| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -162,7 +162,7 @@ int main() | |||
| 162 | 162 | // 1-element queue pull succeed | |
| 163 | 163 | boost::sync_bounded_queue<int> q(2); | |
| 164 | 164 | q.push(1); | |
| 165 | - int i; | ||
| 165 | + int i = -1; | ||
| 166 | 166 | q.pull(i); | |
| 167 | 167 | BOOST_TEST_EQ(i, 1); | |
| 168 | 168 | BOOST_TEST(q.empty()); | |
@@ -198,7 +198,7 @@ int main() | |||
| 198 | 198 | // 1-element queue try_pull succeed | |
| 199 | 199 | boost::sync_bounded_queue<int> q(2); | |
| 200 | 200 | q.push(1); | |
| 201 | - int i; | ||
| 201 | + int i = -1; | ||
| 202 | 202 | BOOST_TEST(q.try_pull(i)); | |
| 203 | 203 | BOOST_TEST_EQ(i, 1); | |
| 204 | 204 | BOOST_TEST(q.empty()); | |
@@ -210,7 +210,7 @@ int main() | |||
| 210 | 210 | // 1-element queue try_pull succeed | |
| 211 | 211 | boost::sync_bounded_queue<int> q(2); | |
| 212 | 212 | q.push(1); | |
| 213 | - int i; | ||
| 213 | + int i = -1; | ||
| 214 | 214 | BOOST_TEST(q.try_pull(boost::no_block, i)); | |
| 215 | 215 | BOOST_TEST_EQ(i, 1); | |
| 216 | 216 | BOOST_TEST(q.empty()); | |
@@ -280,7 +280,7 @@ int main() | |||
| 280 | 280 | boost::sync_bounded_queue<int> q(2); | |
| 281 | 281 | q.push(1); | |
| 282 | 282 | q.close(); | |
| 283 | - int i; | ||
| 283 | + int i = -1; | ||
| 284 | 284 | q.pull(i); | |
| 285 | 285 | BOOST_TEST_EQ(i, 1); | |
| 286 | 286 | BOOST_TEST(q.empty()); | |
@@ -292,7 +292,7 @@ int main() | |||
| 292 | 292 | { | |
| 293 | 293 | // empty queue try_pull fails | |
| 294 | 294 | boost::sync_bounded_queue<int> q(2); | |
| 295 | - int i; | ||
| 295 | + int i = -1; | ||
| 296 | 296 | BOOST_TEST( boost::queue_op_status::empty == q.try_pull_front(i)); | |
| 297 | 297 | BOOST_TEST(q.empty()); | |
| 298 | 298 | BOOST_TEST(! q.full()); | |
@@ -422,7 +422,7 @@ int main() | |||
| 422 | 422 | // 1-element queue pull succeed | |
| 423 | 423 | boost::sync_bounded_queue<int> q(2); | |
| 424 | 424 | q.push_back(1); | |
| 425 | - int i; | ||
| 425 | + int i = -1; | ||
| 426 | 426 | q.pull_front(i); | |
| 427 | 427 | BOOST_TEST_EQ(i, 1); | |
| 428 | 428 | BOOST_TEST(q.empty()); | |
@@ -458,7 +458,7 @@ int main() | |||
| 458 | 458 | // 1-element queue try_pull succeed | |
| 459 | 459 | boost::sync_bounded_queue<int> q(2); | |
| 460 | 460 | q.push_back(1); | |
| 461 | - int i; | ||
| 461 | + int i = -1; | ||
| 462 | 462 | BOOST_TEST(boost::queue_op_status::success == q.try_pull_front(i)); | |
| 463 | 463 | BOOST_TEST_EQ(i, 1); | |
| 464 | 464 | BOOST_TEST(q.empty()); | |
@@ -470,7 +470,7 @@ int main() | |||
| 470 | 470 | // 1-element queue nonblocking_pull_front succeed | |
| 471 | 471 | boost::sync_bounded_queue<int> q(2); | |
| 472 | 472 | q.push_back(1); | |
| 473 | - int i; | ||
| 473 | + int i = -1; | ||
| 474 | 474 | BOOST_TEST(boost::queue_op_status::success == q.nonblocking_pull_front(i)); | |
| 475 | 475 | BOOST_TEST_EQ(i, 1); | |
| 476 | 476 | BOOST_TEST(q.empty()); | |
@@ -482,7 +482,7 @@ int main() | |||
| 482 | 482 | // 1-element queue wait_pull_front succeed | |
| 483 | 483 | boost::sync_bounded_queue<int> q(2); | |
| 484 | 484 | q.push_back(1); | |
| 485 | - int i; | ||
| 485 | + int i = -1; | ||
| 486 | 486 | BOOST_TEST(boost::queue_op_status::success == q.wait_pull_front(i)); | |
| 487 | 487 | BOOST_TEST_EQ(i, 1); | |
| 488 | 488 | BOOST_TEST(q.empty()); | |
@@ -529,7 +529,7 @@ int main() | |||
| 529 | 529 | // closed empty queue try_pull_front closed | |
| 530 | 530 | boost::sync_bounded_queue<int> q(2); | |
| 531 | 531 | q.close(); | |
| 532 | - int i; | ||
| 532 | + int i = -1; | ||
| 533 | 533 | BOOST_TEST(boost::queue_op_status::closed == q.try_pull_front(i)); | |
| 534 | 534 | BOOST_TEST(q.empty()); | |
| 535 | 535 | BOOST_TEST(! q.full()); | |
@@ -540,7 +540,7 @@ int main() | |||
| 540 | 540 | // closed empty queue nonblocking_pull_front closed | |
| 541 | 541 | boost::sync_bounded_queue<int> q(2); | |
| 542 | 542 | q.close(); | |
| 543 | - int i; | ||
| 543 | + int i = -1; | ||
| 544 | 544 | BOOST_TEST(boost::queue_op_status::closed == q.nonblocking_pull_front(i)); | |
| 545 | 545 | BOOST_TEST(q.empty()); | |
| 546 | 546 | BOOST_TEST(! q.full()); | |
@@ -552,7 +552,7 @@ int main() | |||
| 552 | 552 | boost::sync_bounded_queue<int> q(2); | |
| 553 | 553 | q.push_back(1); | |
| 554 | 554 | q.close(); | |
| 555 | - int i; | ||
| 555 | + int i = -1; | ||
| 556 | 556 | q.pull_front(i); | |
| 557 | 557 | BOOST_TEST_EQ(i, 1); | |
| 558 | 558 | BOOST_TEST(q.empty()); | |
@@ -565,7 +565,7 @@ int main() | |||
| 565 | 565 | boost::sync_bounded_queue<int> q(2); | |
| 566 | 566 | q.push_back(1); | |
| 567 | 567 | q.close(); | |
| 568 | - int i; | ||
| 568 | + int i = -1; | ||
| 569 | 569 | BOOST_TEST(boost::queue_op_status::success == q.wait_pull_front(i)); | |
| 570 | 570 | BOOST_TEST_EQ(i, 1); | |
| 571 | 571 | BOOST_TEST(q.empty()); | |
@@ -579,7 +579,7 @@ int main() | |||
| 579 | 579 | q.close(); | |
| 580 | 580 | BOOST_TEST(q.empty()); | |
| 581 | 581 | BOOST_TEST(q.closed()); | |
| 582 | - int i; | ||
| 582 | + int i = -1; | ||
| 583 | 583 | BOOST_TEST(boost::queue_op_status::closed == q.wait_pull_front(i)); | |
| 584 | 584 | BOOST_TEST(q.empty()); | |
| 585 | 585 | BOOST_TEST(q.closed()); | |
@@ -595,6 +595,6 @@ int main() | |||
| 595 | 595 | BOOST_TEST(q.empty()); | |
| 596 | 596 | BOOST_TEST(q.closed()); | |
| 597 | 597 | } | |
| 598 | + | ||
| 598 | 599 | return boost::report_errors(); | |
| 599 | 600 | } | |
| 600 | - | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,7 +49,7 @@ int main() | |||
| 49 | 49 | { | |
| 50 | 50 | // empty queue try_pull fails | |
| 51 | 51 | boost::sync_deque<int> q; | |
| 52 | - int i; | ||
| 52 | + int i = -1; | ||
| 53 | 53 | BOOST_TEST( boost::queue_op_status::empty == q.try_pull_front(i)); | |
| 54 | 54 | BOOST_TEST(q.empty()); | |
| 55 | 55 | BOOST_TEST(! q.full()); | |
@@ -204,7 +204,7 @@ int main() | |||
| 204 | 204 | // 1-element queue pull_front succeed | |
| 205 | 205 | boost::sync_deque<int> q; | |
| 206 | 206 | q.push_back(1); | |
| 207 | - int i; | ||
| 207 | + int i = -1; | ||
| 208 | 208 | q.pull_front(i); | |
| 209 | 209 | BOOST_TEST_EQ(i, 1); | |
| 210 | 210 | BOOST_TEST(q.empty()); | |
@@ -252,7 +252,7 @@ int main() | |||
| 252 | 252 | // 1-element queue try_pull_front succeed | |
| 253 | 253 | boost::sync_deque<int> q; | |
| 254 | 254 | q.push_back(1); | |
| 255 | - int i; | ||
| 255 | + int i = -1; | ||
| 256 | 256 | BOOST_TEST(boost::queue_op_status::success == q.try_pull_front(i)); | |
| 257 | 257 | BOOST_TEST_EQ(i, 1); | |
| 258 | 258 | BOOST_TEST(q.empty()); | |
@@ -277,7 +277,7 @@ int main() | |||
| 277 | 277 | // 1-element queue nonblocking_pull_front succeed | |
| 278 | 278 | boost::sync_deque<int> q; | |
| 279 | 279 | q.push_back(1); | |
| 280 | - int i; | ||
| 280 | + int i = -1; | ||
| 281 | 281 | BOOST_TEST(boost::queue_op_status::success == q.nonblocking_pull_front(i)); | |
| 282 | 282 | BOOST_TEST_EQ(i, 1); | |
| 283 | 283 | BOOST_TEST(q.empty()); | |
@@ -315,7 +315,7 @@ int main() | |||
| 315 | 315 | // 1-element queue wait_pull_front succeed | |
| 316 | 316 | boost::sync_deque<int> q; | |
| 317 | 317 | q.push_back(1); | |
| 318 | - int i; | ||
| 318 | + int i = -1; | ||
| 319 | 319 | BOOST_TEST(boost::queue_op_status::success == q.wait_pull_front(i)); | |
| 320 | 320 | BOOST_TEST_EQ(i, 1); | |
| 321 | 321 | BOOST_TEST(q.empty()); | |
@@ -365,7 +365,7 @@ int main() | |||
| 365 | 365 | boost::sync_deque<int> q; | |
| 366 | 366 | q.push_back(1); | |
| 367 | 367 | q.close(); | |
| 368 | - int i; | ||
| 368 | + int i = -1; | ||
| 369 | 369 | q.pull_front(i); | |
| 370 | 370 | BOOST_TEST_EQ(i, 1); | |
| 371 | 371 | BOOST_TEST(q.empty()); | |
@@ -378,7 +378,7 @@ int main() | |||
| 378 | 378 | boost::sync_deque<int> q; | |
| 379 | 379 | q.push_back(1); | |
| 380 | 380 | q.close(); | |
| 381 | - int i; | ||
| 381 | + int i = -1; | ||
| 382 | 382 | BOOST_TEST(boost::queue_op_status::success == q.wait_pull_front(i)); | |
| 383 | 383 | BOOST_TEST_EQ(i, 1); | |
| 384 | 384 | BOOST_TEST(q.empty()); | |
@@ -392,12 +392,11 @@ int main() | |||
| 392 | 392 | q.close(); | |
| 393 | 393 | BOOST_TEST(q.empty()); | |
| 394 | 394 | BOOST_TEST(q.closed()); | |
| 395 | - int i; | ||
| 395 | + int i = -1; | ||
| 396 | 396 | BOOST_TEST(boost::queue_op_status::closed == q.wait_pull_front(i)); | |
| 397 | 397 | BOOST_TEST(q.empty()); | |
| 398 | 398 | BOOST_TEST(q.closed()); | |
| 399 | 399 | } | |
| 400 | 400 | ||
| 401 | 401 | return boost::report_errors(); | |
| 402 | 402 | } | |
| 403 | - | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,7 +55,7 @@ void test_pull_for() | |||
| 55 | 55 | { | |
| 56 | 56 | sync_pq pq; | |
| 57 | 57 | steady_clock::time_point start = steady_clock::now(); | |
| 58 | - int val; | ||
| 58 | + int val = -1; | ||
| 59 | 59 | boost::queue_op_status st = pq.pull_for(milliseconds(500), val); | |
| 60 | 60 | ns d = steady_clock::now() - start - milliseconds(500); | |
| 61 | 61 | BOOST_THREAD_TEST_IT(d, ns(max_diff)); | |
@@ -66,7 +66,7 @@ void test_pull_until() | |||
| 66 | 66 | { | |
| 67 | 67 | sync_pq pq; | |
| 68 | 68 | steady_clock::time_point start = steady_clock::now(); | |
| 69 | - int val; | ||
| 69 | + int val = -1; | ||
| 70 | 70 | boost::queue_op_status st = pq.pull_until(start + milliseconds(500), val); | |
| 71 | 71 | ns d = steady_clock::now() - start - milliseconds(500); | |
| 72 | 72 | BOOST_THREAD_TEST_IT(d, ns(max_diff)); | |
@@ -77,7 +77,7 @@ void test_nonblocking_pull() | |||
| 77 | 77 | { | |
| 78 | 78 | sync_pq pq; | |
| 79 | 79 | steady_clock::time_point start = steady_clock::now(); | |
| 80 | - int val; | ||
| 80 | + int val = -1; | ||
| 81 | 81 | boost::queue_op_status st = pq.nonblocking_pull(val); | |
| 82 | 82 | ns d = steady_clock::now() - start; | |
| 83 | 83 | BOOST_THREAD_TEST_IT(d, ns(max_diff)); | |
@@ -89,7 +89,7 @@ void test_pull_for_when_not_empty() | |||
| 89 | 89 | sync_pq pq; | |
| 90 | 90 | pq.push(1); | |
| 91 | 91 | steady_clock::time_point start = steady_clock::now(); | |
| 92 | - int val; | ||
| 92 | + int val = -1; | ||
| 93 | 93 | boost::queue_op_status st = pq.pull_for(milliseconds(500), val); | |
| 94 | 94 | ns d = steady_clock::now() - start; | |
| 95 | 95 | BOOST_THREAD_TEST_IT(d, ns(max_diff)); | |
@@ -102,7 +102,7 @@ void test_pull_until_when_not_empty() | |||
| 102 | 102 | sync_pq pq; | |
| 103 | 103 | pq.push(1); | |
| 104 | 104 | steady_clock::time_point start = steady_clock::now(); | |
| 105 | - int val; | ||
| 105 | + int val = -1; | ||
| 106 | 106 | boost::queue_op_status st = pq.pull_until(start + milliseconds(500), val); | |
| 107 | 107 | ns d = steady_clock::now() - start; | |
| 108 | 108 | BOOST_THREAD_TEST_IT(d, ns(max_diff)); | |
@@ -274,7 +274,7 @@ int main() | |||
| 274 | 274 | // 1-element queue try_pull succeed | |
| 275 | 275 | boost::concurrent::sync_priority_queue<int> q; | |
| 276 | 276 | q.push(1); | |
| 277 | - int i; | ||
| 277 | + int i = -1; | ||
| 278 | 278 | BOOST_TEST(boost::queue_op_status::success == q.try_pull(i)); | |
| 279 | 279 | BOOST_TEST_EQ(i, 1); | |
| 280 | 280 | BOOST_TEST(q.empty()); | |
@@ -301,7 +301,7 @@ int main() | |||
| 301 | 301 | // 1-element queue nonblocking_pull succeed | |
| 302 | 302 | boost::concurrent::sync_priority_queue<int> q; | |
| 303 | 303 | q.push(1); | |
| 304 | - int i; | ||
| 304 | + int i = -1; | ||
| 305 | 305 | BOOST_TEST(boost::queue_op_status::success == q.nonblocking_pull(i)); | |
| 306 | 306 | BOOST_TEST_EQ(i, 1); | |
| 307 | 307 | BOOST_TEST(q.empty()); | |
@@ -341,7 +341,7 @@ int main() | |||
| 341 | 341 | // 1-element queue wait_pull succeed | |
| 342 | 342 | boost::concurrent::sync_priority_queue<int> q; | |
| 343 | 343 | q.push(1); | |
| 344 | - int i; | ||
| 344 | + int i = -1; | ||
| 345 | 345 | BOOST_TEST(boost::queue_op_status::success == q.wait_pull(i)); | |
| 346 | 346 | BOOST_TEST_EQ(i, 1); | |
| 347 | 347 | BOOST_TEST(q.empty()); | |
@@ -406,7 +406,7 @@ int main() | |||
| 406 | 406 | boost::concurrent::sync_priority_queue<int> q; | |
| 407 | 407 | q.push(1); | |
| 408 | 408 | q.close(); | |
| 409 | - int i; | ||
| 409 | + int i = -1; | ||
| 410 | 410 | BOOST_TEST(boost::queue_op_status::success == q.wait_pull(i)); | |
| 411 | 411 | BOOST_TEST_EQ(i, 1); | |
| 412 | 412 | BOOST_TEST(q.empty()); | |
@@ -420,7 +420,7 @@ int main() | |||
| 420 | 420 | q.close(); | |
| 421 | 421 | BOOST_TEST(q.empty()); | |
| 422 | 422 | BOOST_TEST(q.closed()); | |
| 423 | - int i; | ||
| 423 | + int i = -1; | ||
| 424 | 424 | BOOST_TEST(boost::queue_op_status::closed == q.wait_pull(i)); | |
| 425 | 425 | BOOST_TEST(q.empty()); | |
| 426 | 426 | BOOST_TEST(q.closed()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,7 +43,7 @@ void call_pull(sync_tq* q, const steady_clock::time_point start) | |||
| 43 | 43 | // pull elements off of the queue (earliest element first) | |
| 44 | 44 | for (int i = cnt - 1; i >= 0; --i) | |
| 45 | 45 | { | |
| 46 | - int j; | ||
| 46 | + int j = -1; | ||
| 47 | 47 | q->pull(j); | |
| 48 | 48 | BOOST_TEST_EQ(i, j); | |
| 49 | 49 | const steady_clock::time_point expected = start + milliseconds(i * 500) + seconds(cnt - i); | |
@@ -57,7 +57,7 @@ void call_pull_until(sync_tq* q, const steady_clock::time_point start) | |||
| 57 | 57 | // pull elements off of the queue (earliest element first) | |
| 58 | 58 | for (int i = cnt - 1; i >= 0; --i) | |
| 59 | 59 | { | |
| 60 | - int j; | ||
| 60 | + int j = -1; | ||
| 61 | 61 | q->pull_until(steady_clock::now() + hours(1), j); | |
| 62 | 62 | BOOST_TEST_EQ(i, j); | |
| 63 | 63 | const steady_clock::time_point expected = start + milliseconds(i * 500) + seconds(cnt - i); | |
@@ -71,7 +71,7 @@ void call_pull_for(sync_tq* q, const steady_clock::time_point start) | |||
| 71 | 71 | // pull elements off of the queue (earliest element first) | |
| 72 | 72 | for (int i = cnt - 1; i >= 0; --i) | |
| 73 | 73 | { | |
| 74 | - int j; | ||
| 74 | + int j = -1; | ||
| 75 | 75 | q->pull_for(hours(1), j); | |
| 76 | 76 | BOOST_TEST_EQ(i, j); | |
| 77 | 77 | const steady_clock::time_point expected = start + milliseconds(i * 500) + seconds(cnt - i); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,7 +50,7 @@ void test_all() | |||
| 50 | 50 | BOOST_TEST_EQ(val, i); | |
| 51 | 51 | } | |
| 52 | 52 | ||
| 53 | - int val; | ||
| 53 | + int val = -1; | ||
| 54 | 54 | boost::queue_op_status st = pq.nonblocking_pull(val); | |
| 55 | 55 | BOOST_TEST(boost::queue_op_status::empty == st); | |
| 56 | 56 | ||
@@ -87,7 +87,7 @@ void test_all_with_try() | |||
| 87 | 87 | BOOST_TEST_EQ(val, i); | |
| 88 | 88 | } | |
| 89 | 89 | ||
| 90 | - int val; | ||
| 90 | + int val = -1; | ||
| 91 | 91 | boost::queue_op_status st = pq.nonblocking_pull(val); | |
| 92 | 92 | BOOST_TEST(st == boost::queue_op_status::empty ); | |
| 93 | 93 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments