diff options
author | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
commit | 134f86e8d5c414409631b25b8c6f0ee45fbd8631 (patch) | |
tree | 216b89d3fb89acfb81be1e440c25c41ab09fa96d /OpenSim/Tests/Common/TestHelpers.cs | |
parent | More changing to production grid. Double oops. (diff) | |
download | opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.zip opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.gz opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.bz2 opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.xz |
Initial update to OpenSim 0.8.2.1 source code.
Diffstat (limited to 'OpenSim/Tests/Common/TestHelpers.cs')
-rw-r--r-- | OpenSim/Tests/Common/TestHelpers.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/OpenSim/Tests/Common/TestHelpers.cs b/OpenSim/Tests/Common/TestHelpers.cs index 57da802..6bf23f8 100644 --- a/OpenSim/Tests/Common/TestHelpers.cs +++ b/OpenSim/Tests/Common/TestHelpers.cs | |||
@@ -114,6 +114,25 @@ namespace OpenSim.Tests.Common | |||
114 | } | 114 | } |
115 | 115 | ||
116 | /// <summary> | 116 | /// <summary> |
117 | /// Parse a UUID stem into a full UUID. | ||
118 | /// </summary> | ||
119 | /// <remarks> | ||
120 | /// The fragment will come at the start of the UUID. The rest will be 0s | ||
121 | /// </remarks> | ||
122 | /// <returns></returns> | ||
123 | /// <param name='frag'> | ||
124 | /// A UUID fragment that will be parsed into a full UUID. Therefore, it can only contain | ||
125 | /// cahracters which are valid in a UUID, except for "-" which is currently only allowed if a full UUID is | ||
126 | /// given as the 'fragment'. | ||
127 | /// </param> | ||
128 | public static UUID ParseStem(string stem) | ||
129 | { | ||
130 | string rawUuid = stem.PadRight(32, '0'); | ||
131 | |||
132 | return UUID.Parse(rawUuid); | ||
133 | } | ||
134 | |||
135 | /// <summary> | ||
117 | /// Parse tail section into full UUID. | 136 | /// Parse tail section into full UUID. |
118 | /// </summary> | 137 | /// </summary> |
119 | /// <param name="tail"></param> | 138 | /// <param name="tail"></param> |
@@ -122,5 +141,24 @@ namespace OpenSim.Tests.Common | |||
122 | { | 141 | { |
123 | return new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", tail)); | 142 | return new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", tail)); |
124 | } | 143 | } |
144 | |||
145 | /// <summary> | ||
146 | /// Parse a UUID tail section into a full UUID. | ||
147 | /// </summary> | ||
148 | /// <remarks> | ||
149 | /// The fragment will come at the end of the UUID. The rest will be 0s | ||
150 | /// </remarks> | ||
151 | /// <returns></returns> | ||
152 | /// <param name='frag'> | ||
153 | /// A UUID fragment that will be parsed into a full UUID. Therefore, it can only contain | ||
154 | /// cahracters which are valid in a UUID, except for "-" which is currently only allowed if a full UUID is | ||
155 | /// given as the 'fragment'. | ||
156 | /// </param> | ||
157 | public static UUID ParseTail(string stem) | ||
158 | { | ||
159 | string rawUuid = stem.PadLeft(32, '0'); | ||
160 | |||
161 | return UUID.Parse(rawUuid); | ||
162 | } | ||
125 | } | 163 | } |
126 | } | 164 | } |