Skip to content

Commit baf517b

Browse files
committed
Fix up tests: no more copying
1 parent 3ee7a14 commit baf517b

File tree

2 files changed

+3
-35
lines changed

2 files changed

+3
-35
lines changed

src/app/server-cluster/StandardServerCluster.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ class StandardServerCluster : public ServerClusterInterface
3838
StandardServerCluster();
3939
virtual ~StandardServerCluster() = default;
4040

41-
StandardServerCluster(const StandardServerCluster & other) = default;
4241
StandardServerCluster(StandardServerCluster && other) = default;
43-
StandardServerCluster & operator=(const StandardServerCluster & other) = default;
4442
StandardServerCluster & operator=(StandardServerCluster && other) = default;
4543

44+
StandardServerCluster(const StandardServerCluster & other) = delete;
45+
StandardServerCluster & operator=(const StandardServerCluster & other) = delete;
46+
4647
void IncreaseDataVersion() { mDataVersion++; }
4748

4849
//////////////////////////// ServerClusterInterface implementation ////////////////////////////////////////

src/app/server-cluster/tests/TestStandardServerCluster.cpp

-33
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,6 @@ TEST(TestStandardServerCluster, TestAssignmentNotInList)
7373

7474
ASSERT_FALSE(basic.IsInList());
7575

76-
// copy constructor: not in list
77-
{
78-
FakeStandardServerCluster other(basic);
79-
ASSERT_FALSE(other.IsInList());
80-
}
81-
82-
// assignment : not in list
83-
{
84-
FakeStandardServerCluster other(2);
85-
ASSERT_FALSE(other.IsInList());
86-
87-
other = basic;
88-
ASSERT_FALSE(other.IsInList());
89-
}
90-
9176
// move constructor
9277
{
9378
FakeStandardServerCluster movable(2);
@@ -118,24 +103,6 @@ TEST(TestStandardServerCluster, TestAssignmentInList)
118103
basic.SetNextListItem(nullptr);
119104
ASSERT_TRUE(basic.IsInList());
120105

121-
// copy constructor: not in list
122-
{
123-
FakeStandardServerCluster other(basic);
124-
ASSERT_TRUE(other.IsInList());
125-
other.SetNotInList(); // ensure destruction is ok
126-
}
127-
128-
// assignment : not in list
129-
{
130-
FakeStandardServerCluster other(2);
131-
ASSERT_FALSE(other.IsInList());
132-
133-
other = basic;
134-
ASSERT_TRUE(other.IsInList());
135-
136-
other.SetNotInList(); // ensure destruction is ok
137-
}
138-
139106
// move constructor
140107
{
141108
FakeStandardServerCluster movable(2);

0 commit comments

Comments
 (0)