Electroneum
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  {
24  EXPECT_EQ(0u, 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 }
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
Definition: rapidjson.h:389
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
mdb_size_t count(MDB_cursor *cur)
bool CountStringCodePoint(const typename Encoding::Ch *s, SizeType length, SizeType *outCount)
Returns number of code points in a encoded string.
Definition: strfunc.h:50
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
UTF-8 encoding.
Definition: encodings.h:96
Here is the call graph for this function: