diff options
author | Jeff Ames | 2009-08-17 10:29:06 +0900 |
---|---|---|
committer | Jeff Ames | 2009-08-17 10:29:06 +0900 |
commit | 82c888fc6c103ec345bf656cd469f4260b678bcb (patch) | |
tree | e36ea04103469ba31501e7a7fe3b10e5e856dbe5 /OpenSim/Data | |
parent | Add UUIDs in bin/ScriptEngines to .gitignore. (diff) | |
download | opensim-SC_OLD-82c888fc6c103ec345bf656cd469f4260b678bcb.zip opensim-SC_OLD-82c888fc6c103ec345bf656cd469f4260b678bcb.tar.gz opensim-SC_OLD-82c888fc6c103ec345bf656cd469f4260b678bcb.tar.bz2 opensim-SC_OLD-82c888fc6c103ec345bf656cd469f4260b678bcb.tar.xz |
Add copyright headers. Formatting cleanup. Fix a compiler warning.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLInventoryData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteInventoryStore.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/Tests/BasicGridTest.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/Tests/PropertyCompareConstraint.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/Tests/PropertyScrambler.cs | 35 |
5 files changed, 35 insertions, 8 deletions
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 849c246..4521a0f 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs | |||
@@ -439,7 +439,7 @@ namespace OpenSim.Data.MySQL | |||
439 | MySqlDataReader reader = result.ExecuteReader(); | 439 | MySqlDataReader reader = result.ExecuteReader(); |
440 | 440 | ||
441 | InventoryFolderBase folder = null; | 441 | InventoryFolderBase folder = null; |
442 | if(reader.Read()) | 442 | if (reader.Read()) |
443 | folder = readInventoryFolder(reader); | 443 | folder = readInventoryFolder(reader); |
444 | reader.Close(); | 444 | reader.Close(); |
445 | result.Dispose(); | 445 | result.Dispose(); |
diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index 557dec7..e5f7a50 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs | |||
@@ -301,7 +301,7 @@ namespace OpenSim.Data.SQLite | |||
301 | DataTable inventoryFolderTable = ds.Tables["inventoryfolders"]; | 301 | DataTable inventoryFolderTable = ds.Tables["inventoryfolders"]; |
302 | 302 | ||
303 | inventoryRow = inventoryFolderTable.Rows.Find(item.Folder.ToString()); | 303 | inventoryRow = inventoryFolderTable.Rows.Find(item.Folder.ToString()); |
304 | if(inventoryRow != null) //MySQL doesn't throw an exception here, so sqlite shouldn't either. | 304 | if (inventoryRow != null) //MySQL doesn't throw an exception here, so sqlite shouldn't either. |
305 | inventoryRow["version"] = (int)inventoryRow["version"] + 1; | 305 | inventoryRow["version"] = (int)inventoryRow["version"] + 1; |
306 | 306 | ||
307 | invFoldersDa.Update(ds, "inventoryfolders"); | 307 | invFoldersDa.Update(ds, "inventoryfolders"); |
diff --git a/OpenSim/Data/Tests/BasicGridTest.cs b/OpenSim/Data/Tests/BasicGridTest.cs index a25b736..de8fb48 100644 --- a/OpenSim/Data/Tests/BasicGridTest.cs +++ b/OpenSim/Data/Tests/BasicGridTest.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Data.Tests | |||
46 | { | 46 | { |
47 | // Clean up all the regions. | 47 | // Clean up all the regions. |
48 | List<RegionProfileData> regions = db.GetRegionsByName("", 100); | 48 | List<RegionProfileData> regions = db.GetRegionsByName("", 100); |
49 | if(regions != null) | 49 | if (regions != null) |
50 | { | 50 | { |
51 | foreach (RegionProfileData region in regions) | 51 | foreach (RegionProfileData region in regions) |
52 | { | 52 | { |
diff --git a/OpenSim/Data/Tests/PropertyCompareConstraint.cs b/OpenSim/Data/Tests/PropertyCompareConstraint.cs index d64a51e..06ca53e 100644 --- a/OpenSim/Data/Tests/PropertyCompareConstraint.cs +++ b/OpenSim/Data/Tests/PropertyCompareConstraint.cs | |||
@@ -83,7 +83,7 @@ namespace OpenSim.Data.Tests | |||
83 | } | 83 | } |
84 | 84 | ||
85 | //prevent loops... | 85 | //prevent loops... |
86 | if(propertyNames.Count > 50) | 86 | if (propertyNames.Count > 50) |
87 | { | 87 | { |
88 | failingPropertyName = string.Join(".", propertyNames.Reverse().ToArray()); | 88 | failingPropertyName = string.Join(".", propertyNames.Reverse().ToArray()); |
89 | failingActual = actual; | 89 | failingActual = actual; |
diff --git a/OpenSim/Data/Tests/PropertyScrambler.cs b/OpenSim/Data/Tests/PropertyScrambler.cs index c56c10f..72aaff1 100644 --- a/OpenSim/Data/Tests/PropertyScrambler.cs +++ b/OpenSim/Data/Tests/PropertyScrambler.cs | |||
@@ -1,3 +1,30 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
1 | using System; | 28 | using System; |
2 | using System.Collections; | 29 | using System.Collections; |
3 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
@@ -20,7 +47,7 @@ namespace OpenSim.Data.Tests | |||
20 | private void AddExpressionToNotScrableList(Expression expression) | 47 | private void AddExpressionToNotScrableList(Expression expression) |
21 | { | 48 | { |
22 | UnaryExpression unaryExpression = expression as UnaryExpression; | 49 | UnaryExpression unaryExpression = expression as UnaryExpression; |
23 | if(unaryExpression != null) | 50 | if (unaryExpression != null) |
24 | { | 51 | { |
25 | AddExpressionToNotScrableList(unaryExpression.Operand); | 52 | AddExpressionToNotScrableList(unaryExpression.Operand); |
26 | return; | 53 | return; |
@@ -58,7 +85,7 @@ namespace OpenSim.Data.Tests | |||
58 | { | 85 | { |
59 | //Skip indexers of classes. We will assume that everything that has an indexer | 86 | //Skip indexers of classes. We will assume that everything that has an indexer |
60 | // is also IEnumberable. May not always be true, but should be true normally. | 87 | // is also IEnumberable. May not always be true, but should be true normally. |
61 | if(property.GetIndexParameters().Length > 0) | 88 | if (property.GetIndexParameters().Length > 0) |
62 | continue; | 89 | continue; |
63 | 90 | ||
64 | RandomizeProperty(obj, property, null); | 91 | RandomizeProperty(obj, property, null); |
@@ -66,7 +93,7 @@ namespace OpenSim.Data.Tests | |||
66 | //Now if it implments IEnumberable, it's probably some kind of list, so we should randomize | 93 | //Now if it implments IEnumberable, it's probably some kind of list, so we should randomize |
67 | // everything inside of it. | 94 | // everything inside of it. |
68 | IEnumerable enumerable = obj as IEnumerable; | 95 | IEnumerable enumerable = obj as IEnumerable; |
69 | if(enumerable != null) | 96 | if (enumerable != null) |
70 | { | 97 | { |
71 | foreach (object value in enumerable) | 98 | foreach (object value in enumerable) |
72 | { | 99 | { |
@@ -78,7 +105,7 @@ namespace OpenSim.Data.Tests | |||
78 | private readonly Random random = new Random(); | 105 | private readonly Random random = new Random(); |
79 | private void RandomizeProperty(object obj, PropertyInfo property, object[] index) | 106 | private void RandomizeProperty(object obj, PropertyInfo property, object[] index) |
80 | {//I'd like a better way to compare, but I had lots of problems with InventoryFolderBase because the ID is inherited. | 107 | {//I'd like a better way to compare, but I had lots of problems with InventoryFolderBase because the ID is inherited. |
81 | if(membersToNotScramble.Contains(property.Name)) | 108 | if (membersToNotScramble.Contains(property.Name)) |
82 | return; | 109 | return; |
83 | Type t = property.PropertyType; | 110 | Type t = property.PropertyType; |
84 | if (!property.CanWrite) | 111 | if (!property.CanWrite) |