2017-12-02 19:05:53 +00:00
|
|
|
#include <criterion/criterion.h>
|
|
|
|
|
|
|
|
#include "vm_screen.h"
|
|
|
|
|
2017-12-17 22:42:05 +00:00
|
|
|
Test(vm_screen, create) {
|
|
|
|
vm_screen *screen;
|
2017-12-02 19:05:53 +00:00
|
|
|
|
2017-12-17 22:42:05 +00:00
|
|
|
screen = vm_screen_create();
|
|
|
|
cr_assert_neq(screen, NULL);
|
2017-12-02 19:05:53 +00:00
|
|
|
|
2017-12-17 22:42:05 +00:00
|
|
|
cr_assert_eq(screen->color_red, 0);
|
|
|
|
cr_assert_eq(screen->color_blue, 0);
|
|
|
|
cr_assert_eq(screen->color_green, 0);
|
|
|
|
cr_assert_eq(screen->color_alpha, 0);
|
2017-12-02 19:05:53 +00:00
|
|
|
|
2017-12-17 22:42:05 +00:00
|
|
|
vm_screen_free(screen);
|
2017-12-02 19:05:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Test(vm_screen, set_color) {
|
2017-12-17 22:42:05 +00:00
|
|
|
vm_screen *screen;
|
2017-12-02 19:05:53 +00:00
|
|
|
int red = 0xDE;
|
|
|
|
int green = 0xAD;
|
|
|
|
int blue = 0xBE;
|
|
|
|
int alpha = 0xEF;
|
|
|
|
|
2017-12-17 22:42:05 +00:00
|
|
|
screen = vm_screen_create();
|
|
|
|
vm_screen_set_color(screen, red, green, blue, alpha);
|
2017-12-02 19:05:53 +00:00
|
|
|
|
2017-12-17 22:42:05 +00:00
|
|
|
cr_assert_eq(screen->color_red, red);
|
|
|
|
cr_assert_eq(screen->color_green, green);
|
|
|
|
cr_assert_eq(screen->color_blue, blue);
|
|
|
|
cr_assert_eq(screen->color_alpha, alpha);
|
2017-12-02 19:05:53 +00:00
|
|
|
|
2017-12-17 22:42:05 +00:00
|
|
|
vm_screen_free(screen);
|
2017-12-02 19:05:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Test(vm_screen, draw_rect) {
|
|
|
|
// Nothing to do here...
|
|
|
|
}
|