@@ -4213,39 +4213,22 @@ TEST_F(ValidationTest, ValidateWithHash) {
4213
4213
}
4214
4214
4215
4215
std::wstring GetEnvVarW (const std::wstring &VarName) {
4216
- #ifdef _WIN32
4217
4216
if (const wchar_t *Result = _wgetenv (VarName.c_str ()))
4218
4217
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
4228
4218
return std::wstring ();
4229
4219
}
4230
4220
4231
4221
void SetEnvVarW (const std::wstring &VarName, const std::wstring &VarValue) {
4232
- #ifdef _WIN32
4233
4222
_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
4241
4223
}
4242
4224
4243
4225
// For now, 3 things are tested:
4244
4226
// 1. The environment variable is not set. GetDxilDllPath() is empty and
4245
4227
// 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.
4249
4232
// 3. CLSID_DxcCompiler, CLSID_DxcLinker, CLSID_DxcValidator
4250
4233
// may be created through DxcDllExtValidationSupport.
4251
4234
// This is all to simply test that the new class, DxcDllExtValidationSupport,
@@ -4301,6 +4284,7 @@ TEST_F(ValidationTest, UnitTestExtValidationSupport) {
4301
4284
CComPtr<IDxcCompiler2> Compiler2;
4302
4285
Linker.Release ();
4303
4286
Validator.Release ();
4287
+ Compiler.Release ();
4304
4288
VERIFY_SUCCEEDED (DxcCoGetMalloc (1 , &Malloc));
4305
4289
VERIFY_SUCCEEDED (ExtSupportBogus.CreateInstance2 (Malloc, CLSID_DxcCompiler,
4306
4290
__uuidof (IDxcCompiler),
0 commit comments