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:
d0a0f47
)
tests: new assertions
author
Bartosz Golaszewski
<bartekgola@gmail.com>
Tue, 13 Jun 2017 19:29:16 +0000
(21:29 +0200)
committer
Bartosz Golaszewski
<bartekgola@gmail.com>
Tue, 13 Jun 2017 19:29:16 +0000
(21:29 +0200)
Add two new string-related assertions for tests.
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 e342677c41b60140dc494553280c6bdf1f522d24..d72b7d37901d2025b7e01c5a8d8dc85a882b17ce 100644
(file)
--- a/
tests/gpiod-test.h
+++ b/
tests/gpiod-test.h
@@
-148,6
+148,8
@@
bool test_regex_match(const char *str, const char *pattern);
#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)
+#define TEST_ASSERT_STR_NOTCONT(s, p) TEST_ASSERT(strstr(s, p) == NULL)
#define TEST_ASSERT_REGEX_MATCH(s, p) TEST_ASSERT(test_regex_match(s, p))
+#define TEST_ASSERT_REGEX_NOMATCH(s, p) TEST_ASSERT(!test_regex_match(s, p))
#endif /* __GPIOD_TEST_H__ */