test-lib.c revision b5fbbd9b27a204d3acd78d81c91bf5b31f934134
76b43e4417bab52e913da39b5f5bc2a130d3f149Timo Sirainen/* Copyright (c) 2007 Dovecot authors, see the included COPYING file */
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen#include "test-lib.h"
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen#include "array.h"
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen#include "str.h"
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen#include "base64.h"
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen#include "bsearch-insert-pos.h"
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen#include "seq-range-array.h"
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen#include "str-sanitize.h"
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainenstatic void test_base64_encode(void)
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen{
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen static const char *input[] = {
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen "hello world",
252db51b6c0a605163326b3ea5d09e9936ca3b29Timo Sirainen "foo barits",
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen "just niin"
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen };
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen static const char *output[] = {
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen "aGVsbG8gd29ybGQ=",
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen "Zm9vIGJhcml0cw==",
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen "anVzdCBuaWlu"
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen };
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen string_t *str;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen unsigned int i;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen bool success;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen str = t_str_new(256);
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen for (i = 0; i < N_ELEMENTS(input); i++) {
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen str_truncate(str, 0);
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen base64_encode(input[i], strlen(input[i]), str);
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen success = strcmp(output[i], str_c(str)) == 0;
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen test_out(t_strdup_printf("base64_encode(%d)", i), success);
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen }
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen}
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainenstruct test_base64_decode_output {
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen const char *text;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen int ret;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen unsigned int src_pos;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen};
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainenstatic void test_base64_decode(void)
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen{
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen static const char *input[] = {
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen "\taGVsbG8gd29ybGQ=",
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen "\nZm9v\n \tIGJh \t\ncml0cw==",
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen " anVzdCBuaWlu \n",
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen "aGVsb",
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen "aGVsb!!!!!",
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen "aGVs!!!!!"
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen };
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen static const struct test_base64_decode_output output[] = {
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen { "hello world", 0, -1 },
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen { "foo barits", 0, -1 },
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen { "just niin", 1, -1 },
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen { "hel", 1, 4 },
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen { "hel", -1, 4 },
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen { "hel", -1, 4 }
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen };
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen string_t *str;
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen unsigned int i;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen size_t src_pos;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen int ret;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen bool success;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen str = t_str_new(256);
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen for (i = 0; i < N_ELEMENTS(input); i++) {
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen str_truncate(str, 0);
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen src_pos = 0;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen ret = base64_decode(input[i], strlen(input[i]), &src_pos, str);
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen success = output[i].ret == ret &&
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen strcmp(output[i].text, str_c(str)) == 0 &&
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen (src_pos == output[i].src_pos ||
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen (output[i].src_pos == (unsigned int)-1 &&
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen src_pos == strlen(input[i])));
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen test_out(t_strdup_printf("base64_decode(%d)", i), success);
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen }
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen}
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainenstatic int cmp_uint(const void *p1, const void *p2)
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen{
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen const unsigned int *i1 = p1, *i2 = p2;
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen return *i1 - *i2;
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen}
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainenstatic void test_bsearch_insert_pos(void)
fe363b433b8038a69b55169da9dca27892ad7d18Timo Sirainen{
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen static const unsigned int input[] = {
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen 1, 5, 9, 15, 16, -1,
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen 1, 5, 9, 15, 16, 17, -1,
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen -1
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen };
252db51b6c0a605163326b3ea5d09e9936ca3b29Timo Sirainen static const unsigned int max_key = 18;
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen const unsigned int *cur;
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen unsigned int key, len, i, idx;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen bool success;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen cur = input;
597dba3488c648ffb375ee4a552bd52ac4346979Timo Sirainen for (i = 0; cur[0] != -1U; i++) {
74f810327aca91b3375d3fc963bce8076785b1cbTimo Sirainen for (len = 0; cur[len] != -1U; len++) ;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen for (key = 0; key < max_key; key++) {
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen if (bsearch_insert_pos(&key, cur, len, sizeof(*cur),
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen cmp_uint, &idx))
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen success = cur[idx] == key;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen else if (idx == 0)
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen success = cur[0] > key;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen else if (idx == len)
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen success = cur[len-1] < key;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen else {
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen success = cur[idx-1] < key &&
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen cur[idx+1] > key;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen }
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen if (!success)
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen break;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen }
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen cur += len + 1;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen test_out(t_strdup_printf("bsearch_insert_pos(%d,%d)", i, key),
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen success);
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen }
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen}
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainenstatic void test_seq_range_array(void)
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen{
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen static const unsigned int input_min = 1, input_max = 5;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen static const unsigned int input[] = {
0a70a2e71658d168f75d1f075661d7936701343cTimo Sirainen 1, 2, 3, 4, 5, -1U,
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen 2, 3, 4, -1U,
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen 1, 2, 4, 5, -1U,
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen 1, 3, 5, -1U,
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen 1, -1U,
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen 5, -1U,
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen -1U
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen };
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen ARRAY_TYPE(seq_range) range = ARRAY_INIT;
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen unsigned int i, j, seq, start, num;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen bool old_exists, success;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen
4fdf60e22b5340fe35f083b9ea5eb3fd1cf2e742Timo Sirainen for (i = num = 0; input[i] != -1U; num++, i++) {
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen success = TRUE;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen start = i;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen for (; input[i] != -1U; i++) {
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen seq_range_array_add(&range, 32, input[i]);
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen for (j = start; j < i; j++) {
43d32cbe60fdaef2699d99f1ca259053e9350411Timo Sirainen if (!seq_range_exists(&range, input[j]))
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen success = FALSE;
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen }
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen }
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen seq_range_array_invert(&range, input_min, input_max);
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen for (seq = input_min; seq <= input_max; seq++) {
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen for (j = start; input[j] != -1U; j++) {
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen if (input[j] == seq)
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen break;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen }
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen old_exists = input[j] != -1U;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen if (seq_range_exists(&range, seq) == old_exists)
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen success = FALSE;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen }
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen test_out(t_strdup_printf("seq_range_array_invert(%u)", num),
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen success);
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen array_free(&range);
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen }
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen}
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainenstruct str_sanitize_input {
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen const char *str;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen unsigned int max_len;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen};
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainenstatic void test_str_sanitize(void)
74f810327aca91b3375d3fc963bce8076785b1cbTimo Sirainen{
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen static struct str_sanitize_input input[] = {
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen { NULL, 2 },
fe363b433b8038a69b55169da9dca27892ad7d18Timo Sirainen { "", 2 },
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen { "a", 2 },
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen { "ab", 2 },
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen { "abc", 2 },
fe363b433b8038a69b55169da9dca27892ad7d18Timo Sirainen { "abcd", 3 },
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen { "abcde", 4 }
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen };
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen static const char *output[] = {
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen NULL,
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen "",
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen "a",
fe363b433b8038a69b55169da9dca27892ad7d18Timo Sirainen "ab",
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen "...",
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen "...",
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen "a..."
fe363b433b8038a69b55169da9dca27892ad7d18Timo Sirainen };
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen const char *str;
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen unsigned int i;
597dba3488c648ffb375ee4a552bd52ac4346979Timo Sirainen bool success;
597dba3488c648ffb375ee4a552bd52ac4346979Timo Sirainen
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen for (i = 0; i < N_ELEMENTS(input); i++) {
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen str = str_sanitize(input[i].str, input[i].max_len);
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen success = null_strcmp(output[i], str) == 0;
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen test_out(t_strdup_printf("str_sanitize(%d)", i), success);
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen }
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen}
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainenint main(void)
a94936bafd127680184da114c6a177b37ff656e5Timo Sirainen{
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen test_init();
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen test_base64_encode();
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen test_base64_decode();
9511a40d933181045343110c8101b75887062aaeTimo Sirainen test_bsearch_insert_pos();
9511a40d933181045343110c8101b75887062aaeTimo Sirainen test_seq_range_array();
ea37a9aedfc3a6ff5f4ea10bc4eff4ca23f62a15Timo Sirainen test_str_sanitize();
test_istreams();
return test_deinit();
}