Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug::Assert(false to Debug::Fail #9441

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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");
anjali-wpf marked this conversation as resolved.
Show resolved Hide resolved
}

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
Loading