mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-27 17:52:58 +02:00
Add some tests for invalid floating point numbers.
2006-05-08 Matthias Clasen <mclasen@redhat.com> * tests/keyfile-test.c (test_number): Add some tests for invalid floating point numbers.
This commit is contained in:
committed by
Matthias Clasen
parent
727f0fea57
commit
eda3af5546
@@ -697,7 +697,11 @@ test_number (void)
|
||||
"key1=0xffff\n"
|
||||
"key2=0.5\n"
|
||||
"key3=1e37\n"
|
||||
"key4=ten\n";
|
||||
"key4=ten\n"
|
||||
"key5=\n"
|
||||
"key6=1.0.0\n"
|
||||
"key7=2x2\n"
|
||||
"key8=abc\n";
|
||||
|
||||
keyfile = load_data (data, 0);
|
||||
|
||||
@@ -723,6 +727,18 @@ test_number (void)
|
||||
g_key_file_get_integer (keyfile, "invalid", "key4", &error);
|
||||
check_error (&error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_INVALID_VALUE);
|
||||
|
||||
g_key_file_get_double (keyfile, "invalid", "key5", &error);
|
||||
check_error (&error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_INVALID_VALUE);
|
||||
|
||||
g_key_file_get_double (keyfile, "invalid", "key6", &error);
|
||||
check_error (&error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_INVALID_VALUE);
|
||||
|
||||
g_key_file_get_double (keyfile, "invalid", "key7", &error);
|
||||
check_error (&error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_INVALID_VALUE);
|
||||
|
||||
g_key_file_get_double (keyfile, "invalid", "key8", &error);
|
||||
check_error (&error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_INVALID_VALUE);
|
||||
|
||||
g_key_file_free (keyfile);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user