-//
-// 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 <dali/dali.h>
+#include <dali/public-api/dali-core.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include "dali-test-suite-utils/dali-test-suite-utils.h"
}
};
+// Used for testing BaseObject::GetTypeName with an object that is not registered
+class FakeObject : public BaseObject
+{
+};
+// used for testing ThisIsSaferThanReturningVoidStar
+class FakeHandle : public BaseHandle
+{
+public:
+
+ void RunTest()
+ {
+ return ThisIsSaferThanReturningVoidStar();
+ }
+};
} // anon namespace
int UtcDaliBaseHandleConstructorVoid(void)
DALI_TEST_CHECK(actorObject);
// Check that an invalid command is not performed
- std::vector<Property::Value> attributes;
+ Property::Map attributes;
DALI_TEST_CHECK(actorObject.DoAction("invalidCommand", attributes) == false);
// Check that the actor is visible
DALI_TEST_EQUALS(animation.GetDuration(), durationSeconds, TEST_LOCATION);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Set the new duration to be 2 seconds
float newDurationSeconds(2.0f);
Property::Value newDurationSecondsValue = Property::Value( newDurationSeconds );
- attributes.push_back(newDurationSecondsValue);
+ attributes["duration"] = newDurationSecondsValue;
// Check the animation performed an action to play itself with the specified duration of 2 seconds
animationObject.DoAction("play", attributes);
END_TEST;
}
-int UtcDaliBaseHandleGetTypeName(void)
+int UtcDaliBaseHandleGetTypeNameP(void)
{
TestApplication application;
tet_infoline("Testing Dali::BaseHandle::GetTypeName");
END_TEST;
}
+int UtcDaliBaseHandleGetTypeNameN(void)
+{
+
+ TestApplication application;
+ tet_infoline("Testing Dali::BaseObject::GetTypeName");
+ FakeObject object;
+ std::string typeName = object.GetTypeName();
+
+ DALI_TEST_CHECK( typeName.empty() );
+ END_TEST;
+}
+
+int UtcDaliBaseHandleGetTypeInfoP(void)
+{
+ TestApplication application;
+ tet_infoline("Testing Dali::BaseHandle::GetTypeInfo");
+
+ Dali::TypeInfo info;
+ Actor actor = Actor::New();
+
+ bool ok = actor.GetTypeInfo( info );
+ DALI_TEST_CHECK( ok );
+ END_TEST;
+}
+
+int UtcDaliBaseHandleThisIsSaferThanReturningVoidStar(void)
+{
+ TestApplication application;
+ tet_infoline("Testing Dali::BaseHandle::GetTypeInfo");
+ FakeHandle handle;
+ handle.RunTest();
+ tet_result(TET_PASS);
+ END_TEST;
+
+}
+
+int UtcDaliBaseHandleGetTypeInfoN(void)
+{
+ TestApplication application;
+ tet_infoline("Testing Dali::BaseHandle::GetTypeInfo");
+
+ Dali::TypeInfo info;
+ FakeObject object;
+
+ bool ok = object.GetTypeInfo( info );
+ DALI_TEST_CHECK( !ok );
+ END_TEST;
+}
+
int UtcDaliBaseHandleGetObjectPtr(void)
{
TestApplication application;