Skip to content

Commit 9e38389

Browse files
authored
Fix SingleDeviceViewOperatorTest row assertion (#17995) (#18003)
1 parent f0dc49e commit 9e38389

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
@@ -165,13 +165,11 @@ public void singleDeviceViewOperatorTest() {
165165
Arrays.asList(1, 2),
166166
Arrays.asList(TSDataType.TEXT, TSDataType.INT32, TSDataType.INT32, TSDataType.INT32));
167167
int count = 0;
168-
int total = 0;
169168
while (singleDeviceViewOperator.isBlocked().isDone() && singleDeviceViewOperator.hasNext()) {
170169
TsBlock tsBlock = singleDeviceViewOperator.next();
171170
assertEquals(4, tsBlock.getValueColumnCount());
172-
total += tsBlock.getPositionCount();
173-
for (int i = 0; i < tsBlock.getPositionCount(); i++) {
174-
long expectedTime = i + 20L * (count % 25);
171+
for (int i = 0; i < tsBlock.getPositionCount(); i++, count++) {
172+
long expectedTime = count;
175173
assertEquals(expectedTime, tsBlock.getTimeByIndex(i));
176174
assertEquals(
177175
SINGLE_DEVICE_MERGE_OPERATOR_TEST_SG + ".device0",
@@ -192,9 +190,8 @@ public void singleDeviceViewOperatorTest() {
192190
assertTrue(tsBlock.getColumn(3).isNull(i));
193191
}
194192
}
195-
count++;
196193
}
197-
assertEquals(500, total);
194+
assertEquals(500, count);
198195
} catch (Exception e) {
199196
e.printStackTrace();
200197
fail();

0 commit comments

Comments
 (0)