@@ -1079,6 +1079,7 @@ TEST_P(SlicMacrosParallel, test_macros_file_output)
1079
1079
std::ifstream no_fmt_contents (no_fmt);
1080
1080
std::stringstream no_fmt_buffer;
1081
1081
no_fmt_buffer << no_fmt_contents.rdbuf ();
1082
+ no_fmt_contents.close ();
1082
1083
1083
1084
std::string no_fmt_expected;
1084
1085
no_fmt_expected += " *****\n [INFO]\n\n Test \n\n " ;
@@ -1090,6 +1091,7 @@ TEST_P(SlicMacrosParallel, test_macros_file_output)
1090
1091
std::ifstream with_fmt_contents (with_fmt);
1091
1092
std::stringstream with_fmt_buffer;
1092
1093
with_fmt_buffer << with_fmt_contents.rdbuf ();
1094
+ with_fmt_contents.close ();
1093
1095
1094
1096
EXPECT_EQ (with_fmt_buffer.str (), " Test" );
1095
1097
}
@@ -1116,6 +1118,7 @@ TEST_P(SlicMacrosParallel, test_macros_file_output)
1116
1118
std::ifstream no_fmt_output (no_fmt);
1117
1119
std::stringstream no_fmt_out_buf;
1118
1120
no_fmt_out_buf << no_fmt_output.rdbuf ();
1121
+ no_fmt_output.close ();
1119
1122
1120
1123
std::string no_fmt_output_expected;
1121
1124
no_fmt_output_expected += " *****\n [INFO]\n\n Test \n\n " ;
@@ -1124,13 +1127,14 @@ TEST_P(SlicMacrosParallel, test_macros_file_output)
1124
1127
no_fmt_output_expected +=
1125
1128
" *****\n [INFO]\n\n Test outputLocalMessages() \n\n " ;
1126
1129
no_fmt_output_expected += __FILE__;
1127
- no_fmt_output_expected += " \n 1107 \n ****\n " ;
1130
+ no_fmt_output_expected += " \n 1109 \n ****\n " ;
1128
1131
1129
1132
EXPECT_EQ (no_fmt_out_buf.str (), no_fmt_output_expected);
1130
1133
1131
1134
std::ifstream with_fmt_output (with_fmt);
1132
1135
std::stringstream with_fmt_out_buf;
1133
1136
with_fmt_out_buf << with_fmt_output.rdbuf ();
1137
+ with_fmt_output.close ();
1134
1138
1135
1139
EXPECT_EQ (with_fmt_out_buf.str (), " TestTest outputLocalMessages()" );
1136
1140
}
@@ -1141,22 +1145,29 @@ TEST_P(SlicMacrosParallel, test_macros_file_output)
1141
1145
std::ifstream no_fmt_output (no_fmt);
1142
1146
std::stringstream no_fmt_out_buf;
1143
1147
no_fmt_out_buf << no_fmt_output.rdbuf ();
1148
+ no_fmt_output.close ();
1144
1149
1145
1150
std::string no_fmt_output_expected;
1146
1151
no_fmt_output_expected +=
1147
1152
" *****\n [INFO]\n\n Test outputLocalMessages() \n\n " ;
1148
1153
no_fmt_output_expected += __FILE__;
1149
- no_fmt_output_expected += " \n 1107 \n ****\n " ;
1154
+ no_fmt_output_expected += " \n 1109 \n ****\n " ;
1150
1155
1151
1156
EXPECT_EQ (no_fmt_out_buf.str (), no_fmt_output_expected);
1152
1157
1153
1158
std::ifstream with_fmt_output (with_fmt);
1154
1159
std::stringstream with_fmt_out_buf;
1155
1160
with_fmt_out_buf << with_fmt_output.rdbuf ();
1161
+ with_fmt_output.close ();
1156
1162
1157
1163
EXPECT_EQ (with_fmt_out_buf.str (), " Test outputLocalMessages()" );
1158
1164
}
1159
1165
1166
+ // Closes open file streams associated with Slic streams when destructors
1167
+ // called during slic::finalize().
1168
+ // Windows _unlink file deletion fails if file is still in use.
1169
+ slic::finalize ();
1170
+
1160
1171
// Cleanup generated files
1161
1172
EXPECT_EQ (axom::utilities::filesystem::removeFile (no_fmt), 0 );
1162
1173
EXPECT_EQ (axom::utilities::filesystem::removeFile (with_fmt), 0 );
0 commit comments