mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-05 16:55:25 +08:00
qt 6.5.1 original
This commit is contained in:
30
tests/auto/corelib/text/qstring/CMakeLists.txt
Normal file
30
tests/auto/corelib/text/qstring/CMakeLists.txt
Normal file
@ -0,0 +1,30 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
if(NOT QT_FEATURE_doubleconversion AND NOT QT_FEATURE_system_doubleconversion)
|
||||
list(APPEND tst_qstring_extra_defines QT_NO_DOUBLECONVERSION)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
list(APPEND tst_qstring_extra_libraries ${FWFoundation})
|
||||
list(APPEND tst_qstring_extra_sources tst_qstring_mac.mm)
|
||||
endif()
|
||||
|
||||
foreach(test tst_qstring tst_qstring_restricted_ascii)
|
||||
qt_internal_add_test(${test}
|
||||
SOURCES
|
||||
tst_qstring.cpp
|
||||
${tst_qstring_extra_sources}
|
||||
LIBRARIES
|
||||
Qt::CorePrivate
|
||||
${tst_qstring_extra_libraries}
|
||||
DEFINES
|
||||
${tst_qstring_extra_defines}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
qt_internal_extend_target(tst_qstring_restricted_ascii
|
||||
DEFINES
|
||||
QT_RESTRICTED_CAST_FROM_ASCII
|
||||
tst_QString=tst_QString_restricted_ascii
|
||||
)
|
9998
tests/auto/corelib/text/qstring/double_data.h
Normal file
9998
tests/auto/corelib/text/qstring/double_data.h
Normal file
File diff suppressed because it is too large
Load Diff
8354
tests/auto/corelib/text/qstring/tst_qstring.cpp
Normal file
8354
tests/auto/corelib/text/qstring/tst_qstring.cpp
Normal file
File diff suppressed because it is too large
Load Diff
45
tests/auto/corelib/text/qstring/tst_qstring_mac.mm
Normal file
45
tests/auto/corelib/text/qstring/tst_qstring_mac.mm
Normal file
@ -0,0 +1,45 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QTest>
|
||||
|
||||
#include <QtCore/private/qcore_mac_p.h>
|
||||
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <Foundation/Foundation.h>
|
||||
|
||||
void tst_QString_macTypes()
|
||||
{
|
||||
// QString <-> CFString
|
||||
{
|
||||
QString qtString("test string");
|
||||
const CFStringRef cfString = qtString.toCFString();
|
||||
QCOMPARE(QString::fromCFString(cfString), qtString);
|
||||
CFRelease(cfString);
|
||||
}
|
||||
{
|
||||
QString qtString("test string");
|
||||
const CFStringRef cfString = qtString.toCFString();
|
||||
QString qtStringCopy(qtString);
|
||||
qtString = qtString.toUpper(); // modify
|
||||
QCOMPARE(QString::fromCFString(cfString), qtStringCopy);
|
||||
}
|
||||
// QString <-> NSString
|
||||
{
|
||||
QMacAutoReleasePool pool;
|
||||
|
||||
QString qtString("test string");
|
||||
const NSString *nsString = qtString.toNSString();
|
||||
QCOMPARE(QString::fromNSString(nsString), qtString);
|
||||
}
|
||||
{
|
||||
QMacAutoReleasePool pool;
|
||||
|
||||
QString qtString("test string");
|
||||
const NSString *nsString = qtString.toNSString();
|
||||
QString qtStringCopy(qtString);
|
||||
qtString = qtString.toUpper(); // modify
|
||||
QCOMPARE(QString::fromNSString(nsString), qtStringCopy);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user