CPP: Update test annotations.

This commit is contained in:
Geoffrey White
2019-08-09 09:28:09 +01:00
parent 1b7d1c37ec
commit 67eb37f460
2 changed files with 9 additions and 9 deletions

View File

@@ -171,7 +171,7 @@ void antipattern2()
// copy back to a FILETIME
ft.dwLowDateTime = (DWORD)(qwLongTime & 0xFFFFFFFF); // BAD
ft.dwHighDateTime = (DWORD)(qwLongTime >> 32);
ft.dwHighDateTime = (DWORD)(qwLongTime >> 32); // BAD
// convert back to SYSTEMTIME for display or other usage
FileTimeToSystemTime(&ft, &st);
@@ -215,7 +215,7 @@ void checkedExample()
// copy back to a FILETIME
ft.dwLowDateTime = (DWORD)(qwLongTime & 0xFFFFFFFF); // GOOD [FALSE POSITIVE]
ft.dwHighDateTime = (DWORD)(qwLongTime >> 32);
ft.dwHighDateTime = (DWORD)(qwLongTime >> 32); // GOOD [FALSE POSITIVE]
// convert back to SYSTEMTIME for display or other usage
if (FileTimeToSystemTime(&ft, &st) == 0)

View File

@@ -445,7 +445,7 @@ void CorrectPattern_check4()
if (fixDate(st.wDay, st.wMonth, st.wYear))
{
// move back a day when landing on Feb 29 in an non-leap year
st.wDay = 28;
st.wDay = 28; // GOOD [FALSE POSITIVE]
}
// Safe to use
@@ -715,9 +715,9 @@ void modified3()
GetSystemTime(&st);
st.wYear = st.wYear + 1;
st.wYear = st.wYear + 1; // BAD
SystemTimeToFileTime(&st, &ft); // BAD
SystemTimeToFileTime(&st, &ft);
}
void modified4()
@@ -728,9 +728,9 @@ void modified4()
GetSystemTime(&st);
st.wYear++;
st.wYear++;
st.wYear++;
st.wYear++; // BAD
st.wYear++; // BAD
st.wYear++; // BAD
SystemTimeToFileTime(&st, &ft); // BAD
SystemTimeToFileTime(&st, &ft);
}