Skip to content

Commit 800abae

Browse files
committed
Fix mislabeled test case
1 parent 1169f9e commit 800abae

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification

cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -731,10 +731,10 @@ void Correct_year_addition_struct_tm()
731731
}
732732

733733
/**
734-
* Negative Case - Anti-pattern 1: [year ±n, month, day]
734+
* Positive Case - Anti-pattern 1: [year ±n, month, day]
735735
* Years is incremented by some integer and leap year is not handled correctly.
736736
*/
737-
void Correct_LinuxPattern()
737+
void Incorrect_LinuxPattern()
738738
{
739739
time_t rawtime;
740740
struct tm timeinfo;
@@ -743,7 +743,7 @@ void Correct_LinuxPattern()
743743
errno_t err = gmtime_s(&timeinfo, &rawtime);
744744

745745
/* from 1900 -> from 1980 */
746-
timeinfo.tm_year -= 80;
746+
timeinfo.tm_year -= 80; // bug - no check for leap year
747747
/* 0~11 -> 1~12 */
748748
timeinfo.tm_mon++;
749749
/* 0~59 -> 0~29(2sec counts) */

0 commit comments

Comments
 (0)