Skip to content

Commit

Permalink
Wrong weekday in unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
Murmele committed Oct 8, 2023
1 parent 39e0348 commit 93e49b3
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions test/amend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ void TestAmend::testAmend() {

auto authorSignature = repo.signature(
"New Author", "New Author Email",
QDateTime::fromString("Sun May 23 10:36:26 2022 +0200", Qt::RFC2822Date));
QDateTime::fromString("Mon May 23 10:36:26 2022 +0200", Qt::RFC2822Date));

QString dateAuthor = "Mon May 23 10:36:26 2022 +0200";
auto committerSignature = repo.signature(
"New Committer", "New Committer Email",
QDateTime::fromString("Sun May 23 11:36:26 2022 +0200", Qt::RFC2822Date));
QDateTime::fromString("Mon May 23 11:36:26 2022 +0200", Qt::RFC2822Date));

Tree tree;
c.amend(authorSignature, committerSignature, commitMessage, tree);
Expand All @@ -73,12 +75,12 @@ void TestAmend::testAmend() {
QCOMPARE(c.author().name(), "New Author");
QCOMPARE(
c.author().date(),
QDateTime::fromString("Sun May 23 10:36:26 2022 +0200", Qt::RFC2822Date));
QDateTime::fromString("Mon May 23 10:36:26 2022 +0200", Qt::RFC2822Date));
QCOMPARE(c.committer().name(), "New Committer");
QCOMPARE(c.committer().email(), "New Committer Email");
QCOMPARE(
c.committer().date(),
QDateTime::fromString("Sun May 23 11:36:26 2022 +0200", Qt::RFC2822Date));
QDateTime::fromString("Mon May 23 11:36:26 2022 +0200", Qt::RFC2822Date));
}

void TestAmend::testAmendAddFile() {
Expand Down Expand Up @@ -196,10 +198,10 @@ void TestAmend::testAmendDialog() {
Test::ScratchRepository repo;
auto authorSignature = repo->signature(
"New Author", "New Author Email",
QDateTime::fromString("Sun May 23 10:36:26 2022 +0200", Qt::RFC2822Date));
QDateTime::fromString("Mon May 23 10:36:26 2022 +0200", Qt::RFC2822Date));
auto committerSignature = repo->signature(
"New Committer", "New Committer Email",
QDateTime::fromString("Sun May 23 11:36:26 2022 +0200", Qt::RFC2822Date));
QDateTime::fromString("Mon May 23 11:36:26 2022 +0200", Qt::RFC2822Date));

{
AmendDialog d(authorSignature, committerSignature, "Test commit message");
Expand Down Expand Up @@ -241,7 +243,7 @@ void TestAmend::testAmendDialog() {
ContributorInfo::SelectedDateTimeType::Original);
QCOMPARE(authorCommitDate->isVisible(), false);
QCOMPARE(info.authorInfo.commitDate,
QDateTime::fromString("Sun May 23 10:36:26 2022 +0200",
QDateTime::fromString("Mon May 23 10:36:26 2022 +0200",
Qt::RFC2822Date));

// manual
Expand Down Expand Up @@ -290,7 +292,7 @@ void TestAmend::testAmendDialog() {
ContributorInfo::SelectedDateTimeType::Original);
QCOMPARE(committerCommitDate->isVisible(), false);
QCOMPARE(info.committerInfo.commitDate,
QDateTime::fromString("Sun May 23 11:36:26 2022 +0200",
QDateTime::fromString("Mon May 23 11:36:26 2022 +0200",
Qt::RFC2822Date));

// manual
Expand Down Expand Up @@ -318,10 +320,10 @@ void TestAmend::testAmendDialog2() {
Test::ScratchRepository repo;
auto authorSignature = repo->signature(
"New Author", "New Author Email",
QDateTime::fromString("Sun May 23 10:36:26 2022 +0200", Qt::RFC2822Date));
QDateTime::fromString("Mon May 23 10:36:26 2022 +0200", Qt::RFC2822Date));
auto committerSignature = repo->signature(
"New Committer", "New Committer Email",
QDateTime::fromString("Sun May 23 11:36:26 2022 +0200", Qt::RFC2822Date));
QDateTime::fromString("Mon May 23 11:36:26 2022 +0200", Qt::RFC2822Date));

AmendDialog d(authorSignature, committerSignature, "Test commit message");

Expand Down Expand Up @@ -373,10 +375,10 @@ void TestAmend::testAmendDialogNewLineInMessage() {
Test::ScratchRepository repo;
auto authorSignature = repo->signature(
"New Author", "New Author Email",
QDateTime::fromString("Sun May 23 10:36:26 2022 +0200", Qt::RFC2822Date));
QDateTime::fromString("Mon May 23 10:36:26 2022 +0200", Qt::RFC2822Date));
auto committerSignature = repo->signature(
"New Committer", "New Committer Email",
QDateTime::fromString("Sun May 23 11:36:26 2022 +0200", Qt::RFC2822Date));
QDateTime::fromString("Mon May 23 11:36:26 2022 +0200", Qt::RFC2822Date));

AmendDialog d(authorSignature, committerSignature,
"Test commit message\nNewLine");
Expand Down

0 comments on commit 93e49b3

Please sign in to comment.