fix StructLayout::getNumber
This commit is contained in:
parent
35079d1b49
commit
dfb5baf79b
@ -310,7 +310,8 @@ number_t StructLayout::getNumber(
|
|||||||
case FieldType::I64:
|
case FieldType::I64:
|
||||||
case FieldType::CHAR:
|
case FieldType::CHAR:
|
||||||
return getInteger(src, name, index);
|
return getInteger(src, name, index);
|
||||||
|
default:
|
||||||
|
throw std::runtime_error("type error");
|
||||||
}
|
}
|
||||||
throw std::runtime_error("type error");
|
throw std::runtime_error("type error");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,6 +92,8 @@ TEST(StructLayout, ConvertWithLoss) {
|
|||||||
};
|
};
|
||||||
auto dstLayout = StructLayout::create(dstFields);
|
auto dstLayout = StructLayout::create(dstFields);
|
||||||
auto report = srcLayout.checkCompatibility(dstLayout);
|
auto report = srcLayout.checkCompatibility(dstLayout);
|
||||||
|
|
||||||
|
// check report
|
||||||
std::sort(report.begin(), report.end(), [](const auto& a, const auto& b) {
|
std::sort(report.begin(), report.end(), [](const auto& a, const auto& b) {
|
||||||
return a.name < b.name;
|
return a.name < b.name;
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user