test: tabs to spaces, remove trailing spaces and extra empty lines at the end of files

This commit is contained in:
XhmikosR 2012-09-17 14:18:19 +03:00 committed by PKEuS
parent 6e4e3dfbfb
commit 3c14e4b52a
21 changed files with 56 additions and 80 deletions

View File

@ -43,4 +43,3 @@ const std::string& options::which_test() const
{ {
return _which_test; return _which_test;
} }

View File

@ -32,5 +32,3 @@ int main()
f(a); f(a);
possible_style(); possible_style();
} }

View File

@ -169,4 +169,3 @@ private:
}; };
REGISTER_TEST(Test64BitPortability) REGISTER_TEST(Test64BitPortability)

View File

@ -138,4 +138,3 @@ private:
}; };
REGISTER_TEST(TestAssignIf) REGISTER_TEST(TestAssignIf)

View File

@ -667,5 +667,3 @@ private:
}; };
REGISTER_TEST(TestAutoVariables) REGISTER_TEST(TestAutoVariables)

View File

@ -117,18 +117,18 @@ private:
TEST_CASE(array_index_for_in_for); // FP: #2634 TEST_CASE(array_index_for_in_for); // FP: #2634
TEST_CASE(array_index_calculation); TEST_CASE(array_index_calculation);
TEST_CASE(array_index_negative1); TEST_CASE(array_index_negative1);
TEST_CASE(array_index_negative2); // ticket #3063 TEST_CASE(array_index_negative2); // ticket #3063
TEST_CASE(array_index_for_decr); TEST_CASE(array_index_for_decr);
TEST_CASE(array_index_varnames); // FP: struct member. #1576 TEST_CASE(array_index_varnames); // FP: struct member. #1576
TEST_CASE(array_index_for_break); // FP: for,break TEST_CASE(array_index_for_break); // FP: for,break
TEST_CASE(array_index_for_continue); // for,continue TEST_CASE(array_index_for_continue); // for,continue
TEST_CASE(array_index_for); // FN: for,if TEST_CASE(array_index_for); // FN: for,if
TEST_CASE(array_index_for_neq); // #2211: Using != in condition TEST_CASE(array_index_for_neq); // #2211: Using != in condition
TEST_CASE(array_index_for_question); // #2561: for, ?: TEST_CASE(array_index_for_question); // #2561: for, ?:
TEST_CASE(array_index_for_andand_oror); // FN: using && or || in the for loop condition TEST_CASE(array_index_for_andand_oror); // FN: using && or || in the for loop condition
TEST_CASE(array_index_vla_for); // #3221: access VLA inside for TEST_CASE(array_index_vla_for); // #3221: access VLA inside for
TEST_CASE(array_index_extern); // FP when using 'extern'. #1684 TEST_CASE(array_index_extern); // FP when using 'extern'. #1684
TEST_CASE(array_index_cast); // FP after cast. #2841 TEST_CASE(array_index_cast); // FP after cast. #2841
TEST_CASE(array_index_string_literal); TEST_CASE(array_index_string_literal);
TEST_CASE(buffer_overrun_1); TEST_CASE(buffer_overrun_1);
@ -1401,9 +1401,9 @@ private:
check("int f( ) \n" check("int f( ) \n"
"{\n" "{\n"
" struct {\n" " struct {\n"
" int arr[ 3 ];\n" " int arr[ 3 ];\n"
" } var[ 1 ];\n" " } var[ 1 ];\n"
" int y;\n" " int y;\n"
" var[ 0 ].arr[ 0 ] = 0;\n" " var[ 0 ].arr[ 0 ] = 0;\n"
" var[ 0 ].arr[ 1 ] = 1;\n" " var[ 0 ].arr[ 1 ] = 1;\n"
@ -1415,9 +1415,9 @@ private:
check("int f( ) \n" check("int f( ) \n"
"{\n" "{\n"
" struct {\n" " struct {\n"
" int arr[ 3 ];\n" " int arr[ 3 ];\n"
" } var[ 1 ];\n" " } var[ 1 ];\n"
" int y;\n" " int y;\n"
" var[ 0 ].arr[ 0 ] = 0;\n" " var[ 0 ].arr[ 0 ] = 0;\n"
" var[ 0 ].arr[ 1 ] = 1;\n" " var[ 0 ].arr[ 1 ] = 1;\n"

View File

@ -224,4 +224,3 @@ private:
}; };
REGISTER_TEST(TestCharVar) REGISTER_TEST(TestCharVar)

View File

@ -98,4 +98,3 @@ private:
}; };
REGISTER_TEST(TestFileLister) REGISTER_TEST(TestFileLister)

