Exemple #1
0
int main() {
    printf("test day out of range\n");
    group_test(2000, 2, 28);
    group_test(2000, 2, 29);
    group_test(2000, 2, 30);
    printf("test month out of range\n");
    group_test(2000, 0, 30);
    group_test(2000, 13, 30);
    printf("test month_day out of range\n");
    test_month_day(2016, 0);
    test_month_day(2016, 1);
    test_month_day(2016, 366);
    test_month_day(2016, 367);
    printf("group test\n");
    group_test(2016, 4, 15); // leap
    group_test(2000, 4, 15); // leap
    group_test(1900, 4, 15); // not leap
    group_test(2001, 4, 15); // not leap
    return 0;
}
Exemple #2
0
int main(int argc, char *argv[])
{
  int superuser;
  start(46);

  superuser = (geteuid() == 0);

  if(!superuser) {
  	if(!(setuid(0) || seteuid(0))) {
		printf("Test 46 has to be run as root; test aborted\n");
		exit(1);
	}
  }

  limit_test();	/* Perform some tests on POSIX limits */
  api_test();	/* Perform some very basic API tests */
  group_test();	/* Perform some tests that mimic actual use */

  quit();

  return(-1);	/* Unreachable */
}