parent
e598b35a95
commit
8d437bb670
|
@ -159,12 +159,18 @@ public class Field {
|
|||
if (bitOffset != NO_BIT_OFFSET) {
|
||||
int packed = wrapped.getInt();
|
||||
value = (packed >> bitOffset) & 1;
|
||||
} else if (type == INT8 || type == UINT8) {
|
||||
} else if (type == INT8) {
|
||||
value = wrapped.get();
|
||||
} else if (type == UINT8) {
|
||||
byte signed = wrapped.get();
|
||||
value = signed & 0xFF;
|
||||
} else if (type == INT) {
|
||||
value = wrapped.getInt();
|
||||
} else if (type == INT16 || type == UINT16) {
|
||||
} else if (type == INT16) {
|
||||
value = wrapped.getShort();
|
||||
} else if (type == UINT16) {
|
||||
short signed = wrapped.getShort();
|
||||
value = signed & 0xFFFF;
|
||||
} else {
|
||||
value = wrapped.getFloat();
|
||||
}
|
||||
|
|
|
@ -57,8 +57,7 @@ public class TuneReadWriteTest {
|
|||
|
||||
ConfigurationImage binaryDataFromXml = tuneFromFile.asImage(IniFileModel.getInstance());
|
||||
|
||||
// todo: why one byte mismatch? since it's in floats I kind of do not care, floats are weird
|
||||
assertEquals(1, compareImages(originalBinaryData, binaryDataFromXml));
|
||||
assertEquals(0, compareImages(originalBinaryData, binaryDataFromXml));
|
||||
Files.delete(path);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue