aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2014-12-06 23:22:16 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2014-12-06 23:22:16 +0100
commit88cd9a624427dcf030f68f835525e49948e60ed5 (patch)
treeddc2b5b099a4381ec068a6557152d2d59871a248 /src
parent1e992efe91f4f171c541fd6b91b2abf17583d406 (diff)
downloadsds-88cd9a624427dcf030f68f835525e49948e60ed5.tar.xz
test.c: Remove blanklines before return
Diffstat (limited to 'src')
-rw-r--r--src/test.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/test.c b/src/test.c
index 32d12a3..3d71f6f 100644
--- a/src/test.c
+++ b/src/test.c
@@ -58,14 +58,12 @@ static inline void sdsfrees(sds *string) { if (*string) sdsfree(*string); }
bool
check_string_length(void) {
_sds_cleanup_ sds x = sdsnew("foo");
-
return (sdslen(x) == 3 && memcmp(x, "foo\0", 4) == 0);
}
bool
create_with_length(void) {
_sds_cleanup_ sds x = sdsnewlen("foo", 2);
-
return (sdslen(x) == 2 && memcmp(x, "fo\0", 3) == 0);
}
@@ -73,7 +71,6 @@ bool
string_concat(void) {
_sds_cleanup_ sds x = sdsnewlen("foo", 2);
x = sdscat(x, "bar");
-
return (sdslen(x) == 5 && memcmp(x, "fobar\0", 6) == 0);
}
@@ -81,7 +78,6 @@ bool
sdscpy_against_longer_str(void) {
_sds_cleanup_ sds x = sdsnew("foo");
x = sdscpy(x, "a");
-
return (sdslen(x) == 1 && memcmp(x, "a\0", 2) == 0);
}
@@ -89,14 +85,12 @@ bool
sdscpy_against_shorter_str(void) {
_sds_cleanup_ sds x = sdsnewlen("foo",2);
x = sdscpy(x, "xxxxyyyyzzzz");
-
return (sdslen(x) == 12 && memcmp(x, "xxxxyyyyzzzz\0", 12) == 0);
}
bool
sdscatprintf_base_case(void) {
_sds_cleanup_ sds x = sdscatprintf(sdsempty(), "%d", 123);
-
return (sdslen(x) == 3 && memcmp(x, "123\0", 4) == 0);
}
@@ -104,7 +98,6 @@ bool
sdstrim_trims_correctly(void) {
_sds_cleanup_ sds x = sdsnew("xxciaoyy");
sdstrim(x, "xy");
-
return (sdslen(x) == 4 && memcmp(x, "ciao\0", 5) == 0);
}
@@ -113,7 +106,6 @@ sdsrange_one_one (void) {
_sds_cleanup_ sds x = sdsnew("ciao");
_sds_cleanup_ sds y = sdsdup(x);
sdsrange(y, 1, 1);
-
return (sdslen(y) == 1 && memcmp(y, "i\0", 2) == 0);
}
@@ -122,7 +114,6 @@ sdsrange_one_none (void) {
_sds_cleanup_ sds x = sdsnew("ciao");
_sds_cleanup_ sds y = sdsdup(x);
sdsrange(y, 1, -1);
-
return (sdslen(y) == 3 && memcmp(y, "iao\0", 4) == 0);
}
@@ -131,7 +122,6 @@ sdsrange_ntwo_none (void) {
_sds_cleanup_ sds x = sdsnew("ciao");
_sds_cleanup_ sds y = sdsdup(x);
sdsrange(y, -2, -1);
-
return (sdslen(y) == 2 && memcmp(y, "ao\0", 3) == 0);
}
@@ -140,7 +130,6 @@ sdsrange_two_one (void) {
_sds_cleanup_ sds x = sdsnew("ciao");
_sds_cleanup_ sds y = sdsdup(x);
sdsrange(y, 2, 1);
-
return (sdslen(y) == 0 && memcmp(y, "\0", 1) == 0);
}
@@ -149,7 +138,6 @@ sdsrange_one_hund (void) {
_sds_cleanup_ sds x = sdsnew("ciao");
_sds_cleanup_ sds y = sdsdup(x);
sdsrange(y, 1, 100);
-
return (sdslen(y) == 3 && memcmp(y, "iao\0", 4) == 0);
}
@@ -158,7 +146,6 @@ sdsrange_hund_hund (void) {
_sds_cleanup_ sds x = sdsnew("ciao");
_sds_cleanup_ sds y = sdsdup(x);
sdsrange(y, 100, 100);
-
return (sdslen(y) == 0 && memcmp(y, "\0", 1) == 0);
}
@@ -166,7 +153,6 @@ bool
sdscmp_foo_foa (void) {
_sds_cleanup_ sds x = sdsnew("foo");
_sds_cleanup_ sds y = sdsnew("foa");
-
return (sdscmp(x, y) > 0);
}
@@ -174,7 +160,6 @@ bool
sdscmp_aar_bar (void) {
_sds_cleanup_ sds x = sdsnew("aar");
_sds_cleanup_ sds y = sdsnew("bar");
-
return (sdscmp(x, y) < 0);
}
@@ -182,7 +167,6 @@ bool
sdscmp_bar_bar (void) {
_sds_cleanup_ sds x = sdsnew("bar");
_sds_cleanup_ sds y = sdsnew("bar");
-
return (sdscmp(x, y) == 0);
}
@@ -197,7 +181,6 @@ bool
sdsnew_check_free_len (void) {
_sds_cleanup_ sds x = sdsnew("0");
struct sdshdr *sh = (void*) (x-(sizeof(struct sdshdr)));
-
return (sh->len == 1 && sh->free == 0);
}
@@ -206,7 +189,6 @@ sdsMakeRoomFor_test (void) {
_sds_cleanup_ sds x = sdsnew("0");
x = sdsMakeRoomFor(x, 1);
struct sdshdr *sh = (void*) (x-(sizeof(struct sdshdr)));
-
return (sh->len == 1 && sh->free > 0);
}
@@ -216,7 +198,6 @@ sdsIncrLen_content (void) {
x = sdsMakeRoomFor(x, 1);
x[1] = '1';
sdsIncrLen(x, 1);
-
return (x[0] == '0' && x[1] == '1');
}
@@ -227,7 +208,6 @@ sdsIncrLen_len (void) {
struct sdshdr *sh = (void*) (x-(sizeof(struct sdshdr)));
x[1] = '1';
sdsIncrLen(x, 1);
-
return (sh->len == 2);
}
@@ -239,6 +219,5 @@ sdsIncrLen_free (void) {
int oldfree = sh->free;
x[1] = '1';
sdsIncrLen(x, 1);
-
return (sh->free == oldfree-1);
}