projects
/
qemu-gpiodev
/
libgpiod.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8b872ad
)
tests: new assertion
author
Bartosz Golaszewski
<bartekgola@gmail.com>
Thu, 25 May 2017 14:32:50 +0000
(16:32 +0200)
committer
Bartosz Golaszewski
<bartekgola@gmail.com>
Wed, 7 Jun 2017 16:12:23 +0000
(18:12 +0200)
Add a new test macro which checks if given string contains a specific
substring using strstr().
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
tests/gpiod-test.h
patch
|
blob
|
history
diff --git
a/tests/gpiod-test.h
b/tests/gpiod-test.h
index ad6d3b786cf549cc7777a1e62269c8b47393fdfa..49bb9b0ff67b9b16e1dfa5e0d90833249a69b70d 100644
(file)
--- 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__ */