mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
Add testcase for bug 640695
This commit is contained in:
parent
440e6f4a61
commit
069daa69f6
@ -168,6 +168,7 @@ CLEANFILES = \
|
||||
EXTRA_DIST += \
|
||||
4096-random-bytes \
|
||||
keyfiletest.ini \
|
||||
pages.ini \
|
||||
bookmarks.xbel
|
||||
|
||||
dist-hook:
|
||||
|
@ -1350,6 +1350,41 @@ test_non_utf8 (void)
|
||||
#define SRCDIR "."
|
||||
#endif
|
||||
|
||||
static void
|
||||
test_page_boundary (void)
|
||||
{
|
||||
GKeyFile *file;
|
||||
GError *error;
|
||||
gint i;
|
||||
|
||||
#define GROUP "main_section"
|
||||
#define KEY_PREFIX "fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_"
|
||||
#define FIRST_KEY 10
|
||||
#define LAST_KEY 99
|
||||
#define VALUE 92
|
||||
|
||||
g_test_bug ("640695");
|
||||
|
||||
file = g_key_file_new ();
|
||||
|
||||
error = NULL;
|
||||
g_key_file_load_from_file (file, SRCDIR "/pages.ini", G_KEY_FILE_NONE, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
for (i = FIRST_KEY; i <= LAST_KEY; i++)
|
||||
{
|
||||
gchar *key;
|
||||
gint val;
|
||||
|
||||
key = g_strdup_printf (KEY_PREFIX "%d", i);
|
||||
val = g_key_file_get_integer (file, GROUP, key, &error);
|
||||
g_free (key);
|
||||
g_assert_no_error (error);
|
||||
g_assert_cmpint (val, ==, VALUE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
@ -1380,6 +1415,7 @@ main (int argc, char *argv[])
|
||||
g_test_add_func ("/keyfile/int64", test_int64);
|
||||
g_test_add_func ("/keyfile/load", test_load);
|
||||
g_test_add_func ("/keyfile/non-utf8", test_non_utf8);
|
||||
|
||||
g_test_add_func ("/keyfile/page-boundary", test_page_boundary);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
|
92
glib/tests/pages.ini
Normal file
92
glib/tests/pages.ini
Normal file
@ -0,0 +1,92 @@
|
||||
[main_section]
|
||||
fill_specific_length_for_alignment_purposes = 3
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_10 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_11 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_12 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_13 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_14 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_15 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_16 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_17 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_18 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_19 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_20 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_21 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_22 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_23 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_24 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_25 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_26 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_27 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_28 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_29 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_30 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_31 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_32 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_33 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_34 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_35 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_36 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_37 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_38 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_39 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_40 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_41 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_42 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_43 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_44 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_45 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_46 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_47 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_48 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_49 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_50 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_51 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_52 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_53 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_54 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_55 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_56 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_57 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_58 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_59 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_60 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_61 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_62 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_63 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_64 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_65 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_66 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_67 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_68 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_69 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_70 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_71 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_72 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_73 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_74 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_75 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_76 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_77 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_78 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_79 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_80 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_81 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_82 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_83 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_84 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_85 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_86 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_87 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_88 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_89 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_90 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_91 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_92 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_93 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_94 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_95 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_96 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_97 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_98 = 92
|
||||
fill_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw_99 = 92
|
Loading…
Reference in New Issue
Block a user