test-strv.c revision 10ddd913f0d13584e13b5e6bbcb381f1618c90c0
/*-*- 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);
}
return 0;
}