1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 11:52:40 +01:00
openrw/tests/test_ViewCamera.cpp
2019-05-23 23:38:43 +01:00

27 lines
559 B
C++

#include <boost/test/unit_test.hpp>
#include "test_Globals.hpp"
#include <render/ViewCamera.hpp>
namespace {
struct CameraFixture {
ViewCamera camera_ {
{1.f, 2.f, 3.f}
};
};
}
BOOST_AUTO_TEST_SUITE(ViewCameraTests)
BOOST_FIXTURE_TEST_CASE(test_creation, CameraFixture) {
BOOST_CHECK_EQUAL(camera_.position, glm::vec3(1.f, 2.f, 3.f));
}
BOOST_FIXTURE_TEST_CASE(test_view_matrix, CameraFixture) {
const auto& view = camera_.getView();
BOOST_CHECK_EQUAL(view[3], glm::vec4(2.f, -3.f, 1.f, 1.f));
}
BOOST_AUTO_TEST_SUITE_END()