GP-0 CompositeInternal.toString() cleanup

This commit is contained in:
ghidra1 2024-01-18 11:55:00 -05:00
parent c0c72ccd12
commit 87b4a89a46
16 changed files with 652 additions and 662 deletions

View file

@ -653,8 +653,7 @@ public class DataTypeMerge3Test extends AbstractDataTypeMergeTest {
new CategoryPath("/Category1/Category2/Category5"), "my_s1", 0);
mys1.add(s);
mys1 =
(Structure) dtm.addDataType(mys1, DataTypeConflictHandler.DEFAULT_HANDLER);
mys1 = (Structure) dtm.addDataType(mys1, DataTypeConflictHandler.DEFAULT_HANDLER);
// edit FloatStruct
fs.add(mys1);
@ -680,9 +679,8 @@ public class DataTypeMerge3Test extends AbstractDataTypeMergeTest {
dtm.getDataType(new CategoryPath("/Category1/Category2/Category5"), "FloatStruct"));
waitForCompletion();
Structure fs =
(Structure) dtm.getDataType(new CategoryPath("/Category1/Category2/Category5"),
"FloatStruct");
Structure fs = (Structure) dtm
.getDataType(new CategoryPath("/Category1/Category2/Category5"), "FloatStruct");
assertNull(fs);
// MyStruct should have a FloatDataType and a Word
@ -796,8 +794,7 @@ public class DataTypeMerge3Test extends AbstractDataTypeMergeTest {
DataTypeManager dtm = program.getDataTypeManager();
// add new BF not compatible with BitFields
dtm.addDataType(
new StructureDataType(new CategoryPath("/Category1/Category2"), "BF", 0),
null);
new StructureDataType(new CategoryPath("/Category1/Category2"), "BF", 0), null);
}
@Override
@ -877,18 +874,16 @@ public class DataTypeMerge3Test extends AbstractDataTypeMergeTest {
@Override
public void modifyLatest(ProgramDB program) {
DataTypeManager dtm = program.getDataTypeManager();
Structure s1 =
(Structure) dtm.getDataType(new CategoryPath("/Category1/Category2"),
"Structure_1");
Structure s1 = (Structure) dtm.getDataType(new CategoryPath("/Category1/Category2"),
"Structure_1");
s1.add(new ArrayDataType(td, 0, -1), 0, null, null);
}
@Override
public void modifyPrivate(ProgramDB program) {
DataTypeManager dtm = program.getDataTypeManager();
Structure s1 =
(Structure) dtm.getDataType(new CategoryPath("/Category1/Category2"),
"Structure_1");
Structure s1 = (Structure) dtm.getDataType(new CategoryPath("/Category1/Category2"),
"Structure_1");
s1.add(new ArrayDataType(IntegerDataType.dataType, 0, -1), "flex1", "cmt1");
}
});
@ -931,18 +926,16 @@ public class DataTypeMerge3Test extends AbstractDataTypeMergeTest {
@Override
public void modifyOriginal(ProgramDB program) throws Exception {
DataTypeManager dtm = program.getDataTypeManager();
Structure s1 =
(Structure) dtm.getDataType(new CategoryPath("/Category1/Category2"),
"Structure_1");
Structure s1 = (Structure) dtm.getDataType(new CategoryPath("/Category1/Category2"),
"Structure_1");
s1.add(new ArrayDataType(IntegerDataType.dataType, 0, -1), 0, null, null);
}
@Override
public void modifyLatest(ProgramDB program) {
DataTypeManager dtm = program.getDataTypeManager();
Structure s1 =
(Structure) dtm.getDataType(new CategoryPath("/Category1/Category2"),
"Structure_1");
Structure s1 = (Structure) dtm.getDataType(new CategoryPath("/Category1/Category2"),
"Structure_1");
// last component is flex array to be replaced
s1.replace(s1.getNumComponents() - 1, new ArrayDataType(td, 0, -1), 0, "flex1",
"cmt1");
@ -952,9 +945,8 @@ public class DataTypeMerge3Test extends AbstractDataTypeMergeTest {
public void modifyPrivate(ProgramDB program) {
DataTypeManager dtm = program.getDataTypeManager();
try {
Structure s1 =
(Structure) dtm.getDataType(new CategoryPath("/Category1/Category2"),
"Structure_1");
Structure s1 = (Structure) dtm
.getDataType(new CategoryPath("/Category1/Category2"), "Structure_1");
s1.deleteAtOffset(s1.getLength());
s1.insertBitFieldAt(3, 2, 6, td, 2, "bf1", "my bf1");
s1.insertBitFieldAt(3, 2, 4, td, 2, "bf2", "my bf2");
@ -1739,8 +1731,7 @@ public class DataTypeMerge3Test extends AbstractDataTypeMergeTest {
enumm.add("two", 2);
enumm.add("three", 3);
dtm.addDataType(
new TypedefDataType(new CategoryPath("/Category1"), "TD_MyEnum", enumm),
null);
new TypedefDataType(new CategoryPath("/Category1"), "TD_MyEnum", enumm), null);
}
@Override
@ -1806,7 +1797,7 @@ public class DataTypeMerge3Test extends AbstractDataTypeMergeTest {
" 0 DLL_Table 96 \"\"\n" +
" 0 DLL_Table *32 4 \"\"\n" +
"}\n" +
"Size = 96 Actual Alignment = 1\n", union.toString());
"Length: 96 Alignment: 1\n", union.toString());
//@formatter:on
}

View file

@ -181,7 +181,7 @@ public class DataTypeTest extends AbstractGhidraHeadedIntegrationTest {
"Structure xyz {\n" +
" 0 int *[2] 8 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4\n",
"Length: 8 Alignment: 4\n",
resolvedStruct2.toString());
//@formatter:on
}
@ -220,7 +220,7 @@ public class DataTypeTest extends AbstractGhidraHeadedIntegrationTest {
"Structure xyz {\n" +
" 0 int *[0] 0 \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 4\n",
"Length: 0 Alignment: 4\n",
resolvedStruct2.toString());
//@formatter:on
}

View file

@ -48,7 +48,7 @@ public class CompositeZeroArrayTest extends AbstractCompositeZeroArrayTest {
" 8 int[0] 0 y \"\"\n" +
" 8 int 4 b \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -64,7 +64,7 @@ public class CompositeZeroArrayTest extends AbstractCompositeZeroArrayTest {
" 6 char[0] 0 x \"\"\n" +
" 8 int[0] 0 y \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -78,7 +78,7 @@ public class CompositeZeroArrayTest extends AbstractCompositeZeroArrayTest {
" 0 int 4 a \"\"\n" +
" 4 zeroArrayStruct2 8 s \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -95,7 +95,7 @@ public class CompositeZeroArrayTest extends AbstractCompositeZeroArrayTest {
" 0 int[0] 0 y \"\"\n" +
" 0 int 4 b \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", union);
"Length: 4 Alignment: 4", union);
//@formatter:on
}
@ -111,7 +111,7 @@ public class CompositeZeroArrayTest extends AbstractCompositeZeroArrayTest {
" 0 char[0] 0 x \"\"\n" +
" 0 int[0] 0 y \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", union);
"Length: 4 Alignment: 4", union);
//@formatter:on
}
@ -125,7 +125,7 @@ public class CompositeZeroArrayTest extends AbstractCompositeZeroArrayTest {
" 0 int 4 a \"\"\n" +
" 0 zeroArrayStruct2 8 s \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", union);
"Length: 8 Alignment: 4", union);
//@formatter:on
}
}

View file

