mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
Implement GTest and change windows output path
Implement GTest as a testing infrastructure. Make windows output binaries to the build folder instead of the release type folder (potentially issue further down the line) Add a simple unit test for DestroyableComponent
This commit is contained in:
25
tests/dCommonTests/TestLDFFormat.cpp
Normal file
25
tests/dCommonTests/TestLDFFormat.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "LDFFormat.h"
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
/**
|
||||
* @brief Test parsing an LDF value
|
||||
*/
|
||||
TEST(dCommonTests, LDFTest) {
|
||||
// Create
|
||||
auto* data = LDFBaseData::DataFromString("KEY=0:VALUE");
|
||||
|
||||
// Check that the data type is correct
|
||||
ASSERT_EQ(data->GetValueType(), eLDFType::LDF_TYPE_UTF_16);
|
||||
|
||||
// Check that the key is correct
|
||||
ASSERT_EQ(data->GetKey(), u"KEY");
|
||||
|
||||
// Check that the value is correct
|
||||
ASSERT_EQ(((LDFData<std::u16string>*)data)->GetValue(), u"VALUE");
|
||||
|
||||
// Check that the serialization is correct
|
||||
ASSERT_EQ(data->GetString(), "KEY=0:VALUE");
|
||||
|
||||
// Cleanup the object
|
||||
delete data;
|
||||
}
|
Reference in New Issue
Block a user