refactor: move test_helpers, RunningQuality
This commit is contained in:
33
google-tests/test_helpers.h
Normal file
33
google-tests/test_helpers.h
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// Created by david on 11.03.2026.
|
||||
//
|
||||
|
||||
#ifndef PASADASUPERPROJECT_TEST_HELPERS_H
|
||||
#define PASADASUPERPROJECT_TEST_HELPERS_H
|
||||
|
||||
#include "npy.hpp"
|
||||
#include "ssf_filter.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
template <typename T> static std::vector<double> apply_filter(T& filter, std::vector<double>& x) {
|
||||
std::vector<double> y;
|
||||
y.resize(x.size());
|
||||
for (int i = 0; i < x.size(); i++) {
|
||||
y[i] = filter.filter(x[i]);
|
||||
}
|
||||
return y;
|
||||
}
|
||||
|
||||
void npy_save(std::string path, std::vector<double>& x);
|
||||
|
||||
std::vector<double> fetch_y_axis(npy::npy_data<double>& acc);
|
||||
|
||||
/** Returns the ssf_threshold as the filter output for debugging. */
|
||||
class DebugSsfStepDetectorThreshold : public SsfStepDetector {
|
||||
public:
|
||||
DebugSsfStepDetectorThreshold(size_t len_refr);
|
||||
double filter(double val);
|
||||
};
|
||||
|
||||
#endif //PASADASUPERPROJECT_TEST_HELPERS_H
|
||||
Reference in New Issue
Block a user