summaryrefslogtreecommitdiff
path: root/src/test/test-strxcpyx.c
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-10-04 23:51:45 +0200
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-10-04 23:55:35 +0200
commitbdf7026e9557349cd3eeb291c01655d5f2a55db8 (patch)
tree10d269fed663e99d659c34e2f8e89fe5b3f55ecd /src/test/test-strxcpyx.c
parent2355af60dc0c0ec2b7fbe69f15a77d980b017b3f (diff)
test: only use assert_se
The asserts used in the tests should never be allowed to be optimized away
Diffstat (limited to 'src/test/test-strxcpyx.c')
-rw-r--r--src/test/test-strxcpyx.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/test-strxcpyx.c b/src/test/test-strxcpyx.c
index b7b70d4c15..cb2309210f 100644
--- a/src/test/test-strxcpyx.c
+++ b/src/test/test-strxcpyx.c
@@ -38,8 +38,8 @@ static void test_strpcpy(void) {
space_left = strpcpy(&s, space_left, "r");
space_left = strpcpy(&s, space_left, "foo");
- assert(streq(target, "12345hey hey heywaldobar"));
- assert(space_left == 0);
+ assert_se(streq(target, "12345hey hey heywaldobar"));
+ assert_se(space_left == 0);
}
static void test_strpcpyf(void) {
@@ -51,8 +51,8 @@ static void test_strpcpyf(void) {
space_left = strpcpyf(&s, space_left, "space left: %zd. ", space_left);
space_left = strpcpyf(&s, space_left, "foo%s", "bar");
- assert(streq(target, "space left: 25. foobar"));
- assert(space_left == 3);
+ assert_se(streq(target, "space left: 25. foobar"));
+ assert_se(space_left == 3);
}
static void test_strpcpyl(void) {
@@ -64,8 +64,8 @@ static void test_strpcpyl(void) {
space_left = strpcpyl(&s, space_left, "waldo", " test", " waldo. ", NULL);
space_left = strpcpyl(&s, space_left, "Banana", NULL);
- assert(streq(target, "waldo test waldo. Banana"));
- assert(space_left == 1);
+ assert_se(streq(target, "waldo test waldo. Banana"));
+ assert_se(space_left == 1);
}
static void test_strscpy(void) {
@@ -75,8 +75,8 @@ static void test_strscpy(void) {
space_left = sizeof(target);
space_left = strscpy(target, space_left, "12345");
- assert(streq(target, "12345"));
- assert(space_left == 20);
+ assert_se(streq(target, "12345"));
+ assert_se(space_left == 20);
}
static void test_strscpyl(void) {
@@ -86,8 +86,8 @@ static void test_strscpyl(void) {
space_left = sizeof(target);
space_left = strscpyl(target, space_left, "12345", "waldo", "waldo", NULL);
- assert(streq(target, "12345waldowaldo"));
- assert(space_left == 10);
+ assert_se(streq(target, "12345waldowaldo"));
+ assert_se(space_left == 10);
}
int main(int argc, char *argv[]) {