From 665f4c426477a701ed76ede51120d95fd84a589c Mon Sep 17 00:00:00 2001 From: John Stairs Date: Wed, 30 Nov 2022 19:47:04 +0000 Subject: [PATCH] Add std::remove(file) to sample and smoketest --- docs/docs.md | 2 ++ smoketest/cpp/smoketest.cc | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/docs.md b/docs/docs.md index 40e42ac5..35689334 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -170,6 +170,7 @@ create `playground.cc` that looks like this: int main() { std::string filename = "playground.bin"; + std::remove(filename.c_str()); { playground::binary::MyProtocolWriter writer(filename); @@ -246,6 +247,7 @@ HDF5 file. This requires only a few modifications to our code: int main() { - std::string filename = "playground.bin"; + std::string filename = "playground.h5"; + std::remove(filename.c_str()); { - playground::binary::MyProtocolWriter writer(filename); diff --git a/smoketest/cpp/smoketest.cc b/smoketest/cpp/smoketest.cc index 4d5f0bf2..102df4c3 100644 --- a/smoketest/cpp/smoketest.cc +++ b/smoketest/cpp/smoketest.cc @@ -1,10 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +#include + #include "generated/hdf5/protocols.h" int main() { - smoketest::hdf5::MyProtocolWriter w("smoketest.h5"); + std::string filename = "smoketest.h5"; + std::remove(filename.c_str()); + + smoketest::hdf5::MyProtocolWriter w(filename); w.WriteHeader({"123"});