NOISSUE tabs -> spaces
This commit is contained in:
.arcconfig.clang-format.gitmodulesCMakeLists.txtCOPYING.md
api
gui
logic
BaseInstaller.cppBaseInstaller.hBaseInstance.cppBaseInstance.hBaseInstanceProvider.hBaseVersion.hBaseVersionList.cppBaseVersionList.hCMakeLists.txtCommandline.cppCommandline.hDefaultVariable.hEnv.cppEnv.hException.hFileSystem.cppFileSystem.hFileSystem_test.cppFilter.cppFilter.hFolderInstanceProvider.cppFolderInstanceProvider.hGZip.cppGZip.hGZip_test.cppInstanceCopyTask.cppInstanceCopyTask.hInstanceCreationTask.cppInstanceCreationTask.hInstanceImportTask.cppInstanceImportTask.hInstanceList.cppInstanceList.hInstanceTask.hJson.cppJson.hLoggedProcess.cppLoggedProcess.hMMCStrings.cppMMCStrings.hMMCZip.cppMMCZip.hMessageLevel.cppMessageLevel.hNullInstance.hProblemProvider.hQObjectPtr.hRWStorage.hRecursiveFileSystemWatcher.cppRecursiveFileSystemWatcher.hSeparatorPrefixTree.hUsable.hVersion.cppVersion.hVersion_test.cpp
icons
java
JavaChecker.cppJavaChecker.hJavaCheckerJob.cppJavaCheckerJob.hJavaInstall.cppJavaInstall.hJavaInstallList.cppJavaInstallList.hJavaUtils.cppJavaUtils.hJavaVersion.cppJavaVersion.hJavaVersion_test.cpp
launch
launch
meta
BaseEntity.cppBaseEntity.hIndex.cppIndex.hIndex_test.cppJsonFormat.cppJsonFormat.hVersion.cppVersion.hVersionList.cppVersionList.h
minecraft
AssetsUtils.cppAssetsUtils.hComponent.cppComponent.hComponentList.cppComponentList.hComponentList_p.hComponentUpdateTask.cppComponentUpdateTask.hComponentUpdateTask_p.hGradleSpecifier.hGradleSpecifier_test.cppLaunchProfile.cppLaunchProfile.hLibrary.cppLibrary.hLibrary_test.cppMinecraftInstance.cppMinecraftInstance.hMinecraftLoadAndCheck.cppMinecraftLoadAndCheck.hMinecraftUpdate.cppMinecraftUpdate.hMod.cppMod.hModsModel.cppModsModel.hMojangDownloadInfo.hMojangVersionFormat.cppMojangVersionFormat.hMojangVersionFormat_test.cppOneSixVersionFormat.cppOneSixVersionFormat.hOpSys.cppOpSys.hParseUtils.cppParseUtils_test.cppProfileUtils.cppRule.cppRule.hSimpleModList.cppSimpleModList.hSimpleModList_test.cppSkinUpload.cppSkinUpload.hVersionFile.cppVersionFile.hVersionFilterData.cppVersionFilterData.hWorld.cppWorld.hWorldList.cppWorldList.h
auth
AuthSession.cppAuthSession.hMojangAccount.cppMojangAccount.hMojangAccountList.cppMojangAccountList.hYggdrasilTask.cppYggdrasilTask.h
flows
forge
launch
ClaimAccount.cppClaimAccount.hCreateServerResourcePacksFolder.cppCreateServerResourcePacksFolder.hDirectJavaLaunch.cppDirectJavaLaunch.hExtractNatives.cppExtractNatives.hLauncherPartLaunch.cppLauncherPartLaunch.hModMinecraftJar.cppModMinecraftJar.hPrintInstanceInfo.h
legacy
LegacyInstance.cppLegacyInstance.hLegacyModList.cppLegacyModList.hLegacyUpgradeTask.cppLegacyUpgradeTask.h
testdata
update
modplatform
flame
ftb
net
ByteArraySink.hChecksumValidator.hDownload.cppDownload.hFileSink.cppFileSink.hHttpMetaCache.cppHttpMetaCache.hMetaCacheSink.cppMetaCacheSink.hMode.hNetAction.hNetJob.cppNetJob.hPasteUpload.cppPasteUpload.hSink.hURLConstants.cppValidator.h
news
notifications
pathmatcher
screenshots
settings
INIFile.cppINIFile.hINIFile_test.cppINISettingsObject.cppINISettingsObject.hOverrideSetting.cppOverrideSetting.hPassthroughSetting.cppPassthroughSetting.hSetting.cppSetting.hSettingsObject.cppSettingsObject.h
status
tasks
tools
BaseExternalTool.cppBaseExternalTool.hBaseProfiler.cppBaseProfiler.hJProfiler.cppJProfiler.hJVisualVM.cppJVisualVM.hMCEditTool.cppMCEditTool.h
translations
updater
application
BuildConfig.cpp.inBuildConfig.hColorCache.cppColorCache.hColumnResizer.cppColumnResizer.hGuiUtil.cppHoeDown.hInstancePageProvider.hInstanceProxyModel.cppInstanceProxyModel.hInstanceWindow.cppInstanceWindow.hJavaCommon.cppJavaCommon.hKonamiCode.cppKonamiCode.hLaunchController.cppLaunchController.hMainWindow.cppMainWindow.hMultiMC.cppMultiMC.hSettingsUI.hUpdateController.cppUpdateController.hVersionProxyModel.cppVersionProxyModel.h
dialogs
AboutDialog.cppAboutDialog.hCopyInstanceDialog.cppCopyInstanceDialog.hCustomMessageBox.cppCustomMessageBox.hEditAccountDialog.cppEditAccountDialog.hExportInstanceDialog.cppExportInstanceDialog.hIconPickerDialog.cppIconPickerDialog.hLoginDialog.cppLoginDialog.hModEditDialogCommon.cppNewComponentDialog.cppNewComponentDialog.hNewInstanceDialog.cppNewInstanceDialog.hNotificationDialog.cppNotificationDialog.hProfileSelectDialog.cppProfileSelectDialog.hProgressDialog.cppProgressDialog.hSkinUploadDialog.cppSkinUploadDialog.hUpdateDialog.cppUpdateDialog.hVersionSelectDialog.cppVersionSelectDialog.h
groupview
GroupView.cppGroupView.hGroupedProxyModel.cppGroupedProxyModel.hInstanceDelegate.cppInstanceDelegate.hVisualGroup.cppVisualGroup.h
install_prereqs.cmake.inmain.cpppackage
linux
pagedialog
pages
BasePage.hBasePageContainer.hBasePageProvider.h
global
AccountListPage.cppAccountListPage.hCustomCommandsPage.cppCustomCommandsPage.hExternalToolsPage.cppExternalToolsPage.hJavaPage.cppJavaPage.hMinecraftPage.cppMinecraftPage.hMultiMCPage.cppMultiMCPage.hPackagesPage.cppPackagesPage.hPasteEEPage.cppPasteEEPage.hProxyPage.cppProxyPage.h
instance
InstanceSettingsPage.cppInstanceSettingsPage.hLegacyUpgradePage.cppLegacyUpgradePage.hLogPage.cppLogPage.hModFolderPage.cppModFolderPage.hNewModFolderPage.cppNewModFolderPage.hNotesPage.cppNotesPage.hOtherLogsPage.cppOtherLogsPage.hResourcePackPage.hScreenshotsPage.cppScreenshotsPage.hServersPage.cppServersPage.hTexturePackPage.hVersionPage.cppVersionPage.hWorldListPage.cppWorldListPage.h
modplatform
resources
OSX
assets
documents
flat
iOS
multimc
pe_blue
pe_colored
pe_dark
pe_light
setupwizard
AnalyticsWizardPage.cppAnalyticsWizardPage.hBaseWizardPage.hJavaWizardPage.cppJavaWizardPage.hLanguageWizardPage.cppLanguageWizardPage.hSetupWizard.cppSetupWizard.h
themes
BrightTheme.cppBrightTheme.hCustomTheme.cppCustomTheme.hDarkTheme.cppDarkTheme.hFusionTheme.cppFusionTheme.hITheme.cppITheme.hSystemTheme.cppSystemTheme.h
widgets
Common.cppCommon.hCustomCommands.cppCustomCommands.hFocusLineEdit.cppFocusLineEdit.hIconLabel.cppIconLabel.hJavaSettingsWidget.cppJavaSettingsWidget.hLabeledToolButton.cppLabeledToolButton.hLineSeparator.cppLineSeparator.hLogView.cppLogView.hMCModInfoFrame.cppMCModInfoFrame.hModListView.cppModListView.hPageContainer.cppPageContainer.hPageContainer_p.hProgressWidget.cppProgressWidget.hServerStatus.cppServerStatus.hVersionListView.cppVersionListView.hVersionSelectWidget.cppVersionSelectWidget.h
libraries
LocalPeer
classparser
ganalytics
hoedown
include
src
iconfix
javacheck
launcher
pack200
rainbow
systeminfo
xz-embedded
travis
@ -5,110 +5,110 @@
|
||||
|
||||
class JavaVersionTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
private
|
||||
slots:
|
||||
void test_Parse_data()
|
||||
{
|
||||
QTest::addColumn<QString>("string");
|
||||
QTest::addColumn<int>("major");
|
||||
QTest::addColumn<int>("minor");
|
||||
QTest::addColumn<int>("security");
|
||||
QTest::addColumn<QString>("prerelease");
|
||||
void test_Parse_data()
|
||||
{
|
||||
QTest::addColumn<QString>("string");
|
||||
QTest::addColumn<int>("major");
|
||||
QTest::addColumn<int>("minor");
|
||||
QTest::addColumn<int>("security");
|
||||
QTest::addColumn<QString>("prerelease");
|
||||
|
||||
QTest::newRow("old format") << "1.6.0_33" << 6 << 0 << 33 << QString();
|
||||
QTest::newRow("old format prerelease") << "1.9.0_1-ea" << 9 << 0 << 1 << "ea";
|
||||
QTest::newRow("old format") << "1.6.0_33" << 6 << 0 << 33 << QString();
|
||||
QTest::newRow("old format prerelease") << "1.9.0_1-ea" << 9 << 0 << 1 << "ea";
|
||||
|
||||
QTest::newRow("new format major") << "9" << 9 << 0 << 0 << QString();
|
||||
QTest::newRow("new format minor") << "9.1" << 9 << 1 << 0 << QString();
|
||||
QTest::newRow("new format security") << "9.0.1" << 9 << 0 << 1 << QString();
|
||||
QTest::newRow("new format prerelease") << "9-ea" << 9 << 0 << 0 << "ea";
|
||||
QTest::newRow("new format long prerelease") << "9.0.1-ea" << 9 << 0 << 1 << "ea";
|
||||
}
|
||||
void test_Parse()
|
||||
{
|
||||
QFETCH(QString, string);
|
||||
QFETCH(int, major);
|
||||
QFETCH(int, minor);
|
||||
QFETCH(int, security);
|
||||
QFETCH(QString, prerelease);
|
||||
QTest::newRow("new format major") << "9" << 9 << 0 << 0 << QString();
|
||||
QTest::newRow("new format minor") << "9.1" << 9 << 1 << 0 << QString();
|
||||
QTest::newRow("new format security") << "9.0.1" << 9 << 0 << 1 << QString();
|
||||
QTest::newRow("new format prerelease") << "9-ea" << 9 << 0 << 0 << "ea";
|
||||
QTest::newRow("new format long prerelease") << "9.0.1-ea" << 9 << 0 << 1 << "ea";
|
||||
}
|
||||
void test_Parse()
|
||||
{
|
||||
QFETCH(QString, string);
|
||||
QFETCH(int, major);
|
||||
QFETCH(int, minor);
|
||||
QFETCH(int, security);
|
||||
QFETCH(QString, prerelease);
|
||||
|
||||
JavaVersion test(string);
|
||||
QCOMPARE(test.m_string, string);
|
||||
QCOMPARE(test.toString(), string);
|
||||
QCOMPARE(test.m_major, major);
|
||||
QCOMPARE(test.m_minor, minor);
|
||||
QCOMPARE(test.m_security, security);
|
||||
QCOMPARE(test.m_prerelease, prerelease);
|
||||
}
|
||||
JavaVersion test(string);
|
||||
QCOMPARE(test.m_string, string);
|
||||
QCOMPARE(test.toString(), string);
|
||||
QCOMPARE(test.m_major, major);
|
||||
QCOMPARE(test.m_minor, minor);
|
||||
QCOMPARE(test.m_security, security);
|
||||
QCOMPARE(test.m_prerelease, prerelease);
|
||||
}
|
||||
|
||||
void test_Sort_data()
|
||||
{
|
||||
QTest::addColumn<QString>("lhs");
|
||||
QTest::addColumn<QString>("rhs");
|
||||
QTest::addColumn<bool>("smaller");
|
||||
QTest::addColumn<bool>("equal");
|
||||
QTest::addColumn<bool>("bigger");
|
||||
void test_Sort_data()
|
||||
{
|
||||
QTest::addColumn<QString>("lhs");
|
||||
QTest::addColumn<QString>("rhs");
|
||||
QTest::addColumn<bool>("smaller");
|
||||
QTest::addColumn<bool>("equal");
|
||||
QTest::addColumn<bool>("bigger");
|
||||
|
||||
// old format and new format equivalence
|
||||
QTest::newRow("1.6.0_33 == 6.0.33") << "1.6.0_33" << "6.0.33" << false << true << false;
|
||||
// old format major version
|
||||
QTest::newRow("1.5.0_33 < 1.6.0_33") << "1.5.0_33" << "1.6.0_33" << true << false << false;
|
||||
// new format - first release vs first security patch
|
||||
QTest::newRow("9 < 9.0.1") << "9" << "9.0.1" << true << false << false;
|
||||
QTest::newRow("9.0.1 > 9") << "9.0.1" << "9" << false << false << true;
|
||||
// new format - first minor vs first release/security patch
|
||||
QTest::newRow("9.1 > 9.0.1") << "9.1" << "9.0.1" << false << false << true;
|
||||
QTest::newRow("9.0.1 < 9.1") << "9.0.1" << "9.1" << true << false << false;
|
||||
QTest::newRow("9.1 > 9") << "9.1" << "9" << false << false << true;
|
||||
QTest::newRow("9 > 9.1") << "9" << "9.1" << true << false << false;
|
||||
// new format - omitted numbers
|
||||
QTest::newRow("9 == 9.0") << "9" << "9.0" << false << true << false;
|
||||
QTest::newRow("9 == 9.0.0") << "9" << "9.0.0" << false << true << false;
|
||||
QTest::newRow("9.0 == 9.0.0") << "9.0" << "9.0.0" << false << true << false;
|
||||
// early access and prereleases compared to final release
|
||||
QTest::newRow("9-ea < 9") << "9-ea" << "9" << true << false << false;
|
||||
QTest::newRow("9 < 9.0.1-ea") << "9" << "9.0.1-ea" << true << false << false;
|
||||
QTest::newRow("9.0.1-ea > 9") << "9.0.1-ea" << "9" << false << false << true;
|
||||
// prerelease difference only testing
|
||||
QTest::newRow("9-1 == 9-1") << "9-1" << "9-1" << false << true << false;
|
||||
QTest::newRow("9-1 < 9-2") << "9-1" << "9-2" << true << false << false;
|
||||
QTest::newRow("9-5 < 9-20") << "9-5" << "9-20" << true << false << false;
|
||||
QTest::newRow("9-rc1 < 9-rc2") << "9-rc1" << "9-rc2" << true << false << false;
|
||||
QTest::newRow("9-rc5 < 9-rc20") << "9-rc5" << "9-rc20" << true << false << false;
|
||||
QTest::newRow("9-rc < 9-rc2") << "9-rc" << "9-rc2" << true << false << false;
|
||||
QTest::newRow("9-ea < 9-rc") << "9-ea" << "9-rc" << true << false << false;
|
||||
}
|
||||
void test_Sort()
|
||||
{
|
||||
QFETCH(QString, lhs);
|
||||
QFETCH(QString, rhs);
|
||||
QFETCH(bool, smaller);
|
||||
QFETCH(bool, equal);
|
||||
QFETCH(bool, bigger);
|
||||
JavaVersion lver(lhs);
|
||||
JavaVersion rver(rhs);
|
||||
QCOMPARE(lver < rver, smaller);
|
||||
QCOMPARE(lver == rver, equal);
|
||||
QCOMPARE(lver > rver, bigger);
|
||||
}
|
||||
void test_PermGen_data()
|
||||
{
|
||||
QTest::addColumn<QString>("version");
|
||||
QTest::addColumn<bool>("needs_permgen");
|
||||
QTest::newRow("1.6.0_33") << "1.6.0_33" << true;
|
||||
QTest::newRow("1.7.0_60") << "1.7.0_60" << true;
|
||||
QTest::newRow("1.8.0_22") << "1.8.0_22" << false;
|
||||
QTest::newRow("9-ea") << "9-ea" << false;
|
||||
QTest::newRow("9.2.4") << "9.2.4" << false;
|
||||
}
|
||||
void test_PermGen()
|
||||
{
|
||||
QFETCH(QString, version);
|
||||
QFETCH(bool, needs_permgen);
|
||||
JavaVersion v(version);
|
||||
QCOMPARE(needs_permgen, v.requiresPermGen());
|
||||
}
|
||||
// old format and new format equivalence
|
||||
QTest::newRow("1.6.0_33 == 6.0.33") << "1.6.0_33" << "6.0.33" << false << true << false;
|
||||
// old format major version
|
||||
QTest::newRow("1.5.0_33 < 1.6.0_33") << "1.5.0_33" << "1.6.0_33" << true << false << false;
|
||||
// new format - first release vs first security patch
|
||||
QTest::newRow("9 < 9.0.1") << "9" << "9.0.1" << true << false << false;
|
||||
QTest::newRow("9.0.1 > 9") << "9.0.1" << "9" << false << false << true;
|
||||
// new format - first minor vs first release/security patch
|
||||
QTest::newRow("9.1 > 9.0.1") << "9.1" << "9.0.1" << false << false << true;
|
||||
QTest::newRow("9.0.1 < 9.1") << "9.0.1" << "9.1" << true << false << false;
|
||||
QTest::newRow("9.1 > 9") << "9.1" << "9" << false << false << true;
|
||||
QTest::newRow("9 > 9.1") << "9" << "9.1" << true << false << false;
|
||||
// new format - omitted numbers
|
||||
QTest::newRow("9 == 9.0") << "9" << "9.0" << false << true << false;
|
||||
QTest::newRow("9 == 9.0.0") << "9" << "9.0.0" << false << true << false;
|
||||
QTest::newRow("9.0 == 9.0.0") << "9.0" << "9.0.0" << false << true << false;
|
||||
// early access and prereleases compared to final release
|
||||
QTest::newRow("9-ea < 9") << "9-ea" << "9" << true << false << false;
|
||||
QTest::newRow("9 < 9.0.1-ea") << "9" << "9.0.1-ea" << true << false << false;
|
||||
QTest::newRow("9.0.1-ea > 9") << "9.0.1-ea" << "9" << false << false << true;
|
||||
// prerelease difference only testing
|
||||
QTest::newRow("9-1 == 9-1") << "9-1" << "9-1" << false << true << false;
|
||||
QTest::newRow("9-1 < 9-2") << "9-1" << "9-2" << true << false << false;
|
||||
QTest::newRow("9-5 < 9-20") << "9-5" << "9-20" << true << false << false;
|
||||
QTest::newRow("9-rc1 < 9-rc2") << "9-rc1" << "9-rc2" << true << false << false;
|
||||
QTest::newRow("9-rc5 < 9-rc20") << "9-rc5" << "9-rc20" << true << false << false;
|
||||
QTest::newRow("9-rc < 9-rc2") << "9-rc" << "9-rc2" << true << false << false;
|
||||
QTest::newRow("9-ea < 9-rc") << "9-ea" << "9-rc" << true << false << false;
|
||||
}
|
||||
void test_Sort()
|
||||
{
|
||||
QFETCH(QString, lhs);
|
||||
QFETCH(QString, rhs);
|
||||
QFETCH(bool, smaller);
|
||||
QFETCH(bool, equal);
|
||||
QFETCH(bool, bigger);
|
||||
JavaVersion lver(lhs);
|
||||
JavaVersion rver(rhs);
|
||||
QCOMPARE(lver < rver, smaller);
|
||||
QCOMPARE(lver == rver, equal);
|
||||
QCOMPARE(lver > rver, bigger);
|
||||
}
|
||||
void test_PermGen_data()
|
||||
{
|
||||
QTest::addColumn<QString>("version");
|
||||
QTest::addColumn<bool>("needs_permgen");
|
||||
QTest::newRow("1.6.0_33") << "1.6.0_33" << true;
|
||||
QTest::newRow("1.7.0_60") << "1.7.0_60" << true;
|
||||
QTest::newRow("1.8.0_22") << "1.8.0_22" << false;
|
||||
QTest::newRow("9-ea") << "9-ea" << false;
|
||||
QTest::newRow("9.2.4") << "9.2.4" << false;
|
||||
}
|
||||
void test_PermGen()
|
||||
{
|
||||
QFETCH(QString, version);
|
||||
QFETCH(bool, needs_permgen);
|
||||
JavaVersion v(version);
|
||||
QCOMPARE(needs_permgen, v.requiresPermGen());
|
||||
}
|
||||
};
|
||||
|
||||
QTEST_GUILESS_MAIN(JavaVersionTest)
|
||||
|
Reference in New Issue
Block a user