Add tests for LDF parsing and serialization. Cleanup LDF (#1062)

* Add tests and cleanup LDF header

Also implements a speedup by using overloaded operators to put numbers directly to a stream as opposed to doing to_string first.

Stage 2 of re-write

Reduce scoping
Add further optimizations
Fix more edge cases
Split out tests to many smaller ones

Use EXPECT_NO_THROW

Add edge cases to test

Added these first with the before to confirm they failed, and now will be adding the remaining fixes needed to make the tests pass.

Add edge case testing for LDF strings

Add further tests

Use characters instead of char*

Update AMFDeserializeTests.cpp

Add null tests

* Add Test Fixture for dCommon

* Add speed test

* Convert to using string_view

* Add explanation on early return

* Remove "testing" code
This commit is contained in:
David Markowitz
2023-05-02 15:19:20 -07:00
committed by GitHub
parent 2f919d101f
commit e8590a5853
6 changed files with 455 additions and 172 deletions

View File

@@ -0,0 +1,26 @@
#ifndef __DCOMMONDEPENDENCIES__H__
#define __DCOMMONDEPENDENCIES__H__
#include "Game.h"
#include "dLogger.h"
#include "dServer.h"
#include "EntityInfo.h"
#include "EntityManager.h"
#include "dConfig.h"
#include <gtest/gtest.h>
class dCommonDependenciesTest : public ::testing::Test {
protected:
void SetUpDependencies() {
Game::logger = new dLogger("./testing.log", true, true);
}
void TearDownDependencies() {
if (Game::logger) {
Game::logger->Flush();
delete Game::logger;
}
}
};
#endif //!__DCOMMONDEPENDENCIES__H__