diff --git a/librerie/exercise1/main b/librerie/exercise1/main index fc9d3de..6294c46 100755 Binary files a/librerie/exercise1/main and b/librerie/exercise1/main differ diff --git a/librerie/exercise1/zlasdtest/container/container.hpp b/librerie/exercise1/zlasdtest/container/container.hpp index 7b12b44..d1503cc 100644 --- a/librerie/exercise1/zlasdtest/container/container.hpp +++ b/librerie/exercise1/zlasdtest/container/container.hpp @@ -26,8 +26,8 @@ void GetFront(uint& testnum, uint& testerr, const lasd::LinearContainer& c } catch(std::length_error exc) { std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; } catch(std::exception exc) { - tst = true; - std::cout << std::endl << "Wrong std::exception: " << exc.what() << "!" << std::endl; + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; } testerr += (1 - (uint) tst); } @@ -43,8 +43,8 @@ void SetFront(uint& testnum, uint& testerr, const lasd::LinearContainer& c } catch(std::length_error exc) { std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; } catch(std::exception exc) { - tst = true; - std::cout << std::endl << "Wrong std::exception: " << exc.what() << "!" << std::endl; + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; } testerr += (1 - (uint) tst); } @@ -59,8 +59,8 @@ void GetBack(uint& testnum, uint& testerr, const lasd::LinearContainer& co } catch(std::length_error exc) { std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; } catch(std::exception exc) { - tst = true; - std::cout << std::endl << "Wrong std::exception: " << exc.what() << "!" << std::endl; + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; } testerr += (1 - (uint) tst); } @@ -76,8 +76,8 @@ void SetBack(uint& testnum, uint& testerr, const lasd::LinearContainer& co } catch(std::length_error exc) { std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; } catch(std::exception exc) { - tst = true; - std::cout << std::endl << "Wrong std::exception: " << exc.what() << "!" << std::endl; + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; } testerr += (1 - (uint) tst); } @@ -93,8 +93,8 @@ void SetAt(uint& testnum, uint& testerr, lasd::LinearContainer& con, bool } catch(std::out_of_range exc) { std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; } catch(std::exception exc) { - tst = true; - std::cout << std::endl << "Wrong std::exception: " << exc.what() << "!" << std::endl; + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; } testerr += (1 - (uint) tst); } @@ -109,8 +109,8 @@ void GetAt(uint& testnum, uint& testerr, lasd::LinearContainer& con, bool } catch(std::out_of_range exc) { std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; } catch(std::exception exc) { - tst = true; - std::cout << std::endl << "Wrong std::exception: " << exc.what() << "!" << std::endl; + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; } testerr += (1 - (uint) tst); } diff --git a/librerie/exercise1/zlasdtest/list/list.hpp b/librerie/exercise1/zlasdtest/list/list.hpp index 94fbe48..0a8d7a0 100644 --- a/librerie/exercise1/zlasdtest/list/list.hpp +++ b/librerie/exercise1/zlasdtest/list/list.hpp @@ -30,6 +30,9 @@ void RemoveFromFront(uint& testnum, uint& testerr, lasd::List& lst, bool c std::cout << ((tst = chk) ? "Correct" : "Error") << "!" << std::endl; } catch(std::length_error exc) { std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; } testerr += (1 - (uint) tst); } @@ -43,6 +46,9 @@ void FrontNRemove(uint& testnum, uint& testerr, lasd::List& lst, bool chk, std::cout << ((tst = ((lst.FrontNRemove() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; } catch(std::length_error exc) { std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; } testerr += (1 - (uint) tst); }