Skip to content

Commit 3721bb6

Browse files
ioannisgcarlescufi
authored andcommitted
tests: error_hook: typo and style fixes in main.c
The commit fixes several style and typo errors in main.c. Signed-off-by: Ioannis Glaropoulos <[email protected]>
1 parent f78759e commit 3721bb6

File tree

1 file changed

+14
-13
lines changed
  • tests/ztest/error_hook/src

1 file changed

+14
-13
lines changed

tests/ztest/error_hook/src/main.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ static void trigger_assert_fail(void *a)
4141
__ASSERT(a != NULL, "parameter a should not be NULL!");
4242
}
4343

44-
static void trigger_fault_illeagl_instuction(void)
44+
static void trigger_fault_illegal_instruction(void)
4545
{
4646
void *a = NULL;
4747

48-
/* execute an illeagal instructions */
48+
/* execute an illeagal instruction */
4949
((void(*)(void))&a)();
5050
}
5151

@@ -70,7 +70,7 @@ static void trigger_fault_access(void)
7070
*/
7171
void *a = (void *)NULL;
7272
#endif
73-
/* access a illeagal address */
73+
/* access an illegal address */
7474
volatile int b = *((int *)a);
7575

7676
printk("b is %d\n", b);
@@ -81,7 +81,7 @@ static void trigger_fault_divide_zero(void)
8181
int a = 1;
8282
int b = 0;
8383

84-
/* divde zero */
84+
/* divide by zero */
8585
a = a / b;
8686
printk("a is %d\n", a);
8787
}
@@ -98,15 +98,16 @@ static void trigger_fault_panic(void)
9898

9999
static void release_offload_sem(void)
100100
{
101-
/* Semaphore used inside irq_offload need to be
102-
* released after assert or fault happened.
101+
/* Semaphore used inside irq_offload needs to be
102+
* released after an assert or a fault has happened.
103103
*/
104104
k_sem_give(&offload_sem);
105105
}
106106

107-
/* This is the fatal error hook that allow you to do actions after
108-
* fatal error happened. This is optional, you can choose to define
109-
* this yourself. If not, it will use the default one.
107+
/* This is the fatal error hook that allows you to do actions after
108+
* the fatal error has occurred. This is optional; you can choose
109+
* to define the hook yourself. If not, the program will use the
110+
* default one.
110111
*/
111112
void ztest_post_fatal_error_hook(unsigned int reason,
112113
const z_arch_esf_t *pEsf)
@@ -134,9 +135,9 @@ void ztest_post_fatal_error_hook(unsigned int reason,
134135
}
135136
}
136137

137-
/* This is the assert fail post hook that allow you to do actions after
138-
* assert fail happened. This is optional, you can choose to define
139-
* this yourself. If not, it will use the default one.
138+
/* This is the assert fail post hook that allows you to do actions after
139+
* the assert fail happened. This is optional, you can choose to define
140+
* the hook yourself. If not, the program will use the default one.
140141
*/
141142
void ztest_post_assert_fail_hook(void)
142143
{
@@ -170,7 +171,7 @@ static void tThread_entry(void *p1, void *p2, void *p3)
170171
break;
171172
case ZTEST_CATCH_FATAL_ILLEAGAL_INSTRUCTION:
172173
ztest_set_fault_valid(true);
173-
trigger_fault_illeagl_instuction();
174+
trigger_fault_illegal_instruction();
174175
break;
175176
case ZTEST_CATCH_FATAL_DIVIDE_ZERO:
176177
ztest_set_fault_valid(true);

0 commit comments

Comments
 (0)