Route canvas camera reset through app core
This commit is contained in:
32
tests/app_core/canvas_view_tests.cpp
Normal file
32
tests/app_core/canvas_view_tests.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#include "app_core/canvas_view.h"
|
||||
#include "test_harness.h"
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace {
|
||||
|
||||
void camera_reset_projects_legacy_defaults(pp::tests::Harness& harness)
|
||||
{
|
||||
const auto state = pp::app::plan_canvas_camera_reset();
|
||||
|
||||
for (std::size_t index = 0; index < state.rotation.size(); ++index) {
|
||||
const bool diagonal = index == 0 || index == 5 || index == 10 || index == 15;
|
||||
PP_EXPECT(harness, state.rotation[index] == (diagonal ? 1.0F : 0.0F));
|
||||
}
|
||||
|
||||
PP_EXPECT(harness, state.position[0] == 0.0F);
|
||||
PP_EXPECT(harness, state.position[1] == 0.0F);
|
||||
PP_EXPECT(harness, state.position[2] == 0.0F);
|
||||
PP_EXPECT(harness, state.field_of_view_degrees == 85.0F);
|
||||
PP_EXPECT(harness, state.pan[0] == 0.0F);
|
||||
PP_EXPECT(harness, state.pan[1] == 0.0F);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main()
|
||||
{
|
||||
pp::tests::Harness harness;
|
||||
harness.run("camera reset projects legacy defaults", camera_reset_projects_legacy_defaults);
|
||||
return harness.finish();
|
||||
}
|
||||
Reference in New Issue
Block a user