summaryrefslogtreecommitdiff
path: root/jni/iodine/tests/base32.c
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2014-08-11 23:26:36 +0200
committerYves Fischer <yvesf-git@xapek.org>2014-08-11 23:26:36 +0200
commit5d8801d4687035ae45143f0f3bc3eeaf75dc17ec (patch)
treebf4395fd5938eb1865ba90b6e52e169d727d9404 /jni/iodine/tests/base32.c
parent1251ce0d7cf2619f9b41637dcb88bebb66e54fb3 (diff)
downloadandiodine-5d8801d4687035ae45143f0f3bc3eeaf75dc17ec.tar.gz
andiodine-5d8801d4687035ae45143f0f3bc3eeaf75dc17ec.zip
Upgrade code to iodine 0.7.0 and improve logging
Diffstat (limited to 'jni/iodine/tests/base32.c')
-rw-r--r--jni/iodine/tests/base32.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/jni/iodine/tests/base32.c b/jni/iodine/tests/base32.c
index 9ff0cf7..419253f 100644
--- a/jni/iodine/tests/base32.c
+++ b/jni/iodine/tests/base32.c
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2006-2009 Bjorn Andersson <flex@kryo.se>, Erik Ekman <yarrick@kryo.se>
+ * Copyright (c) 2006-2014 Erik Ekman <yarrick@kryo.se>,
+ * 2006-2009 Bjorn Andersson <flex@kryo.se>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -50,6 +51,7 @@ START_TEST(test_base32_encode)
len = sizeof(buf);
val = b32->encode(buf, &len, testpairs[_i].a, strlen(testpairs[_i].a));
+ fail_unless(val == strlen(testpairs[_i].b));
fail_unless(strcmp(buf, testpairs[_i].b) == 0,
"'%s' != '%s'", buf, testpairs[_i].b);
}
@@ -61,13 +63,13 @@ START_TEST(test_base32_decode)
char buf[4096];
struct encoder *b32;
int val;
-
+
b32 = get_base32_encoder();
len = sizeof(buf);
val = b32->decode(buf, &len, testpairs[_i].b, strlen(testpairs[_i].b));
- fail_unless(buf != NULL, "buf == NULL");
+ fail_unless(val == strlen(testpairs[_i].a));
fail_unless(strcmp(buf, testpairs[_i].a) == 0,
"'%s' != '%s'", buf, testpairs[_i].a);
}
@@ -79,7 +81,7 @@ START_TEST(test_base32_5to8_8to5)
int c;
for (i = 0; i < 32; i++) {
- c = b32_5to8(i);
+ c = b32_5to8(i);
fail_unless(b32_8to5(c) == i);
}
}