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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
https://github.com/luceneplusplus/LucenePlusPlus/pull/226
diff --git a/src/test/index/AtomicUpdateTest.cpp b/src/test/index/AtomicUpdateTest.cpp
index 0535ee0..4dbbef8 100644
--- a/src/test/index/AtomicUpdateTest.cpp
+++ b/src/test/index/AtomicUpdateTest.cpp
@@ -24,13 +24,13 @@ using namespace Lucene;
typedef LuceneTestFixture AtomicUpdateTest;
-class MockIndexWriter : public IndexWriter {
+class AUTMockIndexWriter : public IndexWriter {
public:
- MockIndexWriter(const DirectoryPtr& dir, const AnalyzerPtr& a, bool create, int32_t mfl) : IndexWriter(dir, a, create, mfl) {
+ AUTMockIndexWriter(const DirectoryPtr& dir, const AnalyzerPtr& a, bool create, int32_t mfl) : IndexWriter(dir, a, create, mfl) {
random = newLucene<Random>();
}
- virtual ~MockIndexWriter() {
+ virtual ~AUTMockIndexWriter() {
}
protected:
@@ -140,7 +140,7 @@ static void runTest(const DirectoryPtr& directory) {
Collection<AtomicTimedThreadPtr> threads(Collection<AtomicTimedThreadPtr>::newInstance(4));
AnalyzerPtr analyzer = newLucene<SimpleAnalyzer>();
- IndexWriterPtr writer = newLucene<MockIndexWriter>(directory, analyzer, true, IndexWriter::MaxFieldLengthUNLIMITED);
+ IndexWriterPtr writer = newLucene<AUTMockIndexWriter>(directory, analyzer, true, IndexWriter::MaxFieldLengthUNLIMITED);
writer->setMaxBufferedDocs(7);
writer->setMergeFactor(3);
diff --git a/src/test/index/IndexReaderCloneNormsTest.cpp b/src/test/index/IndexReaderCloneNormsTest.cpp
index cdd213f..2deab71 100644
--- a/src/test/index/IndexReaderCloneNormsTest.cpp
+++ b/src/test/index/IndexReaderCloneNormsTest.cpp
@@ -22,9 +22,9 @@
using namespace Lucene;
-class SimilarityOne : public DefaultSimilarity {
+class IRCNTSimilarityOne : public DefaultSimilarity {
public:
- virtual ~SimilarityOne() {
+ virtual ~IRCNTSimilarityOne() {
}
public:
@@ -36,7 +36,7 @@ public:
class IndexReaderCloneNormsTest : public LuceneTestFixture {
public:
IndexReaderCloneNormsTest() {
- similarityOne = newLucene<SimilarityOne>();
+ similarityOne = newLucene<IRCNTSimilarityOne>();
anlzr = newLucene<StandardAnalyzer>(LuceneVersion::LUCENE_CURRENT);
numDocNorms = 0;
lastNorm = 0.0;
diff --git a/src/test/index/IndexWriterExceptionsTest.cpp b/src/test/index/IndexWriterExceptionsTest.cpp
index ba05c4a..4e5ded3 100644
--- a/src/test/index/IndexWriterExceptionsTest.cpp
+++ b/src/test/index/IndexWriterExceptionsTest.cpp
@@ -119,13 +119,13 @@ public:
}
};
-class MockIndexWriter : public IndexWriter {
+class IWETMockIndexWriter : public IndexWriter {
public:
- MockIndexWriter(const DirectoryPtr& dir, const AnalyzerPtr& a, bool create, int32_t mfl) : IndexWriter(dir, a, create, mfl) {
+ IWETMockIndexWriter(const DirectoryPtr& dir, const AnalyzerPtr& a, bool create, int32_t mfl) : IndexWriter(dir, a, create, mfl) {
this->r = newLucene<Random>(17);
}
- virtual ~MockIndexWriter() {
+ virtual ~IWETMockIndexWriter() {
}
protected:
@@ -142,7 +142,7 @@ public:
TEST_F(IndexWriterExceptionsTest, testRandomExceptions) {
MockRAMDirectoryPtr dir = newLucene<MockRAMDirectory>();
- IndexWriterPtr writer = newLucene<MockIndexWriter>(dir, newLucene<WhitespaceAnalyzer>(), true, IndexWriter::MaxFieldLengthLIMITED);
+ IndexWriterPtr writer = newLucene<IWETMockIndexWriter>(dir, newLucene<WhitespaceAnalyzer>(), true, IndexWriter::MaxFieldLengthLIMITED);
boost::dynamic_pointer_cast<ConcurrentMergeScheduler>(writer->getMergeScheduler())->setSuppressExceptions();
writer->setRAMBufferSizeMB(0.1);
@@ -174,7 +174,7 @@ TEST_F(IndexWriterExceptionsTest, testRandomExceptions) {
TEST_F(IndexWriterExceptionsTest, testRandomExceptionsThreads) {
MockRAMDirectoryPtr dir = newLucene<MockRAMDirectory>();
- IndexWriterPtr writer = newLucene<MockIndexWriter>(dir, newLucene<WhitespaceAnalyzer>(), true, IndexWriter::MaxFieldLengthLIMITED);
+ IndexWriterPtr writer = newLucene<IWETMockIndexWriter>(dir, newLucene<WhitespaceAnalyzer>(), true, IndexWriter::MaxFieldLengthLIMITED);
boost::dynamic_pointer_cast<ConcurrentMergeScheduler>(writer->getMergeScheduler())->setSuppressExceptions();
writer->setRAMBufferSizeMB(0.2);
diff --git a/src/test/index/NormsTest.cpp b/src/test/index/NormsTest.cpp
index 8212e3b..0321436 100644
--- a/src/test/index/NormsTest.cpp
+++ b/src/test/index/NormsTest.cpp
@@ -18,12 +18,12 @@
using namespace Lucene;
-class SimilarityOne : public DefaultSimilarity {
+class NTSimilarityOne : public DefaultSimilarity {
public:
- virtual ~SimilarityOne() {
+ virtual ~NTSimilarityOne() {
}
- LUCENE_CLASS(SimilarityOne);
+ LUCENE_CLASS(NTSimilarityOne);
public:
virtual double lengthNorm(const String& fieldName, int32_t numTokens) {
@@ -35,7 +35,7 @@ public:
class NormsTest : public LuceneTestFixture {
public:
NormsTest() {
- similarityOne = newLucene<SimilarityOne>();
+ similarityOne = newLucene<NTSimilarityOne>();
lastNorm = 0.0;
normDelta = 0.001;
numDocNorms = 0;
diff --git a/src/test/index/OmitTfTest.cpp b/src/test/index/OmitTfTest.cpp
index 618c1dd..0439215 100644
--- a/src/test/index/OmitTfTest.cpp
+++ b/src/test/index/OmitTfTest.cpp
@@ -29,7 +29,7 @@ using namespace Lucene;
typedef LuceneTestFixture OmitTfTest;
-DECLARE_SHARED_PTR(CountingHitCollector)
+DECLARE_SHARED_PTR(OITCountingHitCollector)
class SimpleIDFExplanation : public IDFExplanation {
public:
@@ -85,18 +85,18 @@ public:
}
};
-class CountingHitCollector : public Collector {
+class OITCountingHitCollector : public Collector {
public:
- CountingHitCollector() {
+ OITCountingHitCollector() {
count = 0;
sum = 0;
docBase = -1;
}
- virtual ~CountingHitCollector() {
+ virtual ~OITCountingHitCollector() {
}
- LUCENE_CLASS(CountingHitCollector);
+ LUCENE_CLASS(OITCountingHitCollector);
public:
int32_t count;
@@ -306,7 +306,7 @@ TEST_F(OmitTfTest, testNoPrxFile) {
namespace TestBasic {
-class CountingHitCollectorQ1 : public CountingHitCollector {
+class CountingHitCollectorQ1 : public OITCountingHitCollector {
protected:
ScorerPtr scorer;
@@ -317,11 +317,11 @@ public:
virtual void collect(int32_t doc) {
EXPECT_EQ(scorer->score(), 1.0);
- CountingHitCollector::collect(doc);
+ OITCountingHitCollector::collect(doc);
}
};
-class CountingHitCollectorQ2 : public CountingHitCollector {
+class CountingHitCollectorQ2 : public OITCountingHitCollector {
protected:
ScorerPtr scorer;
@@ -332,11 +332,11 @@ public:
virtual void collect(int32_t doc) {
EXPECT_EQ(scorer->score(), 1.0 + (double)doc);
- CountingHitCollector::collect(doc);
+ OITCountingHitCollector::collect(doc);
}
};
-class CountingHitCollectorQ3 : public CountingHitCollector {
+class CountingHitCollectorQ3 : public OITCountingHitCollector {
protected:
ScorerPtr scorer;
@@ -348,11 +348,11 @@ public:
virtual void collect(int32_t doc) {
EXPECT_EQ(scorer->score(), 1.0);
EXPECT_NE(doc % 2, 0);
- CountingHitCollector::collect(doc);
+ OITCountingHitCollector::collect(doc);
}
};
-class CountingHitCollectorQ4 : public CountingHitCollector {
+class CountingHitCollectorQ4 : public OITCountingHitCollector {
protected:
ScorerPtr scorer;
@@ -364,7 +364,7 @@ public:
virtual void collect(int32_t doc) {
EXPECT_EQ(scorer->score(), 1.0);
EXPECT_EQ(doc % 2, 0);
- CountingHitCollector::collect(doc);
+ OITCountingHitCollector::collect(doc);
}
};
@@ -424,7 +424,7 @@ TEST_F(OmitTfTest, testBasic) {
bq->add(q1, BooleanClause::MUST);
bq->add(q4, BooleanClause::MUST);
- CountingHitCollectorPtr collector = newLucene<CountingHitCollector>();
+ OITCountingHitCollectorPtr collector = newLucene<OITCountingHitCollector>();
searcher->search(bq, collector);
EXPECT_EQ(15, collector->count);
diff --git a/src/test/search/ScorerPerfTest.cpp b/src/test/search/ScorerPerfTest.cpp
index 9612c31..0ec1253 100644
--- a/src/test/search/ScorerPerfTest.cpp
+++ b/src/test/search/ScorerPerfTest.cpp
@@ -21,18 +21,18 @@
using namespace Lucene;
-DECLARE_SHARED_PTR(CountingHitCollector)
+DECLARE_SHARED_PTR(SPTCountingHitCollector)
DECLARE_SHARED_PTR(MatchingHitCollector)
-class CountingHitCollector : public Collector {
+class SPTCountingHitCollector : public Collector {
public:
- CountingHitCollector() {
+ SPTCountingHitCollector() {
count = 0;
sum = 0;
docBase = 0;
}
- virtual ~CountingHitCollector() {
+ virtual ~SPTCountingHitCollector() {
}
public:
@@ -66,7 +66,7 @@ public:
}
};
-class MatchingHitCollector : public CountingHitCollector {
+class MatchingHitCollector : public SPTCountingHitCollector {
public:
MatchingHitCollector(const BitSetPtr& answer) {
this->answer = answer;
@@ -86,7 +86,7 @@ public:
if (pos != doc + docBase) {
boost::throw_exception(RuntimeException(L"Expected doc " + StringUtils::toString(pos) + L" but got " + StringUtils::toString(doc + docBase)));
}
- CountingHitCollector::collect(doc);
+ SPTCountingHitCollector::collect(doc);
}
};
@@ -160,7 +160,7 @@ public:
result = addClause(bq, result);
}
- CountingHitCollectorPtr hc = newLucene<MatchingHitCollector>(result);
+ SPTCountingHitCollectorPtr hc = newLucene<MatchingHitCollector>(result);
s->search(bq, hc);
EXPECT_EQ(result->cardinality(), hc->getCount());
@@ -182,7 +182,7 @@ public:
oq->add(bq, BooleanClause::MUST);
}
- CountingHitCollectorPtr hc = newLucene<MatchingHitCollector>(result);
+ SPTCountingHitCollectorPtr hc = newLucene<MatchingHitCollector>(result);
s->search(oq, hc);
EXPECT_EQ(result->cardinality(), hc->getCount());
diff --git a/src/test/store/BufferedIndexOutputTest.cpp b/src/test/store/BufferedIndexOutputTest.cpp
index 564a875..fd8490d 100644
--- a/src/test/store/BufferedIndexOutputTest.cpp
+++ b/src/test/store/BufferedIndexOutputTest.cpp
@@ -97,9 +97,9 @@ TEST_F(BufferedIndexOutputTest, testWriteChars) {
namespace TestCopyBytes {
-class SourceIndexInput : public BufferedIndexInput {
+class BIOTSourceIndexInput : public BufferedIndexInput {
public:
- SourceIndexInput(const uint8_t* b, int32_t length) : inputBytes(b), inputLength(length), nextByte(0) {
+ BIOTSourceIndexInput(const uint8_t* b, int32_t length) : inputBytes(b), inputLength(length), nextByte(0) {
}
virtual void readInternal(uint8_t* b, int32_t offset, int32_t length) {
@@ -129,7 +129,7 @@ protected:
TEST_F(BufferedIndexOutputTest, testCopyBytes) {
ByteArray sourceBytes(ByteArray::newInstance(32768));
std::generate(sourceBytes.get(), sourceBytes.get() + 32768, rand);
- BufferedIndexInputPtr indexSource(newLucene<TestCopyBytes::SourceIndexInput>(sourceBytes.get(), 32768));
+ BufferedIndexInputPtr indexSource(newLucene<TestCopyBytes::BIOTSourceIndexInput>(sourceBytes.get(), 32768));
ByteArray outputBytes(ByteArray::newInstance(32768));
TestableBufferedIndexOutput indexOutput(outputBytes.get(), 32768);
diff --git a/src/test/store/IndexOutputTest.cpp b/src/test/store/IndexOutputTest.cpp
index 15ff86b..374da5e 100644
--- a/src/test/store/IndexOutputTest.cpp
+++ b/src/test/store/IndexOutputTest.cpp
@@ -115,9 +115,9 @@ TEST_F(IndexOutputTest, testWriteChars) {
namespace TestCopyBytes {
-class SourceIndexInput : public IndexInput {
+class IOTSourceIndexInput : public IndexInput {
public:
- SourceIndexInput(const uint8_t* b, int32_t length) : inputBytes(b), inputLength(length), nextByte(0) {
+ IOTSourceIndexInput(const uint8_t* b, int32_t length) : inputBytes(b), inputLength(length), nextByte(0) {
}
virtual uint8_t readByte() {
@@ -158,7 +158,7 @@ protected:
TEST_F(IndexOutputTest, testCopyBytes) {
ByteArray sourceBytes(ByteArray::newInstance(32768));
std::generate(sourceBytes.get(), sourceBytes.get() + 32768, rand);
- IndexInputPtr indexSource(newLucene<TestCopyBytes::SourceIndexInput>(sourceBytes.get(), 32768));
+ IndexInputPtr indexSource(newLucene<TestCopyBytes::IOTSourceIndexInput>(sourceBytes.get(), 32768));
ByteArray outputBytes(ByteArray::newInstance(32768));
TestableIndexOutput indexOutput(outputBytes.get(), 32768);
|