summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-02-16 18:07:52 +0100
committerHaru <haru@dotalux.com>2016-02-17 10:40:44 +0100
commit03a5c603be2cf6d5feea9012029f8899c624557a (patch)
tree80c98e0f160700d7441c2642cd7489f7b8645177 /src/test
parent28588859a64fb03335ca5e4083fb6ad95d88db6e (diff)
downloadhercules-03a5c603be2cf6d5feea9012029f8899c624557a.tar.gz
hercules-03a5c603be2cf6d5feea9012029f8899c624557a.tar.bz2
hercules-03a5c603be2cf6d5feea9012029f8899c624557a.tar.xz
hercules-03a5c603be2cf6d5feea9012029f8899c624557a.zip
Removed unnecessary typedefs from libconfig
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_libconfig.c86
1 files changed, 43 insertions, 43 deletions
diff --git a/src/test/test_libconfig.c b/src/test/test_libconfig.c
index e5e6b4d70..a3b233b98 100644
--- a/src/test/test_libconfig.c
+++ b/src/test/test_libconfig.c
@@ -71,7 +71,7 @@ static const char *test_libconfig_defaults(void)
static const char *test_libconfig_init_destroy(void)
{
- config_t config;
+ struct config_t config;
libconfig->init(&config);
if (config.root == NULL || config.root != config_root_setting(&config)) {
return "Unable to create config.";
@@ -85,7 +85,7 @@ static const char *test_libconfig_init_destroy(void)
static const char *test_libconfig_read_file_src(void)
{
- config_t config;
+ struct config_t config;
#define FILENAME "src/test/libconfig/test.conf"
if (libconfig->read_file_src(&config, FILENAME) == CONFIG_FALSE) {
libconfig->destroy(&config);
@@ -102,7 +102,7 @@ static const char *test_libconfig_read_file_src(void)
static const char *test_libconfig_read(void)
{
- config_t config;
+ struct config_t config;
#define FILENAME "src/test/libconfig/test.conf"
FILE *fp = fopen(FILENAME, "r");
if (!fp) {
@@ -124,7 +124,7 @@ static const char *test_libconfig_read(void)
static const char *test_libconfig_load_file(void)
{
- config_t config;
+ struct config_t config;
#define FILENAME "src/test/libconfig/test.conf"
if (libconfig->load_file(&config, FILENAME) == CONFIG_FALSE) {
return "Unable to read file '" FILENAME "'.";
@@ -140,19 +140,19 @@ static const char *test_libconfig_load_file(void)
static const char *test_libconfig_write(void)
{
- //void (*write) (const config_t *config, FILE *stream);
+ //void (*write) (const struct config_t *config, FILE *stream);
return "TEST NOT IMPLEMENTED";
}
static const char *test_libconfig_write_file(void)
{
- //int (*write_file) (config_t *config, const char *filename);
+ //int (*write_file) (struct config_t *config, const char *filename);
return "TEST NOT IMPLEMENTED";
}
static const char *test_libconfig_read_string(void)
{
- config_t config;
+ struct config_t config;
if (libconfig->read_string(&config, "") == CONFIG_FALSE) {
libconfig->destroy(&config);
return "Unable to read from string.";
@@ -167,7 +167,7 @@ static const char *test_libconfig_read_string(void)
static const char *test_libconfig_syntax(void)
{
- config_t config;
+ struct config_t config;
const char *input = "/* Test File */\n"
"Setting_Int: 1;\n"
"Setting_Int64: 1L;\n"
@@ -193,14 +193,14 @@ static const char *test_libconfig_syntax(void)
static const char *test_libconfig_set_include_dir(void)
{
- //void (*set_include_dir) (config_t *config, const char *include_dir);
+ //void (*set_include_dir) (struct config_t *config, const char *include_dir);
return "TEST NOT IMPLEMENTED";
}
static const char *test_libconfig_lookup(void)
{
- config_t config;
- config_setting_t *t = NULL;
+ struct config_t config;
+ struct config_setting_t *t = NULL;
int32 i32;
int64 i64;
double f;
@@ -263,8 +263,8 @@ static const char *test_libconfig_lookup(void)
static const char *test_libconfig_setting_get(void)
{
- config_t config;
- config_setting_t *t = NULL;
+ struct config_t config;
+ struct config_setting_t *t = NULL;
double f;
const char *str;
const char *input = "/* Test File */\n"
@@ -366,17 +366,17 @@ static const char *test_libconfig_setting_get(void)
static const char *test_libconfig_set(void)
{
- //int (*setting_set_int) (config_setting_t *setting ,int value);
- //int (*setting_set_int64) (config_setting_t *setting, long long value);
- //int (*setting_set_float) (config_setting_t *setting, double value);
- //int (*setting_set_bool) (config_setting_t *setting, int value);
- //int (*setting_set_string) (config_setting_t *setting, const char *value);
+ //int (*setting_set_int) (struct config_setting_t *setting ,int value);
+ //int (*setting_set_int64) (struct config_setting_t *setting, long long value);
+ //int (*setting_set_float) (struct config_setting_t *setting, double value);
+ //int (*setting_set_bool) (struct config_setting_t *setting, int value);
+ //int (*setting_set_string) (struct config_setting_t *setting, const char *value);
return "TEST NOT IMPLEMENTED";
}
static const char *test_libconfig_setting_lookup(void)
{
- config_t config;
+ struct config_t config;
int32 i32;
int64 i64;
double f;
@@ -429,8 +429,8 @@ static const char *test_libconfig_setting_lookup(void)
static const char *test_libconfig_setting_types(void)
{
- config_t config;
- config_setting_t *t;
+ struct config_t config;
+ struct config_setting_t *t;
const char *input = "/* Test File */\n"
"Setting_Int: 1;\n"
"Setting_Int64: 1L;\n"
@@ -523,7 +523,7 @@ static const char *test_libconfig_setting_types(void)
static const char *test_libconfig_values(void)
{
- config_t config;
+ struct config_t config;
int32 i32;
int64 i64;
const char *input = "/* Test File */\n"
@@ -583,7 +583,7 @@ static const char *test_libconfig_values(void)
static const char *test_libconfig_path_lookup(void)
{
- config_t config;
+ struct config_t config;
int32 i32;
const char *input = "/* Test File */\n"
"Setting_Array: [1, 2, 3];\n"
@@ -666,7 +666,7 @@ static const char *test_libconfig_path_lookup(void)
static const char *test_libconfig_setting_names(void)
{
- config_t config;
+ struct config_t config;
int32 i32;
const char *input = "/* Test File */\n"
"Setting'with'apostrophes: 1;\n"
@@ -724,9 +724,9 @@ static const char *test_libconfig_setting_names(void)
static const char *test_libconfig_duplicate_keys(void)
{
- config_t config;
+ struct config_t config;
int32 i32;
- config_setting_t *t, *tt;
+ struct config_setting_t *t, *tt;
int i = 0;
const char *input = "/* Test File */\n"
"Setting_Group: {\n"
@@ -775,7 +775,7 @@ static const char *test_libconfig_duplicate_keys(void)
static const char *test_libconfig_special_string_syntax(void)
{
- config_t config;
+ struct config_t config;
const char *str;
const char *input = "/* Test File */\n"
"SpecialString: <\"This is an \"Item_Script\" Special String\n\tWith a line-break inside.\">;\n"
@@ -815,27 +815,27 @@ int do_init(int argc, char **argv)
TEST("libconfig->read_string", test_libconfig_read_string);
TEST("libconfig syntax", test_libconfig_syntax);
(void)test_libconfig_set_include_dir; //TEST("libconfig->set_include_dir", test_libconfig_set_include_dir);
- //int (*setting_set_format) (config_setting_t *setting, short format);
- //short (*setting_get_format) (const config_setting_t *setting);
- //config_setting_t * (*setting_set_int_elem) (config_setting_t *setting, int idx, int value);
- //config_setting_t * (*setting_set_int64_elem) (config_setting_t *setting, int idx, long long value);
- //config_setting_t * (*setting_set_float_elem) (config_setting_t *setting, int idx, double value);
- //config_setting_t * (*setting_set_bool_elem) (config_setting_t *setting, int idx, int value);
- //config_setting_t * (*setting_set_string_elem) (config_setting_t *setting, int idx, const char *value);
- //config_setting_t * (*setting_add) (config_setting_t *parent, const char *name, int type);
- //int (*setting_remove) (config_setting_t *parent, const char *name);
- //int (*setting_remove_elem) (config_setting_t *parent, unsigned int idx);
- //void (*setting_set_hook) (config_setting_t *setting, void *hook);
- //void (*set_destructor) (config_t *config, void (*destructor)(void *));
+ //int (*setting_set_format) (struct config_setting_t *setting, short format);
+ //short (*setting_get_format) (const struct config_setting_t *setting);
+ //struct config_setting_t * (*setting_set_int_elem) (struct config_setting_t *setting, int idx, int value);
+ //struct config_setting_t * (*setting_set_int64_elem) (struct config_setting_t *setting, int idx, long long value);
+ //struct config_setting_t * (*setting_set_float_elem) (struct config_setting_t *setting, int idx, double value);
+ //struct config_setting_t * (*setting_set_bool_elem) (struct config_setting_t *setting, int idx, int value);
+ //struct config_setting_t * (*setting_set_string_elem) (struct config_setting_t *setting, int idx, const char *value);
+ //struct config_setting_t * (*setting_add) (struct config_setting_t *parent, const char *name, int type);
+ //int (*setting_remove) (struct config_setting_t *parent, const char *name);
+ //int (*setting_remove_elem) (struct config_setting_t *parent, unsigned int idx);
+ //void (*setting_set_hook) (struct config_setting_t *setting, void *hook);
+ //void (*set_destructor) (struct config_t *config, void (*destructor)(void *));
TEST("libconfig->lookup_*", test_libconfig_lookup);
TEST("libconfig->setting_get_*", test_libconfig_setting_get);
(void)test_libconfig_set; //TEST("libconfig->setting_set_*", test_libconfig_setting_set);
TEST("libconfig->setting_lookup_*", test_libconfig_setting_lookup);
TEST("setting types", test_libconfig_setting_types);
- //void (*setting_copy_simple) (config_setting_t *parent, const config_setting_t *src);
- //void (*setting_copy_elem) (config_setting_t *parent, const config_setting_t *src);
- //void (*setting_copy_aggregate) (config_setting_t *parent, const config_setting_t *src);
- //int (*setting_copy) (config_setting_t *parent, const config_setting_t *src);
+ //void (*setting_copy_simple) (struct config_setting_t *parent, const struct config_setting_t *src);
+ //void (*setting_copy_elem) (struct config_setting_t *parent, const struct config_setting_t *src);
+ //void (*setting_copy_aggregate) (struct config_setting_t *parent, const struct config_setting_t *src);
+ //int (*setting_copy) (struct config_setting_t *parent, const struct config_setting_t *src);
TEST("values", test_libconfig_values);
TEST("path lookup", test_libconfig_path_lookup);
TEST("setting key names", test_libconfig_setting_names);