Unit Testing: Moved 'testUninitVar1'

This commit is contained in:
Daniel Marjamäki 2008-02-16 17:55:29 +00:00
parent 1d36ff1d3f
commit 84286241ef
3 changed files with 18 additions and 19 deletions

View File

@ -1 +0,0 @@
[testUninitVar1\testUninitVar1.cpp:17] Uninitialized member variable 'Fred::_i'

View File

@ -1,17 +0,0 @@
class Fred
{
private:
int _i;
public:
Fred();
Fred(int);
}
Fred::Fred()
{
_i = 0;
}
Fred::Fred(int i)
{ }

View File

@ -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" );
}
//---------------------------------------------------------------------------