<!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 (2010-07-16)</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>2010-07-17 Bharath Suri <bharath.s.jois@gmail.com>

        PR 1622/testing
        * psxchroot01/test.c, psxchroot01/psxchroot01.scn: Added two test
        cases to completely cover chroot().
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/ChangeLog.diff?r1=text&tr1=1.295&r2=text&tr2=1.296&diff_format=h">M</a></td><td width='1%'>1.296</td><td width='100%'>testsuites/psxtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxchroot01/psxchroot01.scn.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%'>testsuites/psxtests/psxchroot01/psxchroot01.scn</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxchroot01/test.c.diff?r1=text&tr1=1.8&r2=text&tr2=1.9&diff_format=h">M</a></td><td width='1%'>1.9</td><td width='100%'>testsuites/psxtests/psxchroot01/test.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtests/ChangeLog:1.295 rtems/testsuites/psxtests/ChangeLog:1.296
--- rtems/testsuites/psxtests/ChangeLog:1.295   Fri Jul 16 04:23:42 2010
+++ rtems/testsuites/psxtests/ChangeLog Fri Jul 16 14:19:09 2010
</font><font color='#997700'>@@ -1,3 +1,9 @@
</font><font color='#000088'>+2010-07-17    Bharath Suri <bharath.s.jois@gmail.com>
+
+       PR 1622/testing
+       * psxchroot01/test.c, psxchroot01/psxchroot01.scn: Added two test
+       cases to completely cover chroot().
+
</font> 2010-07-16        Sebastian Huber <Sebastian.Huber@embedded-brains.de>
 
        * psxfile01/test.c: Avoid NULL pointer access.

<font color='#006600'>diff -u rtems/testsuites/psxtests/psxchroot01/psxchroot01.scn:1.2 rtems/testsuites/psxtests/psxchroot01/psxchroot01.scn:1.3
--- rtems/testsuites/psxtests/psxchroot01/psxchroot01.scn:1.2   Thu Aug  9 17:02:20 2001
+++ rtems/testsuites/psxtests/psxchroot01/psxchroot01.scn       Fri Jul 16 14:19:09 2010
</font><font color='#997700'>@@ -1,6 +1,8 @@
</font> 
<font color='#880000'>-
</font> *** CHROOT01 TEST ***
<font color='#000088'>+allocate most of memory - attempt to fail chroot - expect ENOTSUP
+freeing the allocated memory
+chroot with bad path - expect EFAULT
</font> SUCCESS on /one/one.test
 SUCCESS on /two/two.test
 Reset the private environment

<font color='#006600'>diff -u rtems/testsuites/psxtests/psxchroot01/test.c:1.8 rtems/testsuites/psxtests/psxchroot01/test.c:1.9
--- rtems/testsuites/psxtests/psxchroot01/test.c:1.8    Tue Dec  8 11:52:53 2009
+++ rtems/testsuites/psxtests/psxchroot01/test.c        Fri Jul 16 14:19:09 2010
</font><font color='#997700'>@@ -15,7 +15,7 @@
</font>  *  implementation of this appears to seek to the ((off/DIRENT_SIZE) + 1)
  *  record where DIRENT_SIZE seems to be 12 bytes.
  *
<font color='#880000'>- *  COPYRIGHT (c) 1989-2009.
</font><font color='#000088'>+ *  COPYRIGHT (c) 1989-2010.
</font>  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
<font color='#997700'>@@ -34,6 +34,7 @@
</font> #include <rtems/libio.h>
 #include <rtems/userenv.h>
 #include <pmacros.h>
<font color='#000088'>+#include <rtems/score/heap.h>
</font> 
 void touch( char *file )
 {
<font color='#997700'>@@ -63,6 +64,8 @@
</font> }
 
 #if defined(__rtems__)
<font color='#000088'>+extern Heap_Control  *RTEMS_Malloc_Heap;
+
</font> int test_main(void)
 #else
 int main(
<font color='#997700'>@@ -72,13 +75,16 @@
</font> #endif
 {
   int status;
<font color='#880000'>-
</font><font color='#000088'>+  void *alloc_ptr = (void *)0;
+  Heap_Information_block Info;
</font> /*
  *  This test is the C equivalent of this sequence.
 #mkdir /one
 #mkdir /one/one
 #touch /one/one.test
 #touch /one/two/two.test
<font color='#000088'>+# an error case to ENOTSUP from chroot
+# chroot
</font> #chroot /one
 #if !fileexists(/one/one.test) echo "SUCCESSFUL"
 #if fileexists(/two/two.test) echo "SUCCESSFUL"
<font color='#997700'>@@ -101,8 +107,25 @@
</font>   touch( "/one/one.test" );
   touch( "/one/two/two.test" );
 
<font color='#000088'>+  puts( "allocate most of memory - attempt to fail chroot - expect ENOTSUP" );
+  _Heap_Get_information(RTEMS_Malloc_Heap, &Info);
+  alloc_ptr = malloc( Info.Free.largest - 4 );
+  rtems_test_assert( alloc_ptr != NULL );
+
</font>   status = chroot( "/one" );
<font color='#880000'>-  rtems_test_assert(  status == 0 );
</font><font color='#000088'>+  rtems_test_assert( status == -1 );
+  rtems_test_assert( errno == ENOTSUP );
+
+  puts( "freeing the allocated memory" );
+  free( alloc_ptr );
+
+  puts( "chroot with bad path - expect EFAULT" );
+  status = chroot( NULL );
+  rtems_test_assert( status == -1 );
+  rtems_test_assert( errno == EFAULT );
+
+  status = chroot( "/one" );
+  rtems_test_assert( status == 0 );
</font> 
   status = fileexists( "/one/one.test" );
   printf( "%s on /one/one.test\n", (!status) ? "SUCCESS" : "FAILURE" );
</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>