| 131 | } |
| 132 | |
| 133 | void 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 | |
| 151 | void TestBoolComparison() |
| 152 | { |
no test coverage detected