Skip to content

Commit e848313

Browse files
authored
Use Debug.Fail("message") over Debug.Assert(false, "message") (#10723)
1 parent 76a1d57 commit e848313

File tree

121 files changed

+229
-229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+229
-229
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Ink/InkSerializedFormat/CustomAttributeSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ internal static void Validate(Guid id, object value)
938938
}
939939
default:
940940
{
941-
Debug.Assert(false, "Missing case statement!");
941+
Debug.Fail("Missing case statement!");
942942
break;
943943
}
944944
}

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Ink/InkSerializedFormat/DrawingAttributeSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ internal static uint DecodeAsISF(Stream stream, GuidList guidList, uint maximumS
279279
}
280280
catch (InvalidOperationException) // Matrix.Parse failed.
281281
{
282-
System.Diagnostics.Debug.Assert(false, "Corrupt Matrix in the ExtendedPropertyCollection!");
282+
System.Diagnostics.Debug.Fail("Corrupt Matrix in the ExtendedPropertyCollection!");
283283
}
284284
finally
285285
{

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Ink/InkSerializedFormat/StrokeSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ private static uint DecodeISFIntoStroke(
288288

289289
byte[] out_buffer = Compressor.DecompressPropertyData(in_buffer);
290290

291-
System.Diagnostics.Debug.Assert(false, "ExtendedProperties for points are not supported");
291+
System.Diagnostics.Debug.Fail("ExtendedProperties for points are not supported");
292292

293293
// skip the bytes in both success & failure cases
294294
// Note: Point ExtendedProperties are discarded

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Ink/StrokeNode.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ List<Point> dcPoints
256256

257257
if (i == maxCount)
258258
{
259-
Debug.Assert(false, "StrokeNodeOperations.GetPointsAtStartOfSegment failed to find the D position");
259+
Debug.Fail("StrokeNodeOperations.GetPointsAtStartOfSegment failed to find the D position");
260260
//we didn't find the d point, return
261261
return;
262262
}
@@ -369,7 +369,7 @@ List<Point> dcPoints
369369

370370
if (i == maxCount)
371371
{
372-
Debug.Assert(false, "StrokeNodeOperations.GetPointsAtEndOfSegment failed to find the B position");
372+
Debug.Fail("StrokeNodeOperations.GetPointsAtEndOfSegment failed to find the B position");
373373
//we didn't find the d point, return
374374
return;
375375
}
@@ -636,7 +636,7 @@ out bool missingIntersection
636636

637637
if (indexA == -1 || indexB == -1 || indexC == -1 || indexD == -1)
638638
{
639-
Debug.Assert(false, "Couldn't find all 4 indexes in StrokeNodeOperations.GetPointsAtMiddleSegment");
639+
Debug.Fail("Couldn't find all 4 indexes in StrokeNodeOperations.GetPointsAtMiddleSegment");
640640
return;
641641
}
642642

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Shaping/OpenTypeCommon.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ out NextGlyph
591591
break;
592592
}
593593
default:
594-
Debug.Assert(false,"Unknown OpenType layout table!");
594+
Debug.Fail("Unknown OpenType layout table!");
595595
break;
596596
}
597597
}
@@ -1072,7 +1072,7 @@ out int complexLanguageCount
10721072
break;
10731073

10741074
case 7: //Extension lookup
1075-
Debug.Assert(false,"Ext.Lookup processed earlier!");
1075+
Debug.Fail("Ext.Lookup processed earlier!");
10761076
break;
10771077

10781078
case 8: //ReverseCahiningSubst
@@ -1157,7 +1157,7 @@ out int complexLanguageCount
11571157
break;
11581158

11591159
case 9: //Extension lookup
1160-
Debug.Assert(false,"Ext.Lookup processed earlier!");
1160+
Debug.Fail("Ext.Lookup processed earlier!");
11611161
break;
11621162

11631163
default:
@@ -1170,7 +1170,7 @@ out int complexLanguageCount
11701170
}
11711171

11721172
default:
1173-
Debug.Assert(false,"Unknown OpenType layout table!");
1173+
Debug.Fail("Unknown OpenType layout table!");
11741174
break;
11751175
}
11761176
}

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Shaping/TypefaceMap.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ ref SpanVector<int> cachedScaledTypefaceIndexSpans
214214
typefaceIndexSpanRider.At(ichRange + ich);
215215
if((int)typefaceIndexSpanRider.CurrentValue < 0)
216216
{
217-
Debug.Assert(false, "Invalid font face spans");
217+
Debug.Fail("Invalid font face spans");
218218
return;
219219
}
220220

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Shaping/UshortList2.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,24 +131,24 @@ internal abstract class UshortBuffer
131131

132132
public virtual ushort[] ToArray()
133133
{
134-
Debug.Assert(false, "Not supported");
134+
Debug.Fail("Not supported");
135135
return null;
136136
}
137137

138138
public virtual ushort[] GetSubsetCopy(int index, int count)
139139
{
140-
Debug.Assert(false, "Not supported");
140+
Debug.Fail("Not supported");
141141
return null;
142142
}
143143

144144
public virtual void Insert(int index, int count, int length)
145145
{
146-
Debug.Assert(false, "Not supported");
146+
Debug.Fail("Not supported");
147147
}
148148

149149
public virtual void Remove(int index, int count, int length)
150150
{
151-
Debug.Assert(false, "Not supported");
151+
Debug.Fail("Not supported");
152152
}
153153
}
154154

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/LineServicesCallbacks.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ private Rect DrawTextDecoration(
12341234
break;
12351235

12361236
default:
1237-
Debug.Assert(false, "Not supported TextDecorationUnit");
1237+
Debug.Fail("Not supported TextDecorationUnit");
12381238
break;
12391239
}
12401240

@@ -1261,7 +1261,7 @@ private Rect DrawTextDecoration(
12611261
break;
12621262

12631263
default:
1264-
Debug.Assert(false, "Not supported TextDecorationUnit");
1264+
Debug.Fail("Not supported TextDecorationUnit");
12651265
break;
12661266
}
12671267

@@ -2312,7 +2312,7 @@ internal unsafe LsErr GetObjectHandlerInfo(
23122312
break;
23132313

23142314
default:
2315-
Debug.Assert(false, "Unsupported installed object!");
2315+
Debug.Fail("Unsupported installed object!");
23162316
break;
23172317
}
23182318
}

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/TextMarkerSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ int autoNumberingIndex
124124
}
125125
else
126126
{
127-
Debug.Assert(false, "Invalid marker style");
127+
Debug.Fail("Invalid marker style");
128128
}
129129

130130
if(symbolString != null)

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/IO/Packaging/PackWebResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ internal Stream GetResponseStream()
608608
// full container request?
609609
if (_parent._partName == null)
610610
{
611-
Debug.Assert(false, "Cannot return full-container stream from cached container object");
611+
Debug.Fail("Cannot return full-container stream from cached container object");
612612
}
613613
else
614614
{

0 commit comments

Comments
 (0)