blob: 43b89058b16f7f45d29cd7b5bee50c2f5775f00e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
// Auxiliary tests for juniper - based on Juniper 1.x proximitytest.cpp
#include <map>
#include <vespa/fastlib/testsuite/test.h>
#include "testenv.h"
class AuxTest : public Test
{
private:
AuxTest(const AuxTest&);
AuxTest& operator=(const AuxTest&);
public:
AuxTest();
virtual ~AuxTest();
typedef void(AuxTest::* tst_method_ptr) ();
typedef std::map<std::string, tst_method_ptr> MethodContainer;
MethodContainer test_methods_;
void init();
void Run(MethodContainer::iterator &itr);
void Run(const char* method);
void Run(int argc, char* argv[]);
virtual void Run();
protected:
/**
* Since we are running within Emacs, the default behavior of
* print_progress which includes backspace does not work.
* We'll use a single '.' instead.
*/
virtual void print_progress() { *m_osptr << '.' << std::flush; }
private:
// tests:
void TestPropertyMap();
void TestRerase();
void TestExample();
void TestUTF8context();
void TestJapanese();
void TestStartHits();
void TestEndHit();
void TestJuniperStack();
void TestUTF811();
void TestUTF812();
void TestDoubleWidth();
void TestPartialUTF8();
void TestLargeBlockChinese();
void TestSpecialTokenRegistry();
void TestWhiteSpacePreserved();
bool assertChar(ucs4_t act, char exp);
// Utilities
char* IsoToUtf8 (const char* iso, size_t size);
char* Utf8ToIso (const char* iso, size_t size);
void test_summary(Matcher& m, const char* input, size_t input_len,
int size, int matches, int surround, size_t& charsize);
void TestUTF8(unsigned int size);
bool _split_char;
SummaryConfig* _sumconf;
};
|