test-strv.c revision 40857008d814c0c0915767b72c225379ce103a10
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
Copyright 2013 Thomas H.P. Andersen
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <string.h>
#include "util.h"
#include "specifier.h"
#include "strv.h"
static void test_specifier_printf(void) {
char *w;
};
printf("<%s>\n", w);
free(w);
}
static void test_strv_find(void) {
const char * const input_table[] = {
"one",
"two",
"three",
};
}
static void test_strv_find_prefix(void) {
const char * const input_table[] = {
"one",
"two",
"three",
};
}
static void test_strv_join(void) {
const char * const input_table_multiple[] = {
"one",
"two",
"three",
};
const char * const input_table_one[] = {
"one",
};
const char * const input_table_none[] = {
};
}
static void test_strv_parse_nulstr(void) {
_cleanup_strv_free_ char **l = NULL;
const char nulstr[] = "fuck\0fuck2\0fuck3\0\0fuck5\0\0xxx";
puts("Parse nulstr:");
strv_print(l);
}
static void test_strv_overlap(void) {
const char * const input_table[] = {
"one",
"two",
"three",
};
const char * const input_table_overlap[] = {
"two",
};
const char * const input_table_unique[] = {
"four",
"five",
"six",
};
}
static void test_strv_sort(void) {
const char * const input_table[] = {
"durian",
"apple",
"citrus",
"CAPITAL LETTERS FIRST",
"banana",
};
strv_sort((char **)input_table);
}
static void test_strv_merge_concat(void) {
c = strv_merge_concat(a, b, "_suffix");
}
static void test_strv_merge(void) {
c = strv_merge(a, b);
}
static void test_strv_append(void) {
b = strv_append(a, "test2");
}
return 0;
}