diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-07-02 23:40:03 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-07-02 23:40:03 +0000 |
commit | 7d8de8cd1041ed84f1073c55aa588de88bcd23c3 (patch) | |
tree | f043895ee9396a6b93dd382a23f6ae1137f61192 /src/or/test.c | |
parent | d58d4c0db685da2d6575c4bc0a0136a231c29cf9 (diff) | |
download | tor-7d8de8cd1041ed84f1073c55aa588de88bcd23c3.tar tor-7d8de8cd1041ed84f1073c55aa588de88bcd23c3.tar.gz |
More digest/nickname fixes
svn:r2000
Diffstat (limited to 'src/or/test.c')
-rw-r--r-- | src/or/test.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/test.c b/src/or/test.c index 5ee586611..4dc914589 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -420,6 +420,17 @@ test_crypto() test_eq(i,0); test_streq(data2, "772w2rfobvomsywe"); + /* Base16 tests */ + strcpy(data1, "6chrs\xff"); + i = base16_encode(data2, 13, data1, 6); + test_eq(i,0); + test_streq(data2, "3663687273FF"); + + strcpy(data1, "f0d678affc000100"); + i = base16_decode(data2, 8, data1, 16); + test_eq(i,0); + test_memeq(data2, "\xf0\xd6\x78\xaf\xfc\x00\x01\x00",8); + free(data1); free(data2); free(data3); |