mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
fix: Remove instances of undefined behavior
This commit is contained in:
@@ -61,8 +61,8 @@ TEST(dCommonTests, AMF3AssociativeArrayTest) {
|
||||
|
||||
TEST(dCommonTests, AMF3InsertionAssociativeTest) {
|
||||
AMFArrayValue array;
|
||||
array.Insert("CString", "string");
|
||||
array.Insert("String", std::string("string"));
|
||||
array.Insert<std::string>("CString", "string");
|
||||
array.Insert<std::string>("String", std::string("string"));
|
||||
array.Insert("False", false);
|
||||
array.Insert("True", true);
|
||||
array.Insert<int32_t>("Integer", 42U);
|
||||
@@ -71,7 +71,6 @@ TEST(dCommonTests, AMF3InsertionAssociativeTest) {
|
||||
array.Insert<std::vector<uint32_t>>("Undefined", {});
|
||||
array.Insert("Null", nullptr);
|
||||
|
||||
ASSERT_EQ(array.Get<const char*>("CString")->GetValueType(), eAmf::String);
|
||||
ASSERT_EQ(array.Get<std::string>("String")->GetValueType(), eAmf::String);
|
||||
ASSERT_EQ(array.Get<bool>("False")->GetValueType(), eAmf::False);
|
||||
ASSERT_EQ(array.Get<bool>("True")->GetValueType(), eAmf::True);
|
||||
@@ -85,7 +84,7 @@ TEST(dCommonTests, AMF3InsertionAssociativeTest) {
|
||||
TEST(dCommonTests, AMF3InsertionDenseTest) {
|
||||
AMFArrayValue array;
|
||||
array.Push<std::string>("string");
|
||||
array.Push("CString");
|
||||
array.Push<std::string>("CString");
|
||||
array.Push(false);
|
||||
array.Push(true);
|
||||
array.Push<int32_t>(42U);
|
||||
@@ -95,7 +94,6 @@ TEST(dCommonTests, AMF3InsertionDenseTest) {
|
||||
array.Push<std::vector<uint32_t>>({});
|
||||
|
||||
ASSERT_EQ(array.Get<std::string>(0)->GetValueType(), eAmf::String);
|
||||
ASSERT_EQ(array.Get<const char*>(1)->GetValueType(), eAmf::String);
|
||||
ASSERT_EQ(array.Get<bool>(2)->GetValueType(), eAmf::False);
|
||||
ASSERT_EQ(array.Get<bool>(3)->GetValueType(), eAmf::True);
|
||||
ASSERT_EQ(array.Get<int32_t>(4)->GetValueType(), eAmf::Integer);
|
||||
|
Reference in New Issue
Block a user