Branch data Line data Source code
1 : : #include "sute.h"
2 : :
3 : : /**
4 : : *
5 : : * Example test. Testitall library capability demonstration.
6 : : *
7 : : */
8 : 1 : Return test0010(void)
9 : : {
10 : 1 : INITTEST;
11 : :
12 : : // Set environment variable
13 [ + - + - ]: 1 : ASSERT(SUCCESS == set_environment_variable("REPLACEMENT","gentl"));
14 : :
15 : : // Get the output of an external program
16 : 1 : const char *command = "echo 'The gentle melody floated through\n" \
17 : : "the afternoon air as children played in the garden,\n" \
18 : : "their laughter mixing with birdsong.\n" \
19 : : "Butterflies danced among colorful flowers while a\n"
20 : : "tabby cat watched lazily from its sunny spot on the\n"
21 : : "wooden fence, tail swaying gently in the warm summer breeze.'";
22 : :
23 : 1 : const char *filename = "templates/0010.txt"; // File name
24 : 1 : const char *template = "%REPLACEMENT%";
25 : :
26 : 1 : const char *replacement = getenv("REPLACEMENT"); // Get variable value
27 : :
28 [ + - + - ]: 1 : ASSERT(replacement != NULL);
29 : :
30 [ + - + - ]: 1 : ASSERT(SUCCESS == match_file_template(command,filename,template,replacement,0));
31 : :
32 [ + - - + : 1 : RETURN_STATUS;
- - - + +
- ]
33 : : }
|