mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 13:05:25 -05:00
tests: Added bitfield test
This commit is contained in:
@@ -7,12 +7,12 @@ namespace hex::test {
|
||||
class TestPatternPadding : public TestPattern {
|
||||
public:
|
||||
TestPatternPadding() : TestPattern("Padding") {
|
||||
auto testStruct = create<PatternDataStruct>(0x100, sizeof(s32) + 20 + sizeof(u8[0x10]), "TestStruct", "testStruct");
|
||||
auto testStruct = create<PatternDataStruct>("TestStruct", "testStruct", 0x100, sizeof(s32) + 20 + sizeof(u8[0x10]));
|
||||
|
||||
auto variable = create<PatternDataSigned>(0x100, sizeof(s32), "s32", "variable");
|
||||
auto padding = create<PatternDataPadding>(0x100 + sizeof(s32), 20, "", "");
|
||||
auto array = create<PatternDataStaticArray>(0x100 + sizeof(s32) + 20, sizeof(u8[0x10]), "u8", "array");
|
||||
array->setEntries(create<PatternDataUnsigned>(0x100 + sizeof(s32) + 20, sizeof(u8), "u8", ""), 0x10);
|
||||
auto variable = create<PatternDataSigned>("s32", "variable", 0x100, sizeof(s32));
|
||||
auto padding = create<PatternDataPadding>("", "", 0x100 + sizeof(s32), 20);
|
||||
auto array = create<PatternDataStaticArray>("u8", "array", 0x100 + sizeof(s32) + 20, sizeof(u8[0x10]));
|
||||
array->setEntries(create<PatternDataUnsigned>("u8", "", 0x100 + sizeof(s32) + 20, sizeof(u8)), 0x10);
|
||||
|
||||
testStruct->setMembers({ variable, padding, array });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user