Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/sel4test-tests/src/tests/faults.c
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ static int test_vm_enter_non_vm(env_t env)
err = api_tcb_set_space(get_helper_tcb(&helper), fault_ep, env->cspace_root,
api_make_guard_skip_word(guard),
env->page_directory, seL4_NilData);
test_eq(err, 0);
test_eq(err, (seL4_Error)seL4_NoError);
Copy link
Member

@lsf37 lsf37 Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other occurrences of seL4_NoError in this repo are just test_eq(err, seL4_NoError). The type of seL4_NoError is already the enum, so it looks to me like we should not need an explicit cast here. Or is there something special going on in this one?

(we would need to cast the 0, since that would be a literal with C's own arcane rules for that)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same for SUCCESS, really, unless there is a #define layer that I have overlooked)

Copy link
Contributor Author

@midnightveil midnightveil Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other cases have err defined as type int, so the RHS matches the same type as the LHS. These ones are special because err is seL4_Error which then has size 1, not 4.

res has the type of test_result_t and not int.

I don't know if there's a better way to solve this generally, this seems really annoying because of C integer promotion rules.


seL4_CPtr reply = vka_alloc_reply_leaky(&env->vka);
start_helper(env, &helper, (helper_fn_t) vm_enter, 0, 0, 0, 0);
Expand Down
4 changes: 2 additions & 2 deletions apps/sel4test-tests/src/tests/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@ static int test_ipc_pair(env_t env, test_func_t fa, test_func_t fb, bool inter_a
}

test_result_t res = wait_for_helper(&thread_a);
test_eq(res, SUCCESS);
test_eq(res, (test_result_t)SUCCESS);
res = wait_for_helper(&thread_b);
test_eq(res, SUCCESS);
test_eq(res, (test_result_t)SUCCESS);

start_number += 0x71717171;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/sel4test-tests/src/tests/schedcontext.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ int test_smp_delete_sched_context(env_t env)

/* Don't use start_helper, we want to run the helper function directly: */
error = sel4utils_start_thread(&thread, sched_context_0014_helper_fn, &counter, NULL, 1);
test_eq(error, seL4_NoError);
test_eq(error, (seL4_Error)seL4_NoError);

/* Wait till helper runs */
while (counter == prev_counter);
Expand Down