Commit 5295ccef authored by Victor Zverovich's avatar Victor Zverovich Committed by Facebook GitHub Bot

Migrate from Folly Format to fmt

Summary: Migrate a couple of uses of Folly Format to fmt.

Reviewed By: simpkins

Differential Revision: D20152350

fbshipit-source-id: fb9798f5ff458ee03e1c01f839dc1c55796d0eaa
parent 99728475
......@@ -16,9 +16,10 @@
#include <folly/File.h>
#include <fmt/core.h>
#include <folly/Exception.h>
#include <folly/FileUtil.h>
#include <folly/Format.h>
#include <folly/ScopeGuard.h>
#include <folly/portability/Fcntl.h>
#include <folly/portability/SysFile.h>
......@@ -41,8 +42,7 @@ File::File(const char* name, int flags, mode_t mode)
: fd_(::open(name, flags, mode)), ownsFd_(false) {
if (fd_ == -1) {
throwSystemError(
folly::format("open(\"{}\", {:#o}, 0{:#o}) failed", name, flags, mode)
.fbstr());
fmt::format("open(\"{}\", {:#o}, 0{:#o}) failed", name, flags, mode));
}
ownsFd_ = true;
}
......
......@@ -21,7 +21,8 @@
#include <string>
#include <vector>
#include <folly/Format.h>
#include <fmt/core.h>
#include <folly/String.h>
#include <folly/detail/IPAddressSource.h>
......@@ -93,7 +94,7 @@ CIDRNetwork IPAddress::createNetwork(
}
if (ret.error() == CIDRNetworkError::INVALID_IP_SLASH_CIDR) {
throw IPAddressFormatException(sformat(
throw IPAddressFormatException(fmt::format(
"Invalid ipSlashCidr specified. Expected IP/CIDR format, got '{}'",
ipSlashCidr));
}
......@@ -106,17 +107,17 @@ CIDRNetwork IPAddress::createNetwork(
case CIDRNetworkError::INVALID_IP:
CHECK_GE(vec.size(), 1);
throw IPAddressFormatException(
sformat("Invalid IP address {}", vec.at(0)));
fmt::format("Invalid IP address {}", vec.at(0)));
case CIDRNetworkError::INVALID_CIDR:
CHECK_GE(vec.size(), 2);
throw IPAddressFormatException(
sformat("Mask value '{}' not a valid mask", vec.at(1)));
fmt::format("Mask value '{}' not a valid mask", vec.at(1)));
case CIDRNetworkError::CIDR_MISMATCH: {
auto const subnet = IPAddress::tryFromString(vec.at(0)).value();
auto cidr = static_cast<uint8_t>(
(defaultCidr > -1) ? defaultCidr : (subnet.isV4() ? 32 : 128));
throw IPAddressFormatException(sformat(
throw IPAddressFormatException(fmt::format(
"CIDR value '{}' is > network bit count '{}'",
vec.size() == 2 ? vec.at(1) : to<string>(cidr),
subnet.bitCount()));
......@@ -176,7 +177,7 @@ Expected<CIDRNetwork, CIDRNetworkError> IPAddress::tryCreateNetwork(
// public static
std::string IPAddress::networkToString(const CIDRNetwork& network) {
return sformat("{}/{}", network.first.str(), network.second);
return fmt::format("{}/{}", network.first.str(), network.second);
}
// public static
......@@ -188,7 +189,7 @@ IPAddress IPAddress::fromBinary(ByteRange bytes) {
} else {
string hexval = detail::Bytes::toHex(bytes.data(), bytes.size());
throw IPAddressFormatException(
sformat("Invalid address with hex value '{}'", hexval));
fmt::format("Invalid address with hex value '{}'", hexval));
}
}
......@@ -363,7 +364,7 @@ bool IPAddress::inSubnetWithMask(const IPAddress& subnet, ByteRange mask)
uint8_t IPAddress::getNthMSByte(size_t byteIndex) const {
const auto highestIndex = byteCount() - 1;
if (byteIndex > highestIndex) {
throw std::invalid_argument(sformat(
throw std::invalid_argument(fmt::format(
"Byte index must be <= {} for addresses of type: {}",
highestIndex,
detail::familyNameStr(family())));
......@@ -440,7 +441,7 @@ CIDRNetwork IPAddress::longestCommonPrefix(
const CIDRNetwork& one,
const CIDRNetwork& two) {
if (one.first.family() != two.first.family()) {
throw std::invalid_argument(sformat(
throw std::invalid_argument(fmt::format(
"Can't compute longest common prefix between addresses of different"
"families. Passed: {} and {}",
detail::familyNameStr(one.first.family()),
......@@ -463,13 +464,13 @@ CIDRNetwork IPAddress::longestCommonPrefix(
[[noreturn]] void IPAddress::asV4Throw() const {
auto fam = detail::familyNameStr(family());
throw InvalidAddressFamilyException(
sformat("Can't convert address with family {} to AF_INET address", fam));
fmt::format("Can't convert address with family {} to AF_INET address", fam));
}
[[noreturn]] void IPAddress::asV6Throw() const {
auto fam = detail::familyNameStr(family());
throw InvalidAddressFamilyException(
sformat("Can't convert address with family {} to AF_INET6 address", fam));
fmt::format("Can't convert address with family {} to AF_INET6 address", fam));
}
// clang-format on
......
......@@ -19,9 +19,12 @@
#include <ostream>
#include <string>
#include <folly/Format.h>
#include <fmt/core.h>
#include <folly/Conv.h>
#include <folly/IPAddress.h>
#include <folly/IPAddressV6.h>
#include <folly/String.h>
#include <folly/detail/IPAddressSource.h>
using std::ostream;
......@@ -67,7 +70,7 @@ uint32_t IPAddressV4::toLong(StringPiece ip) {
in_addr addr;
if (inet_pton(AF_INET, str.c_str(), &addr) != 1) {
throw IPAddressFormatException(
sformat("Can't convert invalid IP '{}' to long", ip));
fmt::format("Can't convert invalid IP '{}' to long", ip));
}
return addr.s_addr;
}
......@@ -140,12 +143,12 @@ IPAddressV4 IPAddressV4::fromInverseArpaName(const std::string& arpaname) {
// input must be something like 1.0.168.192.in-addr.arpa
if (!piece.removeSuffix(".in-addr.arpa")) {
throw IPAddressFormatException(
sformat("input does not end with '.in-addr.arpa': '{}'", arpaname));
fmt::format("input does not end with '.in-addr.arpa': '{}'", arpaname));
}
std::vector<StringPiece> pieces;
split(".", piece, pieces);
if (pieces.size() != 4) {
throw IPAddressFormatException(sformat("Invalid input. Got {}", piece));
throw IPAddressFormatException(fmt::format("Invalid input. Got {}", piece));
}
// reverse 1.0.168.192 -> 192.168.0.1
return IPAddressV4(join(".", pieces.rbegin(), pieces.rend()));
......@@ -169,7 +172,7 @@ IPAddressV6 IPAddressV4::getIPv6For6To4() const {
// public
string IPAddressV4::toJson() const {
return sformat("{{family:'AF_INET', addr:'{}', hash:{}}}", str(), hash());
return fmt::format("{{family:'AF_INET', addr:'{}', hash:{}}}", str(), hash());
}
// public
......@@ -178,7 +181,7 @@ bool IPAddressV4::inSubnet(StringPiece cidrNetwork) const {
auto addr = subnetInfo.first;
if (!addr.isV4()) {
throw IPAddressFormatException(
sformat("Address '{}' is not a V4 address", addr.toJson()));
fmt::format("Address '{}' is not a V4 address", addr.toJson()));
}
return inSubnetWithMask(addr.asV4(), fetchMask(subnetInfo.second));
}
......@@ -240,7 +243,7 @@ IPAddressV4 IPAddressV4::mask(size_t numBits) const {
static const auto bits = bitCount();
if (numBits > bits) {
throw IPAddressFormatException(
sformat("numBits({}) > bitsCount({})", numBits, bits));
fmt::format("numBits({}) > bitsCount({})", numBits, bits));
}
ByteArray4 ba = detail::Bytes::mask(fetchMask(numBits), addr_.bytes_);
......@@ -259,7 +262,7 @@ void IPAddressV4::toFullyQualifiedAppend(std::string& out) const {
// public
string IPAddressV4::toInverseArpaName() const {
return sformat(
return fmt::format(
"{}.{}.{}.{}.in-addr.arpa",
addr_.bytes_[3],
addr_.bytes_[2],
......@@ -271,7 +274,7 @@ string IPAddressV4::toInverseArpaName() const {
uint8_t IPAddressV4::getNthMSByte(size_t byteIndex) const {
const auto highestIndex = byteCount() - 1;
if (byteIndex > highestIndex) {
throw std::invalid_argument(sformat(
throw std::invalid_argument(fmt::format(
"Byte index must be <= {} for addresses of type: {}",
highestIndex,
detail::familyNameStr(AF_INET)));
......
......@@ -20,10 +20,13 @@
#include <ostream>
#include <string>
#include <folly/Format.h>
#include <fmt/core.h>
#include <folly/IPAddress.h>
#include <folly/IPAddressV4.h>
#include <folly/MacAddress.h>
#include <folly/ScopeGuard.h>
#include <folly/String.h>
#include <folly/detail/IPAddressSource.h>
#ifndef _WIN32
......@@ -203,13 +206,14 @@ Expected<Unit, IPAddressFormatError> IPAddressV6::trySetFromBinary(
IPAddressV6 IPAddressV6::fromInverseArpaName(const std::string& arpaname) {
auto piece = StringPiece(arpaname);
if (!piece.removeSuffix(".ip6.arpa")) {
throw IPAddressFormatException(sformat(
throw IPAddressFormatException(fmt::format(
"Invalid input. Should end with 'ip6.arpa'. Got '{}'", arpaname));
}
std::vector<StringPiece> pieces;
split(".", piece, pieces);
if (pieces.size() != 32) {
throw IPAddressFormatException(sformat("Invalid input. Got '{}'", piece));
throw IPAddressFormatException(
fmt::format("Invalid input. Got '{}'", piece));
}
std::array<char, IPAddressV6::kToFullyQualifiedSize> ip;
size_t pos = 0;
......@@ -256,7 +260,7 @@ unpackInto(const unsigned char* src, uint16_t* dest, size_t count) {
IPAddressV4 IPAddressV6::getIPv4For6To4() const {
if (!is6To4()) {
throw IPAddressV6::TypeError(
sformat("Invalid IP '{}': not a 6to4 address", str()));
fmt::format("Invalid IP '{}': not a 6to4 address", str()));
}
// convert 16x8 bytes into first 4x16 bytes
uint16_t ints[4] = {0, 0, 0, 0};
......@@ -308,7 +312,8 @@ IPAddressV6::Type IPAddressV6::type() const {
// public
string IPAddressV6::toJson() const {
return sformat("{{family:'AF_INET6', addr:'{}', hash:{}}}", str(), hash());
return fmt::format(
"{{family:'AF_INET6', addr:'{}', hash:{}}}", str(), hash());
}
// public
......@@ -332,7 +337,7 @@ bool IPAddressV6::inSubnet(StringPiece cidrNetwork) const {
auto addr = subnetInfo.first;
if (!addr.isV6()) {
throw IPAddressFormatException(
sformat("Address '{}' is not a V6 address", addr.toJson()));
fmt::format("Address '{}' is not a V6 address", addr.toJson()));
}
return inSubnetWithMask(addr.asV6(), fetchMask(subnetInfo.second));
}
......@@ -429,7 +434,7 @@ IPAddressV6 IPAddressV6::mask(size_t numBits) const {
static const auto bits = bitCount();
if (numBits > bits) {
throw IPAddressFormatException(
sformat("numBits({}) > bitCount({})", numBits, bits));
fmt::format("numBits({}) > bitCount({})", numBits, bits));
}
ByteArray16 ba = detail::Bytes::mask(fetchMask(numBits), addr_.bytes_);
return IPAddressV6(ba);
......@@ -440,7 +445,7 @@ string IPAddressV6::str() const {
char buffer[INET6_ADDRSTRLEN + IFNAMSIZ + 1];
if (!inet_ntop(AF_INET6, toAddr().s6_addr, buffer, INET6_ADDRSTRLEN)) {
throw IPAddressFormatException(sformat(
throw IPAddressFormatException(fmt::format(
"Invalid address with hex '{}' with error {}",
detail::Bytes::toHex(bytes(), 16),
errnoStr(errno)));
......@@ -483,14 +488,14 @@ string IPAddressV6::toInverseArpaName() const {
a[j + 1] = (lut[bytes()[i] >> 4]);
j += 2;
}
return sformat("{}.ip6.arpa", join(".", a));
return fmt::format("{}.ip6.arpa", join(".", a));
}
// public
uint8_t IPAddressV6::getNthMSByte(size_t byteIndex) const {
const auto highestIndex = byteCount() - 1;
if (byteIndex > highestIndex) {
throw std::invalid_argument(sformat(
throw std::invalid_argument(fmt::format(
"Byte index must be <= {} for addresses of type: {}",
highestIndex,
detail::familyNameStr(AF_INET6)));
......
......@@ -28,8 +28,9 @@
#include <iostream>
#include <string>
#include <fmt/core.h>
#include <folly/Demangle.h>
#include <folly/Format.h>
#include <folly/ScopeGuard.h>
#include <folly/detail/SingletonStackTrace.h>
#include <folly/portability/Config.h>
......@@ -158,9 +159,9 @@ void singletonPrintDestructionStackTrace(const TypeDescriptor& type) {
}
[[noreturn]] void singletonThrowNullCreator(const std::type_info& type) {
auto const msg = sformat(
auto const msg = fmt::format(
"nullptr_t should be passed if you want {} to be default constructed",
demangle(type));
folly::StringPiece(demangle(type)));
throw std::logic_error(msg);
}
......
......@@ -27,12 +27,14 @@
#include <sstream>
#include <string>
#include <system_error>
#include <type_traits>
#include <boost/functional/hash.hpp>
#include <fmt/core.h>
#include <folly/CppAttributes.h>
#include <folly/Exception.h>
#include <folly/Format.h>
#include <folly/hash/Hash.h>
#include <folly/net/NetOps.h>
#include <folly/net/NetworkSocket.h>
......@@ -103,6 +105,22 @@ struct HostAndPort {
char* allocated;
};
struct GetAddrInfoError {
#ifdef _WIN32
std::string error;
const char* str() const { return error.c_str(); }
explicit GetAddrInfoError(int errorCode) {
auto s = gai_strerror(errorCode);
using Char = std::remove_reference_t<decltype(*s)>;
error.assign(s, s + std::char_traits<Char>::length(s));
}
#else
const char* error;
const char* str() const { return error; }
explicit GetAddrInfoError(int errorCode) : error(gai_strerror(errorCode)) {}
#endif
};
} // namespace
namespace folly {
......@@ -617,10 +635,10 @@ SocketAddress::getAddrInfo(const char* host, const char* port, int flags) {
struct addrinfo* results;
int error = getaddrinfo(host, port, &hints, &results);
if (error != 0) {
auto os = folly::sformat(
auto os = fmt::format(
"Failed to resolve address for '{}': {} (error={})",
host,
gai_strerror(error),
GetAddrInfoError(error).str(),
error);
throw std::system_error(error, std::generic_category(), os);
}
......@@ -684,8 +702,9 @@ void SocketAddress::getIpString(char* buf, size_t buflen, int flags) const {
0,
flags);
if (rc != 0) {
auto os = sformat(
"getnameinfo() failed in getIpString() error = {}", gai_strerror(rc));
auto os = fmt::format(
"getnameinfo() failed in getIpString() error = {}",
GetAddrInfoError(rc).str());
throw std::system_error(rc, std::generic_category(), os);
}
}
......
......@@ -22,10 +22,11 @@
#endif
#include <fstream>
#include <fmt/core.h>
#include <folly/Conv.h>
#include <folly/Exception.h>
#include <folly/FileUtil.h>
#include <folly/Format.h>
#include <folly/ScopeGuard.h>
namespace folly {
......@@ -108,8 +109,8 @@ CacheLocality CacheLocality::readFromSysfsTree(
auto cpu = cpus.size();
std::vector<size_t> levels;
for (size_t index = 0;; ++index) {
auto dir =
sformat("/sys/devices/system/cpu/cpu{}/cache/index{}/", cpu, index);
auto dir = fmt::format(
"/sys/devices/system/cpu/cpu{}/cache/index{}/", cpu, index);
auto cacheType = mapping(dir + "type");
auto equivStr = mapping(dir + "shared_cpu_list");
if (cacheType.empty() || equivStr.empty()) {
......
......@@ -24,7 +24,8 @@
#include <boost/interprocess/allocators/adaptive_pool.hpp>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <folly/Format.h>
#include <fmt/core.h>
#include <folly/Random.h>
#include <folly/Traits.h>
#include <folly/container/F14Map.h>
......@@ -108,7 +109,7 @@ using ShmF14VectorI2VVI = folly::F14VectorMap<
namespace {
std::string makeRandomName() {
return folly::sformat("f14test_{}", folly::Random::rand64());
return fmt::format("f14test_{}", folly::Random::rand64());
}
std::shared_ptr<managed_shared_memory> makeShmSegment(
......
......@@ -24,6 +24,7 @@
#include <random>
#include <vector>
#include <fmt/core.h>
#include <folly/Benchmark.h>
#include <folly/Format.h>
#include <folly/portability/GFlags.h>
......@@ -117,23 +118,23 @@ void setup_rand_bench() {
tie(size_add, size_contains) = kvp;
addBenchmark(
__FILE__,
sformat("bitset_rand_bench({}, {})", size_add, size_contains).c_str(),
fmt::format("bitset_rand_bench({}, {})", size_add, size_contains),
[=](int iters) {
rand_bench<BitSetWrapper>(iters, size_add, size_contains);
return iters;
});
addBenchmark(
__FILE__,
sformat("%bool_array_set_rand_bench({}, {})", size_add, size_contains)
.c_str(),
fmt::format(
"%bool_array_set_rand_bench({}, {})", size_add, size_contains),
[=](int iters) {
rand_bench<BoolArraySet>(iters, size_add, size_contains);
return iters;
});
addBenchmark(
__FILE__,
sformat("%sparse_byte_set_rand_bench({}, {})", size_add, size_contains)
.c_str(),
fmt::format(
"%sparse_byte_set_rand_bench({}, {})", size_add, size_contains),
[=](int iters) {
rand_bench<SparseByteSet>(iters, size_add, size_contains);
return iters;
......
......@@ -16,17 +16,18 @@
#include <folly/detail/IPAddress.h>
#include <folly/Format.h>
#include <fmt/core.h>
#include <stdexcept>
namespace folly {
namespace detail {
std::string familyNameStrDefault(sa_family_t family) {
return sformat("sa_family_t({})", family);
return fmt::format("sa_family_t({})", family);
}
[[noreturn]] void getNthMSBitImplThrow(size_t bitCount, sa_family_t family) {
throw std::invalid_argument(sformat(
throw std::invalid_argument(fmt::format(
"Bit index must be < {} for addresses of type: {}",
bitCount,
familyNameStr(family)));
......
......@@ -26,7 +26,7 @@
#include <glog/logging.h>
#include <folly/Format.h>
#include <fmt/core.h>
#include <folly/detail/IPAddress.h>
// BSDish platforms don't provide standard access to s6_addr16
......@@ -76,7 +76,7 @@ struct Bytes {
0xff // /8
}};
if (oneMask > kBitCount || twoMask > kBitCount) {
throw std::invalid_argument(sformat(
throw std::invalid_argument(fmt::format(
"Invalid mask length: {}. Mask length must be <= {}",
std::max(oneMask, twoMask),
kBitCount));
......
......@@ -16,7 +16,8 @@
#include <folly/fibers/detail/AtomicBatchDispatcher.h>
#include <folly/Format.h>
#include <fmt/core.h>
#include <cassert>
namespace folly {
namespace fibers {
......@@ -28,15 +29,14 @@ std::string createABDTokenNotDispatchedExMsg(
assert(numTokensNotDispatched > 0);
size_t numSeqNumToPrint =
(numTokensNotDispatched > 10 ? 10 : numTokensNotDispatched);
std::string strInputsNotFound =
folly::sformat("{}", vecTokensNotDispatched[0]);
std::string strInputsNotFound = fmt::format("{}", vecTokensNotDispatched[0]);
for (size_t i = 1; i < numSeqNumToPrint; ++i) {
strInputsNotFound += folly::sformat(", {}", vecTokensNotDispatched[i]);
strInputsNotFound += fmt::format(", {}", vecTokensNotDispatched[i]);
}
if (numSeqNumToPrint < numTokensNotDispatched) {
strInputsNotFound += "...";
}
return folly::sformat(
return fmt::format(
"{} input tokens (seq nums: {}) destroyed before calling dispatch",
numTokensNotDispatched,
strInputsNotFound);
......@@ -45,7 +45,7 @@ std::string createABDTokenNotDispatchedExMsg(
std::string createUnexpectedNumResultsABDUsageExMsg(
size_t numExpectedResults,
size_t numActualResults) {
return folly::sformat(
return fmt::format(
"Unexpected number of results ({}) returned from dispatch function, "
"expected ({})",
numActualResults,
......
......@@ -23,10 +23,10 @@
#include <string>
#include <vector>
#include <fmt/core.h>
#include <glog/logging.h>
#include <folly/Benchmark.h>
#include <folly/Format.h>
#include <folly/Preprocessor.h>
#include <folly/portability/GFlags.h>
......@@ -59,7 +59,7 @@ void addHashBenchmark(const std::string& name) {
for (size_t i = 0; i < 16; ++i) {
auto k = size_t(1) << i;
names.emplace_back(folly::sformat("{}: k=2^{}", name, i));
names.emplace_back(fmt::format("{}: k=2^{}", name, i));
folly::addBenchmark(__FILE__, names.back().c_str(), [=](unsigned iters) {
Hasher hasher;
bmHasher(hasher, k, iters);
......
......@@ -16,10 +16,11 @@
#include <folly/IPAddress.h>
#include <fmt/core.h>
#include <glog/logging.h>
#include <folly/Benchmark.h>
#include <folly/Format.h>
#include <folly/Conv.h>
using namespace folly;
using std::string;
......@@ -50,7 +51,7 @@ BENCHMARK_DRAW_LINE();
BENCHMARK(ipv4_to_fully_qualified_port, iters) {
IPAddressV4 ip("255.255.255.255");
while (iters--) {
string outputString = folly::sformat("{}:{}", ip.toFullyQualified(), 65535);
string outputString = fmt::format("{}:{}", ip.toFullyQualified(), 65535);
folly::doNotOptimizeAway(outputString);
folly::doNotOptimizeAway(outputString.data());
}
......@@ -97,7 +98,7 @@ BENCHMARK_DRAW_LINE();
BENCHMARK(ipv6_to_fully_qualified_port, iters) {
IPAddressV6 ip("F1E0:0ACE:FB94:7ADF:22E8:6DE6:9672:3725");
while (iters--) {
string outputString = folly::sformat("{}:{}", ip.toFullyQualified(), 65535);
string outputString = fmt::format("{}:{}", ip.toFullyQualified(), 65535);
folly::doNotOptimizeAway(outputString);
folly::doNotOptimizeAway(outputString.data());
}
......
......@@ -20,7 +20,8 @@
#include <string>
#include <folly/Format.h>
#include <fmt/core.h>
#include <folly/MacAddress.h>
#include <folly/String.h>
#include <folly/container/BitIterator.h>
......@@ -661,7 +662,7 @@ TEST(IPaddress, toInverseArpaName) {
EXPECT_EQ("1.0.0.10.in-addr.arpa", addr_ipv4.toInverseArpaName());
IPAddressV6 addr_ipv6("2620:0000:1cfe:face:b00c:0000:0000:0003");
EXPECT_EQ(
sformat(
fmt::format(
"{}.ip6.arpa",
"3.0.0.0.0.0.0.0.0.0.0.0.c.0.0.b.e.c.a.f.e.f.c.1.0.0.0.0.0.2.6.2"),
addr_ipv6.toInverseArpaName());
......@@ -673,7 +674,7 @@ TEST(IPaddress, fromInverseArpaName) {
IPAddressV4::fromInverseArpaName("1.0.0.10.in-addr.arpa"));
EXPECT_EQ(
IPAddressV6("2620:0000:1cfe:face:b00c:0000:0000:0003"),
IPAddressV6::fromInverseArpaName(sformat(
IPAddressV6::fromInverseArpaName(fmt::format(
"{}.ip6.arpa",
"3.0.0.0.0.0.0.0.0.0.0.0.c.0.0.b.e.c.a.f.e.f.c.1.0.0.0.0.0.2.6.2")));
}
......
......@@ -16,7 +16,8 @@
#include <folly/MacAddress.h>
#include <folly/Format.h>
#include <fmt/core.h>
#include <folly/IPAddressV6.h>
#include <folly/portability/GTest.h>
......@@ -141,7 +142,7 @@ TEST(MacAddress, createMulticast) {
}
void testCmp(const char* str1, const char* str2) {
SCOPED_TRACE(folly::sformat("{} < {}", str1, str2));
SCOPED_TRACE(fmt::format("{} < {}", str1, str2));
MacAddress m1(str1);
MacAddress m2(str2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment