diff options
Diffstat (limited to 'core/test_pla_getset.cpp')
-rw-r--r-- | core/test_pla_getset.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/core/test_pla_getset.cpp b/core/test_pla_getset.cpp new file mode 100644 index 0000000..08065f2 --- /dev/null +++ b/core/test_pla_getset.cpp @@ -0,0 +1,44 @@ +#include <boost/mpl/pair.hpp> +#include <iostream> + +#include "context.hpp" +#include "continuous_property.hpp" +#include "pla_get.hpp" +#include "pla_set.hpp" +#include "property_composition.hpp" +#include "pointers.hpp" +#include "time.hpp" + +#include "mempool.hpp" + +// create a test property +#define RASIMU_MODEL +#include "model.hpp" +#include "property_abbrevations_begin.hpp" +GEN_CP(Neuron, TestProp, "test_prop", int, 42); +GEN_CP_EVOLVE(TestProp, _CP(TestProp)); + +using namespace std; + +int main() { + using boost::mpl::pair; + using boost::mpl::list; + using boost::mpl::bool_; + + // below is bullshit + PropertyComposition<list<boost::mpl::pair<TestProp, bool_<true>>>> pc; + + for (int j=0; j<100; j++) { + for (Ptr<Neuron>::ptr_t i=0; i<100; i++) { + PLA_Set<TestProp> set{Time{double{j}}, Ptr<Neuron>{i}, 42 * i + j}; + pc.call(set); + } + for (int i=0; i<100; i++) { + PLA_Get<TestProp> get{Time{double{j}}, Ptr<Neuron>(i)}; + assert(pc.call(get) == (42 * i + j)); + } + } + + // success + return 0; +} |