1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-30 00:41:17 +01:00

Merge pull request #17840 from fjmolinas/pr_tests_fixes

tests: multiple fixes
This commit is contained in:
Kaspar Schleiser 2022-03-28 10:09:45 +02:00 committed by GitHub
commit 13a4393e0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 36 additions and 8 deletions

View File

@ -9,3 +9,8 @@ USEMODULE += base64
RIOT_TERMINAL ?= socat
include $(RIOTBASE)/Makefile.include
# Increase Stack size for AVR
ifneq (,$(filter avr8_common,$(USEMODULE)))
CFLAGS += -DTHREAD_STACKSIZE_MAIN=THREAD_STACKSIZE_LARGE
endif

View File

@ -46,11 +46,12 @@ static void test_flashbase_addr(void)
void *addr;
addr = flashpage_addr(0);
TEST_ASSERT_EQUAL_INT((int)CPU_FLASH_BASE, (int)addr);
TEST_ASSERT_EQUAL_INT((unsigned int)CPU_FLASH_BASE, (unsigned int)addr);
addr = flashpage_addr(FLASHPAGE_NUMOF - 1);
TEST_ASSERT_EQUAL_INT((long)CPU_FLASH_BASE + (((unsigned)FLASHPAGE_NUMOF - 1) * FLASHPAGE_SIZE), (int)addr);
TEST_ASSERT_EQUAL_INT((long)CPU_FLASH_BASE + (((unsigned)FLASHPAGE_NUMOF - 1) * FLASHPAGE_SIZE),
(unsigned int)addr);
addr = flashpage_addr(12);
TEST_ASSERT_EQUAL_INT((int)CPU_FLASH_BASE + (12 * FLASHPAGE_SIZE), (int)addr);
TEST_ASSERT_EQUAL_INT((unsigned int)CPU_FLASH_BASE + (12 * FLASHPAGE_SIZE), (unsigned int)addr);
}
static void test_flashbase_page(void)
@ -65,7 +66,9 @@ static void test_flashbase_page(void)
TEST_ASSERT_EQUAL_INT(1, page);
page = flashpage_page((void *)(CPU_FLASH_BASE + FLASHPAGE_SIZE + 1));
TEST_ASSERT_EQUAL_INT(1, page);
page = flashpage_page((void *)(CPU_FLASH_BASE + ((unsigned)FLASHPAGE_SIZE * (FLASHPAGE_NUMOF - 1))));
page =
flashpage_page((void *)(CPU_FLASH_BASE +
((unsigned)FLASHPAGE_SIZE * (FLASHPAGE_NUMOF - 1))));
TEST_ASSERT_EQUAL_INT(FLASHPAGE_NUMOF - 1, page);
}

View File

@ -12,7 +12,7 @@ import time
from testrunner import run
PRECISION = float(os.getenv("TEST_PERIPH_TIMER_PERIODIC_PRECISION", "0"))
PRECISION = float(os.getenv("TEST_PERIPH_TIMER_PERIODIC_PRECISION", "0.01"))
def testfunc(child):

View File

@ -4,3 +4,8 @@ USEMODULE += hashes
USEPKG += micro-ecc
include $(RIOTBASE)/Makefile.include
# Increase Stack size for AVR
ifneq (,$(filter avr8_common,$(USEMODULE)))
CFLAGS += -DTHREAD_STACKSIZE_MAIN=THREAD_STACKSIZE_LARGE
endif

View File

@ -14,3 +14,8 @@ USEMODULE += ztimer_sec
DISABLE_MODULE += test_utils_interactive_sync_shell
include $(RIOTBASE)/Makefile.include
# Increase stacksize for AVR idle thread
ifneq (,$(filter avr8_common,$(USEMODULE)))
CFLAGS +=-DTHREAD_STACKSIZE_IDLE=THREAD_STACKSIZE_DEFAULT
endif

View File

@ -48,7 +48,7 @@ static void *_thread_fn(void *arg)
volatile uint32_t now = ztimer_now(ZTIMER_USEC);
(void)now;
}
ztimer_sleep(ZTIMER_USEC, 100); /* Sleep for a bit */
ztimer_sleep(ZTIMER_USEC, 1000); /* Sleep for a bit */
msg_send(&m2, pids[next]);
}

View File

@ -8,3 +8,13 @@ ifneq (1,$(NORR))
endif
include $(RIOTBASE)/Makefile.include
# Increase time between round-robin calls so prints are not interrupted for
# slow CPU's
ifneq (,$(filter ztimer_usec,$(USEMODULE)))
CFLAGS += -DSCHED_RR_TIMEOUT=100*1000
else
ifneq (,$(filter ztimer_msec,$(USEMODULE)))
CFLAGS += -DSCHED_RR_TIMEOUT=100
endif
endif

View File

@ -86,7 +86,7 @@ static void test_counter_mode(void)
puts("thread synced");
/* wait for all threads to terminate, we are going to re-use the stack */
xtimer_msleep(10);
xtimer_msleep(50);
}
static void test_mask_mode(void)
@ -113,7 +113,7 @@ static void test_mask_mode(void)
puts("thread synced");
/* wait for all threads to terminate, we are going to re-use the stack */
xtimer_msleep(10);
xtimer_msleep(50);
}
int main(void)