Files
FESADev/tests/property/property_base_test.cpp
T
2026-06-09 11:56:42 +09:00

38 lines
900 B
C++

#include "fesa/property/Property.hpp"
#include <memory>
namespace {
int require(bool condition) {
return condition ? 0 : 1;
}
class TestProperty final : public fesa::property::Property {
public:
explicit TestProperty(fesa::core::PropertyId id) : id_(id) {}
fesa::core::PropertyId id() const noexcept override {
return id_;
}
fesa::property::PropertyKind kind() const noexcept override {
return fesa::property::PropertyKind::Shell;
}
private:
fesa::core::PropertyId id_;
};
} // namespace
int run_property_base_tests() {
std::unique_ptr<fesa::property::Property> owned = std::make_unique<TestProperty>(500);
const fesa::property::Property& property = *owned;
if (const int result = require(property.id() == 500); result != 0) {
return result;
}
return require(property.kind() == fesa::property::PropertyKind::Shell);
}