summaryrefslogtreecommitdiffstats
path: root/juniper
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-03-04 00:19:23 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2017-03-08 21:38:39 +0000
commitdc28bbbd37e04b254b9a3f5a3f47709fbf22371e (patch)
treece15bb4025cb99cfa4e4ce0e6831859036305b4a /juniper
parent032de590a77215ac3625e380dd94fbe5fd8aa19f (diff)
Deinline destructors/constructors
Diffstat (limited to 'juniper')
-rw-r--r--juniper/src/test/auxTest.cpp47
1 files changed, 26 insertions, 21 deletions
diff --git a/juniper/src/test/auxTest.cpp b/juniper/src/test/auxTest.cpp
index 99ccd24af35..4b1274cb2a6 100644
--- a/juniper/src/test/auxTest.cpp
+++ b/juniper/src/test/auxTest.cpp
@@ -696,6 +696,32 @@ AuxTest::assertChar(ucs4_t act, char exp)
return _test((char) act == exp);
}
+typedef std::unique_ptr<QueryNode> QueryNodeUP;
+struct QB {
+ QueryNodeUP q;
+ QB(size_t numTerms) : q(new QueryNode(numTerms, 0, 0)) {}
+ QB(QB & rhs) : q(std::move(rhs.q)) { }
+ QB & add(const char * t, bool st = true) {
+ QueryTerm * qt = new QueryTerm(t, strlen(t), 0);
+ if (st) qt->_options |= X_SPECIALTOKEN;
+ q->AddChild(qt);
+ return *this;
+ }
+};
+struct Ctx {
+ std::string text;
+ QB qb;
+ SpecialTokenRegistry str;
+ Fast_NormalizeWordFolder wf;
+ TokenProcessor tp;
+ JuniperTokenizer jt;
+ Ctx(const std::string & text_, QB & qb_);
+ ~Ctx();
+};
+
+Ctx::Ctx(const std::string & text_, QB & qb_) : text(text_), qb(qb_), str(qb.q.get()), wf(), tp(text), jt(&wf, text.c_str(), text.size(), &tp, &str) { jt.scan(); }
+Ctx::~Ctx() { }
+
void
AuxTest::TestSpecialTokenRegistry()
{
@@ -775,27 +801,6 @@ AuxTest::TestSpecialTokenRegistry()
}
}
{ // test tokenizer with special token registry
- typedef std::unique_ptr<QueryNode> QueryNodeUP;
- struct QB {
- QueryNodeUP q;
- QB(size_t numTerms) : q(new QueryNode(numTerms, 0, 0)) {}
- QB(QB & rhs) : q(std::move(rhs.q)) { }
- QB & add(const char * t, bool st = true) {
- QueryTerm * qt = new QueryTerm(t, strlen(t), 0);
- if (st) qt->_options |= X_SPECIALTOKEN;
- q->AddChild(qt);
- return *this;
- }
- };
- struct Ctx {
- std::string text;
- QB qb;
- SpecialTokenRegistry str;
- Fast_NormalizeWordFolder wf;
- TokenProcessor tp;
- JuniperTokenizer jt;
- Ctx(const std::string & text_, QB & qb_) : text(text_), qb(qb_), str(qb.q.get()), wf(), tp(text), jt(&wf, text.c_str(), text.size(), &tp, &str) { jt.scan(); }
- };
{ // only special token registered
Ctx c("foo", QB(2).add("c++").add("foo", false));