diff options
author | Sean Dague | 2008-12-03 19:19:39 +0000 |
---|---|---|
committer | Sean Dague | 2008-12-03 19:19:39 +0000 |
commit | b2ab15ba34356fbcef040e654fe3838eecd61695 (patch) | |
tree | 1860cc3298f181b4833df1e87c4117853d089934 /OpenSim | |
parent | From: Christopher Yeoh <cyeoh@au1.ibm.com> (diff) | |
download | opensim-SC_OLD-b2ab15ba34356fbcef040e654fe3838eecd61695.zip opensim-SC_OLD-b2ab15ba34356fbcef040e654fe3838eecd61695.tar.gz opensim-SC_OLD-b2ab15ba34356fbcef040e654fe3838eecd61695.tar.bz2 opensim-SC_OLD-b2ab15ba34356fbcef040e654fe3838eecd61695.tar.xz |
Extends Avatar Appearance tests
From: Arthur Rodrigo S Valadares <arthursv@linux.vnet.ibm.com>
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Data/Tests/BasicUserTest.cs | 110 |
1 files changed, 109 insertions, 1 deletions
diff --git a/OpenSim/Data/Tests/BasicUserTest.cs b/OpenSim/Data/Tests/BasicUserTest.cs index 3bc02f7..bfe5976 100644 --- a/OpenSim/Data/Tests/BasicUserTest.cs +++ b/OpenSim/Data/Tests/BasicUserTest.cs | |||
@@ -438,6 +438,7 @@ namespace OpenSim.Data.Tests | |||
438 | UUID secureagent = UUID.Random(); | 438 | UUID secureagent = UUID.Random(); |
439 | string agentip = RandomName(); | 439 | string agentip = RandomName(); |
440 | uint agentport = (uint)random.Next(); | 440 | uint agentport = (uint)random.Next(); |
441 | bool agentonline = (random.NextDouble() > 0.5); | ||
441 | int logintime = random.Next(); | 442 | int logintime = random.Next(); |
442 | int logouttime = random.Next(); | 443 | int logouttime = random.Next(); |
443 | UUID regionid = UUID.Random(); | 444 | UUID regionid = UUID.Random(); |
@@ -452,6 +453,7 @@ namespace OpenSim.Data.Tests | |||
452 | a.SecureSessionID = secureagent; | 453 | a.SecureSessionID = secureagent; |
453 | a.AgentIP = agentip; | 454 | a.AgentIP = agentip; |
454 | a.AgentPort = agentport; | 455 | a.AgentPort = agentport; |
456 | a.AgentOnline = agentonline; | ||
455 | a.LoginTime = logintime; | 457 | a.LoginTime = logintime; |
456 | a.LogoutTime = logouttime; | 458 | a.LogoutTime = logouttime; |
457 | a.Region = regionid; | 459 | a.Region = regionid; |
@@ -468,6 +470,7 @@ namespace OpenSim.Data.Tests | |||
468 | Assert.That(secureagent,Is.EqualTo(a1.SecureSessionID)); | 470 | Assert.That(secureagent,Is.EqualTo(a1.SecureSessionID)); |
469 | Assert.That(agentip,Is.EqualTo(a1.AgentIP)); | 471 | Assert.That(agentip,Is.EqualTo(a1.AgentIP)); |
470 | Assert.That(agentport,Is.EqualTo(a1.AgentPort)); | 472 | Assert.That(agentport,Is.EqualTo(a1.AgentPort)); |
473 | Assert.That(agentonline,Is.EqualTo(a1.AgentOnline)); | ||
471 | Assert.That(logintime,Is.EqualTo(a1.LoginTime)); | 474 | Assert.That(logintime,Is.EqualTo(a1.LoginTime)); |
472 | Assert.That(logouttime,Is.EqualTo(a1.LogoutTime)); | 475 | Assert.That(logouttime,Is.EqualTo(a1.LogoutTime)); |
473 | Assert.That(regionid,Is.EqualTo(a1.Region)); | 476 | Assert.That(regionid,Is.EqualTo(a1.Region)); |
@@ -542,6 +545,111 @@ namespace OpenSim.Data.Tests | |||
542 | AvatarAppearance user1app = db.GetUserAppearance(user1); | 545 | AvatarAppearance user1app = db.GetUserAppearance(user1); |
543 | Assert.That(user1,Is.EqualTo(user1app.Owner)); | 546 | Assert.That(user1,Is.EqualTo(user1app.Owner)); |
544 | } | 547 | } |
548 | |||
549 | [Test] | ||
550 | public void T041_UserAppearancePersistency() | ||
551 | { | ||
552 | AvatarAppearance appear = new AvatarAppearance(); | ||
553 | UUID owner = UUID.Random(); | ||
554 | int serial = random.Next(); | ||
555 | byte[] visualp = new byte[218]; | ||
556 | random.NextBytes(visualp); | ||
557 | UUID bodyitem = UUID.Random(); | ||
558 | UUID bodyasset = UUID.Random(); | ||
559 | UUID skinitem = UUID.Random(); | ||
560 | UUID skinasset = UUID.Random(); | ||
561 | UUID hairitem = UUID.Random(); | ||
562 | UUID hairasset = UUID.Random(); | ||
563 | UUID eyesitem = UUID.Random(); | ||
564 | UUID eyesasset = UUID.Random(); | ||
565 | UUID shirtitem = UUID.Random(); | ||
566 | UUID shirtasset = UUID.Random(); | ||
567 | UUID pantsitem = UUID.Random(); | ||
568 | UUID pantsasset = UUID.Random(); | ||
569 | UUID shoesitem = UUID.Random(); | ||
570 | UUID shoesasset = UUID.Random(); | ||
571 | UUID socksitem = UUID.Random(); | ||
572 | UUID socksasset = UUID.Random(); | ||
573 | UUID jacketitem = UUID.Random(); | ||
574 | UUID jacketasset = UUID.Random(); | ||
575 | UUID glovesitem = UUID.Random(); | ||
576 | UUID glovesasset = UUID.Random(); | ||
577 | UUID ushirtitem = UUID.Random(); | ||
578 | UUID ushirtasset = UUID.Random(); | ||
579 | UUID upantsitem = UUID.Random(); | ||
580 | UUID upantsasset = UUID.Random(); | ||
581 | UUID skirtitem = UUID.Random(); | ||
582 | UUID skirtasset = UUID.Random(); | ||
583 | Primitive.TextureEntry texture = AvatarAppearance.GetDefaultTexture(); | ||
584 | float avatarheight = (float) (Math.Round(random.NextDouble(),5)); | ||
585 | |||
586 | appear.Owner = owner; | ||
587 | appear.Serial = serial; | ||
588 | appear.VisualParams = visualp; | ||
589 | appear.BodyItem = bodyitem; | ||
590 | appear.BodyAsset = bodyasset; | ||
591 | appear.SkinItem = skinitem; | ||
592 | appear.SkinAsset = skinasset; | ||
593 | appear.HairItem = hairitem; | ||
594 | appear.HairAsset = hairasset; | ||
595 | appear.EyesItem = eyesitem; | ||
596 | appear.EyesAsset = eyesasset; | ||
597 | appear.ShirtItem = shirtitem; | ||
598 | appear.ShirtAsset = shirtasset; | ||
599 | appear.PantsItem = pantsitem; | ||
600 | appear.PantsAsset = pantsasset; | ||
601 | appear.ShoesItem = shoesitem; | ||
602 | appear.ShoesAsset = shoesasset; | ||
603 | appear.SocksItem = socksitem; | ||
604 | appear.SocksAsset = socksasset; | ||
605 | appear.JacketItem = jacketitem; | ||
606 | appear.JacketAsset = jacketasset; | ||
607 | appear.GlovesItem = glovesitem; | ||
608 | appear.GlovesAsset = glovesasset; | ||
609 | appear.UnderShirtItem = ushirtitem; | ||
610 | appear.UnderShirtAsset = ushirtasset; | ||
611 | appear.UnderPantsItem = upantsitem; | ||
612 | appear.UnderPantsAsset = upantsasset; | ||
613 | appear.SkirtItem = skirtitem; | ||
614 | appear.SkirtAsset = skirtasset; | ||
615 | appear.Texture = texture; | ||
616 | appear.AvatarHeight = avatarheight; | ||
617 | |||
618 | db.UpdateUserAppearance(owner, appear); | ||
619 | AvatarAppearance app = db.GetUserAppearance(owner); | ||
620 | |||
621 | Assert.That(owner,Is.EqualTo(app.Owner)); | ||
622 | Assert.That(serial,Is.EqualTo(app.Serial)); | ||
623 | Assert.That(visualp,Is.EqualTo(app.VisualParams)); | ||
624 | Assert.That(bodyitem,Is.EqualTo(app.BodyItem)); | ||
625 | Assert.That(bodyasset,Is.EqualTo(app.BodyAsset)); | ||
626 | Assert.That(skinitem,Is.EqualTo(app.SkinItem)); | ||
627 | Assert.That(skinasset,Is.EqualTo(app.SkinAsset)); | ||
628 | Assert.That(hairitem,Is.EqualTo(app.HairItem)); | ||
629 | Assert.That(hairasset,Is.EqualTo(app.HairAsset)); | ||
630 | Assert.That(eyesitem,Is.EqualTo(app.EyesItem)); | ||
631 | Assert.That(eyesasset,Is.EqualTo(app.EyesAsset)); | ||
632 | Assert.That(shirtitem,Is.EqualTo(app.ShirtItem)); | ||
633 | Assert.That(shirtasset,Is.EqualTo(app.ShirtAsset)); | ||
634 | Assert.That(pantsitem,Is.EqualTo(app.PantsItem)); | ||
635 | Assert.That(pantsasset,Is.EqualTo(app.PantsAsset)); | ||
636 | Assert.That(shoesitem,Is.EqualTo(app.ShoesItem)); | ||
637 | Assert.That(shoesasset,Is.EqualTo(app.ShoesAsset)); | ||
638 | Assert.That(socksitem,Is.EqualTo(app.SocksItem)); | ||
639 | Assert.That(socksasset,Is.EqualTo(app.SocksAsset)); | ||
640 | Assert.That(jacketitem,Is.EqualTo(app.JacketItem)); | ||
641 | Assert.That(jacketasset,Is.EqualTo(app.JacketAsset)); | ||
642 | Assert.That(glovesitem,Is.EqualTo(app.GlovesItem)); | ||
643 | Assert.That(glovesasset,Is.EqualTo(app.GlovesAsset)); | ||
644 | Assert.That(ushirtitem,Is.EqualTo(app.UnderShirtItem)); | ||
645 | Assert.That(ushirtasset,Is.EqualTo(app.UnderShirtAsset)); | ||
646 | Assert.That(upantsitem,Is.EqualTo(app.UnderPantsItem)); | ||
647 | Assert.That(upantsasset,Is.EqualTo(app.UnderPantsAsset)); | ||
648 | Assert.That(skirtitem,Is.EqualTo(app.SkirtItem)); | ||
649 | Assert.That(skirtasset,Is.EqualTo(app.SkirtAsset)); | ||
650 | Assert.That(texture.ToString(),Is.EqualTo(app.Texture.ToString())); | ||
651 | Assert.That(avatarheight,Is.EqualTo(app.AvatarHeight)); | ||
652 | } | ||
545 | 653 | ||
546 | public UserProfileData NewUser(UUID id,string fname,string lname) | 654 | public UserProfileData NewUser(UUID id,string fname,string lname) |
547 | { | 655 | { |
@@ -577,6 +685,6 @@ namespace OpenSim.Data.Tests | |||
577 | name.Append(ch); | 685 | name.Append(ch); |
578 | } | 686 | } |
579 | return name.ToString(); | 687 | return name.ToString(); |
580 | } | 688 | } |
581 | } | 689 | } |
582 | } | 690 | } |