diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2012-08-09 20:46:45 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2012-08-09 20:46:45 +0200 |
commit | 52f2bae10d5cc91f3048b67aa91541fd7fc2fdaf (patch) | |
tree | ecae7bed31a42377623bef08c92ad6ed98071a02 /tests/typedetect | |
parent | 4553fe0c3c40eb30648c0e7349f94f1458e5f4b1 (diff) | |
download | crawler-52f2bae10d5cc91f3048b67aa91541fd7fc2fdaf.tar.gz crawler-52f2bae10d5cc91f3048b67aa91541fd7fc2fdaf.tar.bz2 |
reverted libmagic test
Diffstat (limited to 'tests/typedetect')
-rw-r--r-- | tests/typedetect/test1.cpp | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/tests/typedetect/test1.cpp b/tests/typedetect/test1.cpp index e76b6d0..3269e54 100644 --- a/tests/typedetect/test1.cpp +++ b/tests/typedetect/test1.cpp @@ -23,7 +23,7 @@ int main( int argc, char *argv[] ) } char *method = argv[1]; - //char *file = argv[2]; + char *file = argv[2]; #ifdef USE_MODULELOADER vector<string> modules; @@ -41,37 +41,16 @@ int main( int argc, char *argv[] ) } #endif -// URL url( "file", "localhost", 0, argv[2], "", "" ); -// FileFetcher fetcher; - URL url( "http", "www.andreasbaumann.cc", 80, "/index.shtml", "", "" ); - LibFetchFetcher fetcher; - RewindInputStream *s = fetcher.fetch( url ); - - cout << "before first detect" << endl; - cout << "s->good( ): " << s->good( ) << endl; - cout << "s->eof( ): " << s->eof( ) << endl; - cout << "rdstate: " << s->rdstate( ) << endl; - - MIMEType type2 = typeDetect->detect( s ); + URL url( "file", "localhost", 0, file, "", "" ); + FileFetcher fetcher; - cout << "after first detect, before first rewind" << endl; - cout << "s->good( ): " << s->good( ) << endl; - cout << "s->eof( ): " << s->eof( ) << endl; - cout << "s->eof( ): " << s->eof( ) << endl; - cout << "rdstate: " << s->rdstate( ) << endl; + /* + URL url( "http", "www.andreasbaumann.cc", 80, "/index.shtml", "", "" ); + LibFetchFetcher fetcher; */ - s->rewind( ); - - cout << "after rewind, before second detect" << endl; - cout << "s->good( ): " << s->good( ) << endl; - cout << "s->eof( ): " << s->eof( ) << endl; - cout << "rdstate: " << s->rdstate( ) << endl; + RewindInputStream *s = fetcher.fetch( url ); MIMEType type = typeDetect->detect( s ); - - cout << "s->good( ): " << s->good( ) << endl; - cout << "s->eof( ): " << s->eof( ) << endl; - cout << "rdstate: " << s->rdstate( ) << endl; delete s; |