| 198 | } |
| 199 | |
| 200 | void TestVcsDiff::testAssignOperator() |
| 201 | { |
| 202 | // test plain copy |
| 203 | const QString diffString("diff"); |
| 204 | const QUrl baseDiff("git://1"); |
| 205 | const uint depth = 1; |
| 206 | const VcsLocation location("server"); |
| 207 | |
| 208 | { |
| 209 | VcsDiff diffA; |
| 210 | setDiff(diffA, |
| 211 | diffString, baseDiff, depth); |
| 212 | |
| 213 | VcsDiff diffB; |
| 214 | diffB = diffA; |
| 215 | compareDiff(diffA, |
| 216 | diffString, baseDiff, depth); |
| 217 | compareDiff(diffB, |
| 218 | diffString, baseDiff, depth); |
| 219 | } |
| 220 | |
| 221 | const QString diffStringNew("diffNew"); |
| 222 | |
| 223 | // test detach after changing A |
| 224 | { |
| 225 | VcsDiff diffA; |
| 226 | setDiff(diffA, |
| 227 | diffString, baseDiff, depth); |
| 228 | |
| 229 | VcsDiff diffB; |
| 230 | diffB = diffA; |
| 231 | // change a property of A |
| 232 | diffA.setDiff(diffStringNew); |
| 233 | |
| 234 | compareDiff(diffA, |
| 235 | diffStringNew, baseDiff, depth); |
| 236 | compareDiff(diffB, |
| 237 | diffString, baseDiff, depth); |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | QTEST_GUILESS_MAIN(TestVcsDiff) |
| 242 | |