From 8bcb8c013a258691d4004c50af4689b90dd05c45 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 15 Jul 2020 21:41:47 +1000 Subject: Import BurnUnitTest from old wix4 repo. --- src/test/BurnUnitTest/ManifestTest.cpp | 59 ++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/test/BurnUnitTest/ManifestTest.cpp (limited to 'src/test/BurnUnitTest/ManifestTest.cpp') diff --git a/src/test/BurnUnitTest/ManifestTest.cpp b/src/test/BurnUnitTest/ManifestTest.cpp new file mode 100644 index 00000000..14ead82e --- /dev/null +++ b/src/test/BurnUnitTest/ManifestTest.cpp @@ -0,0 +1,59 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#include "precomp.h" + +namespace Microsoft +{ +namespace Tools +{ +namespace WindowsInstallerXml +{ +namespace Test +{ +namespace Bootstrapper +{ + using namespace System; + using namespace WixTest; + using namespace Xunit; + + public ref class ManifestTest : BurnUnitTest + { + public: + [NamedFact] + void ManifestLoadXmlTest() + { + HRESULT hr = S_OK; + BURN_ENGINE_STATE engineState = { }; + try + { + LPCSTR szDocument = + "" + " " + " " + " " + " " + " "; + + hr = VariableInitialize(&engineState.variables); + TestThrowOnFailure(hr, L"Failed to initialize variables."); + + // load manifest from XML + hr = ManifestLoadXmlFromBuffer((BYTE*)szDocument, lstrlenA(szDocument), &engineState); + TestThrowOnFailure(hr, L"Failed to parse searches from XML."); + + // check variable values + Assert::True(VariableExistsHelper(&engineState.variables, L"Variable1")); + } + finally + { + //CoreUninitialize(&engineState); + } + } + }; +} +} +} +} +} -- cgit v1.2.3-55-g6feb