Fixing memory leak with RefPtr

This commit is contained in:
Dynamitos
2020-04-01 02:17:49 +02:00
parent 62c2d37cb3
commit 3ba8f2c2a0
37 changed files with 1675 additions and 270 deletions
+1
View File
@@ -1,5 +1,6 @@
target_sources(Seele_unit_tests
PRIVATE
../../src/Engine/MinimalEngine.cpp
EngineTest.h
EngineTest.cpp)
target_include_directories(Seele_unit_tests PUBLIC ./)
+2 -2
View File
@@ -112,7 +112,7 @@ BOOST_AUTO_TEST_CASE(random_access)
BOOST_CHECK_EQUAL(array[0], 4);
}
BOOST_AUTO_TEST_CASE(benchmark)
/*BOOST_AUTO_TEST_CASE(benchmark)
{
using namespace std::chrono;
srand(time(NULL));
@@ -160,7 +160,7 @@ BOOST_AUTO_TEST_CASE(benchmark)
std::cout << "Vector: " << time_vector << "ms Array: " << time_array << "ms" << std::endl;
std::cout << "Vector remove: " << remove_vector << "ms Array remove: " << remove_array << "ms" << std::endl;
delete[] testSet;
}
}*/
BOOST_AUTO_TEST_SUITE_END()
+6 -1
View File
@@ -31,10 +31,13 @@ BOOST_AUTO_TEST_CASE(for_each)
map[6] = 4;
map[4] = 7;
int count = 0;
for (auto entry : map)
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);
}
@@ -44,6 +47,8 @@ BOOST_AUTO_TEST_CASE(key_exists)
map[2] = 3;
BOOST_REQUIRE_EQUAL(map.exists(2), true);
BOOST_REQUIRE_EQUAL(map.exists(4), false);
map.erase(2);
BOOST_REQUIRE_EQUAL(map.exists(2), false);
}
BOOST_AUTO_TEST_CASE(custom_key)