Fixes for test fails and code style update

pull/9888/head
Senthil Ramakrishnan 2019-02-21 12:42:36 -06:00
parent 200829537f
commit 378a70ca62
2 changed files with 9 additions and 6 deletions

View File

@ -56,7 +56,7 @@ static SingletonPtr<PlatformMutex> _mutex;
# define OPEN_MAX _SYS_OPEN
# ifdef __MICROLIB
# if __ARMCC_VERSION >= 6010050
asm(" .global __use_full_stdio\n");
asm(" .global __use_full_stdio\n");
# else
# pragma import(__use_full_stdio)
# endif
@ -1255,7 +1255,7 @@ extern "C" WEAK caddr_t _sbrk(int incr)
/* __HeapLimit is end of heap section */
if (new_heap > (uint32_t) &__HeapLimit) {
errno = ENOMEM;
return (caddr_t) -1;
return (caddr_t) - 1;
}
heap = new_heap;

View File

@ -30,8 +30,11 @@ from intelhex import IntelHex
Tests for build_api.py
"""
make_mock_target = namedtuple(
"Target", "init_hooks name features core supported_toolchains")
"Target", "init_hooks name features core supported_toolchains build_tools_metadata")
#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
TOOLCHAINS.add("ARMC5")
#Make a mock build_tools_metadata
mock_build_tools_metadata = {u'version':0, u'public':False}
class BuildApiTests(unittest.TestCase):
"""
@ -92,7 +95,7 @@ class BuildApiTests(unittest.TestCase):
"""
app_config = "app_config"
mock_target = make_mock_target(lambda _, __ : None,
"Junk", [], "Cortex-M3", TOOLCHAINS)
"Junk", [], "Cortex-M3", TOOLCHAINS, mock_build_tools_metadata)
mock_config_init.return_value = namedtuple(
"Config", "target has_regions name")(mock_target, False, None)
@ -111,7 +114,7 @@ class BuildApiTests(unittest.TestCase):
:return:
"""
mock_target = make_mock_target(lambda _, __ : None,
"Junk", [], "Cortex-M3", TOOLCHAINS)
"Junk", [], "Cortex-M3", TOOLCHAINS, mock_build_tools_metadata)
mock_config_init.return_value = namedtuple(
"Config", "target has_regions name")(mock_target, False, None)