File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
tests/subsys/logging/log_backend_uart/src Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -55,19 +55,22 @@ static void uart_emul_before(void *f)
5555
5656ZTEST_F (log_backend_uart , test_log_backend_uart_multi_instance )
5757{
58+ /* Prevent stack overflow by making it static */
59+ static uint8_t tx_content [SAMPLE_DATA_SIZE ];
60+ size_t tx_len ;
61+
5862 zassert_equal (log_backend_count_get (), EMUL_UART_NUM , "Unexpected number of instance(s)" );
5963
6064 LOG_RAW (TEST_DATA );
6165
6266 for (size_t i = 0 ; i < EMUL_UART_NUM ; i ++ ) {
63- uint8_t tx_content [SAMPLE_DATA_SIZE ] = {0 };
64- size_t tx_len ;
67+ memset (tx_content , 0 , sizeof (tx_content ));
6568
6669 tx_len = uart_emul_get_tx_data (fixture -> dev [i ], tx_content , sizeof (tx_content ));
6770 zassert_equal (tx_len , strlen (TEST_DATA ),
6871 "%d: TX buffer length does not match. Expected %d, got %d" ,
6972 i , strlen (TEST_DATA ), tx_len );
70- zassert_mem_equal (tx_content , TEST_DATA , strlen (tx_content ));
73+ zassert_mem_equal (tx_content , TEST_DATA , strlen (TEST_DATA ));
7174 }
7275}
7376
You can’t perform that action at this time.
0 commit comments