mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Fix read of 64bit enviroment variables
change atoi to atoll Signed-off-by: Cencelewska, Katarzyna <katarzyna.cencelewska@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
69c9a4e86c
commit
9b19014cf1
@ -70,6 +70,14 @@ TEST_F(RegistryReaderTest, givenRegistryReaderWhenEnvironmentIntVariableExistsTh
|
||||
EXPECT_EQ(1234, registryReader.getSetting(envVar, value));
|
||||
}
|
||||
|
||||
TEST_F(RegistryReaderTest, givenRegistryReaderWhenEnvironmentInt64VariableExistsThenReturnCorrectValue) {
|
||||
const char *envVar = "TestedEnvironmentInt64Variable";
|
||||
int64_t expectedValue = 9223372036854775807;
|
||||
int64_t defaultValue = 0;
|
||||
TestedRegistryReader registryReader("");
|
||||
EXPECT_EQ(expectedValue, registryReader.getSetting(envVar, defaultValue));
|
||||
}
|
||||
|
||||
struct DebugReaderWithRegistryAndEnvTest : ::testing::Test {
|
||||
VariableBackup<uint32_t> openRegCountBackup{&SysCalls::regOpenKeySuccessCount};
|
||||
VariableBackup<uint32_t> queryRegCountBackup{&SysCalls::regQueryValueSuccessCount};
|
||||
|
@ -27,6 +27,8 @@ class TestedRegistryReader : public RegistryReader {
|
||||
return "TestedEnvironmentVariableValue";
|
||||
} else if (strcmp(envVar, "TestedEnvironmentIntVariable") == 0) {
|
||||
return "1234";
|
||||
} else if (strcmp(envVar, "TestedEnvironmentInt64Variable") == 0) {
|
||||
return "9223372036854775807";
|
||||
} else if (strcmp(envVar, "settingSourceString") == 0) {
|
||||
return "environment";
|
||||
} else if (strcmp(envVar, "settingSourceInt") == 0) {
|
||||
|
Reference in New Issue
Block a user