detector.Attach(actor);
- std::vector<Actor> actors = detector.GetAttachedActors();
-
- if (find(actors.begin(), actors.end(), actor) != actors.end())
+ bool found = false;
+ for(size_t i = 0; i < detector.GetAttachedActorCount(); i++)
{
- tet_result(TET_PASS);
+ if( detector.GetAttachedActor(i) == actor )
+ {
+ tet_result(TET_PASS);
+ found = true;
+ }
}
- else
+
+ if(!found)
{
tet_result(TET_FAIL);
}
Actor actor = Actor::New();
detector.Attach(actor);
- std::vector<Actor> actors = detector.GetAttachedActors();
- if (find(actors.begin(), actors.end(), actor) != actors.end())
+ bool found = false;
+ for(size_t i = 0; i < detector.GetAttachedActorCount(); i++)
{
- tet_result(TET_PASS);
+ if( detector.GetAttachedActor(i) == actor )
+ {
+ tet_result(TET_PASS);
+ found = true;
+ }
}
- else
+
+ if(!found)
{
tet_result(TET_FAIL);
}
// Detach and retrieve attached actors again, the vector should be empty.
detector.Detach(actor);
- actors = detector.GetAttachedActors();
- if (actors.empty())
+ found = false;
+ for(size_t i = 0; i < detector.GetAttachedActorCount(); i++)
{
- tet_result(TET_PASS);
+ if( detector.GetAttachedActor(i) == actor )
+ {
+ found = true;
+ }
}
- else
+
+ if(found)
{
tet_result(TET_FAIL);
}
+ else
+ {
+ tet_result(TET_PASS);
+ }
+
END_TEST;
}
detector.Attach(actor);
}
- std::vector<Actor> attachedActors = detector.GetAttachedActors();
- DALI_TEST_EQUALS(actorsToAdd, attachedActors.size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(actorsToAdd, detector.GetAttachedActorCount(), TEST_LOCATION);
// Detach and retrieve attached actors again, the vector should be empty.
detector.DetachAll();
- attachedActors = detector.GetAttachedActors();
- DALI_TEST_EQUALS(true, attachedActors.empty(), TEST_LOCATION);
+ DALI_TEST_EQUALS(0u, detector.GetAttachedActorCount(), TEST_LOCATION);
END_TEST;
}
detector.Attach(actor);
}
- std::vector<Actor> attachedActors = detector.GetAttachedActors();
- DALI_TEST_EQUALS(actorsToAdd, attachedActors.size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(actorsToAdd, detector.GetAttachedActorCount(), TEST_LOCATION);
// Detach and retrieve attached actors again, the vector should be empty.
detector.DetachAll();
- attachedActors = detector.GetAttachedActors();
- DALI_TEST_EQUALS(true, attachedActors.empty(), TEST_LOCATION);
+ DALI_TEST_EQUALS(0u, detector.GetAttachedActorCount(), TEST_LOCATION);
DALI_TEST_EQUALS(true, gestureManager.WasCalled(TestGestureManager::UnregisterType), TEST_LOCATION);
// Call DetachAll again, there should not be any exception
GestureDetector detector = PanGestureDetector::New();
// Initially there should not be any actors.
- DALI_TEST_EQUALS(0u, detector.GetAttachedActors().size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(0u, detector.GetAttachedActorCount(), TEST_LOCATION);
// Attach one actor
Actor actor1 = Actor::New();
detector.Attach(actor1);
- DALI_TEST_EQUALS(1u, detector.GetAttachedActors().size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(1u, detector.GetAttachedActorCount(), TEST_LOCATION);
// Attach another actor
Actor actor2 = Actor::New();
detector.Attach(actor2);
- DALI_TEST_EQUALS(2u, detector.GetAttachedActors().size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(2u, detector.GetAttachedActorCount(), TEST_LOCATION);
// Attach another five actors
std::vector<Actor> myActors;
myActors.push_back(actor);
detector.Attach(actor);
}
- DALI_TEST_EQUALS(7u, detector.GetAttachedActors().size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(7u, detector.GetAttachedActorCount(), TEST_LOCATION);
// Detach actor2
detector.Detach(actor2);
- DALI_TEST_EQUALS(6u, detector.GetAttachedActors().size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(6u, detector.GetAttachedActorCount(), TEST_LOCATION);
// Attach actor1 again, count should not increase.
detector.Attach(actor1);
- DALI_TEST_EQUALS(6u, detector.GetAttachedActors().size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(6u, detector.GetAttachedActorCount(), TEST_LOCATION);
// Detach actor2 again, count should not decrease.
detector.Detach(actor2);
- DALI_TEST_EQUALS(6u, detector.GetAttachedActors().size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(6u, detector.GetAttachedActorCount(), TEST_LOCATION);
// Detach actor1.
detector.Detach(actor1);
- DALI_TEST_EQUALS(5u, detector.GetAttachedActors().size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(5u, detector.GetAttachedActorCount(), TEST_LOCATION);
// Create scoped actor, actor should be automatically removed from the detector when it goes out
// of scope.
{
Actor scopedActor = Actor::New();
detector.Attach(scopedActor);
- DALI_TEST_EQUALS(6u, detector.GetAttachedActors().size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(6u, detector.GetAttachedActorCount(), TEST_LOCATION);
}
- DALI_TEST_EQUALS(5u, detector.GetAttachedActors().size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(5u, detector.GetAttachedActorCount(), TEST_LOCATION);
// Detach all so nothing remains.
detector.DetachAll();
- DALI_TEST_EQUALS(0u, detector.GetAttachedActors().size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(0u, detector.GetAttachedActorCount(), TEST_LOCATION);
END_TEST;
}