snapshot_update.cpp (635B)
1 #include <filesystem> 2 #include <fstream> 3 4 #include "../include/graph.hpp" 5 #include "snapshot_shared.cpp" 6 7 void snapshotGraph(std::string testName, Graph g) { 8 std::filesystem::path path{"tests/snapshot"}; 9 path /= testName + ".out"; 10 std::filesystem::create_directories(path.parent_path()); 11 std::ofstream ofs(path); 12 ofs << g.toString(); 13 } 14 15 int main() { 16 Graph g1 = basicGraphSerialization(); 17 snapshotGraph("basicGraph", g1); 18 Graph g2 = fullTraversalSerialization(); 19 snapshotGraph("traversedGraph", g2); 20 Graph g3 = fullTraversalLargerSerialization(); 21 snapshotGraph("traversedLargerGraph", g3); 22 }