diff --git a/d08/ex00/easyfind b/d08/ex00/easyfind new file mode 100755 index 0000000..1c3bb6e Binary files /dev/null and b/d08/ex00/easyfind differ diff --git a/d08/ex00/main.cpp b/d08/ex00/main.cpp index 1b0a966..4ae39e5 100644 --- a/d08/ex00/main.cpp +++ b/d08/ex00/main.cpp @@ -10,22 +10,20 @@ #define N_TEST "3" template < typename T > -void standardTest(T container) { +void standardTest(T container, int test) { typename T::const_iterator it; - int test; - for (int i = -9 ; i < 10 ; i++) + for (int i = 65 ; i < 91 ; i++) container.push_back(i); for (it = container.begin(); it != container.end(); it++) std::cout << *it << ": " << &*it << "\n"; std::cout << "\n"; - test = -3; try { it = easyfind(container, test); - std::cout << *it << ": " << &*it << "\n"; + std::cout << *it << ": " << &*it << "\n\n"; } catch (std::exception const & e) { - std::cout << test << ": " << e.what() << "\n"; + std::cout << test << ": " << e.what() << "\n\n"; } } @@ -36,21 +34,27 @@ int main() { << "tests list :" RESET "\n"; { std::list container; - standardTest(container); + standardTest(container, 70); + std::list container2; + standardTest(container2, 'T'); } std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] " << "tests vector :" RESET "\n"; { std::vector container; - standardTest(container); + standardTest(container, 70); + std::vector container2; + standardTest(container2, 'T'); } std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] " << "tests deque :" RESET "\n"; { std::deque container; - standardTest(container); + standardTest(container, 70); + std::deque container2; + standardTest(container2, 'T'); } return 0;