MCPcopy Create free account
hub / github.com/KDE/kdevelop / testAssignOperator

Method testAssignOperator

kdevplatform/vcs/tests/test_vcslocation.cpp:163–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163void 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
214QTEST_GUILESS_MAIN(TestVcsLocation)
215

Callers

nothing calls this directly

Calls 2

setRepositoryServerMethod · 0.80
QVariantClass · 0.50

Tested by

no test coverage detected