diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-07-12 17:07:55 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-07-12 17:16:16 +1000 |
| commit | dc558da002794cc07013e8376f3c55c73391aa0e (patch) | |
| tree | faba96f981f1ea0c6888b387cf43cc78d0bc2927 /src/test/DUtilUnitTest/DUtilTests.cpp | |
| parent | aeddc77fc021f11f68a4c1a093eabf9776866b80 (diff) | |
| download | wix-dc558da002794cc07013e8376f3c55c73391aa0e.tar.gz wix-dc558da002794cc07013e8376f3c55c73391aa0e.tar.bz2 wix-dc558da002794cc07013e8376f3c55c73391aa0e.zip | |
Update Dutil_TraceErrorSource to filter based on the report level.
Diffstat (limited to 'src/test/DUtilUnitTest/DUtilTests.cpp')
| -rw-r--r-- | src/test/DUtilUnitTest/DUtilTests.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/test/DUtilUnitTest/DUtilTests.cpp b/src/test/DUtilUnitTest/DUtilTests.cpp new file mode 100644 index 00000000..55e81d46 --- /dev/null +++ b/src/test/DUtilUnitTest/DUtilTests.cpp | |||
| @@ -0,0 +1,35 @@ | |||
| 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 | |||
| 9 | namespace DutilTests | ||
| 10 | { | ||
| 11 | public ref class DUtil | ||
| 12 | { | ||
| 13 | public: | ||
| 14 | [Fact] | ||
| 15 | void DUtilTraceErrorSourceFiltersOnTraceLevel() | ||
| 16 | { | ||
| 17 | DutilInitialize(&DutilTestTraceError); | ||
| 18 | |||
| 19 | CallDutilTraceErrorSource(); | ||
| 20 | |||
| 21 | Dutil_TraceSetLevel(REPORT_DEBUG, FALSE); | ||
| 22 | |||
| 23 | Action^ action = gcnew Action(this, &DUtil::CallDutilTraceErrorSource); | ||
| 24 | Assert::Throws<Exception^>(action); | ||
| 25 | |||
| 26 | DutilUninitialize(); | ||
| 27 | } | ||
| 28 | |||
| 29 | private: | ||
| 30 | void CallDutilTraceErrorSource() | ||
| 31 | { | ||
| 32 | Dutil_TraceErrorSource(__FILE__, __LINE__, REPORT_DEBUG, DUTIL_SOURCE_EXTERNAL, E_FAIL, "Error message"); | ||
| 33 | } | ||
| 34 | }; | ||
| 35 | } | ||
