Example #1
0
int main()
{
	test_null(NULL);
	test_null("1");

	test_fail("1a");
	test_fail("b1");
	test_fail("a");

	test_parse("1", true);
	test_parse("0", false);
	test_parse("Y", true);
	test_parse("y", true);
	test_parse("N", false);
	test_parse("n", false);
	test_parse("yes", true);
	test_parse("Yes", true);
	test_parse("true", true);
	test_parse("True", true);
	test_parse("on", true);
	test_parse("ON", true);
	test_parse("On", true);
	test_parse("oN", true);
	test_parse("no", false);
	test_parse("No", false);
	test_parse("false", false);
	test_parse("False", false);
	test_parse("off", false);
	test_parse("OFF", false);
	test_parse("Off", false);

	return EXIT_SUCCESS;
}
Example #2
0
int main(int argc, char** argv) {
  // default arguments
  verbose=2;  
  
  // default arguments
  autopilot_parms.realistic();

  if (!parse_args(argc,argv)) {
    return 0;
  }

  plan_tests(7);

  terrain_height = 1;
  ok(test_abort(0),"abort",0);
  ok(test_flight(3,0,1.0,true),"basic flight test",0);
  ok(test_goto(0,5),"goto",0);
  ok(test_null(),"null",0);
  ok(test_flight(2,0,1.0,true),"basic flight test",0);
  terrain_height = 500;
  ok(test_flight(3,0,1.0,true),"high terrain",0);
  terrain_height = 1;
  ok(test_airspace(100),"airspace 100",0);
  return exit_status();
}
Example #3
0
void run()
{
    test_null();
    test_true();
    test_false();
    test_integer_zero();
    test_floating_zero();
    test_floating_float();
    test_string_empty();
    test_string_alpha();
}
int main()
{
	test_ensure_empty();
	test_initialise();
	test_ensure_empty();
	test_append();
	test_ensure_empty();
	test_empty();
	test_ensure_empty();
	test_null();
	test_ensure_empty();

	printf("tests passed\n");
	return 0;
}
int main(void)
{
	test_null();
	test_num();
	test_bytes();
	test_appendNum();
	test_appendBytes();
	test_toByte();
	test_toByte_4bitpadding();
	test_size();

	report();

	return 0;
}
Example #6
0
int main(int argc, char **argv)
{
	test_null();
	test_num();
	test_bytes();
	test_appendNum();
	test_appendBytes();
	test_toByte();
	test_toByte_4bitpadding();
	test_size();
	test_append();

	report();

	return 0;
}
Example #7
0
void run()
{
    test_null();
    test_null_white();
    fail_nul();
    fail_nuller();

    test_false();
    test_false_white();
    fail_fals();
    fail_falser();

    test_true();
    test_true_white();
    fail_tru();
    fail_truer();
}
Example #8
0
int
main(int argc, char** argv)
{
  // default arguments
  autopilot_parms.SetIdeal();

  if (!ParseArgs(argc, argv))
    return 0;

  plan_tests(4);

  ok(test_abort(0), "abort", 0);
  ok(test_goto(0, 5, false), "goto", 0);
  ok(test_goto(0, 5, true), "goto with auto mc", 0);
  ok(test_null(), "null", 0);

  return exit_status();
}
Example #9
0
int main(int argc, char** argv) 
{
  // default arguments
  autopilot_parms.bearing_noise=fixed(0);
  autopilot_parms.target_noise=fixed(0.1);
  autopilot_parms.turn_speed=fixed(5.0);
  output_skip = 5;

  if (!parse_args(argc,argv)) {
    return 0;
  }

  plan_tests(4);

  ok(test_abort(0),"abort",0);
  ok(test_goto(0,5,false),"goto",0);
  ok(test_goto(0,5,true),"goto with auto mc",0);
  ok(test_null(),"null",0);

  return exit_status();
}
int main(int argc, char *argv[])
{
    char *logname;
    int ret;

    putenv("CHEWING_PATH=" CHEWING_DATA_PREFIX);
    putenv("CHEWING_USER_PATH=" TEST_HASH_DIR);

    ret = asprintf(&logname, "%s.log", argv[0]);
    if (ret == -1)
        return -1;
    fd = fopen(logname, "w");
    assert(fd);
    free(logname);


    test_null();

    fclose(fd);

    return exit_status();
}
int main(void)
{
	
#line 15 "rnull.pgc"
 char  c []   = "abc       " ;

#line 15 "rnull.pgc"

	
#line 16 "rnull.pgc"
 short  s   = 17 ;

#line 16 "rnull.pgc"

	
#line 17 "rnull.pgc"
 int  i   = - 74874 ;

#line 17 "rnull.pgc"

	
#line 18 "rnull.pgc"
 bool  b   = 1 ;

#line 18 "rnull.pgc"

	
#line 19 "rnull.pgc"
 float  f   = 3.71 ;

#line 19 "rnull.pgc"

	
#line 20 "rnull.pgc"
 long  l   = 487444 ;

#line 20 "rnull.pgc"

	
#line 21 "rnull.pgc"
 double  dbl   = 404.404 ;

#line 21 "rnull.pgc"

	
#line 22 "rnull.pgc"
 decimal  dec    ;

#line 22 "rnull.pgc"

	
#line 23 "rnull.pgc"
 date  dat    ;

#line 23 "rnull.pgc"

	
#line 24 "rnull.pgc"
 timestamp  tmp    ;

#line 24 "rnull.pgc"


	ECPGdebug(1, stderr);
	/* exec sql whenever sqlerror  do sqlprint (  ) ; */
#line 27 "rnull.pgc"


	{ ECPGconnect(__LINE__, 1, "regress1" , NULL,NULL , NULL, 0); 
#line 29 "rnull.pgc"

if (sqlca.sqlcode < 0) sqlprint (  );}
#line 29 "rnull.pgc"


	{ ECPGdo(__LINE__, 1, 0, NULL, "create  table test ( id int   , c char  ( 10 )    , s smallint   , i int   , b bool   , f float    , l bigint   , dbl double precision   , dec decimal    , dat date   , tmp timestamptz   )    ", ECPGt_EOIT, ECPGt_EORT);
#line 33 "rnull.pgc"

if (sqlca.sqlcode < 0) sqlprint (  );}
#line 33 "rnull.pgc"

	{ ECPGtrans(__LINE__, NULL, "commit");
#line 34 "rnull.pgc"

if (sqlca.sqlcode < 0) sqlprint (  );}
#line 34 "rnull.pgc"


	{ ECPGdo(__LINE__, 1, 0, NULL, "insert into test ( id  , c  , s  , i  , b  , f  , l  , dbl  ) values ( 1 ,  ? ,  ? ,  ? ,  ? ,  ? ,  ? ,  ? ) ", 
	ECPGt_char,(c),(long)sizeof("abc       "),(long)1,(sizeof("abc       "))*sizeof(char), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_short,&(s),(long)1,(long)1,sizeof(short), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_int,&(i),(long)1,(long)1,sizeof(int), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_bool,&(b),(long)1,(long)1,sizeof(bool), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_float,&(f),(long)1,(long)1,sizeof(float), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_long,&(l),(long)1,(long)1,sizeof(long), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_double,&(dbl),(long)1,(long)1,sizeof(double), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 38 "rnull.pgc"

if (sqlca.sqlcode < 0) sqlprint (  );}
#line 38 "rnull.pgc"

	{ ECPGtrans(__LINE__, NULL, "commit");
#line 39 "rnull.pgc"

if (sqlca.sqlcode < 0) sqlprint (  );}
#line 39 "rnull.pgc"


	rsetnull(CCHARTYPE, (char *) c);
	rsetnull(CSHORTTYPE, (char *) &s);
	rsetnull(CINTTYPE, (char *) &i);
	rsetnull(CBOOLTYPE, (char *) &b);
	rsetnull(CFLOATTYPE, (char *) &f);
	rsetnull(CLONGTYPE, (char *) &l);
	rsetnull(CDOUBLETYPE, (char *) &dbl);
	rsetnull(CDECIMALTYPE, (char *) &dec);
	rsetnull(CDATETYPE, (char *) &dat);
	rsetnull(CDTIMETYPE, (char *) &tmp);

	{ ECPGdo(__LINE__, 1, 0, NULL, "insert into test ( id  , c  , s  , i  , b  , f  , l  , dbl  , dec  , dat  , tmp  ) values ( 2 ,  ? ,  ? ,  ? ,  ? ,  ? ,  ? ,  ? ,  ? ,  ? ,  ? ) ", 
	ECPGt_char,(c),(long)sizeof("abc       "),(long)1,(sizeof("abc       "))*sizeof(char), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_short,&(s),(long)1,(long)1,sizeof(short), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_int,&(i),(long)1,(long)1,sizeof(int), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_bool,&(b),(long)1,(long)1,sizeof(bool), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_float,&(f),(long)1,(long)1,sizeof(float), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_long,&(l),(long)1,(long)1,sizeof(long), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_double,&(dbl),(long)1,(long)1,sizeof(double), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_decimal,&(dec),(long)1,(long)1,sizeof(decimal), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_date,&(dat),(long)1,(long)1,sizeof(date), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_timestamp,&(tmp),(long)1,(long)1,sizeof(timestamp), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 54 "rnull.pgc"

if (sqlca.sqlcode < 0) sqlprint (  );}
#line 54 "rnull.pgc"

	{ ECPGtrans(__LINE__, NULL, "commit");
#line 55 "rnull.pgc"

if (sqlca.sqlcode < 0) sqlprint (  );}
#line 55 "rnull.pgc"


	printf("first select\n");

	{ ECPGdo(__LINE__, 1, 0, NULL, "select  c , s , i , b , f , l , dbl , dec , dat , tmp  from test where id = 1  ", ECPGt_EOIT, 
	ECPGt_char,(c),(long)sizeof("abc       "),(long)1,(sizeof("abc       "))*sizeof(char), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_short,&(s),(long)1,(long)1,sizeof(short), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_int,&(i),(long)1,(long)1,sizeof(int), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_bool,&(b),(long)1,(long)1,sizeof(bool), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_float,&(f),(long)1,(long)1,sizeof(float), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_long,&(l),(long)1,(long)1,sizeof(long), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_double,&(dbl),(long)1,(long)1,sizeof(double), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_decimal,&(dec),(long)1,(long)1,sizeof(decimal), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_date,&(dat),(long)1,(long)1,sizeof(date), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_timestamp,&(tmp),(long)1,(long)1,sizeof(timestamp), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 61 "rnull.pgc"

if (sqlca.sqlcode < 0) sqlprint (  );}
#line 61 "rnull.pgc"


	test_null(CCHARTYPE, (char *) c);
	test_null(CSHORTTYPE, (char *) &s);
	test_null(CINTTYPE, (char *) &i);
	test_null(CBOOLTYPE, (char *) &b);
	test_null(CFLOATTYPE, (char *) &f);
	test_null(CLONGTYPE, (char *) &l);
	test_null(CDOUBLETYPE, (char *) &dbl);
	test_null(CDECIMALTYPE, (char *) &dec);
	test_null(CDATETYPE, (char *) &dat);
	test_null(CDTIMETYPE, (char *) &tmp);

	printf("second select\n");

	{ ECPGdo(__LINE__, 1, 0, NULL, "select  c , s , i , b , f , l , dbl , dec , dat , tmp  from test where id = 2  ", ECPGt_EOIT, 
	ECPGt_char,(c),(long)sizeof("abc       "),(long)1,(sizeof("abc       "))*sizeof(char), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_short,&(s),(long)1,(long)1,sizeof(short), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_int,&(i),(long)1,(long)1,sizeof(int), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_bool,&(b),(long)1,(long)1,sizeof(bool), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_float,&(f),(long)1,(long)1,sizeof(float), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_long,&(l),(long)1,(long)1,sizeof(long), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_double,&(dbl),(long)1,(long)1,sizeof(double), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_decimal,&(dec),(long)1,(long)1,sizeof(decimal), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_date,&(dat),(long)1,(long)1,sizeof(date), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
	ECPGt_timestamp,&(tmp),(long)1,(long)1,sizeof(timestamp), 
	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 78 "rnull.pgc"

if (sqlca.sqlcode < 0) sqlprint (  );}
#line 78 "rnull.pgc"


	test_null(CCHARTYPE, (char *) c);
	test_null(CSHORTTYPE, (char *) &s);
	test_null(CINTTYPE, (char *) &i);
	test_null(CBOOLTYPE, (char *) &b);
	test_null(CFLOATTYPE, (char *) &f);
	test_null(CLONGTYPE, (char *) &l);
	test_null(CDOUBLETYPE, (char *) &dbl);
	test_null(CDECIMALTYPE, (char *) &dec);
	test_null(CDATETYPE, (char *) &dat);
	test_null(CDTIMETYPE, (char *) &tmp);

	{ ECPGdo(__LINE__, 1, 0, NULL, "drop table test ", ECPGt_EOIT, ECPGt_EORT);
#line 91 "rnull.pgc"

if (sqlca.sqlcode < 0) sqlprint (  );}
#line 91 "rnull.pgc"

	{ ECPGtrans(__LINE__, NULL, "commit");
#line 92 "rnull.pgc"

if (sqlca.sqlcode < 0) sqlprint (  );}
#line 92 "rnull.pgc"


	{ ECPGdisconnect(__LINE__, "CURRENT");
#line 94 "rnull.pgc"

if (sqlca.sqlcode < 0) sqlprint (  );}
#line 94 "rnull.pgc"


	return 0;
}