@ -48,7 +48,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 9 int:8(3) 2 d \"\"\n" +
" 10 int:6(3) 2 e \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -65,7 +65,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 9 int:8(3) 2 d \"\"\n" +
" 10 int:6(3) 2 e \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -82,7 +82,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 12 int:85(0) 4 d \"\"\n" +
" 16 int:6(0) 1 e \"\"\n" +
"}\n" +
"Size = 20 Actual Alignment = 4", struct);
"Length: 20 Alignment: 4", struct);
//@formatter:on
DataTypeComponent c = struct.getComponent(3);
assertTrue(c.isBitFieldComponent());
@ -104,7 +104,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 4 int:8(0) 1 c \"\"\n" +
" 8 short:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -121,7 +121,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 8 short:4(0) 1 d \"\"\n" +
" 12 long[0] 0 flex \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -137,7 +137,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 4 int:8(0) 1 c \"\"\n" +
" 5 int:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -153,7 +153,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 4 int:8(0) 1 c \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -171,7 +171,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 4 int:8(0) 1 c \"\"\n" +
" 8 short:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -188,7 +188,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 8 int:0(0) 0 \"\"\n" +
" 8 short:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -205,7 +205,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 5 int:4(0) 1 d \"\"\n" +
" 8 longlong:0(0) 0 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 8", struct);
"Length: 8 Alignment: 8", struct);
//@formatter:on
}
@ -222,7 +222,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 8 longlong:0(0) 0 \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 16 Actual Alignment = 8", struct);
"Length: 16 Alignment: 8", struct);
//@formatter:on
}
@ -239,7 +239,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 16 int:8(0) 1 c \"\"\n" +
" 20 char 1 d \"\"\n" +
"}\n" +
"Size = 24 Actual Alignment = 8", struct);
"Length: 24 Alignment: 8", struct);
//@formatter:on
}
@ -259,7 +259,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 32 int:8(0) 1 f \"\"\n" +
" 36 char 1 g \"\"\n" +
"}\n" +
"Size = 40 Actual Alignment = 8", struct);
"Length: 40 Alignment: 8", struct);
//@formatter:on
}
@ -275,7 +275,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 3 int:8(0) 1 c \"\"\n" +
" 7 short:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 9 Actual Alignment = 1", struct);
"Length: 9 Alignment: 1", struct);
//@formatter:on
}
@ -291,7 +291,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 3 int:8(0) 1 c \"\"\n" +
" 4 int:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 7 Actual Alignment = 1", struct);
"Length: 7 Alignment: 1", struct);
//@formatter:on
}
@ -307,7 +307,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 3 int:8(0) 1 c \"\"\n" +
" 7 char 1 d \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 1", struct);
"Length: 8 Alignment: 1", struct);
//@formatter:on
}
@ -324,7 +324,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 3 int:8(0) 1 c \"\"\n" +
" 7 short:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 9 Actual Alignment = 1", struct);
"Length: 9 Alignment: 1", struct);
//@formatter:on
}
@ -341,7 +341,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 7 int:0(0) 0 \"\"\n" +
" 7 short:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 9 Actual Alignment = 1", struct);
"Length: 9 Alignment: 1", struct);
//@formatter:on
}
@ -358,7 +358,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 4 int:4(0) 1 d \"\"\n" +
" 8 longlong:0(0) 0 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 1", struct);
"Length: 8 Alignment: 1", struct);
//@formatter:on
}
@ -372,7 +372,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 0 char 1 a \"\"\n" +
" 1 Z3p1 8 z3p1 \"\"\n" +
"}\n" +
"Size = 9 Actual Alignment = 1", struct);
"Length: 9 Alignment: 1", struct);
//@formatter:on
}
@ -389,7 +389,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 7 longlong:0(0) 0 \"\"\n" +
" 7 char 1 d \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 1", struct);
"Length: 8 Alignment: 1", struct);
//@formatter:on
}
@ -405,7 +405,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 4 int:8(0) 1 c \"\"\n" +
" 8 short:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 10 Actual Alignment = 2", struct);
"Length: 10 Alignment: 2", struct);
//@formatter:on
}
@ -421,7 +421,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 4 int:8(0) 1 c \"\"\n" +
" 5 int:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 2", struct);
"Length: 8 Alignment: 2", struct);
//@formatter:on
}
@ -437,7 +437,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 4 int:8(0) 1 c \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 10 Actual Alignment = 2", struct);
"Length: 10 Alignment: 2", struct);
//@formatter:on
}
@ -454,7 +454,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 8 longlong 8 d \"\"\n" +
" 16 int:4(0) 1 e \"\"\n" +
"}\n" +
"Size = 20 Actual Alignment = 2", struct);
"Length: 20 Alignment: 2", struct);
//@formatter:on
}
@ -471,7 +471,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 4 int:8(0) 1 c \"\"\n" +
" 8 short:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 10 Actual Alignment = 2", struct);
"Length: 10 Alignment: 2", struct);
//@formatter:on
}
@ -506,7 +506,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 21 short:4(0) 1 _d6 \"\"\n" +
" 21 short:4(4) 1 _d7 \"\"\n" +
"}\n" +
"Size = 22 Actual Alignment = 2", struct);
"Length: 22 Alignment: 2", struct);
//@formatter:on
}
@ -523,7 +523,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 8 int:0(0) 0 \"\"\n" +
" 8 short:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 10 Actual Alignment = 2", struct);
"Length: 10 Alignment: 2", struct);
//@formatter:on
}
@ -540,7 +540,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 5 int:4(0) 1 d \"\"\n" +
" 8 longlong:0(0) 0 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 2", struct);
"Length: 8 Alignment: 2", struct);
//@formatter:on
}
@ -557,7 +557,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 8 longlong:0(0) 0 \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 10 Actual Alignment = 2", struct);
"Length: 10 Alignment: 2", struct);
//@formatter:on
}
@ -574,7 +574,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 8 longlong:0(0) 0 \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 10 Actual Alignment = 2", struct);
"Length: 10 Alignment: 2", struct);
//@formatter:on
}
@ -587,7 +587,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
"Structure x1p2 {\n" +
" 0 char 1 a \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1", struct);
"Length: 1 Alignment: 1", struct);
//@formatter:on
}
@ -601,7 +601,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 0 char 1 a \"\"\n" +
" 2 int:27(0) 4 b \"\"\n" +
"}\n" +
"Size = 6 Actual Alignment = 2", struct);
"Length: 6 Alignment: 2", struct);
//@formatter:on
}
@ -616,7 +616,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 2 short:0(0) 0 \"\"\n" +
" 2 int:27(0) 4 b \"\"\n" +
"}\n" +
"Size = 6 Actual Alignment = 2", struct);
"Length: 6 Alignment: 2", struct);
//@formatter:on
}
@ -631,7 +631,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 2 int:27(0) 4 b \"\"\n" +
" 8 longlong:0(0) 0 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 2", struct);
"Length: 8 Alignment: 2", struct);
//@formatter:on
}
@ -648,7 +648,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 8 longlong:0(0) 0 \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -661,7 +661,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
"Structure x1p4 {\n" +
" 0 char 1 a \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1", struct);
"Length: 1 Alignment: 1", struct);
//@formatter:on
}
@ -675,7 +675,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 0 char 1 a \"\"\n" +
" 4 int:27(0) 4 b \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -690,7 +690,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 4 short:0(0) 0 \"\"\n" +
" 4 int:27(0) 4 b \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -705,7 +705,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 4 int:27(0) 4 b \"\"\n" +
" 8 longlong:0(0) 0 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -721,7 +721,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 4 enumTypedef:3(3) 1 c \"\"\n" +
" 8 charTypedef:7(0) 1 d \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -737,7 +737,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 6 enumTypedef:3(1) 1 c \"\"\n" +
" 8 charTypedef:3(0) 1 d \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -754,7 +754,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 32 Z2 12 z2 \"\"\n" +
" 48 Z3 8 z3 \"\"\n" +
"}\n" +
"Size = 56 Actual Alignment = 8", struct);
"Length: 56 Alignment: 8", struct);
//@formatter:on
}
@ -771,7 +771,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 32 Z2 12 z2 \"\"\n" +
" 44 Z3 8 z3 \"\"\n" +
"}\n" +
"Size = 52 Actual Alignment = 1", struct);
"Length: 52 Alignment: 1", struct);
//@formatter:on
}
@ -788,7 +788,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 25 Z2p1 9 z2p1 \"\"\n" +
" 34 Z3p1 8 z3p1 \"\"\n" +
"}\n" +
"Size = 42 Actual Alignment = 1", struct);
"Length: 42 Alignment: 1", struct);
//@formatter:on
}
@ -805,7 +805,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 32 Z2 12 z2 \"\"\n" +
" 44 Z3 8 z3 \"\"\n" +
"}\n" +
"Size = 52 Actual Alignment = 2", struct);
"Length: 52 Alignment: 2", struct);
//@formatter:on
}
@ -822,7 +822,7 @@ public class MSVCStructureBitFieldTest extends AbstractCompositeBitFieldTest {
" 28 Z2p2 10 z2p2 \"\"\n" +
" 38 Z3p2 8 z3p2 \"\"\n" +
"}\n" +
"Size = 46 Actual Alignment = 2", struct);
"Length: 46 Alignment: 2", struct);
//@formatter:on
}

View file

@ -43,7 +43,7 @@ public class MSVCUnionBitFieldTest extends AbstractCompositeBitFieldTest {
" 0 int:4(0) 1 a \"\"\n" +
" 0 int:2(0) 1 b \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -58,7 +58,7 @@ public class MSVCUnionBitFieldTest extends AbstractCompositeBitFieldTest {
" 0 longlong:0(0) 0 \"\"\n" +
" 0 int:2(0) 1 b \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 8", struct);
"Length: 8 Alignment: 8", struct);
//@formatter:on
}
@ -72,7 +72,7 @@ public class MSVCUnionBitFieldTest extends AbstractCompositeBitFieldTest {
" 0 int:4(0) 1 a \"\"\n" +
" 0 int:2(0) 1 b \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", struct);
"Length: 4 Alignment: 1", struct);
//@formatter:on
}
@ -87,7 +87,7 @@ public class MSVCUnionBitFieldTest extends AbstractCompositeBitFieldTest {
" 0 longlong:0(0) 0 \"\"\n" +
" 0 int:2(0) 1 b \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 1", struct);
"Length: 8 Alignment: 1", struct);
//@formatter:on
}
@ -101,7 +101,7 @@ public class MSVCUnionBitFieldTest extends AbstractCompositeBitFieldTest {
" 0 int:4(0) 1 a \"\"\n" +
" 0 int:2(0) 1 b \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 2", struct);
"Length: 4 Alignment: 2", struct);
//@formatter:on
}

View file

