@@ -270,98 +270,6 @@ TEST_F(BasicLinkedListTest, SetItems) {
270270 EXPECT_EQ (expectedSeqno, basicLL->getAllSeqnoForVerification ());
271271}
272272
273- TEST_F (BasicLinkedListTest, TestRangeRead) {
274- const int numItems = 3 ;
275-
276- /* Add 3 new items */
277- addNewItemsToList (1 , std::string (" key" ), numItems);
278-
279- /* Now do a range read */
280- ENGINE_ERROR_CODE status;
281- std::vector<UniqueItemPtr> items;
282- seqno_t endSeqno;
283- std::tie (status, items, endSeqno) = basicLL->rangeRead (1 , numItems);
284-
285- EXPECT_EQ (ENGINE_SUCCESS, status);
286- EXPECT_EQ (numItems, items.size ());
287- EXPECT_EQ (numItems, items.back ()->getBySeqno ());
288- EXPECT_EQ (numItems, endSeqno);
289- }
290-
291- TEST_F (BasicLinkedListTest, TestRangeReadTillInf) {
292- const int numItems = 3 ;
293-
294- /* Add 3 new items */
295- addNewItemsToList (1 , std::string (" key" ), numItems);
296-
297- /* Now do a range read */
298- ENGINE_ERROR_CODE status;
299- std::vector<UniqueItemPtr> items;
300- seqno_t endSeqno;
301- std::tie (status, items, endSeqno) =
302- basicLL->rangeRead (1 , std::numeric_limits<seqno_t >::max ());
303-
304- EXPECT_EQ (ENGINE_SUCCESS, status);
305- EXPECT_EQ (numItems, items.size ());
306- EXPECT_EQ (numItems, items.back ()->getBySeqno ());
307- EXPECT_EQ (numItems, endSeqno);
308- }
309-
310- TEST_F (BasicLinkedListTest, TestRangeReadFromMid) {
311- const int numItems = 3 ;
312-
313- /* Add 3 new items */
314- addNewItemsToList (1 , std::string (" key" ), numItems);
315-
316- /* Now do a range read */
317- ENGINE_ERROR_CODE status;
318- std::vector<UniqueItemPtr> items;
319- seqno_t endSeqno;
320- std::tie (status, items, endSeqno) = basicLL->rangeRead (2 , numItems);
321-
322- EXPECT_EQ (ENGINE_SUCCESS, status);
323- EXPECT_EQ (numItems - 1 , items.size ());
324- EXPECT_EQ (numItems, items.back ()->getBySeqno ());
325- EXPECT_EQ (numItems, endSeqno);
326- }
327-
328- TEST_F (BasicLinkedListTest, TestRangeReadStopBeforeEnd) {
329- const int numItems = 3 ;
330-
331- /* Add 3 new items */
332- addNewItemsToList (1 , std::string (" key" ), numItems);
333-
334- /* Now request for a range read of just 2 items */
335- ENGINE_ERROR_CODE status;
336- std::vector<UniqueItemPtr> items;
337- seqno_t endSeqno;
338- std::tie (status, items, endSeqno) = basicLL->rangeRead (1 , numItems - 1 );
339-
340- EXPECT_EQ (ENGINE_SUCCESS, status);
341- EXPECT_EQ (numItems - 1 , items.size ());
342- EXPECT_EQ (numItems - 1 , items.back ()->getBySeqno ());
343- EXPECT_EQ (numItems - 1 , endSeqno);
344- }
345-
346- TEST_F (BasicLinkedListTest, TestRangeReadNegatives) {
347- const int numItems = 3 ;
348-
349- /* Add 3 new items */
350- addNewItemsToList (1 , std::string (" key" ), numItems);
351-
352- ENGINE_ERROR_CODE status;
353- std::vector<UniqueItemPtr> items;
354-
355- /* Now do a range read with start > end */
356- std::tie (status, items, std::ignore) = basicLL->rangeRead (2 , 1 );
357- EXPECT_EQ (ENGINE_ERANGE, status);
358-
359- /* Now do a range read with start > highSeqno */
360- std::tie (status, items, std::ignore) =
361- basicLL->rangeRead (numItems + 1 , numItems + 2 );
362- EXPECT_EQ (ENGINE_ERANGE, status);
363- }
364-
365273TEST_F (BasicLinkedListTest, UpdateFirstElem) {
366274 const int numItems = 3 ;
367275 const std::string keyPrefix (" key" );
@@ -886,28 +794,6 @@ TEST_F(BasicLinkedListTest,
886794 EXPECT_FALSE (guard2);
887795}
888796
889- TEST_F (BasicLinkedListTest, RangeReadStopsOnInvalidSeqno) {
890- /* MB-24376: rangeRead has to stop if it encounters an OSV with a seqno of
891- * -1; this item is definitely past the end of the rangeRead, and has not
892- * yet had its seqno updated in queueDirty */
893- const int numItems = 2 ;
894- const std::string keyPrefix (" key" );
895-
896- /* Add 2 new items */
897- addNewItemsToList (1 , keyPrefix, numItems);
898-
899- /* Add a key that does not yet have a vaild seqno (say -1) */
900- addItemWithoutSeqno (" key3" );
901-
902- EXPECT_EQ (-1 , basicLL->getSeqList ().back ().getBySeqno ());
903-
904- auto res = basicLL->rangeRead (1 , std::numeric_limits<seqno_t >::max ());
905-
906- EXPECT_EQ (ENGINE_SUCCESS, std::get<0 >(res));
907- EXPECT_EQ (numItems, std::get<1 >(res).size ());
908- EXPECT_EQ (numItems, std::get<2 >(res));
909- }
910-
911797/* 'EphemeralVBucket' (class that has the list) never calls the purge of last
912798 element, but the list must support generic purge (that is purge until any
913799 element). */
0 commit comments