<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-07-27)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-07-27 Petr Benes <benesp16@fel.cvut.cz>

        PR 1856/cpukit
        * posix/src/pthread.c, posix/src/pthreadjoin.c,
        score/src/rbtreeextract.c: Do not derefence NULL.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2889&r2=text&tr2=1.2890&diff_format=h">M</a></td><td width='1%'>1.2890</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/pthread.c.diff?r1=text&tr1=1.82&r2=text&tr2=1.83&diff_format=h">M</a></td><td width='1%'>1.83</td><td width='100%'>cpukit/posix/src/pthread.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/pthreadjoin.c.diff?r1=text&tr1=1.9&r2=text&tr2=1.10&diff_format=h">M</a></td><td width='1%'>1.10</td><td width='100%'>cpukit/posix/src/pthreadjoin.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/rbtreeextract.c.diff?r1=text&tr1=1.2&r2=text&tr2=1.3&diff_format=h">M</a></td><td width='1%'>1.3</td><td width='100%'>cpukit/score/src/rbtreeextract.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2889 rtems/cpukit/ChangeLog:1.2890
--- rtems/cpukit/ChangeLog:1.2889       Sun Jul 24 18:55:05 2011
+++ rtems/cpukit/ChangeLog      Wed Jul 27 08:27:47 2011
</font><font color='#997700'>@@ -1,3 +1,9 @@
</font><font color='#000088'>+2011-07-27    Petr Benes <benesp16@fel.cvut.cz>
+
+       PR 1856/cpukit
+       * posix/src/pthread.c, posix/src/pthreadjoin.c,
+       score/src/rbtreeextract.c: Do not derefence NULL.
+
</font> 2011-07-24        Joel Sherrill <joel.sherrill@oarcorp.com>
 
        * ftpd/ftpd.c, libcsupport/src/geteuid.c, libcsupport/src/getgroups.c,

<font color='#006600'>diff -u rtems/cpukit/posix/src/pthread.c:1.82 rtems/cpukit/posix/src/pthread.c:1.83
--- rtems/cpukit/posix/src/pthread.c:1.82       Tue Feb 15 18:24:49 2011
+++ rtems/cpukit/posix/src/pthread.c    Wed Jul 27 08:27:48 2011
</font><font color='#997700'>@@ -217,7 +217,7 @@
</font>   _Thread_queue_Initialize(
     &api->Join_List,
     THREAD_QUEUE_DISCIPLINE_FIFO,
<font color='#880000'>-    STATES_WAITING_FOR_JOIN_AT_EXIT,
</font><font color='#000088'>+    STATES_WAITING_FOR_JOIN_AT_EXIT | STATES_INTERRUPTIBLE_BY_SIGNAL,
</font>     0
   );
 

<font color='#006600'>diff -u rtems/cpukit/posix/src/pthreadjoin.c:1.9 rtems/cpukit/posix/src/pthreadjoin.c:1.10
--- rtems/cpukit/posix/src/pthreadjoin.c:1.9    Tue Mar  8 16:14:14 2011
+++ rtems/cpukit/posix/src/pthreadjoin.c        Wed Jul 27 08:27:48 2011
</font><font color='#997700'>@@ -32,6 +32,7 @@
</font>   Objects_Locations        location;
   void                    *return_pointer;
 
<font color='#000088'>+on_EINTR:
</font>   the_thread = _Thread_Get( thread, &location );
   switch ( location ) {
 
<font color='#997700'>@@ -60,6 +61,11 @@
</font> 
       _Thread_Enable_dispatch();
 
<font color='#000088'>+/*
+      if ( _Thread_Executing->Wait.return_code == EINTR )
+        goto on_EINTR;
+*/
+
</font>       if ( value_ptr )
         *value_ptr = return_pointer;
       return 0;

<font color='#006600'>diff -u rtems/cpukit/score/src/rbtreeextract.c:1.2 rtems/cpukit/score/src/rbtreeextract.c:1.3
--- rtems/cpukit/score/src/rbtreeextract.c:1.2  Mon May 23 21:44:57 2011
+++ rtems/cpukit/score/src/rbtreeextract.c      Wed Jul 27 08:27:48 2011
</font><font color='#997700'>@@ -164,9 +164,11 @@
</font> 
     /* set target's new children to the original node's children */
     target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT];
