parent
fa968d75bd
commit
7efc4dd26e
|
@ -3883,22 +3883,22 @@ private:
|
||||||
|
|
||||||
check("int f2(int a) {return (a == 1) ? (int)1 : (int)1; }");
|
check("int f2(int a) {return (a == 1) ? (int)1 : (int)1; }");
|
||||||
ASSERT_EQUALS("[test.cpp:1]: (style) Same value in both branches of ternary operator.\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:1]: (style) Same value in both branches of ternary operator.\n", errout.str());
|
||||||
|
|
||||||
check("int f3(int a) {return (a == 1) ? 1 : (int)1; }");
|
check("int f3(int a) {return (a == 1) ? 1 : (int)1; }");
|
||||||
ASSERT_EQUALS("[test.cpp:1]: (style) Same value in both branches of ternary operator.\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:1]: (style) Same value in both branches of ternary operator.\n", errout.str());
|
||||||
|
|
||||||
check("int f4(int a) {return (a == 1) ? 1 : 1; }");
|
check("int f4(int a) {return (a == 1) ? 1 : 1; }");
|
||||||
ASSERT_EQUALS("[test.cpp:1]: (style) Same value in both branches of ternary operator.\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:1]: (style) Same value in both branches of ternary operator.\n", errout.str());
|
||||||
|
|
||||||
check("int f5(int a) {return (a == (int)1) ? (int)1 : 1; }");
|
check("int f5(int a) {return (a == (int)1) ? (int)1 : 1; }");
|
||||||
ASSERT_EQUALS("[test.cpp:1]: (style) Same value in both branches of ternary operator.\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:1]: (style) Same value in both branches of ternary operator.\n", errout.str());
|
||||||
|
|
||||||
check("int f6(int a) {return (a == (int)1) ? (int)1 : (int)1; }");
|
check("int f6(int a) {return (a == (int)1) ? (int)1 : (int)1; }");
|
||||||
ASSERT_EQUALS("[test.cpp:1]: (style) Same value in both branches of ternary operator.\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:1]: (style) Same value in both branches of ternary operator.\n", errout.str());
|
||||||
|
|
||||||
check("int f7(int a) {return (a == (int)1) ? 1 : (int)1; }");
|
check("int f7(int a) {return (a == (int)1) ? 1 : (int)1; }");
|
||||||
ASSERT_EQUALS("[test.cpp:1]: (style) Same value in both branches of ternary operator.\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:1]: (style) Same value in both branches of ternary operator.\n", errout.str());
|
||||||
|
|
||||||
check("int f8(int a) {return (a == (int)1) ? 1 : 1; }");
|
check("int f8(int a) {return (a == (int)1) ? 1 : 1; }");
|
||||||
ASSERT_EQUALS("[test.cpp:1]: (style) Same value in both branches of ternary operator.\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:1]: (style) Same value in both branches of ternary operator.\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue