// CLASS HEADER
#include "timer-impl.h"
+// INTERNAL INCLUDES
+#include <adaptor-impl.h>
+
// EXTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+
// Ecore is littered with C style cast
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
void Timer::Start()
{
+ // Timer should be used in the event thread
+ DALI_ASSERT_DEBUG( Adaptor::IsAvailable() );
+
if(mImpl->mId != NULL)
{
Stop();
void Timer::Stop()
{
+ // Timer should be used in the event thread
+ DALI_ASSERT_DEBUG( Adaptor::IsAvailable() );
+
if (mImpl->mId != NULL)
{
ecore_timer_del(mImpl->mId);
../dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp
../dali-adaptor/dali-test-suite-utils/test-render-controller.cpp
../dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp
+ ../dali-adaptor/dali-test-suite-utils/adaptor-test-adaptor-impl.cpp
)
PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
#include <Ecore.h>
#include <dali/dali.h>
#include <dali-test-suite-utils.h>
+#include <adaptor-test-application.h>
#include <tilt-sensor-impl.h>
using namespace Dali;
int UtcDaliTiltSensorStart(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorStart");
int UtcDaliTiltSensorStop(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorStop");
int UtcDaliTiltSensorIsStarted(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorIsStarted");
int UtcDaliTiltSensorGetRoll(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorGetRoll");
int UtcDaliTiltSensorGetPitch(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorGetPitch");
int UtcDaliTiltSensorGetRotation(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorGetRotation");
int UtcDaliTiltSensorSignalTilted(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorSignalTilted");
int UtcDaliTiltSensorSetUpdateFrequency(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorSetUpdateFrequency");
int UtcDaliTiltSensorSetRotationThreshold01(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorSetRotationThreshold01");
dali-test-suite-utils/test-platform-abstraction.cpp
dali-test-suite-utils/test-render-controller.cpp
dali-test-suite-utils/test-trace-call-stack.cpp
+ dali-test-suite-utils/adaptor-test-adaptor-impl.cpp
)
PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
--- /dev/null
+/*
+ * Copyright (c) 2017 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 "adaptor-test-adaptor-impl.h"
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+bool Adaptor::mAvailable = false;
+
+bool Adaptor::IsAvailable()
+{
+ return mAvailable;
+}
+
+void Adaptor::SetAvailable()
+{
+ mAvailable = true;
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_ADAPTOR_TEST_ADAPTOR_IMPL_H__
+#define __DALI_ADAPTOR_TEST_ADAPTOR_IMPL_H__
+
+/*
+ * Copyright (c) 2017 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.
+ *
+ */
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+class Adaptor
+{
+public:
+ static bool IsAvailable();
+ static void SetAvailable();
+
+ Adaptor() {}
+ ~Adaptor() {}
+
+public:
+ static bool mAvailable;
+};
+
+} // Adaptor
+
+} // Internal
+
+} // Dali
+
+#endif // __DALI_ADAPTOR_TEST_ADAPTOR_IMPL_H__
--- /dev/null
+#ifndef __DALI_ADAPTOR_TEST_APPLICATION_H__
+#define __DALI_ADAPTOR_TEST_APPLICATION_H__
+
+/*
+ * Copyright (c) 2017 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include "test-application.h"
+#include "adaptor-test-adaptor-impl.h"
+
+namespace Dali
+{
+
+/**
+ * Adds some functionality on top of TestApplication that is required by the Adaptor.
+ */
+class AdaptorTestApplication : public TestApplication
+{
+public:
+
+ AdaptorTestApplication( size_t surfaceWidth = DEFAULT_SURFACE_WIDTH,
+ size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
+ float horizontalDpi = DEFAULT_HORIZONTAL_DPI,
+ float verticalDpi = DEFAULT_VERTICAL_DPI )
+ : TestApplication( false, surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi )
+ {
+ Initialize();
+
+ Internal::Adaptor::Adaptor::SetAvailable();
+ }
+
+ ~AdaptorTestApplication()
+ {
+ }
+};
+
+} // namespace Dali
+
+#endif // __DALI_ADAPTOR_TEST_APPLICATION_H__
#include <dali/dali.h>
#include <Ecore.h>
#include <dali-test-suite-utils.h>
+#include <adaptor-test-application.h>
using namespace Dali;
// Positive test case for a method
int UtcDaliTimerCreation(void)
{
- // TestApplication application;
+ AdaptorTestApplication application;
+
tet_printf("timer creation \n");
Timer timer = Timer::New(300);
int UtcDaliTimerUnitializedStart(void)
{
+ AdaptorTestApplication application;
+
tet_printf("unintialized timer start \n");
Timer *timer = new Timer;
int UtcDaliTimerUnitializedStop(void)
{
+ AdaptorTestApplication application;
+
tet_printf("unintialized timer stop \n");
Timer *timer = new Timer;
int UtcDaliTimerUnitializedGetInterval(void)
{
+ AdaptorTestApplication application;
+
tet_printf("unintialized get interval \n");
Timer *timer = new Timer;
int UtcDaliTimerUnitializedSetInterval(void)
{
+ AdaptorTestApplication application;
+
tet_printf("unintialized set interval \n");
Timer *timer = new Timer;
int UtcDaliTimerUnitializedIsRunning(void)
{
+ AdaptorTestApplication application;
+
tet_printf("unintialized is running \n");
Timer *timer = new Timer;
int UtcDaliTimerUnitializedSignalTick(void)
{
+ AdaptorTestApplication application;
+
tet_printf("unintialized SignalTick \n");
Timer *timer = new Timer;
int UtcDaliTimerSetInterval(void)
{
+ AdaptorTestApplication application;
+
tet_printf("timer set interval \n");
Timer timer = Timer::New(10);
int UtcDaliTimerCopyConstructor(void)
{
+ AdaptorTestApplication application;
+
tet_printf("timer copy constructor \n");
Timer timer = Timer::New(10);
int UtcDaliTimerAssignmentOperator(void)
{
+ AdaptorTestApplication application;
+
tet_printf("assignmnet constructor \n");
Timer timer = Timer::New(10);
int UtcDaliTimerIsRunning(void)
{
+ AdaptorTestApplication application;
+
tet_printf("timer is running \n");
Timer timer = Timer::New(100);
int UtcDaliTimerSignalTickContinue(void)
{
+ AdaptorTestApplication application;
+
tet_printf("timer call back\n");
Timer timer = Timer::New(100);
int UtcDaliTimerSignalTickStop(void)
{
+ AdaptorTestApplication application;
+
Timer timer = Timer::New(100);
TimerTestClass testClass(false);
int UtcDaliTimerReset(void)
{
+ AdaptorTestApplication application;
+
Timer timer = Timer::New(100);
DALI_TEST_CHECK(timer);
int UtcDaliTimerDownCastP(void)
{
+ AdaptorTestApplication application;
+
Timer timer = Timer::New(100);
Timer cast = Timer::DownCast( timer );
int UtcDaliTimerDownCastN(void)
{
+ AdaptorTestApplication application;
+
Timer timer;
Timer cast = Timer::DownCast( timer );
../dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp
../dali-adaptor/dali-test-suite-utils/test-render-controller.cpp
../dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp
+ ../dali-adaptor/dali-test-suite-utils/adaptor-test-adaptor-impl.cpp
tct-dali-platform-abstraction-core.cpp
utc-image-loading-common.cpp
)