示例#1
0
文件: main.c 项目: choueric/tools
int main(int argc, char **argv)
{
	int fd;

	parse_args(argc, argv);
	print_options();

	fd = open(rtcdev, O_RDONLY);

	if (fd == -1) {
		perror(rtcdev);
		exit(errno);
	}

	if (autotest) {
		auto_test(fd);
		goto done;
	}

	if (!strcmp(cmd, "read")) {
		test_read_time(fd);
	} else if (!strcmp(cmd, "write")) {
		test_set_time(fd);
	} else if (!strcmp(cmd, "vl")) {
		test_low_voltage(fd);
	} else if (!strcmp(cmd, "update")) {
		test_update(fd);
	} else if (!strcmp(cmd, "alarm")) {
		test_alarm(fd);
	} else if (!strcmp(cmd, "periodic")) {
		test_periodic(fd);
	} else {
		printf("invalid command %s\n", cmd);
	}
	goto done;

done:
	fprintf(stderr, "\n*** Test complete ***\n");

	close(fd);

	return 0;
}
示例#2
0
/*
 * Purpose of this program is to verify that
 * p8est_find_edge_transform and p8est_find_corner_transform
 * work as expected for several periodic connectivities.
 */
int
main (int argc, char **argv)
{
  p8est_connectivity_t *conn;

  sc_init (sc_MPI_COMM_NULL, 1, 1, NULL, SC_LP_DEFAULT);
  p4est_init (NULL, SC_LP_DEFAULT);

  conn = p8est_connectivity_new_periodic ();
  test_periodic (conn);
  p8est_connectivity_destroy (conn);

  conn = p8est_connectivity_new_rotwrap ();
  test_rotwrap (conn);
  p8est_connectivity_destroy (conn);

  test_weird ();

  sc_finalize ();

  return 0;
}