Test StrCat of ints and longs of various sizes and signdedness.
| 31 | |
| 32 | // Test StrCat of ints and longs of various sizes and signdedness. |
| 33 | TEST(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 | |
| 64 | TEST(StrCat, Basics) { |
| 65 | string result; |
nothing calls this directly
no test coverage detected