From 37db4740a4c7b83b25da0450ba95d6de8c1c42ec Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 20 Mar 2016 16:04:45 +0000 Subject: [PATCH] Added unit tests for the CreateFilenamePath function. --- source/tests/xestiaab_common.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/source/tests/xestiaab_common.h b/source/tests/xestiaab_common.h index 2efff91..3dafa80 100644 --- a/source/tests/xestiaab_common.h +++ b/source/tests/xestiaab_common.h @@ -18,6 +18,7 @@ #include #include "../common/dirs.h" +#include "../common/filename.h" TEST(CommonFunctions, GetUserDir){ @@ -203,4 +204,24 @@ TEST(CommonFunctions, GetSettingsFile){ #endif +} + +TEST(CommonFunctions, CreateFilenamePath){ + + // Run the unit tests depending on the operating system being used. + +#if defined(__WIN32__) + +#elif defined(__APPLE__) + +#else + + ASSERT_EQ("/test", CreateFilenamePath("", "test")); + ASSERT_EQ("/example/test", CreateFilenamePath("/example", "test")); + ASSERT_EQ("/home/meep/test", CreateFilenamePath("/home/meep", "test")); + ASSERT_EQ("/home/meep/moo/test", CreateFilenamePath("/home/meep/moo", "test")); + ASSERT_EQ("/home/meep/moo/yargh/test", CreateFilenamePath("/home/meep/moo/yargh", "test")); + +#endif + } \ No newline at end of file -- 2.39.5