-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3144 from ARMmbed/release-candidate
Release candidate for 5.2.1
- Loading branch information
Showing
943 changed files
with
519,311 additions
and
29,831 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#include "mbed.h" | ||
#include "greentea-client/test_env.h" | ||
#include "unity.h" | ||
#include "utest.h" | ||
|
||
using namespace utest::v1; | ||
|
||
|
||
// IP parsing verification | ||
void test_ip_accept(const char *string, nsapi_addr_t addr) { | ||
SocketAddress address; | ||
TEST_ASSERT(address.set_ip_address(string)); | ||
TEST_ASSERT(address == SocketAddress(addr)); | ||
} | ||
|
||
template <const char *string> | ||
void test_ip_reject() { | ||
SocketAddress address; | ||
TEST_ASSERT(!address.set_ip_address(string)); | ||
TEST_ASSERT(!address); | ||
} | ||
|
||
#define TEST_IP_ACCEPT(name, string, ...) \ | ||
void name() { \ | ||
nsapi_addr_t addr = __VA_ARGS__; \ | ||
test_ip_accept(string, addr); \ | ||
} | ||
|
||
#define TEST_IP_REJECT(name, string) \ | ||
void name() { \ | ||
test_ip_reject(string); \ | ||
} | ||
|
||
|
||
// Test cases | ||
TEST_IP_ACCEPT(test_simple_ipv4_address, | ||
"12.34.56.78", | ||
{NSAPI_IPv4,{12,34,56,78}}) | ||
TEST_IP_ACCEPT(test_left_weighted_ipv4_address, | ||
"255.0.0.0", | ||
{NSAPI_IPv4,{255,0,0,0}}) | ||
TEST_IP_ACCEPT(test_right_weighted_ipv4_address, | ||
"0.0.0.255", | ||
{NSAPI_IPv4,{0,0,0,255}}) | ||
TEST_IP_ACCEPT(test_null_ipv4_address, | ||
"0.0.0.0", | ||
{NSAPI_IPv4,{0,0,0,0}}) | ||
|
||
TEST_IP_ACCEPT(test_simple_ipv6_address, | ||
"1234:5678:9abc:def0:1234:5678:9abc:def0", | ||
{NSAPI_IPv6,{0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0, | ||
0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0}}) | ||
TEST_IP_ACCEPT(test_left_weighted_ipv6_address, | ||
"1234:5678::", | ||
{NSAPI_IPv6,{0x12,0x34,0x56,0x78,0x00,0x00,0x00,0x00, | ||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}) | ||
TEST_IP_ACCEPT(test_right_weighted_ipv6_address, | ||
"::1234:5678", | ||
{NSAPI_IPv6,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | ||
0x00,0x00,0x00,0x00,0x12,0x34,0x56,0x78}}) | ||
TEST_IP_ACCEPT(test_hollowed_ipv6_address, | ||
"1234:5678::9abc:def8", | ||
{NSAPI_IPv6,{0x12,0x34,0x56,0x78,0x00,0x00,0x00,0x00, | ||
0x00,0x00,0x00,0x00,0x9a,0xbc,0xde,0xf8}}) | ||
TEST_IP_ACCEPT(test_null_ipv6_address, | ||
"::", | ||
{NSAPI_IPv6,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | ||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}) | ||
|
||
|
||
// Test setup | ||
utest::v1::status_t test_setup(const size_t number_of_cases) { | ||
GREENTEA_SETUP(10, "default_auto"); | ||
return verbose_test_setup_handler(number_of_cases); | ||
} | ||
|
||
Case cases[] = { | ||
Case("Simple IPv4 address", test_simple_ipv4_address), | ||
Case("Left-weighted IPv4 address", test_left_weighted_ipv4_address), | ||
Case("Right-weighted IPv4 address", test_right_weighted_ipv4_address), | ||
Case("Null IPv4 address", test_null_ipv4_address), | ||
|
||
Case("Simple IPv6 address", test_simple_ipv6_address), | ||
Case("Left-weighted IPv6 address", test_left_weighted_ipv6_address), | ||
Case("Right-weighted IPv6 address", test_right_weighted_ipv6_address), | ||
Case("Hollowed IPv6 address", test_hollowed_ipv6_address), | ||
Case("Null IPv6 address", test_null_ipv6_address), | ||
}; | ||
|
||
Specification specification(test_setup, cases); | ||
|
||
int main() { | ||
return !Harness::run(specification); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Build Profiles | ||
Mbed 5.0 supports three primary build profiles, *default*, *debug* and *small*. When using | ||
the online compiler the *default* profile is used. When building from the command line | ||
the desired profile can be can be selected by adding the ```--profile <profile>``` | ||
command line flag. Custom user defined profiles can also be specific by giving the path | ||
the the profile. | ||
|
||
## Default profile | ||
* Small and fast code | ||
* Full error information - e.x. asserts have filename and line number | ||
* Hard to follow code flow when using a debugger | ||
|
||
## Debug profile | ||
* Easy to step through code with a debugger | ||
* Full error information - e.x. asserts have filename and line number | ||
* Largest and slowest profile | ||
|
||
## Small profile | ||
* Smallest profile and still fast | ||
* Minimal error information | ||
* Hard to follow code flow when using a debugger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.