コード例 #1
0
void
run_tests(void)
{
	test_chars();
	test_coordinates();
	test_invalid_fens();
	test_fen_basic();
	test_move_str();
}
コード例 #2
0
int main(int argc, char *argv[]) {
  ATerm bottomOfStack;

  ATinit(argc, argv, &bottomOfStack);
  CC_init();

  test_chars();

  test_sets();

  return 0;
}
コード例 #3
0
int main(int argc, char *argv[])
{
   int i,j;
   char *planets[] = {"Mercury", "Venus", "Earth", 
                        "Mars", "Jupiter", "Saturn", 
                        "Uranus", "Neptune", "Pluto"};
   
   for(i=1; i < argc; i++)
   {
      for(j = 0; j < NUM_PLANETS; j++)
      {
         /*
            The planet array looks like this
            
            planets|M|e|r|c|u|r|y|\0|V|e|n|u|s|\0|...
            
            test_chars is expecting 2 arrays, we'll need to 
            pass poiters to the first element in each array.
            Basically, a pointer to the first char in each planet.
            
            Each planet could be sent one of these ways:
            planets[0]        --> This would be a pointer to M in Mercury
            &planets[0][0]    --> This is equal
            
         */

         if(test_chars(&argv[i][0], planets[j]) > 0)
         {
            printf("%s is planet %d\n", argv[i], j+1);
            break;
         }
      }
      
      if(j == NUM_PLANETS)
      {
         printf("%s is not a planet\n", argv[i]);
      }
   }
   
   getchar();
   getchar();
   return 0;
   
}