From: Harlan Stenn Date: Thu, 24 Sep 2015 05:44:53 +0000 (+0000) Subject: Fix bugs in tests/ntpd/ntp_prio_q.c. Harlan Stenn. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9303e32caad73af09e7b4bc9052b7f724cbb65d4;p=thirdparty%2Fntp.git Fix bugs in tests/ntpd/ntp_prio_q.c. Harlan Stenn. bk: 56038dd5n1w5hJVyXI0bnWN2b_XmBw --- diff --git a/ChangeLog b/ChangeLog index 8b955ec6b..614617f4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -119,6 +119,7 @@ fixed formatting. Tomasz Flendrich * Clean trailing whitespace in tests/ntpd/Makefile.am. Harlan Stenn. * Update the patch for bug 2817. Harlan Stenn. * More updates for bug 2817. Harlan Stenn. +* Fix bugs in tests/ntpd/ntp_prio_q.c. Harlan Stenn. --- (4.2.8p3) 2015/06/29 Released by Harlan Stenn diff --git a/tests/ntpd/ntp_prio_q.c b/tests/ntpd/ntp_prio_q.c index cd07c23e7..c2d4f76f0 100644 --- a/tests/ntpd/ntp_prio_q.c +++ b/tests/ntpd/ntp_prio_q.c @@ -210,7 +210,7 @@ test_AppendQueues(void) { queue* q5 = create_queue(); // append empty queue to empty queue - append_queue(q1, q2); + append_queue(q1, q2); // destroys q2 element *e1_ptr, *e2_ptr, *e3_ptr, *e4_ptr, *e5_ptr, *e6_ptr; e1_ptr = (element*)debug_get_node(sizeof(element)); @@ -226,18 +226,18 @@ test_AppendQueues(void) { // append empty queue to non empty queue - append_queue(q1, q3); + append_queue(q1, q3); // destroys q3 TEST_ASSERT_EQUAL(3, get_no_of_elements(q1)); // append non empty queue to empty queue - append_queue(q4, q1); + append_queue(q4, q1); // destroys q1 TEST_ASSERT_EQUAL(3, get_no_of_elements(q4)); enqueue(q5, e4_ptr); enqueue(q5, e5_ptr); // append non empty queue to non empty queue - append_queue(q4, q5); + append_queue(q4, q5); // destroys q5 TEST_ASSERT_EQUAL(5, get_no_of_elements(q4)); dequeue(q4); @@ -254,8 +254,9 @@ test_AppendQueues(void) { TEST_ASSERT_EQUAL(0, get_no_of_elements(q4)); - destroy_queue(q1); - destroy_queue(q2); - destroy_queue(q3); + // destroy_queue(q1); // destroyed already + // destroy_queue(q2); // destroyed already + // destroy_queue(q3); // destroyed already destroy_queue(q4); + // destroy_queue(q5); // destroyed already }