Skip to content
Snippets Groups Projects
Commit 20c8dbdd authored by Zandor Smith's avatar Zandor Smith :computer:
Browse files

Added test for getLimits.

parent fdbaeaeb
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@ void getLimits(const std::vector<vectorType>& haystack, vectorType& min, vectorT
}
if(i > max)
{
max = 1;
max = i;
}
}
}
......@@ -28,11 +28,25 @@ void getLimits(const std::vector<vectorType>& haystack, vectorType& min, vectorT
int main()
{
std::vector<int> vector;
vector.push_back(-1);
vector.push_back(1);
vector.push_back(3);
vector.push_back(8);
bool test = inVector(vector, 1);
bool test2 = inVector(vector, 1);
bool test1 = inVector(vector, 1);
bool test2 = inVector(vector, 2);
printf(std::to_string(test).c_str());
printf(std::to_string(test2).c_str());
printf((std::string("inVector test 1: ") + std::to_string(test1)).c_str());
printf((std::string("inVector test 2: ") + std::to_string(test2)).c_str());
int min;
int max;
getLimits(vector, min, max);
printf((std::string("getLimits min: ") + std::to_string(min)).c_str());
printf((std::string("getLimits max: ") + std::to_string(max)).c_str());
printf("end");
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment