@@ -146,6 +146,26 @@ mcdc004e (int a, int b, int c)
}
}
+/* else-if is not immune to the else-less fuse. This test is also put in as a
+ * detection mechanism - sif this should register as 3 individual decisions
+ * then the test should be updated and fixed to reflect it. */
+int
+mcdc004f (int a, int b, int c)
+{
+ if (a) /* conditions(1/2) false(0) */
+ /* conditions(end) */
+ {
+ x = 1;
+ }
+ else if (b) /* conditions(0/4) true(0 1) false(0 1) */
+ /* conditions(end) */
+ {
+ x = 2;
+ if (c)
+ x = 3;
+ }
+}
+
/* mixing && and || works */
void
mcdc005a (int a, int b, int c)
@@ -1137,6 +1157,8 @@ int main ()
mcdc004e (0, 0, 0);
mcdc004e (1, 1, 1);
+ mcdc004f (1, 1, 1);
+
mcdc005a (1, 0, 1);
mcdc005b (1, 1, 0, 0);