S
Santtu Nyrhinen
Hi,
Let say that I have a function like
void writeHello() {
printf("Hello");
}
Now I need to make an automated test fot that function.
The test function returns 1 for successful and 0 for unsuccessful test.
int Test_writeHello() {
...
writeHello();
...
}
Test funtion is called from test driver that reports to stdout how it went.
E.g. "Test case 10/20 OK Test_writeHello()"
I can redirect stdout to a file (freopen("file","w",stdout)) and then check
if the function works but how can I restore stdout back to the screen?
- Santtu
Let say that I have a function like
void writeHello() {
printf("Hello");
}
Now I need to make an automated test fot that function.
The test function returns 1 for successful and 0 for unsuccessful test.
int Test_writeHello() {
...
writeHello();
...
}
Test funtion is called from test driver that reports to stdout how it went.
E.g. "Test case 10/20 OK Test_writeHello()"
I can redirect stdout to a file (freopen("file","w",stdout)) and then check
if the function works but how can I restore stdout back to the screen?
- Santtu