File: ConvertTestCase.cpp

package info (click to toggle)
ember 0.7.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 22,176 kB
  • ctags: 18,979
  • sloc: cpp: 97,414; sh: 11,095; xml: 1,884; makefile: 946; objc: 245; ansic: 19
file content (35 lines) | stat: -rw-r--r-- 1,208 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "ConvertTestCase.h"

#include "components/ogre/Convert.h"

using namespace Ember::OgreView;
using namespace WFMath;

namespace Ember
{
void ConvertTestCase::testWFMathToOgre()
{
	Point<2> wfMathPoint2(10, 20);
	CPPUNIT_ASSERT(wfMathPoint2 == Convert::toWF(Convert::toOgre<Ogre::Vector2>(wfMathPoint2)));
	CPPUNIT_ASSERT(wfMathPoint2 == Convert::toWF<Point<2>>(Convert::toOgre<Ogre::Vector3>(wfMathPoint2)));

	Point<3> wfMathPoint3(10, 20, 30);
	CPPUNIT_ASSERT(wfMathPoint3 == Convert::toWF<Point<3>>(Convert::toOgre(wfMathPoint3)));

	Vector<2> wfMathVector2(10, 20);
	CPPUNIT_ASSERT(Point<2>(wfMathVector2) == Convert::toWF(Convert::toOgre(wfMathVector2)));

	Vector<3> wfMathVector3(10, 20, 30);
	CPPUNIT_ASSERT(wfMathVector3 == Convert::toWF<Vector<3>>(Convert::toOgre(wfMathVector3)));

	Quaternion wfQuaternion(1, 2.4f);
	CPPUNIT_ASSERT(wfQuaternion == Convert::toWF(Convert::toOgre(wfQuaternion)));

	WFMath::AxisBox<3> wfAxisBox3(Point<3>(1,2,3), Point<3>(10, 20, 30));
	CPPUNIT_ASSERT(wfAxisBox3 == Convert::toWF(Convert::toOgre(wfAxisBox3)));

	WFMath::AxisBox<2> wfAxisBox2(Point<2>(1,2), Point<2>(10, 20));
	CPPUNIT_ASSERT(wfAxisBox2 == Convert::toWF(Convert::toOgre(wfAxisBox2)));

}
}