Skip to content

Commit bac39e6

Browse files
committed
CPP: Add test cases.
1 parent c4d74c3 commit bac39e6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

cpp/ql/test/query-tests/Best Practices/Magic Constants/Japanese Era/ConstructorOrMethodWithExactDate.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,7 @@ int Main()
3737

3838
// GOOD: method call with the same parameters in a different order (we only track year, month, day)
3939
EraInfo * pDateTimeUtil4 = EraInfo::EraInfoFromDate(1, 2, 8, 1, 1989, L"\u5e73\u6210");
40+
41+
// BAD: constructor creating a EraInfo with exact Reiwa era start date [NOT DETECTED]
42+
EraInfo * pDateTimeUtil5 = new EraInfo(2019, 5, 1);
4043
}

cpp/ql/test/query-tests/Best Practices/Magic Constants/Japanese Era/StructWithExactDate.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ int main()
5252
st1.wMonth = 1;
5353
st1.wYear = 1990;
5454

55+
56+
// BAD: Creation of SYSTEMTIME stuct corresponding to the beginning of Reiwa era [NOT DETECTED]
57+
SYSTEMTIME st2;
58+
st2.wDay = 1;
59+
st2.wMonth = 5;
60+
st2.wYear = 2019;
61+
5562
return 0;
5663
}
5764

0 commit comments

Comments
 (0)