Skip to content

Commit 378a70c

Browse files
committed
Fixes for test fails and code style update
1 parent 2008295 commit 378a70c

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

platform/mbed_retarget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static SingletonPtr<PlatformMutex> _mutex;
5656
# define OPEN_MAX _SYS_OPEN
5757
# ifdef __MICROLIB
5858
# if __ARMCC_VERSION >= 6010050
59-
asm(" .global __use_full_stdio\n");
59+
asm(" .global __use_full_stdio\n");
6060
# else
6161
# pragma import(__use_full_stdio)
6262
# endif
@@ -1255,7 +1255,7 @@ extern "C" WEAK caddr_t _sbrk(int incr)
12551255
/* __HeapLimit is end of heap section */
12561256
if (new_heap > (uint32_t) &__HeapLimit) {
12571257
errno = ENOMEM;
1258-
return (caddr_t) -1;
1258+
return (caddr_t) - 1;
12591259
}
12601260

12611261
heap = new_heap;

tools/test/build_api/build_api_test.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@
3030
Tests for build_api.py
3131
"""
3232
make_mock_target = namedtuple(
33-
"Target", "init_hooks name features core supported_toolchains")
34-
33+
"Target", "init_hooks name features core supported_toolchains build_tools_metadata")
34+
#Add ARMC5 to the supported_toolchains list as ARMC5 actually refers ARM Compiler 5 and is needed by ARM/ARM_STD classes when it checks for supported toolchains
35+
TOOLCHAINS.add("ARMC5")
36+
#Make a mock build_tools_metadata
37+
mock_build_tools_metadata = {u'version':0, u'public':False}
3538

3639
class BuildApiTests(unittest.TestCase):
3740
"""
@@ -92,7 +95,7 @@ def test_prepare_toolchain_app_config(self, mock_config_init):
9295
"""
9396
app_config = "app_config"
9497
mock_target = make_mock_target(lambda _, __ : None,
95-
"Junk", [], "Cortex-M3", TOOLCHAINS)
98+
"Junk", [], "Cortex-M3", TOOLCHAINS, mock_build_tools_metadata)
9699
mock_config_init.return_value = namedtuple(
97100
"Config", "target has_regions name")(mock_target, False, None)
98101

@@ -111,7 +114,7 @@ def test_prepare_toolchain_no_app_config(self, mock_config_init):
111114
:return:
112115
"""
113116
mock_target = make_mock_target(lambda _, __ : None,
114-
"Junk", [], "Cortex-M3", TOOLCHAINS)
117+
"Junk", [], "Cortex-M3", TOOLCHAINS, mock_build_tools_metadata)
115118
mock_config_init.return_value = namedtuple(
116119
"Config", "target has_regions name")(mock_target, False, None)
117120

0 commit comments

Comments
 (0)