Unit Testing: Moved 'testUninitVar1'
This commit is contained in:
parent
1d36ff1d3f
commit
84286241ef
|
@ -1 +0,0 @@
|
|||
[testUninitVar1\testUninitVar1.cpp:17] Uninitialized member variable 'Fred::_i'
|
|
@ -1,17 +0,0 @@
|
|||
|
||||
class Fred
|
||||
{
|
||||
private:
|
||||
int _i;
|
||||
public:
|
||||
Fred();
|
||||
Fred(int);
|
||||
}
|
||||
|
||||
Fred::Fred()
|
||||
{
|
||||
_i = 0;
|
||||
}
|
||||
|
||||
Fred::Fred(int i)
|
||||
{ }
|
19
tests.cpp
19
tests.cpp
|
@ -176,8 +176,9 @@ static void buffer_overrun()
|
|||
static void constructors()
|
||||
{
|
||||
// Test1: No constructor => Uninitialized variable (TODO)
|
||||
// Test2: Uninitialized variable (TODO)
|
||||
// Test2: embedded constructor, uninitialized variable (TODO)
|
||||
// Test3: Uninitialized variable
|
||||
// Test4: multiple constructors, uninitialized variable
|
||||
|
||||
const char test1[] = "class clKalle\n"
|
||||
"{\n"
|
||||
|
@ -209,6 +210,22 @@ static void constructors()
|
|||
"{ }\n";
|
||||
check( CheckConstructors, __LINE__, test3, "[test.cpp:8] Uninitialized member variable 'clKalle::i'\n" );
|
||||
|
||||
|
||||
const char test4[] = "class clKalle\n"
|
||||
"{\n"
|
||||
"public:\n"
|
||||
" clKalle();\n"
|
||||
" clKalle(int _i);\n"
|
||||
" int i;\n"
|
||||
"};\n"
|
||||
"clKalle::clKalle()\n"
|
||||
"{ }\n"
|
||||
"clKalle::clKalle(int _i)\n"
|
||||
"{\n"
|
||||
" i = _i;\n"
|
||||
"}\n";
|
||||
check( CheckConstructors, __LINE__, test4, "[test.cpp:9] Uninitialized member variable 'clKalle::i'\n" );
|
||||
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
|
Loading…
Reference in New Issue