Uhhh changes idek anymore mayn

This commit is contained in:
NaifBanana
2025-11-05 00:21:11 -06:00
parent ac1762cb67
commit a7428ef55f
19 changed files with 553 additions and 10286 deletions
+5
View File
@@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.26.0)
project(gtest_Graphics VERSION 0.1.0 LANGUAGES C CXX)
add_executable(ErrorTest main.cpp)
target_link_libraries(ErrorTest NBCore)
+31
View File
@@ -0,0 +1,31 @@
#include "Errors.hpp"
#include <iostream>
using namespace nb;
class TestError : public nb::Error {
public:
TestError(unsigned int code, nb::Error* const trace=nullptr) : _type("nb::TestError"), Error(code, ErrorCodeLookup<TestError>(code), trace) {}
friend const char* ErrorCodeLookup<TestError>(unsigned int);
protected:
static const nb::ErrorCodeMap ErrorCodes;
const char* _type;
};
const ErrorCodeMap TestError::ErrorCodes{
{0, "Hey!"},
{1, "How"},
{2, "You"},
{3, "Doin"}
};
int main() {
TestError a(0);
TestError b(1, &a);
TestError c(2, &b);
throw TestError(3, &c);
return 0;
}