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

Function TestLDAPExpressions

Modules/CppMicroServices/test/usLDAPFilterTest.cpp:133–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133void TestLDAPExpressions()
134{
135 LDAPFilter filter(
136 LDAPProp("bla") == "jo" && !(LDAPProp("ha") == 1) &&
137 (LDAPProp("presence") || !LDAPProp("absence")) &&
138 LDAPProp("le") <= 4.1 && LDAPProp("ge") >= -3 &&
139 LDAPProp("approx").Approx("Approx")
140 );
141 const std::string filterStr = "(&(&(&(&(&(bla=jo)(!(ha=1)))(|(presence=*)(!(absence=*))))(le<=4.1))(ge>=-3))(approx~=Approx))";
142 US_TEST_CONDITION(filter.ToString() == filterStr, "test generated filter string")
143
144 std::string emptyValue;
145 std::string someValue = "some";
146 std::string filter1 = LDAPProp("key2") == someValue && LDAPProp("key3");
147 std::string filter2 = LDAPProp("key2") == someValue && (LDAPProp("key1") == emptyValue || LDAPProp("key3"));
148 US_TEST_CONDITION(filter1 == filter2, "test null expressions")
149}
150
151void TestBoolComparison()
152{

Callers 1

usLDAPFilterTestFunction · 0.85

Calls 2

ApproxMethod · 0.80
ToStringMethod · 0.45

Tested by

no test coverage detected