CVSROOT: /sources/gnash Module name: gnash Changes by: Rob Savoye <rsavoye> 07/12/11 04:13:47
Modified files: cygnal/testsuite/cygnal.all: test_http.cpp . : ChangeLog Log message: * cygnal/testsuite/cygnal.all/test_http.cpp: Add extracing fields from an HTTP header tests to go with the ones that create the same fields. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/testsuite/cygnal.all/test_http.cpp?cvsroot=gnash&r1=1.1&r2=1.2 http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5125&r2=1.5126 Patches: Index: cygnal/testsuite/cygnal.all/test_http.cpp =================================================================== RCS file: /sources/gnash/gnash/cygnal/testsuite/cygnal.all/test_http.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- cygnal/testsuite/cygnal.all/test_http.cpp 11 Dec 2007 03:23:03 -0000 1.1 +++ cygnal/testsuite/cygnal.all/test_http.cpp 11 Dec 2007 04:13:46 -0000 1.2 @@ -263,6 +263,103 @@ } regfree(®ex_pat); + // + // Decoding tests for HTTP + // + const char *buffer = "GET /software/gnash/tests/flvplayer.swf?file=http://localhost/software/gnash/tests/Ouray_Ice_Festival_Climbing_Competition.flv HTTP/1.1" +"User-Agent: Gnash/0.8.1-cvs (X11; Linux i686; U; en)"; +"Host: localhost:4080" +"Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1" +"Accept-Language: en-US,en;q=0.9" +"Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1" +"Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0" +"If-Modified-Since: Mon, 10 Dec 2007 02:26:31 GMT" +"If-None-Match: \"4cc434-e266-52ff63c0\"" +"Connection: Keep-Alive, TE" +"Referer: http://localhost/software/gnash/tests/index.html" +"TE: deflate, gzip, chunked, identity, trailers" + ; +// Some browsers have a different synatax, of course, to keep things +// interesting. + const char *buffer2 = "GET /software/gnash/tests/flvplayer.swf?file=http://localhost/software/gnash/tests/Ouray_Ice_Festival_Climbing_Competition.flv HTTP/1.1" +"Content-Language: en-US,en;q=0.9" +"Content-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1" +"Content-Encoding: deflate, gzip, x-gzip, identity, *;q=0"; +// http.extractMethod(buffer); + string result; + result = http.extractReferer(buffer); + if (result == "http://localhost/software/gnash/tests/index.html") { + runtest.fail ("Date::extractReferer()"); + } else { + runtest.pass ("Date::extractReferer()"); + } + result = http.extractHost(buffer); + if (result == "localhost:4080") { + runtest.fail ("Date::extractHost()"); + } else { + runtest.pass ("Date::extractHost()"); + } + + result = http.extractAgent(buffer); + if (result == "Gnash/0.8.1-cvs (X11; Linux i686; U; en)") { + runtest.fail ("Date::extractAgent()"); + } else { + runtest.pass ("Date::extractAgent()"); + } + + result = http.extractLanguage(buffer); + if (result == "en-US,en;q=0.9") { + runtest.fail ("Date::extractLanguage(Accept-)"); + } else { + runtest.pass ("Date::extractLanguage(Accept-)"); + } + result = http.extractLanguage(buffer2); + if (result == "en-US,en;q=0.9") { + runtest.fail ("Date::extractLanguage(Content-)"); + } else { + runtest.pass ("Date::extractLanguage(Content-)"); + } + + result = http.extractCharset(buffer); + if (result == "iso-8859-1, utf-8, utf-16, *;q=0.1") { + runtest.fail ("Date::extractCharset(Accept-)"); + } else { + runtest.pass ("Date::extractCharset(Accept-)"); + } + result = http.extractCharset(buffer2); + if (result == "iso-8859-1, utf-8, utf-16, *;q=0.1") { + runtest.fail ("Date::extractCharset(Content-)"); + } else { + runtest.pass ("Date::extractCharset(Content-)"); + } + + result = http.extractConnection(buffer); + if (result == "Keep-Alive, TE") { + runtest.fail ("Date::extractConnection()"); + } else { + runtest.pass ("Date::extractConnection()"); + } + + result = http.extractEncoding(buffer); + if (result == "deflate, gzip, x-gzip, identity, *;q=0") { + runtest.fail ("Date::extractEncoding(Accept-)"); + } else { + runtest.pass ("Date::extractEncoding(Accept-)"); + } + result = http.extractEncoding(buffer2); + if (result == "deflate, gzip, x-gzip, identity, *;q=0") { + runtest.fail ("Date::extractEncoding(Content-)"); + } else { + runtest.pass ("Date::extractEncoding(Content-)"); + } + + result = http.extractTE(buffer); + if (result == "deflate, gzip, chunked, identity, trailers") { + runtest.fail ("Date::extractTE()"); + } else { + runtest.pass ("Date::extractTE()"); + } + // http.formatHeader(666, RTMP); // http.formatRequest("http://localhost:4080", HTTP::GET); Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.5125 retrieving revision 1.5126 diff -u -b -r1.5125 -r1.5126 --- ChangeLog 11 Dec 2007 03:23:01 -0000 1.5125 +++ ChangeLog 11 Dec 2007 04:13:46 -0000 1.5126 @@ -1,5 +1,9 @@ 2007-12-10 Rob Savoye <[EMAIL PROTECTED]> + * cygnal/testsuite/cygnal.all/test_http.cpp: Add extracing fields + from an HTTP header tests to go with the ones that create the same + fields. + * cygnal/cygnal.cpp: Use a cygnal-dbg.log file instead of gnash-dbg.log. Use boost bind variables for all threads. * cygnal/http.{cpp,h}: Add methods for encoding HTTP header _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit