Ejemplo n.º 1
0
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 _tmain(int argc, _TCHAR* argv[])
{
    HRESULT         hr = S_OK;
    IDiscRecorder2* recorder = NULL;
    VARIANT_BOOL    fullErase = VARIANT_FALSE;

    if ( !GetParameters(argc-1, argv+1, &recorder, &fullErase) )
    {
        PrintHelp(argv[0]);
        hr = E_INVALIDARG;
    }
    else
    {
        hr = TestErase(recorder, fullErase);
    }
    
    return hr;
}