[PATCH] D85962: [SyntaxTree] Create annotations infrastructure and apply it in expression tests.
Eduardo Caldas via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 18 05:32:58 PDT 2020
eduucaldas added inline comments.
================
Comment at: clang/unittests/Tooling/Syntax/TreeTestBase.cpp:199
+ auto AnnotatedRanges = AnnotatedCode.ranges();
+ assert(AnnotatedRanges.size() == TreeDumps.size());
+ for (auto i = 0ul; i < AnnotatedRanges.size(); i++) {
----------------
eduucaldas wrote:
> gribozavr2 wrote:
> > ASSERT_EQ I think would be better.
> `ASSERT_EQ` is a macro that returns void, so we cannot use it here.
>
> However that brings another question.
> Right now we have methods `treeDumpEqual*` that return `AssertionResult`s and we use them in our tests in the following way: `EXPECT_TRUE(treeDumpEqual*...)`.
> It seems to me that we should instead perform any assertion inside `treeDumpEqual*`, and then just call it directly in the test.
>
> WDYT? I case you agree we can perform this change in another patch.
We need the `EXPECT_TRUE` at the test site to get information about in which line number we failed
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85962/new/
https://reviews.llvm.org/D85962
More information about the cfe-commits
mailing list