* grub-core/tests/cmdline_cat_test.c: Don't reload unifont if it's

already loaded. This saves memory needed for tests,
This commit is contained in:
Vladimir Serbinenko 2013-11-18 11:45:55 +01:00
parent a284320e1e
commit 4bf703206d
3 changed files with 24 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2013-11-18 Vladimir Serbinenko <phcoder@gmail.com>
* 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 <phcoder@gmail.com> 2013-11-18 Vladimir Serbinenko <phcoder@gmail.com>
Fix handling of install lists. Fix handling of install lists.

View file

@ -66,17 +66,25 @@ struct grub_procfs_entry test_txt =
.get_contents = get_test_txt .get_contents = get_test_txt
}; };
#define FONT_NAME "Unknown Regular 16"
/* Functional test main method. */ /* Functional test main method. */
static void static void
cmdline_cat_test (void) cmdline_cat_test (void)
{ {
unsigned i; unsigned i;
grub_font_t font;
grub_dl_load ("gfxterm"); grub_dl_load ("gfxterm");
grub_errno = GRUB_ERR_NONE; 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); grub_test_assert (0, "unicode font not found: %s", grub_errmsg);
return; return;

View file

@ -91,12 +91,15 @@ struct
{ "gfxterm_high", "menu_color_highlight", "blue/red" }, { "gfxterm_high", "menu_color_highlight", "blue/red" },
}; };
#define FONT_NAME "Unknown Regular 16"
/* Functional test main method. */ /* Functional test main method. */
static void static void
gfxterm_menu (void) gfxterm_menu (void)
{ {
unsigned i, j; unsigned i, j;
grub_font_t font;
grub_dl_load ("png"); grub_dl_load ("png");
grub_dl_load ("gettext"); grub_dl_load ("gettext");
grub_dl_load ("gfxterm"); grub_dl_load ("gfxterm");
@ -105,7 +108,13 @@ gfxterm_menu (void)
grub_dl_load ("gfxmenu"); 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); grub_test_assert (0, "unicode font not found: %s", grub_errmsg);
return; return;