@@ -71,13 +71,12 @@ class ValueObjectMockProcessTest : public ::testing::Test {
71
71
}
72
72
73
73
CompilerType
74
- MakeEnumType (const std::vector<std::pair<const char *, int >> enumerators,
75
- bool is_signed) {
76
- CompilerType int_type = m_type_system->GetBuiltinTypeForEncodingAndBitSize (
77
- is_signed ? lldb::eEncodingSint : lldb::eEncodingUint, 32 );
74
+ MakeEnumType (const std::vector<std::pair<const char *, int >> enumerators) {
75
+ CompilerType uint_type = m_type_system->GetBuiltinTypeForEncodingAndBitSize (
76
+ lldb::eEncodingUint, 32 );
78
77
CompilerType enum_type = m_type_system->CreateEnumerationType (
79
78
" TestEnum" , m_type_system->GetTranslationUnitDecl (),
80
- OptionalClangModuleID (), Declaration (), int_type , false );
79
+ OptionalClangModuleID (), Declaration (), uint_type , false );
81
80
82
81
m_type_system->StartTagDeclarationDefinition (enum_type);
83
82
Declaration decl;
@@ -124,27 +123,12 @@ class ValueObjectMockProcessTest : public ::testing::Test {
124
123
lldb::ProcessSP m_process_sp;
125
124
};
126
125
127
- TEST_F (ValueObjectMockProcessTest, EmptyEnum) {
128
- // All values of an empty enum should be shown as plain numbers.
129
- TestDumpValueObject (MakeEnumType ({}, false ),
130
- {{0 , {}, " (TestEnum) test_var = 0\n " },
131
- {1 , {}, " (TestEnum) test_var = 1\n " },
132
- {2 , {}, " (TestEnum) test_var = 2\n " }});
133
-
134
- TestDumpValueObject (MakeEnumType ({}, true ),
135
- {{-2 , {}, " (TestEnum) test_var = -2\n " },
136
- {-1 , {}, " (TestEnum) test_var = -1\n " },
137
- {0 , {}, " (TestEnum) test_var = 0\n " },
138
- {1 , {}, " (TestEnum) test_var = 1\n " },
139
- {2 , {}, " (TestEnum) test_var = 2\n " }});
140
- }
141
-
142
126
TEST_F (ValueObjectMockProcessTest, Enum) {
143
127
// This is not a bitfield-like enum, so values are printed as decimal by
144
128
// default. Also we only show the enumerator name if the value is an
145
129
// exact match.
146
130
TestDumpValueObject (
147
- MakeEnumType ({{" test_2" , 2 }, {" test_3" , 3 }}, false ),
131
+ MakeEnumType ({{" test_2" , 2 }, {" test_3" , 3 }}),
148
132
{{0 , {}, " (TestEnum) test_var = 0\n " },
149
133
{1 , {}, " (TestEnum) test_var = 1\n " },
150
134
{2 , {}, " (TestEnum) test_var = test_2\n " },
@@ -168,7 +152,7 @@ TEST_F(ValueObjectMockProcessTest, BitFieldLikeEnum) {
168
152
// as hex, and values without exact matches are shown as a combination of
169
153
// enumerators and any remaining value left over.
170
154
TestDumpValueObject (
171
- MakeEnumType ({{" test_2" , 2 }, {" test_4" , 4 }}, false ),
155
+ MakeEnumType ({{" test_2" , 2 }, {" test_4" , 4 }}),
172
156
{
173
157
{0 , {}, " (TestEnum) test_var = 0x0\n " },
174
158
{1 , {}, " (TestEnum) test_var = 0x1\n " },
0 commit comments