diff --git a/storage.h b/storage.h index 583ba08..3495604 100644 --- a/storage.h +++ b/storage.h @@ -122,7 +122,7 @@ namespace catima{ ~Data(); void Add(const Projectile &p, const Material &t, Config c=default_config); int GetN() const {return storage.size();}; - void Reset(){storage.clear();storage.resize(max_storage_data);}; + void Reset(){storage.clear();storage.resize(max_storage_data);index=storage.begin();}; DataPoint& Get(const Projectile &p, const Material &t, Config c=default_config); int get_index() {return std::distance(storage.begin(),index);} private: diff --git a/tests/test_storage.cpp b/tests/test_storage.cpp index fe0ded7..4b7b646 100644 --- a/tests/test_storage.cpp +++ b/tests/test_storage.cpp @@ -4,7 +4,17 @@ using namespace std; #include "catima/catima.h" #include "catima/storage.h" -#include "catima/material_database.h" + +bool rcompare(double a, double b,double eps){ + if(fabs((a-b)/fabs(b))