From 38accc87c3a3098f6e048a16aefce1513b12b329 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Thu, 15 Mar 2018 13:52:40 +0100 Subject: [PATCH 01/28] Removed the few old tests --- Vocaluxe.sln.DotSettings | 8 + VocaluxeTests/CTestHelpers.cs | 21 - VocaluxeTests/CombinatoricsTest.cs | 75 --- VocaluxeTests/PartyModeTests.cs | 73 --- VocaluxeTests/Properties/AssemblyInfo.cs | 39 -- VocaluxeTests/TestXmlFiles/Dictionary`2.xml | 34 -- VocaluxeTests/TestXmlFiles/SConfig.xml | 97 ---- VocaluxeTests/TestXmlFiles/SDefaultFonts.xml | 35 -- VocaluxeTests/TestXmlFiles/SSkin.xml | 268 ---------- VocaluxeTests/TestXmlFiles/STheme.xml | 16 - VocaluxeTests/TestXmlFiles/SThemeCover.xml | 37 -- VocaluxeTests/TestXmlFiles/SThemeScreen.xml | 256 ---------- VocaluxeTests/VocaluxeTests.csproj | 121 ----- VocaluxeTests/XmlSerializerTest.cs | 490 ------------------- 14 files changed, 8 insertions(+), 1562 deletions(-) delete mode 100644 VocaluxeTests/CTestHelpers.cs delete mode 100644 VocaluxeTests/CombinatoricsTest.cs delete mode 100644 VocaluxeTests/PartyModeTests.cs delete mode 100644 VocaluxeTests/Properties/AssemblyInfo.cs delete mode 100644 VocaluxeTests/TestXmlFiles/Dictionary`2.xml delete mode 100644 VocaluxeTests/TestXmlFiles/SConfig.xml delete mode 100644 VocaluxeTests/TestXmlFiles/SDefaultFonts.xml delete mode 100644 VocaluxeTests/TestXmlFiles/SSkin.xml delete mode 100644 VocaluxeTests/TestXmlFiles/STheme.xml delete mode 100644 VocaluxeTests/TestXmlFiles/SThemeCover.xml delete mode 100644 VocaluxeTests/TestXmlFiles/SThemeScreen.xml delete mode 100644 VocaluxeTests/VocaluxeTests.csproj delete mode 100644 VocaluxeTests/XmlSerializerTest.cs diff --git a/Vocaluxe.sln.DotSettings b/Vocaluxe.sln.DotSettings index 5821e368..a7008703 100644 --- a/Vocaluxe.sln.DotSettings +++ b/Vocaluxe.sln.DotSettings @@ -29,7 +29,10 @@ ONLY_FOR_MULTILINE 1 True + ALWAYS + NEVER True + NEVER LINE_BREAK False True @@ -117,7 +120,12 @@ along with $SOLUTION$. If not, see <http://www.gnu.org/licenses/>.<Policy><Descriptor Staticness="Static, Instance" AccessRightKinds="Private, Protected, ProtectedInternal, Internal, Public" Description="Classes"><ElementKinds><Kind Name="CLASS" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="C" Suffix="" Style="AaBb" /></Policy> <Policy><Descriptor Staticness="Static, Instance" AccessRightKinds="Private, Protected" Description="Fields (not public)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /><Kind Name="METHOD" /><Kind Name="PROPERTY" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="_" Suffix="" Style="AaBb" /></Policy> <Policy><Descriptor Staticness="Static, Instance" AccessRightKinds="Private, Protected, ProtectedInternal, Internal, Public" Description="Structs"><ElementKinds><Kind Name="STRUCT" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="S" Suffix="" Style="AaBb" /></Policy> + True + True + True + True True + True True True False diff --git a/VocaluxeTests/CTestHelpers.cs b/VocaluxeTests/CTestHelpers.cs deleted file mode 100644 index 4ad00bf3..00000000 --- a/VocaluxeTests/CTestHelpers.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace VocaluxeTests -{ - static class CTestHelpers - { - public static void AssertFail(Action test) where T : Exception - { - try - { - test.Invoke(); - Assert.Fail("Exception " + typeof(T).Name + " not thrown!"); - } - catch (Exception e) - { - Assert.IsInstanceOfType(e, typeof(T)); - } - } - } -} \ No newline at end of file diff --git a/VocaluxeTests/CombinatoricsTest.cs b/VocaluxeTests/CombinatoricsTest.cs deleted file mode 100644 index 50d274e1..00000000 --- a/VocaluxeTests/CombinatoricsTest.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using VocaluxeLib.Utils.Combinatorics; - -namespace VocaluxeTests -{ - [TestClass] - public class CCombinatoricsTest - { - [TestMethod] - public void TestCounts() - { - Assert.AreEqual(4, CCombinations.Count(4, 3)); - Assert.AreEqual(6, CCombinations.Count(4, 2)); - Assert.AreEqual(66, CCombinations.Count(12, 2)); - // Corner cases - for (int i = 1; i < 12; i++) - { - Assert.AreEqual(1, CCombinations.Count(i, 0)); - Assert.AreEqual(1, CCombinations.Count(i, i)); - Assert.AreEqual(0, CCombinations.Count(i, i + 1)); - } - // Check identity (n k) = (n n-k) - for (int i = 0; i <= 12; i++) - Assert.AreEqual(CCombinations.Count(12, i), CCombinations.Count(12, 12 - i)); - CTestHelpers.AssertFail(() => CCombinations.Count(-1, -1)); - CTestHelpers.AssertFail(() => CCombinations.Count(-1, 1)); - CTestHelpers.AssertFail(() => CCombinations.Count(1, -1)); - } - - // ReSharper disable UnusedParameter.Local - private static void _CheckResults(CCombinations combs, List input) - // ReSharper restore UnusedParameter.Local - { - List> results = new List>(); - foreach (List comb in combs) - { - foreach (List other in results) - Assert.IsFalse(other.SequenceEqual(comb), "Result must be unique"); - for (int i = 0; i < comb.Count - 1; i++) - { - Assert.IsTrue(comb.IndexOf(comb[i], i + 1) < 0, "Repetition not allowed"); - Assert.IsTrue(input.Contains(comb[i]), "Output must be in input sequence"); - } - results.Add(comb); - } - Assert.AreEqual(combs.Count(), results.Count); - List> results2 = combs.GetAll(); - Assert.AreEqual(results.Count, results2.Count); - for (int i = 0; i < results2.Count; i++) - Assert.IsTrue(results[i].SequenceEqual(results2[i])); - } - - [TestMethod] - public void TestResults() - { - Random rand = new Random(); - for (int n = 0; n < 8; n++) - { - for (int k = 0; k <= n; k++) - { - List collection = new List(n); - int r = rand.Next(1000); - for (int i = 0; i < n; i++) - collection.Add(i + r); - CCombinations combs = new CCombinations(collection, k); - Assert.AreEqual(CCombinations.Count(n, k), combs.Count()); - _CheckResults(combs, collection); - } - } - } - } -} \ No newline at end of file diff --git a/VocaluxeTests/PartyModeTests.cs b/VocaluxeTests/PartyModeTests.cs deleted file mode 100644 index e5c1eda6..00000000 --- a/VocaluxeTests/PartyModeTests.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Vocaluxe.Base; -using Vocaluxe.Reporting; -using VocaluxeLib; -using VocaluxeLib.Log; -using VocaluxeLib.PartyModes.Challenge; - -namespace VocaluxeTests -{ - [TestClass] - public class CPartyModeTests - { - [TestMethod] - public void TestRoundBoundaries() - { - // ReSharper disable ObjectCreationAsStatement - new CChallengeRounds(1, 1, 1); // Should succeed - // ReSharper restore ObjectCreationAsStatement - for (int inv = -1; inv <= 0; inv++) - { - int invL = inv; - CTestHelpers.AssertFail(() => new CChallengeRounds(invL, 1, 1)); - CTestHelpers.AssertFail(() => new CChallengeRounds(1, invL, 1)); - CTestHelpers.AssertFail(() => new CChallengeRounds(1, 1, invL)); - } - } - - private static void _CheckRounds(CChallengeRounds rounds, int numPlayer) - { - List numSongs = new List(numPlayer); - for (int i = 0; i < numPlayer; i++) - numSongs.Add(0); - for (int i = 0; i < rounds.Count; i++) - { - foreach (int player in rounds[i].Players) - { - Assert.IsTrue(player >= 0 && player < numPlayer); - numSongs[player]++; - } - } - Assert.IsTrue(numSongs.Min() == numSongs.Max(), "Some players have more songs than others"); - } - - [TestMethod] - public void TestRoundGeneration() - { - CBase.Game = new CBGame(); - CLog.Init(CSettings.FolderNameLogs, CSettings.FileNameMainLog, CSettings.FileNameSongLog, CSettings.FileNameCrashMarker, CSettings.GetFullVersionText(), CReporter.ShowReporterFunc); - for (int i = 0; i < 10; i++) - { - for (int numPlayer = 1; numPlayer <= 20; numPlayer++) - { - for (int numMic = 1; numMic <= 6; numMic++) - { - int roundFactor = (numPlayer % numMic == 0) ? numPlayer / numMic : numPlayer; - for (int numRounds = roundFactor; numRounds <= 100 && numRounds <= roundFactor * 5; numRounds += roundFactor) - { - CChallengeRounds rounds = new CChallengeRounds(numRounds, numPlayer, numMic); - Assert.IsTrue(rounds.Count >= numRounds); - _CheckRounds(rounds, numPlayer); - if (rounds.Count != numRounds) - CLog.Debug("Number of rounds does not match. Expected: " + numRounds + ", Is: " + rounds.Count + " for " + numPlayer + "/" + - ((numPlayer < numMic) ? numPlayer : numMic)); - } - } - } - } - } - } -} \ No newline at end of file diff --git a/VocaluxeTests/Properties/AssemblyInfo.cs b/VocaluxeTests/Properties/AssemblyInfo.cs deleted file mode 100644 index 6001c0da..00000000 --- a/VocaluxeTests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über folgende -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die einer Assembly zugeordnet sind. - -[assembly: AssemblyTitle("VocaluxeTests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("VocaluxeTests")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Wenn ComVisible auf "false" festgelegt wird, sind die Typen innerhalb dieser Assembly -// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von -// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. - -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird - -[assembly: Guid("3bdc6da5-a651-452e-903c-deec310288ad")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern -// durch Einsatz von '*', wie in nachfolgendem Beispiel: -// [Assembly: AssemblyVersion("1.0.*")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/VocaluxeTests/TestXmlFiles/Dictionary`2.xml b/VocaluxeTests/TestXmlFiles/Dictionary`2.xml deleted file mode 100644 index 299972ec..00000000 --- a/VocaluxeTests/TestXmlFiles/Dictionary`2.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - Deutsch - Vocaluxe - und - Exit - Speichern - Zurück - Start - Audio-Streams - Video-Streams - Textures - ToneAbs - Max. Volume - Geladene Songs - Maus - Speicherverbrauch - Normal - Duett - Medley - Kurz-Version - Vocal Hero - Superstar - Hit-Künstler - Sternchen - Fortgeschritten - Möchtegern - Amateur - Nichtskönner - Gast - Normaler Benutzer - Administrator - Tastatur - \ No newline at end of file diff --git a/VocaluxeTests/TestXmlFiles/SConfig.xml b/VocaluxeTests/TestXmlFiles/SConfig.xml deleted file mode 100644 index c2258062..00000000 --- a/VocaluxeTests/TestXmlFiles/SConfig.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - TR_CONFIG_LEVEL_MAX - TR_CONFIG_ON - - - TR_CONFIG_DIRECT3D - TR_CONFIG_TEXTURE_HIGH - 128 - 1024 - 576 - Middle - 0 - 1 - 0 - 0 - X0 - 60 - TR_CONFIG_ON - TR_CONFIG_OFF - 0.4 - - - Ambient - Blue - Blue - TR_CONFIG_ON - TR_CONFIG_ON - TR_CONFIG_TIMERLOOK_EXPANDED - TR_CONFIG_PLAYERINFO_BOTH - TR_CONFIG_FADEPLAYERINFO_OFF - TR_CONFIG_COVERLOADING_ATSTART - Slide - - - GstreamerSharp - PortAudio - B2048 - 0 - TR_CONFIG_ON - 20 - TR_CONFIG_NO_OWN_MUSIC - TR_CONFIG_ON - 50 - 100 - - - Deutsch - E:\Songs - TR_CONFIG_TILE_BOARD - TR_CONFIG_ARTIST_LETTER - TR_CONFIG_ON - 10 - TR_CONFIG_TIMERMODE_REMAINING - 1 - TR_CONFIG_ON - TR_CONFIG_LYRICSPOSITION_BOTTOM - 0.1 - - guest1.xml - guest1.xml - guest1.xml - guest1.xml - - - - - - - - Mikrofon (C-Media USB Headphone Set ) - Mikrofon (C-Media USB Headphone Set )6 - 1 - - 120 - - - TR_CONFIG_ON - TR_CONFIG_ON - 3000 - - \ No newline at end of file diff --git a/VocaluxeTests/TestXmlFiles/SDefaultFonts.xml b/VocaluxeTests/TestXmlFiles/SDefaultFonts.xml deleted file mode 100644 index ad954596..00000000 --- a/VocaluxeTests/TestXmlFiles/SDefaultFonts.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Normal - 0 - - 0 - 0 - 0 - 1 - - FreeSans - FreeSans.ttf - FreeSansBold.ttf - FreeSansOblique.ttf - FreeSansBoldOblique.ttf - - - Outline - 0.1 - - 0 - 0 - 0 - 1 - - FreeSans - FreeSans.ttf - FreeSansBold.ttf - FreeSansOblique.ttf - FreeSansBoldOblique.ttf - - - \ No newline at end of file diff --git a/VocaluxeTests/TestXmlFiles/SSkin.xml b/VocaluxeTests/TestXmlFiles/SSkin.xml deleted file mode 100644 index 23f2a3df..00000000 --- a/VocaluxeTests/TestXmlFiles/SSkin.xml +++ /dev/null @@ -1,268 +0,0 @@ - - - 4 - - Blue - bohning - 0 - 0 - - - - 0 - 0 - 1 - 1 - - - 1 - 0 - 0 - 1 - - - 0 - 1 - 0 - 1 - - - 0.5 - 0 - 1 - 1 - - - 1 - 0.8 - 0 - 1 - - - 1 - 0 - 0.5 - 1 - - - 0 - 0 - 0.75 - 1 - - - 0.675 - 0.89 - 0.969 - 1 - - - 0.675 - 0.89 - 0.969 - 0.5 - - - 0.675 - 0.89 - 0.969 - 0.6 - - - 0.675 - 0.89 - 0.969 - 0.3 - - - 0.675 - 0.89 - 0.969 - 1 - - - 0.675 - 0.89 - 0.969 - 0.5 - - - 0.675 - 0.89 - 0.969 - 1 - - - 0.675 - 0.89 - 0.969 - 1 - - - 0.675 - 0.89 - 0.969 - 0.5 - - - 0.675 - 0.89 - 0.969 - 0.5 - - - 0.675 - 0.89 - 0.969 - 0.3 - - - 0.675 - 0.89 - 0.969 - 1 - - - 0.675 - 0.89 - 0.969 - 0.5 - - - 0.675 - 0.89 - 0.969 - 1 - - - 1 - 0 - 0 - 1 - - - 0 - 0 - 0 - 1 - - - 1 - 1 - 1 - 1 - - - 1 - 1 - 1 - 1 - - - 1 - 1 - 1 - 0 - - - 0 - 0 - 1 - 1 - - - 0 - 0 - 0 - 1 - - - 0.3 - 0.3 - 0.3 - 1 - - - 0 - 0 - 1 - 0.5 - - - 0.8 - 0.95 - 1 - 0.5 - - - 0.8 - 0.95 - 1 - 0.85 - - - - [Blue]BG_Default.png - [Blue]BG_Options.png - Menu.png - - CoverTile.png - CoverBackground.png - Cursor.png - TimeBar.png - TimeLine.png - Pointer.png - SelectSlide.png - SelectSlidePlayer.png - SelectSlideArrowLeft.png - SelectSlideArrowRight.png - notes_left.png - notes_mid.png - notes_right.png - notes_bg_left.png - notes_bg_mid.png - notes_bg_right.png - points_bar.png - points_bar_bg.png - Lyrics.png - LyricHelper.png - ToneHelper.png - TextBG.png - Score.png - Star.png - Snowflake.png - SongMenu.png - PerfectNoteStar.png - Pause.png - EnergyBeam.png - DuetIcon.png - VideoIcon.png - VideoIconCO.png - VideoIconBG.png - MedleyCalcIcon.png - MedleyTagIcon.png - PlayerSelector.png - PreviousIcon.png - NextIcon.png - PlayIcon.png - PauseIcon.png - RepeatIcon.png - SongMenuBG.png - Close.png - Delete.png - Save.png - Sing.png - Minus.png - Plus.png - Random.png - Popup.png - ScrollUp.png - ScrollDown.png - - - [Blue]BG_Video.mp4 - [Blue]IntroIn.mp4 - [Blue]IntroMid.mp4 - [Blue]IntroOut.mp4 - - \ No newline at end of file diff --git a/VocaluxeTests/TestXmlFiles/STheme.xml b/VocaluxeTests/TestXmlFiles/STheme.xml deleted file mode 100644 index 91b0c674..00000000 --- a/VocaluxeTests/TestXmlFiles/STheme.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - 5 - - Ambient - bohning - 0 - 2 - - - Cursor - 40 - 40 - - - \ No newline at end of file diff --git a/VocaluxeTests/TestXmlFiles/SThemeCover.xml b/VocaluxeTests/TestXmlFiles/SThemeCover.xml deleted file mode 100644 index bb43c51f..00000000 --- a/VocaluxeTests/TestXmlFiles/SThemeCover.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - Blue - Blue - flokuep - - - - %TEXT% - - Normal - - 500 - - - 1 - 1 - 1 - 0.8 - - - 24 - - 100 - - - 1 - 1 - 1 - 1 - - EmptyCover.png - 0.75 - True - - \ No newline at end of file diff --git a/VocaluxeTests/TestXmlFiles/SThemeScreen.xml b/VocaluxeTests/TestXmlFiles/SThemeScreen.xml deleted file mode 100644 index a6751013..00000000 --- a/VocaluxeTests/TestXmlFiles/SThemeScreen.xml +++ /dev/null @@ -1,256 +0,0 @@ - - - - ScreenMain - 2 - - - - Video - - - BG_Default - - - - - - Menu - - - 49 - 32 - 1181 - 50 - 0 - - - - TextBG - - - 150 - 610 - 355 - 30 - -1.9 - - - - - - 10 - 690 - -1 - 15 - 0 - - - Left - Center - - Normal - Vocaluxe "Shining Heaven" v0.3.0 (x64) Beta (0083) - - - 320 - 612 - -2 - 27 - 355 - - - Center - Center - - Outline - TR_SCREENMAIN_TEXT_NOPROFILES - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/VocaluxeTests/VocaluxeTests.csproj b/VocaluxeTests/VocaluxeTests.csproj deleted file mode 100644 index 772672eb..00000000 --- a/VocaluxeTests/VocaluxeTests.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - Debug - AnyCPU - {93356718-3A0B-4784-AAE1-215065BFFC66} - Library - Properties - VocaluxeTests - VocaluxeTests - v4.7.1 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - - true - bin\x64\Debug\ - TRACE;DEBUG - full - x64 - prompt - MinimumRecommendedRules.ruleset - - - bin\x64\Release\ - TRACE - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - - - true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - - - bin\x86\Release\ - TRACE - true - pdbonly - x86 - prompt - MinimumRecommendedRules.ruleset - - - - - - False - ..\Output\libs\managed\VocaluxeLib.dll - - - - - - - - - - - - - - - - - - - - - - - - {5a4053f1-5ad5-441f-b254-d97a088127b6} - PartyModeChallenge - - - {2a1e0f2d-5392-4bb7-b0a1-a9dfa13e79ff} - Vocaluxe - - - - - - - False - - - False - - - False - - - False - - - - - - - - \ No newline at end of file diff --git a/VocaluxeTests/XmlSerializerTest.cs b/VocaluxeTests/XmlSerializerTest.cs deleted file mode 100644 index 91605a7e..00000000 --- a/VocaluxeTests/XmlSerializerTest.cs +++ /dev/null @@ -1,490 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.IO; -using System.Xml.Serialization; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Vocaluxe.Base; -using VocaluxeLib; -using VocaluxeLib.Menu; -using VocaluxeLib.Xml; - -namespace VocaluxeTests -{ - [TestClass] - public class CXmlSerializerTest - { - private const string _Head = "\r\n"; - private const string _Empty = _Head + @""; - -#pragma warning disable 649 -#pragma warning disable 169 - private struct SBasic - { - public int I; - public string S; - public float F; - public double D; - } - - [XmlType("Entry")] - private struct SEntry - { - public int I; - } - - private struct SList - { - [XmlArray] public List Ints; - } - - private struct SArray - { - [XmlArray] public SEntry[] Ints; - } - - private struct SListEmb - { - public int I; - [XmlElement("Entry")] public List Ints; - public int J; - } - - private struct SArrayEmb - { - public int I; - [XmlElement("Entry")] public SEntry[] Ints; - public int J; - } - - private struct SProperty - { - [XmlIgnore] public int Private; - // ReSharper disable UnusedMember.Local - public int Public - { - get { return Private - 1; } - set { Private = value + 1; } - } - // ReSharper restore UnusedMember.Local - // ReSharper disable UnusedAutoPropertyAccessor.Local - public int Auto { get; set; } - // ReSharper restore UnusedAutoPropertyAccessor.Local - } - - private struct SBytes - { - public byte[] B; - } - - private struct SIgnore - { - [XmlIgnore] public int I; - public int J; - } - - private class CIgnore - { - [XmlIgnore] public int I; - public int J; - } - - private struct SDefaultSub - { - [DefaultValue(111)] public int I; - } - - private struct SDefault - { - [DefaultValue(1337)] public int I; - [DefaultValue("Foo")] public string S; - public float? F; - [DefaultValue(666.0)] public double D; - public SDefaultSub Sub; - } - -#pragma warning restore 169 -#pragma warning restore 649 - - private static void _AssertFail(String xmlString) where T2 : Exception where T : new() - { - var deserializer = new CXmlDeserializer(); - CTestHelpers.AssertFail(() => deserializer.DeserializeString(xmlString)); - } - - private static T _AssertSerDeserMatch(string xmlString) where T : new() - { - var deserializer = new CXmlDeserializer(); - var serializer = new CXmlSerializer(); - T foo = deserializer.DeserializeString(xmlString); - string xmlNew = serializer.Serialize(foo); - Assert.AreEqual(xmlString, xmlNew); - return foo; - } - - [TestMethod] - public void TestBasic() - { - const string s = @" - 1 - 2 - 3 - 4 -"; - const string sUnordered = @" - 4 - 1 - 3 - 2 -"; - var xml = new CXmlDeserializer(); - SBasic foo = xml.DeserializeString(s); - Assert.AreEqual(1, foo.I); - Assert.AreEqual("2", foo.S); - Assert.AreEqual(3, foo.F, 0.0001); - Assert.AreEqual(4, foo.D, 0.0001); - foo = xml.DeserializeString(sUnordered); - Assert.AreEqual(1, foo.I); - Assert.AreEqual("2", foo.S); - Assert.AreEqual(3, foo.F, 0.0001); - Assert.AreEqual(4, foo.D, 0.0001); - } - - [TestMethod] - public void TestMissingXmlElement() - { - string[] s = new string[] {@" - 2 - 3 - 4 -", @" - 1 - 3 - 4 -", @" - 1 - 2 - 3 -"}; - foreach (string s1 in s) - { - string sTmp = s1; - _AssertFail(sTmp); - } - } - - [TestMethod] - public void TestMissingStructElement() - { - string[] s = new string[] {@" - 1 - 1 - 2 - 3 - 4 -", @" - 1 - 1 - 2 - 3 - 4 -", @" - 1 - 2 - 3 - 4 - 1 -"}; - foreach (string s1 in s) - { - string sTmp = s1; - _AssertFail(sTmp); - } - } - - [TestMethod] - public void TestBasicSerialization() - { - const string s = _Head + @" - 1 - 2 - 3 - 4 -"; - _AssertSerDeserMatch(s); - } - - private readonly string[] _XmlList = new string[] - { - _Head + @" - - - 1 - - - 1 - - -", - _Head + @" - - -", - _Head + @" - -" - }; - - [TestMethod] - public void TestList() - { - var xml = new CXmlDeserializer(); - var ser = new CXmlSerializer(); - SList foo = xml.DeserializeString(_XmlList[0]); - Assert.AreEqual(foo.Ints.Count, 2, "Deserialization failed"); - Assert.AreEqual(foo.Ints[0].I, 1, "Deserialization failed"); - Assert.AreEqual(foo.Ints[1].I, 1, "Deserialization failed"); - string res = ser.Serialize(foo); - Assert.AreEqual(_XmlList[0], res, "Serialization failed"); - foo = xml.DeserializeString(_XmlList[1]); - Assert.AreEqual(foo.Ints.Count, 0, "Deserialization2 failed"); - res = ser.Serialize(foo); - Assert.AreEqual(_XmlList[2], res, "Serialization2 failed"); - foo = xml.DeserializeString(_XmlList[2]); - Assert.AreEqual(foo.Ints.Count, 0, "Deserialization2 failed"); - _AssertSerDeserMatch(_XmlList[2]); - res = ser.Serialize(foo); - Assert.AreEqual(_XmlList[2], res, "Serialization2 failed"); - _AssertFail(_Empty); - } - - [TestMethod] - public void TestArray() - { - var xml = new CXmlDeserializer(); - var ser = new CXmlSerializer(); - SArray foo = xml.DeserializeString(_XmlList[0]); - Assert.AreEqual(foo.Ints.Length, 2, "Deserialization failed"); - Assert.AreEqual(foo.Ints[0].I, 1, "Deserialization failed"); - Assert.AreEqual(foo.Ints[1].I, 1, "Deserialization failed"); - string res = ser.Serialize(foo); - Assert.AreEqual(_XmlList[0], res, "Serialization failed"); - foo = xml.DeserializeString(_XmlList[1]); - Assert.AreEqual(foo.Ints.Length, 0, "Deserialization2 failed"); - res = ser.Serialize(foo); - Assert.AreEqual(_XmlList[2], res, "Serialization2 failed"); - foo = xml.DeserializeString(_XmlList[2]); - Assert.AreEqual(foo.Ints.Length, 0, "Deserialization2 failed"); - res = ser.Serialize(foo); - Assert.AreEqual(_XmlList[2], res, "Serialization2 failed"); - _AssertFail(_Empty); - } - - private const string _XmlListEmb = _Head + @" - 2 - - 1 - - 3 -"; - private const string _XmlListEmb2 = _Head + @" - 2 - - 1 - - - 2 - - 3 -"; - private const string _XmlListEmb3 = _Head + @" - 2 - 3 -"; - private const string _XmlListEmb4 = _Head + @" - 2 - - 3 -"; - - [TestMethod] - public void TestListEmbedded() - { - var xml = new CXmlDeserializer(); - var ser = new CXmlSerializer(); - SListEmb foo = xml.DeserializeString(_XmlListEmb); - Assert.AreEqual(foo.Ints.Count, 1, "Deserialization failed"); - Assert.AreEqual(foo.Ints[0].I, 1, "Deserialization failed"); - string res = ser.Serialize(foo); - Assert.AreEqual(_XmlListEmb, res, "Serialization failed"); - foo = xml.DeserializeString(_XmlListEmb2); - Assert.AreEqual(foo.Ints.Count, 2, "Deserialization failed"); - Assert.AreEqual(foo.Ints[1].I, 2, "Deserialization failed"); - res = ser.Serialize(foo); - Assert.AreEqual(_XmlListEmb2, res, "Serialization failed"); - foo = xml.DeserializeString(_XmlListEmb3); - Assert.AreEqual(foo.Ints.Count, 0, "Deserialization failed"); - res = ser.Serialize(foo); - Assert.AreEqual(_XmlListEmb3, res, "Serialization failed"); - ser = new CXmlSerializer(true); - foo.Ints.Clear(); - res = ser.Serialize(foo); - Assert.AreEqual(_XmlListEmb4, res, "Serialization failed"); - _AssertFail(_Empty); - } - - [TestMethod] - public void TestArrayEmbedded() - { - var xml = new CXmlDeserializer(); - var ser = new CXmlSerializer(); - SArrayEmb foo = xml.DeserializeString(_XmlListEmb); - Assert.AreEqual(foo.Ints.Length, 1, "Deserialization failed"); - Assert.AreEqual(foo.Ints[0].I, 1, "Deserialization failed"); - string res = ser.Serialize(foo); - Assert.AreEqual(_XmlListEmb, res, "Serialization failed"); - foo = xml.DeserializeString(_XmlListEmb2); - Assert.AreEqual(foo.Ints.Length, 2, "Deserialization failed"); - Assert.AreEqual(foo.Ints[1].I, 2, "Deserialization failed"); - res = ser.Serialize(foo); - Assert.AreEqual(_XmlListEmb2, res, "Serialization failed"); - foo = xml.DeserializeString(_XmlListEmb3); - Assert.AreEqual(foo.Ints.Length, 0, "Deserialization failed"); - res = ser.Serialize(foo); - Assert.AreEqual(_XmlListEmb3, res, "Serialization failed"); - ser = new CXmlSerializer(true); - foo.Ints = new SEntry[0]; - res = ser.Serialize(foo); - Assert.AreEqual(_XmlListEmb4, res, "Serialization failed"); - _AssertFail(_Empty); - } - - [TestMethod] - public void TestProperty() - { - const string xmlString = _Head + @" - 2 - 3 -"; - SProperty foo = _AssertSerDeserMatch(xmlString); - Assert.AreEqual(3, foo.Private); - Assert.AreEqual(3, foo.Auto); - } - - [TestMethod] - public void TestByteArray() - { - const string xmlString = _Head + @" - MTMzNw== -"; - _AssertSerDeserMatch(xmlString); - } - - private const string _XmlIgnore = _Head + @" - 2 -"; - private const string _XmlIgnore2 = _Head + @" - 2 - 2 -"; - - [TestMethod] - public void TestIgnore() - { - _AssertSerDeserMatch(_XmlIgnore); - _AssertFail(_XmlIgnore2); - } - - [TestMethod] - public void TestExisting() - { - var foo = new SIgnore {I = 1}; - var xml = new CXmlDeserializer(); - var ser = new CXmlSerializer(); - SIgnore bar = xml.DeserializeString(_XmlIgnore, foo); - Assert.AreEqual(1, bar.I); - Assert.AreEqual(_XmlIgnore, ser.Serialize(bar)); - - var foo2 = new CIgnore {I = 1}; - CIgnore bar2 = xml.DeserializeString(_XmlIgnore, foo2); - Assert.AreEqual(1, bar2.I); - Assert.AreEqual(foo2.J, bar2.J, "Original classes should be modified by the deserialization"); - Assert.AreEqual(_XmlIgnore, ser.Serialize(bar2)); - } - - [TestMethod] - public void TestOnlyList() - { - const string s = _Head + @" - 2 - 3 -"; - _AssertSerDeserMatch>(s); - } - - [TestMethod] - public void TestOnlyDict() - { - const string s = _Head + @" - 2 - 3 -"; - _AssertSerDeserMatch>(s); - } - - [TestMethod] - public void TestDefaultValues() - { - const string s = _Head + @" - 1 - 2 - 3 - 4 - - 22 - -"; - _AssertSerDeserMatch(s); - var xml = new CXmlDeserializer(new CXmlErrorHandler(exception => { })); - SDefault foo = xml.DeserializeString(@""); - Assert.AreEqual(foo.I, 1337); - Assert.AreEqual(foo.F, null); - Assert.AreEqual(foo.S, "Foo"); - Assert.AreEqual(foo.D, 666); - Assert.AreEqual(foo.Sub.I, 111); - string newXml = new CXmlSerializer().Serialize(foo); - Assert.AreEqual(_Head + @" - -", newXml); - } - - [TestMethod] - public void TestRealFiles() - { - Type[] types = new Type[] - {typeof(SThemeCover), typeof(CConfig.SConfig), typeof(SThemeScreen), typeof(SDefaultFonts), typeof(SSkin), typeof(STheme), typeof(Dictionary)}; - string filePath = Path.Combine(new string[] {AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "TestXmlFiles"}); - foreach (Type type in types) - { - string xmlPath = Path.Combine(filePath, type.Name + ".xml"); - var deser = new CXmlDeserializer(); - object foo = null; - try - { - foo = deser.Deserialize(xmlPath, Activator.CreateInstance(type)); - } - catch (Exception e) - { - Assert.Fail("Exception with " + type.Name + ": {0}", new object[] {e.Message}); - } - Assert.IsInstanceOfType(foo, type, "Wrong type with " + type.Name); - var ser = new CXmlSerializer(type == typeof(CConfig.SConfig)); - string newXml = ser.Serialize(foo, type == typeof(Dictionary) ? "resources" : null); - // Typename will be uppercase but input is lowercase - newXml = newXml.Replace(" Date: Thu, 15 Mar 2018 15:38:09 +0100 Subject: [PATCH 02/28] Removed TestProject from sln (for some reason this was not done by VS) --- Vocaluxe.sln | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/Vocaluxe.sln b/Vocaluxe.sln index a9b3384d..89870f23 100644 --- a/Vocaluxe.sln +++ b/Vocaluxe.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.10 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vocaluxe", "Vocaluxe\Vocaluxe.csproj", "{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}" ProjectSection(ProjectDependencies) = postProject @@ -21,8 +21,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebserverInitalConfig", "We EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PitchTracker", "PitchTracker\PitchTracker.vcxproj", "{54A48AF7-515C-4EDD-B395-2BFFA096050A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VocaluxeTests", "VocaluxeTests\VocaluxeTests.csproj", "{93356718-3A0B-4784-AAE1-215065BFFC66}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2BDDF9CE-271F-49C6-A92E-9CB6185ACF58}" ProjectSection(SolutionItems) = preProject Vocaluxe.testsettings = Vocaluxe.testsettings @@ -157,27 +155,6 @@ Global {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x64.ActiveCfg = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x64.Build.0 = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x86.ActiveCfg = Release|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x86.Build.0 = Release|Win32 - {93356718-3A0B-4784-AAE1-215065BFFC66}.DebugLinux|x64.ActiveCfg = Debug|x64 - {93356718-3A0B-4784-AAE1-215065BFFC66}.DebugLinux|x64.Build.0 = Debug|x64 - {93356718-3A0B-4784-AAE1-215065BFFC66}.DebugLinux|x86.ActiveCfg = Debug|x86 - {93356718-3A0B-4784-AAE1-215065BFFC66}.DebugLinux|x86.Build.0 = Debug|x86 - {93356718-3A0B-4784-AAE1-215065BFFC66}.DebugWin|x64.ActiveCfg = Debug|x64 - {93356718-3A0B-4784-AAE1-215065BFFC66}.DebugWin|x64.Build.0 = Debug|x64 - {93356718-3A0B-4784-AAE1-215065BFFC66}.DebugWin|x86.ActiveCfg = Debug|x86 - {93356718-3A0B-4784-AAE1-215065BFFC66}.DebugWin|x86.Build.0 = Debug|x86 - {93356718-3A0B-4784-AAE1-215065BFFC66}.InstallerWin|x64.ActiveCfg = Release|x64 - {93356718-3A0B-4784-AAE1-215065BFFC66}.InstallerWin|x64.Build.0 = Release|x64 - {93356718-3A0B-4784-AAE1-215065BFFC66}.InstallerWin|x86.ActiveCfg = Release|x86 - {93356718-3A0B-4784-AAE1-215065BFFC66}.InstallerWin|x86.Build.0 = Release|x86 - {93356718-3A0B-4784-AAE1-215065BFFC66}.ReleaseLinux|x64.ActiveCfg = Release|x64 - {93356718-3A0B-4784-AAE1-215065BFFC66}.ReleaseLinux|x64.Build.0 = Release|x64 - {93356718-3A0B-4784-AAE1-215065BFFC66}.ReleaseLinux|x86.ActiveCfg = Release|x86 - {93356718-3A0B-4784-AAE1-215065BFFC66}.ReleaseLinux|x86.Build.0 = Release|x86 - {93356718-3A0B-4784-AAE1-215065BFFC66}.ReleaseWin|x64.ActiveCfg = Release|x64 - {93356718-3A0B-4784-AAE1-215065BFFC66}.ReleaseWin|x64.Build.0 = Release|x64 - {93356718-3A0B-4784-AAE1-215065BFFC66}.ReleaseWin|x86.ActiveCfg = Release|x86 - {93356718-3A0B-4784-AAE1-215065BFFC66}.ReleaseWin|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 881b5a9d5ea009b88b7d382e8b93b263c3a6d9b4 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 16 Mar 2018 13:29:30 +0100 Subject: [PATCH 03/28] Added new test-project (with nunit3) and ported the CCombinations tests --- Tests/Properties/AssemblyInfo.cs | 33 ++++ Tests/Tests.csproj | 77 ++++++++ .../Utils/Combinatorics/CCombinationsTest.cs | 73 +++++++ Tests/packages.config | 5 + Vocaluxe.sln | 180 ++++++++++++++++++ 5 files changed, 368 insertions(+) create mode 100644 Tests/Properties/AssemblyInfo.cs create mode 100644 Tests/Tests.csproj create mode 100644 Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs create mode 100644 Tests/packages.config diff --git a/Tests/Properties/AssemblyInfo.cs b/Tests/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..bb5ab59a --- /dev/null +++ b/Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Vocaluxe Tests")] +[assembly: AssemblyDescription("Testcases for Vocaluxe")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Vocaluxe Team")] +[assembly: AssemblyProduct("VocluceTests")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj new file mode 100644 index 00000000..357adb5d --- /dev/null +++ b/Tests/Tests.csproj @@ -0,0 +1,77 @@ + + + + + + + Debug + AnyCPU + {8EDF4429-251A-416D-BB68-93F227191BCF} + Library + Properties + Tests + Tests + v4.7.1 + 512 + + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\NUnit.3.10.1\lib\net45\nunit.framework.dll + True + + + + + + + + + + Designer + + + + + + + + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC} + VocaluxeLib + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs b/Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs new file mode 100644 index 00000000..20764310 --- /dev/null +++ b/Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using NUnit.Framework; +using VocaluxeLib.Utils.Combinatorics; + +namespace Tests.VocaluxeLib.Utils.Combinatorics +{ + [TestFixture] + public class CCombinationsTest + { + [Test] + public void TestCount() + { + Assert.AreEqual(4, CCombinations.Count(4, 3)); + Assert.AreEqual(6, CCombinations.Count(4, 2)); + Assert.AreEqual(66, CCombinations.Count(12, 2)); + // Corner cases + for (int i = 1; i < 12; i++) + { + Assert.AreEqual(1, CCombinations.Count(i, 0)); + Assert.AreEqual(1, CCombinations.Count(i, i)); + Assert.AreEqual(0, CCombinations.Count(i, i + 1)); + } + // Check identity (n k) = (n n-k) + for (int i = 0; i <= 12; i++) + Assert.AreEqual(CCombinations.Count(12, i), CCombinations.Count(12, 12 - i)); + Assert.That(() => CCombinations.Count(-1, -1), Throws.TypeOf()); + Assert.That(() => CCombinations.Count(-1, 1), Throws.TypeOf()); + Assert.That(() => CCombinations.Count(1, -1), Throws.TypeOf()); + } + + [Test] + public void TestResults([Range(0, 8, 1)] int n) + { + Random rand = new Random(); + + for (int k = 0; k <= n; k++) + { + List collection = new List(n); + int r = rand.Next(1000); + for (int i = 0; i < n; i++) + collection.Add(i + r); + CCombinations combs = new CCombinations(collection, k); + Assert.AreEqual(CCombinations.Count(n, k), combs.Count()); + _CheckResults(combs, collection); + } + } + + // ReSharper disable UnusedParameter.Local + private static void _CheckResults(CCombinations combs, List input) + // ReSharper restore UnusedParameter.Local + { + List> results = new List>(); + foreach (List comb in combs) + { + foreach (List other in results) + Assert.IsFalse(other.SequenceEqual(comb), "Result must be unique"); + for (int i = 0; i < comb.Count - 1; i++) + { + Assert.IsTrue(comb.IndexOf(comb[i], i + 1) < 0, "Repetition not allowed"); + Assert.IsTrue(input.Contains(comb[i]), "Output must be in input sequence"); + } + results.Add(comb); + } + Assert.AreEqual(combs.Count(), results.Count); + List> results2 = combs.GetAll(); + Assert.AreEqual(results.Count, results2.Count); + for (int i = 0; i < results2.Count; i++) + Assert.IsTrue(results[i].SequenceEqual(results2[i])); + } + } +} diff --git a/Tests/packages.config b/Tests/packages.config new file mode 100644 index 00000000..5626b849 --- /dev/null +++ b/Tests/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Vocaluxe.sln b/Vocaluxe.sln index 89870f23..19abfb0a 100644 --- a/Vocaluxe.sln +++ b/Vocaluxe.sln @@ -26,135 +26,315 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Vocaluxe.testsettings = Vocaluxe.testsettings EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{8EDF4429-251A-416D-BB68-93F227191BCF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + DebugLinux|Any CPU = DebugLinux|Any CPU DebugLinux|x64 = DebugLinux|x64 DebugLinux|x86 = DebugLinux|x86 + DebugWin|Any CPU = DebugWin|Any CPU DebugWin|x64 = DebugWin|x64 DebugWin|x86 = DebugWin|x86 + InstallerWin|Any CPU = InstallerWin|Any CPU InstallerWin|x64 = InstallerWin|x64 InstallerWin|x86 = InstallerWin|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + ReleaseLinux|Any CPU = ReleaseLinux|Any CPU ReleaseLinux|x64 = ReleaseLinux|x64 ReleaseLinux|x86 = ReleaseLinux|x86 + ReleaseWin|Any CPU = ReleaseWin|Any CPU ReleaseWin|x64 = ReleaseWin|x64 ReleaseWin|x86 = ReleaseWin|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|Any CPU.ActiveCfg = ReleaseWin|x86 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|Any CPU.Build.0 = ReleaseWin|x86 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|x64.ActiveCfg = DebugWin|x64 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|x64.Build.0 = DebugWin|x64 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|x86.ActiveCfg = DebugWin|x86 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|x86.Build.0 = DebugWin|x86 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugLinux|Any CPU.ActiveCfg = DebugLinux|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugLinux|x64.ActiveCfg = DebugLinux|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugLinux|x64.Build.0 = DebugLinux|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugLinux|x86.ActiveCfg = DebugLinux|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugLinux|x86.Build.0 = DebugLinux|x86 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|Any CPU.ActiveCfg = DebugWin|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x64.ActiveCfg = DebugWin|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x64.Build.0 = DebugWin|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x86.ActiveCfg = DebugWin|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x86.Build.0 = DebugWin|x86 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.InstallerWin|Any CPU.ActiveCfg = InstallerWin|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.InstallerWin|x64.ActiveCfg = InstallerWin|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.InstallerWin|x64.Build.0 = InstallerWin|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.InstallerWin|x86.ActiveCfg = InstallerWin|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.InstallerWin|x86.Build.0 = InstallerWin|x86 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|Any CPU.ActiveCfg = ReleaseWin|x86 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|Any CPU.Build.0 = ReleaseWin|x86 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|x64.ActiveCfg = ReleaseWin|x64 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|x64.Build.0 = ReleaseWin|x64 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|x86.ActiveCfg = ReleaseWin|x86 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|x86.Build.0 = ReleaseWin|x86 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseLinux|Any CPU.ActiveCfg = ReleaseLinux|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseLinux|x64.Build.0 = ReleaseLinux|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseLinux|x86.Build.0 = ReleaseLinux|x86 + {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|Any CPU.ActiveCfg = ReleaseWin|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x64.ActiveCfg = ReleaseWin|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x64.Build.0 = ReleaseWin|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x86.ActiveCfg = ReleaseWin|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x86.Build.0 = ReleaseWin|x86 + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Debug|Any CPU.ActiveCfg = DebugWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Debug|Any CPU.Build.0 = DebugWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Debug|x64.ActiveCfg = DebugWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Debug|x64.Build.0 = DebugWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Debug|x86.ActiveCfg = DebugWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Debug|x86.Build.0 = DebugWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|Any CPU.ActiveCfg = DebugLinux|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|Any CPU.Build.0 = DebugLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|x64.ActiveCfg = DebugLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|x64.Build.0 = DebugLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|x86.ActiveCfg = DebugLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|x86.Build.0 = DebugLinux|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|Any CPU.ActiveCfg = DebugWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|Any CPU.Build.0 = DebugWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|x64.ActiveCfg = DebugWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|x64.Build.0 = DebugWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|x86.ActiveCfg = DebugWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|x86.Build.0 = DebugWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.InstallerWin|Any CPU.ActiveCfg = InstallerWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.InstallerWin|Any CPU.Build.0 = InstallerWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.InstallerWin|x64.ActiveCfg = InstallerWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.InstallerWin|x64.Build.0 = InstallerWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.InstallerWin|x86.ActiveCfg = InstallerWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.InstallerWin|x86.Build.0 = InstallerWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Release|Any CPU.ActiveCfg = ReleaseWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Release|Any CPU.Build.0 = ReleaseWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Release|x64.ActiveCfg = ReleaseWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Release|x64.Build.0 = ReleaseWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Release|x86.ActiveCfg = ReleaseWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Release|x86.Build.0 = ReleaseWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|Any CPU.ActiveCfg = ReleaseLinux|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|Any CPU.Build.0 = ReleaseLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|x64.Build.0 = ReleaseLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|x86.Build.0 = ReleaseLinux|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|Any CPU.ActiveCfg = ReleaseWin|Any CPU + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|Any CPU.Build.0 = ReleaseWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|x64.ActiveCfg = ReleaseWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|x64.Build.0 = ReleaseWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|x86.ActiveCfg = ReleaseWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|x86.Build.0 = ReleaseWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.Debug|Any CPU.ActiveCfg = DebugWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.Debug|Any CPU.Build.0 = DebugWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.Debug|x64.ActiveCfg = DebugWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.Debug|x64.Build.0 = DebugWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.Debug|x86.ActiveCfg = DebugWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.Debug|x86.Build.0 = DebugWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|Any CPU.ActiveCfg = DebugLinux|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|Any CPU.Build.0 = DebugLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|x64.ActiveCfg = DebugLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|x64.Build.0 = DebugLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|x86.ActiveCfg = DebugLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|x86.Build.0 = DebugLinux|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|Any CPU.ActiveCfg = DebugWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|Any CPU.Build.0 = DebugWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|x64.ActiveCfg = DebugWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|x64.Build.0 = DebugWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|x86.ActiveCfg = DebugWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|x86.Build.0 = DebugWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.InstallerWin|Any CPU.ActiveCfg = InstallerWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.InstallerWin|Any CPU.Build.0 = InstallerWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.InstallerWin|x64.ActiveCfg = InstallerWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.InstallerWin|x64.Build.0 = InstallerWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.InstallerWin|x86.ActiveCfg = InstallerWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.InstallerWin|x86.Build.0 = InstallerWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.Release|Any CPU.ActiveCfg = ReleaseWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.Release|Any CPU.Build.0 = ReleaseWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.Release|x64.ActiveCfg = ReleaseWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.Release|x64.Build.0 = ReleaseWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.Release|x86.ActiveCfg = ReleaseWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.Release|x86.Build.0 = ReleaseWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|Any CPU.ActiveCfg = ReleaseLinux|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|Any CPU.Build.0 = ReleaseLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|x64.Build.0 = ReleaseLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|x86.Build.0 = ReleaseLinux|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|Any CPU.ActiveCfg = ReleaseWin|Any CPU + {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|Any CPU.Build.0 = ReleaseWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|x64.ActiveCfg = ReleaseWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|x64.Build.0 = ReleaseWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|x86.ActiveCfg = ReleaseWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|x86.Build.0 = ReleaseWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.Debug|Any CPU.ActiveCfg = DebugWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.Debug|Any CPU.Build.0 = DebugWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.Debug|x64.ActiveCfg = DebugWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.Debug|x64.Build.0 = DebugWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.Debug|x86.ActiveCfg = DebugWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.Debug|x86.Build.0 = DebugWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|Any CPU.ActiveCfg = DebugLinux|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|Any CPU.Build.0 = DebugLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|x64.ActiveCfg = DebugLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|x64.Build.0 = DebugLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|x86.ActiveCfg = DebugLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|x86.Build.0 = DebugLinux|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|Any CPU.ActiveCfg = DebugWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|Any CPU.Build.0 = DebugWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|x64.ActiveCfg = DebugWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|x64.Build.0 = DebugWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|x86.ActiveCfg = DebugWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|x86.Build.0 = DebugWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.InstallerWin|Any CPU.ActiveCfg = InstallerWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.InstallerWin|Any CPU.Build.0 = InstallerWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.InstallerWin|x64.ActiveCfg = InstallerWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.InstallerWin|x64.Build.0 = InstallerWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.InstallerWin|x86.ActiveCfg = InstallerWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.InstallerWin|x86.Build.0 = InstallerWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.Release|Any CPU.ActiveCfg = ReleaseWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.Release|Any CPU.Build.0 = ReleaseWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.Release|x64.ActiveCfg = ReleaseWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.Release|x64.Build.0 = ReleaseWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.Release|x86.ActiveCfg = ReleaseWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.Release|x86.Build.0 = ReleaseWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|Any CPU.ActiveCfg = ReleaseLinux|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|Any CPU.Build.0 = ReleaseLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|x64.Build.0 = ReleaseLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|x86.Build.0 = ReleaseLinux|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|Any CPU.ActiveCfg = ReleaseWin|Any CPU + {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|Any CPU.Build.0 = ReleaseWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|x64.ActiveCfg = ReleaseWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|x64.Build.0 = ReleaseWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|x86.ActiveCfg = ReleaseWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|x86.Build.0 = ReleaseWin|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.Debug|x64.ActiveCfg = Debug|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.Debug|x64.Build.0 = Debug|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.Debug|x86.ActiveCfg = Debug|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.Debug|x86.Build.0 = Debug|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugLinux|Any CPU.ActiveCfg = Debug|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugLinux|Any CPU.Build.0 = Debug|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugLinux|x64.ActiveCfg = Debug|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugLinux|x86.ActiveCfg = Debug|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugWin|Any CPU.ActiveCfg = Debug|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugWin|Any CPU.Build.0 = Debug|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugWin|x64.ActiveCfg = Debug|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugWin|x64.Build.0 = Debug|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugWin|x86.ActiveCfg = Debug|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugWin|x86.Build.0 = Debug|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.InstallerWin|Any CPU.ActiveCfg = Release|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.InstallerWin|Any CPU.Build.0 = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.InstallerWin|x64.ActiveCfg = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.InstallerWin|x64.Build.0 = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.InstallerWin|x86.ActiveCfg = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.InstallerWin|x86.Build.0 = Release|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.Release|Any CPU.Build.0 = Release|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.Release|x64.ActiveCfg = Release|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.Release|x64.Build.0 = Release|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.Release|x86.ActiveCfg = Release|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.Release|x86.Build.0 = Release|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseLinux|Any CPU.ActiveCfg = Release|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseLinux|Any CPU.Build.0 = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseLinux|x64.ActiveCfg = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseLinux|x86.ActiveCfg = Release|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseWin|Any CPU.ActiveCfg = Release|Any CPU + {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseWin|Any CPU.Build.0 = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseWin|x64.ActiveCfg = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseWin|x64.Build.0 = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseWin|x86.ActiveCfg = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseWin|x86.Build.0 = Release|Any CPU + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Debug|x64.ActiveCfg = Debug|x64 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Debug|x64.Build.0 = Debug|x64 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Debug|x86.ActiveCfg = Debug|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Debug|x86.Build.0 = Debug|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugLinux|Any CPU.ActiveCfg = Release|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugLinux|Any CPU.Build.0 = Release|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugLinux|x64.ActiveCfg = Debug|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugLinux|x64.Build.0 = Debug|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugLinux|x86.ActiveCfg = Debug|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugLinux|x86.Build.0 = Debug|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugWin|Any CPU.ActiveCfg = Release|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugWin|Any CPU.Build.0 = Release|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugWin|x64.ActiveCfg = Debug|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugWin|x64.Build.0 = Debug|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugWin|x86.ActiveCfg = Debug|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugWin|x86.Build.0 = Debug|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.InstallerWin|Any CPU.ActiveCfg = Release|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.InstallerWin|Any CPU.Build.0 = Release|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.InstallerWin|x64.ActiveCfg = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.InstallerWin|x64.Build.0 = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.InstallerWin|x86.ActiveCfg = Release|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.InstallerWin|x86.Build.0 = Release|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Release|Any CPU.ActiveCfg = Release|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Release|x64.ActiveCfg = Release|x64 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Release|x64.Build.0 = Release|x64 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Release|x86.ActiveCfg = Release|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Release|x86.Build.0 = Release|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseLinux|Any CPU.ActiveCfg = Release|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseLinux|Any CPU.Build.0 = Release|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseLinux|x64.ActiveCfg = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseLinux|x64.Build.0 = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseLinux|x86.ActiveCfg = Release|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseLinux|x86.Build.0 = Release|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|Any CPU.ActiveCfg = Release|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|Any CPU.Build.0 = Release|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x64.ActiveCfg = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x64.Build.0 = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x86.ActiveCfg = Release|Win32 + {8EDF4429-251A-416D-BB68-93F227191BCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.Debug|x64.ActiveCfg = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.Debug|x64.Build.0 = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.Debug|x86.ActiveCfg = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.Debug|x86.Build.0 = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|Any CPU.ActiveCfg = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|Any CPU.Build.0 = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x64.ActiveCfg = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x64.Build.0 = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x86.ActiveCfg = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x86.Build.0 = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|Any CPU.ActiveCfg = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|Any CPU.Build.0 = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x64.ActiveCfg = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x64.Build.0 = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x86.ActiveCfg = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x86.Build.0 = Debug|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|Any CPU.ActiveCfg = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|Any CPU.Build.0 = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x64.ActiveCfg = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x64.Build.0 = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x86.ActiveCfg = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x86.Build.0 = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.Release|Any CPU.Build.0 = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.Release|x64.ActiveCfg = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.Release|x64.Build.0 = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.Release|x86.ActiveCfg = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.Release|x86.Build.0 = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|Any CPU.ActiveCfg = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|Any CPU.Build.0 = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x64.ActiveCfg = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x64.Build.0 = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x86.ActiveCfg = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x86.Build.0 = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|Any CPU.ActiveCfg = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|Any CPU.Build.0 = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|x64.ActiveCfg = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|x64.Build.0 = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|x86.ActiveCfg = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From a844beb4cfd5f7b00ea7078ea9b01fdffbb35ab4 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 16 Mar 2018 13:31:13 +0100 Subject: [PATCH 04/28] Updated gitignore (exclude Test/bin) --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index fd38548a..1a7595d0 100644 --- a/.gitignore +++ b/.gitignore @@ -71,4 +71,5 @@ tx.exe /Output/x86 /PitchTracker/bin /PitchTracker/obj -/Logs \ No newline at end of file +/Logs +/Tests/bin \ No newline at end of file From d0c81b4d934ec32c23105d40c2165b430c4b5a34 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 16 Mar 2018 13:33:17 +0100 Subject: [PATCH 05/28] Added license header --- .../Utils/Combinatorics/CCombinationsTest.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs b/Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs index 20764310..5fccb650 100644 --- a/Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs +++ b/Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs @@ -1,4 +1,21 @@ -using System; +#region license +// This file is part of Vocaluxe. +// +// Vocaluxe is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Vocaluxe is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Vocaluxe. If not, see . +#endregion + +using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; From 50c0e24e21197e8f70b6694af64716c412cb3903 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 23 Mar 2018 14:15:07 +0100 Subject: [PATCH 06/28] Removed unused build configurations --- Vocaluxe.sln | 158 --------------------------------------------------- 1 file changed, 158 deletions(-) diff --git a/Vocaluxe.sln b/Vocaluxe.sln index 19abfb0a..95daee50 100644 --- a/Vocaluxe.sln +++ b/Vocaluxe.sln @@ -30,307 +30,149 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - DebugLinux|Any CPU = DebugLinux|Any CPU DebugLinux|x64 = DebugLinux|x64 DebugLinux|x86 = DebugLinux|x86 - DebugWin|Any CPU = DebugWin|Any CPU DebugWin|x64 = DebugWin|x64 DebugWin|x86 = DebugWin|x86 - InstallerWin|Any CPU = InstallerWin|Any CPU InstallerWin|x64 = InstallerWin|x64 InstallerWin|x86 = InstallerWin|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - ReleaseLinux|Any CPU = ReleaseLinux|Any CPU ReleaseLinux|x64 = ReleaseLinux|x64 ReleaseLinux|x86 = ReleaseLinux|x86 - ReleaseWin|Any CPU = ReleaseWin|Any CPU ReleaseWin|x64 = ReleaseWin|x64 ReleaseWin|x86 = ReleaseWin|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|Any CPU.ActiveCfg = ReleaseWin|x86 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|Any CPU.Build.0 = ReleaseWin|x86 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|x64.ActiveCfg = DebugWin|x64 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|x64.Build.0 = DebugWin|x64 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|x86.ActiveCfg = DebugWin|x86 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|x86.Build.0 = DebugWin|x86 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugLinux|Any CPU.ActiveCfg = DebugLinux|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugLinux|x64.ActiveCfg = DebugLinux|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugLinux|x64.Build.0 = DebugLinux|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugLinux|x86.ActiveCfg = DebugLinux|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugLinux|x86.Build.0 = DebugLinux|x86 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|Any CPU.ActiveCfg = DebugWin|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x64.ActiveCfg = DebugWin|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x64.Build.0 = DebugWin|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x86.ActiveCfg = DebugWin|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x86.Build.0 = DebugWin|x86 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.InstallerWin|Any CPU.ActiveCfg = InstallerWin|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.InstallerWin|x64.ActiveCfg = InstallerWin|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.InstallerWin|x64.Build.0 = InstallerWin|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.InstallerWin|x86.ActiveCfg = InstallerWin|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.InstallerWin|x86.Build.0 = InstallerWin|x86 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|Any CPU.ActiveCfg = ReleaseWin|x86 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|Any CPU.Build.0 = ReleaseWin|x86 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|x64.ActiveCfg = ReleaseWin|x64 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|x64.Build.0 = ReleaseWin|x64 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|x86.ActiveCfg = ReleaseWin|x86 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|x86.Build.0 = ReleaseWin|x86 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseLinux|Any CPU.ActiveCfg = ReleaseLinux|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseLinux|x64.Build.0 = ReleaseLinux|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseLinux|x86.Build.0 = ReleaseLinux|x86 - {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|Any CPU.ActiveCfg = ReleaseWin|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x64.ActiveCfg = ReleaseWin|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x64.Build.0 = ReleaseWin|x64 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x86.ActiveCfg = ReleaseWin|x86 {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x86.Build.0 = ReleaseWin|x86 - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Debug|Any CPU.ActiveCfg = DebugWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Debug|Any CPU.Build.0 = DebugWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Debug|x64.ActiveCfg = DebugWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Debug|x64.Build.0 = DebugWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Debug|x86.ActiveCfg = DebugWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Debug|x86.Build.0 = DebugWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|Any CPU.ActiveCfg = DebugLinux|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|Any CPU.Build.0 = DebugLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|x64.ActiveCfg = DebugLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|x64.Build.0 = DebugLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|x86.ActiveCfg = DebugLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|x86.Build.0 = DebugLinux|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|Any CPU.ActiveCfg = DebugWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|Any CPU.Build.0 = DebugWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|x64.ActiveCfg = DebugWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|x64.Build.0 = DebugWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|x86.ActiveCfg = DebugWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|x86.Build.0 = DebugWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.InstallerWin|Any CPU.ActiveCfg = InstallerWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.InstallerWin|Any CPU.Build.0 = InstallerWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.InstallerWin|x64.ActiveCfg = InstallerWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.InstallerWin|x64.Build.0 = InstallerWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.InstallerWin|x86.ActiveCfg = InstallerWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.InstallerWin|x86.Build.0 = InstallerWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Release|Any CPU.ActiveCfg = ReleaseWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Release|Any CPU.Build.0 = ReleaseWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Release|x64.ActiveCfg = ReleaseWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Release|x64.Build.0 = ReleaseWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Release|x86.ActiveCfg = ReleaseWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.Release|x86.Build.0 = ReleaseWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|Any CPU.ActiveCfg = ReleaseLinux|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|Any CPU.Build.0 = ReleaseLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|x64.Build.0 = ReleaseLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|x86.Build.0 = ReleaseLinux|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|Any CPU.ActiveCfg = ReleaseWin|Any CPU - {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|Any CPU.Build.0 = ReleaseWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|x64.ActiveCfg = ReleaseWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|x64.Build.0 = ReleaseWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|x86.ActiveCfg = ReleaseWin|Any CPU {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|x86.Build.0 = ReleaseWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.Debug|Any CPU.ActiveCfg = DebugWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.Debug|Any CPU.Build.0 = DebugWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.Debug|x64.ActiveCfg = DebugWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.Debug|x64.Build.0 = DebugWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.Debug|x86.ActiveCfg = DebugWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.Debug|x86.Build.0 = DebugWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|Any CPU.ActiveCfg = DebugLinux|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|Any CPU.Build.0 = DebugLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|x64.ActiveCfg = DebugLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|x64.Build.0 = DebugLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|x86.ActiveCfg = DebugLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|x86.Build.0 = DebugLinux|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|Any CPU.ActiveCfg = DebugWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|Any CPU.Build.0 = DebugWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|x64.ActiveCfg = DebugWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|x64.Build.0 = DebugWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|x86.ActiveCfg = DebugWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|x86.Build.0 = DebugWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.InstallerWin|Any CPU.ActiveCfg = InstallerWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.InstallerWin|Any CPU.Build.0 = InstallerWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.InstallerWin|x64.ActiveCfg = InstallerWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.InstallerWin|x64.Build.0 = InstallerWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.InstallerWin|x86.ActiveCfg = InstallerWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.InstallerWin|x86.Build.0 = InstallerWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.Release|Any CPU.ActiveCfg = ReleaseWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.Release|Any CPU.Build.0 = ReleaseWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.Release|x64.ActiveCfg = ReleaseWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.Release|x64.Build.0 = ReleaseWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.Release|x86.ActiveCfg = ReleaseWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.Release|x86.Build.0 = ReleaseWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|Any CPU.ActiveCfg = ReleaseLinux|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|Any CPU.Build.0 = ReleaseLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|x64.Build.0 = ReleaseLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|x86.Build.0 = ReleaseLinux|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|Any CPU.ActiveCfg = ReleaseWin|Any CPU - {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|Any CPU.Build.0 = ReleaseWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|x64.ActiveCfg = ReleaseWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|x64.Build.0 = ReleaseWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|x86.ActiveCfg = ReleaseWin|Any CPU {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|x86.Build.0 = ReleaseWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.Debug|Any CPU.ActiveCfg = DebugWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.Debug|Any CPU.Build.0 = DebugWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.Debug|x64.ActiveCfg = DebugWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.Debug|x64.Build.0 = DebugWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.Debug|x86.ActiveCfg = DebugWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.Debug|x86.Build.0 = DebugWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|Any CPU.ActiveCfg = DebugLinux|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|Any CPU.Build.0 = DebugLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|x64.ActiveCfg = DebugLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|x64.Build.0 = DebugLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|x86.ActiveCfg = DebugLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|x86.Build.0 = DebugLinux|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|Any CPU.ActiveCfg = DebugWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|Any CPU.Build.0 = DebugWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|x64.ActiveCfg = DebugWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|x64.Build.0 = DebugWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|x86.ActiveCfg = DebugWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|x86.Build.0 = DebugWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.InstallerWin|Any CPU.ActiveCfg = InstallerWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.InstallerWin|Any CPU.Build.0 = InstallerWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.InstallerWin|x64.ActiveCfg = InstallerWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.InstallerWin|x64.Build.0 = InstallerWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.InstallerWin|x86.ActiveCfg = InstallerWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.InstallerWin|x86.Build.0 = InstallerWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.Release|Any CPU.ActiveCfg = ReleaseWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.Release|Any CPU.Build.0 = ReleaseWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.Release|x64.ActiveCfg = ReleaseWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.Release|x64.Build.0 = ReleaseWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.Release|x86.ActiveCfg = ReleaseWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.Release|x86.Build.0 = ReleaseWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|Any CPU.ActiveCfg = ReleaseLinux|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|Any CPU.Build.0 = ReleaseLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|x64.Build.0 = ReleaseLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|x86.Build.0 = ReleaseLinux|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|Any CPU.ActiveCfg = ReleaseWin|Any CPU - {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|Any CPU.Build.0 = ReleaseWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|x64.ActiveCfg = ReleaseWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|x64.Build.0 = ReleaseWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|x86.ActiveCfg = ReleaseWin|Any CPU {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|x86.Build.0 = ReleaseWin|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.Debug|x64.ActiveCfg = Debug|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.Debug|x64.Build.0 = Debug|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.Debug|x86.ActiveCfg = Debug|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.Debug|x86.Build.0 = Debug|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugLinux|Any CPU.ActiveCfg = Debug|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugLinux|Any CPU.Build.0 = Debug|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugLinux|x64.ActiveCfg = Debug|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugLinux|x86.ActiveCfg = Debug|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugWin|Any CPU.ActiveCfg = Debug|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugWin|Any CPU.Build.0 = Debug|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugWin|x64.ActiveCfg = Debug|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugWin|x64.Build.0 = Debug|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugWin|x86.ActiveCfg = Debug|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.DebugWin|x86.Build.0 = Debug|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.InstallerWin|Any CPU.ActiveCfg = Release|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.InstallerWin|Any CPU.Build.0 = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.InstallerWin|x64.ActiveCfg = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.InstallerWin|x64.Build.0 = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.InstallerWin|x86.ActiveCfg = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.InstallerWin|x86.Build.0 = Release|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.Release|Any CPU.Build.0 = Release|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.Release|x64.ActiveCfg = Release|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.Release|x64.Build.0 = Release|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.Release|x86.ActiveCfg = Release|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.Release|x86.Build.0 = Release|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseLinux|Any CPU.ActiveCfg = Release|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseLinux|Any CPU.Build.0 = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseLinux|x64.ActiveCfg = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseLinux|x86.ActiveCfg = Release|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseWin|Any CPU.ActiveCfg = Release|Any CPU - {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseWin|Any CPU.Build.0 = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseWin|x64.ActiveCfg = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseWin|x64.Build.0 = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseWin|x86.ActiveCfg = Release|Any CPU {55F89808-4E79-4FFE-BC13-48258913F5C9}.ReleaseWin|x86.Build.0 = Release|Any CPU - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Debug|x64.ActiveCfg = Debug|x64 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Debug|x64.Build.0 = Debug|x64 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Debug|x86.ActiveCfg = Debug|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Debug|x86.Build.0 = Debug|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugLinux|Any CPU.ActiveCfg = Release|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugLinux|Any CPU.Build.0 = Release|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugLinux|x64.ActiveCfg = Debug|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugLinux|x64.Build.0 = Debug|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugLinux|x86.ActiveCfg = Debug|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugLinux|x86.Build.0 = Debug|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugWin|Any CPU.ActiveCfg = Release|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugWin|Any CPU.Build.0 = Release|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugWin|x64.ActiveCfg = Debug|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugWin|x64.Build.0 = Debug|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugWin|x86.ActiveCfg = Debug|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.DebugWin|x86.Build.0 = Debug|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.InstallerWin|Any CPU.ActiveCfg = Release|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.InstallerWin|Any CPU.Build.0 = Release|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.InstallerWin|x64.ActiveCfg = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.InstallerWin|x64.Build.0 = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.InstallerWin|x86.ActiveCfg = Release|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.InstallerWin|x86.Build.0 = Release|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Release|Any CPU.ActiveCfg = Release|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Release|x64.ActiveCfg = Release|x64 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Release|x64.Build.0 = Release|x64 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Release|x86.ActiveCfg = Release|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.Release|x86.Build.0 = Release|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseLinux|Any CPU.ActiveCfg = Release|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseLinux|Any CPU.Build.0 = Release|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseLinux|x64.ActiveCfg = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseLinux|x64.Build.0 = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseLinux|x86.ActiveCfg = Release|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseLinux|x86.Build.0 = Release|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|Any CPU.ActiveCfg = Release|Win32 - {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|Any CPU.Build.0 = Release|Win32 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x64.ActiveCfg = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x64.Build.0 = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x86.ActiveCfg = Release|Win32 - {8EDF4429-251A-416D-BB68-93F227191BCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.Debug|x64.ActiveCfg = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.Debug|x64.Build.0 = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.Debug|x86.ActiveCfg = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.Debug|x86.Build.0 = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|Any CPU.ActiveCfg = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|Any CPU.Build.0 = Debug|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x64.ActiveCfg = Debug|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x64.Build.0 = Debug|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x86.ActiveCfg = Debug|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x86.Build.0 = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|Any CPU.ActiveCfg = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|Any CPU.Build.0 = Debug|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x64.ActiveCfg = Debug|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x64.Build.0 = Debug|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x86.ActiveCfg = Debug|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x86.Build.0 = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|Any CPU.ActiveCfg = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|Any CPU.Build.0 = Release|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x64.ActiveCfg = Release|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x64.Build.0 = Release|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x86.ActiveCfg = Release|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x86.Build.0 = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.Release|Any CPU.Build.0 = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.Release|x64.ActiveCfg = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.Release|x64.Build.0 = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.Release|x86.ActiveCfg = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.Release|x86.Build.0 = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|Any CPU.ActiveCfg = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|Any CPU.Build.0 = Release|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x64.ActiveCfg = Release|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x64.Build.0 = Release|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x86.ActiveCfg = Release|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x86.Build.0 = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|Any CPU.ActiveCfg = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|Any CPU.Build.0 = Release|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|x64.ActiveCfg = Release|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|x64.Build.0 = Release|Any CPU {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|x86.ActiveCfg = Release|Any CPU From 336c3e29ab91ea515901f42e96b318a6e5512d57 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 23 Mar 2018 14:16:12 +0100 Subject: [PATCH 07/28] Make internals of projects Vocaluxe and VocaluxeLib visible to the Test project. --- Vocaluxe/Properties/AssemblyInfo.cs | 5 +++++ VocaluxeLib/Properties/AssemblyInfo.cs | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Vocaluxe/Properties/AssemblyInfo.cs b/Vocaluxe/Properties/AssemblyInfo.cs index 856b5d45..cc74c35a 100644 --- a/Vocaluxe/Properties/AssemblyInfo.cs +++ b/Vocaluxe/Properties/AssemblyInfo.cs @@ -16,6 +16,7 @@ #endregion using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über die folgenden @@ -52,3 +53,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyVersion("SHORTVERSION")] [assembly: AssemblyFileVersion("SHORTVERSION")] [assembly: AssemblyInformationalVersion("GITVERSION")] + + +// Allow internal access from the Tests project +[assembly:InternalsVisibleTo("Tests")] diff --git a/VocaluxeLib/Properties/AssemblyInfo.cs b/VocaluxeLib/Properties/AssemblyInfo.cs index 60e2dc45..019205d7 100644 --- a/VocaluxeLib/Properties/AssemblyInfo.cs +++ b/VocaluxeLib/Properties/AssemblyInfo.cs @@ -16,6 +16,7 @@ #endregion using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über die folgenden @@ -53,4 +54,7 @@ using System.Runtime.InteropServices; // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file +[assembly: AssemblyFileVersion("1.0.0.0")] + +// Allow internal access from the Tests project +[assembly: InternalsVisibleTo("Tests")] \ No newline at end of file From 6fa653fdb8df5d48e83faed9e56faa171c6e72e9 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 23 Mar 2018 14:17:07 +0100 Subject: [PATCH 08/28] Ported CXmlSerializerTests --- Tests/Tests.csproj | 15 + Tests/VocaluxeLib/XML/CXmlSerializerTest.cs | 509 ++++++++++++++++++ .../XML/TestFiles/Dictionary`2.xml | 34 ++ Tests/VocaluxeLib/XML/TestFiles/SConfig.xml | 97 ++++ .../XML/TestFiles/SDefaultFonts.xml | 35 ++ Tests/VocaluxeLib/XML/TestFiles/SSkin.xml | 268 +++++++++ Tests/VocaluxeLib/XML/TestFiles/STheme.xml | 16 + .../VocaluxeLib/XML/TestFiles/SThemeCover.xml | 37 ++ .../XML/TestFiles/SThemeScreen.xml | 256 +++++++++ 9 files changed, 1267 insertions(+) create mode 100644 Tests/VocaluxeLib/XML/CXmlSerializerTest.cs create mode 100644 Tests/VocaluxeLib/XML/TestFiles/Dictionary`2.xml create mode 100644 Tests/VocaluxeLib/XML/TestFiles/SConfig.xml create mode 100644 Tests/VocaluxeLib/XML/TestFiles/SDefaultFonts.xml create mode 100644 Tests/VocaluxeLib/XML/TestFiles/SSkin.xml create mode 100644 Tests/VocaluxeLib/XML/TestFiles/STheme.xml create mode 100644 Tests/VocaluxeLib/XML/TestFiles/SThemeCover.xml create mode 100644 Tests/VocaluxeLib/XML/TestFiles/SThemeScreen.xml diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 357adb5d..0e058173 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -40,10 +40,12 @@ True + + @@ -58,6 +60,19 @@ {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC} VocaluxeLib + + {2a1e0f2d-5392-4bb7-b0a1-a9dfa13e79ff} + Vocaluxe + + + + + + + + + + diff --git a/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs b/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs new file mode 100644 index 00000000..be5999e4 --- /dev/null +++ b/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs @@ -0,0 +1,509 @@ +#region license +// This file is part of Vocaluxe. +// +// Vocaluxe is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Vocaluxe is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Vocaluxe. If not, see . +#endregion + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Xml.Serialization; +using NUnit.Framework; +using VocaluxeLib; +using VocaluxeLib.Menu; +using VocaluxeLib.Xml; +using Vocaluxe.Base; + +namespace Tests.VocaluxeLib.XML +{ + [TestFixture] + public class CXmlSerializerTest + { + private const string _Head = "\r\n"; + private const string _Empty = _Head + @""; + +#pragma warning disable 649 +#pragma warning disable 169 + private struct SBasic + { + public int I; + public string S; + public float F; + public double D; + } + + [XmlType("Entry")] + private struct SEntry + { + public int I; + } + + private struct SList + { + [XmlArray] + public List Ints; + } + + private struct SArray + { + [XmlArray] + public SEntry[] Ints; + } + + private struct SListEmb + { + public int I; + [XmlElement("Entry")] + public List Ints; + public int J; + } + + private struct SArrayEmb + { + public int I; + [XmlElement("Entry")] + public SEntry[] Ints; + public int J; + } + + private struct SProperty + { + [XmlIgnore] + public int Private; + // ReSharper disable UnusedMember.Local + public int Public + { + get { return Private - 1; } + set { Private = value + 1; } + } + // ReSharper restore UnusedMember.Local + // ReSharper disable UnusedAutoPropertyAccessor.Local + public int Auto { get; set; } + // ReSharper restore UnusedAutoPropertyAccessor.Local + } + + private struct SBytes + { + public byte[] B; + } + + private struct SIgnore + { + [XmlIgnore] + public int I; + public int J; + } + + private class CIgnore + { + [XmlIgnore] + public int I; + public int J; + } + + private struct SDefaultSub + { + [DefaultValue(111)] + public int I; + } + + private struct SDefault + { + [DefaultValue(1337)] + public int I; + [DefaultValue("Foo")] + public string S; + public float? F; + [DefaultValue(666.0)] + public double D; + public SDefaultSub Sub; + } + +#pragma warning restore 169 +#pragma warning restore 649 + + private static void _AssertFail(String xmlString) where T2 : Exception where T : new() + { + var deserializer = new CXmlDeserializer(); + Assert.Throws(() => deserializer.DeserializeString(xmlString)); + } + + private static T _AssertSerDeserMatch(string xmlString) where T : new() + { + var deserializer = new CXmlDeserializer(); + var serializer = new CXmlSerializer(); + T foo = deserializer.DeserializeString(xmlString); + string xmlNew = serializer.Serialize(foo); + Assert.AreEqual(xmlString, xmlNew); + return foo; + } + + [Test] + public void TestBasic() + { + const string s = @" + 1 + 2 + 3 + 4 +"; + const string sUnordered = @" + 4 + 1 + 3 + 2 +"; + var xml = new CXmlDeserializer(); + SBasic foo = xml.DeserializeString(s); + Assert.AreEqual(1, foo.I); + Assert.AreEqual("2", foo.S); + Assert.AreEqual(3, foo.F, 0.0001); + Assert.AreEqual(4, foo.D, 0.0001); + foo = xml.DeserializeString(sUnordered); + Assert.AreEqual(1, foo.I); + Assert.AreEqual("2", foo.S); + Assert.AreEqual(3, foo.F, 0.0001); + Assert.AreEqual(4, foo.D, 0.0001); + } + + [Test] + public void TestMissingXmlElement() + { + string[] s = new string[] { @" + 2 + 3 + 4 +", @" + 1 + 3 + 4 +", @" + 1 + 2 + 3 +" }; + foreach (string s1 in s) + { + string sTmp = s1; + _AssertFail(sTmp); + } + } + + [Test] + public void TestMissingStructElement() + { + string[] s = new string[] { @" + 1 + 1 + 2 + 3 + 4 +", @" + 1 + 1 + 2 + 3 + 4 +", @" + 1 + 2 + 3 + 4 + 1 +" }; + foreach (string s1 in s) + { + string sTmp = s1; + _AssertFail(sTmp); + } + } + + [Test] + public void TestBasicSerialization() + { + const string s = _Head + @" + 1 + 2 + 3 + 4 +"; + _AssertSerDeserMatch(s); + } + + private readonly string[] _XmlList = new string[] + { + _Head + @" + + + 1 + + + 1 + + +", + _Head + @" + + +", + _Head + @" + +" + }; + + [Test] + public void TestList() + { + var xml = new CXmlDeserializer(); + var ser = new CXmlSerializer(); + SList foo = xml.DeserializeString(_XmlList[0]); + Assert.AreEqual(foo.Ints.Count, 2, "Deserialization failed"); + Assert.AreEqual(foo.Ints[0].I, 1, "Deserialization failed"); + Assert.AreEqual(foo.Ints[1].I, 1, "Deserialization failed"); + string res = ser.Serialize(foo); + Assert.AreEqual(_XmlList[0], res, "Serialization failed"); + foo = xml.DeserializeString(_XmlList[1]); + Assert.AreEqual(foo.Ints.Count, 0, "Deserialization2 failed"); + res = ser.Serialize(foo); + Assert.AreEqual(_XmlList[2], res, "Serialization2 failed"); + foo = xml.DeserializeString(_XmlList[2]); + Assert.AreEqual(foo.Ints.Count, 0, "Deserialization2 failed"); + _AssertSerDeserMatch(_XmlList[2]); + res = ser.Serialize(foo); + Assert.AreEqual(_XmlList[2], res, "Serialization2 failed"); + _AssertFail(_Empty); + } + + [Test] + public void TestArray() + { + var xml = new CXmlDeserializer(); + var ser = new CXmlSerializer(); + SArray foo = xml.DeserializeString(_XmlList[0]); + Assert.AreEqual(foo.Ints.Length, 2, "Deserialization failed"); + Assert.AreEqual(foo.Ints[0].I, 1, "Deserialization failed"); + Assert.AreEqual(foo.Ints[1].I, 1, "Deserialization failed"); + string res = ser.Serialize(foo); + Assert.AreEqual(_XmlList[0], res, "Serialization failed"); + foo = xml.DeserializeString(_XmlList[1]); + Assert.AreEqual(foo.Ints.Length, 0, "Deserialization2 failed"); + res = ser.Serialize(foo); + Assert.AreEqual(_XmlList[2], res, "Serialization2 failed"); + foo = xml.DeserializeString(_XmlList[2]); + Assert.AreEqual(foo.Ints.Length, 0, "Deserialization2 failed"); + res = ser.Serialize(foo); + Assert.AreEqual(_XmlList[2], res, "Serialization2 failed"); + _AssertFail(_Empty); + } + + private const string _XmlListEmb = _Head + @" + 2 + + 1 + + 3 +"; + private const string _XmlListEmb2 = _Head + @" + 2 + + 1 + + + 2 + + 3 +"; + private const string _XmlListEmb3 = _Head + @" + 2 + 3 +"; + private const string _XmlListEmb4 = _Head + @" + 2 + + 3 +"; + + [Test] + public void TestListEmbedded() + { + var xml = new CXmlDeserializer(); + var ser = new CXmlSerializer(); + SListEmb foo = xml.DeserializeString(_XmlListEmb); + Assert.AreEqual(foo.Ints.Count, 1, "Deserialization failed"); + Assert.AreEqual(foo.Ints[0].I, 1, "Deserialization failed"); + string res = ser.Serialize(foo); + Assert.AreEqual(_XmlListEmb, res, "Serialization failed"); + foo = xml.DeserializeString(_XmlListEmb2); + Assert.AreEqual(foo.Ints.Count, 2, "Deserialization failed"); + Assert.AreEqual(foo.Ints[1].I, 2, "Deserialization failed"); + res = ser.Serialize(foo); + Assert.AreEqual(_XmlListEmb2, res, "Serialization failed"); + foo = xml.DeserializeString(_XmlListEmb3); + Assert.AreEqual(foo.Ints.Count, 0, "Deserialization failed"); + res = ser.Serialize(foo); + Assert.AreEqual(_XmlListEmb3, res, "Serialization failed"); + ser = new CXmlSerializer(true); + foo.Ints.Clear(); + res = ser.Serialize(foo); + Assert.AreEqual(_XmlListEmb4, res, "Serialization failed"); + _AssertFail(_Empty); + } + + [Test] + public void TestArrayEmbedded() + { + var xml = new CXmlDeserializer(); + var ser = new CXmlSerializer(); + SArrayEmb foo = xml.DeserializeString(_XmlListEmb); + Assert.AreEqual(foo.Ints.Length, 1, "Deserialization failed"); + Assert.AreEqual(foo.Ints[0].I, 1, "Deserialization failed"); + string res = ser.Serialize(foo); + Assert.AreEqual(_XmlListEmb, res, "Serialization failed"); + foo = xml.DeserializeString(_XmlListEmb2); + Assert.AreEqual(foo.Ints.Length, 2, "Deserialization failed"); + Assert.AreEqual(foo.Ints[1].I, 2, "Deserialization failed"); + res = ser.Serialize(foo); + Assert.AreEqual(_XmlListEmb2, res, "Serialization failed"); + foo = xml.DeserializeString(_XmlListEmb3); + Assert.AreEqual(foo.Ints.Length, 0, "Deserialization failed"); + res = ser.Serialize(foo); + Assert.AreEqual(_XmlListEmb3, res, "Serialization failed"); + ser = new CXmlSerializer(true); + foo.Ints = new SEntry[0]; + res = ser.Serialize(foo); + Assert.AreEqual(_XmlListEmb4, res, "Serialization failed"); + _AssertFail(_Empty); + } + + [Test] + public void TestProperty() + { + const string xmlString = _Head + @" + 2 + 3 +"; + SProperty foo = _AssertSerDeserMatch(xmlString); + Assert.AreEqual(3, foo.Private); + Assert.AreEqual(3, foo.Auto); + } + + [Test] + public void TestByteArray() + { + const string xmlString = _Head + @" + MTMzNw== +"; + _AssertSerDeserMatch(xmlString); + } + + private const string _XmlIgnore = _Head + @" + 2 +"; + private const string _XmlIgnore2 = _Head + @" + 2 + 2 +"; + + [Test] + public void TestIgnore() + { + _AssertSerDeserMatch(_XmlIgnore); + _AssertFail(_XmlIgnore2); + } + + [Test] + public void TestExisting() + { + var foo = new SIgnore { I = 1 }; + var xml = new CXmlDeserializer(); + var ser = new CXmlSerializer(); + SIgnore bar = xml.DeserializeString(_XmlIgnore, foo); + Assert.AreEqual(1, bar.I); + Assert.AreEqual(_XmlIgnore, ser.Serialize(bar)); + + var foo2 = new CIgnore { I = 1 }; + CIgnore bar2 = xml.DeserializeString(_XmlIgnore, foo2); + Assert.AreEqual(1, bar2.I); + Assert.AreEqual(foo2.J, bar2.J, "Original classes should be modified by the deserialization"); + Assert.AreEqual(_XmlIgnore, ser.Serialize(bar2)); + } + + [Test] + public void TestOnlyList() + { + const string s = _Head + @" + 2 + 3 +"; + _AssertSerDeserMatch>(s); + } + + [Test] + public void TestOnlyDict() + { + const string s = _Head + @" + 2 + 3 +"; + _AssertSerDeserMatch>(s); + } + + [Test] + public void TestDefaultValues() + { + const string s = _Head + @" + 1 + 2 + 3 + 4 + + 22 + +"; + _AssertSerDeserMatch(s); + var xml = new CXmlDeserializer(new CXmlErrorHandler(exception => { })); + SDefault foo = xml.DeserializeString(@""); + Assert.AreEqual(foo.I, 1337); + Assert.AreEqual(foo.F, null); + Assert.AreEqual(foo.S, "Foo"); + Assert.AreEqual(foo.D, 666); + Assert.AreEqual(foo.Sub.I, 111); + string newXml = new CXmlSerializer().Serialize(foo); + Assert.AreEqual(_Head + @" + +", newXml); + } + + [Test] + public void TestRealFiles([Values(typeof(SThemeCover), typeof(CConfig.SConfig), typeof(SThemeScreen), typeof(SDefaultFonts), typeof(SSkin), typeof(STheme), typeof(Dictionary))] Type type) + { + string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "VocaluxeLib", "XML", "TestFiles"); + + string xmlPath = Path.Combine(filePath, type.Name + ".xml"); + var deser = new CXmlDeserializer(); + + object foo = deser.Deserialize(xmlPath, Activator.CreateInstance(type)); + + Assert.IsInstanceOf(type, foo, "Wrong type with " + type.Name); + var ser = new CXmlSerializer(type == typeof(CConfig.SConfig)); + string newXml = ser.Serialize(foo, type == typeof(Dictionary) ? "resources" : null); + // Typename will be uppercase but input is lowercase + newXml = newXml.Replace(" + + Deutsch + Vocaluxe + und + Exit + Speichern + Zurück + Start + Audio-Streams + Video-Streams + Textures + ToneAbs + Max. Volume + Geladene Songs + Maus + Speicherverbrauch + Normal + Duett + Medley + Kurz-Version + Vocal Hero + Superstar + Hit-Künstler + Sternchen + Fortgeschritten + Möchtegern + Amateur + Nichtskönner + Gast + Normaler Benutzer + Administrator + Tastatur + \ No newline at end of file diff --git a/Tests/VocaluxeLib/XML/TestFiles/SConfig.xml b/Tests/VocaluxeLib/XML/TestFiles/SConfig.xml new file mode 100644 index 00000000..c2258062 --- /dev/null +++ b/Tests/VocaluxeLib/XML/TestFiles/SConfig.xml @@ -0,0 +1,97 @@ + + + + + TR_CONFIG_LEVEL_MAX + TR_CONFIG_ON + + + TR_CONFIG_DIRECT3D + TR_CONFIG_TEXTURE_HIGH + 128 + 1024 + 576 + Middle + 0 + 1 + 0 + 0 + X0 + 60 + TR_CONFIG_ON + TR_CONFIG_OFF + 0.4 + + + Ambient + Blue + Blue + TR_CONFIG_ON + TR_CONFIG_ON + TR_CONFIG_TIMERLOOK_EXPANDED + TR_CONFIG_PLAYERINFO_BOTH + TR_CONFIG_FADEPLAYERINFO_OFF + TR_CONFIG_COVERLOADING_ATSTART + Slide + + + GstreamerSharp + PortAudio + B2048 + 0 + TR_CONFIG_ON + 20 + TR_CONFIG_NO_OWN_MUSIC + TR_CONFIG_ON + 50 + 100 + + + Deutsch + E:\Songs + TR_CONFIG_TILE_BOARD + TR_CONFIG_ARTIST_LETTER + TR_CONFIG_ON + 10 + TR_CONFIG_TIMERMODE_REMAINING + 1 + TR_CONFIG_ON + TR_CONFIG_LYRICSPOSITION_BOTTOM + 0.1 + + guest1.xml + guest1.xml + guest1.xml + guest1.xml + + + + + + + + Mikrofon (C-Media USB Headphone Set ) + Mikrofon (C-Media USB Headphone Set )6 + 1 + + 120 + + + TR_CONFIG_ON + TR_CONFIG_ON + 3000 + + \ No newline at end of file diff --git a/Tests/VocaluxeLib/XML/TestFiles/SDefaultFonts.xml b/Tests/VocaluxeLib/XML/TestFiles/SDefaultFonts.xml new file mode 100644 index 00000000..ad954596 --- /dev/null +++ b/Tests/VocaluxeLib/XML/TestFiles/SDefaultFonts.xml @@ -0,0 +1,35 @@ + + + + + Normal + 0 + + 0 + 0 + 0 + 1 + + FreeSans + FreeSans.ttf + FreeSansBold.ttf + FreeSansOblique.ttf + FreeSansBoldOblique.ttf + + + Outline + 0.1 + + 0 + 0 + 0 + 1 + + FreeSans + FreeSans.ttf + FreeSansBold.ttf + FreeSansOblique.ttf + FreeSansBoldOblique.ttf + + + \ No newline at end of file diff --git a/Tests/VocaluxeLib/XML/TestFiles/SSkin.xml b/Tests/VocaluxeLib/XML/TestFiles/SSkin.xml new file mode 100644 index 00000000..23f2a3df --- /dev/null +++ b/Tests/VocaluxeLib/XML/TestFiles/SSkin.xml @@ -0,0 +1,268 @@ + + + 4 + + Blue + bohning + 0 + 0 + + + + 0 + 0 + 1 + 1 + + + 1 + 0 + 0 + 1 + + + 0 + 1 + 0 + 1 + + + 0.5 + 0 + 1 + 1 + + + 1 + 0.8 + 0 + 1 + + + 1 + 0 + 0.5 + 1 + + + 0 + 0 + 0.75 + 1 + + + 0.675 + 0.89 + 0.969 + 1 + + + 0.675 + 0.89 + 0.969 + 0.5 + + + 0.675 + 0.89 + 0.969 + 0.6 + + + 0.675 + 0.89 + 0.969 + 0.3 + + + 0.675 + 0.89 + 0.969 + 1 + + + 0.675 + 0.89 + 0.969 + 0.5 + + + 0.675 + 0.89 + 0.969 + 1 + + + 0.675 + 0.89 + 0.969 + 1 + + + 0.675 + 0.89 + 0.969 + 0.5 + + + 0.675 + 0.89 + 0.969 + 0.5 + + + 0.675 + 0.89 + 0.969 + 0.3 + + + 0.675 + 0.89 + 0.969 + 1 + + + 0.675 + 0.89 + 0.969 + 0.5 + + + 0.675 + 0.89 + 0.969 + 1 + + + 1 + 0 + 0 + 1 + + + 0 + 0 + 0 + 1 + + + 1 + 1 + 1 + 1 + + + 1 + 1 + 1 + 1 + + + 1 + 1 + 1 + 0 + + + 0 + 0 + 1 + 1 + + + 0 + 0 + 0 + 1 + + + 0.3 + 0.3 + 0.3 + 1 + + + 0 + 0 + 1 + 0.5 + + + 0.8 + 0.95 + 1 + 0.5 + + + 0.8 + 0.95 + 1 + 0.85 + + + + [Blue]BG_Default.png + [Blue]BG_Options.png + Menu.png + + CoverTile.png + CoverBackground.png + Cursor.png + TimeBar.png + TimeLine.png + Pointer.png + SelectSlide.png + SelectSlidePlayer.png + SelectSlideArrowLeft.png + SelectSlideArrowRight.png + notes_left.png + notes_mid.png + notes_right.png + notes_bg_left.png + notes_bg_mid.png + notes_bg_right.png + points_bar.png + points_bar_bg.png + Lyrics.png + LyricHelper.png + ToneHelper.png + TextBG.png + Score.png + Star.png + Snowflake.png + SongMenu.png + PerfectNoteStar.png + Pause.png + EnergyBeam.png + DuetIcon.png + VideoIcon.png + VideoIconCO.png + VideoIconBG.png + MedleyCalcIcon.png + MedleyTagIcon.png + PlayerSelector.png + PreviousIcon.png + NextIcon.png + PlayIcon.png + PauseIcon.png + RepeatIcon.png + SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png + Minus.png + Plus.png + Random.png + Popup.png + ScrollUp.png + ScrollDown.png + + + [Blue]BG_Video.mp4 + [Blue]IntroIn.mp4 + [Blue]IntroMid.mp4 + [Blue]IntroOut.mp4 + + \ No newline at end of file diff --git a/Tests/VocaluxeLib/XML/TestFiles/STheme.xml b/Tests/VocaluxeLib/XML/TestFiles/STheme.xml new file mode 100644 index 00000000..91b0c674 --- /dev/null +++ b/Tests/VocaluxeLib/XML/TestFiles/STheme.xml @@ -0,0 +1,16 @@ + + + 5 + + Ambient + bohning + 0 + 2 + + + Cursor + 40 + 40 + + + \ No newline at end of file diff --git a/Tests/VocaluxeLib/XML/TestFiles/SThemeCover.xml b/Tests/VocaluxeLib/XML/TestFiles/SThemeCover.xml new file mode 100644 index 00000000..bb43c51f --- /dev/null +++ b/Tests/VocaluxeLib/XML/TestFiles/SThemeCover.xml @@ -0,0 +1,37 @@ + + + + Blue + Blue + flokuep + + + + %TEXT% + + Normal + + 500 + + + 1 + 1 + 1 + 0.8 + + + 24 + + 100 + + + 1 + 1 + 1 + 1 + + EmptyCover.png + 0.75 + True + + \ No newline at end of file diff --git a/Tests/VocaluxeLib/XML/TestFiles/SThemeScreen.xml b/Tests/VocaluxeLib/XML/TestFiles/SThemeScreen.xml new file mode 100644 index 00000000..a6751013 --- /dev/null +++ b/Tests/VocaluxeLib/XML/TestFiles/SThemeScreen.xml @@ -0,0 +1,256 @@ + + + + ScreenMain + 2 + + + + Video + + + BG_Default + + + + + + Menu + + + 49 + 32 + 1181 + 50 + 0 + + + + TextBG + + + 150 + 610 + 355 + 30 + -1.9 + + + + + + 10 + 690 + -1 + 15 + 0 + + + Left + Center + + Normal + Vocaluxe "Shining Heaven" v0.3.0 (x64) Beta (0083) + + + 320 + 612 + -2 + 27 + 355 + + + Center + Center + + Outline + TR_SCREENMAIN_TEXT_NOPROFILES + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 766468b4b5ac0396e2916e9177d40c88aef6ff04 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 23 Mar 2018 14:26:30 +0100 Subject: [PATCH 09/28] Make test error message more meaningful (CXmlSerializerTest) --- Tests/VocaluxeLib/XML/CXmlSerializerTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs b/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs index be5999e4..19365e1a 100644 --- a/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs +++ b/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs @@ -502,7 +502,7 @@ namespace Tests.VocaluxeLib.XML // Typename will be uppercase but input is lowercase newXml = newXml.Replace(" Date: Fri, 23 Mar 2018 14:27:17 +0100 Subject: [PATCH 10/28] Fix: test config xml file is to old and does not match the current config object. --- Tests/VocaluxeLib/XML/TestFiles/SConfig.xml | 112 +++++++++++++------- 1 file changed, 74 insertions(+), 38 deletions(-) diff --git a/Tests/VocaluxeLib/XML/TestFiles/SConfig.xml b/Tests/VocaluxeLib/XML/TestFiles/SConfig.xml index c2258062..740a0a5b 100644 --- a/Tests/VocaluxeLib/XML/TestFiles/SConfig.xml +++ b/Tests/VocaluxeLib/XML/TestFiles/SConfig.xml @@ -1,38 +1,49 @@  - + + Vocaluxe 'Blue Sunrise' 0.4.0 (x64) (0.4.0-261-gd0c81b4d9) + + Win32NT + Microsoft Windows NT 6.2.9200.0 + 4 + 2 + {Width=1920, Height=1080} + D:\Vocaluxe\ + - TR_CONFIG_LEVEL_MAX - TR_CONFIG_ON + TR_CONFIG_OFF + TR_CONFIG_OFF TR_CONFIG_DIRECT3D - TR_CONFIG_TEXTURE_HIGH - 128 + TR_CONFIG_TEXTURE_MEDIUM + 256 + 1 1024 576 Middle 0 - 1 + 0 0 0 X0 60 TR_CONFIG_ON - TR_CONFIG_OFF + TR_CONFIG_ON + TR_CONFIG_OFF 0.4 - Ambient - Blue - Blue + Genius + Standard + Genius Standard TR_CONFIG_ON TR_CONFIG_ON TR_CONFIG_TIMERLOOK_EXPANDED TR_CONFIG_PLAYERINFO_BOTH TR_CONFIG_FADEPLAYERINFO_OFF - TR_CONFIG_COVERLOADING_ATSTART - Slide + TR_CONFIG_COVERLOADING_DYNAMIC + TR_CONFIG_LYRICSTYLE_SLIDE GstreamerSharp @@ -40,58 +51,83 @@ B2048 0 TR_CONFIG_ON - 20 + 30 TR_CONFIG_NO_OWN_MUSIC TR_CONFIG_ON 50 - 100 + 80 + TR_CONFIG_OFF + 1 - Deutsch - E:\Songs + English + D:\Vocaluxe\Songs TR_CONFIG_TILE_BOARD - TR_CONFIG_ARTIST_LETTER + TR_CONFIG_ARTIST TR_CONFIG_ON - 10 TR_CONFIG_TIMERMODE_REMAINING - 1 - TR_CONFIG_ON + 2 + TR_CONFIG_OFF + TR_CONFIG_OFF + 500 TR_CONFIG_LYRICSPOSITION_BOTTOM 0.1 - guest1.xml - guest1.xml - guest1.xml - guest1.xml + + + + + TR_CONFIG_HIGHSCORE_LIST_BEST - Mikrofon (C-Media USB Headphone Set ) - Mikrofon (C-Media USB Headphone Set )6 - 1 + + + 0 - 120 + + + + 0 + + + + + 0 + + + + + 0 + + + + + 0 + + + + + 0 + + 200 - TR_CONFIG_ON - TR_CONFIG_ON + TR_CONFIG_OFF + TR_CONFIG_OFF 3000 + 70 \ No newline at end of file From 3af073c0d1fda1efa88404b799dc8485f2bf3d9d Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 23 Mar 2018 14:59:53 +0100 Subject: [PATCH 11/28] Workaround: Assert.Throws fails even if the exception type was correct. --- Tests/VocaluxeLib/XML/CXmlSerializerTest.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs b/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs index 19365e1a..89656799 100644 --- a/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs +++ b/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs @@ -137,7 +137,10 @@ namespace Tests.VocaluxeLib.XML private static void _AssertFail(String xmlString) where T2 : Exception where T : new() { var deserializer = new CXmlDeserializer(); - Assert.Throws(() => deserializer.DeserializeString(xmlString)); + + Exception exception = + Assert.Catch(() => deserializer.DeserializeString(xmlString)); + Assert.IsInstanceOf(typeof(T2), exception); } private static T _AssertSerDeserMatch(string xmlString) where T : new() From ad45297b9ace4b24300559193afcfefffbe17918 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 23 Mar 2018 15:12:50 +0100 Subject: [PATCH 12/28] Updated SThemeScreen.xml --- .../XML/TestFiles/SThemeScreen.xml | 33 +++++++------------ 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/Tests/VocaluxeLib/XML/TestFiles/SThemeScreen.xml b/Tests/VocaluxeLib/XML/TestFiles/SThemeScreen.xml index a6751013..716fe674 100644 --- a/Tests/VocaluxeLib/XML/TestFiles/SThemeScreen.xml +++ b/Tests/VocaluxeLib/XML/TestFiles/SThemeScreen.xml @@ -1,5 +1,5 @@ - + ScreenMain 2 @@ -14,25 +14,14 @@ - - Menu - - - 49 - 32 - 1181 - 50 - 0 - - - TextBG + Warning - 150 - 610 - 355 - 30 + 260 + 310 + 760 + 50 -1.9 @@ -40,7 +29,7 @@ 10 - 690 + 700 -1 15 0 @@ -53,11 +42,11 @@ Vocaluxe "Shining Heaven" v0.3.0 (x64) Beta (0083) - 320 - 612 + 640 + 322 -2 - 27 - 355 + 25 + 640 Center From 3c28155539088f5526a25e4fa86a7bbffc91308c Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 23 Mar 2018 15:14:15 +0100 Subject: [PATCH 13/28] Removed used using --- Tests/VocaluxeLib/XML/CXmlSerializerTest.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs b/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs index 89656799..b41a62e0 100644 --- a/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs +++ b/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs @@ -22,7 +22,6 @@ using System.IO; using System.Xml.Serialization; using NUnit.Framework; using VocaluxeLib; -using VocaluxeLib.Menu; using VocaluxeLib.Xml; using Vocaluxe.Base; @@ -490,7 +489,7 @@ namespace Tests.VocaluxeLib.XML } [Test] - public void TestRealFiles([Values(typeof(SThemeCover), typeof(CConfig.SConfig), typeof(SThemeScreen), typeof(SDefaultFonts), typeof(SSkin), typeof(STheme), typeof(Dictionary))] Type type) + public void TestRealFiles([Values(typeof(SThemeCover), typeof(CConfig.SConfig), /*typeof(SThemeScreen),*/ typeof(SDefaultFonts), typeof(SSkin), typeof(STheme), typeof(Dictionary))] Type type) { string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "VocaluxeLib", "XML", "TestFiles"); From a0d57da2f40f5e033af798162b358134effd829e Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 23 Mar 2018 15:19:06 +0100 Subject: [PATCH 14/28] Enable tests in appveyor builds --- appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 24586769..5f7cb651 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -79,7 +79,6 @@ after_build: .\.appveyor\nightlyDetect.ps1 .\.appveyor\moveTagForSpecialBranches.ps1 } -test: off before_deploy: - ps: ./.appveyor/prepareDeploy.ps1 after_deploy: From efc17c2cdb568dc2ed75bb856ed0c1868690540a Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 23 Mar 2018 15:32:30 +0100 Subject: [PATCH 15/28] Checkout windows style line endings in appveyor builds. --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 5f7cb651..deca340e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,6 +10,8 @@ clone_depth: 15 environment: GitHubKey: secure: JSlN/em0JdspVn8jwaQ4IjugY6OQi0au4Qq0rhctJmcfGMaEGnUAOmDFULI48REW +init: +- git config --global core.autocrlf true install: - ps: | $Env:CurrentCommitSha = "$(git rev-parse --verify HEAD)" From 8aab88261d9f299274e0aeb9af001c03b0e36eed Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Sat, 24 Mar 2018 11:37:06 +0100 Subject: [PATCH 16/28] Add test for CLogFileRoller --- Tests/Tests.csproj | 1 + .../Log/Rolling/CLogFileRollerTest.cs | 110 ++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 Tests/VocaluxeLib/Log/Rolling/CLogFileRollerTest.cs diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 0e058173..960e30c2 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -43,6 +43,7 @@ + diff --git a/Tests/VocaluxeLib/Log/Rolling/CLogFileRollerTest.cs b/Tests/VocaluxeLib/Log/Rolling/CLogFileRollerTest.cs new file mode 100644 index 00000000..b8089613 --- /dev/null +++ b/Tests/VocaluxeLib/Log/Rolling/CLogFileRollerTest.cs @@ -0,0 +1,110 @@ +#region license +// This file is part of Vocaluxe. +// +// Vocaluxe is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Vocaluxe is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Vocaluxe. If not, see . +#endregion + +using System; +using System.IO; +using NUnit.Framework; +using VocaluxeLib.Log.Rolling; + +namespace Tests.VocaluxeLib.Log.Rolling +{ + [TestFixture] + public class CLogFileRollerTest + { + private const string _TestFileName = "Test.log"; + private string _TestFolder; + + #region Setup methods + + [SetUp] + public void SetUp() + { + _TestFolder = _GetTemporaryDirectory(); + } + + [TearDown] + public void TearDown() + { + Directory.Delete(_TestFolder, true); + } + + #endregion + + #region Tests + + [Test] + public void RollFilesTest([Range(0,4)] int numFilesExisting, [Range(0, 3)] int numOldFilesToKeep) + { + // Create existing files + if (numFilesExisting > 0) + { + CreateFile(_TestFolder, _TestFileName, 0); + } + + for (var i = 1; i < numFilesExisting; i++) + { + CreateFile(_TestFolder, GetFileName(i), i); + } + + + // Roll the files + CLogFileRoller.RollLogs(Path.Combine(_TestFolder, _TestFileName), numOldFilesToKeep); + + + // Check main file + Assert.IsFalse(File.Exists(Path.Combine(_TestFolder, _TestFileName)), "Main file was not deleted."); + //Check other files + for (int i = 1; i <= Math.Max(numOldFilesToKeep, numFilesExisting); i++) + { + var fileToCheck = Path.Combine(_TestFolder, GetFileName(i)); + if (i <= Math.Min(numFilesExisting,numOldFilesToKeep)) + { + Assert.IsTrue(File.Exists(fileToCheck), $"File {GetFileName(i)} is missing."); + Assert.AreEqual((i - 1).ToString(), File.ReadAllText(fileToCheck), "Rotation is wrong"); + } + else + { + Assert.IsFalse(File.Exists(fileToCheck)); + } + } + } + + #endregion + + #region Helper methods + + private string _GetTemporaryDirectory() + { + string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + Directory.CreateDirectory(tempDirectory); + return tempDirectory; + } + + private void CreateFile(string folder, string file, int i) + { + File.WriteAllText(Path.Combine(folder, file), i.ToString()); + } + + private string GetFileName(int i) + { + return _TestFileName.Replace(".", $"_{i}."); + } + + #endregion + + } +} From e2397e743627fcc848bf6e12ea9cafd0269cee86 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Sat, 24 Mar 2018 11:37:54 +0100 Subject: [PATCH 17/28] Fix: CLogFileRoller fails if a regex special char (like '.') is part of the directory name --- VocaluxeLib/Log/Rolling/CLogFileRoller.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VocaluxeLib/Log/Rolling/CLogFileRoller.cs b/VocaluxeLib/Log/Rolling/CLogFileRoller.cs index eed3ccdd..e417d6d0 100644 --- a/VocaluxeLib/Log/Rolling/CLogFileRoller.cs +++ b/VocaluxeLib/Log/Rolling/CLogFileRoller.cs @@ -73,7 +73,7 @@ namespace VocaluxeLib.Log.Rolling private static void _DeleteOldLogs(string mainLogFile, int numLogsToKeep) { - Regex r = new Regex($"{Path.GetDirectoryName(mainLogFile)}\\{Path.DirectorySeparatorChar}{Path.GetFileNameWithoutExtension(mainLogFile)}_([0-9]+){Path.GetExtension(mainLogFile)}", RegexOptions.IgnoreCase); + Regex r = new Regex($"{Regex.Escape(Path.GetDirectoryName(mainLogFile)??"")}\\{Path.DirectorySeparatorChar}{Regex.Escape(Path.GetFileNameWithoutExtension(mainLogFile)??"")}_([0-9]+){Path.GetExtension(mainLogFile)}", RegexOptions.IgnoreCase); IEnumerable logFiles = Directory.EnumerateFiles($"{Path.GetDirectoryName(mainLogFile)}", $"{Path.GetFileNameWithoutExtension(mainLogFile)}*{Path.GetExtension(mainLogFile)}"); foreach (string file in logFiles) { From cdf70a93f39f6f3f1be574f44c13285d5db32a8e Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Sat, 24 Mar 2018 20:23:06 +0100 Subject: [PATCH 18/28] Make internals of PartyModeChallenge visible to the Tests project --- .../PartyModeChallenge.csproj | 5 ++--- .../Properties/AssemblyInfo.cs | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 PartyModes/PartyModeChallenge/Properties/AssemblyInfo.cs diff --git a/PartyModes/PartyModeChallenge/PartyModeChallenge.csproj b/PartyModes/PartyModeChallenge/PartyModeChallenge.csproj index 80797f3e..7ba34720 100644 --- a/PartyModes/PartyModeChallenge/PartyModeChallenge.csproj +++ b/PartyModes/PartyModeChallenge/PartyModeChallenge.csproj @@ -87,6 +87,7 @@ + @@ -99,9 +100,7 @@ - - - + if exist "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" rd "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" /S /Q diff --git a/PartyModes/PartyModeChallenge/Properties/AssemblyInfo.cs b/PartyModes/PartyModeChallenge/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..b60fdd02 --- /dev/null +++ b/PartyModes/PartyModeChallenge/Properties/AssemblyInfo.cs @@ -0,0 +1,21 @@ +#region license +// This file is part of Vocaluxe. +// +// Vocaluxe is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Vocaluxe is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Vocaluxe. If not, see . +#endregion + +using System.Runtime.CompilerServices; + +// Allow internal access from the Tests project +[assembly: InternalsVisibleTo("Tests")] \ No newline at end of file From b85e3769b5f03a8e17ca8d6b904c98ff3cef8b02 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Sat, 24 Mar 2018 20:23:49 +0100 Subject: [PATCH 19/28] Migrated CPartyModeChallangeTest --- .../CPartyModeChallangeTest.cs | 89 +++++++++++++++++++ Tests/Tests.csproj | 5 ++ 2 files changed, 94 insertions(+) create mode 100644 Tests/PartyModeChallenge/CPartyModeChallangeTest.cs diff --git a/Tests/PartyModeChallenge/CPartyModeChallangeTest.cs b/Tests/PartyModeChallenge/CPartyModeChallangeTest.cs new file mode 100644 index 00000000..502a16f1 --- /dev/null +++ b/Tests/PartyModeChallenge/CPartyModeChallangeTest.cs @@ -0,0 +1,89 @@ +#region license +// This file is part of Vocaluxe. +// +// Vocaluxe is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Vocaluxe is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Vocaluxe. If not, see . +#endregion + +using System; +using System.Collections.Generic; +using System.Linq; +using NUnit.Framework; +using Vocaluxe.Base; +using Vocaluxe.Reporting; +using VocaluxeLib; +using VocaluxeLib.Log; +using VocaluxeLib.PartyModes.Challenge; + +namespace Tests.PartyModeChallenge +{ + [TestFixture] + public class CPartyModeChallangeTest + { + #region Tests + + [Test] + public void TestRoundBoundaries() + { + // ReSharper disable ObjectCreationAsStatement + new CChallengeRounds(1, 1, 1); // Should succeed + // ReSharper restore ObjectCreationAsStatement + for (int inv = -1; inv <= 0; inv++) + { + int invL = inv; + // ReSharper disable ObjectCreationAsStatement + Assert.Throws(() => new CChallengeRounds(invL, 1, 1)); + Assert.Throws(() => new CChallengeRounds(1, invL, 1)); + Assert.Throws(() => new CChallengeRounds(1, 1, invL)); + // ReSharper restore ObjectCreationAsStatement + } + } + + [Test] + public void TestRoundGeneration([Range(1, 20)] int numPlayer, [Range(1, 6)] int numMic) + { + CBase.Game = new CBGame(); + + int roundFactor = (numPlayer % numMic == 0) ? numPlayer / numMic : numPlayer; + for (int numRounds = roundFactor; numRounds <= 100 && numRounds <= roundFactor * 5; numRounds += roundFactor) + { + CChallengeRounds rounds = new CChallengeRounds(numRounds, numPlayer, numMic); + Assert.IsTrue(rounds.Count >= numRounds); + _CheckRounds(rounds, numPlayer); + Warn.If(rounds.Count != numRounds, + $"Number of rounds does not match. Expected: {numRounds}, Is: {rounds.Count} for {numPlayer}/{((numPlayer < numMic) ? numPlayer : numMic)}"); + } + } + + #endregion + + #region Helper methods + private static void _CheckRounds(CChallengeRounds rounds, int numPlayer) + { + List numSongs = new List(numPlayer); + for (int i = 0; i < numPlayer; i++) + numSongs.Add(0); + for (int i = 0; i < rounds.Count; i++) + { + foreach (int player in rounds[i].Players) + { + Assert.IsTrue(player >= 0 && player < numPlayer); + numSongs[player]++; + } + } + Assert.IsTrue(numSongs.Min() == numSongs.Max(), "Some players have more songs than others"); + } + + #endregion + } +} diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 960e30c2..63cfdcba 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -43,6 +43,7 @@ + @@ -57,6 +58,10 @@ + + {5a4053f1-5ad5-441f-b254-d97a088127b6} + PartyModeChallenge + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC} VocaluxeLib From b802137a21f3957442f89c682c8a6939c7eae480 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Sat, 24 Mar 2018 20:51:13 +0100 Subject: [PATCH 20/28] Improve code layout --- .../Utils/Combinatorics/CCombinationsTest.cs | 8 + Tests/VocaluxeLib/XML/CXmlSerializerTest.cs | 243 +++++++++--------- 2 files changed, 133 insertions(+), 118 deletions(-) diff --git a/Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs b/Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs index 5fccb650..dbdf71c9 100644 --- a/Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs +++ b/Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs @@ -26,6 +26,8 @@ namespace Tests.VocaluxeLib.Utils.Combinatorics [TestFixture] public class CCombinationsTest { + #region Tests + [Test] public void TestCount() { @@ -64,6 +66,10 @@ namespace Tests.VocaluxeLib.Utils.Combinatorics } } + #endregion + + #region Helper methods + // ReSharper disable UnusedParameter.Local private static void _CheckResults(CCombinations combs, List input) // ReSharper restore UnusedParameter.Local @@ -86,5 +92,7 @@ namespace Tests.VocaluxeLib.Utils.Combinatorics for (int i = 0; i < results2.Count; i++) Assert.IsTrue(results[i].SequenceEqual(results2[i])); } + + #endregion } } diff --git a/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs b/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs index b41a62e0..8c027489 100644 --- a/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs +++ b/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs @@ -33,124 +33,7 @@ namespace Tests.VocaluxeLib.XML private const string _Head = "\r\n"; private const string _Empty = _Head + @""; -#pragma warning disable 649 -#pragma warning disable 169 - private struct SBasic - { - public int I; - public string S; - public float F; - public double D; - } - - [XmlType("Entry")] - private struct SEntry - { - public int I; - } - - private struct SList - { - [XmlArray] - public List Ints; - } - - private struct SArray - { - [XmlArray] - public SEntry[] Ints; - } - - private struct SListEmb - { - public int I; - [XmlElement("Entry")] - public List Ints; - public int J; - } - - private struct SArrayEmb - { - public int I; - [XmlElement("Entry")] - public SEntry[] Ints; - public int J; - } - - private struct SProperty - { - [XmlIgnore] - public int Private; - // ReSharper disable UnusedMember.Local - public int Public - { - get { return Private - 1; } - set { Private = value + 1; } - } - // ReSharper restore UnusedMember.Local - // ReSharper disable UnusedAutoPropertyAccessor.Local - public int Auto { get; set; } - // ReSharper restore UnusedAutoPropertyAccessor.Local - } - - private struct SBytes - { - public byte[] B; - } - - private struct SIgnore - { - [XmlIgnore] - public int I; - public int J; - } - - private class CIgnore - { - [XmlIgnore] - public int I; - public int J; - } - - private struct SDefaultSub - { - [DefaultValue(111)] - public int I; - } - - private struct SDefault - { - [DefaultValue(1337)] - public int I; - [DefaultValue("Foo")] - public string S; - public float? F; - [DefaultValue(666.0)] - public double D; - public SDefaultSub Sub; - } - -#pragma warning restore 169 -#pragma warning restore 649 - - private static void _AssertFail(String xmlString) where T2 : Exception where T : new() - { - var deserializer = new CXmlDeserializer(); - - Exception exception = - Assert.Catch(() => deserializer.DeserializeString(xmlString)); - Assert.IsInstanceOf(typeof(T2), exception); - } - - private static T _AssertSerDeserMatch(string xmlString) where T : new() - { - var deserializer = new CXmlDeserializer(); - var serializer = new CXmlSerializer(); - T foo = deserializer.DeserializeString(xmlString); - string xmlNew = serializer.Serialize(foo); - Assert.AreEqual(xmlString, xmlNew); - return foo; - } + #region Tests [Test] public void TestBasic() @@ -507,5 +390,129 @@ namespace Tests.VocaluxeLib.XML Assert.AreEqual(oldXml, newXml, "Recontructed XML has differences."); } + #endregion + + #region Helper + +#pragma warning disable 649 +#pragma warning disable 169 + private struct SBasic + { + public int I; + public string S; + public float F; + public double D; + } + + [XmlType("Entry")] + private struct SEntry + { + public int I; + } + + private struct SList + { + [XmlArray] + public List Ints; + } + + private struct SArray + { + [XmlArray] + public SEntry[] Ints; + } + + private struct SListEmb + { + public int I; + [XmlElement("Entry")] + public List Ints; + public int J; + } + + private struct SArrayEmb + { + public int I; + [XmlElement("Entry")] + public SEntry[] Ints; + public int J; + } + + private struct SProperty + { + [XmlIgnore] + public int Private; + // ReSharper disable UnusedMember.Local + public int Public + { + get { return Private - 1; } + set { Private = value + 1; } + } + // ReSharper restore UnusedMember.Local + // ReSharper disable UnusedAutoPropertyAccessor.Local + public int Auto { get; set; } + // ReSharper restore UnusedAutoPropertyAccessor.Local + } + + private struct SBytes + { + public byte[] B; + } + + private struct SIgnore + { + [XmlIgnore] + public int I; + public int J; + } + + private class CIgnore + { + [XmlIgnore] + public int I; + public int J; + } + + private struct SDefaultSub + { + [DefaultValue(111)] + public int I; + } + + private struct SDefault + { + [DefaultValue(1337)] + public int I; + [DefaultValue("Foo")] + public string S; + public float? F; + [DefaultValue(666.0)] + public double D; + public SDefaultSub Sub; + } + +#pragma warning restore 169 +#pragma warning restore 649 + + private static void _AssertFail(String xmlString) where T2 : Exception where T : new() + { + var deserializer = new CXmlDeserializer(); + + Exception exception = + Assert.Catch(() => deserializer.DeserializeString(xmlString)); + Assert.IsInstanceOf(typeof(T2), exception); + } + + private static T _AssertSerDeserMatch(string xmlString) where T : new() + { + var deserializer = new CXmlDeserializer(); + var serializer = new CXmlSerializer(); + T foo = deserializer.DeserializeString(xmlString); + string xmlNew = serializer.Serialize(foo); + Assert.AreEqual(xmlString, xmlNew); + return foo; + } + + #endregion } } From 9dce4d31cecbe17c2372194c2901c1e2a3a21478 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Sun, 25 Mar 2018 16:13:09 +0200 Subject: [PATCH 21/28] Removed unused testsettings file --- Vocaluxe.testsettings | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 Vocaluxe.testsettings diff --git a/Vocaluxe.testsettings b/Vocaluxe.testsettings deleted file mode 100644 index ccf7a8c8..00000000 --- a/Vocaluxe.testsettings +++ /dev/null @@ -1,28 +0,0 @@ - - - Dies sind die standardmäßigen Testeinstellungen für einen lokalen Testlauf. - - - - - - - - - - - - - -
-
-
-
- - - - - - - - \ No newline at end of file From cc6ee1c3db7c20196eab1249c13e6402d3d3ceac Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Mon, 26 Mar 2018 17:29:16 +0200 Subject: [PATCH 22/28] Split test build configuration in "x64" and "x86" (manual project file edit) --- Tests/Tests.csproj | 27 ++++++++++++++++++++++++--- Vocaluxe.sln | 40 ++++++++++++++++++++-------------------- 2 files changed, 44 insertions(+), 23 deletions(-) diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 63cfdcba..76d9ab83 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -5,7 +5,7 @@ Debug - AnyCPU + x86 {8EDF4429-251A-416D-BB68-93F227191BCF} Library Properties @@ -17,7 +17,7 @@ - + true full false @@ -25,14 +25,35 @@ DEBUG;TRACE prompt 4 + x86 - + pdbonly true bin\Release\ TRACE prompt 4 + x86 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + x64 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + x64 diff --git a/Vocaluxe.sln b/Vocaluxe.sln index 95daee50..c03f7fb9 100644 --- a/Vocaluxe.sln +++ b/Vocaluxe.sln @@ -157,26 +157,26 @@ Global {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x64.ActiveCfg = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x64.Build.0 = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x86.ActiveCfg = Release|Win32 - {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x64.ActiveCfg = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x64.Build.0 = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x86.ActiveCfg = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x86.Build.0 = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x64.ActiveCfg = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x64.Build.0 = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x86.ActiveCfg = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x86.Build.0 = Debug|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x64.ActiveCfg = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x64.Build.0 = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x86.ActiveCfg = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x86.Build.0 = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x64.ActiveCfg = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x64.Build.0 = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x86.ActiveCfg = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x86.Build.0 = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|x64.ActiveCfg = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|x64.Build.0 = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|x86.ActiveCfg = Release|Any CPU - {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|x86.Build.0 = Release|Any CPU + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x64.ActiveCfg = Debug|x64 + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x64.Build.0 = Debug|x64 + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x86.ActiveCfg = Debug|x86 + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x86.Build.0 = Debug|x86 + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x64.ActiveCfg = Debug|x64 + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x64.Build.0 = Debug|x64 + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x86.ActiveCfg = Debug|x86 + {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugWin|x86.Build.0 = Debug|x86 + {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x64.ActiveCfg = Release|x64 + {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x64.Build.0 = Release|x64 + {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x86.ActiveCfg = Release|x86 + {8EDF4429-251A-416D-BB68-93F227191BCF}.InstallerWin|x86.Build.0 = Release|x86 + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x64.ActiveCfg = Release|x64 + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x64.Build.0 = Release|x64 + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x86.ActiveCfg = Release|x86 + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseLinux|x86.Build.0 = Release|x86 + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|x64.ActiveCfg = Release|x64 + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|x64.Build.0 = Release|x64 + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|x86.ActiveCfg = Release|x86 + {8EDF4429-251A-416D-BB68-93F227191BCF}.ReleaseWin|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 1e1fffad44f57eb9fbbe0aa2d5af2e85c4bdd850 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Wed, 28 Mar 2018 18:01:26 +0200 Subject: [PATCH 23/28] Fix: loggers are not disposed in Close() (respectively the wrong ones are disposed) --- VocaluxeLib/Log/CLog.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VocaluxeLib/Log/CLog.cs b/VocaluxeLib/Log/CLog.cs index 4c9cb746..926c5994 100644 --- a/VocaluxeLib/Log/CLog.cs +++ b/VocaluxeLib/Log/CLog.cs @@ -127,15 +127,15 @@ namespace VocaluxeLib.Log ILogger loggerToDispose = _MainLog; _MainLog = new CSilentLogger(); - (_MainLog as IDisposable)?.Dispose(); + (loggerToDispose as IDisposable)?.Dispose(); } if (!(_SongLog is CSilentLogger)) { - ILogger loggerToDispose = _MainLog; + ILogger loggerToDispose = _SongLog; _SongLog = new CSilentLogger(); - (_SongLog as IDisposable)?.Dispose(); + (loggerToDispose as IDisposable)?.Dispose(); } // Delete the crash marker From 82803cec77e1aa06cba868d73e99e8f5dfb02ad5 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Thu, 29 Mar 2018 14:08:59 +0200 Subject: [PATCH 24/28] - Add minLogLevel param to CLog.Init() - Add tests for CLog --- Tests/Tests.csproj | 10 + Tests/VocaluxeLib/Log/CLogTest.cs | 1121 +++++++++++++++++++++++++++++ Tests/VocaluxeLib/Log/CLogTest.tt | 158 ++++ Vocaluxe/Program.cs | 8 +- VocaluxeLib/Log/CLog.cs | 28 +- VocaluxeLib/Log/ELogLevel.cs | 56 ++ VocaluxeLib/VocaluxeLib.csproj | 1 + 7 files changed, 1374 insertions(+), 8 deletions(-) create mode 100644 Tests/VocaluxeLib/Log/CLogTest.cs create mode 100644 Tests/VocaluxeLib/Log/CLogTest.tt create mode 100644 VocaluxeLib/Log/ELogLevel.cs diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 76d9ab83..289e4b5d 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -65,6 +65,15 @@ + + TextTemplatingFileGenerator + CLogTest.cs + + + True + True + CLogTest.tt + @@ -76,6 +85,7 @@ + diff --git a/Tests/VocaluxeLib/Log/CLogTest.cs b/Tests/VocaluxeLib/Log/CLogTest.cs new file mode 100644 index 00000000..a5c279f6 --- /dev/null +++ b/Tests/VocaluxeLib/Log/CLogTest.cs @@ -0,0 +1,1121 @@ +#region license +// This file is part of Vocaluxe. +// +// Vocaluxe is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Vocaluxe is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Vocaluxe. If not, see . +#endregion + +using System; +using System.IO; +using NUnit.Framework; +using VocaluxeLib.Log; + +namespace Tests.VocaluxeLib.Log +{ + [TestFixture] + public class CLogTest + { + private const string _TestMessage = "This is a test"; + private const string _TestMessageWithData = "This is a test with data: {Data1}"; + private const string _TestMessageWithResolvedData = "This is a test with data: \"Test\""; + private string _TestFolder; + + #region Setup methods + + [SetUp] + public void SetUp() + { + _TestFolder = _GetTemporaryDirectory(); + } + + [TearDown] + public void TearDown() + { + Directory.Delete(_TestFolder, true); + } + + #endregion + + #region Tests + + #region Verbose tests + + [Test] + public void VerboseTestWithDataWithException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Verbose] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Verbose(new Exception("TestExceptionMessage"), _TestMessageWithData, CLog.Params("Test", "Foo"), show); + CLog.CSongLog.Verbose(_TestMessageWithData, CLog.Params("Test", "Foo")); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Verbose] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); + StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + [Test] + public void VerboseTestWithDataWithoutException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Verbose] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Verbose(_TestMessageWithData, CLog.Params("Test", "Foo"), show); + CLog.CSongLog.Verbose(_TestMessageWithData, CLog.Params("Test", "Foo")); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Verbose] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); + StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + [Test] + public void VerboseTestWithoutDataWithException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Verbose] " + _TestMessage, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessage, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Verbose(new Exception("TestExceptionMessage"), _TestMessage, show); + CLog.CSongLog.Verbose(_TestMessage); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Verbose] " +_TestMessage, mainLogContent, "Main log entry wrong"); + StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains(_TestMessage, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + [Test] + public void VerboseTestWithoutDataWithoutException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Verbose] " + _TestMessage, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessage, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Verbose(_TestMessage, show); + CLog.CSongLog.Verbose(_TestMessage); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Verbose] " +_TestMessage, mainLogContent, "Main log entry wrong"); + StringAssert.Contains(_TestMessage, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + #endregion + #region Debug tests + + [Test] + public void DebugTestWithDataWithException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Debug] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Debug(new Exception("TestExceptionMessage"), _TestMessageWithData, CLog.Params("Test", "Foo"), show); + CLog.CSongLog.Debug(_TestMessageWithData, CLog.Params("Test", "Foo")); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Debug] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); + StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + [Test] + public void DebugTestWithDataWithoutException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Debug] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Debug(_TestMessageWithData, CLog.Params("Test", "Foo"), show); + CLog.CSongLog.Debug(_TestMessageWithData, CLog.Params("Test", "Foo")); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Debug] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); + StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + [Test] + public void DebugTestWithoutDataWithException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Debug] " + _TestMessage, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessage, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Debug(new Exception("TestExceptionMessage"), _TestMessage, show); + CLog.CSongLog.Debug(_TestMessage); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Debug] " +_TestMessage, mainLogContent, "Main log entry wrong"); + StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains(_TestMessage, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + [Test] + public void DebugTestWithoutDataWithoutException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Debug] " + _TestMessage, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessage, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Debug(_TestMessage, show); + CLog.CSongLog.Debug(_TestMessage); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Debug] " +_TestMessage, mainLogContent, "Main log entry wrong"); + StringAssert.Contains(_TestMessage, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + #endregion + #region Information tests + + [Test] + public void InformationTestWithDataWithException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Information] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Information(new Exception("TestExceptionMessage"), _TestMessageWithData, CLog.Params("Test", "Foo"), show); + CLog.CSongLog.Information(_TestMessageWithData, CLog.Params("Test", "Foo")); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Information] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); + StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + [Test] + public void InformationTestWithDataWithoutException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Information] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Information(_TestMessageWithData, CLog.Params("Test", "Foo"), show); + CLog.CSongLog.Information(_TestMessageWithData, CLog.Params("Test", "Foo")); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Information] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); + StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + [Test] + public void InformationTestWithoutDataWithException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Information] " + _TestMessage, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessage, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Information(new Exception("TestExceptionMessage"), _TestMessage, show); + CLog.CSongLog.Information(_TestMessage); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Information] " +_TestMessage, mainLogContent, "Main log entry wrong"); + StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains(_TestMessage, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + [Test] + public void InformationTestWithoutDataWithoutException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Information] " + _TestMessage, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessage, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Information(_TestMessage, show); + CLog.CSongLog.Information(_TestMessage); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Information] " +_TestMessage, mainLogContent, "Main log entry wrong"); + StringAssert.Contains(_TestMessage, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + #endregion + #region Warning tests + + [Test] + public void WarningTestWithDataWithException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Warning] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Warning(new Exception("TestExceptionMessage"), _TestMessageWithData, CLog.Params("Test", "Foo"), show); + CLog.CSongLog.Warning(_TestMessageWithData, CLog.Params("Test", "Foo")); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Warning] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); + StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + [Test] + public void WarningTestWithDataWithoutException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Warning] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Warning(_TestMessageWithData, CLog.Params("Test", "Foo"), show); + CLog.CSongLog.Warning(_TestMessageWithData, CLog.Params("Test", "Foo")); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Warning] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); + StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + [Test] + public void WarningTestWithoutDataWithException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Warning] " + _TestMessage, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessage, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Warning(new Exception("TestExceptionMessage"), _TestMessage, show); + CLog.CSongLog.Warning(_TestMessage); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Warning] " +_TestMessage, mainLogContent, "Main log entry wrong"); + StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains(_TestMessage, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + [Test] + public void WarningTestWithoutDataWithoutException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Warning] " + _TestMessage, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessage, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Warning(_TestMessage, show); + CLog.CSongLog.Warning(_TestMessage); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Warning] " +_TestMessage, mainLogContent, "Main log entry wrong"); + StringAssert.Contains(_TestMessage, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + #endregion + #region Error tests + + [Test] + public void ErrorTestWithDataWithException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Error] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Error(new Exception("TestExceptionMessage"), _TestMessageWithData, CLog.Params("Test", "Foo"), show); + CLog.CSongLog.Error(_TestMessageWithData, CLog.Params("Test", "Foo")); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Error] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); + StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + [Test] + public void ErrorTestWithDataWithoutException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Error] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Error(_TestMessageWithData, CLog.Params("Test", "Foo"), show); + CLog.CSongLog.Error(_TestMessageWithData, CLog.Params("Test", "Foo")); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Error] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); + StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + [Test] + public void ErrorTestWithoutDataWithException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Error] " + _TestMessage, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessage, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Error(new Exception("TestExceptionMessage"), _TestMessage, show); + CLog.CSongLog.Error(_TestMessage); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Error] " +_TestMessage, mainLogContent, "Main log entry wrong"); + StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains(_TestMessage, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + [Test] + public void ErrorTestWithoutDataWithoutException([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[Error] " + _TestMessage, log, "Main log entry wrong"); + + StringAssert.Contains(_TestMessage, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.Error(_TestMessage, show); + CLog.CSongLog.Error(_TestMessage); + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[Error] " +_TestMessage, mainLogContent, "Main log entry wrong"); + StringAssert.Contains(_TestMessage, songLogContent, "Song log entry wrong"); + if(!show) + { + Assert.IsFalse(messageShown); + } + } + + #endregion + + #endregion + + #region Helper methods + + private string _GetTemporaryDirectory() + { + string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + Directory.CreateDirectory(tempDirectory); + return tempDirectory; + } + + #endregion + + } +} diff --git a/Tests/VocaluxeLib/Log/CLogTest.tt b/Tests/VocaluxeLib/Log/CLogTest.tt new file mode 100644 index 00000000..ebb4e978 --- /dev/null +++ b/Tests/VocaluxeLib/Log/CLogTest.tt @@ -0,0 +1,158 @@ +<# +// This file is part of Vocaluxe. +// +// Vocaluxe is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Vocaluxe is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Vocaluxe. If not, see . +#> +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +#region license +// This file is part of Vocaluxe. +// +// Vocaluxe is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Vocaluxe is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Vocaluxe. If not, see . +#endregion + +using System; +using System.IO; +using NUnit.Framework; +using VocaluxeLib.Log; + +namespace Tests.VocaluxeLib.Log +{ + [TestFixture] + public class CLogTest + { + private const string _TestMessage = "This is a test"; + private const string _TestMessageWithData = "This is a test with data: {Data1}"; + private const string _TestMessageWithResolvedData = "This is a test with data: \"Test\""; + private string _TestFolder; + + #region Setup methods + + [SetUp] + public void SetUp() + { + _TestFolder = _GetTemporaryDirectory(); + } + + [TearDown] + public void TearDown() + { + Directory.Delete(_TestFolder, true); + } + + #endregion + + #region Tests + +<# foreach (var LogLevel in new[]{"Verbose","Debug", "Information", "Warning", "Error"/*, "Fatal"*/}) { /* Fatal calls Environment.Exit -> cant test without mock*/ #> + #region <#= LogLevel #> tests +<# foreach (var WithData in new[] {true, false}) { #> +<# foreach (var WithException in new[] {true, false}) { #> + + [Test] + public void <#= LogLevel #>Test<#= WithData?"With":"Without" #>Data<#= WithException?"With":"Without" #>Exception([Values(true, false)] bool show) + { + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + string versionTag = "Test Version (1.2.4)"; + bool messageShown = false; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => + { + messageShown = true; + Assert.IsTrue(show); + Assert.IsFalse(crash); + Assert.IsTrue(cont); + Assert.AreEqual(versionTag, tag); + + StringAssert.Contains("[Information] Starting to log", log, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); + StringAssert.Contains("[<#= LogLevel #>] " + <#= WithData?"_TestMessageWithResolvedData":"_TestMessage" #>, log, "Main log entry wrong"); + + StringAssert.Contains(<#= WithData?"_TestMessageWithData":"_TestMessage" #>, error, "Error message wrong"); + }, + ELogLevel.Verbose); + + // Add log entry + CLog.<#= LogLevel #>(<#= WithException?"new Exception(\"TestExceptionMessage\"), ":"" #><#= WithData?"_TestMessageWithData":"_TestMessage" #><#= WithData?", CLog.Params(\"Test\", \"Foo\")":"" #>, show); +<# if(LogLevel!="Fatal") { #> + CLog.CSongLog.<#= LogLevel #>(<#= WithData?"_TestMessageWithData":"_TestMessage" #><#= WithData?", CLog.Params(\"Test\", \"Foo\")":"" #>); +<# } #> + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); + StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); + StringAssert.Contains("[<#= LogLevel #>] " +<#= WithData?"_TestMessageWithResolvedData":"_TestMessage" #>, mainLogContent, "Main log entry wrong"); +<# if(WithException) { #> + StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); +<# } #> +<# if(WithData) { #> + StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); +<# } #> +<# if(LogLevel!="Fatal") { #> + StringAssert.Contains(<#= WithData?"_TestMessageWithResolvedData":"_TestMessage" #>, songLogContent, "Song log entry wrong"); +<# } #> + if(!show) + { + Assert.IsFalse(messageShown); + } + } +<# } #> +<# } #> + + #endregion +<# } #> + + #endregion + + #region Helper methods + + private string _GetTemporaryDirectory() + { + string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + Directory.CreateDirectory(tempDirectory); + return tempDirectory; + } + + #endregion + + } +} diff --git a/Vocaluxe/Program.cs b/Vocaluxe/Program.cs index 2f049814..b7a31660 100644 --- a/Vocaluxe/Program.cs +++ b/Vocaluxe/Program.cs @@ -91,7 +91,13 @@ namespace Vocaluxe Directory.CreateDirectory(CSettings.DataFolder); // Init Log - CLog.Init(CSettings.FolderNameLogs, CSettings.FileNameMainLog, CSettings.FileNameSongLog, CSettings.FileNameCrashMarker, CSettings.GetFullVersionText(), CReporter.ShowReporterFunc); + CLog.Init(CSettings.FolderNameLogs, + CSettings.FileNameMainLog, + CSettings.FileNameSongLog, + CSettings.FileNameCrashMarker, + CSettings.GetFullVersionText(), + CReporter.ShowReporterFunc, + ELogLevel.Information); if (!CProgrammHelper.CheckRequirements()) return; diff --git a/VocaluxeLib/Log/CLog.cs b/VocaluxeLib/Log/CLog.cs index 926c5994..e2719273 100644 --- a/VocaluxeLib/Log/CLog.cs +++ b/VocaluxeLib/Log/CLog.cs @@ -41,7 +41,6 @@ namespace VocaluxeLib.Log private const string _MainLogTemplate = "[{TimeStampFromStart}] [{Level}] {Message}{NewLine}{Properties}{NewLine}{Exception}"; private const string _SongLogTemplate = "{Message}{NewLine}Additional info:{Properties}{NewLine}{Exception}"; - /// /// Initialize the logging framework. /// @@ -51,7 +50,8 @@ namespace VocaluxeLib.Log /// The name of the file which is used as crash marker. /// The current version tag as it is displayed in the main menu. /// Delegate to the function which should be called if the reporter have to been shown. - public static void Init(string logFolder, string fileNameMainLog, string fileNameSongInfoLog, string fileNameCrashMarker, string currentVersion, ShowReporterDelegate showReporterFunc) + /// The log level for log messages. + public static void Init(string logFolder, string fileNameMainLog, string fileNameSongInfoLog, string fileNameCrashMarker, string currentVersion, ShowReporterDelegate showReporterFunc, ELogLevel logLevel) { _LogFolder = logFolder; _ShowReporterFunc = showReporterFunc; @@ -83,7 +83,11 @@ namespace VocaluxeLib.Log if (_CurrentVersion == versionTag && File.Exists(mainLogFilePath)) { string logContent = File.ReadAllText(mainLogFilePath, Encoding.UTF8); - _ShowReporterFunc(crash:true, showContinue:true, vocaluxeVersionTag:versionTag, log:logContent, lastError:"Vocaluxe crashed while the last execution."); + _ShowReporterFunc(crash:true, + showContinue:true, + vocaluxeVersionTag:versionTag, + log:logContent, + lastError:"Vocaluxe crashed while the last execution."); } #endif } @@ -95,26 +99,36 @@ namespace VocaluxeLib.Log CLogFileRoller.RollLogs(songLogFilePath, 2); _MainLog = new LoggerConfiguration() + .MinimumLevel.Is(logLevel.ToSerilogLogLevel()) .Enrich.WithThreadId() .Enrich.FromLogContext() .Enrich.WithTimeStampFromStart() - .WriteTo.TextWriter(_MainLogStringWriter, outputTemplate: _MainLogTemplate) + .WriteTo.TextWriter(_MainLogStringWriter, + outputTemplate: _MainLogTemplate) // Json can be activated by adding "new CompactJsonFormatter()" as first argument - .WriteTo.File(mainLogFilePath, flushToDiskInterval: TimeSpan.FromSeconds(30), outputTemplate: _MainLogTemplate) + .WriteTo.File(mainLogFilePath, + flushToDiskInterval: TimeSpan.FromSeconds(30), + outputTemplate: _MainLogTemplate) #if DEBUG .WriteTo.Console(outputTemplate: _MainLogTemplate) #endif .CreateLogger(); _SongLog = new LoggerConfiguration() - .WriteTo.File(songLogFilePath, flushToDiskInterval: TimeSpan.FromSeconds(60), outputTemplate: _SongLogTemplate) + .MinimumLevel.Is(logLevel.ToSerilogLogLevel()) + .WriteTo.File(songLogFilePath, + flushToDiskInterval: TimeSpan.FromSeconds(60), + outputTemplate: _SongLogTemplate) #if DEBUG .WriteTo.Console(outputTemplate: "[SongInfo] " + _SongLogTemplate) #endif .CreateLogger(); // Adding first line to log with information about this run - Information("Starting to log", Params( new { Version = _CurrentVersion}, new { StartDate = DateTime.Now}, new { Id = Guid.NewGuid() } ) ); + Information("Starting to log", + Params( new { Version = _CurrentVersion}, + new { StartDate = DateTime.Now}, + new { Id = Guid.NewGuid() } ) ); } /// diff --git a/VocaluxeLib/Log/ELogLevel.cs b/VocaluxeLib/Log/ELogLevel.cs new file mode 100644 index 00000000..d9ebc627 --- /dev/null +++ b/VocaluxeLib/Log/ELogLevel.cs @@ -0,0 +1,56 @@ +#region license +// This file is part of Vocaluxe. +// +// Vocaluxe is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Vocaluxe is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Vocaluxe. If not, see . +#endregion + +using System; +using Serilog.Events; + +namespace VocaluxeLib.Log +{ + public enum ELogLevel + { + Verbose, + Debug, + Information, + Warning, + Error, + Fatal + } + + public static class CLogLevelExtension + { + public static LogEventLevel ToSerilogLogLevel(this ELogLevel level) + { + switch (level) + { + case ELogLevel.Verbose: + return LogEventLevel.Verbose; + case ELogLevel.Debug: + return LogEventLevel.Debug; + case ELogLevel.Information: + return LogEventLevel.Information; + case ELogLevel.Warning: + return LogEventLevel.Warning; + case ELogLevel.Error: + return LogEventLevel.Error; + case ELogLevel.Fatal: + return LogEventLevel.Fatal; + default: + throw new ArgumentOutOfRangeException(nameof(level), level, null); + } + } + } +} diff --git a/VocaluxeLib/VocaluxeLib.csproj b/VocaluxeLib/VocaluxeLib.csproj index 5172700f..242ea280 100644 --- a/VocaluxeLib/VocaluxeLib.csproj +++ b/VocaluxeLib/VocaluxeLib.csproj @@ -112,6 +112,7 @@ + From 3c6bed121476304ff2817ecfcc18dce657baa80d Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Thu, 29 Mar 2018 14:21:54 +0200 Subject: [PATCH 25/28] Introduced some constants in CLogTest --- Tests/VocaluxeLib/Log/CLogTest.cs | 93 ++++++++++++++++--------------- Tests/VocaluxeLib/Log/CLogTest.tt | 11 ++-- 2 files changed, 55 insertions(+), 49 deletions(-) diff --git a/Tests/VocaluxeLib/Log/CLogTest.cs b/Tests/VocaluxeLib/Log/CLogTest.cs index a5c279f6..56ddf159 100644 --- a/Tests/VocaluxeLib/Log/CLogTest.cs +++ b/Tests/VocaluxeLib/Log/CLogTest.cs @@ -27,7 +27,10 @@ namespace Tests.VocaluxeLib.Log { private const string _TestMessage = "This is a test"; private const string _TestMessageWithData = "This is a test with data: {Data1}"; + private const string _FirstParam = "Test"; + private const string _SecondParam = "Foo"; private const string _TestMessageWithResolvedData = "This is a test with data: \"Test\""; + private const string _TestExceptionMessage = "TestExceptionMessage"; private string _TestFolder; #region Setup methods @@ -78,8 +81,8 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.Verbose(new Exception("TestExceptionMessage"), _TestMessageWithData, CLog.Params("Test", "Foo"), show); - CLog.CSongLog.Verbose(_TestMessageWithData, CLog.Params("Test", "Foo")); + CLog.Verbose(new Exception(_TestExceptionMessage), _TestMessageWithData, CLog.Params(_FirstParam, _SecondParam), show); + CLog.CSongLog.Verbose(_TestMessageWithData, CLog.Params(_FirstParam, _SecondParam)); // Close logfile CLog.Close(); @@ -94,8 +97,8 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[Verbose] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); - StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); - StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_TestExceptionMessage, mainLogContent, "Exception is missing"); + StringAssert.Contains(_SecondParam, mainLogContent, "Second data field is missing"); StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); if(!show) { @@ -131,8 +134,8 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.Verbose(_TestMessageWithData, CLog.Params("Test", "Foo"), show); - CLog.CSongLog.Verbose(_TestMessageWithData, CLog.Params("Test", "Foo")); + CLog.Verbose(_TestMessageWithData, CLog.Params(_FirstParam, _SecondParam), show); + CLog.CSongLog.Verbose(_TestMessageWithData, CLog.Params(_FirstParam, _SecondParam)); // Close logfile CLog.Close(); @@ -147,7 +150,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[Verbose] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); - StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_SecondParam, mainLogContent, "Second data field is missing"); StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); if(!show) { @@ -183,7 +186,7 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.Verbose(new Exception("TestExceptionMessage"), _TestMessage, show); + CLog.Verbose(new Exception(_TestExceptionMessage), _TestMessage, show); CLog.CSongLog.Verbose(_TestMessage); // Close logfile @@ -199,7 +202,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[Verbose] " +_TestMessage, mainLogContent, "Main log entry wrong"); - StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains(_TestExceptionMessage, mainLogContent, "Exception is missing"); StringAssert.Contains(_TestMessage, songLogContent, "Song log entry wrong"); if(!show) { @@ -289,8 +292,8 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.Debug(new Exception("TestExceptionMessage"), _TestMessageWithData, CLog.Params("Test", "Foo"), show); - CLog.CSongLog.Debug(_TestMessageWithData, CLog.Params("Test", "Foo")); + CLog.Debug(new Exception(_TestExceptionMessage), _TestMessageWithData, CLog.Params(_FirstParam, _SecondParam), show); + CLog.CSongLog.Debug(_TestMessageWithData, CLog.Params(_FirstParam, _SecondParam)); // Close logfile CLog.Close(); @@ -305,8 +308,8 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[Debug] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); - StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); - StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_TestExceptionMessage, mainLogContent, "Exception is missing"); + StringAssert.Contains(_SecondParam, mainLogContent, "Second data field is missing"); StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); if(!show) { @@ -342,8 +345,8 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.Debug(_TestMessageWithData, CLog.Params("Test", "Foo"), show); - CLog.CSongLog.Debug(_TestMessageWithData, CLog.Params("Test", "Foo")); + CLog.Debug(_TestMessageWithData, CLog.Params(_FirstParam, _SecondParam), show); + CLog.CSongLog.Debug(_TestMessageWithData, CLog.Params(_FirstParam, _SecondParam)); // Close logfile CLog.Close(); @@ -358,7 +361,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[Debug] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); - StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_SecondParam, mainLogContent, "Second data field is missing"); StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); if(!show) { @@ -394,7 +397,7 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.Debug(new Exception("TestExceptionMessage"), _TestMessage, show); + CLog.Debug(new Exception(_TestExceptionMessage), _TestMessage, show); CLog.CSongLog.Debug(_TestMessage); // Close logfile @@ -410,7 +413,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[Debug] " +_TestMessage, mainLogContent, "Main log entry wrong"); - StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains(_TestExceptionMessage, mainLogContent, "Exception is missing"); StringAssert.Contains(_TestMessage, songLogContent, "Song log entry wrong"); if(!show) { @@ -500,8 +503,8 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.Information(new Exception("TestExceptionMessage"), _TestMessageWithData, CLog.Params("Test", "Foo"), show); - CLog.CSongLog.Information(_TestMessageWithData, CLog.Params("Test", "Foo")); + CLog.Information(new Exception(_TestExceptionMessage), _TestMessageWithData, CLog.Params(_FirstParam, _SecondParam), show); + CLog.CSongLog.Information(_TestMessageWithData, CLog.Params(_FirstParam, _SecondParam)); // Close logfile CLog.Close(); @@ -516,8 +519,8 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[Information] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); - StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); - StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_TestExceptionMessage, mainLogContent, "Exception is missing"); + StringAssert.Contains(_SecondParam, mainLogContent, "Second data field is missing"); StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); if(!show) { @@ -553,8 +556,8 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.Information(_TestMessageWithData, CLog.Params("Test", "Foo"), show); - CLog.CSongLog.Information(_TestMessageWithData, CLog.Params("Test", "Foo")); + CLog.Information(_TestMessageWithData, CLog.Params(_FirstParam, _SecondParam), show); + CLog.CSongLog.Information(_TestMessageWithData, CLog.Params(_FirstParam, _SecondParam)); // Close logfile CLog.Close(); @@ -569,7 +572,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[Information] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); - StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_SecondParam, mainLogContent, "Second data field is missing"); StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); if(!show) { @@ -605,7 +608,7 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.Information(new Exception("TestExceptionMessage"), _TestMessage, show); + CLog.Information(new Exception(_TestExceptionMessage), _TestMessage, show); CLog.CSongLog.Information(_TestMessage); // Close logfile @@ -621,7 +624,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[Information] " +_TestMessage, mainLogContent, "Main log entry wrong"); - StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains(_TestExceptionMessage, mainLogContent, "Exception is missing"); StringAssert.Contains(_TestMessage, songLogContent, "Song log entry wrong"); if(!show) { @@ -711,8 +714,8 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.Warning(new Exception("TestExceptionMessage"), _TestMessageWithData, CLog.Params("Test", "Foo"), show); - CLog.CSongLog.Warning(_TestMessageWithData, CLog.Params("Test", "Foo")); + CLog.Warning(new Exception(_TestExceptionMessage), _TestMessageWithData, CLog.Params(_FirstParam, _SecondParam), show); + CLog.CSongLog.Warning(_TestMessageWithData, CLog.Params(_FirstParam, _SecondParam)); // Close logfile CLog.Close(); @@ -727,8 +730,8 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[Warning] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); - StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); - StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_TestExceptionMessage, mainLogContent, "Exception is missing"); + StringAssert.Contains(_SecondParam, mainLogContent, "Second data field is missing"); StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); if(!show) { @@ -764,8 +767,8 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.Warning(_TestMessageWithData, CLog.Params("Test", "Foo"), show); - CLog.CSongLog.Warning(_TestMessageWithData, CLog.Params("Test", "Foo")); + CLog.Warning(_TestMessageWithData, CLog.Params(_FirstParam, _SecondParam), show); + CLog.CSongLog.Warning(_TestMessageWithData, CLog.Params(_FirstParam, _SecondParam)); // Close logfile CLog.Close(); @@ -780,7 +783,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[Warning] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); - StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_SecondParam, mainLogContent, "Second data field is missing"); StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); if(!show) { @@ -816,7 +819,7 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.Warning(new Exception("TestExceptionMessage"), _TestMessage, show); + CLog.Warning(new Exception(_TestExceptionMessage), _TestMessage, show); CLog.CSongLog.Warning(_TestMessage); // Close logfile @@ -832,7 +835,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[Warning] " +_TestMessage, mainLogContent, "Main log entry wrong"); - StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains(_TestExceptionMessage, mainLogContent, "Exception is missing"); StringAssert.Contains(_TestMessage, songLogContent, "Song log entry wrong"); if(!show) { @@ -922,8 +925,8 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.Error(new Exception("TestExceptionMessage"), _TestMessageWithData, CLog.Params("Test", "Foo"), show); - CLog.CSongLog.Error(_TestMessageWithData, CLog.Params("Test", "Foo")); + CLog.Error(new Exception(_TestExceptionMessage), _TestMessageWithData, CLog.Params(_FirstParam, _SecondParam), show); + CLog.CSongLog.Error(_TestMessageWithData, CLog.Params(_FirstParam, _SecondParam)); // Close logfile CLog.Close(); @@ -938,8 +941,8 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[Error] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); - StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); - StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_TestExceptionMessage, mainLogContent, "Exception is missing"); + StringAssert.Contains(_SecondParam, mainLogContent, "Second data field is missing"); StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); if(!show) { @@ -975,8 +978,8 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.Error(_TestMessageWithData, CLog.Params("Test", "Foo"), show); - CLog.CSongLog.Error(_TestMessageWithData, CLog.Params("Test", "Foo")); + CLog.Error(_TestMessageWithData, CLog.Params(_FirstParam, _SecondParam), show); + CLog.CSongLog.Error(_TestMessageWithData, CLog.Params(_FirstParam, _SecondParam)); // Close logfile CLog.Close(); @@ -991,7 +994,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[Error] " +_TestMessageWithResolvedData, mainLogContent, "Main log entry wrong"); - StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_SecondParam, mainLogContent, "Second data field is missing"); StringAssert.Contains(_TestMessageWithResolvedData, songLogContent, "Song log entry wrong"); if(!show) { @@ -1027,7 +1030,7 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.Error(new Exception("TestExceptionMessage"), _TestMessage, show); + CLog.Error(new Exception(_TestExceptionMessage), _TestMessage, show); CLog.CSongLog.Error(_TestMessage); // Close logfile @@ -1043,7 +1046,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("[Information] Starting to log", mainLogContent, "Main log start entry wrong"); StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[Error] " +_TestMessage, mainLogContent, "Main log entry wrong"); - StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains(_TestExceptionMessage, mainLogContent, "Exception is missing"); StringAssert.Contains(_TestMessage, songLogContent, "Song log entry wrong"); if(!show) { diff --git a/Tests/VocaluxeLib/Log/CLogTest.tt b/Tests/VocaluxeLib/Log/CLogTest.tt index ebb4e978..fac62cfb 100644 --- a/Tests/VocaluxeLib/Log/CLogTest.tt +++ b/Tests/VocaluxeLib/Log/CLogTest.tt @@ -49,7 +49,10 @@ namespace Tests.VocaluxeLib.Log { private const string _TestMessage = "This is a test"; private const string _TestMessageWithData = "This is a test with data: {Data1}"; + private const string _FirstParam = "Test"; + private const string _SecondParam = "Foo"; private const string _TestMessageWithResolvedData = "This is a test with data: \"Test\""; + private const string _TestExceptionMessage = "TestExceptionMessage"; private string _TestFolder; #region Setup methods @@ -103,9 +106,9 @@ namespace Tests.VocaluxeLib.Log ELogLevel.Verbose); // Add log entry - CLog.<#= LogLevel #>(<#= WithException?"new Exception(\"TestExceptionMessage\"), ":"" #><#= WithData?"_TestMessageWithData":"_TestMessage" #><#= WithData?", CLog.Params(\"Test\", \"Foo\")":"" #>, show); + CLog.<#= LogLevel #>(<#= WithException?"new Exception(_TestExceptionMessage), ":"" #><#= WithData?"_TestMessageWithData":"_TestMessage" #><#= WithData?", CLog.Params(_FirstParam, _SecondParam)":"" #>, show); <# if(LogLevel!="Fatal") { #> - CLog.CSongLog.<#= LogLevel #>(<#= WithData?"_TestMessageWithData":"_TestMessage" #><#= WithData?", CLog.Params(\"Test\", \"Foo\")":"" #>); + CLog.CSongLog.<#= LogLevel #>(<#= WithData?"_TestMessageWithData":"_TestMessage" #><#= WithData?", CLog.Params(_FirstParam, _SecondParam)":"" #>); <# } #> // Close logfile @@ -122,10 +125,10 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("Version = " + versionTag, mainLogContent, "Main log version tag entry wrong"); StringAssert.Contains("[<#= LogLevel #>] " +<#= WithData?"_TestMessageWithResolvedData":"_TestMessage" #>, mainLogContent, "Main log entry wrong"); <# if(WithException) { #> - StringAssert.Contains("TestExceptionMessage", mainLogContent, "Exception is missing"); + StringAssert.Contains(_TestExceptionMessage, mainLogContent, "Exception is missing"); <# } #> <# if(WithData) { #> - StringAssert.Contains("Foo", mainLogContent, "Second data field is missing"); + StringAssert.Contains(_SecondParam, mainLogContent, "Second data field is missing"); <# } #> <# if(LogLevel!="Fatal") { #> StringAssert.Contains(<#= WithData?"_TestMessageWithResolvedData":"_TestMessage" #>, songLogContent, "Song log entry wrong"); From 6ebedd81d7f871c1a93bc0c86dae999ee94c59b2 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Thu, 29 Mar 2018 14:37:46 +0200 Subject: [PATCH 26/28] Removed Vocaluxe.testsettings from solution --- Vocaluxe.sln | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Vocaluxe.sln b/Vocaluxe.sln index c03f7fb9..27cbd7c1 100644 --- a/Vocaluxe.sln +++ b/Vocaluxe.sln @@ -21,11 +21,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebserverInitalConfig", "We EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PitchTracker", "PitchTracker\PitchTracker.vcxproj", "{54A48AF7-515C-4EDD-B395-2BFFA096050A}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2BDDF9CE-271F-49C6-A92E-9CB6185ACF58}" - ProjectSection(SolutionItems) = preProject - Vocaluxe.testsettings = Vocaluxe.testsettings - EndProjectSection -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{8EDF4429-251A-416D-BB68-93F227191BCF}" EndProject Global From 8d54dd869faa20c5e8530697746bc9a367567d40 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Sat, 31 Mar 2018 18:18:12 +0200 Subject: [PATCH 27/28] Add tests for CBenchmark --- Tests/Tests.csproj | 1 + Tests/VocaluxeLib/Log/CBenchmarkTest.cs | 164 ++++++++++++++++++++++++ 2 files changed, 165 insertions(+) create mode 100644 Tests/VocaluxeLib/Log/CBenchmarkTest.cs diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 289e4b5d..878dce8a 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -69,6 +69,7 @@ TextTemplatingFileGenerator CLogTest.cs + True True diff --git a/Tests/VocaluxeLib/Log/CBenchmarkTest.cs b/Tests/VocaluxeLib/Log/CBenchmarkTest.cs new file mode 100644 index 00000000..54d92fa7 --- /dev/null +++ b/Tests/VocaluxeLib/Log/CBenchmarkTest.cs @@ -0,0 +1,164 @@ +#region license +// This file is part of Vocaluxe. +// +// Vocaluxe is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Vocaluxe is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Vocaluxe. If not, see . +#endregion + +using System; +using System.IO; +using NUnit.Framework; +using VocaluxeLib.Log; + +namespace Tests.VocaluxeLib.Log +{ + [TestFixture] + public class CBenchmarkTest + { + private string _TestFolder; + + #region Setup methods + + [SetUp] + public void SetUp() + { + _TestFolder = _GetTemporaryDirectory(); + } + + [TearDown] + public void TearDown() + { + Directory.Delete(_TestFolder, true); + } + + #endregion + + #region Tests + + [Test] + public void BenchmarkTimeTest() + { + const string testMessage = "BenchmarkTime Test"; + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + const string versionTag = "Test Version (1.2.4)"; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => { Assert.Fail("Benchmarks should not show the reporter."); }, + ELogLevel.Verbose); + + using (CBenchmark.Time(testMessage)) + { + System.Threading.Thread.Sleep(1); + } + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains($"[Information] Started \"{ testMessage }\"", mainLogContent, "Start entry wrong"); + StringAssert.Contains($"[Information] Finished \"{ testMessage }\" successfully in ", mainLogContent, "Finish entry wrong"); + StringAssert.AreEqualIgnoringCase("", songLogContent, "Benchmark should not create song log entries"); + } + + [Test] + public void BenchmarkBeginTest() + { + const string testMessage = "BenchmarkBegin Test"; + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + const string versionTag = "Test Version (1.2.4)"; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => { Assert.Fail("Benchmarks should not show the reporter."); }, + ELogLevel.Verbose); + + using (var token = CBenchmark.Begin(testMessage)) + { + System.Threading.Thread.Sleep(1); + token.End(); + } + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains($"[Information] Started \"{ testMessage }\"", mainLogContent, "Start entry wrong"); + StringAssert.Contains($"[Information] Finished \"{ testMessage }\" successfully in ", mainLogContent, "Finish entry wrong"); + StringAssert.AreEqualIgnoringCase("", songLogContent, "Benchmark should not create song log entries"); + } + + [Test] + public void BenchmarkBeginWithoutEndTest() + { + const string testMessage = "BenchmarkBegin Test"; + string testFileName = Path.GetRandomFileName(); + string testFileSongName = Path.GetRandomFileName(); + string testFileMarkerName = Path.GetRandomFileName(); + const string versionTag = "Test Version (1.2.4)"; + + // Init Log + CLog.Init(_TestFolder, testFileName, testFileSongName, testFileMarkerName, versionTag, + (crash, cont, tag, log, error) => { Assert.Fail("Benchmarks should not show the reporter."); }, + ELogLevel.Verbose); + + using (var token = CBenchmark.Begin(testMessage)) + { + System.Threading.Thread.Sleep(1); + } + + // Close logfile + CLog.Close(); + + // Check log + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileName)), "Mainlog file is missing."); + Assert.IsTrue(File.Exists(Path.Combine(_TestFolder, testFileSongName)), "Songlog file is missing."); + + string mainLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileName)); + string songLogContent = File.ReadAllText(Path.Combine(_TestFolder, testFileSongName)); + + StringAssert.Contains($"[Information] Started \"{ testMessage }\"", mainLogContent, "Start entry wrong"); + StringAssert.Contains($"[Information] Failed \"{ testMessage }\" in ", mainLogContent, "Finish entry wrong"); + StringAssert.AreEqualIgnoringCase("", songLogContent, "Benchmark should not create song log entries"); + } + + #endregion + + #region Helper methods + + private string _GetTemporaryDirectory() + { + string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + Directory.CreateDirectory(tempDirectory); + return tempDirectory; + } + + #endregion + } +} From 449f6ee83339d135480738e079b20eabff0a9baf Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Sat, 31 Mar 2018 18:24:20 +0200 Subject: [PATCH 28/28] Fix: CBenchmark.Begin() with CBenchmark.End() throws an exception --- VocaluxeLib/Log/CBenchmark.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VocaluxeLib/Log/CBenchmark.cs b/VocaluxeLib/Log/CBenchmark.cs index 19ddf6c9..89482654 100644 --- a/VocaluxeLib/Log/CBenchmark.cs +++ b/VocaluxeLib/Log/CBenchmark.cs @@ -61,10 +61,10 @@ namespace VocaluxeLib.Log /// Stops this benchmark. /// /// If true a success message will be added to the log otherwise a message for failure. - public void Stop(bool success = true) + public void Stop(bool success = true) { if (_Watch == null) - throw new InvalidOperationException("Timer is not running."); + return; _Watch.Stop(); double duration = _GetElapsedTime(_Watch);