Scrambled asset type in BasicAssetTest.cs!
The asset type wasn't in the list of "DontScramble" fields, so the test assets were stored with randomized type, which caused exception on reading them. Also the scrambler was moved from local var to the class level, so it could be used in the new tests I've added (see the next commit).soprefactor
parent
64fe823b92
commit
d6a6668bd7
|
@ -43,6 +43,7 @@ namespace OpenSim.Data.Tests
|
|||
public UUID uuid2;
|
||||
public UUID uuid3;
|
||||
public byte[] asset1;
|
||||
PropertyScrambler<AssetBase> scrambler;
|
||||
|
||||
public void SuperInit()
|
||||
{
|
||||
|
@ -53,6 +54,15 @@ namespace OpenSim.Data.Tests
|
|||
uuid3 = UUID.Random();
|
||||
asset1 = new byte[100];
|
||||
asset1.Initialize();
|
||||
|
||||
scrambler = new PropertyScrambler<AssetBase>()
|
||||
.DontScramble(x => x.ID)
|
||||
.DontScramble(x => x.FullID)
|
||||
.DontScramble(x => x.Metadata.ID)
|
||||
.DontScramble(x => x.Metadata.Type)
|
||||
.DontScramble(x => x.Metadata.CreatorID)
|
||||
.DontScramble(x => x.Metadata.ContentType)
|
||||
.DontScramble(x => x.Metadata.FullID);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -73,15 +83,6 @@ namespace OpenSim.Data.Tests
|
|||
a2.Data = asset1;
|
||||
a3.Data = asset1;
|
||||
|
||||
PropertyScrambler<AssetBase> scrambler = new PropertyScrambler<AssetBase>()
|
||||
.DontScramble(x => x.Data)
|
||||
.DontScramble(x => x.ID)
|
||||
.DontScramble(x => x.FullID)
|
||||
.DontScramble(x => x.Metadata.ID)
|
||||
.DontScramble(x => x.Metadata.CreatorID)
|
||||
.DontScramble(x => x.Metadata.ContentType)
|
||||
.DontScramble(x => x.Metadata.FullID);
|
||||
|
||||
scrambler.Scramble(a1);
|
||||
scrambler.Scramble(a2);
|
||||
scrambler.Scramble(a3);
|
||||
|
|
Loading…
Reference in New Issue