@@ -52,18 +52,18 @@ void TestUtilsFunctions::testFormatDuration()
5252 testFormatDuration ( t0, -1 , QStringLiteral ( " Invalid datetime" ) );
5353 testFormatDuration ( t0, 0 , QStringLiteral ( " just now" ) );
5454 testFormatDuration ( t0, 1 , QStringLiteral ( " just now" ) );
55- testFormatDuration ( t0, 60 , QStringLiteral ( " 1 minute ago" ) );
56- testFormatDuration ( t0, 2 * 60 , QStringLiteral ( " 2 minutes ago" ) );
57- testFormatDuration ( t0, 1 * 60 * 60 , QStringLiteral ( " 1 hour ago" ) );
58- testFormatDuration ( t0, 2 * 60 * 60 , QStringLiteral ( " 2 hours ago" ) );
59- testFormatDuration ( t0, 1 * DAY_IN_SECS, QStringLiteral ( " 1 day ago" ) );
60- testFormatDuration ( t0, 2 * DAY_IN_SECS, QStringLiteral ( " 2 days ago" ) );
61- testFormatDuration ( t0, 7 * DAY_IN_SECS, QStringLiteral ( " 1 week ago" ) );
62- testFormatDuration ( t0, 14 * DAY_IN_SECS, QStringLiteral ( " 2 weeks ago" ) );
63- testFormatDuration ( t0, MONTH_IN_SECS, QStringLiteral ( " 1 month ago" ) );
64- testFormatDuration ( t0, 2 * MONTH_IN_SECS, QStringLiteral ( " 2 months ago" ) );
65- testFormatDuration ( t0, 12 * MONTH_IN_SECS, QStringLiteral ( " 1 year ago" ) );
66- testFormatDuration ( t0, 24 * MONTH_IN_SECS, QStringLiteral ( " 2 years ago" ) );
55+ testFormatDuration ( t0, 60 , QStringLiteral ( " 1 minute(s) ago" ) );
56+ testFormatDuration ( t0, 2 * 60 , QStringLiteral ( " 2 minute(s) ago" ) );
57+ testFormatDuration ( t0, 1 * 60 * 60 , QStringLiteral ( " 1 hour(s) ago" ) );
58+ testFormatDuration ( t0, 2 * 60 * 60 , QStringLiteral ( " 2 hour(s) ago" ) );
59+ testFormatDuration ( t0, 1 * DAY_IN_SECS, QStringLiteral ( " 1 day(s) ago" ) );
60+ testFormatDuration ( t0, 2 * DAY_IN_SECS, QStringLiteral ( " 2 day(s) ago" ) );
61+ testFormatDuration ( t0, 7 * DAY_IN_SECS, QStringLiteral ( " 1 week(s) ago" ) );
62+ testFormatDuration ( t0, 14 * DAY_IN_SECS, QStringLiteral ( " 2 week(s) ago" ) );
63+ testFormatDuration ( t0, MONTH_IN_SECS, QStringLiteral ( " 1 month(s) ago" ) );
64+ testFormatDuration ( t0, 2 * MONTH_IN_SECS, QStringLiteral ( " 2 month(s) ago" ) );
65+ testFormatDuration ( t0, 12 * MONTH_IN_SECS, QStringLiteral ( " 1 year(s) ago" ) );
66+ testFormatDuration ( t0, 24 * MONTH_IN_SECS, QStringLiteral ( " 2 year(s) ago" ) );
6767}
6868
6969void TestUtilsFunctions::testFormatDuration ( const QDateTime &t0, qint64 diffSecs, const QString &expectedResult )
0 commit comments