From 91331c0d88e8d67825183888e6c7d488424cb30c Mon Sep 17 00:00:00 2001 From: Rainer Koschke Date: Wed, 24 Jan 2024 18:34:17 +0100 Subject: [PATCH 1/4] Moved utility function to FileIO. --- Assets/SEE/Utils/FileIO.cs | 15 ++++++++++++++- Assets/SEETests/TestKeyMap.cs | 21 +++++---------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Assets/SEE/Utils/FileIO.cs b/Assets/SEE/Utils/FileIO.cs index 87adbabf8a..951d0ec6b0 100644 --- a/Assets/SEE/Utils/FileIO.cs +++ b/Assets/SEE/Utils/FileIO.cs @@ -24,7 +24,7 @@ public static class FileIO /// the start of the requested line range /// the end of the requested line range /// file content in the specified line range - public static string Read(string fileName, int fromLine, int toLine) + internal static string Read(string fileName, int fromLine, int toLine) { UnityEngine.Assertions.Assert.IsTrue(fromLine > 0 && fromLine <= toLine); @@ -49,5 +49,18 @@ public static string Read(string fileName, int fromLine, int toLine) } return result.ToString(); } + + /// + /// If a file named exists, it will be deleted. + /// If it does not exist, nothing happens. + /// + /// file to be deleted + internal static void DeleteIfExists(string filename) + { + if (File.Exists(filename)) + { + File.Delete(filename); + } + } } } \ No newline at end of file diff --git a/Assets/SEETests/TestKeyMap.cs b/Assets/SEETests/TestKeyMap.cs index e34a58a858..b7d4c136b8 100644 --- a/Assets/SEETests/TestKeyMap.cs +++ b/Assets/SEETests/TestKeyMap.cs @@ -1,4 +1,5 @@ using NUnit.Framework; +using SEE.Utils; using System; using System.IO; using UnityEngine; @@ -55,7 +56,7 @@ public void TestEmpty() } finally { - Delete(filename); + FileIO.DeleteIfExists(filename); } } @@ -89,7 +90,7 @@ public void TestSingleEntry() } finally { - Delete(filename); + FileIO.DeleteIfExists(filename); } } @@ -162,7 +163,7 @@ public void TestOverlap() } finally { - Delete(filename); + FileIO.DeleteIfExists(filename); } } @@ -188,7 +189,7 @@ public void TestInconsistencyInFile() } finally { - Delete(filename); + FileIO.DeleteIfExists(filename); } } @@ -229,17 +230,5 @@ private void IsSubSet(KeyMap subset, KeyMap superset) AreEqual(binding.Value, supersetBinding); } } - - /// - /// If a file named exists, it will be deleted. - /// - /// file to be deleted - private static void Delete(string filename) - { - if (File.Exists(filename)) - { - File.Delete(filename); - } - } } } From 03c7e18d393e96911d3b1b715c82892ac1849a83 Mon Sep 17 00:00:00 2001 From: Rainer Koschke Date: Wed, 24 Jan 2024 18:38:24 +0100 Subject: [PATCH 2/4] Temporary files generated by tests are deleted when no longer used. --- Assets/SEETests/TestConfigIO.cs | 296 +++++++++++++++++++------------- Assets/SEETests/TestGraphIO.cs | 44 +++-- Assets/SEETests/TestLayoutIO.cs | 123 +++++++------ 3 files changed, 279 insertions(+), 184 deletions(-) diff --git a/Assets/SEETests/TestConfigIO.cs b/Assets/SEETests/TestConfigIO.cs index 03940f1540..9081947513 100644 --- a/Assets/SEETests/TestConfigIO.cs +++ b/Assets/SEETests/TestConfigIO.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.IO; using NUnit.Framework; using SEE.Game; using SEE.Game.City; @@ -265,20 +266,27 @@ public void TestConfigParseList4() [Test] public void TestMetricColorMapZeroElements() { - const string filename = "metricmap.cfg"; + string filename = Path.GetTempFileName(); const string label = "metricMap"; - ColorMap saved = new ColorMap(); + try { - using ConfigWriter writer = new ConfigWriter(filename); - saved.Save(writer, label); + ColorMap saved = new(); + { + using ConfigWriter writer = new(filename); + saved.Save(writer, label); + } + ColorMap loaded = new(); + { + using ConfigReader stream = new(filename); + loaded.Restore(stream.Read(), label); + } + AreEqualMetricColorMap(saved, loaded); } - ColorMap loaded = new ColorMap(); + finally { - using ConfigReader stream = new ConfigReader(filename); - loaded.Restore(stream.Read(), label); + FileIO.DeleteIfExists(filename); } - AreEqualMetricColorMap(saved, loaded); } /// @@ -287,30 +295,39 @@ public void TestMetricColorMapZeroElements() [Test] public void TestMetricColorMapOneElement() { - const string filename = "metricmap.cfg"; + string filename = Path.GetTempFileName(); const string label = "metricMap"; - ColorMap saved = new ColorMap(); - ColorRange colorRange = NewColorRange(Color.green, Color.cyan, 5); - saved["metricX"] = colorRange; + try { - using ConfigWriter writer = new ConfigWriter(filename); - saved.Save(writer, label); + ColorMap saved = new(); + ColorRange colorRange = NewColorRange(Color.green, Color.cyan, 5); + saved["metricX"] = colorRange; + { + using ConfigWriter writer = new(filename); + saved.Save(writer, label); + } + ColorMap loaded = new(); + { + using ConfigReader stream = new(filename); + loaded.Restore(stream.Read(), label); + } + AreEqualMetricColorMap(saved, loaded); } - ColorMap loaded = new ColorMap(); + finally { - using ConfigReader stream = new ConfigReader(filename); - loaded.Restore(stream.Read(), label); + FileIO.DeleteIfExists(filename); } - AreEqualMetricColorMap(saved, loaded); } private static ColorRange NewColorRange(Color lower, Color upper, uint numberOfColors) { - ColorRange colorRange = new ColorRange(); - colorRange.Lower = lower; - colorRange.Upper = upper; - colorRange.NumberOfColors = numberOfColors; + ColorRange colorRange = new() + { + Lower = lower, + Upper = upper, + NumberOfColors = numberOfColors + }; return colorRange; } @@ -320,22 +337,29 @@ private static ColorRange NewColorRange(Color lower, Color upper, uint numberOfC [Test] public void TestMetricColorMapTwoElements() { - const string filename = "metricmap.cfg"; + string filename = Path.GetTempFileName(); const string label = "metricMap"; - ColorMap saved = new ColorMap(); - saved["metricX"] = NewColorRange(Color.white, Color.grey, 10); - saved["metricY"] = NewColorRange(Color.grey, Color.black, 3); + try { - using ConfigWriter writer = new ConfigWriter(filename); - saved.Save(writer, label); + ColorMap saved = new(); + saved["metricX"] = NewColorRange(Color.white, Color.grey, 10); + saved["metricY"] = NewColorRange(Color.grey, Color.black, 3); + { + using ConfigWriter writer = new(filename); + saved.Save(writer, label); + } + ColorMap loaded = new(); + { + using ConfigReader stream = new(filename); + loaded.Restore(stream.Read(), label); + } + AreEqualMetricColorMap(saved, loaded); } - ColorMap loaded = new ColorMap(); + finally { - using ConfigReader stream = new ConfigReader(filename); - loaded.Restore(stream.Read(), label); + FileIO.DeleteIfExists(filename); } - AreEqualMetricColorMap(saved, loaded); } private void AreEqualMetricColorMap(ColorMap saved, ColorMap loaded) @@ -353,22 +377,29 @@ private void AreEqualMetricColorMap(ColorMap saved, ColorMap loaded) [Test] public void TestAntennaAttributes() { - AntennaAttributes saved = new AntennaAttributes(); + AntennaAttributes saved = new(); saved.AntennaSections.Add("metricA"); saved.AntennaSections.Add("metricB"); - const string filename = "antenna.cfg"; - const string label = "Antenna"; + string filename = Path.GetTempFileName(); + try { - using ConfigWriter writer = new ConfigWriter(filename); - saved.Save(writer, label); + const string label = "Antenna"; + { + using ConfigWriter writer = new(filename); + saved.Save(writer, label); + } + AntennaAttributes loaded = new(); + { + using ConfigReader stream = new(filename); + loaded.Restore(stream.Read(), label); + } + AreEqualAntennaSettings(saved, loaded); } - AntennaAttributes loaded = new AntennaAttributes(); + finally { - using ConfigReader stream = new ConfigReader(filename); - loaded.Restore(stream.Read(), label); + FileIO.DeleteIfExists(filename); } - AreEqualAntennaSettings(saved, loaded); } /// @@ -377,7 +408,7 @@ public void TestAntennaAttributes() [Test] public void TestSEECity() { - string filename = "seecity.cfg"; + string filename = Path.GetTempFileName(); // First save a new city with all its default values. SEECity savedCity = NewVanillaSEECity(); // FIXME: We need tests for the antenna settings @@ -391,20 +422,27 @@ public void TestSEECity() { IsRelevant = false }; - savedCity.NodeTypes = new NodeTypeVisualsMap(); - savedCity.NodeTypes["Function"] = function; - savedCity.NodeTypes["File"] = file; - savedCity.Save(filename); - - // Create a new city with all its default values and then - // wipe out all its attributes to see whether they are correctly - // restored from the saved configuration file. - SEECity loadedCity = NewVanillaSEECity(); - WipeOutSEECityAttributes(loadedCity); - // Load the saved attributes from the configuration file. - loadedCity.Load(filename); - - SEECityAttributesAreEqual(savedCity, loadedCity); + try + { + savedCity.NodeTypes = new NodeTypeVisualsMap(); + savedCity.NodeTypes["Function"] = function; + savedCity.NodeTypes["File"] = file; + savedCity.Save(filename); + + // Create a new city with all its default values and then + // wipe out all its attributes to see whether they are correctly + // restored from the saved configuration file. + SEECity loadedCity = NewVanillaSEECity(); + WipeOutSEECityAttributes(loadedCity); + // Load the saved attributes from the configuration file. + loadedCity.Load(filename); + + SEECityAttributesAreEqual(savedCity, loadedCity); + } + finally + { + FileIO.DeleteIfExists(filename); + } } /// @@ -416,25 +454,32 @@ public void TestSEECity() [Test] public void TestDiffCity() { - string filename = "diffcity.cfg"; + string filename = Path.GetTempFileName(); string vcsPath = "/c/mypath/myvcs"; - // First save a new city with all its default values. - DiffCity savedCity = NewVanillaSEECity(); - savedCity.VCSPath = new(vcsPath); - savedCity.OldRevision = "old revision"; - savedCity.NewRevision = "new revision"; - savedCity.Save(filename); - - // Create a new city with all its default values and then - // wipe out all its attributes to see whether they are correctly - // restored from the saved configuration file. - DiffCity loadedCity = NewVanillaSEECity(); - WipeOutDiffCityAttributes(loadedCity); - // Load the saved attributes from the configuration file. - loadedCity.Load(filename); - - DiffCityAttributesAreEqual(savedCity, loadedCity); + try + { + // First save a new city with all its default values. + DiffCity savedCity = NewVanillaSEECity(); + savedCity.VCSPath = new(vcsPath); + savedCity.OldRevision = "old revision"; + savedCity.NewRevision = "new revision"; + savedCity.Save(filename); + + // Create a new city with all its default values and then + // wipe out all its attributes to see whether they are correctly + // restored from the saved configuration file. + DiffCity loadedCity = NewVanillaSEECity(); + WipeOutDiffCityAttributes(loadedCity); + // Load the saved attributes from the configuration file. + loadedCity.Load(filename); + + DiffCityAttributesAreEqual(savedCity, loadedCity); + } + finally + { + FileIO.DeleteIfExists(filename); + } } /// @@ -443,20 +488,27 @@ public void TestDiffCity() [Test] public void TestSEEEvolutionCity() { - string filename = "seerandomcity.cfg"; - // First save a new city with all its default values. - SEECityEvolution savedCity = NewVanillaSEECity(); - savedCity.Save(filename); - - // Create a new city with all its default values and then - // wipe out all its attributes to see whether they are correctly - // restored from the saved configuration file. - SEECityEvolution loadedCity = NewVanillaSEECity(); - WipeOutSEEEvolutionCityAttributes(loadedCity); - // Load the saved attributes from the configuration file. - loadedCity.Load(filename); - - SEEEvolutionCityAttributesAreEqual(savedCity, loadedCity); + string filename = Path.GetTempFileName(); + try + { + // First save a new city with all its default values. + SEECityEvolution savedCity = NewVanillaSEECity(); + savedCity.Save(filename); + + // Create a new city with all its default values and then + // wipe out all its attributes to see whether they are correctly + // restored from the saved configuration file. + SEECityEvolution loadedCity = NewVanillaSEECity(); + WipeOutSEEEvolutionCityAttributes(loadedCity); + // Load the saved attributes from the configuration file. + loadedCity.Load(filename); + + SEEEvolutionCityAttributesAreEqual(savedCity, loadedCity); + } + finally + { + FileIO.DeleteIfExists(filename); + } } /// @@ -465,20 +517,27 @@ public void TestSEEEvolutionCity() [Test] public void TestSEERandomCity() { - string filename = "seerandomcity.cfg"; - // First save a new city with all its default values. - SEECityRandom savedCity = NewVanillaSEECity(); - savedCity.Save(filename); - - // Create a new city with all its default values and then - // wipe out all its attributes to see whether they are correctly - // restored from the saved configuration file. - SEECityRandom loadedCity = NewVanillaSEECity(); - WipeOutSEERandomCityAttributes(loadedCity); - // Load the saved attributes from the configuration file. - loadedCity.Load(filename); - - SEERandomCityAttributesAreEqual(savedCity, loadedCity); + string filename = Path.GetTempFileName(); + try + { + // First save a new city with all its default values. + SEECityRandom savedCity = NewVanillaSEECity(); + savedCity.Save(filename); + + // Create a new city with all its default values and then + // wipe out all its attributes to see whether they are correctly + // restored from the saved configuration file. + SEECityRandom loadedCity = NewVanillaSEECity(); + WipeOutSEERandomCityAttributes(loadedCity); + // Load the saved attributes from the configuration file. + loadedCity.Load(filename); + + SEERandomCityAttributesAreEqual(savedCity, loadedCity); + } + finally + { + FileIO.DeleteIfExists(filename); + } } /// @@ -487,20 +546,27 @@ public void TestSEERandomCity() [Test] public void TestSEEJlgCity() { - string filename = "seejlgcity.cfg"; - // First save a new city with all its default values. - SEEJlgCity savedCity = NewVanillaSEECity(); - savedCity.Save(filename); - - // Create a new city with all its default values and then - // wipe out all its attributes to see whether they are correctly - // restored from the saved configuration file. - SEEJlgCity loadedCity = NewVanillaSEECity(); - WipeOutSEEJlgCityAttributes(loadedCity); - // Load the saved attributes from the configuration file. - loadedCity.Load(filename); - - SEEJlgCityAttributesAreEqual(savedCity, loadedCity); + string filename = Path.GetTempFileName(); + try + { + // First save a new city with all its default values. + SEEJlgCity savedCity = NewVanillaSEECity(); + savedCity.Save(filename); + + // Create a new city with all its default values and then + // wipe out all its attributes to see whether they are correctly + // restored from the saved configuration file. + SEEJlgCity loadedCity = NewVanillaSEECity(); + WipeOutSEEJlgCityAttributes(loadedCity); + // Load the saved attributes from the configuration file. + loadedCity.Load(filename); + + SEEJlgCityAttributesAreEqual(savedCity, loadedCity); + } + finally + { + FileIO.DeleteIfExists(filename); + } } //-------------------------------------------------------- diff --git a/Assets/SEETests/TestGraphIO.cs b/Assets/SEETests/TestGraphIO.cs index c748aeb212..0793f1a774 100644 --- a/Assets/SEETests/TestGraphIO.cs +++ b/Assets/SEETests/TestGraphIO.cs @@ -160,6 +160,7 @@ private static void WriteReadGraph(string basename, Graph outGraph, bool compres { string Extension = compress ? CompressedExtension : NormalExtension; string filename = basename + Extension; + string backupFilename = basename + backupSuffix + Extension; // We need to finalize the node hierarchy so that the integer node attribute // Metric.Level is calculated for outgraph. Otherwise its node would not have @@ -167,26 +168,33 @@ private static void WriteReadGraph(string basename, Graph outGraph, bool compres // lead to an artificial discrepancy. outGraph.FinalizeNodeHierarchy(); - // Write outGraph - GraphWriter.Save(filename, outGraph, hierarchicalEdgeType); + try + { + // Write outGraph + GraphWriter.Save(filename, outGraph, hierarchicalEdgeType); - // Read the saved outGraph again - Graph inGraph = LoadGraph(filename); - Assert.AreEqual(filename, inGraph.Path); + // Read the saved outGraph again + Graph inGraph = LoadGraph(filename); + Assert.AreEqual(filename, inGraph.Path); - // Write the loaded saved initial graph again as a backup - string backupFilename = basename + backupSuffix + Extension; - GraphWriter.Save(backupFilename, inGraph, hierarchicalEdgeType); + // Write the loaded saved initial graph again as a backup + GraphWriter.Save(backupFilename, inGraph, hierarchicalEdgeType); - // Read the backup graph again - Graph backupGraph = LoadGraph(backupFilename); - // The path of backupGraph will be backupFilename. - Assert.AreEqual(backupFilename, backupGraph.Path); - // For the comparison, we need to reset the path. - backupGraph.Path = inGraph.Path = outGraph.Path; + // Read the backup graph again + Graph backupGraph = LoadGraph(backupFilename); + // The path of backupGraph will be backupFilename. + Assert.AreEqual(backupFilename, backupGraph.Path); + // For the comparison, we need to reset the path. + backupGraph.Path = inGraph.Path = outGraph.Path; - Assert.AreEqual(outGraph, inGraph); - Assert.AreEqual(backupGraph, inGraph); + Assert.AreEqual(outGraph, inGraph); + Assert.AreEqual(backupGraph, inGraph); + } + finally + { + FileIO.DeleteIfExists(filename); + FileIO.DeleteIfExists(backupFilename); + } } private static Graph LoadGraph(string filename) @@ -237,8 +245,8 @@ private static Graph Create() parent.AddChild(node1); parent.AddChild(node2); - Edge edge1 = NewEdge(graph, node1, node2, "call"); - Edge edge2 = NewEdge(graph, node2, node1, "called"); + NewEdge(graph, node1, node2, "call"); + NewEdge(graph, node2, node1, "called"); return graph; } diff --git a/Assets/SEETests/TestLayoutIO.cs b/Assets/SEETests/TestLayoutIO.cs index 400daf5df9..2b877bed13 100644 --- a/Assets/SEETests/TestLayoutIO.cs +++ b/Assets/SEETests/TestLayoutIO.cs @@ -3,6 +3,7 @@ using SEE.Layout.NodeLayouts; using SEE.Utils; using System.Collections.Generic; +using System.IO; using System.Linq; using UnityEngine; @@ -26,28 +27,34 @@ public void TestGVLWriteRead() { // GVL does not contain the height (y co-ordinate). bool yIsStored = false; - string filename = Application.dataPath + "/../Temp/layout" + Filenames.GVLExtension; + string filename = Path.GetTempFileName() + Filenames.GVLExtension; - ICollection gameObjects = NodeCreator.CreateNodes(1); + try + { + ICollection gameObjects = NodeCreator.CreateNodes(1); - CalculateLayout(gameObjects, - out Dictionary savedLayout, - out Dictionary layoutMap); + CalculateLayout(gameObjects, + out Dictionary savedLayout, + out Dictionary layoutMap); - // Save the layout. - IO.GVLWriter.Save(filename, "architecture", gameObjects); - //Dump(gameObjects, 10); + // Save the layout. + IO.GVLWriter.Save(filename, "architecture", gameObjects); - ClearLayout(gameObjects, yIsStored); + ClearLayout(gameObjects, yIsStored); - // Read the saved layout. - Dictionary readLayout = new LoadedNodeLayout(0, filename).Layout(gameObjects); - //Dump(readLayout, 10); + // Read the saved layout. + Dictionary readLayout = new LoadedNodeLayout(0, filename).Layout(gameObjects); + //Dump(readLayout, 10); - Assert.AreEqual(savedLayout.Count, readLayout.Count); // no gameObject added or removed - // Now layoutMap and readLayout should be the same except for - // scale.y and, thus, position.y (none of those are stored in GVL). - LayoutsAreEqual(readLayout, layoutMap, yIsStored); + Assert.AreEqual(savedLayout.Count, readLayout.Count); // no gameObject added or removed + // Now layoutMap and readLayout should be the same except for + // scale.y and, thus, position.y (none of those are stored in GVL). + LayoutsAreEqual(readLayout, layoutMap, yIsStored); + } + finally + { + FileIO.DeleteIfExists(filename); + } } /// @@ -59,34 +66,41 @@ public void TestSLDWriteRead() float groundLevel = -1; // SLD contains the height (y co-ordinate). bool yIsStored = true; - string filename = Application.dataPath + "/../Temp/layout" + Filenames.SLDExtension; + string filename = Path.GetTempFileName() + Filenames.SLDExtension; - ICollection layoutNodes = NodeCreator.CreateNodes(howManyRootNodes: 9, howDeeplyNested:0); + try + { + ICollection layoutNodes = NodeCreator.CreateNodes(howManyRootNodes: 9, howDeeplyNested: 0); - CalculateLayout(layoutNodes, - out Dictionary _, - out Dictionary layoutMap); + CalculateLayout(layoutNodes, + out Dictionary _, + out Dictionary layoutMap); - //Dump(layoutMap, 10, "Created layout (y relates to the ground)"); + //Dump(layoutMap, 10, "Created layout (y relates to the ground)"); - // Save the layout including the y co-ordinate (in SLD relating to the center). - { - ICollection gameObjects = ToGameNodes(layoutMap); - IO.SLDWriter.Save(filename, gameObjects); - //Dump(gameObjects, 10, "Saved layout (y relates to the center)"); - } + // Save the layout including the y co-ordinate (in SLD relating to the center). + { + ICollection gameObjects = ToGameNodes(layoutMap); + IO.SLDWriter.Save(filename, gameObjects); + //Dump(gameObjects, 10, "Saved layout (y relates to the center)"); + } - ClearLayout(layoutNodes, yIsStored); + ClearLayout(layoutNodes, yIsStored); - // Read the saved layout. - // Note: groundLevel will be ignored when the layout was stored in SLD. - Dictionary readLayout = new LoadedNodeLayout(groundLevel, filename).Layout(layoutNodes); - //Dump(readLayout, 10, "Read layout (y relates to the ground)"); + // Read the saved layout. + // Note: groundLevel will be ignored when the layout was stored in SLD. + Dictionary readLayout = new LoadedNodeLayout(groundLevel, filename).Layout(layoutNodes); + //Dump(readLayout, 10, "Read layout (y relates to the ground)"); - Assert.AreEqual(layoutMap.Count, readLayout.Count); // no gameObject added or removed - // Now layoutMap and readLayout should be the same including - // scale.y and, thus, position.y (all of those are stored in GVL). - LayoutsAreEqual(readLayout, layoutMap, yIsStored); + Assert.AreEqual(layoutMap.Count, readLayout.Count); // no gameObject added or removed + // Now layoutMap and readLayout should be the same including + // scale.y and, thus, position.y (all of those are stored in GVL). + LayoutsAreEqual(readLayout, layoutMap, yIsStored); + } + finally + { + FileIO.DeleteIfExists(filename); + } static ICollection ToGameNodes(Dictionary layoutNodes) { @@ -296,25 +310,32 @@ public void TestWriteReadEmptySLD() private static void TestWriteReadLayout(string fileExtension) { string graphName = "architecture"; - string filename = Application.dataPath + "/../Temp/emptylayout" + fileExtension; + string filename = Path.GetTempFileName() + fileExtension; - // Save the layout. - if (fileExtension == Filenames.GVLExtension) - { - IO.GVLWriter.Save(filename, graphName, new List()); - } - else if (fileExtension == Filenames.SLDExtension) + try { - IO.SLDWriter.Save(filename, new List()); + // Save the layout. + if (fileExtension == Filenames.GVLExtension) + { + IO.GVLWriter.Save(filename, graphName, new List()); + } + else if (fileExtension == Filenames.SLDExtension) + { + IO.SLDWriter.Save(filename, new List()); + } + else + { + Assert.Fail("Untested layout format"); + } + // Read the saved layout. + LoadedNodeLayout loadedNodeLayout = new(0, filename); + Dictionary readLayout = loadedNodeLayout.Layout(new List()); + Assert.AreEqual(0, readLayout.Count); } - else + finally { - Assert.Fail("Untested layout format"); + FileIO.DeleteIfExists(filename); } - // Read the saved layout. - LoadedNodeLayout loadedNodeLayout = new(0, filename); - Dictionary readLayout = loadedNodeLayout.Layout(new List()); - Assert.AreEqual(0, readLayout.Count); } /// From 3ddea0700473a51fb747feb60d2c7945131f5f32 Mon Sep 17 00:00:00 2001 From: Rainer Koschke Date: Wed, 24 Jan 2024 19:00:49 +0100 Subject: [PATCH 3/4] Removed debugging output. --- Assets/SEE/DataModel/DG/IO/GraphWriter.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Assets/SEE/DataModel/DG/IO/GraphWriter.cs b/Assets/SEE/DataModel/DG/IO/GraphWriter.cs index 10714933c4..531b80d885 100644 --- a/Assets/SEE/DataModel/DG/IO/GraphWriter.cs +++ b/Assets/SEE/DataModel/DG/IO/GraphWriter.cs @@ -45,7 +45,6 @@ public static void Save(string filename, Graph graph, string hierarchicalEdgeTyp Debug.LogError($"Could not save graph to GXL file '{filename}' due to: {e.Message}.\n"); throw; } - Debug.Log($"Successfully saved graph to file '{filename}'!"); } /// From 13f861279c0d59377e02514f269985e2989e0932 Mon Sep 17 00:00:00 2001 From: Rainer Koschke Date: Thu, 25 Jan 2024 08:54:48 +0100 Subject: [PATCH 4/4] Added missing EOF newline. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Assets/SEE/Utils/FileIO.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/SEE/Utils/FileIO.cs b/Assets/SEE/Utils/FileIO.cs index 951d0ec6b0..db9a262b08 100644 --- a/Assets/SEE/Utils/FileIO.cs +++ b/Assets/SEE/Utils/FileIO.cs @@ -63,4 +63,4 @@ internal static void DeleteIfExists(string filename) } } } -} \ No newline at end of file +}