blob: 9e0828cfa77f685be3130cc0e2bbcd75e47d9bd6 (
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
/**
* Definition of the automated unit test class for the MatchObject class.
*
* @file matchobjectTest.h
*
* @author Knut Omang
*
* @date Created 21 Feb 2003
*
* $Id$
*
* <pre>
* Copyright (c) : 2003 Fast Search & Transfer ASA
* ALL RIGHTS RESERVED
* </pre>
***************************************************************************/
#pragma once
#include <map>
#include <vespa/fastlib/testsuite/test.h>
#include "testenv.h"
/**
* The MatchObjectTest class holds
* the unit tests for the MatchObject class.
*
* @sa MatchObject
* @author Knut Omang
*/
class MatchObjectTest : public Test {
/*************************************************************************
* Test methods
*
* This section contains boolean methods for testing each public method
* in the class ing tested
*************************************************************************/
/**
* Test of the Term method.
*/
void testTerm();
/**
* Test of performance
*/
void testPerformance();
/**
* Test of the Match method.
*/
void testMatch();
/**
* Test of the Match method on annotated buffers.
*/
void testMatchAnnotated();
/**
* Test of the the expansion based (langid) constructor
*/
void testLangid();
void testCombined();
/** Test parameter input via query handle options
*/
void testParams();
/*************************************************************************
* Test administration methods
*************************************************************************/
/**
* Set up common stuff for all test methods.
* This method is called immediately before each test method is called
*/
bool setUp();
/**
* Tear down common stuff for all test methods.
* This method is called immediately after each test method is called
*/
void tearDown();
typedef void(MatchObjectTest::* tst_method_ptr) ();
typedef std::map<std::string, tst_method_ptr> MethodContainer;
MethodContainer test_methods_;
void init();
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() override { *m_osptr << '.' << std::flush; }
public:
MatchObjectTest() : Test("MatchObject"), test_methods_() { init(); }
~MatchObjectTest() {}
/*************************************************************************
* main entry points
*************************************************************************/
void Run(MethodContainer::iterator &itr);
virtual void Run() override;
void Run(const char *method);
void Run(int argc, char* argv[]);
};
// Local Variables:
// mode:c++
// End:
|