Skip to content

Commit

Permalink
x509 test updates removefile issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ecdeye committed Jul 19, 2024
1 parent 7c0aa37 commit ce2f43e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tool-openssl/x509_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ X509* CreateAndSignX509Certificate() {
}

void RemoveFile(const char* path) {
if (remove(path) != 0) {
if (path != nullptr && remove(path) != 0) {
fprintf(stderr, "Error deleting %s: %s\n", path, strerror(errno));
}
}
Expand All @@ -73,7 +73,6 @@ class X509Test : public ::testing::Test {
protected:
void SetUp() override {
ASSERT_GT(createTempFILEpath(in_path), 0u);

ASSERT_GT(createTempFILEpath(csr_path), 0u);
ASSERT_GT(createTempFILEpath(out_path), 0u);
ASSERT_GT(createTempFILEpath(signkey_path), 0u);
Expand Down Expand Up @@ -132,7 +131,6 @@ TEST_F(X509Test, X509ToolInOutTest) {
{
ScopedFILE out_file(fopen(out_path, "rb"));
ASSERT_TRUE(out_file);

bssl::UniquePtr<X509> parsed_x509(PEM_read_X509(out_file.get(), nullptr, nullptr, nullptr));
ASSERT_TRUE(parsed_x509);
}
Expand Down

0 comments on commit ce2f43e

Please sign in to comment.