Skip to content

Commit

Permalink
Debug::Assert(false to Debug::Fail (#9441)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperk81 authored Jul 23, 2024
1 parent 804a31e commit e84c567
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace MS { namespace Internal { namespace Text { namespace TextInterface

public:

FontCollectionLoader() { Debug::Assert(false, "Assertion failed"); }
FontCollectionLoader() { Debug::Fail("Assertion failed"); }

FontCollectionLoader(
IFontSourceCollectionFactory^ fontSourceCollectionFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace MS { namespace Internal { namespace Text { namespace TextInterface

public:

FontFileEnumerator() { Debug::Assert(false, "Assertion failed"); }
FontFileEnumerator() { Debug::Fail("Assertion failed"); }

FontFileEnumerator(
IEnumerable<IFontSource^>^ fontSourceCollection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace MS { namespace Internal { namespace Text { namespace TextInterface

public:

FontFileLoader() { Debug::Assert(false, "Assertion failed"); }
FontFileLoader() { Debug::Fail("Assertion failed"); }

FontFileLoader(IFontSourceFactory^ fontSourceFactory);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace MS { namespace Internal { namespace Text { namespace TextInterface
/// Asserts false because COM convention requires us to have a default constructor
/// but we are the only entity that can construct these objects, and we use the
/// other constructor.
FontFileStream() { Debug::Assert(false, "Assertion failed"); }
FontFileStream() { Debug::Fail("Assertion failed"); }

/// <summary>
/// ctor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void CGDIBitmap::SetupPalette(interior_ptr<BITMAPINFO> bmi, int bitCount)
}
else
{
Debug::Assert(false, "Unsupported format");
Debug::Fail("Unsupported format");
}

bmi->bmiHeader.biClrUsed = count;
Expand Down Expand Up @@ -242,7 +242,7 @@ void CGDIBitmap::SetBits(interior_ptr<BITMAPINFO> bmi)
}
else
{
Debug::Assert(false, "Unexpected bitcount");
Debug::Fail("Unexpected bitcount");
m_Buffer = nullptr;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ GdiSafeHandle^ CGDIDevice::ConvertBrush(COLORREF colorRef)
}
else
{
Debug::Assert(false, "CreateSolidBrush failed");
Debug::Fail("CreateSolidBrush failed");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ ref class GdiGeometryConverter : public CapacityStreamGeometryContext

if (Double::IsNaN(transformedPoint.X) || Double::IsNaN(transformedPoint.Y))
{
Debug::Assert(false, "Invalid path input: NaN encountered");
Debug::Fail("Invalid path input: NaN encountered");
ForceGeometryEmpty();
return -1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ GdiSafeHandle^ CGDIDevice::ConvertPen(
}
else
{
Debug::Assert(false, "ExtCreatePen failed");
Debug::Fail("ExtCreatePen failed");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ HRESULT CGDIRenderTarget::StrokePath(
}
else
{
Debug::Assert(false, "PathGeometry.GetWidenedPathGeometry failed.");
Debug::Fail("PathGeometry.GetWidenedPathGeometry failed.");
}
}

Expand Down Expand Up @@ -1487,12 +1487,12 @@ HRESULT CGDIRenderTarget::FillLinearGradient(
}
else if (gradientBrush->GradientStops == nullptr || gradientBrush->GradientStops->Count == 0)
{
Debug::Assert(false, "Empty LinearGradientBrush, should've been culled");
Debug::Fail("Empty LinearGradientBrush, should've been culled");
return S_OK;
}
else if (gradientBrush->GradientStops->Count == 1)
{
Debug::Assert(false, "Single-stop LinearGradientBrush, should've been converted to SolidColorBrush");
Debug::Fail("Single-stop LinearGradientBrush, should've been converted to SolidColorBrush");
return FillPath(geometry, gcnew SolidColorBrush(gradientBrush->GradientStops[0]->Color));
}

Expand Down Expand Up @@ -1538,7 +1538,7 @@ HRESULT CGDIRenderTarget::FillLinearGradient(
break;

default:
Debug::Assert(false, "Unknown GradientSpreadMethod");
Debug::Fail("Unknown GradientSpreadMethod");
return E_NOTIMPL;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ GdiSafeHandle^ CGDIRenderTarget::CreateSimulatedStyleFont(interior_ptr<ENUMLOGFO
{
// we have no way of telling if we've succeeded in creating unstyled font,
// fail.
Debug::Assert(false, "CreateUnstyledFont failed");
Debug::Fail("CreateUnstyledFont failed");
}
else
{
Expand Down Expand Up @@ -975,7 +975,7 @@ GdiSafeHandle^ CGDIRenderTarget::CreateSimulatedStyleFont(interior_ptr<ENUMLOGFO

if (charsetFont == nullptr)
{
Debug::Assert(false, "CreateFontCached failed");
Debug::Fail("CreateFontCached failed");
}
else if (CheckFontFaceAndStyle(charsetFont, regularFaceName, regularStyleName))
{
Expand Down

0 comments on commit e84c567

Please sign in to comment.