@ -50,7 +50,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 6 int:8(5) 2 d \"\"\n" +
" 8 int:6(2) 1 e \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -67,7 +67,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 6 int:8(5) 2 d \"\"\n" +
" 8 int:6(2) 1 e \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -84,7 +84,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 8 int:85(0) 4 d \"\"\n" +
" 12 int:6(2) 1 e \"\"\n" +
"}\n" +
"Size = 16 Actual Alignment = 4\n", struct);
"Length: 16 Alignment: 4\n", struct);
//@formatter:on
DataTypeComponent c = struct.getComponent(3);
assertTrue(c.isBitFieldComponent());
@ -106,7 +106,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 1 int:8(2) 2 c \"\"\n" +
" 2 short:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -123,7 +123,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 2 short:4(6) 2 d \"\"\n" +
" 4 long[0] 0 flex \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -139,7 +139,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 1 int:8(2) 2 c \"\"\n" +
" 2 int:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -155,7 +155,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 1 int:8(2) 2 c \"\"\n" +
" 3 char 1 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -173,7 +173,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 4 int:8(2) 2 c \"\"\n" +
" 6 short:4(4) 1 d \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -190,7 +190,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 4 int:0(7) 0 \"\"\n" +
" 4 short:4(4) 1 d \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -207,7 +207,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 2 int:4(6) 2 d \"\"\n" +
" 8 longlong:0(7) 0 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 8", struct);
"Length: 8 Alignment: 8", struct);
//@formatter:on
}
@ -224,7 +224,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 8 longlong:0(7) 0 \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -241,7 +241,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 4 int:8(2) 2 c \"\"\n" +
" 6 char 1 d \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 8", struct);
"Length: 8 Alignment: 8", struct);
//@formatter:on
}
@ -261,7 +261,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 8 int:8(0) 1 f \"\"\n" +
" 9 char 1 g \"\"\n" +
"}\n" +
"Size = 16 Actual Alignment = 8", struct);
"Length: 16 Alignment: 8", struct);
//@formatter:on
}
@ -277,7 +277,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 1 int:8(2) 2 c \"\"\n" +
" 2 short:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", struct);
"Length: 4 Alignment: 1", struct);
//@formatter:on
}
@ -293,7 +293,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 1 int:8(2) 2 c \"\"\n" +
" 2 int:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", struct);
"Length: 4 Alignment: 1", struct);
//@formatter:on
}
@ -309,7 +309,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 1 int:8(2) 2 c \"\"\n" +
" 3 char 1 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", struct);
"Length: 4 Alignment: 1", struct);
//@formatter:on
}
@ -326,7 +326,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 4 int:8(2) 2 c \"\"\n" +
" 5 short:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 7 Actual Alignment = 1", struct);
"Length: 7 Alignment: 1", struct);
//@formatter:on
}
@ -343,7 +343,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 4 int:0(7) 0 \"\"\n" +
" 4 short:4(4) 1 d \"\"\n" +
"}\n" +
"Size = 5 Actual Alignment = 1", struct);
"Length: 5 Alignment: 1", struct);
//@formatter:on
}
@ -360,7 +360,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 2 int:4(6) 2 d \"\"\n" +
" 8 longlong:0(7) 0 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 1", struct);
"Length: 8 Alignment: 1", struct);
//@formatter:on
}
@ -374,7 +374,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 0 char 1 a \"\"\n" +
" 1 Z3p1 8 z3p1 \"\"\n" +
"}\n" +
"Size = 9 Actual Alignment = 1", struct);
"Length: 9 Alignment: 1", struct);
//@formatter:on
}
@ -391,7 +391,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 8 longlong:0(7) 0 \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 9 Actual Alignment = 1", struct);
"Length: 9 Alignment: 1", struct);
//@formatter:on
}
@ -407,7 +407,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 1 int:8(2) 2 c \"\"\n" +
" 2 short:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 2", struct);
"Length: 4 Alignment: 2", struct);
//@formatter:on
}
@ -423,7 +423,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 1 int:8(2) 2 c \"\"\n" +
" 2 int:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 2", struct);
"Length: 4 Alignment: 2", struct);
//@formatter:on
}
@ -439,7 +439,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 1 int:8(2) 2 c \"\"\n" +
" 3 char 1 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 2", struct);
"Length: 4 Alignment: 2", struct);
//@formatter:on
}
@ -456,7 +456,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 4 longlong 8 d \"\"\n" +
" 12 int:4(4) 1 e \"\"\n" +
"}\n" +
"Size = 14 Actual Alignment = 2", struct);
"Length: 14 Alignment: 2", struct);
//@formatter:on
}
@ -473,7 +473,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 4 int:8(2) 2 c \"\"\n" +
" 5 short:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 2", struct);
"Length: 8 Alignment: 2", struct);
//@formatter:on
}
@ -508,7 +508,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 14 short:4(6) 2 _d6 \"\"\n" +
" 15 short:4(2) 1 _d7 \"\"\n" +
"}\n" +
"Size = 16 Actual Alignment = 2", struct);
"Length: 16 Alignment: 2", struct);
//@formatter:on
}
@ -525,7 +525,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 4 int:0(7) 0 \"\"\n" +
" 4 short:4(4) 1 d \"\"\n" +
"}\n" +
"Size = 6 Actual Alignment = 2", struct);
"Length: 6 Alignment: 2", struct);
//@formatter:on
}
@ -542,7 +542,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 2 int:4(6) 2 d \"\"\n" +
" 8 longlong:0(7) 0 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 2", struct);
"Length: 8 Alignment: 2", struct);
//@formatter:on
}
@ -559,7 +559,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 8 longlong:0(7) 0 \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 10 Actual Alignment = 2", struct);
"Length: 10 Alignment: 2", struct);
//@formatter:on
}
@ -576,7 +576,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 8 longlong:0(7) 0 \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 10 Actual Alignment = 2", struct);
"Length: 10 Alignment: 2", struct);
//@formatter:on
}
@ -589,7 +589,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
"Structure x1p2 {\n" +
" 0 char 1 a \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1", struct);
"Length: 1 Alignment: 1", struct);
//@formatter:on
}
@ -603,7 +603,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 0 char 1 a \"\"\n" +
" 1 int:27(5) 4 b \"\"\n" +
"}\n" +
"Size = 6 Actual Alignment = 2", struct);
"Length: 6 Alignment: 2", struct);
//@formatter:on
}
@ -618,7 +618,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 2 short:0(7) 0 \"\"\n" +
" 2 int:27(5) 4 b \"\"\n" +
"}\n" +
"Size = 6 Actual Alignment = 2", struct);
"Length: 6 Alignment: 2", struct);
//@formatter:on
}
@ -633,7 +633,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 1 int:27(5) 4 b \"\"\n" +
" 8 longlong:0(7) 0 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 2", struct);
"Length: 8 Alignment: 2", struct);
//@formatter:on
}
@ -650,7 +650,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 8 longlong:0(7) 0 \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -663,7 +663,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
"Structure x1p4 {\n" +
" 0 char 1 a \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1", struct);
"Length: 1 Alignment: 1", struct);
//@formatter:on
}
@ -677,7 +677,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 0 char 1 a \"\"\n" +
" 1 int:27(5) 4 b \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -692,7 +692,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 2 short:0(7) 0 \"\"\n" +
" 2 int:27(5) 4 b \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -707,7 +707,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 1 int:27(5) 4 b \"\"\n" +
" 8 longlong:0(7) 0 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -723,7 +723,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 1 enumTypedef:3(2) 1 c \"\"\n" +
" 2 charTypedef:7(1) 1 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -739,7 +739,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 3 enumTypedef:3(4) 1 c \"\"\n" +
" 3 charTypedef:3(1) 1 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -756,7 +756,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 16 Z2 8 z2 \"\"\n" +
" 24 Z3 8 z3 \"\"\n" +
"}\n" +
"Size = 32 Actual Alignment = 8", struct);
"Length: 32 Alignment: 8", struct);
//@formatter:on
}
@ -773,7 +773,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 16 Z2 8 z2 \"\"\n" +
" 24 Z3 8 z3 \"\"\n" +
"}\n" +
"Size = 32 Actual Alignment = 1", struct);
"Length: 32 Alignment: 1", struct);
//@formatter:on
}
@ -790,7 +790,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 15 Z2p1 5 z2p1 \"\"\n" +
" 20 Z3p1 8 z3p1 \"\"\n" +
"}\n" +
"Size = 28 Actual Alignment = 1", struct);
"Length: 28 Alignment: 1", struct);
//@formatter:on
}
@ -807,7 +807,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 16 Z2 8 z2 \"\"\n" +
" 24 Z3 8 z3 \"\"\n" +
"}\n" +
"Size = 32 Actual Alignment = 2", struct);
"Length: 32 Alignment: 2", struct);
//@formatter:on
}
@ -824,7 +824,7 @@ public class StructureBigEndianBitFieldTest extends AbstractCompositeBitFieldTes
" 16 Z2p2 6 z2p2 \"\"\n" +
" 22 Z3p2 8 z3p2 \"\"\n" +
"}\n" +
"Size = 30 Actual Alignment = 2", struct);
"Length: 30 Alignment: 2", struct);
//@formatter:on
}

View file

