Skip to content

Commit eb1e96f

Browse files
committed
remove Linux definitions from windows only testing, address ambiguity in comment
1 parent f2890f5 commit eb1e96f

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

tools/clang/unittests/HLSL/ValidationTest.cpp

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4213,39 +4213,22 @@ TEST_F(ValidationTest, ValidateWithHash) {
42134213
}
42144214

42154215
std::wstring GetEnvVarW(const std::wstring &VarName) {
4216-
#ifdef _WIN32
42174216
if (const wchar_t *Result = _wgetenv(VarName.c_str()))
42184217
return std::wstring(Result);
4219-
#else
4220-
std::string VarNameUtf8;
4221-
Unicode::WideToUTF8String(VarName.c_str(), &VarNameUtf8);
4222-
if (const char *Result = std::getenv(VarNameUtf8.c_str())) {
4223-
std::wstring ResultWide;
4224-
Unicode::UTF8ToWideString(Result, &ResultWide);
4225-
return std::wstring(ResultWide);
4226-
}
4227-
#endif
42284218
return std::wstring();
42294219
}
42304220

42314221
void SetEnvVarW(const std::wstring &VarName, const std::wstring &VarValue) {
4232-
#ifdef _WIN32
42334222
_wputenv_s(VarName.c_str(), VarValue.c_str());
4234-
#else
4235-
std::string VarNameUtf8;
4236-
std::string VarValueUtf8;
4237-
Unicode::WideToUTF8String(VarName.c_str(), &VarNameUtf8);
4238-
Unicode::WideToUTF8String(VarValue.c_str(), &VarValueUtf8);
4239-
setenv(VarNameUtf8.c_str(), VarValueUtf8.c_str(), 1);
4240-
#endif
42414223
}
42424224

42434225
// For now, 3 things are tested:
42444226
// 1. The environment variable is not set. GetDxilDllPath() is empty and
42454227
// DxilDllFailedToLoad() returns false
4246-
// 2. Given a bogus path in the environment variable, GetDxilDllPath()
4247-
// retrieves the path but fails to load it as a dll, and returns true
4248-
// for DxilDllFailedToLoad()
4228+
// 2. Given a bogus path in the environment variable, and an initialized
4229+
// DxcDllExtValidationSupport object, GetDxilDllPath()
4230+
// retrieves the bogus path despite DxcDllExtValidationSupport failing to load
4231+
// it as a dll, and DxilDllFailedToLoad() returns true.
42494232
// 3. CLSID_DxcCompiler, CLSID_DxcLinker, CLSID_DxcValidator
42504233
// may be created through DxcDllExtValidationSupport.
42514234
// This is all to simply test that the new class, DxcDllExtValidationSupport,
@@ -4301,6 +4284,7 @@ TEST_F(ValidationTest, UnitTestExtValidationSupport) {
43014284
CComPtr<IDxcCompiler2> Compiler2;
43024285
Linker.Release();
43034286
Validator.Release();
4287+
Compiler.Release();
43044288
VERIFY_SUCCEEDED(DxcCoGetMalloc(1, &Malloc));
43054289
VERIFY_SUCCEEDED(ExtSupportBogus.CreateInstance2(Malloc, CLSID_DxcCompiler,
43064290
__uuidof(IDxcCompiler),

0 commit comments

Comments
 (0)