@@ -56,19 +56,19 @@ test__get_console_info__sets_attributes()
5656}
5757
5858
59- // int
60- // test__create_footer()
61- // {
62- // /* Arrange */
63- // char footer_string[640] ;
64- // short console_width = 80;
65- // char root_path[] = "x:\\";
66- // char search_drive = 'C';
67- //
68- // /* Act */
69- // create_footer(footer_string, console_width, root_path, search_drive);
70- //
71- // /* Assert */
59+ int
60+ test__create_footer ()
61+ {
62+ /* Arrange */
63+ char footer_string [1024 ] = { 0 } ;
64+ int console_width = 80 ;
65+ char * root_path = "x:\\" ;
66+ char search_drive = 'C' ;
67+
68+ /* Act */
69+ create_footer (footer_string , console_width , root_path , search_drive );
70+
71+ /* Assert */
7272// if (strcmp(footer_string,
7373// " 0 files, totaling , consuming 0 bytes of disk space.\n"
7474// " 0 bytes available on Drive C: Volume label: C_DRIVE\n"
@@ -77,8 +77,8 @@ test__get_console_info__sets_attributes()
7777// return 1;
7878// }
7979//
80- // return 0;
81- // }
80+ return 0 ;
81+ }
8282
8383
8484int
@@ -249,6 +249,29 @@ test__compact_size_with_suffix__works_with_ntfs_volume_limit()
249249}
250250
251251
252+ int
253+ test__append_horizontal_line ()
254+ {
255+ /* Arrange */
256+ char result [4096 ] = { 0 };
257+ unsigned int length = 0 ;
258+ unsigned int console_width = 80 ;
259+
260+ /* Act */
261+ append_horizontal_line (result , console_width );
262+ length = strlen (result );
263+ //printf("%s", result);
264+
265+ /* Assert */
266+ if (length != console_width ) {
267+ printf ("\nRESULT: %u\nEXPECTED: %u\n" , length , console_width );
268+ return 1 ;
269+ }
270+
271+ return 0 ;
272+ }
273+
274+
252275int
253276main ()
254277{
@@ -263,6 +286,7 @@ main()
263286 failed_count += test__compact_size_with_suffix__is_terabytes ();
264287 failed_count += test__compact_size_with_suffix__works_with_ntfs_volume_limit ();
265288 failed_count += test__create_horizontal_line__is_console_width ();
289+ failed_count += test__append_horizontal_line ();
266290 //failed_count += test__create_footer();
267291 failed_count += test__get_console_info__sets_attributes ();
268292
0 commit comments