1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2026-03-02 04:09:18 +00:00

chore: replaced wf_string_create by asprintf

This commit is contained in:
Falk Werner
2020-06-14 20:28:39 +02:00
parent 01a9488f6e
commit 60141c4d8a
6 changed files with 2 additions and 77 deletions

View File

@@ -1,18 +0,0 @@
#include <gtest/gtest.h>
#include <stdlib.h>
#include "webfuse/core/string.h"
TEST(wf_string_create, Default)
{
char * value = wf_create_string("test %s/%d", "hello", 42);
ASSERT_STREQ("test hello/42", value);
free(value);
}
TEST(wf_string_create, EmptyString)
{
char * value = wf_create_string("");
ASSERT_STREQ("", value);
free(value);
}

View File

@@ -1,7 +1,7 @@
#include "webfuse/core/string.h"
#include "webfuse/utils/tempdir.hpp"
#include <unistd.h>
#include <cstdio>
#include <cstdlib>
#include <stdexcept>
@@ -9,8 +9,8 @@ namespace webfuse_test
{
TempDir::TempDir(char const * prefix)
: path_(wf_create_string("/tmp/%s_XXXXXX", prefix))
{
asprintf(&path_, "/tmp/%s_XXXXXX", prefix);
char * result = mkdtemp(path_);
if (NULL == result)
{