2010-02-11 11:15:57 +01:00
|
|
|
#ifndef _OWLPS_POSITIONING_TESTS_TESTUTIL_HH_
|
|
|
|
#define _OWLPS_POSITIONING_TESTS_TESTUTIL_HH_
|
|
|
|
|
2010-02-15 20:39:08 +01:00
|
|
|
#include "accesspoint.hh"
|
|
|
|
#include "mobile.hh"
|
|
|
|
#include "request.hh"
|
2010-02-16 16:19:39 +01:00
|
|
|
#include "measurement.hh"
|
2010-02-15 20:39:08 +01:00
|
|
|
|
2010-02-11 11:15:57 +01:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2010-02-16 16:19:39 +01:00
|
|
|
#include <boost/tr1/unordered_map.hpp>
|
2010-02-11 11:15:57 +01:00
|
|
|
|
|
|
|
class TestUtil
|
|
|
|
{
|
|
|
|
public:
|
2010-02-15 20:39:08 +01:00
|
|
|
static std::vector<AccessPoint> aps ;
|
|
|
|
static std::vector<Mobile> mobiles ;
|
|
|
|
static std::vector<Request> requests ;
|
|
|
|
|
|
|
|
static void set_up(void) ;
|
|
|
|
static void tear_down(void) ;
|
|
|
|
|
2010-02-11 11:15:57 +01:00
|
|
|
static void fill_file(const std::string &output_file_name,
|
2010-02-15 20:39:08 +01:00
|
|
|
const std::vector<std::string> output_lines) ;
|
2010-02-11 11:15:57 +01:00
|
|
|
static void remove_file(const std::string &file_name) ;
|
2010-02-12 16:45:04 +01:00
|
|
|
|
2010-02-15 20:39:08 +01:00
|
|
|
static void create_test_csv_file(const std::string &file_name,
|
|
|
|
bool with_spaces = false) ;
|
2010-02-16 16:19:39 +01:00
|
|
|
|
|
|
|
static bool request_equals(const Request &first,
|
|
|
|
const Request &second) ;
|
|
|
|
static bool measurements_unordered_map_equals(
|
|
|
|
std::tr1::unordered_map<std::string,Measurement> first,
|
|
|
|
std::tr1::unordered_map<std::string,Measurement> second) ;
|
|
|
|
static bool measurement_equals(const Measurement &first,
|
|
|
|
const Measurement &second) ;
|
|
|
|
|
|
|
|
|
|
|
|
static bool file_size_equals(const std::string &file1_name,
|
|
|
|
const std::string &file2_name) ;
|
|
|
|
static off_t file_size(const std::string &file_name) ;
|
|
|
|
|
2010-02-11 11:15:57 +01:00
|
|
|
} ;
|
|
|
|
|
|
|
|
#endif // _OWLPS_POSITIONING_TESTS_TESTUTIL_HH_
|