33 lines
974 B
C++
33 lines
974 B
C++
#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();
|
|
}
|