diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-04-07 11:45:13 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-04-07 14:13:18 +0200 |
commit | d36f7c5bd2115fcdd26ba8ff7b6a0446dea70bd4 (patch) | |
tree | 5ae4b15f3302a538ac55d714ba0529ca4c1de87a /vcl/qa | |
parent | 61d57bcebd1a246603cbcd9ad5e0a7df1a8d66cd (diff) |
Revert "long->sal_Int32 in tools/gen.hxx"
This reverts commit 8bc951daf79decbd8a599a409c6d33c5456710e0.
As discussed at
<https://lists.freedesktop.org/archives/libreoffice/2018-April/079955.html>
"long->sal_Int32 in tools/gen.hxx", that commit caused lots of problems with
signed integer overflow, and the original plan was to redo it to consistently
use sal_Int64 instead of sal_Int32. <https://gerrit.libreoffice.org/#/c/52471/>
"sal_Int32->sal_Int64 in tools/gen.hxx" tried that. However, it failed
miserably on Windows, causing odd failures like not writing out Pictures/*.svm
streams out into .odp during CppunitTest_sd_export_ooxml2. So the next best
approach is to just revert the original commit, at least for now.
Includes revert of follow-up 8c50aff2175e85c54957d98ce32af40a3a87e168 "Fix
Library_vclplug_qt5".
Change-Id: Ia8bf34272d1ed38aac00e5d07a9d13fb03f439ae
Reviewed-on: https://gerrit.libreoffice.org/52532
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/BitmapTest.cxx | 36 | ||||
-rw-r--r-- | vcl/qa/cppunit/graphicfilter/filters-test.cxx | 6 | ||||
-rw-r--r-- | vcl/qa/cppunit/jpeg/JpegReaderTest.cxx | 12 |
3 files changed, 27 insertions, 27 deletions
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx index c92d1753c6ff..f835c7b78bc3 100644 --- a/vcl/qa/cppunit/BitmapTest.cxx +++ b/vcl/qa/cppunit/BitmapTest.cxx @@ -61,8 +61,8 @@ void BitmapTest::testCreation() { Bitmap aBmp; Size aSize = aBmp.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(0), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(0), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(0), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(0), aSize.Height()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize()); CPPUNIT_ASSERT_MESSAGE("Not empty", aBmp.IsEmpty()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(0), @@ -76,8 +76,8 @@ void BitmapTest::testCreation() { Bitmap aBmp(Size(10, 10), 1); Size aSize = aBmp.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize()); CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(1), @@ -91,8 +91,8 @@ void BitmapTest::testCreation() { Bitmap aBmp(Size(10, 10), 4); Size aSize = aBmp.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize()); CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(4), @@ -106,8 +106,8 @@ void BitmapTest::testCreation() { Bitmap aBmp(Size(10, 10), 8); Size aSize = aBmp.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize()); CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(8), @@ -121,8 +121,8 @@ void BitmapTest::testCreation() { Bitmap aBmp(Size(10, 10), 16); Size aSize = aBmp.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize()); CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(24), @@ -136,8 +136,8 @@ void BitmapTest::testCreation() { Bitmap aBmp(Size(10, 10), 24); Size aSize = aBmp.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize()); CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(24), @@ -151,8 +151,8 @@ void BitmapTest::testCreation() { Bitmap aBmp(Size(10, 10), 32); Size aSize = aBmp.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize()); CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(24), @@ -407,8 +407,8 @@ void BitmapTest::testScale() BitmapSymmetryCheck aBitmapSymmetryCheck; - CPPUNIT_ASSERT_EQUAL(sal_Int32(10), aBitmap24Bit.GetSizePixel().Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(10), aBitmap24Bit.GetSizePixel().Height()); + CPPUNIT_ASSERT_EQUAL(static_cast<long>(10), aBitmap24Bit.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(static_cast<long>(10), aBitmap24Bit.GetSizePixel().Height()); // Check symmetry of the bitmap CPPUNIT_ASSERT(BitmapSymmetryCheck::check(aBitmap24Bit)); @@ -422,8 +422,8 @@ void BitmapTest::testScale() aBitmap24Bit.Scale(2, 2, BmpScaleFlag::Fast); - CPPUNIT_ASSERT_EQUAL(sal_Int32(20), aBitmap24Bit.GetSizePixel().Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(20), aBitmap24Bit.GetSizePixel().Height()); + CPPUNIT_ASSERT_EQUAL(static_cast<long>(20), aBitmap24Bit.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(static_cast<long>(20), aBitmap24Bit.GetSizePixel().Height()); // After scaling the bitmap should still be symmetrical. This check guarantees that // scaling doesn't misalign the bitmap. diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx index 9399dd43f339..a423a17081e8 100644 --- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx +++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx @@ -95,7 +95,7 @@ void VclFiltersTest::testScaling() fprintf( stderr, "scale with type %d\n", int( i ) ); CPPUNIT_ASSERT( aBitmapEx.Scale( 0.1937046, 0.193154, i ) ); Size aAfter( aBitmapEx.GetSizePixel() ); - fprintf( stderr, "size %" SAL_PRIdINT32 ", %" SAL_PRIdINT32 "\n", aAfter.Width(), aAfter.Height() ); + fprintf( stderr, "size %ld, %ld\n", aAfter.Width(), aAfter.Height() ); CPPUNIT_ASSERT( labs (aAfter.Height() - aAfter.Width()) <= 1 ); } } @@ -129,8 +129,8 @@ void VclFiltersTest::checkExportImport(const OUString& aFilterShortName) BitmapEx aLoadedBitmapEx = aLoadedGraphic.GetBitmapEx(); Size aSize = aLoadedBitmapEx.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(100), aSize.Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(100), aSize.Height()); + CPPUNIT_ASSERT_EQUAL(100L, aSize.Width()); + CPPUNIT_ASSERT_EQUAL(100L, aSize.Height()); } void VclFiltersTest::testExportImport() diff --git a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx index 7727a13c18ad..4cae79645bd6 100644 --- a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx +++ b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx @@ -106,8 +106,8 @@ void JpegReaderTest::testReadRGB() { Bitmap aBitmap = loadJPG(getFullUrl("JPEGTestRGB.jpeg")); Size aSize = aBitmap.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Height()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Width()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Height()); int nMaxDelta = 1; // still acceptable color error CPPUNIT_ASSERT(checkRect(aBitmap, 0, 8, 8, Color(0xff, 0xff, 0xff), nMaxDelta)); @@ -120,8 +120,8 @@ void JpegReaderTest::testReadGray() { Bitmap aBitmap = loadJPG(getFullUrl("JPEGTestGray.jpeg")); Size aSize = aBitmap.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Height()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Width()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Height()); aBitmap.Convert(BmpConversion::N24Bit); // convert to 24bit so we don't need to deal with palette @@ -136,8 +136,8 @@ void JpegReaderTest::testReadCMYK() { Bitmap aBitmap = loadJPG(getFullUrl("JPEGTestCMYK.jpeg")); Size aSize = aBitmap.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Height()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Width()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Height()); int maxDelta = 1; CPPUNIT_ASSERT(checkRect(aBitmap, 0, 8, 8, Color(0xff, 0xff, 0xff), maxDelta)); |