[poppler] 2 commits - INSTALL qt5/tests

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Dec 2 09:33:55 UTC 2017


 INSTALL                            |   38 ++++++++++++++++++++++++++++++++-----
 qt5/tests/check_utf_conversion.cpp |   13 +++++++-----
 2 files changed, 41 insertions(+), 10 deletions(-)

New commits:
commit f007ab6beb2616850488271da5162f4ef0dbe789
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sat Dec 2 14:13:50 2017 +1030

    INSTALL: add debug options
    
    also ensure cmake commands are lowercase to be consistent with our
    code style.

diff --git a/INSTALL b/INSTALL
index 7b5d6585..a38a8c00 100644
--- a/INSTALL
+++ b/INSTALL
@@ -65,12 +65,40 @@ tools. Run cmake with the option:
 A sample toolchain for a 64-bit mingw build is shown below. Replace
 /path/to/win/root with the install prefix for the target environment.
 
-  SET(CMAKE_SYSTEM_NAME Windows)
-  SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
-  SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
-  SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
-  SET(CMAKE_FIND_ROOT_PATH  /usr/x86_64-w64-mingw32 /path/to/win/root )
+  set(CMAKE_SYSTEM_NAME Windows)
+  set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
+  set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
+  set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
+  set(CMAKE_FIND_ROOT_PATH  /usr/x86_64-w64-mingw32 /path/to/win/root )
   set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
   set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
   set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 
+
+Debugging Options
+=================
+
+Debug Build Types
+-----------------
+Release build with debugging information:
+  -DCMAKE_BUILD_TYPE=relwithdebinfo
+
+Debug build with optimization except for some code re-ordering optimizations:
+  -DCMAKE_BUILD_TYPE=debug
+
+Debug build with no optimization:
+  -DCMAKE_BUILD_TYPE=debugfull
+
+Release build with debugging and profiling information:
+  -DCMAKE_BUILD_TYPE=profile
+
+
+Address Sanitizer
+-----------------
+Ensure the extra cmake modules are available (may be a separate
+package) then use -DECM_ENABLE_SANITIZERS to specify the santizers. eg
+
+  -DECM_ENABLE_SANITIZERS='address;leak;undefined'
+
+Some options may only be available with clang. Use
+-DCMAKE_CXX_COMPILER=clang++ to build with clang.
commit cef42ac807f4da7ae91be1b6b81b50adb9684975
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sat Dec 2 14:01:42 2017 +1030

    Fix UTF test fail
    
    The buffer size was not large enough. Increase it and add an assert to
    check the buffer size.

diff --git a/qt5/tests/check_utf_conversion.cpp b/qt5/tests/check_utf_conversion.cpp
index b8eb03a5..d344434d 100644
--- a/qt5/tests/check_utf_conversion.cpp
+++ b/qt5/tests/check_utf_conversion.cpp
@@ -46,9 +46,9 @@ void TestUTFConversion::testUTF_data()
 
 void TestUTFConversion::testUTF()
 {
-    char utf8Buf[100];
+    char utf8Buf[1000];
     char *utf8String;
-    uint16_t utf16Buf[100];
+    uint16_t utf16Buf[1000];
     uint16_t *utf16String;
     int len;
 
@@ -57,8 +57,9 @@ void TestUTFConversion::testUTF()
 
     // UTF-8 to UTF-16
 
-    // QString size() returns number of code units, not code points
-    QCOMPARE( utf8CountUtf16CodeUnits(str), s.size() );
+    len = utf8CountUtf16CodeUnits(str);
+    QCOMPARE( len, s.size() ); // QString size() returns number of code units, not code points
+    Q_ASSERT( len < (int)sizeof(utf16Buf) ); // if this fails, make utf16Buf larger
 
     len = utf8ToUtf16(str, utf16Buf);
     QVERIFY( compare(utf16Buf, s.utf16()) );
@@ -70,7 +71,9 @@ void TestUTFConversion::testUTF()
 
     // UTF-16 to UTF-8
 
-    QCOMPARE( utf16CountUtf8Bytes(s.utf16()), (int)strlen(str) );
+    len = utf16CountUtf8Bytes(s.utf16());
+    QCOMPARE( len, (int)strlen(str) );
+    Q_ASSERT( len < (int)sizeof(utf8Buf) ); // if this fails, make utf8Buf larger
 
     len = utf16ToUtf8(s.utf16(), utf8Buf);
     QVERIFY( compare(utf8Buf, str) );


More information about the poppler mailing list