summaryrefslogtreecommitdiff
path: root/src/api/burn/test/BalUtilUnitTest/BAFunctionsTests.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-06-16 14:41:27 -0500
committerSean Hall <r.sean.hall@gmail.com>2022-06-16 16:49:13 -0500
commit4d94ed9fd1d9cb69337134561c520a24a91b91b2 (patch)
tree494d91dce4eacffae5a0263a0d35892b80d10e73 /src/api/burn/test/BalUtilUnitTest/BAFunctionsTests.cpp
parent223606fcd02e6d15e065d1e108e17c8848d35f9f (diff)
downloadwix-4d94ed9fd1d9cb69337134561c520a24a91b91b2.tar.gz
wix-4d94ed9fd1d9cb69337134561c520a24a91b91b2.tar.bz2
wix-4d94ed9fd1d9cb69337134561c520a24a91b91b2.zip
Use dotnet test on C++/CLI test projects to get trx logs.
Diffstat (limited to 'src/api/burn/test/BalUtilUnitTest/BAFunctionsTests.cpp')
-rw-r--r--src/api/burn/test/BalUtilUnitTest/BAFunctionsTests.cpp49
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
5using namespace System;
6using namespace Xunit;
7using namespace WixBuildTools::TestSupport;
8using namespace WixBuildTools::TestSupport::XunitExtensions;
9
10namespace 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}