<font color='#880000'>-    the_node->child[RBT_RIGHT]->parent = target;
</font><font color='#000088'>+    if (the_node->child[RBT_RIGHT])
+      the_node->child[RBT_RIGHT]->parent = target;
</font>     target->child[RBT_LEFT] = the_node->child[RBT_LEFT];
<font color='#880000'>-    the_node->child[RBT_LEFT]->parent = target;
</font><font color='#000088'>+    if (the_node->child[RBT_LEFT])
+      the_node->child[RBT_LEFT]->parent = target;
</font> 
     /* finally, update the parent node and recolor. target has completely
      * replaced the_node, and target's child has moved up the tree if needed.
</pre>
<p> </p>
<a name='cs2'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-07-27 Petr Benes <benesp16@fel.cvut.cz>

        PR 1854/cpukit
        * sprbtree01/init.c, sprbtree01/sprbtree01.scn: Add test of the
        rtems_rbtree_extract() to improve test coverage.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/ChangeLog.diff?r1=text&tr1=1.465&r2=text&tr2=1.466&diff_format=h">M</a></td><td width='1%'>1.466</td><td width='100%'>testsuites/sptests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/sprbtree01/init.c.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>testsuites/sptests/sprbtree01/init.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/sprbtree01/sprbtree01.scn.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>testsuites/sptests/sprbtree01/sprbtree01.scn</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/sptests/ChangeLog:1.465 rtems/testsuites/sptests/ChangeLog:1.466
--- rtems/testsuites/sptests/ChangeLog:1.465    Tue Jul 26 15:53:09 2011
+++ rtems/testsuites/sptests/ChangeLog  Wed Jul 27 08:35:11 2011
</font><font color='#997700'>@@ -1,3 +1,9 @@
</font><font color='#000088'>+2011-07-27    Petr Benes <benesp16@fel.cvut.cz>
+
+       PR 1854/cpukit
+       * sprbtree01/init.c, sprbtree01/sprbtree01.scn: Add test of the
+       rtems_rbtree_extract() to improve test coverage.
+
</font> 2011-07-26        Joel Sherrill <joel.sherrilL@OARcorp.com>
 
        * Makefile.am, configure.ac: New test to get coverage of core mutex

<font color='#006600'>diff -u rtems/testsuites/sptests/sprbtree01/init.c:1.1 rtems/testsuites/sptests/sprbtree01/init.c:1.2
--- rtems/testsuites/sptests/sprbtree01/init.c:1.1      Mon Apr  4 13:45:38 2011
+++ rtems/testsuites/sptests/sprbtree01/init.c  Wed Jul 27 08:35:11 2011
</font><font color='#997700'>@@ -12,10 +12,10 @@
</font> #include <rtems/rbtree.h>
 
 int numbers[20] = {
<font color='#880000'>-52, 99, 5, 85, 43, 44, 10, 60, 50, 19, 8, 68, 48, 57, 17, 67, 90, 12, 77, 71};
</font><font color='#000088'>+52, 99, 0, 85, 43, 44, 10, 60, 50, 19, 8, 68, 48, 57, 17, 67, 90, 12, 77, 71};
</font> 
 int numbers_sorted[20] = {
<font color='#880000'>-  5, 8, 10, 12, 17, 19, 43, 44, 48, 50, 52, 57, 60, 67, 68, 71, 77, 85, 90, 99};
</font><font color='#000088'>+  0, 8, 10, 12, 17, 19, 43, 44, 48, 50, 52, 57, 60, 67, 68, 71, 77, 85, 90, 99};
</font> 
 typedef struct {
   int              id;
<font color='#997700'>@@ -272,6 +272,58 @@
</font>     rtems_test_exit(0);
   }
 
<font color='#000088'>+  /* testing rbtree_extract by adding 100 nodes then removing the 20 with
+   * keys specified by the numbers array, then removing the rest */
+  puts( "INIT - Verify rtems_rbtree_extract with 100 nodes value [0,99]" );
+  for (i = 0; i < 100; i++) {
+    node_array[i].id = i;
+    node_array[i].Node.value = i;
+    rtems_rbtree_insert( &rbtree1, &node_array[i].Node );
+
+    if (!rb_assert(rbtree1.root) )
+      puts( "INIT - FAILED TREE CHECK" );
+  }
+
+  puts( "INIT - Extracting 20 random nodes" );
+
+  for (i = 0; i < 20; i++) {
+    id = numbers[i];
+    rtems_rbtree_extract( &rbtree1, &node_array[id].Node );
+    if (!rb_assert(rbtree1.root) )
+      puts( "INIT - FAILED TREE CHECK" );
+  }
+
+  puts( "INIT - Removing 80 nodes" );
+
+  for ( p = rtems_rbtree_get_min(&rbtree1), id = 0, i = 0 ; p ;
+      p = rtems_rbtree_get_min(&rbtree1) , id++ ) {
+    test_node *t = rtems_rbtree_container_of(p, test_node, Node);
+
+    while ( id == numbers_sorted[i] ) {
+      /* skip if expected minimum (id) is in the set of extracted numbers */
+      id++;
+      i++;
+    }
+
+    if ( id > 99 ) {
+      puts( "INIT - TOO MANY NODES ON RBTREE" );
+      rtems_test_exit(0);
+    }
+
+    if ( t->id != id ) {
+      puts( "INIT - ERROR ON RBTREE ID MISMATCH" );
+      rtems_test_exit(0);
+    }
+
+    if (!rb_assert(rbtree1.root) )
+      puts( "INIT - FAILED TREE CHECK" );
+  }
+
+  if(!rtems_rbtree_is_empty(&rbtree1)) {
+    puts( "INIT - TREE NOT EMPTY" );
+    rtems_test_exit(0);
+  }
+
</font>   puts( "INIT - Verify rtems_rbtree_get_max with 100 nodes value [99,0]" );
   for (i = 0; i < 100; i++) {
     node_array[i].id = 99-i;

<font color='#006600'>diff -u rtems/testsuites/sptests/sprbtree01/sprbtree01.scn:1.1 rtems/testsuites/sptests/sprbtree01/sprbtree01.scn:1.2
--- rtems/testsuites/sptests/sprbtree01/sprbtree01.scn:1.1      Mon Apr  4 13:45:38 2011
+++ rtems/testsuites/sptests/sprbtree01/sprbtree01.scn  Wed Jul 27 08:35:11 2011
</font><font color='#997700'>@@ -10,6 +10,9 @@
</font> INIT - Removing 100 nodes
 INIT - Verify rtems_rbtree_insert with 100 nodes value [99,0]
 INIT - Removing 100 nodes
<font color='#000088'>+INIT - Verify rtems_rbtree_extract with 100 nodes value [0,99]
+INIT - Extracting 20 random nodes
+INIT - Removing 80 nodes
</font> INIT - Verify rtems_rbtree_get_max with 100 nodes value [99,0]
 INIT - Removing 100 nodes
 INIT - Verify rtems_rbtree_get_max with 100 nodes value [0,99]
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>