1 #ifndef TEST_CASE_H_ 2 #define TEST_CASE_H_ 3 4 #include <string> 5 #include <vector> 6 #include <limits> 7 8 class TestCaseReader 9 { 10 public: 11 TestCaseReader(); 12 ~TestCaseReader(); 13 14 void loadFromFile(const char *filename); 15 16 void getTLE(char *tle[2]); 17 latitude()18 double latitude() const {return m_qth_latitude;} longitude()19 double longitude() const {return m_qth_longitude;} altitude()20 double altitude() const {return m_qth_altitude;} 21 alon()22 double alon() const {return m_alon;}; alat()23 double alat() const {return m_alat;}; 24 data()25 std::vector<std::vector<double> > &data() {return m_data;} 26 27 bool containsValidData(); 28 bool containsValidQth(); 29 bool containsValidTLE(); 30 bool containsValidAlonAlat(); 31 32 private: 33 std::string m_tle[2]; 34 35 double m_alat; 36 double m_alon; 37 38 double m_qth_latitude; 39 double m_qth_longitude; 40 double m_qth_altitude; 41 42 std::vector<std::vector<double> > m_data; 43 }; 44 45 bool fuzzyCompare(const double &x, const double &y, const double &epsilon = std::numeric_limits<double>::epsilon()); 46 47 /** 48 * Check whether input value lies within supplied boundary values. Order of boundary values is irrelevant. 49 * \param boundary_value_1 Boundary value 1 50 * \param boundary_value_2 Boundary value 2 51 * \param compared_value Compared value 52 * \param offset Offset added to each boundary value in order to permit larger deviations from the allowed range. Defaults to 0.05, since predict usually is accurate to two decimals 53 * \return True if the compared value lies within the boundary values 54 **/ 55 bool fuzzyCompareWithBoundaries(const double &boundary_value_1, const double &boundary_value_2, const double &compared_value, double offset = 0.05); 56 57 #endif 58