| 17 | } |
| 18 | |
| 19 | TEST(Memory, BaseTypes) |
| 20 | { |
| 21 | void *aVoid[123]; |
| 22 | secure_random_fill(aVoid, sizeof(aVoid)); |
| 23 | EXPECT_FALSE(mem_is_null(aVoid, sizeof(aVoid))); |
| 24 | mem_zero(&aVoid, sizeof(aVoid)); |
| 25 | EXPECT_TRUE(mem_is_null(aVoid, sizeof(aVoid))); |
| 26 | secure_random_fill(aVoid, sizeof(aVoid)); |
| 27 | EXPECT_FALSE(mem_is_null(aVoid, sizeof(aVoid))); |
| 28 | mem_zero(&aVoid[0], 123 * sizeof(void *)); |
| 29 | EXPECT_TRUE(mem_is_null(aVoid, sizeof(aVoid))); |
| 30 | |
| 31 | secure_random_fill(aVoid, sizeof(aVoid)); |
| 32 | EXPECT_FALSE(mem_is_null(aVoid, sizeof(aVoid))); |
| 33 | mem_zero(aVoid, sizeof(aVoid)); |
| 34 | EXPECT_TRUE(mem_is_null(aVoid, sizeof(aVoid))); |
| 35 | |
| 36 | int aInt[512]; |
| 37 | secure_random_fill(aInt, sizeof(aInt)); |
| 38 | EXPECT_FALSE(mem_is_null(aInt, sizeof(aInt))); |
| 39 | mem_zero(&aInt, sizeof(aInt)); |
| 40 | EXPECT_TRUE(mem_is_null(aInt, sizeof(aInt))); |
| 41 | secure_random_fill(aInt, sizeof(aInt)); |
| 42 | EXPECT_FALSE(mem_is_null(aInt, sizeof(aInt))); |
| 43 | mem_zero(&aInt[0], sizeof(aInt)); |
| 44 | EXPECT_TRUE(mem_is_null(aInt, sizeof(aInt))); |
| 45 | |
| 46 | secure_random_fill(aInt, sizeof(aInt)); |
| 47 | EXPECT_FALSE(mem_is_null(aInt, sizeof(aInt))); |
| 48 | mem_zero(aInt, sizeof(aInt)); |
| 49 | EXPECT_TRUE(mem_is_null(aInt, sizeof(aInt))); |
| 50 | |
| 51 | int *apInt[512]; |
| 52 | secure_random_fill(apInt, sizeof(apInt)); |
| 53 | EXPECT_FALSE(mem_is_null(apInt, sizeof(apInt))); |
| 54 | mem_zero(&apInt, sizeof(apInt)); |
| 55 | EXPECT_TRUE(mem_is_null(apInt, sizeof(apInt))); |
| 56 | |
| 57 | secure_random_fill(apInt, sizeof(apInt)); |
| 58 | EXPECT_FALSE(mem_is_null(apInt, sizeof(apInt))); |
| 59 | mem_zero(apInt, sizeof(apInt)); |
| 60 | EXPECT_TRUE(mem_is_null(apInt, sizeof(apInt))); |
| 61 | |
| 62 | int aaInt[10][20]; |
| 63 | secure_random_fill(aaInt, sizeof(aaInt)); |
| 64 | EXPECT_FALSE(mem_is_null(aaInt, sizeof(aaInt))); |
| 65 | mem_zero(&aaInt, sizeof(aaInt)); |
| 66 | EXPECT_TRUE(mem_is_null(aaInt, sizeof(aaInt))); |
| 67 | secure_random_fill(aaInt, sizeof(aaInt)); |
| 68 | EXPECT_FALSE(mem_is_null(aaInt, sizeof(aaInt))); |
| 69 | mem_zero(&aaInt[0], sizeof(aaInt)); |
| 70 | EXPECT_TRUE(mem_is_null(aaInt, sizeof(aaInt))); |
| 71 | secure_random_fill(aaInt, sizeof(aaInt)); |
| 72 | EXPECT_FALSE(mem_is_null(aaInt, sizeof(aaInt))); |
| 73 | mem_zero(&aaInt[0][0], sizeof(aaInt)); |
| 74 | EXPECT_TRUE(mem_is_null(aaInt, sizeof(aaInt))); |
| 75 | |
| 76 | secure_random_fill(aaInt, sizeof(aaInt)); |
nothing calls this directly
no test coverage detected