ztest: run clang-format for easier diffs
Run clang-format on ztest-new.c to make diffs a bit easier Signed-off-by: Yuval Peress <peress@google.com>
This commit is contained in:
parent
54adba4633
commit
16b9fdf6a0
1 changed files with 16 additions and 40 deletions
|
@ -4,27 +4,29 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <ztest.h>
|
||||
#include <zephyr/app_memory/app_memdomain.h>
|
||||
|
||||
#include <ztest.h>
|
||||
#ifdef CONFIG_USERSPACE
|
||||
#include <zephyr/sys/libc-hooks.h>
|
||||
#endif
|
||||
#include <zephyr/sys/reboot.h>
|
||||
#include <zephyr/logging/log_ctrl.h>
|
||||
#include <zephyr/sys/reboot.h>
|
||||
|
||||
#ifdef KERNEL
|
||||
static struct k_thread ztest_thread;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ZTEST_SHUFFLE
|
||||
#include <zephyr/random/rand32.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <zephyr/random/rand32.h>
|
||||
#define NUM_ITER_PER_SUITE CONFIG_ZTEST_SHUFFLE_SUITE_REPEAT_COUNT
|
||||
#define NUM_ITER_PER_TEST CONFIG_ZTEST_SHUFFLE_TEST_REPEAT_COUNT
|
||||
#define NUM_ITER_PER_TEST CONFIG_ZTEST_SHUFFLE_TEST_REPEAT_COUNT
|
||||
#else
|
||||
#define NUM_ITER_PER_SUITE 1
|
||||
#define NUM_ITER_PER_TEST 1
|
||||
#define NUM_ITER_PER_TEST 1
|
||||
#endif
|
||||
|
||||
/* ZTEST_DMEM and ZTEST_BMEM are used for the application shared memory test */
|
||||
|
@ -176,16 +178,10 @@ void z_impl_z_test_1cpu_stop(void)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
void z_vrfy_z_test_1cpu_start(void)
|
||||
{
|
||||
z_impl_z_test_1cpu_start();
|
||||
}
|
||||
void z_vrfy_z_test_1cpu_start(void) { z_impl_z_test_1cpu_start(); }
|
||||
#include <syscalls/z_test_1cpu_start_mrsh.c>
|
||||
|
||||
void z_vrfy_z_test_1cpu_stop(void)
|
||||
{
|
||||
z_impl_z_test_1cpu_stop();
|
||||
}
|
||||
void z_vrfy_z_test_1cpu_stop(void) { z_impl_z_test_1cpu_stop(); }
|
||||
#include <syscalls/z_test_1cpu_stop_mrsh.c>
|
||||
#endif /* CONFIG_USERSPACE */
|
||||
#endif
|
||||
|
@ -219,8 +215,8 @@ static void run_test_functions(struct ztest_suite_node *suite, struct ztest_unit
|
|||
*/
|
||||
#include <setjmp.h> /* parasoft-suppress MISRAC2012-RULE_21_4-a MISRAC2012-RULE_21_4-b*/
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define FAIL_FAST 0
|
||||
|
||||
|
@ -228,15 +224,9 @@ static jmp_buf test_fail;
|
|||
static jmp_buf test_pass;
|
||||
static jmp_buf stack_fail;
|
||||
|
||||
void ztest_test_fail(void)
|
||||
{
|
||||
raise(SIGABRT);
|
||||
}
|
||||
void ztest_test_fail(void) { raise(SIGABRT); }
|
||||
|
||||
void ztest_test_pass(void)
|
||||
{
|
||||
longjmp(test_pass, 1);
|
||||
}
|
||||
void ztest_test_pass(void) { longjmp(test_pass, 1); }
|
||||
|
||||
/**
|
||||
* @brief Get a friendly name string for a given test phrase.
|
||||
|
@ -329,12 +319,7 @@ out:
|
|||
|
||||
K_THREAD_STACK_DEFINE(ztest_thread_stack, CONFIG_ZTEST_STACK_SIZE + CONFIG_TEST_EXTRA_STACK_SIZE);
|
||||
|
||||
enum ztest_result {
|
||||
ZTEST_RESULT_PENDING,
|
||||
ZTEST_RESULT_PASS,
|
||||
ZTEST_RESULT_FAIL,
|
||||
ZTEST_RESULT_SKIP
|
||||
};
|
||||
enum ztest_result { ZTEST_RESULT_PENDING, ZTEST_RESULT_PASS, ZTEST_RESULT_FAIL, ZTEST_RESULT_SKIP };
|
||||
static ZTEST_BMEM enum ztest_result test_result;
|
||||
|
||||
static void test_finalize(void)
|
||||
|
@ -375,10 +360,7 @@ void ztest_simple_1cpu_after(void *data)
|
|||
z_test_1cpu_stop();
|
||||
}
|
||||
|
||||
static void init_testing(void)
|
||||
{
|
||||
k_object_access_all_grant(&ztest_thread);
|
||||
}
|
||||
static void init_testing(void) { k_object_access_all_grant(&ztest_thread); }
|
||||
|
||||
static void test_cb(void *a, void *b, void *c)
|
||||
{
|
||||
|
@ -657,15 +639,9 @@ void ztest_verify_all_test_suites_ran(void)
|
|||
}
|
||||
}
|
||||
|
||||
void ztest_run_all(const void *state)
|
||||
{
|
||||
ztest_api.run_all(state);
|
||||
}
|
||||
void ztest_run_all(const void *state) { ztest_api.run_all(state); }
|
||||
|
||||
void __weak test_main(void)
|
||||
{
|
||||
ztest_run_all(NULL);
|
||||
}
|
||||
void __weak test_main(void) { ztest_run_all(NULL); }
|
||||
|
||||
#ifndef KERNEL
|
||||
int main(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue