コード例 #1
0
ファイル: ex18.c プロジェクト: slugbyte/c-the-hard-way
int main(int argc, char *argv[]){
  if (argc < 2) die("USAGE: ex18 2 3 4 1 6");

  int count = argc - 1;
  int i = 0;
  char **inputs = argv + 1;
  
  int *numbers = malloc(count * sizeof(int));
  if(!numbers) die("Memory Error");
  
  for(i=0; i<count; i++){
    numbers[i] = atoi(inputs[i]);
  } 

  testSorting(numbers, count, sortedOrder);
  testSorting(numbers, count, reversedOrder);
  testSorting(numbers, count, strageOrder);

  return 0;
}
コード例 #2
0
ファイル: testDiffusion.cpp プロジェクト: csiki/MOOSE
void testDiffusion()
{
	testSorting();
	testFastMatrixElim();
	testSetDiffusionAndTransport();
	testCylDiffn();
	testTaperingCylDiffn();
	testSmallCellDiffn();
	testCellDiffn();
	testCylDiffnWithStoich();
	testCalcJunction();
}
コード例 #3
0
TEST(ExternalSortTest, keepsDuplicate) {
  testSorting({1, 1, 3, 3}, 1<<20); //already sorted
  testSorting({10, 8, 10, 8, 7}, 1<<20); //unsorted
}
コード例 #4
0
TEST(ExternalSortTest, sortsValues) {
  testSorting({1, 2, 3, 12, 33}, 1<<20); //already sorted
  testSorting({10, 8, 23, 12, 43}, 1<<20); //unsorted
}
コード例 #5
0
TEST(ExternalSortTest, handlesOneValue) {
  testSorting({42}, 1<<20); //only one elements
}
コード例 #6
0
TEST(ExternalSortTest, handlesEmptyInput) {
  testSorting({}, 1<<20); //no values at all
}