summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp
diff options
context:
space:
mode:
authorDiego Astiazaran <diegoaat97@gmail.com>2019-08-16 00:10:49 +0000
committerDiego Astiazaran <diegoaat97@gmail.com>2019-08-16 00:10:49 +0000
commitba3d595f93a45965adb4f47bfc57e28c00ba8942 (patch)
treeee16fc68101e6222c8bb9cf10f93f994f74cf423 /clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp
parent76053297bd779ae13bd456c8ddbd405754ee39f2 (diff)
downloadbcm5719-llvm-ba3d595f93a45965adb4f47bfc57e28c00ba8942.tar.gz
bcm5719-llvm-ba3d595f93a45965adb4f47bfc57e28c00ba8942.zip
[clang-doc] Serialize inherited attributes and methods
clang-doc now serializes the inherited attributes and methods, not only the name of the base class. All inherited are tracked, if B:A and C:B, info of A is included in C. This data is stored in attribute Bases in a RecordInfo. Previously tracked inheritance data, stored in Parents and VParents, hasn't been removed to reduce review load. Differential revision: https://reviews.llvm.org/D66238 llvm-svn: 369075
Diffstat (limited to 'clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp')
-rw-r--r--clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp b/clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp
index 4350225df39..970ffcebd71 100644
--- a/clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp
+++ b/clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp
@@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
+#include "ClangDocTest.h"
#include "Representation.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "gtest/gtest.h"
@@ -168,6 +169,10 @@ void CheckRecordInfo(RecordInfo *Expected, RecordInfo *Actual) {
for (size_t Idx = 0; Idx < Actual->VirtualParents.size(); ++Idx)
CheckReference(Expected->VirtualParents[Idx], Actual->VirtualParents[Idx]);
+ ASSERT_EQ(Expected->Bases.size(), Actual->Bases.size());
+ for (size_t Idx = 0; Idx < Actual->Bases.size(); ++Idx)
+ CheckBaseRecordInfo(&Expected->Bases[Idx], &Actual->Bases[Idx]);
+
ASSERT_EQ(Expected->ChildRecords.size(), Actual->ChildRecords.size());
for (size_t Idx = 0; Idx < Actual->ChildRecords.size(); ++Idx)
CheckReference(Expected->ChildRecords[Idx], Actual->ChildRecords[Idx]);
@@ -182,6 +187,14 @@ void CheckRecordInfo(RecordInfo *Expected, RecordInfo *Actual) {
CheckEnumInfo(&Expected->ChildEnums[Idx], &Actual->ChildEnums[Idx]);
}
+void CheckBaseRecordInfo(BaseRecordInfo *Expected, BaseRecordInfo *Actual) {
+ CheckRecordInfo(Expected, Actual);
+
+ EXPECT_EQ(Expected->IsVirtual, Actual->IsVirtual);
+ EXPECT_EQ(Expected->Access, Actual->Access);
+ EXPECT_EQ(Expected->IsParent, Actual->IsParent);
+}
+
void CheckIndex(Index &Expected, Index &Actual) {
CheckReference(Expected, Actual);
ASSERT_EQ(Expected.Children.size(), Actual.Children.size());
OpenPOWER on IntegriCloud