mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 02:04:04 +00:00
feat: add configurable feature and versions (#1298)
* feat: add configurable feature and versions to allow for easily swithing it out to enable features in the client for funsies tested that this doesn't break anything and added test * cleanup
This commit is contained in:
@@ -2,6 +2,7 @@ set(DCOMMONTEST_SOURCES
|
||||
"AMFDeserializeTests.cpp"
|
||||
"Amf3Tests.cpp"
|
||||
"HeaderSkipTest.cpp"
|
||||
"TestCDFeatureGatingTable.cpp"
|
||||
"TestLDFFormat.cpp"
|
||||
"TestNiPoint3.cpp"
|
||||
"TestEncoding.cpp"
|
||||
|
55
tests/dCommonTests/TestCDFeatureGatingTable.cpp
Normal file
55
tests/dCommonTests/TestCDFeatureGatingTable.cpp
Normal file
@@ -0,0 +1,55 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include "CDFeatureGatingTable.h"
|
||||
|
||||
|
||||
TEST(dCommonTests, CDFeaturingGatingComparison){
|
||||
CDFeatureGating a;
|
||||
a.major = 1;
|
||||
a.current = 10;
|
||||
a.minor = 64;
|
||||
|
||||
CDFeatureGating b;
|
||||
b.major = 999;
|
||||
b.current = 999;
|
||||
b.minor = 999;
|
||||
EXPECT_TRUE(b >= a);
|
||||
EXPECT_FALSE(a >= b);
|
||||
|
||||
// below
|
||||
b.major = 0;
|
||||
b.current = 10;
|
||||
b.minor = 64;
|
||||
EXPECT_FALSE(b >= a);
|
||||
EXPECT_TRUE(a >= b);
|
||||
|
||||
b.major = 1;
|
||||
b.current = 9;
|
||||
b.minor = 64;
|
||||
EXPECT_FALSE(b >= a);
|
||||
EXPECT_TRUE(a >= b);
|
||||
|
||||
b.major = 1;
|
||||
b.current = 10;
|
||||
b.minor = 63;
|
||||
EXPECT_FALSE(b >= a);
|
||||
EXPECT_TRUE(a >= b);
|
||||
|
||||
// above
|
||||
b.major = 2;
|
||||
b.current = 10;
|
||||
b.minor = 64;
|
||||
EXPECT_TRUE(b >= a);
|
||||
EXPECT_FALSE(a >= b);
|
||||
|
||||
b.major = 1;
|
||||
b.current = 11;
|
||||
b.minor = 64;
|
||||
EXPECT_TRUE(b >= a);
|
||||
EXPECT_FALSE(a >= b);
|
||||
|
||||
b.major = 1;
|
||||
b.current = 10;
|
||||
b.minor = 65;
|
||||
EXPECT_TRUE(b >= a);
|
||||
EXPECT_FALSE(a >= b);
|
||||
}
|
Reference in New Issue
Block a user