diff options
author | Sean Dague | 2008-11-18 12:48:36 +0000 |
---|---|---|
committer | Sean Dague | 2008-11-18 12:48:36 +0000 |
commit | 5517ea3dfd9201217a829eadc38d20030bd65117 (patch) | |
tree | b6489909b3abba8fb76f20d070851ae7a0299730 /OpenSim/Data/Tests | |
parent | Extended Agent Tests (diff) | |
download | opensim-SC_OLD-5517ea3dfd9201217a829eadc38d20030bd65117.zip opensim-SC_OLD-5517ea3dfd9201217a829eadc38d20030bd65117.tar.gz opensim-SC_OLD-5517ea3dfd9201217a829eadc38d20030bd65117.tar.bz2 opensim-SC_OLD-5517ea3dfd9201217a829eadc38d20030bd65117.tar.xz |
Fixed MySQL and SQLite so they will save the
variable sun vector, adding 3 new fields on both.
From: Arthur Rodrigo S Valadares <arthursv@linux.vnet.ibm.com>
Diffstat (limited to 'OpenSim/Data/Tests')
-rw-r--r-- | OpenSim/Data/Tests/BasicRegionTest.cs | 148 |
1 files changed, 139 insertions, 9 deletions
diff --git a/OpenSim/Data/Tests/BasicRegionTest.cs b/OpenSim/Data/Tests/BasicRegionTest.cs index ff8f8c3..a7d62d0 100644 --- a/OpenSim/Data/Tests/BasicRegionTest.cs +++ b/OpenSim/Data/Tests/BasicRegionTest.cs | |||
@@ -467,7 +467,52 @@ namespace OpenSim.Data.Tests | |||
467 | Assert.That(clickaction,Is.EqualTo(p.ClickAction)); | 467 | Assert.That(clickaction,Is.EqualTo(p.ClickAction)); |
468 | Assert.That(scale,Is.EqualTo(p.Scale)); | 468 | Assert.That(scale,Is.EqualTo(p.Scale)); |
469 | } | 469 | } |
470 | 470 | ||
471 | [Test] | ||
472 | public void T015_LargeSceneObjects() | ||
473 | { | ||
474 | UUID id = UUID.Random(); | ||
475 | Dictionary<UUID, SceneObjectPart> mydic = new Dictionary<UUID, SceneObjectPart>(); | ||
476 | SceneObjectGroup sog = NewSOG("Test SOG",id); | ||
477 | mydic.Add(sog.RootPart.UUID,sog.RootPart); | ||
478 | Console.WriteLine("Let's Start!"); | ||
479 | for (int i=0;i<30;i++) | ||
480 | { | ||
481 | UUID tmp = UUID.Random(); | ||
482 | SceneObjectPart sop = NewSOP(("Test SOP " + i.ToString()),tmp); | ||
483 | Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next()); | ||
484 | Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next()); | ||
485 | Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next()); | ||
486 | Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next()); | ||
487 | Vector3 angvelo = new Vector3(random.Next(),random.Next(),random.Next()); | ||
488 | Vector3 accel = new Vector3(random.Next(),random.Next(),random.Next()); | ||
489 | |||
490 | sop.GroupPosition = groupos; | ||
491 | sop.RotationOffset = rotoff; | ||
492 | sop.OffsetPosition = offset; | ||
493 | sop.Velocity = velocity; | ||
494 | sop.AngularVelocity = angvelo; | ||
495 | sop.Acceleration = accel; | ||
496 | |||
497 | mydic.Add(tmp,sop); | ||
498 | sog.AddPart(sop); | ||
499 | db.StoreObject(sog, region4); | ||
500 | } | ||
501 | |||
502 | SceneObjectGroup retsog = FindSOG("Test SOG", region4); | ||
503 | SceneObjectPart[] parts = retsog.GetParts(); | ||
504 | for (int i=0;i<30;i++) | ||
505 | { | ||
506 | SceneObjectPart cursop = mydic[parts[i].UUID]; | ||
507 | Assert.That(cursop.GroupPosition,Is.EqualTo(parts[i].GroupPosition)); | ||
508 | Assert.That(cursop.RotationOffset,Is.EqualTo(parts[i].RotationOffset)); | ||
509 | Assert.That(cursop.OffsetPosition,Is.EqualTo(parts[i].OffsetPosition)); | ||
510 | Assert.That(cursop.Velocity,Is.EqualTo(parts[i].Velocity)); | ||
511 | Assert.That(cursop.AngularVelocity,Is.EqualTo(parts[i].AngularVelocity)); | ||
512 | Assert.That(cursop.Acceleration,Is.EqualTo(parts[i].Acceleration)); | ||
513 | } | ||
514 | } | ||
515 | |||
471 | [Test] | 516 | [Test] |
472 | public void T020_PrimInventoryEmpty() | 517 | public void T020_PrimInventoryEmpty() |
473 | { | 518 | { |
@@ -660,21 +705,106 @@ namespace OpenSim.Data.Tests | |||
660 | [Test] | 705 | [Test] |
661 | public void T101_UpdateRegionInfo() | 706 | public void T101_UpdateRegionInfo() |
662 | { | 707 | { |
663 | bool blockfly = true; | 708 | int agentlimit = random.Next(); |
664 | double sunpos = 0.5; | 709 | double objectbonus = random.NextDouble(); |
710 | int maturity = random.Next(); | ||
711 | UUID tertex1 = UUID.Random(); | ||
712 | UUID tertex2 = UUID.Random(); | ||
713 | UUID tertex3 = UUID.Random(); | ||
714 | UUID tertex4 = UUID.Random(); | ||
715 | double elev1nw = random.NextDouble(); | ||
716 | double elev2nw = random.NextDouble(); | ||
717 | double elev1ne = random.NextDouble(); | ||
718 | double elev2ne = random.NextDouble(); | ||
719 | double elev1se = random.NextDouble(); | ||
720 | double elev2se = random.NextDouble(); | ||
721 | double elev1sw = random.NextDouble(); | ||
722 | double elev2sw = random.NextDouble(); | ||
723 | double waterh = random.NextDouble(); | ||
724 | double terrainraise = random.NextDouble(); | ||
725 | double terrainlower = random.NextDouble(); | ||
726 | Vector3 sunvector = new Vector3((float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5)); | ||
727 | UUID terimgid = UUID.Random(); | ||
728 | double sunpos = random.NextDouble(); | ||
665 | UUID cov = UUID.Random(); | 729 | UUID cov = UUID.Random(); |
666 | 730 | ||
667 | RegionSettings r1 = db.LoadRegionSettings(region1); | 731 | RegionSettings r1 = db.LoadRegionSettings(region1); |
668 | r1.BlockFly = blockfly; | 732 | r1.BlockTerraform = true; |
733 | r1.BlockFly = true; | ||
734 | r1.AllowDamage = true; | ||
735 | r1.RestrictPushing = true; | ||
736 | r1.AllowLandResell = false; | ||
737 | r1.AllowLandJoinDivide = false; | ||
738 | r1.BlockShowInSearch = true; | ||
739 | r1.AgentLimit = agentlimit; | ||
740 | r1.ObjectBonus = objectbonus; | ||
741 | r1.Maturity = maturity; | ||
742 | r1.DisableScripts = true; | ||
743 | r1.DisableCollisions = true; | ||
744 | r1.DisablePhysics = true; | ||
745 | r1.TerrainTexture1 = tertex1; | ||
746 | r1.TerrainTexture2 = tertex2; | ||
747 | r1.TerrainTexture3 = tertex3; | ||
748 | r1.TerrainTexture4 = tertex4; | ||
749 | r1.Elevation1NW = elev1nw; | ||
750 | r1.Elevation2NW = elev2nw; | ||
751 | r1.Elevation1NE = elev1ne; | ||
752 | r1.Elevation2NE = elev2ne; | ||
753 | r1.Elevation1SE = elev1se; | ||
754 | r1.Elevation2SE = elev2se; | ||
755 | r1.Elevation1SW = elev1sw; | ||
756 | r1.Elevation2SW = elev2sw; | ||
757 | r1.WaterHeight = waterh; | ||
758 | r1.TerrainRaiseLimit = terrainraise; | ||
759 | r1.TerrainLowerLimit = terrainlower; | ||
760 | r1.UseEstateSun = false; | ||
761 | r1.Sandbox = true; | ||
762 | r1.SunVector = sunvector; | ||
763 | r1.TerrainImageID = terimgid; | ||
764 | r1.FixedSun = true; | ||
669 | r1.SunPosition = sunpos; | 765 | r1.SunPosition = sunpos; |
670 | r1.Covenant = cov; | 766 | r1.Covenant = cov; |
767 | |||
671 | db.StoreRegionSettings(r1); | 768 | db.StoreRegionSettings(r1); |
672 | 769 | ||
673 | RegionSettings r2 = db.LoadRegionSettings(region1); | 770 | RegionSettings r1a = db.LoadRegionSettings(region1); |
674 | Assert.That(r2.RegionUUID, Is.EqualTo(region1)); | 771 | Assert.That(r1a.RegionUUID, Is.EqualTo(region1)); |
675 | Assert.That(r2.SunPosition, Is.EqualTo(sunpos)); | 772 | Assert.That(r1a.BlockTerraform,Is.True); |
676 | Assert.That(r2.BlockFly, Is.EqualTo(blockfly)); | 773 | Assert.That(r1a.BlockFly,Is.True); |
677 | Assert.That(r2.Covenant, Is.EqualTo(cov)); | 774 | Assert.That(r1a.AllowDamage,Is.True); |
775 | Assert.That(r1a.RestrictPushing,Is.True); | ||
776 | Assert.That(r1a.AllowLandResell,Is.False); | ||
777 | Assert.That(r1a.AllowLandJoinDivide,Is.False); | ||
778 | Assert.That(r1a.BlockShowInSearch,Is.True); | ||
779 | Assert.That(r1a.AgentLimit,Is.EqualTo(agentlimit)); | ||
780 | Assert.That(r1a.ObjectBonus,Is.EqualTo(objectbonus)); | ||
781 | Assert.That(r1a.Maturity,Is.EqualTo(maturity)); | ||
782 | Assert.That(r1a.DisableScripts,Is.True); | ||
783 | Assert.That(r1a.DisableCollisions,Is.True); | ||
784 | Assert.That(r1a.DisablePhysics,Is.True); | ||
785 | Assert.That(r1a.TerrainTexture1,Is.EqualTo(tertex1)); | ||
786 | Assert.That(r1a.TerrainTexture2,Is.EqualTo(tertex2)); | ||
787 | Assert.That(r1a.TerrainTexture3,Is.EqualTo(tertex3)); | ||
788 | Assert.That(r1a.TerrainTexture4,Is.EqualTo(tertex4)); | ||
789 | Assert.That(r1a.Elevation1NW,Is.EqualTo(elev1nw)); | ||
790 | Assert.That(r1a.Elevation2NW,Is.EqualTo(elev2nw)); | ||
791 | Assert.That(r1a.Elevation1NE,Is.EqualTo(elev1ne)); | ||
792 | Assert.That(r1a.Elevation2NE,Is.EqualTo(elev2ne)); | ||
793 | Assert.That(r1a.Elevation1SE,Is.EqualTo(elev1se)); | ||
794 | Assert.That(r1a.Elevation2SE,Is.EqualTo(elev2se)); | ||
795 | Assert.That(r1a.Elevation1SW,Is.EqualTo(elev1sw)); | ||
796 | Assert.That(r1a.Elevation2SW,Is.EqualTo(elev2sw)); | ||
797 | Assert.That(r1a.WaterHeight,Is.EqualTo(waterh)); | ||
798 | Assert.That(r1a.TerrainRaiseLimit,Is.EqualTo(terrainraise)); | ||
799 | Assert.That(r1a.TerrainLowerLimit,Is.EqualTo(terrainlower)); | ||
800 | Assert.That(r1a.UseEstateSun,Is.False); | ||
801 | Assert.That(r1a.Sandbox,Is.True); | ||
802 | Assert.That(r1a.SunVector,Is.EqualTo(sunvector)); | ||
803 | //Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid)); | ||
804 | Assert.That(r1a.FixedSun,Is.True); | ||
805 | Assert.That(r1a.SunPosition, Is.EqualTo(sunpos)); | ||
806 | Assert.That(r1a.Covenant, Is.EqualTo(cov)); | ||
807 | |||
678 | } | 808 | } |
679 | 809 | ||
680 | [Test] | 810 | [Test] |