Skip to content

Commit 5f96833

Browse files
authored
Fix SingleDeviceViewOperatorTest row assertion (#17995)
1 parent ae7a5de commit 5f96833

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/SingleDeviceViewOperatorTest.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,14 @@ public void singleDeviceViewOperatorTest() {
171171
Arrays.asList(1, 2),
172172
Arrays.asList(TSDataType.TEXT, TSDataType.INT32, TSDataType.INT32, TSDataType.INT32));
173173
int count = 0;
174-
int total = 0;
175174
while (singleDeviceViewOperator.isBlocked().isDone() && singleDeviceViewOperator.hasNext()) {
176175
TsBlock tsBlock = singleDeviceViewOperator.next();
177176
if (tsBlock == null || tsBlock.isEmpty()) {
178177
continue;
179178
}
180179
assertEquals(4, tsBlock.getValueColumnCount());
181-
total += tsBlock.getPositionCount();
182-
for (int i = 0; i < tsBlock.getPositionCount(); i++) {
183-
long expectedTime = i + 20L * (count % 25);
180+
for (int i = 0; i < tsBlock.getPositionCount(); i++, count++) {
181+
long expectedTime = count;
184182
assertEquals(expectedTime, tsBlock.getTimeByIndex(i));
185183
assertEquals(
186184
SINGLE_DEVICE_MERGE_OPERATOR_TEST_SG + ".device0",
@@ -201,9 +199,8 @@ public void singleDeviceViewOperatorTest() {
201199
assertTrue(tsBlock.getColumn(3).isNull(i));
202200
}
203201
}
204-
count++;
205202
}
206-
assertEquals(500, total);
203+
assertEquals(500, count);
207204
} catch (Exception e) {
208205
e.printStackTrace();
209206
fail();

0 commit comments

Comments
 (0)