MCPcopy Create free account
hub / github.com/MITK/MITK / TestParsing

Function TestParsing

Modules/CppMicroServices/test/usLDAPFilterTest.cpp:22–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20using namespace us;
21
22int TestParsing()
23{
24 // WELL FORMED Expr
25 try
26 {
27 US_TEST_OUTPUT(<< "Parsing (cn=Babs Jensen)")
28 LDAPFilter ldap( "(cn=Babs Jensen)" );
29 US_TEST_OUTPUT(<< "Parsing (!(cn=Tim Howes))")
30 ldap = LDAPFilter( "(!(cn=Tim Howes))" );
31 US_TEST_OUTPUT(<< "Parsing " << std::string("(&(") + ServiceConstants::OBJECTCLASS() + "=Person)(|(sn=Jensen)(cn=Babs J*)))")
32 ldap = LDAPFilter( std::string("(&(") + ServiceConstants::OBJECTCLASS() + "=Person)(|(sn=Jensen)(cn=Babs J*)))" );
33 US_TEST_OUTPUT(<< "Parsing (o=univ*of*mich*)")
34 ldap = LDAPFilter( "(o=univ*of*mich*)" );
35 }
36 catch (const std::invalid_argument& e)
37 {
38 US_TEST_OUTPUT(<< e.what());
39 return EXIT_FAILURE;
40 }
41
42
43 // MALFORMED Expr
44 try
45 {
46 US_TEST_OUTPUT( << "Parsing malformed expr: cn=Babs Jensen)")
47 LDAPFilter ldap( "cn=Babs Jensen)" );
48 return EXIT_FAILURE;
49 }
50 catch (const std::invalid_argument&)
51 {
52 }
53
54 return EXIT_SUCCESS;
55}
56
57
58int TestEvaluate()

Callers 1

usLDAPFilterTestFunction · 0.85

Calls 1

whatMethod · 0.80

Tested by

no test coverage detected