Files
Upsilon/apps/graph/test/helper.cpp
Gabriel Ozouf a1aefb0cb2 [apps/graph] Added tests on graph ranges
Change-Id: I6c080f40c934cd31083be3d19aa0a4d0bb33c5cc
2020-11-04 15:30:53 +01:00

17 lines
698 B
C++

#include "helper.h"
namespace Graph {
ContinuousFunction * addFunction(const char * definition, ContinuousFunction::PlotType type, ContinuousFunctionStore * store, Context * context) {
Ion::Storage::Record::ErrorStatus err = store->addEmptyModel();
assert(err == Ion::Storage::Record::ErrorStatus::None);
(void) err; // Silence compilation warning about unused variable.
Ion::Storage::Record record = store->recordAtIndex(store->numberOfModels() - 1);
ContinuousFunction * f = static_cast<ContinuousFunction *>(store->modelForRecord(record).operator->());
f->setPlotType(type, Poincare::Preferences::AngleUnit::Degree, context);
f->setContent(definition, context);
return f;
}
}