2011-06-02 14:38:23 +00:00
|
|
|
# GYP file to build unit tests.
|
|
|
|
{
|
|
|
|
'includes': [
|
|
|
|
'apptype_console.gypi',
|
|
|
|
],
|
|
|
|
'targets': [
|
|
|
|
{
|
|
|
|
'target_name': 'tests',
|
|
|
|
'type': 'executable',
|
|
|
|
'include_dirs' : [
|
|
|
|
'../src/core',
|
2012-03-20 21:18:43 +00:00
|
|
|
'../src/effects',
|
2013-10-29 19:55:00 +00:00
|
|
|
'../src/image',
|
2013-02-22 21:38:35 +00:00
|
|
|
'../src/lazy',
|
2013-11-21 15:32:08 +00:00
|
|
|
'../src/images',
|
2013-04-25 13:34:40 +00:00
|
|
|
'../src/pathops',
|
2012-03-22 20:45:15 +00:00
|
|
|
'../src/pdf',
|
2012-08-08 20:43:22 +00:00
|
|
|
'../src/pipe/utils',
|
2012-03-21 23:11:46 +00:00
|
|
|
'../src/utils',
|
2012-07-09 18:32:08 +00:00
|
|
|
'../tools/',
|
2013-11-20 21:40:57 +00:00
|
|
|
|
|
|
|
# Needed for TDStackNesterTest.
|
|
|
|
'../experimental/PdfViewer',
|
|
|
|
'../experimental/PdfViewer/src',
|
2011-06-02 14:38:23 +00:00
|
|
|
],
|
2013-04-19 11:45:56 +00:00
|
|
|
'includes': [
|
|
|
|
'pathops_unittest.gypi',
|
|
|
|
],
|
2011-06-02 14:38:23 +00:00
|
|
|
'sources': [
|
2011-10-26 15:03:48 +00:00
|
|
|
'../tests/AAClipTest.cpp',
|
2013-09-26 15:16:12 +00:00
|
|
|
'../tests/AndroidPaintTest.cpp',
|
2012-07-11 19:57:55 +00:00
|
|
|
'../tests/AnnotationTest.cpp',
|
2013-04-23 18:06:23 +00:00
|
|
|
'../tests/ARGBImageEncoderTest.cpp',
|
2012-07-16 16:51:28 +00:00
|
|
|
'../tests/AtomicTest.cpp',
|
2013-12-13 18:29:51 +00:00
|
|
|
'../tests/BitmapTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/BitmapCopyTest.cpp',
|
|
|
|
'../tests/BitmapGetColorTest.cpp',
|
2013-04-12 02:23:55 +00:00
|
|
|
'../tests/BitmapHasherTest.cpp',
|
2012-11-16 20:34:37 +00:00
|
|
|
'../tests/BitmapHeapTest.cpp',
|
2011-07-07 13:43:38 +00:00
|
|
|
'../tests/BitSetTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/BlitRowTest.cpp',
|
2011-07-07 13:43:38 +00:00
|
|
|
'../tests/BlurTest.cpp',
|
2013-10-29 19:55:00 +00:00
|
|
|
'../tests/CachedDecodingPixelRefTest.cpp',
|
2011-11-28 16:06:04 +00:00
|
|
|
'../tests/CanvasTest.cpp',
|
2013-08-29 20:20:40 +00:00
|
|
|
'../tests/CanvasStateTest.cpp',
|
2012-11-02 18:35:04 +00:00
|
|
|
'../tests/ChecksumTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/ClampRangeTest.cpp',
|
2012-05-09 21:15:28 +00:00
|
|
|
'../tests/ClipCacheTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/ClipCubicTest.cpp',
|
|
|
|
'../tests/ClipStackTest.cpp',
|
|
|
|
'../tests/ClipperTest.cpp',
|
|
|
|
'../tests/ColorFilterTest.cpp',
|
2013-12-03 18:53:30 +00:00
|
|
|
'../tests/ColorPrivTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/ColorTest.cpp',
|
2011-06-14 19:18:26 +00:00
|
|
|
'../tests/DataRefTest.cpp',
|
2012-02-07 16:27:57 +00:00
|
|
|
'../tests/DeferredCanvasTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/DequeTest.cpp',
|
2013-09-17 20:03:43 +00:00
|
|
|
'../tests/DeviceLooperTest.cpp',
|
2013-12-05 18:31:42 +00:00
|
|
|
'../tests/DiscardableMemoryPool.cpp',
|
2013-12-10 18:33:07 +00:00
|
|
|
'../tests/DiscardableMemoryTest.cpp',
|
2013-10-22 14:49:03 +00:00
|
|
|
'../tests/DocumentTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/DrawBitmapRectTest.cpp',
|
2012-04-14 12:55:17 +00:00
|
|
|
'../tests/DrawPathTest.cpp',
|
2012-01-13 15:02:58 +00:00
|
|
|
'../tests/DrawTextTest.cpp',
|
2013-08-05 22:31:20 +00:00
|
|
|
'../tests/DynamicHashTest.cpp',
|
2011-12-21 19:36:21 +00:00
|
|
|
'../tests/EmptyPathTest.cpp',
|
2013-04-08 21:44:11 +00:00
|
|
|
'../tests/ErrorTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/FillPathTest.cpp',
|
2013-07-12 18:22:49 +00:00
|
|
|
'../tests/FitsInTest.cpp',
|
2012-08-01 19:34:20 +00:00
|
|
|
'../tests/FlatDataTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/FlateTest.cpp',
|
2012-05-18 19:06:41 +00:00
|
|
|
'../tests/FontHostStreamTest.cpp',
|
2012-02-23 14:51:10 +00:00
|
|
|
'../tests/FontHostTest.cpp',
|
2013-04-11 18:31:25 +00:00
|
|
|
'../tests/FontMgrTest.cpp',
|
2013-04-02 14:12:38 +00:00
|
|
|
'../tests/FontNamesTest.cpp',
|
2013-09-26 21:35:39 +00:00
|
|
|
'../tests/FrontBufferedStreamTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/GeometryTest.cpp',
|
2014-01-27 21:54:18 +00:00
|
|
|
'../tests/GifTest.cpp',
|
2011-10-24 21:17:53 +00:00
|
|
|
'../tests/GLInterfaceValidation.cpp',
|
2011-08-16 15:45:58 +00:00
|
|
|
'../tests/GLProgramsTest.cpp',
|
2012-08-22 15:00:05 +00:00
|
|
|
'../tests/GpuBitmapCopyTest.cpp',
|
2013-10-23 05:42:03 +00:00
|
|
|
'../tests/GpuColorFilterTest.cpp',
|
2013-08-05 13:28:55 +00:00
|
|
|
'../tests/GpuDrawPathTest.cpp',
|
2012-08-14 22:02:48 +00:00
|
|
|
'../tests/GrContextFactoryTest.cpp',
|
2013-11-08 18:45:27 +00:00
|
|
|
'../tests/GrDrawTargetTest.cpp',
|
2014-01-27 21:54:18 +00:00
|
|
|
'../tests/GradientTest.cpp',
|
2012-06-19 15:40:27 +00:00
|
|
|
'../tests/GrMemoryPoolTest.cpp',
|
2013-04-09 15:04:12 +00:00
|
|
|
'../tests/GrSurfaceTest.cpp',
|
2013-12-02 13:50:38 +00:00
|
|
|
'../tests/GrUnitTests.cpp',
|
2012-09-18 17:16:33 +00:00
|
|
|
'../tests/HashCacheTest.cpp',
|
2013-07-23 19:13:54 +00:00
|
|
|
'../tests/ImageCacheTest.cpp',
|
2013-06-14 15:33:20 +00:00
|
|
|
'../tests/ImageDecodingTest.cpp',
|
2013-07-24 22:19:24 +00:00
|
|
|
'../tests/ImageFilterTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/InfRectTest.cpp',
|
Make image decoding more fault resistant, less verbose.
This change address what happens when a jpeg is partially downloaded
before failing. Many browsers will render it anyway: we want Skia to
do the same. The JpegTest takes a perfectly cromulent jpeg file and
only passes into the ImageDecoder the first half of the image. We
then verify that the image decoder returns a valid bitmap of the
correct dimensions.
We also fixed some png library errors, including issue 1691.
Also, suppressed the majority of warnings from using libpng and
libjpeg. By default, most warnings are *not* suppressed in debug mode.
If you have a debug binary and wish to suppress warnings, set the
following environment variables to true
skia_images_png_suppressDecoderWarnings
skia_images_jpeg_suppressDecoderWarnings
or from within a program that links to Skia:
#if defined(SK_DEBUG)
#include "SkRTConf.h"
SK_CONF_SET("images.jpeg.suppressDecoderWarnings", true);
SK_CONF_SET("images.png.suppressDecoderWarnings", true);
#endif
I tested this, before (control) and after these changes (test), on
364,295 skps from the cluster telemetry.
- number of errors+warnings in control = 2804
- number of errors+warnings fixed = 2283
- number of PNG verbosity fixed = 2152
- number of PNG error fixed = 4
- number of PNG segfault fixed = 3
- number of PNG errors changed to warnings = 62
- number of JPG verbosity fixed = 26
- number of JPG error fixed = 91
Not all errors and warning have been fixed.
These numbers were generated using the find_bad_images_in_skps.py
program. This program may be useful going forward for testing
image-decoding libraries on skp files from the cluster telemetry.
find_bad_images_in_skps.py depends on the test_image_decoder program,
which simply executes the SkImageDecoder::DecodeFile function and uses
its exit status to report success or failure.
BUG=skia:1649
BUG=skia:1691
BUG=skia:1680
R=scroggo@google.com
Review URL: https://codereview.chromium.org/24449003
git-svn-id: http://skia.googlecode.com/svn/trunk@11597 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-04 12:46:45 +00:00
|
|
|
'../tests/JpegTest.cpp',
|
2012-12-03 18:01:45 +00:00
|
|
|
'../tests/LListTest.cpp',
|
2013-05-22 12:35:50 +00:00
|
|
|
'../tests/LayerDrawLooperTest.cpp',
|
2013-01-31 19:47:48 +00:00
|
|
|
'../tests/MD5Test.cpp',
|
2014-01-02 17:29:28 +00:00
|
|
|
'../tests/MallocPixelRefTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/MathTest.cpp',
|
|
|
|
'../tests/MatrixTest.cpp',
|
2011-06-09 19:13:41 +00:00
|
|
|
'../tests/Matrix44Test.cpp',
|
2013-09-20 14:31:45 +00:00
|
|
|
'../tests/MemoryTest.cpp',
|
2012-01-07 03:49:13 +00:00
|
|
|
'../tests/MemsetTest.cpp',
|
2013-10-24 17:44:27 +00:00
|
|
|
'../tests/MessageBusTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/MetaDataTest.cpp',
|
2013-07-18 19:53:31 +00:00
|
|
|
'../tests/MipMapTest.cpp',
|
2013-10-09 16:12:23 +00:00
|
|
|
'../tests/OnceTest.cpp',
|
2013-05-28 16:45:07 +00:00
|
|
|
'../tests/OSPathTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/PackBitsTest.cpp',
|
|
|
|
'../tests/PaintTest.cpp',
|
|
|
|
'../tests/ParsePathTest.cpp',
|
2011-06-24 15:43:24 +00:00
|
|
|
'../tests/PathCoverageTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/PathMeasureTest.cpp',
|
|
|
|
'../tests/PathTest.cpp',
|
2013-07-01 17:50:29 +00:00
|
|
|
'../tests/PathUtilsTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/PDFPrimitivesTest.cpp',
|
2012-09-14 17:26:37 +00:00
|
|
|
'../tests/PictureTest.cpp',
|
2012-07-09 18:32:08 +00:00
|
|
|
'../tests/PictureUtilsTest.cpp',
|
2012-09-14 17:26:37 +00:00
|
|
|
'../tests/PipeTest.cpp',
|
2013-10-24 17:44:27 +00:00
|
|
|
'../tests/PixelRefTest.cpp',
|
2011-06-15 18:49:21 +00:00
|
|
|
'../tests/PointTest.cpp',
|
2012-02-23 15:39:54 +00:00
|
|
|
'../tests/PremulAlphaRoundTripTest.cpp',
|
2011-11-21 15:16:16 +00:00
|
|
|
'../tests/QuickRejectTest.cpp',
|
2013-02-08 17:13:09 +00:00
|
|
|
'../tests/RandomTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/Reader32Test.cpp',
|
2011-11-02 19:57:21 +00:00
|
|
|
'../tests/ReadPixelsTest.cpp',
|
2012-04-30 20:01:21 +00:00
|
|
|
'../tests/ReadWriteAlphaTest.cpp',
|
2012-05-14 14:09:24 +00:00
|
|
|
'../tests/RefCntTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/RefDictTest.cpp',
|
|
|
|
'../tests/RegionTest.cpp',
|
2013-08-08 22:55:21 +00:00
|
|
|
'../tests/ResourceCacheTest.cpp',
|
2012-11-29 13:24:55 +00:00
|
|
|
'../tests/RoundRectTest.cpp',
|
2013-11-06 15:07:44 +00:00
|
|
|
'../tests/RuntimeConfigTest.cpp',
|
2012-09-05 16:10:59 +00:00
|
|
|
'../tests/RTreeTest.cpp',
|
2013-01-31 19:47:48 +00:00
|
|
|
'../tests/SHA1Test.cpp',
|
2011-12-05 20:49:37 +00:00
|
|
|
'../tests/ScalarTest.cpp',
|
Adding size parameter to read array functions
In some cases, the allocated array into which the data will be read is using getArrayCount() to allocate itself, which should be safe, but some cases use fixed length arrays or compute the array size before reading, which could overflow if the stream is compromised.
To prevent that from happening, I added a check that will verify that the number of bytes to read will not exceed the capacity of the input buffer argument passed to all the read...Array() functions.
I chose to use the byte array for this initial version, so that "size" represents the same value across all read...Array() functions, but I could also use the element count, if it is preferred.
Note : readPointArray and writePointArray are unused, so I could also remove them
BUG=
R=reed@google.com, mtklein@google.com, senorblanco@chromium.org
Author: sugoi@chromium.org
Review URL: https://codereview.chromium.org/37803002
git-svn-id: http://skia.googlecode.com/svn/trunk@12058 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-31 18:37:50 +00:00
|
|
|
'../tests/SerializationTest.cpp',
|
2013-02-21 15:02:28 +00:00
|
|
|
'../tests/ShaderImageFilterTest.cpp',
|
2011-12-09 15:48:03 +00:00
|
|
|
'../tests/ShaderOpacityTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/skia_test.cpp',
|
|
|
|
'../tests/SortTest.cpp',
|
|
|
|
'../tests/SrcOverTest.cpp',
|
|
|
|
'../tests/StreamTest.cpp',
|
|
|
|
'../tests/StringTest.cpp',
|
2012-11-20 19:00:28 +00:00
|
|
|
'../tests/StrokeTest.cpp',
|
2013-03-28 13:49:22 +00:00
|
|
|
'../tests/SurfaceTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/Test.cpp',
|
2011-08-16 15:45:58 +00:00
|
|
|
'../tests/Test.h',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/TestSize.cpp',
|
2012-11-07 17:38:38 +00:00
|
|
|
'../tests/TileGridTest.cpp',
|
2012-05-21 15:29:27 +00:00
|
|
|
'../tests/TLSTest.cpp',
|
2013-02-25 20:07:24 +00:00
|
|
|
'../tests/TSetTest.cpp',
|
2011-08-16 15:45:58 +00:00
|
|
|
'../tests/ToUnicode.cpp',
|
2013-09-19 12:08:40 +00:00
|
|
|
'../tests/Typeface.cpp',
|
2011-12-21 15:21:32 +00:00
|
|
|
'../tests/UnicodeTest.cpp',
|
2013-08-14 18:14:37 +00:00
|
|
|
'../tests/UnitTestTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/UtilsTest.cpp',
|
2011-11-11 19:38:54 +00:00
|
|
|
'../tests/WArrayTest.cpp',
|
2011-11-10 20:57:43 +00:00
|
|
|
'../tests/WritePixelsTest.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
'../tests/Writer32Test.cpp',
|
|
|
|
'../tests/XfermodeTest.cpp',
|
2012-08-08 20:43:22 +00:00
|
|
|
|
2013-11-20 21:40:57 +00:00
|
|
|
'../experimental/PdfViewer/src/SkTDStackNester.h',
|
|
|
|
'../tests/TDStackNesterTest.cpp',
|
|
|
|
|
2012-08-08 20:43:22 +00:00
|
|
|
# Needed for PipeTest.
|
|
|
|
'../src/pipe/utils/SamplePipeControllers.cpp',
|
2011-06-02 14:38:23 +00:00
|
|
|
],
|
|
|
|
'dependencies': [
|
2013-06-03 12:10:19 +00:00
|
|
|
'skia_lib.gyp:skia_lib',
|
2013-04-11 16:54:09 +00:00
|
|
|
'flags.gyp:flags',
|
2011-06-09 19:13:41 +00:00
|
|
|
'experimental.gyp:experimental',
|
2011-06-24 19:09:09 +00:00
|
|
|
'pdf.gyp:pdf',
|
2012-07-09 18:32:08 +00:00
|
|
|
'tools.gyp:picture_utils',
|
2011-06-02 14:38:23 +00:00
|
|
|
],
|
2012-08-02 14:03:32 +00:00
|
|
|
'conditions': [
|
|
|
|
[ 'skia_gpu == 1', {
|
|
|
|
'include_dirs': [
|
|
|
|
'../src/gpu',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
],
|
2011-06-02 14:38:23 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|