diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-11-12 13:28:07 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-11-12 13:28:07 -0500 |
commit | a3dafd3f58bb3122b9de919e931c02b5e12373b2 (patch) | |
tree | 3df98129cf51f089d4edb734f55ea86f5b8e8e74 /src/ext | |
parent | 2170171d84e30bc4b1b2565255bd978668c50e97 (diff) | |
download | tor-a3dafd3f58bb3122b9de919e931c02b5e12373b2.tar.gz tor-a3dafd3f58bb3122b9de919e931c02b5e12373b2.zip |
Replace operators used as macro arguments with OP_XX macros
Part of fix for 13172
Diffstat (limited to 'src/ext')
-rw-r--r-- | src/ext/tinytest_demo.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ext/tinytest_demo.c b/src/ext/tinytest_demo.c index 634e112cb8..c07f099791 100644 --- a/src/ext/tinytest_demo.c +++ b/src/ext/tinytest_demo.c @@ -74,13 +74,13 @@ test_strcmp(void *data) values of the failing things. Fail unless strcmp("abc, "abc") == 0 */ - tt_int_op(strcmp("abc", "abc"), ==, 0); + tt_int_op(strcmp("abc", "abc"), OP_EQ, 0); /* Fail unless strcmp("abc, "abcd") is less than 0 */ - tt_int_op(strcmp("abc", "abcd"), < , 0); + tt_int_op(strcmp("abc", "abcd"), OP_LT, 0); /* Incidentally, there's a test_str_op that uses strcmp internally. */ - tt_str_op("abc", <, "abcd"); + tt_str_op("abc", OP_LT, "abcd"); /* Every test-case function needs to finish with an "end:" @@ -153,11 +153,11 @@ test_memcpy(void *ptr) /* Let's make sure that memcpy does what we'd like. */ strcpy(db->buffer1, "String 0"); memcpy(db->buffer2, db->buffer1, sizeof(db->buffer1)); - tt_str_op(db->buffer1, ==, db->buffer2); + tt_str_op(db->buffer1, OP_EQ, db->buffer2); /* tt_mem_op() does a memcmp, as opposed to the strcmp in tt_str_op() */ db->buffer2[100] = 3; /* Make the buffers unequal */ - tt_mem_op(db->buffer1, <, db->buffer2, sizeof(db->buffer1)); + tt_mem_op(db->buffer1, OP_LT, db->buffer2, sizeof(db->buffer1)); /* Now we've allocated memory that's referenced by a local variable. The end block of the function will clean it up. */ @@ -165,7 +165,7 @@ test_memcpy(void *ptr) tt_assert(mem); /* Another rather trivial test. */ - tt_str_op(db->buffer1, !=, mem); + tt_str_op(db->buffer1, OP_NE, mem); end: /* This time our end block has something to do. */ @@ -186,9 +186,9 @@ test_timeout(void *ptr) #endif t2 = time(NULL); - tt_int_op(t2-t1, >=, 4); + tt_int_op(t2-t1, OP_GE, 4); - tt_int_op(t2-t1, <=, 6); + tt_int_op(t2-t1, OP_LE, 6); end: ; |