From 38219f6ebb4612a6af966e80a31292437c810ec3 Mon Sep 17 00:00:00 2001 From: "REDMOND\\brodes" Date: Thu, 19 Feb 2026 14:08:36 -0500 Subject: [PATCH] C++: Fixing FP in unit tests. --- .../UncheckedLeapYearAfterYearModification.expected | 2 -- .../Leap Year/UncheckedLeapYearAfterYearModification/test.cpp | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/UncheckedLeapYearAfterYearModification.expected b/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/UncheckedLeapYearAfterYearModification.expected index 30b6dad1208..773cb92b0b1 100644 --- a/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/UncheckedLeapYearAfterYearModification.expected +++ b/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/UncheckedLeapYearAfterYearModification.expected @@ -3,7 +3,6 @@ | test.cpp:440:2:440:11 | ... ++ | test.cpp:440:2:440:11 | ... ++ | test.cpp:440:2:440:11 | ... ++ | Year field has been modified, but no appropriate check for LeapYear was found. | | test.cpp:456:2:456:12 | ... ++ | test.cpp:456:2:456:12 | ... ++ | test.cpp:456:2:456:12 | ... ++ | Year field has been modified, but no appropriate check for LeapYear was found. | | test.cpp:681:2:681:23 | ... += ... | test.cpp:681:2:681:23 | ... += ... | test.cpp:681:2:681:23 | ... += ... | Year field has been modified, but no appropriate check for LeapYear was found. | -| test.cpp:769:2:769:23 | ... -= ... | test.cpp:769:2:769:23 | ... -= ... | test.cpp:769:2:769:23 | ... -= ... | Year field has been modified, but no appropriate check for LeapYear was found. | | test.cpp:813:2:813:40 | ... = ... | test.cpp:813:21:813:40 | ... + ... | test.cpp:813:2:813:40 | ... = ... | Year field has been modified, but no appropriate check for LeapYear was found. | | test.cpp:818:2:818:24 | ... = ... | test.cpp:818:13:818:24 | ... + ... | test.cpp:818:2:818:24 | ... = ... | Year field has been modified, but no appropriate check for LeapYear was found. | | test.cpp:951:3:951:25 | ... = ... | test.cpp:951:14:951:25 | ... + ... | test.cpp:951:3:951:25 | ... = ... | Year field has been modified, but no appropriate check for LeapYear was found. | @@ -75,7 +74,6 @@ nodes | test.cpp:456:2:456:12 | ... ++ | semmle.label | ... ++ | | test.cpp:482:3:482:12 | ... ++ | semmle.label | ... ++ | | test.cpp:681:2:681:23 | ... += ... | semmle.label | ... += ... | -| test.cpp:769:2:769:23 | ... -= ... | semmle.label | ... -= ... | | test.cpp:813:2:813:40 | ... = ... | semmle.label | ... = ... | | test.cpp:813:21:813:40 | ... + ... | semmle.label | ... + ... | | test.cpp:818:2:818:24 | ... = ... | semmle.label | ... = ... | diff --git a/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/test.cpp b/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/test.cpp index 850ef560536..a2dce39cc85 100644 --- a/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/test.cpp +++ b/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/test.cpp @@ -766,7 +766,7 @@ void Incorrect_LinuxPattern() /* from 1900 -> from 1980 */ // BUG - UncheckedLeapYearAfterYearModification - timeinfo.tm_year -= 80; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + timeinfo.tm_year -= 80; /* 0~11 -> 1~12 */ timeinfo.tm_mon++; /* 0~59 -> 0~29(2sec counts) */