From f776df6076725d14679b31168e3ede53c966182e Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Tue, 31 Oct 2017 22:11:18 +0000 Subject: renaming base folder --- tests/resources/simplegame.frag | 0 tests/resources/simplegame.vert | 0 tests/simplegame.cpp | 4 ++++ tests/vector3test.cpp | 28 ++++++++++++++++++++++++++-- 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 tests/resources/simplegame.frag create mode 100644 tests/resources/simplegame.vert (limited to 'tests') diff --git a/tests/resources/simplegame.frag b/tests/resources/simplegame.frag new file mode 100644 index 00000000..e69de29b diff --git a/tests/resources/simplegame.vert b/tests/resources/simplegame.vert new file mode 100644 index 00000000..e69de29b diff --git a/tests/simplegame.cpp b/tests/simplegame.cpp index f6565fc9..0692574a 100644 --- a/tests/simplegame.cpp +++ b/tests/simplegame.cpp @@ -9,8 +9,12 @@ int main() window.create("Simple Game", 800, 640); while(!window.shouldClose()) { + window.clearBuffer(); + SpriteBatch sp; sp.begin(); + window.pollEvents(); + window.swapBuffer(); } } diff --git a/tests/vector3test.cpp b/tests/vector3test.cpp index b618f2fc..0e10458a 100644 --- a/tests/vector3test.cpp +++ b/tests/vector3test.cpp @@ -14,7 +14,7 @@ using namespace yage; -TEST(Vector4, Initialize) +TEST(Vector3, Initialize) { Vector3i vec{{rand(), rand(), rand()}}; ASSERT_EQ(vec.x, vec[0]); @@ -22,7 +22,7 @@ TEST(Vector4, Initialize) ASSERT_EQ(vec.z, vec[2]); } -TEST(Vector3, Assigning) +TEST(Vector3, Assigning_x) { Vector3i vec{{rand(), rand(), rand()}}; ASSERT_EQ(vec.x, vec[0]); @@ -32,6 +32,30 @@ TEST(Vector3, Assigning) ASSERT_EQ(vec.x, vec[0]); } +TEST(Vector3, Assigning_y) +{ + Vector3i vec{{rand(), rand(), rand()}}; + ASSERT_EQ(vec.y, vec[1]); + vec.x = rand(); + ASSERT_EQ(vec.y, vec[1]); + vec[1] = rand(); + ASSERT_EQ(vec.y, vec[1]); +} + +TEST(Vector3, Assigning_z) +{ + Vector3i vec{{rand(), rand(), rand()}}; + ASSERT_EQ(vec.z, vec[2]); + vec.z = rand(); + ASSERT_EQ(vec.z, vec[2]); + vec[2] = rand(); + ASSERT_EQ(vec.z, vec[2]); +} + +TEST(Vector3, Addition) +{ +} + int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); -- cgit