From: Bartosz Golaszewski Date: Thu, 25 May 2017 14:32:50 +0000 (+0200) Subject: tests: new assertion X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4ddba181fc101274c0660ca76e2cc44b3b402b62;p=qemu-gpiodev%2Flibgpiod.git tests: new assertion Add a new test macro which checks if given string contains a specific substring using strstr(). Signed-off-by: Bartosz Golaszewski --- diff --git a/tests/gpiod-test.h b/tests/gpiod-test.h index ad6d3b7..49bb9b0 100644 --- a/tests/gpiod-test.h +++ b/tests/gpiod-test.h @@ -136,5 +136,6 @@ void test_free_chip_iter_noclose(struct gpiod_chip_iter **iter); #define TEST_ASSERT_EQ(a1, a2) TEST_ASSERT(a1 == a2) #define TEST_ASSERT_NOTEQ(a1, a2) TEST_ASSERT(a1 != a2) #define TEST_ASSERT_STR_EQ(s1, s2) TEST_ASSERT(strcmp(s1, s2) == 0) +#define TEST_ASSERT_STR_CONTAINS(s, p) TEST_ASSERT(strstr(s, p) != NULL) #endif /* __GPIOD_TEST_H__ */