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

Function TEST

tensorflow/core/lib/strings/numbers_test.cc:29–43  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

27
28// Test StrCat of ints and longs of various sizes and signdedness.
29TEST(FpToString, Ints) {
30 for (int s = 0; s < 64; s++) {
31 for (int delta = -1; delta <= 1; delta++) {
32 uint64 fp = (1ull << s) + delta;
33 string s = FpToString(fp);
34 uint64 fp2;
35 EXPECT_TRUE(StringToFp(s, &fp2));
36 EXPECT_EQ(fp, fp2);
37 }
38 }
39 Fprint dummy;
40 EXPECT_FALSE(StringToFp("", &dummy));
41 EXPECT_FALSE(StringToFp("xyz", &dummy));
42 EXPECT_FALSE(StringToFp("0000000000000000xyz", &dummy));
43}
44
45TEST(Uint64ToHexString, Ints) {
46 for (int s = 0; s < 64; s++) {

Callers

nothing calls this directly

Calls 15

FpToStringFunction · 0.85
StringToFpFunction · 0.85
Uint64ToHexStringFunction · 0.85
HexStringToUint64Function · 0.85
HumanReadableNumFunction · 0.85
HumanReadableElapsedTimeFunction · 0.85
safe_strtou32Function · 0.85
safe_strto64Function · 0.85
safe_strtou64Function · 0.85
safe_strtofFunction · 0.85
infinityFunction · 0.85
isnanClass · 0.85

Tested by

no test coverage detected