MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / TEST

Function TEST

test/cpp/utils/string/printf_test.cc:21–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19#include "gtest/gtest.h"
20
21TEST(StringPrintf, StringPrintf) {
22 std::string weekday = "Wednesday";
23 const char* month = "July";
24 size_t day = 27;
25 int hour = 14;
26 int min = 44;
27 EXPECT_EQ(std::string("Wednesday, July 27, 14:44"),
28 paddle::string::Sprintf(
29 "%s, %s %d, %.2d:%.2d", weekday, month, day, hour, min));
30 EXPECT_EQ(std::string(""), paddle::string::Sprintf());
31}

Callers

nothing calls this directly

Calls 1

SprintfFunction · 0.85

Tested by

no test coverage detected