FOSSology  4.4.0
Open Source License Compliance by Open Source Software
test_ununpack-disk.c File Reference

Unit test cases for ExtractDisk() More...

#include "run_tests.h"
Include dependency graph for test_ununpack-disk.c:

Go to the source code of this file.

Functions

void testExtractDisk4Ext2 ()
 unpack disk image, ext2 More...
 
void testExtractDisk4Ext3 ()
 unpack disk image, ext3 More...
 
void testExtractDisk4Ext2FstypeUnknow ()
 unpack disk image, ext2, FStype is unknown More...
 
void testExtractDisk4Fat ()
 unpack disk image, fat More...
 
void testExtractDisk4Ntfs ()
 unpack disk image, ntfs More...
 
int FatDiskNameInit ()
 initialize
 
int FatDiskNameClean ()
 clean env and others
 
void testFatDiskName1 ()
 Convert to lowercase. More...
 
void testFatDiskName2 ()
 Convert to lowercase. More...
 
void testFatDiskName3 ()
 Convert to lowercase. More...
 
void testFatDiskNameNameEmpty ()
 Convert to lowercase. More...
 

Variables

static int Result = 0
 
static char * Name = NULL
 
CU_TestInfo ununpack_disk_testcases []
 Disk image test cases. More...
 

Detailed Description

Unit test cases for ExtractDisk()

Definition in file test_ununpack-disk.c.

Function Documentation

◆ testExtractDisk4Ext2()

void testExtractDisk4Ext2 ( )

unpack disk image, ext2

Test:
  1. Try to extract ext2 fs images using ExtractDisk()
  2. Check if the files are unpacked

Definition at line 20 of file test_ununpack-disk.c.

◆ testExtractDisk4Ext2FstypeUnknow()

void testExtractDisk4Ext2FstypeUnknow ( )

unpack disk image, ext2, FStype is unknown

Test:
  1. Try to extract ext2 fs images using ExtractDisk() with empty FStype
  2. Check if function returns NOT OK
  3. Check if function has not unpacked the files

Definition at line 59 of file test_ununpack-disk.c.

◆ testExtractDisk4Ext3()

void testExtractDisk4Ext3 ( )

unpack disk image, ext3

Test:
  1. Try to extract ext3 fs images using ExtractDisk()
  2. Check if the files are unpacked

Definition at line 39 of file test_ununpack-disk.c.

◆ testExtractDisk4Fat()

void testExtractDisk4Fat ( )

unpack disk image, fat

Test:
  1. Try to extract fat fs images using ExtractDisk()
  2. Check if the files are unpacked

Definition at line 78 of file test_ununpack-disk.c.

◆ testExtractDisk4Ntfs()

void testExtractDisk4Ntfs ( )

unpack disk image, ntfs

Test:
  1. Try to extract ntfs fs images using ExtractDisk()
  2. Check if the files are unpacked

Definition at line 97 of file test_ununpack-disk.c.

◆ testFatDiskName1()

void testFatDiskName1 ( )

Convert to lowercase.

Test:
  1. Pass a string with upper case letters to FatDiskName()
  2. Check if the string is returned in lower case

Definition at line 139 of file test_ununpack-disk.c.

◆ testFatDiskName2()

void testFatDiskName2 ( )

Convert to lowercase.

Test:
  1. Pass a string with upper case letters to FatDiskName()
  2. Check if the string is returned in lower case
  3. Pass a string with upper case letters and spaces to FatDiskName()
  4. Check if the string is returned in lower case with spaces in place

Definition at line 154 of file test_ununpack-disk.c.

◆ testFatDiskName3()

void testFatDiskName3 ( )

Convert to lowercase.

Test:
  1. Pass a string with upper case letters and text in () to FatDiskName()
  2. Check if the string is returned in lower case without ()

Definition at line 171 of file test_ununpack-disk.c.

◆ testFatDiskNameNameEmpty()

void testFatDiskNameNameEmpty ( )

Convert to lowercase.

Test:
  1. Pass an empty string to FatDiskName()
  2. Check if empty string is returned

Definition at line 184 of file test_ununpack-disk.c.

Variable Documentation

◆ ununpack_disk_testcases

CU_TestInfo ununpack_disk_testcases[]
Initial value:
=
{
{"ExtractDisk: ext2 image:", testExtractDisk4Ext2},
{"ExtractDisk: ext3 image:", testExtractDisk4Ext3},
{"ExtractDisk: ext2 image, fs type is unknowed:", testExtractDisk4Ext2FstypeUnknow},
{"ExtractDisk: fat image:", testExtractDisk4Fat},
{"ExtractDisk: nfts image:", testExtractDisk4Ntfs},
{"FatDiskName: 1:", testFatDiskName1},
{"FatDiskName: 2:", testFatDiskName2},
{"FatDiskName: 3:", testFatDiskName3},
{"FatDiskName: empty parameter", testFatDiskNameNameEmpty},
CU_TEST_INFO_NULL
}
void testFatDiskName3()
Convert to lowercase.
void testExtractDisk4Ext2FstypeUnknow()
unpack disk image, ext2, FStype is unknown
void testExtractDisk4Ext2()
unpack disk image, ext2
void testExtractDisk4Ntfs()
unpack disk image, ntfs
void testFatDiskName1()
Convert to lowercase.
void testFatDiskNameNameEmpty()
Convert to lowercase.
void testFatDiskName2()
Convert to lowercase.
void testExtractDisk4Fat()
unpack disk image, fat
void testExtractDisk4Ext3()
unpack disk image, ext3

Disk image test cases.

Definition at line 196 of file test_ununpack-disk.c.