From 1bb0ef8960c71ef505a351702bec54c01ba15e22 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Thu, 12 Oct 2017 14:57:26 +0100 Subject: Fixing spritesheet and fixed #12 --- tests/vector3test.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tests/vector3test.cpp (limited to 'tests/vector3test.cpp') diff --git a/tests/vector3test.cpp b/tests/vector3test.cpp new file mode 100644 index 00000000..b618f2fc --- /dev/null +++ b/tests/vector3test.cpp @@ -0,0 +1,40 @@ +/* ---------------------------------------------------------------------------- + * vector3test.cpp + * + * Copyright (c) 2017 Yann Herklotz Grave + * MIT License, see LICENSE file for more details. + * ---------------------------------------------------------------------------- + */ + +#include +#include + +#include +#include + +using namespace yage; + +TEST(Vector4, Initialize) +{ + Vector3i vec{{rand(), rand(), rand()}}; + ASSERT_EQ(vec.x, vec[0]); + ASSERT_EQ(vec.y, vec[1]); + ASSERT_EQ(vec.z, vec[2]); +} + +TEST(Vector3, Assigning) +{ + Vector3i vec{{rand(), rand(), rand()}}; + ASSERT_EQ(vec.x, vec[0]); + vec.x = rand(); + ASSERT_EQ(vec.x, vec[0]); + vec[0] = rand(); + ASSERT_EQ(vec.x, vec[0]); +} + +int main(int argc, char **argv) +{ + testing::InitGoogleTest(&argc, argv); + srand(time(nullptr)); + return RUN_ALL_TESTS(); +} -- cgit