View File

@ -206,5 +206,3 @@ private:
}; };
REGISTER_TEST(TestIncompleteStatement) REGISTER_TEST(TestIncompleteStatement)

View File

@ -566,4 +566,3 @@ private:
}; };
REGISTER_TEST(TestLeakAutoVar) REGISTER_TEST(TestLeakAutoVar)

View File

@ -188,7 +188,7 @@ private:
// ----------------- // -----------------
// to double number: // to double number:
// ----------------- // -----------------
ASSERT_EQUALS_DOUBLE(10.0 , MathLib::toDoubleNumber("10")); ASSERT_EQUALS_DOUBLE(10.0 , MathLib::toDoubleNumber("10"));
ASSERT_EQUALS_DOUBLE(1000.0, MathLib::toDoubleNumber("10E+2")); ASSERT_EQUALS_DOUBLE(1000.0, MathLib::toDoubleNumber("10E+2"));
ASSERT_EQUALS_DOUBLE(100.0 , MathLib::toDoubleNumber("1.0E+2")); ASSERT_EQUALS_DOUBLE(100.0 , MathLib::toDoubleNumber("1.0E+2"));
ASSERT_EQUALS_DOUBLE(-100.0, MathLib::toDoubleNumber("-1.0E+2")); ASSERT_EQUALS_DOUBLE(-100.0, MathLib::toDoubleNumber("-1.0E+2"));
@ -239,18 +239,18 @@ private:
ASSERT_EQUALS(false, MathLib::isInt("-1E-1")); ASSERT_EQUALS(false, MathLib::isInt("-1E-1"));
ASSERT_EQUALS(false, MathLib::isInt("-1E-10000")); ASSERT_EQUALS(false, MathLib::isInt("-1E-10000"));
ASSERT_EQUALS(true, MathLib::isInt("0xff")); ASSERT_EQUALS(true , MathLib::isInt("0xff"));
ASSERT_EQUALS(true, MathLib::isInt("0xa")); ASSERT_EQUALS(true , MathLib::isInt("0xa"));
ASSERT_EQUALS(true, MathLib::isInt("0l")); ASSERT_EQUALS(true , MathLib::isInt("0l"));
ASSERT_EQUALS(true, MathLib::isInt("0L")); ASSERT_EQUALS(true , MathLib::isInt("0L"));
ASSERT_EQUALS(true, MathLib::isInt("0ul")); ASSERT_EQUALS(true , MathLib::isInt("0ul"));
ASSERT_EQUALS(true, MathLib::isInt("0ull")); ASSERT_EQUALS(true , MathLib::isInt("0ull"));
ASSERT_EQUALS(true, MathLib::isInt("0llu")); ASSERT_EQUALS(true , MathLib::isInt("0llu"));
ASSERT_EQUALS(true, MathLib::isInt("333L")); ASSERT_EQUALS(true , MathLib::isInt("333L"));
ASSERT_EQUALS(true, MathLib::isInt("330L")); ASSERT_EQUALS(true , MathLib::isInt("330L"));
ASSERT_EQUALS(true, MathLib::isInt("330llu")); ASSERT_EQUALS(true , MathLib::isInt("330llu"));
ASSERT_EQUALS(true, MathLib::isInt("07")); ASSERT_EQUALS(true , MathLib::isInt("07"));
ASSERT_EQUALS(true, MathLib::isInt("0123")); ASSERT_EQUALS(true , MathLib::isInt("0123"));
ASSERT_EQUALS(false, MathLib::isInt("0.4")); ASSERT_EQUALS(false, MathLib::isInt("0.4"));
ASSERT_EQUALS(false, MathLib::isInt("2352.3f")); ASSERT_EQUALS(false, MathLib::isInt("2352.3f"));
ASSERT_EQUALS(false, MathLib::isInt("0.00004")); ASSERT_EQUALS(false, MathLib::isInt("0.00004"));
@ -293,11 +293,11 @@ private:
} }
void isnegative() const { void isnegative() const {
ASSERT_EQUALS(true, MathLib::isNegative("-1")); ASSERT_EQUALS(true , MathLib::isNegative("-1"));
ASSERT_EQUALS(true, MathLib::isNegative("-1.")); ASSERT_EQUALS(true , MathLib::isNegative("-1."));
ASSERT_EQUALS(true, MathLib::isNegative("-1.0")); ASSERT_EQUALS(true , MathLib::isNegative("-1.0"));
ASSERT_EQUALS(true, MathLib::isNegative("-1.0E+2")); ASSERT_EQUALS(true , MathLib::isNegative("-1.0E+2"));
ASSERT_EQUALS(true, MathLib::isNegative("-1.0E-2")); ASSERT_EQUALS(true , MathLib::isNegative("-1.0E-2"));
ASSERT_EQUALS(false, MathLib::isNegative("+1")); ASSERT_EQUALS(false, MathLib::isNegative("+1"));
ASSERT_EQUALS(false, MathLib::isNegative("+1.")); ASSERT_EQUALS(false, MathLib::isNegative("+1."));
@ -342,5 +342,3 @@ private:
}; };
REGISTER_TEST(TestMathLib) REGISTER_TEST(TestMathLib)

