| 30 | } // namespace |
| 31 | |
| 32 | TEST(StringConcat, Enum) |
| 33 | { |
| 34 | // local enum |
| 35 | enum { |
| 36 | L_FIRST, |
| 37 | L_SECOND |
| 38 | }; |
| 39 | |
| 40 | std::string s; |
| 41 | StringAppend(&s, N_FIRST); |
| 42 | EXPECT_EQ("0", s); |
| 43 | StringAppend(&s, A_FIRST); |
| 44 | EXPECT_EQ("00", s); |
| 45 | StringAppend(&s, L_FIRST); |
| 46 | EXPECT_EQ("000", s); |
| 47 | EXPECT_EQ("0", StringConcat(N_FIRST)); |
| 48 | |
| 49 | // The following code can't compile because anonymous and local enums |
| 50 | // has no linkage |
| 51 | #if 0 |
| 52 | EXPECT_EQ("0", StringConcat(A_FIRST)); |
| 53 | EXPECT_EQ("0", StringConcat(L_FIRST)); |
| 54 | #endif |
| 55 | } |
| 56 | |
| 57 | TEST(StringConcat, Append) |
| 58 | { |
nothing calls this directly
no test coverage detected