From c7829e52350e68631405e4c20cf4946fa69a6119 Mon Sep 17 00:00:00 2001 From: Joshua Scott Date: Tue, 11 Dec 2018 01:19:30 +0000 Subject: [PATCH] etc: Fix build and test errors on CI --- include/ki/pclass/Value.h | 8 +++++--- src/pclass/TypeSystem.cpp | 2 +- test/src/unit-serialization.cpp | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/ki/pclass/Value.h b/include/ki/pclass/Value.h index ced2c8a..bb8805d 100644 --- a/include/ki/pclass/Value.h +++ b/include/ki/pclass/Value.h @@ -125,7 +125,8 @@ namespace pclass template static void declare() { - ValueCaster::get().add_caster(); + ValueCaster &caster = ValueCaster::get(); + caster.add_caster(); } /** @@ -355,7 +356,7 @@ namespace pclass { const auto it = s_caster_lookup.find(src_type.hash_code()); if (it != s_caster_lookup.end()) - return it->second.cast(value); + return it->second->cast_value(value); throw cast_error(src_type, typeid(DestT)); } @@ -363,7 +364,8 @@ namespace pclass Value ValueCaster::cast(const Value& value) { ValueCaster::declare(); - return ValueCaster::get().cast(value); + ValueCaster &caster = ValueCaster::get(); + return caster.cast_value(value); } template diff --git a/src/pclass/TypeSystem.cpp b/src/pclass/TypeSystem.cpp index 35376be..7feca83 100644 --- a/src/pclass/TypeSystem.cpp +++ b/src/pclass/TypeSystem.cpp @@ -65,7 +65,7 @@ namespace pclass // Define string types define_primitive("std::string"); - define_primitive("std::wstring"); + define_primitive("std::wstring"); // Define the base class for all classes define_class("class PropertyClass"); diff --git a/test/src/unit-serialization.cpp b/test/src/unit-serialization.cpp index 2f1bd78..83f25b2 100644 --- a/test/src/unit-serialization.cpp +++ b/test/src/unit-serialization.cpp @@ -213,7 +213,7 @@ public: // Test strings pclass::StaticProperty string; - pclass::StaticProperty wstring; + pclass::StaticProperty wstring; // Test single precision and double precision floating point integers pclass::StaticProperty float32; @@ -268,7 +268,7 @@ void define_types() #define EXPECTED_uint32 0x0708090A #define EXPECTED_uint64 0x0B0C0D0E0F101112 #define EXPECTED_string "This is a test value" -#define EXPECTED_wstring L"This is a test value" +#define EXPECTED_wstring u"This is a test value" #define EXPECTED_float32 3.1415927410125732421875f #define EXPECTED_float64 3.141592653589793115997963468544185161590576171875 #define EXPECTED_vector3d Vector3D(24.0f, 61.0f, 3.62f)