| 52 | } |
| 53 | |
| 54 | void TestVcsAnnotationLine::testCopyConstructor() |
| 55 | { |
| 56 | // copy invalid |
| 57 | { |
| 58 | VcsAnnotationLine annotationLineA; |
| 59 | |
| 60 | VcsAnnotationLine annotationLineB(annotationLineA); |
| 61 | QCOMPARE(annotationLineA.revision().revisionType(), VcsRevision::Invalid); |
| 62 | QCOMPARE(annotationLineB.revision().revisionType(), VcsRevision::Invalid); |
| 63 | } |
| 64 | |
| 65 | // test plain copy |
| 66 | const int lineNumber = 1; |
| 67 | const QString text("Text A"); |
| 68 | const QString author("Author A"); |
| 69 | VcsRevision revision; |
| 70 | revision.setRevisionValue("A", VcsRevision::GlobalNumber); |
| 71 | const QDateTime date = QDateTime::fromString("2001-01-01T00:00:00+00:00", Qt::ISODate); |
| 72 | const QString commitMessage("Commit A"); |
| 73 | |
| 74 | { |
| 75 | VcsAnnotationLine annotationLineA; |
| 76 | setAnnotationLine(annotationLineA, |
| 77 | lineNumber, text, author, revision, date, commitMessage); |
| 78 | |
| 79 | VcsAnnotationLine annotationLineB(annotationLineA); |
| 80 | compareAnnotationLine(annotationLineA, |
| 81 | lineNumber, text, author, revision, date, commitMessage); |
| 82 | compareAnnotationLine(annotationLineB, |
| 83 | lineNumber, text, author, revision, date, commitMessage); |
| 84 | } |
| 85 | |
| 86 | const int lineNumberNew = 10; |
| 87 | |
| 88 | // test detach after changing A |
| 89 | { |
| 90 | VcsAnnotationLine annotationLineA; |
| 91 | setAnnotationLine(annotationLineA, |
| 92 | lineNumber, text, author, revision, date, commitMessage); |
| 93 | |
| 94 | VcsAnnotationLine annotationLineB(annotationLineA); |
| 95 | // change a property of A |
| 96 | annotationLineA.setLineNumber(lineNumberNew); |
| 97 | |
| 98 | compareAnnotationLine(annotationLineA, |
| 99 | lineNumberNew, text, author, revision, date, commitMessage); |
| 100 | compareAnnotationLine(annotationLineB, |
| 101 | lineNumber, text, author, revision, date, commitMessage); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | void TestVcsAnnotationLine::testAssignOperator() |
| 106 | { |
nothing calls this directly
no test coverage detected