From b0f661cd5d30c6bba571fa49ffa6172e346d29ad Mon Sep 17 00:00:00 2001 From: AlfredCP <82832709+AlfredCP@users.noreply.github.com> Date: Tue, 19 Oct 2021 08:50:10 +0000 Subject: [PATCH] Remove intemediate files (#129) * Adding library name (CXXGRAPH) in header guards to avoid possible conflicts in include folders Node and Graph * Adding library name (CXXGRAPH) in header guards to avoid possible conflicts in include folders Edge, Partitioning and Utility * Added code to remove reading intermediate files and removed lines in tests not needed anymore Co-authored-by: Parrot User --- include/Graph/Graph.hpp | 6 ++++++ test/RWOutputTest.cpp | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/Graph/Graph.hpp b/include/Graph/Graph.hpp index b62ab978d..788c79b7e 100644 --- a/include/Graph/Graph.hpp +++ b/include/Graph/Graph.hpp @@ -589,6 +589,7 @@ namespace CXXGRAPH ifileGraph.ignore(128, '\n'); } ifileGraph.close(); + if (compress) remove(completePathToFileGraph.c_str()); if (readNodeFeat) { @@ -611,6 +612,7 @@ namespace CXXGRAPH ifileNodeFeat.ignore(128, '\n'); } ifileNodeFeat.close(); + if (compress) remove(completePathToFileNodeFeat.c_str()); } if (readEdgeWeight) @@ -638,6 +640,7 @@ namespace CXXGRAPH ifileEdgeWeight.ignore(128, '\n'); } ifileEdgeWeight.close(); + if (compress) remove(completePathToFileEdgeWeight.c_str()); } recreateGraphFromReadFiles(edgeMap, edgeDirectedMap, nodeFeatMap, edgeWeightMap); return 0; @@ -728,6 +731,7 @@ namespace CXXGRAPH ifileGraph.ignore(128, '\n'); } ifileGraph.close(); + if (compress) remove(completePathToFileGraph.c_str()); if (readNodeFeat) { @@ -750,6 +754,7 @@ namespace CXXGRAPH ifileNodeFeat.ignore(128, '\n'); } ifileNodeFeat.close(); + if (compress) remove(completePathToFileNodeFeat.c_str()); } if (readEdgeWeight) @@ -777,6 +782,7 @@ namespace CXXGRAPH ifileEdgeWeight.ignore(128, '\n'); } ifileEdgeWeight.close(); + if (compress) remove(completePathToFileEdgeWeight.c_str()); } recreateGraphFromReadFiles(edgeMap, edgeDirectedMap, nodeFeatMap, edgeWeightMap); return 0; diff --git a/test/RWOutputTest.cpp b/test/RWOutputTest.cpp index e576e149a..f770fcb13 100644 --- a/test/RWOutputTest.cpp +++ b/test/RWOutputTest.cpp @@ -863,9 +863,6 @@ TEST(RWOutputTest, test_22) } } - remove("test_22.csv"); - remove("test_22_NodeFeat.csv"); - remove("test_22_EdgeWeight.csv"); remove("test_22.csv.gz"); remove("test_22_NodeFeat.csv.gz"); remove("test_22_EdgeWeight.csv.gz"); @@ -995,9 +992,6 @@ TEST(RWOutputTest, test_25) } } - remove("test_25.tsv"); - remove("test_25_NodeFeat.tsv"); - remove("test_25_EdgeWeight.tsv"); remove("test_25.tsv.gz"); remove("test_25_NodeFeat.tsv.gz"); remove("test_25_EdgeWeight.tsv.gz");