@ -66,7 +66,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
private Pointer createPointer(DataType dataType, int length) {
return new PointerDataType(dataType, length);
}
@Test
public void testEmpty() throws Exception {
Structure s = new StructureDataType("foo", 0);
@ -75,7 +75,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
assertEquals(0, s.getNumComponents());
assertEquals(0, s.getNumDefinedComponents());
}
@Test
public void testSizeOne() throws Exception {
Structure s = new StructureDataType("foo", 1);
@ -422,7 +422,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
assertEquals(DWordDataType.class, comps[3].getDataType().getClass());
}
@Test
public void testInsertWithZeroArrayAtOffset() {
struct.insertAtOffset(2, FloatDataType.dataType, -1);
@ -441,7 +441,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
assertEquals(2, comps[1].getOffset());
assertEquals(2, comps[1].getOrdinal());
assertTrue(zeroArray.isEquivalent(comps[1].getDataType()));
assertEquals(2, comps[2].getOffset());
assertEquals(3, comps[2].getOrdinal());
assertEquals(FloatDataType.class, comps[2].getDataType().getClass());
@ -455,7 +455,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
assertEquals(DWordDataType.class, comps[4].getDataType().getClass());
}
@Test
public void testInsertWithZeroArrayAtOffset2() {
Array zeroArray = new ArrayDataType(FloatDataType.dataType, 0, -1);
@ -474,11 +474,11 @@ public class StructureDataTypeTest extends AbstractGenericTest {
assertEquals(2, comps[1].getOffset());
assertEquals(2, comps[1].getOrdinal());
assertEquals(FloatDataType.class, comps[1].getDataType().getClass());
assertEquals(6, comps[2].getOffset());
assertEquals(3, comps[2].getOrdinal());
assertTrue(zeroArray.isEquivalent(comps[2].getDataType()));
assertEquals(6, comps[3].getOffset());
assertEquals(4, comps[3].getOrdinal());
assertEquals(WordDataType.class, comps[3].getDataType().getClass());
@ -494,7 +494,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
struct.insertAtOffset(100, new FloatDataType(), 4);
assertEquals(104, struct.getLength());
}
@Test
public void testSetFlexArray() throws Exception {
@ -514,7 +514,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 4 byte 1 field4 \"Comment4\"\n" +
" 5 char[0] 0 flex \"FlexComment\"\n" +
"}\n" +
"Size = 6 Actual Alignment = 2", struct);
"Length: 6 Alignment: 2", struct);
//@formatter:on
struct.replace(flexDtc.getOrdinal(), new ArrayDataType(IntegerDataType.dataType, 0, -1), 0,
@ -529,7 +529,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 4 byte 1 field4 \"Comment4\"\n" +
" 8 int[0] 0 flex \"FlexComment\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -555,7 +555,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 6 word 2 \"Comment2\"\n" +
" 8 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
struct.insertBitField(2, 0, 0, IntegerDataType.dataType, 0, "z2", "zero bitfield 2");
@ -572,7 +572,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 6 word 2 \"Comment2\"\n" +
" 8 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -594,7 +594,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
// " 10 undefined 1 \"\"\n" +
// " 11 undefined 1 \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 1", struct);
"Length: 12 Alignment: 1", struct);
//@formatter:on
struct.insertBitField(4, 4, 3, IntegerDataType.dataType, 3, "bf2", "bf2Comment");
@ -613,7 +613,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
// " 10 undefined 1 \"\"\n" +
// " 11 undefined 1 \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 1", struct);
"Length: 12 Alignment: 1", struct);
//@formatter:on
}
@ -637,7 +637,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
// " 12 undefined 1 \"\"\n" +
// " 13 undefined 1 \"\"\n" +
"}\n" +
"Size = 14 Actual Alignment = 1", struct);
"Length: 14 Alignment: 1", struct);
//@formatter:on
struct.insertBitFieldAt(10, 4, 3, IntegerDataType.dataType, 3, "bf2", "bf2Comment");
@ -658,7 +658,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
// " 12 undefined 1 \"\"\n" +
// " 13 undefined 1 \"\"\n" +
"}\n" +
"Size = 14 Actual Alignment = 1", struct);
"Length: 14 Alignment: 1", struct);
//@formatter:on
}
@ -681,7 +681,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.insertBitFieldAt(2, 4, 3, IntegerDataType.dataType, 3, "bf2", "bf2Comment");
@ -701,7 +701,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.insertBitFieldAt(2, 4, 6, IntegerDataType.dataType, 15, "bf3", "bf3Comment");
@ -720,7 +720,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
try {
@ -748,7 +748,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
}
@ -782,7 +782,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.insertBitFieldAt(2, 4, 26, IntegerDataType.dataType, 3, "bf2", "bf2Comment");
@ -802,7 +802,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.insertBitFieldAt(2, 4, 11, IntegerDataType.dataType, 15, "bf3", "bf3Comment");
@ -821,7 +821,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.insertBitFieldAt(2, 4, 0, IntegerDataType.dataType, 11, "bf4", "bf4Comment");
@ -840,7 +840,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
}
@ -869,7 +869,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 12 dword 4 field3 \"\"\n" +
" 16 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 17 Actual Alignment = 1", struct);
"Length: 17 Alignment: 1", struct);
//@formatter:on
}
@ -1092,7 +1092,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.delete(Sets.newHashSet(1, 2, 3, 4, 5, 6));
@ -1109,7 +1109,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 5 dword 4 field3 \"\"\n" +
" 9 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 10 Actual Alignment = 1", struct);
"Length: 10 Alignment: 1", struct);
//@formatter:on
assertEquals(10, struct.getLength());
@ -1152,7 +1152,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.delete(6);
@ -1170,7 +1170,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 6 dword 4 field3 \"\"\n" +
" 10 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 11 Actual Alignment = 1", struct);
"Length: 11 Alignment: 1", struct);
//@formatter:on
struct.delete(3);
@ -1187,7 +1187,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 6 dword 4 field3 \"\"\n" +
" 10 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 11 Actual Alignment = 1", struct);
"Length: 11 Alignment: 1", struct);
//@formatter:on
struct.delete(3);
@ -1204,7 +1204,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 6 dword 4 field3 \"\"\n" +
" 10 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 11 Actual Alignment = 1", struct);
"Length: 11 Alignment: 1", struct);
//@formatter:on
struct.delete(4);
@ -1222,7 +1222,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 6 dword 4 field3 \"\"\n" +
" 10 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 11 Actual Alignment = 1", struct);
"Length: 11 Alignment: 1", struct);
//@formatter:on
struct.delete(2);
@ -1240,7 +1240,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 6 dword 4 field3 \"\"\n" +
" 10 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 11 Actual Alignment = 1", struct);
"Length: 11 Alignment: 1", struct);
//@formatter:on
struct.delete(2);
@ -1257,7 +1257,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
" 5 dword 4 field3 \"\"\n" +
" 9 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 10 Actual Alignment = 1", struct);
"Length: 10 Alignment: 1", struct);
//@formatter:on
assertEquals(10, struct.getLength());
@ -1317,17 +1317,17 @@ public class StructureDataTypeTest extends AbstractGenericTest {
assertEquals(DWordDataType.class, comps[1].getDataType().getClass());
assertEquals(1, comps[1].getOffset());
}
@Test
public void testDeleteAtOffset2() {
assertEquals(8, struct.getLength());
Array zeroArray = new ArrayDataType(CharDataType.dataType, 0, -1);
struct.insertAtOffset(1, zeroArray, -1);
assertEquals(8, struct.getLength());
DataTypeComponent[] comps = struct.getDefinedComponents();
assertEquals(5, comps.length);
@ -1338,17 +1338,17 @@ public class StructureDataTypeTest extends AbstractGenericTest {
assertEquals(1, comps[1].getOffset());
assertEquals(1, comps[1].getOrdinal());
assertTrue(zeroArray.isEquivalent(comps[1].getDataType()));
assertEquals(1, comps[2].getOffset());
assertEquals(2, comps[2].getOrdinal());
assertEquals(WordDataType.class, comps[2].getDataType().getClass());
struct.deleteAtOffset(1);
assertEquals(6, struct.getLength());
assertEquals(3, struct.getNumComponents());
comps = struct.getDefinedComponents();
assertEquals(DWordDataType.class, comps[1].getDataType().getClass());
assertEquals(1, comps[1].getOffset());
}
@ -1487,7 +1487,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
* 3 dword 4 field3 ""
* 7 byte 1 field4 "Comment4"
* }
* Size = 8 Actual Alignment = 1
* Length: 8 Alignment: 1
*/
DataTypeComponent dtc = struct.getComponentAt(3);
@ -1519,7 +1519,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
* 8 long 4 field4 ""
* 12 long[0] 0 zarray2 ""
* }
* Size = 12 Actual Alignment = 1
* Length: 12 Alignment: 1
*/
dtc = struct.getComponentAt(8);
@ -1546,7 +1546,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
* 12 long 4 field4 ""
* 16 long[0] 0 zarray2 ""
* }
* Size = 16 Actual Alignment = 1
* Length: 16 Alignment: 1
*/
assertEquals(16, struct.getLength());
@ -1589,7 +1589,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
* 8 long 4 field4 ""
* 12 long[0] 0 zarray2 ""
* }
* Size = 12 Actual Alignment = 1
* Length: 12 Alignment: 1
*/
dtc = struct.getComponentContaining(8);
@ -1616,7 +1616,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
* 12 long 4 field4 ""
* 16 long[0] 0 zarray2 ""
* }
* Size = 16 Actual Alignment = 1
* Length: 16 Alignment: 1
*/
assertEquals(16, struct.getLength());
@ -1658,7 +1658,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
* 12 long 4 field4 ""
* 16 long[0] 0 zarray2 ""
* }
* Size = 16 Actual Alignment = 1
* Length: 16 Alignment: 1
*/
// DatatypeComponent.toString: <ordinal> <offset> <dtname> <length> <fieldname> <comment>
@ -1691,9 +1691,9 @@ public class StructureDataTypeTest extends AbstractGenericTest {
@Test
public void testReplaceAtVarLengthDataTypes() {
// TODO: these tests are too simple since they only replace undefined components
Structure s1 = new StructureDataType("Test1", 25);
s1.replaceAtOffset(0, new StringDataType(), 5, null, null);
@ -1709,7 +1709,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
@Test
public void testReplaceAtVarLengthDataTypes2() {
// TODO: these tests are too simple since they only replace undefined components
Structure s1 = new StructureDataType("Test1", 0x60);
@ -1733,22 +1733,22 @@ public class StructureDataTypeTest extends AbstractGenericTest {
assertEquals("string", dt.getDisplayName());
assertEquals(0xd, dtc.getLength());
}
@Test
public void testReplaceAtPacked() {
struct.setPackingEnabled(true); // test case where there is no component
assertEquals(12, struct.getLength());
assertEquals(4, struct.getNumDefinedComponents());
struct.replaceAtOffset(0, DataType.DEFAULT, -1, "a", null);
struct.replaceAtOffset(1, ByteDataType.dataType, -1, "b", null);
struct.replaceAtOffset(2, ByteDataType.dataType, -1, "c", null);
assertEquals(12, struct.getLength());
assertEquals(5, struct.getNumDefinedComponents());
DataTypeComponent[] comps = struct.getDefinedComponents();
assertEquals(0, comps[0].getOffset());
@ -1758,21 +1758,21 @@ public class StructureDataTypeTest extends AbstractGenericTest {
assertEquals(1, comps[1].getOffset());
assertEquals(1, comps[1].getOrdinal());
assertTrue(ByteDataType.dataType.isEquivalent(comps[1].getDataType()));
assertEquals(2, comps[2].getOffset());
assertEquals(2, comps[2].getOrdinal());
assertTrue(ByteDataType.dataType.isEquivalent(comps[2].getDataType()));
assertEquals(4, comps[3].getOffset());
assertEquals(3, comps[3].getOrdinal());
assertTrue(DWordDataType.dataType.isEquivalent(comps[3].getDataType()));
assertEquals(8, comps[4].getOffset());
assertEquals(4, comps[4].getOrdinal());
assertTrue(ByteDataType.dataType.isEquivalent(comps[4].getDataType()));
}
@Test
public void testReplaceAt() {
@ -1813,10 +1813,10 @@ public class StructureDataTypeTest extends AbstractGenericTest {
struct.insertAtOffset(3, zeroArray, -1);
assertEquals(8, struct.getLength());
assertEquals(5, struct.getNumDefinedComponents());
// replace dword with short
struct.replaceAtOffset(3, ShortDataType.dataType, -1, "b", null);
assertEquals(8, struct.getLength());
assertEquals(5, struct.getNumDefinedComponents());
@ -1963,7 +1963,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
// " 11 undefined 1 \"\"\n" +
" 12 Foo[0] 0 myFlex \"flexComment\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 1", struct);
"Length: 12 Alignment: 1", struct);
//@formatter:on
DataTypeManager beDtm = createBigEndianDataTypeManager();
@ -1988,7 +1988,7 @@ public class StructureDataTypeTest extends AbstractGenericTest {
// " 11 undefined 1 \"\"\n" +
" 12 Foo[0] 0 myFlex \"flexComment\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 1", newStruct);
"Length: 12 Alignment: 1", newStruct);
//@formatter:on
}

View file

@ -81,7 +81,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 6 int:8(3) 2 d \"\"\n" +
" 8 int:6(0) 1 e \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -98,7 +98,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 6 int:8(3) 2 d \"\"\n" +
" 8 int:6(0) 1 e \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -115,7 +115,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 8 int:85(0) 4 d \"\"\n" +
" 12 int:6(0) 1 e \"\"\n" +
"}\n" +
"Size = 16 Actual Alignment = 4\n", struct);
"Length: 16 Alignment: 4\n", struct);
//@formatter:on
DataTypeComponent c = struct.getComponent(3);
assertTrue(c.isBitFieldComponent());
@ -137,7 +137,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 1 int:8(6) 2 c \"\"\n" +
" 2 short:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -154,7 +154,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 2 short:4(6) 2 d \"\"\n" +
" 8 long[0] 0 flex \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 8", struct);
"Length: 8 Alignment: 8", struct);
//@formatter:on
}
@ -170,7 +170,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 1 int:8(6) 2 c \"\"\n" +
" 2 int:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -186,7 +186,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 1 int:8(6) 2 c \"\"\n" +
" 3 char 1 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -204,7 +204,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 4 int:8(6) 2 c \"\"\n" +
" 6 short:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -221,7 +221,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 4 int:0(0) 0 \"\"\n" +
" 4 short:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -238,7 +238,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 2 int:4(6) 2 d \"\"\n" +
" 8 longlong:0(0) 0 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 8", struct);
"Length: 8 Alignment: 8", struct);
//@formatter:on
}
@ -255,7 +255,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 8 longlong:0(0) 0 \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -272,7 +272,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 4 int:8(6) 2 c \"\"\n" +
" 6 char 1 d \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 8", struct);
"Length: 8 Alignment: 8", struct);
//@formatter:on
}
@ -292,7 +292,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 8 int:8(0) 1 f \"\"\n" +
" 9 char 1 g \"\"\n" +
"}\n" +
"Size = 16 Actual Alignment = 8", struct);
"Length: 16 Alignment: 8", struct);
//@formatter:on
}
@ -308,7 +308,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 1 int:8(6) 2 c \"\"\n" +
" 2 short:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", struct);
"Length: 4 Alignment: 1", struct);
//@formatter:on
}
@ -324,7 +324,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 1 int:8(6) 2 c \"\"\n" +
" 2 int:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", struct);
"Length: 4 Alignment: 1", struct);
//@formatter:on
}
@ -340,7 +340,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 1 int:8(6) 2 c \"\"\n" +
" 3 char 1 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", struct);
"Length: 4 Alignment: 1", struct);
//@formatter:on
}
@ -357,7 +357,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 4 int:8(6) 2 c \"\"\n" +
" 5 short:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 7 Actual Alignment = 1", struct);
"Length: 7 Alignment: 1", struct);
//@formatter:on
}
@ -374,7 +374,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 4 int:0(0) 0 \"\"\n" +
" 4 short:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 5 Actual Alignment = 1", struct);
"Length: 5 Alignment: 1", struct);
//@formatter:on
}
@ -391,7 +391,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 2 int:4(6) 2 d \"\"\n" +
" 8 longlong:0(0) 0 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 1", struct);
"Length: 8 Alignment: 1", struct);
//@formatter:on
}
@ -405,7 +405,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 0 char 1 a \"\"\n" +
" 1 Z3p1 8 z3p1 \"\"\n" +
"}\n" +
"Size = 9 Actual Alignment = 1", struct);
"Length: 9 Alignment: 1", struct);
//@formatter:on
}
@ -422,7 +422,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 8 longlong:0(0) 0 \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 9 Actual Alignment = 1", struct);
"Length: 9 Alignment: 1", struct);
//@formatter:on
}
@ -438,7 +438,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 1 int:8(6) 2 c \"\"\n" +
" 2 short:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 2", struct);
"Length: 4 Alignment: 2", struct);
//@formatter:on
}
@ -454,7 +454,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 1 int:8(6) 2 c \"\"\n" +
" 2 int:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 2", struct);
"Length: 4 Alignment: 2", struct);
//@formatter:on
}
@ -470,7 +470,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 1 int:8(6) 2 c \"\"\n" +
" 3 char 1 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 2", struct);
"Length: 4 Alignment: 2", struct);
//@formatter:on
}
@ -487,7 +487,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 4 longlong 8 d \"\"\n" +
" 12 int:4(0) 1 e \"\"\n" +
"}\n" +
"Size = 14 Actual Alignment = 2", struct);
"Length: 14 Alignment: 2", struct);
//@formatter:on
}
@ -504,7 +504,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 4 int:8(6) 2 c \"\"\n" +
" 5 short:4(6) 2 d \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 2", struct);
"Length: 8 Alignment: 2", struct);
//@formatter:on
}
@ -539,7 +539,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 14 short:4(6) 2 _d6 \"\"\n" +
" 15 short:4(2) 1 _d7 \"\"\n" +
"}\n" +
"Size = 16 Actual Alignment = 2", struct);
"Length: 16 Alignment: 2", struct);
//@formatter:on
}
@ -556,7 +556,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 4 int:0(0) 0 \"\"\n" +
" 4 short:4(0) 1 d \"\"\n" +
"}\n" +
"Size = 6 Actual Alignment = 2", struct);
"Length: 6 Alignment: 2", struct);
//@formatter:on
}
@ -573,7 +573,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 2 int:4(6) 2 d \"\"\n" +
" 8 longlong:0(0) 0 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 2", struct);
"Length: 8 Alignment: 2", struct);
//@formatter:on
}
@ -590,7 +590,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 8 longlong:0(0) 0 \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 10 Actual Alignment = 2", struct);
"Length: 10 Alignment: 2", struct);
//@formatter:on
}
@ -607,7 +607,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 8 longlong:0(0) 0 \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 10 Actual Alignment = 2", struct);
"Length: 10 Alignment: 2", struct);
//@formatter:on
}
@ -620,7 +620,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
"Structure x1p2 {\n" +
" 0 char 1 a \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1", struct);
"Length: 1 Alignment: 1", struct);
//@formatter:on
}
@ -634,7 +634,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 0 char 1 a \"\"\n" +
" 1 int:27(0) 4 b \"\"\n" +
"}\n" +
"Size = 6 Actual Alignment = 2", struct);
"Length: 6 Alignment: 2", struct);
//@formatter:on
}
@ -649,7 +649,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 2 short:0(0) 0 \"\"\n" +
" 2 int:27(0) 4 b \"\"\n" +
"}\n" +
"Size = 6 Actual Alignment = 2", struct);
"Length: 6 Alignment: 2", struct);
//@formatter:on
}
@ -664,7 +664,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 1 int:27(0) 4 b \"\"\n" +
" 8 longlong:0(0) 0 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 2", struct);
"Length: 8 Alignment: 2", struct);
//@formatter:on
}
@ -681,7 +681,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 8 longlong:0(0) 0 \"\"\n" +
" 8 char 1 d \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -694,7 +694,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
"Structure x1p4 {\n" +
" 0 char 1 a \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1", struct);
"Length: 1 Alignment: 1", struct);
//@formatter:on
}
@ -708,7 +708,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 0 char 1 a \"\"\n" +
" 1 int:27(0) 4 b \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -723,7 +723,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 2 short:0(0) 0 \"\"\n" +
" 2 int:27(0) 4 b \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -738,7 +738,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 1 int:27(0) 4 b \"\"\n" +
" 8 longlong:0(0) 0 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -754,7 +754,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 1 enumTypedef:3(3) 1 c \"\"\n" +
" 2 charTypedef:7(0) 1 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -770,7 +770,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 3 enumTypedef:3(1) 1 c \"\"\n" +
" 3 charTypedef:3(4) 1 d \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -787,7 +787,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 16 Z2 8 z2 \"\"\n" +
" 24 Z3 8 z3 \"\"\n" +
"}\n" +
"Size = 32 Actual Alignment = 8", struct);
"Length: 32 Alignment: 8", struct);
//@formatter:on
}
@ -804,7 +804,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 16 Z2 8 z2 \"\"\n" +
" 24 Z3 8 z3 \"\"\n" +
"}\n" +
"Size = 32 Actual Alignment = 1", struct);
"Length: 32 Alignment: 1", struct);
//@formatter:on
}
@ -821,7 +821,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 15 Z2p1 5 z2p1 \"\"\n" +
" 20 Z3p1 8 z3p1 \"\"\n" +
"}\n" +
"Size = 28 Actual Alignment = 1", struct);
"Length: 28 Alignment: 1", struct);
//@formatter:on
}
@ -838,7 +838,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 16 Z2 8 z2 \"\"\n" +
" 24 Z3 8 z3 \"\"\n" +
"}\n" +
"Size = 32 Actual Alignment = 2", struct);
"Length: 32 Alignment: 2", struct);
//@formatter:on
}
@ -855,7 +855,7 @@ public class StructureLittleEndianBitFieldTest extends AbstractCompositeBitField
" 16 Z2p2 6 z2p2 \"\"\n" +
" 22 Z3p2 8 z3p2 \"\"\n" +
"}\n" +
"Size = 30 Actual Alignment = 2", struct);
"Length: 30 Alignment: 2", struct);
//@formatter:on
}

