Subversion Repositories Projects

Rev

Rev 513 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 513 Rev 524
Line 1... Line 1...
1
#include "HandlerTest.h"
1
#include "HandlerTest.h"
-
 
2
#include <iostream>
Line 2... Line 3...
2
 
3
 
-
 
4
void HandlerTest::setUp(void) {
3
void HandlerTest::setUp(void) {
5
    std::cout << std::endl;
4
    handler = new Handler(&com, &data);
6
    handler = new Handler(&com, &data);
-
 
7
}
-
 
8
 
-
 
9
void HandlerTest::tearDown(void) {
-
 
10
    std::cout << "result";
Line 5... Line 11...
5
};
11
}
6
 
12
 
7
void HandlerTest::get_flightctrl_settings_test(void) {
13
void HandlerTest::get_flightctrl_settings_test(void) {
Line -... Line 14...
-
 
14
    handler->get_flightctrl_settings(0);
-
 
15
}
-
 
16
 
-
 
17
void HandlerTest::set_flightctrl_settings_test(void) {
-
 
18
    handler->set_flightctrl_settings(0);
-
 
19
    CPPUNIT_ASSERT_DOUBLES_EQUAL(1, 0, .00001);
-
 
20
}
-
 
21
 
-
 
22
void HandlerTest::motor_test_test(void) {
-
 
23
    sMotorData motor;
-
 
24
    handler->motor_test(motor);
-
 
25
}
-
 
26
 
-
 
27
void HandlerTest::reset_motor_test(void) {
-
 
28
    handler->reset_motor();
-
 
29
}
-
 
30
 
-
 
31
void HandlerTest::read_motor_mixer_test(void) {
-
 
32
    handler->read_motor_mixer();
-
 
33
}
-
 
34
 
-
 
35
void HandlerTest::write_motor_mixer_test(void) {
-
 
36
    handler->write_motor_mixer(0, 0);
-
 
37
}
-
 
38
 
-
 
39
void HandlerTest::get_motor_config_test(void) {
-
 
40
    handler->get_motor_config(0);
-
 
41
}
-
 
42
 
-
 
43
//NaviCtrl commands
-
 
44
void HandlerTest::set_navictrl_debug_test(void) {
-
 
45
    handler->set_navictrl_debug(10);
-
 
46
}
-
 
47
 
-
 
48
void HandlerTest::stop_navictrl_debug_test(void) {
-
 
49
    handler->stop_navictrl_debug();
-
 
50
}
-
 
51
 
-
 
52
void HandlerTest::send_waypoint_test(void) {
-
 
53
    Waypoint_t wp;
-
 
54
    handler->send_waypoint(wp);
-
 
55
}
-
 
56
 
-
 
57
void HandlerTest::add_waypoint_test(void) {
-
 
58
    Waypoint_t wp;
-
 
59
    handler->add_waypoint(wp);
-
 
60
}
-
 
61
 
-
 
62
void HandlerTest::delete_waypoints_test(void) {
-
 
63
    handler->delete_waypoints();
-
 
64
}
-
 
65
 
-
 
66
//switch between MK modules/components
-
 
67
void HandlerTest::switch_navictrl_test(void) {
-
 
68
    handler->switch_navictrl();
-
 
69
}
-
 
70
 
-
 
71
void HandlerTest::switch_flightctrl_test(void) {
-
 
72
    handler->switch_flightctrl();
-
 
73
}
-
 
74
 
-
 
75
void HandlerTest::switch_mk3mag_test(void) {
-
 
76
    handler->switch_mk3mag();
-
 
77
}
-
 
78
 
-
 
79
//commands for MK3MAG
-
 
80
 
-
 
81
//commands for all modules/components
-
 
82
void HandlerTest::set_all_debug_test(void) {
-
 
83
    handler->set_all_debug(10);
-
 
84
}
-
 
85
 
-
 
86
void HandlerTest::stop_all_debug_test(void) {
-
 
87
    handler->stop_all_debug();
-
 
88
}
-
 
89
 
-
 
90
void HandlerTest::get_analog_test(void) {
-
 
91
    handler->get_analog();
-
 
92
}
-
 
93
 
-
 
94
void HandlerTest::show_lcd_test(void) {
-
 
95
    handler->show_lcd();
-
 
96
}
-
 
97
 
-
 
98
void HandlerTest::lcd_up_test(void) {
8
    handler->get_flightctrl_settings(0);
99
    handler->lcd_up();
-
 
100
}
-
 
101
 
-
 
102
void HandlerTest::lcd_down_test(void) {
-
 
103
    handler->lcd_down();
-
 
104
}
-
 
105
 
-
 
106
void HandlerTest::get_version_test(void) {
-
 
107
    handler->get_version();
-
 
108
}
9
};
109