diff options
Diffstat (limited to 'src/api/burn/test/BalUtilUnitTest/BAFunctionsTests.cpp')
-rw-r--r-- | src/api/burn/test/BalUtilUnitTest/BAFunctionsTests.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/api/burn/test/BalUtilUnitTest/BAFunctionsTests.cpp b/src/api/burn/test/BalUtilUnitTest/BAFunctionsTests.cpp new file mode 100644 index 00000000..9920564e --- /dev/null +++ b/src/api/burn/test/BalUtilUnitTest/BAFunctionsTests.cpp | |||
@@ -0,0 +1,49 @@ | |||
1 | // 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. | ||
2 | |||
3 | #include "precomp.h" | ||
4 | |||
5 | using namespace System; | ||
6 | using namespace Xunit; | ||
7 | using namespace WixBuildTools::TestSupport; | ||
8 | using namespace WixBuildTools::TestSupport::XunitExtensions; | ||
9 | |||
10 | namespace BalUtilTests | ||
11 | { | ||
12 | public ref class BAFunctions | ||
13 | { | ||
14 | public: | ||
15 | [Fact] | ||
16 | void CanCreateTestBAFunctions() | ||
17 | { | ||
18 | HRESULT hr = S_OK; | ||
19 | BOOTSTRAPPER_CREATE_ARGS bootstrapperArgs = { }; | ||
20 | BOOTSTRAPPER_COMMAND bootstrapperCommand = { }; | ||
21 | BA_FUNCTIONS_CREATE_ARGS args = { }; | ||
22 | BA_FUNCTIONS_CREATE_RESULTS results = { }; | ||
23 | IBootstrapperEngine* pEngine = NULL; | ||
24 | IBAFunctions* pBAFunctions = NULL; | ||
25 | |||
26 | bootstrapperArgs.cbSize = sizeof(bootstrapperArgs); | ||
27 | bootstrapperArgs.pCommand = &bootstrapperCommand; | ||
28 | |||
29 | args.cbSize = sizeof(args); | ||
30 | args.pBootstrapperCreateArgs = &bootstrapperArgs; | ||
31 | |||
32 | results.cbSize = sizeof(results); | ||
33 | |||
34 | try | ||
35 | { | ||
36 | hr = BalInitializeFromCreateArgs(&bootstrapperArgs, &pEngine); | ||
37 | NativeAssert::Succeeded(hr, "Failed to create engine."); | ||
38 | |||
39 | hr = CreateBAFunctions(NULL, pEngine, &args, &results, &pBAFunctions); | ||
40 | NativeAssert::Succeeded(hr, "Failed to create BAFunctions."); | ||
41 | } | ||
42 | finally | ||
43 | { | ||
44 | ReleaseObject(pEngine); | ||
45 | ReleaseObject(pBAFunctions); | ||
46 | } | ||
47 | } | ||
48 | }; | ||
49 | } | ||