utf8rewind  1.5.1
System library for processing UTF-8 encoded text
helpers-streams.hpp
Go to the documentation of this file.
1 #pragma once
2 
10 #include "helpers-base.hpp"
11 
12 extern "C" {
13  #include "../internal/database.h"
14  #include "../internal/streaming.h"
15 }
16 
17 #define CHECK_STREAM_ENTRY(_stream, _index, _codepoint, _qc, _ccc) { \
18  ::helpers::StreamEntry e; \
19  e.codepoint = _codepoint; \
20  e.quick_check = QuickCheckResult_ ## _qc; \
21  e.canonical_combining_class = _ccc; \
22  ::helpers::StreamEntry a; \
23  a.index = _index; \
24  a.codepoint = (_stream).codepoint[_index]; \
25  a.quick_check = (_stream).quick_check[_index]; \
26  a.canonical_combining_class = (_stream).canonical_combining_class[_index]; \
27  EXPECT_PRED_FORMAT2(::helpers::CompareStream, e, a); \
28 }
29 
30 namespace helpers {
31 
32  StreamState createStream(const std::string& text);
33 
34  struct StreamEntry
35  {
36  uint8_t index;
37  unicode_t codepoint;
38  uint8_t quick_check;
39  uint8_t canonical_combining_class;
40  };
41 
42  ::testing::AssertionResult CompareStream(
43  const char* expressionExpected, const char* expressionActual,
44  const StreamEntry& entryExpected, const StreamEntry& entryActual);
45 
46 };
47 
Base includes for helper methods.
uint32_t unicode_t
UTF-32 encoded code point.
Definition: utf8rewind.h:698