int main()
{
    check_parse("1, 2, 3, 4", "[ 1 2 3 4 ]");
    check_parse("1 , 2 , 3 , 4", "[ 1 2 3 4 ]");
    check_parse("1 2 3 4", "[ 1 2 3 4 ]");
    check_parse("1,2,3,4", "[ 1 2 3 4 ]");

    check_parse("1,2,3,4,5,6,7,8", "[ 1 2 3 4 ]");

    return 0;
}
int
main (int argc, char *argv[])
{
  tests_start_mpfr ();

  check_special();
  check_reftable ();
  check_parse ();
  check_overflow ();
  check_retval ();
  bug20081028 ();
  test20100310 ();

  tests_end_mpfr ();
  return 0;
}
Ejemplo n.º 3
0
int
main (int argc, char **argv)
{
  struct file f;
  char *line;
  int i;
  int n;

  n = 0;
  for (i = 1; i < argc; i++) {
    file_open (&f, argv[i]);
    while ((line = file_readline (&f))) {
      check_parse (line);
      n++;
    }
    file_close (&f);
  }
  url_free (&url);

  printf ("Tested %d urls.\n", n);
}
Ejemplo n.º 4
0
int		main(int ac, char **av)
{
    t_glob	*glob;

    glob = cx_malloc(1 * sizeof(*glob));
    glob->graph = cx_malloc(1 * sizeof(t_graph));
    glob->universe = cx_malloc(1 * sizeof(t_uni));
    glob->option = cx_malloc(1 * sizeof(t_option));
    if (ac < 2)
    {
        fprintf(stderr, "Usage: ./%s [file.xml] [flags]\n", av[0]);
        put_error(USAGE_FLAG, 1);
    }
    parse_conf(av[1], glob);
    get_args(glob, ac, av);
    check_parse(glob);
    init_methodes(glob);
    init(glob);
    tracemyray(glob);
    mlx_expose_hook(glob->graph->win_ptr, &expose, glob);
    mlx_key_hook(glob->graph->win_ptr, &key_hook, glob);
    mlx_loop(glob->graph->mlx_ptr);
    return (EXIT_SUCCESS);
}
Ejemplo n.º 5
0
int
main (int argc, char *argv[])
{
    int ret;
    sqlite3 *handle;
    void *cache = spatialite_alloc_connection ();

    if (argc > 1 || argv[0] == NULL)
	argc = 1;		/* silencing stupid compiler warnings */

    ret =
	sqlite3_open_v2 (":memory:", &handle,
			 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr, "cannot open in-memory db: %s\n",
		   sqlite3_errmsg (handle));
	  sqlite3_close (handle);
	  return -1;
      }

    spatialite_init_ex (handle, cache, 0);

#ifdef ENABLE_LIBXML2		/* only if LIBXML2 is supported */

    if (!check_parse (cache, "books.xml"))
      {
	  fprintf (stderr, "unable to parse \"books.xml\"\n");
	  return -2;
      }
    if (!check_parse (cache, "opera.xml"))
      {
	  fprintf (stderr, "unable to parse \"opera.xml\"\n");
	  return -3;
      }
    if (!check_parse (cache, "movies.xml"))
      {
	  fprintf (stderr, "unable to parse \"movies.xml\"\n");
	  return -4;
      }

    if (!check_validate (cache, "books.xml"))
      {
	  fprintf (stderr, "unable to validate \"books.xml\"\n");
	  return -5;
      }
    if (!check_validate (cache, "opera.xml"))
      {
	  fprintf (stderr, "unable to validate \"opera.xml\"\n");
	  return -6;
      }
    if (!check_validate (cache, "movies.xml"))
      {
	  fprintf (stderr, "unable to validate \"movies.xml\"\n");
	  return -7;
      }
    if (!check_extended (cache, "inspire-data-example.xml", ISO_METADATA))
      {
	  fprintf (stderr, "unable to parse \"inspire-data-example.xml\"\n");
	  return -8;
      }
    if (!check_extended (cache, "stazioni_se.xml", SLD_SE_STYLE))
      {
	  fprintf (stderr, "unable to parse \"stazioni_se.xml\"\n");
	  return -9;
      }
    if (!check_extended (cache, "thunderstorm_mild.svg", SVG))
      {
	  fprintf (stderr, "unable to parse \"thunderstorm_mild.svg\"\n");
	  return -10;
      }

    if (!check_bad_xml (cache))
      {
	  fprintf (stderr, "unable to test not well-formed XML\n");
	  return -11;
      }
    if (!check_bad_schema (cache))
      {
	  fprintf (stderr, "unable to test invalid Schema\n");
	  return -12;
      }

    if (!check_mline_gpx (handle, cache, "000323485.gpx"))
      {
	  fprintf (stderr, "unable to test \"000323485.gpx\"\n");
	  return -13;
      }
    if (!check_mline_gpx (handle, cache, "Gpx-sample.gpx"))
      {
	  fprintf (stderr, "unable to test \"Gpx-sample.gpx\"\n");
	  return -14;
      }

#endif

    ret = sqlite3_close (handle);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr, "sqlite3_close() error: %s\n",
		   sqlite3_errmsg (handle));
	  return -10;
      }

    spatialite_cleanup_ex (cache);

    spatialite_shutdown ();

    return 0;
}