Commit deae0f20 authored by Robert Menzel's avatar Robert Menzel

removed unmaintained tests

parent 61a2ae68
......@@ -389,45 +389,3 @@ void GenericCamera::setFocalLengthInPixel( float _focalLengthInPixel )
setHorizontalFieldOfView( calcRadToDeg( hFoVrad ) );
}
/////////////// TESTS /////////////
#define DISABLE_TESTING
#ifndef DISABLE_TESTING
#include <gtest/gtest.h>
TEST(GenericCamera, SimpleTest)
{
GenericCamera cam;
cam.setNearClippingPlane(.33f);
cam.setFarClippingPlane(3333.33f);
cam.setLookAtMatrix(glm::vec3(0,0,-10), glm::vec3(0,0,10), glm::vec3(0,1,0));
ASSERT_TRUE(isApproxEqual(cam.getLookAtDistance(), 20.0f));
ASSERT_TRUE(isApproxEqual(cam.getPosition(), glm::vec3(0,0,-10)));
ASSERT_TRUE(isApproxEqual(cam.getTarget(), glm::vec3(0,0,10)));
ASSERT_TRUE(isApproxEqual(cam.getUpDirection(), glm::vec3(0,1,0)));
ASSERT_TRUE(isApproxEqual(cam.getForwardDirection(), glm::vec3(0,0,1)));
ASSERT_TRUE(isApproxEqual(cam.getRightDirection(), glm::cross(cam.getForwardDirection(), cam.getUpDirection())));
ASSERT_TRUE(isApproxEqual(cam.getNearClippingPlane(), .33f));
ASSERT_TRUE(isApproxEqual(cam.getFarClippingPlane(), 3333.33f));
ASSERT_TRUE(isApproxEqual(cam.getViewMatrix(), glm::lookAt(glm::vec3(0,0,-10), glm::vec3(0,0,10), glm::vec3(0,1,0))));
cam.moveForward(5.0f);
ASSERT_TRUE(isApproxEqual(cam.getPosition(), glm::vec3(0,0,-5)));
ASSERT_TRUE(isApproxEqual(cam.getTarget(), glm::vec3(0,0,15)));
cam.moveUp(5.0f);
ASSERT_TRUE(isApproxEqual(cam.getPosition(), glm::vec3(0,5,-5)));
ASSERT_TRUE(isApproxEqual(cam.getTarget(), glm::vec3(0,5,15)));
cam.moveLeft(5.0f);
ASSERT_TRUE(isApproxEqual(cam.getPosition(), glm::vec3(5,5,-5)));
ASSERT_TRUE(isApproxEqual(cam.getTarget(), glm::vec3(5,5,15)));
}
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment