diff --git a/ChangeLog b/ChangeLog index 8e286bf76..e1989f780 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-11-18 Vladimir Serbinenko + + * grub-core/tests/cmdline_cat_test.c: Don't reload unifont if it's + already loaded. This saves memory needed for tests, + 2013-11-18 Vladimir Serbinenko Fix handling of install lists. diff --git a/grub-core/tests/cmdline_cat_test.c b/grub-core/tests/cmdline_cat_test.c index 3337d34cb..c3de5c464 100644 --- a/grub-core/tests/cmdline_cat_test.c +++ b/grub-core/tests/cmdline_cat_test.c @@ -66,17 +66,25 @@ struct grub_procfs_entry test_txt = .get_contents = get_test_txt }; +#define FONT_NAME "Unknown Regular 16" /* Functional test main method. */ static void cmdline_cat_test (void) { unsigned i; + grub_font_t font; grub_dl_load ("gfxterm"); grub_errno = GRUB_ERR_NONE; - if (grub_font_load ("unicode") == 0) + font = grub_font_get (FONT_NAME); + if (font && grub_strcmp (font->name, FONT_NAME) != 0) + font = 0; + if (!font) + font = grub_font_load ("unicode"); + + if (!font) { grub_test_assert (0, "unicode font not found: %s", grub_errmsg); return; diff --git a/grub-core/tests/gfxterm_menu.c b/grub-core/tests/gfxterm_menu.c index 68531892f..879fbc003 100644 --- a/grub-core/tests/gfxterm_menu.c +++ b/grub-core/tests/gfxterm_menu.c @@ -91,12 +91,15 @@ struct { "gfxterm_high", "menu_color_highlight", "blue/red" }, }; +#define FONT_NAME "Unknown Regular 16" /* Functional test main method. */ static void gfxterm_menu (void) { unsigned i, j; + grub_font_t font; + grub_dl_load ("png"); grub_dl_load ("gettext"); grub_dl_load ("gfxterm"); @@ -105,7 +108,13 @@ gfxterm_menu (void) grub_dl_load ("gfxmenu"); - if (grub_font_load ("unicode") == 0) + font = grub_font_get (FONT_NAME); + if (font && grub_strcmp (font->name, FONT_NAME) != 0) + font = 0; + if (!font) + font = grub_font_load ("unicode"); + + if (!font) { grub_test_assert (0, "unicode font not found: %s", grub_errmsg); return;