@@ -4217,11 +4217,11 @@ std::wstring GetEnvVarW(const std::wstring &VarName) {
4217
4217
if (const wchar_t *Result = _wgetenv (VarName.c_str ()))
4218
4218
return std::wstring (Result);
4219
4219
#else
4220
- std::string NameUtf8 ;
4221
- WideToUTF8String (Name .c_str , &NameUtf8 );
4222
- if (const char *Result = std::getenv (NameUtf8 .c_str ())) {
4220
+ std::string VarNameUtf8 ;
4221
+ WideToUTF8String (VarName .c_str , &VarNameUtf8 );
4222
+ if (const char *Result = std::getenv (VarNameUtf8 .c_str ())) {
4223
4223
std::wstring ResultWide;
4224
- Unicode::UTF8ToWideString (Result. c_str () , &ResultWide);
4224
+ Unicode::UTF8ToWideString (Result, &ResultWide);
4225
4225
return std::wstring (ResultWide);
4226
4226
}
4227
4227
#endif
@@ -4268,7 +4268,8 @@ TEST_F(ValidationTest, UnitTestExtValidationSupport) {
4268
4268
VERIFY_SUCCEEDED (ExtSupportEmpty.Initialize ());
4269
4269
4270
4270
VERIFY_IS_FALSE (ExtSupportEmpty.DxilDllFailedToLoad ());
4271
- VERIFY_ARE_EQUAL_STR (ExtSupportEmpty.GetDxilDllPath ().c_str (), " " );
4271
+ std::string EmptyPath = ExtSupportBogus.GetDxilDllPath ();
4272
+ VERIFY_ARE_EQUAL_STR (EmptyPath.c_str (), " " );
4272
4273
4273
4274
// 2. Test with a bogus path in the environment variable
4274
4275
SetEnvVarW (L" DXC_DXIL_DLL_PATH" , L" bogus" );
@@ -4279,7 +4280,8 @@ TEST_F(ValidationTest, UnitTestExtValidationSupport) {
4279
4280
4280
4281
// validate that m_dllExtSupport2 was able to capture the environment
4281
4282
// variable's value, and that loading the bogus path was unsuccessful
4282
- VERIFY_ARE_EQUAL_STR (ExtSupportBogus.GetDxilDllPath ().c_str (), " bogus" );
4283
+ std::string BogusPath = ExtSupportBogus.GetDxilDllPath ();
4284
+ VERIFY_ARE_EQUAL_STR (BogusPath.c_str (), " bogus" );
4283
4285
VERIFY_IS_TRUE (ExtSupportBogus.DxilDllFailedToLoad ());
4284
4286
4285
4287
// 3. Test production of class IDs CLSID_DxcCompiler, CLSID_DxcLinker,
0 commit comments