#include #include "index_global.hpp" #include "index_spike.hpp" using namespace std; int main() { Index g; Index s; // add/check some global events for (uint i=0; i<1000; i++) { Index::ptr_t r; r = g.add(Time(i), Time(i), Ptr()); if (r != i) { cerr << "discontinuous global event allocation (event: " << i << ", ptr: " << r << ")" << endl; return -1; } } // add some spike events for (uint i=0; i<1000; i++) { s.add(i, i, Ptr(i)); } for (uint i=0; i<1000; i++) { if (s.last(i) != i) { cerr << "last(" << i << ") = " << s.last(i) << " != " << i << endl; return -1; } if (s.last(10000, Ptr(i)) != i) { cerr << "last(inf, " << i << ") = " << s.last(i) << " != " << i << endl; return -1; } } // and check if we found the corrent one return 0; // success }