Skip to content

Instantly share code, notes, and snippets.

@r7vme
Created January 25, 2021 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r7vme/c1706f32a09fffc4b75b106fef057419 to your computer and use it in GitHub Desktop.
Save r7vme/c1706f32a09fffc4b75b106fef057419 to your computer and use it in GitHub Desktop.
TEST_CASE("if more than one core then return true", "[is_multicore_system]")
{
// always reset globally-defined fff objects
// This is a limitation of pure-C fff, that it uses global objects.
RESET_FAKE(__wrap_get_nprocs_conf);
// if get_nprocs_conf will return 2
__wrap_get_nprocs_conf_fake.return_val = 2;
// then return true
REQUIRE(is_multicore_system() == true);
// also check that get_nprocs_conf was called once
REQUIRE(__wrap_get_nprocs_conf_fake.call_count == 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment