File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
features/cellular/UNITTESTS Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ void Test_AT_CellularDevice::test_AT_CellularDevice_close_network()
122
122
CHECK (ATHandler_stub::ref_count == 1 );
123
123
124
124
dev.close_network ();
125
- CHECK (ATHandler_stub::ref_count == - 909 );
125
+ CHECK (ATHandler_stub::ref_count == kATHandler_destructor_ref_ount );
126
126
}
127
127
128
128
void Test_AT_CellularDevice::test_AT_CellularDevice_close_sms ()
@@ -137,7 +137,7 @@ void Test_AT_CellularDevice::test_AT_CellularDevice_close_sms()
137
137
CHECK (ATHandler_stub::ref_count == 1 );
138
138
139
139
dev.close_sms ();
140
- CHECK (ATHandler_stub::ref_count == - 909 );
140
+ CHECK (ATHandler_stub::ref_count == kATHandler_destructor_ref_ount );
141
141
}
142
142
143
143
void Test_AT_CellularDevice::test_AT_CellularDevice_close_power ()
@@ -152,7 +152,7 @@ void Test_AT_CellularDevice::test_AT_CellularDevice_close_power()
152
152
CHECK (ATHandler_stub::ref_count == 1 );
153
153
154
154
dev.close_power ();
155
- CHECK (ATHandler_stub::ref_count == - 909 );
155
+ CHECK (ATHandler_stub::ref_count == kATHandler_destructor_ref_ount );
156
156
}
157
157
158
158
void Test_AT_CellularDevice::test_AT_CellularDevice_close_sim ()
@@ -170,7 +170,7 @@ void Test_AT_CellularDevice::test_AT_CellularDevice_close_sim()
170
170
CHECK (ATHandler_stub::ref_count == 1 );
171
171
172
172
dev.close_sim ();
173
- CHECK (ATHandler_stub::ref_count == - 909 );
173
+ CHECK (ATHandler_stub::ref_count == kATHandler_destructor_ref_ount );
174
174
}
175
175
176
176
void Test_AT_CellularDevice::test_AT_CellularDevice_close_information ()
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ void ATHandler::set_debug(bool debug_on)
68
68
69
69
ATHandler::~ATHandler ()
70
70
{
71
- ATHandler_stub::ref_count = - 909 ;
71
+ ATHandler_stub::ref_count = kATHandler_destructor_ref_ount ;
72
72
}
73
73
74
74
void ATHandler::inc_ref_count ()
Original file line number Diff line number Diff line change 26
26
static const int kRead_string_table_size = 100 ;
27
27
static const int kRead_int_table_size = 100 ;
28
28
static const int kResp_stop_count_default = 100 ;
29
+ // set reference count to -909 to separate it from zero so we can test that ATHandler is really deleted.
30
+ static const int kATHandler_destructor_ref_ount = -909 ;
29
31
30
32
namespace ATHandler_stub {
31
33
extern nsapi_error_t nsapi_error_value;
You can’t perform that action at this time.
0 commit comments