diff options
author | onefang | 2019-05-19 21:24:15 +1000 |
---|---|---|
committer | onefang | 2019-05-19 21:24:15 +1000 |
commit | 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch) | |
tree | a9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Data/Tests/AssetTests.cs | |
parent | Add a build script. (diff) | |
download | opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2 opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz |
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Data/Tests/AssetTests.cs')
-rw-r--r-- | OpenSim/Data/Tests/AssetTests.cs | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/OpenSim/Data/Tests/AssetTests.cs b/OpenSim/Data/Tests/AssetTests.cs index 5d7b169..70880cf 100644 --- a/OpenSim/Data/Tests/AssetTests.cs +++ b/OpenSim/Data/Tests/AssetTests.cs | |||
@@ -110,7 +110,7 @@ namespace OpenSim.Data.Tests | |||
110 | public void T010_StoreReadVerifyAssets() | 110 | public void T010_StoreReadVerifyAssets() |
111 | { | 111 | { |
112 | TestHelpers.InMethod(); | 112 | TestHelpers.InMethod(); |
113 | 113 | ||
114 | AssetBase a1 = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, critter1.ToString()); | 114 | AssetBase a1 = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, critter1.ToString()); |
115 | AssetBase a2 = new AssetBase(uuid2, "asset two", (sbyte)AssetType.Texture, critter2.ToString()); | 115 | AssetBase a2 = new AssetBase(uuid2, "asset two", (sbyte)AssetType.Texture, critter2.ToString()); |
116 | AssetBase a3 = new AssetBase(uuid3, "asset three", (sbyte)AssetType.Texture, critter3.ToString()); | 116 | AssetBase a3 = new AssetBase(uuid3, "asset three", (sbyte)AssetType.Texture, critter3.ToString()); |
@@ -125,14 +125,20 @@ namespace OpenSim.Data.Tests | |||
125 | m_db.StoreAsset(a1); | 125 | m_db.StoreAsset(a1); |
126 | m_db.StoreAsset(a2); | 126 | m_db.StoreAsset(a2); |
127 | m_db.StoreAsset(a3); | 127 | m_db.StoreAsset(a3); |
128 | 128 | a1.UploadAttempts = 0; | |
129 | a2.UploadAttempts = 0; | ||
130 | a3.UploadAttempts = 0; | ||
131 | |||
129 | AssetBase a1a = m_db.GetAsset(uuid1); | 132 | AssetBase a1a = m_db.GetAsset(uuid1); |
133 | a1a.UploadAttempts = 0; | ||
130 | Assert.That(a1a, Constraints.PropertyCompareConstraint(a1)); | 134 | Assert.That(a1a, Constraints.PropertyCompareConstraint(a1)); |
131 | 135 | ||
132 | AssetBase a2a = m_db.GetAsset(uuid2); | 136 | AssetBase a2a = m_db.GetAsset(uuid2); |
137 | a2a.UploadAttempts = 0; | ||
133 | Assert.That(a2a, Constraints.PropertyCompareConstraint(a2)); | 138 | Assert.That(a2a, Constraints.PropertyCompareConstraint(a2)); |
134 | 139 | ||
135 | AssetBase a3a = m_db.GetAsset(uuid3); | 140 | AssetBase a3a = m_db.GetAsset(uuid3); |
141 | a3a.UploadAttempts = 0; | ||
136 | Assert.That(a3a, Constraints.PropertyCompareConstraint(a3)); | 142 | Assert.That(a3a, Constraints.PropertyCompareConstraint(a3)); |
137 | 143 | ||
138 | scrambler.Scramble(a1a); | 144 | scrambler.Scramble(a1a); |
@@ -142,14 +148,20 @@ namespace OpenSim.Data.Tests | |||
142 | m_db.StoreAsset(a1a); | 148 | m_db.StoreAsset(a1a); |
143 | m_db.StoreAsset(a2a); | 149 | m_db.StoreAsset(a2a); |
144 | m_db.StoreAsset(a3a); | 150 | m_db.StoreAsset(a3a); |
151 | a1a.UploadAttempts = 0; | ||
152 | a2a.UploadAttempts = 0; | ||
153 | a3a.UploadAttempts = 0; | ||
145 | 154 | ||
146 | AssetBase a1b = m_db.GetAsset(uuid1); | 155 | AssetBase a1b = m_db.GetAsset(uuid1); |
156 | a1b.UploadAttempts = 0; | ||
147 | Assert.That(a1b, Constraints.PropertyCompareConstraint(a1a)); | 157 | Assert.That(a1b, Constraints.PropertyCompareConstraint(a1a)); |
148 | 158 | ||
149 | AssetBase a2b = m_db.GetAsset(uuid2); | 159 | AssetBase a2b = m_db.GetAsset(uuid2); |
160 | a2b.UploadAttempts = 0; | ||
150 | Assert.That(a2b, Constraints.PropertyCompareConstraint(a2a)); | 161 | Assert.That(a2b, Constraints.PropertyCompareConstraint(a2a)); |
151 | 162 | ||
152 | AssetBase a3b = m_db.GetAsset(uuid3); | 163 | AssetBase a3b = m_db.GetAsset(uuid3); |
164 | a3b.UploadAttempts = 0; | ||
153 | Assert.That(a3b, Constraints.PropertyCompareConstraint(a3a)); | 165 | Assert.That(a3b, Constraints.PropertyCompareConstraint(a3a)); |
154 | 166 | ||
155 | bool[] exist = m_db.AssetsExist(new[] { uuid1, uuid2, uuid3 }); | 167 | bool[] exist = m_db.AssetsExist(new[] { uuid1, uuid2, uuid3 }); |
@@ -178,7 +190,7 @@ namespace OpenSim.Data.Tests | |||
178 | public void T020_CheckForWeirdCreatorID() | 190 | public void T020_CheckForWeirdCreatorID() |
179 | { | 191 | { |
180 | TestHelpers.InMethod(); | 192 | TestHelpers.InMethod(); |
181 | 193 | ||
182 | // It is expected that eventually the CreatorID might be an arbitrary string (an URI) | 194 | // It is expected that eventually the CreatorID might be an arbitrary string (an URI) |
183 | // rather than a valid UUID (?). This test is to make sure that the database layer does not | 195 | // rather than a valid UUID (?). This test is to make sure that the database layer does not |
184 | // attempt to convert CreatorID to GUID, but just passes it both ways as a string. | 196 | // attempt to convert CreatorID to GUID, but just passes it both ways as a string. |
@@ -190,16 +202,22 @@ namespace OpenSim.Data.Tests | |||
190 | a3.Data = data1; | 202 | a3.Data = data1; |
191 | 203 | ||
192 | m_db.StoreAsset(a1); | 204 | m_db.StoreAsset(a1); |
205 | a1.UploadAttempts = 0; | ||
193 | m_db.StoreAsset(a2); | 206 | m_db.StoreAsset(a2); |
207 | a2.UploadAttempts = 0; | ||
194 | m_db.StoreAsset(a3); | 208 | m_db.StoreAsset(a3); |
209 | a3.UploadAttempts = 0; | ||
195 | 210 | ||
196 | AssetBase a1a = m_db.GetAsset(uuid1); | 211 | AssetBase a1a = m_db.GetAsset(uuid1); |
212 | a1a.UploadAttempts = 0; | ||
197 | Assert.That(a1a, Constraints.PropertyCompareConstraint(a1)); | 213 | Assert.That(a1a, Constraints.PropertyCompareConstraint(a1)); |
198 | 214 | ||
199 | AssetBase a2a = m_db.GetAsset(uuid2); | 215 | AssetBase a2a = m_db.GetAsset(uuid2); |
216 | a2a.UploadAttempts = 0; | ||
200 | Assert.That(a2a, Constraints.PropertyCompareConstraint(a2)); | 217 | Assert.That(a2a, Constraints.PropertyCompareConstraint(a2)); |
201 | 218 | ||
202 | AssetBase a3a = m_db.GetAsset(uuid3); | 219 | AssetBase a3a = m_db.GetAsset(uuid3); |
220 | a3a.UploadAttempts = 0; | ||
203 | Assert.That(a3a, Constraints.PropertyCompareConstraint(a3)); | 221 | Assert.That(a3a, Constraints.PropertyCompareConstraint(a3)); |
204 | } | 222 | } |
205 | } | 223 | } |