------------------------------------------------------------ revno: 13139 revision-id: kinkie@squid-cache.org-20131118170355-9xid3c8amxstwl2z parent: rousskov@measurement-factory.com-20131118155505-y5bsj9mxs73sq3nd committer: Francesco Chemolli branch nick: trunk timestamp: Mon 2013-11-18 18:03:55 +0100 message: Use CPPUNIT_ASSERT_EQUAL wherever it makes sense in unit tests ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: kinkie@squid-cache.org-20131118170355-9xid3c8amxstwl2z # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 3bce5d9945b448f438720bf2500b87094b27461a # timestamp: 2013-11-18 17:53:45 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: rousskov@measurement-factory.com-20131118155505-\ # y5bsj9mxs73sq3nd # # Begin patch === modified file 'src/tests/testACLMaxUserIP.cc' --- src/tests/testACLMaxUserIP.cc 2013-10-25 00:13:46 +0000 +++ src/tests/testACLMaxUserIP.cc 2013-11-18 17:03:55 +0000 @@ -19,11 +19,11 @@ { ACLMaxUserIP anACL("max_user_ip"); /* 0 is not a valid maximum, so we start at 0 */ - CPPUNIT_ASSERT(anACL.getMaximum() == 0); + CPPUNIT_ASSERT_EQUAL(0,anACL.getMaximum()); /* and we have no option to turn strict OFF, so start ON. */ - CPPUNIT_ASSERT(anACL.getStrict() == false); + CPPUNIT_ASSERT_EQUAL(0,anACL.getStrict()); /* an unparsed acl must not be valid - there is no sane default */ - CPPUNIT_ASSERT(!anACL.valid()); + CPPUNIT_ASSERT_EQUAL(false,anACL.valid()); } void @@ -36,10 +36,10 @@ ACLMaxUserIP anACL("max_user_ip"); anACL.parse(); /* we want a maximum of one, and strict to be true */ - CPPUNIT_ASSERT(anACL.getMaximum() == 1); - CPPUNIT_ASSERT(anACL.getStrict() == true); + CPPUNIT_ASSERT_EQUAL(1,anACL.getMaximum()); + CPPUNIT_ASSERT_EQUAL(1,anACL.getStrict()); /* the acl must be vaid */ - CPPUNIT_ASSERT(anACL.valid()); + CPPUNIT_ASSERT_EQUAL(true,anACL.valid()); xfree(line); } === modified file 'src/tests/testBoilerplate.cc' --- src/tests/testBoilerplate.cc 2012-08-28 13:00:30 +0000 +++ src/tests/testBoilerplate.cc 2013-11-18 17:03:55 +0000 @@ -12,5 +12,5 @@ void testBoilerplate::testDemonstration() { - CPPUNIT_ASSERT(0 == 0); + CPPUNIT_ASSERT_EQUAL(0, 0); } === modified file 'src/tests/testConfigParser.cc' --- src/tests/testConfigParser.cc 2013-10-25 00:13:46 +0000 +++ src/tests/testConfigParser.cc 2013-11-18 17:03:55 +0000 @@ -54,24 +54,24 @@ void testConfigParser::testParseQuoted() { // SingleToken - CPPUNIT_ASSERT(doParseQuotedTest("SingleToken", "SingleToken")); + CPPUNIT_ASSERT_EQUAL(true, doParseQuotedTest("SingleToken", "SingleToken")); // This is a quoted "string" by me - CPPUNIT_ASSERT(doParseQuotedTest("\"This is a quoted \\\"string\\\" by me\"", + CPPUNIT_ASSERT_EQUAL(true, doParseQuotedTest("\"This is a quoted \\\"string\\\" by me\"", "This is a quoted \"string\" by me")); // escape sequence test: \\"\"\\" - CPPUNIT_ASSERT(doParseQuotedTest("\"escape sequence test: \\\\\\\\\\\"\\\\\\\"\\\\\\\\\\\"\"", + CPPUNIT_ASSERT_EQUAL(true, doParseQuotedTest("\"escape sequence test: \\\\\\\\\\\"\\\\\\\"\\\\\\\\\\\"\"", "escape sequence test: \\\\\"\\\"\\\\\"")); // \beginning and end test" - CPPUNIT_ASSERT(doParseQuotedTest("\"\\\\beginning and end test\\\"\"", + CPPUNIT_ASSERT_EQUAL(true, doParseQuotedTest("\"\\\\beginning and end test\\\"\"", "\\beginning and end test\"")); // " - CPPUNIT_ASSERT(doParseQuotedTest("\"\\\"\"", "\"")); + CPPUNIT_ASSERT_EQUAL(true, doParseQuotedTest("\"\\\"\"", "\"")); /* \ */ - CPPUNIT_ASSERT(doParseQuotedTest("\"\\\\\"", "\\")); + CPPUNIT_ASSERT_EQUAL(true, doParseQuotedTest("\"\\\\\"", "\\")); } === modified file 'src/tests/testHttpParser.cc' --- src/tests/testHttpParser.cc 2013-11-13 04:20:41 +0000 +++ src/tests/testHttpParser.cc 2013-11-18 17:03:55 +0000 @@ -43,13 +43,13 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET /\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0,memcmp("GET /\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start], (output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start], (output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start], (output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start], (output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(-1, output.req.v_start); CPPUNIT_ASSERT_EQUAL(-1, output.req.v_end); CPPUNIT_ASSERT_EQUAL(0, output.req.v_maj); @@ -66,13 +66,13 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET /\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0,memcmp("GET /\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start], (output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start], (output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start], (output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start], (output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(-1, output.req.v_start); CPPUNIT_ASSERT_EQUAL(-1, output.req.v_end); CPPUNIT_ASSERT_EQUAL(0, output.req.v_maj); @@ -89,16 +89,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/1.0\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/1.0\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(6, output.req.v_start); CPPUNIT_ASSERT_EQUAL(13, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.0", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.0", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(0, output.req.v_min); input.reset(); @@ -112,16 +112,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/1.1\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/1.1\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(6, output.req.v_start); CPPUNIT_ASSERT_EQUAL(13, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(1, output.req.v_min); input.reset(); @@ -135,16 +135,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/1.2\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/1.2\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(6, output.req.v_start); CPPUNIT_ASSERT_EQUAL(13, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.2", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.2", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(2, output.req.v_min); input.reset(); @@ -160,16 +160,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/10.12\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/10.12\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(6, output.req.v_start); CPPUNIT_ASSERT_EQUAL(15, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/10.12", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/10.12", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(10, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(12, output.req.v_min); input.reset(); @@ -185,27 +185,27 @@ CPPUNIT_ASSERT_EQUAL(1, HttpParserParseReqLine(&output)); CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(12, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/ FOO/1.0", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/ FOO/1.0", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(9, output.req.v_min); #else CPPUNIT_ASSERT_EQUAL(-1, HttpParserParseReqLine(&output)); CPPUNIT_ASSERT_EQUAL(Http::scHttpVersionNotSupported, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(0, output.req.v_min); #endif CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / FOO/1.0\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / FOO/1.0\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(6, output.req.v_start); CPPUNIT_ASSERT_EQUAL(12, output.req.v_end); - CPPUNIT_ASSERT(memcmp("FOO/1.0", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("FOO/1.0", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); input.reset(); } @@ -218,16 +218,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scHttpVersionNotSupported, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(6, output.req.v_start); CPPUNIT_ASSERT_EQUAL(10, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(0, output.req.v_min); input.reset(); @@ -242,16 +242,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scHttpVersionNotSupported, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(6, output.req.v_start); CPPUNIT_ASSERT_EQUAL(12, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(0, output.req.v_min); input.reset(); @@ -266,16 +266,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scHttpVersionNotSupported, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/11\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/11\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(6, output.req.v_start); CPPUNIT_ASSERT_EQUAL(12, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/11", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/11", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(0, output.req.v_min); input.reset(); @@ -290,16 +290,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scHttpVersionNotSupported, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/-999999.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/-999999.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(6, output.req.v_start); CPPUNIT_ASSERT_EQUAL(19, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/-999999.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/-999999.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(0, output.req.v_min); input.reset(); @@ -314,16 +314,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scHttpVersionNotSupported, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/1.\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/1.\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(6, output.req.v_start); CPPUNIT_ASSERT_EQUAL(12, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(0, output.req.v_min); input.reset(); @@ -338,16 +338,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scHttpVersionNotSupported, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/1.-999999\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/1.-999999\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(6, output.req.v_start); CPPUNIT_ASSERT_EQUAL(19, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.-999999", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.-999999", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(0, output.req.v_min); input.reset(); @@ -373,16 +373,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/1.1\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/1.1\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(5, output.req.u_start); CPPUNIT_ASSERT_EQUAL(5, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(11, output.req.v_start); CPPUNIT_ASSERT_EQUAL(18, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(1, output.req.v_min); input.reset(); @@ -397,16 +397,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET /fo o/ HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0,memcmp("GET /fo o/ HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(9, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/fo o/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/fo o/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(11, output.req.v_start); CPPUNIT_ASSERT_EQUAL(18, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(1, output.req.v_min); input.reset(); @@ -421,16 +421,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-5, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); // strangeness generated by following RFC - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(10, output.req.v_start); CPPUNIT_ASSERT_EQUAL(17, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(1, output.req.v_min); input.reset(); @@ -456,16 +456,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(6, output.req.v_start); CPPUNIT_ASSERT_EQUAL(13, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(1, output.req.v_min); input.reset(); @@ -480,16 +480,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-2, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(6, output.req.v_start); CPPUNIT_ASSERT_EQUAL(13, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(1, output.req.v_min); input.reset(); @@ -506,16 +506,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/1.1\r\r\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/1.1\r\r\r\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(4, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(6, output.req.v_start); CPPUNIT_ASSERT_EQUAL(13, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(1, output.req.v_min); input.reset(); @@ -554,13 +554,13 @@ CPPUNIT_ASSERT_EQUAL(Http::scBadRequest, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/1.1 \n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/1.1 \n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(13, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/ HTTP/1.1", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/ HTTP/1.1", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(-1, output.req.v_start); CPPUNIT_ASSERT_EQUAL(-1, output.req.v_end); CPPUNIT_ASSERT_EQUAL(0, output.req.v_maj); @@ -659,16 +659,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp(". / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp(". / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(0, output.req.m_end); - CPPUNIT_ASSERT(memcmp(".", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp(".", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(2, output.req.u_start); CPPUNIT_ASSERT_EQUAL(2, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.v_start); CPPUNIT_ASSERT_EQUAL(11, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(1, output.req.v_min); input.reset(); @@ -683,16 +683,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("OPTIONS * HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("OPTIONS * HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(6, output.req.m_end); - CPPUNIT_ASSERT(memcmp("OPTIONS", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("OPTIONS", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(8, output.req.u_start); CPPUNIT_ASSERT_EQUAL(8, output.req.u_end); - CPPUNIT_ASSERT(memcmp("*", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("*", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(10, output.req.v_start); CPPUNIT_ASSERT_EQUAL(17, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(1, output.req.v_min); input.reset(); @@ -707,16 +707,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("HELLOWORLD / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HELLOWORLD / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(9, output.req.m_end); - CPPUNIT_ASSERT(memcmp("HELLOWORLD", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HELLOWORLD", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(11, output.req.u_start); CPPUNIT_ASSERT_EQUAL(11, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(13, output.req.v_start); CPPUNIT_ASSERT_EQUAL(20, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(1, output.req.v_min); input.reset(); @@ -731,7 +731,7 @@ CPPUNIT_ASSERT_EQUAL(Http::scBadRequest, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("A\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("A\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(-1, output.req.m_end); CPPUNIT_ASSERT_EQUAL(-1, output.req.u_start); @@ -751,7 +751,7 @@ CPPUNIT_ASSERT_EQUAL(Http::scBadRequest, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(-1, output.req.m_end); CPPUNIT_ASSERT_EQUAL(-1, output.req.u_start); @@ -773,16 +773,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(1, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.m_start); CPPUNIT_ASSERT_EQUAL(3, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(5, output.req.u_start); CPPUNIT_ASSERT_EQUAL(5, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(7, output.req.v_start); CPPUNIT_ASSERT_EQUAL(14, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(1, output.req.v_min); input.reset(); @@ -798,7 +798,7 @@ CPPUNIT_ASSERT_EQUAL(Http::scBadRequest, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp(" GET / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp(" GET / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(-1, output.req.m_end); CPPUNIT_ASSERT_EQUAL(-1, output.req.u_start); @@ -819,16 +819,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("\tGET / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("\tGET / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(3, output.req.m_end); - CPPUNIT_ASSERT(memcmp("\tGET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("\tGET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(5, output.req.u_start); CPPUNIT_ASSERT_EQUAL(5, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(7, output.req.v_start); CPPUNIT_ASSERT_EQUAL(14, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(1, output.req.v_min); input.reset(); @@ -855,13 +855,13 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("/ HTTP/1.0\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/ HTTP/1.0\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(0, output.req.m_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(2, output.req.u_start); CPPUNIT_ASSERT_EQUAL(9, output.req.u_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.0", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.0", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(-1, output.req.v_start); CPPUNIT_ASSERT_EQUAL(-1, output.req.v_end); CPPUNIT_ASSERT_EQUAL(0, output.req.v_maj); @@ -880,13 +880,13 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(1, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("/ HTTP/1.0\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/ HTTP/1.0\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.m_start); CPPUNIT_ASSERT_EQUAL(1, output.req.m_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(3, output.req.u_start); CPPUNIT_ASSERT_EQUAL(10, output.req.u_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.0", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.0", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(-1, output.req.v_start); CPPUNIT_ASSERT_EQUAL(-1, output.req.v_end); CPPUNIT_ASSERT_EQUAL(0, output.req.v_maj); @@ -905,7 +905,7 @@ CPPUNIT_ASSERT_EQUAL(Http::scBadRequest, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp(" / HTTP/1.0\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp(" / HTTP/1.0\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(-1, output.req.m_end); CPPUNIT_ASSERT_EQUAL(-1, output.req.u_start); @@ -926,16 +926,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET\x0B / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET\x0B / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(3, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET\x0B", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET\x0B", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(5, output.req.u_start); CPPUNIT_ASSERT_EQUAL(5, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(7, output.req.v_start); CPPUNIT_ASSERT_EQUAL(14, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(1, output.req.v_min); input.reset(); @@ -971,16 +971,16 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET\0 / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET\0 / HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(3, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET\0", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET\0", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(5, output.req.u_start); CPPUNIT_ASSERT_EQUAL(5, output.req.u_end); - CPPUNIT_ASSERT(memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("/", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(7, output.req.v_start); CPPUNIT_ASSERT_EQUAL(14, output.req.v_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.v_start],(output.req.v_end-output.req.v_start+1))); CPPUNIT_ASSERT_EQUAL(1, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(1, output.req.v_min); input.reset(); @@ -995,14 +995,14 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(5, output.req.u_start); CPPUNIT_ASSERT_EQUAL(12, output.req.u_end); CPPUNIT_ASSERT_EQUAL(-1, output.req.v_start); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(-1, output.req.v_end); CPPUNIT_ASSERT_EQUAL(0, output.req.v_maj); CPPUNIT_ASSERT_EQUAL(9, output.req.v_min); @@ -1018,13 +1018,13 @@ CPPUNIT_ASSERT_EQUAL(Http::scOkay, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("GET HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET HTTP/1.1\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(2, output.req.m_end); - CPPUNIT_ASSERT(memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("GET", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(4, output.req.u_start); CPPUNIT_ASSERT_EQUAL(11, output.req.u_end); - CPPUNIT_ASSERT(memcmp("HTTP/1.1", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("HTTP/1.1", &output.buf[output.req.u_start],(output.req.u_end-output.req.u_start+1))); CPPUNIT_ASSERT_EQUAL(-1, output.req.v_start); CPPUNIT_ASSERT_EQUAL(-1, output.req.v_end); CPPUNIT_ASSERT_EQUAL(0, output.req.v_maj); @@ -1041,7 +1041,7 @@ CPPUNIT_ASSERT_EQUAL(Http::scBadRequest, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("\xB\xC\xE\xF\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("\xB\xC\xE\xF\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(-1, output.req.m_end); CPPUNIT_ASSERT_EQUAL(-1, output.req.u_start); @@ -1064,10 +1064,10 @@ CPPUNIT_ASSERT_EQUAL(Http::scBadRequest, output.request_parse_status); CPPUNIT_ASSERT_EQUAL(0, output.req.start); CPPUNIT_ASSERT_EQUAL((int)input.contentSize()-1, output.req.end); - CPPUNIT_ASSERT(memcmp("\t \t \t\n", &output.buf[output.req.start],(output.req.end-output.req.start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("\t \t \t\n", &output.buf[output.req.start],(output.req.end-output.req.start+1))); CPPUNIT_ASSERT_EQUAL(0, output.req.m_start); CPPUNIT_ASSERT_EQUAL(0, output.req.m_end); - CPPUNIT_ASSERT(memcmp("\t", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1)) == 0); + CPPUNIT_ASSERT_EQUAL(0, memcmp("\t", &output.buf[output.req.m_start],(output.req.m_end-output.req.m_start+1))); CPPUNIT_ASSERT_EQUAL(-1, output.req.u_start); CPPUNIT_ASSERT_EQUAL(-1, output.req.u_end); CPPUNIT_ASSERT_EQUAL(-1, output.req.v_start); === modified file 'src/tests/testRock.cc' --- src/tests/testRock.cc 2013-07-21 19:24:35 +0000 +++ src/tests/testRock.cc 2013-11-18 17:03:55 +0000 @@ -222,7 +222,7 @@ { struct stat sb; - CPPUNIT_ASSERT(::stat(TESTDIR, &sb) == 0); + CPPUNIT_ASSERT_EQUAL(0, ::stat(TESTDIR, &sb)); /* TODO: check the size */ @@ -240,8 +240,8 @@ StoreEntry *const pe = addEntry(i); - CPPUNIT_ASSERT(pe->swap_status == SWAPOUT_WRITING); - CPPUNIT_ASSERT(pe->swap_dirn == 0); + CPPUNIT_ASSERT_EQUAL(SWAPOUT_WRITING, pe->swap_status); + CPPUNIT_ASSERT_EQUAL(0, pe->swap_dirn); CPPUNIT_ASSERT(pe->swap_filen >= 0); // Rock::IoState::finishedWriting() schedules an AsyncCall @@ -249,7 +249,7 @@ StockEventLoop loop; loop.run(); - CPPUNIT_ASSERT(pe->swap_status == SWAPOUT_DONE); + CPPUNIT_ASSERT_EQUAL(SWAPOUT_DONE, pe->swap_status); pe->unlock(); } @@ -260,31 +260,30 @@ { StoreEntry *const pe = addEntry(4); - CPPUNIT_ASSERT(pe->swap_status == SWAPOUT_WRITING); - CPPUNIT_ASSERT(pe->swap_dirn == 0); + CPPUNIT_ASSERT_EQUAL(SWAPOUT_WRITING, pe->swap_status); + CPPUNIT_ASSERT_EQUAL(0, pe->swap_dirn); CPPUNIT_ASSERT(pe->swap_filen >= 0); StockEventLoop loop; loop.run(); - CPPUNIT_ASSERT(pe->swap_status == SWAPOUT_DONE); + CPPUNIT_ASSERT_EQUAL(SWAPOUT_DONE, pe->swap_status); } // try to swap out entry to a used locked slot { StoreEntry *const pe = addEntry(5); - CPPUNIT_ASSERT(pe->swap_status == SWAPOUT_WRITING); - CPPUNIT_ASSERT(pe->swap_dirn == 0); + CPPUNIT_ASSERT_EQUAL(SWAPOUT_WRITING, pe->swap_status); + CPPUNIT_ASSERT_EQUAL(0, pe->swap_dirn); CPPUNIT_ASSERT(pe->swap_filen >= 0); // the slot is locked here because the async calls have not run yet StoreEntry *const pe2 = addEntry(5); - CPPUNIT_ASSERT(pe2->swap_status == SWAPOUT_NONE); - CPPUNIT_ASSERT(pe2->mem_obj->swapout.decision == - MemObject::SwapOut::swImpossible); - CPPUNIT_ASSERT(pe2->swap_dirn == -1); - CPPUNIT_ASSERT(pe2->swap_filen == -1); + CPPUNIT_ASSERT_EQUAL(SWAPOUT_NONE, pe2->swap_status); + CPPUNIT_ASSERT_EQUAL(MemObject::SwapOut::swImpossible, pe2->mem_obj->swapout.decision); + CPPUNIT_ASSERT_EQUAL(-1, pe2->swap_dirn); + CPPUNIT_ASSERT_EQUAL(-1, pe2->swap_filen); StockEventLoop loop; loop.run(); @@ -300,6 +299,6 @@ pe->unlink(); StoreEntry *const pe2 = getEntry(i); - CPPUNIT_ASSERT(pe2 == NULL); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), pe2); } } === modified file 'src/tests/testStore.cc' --- src/tests/testStore.cc 2013-10-25 00:13:46 +0000 +++ src/tests/testStore.cc 2013-11-18 17:03:55 +0000 @@ -79,7 +79,7 @@ StorePointer aStore(new TestStore); Store::Root(aStore); - CPPUNIT_ASSERT(&Store::Root() == aStore.getRaw()); + CPPUNIT_ASSERT_EQUAL(&Store::Root(),aStore.getRaw()); Store::Root(NULL); } @@ -90,7 +90,7 @@ StorePointer aStore2(new TestStore); Store::Root(aStore); Store::Root(aStore2); - CPPUNIT_ASSERT(&Store::Root() == aStore2.getRaw()); + CPPUNIT_ASSERT_EQUAL(&Store::Root(),aStore2.getRaw()); Store::Root(NULL); } @@ -99,9 +99,9 @@ { TestStorePointer aStore(new TestStore); Store::Root(aStore.getRaw()); - CPPUNIT_ASSERT(aStore->statsCalled == false); + CPPUNIT_ASSERT_EQUAL(false, aStore->statsCalled); Store::Stats(NullStoreEntry::getInstance()); - CPPUNIT_ASSERT(aStore->statsCalled == true); + CPPUNIT_ASSERT_EQUAL(true, aStore->statsCalled); Store::Root(NULL); } @@ -110,6 +110,6 @@ { StorePointer aStore(new TestStore); Store::Root(aStore.getRaw()); - CPPUNIT_ASSERT(aStore->maxSize() == 3); + CPPUNIT_ASSERT_EQUAL(static_cast(3), aStore->maxSize()); Store::Root(NULL); } === modified file 'src/tests/testStoreController.cc' --- src/tests/testStoreController.cc 2013-10-25 00:13:46 +0000 +++ src/tests/testStoreController.cc 2013-11-18 17:03:55 +0000 @@ -31,12 +31,12 @@ TestSwapDirPointer aStore2 (new TestSwapDir); addSwapDir(aStore); addSwapDir(aStore2); - CPPUNIT_ASSERT(aStore->statsCalled == false); - CPPUNIT_ASSERT(aStore2->statsCalled == false); + CPPUNIT_ASSERT_EQUAL(false, aStore->statsCalled); + CPPUNIT_ASSERT_EQUAL(false, aStore2->statsCalled); Store::Stats(logEntry); free_cachedir(&Config.cacheSwap); - CPPUNIT_ASSERT(aStore->statsCalled == true); - CPPUNIT_ASSERT(aStore2->statsCalled == true); + CPPUNIT_ASSERT_EQUAL(true, aStore->statsCalled); + CPPUNIT_ASSERT_EQUAL(true, aStore2->statsCalled); Store::Root(NULL); } @@ -71,7 +71,7 @@ TestSwapDirPointer aStore2 (new TestSwapDir); addSwapDir(aStore); addSwapDir(aStore2); - CPPUNIT_ASSERT(Store::Root().maxSize() == 6); + CPPUNIT_ASSERT_EQUAL(static_cast(6), Store::Root().maxSize()); free_cachedir(&Config.cacheSwap); Store::Root(NULL); } @@ -140,47 +140,47 @@ StoreSearchPointer search = aRoot->search (NULL, NULL); /* search for everything in the store */ /* nothing should be immediately available */ - CPPUNIT_ASSERT(search->error() == false); - CPPUNIT_ASSERT(search->isDone() == false); - CPPUNIT_ASSERT(search->currentItem() == NULL); + CPPUNIT_ASSERT_EQUAL(false, search->error()); + CPPUNIT_ASSERT_EQUAL(false, search->isDone()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), search->currentItem()); #if 0 - CPPUNIT_ASSERT(search->next() == false); + CPPUNIT_ASSERT_EQUAL(false, search->next()); #endif /* trigger a callback */ cbcalled = false; search->next(searchCallback, NULL); - CPPUNIT_ASSERT(cbcalled == true); + CPPUNIT_ASSERT_EQUAL(true, cbcalled); /* we should have access to a entry now, that matches the entry we had before */ - CPPUNIT_ASSERT(search->error() == false); - CPPUNIT_ASSERT(search->isDone() == false); + CPPUNIT_ASSERT_EQUAL(false, search->error()); + CPPUNIT_ASSERT_EQUAL(false, search->isDone()); /* note the hash order is random - the test happens to be in a nice order */ - CPPUNIT_ASSERT(search->currentItem() == entry1); - //CPPUNIT_ASSERT(search->next() == false); + CPPUNIT_ASSERT_EQUAL(entry1, search->currentItem()); + //CPPUNIT_ASSERT_EQUAL(false, search->next()); /* trigger another callback */ cbcalled = false; search->next(searchCallback, NULL); - CPPUNIT_ASSERT(cbcalled == true); + CPPUNIT_ASSERT_EQUAL(true, cbcalled); /* we should have access to a entry now, that matches the entry we had before */ - CPPUNIT_ASSERT(search->error() == false); - CPPUNIT_ASSERT(search->isDone() == false); - CPPUNIT_ASSERT(search->currentItem() == entry2); - //CPPUNIT_ASSERT(search->next() == false); + CPPUNIT_ASSERT_EQUAL(false, search->error()); + CPPUNIT_ASSERT_EQUAL(false, search->isDone()); + CPPUNIT_ASSERT_EQUAL(entry2, search->currentItem()); + //CPPUNIT_ASSERT_EQUAL(false, search->next()); /* trigger another callback */ cbcalled = false; search->next(searchCallback, NULL); - CPPUNIT_ASSERT(cbcalled == true); + CPPUNIT_ASSERT_EQUAL(true, cbcalled); /* now we should have no error, we should have finished and have no current item */ - CPPUNIT_ASSERT(search->error() == false); - CPPUNIT_ASSERT(search->isDone() == true); - CPPUNIT_ASSERT(search->currentItem() == NULL); - //CPPUNIT_ASSERT(search->next() == false); + CPPUNIT_ASSERT_EQUAL(false, search->error()); + CPPUNIT_ASSERT_EQUAL(true, search->isDone()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), search->currentItem()); + //CPPUNIT_ASSERT_EQUAL(false, search->next()); Store::Root(NULL); } === modified file 'src/tests/testStoreHashIndex.cc' --- src/tests/testStoreHashIndex.cc 2013-10-25 00:13:46 +0000 +++ src/tests/testStoreHashIndex.cc 2013-11-18 17:03:55 +0000 @@ -32,12 +32,12 @@ TestSwapDirPointer aStore2 (new TestSwapDir); addSwapDir(aStore); addSwapDir(aStore2); - CPPUNIT_ASSERT(aStore->statsCalled == false); - CPPUNIT_ASSERT(aStore2->statsCalled == false); + CPPUNIT_ASSERT_EQUAL(false, aStore->statsCalled); + CPPUNIT_ASSERT_EQUAL(false, aStore2->statsCalled); Store::Stats(logEntry); free_cachedir(&Config.cacheSwap); - CPPUNIT_ASSERT(aStore->statsCalled == true); - CPPUNIT_ASSERT(aStore2->statsCalled == true); + CPPUNIT_ASSERT_EQUAL(true, aStore->statsCalled); + CPPUNIT_ASSERT_EQUAL(true, aStore2->statsCalled); Store::Root(NULL); } @@ -52,7 +52,7 @@ TestSwapDirPointer aStore2 (new TestSwapDir); addSwapDir(aStore); addSwapDir(aStore2); - CPPUNIT_ASSERT(Store::Root().maxSize() == 6); + CPPUNIT_ASSERT_EQUAL(static_cast(6), Store::Root().maxSize()); free_cachedir(&Config.cacheSwap); Store::Root(NULL); } @@ -137,47 +137,47 @@ StoreSearchPointer search = aRoot->search (NULL, NULL); /* search for everything in the store */ /* nothing should be immediately available */ - CPPUNIT_ASSERT(search->error() == false); - CPPUNIT_ASSERT(search->isDone() == false); - CPPUNIT_ASSERT(search->currentItem() == NULL); + CPPUNIT_ASSERT_EQUAL(false, search->error()); + CPPUNIT_ASSERT_EQUAL(false, search->isDone()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), search->currentItem()); #if 0 - CPPUNIT_ASSERT(search->next() == false); + CPPUNIT_ASSERT_EQUAL(false, search->next()); #endif /* trigger a callback */ cbcalled = false; search->next(searchCallback, NULL); - CPPUNIT_ASSERT(cbcalled == true); + CPPUNIT_ASSERT_EQUAL(true, cbcalled); /* we should have access to a entry now, that matches the entry we had before */ - CPPUNIT_ASSERT(search->error() == false); - CPPUNIT_ASSERT(search->isDone() == false); + CPPUNIT_ASSERT_EQUAL(false, search->error()); + CPPUNIT_ASSERT_EQUAL(false, search->isDone()); /* note the hash order is random - the test happens to be in a nice order */ - CPPUNIT_ASSERT(search->currentItem() == entry1); - //CPPUNIT_ASSERT(search->next() == false); + CPPUNIT_ASSERT_EQUAL(entry1, search->currentItem()); + //CPPUNIT_ASSERT_EQUAL(false, search->next()); /* trigger another callback */ cbcalled = false; search->next(searchCallback, NULL); - CPPUNIT_ASSERT(cbcalled == true); + CPPUNIT_ASSERT_EQUAL(true, cbcalled); /* we should have access to a entry now, that matches the entry we had before */ - CPPUNIT_ASSERT(search->error() == false); - CPPUNIT_ASSERT(search->isDone() == false); - CPPUNIT_ASSERT(search->currentItem() == entry2); - //CPPUNIT_ASSERT(search->next() == false); + CPPUNIT_ASSERT_EQUAL(false, search->error()); + CPPUNIT_ASSERT_EQUAL(false, search->isDone()); + CPPUNIT_ASSERT_EQUAL(entry2, search->currentItem()); + //CPPUNIT_ASSERT_EQUAL(false, search->next()); /* trigger another callback */ cbcalled = false; search->next(searchCallback, NULL); - CPPUNIT_ASSERT(cbcalled == true); + CPPUNIT_ASSERT_EQUAL(true, cbcalled); /* now we should have no error, we should have finished and have no current item */ - CPPUNIT_ASSERT(search->error() == false); - CPPUNIT_ASSERT(search->isDone() == true); - CPPUNIT_ASSERT(search->currentItem() == NULL); - //CPPUNIT_ASSERT(search->next() == false); + CPPUNIT_ASSERT_EQUAL(false, search->error()); + CPPUNIT_ASSERT_EQUAL(true, search->isDone()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), search->currentItem()); + //CPPUNIT_ASSERT_EQUAL(false, search->next()); Store::Root(NULL); } === modified file 'src/tests/testUfs.cc' --- src/tests/testUfs.cc 2013-07-21 19:24:35 +0000 +++ src/tests/testUfs.cc 2013-11-18 17:03:55 +0000 @@ -163,8 +163,8 @@ pe->timestampsSet(); pe->complete(); pe->swapOut(); - CPPUNIT_ASSERT(pe->swap_dirn == 0); - CPPUNIT_ASSERT(pe->swap_filen == 0); + CPPUNIT_ASSERT_EQUAL(0, pe->swap_dirn); + CPPUNIT_ASSERT_EQUAL(0, pe->swap_filen); pe->unlock(); } @@ -178,34 +178,34 @@ /* nothing should be immediately available */ #if 0 - CPPUNIT_ASSERT(search->next() == false); + CPPUNIT_ASSERT_EQUAL(false, search->next()); #endif - CPPUNIT_ASSERT(search->error() == false); - CPPUNIT_ASSERT(search->isDone() == false); - CPPUNIT_ASSERT(search->currentItem() == NULL); + CPPUNIT_ASSERT_EQUAL(false, search->error()); + CPPUNIT_ASSERT_EQUAL(false, search->isDone()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), search->currentItem()); /* trigger a callback */ cbcalled = false; search->next(searchCallback, NULL); - CPPUNIT_ASSERT(cbcalled == true); + CPPUNIT_ASSERT_EQUAL(true, cbcalled); /* we should have access to a entry now, that matches the entry we had before */ - //CPPUNIT_ASSERT(search->next() == false); - CPPUNIT_ASSERT(search->error() == false); - CPPUNIT_ASSERT(search->isDone() == false); + //CPPUNIT_ASSERT_EQUAL(false, search->next()); + CPPUNIT_ASSERT_EQUAL(false, search->error()); + CPPUNIT_ASSERT_EQUAL(false, search->isDone()); CPPUNIT_ASSERT(search->currentItem() != NULL); /* trigger another callback */ cbcalled = false; search->next(searchCallback, NULL); - CPPUNIT_ASSERT(cbcalled == true); + CPPUNIT_ASSERT_EQUAL(true, cbcalled); /* now we should have no error, we should have finished and have no current item */ - //CPPUNIT_ASSERT(search->next() == false); - CPPUNIT_ASSERT(search->error() == false); - CPPUNIT_ASSERT(search->isDone() == true); - CPPUNIT_ASSERT(search->currentItem() == NULL); + //CPPUNIT_ASSERT_EQUAL(false, search->next()); + CPPUNIT_ASSERT_EQUAL(false, search->error()); + CPPUNIT_ASSERT_EQUAL(true, search->isDone()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), search->currentItem()); Store::Root(NULL); === modified file 'src/tests/testVector.cc' --- src/tests/testVector.cc 2013-05-04 11:50:26 +0000 +++ src/tests/testVector.cc 2013-11-18 17:03:55 +0000 @@ -9,11 +9,11 @@ void testVector::all() { - CPPUNIT_ASSERT( 1 == 1 ); + CPPUNIT_ASSERT_EQUAL(1 , 1); Vector aArray; - CPPUNIT_ASSERT(aArray.size() == 0); + CPPUNIT_ASSERT_EQUAL(static_cast(0), aArray.size()); aArray.push_back(2); - CPPUNIT_ASSERT(aArray.size() == 1); - CPPUNIT_ASSERT(aArray.back() == 2); - CPPUNIT_ASSERT(aArray.size() == 1); + CPPUNIT_ASSERT_EQUAL(static_cast(1), aArray.size()); + CPPUNIT_ASSERT_EQUAL(2, aArray.back()); + CPPUNIT_ASSERT_EQUAL(static_cast(1), aArray.size()); }