diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-03-26 21:17:19 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-03-26 21:17:19 (GMT) |
commit | 405c805f249cacb07f8861d5550abda8f6694d0c (patch) | |
tree | 669743f4b895c063296f0c6799fe698202d34893 /test/src | |
parent | 79b8a7941354416f83aae9cb53fbdf7e680beae2 (diff) | |
download | uscxml-405c805f249cacb07f8861d5550abda8f6694d0c.zip uscxml-405c805f249cacb07f8861d5550abda8f6694d0c.tar.gz uscxml-405c805f249cacb07f8861d5550abda8f6694d0c.tar.bz2 |
Various smaller bug-fixes (see details)
- Pass -DPHP_CONFIG=/usr/bin/zts-php-config for custom php-config
- More php bug fixes
- Fixed nasty "parse from string" bug
- Reindented source code
Diffstat (limited to 'test/src')
-rw-r--r-- | test/src/test-url.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/test/src/test-url.cpp b/test/src/test-url.cpp index f2d0cb9..3165a20 100644 --- a/test/src/test-url.cpp +++ b/test/src/test-url.cpp @@ -13,10 +13,14 @@ using namespace boost; class TestServlet : public HTTPServlet { public: TestServlet(bool adaptPath) : _canAdaptPath(adaptPath) {} - + void httpRecvRequest(const HTTPServer::Request& request) {}; - bool canAdaptPath() { return _canAdaptPath; } - void setURL(const std::string& url) { _actualUrl = url; } + bool canAdaptPath() { + return _canAdaptPath; + } + void setURL(const std::string& url) { + _actualUrl = url; + } std::string _actualUrl; bool _canAdaptPath; @@ -34,13 +38,13 @@ int main(int argc, char** argv) { { TestServlet* testServlet1 = new TestServlet(false); TestServlet* testServlet2 = new TestServlet(false); - + assert(HTTPServer::registerServlet("/foo", testServlet1)); assert(!HTTPServer::registerServlet("/foo", testServlet2)); HTTPServer::unregisterServlet(testServlet1); assert(HTTPServer::registerServlet("/foo", testServlet2)); HTTPServer::unregisterServlet(testServlet1); - + assert(HTTPServer::registerServlet("/foo/bar/", testServlet1)); assert(!HTTPServer::registerServlet("/foo/bar/", testServlet2)); HTTPServer::unregisterServlet(testServlet1); @@ -51,7 +55,7 @@ int main(int argc, char** argv) { TestServlet* testServlet1 = new TestServlet(true); TestServlet* testServlet2 = new TestServlet(true); TestServlet* testServlet3 = new TestServlet(true); - + assert(HTTPServer::registerServlet("/foo", testServlet1)); assert(HTTPServer::registerServlet("/foo", testServlet2)); assert(HTTPServer::registerServlet("/foo", testServlet3)); @@ -63,7 +67,7 @@ int main(int argc, char** argv) { HTTPServer::unregisterServlet(testServlet2); HTTPServer::unregisterServlet(testServlet3); } - + { Data data = Data::fromJSON("asdf"); std::cout << data << std::endl; @@ -93,7 +97,7 @@ int main(int argc, char** argv) { std::stringstream content; content << url; } - + { URL url("https://raw.github.com/tklab-tud/uscxml/master/test/samples/uscxml/test-ecmascript.scxml"); std::cout << url.asString() << std::endl; @@ -102,7 +106,7 @@ int main(int argc, char** argv) { std::stringstream content; content << url; } - + { URL url("file:Document/Text.foo"); std::cout << url.asString() << std::endl; |