summaryrefslogtreecommitdiff
path: root/core/test_pla_getset.cpp
blob: 08065f2a3f5e28e1e79792279b732f3827960190 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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;
}
contact: Jan Huwald // Impressum