mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-31 22:04:04 -06:00
Creating the *real* autotest nest
git-svn-id: svn://ultimatepp.org/upp/trunk@7141 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
dc9a464a45
commit
6d3aa8ba61
230 changed files with 9963 additions and 73 deletions
49
autotest/HttpRequest/HttpRequest.cpp
Normal file
49
autotest/HttpRequest/HttpRequest.cpp
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#define LLOG(x) RLOG(x)
|
||||
#define LDUMP(x) RDUMP(x)
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
StdLogSetup(LOG_COUT|LOG_FILE);
|
||||
HttpRequest::Trace();
|
||||
const Tuple2<const char *, const char *> x[] = {
|
||||
{ "https://www.servis24.cz", "" },
|
||||
{ "rcmania.cz", "</html>" },
|
||||
// { "http://www.facebook.com/pages/Upp", "" },
|
||||
{ "www.oexchange.org", "" },
|
||||
{ "http://pagead2.googlesyndication.com/pagead/show_ads.js", "" },
|
||||
{ "www.ultimatepp.org", "</script></BODY>" },
|
||||
{ "www.idnes.cz", "</html>" },
|
||||
{ "www.google.com", "</script>" },
|
||||
{ "http://wattsupwiththat.com/", "</html>" },
|
||||
{ "http://www.rcalbum.com", "</html>" },
|
||||
};
|
||||
for(int nd = 0; nd < 1; nd++)
|
||||
for(int i = 0; i < __countof(x); i++) {
|
||||
LLOG("=============================================");
|
||||
LLOG("URL: " << x[i].a);
|
||||
HttpRequest h(x[i].a);
|
||||
if(nd)
|
||||
h.Timeout(0);
|
||||
if(IsNull(h.Execute())) {
|
||||
DUMP(~h);
|
||||
LLOG("Error:\n" << h.GetErrorDesc());
|
||||
NEVER();
|
||||
}
|
||||
if((~h).Find(x[i].b) < 0) {
|
||||
LLOG("Content:\n" << ~h);
|
||||
NEVER();
|
||||
}
|
||||
}
|
||||
{
|
||||
HttpRequest h("www.idnes.cz");
|
||||
h.MaxContentSize(10000);
|
||||
h.Execute();
|
||||
ASSERT(h.IsError());
|
||||
LDUMP(h.GetError());
|
||||
}
|
||||
LLOG("*********** Everything is OK");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue