* Introduced GetVersionString so we can harness the whole thing.
* Introduced 'Flavour' to spice things up.0.6.6-post-fixes
parent
f76615a66d
commit
5d23ecebeb
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue