Skip to content

Commit 647cbfc

Browse files
committed
fix tests
1 parent 1c7cd04 commit 647cbfc

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

codeflash-java-runtime/src/test/java/com/codeflash/ComparatorCorrectnessTest.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ void testAllPlaceholderSkips() throws Exception {
5454
KryoPlaceholder.create(new Object(), "unserializable", "root")
5555
);
5656

57-
insertRow(originalDb, 1, 1, placeholderBytes);
58-
insertRow(candidateDb, 1, 1, placeholderBytes);
57+
insertRow(originalDb, "1", 1, placeholderBytes);
58+
insertRow(candidateDb, "1", 1, placeholderBytes);
5959

6060
String json = Comparator.compareDatabases(originalDb.toString(), candidateDb.toString());
6161
Map<String, Object> result = parseJson(json);
@@ -74,8 +74,8 @@ void testDeserializationErrorSkipped() throws Exception {
7474
// Insert corrupted byte data that will fail Kryo deserialization
7575
byte[] corruptedBytes = new byte[]{0x01, 0x02, 0x03, (byte) 0xFF, (byte) 0xFE};
7676

77-
insertRow(originalDb, 1, 1, corruptedBytes);
78-
insertRow(candidateDb, 1, 1, corruptedBytes);
77+
insertRow(originalDb, "1", 1, corruptedBytes);
78+
insertRow(candidateDb, "1", 1, corruptedBytes);
7979

8080
String json = Comparator.compareDatabases(originalDb.toString(), candidateDb.toString());
8181
Map<String, Object> result = parseJson(json);
@@ -97,12 +97,12 @@ void testMixedRealAndPlaceholder() throws Exception {
9797
KryoPlaceholder.create(new Object(), "unserializable", "root")
9898
);
9999

100-
insertRow(originalDb, 1, 1, realBytes1);
101-
insertRow(candidateDb, 1, 1, realBytes1);
102-
insertRow(originalDb, 2, 1, realBytes2);
103-
insertRow(candidateDb, 2, 1, realBytes2);
104-
insertRow(originalDb, 3, 1, placeholderBytes);
105-
insertRow(candidateDb, 3, 1, placeholderBytes);
100+
insertRow(originalDb, "1", 1, realBytes1);
101+
insertRow(candidateDb, "1", 1, realBytes1);
102+
insertRow(originalDb, "2", 1, realBytes2);
103+
insertRow(candidateDb, "2", 1, realBytes2);
104+
insertRow(originalDb, "3", 1, placeholderBytes);
105+
insertRow(candidateDb, "3", 1, placeholderBytes);
106106

107107
String json = Comparator.compareDatabases(originalDb.toString(), candidateDb.toString());
108108
Map<String, Object> result = parseJson(json);
@@ -121,10 +121,10 @@ void testNormalHappyPath() throws Exception {
121121
byte[] bytes1 = Serializer.serialize(100);
122122
byte[] bytes2 = Serializer.serialize("world");
123123

124-
insertRow(originalDb, 1, 1, bytes1);
125-
insertRow(candidateDb, 1, 1, bytes1);
126-
insertRow(originalDb, 2, 1, bytes2);
127-
insertRow(candidateDb, 2, 1, bytes2);
124+
insertRow(originalDb, "1", 1, bytes1);
125+
insertRow(candidateDb, "1", 1, bytes1);
126+
insertRow(originalDb, "2", 1, bytes2);
127+
insertRow(candidateDb, "2", 1, bytes2);
128128

129129
String json = Comparator.compareDatabases(originalDb.toString(), candidateDb.toString());
130130
Map<String, Object> result = parseJson(json);
@@ -144,8 +144,8 @@ void testNormalMismatch() throws Exception {
144144
byte[] origBytes = Serializer.serialize(42);
145145
byte[] candBytes = Serializer.serialize(99);
146146

147-
insertRow(originalDb, 1, 1, origBytes);
148-
insertRow(candidateDb, 1, 1, candBytes);
147+
insertRow(originalDb, "1", 1, origBytes);
148+
insertRow(candidateDb, "1", 1, candBytes);
149149

150150
String json = Comparator.compareDatabases(originalDb.toString(), candidateDb.toString());
151151
Map<String, Object> result = parseJson(json);
@@ -161,8 +161,8 @@ void testVoidMethodsBothNull() throws Exception {
161161
createTestDb(candidateDb);
162162

163163
// Insert rows with NULL return_value (void methods)
164-
insertRow(originalDb, 1, 1, null);
165-
insertRow(candidateDb, 1, 1, null);
164+
insertRow(originalDb, "1", 1, null);
165+
insertRow(candidateDb, "1", 1, null);
166166

167167
String json = Comparator.compareDatabases(originalDb.toString(), candidateDb.toString());
168168
Map<String, Object> result = parseJson(json);
@@ -178,7 +178,7 @@ void testOneSideEmpty() throws Exception {
178178
createTestDb(candidateDb);
179179

180180
byte[] bytes = Serializer.serialize(42);
181-
insertRow(originalDb, 1, 1, bytes);
181+
insertRow(originalDb, "1", 1, bytes);
182182
// candidateDb has no rows
183183

184184
String json = Comparator.compareDatabases(originalDb.toString(), candidateDb.toString());
@@ -226,7 +226,7 @@ private void createTestDb(Path dbPath) throws Exception {
226226
}
227227
}
228228

229-
private void insertRow(Path dbPath, int iterationId, int loopIndex, byte[] returnValue) throws Exception {
229+
private void insertRow(Path dbPath, String iterationId, int loopIndex, byte[] returnValue) throws Exception {
230230
String url = "jdbc:sqlite:" + dbPath;
231231
try (Connection conn = DriverManager.getConnection(url);
232232
PreparedStatement ps = conn.prepareStatement(

0 commit comments

Comments
 (0)