/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
#include <stdlib.h>
#include <stdint.h>
#include <dali/dali.h>
-#include <Ecore.h>
+#include <dali/internal/system/linux/dali-ecore.h>
#include <dali-test-suite-utils.h>
#include <adaptor-test-application.h>
END_TEST;
}
+int UtcDaliTimerSetInterval02(void)
+{
+ AdaptorTestApplication application;
+
+ tet_printf("timer set interval 02 \n");
+ Timer timer = Timer::New(10);
+ timer.SetInterval(20);
+
+ DALI_TEST_CHECK( timer.GetInterval() == 20 );
+ DALI_TEST_CHECK( timer.IsRunning() == true );
+
+ timer.SetInterval(5000, false);
+
+ DALI_TEST_CHECK( timer.GetInterval() == 5000 );
+ DALI_TEST_CHECK( timer.IsRunning() == false );
+
+ END_TEST;
+}
+
+int UtcDaliTimerSetInterval03(void)
+{
+ AdaptorTestApplication application;
+
+ tet_printf("UtcDaliTimerSetInterval03 SetInterval and ensure timer restarts \n");
+ Timer timer = Timer::New(10);
+ timer.SetInterval(20);
+
+ DALI_TEST_CHECK( timer.GetInterval() == 20 );
+ DALI_TEST_CHECK( timer.IsRunning() == true );
+
+ timer.SetInterval(5000, true);
+
+ DALI_TEST_CHECK( timer.GetInterval() == 5000 );
+ DALI_TEST_CHECK( timer.IsRunning() == true );
+
+ END_TEST;
+}
+
int UtcDaliTimerCopyConstructor(void)
{
AdaptorTestApplication application;
END_TEST;
}
+int UtcDaliTimerMoveConstructor(void)
+{
+ AdaptorTestApplication application;
+
+ Timer timer = Timer::New( 40 );
+ DALI_TEST_CHECK( timer );
+ DALI_TEST_EQUALS( 1, timer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( timer.GetInterval() == 40) ;
+
+ Timer moved = std::move( timer );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( moved.GetInterval() == 40 );
+ DALI_TEST_CHECK( !timer );
+
+ END_TEST;
+}
+
+int UtcDaliTimerMoveAssignmentr(void)
+{
+ AdaptorTestApplication application;
+
+ Timer timer = Timer::New( 40 );
+ DALI_TEST_CHECK( timer );
+ DALI_TEST_EQUALS( 1, timer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( timer.GetInterval() == 40) ;
+
+ Timer moved;
+ moved = std::move( timer );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( moved.GetInterval() == 40 );
+ DALI_TEST_CHECK( !timer );
+
+ END_TEST;
+}
+
int UtcDaliTimerIsRunning(void)
{
AdaptorTestApplication application;