cpp/CPP05/ex01/main.cpp
2024-12-04 17:29:31 +01:00

40 lines
722 B
C++

#include "Bureaucrat.hpp"
#include "Form.hpp"
int main() {
std::cout << "\n---Test---\n" << std::endl;
try {
Form form("toto", 151, 150);
}
catch (std::exception & e) {
std::cout << e.what() << std::endl;
}
std::cout << "\n----------------\n" << std::endl;
try {
Form form("toto", 1, 0);
}
catch (std::exception & e) {
std::cout << e.what() << std::endl;
}
std::cout << "\n----------------\n" << std::endl;
try {
Form form("fofo", 5, 4);
Bureaucrat toto("toto", 5);
Bureaucrat tata("tata", 6);
tata.signForm(form);
toto.signForm(form);
toto.signForm(form);
}
catch (std::exception & e) {
std::cout << e.what() << std::endl;
}
std::cout << "\n---End Test---\n" << std::endl;
}