1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 343767 - [fp] 'No return' warning when return in both if and else

This commit is contained in:
Alena Laskavaia 2011-05-01 21:11:52 +00:00
parent 6f411b236b
commit a0ff5b6b4f

View file

@ -210,4 +210,39 @@ public class ReturnCheckerTest extends CheckerTestCase {
loadCodeAndRun(getAboveComment());
checkErrorLine(1);
}
//int bar(int foo)
//{
// if(foo)
// return 0;
// else
// return 0;
//}
public void testBranches_Bug343767() {
loadCodeAndRunCpp(getAboveComment());
checkNoErrors();
}
// int f()
// {
// switch (g()) {
// case 1: return 1;
// case 2:
// return 0;
// }
public void testBranchesSwitch_Bug343767() {
loadCodeAndRunCpp(getAboveComment());
checkNoErrors();
}
//int bar(int foo)
//{
// if(foo)
// return 0;
// else
// if (g()) return 0;
// else return 1;
//}
public void testBranches2_Bug343767() {
loadCodeAndRunCpp(getAboveComment());
checkNoErrors();
}
}