Problem
When an integration test fails due to a JSON metadata mismatch, the error message provides no indication of which field caused the failure:
[json.exception.type_error.302] type must be string, but is number
This happens because tests use implicit nlohmann::json conversions (e.g. unit = axes[2]["unit"]) that throw a raw json::type_error or json::out_of_range before any EXPECT macro runs. The generic catch (const std::exception& e) in main() only prints e.what(), which has no file, line, or field name.
Narrowing down these failures currently requires attaching a debugger.
Affected tests
Every integration test that calls verify_group_metadata or verify_array_metadata — at least 10 files.
Suggested fix
Replace bare implicit conversions with .value() + EXPECT so failures report context:
// Before (throws raw json exception, no context):
unit = axes[2]["unit"];
// After (EXPECT prints file:line and field name on mismatch):
EXPECT(axes[2].contains("unit"), "Missing 'unit' on axis ", axes[2]["name"]);
unit = axes[2]["unit"].get<std::string>();
Or use axes[2].value("unit", "") to avoid the throw entirely, then check with EXPECT.
Problem
When an integration test fails due to a JSON metadata mismatch, the error message provides no indication of which field caused the failure:
This happens because tests use implicit nlohmann::json conversions (e.g.
unit = axes[2]["unit"]) that throw a rawjson::type_errororjson::out_of_rangebefore anyEXPECTmacro runs. The genericcatch (const std::exception& e)inmain()only printse.what(), which has no file, line, or field name.Narrowing down these failures currently requires attaching a debugger.
Affected tests
Every integration test that calls
verify_group_metadataorverify_array_metadata— at least 10 files.Suggested fix
Replace bare implicit conversions with
.value()+ EXPECT so failures report context:Or use
axes[2].value("unit", "")to avoid the throw entirely, then check with EXPECT.