/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
*/
virtual Actor NewItem(unsigned int itemId)
{
- // Create an image actor for this item
+ // Create a renderable actor for this item
Image image = ResourceImage::New( TEST_IMAGE_FILE_NAME );
- Actor actor = ImageActor::New(image);
+ Actor actor = CreateRenderableActor(image);
return actor;
}
DALI_TEST_CHECK(flickSpeedFactor != 0.0f);
+ // White box test here: -( itemId / NoOfItemsPerRow(default 4) ) * NoOfItemsPerRow
+ DALI_TEST_EQUALS( -1.0f, gridLayout->GetItemScrollToPosition( 1 ), TEST_LOCATION );
+
ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
view.AddLayout(*depthLayout);
END_TEST;
}
+int UtcDaliItemRangeIntersection(void)
+{
+ ToolkitTestApplication application;
+
+ unsigned int uBeginItemFirst = 100u, uEndItemFirst = 300u;
+ unsigned int uBeginItemSecond = 290u, uEndItemSecond = 400;
+ unsigned int uInterBeginCheck=290u , uInterEndCheck=301u;
+ bool bIsInThisRange = false, bOutOfThisRange = false;
+
+ Toolkit::ItemRange objItemRangeFirst(uBeginItemFirst, uEndItemFirst);
+ Toolkit::ItemRange objItemRangeSecond(uBeginItemSecond, uEndItemSecond);
+ ItemRange itmInterSect = objItemRangeFirst.Intersection(objItemRangeSecond);
+
+ bIsInThisRange = itmInterSect.Within(uInterBeginCheck);
+ DALI_TEST_EQUALS(bIsInThisRange, true, TEST_LOCATION );
+
+ bOutOfThisRange = itmInterSect.Within(uInterEndCheck);
+ DALI_TEST_EQUALS(bOutOfThisRange, false, TEST_LOCATION );
+
+ END_TEST;
+}