123456789101112131415161718192021222324252627 |
- #include "../Tests.hpp"
- #include "core/utils/Error.hpp"
- static void test(Core::Error e, const char* s) {
- CORE_TEST_STRING(getErrorName(e), s);
- }
- void Core::testError() {
- test(Error::NONE, "NONE");
- test(Error::NEGATIVE_ARGUMENT, "NEGATIVE_ARGUMENT");
- test(Error::CAPACITY_REACHED, "CAPACITY_REACHED");
- test(Error::BLOCKED_STDOUT, "BLOCKED_STDOUT");
- test(Error::OUT_OF_MEMORY, "OUT_OF_MEMORY");
- test(Error::INVALID_CHAR, "INVALID_CHAR");
- test(Error::NOT_FOUND, "NOT_FOUND");
- test(Error::INVALID_STATE, "INVALID_STATE");
- test(Error::INVALID_INDEX, "INVALID_INDEX");
- test(Error::INVALID_ARGUMENT, "INVALID_ARGUMENT");
- test(Error::TIME_NOT_AVAILABLE, "TIME_NOT_AVAILABLE");
- test(Error::SLEEP_INTERRUPTED, "SLEEP_INTERRUPTED");
- test(Error::THREAD_ERROR, "THREAD_ERROR");
- test(Error::MUTEX_ERROR, "MUTEX_ERROR");
- test(Error::EXISTING_KEY, "EXISTING_KEY");
- test(Error::CANNOT_OPEN_FILE, "CANNOT_OPEN_FILE");
- test(Error::END_OF_FILE, "END_OF_FILE");
- test(static_cast<Error>(200), "?");
- }
|