Beispiel #1
0
 int main(void){
  printf("1.test_for_create_array: 'create' creates an array and adds three fields to it\n");
  test_for_create_array();
  printf("2.test2_for_create_array: 'create' initialize everything to 0\n");
  test2_for_create_array();
  printf("3.test_for_resize_array:'resize' increases the size of array for greater given length\n");
  test_for_resize_array();
  printf("4.test2_for_resize_array:'resize' decreases the size of array for lesser given length\n");
  test2_for_resize_array();
  printf("4.test3_for_resize_array:'resize' doesn't effect the values form the array\n");
  test3_for_resize_array();
  printf("5.test_for_areEqual:'areEqual' gives 1 when given two arrays are same\n");
  test_for_areEqual();
  printf("6.test2_for_areEqual:'areEqual' gives 0 when given two arrays are different\n");
  test2_for_areEqual();
  printf("7.test3_for_areEqual:'areEqual' gives 1 when given two arrays have same values\n");
  test3_for_areEqual();
  printf("8.test4_for_areEqual:'areEqual' gives 0 when given two arrays have same values\n");
  test4_for_areEqual();
  printf("9.test_for_findIndex:'findIndex' gives index number  when it has the given element\n");
  test_for_findIndex();
  printf("10.test2_for_findIndex:'findIndex' gives index number  when it doesn't have the given element\n");
  test2_for_findIndex();
  printf("11.test2_for_dispose:'dispose' releases the memory allocated in array's base field\n");
  test_for_dispose();
  test3_for_create_array();
  printf("12.test_for_findFirst:'findFirst' gives the pointer to the firstly matched value if matched value is found\n");
  test_for_findFirst();
  printf("13.test2_for_findFirst:'findFirst' gives the pointer to the firstly matched value if matched value is found\n");
  test2_for_findFirst();
  printf("14.test3_for_findFirst:'findFirst' gives the NULL if no value matched the condition\n");
  test3_for_findFirst();
  printf("15.test_for_findLast:'findLast' gives the pointer to the lastly matched value if matched value is found\n");
  test_for_findLast();
  printf("16.test_for_findLast:'findLast' gives the NUll if no value matched the condition\n");
  test2_for_findLast();
  printf("17.test_for_count:'count' gives count of values that matched the condition\n");
  test_for_count();
  printf("18.test_for_filter:'filter' gives the count of values that matched the condition\n");
  test_for_filter();
  printf("19.test2_for_filter:'filter' stores the pointers of matched value in destination array\n");
  test2_for_filter();
  printf("20.test_for_map:'map' stores the resultant values in the destination array\n");
  test_for_map();
  printf("21.test_for_reduce:'reduce' gives the pointer to the resultant value\n");
  test_for_reduce();
  printf("22.test_for_forEach:'forEach' gives the apply the operation on every element of the given array\n");
  test_for_forEach();
  return 0;
};
Beispiel #2
0
int main(){
	test_create_array();
	test_array_are_equal();
	test_resize_array();
	test_check_equal_in_str_case();
	test_check_index_for_float();
	test_check_index_for_char();
	test_check_divisibility_if_divisible_for_findFirst();
	test_check_divisibility_if_not_divisible_for_findFirst();
	test_check_divisibility_if_divisible_for_findLast();
	test_check_counts_if_criteria_match();
	test_check_counts_if_criteria_dont_match();
	test_filter_method_for_int();
	// test_filter_method_for_char();
	test_for_map_for_int();
	test_for_forEach();
	test_for_reduce();
	return 0;
};