feat: add property model foundation

This commit is contained in:
김경종
2026-06-09 11:56:42 +09:00
parent f4196efb10
commit 7ea08441ed
23 changed files with 661 additions and 25 deletions
+44
View File
@@ -0,0 +1,44 @@
#include "fesa/io/Hdf5ResultWriter.hpp"
#include <stdexcept>
namespace {
int require(bool condition) {
return condition ? 0 : 1;
}
template <typename Exception, typename Function>
int require_throws(Function&& function) {
try {
function();
} catch (const Exception&) {
return 0;
} catch (...) {
return 1;
}
return 1;
}
int construct_writer_preserves_output_path() {
const fesa::io::Hdf5ResultWriter writer{"results.h5"};
return require(writer.filePath() == "results.h5");
}
int empty_output_path_throws() {
return require_throws<std::invalid_argument>([]() {
(void)fesa::io::Hdf5ResultWriter{""};
});
}
} // namespace
int main() {
if (const int result = construct_writer_preserves_output_path(); result != 0) {
return result;
}
if (const int result = empty_output_path_throws(); result != 0) {
return result;
}
return 0;
}