DrgnParser: Options should default to false

We only want to do the extra work if it's explicitly requested.

chaseRawPointers is already explicitly requested whenever it's needed
and readEnumValues currently isn't needed at all.
This commit is contained in:
Alastair Robertson 2023-09-19 09:42:26 -07:00 committed by Alastair Robertson
parent 78b1a6c840
commit a509354624
3 changed files with 14 additions and 3 deletions

View File

@ -30,8 +30,8 @@ struct ContainerInfo;
namespace oi::detail::type_graph { namespace oi::detail::type_graph {
struct DrgnParserOptions { struct DrgnParserOptions {
bool chaseRawPointers = true; bool chaseRawPointers = false;
bool readEnumValues = true; bool readEnumValues = false;
}; };
/* /*

View File

@ -72,6 +72,16 @@ void DrgnParserTest::test(std::string_view function,
EXPECT_EQ(expected, actual); EXPECT_EQ(expected, actual);
} }
void DrgnParserTest::test(std::string_view function,
std::string_view expected) {
// Enable options in unit tests so we get more coverage
DrgnParserOptions options = {
.chaseRawPointers = true,
.readEnumValues = true,
};
test(function, expected, options);
}
void DrgnParserTest::testContains(std::string_view function, void DrgnParserTest::testContains(std::string_view function,
std::string_view expected, std::string_view expected,
DrgnParserOptions options) { DrgnParserOptions options) {

View File

@ -32,7 +32,8 @@ class DrgnParserTest : public ::testing::Test {
type_graph::DrgnParserOptions options); type_graph::DrgnParserOptions options);
void test(std::string_view function, void test(std::string_view function,
std::string_view expected, std::string_view expected,
type_graph::DrgnParserOptions options = {}); type_graph::DrgnParserOptions options);
void test(std::string_view function, std::string_view expected);
void testContains(std::string_view function, void testContains(std::string_view function,
std::string_view expected, std::string_view expected,
type_graph::DrgnParserOptions options = {}); type_graph::DrgnParserOptions options = {});