JaiaBot 2.1.1
JaiaBot micro-AUV software
 
Loading...
Searching...
No Matches
driver_tester.h
Go to the documentation of this file.
1// Copyright 2013-2021:
2// GobySoft, LLC (2013-)
3// Massachusetts Institute of Technology (2007-2014)
4// Community contributors (see AUTHORS file)
5// File authors:
6// Toby Schneider <toby@gobysoft.org>
7//
8//
9// This file is part of the Goby Underwater Autonomy Project Binaries
10// ("The Goby Binaries").
11//
12// The Goby Binaries are free software: you can redistribute them and/or modify
13// them under the terms of the GNU General Public License as published by
14// the Free Software Foundation, either version 2 of the License, or
15// (at your option) any later version.
16//
17// The Goby Binaries are distributed in the hope that they will be useful,
18// but WITHOUT ANY WARRANTY; without even the implied warranty of
19// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20// GNU General Public License for more details.
21//
22// You should have received a copy of the GNU General Public License
23// along with Goby. If not, see <http://www.gnu.org/licenses/>.
24
25#ifndef GOBY_TEST_ACOMMS_DRIVER_TESTER_DRIVER_TESTER_H
26#define GOBY_TEST_ACOMMS_DRIVER_TESTER_DRIVER_TESTER_H
27
28#include "goby/acomms/connect.h"
29#include "goby/acomms/modemdriver/mm_driver.h"
30#include "goby/acomms/protobuf/benthos_atm900.pb.h"
31#include "goby/util/binary.h"
32#include "goby/util/debug_logger.h"
33
34namespace goby
35{
36namespace test
37{
38namespace acomms
39{
41{
42 public:
43 DriverTester(std::shared_ptr<goby::acomms::ModemDriverBase> driver1,
44 std::shared_ptr<goby::acomms::ModemDriverBase> driver2,
45 const goby::acomms::protobuf::DriverConfig& cfg1,
46 const goby::acomms::protobuf::DriverConfig& cfg2, std::vector<int> tests_to_run,
47 goby::acomms::protobuf::DriverType driver_type);
48
49 int run();
50
51 private:
52 void handle_data_request1(goby::acomms::protobuf::ModemTransmission* msg);
53 void handle_modify_transmission1(goby::acomms::protobuf::ModemTransmission* msg);
54 void handle_transmit_result1(const goby::acomms::protobuf::ModemTransmission& msg);
55 void handle_data_receive1(const goby::acomms::protobuf::ModemTransmission& msg);
56
57 void handle_data_request2(goby::acomms::protobuf::ModemTransmission* msg);
58 void handle_modify_transmission2(goby::acomms::protobuf::ModemTransmission* msg);
59 void handle_transmit_result2(const goby::acomms::protobuf::ModemTransmission& msg);
60 void handle_data_receive2(const goby::acomms::protobuf::ModemTransmission& msg);
61
62 void test0();
63 void test1();
64 void test2();
65 void test3();
66 void test4();
67 void test5();
68 void test6();
69 void test7();
70
71 private:
72 std::shared_ptr<goby::acomms::ModemDriverBase> driver1_, driver2_;
73
74 int check_count_;
75
76 std::vector<int> tests_to_run_;
77 int tests_to_run_index_;
78 int test_number_;
79
80 std::string test_str0_, test_str1_, test_str2_, test_str3_, test_str_max_;
81 goby::acomms::protobuf::DriverType driver_type_;
82};
83} // namespace acomms
84} // namespace test
85} // namespace goby
86
87#endif
DriverTester(std::shared_ptr< goby::acomms::ModemDriverBase > driver1, std::shared_ptr< goby::acomms::ModemDriverBase > driver2, const goby::acomms::protobuf::DriverConfig &cfg1, const goby::acomms::protobuf::DriverConfig &cfg2, std::vector< int > tests_to_run, goby::acomms::protobuf::DriverType driver_type)