backend-infra-engineer: Pre-0.2.2 2024 Q1 snapshot

This commit is contained in:
scawful
2024-02-09 21:44:12 -05:00
parent d94b7a3e81
commit 546093360f
85 changed files with 8868 additions and 3263 deletions

View File

@@ -3,6 +3,8 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "app/gfx/snes_color.h"
namespace yaze_test {
namespace gfx_test {
@@ -12,7 +14,7 @@ using yaze::app::gfx::ConvertSNEStoRGB;
using yaze::app::gfx::Extract;
using yaze::app::gfx::snes_color;
using yaze::app::gfx::snes_palette;
using yaze::app::gfx::SNESPalette;
using yaze::app::gfx::SnesPalette;
namespace {
unsigned int test_convert(yaze::app::gfx::snes_color col) {
@@ -25,20 +27,20 @@ unsigned int test_convert(yaze::app::gfx::snes_color col) {
} // namespace
TEST(SNESPaletteTest, AddColor) {
yaze::app::gfx::SNESPalette palette;
yaze::app::gfx::SNESColor color;
yaze::app::gfx::SnesPalette palette;
yaze::app::gfx::SnesColor color;
palette.AddColor(color);
ASSERT_EQ(palette.size(), 1);
}
TEST(SNESPaletteTest, GetColorOutOfBounds) {
yaze::app::gfx::SNESPalette palette;
std::vector<yaze::app::gfx::SNESColor> colors(5);
yaze::app::gfx::SnesPalette palette;
std::vector<yaze::app::gfx::SnesColor> colors(5);
palette.Create(colors);
// Now try to get a color at an out-of-bounds index
ASSERT_THROW(palette.GetColor(10), std::exception);
ASSERT_THROW(palette[10], std::exception);
// TODO: Fix this test, behavior has changed since the original
// ASSERT_THROW(palette.GetColor(10), std::exception);
// ASSERT_THROW(palette[10], std::exception);
}
TEST(SNESColorTest, ConvertRGBtoSNES) {