Commit ca4ec785 authored by Niels Möller's avatar Niels Möller
Browse files

* testsuite/Makefile.am (TS_PROGS): Added base16-test.

* testsuite/base16-test.c: New test.

Rev: src/nettle/testsuite/Makefile.am:1.27
Rev: src/nettle/testsuite/base16-test.c:1.1
parent e0292d52
......@@ -2,7 +2,7 @@ CFLAGS = -I$(top_srcdir) @CFLAGS@
CPPFLAGS = @CPPFLAGS@
TS_PROGS = aes-test arcfour-test blowfish-test cast128-test \
base64-test \
base16-test base64-test \
des-test des3-test des-compat-test \
md5-test md5-compat-test sha1-test sha256-test \
serpent-test twofish-test \
......
#include "testutils.h"
#include "base16.h"
int
test_main(void)
{
ASSERT(BASE16_ENCODE_LENGTH(0) == 0);
ASSERT(BASE16_ENCODE_LENGTH(1) == 2);
ASSERT(BASE16_ENCODE_LENGTH(2) == 4);
ASSERT(BASE16_DECODE_LENGTH(0) == 0);
ASSERT(BASE16_DECODE_LENGTH(1) == 1);
ASSERT(BASE16_DECODE_LENGTH(2) == 1);
ASSERT(BASE16_DECODE_LENGTH(3) == 2);
ASSERT(BASE16_DECODE_LENGTH(4) == 2);
test_armor(&nettle_base16, 0, "", "");
test_armor(&nettle_base16, 1, "H", "48");
test_armor(&nettle_base16, 2, "He", "4865");
test_armor(&nettle_base16, 3, "Hel", "48656c");
test_armor(&nettle_base16, 4, "Hell", "48656c6c");
test_armor(&nettle_base16, 5, "Hello", "48656c6c6f");
test_armor(&nettle_base16, 6, "Hello", "48656c6c6f00");
SUCCESS();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment