tst_QChar: run it also under QT_RESTRICTED_CAST_FROM_ASCII
Like QString, QChar also changes API when said macro is defined. So, like tst_QString from 8420d3e0b205d0ef2367224afd3040c68e28bcc9 onwards, also compile tst_QChar under it, separately. Pick-to: 6.5 Change-Id: I81d25d5bfae78b1a11d47e49aa618d079c4b09b7 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 167b04aac89488a5f2005bd1f4dfde354f43c6a6)
This commit is contained in:
parent
b441f9e5bb
commit
e46ba4d413
@ -14,10 +14,20 @@ endif()
|
||||
# Collect test data
|
||||
list(APPEND test_data "data/NormalizationTest.txt")
|
||||
|
||||
qt_internal_add_test(tst_qchar
|
||||
foreach(test tst_qchar tst_qchar_restricted_ascii)
|
||||
qt_internal_add_test(${test}
|
||||
NO_BATCH
|
||||
SOURCES
|
||||
tst_qchar.cpp
|
||||
LIBRARIES
|
||||
Qt::CorePrivate
|
||||
TESTDATA ${test_data}
|
||||
TESTDATA
|
||||
${test_data}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
qt_internal_extend_target(tst_qchar_restricted_ascii
|
||||
DEFINES
|
||||
QT_RESTRICTED_CAST_FROM_ASCII
|
||||
tst_QChar=tst_QChar_restricted_ascii
|
||||
)
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <qfile.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
#include <climits>
|
||||
#include <type_traits>
|
||||
|
||||
template <typename C>
|
||||
@ -33,7 +34,11 @@ static_assert(explicitly<char32_t>);
|
||||
//
|
||||
// Conversion from others
|
||||
//
|
||||
#if defined(QT_RESTRICTED_CAST_FROM_ASCII)
|
||||
static_assert(explicitly<uchar>); // via integer promotion
|
||||
#else
|
||||
static_assert(explicitly<uchar>);
|
||||
#endif
|
||||
static_assert(implicitly<short>);
|
||||
static_assert(implicitly<ushort>);
|
||||
static_assert(explicitly<int>);
|
||||
|
Loading…
x
Reference in New Issue
Block a user