BufferImage Usage Removal
[platform/core/uifw/dali-adaptor.git] / automated-tests / src / dali-adaptor-internal / utc-Dali-CommandLineOptions.cpp
index a0da215..f9a9404 100644 (file)
@@ -1,25 +1,26 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <iostream>
 
 #include <stdlib.h>
 #include <getopt.h>
 #include <dali/dali.h>
-#include <internal/command-line-options.h>
+#include <dali/internal/system/common/command-line-options.h>
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
@@ -30,7 +31,7 @@ using namespace Dali::Internal::Adaptor;
 void command_line_options_startup(void)
 {
   test_return_value = TET_UNDEF;
-  optind = 1; // Reset opt for test
+  optind = 0; // Reset opt for test
 }
 
 // Called only once after last test is run
@@ -39,15 +40,9 @@ void command_line_options_cleanup(void)
   test_return_value = TET_PASS;
 }
 
-namespace
-{
-int gOriginalOptIndValue(0);
-}
-
-
 int UtcDaliCommandLineOptionsNoArgs(void)
 {
-  optind=1;
+  optind=0;
 
   int argc( 1 );
   const char* argList[1] = { "program" };
@@ -58,7 +53,6 @@ int UtcDaliCommandLineOptionsNoArgs(void)
   DALI_TEST_EQUALS( argc, 1, TEST_LOCATION );
 
   // Check values
-  DALI_TEST_EQUALS( options.noVSyncOnRender, 0, TEST_LOCATION );
   DALI_TEST_EQUALS( options.stageWidth, 0, TEST_LOCATION );
   DALI_TEST_EQUALS( options.stageHeight, 0, TEST_LOCATION );
   DALI_TEST_EQUALS( options.stageDPI, "", TEST_LOCATION );
@@ -68,7 +62,7 @@ int UtcDaliCommandLineOptionsNoArgs(void)
 
 int UtcDaliCommandLineOptionsDaliShortArgs(void)
 {
-  optind=1;
+  optind=0;
 
   const char* argList[] =
   {
@@ -86,7 +80,6 @@ int UtcDaliCommandLineOptionsDaliShortArgs(void)
   DALI_TEST_EQUALS( argc, 1, TEST_LOCATION );
 
   // Check values
-  DALI_TEST_EQUALS( options.noVSyncOnRender, 0, TEST_LOCATION );
   DALI_TEST_EQUALS( options.stageWidth, 800, TEST_LOCATION );
   DALI_TEST_EQUALS( options.stageHeight, 1000, TEST_LOCATION );
   DALI_TEST_EQUALS( options.stageDPI, "4x5", TEST_LOCATION );
@@ -96,7 +89,7 @@ int UtcDaliCommandLineOptionsDaliShortArgs(void)
 
 int UtcDaliCommandLineOptionsDaliLongArgsEqualsSign(void)
 {
-  optind=1;
+  optind=0;
 
   const char* argList[] =
   {
@@ -104,7 +97,6 @@ int UtcDaliCommandLineOptionsDaliLongArgsEqualsSign(void)
       "--width=800",
       "--height=1000",
       "--dpi=3x4",
-      "--no-vsync",
       "--help"
   };
   int argc( sizeof( argList ) / sizeof( argList[0] ) );
@@ -116,7 +108,6 @@ int UtcDaliCommandLineOptionsDaliLongArgsEqualsSign(void)
   DALI_TEST_EQUALS( argc, 1, TEST_LOCATION );
 
   // Check values
-  DALI_TEST_EQUALS( options.noVSyncOnRender, 1, TEST_LOCATION );
   DALI_TEST_EQUALS( options.stageWidth, 800, TEST_LOCATION );
   DALI_TEST_EQUALS( options.stageHeight, 1000, TEST_LOCATION );
   DALI_TEST_EQUALS( options.stageDPI, "3x4", TEST_LOCATION );
@@ -126,7 +117,7 @@ int UtcDaliCommandLineOptionsDaliLongArgsEqualsSign(void)
 
 int UtcDaliCommandLineOptionsDaliLongArgsSpaces(void)
 {
-  optind=1;
+  optind=0;
 
   const char* argList[] =
   {
@@ -134,7 +125,6 @@ int UtcDaliCommandLineOptionsDaliLongArgsSpaces(void)
       "--width", "800",
       "--height", "1000",
       "--dpi", "3x4",
-      "--no-vsync",
       "--help"
   };
   int argc( sizeof( argList ) / sizeof( argList[0] ) );
@@ -146,7 +136,6 @@ int UtcDaliCommandLineOptionsDaliLongArgsSpaces(void)
   DALI_TEST_EQUALS( argc, 1, TEST_LOCATION );
 
   // Check values
-  DALI_TEST_EQUALS( options.noVSyncOnRender, 1, TEST_LOCATION );
   DALI_TEST_EQUALS( options.stageWidth, 800, TEST_LOCATION );
   DALI_TEST_EQUALS( options.stageHeight, 1000, TEST_LOCATION );
   DALI_TEST_EQUALS( options.stageDPI, "3x4", TEST_LOCATION );
@@ -156,7 +145,7 @@ int UtcDaliCommandLineOptionsDaliLongArgsSpaces(void)
 
 int UtcDaliCommandLineOptionsNonDaliArgs(void)
 {
-  optind=1;
+  optind=0;
 
   const char* argList[] =
   {
@@ -183,9 +172,9 @@ int UtcDaliCommandLineOptionsNonDaliArgs(void)
 
 int UtcDaliCommandLineOptionsMixture(void)
 {
-  optind = 1; // Reset opt for test
+  optind = 0; // Reset opt for test
 
-  char* argList[] =
+  const char* argList[] =
   {
     "program",
     "--width=800",
@@ -195,7 +184,7 @@ int UtcDaliCommandLineOptionsMixture(void)
     "-r",
   };
   int argc( sizeof( argList ) / sizeof( argList[0] ) );
-  char** argv = argList;
+  char** argv = const_cast<char**>( argList );
 
   CommandLineOptions options( &argc, &argv );
 
@@ -214,9 +203,9 @@ int UtcDaliCommandLineOptionsMixture(void)
 
 int UtcDaliCommandLineOptionsMixtureDaliOpsAtStart(void)
 {
-  optind=1;
+  optind=0;
 
-  char* argList[] =
+  const char* argList[] =
   {
       "program",
       "--width=800",
@@ -226,7 +215,7 @@ int UtcDaliCommandLineOptionsMixtureDaliOpsAtStart(void)
       "-y", "600",
   };
   int argc( sizeof( argList ) / sizeof( argList[0] ) );
-  char** argv = argList;
+  char** argv = const_cast<char**>( argList );
 
   CommandLineOptions options( &argc, &argv );
 
@@ -245,9 +234,9 @@ int UtcDaliCommandLineOptionsMixtureDaliOpsAtStart(void)
 
 int UtcDaliCommandLineOptionsMixtureDaliOpsAtEnd(void)
 {
-  optind=1;
+  optind=0;
 
-  char* argList[] =
+  const char* argList[] =
   {
       "program",
       "hello-world",
@@ -257,7 +246,7 @@ int UtcDaliCommandLineOptionsMixtureDaliOpsAtEnd(void)
       "--height", "1000",
   };
   int argc( sizeof( argList ) / sizeof( argList[0] ) );
-  char** argv = argList;
+  char** argv = const_cast<char**>( argList );
 
   CommandLineOptions options( &argc, &argv );