Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package c++utilities for openSUSE:Factory checked in at 2026-07-12 16:21:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/c++utilities (Old) and /work/SRC/openSUSE:Factory/.c++utilities.new.1991 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "c++utilities" Sun Jul 12 16:21:23 2026 rev:2 rq:1364952 version:5.34.2 Changes: -------- --- /work/SRC/openSUSE:Factory/c++utilities/c++utilities.changes 2026-05-15 23:53:34.393264731 +0200 +++ /work/SRC/openSUSE:Factory/.c++utilities.new.1991/c++utilities.changes 2026-07-12 16:22:20.102417185 +0200 @@ -1,0 +2,14 @@ +Fri Jul 10 13:25:38 UTC 2026 - Jonatas Gonçalves <[email protected]> + +- Update to version 5.34.2: + * Add support for enabling a detached console via USE_DETACHED_CONSOLE. + * Fix startConsole() when using modern mingw-w64 environments and UCRT. + * Remove legacy and obsolete mingw-w64 implementation of startConsole(). + * Fix invalid XML syntax in Windows manifest templates. + * Set QT_NO_PACKAGE_VERSION_CHECK=ON by default in cross-compilation presets. + * Disable KDE integrations for development builds by default. + * Add new unit tests for ticks() functions. + * Documentation updates in README.md regarding Plasmoid logs gathering, + cmd.exe PATH configurations, and improved pacman/podman examples. + +------------------------------------------------------------------- Old: ---- cpp-utilities-5.34.1.tar.gz New: ---- cpp-utilities-5.34.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ c++utilities.spec ++++++ --- /var/tmp/diff_new_pack.Aq2b4T/_old 2026-07-12 16:22:20.866444169 +0200 +++ /var/tmp/diff_new_pack.Aq2b4T/_new 2026-07-12 16:22:20.870444310 +0200 @@ -20,7 +20,7 @@ %define soname 5 Name: %{reponame} -Version: 5.34.1 +Version: 5.34.2 Release: 0 Summary: Common C++ classes and routines License: GPL-2.0-or-later ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.Aq2b4T/_old 2026-07-12 16:22:20.914445864 +0200 +++ /var/tmp/diff_new_pack.Aq2b4T/_new 2026-07-12 16:22:20.918446005 +0200 @@ -1,5 +1,5 @@ -mtime: 1778798505 -commit: 0bae832f45b00e0c41436869939643a73a99dda8bca7549a0e925aa415d0c09e +mtime: 1783690194 +commit: f77c5f70af713db9a512d1d5e0e602acdaac9379cee781ae92cc068951a08e8f url: https://src.opensuse.org/MaxxedSUSE/c--utilities revision: master ++++++ cpp-utilities-5.34.1.tar.gz -> cpp-utilities-5.34.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpp-utilities-5.34.1/CMakeLists.txt new/cpp-utilities-5.34.2/CMakeLists.txt --- old/cpp-utilities-5.34.1/CMakeLists.txt 2026-05-12 10:52:19.000000000 +0200 +++ new/cpp-utilities-5.34.2/CMakeLists.txt 2026-06-28 19:42:10.000000000 +0200 @@ -102,8 +102,8 @@ cmake/templates/version.h.in cmake/templates/template.pc.in) if (WIN32) - list(APPEND CMAKE_TEMPLATE_FILES cmake/templates/windows.rc.in cmake/templates/windows-cli-wrapper.rc.in - cmake/templates/cli-wrapper.cpp) + list(APPEND CMAKE_TEMPLATE_FILES cmake/templates/windows.rc.in cmake/templates/windows.manifest.in + cmake/templates/windows-cli-wrapper.rc.in cmake/templates/cli-wrapper.cpp) endif () set(EXCLUDED_FILES cmake/templates/cli-wrapper.cpp) @@ -122,7 +122,7 @@ set(META_APP_DESCRIPTION "Useful C++ classes and routines such as argument parser, IO and conversion utilities") set(META_VERSION_MAJOR 5) set(META_VERSION_MINOR 34) -set(META_VERSION_PATCH 1) +set(META_VERSION_PATCH 2) # find required 3rd party libraries include(3rdParty) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpp-utilities-5.34.1/CMakePresets.json new/cpp-utilities-5.34.2/CMakePresets.json --- old/cpp-utilities-5.34.1/CMakePresets.json 2026-05-12 10:52:19.000000000 +0200 +++ new/cpp-utilities-5.34.2/CMakePresets.json 2026-06-28 19:42:10.000000000 +0200 @@ -67,6 +67,16 @@ } }, { + "name": "qt-cross", + "inherits": "default", + "displayName": "Additional settings for cross-compilation with Qt", + "description": "Same as default but sets additional settings for cross-compilation with Qt", + "binaryDir": "$env{BUILD_DIR}/${sourceDirName}/default-qt-cross", + "cacheVariables": { + "QT_NO_PACKAGE_VERSION_CHECK": {"type": "BOOL", "value": "ON"} + } + }, + { "name": "qt6", "inherits": "default", "displayName": "Use Qt 6 (instead of Qt 5)", @@ -90,7 +100,7 @@ }, { "name": "devel", - "inherits": "ccache", + "inherits": ["ccache", "no-kde"], "displayName": "Generic development config", "description": "Development build with testsuite using ccache with many warnings enabled and treated as errors", "binaryDir": "$env{BUILD_DIR}/${sourceDirName}/devel", @@ -141,9 +151,7 @@ "QT_PACKAGE_PREFIX": {"type": "STRING", "value": "Qt6"}, "QT_MAJOR_VERSION": {"type": "STRING", "value": "6"}, "KF_PACKAGE_PREFIX": {"type": "STRING", "value": "KF6"}, - "BUILD_WITH_QT6": {"type": "BOOL", "value": "ON"}, - "NO_PLASMOID": {"type": "BOOL", "value": "ON"}, - "NO_FILE_ITEM_ACTION_PLUGIN": {"type": "BOOL", "value": "ON"} + "BUILD_WITH_QT6": {"type": "BOOL", "value": "ON"} } }, { @@ -211,7 +219,7 @@ }, { "name": "arch-*-w64-mingw32", - "inherits": ["no-webview", "no-kde"], + "inherits": ["no-webview", "no-kde", "qt-cross"], "displayName": "Target *-w64-mingw32 using Arch Linux's mingw-w64 packaging", "description": "Build targeting *-w64-mingw32, paths and flags are specific to Arch Linux's mingw-w64 packaging", "environment": { @@ -366,7 +374,7 @@ }, { "name": "arch-mingw-w64-clang", - "inherits": ["no-webview", "no-kde", "qt6"], + "inherits": ["no-webview", "no-kde", "qt-cross", "qt6"], "displayName": "Target *-w64-mingw32 using LLVM/Clang provided by Arch Linux and additional mingw-w64-clang-* packaging (invoke e.g. \"source mingw-clang-env aarch64-w64-mingw32\" before invoking CMake)", "description": "Build targeting Windows, paths and flags are specific to Arch Linux packaging, invoke e.g. \"source mingw-clang-env aarch64-w64-mingw32\" for required environment variables", "binaryDir": "$env{BUILD_DIR}/${sourceDirName}/arch-mingw-w64-clang-$env{MINGW_W64_CLANG_TARGET}", @@ -461,7 +469,7 @@ }, { "name": "arch-android", - "inherits": ["no-webview", "no-kde", "qt6", "builtin-translations"], + "inherits": ["no-webview", "no-kde", "qt-cross", "qt6", "builtin-translations"], "displayName": "Target *-linux-android using Arch Linux's Android packaging (invoke e.g. \"source android-env aarch64\" before invoking CMake)", "description": "Build targeting Android, paths and flags are specific to Arch Linux's Android packaging, invoke e.g. \"source android-env aarch64\" for required environment variables", "binaryDir": "$env{BUILD_DIR}/${sourceDirName}/arch-android-$env{ANDROID_ABI}", @@ -497,7 +505,7 @@ }, { "name": "arch-wasm", - "inherits": ["no-webview", "no-kde", "qt6"], + "inherits": ["no-webview", "no-kde", "qt-cross", "qt6"], "displayName": "Target wasm32-unknown-emscripten using Arch Linux's packaging", "description": "Build targeting WebAssembly via Emscripten, paths and flags are specific to Arch Linux's packaging", "binaryDir": "$env{BUILD_DIR}/${sourceDirName}/arch-wasm", @@ -594,7 +602,7 @@ }, { "name": "win-android-base", - "inherits": ["no-webview", "no-kde", "qt6", "builtin-translations"], + "inherits": ["no-webview", "no-kde", "qt-cross", "qt6", "builtin-translations"], "displayName": "Target *-linux-android using MSYS2 and Arch Linux's Android packaging (invoke e.g. \"source android-env aarch64\" before invoking CMake)", "description": "Build targeting Android, paths and flags are specific to MSYS2 and Arch Linux's Android packaging, invoke e.g. \"source android-env aarch64\" for required environment variables", "binaryDir": "$env{BUILD_DIR}/${sourceDirName}/win-android-$env{ANDROID_ABI}", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpp-utilities-5.34.1/README.md new/cpp-utilities-5.34.2/README.md --- old/cpp-utilities-5.34.1/README.md 2026-05-12 10:52:19.000000000 +0200 +++ new/cpp-utilities-5.34.2/README.md 2026-06-28 19:42:10.000000000 +0200 @@ -81,6 +81,9 @@ * Install debug packages for producing better crash dumps if available. * The Arch Linux repository I provide contains debug packages via `ownstuff-debug`. * Some of the openSUSE and Fedora repositories I provide via OBS contain debug info packages. +* Under systemd-based systems, logs of Plasma Applets/Plasmoids can be accessed via e.g. + `journalctl --user --since '2 hours ago' -fu plasma-plasmashell.service`. Altneratively, one can also restart + `plasmashell` in a terminal, e.g. `killall plasmashell; plasmashell &`. ### Android-specific notes * Logs can be followed via `adb logcat`, Android Studio or viewed on the device itself via apps like @@ -186,6 +189,13 @@ * When using `BUILTIN_ICON_THEMES`, the icon theme still needs to be installed as if it were installed on a GNU/Linux system. So simply grab, e.g., the Arch Linux package `breeze-icons` and extract it somewhere. Do *not* use the package from MSYS2 or what comes with builds from KDE's binary factory. +* Windows did not allow creating hybrid console/GUI versions until version Windows 11 24H2 (build 26100). + Hence the build system creates a CLI wrapper for GUI applications so they can also be used from the console, + e.g. to view logs and to access additional CLI features. Add `-DUSE_DETACHED_CONSOLE=ON` to build GUI apps + instead as console applications with "detached" + [Console Allocation Policy](https://learn.microsoft.com/en-us/windows/console/console-allocation-policy). + With this, the CLI wrapper is no longer needed but suppressing the console windows this way onlay works as + of Windows 11 24H2 (build 26100). #### MacOS-specific notes * To create application icons, the tool `png2icns` is required. @@ -196,7 +206,7 @@ * There are [MacPorts packages](https://www.macports.org/ports.php?by=name&substr=syncthingtray-devel) to build Syncthing Tray. -##### Development builds +#### Development builds During development, I find it useful to build all required projects (for instance, c++utilities, qtutilities, tagparser, and tageditor) as one big project. @@ -368,7 +378,11 @@ ``` podman container exec -it archlinux-devel-container \ - pacman -Syu clang ninja git extra-cmake-modules qt6-{base,tools,declarative,shadertools} android-cmake android-aarch64-qt6-{base,declarative,tools,translations,svg} go perl-yaml-libyaml + pacman -Syu --needed clang ninja git extra-cmake-modules android-cmake \ + go perl-yaml-libyaml \ + qt6-{base,tools,declarative,shadertools} \ + android-aarch64-qt6-{base,declarative,tools,translations,svg} \ + android-x86-64-qt6-{base,declarative,tools,translations,svg} ``` You use `keytool` from within the container in the same way as shown above: @@ -428,7 +442,7 @@ prefix=mingw-w64-clang-aarch64 # in CLANGARM64 shell # install dependencies; you may strip down this list depending on the application and features to enable -pacman -Syu git perl-YAML-Tiny $prefix-gcc $prefix-ccache $prefix-cmake $prefix-boost $prefix-cppunit $prefix-qt6-base $prefix-qt6-declarative $prefix-qt6-tools $prefix-qt6-svg $prefix-clang-tools-extra $prefix-doxygen $prefix-ffmpeg $prefix-go $prefix-libarchive +pacman -Syu --needed git perl-YAML-Tiny $prefix-gcc $prefix-ccache $prefix-cmake $prefix-boost $prefix-cppunit $prefix-qt6-base $prefix-qt6-declarative $prefix-qt6-tools $prefix-qt6-svg $prefix-clang-tools-extra $prefix-doxygen $prefix-ffmpeg $prefix-go $prefix-libarchive $prefix-openssl # clone repositories as mentioned under "Building this straight" in the application's README file cd /path/to/store/sources @@ -439,7 +453,7 @@ # configure and invoke the build cd subdirs/syncthingtray cmake --preset devel-qt6 -cmake --build "$BUILD_DIR/syncthingtray/devel-qt6" devel-qt6 -- -v +cmake --build --preset devel-qt6 ``` Run the following commands to build libraries individually (in this example, `tagparser`) and @@ -448,7 +462,7 @@ ``` # install dependencies prefix=mingw-w64-ucrt-x86_64 -pacman -Syu git $prefix-gcc $prefix-ccache $prefix-cmake $prefix-boost $prefix-cppunit +pacman -Syu --needed git $prefix-gcc $prefix-ccache $prefix-cmake $prefix-boost $prefix-cppunit # clone relevant repositories, e.g. here just tagparser and its dependency c++utilities cd /path/to/store/sources @@ -476,7 +490,8 @@ require Qt at all. * To run the binaries from the Windows terminal, you need to add the mingw-w64 libraries from the MSYS2 installation to the path, e.g., `$Env:PATH = "$Env:MSYS2_ROOT\ucrt64\bin"` or - `$Env:PATH = "$Env:MSYS2_ROOT\mingw64\bin"`. + `$Env:PATH = "$Env:MSYS2_ROOT\mingw64\bin"` (or e.g. `set PATH=%MSYS2_ROOT%\ucrt64\bin` or + `set PATH=%MSYS2_ROOT%\mingw64\bin` for `cmd.exe`). * You can also easily install Qt Creator via MSYS2 using `pacman -S $prefix-qt-creator`. In Qt Creator, you can import the build configured via presets on the command line as an existing build. This also works for the MSVC build mentioned below. This way, not much tinkering in the Qt Creator settings is @@ -493,7 +508,7 @@ Go (only used by `libsyncthing`) provided via MSYS2 packages; install the following packages: ``` prefix=mingw-w64-ucrt-x86_64 # see "Remarks for building on Windows" for details and other options - pacman -Syu perl-YAML $prefix-clang-tools-extra $prefix-doxygen $prefix-ffmpeg $prefix-go + pacman -Syu --needed perl-YAML $prefix-clang-tools-extra $prefix-doxygen $prefix-ffmpeg $prefix-go ``` * `MSYS2_ROOT` must be set to the main install directory of MSYS2 (that also contains all the executables for the different shells/environments). @@ -594,12 +609,12 @@ can install Android packages, e.g.: ``` -pacman -Syu android-cmake android-{x86-64,aarch64}-{boost,libiconv,openssl,cppunit,sqlite} +pacman -Syu --needed android-cmake android-{x86-64,aarch64}-{boost,libiconv,openssl,cppunit,sqlite} ```` You may also install Qt from my repo instead of relying on official Qt builds: ``` -pacman -S android-{x86-64,aarch64}-qt6-{base,declarative,tools,svg,translations} +pacman -Syu --needed android-{x86-64,aarch64}-qt6-{base,declarative,tools,svg,translations} ``` Note that when using Qt for Android from my repo, you also need to install a matching version of Qt for @@ -607,7 +622,7 @@ You may also install a few KDE libraries, like Kirigami: ``` -pacman -S --assume-installed=android-{aarch64,x86-64}-qt6-{base,declarative,shadertools,svg,5compat} \ +pacman -Syu --needed --assume-installed=android-{aarch64,x86-64}-qt6-{base,declarative,shadertools,svg,5compat} \ android-{aarch64,x86-64}-kirigami ``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpp-utilities-5.34.1/application/commandlineutils.cpp new/cpp-utilities-5.34.2/application/commandlineutils.cpp --- old/cpp-utilities-5.34.1/application/commandlineutils.cpp 2026-05-12 10:52:19.000000000 +0200 +++ new/cpp-utilities-5.34.2/application/commandlineutils.cpp 2026-06-28 19:42:10.000000000 +0200 @@ -210,9 +210,8 @@ // attach to the parent process' console or allocate a new console if that's not possible if (!skip && (AttachConsole(ATTACH_PARENT_PROCESS) || AllocConsole())) { - FILE *fp; -#ifdef _MSC_VER // take care of normal streams + FILE *fp; if (!skipstdout) { freopen_s(&fp, "CONOUT$", "w", stdout); std::cout.clear(); @@ -244,36 +243,6 @@ SetStdHandle(STD_INPUT_HANDLE, hConIn); std::wcin.clear(); } -#else - // redirect stdout - auto stdHandle = std::intptr_t(); - auto conHandle = int(); - if (!skipstdout) { - stdHandle = reinterpret_cast<intptr_t>(GetStdHandle(STD_OUTPUT_HANDLE)); - conHandle = _open_osfhandle(stdHandle, _O_TEXT); - fp = _fdopen(conHandle, "w"); - *stdout = *fp; - setvbuf(stdout, nullptr, _IONBF, 0); - } - // redirect stdin - if (!skipstdin) { - stdHandle = reinterpret_cast<intptr_t>(GetStdHandle(STD_INPUT_HANDLE)); - conHandle = _open_osfhandle(stdHandle, _O_TEXT); - fp = _fdopen(conHandle, "r"); - *stdin = *fp; - setvbuf(stdin, nullptr, _IONBF, 0); - } - // redirect stderr - if (!skipstderr) { - stdHandle = reinterpret_cast<intptr_t>(GetStdHandle(STD_ERROR_HANDLE)); - conHandle = _open_osfhandle(stdHandle, _O_TEXT); - fp = _fdopen(conHandle, "w"); - *stderr = *fp; - setvbuf(stderr, nullptr, _IONBF, 0); - } - // sync - ios::sync_with_stdio(true); -#endif // ensure the console prompt is shown again when app terminates std::atexit(stopConsole); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpp-utilities-5.34.1/cmake/modules/WindowsResources.cmake new/cpp-utilities-5.34.2/cmake/modules/WindowsResources.cmake --- old/cpp-utilities-5.34.1/cmake/modules/WindowsResources.cmake 2026-05-12 10:52:19.000000000 +0200 +++ new/cpp-utilities-5.34.2/cmake/modules/WindowsResources.cmake 2026-06-28 19:42:10.000000000 +0200 @@ -12,16 +12,39 @@ option(WINDOWS_RESOURCES_ENABLED "controls whether Windows resources are enabled" ON) option(WINDOWS_ICON_ENABLED "controls whether Windows icon is enabled" ON) +# allow configuring console allocation policy (see +# https://learn.microsoft.com/en-us/windows/console/console-allocation-policy) +set(WINDOWS_CONSOLE_ALLOCATION_POLICY + "" + CACHE STRING "sets the default console allocation policy for all projects") +set(${META_PROJECT_VARNAME_UPPER}_WINDOWS_CONSOLE_ALLOCATION_POLICY + "${WINDOWS_CONSOLE_ALLOCATION_POLICY}" + CACHE STRING "sets the console allocation policy for ${META_PROJECT_NAME}") + if (NOT WIN32 OR NOT WINDOWS_RESOURCES_ENABLED) return() endif () # find rc template, define path of output rc file include(TemplateFinder) +find_template_file("windows.manifest" CPP_UTILITIES MANIFEST_TEMPLATE_FILE) find_template_file("windows.rc" CPP_UTILITIES RC_TEMPLATE_FILE) find_template_file("windows-cli-wrapper.rc" CPP_UTILITIES RC_CLI_TEMPLATE_FILE) set(WINDOWS_RC_FILE "${CMAKE_CURRENT_BINARY_DIR}/resources/windows") set(WINDOWS_CLI_RC_FILE "${CMAKE_CURRENT_BINARY_DIR}/resources/windows-cli-wrapper") +set(WINDOWS_MANIFEST "${CMAKE_CURRENT_BINARY_DIR}/resources/windows.manifest") + +# make manifest settings +set(WINDOWS_SETTINGS "") +if (${META_PROJECT_VARNAME_UPPER}_WINDOWS_CONSOLE_ALLOCATION_POLICY) + set(WINDOWS_SETTINGS + " <consoleAllocationPolicy xmlns=\"http://schemas.microsoft.com/SMI/2024/WindowsSettings\">${${META_PROJECT_VARNAME_UPPER}_WINDOWS_CONSOLE_ALLOCATION_POLICY}</consoleAllocationPolicy>" + ) +endif () +if (WINDOWS_SETTINGS) + configure_file("${MANIFEST_TEMPLATE_FILE}" "${WINDOWS_MANIFEST}") + set(WINDOWS_MANIFEST_ENTRY "CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST \"${WINDOWS_MANIFEST}\"") +endif () # create Windows icon from png with ffmpeg if available unset(WINDOWS_ICON_RC_ENTRY) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpp-utilities-5.34.1/cmake/templates/windows.manifest.in new/cpp-utilities-5.34.2/cmake/templates/windows.manifest.in --- old/cpp-utilities-5.34.1/cmake/templates/windows.manifest.in 1970-01-01 01:00:00.000000000 +0100 +++ new/cpp-utilities-5.34.2/cmake/templates/windows.manifest.in 2026-06-28 19:42:10.000000000 +0200 @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <application> + <windowsSettings> +@WINDOWS_SETTINGS@ + </windowsSettings> + </application> +</assembly> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpp-utilities-5.34.1/cmake/templates/windows.rc.in new/cpp-utilities-5.34.2/cmake/templates/windows.rc.in --- old/cpp-utilities-5.34.1/cmake/templates/windows.rc.in 2026-05-12 10:52:19.000000000 +0200 +++ new/cpp-utilities-5.34.2/cmake/templates/windows.rc.in 2026-06-28 19:42:10.000000000 +0200 @@ -5,6 +5,7 @@ # endif @WINDOWS_ICON_RC_ENTRY@ +@WINDOWS_MANIFEST_ENTRY@ VS_VERSION_INFO VERSIONINFO FILEVERSION @META_VERSION_MAJOR@,@META_VERSION_MINOR@,@META_VERSION_PATCH@,0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cpp-utilities-5.34.1/tests/chronotests.cpp new/cpp-utilities-5.34.2/tests/chronotests.cpp --- old/cpp-utilities-5.34.1/tests/chronotests.cpp 2026-05-12 10:52:19.000000000 +0200 +++ new/cpp-utilities-5.34.2/tests/chronotests.cpp 2026-06-28 19:42:10.000000000 +0200 @@ -221,6 +221,11 @@ // test now() and exactNow() (or at least whether both behave the same) const auto delta = DateTime::gmtNow() - DateTime::exactGmtNow(); CPPUNIT_ASSERT(delta < TimeSpan::fromSeconds(2.0) && delta > TimeSpan::fromSeconds(-2.0)); + + // test modifying ticks directly + auto dt = DateTime(100); + dt.ticks() += 5; + CPPUNIT_ASSERT_EQUAL_MESSAGE("modifying reference via ticks() possible despite constexpr", static_cast<DateTime::TickType>(105), dt.totalTicks()); } /*! @@ -358,6 +363,11 @@ CPPUNIT_ASSERT_EQUAL("00:00:15.9850776"s, test2.toString()); CPPUNIT_ASSERT_EQUAL("15 s 985 ms 77 µs 600 ns"s, test2.toString(TimeSpanOutputFormat::WithMeasures)); CPPUNIT_ASSERT_EQUAL("15.9850776"s, test2.toString(TimeSpanOutputFormat::TotalSeconds)); + + // test modifying ticks directly + auto ts = TimeSpan(100); + ts.ticks() += 5; + CPPUNIT_ASSERT_EQUAL_MESSAGE("modifying reference via ticks()", static_cast<TimeSpan::TickType>(105), ts.totalTicks()); } /*!
