Browse Source

all those test files didn't really work out

opengl-renderer-broken
Martin Dørum 4 years ago
parent
commit
24798a387d

+ 1
- 22
libswan/CMakeLists.txt View File

@@ -22,28 +22,7 @@ target_link_libraries(libswan ${libraries})
install(TARGETS libswan DESTINATION swan/libswan)

add_executable(test_libswan EXCLUDE_FROM_ALL
test/lib/test.cc
test/Animation.t.cc
test/Body.t.cc
test/BoundingBox.t.cc
test/Clock.t.cc
test/common.t.cc
test/Entity.t.cc
test/Game.t.cc
test/Item.t.cc
test/Mod.t.cc
test/OS.t.cc
test/Resource.t.cc
test/SRF.t.cc
test/swan.t.cc
test/Tile.t.cc
test/util.t.cc
test/log.t.cc
test/Vector2.t.cc
test/Win.t.cc
test/World.t.cc
test/WorldGen.t.cc
test/WorldPlane.t.cc)
test/lib/test.cc)
target_link_libraries(test_libswan libswan)
target_include_directories(test_libswan
PRIVATE "include/swan")

+ 0
- 3
libswan/test/Animation.t.cc View File

@@ -1,3 +0,0 @@
#include "Animation.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/Body.t.cc View File

@@ -1,3 +0,0 @@
#include "Body.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/BoundingBox.t.cc View File

@@ -1,3 +0,0 @@
#include "BoundingBox.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/Clock.t.cc View File

@@ -1,3 +0,0 @@
#include "Clock.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/Entity.t.cc View File

@@ -1,3 +0,0 @@
#include "Entity.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/Game.t.cc View File

@@ -1,3 +0,0 @@
#include "Game.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/Item.t.cc View File

@@ -1,3 +0,0 @@
#include "Item.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/Mod.t.cc View File

@@ -1,3 +0,0 @@
#include "Mod.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/OS.t.cc View File

@@ -1,3 +0,0 @@
#include "OS.h"

#include "lib/test.h"

+ 0
- 5
libswan/test/PerfCounter.t.cc View File

@@ -1,5 +0,0 @@
#include "PerfCounter.h"

#include "lib/test.h"

test("")

+ 0
- 3
libswan/test/Resource.t.cc View File

@@ -1,3 +0,0 @@
#include "Resource.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/SRF.t.cc View File

@@ -1,3 +0,0 @@
#include "SRF.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/Tile.t.cc View File

@@ -1,3 +0,0 @@
#include "Tile.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/Vector2.t.cc View File

@@ -1,3 +0,0 @@
#include "Vector2.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/Win.t.cc View File

@@ -1,3 +0,0 @@
#include "Win.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/World.t.cc View File

@@ -1,3 +0,0 @@
#include "World.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/WorldGen.t.cc View File

@@ -1,3 +0,0 @@
#include "WorldGen.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/WorldPlane.t.cc View File

@@ -1,3 +0,0 @@
#include "WorldPlane.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/common.t.cc View File

@@ -1,3 +0,0 @@
#include "common.h"

#include "lib/test.h"

+ 0
- 3
libswan/test/gfxutil.t.cc View File

@@ -1,3 +0,0 @@
#include "gfxutil.h"

#include "lib/test.h"

+ 0
- 12
libswan/test/log.t.cc View File

@@ -1,12 +0,0 @@
#include "log.h"

#include <sstream>

#include "lib/test.h"

test("Basic logging") {
std::stringstream ostream;
Swan::Logger log(ostream, "test");
log << "Hello World, a number: " << 100 << ", and a string";
expecteq(ostream.str(), "test: Hello World, a number: 100, and a string\n");
}

+ 0
- 3
libswan/test/swan.t.cc View File

@@ -1,3 +0,0 @@
#include "swan.h"

#include "lib/test.h"

+ 0
- 37
libswan/test/util.t.cc View File

@@ -1,37 +0,0 @@
#include "util.h"

#include "lib/test.h"

test("Deferred functions run") {
int runs = 0;
{
auto def = Swan::makeDeferred([&] { runs += 1; });
expecteq(runs, 0);
}
expecteq(runs, 1);
}

test("Moved deferreds don't run") {
int runs = 0;
{
auto def = Swan::makeDeferred([&] { runs += 1; });
auto def2 = std::move(def);
expecteq(runs, 0);
}
expecteq(runs, 1);
}

test("Raii pointers") {
int runs = 0;
{
auto ptr = Swan::makeRaiiPtr(new int(10), [&](int *p) {
runs += 1;
delete p;
});
expecteq(runs, 0);
expectneq(ptr, nullptr);
expecteq(*ptr, 10);
}

expecteq(runs, 1);
}

Loading…
Cancel
Save