This repository has been archived on 2022-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
space-war/tests/unittest.hpp

28 lines
748 B
C++
Raw Permalink Normal View History

#pragma once
#include "tinyengine/libmath.hpp"
#include "tinyengine/tool.hpp"
#define TEST_TRUE(condition) do { \
if (!(condition)) { \
std::cout << "[TEST_TRUE] " << #condition << " test failed!" << std::endl; \
FATAL_ERROR("TEST TRUE failed"); \
} \
} while(0)
#define TEST_FALSE(condition) do { \
if (condition) { \
std::cout << "[TEST FALSE] " << #condition << " test failed!" << std::endl; \
FATAL_ERROR("TEST FALSE failed"); \
} \
} while(0)
inline Mat44 CreateTextureTransform(const Size& size, const Point& pos) {
return Mat44({
size.w, 0, 0, pos.x,
0, size.h, 0, pos.y,
0, 0, 1, 0,
0, 0, 0, 1,
});
}