diff options
author | Pavel Labath <pavel@labath.sk> | 2019-01-16 12:43:01 +0000 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2019-01-16 12:43:01 +0000 |
commit | 2a32a69c53ba4e4e458a4bdd9cc5060d8a91ac85 (patch) | |
tree | 675b60e99b520066236353e74205699c9a429a3b /lldb | |
parent | dd487d65211d919873beeca3206a8b9401a710a1 (diff) |
TestClangASTContext: Rewrite an if-else chain into a switch
This avoids the "ambiguous else" warning, which comes from within the
EXPECT_TRUE macro.
llvm-svn: 351331
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/unittests/Symbol/TestClangASTContext.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lldb/unittests/Symbol/TestClangASTContext.cpp b/lldb/unittests/Symbol/TestClangASTContext.cpp index ad2cb2c9e54e..28df732fc791 100644 --- a/lldb/unittests/Symbol/TestClangASTContext.cpp +++ b/lldb/unittests/Symbol/TestClangASTContext.cpp @@ -190,12 +190,20 @@ void VerifyEncodingAndBitSize(clang::ASTContext *context, return; EXPECT_TRUE(type_ptr->isBuiltinType()); - if (encoding == eEncodingSint) + switch (encoding) { + case eEncodingSint: EXPECT_TRUE(type_ptr->isSignedIntegerType()); - else if (encoding == eEncodingUint) + break; + case eEncodingUint: EXPECT_TRUE(type_ptr->isUnsignedIntegerType()); - else if (encoding == eEncodingIEEE754) + break; + case eEncodingIEEE754: EXPECT_TRUE(type_ptr->isFloatingType()); + break; + default: + FAIL() << "Unexpected encoding"; + break; + } } TEST_F(TestClangASTContext, TestBuiltinTypeForEncodingAndBitSize) { |