diff options
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-02-12 12:03:58 +0000 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-02-12 12:03:58 +0000 |
commit | abbad00edd7f5f3d33ae77a9d5ac338e5bea5fb3 (patch) | |
tree | 0d55fb4d8e5ad7a9376d1bccdea31104cbecacfe /lib/tests | |
parent | bd7029a99b0c2974265c6665638ef14a052f42ab (diff) | |
download | monitoring-plugins-abbad00edd7f5f3d33ae77a9d5ac338e5bea5fb3.tar.gz |
Import Gnulib floorf and base64 and removed our old base64 library.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1926 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'lib/tests')
-rw-r--r-- | lib/tests/Makefile.am | 2 | ||||
-rw-r--r-- | lib/tests/test_base64.c | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/tests/Makefile.am b/lib/tests/Makefile.am index 0ddc8abf..bd25ccfe 100644 --- a/lib/tests/Makefile.am +++ b/lib/tests/Makefile.am @@ -36,7 +36,7 @@ test_cmd_LDADD = ../utils_cmd.o ../utils_base.o test_base64_SOURCES = test_base64.c test_base64_CFLAGS = -g -I.. test_base64_LDFLAGS = -L/usr/local/lib -ltap -test_base64_LDADD = ../base64.o +test_base64_LDADD = $(top_srcdir)/gl/base64.o test: ${noinst_PROGRAMS} perl -MTest::Harness -e '$$Test::Harness::switches=""; runtests(map {$$_ .= ".t"} @ARGV)' $(EXTRA_PROGRAMS) diff --git a/lib/tests/test_base64.c b/lib/tests/test_base64.c index e3ff3e35..650cfa1a 100644 --- a/lib/tests/test_base64.c +++ b/lib/tests/test_base64.c @@ -18,13 +18,12 @@ *****************************************************************************/ #include "common.h" -#include "base64.h" +#include "gl/base64.h" #include "tap.h" int main (int argc, char **argv) { -#if 0 /* The current base64 function doesn't work on 8bit data */ char random[1024] = { 0x8b,0xb0,0xc4,0xe2,0xfc,0x22,0x9f,0x0d,0x85,0xe7,0x2c,0xaa,0x39,0xa1,0x46,0x88, 0x50,0xe6,0x34,0x37,0x0b,0x45,0x4b,0xb8,0xb2,0x86,0x7a,0x3e,0x7f,0x0c,0x40,0x18, @@ -180,8 +179,9 @@ main (int argc, char **argv) 0x46,0x62,0x5a,0x61,0x35,0x52,0x6e,0x50,0x59,0x43,0x4f,0x36,0x4f,0x70,0x4d,0x6c, 0x41,0x6e,0x6a,0x4d,0x56,0x41,0x3d,0x3d }; -#endif +#if 0 + /* The old base64 function didn't work on 8bit data, below is 7bit */ char random[1024] = { 0x0b,0x30,0x44,0x62,0x7c,0x22,0x1f,0x0d,0x05,0x67,0x2c,0x2a,0x39,0x21,0x46,0x08, 0x50,0x66,0x34,0x37,0x0b,0x45,0x4b,0x38,0x32,0x06,0x7a,0x3e,0x7f,0x0c,0x40,0x18, @@ -336,11 +336,13 @@ main (int argc, char **argv) 0x46,0x54,0x5a,0x61,0x5a,0x52,0x6c,0x50,0x59,0x43,0x4d,0x36,0x4f,0x68,0x4d,0x6c, 0x41,0x6e,0x68,0x4d,0x56,0x41,0x3d,0x3d,0x00 }; +#endif + char *b64_test; plan_tests(1); - b64_test = base64 (random, 1024); + base64_encode_alloc (random, 1024, &b64_test); ok(strcmp(b64_known, b64_test) == 0, "Test matching a base64 encoded 1024 bytes random string"); |