@@ -468,12 +468,10 @@ TEST_F(KeyValueFileStoreWriteTest, TestRealtimeWrite) {
468468 ASSERT_NOK_WITH_MSG (writer->Write (MakeBatch (realtime_schema, R"( [[30, 3, "backwards"]])" )),
469469 " offset moved backwards or was duplicated" );
470470 ASSERT_NOK (writer->Write (MakeBatch (realtime_schema, R"( [[null, 3, "null-offset"]])" )));
471- using RealtimePrimaryKeyStoreRow = std::tuple<int8_t , int64_t , std::string, int64_t , int64_t >;
472- ASSERT_OK_AND_ASSIGN (std::vector<RealtimePrimaryKeyStoreRow> store_rows,
473- ReadRealtimePrimaryKeyStoreRows (realtime_context));
474- ASSERT_EQ ((std::vector<RealtimePrimaryKeyStoreRow>{
475- {0 , 1 , " old" , 0 , 10 }, {2 , 1 , " new" , 2 , 30 }, {3 , 2 , " two" , 1 , 20 }}),
476- store_rows);
471+ ASSERT_OK_AND_ASSIGN (auto store_rows, ReadRealtimePrimaryKeyStoreRows (realtime_context));
472+ ASSERT_EQ (
473+ (decltype (store_rows){{0 , 1 , " old" , 0 , 10 }, {2 , 1 , " new" , 2 , 30 }, {3 , 2 , " two" , 1 , 20 }}),
474+ store_rows);
477475 ASSERT_OK_AND_ASSIGN (std::vector<RealtimeCommitProgress> progresses,
478476 writer->PrepareCommitWithProgress (0 ));
479477 ASSERT_EQ (1 , progresses.size ());
@@ -523,10 +521,8 @@ TEST_F(KeyValueFileStoreWriteTest, TestRealtimePool) {
523521 ASSERT_GT (pool->allocation_count , allocations_before_write);
524522 ASSERT_OK (writer->Close ());
525523 writer.reset ();
526- using RealtimePrimaryKeyStoreRow = std::tuple<int8_t , int64_t , std::string, int64_t , int64_t >;
527- ASSERT_OK_AND_ASSIGN (std::vector<RealtimePrimaryKeyStoreRow> retained_rows,
528- ReadRealtimePrimaryKeyStoreRows (realtime_context));
529- ASSERT_EQ ((std::vector<RealtimePrimaryKeyStoreRow>{{0 , 1 , " one" , 0 , 0 }}), retained_rows);
524+ ASSERT_OK_AND_ASSIGN (auto retained_rows, ReadRealtimePrimaryKeyStoreRows (realtime_context));
525+ ASSERT_EQ ((decltype (retained_rows){{0 , 1 , " one" , 0 , 0 }}), retained_rows);
530526
531527 std::shared_ptr<TestingMemoryPool> rejecting_pool = std::make_shared<TestingMemoryPool>();
532528 ASSERT_OK_AND_ASSIGN (std::shared_ptr<RealtimeContext> rejecting_context,
@@ -546,8 +542,7 @@ TEST_F(KeyValueFileStoreWriteTest, TestRealtimePool) {
546542 ASSERT_NOK_WITH_MSG (rejecting_writer->Write (MakeBatch (realtime_schema, R"( [[0, 2, "two"]])" )),
547543 " Out of memory" );
548544 ASSERT_GT (rejecting_pool->allocation_count , rejecting_allocations_before_write);
549- ASSERT_OK_AND_ASSIGN (std::vector<RealtimePrimaryKeyStoreRow> rejected_rows,
550- ReadRealtimePrimaryKeyStoreRows (rejecting_context));
545+ ASSERT_OK_AND_ASSIGN (auto rejected_rows, ReadRealtimePrimaryKeyStoreRows (rejecting_context));
551546 ASSERT_TRUE (rejected_rows.empty ());
552547 ASSERT_OK (rejecting_writer->Close ());
553548}
@@ -606,18 +601,14 @@ TEST_F(KeyValueFileStoreWriteTest, TestRealtimeLimits) {
606601 FileStoreWrite::Create (std::move (write_context)));
607602 ASSERT_OK (
608603 writer->Write (MakeBatch (realtime_schema, fmt::format (R"( [[{}, 1, "legal"]])" , max - 1 ))));
609- using RealtimePrimaryKeyStoreRow = std::tuple<int8_t , int64_t , std::string, int64_t , int64_t >;
610- ASSERT_OK_AND_ASSIGN (std::vector<RealtimePrimaryKeyStoreRow> store_rows,
611- ReadRealtimePrimaryKeyStoreRows (realtime_context));
612- ASSERT_EQ ((std::vector<RealtimePrimaryKeyStoreRow>{{0 , 1 , " legal" , max - 1 , max - 1 }}),
613- store_rows);
604+ ASSERT_OK_AND_ASSIGN (auto store_rows, ReadRealtimePrimaryKeyStoreRows (realtime_context));
605+ ASSERT_EQ ((decltype (store_rows){{0 , 1 , " legal" , max - 1 , max - 1 }}), store_rows);
614606
615607 ASSERT_NOK_WITH_MSG (
616608 writer->Write (MakeBatch (realtime_schema, fmt::format (R"( [[{}, 2, "overflow"]])" , max))),
617609 " real-time offset range exceeds INT64_MAX" );
618610 ASSERT_OK_AND_ASSIGN (store_rows, ReadRealtimePrimaryKeyStoreRows (realtime_context));
619- ASSERT_EQ ((std::vector<RealtimePrimaryKeyStoreRow>{{0 , 1 , " legal" , max - 1 , max - 1 }}),
620- store_rows);
611+ ASSERT_EQ ((decltype (store_rows){{0 , 1 , " legal" , max - 1 , max - 1 }}), store_rows);
621612 ASSERT_OK_AND_ASSIGN (std::shared_ptr<RealtimeContextImpl> context_impl,
622613 RealtimeContextImpl::Cast (realtime_context));
623614 ASSERT_OK_AND_ASSIGN (RealtimeReadState read_state, context_impl->AcquireReadState ());
0 commit comments