Functional test for cs_winkernel_vsnprintf()
| 133 | |
| 134 | // Functional test for cs_winkernel_vsnprintf() |
| 135 | static void cs_winkernel_vsnprintf_test() |
| 136 | { |
| 137 | char buf[10]; |
| 138 | bool ok = true; |
| 139 | ok = (ok && cs_snprintf(buf, sizeof(buf), "%s", "") == 0 && strcmp(buf, "") == 0); |
| 140 | ok = (ok && cs_snprintf(buf, sizeof(buf), "%s", "0") == 1 && strcmp(buf, "0") == 0); |
| 141 | ok = (ok && cs_snprintf(buf, sizeof(buf), "%s", "012345678") == 9 && strcmp(buf, "012345678") == 0); |
| 142 | ok = (ok && cs_snprintf(buf, sizeof(buf), "%s", "0123456789") == 10 && strcmp(buf, "012345678") == 0); |
| 143 | ok = (ok && cs_snprintf(buf, sizeof(buf), "%s", "01234567890") == 11 && strcmp(buf, "012345678") == 0); |
| 144 | ok = (ok && cs_snprintf(buf, sizeof(buf), "%s", "0123456789001234567890") == 22 && strcmp(buf, "012345678") == 0); |
| 145 | if (!ok) { |
| 146 | printf("ERROR: cs_winkernel_vsnprintf_test() did not produce expected results!\n"); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | // Driver entry point |
| 151 | EXTERN_C NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) |
no test coverage detected
searching dependent graphs…