return ostream;
}
+std::ostream& operator<<(std::ostream& ostream, BaseHandle handle)
+{
+ return ostream << static_cast<void*>(handle.GetObjectPtr());
+}
+
void DALI_TEST_EQUALS(const BaseHandle& baseHandle1, const BaseHandle& baseHandle2, const char* location)
{
DALI_TEST_EQUALS<const BaseHandle&>(baseHandle1, baseHandle2, location);
std::ostream& operator<<(std::ostream& ostream, TimePeriod value);
std::ostream& operator<<(std::ostream& ostream, Radian angle);
std::ostream& operator<<(std::ostream& ostream, Degree angle);
+std::ostream& operator<<(std::ostream& ostream, BaseHandle handle);
/**
* Test whether two values are equal.
<< " usageFlags:" << std::hex << createInfo.usageFlags
<< " data:" << std::hex << createInfo.data
<< " dataSize:" << std::dec << createInfo.dataSize
- << " nativeImagePtr:" << std::hex << createInfo.nativeImagePtr;
+ << " nativeImagePtr:" << std::hex << createInfo.nativeImagePtr.Get();
return o;
}
DALI_TEST_CHECK(view.GetLayoutCount() == 3);
// Check there is no active layout at the moment
- DALI_TEST_CHECK(view.GetActiveLayout() == NULL);
+ DALI_TEST_CHECK(!view.GetActiveLayout());
// Activate the depth layout
Vector3 stageSize(application.GetScene().GetSize());
view.AddLayout(*gridLayout);
// Check there is no active layout at the moment
- DALI_TEST_CHECK(view.GetActiveLayout() == NULL);
+ DALI_TEST_CHECK(!view.GetActiveLayout());
// Activate the grid layout
Vector3 stageSize(application.GetScene().GetSize());
view.DeactivateCurrentLayout();
// Check there is no active layout at the moment
- DALI_TEST_CHECK(view.GetActiveLayout() == NULL);
+ DALI_TEST_CHECK(!view.GetActiveLayout());
END_TEST;
}
{
PixelData pixelData = Toolkit::SyncImageLoader::Load( gImage_50_RGBA );
- DALI_TEST_EQUALS<bool>( pixelData, true, TEST_LOCATION );
+ DALI_TEST_CHECK( pixelData );
END_TEST;
}
END_TEST;
}
-
-
// load url.
context->RegisterRequestInterceptedCallback(&OnRequestIntercepted);
DALI_TEST_EQUALS(gRequestInterceptedCallbackCalled, 0, TEST_LOCATION);
- DALI_TEST_CHECK(gRequestInterceptorInstance == 0);
+ DALI_TEST_CHECK(!gRequestInterceptorInstance);
Test::EmitGlobalTimerSignal();
DALI_TEST_EQUALS( gRequestInterceptedCallbackCalled, 1, TEST_LOCATION );
// check request interceptor.
- DALI_TEST_CHECK(gRequestInterceptorInstance != 0);
+ DALI_TEST_CHECK(gRequestInterceptorInstance);
DALI_TEST_CHECK(gRequestInterceptorInstance->Ignore());
DALI_TEST_CHECK(gRequestInterceptorInstance->SetResponseStatus(400, "error"));
DALI_TEST_CHECK(gRequestInterceptorInstance->AddResponseHeader("key1", "value1"));
END_TEST;
}
-
class OptionalValue
{
public:
- typedef void (OptionalValue::*bool_type)() const;
typedef typename OptionalTypes<T>::ReturnType ReturnType;
typedef typename OptionalTypes<T>::ValueType ValueType;
return OptionalTypes<T>::Get(mValue);
}
- // safe bool idiom
- operator bool_type() const
+ explicit operator bool() const
{
- return mOk == true ? &OptionalValue::this_type_does_not_support_comparisons : 0;
+ return mOk;
}
private:
bool mOk;
ValueType mValue;
- void this_type_does_not_support_comparisons() const
- {
- }
};
template<typename T, typename U>
// Lock while adding task to the queue
ConditionalWait::ScopedLock lock(mConditionalWait);
wasEmpty = mRasterizeTasks.empty();
- if(!wasEmpty && task != NULL)
+ if(!wasEmpty && task)
{
// Remove the tasks with the same renderer.
// Older task which waiting to rasterize and apply the svg to the same renderer is expired.
bool Magnifier::GetFrameVisibility() const
{
- return mFrame;
+ return static_cast<bool>(mFrame);
}
void Magnifier::SetFrameVisibility(bool visible)
// Lock while adding task to the queue
ConditionalWait::ScopedLock lock(mConditionalWait);
wasEmpty = mRasterizeTasks.empty();
- if(!wasEmpty && task != NULL)
+ if(!wasEmpty && task)
{
// Remove the tasks with the same renderer.
// Older task which waiting to rasterize and apply the svg to the same renderer is expired.