diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2012-07-15 20:52:33 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2012-07-15 20:52:33 +0200 |
commit | a08968025b98a50d6dd355cb02599937e178fbbf (patch) | |
tree | e47d75e7f134e9e643e60083fbe9299ae54efdc2 /tests/url | |
parent | 69f32e239eafcfdc2392a8644c6de6ca6dbe83c1 (diff) | |
download | crawler-a08968025b98a50d6dd355cb02599937e178fbbf.tar.gz crawler-a08968025b98a50d6dd355cb02599937e178fbbf.tar.bz2 |
some investemnet in URL parsing
Diffstat (limited to 'tests/url')
-rw-r--r-- | tests/url/GNUmakefile | 25 | ||||
-rw-r--r-- | tests/url/test1.cpp | 24 |
2 files changed, 49 insertions, 0 deletions
diff --git a/tests/url/GNUmakefile b/tests/url/GNUmakefile new file mode 100644 index 0000000..e3913bd --- /dev/null +++ b/tests/url/GNUmakefile @@ -0,0 +1,25 @@ +TOPDIR = ../.. + +SUBDIRS = + +INCLUDE_DIRS = \ + -I$(TOPDIR)/src + +INCLUDE_LDFLAGS = + +INCLUDE_LIBS = + +TEST_CPP_BINS = \ + test1$(EXE) + +OBJS = + +-include $(TOPDIR)/makefiles/gmake/sub.mk + +local_all: + +local_clean: + +local_distclean: + +local_test: diff --git a/tests/url/test1.cpp b/tests/url/test1.cpp new file mode 100644 index 0000000..264bef0 --- /dev/null +++ b/tests/url/test1.cpp @@ -0,0 +1,24 @@ +#include "URL.hpp" + +#include <iostream> +#include <string> + +using namespace std; + +int main( int argc, char *argv[] ) +{ + if( argc != 2 ) { + cerr << "usage: test1 <url>\n" << endl; + return 1; + } + + char *urlstring = argv[1]; + + URL url( urlstring ); + + cout << "protocol: " << url.protocol( ) << endl + << "domain: " << url.domain( ) << endl + << endl; + + return 0; +} |