2018-03-13 20:46:21 +00:00
|
|
|
#include <criterion/criterion.h>
|
|
|
|
|
|
|
|
#include "apple2.h"
|
|
|
|
#include "apple2.lores.h"
|
|
|
|
|
|
|
|
/* Test(apple2_lores, draw) */
|
|
|
|
|
|
|
|
Test(apple2_lores, color)
|
|
|
|
{
|
|
|
|
static vm_color lores_colors[] = {
|
|
|
|
{ 0x00, 0x00, 0x00, 0x00 }, // black
|
|
|
|
{ 0xff, 0x28, 0x97, 0x00 }, // magenta
|
|
|
|
{ 0x60, 0x4d, 0xbc, 0x00 }, // dark blue
|
|
|
|
{ 0xff, 0x44, 0xfd, 0x00 }, // purple
|
|
|
|
{ 0x00, 0xa3, 0x60, 0x00 }, // dark green
|
|
|
|
{ 0x9c, 0x9c, 0x9c, 0x00 }, // gray
|
|
|
|
{ 0x14, 0xcf, 0xfd, 0x00 }, // medium blue
|
|
|
|
{ 0xd0, 0xc3, 0xff, 0x00 }, // light blue
|
|
|
|
{ 0x60, 0x72, 0x03, 0x00 }, // brown
|
|
|
|
{ 0xff, 0x6a, 0x3c, 0x00 }, // orange
|
|
|
|
{ 0x9c, 0x9c, 0x9c, 0x00 }, // gray
|
|
|
|
{ 0xff, 0xa0, 0xd0, 0x00 }, // pink
|
|
|
|
{ 0x14, 0xf5, 0x3c, 0x00 }, // light green
|
|
|
|
{ 0xd0, 0xdd, 0x81, 0x00 }, // yellow
|
|
|
|
{ 0x72, 0xff, 0xd0, 0x00 }, // aquamarine
|
|
|
|
{ 0xff, 0xff, 0xff, 0x00 }, // white
|
|
|
|
};
|
|
|
|
|
|
|
|
vm_color clr;
|
|
|
|
int len = sizeof(lores_colors) / sizeof(vm_color);
|
|
|
|
|
|
|
|
for (int i = 0; i < len; i++) {
|
|
|
|
clr = apple2_lores_color(i);
|
|
|
|
cr_assert_eq(memcmp(&clr, &lores_colors[i], sizeof(vm_color)), 0);
|
|
|
|
}
|
|
|
|
}
|