• Home
  • Raw
  • Download

Lines Matching refs:MoveOnly

218 struct MoveOnly {  struct
223 explicit MoveOnly(int val) : val(val) { in MoveOnly() argument
225 MoveOnly(MoveOnly&& other) { in MoveOnly() function
229 MoveOnly &operator=(MoveOnly&& other) { in operator =() argument
234 ~MoveOnly() { in ~MoveOnly() argument
244 unsigned MoveOnly::MoveConstructions = 0;
245 unsigned MoveOnly::Destructions = 0;
246 unsigned MoveOnly::MoveAssignments = 0;
249 MoveOnly::ResetCounts(); in TEST_F()
250 Optional<MoveOnly> O; in TEST_F()
251 EXPECT_EQ(0u, MoveOnly::MoveConstructions); in TEST_F()
252 EXPECT_EQ(0u, MoveOnly::MoveAssignments); in TEST_F()
253 EXPECT_EQ(0u, MoveOnly::Destructions); in TEST_F()
257 MoveOnly::ResetCounts(); in TEST_F()
258 Optional<MoveOnly> O(MoveOnly(3)); in TEST_F()
261 EXPECT_EQ(1u, MoveOnly::MoveConstructions); in TEST_F()
262 EXPECT_EQ(0u, MoveOnly::MoveAssignments); in TEST_F()
263 EXPECT_EQ(1u, MoveOnly::Destructions); in TEST_F()
267 Optional<MoveOnly> A(MoveOnly(3)); in TEST_F()
268 MoveOnly::ResetCounts(); in TEST_F()
269 Optional<MoveOnly> B(std::move(A)); in TEST_F()
273 EXPECT_EQ(1u, MoveOnly::MoveConstructions); in TEST_F()
274 EXPECT_EQ(0u, MoveOnly::MoveAssignments); in TEST_F()
275 EXPECT_EQ(1u, MoveOnly::Destructions); in TEST_F()
279 MoveOnly::ResetCounts(); in TEST_F()
280 Optional<MoveOnly> O; in TEST_F()
281 O = MoveOnly(3); in TEST_F()
284 EXPECT_EQ(1u, MoveOnly::MoveConstructions); in TEST_F()
285 EXPECT_EQ(0u, MoveOnly::MoveAssignments); in TEST_F()
286 EXPECT_EQ(1u, MoveOnly::Destructions); in TEST_F()
290 Optional<MoveOnly> A(MoveOnly(3)); in TEST_F()
291 Optional<MoveOnly> B; in TEST_F()
292 MoveOnly::ResetCounts(); in TEST_F()
297 EXPECT_EQ(1u, MoveOnly::MoveConstructions); in TEST_F()
298 EXPECT_EQ(0u, MoveOnly::MoveAssignments); in TEST_F()
299 EXPECT_EQ(1u, MoveOnly::Destructions); in TEST_F()
303 Optional<MoveOnly> A; in TEST_F()
304 Optional<MoveOnly> B(MoveOnly(3)); in TEST_F()
305 MoveOnly::ResetCounts(); in TEST_F()
309 EXPECT_EQ(0u, MoveOnly::MoveConstructions); in TEST_F()
310 EXPECT_EQ(0u, MoveOnly::MoveAssignments); in TEST_F()
311 EXPECT_EQ(1u, MoveOnly::Destructions); in TEST_F()
315 Optional<MoveOnly> A(MoveOnly(3)); in TEST_F()
316 Optional<MoveOnly> B(MoveOnly(4)); in TEST_F()
317 MoveOnly::ResetCounts(); in TEST_F()
322 EXPECT_EQ(0u, MoveOnly::MoveConstructions); in TEST_F()
323 EXPECT_EQ(1u, MoveOnly::MoveAssignments); in TEST_F()
324 EXPECT_EQ(1u, MoveOnly::Destructions); in TEST_F()
362 Optional<MoveOnly> A; in TEST_F()
364 MoveOnly::ResetCounts(); in TEST_F()
365 EXPECT_EQ(42, std::move(A).getValueOr(MoveOnly(42)).val); in TEST_F()
366 EXPECT_EQ(1u, MoveOnly::MoveConstructions); in TEST_F()
367 EXPECT_EQ(0u, MoveOnly::MoveAssignments); in TEST_F()
368 EXPECT_EQ(2u, MoveOnly::Destructions); in TEST_F()
370 A = MoveOnly(5); in TEST_F()
371 MoveOnly::ResetCounts(); in TEST_F()
372 EXPECT_EQ(5, std::move(A).getValueOr(MoveOnly(42)).val); in TEST_F()
373 EXPECT_EQ(1u, MoveOnly::MoveConstructions); in TEST_F()
374 EXPECT_EQ(0u, MoveOnly::MoveAssignments); in TEST_F()
375 EXPECT_EQ(2u, MoveOnly::Destructions); in TEST_F()