Skip to content

Commit f821b02

Browse files
author
Teppo Järvelin
committed
Cellular: fixed unit tests after rebase with latest changes.
1 parent 7e1b048 commit f821b02

File tree

7 files changed

+66
-18
lines changed

7 files changed

+66
-18
lines changed

features/cellular/UNITTESTS/common/util/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ TEST_SRC_FILES = \
1010
main.cpp \
1111
utiltest.cpp \
1212
test_util.cpp \
13+
../../stubs/randLIB_stub.cpp \
1314

1415
include ../../MakefileWorker.mk
1516

features/cellular/UNITTESTS/stubs/AT_CellularNetwork_stub.cpp

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,6 @@ nsapi_error_t AT_CellularNetwork::set_blocking(bool blocking)
9090
return NSAPI_ERROR_OK;;
9191
}
9292

93-
nsapi_error_t AT_CellularNetwork::set_context_to_be_activated()
94-
{
95-
return NSAPI_ERROR_OK;
96-
}
97-
98-
//bool AT_CellularNetwork::set_new_context(nsapi_ip_stack_t stack, int cid)
99-
//{
100-
// return false;
101-
//}
102-
103-
//bool AT_CellularNetwork::get_context(nsapi_ip_stack_t requested_stack)
104-
//{
105-
// return false;
106-
//}
107-
10893
nsapi_ip_stack_t AT_CellularNetwork::string_to_stack_type(const char* pdp_type)
10994
{
11095
return IPV4_STACK;
@@ -261,3 +246,11 @@ nsapi_error_t AT_CellularNetwork::get_operator_names(operator_names_list &op_nam
261246
{
262247
return NSAPI_ERROR_OK;
263248
}
249+
250+
nsapi_error_t AT_CellularNetwork::do_user_authentication()
251+
{
252+
return NSAPI_ERROR_OK;
253+
}
254+
255+
256+

features/cellular/UNITTESTS/stubs/AT_CellularPower_stub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ nsapi_error_t AT_CellularPower::set_at_mode()
4545
return NSAPI_ERROR_OK;
4646
}
4747

48-
nsapi_error_t AT_CellularPower::set_power_level(int func_level)
48+
nsapi_error_t AT_CellularPower::set_power_level(int func_level, int do_reset)
4949
{
5050
return NSAPI_ERROR_OK;
5151
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2017, Arm Limited and affiliates.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
#include "randLIB.h"
18+
19+
void randLIB_seed_random(void)
20+
{
21+
}
22+
23+
uint16_t randLIB_get_random_in_range(uint16_t min, uint16_t max)
24+
{
25+
return min;
26+
}
27+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2017, Arm Limited and affiliates.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
#ifndef FEATURES_CELLULAR_UNITTESTS_TARGET_H_RANDLIB_H_
18+
#define FEATURES_CELLULAR_UNITTESTS_TARGET_H_RANDLIB_H_
19+
20+
#include <stdint.h>
21+
22+
extern void randLIB_seed_random(void);
23+
24+
uint16_t randLIB_get_random_in_range(uint16_t min, uint16_t max);
25+
26+
27+
#endif /* FEATURES_CELLULAR_UNITTESTS_TARGET_H_RANDLIB_H_ */

features/cellular/framework/AT/AT_CellularNetwork.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ class AT_CellularNetwork : public CellularNetwork, public AT_CellularBase
142142
*/
143143
virtual nsapi_error_t set_access_technology_impl(RadioAccessTechnology op_rat);
144144

145+
virtual nsapi_error_t do_user_authentication();
145146
private:
146147
// "NO CARRIER" urc
147148
void urc_no_carrier();
@@ -179,7 +180,6 @@ class AT_CellularNetwork : public CellularNetwork, public AT_CellularBase
179180
AuthenticationType _authentication_type;
180181
int _cell_id;
181182
nsapi_connection_status_t _connect_status;
182-
virtual nsapi_error_t do_user_authentication();
183183
bool _new_context_set;
184184
bool _is_context_active;
185185
RegistrationStatus _reg_status;

features/cellular/framework/common/CellularUtil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ uint16_t get_dynamic_ip_port()
334334
if (port_counter >= RANDOM_PORT_NUMBER_COUNT) {
335335
port_counter -= RANDOM_PORT_NUMBER_COUNT;
336336
}
337-
337+
338338
return (RANDOM_PORT_NUMBER_START + port_counter);
339339
}
340340

0 commit comments

Comments
 (0)