tizen 2.4 release
[framework/web/wrt-commons.git] / tests / utils / path_tests.cpp
index e612ad7..02b1fa3 100644 (file)
 
 #include <dpl/test/test_runner.h>
 #include <dpl/scoped_dir.h>
-#include <dpl/scoped_free.h>
 #include <dpl/utils/path.h>
 #include <dpl/foreach.h>
-#include <dpl/log/log.h>
+#include <dpl/log/wrt_log.h>
 #include <dpl/binary_queue.h>
 #include <dpl/file_input.h>
 #include <dpl/file_output.h>
@@ -235,7 +234,7 @@ Expected: success full constrution
 */
 RUNNER_TEST(path_construction_1)
 {
-    DPL::ScopedFree<char> sf(getcwd(NULL, 0));
+   std::unique_ptr<char> sf(getcwd(NULL, 0));
 
     Path path1(std::string("/test/bin/file"));
     RUNNER_ASSERT(path1.Fullpath() == "/test/bin/file");
@@ -250,8 +249,8 @@ Expected: success full constrution
 */
 RUNNER_TEST(path_construction_2)
 {
-    DPL::ScopedFree<char> sf(getcwd(NULL, 0));
-    std::string cwd(sf.Get());
+   std::unique_ptr<char> sf(getcwd(NULL, 0));
+    std::string cwd(sf.get());
 
     if("/" == cwd)
         cwd = "";
@@ -269,8 +268,8 @@ Expected: success full constrution
 */
 RUNNER_TEST(path_construction_3)
 {
-    DPL::ScopedFree<char> sf(getcwd(NULL, 0));
-    std::string cwd(sf.Get());
+   std::unique_ptr<char> sf(getcwd(NULL, 0));
+    std::string cwd(sf.get());
 
     if("/" == cwd)
         cwd = "";
@@ -288,7 +287,7 @@ Expected: success full constrution
 */
 RUNNER_TEST(path_construction_4)
 {
-    DPL::ScopedFree<char> sf(getcwd(NULL, 0));
+   std::unique_ptr<char> sf(getcwd(NULL, 0));
 
     Path path4("/test/bin/abc");
     RUNNER_ASSERT(path4.Fullpath() == "/test/bin/abc");
@@ -303,8 +302,8 @@ Expected: success full constrution
 */
 RUNNER_TEST(path_construction_5)
 {
-    DPL::ScopedFree<char> sf(getcwd(NULL, 0));
-    std::string cwd(sf.Get());
+   std::unique_ptr<char> sf(getcwd(NULL, 0));
+    std::string cwd(sf.get());
 
     if("/" == cwd)
         cwd = "";
@@ -322,7 +321,7 @@ Expected: success full constrution
 */
 RUNNER_TEST(path_construction_6)
 {
-    DPL::ScopedFree<char> sf(getcwd(NULL, 0));
+   std::unique_ptr<char> sf(getcwd(NULL, 0));
 
     Path path6(DPL::String(L"/test/bin/file"));
     RUNNER_ASSERT(path6.Fullpath() == "/test/bin/file");
@@ -337,8 +336,8 @@ Expected: success full constrution
 */
 RUNNER_TEST(path_construction_7)
 {
-    DPL::ScopedFree<char> sf(getcwd(NULL, 0));
-    std::string cwd(sf.Get());
+   std::unique_ptr<char> sf(getcwd(NULL, 0));
+    std::string cwd(sf.get());
 
     if("/" == cwd)
         cwd = "";
@@ -356,7 +355,7 @@ Expected: success full constrution
 */
 RUNNER_TEST(path_construction_8)
 {
-    DPL::ScopedFree<char> sf(getcwd(NULL, 0));
+   std::unique_ptr<char> sf(getcwd(NULL, 0));
 
     Path path8 = Path("/test/bin/") / "123" / "dir1.dll";
     RUNNER_ASSERT(path8.Fullpath() == "/test/bin/123/dir1.dll");
@@ -371,7 +370,7 @@ Expected: success full constrution
 */
 RUNNER_TEST(path_construction_9)
 {
-    DPL::ScopedFree<char> sf(getcwd(NULL, 0));
+   std::unique_ptr<char> sf(getcwd(NULL, 0));
 
     Path path9 = Path("/test/bin/file.txt//");
     RUNNER_ASSERT(path9.Fullpath() == "/test/bin/file.txt");
@@ -790,13 +789,13 @@ RUNNER_TEST(path_iterate_empty_directory)
         FOREACH(file, dirTest)
         {
             passed = false;
-            LogError("Directory should be empty");
+            WrtLogE("Directory should be empty");
         }
     }
     Catch(Path::NotDirectory)
     {
         passed = false;
-        LogError("Directory should exists");
+        WrtLogE("Directory should exists");
     }
     RUNNER_ASSERT(passed);
 }