Merge branch 'OctTree' of github.com:teamfisk/TacticalZ into OctTree
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
|
//#define BOOST_TEST_MODULE collTest
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
|
#include <boost/test/execution_monitor.hpp>
|
||||||
using boost::unit_test_framework::test_suite;
|
using boost::unit_test_framework::test_suite;
|
||||||
using boost::unit_test_framework::test_case;
|
using boost::unit_test_framework::test_case;
|
||||||
#include <Engine\Core\Collision.h>
|
#include <Engine\Core\Collision.h>
|
||||||
@@ -6,10 +8,20 @@ using boost::unit_test_framework::test_case;
|
|||||||
#include "Engine/Core/Ray.h"
|
#include "Engine/Core/Ray.h"
|
||||||
#include <stdlib.h>//srand
|
#include <stdlib.h>//srand
|
||||||
|
|
||||||
|
//vs memleaks
|
||||||
|
//#define _CRTDBG_MAP_ALLOC
|
||||||
|
//#include <stdlib.h>
|
||||||
|
//#include <crtdbg.h>
|
||||||
|
//#define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__)
|
||||||
|
//#define new DEBUG_CLIENTBLOCK
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE(collisionTests)
|
BOOST_AUTO_TEST_SUITE(collisionTests)
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(collisionTest)
|
BOOST_AUTO_TEST_CASE(collisionTest)
|
||||||
{
|
{
|
||||||
|
//memleak
|
||||||
|
int* globalLeak = new int[5];
|
||||||
|
|
||||||
//fixed seed
|
//fixed seed
|
||||||
srand(2);
|
srand(2);
|
||||||
Ray ray;
|
Ray ray;
|
||||||
@@ -18,7 +30,7 @@ BOOST_AUTO_TEST_CASE(collisionTest)
|
|||||||
glm::vec3 maxPos;
|
glm::vec3 maxPos;
|
||||||
bool z;
|
bool z;
|
||||||
int test = 0;
|
int test = 0;
|
||||||
for (size_t i = 0; i < 1000000; i++)
|
for (size_t i = 0; i < 10; i++)
|
||||||
{
|
{
|
||||||
ray.Origin.x = rand() % 100;
|
ray.Origin.x = rand() % 100;
|
||||||
ray.Origin.y = rand() % 100;
|
ray.Origin.y = rand() % 100;
|
||||||
@@ -38,6 +50,8 @@ BOOST_AUTO_TEST_CASE(collisionTest)
|
|||||||
if (z) ++test;
|
if (z) ++test;
|
||||||
}
|
}
|
||||||
BOOST_CHECK(test >= 0);
|
BOOST_CHECK(test >= 0);
|
||||||
|
|
||||||
|
//_CrtDumpMemoryLeaks();
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(collisionTest2)
|
BOOST_AUTO_TEST_CASE(collisionTest2)
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#include <boost/test/unit_test.hpp>
|
||||||
|
using boost::unit_test_framework::test_suite;
|
||||||
|
using boost::unit_test_framework::test_case;
|
||||||
|
#include <stdlib.h>//srand
|
||||||
|
#include <Engine\Core\OctTree.h>
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_SUITE(octTreeTests)
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(octTreeTest)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(octTreeTest2)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|
||||||
Reference in New Issue
Block a user