aboutsummaryrefslogtreecommitdiff
path: root/src/test/BextUtilUnitTest/TestBundleExtension.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2020-12-02 20:11:21 -0600
committerSean Hall <r.sean.hall@gmail.com>2020-12-03 10:58:32 -0600
commit27766738dc62ec95f89af347eebb1723a5943848 (patch)
treea113cf0cf3872fbbd752999fb8868ffce39e6f55 /src/test/BextUtilUnitTest/TestBundleExtension.cpp
parente08c0fc700edd3fe31d3a3778c26cac9f0304de4 (diff)
downloadwix-27766738dc62ec95f89af347eebb1723a5943848.tar.gz
wix-27766738dc62ec95f89af347eebb1723a5943848.tar.bz2
wix-27766738dc62ec95f89af347eebb1723a5943848.zip
Add test projects for balutil and bextutil.
For now, they only have test implementations to check for compile errors in header only code.
Diffstat (limited to 'src/test/BextUtilUnitTest/TestBundleExtension.cpp')
-rw-r--r--src/test/BextUtilUnitTest/TestBundleExtension.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/test/BextUtilUnitTest/TestBundleExtension.cpp b/src/test/BextUtilUnitTest/TestBundleExtension.cpp
new file mode 100644
index 00000000..921303bb
--- /dev/null
+++ b/src/test/BextUtilUnitTest/TestBundleExtension.cpp
@@ -0,0 +1,42 @@
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#include "BextBaseBundleExtension.h"
5#include "BextBaseBundleExtensionProc.h"
6
7class CTestBundleExtension : public CBextBaseBundleExtension
8{
9public:
10 CTestBundleExtension(
11 __in IBundleExtensionEngine* pEngine
12 ) : CBextBaseBundleExtension(pEngine)
13 {
14 }
15};
16
17HRESULT TestBundleExtensionCreate(
18 __in IBundleExtensionEngine* pEngine,
19 __in const BUNDLE_EXTENSION_CREATE_ARGS* pArgs,
20 __inout BUNDLE_EXTENSION_CREATE_RESULTS* pResults,
21 __out IBundleExtension** ppBundleExtension
22 )
23{
24 HRESULT hr = S_OK;
25 CTestBundleExtension* pExtension = NULL;
26
27 pExtension = new CTestBundleExtension(pEngine);
28 ExitOnNull(pExtension, hr, E_OUTOFMEMORY, "Failed to create new CTestBundleExtension.");
29
30 hr = pExtension->Initialize(pArgs);
31 ExitOnFailure(hr, "CTestBundleExtension initialization failed");
32
33 pResults->pfnBundleExtensionProc = BextBaseBundleExtensionProc;
34 pResults->pvBundleExtensionProcContext = pExtension;
35
36 *ppBundleExtension = pExtension;
37 pExtension = NULL;
38
39LExit:
40 ReleaseObject(pExtension);
41 return hr;
42}