diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-08-01 17:07:49 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-08-02 09:15:14 -0500 |
commit | 28c8abfda013d6aa568fde8b26da65522748d376 (patch) | |
tree | b2e98b0e69e2941c659979f7b2bedff5a0a29b4f /src/burn/test | |
parent | aacd6b677332f2e262d0df67603c246cd65d833e (diff) | |
download | wix-28c8abfda013d6aa568fde8b26da65522748d376.tar.gz wix-28c8abfda013d6aa568fde8b26da65522748d376.tar.bz2 wix-28c8abfda013d6aa568fde8b26da65522748d376.zip |
Downgrade error to warning when search refs a reserved prefix variable.
The engine doesn't actually prevent external callers from setting variables that start with 'Wix'.
Diffstat (limited to 'src/burn/test')
-rw-r--r-- | src/burn/test/BurnUnitTest/VariableTest.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/burn/test/BurnUnitTest/VariableTest.cpp b/src/burn/test/BurnUnitTest/VariableTest.cpp index f864307c..8ee6e179 100644 --- a/src/burn/test/BurnUnitTest/VariableTest.cpp +++ b/src/burn/test/BurnUnitTest/VariableTest.cpp | |||
@@ -163,6 +163,39 @@ namespace Bootstrapper | |||
163 | } | 163 | } |
164 | 164 | ||
165 | [Fact] | 165 | [Fact] |
166 | void VariablesSetCustomWixVariableTest() | ||
167 | { | ||
168 | HRESULT hr = S_OK; | ||
169 | IXMLDOMElement* pixeBundle = NULL; | ||
170 | BURN_VARIABLES variables = { }; | ||
171 | |||
172 | try | ||
173 | { | ||
174 | LPCWSTR wzDocument = | ||
175 | L"<Bundle>" | ||
176 | L" <CommandLine Variables='upperCase' />" | ||
177 | L"</Bundle>"; | ||
178 | |||
179 | hr = VariableInitialize(&variables); | ||
180 | TestThrowOnFailure(hr, L"Failed to initialize variables."); | ||
181 | |||
182 | // load XML document | ||
183 | LoadBundleXmlHelper(wzDocument, &pixeBundle); | ||
184 | |||
185 | hr = VariablesParseFromXml(&variables, pixeBundle); | ||
186 | NativeAssert::Succeeded(hr, "Failed to parse variables from XML."); | ||
187 | |||
188 | hr = VariableSetString(&variables, L"WixCustomVariable", L"something", FALSE, FALSE); | ||
189 | NativeAssert::Succeeded(hr, "Failed to set 'WixCustomVariable' variable."); | ||
190 | } | ||
191 | finally | ||
192 | { | ||
193 | ReleaseObject(pixeBundle); | ||
194 | VariablesUninitialize(&variables); | ||
195 | } | ||
196 | } | ||
197 | |||
198 | [Fact] | ||
166 | void VariablesFormatTest() | 199 | void VariablesFormatTest() |
167 | { | 200 | { |
168 | HRESULT hr = S_OK; | 201 | HRESULT hr = S_OK; |