This commit is contained in:
Peter Lawrey
2019-05-09 09:28:48 +01:00
parent 88ff28087b
commit a165c357d1
@@ -105,26 +105,37 @@ public class ValueAlignmentRelocationTest {
.entries(10);
ChronicleMap<byte[], byte[]> map = persisted ? builder.createPersistedTo(file) : builder.create();
byte[] _austi = "austi".getBytes(ISO_8859_1);
byte[] _12345678 = "12345678".getBytes(ISO_8859_1);
byte[] _h = "h".getBytes(ISO_8859_1);
byte[] _a = "a".getBytes(ISO_8859_1);
String expected = "1234567890123456";
byte[] _1234567890123456 = expected.getBytes(ISO_8859_1);
byte[] _Hello = "Hello".getBytes(ISO_8859_1);
byte[] _world = "world".getBytes(ISO_8859_1);
for (int k = 1; k <= 16; k++) {
for (int i = 1; i < 10; i++) {
for (int j = i + 1; j <= i + 2; j++) {
map.clear();
map.put(_austi, _12345678);
map.put(_h, _a);
byte[] _austi = "abcdefghijklmnopqrstuvwxyz".substring(0, k).getBytes(ISO_8859_1);
byte[] _shorter = "1234567890".substring(0, i).getBytes(ISO_8859_1);
byte[] _h = "h".getBytes(ISO_8859_1);
byte[] _a = "a".getBytes(ISO_8859_1);
String expected = "abcdefghijklmnopqrstuvwxyz".substring(0, j);
byte[] _longer = expected.getBytes(ISO_8859_1);
byte[] _Hello = "Hello".getBytes(ISO_8859_1);
byte[] _world = "world".getBytes(ISO_8859_1);
map.put(_austi, _1234567890123456);
String actual0 = toString(map.get(_austi));
Assert.assertEquals(expected, actual0);
map.put(_austi, _shorter);
map.put(_h, _a);
map.put(_Hello, _world);
String actual = toString(map.get(_austi));
map.put(_austi, _longer);
String actual0 = toString(map.get(_austi));
Assert.assertEquals(expected, actual0);
Assert.assertEquals(expected, actual);
map.put(_Hello, _world);
String actual = toString(map.get(_austi));
if (expected.equals(actual))
Assert.assertEquals(expected, actual);
else
System.out.println("k= " + k + ", i= " + i + ", j=" + j);
}
}
}
}
}