mirror of
https://github.com/xtjoeytx/GServer-v2.git
synced 2026-05-06 07:26:41 -04:00
fefd62bf04
* Initial Catch2 testing stuff * Add unit testing stage to Jenkins * Update docker alpine version * Fix tests * Fix running tests * Make CTest actually know there are tests available * It was case sensitive on my mac * Messing with unit tests, I think were at 20% now * Fix so testing works for any target platform * Update gs2compiler submodule * Make unit testing more verbose * Don't fail the whole build if test failed + notify discord on test failure * Update gs2lib submodule * Fix unit testing + Add linux x86_64 artifact build + improve release setup * Add cmake to linux x86_64 to be able to run CTest * Change path for testing * Try again * Fix copy path for Testing directory * Fix github release * Fix github release * Fix github release * Fix github release * Fix github release * Fix github release * Fix github release * Fix github release * Fix github release * Fix github release * Fix github release * Fix github release * Publish test results * Revert version Co-authored-by: joey <1166538+xtjoeytx@users.noreply.github.com>
26 lines
560 B
C++
26 lines
560 B
C++
#define CATCH_CONFIG_MAIN
|
|
#include "catch2/catch_all.hpp"
|
|
#include <TPlayer.h>
|
|
#include <TServer.h>
|
|
|
|
SCENARIO( "TPlayer", "[object]" ) {
|
|
|
|
GIVEN( "TPlayer" ) {
|
|
int id = 123;
|
|
auto* server = new TServer("test");
|
|
auto* socket = new CSocket();
|
|
auto* player = new TPlayer(server, (CSocket*)socket, id);
|
|
|
|
WHEN( "getting player id" ) {
|
|
THEN( "id should be " << id ) {
|
|
REQUIRE( player->getId() == id );
|
|
}
|
|
}
|
|
|
|
WHEN( "getting player servername" ) {
|
|
THEN( "name should be test" ) {
|
|
REQUIRE( player->getServerName() == "test" );
|
|
}
|
|
}
|
|
}
|
|
} |