View file

@ -45,7 +45,7 @@ public class UnionBigEndianBitFieldTest extends AbstractCompositeBitFieldTest {
" 0 int:4(4) 1 a \"\"\n" +
" 0 int:2(6) 1 b \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -60,7 +60,7 @@ public class UnionBigEndianBitFieldTest extends AbstractCompositeBitFieldTest {
" 0 longlong:0(7) 0 \"\"\n" + // has no impact
" 0 int:2(6) 1 b \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -74,7 +74,7 @@ public class UnionBigEndianBitFieldTest extends AbstractCompositeBitFieldTest {
" 0 int:4(4) 1 a \"\"\n" +
" 0 int:2(6) 1 b \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1", struct);
"Length: 1 Alignment: 1", struct);
//@formatter:on
}
@ -89,7 +89,7 @@ public class UnionBigEndianBitFieldTest extends AbstractCompositeBitFieldTest {
" 0 longlong:0(7) 0 \"\"\n" + // has no impact
" 0 int:2(6) 1 b \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1", struct);
"Length: 1 Alignment: 1", struct);
//@formatter:on
}
@ -103,7 +103,7 @@ public class UnionBigEndianBitFieldTest extends AbstractCompositeBitFieldTest {
" 0 int:4(4) 1 a \"\"\n" +
" 0 int:2(6) 1 b \"\"\n" +
"}\n" +
"Size = 2 Actual Alignment = 2", struct);
"Length: 2 Alignment: 2", struct);
//@formatter:on
}
}

View file

@ -155,7 +155,7 @@ public class UnionDataTypeTest extends AbstractGenericTest {
" 0 short 2 \"\"\n" +
" 0 int:2(0) 1 bf1 \"bf1Comment\"\n" +
"}\n" +
"Size = 2 Actual Alignment = 1", union);
"Length: 2 Alignment: 1", union);
//@formatter:on
}
@ -177,7 +177,7 @@ public class UnionDataTypeTest extends AbstractGenericTest {
" 0 short 2 \"\"\n" +
" 0 int:2(0) 1 bf1 \"bf1Comment\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", union);
"Length: 4 Alignment: 4", union);
//@formatter:on
}
@ -198,7 +198,7 @@ public class UnionDataTypeTest extends AbstractGenericTest {
" 0 dword 4 field3 \"\"\n" +
" 0 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", union);
"Length: 4 Alignment: 1", union);
//@formatter:on
}
@ -221,7 +221,7 @@ public class UnionDataTypeTest extends AbstractGenericTest {
" 0 dword 4 field3 \"\"\n" +
" 0 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", union);
"Length: 4 Alignment: 1", union);
//@formatter:on
}
@ -232,7 +232,7 @@ public class UnionDataTypeTest extends AbstractGenericTest {
@Test
public void testCloneRetainIdentity() throws Exception {
Union unionCopy = (Union) union.clone(null);
Union unionCopy = union.clone(null);
assertNull(unionCopy.getDataTypeManager());
assertEquals(4, union.getLength());
}
@ -277,7 +277,7 @@ public class UnionDataTypeTest extends AbstractGenericTest {
" 0 byte 1 field4 \"Comment4\"\n" +
" 0 struct_1 11 \"\"\n" +
"}\n" +
"Size = 11 Actual Alignment = 1", union);
"Length: 11 Alignment: 1", union);
//@formatter:on
union.delete(Sets.newHashSet(2, 4));
@ -291,7 +291,7 @@ public class UnionDataTypeTest extends AbstractGenericTest {
" 0 word 2 \"Comment2\"\n" +
" 0 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 2 Actual Alignment = 1", union);
"Length: 2 Alignment: 1", union);
//@formatter:on
}

