示例#1
0
static
void
GenericRemoveTest(ValueStrategy strategy, int32 maxNumber)
{
	typedef typename ValueStrategy::Value Value;
	TestVector<Value> v;
	GenericFill(v, strategy, maxNumber);
	while (v.Count() > 0) {
		int32 index = rand() % (v.Count());
		Value value = v[index];
		v.Remove(value);
		v.Remove(value);
	}
}
示例#2
0
static
void
GenericPushPopBackTest(ValueStrategy strategy, int32 maxNumber)
{
	typedef typename ValueStrategy::Value Value;
	TestVector<Value> v;
	for (int32 i = 0; i < maxNumber; i++)
		v.PushBack(strategy.Generate());
	for (int32 i = 0; i < maxNumber / 2; i++)
		v.PopBack();
	for (int32 i = 0; i < maxNumber; i++)
		v.PushBack(strategy.Generate());
	int32 count = v.Count();
	for (int32 i = 0; i < count; i++)
		v.PopBack();
}