mirror of
https://github.com/libretro/RetroArch
synced 2025-04-02 16:20:39 +00:00
Silence warnings
This commit is contained in:
parent
2d107b44fa
commit
d1ad5c336e
@ -964,37 +964,46 @@ bool config_file_exists(const char *path)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_config_file_parse_contains(const char * cfgtext, const char * key, const char * val)
|
#if 0
|
||||||
|
static void test_config_file_parse_contains(
|
||||||
|
const char * cfgtext,
|
||||||
|
const char *key, const char *val)
|
||||||
{
|
{
|
||||||
config_file_t* cfg = config_file_new_from_string(cfgtext);
|
config_file_t *cfg = config_file_new_from_string(cfgtext);
|
||||||
char* out;
|
char *out = NULL;
|
||||||
bool ok;
|
bool ok = false;
|
||||||
|
|
||||||
if (!cfg) abort();
|
if (!cfg)
|
||||||
|
abort();
|
||||||
|
|
||||||
ok = config_get_string(cfg, key, &out);
|
ok = config_get_string(cfg, key, &out);
|
||||||
if (ok != (bool)val) abort();
|
if (ok != (bool)val)
|
||||||
if (!val) return;
|
abort();
|
||||||
|
if (!val)
|
||||||
|
return;
|
||||||
|
|
||||||
if (out == NULL) out = strdup("");
|
if (out == NULL)
|
||||||
if (strcmp(out, val) != 0) abort();
|
out = strdup("");
|
||||||
|
if (strcmp(out, val) != 0)
|
||||||
|
abort();
|
||||||
free(out);
|
free(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_config_file()
|
static void test_config_file(void)
|
||||||
{
|
{
|
||||||
test_config_file_parse_contains("foo = \"bar\"\n", "foo", "bar");
|
test_config_file_parse_contains("foo = \"bar\"\n", "foo", "bar");
|
||||||
test_config_file_parse_contains("foo = \"bar\"", "foo", "bar");
|
test_config_file_parse_contains("foo = \"bar\"", "foo", "bar");
|
||||||
test_config_file_parse_contains("foo = \"bar\"\r\n", "foo", "bar");
|
test_config_file_parse_contains("foo = \"bar\"\r\n", "foo", "bar");
|
||||||
test_config_file_parse_contains("foo = \"bar\"", "foo", "bar");
|
test_config_file_parse_contains("foo = \"bar\"", "foo", "bar");
|
||||||
|
|
||||||
/* turns out it treats empty as nonexistent - should probably be fixed */
|
#if 0
|
||||||
/*
|
/* turns out it treats empty as nonexistent -
|
||||||
|
* should probably be fixed */
|
||||||
test_config_file_parse_contains("foo = \"\"\n", "foo", "");
|
test_config_file_parse_contains("foo = \"\"\n", "foo", "");
|
||||||
test_config_file_parse_contains("foo = \"\"", "foo", "");
|
test_config_file_parse_contains("foo = \"\"", "foo", "");
|
||||||
test_config_file_parse_contains("foo = \"\"\r\n", "foo", "");
|
test_config_file_parse_contains("foo = \"\"\r\n", "foo", "");
|
||||||
test_config_file_parse_contains("foo = \"\"", "foo", "");
|
test_config_file_parse_contains("foo = \"\"", "foo", "");
|
||||||
// */
|
#endif
|
||||||
|
|
||||||
test_config_file_parse_contains("foo = \"\"\n", "bar", NULL);
|
test_config_file_parse_contains("foo = \"\"\n", "bar", NULL);
|
||||||
test_config_file_parse_contains("foo = \"\"", "bar", NULL);
|
test_config_file_parse_contains("foo = \"\"", "bar", NULL);
|
||||||
@ -1009,9 +1018,8 @@ void test_config_file()
|
|||||||
&& ./a.out
|
&& ./a.out
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
int main(void)
|
||||||
int main()
|
|
||||||
{
|
{
|
||||||
test_config_file();
|
test_config_file();
|
||||||
}
|
}
|
||||||
*/
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user