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 | ||
---|---|---|
64 | nit: can be directly asserted | |
70 | nit: can be directly asserted | |
79 | nit: can be directly asserted | |
87 | nit: again can be directly asserted | |
159 | maybe make this an assert too (and also consider issuing ASSERT_FALSE directly on the expression instead of an extra assingment) | |
165 | same as the previous one | |
171 | same as the previous one | |
193 | nit: maybe directly issue EXPECT_FALSE(WrongMarshaller.toProtobuf(Sym)) instead of going through an extra variable. | |
275 | this should be done before the EXPECT_EQ above (which accesses headers_size()) |
Address most comments.
clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp | ||
---|---|---|
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! | |
159 | 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 | ||
---|---|---|
159 | Should be OK as discussed in PM. |
nit: can be directly asserted