summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2017-12-16 18:56:39 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2017-12-16 20:44:36 +0000
commitf384894d47ee1f18e9359c4e4ea951ddf36511a1 (patch)
treeba2c2162e2c4f4b532c7587381a624f35b0c5bab
parentImprove permissions tests on symlink (diff)
downloadnetfs-1.2.2.tar.bz2
netfs-1.2.2.tar.xz
netfs-1.2.2.zip
Remove calls to stringbf in favour of CTFnetfs-1.2.2
-rw-r--r--netfs/fuse/fuseApp.cpp4
-rw-r--r--netfs/unittests/mockDaemon.cpp2
-rw-r--r--netfs/unittests/mockDaemon.h3
-rw-r--r--netfs/unittests/testCore.cpp5
4 files changed, 10 insertions, 4 deletions
diff --git a/netfs/fuse/fuseApp.cpp b/netfs/fuse/fuseApp.cpp
index b980af8..17319ec 100644
--- a/netfs/fuse/fuseApp.cpp
+++ b/netfs/fuse/fuseApp.cpp
@@ -7,6 +7,7 @@
#include <slicer/slicer.h>
#include <uriParse.h>
#include <safeMapFind.h>
+#include <compileTimeFormatter.h>
namespace AdHoc {
template class Cache<struct stat, std::string>;
@@ -86,6 +87,7 @@ NetFS::FuseApp::configureFromFile(const std::string & configPath, const std::str
return AdHoc::safeMapLookup<Client::ResourceNotFound>(ReadConfiguration(configPath)->Resources, resourceName);
}
+AdHocFormatter(IceEndpointFmt, "%? -h %? -p %?");
NetFS::Client::ResourcePtr
NetFS::FuseApp::configureFromUri(const std::string & uriString) const
{
@@ -93,7 +95,7 @@ NetFS::FuseApp::configureFromUri(const std::string & uriString) const
NetFS::Client::ResourcePtr r = new NetFS::Client::Resource();
r->ExportName = uri.path->string();
- r->Endpoints.push_back(stringbf("%s -h %s -p %d", uri.scheme, uri.host, uri.port ? *uri.port : 4000));
+ r->Endpoints.push_back(IceEndpointFmt::get(uri.scheme, uri.host, uri.port ? *uri.port : 4000));
if (uri.password) {
r->AuthToken = *uri.password;
}
diff --git a/netfs/unittests/mockDaemon.cpp b/netfs/unittests/mockDaemon.cpp
index b428e28..7fe8389 100644
--- a/netfs/unittests/mockDaemon.cpp
+++ b/netfs/unittests/mockDaemon.cpp
@@ -4,7 +4,7 @@
#include <buffer.h>
const boost::filesystem::path TestExportRoot(binDir /
- stringbf("testExport-%d", getpid()));
+ UniqueExport::get(getpid()));
MockDaemon::MockDaemon(const std::string & ep) :
NetFSDaemon(),
diff --git a/netfs/unittests/mockDaemon.h b/netfs/unittests/mockDaemon.h
index a0de8b4..ae6614b 100644
--- a/netfs/unittests/mockDaemon.h
+++ b/netfs/unittests/mockDaemon.h
@@ -3,6 +3,9 @@
#include <daemon.h>
#include <visibility.h>
+#include <compileTimeFormatter.h>
+
+AdHocFormatter(UniqueExport, "testExport-%?");
class DLL_PUBLIC MockDaemon : public NetFSDaemon {
public:
diff --git a/netfs/unittests/testCore.cpp b/netfs/unittests/testCore.cpp
index 4b12871..76b3c4c 100644
--- a/netfs/unittests/testCore.cpp
+++ b/netfs/unittests/testCore.cpp
@@ -7,7 +7,7 @@
#include <ostream>
#include <algorithm>
-const auto testExport = stringbf("testExport-%d", getpid());
+const auto testExport = UniqueExport::get(getpid());
const std::string testEndpoint("tcp -h localhost -p 12012");
const std::string testUri("tcp://localhost:12012/testvol");
@@ -18,10 +18,11 @@ operator==(const struct stat & a, const struct stat & b)
}
namespace std {
+ AdHocFormatter(StatDebug, "dev: %? inode: %?");
// LCOV_EXCL_START
ostream & operator<<(ostream & s, const struct stat & ss)
{
- return s << "dev: " << ss.st_dev << " inode: " << ss.st_ino;
+ return StatDebug::write(s, ss.st_dev, ss.st_ino);
}
// LCOV_EXCL_STOP
}