Merge branch 'master' into issue_408

This commit is contained in:
MHaselmaier 2021-05-07 07:49:26 +02:00
commit 00daf643b6
4 changed files with 9 additions and 9 deletions

View File

@ -497,7 +497,7 @@ Void EnumInterpreterAsString<T, notnull>::fromInterpretation(const Void& interVa
try { try {
const auto &entry = EnumOW::getEntryByName(interValue.staticCast<String>()); const auto &entry = EnumOW::getEntryByName(interValue.staticCast<String>());
return EnumOW(entry.value); return EnumOW(entry.value);
} catch (const std::runtime_error& e) { // TODO - add a specific error for this. } catch (const std::runtime_error&) { // TODO - add a specific error for this.
error = EnumInterpreterError::ENTRY_NOT_FOUND; error = EnumInterpreterError::ENTRY_NOT_FOUND;
} }
return Void(nullptr, EnumOW::Class::getType()); return Void(nullptr, EnumOW::Class::getType());
@ -558,7 +558,7 @@ Void EnumInterpreterAsNumber<T, notnull>::fromInterpretation(const Void& interVa
interValue.staticCast<OW>() interValue.staticCast<OW>()
); );
return EnumOW(entry.value); return EnumOW(entry.value);
} catch (const std::runtime_error& e) { // TODO - add a specific error for this. } catch (const std::runtime_error&) { // TODO - add a specific error for this.
error = EnumInterpreterError::ENTRY_NOT_FOUND; error = EnumInterpreterError::ENTRY_NOT_FOUND;
} }
return Void(nullptr, EnumOW::Class::getType()); return Void(nullptr, EnumOW::Class::getType());

View File

@ -95,7 +95,7 @@ void TypeResolverTest::onRun() {
dto1->f_int64 = 64; dto1->f_int64 = 64;
dto1->f_uint64 = 6464; dto1->f_uint64 = 6464;
dto1->f_float32 = 0.32; dto1->f_float32 = 0.32f;
dto1->f_float64 = 0.64; dto1->f_float64 = 0.64;
dto1->f_bool = true; dto1->f_bool = true;

View File

@ -116,7 +116,7 @@ void AnyTest::onRun() {
try { try {
auto obj = any.retrieve<oatpp::Object<Dto2>>(); // wrong object auto obj = any.retrieve<oatpp::Object<Dto2>>(); // wrong object
} catch (std::runtime_error& e) { } catch (std::runtime_error&) {
wasError = true; wasError = true;
} }

View File

@ -42,15 +42,15 @@ void PrimitiveTest::onRun() {
{ {
checkHash(oatpp::Boolean(true)); checkHash(oatpp::Boolean(true));
checkHash(oatpp::Int8(0xFF)); checkHash(oatpp::Int8(0x7F));
checkHash(oatpp::UInt8(0xFF)); checkHash(oatpp::UInt8(0xFF));
checkHash(oatpp::Int16(0xFFFF)); checkHash(oatpp::Int16(0x7FFF));
checkHash(oatpp::UInt16(0xFFFF)); checkHash(oatpp::UInt16(0xFFFF));
checkHash(oatpp::Int32(0xFFFFFFFF)); checkHash(oatpp::Int32(0x7FFFFFFF));
checkHash(oatpp::UInt32(0xFFFFFFFF)); checkHash(oatpp::UInt32(0xFFFFFFFF));
checkHash(oatpp::Int64(0xFFFFFFFFFFFFFFFF)); checkHash(oatpp::Int64(0x7FFFFFFFFFFFFFFF));
checkHash(oatpp::UInt64(0xFFFFFFFFFFFFFFFF)); checkHash(oatpp::UInt64(0xFFFFFFFFFFFFFFFF));
checkHash(oatpp::Float32(0.2)); checkHash(oatpp::Float32(0.2f));
checkHash(oatpp::Float64(0.2)); checkHash(oatpp::Float64(0.2));
} }