Example #1
0
int main(int argc, char **argv) {
  FILE *pipe = popen("tee arithmetic.log | /usr/bin/ruby", "w");
  if (pipe == NULL) {
    handle_error(-1, "popen");
  }
  int pfd = fileno(pipe);
  handle_error(pfd, "fileno");
  int retcode = close(STDOUT_FILENO);
  handle_error(retcode, "close(STDOUT_FILENO)");
  retcode = dup(pfd);
  handle_error(retcode, "dup");
  fprintf(stderr, "doing add_test\n");
  add_test();
  fprintf(stderr, "doing sub_test\n");
  sub_test();
  fprintf(stderr, "doing sprintf_test\n");
  sprintf_test();
  fprintf(stderr, "doing mul_test\n");
  mul_test();
  fprintf(stderr, "doing divx_test\n");
  divx_test();
  fprintf(stderr, "done with C-operations\n");
  printf("puts 'DONE'\n");
  fflush(stdout);
  retcode = close(STDOUT_FILENO);
  handle_error(retcode, "close");
  retcode = pclose(pipe);
  handle_error(retcode, "pclose");
  exit(0);
}
Example #2
0
static void MainL()
	{
	TheTest.Start(_L(" @SYMTestCaseID:SYSLIB-STDLIB-LEGACY-TMISC-0001 TMISC tests "));

	random_numbers();
	sorting();
	searching();
	setjmp_longjmp();
	casecmp();
	sscanf_test();

	int argsc = 5;
	char *argsv[]=
		{
		"tmisc", "This", "is", "a", "test.",
		};
	arguments(argsc, argsv);

	strtod_test();
	va_args_test();
	sprintf_test();
	}