From 7f642e51670bc38a4ef782a363936850bc2b0ba9 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 22 Apr 2021 06:38:23 -0700 Subject: Move dutil into libs/dutil --- src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp | 35 ++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp (limited to 'src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp') diff --git a/src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp b/src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp new file mode 100644 index 00000000..55e81d46 --- /dev/null +++ b/src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp @@ -0,0 +1,35 @@ +// 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" + +using namespace System; +using namespace Xunit; +using namespace WixBuildTools::TestSupport; + +namespace DutilTests +{ + public ref class DUtil + { + public: + [Fact] + void DUtilTraceErrorSourceFiltersOnTraceLevel() + { + DutilInitialize(&DutilTestTraceError); + + CallDutilTraceErrorSource(); + + Dutil_TraceSetLevel(REPORT_DEBUG, FALSE); + + Action^ action = gcnew Action(this, &DUtil::CallDutilTraceErrorSource); + Assert::Throws(action); + + DutilUninitialize(); + } + + private: + void CallDutilTraceErrorSource() + { + Dutil_TraceErrorSource(__FILE__, __LINE__, REPORT_DEBUG, DUTIL_SOURCE_EXTERNAL, E_FAIL, "Error message"); + } + }; +} -- cgit v1.2.3-55-g6feb