Now we only support returning Optional<> values and have changed all clients over to use Optional::getValueOr().
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp | ||
---|---|---|
276–278 ↗ | (On Diff #83994) | Looks like all of these could use op* instead: EXPECT_EQ(Data1, *DieDG.getAttributeValueAsUnsignedConstant(Attr_DW_Form_data1)); Since they'll fail if the value isn't present anyway - granted, using getValueOr means they fail elegantly (with an EXPECT fail, which also allows the test to continue on to the other EXPECTS rather than assert-failing and halting immediately) & to fail in a well defined way even in non-asserts builds. But I don't think that's too important relative to the likelyhood of those failure modes. (also, switching the arguments around probably produces better failures - the expected value is the first parameter, the value under test should be the second parameter (if I recall correctly, at least - you may want to double check the documentation for EXPECT_*)) |
I will leave the tests using getValueOr() for now as I would like it to fail nicely so we can get a complete snapshot of what is failing instead of crashing on any failure and not knowing how many others tests would fail. I will read up on EXPECT_* and make a separate change for switching arg order if needed.