View File

@ -293,5 +293,3 @@ private:
}; };
REGISTER_TEST(TestObsoleteFunctions) REGISTER_TEST(TestObsoleteFunctions)

View File

@ -4536,7 +4536,7 @@ private:
"{\n" "{\n"
" if( token == \"C\")\n" " if( token == \"C\")\n"
" {\n" " {\n"
" std::cout << \"C\";\n" " std::cout << \"C\";\n"
" }\n" " }\n"
" else if ( token == \"A\" )\n" " else if ( token == \"A\" )\n"
" {\n" " {\n"
@ -4736,18 +4736,18 @@ private:
"int fitInt(long long int nValue){\n" "int fitInt(long long int nValue){\n"
" if( nValue < INT32_MAX )\n" " if( nValue < INT32_MAX )\n"
" {\n" " {\n"
" return 32;\n" " return 32;\n"
" }\n" " }\n"
" if( nValue < INT48_MAX )\n" " if( nValue < INT48_MAX )\n"
" {\n" " {\n"
" return 48;\n" " return 48;\n"
" }\n" " }\n"
" else if( nValue < INT64_MAX )\n" " else if( nValue < INT64_MAX )\n"
" {\n" " {\n"
" return 64;\n" " return 64;\n"
" } else\n" " } else\n"
" {\n" " {\n"
" return -1;\n" " return -1;\n"
" }\n" " }\n"
"}\n"); "}\n");
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
@ -5651,7 +5651,7 @@ private:
" char *p = malloc(100);\n" " char *p = malloc(100);\n"
" if (x) {\n" " if (x) {\n"
" free(p);\n" " free(p);\n"
" x = 0;\n" " x = 0;\n"
" }\n" " }\n"
" free(p);\n" " free(p);\n"
"}"); "}");
@ -5789,16 +5789,16 @@ private:
check( check(
"int foo()\n" "int foo()\n"
"{\n" "{\n"
" int* a = new int;\n" " int* a = new int;\n"
" bool doDelete = true;\n" " bool doDelete = true;\n"
" if (a != 0)\n" " if (a != 0)\n"
" {\n" " {\n"
" doDelete = false;\n" " doDelete = false;\n"
" delete a;\n" " delete a;\n"
" }\n" " }\n"
" if(doDelete)\n" " if(doDelete)\n"
" delete a;\n" " delete a;\n"
" return 0;\n" " return 0;\n"
"}" "}"
); );
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());

View File

@ -348,5 +348,3 @@ private:
}; };
REGISTER_TEST(TestPostfixOperator) REGISTER_TEST(TestPostfixOperator)

View File

@ -28,4 +28,3 @@ int main(int argc, char *argv[])
return (ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE); return (ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
} }

View File

@ -78,4 +78,3 @@ public:
#define REGISTER_TEST( CLASSNAME ) namespace { CLASSNAME instance; } #define REGISTER_TEST( CLASSNAME ) namespace { CLASSNAME instance; }
#endif #endif

View File

