[Lldb-commits] [PATCH] D112180: Libcpp bitset syntethic children and tests

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 25 14:50:18 PDT 2021


wallace added inline comments.


================
Comment at: lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py:32-35
         for i in range(size):
             child = var.GetChildAtIndex(i)
             self.assertEqual(child.GetValueAsUnsigned(), self.primes[i],
                     "variable: %s, index: %d"%(name, size))
----------------
wallace wrote:
> What teemperor is saying is to something like:
> 
>   children = [ValueCheck(name="<something goes here>", summary='<same here>')]
>   for i in range(size):
>     children.append(
>   valobj = self.expect_var_path(
>             name,
>             type="std::bitset<" + size + ">", # you might need to change this depending on the stdlib you use for each test
>             children=children,
>         )
> 
>   self.assertRegex(valobj.summary, r'^"hello"( strong=1)? weak=1$') # change this for the actual summary of the object
Ugh, I made some mistakes

```
children = []
for i in range(size):
  children.append(
valobj = self.expect_var_path( // this will check the entire bitset and the children argument will check its children
          name,
          type="std::bitset<" + size + ">", // you might need to change this depending on the stdlib you use for each test
          children=children,
      )

self.assertRegex(valobj.summary, r'^"hello"( strong=1)? weak=1$') # change this for the actual summary of the object
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112180/new/

https://reviews.llvm.org/D112180



More information about the lldb-commits mailing list