mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 11:42:31 +01:00
- updating version # to v3.9 in preparation for release
This commit is contained in:
parent
b2f3748168
commit
e89210cf6c
@ -6,7 +6,7 @@
|
||||
|
||||
OLD_MG_VERSION=3.7.1
|
||||
OLD_MG_VERSION_BINARY=3.7.1
|
||||
MG_VERSION=3.8.0-dev
|
||||
MG_VERSION=3.9
|
||||
|
||||
if [ "$1" = "--oldversion" ]; then
|
||||
echo "$OLD_MG_VERSION"
|
||||
|
@ -1,5 +1,5 @@
|
||||
local GAME_INSTALL_SIZE = 680000000;
|
||||
local GAME_VERSION = "3.8.0-beta1";
|
||||
local GAME_VERSION = "3.9";
|
||||
|
||||
local _ = MojoSetup.translate
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
!define APNAME MegaGlest
|
||||
!define APNAME_OLD Mega-Glest
|
||||
!define APVER_OLD 3.7.1
|
||||
!define APVER 3.8.0-beta1
|
||||
!define APVER 3.9
|
||||
|
||||
Name "${APNAME} ${APVER}"
|
||||
SetCompressor /FINAL /SOLID lzma
|
||||
|
@ -2,10 +2,10 @@
|
||||
; General Attributes
|
||||
|
||||
!define APNAME MegaGlest
|
||||
!define APVER 3.8.0-beta1
|
||||
!define APVER 3.9
|
||||
!define APNAME_OLD Mega-Glest
|
||||
!define APVER_OLD 3.7.1
|
||||
!define APVER_UPDATE 3.8.0-beta1
|
||||
!define APVER_UPDATE 3.9
|
||||
|
||||
Name "${APNAME} ${APVER_UPDATE}"
|
||||
SetCompressor /FINAL /SOLID lzma
|
||||
|
@ -27,7 +27,7 @@ using namespace Shared::Platform;
|
||||
namespace Glest { namespace Game {
|
||||
|
||||
const char *mailString = " http://bugs.megaglest.org";
|
||||
const string glestVersionString = "v3.8-dev";
|
||||
const string glestVersionString = "v3.9";
|
||||
#if defined(SVNVERSION)
|
||||
const string SVN_RawRev = string(SVNVERSION);
|
||||
const string SVN_Rev = string("Rev: ") + string(SVNVERSION);
|
||||
|
@ -779,14 +779,14 @@ bool checkVersionComptability(string clientVersionString, string serverVersionSt
|
||||
StartsWith(tokensSpecialVersionTags[1],"alpha") == true ||
|
||||
StartsWith(tokensSpecialVersionTags[1],"beta") == true) {
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("FOUND SPECIAL SERVER VERSION TAG [%s] [%s] tokensSpecialVersionTags.size() = " MG_SIZE_T_SPECIFIER "\n",tokensSpecialVersionTags[0].c_str(),tokensSpecialVersionTags[1].c_str(),tokensSpecialVersionTags.size());
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Line Ref: %d FOUND SPECIAL SERVER VERSION TAG [%s] [%s] tokensSpecialVersionTags.size() = " MG_SIZE_T_SPECIFIER "\n",__LINE__,tokensSpecialVersionTags[0].c_str(),tokensSpecialVersionTags[1].c_str(),tokensSpecialVersionTags.size());
|
||||
|
||||
// Chop off platform specific version info
|
||||
if(tokensSpecialVersionTags.size() > 2) {
|
||||
string trimRightDelim = "-" + tokensSpecialVersionTags[2];
|
||||
string newVersionText = trim_at_delim(serverVersionString, trimRightDelim);
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("NEW SERVER VERSION TAG [%s] OLD TAG [%s] delim [%s]\n",newVersionText.c_str(),serverVersionString.c_str(),trimRightDelim.c_str());
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Line Ref: %d NEW SERVER VERSION TAG [%s] OLD TAG [%s] delim [%s]\n",__LINE__,newVersionText.c_str(),serverVersionString.c_str(),trimRightDelim.c_str());
|
||||
serverVersionString = newVersionText;
|
||||
|
||||
tokensServer.clear();
|
||||
@ -806,14 +806,14 @@ bool checkVersionComptability(string clientVersionString, string serverVersionSt
|
||||
StartsWith(tokensSpecialVersionTags[1],"alpha") == true ||
|
||||
StartsWith(tokensSpecialVersionTags[1],"beta") == true) {
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("FOUND SPECIAL CLIENT VERSION TAG [%s] [%s] tokensSpecialVersionTags.size() = " MG_SIZE_T_SPECIFIER "\n",tokensSpecialVersionTags[0].c_str(),tokensSpecialVersionTags[1].c_str(),tokensSpecialVersionTags.size());
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Line Ref: %d FOUND SPECIAL CLIENT VERSION TAG [%s] [%s] tokensSpecialVersionTags.size() = " MG_SIZE_T_SPECIFIER "\n",__LINE__,tokensSpecialVersionTags[0].c_str(),tokensSpecialVersionTags[1].c_str(),tokensSpecialVersionTags.size());
|
||||
|
||||
// Chop off platform specific version info
|
||||
if(tokensSpecialVersionTags.size() > 2) {
|
||||
string trimRightDelim = "-" + tokensSpecialVersionTags[2];
|
||||
string newVersionText = trim_at_delim(clientVersionString, trimRightDelim);
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("NEW CLIENT VERSION TAG [%s] OLD TAG [%s] delim [%s]\n",newVersionText.c_str(),clientVersionString.c_str(),trimRightDelim.c_str());
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Line Ref: %d NEW CLIENT VERSION TAG [%s] OLD TAG [%s] delim [%s]\n",__LINE__,newVersionText.c_str(),clientVersionString.c_str(),trimRightDelim.c_str());
|
||||
clientVersionString = newVersionText;
|
||||
|
||||
tokens.clear();
|
||||
@ -833,10 +833,10 @@ bool checkVersionComptability(string clientVersionString, string serverVersionSt
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) {
|
||||
// debug version strings
|
||||
for(unsigned int i = 0; i < tokensServer.size(); ++i) {
|
||||
printf("Server version index = %u str [%s] IsNumeric = %d\n",i,tokensServer[i].c_str(),IsNumeric(tokensServer[i].c_str(),false));
|
||||
printf("Line Ref: %d Server version index = %u str [%s] IsNumeric = %d\n",__LINE__,i,tokensServer[i].c_str(),IsNumeric(tokensServer[i].c_str(),false));
|
||||
}
|
||||
for(unsigned int i = 0; i < tokens.size(); ++i) {
|
||||
printf("Client version index = %u str [%s] IsNumeric = %d\n",i,tokens[i].c_str(),IsNumeric(tokens[i].c_str(),false));
|
||||
printf("Line Ref: %d Client version index = %u str [%s] IsNumeric = %d\n",__LINE__,i,tokens[i].c_str(),IsNumeric(tokens[i].c_str(),false));
|
||||
}
|
||||
}
|
||||
// **NOTE:
|
||||
@ -913,7 +913,7 @@ bool checkVersionComptability(string clientVersionString, string serverVersionSt
|
||||
if(compatiblePost3_7_0_Check == true) {
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
compatiblePre3_7_0_1_Check = false;
|
||||
// only check the first 2 sections with . to compare makor versions #'s
|
||||
// only check the first 2 sections with . to compare major versions #'s
|
||||
compatible = (tokens.size() >= 2 && tokensServer.size() >= 2);
|
||||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] clientVersionString [%s], serverVersionString [%s] compatible [%d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,clientVersionString.c_str(),serverVersionString.c_str(),compatible);
|
||||
|
184
source/tests/shared_lib/util/util_test.cpp
Normal file
184
source/tests/shared_lib/util/util_test.cpp
Normal file
@ -0,0 +1,184 @@
|
||||
// ==============================================================
|
||||
// This file is part of MegaGlest Unit Tests (www.megaglest.org)
|
||||
//
|
||||
// Copyright (C) 2013 Mark Vejvoda
|
||||
//
|
||||
// You can redistribute this code and/or modify it under
|
||||
// the terms of the GNU General Public License as published
|
||||
// by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version
|
||||
// ==============================================================
|
||||
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include "util.h"
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
using namespace Shared::Util;
|
||||
|
||||
//
|
||||
// Tests for util classes
|
||||
//
|
||||
// **NOTE: IMPORTANT!
|
||||
// AFTER 3.7.0 we moved to 2 digit compatibility checks
|
||||
|
||||
class UtilTest : public CppUnit::TestFixture {
|
||||
// Register the suite of tests for this fixture
|
||||
CPPUNIT_TEST_SUITE( UtilTest );
|
||||
|
||||
CPPUNIT_TEST( test_checkVersionComptability_2_digit_versions );
|
||||
CPPUNIT_TEST( test_checkVersionComptability_3_digit_versions );
|
||||
CPPUNIT_TEST( test_checkVersionComptability_mixed_digit_versions );
|
||||
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
// End of Fixture registration
|
||||
|
||||
public:
|
||||
|
||||
void test_checkVersionComptability_2_digit_versions() {
|
||||
bool debug_verbose_tests = false;
|
||||
SystemFlags::VERBOSE_MODE_ENABLED = debug_verbose_tests;
|
||||
// -------- START
|
||||
|
||||
// 2 digit version checks
|
||||
bool result = checkVersionComptability("v4.0", "v3.9");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v3.9-dev", "v4.0");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v4.0-dev", "v4.0");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v3.9-dev", "v3.9");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v3.8", "v3.9");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v3.8-dev", "v3.9");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v3.8-dev", "v3.8");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v3.8-beta2", "v3.8");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v3.8-beta1", "v3.8");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v3.8-beta1", "v3.8");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
// -------- END
|
||||
SystemFlags::VERBOSE_MODE_ENABLED = false;
|
||||
}
|
||||
|
||||
void test_checkVersionComptability_3_digit_versions() {
|
||||
bool debug_verbose_tests = false;
|
||||
SystemFlags::VERBOSE_MODE_ENABLED = debug_verbose_tests;
|
||||
// -------- START
|
||||
|
||||
// 3 digit version checks
|
||||
bool result = checkVersionComptability("v3.8.1", "v3.8.2");
|
||||
CPPUNIT_ASSERT_EQUAL( true,result );
|
||||
|
||||
result = checkVersionComptability("v3.8.0-beta2", "v3.8.0");
|
||||
CPPUNIT_ASSERT_EQUAL( true,result );
|
||||
|
||||
result = checkVersionComptability("v3.8.0-dev", "v3.8.0");
|
||||
CPPUNIT_ASSERT_EQUAL( true,result );
|
||||
|
||||
result = checkVersionComptability("v3.8.0-beta2", "v3.8.0-dev");
|
||||
CPPUNIT_ASSERT_EQUAL( true,result );
|
||||
|
||||
result = checkVersionComptability("v3.8.0-beta1", "v3.8.0-dev");
|
||||
CPPUNIT_ASSERT_EQUAL( true,result );
|
||||
|
||||
result = checkVersionComptability("v3.8.0-beta1", "v3.8.0-beta2");
|
||||
CPPUNIT_ASSERT_EQUAL( true,result );
|
||||
|
||||
result = checkVersionComptability("v3.7.1", "v3.7.2-dev");
|
||||
CPPUNIT_ASSERT_EQUAL( true,result );
|
||||
|
||||
result = checkVersionComptability("v3.7.1", "v3.7.2");
|
||||
CPPUNIT_ASSERT_EQUAL( true,result );
|
||||
|
||||
result = checkVersionComptability("v3.7.1-dev", "v3.7.1");
|
||||
CPPUNIT_ASSERT_EQUAL( true,result );
|
||||
|
||||
// **NOTE: IMPORTANT!
|
||||
// AFTER 3.7.0 we moved to 2 digit compatibility checks
|
||||
result = checkVersionComptability("v3.7.0", "v3.7.1-dev");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
// -------- END
|
||||
SystemFlags::VERBOSE_MODE_ENABLED = false;
|
||||
}
|
||||
|
||||
void test_checkVersionComptability_mixed_digit_versions() {
|
||||
bool debug_verbose_tests = false;
|
||||
SystemFlags::VERBOSE_MODE_ENABLED = debug_verbose_tests;
|
||||
// -------- START
|
||||
|
||||
bool result = checkVersionComptability("v3.8.0-dev", "v3.9");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v3.8.0-beta2", "v3.9");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v3.8.0-beta1", "v3.9");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
// Mixed digit version checks
|
||||
result = checkVersionComptability("v3.8", "v3.8.2");
|
||||
CPPUNIT_ASSERT_EQUAL( true,result );
|
||||
|
||||
result = checkVersionComptability("v3.8", "v3.8.1");
|
||||
CPPUNIT_ASSERT_EQUAL( true,result );
|
||||
|
||||
result = checkVersionComptability("v3.8.0-dev", "v3.8");
|
||||
CPPUNIT_ASSERT_EQUAL( true,result );
|
||||
|
||||
result = checkVersionComptability("v3.8.0-beta2", "v3.8");
|
||||
CPPUNIT_ASSERT_EQUAL( true,result );
|
||||
|
||||
result = checkVersionComptability("v3.8.0-beta1", "v3.8");
|
||||
CPPUNIT_ASSERT_EQUAL( true,result );
|
||||
|
||||
result = checkVersionComptability("v3.7.2-dev", "v3.8-dev");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v3.7.1", "v3.8");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v3.7.1", "v3.8-dev");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v3.7.1", "v3.8-beta2");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v3.7.1", "v3.8-beta1");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
result = checkVersionComptability("v3.7.0", "v3.8");
|
||||
CPPUNIT_ASSERT_EQUAL( false,result );
|
||||
|
||||
// -------- END
|
||||
SystemFlags::VERBOSE_MODE_ENABLED = false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Test Suite Registrations
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( UtilTest );
|
||||
//
|
Loading…
x
Reference in New Issue
Block a user