seL4 / sel4test

Test suite for seL4.
http://sel4.systems
Other
24 stars 60 forks source link

sched0022_to_fn() does not return a value #47

Closed axel-h closed 3 years ago

axel-h commented 3 years ago

The function sched0022_to_fn() does not return a value and the compiler complains

  [249/267] Building C object .../src/tests/scheduler.c.obj
  .../src/tests/scheduler.c:1653:1: warning: control reaches end of non-void function [-Wreturn-type]
  }
  ^
  1 warning generated.

I wonder, is there just a return sel4test_get_result(); missing?

lsf37 commented 3 years ago

The function doesn't seem to perform any test asserts or similar, just performing some actions. So the correct thing to return is probably 0, but I'm not entirely sure what the convention is. @kent-mcleod or @yyshen, any input?

yyshen commented 3 years ago

The function doesn't seem to perform any test asserts or similar, just performing some actions. So the correct thing to return is probably 0, but I'm not entirely sure what the convention is. @kent-mcleod or @yyshen, any input?

I think the test is fine. If you look at the calling function, test_changing_affinity. It checks the MRs set by the function as the results. A return 0 to avoid the warning should be enough, since the results are in MRs.