| 161 | } |
| 162 | |
| 163 | void TestVcsLocation::testAssignOperator() |
| 164 | { |
| 165 | // test plain copy |
| 166 | const QString repositoryServer = QStringLiteral("server"); |
| 167 | const QString repositoryModule = QStringLiteral("module"); |
| 168 | const QString repositoryBranch = QStringLiteral("branch"); |
| 169 | const QString repositoryTag = QStringLiteral("tag"); |
| 170 | const QString repositoryPath = QStringLiteral("path"); |
| 171 | const QVariant userData = QVariant(QStringLiteral("userdata")); |
| 172 | |
| 173 | { |
| 174 | VcsLocation serverLocationA(repositoryServer); |
| 175 | setServerLocation(serverLocationA, |
| 176 | repositoryModule, repositoryBranch, repositoryTag, repositoryPath, userData); |
| 177 | |
| 178 | VcsLocation serverLocationB; |
| 179 | serverLocationB = serverLocationA; |
| 180 | compareServerLocation(serverLocationA, |
| 181 | repositoryServer, repositoryModule, repositoryBranch, repositoryTag, repositoryPath, |
| 182 | userData); |
| 183 | compareServerLocation(serverLocationB, |
| 184 | repositoryServer, repositoryModule, repositoryBranch, repositoryTag, repositoryPath, |
| 185 | userData); |
| 186 | QVERIFY(serverLocationB == serverLocationA); |
| 187 | QVERIFY(serverLocationA == serverLocationB); |
| 188 | } |
| 189 | |
| 190 | const QString repositoryServerNew = QStringLiteral("servernew"); |
| 191 | |
| 192 | // test detach after changing A |
| 193 | { |
| 194 | VcsLocation serverLocationA(repositoryServer); |
| 195 | setServerLocation(serverLocationA, |
| 196 | repositoryModule, repositoryBranch, repositoryTag, repositoryPath, userData); |
| 197 | |
| 198 | VcsLocation serverLocationB; |
| 199 | serverLocationB = serverLocationA; |
| 200 | // change a property of A |
| 201 | serverLocationA.setRepositoryServer(repositoryServerNew); |
| 202 | |
| 203 | compareServerLocation(serverLocationA, |
| 204 | repositoryServerNew, repositoryModule, repositoryBranch, repositoryTag, repositoryPath, |
| 205 | userData); |
| 206 | compareServerLocation(serverLocationB, |
| 207 | repositoryServer, repositoryModule, repositoryBranch, repositoryTag, repositoryPath, |
| 208 | userData); |
| 209 | QVERIFY(!(serverLocationB == serverLocationA)); |
| 210 | QVERIFY(!(serverLocationA == serverLocationB)); |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | QTEST_GUILESS_MAIN(TestVcsLocation) |
| 215 |
nothing calls this directly
no test coverage detected