Skip to content

Commit

Permalink
Use FlashMQTempDir in forkingTestSaveAndLoadDelayedWill
Browse files Browse the repository at this point in the history
  • Loading branch information
halfgaar committed Jul 10, 2024
1 parent 30983b5 commit 28997f5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions FlashMQTests/willtests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "flashmqtestclient.h"
#include "conffiletemp.h"
#include "mainappasfork.h"
#include "flashmqtempdir.h"


void MainTests::testMqtt3will()
Expand Down Expand Up @@ -352,10 +353,7 @@ void MainTests::testMqtt5DelayedWillsDisabled()
*/
void MainTests::forkingTestSaveAndLoadDelayedWill()
{
// TODO: auto-delete temp dir.
char dir_template[255] = "/tmp/forkingTestSaveAndLoadDelayedWill_XXXXXXX";
mkdtemp(dir_template);
const std::string tempdir(dir_template);
FlashMQTempDir tmpdir;

cleanup();

Expand All @@ -364,7 +362,7 @@ void MainTests::forkingTestSaveAndLoadDelayedWill()
allow_anonymous true
log_level debug
)");
confFile.writeLine("storage_dir " + tempdir);
confFile.writeLine("storage_dir " + tmpdir.getPath().string());
confFile.closeFile();

const std::vector<std::string> args {"--config-file", confFile.getFilePath()};
Expand Down

0 comments on commit 28997f5

Please sign in to comment.