Merge "Add SwitchParent api in actor-devel" into devel/master
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Mutex.cpp
index edbd1cc..dfca24e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
 
 #include <iostream>
 #include <type_traits>
+#include <utility>
 
 using Dali::Mutex;
 using Dali::Thread;
@@ -49,6 +50,20 @@ int UtcDaliMutexSingleThread(void)
   }
   DALI_TEST_EQUALS(false, mutex3.IsLocked(), TEST_LOCATION);
 
+  {
+    Mutex             mutex4;
+    Mutex             mutex5(std::move(mutex4)); // move constructor
+    Mutex::ScopedLock lock(mutex5);
+    DALI_TEST_EQUALS(true, mutex5.IsLocked(), TEST_LOCATION);
+  }
+
+  {
+    Mutex mutex4, mutex5;
+    mutex5 = std::move(mutex4); // move assignment
+    Mutex::ScopedLock lock(mutex5);
+    DALI_TEST_EQUALS(true, mutex5.IsLocked(), TEST_LOCATION);
+  }
+
   END_TEST;
 }