@ -1409,4 +1409,3 @@ private:
}; };
REGISTER_TEST(TestSymbolDatabase) REGISTER_TEST(TestSymbolDatabase)

View File

@ -2481,7 +2481,7 @@ private:
"for ( int i = 0 ; i < 10 ; ++ i ) { }\n" "for ( int i = 0 ; i < 10 ; ++ i ) { }\n"
"}"; "}";
ASSERT_EQUALS(expected, tokenizeAndStringify(code, true)); ASSERT_EQUALS(expected, tokenizeAndStringify(code, true));
ASSERT_EQUALS("", errout.str()); // debug warnings ASSERT_EQUALS("", errout.str()); // debug warnings
} }
void simplifyKnownVariablesBailOutFor2() { void simplifyKnownVariablesBailOutFor2() {
@ -2494,7 +2494,7 @@ private:
"while ( i < 10 ) { ++ i ; }\n" "while ( i < 10 ) { ++ i ; }\n"
"}"; "}";
ASSERT_EQUALS(expected, tokenizeAndStringify(code, true)); ASSERT_EQUALS(expected, tokenizeAndStringify(code, true));
ASSERT_EQUALS("", errout.str()); // debug warnings ASSERT_EQUALS("", errout.str()); // debug warnings
} }
void simplifyKnownVariablesBailOutFor3() { void simplifyKnownVariablesBailOutFor3() {
@ -2507,7 +2507,7 @@ private:
"{ }\n" "{ }\n"
"}"; "}";
ASSERT_EQUALS(expected, tokenizeAndStringify(code, true)); ASSERT_EQUALS(expected, tokenizeAndStringify(code, true));
ASSERT_EQUALS("", errout.str()); // debug warnings ASSERT_EQUALS("", errout.str()); // debug warnings
} }
void simplifyKnownVariablesBailOutMemberFunction() { void simplifyKnownVariablesBailOutMemberFunction() {
@ -2531,7 +2531,7 @@ private:
" return a;\n" " return a;\n"
"}\n"; "}\n";
tokenizeAndStringify(code,true); tokenizeAndStringify(code,true);
ASSERT_EQUALS("", errout.str()); // no debug warnings ASSERT_EQUALS("", errout.str()); // no debug warnings
} }
void simplifyKnownVariablesBailOutSwitchBreak() { void simplifyKnownVariablesBailOutSwitchBreak() {
@ -2590,17 +2590,17 @@ private:
const char code[] = "void a(int x);" // <- x is passed by value const char code[] = "void a(int x);" // <- x is passed by value
"void b() {" "void b() {"
" int x = 123;" " int x = 123;"
" a(x);" // <- replace with a(123); " a(x);" // <- replace with a(123);
"}"; "}";
const char expected[] = "void a ( int x ) ; void b ( ) { a ( 123 ) ; }"; const char expected[] = "void a ( int x ) ; void b ( ) { a ( 123 ) ; }";
ASSERT_EQUALS(expected, tokenizeAndStringify(code,true)); ASSERT_EQUALS(expected, tokenizeAndStringify(code,true));
} }
{ {
const char code[] = "void a(int &x);" // <- x is passed by reference const char code[] = "void a(int &x);" // <- x is passed by reference
"void b() {" "void b() {"
" int x = 123;" " int x = 123;"
" a(x);" // <- don't replace with a(123); " a(x);" // <- don't replace with a(123);
"}"; "}";
const char expected[] = "void a ( int & x ) ; void b ( ) { int x ; x = 123 ; a ( x ) ; }"; const char expected[] = "void a ( int & x ) ; void b ( ) { int x ; x = 123 ; a ( x ) ; }";
ASSERT_EQUALS(expected, tokenizeAndStringify(code,true)); ASSERT_EQUALS(expected, tokenizeAndStringify(code,true));

View File

@ -2349,4 +2349,3 @@ private:
}; };
REGISTER_TEST(TestUninitVar) REGISTER_TEST(TestUninitVar)

View File

@ -260,4 +260,3 @@ private:
}; };
REGISTER_TEST(TestUnusedFunctions) REGISTER_TEST(TestUnusedFunctions)

View File

@ -659,4 +659,3 @@ private:
}; };
REGISTER_TEST(TestUnusedPrivateFunction) REGISTER_TEST(TestUnusedPrivateFunction)