int main(int argc, char** argv) { if (!ParseArgs(argc, argv)) return 0; plan_tests(52); Waypoints waypoints; GeoPoint center(Angle::Degrees(51.4), Angle::Degrees(7.85)); // AddSpiralWaypoints creates 151 waypoints from // 0km to 150km distance in 1km steps AddSpiralWaypoints(waypoints, center); ok1(!waypoints.IsEmpty()); ok1(waypoints.size() == 151); TestLookups(waypoints, center); TestNamePrefixVisitor(waypoints); TestRangeVisitor(waypoints, center); TestGetNearest(waypoints, center); TestIterator(waypoints); ok(TestCopy(waypoints), "waypoint copy", 0); ok(TestErase(waypoints, 3), "waypoint erase", 0); ok(TestReplace(waypoints, 4), "waypoint replace", 0); // test clear waypoints.Clear(); ok1(waypoints.IsEmpty()); ok1(waypoints.size() == 0); return exit_status(); }
int main( int argc, char* argv[] ) { // Set default for minimum number of threads. MinThread = 1; ParseCommandLine(argc,argv); TestEmptyQueue<char>(); TestEmptyQueue<Foo>(); TestFullQueue(); TestConcurrenetQueueType(); TestIterator(); // Test concurrent operations for( int nthread=MinThread; nthread<=MaxThread; ++nthread ) { TestNegativeQueue<Foo>(nthread); for( int prefill=0; prefill<64; prefill+=(1+prefill/3) ) { TestPushPop(prefill,ptrdiff_t(-1),nthread); TestPushPop(prefill,ptrdiff_t(1),nthread); TestPushPop(prefill,ptrdiff_t(2),nthread); TestPushPop(prefill,ptrdiff_t(10),nthread); TestPushPop(prefill,ptrdiff_t(100),nthread); } } printf("done\n"); return 0; }
/** * Run the test */ void TestVector::RunImpl() { TestConstructor(); TestIterator(); TestSize(); TestAccessor(); TestInsertion(); TestRemove(); }
bool MapSpecificTests<CHXMapGUIDToObj>::operator() () { bool ret = (TestIterator() && TestIterator2() && TestGetStartPosition() && TestGetNextAssoc()); DPRINTF (D_ERROR, ("MapSpecificTests<CHXMapGUIDToObj> : %d\n", ret)); return ret; }
bool MapSpecificTests<CHXMapStringToString>::operator() () { bool ret = (TestIterator() && TestIterator2() && TestGetStartPosition() && TestGetNextAssoc() && TestSetCaseSensitive()); DPRINTF (D_ERROR, ("MapSpecificTests<CHXMapStringToString> : %d\n", ret)); return ret; }
int TestMain () { TestEmptyQueue<char>(); TestEmptyQueue<Foo>(); TestFullQueue(); TestConcurrentQueueType(); TestIterator(); // Test concurrent operations for( int nthread=MinThread; nthread<=MaxThread; ++nthread ) { TestNegativeQueue<Foo>(nthread); for( int prefill=0; prefill<64; prefill+=(1+prefill/3) ) { TestPushPop(prefill,ptrdiff_t(-1),nthread); TestPushPop(prefill,ptrdiff_t(1),nthread); TestPushPop(prefill,ptrdiff_t(2),nthread); TestPushPop(prefill,ptrdiff_t(10),nthread); TestPushPop(prefill,ptrdiff_t(100),nthread); } } return Harness::Done; }