MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/core/lib/strings/strcat_test.cc:33–62  ·  view source on GitHub ↗

Test StrCat of ints and longs of various sizes and signdedness.

Source from the content-addressed store, hash-verified

31
32// Test StrCat of ints and longs of various sizes and signdedness.
33TEST(StrCat, Ints) {
34 const int16 s = -1;
35 const uint16 us = 2;
36 const int i = -3;
37 const unsigned int ui = 4;
38 const int32 l = -5;
39 const uint32 ul = 6;
40 const int64 ll = -7;
41 const uint64 ull = 8;
42 const ptrdiff_t ptrdiff = -9;
43 const size_t size = 10;
44 const ssize_t ssize = -11;
45 const intptr_t intptr = -12;
46 const uintptr_t uintptr = 13;
47 string answer;
48 answer = tensorflow::strings::StrCat(s, us);
49 EXPECT_EQ(answer, "-12");
50 answer = tensorflow::strings::StrCat(i, ui);
51 EXPECT_EQ(answer, "-34");
52 answer = tensorflow::strings::StrCat(l, ul);
53 EXPECT_EQ(answer, "-56");
54 answer = tensorflow::strings::StrCat(ll, ull);
55 EXPECT_EQ(answer, "-78");
56 answer = tensorflow::strings::StrCat(ptrdiff, size);
57 EXPECT_EQ(answer, "-910");
58 answer = tensorflow::strings::StrCat(ssize, intptr);
59 EXPECT_EQ(answer, "-11-12");
60 answer = tensorflow::strings::StrCat(uintptr, 0);
61 EXPECT_EQ(answer, "130");
62}
63
64TEST(StrCat, Basics) {
65 string result;

Callers

nothing calls this directly

Calls 6

EXPECT_DEBUG_DEATHFunction · 0.85
TestFastPrintsFunction · 0.85
c_strMethod · 0.80
StrCatFunction · 0.70
StrAppendFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected