tizen 2.4 release
[framework/web/wrt-commons.git] / tests / core / test_zip_input.cpp
index c62accb..7059655 100644 (file)
  * @version     1.0
  * @brief       This file is the implementation file of zip input tests
  */
+#include <memory>
 #include <dpl/test/test_runner.h>
 #include <dpl/zip_input.h>
 #include <dpl/foreach.h>
 #include <dpl/abstract_waitable_input_adapter.h>
 #include <dpl/abstract_waitable_output_adapter.h>
 #include <dpl/binary_queue.h>
-#include <dpl/scoped_array.h>
 #include <dpl/copy.h>
-#include <dpl/log/log.h>
+#include <dpl/log/wrt_log.h>
 
 namespace {
 const char* PATH_NO_FILE = "/opt/share/wrt/wrt-commons/tests/core/no_such_file";
@@ -70,14 +70,12 @@ RUNNER_TEST(ZipInput_OpenFile)
 
     FOREACH(iter, zip)
     {
-        LogDebug("---------");
-        LogDebug("FileInfo: ");
-#define FIELD(X) LogDebug(#X ": " << iter->X)
-        FIELD(name);
-        FIELD(comment);
-        FIELD(compressedSize);
-        FIELD(uncompressedSize);
-#undef  FIELD
+        WrtLogD("---------");
+        WrtLogD("FileInfo: ");
+        WrtLogD("name: %s", iter->name.c_str());
+        WrtLogD("comment: %s", iter->comment.c_str());
+        WrtLogD("compressedSize: %lli", iter->compressedSize);
+        WrtLogD("uncompressedSize: %lli", iter->uncompressedSize);
     }
 }
 
@@ -96,9 +94,9 @@ RUNNER_TEST(ZipInput_UnzipSingleFile)
 
     DPL::Copy(&fileAdapter, &bufferAdapter);
 
-    DPL::ScopedArray<char> data(new char[buffer.Size() + 1]);
-    buffer.Flatten(data.Get(), buffer.Size());
+    std::unique_ptr<char[]> data(new char[buffer.Size() + 1]);
+    buffer.Flatten(data.get(), buffer.Size());
     data[buffer.Size()] = '\0';
 
-    RUNNER_ASSERT(std::string(data.Get()) == "test");
+    RUNNER_ASSERT(std::string(data.get()) == "test");
 }