mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
fix StructLayout::getNumber
This commit is contained in:
parent
35079d1b49
commit
dfb5baf79b
2 changed files with 4 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue