Skip to content

Commit a3437be

Browse files
Debug::Assert(false to Debug::Fail (#9447)
Co-authored-by: kasperk81 <[email protected]>
1 parent 2bf36b0 commit a3437be

File tree

10 files changed

+15
-15
lines changed

10 files changed

+15
-15
lines changed

src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/FontCollectionLoader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace MS { namespace Internal { namespace Text { namespace TextInterface
2525

2626
public:
2727

28-
FontCollectionLoader() { Debug::Assert(false, "Assertion failed"); }
28+
FontCollectionLoader() { Debug::Fail("Assertion failed"); }
2929

3030
FontCollectionLoader(
3131
IFontSourceCollectionFactory^ fontSourceCollectionFactory,

src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/FontFileEnumerator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace MS { namespace Internal { namespace Text { namespace TextInterface
2727

2828
public:
2929

30-
FontFileEnumerator() { Debug::Assert(false, "Assertion failed"); }
30+
FontFileEnumerator() { Debug::Fail("Assertion failed"); }
3131

3232
FontFileEnumerator(
3333
IEnumerable<IFontSource^>^ fontSourceCollection,

src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/FontFileLoader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace MS { namespace Internal { namespace Text { namespace TextInterface
2222

2323
public:
2424

25-
FontFileLoader() { Debug::Assert(false, "Assertion failed"); }
25+
FontFileLoader() { Debug::Fail("Assertion failed"); }
2626

2727
FontFileLoader(IFontSourceFactory^ fontSourceFactory);
2828

src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/FontFileStream.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace MS { namespace Internal { namespace Text { namespace TextInterface
2929
/// Asserts false because COM convention requires us to have a default constructor
3030
/// but we are the only entity that can construct these objects, and we use the
3131
/// other constructor.
32-
FontFileStream() { Debug::Assert(false, "Assertion failed"); }
32+
FontFileStream() { Debug::Fail("Assertion failed"); }
3333

3434
/// <summary>
3535
/// ctor.

src/Microsoft.DotNet.Wpf/src/System.Printing/CPP/src/GDIExporter/gdibitmap.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ void CGDIBitmap::SetupPalette(interior_ptr<BITMAPINFO> bmi, int bitCount)
188188
}
189189
else
190190
{
191-
Debug::Assert(false, "Unsupported format");
191+
Debug::Fail("Unsupported format");
192192
}
193193

194194
bmi->bmiHeader.biClrUsed = count;
@@ -242,7 +242,7 @@ void CGDIBitmap::SetBits(interior_ptr<BITMAPINFO> bmi)
242242
}
243243
else
244244
{
245-
Debug::Assert(false, "Unexpected bitcount");
245+
Debug::Fail("Unexpected bitcount");
246246
m_Buffer = nullptr;
247247
}
248248
}

src/Microsoft.DotNet.Wpf/src/System.Printing/CPP/src/GDIExporter/gdibrush.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ GdiSafeHandle^ CGDIDevice::ConvertBrush(COLORREF colorRef)
3333
}
3434
else
3535
{
36-
Debug::Assert(false, "CreateSolidBrush failed");
36+
Debug::Fail("CreateSolidBrush failed");
3737
}
3838
}
3939

src/Microsoft.DotNet.Wpf/src/System.Printing/CPP/src/GDIExporter/gdipath.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ ref class GdiGeometryConverter : public CapacityStreamGeometryContext
343343

344344
if (Double::IsNaN(transformedPoint.X) || Double::IsNaN(transformedPoint.Y))
345345
{
346-
Debug::Assert(false, "Invalid path input: NaN encountered");
346+
Debug::Fail("Invalid path input: NaN encountered");
347347
ForceGeometryEmpty();
348348
return -1;
349349
}

src/Microsoft.DotNet.Wpf/src/System.Printing/CPP/src/GDIExporter/gdipen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ GdiSafeHandle^ CGDIDevice::ConvertPen(
361361
}
362362
else
363363
{
364-
Debug::Assert(false, "ExtCreatePen failed");
364+
Debug::Fail("ExtCreatePen failed");
365365
}
366366
}
367367

src/Microsoft.DotNet.Wpf/src/System.Printing/CPP/src/GDIExporter/gdirt.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ HRESULT CGDIRenderTarget::StrokePath(
11781178
}
11791179
else
11801180
{
1181-
Debug::Assert(false, "PathGeometry.GetWidenedPathGeometry failed.");
1181+
Debug::Fail("PathGeometry.GetWidenedPathGeometry failed.");
11821182
}
11831183
}
11841184

@@ -1487,12 +1487,12 @@ HRESULT CGDIRenderTarget::FillLinearGradient(
14871487
}
14881488
else if (gradientBrush->GradientStops == nullptr || gradientBrush->GradientStops->Count == 0)
14891489
{
1490-
Debug::Assert(false, "Empty LinearGradientBrush, should've been culled");
1490+
Debug::Fail("Empty LinearGradientBrush, should've been culled");
14911491
return S_OK;
14921492
}
14931493
else if (gradientBrush->GradientStops->Count == 1)
14941494
{
1495-
Debug::Assert(false, "Single-stop LinearGradientBrush, should've been converted to SolidColorBrush");
1495+
Debug::Fail("Single-stop LinearGradientBrush, should've been converted to SolidColorBrush");
14961496
return FillPath(geometry, gcnew SolidColorBrush(gradientBrush->GradientStops[0]->Color));
14971497
}
14981498

@@ -1538,7 +1538,7 @@ HRESULT CGDIRenderTarget::FillLinearGradient(
15381538
break;
15391539

15401540
default:
1541-
Debug::Assert(false, "Unknown GradientSpreadMethod");
1541+
Debug::Fail("Unknown GradientSpreadMethod");
15421542
return E_NOTIMPL;
15431543
}
15441544

src/Microsoft.DotNet.Wpf/src/System.Printing/CPP/src/GDIExporter/gditextrt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ GdiSafeHandle^ CGDIRenderTarget::CreateSimulatedStyleFont(interior_ptr<ENUMLOGFO
931931
{
932932
// we have no way of telling if we've succeeded in creating unstyled font,
933933
// fail.
934-
Debug::Assert(false, "CreateUnstyledFont failed");
934+
Debug::Fail("CreateUnstyledFont failed");
935935
}
936936
else
937937
{
@@ -975,7 +975,7 @@ GdiSafeHandle^ CGDIRenderTarget::CreateSimulatedStyleFont(interior_ptr<ENUMLOGFO
975975

976976
if (charsetFont == nullptr)
977977
{
978-
Debug::Assert(false, "CreateFontCached failed");
978+
Debug::Fail("CreateFontCached failed");
979979
}
980980
else if (CheckFontFaceAndStyle(charsetFont, regularFaceName, regularStyleName))
981981
{

0 commit comments

Comments
 (0)