| 38 | }; |
| 39 | |
| 40 | static void test_strdup(void **state) |
| 41 | { |
| 42 | char str[] = "Hello coreboot\n"; |
| 43 | char *duplicate = strdup(str); |
| 44 | |
| 45 | /* There is a more suitable Cmocka's function 'assert_string_equal()', but it |
| 46 | is using strcmp() internally. */ |
| 47 | assert_int_equal(0, memcmp(str, duplicate, __builtin_strlen(str))); |
| 48 | |
| 49 | free(duplicate); |
| 50 | } |
| 51 | |
| 52 | static void test_strconcat(void **state) |
| 53 | { |