* Introduced GetVersionString so we can harness the whole thing.

* Introduced 'Flavour' to spice things up.
0.6.6-post-fixes
lbsa71 2009-05-26 16:01:06 +00:00
parent f76615a66d
commit 5d23ecebeb
2 changed files with 24 additions and 3 deletions

View File

@ -9,9 +9,16 @@ namespace OpenSim.Framework.Servers.Tests
public class VersionInfoTests
{
[Test]
public void TestVersionInfoLength()
public void TestVersionLength()
{
Assert.AreEqual( VersionInfo.VERSIONINFO_VERSION_LENGTH, VersionInfo.Version.Length," VersionInfo.Version string not " + VersionInfo.VERSIONINFO_VERSION_LENGTH + " chars." );
Assert.AreEqual(VersionInfo.VERSIONINFO_VERSION_LENGTH, VersionInfo.Version.Length," VersionInfo.Version string not " + VersionInfo.VERSIONINFO_VERSION_LENGTH + " chars." );
}
[Test]
public void TestGetVersionStringLength()
{
Assert.AreEqual(VersionInfo.VERSIONINFO_VERSION_LENGTH, VersionInfo.GetVersionString("0.0.0").Length, "0.0.0 failed");
Assert.AreEqual(VersionInfo.VERSIONINFO_VERSION_LENGTH, VersionInfo.GetVersionString("9.99.99").Length, "9.99.99 failed");
}
}
}

View File

@ -29,11 +29,25 @@ namespace OpenSim
{
public class VersionInfo
{
private enum Flavour
{
Unknown,
Dev,
RC1,
RC2,
Release
}
private const string m_versionNumber = "0.6.5";
public static string Version
{
get { return "OpenSimulator Server" + " " + m_versionNumber; }
get { return GetVersionString(m_versionNumber); }
}
public static string GetVersionString(string versionNumber)
{
string versionString = "OpenSimulator Server" + versionNumber;
return versionString.PadRight(VERSIONINFO_VERSION_LENGTH);
}
public const int VERSIONINFO_VERSION_LENGTH = 27;