Skip to content

Commit 0e9b95a

Browse files
committed
... use _putenv / delay cert removal
1 parent 50c96ee commit 0e9b95a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/src/unit/tests/test_connection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace {
3737

3838
static void setenv(const std::string& name, const std::string& value) {
3939
#ifdef _WIN32
40-
putenv(const_cast<char*>(std::string(name + "=" + value).c_str()));
40+
_putenv(const_cast<char*>(std::string(name + "=" + value).c_str()));
4141
#else
4242
::setenv(name.c_str(), value.c_str(), 1);
4343
#endif
@@ -244,7 +244,6 @@ TEST_F(ConnectionUnitTest, SslDefaultVerifyPaths) {
244244
}
245245
ASSERT_EQ(settings.socket_settings.ssl_context->set_default_verify_paths(), CASS_OK)
246246
<< "Failed to import default / system SSL certificates.";
247-
ASSERT_EQ(std::remove(cert_path.c_str()), 0) << "Failed to cleanup temporary certificate file.";
248247

249248
// Ensure verification succeeds with this certificate.
250249
State state;
@@ -254,6 +253,7 @@ TEST_F(ConnectionUnitTest, SslDefaultVerifyPaths) {
254253
connector1->with_settings(settings)->connect(loop());
255254
uv_run(loop(), UV_RUN_DEFAULT);
256255
EXPECT_EQ(state.status, STATUS_SUCCESS);
256+
ASSERT_EQ(std::remove(cert_path.c_str()), 0) << "Failed to cleanup temporary certificate file.";
257257
}
258258

259259
TEST_F(ConnectionUnitTest, Refused) {

0 commit comments

Comments
 (0)