Skip to content

Commit adc4ce4

Browse files
author
Antti Kauppila
committed
Old Cellular UNITTESTS removed
1 parent 9f9aa4a commit adc4ce4

File tree

111 files changed

+9
-9484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+9
-9484
lines changed

UNITTESTS/features/cellular/framework/AT/at_cellulardevice/at_cellulardevicetest.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ TEST_F(TestAT_CellularDevice, test_AT_CellularDevice_close_network)
120120
ATHandler_stub::ref_count = 0;
121121

122122
EXPECT_TRUE(dev.open_network(&fh1));
123+
AT_CellularBase_stub::handler_value = AT_CellularBase_stub::handler_at_constructor_value;
123124
EXPECT_TRUE(ATHandler_stub::ref_count == 1);
124125

125126
dev.close_network();
@@ -134,6 +135,7 @@ TEST_F(TestAT_CellularDevice, test_AT_CellularDevice_close_sms)
134135
ATHandler_stub::ref_count = 0;
135136

136137
EXPECT_TRUE(dev.open_sms(&fh1));
138+
AT_CellularBase_stub::handler_value = AT_CellularBase_stub::handler_at_constructor_value;
137139
EXPECT_TRUE(ATHandler_stub::ref_count == 1);
138140

139141
dev.close_sms();
@@ -148,6 +150,7 @@ TEST_F(TestAT_CellularDevice, test_AT_CellularDevice_close_power)
148150
ATHandler_stub::ref_count = 0;
149151

150152
EXPECT_TRUE(dev.open_power(&fh1));
153+
AT_CellularBase_stub::handler_value = AT_CellularBase_stub::handler_at_constructor_value;
151154
EXPECT_TRUE(ATHandler_stub::ref_count == 1);
152155

153156
dev.close_power();
@@ -163,6 +166,8 @@ TEST_F(TestAT_CellularDevice, test_AT_CellularDevice_close_sim)
163166

164167

165168
EXPECT_TRUE(dev.open_sim(&fh1));
169+
AT_CellularBase_stub::handler_value = AT_CellularBase_stub::handler_at_constructor_value;
170+
166171
dev.close_sms(); // this should not affect to refcount as it's not opened
167172
EXPECT_TRUE(ATHandler_stub::ref_count == 1);
168173

@@ -191,6 +196,7 @@ TEST_F(TestAT_CellularDevice, test_AT_CellularDevice_close_information)
191196
AT_CellularBase_stub::handler_value = AT_CellularBase_stub::handler_at_constructor_value;
192197

193198
dev.close_information();
199+
EXPECT_TRUE(ATHandler_stub::ref_count == 1);
194200

195201
ATHandler_stub::fh_value = NULL;
196202
}

UNITTESTS/stubs/ATHandler_stub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void ATHandler::set_debug(bool debug_on)
6868

6969
ATHandler::~ATHandler()
7070
{
71-
ATHandler_stub::ref_count = -909;
71+
ATHandler_stub::ref_count = kATHandler_destructor_ref_ount;
7272
}
7373

7474
void ATHandler::inc_ref_count()

UNITTESTS/stubs/ATHandler_stub.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
static const int kRead_string_table_size = 100;
3030
static const int kRead_int_table_size = 100;
3131
static const int kResp_stop_count_default = 100;
32+
// set reference count to -909 to separate it from zero so we can test that ATHandler is really deleted.
33+
static const int kATHandler_destructor_ref_ount = -909;
3234

3335
namespace ATHandler_stub {
3436
extern nsapi_error_t nsapi_error_value;

UNITTESTS/stubs/SocketAddress_stub.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,16 @@
2222
#include "mbed.h"
2323

2424

25-
static bool ipv4_is_valid(const char *addr)
26-
{
27-
return false;
28-
}
29-
3025
static bool ipv6_is_valid(const char *addr)
3126
{
3227
return false;
3328
}
3429

35-
static void ipv4_from_address(uint8_t *bytes, const char *addr)
36-
{
37-
38-
}
39-
4030
static int ipv6_scan_chunk(uint16_t *shorts, const char *chunk)
4131
{
4232
return 0;
4333
}
4434

45-
static void ipv6_from_address(uint8_t *bytes, const char *addr)
46-
{
47-
48-
}
49-
50-
static void ipv4_to_address(char *addr, const uint8_t *bytes)
51-
{
52-
53-
}
54-
55-
static void ipv6_to_address(char *addr, const uint8_t *bytes)
56-
{
57-
}
58-
5935

6036
SocketAddress::SocketAddress(nsapi_addr_t addr, uint16_t port)
6137
{

features/cellular/UNITTESTS/Makefile

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)