Commit 18fcd1c1 authored by Steven Murray's avatar Steven Murray
Browse files

Added comments to castorUnitTest to explain the closing of standard in, out and error

parent f02e3b60
...@@ -31,13 +31,20 @@ int main(int argc, char** argv) { ...@@ -31,13 +31,20 @@ int main(int argc, char** argv) {
// relying on the old "Cthread" collection. Calling should not have side // relying on the old "Cthread" collection. Calling should not have side
// effects. // effects.
Cthread_init(); Cthread_init();
// The following line must be executed to initialize Google Mock // The following line must be executed to initialize Google Mock
// (and Google Test) before running the tests. // (and Google Test) before running the tests.
::testing::InitGoogleMock(&argc, argv); ::testing::InitGoogleMock(&argc, argv);
int ret = RUN_ALL_TESTS(); int ret = RUN_ALL_TESTS();
castor::BaseObject::resetServices(); castor::BaseObject::resetServices();
// Close standard in, out and error so that valgrind can be used with the
// following command-line to track open file-descriptors:
//
// valgrind --track-fds=yes
close(0); close(0);
close(1); close(1);
close(2); close(2);
return ret; return ret;
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment