[wpiutil] Rename struct constants to all caps

This commit is contained in:
Peter Johnson
2026-03-15 22:37:36 -07:00
parent c913b27a27
commit aa88fa0fcf
48 changed files with 286 additions and 288 deletions

View File

@@ -502,7 +502,7 @@ TEST_P(DynamicSimpleStructTest, Check) {
EXPECT_EQ(fields[0].IsInt(), GetParam().isInt);
EXPECT_EQ(fields[0].IsUint(), GetParam().isUint);
EXPECT_FALSE(fields[0].IsArray());
if (GetParam().type != StructFieldType::kStruct) {
if (GetParam().type != StructFieldType::STRUCT) {
ASSERT_TRUE(desc->IsValid());
ASSERT_EQ(desc->GetSize(), GetParam().size);
ASSERT_EQ(fields[0].GetSize(), GetParam().size);
@@ -527,7 +527,7 @@ TEST_P(DynamicSimpleStructTest, Array) {
EXPECT_EQ(fields[0].IsUint(), GetParam().isUint);
EXPECT_TRUE(fields[0].IsArray());
EXPECT_EQ(fields[0].GetArraySize(), 2u);
if (GetParam().type != StructFieldType::kStruct) {
if (GetParam().type != StructFieldType::STRUCT) {
ASSERT_TRUE(desc->IsValid());
ASSERT_EQ(desc->GetSize(), GetParam().size * 2u);
} else {
@@ -550,7 +550,7 @@ static int64_t SignExtend(uint64_t value, size_t size) {
}
TEST_P(DynamicSimpleStructTest, IntRoundTrip) {
if (GetParam().type == StructFieldType::kStruct) {
if (GetParam().type == StructFieldType::STRUCT) {
return;
}
auto desc = db.Add("test", GetParam().schema, &err);
@@ -582,7 +582,7 @@ TEST_P(DynamicSimpleStructTest, IntRoundTrip) {
dynamic.SetUintField(field, value);
EXPECT_EQ(dynamic.GetUintField(field), value);
}
} else if (GetParam().type == StructFieldType::kBool) {
} else if (GetParam().type == StructFieldType::BOOL) {
dynamic.SetBoolField(field, false);
EXPECT_FALSE(dynamic.GetBoolField(field));
dynamic.SetBoolField(field, true);
@@ -591,39 +591,39 @@ TEST_P(DynamicSimpleStructTest, IntRoundTrip) {
}
static SimpleTestParam simpleTests[] = {
{"bool a", 1, StructFieldType::kBool, false, false, 8, UINT8_MAX, 0, 0},
{"char a", 1, StructFieldType::kChar, false, false, 8, UINT8_MAX, 0, 0},
{"int8 a", 1, StructFieldType::kInt8, true, false, 8, UINT8_MAX,
{"bool a", 1, StructFieldType::BOOL, false, false, 8, UINT8_MAX, 0, 0},
{"char a", 1, StructFieldType::CHAR, false, false, 8, UINT8_MAX, 0, 0},
{"int8 a", 1, StructFieldType::INT8, true, false, 8, UINT8_MAX,
static_cast<uint64_t>(std::numeric_limits<int8_t>::min()),
std::numeric_limits<int8_t>::max()},
{"int16 a", 2, StructFieldType::kInt16, true, false, 16, UINT16_MAX,
{"int16 a", 2, StructFieldType::INT16, true, false, 16, UINT16_MAX,
static_cast<uint64_t>(std::numeric_limits<int16_t>::min()),
std::numeric_limits<int16_t>::max()},
{"int32 a", 4, StructFieldType::kInt32, true, false, 32, UINT32_MAX,
{"int32 a", 4, StructFieldType::INT32, true, false, 32, UINT32_MAX,
static_cast<uint64_t>(std::numeric_limits<int32_t>::min()),
std::numeric_limits<int32_t>::max()},
{"int64 a", 8, StructFieldType::kInt64, true, false, 64, UINT64_MAX,
{"int64 a", 8, StructFieldType::INT64, true, false, 64, UINT64_MAX,
static_cast<uint64_t>(std::numeric_limits<int64_t>::min()),
std::numeric_limits<int64_t>::max()},
{"uint8 a", 1, StructFieldType::kUint8, false, true, 8, UINT8_MAX,
{"uint8 a", 1, StructFieldType::UINT8, false, true, 8, UINT8_MAX,
std::numeric_limits<uint8_t>::min(), std::numeric_limits<uint8_t>::max()},
{"uint16 a", 2, StructFieldType::kUint16, false, true, 16, UINT16_MAX,
{"uint16 a", 2, StructFieldType::UINT16, false, true, 16, UINT16_MAX,
std::numeric_limits<uint16_t>::min(),
std::numeric_limits<uint16_t>::max()},
{"uint32 a", 4, StructFieldType::kUint32, false, true, 32, UINT32_MAX,
{"uint32 a", 4, StructFieldType::UINT32, false, true, 32, UINT32_MAX,
std::numeric_limits<uint32_t>::min(),
std::numeric_limits<uint32_t>::max()},
{"uint64 a", 8, StructFieldType::kUint64, false, true, 64, UINT64_MAX,
{"uint64 a", 8, StructFieldType::UINT64, false, true, 64, UINT64_MAX,
std::numeric_limits<uint64_t>::min(),
std::numeric_limits<uint64_t>::max()},
{"float a", 4, StructFieldType::kFloat, false, false, 32, UINT32_MAX, 0, 0},
{"float32 a", 4, StructFieldType::kFloat, false, false, 32, UINT32_MAX, 0,
{"float a", 4, StructFieldType::FLOAT, false, false, 32, UINT32_MAX, 0, 0},
{"float32 a", 4, StructFieldType::FLOAT, false, false, 32, UINT32_MAX, 0,
0},
{"double a", 8, StructFieldType::kDouble, false, false, 64, UINT64_MAX, 0,
{"double a", 8, StructFieldType::DOUBLE, false, false, 64, UINT64_MAX, 0,
0},
{"float64 a", 8, StructFieldType::kDouble, false, false, 64, UINT64_MAX, 0,
{"float64 a", 8, StructFieldType::DOUBLE, false, false, 64, UINT64_MAX, 0,
0},
{"foo a", 0, StructFieldType::kStruct, false, false, 0, 0, 0, 0},
{"foo a", 0, StructFieldType::STRUCT, false, false, 0, 0, 0, 0},
};
INSTANTIATE_TEST_SUITE_P(DynamicSimpleStructTests, DynamicSimpleStructTest,