Playing around with Igloo unit testing.
This commit is contained in:
parent
d342bd21ee
commit
db0ac63215
3 changed files with 28 additions and 6 deletions
|
@ -1,13 +1,13 @@
|
||||||
#include "math/Vector3.h"
|
|
||||||
|
|
||||||
// Testing Headers
|
|
||||||
#include <igloo/igloo_alt.h>
|
#include <igloo/igloo_alt.h>
|
||||||
|
|
||||||
|
using namespace igloo;
|
||||||
|
|
||||||
|
// Testing headers:
|
||||||
#include "tests/TestsVector3.h"
|
#include "tests/TestsVector3.h"
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main( int argc, const char* argv[ ] )
|
||||||
{
|
{
|
||||||
|
|
||||||
return 0;
|
return TestRunner::RunAllTests( argc, const_cast< char** >( argv ) );
|
||||||
}
|
}
|
|
@ -29,7 +29,7 @@ solution "tests"
|
||||||
kind "ConsoleApp"
|
kind "ConsoleApp"
|
||||||
language "C++"
|
language "C++"
|
||||||
targetdir "bin"
|
targetdir "bin"
|
||||||
files { "../src/**.cpp", "main.cpp" }
|
files { "../src/**.cpp", "main.cpp", "tests/*.h" }
|
||||||
|
|
||||||
includedirs {
|
includedirs {
|
||||||
"../include",
|
"../include",
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
#ifndef __TESTSVECTOR3_H__
|
||||||
|
#define __TESTSVECTOR3_H__
|
||||||
|
|
||||||
|
# include "math/Vector3.h"
|
||||||
|
|
||||||
|
When( vector3_scalar_multiplied )
|
||||||
|
{
|
||||||
|
Then( it_should_multiply )
|
||||||
|
{
|
||||||
|
value1.X = 1.f;
|
||||||
|
value1.Y = 1.f;
|
||||||
|
value1.Z = 1.f;
|
||||||
|
|
||||||
|
value1 *= 2.f;
|
||||||
|
|
||||||
|
Assert::That( value1, Equals( Vec3f( 2.f, 2.f, 2.f ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
Vec3f value1;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //__TESTSVECTOR3_H__
|
Loading…
Add table
Add a link
Reference in a new issue