FOSSology  4.4.0
Open Source License Compliance by Open Source Software
test_CopyFile.c File Reference

Unit test cases related to file handling. More...

#include "run_tests.h"
Include dependency graph for test_CopyFile.c:

Go to the source code of this file.

Functions

int CopyFileInit ()
 initialize
 
int CopyFileClean ()
 clean env and others
 
void testCopyFileNormalFile ()
 copy directory More...
 
void testCopyFileNormalDir ()
 copy directory More...
 
void testCopyFileAbnormal ()
 parameters are null More...
 

Variables

static char * Src = ""
 Souce location.
 
static char * Dst = NULL
 Destination location.
 
static struct stat statSrc
 Stat of source.
 
static struct stat statDst
 Stat of destination.
 
static int Result = 0
 Result of calls.
 
CU_TestInfo CopyFile_testcases []
 Copy test cases. More...
 

Detailed Description

Unit test cases related to file handling.

Definition in file test_CopyFile.c.

Function Documentation

◆ testCopyFileAbnormal()

void testCopyFileAbnormal ( )

parameters are null

Test:
  1. Call CopyFile() on an empty Src
  2. Check if function returns 1
  3. Check if function did not do anything

Definition at line 85 of file test_CopyFile.c.

◆ testCopyFileNormalDir()

void testCopyFileNormalDir ( )

copy directory

Test:
  1. Call CopyFile() to copy directory
  2. Check if the function returns 1
  3. Check if a file under Src is not copied to Dst

Definition at line 67 of file test_CopyFile.c.

◆ testCopyFileNormalFile()

void testCopyFileNormalFile ( )

copy directory

Test:
  1. Add a new directory to Dst
  2. Call CopyFile() to copy a file from Src to Dst
  3. Check if file was copied to new directory

Definition at line 48 of file test_CopyFile.c.

Variable Documentation

◆ CopyFile_testcases

CU_TestInfo CopyFile_testcases[]
Initial value:
=
{
{"CopyFile: file name", testCopyFileNormalFile},
{"CopyFile: dir name", testCopyFileNormalDir},
{"CopyFile: file name is empty", testCopyFileAbnormal},
CU_TEST_INFO_NULL
}
void testCopyFileNormalFile()
copy directory
Definition: test_CopyFile.c:48
void testCopyFileNormalDir()
copy directory
Definition: test_CopyFile.c:67
void testCopyFileAbnormal()
parameters are null
Definition: test_CopyFile.c:85

Copy test cases.

Definition at line 101 of file test_CopyFile.c.