Branch data Line data Source code
1 : : #include "sute.h"
2 : :
3 : : /**
4 : : * @brief Check that delete_path() removes a regular file
5 : : *
6 : : * @return Return describing success or failure
7 : : */
8 : 1 : Return test0036(void)
9 : : {
10 : : /* This function was reviewed line by line by a human and is not AI-generated
11 : : Any change to this function requires separate explicit approval */
12 : :
13 : 1 : INITTEST;
14 : :
15 : 1 : bool file_exists = false;
16 : 1 : m_create(char,absolute_path,MEMORY_STRING);
17 : :
18 : 1 : ASSERT(SUCCESS == replase_to_string("delete_path regular file coverage","delete_path_regular_file.txt"));
19 : 1 : ASSERT(SUCCESS == construct_path("delete_path_regular_file.txt",absolute_path));
20 : 1 : ASSERT(SUCCESS == check_file_exists(&file_exists,m_text(absolute_path)));
21 : 1 : ASSERT(file_exists == true);
22 : 1 : ASSERT(SUCCESS == delete_path("delete_path_regular_file.txt"));
23 : : /* Verify that delete_path() really removed the file */
24 : 1 : ASSERT(SUCCESS == check_file_exists(&file_exists,m_text(absolute_path)));
25 : 1 : ASSERT(file_exists == false);
26 : :
27 : 1 : call(m_del(absolute_path));
28 : :
29 : 1 : RETURN_STATUS;
30 : : }
|