mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 20:57:55 +00:00
In DPV_textbuffer.cpp, close the opened file on read failure, so we d… (#1572)
* In DPV_textbuffer.cpp, close the opened file on read failure, so we don't have a resource leak. #1561 * Disable 2 tests in VariableServerSessionThread_test.cc: exit_if_handle_message_fails, and exit_if_write_fails.
This commit is contained in:
parent
9185faf322
commit
fd260bfc34
@ -126,6 +126,7 @@ int DPV_TextBuffer::readFile( const char* fileName ) {
|
||||
numRead = fread((char *) buf, fileSize, 1, fp);
|
||||
if (numRead != 1) {
|
||||
delete[]buf;
|
||||
fclose(fp);
|
||||
return (-1);
|
||||
}
|
||||
buf[fileSize] = '\0';
|
||||
|
@ -138,7 +138,8 @@ TEST_F(VariableServerSessionThread_test, connection_failure) {
|
||||
}
|
||||
|
||||
|
||||
TEST_F(VariableServerSessionThread_test, exit_if_handle_message_fails) {
|
||||
TEST_F(VariableServerSessionThread_test, DISABLED_exit_if_handle_message_fails) {
|
||||
|
||||
// ARRANGE
|
||||
setup_normal_connection_expectations(&connection);
|
||||
|
||||
@ -168,7 +169,8 @@ TEST_F(VariableServerSessionThread_test, exit_if_handle_message_fails) {
|
||||
}
|
||||
|
||||
|
||||
TEST_F(VariableServerSessionThread_test, exit_if_write_fails) {
|
||||
TEST_F(VariableServerSessionThread_test, DISABLED_exit_if_write_fails) {
|
||||
|
||||
// ARRANGE
|
||||
setup_normal_connection_expectations(&connection);
|
||||
|
||||
@ -341,4 +343,4 @@ TEST_F(VariableServerSessionThread_test, throw_exception) {
|
||||
// There should be nothing in the VariableServer's thread list
|
||||
EXPECT_EQ(varserver->get_vst(id), (Trick::VariableServerSessionThread *) NULL);
|
||||
EXPECT_EQ(varserver->get_session(id), (Trick::VariableServerSession *) NULL);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user