-
Notifications
You must be signed in to change notification settings - Fork 17
/
searchable_vector_test.cc
47 lines (37 loc) · 1.05 KB
/
searchable_vector_test.cc
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
/*
* searchable_vector_test.cc
*
* Created on: Feb 28, 2012
* Author: Caoimhe Clausen
*/
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/text/TestRunner.h>
#include "ldap++.h"
using namespace std;
namespace testing {
class SearchableVectorTest : public CppUnit::TestCase {
CPPUNIT_TEST_SUITE(SearchableVectorTest);
CPPUNIT_TEST(testSearchableVector);
CPPUNIT_TEST_SUITE_END();
public:
void testSearchableVector();
};
void
SearchableVectorTest::testSearchableVector()
{
ldap_client::SearchableVector<string> v;
v.push_back("Hello");
CPPUNIT_ASSERT(v.Contains("Hello"));
CPPUNIT_ASSERT_ASSERTION_FAIL(CPPUNIT_ASSERT(v.Contains("Otto")));
}
CPPUNIT_TEST_SUITE_REGISTRATION(SearchableVectorTest);
};
int main( int argc, char **argv)
{
CppUnit::TextUi::TestRunner runner;
CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry();
runner.addTest( registry.makeTest() );
bool wasSuccessful = runner.run( "", false );
return !wasSuccessful;
}