diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b81c6e0b2..346128d60 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -22,6 +22,7 @@ set(tests_headers add_executable(tests ${tests_sources} ${tests_headers}) target_link_libraries(tests common cppunit) +target_include_directories(tests PRIVATE ..) install(TARGETS tests RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) diff --git a/tests/atobool_test.h b/tests/atobool_test.h index 21ef277d1..19da10d3e 100644 --- a/tests/atobool_test.h +++ b/tests/atobool_test.h @@ -16,11 +16,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __EQEMU_TESTS_ATOBOOL_H -#define __EQEMU_TESTS_ATOBOOL_H +#pragma once +#include "common/strings.h" #include "cppunit/cpptest.h" -#include "../common/strings.h" class atoboolTest : public Test::Suite { typedef void(atoboolTest::*TestFunction)(void); @@ -99,5 +98,3 @@ public: } }; - -#endif diff --git a/tests/cppunit/CMakeLists.txt b/tests/cppunit/CMakeLists.txt index a6f82df87..4b4763d95 100644 --- a/tests/cppunit/CMakeLists.txt +++ b/tests/cppunit/CMakeLists.txt @@ -36,3 +36,4 @@ if(UNIX) endif() set(LIBRARY_OUTPUT_PATH ../../bin) +set_property(TARGET cppunit PROPERTY FOLDER contrib) diff --git a/tests/data_verification_test.h b/tests/data_verification_test.h index 5053b922a..e0af47bfe 100644 --- a/tests/data_verification_test.h +++ b/tests/data_verification_test.h @@ -16,11 +16,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __EQEMU_TESTS_DATA_VERIFICATION_H -#define __EQEMU_TESTS_DATA_VERIFICATION_H +#pragma once +#include "common/data_verification.h" #include "cppunit/cpptest.h" -#include "../common/data_verification.h" class DataVerificationTest : public Test::Suite { typedef void(DataVerificationTest::*TestFunction)(void); @@ -104,5 +103,3 @@ public: TEST_ASSERT(!EQ::ValueWithin(value_i, 600, 900)); } }; - -#endif diff --git a/tests/fixed_memory_test.h b/tests/fixed_memory_test.h index faddc963f..c2059ab3b 100644 --- a/tests/fixed_memory_test.h +++ b/tests/fixed_memory_test.h @@ -16,12 +16,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __EQEMU_TESTS_FIXED_MEMORY_H -#define __EQEMU_TESTS_FIXED_MEMORY_H +#pragma once +#include "common/fixed_memory_hash_set.h" +#include "common/item_instance.h" #include "cppunit/cpptest.h" -#include "../common/fixed_memory_hash_set.h" -#include "../common/item_instance.h" class FixedMemoryHashTest : public Test::Suite { typedef void(FixedMemoryHashTest::*TestFunction)(void); @@ -233,5 +232,3 @@ private: uint8 *data_; size_t size_; }; - -#endif diff --git a/tests/fixed_memory_variable_test.h b/tests/fixed_memory_variable_test.h index 4bb89e1b6..ea7948710 100644 --- a/tests/fixed_memory_variable_test.h +++ b/tests/fixed_memory_variable_test.h @@ -16,11 +16,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __EQEMU_TESTS_FIXED_MEMORY_VARIABLE_H -#define __EQEMU_TESTS_FIXED_MEMORY_VARIABLE_H +#pragma once +#include "common/fixed_memory_variable_hash_set.h" #include "cppunit/cpptest.h" -#include "../common/fixed_memory_variable_hash_set.h" struct test_struct { char name[512]; @@ -129,5 +128,3 @@ private: uint8 *data_; uint32 size_; }; - -#endif diff --git a/tests/hextoi_32_64_test.h b/tests/hextoi_32_64_test.h index cd7bb83bd..119d66dc8 100644 --- a/tests/hextoi_32_64_test.h +++ b/tests/hextoi_32_64_test.h @@ -16,11 +16,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __EQEMU_TESTS_HEXTOI_32_64_H -#define __EQEMU_TESTS_HEXTOI_32_64_H +#pragma once +#include "common/strings.h" #include "cppunit/cpptest.h" -#include "../common/strings.h" class hextoi_32_64_Test : public Test::Suite { typedef void(hextoi_32_64_Test::*TestFunction)(void); @@ -209,5 +208,3 @@ public: } }; - -#endif diff --git a/tests/ipc_mutex_test.h b/tests/ipc_mutex_test.h index c4323d425..da2a93016 100644 --- a/tests/ipc_mutex_test.h +++ b/tests/ipc_mutex_test.h @@ -16,12 +16,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __EQEMU_TESTS_IPC_MUTEX_H -#define __EQEMU_TESTS_IPC_MUTEX_H +#pragma once +#include "common/eqemu_config.h" +#include "common/ipc_mutex.h" #include "cppunit/cpptest.h" -#include "../common/ipc_mutex.h" -#include "../common/eqemu_config.h" extern const EQEmuConfig *Config; @@ -63,5 +62,3 @@ public: TEST_ASSERT(!mutex.Unlock()); } }; - -#endif diff --git a/tests/main.cpp b/tests/main.cpp index 9c9af40c9..cfec4abcd 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -16,22 +16,23 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "tests/atobool_test.h" +#include "tests/data_verification_test.h" +#include "tests/fixed_memory_test.h" +#include "tests/fixed_memory_variable_test.h" +#include "tests/hextoi_32_64_test.h" +#include "tests/ipc_mutex_test.h" +#include "tests/memory_mapped_file_test.h" +#include "tests/skills_util_test.h" +#include "tests/string_util_test.h" +#include "tests/task_state_test.h" + +#include "common/path_manager.h" +#include "common/platform.h" #include #include #include -#include "../common/platform.h" -#include "../common/path_manager.h" -#include "memory_mapped_file_test.h" -#include "ipc_mutex_test.h" -#include "fixed_memory_test.h" -#include "fixed_memory_variable_test.h" -#include "atobool_test.h" -#include "hextoi_32_64_test.h" -#include "string_util_test.h" -#include "data_verification_test.h" -#include "skills_util_test.h" -#include "task_state_test.h" const EQEmuConfig *Config; diff --git a/tests/memory_mapped_file_test.h b/tests/memory_mapped_file_test.h index b23f6568d..75db90b53 100644 --- a/tests/memory_mapped_file_test.h +++ b/tests/memory_mapped_file_test.h @@ -16,11 +16,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __EQEMU_TESTS_MEMORY_MAPPED_FILE_H -#define __EQEMU_TESTS_MEMORY_MAPPED_FILE_H +#pragma once +#include "common/memory_mapped_file.h" #include "cppunit/cpptest.h" -#include "../common/memory_mapped_file.h" class MemoryMappedFileTest : public Test::Suite { typedef void(MemoryMappedFileTest::*TestFunction)(void); @@ -56,5 +55,3 @@ public: TEST_ASSERT(val == 562); } }; - -#endif diff --git a/tests/skills_util_test.h b/tests/skills_util_test.h index 77616ea14..da8f78181 100644 --- a/tests/skills_util_test.h +++ b/tests/skills_util_test.h @@ -16,11 +16,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __EQEMU_TESTS_SKILLS_UTILS_H -#define __EQEMU_TESTS_SKILLS_UTILS_H +#pragma once +#include "common/skills.h" #include "cppunit/cpptest.h" -#include "../common/skills.h" class SkillsUtilsTest: public Test::Suite { typedef void(SkillsUtilsTest::*TestFunction)(void); @@ -44,5 +43,3 @@ public: TEST_ASSERT(!EQ::skills::IsSpecializedSkill(EQ::skills::SkillConjuration)) } }; - -#endif diff --git a/tests/string_util_test.h b/tests/string_util_test.h index 37bd539f7..1bcdb2fa9 100644 --- a/tests/string_util_test.h +++ b/tests/string_util_test.h @@ -16,11 +16,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __EQEMU_TESTS_STRING_UTIL_H -#define __EQEMU_TESTS_STRING_UTIL_H +#pragma once +#include "common/strings.h" #include "cppunit/cpptest.h" -#include "../common/strings.h" class StringUtilTest : public Test::Suite { typedef void(StringUtilTest::*TestFunction)(void); @@ -135,5 +134,3 @@ public: TEST_ASSERT_EQUALS(Strings::IsNumber("18446744073709551616.0f"), false); // 64 } }; - -#endif diff --git a/tests/task_state_test.h b/tests/task_state_test.h index 729c02c04..a271ca3f8 100644 --- a/tests/task_state_test.h +++ b/tests/task_state_test.h @@ -1,9 +1,9 @@ #pragma once +#include "common/eqemu_logsys.h" +#include "common/shared_tasks.h" +#include "common/tasks.h" #include "cppunit/cpptest.h" -#include "../common/eqemu_logsys.h" -#include "../common/tasks.h" -#include "../common/shared_tasks.h" class TaskStateTest: public Test::Suite {