/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
class FakeObject : public BaseObject
{
};
-// used for testing ThisIsSaferThanReturningVoidStar
-class FakeHandle : public BaseHandle
-{
-public:
- void RunTest()
- {
- return ThisIsSaferThanReturningVoidStar();
- }
-};
} // namespace
int UtcDaliBaseHandleConstructorVoid(void)
END_TEST;
}
+int UtcDaliBaseHandleInequalityWithNullptr(void)
+{
+ TestApplication application;
+ tet_infoline("Test for Dali::BaseHandle::operator == nullptr");
+
+ BaseHandle object;
+
+ // object is nullptr.
+ DALI_TEST_CHECK(object == nullptr);
+ DALI_TEST_CHECK(nullptr == object);
+ DALI_TEST_CHECK(!(object != nullptr));
+ DALI_TEST_CHECK(!(nullptr != object));
+
+ object = Actor::New();
+
+ // object is not nullptr.
+ DALI_TEST_CHECK(!(object == nullptr));
+ DALI_TEST_CHECK(!(nullptr == object));
+ DALI_TEST_CHECK(object != nullptr);
+ DALI_TEST_CHECK(nullptr != object);
+
+ END_TEST;
+}
+
int UtcDaliBaseHandleStlVector(void)
{
TestApplication application;
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;
int UtcDaliBaseHandleBooleanCast(void)
{
TestApplication application;
- tet_infoline("Testing Dali::BaseHandle::BooleanType");
+ tet_infoline("Testing Dali::BaseHandle::operator bool");
// get the root layer
BaseHandle handle = Actor::New();
- DALI_TEST_CHECK(static_cast<BaseHandle::BooleanType>(handle));
+ DALI_TEST_CHECK(static_cast<bool>(handle));
END_TEST;
}