| 159 | |
| 160 | |
| 161 | void TestVcsDiff::testCopyConstructor() |
| 162 | { |
| 163 | // test plain copy |
| 164 | const QString diffString("diff"); |
| 165 | const QUrl baseDiff("git://1"); |
| 166 | const uint depth = 1; |
| 167 | const VcsLocation location("server"); |
| 168 | |
| 169 | { |
| 170 | VcsDiff diffA; |
| 171 | setDiff(diffA, |
| 172 | diffString, baseDiff, depth); |
| 173 | |
| 174 | VcsDiff diffB(diffA); |
| 175 | compareDiff(diffA, |
| 176 | diffString, baseDiff, depth); |
| 177 | compareDiff(diffB, |
| 178 | diffString, baseDiff, depth); |
| 179 | } |
| 180 | |
| 181 | const QString diffStringNew("diffNew"); |
| 182 | |
| 183 | // test detach after changing A |
| 184 | { |
| 185 | VcsDiff diffA; |
| 186 | setDiff(diffA, |
| 187 | diffString, baseDiff, depth); |
| 188 | |
| 189 | VcsDiff diffB(diffA); |
| 190 | // change a property of A |
| 191 | diffA.setDiff(diffStringNew); |
| 192 | |
| 193 | compareDiff(diffA, |
| 194 | diffStringNew, baseDiff, depth); |
| 195 | compareDiff(diffB, |
| 196 | diffString, baseDiff, depth); |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | void TestVcsDiff::testAssignOperator() |
| 201 | { |