@@ -232,8 +232,9 @@ TEST_F(DefaultCacheImplTest, LruCachePut) {
232232
233233 cache.Open ();
234234 cache.Clear ();
235- cache.Put (key, data_string, [=]() { return data_string; },
236- (std::numeric_limits<time_t >::max)());
235+ cache.Put (
236+ key, data_string, [=]() { return data_string; },
237+ (std::numeric_limits<time_t >::max)());
237238
238239 EXPECT_TRUE (cache.ContainsLru (key));
239240 }
@@ -266,8 +267,9 @@ TEST_F(DefaultCacheImplTest, LruCacheGetPromote) {
266267
267268 cache.Open ();
268269 cache.Clear ();
269- cache.Put (key1, data_string, [=]() { return data_string; },
270- (std::numeric_limits<time_t >::max)());
270+ cache.Put (
271+ key1, data_string, [=]() { return data_string; },
272+ (std::numeric_limits<time_t >::max)());
271273 cache.Put (key2, std::make_shared<std::vector<unsigned char >>(binary_data),
272274 (std::numeric_limits<time_t >::max)());
273275
@@ -334,8 +336,9 @@ TEST_F(DefaultCacheImplTest, LruCacheRemove) {
334336 (std::numeric_limits<time_t >::max)());
335337 cache.Put (key2, std::make_shared<std::vector<unsigned char >>(binary_data),
336338 (std::numeric_limits<time_t >::max)());
337- cache.Put (key3, data_string, [=]() { return data_string; },
338- (std::numeric_limits<time_t >::max)());
339+ cache.Put (
340+ key3, data_string, [=]() { return data_string; },
341+ (std::numeric_limits<time_t >::max)());
339342
340343 EXPECT_TRUE (cache.ContainsLru (key1));
341344 EXPECT_TRUE (cache.ContainsLru (key2));
@@ -379,7 +382,8 @@ TEST_F(DefaultCacheImplTest, MutableCacheExpired) {
379382 cache1.Clear ();
380383
381384 cache1.Put (key1, data_ptr, expiry);
382- cache1.Put (key2, data_string, [=]() { return data_string; }, expiry);
385+ cache1.Put (
386+ key2, data_string, [=]() { return data_string; }, expiry);
383387 cache1.Close ();
384388
385389 cache::CacheSettings settings2;
@@ -421,7 +425,8 @@ TEST_F(DefaultCacheImplTest, ProtectedCacheExpired) {
421425 cache1.Clear ();
422426
423427 cache1.Put (key1, data_ptr, expiry);
424- cache1.Put (key2, data_string, [=]() { return data_string; }, expiry);
428+ cache1.Put (
429+ key2, data_string, [=]() { return data_string; }, expiry);
425430 cache1.Close ();
426431
427432 cache::CacheSettings settings2;
@@ -468,13 +473,15 @@ TEST_F(DefaultCacheImplTest, MutableCacheSize) {
468473 cache.Open ();
469474 cache.Clear ();
470475
471- cache.Put (key1, data_string, [=]() { return data_string; },
472- (std::numeric_limits<time_t >::max)());
476+ cache.Put (
477+ key1, data_string, [=]() { return data_string; },
478+ (std::numeric_limits<time_t >::max)());
473479 auto data_size = key1.size () + data_string.size ();
474480
475481 EXPECT_EQ (data_size, cache.Size (CacheType::kMutable ));
476482
477- cache.Put (key2, data_string, [=]() { return data_string; }, expiry);
483+ cache.Put (
484+ key2, data_string, [=]() { return data_string; }, expiry);
478485 data_size +=
479486 key2.size () + data_string.size () + cache.CalculateExpirySize (key2);
480487
@@ -509,8 +516,9 @@ TEST_F(DefaultCacheImplTest, MutableCacheSize) {
509516 cache.Clear ();
510517
511518 cache.Put (key1, data_ptr, (std::numeric_limits<time_t >::max)());
512- cache.Put (key2, data_string, [=]() { return data_string; },
513- (std::numeric_limits<time_t >::max)());
519+ cache.Put (
520+ key2, data_string, [=]() { return data_string; },
521+ (std::numeric_limits<time_t >::max)());
514522
515523 cache.Remove (key1);
516524 cache.Remove (key2);
@@ -527,7 +535,8 @@ TEST_F(DefaultCacheImplTest, MutableCacheSize) {
527535 cache.Clear ();
528536
529537 cache.Put (key1, data_ptr, expiry);
530- cache.Put (key2, data_string, [=]() { return data_string; }, expiry);
538+ cache.Put (
539+ key2, data_string, [=]() { return data_string; }, expiry);
531540
532541 cache.Remove (key1);
533542 cache.Remove (key2);
@@ -545,7 +554,8 @@ TEST_F(DefaultCacheImplTest, MutableCacheSize) {
545554
546555 cache.Put (key1, data_ptr, (std::numeric_limits<time_t >::max)());
547556 cache.Put (key2, data_ptr, expiry);
548- cache.Put (key3, data_string, [=]() { return data_string; }, expiry);
557+ cache.Put (
558+ key3, data_string, [=]() { return data_string; }, expiry);
549559 const auto data_size =
550560 key3.size () + data_string.size () + cache.CalculateExpirySize (key3);
551561
@@ -563,7 +573,8 @@ TEST_F(DefaultCacheImplTest, MutableCacheSize) {
563573 cache.Clear ();
564574
565575 cache.Put (key1, data_ptr, -1 );
566- cache.Put (key2, data_string, [=]() { return data_string; }, -1 );
576+ cache.Put (
577+ key2, data_string, [=]() { return data_string; }, -1 );
567578
568579 cache.Get (key1);
569580 cache.Get (key2, [](const std::string& value) { return value; });
@@ -582,8 +593,9 @@ TEST_F(DefaultCacheImplTest, MutableCacheSize) {
582593 cache.Open ();
583594 cache.Clear ();
584595
585- cache.Put (key, data_string, [=]() { return data_string; },
586- (std::numeric_limits<time_t >::max)());
596+ cache.Put (
597+ key, data_string, [=]() { return data_string; },
598+ (std::numeric_limits<time_t >::max)());
587599 cache.Close ();
588600 EXPECT_EQ (0u , cache.Size (CacheType::kMutable ));
589601
@@ -825,21 +837,24 @@ TEST_F(DefaultCacheImplTest, ProtectTest) {
825837 DefaultCacheImplHelper cache (settings);
826838 ASSERT_EQ (olp::cache::DefaultCache::Success, cache.Open ());
827839 ASSERT_TRUE (cache.Clear ());
828- cache.Put (key1, key1_data_string, [=]() { return key1_data_string; }, 2 );
829- cache.Put (other_key1, key1_data_string, [=]() { return key1_data_string; },
830- 2 );
840+ cache.Put (
841+ key1, key1_data_string, [=]() { return key1_data_string; }, 2 );
842+ cache.Put (
843+ other_key1, key1_data_string, [=]() { return key1_data_string; }, 2 );
831844 ASSERT_TRUE (cache.Contains (key1));
832845 // protect single keys, and prefix
833846 ASSERT_TRUE (cache.Protect ({key1, key2, " other" }));
834847 // Try to protect key already protected by prefix
835848 ASSERT_FALSE (cache.Protect ({other_key1}));
836849 ASSERT_FALSE (cache.Contains (key2));
837- cache.Put (key2, key2_data_string, [=]() { return key2_data_string; }, 2 );
838- cache.Put (key3, key3_data_string, [=]() { return key3_data_string; }, 2 );
839- cache.Put (other_key2, key2_data_string, [=]() { return key2_data_string; },
840- 2 );
841- cache.Put (other_key3, key3_data_string, [=]() { return key3_data_string; },
842- 2 );
850+ cache.Put (
851+ key2, key2_data_string, [=]() { return key2_data_string; }, 2 );
852+ cache.Put (
853+ key3, key3_data_string, [=]() { return key3_data_string; }, 2 );
854+ cache.Put (
855+ other_key2, key2_data_string, [=]() { return key2_data_string; }, 2 );
856+ cache.Put (
857+ other_key3, key3_data_string, [=]() { return key3_data_string; }, 2 );
843858 ASSERT_TRUE (cache.Protect ({key3}));
844859 ASSERT_TRUE (cache.Release ({key1}));
845860 std::this_thread::sleep_for (std::chrono::seconds (3 ));
@@ -969,8 +984,9 @@ TEST_F(DefaultCacheImplTest, ReadOnlyPartitionForProtectedCache) {
969984 cache1.Open ());
970985 cache1.Clear ();
971986
972- cache1.Put (key, data_string, [=]() { return data_string; },
973- std::numeric_limits<time_t >::max ());
987+ cache1.Put (
988+ key, data_string, [=]() { return data_string; },
989+ std::numeric_limits<time_t >::max ());
974990 cache1.Close ();
975991
976992 // Make readonly
@@ -997,8 +1013,9 @@ TEST_F(DefaultCacheImplTest, ProtectTestWithoutMutableCache) {
9971013 DefaultCacheImplHelper cache ({});
9981014 ASSERT_EQ (olp::cache::DefaultCache::Success, cache.Open ());
9991015 ASSERT_TRUE (cache.Clear ());
1000- cache.Put (key1, key1_data_string, [=]() { return key1_data_string; },
1001- std::numeric_limits<time_t >::max ());
1016+ cache.Put (
1017+ key1, key1_data_string, [=]() { return key1_data_string; },
1018+ std::numeric_limits<time_t >::max ());
10021019 ASSERT_TRUE (cache.Contains (key1));
10031020 ASSERT_FALSE (cache.Protect ({key1}));
10041021
@@ -1012,9 +1029,9 @@ TEST_F(DefaultCacheImplTest, ProtectTestWithoutMutableCache) {
10121029 DefaultCacheImplHelper cache (settings);
10131030 ASSERT_EQ (olp::cache::DefaultCache::Success, cache.Open ());
10141031 ASSERT_TRUE (cache.Clear ());
1015- ASSERT_TRUE (cache.Put (key1, key1_data_string,
1016- [=]() { return key1_data_string; },
1017- std::numeric_limits<time_t >::max ()));
1032+ ASSERT_TRUE (cache.Put (
1033+ key1, key1_data_string, [=]() { return key1_data_string; },
1034+ std::numeric_limits<time_t >::max ()));
10181035 ASSERT_TRUE (cache.Protect ({key1}));
10191036 cache.Close ();
10201037 }
0 commit comments