@@ -113,8 +113,8 @@ public async Task TestInsertStringRecord()
113113 var res_cnt = 0 ;
114114 while ( res . HasNext ( ) )
115115 {
116- res . Next ( ) ;
117116 res_cnt ++ ;
117+ res . Next ( ) ;
118118 }
119119 Console . WriteLine ( res_cnt + " " + fetchSize * processedSize ) ;
120120 System . Diagnostics . Debug . Assert ( res_cnt == fetchSize * processedSize ) ;
@@ -149,8 +149,7 @@ public async Task TestInsertStrRecord()
149149 System . Diagnostics . Debug . Assert ( status == 0 ) ;
150150 var res = await session_pool . ExecuteQueryStatementAsync (
151151 "select * from " + string . Format ( "{0}.{1}" , testDatabaseName , testDevice ) + " where time<2" ) ;
152- res . ShowTableNames ( ) ;
153- while ( res . HasNext ( ) ) Console . WriteLine ( res . Next ( ) ) ;
152+ SessionPoolTest . PrintDataSetByString ( res ) ;
154153
155154 await res . Close ( ) ;
156155
@@ -173,8 +172,8 @@ public async Task TestInsertStrRecord()
173172 var res_count = 0 ;
174173 while ( res . HasNext ( ) )
175174 {
176- res . Next ( ) ;
177175 res_count += 1 ;
176+ res . Next ( ) ;
178177 }
179178
180179 await res . Close ( ) ;
@@ -256,8 +255,7 @@ public async Task TestInsertRecords()
256255 System . Diagnostics . Debug . Assert ( status == 0 ) ;
257256 var res = await session_pool . ExecuteQueryStatementAsync (
258257 "select * from " + string . Format ( "{0}.{1}" , testDatabaseName , testDevice ) + " where time<10" ) ;
259- res . ShowTableNames ( ) ;
260- while ( res . HasNext ( ) ) Console . WriteLine ( res . Next ( ) ) ;
258+ SessionPoolTest . PrintDataSetByString ( res ) ;
261259
262260 await res . Close ( ) ;
263261 Console . WriteLine ( status ) ;
@@ -282,13 +280,15 @@ public async Task TestInsertRecords()
282280 Task . WaitAll ( tasks . ToArray ( ) ) ;
283281 res = await session_pool . ExecuteQueryStatementAsync (
284282 "select * from " + string . Format ( "{0}.{1}" , testDatabaseName , testDevice ) ) ;
285- res . ShowTableNames ( ) ;
283+
286284 var record_count = fetchSize * processedSize ;
285+
286+ res . ShowTableNames ( ) ;
287287 var res_count = 0 ;
288288 while ( res . HasNext ( ) )
289289 {
290- res . Next ( ) ;
291290 res_count += 1 ;
291+ res . Next ( ) ;
292292 }
293293
294294 await res . Close ( ) ;
@@ -306,10 +306,10 @@ public async Task TestInsertRecords()
306306 break ;
307307 }
308308
309- Console . WriteLine ( $ "{ testDatabaseName } .{ testDevice } .{ row . Measurements [ 0 ] } { testMeasurements [ 3 ] } ") ;
310- System . Diagnostics . Debug . Assert ( $ "{ testDatabaseName } .{ testDevice } .{ testMeasurements [ 3 ] } " == row . Measurements [ 0 ] ) ;
311- System . Diagnostics . Debug . Assert ( $ "{ testDatabaseName } .{ testDevice } .{ testMeasurements [ 1 ] } " == row . Measurements [ 1 ] ) ;
312- System . Diagnostics . Debug . Assert ( $ "{ testDatabaseName } .{ testDevice } .{ testMeasurements [ 2 ] } " == row . Measurements [ 2 ] ) ;
309+ Console . WriteLine ( $ "{ testDatabaseName } .{ testDevice } .{ row . Measurements [ 1 ] } { testMeasurements [ 3 ] } ") ;
310+ System . Diagnostics . Debug . Assert ( $ "{ testDatabaseName } .{ testDevice } .{ testMeasurements [ 3 ] } " == row . Measurements [ 1 ] ) ;
311+ System . Diagnostics . Debug . Assert ( $ "{ testDatabaseName } .{ testDevice } .{ testMeasurements [ 1 ] } " == row . Measurements [ 2 ] ) ;
312+ System . Diagnostics . Debug . Assert ( $ "{ testDatabaseName } .{ testDevice } .{ testMeasurements [ 2 ] } " == row . Measurements [ 3 ] ) ;
313313
314314 status = await session_pool . DeleteDatabaseAsync ( testDatabaseName ) ;
315315 System . Diagnostics . Debug . Assert ( status == 0 ) ;
@@ -351,8 +351,7 @@ public async Task TestInsertStringRecords()
351351 System . Diagnostics . Debug . Assert ( status == 0 ) ;
352352 var res = await session_pool . ExecuteQueryStatementAsync (
353353 "select * from " + string . Format ( "{0}.{1}" , testDatabaseName , testDevice ) + " where time<10" ) ;
354- res . ShowTableNames ( ) ;
355- while ( res . HasNext ( ) ) Console . WriteLine ( res . Next ( ) ) ;
354+ SessionPoolTest . PrintDataSetByString ( res ) ;
356355
357356 await res . Close ( ) ;
358357
@@ -386,7 +385,7 @@ public async Task TestInsertStringRecords()
386385 var res_count = 0 ;
387386 while ( res . HasNext ( ) )
388387 {
389- res . Next ( ) ;
388+ Console . WriteLine ( res . Next ( ) ) ;
390389 res_count += 1 ;
391390 }
392391
@@ -468,8 +467,7 @@ public async Task TestInsertRecordsOfOneDevice()
468467 System . Diagnostics . Debug . Assert ( status == 0 ) ;
469468 var res = await session_pool . ExecuteQueryStatementAsync (
470469 "select * from " + string . Format ( "{0}.{1}" , testDatabaseName , testDevice ) + " where time<10" ) ;
471- res . ShowTableNames ( ) ;
472- while ( res . HasNext ( ) ) Console . WriteLine ( res . Next ( ) ) ;
470+ SessionPoolTest . PrintDataSetByString ( res ) ;
473471
474472 await res . Close ( ) ;
475473 // large data test
@@ -492,8 +490,8 @@ public async Task TestInsertRecordsOfOneDevice()
492490 var res_count = 0 ;
493491 while ( res . HasNext ( ) )
494492 {
495- res . Next ( ) ;
496493 res_count += 1 ;
494+ res . Next ( ) ;
497495 }
498496
499497 await res . Close ( ) ;
@@ -543,8 +541,7 @@ public async Task TestInsertStringRecordsOfOneDevice()
543541 System . Diagnostics . Debug . Assert ( status == 0 ) ;
544542 var res = await session_pool . ExecuteQueryStatementAsync (
545543 "select * from " + string . Format ( "{0}.{1}" , testDatabaseName , testDevice ) + " where time<10" ) ;
546- res . ShowTableNames ( ) ;
547- while ( res . HasNext ( ) ) Console . WriteLine ( res . Next ( ) ) ;
544+ SessionPoolTest . PrintDataSetByString ( res ) ;
548545
549546 await res . Close ( ) ;
550547 // large data test
@@ -572,8 +569,8 @@ public async Task TestInsertStringRecordsOfOneDevice()
572569 var res_count = 0 ;
573570 while ( res . HasNext ( ) )
574571 {
575- res . Next ( ) ;
576572 res_count += 1 ;
573+ res . Next ( ) ;
577574 }
578575
579576 await res . Close ( ) ;
0 commit comments