74 int rand_num, rand_value, index, num_tests = 1000;
78 for(
int i = 0; i < 100; i++){
79 rand_num = std::rand() % 1000;
80 arr.push_back(rand_num);
82 rand_value = std::rand() % 1000;
83 while(std::find(arr.begin(), arr.end(), rand_value) != arr.end()){
84 std::remove(arr.begin(), arr.end(), rand_value);
86 sort(arr.begin(), arr.end());
88 passed = passed && (index == -1);
98 int rand_num, rand_value, index, real_value, num_tests = 10000;
102 for(
int i = 0; i < 100; i++){
103 rand_num = std::rand() % 1000;
104 arr.push_back(rand_num);
106 rand_value = std::rand() % 1000;
107 std::sort(arr.begin(), arr.end());
110 real_value = arr[index];
111 passed = passed && (real_value == rand_value);
113 passed = passed && (std::find(arr.begin(), arr.end(), rand_value) == arr.end());