Skip to content

Commit

Permalink
kde-frameworks/kcoreaddons: Add Debian patch for kformattest failure
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/650280
Package-Manager: Portage-2.3.40, Repoman-2.3.9
  • Loading branch information
a17r committed Jun 6, 2018
1 parent e381e5c commit 2d400f0
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
From: Maximiliano Curia <[email protected]>
Date: Tue, 15 May 2018 13:06:53 +0200
Subject: fix kformattest plural forms

---
autotests/kformattest.cpp | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/autotests/kformattest.cpp b/autotests/kformattest.cpp
index 15080be..6cc3c52 100644
--- a/autotests/kformattest.cpp
+++ b/autotests/kformattest.cpp
@@ -248,8 +248,8 @@ void KFormatTest::formatDecimalDuration()
{
KFormat format(QLocale::c());

- QCOMPARE(format.formatDecimalDuration(10), QStringLiteral("10 millisecond(s)"));
- QCOMPARE(format.formatDecimalDuration(10, 3), QStringLiteral("10 millisecond(s)"));
+ QCOMPARE(format.formatDecimalDuration(10), QStringLiteral("10 milliseconds"));
+ QCOMPARE(format.formatDecimalDuration(10, 3), QStringLiteral("10 milliseconds"));
QCOMPARE(format.formatDecimalDuration(1 * MSecsInSecond + 10), QStringLiteral("1.01 seconds"));
QCOMPARE(format.formatDecimalDuration(1 * MSecsInSecond + 1, 3), QStringLiteral("1.001 seconds"));
QCOMPARE(format.formatDecimalDuration(1 * MSecsInMinute + 10 * MSecsInSecond), QStringLiteral("1.17 minutes"));
@@ -264,22 +264,22 @@ void KFormatTest::formatSpelloutDuration()
{
KFormat format(QLocale::c());

- QCOMPARE(format.formatSpelloutDuration(1000), QStringLiteral("1 second(s)"));
- QCOMPARE(format.formatSpelloutDuration(5000), QStringLiteral("5 second(s)"));
- QCOMPARE(format.formatSpelloutDuration(60000), QStringLiteral("1 minute(s)"));
- QCOMPARE(format.formatSpelloutDuration(300000), QStringLiteral("5 minute(s)"));
- QCOMPARE(format.formatSpelloutDuration(3600000), QStringLiteral("1 hour(s)"));
- QCOMPARE(format.formatSpelloutDuration(18000000), QStringLiteral("5 hour(s)"));
- QCOMPARE(format.formatSpelloutDuration(75000), QStringLiteral("1 minute(s) and 15 second(s)"));
+ QCOMPARE(format.formatSpelloutDuration(1000), QStringLiteral("1 second"));
+ QCOMPARE(format.formatSpelloutDuration(5000), QStringLiteral("5 seconds"));
+ QCOMPARE(format.formatSpelloutDuration(60000), QStringLiteral("1 minute"));
+ QCOMPARE(format.formatSpelloutDuration(300000), QStringLiteral("5 minutes"));
+ QCOMPARE(format.formatSpelloutDuration(3600000), QStringLiteral("1 hour"));
+ QCOMPARE(format.formatSpelloutDuration(18000000), QStringLiteral("5 hours"));
+ QCOMPARE(format.formatSpelloutDuration(75000), QStringLiteral("1 minute and 15 seconds"));
// Problematic case #1 (there is a reference to this case on kformat.cpp)
- QCOMPARE(format.formatSpelloutDuration(119999), QStringLiteral("2 minute(s)"));
+ QCOMPARE(format.formatSpelloutDuration(119999), QStringLiteral("2 minutes"));
// This case is strictly 2 hours, 15 minutes and 59 seconds. However, since the range is
// pretty high between hours and seconds, formatSpelloutDuration always omits seconds when there
// are hours in scene.
- QCOMPARE(format.formatSpelloutDuration(8159000), QStringLiteral("2 hour(s) and 15 minute(s)"));
+ QCOMPARE(format.formatSpelloutDuration(8159000), QStringLiteral("2 hours and 15 minutes"));
// This case is strictly 1 hour and 10 seconds. For the same reason, formatSpelloutDuration
// detects that 10 seconds is just garbage compared to 1 hour, and omits it on the result.
- QCOMPARE(format.formatSpelloutDuration(3610000), QStringLiteral("1 hour(s)"));
+ QCOMPARE(format.formatSpelloutDuration(3610000), QStringLiteral("1 hour"));
}

void KFormatTest::formatRelativeDate()
8 changes: 8 additions & 0 deletions kde-frameworks/kcoreaddons/kcoreaddons-5.46.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ DEPEND="${RDEPEND}
nls? ( $(add_qt_dep linguist-tools) )
"

src_prepare() {
# bug 650280
has_version '<dev-qt/qtcore-5.10.0:5' && \
eapply "${FILESDIR}/${P}-kformattest.patch"

kde5_src_prepare
}

src_configure() {
local mycmakeargs=(
-D_KDE4_DEFAULT_HOME_POSTFIX=4
Expand Down

0 comments on commit 2d400f0

Please sign in to comment.