Commit Graph

60 Commits (mbed-os-5.10)

Author SHA1 Message Date
Antti Kauppila 1758c5157a LoRaWANTimer UT fixed 2018-11-16 14:49:17 +00:00
adbridge 3aa8d7f906 Revert "Use the parsing status as a way to detect if the IP string represent a valid IPv6 address"
This reverts commit 99aa1dca0a.
This has been moved to 5.11
2018-11-05 12:36:59 +00:00
Antti Kauppila 45c0fa10cc Unittest fixes 2018-11-02 19:50:00 -05:00
Michal Paszta e1887a7738 TCPSocket accept refactored to close cleanly and icetea test added
Private constructor called in TCPSocket accept, when creating a new Socket.
Close() method calls moved "up" to InternetSocket.
InternetSocket::close() returns proper error code when no socket available.
Add TcpSocket::accept icetea tests.
Deleting sockets moved to teardown.
2018-11-02 19:49:59 -05:00
Taiki 99aa1dca0a Use the parsing status as a way to detect if the IP string represent a valid IPv6 address 2018-11-02 19:49:54 -05:00
Mirela Chirica fcfdb099ab Cellular: Fix for AT handler consume to tag
If sequence from buffer contains tag but symbol before tag is same as
first symbol of the tag, then the tag wasn't detected.

For example, "\r\n" tag was not found from "\r\r\nOK" sequence.
2018-11-02 19:49:52 -05:00
Lari-Matias Orjala cb69f8ce42 update unit testing documentation for Mac OS Mojave 2018-11-02 19:49:51 -05:00
Antti Kauppila 3e24f2570a Fixed lorawan unittests valgrind issues 2018-10-19 11:46:55 +01:00
Hasnain Virk fa1a6d27b8 Unit test fix for cancel_send()
PR 8299 went in but correct unit tests were not there.
This commit is adding proper unittests for 8299.
2018-10-19 11:46:55 +01:00
Hasnain Virk f6d50cc55d Unit Test Fixes for LoRaWAN
Missing methods are added.
Logic was broken at various places which needed to be fixed.
2018-10-19 11:46:55 +01:00
Sławek Piotrowski 50dd1eb950 Fix hard-fault when socket created using accept() is closed
When socket created  using accept() is closed by calling the close()
method, "delete this" is executed which triggers the destructor call
on TCPSocket which in turn calls close() once again. Because _stack
is already 0 this results in a hard-fault.

Add a check that skips the rest of the close() method is the _stack
is already 0.
2018-10-19 11:46:55 +01:00
Amanda Butler 72842bb3b8 Edit README.md
Edit readme.
2018-10-19 11:46:55 +01:00
Lari-Matias Orjala dfa1b540c7 Improve unit testing instructions. 2018-10-19 11:46:55 +01:00
Michal Paszta 8c72bd5c0b unittests: Added tests for netsocket classes
New classes covered with unit tests: SocketAddress, EthernetInterface, EMACInterface, WiFiAccessPoint.
Also added missing namespace in front of mbed::Callback usages.
EMACInterface is covered by the EthernetInterface unit tests.
2018-10-19 11:46:55 +01:00
Kimmo Vaisanen 5e105ddb7b Cellular: Fix ATHandler_stub compiler warnings 2018-10-19 11:46:55 +01:00
Kimmo Vaisanen bff5c3be86 Cellular: Fix AT_CellularStack unittest
Missing CellularSocket constructor caused uninitialized values to be used.

