[Lldb-commits] [PATCH] D131472: [LLDB] Add multi value test for const static enum

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 10 01:50:19 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5e538c669c76: [LLDB] Add multi value test for const static enum (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131472

Files:
  lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
  lldb/test/API/lang/cpp/const_static_integral_member/main.cpp


Index: lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
===================================================================
--- lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
+++ lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
@@ -48,7 +48,9 @@
 
   const static Enum enum_val = enum_case2;
   const static ScopedEnum scoped_enum_val = ScopedEnum::scoped_enum_case2;
-  const static ScopedEnum invalid_scoped_enum_val = static_cast<ScopedEnum>(5);
+  const static ScopedEnum not_enumerator_scoped_enum_val = static_cast<ScopedEnum>(5);
+  const static ScopedEnum not_enumerator_scoped_enum_val_2 =
+      static_cast<ScopedEnum>(7);
   const static ScopedCharEnum scoped_char_enum_val = ScopedCharEnum::case2;
   const static ScopedLongLongEnum scoped_ll_enum_val_neg =
       ScopedLongLongEnum::case0;
@@ -102,7 +104,7 @@
 
   Enum e = A::enum_val;
   ScopedEnum se = A::scoped_enum_val;
-  se = A::invalid_scoped_enum_val;
+  se = A::not_enumerator_scoped_enum_val;
   ScopedCharEnum sce = A::scoped_char_enum_val;
   ScopedLongLongEnum sle = A::scoped_ll_enum_val;
 
Index: lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
===================================================================
--- lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
+++ lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
@@ -56,8 +56,11 @@
 
         # Test a scoped enum.
         self.expect_expr("A::scoped_enum_val", result_value="scoped_enum_case2")
-        # Test an scoped enum with an invalid enum case.
-        self.expect_expr("A::invalid_scoped_enum_val", result_value="scoped_enum_case1 | 0x4")
+        # Test an scoped enum with a value that isn't an enumerator.
+        self.expect_expr("A::not_enumerator_scoped_enum_val", result_value="scoped_enum_case1 | 0x4")
+        # This time with more than one enum value plus the extra.
+        self.expect_expr("A::not_enumerator_scoped_enum_val_2",
+                         result_value="scoped_enum_case1 | scoped_enum_case2 | 0x4")
 
         # Test an enum with fixed underlying type.
         self.expect_expr("A::scoped_char_enum_val", result_value="case2")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131472.451387.patch
Type: text/x-patch
Size: 2256 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220810/d46f9809/attachment.bin>


More information about the lldb-commits mailing list