parent
e172a36726
commit
78993e7281
Binary file not shown.
|
@ -292,8 +292,7 @@ public class ReaderState {
|
|||
log.debug("Need to align before " + cf.getName());
|
||||
structure.addAlignmentFill(state, getPrimitiveSize);
|
||||
} else {
|
||||
// adding a structure instance - had to be aligned
|
||||
// todo? structure.addAlignmentFill(state);
|
||||
structure.addAlignmentFill(state, 4);
|
||||
}
|
||||
|
||||
if (cf.isIterate()) {
|
||||
|
|
|
@ -510,15 +510,15 @@ public class ConfigFieldParserTest {
|
|||
"\t */\n" +
|
||||
"\tint8_t byte1 = (int8_t)0;\n" +
|
||||
"\t/**\n" +
|
||||
"\t * offset 1\n" +
|
||||
"\t */\n" +
|
||||
"\tstruct_s struct;\n" +
|
||||
"\t/**\n" +
|
||||
"\t * need 4 byte alignment\n" +
|
||||
"\tunits\n" +
|
||||
"\t * offset 5\n" +
|
||||
"\t * offset 1\n" +
|
||||
"\t */\n" +
|
||||
"\tuint8_t alignmentFill_at_5[3];\n" +
|
||||
"\tuint8_t alignmentFill_at_1[3];\n" +
|
||||
"\t/**\n" +
|
||||
"\t * offset 4\n" +
|
||||
"\t */\n" +
|
||||
"\tstruct_s struct;\n" +
|
||||
"};\n" +
|
||||
"static_assert(sizeof(pid_s) == 8);\n" +
|
||||
"\n",
|
||||
|
|
|
@ -37,10 +37,11 @@ public class JavaSensorsConsumerTest {
|
|||
"alignmentFill_at_10(\"need 4 byte alignment\", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 10, 1.0, -20.0, 100.0, \"units\"),\n" +
|
||||
"luaTimingMult(\"luaTimingMult\", SensorCategory.SENSOR_INPUTS, FieldType.INT, 12, 1.0, -1.0, -1.0, \"\"),\n" +
|
||||
"vehicleSpeedKph(\"vehicleSpeedKph\", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 16, 1.0, -1.0, -1.0, \"\"),\n" +
|
||||
"internalMcuTemperature(\"mcu\", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 17, 1.0, 0.0, 0.0, \"deg C\"),\n" +
|
||||
"alignmentFill_at_18(\"need 4 byte alignment\", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 18, 1.0, -20.0, 100.0, \"units\"),\n",
|
||||
"alignmentFill_at_17(\"need 4 byte alignment\", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 17, 1.0, -20.0, 100.0, \"units\"),\n" +
|
||||
"internalMcuTemperature(\"mcu\", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 20, 1.0, 0.0, 0.0, \"deg C\"),\n" +
|
||||
"alignmentFill_at_21(\"need 4 byte alignment\", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 21, 1.0, -20.0, 100.0, \"units\"),\n",
|
||||
javaSensorsConsumer.getContent());
|
||||
assertEquals(20, javaSensorsConsumer.sensorTsPosition);
|
||||
assertEquals(24, javaSensorsConsumer.sensorTsPosition);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue