Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
strfunctest.cpp File Reference
Include dependency graph for strfunctest.cpp:

Go to the source code of this file.

Functions

 TEST (StrFunc, CountStringCodePoint)
 

Function Documentation

◆ TEST()

TEST ( StrFunc ,
CountStringCodePoint  )

Definition at line 21 of file strfunctest.cpp.

21 {
23 EXPECT_TRUE(CountStringCodePoint<UTF8<> >("", 0, &count));
24 EXPECT_EQ(0u, count);
25 EXPECT_TRUE(CountStringCodePoint<UTF8<> >("Hello", 5, &count));
26 EXPECT_EQ(5u, count);
27 EXPECT_TRUE(CountStringCodePoint<UTF8<> >("\xC2\xA2\xE2\x82\xAC\xF0\x9D\x84\x9E", 9, &count)); // cents euro G-clef
28 EXPECT_EQ(3u, count);
29 EXPECT_FALSE(CountStringCodePoint<UTF8<> >("\xC2\xA2\xE2\x82\xAC\xF0\x9D\x84\x9E\x80", 10, &count));
30}
int * count
#define EXPECT_EQ(val1, val2)
Definition gtest.h:1954
#define EXPECT_TRUE(condition)
Definition gtest.h:1895
#define EXPECT_FALSE(condition)
Definition gtest.h:1898
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
Definition rapidjson.h:384
UTF-8 encoding.
Definition encodings.h:96