Functions | Variables

utf8-parse-test.cpp File Reference

#include <iostream>
#include <sstream>
#include "perf/perf.h"
#include "util/parsing.h"
Include dependency graph for utf8-parse-test.cpp:

Go to the source code of this file.

Functions

static void testLine (IN const test_line_t *p)
static void invalidLine (IN const invalid_line_t *p)
static void doTest (void)
int main (IN int argc, IN const char *argv[])

Variables

static test_line_t s_testLines []
static const invalid_line_t s_invalidLines []

Function Documentation

static void testLine ( IN const test_line_t *  p  )  [static]

Definition at line 94 of file utf8-parse-test.cpp.

static void invalidLine ( IN const invalid_line_t *  p  )  [static]

Definition at line 151 of file utf8-parse-test.cpp.

static void doTest ( void   )  [static]

Definition at line 174 of file utf8-parse-test.cpp.

int main ( IN int  argc,
IN const char *  argv[] 
)

Definition at line 197 of file utf8-parse-test.cpp.


Variable Documentation

test_line_t s_testLines[] [static]
Initial value:
 {
          
        { "This is a test in English",                          6,      25 },
        { "I can eat glass.",                                   4,      16 },

        
        { "Мон ярсан суликадо, ды зыян эйстэнзэ а ули.",      8,      43 },

        
        { "मैं काँच खा सकता हूँ और मुझे उससे कोई चोट नहीं पहुंचती",
        12, 54 },

        
        { "我能吞下玻璃而不傷身體",                          1,      11 },

        
        { "Я могу есть стекло, оно мне не вредит.",                8,      38 },

        
        { "Je peux manger du verre, ça ne me fait pas  mal.",  11,     48 },

        
        { NULL, 0, 0 }
}

Definition at line 27 of file utf8-parse-test.cpp.

const invalid_line_t s_invalidLines[] [static]
Initial value:
 {
        
        { { 0x80, 0x00 } },
        { { 0x81, 0x00 } },

        
        { { 0xc0, 0x20, 0x00 } },       
        { { 0xc1, 0x30, 0x00 } },
        { { 0xc1, 0x00 } },
        { { 0xe0, 0x20, 0x00 } }, 
        { { 0xe1, 0x00 } },
        { { 0xe1, 0x20, 0x00 } },
        { { 0xf0, 0x20, 0x00 } }, 
        { { 0xf0, 0x00 } },

        
        { { 0xfe, 0x00 } },
        { { 0xff, 0x00 } },
        { { 0xfe, 0xfe, 0xff, 0xff, 0x00 } },

        
        { { 0x00 } }
}

Definition at line 61 of file utf8-parse-test.cpp.