Added test to read the debug int value

Change-Id: I97e90320498b0abbdeeeb92c82e962bb411111c6
Signed-off-by: Koska <andrzej.koska@intel.com>
Related-To: NEO-3239
This commit is contained in:
Koska
2019-10-10 11:14:58 +02:00
committed by sys_ocldev
parent f32f3602a4
commit fc067c823b
3 changed files with 12 additions and 2 deletions

View File

@@ -54,3 +54,10 @@ TEST_F(RegistryReaderTest, givenRegistryReaderWhenEnvironmentVariableExistsThenR
TestedRegistryReader registryReader("");
EXPECT_EQ("TestedEnvironmentVariableValue", registryReader.getSetting(envVar, value));
}
TEST_F(RegistryReaderTest, givenRegistryReaderWhenEnvironmentIntVariableExistsThenReturnCorrectValue) {
char *envVar = "TestedEnvironmentIntVariable";
int32_t value = -1;
TestedRegistryReader registryReader("");
EXPECT_EQ(1234, registryReader.getSetting(envVar, value));
}

View File

@@ -17,9 +17,12 @@ class TestedRegistryReader : public RegistryReader {
return igdrclHkeyType;
}
using RegistryReader::getSetting;
char *getenv(const char *envVar) override {
if (strcmp(envVar, "TestedEnvironmentVariable") == 0) {
return "TestedEnvironmentVariableValue";
} else if (strcmp(envVar, "TestedEnvironmentIntVariable") == 0) {
return "1234";
} else {
return nullptr;
}