From 6e4652ea80c29c6b0c198882138749df6269af8c Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Fri, 22 May 2015 18:40:09 +0100 Subject: [PATCH] (AutomatedTests) Added Application & Timer tests Change-Id: I1a1ebfca2187178f125904a834c2b91d147117b6 --- .../src/dali-adaptor/utc-Dali-Application.cpp | 122 +++++++++++++++++++++ .../src/dali-adaptor/utc-Dali-Timer.cpp | 20 ++++ 2 files changed, 142 insertions(+) diff --git a/automated-tests/src/dali-adaptor/utc-Dali-Application.cpp b/automated-tests/src/dali-adaptor/utc-Dali-Application.cpp index 3a66950..4594de6 100644 --- a/automated-tests/src/dali-adaptor/utc-Dali-Application.cpp +++ b/automated-tests/src/dali-adaptor/utc-Dali-Application.cpp @@ -57,7 +57,16 @@ struct MyTestApp : public ConnectionTracker Application& application; }; +void ApplicationSignalCallback( Application& app ) +{ +} + +void ApplicationControlSignalCallback(Application&, void *) +{ +} + } // unnamed namespace + int UtcDaliApplicationNew(void) { Application application = Application::New(); @@ -68,3 +77,116 @@ int UtcDaliApplicationNew(void) END_TEST; } + +int UtcDaliApplicationCopyAndAssignment(void) +{ + Application application = Application::New(); + Application copy( application ); + DALI_TEST_CHECK( copy == application ); + + Application assigned; + DALI_TEST_CHECK( !assigned ); + assigned = application; + DALI_TEST_CHECK( copy == assigned ); + + END_TEST; +} + +int UtcDaliApplicationInitSignal(void) +{ + Application application = Application::New(); + application.InitSignal().Connect( &ApplicationSignalCallback ); + DALI_TEST_CHECK( application ); + + END_TEST; +} + +int UtcDaliApplicationTerminateSignal(void) +{ + Application application = Application::New(); + application.TerminateSignal().Connect( &ApplicationSignalCallback ); + DALI_TEST_CHECK( application ); + + END_TEST; +} + +int UtcDaliApplicationPauseSignal(void) +{ + Application application = Application::New(); + application.PauseSignal().Connect( &ApplicationSignalCallback ); + DALI_TEST_CHECK( application ); + + END_TEST; +} + +int UtcDaliApplicationResumeSignal(void) +{ + Application application = Application::New(); + application.ResumeSignal().Connect( &ApplicationSignalCallback ); + DALI_TEST_CHECK( application ); + + END_TEST; +} + +int UtcDaliApplicationResetSignal(void) +{ + Application application = Application::New(); + application.ResetSignal().Connect( &ApplicationSignalCallback ); + DALI_TEST_CHECK( application ); + + END_TEST; +} + +int UtcDaliApplicationResizeSignal(void) +{ + Application application = Application::New(); + application.ResizeSignal().Connect( &ApplicationSignalCallback ); + DALI_TEST_CHECK( application ); + + END_TEST; +} + +int UtcDaliApplicationlControlSignal(void) +{ + Application application = Application::New(); + application.AppControlSignal().Connect( &ApplicationControlSignalCallback ); + DALI_TEST_CHECK( application ); + + END_TEST; +} + +int UtcDaliApplicationLanguageChangedSignal(void) +{ + Application application = Application::New(); + application.LanguageChangedSignal().Connect( &ApplicationSignalCallback ); + DALI_TEST_CHECK( application ); + + END_TEST; +} + +int UtcDaliApplicationRegionChangedSignal(void) +{ + Application application = Application::New(); + application.RegionChangedSignal().Connect( &ApplicationSignalCallback ); + DALI_TEST_CHECK( application ); + + END_TEST; +} + +int UtcDaliApplicationBatteryLowSignal(void) +{ + Application application = Application::New(); + application.BatteryLowSignal().Connect( &ApplicationSignalCallback ); + DALI_TEST_CHECK( application ); + + END_TEST; +} + +int UtcDaliApplicationMemoryLowSignal(void) +{ + Application application = Application::New(); + application.MemoryLowSignal().Connect( &ApplicationSignalCallback ); + DALI_TEST_CHECK( application ); + + END_TEST; +} diff --git a/automated-tests/src/dali-adaptor/utc-Dali-Timer.cpp b/automated-tests/src/dali-adaptor/utc-Dali-Timer.cpp index 4a57090..ecd4638 100644 --- a/automated-tests/src/dali-adaptor/utc-Dali-Timer.cpp +++ b/automated-tests/src/dali-adaptor/utc-Dali-Timer.cpp @@ -355,3 +355,23 @@ int UtcDaliTimerReset(void) END_TEST; } + +int UtcDaliTimerDownCastP(void) +{ + Timer timer = Timer::New(100); + Timer cast = Timer::DownCast( timer ); + + DALI_TEST_CHECK( cast ); + + END_TEST; +} + +int UtcDaliTimerDownCastN(void) +{ + Timer timer; + Timer cast = Timer::DownCast( timer ); + + DALI_TEST_CHECK( ! cast ); + + END_TEST; +} -- 2.7.4