-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(linux): enable lowlatency mode for AMD
- Loading branch information
1 parent
ddd67ce
commit db3c6e1
Showing
5 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* @file tests/unit/platform/test_common.cpp | ||
* @brief Test src/platform/common.*. | ||
*/ | ||
#include <src/platform/common.h> | ||
|
||
#include "../../tests_common.h" | ||
|
||
struct SetEnvTest: ::testing::TestWithParam<std::tuple<std::string, std::string, int>> { | ||
protected: | ||
void | ||
TearDown() override { | ||
// Clean up environment variable after each test | ||
const auto &[name, value, expected] = GetParam(); | ||
platf::unset_env(name); | ||
} | ||
}; | ||
|
||
TEST_P(SetEnvTest, HandlesVariousInputs) { | ||
const auto &[name, value, expected] = GetParam(); | ||
platf::set_env(name, value); | ||
|
||
const char *env_value = std::getenv(name.c_str()); | ||
if (expected == 0 && !value.empty()) { | ||
ASSERT_NE(env_value, nullptr); | ||
ASSERT_EQ(std::string(env_value), value); | ||
} | ||
else { | ||
ASSERT_EQ(env_value, nullptr); | ||
} | ||
} | ||
|
||
INSTANTIATE_TEST_SUITE_P( | ||
SetEnvTests, | ||
SetEnvTest, | ||
::testing::Values( | ||
std::make_tuple("SUNSHINE_UNIT_TEST_ENV_VAR", "test_value", 0), | ||
std::make_tuple("", "test_value", -1), | ||
std::make_tuple("SUNSHINE_UNIT_TEST_ENV_VAR", "", 0))); |