[Lldb-commits] [lldb] 72d9390 - Add a little extra test coverage for simple template names

David Blaikie via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 7 17:14:13 PDT 2022


Author: David Blaikie
Date: 2022-07-08T00:12:29Z
New Revision: 72d9390778966d4f87ec4b1de63c107b2fd46b9a

URL: https://github.com/llvm/llvm-project/commit/72d9390778966d4f87ec4b1de63c107b2fd46b9a
DIFF: https://github.com/llvm/llvm-project/commit/72d9390778966d4f87ec4b1de63c107b2fd46b9a.diff

LOG: Add a little extra test coverage for simple template names

This would fail with an overly naive approach to simple template
name (clang's -gsimple-template-names) since the names wouldn't be
unique per specialization, creating ambiguity/chance that a query for
one specialization would find another.

Added: 
    

Modified: 
    lldb/test/API/lang/cpp/complete-type-check/TestCppIsTypeComplete.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/lang/cpp/complete-type-check/TestCppIsTypeComplete.py b/lldb/test/API/lang/cpp/complete-type-check/TestCppIsTypeComplete.py
index b596611b15f2f..81a8876743474 100644
--- a/lldb/test/API/lang/cpp/complete-type-check/TestCppIsTypeComplete.py
+++ b/lldb/test/API/lang/cpp/complete-type-check/TestCppIsTypeComplete.py
@@ -14,6 +14,11 @@ def assertComplete(self, typename):
         self.assertTrue(found_type.IsValid())
         self.assertTrue(found_type.IsTypeComplete())
 
+    def assertIsNotPresent(self, typename):
+        """ Asserts that the type with the given name is not found. """
+        found_type = self.target().FindFirstType(typename)
+        self.assertFalse(found_type.IsValid())
+
     def assertCompleteWithVar(self, typename):
         """ Asserts that the type with the given name is complete. """
         found_type = self.target().FindFirstType(typename)
@@ -41,6 +46,7 @@ def test_forward_declarations(self):
         self.assertCompleteWithVar("DefinedClass")
         self.assertCompleteWithVar("DefinedClassTypedef")
         self.assertCompleteWithVar("DefinedTemplateClass<int>")
+        self.assertIsNotPresent("DefinedTemplateClass<long>")
 
         # Record types without a defining declaration are not complete.
         self.assertPointeeIncomplete("FwdClass *", "fwd_class")


        


More information about the lldb-commits mailing list