First runnable render loop

This commit is contained in:
Dynamitos
2020-10-14 01:49:43 +02:00
parent ceee96b462
commit 8d4c43361b
35 changed files with 519 additions and 134 deletions
+27
View File
@@ -1,5 +1,6 @@
#include "EngineTest.h"
#include "Containers/Array.h"
#include "MinimalEngine.h"
#include <time.h>
#include <chrono>
#define BOOST_TEST_MODULE SeeleEngine
@@ -112,6 +113,32 @@ BOOST_AUTO_TEST_CASE(random_access)
BOOST_CHECK_EQUAL(array[0], 4);
}
class TestStruct
{
public:
uint32 data;
~TestStruct()
{
data = 1;
}
};
DECLARE_REF(TestStruct);
BOOST_AUTO_TEST_CASE(refptr_interaction)
{
uint32* dataPtr;
{
PTestStruct test = new TestStruct();
test->data = 32123;
dataPtr = &test->data;
{
Array<PTestStruct> arr(1);
arr[0] = test;
}
BOOST_CHECK_EQUAL(test->data, 32123);
}
}
/*BOOST_AUTO_TEST_CASE(benchmark)
{
using namespace std::chrono;
-8
View File
@@ -26,10 +26,6 @@ BOOST_AUTO_TEST_CASE(basic_insert)
List<int>::Iterator it = list.find(3);
it = list.insert(it, 1);
BOOST_REQUIRE_EQUAL(*it, 1);
for (auto i : list)
{
std::cout << i << std::endl;
}
BOOST_REQUIRE_EQUAL(list.length(), 4);
}
BOOST_AUTO_TEST_CASE(basic_remove)
@@ -41,10 +37,6 @@ BOOST_AUTO_TEST_CASE(basic_remove)
List<int>::Iterator it = list.find(3);
it = list.remove(it);
BOOST_REQUIRE_EQUAL(*it, 4);
for (auto i : list)
{
std::cout << i << std::endl;
}
BOOST_REQUIRE_EQUAL(list.length(), 2);
}
-3
View File
@@ -31,13 +31,10 @@ BOOST_AUTO_TEST_CASE(for_each)
map[6] = 4;
map[4] = 7;
int count = 0;
std::cout << "Map start" << std::endl;
for(auto it = map.begin(); it != map.end(); ++it)
{
std::cout << (*it).key << std::endl;
count++;
}
std::cout << "Map end" << std::endl;
BOOST_REQUIRE_EQUAL(count, 4);
}