diff options
author | lbsa71 | 2009-05-26 16:01:06 +0000 |
---|---|---|
committer | lbsa71 | 2009-05-26 16:01:06 +0000 |
commit | 5d23ecebeb971b78b8a9847b6be634bf0f48c359 (patch) | |
tree | f7e69d1f947ab3c71bbfbff495f564775ff0515a /OpenSim/Framework/Servers | |
parent | * slowly getting there... (diff) | |
download | opensim-SC_OLD-5d23ecebeb971b78b8a9847b6be634bf0f48c359.zip opensim-SC_OLD-5d23ecebeb971b78b8a9847b6be634bf0f48c359.tar.gz opensim-SC_OLD-5d23ecebeb971b78b8a9847b6be634bf0f48c359.tar.bz2 opensim-SC_OLD-5d23ecebeb971b78b8a9847b6be634bf0f48c359.tar.xz |
* Introduced GetVersionString so we can harness the whole thing.
* Introduced 'Flavour' to spice things up.
Diffstat (limited to 'OpenSim/Framework/Servers')
-rw-r--r-- | OpenSim/Framework/Servers/Tests/VersionInfoTests.cs | 11 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/VersionInfo.cs | 16 |
2 files changed, 24 insertions, 3 deletions
diff --git a/OpenSim/Framework/Servers/Tests/VersionInfoTests.cs b/OpenSim/Framework/Servers/Tests/VersionInfoTests.cs index 5eb362b..1a3d98c 100644 --- a/OpenSim/Framework/Servers/Tests/VersionInfoTests.cs +++ b/OpenSim/Framework/Servers/Tests/VersionInfoTests.cs | |||
@@ -9,9 +9,16 @@ namespace OpenSim.Framework.Servers.Tests | |||
9 | public class VersionInfoTests | 9 | public class VersionInfoTests |
10 | { | 10 | { |
11 | [Test] | 11 | [Test] |
12 | public void TestVersionInfoLength() | 12 | public void TestVersionLength() |
13 | { | 13 | { |
14 | Assert.AreEqual( VersionInfo.VERSIONINFO_VERSION_LENGTH, VersionInfo.Version.Length," VersionInfo.Version string not " + VersionInfo.VERSIONINFO_VERSION_LENGTH + " chars." ); | 14 | Assert.AreEqual(VersionInfo.VERSIONINFO_VERSION_LENGTH, VersionInfo.Version.Length," VersionInfo.Version string not " + VersionInfo.VERSIONINFO_VERSION_LENGTH + " chars." ); |
15 | } | ||
16 | |||
17 | [Test] | ||
18 | public void TestGetVersionStringLength() | ||
19 | { | ||
20 | Assert.AreEqual(VersionInfo.VERSIONINFO_VERSION_LENGTH, VersionInfo.GetVersionString("0.0.0").Length, "0.0.0 failed"); | ||
21 | Assert.AreEqual(VersionInfo.VERSIONINFO_VERSION_LENGTH, VersionInfo.GetVersionString("9.99.99").Length, "9.99.99 failed"); | ||
15 | } | 22 | } |
16 | } | 23 | } |
17 | } | 24 | } |
diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index 200f0e2..56f9148 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs | |||
@@ -29,11 +29,25 @@ namespace OpenSim | |||
29 | { | 29 | { |
30 | public class VersionInfo | 30 | public class VersionInfo |
31 | { | 31 | { |
32 | private enum Flavour | ||
33 | { | ||
34 | Unknown, | ||
35 | Dev, | ||
36 | RC1, | ||
37 | RC2, | ||
38 | Release | ||
39 | } | ||
32 | private const string m_versionNumber = "0.6.5"; | 40 | private const string m_versionNumber = "0.6.5"; |
33 | 41 | ||
34 | public static string Version | 42 | public static string Version |
35 | { | 43 | { |
36 | get { return "OpenSimulator Server" + " " + m_versionNumber; } | 44 | get { return GetVersionString(m_versionNumber); } |
45 | } | ||
46 | |||
47 | public static string GetVersionString(string versionNumber) | ||
48 | { | ||
49 | string versionString = "OpenSimulator Server" + versionNumber; | ||
50 | return versionString.PadRight(VERSIONINFO_VERSION_LENGTH); | ||
37 | } | 51 | } |
38 | 52 | ||
39 | public const int VERSIONINFO_VERSION_LENGTH = 27; | 53 | public const int VERSIONINFO_VERSION_LENGTH = 27; |