| 103 | } |
| 104 | |
| 105 | void TestVcsAnnotationLine::testAssignOperator() |
| 106 | { |
| 107 | // assign invalid |
| 108 | { |
| 109 | VcsAnnotationLine annotationLineA; |
| 110 | |
| 111 | VcsAnnotationLine annotationLineB; |
| 112 | VcsRevision revision; |
| 113 | revision.setRevisionValue(2, VcsRevision::FileNumber); |
| 114 | annotationLineB.setRevision(revision); |
| 115 | |
| 116 | annotationLineB = annotationLineA; |
| 117 | |
| 118 | QCOMPARE(annotationLineA.revision().revisionType(), VcsRevision::Invalid); |
| 119 | QCOMPARE(annotationLineB.revision().revisionType(), VcsRevision::Invalid); |
| 120 | } |
| 121 | |
| 122 | // test plain assign |
| 123 | const int lineNumber = 1; |
| 124 | const QString text("Text A"); |
| 125 | const QString author("Author A"); |
| 126 | VcsRevision revision; |
| 127 | revision.setRevisionValue("A", VcsRevision::GlobalNumber); |
| 128 | const QDateTime date = QDateTime::fromString("2001-01-01T00:00:00+00:00", Qt::ISODate); |
| 129 | const QString commitMessage("Commit A"); |
| 130 | |
| 131 | { |
| 132 | VcsAnnotationLine annotationLineA; |
| 133 | setAnnotationLine(annotationLineA, |
| 134 | lineNumber, text, author, revision, date, commitMessage); |
| 135 | |
| 136 | VcsAnnotationLine annotationLineB; |
| 137 | annotationLineB = annotationLineA; |
| 138 | |
| 139 | compareAnnotationLine(annotationLineA, |
| 140 | lineNumber, text, author, revision, date, commitMessage); |
| 141 | compareAnnotationLine(annotationLineB, |
| 142 | lineNumber, text, author, revision, date, commitMessage); |
| 143 | } |
| 144 | |
| 145 | const int lineNumberNew = 10; |
| 146 | |
| 147 | // test detach after changing A |
| 148 | { |
| 149 | VcsAnnotationLine annotationLineA; |
| 150 | setAnnotationLine(annotationLineA, |
| 151 | lineNumber, text, author, revision, date, commitMessage); |
| 152 | |
| 153 | VcsAnnotationLine annotationLineB; |
| 154 | annotationLineB = annotationLineA; |
| 155 | // change a property of A |
| 156 | annotationLineA.setLineNumber(lineNumberNew); |
| 157 | |
| 158 | compareAnnotationLine(annotationLineA, |
| 159 | lineNumberNew, text, author, revision, date, commitMessage); |
| 160 | compareAnnotationLine(annotationLineB, |
| 161 | lineNumber, text, author, revision, date, commitMessage); |
| 162 | } |
nothing calls this directly
no test coverage detected