]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix several uninitialized object members in unit tests
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 3 Feb 2013 10:45:53 +0000 (03:45 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 3 Feb 2013 10:45:53 +0000 (03:45 -0700)
 Detected by Coverity Scan. Issues 740581, 740582, 740583, 740584

src/ssl/Config.cc
src/ssl/Config.h
src/tests/stub_DelayId.cc
src/tests/stub_HttpReply.cc
src/tests/stub_libsslsquid.cc
src/tests/testRock.h

index 7c2ef06717b924d55603b01a1dec788869bb0756..0060df8ab446b6453a560ed5684109423c980fcc 100644 (file)
@@ -3,14 +3,6 @@
 
 Ssl::Config Ssl::TheConfig;
 
-Ssl::Config::Config():
-#if USE_SSL_CRTD
-        ssl_crtd(NULL),
-#endif
-        ssl_crt_validator(NULL)
-{
-}
-
 Ssl::Config::~Config()
 {
 #if USE_SSL_CRTD
index 6fa5daedd5ea21d388cad23d6c92037540f79c6a..24de8f64f9b1f0d029c7a976ca8cd50d7e096e93 100644 (file)
@@ -16,7 +16,12 @@ public:
 #endif
     char *ssl_crt_validator;
     HelperChildConfig ssl_crt_validator_Children;
-    Config();
+    Config():
+#if USE_SSL_CRTD
+            ssl_crtd(NULL),
+#endif
+            ssl_crt_validator(NULL) {}
+
     ~Config();
 private:
     Config(const Config &); // not implemented
index 619ff73ef90547dfc931e233fbeadcd4460b95d1..2f81b069a59559b16b849f8c90d7d5488680d9bd 100644 (file)
@@ -38,7 +38,7 @@
 #define STUB_API "stub_DelayId.cc"
 #include "tests/STUB.h"
 
-DelayId::DelayId() {}
+DelayId::DelayId(): pool_(0), compositeId(NULL), markedAsNoDelay(false) {}
 DelayId::~DelayId() {}
 
 void DelayId::delayRead(DeferredRead const&) STUB_NOP
index c6a12b21bc5d90aa525badb0abd59ef55c7fa8c0..b7f5aef9c2017a4b2bedc93863b422ff8bb0e5de 100644 (file)
@@ -4,11 +4,10 @@
 #define STUB_API "HttpReply.cc"
 #include "tests/STUB.h"
 
-HttpReply::HttpReply() : HttpMsg(hoReply)
-{
-// XXX: required by testStore
-// STUB
-}
+HttpReply::HttpReply() : HttpMsg(hoReply), date (0), last_modified (0),
+        expires (0), surrogate_control (NULL), content_range (NULL), keep_alive (0),
+        protoPrefix("HTTP/"), bodySizeMax(-2)
+STUB_NOP
 HttpReply::~HttpReply() STUB
 void HttpReply::setHeaders(http_status status, const char *reason, const char *ctype, int64_t clen, time_t lmt, time_t expires_) STUB
 void HttpReply::packHeadersInto(Packer * p) const STUB
index 08f3c5f26dc191377b816b7765a60bfb576fd60c..6bec9464d552baa3d704ad55c5618e2bcc1c1cd7 100644 (file)
@@ -10,8 +10,7 @@
 #include "tests/STUB.h"
 
 #include "ssl/Config.h"
-Ssl::Config::Config() { printf("Ssl::Config::Config No implemented\n"); }
-Ssl::Config::~Config() { printf("Ssl::Config::Config No implemented\n"); }
+Ssl::Config::~Config() STUB_NOP
 Ssl::Config Ssl::TheConfig;
 
 #include "ssl/context_storage.h"
index 2951d8ff423147e0386c57541c8215e81a32a4f0..5b0f00d4d395cba0c2830281ba1ef4a74d23ca81 100644 (file)
@@ -15,6 +15,7 @@ class testRock : public CPPUNIT_NS::TestFixture
     CPPUNIT_TEST_SUITE_END();
 
 public:
+    testRock() : rr(NULL) {}
     virtual void setUp();
     virtual void tearDown();