Changeset 1060:13fc3fc9c789 in freeDiameter for tests/testfifo.c
- Timestamp:
- Apr 29, 2013, 6:15:34 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/testfifo.c
r972 r1060 217 217 { 218 218 struct fifo * queue = NULL; 219 int count ;219 int count, max; 220 220 struct msg * msg = NULL; 221 221 … … 224 224 225 225 /* Check the count is 0 */ 226 CHECK( 0, fd_fifo_length(queue, &count ) );226 CHECK( 0, fd_fifo_length(queue, &count, &max) ); 227 227 CHECK( 0, count); 228 CHECK( 0, max); 228 229 229 230 /* Now enqueue */ … … 236 237 237 238 /* Check the count is 3 */ 238 CHECK( 0, fd_fifo_length(queue, &count ) );239 CHECK( 0, fd_fifo_length(queue, &count, &max) ); 239 240 CHECK( 3, count); 241 CHECK( 0, max); 240 242 241 243 /* Retrieve the first message using fd_fifo_get */ 242 244 CHECK( 0, fd_fifo_get(queue, &msg) ); 243 245 CHECK( msg1, msg); 244 CHECK( 0, fd_fifo_length(queue, &count ) );246 CHECK( 0, fd_fifo_length(queue, &count, NULL) ); 245 247 CHECK( 2, count); 246 248 … … 250 252 CHECK( 0, fd_fifo_timedget(queue, &msg, &ts) ); 251 253 CHECK( msg2, msg); 252 CHECK( 0, fd_fifo_length(queue, &count ) );254 CHECK( 0, fd_fifo_length(queue, &count, NULL) ); 253 255 CHECK( 1, count); 254 256 … … 256 258 CHECK( 0, fd_fifo_tryget(queue, &msg) ); 257 259 CHECK( msg3, msg); 258 CHECK( 0, fd_fifo_length(queue, &count ) );260 CHECK( 0, fd_fifo_length(queue, &count, NULL) ); 259 261 CHECK( 0, count); 260 262 261 263 /* Check that another meq_tryget does not block */ 262 264 CHECK( EWOULDBLOCK, fd_fifo_tryget(queue, &msg) ); 263 CHECK( 0, fd_fifo_length(queue, &count ) );265 CHECK( 0, fd_fifo_length(queue, &count, NULL) ); 264 266 CHECK( 0, count); 265 267 … … 272 274 } 273 275 CHECK( ETIMEDOUT, fd_fifo_timedget(queue, &msg, &ts) ); 274 CHECK( 0, fd_fifo_length(queue, &count ) );276 CHECK( 0, fd_fifo_length(queue, &count, NULL) ); 275 277 CHECK( 0, count); 276 278 … … 361 363 362 364 /* Check the count of the queue is back to 0 */ 363 CHECK( 0, fd_fifo_length(queue, &count ) );365 CHECK( 0, fd_fifo_length(queue, &count, NULL) ); 364 366 CHECK( 0, count); 365 367
Note: See TracChangeset
for help on using the changeset viewer.