View file

@ -45,7 +45,7 @@ public class UnionLittleEndianBitFieldTest extends AbstractCompositeBitFieldTest
" 0 int:4(0) 1 a \"\"\n" +
" 0 int:2(0) 1 b \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -60,7 +60,7 @@ public class UnionLittleEndianBitFieldTest extends AbstractCompositeBitFieldTest
" 0 longlong:0(0) 0 \"\"\n" + // has no impact
" 0 int:2(0) 1 b \"\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", struct);
"Length: 4 Alignment: 4", struct);
//@formatter:on
}
@ -74,7 +74,7 @@ public class UnionLittleEndianBitFieldTest extends AbstractCompositeBitFieldTest
" 0 int:4(0) 1 a \"\"\n" +
" 0 int:2(0) 1 b \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1", struct);
"Length: 1 Alignment: 1", struct);
//@formatter:on
}
@ -89,7 +89,7 @@ public class UnionLittleEndianBitFieldTest extends AbstractCompositeBitFieldTest
" 0 longlong:0(0) 0 \"\"\n" + // has no impact
" 0 int:2(0) 1 b \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1", struct);
"Length: 1 Alignment: 1", struct);
//@formatter:on
}
@ -103,7 +103,7 @@ public class UnionLittleEndianBitFieldTest extends AbstractCompositeBitFieldTest
" 0 int:4(0) 1 a \"\"\n" +
" 0 int:2(0) 1 b \"\"\n" +
"}\n" +
"Size = 2 Actual Alignment = 2", struct);
"Length: 2 Alignment: 2", struct);
//@formatter:on
}
}

View file

@ -133,7 +133,7 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 4 uint:4(0) 1 e \"\"\n" +
" 8 ushort 2 f \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -171,7 +171,7 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 4 uint:4(0) 1 e \"\"\n" +
" 8 ushort 2 f \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct, true);
"Length: 12 Alignment: 4", struct, true);
//@formatter:on
}
@ -226,14 +226,14 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
"Structure struct {\n" +
" 0 struct_u_0 1 \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1\n" +
"Length: 1 Alignment: 1\n" +
"/struct/struct_u_0\n" +
"pack()\n" +
"Union struct_u_0 {\n" +
" 0 struct_u_0_s_0 1 _s_0 \"\"\n" +
" 0 struct_u_0_s_1 1 _s_1 \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1\n" +
"Length: 1 Alignment: 1\n" +
"/struct/struct_u_0/struct_u_0_s_0\n" +
"pack()\n" +
"Structure struct_u_0_s_0 {\n" +
@ -243,7 +243,7 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 0 char:1(3) 1 padding \"\"\n" +
" 0 char:1(4) 1 a4 \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1\n" +
"Length: 1 Alignment: 1\n" +
"/struct/struct_u_0/struct_u_0_s_1\n" +
"pack()\n" +
"Structure struct_u_0_s_1 {\n" +
@ -254,7 +254,7 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 0 char:1(4) 1 padding \"\"\n" +
" 0 char:1(5) 1 a5 \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1", struct, true);
"Length: 1 Alignment: 1", struct, true);
//@formatter:on
}
@ -292,21 +292,21 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 0 union_s_2 1 _s_2 \"\"\n" +
" 0 ushort 2 f \"\"\n" +
"}\n" +
"Size = 2 Actual Alignment = 2\n" +
"Length: 2 Alignment: 2\n" +
"/union/union_s_1\n" +
"pack()\n" +
"Structure union_s_1 {\n" +
" 0 uchar:4(0) 1 b \"\"\n" +
" 0 uchar:4(4) 1 c \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1\n" +
"Length: 1 Alignment: 1\n" +
"/union/union_s_2\n" +
"pack()\n" +
"Structure union_s_2 {\n" +
" 0 uchar:4(0) 1 d \"\"\n" +
" 0 uchar:4(4) 1 e \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1", union, true);
"Length: 1 Alignment: 1", union, true);
//@formatter:on
}
@ -333,7 +333,7 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 0 char 1 a \"\"\n" +
" 1 char[0] 0 e \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1", struct, true);
"Length: 1 Alignment: 1", struct, true);
//@formatter:on
}
@ -364,7 +364,7 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 0 union_s_0 12 _s_0 \"\"\n" +
" 0 union_s_1 8 _s_1 \"\"\n" +
"}\n" +
"Size = 16 Actual Alignment = 8\n" +
"Length: 16 Alignment: 8\n" +
"/union/union_s_0\n" +
"pack()\n" +
"Structure union_s_0 {\n" +
@ -373,14 +373,14 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 8 int 4 c \"\"\n" +
" 12 char[0] 0 d \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4\n" +
"Length: 12 Alignment: 4\n" +
"/union/union_s_1\n" +
"pack()\n" +
"Structure union_s_1 {\n" +
" 0 longlong 8 e \"\"\n" +
" 8 char[0] 0 f \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 8\n", struct, true);
"Length: 8 Alignment: 8\n", struct, true);
//@formatter:on
}
@ -410,7 +410,7 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 0 union_s_0 12 _s_0 \"\"\n" +
" 0 union_s_1 0 _s_1 \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4\n" +
"Length: 12 Alignment: 4\n" +
"/union/union_s_0\n" +
"pack()\n" +
"Structure union_s_0 {\n" +
@ -419,13 +419,13 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 8 int 4 c \"\"\n" +
" 12 char[0] 0 d \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4\n" +
"Length: 12 Alignment: 4\n" +
"/union/union_s_1\n" +
"pack()\n" +
"Structure union_s_1 {\n" +
" 0 char[0] 0 f \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1\n", struct, true);
"Length: 0 Alignment: 1\n", struct, true);
//@formatter:on
}
@ -454,21 +454,21 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 0 union_s_0 1 _s_0 \"\"\n" +
" 0 union_s_1 2 _s_1 \"\"\n" +
"}\n" +
"Size = 2 Actual Alignment = 1\n" +
"Length: 2 Alignment: 1\n" +
"/union/union_s_0\n" +
"pack()\n" +
"Structure union_s_0 {\n" +
" 0 char 1 a \"\"\n" +
" 1 char[0] 0 flex \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1\n" +
"Length: 1 Alignment: 1\n" +
"/union/union_s_1\n" +
"pack()\n" +
"Structure union_s_1 {\n" +
" 0 char 1 b \"\"\n" +
" 1 char 1 c \"\"\n" +
"}\n" +
"Size = 2 Actual Alignment = 1", struct, true);
"Length: 2 Alignment: 1", struct, true);
//@formatter:on
}
@ -511,14 +511,14 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 0 struct_u_0 1 \"\"\n" +
" 8 struct_u_8 8 \"\"\n" +
"}\n" +
"Size = 16 Actual Alignment = 8\n" +
"Length: 16 Alignment: 8\n" +
"/struct/struct_u_0\n" +
"pack()\n" +
"Union struct_u_0 {\n" +
" 0 struct_u_0_s_0 1 _s_0 \"\"\n" +
" 0 struct_u_0_s_1 1 _s_1 \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1\n" +
"Length: 1 Alignment: 1\n" +
"/struct/struct_u_0/struct_u_0_s_0\n" +
"pack()\n" +
"Structure struct_u_0_s_0 {\n" +
@ -531,7 +531,7 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 0 char:1(6) 1 s6 \"\"\n" +
" 0 char:1(7) 1 s7 \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1\n" +
"Length: 1 Alignment: 1\n" +
"/struct/struct_u_0/struct_u_0_s_1\n" +
"pack()\n" +
"Structure struct_u_0_s_1 {\n" +
@ -544,14 +544,14 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 0 uchar:1(6) 1 u6 \"\"\n" +
" 0 uchar:1(7) 1 u7 \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1\n" +
"Length: 1 Alignment: 1\n" +
"/struct/struct_u_8\n" +
"pack()\n" +
"Union struct_u_8 {\n" +
" 0 ulong 4 a \"\"\n" +
" 0 longlong 8 b \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 8\n", struct, true);
"Length: 8 Alignment: 8\n", struct, true);
//@formatter:on
}
@ -596,7 +596,7 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 0 longlong 8 b \"\"\n" +
" 0 union_s_2 2 _s_2 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 1\n" +
"Length: 8 Alignment: 1\n" +
"/union/union_s_2\n" +
"pack()\n" +
"Structure union_s_2 {\n" +
@ -617,7 +617,7 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 1 uchar:1(6) 1 u6 \"\"\n" +
" 1 uchar:1(7) 1 u7 \"\"\n" +
"}\n" +
"Size = 2 Actual Alignment = 1", struct, true);
"Length: 2 Alignment: 1", struct, true);
//@formatter:on
}
@ -708,14 +708,14 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 32 char[10] 10 beef \"\"\n" +
" 44 MoreComplicated_s_u_44 12 \"\"\n" +
"}\n" +
"Size = 56 Actual Alignment = 8\n" +
"Length: 56 Alignment: 8\n" +
"/MoreComplicated_s/MoreComplicated_s_u_0\n" +
"pack()\n" +
"Union MoreComplicated_s_u_0 {\n" +
" 0 MoreComplicated_s_u_0_s_0 1 _s_0 \"\"\n" +
" 0 MoreComplicated_s_u_0_s_1 1 _s_1 \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1\n" +
"Length: 1 Alignment: 1\n" +
"/MoreComplicated_s/MoreComplicated_s_u_0/MoreComplicated_s_u_0_s_0\n" +
"pack()\n" +
"Structure MoreComplicated_s_u_0_s_0 {\n" +
@ -728,7 +728,7 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 0 char:1(6) 1 s6 \"\"\n" +
" 0 char:1(7) 1 s7 \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1\n" +
"Length: 1 Alignment: 1\n" +
"/MoreComplicated_s/MoreComplicated_s_u_0/MoreComplicated_s_u_0_s_1\n" +
"pack()\n" +
"Structure MoreComplicated_s_u_0_s_1 {\n" +
@ -741,35 +741,35 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 0 uchar:1(6) 1 u6 \"\"\n" +
" 0 uchar:1(7) 1 u7 \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1\n" +
"Length: 1 Alignment: 1\n" +
"/MoreComplicated_s/MoreComplicated_s_u_16\n" +
"pack()\n" +
"Union MoreComplicated_s_u_16 {\n" +
" 0 MoreComplicated_s_u_16_s_0 16 _s_0 \"\"\n" +
" 0 MoreComplicated_s_u_16_s_1 16 _s_1 \"\"\n" +
"}\n" +
"Size = 16 Actual Alignment = 8\n" +
"Length: 16 Alignment: 8\n" +
"/MoreComplicated_s/MoreComplicated_s_u_16/MoreComplicated_s_u_16_s_0\n" +
"pack()\n" +
"Structure MoreComplicated_s_u_16_s_0 {\n" +
" 0 double 8 da \"\"\n" +
" 8 char[8] 8 ca \"\"\n" +
"}\n" +
"Size = 16 Actual Alignment = 8\n" +
"Length: 16 Alignment: 8\n" +
"/MoreComplicated_s/MoreComplicated_s_u_16/MoreComplicated_s_u_16_s_1\n" +
"pack()\n" +
"Structure MoreComplicated_s_u_16_s_1 {\n" +
" 0 char[8] 8 cb \"\"\n" +
" 8 double 8 db \"\"\n" +
"}\n" +
"Size = 16 Actual Alignment = 8\n" +
"Length: 16 Alignment: 8\n" +
"/MoreComplicated_s/MoreComplicated_s_u_44\n" +
"pack()\n" +
"Union MoreComplicated_s_u_44 {\n" +
" 0 MoreComplicated_s_u_44_s_0 12 _s_0 \"\"\n" +
" 0 MoreComplicated_s_u_44_s_1 0 _s_1 \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4\n" +
"Length: 12 Alignment: 4\n" +
"/MoreComplicated_s/MoreComplicated_s_u_44/MoreComplicated_s_u_44_s_0\n" +
"pack()\n" +
"Structure MoreComplicated_s_u_44_s_0 {\n" +
@ -778,13 +778,13 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 8 int 4 seqNum \"\"\n" +
" 12 char[0] 0 data \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4\n" +
"Length: 12 Alignment: 4\n" +
"/MoreComplicated_s/MoreComplicated_s_u_44/MoreComplicated_s_u_44_s_1\n" +
"pack()\n" +
"Structure MoreComplicated_s_u_44_s_1 {\n" +
" 0 char[0] 0 buf \"\"\n" +
"}\n" +
"Size = 1 Actual Alignment = 1\n" +
"Length: 0 Alignment: 1\n" +
"/MoreComplicated_s/MoreComplicated_s_u_8\n" +
"pack()\n" +
"Union MoreComplicated_s_u_8 {\n" +
@ -794,7 +794,7 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 0 MoreComplicated_s_u_8_s_3 8 _s_3 \"\"\n" +
" 0 MoreComplicated_s_u_8_s_4 8 _s_4 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 8\n" +
"Length: 8 Alignment: 8\n" +
"/MoreComplicated_s/MoreComplicated_s_u_8/MoreComplicated_s_u_8_s_2\n" +
"pack()\n" +
"Structure MoreComplicated_s_u_8_s_2 {\n" +
@ -815,7 +815,7 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 7 ulong:4(0) 1 n14 \"\"\n" +
" 7 ulong:4(4) 1 n15 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4\n" +
"Length: 8 Alignment: 4\n" +
"/MoreComplicated_s/MoreComplicated_s_u_8/MoreComplicated_s_u_8_s_3\n" +
"pack()\n" +
"Structure MoreComplicated_s_u_8_s_3 {\n" +
@ -830,7 +830,7 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 5 ulong:9(0) 2 x9 \"\"\n" +
" 6 ulong:10(1) 2 x10 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4\n" +
"Length: 8 Alignment: 4\n" +
"/MoreComplicated_s/MoreComplicated_s_u_8/MoreComplicated_s_u_8_s_4\n" +
"pack()\n" +
"Structure MoreComplicated_s_u_8_s_4 {\n" +
@ -844,7 +844,7 @@ public class CompositeMemberTest extends AbstractGhidraHeadlessIntegrationTest
" 5 uchar:8(0) 1 y8 \"\"\n" +
" 6 ushort:9(0) 2 y9 \"\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 2", struct, true);
"Length: 8 Alignment: 2", struct, true);
//@formatter:on
}

