Revision 061ea1b3 src/um/test/UserPoolTest.cc
src/um/test/UserPoolTest.cc | ||
---|---|---|
158 | 158 |
void authenticate() |
159 | 159 |
{ |
160 | 160 |
UserPool* user_pool = (UserPool*) pool; |
161 |
|
|
162 |
bool rc; |
|
163 |
int oid, gid; |
|
164 |
|
|
161 | 165 |
// There is an initial user, created with the one_auth file: |
162 | 166 |
// one_user_test:password |
163 | 167 |
string session="one_user_test:5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8"; |
164 | 168 |
|
165 |
int oid = user_pool->authenticate( session ); |
|
169 |
rc = user_pool->authenticate( session, oid, gid ); |
|
170 |
CPPUNIT_ASSERT( rc == true ); |
|
171 |
CPPUNIT_ASSERT( oid == 0 ); |
|
166 | 172 |
CPPUNIT_ASSERT( oid == 0 ); |
167 | 173 |
|
168 | 174 |
session = "one_user_test:wrong_password"; |
169 |
oid = user_pool->authenticate( session ); |
|
175 |
oid = user_pool->authenticate( session, oid, gid ); |
|
176 |
CPPUNIT_ASSERT( rc == false ); |
|
170 | 177 |
CPPUNIT_ASSERT( oid == -1 ); |
178 |
CPPUNIT_ASSERT( gid == -1 ); |
|
171 | 179 |
|
172 | 180 |
session = "unknown_user:5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8"; |
173 |
oid = user_pool->authenticate( session ); |
|
181 |
oid = user_pool->authenticate( session, oid, gid ); |
|
182 |
CPPUNIT_ASSERT( rc == false ); |
|
174 | 183 |
CPPUNIT_ASSERT( oid == -1 ); |
184 |
CPPUNIT_ASSERT( gid == -1 ); |
|
175 | 185 |
} |
176 | 186 |
|
177 | 187 |
void get_using_name() |
Also available in: Unified diff