feat: add property model foundation
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#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);
|
||||
}
|
||||
Reference in New Issue
Block a user