]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: journal updates to support C++11
authorJason Dillaman <dillaman@redhat.com>
Thu, 20 Aug 2015 01:58:04 +0000 (21:58 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 6 Nov 2015 01:42:43 +0000 (20:42 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/cls_journal/test_cls_journal.cc
src/test/journal/test_JournalMetadata.cc
src/test/journal/test_JournalPlayer.cc
src/test/journal/test_ObjectPlayer.cc
src/test/journal/test_ObjectRecorder.cc

index 0df127663b83245050d7dee7b79ff727d6663f70..18375645b3792e494d56bbd4b861f2d061cbf27b 100644 (file)
@@ -9,7 +9,6 @@
 #include <errno.h>
 #include <set>
 #include <string>
-#include <boost/assign/list_of.hpp>
 
 using namespace cls::journal;
 
@@ -201,8 +200,7 @@ TEST_F(TestClsJournal, ClientRegister) {
   std::set<Client> clients;
   ASSERT_EQ(0, client::client_list(ioctx, oid, &clients));
 
-  std::set<Client> expected_clients = boost::assign::list_of(
-    Client("id1", "desc1"));
+  std::set<Client> expected_clients = {Client("id1", "desc1")};
   ASSERT_EQ(expected_clients, clients);
 }
 
@@ -247,9 +245,9 @@ TEST_F(TestClsJournal, ClientCommit) {
   ASSERT_EQ(0, client::client_register(ioctx, oid, "id1", "desc1"));
 
   cls::journal::EntryPositions entry_positions;
-  entry_positions = boost::assign::list_of(
-    cls::journal::EntryPosition("tag1", 120))(
-    cls::journal::EntryPosition("tag2", 121));
+  entry_positions = {
+    cls::journal::EntryPosition("tag1", 120),
+    cls::journal::EntryPosition("tag2", 121)};
   cls::journal::ObjectSetPosition object_set_position(
     1, entry_positions);
 
@@ -260,8 +258,8 @@ TEST_F(TestClsJournal, ClientCommit) {
   std::set<Client> clients;
   ASSERT_EQ(0, client::client_list(ioctx, oid, &clients));
 
-  std::set<Client> expected_clients = boost::assign::list_of(
-    Client("id1", "desc1", object_set_position));
+  std::set<Client> expected_clients = {
+    Client("id1", "desc1", object_set_position)};
   ASSERT_EQ(expected_clients, clients);
 }
 
@@ -275,10 +273,10 @@ TEST_F(TestClsJournal, ClientCommitInvalid) {
   ASSERT_EQ(0, client::client_register(ioctx, oid, "id1", "desc1"));
 
   cls::journal::EntryPositions entry_positions;
-  entry_positions = boost::assign::list_of(
-    cls::journal::EntryPosition("tag1", 120))(
-    cls::journal::EntryPosition("tag1", 121))(
-    cls::journal::EntryPosition("tag2", 121));
+  entry_positions = {
+    cls::journal::EntryPosition("tag1", 120),
+    cls::journal::EntryPosition("tag1", 121),
+    cls::journal::EntryPosition("tag2", 121)};
   cls::journal::ObjectSetPosition object_set_position(
     1, entry_positions);
 
index fc4fd0f5a2b262c1a225177b1a4a67e82a0b9493..e0bd918dc2706094d171e78393984b15816bb4af 100644 (file)
@@ -5,7 +5,6 @@
 #include "test/journal/RadosTestFixture.h"
 #include "common/Cond.h"
 #include "common/Mutex.h"
-#include <boost/assign/list_of.hpp>
 #include <map>
 
 class TestJournalMetadata : public RadosTestFixture {
@@ -70,8 +69,8 @@ TEST_F(TestJournalMetadata, SetCommitPositions) {
   ASSERT_EQ(commit_position, read_commit_position);
 
   journal::JournalMetadata::EntryPositions entry_positions;
-  entry_positions = boost::assign::list_of(
-    cls::journal::EntryPosition("tag1", 122));
+  entry_positions = {
+    cls::journal::EntryPosition("tag1", 122)};
   commit_position = journal::JournalMetadata::ObjectSetPosition(1, entry_positions);
 
   C_SaferCond cond;
index 19a256d19dca89cf36cd6edf955e45b39c8f923b..8dcb95f63e5d2a74cc105527cca4edb499ae1c3f 100644 (file)
@@ -11,7 +11,6 @@
 #include "gtest/gtest.h"
 #include "test/journal/RadosTestFixture.h"
 #include <list>
-#include <boost/assign/list_of.hpp>
 
 class TestJournalPlayer : public RadosTestFixture {
 public:
@@ -149,8 +148,8 @@ TEST_F(TestJournalPlayer, Prefetch) {
   std::string oid = get_temp_oid();
 
   journal::JournalPlayer::EntryPositions positions;
-  positions = boost::assign::list_of(
-    cls::journal::EntryPosition("tag1", 122));
+  positions = {
+    cls::journal::EntryPosition("tag1", 122) };
   cls::journal::ObjectSetPosition commit_position(0, positions);
 
   ASSERT_EQ(0, create(oid));
@@ -174,10 +173,10 @@ TEST_F(TestJournalPlayer, Prefetch) {
   ASSERT_TRUE(wait_for_complete(player));
 
   Entries expected_entries;
-  expected_entries = boost::assign::list_of(
-    create_entry("tag1", 123))(
-    create_entry("tag1", 124))(
-    create_entry("tag1", 125));
+  expected_entries = {
+    create_entry("tag1", 123),
+    create_entry("tag1", 124),
+    create_entry("tag1", 125)};
   ASSERT_EQ(expected_entries, entries);
 
   uint64_t last_tid;
@@ -209,9 +208,9 @@ TEST_F(TestJournalPlayer, PrefetchWithoutCommit) {
   ASSERT_TRUE(wait_for_complete(player));
 
   Entries expected_entries;
-  expected_entries = boost::assign::list_of(
-    create_entry("tag1", 122))(
-    create_entry("tag1", 123));
+  expected_entries = {
+    create_entry("tag1", 122),
+    create_entry("tag1", 123)};
   ASSERT_EQ(expected_entries, entries);
 }
 
@@ -219,9 +218,9 @@ TEST_F(TestJournalPlayer, PrefetchMultipleTags) {
   std::string oid = get_temp_oid();
 
   journal::JournalPlayer::EntryPositions positions;
-  positions = boost::assign::list_of(
-    cls::journal::EntryPosition("tag1", 122))(
-    cls::journal::EntryPosition("tag2", 1));
+  positions = {
+    cls::journal::EntryPosition("tag1", 122),
+    cls::journal::EntryPosition("tag2", 1)};
   cls::journal::ObjectSetPosition commit_position(0, positions);
 
   ASSERT_EQ(0, create(oid));
@@ -289,8 +288,8 @@ TEST_F(TestJournalPlayer, PrefetchAndWatch) {
   std::string oid = get_temp_oid();
 
   journal::JournalPlayer::EntryPositions positions;
-  positions = boost::assign::list_of(
-    cls::journal::EntryPosition("tag1", 122));
+  positions = {
+    cls::journal::EntryPosition("tag1", 122)};
   cls::journal::ObjectSetPosition commit_position(0, positions);
 
   ASSERT_EQ(0, create(oid));
@@ -311,12 +310,12 @@ TEST_F(TestJournalPlayer, PrefetchAndWatch) {
   ASSERT_TRUE(wait_for_entries(player, 1, &entries));
 
   Entries expected_entries;
-  expected_entries = boost::assign::list_of(create_entry("tag1", 123));
+  expected_entries = {create_entry("tag1", 123)};
   ASSERT_EQ(expected_entries, entries);
 
   ASSERT_EQ(0, write_entry(oid, 0, "tag1", 124));
   ASSERT_TRUE(wait_for_entries(player, 1, &entries));
 
-  expected_entries = boost::assign::list_of(create_entry("tag1", 124));
+  expected_entries = {create_entry("tag1", 124)};
   ASSERT_EQ(expected_entries, entries);
 }
index f00c053cdc6f8288a1f04b4add4bf37a133800c3..3e9a2afd7ab62d995f099612f300315a0164ca9e 100644 (file)
@@ -9,7 +9,6 @@
 #include "gtest/gtest.h"
 #include "test/librados/test.h"
 #include "test/journal/RadosTestFixture.h"
-#include <boost/assign/list_of.hpp>
 
 class TestObjectPlayer : public RadosTestFixture {
 public:
@@ -46,8 +45,7 @@ TEST_F(TestObjectPlayer, Fetch) {
   object->get_entries(&entries);
   ASSERT_EQ(2U, entries.size());
 
-  journal::ObjectPlayer::Entries expected_entries = boost::assign::list_of(
-    entry1)(entry2);
+  journal::ObjectPlayer::Entries expected_entries = {entry1, entry2};
   ASSERT_EQ(expected_entries, entries);
 }
 
@@ -73,8 +71,7 @@ TEST_F(TestObjectPlayer, FetchLarge) {
   object->get_entries(&entries);
   ASSERT_EQ(1U, entries.size());
 
-  journal::ObjectPlayer::Entries expected_entries = boost::assign::list_of(
-    entry1);
+  journal::ObjectPlayer::Entries expected_entries = {entry1};
   ASSERT_EQ(expected_entries, entries);
 }
 
@@ -99,8 +96,7 @@ TEST_F(TestObjectPlayer, FetchDeDup) {
   object->get_entries(&entries);
   ASSERT_EQ(1U, entries.size());
 
-  journal::ObjectPlayer::Entries expected_entries = boost::assign::list_of(
-    entry2);
+  journal::ObjectPlayer::Entries expected_entries = {entry2};
   ASSERT_EQ(expected_entries, entries);
 }
 
@@ -151,8 +147,7 @@ TEST_F(TestObjectPlayer, FetchCorrupt) {
   object->get_entries(&entries);
   ASSERT_EQ(2U, entries.size());
 
-  journal::ObjectPlayer::Entries expected_entries = boost::assign::list_of(
-    entry1)(entry2);
+  journal::ObjectPlayer::Entries expected_entries = {entry1, entry2};
   ASSERT_EQ(expected_entries, entries);
 }
 
@@ -176,8 +171,7 @@ TEST_F(TestObjectPlayer, FetchAppend) {
   object->get_entries(&entries);
   ASSERT_EQ(1U, entries.size());
 
-  journal::ObjectPlayer::Entries expected_entries = boost::assign::list_of(
-    entry1);
+  journal::ObjectPlayer::Entries expected_entries = {entry1};
   ASSERT_EQ(expected_entries, entries);
 
   bl.clear();
@@ -191,7 +185,7 @@ TEST_F(TestObjectPlayer, FetchAppend) {
   object->get_entries(&entries);
   ASSERT_EQ(2U, entries.size());
 
-  expected_entries = boost::assign::list_of(entry1)(entry2);
+  expected_entries = {entry1, entry2};
   ASSERT_EQ(expected_entries, entries);
 }
 
@@ -246,7 +240,7 @@ TEST_F(TestObjectPlayer, Watch) {
   ASSERT_EQ(1U, entries.size());
 
   journal::ObjectPlayer::Entries expected_entries;
-  expected_entries = boost::assign::list_of(entry1);
+  expected_entries = {entry1};
   ASSERT_EQ(expected_entries, entries);
 
   C_SaferCond cond2;
@@ -260,7 +254,7 @@ TEST_F(TestObjectPlayer, Watch) {
   object->get_entries(&entries);
   ASSERT_EQ(2U, entries.size());
 
-  expected_entries = boost::assign::list_of(entry1)(entry2);
+  expected_entries = {entry1, entry2};
   ASSERT_EQ(expected_entries, entries);
 }
 
index bbe18eaa1ed7cb35c340654882424298e38e1ab8..8c2743028774d20633caccea3621aa3db2e037f8 100644 (file)
@@ -10,7 +10,6 @@
 #include "test/librados/test.h"
 #include "test/journal/RadosTestFixture.h"
 #include <limits>
-#include <boost/assign/list_of.hpp>
 
 class TestObjectRecorder : public RadosTestFixture {
 public:
@@ -111,13 +110,13 @@ TEST_F(TestObjectRecorder, Append) {
   journal::AppendBuffer append_buffer1 = create_append_buffer("tag", 123,
                                                              "payload");
   journal::AppendBuffers append_buffers;
-  append_buffers = boost::assign::list_of(append_buffer1);
+  append_buffers = {append_buffer1};
   ASSERT_FALSE(object->append(append_buffers));
   ASSERT_EQ(1U, object->get_pending_appends());
 
   journal::AppendBuffer append_buffer2 = create_append_buffer("tag", 124,
                                                              "payload");
-  append_buffers = boost::assign::list_of(append_buffer2);
+  append_buffers = {append_buffer2};
   ASSERT_FALSE(object->append(append_buffers));
   ASSERT_EQ(2U, object->get_pending_appends());
 
@@ -136,13 +135,13 @@ TEST_F(TestObjectRecorder, AppendFlushByCount) {
   journal::AppendBuffer append_buffer1 = create_append_buffer("tag", 123,
                                                              "payload");
   journal::AppendBuffers append_buffers;
-  append_buffers = boost::assign::list_of(append_buffer1);
+  append_buffers = {append_buffer1};
   ASSERT_FALSE(object->append(append_buffers));
   ASSERT_EQ(1U, object->get_pending_appends());
 
   journal::AppendBuffer append_buffer2 = create_append_buffer("tag", 124,
                                                              "payload");
-  append_buffers = boost::assign::list_of(append_buffer2);
+  append_buffers = {append_buffer2};
   ASSERT_FALSE(object->append(append_buffers));
   ASSERT_EQ(0U, object->get_pending_appends());
 
@@ -160,13 +159,13 @@ TEST_F(TestObjectRecorder, AppendFlushByBytes) {
   journal::AppendBuffer append_buffer1 = create_append_buffer("tag", 123,
                                                              "payload");
   journal::AppendBuffers append_buffers;
-  append_buffers = boost::assign::list_of(append_buffer1);
+  append_buffers = {append_buffer1};
   ASSERT_FALSE(object->append(append_buffers));
   ASSERT_EQ(1U, object->get_pending_appends());
 
   journal::AppendBuffer append_buffer2 = create_append_buffer("tag", 124,
                                                              "payload");
-  append_buffers = boost::assign::list_of(append_buffer2);
+  append_buffers = {append_buffer2};
   ASSERT_FALSE(object->append(append_buffers));
   ASSERT_EQ(0U, object->get_pending_appends());
 
@@ -184,12 +183,12 @@ TEST_F(TestObjectRecorder, AppendFlushByAge) {
   journal::AppendBuffer append_buffer1 = create_append_buffer("tag", 123,
                                                              "payload");
   journal::AppendBuffers append_buffers;
-  append_buffers = boost::assign::list_of(append_buffer1);
+  append_buffers = {append_buffer1};
   ASSERT_FALSE(object->append(append_buffers));
 
   journal::AppendBuffer append_buffer2 = create_append_buffer("tag", 124,
                                                              "payload");
-  append_buffers = boost::assign::list_of(append_buffer2);
+  append_buffers = {append_buffer2};
   ASSERT_FALSE(object->append(append_buffers));
 
   C_SaferCond cond;
@@ -207,12 +206,12 @@ TEST_F(TestObjectRecorder, AppendFilledObject) {
   journal::AppendBuffer append_buffer1 = create_append_buffer("tag", 123,
                                                               payload);
   journal::AppendBuffers append_buffers;
-  append_buffers = boost::assign::list_of(append_buffer1);
+  append_buffers = {append_buffer1};
   ASSERT_FALSE(object->append(append_buffers));
 
   journal::AppendBuffer append_buffer2 = create_append_buffer("tag", 124,
                                                               payload);
-  append_buffers = boost::assign::list_of(append_buffer2);
+  append_buffers = {append_buffer2};
   ASSERT_TRUE(object->append(append_buffers));
 
   C_SaferCond cond;
@@ -229,7 +228,7 @@ TEST_F(TestObjectRecorder, Flush) {
   journal::AppendBuffer append_buffer1 = create_append_buffer("tag", 123,
                                                              "payload");
   journal::AppendBuffers append_buffers;
-  append_buffers = boost::assign::list_of(append_buffer1);
+  append_buffers = {append_buffer1};
   ASSERT_FALSE(object->append(append_buffers));
   ASSERT_EQ(1U, object->get_pending_appends());
 
@@ -251,7 +250,7 @@ TEST_F(TestObjectRecorder, FlushFuture) {
   journal::AppendBuffer append_buffer = create_append_buffer("tag", 123,
                                                              "payload");
   journal::AppendBuffers append_buffers;
-  append_buffers = boost::assign::list_of(append_buffer);
+  append_buffers = {append_buffer};
   ASSERT_FALSE(object->append(append_buffers));
   ASSERT_EQ(1U, object->get_pending_appends());
 
@@ -272,7 +271,7 @@ TEST_F(TestObjectRecorder, FlushDetachedFuture) {
                                                              "payload");
 
   journal::AppendBuffers append_buffers;
-  append_buffers = boost::assign::list_of(append_buffer);
+  append_buffers = {append_buffer};
 
   object->flush(append_buffer.first);
   ASSERT_FALSE(append_buffer.first->is_flush_in_progress());
@@ -296,7 +295,7 @@ TEST_F(TestObjectRecorder, Overflow) {
   journal::AppendBuffer append_buffer2 = create_append_buffer("tag", 124,
                                                               payload);
   journal::AppendBuffers append_buffers;
-  append_buffers = boost::assign::list_of(append_buffer1)(append_buffer2);
+  append_buffers = {append_buffer1, append_buffer2};
   ASSERT_TRUE(object1->append(append_buffers));
 
   C_SaferCond cond;
@@ -306,7 +305,7 @@ TEST_F(TestObjectRecorder, Overflow) {
 
   journal::AppendBuffer append_buffer3 = create_append_buffer("bar", 123,
                                                               payload);
-  append_buffers = boost::assign::list_of(append_buffer3);
+  append_buffers = {append_buffer3};
 
   ASSERT_FALSE(object2->append(append_buffers));
   append_buffer3.first->flush(NULL);