memcpy and template deduction guide

This commit is contained in:
jadebenn
2024-11-21 18:37:50 -06:00
parent 3a0e37ee8a
commit 5aa8b1395b
12 changed files with 54 additions and 49 deletions

View File

@@ -61,8 +61,8 @@ TEST(dCommonTests, AMF3AssociativeArrayTest) {
TEST(dCommonTests, AMF3InsertionAssociativeTest) {
AMFArrayValue array;
array.Insert<std::string>("CString", "string");
array.Insert<std::string>("String", std::string("string"));
array.Insert("CString", "string");
array.Insert("String", std::string("string"));
array.Insert("False", false);
array.Insert("True", true);
array.Insert<int32_t>("Integer", 42U);
@@ -71,6 +71,7 @@ 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);
@@ -84,7 +85,7 @@ TEST(dCommonTests, AMF3InsertionAssociativeTest) {
TEST(dCommonTests, AMF3InsertionDenseTest) {
AMFArrayValue array;
array.Push<std::string>("string");
array.Push<std::string>("CString");
array.Push("CString");
array.Push(false);
array.Push(true);
array.Push<int32_t>(42U);
@@ -94,6 +95,7 @@ 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);