newlib: fix unit test for psram config

This commit is contained in:
Ivan Grokhotkov 2018-06-27 14:47:05 +08:00 committed by bot
parent cfde037f9a
commit a1dadda7d6

View File

@ -124,15 +124,20 @@ static bool fn_in_rom(void *fn, const char *name)
TEST_CASE("check if ROM or Flash is used for functions", "[newlib]")
{
#ifdef CONFIG_NEWLIB_NANO_FORMAT
#if defined(CONFIG_NEWLIB_NANO_FORMAT) && !defined(CONFIG_SPIRAM_SUPPORT)
TEST_ASSERT(fn_in_rom(printf, "printf"));
TEST_ASSERT(fn_in_rom(sscanf, "sscanf"));
#else
TEST_ASSERT_FALSE(fn_in_rom(printf, "printf"));
TEST_ASSERT_FALSE(fn_in_rom(sscanf, "sscanf"));
#endif
#if !defined(CONFIG_SPIRAM_SUPPORT)
TEST_ASSERT(fn_in_rom(atoi, "atoi"));
TEST_ASSERT(fn_in_rom(strtol, "strtol"));
#else
TEST_ASSERT_FALSE(fn_in_rom(atoi, "atoi"));
TEST_ASSERT_FALSE(fn_in_rom(strtol, "strtol"));
#endif
}
#ifndef CONFIG_NEWLIB_NANO_FORMAT