testing: avoid unitialized members after constructor

cppcheck warned about this. This wasn't actually a problem (one member
was not used at all, the other was set later), but for the sake of
clean cppcheck scans let's fix it.
This commit is contained in:
Patrick Ohly 2014-01-07 02:00:27 -08:00
parent d9ecdafb01
commit 5fed9ef3e6
2 changed files with 6 additions and 4 deletions

View file

@ -492,9 +492,6 @@ public:
/** helper funclets to create sources */
CreateSource createSourceA, createSourceB;
/** if set, then this will be called at the end of testing */
void (*cleanupSources)();
LocalTests(const std::string &name, ClientTest &cl, int sourceParam, ClientTest::Config &co) :
CppUnit::TestSuite(name),
client(cl),

View file

@ -106,7 +106,10 @@ public:
class ClientListener : public CppUnit::TestListener {
public:
ClientListener() :
m_failed(false)
m_failed(false),
// Not really necessary, will be initialized once the test starts.
// Set it anyway, to keep cppcheck happy.
m_testFailed(false)
{
#ifdef HAVE_SIGNAL_H
// install signal handler which turns an alarm signal into a runtime exception
@ -238,7 +241,9 @@ private:
set<string> m_allowedFailures;
bool m_failed, m_testFailed;
string m_currentTest;
#ifdef HAVE_SIGNAL_H
int m_alarmSeconds;
#endif
PushLogger<Logger> m_logger;
CppUnit::TestResultCollector m_failures;