feat: add solver core skeleton

This commit is contained in:
NINI
2026-06-12 02:25:07 +09:00
parent 4e7fd1087d
commit cbd1a6c5d7
46 changed files with 1911 additions and 19 deletions
+50
View File
@@ -0,0 +1,50 @@
#include <fesa/core/diagnostic.hpp>
#include <fesa/core/ids.hpp>
#include <fesa/core/status.hpp>
#include <string>
#include <type_traits>
namespace {
int fail()
{
return 1;
}
} // namespace
int main()
{
static_assert(!std::is_same_v<fesa::core::NodeId, fesa::core::ElementId>);
const auto ok = fesa::core::Status::ok();
if (!ok.is_ok() || !ok.diagnostics().empty()) {
return fail();
}
fesa::core::Diagnostic error{
fesa::core::Severity::error,
"core.error",
"core failure"
};
auto failed = fesa::core::Status::failure(error);
if (failed.is_ok() || failed.diagnostics().size() != 1) {
return fail();
}
if (failed.diagnostics()[0].code != "core.error" ||
failed.diagnostics()[0].message != "core failure") {
return fail();
}
failed.add({fesa::core::Severity::warning, "core.warning", "check warning"});
if (failed.diagnostics().size() != 2) {
return fail();
}
if (failed.diagnostics()[0].code != "core.error" ||
failed.diagnostics()[1].code != "core.warning") {
return fail();
}
return 0;
}