Ignore:
Timestamp:
Jul 13, 2016, 7:22:35 AM (4 years ago)
Author:
Alexander Krutwig <alexander.krutwig@…>
Branches:
master
Children:
6a174c02
Parents:
c1b815ab
git-author:
Alexander Krutwig <alexander.krutwig@…> (07/13/16 07:22:35)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/26/16 08:00:04)
Message:

Add Untar_FromChunk_Print() + Test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/tar01/init.c

    rc1b815ab r1a8fe67a  
    3232void test_untar_from_memory(void);
    3333void test_untar_from_file(void);
     34void test_untar_chunks_from_memory(void);
    3435
    3536#define TARFILE_START initial_filesystem_tar
     
    107108}
    108109
     110void test_untar_chunks_from_memory(void)
     111{
     112  rtems_status_code sc;
     113  rtems_printer     printer;
     114  int rv;
     115  Untar_ChunkContext ctx;
     116  unsigned long counter = 0;
     117  char *buffer = (char *)TARFILE_START;
     118  size_t buflen = TARFILE_SIZE;
     119
     120  rtems_print_printer_printf(&printer);
     121
     122  /* make a directory to untar it into */
     123  rv = mkdir( "/dest2", 0777 );
     124  rtems_test_assert( rv == 0 );
     125
     126  rv = chdir( "/dest2" );
     127  rtems_test_assert( rv == 0 );
     128
     129  printf( "Untaring chunks from memory - " );
     130  Untar_ChunkContext_Init(&ctx);
     131  do {
     132    sc = Untar_FromChunk_Print(&ctx, &buffer[counter], (size_t)1 , &printer);
     133    rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     134    counter ++;
     135  } while (counter < buflen);
     136  printf("successful\n");
     137
     138  /******************/
     139  printf( "========= /dest2/home/test_file =========\n" );
     140  test_cat( "/dest2/home/test_file", 0, 0 );
     141
     142  /******************/
     143  printf( "========= /dest2/symlink =========\n" );
     144  test_cat( "/dest2/symlink", 0, 0 );
     145
     146}
     147
    109148rtems_task Init(
    110149  rtems_task_argument ignored
     
    116155  puts( "" );
    117156  test_untar_from_file();
     157  puts( "" );
     158  test_untar_chunks_from_memory();
    118159
    119160  TEST_END();
Note: See TracChangeset for help on using the changeset viewer.