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:
@@ -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);
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user