mirror of
				https://github.com/pocoproject/poco.git
				synced 2025-10-30 05:29:41 +01:00 
			
		
		
		
	Poco 1.9.1 assert true (#2255)
* Rename assert by assertTrue * Update submodules * Missing assertTrue * Rename poco_assertTrue to poco_assert * Rename poco_assertTrue to poco_assert
This commit is contained in:
		 zosrothko
					zosrothko
				
			
				
					committed by
					
						 Aleksandar Fabijanic
						Aleksandar Fabijanic
					
				
			
			
				
	
			
			
			 Aleksandar Fabijanic
						Aleksandar Fabijanic
					
				
			
						parent
						
							5a1bf5eb4a
						
					
				
				
					commit
					960ecb38f0
				
			| @@ -94,11 +94,11 @@ void HTTPSClientSessionTest::testGetSmall() | ||||
| 	s.sendRequest(request); | ||||
| 	HTTPResponse response; | ||||
| 	std::istream& rs = s.receiveResponse(response); | ||||
| 	assert (response.getContentLength() == HTTPSTestServer::SMALL_BODY.length()); | ||||
| 	assert (response.getContentType() == "text/plain"); | ||||
| 	assertTrue (response.getContentLength() == HTTPSTestServer::SMALL_BODY.length()); | ||||
| 	assertTrue (response.getContentType() == "text/plain"); | ||||
| 	std::ostringstream ostr; | ||||
| 	StreamCopier::copyStream(rs, ostr); | ||||
| 	assert (ostr.str() == HTTPSTestServer::SMALL_BODY); | ||||
| 	assertTrue (ostr.str() == HTTPSTestServer::SMALL_BODY); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -110,11 +110,11 @@ void HTTPSClientSessionTest::testGetLarge() | ||||
| 	s.sendRequest(request); | ||||
| 	HTTPResponse response; | ||||
| 	std::istream& rs = s.receiveResponse(response); | ||||
| 	assert (response.getContentLength() == HTTPSTestServer::LARGE_BODY.length()); | ||||
| 	assert (response.getContentType() == "text/plain"); | ||||
| 	assertTrue (response.getContentLength() == HTTPSTestServer::LARGE_BODY.length()); | ||||
| 	assertTrue (response.getContentType() == "text/plain"); | ||||
| 	std::ostringstream ostr; | ||||
| 	StreamCopier::copyStream(rs, ostr); | ||||
| 	assert (ostr.str() == HTTPSTestServer::LARGE_BODY); | ||||
| 	assertTrue (ostr.str() == HTTPSTestServer::LARGE_BODY); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -126,10 +126,10 @@ void HTTPSClientSessionTest::testHead() | ||||
| 	s.sendRequest(request); | ||||
| 	HTTPResponse response; | ||||
| 	std::istream& rs = s.receiveResponse(response); | ||||
| 	assert (response.getContentLength() == HTTPSTestServer::LARGE_BODY.length()); | ||||
| 	assert (response.getContentType() == "text/plain"); | ||||
| 	assertTrue (response.getContentLength() == HTTPSTestServer::LARGE_BODY.length()); | ||||
| 	assertTrue (response.getContentType() == "text/plain"); | ||||
| 	std::ostringstream ostr; | ||||
| 	assert (StreamCopier::copyStream(rs, ostr) == 0); | ||||
| 	assertTrue (StreamCopier::copyStream(rs, ostr) == 0); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -143,10 +143,10 @@ void HTTPSClientSessionTest::testPostSmallIdentity() | ||||
| 	s.sendRequest(request) << body; | ||||
| 	HTTPResponse response; | ||||
| 	std::istream& rs = s.receiveResponse(response); | ||||
| 	assert (response.getContentLength() == body.length()); | ||||
| 	assertTrue (response.getContentLength() == body.length()); | ||||
| 	std::ostringstream ostr; | ||||
| 	StreamCopier::copyStream(rs, ostr); | ||||
| 	assert (ostr.str() == body); | ||||
| 	assertTrue (ostr.str() == body); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -161,10 +161,10 @@ void HTTPSClientSessionTest::testPostLargeIdentity() | ||||
| 	s.sendRequest(request) << body; | ||||
| 	HTTPResponse response; | ||||
| 	std::istream& rs = s.receiveResponse(response); | ||||
| 	assert (response.getContentLength() == body.length()); | ||||
| 	assertTrue (response.getContentLength() == body.length()); | ||||
| 	std::ostringstream ostr; | ||||
| 	StreamCopier::copyStream(rs, ostr); | ||||
| 	assert (ostr.str() == body); | ||||
| 	assertTrue (ostr.str() == body); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -178,11 +178,11 @@ void HTTPSClientSessionTest::testPostSmallChunked() | ||||
| 	s.sendRequest(request) << body; | ||||
| 	HTTPResponse response; | ||||
| 	std::istream& rs = s.receiveResponse(response); | ||||
| 	assert (response.getChunkedTransferEncoding()); | ||||
| 	assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH); | ||||
| 	assertTrue (response.getChunkedTransferEncoding()); | ||||
| 	assertTrue (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH); | ||||
| 	std::ostringstream ostr; | ||||
| 	StreamCopier::copyStream(rs, ostr); | ||||
| 	assert (ostr.str() == body); | ||||
| 	assertTrue (ostr.str() == body); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -196,11 +196,11 @@ void HTTPSClientSessionTest::testPostLargeChunked() | ||||
| 	s.sendRequest(request) << body; | ||||
| 	HTTPResponse response; | ||||
| 	std::istream& rs = s.receiveResponse(response); | ||||
| 	assert (response.getChunkedTransferEncoding()); | ||||
| 	assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH); | ||||
| 	assertTrue (response.getChunkedTransferEncoding()); | ||||
| 	assertTrue (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH); | ||||
| 	std::ostringstream ostr; | ||||
| 	StreamCopier::copyStream(rs, ostr); | ||||
| 	assert (ostr.str() == body); | ||||
| 	assertTrue (ostr.str() == body); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -221,11 +221,11 @@ void HTTPSClientSessionTest::testPostLargeChunkedKeepAlive() | ||||
| 			s.sendRequest(request) << body; | ||||
| 			HTTPResponse response; | ||||
| 			std::istream& rs = s.receiveResponse(response); | ||||
| 			assert (response.getChunkedTransferEncoding()); | ||||
| 			assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH); | ||||
| 			assertTrue (response.getChunkedTransferEncoding()); | ||||
| 			assertTrue (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH); | ||||
| 			std::ostringstream ostr; | ||||
| 			StreamCopier::copyStream(rs, ostr); | ||||
| 			assert (ostr.str() == body); | ||||
| 			assertTrue (ostr.str() == body); | ||||
| 		} | ||||
| 		srv.stop(); | ||||
| 	} | ||||
| @@ -246,42 +246,42 @@ void HTTPSClientSessionTest::testKeepAlive() | ||||
| 	s.sendRequest(request); | ||||
| 	HTTPResponse response; | ||||
| 	std::istream& rs1 = s.receiveResponse(response); | ||||
| 	assert (response.getContentLength() == HTTPSTestServer::SMALL_BODY.length()); | ||||
| 	assert (response.getContentType() == "text/plain"); | ||||
| 	assert (response.getKeepAlive()); | ||||
| 	assertTrue (response.getContentLength() == HTTPSTestServer::SMALL_BODY.length()); | ||||
| 	assertTrue (response.getContentType() == "text/plain"); | ||||
| 	assertTrue (response.getKeepAlive()); | ||||
| 	std::ostringstream ostr1; | ||||
| 	assert (StreamCopier::copyStream(rs1, ostr1) == 0); | ||||
| 	assertTrue (StreamCopier::copyStream(rs1, ostr1) == 0); | ||||
| 	 | ||||
| 	request.setMethod(HTTPRequest::HTTP_GET); | ||||
| 	request.setURI("/small"); | ||||
| 	s.sendRequest(request); | ||||
| 	std::istream& rs2 = s.receiveResponse(response); | ||||
| 	assert (response.getContentLength() == HTTPSTestServer::SMALL_BODY.length()); | ||||
| 	assert (response.getKeepAlive()); | ||||
| 	assertTrue (response.getContentLength() == HTTPSTestServer::SMALL_BODY.length()); | ||||
| 	assertTrue (response.getKeepAlive()); | ||||
| 	std::ostringstream ostr2; | ||||
| 	StreamCopier::copyStream(rs2, ostr2); | ||||
| 	assert (ostr2.str() == HTTPSTestServer::SMALL_BODY); | ||||
| 	assertTrue (ostr2.str() == HTTPSTestServer::SMALL_BODY); | ||||
| 	 | ||||
| 	request.setMethod(HTTPRequest::HTTP_GET); | ||||
| 	request.setURI("/large"); | ||||
| 	s.sendRequest(request); | ||||
| 	std::istream& rs3 = s.receiveResponse(response); | ||||
| 	assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH); | ||||
| 	assert (response.getChunkedTransferEncoding()); | ||||
| 	assert (response.getKeepAlive()); | ||||
| 	assertTrue (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH); | ||||
| 	assertTrue (response.getChunkedTransferEncoding()); | ||||
| 	assertTrue (response.getKeepAlive()); | ||||
| 	std::ostringstream ostr3; | ||||
| 	StreamCopier::copyStream(rs3, ostr3); | ||||
| 	assert (ostr3.str() == HTTPSTestServer::LARGE_BODY); | ||||
| 	assertTrue (ostr3.str() == HTTPSTestServer::LARGE_BODY); | ||||
|  | ||||
| 	request.setMethod(HTTPRequest::HTTP_HEAD); | ||||
| 	request.setURI("/large"); | ||||
| 	s.sendRequest(request); | ||||
| 	std::istream& rs4 = s.receiveResponse(response); | ||||
| 	assert (response.getContentLength() == HTTPSTestServer::LARGE_BODY.length()); | ||||
| 	assert (response.getContentType() == "text/plain"); | ||||
| 	assert (!response.getKeepAlive()); | ||||
| 	assertTrue (response.getContentLength() == HTTPSTestServer::LARGE_BODY.length()); | ||||
| 	assertTrue (response.getContentType() == "text/plain"); | ||||
| 	assertTrue (!response.getKeepAlive()); | ||||
| 	std::ostringstream ostr4; | ||||
| 	assert (StreamCopier::copyStream(rs4, ostr4) == 0); | ||||
| 	assertTrue (StreamCopier::copyStream(rs4, ostr4) == 0); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -297,14 +297,14 @@ void HTTPSClientSessionTest::testInterop() | ||||
| 	std::ostringstream ostr; | ||||
| 	StreamCopier::copyStream(rs, ostr); | ||||
| 	std::string str(ostr.str()); | ||||
| 	assert (str == "This is a test file for NetSSL.\n"); | ||||
| 	assertTrue (str == "This is a test file for NetSSL.\n"); | ||||
|  | ||||
| 	std::string commonName; | ||||
| 	std::set<std::string> domainNames; | ||||
| 	cert.extractNames(commonName, domainNames); | ||||
|  | ||||
| 	assert (commonName == "secure.appinf.com" || commonName == "*.appinf.com"); | ||||
| 	assert (domainNames.find("appinf.com") != domainNames.end()  | ||||
| 	assertTrue (commonName == "secure.appinf.com" || commonName == "*.appinf.com"); | ||||
| 	assertTrue (domainNames.find("appinf.com") != domainNames.end()  | ||||
| 		 || domainNames.find("*.appinf.com") != domainNames.end()); | ||||
| } | ||||
|  | ||||
| @@ -325,8 +325,8 @@ void HTTPSClientSessionTest::testProxy() | ||||
| 	std::ostringstream ostr; | ||||
| 	StreamCopier::copyStream(rs, ostr); | ||||
| 	std::string str(ostr.str()); | ||||
| 	assert (str == "This is a test file for NetSSL.\n"); | ||||
| 	assert (cert.commonName() == "secure.appinf.com" || cert.commonName() == "*.appinf.com"); | ||||
| 	assertTrue (str == "This is a test file for NetSSL.\n"); | ||||
| 	assertTrue (cert.commonName() == "secure.appinf.com" || cert.commonName() == "*.appinf.com"); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -357,11 +357,11 @@ void HTTPSClientSessionTest::testCachedSession() | ||||
| 	Session::Ptr pSession1 = s1.sslSession(); | ||||
| 	HTTPResponse response1; | ||||
| 	std::istream& rs1 = s1.receiveResponse(response1); | ||||
| 	assert (response1.getContentLength() == HTTPSTestServer::SMALL_BODY.length()); | ||||
| 	assert (response1.getContentType() == "text/plain"); | ||||
| 	assertTrue (response1.getContentLength() == HTTPSTestServer::SMALL_BODY.length()); | ||||
| 	assertTrue (response1.getContentType() == "text/plain"); | ||||
| 	std::ostringstream ostr1; | ||||
| 	StreamCopier::copyStream(rs1, ostr1); | ||||
| 	assert (ostr1.str() == HTTPSTestServer::SMALL_BODY); | ||||
| 	assertTrue (ostr1.str() == HTTPSTestServer::SMALL_BODY); | ||||
|  | ||||
| 	HTTPSClientSession s2("localhost", srv.port(), pClientContext, pSession1); | ||||
| 	HTTPRequest request2(HTTPRequest::HTTP_GET, "/small"); | ||||
| @@ -369,26 +369,26 @@ void HTTPSClientSessionTest::testCachedSession() | ||||
| 	Session::Ptr pSession2 = s2.sslSession(); | ||||
| 	HTTPResponse response2; | ||||
| 	std::istream& rs2 = s2.receiveResponse(response2); | ||||
| 	assert (response2.getContentLength() == HTTPSTestServer::SMALL_BODY.length()); | ||||
| 	assert (response2.getContentType() == "text/plain"); | ||||
| 	assertTrue (response2.getContentLength() == HTTPSTestServer::SMALL_BODY.length()); | ||||
| 	assertTrue (response2.getContentType() == "text/plain"); | ||||
| 	std::ostringstream ostr2; | ||||
| 	StreamCopier::copyStream(rs2, ostr2); | ||||
| 	assert (ostr2.str() == HTTPSTestServer::SMALL_BODY); | ||||
| 	assertTrue (ostr2.str() == HTTPSTestServer::SMALL_BODY); | ||||
| 	 | ||||
| 	assert (pSession1 == pSession2); | ||||
| 	assertTrue (pSession1 == pSession2); | ||||
|  | ||||
| 	HTTPRequest request3(HTTPRequest::HTTP_GET, "/small"); | ||||
| 	s2.sendRequest(request3); | ||||
| 	Session::Ptr pSession3 = s2.sslSession(); | ||||
| 	HTTPResponse response3; | ||||
| 	std::istream& rs3 = s2.receiveResponse(response3); | ||||
| 	assert (response3.getContentLength() == HTTPSTestServer::SMALL_BODY.length()); | ||||
| 	assert (response3.getContentType() == "text/plain"); | ||||
| 	assertTrue (response3.getContentLength() == HTTPSTestServer::SMALL_BODY.length()); | ||||
| 	assertTrue (response3.getContentType() == "text/plain"); | ||||
| 	std::ostringstream ostr3; | ||||
| 	StreamCopier::copyStream(rs3, ostr3); | ||||
| 	assert (ostr3.str() == HTTPSTestServer::SMALL_BODY); | ||||
| 	assertTrue (ostr3.str() == HTTPSTestServer::SMALL_BODY); | ||||
|  | ||||
| 	assert (pSession1 == pSession3); | ||||
| 	assertTrue (pSession1 == pSession3); | ||||
|  | ||||
| 	Thread::sleep(15000); // wait for session to expire | ||||
| 	//pServerContext->flushSessionCache(); | ||||
| @@ -398,13 +398,13 @@ void HTTPSClientSessionTest::testCachedSession() | ||||
| 	Session::Ptr pSession4 = s2.sslSession(); | ||||
| 	HTTPResponse response4; | ||||
| 	std::istream& rs4 = s2.receiveResponse(response4); | ||||
| 	assert (response4.getContentLength() == HTTPSTestServer::SMALL_BODY.length()); | ||||
| 	assert (response4.getContentType() == "text/plain"); | ||||
| 	assertTrue (response4.getContentLength() == HTTPSTestServer::SMALL_BODY.length()); | ||||
| 	assertTrue (response4.getContentType() == "text/plain"); | ||||
| 	std::ostringstream ostr4; | ||||
| 	StreamCopier::copyStream(rs4, ostr4); | ||||
| 	assert (ostr4.str() == HTTPSTestServer::SMALL_BODY); | ||||
| 	assertTrue (ostr4.str() == HTTPSTestServer::SMALL_BODY); | ||||
|  | ||||
| 	assert (pSession1 != pSession4); | ||||
| 	assertTrue (pSession1 != pSession4); | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user