View file

@ -168,8 +168,8 @@ public interface CompositeInternal extends Composite {
stringBuffer.append(getTypeName(composite) + " " + composite.getDisplayName() + " {\n");
dumpComponents(composite, stringBuffer, " ");
stringBuffer.append("}\n");
stringBuffer.append("Size = " + composite.getLength() + " Actual Alignment = " +
composite.getAlignment() + "\n");
int length = composite.isZeroLength() ? 0 : composite.getLength();
stringBuffer.append("Length: " + length + " Alignment: " + composite.getAlignment() + "\n");
return stringBuffer.toString();
}
@ -181,11 +181,10 @@ public interface CompositeInternal extends Composite {
*/
private static void dumpComponents(Composite composite, StringBuilder buffer, String pad) {
// limit output of filler components for non-packed structures
DataTypeComponent[] components = composite.getDefinedComponents();
for (DataTypeComponent dtc : components) {
DataType dataType = dtc.getDataType();
// buffer.append(pad + dtc.getOrdinal());
// buffer.append(") ");
buffer.append(pad + dtc.getOffset());
buffer.append(pad + dataType.getName());
if (dataType instanceof BitFieldDataType) {

View file

@ -530,7 +530,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 4 byte 1 field4 \"Comment4\"\n" +
" 5 char[0] 0 flex \"FlexComment\"\n" +
"}\n" +
"Size = 6 Actual Alignment = 2", struct);
"Length: 6 Alignment: 2", struct);
//@formatter:on
struct.replace(flexDtc.getOrdinal(), new ArrayDataType(IntegerDataType.dataType, 0, -1), 0,
@ -545,7 +545,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 4 byte 1 field4 \"Comment4\"\n" +
" 8 int[0] 0 flex \"FlexComment\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
}
@ -571,7 +571,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 6 word 2 \"Comment2\"\n" +
" 8 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
struct.insertBitField(2, 0, 0, IntegerDataType.dataType, 0, "z2", "zero bitfield 2");
@ -588,7 +588,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 6 word 2 \"Comment2\"\n" +
" 8 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -610,7 +610,7 @@ public class StructureDBTest extends AbstractGenericTest {
// " 10 undefined 1 \"\"\n" +
// " 11 undefined 1 \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 1", struct);
"Length: 12 Alignment: 1", struct);
//@formatter:on
struct.insertBitField(4, 4, 3, IntegerDataType.dataType, 3, "bf2", "bf2Comment");
@ -629,7 +629,7 @@ public class StructureDBTest extends AbstractGenericTest {
// " 10 undefined 1 \"\"\n" +
// " 11 undefined 1 \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 1", struct);
"Length: 12 Alignment: 1", struct);
//@formatter:on
struct.insertBitField(6, 1, 0, ByteDataType.dataType, 3, "bf3", "bf3Comment");
@ -648,7 +648,7 @@ public class StructureDBTest extends AbstractGenericTest {
// " 10 undefined 1 \"\"\n" +
// " 11 undefined 1 \"\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 1", struct);
"Length: 12 Alignment: 1", struct);
//@formatter:on
}
@ -672,7 +672,7 @@ public class StructureDBTest extends AbstractGenericTest {
// " 12 undefined 1 \"\"\n" +
// " 13 undefined 1 \"\"\n" +
"}\n" +
"Size = 14 Actual Alignment = 1", struct);
"Length: 14 Alignment: 1", struct);
//@formatter:on
struct.insertBitFieldAt(10, 4, 3, IntegerDataType.dataType, 3, "bf2", "bf2Comment");
@ -693,7 +693,7 @@ public class StructureDBTest extends AbstractGenericTest {
// " 12 undefined 1 \"\"\n" +
// " 13 undefined 1 \"\"\n" +
"}\n" +
"Size = 14 Actual Alignment = 1", struct);
"Length: 14 Alignment: 1", struct);
//@formatter:on
}
@ -716,7 +716,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.insertBitFieldAt(2, 4, 3, IntegerDataType.dataType, 3, "bf2", "bf2Comment");
@ -736,7 +736,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.insertBitFieldAt(2, 4, 6, IntegerDataType.dataType, 15, "bf3", "bf3Comment");
@ -755,7 +755,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
try {
@ -783,7 +783,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.insertBitFieldAt(2, 4, 0, IntegerDataType.dataType, 0, "z", "zero bitfield");
@ -803,7 +803,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
}
@ -837,7 +837,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.insertBitFieldAt(2, 4, 26, IntegerDataType.dataType, 3, "bf2", "bf2Comment");
@ -857,7 +857,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.insertBitFieldAt(2, 4, 11, IntegerDataType.dataType, 15, "bf3", "bf3Comment");
@ -876,7 +876,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.insertBitFieldAt(2, 4, 0, IntegerDataType.dataType, 11, "bf4", "bf4Comment");
@ -895,7 +895,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.insertBitFieldAt(2, 4, 31, IntegerDataType.dataType, 0, "z", "zero bitfield");
@ -915,7 +915,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
}
@ -946,7 +946,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 12 dword 4 field3 \"\"\n" +
" 16 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 17 Actual Alignment = 1", struct);
"Length: 17 Alignment: 1", struct);
//@formatter:on
}
@ -1174,7 +1174,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 9 Foo:3(0) 1 MyBit2 \"bitComment\"\n" +
" 10 Foo:2(0) 1 MyBit3 \"bitComment\"\n" +
"}\n" +
"Size = 11 Actual Alignment = 1", struct);
"Length: 11 Alignment: 1", struct);
//@formatter:on
dataMgr.remove(td, TaskMonitor.DUMMY);
@ -1191,7 +1191,7 @@ public class StructureDBTest extends AbstractGenericTest {
// " 9 undefined 1 \"\"\n" +
// " 10 undefined 1 \"\"\n" +
"}\n" +
"Size = 11 Actual Alignment = 1", struct);
"Length: 11 Alignment: 1", struct);
//@formatter:on
}
@ -1216,7 +1216,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 4 byte 1 field4 \"Comment4\"\n" +
" 8 Foo[0] 0 flex \"FlexComment\"\n" +
"}\n" +
"Size = 8 Actual Alignment = 4", struct);
"Length: 8 Alignment: 4", struct);
//@formatter:on
dataMgr.replaceDataType(td, ByteDataType.dataType, false);
@ -1235,7 +1235,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 4 byte 1 field4 \"Comment4\"\n" +
" 5 byte[0] 0 flex \"FlexComment\"\n" +
"}\n" +
"Size = 6 Actual Alignment = 2", struct);
"Length: 6 Alignment: 2", struct);
//@formatter:on
}
@ -1264,7 +1264,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 9 Foo:3(4) 1 MyBit2 \"bitComment2\"\n" +
" 9 Foo:2(7) 2 MyBit3 \"bitComment3\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
dataMgr.replaceDataType(td, CharDataType.dataType, false);
@ -1281,7 +1281,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 9 char:3(4) 1 MyBit2 \"bitComment2\"\n" +
" 10 char:2(0) 1 MyBit3 \"bitComment3\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 4", struct);
"Length: 12 Alignment: 4", struct);
//@formatter:on
}
@ -1340,7 +1340,7 @@ public class StructureDBTest extends AbstractGenericTest {
// " 11 undefined 1 \"\"\n" +
" 12 Foo[0] 0 myFlex \"flexComment\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 1", struct);
"Length: 12 Alignment: 1", struct);
//@formatter:on
transitionToBigEndian();
@ -1364,7 +1364,7 @@ public class StructureDBTest extends AbstractGenericTest {
// " 11 undefined 1 \"\"\n" +
" 12 Foo[0] 0 myFlex \"flexComment\"\n" +
"}\n" +
"Size = 12 Actual Alignment = 1", newStruct);
"Length: 12 Alignment: 1", newStruct);
//@formatter:on
}
@ -1396,7 +1396,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 0 FOO 10 f1 \"\"\n" +
" 10 byte 1 f2 \"\"\n" +
"}\n" +
"Size = 40 Actual Alignment = 1", barStruct);
"Length: 40 Alignment: 1", barStruct);
//@formatter:on
DataTypeComponent dtc1 = barStruct.getDefinedComponents()[1];
@ -1432,7 +1432,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 0 FOO 5 f1 \"\"\n" +
" 10 byte 1 f2 \"\"\n" +
"}\n" +
"Size = 40 Actual Alignment = 1", barStruct);
"Length: 40 Alignment: 1", barStruct);
//@formatter:on
DataTypeComponent dtc1 = barStruct.getDefinedComponents()[1];
@ -1463,7 +1463,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.delete(Sets.newHashSet(1, 2, 3, 4, 5, 6));
@ -1480,7 +1480,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 5 dword 4 field3 \"\"\n" +
" 9 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 10 Actual Alignment = 1", struct);
"Length: 10 Alignment: 1", struct);
//@formatter:on
assertEquals(10, struct.getLength());
@ -1513,7 +1513,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 8 dword 4 field3 \"\"\n" +
" 12 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 13 Actual Alignment = 1", struct);
"Length: 13 Alignment: 1", struct);
//@formatter:on
struct.delete(6);
@ -1531,7 +1531,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 6 dword 4 field3 \"\"\n" +
" 10 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 11 Actual Alignment = 1", struct);
"Length: 11 Alignment: 1", struct);
//@formatter:on
struct.delete(3);
@ -1548,7 +1548,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 6 dword 4 field3 \"\"\n" +
" 10 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 11 Actual Alignment = 1", struct);
"Length: 11 Alignment: 1", struct);
//@formatter:on
struct.delete(3);
@ -1565,7 +1565,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 6 dword 4 field3 \"\"\n" +
" 10 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 11 Actual Alignment = 1", struct);
"Length: 11 Alignment: 1", struct);
//@formatter:on
struct.delete(4);
@ -1583,7 +1583,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 6 dword 4 field3 \"\"\n" +
" 10 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 11 Actual Alignment = 1", struct);
"Length: 11 Alignment: 1", struct);
//@formatter:on
struct.delete(2);
@ -1601,7 +1601,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 6 dword 4 field3 \"\"\n" +
" 10 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 11 Actual Alignment = 1", struct);
"Length: 11 Alignment: 1", struct);
//@formatter:on
struct.delete(2);
@ -1618,7 +1618,7 @@ public class StructureDBTest extends AbstractGenericTest {
" 5 dword 4 field3 \"\"\n" +
" 9 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 10 Actual Alignment = 1", struct);
"Length: 10 Alignment: 1", struct);
//@formatter:on
assertEquals(10, struct.getLength());
@ -1764,7 +1764,7 @@ public class StructureDBTest extends AbstractGenericTest {
* 3 dword 4 field3 ""
* 7 byte 1 field4 "Comment4"
* }
* Size = 8 Actual Alignment = 1
* Length: 8 Alignment: 1
*/
DataTypeComponent dtc = struct.getComponentAt(3);
@ -1796,7 +1796,7 @@ public class StructureDBTest extends AbstractGenericTest {
* 8 long 4 field4 ""
* 12 long[0] 0 zarray2 ""
* }
* Size = 12 Actual Alignment = 1
* Length: 12 Alignment: 1
*/
dtc = struct.getComponentAt(8);
@ -1823,7 +1823,7 @@ public class StructureDBTest extends AbstractGenericTest {
* 12 long 4 field4 ""
* 16 long[0] 0 zarray2 ""
* }
* Size = 16 Actual Alignment = 1
* Length: 16 Alignment: 1
*/
assertEquals(16, struct.getLength());
@ -1866,7 +1866,7 @@ public class StructureDBTest extends AbstractGenericTest {
* 8 long 4 field4 ""
* 12 long[0] 0 zarray2 ""
* }
* Size = 12 Actual Alignment = 1
* Length: 12 Alignment: 1
*/
dtc = struct.getComponentContaining(8);
@ -1893,7 +1893,7 @@ public class StructureDBTest extends AbstractGenericTest {
* 12 long 4 field4 ""
* 16 long[0] 0 zarray2 ""
* }
* Size = 16 Actual Alignment = 1
* Length: 16 Alignment: 1
*/
assertEquals(16, struct.getLength());
@ -1935,7 +1935,7 @@ public class StructureDBTest extends AbstractGenericTest {
* 12 long 4 field4 ""
* 16 long[0] 0 zarray2 ""
* }
* Size = 16 Actual Alignment = 1
* Length: 16 Alignment: 1
*/
// DatatypeComponent.toString: <ordinal> <offset> <dtname> <length> <fieldname> <comment>

