mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 16:43:47 +00:00
feature(testing-automation): unit tests with Google Framework (#3273)
This commit is contained in:
23
src/test/CMakeLists.txt
Normal file
23
src/test/CMakeLists.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
CollectSourceFiles(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PRIVATE_SOURCES
|
||||
)
|
||||
|
||||
add_executable(
|
||||
unit_tests
|
||||
${PRIVATE_SOURCES}
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
unit_tests
|
||||
gtest_main
|
||||
game
|
||||
game-interface
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME
|
||||
unit
|
||||
COMMAND
|
||||
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/unit_tests
|
||||
)
|
||||
13
src/test/server/game/Miscellaneous/FormulasTest.cpp
Normal file
13
src/test/server/game/Miscellaneous/FormulasTest.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "Formulas.h"
|
||||
|
||||
TEST(FormulasTest, hk_honor_at_level)
|
||||
{
|
||||
EXPECT_EQ(acore::Honor::hk_honor_at_level(80), 124);
|
||||
EXPECT_EQ(acore::Honor::hk_honor_at_level(80, 2), 248);
|
||||
EXPECT_EQ(acore::Honor::hk_honor_at_level(80, 0.5), 62);
|
||||
EXPECT_EQ(acore::Honor::hk_honor_at_level(1), 2);
|
||||
EXPECT_EQ(acore::Honor::hk_honor_at_level(1, 10), 16);
|
||||
EXPECT_EQ(acore::Honor::hk_honor_at_level(2), 4);
|
||||
EXPECT_EQ(acore::Honor::hk_honor_at_level(3), 5);
|
||||
}
|
||||
Reference in New Issue
Block a user