9 static void test_b64_encode(const char *src
)
11 char *dst
= malloc(BUF_LEN
+1);
12 int r
= b64_encode(src
, strlen(src
), dst
, BUF_LEN
);
13 fprintf(stdout
, "%d %s\n", r
, dst
);
17 static void test_b64_decode(const char *src
)
19 char *dst
= malloc(BUF_LEN
+1);
20 int r
= b64_decode(src
, dst
, BUF_LEN
);
21 fprintf(stdout
, "%d %s\n", r
, dst
);
29 test_b64_encode("fo");
30 test_b64_encode("foo");
31 test_b64_encode("foob");
32 test_b64_encode("fooba");
33 test_b64_encode("foobar");
36 test_b64_decode("Zg==");
37 test_b64_decode("Zm8=");
38 test_b64_decode("Zm9v");
39 test_b64_decode("Zm9vYg==");
40 test_b64_decode("Zm9vYmE=");
41 test_b64_decode("Zm9vYmFy");