| 88 | } |
| 89 | |
| 90 | void TestVcsItemEvent::testAssignOperator() |
| 91 | { |
| 92 | // test plain assign |
| 93 | const QString repositoryLocation("location"); |
| 94 | const QString repositoryCopySourceLocation("copy source location"); |
| 95 | VcsRevision repositoryCopySourceRevision; |
| 96 | repositoryCopySourceRevision.setRevisionValue("A", VcsRevision::GlobalNumber); |
| 97 | const VcsItemEvent::Actions actions = VcsItemEvent::Added; |
| 98 | |
| 99 | { |
| 100 | VcsItemEvent itemEventA; |
| 101 | setItemEvent(itemEventA, |
| 102 | repositoryLocation, repositoryCopySourceLocation, repositoryCopySourceRevision, actions); |
| 103 | |
| 104 | VcsItemEvent itemEventB; |
| 105 | itemEventB = itemEventA; |
| 106 | |
| 107 | compareItemEvent(itemEventA, |
| 108 | repositoryLocation, repositoryCopySourceLocation, repositoryCopySourceRevision, |
| 109 | actions); |
| 110 | compareItemEvent(itemEventB, |
| 111 | repositoryLocation, repositoryCopySourceLocation, repositoryCopySourceRevision, |
| 112 | actions); |
| 113 | } |
| 114 | |
| 115 | const QString repositoryLocationNew("new location"); |
| 116 | |
| 117 | // test detach after changing A |
| 118 | { |
| 119 | VcsItemEvent itemEventA; |
| 120 | setItemEvent(itemEventA, |
| 121 | repositoryLocation, repositoryCopySourceLocation, repositoryCopySourceRevision, actions); |
| 122 | |
| 123 | VcsItemEvent itemEventB; |
| 124 | itemEventB = itemEventA; |
| 125 | // change a property of A |
| 126 | itemEventA.setRepositoryLocation(repositoryLocationNew); |
| 127 | |
| 128 | compareItemEvent(itemEventA, |
| 129 | repositoryLocationNew, repositoryCopySourceLocation, repositoryCopySourceRevision, |
| 130 | actions); |
| 131 | compareItemEvent(itemEventB, |
| 132 | repositoryLocation, repositoryCopySourceLocation, repositoryCopySourceRevision, |
| 133 | actions); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | QTEST_GUILESS_MAIN(TestVcsItemEvent) |
| 138 |
nothing calls this directly
no test coverage detected