Import Upstream version 5.92.0
This commit is contained in:
commit
a64293c16f
|
@ -0,0 +1,28 @@
|
|||
# Ignore the following files
|
||||
*~
|
||||
*.[oa]
|
||||
*.diff
|
||||
*.kate-swp
|
||||
*.kdev4
|
||||
.kdev_include_paths
|
||||
*.kdevelop.pcs
|
||||
*.moc
|
||||
*.moc.cpp
|
||||
*.orig
|
||||
*.user
|
||||
.*.swp
|
||||
.swp.*
|
||||
Doxyfile
|
||||
Makefile
|
||||
avail
|
||||
random_seed
|
||||
/build*/
|
||||
CMakeLists.txt.user*
|
||||
*.unc-backup*
|
||||
.cmake/
|
||||
/.clang-format
|
||||
/compile_commands.json
|
||||
.clangd
|
||||
.idea
|
||||
/cmake-build*
|
||||
.cache
|
|
@ -0,0 +1,6 @@
|
|||
# SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
include:
|
||||
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml
|
||||
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd.yml
|
|
@ -0,0 +1,36 @@
|
|||
Dependencies:
|
||||
- 'on': ['Linux', 'FreeBSD', 'Windows', 'macOS']
|
||||
'require':
|
||||
'frameworks/extra-cmake-modules': '@same'
|
||||
'frameworks/ki18n' : '@same'
|
||||
'frameworks/kguiaddons' : '@same'
|
||||
'frameworks/kwidgetsaddons' : '@same'
|
||||
'frameworks/kdbusaddons' : '@same'
|
||||
'frameworks/kconfig' : '@same'
|
||||
'frameworks/kconfigwidgets' : '@same'
|
||||
'frameworks/kitemviews' : '@same'
|
||||
'frameworks/kiconthemes' : '@same'
|
||||
'frameworks/kunitconversion' : '@same'
|
||||
'frameworks/kwindowsystem' : '@same'
|
||||
'frameworks/kservice' : '@same'
|
||||
'frameworks/kcompletion' : '@same'
|
||||
'frameworks/ktextwidgets' : '@same'
|
||||
'frameworks/kxmlgui' : '@same'
|
||||
'frameworks/kbookmarks' : '@same'
|
||||
'frameworks/kio' : '@same'
|
||||
'frameworks/kded' : '@same'
|
||||
'frameworks/kinit' : '@same'
|
||||
'frameworks/kdoctools' : '@same'
|
||||
'frameworks/kemoticons' : '@same'
|
||||
'frameworks/kcrash' : '@same'
|
||||
'frameworks/knotifications' : '@same'
|
||||
'frameworks/kparts' : '@same'
|
||||
'frameworks/kdesignerplugin' : '@same'
|
||||
'frameworks/kglobalaccel' : '@same'
|
||||
'frameworks/kitemmodels' : '@same'
|
||||
'frameworks/kauth' : '@same'
|
||||
'third-party/taglib' : '@same'
|
||||
'kdesupport/polkit-qt-1' : '@same'
|
||||
|
||||
Options:
|
||||
test-before-installing: True
|
|
@ -0,0 +1,227 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
set(KF_VERSION "5.92.0") # handled by release scripts
|
||||
set(KF_DEP_VERSION "5.92.0") # handled by release scripts
|
||||
project(KDELibs4Support VERSION ${KF_VERSION})
|
||||
|
||||
include(FeatureSummary)
|
||||
find_package(ECM 5.92.0 NO_MODULE)
|
||||
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
|
||||
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||
|
||||
|
||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules )
|
||||
|
||||
include(KDEInstallDirs)
|
||||
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
|
||||
include(KDECMakeSettings)
|
||||
|
||||
include(GenerateExportHeader)
|
||||
include(CMakeFindFrameworks)
|
||||
|
||||
set(REQUIRED_QT_VERSION 5.15.2)
|
||||
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Network Widgets DBus Test Svg PrintSupport Designer)
|
||||
|
||||
find_package(KF5Completion ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5Config ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5ConfigWidgets ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5Crash ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5DesignerPlugin ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5GlobalAccel ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5DocTools ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5Emoticons ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5GuiAddons ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5I18n ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5IconThemes ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5KIO ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5Notifications ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5Parts ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5Service ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5TextWidgets ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5UnitConversion ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5WidgetsAddons ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5WindowSystem ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5XmlGui ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5DBusAddons ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KDED ${KF_DEP_VERSION} REQUIRED)
|
||||
find_package(KF5Auth ${KF_DEP_VERSION} REQUIRED)
|
||||
|
||||
if(WIN32)
|
||||
find_package(KDEWin REQUIRED)
|
||||
endif()
|
||||
|
||||
if (NOT APPLE AND NOT WIN32)
|
||||
find_package(X11)
|
||||
endif()
|
||||
set(HAVE_X11 ${X11_FOUND})
|
||||
if (HAVE_X11)
|
||||
add_feature_info("X11 Session Management (libSM)" X11_SM_FOUND "Support for session management in KApplication")
|
||||
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED X11Extras)
|
||||
find_package(XCB REQUIRED COMPONENTS XCB)
|
||||
endif ()
|
||||
if (APPLE)
|
||||
cmake_find_frameworks(CoreFoundation)
|
||||
endif ()
|
||||
|
||||
include(ECMSetupVersion)
|
||||
include(ECMMarkNonGuiExecutable)
|
||||
|
||||
ecm_setup_version(PROJECT VARIABLE_PREFIX KDELIBS4SUPPORT
|
||||
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kdelibs4support_version.h"
|
||||
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KDELibs4SupportConfigVersion.cmake"
|
||||
SOVERSION 5)
|
||||
|
||||
# Remove default warning version from KDEFrameworkCompilerSettings, too much noise
|
||||
# instead avoid any deprecation warnings (to what Qt respects its own flag)
|
||||
# Setting QT_DISABLE_DEPRECATED_BEFORE & KF_DISABLE_DEPRECATED_BEFORE_AND_AT as below
|
||||
# defaults those DEPRECATED_WARNINGS_SINCE to the same version -> no warnings
|
||||
remove_definitions(
|
||||
-DQT_DEPRECATED_WARNINGS_SINCE=0x060000
|
||||
-DKF_DEPRECATED_WARNINGS_SINCE=0x060000
|
||||
)
|
||||
# remove definitions set by KDEFrameworkCompilerSettings which we fail to meet
|
||||
remove_definitions(-DQT_NO_KEYWORDS)
|
||||
remove_definitions(-DQT_NO_FOREACH)
|
||||
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
|
||||
remove_definitions(-DQT_NO_CAST_FROM_BYTEARRAY)
|
||||
remove_definitions(-DQT_USE_QSTRINGBUILDER)
|
||||
# TODO: use QT_USE_QSTRINGBUILDER instead of deprecated & undocumented QT_USE_FAST_OPERATOR_PLUS
|
||||
add_definitions(-DQT_USE_FAST_OPERATOR_PLUS)
|
||||
# ideally we would support QT_NO_KEYWORDS, but at least we can do this
|
||||
add_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS)
|
||||
|
||||
# QUrl
|
||||
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
|
||||
|
||||
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0)
|
||||
|
||||
# This one won't be needed when CMake 2.8.13 is depended on.
|
||||
add_definitions(
|
||||
-DKDELIBS4SUPPORT_DEPRECATED= # if KDELIBS4SUPPORT_DEPRECATED is already defined the other deprecated macros won't be defined
|
||||
-DKDELIBS4SUPPORT_DEPRECATED_NO_EXPORT=KDELIBS4SUPPORT_NO_EXPORT
|
||||
-DKDELIBS4SUPPORT_DEPRECATED_EXPORT=KDELIBS4SUPPORT_EXPORT
|
||||
)
|
||||
|
||||
add_definitions(-DTRANSLATION_DOMAIN=\"kdelibs4support\")
|
||||
|
||||
add_executable(kf5-config kde-config.cpp )
|
||||
ecm_mark_nongui_executable(kf5-config)
|
||||
|
||||
target_link_libraries(kf5-config KF5::CoreAddons KF5::I18n KF5::ConfigCore KF5::KDELibs4Support)
|
||||
target_include_directories(kf5-config PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../..")
|
||||
|
||||
install(TARGETS kf5-config ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
||||
|
||||
# create a Config.cmake and a ConfigVersion.cmake file and install them
|
||||
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5KDELibs4Support")
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
configure_package_config_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/KF5KDELibs4SupportConfig.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/KF5KDELibs4SupportConfig.cmake"
|
||||
PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR
|
||||
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
|
||||
)
|
||||
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KF5KDELibs4SupportConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/KF5KDELibs4SupportConfigVersion.cmake"
|
||||
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
|
||||
COMPONENT Devel)
|
||||
|
||||
install(EXPORT KF5KDELibs4SupportTargets
|
||||
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
|
||||
FILE KF5KDELibs4SupportTargets.cmake
|
||||
NAMESPACE KF5::)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kdelibs4support_version.h
|
||||
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KDELibs4Support
|
||||
COMPONENT Devel)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Compatibility file
|
||||
#
|
||||
set(CMAKECONFIG_COMPAT_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5KDE4Support")
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(KDELibs4Support_LIB_TYPE SHARED)
|
||||
else()
|
||||
set(KDELibs4Support_LIB_TYPE STATIC)
|
||||
endif()
|
||||
configure_package_config_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/KF5KDE4SupportConfig.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/KF5KDE4SupportConfig.cmake"
|
||||
INSTALL_DESTINATION "${CMAKECONFIG_COMPAT_INSTALL_DIR}"
|
||||
)
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/KF5KDE4SupportConfigVersion.cmake"
|
||||
VERSION ${KF_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion
|
||||
)
|
||||
install(
|
||||
FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/KF5KDE4SupportConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/KF5KDE4SupportConfigVersion.cmake"
|
||||
DESTINATION "${CMAKECONFIG_COMPAT_INSTALL_DIR}"
|
||||
COMPONENT Devel
|
||||
)
|
||||
|
||||
|
||||
|
||||
ki18n_install(po)
|
||||
kdoctools_install(po)
|
||||
add_subdirectory(cmake)
|
||||
add_subdirectory(data)
|
||||
add_subdirectory(docs)
|
||||
add_subdirectory(src)
|
||||
|
||||
if (BUILD_TESTING)
|
||||
add_subdirectory(autotests)
|
||||
add_subdirectory(tests)
|
||||
endif ()
|
||||
|
||||
|
||||
set (KDE_VERSION_MAJOR 4)
|
||||
set (KDE_VERSION_MINOR 90)
|
||||
set (KDE_VERSION_RELEASE 00)
|
||||
set (KDE_VERSION "${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}.${KDE_VERSION_RELEASE}" )
|
||||
# For git master, use this:
|
||||
set (KDE_VERSION_STRING "${KDE_VERSION} (KDE Frameworks >= 20121130)")
|
||||
# For a stable release, use this:
|
||||
#set (KDE_VERSION_STRING "${KDE_VERSION}")
|
||||
|
||||
include(CreateKDELibsDependenciesFile.cmake)
|
||||
set(CMAKECONFIG_INSTALL_DIR ${KDE_INSTALL_LIBDIR}/cmake/KDELibs4)
|
||||
|
||||
# Used in configure_file() and install(EXPORT)
|
||||
set(KDE4_TARGET_PREFIX KDE4__)
|
||||
|
||||
################# install files #################
|
||||
|
||||
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/KDELibsDependencies.cmake
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/kde4_cmake_uninstall.cmake.in
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/Win32.Manifest.in
|
||||
DESTINATION ${CMAKECONFIG_INSTALL_DIR} COMPONENT Devel)
|
||||
|
||||
# run a script before installing the exports files which deletes previously installed
|
||||
# configuration specific export files KDELibs4(Library|Tools)Targets-<config>.cmake
|
||||
# if the main exports file KDELibs4(Library|Tools)Targets.cmake has changed. This makes sure
|
||||
# that this main file doesn't include older and different configuration specific exports files,
|
||||
# which might have a different set of targets or targets with different names.
|
||||
# The code for installing the exports files will soon go into a macro. Alex
|
||||
install(CODE "set(EXPORT_FILES KDELibs4LibraryTargets.cmake)"
|
||||
CODE "set(EXPORT_INSTALL_DIR \"${CMAKECONFIG_INSTALL_DIR}\")"
|
||||
SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/check_installed_exports_file.cmake" )
|
||||
install(EXPORT KF5KDELibs4SupportTargets
|
||||
DESTINATION ${CMAKECONFIG_INSTALL_DIR}
|
||||
NAMESPACE ${KDE4_TARGET_PREFIX}
|
||||
FILE KF5KDELibs4LibraryTargets.cmake
|
||||
COMPONENT Devel)
|
||||
|
||||
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||
|
||||
if (HAVE_X11 AND NOT X11_SM_FOUND)
|
||||
message(FATAL_ERROR "The X11 Session Management library (libSM) is required when building on X11.")
|
||||
endif()
|
|
@ -0,0 +1,346 @@
|
|||
NOTE! The GPL below is copyrighted by the Free Software Foundation, but
|
||||
the instance of code that it refers to (the kde programs) are copyrighted
|
||||
by the authors who actually wrote it.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
|
@ -0,0 +1,510 @@
|
|||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations
|
||||
below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it
|
||||
becomes a de-facto standard. To achieve this, non-free programs must
|
||||
be allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control
|
||||
compilation and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at least
|
||||
three years, to give the same user the materials specified in
|
||||
Subsection 6a, above, for a charge no more than the cost of
|
||||
performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply, and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License
|
||||
may add an explicit geographical distribution limitation excluding those
|
||||
countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms
|
||||
of the ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library.
|
||||
It is safest to attach them to the start of each source file to most
|
||||
effectively convey the exclusion of warranty; and each file should
|
||||
have at least the "copyright" line and a pointer to where the full
|
||||
notice is found.
|
||||
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or
|
||||
your school, if any, to sign a "copyright disclaimer" for the library,
|
||||
if necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James
|
||||
Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
# this file is included by kdelibs/CMakeLists.txt and contains the cmake code
|
||||
# which creates the KDELibsDepencies.cmake file, which is installed by kdelibs
|
||||
|
||||
######## write dependency file which will be installed #########
|
||||
|
||||
# write versions
|
||||
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/KDELibsDependencies.cmake
|
||||
"# this file was generated during the kdelibs build process
|
||||
set(KDE_VERSION_MAJOR ${KDE_VERSION_MAJOR})
|
||||
set(KDE_VERSION_MINOR ${KDE_VERSION_MINOR})
|
||||
set(KDE_VERSION_RELEASE ${KDE_VERSION_RELEASE})
|
||||
set(KDE_VERSION \"${KDE_VERSION}\")
|
||||
set(KDE_VERSION_STRING \"${KDE_VERSION_STRING}\")
|
||||
set(KDE_DEFAULT_HOME \"${KDE_DEFAULT_HOME}\")
|
||||
")
|
||||
|
||||
# write installdirs
|
||||
|
||||
# we need the absolute directories where stuff will be installed too
|
||||
# but since the variables which contain the destinations can be relative
|
||||
# or absolute paths, we need this macro to make them all absolute, Alex
|
||||
macro(MAKE_INSTALL_PATH_ABSOLUTE out in)
|
||||
if (IS_ABSOLUTE "${in}") # IS_ABSOLUTE is new since cmake 2.4.8
|
||||
set(${out} "${in}")
|
||||
else (IS_ABSOLUTE "${in}")
|
||||
set(${out} "\${KDE4_INSTALL_DIR}/${in}")
|
||||
endif (IS_ABSOLUTE "${in}")
|
||||
endmacro(MAKE_INSTALL_PATH_ABSOLUTE out in)
|
||||
|
||||
set(KDE4_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}")
|
||||
make_install_path_absolute(KDE4_LIB_INSTALL_DIR ${LIB_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_IMPORTS_INSTALL_DIR ${IMPORTS_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_LIBEXEC_INSTALL_DIR ${LIBEXEC_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_BIN_INSTALL_DIR ${BIN_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_SBIN_INSTALL_DIR ${SBIN_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_DATA_INSTALL_DIR ${DATA_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_HTML_INSTALL_DIR ${HTML_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_CONFIG_INSTALL_DIR ${CONFIG_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_ICON_INSTALL_DIR ${ICON_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_KCFG_INSTALL_DIR ${KCFG_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_LOCALE_INSTALL_DIR ${LOCALE_INSTALL_DIR})
|
||||
#make_install_path_absolute(KDE4_MIME_INSTALL_DIR ${MIME_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_SOUND_INSTALL_DIR ${SOUND_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_TEMPLATES_INSTALL_DIR ${TEMPLATES_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_WALLPAPER_INSTALL_DIR ${WALLPAPER_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_KCONF_UPDATE_INSTALL_DIR ${KCONF_UPDATE_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_AUTOSTART_INSTALL_DIR ${AUTOSTART_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_XDG_APPS_INSTALL_DIR ${XDG_APPS_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_XDG_DIRECTORY_INSTALL_DIR ${XDG_DIRECTORY_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_SYSCONF_INSTALL_DIR ${SYSCONF_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_MAN_INSTALL_DIR ${MAN_INSTALL_DIR})
|
||||
#make_install_path_absolute(KDE4_INFO_INSTALL_DIR ${INFO_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_DBUS_INTERFACES_DIR ${DBUS_INTERFACES_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_DBUS_SERVICES_DIR ${DBUS_SERVICES_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_SERVICES_INSTALL_DIR ${SERVICES_INSTALL_DIR})
|
||||
make_install_path_absolute(KDE4_SERVICETYPES_INSTALL_DIR ${SERVICETYPES_INSTALL_DIR})
|
||||
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/KDELibsDependencies.cmake "
|
||||
if (NOT KDE4_INSTALL_DIR)
|
||||
set(KDE4_INSTALL_DIR \"${CMAKE_INSTALL_PREFIX}\")
|
||||
endif (NOT KDE4_INSTALL_DIR)
|
||||
|
||||
set(KDE4_LIB_INSTALL_DIR \"${KDE4_LIB_INSTALL_DIR}\")
|
||||
set(KDE4_IMPORTS_INSTALL_DIR \"${KDE4_IMPORTS_INSTALL_DIR}\")
|
||||
set(KDE4_LIBEXEC_INSTALL_DIR \"${KDE4_LIBEXEC_INSTALL_DIR}\")
|
||||
set(KDE4_INCLUDE_INSTALL_DIR \"${KDE4_INCLUDE_INSTALL_DIR}\")
|
||||
set(KDE4_BIN_INSTALL_DIR \"${KDE4_BIN_INSTALL_DIR}\")
|
||||
set(KDE4_SBIN_INSTALL_DIR \"${KDE4_SBIN_INSTALL_DIR}\")
|
||||
set(KDE4_DATA_INSTALL_DIR \"${KDE4_DATA_INSTALL_DIR}\")
|
||||
set(KDE4_HTML_INSTALL_DIR \"${KDE4_HTML_INSTALL_DIR}\")
|
||||
set(KDE4_CONFIG_INSTALL_DIR \"${KDE4_CONFIG_INSTALL_DIR}\")
|
||||
set(KDE4_ICON_INSTALL_DIR \"${KDE4_ICON_INSTALL_DIR}\")
|
||||
set(KDE4_KCFG_INSTALL_DIR \"${KDE4_KCFG_INSTALL_DIR}\")
|
||||
set(KDE4_LOCALE_INSTALL_DIR \"${KDE4_LOCALE_INSTALL_DIR}\")
|
||||
set(KDE4_SOUND_INSTALL_DIR \"${KDE4_SOUND_INSTALL_DIR}\")
|
||||
set(KDE4_TEMPLATES_INSTALL_DIR \"${KDE4_TEMPLATES_INSTALL_DIR}\")
|
||||
set(KDE4_WALLPAPER_INSTALL_DIR \"${KDE4_WALLPAPER_INSTALL_DIR}\")
|
||||
set(KDE4_KCONF_UPDATE_INSTALL_DIR \"${KDE4_KCONF_UPDATE_INSTALL_DIR}\")
|
||||
set(KDE4_AUTOSTART_INSTALL_DIR \"${KDE4_AUTOSTART_INSTALL_DIR}\")
|
||||
set(KDE4_XDG_APPS_INSTALL_DIR \"${KDE4_XDG_APPS_INSTALL_DIR}\")
|
||||
set(KDE4_XDG_DIRECTORY_INSTALL_DIR \"${KDE4_XDG_DIRECTORY_INSTALL_DIR}\")
|
||||
set(KDE4_SYSCONF_INSTALL_DIR \"${KDE4_SYSCONF_INSTALL_DIR}\")
|
||||
set(KDE4_MAN_INSTALL_DIR \"${KDE4_MAN_INSTALL_DIR}\")
|
||||
set(KDE4_DBUS_INTERFACES_DIR \"${KDE4_DBUS_INTERFACES_DIR}\")
|
||||
set(KDE4_DBUS_SERVICES_DIR \"${KDE4_DBUS_SERVICES_DIR}\")
|
||||
set(KDE4_SERVICES_INSTALL_DIR \"${KDE4_SERVICES_INSTALL_DIR}\")
|
||||
set(KDE4_SERVICETYPES_INSTALL_DIR \"${KDE4_SERVICETYPES_INSTALL_DIR}\")
|
||||
|
||||
set(KDE4_TARGET_PREFIX ${KDE4_TARGET_PREFIX} )
|
||||
|
||||
")
|
||||
|
||||
|
||||
# write library dependencies
|
||||
|
||||
if (WIN32)
|
||||
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/KDELibsDependencies.cmake"
|
||||
"if (NOT QT_INSTALL_DIR)
|
||||
set (QT_INSTALL_DIR \"${QT_INSTALL_DIR}\")
|
||||
endif (NOT QT_INSTALL_DIR)
|
||||
")
|
||||
# replace hard coded paths by variables
|
||||
# !!! the following stuff does not work because export_library_dependencies
|
||||
# !!! does not wait until the file is written completely
|
||||
# export_library_dependencies(${CMAKE_BINARY_DIR}/tmpdeps.cmake)
|
||||
# file(READ ${CMAKE_BINARY_DIR}/tmpdeps.cmake _deps)
|
||||
# string(REPLACE "${QT_INSTALL_DIR}" "\${QT_INSTALL_DIR}" __deps "${_deps}")
|
||||
# file (APPEND ${CMAKE_BINARY_DIR}/KDELibsDependencies.cmake "${__deps}")
|
||||
endif(WIN32)
|
||||
|
||||
# This variable defines whether KPty::login/logout have been built with
|
||||
# utempter support so that they don't require special user permissions
|
||||
# in order to work properly. Used by kwrited.
|
||||
if(HAVE_UTEMPTER)
|
||||
set(KDE4_KPTY_BUILT_WITH_UTEMPTER 1)
|
||||
else()
|
||||
set(KDE4_KPTY_BUILT_WITH_UTEMPTER 0)
|
||||
endif()
|
||||
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/KDELibsDependencies.cmake" "set(KDE4_KPTY_BUILT_WITH_UTEMPTER ${KDE4_KPTY_BUILT_WITH_UTEMPTER})")
|
||||
|
||||
# Append stuff needed by the KAuth framework
|
||||
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/KDELibsDependencies.cmake" "
|
||||
|
||||
set(KDE4_AUTH_BACKEND_NAME \"${KAUTH_BACKEND_NAME}\")
|
||||
set(KDE4_AUTH_HELPER_BACKEND_NAME \"${KAUTH_HELPER_BACKEND_NAME}\")
|
||||
set(KDE4_AUTH_POLICY_FILES_INSTALL_DIR \"${KAUTH_POLICY_FILES_INSTALL_DIR}\" CACHE STRING \"The location where policy files generated by KAuth will be installed, if the installed backend needs to\")
|
||||
")
|
|
@ -0,0 +1,34 @@
|
|||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(KF5KDELibs4Support "@KF_VERSION@")
|
||||
|
||||
if(NOT TARGET KF5::KDE4Support)
|
||||
add_library(KF5::KDE4Support @KDELibs4Support_LIB_TYPE@ IMPORTED)
|
||||
|
||||
# Because CMake won't let us alias an imported target, we have to
|
||||
# create a new imported target and copy the properties we care about
|
||||
set(_copy_props
|
||||
INTERFACE_INCLUDE_DIRECTORIES
|
||||
INTERFACE_LINK_LIBRARIES
|
||||
IMPORTED_CONFIGURATIONS
|
||||
)
|
||||
get_target_property(_configs KF5::KDELibs4Support IMPORTED_CONFIGURATIONS)
|
||||
foreach(_config ${_configs})
|
||||
set(_copy_props
|
||||
${_copy_props}
|
||||
IMPORTED_LINK_DEPENDENT_LIBRARIES_${_config}
|
||||
IMPORTED_LOCATION_${_config}
|
||||
IMPORTED_SONAME_${_config}
|
||||
)
|
||||
endforeach()
|
||||
foreach(_prop ${_copy_props})
|
||||
get_target_property(_temp_prop KF5::KDELibs4Support "${_prop}")
|
||||
set_target_properties(KF5::KDE4Support PROPERTIES "${_prop}" "${_temp_prop}")
|
||||
endforeach()
|
||||
|
||||
message(AUTHOR_WARNING
|
||||
" The KF5KDE4Support package is deprecated: use
|
||||
find_package(KF5KDELibs4Support) or
|
||||
find_package(KF5 COMPONENTS KDELibs4Support) instead.")
|
||||
endif()
|
|
@ -0,0 +1,102 @@
|
|||
@PACKAGE_INIT@
|
||||
|
||||
# This needs to be set before finding dependencies, since it uses
|
||||
# PACKAGE_PREFIX_DIR, which may be overwritten by the config files
|
||||
# of other packages.
|
||||
set(KDE4_DBUS_INTERFACES_DIR "@PACKAGE_KDE_INSTALL_DBUSINTERFACEDIR@")
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(KF5Auth "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5Archive "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5ConfigWidgets "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5CoreAddons "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5Crash "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5DesignerPlugin "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5DocTools "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5Emoticons "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5GuiAddons "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5IconThemes "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5ItemModels "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5Init "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5Notifications "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5Parts "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5TextWidgets "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5UnitConversion "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5WindowSystem "@KF_DEP_VERSION@")
|
||||
find_dependency(KF5DBusAddons "@KF_DEP_VERSION@")
|
||||
|
||||
find_dependency(Qt5DBus @REQUIRED_QT_VERSION@)
|
||||
find_dependency(Qt5Xml @REQUIRED_QT_VERSION@)
|
||||
find_dependency(Qt5PrintSupport @REQUIRED_QT_VERSION@)
|
||||
|
||||
if(WIN32)
|
||||
find_dependency(KDEWin)
|
||||
endif()
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/KF5KDELibs4SupportTargets.cmake")
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/ECMQt4To5Porting.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/KDE4Macros.cmake")
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/MacroAppendIf.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/MacroEnsureOutOfSourceBuild.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/MacroBoolTo01.cmake")
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
|
||||
|
||||
remove_definitions(
|
||||
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
|
||||
-DQT_NO_CAST_FROM_ASCII
|
||||
-DQT_NO_CAST_TO_ASCII
|
||||
)
|
||||
|
||||
# This is not intended to be a list of what frameworks each of the kde libraries
|
||||
# was broken into. KDE4_KDECORE_LIBS contains more than what used to be in
|
||||
# the kdecore library. That is a feature. These things should be big ugly warts
|
||||
# in any project using them. The KDELibs4Support module is not for long term use and
|
||||
# it is not for 'making code build with both Qt/KDE 4 and Qt/KF 5' for medium or
|
||||
# long term. In trivial cases, no use of KDELibs4Support will be pushed to the repo
|
||||
# of the code being ported.
|
||||
#
|
||||
# The use-sequence is this:
|
||||
# 1. When starting to port something to KF5, find and use KDELibs4Support.
|
||||
# 2. Port the C++ code to Qt5/KF5.
|
||||
# 3. Port the buildsystem away from KDELibs4Support.
|
||||
# 4. Remove the find_package for KDELibs4Support.
|
||||
|
||||
set(KDE4_KDECORE_LIBS
|
||||
KF5::KDELibs4Support
|
||||
Qt5::Network
|
||||
Qt5::DBus
|
||||
Qt5::Xml
|
||||
KF5::KIOCore
|
||||
KF5::I18n
|
||||
KF5::CoreAddons
|
||||
KF5::Codecs
|
||||
KF5::ConfigCore
|
||||
KF5::WidgetsAddons
|
||||
KF5::ItemModels
|
||||
KF5::ConfigWidgets
|
||||
KF5::Completion
|
||||
KF5::XmlGui
|
||||
KF5::IconThemes
|
||||
KF5::KIOWidgets
|
||||
KF5::ItemViews
|
||||
KF5::Emoticons
|
||||
)
|
||||
set(KDE4_KDEUI_LIBS ${KDE4_KDECORE_LIBS})
|
||||
set(KDE4_KIO_LIBS ${KDE4_KDECORE_LIBS})
|
||||
set(KDE4_KPARTS_LIBS ${KDE4_KPARTS_LIBS})
|
||||
set(KDE4_KUTILS_LIBS ${KDE4_KUTILS_LIBS})
|
||||
set(KDE4_KFILE_LIBS ${KDE4_KFILE_LIBS})
|
||||
set(KDE4_KHTML_LIBS ${KDE4_KHTML_LIBS})
|
||||
set(KDE4_KDELIBS4SUPPORT_LIBS ${KDE4_KDECORE_LIBS})
|
||||
|
||||
set(KDE4_INCLUDES $<TARGET_PROPERTY:KF5::KDELibs4Support,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel"))
|
||||
set (KDE4_ENABLE_EXCEPTIONS -EHsc)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
set (KDE4_ENABLE_EXCEPTIONS "-fexceptions -UQT_NO_EXCEPTIONS")
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set (KDE4_ENABLE_EXCEPTIONS -fexceptions)
|
||||
endif()
|
|
@ -0,0 +1,22 @@
|
|||
# KDELibs 4 Support
|
||||
|
||||
Legacy support for kdelibs 4 compatibility
|
||||
|
||||
## Introduction
|
||||
|
||||
This framework provides code and utilities to ease the transition from
|
||||
kdelibs 4 to KDE Frameworks 5. This includes CMake macros and C++
|
||||
classes whose functionality has been replaced by code in CMake, Qt and
|
||||
other frameworks.
|
||||
|
||||
Code should aim to port away from this framework eventually. The API
|
||||
documentation of the classes in this framework and the notes at
|
||||
<http://community.kde.org/Frameworks/Porting_Notes> should help with
|
||||
this.
|
||||
|
||||
Note that some of the classes in this framework, especially
|
||||
KStandardDirs, may not work correctly unless any libraries and other
|
||||
software using the KDELibs 4 Support framework are installed to the same
|
||||
location as KDELibs4Support, although it may be sufficient to set the
|
||||
KDEDIRS environment variable correctly.
|
||||
|
Binary file not shown.
|
@ -0,0 +1,288 @@
|
|||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Fri Dec 13 20:45:52 1901 UTC = Fri Dec 13 21:45:52 1901 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sat Dec 14 20:45:52 1901 UTC = Sat Dec 14 21:45:52 1901 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Apr 30 21:59:59 1916 UTC = Sun Apr 30 22:59:59 1916 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Apr 30 22:00:00 1916 UTC = Mon May 1 00:00:00 1916 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sat Sep 30 22:59:59 1916 UTC = Sun Oct 1 00:59:59 1916 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sat Sep 30 23:00:00 1916 UTC = Sun Oct 1 00:00:00 1916 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Apr 16 00:59:59 1917 UTC = Mon Apr 16 01:59:59 1917 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Apr 16 01:00:00 1917 UTC = Mon Apr 16 03:00:00 1917 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Sep 17 00:59:59 1917 UTC = Mon Sep 17 02:59:59 1917 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Sep 17 01:00:00 1917 UTC = Mon Sep 17 02:00:00 1917 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Apr 15 00:59:59 1918 UTC = Mon Apr 15 01:59:59 1918 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Apr 15 01:00:00 1918 UTC = Mon Apr 15 03:00:00 1918 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Sep 16 00:59:59 1918 UTC = Mon Sep 16 02:59:59 1918 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Sep 16 01:00:00 1918 UTC = Mon Sep 16 02:00:00 1918 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Apr 1 00:59:59 1940 UTC = Mon Apr 1 01:59:59 1940 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Apr 1 01:00:00 1940 UTC = Mon Apr 1 03:00:00 1940 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Nov 2 00:59:59 1942 UTC = Mon Nov 2 02:59:59 1942 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Nov 2 01:00:00 1942 UTC = Mon Nov 2 02:00:00 1942 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Mar 29 00:59:59 1943 UTC = Mon Mar 29 01:59:59 1943 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Mar 29 01:00:00 1943 UTC = Mon Mar 29 03:00:00 1943 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Oct 4 00:59:59 1943 UTC = Mon Oct 4 02:59:59 1943 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Oct 4 01:00:00 1943 UTC = Mon Oct 4 02:00:00 1943 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Apr 3 00:59:59 1944 UTC = Mon Apr 3 01:59:59 1944 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Apr 3 01:00:00 1944 UTC = Mon Apr 3 03:00:00 1944 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Oct 2 00:59:59 1944 UTC = Mon Oct 2 02:59:59 1944 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Oct 2 01:00:00 1944 UTC = Mon Oct 2 02:00:00 1944 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Apr 2 00:59:59 1945 UTC = Mon Apr 2 01:59:59 1945 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Apr 2 01:00:00 1945 UTC = Mon Apr 2 03:00:00 1945 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Wed May 23 23:59:59 1945 UTC = Thu May 24 01:59:59 1945 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Thu May 24 00:00:00 1945 UTC = Thu May 24 03:00:00 1945 CEMT isdst=1 gmtoff=10800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 23 23:59:59 1945 UTC = Mon Sep 24 02:59:59 1945 CEMT isdst=1 gmtoff=10800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Sep 24 00:00:00 1945 UTC = Mon Sep 24 02:00:00 1945 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Nov 18 00:59:59 1945 UTC = Sun Nov 18 02:59:59 1945 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Nov 18 01:00:00 1945 UTC = Sun Nov 18 02:00:00 1945 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Apr 14 00:59:59 1946 UTC = Sun Apr 14 01:59:59 1946 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Apr 14 01:00:00 1946 UTC = Sun Apr 14 03:00:00 1946 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Oct 7 00:59:59 1946 UTC = Mon Oct 7 02:59:59 1946 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Oct 7 01:00:00 1946 UTC = Mon Oct 7 02:00:00 1946 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Apr 6 01:59:59 1947 UTC = Sun Apr 6 02:59:59 1947 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Apr 6 02:00:00 1947 UTC = Sun Apr 6 04:00:00 1947 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun May 11 00:59:59 1947 UTC = Sun May 11 02:59:59 1947 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun May 11 01:00:00 1947 UTC = Sun May 11 04:00:00 1947 CEMT isdst=1 gmtoff=10800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sat Jun 28 23:59:59 1947 UTC = Sun Jun 29 02:59:59 1947 CEMT isdst=1 gmtoff=10800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Jun 29 00:00:00 1947 UTC = Sun Jun 29 02:00:00 1947 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 5 00:59:59 1947 UTC = Sun Oct 5 02:59:59 1947 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 5 01:00:00 1947 UTC = Sun Oct 5 02:00:00 1947 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Apr 18 00:59:59 1948 UTC = Sun Apr 18 01:59:59 1948 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Apr 18 01:00:00 1948 UTC = Sun Apr 18 03:00:00 1948 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 3 00:59:59 1948 UTC = Sun Oct 3 02:59:59 1948 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 3 01:00:00 1948 UTC = Sun Oct 3 02:00:00 1948 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Apr 10 00:59:59 1949 UTC = Sun Apr 10 01:59:59 1949 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Apr 10 01:00:00 1949 UTC = Sun Apr 10 03:00:00 1949 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 2 00:59:59 1949 UTC = Sun Oct 2 02:59:59 1949 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 2 01:00:00 1949 UTC = Sun Oct 2 02:00:00 1949 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Apr 6 00:59:59 1980 UTC = Sun Apr 6 01:59:59 1980 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Apr 6 01:00:00 1980 UTC = Sun Apr 6 03:00:00 1980 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 28 00:59:59 1980 UTC = Sun Sep 28 02:59:59 1980 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 28 01:00:00 1980 UTC = Sun Sep 28 02:00:00 1980 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 00:59:59 1981 UTC = Sun Mar 29 01:59:59 1981 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 01:00:00 1981 UTC = Sun Mar 29 03:00:00 1981 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 27 00:59:59 1981 UTC = Sun Sep 27 02:59:59 1981 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 27 01:00:00 1981 UTC = Sun Sep 27 02:00:00 1981 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 00:59:59 1982 UTC = Sun Mar 28 01:59:59 1982 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 01:00:00 1982 UTC = Sun Mar 28 03:00:00 1982 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 26 00:59:59 1982 UTC = Sun Sep 26 02:59:59 1982 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 26 01:00:00 1982 UTC = Sun Sep 26 02:00:00 1982 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 00:59:59 1983 UTC = Sun Mar 27 01:59:59 1983 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 01:00:00 1983 UTC = Sun Mar 27 03:00:00 1983 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 25 00:59:59 1983 UTC = Sun Sep 25 02:59:59 1983 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 25 01:00:00 1983 UTC = Sun Sep 25 02:00:00 1983 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 00:59:59 1984 UTC = Sun Mar 25 01:59:59 1984 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 01:00:00 1984 UTC = Sun Mar 25 03:00:00 1984 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 30 00:59:59 1984 UTC = Sun Sep 30 02:59:59 1984 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 30 01:00:00 1984 UTC = Sun Sep 30 02:00:00 1984 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 00:59:59 1985 UTC = Sun Mar 31 01:59:59 1985 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 01:00:00 1985 UTC = Sun Mar 31 03:00:00 1985 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 29 00:59:59 1985 UTC = Sun Sep 29 02:59:59 1985 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 29 01:00:00 1985 UTC = Sun Sep 29 02:00:00 1985 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 00:59:59 1986 UTC = Sun Mar 30 01:59:59 1986 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 01:00:00 1986 UTC = Sun Mar 30 03:00:00 1986 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 28 00:59:59 1986 UTC = Sun Sep 28 02:59:59 1986 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 28 01:00:00 1986 UTC = Sun Sep 28 02:00:00 1986 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 00:59:59 1987 UTC = Sun Mar 29 01:59:59 1987 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 01:00:00 1987 UTC = Sun Mar 29 03:00:00 1987 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 27 00:59:59 1987 UTC = Sun Sep 27 02:59:59 1987 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 27 01:00:00 1987 UTC = Sun Sep 27 02:00:00 1987 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 00:59:59 1988 UTC = Sun Mar 27 01:59:59 1988 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 01:00:00 1988 UTC = Sun Mar 27 03:00:00 1988 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 25 00:59:59 1988 UTC = Sun Sep 25 02:59:59 1988 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 25 01:00:00 1988 UTC = Sun Sep 25 02:00:00 1988 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 00:59:59 1989 UTC = Sun Mar 26 01:59:59 1989 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 01:00:00 1989 UTC = Sun Mar 26 03:00:00 1989 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 24 00:59:59 1989 UTC = Sun Sep 24 02:59:59 1989 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 24 01:00:00 1989 UTC = Sun Sep 24 02:00:00 1989 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 00:59:59 1990 UTC = Sun Mar 25 01:59:59 1990 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 01:00:00 1990 UTC = Sun Mar 25 03:00:00 1990 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 30 00:59:59 1990 UTC = Sun Sep 30 02:59:59 1990 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 30 01:00:00 1990 UTC = Sun Sep 30 02:00:00 1990 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 00:59:59 1991 UTC = Sun Mar 31 01:59:59 1991 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 01:00:00 1991 UTC = Sun Mar 31 03:00:00 1991 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 29 00:59:59 1991 UTC = Sun Sep 29 02:59:59 1991 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 29 01:00:00 1991 UTC = Sun Sep 29 02:00:00 1991 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 00:59:59 1992 UTC = Sun Mar 29 01:59:59 1992 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 01:00:00 1992 UTC = Sun Mar 29 03:00:00 1992 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 27 00:59:59 1992 UTC = Sun Sep 27 02:59:59 1992 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 27 01:00:00 1992 UTC = Sun Sep 27 02:00:00 1992 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 00:59:59 1993 UTC = Sun Mar 28 01:59:59 1993 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 01:00:00 1993 UTC = Sun Mar 28 03:00:00 1993 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 26 00:59:59 1993 UTC = Sun Sep 26 02:59:59 1993 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 26 01:00:00 1993 UTC = Sun Sep 26 02:00:00 1993 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 00:59:59 1994 UTC = Sun Mar 27 01:59:59 1994 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 01:00:00 1994 UTC = Sun Mar 27 03:00:00 1994 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 25 00:59:59 1994 UTC = Sun Sep 25 02:59:59 1994 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 25 01:00:00 1994 UTC = Sun Sep 25 02:00:00 1994 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 00:59:59 1995 UTC = Sun Mar 26 01:59:59 1995 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 01:00:00 1995 UTC = Sun Mar 26 03:00:00 1995 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 24 00:59:59 1995 UTC = Sun Sep 24 02:59:59 1995 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Sep 24 01:00:00 1995 UTC = Sun Sep 24 02:00:00 1995 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 00:59:59 1996 UTC = Sun Mar 31 01:59:59 1996 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 01:00:00 1996 UTC = Sun Mar 31 03:00:00 1996 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 27 00:59:59 1996 UTC = Sun Oct 27 02:59:59 1996 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 27 01:00:00 1996 UTC = Sun Oct 27 02:00:00 1996 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 00:59:59 1997 UTC = Sun Mar 30 01:59:59 1997 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 01:00:00 1997 UTC = Sun Mar 30 03:00:00 1997 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 26 00:59:59 1997 UTC = Sun Oct 26 02:59:59 1997 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 26 01:00:00 1997 UTC = Sun Oct 26 02:00:00 1997 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 00:59:59 1998 UTC = Sun Mar 29 01:59:59 1998 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 01:00:00 1998 UTC = Sun Mar 29 03:00:00 1998 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 25 00:59:59 1998 UTC = Sun Oct 25 02:59:59 1998 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 25 01:00:00 1998 UTC = Sun Oct 25 02:00:00 1998 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 00:59:59 1999 UTC = Sun Mar 28 01:59:59 1999 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 01:00:00 1999 UTC = Sun Mar 28 03:00:00 1999 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 31 00:59:59 1999 UTC = Sun Oct 31 02:59:59 1999 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 31 01:00:00 1999 UTC = Sun Oct 31 02:00:00 1999 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 00:59:59 2000 UTC = Sun Mar 26 01:59:59 2000 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 01:00:00 2000 UTC = Sun Mar 26 03:00:00 2000 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 29 00:59:59 2000 UTC = Sun Oct 29 02:59:59 2000 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 29 01:00:00 2000 UTC = Sun Oct 29 02:00:00 2000 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 00:59:59 2001 UTC = Sun Mar 25 01:59:59 2001 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 01:00:00 2001 UTC = Sun Mar 25 03:00:00 2001 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 28 00:59:59 2001 UTC = Sun Oct 28 02:59:59 2001 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 28 01:00:00 2001 UTC = Sun Oct 28 02:00:00 2001 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 00:59:59 2002 UTC = Sun Mar 31 01:59:59 2002 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 01:00:00 2002 UTC = Sun Mar 31 03:00:00 2002 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 27 00:59:59 2002 UTC = Sun Oct 27 02:59:59 2002 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 27 01:00:00 2002 UTC = Sun Oct 27 02:00:00 2002 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 00:59:59 2003 UTC = Sun Mar 30 01:59:59 2003 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 01:00:00 2003 UTC = Sun Mar 30 03:00:00 2003 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 26 00:59:59 2003 UTC = Sun Oct 26 02:59:59 2003 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 26 01:00:00 2003 UTC = Sun Oct 26 02:00:00 2003 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 00:59:59 2004 UTC = Sun Mar 28 01:59:59 2004 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 01:00:00 2004 UTC = Sun Mar 28 03:00:00 2004 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 31 00:59:59 2004 UTC = Sun Oct 31 02:59:59 2004 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 31 01:00:00 2004 UTC = Sun Oct 31 02:00:00 2004 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 00:59:59 2005 UTC = Sun Mar 27 01:59:59 2005 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 01:00:00 2005 UTC = Sun Mar 27 03:00:00 2005 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 30 00:59:59 2005 UTC = Sun Oct 30 02:59:59 2005 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 30 01:00:00 2005 UTC = Sun Oct 30 02:00:00 2005 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 00:59:59 2006 UTC = Sun Mar 26 01:59:59 2006 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 01:00:00 2006 UTC = Sun Mar 26 03:00:00 2006 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 29 00:59:59 2006 UTC = Sun Oct 29 02:59:59 2006 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 29 01:00:00 2006 UTC = Sun Oct 29 02:00:00 2006 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 00:59:59 2007 UTC = Sun Mar 25 01:59:59 2007 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 01:00:00 2007 UTC = Sun Mar 25 03:00:00 2007 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 28 00:59:59 2007 UTC = Sun Oct 28 02:59:59 2007 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 28 01:00:00 2007 UTC = Sun Oct 28 02:00:00 2007 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 00:59:59 2008 UTC = Sun Mar 30 01:59:59 2008 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 01:00:00 2008 UTC = Sun Mar 30 03:00:00 2008 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 26 00:59:59 2008 UTC = Sun Oct 26 02:59:59 2008 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 26 01:00:00 2008 UTC = Sun Oct 26 02:00:00 2008 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 00:59:59 2009 UTC = Sun Mar 29 01:59:59 2009 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 01:00:00 2009 UTC = Sun Mar 29 03:00:00 2009 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 25 00:59:59 2009 UTC = Sun Oct 25 02:59:59 2009 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 25 01:00:00 2009 UTC = Sun Oct 25 02:00:00 2009 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 00:59:59 2010 UTC = Sun Mar 28 01:59:59 2010 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 01:00:00 2010 UTC = Sun Mar 28 03:00:00 2010 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 31 00:59:59 2010 UTC = Sun Oct 31 02:59:59 2010 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 31 01:00:00 2010 UTC = Sun Oct 31 02:00:00 2010 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 00:59:59 2011 UTC = Sun Mar 27 01:59:59 2011 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 01:00:00 2011 UTC = Sun Mar 27 03:00:00 2011 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 30 00:59:59 2011 UTC = Sun Oct 30 02:59:59 2011 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 30 01:00:00 2011 UTC = Sun Oct 30 02:00:00 2011 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 00:59:59 2012 UTC = Sun Mar 25 01:59:59 2012 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 01:00:00 2012 UTC = Sun Mar 25 03:00:00 2012 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 28 00:59:59 2012 UTC = Sun Oct 28 02:59:59 2012 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 28 01:00:00 2012 UTC = Sun Oct 28 02:00:00 2012 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 00:59:59 2013 UTC = Sun Mar 31 01:59:59 2013 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 01:00:00 2013 UTC = Sun Mar 31 03:00:00 2013 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 27 00:59:59 2013 UTC = Sun Oct 27 02:59:59 2013 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 27 01:00:00 2013 UTC = Sun Oct 27 02:00:00 2013 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 00:59:59 2014 UTC = Sun Mar 30 01:59:59 2014 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 01:00:00 2014 UTC = Sun Mar 30 03:00:00 2014 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 26 00:59:59 2014 UTC = Sun Oct 26 02:59:59 2014 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 26 01:00:00 2014 UTC = Sun Oct 26 02:00:00 2014 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 00:59:59 2015 UTC = Sun Mar 29 01:59:59 2015 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 01:00:00 2015 UTC = Sun Mar 29 03:00:00 2015 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 25 00:59:59 2015 UTC = Sun Oct 25 02:59:59 2015 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 25 01:00:00 2015 UTC = Sun Oct 25 02:00:00 2015 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 00:59:59 2016 UTC = Sun Mar 27 01:59:59 2016 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 01:00:00 2016 UTC = Sun Mar 27 03:00:00 2016 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 30 00:59:59 2016 UTC = Sun Oct 30 02:59:59 2016 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 30 01:00:00 2016 UTC = Sun Oct 30 02:00:00 2016 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 00:59:59 2017 UTC = Sun Mar 26 01:59:59 2017 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 01:00:00 2017 UTC = Sun Mar 26 03:00:00 2017 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 29 00:59:59 2017 UTC = Sun Oct 29 02:59:59 2017 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 29 01:00:00 2017 UTC = Sun Oct 29 02:00:00 2017 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 00:59:59 2018 UTC = Sun Mar 25 01:59:59 2018 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 01:00:00 2018 UTC = Sun Mar 25 03:00:00 2018 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 28 00:59:59 2018 UTC = Sun Oct 28 02:59:59 2018 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 28 01:00:00 2018 UTC = Sun Oct 28 02:00:00 2018 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 00:59:59 2019 UTC = Sun Mar 31 01:59:59 2019 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 01:00:00 2019 UTC = Sun Mar 31 03:00:00 2019 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 27 00:59:59 2019 UTC = Sun Oct 27 02:59:59 2019 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 27 01:00:00 2019 UTC = Sun Oct 27 02:00:00 2019 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 00:59:59 2020 UTC = Sun Mar 29 01:59:59 2020 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 01:00:00 2020 UTC = Sun Mar 29 03:00:00 2020 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 25 00:59:59 2020 UTC = Sun Oct 25 02:59:59 2020 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 25 01:00:00 2020 UTC = Sun Oct 25 02:00:00 2020 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 00:59:59 2021 UTC = Sun Mar 28 01:59:59 2021 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 01:00:00 2021 UTC = Sun Mar 28 03:00:00 2021 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 31 00:59:59 2021 UTC = Sun Oct 31 02:59:59 2021 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 31 01:00:00 2021 UTC = Sun Oct 31 02:00:00 2021 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 00:59:59 2022 UTC = Sun Mar 27 01:59:59 2022 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 01:00:00 2022 UTC = Sun Mar 27 03:00:00 2022 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 30 00:59:59 2022 UTC = Sun Oct 30 02:59:59 2022 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 30 01:00:00 2022 UTC = Sun Oct 30 02:00:00 2022 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 00:59:59 2023 UTC = Sun Mar 26 01:59:59 2023 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 01:00:00 2023 UTC = Sun Mar 26 03:00:00 2023 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 29 00:59:59 2023 UTC = Sun Oct 29 02:59:59 2023 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 29 01:00:00 2023 UTC = Sun Oct 29 02:00:00 2023 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 00:59:59 2024 UTC = Sun Mar 31 01:59:59 2024 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 01:00:00 2024 UTC = Sun Mar 31 03:00:00 2024 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 27 00:59:59 2024 UTC = Sun Oct 27 02:59:59 2024 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 27 01:00:00 2024 UTC = Sun Oct 27 02:00:00 2024 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 00:59:59 2025 UTC = Sun Mar 30 01:59:59 2025 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 01:00:00 2025 UTC = Sun Mar 30 03:00:00 2025 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 26 00:59:59 2025 UTC = Sun Oct 26 02:59:59 2025 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 26 01:00:00 2025 UTC = Sun Oct 26 02:00:00 2025 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 00:59:59 2026 UTC = Sun Mar 29 01:59:59 2026 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 01:00:00 2026 UTC = Sun Mar 29 03:00:00 2026 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 25 00:59:59 2026 UTC = Sun Oct 25 02:59:59 2026 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 25 01:00:00 2026 UTC = Sun Oct 25 02:00:00 2026 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 00:59:59 2027 UTC = Sun Mar 28 01:59:59 2027 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 01:00:00 2027 UTC = Sun Mar 28 03:00:00 2027 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 31 00:59:59 2027 UTC = Sun Oct 31 02:59:59 2027 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 31 01:00:00 2027 UTC = Sun Oct 31 02:00:00 2027 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 00:59:59 2028 UTC = Sun Mar 26 01:59:59 2028 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 01:00:00 2028 UTC = Sun Mar 26 03:00:00 2028 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 29 00:59:59 2028 UTC = Sun Oct 29 02:59:59 2028 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 29 01:00:00 2028 UTC = Sun Oct 29 02:00:00 2028 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 00:59:59 2029 UTC = Sun Mar 25 01:59:59 2029 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 01:00:00 2029 UTC = Sun Mar 25 03:00:00 2029 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 28 00:59:59 2029 UTC = Sun Oct 28 02:59:59 2029 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 28 01:00:00 2029 UTC = Sun Oct 28 02:00:00 2029 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 00:59:59 2030 UTC = Sun Mar 31 01:59:59 2030 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 31 01:00:00 2030 UTC = Sun Mar 31 03:00:00 2030 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 27 00:59:59 2030 UTC = Sun Oct 27 02:59:59 2030 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 27 01:00:00 2030 UTC = Sun Oct 27 02:00:00 2030 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 00:59:59 2031 UTC = Sun Mar 30 01:59:59 2031 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 01:00:00 2031 UTC = Sun Mar 30 03:00:00 2031 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 26 00:59:59 2031 UTC = Sun Oct 26 02:59:59 2031 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 26 01:00:00 2031 UTC = Sun Oct 26 02:00:00 2031 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 00:59:59 2032 UTC = Sun Mar 28 01:59:59 2032 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 28 01:00:00 2032 UTC = Sun Mar 28 03:00:00 2032 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 31 00:59:59 2032 UTC = Sun Oct 31 02:59:59 2032 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 31 01:00:00 2032 UTC = Sun Oct 31 02:00:00 2032 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 00:59:59 2033 UTC = Sun Mar 27 01:59:59 2033 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 27 01:00:00 2033 UTC = Sun Mar 27 03:00:00 2033 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 30 00:59:59 2033 UTC = Sun Oct 30 02:59:59 2033 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 30 01:00:00 2033 UTC = Sun Oct 30 02:00:00 2033 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 00:59:59 2034 UTC = Sun Mar 26 01:59:59 2034 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 26 01:00:00 2034 UTC = Sun Mar 26 03:00:00 2034 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 29 00:59:59 2034 UTC = Sun Oct 29 02:59:59 2034 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 29 01:00:00 2034 UTC = Sun Oct 29 02:00:00 2034 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 00:59:59 2035 UTC = Sun Mar 25 01:59:59 2035 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 25 01:00:00 2035 UTC = Sun Mar 25 03:00:00 2035 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 28 00:59:59 2035 UTC = Sun Oct 28 02:59:59 2035 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 28 01:00:00 2035 UTC = Sun Oct 28 02:00:00 2035 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 00:59:59 2036 UTC = Sun Mar 30 01:59:59 2036 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 30 01:00:00 2036 UTC = Sun Mar 30 03:00:00 2036 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 26 00:59:59 2036 UTC = Sun Oct 26 02:59:59 2036 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 26 01:00:00 2036 UTC = Sun Oct 26 02:00:00 2036 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 00:59:59 2037 UTC = Sun Mar 29 01:59:59 2037 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Mar 29 01:00:00 2037 UTC = Sun Mar 29 03:00:00 2037 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 25 00:59:59 2037 UTC = Sun Oct 25 02:59:59 2037 CEST isdst=1 gmtoff=7200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Sun Oct 25 01:00:00 2037 UTC = Sun Oct 25 02:00:00 2037 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Mon Jan 18 03:14:07 2038 UTC = Mon Jan 18 04:14:07 2038 CET isdst=0 gmtoff=3600
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Berlin Tue Jan 19 03:14:07 2038 UTC = Tue Jan 19 04:14:07 2038 CET isdst=0 gmtoff=3600
|
|
@ -0,0 +1,114 @@
|
|||
|
||||
include(ECMAddTests)
|
||||
|
||||
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Concurrent)
|
||||
|
||||
include_directories("${CMAKE_CURRENT_BINARY_DIR}/../../..")
|
||||
|
||||
macro(KDELIBS4SUPPORT_EXECUTABLE_TESTS)
|
||||
foreach(_testname ${ARGN})
|
||||
add_executable(${_testname} ${_testname}.cpp)
|
||||
target_link_libraries(${_testname} KF5::KDELibs4Support Qt5::Core Qt5::Widgets KF5::ConfigCore)
|
||||
ecm_mark_as_test(${_testname})
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
|
||||
ecm_add_tests( globalcleanuptest.cpp
|
||||
kaccelgentest.cpp
|
||||
kcalendartest.cpp
|
||||
kcmdlineargs_unittest.cpp
|
||||
kdatetimetest.cpp
|
||||
klocaletimeformattest.cpp
|
||||
ktimezonestest.cpp
|
||||
k4timezonewidget_unittest.cpp
|
||||
kdebugtest.cpp
|
||||
kbuttongrouptest.cpp
|
||||
kdialog_unittest.cpp
|
||||
kfadewidgeteffecttest.cpp
|
||||
kconfigafterkglobaltest1.cpp
|
||||
kconfigafterkglobaltest2.cpp
|
||||
kdebug_unittest.cpp
|
||||
kdebug_qcoreapptest.cpp
|
||||
kmd5benchmark.cpp
|
||||
ktabwidget_unittest.cpp
|
||||
ktempdirtest.cpp
|
||||
ktemporaryfiletest.cpp
|
||||
kuniqueapptest.cpp
|
||||
kurlmimetest.cpp
|
||||
klibloadertest.cpp
|
||||
ksavefiletest.cpp
|
||||
kconfigcompattest.cpp
|
||||
kglobalstatictest.cpp
|
||||
kmimetypetest.cpp
|
||||
kmimetype_nomimetypes.cpp
|
||||
kstandarddirstest.cpp
|
||||
kasciitest.cpp
|
||||
kglobaltest.cpp
|
||||
klockfiletest.cpp
|
||||
kurltest.cpp
|
||||
kfilemetainfotest.cpp
|
||||
kglobalsettingstest.cpp
|
||||
ksharedptrtest.cpp
|
||||
naturalcomparetest.cpp
|
||||
LINK_LIBRARIES
|
||||
KF5::KDELibs4Support
|
||||
Qt5::DBus
|
||||
Qt5::Widgets
|
||||
Qt5::Test
|
||||
Qt5::Network
|
||||
Qt5::Concurrent
|
||||
KF5::CoreAddons
|
||||
KF5::I18n
|
||||
KF5::Crash
|
||||
KF5::KIOCore
|
||||
KF5::KIOWidgets
|
||||
)
|
||||
|
||||
|
||||
kdelibs4support_executable_tests(
|
||||
klockfile_testlock # Helper for klockfiletest
|
||||
kglobalsettingsclient # Helper for kglobalsettingstest
|
||||
)
|
||||
|
||||
########### module for klibloadertest ###############
|
||||
|
||||
if(NOT KDELIBS4SUPPORT_NO_DEPRECATED)
|
||||
# this exists to check that code using the kde 3 macros still build,
|
||||
# even though the module cannot be loaded
|
||||
set(klibloadertestmodule3_PART_SRCS klibloadertest3_module.cpp )
|
||||
|
||||
add_library(klibloadertestmodule3 MODULE ${klibloadertestmodule3_PART_SRCS})
|
||||
set_target_properties(klibloadertestmodule3 PROPERTIES PREFIX "") # remove lib prefix - missing from cmake
|
||||
|
||||
target_link_libraries(klibloadertestmodule3 KF5::KDELibs4Support Qt5::Test KF5::I18n KF5::Service KF5::CoreAddons)
|
||||
|
||||
set_target_properties(klibloadertestmodule3 PROPERTIES SKIP_BUILD_RPATH FALSE BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
endif()
|
||||
|
||||
########### module for klibloadertest5 ###############
|
||||
|
||||
set(klibloadertestmodule5_PART_SRCS klibloadertest5_module.cpp )
|
||||
|
||||
add_library(klibloadertestmodule5 MODULE ${klibloadertestmodule5_PART_SRCS})
|
||||
ecm_mark_as_test(klibloadertestmodule5)
|
||||
set_target_properties(klibloadertestmodule5 PROPERTIES PREFIX "") # remove lib prefix - missing from cmake
|
||||
|
||||
target_link_libraries(klibloadertestmodule5 KF5::KDELibs4Support Qt5::Test KF5::I18n KF5::Service KF5::CoreAddons)
|
||||
|
||||
set_target_properties(klibloadertestmodule5 PROPERTIES SKIP_BUILD_RPATH FALSE BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
|
||||
########### klocaletest ###############
|
||||
|
||||
# compile into the test since it's not exported
|
||||
ecm_add_test(klocaletest.cpp ../src/kdecore/kdayperiod.cpp
|
||||
TEST_NAME "kdelibs4support-klocaletest"
|
||||
LINK_LIBRARIES Qt5::Test Qt5::DBus KF5::I18n KF5::KDELibs4Support KF5::ConfigCore)
|
||||
|
||||
########### kdatetimeformattertest ###############
|
||||
|
||||
# compile KDateTimeFormatter and KDayPeriod into the test since it's not exported
|
||||
ecm_add_test(kdatetimeformattertest.cpp ../src/kdecore/kdatetimeformatter.cpp ../src/kdecore/kdayperiod.cpp
|
||||
TEST_NAME "kdelibs4support-kdatetimeformattertest" LINK_LIBRARIES Qt5::Test KF5::I18n KF5::KDELibs4Support KF5::ConfigCore)
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,14 @@
|
|||
Africa/Johannesburg Fri Dec 13 20:45:52 1901 UTC = Fri Dec 13 22:15:52 1901 SAST isdst=0 gmtoff=5400
|
||||
Africa/Johannesburg Sat Dec 14 20:45:52 1901 UTC = Sat Dec 14 22:15:52 1901 SAST isdst=0 gmtoff=5400
|
||||
Africa/Johannesburg Sat Feb 28 22:29:59 1903 UTC = Sat Feb 28 23:59:59 1903 SAST isdst=0 gmtoff=5400
|
||||
Africa/Johannesburg Sat Feb 28 22:30:00 1903 UTC = Sun Mar 1 00:30:00 1903 SAST isdst=0 gmtoff=7200
|
||||
Africa/Johannesburg Sat Sep 19 23:59:59 1942 UTC = Sun Sep 20 01:59:59 1942 SAST isdst=0 gmtoff=7200
|
||||
Africa/Johannesburg Sun Sep 20 00:00:00 1942 UTC = Sun Sep 20 03:00:00 1942 SAST isdst=1 gmtoff=10800
|
||||
Africa/Johannesburg Sat Mar 20 22:59:59 1943 UTC = Sun Mar 21 01:59:59 1943 SAST isdst=1 gmtoff=10800
|
||||
Africa/Johannesburg Sat Mar 20 23:00:00 1943 UTC = Sun Mar 21 01:00:00 1943 SAST isdst=0 gmtoff=7200
|
||||
Africa/Johannesburg Sat Sep 18 23:59:59 1943 UTC = Sun Sep 19 01:59:59 1943 SAST isdst=0 gmtoff=7200
|
||||
Africa/Johannesburg Sun Sep 19 00:00:00 1943 UTC = Sun Sep 19 03:00:00 1943 SAST isdst=1 gmtoff=10800
|
||||
Africa/Johannesburg Sat Mar 18 22:59:59 1944 UTC = Sun Mar 19 01:59:59 1944 SAST isdst=1 gmtoff=10800
|
||||
Africa/Johannesburg Sat Mar 18 23:00:00 1944 UTC = Sun Mar 19 01:00:00 1944 SAST isdst=0 gmtoff=7200
|
||||
Africa/Johannesburg Mon Jan 18 03:14:07 2038 UTC = Mon Jan 18 05:14:07 2038 SAST isdst=0 gmtoff=7200
|
||||
Africa/Johannesburg Tue Jan 19 03:14:07 2038 UTC = Tue Jan 19 05:14:07 2038 SAST isdst=0 gmtoff=7200
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,374 @@
|
|||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Fri Dec 13 20:45:52 1901 UTC = Fri Dec 13 12:45:52 1901 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sat Dec 14 20:45:52 1901 UTC = Sat Dec 14 12:45:52 1901 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 31 09:59:59 1918 UTC = Sun Mar 31 01:59:59 1918 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 31 10:00:00 1918 UTC = Sun Mar 31 03:00:00 1918 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 08:59:59 1918 UTC = Sun Oct 27 01:59:59 1918 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 09:00:00 1918 UTC = Sun Oct 27 01:00:00 1918 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 30 09:59:59 1919 UTC = Sun Mar 30 01:59:59 1919 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 30 10:00:00 1919 UTC = Sun Mar 30 03:00:00 1919 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 26 08:59:59 1919 UTC = Sun Oct 26 01:59:59 1919 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 26 09:00:00 1919 UTC = Sun Oct 26 01:00:00 1919 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Mon Feb 9 09:59:59 1942 UTC = Mon Feb 9 01:59:59 1942 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Mon Feb 9 10:00:00 1942 UTC = Mon Feb 9 03:00:00 1942 PWT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Tue Aug 14 22:59:59 1945 UTC = Tue Aug 14 15:59:59 1945 PWT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Tue Aug 14 23:00:00 1945 UTC = Tue Aug 14 16:00:00 1945 PPT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 30 08:59:59 1945 UTC = Sun Sep 30 01:59:59 1945 PPT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 30 09:00:00 1945 UTC = Sun Sep 30 01:00:00 1945 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 14 09:59:59 1948 UTC = Sun Mar 14 01:59:59 1948 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 14 10:00:00 1948 UTC = Sun Mar 14 03:00:00 1948 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sat Jan 1 08:59:59 1949 UTC = Sat Jan 1 01:59:59 1949 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sat Jan 1 09:00:00 1949 UTC = Sat Jan 1 01:00:00 1949 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 30 09:59:59 1950 UTC = Sun Apr 30 01:59:59 1950 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 30 10:00:00 1950 UTC = Sun Apr 30 03:00:00 1950 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 24 08:59:59 1950 UTC = Sun Sep 24 01:59:59 1950 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 24 09:00:00 1950 UTC = Sun Sep 24 01:00:00 1950 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 29 09:59:59 1951 UTC = Sun Apr 29 01:59:59 1951 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 29 10:00:00 1951 UTC = Sun Apr 29 03:00:00 1951 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 30 08:59:59 1951 UTC = Sun Sep 30 01:59:59 1951 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 30 09:00:00 1951 UTC = Sun Sep 30 01:00:00 1951 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 27 09:59:59 1952 UTC = Sun Apr 27 01:59:59 1952 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 27 10:00:00 1952 UTC = Sun Apr 27 03:00:00 1952 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 28 08:59:59 1952 UTC = Sun Sep 28 01:59:59 1952 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 28 09:00:00 1952 UTC = Sun Sep 28 01:00:00 1952 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 26 09:59:59 1953 UTC = Sun Apr 26 01:59:59 1953 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 26 10:00:00 1953 UTC = Sun Apr 26 03:00:00 1953 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 27 08:59:59 1953 UTC = Sun Sep 27 01:59:59 1953 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 27 09:00:00 1953 UTC = Sun Sep 27 01:00:00 1953 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 25 09:59:59 1954 UTC = Sun Apr 25 01:59:59 1954 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 25 10:00:00 1954 UTC = Sun Apr 25 03:00:00 1954 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 26 08:59:59 1954 UTC = Sun Sep 26 01:59:59 1954 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 26 09:00:00 1954 UTC = Sun Sep 26 01:00:00 1954 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 24 09:59:59 1955 UTC = Sun Apr 24 01:59:59 1955 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 24 10:00:00 1955 UTC = Sun Apr 24 03:00:00 1955 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 25 08:59:59 1955 UTC = Sun Sep 25 01:59:59 1955 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 25 09:00:00 1955 UTC = Sun Sep 25 01:00:00 1955 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 29 09:59:59 1956 UTC = Sun Apr 29 01:59:59 1956 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 29 10:00:00 1956 UTC = Sun Apr 29 03:00:00 1956 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 30 08:59:59 1956 UTC = Sun Sep 30 01:59:59 1956 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 30 09:00:00 1956 UTC = Sun Sep 30 01:00:00 1956 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 28 09:59:59 1957 UTC = Sun Apr 28 01:59:59 1957 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 28 10:00:00 1957 UTC = Sun Apr 28 03:00:00 1957 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 29 08:59:59 1957 UTC = Sun Sep 29 01:59:59 1957 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 29 09:00:00 1957 UTC = Sun Sep 29 01:00:00 1957 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 27 09:59:59 1958 UTC = Sun Apr 27 01:59:59 1958 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 27 10:00:00 1958 UTC = Sun Apr 27 03:00:00 1958 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 28 08:59:59 1958 UTC = Sun Sep 28 01:59:59 1958 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 28 09:00:00 1958 UTC = Sun Sep 28 01:00:00 1958 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 26 09:59:59 1959 UTC = Sun Apr 26 01:59:59 1959 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 26 10:00:00 1959 UTC = Sun Apr 26 03:00:00 1959 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 27 08:59:59 1959 UTC = Sun Sep 27 01:59:59 1959 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 27 09:00:00 1959 UTC = Sun Sep 27 01:00:00 1959 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 24 09:59:59 1960 UTC = Sun Apr 24 01:59:59 1960 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 24 10:00:00 1960 UTC = Sun Apr 24 03:00:00 1960 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 25 08:59:59 1960 UTC = Sun Sep 25 01:59:59 1960 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 25 09:00:00 1960 UTC = Sun Sep 25 01:00:00 1960 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 30 09:59:59 1961 UTC = Sun Apr 30 01:59:59 1961 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 30 10:00:00 1961 UTC = Sun Apr 30 03:00:00 1961 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 24 08:59:59 1961 UTC = Sun Sep 24 01:59:59 1961 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Sep 24 09:00:00 1961 UTC = Sun Sep 24 01:00:00 1961 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 29 09:59:59 1962 UTC = Sun Apr 29 01:59:59 1962 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 29 10:00:00 1962 UTC = Sun Apr 29 03:00:00 1962 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 28 08:59:59 1962 UTC = Sun Oct 28 01:59:59 1962 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 28 09:00:00 1962 UTC = Sun Oct 28 01:00:00 1962 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 28 09:59:59 1963 UTC = Sun Apr 28 01:59:59 1963 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 28 10:00:00 1963 UTC = Sun Apr 28 03:00:00 1963 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 08:59:59 1963 UTC = Sun Oct 27 01:59:59 1963 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 09:00:00 1963 UTC = Sun Oct 27 01:00:00 1963 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 26 09:59:59 1964 UTC = Sun Apr 26 01:59:59 1964 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 26 10:00:00 1964 UTC = Sun Apr 26 03:00:00 1964 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 25 08:59:59 1964 UTC = Sun Oct 25 01:59:59 1964 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 25 09:00:00 1964 UTC = Sun Oct 25 01:00:00 1964 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 25 09:59:59 1965 UTC = Sun Apr 25 01:59:59 1965 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 25 10:00:00 1965 UTC = Sun Apr 25 03:00:00 1965 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 31 08:59:59 1965 UTC = Sun Oct 31 01:59:59 1965 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 31 09:00:00 1965 UTC = Sun Oct 31 01:00:00 1965 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 24 09:59:59 1966 UTC = Sun Apr 24 01:59:59 1966 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 24 10:00:00 1966 UTC = Sun Apr 24 03:00:00 1966 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 30 08:59:59 1966 UTC = Sun Oct 30 01:59:59 1966 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 30 09:00:00 1966 UTC = Sun Oct 30 01:00:00 1966 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 30 09:59:59 1967 UTC = Sun Apr 30 01:59:59 1967 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 30 10:00:00 1967 UTC = Sun Apr 30 03:00:00 1967 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 29 08:59:59 1967 UTC = Sun Oct 29 01:59:59 1967 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 29 09:00:00 1967 UTC = Sun Oct 29 01:00:00 1967 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 28 09:59:59 1968 UTC = Sun Apr 28 01:59:59 1968 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 28 10:00:00 1968 UTC = Sun Apr 28 03:00:00 1968 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 08:59:59 1968 UTC = Sun Oct 27 01:59:59 1968 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 09:00:00 1968 UTC = Sun Oct 27 01:00:00 1968 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 27 09:59:59 1969 UTC = Sun Apr 27 01:59:59 1969 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 27 10:00:00 1969 UTC = Sun Apr 27 03:00:00 1969 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 26 08:59:59 1969 UTC = Sun Oct 26 01:59:59 1969 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 26 09:00:00 1969 UTC = Sun Oct 26 01:00:00 1969 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 26 09:59:59 1970 UTC = Sun Apr 26 01:59:59 1970 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 26 10:00:00 1970 UTC = Sun Apr 26 03:00:00 1970 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 25 08:59:59 1970 UTC = Sun Oct 25 01:59:59 1970 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 25 09:00:00 1970 UTC = Sun Oct 25 01:00:00 1970 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 25 09:59:59 1971 UTC = Sun Apr 25 01:59:59 1971 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 25 10:00:00 1971 UTC = Sun Apr 25 03:00:00 1971 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 31 08:59:59 1971 UTC = Sun Oct 31 01:59:59 1971 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 31 09:00:00 1971 UTC = Sun Oct 31 01:00:00 1971 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 30 09:59:59 1972 UTC = Sun Apr 30 01:59:59 1972 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 30 10:00:00 1972 UTC = Sun Apr 30 03:00:00 1972 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 29 08:59:59 1972 UTC = Sun Oct 29 01:59:59 1972 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 29 09:00:00 1972 UTC = Sun Oct 29 01:00:00 1972 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 29 09:59:59 1973 UTC = Sun Apr 29 01:59:59 1973 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 29 10:00:00 1973 UTC = Sun Apr 29 03:00:00 1973 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 28 08:59:59 1973 UTC = Sun Oct 28 01:59:59 1973 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 28 09:00:00 1973 UTC = Sun Oct 28 01:00:00 1973 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Jan 6 09:59:59 1974 UTC = Sun Jan 6 01:59:59 1974 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Jan 6 10:00:00 1974 UTC = Sun Jan 6 03:00:00 1974 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 08:59:59 1974 UTC = Sun Oct 27 01:59:59 1974 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 09:00:00 1974 UTC = Sun Oct 27 01:00:00 1974 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Feb 23 09:59:59 1975 UTC = Sun Feb 23 01:59:59 1975 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Feb 23 10:00:00 1975 UTC = Sun Feb 23 03:00:00 1975 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 26 08:59:59 1975 UTC = Sun Oct 26 01:59:59 1975 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 26 09:00:00 1975 UTC = Sun Oct 26 01:00:00 1975 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 25 09:59:59 1976 UTC = Sun Apr 25 01:59:59 1976 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 25 10:00:00 1976 UTC = Sun Apr 25 03:00:00 1976 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 31 08:59:59 1976 UTC = Sun Oct 31 01:59:59 1976 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 31 09:00:00 1976 UTC = Sun Oct 31 01:00:00 1976 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 24 09:59:59 1977 UTC = Sun Apr 24 01:59:59 1977 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 24 10:00:00 1977 UTC = Sun Apr 24 03:00:00 1977 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 30 08:59:59 1977 UTC = Sun Oct 30 01:59:59 1977 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 30 09:00:00 1977 UTC = Sun Oct 30 01:00:00 1977 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 30 09:59:59 1978 UTC = Sun Apr 30 01:59:59 1978 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 30 10:00:00 1978 UTC = Sun Apr 30 03:00:00 1978 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 29 08:59:59 1978 UTC = Sun Oct 29 01:59:59 1978 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 29 09:00:00 1978 UTC = Sun Oct 29 01:00:00 1978 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 29 09:59:59 1979 UTC = Sun Apr 29 01:59:59 1979 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 29 10:00:00 1979 UTC = Sun Apr 29 03:00:00 1979 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 28 08:59:59 1979 UTC = Sun Oct 28 01:59:59 1979 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 28 09:00:00 1979 UTC = Sun Oct 28 01:00:00 1979 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 27 09:59:59 1980 UTC = Sun Apr 27 01:59:59 1980 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 27 10:00:00 1980 UTC = Sun Apr 27 03:00:00 1980 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 26 08:59:59 1980 UTC = Sun Oct 26 01:59:59 1980 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 26 09:00:00 1980 UTC = Sun Oct 26 01:00:00 1980 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 26 09:59:59 1981 UTC = Sun Apr 26 01:59:59 1981 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 26 10:00:00 1981 UTC = Sun Apr 26 03:00:00 1981 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 25 08:59:59 1981 UTC = Sun Oct 25 01:59:59 1981 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 25 09:00:00 1981 UTC = Sun Oct 25 01:00:00 1981 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 25 09:59:59 1982 UTC = Sun Apr 25 01:59:59 1982 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 25 10:00:00 1982 UTC = Sun Apr 25 03:00:00 1982 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 31 08:59:59 1982 UTC = Sun Oct 31 01:59:59 1982 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 31 09:00:00 1982 UTC = Sun Oct 31 01:00:00 1982 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 24 09:59:59 1983 UTC = Sun Apr 24 01:59:59 1983 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 24 10:00:00 1983 UTC = Sun Apr 24 03:00:00 1983 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 30 08:59:59 1983 UTC = Sun Oct 30 01:59:59 1983 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 30 09:00:00 1983 UTC = Sun Oct 30 01:00:00 1983 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 29 09:59:59 1984 UTC = Sun Apr 29 01:59:59 1984 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 29 10:00:00 1984 UTC = Sun Apr 29 03:00:00 1984 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 28 08:59:59 1984 UTC = Sun Oct 28 01:59:59 1984 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 28 09:00:00 1984 UTC = Sun Oct 28 01:00:00 1984 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 28 09:59:59 1985 UTC = Sun Apr 28 01:59:59 1985 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 28 10:00:00 1985 UTC = Sun Apr 28 03:00:00 1985 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 08:59:59 1985 UTC = Sun Oct 27 01:59:59 1985 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 09:00:00 1985 UTC = Sun Oct 27 01:00:00 1985 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 27 09:59:59 1986 UTC = Sun Apr 27 01:59:59 1986 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 27 10:00:00 1986 UTC = Sun Apr 27 03:00:00 1986 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 26 08:59:59 1986 UTC = Sun Oct 26 01:59:59 1986 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 26 09:00:00 1986 UTC = Sun Oct 26 01:00:00 1986 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 5 09:59:59 1987 UTC = Sun Apr 5 01:59:59 1987 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 5 10:00:00 1987 UTC = Sun Apr 5 03:00:00 1987 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 25 08:59:59 1987 UTC = Sun Oct 25 01:59:59 1987 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 25 09:00:00 1987 UTC = Sun Oct 25 01:00:00 1987 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 3 09:59:59 1988 UTC = Sun Apr 3 01:59:59 1988 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 3 10:00:00 1988 UTC = Sun Apr 3 03:00:00 1988 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 30 08:59:59 1988 UTC = Sun Oct 30 01:59:59 1988 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 30 09:00:00 1988 UTC = Sun Oct 30 01:00:00 1988 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 2 09:59:59 1989 UTC = Sun Apr 2 01:59:59 1989 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 2 10:00:00 1989 UTC = Sun Apr 2 03:00:00 1989 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 29 08:59:59 1989 UTC = Sun Oct 29 01:59:59 1989 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 29 09:00:00 1989 UTC = Sun Oct 29 01:00:00 1989 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 1 09:59:59 1990 UTC = Sun Apr 1 01:59:59 1990 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 1 10:00:00 1990 UTC = Sun Apr 1 03:00:00 1990 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 28 08:59:59 1990 UTC = Sun Oct 28 01:59:59 1990 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 28 09:00:00 1990 UTC = Sun Oct 28 01:00:00 1990 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 7 09:59:59 1991 UTC = Sun Apr 7 01:59:59 1991 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 7 10:00:00 1991 UTC = Sun Apr 7 03:00:00 1991 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 08:59:59 1991 UTC = Sun Oct 27 01:59:59 1991 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 09:00:00 1991 UTC = Sun Oct 27 01:00:00 1991 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 5 09:59:59 1992 UTC = Sun Apr 5 01:59:59 1992 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 5 10:00:00 1992 UTC = Sun Apr 5 03:00:00 1992 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 25 08:59:59 1992 UTC = Sun Oct 25 01:59:59 1992 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 25 09:00:00 1992 UTC = Sun Oct 25 01:00:00 1992 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 4 09:59:59 1993 UTC = Sun Apr 4 01:59:59 1993 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 4 10:00:00 1993 UTC = Sun Apr 4 03:00:00 1993 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 31 08:59:59 1993 UTC = Sun Oct 31 01:59:59 1993 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 31 09:00:00 1993 UTC = Sun Oct 31 01:00:00 1993 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 3 09:59:59 1994 UTC = Sun Apr 3 01:59:59 1994 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 3 10:00:00 1994 UTC = Sun Apr 3 03:00:00 1994 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 30 08:59:59 1994 UTC = Sun Oct 30 01:59:59 1994 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 30 09:00:00 1994 UTC = Sun Oct 30 01:00:00 1994 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 2 09:59:59 1995 UTC = Sun Apr 2 01:59:59 1995 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 2 10:00:00 1995 UTC = Sun Apr 2 03:00:00 1995 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 29 08:59:59 1995 UTC = Sun Oct 29 01:59:59 1995 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 29 09:00:00 1995 UTC = Sun Oct 29 01:00:00 1995 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 7 09:59:59 1996 UTC = Sun Apr 7 01:59:59 1996 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 7 10:00:00 1996 UTC = Sun Apr 7 03:00:00 1996 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 08:59:59 1996 UTC = Sun Oct 27 01:59:59 1996 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 09:00:00 1996 UTC = Sun Oct 27 01:00:00 1996 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 6 09:59:59 1997 UTC = Sun Apr 6 01:59:59 1997 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 6 10:00:00 1997 UTC = Sun Apr 6 03:00:00 1997 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 26 08:59:59 1997 UTC = Sun Oct 26 01:59:59 1997 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 26 09:00:00 1997 UTC = Sun Oct 26 01:00:00 1997 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 5 09:59:59 1998 UTC = Sun Apr 5 01:59:59 1998 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 5 10:00:00 1998 UTC = Sun Apr 5 03:00:00 1998 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 25 08:59:59 1998 UTC = Sun Oct 25 01:59:59 1998 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 25 09:00:00 1998 UTC = Sun Oct 25 01:00:00 1998 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 4 09:59:59 1999 UTC = Sun Apr 4 01:59:59 1999 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 4 10:00:00 1999 UTC = Sun Apr 4 03:00:00 1999 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 31 08:59:59 1999 UTC = Sun Oct 31 01:59:59 1999 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 31 09:00:00 1999 UTC = Sun Oct 31 01:00:00 1999 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 2 09:59:59 2000 UTC = Sun Apr 2 01:59:59 2000 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 2 10:00:00 2000 UTC = Sun Apr 2 03:00:00 2000 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 29 08:59:59 2000 UTC = Sun Oct 29 01:59:59 2000 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 29 09:00:00 2000 UTC = Sun Oct 29 01:00:00 2000 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 1 09:59:59 2001 UTC = Sun Apr 1 01:59:59 2001 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 1 10:00:00 2001 UTC = Sun Apr 1 03:00:00 2001 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 28 08:59:59 2001 UTC = Sun Oct 28 01:59:59 2001 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 28 09:00:00 2001 UTC = Sun Oct 28 01:00:00 2001 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 7 09:59:59 2002 UTC = Sun Apr 7 01:59:59 2002 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 7 10:00:00 2002 UTC = Sun Apr 7 03:00:00 2002 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 08:59:59 2002 UTC = Sun Oct 27 01:59:59 2002 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 27 09:00:00 2002 UTC = Sun Oct 27 01:00:00 2002 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 6 09:59:59 2003 UTC = Sun Apr 6 01:59:59 2003 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 6 10:00:00 2003 UTC = Sun Apr 6 03:00:00 2003 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 26 08:59:59 2003 UTC = Sun Oct 26 01:59:59 2003 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 26 09:00:00 2003 UTC = Sun Oct 26 01:00:00 2003 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 4 09:59:59 2004 UTC = Sun Apr 4 01:59:59 2004 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 4 10:00:00 2004 UTC = Sun Apr 4 03:00:00 2004 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 31 08:59:59 2004 UTC = Sun Oct 31 01:59:59 2004 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 31 09:00:00 2004 UTC = Sun Oct 31 01:00:00 2004 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 3 09:59:59 2005 UTC = Sun Apr 3 01:59:59 2005 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 3 10:00:00 2005 UTC = Sun Apr 3 03:00:00 2005 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 30 08:59:59 2005 UTC = Sun Oct 30 01:59:59 2005 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 30 09:00:00 2005 UTC = Sun Oct 30 01:00:00 2005 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 2 09:59:59 2006 UTC = Sun Apr 2 01:59:59 2006 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Apr 2 10:00:00 2006 UTC = Sun Apr 2 03:00:00 2006 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 29 08:59:59 2006 UTC = Sun Oct 29 01:59:59 2006 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Oct 29 09:00:00 2006 UTC = Sun Oct 29 01:00:00 2006 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 11 09:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 11 10:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 4 08:59:59 2007 UTC = Sun Nov 4 01:59:59 2007 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 4 09:00:00 2007 UTC = Sun Nov 4 01:00:00 2007 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 9 09:59:59 2008 UTC = Sun Mar 9 01:59:59 2008 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 9 10:00:00 2008 UTC = Sun Mar 9 03:00:00 2008 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 2 08:59:59 2008 UTC = Sun Nov 2 01:59:59 2008 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 2 09:00:00 2008 UTC = Sun Nov 2 01:00:00 2008 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 8 09:59:59 2009 UTC = Sun Mar 8 01:59:59 2009 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 8 10:00:00 2009 UTC = Sun Mar 8 03:00:00 2009 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 1 08:59:59 2009 UTC = Sun Nov 1 01:59:59 2009 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 1 09:00:00 2009 UTC = Sun Nov 1 01:00:00 2009 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 14 09:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 14 10:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 7 08:59:59 2010 UTC = Sun Nov 7 01:59:59 2010 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 7 09:00:00 2010 UTC = Sun Nov 7 01:00:00 2010 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 13 09:59:59 2011 UTC = Sun Mar 13 01:59:59 2011 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 13 10:00:00 2011 UTC = Sun Mar 13 03:00:00 2011 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 6 08:59:59 2011 UTC = Sun Nov 6 01:59:59 2011 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 6 09:00:00 2011 UTC = Sun Nov 6 01:00:00 2011 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 11 09:59:59 2012 UTC = Sun Mar 11 01:59:59 2012 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 11 10:00:00 2012 UTC = Sun Mar 11 03:00:00 2012 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 4 08:59:59 2012 UTC = Sun Nov 4 01:59:59 2012 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 4 09:00:00 2012 UTC = Sun Nov 4 01:00:00 2012 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 10 09:59:59 2013 UTC = Sun Mar 10 01:59:59 2013 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 10 10:00:00 2013 UTC = Sun Mar 10 03:00:00 2013 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 3 08:59:59 2013 UTC = Sun Nov 3 01:59:59 2013 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 3 09:00:00 2013 UTC = Sun Nov 3 01:00:00 2013 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 9 09:59:59 2014 UTC = Sun Mar 9 01:59:59 2014 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 9 10:00:00 2014 UTC = Sun Mar 9 03:00:00 2014 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 2 08:59:59 2014 UTC = Sun Nov 2 01:59:59 2014 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 2 09:00:00 2014 UTC = Sun Nov 2 01:00:00 2014 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 8 09:59:59 2015 UTC = Sun Mar 8 01:59:59 2015 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 8 10:00:00 2015 UTC = Sun Mar 8 03:00:00 2015 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 1 08:59:59 2015 UTC = Sun Nov 1 01:59:59 2015 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 1 09:00:00 2015 UTC = Sun Nov 1 01:00:00 2015 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 13 09:59:59 2016 UTC = Sun Mar 13 01:59:59 2016 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 13 10:00:00 2016 UTC = Sun Mar 13 03:00:00 2016 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 6 08:59:59 2016 UTC = Sun Nov 6 01:59:59 2016 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 6 09:00:00 2016 UTC = Sun Nov 6 01:00:00 2016 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 12 09:59:59 2017 UTC = Sun Mar 12 01:59:59 2017 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 12 10:00:00 2017 UTC = Sun Mar 12 03:00:00 2017 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 5 08:59:59 2017 UTC = Sun Nov 5 01:59:59 2017 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 5 09:00:00 2017 UTC = Sun Nov 5 01:00:00 2017 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 11 09:59:59 2018 UTC = Sun Mar 11 01:59:59 2018 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 11 10:00:00 2018 UTC = Sun Mar 11 03:00:00 2018 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 4 08:59:59 2018 UTC = Sun Nov 4 01:59:59 2018 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 4 09:00:00 2018 UTC = Sun Nov 4 01:00:00 2018 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 10 09:59:59 2019 UTC = Sun Mar 10 01:59:59 2019 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 10 10:00:00 2019 UTC = Sun Mar 10 03:00:00 2019 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 3 08:59:59 2019 UTC = Sun Nov 3 01:59:59 2019 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 3 09:00:00 2019 UTC = Sun Nov 3 01:00:00 2019 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 8 09:59:59 2020 UTC = Sun Mar 8 01:59:59 2020 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 8 10:00:00 2020 UTC = Sun Mar 8 03:00:00 2020 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 1 08:59:59 2020 UTC = Sun Nov 1 01:59:59 2020 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 1 09:00:00 2020 UTC = Sun Nov 1 01:00:00 2020 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 14 09:59:59 2021 UTC = Sun Mar 14 01:59:59 2021 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 14 10:00:00 2021 UTC = Sun Mar 14 03:00:00 2021 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 7 08:59:59 2021 UTC = Sun Nov 7 01:59:59 2021 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 7 09:00:00 2021 UTC = Sun Nov 7 01:00:00 2021 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 13 09:59:59 2022 UTC = Sun Mar 13 01:59:59 2022 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 13 10:00:00 2022 UTC = Sun Mar 13 03:00:00 2022 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 6 08:59:59 2022 UTC = Sun Nov 6 01:59:59 2022 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 6 09:00:00 2022 UTC = Sun Nov 6 01:00:00 2022 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 12 09:59:59 2023 UTC = Sun Mar 12 01:59:59 2023 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 12 10:00:00 2023 UTC = Sun Mar 12 03:00:00 2023 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 5 08:59:59 2023 UTC = Sun Nov 5 01:59:59 2023 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 5 09:00:00 2023 UTC = Sun Nov 5 01:00:00 2023 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 10 09:59:59 2024 UTC = Sun Mar 10 01:59:59 2024 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 10 10:00:00 2024 UTC = Sun Mar 10 03:00:00 2024 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 3 08:59:59 2024 UTC = Sun Nov 3 01:59:59 2024 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 3 09:00:00 2024 UTC = Sun Nov 3 01:00:00 2024 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 9 09:59:59 2025 UTC = Sun Mar 9 01:59:59 2025 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 9 10:00:00 2025 UTC = Sun Mar 9 03:00:00 2025 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 2 08:59:59 2025 UTC = Sun Nov 2 01:59:59 2025 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 2 09:00:00 2025 UTC = Sun Nov 2 01:00:00 2025 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 8 09:59:59 2026 UTC = Sun Mar 8 01:59:59 2026 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 8 10:00:00 2026 UTC = Sun Mar 8 03:00:00 2026 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 1 08:59:59 2026 UTC = Sun Nov 1 01:59:59 2026 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 1 09:00:00 2026 UTC = Sun Nov 1 01:00:00 2026 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 14 09:59:59 2027 UTC = Sun Mar 14 01:59:59 2027 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 14 10:00:00 2027 UTC = Sun Mar 14 03:00:00 2027 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 7 08:59:59 2027 UTC = Sun Nov 7 01:59:59 2027 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 7 09:00:00 2027 UTC = Sun Nov 7 01:00:00 2027 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 12 09:59:59 2028 UTC = Sun Mar 12 01:59:59 2028 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 12 10:00:00 2028 UTC = Sun Mar 12 03:00:00 2028 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 5 08:59:59 2028 UTC = Sun Nov 5 01:59:59 2028 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 5 09:00:00 2028 UTC = Sun Nov 5 01:00:00 2028 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 11 09:59:59 2029 UTC = Sun Mar 11 01:59:59 2029 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 11 10:00:00 2029 UTC = Sun Mar 11 03:00:00 2029 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 4 08:59:59 2029 UTC = Sun Nov 4 01:59:59 2029 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 4 09:00:00 2029 UTC = Sun Nov 4 01:00:00 2029 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 10 09:59:59 2030 UTC = Sun Mar 10 01:59:59 2030 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 10 10:00:00 2030 UTC = Sun Mar 10 03:00:00 2030 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 3 08:59:59 2030 UTC = Sun Nov 3 01:59:59 2030 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 3 09:00:00 2030 UTC = Sun Nov 3 01:00:00 2030 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 9 09:59:59 2031 UTC = Sun Mar 9 01:59:59 2031 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 9 10:00:00 2031 UTC = Sun Mar 9 03:00:00 2031 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 2 08:59:59 2031 UTC = Sun Nov 2 01:59:59 2031 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 2 09:00:00 2031 UTC = Sun Nov 2 01:00:00 2031 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 14 09:59:59 2032 UTC = Sun Mar 14 01:59:59 2032 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 14 10:00:00 2032 UTC = Sun Mar 14 03:00:00 2032 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 7 08:59:59 2032 UTC = Sun Nov 7 01:59:59 2032 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 7 09:00:00 2032 UTC = Sun Nov 7 01:00:00 2032 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 13 09:59:59 2033 UTC = Sun Mar 13 01:59:59 2033 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 13 10:00:00 2033 UTC = Sun Mar 13 03:00:00 2033 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 6 08:59:59 2033 UTC = Sun Nov 6 01:59:59 2033 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 6 09:00:00 2033 UTC = Sun Nov 6 01:00:00 2033 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 12 09:59:59 2034 UTC = Sun Mar 12 01:59:59 2034 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 12 10:00:00 2034 UTC = Sun Mar 12 03:00:00 2034 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 5 08:59:59 2034 UTC = Sun Nov 5 01:59:59 2034 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 5 09:00:00 2034 UTC = Sun Nov 5 01:00:00 2034 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 11 09:59:59 2035 UTC = Sun Mar 11 01:59:59 2035 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 11 10:00:00 2035 UTC = Sun Mar 11 03:00:00 2035 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 4 08:59:59 2035 UTC = Sun Nov 4 01:59:59 2035 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 4 09:00:00 2035 UTC = Sun Nov 4 01:00:00 2035 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 9 09:59:59 2036 UTC = Sun Mar 9 01:59:59 2036 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 9 10:00:00 2036 UTC = Sun Mar 9 03:00:00 2036 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 2 08:59:59 2036 UTC = Sun Nov 2 01:59:59 2036 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 2 09:00:00 2036 UTC = Sun Nov 2 01:00:00 2036 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 8 09:59:59 2037 UTC = Sun Mar 8 01:59:59 2037 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Mar 8 10:00:00 2037 UTC = Sun Mar 8 03:00:00 2037 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 1 08:59:59 2037 UTC = Sun Nov 1 01:59:59 2037 PDT isdst=1 gmtoff=-25200
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Sun Nov 1 09:00:00 2037 UTC = Sun Nov 1 01:00:00 2037 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Mon Jan 18 03:14:07 2038 UTC = Sun Jan 17 19:14:07 2038 PST isdst=0 gmtoff=-28800
|
||||
/home/david/src/kde/4.8/kdelibs/kdecore/tests/Los_Angeles Tue Jan 19 03:14:07 2038 UTC = Mon Jan 18 19:14:07 2038 PST isdst=0 gmtoff=-28800
|
Binary file not shown.
|
@ -0,0 +1,44 @@
|
|||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QtGlobal>
|
||||
#include <kcomponentdata.h>
|
||||
#include <ksharedconfig.h>
|
||||
#include <kconfiggroup.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
|
||||
{
|
||||
KComponentData componentData("globalcleanuptest");
|
||||
// letting componentData go out of scope here simulates the behaviour of KCmdLineArgs
|
||||
}
|
||||
KSharedConfigPtr cfg = KSharedConfig::openConfig();
|
||||
KConfigGroup group = cfg->group("test");
|
||||
group.writeEntry("test", 1);
|
||||
|
||||
KComponentData componentData2("globalcleanuptest2");
|
||||
cfg = componentData2.config();
|
||||
group = cfg->group("test");
|
||||
group.writeEntry("test", 1);
|
||||
|
||||
qrand(); // make sure the global static that kills us is accessed
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 878 B |
|
@ -0,0 +1,121 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (C) 2007 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <QTest>
|
||||
#include <k4timezonewidget.h>
|
||||
#include <ksystemtimezone.h>
|
||||
#include <kconfiggroup.h>
|
||||
#include "ktimezonestest_p.h"
|
||||
|
||||
class K4TimeZoneWidgetTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
void init()
|
||||
{
|
||||
initTestCase();
|
||||
}
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
void initTestCase()
|
||||
{
|
||||
//mTestData.setupTimeZoneTest(); // see ktimezonestest_p.h
|
||||
}
|
||||
|
||||
void cleanupTestCase()
|
||||
{
|
||||
//mTestData.cleanupTimeZoneTest();
|
||||
}
|
||||
|
||||
void testSetSelected()
|
||||
{
|
||||
if (!KSystemTimeZones::isTimeZoneDaemonAvailable()) {
|
||||
QSKIP("ktimezoned not available, check that kded5 is running and /modules/ktimezoned is available");
|
||||
}
|
||||
|
||||
K4TimeZoneWidget tzw;
|
||||
QVERIFY(tzw.topLevelItemCount() > 0);
|
||||
QVERIFY(tzw.selectedItems().isEmpty());
|
||||
|
||||
// Single selection mode (default)
|
||||
QVERIFY(tzw.selectionMode() == K4TimeZoneWidget::SingleSelection);
|
||||
tzw.setSelected("Europe/Paris", true);
|
||||
QCOMPARE(tzw.selectedItems().count(), 1);
|
||||
QCOMPARE(tzw.selection(), QStringList() << "Europe/Paris");
|
||||
tzw.setSelected("Africa/Cairo", true);
|
||||
QCOMPARE(tzw.selectedItems().count(), 1);
|
||||
QCOMPARE(tzw.selection(), QStringList() << "Africa/Cairo");
|
||||
|
||||
// Multiple selections explicitly allowed
|
||||
tzw.setSelectionMode(K4TimeZoneWidget::MultiSelection);
|
||||
tzw.clearSelection();
|
||||
QVERIFY(tzw.selectedItems().isEmpty());
|
||||
tzw.setSelected("Europe/Paris", true);
|
||||
QCOMPARE(tzw.selectedItems().count(), 1);
|
||||
QCOMPARE(tzw.selection(), QStringList() << "Europe/Paris");
|
||||
tzw.setSelected("America/Los_Angeles", true);
|
||||
QCOMPARE(tzw.selectedItems().count(), 2);
|
||||
QCOMPARE(tzw.selection(), QStringList() << "America/Los_Angeles" << "Europe/Paris");
|
||||
}
|
||||
|
||||
void testCheckableItems()
|
||||
{
|
||||
if (!KSystemTimeZones::isTimeZoneDaemonAvailable()) {
|
||||
QSKIP("ktimezoned not available, check that kded5 is running and /modules/ktimezoned is available");
|
||||
}
|
||||
|
||||
K4TimeZoneWidget tzw;
|
||||
tzw.setItemsCheckable(true);
|
||||
QVERIFY(tzw.topLevelItemCount() > 0);
|
||||
QVERIFY(tzw.selectedItems().isEmpty());
|
||||
QVERIFY(tzw.selection().isEmpty());
|
||||
|
||||
// Single selection mode (default)
|
||||
QVERIFY(tzw.selectionMode() == K4TimeZoneWidget::SingleSelection);
|
||||
tzw.setSelected("Europe/Paris", true);
|
||||
QCOMPARE(tzw.selectedItems().count(), 0); // it got checked, not selected
|
||||
QCOMPARE(tzw.selection(), QStringList() << "Europe/Paris");
|
||||
tzw.setSelected("Africa/Cairo", true);
|
||||
QCOMPARE(tzw.selection(), QStringList() << "Africa/Cairo");
|
||||
|
||||
// Multiple selections explicitly allowed
|
||||
tzw.setSelectionMode(K4TimeZoneWidget::MultiSelection);
|
||||
tzw.clearSelection();
|
||||
tzw.setSelected("Europe/Paris", true);
|
||||
QCOMPARE(tzw.selection(), QStringList() << "Europe/Paris");
|
||||
tzw.setSelected("America/Los_Angeles", true);
|
||||
QCOMPARE(tzw.selection(), QStringList() << "America/Los_Angeles" << "Europe/Paris");
|
||||
}
|
||||
private:
|
||||
// Because we don't use a separate KDEHOME, we can't use TimeZoneTestData.
|
||||
// It would remove ktimezonedrc from the user!
|
||||
//TimeZoneTestData mTestData;
|
||||
};
|
||||
|
||||
// Note: no QStandardPaths::setTestModeEnabled(true) here.
|
||||
// The kded module writes out a config file, but unit tests have
|
||||
// a different configuration directory so they don't see those config files.
|
||||
// Ideally unit tests should talk to their own kded instance,
|
||||
// but that means starting a new DBus session bus for all (each?) unit tests, somehow...
|
||||
|
||||
QTEST_MAIN(K4TimeZoneWidgetTest)
|
||||
|
||||
#include "k4timezonewidget_unittest.moc"
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
Copyright 2004 Frerich Raabe <raabe@kde.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of
|
||||
the License, or (at your option) version 3.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "kaccelgen.h"
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
void check(const QString &what, const QStringList &expected, const QStringList &received)
|
||||
{
|
||||
cout << "Testing " << qPrintable(what) << ": ";
|
||||
if (expected == received) {
|
||||
cout << "ok" << endl;
|
||||
} else {
|
||||
cout << "ERROR!" << endl;
|
||||
cout << "Expected: " << qPrintable(expected.join(",")) << endl;
|
||||
cout << "Received: " << qPrintable(received.join(",")) << endl;
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
QStringList input;
|
||||
input << "foo" << "bar item" << "&baz" << "bif" << "boz" << "boz 2"
|
||||
<< "yoyo && dyne";
|
||||
|
||||
QStringList expected;
|
||||
expected << "&foo" << "bar &item" << "&baz" << "bif" << "b&oz" << "boz &2"
|
||||
<< "&yoyo && dyne";
|
||||
|
||||
QStringList output;
|
||||
KAccelGen::generate(input, output);
|
||||
check("QStringList value generation", expected, output);
|
||||
|
||||
QMap<QString, QString> map;
|
||||
for (QStringList::ConstIterator it = input.constBegin(); it != input.constEnd(); ++it) {
|
||||
map.insert(*it, *it);
|
||||
}
|
||||
input.sort();
|
||||
expected.clear();
|
||||
KAccelGen::generate(input, expected);
|
||||
|
||||
output.clear();
|
||||
KAccelGen::generateFromValues(map, output);
|
||||
check("map value generation", expected, output);
|
||||
|
||||
output.clear();
|
||||
KAccelGen::generateFromKeys(map, output);
|
||||
check("map key generation", expected, output);
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
Copyright (c) 2006 Volker Krause <vkrause@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include "kasciitest.h"
|
||||
#include "qtest_kde.h"
|
||||
|
||||
#include <kascii.h>
|
||||
|
||||
QTEST_KDEMAIN_CORE(KAsciiTest)
|
||||
|
||||
void KAsciiTest::testkasciistricmp()
|
||||
{
|
||||
QVERIFY(kasciistricmp("test", "test") == 0);
|
||||
QVERIFY(kasciistricmp("test", "Test") == 0);
|
||||
QVERIFY(kasciistricmp("TeSt", "tEst") == 0);
|
||||
|
||||
QVERIFY(kasciistricmp(nullptr, nullptr) == 0);
|
||||
QVERIFY(kasciistricmp("", "") == 0);
|
||||
QVERIFY(kasciistricmp(nullptr, "") < 0);
|
||||
QVERIFY(kasciistricmp("", nullptr) > 0);
|
||||
|
||||
QVERIFY(kasciistricmp("", "foo") < 0);
|
||||
QVERIFY(kasciistricmp("foo", "") > 0);
|
||||
|
||||
QVERIFY(kasciistricmp("test", "testtest") < 0);
|
||||
QVERIFY(kasciistricmp("testtest", "test") > 0);
|
||||
|
||||
QVERIFY(kasciistricmp("a", "b") < 0);
|
||||
QVERIFY(kasciistricmp("b", "a") > 0);
|
||||
QVERIFY(kasciistricmp("A", "b") < 0);
|
||||
QVERIFY(kasciistricmp("b", "A") > 0);
|
||||
QVERIFY(kasciistricmp("a", "B") < 0);
|
||||
QVERIFY(kasciistricmp("B", "a") > 0);
|
||||
QVERIFY(kasciistricmp("A", "B") < 0);
|
||||
QVERIFY(kasciistricmp("B", "A") > 0);
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
Copyright (c) 2006 Volker Krause <vkrause@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KASCIITEST_H
|
||||
#define KASCIITEST_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class KAsciiTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
void testkasciistricmp();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,200 @@
|
|||
/*
|
||||
This file is part of the KDE Libraries
|
||||
|
||||
Copyright (C) 2006 Pino Toscano <toscano.pino@tiscali.it>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <QTest>
|
||||
|
||||
#include <QTestEvent>
|
||||
|
||||
#include <QList>
|
||||
#include <QRadioButton>
|
||||
#include <QSignalSpy>
|
||||
#include <QBoxLayout>
|
||||
|
||||
#include "kbuttongrouptest.h"
|
||||
#include "kbuttongroup.h"
|
||||
|
||||
KButtonGroup *kbuttongroup;
|
||||
QList<QRadioButton *> buttons;
|
||||
|
||||
void KButtonGroupTest::initTestCase()
|
||||
{
|
||||
kbuttongroup = new KButtonGroup();
|
||||
QVBoxLayout *lay2 = new QVBoxLayout(kbuttongroup);
|
||||
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
QRadioButton *r = new QRadioButton(kbuttongroup);
|
||||
r->setText(QString("radio%1").arg(i));
|
||||
lay2->addWidget(r);
|
||||
buttons << r;
|
||||
}
|
||||
|
||||
QCOMPARE(kbuttongroup->selected(), -1);
|
||||
}
|
||||
|
||||
void KButtonGroupTest::directSelectionTestCase()
|
||||
{
|
||||
// test where setSelected is called before the
|
||||
// ensurePolished() is called.
|
||||
KButtonGroup *kbuttongroup2 = new KButtonGroup();
|
||||
kbuttongroup2->setSelected(3);
|
||||
|
||||
QVBoxLayout *lay2 = new QVBoxLayout(kbuttongroup2);
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
QRadioButton *r = new QRadioButton(kbuttongroup2);
|
||||
r->setText(QString("radio%1").arg(i));
|
||||
lay2->addWidget(r);
|
||||
buttons << r;
|
||||
}
|
||||
|
||||
QTest::qWait(250); // events should occur.
|
||||
QCOMPARE(kbuttongroup2->selected(), 3);
|
||||
}
|
||||
|
||||
void KButtonGroupTest::cleanupTestCase()
|
||||
{
|
||||
kbuttongroup->deleteLater();
|
||||
}
|
||||
|
||||
void KButtonGroupTest::testEmptyGroup()
|
||||
{
|
||||
KButtonGroup kemptybuttongroup;
|
||||
QCOMPARE(kemptybuttongroup.selected(), -1);
|
||||
|
||||
kemptybuttongroup.setSelected(5);
|
||||
QCOMPARE(kemptybuttongroup.selected(), -1);
|
||||
|
||||
QRadioButton radio1("Radio button 1");
|
||||
QCOMPARE(kemptybuttongroup.id(&radio1), -1);
|
||||
}
|
||||
|
||||
void KButtonGroupTest::testId()
|
||||
{
|
||||
QCOMPARE(kbuttongroup->id(buttons[1]), 1);
|
||||
}
|
||||
|
||||
void KButtonGroupTest::testClicks()
|
||||
{
|
||||
QTest::mouseClick(buttons[3], Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(), 10);
|
||||
QCOMPARE(kbuttongroup->selected(), 3);
|
||||
|
||||
QTest::mouseClick(buttons[5], Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(), 10);
|
||||
QCOMPARE(kbuttongroup->selected(), 5);
|
||||
|
||||
QTest::mouseClick(buttons[7], Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(), 10);
|
||||
QCOMPARE(kbuttongroup->selected(), 7);
|
||||
|
||||
QTest::mouseClick(buttons[1], Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(), 10);
|
||||
QCOMPARE(kbuttongroup->selected(), 1);
|
||||
|
||||
// QRadioButton's react only to LMB click events
|
||||
QTest::mouseClick(buttons[5], Qt::RightButton, Qt::KeyboardModifiers(), QPoint(), 10);
|
||||
QCOMPARE(kbuttongroup->selected(), 1);
|
||||
QTest::mouseClick(buttons[5], Qt::MidButton, Qt::KeyboardModifiers(), QPoint(), 10);
|
||||
QCOMPARE(kbuttongroup->selected(), 1);
|
||||
}
|
||||
|
||||
void KButtonGroupTest::testManualSelection()
|
||||
{
|
||||
kbuttongroup->setSelected(3);
|
||||
QCOMPARE(kbuttongroup->selected(), 3);
|
||||
|
||||
kbuttongroup->setSelected(0);
|
||||
QCOMPARE(kbuttongroup->selected(), 0);
|
||||
|
||||
kbuttongroup->setSelected(7);
|
||||
QCOMPARE(kbuttongroup->selected(), 7);
|
||||
|
||||
kbuttongroup->setSelected(2);
|
||||
QCOMPARE(kbuttongroup->selected(), 2);
|
||||
|
||||
// "bad" cases: ask for an invalid id -- the selection should not change
|
||||
kbuttongroup->setSelected(10);
|
||||
QCOMPARE(kbuttongroup->selected(), 2);
|
||||
kbuttongroup->setSelected(-1);
|
||||
QCOMPARE(kbuttongroup->selected(), 2);
|
||||
}
|
||||
|
||||
void KButtonGroupTest::testSignals()
|
||||
{
|
||||
QSignalSpy spyClicked(kbuttongroup, SIGNAL(clicked(int)));
|
||||
QSignalSpy spyPressed(kbuttongroup, SIGNAL(pressed(int)));
|
||||
QSignalSpy spyReleased(kbuttongroup, SIGNAL(released(int)));
|
||||
QSignalSpy spyChanged(kbuttongroup, SIGNAL(changed(int)));
|
||||
|
||||
QTest::mouseClick(buttons[2], Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(), 10);
|
||||
QCOMPARE(spyClicked.count(), 1);
|
||||
QCOMPARE(spyPressed.count(), 1);
|
||||
QCOMPARE(spyReleased.count(), 1);
|
||||
QCOMPARE(spyChanged.count(), 1);
|
||||
QList<QVariant> args = spyClicked.last();
|
||||
QList<QVariant> args2 = spyPressed.last();
|
||||
QList<QVariant> args3 = spyReleased.last();
|
||||
QCOMPARE(args.first().toInt(), 2);
|
||||
QCOMPARE(args2.first().toInt(), 2);
|
||||
QCOMPARE(args3.first().toInt(), 2);
|
||||
QCOMPARE(kbuttongroup->selected(), 2);
|
||||
|
||||
QTest::mouseClick(buttons[6], Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(), 10);
|
||||
QCOMPARE(spyClicked.count(), 2);
|
||||
QCOMPARE(spyPressed.count(), 2);
|
||||
QCOMPARE(spyReleased.count(), 2);
|
||||
QCOMPARE(spyChanged.count(), 2);
|
||||
args = spyClicked.last();
|
||||
args2 = spyPressed.last();
|
||||
args3 = spyReleased.last();
|
||||
QCOMPARE(args.first().toInt(), 6);
|
||||
QCOMPARE(args2.first().toInt(), 6);
|
||||
QCOMPARE(args3.first().toInt(), 6);
|
||||
QCOMPARE(kbuttongroup->selected(), 6);
|
||||
|
||||
// click with RMB on a radio -> no signal
|
||||
QTest::mouseClick(buttons[0], Qt::RightButton, Qt::KeyboardModifiers(), QPoint(), 10);
|
||||
QCOMPARE(spyClicked.count(), 2);
|
||||
QCOMPARE(spyPressed.count(), 2);
|
||||
QCOMPARE(spyReleased.count(), 2);
|
||||
QCOMPARE(spyChanged.count(), 2);
|
||||
QCOMPARE(kbuttongroup->selected(), 6);
|
||||
|
||||
// manual selections
|
||||
kbuttongroup->setSelected(7);
|
||||
QCOMPARE(spyChanged.count(), 3);
|
||||
QList<QVariant> args4 = spyChanged.last();
|
||||
QCOMPARE(args4.first().toInt(), 7);
|
||||
QCOMPARE(kbuttongroup->selected(), 7);
|
||||
|
||||
kbuttongroup->setSelected(2);
|
||||
QCOMPARE(spyChanged.count(), 4);
|
||||
args4 = spyChanged.last();
|
||||
QCOMPARE(args4.first().toInt(), 2);
|
||||
QCOMPARE(kbuttongroup->selected(), 2);
|
||||
|
||||
// "bad" cases: ask for an invalid id -- the selection should not change
|
||||
kbuttongroup->setSelected(10);
|
||||
QCOMPARE(spyChanged.count(), 4);
|
||||
QCOMPARE(kbuttongroup->selected(), 2);
|
||||
|
||||
kbuttongroup->setSelected(-1);
|
||||
QCOMPARE(spyChanged.count(), 4);
|
||||
QCOMPARE(kbuttongroup->selected(), 2);
|
||||
}
|
||||
|
||||
QTEST_MAIN(KButtonGroupTest)
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
This file is part of the KDE Libraries
|
||||
|
||||
Copyright (C) 2006 Pino Toscano <toscano.pino@tiscali.it>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KBUTTONGROUPTEST_H
|
||||
#define KBUTTONGROUPTEST_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class KButtonGroupTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void directSelectionTestCase();
|
||||
void cleanupTestCase();
|
||||
|
||||
void testEmptyGroup();
|
||||
void testId();
|
||||
void testClicks();
|
||||
void testManualSelection();
|
||||
void testSignals();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
Copyright 2005 Brad Hards <bradh@kde.org>
|
||||
Copyright 2007, 2009, 2010, 2011 John Layt <john@layt.net>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KCALENDARTEST_H
|
||||
#define KCALENDARTEST_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "klocale.h"
|
||||
|
||||
class QString;
|
||||
class QDate;
|
||||
|
||||
class KCalendarSystem;
|
||||
|
||||
class KCalendarTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
protected:
|
||||
void testCalendarSystemType(const KCalendarSystem *calendar,
|
||||
KLocale::CalendarSystem system,
|
||||
const QString &type, const QString &label);
|
||||
void testValid(const KCalendarSystem *calendar, int lowInvalidYear, int highInvalidYear,
|
||||
int highInvalidMonth, int highInvalidDay, const QDate &invalidDate);
|
||||
void testEpoch(const KCalendarSystem *calendar, int y, int m, int d, int jd);
|
||||
void testEarliestValidDate(const KCalendarSystem *calendar, int y, int m, int d, int jd);
|
||||
void testLatestValidDate(const KCalendarSystem *calendar, int y, int m, int d, int jd);
|
||||
void testYear(const KCalendarSystem *calendar, const QDate &date,
|
||||
int year, const QString &shortString, const QString &longString);
|
||||
void testMonth(const KCalendarSystem *calendar, const QDate &date,
|
||||
int month, const QString &shortString, const QString &longString);
|
||||
void testDay(const KCalendarSystem *calendar, const QDate &date,
|
||||
int day, const QString &shortString, const QString &longString);
|
||||
void testEraDate(const KCalendarSystem *calendar, const QDate &date,
|
||||
int yearInEra, const QString &shortYearInEraString, const QString &longYearInEraString,
|
||||
const QString &shortEraName, const QString &longEraName);
|
||||
void testYmd(const KCalendarSystem *calendar, int y, int m, int d, int jd);
|
||||
void testWeekDayName(const KCalendarSystem *calendar, int weekDay, const QDate &date,
|
||||
const QString &narrowName, const QString &shortName, const QString &longName);
|
||||
void testMonthName(const KCalendarSystem *calendar, int month, int year, const QDate &date,
|
||||
const QString &narrowName, const QString &shortName, const QString &longName,
|
||||
const QString &shortNamePossessive, const QString &longNamePossessive);
|
||||
|
||||
void testStrings(KLocale::DigitSet testDigitSet);
|
||||
QDate setDayOfYearDate(const KCalendarSystem *calendar, int year, int dayOfYear);
|
||||
void compareDateDifference(const KCalendarSystem *calendar,
|
||||
const QDate &lowDate, const QDate &highDate,
|
||||
int yearsDiff, int monthsDiff, int daysDiff);
|
||||
void compareYearDifference(const KCalendarSystem *calendar,
|
||||
const QDate &lowDate, const QDate &highDate,
|
||||
int yearsDiff);
|
||||
void compareMonthDifference(const KCalendarSystem *calendar,
|
||||
const QDate &lowDate, const QDate &highDate,
|
||||
int monthsDiff);
|
||||
QDate setIsoWeekDate(const KCalendarSystem *calendar, int year, int isoWeek, int dayOfWeek);
|
||||
QDate setEraDate(const KCalendarSystem *calendar, const QString &era, int yearInEra, int month, int day);
|
||||
void testRoundTrip(const KCalendarSystem *calendar, bool testFullRange = false);
|
||||
void compareFormatUnicode(const KCalendarSystem *calendar, const QDate &testDate, const QString &testFormat);
|
||||
|
||||
private Q_SLOTS:
|
||||
void testTypes();
|
||||
void testFormatDate();
|
||||
void testFormatUnicode();
|
||||
void testReadDate();
|
||||
void testStringForms();
|
||||
void testHebrewStrings();
|
||||
void testIsoWeekDate();
|
||||
void testDayOfYearDate();
|
||||
void testDateDifference();
|
||||
void testFirstLast();
|
||||
void testEra();
|
||||
void testGregorianCalendar();
|
||||
void testHebrew();
|
||||
void testIndianNational();
|
||||
void testIslamicCivil();
|
||||
void testGregorianCalendarBasic();
|
||||
void testGregorianCalendarYmd();
|
||||
void testGregorianCalendarSpecialCases();
|
||||
void testHebrewBasic();
|
||||
void testHebrewYmd();
|
||||
void testHebrewCompare();
|
||||
void testIslamicCivilBasic();
|
||||
void testIslamicCivilYmd();
|
||||
void testJalaliBasic();
|
||||
void testJalaliYmd();
|
||||
void testJapanese();
|
||||
void testJapaneseBasic();
|
||||
void testJapaneseYmd();
|
||||
void testJapaneseSpecialCases();
|
||||
void testMinguoBasic();
|
||||
void testThaiBasic();
|
||||
void testGregorianAddYears();
|
||||
void testGregorianAddMonths();
|
||||
void testGregorianAddDays();
|
||||
void testGregorianDaysInYear();
|
||||
void testGregorianDaysInMonth();
|
||||
void testGregorianDayOfYear();
|
||||
void testGregorianDayOfWeek();
|
||||
void testGregorianIsLeapYear();
|
||||
void testKLocalizedDate();
|
||||
void testWeekNumberSystem();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,52 @@
|
|||
/* This file is part of the KDE project
|
||||
|
||||
Copyright 1999 Waldo Bastian <bastian@kde.org>
|
||||
Copyright 2014 Albert Astals Cid <aacid@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published
|
||||
by the Free Software Foundation; either version 2 of the License or
|
||||
( at your option ) version 3 or, at the discretion of KDE e.V.
|
||||
( which shall act as a proxy as in section 14 of the GPLv3 ), any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <QTest>
|
||||
|
||||
#include <kcmdlineargs.h>
|
||||
|
||||
class KCmdLineArgsTest : public QObject
|
||||
{
|
||||
public Q_SLOTS:
|
||||
void testmakeURL()
|
||||
{
|
||||
// Check how KCmdLineArgs::url() works
|
||||
QUrl u = KCmdLineArgs::makeURL(QByteArray("/tmp"));
|
||||
QCOMPARE(u.toLocalFile(), QLatin1String("/tmp"));
|
||||
u = KCmdLineArgs::makeURL(QByteArray("foo"));
|
||||
QCOMPARE(u.toLocalFile(), QDir::currentPath() + QLatin1String("/foo"));
|
||||
u = KCmdLineArgs::makeURL(QByteArray("http://www.kde.org"));
|
||||
QCOMPARE(u.toString(), QLatin1String("http://www.kde.org"));
|
||||
|
||||
QFile file(QLatin1String("a:b"));
|
||||
#ifndef Q_OS_WIN
|
||||
bool ok = file.open(QIODevice::WriteOnly);
|
||||
Q_UNUSED(ok) // silence warnings
|
||||
QVERIFY(ok);
|
||||
#endif
|
||||
u = KCmdLineArgs::makeURL(QByteArray("a:b"));
|
||||
QVERIFY(u.isLocalFile());
|
||||
QVERIFY(u.toLocalFile().endsWith(QLatin1String("a:b")));
|
||||
}
|
||||
};
|
||||
|
||||
QTEST_MAIN(KCmdLineArgsTest)
|
|
@ -0,0 +1,64 @@
|
|||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QtGlobal>
|
||||
#include <kcomponentdata.h>
|
||||
#include <ksharedconfig.h>
|
||||
#include <kconfiggroup.h>
|
||||
|
||||
class Tester
|
||||
{
|
||||
public:
|
||||
void initConfig();
|
||||
~Tester();
|
||||
|
||||
private:
|
||||
KConfig *m_config;
|
||||
};
|
||||
|
||||
void Tester::initConfig()
|
||||
{
|
||||
m_config = new KConfig("kconfigafterkglobaltest");
|
||||
}
|
||||
|
||||
Q_GLOBAL_STATIC(Tester, globalTestObject)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
Tester *t = globalTestObject();
|
||||
Q_UNUSED(t);
|
||||
|
||||
QCoreApplication app(argc, argv);
|
||||
KComponentData componentData("kconfigafterkglobaltest");
|
||||
|
||||
t->initConfig();
|
||||
}
|
||||
|
||||
Tester::~Tester()
|
||||
{
|
||||
// the KGlobal K_GLOBAL_STATIC should already be deleted
|
||||
// If this fails, check that a new global static in kdecore didn't create KGlobal indirectly;
|
||||
// e.g. this can happen if someone writes 'static int s_area = KDebug::registerArea("foo");' in
|
||||
// a .cpp file, rather than using a function.
|
||||
Q_ASSERT(!KComponentData::hasMainComponent());
|
||||
KConfigGroup group = m_config->group("test");
|
||||
group.writeEntry("test", 1);
|
||||
delete m_config; // this calls KConfig::sync() which needs KLocale::global()
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QtGlobal>
|
||||
#include <kcomponentdata.h>
|
||||
#include <ksharedconfig.h>
|
||||
#include <kconfiggroup.h>
|
||||
|
||||
class Tester
|
||||
{
|
||||
public:
|
||||
void initConfig();
|
||||
~Tester();
|
||||
|
||||
private:
|
||||
KConfig *m_config;
|
||||
};
|
||||
|
||||
void Tester::initConfig()
|
||||
{
|
||||
m_config = new KConfig("kconfigafterkglobaltest");
|
||||
}
|
||||
|
||||
Q_GLOBAL_STATIC(Tester, globalTestObject)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
Tester *t = globalTestObject();
|
||||
Q_UNUSED(t);
|
||||
|
||||
QCoreApplication app(argc, argv);
|
||||
KComponentData componentData("kconfigafterkglobaltest");
|
||||
|
||||
KSharedConfigPtr cfg = KSharedConfig::openConfig();
|
||||
KConfigGroup group = cfg->group("test");
|
||||
group.writeEntry("test", 1);
|
||||
|
||||
t->initConfig();
|
||||
}
|
||||
|
||||
Tester::~Tester()
|
||||
{
|
||||
Q_ASSERT(!KComponentData::hasMainComponent()); // the KGlobal K_GLOBAL_STATIC should already be deleted
|
||||
KConfigGroup group = m_config->group("test");
|
||||
group.writeEntry("test", 1);
|
||||
delete m_config; // this calls KConfig::sync() which needs KStandardDirs
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (C) 2011 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <qtest_kde.h>
|
||||
|
||||
#include <ksharedconfig.h>
|
||||
|
||||
#include <kconfig.h>
|
||||
#include <kconfiggroup.h>
|
||||
#include <kconfiggroup_kurl.h>
|
||||
#include <qstandardpaths.h>
|
||||
|
||||
class KConfigCompatTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void testKUrl();
|
||||
void testDefaultName();
|
||||
void cleanupTestCase();
|
||||
};
|
||||
|
||||
void KConfigCompatTest::initTestCase()
|
||||
{
|
||||
// Qt5 TODO: should be done by qtestlib+qstandardpaths
|
||||
QString xdgConfigHome = QDir::home().canonicalPath() + "/.qttest/config";
|
||||
qputenv("XDG_CONFIG_HOME", QFile::encodeName(xdgConfigHome));
|
||||
}
|
||||
|
||||
void KConfigCompatTest::cleanupTestCase()
|
||||
{
|
||||
QFile::remove(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1String("/kconfig_compat_test"));
|
||||
}
|
||||
|
||||
void KConfigCompatTest::testKUrl()
|
||||
{
|
||||
KConfig config("kconfig_compat_test");
|
||||
{
|
||||
KConfigGroup cg(&config, "Group");
|
||||
cg.writeEntry("kurlEntry", KUrl("http://www.kde.org")); // DO NOT PORT TO QUrl
|
||||
}
|
||||
{
|
||||
KConfigGroup cg(&config, "Group");
|
||||
QCOMPARE(cg.readEntry("kurlEntry", KUrl()), KUrl("http://www.kde.org"));
|
||||
}
|
||||
}
|
||||
|
||||
void KConfigCompatTest::testDefaultName()
|
||||
{
|
||||
QCOMPARE(KSharedConfig::openConfig()->name(), QString::fromLatin1("myapprc"));
|
||||
QCOMPARE(KGlobal::config()->name(), QString::fromLatin1("myapprc"));
|
||||
}
|
||||
|
||||
QTEST_KDEMAIN_CORE_WITH_COMPONENTNAME(KConfigCompatTest, "myapp")
|
||||
|
||||
#include "kconfigcompattest.moc"
|
|
@ -0,0 +1,368 @@
|
|||
/*
|
||||
Copyright 2010 John Layt <john@layt.net>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "kdatetimeformattertest.h"
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <QTest>
|
||||
#include "kdatetime.h"
|
||||
#include "kcalendarsystem.h"
|
||||
#include "klocale.h"
|
||||
#include "kconfiggroup.h"
|
||||
|
||||
QTEST_MAIN(KDateTimeFormatterTest)
|
||||
|
||||
void KDateTimeFormatterTest::testFormatDateTimePosix()
|
||||
{
|
||||
KLocale::global()->setLanguage(QStringList("en_US"));
|
||||
KLocale::global()->setCalendarSystem(KLocale::QDateCalendar);
|
||||
KLocale::global()->setDateFormatShort("%y-%m-%d");
|
||||
|
||||
KDateTimeFormatter formatter;
|
||||
|
||||
//Test default settings
|
||||
KDateTime testDate(QDate(2005, 10, 20));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Y"), QString("2005"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%C"), QString("20"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%y"), QString("05"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%m"), QString("10"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%n"), QString("10"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%d"), QString("20"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%e"), QString("20"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%B"), QString("October"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%b"), QString("Oct"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%h"), QString("Oct"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%A"), QString("Thursday"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%a"), QString("Thu"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%j"), QString("293"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%V"), QString("42"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%G"), QString("2005"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%g"), QString("05"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%u"), QString("4"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%D"), QString("10/20/05"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%F"), QString("2005-10-20"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%x"), QString("05-10-20"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%%"), QString("%"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%t"), QString("\t"));
|
||||
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "-%Y-%C-%y-%m-%n-%d-%e-%B-%b-%h-%A-%a-%j-%V-%G-%g-%u:%D:%F:%x:%%-%t-"),
|
||||
QString("-2005-20-05-10-10-20-20-October-Oct-Oct-Thursday-Thu-293-42-2005-05-4:10/20/05:2005-10-20:05-10-20:%-\t-"));
|
||||
|
||||
//Test the minimum widths are respected
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1Y"), QString("2005"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1C"), QString("20"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1y"), QString("05"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1m"), QString("10"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1n"), QString("10"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1d"), QString("20"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1e"), QString("20"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%01B"), QString("October"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%01b"), QString("Oct"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%01h"), QString("Oct"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%01A"), QString("Thursday"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%01a"), QString("Thu"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1j"), QString("293"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1V"), QString("42"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1G"), QString("2005"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1g"), QString("05"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1u"), QString("4"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1D"), QString("10/20/05"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1F"), QString("2005-10-20"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1x"), QString("05-10-20"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1%"), QString("%"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1t"), QString("\t"));
|
||||
|
||||
testDate.setDate(QDate(2005, 1, 2));
|
||||
|
||||
//Test various padding options with minimum width
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%"), QString(""));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%m"), QString("01"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%n"), QString("1"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%d"), QString("02"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%e"), QString("2"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%j"), QString("002"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_m"), QString(" 1"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_n"), QString("1"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_d"), QString(" 2"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_e"), QString("2"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_j"), QString(" 2"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-m"), QString("1"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-n"), QString("1"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-d"), QString("2"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-e"), QString("2"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-j"), QString("2"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0m"), QString("01"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0n"), QString("1"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0d"), QString("02"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0e"), QString("2"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0j"), QString("002"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-_j"), QString(" 2"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_-j"), QString("2"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-_0j"), QString("002"));
|
||||
|
||||
//Test various padding options with width override
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1m"), QString("01"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-05m"), QString("00001"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%10m"), QString("0000000001"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%15m"), QString("000000000000001"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-5m"), QString("1"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_5m"), QString(" 1"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_15m"), QString(" 1"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%1B"), QString("January"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%15B"), QString(" January"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-15B"), QString("January"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_15B"), QString(" January"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%015B"), QString("00000000January"));
|
||||
|
||||
//Test week number in previous year
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%V"), QString("53"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%G"), QString("2004"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%g"), QString("04"));
|
||||
|
||||
//test case overrides
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%B"), QString("January"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%^B"), QString("JANUARY"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%#B"), QString("JANUARY"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%m"), QString("01"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%^m"), QString("01"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%#m"), QString("01"));
|
||||
|
||||
//Test various year options
|
||||
|
||||
testDate.setDate(QDate(789, 1, 1));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Y"), QString("0789"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%C"), QString("07"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%y"), QString("89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-Y"), QString("789"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-C"), QString("7"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-y"), QString("89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_Y"), QString(" 789"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_C"), QString(" 7"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_y"), QString("89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0Y"), QString("0789"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0C"), QString("07"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0y"), QString("89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EC"), QString("AD"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Ey"), QString("789"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EY"), QString("789 AD"));
|
||||
|
||||
testDate.setDate(QDate(709, 1, 1));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Y"), QString("0709"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%C"), QString("07"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%y"), QString("09"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-Y"), QString("709"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-C"), QString("7"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-y"), QString("9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_Y"), QString(" 709"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_C"), QString(" 7"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_y"), QString(" 9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0Y"), QString("0709"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0C"), QString("07"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0y"), QString("09"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EC"), QString("AD"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Ey"), QString("709"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EY"), QString("709 AD"));
|
||||
|
||||
testDate.setDate(QDate(89, 1, 1));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Y"), QString("0089"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%C"), QString("00"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%y"), QString("89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-Y"), QString("89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-C"), QString("0"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-y"), QString("89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_Y"), QString(" 89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_C"), QString(" 0"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_y"), QString("89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0Y"), QString("0089"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0C"), QString("00"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0y"), QString("89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EC"), QString("AD"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Ey"), QString("89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EY"), QString("89 AD"));
|
||||
|
||||
testDate.setDate(QDate(9, 1, 1));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Y"), QString("0009"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%C"), QString("00"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%y"), QString("09"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-Y"), QString("9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-C"), QString("0"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-y"), QString("9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_Y"), QString(" 9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_C"), QString(" 0"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_y"), QString(" 9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0Y"), QString("0009"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0C"), QString("00"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0y"), QString("09"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EC"), QString("AD"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Ey"), QString("9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EY"), QString("9 AD"));
|
||||
|
||||
testDate.setDate(QDate(-9, 1, 1));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Y"), QString("-0009"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%C"), QString("-00"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%y"), QString("-09"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-Y"), QString("-9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-C"), QString("-0"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-y"), QString("-9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_Y"), QString(" -9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_C"), QString("-0"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_y"), QString("-9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0Y"), QString("-0009"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0C"), QString("-00"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0y"), QString("-09"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EC"), QString("BC"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Ey"), QString("9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EY"), QString("9 BC"));
|
||||
|
||||
testDate.setDate(QDate(-89, 1, 1));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Y"), QString("-0089"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%C"), QString("-00"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%y"), QString("-89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-Y"), QString("-89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-C"), QString("-0"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-y"), QString("-89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_Y"), QString(" -89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_C"), QString("-0"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_y"), QString("-89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0Y"), QString("-0089"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0C"), QString("-00"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0y"), QString("-89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EC"), QString("BC"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Ey"), QString("89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EY"), QString("89 BC"));
|
||||
|
||||
testDate.setDate(QDate(-789, 1, 1));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Y"), QString("-0789"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%C"), QString("-07"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%y"), QString("-89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-Y"), QString("-789"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-C"), QString("-7"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-y"), QString("-89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_Y"), QString("-789"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_C"), QString("-7"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_y"), QString("-89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0Y"), QString("-0789"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0C"), QString("-07"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0y"), QString("-89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EC"), QString("BC"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Ey"), QString("789"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EY"), QString("789 BC"));
|
||||
|
||||
testDate.setDate(QDate(-709, 1, 1));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Y"), QString("-0709"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%C"), QString("-07"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%y"), QString("-09"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-Y"), QString("-709"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-C"), QString("-7"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-y"), QString("-9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_Y"), QString("-709"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_C"), QString("-7"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_y"), QString("-9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0Y"), QString("-0709"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0C"), QString("-07"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0y"), QString("-09"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EC"), QString("BC"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Ey"), QString("709"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EY"), QString("709 BC"));
|
||||
|
||||
testDate.setDate(QDate(-1789, 1, 1));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Y"), QString("-1789"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%C"), QString("-17"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%y"), QString("-89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-Y"), QString("-1789"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-C"), QString("-17"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-y"), QString("-89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_Y"), QString("-1789"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_C"), QString("-17"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_y"), QString("-89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0Y"), QString("-1789"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0C"), QString("-17"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0y"), QString("-89"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EC"), QString("BC"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Ey"), QString("1789"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EY"), QString("1789 BC"));
|
||||
|
||||
testDate.setDate(QDate(-1709, 1, 1));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Y"), QString("-1709"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%C"), QString("-17"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%y"), QString("-09"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-Y"), QString("-1709"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-C"), QString("-17"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%-y"), QString("-9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_Y"), QString("-1709"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_C"), QString("-17"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%_y"), QString("-9"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0Y"), QString("-1709"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0C"), QString("-17"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%0y"), QString("-09"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EC"), QString("BC"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%Ey"), QString("1709"));
|
||||
QCOMPARE(formatter.formatDateTime(testDate, "%EY"), QString("1709 BC"));
|
||||
/*
|
||||
// Test POSIX format
|
||||
testDate.setDate( QDate( 2010, 1, 2 ) );
|
||||
QCOMPARE( formatter.formatDateTime( testDate, "%Y-%n-%d", KLocale::KdeFormat ), QString( "2010-1-02" ) );
|
||||
QCOMPARE( formatter.formatDateTime( testDate, "%Y-%n-%d", KLocale::PosixFormat ), QString( "2010-\n-02" ) );
|
||||
QCOMPARE( formatter.formatDateTime( testDate, "%e", KLocale::KdeFormat ), QString( "2" ) );
|
||||
QCOMPARE( formatter.formatDateTime( testDate, "%e", KLocale::PosixFormat ), QString( " 2" ) );
|
||||
*/
|
||||
}
|
||||
|
||||
void KDateTimeFormatterTest::testFormatUnicode()
|
||||
{
|
||||
KLocale::global()->setLanguage(QStringList("en_US"));
|
||||
KLocale::global()->setCalendarSystem(KLocale::QDateCalendar);
|
||||
KLocale::global()->setDateFormatShort("%y-%m-%d");
|
||||
|
||||
KDateTimeFormatter formatter;
|
||||
|
||||
KDateTime testDateTime(QDate(2005, 10, 20));
|
||||
compareFormatUnicode(formatter, testDateTime, "yyyy");
|
||||
compareFormatUnicode(formatter, testDateTime, "yy");
|
||||
compareFormatUnicode(formatter, testDateTime, "MMMM");
|
||||
compareFormatUnicode(formatter, testDateTime, "MMM");
|
||||
compareFormatUnicode(formatter, testDateTime, "MM");
|
||||
compareFormatUnicode(formatter, testDateTime, "M");
|
||||
compareFormatUnicode(formatter, testDateTime, "dddd");
|
||||
compareFormatUnicode(formatter, testDateTime, "ddd");
|
||||
compareFormatUnicode(formatter, testDateTime, "dd");
|
||||
compareFormatUnicode(formatter, testDateTime, "d");
|
||||
compareFormatUnicode(formatter, testDateTime, "yyyy-MM-dd");
|
||||
|
||||
testDateTime.setDate(QDate(-2005, 10, 20));
|
||||
compareFormatUnicode(formatter, testDateTime, "yyyy");
|
||||
compareFormatUnicode(formatter, testDateTime, "yy");
|
||||
compareFormatUnicode(formatter, testDateTime, "MMMM");
|
||||
compareFormatUnicode(formatter, testDateTime, "MMM");
|
||||
compareFormatUnicode(formatter, testDateTime, "MM");
|
||||
compareFormatUnicode(formatter, testDateTime, "M");
|
||||
compareFormatUnicode(formatter, testDateTime, "dddd");
|
||||
compareFormatUnicode(formatter, testDateTime, "ddd");
|
||||
compareFormatUnicode(formatter, testDateTime, "dd");
|
||||
compareFormatUnicode(formatter, testDateTime, "d");
|
||||
compareFormatUnicode(formatter, testDateTime, "yyyy-MM-dd");
|
||||
}
|
||||
|
||||
void KDateTimeFormatterTest::compareFormatUnicode(KDateTimeFormatter formatter, const KDateTime &testDateTime, const QString &testFormat)
|
||||
{
|
||||
QCOMPARE(formatter.formatDateTime(testDateTime, testFormat, KLocale::TimeFormatOptions(), KLocale::global()->calendar(), KLocale::global(), KLocale::global()->dateTimeDigitSet(), KLocale::UnicodeFormat), testDateTime.dateTime().toString(testFormat));
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
Copyright 2010 John Layt <john@layt.net>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KDATETIMEFORMATTERTEST_H
|
||||
#define KDATETIMEFORMATTERTEST_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "kdatetimeformatter_p.h"
|
||||
|
||||
class QString;
|
||||
class QDate;
|
||||
|
||||
class KCalendarSystem;
|
||||
|
||||
class KDateTimeFormatterTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
protected:
|
||||
void compareFormatUnicode(KDateTimeFormatter formatter, const KDateTime &testDateTime, const QString &testFormat);
|
||||
|
||||
private Q_SLOTS:
|
||||
void testFormatDateTimePosix();
|
||||
void testFormatUnicode();
|
||||
|
||||
};
|
||||
|
||||
#endif // KDATETIMEFORMATTERTEST_H
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,63 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005,2011 David Jarvie <djarvie@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KDATETIMETEST_H
|
||||
#define KDATETIMETEST_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class KDateTimeTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
void specConstructors();
|
||||
void specSet();
|
||||
void constructors();
|
||||
void toUtc();
|
||||
void toOffsetFromUtc();
|
||||
void toLocalZone();
|
||||
void toClockTime();
|
||||
void toZone();
|
||||
void toTimeSpec();
|
||||
void set();
|
||||
void equal();
|
||||
void lessThan();
|
||||
void compare();
|
||||
void addSubtract();
|
||||
void addMSecs();
|
||||
void addSubtractDate();
|
||||
void dstShifts();
|
||||
void strings_iso8601();
|
||||
void strings_rfc2822();
|
||||
void strings_rfc3339();
|
||||
void strings_qttextdate();
|
||||
void strings_format();
|
||||
#ifdef COMPILING_TESTS
|
||||
void cache();
|
||||
#endif
|
||||
void stream();
|
||||
void misc();
|
||||
private:
|
||||
void removeDir(const QString &subdir);
|
||||
QString mDataDir;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,102 @@
|
|||
/* This file is part of the KDE project
|
||||
Copyright (C) 2010 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
|
||||
*/
|
||||
|
||||
// Emulate being compiled in debug mode, so that kDebug(0) defaults to "on"
|
||||
#undef QT_NO_DEBUG
|
||||
|
||||
// TODO: a separate test program with #define QT_NO_DEBUG...
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QtGlobal>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include <qstandardpaths.h>
|
||||
#include <kcomponentdata.h>
|
||||
#include <klocalizedstring.h>
|
||||
#include <kconfiggroup.h>
|
||||
#include <kdebug.h>
|
||||
#include <kcrash.h>
|
||||
|
||||
// This test is actually called by kdebug_unittest
|
||||
// in order to see how kDebug behaves when there is no KComponentData.
|
||||
|
||||
// Disable drkonqi, to avoid warning about it not being found (which breaks kdebug_unittest)
|
||||
void disableDrKonqi()
|
||||
{
|
||||
KCrash::setDrKonqiEnabled(false);
|
||||
}
|
||||
Q_CONSTRUCTOR_FUNCTION(disableDrKonqi)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
|
||||
QStandardPaths::setTestModeEnabled(true);
|
||||
{
|
||||
KConfig config("kdebugrc");
|
||||
config.group(QString()).writeEntry("DisableAll", false); // in case of a global kdebugrc with DisableAll=true
|
||||
}
|
||||
|
||||
// Test kDebug before and after KComponentData gets created
|
||||
|
||||
// Register dynamic area (e.g. from oxygen style)
|
||||
const int myArea = KDebug::registerArea("qcoreapp_myarea");
|
||||
kDebug(myArea) << "Test debug using qcoreapp_myarea" << myArea;
|
||||
|
||||
// Another dynamic area, but it was turned off (well, to file) by kdebug_unittest
|
||||
const int myFileArea = KDebug::registerArea("myarea");
|
||||
kDebug(myFileArea) << "Test logging to file debug using myarea";
|
||||
|
||||
// Test that KDebug works
|
||||
kDebug(264) << "Debug in area 264, off by default, no output";
|
||||
kDebug(100) << "Debug in area 100"; // unknown area, will use area 0 instead
|
||||
// This should appear, but disabling kdebug_qcoreapptest in kdebugdialog should make it go away.";
|
||||
kDebug() << "Simple debug";
|
||||
|
||||
if (KComponentData::hasMainComponent()) {
|
||||
abort();
|
||||
return 2;
|
||||
}
|
||||
|
||||
KConfig config("kdebugrc");
|
||||
Q_ASSERT(!config.hasGroup(QString::number(myArea)));
|
||||
// only true when called by kdebug_unnittest
|
||||
//Q_ASSERT(config.hasGroup("myarea"));
|
||||
//Q_ASSERT(config.group("myarea").readEntry("InfoOutput", 2) == 0);
|
||||
|
||||
if (KComponentData::hasMainComponent()) {
|
||||
abort();
|
||||
return 3;
|
||||
}
|
||||
|
||||
// Test what happens when creating a main component data _now_
|
||||
// In KF5: nothing.
|
||||
KComponentData mainData("kdebug_qcoreapptest_mainData");
|
||||
if (!KComponentData::hasMainComponent()) {
|
||||
abort();
|
||||
return 4;
|
||||
}
|
||||
kDebug() << "This should appear, under the kdebug_qcoreapptest area";
|
||||
kDebug(264) << "Debug in area 264, still off by default";
|
||||
kDebug(100) << "Debug in area 100"; // unknown area, will use area 0 instead
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,371 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2009 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License or ( at
|
||||
your option ) version 3 or, at the discretion of KDE e.V. ( which shall
|
||||
act as a proxy as in section 14 of the GPLv3 ), any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "kdebug_unittest.h"
|
||||
#include <qstandardpaths.h>
|
||||
#include <kconfig.h>
|
||||
#include <kconfiggroup.h>
|
||||
#include <QTest>
|
||||
#include <kdebug.h>
|
||||
#include <QProcess>
|
||||
|
||||
// Set up the env before the first qDebug/qWarning (e.g. from kcrash)
|
||||
void setEnvironmentVariables()
|
||||
{
|
||||
qputenv("KDE_DEBUG_TIMESTAMP", "");
|
||||
qputenv("QT_MESSAGE_PATTERN", "%{appname}(%{pid})/%{category} %{function}: %{message}");
|
||||
}
|
||||
Q_CONSTRUCTOR_FUNCTION(setEnvironmentVariables)
|
||||
|
||||
QTEST_MAIN(KDebugTest)
|
||||
|
||||
void KDebugTest::initTestCase()
|
||||
{
|
||||
// The source files (kdebugrc and kdebug.areas) are in the "global" config dir:
|
||||
qputenv("XDG_CONFIG_DIRS", QFile::encodeName(QFileInfo(QFINDTESTDATA("../src/kdebug.areas")).absolutePath()));
|
||||
|
||||
QStandardPaths::setTestModeEnabled(true);
|
||||
|
||||
QString kdebugrc = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + "kdebugrc";
|
||||
if (!kdebugrc.isEmpty()) {
|
||||
QFile::remove(kdebugrc);
|
||||
}
|
||||
QFile::remove("kdebug.dbg");
|
||||
QFile::remove("myarea.dbg");
|
||||
|
||||
// Check that we can find kdebugrc and kdebug.areas
|
||||
QString filename(QStandardPaths::locate(QStandardPaths::GenericConfigLocation, QLatin1String("kdebug.areas")));
|
||||
QVERIFY2(QFile::exists(filename), filename.toLatin1() + " not found");
|
||||
QVERIFY(QFile::exists(QFINDTESTDATA("../src/kdebugrc")));
|
||||
|
||||
// Now set up logging to file
|
||||
KConfig config("kdebugrc");
|
||||
config.group(QString()).writeEntry("DisableAll", false); // in case of a global kdebugrc with DisableAll=true
|
||||
config.group("180").writeEntry("InfoOutput", 0 /*FileOutput*/);
|
||||
config.group("myarea").writeEntry("InfoOutput", 0 /*FileOutput*/);
|
||||
config.group("myarea").writeEntry("InfoFilename", "myarea.dbg");
|
||||
config.group("kdebug_unittest").writeEntry("InfoOutput", 0 /*FileOutput*/);
|
||||
config.group("kdebug_unittest").writeEntry("WarnOutput", 0 /*FileOutput*/);
|
||||
config.sync();
|
||||
|
||||
//QCOMPARE(KDebug::hasNullOutput(QtDebugMsg, true, 0, false), false);
|
||||
|
||||
// Test for crash that used to happen when using an unknown area after only dynamic areas
|
||||
KDebug::registerArea("somearea"); // gets number 1
|
||||
KDebug::registerArea("someotherarea"); // gets number 2
|
||||
QCOMPARE(KDebug::hasNullOutput(QtDebugMsg, true, 4242, false), false); // unknown area -> area 0 is being used
|
||||
|
||||
kClearDebugConfig();
|
||||
}
|
||||
|
||||
void KDebugTest::cleanupTestCase()
|
||||
{
|
||||
QString kdebugrc = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + "kdebugrc";
|
||||
if (!kdebugrc.isEmpty()) {
|
||||
QFile::remove(kdebugrc);
|
||||
}
|
||||
// TODO QFile::remove("kdebug.dbg");
|
||||
QFile::remove("myarea.dbg");
|
||||
}
|
||||
|
||||
static QList<QByteArray> readLines(const char *fileName = "kdebug.dbg")
|
||||
{
|
||||
const QString path = QFile::decodeName(fileName);
|
||||
Q_ASSERT(!path.isEmpty());
|
||||
Q_ASSERT(QFile::exists(path));
|
||||
QFile file(path);
|
||||
const bool opened = file.open(QIODevice::ReadOnly);
|
||||
Q_ASSERT(opened);
|
||||
Q_UNUSED(opened);
|
||||
QList<QByteArray> lines;
|
||||
QByteArray line;
|
||||
do {
|
||||
line = file.readLine();
|
||||
if (!line.isEmpty()) {
|
||||
lines.append(line);
|
||||
}
|
||||
} while (!line.isEmpty());
|
||||
return lines;
|
||||
}
|
||||
|
||||
void KDebugTest::compareLines(const QList<QByteArray> &expectedLines, const char *fileName)
|
||||
{
|
||||
QList<QByteArray> lines = readLines(fileName);
|
||||
//qDebug() << lines;
|
||||
QCOMPARE(lines.count(), expectedLines.count());
|
||||
QVERIFY(lines[0].endsWith('\n'));
|
||||
for (int i = 0; i < lines.count(); ++i) {
|
||||
QByteArray line = lines[i];
|
||||
if (expectedLines[i].contains("[...]")) {
|
||||
const int pos = line.indexOf('[');
|
||||
QVERIFY(pos >= 0);
|
||||
line.truncate(pos);
|
||||
line.append("[...]\n");
|
||||
}
|
||||
//qDebug() << "line" << i << ":" << line << expectedLines[i];
|
||||
QVERIFY2(line.endsWith(expectedLines[i]), "Got '" + line + "'\nexpected '" + expectedLines[i] + "'");
|
||||
}
|
||||
}
|
||||
|
||||
// Test what happens when a operator<< calls a method that itself uses kDebug,
|
||||
// meaning that two kDebug instances will be active at the same time.
|
||||
// In this case it works, but technically, if area 180 was configured with
|
||||
// a different output file than area 0 then the output would currently go
|
||||
// into the wrong file (because the stream is static) (the "after the call" string
|
||||
// would go into the file for area 180)
|
||||
class TestClass
|
||||
{
|
||||
public:
|
||||
TestClass() {}
|
||||
QString getSomething() const
|
||||
{
|
||||
kDebug(180) << "Nested kDebug call";
|
||||
return "TestClass";
|
||||
}
|
||||
};
|
||||
QDebug operator<<(QDebug s, const TestClass &me)
|
||||
{
|
||||
s << me.getSomething() << "after the call";
|
||||
return s;
|
||||
}
|
||||
|
||||
void KDebugTest::testDebugToFile()
|
||||
{
|
||||
kDebug(180) << "TEST DEBUG 180";
|
||||
kDebug(0) << "TEST DEBUG 0";
|
||||
kWarning() << "TEST WARNING 0";
|
||||
// The calls to kDebug(0) created a dynamic debug area named after the componentdata name
|
||||
KConfig config("kdebugrc");
|
||||
QVERIFY(config.hasGroup("kdebug_unittest"));
|
||||
kDebug(0) << "TEST DEBUG with newline" << endl << "newline";
|
||||
TestClass tc;
|
||||
kDebug(0) << "Re-entrance test" << tc << "[ok]";
|
||||
{
|
||||
KDebug::Block block("block 1");
|
||||
{
|
||||
KDebug::Block block("block 2");
|
||||
}
|
||||
}
|
||||
QVERIFY(QFile::exists("kdebug.dbg"));
|
||||
QList<QByteArray> expected;
|
||||
expected << "/kdecore (kdelibs) KDebugTest::testDebugToFile: TEST DEBUG 180\n";
|
||||
expected << "KDebugTest::testDebugToFile: TEST DEBUG 0\n";
|
||||
expected << "KDebugTest::testDebugToFile: TEST WARNING 0\n";
|
||||
expected << "KDebugTest::testDebugToFile: TEST DEBUG with newline\n";
|
||||
expected << "newline\n";
|
||||
expected << "/kdecore (kdelibs) TestClass::getSomething: Nested kDebug call\n";
|
||||
expected << "Re-entrance test \"TestClass\" after the call [ok]\n";
|
||||
expected << "BEGIN: block 1\n";
|
||||
expected << "BEGIN: block 2\n";
|
||||
expected << "END__: block 2 [...]\n";
|
||||
expected << "END__: block 1 [...]\n";
|
||||
compareLines(expected);
|
||||
}
|
||||
|
||||
void KDebugTest::testDisableArea()
|
||||
{
|
||||
QFile::remove("kdebug.dbg");
|
||||
KConfig config("kdebugrc");
|
||||
config.group("180").writeEntry("InfoOutput", 4 /*NoOutput*/);
|
||||
config.group("kdebug_unittest").writeEntry("InfoOutput", 4 /*NoOutput*/);
|
||||
config.sync();
|
||||
kClearDebugConfig();
|
||||
kDebug(180) << "TEST DEBUG 180 - SHOULD NOT APPEAR";
|
||||
kDebug(0) << "TEST DEBUG 0 - SHOULD NOT APPEAR";
|
||||
{
|
||||
KDebug::Block block("SHOULD NOT APPEAR");
|
||||
kDebug(0) << "msg inside the block, should not appear";
|
||||
}
|
||||
QVERIFY(!QFile::exists("kdebug.dbg"));
|
||||
|
||||
// Re-enable debug, for further tests
|
||||
config.group("180").writeEntry("InfoOutput", 0 /*FileOutput*/);
|
||||
config.group("kdebug_unittest").writeEntry("InfoOutput", 0 /*FileOutput*/);
|
||||
config.sync();
|
||||
kClearDebugConfig();
|
||||
}
|
||||
|
||||
void KDebugTest::testDynamicArea()
|
||||
{
|
||||
const int myArea = KDebug::registerArea("myarea"); // gets number 3
|
||||
QCOMPARE(myArea, 3);
|
||||
KConfig config("kdebugrc");
|
||||
QVERIFY(!config.hasGroup(QString::number(myArea)));
|
||||
QVERIFY(config.hasGroup("myarea"));
|
||||
kDebug(myArea) << "TEST DEBUG using myArea" << myArea;
|
||||
QList<QByteArray> expected;
|
||||
expected << "/myarea KDebugTest::testDynamicArea: TEST DEBUG using myArea 3\n";
|
||||
compareLines(expected, "myarea.dbg");
|
||||
}
|
||||
|
||||
void KDebugTest::testDisabledDynamicArea()
|
||||
{
|
||||
const int verboseArea = KDebug::registerArea("verbosearea", false);
|
||||
QVERIFY(verboseArea > 0);
|
||||
kClearDebugConfig(); // force a sync() of KDebug's own kdebugrc so that it gets written out
|
||||
KConfig config("kdebugrc");
|
||||
QVERIFY(config.hasGroup("verbosearea"));
|
||||
kDebug(verboseArea) << "TEST DEBUG using verboseArea" << verboseArea;
|
||||
}
|
||||
|
||||
static void disableAll(bool dis)
|
||||
{
|
||||
KConfig config("kdebugrc");
|
||||
config.group(QString()).writeEntry("DisableAll", dis);
|
||||
config.sync();
|
||||
kClearDebugConfig();
|
||||
}
|
||||
|
||||
void KDebugTest::testDisableAll()
|
||||
{
|
||||
// Some people really don't like debug output :-)
|
||||
disableAll(true);
|
||||
QFile::remove("kdebug.dbg");
|
||||
kDebug() << "Should not appear";
|
||||
kDebug(123465) << "Unknown area, should not appear either";
|
||||
QVERIFY(!QFile::exists("kdebug.dbg"));
|
||||
// Repair
|
||||
disableAll(false);
|
||||
}
|
||||
|
||||
void KDebugTest::testHasNullOutput()
|
||||
{
|
||||
// When compiling in debug mode:
|
||||
QCOMPARE(KDebug::hasNullOutput(QtDebugMsg, true, 0, true), false);
|
||||
QCOMPARE(KDebug::hasNullOutput(QtDebugMsg, true, 180, true), false);
|
||||
QCOMPARE(KDebug::hasNullOutput(QtDebugMsg, true, 293, true), false);
|
||||
QCOMPARE(KDebug::hasNullOutput(QtDebugMsg, true, 4242, true), false);
|
||||
|
||||
kClearDebugConfig(); // force dropping the cache
|
||||
|
||||
// When compiling in release mode:
|
||||
QCOMPARE(KDebug::hasNullOutput(QtDebugMsg, true, 0, false), false); // controlled by "InfoOutput" key
|
||||
QCOMPARE(KDebug::hasNullOutput(QtDebugMsg, true, 180, false), false); // controlled by "InfoOutput" key
|
||||
QCOMPARE(KDebug::hasNullOutput(QtDebugMsg, true, 293, false), true); // no config -> the default is being used
|
||||
QCOMPARE(KDebug::hasNullOutput(QtDebugMsg, true, 4242, false), false); // unknown area -> area 0 is being used
|
||||
|
||||
// And if we really have no config for area 0 (the app name)
|
||||
KConfig config("kdebugrc");
|
||||
config.deleteGroup("kdebug_unittest");
|
||||
config.sync();
|
||||
kClearDebugConfig();
|
||||
|
||||
QCOMPARE(KDebug::hasNullOutput(QtDebugMsg, true, 0, false), true);
|
||||
QCOMPARE(KDebug::hasNullOutput(QtDebugMsg, true, 293, false), true);
|
||||
QCOMPARE(KDebug::hasNullOutput(QtDebugMsg, true, 4242, false), true);
|
||||
|
||||
// Restore to normal for future tests
|
||||
config.group("kdebug_unittest").writeEntry("InfoOutput", 0 /*FileOutput*/);
|
||||
config.sync();
|
||||
kClearDebugConfig();
|
||||
}
|
||||
|
||||
void KDebugTest::testNoMainComponentData()
|
||||
{
|
||||
// change to the bin dir
|
||||
QDir::setCurrent(QCoreApplication::applicationDirPath());
|
||||
// This test runs kdebug_qcoreapptest and checks its output
|
||||
QProcess proc;
|
||||
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
|
||||
// No process info, to make this easier
|
||||
environment.insert("QT_MESSAGE_PATTERN", "%{category} %{function}: %{message}");
|
||||
proc.setProcessEnvironment(environment);
|
||||
proc.setProcessChannelMode(QProcess::SeparateChannels);
|
||||
#ifdef Q_OS_WIN
|
||||
proc.start("kdebug_qcoreapptest.exe");
|
||||
#else
|
||||
if (QFile::exists("./kdebug_qcoreapptest.shell")) {
|
||||
proc.start("./kdebug_qcoreapptest.shell");
|
||||
} else {
|
||||
QVERIFY(QFile::exists("./kdebug_qcoreapptest"));
|
||||
proc.start("./kdebug_qcoreapptest");
|
||||
}
|
||||
#endif
|
||||
// kDebug() << proc.args();
|
||||
const bool ok = proc.waitForFinished();
|
||||
QVERIFY(ok);
|
||||
const QByteArray allOutput = proc.readAllStandardError();
|
||||
const QList<QByteArray> receivedLines = allOutput.split('\n');
|
||||
//qDebug() << receivedLines;
|
||||
QList<QByteArray> expectedLines;
|
||||
expectedLines << "qcoreapp_myarea main: Test debug using qcoreapp_myarea 1";
|
||||
expectedLines << "kdebug_qcoreapptest main: Debug in area 100";
|
||||
expectedLines << "kdebug_qcoreapptest main: Simple debug";
|
||||
expectedLines << "kdebug_qcoreapptest main: This should appear, under the kdebug_qcoreapptest area";
|
||||
expectedLines << "kdebug_qcoreapptest main: Debug in area 100";
|
||||
expectedLines << ""; // artefact of split, I guess?
|
||||
for (int i = 0; i < qMin(expectedLines.count(), receivedLines.count()); ++i) {
|
||||
QCOMPARE(QString::fromLatin1(receivedLines[i]), QString::fromLatin1(expectedLines[i]));
|
||||
}
|
||||
QCOMPARE(receivedLines.count(), expectedLines.count());
|
||||
QCOMPARE(receivedLines, expectedLines);
|
||||
}
|
||||
|
||||
#include <QThreadPool>
|
||||
#include <QFutureSynchronizer>
|
||||
#include <qtconcurrentrun.h>
|
||||
|
||||
class KDebugThreadTester
|
||||
{
|
||||
public:
|
||||
void doDebugs()
|
||||
{
|
||||
KDEBUG_BLOCK
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
kDebug() << "A kdebug statement in a thread:" << i;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void KDebugTest::testMultipleThreads()
|
||||
{
|
||||
kDebug() << "kDebug works";
|
||||
QVERIFY(QFile::exists("kdebug.dbg"));
|
||||
QFile::remove("kdebug.dbg");
|
||||
|
||||
KDebugThreadTester tester;
|
||||
QThreadPool::globalInstance()->setMaxThreadCount(10);
|
||||
QFutureSynchronizer<void> sync;
|
||||
for (int threadNum = 0; threadNum < 10; ++threadNum) {
|
||||
sync.addFuture(QtConcurrent::run(&tester, &KDebugThreadTester::doDebugs));
|
||||
}
|
||||
sync.waitForFinished();
|
||||
|
||||
QVERIFY(QFile::exists("kdebug.dbg"));
|
||||
|
||||
//QFile f("kdebug.dbg"); f.open(QIODevice::ReadOnly);
|
||||
//qDebug() << QString::fromLatin1(f.readAll());
|
||||
|
||||
// We have no guarantee that the debug lines are issued one after the other.
|
||||
// The \n comes from the destruction of the temp kDebug, and that's not mutexed,
|
||||
// so we can get msg1 + msg2 + \n + \n.
|
||||
// So this test is basically only good for running in helgrind.
|
||||
|
||||
#if 0
|
||||
// Check that the lines are whole
|
||||
QList<QByteArray> lines = readLines();
|
||||
Q_FOREACH (const QByteArray &line, lines) {
|
||||
qDebug() << line;
|
||||
QCOMPARE(line.count("doDebugs"), 1);
|
||||
QCOMPARE(line.count('\n'), 1);
|
||||
QVERIFY(!line.startsWith(" ")); // more than 2 spaces? indentString messed up
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2009 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License or ( at
|
||||
your option ) version 3 or, at the discretion of KDE e.V. ( which shall
|
||||
act as a proxy as in section 14 of the GPLv3 ), any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KDEBUG_UNITTEST_H
|
||||
#define KDEBUG_UNITTEST_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class KDebugTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
|
||||
void testDebugToFile();
|
||||
void testDisableArea();
|
||||
void testDynamicArea();
|
||||
void testDisabledDynamicArea();
|
||||
void testDisableAll();
|
||||
void testHasNullOutput();
|
||||
void testNoMainComponentData();
|
||||
void testMultipleThreads();
|
||||
|
||||
private:
|
||||
void compareLines(const QList<QByteArray> &expectedLines, const char *fileName = "kdebug.dbg");
|
||||
};
|
||||
|
||||
#endif //KDEBUG_UNITTEST_H
|
|
@ -0,0 +1,492 @@
|
|||
/* This file is part of the KDE project
|
||||
|
||||
Copyright 1999-2008 David Faure <faure@kde.org>
|
||||
Copyright 2000-2005 Stephan Kulow <coolo@kde.org>
|
||||
Copyright 2007 Thiago Macieira <thiago@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published
|
||||
by the Free Software Foundation; either version 2 of the License or
|
||||
( at your option ) version 3 or, at the discretion of KDE e.V.
|
||||
( which shall act as a proxy as in section 14 of the GPLv3 ), any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
// to test debug messages, kdebug should be enabled regardless of build mode
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QStringList>
|
||||
#include <QDebug>
|
||||
#undef QT_NO_DEBUG
|
||||
|
||||
#include "kdebug.h"
|
||||
#include <kcomponentdata.h>
|
||||
#include <iostream>
|
||||
#include <QPoint>
|
||||
#include <QRect>
|
||||
#include <QVariant>
|
||||
#include <map>
|
||||
#include <list>
|
||||
|
||||
class TestClass1
|
||||
{
|
||||
public:
|
||||
enum Something { foo };
|
||||
|
||||
void func_void()
|
||||
{
|
||||
KWARNING_NOTIMPLEMENTED
|
||||
}
|
||||
int func_int()
|
||||
{
|
||||
kDebug();
|
||||
return 0;
|
||||
}
|
||||
unsigned func_unsigned()
|
||||
{
|
||||
kDebug();
|
||||
return 0;
|
||||
}
|
||||
long func_long()
|
||||
{
|
||||
kDebug();
|
||||
return 0;
|
||||
}
|
||||
long long func_ll()
|
||||
{
|
||||
kDebug();
|
||||
return 0;
|
||||
}
|
||||
unsigned long long func_ull()
|
||||
{
|
||||
kDebug();
|
||||
return 0;
|
||||
}
|
||||
char func_char()
|
||||
{
|
||||
kDebug();
|
||||
return 0;
|
||||
}
|
||||
signed char func_schar()
|
||||
{
|
||||
kDebug();
|
||||
return 0;
|
||||
}
|
||||
unsigned char func_uchar()
|
||||
{
|
||||
kDebug();
|
||||
return 0;
|
||||
}
|
||||
char *func_Pchar()
|
||||
{
|
||||
kDebug();
|
||||
return nullptr;
|
||||
}
|
||||
const char *func_KPchar()
|
||||
{
|
||||
kDebug();
|
||||
return nullptr;
|
||||
}
|
||||
const volatile char *func_VKPchar()
|
||||
{
|
||||
kDebug();
|
||||
return nullptr;
|
||||
}
|
||||
const volatile unsigned long long *const volatile func_KVPKVull()
|
||||
{
|
||||
kDebug();
|
||||
return nullptr;
|
||||
}
|
||||
const void *const volatile *func_KPKVvoid()
|
||||
{
|
||||
kDebug();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QList<int> func_ai()
|
||||
{
|
||||
kDebug();
|
||||
return QList<int>();
|
||||
}
|
||||
QList<unsigned long long const volatile *> func_aptr()
|
||||
{
|
||||
kDebug();
|
||||
return QList<unsigned long long const volatile *>();
|
||||
}
|
||||
|
||||
QList<Something> func_aenum()
|
||||
{
|
||||
kDebug();
|
||||
return QList<Something>();
|
||||
}
|
||||
QList<QList<const void *> > func_aaptr()
|
||||
{
|
||||
kDebug();
|
||||
return QList<QList<const void *> >();
|
||||
}
|
||||
|
||||
QMap<int, Something> func_ienummap()
|
||||
{
|
||||
kDebug();
|
||||
return QMap<int, Something>();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T *func_template1()
|
||||
{
|
||||
kDebug();
|
||||
return nullptr;
|
||||
}
|
||||
template<Something val>
|
||||
long func_template2()
|
||||
{
|
||||
kDebug();
|
||||
return long(val);
|
||||
}
|
||||
|
||||
typedef unsigned long long *(*fptr)();
|
||||
typedef unsigned long long *(TestClass1::* pmf)();
|
||||
typedef fptr(TestClass1::* uglypmf)();
|
||||
fptr func_fptr()
|
||||
{
|
||||
kDebug();
|
||||
return nullptr;
|
||||
}
|
||||
pmf func_pmf()
|
||||
{
|
||||
kDebug();
|
||||
return nullptr;
|
||||
}
|
||||
uglypmf func_uglypmf(uglypmf = nullptr)
|
||||
{
|
||||
kDebug();
|
||||
return nullptr;
|
||||
}
|
||||
QMap<QString, uglypmf> func_uglypmf2()
|
||||
{
|
||||
kDebug();
|
||||
return QMap<QString, uglypmf>();
|
||||
}
|
||||
|
||||
void testBlock()
|
||||
{
|
||||
KDEBUG_BLOCK
|
||||
func_int();
|
||||
testNestedBlock();
|
||||
}
|
||||
|
||||
void testNestedBlock()
|
||||
{
|
||||
KDEBUG_BLOCK
|
||||
func_void();
|
||||
deprecatedMethod();
|
||||
}
|
||||
|
||||
void testCharStarBlock()
|
||||
{
|
||||
KDebug::Block myBlock(qPrintable(QString::fromLatin1("Block"))); // the char* goes out of scope
|
||||
func_void();
|
||||
deprecatedMethod();
|
||||
}
|
||||
|
||||
void deprecatedMethod()
|
||||
{
|
||||
KWARNING_DEPRECATED
|
||||
}
|
||||
|
||||
public:
|
||||
TestClass1()
|
||||
{
|
||||
// instantiate
|
||||
func_void();
|
||||
func_int();
|
||||
func_unsigned();
|
||||
func_long();
|
||||
func_ll();
|
||||
func_ull();
|
||||
func_char();
|
||||
func_schar();
|
||||
func_uchar();
|
||||
func_Pchar();
|
||||
func_KPchar();
|
||||
func_VKPchar();
|
||||
func_KVPKVull();
|
||||
func_KPKVvoid();
|
||||
func_ai();
|
||||
func_aptr();
|
||||
func_aenum();
|
||||
func_aaptr();
|
||||
func_ienummap();
|
||||
func_template1<TestClass1>();
|
||||
func_template2<foo>();
|
||||
func_fptr();
|
||||
func_pmf();
|
||||
func_uglypmf();
|
||||
func_uglypmf2();
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T> class TestClass2
|
||||
{
|
||||
long func_long()
|
||||
{
|
||||
kDebug();
|
||||
return 0;
|
||||
}
|
||||
template<typename S>
|
||||
T *func_template1()
|
||||
{
|
||||
kDebug();
|
||||
return nullptr;
|
||||
}
|
||||
template<TestClass1::Something val>
|
||||
long func_template2()
|
||||
{
|
||||
kDebug();
|
||||
return long(val);
|
||||
}
|
||||
public:
|
||||
TestClass2()
|
||||
{
|
||||
func_long();
|
||||
func_template1<TestClass2>();
|
||||
func_template2<TestClass1::foo>();
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, TestClass1::Something v> class TestClass3
|
||||
{
|
||||
long func_long()
|
||||
{
|
||||
kDebug();
|
||||
return 0;
|
||||
}
|
||||
template<typename S>
|
||||
S *func_template1()
|
||||
{
|
||||
kDebug();
|
||||
return nullptr;
|
||||
}
|
||||
template<TestClass1::Something val>
|
||||
long func_template2()
|
||||
{
|
||||
kDebug();
|
||||
return long(val);
|
||||
}
|
||||
public:
|
||||
struct Foo {
|
||||
TestClass3 foo;
|
||||
};
|
||||
TestClass3()
|
||||
{
|
||||
func_long();
|
||||
func_template1<TestClass2<T> >();
|
||||
func_template2<TestClass1::foo>();
|
||||
}
|
||||
};
|
||||
|
||||
class TestClass4
|
||||
{
|
||||
TestClass1 c1;
|
||||
|
||||
TestClass2<std::map<long, const void *> > func2()
|
||||
{
|
||||
kDebug();
|
||||
return TestClass2<std::map<long, const void *> >();
|
||||
}
|
||||
TestClass3<std::map<std::list<int>, const void *>, TestClass1::foo>::Foo func3()
|
||||
{
|
||||
kDebug();
|
||||
return TestClass3<std::map<std::list<int>, const void *>, TestClass1::foo>::Foo();
|
||||
}
|
||||
public:
|
||||
TestClass4()
|
||||
{
|
||||
func2();
|
||||
func3();
|
||||
kDebug();
|
||||
}
|
||||
~TestClass4()
|
||||
{
|
||||
kDebug();
|
||||
}
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
class TestClass5
|
||||
{
|
||||
public:
|
||||
TestClass5()
|
||||
{
|
||||
kDebug();
|
||||
}
|
||||
};
|
||||
TestClass5 func5()
|
||||
{
|
||||
kDebug();
|
||||
return TestClass5();
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace N
|
||||
{
|
||||
namespace
|
||||
{
|
||||
class TestClass6
|
||||
{
|
||||
public:
|
||||
TestClass6()
|
||||
{
|
||||
kDebug();
|
||||
}
|
||||
};
|
||||
TestClass6 func6()
|
||||
{
|
||||
kDebug();
|
||||
return TestClass6();
|
||||
}
|
||||
} // namespace
|
||||
} // namespace N
|
||||
|
||||
void testKDebug()
|
||||
{
|
||||
QString test = "%20C this is a string";
|
||||
kDebug(180) << test;
|
||||
QByteArray cstr = test.toLatin1();
|
||||
kDebug(180) << test;
|
||||
QChar ch = 'a';
|
||||
kDebug() << "QChar a: " << ch;
|
||||
ch = '\r';
|
||||
kDebug() << "QChar \\r: " << ch;
|
||||
kDebug() << k_lineinfo << "error on this line";
|
||||
kDebug(2 == 2) << "this is right " << perror;
|
||||
kDebug() << "Before instance creation";
|
||||
kDebug(1202) << "Before instance creation";
|
||||
KComponentData i("kdebugtest");
|
||||
kDebug(1) << "kDebugInfo with inexisting area number";
|
||||
kDebug(1202) << "This number has a value of " << 5;
|
||||
// kDebug() << "This number should come out as appname " << 5 << " " << "test";
|
||||
kWarning() << "1+1 = " << 1 + 1 + 1;
|
||||
kError(1 + 1 != 2) << "there is something really odd!";
|
||||
QString s = "mystring";
|
||||
kDebug() << s;
|
||||
kError(1202) << "Error !!!";
|
||||
kError() << "Error with no area";
|
||||
|
||||
kDebug() << "Printing a null QObject pointer: " << (QObject *)nullptr;
|
||||
|
||||
kDebug() << "char " << '^' << " " << char(26);
|
||||
QPoint p(0, 9);
|
||||
kDebug() << p;
|
||||
|
||||
QRect r(9, 12, 58, 234);
|
||||
kDebug() << r;
|
||||
|
||||
QStringList sl;
|
||||
sl << "hi" << "this" << "list" << "is" << "short";
|
||||
kDebug() << sl;
|
||||
|
||||
QList<int> il;
|
||||
kDebug() << "Empty QList<int>: " << il;
|
||||
il << 1 << 2 << 3 << 4 << 5;
|
||||
kDebug() << "QList<int> filled: " << il;
|
||||
|
||||
qint64 big = 65536LL * 65536 * 500;
|
||||
kDebug() << big;
|
||||
|
||||
QVariant v(0.12345);
|
||||
kDebug() << "Variant: " << v;
|
||||
|
||||
QByteArray data;
|
||||
data.resize(6);
|
||||
data[0] = 42;
|
||||
data[1] = 'H';
|
||||
data[2] = 'e';
|
||||
data[3] = 'l';
|
||||
data[4] = 'l';
|
||||
data[5] = 'o';
|
||||
kDebug() << data;
|
||||
data.resize(80);
|
||||
data.fill(42);
|
||||
kDebug() << data;
|
||||
|
||||
#ifdef Q_CC_GNU
|
||||
bool dotest = true;
|
||||
#else
|
||||
bool dotest = false;
|
||||
#endif
|
||||
if (dotest) {
|
||||
kDebug() << "Testing the function names. The following should display only the base name of the functions";
|
||||
TestClass4 c4;
|
||||
func5();
|
||||
using namespace N;
|
||||
func6();
|
||||
}
|
||||
|
||||
TestClass1 c1;
|
||||
c1.testBlock();
|
||||
c1.testCharStarBlock();
|
||||
}
|
||||
|
||||
// Concurrency testing, based on code from bug 133026
|
||||
// Copyright 2006 Marcel Wiesweg <marcel.wiesweg@gmx.de>
|
||||
|
||||
//#define THREAD_TEST 1
|
||||
|
||||
#ifdef THREAD_TEST
|
||||
#include <QThread>
|
||||
class DebugKDebug : public QThread
|
||||
{
|
||||
public:
|
||||
DebugKDebug(int num) : m_num(num) {}
|
||||
protected:
|
||||
virtual void run()
|
||||
{
|
||||
int count = 1000;
|
||||
while (--count) {
|
||||
kDebug() << "Test" << m_num;
|
||||
//usleep(1);
|
||||
}
|
||||
}
|
||||
private:
|
||||
int m_num;
|
||||
};
|
||||
|
||||
static void startThreads()
|
||||
{
|
||||
QVector<DebugKDebug *> threads;
|
||||
threads.resize(100);
|
||||
for (int i = 0; i < threads.size(); i++) {
|
||||
threads[i] = new DebugKDebug(i);
|
||||
threads[i]->start();
|
||||
}
|
||||
for (int i = 0; i < threads.size(); i++) {
|
||||
threads[i]->wait();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
KComponentData mainData("kdebugtest");
|
||||
testKDebug();
|
||||
#ifdef THREAD_TEST
|
||||
startThreads();
|
||||
#else
|
||||
Q_UNUSED(argc);
|
||||
Q_UNUSED(argv);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,257 @@
|
|||
/* This file is part of the KDE libraries
|
||||
|
||||
Copyright (c) 2010 Romain Perier <mrpouet@gentoo.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCheckBox>
|
||||
#include <QSignalSpy>
|
||||
#include <kdialog.h>
|
||||
#include <QPushButton>
|
||||
#include <QPointer>
|
||||
#include <QTest>
|
||||
|
||||
Q_DECLARE_METATYPE(KDialog::ButtonCode)
|
||||
|
||||
class KDialog_UnitTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KDialog_UnitTest()
|
||||
{
|
||||
qRegisterMetaType<KDialog::ButtonCode>("KDialog::ButtonCode");
|
||||
}
|
||||
|
||||
private: // helper methods
|
||||
void checkOtherButtonsAreNotDefault(KDialog &dialog, KDialog::ButtonCode id)
|
||||
{
|
||||
KDialog::ButtonCode codes[] = { KDialog::Ok, KDialog::Apply, KDialog::Cancel,
|
||||
KDialog::No, KDialog::Yes
|
||||
};
|
||||
for (int i = 0; i < 5; i++) {
|
||||
if (codes[i] == id) {
|
||||
continue;
|
||||
}
|
||||
QVERIFY(!dialog.button(codes[i])->isDefault());
|
||||
}
|
||||
}
|
||||
|
||||
void checkSetDefaultButton(KDialog &dialog, KDialog::ButtonCode id)
|
||||
{
|
||||
dialog.setDefaultButton(id);
|
||||
QCOMPARE(dialog.defaultButton(), id);
|
||||
QVERIFY(dialog.button(id)->isDefault());
|
||||
checkOtherButtonsAreNotDefault(dialog, id);
|
||||
}
|
||||
|
||||
private Q_SLOTS:
|
||||
// Test if buttons are correctly stored
|
||||
// in the KDialog, then try to get back them.
|
||||
// (only common buttons are tested)
|
||||
void testDefaultButton()
|
||||
{
|
||||
KDialog dialog;
|
||||
dialog.setButtons(KDialog::Ok | KDialog::Apply
|
||||
| KDialog::Cancel | KDialog::No | KDialog::Yes);
|
||||
checkSetDefaultButton(dialog, KDialog::Ok);
|
||||
checkSetDefaultButton(dialog, KDialog::Apply);
|
||||
checkSetDefaultButton(dialog, KDialog::Cancel);
|
||||
checkSetDefaultButton(dialog, KDialog::No);
|
||||
dialog.setDefaultButton(KDialog::NoDefault);
|
||||
checkOtherButtonsAreNotDefault(dialog, KDialog::NoDefault);
|
||||
checkSetDefaultButton(dialog, KDialog::Yes);
|
||||
dialog.setDefaultButton(KDialog::None); // #148969
|
||||
checkOtherButtonsAreNotDefault(dialog, KDialog::None);
|
||||
}
|
||||
|
||||
void testFutureDefaultButton()
|
||||
{
|
||||
// Test setting a default button that doesn't exist yet
|
||||
KDialog dialog;
|
||||
KDialog::ButtonCode id = KDialog::Apply;
|
||||
dialog.setDefaultButton(id);
|
||||
QCOMPARE(dialog.defaultButton(), id);
|
||||
QCOMPARE(dialog.button(id), static_cast<QPushButton *>(nullptr));
|
||||
|
||||
dialog.setButtons(KDialog::Ok | KDialog::Apply
|
||||
| KDialog::Cancel | KDialog::No | KDialog::Yes);
|
||||
QCOMPARE(dialog.defaultButton(), KDialog::Apply);
|
||||
QVERIFY(dialog.button(id)->isDefault());
|
||||
QVERIFY(!dialog.button(KDialog::Ok)->isDefault());
|
||||
}
|
||||
|
||||
// Test what happens with giving focus to widgets before the window is shown
|
||||
// This is mostly Qt experimentation, unrelated to KDialog's own code
|
||||
void testFocus()
|
||||
{
|
||||
KDialog dialog;
|
||||
dialog.setButtons(KDialog::Ok | KDialog::Cancel);
|
||||
QCheckBox *checkBox = new QCheckBox("Hello world !", &dialog);
|
||||
QPushButton *okButton = dialog.button(KDialog::Ok);
|
||||
okButton->setFocus();
|
||||
QVERIFY(!okButton->hasFocus()); // confusing, heh?
|
||||
QCOMPARE(dialog.focusWidget(), static_cast<QWidget *>(okButton));
|
||||
checkBox->setFocus();
|
||||
QVERIFY(!checkBox->hasFocus()); // confusing, heh?
|
||||
QCOMPARE(dialog.focusWidget(), static_cast<QWidget *>(checkBox));
|
||||
}
|
||||
|
||||
// Ensure that only the defaultButton() receives the keyEvent
|
||||
// (it should get the focus)
|
||||
void testKeyPressEvents()
|
||||
{
|
||||
KDialog dialog;
|
||||
QSignalSpy qCancelClickedSpy(&dialog, SIGNAL(cancelClicked()));
|
||||
QSignalSpy qOkClickedSpy(&dialog, SIGNAL(okClicked()));
|
||||
dialog.setButtons(KDialog::Ok | KDialog::Cancel);
|
||||
dialog.setDefaultButton(KDialog::Cancel);
|
||||
dialog.show();
|
||||
// Necessary after show(), otherwise dialog.focusWidget() returns NULL
|
||||
QApplication::setActiveWindow(&dialog);
|
||||
QVERIFY(dialog.focusWidget());
|
||||
// Graphically always the focused widget receives the keyEvent
|
||||
// (otherwises it does not make sense)
|
||||
QTest::keyClick(dialog.focusWidget(), Qt::Key_Return);
|
||||
QCOMPARE(qCancelClickedSpy.count(), 1);
|
||||
QCOMPARE(qOkClickedSpy.count(), 0);
|
||||
}
|
||||
|
||||
void testCheckBoxKeepsFocus()
|
||||
{
|
||||
KDialog dialog;
|
||||
QCheckBox checkBox("Hello world !", &dialog);
|
||||
QSignalSpy qCancelClickedSpy(&dialog, SIGNAL(cancelClicked()));
|
||||
dialog.setButtons(KDialog::Ok | KDialog::Cancel);
|
||||
checkBox.setFocus();
|
||||
dialog.setMainWidget(&checkBox);
|
||||
dialog.setDefaultButton(KDialog::Cancel);
|
||||
dialog.show();
|
||||
QApplication::setActiveWindow(&dialog);
|
||||
QVERIFY(checkBox.hasFocus());
|
||||
QVERIFY(!dialog.button(KDialog::Cancel)->hasFocus());
|
||||
QCOMPARE(dialog.focusWidget(), static_cast<QWidget *>(&checkBox));
|
||||
QTest::keyClick(dialog.focusWidget(), Qt::Key_Return);
|
||||
QCOMPARE(qCancelClickedSpy.count(), 1);
|
||||
}
|
||||
|
||||
// Test if buttons labels are correctly handled
|
||||
// assuming that testButtonDefault() passed
|
||||
void testButtonText()
|
||||
{
|
||||
KDialog dialog;
|
||||
KDialog::ButtonCode id = KDialog::Ok;
|
||||
QString text = "it's okay !";
|
||||
dialog.setButtons(id);
|
||||
dialog.setButtonText(id, text);
|
||||
QCOMPARE(dialog.buttonText(id), text);
|
||||
QCOMPARE(dialog.button(id)->text(), text);
|
||||
}
|
||||
|
||||
void testButtonToolTip()
|
||||
{
|
||||
KDialog dialog;
|
||||
KDialog::ButtonCode id = KDialog::Ok;
|
||||
QString tooltip = "This is okay button";
|
||||
dialog.setButtons(id);
|
||||
dialog.setButtonToolTip(id, tooltip);
|
||||
QCOMPARE(dialog.buttonToolTip(id), tooltip);
|
||||
QCOMPARE(dialog.button(id)->toolTip(), tooltip);
|
||||
}
|
||||
|
||||
void testButtonWhatsThis()
|
||||
{
|
||||
KDialog dialog;
|
||||
KDialog::ButtonCode id = KDialog::Ok;
|
||||
QString whatsthis = "A simple button to press okay";
|
||||
dialog.setButtons(id);
|
||||
dialog.setButtonWhatsThis(id, whatsthis);
|
||||
QCOMPARE(dialog.buttonWhatsThis(id), whatsthis);
|
||||
QCOMPARE(dialog.button(id)->whatsThis(), whatsthis);
|
||||
}
|
||||
|
||||
void testDeleteOnClose_data()
|
||||
{
|
||||
QTest::addColumn<KDialog::ButtonCode>("button");
|
||||
QTest::addColumn<int>("emitAccepted");
|
||||
QTest::addColumn<int>("emitRejected");
|
||||
|
||||
QTest::newRow("Ok") << KDialog::Ok << 1 << 0;
|
||||
QTest::newRow("Cancel") << KDialog::Cancel << 0 << 1;
|
||||
QTest::newRow("Close") << KDialog::Close << 0 << 0;
|
||||
}
|
||||
|
||||
void testDeleteOnClose()
|
||||
{
|
||||
QFETCH(KDialog::ButtonCode, button);
|
||||
QFETCH(int, emitAccepted);
|
||||
QFETCH(int, emitRejected);
|
||||
|
||||
KDialog *dialog = new KDialog;
|
||||
QPointer<KDialog> dialogPointer(dialog);
|
||||
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||
dialog->setButtons(KDialog::Ok | button);
|
||||
QSignalSpy qAcceptedSpy(dialog, SIGNAL(accepted()));
|
||||
QSignalSpy qRejectedSpy(dialog, SIGNAL(rejected()));
|
||||
dialog->show(); // KDialog::closeEvent tests for isHidden
|
||||
dialog->button(button)->click();
|
||||
QCOMPARE(qAcceptedSpy.count(), emitAccepted);
|
||||
QCOMPARE(qRejectedSpy.count(), emitRejected);
|
||||
QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
|
||||
QVERIFY(dialogPointer.isNull()); // deletion happened
|
||||
}
|
||||
|
||||
// Closing the dialog using the window manager button
|
||||
void testCloseDialogWithDeleteOnClose_data()
|
||||
{
|
||||
QTest::addColumn<KDialog::ButtonCode>("button");
|
||||
QTest::addColumn<int>("emitRejected");
|
||||
QTest::addColumn<QString>("signal");
|
||||
|
||||
QTest::newRow("Cancel") << KDialog::Cancel << 1 << SIGNAL(cancelClicked());
|
||||
QTest::newRow("Close") << KDialog::Close << 0 << SIGNAL(closeClicked());
|
||||
}
|
||||
|
||||
void testCloseDialogWithDeleteOnClose()
|
||||
{
|
||||
QFETCH(KDialog::ButtonCode, button);
|
||||
QFETCH(int, emitRejected);
|
||||
QFETCH(QString, signal);
|
||||
|
||||
KDialog *dialog = new KDialog;
|
||||
QPointer<KDialog> dialogPointer(dialog);
|
||||
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||
dialog->setButtons(KDialog::Ok | button);
|
||||
QSignalSpy qCancelOrCloseClickedSpy(dialog, signal.toLatin1().constData());
|
||||
QSignalSpy qRejectedSpy(dialog, SIGNAL(rejected()));
|
||||
dialog->show(); // KDialog::closeEvent tests for isHidden
|
||||
dialog->close();
|
||||
if (qRejectedSpy.isEmpty() && emitRejected) {
|
||||
QVERIFY(qRejectedSpy.wait(5000));
|
||||
}
|
||||
if (qCancelOrCloseClickedSpy.isEmpty()) {
|
||||
QVERIFY(qCancelOrCloseClickedSpy.wait(5000));
|
||||
}
|
||||
QCOMPARE(qRejectedSpy.count(), emitRejected); // and then rejected is emitted as well
|
||||
QCOMPARE(qCancelOrCloseClickedSpy.count(), 1); // KDialog emulated cancel or close being clicked
|
||||
qApp->sendPostedEvents(); // DeferredDelete
|
||||
QVERIFY(dialogPointer.isNull()); // deletion happened
|
||||
}
|
||||
};
|
||||
|
||||
QTEST_MAIN(KDialog_UnitTest)
|
||||
#include "kdialog_unittest.moc"
|
|
@ -0,0 +1,68 @@
|
|||
/* This file is part of the KDE project
|
||||
Copyright (C) 2008 Matthias Kretz <kretz@kde.org>
|
||||
|
||||
Permission to use, copy, modify, and distribute this software
|
||||
and its documentation for any purpose and without fee is hereby
|
||||
granted, provided that the above copyright notice appear in all
|
||||
copies and that both that the copyright notice and this
|
||||
permission notice and warranty disclaimer appear in supporting
|
||||
documentation, and that the name of the author not be used in
|
||||
advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
|
||||
The author disclaim all warranties with regard to this
|
||||
software, including all implied warranties of merchantability
|
||||
and fitness. In no event shall the author be liable for any
|
||||
special, indirect or consequential damages or any damages
|
||||
whatsoever resulting from loss of use, data or profits, whether
|
||||
in an action of contract, negligence or other tortious action,
|
||||
arising out of or in connection with the use or performance of
|
||||
this software.
|
||||
|
||||
*/
|
||||
|
||||
#include <qtest_kde.h>
|
||||
#include <kfadewidgeteffect.h>
|
||||
#include <QPointer>
|
||||
|
||||
class KFadeWidgetEffectTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void createEffect();
|
||||
void startEffect();
|
||||
void cleanupTestCase();
|
||||
|
||||
private:
|
||||
QWidget *parent, *w;
|
||||
QPointer<KFadeWidgetEffect> fade;
|
||||
};
|
||||
|
||||
void KFadeWidgetEffectTest::initTestCase()
|
||||
{
|
||||
parent = new QWidget;
|
||||
w = new QWidget(parent);
|
||||
//parent->show();
|
||||
}
|
||||
|
||||
void KFadeWidgetEffectTest::createEffect()
|
||||
{
|
||||
fade = new KFadeWidgetEffect(w);
|
||||
}
|
||||
|
||||
void KFadeWidgetEffectTest::startEffect()
|
||||
{
|
||||
fade->start(250);
|
||||
QVERIFY(QTest::kWaitForSignal(fade, SIGNAL(destroyed(QObject*)), 2000));
|
||||
}
|
||||
|
||||
void KFadeWidgetEffectTest::cleanupTestCase()
|
||||
{
|
||||
QVERIFY(!fade);
|
||||
delete parent;
|
||||
}
|
||||
|
||||
QTEST_KDEMAIN(KFadeWidgetEffectTest, GUI)
|
||||
|
||||
#include "kfadewidgeteffecttest.moc"
|
|
@ -0,0 +1,101 @@
|
|||
/* This file is part of the KDE project
|
||||
Copyright (C) 2010 Peter Penz <peter.penz19@gmail.com>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "kfilemetainfotest.h"
|
||||
#include <kiotesthelper.h>
|
||||
|
||||
#include <kdirlister.h>
|
||||
#include <kfilemetainfo.h>
|
||||
#include <qtest.h>
|
||||
|
||||
#include <config-kdelibs4support.h>
|
||||
|
||||
#include <QThread>
|
||||
|
||||
/**
|
||||
* Reads the meta-data of a given file inside a thread.
|
||||
* Used to test KFileMetaInfo for reentrancy issues.
|
||||
*/
|
||||
class KFileMetaInfoThread : public QThread
|
||||
{
|
||||
public:
|
||||
KFileMetaInfoThread(const QString &fileName);
|
||||
|
||||
protected:
|
||||
void run() override;
|
||||
|
||||
private:
|
||||
QString m_fileName;
|
||||
};
|
||||
|
||||
KFileMetaInfoThread::KFileMetaInfoThread(const QString &fileName) :
|
||||
m_fileName(fileName)
|
||||
{
|
||||
}
|
||||
|
||||
void KFileMetaInfoThread::run()
|
||||
{
|
||||
KFileMetaInfo fileMetaInfo(m_fileName);
|
||||
}
|
||||
|
||||
QTEST_MAIN(KFileMetaInfoTest)
|
||||
|
||||
void KFileMetaInfoTest::initTestCase()
|
||||
{
|
||||
m_exitCount = 0;
|
||||
}
|
||||
|
||||
void KFileMetaInfoTest::testMetaInfo()
|
||||
{
|
||||
const QString file = m_tempDir.path() + "/testfilename";
|
||||
createTestFile(file);
|
||||
|
||||
KFileMetaInfo fileMetaInfo(file);
|
||||
#if ! KIO_NO_STRIGI
|
||||
QVERIFY(fileMetaInfo.isValid());
|
||||
|
||||
const KFileMetaInfoItem &item = fileMetaInfo.item("http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName");
|
||||
QCOMPARE(item.value().toString(), QString("testfilename"));
|
||||
#endif
|
||||
}
|
||||
|
||||
void KFileMetaInfoTest::testReentrancy()
|
||||
{
|
||||
const QString file = m_tempDir.path() + "/testfilename";
|
||||
createTestFile(file);
|
||||
|
||||
m_exitCount = 20;
|
||||
for (int i = 0; i < m_exitCount; ++i) {
|
||||
QThread *thread = new KFileMetaInfoThread(file);
|
||||
thread->setParent(this);
|
||||
connect(thread, SIGNAL(finished()), this, SLOT(exitLoop()));
|
||||
thread->start();
|
||||
}
|
||||
|
||||
m_eventLoop.exec();
|
||||
}
|
||||
|
||||
void KFileMetaInfoTest::exitLoop()
|
||||
{
|
||||
--m_exitCount;
|
||||
if (m_exitCount <= 0) {
|
||||
m_eventLoop.quit();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/* This file is part of the KDE project
|
||||
Copyright (C) 2010 Peter Penz <peter.penz19@gmail.com>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KFILEMETAINFOTEST_H
|
||||
#define KFILEMETAINFOTEST_H
|
||||
|
||||
#include <qtemporarydir.h>
|
||||
#include <QEventLoop>
|
||||
#include <QObject>
|
||||
|
||||
class KFileMetaInfoTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void testMetaInfo();
|
||||
void testReentrancy();
|
||||
|
||||
protected Q_SLOTS:
|
||||
void exitLoop();
|
||||
|
||||
private:
|
||||
int m_exitCount;
|
||||
QEventLoop m_eventLoop;
|
||||
QTemporaryDir m_tempDir;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,51 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2006 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
//#include <kaboutdata.h>
|
||||
#include <QApplication>
|
||||
#include <kglobalsettings.h>
|
||||
#include <qdebug.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
//KCmdLineOptions options;
|
||||
//options.add("p", qi18n("emit paletteChanged()"));
|
||||
//options.add("f", qi18n("emit fontChanged()"));
|
||||
//options.add("ps", qi18n("emit settingsChanged(SETTINGS_PATH)"));
|
||||
|
||||
QApplication app(argc, argv, false);
|
||||
|
||||
QByteArray opt = argc > 1 ? argv[1] : "";
|
||||
if (opt == "-p") {
|
||||
qDebug() << "emitChange(PaletteChanged)";
|
||||
KGlobalSettings::self()->emitChange(KGlobalSettings::PaletteChanged);
|
||||
return 0;
|
||||
} else if (opt == "-f") {
|
||||
qDebug() << "emitChange(FontChanged)";
|
||||
KGlobalSettings::self()->emitChange(KGlobalSettings::FontChanged);
|
||||
return 0;
|
||||
} else if (opt == "--ps") {
|
||||
qDebug() << "emitChange(SettingsChanged)";
|
||||
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_PATHS);
|
||||
return 0;
|
||||
}
|
||||
|
||||
qWarning() << "No action specified";
|
||||
return 1;
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2006 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <QSignalSpy>
|
||||
#include <QTest>
|
||||
#include "kglobalsettingstest.h"
|
||||
|
||||
QTEST_MAIN(KGlobalSettingsTest)
|
||||
|
||||
#include <kglobalsettings.h>
|
||||
#include <QProcess>
|
||||
#include <QEventLoop>
|
||||
#include <QDBusConnection>
|
||||
|
||||
/**
|
||||
* The strategy of this test is:
|
||||
* We install QSignalSpy instances on many signals from KGlobalSettings::self(),
|
||||
* and then we get another process (kglobalsettingsclient) to call emitChange(),
|
||||
* and we check that the corresponding signals are emitted, i.e. that our process
|
||||
* got the dbus signal.
|
||||
*
|
||||
* As a nice side-effect we automatically test a bit of KProcess as well :)
|
||||
*/
|
||||
|
||||
void KGlobalSettingsTest::initTestCase()
|
||||
{
|
||||
// Some signals are only emitted when we are running a full KDE session. If
|
||||
// we are not then KDE applications follow the platform palette and font
|
||||
// settings.
|
||||
qputenv("KDE_FULL_SESSION", "1");
|
||||
|
||||
// change to the bin dir
|
||||
QDir::setCurrent(QCoreApplication::applicationDirPath());
|
||||
|
||||
QDBusConnectionInterface *bus = nullptr;
|
||||
if (!QDBusConnection::sessionBus().isConnected() || !(bus = QDBusConnection::sessionBus().interface())) {
|
||||
QFAIL("Session bus not found");
|
||||
}
|
||||
|
||||
QVERIFY(!KGlobalSettings::showFilePreview(QUrl("audiocd:/")));
|
||||
}
|
||||
|
||||
#define CREATE_ALL_SPYS \
|
||||
KGlobalSettings* settings = KGlobalSettings::self(); \
|
||||
settings->activate(); \
|
||||
QSignalSpy palette_spy( settings, SIGNAL(kdisplayPaletteChanged()) ); \
|
||||
QSignalSpy font_spy( settings, SIGNAL(kdisplayFontChanged()) ); \
|
||||
QSignalSpy style_spy( settings, SIGNAL(kdisplayStyleChanged()) ); \
|
||||
QSignalSpy settings_spy( settings, SIGNAL(settingsChanged(int)) ); \
|
||||
QSignalSpy appearance_spy( settings, SIGNAL(appearanceChanged()) )
|
||||
|
||||
static void callClient(const QString &opt, const char *signalToWaitFor)
|
||||
{
|
||||
QProcess proc;
|
||||
QString processName;
|
||||
#ifdef Q_OS_WIN
|
||||
processName = "kglobalsettingsclient.exe";
|
||||
#else
|
||||
if (QFile::exists("./kglobalsettingsclient.shell")) {
|
||||
processName = "./kglobalsettingsclient.shell";
|
||||
} else {
|
||||
QVERIFY(QFile::exists("./kglobalsettingsclient"));
|
||||
processName = "./kglobalsettingsclient";
|
||||
}
|
||||
#endif
|
||||
// qDebug() << proc.args();
|
||||
proc.start(processName, QStringList() << opt);
|
||||
bool ok = proc.waitForFinished();
|
||||
QVERIFY(ok);
|
||||
|
||||
QSignalSpy spy(KGlobalSettings::self(), signalToWaitFor);
|
||||
QVERIFY(spy.wait(5000));
|
||||
}
|
||||
|
||||
void KGlobalSettingsTest::testPaletteChange()
|
||||
{
|
||||
CREATE_ALL_SPYS;
|
||||
callClient("-p", SIGNAL(kdisplayPaletteChanged()));
|
||||
QCOMPARE(palette_spy.size(), 1);
|
||||
QCOMPARE(font_spy.size(), 0);
|
||||
QCOMPARE(style_spy.size(), 0);
|
||||
QCOMPARE(settings_spy.size(), 0);
|
||||
QCOMPARE(appearance_spy.size(), 1);
|
||||
}
|
||||
|
||||
void KGlobalSettingsTest::testFontChange()
|
||||
{
|
||||
CREATE_ALL_SPYS;
|
||||
callClient("-f", SIGNAL(kdisplayFontChanged()));
|
||||
QCOMPARE(palette_spy.size(), 0);
|
||||
QCOMPARE(font_spy.size(), 1);
|
||||
QCOMPARE(style_spy.size(), 0);
|
||||
QCOMPARE(settings_spy.size(), 0);
|
||||
QCOMPARE(appearance_spy.size(), 1);
|
||||
}
|
||||
|
||||
void KGlobalSettingsTest::testSettingsChange()
|
||||
{
|
||||
CREATE_ALL_SPYS;
|
||||
callClient("--ps", SIGNAL(settingsChanged(int)));
|
||||
QCOMPARE(palette_spy.size(), 0);
|
||||
QCOMPARE(font_spy.size(), 0);
|
||||
QCOMPARE(style_spy.size(), 0);
|
||||
QCOMPARE(settings_spy.size(), 1);
|
||||
QCOMPARE(settings_spy.at(0).at(0).toInt(), (int)KGlobalSettings::SETTINGS_PATHS);
|
||||
QCOMPARE(appearance_spy.size(), 0);
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2006 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef kglobalsettingstest_h
|
||||
#define kglobalsettingstest_h
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class KGlobalSettingsTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void testPaletteChange();
|
||||
void testFontChange();
|
||||
void testSettingsChange();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,70 @@
|
|||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of
|
||||
the License or (at your option) version 3 of the license.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
#include <kglobal.h>
|
||||
#include <QDebug>
|
||||
|
||||
class A
|
||||
{
|
||||
public:
|
||||
A() : i(1) {}
|
||||
int i;
|
||||
};
|
||||
|
||||
K_GLOBAL_STATIC(A, globalA)
|
||||
K_GLOBAL_STATIC(A, globalA2)
|
||||
|
||||
class B
|
||||
{
|
||||
public:
|
||||
~B()
|
||||
{
|
||||
Q_ASSERT(globalA.isDestroyed());
|
||||
qDebug() << "All global statics were successfully destroyed.";
|
||||
}
|
||||
};
|
||||
|
||||
Q_GLOBAL_STATIC(B, globalB)
|
||||
|
||||
int main(int, char **)
|
||||
{
|
||||
Q_ASSERT(globalB);
|
||||
|
||||
Q_ASSERT(!globalA.isDestroyed());
|
||||
A *a = globalA;
|
||||
Q_ASSERT(a);
|
||||
A &x = *globalA;
|
||||
Q_ASSERT(a == &x);
|
||||
Q_ASSERT(a == globalA);
|
||||
Q_ASSERT(globalA->i == 1);
|
||||
Q_ASSERT(!globalA.isDestroyed());
|
||||
|
||||
Q_ASSERT(!globalA2.isDestroyed());
|
||||
Q_ASSERT(globalA2);
|
||||
Q_ASSERT(globalA2->i == 1);
|
||||
Q_ASSERT(!globalA2.isDestroyed());
|
||||
globalA2.destroy();
|
||||
Q_ASSERT(globalA2.isDestroyed());
|
||||
|
||||
// silence warnings
|
||||
Q_UNUSED(globalB)
|
||||
Q_UNUSED(a)
|
||||
Q_UNUSED(x)
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
/*
|
||||
* Copyright (C) 2007 David Faure <faure@kde.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License version 2 as published by the Free Software Foundation;
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public License
|
||||
* along with this library; see the file COPYING.LIB. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <klocale.h>
|
||||
#include <kglobal.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QtConcurrent>
|
||||
|
||||
#include <QTest>
|
||||
#include <qtest_kde.h> // kWaitForSignal
|
||||
|
||||
static QString testMethod()
|
||||
{
|
||||
return QLatin1String("application/octet-stream");
|
||||
}
|
||||
|
||||
class KGlobalTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
void testStaticQString()
|
||||
{
|
||||
QCOMPARE(testMethod(), QString::fromLatin1("application/octet-stream"));
|
||||
}
|
||||
|
||||
void testFindDirectChild()
|
||||
{
|
||||
QTimer child(this);
|
||||
QCOMPARE(KGlobal::findDirectChild<QTimer *>(this), &child);
|
||||
QCOMPARE(KGlobal::findDirectChild<QTimer *>(&child), (QTimer *)nullptr);
|
||||
QCOMPARE(KGlobal::findDirectChild<QEventLoop *>(this), (QEventLoop *)nullptr);
|
||||
}
|
||||
|
||||
// The former implementation of QTest::kWaitForSignal would return
|
||||
// false even if the signal was emitted, when the timeout fired too
|
||||
// (e.g. due to a breakpoint in gdb).
|
||||
void testWaitForSignal()
|
||||
{
|
||||
QTimer::singleShot(5, this, SLOT(emitSigFoo()));
|
||||
QVERIFY(QTest::kWaitForSignal(this, SIGNAL(sigFoo()), 20));
|
||||
}
|
||||
|
||||
void testWaitForSignalTimeout()
|
||||
{
|
||||
QVERIFY(!QTest::kWaitForSignal(this, SIGNAL(sigFoo()), 1));
|
||||
}
|
||||
|
||||
// For testing from multiple threads in testThreads
|
||||
void testLocale()
|
||||
{
|
||||
KLocale::global();
|
||||
KLocale::global()->setDecimalPlaces(2);
|
||||
QCOMPARE(KLocale::global()->formatNumber(70), QString("70.00"));
|
||||
}
|
||||
|
||||
// Calling this directly aborts in KLocale::global(), this is intended.
|
||||
// We have to install the qtranslator in the main thread.
|
||||
void testThreads()
|
||||
{
|
||||
QThreadPool::globalInstance()->setMaxThreadCount(10);
|
||||
QFutureSynchronizer<void> sync;
|
||||
sync.addFuture(QtConcurrent::run(this, &KGlobalTest::testLocale));
|
||||
sync.addFuture(QtConcurrent::run(this, &KGlobalTest::testLocale));
|
||||
// sync dtor blocks waiting for finished
|
||||
}
|
||||
|
||||
protected Q_SLOTS:
|
||||
void emitSigFoo()
|
||||
{
|
||||
emit sigFoo();
|
||||
#ifndef Q_OS_MAC
|
||||
// Mac currently uses the unix event loop (not glib) which
|
||||
// has issues and blocks in nested event loops such as the
|
||||
// one triggered by the below. Since this is a limitation
|
||||
// of Qt and working around it here doesn't invalidate the
|
||||
// actual test case, let's do that.
|
||||
QTest::qWait(10);
|
||||
#endif
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void sigFoo();
|
||||
};
|
||||
|
||||
QTEST_MAIN(KGlobalTest)
|
||||
|
||||
#include "kglobaltest.moc"
|
|
@ -0,0 +1,209 @@
|
|||
/* This file is part of the KDE project
|
||||
Copyright (C) 2006 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
// This file can only be included once in a given binary
|
||||
|
||||
#include <QDebug>
|
||||
#include <qglobal.h>
|
||||
#include <qstandardpaths.h>
|
||||
#include <qplatformdefs.h>
|
||||
#include <QDir>
|
||||
#include <QDateTime>
|
||||
#include <QTest>
|
||||
#ifdef Q_OS_UNIX
|
||||
#include <utime.h>
|
||||
#else
|
||||
#include <sys/utime.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
QString homeTmpDir()
|
||||
{
|
||||
const QString dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/kiotests/");
|
||||
if (!QFile::exists(dir)) {
|
||||
const bool ok = QDir().mkpath(dir);
|
||||
if (!ok) {
|
||||
qFatal("Couldn't create %s", qPrintable(dir));
|
||||
}
|
||||
}
|
||||
return dir;
|
||||
}
|
||||
|
||||
QDateTime s_referenceTimeStamp;
|
||||
|
||||
static void setTimeStamp(const QString &path, const QDateTime &mtime)
|
||||
{
|
||||
#ifdef Q_OS_UNIX
|
||||
// Put timestamp in the past so that we can check that the listing is correct
|
||||
struct utimbuf utbuf;
|
||||
utbuf.actime = mtime.toTime_t();
|
||||
utbuf.modtime = utbuf.actime;
|
||||
utime(QFile::encodeName(path), &utbuf);
|
||||
//qDebug( "Time changed for %s", qPrintable( path ) );
|
||||
#elif defined(Q_OS_WIN)
|
||||
struct _utimbuf utbuf;
|
||||
utbuf.actime = mtime.toTime_t();
|
||||
utbuf.modtime = utbuf.actime;
|
||||
_wutime(reinterpret_cast<const wchar_t *>(path.utf16()), &utbuf);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void createTestFile(const QString &path, bool plainText = false)
|
||||
{
|
||||
QFile f(path);
|
||||
if (!f.open(QIODevice::WriteOnly)) {
|
||||
qFatal("Couldn't create %s", qPrintable(path));
|
||||
}
|
||||
QByteArray data(plainText ? "Hello world" : "Hello\0world", 11);
|
||||
QCOMPARE(data.size(), 11);
|
||||
f.write(data);
|
||||
f.close();
|
||||
setTimeStamp(path, s_referenceTimeStamp);
|
||||
}
|
||||
|
||||
static void createTestSymlink(const QString &path, const QByteArray &target = "/IDontExist")
|
||||
{
|
||||
QFile::remove(path);
|
||||
bool ok = symlink(target.constData(), QFile::encodeName(path)) == 0; // broken symlink
|
||||
if (!ok) {
|
||||
qFatal("couldn't create symlink: %s", strerror(errno));
|
||||
}
|
||||
QT_STATBUF buf;
|
||||
#ifndef Q_OS_WIN
|
||||
QVERIFY(QT_LSTAT(QFile::encodeName(path), &buf) == 0);
|
||||
#endif
|
||||
QVERIFY((buf.st_mode & QT_STAT_MASK) == QT_STAT_LNK);
|
||||
//qDebug( "symlink %s created", qPrintable( path ) );
|
||||
QVERIFY(QFileInfo(path).isSymLink());
|
||||
}
|
||||
|
||||
enum CreateTestDirectoryOptions { DefaultOptions = 0, NoSymlink = 1 };
|
||||
static void createTestDirectory(const QString &path, CreateTestDirectoryOptions opt = DefaultOptions)
|
||||
{
|
||||
QDir dir;
|
||||
bool ok = dir.mkdir(path);
|
||||
if (!ok && !dir.exists()) {
|
||||
qFatal("Couldn't create %s", qPrintable(path));
|
||||
}
|
||||
createTestFile(path + "/testfile");
|
||||
if ((opt & NoSymlink) == 0) {
|
||||
#ifndef Q_OS_WIN
|
||||
createTestSymlink(path + "/testlink");
|
||||
QVERIFY(QFileInfo(path + "/testlink").isSymLink());
|
||||
#else
|
||||
// to not change the filecount everywhere in the tests
|
||||
createTestFile(path + "/testlink");
|
||||
#endif
|
||||
}
|
||||
setTimeStamp(path, s_referenceTimeStamp);
|
||||
}
|
||||
|
||||
#include <kio/jobuidelegateextension.h>
|
||||
class PredefinedAnswerJobUiDelegate : public KIO::JobUiDelegateExtension
|
||||
{
|
||||
public:
|
||||
PredefinedAnswerJobUiDelegate()
|
||||
: JobUiDelegateExtension(),
|
||||
m_askFileRenameCalled(0),
|
||||
m_askSkipCalled(0),
|
||||
m_askDeleteCalled(0),
|
||||
m_messageBoxCalled(0),
|
||||
m_renameResult(KIO::R_SKIP),
|
||||
m_skipResult(KIO::S_SKIP),
|
||||
m_deleteResult(false),
|
||||
m_messageBoxResult(0)
|
||||
{
|
||||
}
|
||||
|
||||
KIO::RenameDialog_Result askFileRename(KJob *job,
|
||||
const QString &caption,
|
||||
const QUrl &src,
|
||||
const QUrl &dest,
|
||||
KIO::RenameDialog_Options options,
|
||||
QString &newDest,
|
||||
KIO::filesize_t = (KIO::filesize_t) - 1,
|
||||
KIO::filesize_t = (KIO::filesize_t) - 1,
|
||||
const QDateTime & = QDateTime(),
|
||||
const QDateTime & = QDateTime(),
|
||||
const QDateTime & = QDateTime(),
|
||||
const QDateTime & = QDateTime()) override {
|
||||
Q_UNUSED(job)
|
||||
Q_UNUSED(caption)
|
||||
Q_UNUSED(src)
|
||||
Q_UNUSED(dest)
|
||||
Q_UNUSED(options)
|
||||
Q_UNUSED(newDest)
|
||||
++m_askFileRenameCalled;
|
||||
return m_renameResult;
|
||||
}
|
||||
|
||||
KIO::SkipDialog_Result askSkip(KJob *job,
|
||||
KIO::SkipDialog_Options options,
|
||||
const QString &error_text) override {
|
||||
Q_UNUSED(job)
|
||||
Q_UNUSED(options)
|
||||
Q_UNUSED(error_text)
|
||||
++m_askSkipCalled;
|
||||
return m_skipResult;
|
||||
}
|
||||
|
||||
bool askDeleteConfirmation(const QList<QUrl> &urls, DeletionType deletionType,
|
||||
ConfirmationType confirmationType) override {
|
||||
Q_UNUSED(urls);
|
||||
Q_UNUSED(deletionType);
|
||||
Q_UNUSED(confirmationType);
|
||||
++m_askDeleteCalled;
|
||||
return m_deleteResult;
|
||||
}
|
||||
|
||||
int requestMessageBox(MessageBoxType type, const QString &text,
|
||||
const QString &caption,
|
||||
const QString &buttonYes,
|
||||
const QString &buttonNo,
|
||||
const QString &iconYes = QString(),
|
||||
const QString &iconNo = QString(),
|
||||
const QString &dontAskAgainName = QString(),
|
||||
const KIO::MetaData &sslMetaData = KIO::MetaData()) override
|
||||
{
|
||||
Q_UNUSED(type);
|
||||
Q_UNUSED(text);
|
||||
Q_UNUSED(caption);
|
||||
Q_UNUSED(buttonYes);
|
||||
Q_UNUSED(buttonNo);
|
||||
Q_UNUSED(iconYes);
|
||||
Q_UNUSED(iconNo);
|
||||
Q_UNUSED(dontAskAgainName);
|
||||
Q_UNUSED(sslMetaData);
|
||||
++m_messageBoxCalled;
|
||||
return m_messageBoxResult;
|
||||
}
|
||||
|
||||
// yeah, public, for get and reset.
|
||||
int m_askFileRenameCalled;
|
||||
int m_askSkipCalled;
|
||||
int m_askDeleteCalled;
|
||||
int m_messageBoxCalled;
|
||||
|
||||
KIO::RenameDialog_Result m_renameResult;
|
||||
KIO::SkipDialog_Result m_skipResult;
|
||||
bool m_deleteResult;
|
||||
int m_messageBoxResult;
|
||||
};
|
|
@ -0,0 +1,118 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005-2006 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#undef QT_NO_CAST_FROM_ASCII
|
||||
|
||||
#include "klibloadertest.h"
|
||||
|
||||
#include <QTest>
|
||||
|
||||
QTEST_MAIN(KLibLoaderTest)
|
||||
|
||||
#include <klibloader.h>
|
||||
#include <QDir>
|
||||
#include <QDebug>
|
||||
|
||||
// Only new-style plugins are supported, even though we are doing
|
||||
// loading with a deprecated class.
|
||||
static const char s_kpluginFactoryModule[] = "klibloadertestmodule5";
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
|
||||
static const char s_modExt[] = ".dll";
|
||||
#else
|
||||
static const char s_modExt[] = ".so";
|
||||
#endif
|
||||
#define MODULE_PATH(mod) QFileInfo(QFINDTESTDATA(QString::fromLatin1(mod) + s_modExt)).canonicalFilePath()
|
||||
|
||||
void KLibLoaderTest::initTestCase()
|
||||
{
|
||||
const QString libdir = QDir::currentPath();
|
||||
qDebug() << "Adding" << libdir << "to LD_LIBRARY_PATH";
|
||||
qputenv("LD_LIBRARY_PATH", qgetenv("LD_LIBRARY_PATH") + ":" + QFile::encodeName(libdir));
|
||||
}
|
||||
|
||||
void KLibLoaderTest::testFactory()
|
||||
{
|
||||
KPluginFactory *factory = KLibLoader::self()->factory(s_kpluginFactoryModule);
|
||||
if (!factory) {
|
||||
QVERIFY(factory);
|
||||
} else {
|
||||
QObject *obj = factory->create<QObject>();
|
||||
QVERIFY(obj);
|
||||
delete obj;
|
||||
}
|
||||
}
|
||||
|
||||
void KLibLoaderTest::testFactory_hints()
|
||||
{
|
||||
// the hints will be ignored, but we want to check the call will still compile
|
||||
KPluginFactory *factory = KLibLoader::self()->factory(s_kpluginFactoryModule,
|
||||
QLibrary::ResolveAllSymbolsHint);
|
||||
if (!factory) {
|
||||
QVERIFY(factory);
|
||||
} else {
|
||||
QObject *obj = factory->create<QObject>();
|
||||
QVERIFY(obj);
|
||||
delete obj;
|
||||
}
|
||||
}
|
||||
|
||||
void KLibLoaderTest::testFactory_noexist()
|
||||
{
|
||||
KPluginFactory *factory = KLibLoader::self()->factory("idontexist");
|
||||
QVERIFY(!factory);
|
||||
}
|
||||
|
||||
void KLibLoaderTest::testLibrary()
|
||||
{
|
||||
KLibrary *lib = KLibLoader::self()->library(s_kpluginFactoryModule);
|
||||
QVERIFY(lib);
|
||||
QVERIFY(lib->isLoaded());
|
||||
QCOMPARE(QFileInfo(lib->fileName()).canonicalFilePath(),
|
||||
MODULE_PATH(s_kpluginFactoryModule));
|
||||
}
|
||||
|
||||
void KLibLoaderTest::testLibrary_hints()
|
||||
{
|
||||
// the hints will be ignored, but we want to check the call will still compile
|
||||
KLibrary *lib = KLibLoader::self()->library(s_kpluginFactoryModule,
|
||||
QLibrary::ResolveAllSymbolsHint);
|
||||
QVERIFY(lib);
|
||||
QVERIFY(lib->isLoaded());
|
||||
QCOMPARE(QFileInfo(lib->fileName()).canonicalFilePath(),
|
||||
MODULE_PATH(s_kpluginFactoryModule));
|
||||
}
|
||||
|
||||
void KLibLoaderTest::testLibrary_noexist()
|
||||
{
|
||||
KLibrary *lib = KLibLoader::self()->library("idontexist");
|
||||
QVERIFY(!lib);
|
||||
}
|
||||
|
||||
void KLibLoaderTest::testFindLibrary()
|
||||
{
|
||||
const QString library = KLibLoader::findLibrary(s_kpluginFactoryModule);
|
||||
QVERIFY(!library.isEmpty());
|
||||
QCOMPARE(QFileInfo(library).canonicalFilePath(),
|
||||
MODULE_PATH(s_kpluginFactoryModule));
|
||||
}
|
||||
|
||||
void KLibLoaderTest::testFindLibrary_noexist()
|
||||
{
|
||||
const QString library = KLibLoader::findLibrary("idontexist");
|
||||
QVERIFY(library.isEmpty());
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KLIBLOADERTEST_H
|
||||
#define KLIBLOADERTEST_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class KLibLoaderTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void testFactory();
|
||||
void testFactory_hints();
|
||||
void testFactory_noexist();
|
||||
void testLibrary();
|
||||
void testLibrary_hints();
|
||||
void testLibrary_noexist();
|
||||
void testFindLibrary();
|
||||
void testFindLibrary_noexist();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,34 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "klibloadertest3_module.h"
|
||||
#include <kgenericfactory.h>
|
||||
|
||||
typedef KGenericFactory<KLibLoaderTestObject> KLibLoaderTestFactory;
|
||||
K_EXPORT_COMPONENT_FACTORY(klibloadertestmodule, KLibLoaderTestFactory("klibloadertestfactory"))
|
||||
|
||||
KLibLoaderTestObject::KLibLoaderTestObject(QObject *parent, const QStringList &)
|
||||
: QObject(parent)
|
||||
{
|
||||
qDebug("KLibLoaderTestObject created");
|
||||
}
|
||||
|
||||
KLibLoaderTestObject::~KLibLoaderTestObject()
|
||||
{
|
||||
qDebug("KLibLoaderTestObject deleted");
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KLIBLOADERTEST_MODULE_H
|
||||
#define KLIBLOADERTEST_MODULE_H
|
||||
|
||||
#include <QObject>
|
||||
class KLibLoaderTestObject : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KLibLoaderTestObject(QObject *parent, const QStringList &);
|
||||
~KLibLoaderTestObject() override;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,38 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "klibloadertest5_module.h"
|
||||
|
||||
#include <kpluginfactory.h> // K_PLUGIN_FACTORY
|
||||
|
||||
K_PLUGIN_FACTORY(KLibLoaderTestFactory,
|
||||
registerPlugin<KLibLoaderTestObject>();
|
||||
)
|
||||
|
||||
KLibLoaderTestObject::KLibLoaderTestObject(QObject *parent, const QList<QVariant> &)
|
||||
: QObject(parent)
|
||||
{
|
||||
qDebug("KLibLoaderTestObject created with KPluginFactory");
|
||||
}
|
||||
|
||||
KLibLoaderTestObject::~KLibLoaderTestObject()
|
||||
{
|
||||
qDebug("KLibLoaderTestObject created with KPluginFactory, now deleted");
|
||||
}
|
||||
|
||||
#include "klibloadertest5_module.moc"
|
|
@ -0,0 +1,31 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KLIBLOADERTEST5_MODULE_H
|
||||
#define KLIBLOADERTEST5_MODULE_H
|
||||
|
||||
#include <QObject>
|
||||
class KLibLoaderTestObject : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KLibLoaderTestObject(QObject *parent, const QList<QVariant> &);
|
||||
~KLibLoaderTestObject() override;
|
||||
};
|
||||
|
||||
#endif //KLIBLOADERTEST5_MODULE_H
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,50 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005 Thomas Braxton <brax108@cox.net>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KLOCALETEST_H
|
||||
#define KLOCALETEST_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class KLocaleTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void languages();
|
||||
void formatNumbers();
|
||||
void formatNumberStrings();
|
||||
void readNumber();
|
||||
void formatMoney();
|
||||
void readMoney();
|
||||
void formatDate();
|
||||
void readDate();
|
||||
void formatTime();
|
||||
void formatDateTime();
|
||||
void readTime();
|
||||
void testDayPeriods();
|
||||
void testCalendarSystemType();
|
||||
void testCountryDivision();
|
||||
void prettyFormatDuration();
|
||||
void formatByteSize();
|
||||
void bug95511();
|
||||
void weekDays();
|
||||
void formatByteSize2();
|
||||
};
|
||||
|
||||
#endif // KLOCALETEST_H
|
|
@ -0,0 +1,214 @@
|
|||
/*
|
||||
* This file is part of the KDE libraries.
|
||||
* Copyright 2009 Michael Leupold <lemma@confuego.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) version 3, or any
|
||||
* later version accepted by the membership of KDE e.V. (or its
|
||||
* successor approved by the membership of KDE e.V.), which shall
|
||||
* act as a proxy defined in Section 6 of version 3 of the license.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "klocaletimeformattest.h"
|
||||
|
||||
#include <kconfig.h>
|
||||
#include <kconfiggroup.h>
|
||||
#include "kdayperiod_p.h"
|
||||
|
||||
#include <QStandardPaths>
|
||||
#include <QStringList>
|
||||
#include <QTest>
|
||||
|
||||
static QString loadTimeFormat(const QString &country)
|
||||
{
|
||||
const QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
|
||||
QString::fromLatin1("kf5/locale/countries/%1/country.desktop")
|
||||
.arg(country));
|
||||
if (file.isEmpty()) {
|
||||
return QString();
|
||||
}
|
||||
KConfig entryFile(file);
|
||||
KConfigGroup entry(&entryFile, "KCM Locale");
|
||||
return entry.readEntry("TimeFormat", QString());
|
||||
}
|
||||
|
||||
void KLocaleTimeFormatTest::initTestCase()
|
||||
{
|
||||
// get countries with according time formats
|
||||
// for formatAndReadAllCountriesTest().
|
||||
QStringList countries(KLocale::global()->allCountriesList());
|
||||
QString timeFormat;
|
||||
Q_FOREACH (const QString &c, countries) {
|
||||
timeFormat = loadTimeFormat(c);
|
||||
if (!timeFormat.isEmpty()) {
|
||||
m_allFormats.insert(c, timeFormat);
|
||||
}
|
||||
}
|
||||
|
||||
// additional test-data (for (format|read)TimeTest)
|
||||
m_timeFormats["ampm"].timeFormat = "%I:%M:%S %p";
|
||||
m_timeFormats["ampm"].exp[KLocale::TimeDefault] = "03:59:59 PM";
|
||||
m_timeFormats["ampm"].exp[KLocale::TimeWithoutAmPm] = "03:59:59";
|
||||
m_timeFormats["ampm"].exp[KLocale::TimeDuration] = "15:59:59";
|
||||
m_timeFormats["ampm"].exp[KLocale::TimeWithoutSeconds] = "03:59 PM";
|
||||
m_timeFormats["ampm"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeWithoutAmPm] = "03:59";
|
||||
m_timeFormats["ampm"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeDuration] = "15:59";
|
||||
m_timeFormats["ampm"].exp[KLocale::TimeFoldHours] = "959:59";
|
||||
m_timeFormats["ampm"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeFoldHours] = "959";
|
||||
|
||||
m_timeFormats["24h"].timeFormat = "%H:%M:%S";
|
||||
m_timeFormats["24h"].exp[KLocale::TimeDefault] = "15:59:59";
|
||||
m_timeFormats["24h"].exp[KLocale::TimeWithoutAmPm] = "15:59:59";
|
||||
m_timeFormats["24h"].exp[KLocale::TimeDuration] = "15:59:59";
|
||||
m_timeFormats["24h"].exp[KLocale::TimeWithoutSeconds] = "15:59";
|
||||
m_timeFormats["24h"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeWithoutAmPm] = "15:59";
|
||||
m_timeFormats["24h"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeDuration] = "15:59";
|
||||
m_timeFormats["24h"].exp[KLocale::TimeFoldHours] = "959:59";
|
||||
m_timeFormats["24h"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeFoldHours] = "959";
|
||||
|
||||
m_timeFormats["ampm2"].timeFormat = "%l:%M:%S %p";
|
||||
m_timeFormats["ampm2"].exp[KLocale::TimeDefault] = "3:59:59 PM";
|
||||
m_timeFormats["ampm2"].exp[KLocale::TimeWithoutAmPm] = "3:59:59";
|
||||
m_timeFormats["ampm2"].exp[KLocale::TimeDuration] = "15:59:59";
|
||||
m_timeFormats["ampm2"].exp[KLocale::TimeWithoutSeconds] = "3:59 PM";
|
||||
m_timeFormats["ampm2"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeWithoutAmPm] = "3:59";
|
||||
m_timeFormats["ampm2"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeDuration] = "15:59";
|
||||
m_timeFormats["ampm2"].exp[KLocale::TimeFoldHours] = "959:59";
|
||||
m_timeFormats["ampm2"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeFoldHours] = "959";
|
||||
|
||||
m_timeFormats["ag"].timeFormat = "%I.%M.%S.%p";
|
||||
m_timeFormats["ag"].exp[KLocale::TimeDefault] = "03.59.59.PM";
|
||||
m_timeFormats["ag"].exp[KLocale::TimeWithoutAmPm] = "03.59.59";
|
||||
m_timeFormats["ag"].exp[KLocale::TimeDuration] = "15.59.59";
|
||||
m_timeFormats["ag"].exp[KLocale::TimeWithoutSeconds] = "03.59.PM";
|
||||
m_timeFormats["ag"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeWithoutAmPm] = "03.59";
|
||||
m_timeFormats["ag"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeDuration] = "15.59";
|
||||
m_timeFormats["ag"].exp[KLocale::TimeFoldHours] = "959.59";
|
||||
m_timeFormats["ag"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeFoldHours] = "959";
|
||||
|
||||
m_timeFormats["ampre"].timeFormat = "%p %l-%M-%S";
|
||||
m_timeFormats["ampre"].exp[KLocale::TimeDefault] = "PM 3-59-59";
|
||||
m_timeFormats["ampre"].exp[KLocale::TimeWithoutAmPm] = "3-59-59";
|
||||
m_timeFormats["ampre"].exp[KLocale::TimeDuration] = "15-59-59";
|
||||
m_timeFormats["ampre"].exp[KLocale::TimeWithoutSeconds] = "PM 3-59";
|
||||
m_timeFormats["ampre"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeWithoutAmPm] = "3-59";
|
||||
m_timeFormats["ampre"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeDuration] = "15-59";
|
||||
m_timeFormats["ampre"].exp[KLocale::TimeFoldHours] = "959-59";
|
||||
m_timeFormats["ampre"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeFoldHours] = "959";
|
||||
|
||||
m_timeFormats["ampresep"].timeFormat = "%p-%l-%M-%S";
|
||||
m_timeFormats["ampresep"].exp[KLocale::TimeDefault] = "PM-3-59-59";
|
||||
m_timeFormats["ampresep"].exp[KLocale::TimeWithoutAmPm] = "3-59-59";
|
||||
m_timeFormats["ampresep"].exp[KLocale::TimeDuration] = "15-59-59";
|
||||
m_timeFormats["ampresep"].exp[KLocale::TimeWithoutSeconds] = "PM-3-59";
|
||||
m_timeFormats["ampresep"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeWithoutAmPm] = "3-59";
|
||||
m_timeFormats["ampresep"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeDuration] = "15-59";
|
||||
m_timeFormats["ampresep"].exp[KLocale::TimeFoldHours] = "959-59";
|
||||
m_timeFormats["ampresep"].exp[KLocale::TimeWithoutSeconds | KLocale::TimeFoldHours] = "959";
|
||||
}
|
||||
|
||||
void KLocaleTimeFormatTest::formatTimeTest()
|
||||
{
|
||||
KLocale locale(*KLocale::global());
|
||||
QTime time(15, 59, 59);
|
||||
|
||||
QMap<QString, TimeFormatTestValue>::const_iterator it;
|
||||
QMap<QString, TimeFormatTestValue>::const_iterator end(m_timeFormats.constEnd());
|
||||
for (it = m_timeFormats.constBegin(); it != end; ++it) {
|
||||
locale.setTimeFormat(it.value().timeFormat);
|
||||
|
||||
QMap<KLocale::TimeFormatOptions, QString>::const_iterator it2;
|
||||
QMap<KLocale::TimeFormatOptions, QString>::const_iterator end2(it.value().exp.constEnd());
|
||||
for (it2 = it.value().exp.constBegin(); it2 != end2; ++it2) {
|
||||
QCOMPARE(locale.formatLocaleTime(time, it2.key()), it2.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KLocaleTimeFormatTest::readTimeTest()
|
||||
{
|
||||
KLocale locale(*KLocale::global());
|
||||
QMap<KLocale::TimeFormatOptions, QTime> timeMap;
|
||||
timeMap[KLocale::TimeDefault] = QTime(15, 59, 59);
|
||||
timeMap[KLocale::TimeWithoutSeconds] = QTime(15, 59, 0);
|
||||
timeMap[KLocale::TimeDuration] = QTime(15, 59, 59);
|
||||
timeMap[KLocale::TimeDuration | KLocale::TimeWithoutSeconds] = QTime(15, 59, 0);
|
||||
timeMap[KLocale::TimeWithoutAmPm] = QTime(3, 59, 59);
|
||||
timeMap[KLocale::TimeWithoutSeconds | KLocale::TimeWithoutAmPm] = QTime(3, 59, 0);
|
||||
timeMap[KLocale::TimeFoldHours] = QTime(15, 59, 59);
|
||||
timeMap[KLocale::TimeWithoutSeconds | KLocale::TimeFoldHours] = QTime(15, 59);
|
||||
|
||||
QMap<QString, TimeFormatTestValue>::const_iterator it;
|
||||
QMap<QString, TimeFormatTestValue>::const_iterator end(m_timeFormats.constEnd());
|
||||
for (it = m_timeFormats.constBegin(); it != end; ++it) {
|
||||
locale.setTimeFormat(it.value().timeFormat);
|
||||
|
||||
bool ampm = locale.timeFormat().contains(QLatin1String("%p"));
|
||||
|
||||
QMap<KLocale::TimeFormatOptions, QString>::const_iterator it2;
|
||||
QMap<KLocale::TimeFormatOptions, QString>::const_iterator end2(it.value().exp.constEnd());
|
||||
for (it2 = it.value().exp.constBegin(); it2 != end2; ++it2) {
|
||||
KLocale::TimeFormatOptions options = it2.key();
|
||||
if ((options & KLocale::TimeDuration) != KLocale::TimeDuration && !ampm) {
|
||||
options &= ~KLocale::TimeWithoutAmPm;
|
||||
}
|
||||
if (!timeMap.contains(options)) {
|
||||
QWARN("Missing entry in timeMap, skipping");
|
||||
continue;
|
||||
}
|
||||
bool ok;
|
||||
QCOMPARE(locale.readLocaleTime(it2.value(), &ok, it2.key()), timeMap[options]);
|
||||
QVERIFY(ok);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KLocaleTimeFormatTest::formatAndReadAllCountriesTest()
|
||||
{
|
||||
KLocale locale(*KLocale::global());
|
||||
|
||||
// for each of the countries, format with any options, read again
|
||||
// and check if times match.
|
||||
QTime timeS(15, 59, 59);
|
||||
QTime timeNs(15, 59, 0);
|
||||
QTime timeAm(3, 59, 59);
|
||||
QTime timeNsAm(3, 59, 0);
|
||||
|
||||
QMap<QString, QString>::const_iterator it(m_allFormats.constBegin());
|
||||
QMap<QString, QString>::const_iterator end(m_allFormats.constEnd());
|
||||
for (; it != end; ++it) {
|
||||
locale.setTimeFormat(it.value());
|
||||
|
||||
bool ampm = locale.timeFormat().contains(QLatin1String("%p"));
|
||||
|
||||
bool ok;
|
||||
QCOMPARE(locale.readLocaleTime(locale.formatLocaleTime(timeS, KLocale::TimeDefault), &ok, KLocale::TimeDefault), timeS);
|
||||
QVERIFY(ok);
|
||||
QCOMPARE(locale.readLocaleTime(locale.formatLocaleTime(timeS, KLocale::TimeWithoutAmPm), &ok, KLocale::TimeWithoutAmPm), ampm ? timeAm : timeS);
|
||||
QVERIFY(ok);
|
||||
QCOMPARE(locale.readLocaleTime(locale.formatLocaleTime(timeS, KLocale::TimeDuration), &ok, KLocale::TimeDuration), timeS);
|
||||
QVERIFY(ok);
|
||||
|
||||
QCOMPARE(locale.readLocaleTime(locale.formatLocaleTime(timeS, KLocale::TimeWithoutSeconds), &ok, KLocale::TimeWithoutSeconds), timeNs);
|
||||
QVERIFY(ok);
|
||||
QCOMPARE(locale.readLocaleTime(locale.formatLocaleTime(timeS, KLocale::TimeWithoutSeconds | KLocale::TimeWithoutAmPm), &ok, KLocale::TimeWithoutSeconds | KLocale::TimeWithoutAmPm), ampm ? timeNsAm : timeNs);
|
||||
QVERIFY(ok);
|
||||
QCOMPARE(locale.readLocaleTime(locale.formatLocaleTime(timeS, KLocale::TimeWithoutSeconds | KLocale::TimeDuration), &ok, KLocale::TimeWithoutSeconds | KLocale::TimeDuration), timeNs);
|
||||
QVERIFY(ok);
|
||||
QCOMPARE(locale.readLocaleTime(locale.formatLocaleTime(timeS, KLocale::TimeFoldHours), &ok, KLocale::TimeFoldHours), timeS);
|
||||
QVERIFY(ok);
|
||||
QCOMPARE(locale.readLocaleTime(locale.formatLocaleTime(timeS, KLocale::TimeWithoutSeconds | KLocale::TimeFoldHours), &ok, KLocale::TimeWithoutSeconds | KLocale::TimeFoldHours), timeNs);
|
||||
}
|
||||
}
|
||||
|
||||
QTEST_MAIN(KLocaleTimeFormatTest)
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* This file is part of the KDE libraries.
|
||||
* Copyright 2009 Michael Leupold <lemma@confuego.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) version 3, or any
|
||||
* later version accepted by the membership of KDE e.V. (or its
|
||||
* successor approved by the membership of KDE e.V.), which shall
|
||||
* act as a proxy defined in Section 6 of version 3 of the license.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef KLOCALETIMEFORMATTEST_H
|
||||
#define KLOCALETIMEFORMATTEST_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QTime>
|
||||
#include <QMap>
|
||||
#include <klocale.h>
|
||||
|
||||
struct TimeFormatTestValue {
|
||||
QString timeFormat; // time format string
|
||||
// expected values for the various format options
|
||||
QMap<KLocale::TimeFormatOptions, QString> exp;
|
||||
};
|
||||
|
||||
class KLocaleTimeFormatTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
|
||||
void formatTimeTest();
|
||||
void readTimeTest();
|
||||
|
||||
void formatAndReadAllCountriesTest();
|
||||
|
||||
private:
|
||||
QMap<QString, TimeFormatTestValue> m_timeFormats;
|
||||
QMap<QString, QString> m_allFormats;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2011 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
//#include <kaboutdata.h>
|
||||
#include <klockfile.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
//KAboutData about("klockfile_testlock", 0, qi18n("klockfile_testlock"), "version");
|
||||
|
||||
if (argc <= 1) {
|
||||
return KLockFile::LockError;
|
||||
}
|
||||
|
||||
const QString lockName = QString::fromLocal8Bit(argv[1]);
|
||||
|
||||
KLockFile lockFile(lockName);
|
||||
if (lockFile.isLocked()) {
|
||||
return KLockFile::LockError;
|
||||
}
|
||||
return lockFile.lock(KLockFile::NoBlockFlag);
|
||||
}
|
|
@ -0,0 +1,174 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005 Thomas Braxton <brax108@cox.net>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "klockfiletest.h"
|
||||
#include "moc_klockfiletest.cpp"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <QTest>
|
||||
#include <QFile>
|
||||
#include <QProcess>
|
||||
#include <QIODevice>
|
||||
#include <QTextStream>
|
||||
#include <QtConcurrentRun>
|
||||
|
||||
namespace QTest
|
||||
{
|
||||
|
||||
char *toString(const KLockFile::LockResult &result)
|
||||
{
|
||||
static const char *const strings[] = {
|
||||
"LockOK", "LockFail", "LockError", "LockStale"
|
||||
};
|
||||
return qstrdup(strings[result]);
|
||||
}
|
||||
}
|
||||
|
||||
// Here's how to test file locking on a FAT filesystem, on linux:
|
||||
// cd /tmp
|
||||
// dd if=/dev/zero of=fatfile count=180000
|
||||
// mkfs.vfat -F32 fatfile
|
||||
// mkdir -p fatsystem
|
||||
// sudo mount -o loop -o uid=$UID fatfile fatsystem
|
||||
//
|
||||
// static const char *const lockName = "/tmp/fatsystem/klockfiletest.lock";
|
||||
//
|
||||
// =====================================================================
|
||||
//
|
||||
// And here's how to test file locking over NFS, on linux:
|
||||
// In /etc/exports: /tmp/nfs localhost(rw,sync,no_subtree_check)
|
||||
// sudo mount -t nfs localhost:/tmp/nfs /tmp/nfs-mount
|
||||
//
|
||||
// static const char *const lockName = "/tmp/nfs-mount/klockfiletest.lock";
|
||||
//
|
||||
// =====================================================================
|
||||
//
|
||||
|
||||
static const char *const lockName = "klockfiletest.lock";
|
||||
|
||||
void Test_KLockFile::initTestCase()
|
||||
{
|
||||
qApp->setApplicationName(QLatin1String("qttest"));
|
||||
QDir::setCurrent(QCoreApplication::applicationDirPath());
|
||||
QFile::remove(QString::fromLatin1(lockName));
|
||||
lockFile = new KLockFile(QLatin1String(lockName));
|
||||
}
|
||||
|
||||
void Test_KLockFile::cleanupTestCase()
|
||||
{
|
||||
delete lockFile;
|
||||
}
|
||||
|
||||
static KLockFile::LockResult testLockFromProcess(const QString &lockName)
|
||||
{
|
||||
const int ret = QProcess::execute(QString::fromLatin1("./klockfile_testlock"), QStringList() << lockName);
|
||||
return KLockFile::LockResult(ret);
|
||||
}
|
||||
|
||||
static KLockFile::LockResult testLockFromThread()
|
||||
{
|
||||
KLockFile *lockFile = new KLockFile(QLatin1String(lockName));
|
||||
KLockFile::LockResult result = lockFile->lock(KLockFile::NoBlockFlag);
|
||||
delete lockFile;
|
||||
return result;
|
||||
}
|
||||
|
||||
void Test_KLockFile::testLock()
|
||||
{
|
||||
QVERIFY(!lockFile->isLocked());
|
||||
QCOMPARE(lockFile->lock(), KLockFile::LockOK);
|
||||
QVERIFY(lockFile->isLocked());
|
||||
|
||||
// Try to lock it again, should fail
|
||||
KLockFile *lockFile2 = new KLockFile(QLatin1String(lockName));
|
||||
QVERIFY(!lockFile2->isLocked());
|
||||
QCOMPARE(lockFile2->lock(KLockFile::NoBlockFlag), KLockFile::LockFail);
|
||||
QVERIFY(!lockFile2->isLocked());
|
||||
delete lockFile2;
|
||||
|
||||
// Try from a different process.
|
||||
QCOMPARE(testLockFromProcess(QLatin1String(lockName)), KLockFile::LockFail);
|
||||
|
||||
// Also try from a different thread.
|
||||
QFuture<KLockFile::LockResult> ret = QtConcurrent::run<KLockFile::LockResult>(testLockFromThread);
|
||||
QCOMPARE(ret.result(), KLockFile::LockFail);
|
||||
}
|
||||
|
||||
void Test_KLockFile::testStale()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
qDebug("unix stale lock support not implemented yet");
|
||||
#else
|
||||
QVERIFY(lockFile->isLocked());
|
||||
|
||||
const int secs = 2;
|
||||
KLockFile lf = KLockFile(QLatin1String(lockName));
|
||||
lf.setStaleTime(secs);
|
||||
QVERIFY(lf.staleTime() == secs);
|
||||
|
||||
QTest::qWait(secs * 1000);
|
||||
QCOMPARE(lf.lock(), KLockFile::LockStale);
|
||||
QVERIFY(!lf.isLocked());
|
||||
|
||||
int pid;
|
||||
QString host, app;
|
||||
if (lf.getLockInfo(pid, host, app)) {
|
||||
QCOMPARE(pid, ::getpid());
|
||||
char hostname[256];
|
||||
if (::gethostname(hostname, sizeof(hostname)) == 0) {
|
||||
QCOMPARE(host, QLatin1String(hostname));
|
||||
}
|
||||
QCOMPARE(app, QLatin1String("qttest")); // this is our app name
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Test_KLockFile::testUnlock()
|
||||
{
|
||||
QVERIFY(lockFile->isLocked());
|
||||
lockFile->unlock();
|
||||
QVERIFY(!lockFile->isLocked());
|
||||
}
|
||||
|
||||
void Test_KLockFile::testStaleNoBlockFlag()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
QSKIP("lockfile on windows has different format", SkipSingle);
|
||||
#else
|
||||
char hostname[256];
|
||||
::gethostname(hostname, sizeof(hostname));
|
||||
|
||||
QFile f(QString::fromLatin1(lockName));
|
||||
QVERIFY(f.open(QIODevice::WriteOnly));
|
||||
QTextStream stream(&f);
|
||||
stream << QString::number(111222) << endl << QLatin1String("qttest") << endl << hostname << endl;
|
||||
stream.flush();
|
||||
f.close();
|
||||
|
||||
KLockFile lockFile(QString::fromLatin1(lockName));
|
||||
QVERIFY(!lockFile.isLocked());
|
||||
QCOMPARE(lockFile.lock(KLockFile::NoBlockFlag), KLockFile::LockStale);
|
||||
QByteArray expectedMsg = QByteArray("WARNING: deleting stale lockfile ") + lockName;
|
||||
QTest::ignoreMessage(QtWarningMsg, expectedMsg.data());
|
||||
QCOMPARE(lockFile.lock(KLockFile::NoBlockFlag | KLockFile::ForceFlag), KLockFile::LockOK);
|
||||
|
||||
QVERIFY(lockFile.isLocked());
|
||||
#endif
|
||||
}
|
||||
|
||||
QTEST_MAIN(Test_KLockFile)
|
|
@ -0,0 +1,39 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005 Thomas Braxton <brax108@cox.net>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KLOCKFILETEST_H
|
||||
#define KLOCKFILETEST_H
|
||||
|
||||
#include "klockfile.h"
|
||||
#include <QObject>
|
||||
|
||||
class Test_KLockFile : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
KLockFile *lockFile;
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void testLock();
|
||||
void testStale();
|
||||
void testUnlock();
|
||||
void testStaleNoBlockFlag();
|
||||
void cleanupTestCase();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
This file is part of the KDE libraries
|
||||
|
||||
Copyright (C) 2011 Volker Krause <vkrause@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <kmd5.h>
|
||||
#include <qtest_kde.h>
|
||||
|
||||
#include <QCryptographicHash>
|
||||
|
||||
class KMd5Benchmark : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
static QByteArray makeByteArray(int size)
|
||||
{
|
||||
QByteArray b;
|
||||
b.resize(size);
|
||||
for (int i = 0; i < size; ++i) {
|
||||
b[i] = static_cast<char>(i % 255);
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
static void makeData()
|
||||
{
|
||||
QTest::addColumn<QByteArray>("input");
|
||||
QTest::newRow("empty") << QByteArray();
|
||||
QTest::newRow("32") << makeByteArray(32);
|
||||
QTest::newRow("128") << makeByteArray(128);
|
||||
QTest::newRow("1024") << makeByteArray(1 << 10);
|
||||
QTest::newRow("1M") << makeByteArray(1 << 20);
|
||||
QTest::newRow("16M") << makeByteArray(1 << 24);
|
||||
}
|
||||
|
||||
private Q_SLOTS:
|
||||
void benchmarkKMd5_data()
|
||||
{
|
||||
makeData();
|
||||
}
|
||||
|
||||
void benchmarkKMd5()
|
||||
{
|
||||
QFETCH(QByteArray, input);
|
||||
QBENCHMARK {
|
||||
KMD5 md5(input);
|
||||
md5.rawDigest();
|
||||
}
|
||||
}
|
||||
|
||||
void benchmarkKMd5WithReset_data()
|
||||
{
|
||||
makeData();
|
||||
}
|
||||
|
||||
void benchmarkKMd5WithReset()
|
||||
{
|
||||
QFETCH(QByteArray, input);
|
||||
KMD5 md5;
|
||||
QBENCHMARK {
|
||||
md5.reset();
|
||||
md5.update(input);
|
||||
md5.rawDigest();
|
||||
}
|
||||
}
|
||||
|
||||
void benchmarkQCH_data()
|
||||
{
|
||||
makeData();
|
||||
}
|
||||
|
||||
void benchmarkQCH()
|
||||
{
|
||||
QFETCH(QByteArray, input);
|
||||
QBENCHMARK {
|
||||
QCryptographicHash h(QCryptographicHash::Md5);
|
||||
h.addData(input);
|
||||
h.result();
|
||||
}
|
||||
}
|
||||
|
||||
void benchmarkQCHWithReset_data()
|
||||
{
|
||||
makeData();
|
||||
}
|
||||
|
||||
void benchmarkQCHWithReset()
|
||||
{
|
||||
QFETCH(QByteArray, input);
|
||||
QCryptographicHash h(QCryptographicHash::Md5);
|
||||
QBENCHMARK {
|
||||
h.reset();
|
||||
h.addData(input);
|
||||
h.result();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
QTEST_KDEMAIN_CORE(KMd5Benchmark)
|
||||
|
||||
#include "kmd5benchmark.moc"
|
|
@ -0,0 +1,74 @@
|
|||
/* This file is part of the KDE project
|
||||
Copyright (C) 2011 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QtGlobal>
|
||||
#include <QUrl>
|
||||
#include <kcomponentdata.h>
|
||||
#include <kmimetype.h>
|
||||
#include <kmessage.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
class KTestMessageHandler : public KMessageHandler
|
||||
{
|
||||
public:
|
||||
void message(KMessage::MessageType type, const QString &text, const QString &caption) override
|
||||
{
|
||||
Q_UNUSED(type);
|
||||
Q_UNUSED(caption);
|
||||
m_messages.append(text);
|
||||
}
|
||||
|
||||
QStringList m_messages;
|
||||
};
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
|
||||
// Test what happens when there are no mimetypes installed.
|
||||
|
||||
qputenv("XDG_DATA_DIRS", "/doesnotexist");
|
||||
|
||||
KComponentData cData("foo");
|
||||
|
||||
KTestMessageHandler *msgHandler = new KTestMessageHandler;
|
||||
KMessage::setMessageHandler(msgHandler);
|
||||
|
||||
KMimeType::Ptr s0 = KMimeType::mimeType("application/x-zerosize");
|
||||
Q_ASSERT(s0); // QMimeType falls back to its own copy freedesktop.org.xml, so this works!
|
||||
if (!s0) {
|
||||
abort();
|
||||
return 1;
|
||||
}
|
||||
|
||||
KMimeType::Ptr mime = KMimeType::findByUrl(QUrl::fromLocalFile("/"));
|
||||
Q_ASSERT(mime);
|
||||
Q_ASSERT(mime->name() == "inode/directory");
|
||||
if (!mime) {
|
||||
abort();
|
||||
return 2;
|
||||
}
|
||||
|
||||
Q_ASSERT(msgHandler->m_messages.count() == 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,920 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2009 David Faure <faure@kde.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License or ( at
|
||||
* your option ) version 3 or, at the discretion of KDE e.V. ( which shall
|
||||
* act as a proxy as in section 14 of the GPLv3 ), any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public License
|
||||
* along with this library; see the file COPYING.LIB. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "kmimetypetest.h"
|
||||
|
||||
#include <kde_file.h>
|
||||
#include <kdeversion.h> // KDE_MAKE_VERSION
|
||||
#include <kmimetype.h>
|
||||
#include <ksycoca.h>
|
||||
#include <kuser.h>
|
||||
#include <qtemporarydir.h>
|
||||
#include <kconfiggroup.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
#include <qtest_kde.h> // WARNING: do not port to qtest.h without adding a putenv for XDG_DATA_HOME! User data loss will occur otherwise.
|
||||
#include <qstandardpaths.h>
|
||||
#include <qprocess.h>
|
||||
#include <kmimetypetrader.h>
|
||||
#include <kservicetypetrader.h>
|
||||
#include <kmimetyperepository_p.h>
|
||||
#include <qtemporaryfile.h>
|
||||
#include <kdesktopfile.h>
|
||||
|
||||
#include <QtConcurrent>
|
||||
|
||||
extern KSERVICE_EXPORT bool kservice_require_kded;
|
||||
|
||||
static int initializeLang()
|
||||
{
|
||||
qputenv("LC_ALL", "en_US");
|
||||
qputenv("LANG", "en_US");
|
||||
qputenv("XDG_CURRENT_DESKTOP", "KDE");
|
||||
kservice_require_kded = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Set LANG before QCoreApplication is created
|
||||
Q_CONSTRUCTOR_FUNCTION(initializeLang)
|
||||
|
||||
void KMimeTypeTest::initTestCase()
|
||||
{
|
||||
// Clean up local xdg dir in case of leftover mimetype definitions
|
||||
const QString xdgDir = QString::fromLocal8Bit(getenv("XDG_DATA_HOME"));
|
||||
if (!xdgDir.isEmpty()) {
|
||||
QDir d_(xdgDir);
|
||||
d_.removeRecursively();
|
||||
// No need to run update-mime-database here, the dir is entirely gone.
|
||||
}
|
||||
|
||||
bool mustUpdateKSycoca = false;
|
||||
|
||||
// Create fake text/x-patch part.
|
||||
const QString fakePatchPart = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kservices5/") + "fakepatchpart.desktop";
|
||||
const bool mustCreatePatchPart = !QFile::exists(fakePatchPart);
|
||||
if (mustCreatePatchPart) {
|
||||
mustUpdateKSycoca = true;
|
||||
KDesktopFile file(fakePatchPart);
|
||||
KConfigGroup group = file.desktopGroup();
|
||||
group.writeEntry("Name", "FakePatchPart");
|
||||
group.writeEntry("Type", "Service");
|
||||
group.writeEntry("X-KDE-Library", "fakepatchpart");
|
||||
group.writeEntry("ServiceTypes", "KParts/ReadOnlyPart");
|
||||
group.writeEntry("MimeType", "text/x-diff;"); // Use an alias on purpose, to test if that works
|
||||
group.writeEntry("InitialPreference", 5);
|
||||
}
|
||||
|
||||
// Create fake text/plain part with a higher initial preference than the patch part.
|
||||
QString fakePart = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kservices5/") + "faketextpart.desktop";
|
||||
const bool mustCreate = !QFile::exists(fakePart);
|
||||
if (mustCreate) {
|
||||
mustUpdateKSycoca = true;
|
||||
KDesktopFile file(fakePart);
|
||||
KConfigGroup group = file.desktopGroup();
|
||||
group.writeEntry("Name", "FakePart");
|
||||
group.writeEntry("Type", "Service");
|
||||
group.writeEntry("X-KDE-Library", "faketextpart");
|
||||
group.writeEntry("ServiceTypes", "KParts/ReadOnlyPart");
|
||||
group.writeEntry("MimeType", "text/plain;");
|
||||
group.writeEntry("InitialPreference", 100);
|
||||
}
|
||||
|
||||
// Create fake text/plain ktexteditor plugin.
|
||||
QString fakePlugin = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kservices5/") + "faketextplugin.desktop";
|
||||
const bool mustCreatePlugin = !QFile::exists(fakePlugin);
|
||||
if (mustCreatePlugin) {
|
||||
mustUpdateKSycoca = true;
|
||||
KDesktopFile file(fakePlugin);
|
||||
KConfigGroup group = file.desktopGroup();
|
||||
group.writeEntry("Name", "FakePlugin");
|
||||
group.writeEntry("Type", "Service");
|
||||
group.writeEntry("X-KDE-Library", "faketextplugin");
|
||||
group.writeEntry("ServiceTypes", "KPluginInfo");
|
||||
group.writeEntry("MimeType", "text/plain;");
|
||||
}
|
||||
|
||||
// Create fake "NotShowIn=KDE" service
|
||||
m_nonKdeApp = QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation) + QLatin1Char('/') + "fake_nonkde_application.desktop";
|
||||
const bool mustCreateNonKdeApp = !QFile::exists(m_nonKdeApp);
|
||||
if (mustCreateNonKdeApp) {
|
||||
mustUpdateKSycoca = true;
|
||||
KDesktopFile file(m_nonKdeApp);
|
||||
KConfigGroup group = file.desktopGroup();
|
||||
group.writeEntry("Name", "NonKDEApp");
|
||||
group.writeEntry("Type", "Application");
|
||||
group.writeEntry("Exec", "xterm");
|
||||
group.writeEntry("NotShowIn", "KDE;FVWM;");
|
||||
group.writeEntry("MimeType", "text/plain;");
|
||||
group.writeEntry("InitialPreference", "50");
|
||||
group.writeEntry("Categories", "Qt;KDE;");
|
||||
}
|
||||
m_nonKdeApp = QFileInfo(m_nonKdeApp).canonicalFilePath();
|
||||
|
||||
// Create fake text/plain app
|
||||
m_textPlainApp = QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation) + QLatin1Char('/') + "fake_textplain_application.desktop";
|
||||
const bool mustCreateTextPlainApp = !QFile::exists(m_textPlainApp);
|
||||
if (mustCreateTextPlainApp) {
|
||||
mustUpdateKSycoca = true;
|
||||
KDesktopFile file(m_textPlainApp);
|
||||
KConfigGroup group = file.desktopGroup();
|
||||
group.writeEntry("Name", "NonKDEApp");
|
||||
group.writeEntry("Type", "Application");
|
||||
group.writeEntry("Exec", "xterm");
|
||||
group.writeEntry("MimeType", "text/plain;");
|
||||
group.writeEntry("InitialPreference", "40");
|
||||
group.writeEntry("Categories", "Qt;KDE;");
|
||||
}
|
||||
m_textPlainApp = QFileInfo(m_textPlainApp).canonicalFilePath();
|
||||
|
||||
if (mustUpdateKSycoca) {
|
||||
// Update ksycoca in ~/.kde-unit-test after creating the above
|
||||
QProcess::execute(QStandardPaths::findExecutable(KBUILDSYCOCA_EXENAME), QStringList());
|
||||
}
|
||||
|
||||
QVERIFY(KService::serviceByStorageId("fake_nonkde_application.desktop"));
|
||||
QVERIFY(KService::serviceByDesktopPath(m_nonKdeApp)); // the desktoppath is the full path nowadays
|
||||
QVERIFY(KService::serviceByStorageId("fake_textplain_application.desktop"));
|
||||
QVERIFY(KService::serviceByDesktopPath(m_textPlainApp));
|
||||
}
|
||||
|
||||
void KMimeTypeTest::cleanupTestCase()
|
||||
{
|
||||
// If I want the konqueror unit tests to work, then I better not have a non-working part
|
||||
// as the preferred part for text/plain...
|
||||
const QString fakePatchPart = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kservices5/") + "fakepatchpart.desktop";
|
||||
QFile::remove(fakePatchPart);
|
||||
const QString fakePart = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kservices5/") + "faketextpart.desktop";
|
||||
QFile::remove(fakePart);
|
||||
const QString fakePlugin = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kservices5/") + "faketextplugin.desktop";
|
||||
QFile::remove(fakePlugin);
|
||||
QFile::remove(m_textPlainApp);
|
||||
QFile::remove(m_nonKdeApp);
|
||||
QProcess proc;
|
||||
proc.setProcessChannelMode(QProcess::MergedChannels); // silence kbuildsycoca output
|
||||
proc.start(QStandardPaths::findExecutable(KBUILDSYCOCA_EXENAME), QStringList());
|
||||
proc.waitForFinished();
|
||||
}
|
||||
|
||||
QTEST_KDEMAIN_CORE(KMimeTypeTest)
|
||||
|
||||
void KMimeTypeTest::testByName()
|
||||
{
|
||||
KMimeType::Ptr s0 = KMimeType::mimeType("application/x-zerosize");
|
||||
QVERIFY(s0);
|
||||
QCOMPARE(s0->name(), QString::fromLatin1("application/x-zerosize"));
|
||||
QCOMPARE(s0->comment(), QString::fromLatin1("empty document"));
|
||||
|
||||
KMimeType::Ptr s0Again = KMimeType::mimeType("application/x-zerosize");
|
||||
QCOMPARE(s0Again->name(), s0->name());
|
||||
QVERIFY(s0Again != s0);
|
||||
|
||||
KMimeType::Ptr s1 = KMimeType::mimeType("text/plain");
|
||||
QVERIFY(s1);
|
||||
QCOMPARE(s1->name(), QString::fromLatin1("text/plain"));
|
||||
//qDebug("Comment is %s", qPrintable(s1->comment()) );
|
||||
|
||||
KMimeType::Ptr krita = KMimeType::mimeType("application/x-krita");
|
||||
QVERIFY(krita);
|
||||
|
||||
// Test <comment> parsing with application/rdf+xml which has the english comment after the other ones
|
||||
KMimeType::Ptr rdf = KMimeType::mimeType("application/rdf+xml");
|
||||
QVERIFY(rdf);
|
||||
QCOMPARE(rdf->comment(), QString::fromLatin1("RDF file"));
|
||||
|
||||
KMimeType::Ptr bzip2 = KMimeType::mimeType("application/x-bzip2");
|
||||
QVERIFY(bzip2);
|
||||
QCOMPARE(bzip2->comment(), QString::fromLatin1("Bzip archive"));
|
||||
|
||||
KMimeType::Ptr defaultMime = KMimeType::mimeType("application/octet-stream");
|
||||
QVERIFY(defaultMime);
|
||||
QVERIFY(defaultMime->isDefault());
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testIcons()
|
||||
{
|
||||
if (!KUser().isSuperUser()) { // Can't test this one if running as root
|
||||
QString emptyString; // gcc-3.3 workaround
|
||||
QTemporaryDir tmp(emptyString);
|
||||
QFile(tmp.path()).setPermissions(QFileDevice::Permissions());
|
||||
tmp.setAutoRemove(true);
|
||||
//KUrl url( tmp.path() );
|
||||
//QCOMPARE(KIO::iconNameForUrl(url), "inode-directory"); // was folder_locked, but we don't have that anymore - TODO
|
||||
QFile(tmp.path()).setPermissions(QFile::ReadOwner | QFile::ExeOwner); // so we can 'rm -rf' it
|
||||
}
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testFindByPathUsingFileName_data()
|
||||
{
|
||||
QTest::addColumn<QString>("fileName");
|
||||
QTest::addColumn<QString>("expectedMimeType");
|
||||
// Maybe we could also add a expectedAccuracy column...
|
||||
|
||||
QTest::newRow("text") << "textfile.txt" << "text/plain";
|
||||
QTest::newRow("case-insensitive search") << "textfile.TxT" << "text/plain";
|
||||
// With QMime, this needs shared-mime-info > 0.91. Earlier versions wrote .Z to the mime.cache file...
|
||||
if (KMimeType::sharedMimeInfoVersion() > KDE_MAKE_VERSION(0, 91, 0)) {
|
||||
QTest::newRow("case-insensitive match on a non-lowercase glob") << "foo.z" << "application/x-compress";
|
||||
}
|
||||
|
||||
QTest::newRow("case-sensitive uppercase match") << "textfile.C" << "text/x-c++src";
|
||||
QTest::newRow("case-sensitive lowercase match") << "textfile.c" << "text/x-csrc";
|
||||
QTest::newRow("case-sensitive long-extension match") << "foo.PS.gz" << "application/x-gzpostscript";
|
||||
QTest::newRow("case-sensitive-only match") << "core" << "application/x-core";
|
||||
QTest::newRow("case-sensitive-only match") << "Core" << "application/octet-stream"; // #198477
|
||||
|
||||
QTest::newRow("desktop file") << "foo.desktop" << "application/x-desktop";
|
||||
QTest::newRow("old kdelnk file is x-desktop too") << "foo.kdelnk" << "application/x-desktop";
|
||||
QTest::newRow("double-extension file") << "foo.tar.bz2" << "application/x-bzip-compressed-tar";
|
||||
QTest::newRow("single-extension file") << "foo.bz2" << "application/x-bzip";
|
||||
QTest::newRow(".doc should assume msword") << "somefile.doc" << "application/msword"; // #204139
|
||||
QTest::newRow("glob that uses [] syntax, 1") << "Makefile" << "text/x-makefile";
|
||||
QTest::newRow("glob that uses [] syntax, 2") << "makefile" << "text/x-makefile";
|
||||
QTest::newRow("glob that ends with *, no extension") << "README" << "text/x-readme";
|
||||
QTest::newRow("glob that ends with *, extension") << "README.foo" << "text/x-readme";
|
||||
QTest::newRow("glob that ends with *, also matches *.txt. Higher weight wins.") << "README.txt" << "text/plain";
|
||||
QTest::newRow("glob that ends with *, also matches *.nfo. Higher weight wins.") << "README.nfo" << "text/x-nfo";
|
||||
// fdo bug 15436, needs shared-mime-info >= 0.40 (and this tests the globs2-parsing code).
|
||||
QTest::newRow("glob that ends with *, also matches *.pdf. *.pdf has higher weight") << "README.pdf" << "application/pdf";
|
||||
QTest::newRow("directory") << "/" << "inode/directory";
|
||||
QTest::newRow("doesn't exist, no extension") << "IDontExist" << "application/octet-stream";
|
||||
QTest::newRow("doesn't exist but has known extension") << "IDontExist.txt" << "text/plain";
|
||||
QTest::newRow("png image") << QFINDTESTDATA("image.png") << "image/png";
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
// Windows: use cmake
|
||||
const QString exePath = QStandardPaths::findExecutable("cmake");
|
||||
QVERIFY2(!exePath.isEmpty(), "cmake not found. Isn't it in your $PATH?");
|
||||
const QString executableType = QString::fromLatin1("application/x-ms-dos-executable");
|
||||
#else
|
||||
// Linux: cmake can be found as x-sharedlib on CI for some reason, use ls like tst_qmimedatabase does
|
||||
const QString exePath = QStandardPaths::findExecutable("ls");
|
||||
QVERIFY2(!exePath.isEmpty(), "ls not found. Isn't it in your $PATH?");
|
||||
const QString executableType = QString::fromLatin1("application/x-executable");
|
||||
#endif
|
||||
QTest::newRow("executable") << exePath << executableType;
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testFindByPathUsingFileName()
|
||||
{
|
||||
QFETCH(QString, fileName);
|
||||
QFETCH(QString, expectedMimeType);
|
||||
KMimeType::Ptr mime = KMimeType::findByPath(fileName);
|
||||
QVERIFY(mime);
|
||||
if (expectedMimeType == QLatin1String("application/x-executable")) {
|
||||
// see bf87e1cfbd in qtbase
|
||||
QVERIFY(mime->name() == expectedMimeType || mime->name() == "application/x-sharedlib");
|
||||
} else {
|
||||
QCOMPARE(mime->name(), expectedMimeType);
|
||||
}
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testAdditionalGlobs_data()
|
||||
{
|
||||
// Other globs that are not in shared-mime-info but which users could define themselves.
|
||||
QTest::addColumn<QString>("filename");
|
||||
QTest::addColumn<QString>("pattern");
|
||||
QTest::addColumn<bool>("expected");
|
||||
|
||||
QTest::newRow("one star, match") << "foo.txt" << "*.txt" << true;
|
||||
QTest::newRow("README*, match") << "README.foo" << "README*" << true;
|
||||
QTest::newRow("README.*, match") << "README.foo" << "README.*" << true;
|
||||
QTest::newRow("README.*, no match") << "README" << "README.*" << false;
|
||||
QTest::newRow("two stars, match") << "andre.ts.001" << "*.ts.0*" << true;
|
||||
QTest::newRow("two stars, no match") << "andre.ts" << "*.ts.0*" << false;
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testAdditionalGlobs()
|
||||
{
|
||||
QFETCH(QString, filename);
|
||||
QFETCH(QString, pattern);
|
||||
QFETCH(bool, expected);
|
||||
|
||||
QCOMPARE(KMimeTypeRepository::matchFileName(filename, pattern), expected);
|
||||
}
|
||||
|
||||
// All the simple tests for findByPath are in testFindByPathUsingFileName_data.
|
||||
// In here we do the tests that need some content in a temporary file.
|
||||
void KMimeTypeTest::testFindByPathWithContent()
|
||||
{
|
||||
KMimeType::Ptr mime;
|
||||
|
||||
// Test a real PDF file.
|
||||
// If we find x-matlab because it starts with '%' then we are not ordering by priority.
|
||||
QTemporaryFile tempFile;
|
||||
QVERIFY(tempFile.open());
|
||||
QString tempFileName = tempFile.fileName();
|
||||
tempFile.write("%PDF-");
|
||||
tempFile.close();
|
||||
mime = KMimeType::findByPath(tempFileName);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("application/pdf"));
|
||||
// fast mode cannot find the mimetype
|
||||
mime = KMimeType::findByPath(tempFileName, 0, true);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("application/octet-stream"));
|
||||
|
||||
// Test the case where the extension doesn't match the contents: extension wins
|
||||
{
|
||||
QTemporaryFile txtTempFile(QDir::tempPath() + QLatin1String("/kmimetypetest_XXXXXX.txt"));
|
||||
QVERIFY(txtTempFile.open());
|
||||
txtTempFile.write("%PDF-");
|
||||
QString txtTempFileName = txtTempFile.fileName();
|
||||
txtTempFile.close();
|
||||
mime = KMimeType::findByPath(txtTempFileName);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("text/plain"));
|
||||
// fast mode finds the same
|
||||
mime = KMimeType::findByPath(txtTempFileName, 0, true);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("text/plain"));
|
||||
}
|
||||
|
||||
// Now the case where extension differs from contents, but contents has >80 magic rule
|
||||
// XDG spec used to say: contents wins. But we can't sniff all files...
|
||||
// XDG spec has now been amended, extensions always win.
|
||||
{
|
||||
QTemporaryFile txtTempFile(QDir::tempPath() + QLatin1String("/kmimetypetest_XXXXXX.txt"));
|
||||
QVERIFY(txtTempFile.open());
|
||||
txtTempFile.write("<smil");
|
||||
QString txtTempFileName = txtTempFile.fileName();
|
||||
txtTempFile.close();
|
||||
mime = KMimeType::findByPath(txtTempFileName);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("text/plain"));
|
||||
}
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testFindByUrl()
|
||||
{
|
||||
// Tests with local files are already done in testFindByPath,
|
||||
// here we test for remote urls only.
|
||||
KMimeType::Ptr mime;
|
||||
mime = KMimeType::findByUrl(KUrl("http://foo/bar.png"));
|
||||
QVERIFY(mime);
|
||||
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("application/octet-stream")); // HTTP can't know before downloading
|
||||
|
||||
mime = KMimeType::findByUrl(KUrl("http://foo/s0/"));
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("application/octet-stream")); // HTTP can't know before downloading
|
||||
|
||||
#if 0 // no such logic in QMimeType, we get default mimetype, KRun will figure it out
|
||||
if (!KProtocolInfo::isKnownProtocol(KUrl("man:/"))) {
|
||||
QSKIP("man protocol not installed");
|
||||
}
|
||||
|
||||
mime = KMimeType::findByUrl(KUrl("man:/ls"));
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("text/html"));
|
||||
|
||||
mime = KMimeType::findByUrl(KUrl("man:/ls/"));
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("text/html"));
|
||||
#endif
|
||||
|
||||
mime = KMimeType::findByUrl(KUrl("fish://host/test1")); // like fish does, to test for known extensions
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("application/octet-stream"));
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testFindByNameAndContent()
|
||||
{
|
||||
KMimeType::Ptr mime;
|
||||
|
||||
QByteArray textData = "Hello world";
|
||||
// textfile -> text/plain. No extension -> mimetype is found from the contents.
|
||||
mime = KMimeType::findByNameAndContent("textfile", textData);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("text/plain"));
|
||||
|
||||
// textfile.foo -> text/plain. Unknown extension -> mimetype is found from the contents.
|
||||
mime = KMimeType::findByNameAndContent("textfile.foo", textData);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("text/plain"));
|
||||
|
||||
// textfile.doc -> text/plain. We added this to the mimetype database so that it can be handled.
|
||||
mime = KMimeType::findByNameAndContent("textfile.doc", textData);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("text/plain"));
|
||||
|
||||
// mswordfile.doc -> application/msword. Found by contents, because of the above case.
|
||||
// Note that it's application/msword, not application/vnd.ms-word, since it's the former that is registered to IANA.
|
||||
QByteArray mswordData = "\320\317\021\340\241\261\032\341";
|
||||
mime = KMimeType::findByNameAndContent("mswordfile.doc", mswordData);
|
||||
QVERIFY(mime);
|
||||
if (mime->name() == "application/vnd.ms-word") { // this comes from /usr/share/mime/packages/libreoffice.xml....
|
||||
QEXPECT_FAIL("", "libreoffice.xml is messing with us", Continue);
|
||||
}
|
||||
// If you get powerpoint instead, then you're hit by https://bugs.freedesktop.org/show_bug.cgi?id=435 - upgrade to shared-mime-info >= 0.22
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("application/msword"));
|
||||
|
||||
// excelfile.xls -> application/vnd.ms-excel. Found by extension.
|
||||
mime = KMimeType::findByNameAndContent("excelfile.xls", mswordData /*same magic*/);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("application/vnd.ms-excel"));
|
||||
|
||||
// textfile.xls -> application/vnd.ms-excel. Found by extension. User shouldn't rename a text file to .xls ;)
|
||||
mime = KMimeType::findByNameAndContent("textfile.xls", textData);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("application/vnd.ms-excel"));
|
||||
|
||||
#if 0 // needs shared-mime-info >= 0.20
|
||||
QByteArray tnefData = "\x78\x9f\x3e\x22";
|
||||
mime = KMimeType::findByNameAndContent("tneffile", mswordData);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("application/vnd.ms-tnef"));
|
||||
#endif
|
||||
|
||||
QByteArray pdfData = "%PDF-";
|
||||
mime = KMimeType::findByNameAndContent("foo", pdfData);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("application/pdf"));
|
||||
|
||||
// High-priority rule (80)
|
||||
QByteArray phpData = "<?php";
|
||||
mime = KMimeType::findByNameAndContent("foo", phpData);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("application/x-php"));
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testFindByContent_data()
|
||||
{
|
||||
QTest::addColumn<QByteArray>("data");
|
||||
QTest::addColumn<QString>("expectedMimeType");
|
||||
QTest::newRow("simple text") << QByteArray("Hello world") << "text/plain";
|
||||
QTest::newRow("html: <html>") << QByteArray("<html>foo</html>") << "text/html";
|
||||
|
||||
// fixed in smi-0.30, xml magic has prio 40
|
||||
QTest::newRow("html: comment+<html>") << QByteArray("<!--foo--><html>foo</html>") << "text/html";
|
||||
// https://bugs.freedesktop.org/show_bug.cgi?id=11259, fixed in smi-0.22
|
||||
QTest::newRow("html: <script>") << QByteArray("<script>foo</script>") << "text/html";
|
||||
|
||||
QTest::newRow("pdf") << QByteArray("%PDF-") << "application/pdf";
|
||||
QTest::newRow("no mimetype known") << QByteArray("\261\032\341\265") << "application/octet-stream";
|
||||
|
||||
QByteArray mswordData = "\320\317\021\340\241\261\032\341";
|
||||
// same as \xD0\xCF\x11\xE0 \xA1\xB1\x1A\xE1
|
||||
QVERIFY(KMimeType::isBufferBinaryData(mswordData));
|
||||
// We have no magic specific to msword data, so finding x-ole-storage is correct.
|
||||
// If you get powerpoint instead, then you're hit by https://bugs.freedesktop.org/show_bug.cgi?id=435 - upgrade to shared-mime-info >= 0.22
|
||||
QTest::newRow("msword") << mswordData << "application/x-ole-storage";
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testFindByContent()
|
||||
{
|
||||
QFETCH(QByteArray, data);
|
||||
QFETCH(QString, expectedMimeType);
|
||||
|
||||
KMimeType::Ptr mime = KMimeType::findByContent(data);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), expectedMimeType);
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testFindByFileContent()
|
||||
{
|
||||
KMimeType::Ptr mime;
|
||||
int accuracy = 0;
|
||||
|
||||
// Calling findByFileContent on a directory
|
||||
mime = KMimeType::findByFileContent("/", &accuracy);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("inode/directory"));
|
||||
QCOMPARE(accuracy, 100);
|
||||
|
||||
// Albert calls findByFileContent with a URL instead of a path and gets 11021 as accuracy :)
|
||||
// It was not set inside findByFileContent -> fixed.
|
||||
mime = KMimeType::findByFileContent("file:///etc/passwd" /*bad example code, use a path instead*/, &accuracy);
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->name(), QString::fromLatin1("application/octet-stream"));
|
||||
QCOMPARE(accuracy, 0);
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testAllMimeTypes()
|
||||
{
|
||||
const KMimeType::List lst = KMimeType::allMimeTypes(); // does NOT include aliases
|
||||
QVERIFY(!lst.isEmpty());
|
||||
|
||||
for (KMimeType::List::ConstIterator it = lst.begin();
|
||||
it != lst.end(); ++it) {
|
||||
const KMimeType::Ptr mime = (*it);
|
||||
const QString name = mime->name();
|
||||
//qDebug( "%s", qPrintable( name ) );
|
||||
QVERIFY(!name.isEmpty());
|
||||
QCOMPARE(name.count('/'), 1);
|
||||
|
||||
const KMimeType::Ptr lookedupMime = KMimeType::mimeType(name);
|
||||
QVERIFY(lookedupMime); // not null
|
||||
#if 0 // this just breaks too often to run on systems with uncontrolled files in /usr/share/mime/packages
|
||||
if (name != "application/vnd.ms-word" && name != "application/x-pkcs7-certificates"
|
||||
&& name != "application/x-x509-ca-cert"
|
||||
&& name != "application/x-vnd.kde.kexi" // due to /usr/share/mime/packages/kde.xml from KDE4
|
||||
&& name != "application/x-kexiproject-sqlite" // due to /usr/share/mime/packages/kde.xml from KDE4
|
||||
&& name != "application/vnd.sun.xml.base" // libreoffice.xml messing things up yet again
|
||||
) {
|
||||
QCOMPARE(lookedupMime->name(), name);
|
||||
// if this fails, you have an alias defined as a real mimetype too!
|
||||
//
|
||||
// Note: this also happens with x-win-lnk when your kde.xml defines it as an alias, while
|
||||
// /usr/share/mime/packages/kde.xml defines it as a real mimetype. This is a false positive,
|
||||
// remove one of the kde.xml files.
|
||||
//
|
||||
// It also happens with application/x-pkcs7-certificates due to
|
||||
// /usr/share/mime/packages/gcr-crypto-types.xml. Remove that file and run
|
||||
// `update-mime-database /usr/share/mime`.
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testAlias()
|
||||
{
|
||||
const KMimeType::Ptr canonical = KMimeType::mimeType("application/xml");
|
||||
QVERIFY(canonical);
|
||||
KMimeType::Ptr alias = KMimeType::mimeType("text/xml");
|
||||
QVERIFY(alias);
|
||||
QCOMPARE(alias->name(), QString("application/xml"));
|
||||
|
||||
QVERIFY(alias->is("application/xml"));
|
||||
QVERIFY(canonical->is("text/xml"));
|
||||
|
||||
// Test for bug 197346: does nspluginscan see that audio/mp3 already exists?
|
||||
bool mustWriteMimeType = !KMimeType::mimeType("audio/mp3");
|
||||
QVERIFY(!mustWriteMimeType);
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testMimeTypeParent()
|
||||
{
|
||||
// All file-like mimetypes inherit from octet-stream
|
||||
const KMimeType::Ptr wordperfect = KMimeType::mimeType("application/vnd.wordperfect");
|
||||
QVERIFY(wordperfect);
|
||||
QCOMPARE(wordperfect->parentMimeTypes().join(","), QString("application/octet-stream"));
|
||||
QVERIFY(wordperfect->is("application/octet-stream"));
|
||||
|
||||
QVERIFY(KMimeType::mimeType("image/svg+xml-compressed")->is("application/x-gzip"));
|
||||
|
||||
// Check that msword derives from ole-storage [it didn't in 0.20, but we added it to kde.xml]
|
||||
const KMimeType::Ptr msword = KMimeType::mimeType("application/msword");
|
||||
QVERIFY(msword);
|
||||
const KMimeType::Ptr olestorage = KMimeType::mimeType("application/x-ole-storage");
|
||||
QVERIFY(olestorage);
|
||||
QVERIFY(msword->is(olestorage->name()));
|
||||
QVERIFY(msword->is("application/octet-stream"));
|
||||
|
||||
const KMimeType::Ptr directory = KMimeType::mimeType("inode/directory");
|
||||
QVERIFY(directory);
|
||||
QCOMPARE(directory->parentMimeTypes().count(), 0);
|
||||
QVERIFY(!directory->is("application/octet-stream"));
|
||||
|
||||
// Check that text/x-patch knows that it inherits from text/plain (it says so explicitly)
|
||||
const KMimeType::Ptr plain = KMimeType::mimeType("text/plain");
|
||||
const KMimeType::Ptr derived = KMimeType::mimeType("text/x-patch");
|
||||
QVERIFY(derived);
|
||||
QCOMPARE(derived->parentMimeTypes().join(","), plain->name());
|
||||
QVERIFY(derived->is("text/plain"));
|
||||
QVERIFY(derived->is("application/octet-stream"));
|
||||
|
||||
// Check that application/x-shellscript inherits from application/x-executable
|
||||
// (Otherwise KRun cannot start shellscripts...)
|
||||
// This is a test for multiple inheritance...
|
||||
const KMimeType::Ptr shellscript = KMimeType::mimeType("application/x-shellscript");
|
||||
QVERIFY(shellscript);
|
||||
QVERIFY(shellscript->is("text/plain"));
|
||||
QVERIFY(shellscript->is("application/x-executable"));
|
||||
const QStringList shellParents = shellscript->parentMimeTypes();
|
||||
QVERIFY(shellParents.contains("text/plain"));
|
||||
QVERIFY(shellParents.contains("application/x-executable"));
|
||||
QCOMPARE(shellParents.count(), 2); // only the above two
|
||||
const QStringList allShellParents = shellscript->allParentMimeTypes();
|
||||
QVERIFY(allShellParents.contains("text/plain"));
|
||||
QVERIFY(allShellParents.contains("application/x-executable"));
|
||||
QVERIFY(allShellParents.contains("application/octet-stream"));
|
||||
// Must be least-specific last, i.e. breadth first.
|
||||
QCOMPARE(allShellParents.last(), QString("application/octet-stream"));
|
||||
|
||||
// Check that text/x-mrml knows that it inherits from text/plain (implicitly)
|
||||
const KMimeType::Ptr mrml = KMimeType::mimeType("text/x-mrml");
|
||||
if (!mrml) {
|
||||
QSKIP("kdelibs not installed");
|
||||
}
|
||||
QVERIFY(mrml->is("text/plain"));
|
||||
QVERIFY(mrml->is("application/octet-stream"));
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testMimeTypeInheritancePerformance()
|
||||
{
|
||||
// Check performance of is(). In kde3 the list of mimetypes with previews had 63 items...
|
||||
// We could get it with KServiceTypeTrader::self()->query("ThumbCreator") and the "MimeTypes"
|
||||
// property, but this would give variable results and requires other modules installed.
|
||||
QStringList mimeTypes; mimeTypes << "image/jpeg" << "image/png" << "image/tiff" << "text/plain" << "text/html";
|
||||
mimeTypes += mimeTypes;
|
||||
mimeTypes += mimeTypes;
|
||||
mimeTypes += mimeTypes;
|
||||
QCOMPARE(mimeTypes.count(), 40);
|
||||
KMimeType::Ptr mime = KMimeType::mimeType("text/x-chdr");
|
||||
QVERIFY(mime);
|
||||
QTime dt; dt.start();
|
||||
QBENCHMARK {
|
||||
QString match;
|
||||
foreach (const QString &mt, mimeTypes)
|
||||
{
|
||||
if (mime->is(mt)) {
|
||||
match = mt;
|
||||
// of course there would normally be a "break" here, but we're testing worse-case
|
||||
// performance here
|
||||
}
|
||||
}
|
||||
QCOMPARE(match, QString("text/plain"));
|
||||
}
|
||||
// Results on David's machine (April 2009):
|
||||
// With the KMimeType::is() code that loaded every parent KMimeType:
|
||||
// 3.5 msec / 7,000,000 ticks / 5,021,498 instr. loads per iteration
|
||||
// After the QHash for parent mimetypes in ksycoca, removing the need to load full mimetypes:
|
||||
// 0.57 msec / 1,115,000 ticks / 938,356 instr. loads per iteration
|
||||
// After converting the QMap for aliases into a QHash too:
|
||||
// 0.48 msec / 960,000 ticks / 791,404 instr. loads per iteration
|
||||
// July 2010: After moving KMimeType out of ksycoca:
|
||||
// 0.21 msec / 494,000 ticks / 568,345 instr. loads per iteration
|
||||
}
|
||||
|
||||
// Helper method for all the trader tests
|
||||
static bool offerListHasService(const KService::List &offers,
|
||||
const QString &entryPath)
|
||||
{
|
||||
bool found = false;
|
||||
KService::List::const_iterator it = offers.begin();
|
||||
for (; it != offers.end(); ++it) {
|
||||
if ((*it)->entryPath() == entryPath) {
|
||||
if (found) { // should be there only once
|
||||
qWarning("ERROR: %s was found twice in the list", qPrintable(entryPath));
|
||||
return false; // make test fail
|
||||
}
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testMimeTypeTraderForTextPlain()
|
||||
{
|
||||
if (!KSycoca::isAvailable()) {
|
||||
QSKIP("ksycoca not available");
|
||||
}
|
||||
|
||||
// Querying mimetype trader for services associated with text/plain
|
||||
KService::List offers = KMimeTypeTrader::self()->query("text/plain", "KParts/ReadOnlyPart");
|
||||
QVERIFY(!offerListHasService(offers, "fakepatchpart.desktop"));
|
||||
QVERIFY(offerListHasService(offers, "faketextpart.desktop"));
|
||||
|
||||
offers = KMimeTypeTrader::self()->query("text/plain", "KPluginInfo");
|
||||
QVERIFY(offers.count() > 0);
|
||||
|
||||
// We should have at least the fake text plugin that we created for this.
|
||||
// (The actual plugins from kdelibs don't mention text/plain anymore)
|
||||
QVERIFY(offerListHasService(offers, "faketextplugin.desktop"));
|
||||
|
||||
// We shouldn't have non-plugins
|
||||
QVERIFY(!offerListHasService(offers, "fakepatchpart.desktop"));
|
||||
QVERIFY(!offerListHasService(offers, "faketextpart.desktop"));
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testMimeTypeTraderForDerivedMimeType()
|
||||
{
|
||||
if (!KSycoca::isAvailable()) {
|
||||
QSKIP("ksycoca not available");
|
||||
}
|
||||
|
||||
// Querying mimetype trader for services associated with text/x-patch, which inherits from text/plain
|
||||
KService::List offers = KMimeTypeTrader::self()->query("text/x-patch", "KParts/ReadOnlyPart");
|
||||
QVERIFY(offerListHasService(offers, "fakepatchpart.desktop"));
|
||||
QVERIFY(offerListHasService(offers, "faketextpart.desktop"));
|
||||
QVERIFY((*offers.begin())->entryPath() != "faketextpart.desktop"); // in the list, but not preferred
|
||||
|
||||
offers = KMimeTypeTrader::self()->query("text/x-patch", "KPluginInfo");
|
||||
QVERIFY(offers.count() > 0);
|
||||
|
||||
// We should have at least the fake text plugin that we created for this.
|
||||
// (The actual plugins from kdelibs don't mention text/plain anymore)
|
||||
QVERIFY(offerListHasService(offers, "faketextplugin.desktop"));
|
||||
|
||||
offers = KMimeTypeTrader::self()->query("text/x-patch", "Application");
|
||||
QVERIFY(!offerListHasService(offers, "faketextpart.desktop"));
|
||||
|
||||
// We shouldn't have non-kde apps
|
||||
Q_FOREACH (KService::Ptr service, offers) {
|
||||
kDebug() << service->name() << service->entryPath();
|
||||
}
|
||||
|
||||
QVERIFY(!offerListHasService(offers, m_nonKdeApp));
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testPreferredService()
|
||||
{
|
||||
// The "NotShowIn=KDE" service should not be the preferred one!
|
||||
KService::Ptr serv = KMimeTypeTrader::self()->preferredService("text/plain");
|
||||
QVERIFY(serv);
|
||||
qDebug() << serv->entryPath();
|
||||
QVERIFY(serv->entryPath() != m_nonKdeApp);
|
||||
QCOMPARE(serv->entryPath(), m_textPlainApp);
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testMimeTypeTraderForAlias()
|
||||
{
|
||||
if (!KSycoca::isAvailable()) {
|
||||
QSKIP("ksycoca not available");
|
||||
}
|
||||
|
||||
const KService::List referenceOffers = KMimeTypeTrader::self()->query("application/xml", "KParts/ReadOnlyPart");
|
||||
QVERIFY(offerListHasService(referenceOffers, "faketextpart.desktop"));
|
||||
QVERIFY(!offerListHasService(referenceOffers, "fakepatchpart.desktop"));
|
||||
|
||||
// Querying mimetype trader for services associated with text/xml, which is an alias for application/xml
|
||||
const KService::List offers = KMimeTypeTrader::self()->query("text/xml", "KParts/ReadOnlyPart");
|
||||
QVERIFY(offerListHasService(offers, "faketextpart.desktop"));
|
||||
QVERIFY(!offerListHasService(offers, "fakepatchpart.desktop"));
|
||||
|
||||
QCOMPARE(offers.count(), referenceOffers.count());
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testHasServiceType1() // with services constructed with a full path (rare)
|
||||
{
|
||||
QString faketextpartPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("/kservices5/") + "faketextpart.desktop");
|
||||
QVERIFY(!faketextpartPath.isEmpty());
|
||||
KService faketextpart(faketextpartPath);
|
||||
QVERIFY(faketextpart.hasMimeType("text/plain"));
|
||||
QVERIFY(!faketextpart.hasMimeType("text/x-patch")); // inherited mimetype; fails
|
||||
QVERIFY(!faketextpart.hasMimeType("image/png"));
|
||||
QVERIFY(faketextpart.hasServiceType("KParts/ReadOnlyPart"));
|
||||
QVERIFY(!faketextpart.hasServiceType("KParts/ReadWritePart"));
|
||||
QVERIFY(!faketextpart.hasServiceType("KPluginInfo"));
|
||||
|
||||
QString textPluginPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("/kservices5/") + "faketextplugin.desktop");
|
||||
QVERIFY(!textPluginPath.isEmpty());
|
||||
KService textPlugin(textPluginPath);
|
||||
QVERIFY(textPlugin.hasServiceType("KPluginInfo"));
|
||||
QVERIFY(!textPlugin.hasServiceType("KParts/ReadOnlyPart"));
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testHasServiceType2() // with services coming from ksycoca
|
||||
{
|
||||
KService::Ptr faketextpart = KService::serviceByDesktopPath("faketextpart.desktop");
|
||||
QVERIFY(faketextpart);
|
||||
QVERIFY(faketextpart->hasMimeType("text/plain"));
|
||||
QVERIFY(faketextpart->hasMimeType("text/x-patch")); // due to inheritance
|
||||
QVERIFY(!faketextpart->hasMimeType("image/png"));
|
||||
QVERIFY(faketextpart->hasServiceType("KParts/ReadOnlyPart"));
|
||||
QVERIFY(!faketextpart->hasServiceType("KParts/ReadWritePart"));
|
||||
QVERIFY(!faketextpart->hasServiceType("KPluginInfo"));
|
||||
|
||||
KService::Ptr textPlugin = KService::serviceByDesktopPath("faketextplugin.desktop");
|
||||
QVERIFY(textPlugin);
|
||||
QVERIFY(textPlugin->hasServiceType("KPluginInfo"));
|
||||
QVERIFY(!textPlugin->hasServiceType("KParts/ReadOnlyPart"));
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testPatterns_data()
|
||||
{
|
||||
QTest::addColumn<QString>("mimeType");
|
||||
QTest::addColumn<QString>("patterns");
|
||||
QTest::addColumn<QString>("mainExtension");
|
||||
QTest::newRow("mimetype with a single pattern") << "application/pdf" << "*.pdf" << ".pdf";
|
||||
QTest::newRow("mimetype with multiple patterns") << "application/x-kpresenter" << "*.kpr;*.kpt" << ".kpr";
|
||||
if (KMimeType::sharedMimeInfoVersion() > KDE_MAKE_VERSION(0, 60, 0)) {
|
||||
QTest::newRow("mimetype with many patterns") << "application/vnd.wordperfect" << "*.wp;*.wp4;*.wp5;*.wp6;*.wpd;*.wpp" << ".wp";
|
||||
}
|
||||
QTest::newRow("oasis text mimetype") << "application/vnd.oasis.opendocument.text" << "*.odt" << ".odt";
|
||||
QTest::newRow("oasis presentation mimetype") << "application/vnd.oasis.opendocument.presentation" << "*.odp" << ".odp";
|
||||
QTest::newRow("mimetype with multiple patterns, *.doc added by kde") << "text/plain" << "*.asc;*.txt;*.doc;*,v" << ".txt";
|
||||
QTest::newRow("mimetype with uncommon pattern") << "application/x-kcachegrind" << "callgrind.out*;cachegrind.out*" << QString();
|
||||
QTest::newRow("mimetype with no patterns") << "application/x-ole-storage" << QString() << QString();
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testPatterns()
|
||||
{
|
||||
QFETCH(QString, mimeType);
|
||||
QFETCH(QString, patterns);
|
||||
QFETCH(QString, mainExtension);
|
||||
KMimeType::Ptr mime = KMimeType::mimeType(mimeType);
|
||||
QVERIFY(mime);
|
||||
// Sort both lists; order is unreliable since shared-mime-info uses hashes internally.
|
||||
QStringList expectedPatterns = patterns.split(';', QString::SkipEmptyParts);
|
||||
expectedPatterns.sort();
|
||||
QStringList mimePatterns = mime->patterns();
|
||||
|
||||
if (mimeType == "application/vnd.oasis.opendocument.text" && mimePatterns.contains("*.fodt")) {
|
||||
QSKIP("Skipping test which would fail due to an upstream bug, see https://bugs.freedesktop.org/show_bug.cgi?id=31242");
|
||||
}
|
||||
|
||||
if (mimeType == "application/vnd.oasis.opendocument.presentation" && mimePatterns.contains("*.fodp")) {
|
||||
QSKIP("Skipping test which would fail due to an upstream bug, see https://bugs.freedesktop.org/show_bug.cgi?id=31242");
|
||||
}
|
||||
|
||||
// shared-mime-info 0.30 adds *,v to text/plain, let's add it from this test so that it works
|
||||
// with older versions too.
|
||||
if (mimeType == "text/plain" && !mimePatterns.contains("*,v")) {
|
||||
mimePatterns.append("*,v");
|
||||
}
|
||||
mimePatterns.sort();
|
||||
// Not robust enough, other packages can add additional patterns, like libfm.xml adds *.inf to text/plain
|
||||
//QCOMPARE(mimePatterns.join(";"), expectedPatterns.join(";"));
|
||||
Q_FOREACH (const QString &expected, expectedPatterns) {
|
||||
QVERIFY2(mimePatterns.contains(expected), qPrintable(mimeType + " did not have pattern " + expected));
|
||||
}
|
||||
|
||||
QCOMPARE(mime->mainExtension(), mainExtension);
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testExtractKnownExtension_data()
|
||||
{
|
||||
QTest::addColumn<QString>("fileName");
|
||||
QTest::addColumn<QString>("extension");
|
||||
QTest::newRow("simple extension") << "foo.pdf" << "pdf";
|
||||
QTest::newRow("filename has two extensions, last one matches") << "kpresenter.foo.kpt" << "kpt";
|
||||
QTest::newRow("filename has two extensions, pattern for both exist") << "foo.tar.bz2" << "tar.bz2";
|
||||
QTest::newRow("bz2 alone works too") << "foo.bz2" << "bz2";
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testExtractKnownExtension()
|
||||
{
|
||||
QFETCH(QString, fileName);
|
||||
QFETCH(QString, extension);
|
||||
QCOMPARE(KMimeType::extractKnownExtension(fileName), extension);
|
||||
}
|
||||
|
||||
struct LessMimeType_ByComment {
|
||||
bool operator()(const KMimeType::Ptr &lhs, const KMimeType::Ptr &rhs) const
|
||||
{
|
||||
return lhs->comment() < rhs->comment();
|
||||
}
|
||||
};
|
||||
|
||||
void KMimeTypeTest::testSortByComment()
|
||||
{
|
||||
QBENCHMARK {
|
||||
KMimeType::List sortedList = KMimeType::allMimeTypes();
|
||||
std::sort(sortedList.begin(), sortedList.end(), LessMimeType_ByComment());
|
||||
}
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testFromThread()
|
||||
{
|
||||
// Some simple tests to test more API from testThreads without using _data()
|
||||
KMimeType::Ptr mime = KMimeType::mimeType("application/pdf");
|
||||
QVERIFY(mime);
|
||||
QCOMPARE(mime->mainExtension(), QString::fromLatin1(".pdf"));
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testThreads()
|
||||
{
|
||||
QThreadPool::globalInstance()->setMaxThreadCount(20);
|
||||
// Note that data-based tests cannot be used here (QTest::fetchData asserts).
|
||||
QList<QFuture<void> > futures;
|
||||
futures << QtConcurrent::run(this, &KMimeTypeTest::testFindByUrl);
|
||||
futures << QtConcurrent::run(this, &KMimeTypeTest::testFindByFileContent);
|
||||
futures << QtConcurrent::run(this, &KMimeTypeTest::testFindByNameAndContent);
|
||||
futures << QtConcurrent::run(this, &KMimeTypeTest::testFindByPathWithContent);
|
||||
futures << QtConcurrent::run(this, &KMimeTypeTest::testAllMimeTypes);
|
||||
futures << QtConcurrent::run(this, &KMimeTypeTest::testAlias);
|
||||
futures << QtConcurrent::run(this, &KMimeTypeTest::testMimeTypeParent);
|
||||
futures << QtConcurrent::run(this, &KMimeTypeTest::testPreferredService);
|
||||
futures << QtConcurrent::run(this, &KMimeTypeTest::testFromThread);
|
||||
kDebug() << "Joining all threads";
|
||||
Q_FOREACH (QFuture<void> f, futures) { // krazy:exclude=foreach
|
||||
f.waitForFinished();
|
||||
}
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testProperties()
|
||||
{
|
||||
KMimeType::Ptr pngMimeType = KMimeType::mimeType("image/png");
|
||||
#if 0 // API removed
|
||||
QVariant comment = pngMimeType->property("Comment");
|
||||
QVariant patterns = pngMimeType->property("Patterns");
|
||||
|
||||
QCOMPARE(comment.toString(), pngMimeType->comment());
|
||||
QCOMPARE(patterns.toStringList(), pngMimeType->patterns());
|
||||
#endif
|
||||
}
|
||||
|
||||
void KMimeTypeTest::testIsNull()
|
||||
{
|
||||
KMimeType::Ptr ptr;
|
||||
QVERIFY(ptr.isNull());
|
||||
ptr = KMimeType::mimeType(QStringLiteral("image/jpeg"));
|
||||
QVERIFY(!ptr.isNull());
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2009 David Faure <faure@kde.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License or ( at
|
||||
* your option ) version 3 or, at the discretion of KDE e.V. ( which shall
|
||||
* act as a proxy as in section 14 of the GPLv3 ), any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public License
|
||||
* along with this library; see the file COPYING.LIB. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KMIMETYPETEST_H
|
||||
#define KMIMETYPETEST_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class KMimeTypeTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
void testByName();
|
||||
void testIcons();
|
||||
void testFindByUrl();
|
||||
void testFindByPathUsingFileName_data();
|
||||
void testFindByPathUsingFileName();
|
||||
void testAdditionalGlobs_data();
|
||||
void testAdditionalGlobs();
|
||||
void testFindByPathWithContent();
|
||||
void testFindByNameAndContent();
|
||||
void testFindByContent();
|
||||
void testFindByContent_data();
|
||||
void testFindByFileContent();
|
||||
void testAllMimeTypes();
|
||||
void testAlias();
|
||||
void testMimeTypeParent();
|
||||
void testMimeTypeInheritancePerformance();
|
||||
void testMimeTypeTraderForTextPlain();
|
||||
void testMimeTypeTraderForDerivedMimeType();
|
||||
void testMimeTypeTraderForAlias();
|
||||
void testPreferredService();
|
||||
void testHasServiceType1();
|
||||
void testHasServiceType2();
|
||||
void testPatterns_data();
|
||||
void testPatterns();
|
||||
void testExtractKnownExtension_data();
|
||||
void testExtractKnownExtension();
|
||||
void testSortByComment();
|
||||
void testFromThread();
|
||||
void testThreads();
|
||||
void testProperties();
|
||||
void testIsNull();
|
||||
private:
|
||||
QString m_nonKdeApp;
|
||||
QString m_textPlainApp;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,469 @@
|
|||
/*
|
||||
This file is part of the KDE libraries
|
||||
Copyright 2006 Allen Winter <winter@kde.org>
|
||||
Copyright 2006 Jaison Lee <lee.jaison@gmail.com>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "ksavefiletest.h"
|
||||
|
||||
#include "kbackup.h" // TODO split out into a separate test
|
||||
|
||||
#include <QDebug>
|
||||
#include <QTextStream>
|
||||
|
||||
#include <qstandardpaths.h>
|
||||
#include <qtemporaryfile.h>
|
||||
|
||||
#include <kdebug.h>
|
||||
#include <klocalizedstring.h>
|
||||
#include <klocale.h>
|
||||
#include <ktemporaryfile.h>
|
||||
#include <ktempdir.h>
|
||||
#include <ksavefile.h>
|
||||
|
||||
#include <qtest_kde.h>
|
||||
|
||||
QTEST_KDEMAIN_CORE(KSaveFileTest)
|
||||
|
||||
void KSaveFileTest::initTestCase()
|
||||
{
|
||||
tmp = tmpDir.path() + '/';
|
||||
}
|
||||
|
||||
void KSaveFileTest::test_ksavefile()
|
||||
{
|
||||
QString targetFile;
|
||||
|
||||
{
|
||||
//This will be the file we eventually write to. Yes, I know you
|
||||
//should never remove the temporaryfile and then expect the filename
|
||||
//to continue to be unique, but this is a test for crying out loud. :)
|
||||
QTemporaryFile file(QDir::tempPath() + QLatin1String("/ksavefiletest_XXXXXX"));
|
||||
QVERIFY(file.open());
|
||||
targetFile = file.fileName();
|
||||
}
|
||||
|
||||
{
|
||||
//Test basic functionality
|
||||
KSaveFile saveFile;
|
||||
saveFile.setFileName(targetFile);
|
||||
QVERIFY(saveFile.open());
|
||||
QVERIFY(!QFile::exists(targetFile));
|
||||
|
||||
QTextStream ts(&saveFile);
|
||||
ts << "This is test data one.\n";
|
||||
ts.flush();
|
||||
QCOMPARE(saveFile.error(), QFile::NoError);
|
||||
QVERIFY(!QFile::exists(targetFile));
|
||||
|
||||
QVERIFY(saveFile.finalize());
|
||||
QVERIFY(QFile::exists(targetFile));
|
||||
|
||||
QFile::remove(targetFile);
|
||||
QVERIFY(!QFile::exists(targetFile));
|
||||
}
|
||||
|
||||
{
|
||||
//Make sure destructor does what it is supposed to do.
|
||||
{
|
||||
KSaveFile saveFile;
|
||||
saveFile.setFileName(targetFile);
|
||||
QVERIFY(saveFile.open());
|
||||
QVERIFY(!QFile::exists(targetFile));
|
||||
}
|
||||
|
||||
QVERIFY(QFile::exists(targetFile));
|
||||
QFile::remove(targetFile);
|
||||
QVERIFY(!QFile::exists(targetFile));
|
||||
}
|
||||
|
||||
{
|
||||
//Test some error conditions
|
||||
KSaveFile saveFile;
|
||||
QVERIFY(!saveFile.open()); //no filename
|
||||
saveFile.setFileName(targetFile);
|
||||
QVERIFY(saveFile.open());
|
||||
QVERIFY(!QFile::exists(targetFile));
|
||||
QVERIFY(!saveFile.open()); //already open
|
||||
|
||||
QVERIFY(saveFile.finalize());
|
||||
QVERIFY(QFile::exists(targetFile));
|
||||
QVERIFY(!saveFile.finalize()); //already finalized
|
||||
|
||||
QFile::remove(targetFile);
|
||||
QVERIFY(!QFile::exists(targetFile));
|
||||
}
|
||||
|
||||
{
|
||||
//Do it again, aborting this time
|
||||
KSaveFile saveFile(targetFile);
|
||||
QVERIFY(saveFile.open());
|
||||
QVERIFY(!QFile::exists(targetFile));
|
||||
|
||||
QTextStream ts(&saveFile);
|
||||
ts << "This is test data two.\n";
|
||||
ts.flush();
|
||||
QCOMPARE(saveFile.error(), QFile::NoError);
|
||||
QVERIFY(!QFile::exists(targetFile));
|
||||
|
||||
saveFile.abort();
|
||||
QVERIFY(!QFile::exists(targetFile));
|
||||
}
|
||||
|
||||
QFile file(targetFile);
|
||||
QVERIFY(file.open(QIODevice::WriteOnly | QIODevice::Text));
|
||||
QVERIFY(file.setPermissions(file.permissions() | QFile::ExeUser));
|
||||
file.close();
|
||||
|
||||
{
|
||||
//Test how it works when the file already exists
|
||||
//Also check for special permissions
|
||||
KSaveFile saveFile(targetFile);
|
||||
QVERIFY(saveFile.open());
|
||||
|
||||
QVERIFY(QFile::exists(targetFile));
|
||||
QFileInfo fi(targetFile);
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
// Windows: qt_ntfs_permission_lookup is not set by default in
|
||||
// qfsfileengine_win.cpp, could change in future Qt versions.
|
||||
QVERIFY(fi.permission(QFile::ExeUser));
|
||||
#endif
|
||||
QVERIFY(fi.size() == 0);
|
||||
|
||||
QTextStream ts(&saveFile);
|
||||
ts << "This is test data three.\n";
|
||||
ts.flush();
|
||||
|
||||
fi.refresh();
|
||||
QVERIFY(fi.size() == 0);
|
||||
QVERIFY(saveFile.finalize());
|
||||
|
||||
fi.refresh();
|
||||
QVERIFY(fi.size() != 0);
|
||||
#ifndef Q_OS_WIN
|
||||
QVERIFY(fi.permission(QFile::ExeUser));
|
||||
#endif
|
||||
|
||||
QFile::remove(targetFile);
|
||||
}
|
||||
|
||||
{
|
||||
QFileInfo fi(targetFile);
|
||||
targetFile = fi.fileName();
|
||||
QDir::setCurrent(fi.path());
|
||||
|
||||
//one more time, this time with relative filenames
|
||||
KSaveFile saveFile(targetFile);
|
||||
QVERIFY(saveFile.open());
|
||||
QVERIFY(!QFile::exists(targetFile));
|
||||
|
||||
QTextStream ts(&saveFile);
|
||||
ts << "This is test data four.\n";
|
||||
ts.flush();
|
||||
QCOMPARE(saveFile.error(), QFile::NoError);
|
||||
QVERIFY(!QFile::exists(targetFile));
|
||||
|
||||
QVERIFY(saveFile.finalize());
|
||||
QVERIFY(QFile::exists(targetFile));
|
||||
QFile::remove(targetFile);
|
||||
}
|
||||
}
|
||||
|
||||
void KSaveFileTest::transactionalWriteNoPermissionsOnDir_data()
|
||||
{
|
||||
QTest::addColumn<bool>("directWriteFallback");
|
||||
|
||||
QTest::newRow("default") << false;
|
||||
QTest::newRow("directWriteFallback") << true;
|
||||
}
|
||||
|
||||
void KSaveFileTest::transactionalWriteNoPermissionsOnDir()
|
||||
{
|
||||
#ifdef Q_OS_UNIX
|
||||
QFETCH(bool, directWriteFallback);
|
||||
// Restore permissions so that the QTemporaryDir cleanup can happen
|
||||
class PermissionRestorer
|
||||
{
|
||||
QString m_path;
|
||||
public:
|
||||
PermissionRestorer(const QString &path)
|
||||
: m_path(path)
|
||||
{}
|
||||
|
||||
~PermissionRestorer()
|
||||
{
|
||||
restore();
|
||||
}
|
||||
void restore()
|
||||
{
|
||||
QFile file(m_path);
|
||||
file.setPermissions(QFile::Permissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner));
|
||||
}
|
||||
};
|
||||
|
||||
KTempDir dir;
|
||||
QVERIFY(QFile(dir.name()).setPermissions(QFile::ReadOwner | QFile::ExeOwner));
|
||||
PermissionRestorer permissionRestorer(dir.name());
|
||||
|
||||
const QString targetFile = dir.name() + QString::fromLatin1("/outfile");
|
||||
KSaveFile firstTry(targetFile);
|
||||
QVERIFY(!firstTry.open(QIODevice::WriteOnly));
|
||||
QCOMPARE((int)firstTry.error(), (int)QFile::PermissionsError); // actually better than QSaveFile (limited because of QTemporaryFileEngine)
|
||||
QVERIFY(!firstTry.finalize());
|
||||
|
||||
// Now make an existing writable file
|
||||
permissionRestorer.restore();
|
||||
QFile f(targetFile);
|
||||
QVERIFY(f.open(QIODevice::WriteOnly));
|
||||
QCOMPARE(f.write("Hello"), Q_INT64_C(5));
|
||||
f.close();
|
||||
|
||||
// Make the directory non-writable again
|
||||
QVERIFY(QFile(dir.name()).setPermissions(QFile::ReadOwner | QFile::ExeOwner));
|
||||
|
||||
// And write to it again using KSaveFile; only works if directWriteFallback is enabled
|
||||
KSaveFile file(targetFile);
|
||||
file.setDirectWriteFallback(directWriteFallback);
|
||||
QCOMPARE(file.directWriteFallback(), directWriteFallback);
|
||||
if (directWriteFallback) {
|
||||
QVERIFY(file.open(QIODevice::WriteOnly));
|
||||
QCOMPARE((int)file.error(), (int)QFile::NoError);
|
||||
QCOMPARE(file.write("World"), Q_INT64_C(5));
|
||||
QVERIFY(file.finalize());
|
||||
|
||||
QFile reader(targetFile);
|
||||
QVERIFY(reader.open(QIODevice::ReadOnly));
|
||||
QCOMPARE(QString::fromLatin1(reader.readAll()), QString::fromLatin1("World"));
|
||||
reader.close();
|
||||
|
||||
QVERIFY(file.open(QIODevice::WriteOnly));
|
||||
QCOMPARE((int)file.error(), (int)QFile::NoError);
|
||||
QCOMPARE(file.write("W"), Q_INT64_C(1));
|
||||
QVERIFY(file.finalize());
|
||||
|
||||
QVERIFY(reader.open(QIODevice::ReadOnly));
|
||||
QCOMPARE(QString::fromLatin1(reader.readAll()), QString::fromLatin1("W"));
|
||||
} else {
|
||||
QVERIFY(!file.open(QIODevice::WriteOnly));
|
||||
QCOMPARE((int)file.error(), (int)QFile::PermissionsError);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void KSaveFileTest::test_simpleBackupFile()
|
||||
{
|
||||
QTemporaryFile file;
|
||||
QVERIFY(file.open());
|
||||
|
||||
QVERIFY(KBackup::simpleBackupFile(file.fileName()));
|
||||
QVERIFY(QFile::exists(file.fileName() + '~'));
|
||||
QFile::remove(file.fileName() + '~');
|
||||
|
||||
QVERIFY(KBackup::simpleBackupFile(file.fileName(), tmp));
|
||||
QFileInfo fi(file.fileName());
|
||||
QVERIFY(QFile::exists(tmp + fi.fileName() + '~'));
|
||||
QFile::remove(tmp + fi.fileName() + '~');
|
||||
}
|
||||
|
||||
void KSaveFileTest::test_numberedBackupFile()
|
||||
{
|
||||
// Test absolute pathname file
|
||||
{
|
||||
QTemporaryFile file;
|
||||
QVERIFY(file.open());
|
||||
|
||||
for (int i = 1; i < 15; i++) {
|
||||
QVERIFY(KBackup::numberedBackupFile(file.fileName()));
|
||||
}
|
||||
|
||||
QString fileNameTemplate = file.fileName() + ".%1~";
|
||||
for (int i = 1; i <= 10; i++) {
|
||||
QVERIFY(QFile::exists(fileNameTemplate.arg(i)));
|
||||
filesToRemove << fileNameTemplate.arg(i);
|
||||
}
|
||||
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(11)));
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(12)));
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(13)));
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(14)));
|
||||
}
|
||||
|
||||
// Test current directory
|
||||
{
|
||||
QTemporaryFile file;
|
||||
QVERIFY(file.open());
|
||||
|
||||
QFileInfo fi(file.fileName());
|
||||
QVERIFY(QDir::setCurrent(fi.absolutePath()));
|
||||
|
||||
for (int i = 1; i < 15; i++) {
|
||||
QVERIFY(KBackup::numberedBackupFile(fi.fileName()));
|
||||
}
|
||||
|
||||
QString fileNameTemplate = fi.fileName() + ".%1~";
|
||||
for (int i = 1; i <= 10; i++) {
|
||||
QVERIFY(QFile::exists(fileNameTemplate.arg(i)));
|
||||
filesToRemove << fileNameTemplate.arg(i);
|
||||
}
|
||||
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(11)));
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(12)));
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(13)));
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(14)));
|
||||
}
|
||||
|
||||
// Test absolute pathname file w/new directory
|
||||
{
|
||||
QTemporaryFile file;
|
||||
QVERIFY(file.open());
|
||||
|
||||
QFileInfo fi(file.fileName());
|
||||
QVERIFY(QDir::setCurrent(fi.absolutePath()));
|
||||
|
||||
for (int i = 1; i < 15; i++) {
|
||||
QVERIFY(KBackup::numberedBackupFile(fi.fileName(), tmp));
|
||||
}
|
||||
|
||||
QString fileNameTemplate = tmp + fi.fileName() + ".%1~";
|
||||
for (int i = 1; i <= 10; i++) {
|
||||
QVERIFY(QFile::exists(fileNameTemplate.arg(i)));
|
||||
filesToRemove << fileNameTemplate.arg(i);
|
||||
}
|
||||
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(11)));
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(12)));
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(13)));
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(14)));
|
||||
}
|
||||
|
||||
// Test current directory w/new directory
|
||||
{
|
||||
QTemporaryFile file;
|
||||
QVERIFY(file.open());
|
||||
|
||||
QFileInfo fi(file.fileName());
|
||||
QVERIFY(QDir::setCurrent(fi.absolutePath()));
|
||||
|
||||
for (int i = 1; i < 15; i++) {
|
||||
QVERIFY(KBackup::numberedBackupFile(fi.fileName(), tmp));
|
||||
}
|
||||
|
||||
QString fileNameTemplate = tmp + fi.fileName() + ".%1~";
|
||||
for (int i = 1; i <= 10; i++) {
|
||||
QVERIFY(QFile::exists(fileNameTemplate.arg(i)));
|
||||
filesToRemove << fileNameTemplate.arg(i);
|
||||
}
|
||||
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(11)));
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(12)));
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(13)));
|
||||
QVERIFY(!QFile::exists(fileNameTemplate.arg(14)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void KSaveFileTest::test_rcsBackupFile()
|
||||
{
|
||||
QString cipath = QStandardPaths::findExecutable("ci");
|
||||
if (cipath.isEmpty()) {
|
||||
QSKIP("ci not available");
|
||||
}
|
||||
|
||||
{
|
||||
QTemporaryFile f;
|
||||
QVERIFY(f.open());
|
||||
|
||||
QVERIFY(KBackup::rcsBackupFile(f.fileName()));
|
||||
QVERIFY(QFile::exists(f.fileName() + ",v"));
|
||||
QVERIFY(KBackup::rcsBackupFile(f.fileName()));
|
||||
QVERIFY(QFile::exists(f.fileName() + ",v"));
|
||||
|
||||
filesToRemove << f.fileName() + ",v";
|
||||
}
|
||||
|
||||
{
|
||||
QTemporaryFile f;
|
||||
QVERIFY(f.open());
|
||||
|
||||
QVERIFY(KBackup::rcsBackupFile(f.fileName()));
|
||||
QVERIFY(QFile::exists(f.fileName() + ",v"));
|
||||
|
||||
QTextStream out(&f);
|
||||
out << "Testing a change\n";
|
||||
out.flush();
|
||||
|
||||
QVERIFY(KBackup::rcsBackupFile(f.fileName()));
|
||||
|
||||
out << "Testing another change\n";
|
||||
out.flush();
|
||||
|
||||
QVERIFY(KBackup::rcsBackupFile(f.fileName()));
|
||||
filesToRemove << f.fileName() + ",v";
|
||||
}
|
||||
|
||||
{
|
||||
QTemporaryFile f;
|
||||
QVERIFY(f.open());
|
||||
|
||||
QFileInfo fi(f.fileName());
|
||||
QVERIFY(QDir::setCurrent(fi.absolutePath()));
|
||||
|
||||
QVERIFY(KBackup::rcsBackupFile(fi.fileName()));
|
||||
QVERIFY(QFile::exists(f.fileName() + ",v"));
|
||||
QVERIFY(KBackup::rcsBackupFile(fi.fileName()));
|
||||
QVERIFY(QFile::exists(f.fileName() + ",v"));
|
||||
|
||||
filesToRemove << f.fileName() + ",v";
|
||||
}
|
||||
|
||||
{
|
||||
QTemporaryFile f;
|
||||
QVERIFY(f.open());
|
||||
|
||||
QFileInfo fi(f.fileName());
|
||||
|
||||
QVERIFY(KBackup::rcsBackupFile(f.fileName(), tmp));
|
||||
QVERIFY(QFile::exists(tmp + fi.fileName() + ",v"));
|
||||
QVERIFY(KBackup::rcsBackupFile(f.fileName(), tmp));
|
||||
QVERIFY(QFile::exists(tmp + fi.fileName() + ",v"));
|
||||
|
||||
filesToRemove << tmp + fi.fileName() + ",v";
|
||||
}
|
||||
|
||||
{
|
||||
QTemporaryFile f;
|
||||
QVERIFY(f.open());
|
||||
|
||||
QFileInfo fi(f.fileName());
|
||||
QVERIFY(QDir::setCurrent(fi.absolutePath()));
|
||||
|
||||
QVERIFY(KBackup::rcsBackupFile(fi.fileName(), tmp));
|
||||
QVERIFY(QFile::exists(tmp + fi.fileName() + ",v"));
|
||||
QVERIFY(KBackup::rcsBackupFile(fi.fileName(), tmp));
|
||||
QVERIFY(QFile::exists(tmp + fi.fileName() + ",v"));
|
||||
|
||||
filesToRemove << tmp + fi.fileName() + ",v";
|
||||
}
|
||||
}
|
||||
|
||||
void KSaveFileTest::cleanupTestCase()
|
||||
{
|
||||
foreach (const QString &fileToRemove, filesToRemove) {
|
||||
QFile::remove(fileToRemove);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2006 Peter Kümmel <syntheticpp@yahoo.com>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef ksavefiletest_h
|
||||
#define ksavefiletest_h
|
||||
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <qtemporarydir.h>
|
||||
|
||||
class KSaveFileTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void test_ksavefile();
|
||||
void transactionalWriteNoPermissionsOnDir_data();
|
||||
void transactionalWriteNoPermissionsOnDir();
|
||||
|
||||
void test_numberedBackupFile();
|
||||
void test_rcsBackupFile();
|
||||
void test_simpleBackupFile();
|
||||
void cleanupTestCase();
|
||||
|
||||
private:
|
||||
QStringList filesToRemove;
|
||||
|
||||
QTemporaryDir tmpDir; // destination for backups
|
||||
QString tmp;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,174 @@
|
|||
/* Copyright (c) 2005 Frerich Raabe <raabe@kde.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "ksharedptrtest.h"
|
||||
#include "ksharedptr.h"
|
||||
|
||||
#include <QTest>
|
||||
|
||||
QTEST_MAIN(KSharedPtrTest)
|
||||
|
||||
class SharedString : public KShared
|
||||
{
|
||||
public:
|
||||
SharedString(const QString &data) : mStr(data) {}
|
||||
bool operator == (const SharedString &o) const
|
||||
{
|
||||
return mStr == o.mStr;
|
||||
}
|
||||
QString mStr;
|
||||
};
|
||||
|
||||
void KSharedPtrTest::testWithStrings()
|
||||
{
|
||||
SharedString s = QString::fromLatin1("Hello");
|
||||
SharedString s2 = QString::fromLatin1("Foo");
|
||||
SharedString s3 = QString::fromLatin1("Bar");
|
||||
|
||||
KSharedPtr<SharedString>u(new SharedString(s));
|
||||
QCOMPARE(*u, s);
|
||||
QVERIFY(u.isUnique());
|
||||
|
||||
KSharedPtr<SharedString> v;
|
||||
QVERIFY(u.isUnique());
|
||||
QVERIFY(!v);
|
||||
|
||||
v = u;
|
||||
QVERIFY(!u.isUnique());
|
||||
QCOMPARE(*v, s);
|
||||
QVERIFY(!v.isUnique());
|
||||
|
||||
KSharedPtr<SharedString> w = v;
|
||||
QVERIFY(!u.isUnique());
|
||||
QCOMPARE(u.count(), 3);
|
||||
QVERIFY(!v.isUnique());
|
||||
QCOMPARE(v.count(), 3);
|
||||
QVERIFY(!w.isUnique());
|
||||
QCOMPARE(w.count(), 3);
|
||||
|
||||
// v->clear();
|
||||
v = nullptr;
|
||||
QVERIFY(u);
|
||||
QVERIFY(!u.isUnique());
|
||||
QCOMPARE(u.count(), 2);
|
||||
QVERIFY(!v);
|
||||
QVERIFY(!v.isUnique());
|
||||
QCOMPARE(*w, s);
|
||||
QVERIFY(!w.isUnique());
|
||||
QCOMPARE(w.count(), 2);
|
||||
|
||||
u = v = w;
|
||||
QCOMPARE(*u, s);
|
||||
QVERIFY(!u.isUnique());
|
||||
QCOMPARE(*v, s);
|
||||
QVERIFY(!v.isUnique());
|
||||
QCOMPARE(*w, s);
|
||||
QVERIFY(!w.isUnique());
|
||||
|
||||
u->mStr = s2.mStr;
|
||||
QCOMPARE(*u, s2);
|
||||
QVERIFY(!u.isUnique());
|
||||
QCOMPARE(*v, s2);
|
||||
QVERIFY(!v.isUnique());
|
||||
// QCOMPARE( *w, s2 );
|
||||
// QVERIFY( !w.isUnique() );
|
||||
}
|
||||
|
||||
static int dtor_called = 0;
|
||||
class Base : public KShared
|
||||
{
|
||||
public:
|
||||
virtual ~Base()
|
||||
{
|
||||
++dtor_called;
|
||||
}
|
||||
};
|
||||
|
||||
void KSharedPtrTest::testDeletion()
|
||||
{
|
||||
dtor_called = 0;
|
||||
{
|
||||
Base *obj = new Base;
|
||||
KSharedPtr<Base> ptrBase(obj);
|
||||
QCOMPARE(ptrBase.data(), obj);
|
||||
QCOMPARE(dtor_called, 0); // no dtor called yet
|
||||
}
|
||||
QCOMPARE(dtor_called, 1);
|
||||
}
|
||||
|
||||
class Derived : public Base
|
||||
{
|
||||
public:
|
||||
Derived()
|
||||
{
|
||||
/*qDebug( "Derived created %p", (void*)this );*/
|
||||
}
|
||||
~Derived() override
|
||||
{
|
||||
/*qDebug( "Derived deleted %p", (void*)this );*/
|
||||
}
|
||||
};
|
||||
|
||||
void KSharedPtrTest::testDifferentTypes()
|
||||
{
|
||||
dtor_called = 0;
|
||||
{
|
||||
Derived *obj = new Derived;
|
||||
KSharedPtr<Base> ptrBase(obj);
|
||||
// then we call some method that takes a KSharedPtr<Base> as argument
|
||||
// and there we downcast again:
|
||||
KSharedPtr<Derived> ptrDerived = KSharedPtr<Derived>::staticCast(ptrBase);
|
||||
QCOMPARE(dtor_called, 0); // no dtor called yet
|
||||
QCOMPARE(ptrDerived.data(), obj);
|
||||
|
||||
// now test assignment operator
|
||||
ptrDerived = KSharedPtr<Derived>::dynamicCast(ptrBase);
|
||||
QCOMPARE(dtor_called, 0); // no dtor called yet
|
||||
QCOMPARE(ptrDerived.data(), obj);
|
||||
}
|
||||
QCOMPARE(dtor_called, 1);
|
||||
}
|
||||
|
||||
void KSharedPtrTest::testOrdering()
|
||||
{
|
||||
Base *obj = new Base;
|
||||
KSharedPtr<Base> ptrBase(obj);
|
||||
|
||||
Base *obj2 = new Base;
|
||||
KSharedPtr<Base> ptrBase2(obj2);
|
||||
|
||||
QVERIFY(obj != obj2);
|
||||
QVERIFY(ptrBase != ptrBase2);
|
||||
QVERIFY(ptrBase < ptrBase2 || ptrBase2 < ptrBase);
|
||||
|
||||
QMap<KSharedPtr<Base>, int> map;
|
||||
map.insert(ptrBase, 1);
|
||||
QVERIFY(map.contains(ptrBase));
|
||||
QVERIFY(!map.contains(ptrBase2));
|
||||
QCOMPARE(map.value(ptrBase, 0), 1);
|
||||
map.insert(ptrBase2, 2);
|
||||
QVERIFY(map.contains(ptrBase2));
|
||||
QCOMPARE(map.value(ptrBase2, 0), 2);
|
||||
QCOMPARE(map.count(), 2);
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/* Copyright (c) 2005 Frerich Raabe <raabe@kde.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef KSHAREDPTRTEST_H
|
||||
#define KSHAREDPTRTEST_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class KSharedPtrTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
void testWithStrings();
|
||||
void testDeletion();
|
||||
void testDifferentTypes();
|
||||
void testOrdering();
|
||||
};
|
||||
|
||||
#endif /* KSHAREDPTRTEST_H */
|
|
@ -0,0 +1,601 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2006, 2011 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "kstandarddirstest.h"
|
||||
#include "qstandardpaths.h"
|
||||
|
||||
#include "qtest.h"
|
||||
|
||||
QTEST_GUILESS_MAIN(KStandarddirsTest)
|
||||
|
||||
#include <config-kstandarddirs.h>
|
||||
#include <kdebug.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <kcomponentdata.h>
|
||||
#include <kconfig.h>
|
||||
#include <kglobal.h>
|
||||
#include <qtemporarydir.h>
|
||||
#include <QDebug>
|
||||
#include <QTest>
|
||||
#include <kconfiggroup.h>
|
||||
#include <QFile>
|
||||
|
||||
// we need case-insensitive comparison of file paths on windows
|
||||
#ifdef Q_OS_WIN
|
||||
#define QCOMPARE_PATHS(x,y) QCOMPARE(QString(x).toLower(), QString(y).toLower())
|
||||
#define PATH_SENSITIVITY Qt::CaseInsensitive
|
||||
#define EXT ".exe"
|
||||
#else
|
||||
#define QCOMPARE_PATHS(x,y) QCOMPARE(QString(x), QString(y))
|
||||
#define PATH_SENSITIVITY Qt::CaseSensitive
|
||||
#define EXT ""
|
||||
#endif
|
||||
|
||||
void KStandarddirsTest::initTestCase()
|
||||
{
|
||||
QString kconfig_compilerLocation = QStringLiteral(KCONFIG_COMPILER_LOCATION);
|
||||
if (kconfig_compilerLocation.startsWith(CMAKE_INSTALL_PREFIX)) {
|
||||
m_canFindKConfig = true;
|
||||
} else {
|
||||
// the user needs to set KDEDIRS properly!
|
||||
QStringList kdedirs = QFile::decodeName(qgetenv("KDEDIRS")).split(':');
|
||||
m_canFindKConfig = false;
|
||||
foreach (QString dirName, kdedirs) {
|
||||
if (!dirName.isEmpty() && kconfig_compilerLocation.startsWith(dirName)) {
|
||||
m_canFindKConfig = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// canonicalPath() to resolve symlinks (e.g. on FreeBSD where /home is a symlink to /usr/home),
|
||||
// this matches what KGlobal::dirs()->realPath() would do, but we can't use it before setting
|
||||
// the env vars, it would mess up the unit test
|
||||
const QString homePath = QDir::home().canonicalPath();
|
||||
m_configHome = homePath + QLatin1String("/.kde-unit-test/xdg/config");
|
||||
|
||||
qputenv("XDG_CONFIG_HOME", QFile::encodeName(m_configHome));
|
||||
|
||||
m_dataHome = homePath + QLatin1String("/.kde-unit-test/xdg/local");
|
||||
qputenv("XDG_DATA_HOME", QFile::encodeName(m_dataHome));
|
||||
|
||||
const QString configDirs = QDir::currentPath() + "/xdg";
|
||||
qputenv("XDG_CONFIG_DIRS", QFile::encodeName(configDirs));
|
||||
|
||||
qunsetenv("XDG_DATA_DIRS");
|
||||
|
||||
QFile::remove(KGlobal::dirs()->saveLocation("config") + "kstandarddirstestrc");
|
||||
|
||||
// Create a main component data so that testAppData doesn't suddenly change the main component
|
||||
// data.
|
||||
KComponentData mainData("kstandarddirstest");
|
||||
|
||||
// Must initialize KStandardDirs only after all the setenv() calls.
|
||||
QCOMPARE(KGlobal::dirs()->localxdgconfdir(), QString(m_configHome + '/'));
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testSaveLocation()
|
||||
{
|
||||
const QString saveLocConfig = KGlobal::dirs()->saveLocation("config");
|
||||
QCOMPARE_PATHS(saveLocConfig, KGlobal::dirs()->localxdgconfdir());
|
||||
const QString saveLocXdgConfig = KGlobal::dirs()->saveLocation("xdgconf");
|
||||
QCOMPARE_PATHS(saveLocConfig, saveLocXdgConfig); // same result
|
||||
|
||||
const QString saveLocAppData = KGlobal::dirs()->saveLocation("appdata");
|
||||
QCOMPARE_PATHS(saveLocAppData, m_dataHome + "/kstandarddirstest/");
|
||||
|
||||
const QString saveTmp = KGlobal::dirs()->saveLocation("tmp");
|
||||
QCOMPARE_PATHS(saveTmp, QDir::tempPath() + '/');
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testLocateLocal()
|
||||
{
|
||||
const QString configLocal = KStandardDirs::locateLocal("config", "ksomethingrc");
|
||||
// KStandardDirs resolves symlinks, so we must compare with canonicalPath()
|
||||
QCOMPARE_PATHS(configLocal, m_configHome + "/ksomethingrc");
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testResourceDirs()
|
||||
{
|
||||
const QStringList configDirs = KGlobal::dirs()->resourceDirs("config");
|
||||
Q_FOREACH (const QString &dir, configDirs) {
|
||||
QVERIFY2(dir.endsWith("xdg/")
|
||||
|| dir.endsWith("share/config/") // KDE4 compat path
|
||||
|| dir.endsWith(".kde-unit-test/xdg/config/"), qPrintable(dir));
|
||||
}
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testAppData()
|
||||
{
|
||||
// This API is gone
|
||||
#if 0
|
||||
// In addition to testSaveLocation(), we want to also check other KComponentDatas
|
||||
KComponentData cData("foo");
|
||||
const QString fooAppData = cData.dirs()->saveLocation("appdata");
|
||||
QCOMPARE_PATHS(fooAppData, m_dataHome + "/foo/");
|
||||
#endif
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testChangeSaveLocation()
|
||||
{
|
||||
KStandardDirs cData;
|
||||
QCOMPARE_PATHS(cData.saveLocation("config"), m_configHome + "/");
|
||||
// Can we change the save location?
|
||||
const QString newSaveLoc = m_configHome + "/newconfigdir/";
|
||||
//cData.addResourceDir("config", newSaveLoc); // can't be done, absolute paths have less priority than relative paths
|
||||
cData.addResourceType("config", nullptr, "newconfigdir");
|
||||
QCOMPARE_PATHS(KStandardDirs::realPath(cData.saveLocation("config")), newSaveLoc);
|
||||
}
|
||||
|
||||
static bool isKdeLibs4supportInstalled()
|
||||
{
|
||||
return QFile::exists(CMAKE_INSTALL_PREFIX "/bin/kf5-config");
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testFindResource()
|
||||
{
|
||||
if (!m_canFindKConfig) {
|
||||
QSKIP("KDEDIRS does not contain the KConfig prefix");
|
||||
}
|
||||
|
||||
const QString bin = KGlobal::dirs()->findResource("exe", "kf5/kconf_update" EXT);
|
||||
QVERIFY(!bin.isEmpty());
|
||||
#ifdef Q_OS_WIN
|
||||
QVERIFY(bin.endsWith("bin/kconf_update.exe"));
|
||||
#else
|
||||
QVERIFY(bin.endsWith("libexec/kf5/kconf_update"));
|
||||
#endif
|
||||
QVERIFY(!QDir::isRelativePath(bin));
|
||||
|
||||
const QString data = KGlobal::dirs()->findResource("data", "dbus-1/interfaces/kf5_org.kde.JobView.xml");
|
||||
QVERIFY(!data.isEmpty());
|
||||
QVERIFY(data.endsWith(QLatin1String("dbus-1/interfaces/kf5_org.kde.JobView.xml")));
|
||||
QVERIFY(!QDir::isRelativePath(data));
|
||||
}
|
||||
|
||||
static bool oneEndsWith(const QStringList &lst, const QString &str)
|
||||
{
|
||||
for (QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it) {
|
||||
if ((*it).endsWith(str)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testFindAllResources()
|
||||
{
|
||||
if (!isKdeLibs4supportInstalled()) {
|
||||
QSKIP("KDELibs4Support is not installed yet");
|
||||
}
|
||||
|
||||
const QStringList dbusInterfaceFiles = KGlobal::dirs()->findAllResources("data", "dbus-1/interfaces/");
|
||||
QVERIFY(!dbusInterfaceFiles.isEmpty());
|
||||
QVERIFY(dbusInterfaceFiles.count() > 20); // I have 21 here, installed by kdelibs.
|
||||
|
||||
// Create a local config file, the file will be used as expected result
|
||||
const QString localConfigFile = m_configHome + "/foorc";
|
||||
QFile::remove(localConfigFile);
|
||||
KConfig foorc("foorc");
|
||||
KConfigGroup dummyGroup(&foorc, "Dummy");
|
||||
dummyGroup.writeEntry("someEntry", true);
|
||||
dummyGroup.sync();
|
||||
QVERIFY2(QFile::exists(localConfigFile), qPrintable(localConfigFile));
|
||||
|
||||
const QStringList configFiles = KGlobal::dirs()->findAllResources("config");
|
||||
QVERIFY(!configFiles.isEmpty());
|
||||
//qDebug() << configFiles;
|
||||
QVERIFY(oneEndsWith(configFiles, "etc/xdg/kdebugrc"));
|
||||
QVERIFY(oneEndsWith(configFiles, "etc/xdg/kdebug.areas"));
|
||||
QVERIFY(oneEndsWith(configFiles, "kde-unit-test/xdg/config/foorc"));
|
||||
QVERIFY(!oneEndsWith(configFiles, "etc/xdg/colors/Web.colors")); // recursive was false
|
||||
|
||||
{
|
||||
const QStringList configFilesRecursive = KGlobal::dirs()->findAllResources("config", QString(),
|
||||
KStandardDirs::Recursive);
|
||||
QVERIFY(!configFilesRecursive.isEmpty());
|
||||
QVERIFY(configFilesRecursive.count() > 5); // I have 15 here
|
||||
QVERIFY(oneEndsWith(configFilesRecursive, "etc/xdg/kdebugrc"));
|
||||
QVERIFY(oneEndsWith(configFilesRecursive, "etc/xdg/colors/Web.colors")); // proves that recursive worked
|
||||
}
|
||||
|
||||
{
|
||||
const QStringList configFilesRecursiveWithFilter = KGlobal::dirs()->findAllResources("config", "*rc",
|
||||
KStandardDirs::Recursive);
|
||||
QVERIFY(!configFilesRecursiveWithFilter.isEmpty());
|
||||
//qDebug() << configFilesRecursiveWithFilter;
|
||||
QVERIFY(configFilesRecursiveWithFilter.count() >= 2); // foorc, kdebugrc
|
||||
QVERIFY(oneEndsWith(configFilesRecursiveWithFilter, "kde-unit-test/xdg/config/foorc"));
|
||||
QVERIFY(oneEndsWith(configFilesRecursiveWithFilter, "etc/xdg/kdebugrc"));
|
||||
QVERIFY(!oneEndsWith(configFilesRecursiveWithFilter, "etc/xdg/colors/Web.colors")); // didn't match the filter
|
||||
}
|
||||
|
||||
{
|
||||
QStringList fileNames;
|
||||
const QStringList configFilesWithFilter = KGlobal::dirs()->findAllResources("config", "*rc", KStandardDirs::NoDuplicates, fileNames);
|
||||
QVERIFY(!configFilesWithFilter.isEmpty());
|
||||
QVERIFY2(configFilesWithFilter.count() >= 2, qPrintable(configFilesWithFilter.join(",")));
|
||||
QVERIFY(oneEndsWith(configFilesWithFilter, "kde-unit-test/xdg/config/foorc"));
|
||||
QVERIFY(oneEndsWith(configFilesWithFilter, "kdebugrc")); // either global (etc/xdg/) or local (XDG_HOME)
|
||||
QVERIFY(!oneEndsWith(configFilesWithFilter, "etc/xdg/ui/ui_standards.rc")); // recursive not set
|
||||
QVERIFY(!oneEndsWith(configFilesWithFilter, "etc/xdg/accept-languages.codes")); // didn't match the filter
|
||||
QCOMPARE(fileNames.count(), configFilesWithFilter.count());
|
||||
QVERIFY(fileNames.contains("kdebugrc"));
|
||||
}
|
||||
|
||||
#if 0
|
||||
list = t.findAllResources("html", "en/*/index.html", false);
|
||||
for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
|
||||
kDebug() << "docs " << (*it).toLatin1().constData();
|
||||
}
|
||||
|
||||
list = t.findAllResources("html", "*/*/*.html", false);
|
||||
for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
|
||||
kDebug() << "docs " << (*it).toLatin1().constData();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testFindAllResourcesNewDir()
|
||||
{
|
||||
const QString dir = m_dataHome + "/cmake/modules";
|
||||
const QString fileName = dir + "/unittest.testfile";
|
||||
QFile::remove(fileName);
|
||||
const QStringList origFiles = KGlobal::dirs()->findAllResources("data", "cmake/modules/");
|
||||
const int origCount = origFiles.count();
|
||||
|
||||
QDir().mkpath(dir);
|
||||
QFile file(fileName);
|
||||
QVERIFY(file.open(QIODevice::WriteOnly | QIODevice::Text));
|
||||
file.write("foo");
|
||||
file.close();
|
||||
|
||||
const int newCount = KGlobal::dirs()->findAllResources("data", "cmake/modules/").count();
|
||||
QCOMPARE(newCount, origCount + 1);
|
||||
file.remove();
|
||||
QDir().rmpath(dir);
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testFindDirs()
|
||||
{
|
||||
if (!isKdeLibs4supportInstalled()) {
|
||||
QSKIP("KDELibs4Support is not installed yet");
|
||||
}
|
||||
|
||||
const QString t = KStandardDirs::locateLocal("data", "locale/");
|
||||
QCOMPARE(t, QString(m_dataHome + "/locale/"));
|
||||
const QStringList dirs = KGlobal::dirs()->findDirs("data", "locale");
|
||||
QVERIFY(!dirs.isEmpty());
|
||||
QVERIFY2(dirs.count() >= 2, qPrintable(dirs.join(","))); // at least local and global
|
||||
//qDebug() << dirs;
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testFindResourceDir()
|
||||
{
|
||||
if (!isKdeLibs4supportInstalled()) {
|
||||
QSKIP("KDELibs4Support is not installed yet");
|
||||
}
|
||||
|
||||
const QString configDir = KGlobal::dirs()->findResourceDir("config", "foorc");
|
||||
QVERIFY(!configDir.isEmpty());
|
||||
QVERIFY2(configDir.endsWith(QLatin1String("/xdg/config/")), qPrintable(configDir));
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testFindExeLibExec()
|
||||
{
|
||||
#ifndef Q_OS_UNIX
|
||||
QSKIP("non-UNIX system");
|
||||
#endif
|
||||
if (!isKdeLibs4supportInstalled()) {
|
||||
// KStandardDirs::findExe only finds libexec executables in the installed location
|
||||
QSKIP("KDELibs4Support is not installed yet");
|
||||
}
|
||||
|
||||
// findExe with a result in libexec
|
||||
const QString libexe = KGlobal::dirs()->findExe("kf5/fileshareset");
|
||||
QVERIFY(!libexe.isEmpty());
|
||||
QVERIFY(libexe.endsWith(LIB_INSTALL_DIR "/libexec/kf5/fileshareset" EXT, PATH_SENSITIVITY));
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testFindExe()
|
||||
{
|
||||
if (!m_canFindKConfig) {
|
||||
QSKIP("KDEDIRS does not contain the KConfig prefix");
|
||||
}
|
||||
|
||||
const QString exeFileName = QStringLiteral("kreadconfig5");
|
||||
|
||||
// findExe with a result in bin
|
||||
const QString binexe = KGlobal::dirs()->findExe(exeFileName);
|
||||
QVERIFY(!binexe.isEmpty());
|
||||
QCOMPARE_PATHS(binexe, QStandardPaths::findExecutable(exeFileName));
|
||||
|
||||
// Check the "exe" resource too
|
||||
QString binexePath1 = KStandardDirs::realFilePath(binexe);
|
||||
QString binexePath2 = KGlobal::dirs()->locate("exe", exeFileName);
|
||||
QCOMPARE_PATHS(binexePath1, binexePath2);
|
||||
|
||||
// Check realFilePath behavior with complete command lines, like KRun does
|
||||
const QString cmd = binexe + " -c foo -x bar";
|
||||
const QString fromKStdDirs = KStandardDirs::realFilePath(cmd);
|
||||
QCOMPARE(fromKStdDirs, cmd);
|
||||
const QString fromQFileInfo = QFileInfo(cmd).canonicalFilePath();
|
||||
QVERIFY2(fromQFileInfo.isEmpty(), qPrintable(QString("QFileInfo(\"" + cmd + "\").canonicalFilePath() returned \"" + fromQFileInfo + "\""))); // !! different result, since this doesn't exist as a file
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
// findExe with relative path
|
||||
const QString pwd = QDir::currentPath();
|
||||
QDir::setCurrent("/bin");
|
||||
QStringList possibleResults;
|
||||
possibleResults << QString::fromLatin1("/bin/sh") << QString::fromLatin1("/usr/bin/sh");
|
||||
const QString sh = KGlobal::dirs()->findExe("./sh");
|
||||
if (!possibleResults.contains(sh)) {
|
||||
kDebug() << sh;
|
||||
}
|
||||
QVERIFY(possibleResults.contains(sh));
|
||||
QDir::setCurrent(pwd);
|
||||
#endif
|
||||
|
||||
#if 0 // Broken test, findExe doesn't look in kdehome, but in kdehome/bin (in kde4) and in $PATH.
|
||||
#ifdef Q_OS_UNIX
|
||||
QFile home(m_kdehome);
|
||||
const QString target = m_kdehome + "/linktodir";
|
||||
home.link(target);
|
||||
QVERIFY(KGlobal::dirs()->findExe(target).isEmpty());
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
// findExe for a binary not part of KDE
|
||||
const QString ls = KGlobal::dirs()->findExe("ls");
|
||||
QVERIFY(!ls.isEmpty());
|
||||
QVERIFY(ls.endsWith(QLatin1String("bin/ls")));
|
||||
#endif
|
||||
|
||||
// findExe with no result
|
||||
const QString idontexist = KGlobal::dirs()->findExe("idontexist");
|
||||
QVERIFY(idontexist.isEmpty());
|
||||
|
||||
// findExe with empty string
|
||||
const QString empty = KGlobal::dirs()->findExe("");
|
||||
QVERIFY(empty.isEmpty());
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testLocate()
|
||||
{
|
||||
QString textPlain = "text/x-patch.xml";
|
||||
Q_FOREACH (const QString &path, KGlobal::dirs()->resourceDirs("xdgdata-mime")) {
|
||||
if (QFile::exists(path + textPlain)) {
|
||||
textPlain = path + textPlain;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (textPlain == "text/x-patch.xml") {
|
||||
QSKIP("xdg-share-mime not installed");
|
||||
}
|
||||
|
||||
const QString res = KGlobal::dirs()->locate("xdgdata-mime", "text/x-patch.xml");
|
||||
QCOMPARE_PATHS(res, textPlain);
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testRelativeLocation()
|
||||
{
|
||||
if (!isKdeLibs4supportInstalled()) {
|
||||
QSKIP("KDELibs4Support is not installed yet");
|
||||
}
|
||||
|
||||
const QString file = "kdebugrc";
|
||||
QString located = KGlobal::dirs()->locate("config", file);
|
||||
QCOMPARE_PATHS(KGlobal::dirs()->relativeLocation("config", located), file);
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testAddResourceType()
|
||||
{
|
||||
if (!isKdeLibs4supportInstalled()) {
|
||||
QSKIP("KDELibs4Support is not installed yet");
|
||||
}
|
||||
|
||||
QString ret = KStandardDirs::locate("widgets", "pics/kdialog.png");
|
||||
QCOMPARE(ret, QString()); // normal, there's no "widgets" resource in kstandarddirs by default
|
||||
|
||||
KGlobal::dirs()->addResourceType("widgets", "data", "kf5/widgets/");
|
||||
ret = KStandardDirs::locate("widgets", "pics/kdialog.png");
|
||||
QVERIFY(!ret.isEmpty());
|
||||
|
||||
ret = KStandardDirs::locate("widgets", "pics/kdoublenuminput.png");
|
||||
QVERIFY(!ret.isEmpty());
|
||||
|
||||
const QStringList files = KGlobal::dirs()->findAllResources("widgets", "pics/*", KStandardDirs::NoDuplicates);
|
||||
QVERIFY(files.count() >= 10);
|
||||
|
||||
KGlobal::dirs()->addResourceType("xdgdata-ontology", nullptr, "ontology");
|
||||
const QStringList ontologyDirs = KGlobal::dirs()->resourceDirs("xdgdata-ontology");
|
||||
QCOMPARE(ontologyDirs.first(), KStandardDirs::realPath(QString(qgetenv("XDG_DATA_HOME")) + "/ontology/"));
|
||||
if (QFile::exists("/usr/share/ontology") &&
|
||||
QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation).contains("/usr/share")) {
|
||||
QVERIFY(ontologyDirs.contains("/usr/share/ontology/"));
|
||||
}
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testAddResourceDir()
|
||||
{
|
||||
const QString dir = QFileInfo(QFINDTESTDATA("kstandarddirstest.cpp")).absolutePath();
|
||||
const QString file = "kstandarddirstest.cpp";
|
||||
QString ret = KStandardDirs::locate("here", file);
|
||||
QCOMPARE(ret, QString()); // not set up yet
|
||||
|
||||
KGlobal::dirs()->addResourceDir("here", dir);
|
||||
ret = KStandardDirs::locate("here", file);
|
||||
QCOMPARE_PATHS(ret, KStandardDirs::realPath(dir) + "kstandarddirstest.cpp");
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testSetXdgDataDirs()
|
||||
{
|
||||
// By default we should have KDEDIR/share/applications in `kf5-config --path xdgdata-apps`
|
||||
const QStringList dirs = KGlobal::dirs()->resourceDirs("xdgdata-apps");
|
||||
const QString kdeDataApps = KStandardDirs::realPath(CMAKE_INSTALL_PREFIX "/share/applications/");
|
||||
if (!dirs.contains(kdeDataApps)) {
|
||||
kDebug() << "ERROR:" << kdeDataApps << "not in" << dirs;
|
||||
kDebug() << "XDG_DATA_DIRS=" << qgetenv("XDG_DATA_DIRS");
|
||||
kDebug() << "installprefix=" << KStandardDirs::installPath("kdedir");
|
||||
kDebug() << "installdir=" << KStandardDirs::installPath("xdgdata-apps");
|
||||
kDebug() << "GenericDataLocation=" << QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
|
||||
}
|
||||
QVERIFY(dirs.contains(kdeDataApps, PATH_SENSITIVITY));
|
||||
|
||||
// When setting XDG_DATA_DIRS this should still be true
|
||||
const QString localApps = m_dataHome + "/applications/";
|
||||
QVERIFY(KStandardDirs::makeDir(localApps));
|
||||
|
||||
// canonicalPath: see the comment in initTestCase
|
||||
const QString customDataDir = QDir::home().canonicalPath() + QLatin1String("/.kde-unit-test/xdg/global");
|
||||
qputenv("XDG_DATA_DIRS", QFile::encodeName(customDataDir));
|
||||
QVERIFY(QDir(customDataDir).mkpath("applications"));
|
||||
KStandardDirs newStdDirs;
|
||||
const QStringList newDirs = newStdDirs.resourceDirs("xdgdata-apps");
|
||||
//qDebug() << newDirs;
|
||||
QVERIFY(newDirs.contains(kdeDataApps, PATH_SENSITIVITY));
|
||||
QVERIFY(newDirs.contains(localApps, PATH_SENSITIVITY));
|
||||
QVERIFY(newDirs.contains(customDataDir + "/applications/", PATH_SENSITIVITY));
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testRestrictedResources()
|
||||
{
|
||||
// Ensure we have a local xdgdata-apps dir
|
||||
QFile localFile(KStandardDirs::locateLocal("xdgdata-apps", "foo.desktop"));
|
||||
QVERIFY(localFile.open(QIODevice::WriteOnly | QIODevice::Text));
|
||||
localFile.write("foo");
|
||||
localFile.close();
|
||||
const QString localAppsDir = KStandardDirs::realPath(QFileInfo(localFile).absolutePath() + '/');
|
||||
QVERIFY(!localAppsDir.contains("foo.desktop"));
|
||||
// Ensure we have a local share/kstandarddirstest dir
|
||||
const QString localDataDir = KStandardDirs::locateLocal("data", "kstandarddirstest/");
|
||||
QVERIFY(!localDataDir.isEmpty());
|
||||
QVERIFY(QFile::exists(localDataDir));
|
||||
const QString localOtherDataDir = KStandardDirs::locateLocal("data", "other/");
|
||||
QVERIFY(!localOtherDataDir.isEmpty());
|
||||
|
||||
// Check unrestricted results first
|
||||
const QStringList appsDirs = KGlobal::dirs()->resourceDirs("xdgdata-apps");
|
||||
QCOMPARE_PATHS(appsDirs.first(), localAppsDir);
|
||||
const QString kdeDataApps = KStandardDirs::realPath(CMAKE_INSTALL_PREFIX "/share/applications/");
|
||||
QVERIFY(appsDirs.contains(kdeDataApps, PATH_SENSITIVITY));
|
||||
const QStringList dataDirs = KGlobal::dirs()->findDirs("data", "kstandarddirstest");
|
||||
QCOMPARE_PATHS(dataDirs.first(), localDataDir);
|
||||
const QStringList otherDataDirs = KGlobal::dirs()->findDirs("data", "other");
|
||||
QCOMPARE_PATHS(otherDataDirs.first(), localOtherDataDir);
|
||||
|
||||
// Initialize restrictions.
|
||||
// Need a new componentdata to trigger restricted-resource initialization
|
||||
// And we need to write the config _before_ creating the KStandardDirs.
|
||||
KConfig foorc("kstandarddirstestrc");
|
||||
KConfigGroup restrictionsGroup(&foorc, "KDE Resource Restrictions");
|
||||
restrictionsGroup.writeEntry("xdgdata-apps", false);
|
||||
restrictionsGroup.writeEntry("data_kstandarddirstest", false);
|
||||
restrictionsGroup.sync();
|
||||
|
||||
// Check restrictions.
|
||||
//KComponentData cData("foo");
|
||||
KStandardDirs *dirs = new KStandardDirs;
|
||||
dirs->addCustomized(&foorc); // like KGlobal::dirs() does
|
||||
QVERIFY(dirs->isRestrictedResource("xdgdata-apps"));
|
||||
QVERIFY(dirs->isRestrictedResource("data", "kstandarddirstest"));
|
||||
|
||||
const QStringList newAppsDirs = dirs->resourceDirs("xdgdata-apps");
|
||||
QVERIFY(newAppsDirs.contains(kdeDataApps, PATH_SENSITIVITY));
|
||||
QVERIFY(!newAppsDirs.contains(localAppsDir, PATH_SENSITIVITY)); // restricted!
|
||||
const QStringList newDataDirs = dirs->findDirs("data", "kstandarddirstest");
|
||||
QVERIFY(!newDataDirs.contains(localDataDir, PATH_SENSITIVITY)); // restricted!
|
||||
const QStringList newOtherDataDirs = dirs->findDirs("data", "other");
|
||||
QVERIFY(newOtherDataDirs.contains(localOtherDataDir, PATH_SENSITIVITY)); // not restricted!
|
||||
|
||||
restrictionsGroup.deleteGroup();
|
||||
localFile.remove();
|
||||
delete dirs;
|
||||
}
|
||||
|
||||
void KStandarddirsTest::testSymlinkResolution()
|
||||
{
|
||||
// On FreeBSD it is common to have a symlink /home -> /usr/home,
|
||||
// which messes with all the comparisons where **some** code paths
|
||||
// return a canonicalized path and some do not.
|
||||
if (QDir::homePath().compare(QFileInfo(QDir::homePath() + '/').canonicalFilePath(), PATH_SENSITIVITY) != 0) {
|
||||
QSKIP("HOME contains a symlink, not supported");
|
||||
}
|
||||
#ifndef Q_OS_WIN
|
||||
// This makes the save location for the david resource, "<XDG_DATA_HOME>/symlink/test/"
|
||||
// where symlink points to "real", and the subdir test will be created later
|
||||
// This used to confuse KStandardDirs and make it return unresolved paths,
|
||||
// and thus making comparisons fail later on in KConfig.
|
||||
QString baseDir = m_dataHome;
|
||||
const QString symlink = baseDir + "/symlink";
|
||||
const QString expected = baseDir + "/real/test/";
|
||||
QDir d_(baseDir + "/real");
|
||||
QVERIFY(d_.removeRecursively());
|
||||
QVERIFY(QDir(baseDir).mkdir("real"));
|
||||
QFile::remove(symlink);
|
||||
QVERIFY(!QFile::exists(symlink));
|
||||
QVERIFY(QFile::link("real", symlink));
|
||||
QVERIFY(QFileInfo(symlink).isSymLink());
|
||||
QVERIFY(!QFile::exists(expected));
|
||||
KGlobal::dirs()->addResourceType("david", nullptr, "symlink/test");
|
||||
QVERIFY(!QFile::exists(expected));
|
||||
const QString saveLoc = KGlobal::dirs()->resourceDirs("david").first();
|
||||
QVERIFY(!QFile::exists(expected));
|
||||
// The issue at this point is that saveLoc does not actually exist yet.
|
||||
QVERIFY(QDir(saveLoc).canonicalPath().isEmpty()); // this is why we can't use canonicalPath
|
||||
QVERIFY(!QFile::exists(saveLoc));
|
||||
QCOMPARE(saveLoc, KStandardDirs::realPath(saveLoc)); // must be resolved
|
||||
QCOMPARE(saveLoc, expected);
|
||||
QVERIFY(QDir(baseDir).mkpath("real/test")); // KConfig calls mkdir on its own, we simulate that here
|
||||
const QString sameSaveLoc = KGlobal::dirs()->resourceDirs("david").first();
|
||||
QCOMPARE(sameSaveLoc, saveLoc);
|
||||
QCOMPARE(sameSaveLoc, KGlobal::dirs()->saveLocation("david"));
|
||||
|
||||
// While we're here...
|
||||
QCOMPARE(KStandardDirs::realPath(QString()), QString());
|
||||
QCOMPARE(KStandardDirs::realPath(QString("/")), QString("/"));
|
||||
|
||||
QCOMPARE(KStandardDirs::realPath(QString("/does_not_exist/")), QString("/does_not_exist/"));
|
||||
#endif
|
||||
}
|
||||
|
||||
#include <QThreadPool>
|
||||
#include <QFutureSynchronizer>
|
||||
#include <qtconcurrentrun.h>
|
||||
|
||||
// To find multithreading bugs: valgrind --tool=helgrind ./kstandarddirstest testThreads
|
||||
void KStandarddirsTest::testThreads()
|
||||
{
|
||||
if (!isKdeLibs4supportInstalled()) {
|
||||
QSKIP("KDELibs4Support is not installed yet");
|
||||
}
|
||||
if (!m_canFindKConfig) {
|
||||
QSKIP("KDEDIRS does not contain the KConfig prefix");
|
||||
}
|
||||
|
||||
QThreadPool::globalInstance()->setMaxThreadCount(6);
|
||||
QFutureSynchronizer<void> sync;
|
||||
sync.addFuture(QtConcurrent::run(this, &KStandarddirsTest::testLocateLocal));
|
||||
sync.addFuture(QtConcurrent::run(this, &KStandarddirsTest::testSaveLocation));
|
||||
sync.addFuture(QtConcurrent::run(this, &KStandarddirsTest::testAppData));
|
||||
sync.addFuture(QtConcurrent::run(this, &KStandarddirsTest::testFindResource));
|
||||
sync.addFuture(QtConcurrent::run(this, &KStandarddirsTest::testFindAllResources));
|
||||
sync.addFuture(QtConcurrent::run(this, &KStandarddirsTest::testLocate));
|
||||
sync.addFuture(QtConcurrent::run(this, &KStandarddirsTest::testRelativeLocation));
|
||||
sync.waitForFinished();
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
Copyright (c) 2006 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef kstandarddirstest_h
|
||||
#define kstandarddirstest_h
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class KStandarddirsTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void testSaveLocation();
|
||||
void testLocateLocal();
|
||||
void testResourceDirs();
|
||||
void testAppData();
|
||||
void testChangeSaveLocation();
|
||||
void testFindResource();
|
||||
void testFindAllResources();
|
||||
void testFindAllResourcesNewDir();
|
||||
void testFindDirs();
|
||||
void testFindResourceDir();
|
||||
void testFindExe();
|
||||
void testFindExeLibExec();
|
||||
void testLocate();
|
||||
void testRelativeLocation();
|
||||
void testAddResourceType();
|
||||
void testAddResourceDir();
|
||||
void testSetXdgDataDirs();
|
||||
void testRestrictedResources();
|
||||
void testSymlinkResolution();
|
||||
void testThreads();
|
||||
|
||||
private:
|
||||
QString m_configHome;
|
||||
QString m_dataHome;
|
||||
bool m_canFindKConfig;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,225 @@
|
|||
/* This file is part of the KDE libraries
|
||||
|
||||
Copyright (c) 2008 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <QTest>
|
||||
#include <qtestevent.h>
|
||||
#include <ktabwidget.h>
|
||||
#include <klineedit.h>
|
||||
#include <QComboBox>
|
||||
#include <QTabBar>
|
||||
|
||||
class KTabWidget_UnitTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private Q_SLOTS:
|
||||
// Test calling tabText() from slotCurrentChanged().
|
||||
// Because QTabBar::insertTab() emits currentChanged before
|
||||
// QTabWidget calls tabInserted(), we were getting an assert in tabText().
|
||||
void testTabTextFromSlotCurrentChanged()
|
||||
{
|
||||
KTabWidget w;
|
||||
w.setAutomaticResizeTabs(true);
|
||||
const QString firstTitle = "First post!";
|
||||
connect(&w, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentChanged(int)));
|
||||
const int zero = w.insertTab(0, new QWidget, firstTitle); // calls slotCurrentChanged
|
||||
QCOMPARE(zero, 0);
|
||||
QCOMPARE(w.tabText(0), firstTitle);
|
||||
}
|
||||
|
||||
void testCloseFirstTab()
|
||||
{
|
||||
// Test inspired by #170470, but the bug only happened when calling setTabText
|
||||
// in slotCurrentChanged so the real unit test for that bug is in konqueror.
|
||||
KTabWidget w;
|
||||
w.setAutomaticResizeTabs(true);
|
||||
w.resize(300, 400);
|
||||
// Send the pending resize event (resize() only sets Qt::WA_PendingResizeEvent)
|
||||
QResizeEvent e(w.size(), QSize());
|
||||
QApplication::sendEvent(&w, &e);
|
||||
|
||||
QString prefix = "This is a long prefix for the tab title. ";
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
w.insertTab(i, new QWidget, prefix + QString::number(i));
|
||||
}
|
||||
w.removeTab(0);
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
//kDebug() << i << w.tabText(i);
|
||||
QCOMPARE(w.tabText(i), QString(prefix + QString::number(i + 1)));
|
||||
}
|
||||
w.removeTab(0);
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
//kDebug() << i << w.tabText(i);
|
||||
QCOMPARE(w.tabText(i), QString(prefix + QString::number(i + 2)));
|
||||
}
|
||||
}
|
||||
void testMoveTab()
|
||||
{
|
||||
// Test inspired by #170470 and #177036 (title messup).
|
||||
// Then expanded to include the problem of #159295 (focus loss).
|
||||
QWidget topLevel;
|
||||
QComboBox *combo = new QComboBox(&topLevel);
|
||||
combo->setEditable(true);
|
||||
KTabWidget *w = new KTabWidget(&topLevel);
|
||||
w->setAutomaticResizeTabs(true);
|
||||
w->resize(300, 400);
|
||||
QResizeEvent e(w->size(), QSize());
|
||||
QApplication::sendEvent(w, &e);
|
||||
QString prefix = "This is a long prefix for the tab title. ";
|
||||
KLineEdit *lineEdits[4];
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
QWidget *page = new QWidget;
|
||||
page->setObjectName(QString::number(i));
|
||||
lineEdits[i] = new KLineEdit(page); // a widget that can take focus
|
||||
lineEdits[i]->setObjectName("LineEdit" + QString::number(i));
|
||||
w->insertTab(i, page, prefix + QString::number(i));
|
||||
//kDebug() << i << w->tabText(i);
|
||||
}
|
||||
topLevel.show();
|
||||
// Necessary after show(), otherwise topLevel.focusWidget() returns NULL
|
||||
QApplication::setActiveWindow(&topLevel);
|
||||
|
||||
// Make sure the tab order is so that the combo gets focus after this tab
|
||||
QWidget::setTabOrder(lineEdits[0], combo->lineEdit());
|
||||
QWidget::setTabOrder(combo->lineEdit(), lineEdits[1]);
|
||||
|
||||
w->setCurrentIndex(0);
|
||||
lineEdits[0]->setFocus();
|
||||
QCOMPARE(topLevel.focusWidget()->objectName(), lineEdits[0]->objectName());
|
||||
QVERIFY(lineEdits[0]->isVisible());
|
||||
|
||||
w->moveTab(0, 3);
|
||||
//for (int i = 0; i < 4; ++i)
|
||||
//kDebug() << i << w->tabText(i);
|
||||
QCOMPARE(w->tabText(0), QString(prefix + QString::number(1)));
|
||||
QCOMPARE(w->tabText(1), QString(prefix + QString::number(2)));
|
||||
QCOMPARE(w->tabText(2), QString(prefix + QString::number(3)));
|
||||
QCOMPARE(w->tabText(3), QString(prefix + QString::number(0)));
|
||||
|
||||
// Did the focus switch to the lineEdit, due to removeTab+insertTab? Whoops.
|
||||
QCOMPARE(topLevel.focusWidget()->objectName(), lineEdits[0]->objectName());
|
||||
|
||||
w->moveTab(3, 0);
|
||||
QCOMPARE(topLevel.focusWidget()->objectName(), lineEdits[0]->objectName());
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
//kDebug() << i << w->tabText(i);
|
||||
QCOMPARE(w->tabText(i), QString(prefix + QString::number(i)));
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef KDELIBS4SUPPORT_NO_DEPRECATED
|
||||
void testSetHidden()
|
||||
{
|
||||
KTabWidget w;
|
||||
w.insertTab(0, new QWidget, "a tab");
|
||||
QVERIFY(!w.isTabBarHidden());
|
||||
w.show();
|
||||
QVERIFY(!w.isTabBarHidden());
|
||||
w.setTabBarHidden(true);
|
||||
QVERIFY(w.isTabBarHidden());
|
||||
}
|
||||
#endif
|
||||
void testMouseButtonTabReordering();
|
||||
void testTabMoved();
|
||||
|
||||
private Q_SLOTS:
|
||||
void slotCurrentChanged(int index)
|
||||
{
|
||||
QCOMPARE(index, 0);
|
||||
KTabWidget *w = qobject_cast<KTabWidget *>(sender());
|
||||
QVERIFY(w);
|
||||
QCOMPARE(w->tabText(0), QString("First post!"));
|
||||
}
|
||||
};
|
||||
|
||||
// MyTabWidget is a tab widget that provides access to the tab bar.
|
||||
// This is needed for the following unit test.
|
||||
|
||||
class MyTabWidget : public KTabWidget
|
||||
{
|
||||
|
||||
public:
|
||||
QTabBar *getTabBar() const
|
||||
{
|
||||
return tabBar();
|
||||
}
|
||||
};
|
||||
|
||||
void KTabWidget_UnitTest::testMouseButtonTabReordering()
|
||||
{
|
||||
// This test passes locally but fails on CI.
|
||||
// Tab reordering works, let's not spend time on this.
|
||||
#if 0
|
||||
MyTabWidget tabWidget;
|
||||
tabWidget.setMovable(true);
|
||||
|
||||
QWidget *w0 = new QWidget;
|
||||
QWidget *w1 = new QWidget;
|
||||
tabWidget.insertTab(0, w0, "Tab 0");
|
||||
tabWidget.insertTab(1, w1, "Tab 1");
|
||||
tabWidget.show();
|
||||
|
||||
QPoint pos0 = tabWidget.getTabBar()->tabRect(0).center();
|
||||
QPoint pos1 = tabWidget.getTabBar()->tabRect(1).center();
|
||||
|
||||
// Press LMB
|
||||
QTest::mousePress(tabWidget.getTabBar(), Qt::LeftButton, Qt::NoModifier, pos0);
|
||||
|
||||
// We need a first move event on tab 0 to initialize tab moving
|
||||
QMouseEvent moveEvent(QEvent::MouseMove, pos0, Qt::NoButton, Qt::LeftButton, Qt::NoModifier);
|
||||
bool moveEventReceived = qApp->notify(tabWidget.getTabBar(), &moveEvent);
|
||||
QVERIFY(moveEventReceived);
|
||||
|
||||
// Move tab 0 to tab 1
|
||||
moveEvent = QMouseEvent(QEvent::MouseMove, pos1, Qt::NoButton, Qt::LeftButton, Qt::NoModifier);
|
||||
moveEventReceived = qApp->notify(tabWidget.getTabBar(), &moveEvent);
|
||||
QVERIFY(moveEventReceived);
|
||||
|
||||
QCOMPARE(tabWidget.tabText(0), QString("Tab 1"));
|
||||
QCOMPARE(tabWidget.tabText(1), QString("Tab 0"));
|
||||
QCOMPARE(tabWidget.widget(0), w1);
|
||||
QCOMPARE(tabWidget.widget(1), w0);
|
||||
|
||||
QTest::mouseRelease(tabWidget.getTabBar(), Qt::LeftButton, Qt::NoModifier, pos1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void KTabWidget_UnitTest::testTabMoved()
|
||||
{
|
||||
MyTabWidget tabWidget;
|
||||
tabWidget.setMovable(true);
|
||||
tabWidget.setAutomaticResizeTabs(true);
|
||||
|
||||
tabWidget.insertTab(0, new QWidget, "Tab A");
|
||||
tabWidget.insertTab(1, new QWidget, "Tab B");
|
||||
tabWidget.insertTab(2, new QWidget, "Tab C");
|
||||
tabWidget.insertTab(3, new QWidget, "Tab D");
|
||||
|
||||
tabWidget.getTabBar()->moveTab(3, 1);
|
||||
|
||||
QCOMPARE(tabWidget.tabText(0), QString("Tab A"));
|
||||
QCOMPARE(tabWidget.tabText(1), QString("Tab D"));
|
||||
QCOMPARE(tabWidget.tabText(2), QString("Tab B"));
|
||||
QCOMPARE(tabWidget.tabText(3), QString("Tab C"));
|
||||
}
|
||||
|
||||
QTEST_MAIN(KTabWidget_UnitTest)
|
||||
|
||||
#include "ktabwidget_unittest.moc"
|
|
@ -0,0 +1,102 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005 Thomas Braxton <brax108@cox.net>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "qtest_kde.h"
|
||||
#include <ktempdir.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
class KTempDirTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
void testDefaultCtor();
|
||||
void testNoDelete();
|
||||
void testAutoDelete();
|
||||
void testCreateSubDir();
|
||||
};
|
||||
|
||||
void KTempDirTest::testDefaultCtor()
|
||||
{
|
||||
QString name;
|
||||
{
|
||||
KTempDir dir;
|
||||
QVERIFY(dir.status() == 0);
|
||||
QVERIFY(dir.exists());
|
||||
name = dir.name();
|
||||
qDebug() << name;
|
||||
QVERIFY(QDir(name).exists());
|
||||
}
|
||||
QVERIFY(!QDir(name).exists());
|
||||
#ifdef Q_OS_UNIX
|
||||
QVERIFY2(name.startsWith(QLatin1String("/tmp/")), qPrintable(name));
|
||||
#endif
|
||||
}
|
||||
|
||||
void KTempDirTest::testNoDelete()
|
||||
{
|
||||
KTempDir dir(QLatin1String("test"));
|
||||
dir.setAutoRemove(false);
|
||||
QVERIFY(dir.status() == 0);
|
||||
QVERIFY(dir.exists());
|
||||
QVERIFY(QDir(dir.name()).exists());
|
||||
|
||||
dir.unlink();
|
||||
QVERIFY(dir.status() == 0);
|
||||
QVERIFY(!dir.exists());
|
||||
QVERIFY(!QDir(dir.name()).exists());
|
||||
|
||||
}
|
||||
|
||||
void KTempDirTest::testAutoDelete()
|
||||
{
|
||||
KTempDir *dir = new KTempDir(QLatin1String("test"));
|
||||
QVERIFY(dir->status() == 0);
|
||||
QVERIFY(dir->exists());
|
||||
|
||||
QString dName = dir->name();
|
||||
delete dir;
|
||||
QVERIFY(!QDir(dName).exists());
|
||||
}
|
||||
|
||||
void KTempDirTest::testCreateSubDir()
|
||||
{
|
||||
KTempDir *dir = new KTempDir(QLatin1String("test"));
|
||||
QVERIFY(dir->status() == 0);
|
||||
QVERIFY(dir->exists());
|
||||
|
||||
QDir d(dir->name());
|
||||
QVERIFY(d.exists());
|
||||
|
||||
QVERIFY(d.mkdir(QString(QString::fromLatin1("123"))));
|
||||
QVERIFY(d.mkdir(QString(QString::fromLatin1("456"))));
|
||||
|
||||
QString dName = dir->name();
|
||||
delete dir;
|
||||
d.refresh();
|
||||
|
||||
QVERIFY(!QDir(dName).exists());
|
||||
QVERIFY(!d.exists(QString::fromLatin1(("123"))));
|
||||
QVERIFY(!d.exists(QString(QString::fromLatin1("456"))));
|
||||
}
|
||||
|
||||
QTEST_MAIN(KTempDirTest)
|
||||
|
||||
#include "ktempdirtest.moc"
|
|
@ -0,0 +1,99 @@
|
|||
/*
|
||||
This file is part of the KDE libraries
|
||||
This file has been placed in the Public Domain.
|
||||
*/
|
||||
|
||||
#undef QT_NO_CAST_FROM_ASCII
|
||||
|
||||
#include "ktemporaryfiletest.h"
|
||||
|
||||
#include "qtest_kde.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QCoreApplication>
|
||||
|
||||
#include "ktemporaryfile.h"
|
||||
|
||||
QTEST_MAIN(KTemporaryFileTest)
|
||||
|
||||
/*
|
||||
Notes on these tests:
|
||||
|
||||
- I'm not testing anything that QTemporaryFile should handle, like the
|
||||
working of setAutoRemove(). I suggest letting Trolltech handle making sure
|
||||
those things work. These should only test KDE specific functionality.
|
||||
|
||||
*/
|
||||
|
||||
void KTemporaryFileTest::initTestCase()
|
||||
{
|
||||
kdeTempDir = QDir::tempPath() + '/';
|
||||
componentName = QCoreApplication::instance()->applicationName();
|
||||
|
||||
QDir qdir(kdeTempDir);
|
||||
qdir.mkdir("ktempfiletest");
|
||||
}
|
||||
|
||||
void KTemporaryFileTest::cleanupTestCase()
|
||||
{
|
||||
QDir qdir(kdeTempDir);
|
||||
qdir.rmdir("ktempfiletest");
|
||||
}
|
||||
|
||||
// Test putting files in the default KDE temp directory
|
||||
void KTemporaryFileTest::testKTemporaryFile()
|
||||
{
|
||||
|
||||
//Test basic placement
|
||||
QString first;
|
||||
{
|
||||
KTemporaryFile file;
|
||||
QVERIFY(file.open());
|
||||
QVERIFY(file.fileName().startsWith(kdeTempDir + componentName));
|
||||
QVERIFY(file.fileName().endsWith(QLatin1String(".tmp")));
|
||||
QVERIFY(QFile::exists(file.fileName()));
|
||||
first = file.fileName();
|
||||
}
|
||||
QVERIFY(!QFile::exists(first));
|
||||
|
||||
// Test we don't get the same twice
|
||||
{
|
||||
KTemporaryFile file;
|
||||
QVERIFY(file.open());
|
||||
QVERIFY(first != file.fileName());
|
||||
}
|
||||
|
||||
//Test relative subdirectory
|
||||
{
|
||||
KTemporaryFile file;
|
||||
file.setPrefix("ktempfiletest/");
|
||||
QVERIFY(file.open());
|
||||
QVERIFY(file.fileName().startsWith(kdeTempDir + "ktempfiletest/"));
|
||||
QVERIFY(file.fileName().endsWith(QLatin1String(".tmp")));
|
||||
QVERIFY(QFile::exists(file.fileName()));
|
||||
}
|
||||
|
||||
//Test relative filename
|
||||
{
|
||||
KTemporaryFile file;
|
||||
file.setPrefix("spam");
|
||||
file.setSuffix("eggs");
|
||||
QVERIFY(file.open());
|
||||
QVERIFY(file.fileName().startsWith(kdeTempDir + "spam"));
|
||||
QVERIFY(file.fileName().endsWith(QLatin1String("eggs")));
|
||||
QVERIFY(QFile::exists(file.fileName()));
|
||||
}
|
||||
|
||||
//Test suffix only
|
||||
{
|
||||
KTemporaryFile file;
|
||||
file.setSuffix("eggs");
|
||||
QVERIFY(file.open());
|
||||
QVERIFY(file.fileName().endsWith(QLatin1String("eggs")));
|
||||
QVERIFY(QFile::exists(file.fileName()));
|
||||
}
|
||||
|
||||
//TODO: How to test outside of tmp when we can't be sure what
|
||||
//directories we have write access to?
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
This file is part of the KDE libraries
|
||||
This file has been placed in the Public Domain.
|
||||
*/
|
||||
|
||||
#ifndef ktemporaryfiletest_h
|
||||
#define ktemporaryfiletest_h
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
class KTemporaryFileTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
void testKTemporaryFile();
|
||||
|
||||
private:
|
||||
QString kdeTempDir;
|
||||
QString componentName;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,798 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005-2007,2011-2012 David Jarvie <djarvie@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "ktimezonestest.h"
|
||||
#include "ktimezonestest_p.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <QTest>
|
||||
#include <QDir>
|
||||
#include <QDate>
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusMessage>
|
||||
#include <QTimer>
|
||||
#include <QSignalSpy>
|
||||
#include <config-date.h> // for HAVE_TM_GMTOFF
|
||||
#include "ksystemtimezone.h"
|
||||
#include "ktzfiletimezone.h"
|
||||
|
||||
QTEST_MAIN(KTimeZonesTest)
|
||||
|
||||
TimeZoneTestData s_testData;
|
||||
|
||||
void KTimeZonesTest::initTestCase()
|
||||
{
|
||||
qputenv("TZ", "Europe/London");
|
||||
::tzset();
|
||||
|
||||
s_testData.setupTimeZoneTest(); // see ktimezonestest_p.h
|
||||
mDataDir = s_testData.dataDir();
|
||||
}
|
||||
|
||||
void KTimeZonesTest::cleanupTestCase()
|
||||
{
|
||||
s_testData.cleanupTimeZoneTest();
|
||||
}
|
||||
|
||||
///////////////////
|
||||
// KTimeZones tests
|
||||
///////////////////
|
||||
|
||||
void KTimeZonesTest::ktimezones()
|
||||
{
|
||||
KTimeZones timezones;
|
||||
KTimeZone zone1("Zone1");
|
||||
QVERIFY(zone1.isValid());
|
||||
KTimeZone zone2("Zone2");
|
||||
QVERIFY(zone2.isValid());
|
||||
QVERIFY(timezones.add(zone1));
|
||||
QVERIFY(!timezones.add(zone1));
|
||||
QVERIFY(timezones.add(zone2));
|
||||
QCOMPARE(timezones.zones().count(), 2);
|
||||
KTimeZone tz = timezones.zone("Zone1");
|
||||
QVERIFY((tz == zone1));
|
||||
tz = timezones.zone("Zone99");
|
||||
QVERIFY(!tz.isValid());
|
||||
zone1 = timezones.remove(zone1);
|
||||
QVERIFY(zone1.isValid());
|
||||
QCOMPARE(timezones.zones().count(), 1);
|
||||
QVERIFY(!timezones.remove(zone1).isValid());
|
||||
QVERIFY(timezones.add(zone1));
|
||||
QVERIFY(timezones.remove("Zone1").isValid());
|
||||
QVERIFY(!timezones.remove("Zone1").isValid());
|
||||
QVERIFY(timezones.remove("Zone2").isValid());
|
||||
zone1 = KTimeZone("Zone10");
|
||||
QVERIFY(timezones.add(zone1));
|
||||
QCOMPARE(timezones.zones().count(), 1);
|
||||
timezones.clear();
|
||||
QCOMPARE(timezones.zones().count(), 0);
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
// KTimeZone: ref counting
|
||||
//////////////////////////
|
||||
|
||||
void KTimeZonesTest::refcount()
|
||||
{
|
||||
KTimeZone *zone1 = new KTimeZone("Zone1");
|
||||
QCOMPARE(zone1->name(), QString("Zone1"));
|
||||
KTimeZones timezones;
|
||||
timezones.add(*zone1);
|
||||
delete zone1;
|
||||
zone1 = nullptr;
|
||||
KTimeZone tz = timezones.zone("Zone1");
|
||||
QVERIFY(tz.isValid());
|
||||
QCOMPARE(tz.name(), QString("Zone1"));
|
||||
QCOMPARE(tz.type(), QByteArray("KTimeZone"));
|
||||
}
|
||||
|
||||
///////////////////
|
||||
// KTimeZone: UTC
|
||||
///////////////////
|
||||
|
||||
void KTimeZonesTest::utc()
|
||||
{
|
||||
KTimeZone utc = KTimeZone::utc();
|
||||
QVERIFY(utc.isValid());
|
||||
QCOMPARE(utc.name(), QString("UTC"));
|
||||
QCOMPARE(utc.offsetAtUtc(QDateTime(QDate(2005, 1, 1), QTime(), Qt::LocalTime)), 0);
|
||||
QCOMPARE(utc.offsetAtUtc(QDateTime(QDate(2005, 1, 1), QTime(), Qt::UTC)), 0);
|
||||
QCOMPARE(utc.offsetAtUtc(QDateTime(QDate(2005, 2, 1), QTime(), Qt::UTC)), 0);
|
||||
QCOMPARE(utc.offsetAtUtc(QDateTime(QDate(2005, 7, 1), QTime(), Qt::UTC)), 0);
|
||||
}
|
||||
|
||||
/////////////////////////
|
||||
// KSystemTimeZones tests
|
||||
/////////////////////////
|
||||
|
||||
// Defined in ksystemtimezone.cpp for our benefit
|
||||
KDELIBS4SUPPORT_EXPORT void k_system_time_zone_private_reset_config();
|
||||
|
||||
void KTimeZonesTest::invalidLocal()
|
||||
{
|
||||
KTimeZone local;
|
||||
KConfig config("ktimezonedrc");
|
||||
KConfigGroup group(&config, "TimeZones");
|
||||
|
||||
// Check that the originally set local local time zone is valid
|
||||
local = KSystemTimeZones::local();
|
||||
QVERIFY(local.isValid());
|
||||
QCOMPARE(local.name(), QString::fromLatin1("Europe/Paris"));
|
||||
QCOMPARE(local.type(), QByteArray("KTzfileTimeZone"));
|
||||
|
||||
// Check invalid LocalZone
|
||||
group.writeEntry("LocalZone", QString::fromLatin1("Invalid/Zone"));
|
||||
config.sync();
|
||||
k_system_time_zone_private_reset_config();
|
||||
|
||||
local = KSystemTimeZones::local();
|
||||
QVERIFY(local.isValid());
|
||||
QCOMPARE(local.name(), QString::fromLatin1("UTC"));
|
||||
QCOMPARE(local, KTimeZone::utc());
|
||||
|
||||
// Check empty LocalZone
|
||||
group.deleteEntry("LocalZone");
|
||||
config.sync();
|
||||
k_system_time_zone_private_reset_config();
|
||||
|
||||
local = KSystemTimeZones::local();
|
||||
QVERIFY(local.isValid());
|
||||
QCOMPARE(local.name(), QString::fromLatin1("UTC"));
|
||||
QCOMPARE(local, KTimeZone::utc());
|
||||
|
||||
// Check invalid ZoneinfoDir
|
||||
group.writeEntry("ZoneinfoDir", QString::fromLatin1("/invalid/zoneinfo/dir"));
|
||||
group.writeEntry("Zonetab", QString("/invalid/zoneinfo/dir" + QString::fromLatin1("/zone.tab")));
|
||||
group.writeEntry("LocalZone", QString::fromLatin1("Europe/Paris"));
|
||||
config.sync();
|
||||
k_system_time_zone_private_reset_config();
|
||||
|
||||
local = KSystemTimeZones::local();
|
||||
QVERIFY(local.isValid());
|
||||
QCOMPARE(local.name(), QString::fromLatin1("UTC"));
|
||||
QCOMPARE(local, KTimeZone::utc());
|
||||
|
||||
// Check empty ZoneinfoDir
|
||||
group.deleteEntry("ZoneinfoDir");
|
||||
group.deleteEntry("Zonetab");
|
||||
config.sync();
|
||||
k_system_time_zone_private_reset_config();
|
||||
|
||||
local = KSystemTimeZones::local();
|
||||
QVERIFY(local.isValid());
|
||||
QCOMPARE(local.name(), QString::fromLatin1("UTC"));
|
||||
QCOMPARE(local, KTimeZone::utc());
|
||||
|
||||
// KTimeZonesTest::local() will restore config for us
|
||||
}
|
||||
|
||||
void KTimeZonesTest::local()
|
||||
{
|
||||
// Restore the configuration after ::invalidLocal()
|
||||
KConfig config("ktimezonedrc");
|
||||
KConfigGroup group(&config, "TimeZones");
|
||||
group.writeEntry("ZoneinfoDir", mDataDir);
|
||||
group.writeEntry("Zonetab", QString(mDataDir + QString::fromLatin1("/zone.tab")));
|
||||
group.writeEntry("LocalZone", QString::fromLatin1("Europe/Paris"));
|
||||
config.sync();
|
||||
k_system_time_zone_private_reset_config();
|
||||
|
||||
// Verify that we have a valid local time zone
|
||||
KTimeZone local = KSystemTimeZones::local();
|
||||
QVERIFY(local.isValid());
|
||||
QCOMPARE(local.name(), QString::fromLatin1("Europe/Paris"));
|
||||
QCOMPARE(local.type(), QByteArray("KTzfileTimeZone"));
|
||||
}
|
||||
|
||||
void KTimeZonesTest::zone()
|
||||
{
|
||||
KTimeZone utc = KSystemTimeZones::zone("UTC");
|
||||
QVERIFY(utc.isValid());
|
||||
KTimeZone losAngeles = KSystemTimeZones::zone("America/Los_Angeles");
|
||||
QVERIFY(losAngeles.isValid());
|
||||
KTimeZone london = KSystemTimeZones::zone("Europe/London");
|
||||
QVERIFY(london.isValid());
|
||||
QCOMPARE(london.countryCode(), QString("GB"));
|
||||
QCOMPARE(london.latitude(), float(51 * 3600 + 28 * 60 + 30) / 3600.0f);
|
||||
QCOMPARE(london.longitude(), -float(0 * 3600 + 18 * 60 + 45) / 3600.0f);
|
||||
QCOMPARE(london.comment(), QString("Great Britain"));
|
||||
QCOMPARE(losAngeles.longitude(), -float(118 * 3600 + 14 * 60 + 34) / 3600.0f);
|
||||
}
|
||||
|
||||
void KTimeZonesTest::zoneinfoDir()
|
||||
{
|
||||
QString zoneinfo = KSystemTimeZones::zoneinfoDir();
|
||||
QCOMPARE(zoneinfo, mDataDir);
|
||||
}
|
||||
|
||||
void KTimeZonesTest::zonetabChange()
|
||||
{
|
||||
QEventLoop loop;
|
||||
QTimer timer;
|
||||
timer.setSingleShot(true);
|
||||
QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
|
||||
QSignalSpy timeoutSpy(&timer, SIGNAL(timeout()));
|
||||
|
||||
QCOMPARE(KSystemTimeZones::zones().count(), 5);
|
||||
KTimeZone london = KSystemTimeZones::zone("Europe/London");
|
||||
QVERIFY(london.isValid());
|
||||
QCOMPARE(london.countryCode(), QString("GB"));
|
||||
QCOMPARE(london.latitude(), float(51 * 3600 + 28 * 60 + 30) / 3600.0f);
|
||||
QCOMPARE(london.longitude(), -float(0 * 3600 + 18 * 60 + 45) / 3600.0f);
|
||||
QCOMPARE(london.comment(), QString("Great Britain"));
|
||||
QVERIFY(!KSystemTimeZones::zone("Europe/Berlin").isValid());
|
||||
QVERIFY(KSystemTimeZones::zone("Europe/Paris").isValid());
|
||||
QVERIFY(KSystemTimeZones::zone("Europe/London").isValid());
|
||||
QVERIFY(KSystemTimeZones::zone("Africa/Cairo").isValid());
|
||||
QVERIFY(!KSystemTimeZones::zone("Asia/Dili").isValid());
|
||||
QVERIFY(KSystemTimeZones::zone("America/Los_Angeles").isValid());
|
||||
|
||||
// Check that 'london' is automatically updated with the new zone.tab
|
||||
// contents, and that the new zones are added to KSystemTimeZones.
|
||||
s_testData.writeZoneTab(true);
|
||||
QDBusMessage message = QDBusMessage::createSignal("/Daemon", "org.kde.KTimeZoned", "timeZoneDatabaseUpdated");
|
||||
QList<QVariant> args;
|
||||
args += QString(mDataDir + QLatin1String("/zone.tab"));
|
||||
message.setArguments(args);
|
||||
QDBusConnection::sessionBus().send(message);
|
||||
timer.start(1000);
|
||||
loop.exec();
|
||||
QCOMPARE(KSystemTimeZones::zones().count(), 7);
|
||||
QVERIFY(london.isValid());
|
||||
QCOMPARE(london.countryCode(), QString("XX"));
|
||||
QCOMPARE(london.latitude(), -float(51 * 3600 + 28 * 60 + 30) / 3600.0f);
|
||||
QCOMPARE(london.longitude(), float(0 * 3600 + 18 * 60 + 45) / 3600.0f);
|
||||
QCOMPARE(london.comment(), QString("Greater Britain"));
|
||||
QCOMPARE(KSystemTimeZones::zone("Europe/London"), london);
|
||||
QVERIFY(KSystemTimeZones::zone("Europe/Berlin").isValid());
|
||||
QVERIFY(KSystemTimeZones::zone("Europe/Paris").isValid());
|
||||
QVERIFY(KSystemTimeZones::zone("Europe/London").isValid());
|
||||
QVERIFY(KSystemTimeZones::zone("Africa/Cairo").isValid());
|
||||
QVERIFY(KSystemTimeZones::zone("Africa/Johannesburg").isValid());
|
||||
QVERIFY(KSystemTimeZones::zone("Asia/Dili").isValid());
|
||||
QVERIFY(KSystemTimeZones::zone("America/Los_Angeles").isValid());
|
||||
|
||||
// Check that 'london' is automatically updated with the new zone.tab
|
||||
// contents, and that the removed zones are deleted from KSystemTimeZones.
|
||||
s_testData.writeZoneTab(false);
|
||||
QDBusConnection::sessionBus().send(message);
|
||||
timer.start(1000);
|
||||
loop.exec();
|
||||
QCOMPARE(KSystemTimeZones::zones().count(), 5);
|
||||
QVERIFY(london.isValid());
|
||||
QCOMPARE(london.countryCode(), QString("GB"));
|
||||
QCOMPARE(london.latitude(), float(51 * 3600 + 28 * 60 + 30) / 3600.0f);
|
||||
QCOMPARE(london.longitude(), -float(0 * 3600 + 18 * 60 + 45) / 3600.0f);
|
||||
QCOMPARE(london.comment(), QString("Great Britain"));
|
||||
QCOMPARE(KSystemTimeZones::zone("Europe/London"), london);
|
||||
QVERIFY(!KSystemTimeZones::zone("Europe/Berlin").isValid());
|
||||
QVERIFY(KSystemTimeZones::zone("Europe/Paris").isValid());
|
||||
QVERIFY(KSystemTimeZones::zone("Europe/London").isValid());
|
||||
QVERIFY(KSystemTimeZones::zone("Africa/Cairo").isValid());
|
||||
QVERIFY(!KSystemTimeZones::zone("Asia/Dili").isValid());
|
||||
QVERIFY(KSystemTimeZones::zone("America/Los_Angeles").isValid());
|
||||
}
|
||||
|
||||
////////////////////////
|
||||
// KSystemTimeZone tests
|
||||
////////////////////////
|
||||
|
||||
void KTimeZonesTest::currentOffset()
|
||||
{
|
||||
QString tzfile = ':' + mDataDir + "/Europe/Paris";
|
||||
QByteArray originalZone = qgetenv("TZ"); // save the original local time zone
|
||||
qputenv("TZ", tzfile.toLatin1());
|
||||
::tzset();
|
||||
|
||||
// Find the current offset of a time zone
|
||||
time_t now = time(nullptr);
|
||||
tm *tnow = localtime(&now);
|
||||
#if HAVE_TM_GMTOFF
|
||||
int offset = tnow->tm_gmtoff;
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
KTimeZone local = KSystemTimeZones::local();
|
||||
QVERIFY(local.isValid());
|
||||
QCOMPARE(local.currentOffset(Qt::UTC), offset);
|
||||
|
||||
// Restore the original local time zone
|
||||
if (originalZone.isEmpty()) {
|
||||
::unsetenv("TZ");
|
||||
} else {
|
||||
qputenv("TZ", originalZone);
|
||||
}
|
||||
::tzset();
|
||||
}
|
||||
|
||||
void KTimeZonesTest::offsetAtUtc()
|
||||
{
|
||||
// Find some offsets for Europe/London.
|
||||
KTimeZone losAngeles = KSystemTimeZones::zone("America/Los_Angeles");
|
||||
QVERIFY(losAngeles.isValid());
|
||||
KTimeZone london = KSystemTimeZones::zone("Europe/London");
|
||||
QVERIFY(london.isValid());
|
||||
QDateTime winter(QDate(2005, 1, 1), QTime(0, 0, 0), Qt::UTC);
|
||||
QDateTime summer(QDate(2005, 6, 1), QTime(0, 0, 0), Qt::UTC);
|
||||
QCOMPARE(london.offsetAtUtc(winter), 0);
|
||||
QCOMPARE(london.offsetAtUtc(summer), 3600);;
|
||||
QCOMPARE(losAngeles.offsetAtUtc(winter), -28800);
|
||||
QCOMPARE(losAngeles.offsetAtUtc(summer), -25200);;
|
||||
}
|
||||
|
||||
void KTimeZonesTest::offsetAtZoneTime()
|
||||
{
|
||||
QDateTime Gmt1(QDate(2005, 3, 27), QTime(0, 30, 0), Qt::LocalTime);
|
||||
QDateTime GmtToBst1(QDate(2005, 3, 27), QTime(0, 59, 59), Qt::LocalTime);
|
||||
QDateTime GmtToBst2(QDate(2005, 3, 27), QTime(1, 0, 0), Qt::LocalTime);
|
||||
QDateTime GmtToBst3(QDate(2005, 3, 27), QTime(1, 59, 59), Qt::LocalTime);
|
||||
QDateTime GmtToBst4(QDate(2005, 3, 27), QTime(2, 0, 0), Qt::LocalTime);
|
||||
QDateTime Bst1(QDate(2005, 4, 27), QTime(2, 30, 0), Qt::LocalTime);
|
||||
QDateTime Bst2(QDate(2005, 10, 30), QTime(0, 30, 0), Qt::LocalTime);
|
||||
QDateTime BstToGmt1(QDate(2005, 10, 30), QTime(0, 59, 59), Qt::LocalTime);
|
||||
QDateTime BstToGmt2(QDate(2005, 10, 30), QTime(1, 0, 0), Qt::LocalTime);
|
||||
QDateTime BstToGmt3(QDate(2005, 10, 30), QTime(1, 59, 59), Qt::LocalTime);
|
||||
QDateTime BstToGmt4(QDate(2005, 10, 30), QTime(2, 0, 0), Qt::LocalTime);
|
||||
QDateTime Gmt2(QDate(2005, 10, 30), QTime(2, 30, 0), Qt::LocalTime);
|
||||
KTimeZone london = KSystemTimeZones::zone("Europe/London");
|
||||
QVERIFY(london.isValid());
|
||||
int offset2;
|
||||
QCOMPARE(london.offsetAtZoneTime(Gmt1, &offset2), 0);
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(london.offsetAtZoneTime(GmtToBst1, &offset2), 0);
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(london.offsetAtZoneTime(GmtToBst2, &offset2), KTimeZone::InvalidOffset);
|
||||
QCOMPARE(offset2, KTimeZone::InvalidOffset);
|
||||
QCOMPARE(london.offsetAtZoneTime(GmtToBst3, &offset2), KTimeZone::InvalidOffset);
|
||||
QCOMPARE(offset2, KTimeZone::InvalidOffset);
|
||||
QCOMPARE(london.offsetAtZoneTime(GmtToBst4, &offset2), 3600);
|
||||
QCOMPARE(offset2, 3600);
|
||||
QCOMPARE(london.offsetAtZoneTime(Bst1, &offset2), 3600);
|
||||
QCOMPARE(offset2, 3600);
|
||||
QCOMPARE(london.offsetAtZoneTime(Bst2, &offset2), 3600);
|
||||
QCOMPARE(offset2, 3600);
|
||||
QCOMPARE(london.offsetAtZoneTime(BstToGmt1, &offset2), 3600);
|
||||
QCOMPARE(offset2, 3600);
|
||||
QCOMPARE(london.offsetAtZoneTime(BstToGmt2, &offset2), 3600);
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(london.offsetAtZoneTime(BstToGmt3, &offset2), 3600);
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(london.offsetAtZoneTime(BstToGmt4, &offset2), 0);
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(london.offsetAtZoneTime(Gmt2, &offset2), 0);
|
||||
QCOMPARE(offset2, 0);
|
||||
|
||||
KTimeZone johannesburg = KSystemTimeZones::zone("Africa/Johannesburg");
|
||||
QVERIFY(johannesburg.isValid());
|
||||
QDateTime recent(QDate(2013, 5, 10), QTime(13, 0, 0), Qt::LocalTime);
|
||||
QCOMPARE(johannesburg.offsetAtZoneTime(recent, &offset2), 7200);
|
||||
QCOMPARE(offset2, 7200);
|
||||
}
|
||||
|
||||
void KTimeZonesTest::abbreviation()
|
||||
{
|
||||
// Fetch time zone abbreviations
|
||||
KTimeZone losAngeles = KSystemTimeZones::zone("America/Los_Angeles");
|
||||
QVERIFY(losAngeles.isValid());
|
||||
KTimeZone london = KSystemTimeZones::zone("Europe/London");
|
||||
QVERIFY(london.isValid());
|
||||
QDateTime winter(QDate(2005, 1, 1), QTime(0, 0, 0), Qt::UTC);
|
||||
QDateTime summer(QDate(2005, 6, 1), QTime(0, 0, 0), Qt::UTC);
|
||||
QString sResult = london.abbreviation(winter);
|
||||
QCOMPARE(london.abbreviation(winter), QByteArray("GMT"));
|
||||
QCOMPARE(london.abbreviation(summer), QByteArray("BST"));
|
||||
QCOMPARE(losAngeles.abbreviation(winter), QByteArray("PST"));
|
||||
QCOMPARE(losAngeles.abbreviation(summer), QByteArray("PDT"));
|
||||
}
|
||||
|
||||
void KTimeZonesTest::timet()
|
||||
{
|
||||
QDateTime t1(QDate(1970, 1, 2), QTime(1, 30, 5), Qt::UTC);
|
||||
QDateTime t2(QDate(1969, 12, 30), QTime(22, 29, 55), Qt::UTC);
|
||||
time_t t1t = KTimeZone::toTime_t(t1);
|
||||
time_t t2t = KTimeZone::toTime_t(t2);
|
||||
QCOMPARE((int)t1t, 86400 + 3600 + 30 * 60 + 5);
|
||||
QCOMPARE((int)t2t, -(86400 + 3600 + 30 * 60 + 5));
|
||||
QCOMPARE(KTimeZone::fromTime_t(t1t), t1);
|
||||
QCOMPARE(KTimeZone::fromTime_t(t2t), t2);
|
||||
}
|
||||
|
||||
void KTimeZonesTest::toUtc()
|
||||
{
|
||||
// Convert to UTC.
|
||||
KTimeZone losAngeles = KSystemTimeZones::zone("America/Los_Angeles");
|
||||
QVERIFY(losAngeles.isValid());
|
||||
KTimeZone london = KSystemTimeZones::zone("Europe/London");
|
||||
QVERIFY(london.isValid());
|
||||
QDateTime winter(QDate(2005, 1, 1), QTime(0, 0, 0), Qt::UTC);
|
||||
QDateTime summer(QDate(2005, 6, 1), QTime(0, 0, 0), Qt::UTC);
|
||||
QDateTime winterLocal = winter;
|
||||
winterLocal.setTimeSpec(Qt::LocalTime);
|
||||
QDateTime summerLocal = summer;
|
||||
summerLocal.setTimeSpec(Qt::LocalTime);
|
||||
QCOMPARE(london.toUtc(winterLocal), winter);
|
||||
QCOMPARE(london.toUtc(summerLocal), summer.addSecs(-3600));;
|
||||
QCOMPARE(losAngeles.toUtc(winterLocal), winter.addSecs(8 * 3600));
|
||||
QCOMPARE(losAngeles.toUtc(summerLocal), summer.addSecs(7 * 3600));
|
||||
}
|
||||
|
||||
void KTimeZonesTest::toZoneTime()
|
||||
{
|
||||
// Convert from UTC.
|
||||
KTimeZone losAngeles = KSystemTimeZones::zone("America/Los_Angeles");
|
||||
QVERIFY(losAngeles.isValid());
|
||||
KTimeZone london = KSystemTimeZones::zone("Europe/London");
|
||||
QVERIFY(london.isValid());
|
||||
QDateTime winter(QDate(2005, 1, 1), QTime(0, 0, 0), Qt::UTC);
|
||||
QDateTime summer(QDate(2005, 6, 1), QTime(0, 0, 0), Qt::UTC);
|
||||
QDateTime winterLocal = winter;
|
||||
winterLocal.setTimeSpec(Qt::LocalTime);
|
||||
QDateTime summerLocal = summer;
|
||||
summerLocal.setTimeSpec(Qt::LocalTime);
|
||||
QCOMPARE(london.toZoneTime(winter), winterLocal);
|
||||
QCOMPARE(london.toZoneTime(summer), summerLocal.addSecs(3600));
|
||||
QCOMPARE(losAngeles.toZoneTime(winter), winterLocal.addSecs(-8 * 3600));
|
||||
QCOMPARE(losAngeles.toZoneTime(summer), summerLocal.addSecs(-7 * 3600));
|
||||
|
||||
QDateTime prepre(QDate(2005, 10, 29), QTime(23, 59, 59), Qt::UTC); // before time shift (local time not repeated)
|
||||
QDateTime pre(QDate(2005, 10, 30), QTime(0, 0, 0), Qt::UTC); // before time shift (local time repeated afterwards)
|
||||
QDateTime before(QDate(2005, 10, 30), QTime(0, 59, 59), Qt::UTC); // before time shift (local time repeated afterwards)
|
||||
QDateTime at(QDate(2005, 10, 30), QTime(1, 0, 0), Qt::UTC); // at time shift (second occurrence of local time)
|
||||
QDateTime last(QDate(2005, 10, 30), QTime(1, 59, 59), Qt::UTC); // after time shift (second occurrence of local time)
|
||||
QDateTime after(QDate(2005, 10, 30), QTime(2, 0, 0), Qt::UTC); // after time shift (local time not repeated)
|
||||
bool second;
|
||||
QCOMPARE(london.toZoneTime(prepre, &second), QDateTime(QDate(2005, 10, 30), QTime(0, 59, 59), Qt::LocalTime));
|
||||
QVERIFY(!second);
|
||||
QCOMPARE(london.toZoneTime(pre, &second), QDateTime(QDate(2005, 10, 30), QTime(1, 0, 0), Qt::LocalTime));
|
||||
QVERIFY(!second);
|
||||
QCOMPARE(london.toZoneTime(before, &second), QDateTime(QDate(2005, 10, 30), QTime(1, 59, 59), Qt::LocalTime));
|
||||
QVERIFY(!second);
|
||||
QCOMPARE(london.toZoneTime(at, &second), QDateTime(QDate(2005, 10, 30), QTime(1, 0, 0), Qt::LocalTime));
|
||||
QVERIFY(second);
|
||||
QCOMPARE(london.toZoneTime(last, &second), QDateTime(QDate(2005, 10, 30), QTime(1, 59, 59), Qt::LocalTime));
|
||||
QVERIFY(second);
|
||||
QCOMPARE(london.toZoneTime(after, &second), QDateTime(QDate(2005, 10, 30), QTime(2, 0, 0), Qt::LocalTime));
|
||||
QVERIFY(!second);
|
||||
}
|
||||
|
||||
void KTimeZonesTest::convert()
|
||||
{
|
||||
// Try time zone conversions.
|
||||
KTimeZone losAngeles = KSystemTimeZones::zone("America/Los_Angeles");
|
||||
QVERIFY(losAngeles.isValid());
|
||||
KTimeZone london = KSystemTimeZones::zone("Europe/London");
|
||||
QVERIFY(london.isValid());
|
||||
QDateTime bstBeforePdt(QDate(2005, 3, 28), QTime(0, 0, 0), Qt::LocalTime);
|
||||
QDateTime bstAfterPdt(QDate(2005, 5, 1), QTime(0, 0, 0), Qt::LocalTime);
|
||||
QDateTime gmtBeforePst(QDate(2005, 10, 30), QTime(4, 0, 0), Qt::LocalTime);
|
||||
QDateTime gmtAfterPst(QDate(2005, 12, 1), QTime(0, 0, 0), Qt::LocalTime);
|
||||
QDateTime bstBeforePdtResult(QDate(2005, 3, 27), QTime(15, 0, 0), Qt::LocalTime);
|
||||
QDateTime bstAfterPdtResult(QDate(2005, 4, 30), QTime(16, 0, 0), Qt::LocalTime);
|
||||
QDateTime gmtBeforePstResult(QDate(2005, 10, 29), QTime(21, 0, 0), Qt::LocalTime);
|
||||
QDateTime gmtAfterPstResult(QDate(2005, 11, 30), QTime(16, 0, 0), Qt::LocalTime);
|
||||
|
||||
QCOMPARE(london.convert(losAngeles, bstBeforePdt), bstBeforePdtResult);
|
||||
QCOMPARE(london.convert(losAngeles, bstAfterPdt), bstAfterPdtResult);
|
||||
QCOMPARE(london.convert(losAngeles, gmtBeforePst), gmtBeforePstResult);
|
||||
QCOMPARE(london.convert(losAngeles, gmtAfterPst), gmtAfterPstResult);
|
||||
QCOMPARE(losAngeles.convert(losAngeles, bstBeforePdtResult), bstBeforePdtResult);
|
||||
}
|
||||
|
||||
////////////////////////
|
||||
// KTzfileTimeZone tests
|
||||
// Plus KSystemTimeZones::readZone() tests
|
||||
////////////////////////
|
||||
|
||||
void KTimeZonesTest::tzfile()
|
||||
{
|
||||
QDateTime winter(QDate(2005, 1, 1), QTime(0, 0, 0), Qt::UTC);
|
||||
QString zoneinfo = KSystemTimeZones::zoneinfoDir();
|
||||
QVERIFY(!zoneinfo.isEmpty());
|
||||
KTzfileTimeZoneSource tzsource(zoneinfo);
|
||||
KTimeZone *tzcairo = new KTzfileTimeZone(&tzsource, "Africa/Cairo");
|
||||
delete tzcairo;
|
||||
tzcairo = new KTzfileTimeZone(&tzsource, "Africa/Cairo");
|
||||
QCOMPARE(tzcairo->offsetAtUtc(winter), 7200);
|
||||
delete tzcairo;
|
||||
KTimeZone *johannesburg = new KTzfileTimeZone(&tzsource, "Africa/Johannesburg");
|
||||
delete johannesburg;
|
||||
johannesburg = new KTzfileTimeZone(&tzsource, "Africa/Johannesburg");
|
||||
QCOMPARE(johannesburg->offsetAtUtc(winter), 7200);
|
||||
delete johannesburg;
|
||||
}
|
||||
|
||||
void KTimeZonesTest::tzfileDstShifts()
|
||||
{
|
||||
// Check time zone conversions against zdump output for zone
|
||||
KTzfileTimeZoneSource tzsource(KSystemTimeZones::zoneinfoDir());
|
||||
KTimeZone berlin = KTzfileTimeZone(&tzsource, "Europe/Berlin");
|
||||
KTimeZone losAngeles = KTzfileTimeZone(&tzsource, "America/Los_Angeles");
|
||||
KTimeZone tz = berlin;
|
||||
for (int n = 0; n < 2; ++n, tz = losAngeles) {
|
||||
qDebug() << tz.name();
|
||||
QVERIFY(tz.isValid());
|
||||
QCOMPARE(tz.type(), QByteArray("KTzfileTimeZone"));
|
||||
QFile file(QFINDTESTDATA(tz.name().remove(QRegExp("^.+/")) + QLatin1String(".zdump")));
|
||||
QVERIFY(file.open(QIODevice::ReadOnly));
|
||||
QTextStream in(&file);
|
||||
QString line;
|
||||
while (!(line = in.readLine()).isNull()) {
|
||||
QStringList parts = line.split(" ", QString::SkipEmptyParts);
|
||||
QCOMPARE(parts[6], QString::fromLatin1("UTC"));
|
||||
QCOMPARE(parts[7], QString::fromLatin1("="));
|
||||
QCOMPARE(parts[14].left(6), QString::fromLatin1("isdst="));
|
||||
QCOMPARE(parts[15].left(7), QString::fromLatin1("gmtoff="));
|
||||
QDateTime utc = QDateTime::fromString(static_cast<QStringList>(parts.mid(1, 5)).join(" "));
|
||||
utc.setTimeSpec(Qt::UTC);
|
||||
QDateTime local = QDateTime::fromString(static_cast<QStringList>(parts.mid(8, 5)).join(" "));
|
||||
local.setTimeSpec(Qt::LocalTime);
|
||||
QCOMPARE(tz.toZoneTime(utc), local);
|
||||
QCOMPARE(parts[13], QString::fromLatin1(tz.abbreviation(utc)));
|
||||
bool dst = (parts[14].right(1) != "0");
|
||||
QCOMPARE(tz.isDstAtUtc(utc), dst);
|
||||
QCOMPARE(parts[15].mid(7).toInt(), tz.offsetAtUtc(utc));
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
|
||||
void KTimeZonesTest::tzfileToZoneTime()
|
||||
{
|
||||
// Convert from UTC.
|
||||
KTzfileTimeZoneSource tzsource(KSystemTimeZones::zoneinfoDir());
|
||||
KTimeZone london = KTzfileTimeZone(&tzsource, "Europe/London");
|
||||
QVERIFY(london.isValid());
|
||||
QCOMPARE(london.type(), QByteArray("KTzfileTimeZone"));
|
||||
QDateTime prepre(QDate(2005, 10, 29), QTime(23, 59, 59), Qt::UTC); // before time shift (local time not repeated)
|
||||
QDateTime pre(QDate(2005, 10, 30), QTime(0, 0, 0), Qt::UTC); // before time shift (local time repeated afterwards)
|
||||
QDateTime before(QDate(2005, 10, 30), QTime(0, 59, 59), Qt::UTC); // before time shift (local time repeated afterwards)
|
||||
QDateTime at(QDate(2005, 10, 30), QTime(1, 0, 0), Qt::UTC); // at time shift (second occurrence of local time)
|
||||
QDateTime last(QDate(2005, 10, 30), QTime(1, 59, 59), Qt::UTC); // after time shift (second occurrence of local time)
|
||||
QDateTime after(QDate(2005, 10, 30), QTime(2, 0, 0), Qt::UTC); // after time shift (local time not repeated)
|
||||
bool second;
|
||||
QCOMPARE(london.toZoneTime(prepre, &second), QDateTime(QDate(2005, 10, 30), QTime(0, 59, 59), Qt::LocalTime));
|
||||
QVERIFY(!second);
|
||||
QCOMPARE(london.toZoneTime(pre, &second), QDateTime(QDate(2005, 10, 30), QTime(1, 0, 0), Qt::LocalTime));
|
||||
QVERIFY(!second);
|
||||
QCOMPARE(london.toZoneTime(before, &second), QDateTime(QDate(2005, 10, 30), QTime(1, 59, 59), Qt::LocalTime));
|
||||
QVERIFY(!second);
|
||||
QCOMPARE(london.toZoneTime(at, &second), QDateTime(QDate(2005, 10, 30), QTime(1, 0, 0), Qt::LocalTime));
|
||||
QVERIFY(second);
|
||||
QCOMPARE(london.toZoneTime(last, &second), QDateTime(QDate(2005, 10, 30), QTime(1, 59, 59), Qt::LocalTime));
|
||||
QVERIFY(second);
|
||||
QCOMPARE(london.toZoneTime(after, &second), QDateTime(QDate(2005, 10, 30), QTime(2, 0, 0), Qt::LocalTime));
|
||||
QVERIFY(!second);
|
||||
|
||||
KTimeZone sysLondon = KSystemTimeZones::readZone("Europe/London");
|
||||
QVERIFY(sysLondon.isValid());
|
||||
QCOMPARE(sysLondon.toZoneTime(prepre, &second), QDateTime(QDate(2005, 10, 30), QTime(0, 59, 59), Qt::LocalTime));
|
||||
QVERIFY(!second);
|
||||
QCOMPARE(sysLondon.toZoneTime(pre, &second), QDateTime(QDate(2005, 10, 30), QTime(1, 0, 0), Qt::LocalTime));
|
||||
QVERIFY(!second);
|
||||
QCOMPARE(sysLondon.toZoneTime(before, &second), QDateTime(QDate(2005, 10, 30), QTime(1, 59, 59), Qt::LocalTime));
|
||||
QVERIFY(!second);
|
||||
QCOMPARE(sysLondon.toZoneTime(at, &second), QDateTime(QDate(2005, 10, 30), QTime(1, 0, 0), Qt::LocalTime));
|
||||
QVERIFY(second);
|
||||
QCOMPARE(sysLondon.toZoneTime(last, &second), QDateTime(QDate(2005, 10, 30), QTime(1, 59, 59), Qt::LocalTime));
|
||||
QVERIFY(second);
|
||||
QCOMPARE(sysLondon.toZoneTime(after, &second), QDateTime(QDate(2005, 10, 30), QTime(2, 0, 0), Qt::LocalTime));
|
||||
QVERIFY(!second);
|
||||
}
|
||||
|
||||
void KTimeZonesTest::tzfileOffsetAtUtc()
|
||||
{
|
||||
QDateTime a3Gmt(QDate(2004, 12, 27), QTime(0, 30, 0), Qt::UTC);
|
||||
QDateTime a2Gmt(QDate(2005, 2, 27), QTime(0, 30, 0), Qt::UTC);
|
||||
QDateTime aGmt(QDate(2005, 3, 27), QTime(0, 30, 0), Qt::UTC);
|
||||
QDateTime aBst(QDate(2005, 3, 27), QTime(1, 30, 0), Qt::UTC);
|
||||
QDateTime a2Bst(QDate(2005, 7, 27), QTime(2, 30, 0), Qt::UTC);
|
||||
QDateTime bBst(QDate(2005, 10, 29), QTime(23, 30, 0), Qt::UTC);
|
||||
QDateTime bBstBeforeGmt(QDate(2005, 10, 30), QTime(0, 30, 0), Qt::UTC);
|
||||
QDateTime bGmt(QDate(2005, 10, 30), QTime(2, 30, 0), Qt::UTC);
|
||||
KTzfileTimeZoneSource tzsource(KSystemTimeZones::zoneinfoDir());
|
||||
KTimeZone london = KTzfileTimeZone(&tzsource, "Europe/London");
|
||||
QVERIFY(london.isValid());
|
||||
QCOMPARE(london.type(), QByteArray("KTzfileTimeZone"));
|
||||
QCOMPARE(london.offsetAtUtc(a3Gmt), 0);
|
||||
QCOMPARE(london.offsetAtUtc(a2Gmt), 0); // uses cache
|
||||
QCOMPARE(london.offsetAtUtc(aGmt), 0); // uses cache
|
||||
QCOMPARE(london.offsetAtUtc(aBst), 3600);
|
||||
QCOMPARE(london.offsetAtUtc(a2Bst), 3600); // uses cache
|
||||
QCOMPARE(london.offsetAtUtc(bBst), 3600); // uses cache
|
||||
QCOMPARE(london.offsetAtUtc(bBstBeforeGmt), 3600); // uses cache
|
||||
QCOMPARE(london.offsetAtUtc(bGmt), 0);
|
||||
|
||||
QDateTime recent(QDate(2013, 5, 10), QTime(13, 0, 0), Qt::UTC);
|
||||
KTimeZone johannesburg = KTzfileTimeZone(&tzsource, "Africa/Johannesburg");
|
||||
QVERIFY(johannesburg.isValid());
|
||||
QCOMPARE(johannesburg.type(), QByteArray("KTzfileTimeZone"));
|
||||
QCOMPARE(johannesburg.offsetAtUtc(recent), 7200);
|
||||
}
|
||||
|
||||
void KTimeZonesTest::tzfileOffsetAtZoneTime()
|
||||
{
|
||||
QDateTime Gmt0(QDate(2005, 2, 27), QTime(0, 30, 0), Qt::LocalTime);
|
||||
QDateTime Gmt1(QDate(2005, 3, 27), QTime(0, 30, 0), Qt::LocalTime);
|
||||
QDateTime GmtToBst1(QDate(2005, 3, 27), QTime(0, 59, 59), Qt::LocalTime);
|
||||
QDateTime GmtToBst2(QDate(2005, 3, 27), QTime(1, 0, 0), Qt::LocalTime);
|
||||
QDateTime GmtToBst3(QDate(2005, 3, 27), QTime(1, 59, 59), Qt::LocalTime);
|
||||
QDateTime GmtToBst4(QDate(2005, 3, 27), QTime(2, 0, 0), Qt::LocalTime);
|
||||
QDateTime Bst1(QDate(2005, 4, 27), QTime(2, 30, 0), Qt::LocalTime);
|
||||
QDateTime Bst2(QDate(2005, 10, 30), QTime(0, 30, 0), Qt::LocalTime);
|
||||
QDateTime BstToGmt1(QDate(2005, 10, 30), QTime(0, 59, 59), Qt::LocalTime);
|
||||
QDateTime BstToGmt2(QDate(2005, 10, 30), QTime(1, 0, 0), Qt::LocalTime);
|
||||
QDateTime BstToGmt3(QDate(2005, 10, 30), QTime(1, 59, 59), Qt::LocalTime);
|
||||
QDateTime BstToGmt4(QDate(2005, 10, 30), QTime(2, 0, 0), Qt::LocalTime);
|
||||
QDateTime Gmt2(QDate(2005, 10, 30), QTime(2, 30, 0), Qt::LocalTime);
|
||||
KTzfileTimeZoneSource tzsource(KSystemTimeZones::zoneinfoDir());
|
||||
KTimeZone london = KTzfileTimeZone(&tzsource, "Europe/London");
|
||||
QVERIFY(london.isValid());
|
||||
int offset2;
|
||||
QCOMPARE(london.offsetAtZoneTime(Gmt0, &offset2), 0);
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(london.offsetAtZoneTime(Gmt1, &offset2), 0); // uses cache
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(london.offsetAtZoneTime(GmtToBst1, &offset2), 0); // uses cache
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(london.offsetAtZoneTime(GmtToBst2, &offset2), KTimeZone::InvalidOffset);
|
||||
QCOMPARE(offset2, KTimeZone::InvalidOffset);
|
||||
QCOMPARE(london.offsetAtZoneTime(GmtToBst3, &offset2), KTimeZone::InvalidOffset);
|
||||
QCOMPARE(offset2, KTimeZone::InvalidOffset);
|
||||
QCOMPARE(london.offsetAtZoneTime(GmtToBst4, &offset2), 3600);
|
||||
QCOMPARE(offset2, 3600);
|
||||
QCOMPARE(london.offsetAtZoneTime(Bst1, &offset2), 3600);
|
||||
QCOMPARE(offset2, 3600);
|
||||
QCOMPARE(london.offsetAtZoneTime(Bst2, &offset2), 3600); // uses cache
|
||||
QCOMPARE(offset2, 3600);
|
||||
QCOMPARE(london.offsetAtZoneTime(BstToGmt1, &offset2), 3600); // uses cache
|
||||
QCOMPARE(offset2, 3600);
|
||||
QCOMPARE(london.offsetAtZoneTime(BstToGmt2, &offset2), 3600);
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(london.offsetAtZoneTime(BstToGmt3, &offset2), 3600);
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(london.offsetAtZoneTime(BstToGmt4, &offset2), 0);
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(london.offsetAtZoneTime(Gmt2, &offset2), 0); // uses cache
|
||||
QCOMPARE(offset2, 0);
|
||||
|
||||
KTimeZone sysLondon = KSystemTimeZones::readZone("Europe/London");
|
||||
QVERIFY(sysLondon.isValid());
|
||||
QCOMPARE(sysLondon.offsetAtZoneTime(Gmt0, &offset2), 0);
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(sysLondon.offsetAtZoneTime(Gmt1, &offset2), 0); // uses cache
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(sysLondon.offsetAtZoneTime(GmtToBst1, &offset2), 0); // uses cache
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(sysLondon.offsetAtZoneTime(GmtToBst2, &offset2), KTimeZone::InvalidOffset);
|
||||
QCOMPARE(offset2, KTimeZone::InvalidOffset);
|
||||
QCOMPARE(sysLondon.offsetAtZoneTime(GmtToBst3, &offset2), KTimeZone::InvalidOffset);
|
||||
QCOMPARE(offset2, KTimeZone::InvalidOffset);
|
||||
QCOMPARE(sysLondon.offsetAtZoneTime(GmtToBst4, &offset2), 3600);
|
||||
QCOMPARE(offset2, 3600);
|
||||
QCOMPARE(sysLondon.offsetAtZoneTime(Bst1, &offset2), 3600);
|
||||
QCOMPARE(offset2, 3600);
|
||||
QCOMPARE(sysLondon.offsetAtZoneTime(Bst2, &offset2), 3600); // uses cache
|
||||
QCOMPARE(offset2, 3600);
|
||||
QCOMPARE(sysLondon.offsetAtZoneTime(BstToGmt1, &offset2), 3600); // uses cache
|
||||
QCOMPARE(offset2, 3600);
|
||||
QCOMPARE(sysLondon.offsetAtZoneTime(BstToGmt2, &offset2), 3600);
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(sysLondon.offsetAtZoneTime(BstToGmt3, &offset2), 3600);
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(sysLondon.offsetAtZoneTime(BstToGmt4, &offset2), 0);
|
||||
QCOMPARE(offset2, 0);
|
||||
QCOMPARE(sysLondon.offsetAtZoneTime(Gmt2, &offset2), 0); // uses cache
|
||||
QCOMPARE(offset2, 0);
|
||||
|
||||
KTimeZone johannesburg = KTzfileTimeZone(&tzsource, "Africa/Johannesburg");
|
||||
QVERIFY(johannesburg.isValid());
|
||||
QCOMPARE(johannesburg.type(), QByteArray("KTzfileTimeZone"));
|
||||
QDateTime recent(QDate(2013,5,10), QTime(13,0,0), Qt::LocalTime);
|
||||
QCOMPARE(johannesburg.offsetAtZoneTime(recent, &offset2), 7200);
|
||||
QCOMPARE(offset2, 7200);
|
||||
}
|
||||
|
||||
void KTimeZonesTest::tzfileUtcOffsets()
|
||||
{
|
||||
KTzfileTimeZoneSource tzsource(KSystemTimeZones::zoneinfoDir());
|
||||
KTimeZone london = KTzfileTimeZone(&tzsource, "Europe/London");
|
||||
QVERIFY(london.isValid());
|
||||
QList<int> offsets = london.utcOffsets();
|
||||
QCOMPARE(offsets.count(), 3);
|
||||
QCOMPARE(offsets[0], 0); // GMT
|
||||
QCOMPARE(offsets[1], 3600); // BST
|
||||
QCOMPARE(offsets[2], 7200); // DST
|
||||
|
||||
KTimeZone sysLondon = KSystemTimeZones::readZone("Europe/London");
|
||||
QVERIFY(sysLondon.isValid());
|
||||
offsets = sysLondon.utcOffsets();
|
||||
QCOMPARE(offsets.count(), 3);
|
||||
QCOMPARE(offsets[0], 0); // GMT
|
||||
QCOMPARE(offsets[1], 3600); // BST
|
||||
QCOMPARE(offsets[2], 7200); // DST
|
||||
}
|
||||
|
||||
void KTimeZonesTest::tzfileAbbreviation()
|
||||
{
|
||||
KTzfileTimeZoneSource tzsource(KSystemTimeZones::zoneinfoDir());
|
||||
KTimeZone london = KTzfileTimeZone(&tzsource, "Europe/London");
|
||||
QVERIFY(london.isValid());
|
||||
QDateTime winter(QDate(2005, 1, 1), QTime(0, 0, 0), Qt::UTC);
|
||||
QDateTime summer(QDate(2005, 6, 1), QTime(0, 0, 0), Qt::UTC);
|
||||
QDateTime standard(QDate(1970, 4, 30), QTime(12, 45, 16, 25), Qt::UTC);
|
||||
QString sResult = london.abbreviation(winter);
|
||||
QCOMPARE(london.abbreviation(winter), QByteArray("GMT"));
|
||||
QCOMPARE(london.abbreviation(summer), QByteArray("BST"));
|
||||
QCOMPARE(london.abbreviation(standard), QByteArray("BST"));
|
||||
|
||||
KTimeZone sysLondon = KSystemTimeZones::readZone("Europe/London");
|
||||
QVERIFY(sysLondon.isValid());
|
||||
sResult = sysLondon.abbreviation(winter);
|
||||
QCOMPARE(sysLondon.abbreviation(winter), QByteArray("GMT"));
|
||||
QCOMPARE(sysLondon.abbreviation(summer), QByteArray("BST"));
|
||||
QCOMPARE(sysLondon.abbreviation(standard), QByteArray("BST"));
|
||||
}
|
||||
|
||||
void KTimeZonesTest::tzfileTransitions()
|
||||
{
|
||||
KTzfileTimeZoneSource tzsource(KSystemTimeZones::zoneinfoDir());
|
||||
KTimeZone london = KTzfileTimeZone(&tzsource, "Europe/London");
|
||||
QVERIFY(london.isValid());
|
||||
QList<KTimeZone::Transition> all = london.transitions();
|
||||
QVERIFY(!all.isEmpty());
|
||||
QDateTime jan2003(QDate(2003, 1, 1), QTime(0, 0, 0), Qt::UTC);
|
||||
QDateTime jan2006(QDate(2006, 1, 1), QTime(0, 0, 0), Qt::UTC);
|
||||
int index2006 = london.transitionIndex(jan2006);
|
||||
if (index2006 >= 0) {
|
||||
QVERIFY(all[index2006].time() <= jan2006);
|
||||
QList<KTimeZone::Transition> some = london.transitions(QDateTime(), jan2006);
|
||||
QList<KTimeZone::Transition> check = all.mid(0, index2006 + 1);
|
||||
QCOMPARE(some.count(), check.count());
|
||||
for (int i = 0; i < some.count(); ++i) {
|
||||
QCOMPARE(some[i].time(), check[i].time());
|
||||
QCOMPARE(some[i].phase(), check[i].phase());
|
||||
}
|
||||
if (all[index2006].time() < jan2006 && ++index2006 < all.count()) {
|
||||
QVERIFY(all[index2006].time() > jan2006);
|
||||
}
|
||||
some = london.transitions(jan2006);
|
||||
check = all.mid(index2006);
|
||||
for (int i = 0; i < some.count(); ++i) {
|
||||
QCOMPARE(some[i].time(), check[i].time());
|
||||
QCOMPARE(some[i].phase(), check[i].phase());
|
||||
}
|
||||
}
|
||||
index2006 = london.transitionIndex(jan2006);
|
||||
int index2003 = london.transitionIndex(jan2003);
|
||||
if (index2003 >= 0) {
|
||||
QVERIFY(all[index2003].time() <= jan2003);
|
||||
if (all[index2003].time() < jan2003 && ++index2003 < all.count()) {
|
||||
QVERIFY(all[index2003].time() > jan2003);
|
||||
}
|
||||
QList<KTimeZone::Transition> some = london.transitions(jan2003, jan2006);
|
||||
QList<KTimeZone::Transition> check = all.mid(index2003, index2006 - index2003 + 1);
|
||||
QCOMPARE(some.count(), check.count());
|
||||
for (int i = 0; i < some.count(); ++i) {
|
||||
|
||||
QCOMPARE(some[i].time(), check[i].time());
|
||||
QCOMPARE(some[i].phase(), check[i].phase());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005-2007,2011 David Jarvie <djarvie@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KTIMEZONESTEST_H
|
||||
#define KTIMEZONESTEST_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class KTimeZonesTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
void ktimezones();
|
||||
void refcount();
|
||||
void utc();
|
||||
void invalidLocal();
|
||||
void local();
|
||||
void zone();
|
||||
void zoneinfoDir();
|
||||
void zonetabChange();
|
||||
void currentOffset();
|
||||
void offsetAtUtc();
|
||||
void offsetAtZoneTime();
|
||||
void abbreviation();
|
||||
void timet();
|
||||
void toUtc();
|
||||
void toZoneTime();
|
||||
void convert();
|
||||
void tzfile();
|
||||
void tzfileDstShifts();
|
||||
void tzfileToZoneTime();
|
||||
void tzfileOffsetAtUtc();
|
||||
void tzfileOffsetAtZoneTime();
|
||||
void tzfileUtcOffsets();
|
||||
void tzfileAbbreviation();
|
||||
void tzfileTransitions();
|
||||
private:
|
||||
void removeDir(const QString &subdir);
|
||||
void writeZoneTab(bool testcase);
|
||||
QString mDataDir;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,118 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005-2007 David Jarvie <djarvie@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KTIMEZONESTEST_P_H
|
||||
#define KTIMEZONESTEST_P_H
|
||||
|
||||
#include <kconfig.h>
|
||||
#include <kconfiggroup.h>
|
||||
#include <qstandardpaths.h>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <qtest.h>
|
||||
|
||||
class TimeZoneTestData
|
||||
{
|
||||
public:
|
||||
QString dataDir() const
|
||||
{
|
||||
return mDataDir;
|
||||
}
|
||||
|
||||
void cleanupTimeZoneTest()
|
||||
{
|
||||
removeDir(QLatin1String("ktimezonestest/Africa"));
|
||||
removeDir(QLatin1String("ktimezonestest/America"));
|
||||
removeDir(QLatin1String("ktimezonestest/Asia"));
|
||||
removeDir(QLatin1String("ktimezonestest/Europe"));
|
||||
removeDir(QLatin1String("ktimezonestest"));
|
||||
QFile::remove(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + "ktimezonedrc");
|
||||
}
|
||||
|
||||
void setupTimeZoneTest()
|
||||
{
|
||||
cleanupTimeZoneTest();
|
||||
|
||||
mDataDir = QDir::homePath() + "/.kde-unit-test/ktimezonestest";
|
||||
QVERIFY(QDir().mkpath(mDataDir));
|
||||
writeZoneTab(false);
|
||||
QDir dir(mDataDir);
|
||||
QVERIFY(dir.mkdir("Africa"));
|
||||
QVERIFY(QFile::copy(QFINDTESTDATA("Cairo"), mDataDir + QLatin1String("/Africa/Cairo")));
|
||||
QVERIFY(QFile::copy(QFINDTESTDATA("Johannesburg"), mDataDir + QLatin1String("/Africa/Johannesburg")));
|
||||
QVERIFY(dir.mkdir("America"));
|
||||
QFile::copy(QFINDTESTDATA("Los_Angeles"), mDataDir + QLatin1String("/America/Los_Angeles"));
|
||||
QVERIFY(dir.mkdir("Asia"));
|
||||
QFile::copy(QFINDTESTDATA("Dili"), mDataDir + QLatin1String("/Asia/Dili"));
|
||||
QVERIFY(dir.mkdir("Europe"));
|
||||
QFile::copy(QFINDTESTDATA("Berlin"), mDataDir + QLatin1String("/Europe/Berlin"));
|
||||
QFile::copy(QFINDTESTDATA("London"), mDataDir + QLatin1String("/Europe/London"));
|
||||
QFile::copy(QFINDTESTDATA("Paris"), mDataDir + QLatin1String("/Europe/Paris"));
|
||||
|
||||
KConfig config("ktimezonedrc");
|
||||
KConfigGroup group(&config, "TimeZones");
|
||||
group.writeEntry("ZoneinfoDir", mDataDir);
|
||||
group.writeEntry("Zonetab", QString(mDataDir + QString::fromLatin1("/zone.tab")));
|
||||
group.writeEntry("LocalZone", QString::fromLatin1("Europe/Paris"));
|
||||
config.sync();
|
||||
}
|
||||
|
||||
private:
|
||||
void removeDir(const QString &subdir)
|
||||
{
|
||||
QDir local(QDir::homePath() + QLatin1String("/.kde-unit-test/") + subdir);
|
||||
foreach (const QString &file, local.entryList(QDir::Files))
|
||||
if (!local.remove(file)) {
|
||||
qWarning("%s: removing failed", qPrintable(file));
|
||||
}
|
||||
QCOMPARE((int)local.entryList(QDir::Files).count(), 0);
|
||||
local.cdUp();
|
||||
QString subd = subdir;
|
||||
subd.remove(QRegExp("^.*/"));
|
||||
local.rmpath(subd);
|
||||
}
|
||||
|
||||
public:
|
||||
void writeZoneTab(bool testcase)
|
||||
{
|
||||
QFile f(mDataDir + QLatin1String("/zone.tab"));
|
||||
qDebug() << "Writing" << f.fileName();
|
||||
QVERIFY(f.open(QIODevice::WriteOnly));
|
||||
QTextStream fStream(&f);
|
||||
if (testcase)
|
||||
fStream << "DE +5230+01322 Europe/Berlin\n"
|
||||
"EG +3003+03115 Africa/Cairo\n"
|
||||
"FR +4852+00220 Europe/Paris\n"
|
||||
"XX -512830+0001845 Europe/London Greater Britain\n"
|
||||
"TL -0833+12535 Asia/Dili\n"
|
||||
"US +340308-1181434 America/Los_Angeles Pacific Time\n"
|
||||
"ZA -2615+02800 Africa/Johannesburg\n";
|
||||
else
|
||||
fStream << "EG +3003+03115 Africa/Cairo\n"
|
||||
"FR +4852+00220 Europe/Paris\n"
|
||||
"GB +512830-0001845 Europe/London Great Britain\n"
|
||||
"US +340308-1181434 America/Los_Angeles Pacific Time\n"
|
||||
"ZA -2615+02800 Africa/Johannesburg\n";
|
||||
f.close();
|
||||
}
|
||||
|
||||
QString mDataDir;
|
||||
};
|
||||
|
||||
#endif //KTIMEZONESTEST_P_H
|
|
@ -0,0 +1,113 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 1999 Waldo Bastian <bastian@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include "kuniqueapplication.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <kcmdlineargs.h>
|
||||
#include <k4aboutdata.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
#include <QTimer>
|
||||
#include <QFile>
|
||||
#include <QProcess>
|
||||
|
||||
class TestApp : public KUniqueApplication
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TestApp() : KUniqueApplication("TestApp"), m_callCount(0) { }
|
||||
int newInstance() override;
|
||||
int callCount() const
|
||||
{
|
||||
return m_callCount;
|
||||
}
|
||||
|
||||
private Q_SLOTS:
|
||||
void executeNewChild()
|
||||
{
|
||||
// Duplicated from kglobalsettingstest.cpp - make a shared helper method?
|
||||
QProcess *proc = new QProcess(this);
|
||||
QString appName = "kuniqueapptest";
|
||||
#ifdef Q_OS_WIN
|
||||
appName = appName + ".exe";
|
||||
#else
|
||||
if (QFile::exists(appName + ".shell")) {
|
||||
appName = "./" + appName + ".shell";
|
||||
} else {
|
||||
Q_ASSERT(QFile::exists(appName));
|
||||
appName = "./" + appName;
|
||||
}
|
||||
#endif
|
||||
proc->start(appName);
|
||||
}
|
||||
private:
|
||||
int m_callCount;
|
||||
};
|
||||
|
||||
int TestApp::newInstance()
|
||||
{
|
||||
++m_callCount;
|
||||
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
|
||||
kDebug() << "NewInstance";
|
||||
for (int i = 0; i < args->count(); i++) {
|
||||
kDebug() << "argument " << i << " : " << args->arg(i);
|
||||
}
|
||||
|
||||
if (m_callCount == 2) { // OK, all done, quit
|
||||
quit();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
KCmdLineOptions options;
|
||||
options.add("!+[argument]", ki18n("arguments passed to new instance"));
|
||||
|
||||
K4AboutData about("kuniqueapptest", nullptr, ki18n("kuniqueapptest"), "version");
|
||||
KCmdLineArgs::init(argc, argv, &about);
|
||||
KCmdLineArgs::addCmdLineOptions(options);
|
||||
KUniqueApplication::addCmdLineOptions();
|
||||
|
||||
if (!TestApp::start()) {
|
||||
return 1;
|
||||
}
|
||||
TestApp a;
|
||||
|
||||
// Testcase for the problem coming from the old fork-on-startup solution:
|
||||
// the "newInstance" D-Bus call would time out if the app took too much time
|
||||
// to be ready.
|
||||
//printf("Sleeping.\n");
|
||||
//sleep(200);
|
||||
|
||||
QTimer::singleShot(400, &a, SLOT(executeNewChild()));
|
||||
|
||||
printf("Running.\n");
|
||||
kapp->exec();
|
||||
printf("Terminating.\n");
|
||||
|
||||
Q_ASSERT(a.callCount() == 2);
|
||||
const bool ok = a.callCount() == 2;
|
||||
|
||||
return ok ? 0 : 1;
|
||||
}
|
||||
|
||||
#include "kuniqueapptest.moc"
|
|
@ -0,0 +1,139 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "kurlmimetest.h"
|
||||
#include <QTest>
|
||||
#include <QMimeData>
|
||||
#include <kurl.h>
|
||||
|
||||
QTEST_MAIN(KUrlMimeTest)
|
||||
|
||||
void KUrlMimeTest::testURLList()
|
||||
{
|
||||
QMimeData *mimeData = new QMimeData;
|
||||
QVERIFY(!KUrl::List::canDecode(mimeData));
|
||||
QVERIFY(!mimeData->hasUrls());
|
||||
|
||||
KUrl::List urls;
|
||||
urls.append(KUrl("http://www.kde.org"));
|
||||
urls.append(KUrl("http://wstephenson:secret@example.com/path"));
|
||||
urls.append(KUrl("file:///home/dfaure/konqtests/Mat%C3%A9riel"));
|
||||
QMap<QString, QString> metaData;
|
||||
metaData[QLatin1String("key")] = QLatin1String("value");
|
||||
metaData[QLatin1String("key2")] = QLatin1String("value2");
|
||||
|
||||
urls.populateMimeData(mimeData, metaData);
|
||||
|
||||
QVERIFY(KUrl::List::canDecode(mimeData));
|
||||
QVERIFY(mimeData->hasUrls());
|
||||
QVERIFY(mimeData->hasText());
|
||||
|
||||
QMap<QString, QString> decodedMetaData;
|
||||
KUrl::List decodedURLs = KUrl::List::fromMimeData(mimeData, KUrl::List::PreferKdeUrls, &decodedMetaData);
|
||||
QVERIFY(!decodedURLs.isEmpty());
|
||||
KUrl::List expectedUrls = urls;
|
||||
expectedUrls[1] = KUrl("http://wstephenson:secret@example.com/path"); // password kept, unlike in KDE4, but that's okay, it's not displayed
|
||||
const QString space(QLatin1Char(' '));
|
||||
QCOMPARE(expectedUrls.toStringList().join(space), decodedURLs.toStringList().join(space));
|
||||
|
||||
const QList<QUrl> qurls = mimeData->urls();
|
||||
QCOMPARE(qurls.count(), urls.count());
|
||||
for (int i = 0; i < qurls.count(); ++i) {
|
||||
QCOMPARE(qurls[i], static_cast<QUrl>(decodedURLs[i]));
|
||||
}
|
||||
|
||||
QVERIFY(!decodedMetaData.isEmpty());
|
||||
QCOMPARE(decodedMetaData[QLatin1String("key")], QString::fromLatin1("value"));
|
||||
QCOMPARE(decodedMetaData[QLatin1String("key2")], QString::fromLatin1("value2"));
|
||||
|
||||
delete mimeData;
|
||||
}
|
||||
|
||||
void KUrlMimeTest::testOneURL()
|
||||
{
|
||||
KUrl oneURL("file:///tmp");
|
||||
QMimeData *mimeData = new QMimeData;
|
||||
|
||||
oneURL.populateMimeData(mimeData);
|
||||
|
||||
QVERIFY(KUrl::List::canDecode(mimeData));
|
||||
QMap<QString, QString> decodedMetaData;
|
||||
KUrl::List decodedURLs = KUrl::List::fromMimeData(mimeData, KUrl::List::PreferKdeUrls, &decodedMetaData);
|
||||
QVERIFY(!decodedURLs.isEmpty());
|
||||
QCOMPARE(decodedURLs.count(), 1);
|
||||
QCOMPARE(decodedURLs[0].url(), oneURL.url());
|
||||
QVERIFY(decodedMetaData.isEmpty());
|
||||
delete mimeData;
|
||||
}
|
||||
|
||||
void KUrlMimeTest::testFromQUrl()
|
||||
{
|
||||
QList<QUrl> qurls;
|
||||
qurls.append(QUrl(QLatin1String("http://www.kde.org")));
|
||||
qurls.append(QUrl(QLatin1String("file:///home/dfaure/konqtests/Mat%C3%A9riel")));
|
||||
QMimeData *mimeData = new QMimeData;
|
||||
mimeData->setUrls(qurls);
|
||||
|
||||
QVERIFY(KUrl::List::canDecode(mimeData));
|
||||
QMap<QString, QString> decodedMetaData;
|
||||
KUrl::List decodedURLs = KUrl::List::fromMimeData(mimeData, KUrl::List::PreferKdeUrls, &decodedMetaData);
|
||||
QVERIFY(!decodedURLs.isEmpty());
|
||||
QCOMPARE(decodedURLs.count(), 2);
|
||||
QCOMPARE(static_cast<QUrl>(decodedURLs[0]), qurls[0]);
|
||||
QCOMPARE(static_cast<QUrl>(decodedURLs[1]), qurls[1]);
|
||||
QVERIFY(decodedMetaData.isEmpty());
|
||||
delete mimeData;
|
||||
}
|
||||
|
||||
void KUrlMimeTest::testMostLocalUrlList()
|
||||
{
|
||||
QMimeData *mimeData = new QMimeData;
|
||||
KUrl::List urls;
|
||||
urls.append(KUrl("desktop:/foo"));
|
||||
urls.append(KUrl("desktop:/bar"));
|
||||
KUrl::List localUrls;
|
||||
localUrls.append(KUrl("file:/home/dfaure/Desktop/foo"));
|
||||
localUrls.append(KUrl("file:/home/dfaure/Desktop/bar"));
|
||||
|
||||
urls.populateMimeData(localUrls, mimeData);
|
||||
|
||||
QVERIFY(KUrl::List::canDecode(mimeData));
|
||||
QVERIFY(mimeData->hasUrls());
|
||||
QVERIFY(mimeData->hasText());
|
||||
QVERIFY(mimeData->hasFormat(QLatin1String("text/plain")));
|
||||
|
||||
// KUrl decodes the real "kde" urls by default
|
||||
KUrl::List decodedURLs = KUrl::List::fromMimeData(mimeData);
|
||||
QVERIFY(!decodedURLs.isEmpty());
|
||||
const QString space(QLatin1Char(' '));
|
||||
QCOMPARE(decodedURLs.toStringList().join(space), urls.toStringList().join(space));
|
||||
|
||||
// KUrl can also be told to decode the "most local" urls
|
||||
decodedURLs = KUrl::List::fromMimeData(mimeData, KUrl::List::PreferLocalUrls);
|
||||
QVERIFY(!decodedURLs.isEmpty());
|
||||
QCOMPARE(decodedURLs.toStringList().join(space), localUrls.toStringList().join(space));
|
||||
|
||||
// QMimeData decodes the "most local" urls
|
||||
const QList<QUrl> qurls = mimeData->urls();
|
||||
QCOMPARE(qurls.count(), localUrls.count());
|
||||
for (int i = 0; i < qurls.count(); ++i) {
|
||||
QCOMPARE(qurls[i], static_cast<QUrl>(localUrls[i]));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (c) 2005 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KURLMIMETEST_H
|
||||
#define KURLMIMETEST_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class KUrlMimeTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
void testURLList();
|
||||
void testOneURL();
|
||||
void testFromQUrl();
|
||||
void testMostLocalUrlList();
|
||||
};
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
Copyright (c) 2005 David Faure <faure@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef kurltest_h
|
||||
#define kurltest_h
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class KUrlTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
void testQUrl();
|
||||
void testEmptyURL();
|
||||
void testIsValid();
|
||||
void testSetQuery();
|
||||
void testEmptyNullReference();
|
||||
void testSetRef();
|
||||
void testSetHTMLRef();
|
||||
void testDirectory();
|
||||
void testUtf8();
|
||||
void testIsLocalFile();
|
||||
void testSimpleMethods();
|
||||
void testHostName();
|
||||
void testParsingTolerance();
|
||||
void testNewLine();
|
||||
void testQueryParsing();
|
||||
void testEmptyQueryOrRef();
|
||||
void testURLsWithoutPath();
|
||||
void testPathAndQuery();
|
||||
void testUpUrl();
|
||||
void testSetFileName();
|
||||
void testPrettyURL();
|
||||
void testIsRelative();
|
||||
void testRelativePath();
|
||||
void testRelativeURL();
|
||||
void testAdjustPath();
|
||||
void testIPV6();
|
||||
void testBaseURL();
|
||||
void testSetUser();
|
||||
void testSetEncodedFragment_data();
|
||||
void testSetEncodedFragment();
|
||||
void testSubURL();
|
||||
void testComparisons();
|
||||
void testStreaming_data();
|
||||
void testStreaming();
|
||||
void testBrokenStuff();
|
||||
void testMoreBrokenStuff();
|
||||
void testMailto();
|
||||
void testSmb();
|
||||
void testOtherProtocols();
|
||||
void testOtherEncodings();
|
||||
void testPathOrURL();
|
||||
void testAssignment();
|
||||
void testQueryItem();
|
||||
void testEncodeString();
|
||||
void testIdn();
|
||||
void testUriMode();
|
||||
void testToLocalFile();
|
||||
void testUrl_data();
|
||||
void testUrl();
|
||||
void testToStringList();
|
||||
void testHashing();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
/* This file is part of the KDE libraries
|
||||
* Copyright (C) 1999 Ian Zepp (icszepp@islc.net)
|
||||
* Copyright (C) 2006 by Dominic Battre <dominic@battre.de>
|
||||
* Copyright (C) 2006 by Martin Pool <mbp@canonical.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public License
|
||||
* along with this library; see the file COPYING.LIB. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "kdecore/kstringhandler_deprecated.h"
|
||||
#include <QTest>
|
||||
|
||||
class NaturalCompareTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private Q_SLOTS:
|
||||
void naturalCompare();
|
||||
};
|
||||
|
||||
QTEST_MAIN(NaturalCompareTest)
|
||||
|
||||
void NaturalCompareTest::naturalCompare()
|
||||
{
|
||||
QCOMPARE(KStringHandler::naturalCompare("a", "b", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("b", "a", Qt::CaseSensitive), +1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("a", "a", Qt::CaseSensitive), 0);
|
||||
|
||||
QCOMPARE(KStringHandler::naturalCompare("A", "a", Qt::CaseSensitive), QString::localeAwareCompare("A", "a"));
|
||||
QCOMPARE(KStringHandler::naturalCompare("A", "a", Qt::CaseInsensitive), 0);
|
||||
QCOMPARE(KStringHandler::naturalCompare("a", "A", Qt::CaseInsensitive), 0);
|
||||
QCOMPARE(KStringHandler::naturalCompare("aAa", "AaA", Qt::CaseInsensitive), 0);
|
||||
QCOMPARE(KStringHandler::naturalCompare("aaa", "AAA", Qt::CaseInsensitive), 0);
|
||||
|
||||
QCOMPARE(KStringHandler::naturalCompare("1", "2", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("1", "10", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("9", "10", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("1", "11", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("1", "12", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("1", "100", Qt::CaseSensitive), -1);
|
||||
|
||||
QCOMPARE(KStringHandler::naturalCompare("1a", "2a", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("1b", "1a", Qt::CaseSensitive), +1);
|
||||
|
||||
QCOMPARE(KStringHandler::naturalCompare("a1", "a2", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("a1", "a10", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("a9", "a10", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("a1", "a11", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("a1", "a12", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("a1", "a100", Qt::CaseSensitive), -1);
|
||||
|
||||
QCOMPARE(KStringHandler::naturalCompare("a1a1", "a2a1", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("a1a1", "a1a2", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("a1a1", "a10a1", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("a1a1", "a1a10", Qt::CaseSensitive), -1);
|
||||
|
||||
QCOMPARE(KStringHandler::naturalCompare("Test 1.gif", "Test 2.gif", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("Test 1.gif", "Test 10.gif", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("Test 9.gif", "Test 10.gif", Qt::CaseSensitive), -1);
|
||||
|
||||
QCOMPARE(KStringHandler::naturalCompare("cmake_2.4.6", "cmake_2.4.10", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("cmake_2.4.10", "cmake_2.4.11", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("cmake_2.4.6", "cmake_2.5.6", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("cmake_2.4.6", "cmake_3.4.6", Qt::CaseSensitive), -1);
|
||||
|
||||
QCOMPARE(KStringHandler::naturalCompare("A-123.txt", "A-a.txt", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("A-012.txt", "A-a.txt", Qt::CaseSensitive), -1);
|
||||
|
||||
// bug 191865
|
||||
QCOMPARE(KStringHandler::naturalCompare("E & G", "E & J", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("E & J", "E & S", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("E & S", "Em & M", Qt::CaseSensitive), -1);
|
||||
|
||||
// bug 181211
|
||||
QCOMPARE(KStringHandler::naturalCompare("queen__radio_ga_ga.mp3", "queen__somebody_to_love_live.mp3", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("queen__somebody_to_love_live.mp3", "queens_of_the_stone_age__no_one_knows.mp3", Qt::CaseSensitive), -1);
|
||||
|
||||
// bug 201101
|
||||
QCOMPARE(KStringHandler::naturalCompare("text", "text.txt", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("text.txt", "text1", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("text1", "text1.txt", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("A B", "A.B", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("A.B", "A B", Qt::CaseSensitive), +1);
|
||||
|
||||
// bug 231445
|
||||
QCOMPARE(KStringHandler::naturalCompare("1", "a", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("a", "v01 1", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("v01 1", "v01 a", Qt::CaseSensitive), -1);
|
||||
|
||||
// bug 237551
|
||||
QCOMPARE(KStringHandler::naturalCompare("sysvinit-2.86-i486-6.txt", "sysvinit-2.86-i486-6.txz", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("sysvinit-2.86-i486-6.txz", "sysvinit-2.86-i486-6.txz.asc", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("sysvinit-2.86-i486-6.txz.asc", "sysvinit-functions-8.53-i486-2.txt", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("sysvinit-functions-8.53-i486-2.txt", "sysvinit-functions-8.53-i486-2.txz", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("sysvinit-functions-8.53-i486-2.txz", "sysvinit-functions-8.53-i486-2.txz.asc", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("sysvinit-functions-8.53-i486-2.txz.asc", "sysvinit-scripts-1.2-noarch-31.txt", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("sysvinit-scripts-1.2-noarch-31.txt", "sysvinit-scripts-1.2-noarch-31.txz", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("sysvinit-scripts-1.2-noarch-31.txz", "sysvinit-scripts-1.2-noarch-31.txz.asc", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("sysvinit-2.86-i486-6.txz.asc", "sysvinit-scripts-1.2-noarch-31.txz", Qt::CaseSensitive), -1);
|
||||
|
||||
// bug 237541
|
||||
QCOMPARE(KStringHandler::naturalCompare("Car and Driver 2008-10", "Car and Driver Buyer's Guide 2010", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("Car and Driver 2008-10", "Car and Driver 2009-11", Qt::CaseSensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("Car and Driver 2009-11", "Car and Driver 2010-05", Qt::CaseSensitive), -1);
|
||||
|
||||
// bug 237788
|
||||
QCOMPARE(KStringHandler::naturalCompare(" ", ".", Qt::CaseInsensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare(".", "_", Qt::CaseInsensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare(" ", "_", Qt::CaseInsensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("abc.jpg", "abc1.jpg", Qt::CaseInsensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("abc1.jpg", "abc_a.jpg", Qt::CaseInsensitive), -1);
|
||||
QCOMPARE(KStringHandler::naturalCompare("abc.jpg", "abc_a.jpg", Qt::CaseInsensitive), -1);
|
||||
}
|
||||
|
||||
#include "naturalcomparetest.moc"
|
|
@ -0,0 +1,4 @@
|
|||
# automoc comes now from kdesupport, Alex
|
||||
|
||||
add_subdirectory(modules)
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
# - Check if the given struct or class has the specified member variable
|
||||
# CHECK_STRUCT_MEMBER (STRUCT MEMBER HEADER VARIABLE)
|
||||
#
|
||||
# STRUCT - the name of the struct or class you are interested in
|
||||
# MEMBER - the member which existence you want to check
|
||||
# HEADER - the header(s) where the prototype should be declared
|
||||
# VARIABLE - variable to store the result
|
||||
#
|
||||
# The following variables may be set before calling this macro to
|
||||
# modify the way the check is run:
|
||||
#
|
||||
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
|
||||
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
|
||||
MACRO (CHECK_STRUCT_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
|
||||
SET(_INCLUDE_FILES)
|
||||
FOREACH (it ${_HEADER})
|
||||
SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
|
||||
ENDFOREACH (it)
|
||||
|
||||
SET(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
|
||||
${_INCLUDE_FILES}
|
||||
int main()
|
||||
{
|
||||
${_STRUCT}* tmp;
|
||||
tmp->${_MEMBER};
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
CHECK_CXX_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT})
|
||||
|
||||
ENDMACRO (CHECK_STRUCT_MEMBER)
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
# Try to find DocBook XML 4.x DTD.
|
||||
# By default it will find version 4.2. A different version can be specified
|
||||
# as parameter for find_package().
|
||||
# Once done, it will define:
|
||||
#
|
||||
# DocBookXML4_FOUND - system has the requested DocBook4 XML DTDs
|
||||
# DocBookXML4_DTD_VERSION - the version of requested DocBook4
|
||||
# XML DTD
|
||||
# DocBookXML4_DTD_DIR - the directory containing the definition of
|
||||
# the DocBook4 XML
|
||||
|
||||
# Copyright (c) 2010, 2014 Luigi Toscano, <luigi.toscano@tiscali.it>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
|
||||
if (NOT DocBookXML_FIND_VERSION)
|
||||
set(DocBookXML_FIND_VERSION "4.2")
|
||||
endif ()
|
||||
|
||||
set (DocBookXML4_DTD_VERSION ${DocBookXML_FIND_VERSION}
|
||||
CACHE INTERNAL "Required version of DocBook4 XML DTDs")
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(DocBookXML4 PROPERTIES DESCRIPTION "DocBook XML 4"
|
||||
URL "http://www.oasis-open.org/docbook/xml/${DocBookXML4_DTD_VERSION}"
|
||||
)
|
||||
|
||||
function (locate_version version found_dir)
|
||||
|
||||
set (DTD_PATH_LIST
|
||||
share/xml/docbook/schema/dtd/${version}
|
||||
share/xml/docbook/xml-dtd-${version}
|
||||
share/sgml/docbook/xml-dtd-${version}
|
||||
share/xml/docbook/${version}
|
||||
)
|
||||
|
||||
find_path (searched_dir docbookx.dtd
|
||||
PATHS ${CMAKE_SYSTEM_PREFIX_PATH}
|
||||
PATH_SUFFIXES ${DTD_PATH_LIST}
|
||||
)
|
||||
|
||||
if (NOT searched_dir)
|
||||
# hacks for systems that use the package version in the DTD dirs,
|
||||
# e.g. Fedora, OpenSolaris
|
||||
set (DTD_PATH_LIST)
|
||||
foreach (DTD_PREFIX_ITER ${CMAKE_SYSTEM_PREFIX_PATH})
|
||||
file(GLOB DTD_SUFFIX_ITER RELATIVE ${DTD_PREFIX_ITER}
|
||||
${DTD_PREFIX_ITER}/share/sgml/docbook/xml-dtd-${version}-*
|
||||
)
|
||||
if (DTD_SUFFIX_ITER)
|
||||
list (APPEND DTD_PATH_LIST ${DTD_SUFFIX_ITER})
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
find_path (searched_dir docbookx.dtd
|
||||
PATHS ${CMAKE_SYSTEM_PREFIX_PATH}
|
||||
PATH_SUFFIXES ${DTD_PATH_LIST}
|
||||
)
|
||||
endif ()
|
||||
set (${found_dir} ${searched_dir} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
||||
locate_version (${DocBookXML4_DTD_VERSION} DocBookXML4_DTD_DIR)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (DocBookXML4
|
||||
REQUIRED_VARS DocBookXML4_DTD_DIR DocBookXML4_DTD_VERSION
|
||||
FOUND_VAR DocBookXML4_FOUND)
|
||||
|
||||
mark_as_advanced (DocBookXML4_DTD_DIR DocBookXML4_DTD_VERSION)
|
|
@ -0,0 +1,46 @@
|
|||
# Try to find Libintl functionality
|
||||
# Once done this will define
|
||||
#
|
||||
# LIBINTL_FOUND - system has Libintl
|
||||
# LIBINTL_INCLUDE_DIR - Libintl include directory
|
||||
# LIBINTL_LIBRARIES - Libraries needed to use Libintl
|
||||
#
|
||||
# TODO: This will enable translations only if Gettext functionality is
|
||||
# present in libc. Must have more robust system for release, where Gettext
|
||||
# functionality can also reside in standalone Gettext library, or the one
|
||||
# embedded within kdelibs (cf. gettext.m4 from Gettext source).
|
||||
|
||||
# Copyright (c) 2006, Chusslove Illich, <caslav.ilic@gmx.net>
|
||||
# Copyright (c) 2007, Alexander Neundorf, <neundorf@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
if(LIBINTL_INCLUDE_DIR AND LIBINTL_LIB_FOUND)
|
||||
set(Libintl_FIND_QUIETLY TRUE)
|
||||
endif(LIBINTL_INCLUDE_DIR AND LIBINTL_LIB_FOUND)
|
||||
|
||||
find_path(LIBINTL_INCLUDE_DIR libintl.h)
|
||||
|
||||
set(LIBINTL_LIB_FOUND FALSE)
|
||||
|
||||
if(LIBINTL_INCLUDE_DIR)
|
||||
include(CheckFunctionExists)
|
||||
check_function_exists(dgettext LIBINTL_LIBC_HAS_DGETTEXT)
|
||||
|
||||
if (LIBINTL_LIBC_HAS_DGETTEXT)
|
||||
set(LIBINTL_LIBRARIES)
|
||||
set(LIBINTL_LIB_FOUND TRUE)
|
||||
else (LIBINTL_LIBC_HAS_DGETTEXT)
|
||||
find_library(LIBINTL_LIBRARIES NAMES intl libintl )
|
||||
if(LIBINTL_LIBRARIES)
|
||||
set(LIBINTL_LIB_FOUND TRUE)
|
||||
endif(LIBINTL_LIBRARIES)
|
||||
endif (LIBINTL_LIBC_HAS_DGETTEXT)
|
||||
|
||||
endif(LIBINTL_INCLUDE_DIR)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libintl DEFAULT_MSG LIBINTL_INCLUDE_DIR LIBINTL_LIB_FOUND)
|
||||
|
||||
mark_as_advanced(LIBINTL_INCLUDE_DIR LIBINTL_LIBRARIES LIBINTL_LIBC_HAS_DGETTEXT LIBINTL_LIB_FOUND)
|
|
@ -0,0 +1,89 @@
|
|||
#.rst:
|
||||
# FindPerlModules
|
||||
# ---------------
|
||||
#
|
||||
# Check that Perl has certain modules available.
|
||||
#
|
||||
# If PERL_EXECUTABLE is set, uses that, otherwise calls the Perl find module.
|
||||
#
|
||||
# To use, pass the perl module names (in the form you would use in a Perl
|
||||
# ``use`` statement) as components.
|
||||
#
|
||||
# This will define the following variables:
|
||||
#
|
||||
# ``Perl_<module>_FOUND``
|
||||
# True if the given Perl module could be loaded by Perl
|
||||
#
|
||||
# where ``<module>`` is either the name passed as a component, or a version
|
||||
# with ``::`` replaced by ``_``.
|
||||
|
||||
# Copyright 2015 Alex Merry <alex.merry@kde.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the University nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
|
||||
if (NOT PERL_EXECUTABLE)
|
||||
find_package(Perl)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
if (PERL_EXECUTABLE)
|
||||
set(PerlModules_all_modules_found TRUE)
|
||||
foreach(_comp ${PerlModules_FIND_COMPONENTS})
|
||||
execute_process(
|
||||
COMMAND ${PERL_EXECUTABLE} -e "use ${_comp}"
|
||||
RESULT_VARIABLE _result
|
||||
OUTPUT_QUIET
|
||||
ERROR_QUIET
|
||||
)
|
||||
string(REPLACE "::" "_" _comp_sanitised "${_comp}")
|
||||
if (_result EQUAL 0)
|
||||
set(PerlModules_${_comp_sanitised}_FOUND TRUE)
|
||||
else()
|
||||
set(PerlModules_${_comp_sanitised}_FOUND FALSE)
|
||||
set(PerlModules_all_modules_found FALSE)
|
||||
endif()
|
||||
find_package_handle_standard_args(PerlModules_${_comp}
|
||||
FOUND_VAR
|
||||
PerlModules_${_comp}_FOUND
|
||||
REQUIRED_VARS
|
||||
PerlModules_${_comp_sanitised}_FOUND
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(PerlModules
|
||||
FOUND_VAR
|
||||
PerlModules_FOUND
|
||||
REQUIRED_VARS
|
||||
PerlModules_all_modules_found
|
||||
HANDLE_COMPONENTS
|
||||
)
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(PerlModules PROPERTIES
|
||||
URL "http://www.cpan.org"
|
||||
)
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
|
||||
|
||||
test_find_package(AGG AGG INCLUDE_DIR LIBRARIES DEFINITIONS)
|
|
@ -0,0 +1,5 @@
|
|||
include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
|
||||
|
||||
test_find_package(Blitz BLITZ INCLUDES LIBRARIES)
|
|
@ -0,0 +1,5 @@
|
|||
include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
|
||||
|
||||
test_find_package(BlueZ BLUEZ INCLUDE_DIR LIBRARIES DEFINITIONS)
|
|
@ -0,0 +1,5 @@
|
|||
include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
|
||||
|
||||
test_find_package(ENCHANT ENCHANT INCLUDE_DIR LIBRARIES DEFINITIONS)
|
|
@ -0,0 +1,5 @@
|
|||
include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
|
||||
|
||||
test_find_package(Eigen2 EIGEN2 INCLUDE_DIR )
|
|
@ -0,0 +1,5 @@
|
|||
include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
|
||||
|
||||
test_find_package(FFmpeg FFMPEG INCLUDE_DIR LIBRARIES DEFINITIONS)
|
|
@ -0,0 +1,5 @@
|
|||
include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
|
||||
|
||||
test_find_package(Flac FLAC INCLUDE_DIR LIBRARIES OGGFLAC_LIBRARIES)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue