Skip to content

Commit

Permalink
Ignore zero variadic macro warning
Browse files Browse the repository at this point in the history
Ignore gnu-zero-variadic-macro-arguments for clang because
"__VA_ARGS__" is a GNU extension, not part of the standard
C language.

Replace TYPED_TEST_CASE with TYPED_TEST_SUITE because
TYPED_TEST_CASE has been deprecated.

Change-Id: Id153a24bf4ac2de5623e85c11ac4ca24b6224fd0
  • Loading branch information
EstherWx committed Jan 18, 2024
1 parent b9b07d6 commit 7df1450
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
10 changes: 1 addition & 9 deletions test/unittest/documenttest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,15 +461,7 @@ struct DocumentMove: public ::testing::Test {
};

typedef ::testing::Types< CrtAllocator, MemoryPoolAllocator<> > MoveAllocatorTypes;
class TypeTestNames {
public:
template <typename T>
static std::string GetName(int) {
if (std::is_same<T, CrtAllocator>()) return "CrtAllocator";
if (std::is_same<T, MemoryPoolAllocator<>>()) return "MemoryPoolAllocator<>";
}
};
TYPED_TEST_CASE(DocumentMove, MoveAllocatorTypes, TypeTestNames);
TYPED_TEST_SUITE(DocumentMove, MoveAllocatorTypes);

TYPED_TEST(DocumentMove, MoveConstructor) {
typedef TypeParam Allocator;
Expand Down
1 change: 1 addition & 0 deletions test/unittest/unittest.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#ifdef __clang__
// All TEST() macro generated this warning, disable globally
#pragma GCC diagnostic ignored "-Wglobal-constructors"
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif

template <typename Ch>
Expand Down

0 comments on commit 7df1450

Please sign in to comment.