When dereferencing Optional's it makes sense to use ASSERT_TRUE for better
test failures readability. Switch from EXPECT_TRUE to ASSERT_TRUE where
it is appropriate.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
thanks LGTM!
| clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp | ||
|---|---|---|
| 63–64 | nit: can be directly asserted | |
| 68–69 | nit: can be directly asserted | |
| 76–77 | nit: can be directly asserted | |
| 83–84 | nit: again can be directly asserted | |
| 153–154 | maybe make this an assert too (and also consider issuing ASSERT_FALSE directly on the expression instead of an extra assingment) | |
| 159 | same as the previous one | |
| 164 | same as the previous one | |
| 184–185 | nit: maybe directly issue EXPECT_FALSE(WrongMarshaller.toProtobuf(Sym)) instead of going through an extra variable. | |
| 266–267 | this should be done before the EXPECT_EQ above (which accesses headers_size()) | |
Address most comments.
| clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp | ||
|---|---|---|
| 63–64 | Do you mean "directly checked (whether via EXPECTED or ASSERT, I guess EXPECTED should be still better here, right?)" here and elsewhere? If so, done! | |
| 153–154 | Why is would asserting be better here? If I'm not dereferencing it I guess this should be worse because only the first assertion failure is checked, right? | |
| clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp | ||
|---|---|---|
| 153–154 | Should be OK as discussed in PM. | |
nit: can be directly asserted