hce-node application
1.4.3
HCE Hierarchical Cluster Engine node application
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
BoostTokenizerTest.cpp
Go to the documentation of this file.
1
#include "
BoostTokenizerTest.hpp
"
2
3
4
namespace
refine_test {
5
6
7
std::string
BoostTokenizerTest::_args
=
"123 one"
;
8
9
10
void
BoostTokenizerTest::setUp
() {
14
_lcData.
_processInfo
.
_pluginType
=
HCE::component::BOOST_TOKENIZER
;
15
_lcData.
_content
=
"123 one"
;
16
}
17
18
19
void
BoostTokenizerTest::tearDown
() {
20
}
21
22
23
void
BoostTokenizerTest::testTokensCount
() {
24
_boostPlugin.
process
(_lcData);
25
CPPUNIT_ASSERT(_lcData.
_mapTokens
.size()==2);
26
}
27
28
29
void
BoostTokenizerTest::testTokensValues
() {
30
_boostPlugin.
process
(_lcData);
31
CPPUNIT_ASSERT(_lcData.
_mapTokens
[0]==
"123"
);
32
CPPUNIT_ASSERT(_lcData.
_mapTokens
[4]==
"one"
);
33
}
34
35
36
void
BoostTokenizerTest::testTokensOffsets
() {
37
_boostPlugin.
process
(_lcData);
38
CPPUNIT_ASSERT((_lcData.
_mapOffsets
.find(0))!=_lcData.
_mapOffsets
.end());
39
CPPUNIT_ASSERT((_lcData.
_mapOffsets
.find(4))!=_lcData.
_mapOffsets
.end());
40
}
41
42
43
void
BoostTokenizerTest::testTokensLenghts
() {
44
_boostPlugin.
process
(_lcData);
45
CPPUNIT_ASSERT(_lcData.
_mapOffsets
[0]==3);
46
CPPUNIT_ASSERT(_lcData.
_mapOffsets
[4]==3);
47
}
48
49
50
void
BoostTokenizerTest::testCustomDelimiters
() {
51
std::vector<std::string> delimiters = {
"3"
};
52
_lcData.
_delimiters
= delimiters;
53
_boostPlugin.
process
(_lcData);
54
CPPUNIT_ASSERT(_lcData.
_mapOffsets
[0]==2);
55
CPPUNIT_ASSERT(_lcData.
_mapOffsets
[3]==4);
56
}
57
58
59
}
sources
utils
refine
tests
cppunit
BoostTokenizerTest.cpp
Generated on Tue Jun 30 2015 19:42:16 for hce-node application by
1.8.1.2