81 lines
2.4 KiB
C
81 lines
2.4 KiB
C
/*
|
|
* VAS_EBOOT -- GRand Unified Bootloader
|
|
* Copyright (C) 2013 Free Software Foundation, Inc.
|
|
*
|
|
* VAS_EBOOT is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* VAS_EBOOT is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with VAS_EBOOT. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
/* All tests need to include test.h for VAS_EBOOT testing framework. */
|
|
#include <VasEBoot/test.h>
|
|
#include <VasEBoot/dl.h>
|
|
#include <VasEBoot/video.h>
|
|
#include <VasEBoot/video_fb.h>
|
|
#include <VasEBoot/command.h>
|
|
#include <VasEBoot/font.h>
|
|
|
|
VAS_EBOOT_MOD_LICENSE ("GPLv3+");
|
|
|
|
#define FONT_NAME "Unknown Regular 16"
|
|
|
|
/* Functional test main method. */
|
|
static void
|
|
videotest_checksum (void)
|
|
{
|
|
unsigned i;
|
|
VasEBoot_font_t font;
|
|
|
|
font = VasEBoot_font_get (FONT_NAME);
|
|
if (font && VasEBoot_strcmp (font->name, FONT_NAME) != 0)
|
|
font = 0;
|
|
if (!font)
|
|
font = VasEBoot_font_load ("unicode");
|
|
|
|
if (!font)
|
|
{
|
|
VasEBoot_test_assert (0, "unicode font not found: %s", VasEBoot_errmsg);
|
|
return;
|
|
}
|
|
|
|
for (i = 0; i < ARRAY_SIZE (VasEBoot_test_video_modes); i++)
|
|
{
|
|
VasEBoot_err_t err;
|
|
#if defined (VAS_EBOOT_MACHINE_MIPS_QEMU_MIPS) || defined (VAS_EBOOT_MACHINE_IEEE1275)
|
|
if (VasEBoot_test_video_modes[i].width > 1024)
|
|
continue;
|
|
#endif
|
|
err = VasEBoot_video_capture_start (&VasEBoot_test_video_modes[i],
|
|
VasEBoot_video_fbstd_colors,
|
|
VasEBoot_test_video_modes[i].number_of_colors);
|
|
if (err)
|
|
{
|
|
VasEBoot_test_assert (0, "can't start capture: %s", VasEBoot_errmsg);
|
|
VasEBoot_print_error ();
|
|
continue;
|
|
}
|
|
VasEBoot_terminal_input_fake_sequence ((int []) { '\n' }, 1);
|
|
|
|
VasEBoot_video_checksum ("videotest");
|
|
|
|
char *args[] = { 0 };
|
|
VasEBoot_command_execute ("videotest", 0, args);
|
|
|
|
VasEBoot_terminal_input_fake_sequence_end ();
|
|
VasEBoot_video_checksum_end ();
|
|
VasEBoot_video_capture_end ();
|
|
}
|
|
}
|
|
|
|
/* Register example_test method as a functional test. */
|
|
VAS_EBOOT_FUNCTIONAL_TEST (videotest_checksum, videotest_checksum);
|