@@ -141,7 +141,8 @@ TEST_CASE("Test insertRecord by string", "[testInsertRecord]") {
141141 while (sessionDataSet->hasNext ()) {
142142 long index = 1 ;
143143 count++;
144- for (const Field &f: sessionDataSet->next ()->fields ) {
144+ auto fields = sessionDataSet->next ()->fields ;
145+ for (const Field &f: fields) {
145146 REQUIRE (f.longV .value () == index);
146147 index++;
147148 }
@@ -186,7 +187,8 @@ TEST_CASE("Test insertRecords ", "[testInsertRecords]") {
186187 while (sessionDataSet->hasNext ()) {
187188 long index = 1 ;
188189 count++;
189- for (const Field &f: sessionDataSet->next ()->fields ) {
190+ auto fields = sessionDataSet->next ()->fields ;
191+ for (const Field &f: fields) {
190192 REQUIRE (f.longV .value () == index);
191193 index++;
192194 }
@@ -386,7 +388,8 @@ TEST_CASE("Test insertTablet ", "[testInsertTablet]") {
386388 while (sessionDataSet->hasNext ()) {
387389 long index = 0 ;
388390 count++;
389- for (const Field& f: sessionDataSet->next ()->fields ) {
391+ auto fields = sessionDataSet->next ()->fields ;
392+ for (const Field &f: fields) {
390393 REQUIRE (f.longV .value () == index);
391394 index++;
392395 }
@@ -436,7 +439,8 @@ TEST_CASE("Test insertTablets ", "[testInsertTablets]") {
436439 while (sessionDataSet->hasNext ()) {
437440 long index = 0 ;
438441 count++;
439- for (const Field& f: sessionDataSet->next ()->fields ) {
442+ auto fields = sessionDataSet->next ()->fields ;
443+ for (const Field &f: fields) {
440444 REQUIRE (f.longV .value () == index);
441445 index++;
442446 }
@@ -614,10 +618,6 @@ TEST_CASE("Test executeRawDataQuery ", "[executeRawDataQuery]") {
614618 sessionDataSet->setFetchSize (10 );
615619 vector<string> columns = sessionDataSet->getColumnNames ();
616620 columns = sessionDataSet->getColumnNames ();
617- for (const string &column : columns) {
618- cout << column << " " ;
619- }
620- cout << endl;
621621 REQUIRE (columns[0 ] == " Time" );
622622 REQUIRE (columns[1 ] == paths[0 ]);
623623 REQUIRE (columns[2 ] == paths[1 ]);
0 commit comments