Also changed comparision macros to ASSERT_EQ as suggested by GoogleTest guide.
2018-10-19 11:46:55 +01:00
Antti Kauppila dbe2b15daa equeue_stub updated and code fixed accordingly 2018-10-08 15:29:18 +01:00
Antti Kauppila 04c16412cf cmake Paths corrected 2018-10-08 15:29:18 +01:00
Antti Kauppila 18a1e66ebc LoRaMac unittested 2018-10-08 15:29:18 +01:00
Antti Kauppila 8bed43e4f8 LoRaWANStack unit tested 2018-10-08 15:29:18 +01:00
Antti Kauppila 41d0648fdd LoRaMacCrypto unittested 2018-10-08 15:29:18 +01:00
Antti Kauppila 1f24d725a7 LoRaPHY unittested, small fixed done during tests 2018-10-08 15:29:18 +01:00
Antti Kauppila 07d2ce69ca LoRa regions unittested, stubs licences revisited 2018-10-08 15:18:50 +01:00
Antti Kauppila 323ea129be LoraPhy and regions unit test skeletons added 2018-10-08 15:18:50 +01:00
Antti Kauppila b1c62a9ecd Unit test for LorawanInterface 2018-10-08 15:18:50 +01:00
Antti Kauppila ed8ebf335a LorawanInterface unit test added 2018-10-08 15:18:50 +01:00
Antti Kauppila 474b652820 More lorawan unit tests added 2018-10-08 15:18:50 +01:00
Antti Kauppila b70d23a175 Lorawan unittests 2018-10-08 15:18:50 +01:00
Seppo Takalo 3664339c39 Use SocketAddr that actually has IP bytes in UDP test 2018-10-08 15:18:50 +01:00
Seppo Takalo 5b659c898b Fix TCPSocket::accept() unittest.
accept() is not anymore returning NULL pointer. It was a bug.
2018-10-08 15:18:50 +01:00
Michal Paszta 6c012fc476 unittests: Add tests for NetworkStack class.
Improved the stubs for event queue and nsapi_dns, to allow checking if callback are handled correctly. This involves some memory allocation and deallocation.
The NetworkStackWrapper is not covered as it seems to be deprecated code.
2018-10-08 15:18:50 +01:00
Michal Paszta 43ca738436 unittests: Add TCPServer unit tests
TCPServer class only really implements attach method.
2018-10-08 15:18:50 +01:00
Michal Paszta 54ee25cf1e unittests: Added NetworkInterface unit tests
Most functions are empty or simply return "UNSUPPORTED", but it is still worth covering this functions with unit tests to have better control of unwanted changes.
2018-10-08 15:18:50 +01:00
Michal Paszta 77fc6a0347 unittests: InternetSocket class coverage improved.
Added more tests, improved the existing ones. setblocking tests were not checking anything, so they were removed and these functions are called in TCPSocket tests instead.
2018-10-08 15:18:50 +01:00
Michal Paszta 46b529a1ea unittests: Check NULL pointer scenario in TCPSocket::recvfrom 2018-10-08 15:18:50 +01:00
Michal Paszta 2bbf033fe2 unittests: improved coverage for UDPSocket and TCPSocket
Add functional and line coverage for UDPSocket and TCPSocket. The EventFlagsstub and NetworkStackstub classes are allowed to store multiple return values to allow running internal loops multiple times.
2018-10-08 15:18:50 +01:00
Lari-Matias Orjala cb80c49f3a Unit tests: improve argument checking in coverage.py 2018-10-08 15:18:50 +01:00
Lari-Matias Orjala 605a72cead add coverage filtering 2018-10-08 15:18:50 +01:00
Mirela Chirica 82ba6314dc Cellular: Fix cellular util unit test 2018-10-08 15:18:50 +01:00
Mirela Chirica 523edf0561 Cellular: Fix cellular network unit test 2018-10-08 15:18:50 +01:00
Lari-Matias Orjala f681e54690 update UNITTESTS/README.md 2018-10-08 15:18:50 +01:00
Lari-Matias Orjala 2bd1f64531 replace missing types 2018-10-08 15:18:50 +01:00
Lari-Matias Orjala 814ff08789 fix athandler unit tests and declaration conflict 2018-10-08 15:18:50 +01:00
studavekar e1b57ef24e specify mbed-cli version requirement 2018-10-08 15:18:50 +01:00
Lari-Matias Orjala e49523b11c remove test suite names from cellular tests 2018-10-08 15:18:50 +01:00
Lari-Matias Orjala 2c8550b510 update test file generator 2018-10-08 15:18:50 +01:00
Lari-Matias Orjala b6b331f94d add auto-naming of unit test suites 2018-10-08 15:18:50 +01:00
Antti Kauppila fc97b2aca0 Rebased & fixed 2018-10-08 15:18:50 +01:00
Antti Kauppila eff5f392b4 Small improvements for test cases 2018-10-08 15:18:50 +01:00
Antti Kauppila 3945ea6bf5 Old Cellular UNITTESTS removed 2018-10-08 15:18:50 +01:00