View file

@ -173,7 +173,7 @@ public class UnionDBTest extends AbstractGenericTest {
" 0 short 2 \"\"\n" +
" 0 int:2(0) 1 bf1 \"bf1Comment\"\n" +
"}\n" +
"Size = 2 Actual Alignment = 1", union);
"Length: 2 Alignment: 1", union);
//@formatter:on
}
@ -195,7 +195,7 @@ public class UnionDBTest extends AbstractGenericTest {
" 0 short 2 \"\"\n" +
" 0 int:2(0) 1 bf1 \"bf1Comment\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 4", union);
"Length: 4 Alignment: 4", union);
//@formatter:on
}
@ -216,7 +216,7 @@ public class UnionDBTest extends AbstractGenericTest {
" 0 dword 4 field3 \"\"\n" +
" 0 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", union);
"Length: 4 Alignment: 1", union);
//@formatter:on
}
@ -239,7 +239,7 @@ public class UnionDBTest extends AbstractGenericTest {
" 0 dword 4 field3 \"\"\n" +
" 0 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", union);
"Length: 4 Alignment: 1", union);
//@formatter:on
}
@ -263,7 +263,7 @@ public class UnionDBTest extends AbstractGenericTest {
" 0 dword 4 field3 \"\"\n" +
" 0 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", union);
"Length: 4 Alignment: 1", union);
//@formatter:on
dataMgr.remove(td, TaskMonitor.DUMMY);
@ -277,7 +277,7 @@ public class UnionDBTest extends AbstractGenericTest {
" 0 dword 4 field3 \"\"\n" +
" 0 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", union);
"Length: 4 Alignment: 1", union);
//@formatter:on
}
@ -302,7 +302,7 @@ public class UnionDBTest extends AbstractGenericTest {
" 0 dword 4 field3 \"\"\n" +
" 0 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", union);
"Length: 4 Alignment: 1", union);
//@formatter:on
dataMgr.replaceDataType(td, CharDataType.dataType, false);
@ -318,7 +318,7 @@ public class UnionDBTest extends AbstractGenericTest {
" 0 dword 4 field3 \"\"\n" +
" 0 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", union);
"Length: 4 Alignment: 1", union);
//@formatter:on
}
@ -374,7 +374,7 @@ public class UnionDBTest extends AbstractGenericTest {
" 0 byte 1 field4 \"Comment4\"\n" +
" 0 struct_1 11 \"\"\n" +
"}\n" +
"Size = 11 Actual Alignment = 1", union);
"Length: 11 Alignment: 1", union);
//@formatter:on
union.delete(Sets.newHashSet(2, 4));
@ -388,7 +388,7 @@ public class UnionDBTest extends AbstractGenericTest {
" 0 word 2 \"Comment2\"\n" +
" 0 byte 1 field4 \"Comment4\"\n" +
"}\n" +
"Size = 2 Actual Alignment = 1", union);
"Length: 2 Alignment: 1", union);
//@formatter:on
}
@ -431,7 +431,7 @@ public class UnionDBTest extends AbstractGenericTest {
" 0 int:4(0) 1 MyBit1 \"bitComment1\"\n" +
" 0 int:3(0) 1 MyBit2 \"bitComment2\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", newUnion);
"Length: 4 Alignment: 1", newUnion);
//@formatter:on
union.replaceWith(newUnion);
@ -446,7 +446,7 @@ public class UnionDBTest extends AbstractGenericTest {
" 0 int:4(0) 1 MyBit1 \"bitComment1\"\n" +
" 0 int:3(0) 1 MyBit2 \"bitComment2\"\n" +
"}\n" +
"Size = 4 Actual Alignment = 1", union);
"Length: 4 Alignment: 1", union);
//@formatter:on
assertEquals("testReplaceWith()", union.getDescription());