Merge pull request #12073 from AnttiKauppila/UT_fixed

cellular: unittests fix after PRs 12051 and 11996
pull/12080/head
Martin Kojtal 2019-12-10 17:52:35 +01:00 committed by GitHub
commit 76ae27e762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 46 additions and 13 deletions

View File

@ -34,4 +34,10 @@ set(unittest-test-sources
stubs/NetworkInterface_stub.cpp
stubs/NetworkInterfaceDefaults_stub.cpp
stubs/Mutex_stub.cpp
stubs/Semaphore_stub.cpp
)
set(unittest-test-flags
-DDEVICE_SERIAL=1
-DDEVICE_INTERRUPTIN=1
)

View File

@ -36,4 +36,10 @@ set(unittest-test-sources
stubs/randLIB_stub.cpp
stubs/ConditionVariable_stub.cpp
stubs/Mutex_stub.cpp
stubs/Semaphore_stub.cpp
)
set(unittest-test-flags
-DDEVICE_SERIAL=1
-DDEVICE_INTERRUPTIN=1
)

View File

@ -37,8 +37,11 @@ set(unittest-test-sources
stubs/NetworkInterface_stub.cpp
stubs/NetworkInterfaceDefaults_stub.cpp
stubs/Mutex_stub.cpp
stubs/Semaphore_stub.cpp
)
set(unittest-test-flags
-DMBED_CONF_CELLULAR_USE_SMS=1
-DDEVICE_SERIAL=1
-DDEVICE_INTERRUPTIN=1
)

View File

@ -43,4 +43,11 @@ set(unittest-test-sources
stubs/ThisThread_stub.cpp
stubs/ConditionVariable_stub.cpp
stubs/Mutex_stub.cpp
stubs/Semaphore_stub.cpp
)
set(unittest-test-flags
-DDEVICE_SERIAL=1
-DDEVICE_INTERRUPTIN=1
)

View File

@ -32,7 +32,11 @@ int AT_CellularDevice_stub::get_sim_failure_count = 0;
bool AT_CellularDevice_stub::pin_needed = false;
bool AT_CellularDevice_stub::supported_bool = false;
AT_CellularDevice::AT_CellularDevice(FileHandle *fh) : CellularDevice(fh), _network(0), _sms(0),
AT_CellularDevice::AT_CellularDevice(FileHandle *fh) : CellularDevice(fh),
#if MBED_CONF_CELLULAR_USE_SMS
_sms(0),
#endif // MBED_CONF_CELLULAR_USE_SMS
_network(0),
_information(0), _context_list(0), _default_timeout(DEFAULT_AT_TIMEOUT), _modem_debug_on(false)
{
}
@ -87,12 +91,23 @@ CellularNetwork *AT_CellularDevice::open_network(FileHandle *fh)
_modem_debug_on), *this);
return _network;
}
#if MBED_CONF_CELLULAR_USE_SMS
CellularSMS *AT_CellularDevice::open_sms(FileHandle *fh)
{
return NULL;
}
void AT_CellularDevice::close_sms()
{
}
AT_CellularSMS *AT_CellularDevice::open_sms_impl(ATHandler &at)
{
return NULL;
}
#endif // MBED_CONF_CELLULAR_USE_SMS
CellularInformation *AT_CellularDevice::open_information(FileHandle *fh)
{
return NULL;
@ -108,10 +123,6 @@ void AT_CellularDevice::close_network()
}
}
void AT_CellularDevice::close_sms()
{
}
void AT_CellularDevice::close_information()
{
}
@ -142,11 +153,6 @@ AT_CellularNetwork *AT_CellularDevice::open_network_impl(ATHandler &at)
return _network;
}
AT_CellularSMS *AT_CellularDevice::open_sms_impl(ATHandler &at)
{
return NULL;
}
AT_CellularInformation *AT_CellularDevice::open_information_impl(ATHandler &at)
{
return NULL;

View File

@ -37,8 +37,12 @@ MBED_WEAK CellularDevice *CellularDevice::get_default_instance()
}
}
CellularDevice::CellularDevice(FileHandle *fh) : _network_ref_count(0), _sms_ref_count(0),
_info_ref_count(0), _fh(fh), _queue(5 * EVENTS_EVENT_SIZE), _state_machine(0), _nw(0)
CellularDevice::CellularDevice(FileHandle *fh) : _network_ref_count(0),
#if MBED_CONF_CELLULAR_USE_SMS
_sms_ref_count(0),
#endif //MBED_CONF_CELLULAR_USE_SMS
_info_ref_count(0), _fh(fh), _queue(10 * EVENTS_EVENT_SIZE), _state_machine(0),
_nw(0), _status_cb(0), _property_array(0)
{
}

View File

@ -23,6 +23,7 @@
#include "ATHandler_stub.h"
#include "AT_CellularContext.h"
#include "gtest/gtest.h"
#include "UARTSerial.h"
using namespace events;