Пример #1
0
static bool
TestWaypointFile(const TCHAR* filename, Waypoints &way_points, unsigned num_wps)
{
    WaypointReader f(filename, 0);
    if (!ok1(!f.Error())) {
        skip(3, 0, "opening waypoint file failed");
        return false;
    }

    NullOperationEnvironment operation;
    if(!ok1(f.Parse(way_points, operation))) {
        skip(2, 0, "parsing waypoint file failed");
        return false;
    }

    way_points.optimise();

    ok1(!way_points.empty());
    ok1(way_points.size() == num_wps);

    return true;
}
Пример #2
0
static bool
TestWayPointFile(const TCHAR* filename, Waypoints &way_points, unsigned num_wps)
{
  WayPointFile *f = WayPointFile::create(filename, 0);
  if (!ok1(f != NULL)) {
    skip(3, 0, "opening waypoint file failed");
    return false;
  }

  if(!ok1(f->Parse(way_points, NULL))) {
    delete f;
    skip(2, 0, "parsing waypoint file failed");
  }

  delete f;

  way_points.optimise();

  ok1(!way_points.empty());
  ok1(way_points.size() == num_wps);

  return true;
}