Created
January 25, 2021 22:07
-
-
Save r7vme/c1706f32a09fffc4b75b106fef057419 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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