Remove "sanity"/"insane" to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference
Bug: 162536543
Change-Id: Ia9c81c2251ac7bf4eef6d37799741612989fc9c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307228
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
diff --git a/infra/bots/README.md b/infra/bots/README.md
index e9c8473..823962d 100644
--- a/infra/bots/README.md
+++ b/infra/bots/README.md
@@ -39,7 +39,7 @@
$ cd infra/bots; make train
-There is also a test mode which performs sanity-checks and verifies that
+There is also a test mode which performs consistency checks and verifies that
tasks.json is unchanged:
$ go run infra/bots/gen_tasks.go --test
diff --git a/infra/bots/recipes/skpbench.py b/infra/bots/recipes/skpbench.py
index b6e6d1d..7bd6adf 100644
--- a/infra/bots/recipes/skpbench.py
+++ b/infra/bots/recipes/skpbench.py
@@ -63,7 +63,7 @@
'-v5']
if 'DDL' in api.vars.builder_name:
skpbench_args += ['--ddl']
- # disable the mask generation threads for sanity's sake in DDL mode
+ # disable the mask generation threads for simplicity's sake in DDL mode
skpbench_args += ['--gpuThreads', '0']
if '9x9' in api.vars.builder_name:
skpbench_args += [
diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp
index e901957..b66d576 100644
--- a/src/codec/SkWebpCodec.cpp
+++ b/src/codec/SkWebpCodec.cpp
@@ -77,7 +77,7 @@
const int width = WebPDemuxGetI(demux, WEBP_FF_CANVAS_WIDTH);
const int height = WebPDemuxGetI(demux, WEBP_FF_CANVAS_HEIGHT);
- // Sanity check for image size that's about to be decoded.
+ // Validate the image size that's about to be decoded.
{
const int64_t size = sk_64_mul(width, height);
// now check that if we are 4-bytes per pixel, we also don't overflow
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index d5c6f59..ebdc1f0 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -751,7 +751,7 @@
}
void SkCanvas::restoreToCount(int count) {
- // sanity check
+ // safety check
if (count < 1) {
count = 1;
}
diff --git a/src/core/SkColorSpacePriv.h b/src/core/SkColorSpacePriv.h
index bbd0d00..9b4fad9 100644
--- a/src/core/SkColorSpacePriv.h
+++ b/src/core/SkColorSpacePriv.h
@@ -41,7 +41,7 @@
static inline TFKind classify_transfer_fn(const skcms_TransferFunction& tf) {
if (tf.g < 0 && (int)tf.g == tf.g) {
- // TODO: sanity checks for PQ/HLG like we do for sRGBish.
+ // TODO: safety checks for PQ/HLG like we do for sRGBish.
switch ((int)tf.g) {
case -PQish_TF: return PQish_TF;
case -HLGish_TF: return HLGish_TF;
@@ -50,7 +50,7 @@
return Bad_TF;
}
- // Basic sanity checks for sRGBish transfer functions.
+ // Basic safety checks for sRGBish transfer functions.
if (sk_float_isfinite(tf.a + tf.b + tf.c + tf.d + tf.e + tf.f + tf.g)
// a,c,d,g should be non-negative to make any sense.
&& tf.a >= 0
diff --git a/src/core/SkFontStream.cpp b/src/core/SkFontStream.cpp
index 54c8cab..010bbdd 100644
--- a/src/core/SkFontStream.cpp
+++ b/src/core/SkFontStream.cpp
@@ -180,8 +180,8 @@
if (SkEndian_SwapBE32(header.fDir[i].fTag) == tag) {
size_t realOffset = SkEndian_SwapBE32(header.fDir[i].fOffset);
size_t realLength = SkEndian_SwapBE32(header.fDir[i].fLength);
- // now sanity check the caller's offset/length
if (offset >= realLength) {
+ // invalid
return 0;
}
// if the caller is trusting the length from the file, then a
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 11bbd36..3ab4dbf 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -526,7 +526,6 @@
template<skif::Usage kU>
skif::FilterResult<kU> SkImageFilter_Base::filterInput(int index, const skif::Context& ctx) const {
- // Sanity checks for the index-specific input usages
SkASSERT(kU != skif::Usage::kInput0 || index == 0);
SkASSERT(kU != skif::Usage::kInput1 || index == 1);
diff --git a/src/core/SkRegion.cpp b/src/core/SkRegion.cpp
index a53718a..86c38bd 100644
--- a/src/core/SkRegion.cpp
+++ b/src/core/SkRegion.cpp
@@ -1202,7 +1202,7 @@
return false;
}
SkASSERT(runCount >= 7); // 7==SkRegion::kRectRegionRuns
- // quick sanity check:
+ // quick safety check:
if (runs[runCount - 1] != SkRegion_kRunTypeSentinel ||
runs[runCount - 2] != SkRegion_kRunTypeSentinel) {
return false;
diff --git a/src/core/SkScan_Hairline.cpp b/src/core/SkScan_Hairline.cpp
index eeea9e7..ae0e817 100644
--- a/src/core/SkScan_Hairline.cpp
+++ b/src/core/SkScan_Hairline.cpp
@@ -439,7 +439,7 @@
than a pixel.
*/
int level = (33 - SkCLZ(d)) >> 1;
- // sanity check on level (from the previous version)
+ // safety check on level (from the previous version)
if (level > kMaxQuadSubdivideLevel) {
level = kMaxQuadSubdivideLevel;
}
diff --git a/src/core/SkStrikeSpec.cpp b/src/core/SkStrikeSpec.cpp
index 51b92e0..95a5148 100644
--- a/src/core/SkStrikeSpec.cpp
+++ b/src/core/SkStrikeSpec.cpp
@@ -147,7 +147,7 @@
SkMatrix textMatrix = SkFontPriv::MakeTextMatrix(font);
textMatrix.postConcat(viewMatrix);
- // we have a self-imposed maximum, just for memory-usage sanity
+ // we have a self-imposed maximum, just to limit memory-usage
SkScalar limit = std::min(SkGraphics::GetFontCachePointSizeLimit(), 1024);
SkScalar maxSizeSquared = limit * limit;
diff --git a/src/effects/imagefilters/SkBlurImageFilter.cpp b/src/effects/imagefilters/SkBlurImageFilter.cpp
index ee4c9d0..f57fbcd 100644
--- a/src/effects/imagefilters/SkBlurImageFilter.cpp
+++ b/src/effects/imagefilters/SkBlurImageFilter.cpp
@@ -116,7 +116,6 @@
buffer.writeScalar(fSigma.fWidth);
buffer.writeScalar(fSigma.fHeight);
- // Fuzzer sanity checks
static_assert((int) SkTileMode::kLastTileMode == 3 && SkBlurImageFilter::kLast_TileMode == 2,
"SkBlurImageFilterImpl::flatten");
SkASSERT(fTileMode <= SkTileMode::kLastTileMode);
diff --git a/src/gpu/GrBlockAllocator.cpp b/src/gpu/GrBlockAllocator.cpp
index b1e674f..181c74d 100644
--- a/src/gpu/GrBlockAllocator.cpp
+++ b/src/gpu/GrBlockAllocator.cpp
@@ -109,7 +109,7 @@
// The released block becomes the new scratch block (if it's bigger), or delete it
if (this->scratchBlockSize() < block->fSize) {
- SkASSERT(block != fHead.fPrev); // sanity check, shouldn't already be the scratch block
+ SkASSERT(block != fHead.fPrev); // shouldn't already be the scratch block
if (fHead.fPrev) {
delete fHead.fPrev;
}
diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp
index b661012..de2f6ef 100644
--- a/src/gpu/GrFragmentProcessor.cpp
+++ b/src/gpu/GrFragmentProcessor.cpp
@@ -176,7 +176,7 @@
child->fParent = this;
fChildProcessors.push_back(std::move(child));
- // Sanity check: our sample strategy comes from a parent we shouldn't have yet.
+ // Validate: our sample strategy comes from a parent we shouldn't have yet.
SkASSERT(!this->isSampledWithExplicitCoords() && !this->hasPerspectiveTransform() &&
!fUsage.isSampled() && !fParent);
}
diff --git a/src/gpu/dawn/GrDawnOpsRenderPass.cpp b/src/gpu/dawn/GrDawnOpsRenderPass.cpp
index 7f71a43..700aef5 100644
--- a/src/gpu/dawn/GrDawnOpsRenderPass.cpp
+++ b/src/gpu/dawn/GrDawnOpsRenderPass.cpp
@@ -148,7 +148,7 @@
void GrDawnOpsRenderPass::onSetScissorRect(const SkIRect& scissor) {
// Higher-level GrRenderTargetContext and clips should have already ensured draw bounds are
- // restricted to the render target. This is a sanity check.
+ // restricted to the render target.
SkASSERT(SkIRect::MakeSize(fRenderTarget->dimensions()).contains(scissor));
auto nativeScissorRect =
GrNativeRect::MakeRelativeTo(fOrigin, fRenderTarget->height(), scissor);
diff --git a/src/gpu/geometry/GrShape.cpp b/src/gpu/geometry/GrShape.cpp
index a013cf1..3884c40 100644
--- a/src/gpu/geometry/GrShape.cpp
+++ b/src/gpu/geometry/GrShape.cpp
@@ -238,7 +238,7 @@
}
bool GrShape::simplify(unsigned flags) {
- // Sanity check that winding parameters are valid for the current type.
+ // Verify that winding parameters are valid for the current type.
SkASSERT((fType == Type::kRect || fType == Type::kRRect) ||
(this->dir() == kDefaultDir && this->startIndex() == kDefaultStart));
diff --git a/src/gpu/geometry/GrStyledShape.cpp b/src/gpu/geometry/GrStyledShape.cpp
index 0e87857..77b96c1 100644
--- a/src/gpu/geometry/GrStyledShape.cpp
+++ b/src/gpu/geometry/GrStyledShape.cpp
@@ -70,7 +70,7 @@
result.fSimplified = true;
}
- // Sanity check that lines/points were converted to empty by the style change
+ // Verify that lines/points were converted to empty by the style change
SkASSERT((!original.fShape.isLine() && !original.fShape.isPoint()) || result.fShape.isEmpty());
// We don't copy the inherited key since it can contain path effect information that we just
@@ -426,7 +426,7 @@
return false;
}
- // Sanity check here, if we don't have a path effect on the style, we should have passed
+ // Validity check here, if we don't have a path effect on the style, we should have passed
// appropriate flags to GrShape::simplify() to have reset these parameters.
SkASSERT(fStyle.hasPathEffect() || (fShape.dir() == GrShape::kDefaultDir &&
fShape.startIndex() == GrShape::kDefaultStart));
diff --git a/src/pathops/SkPathOpsDebug.h b/src/pathops/SkPathOpsDebug.h
index b452f72..b7f440e 100644
--- a/src/pathops/SkPathOpsDebug.h
+++ b/src/pathops/SkPathOpsDebug.h
@@ -84,7 +84,7 @@
#define DEBUG_ALIGNMENT 0
#define DEBUG_ANGLE 0
#define DEBUG_ASSEMBLE 0
-#define DEBUG_COINCIDENCE 0 // sanity checking
+#define DEBUG_COINCIDENCE 0
#define DEBUG_COINCIDENCE_DUMP 0 // accumulate and dump which algorithms fired
#define DEBUG_COINCIDENCE_ORDER 0 // for well behaved curves, check if pairs match up in t-order
#define DEBUG_COINCIDENCE_VERBOSE 0 // usually whether the next function generates coincidence
diff --git a/src/pdf/SkPDFBitmap.cpp b/src/pdf/SkPDFBitmap.cpp
index 86bfc80..fcd03b1 100644
--- a/src/pdf/SkPDFBitmap.cpp
+++ b/src/pdf/SkPDFBitmap.cpp
@@ -204,7 +204,7 @@
}
bool yuv = jpegColorType == SkEncodedInfo::kYUV_Color;
bool goodColorType = yuv || jpegColorType == SkEncodedInfo::kGray_Color;
- if (jpegSize != size // Sanity check.
+ if (jpegSize != size // Safety check.
|| !goodColorType
|| kTopLeft_SkEncodedOrigin != exifOrientation) {
return false;
diff --git a/src/pdf/SkPDFResourceDict.cpp b/src/pdf/SkPDFResourceDict.cpp
index dd69901..6705b04 100644
--- a/src/pdf/SkPDFResourceDict.cpp
+++ b/src/pdf/SkPDFResourceDict.cpp
@@ -9,8 +9,8 @@
#include "src/pdf/SkPDFResourceDict.h"
#include "src/pdf/SkPDFTypes.h"
-// Sanity check that the values of enum ResourceType correspond to the
-// expected values as defined in the arrays below.
+// Verify that the values of enum ResourceType correspond to the expected values
+// as defined in the arrays below.
// If these are failing, you may need to update the kResourceTypePrefixes
// and kResourceTypeNames arrays below.
static_assert(0 == (int)SkPDFResourceType::kExtGState, "resource_type_mismatch");
diff --git a/src/sksl/SkSLCPPCodeGenerator.cpp b/src/sksl/SkSLCPPCodeGenerator.cpp
index 79d04be..a95b36c 100644
--- a/src/sksl/SkSLCPPCodeGenerator.cpp
+++ b/src/sksl/SkSLCPPCodeGenerator.cpp
@@ -398,7 +398,7 @@
void CPPCodeGenerator::writeFunctionCall(const FunctionCall& c) {
if (c.fFunction.fBuiltin && c.fFunction.fName == "sample" &&
c.fArguments[0]->fType.kind() != Type::Kind::kSampler_Kind) {
- // Sanity checks that are detected by function definition in sksl_fp.inc
+ // Validity checks that are detected by function definition in sksl_fp.inc
SkASSERT(c.fArguments.size() >= 1 && c.fArguments.size() <= 3);
SkASSERT("fragmentProcessor" == c.fArguments[0]->fType.name() ||
"fragmentProcessor?" == c.fArguments[0]->fType.name());
diff --git a/tests/BitmapTest.cpp b/tests/BitmapTest.cpp
index be1f3c7..f81e5f7 100644
--- a/tests/BitmapTest.cpp
+++ b/tests/BitmapTest.cpp
@@ -147,9 +147,6 @@
REPORTER_ASSERT(reporter, !bm.setInfo(info.makeColorType(kN32_SkColorType)));
}
-/**
- * This test contains basic sanity checks concerning bitmaps.
- */
DEF_TEST(Bitmap, reporter) {
// Zero-sized bitmaps are allowed
for (int width = 0; width < 2; ++width) {
diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp
index 53eba73..76f625a 100644
--- a/tests/ClipStackTest.cpp
+++ b/tests/ClipStackTest.cpp
@@ -122,7 +122,6 @@
s.clipRect(r, SkMatrix::I(), kUnion_SkClipOp, doAA);
REPORTER_ASSERT(reporter, s != copy);
- // Sanity check
s.restore();
REPORTER_ASSERT(reporter, 2 == s.getSaveCount());
diff --git a/tests/GrBlockAllocatorTest.cpp b/tests/GrBlockAllocatorTest.cpp
index ad768c4..ea8907a 100644
--- a/tests/GrBlockAllocatorTest.cpp
+++ b/tests/GrBlockAllocatorTest.cpp
@@ -478,7 +478,7 @@
avail = oldTail->avail();
size_t scratchAvail = 2 * avail;
pool->reserve(scratchAvail);
- REPORTER_ASSERT(r, (size_t) pool->testingOnly_scratchBlockSize() >= scratchAvail); // sanity
+ REPORTER_ASSERT(r, (size_t) pool->testingOnly_scratchBlockSize() >= scratchAvail);
// This allocation request is higher than oldTail's available, and the scratch size so we
// should add a new block and scratch size should stay the same.
diff --git a/tests/GrQuadBufferTest.cpp b/tests/GrQuadBufferTest.cpp
index e36651c..5fce192 100644
--- a/tests/GrQuadBufferTest.cpp
+++ b/tests/GrQuadBufferTest.cpp
@@ -71,7 +71,7 @@
break;
}
- SkASSERT(quad.quadType() == types[i]); // sanity check
+ SkASSERT(quad.quadType() == types[i]);
quads.push_back(quad);
}
return quads;
@@ -149,7 +149,6 @@
buffer2.append(quadsB[i], {2 * i, 0.5f * i}, i % 2 == 0 ? nullptr : &quadsA[i]);
}
- // Sanity check
ASSERT(kQuadCount == buffer1.count());
ASSERT(kQuadCount == buffer2.count());
diff --git a/tests/GrTBlockListTest.cpp b/tests/GrTBlockListTest.cpp
index 45d1416..a409f35 100644
--- a/tests/GrTBlockListTest.cpp
+++ b/tests/GrTBlockListTest.cpp
@@ -179,7 +179,6 @@
listB.emplace_back(aCount + i);
}
- // Sanity check
REPORTER_ASSERT(reporter, listA.count() == aCount && listB.count() == bCount);
REPORTER_ASSERT(reporter, C::gInstCnt == aCount + bCount);
@@ -217,7 +216,6 @@
listB.push_back({aCount + i});
}
- // Sanity check
REPORTER_ASSERT(reporter, listA.count() == aCount && listB.count() == bCount);
// Concatenate B into A and verify.
listA.concat(std::move(listB));
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index 74ec861..7d18b16 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -1306,7 +1306,7 @@
bitmap.allocN32Pixels(100, 100);
bitmap.eraseARGB(0, 0, 0, 0);
- // Check that a blur with an insane radius does not crash or assert.
+ // Check that a blur with a very large radius does not crash or assert.
SkPaint paint;
paint.setImageFilter(SkImageFilters::Blur(SkIntToScalar(1<<30), SkIntToScalar(1<<30), nullptr));
canvas->drawBitmap(bitmap, 0, 0, &paint);
@@ -1319,7 +1319,7 @@
test_huge_blur(&canvas, reporter);
}
-DEF_TEST(ImageFilterMatrixConvolutionSanityTest, reporter) {
+DEF_TEST(ImageFilterMatrixConvolutionTest, reporter) {
SkScalar kernel[1] = { 0 };
SkScalar gain = SK_Scalar1, bias = 0;
SkIPoint kernelOffset = SkIPoint::Make(1, 1);
diff --git a/tests/MallocPixelRefTest.cpp b/tests/MallocPixelRefTest.cpp
index b20e5bb..1288a27 100644
--- a/tests/MallocPixelRefTest.cpp
+++ b/tests/MallocPixelRefTest.cpp
@@ -19,9 +19,6 @@
*(static_cast<int*>(context)) = 1;
}
-/**
- * This test contains basic sanity checks concerning SkMallocPixelRef.
- */
DEF_TEST(MallocPixelRef, reporter) {
REPORTER_ASSERT(reporter, true);
SkImageInfo info = SkImageInfo::MakeN32Premul(10, 13);
diff --git a/tests/OctoBoundsTest.cpp b/tests/OctoBoundsTest.cpp
index f37ae73..01d9cc0 100644
--- a/tests/OctoBoundsTest.cpp
+++ b/tests/OctoBoundsTest.cpp
@@ -189,7 +189,7 @@
test_octagon(reporter, &rand, 0, -10, 100, 0);
// We can't test Infs or NaNs because they trigger internal asserts when setting GrOctoBounds.
- // Sanity check on our random clip testing.. Just make we hit both types of clip.
+ // Verify that our random clip testing hit both types of clip.
REPORTER_ASSERT(reporter, numClipsOut > 0);
REPORTER_ASSERT(reporter, numIntersectClips > 0);
}
diff --git a/tests/Time.cpp b/tests/Time.cpp
index 189443b..ee80068 100644
--- a/tests/Time.cpp
+++ b/tests/Time.cpp
@@ -9,7 +9,6 @@
#include "include/private/SkTo.h"
#include "tests/Test.h"
-// Sanity checks for the GetDateTime function.
DEF_TEST(Time_GetDateTime, r) {
SkTime::DateTime dateTime;
SkTime::GetDateTime(&dateTime);