Skip to content

Commit

Permalink
x509 test updates msvc issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ecdeye committed Jul 19, 2024
1 parent 32a6ab9 commit 5f4cd1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/ci/run_openssl_comparison_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ for branch in "${openssl_branches_lib[@]}"; do
echo "Running X509ComparisonTests against OpenSSL ${branch}"
LD_LIBRARY_PATH="${install_dir}/openssl-${branch}/lib" "${BUILD_ROOT}/tool-openssl/tool_openssl_test" --gtest_filter=X509ComparisonTest.*
done

# OpenSSL 3.1.0 on switches from lib folder to lib64 folder
openssl_branches_lib64=($openssl_3_1_branch $openssl_3_2_branch $openssl_master_branch)
for branch in "${openssl_branches_lib64[@]}"; do
export OPENSSL_TOOL_PATH="${install_dir}/openssl-${branch}/bin/openssl"
Expand Down
12 changes: 6 additions & 6 deletions tool-openssl/x509_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <openssl/pem.h>
#include "internal.h"
#include <fstream>
#include <locale>


#ifdef _WIN32
Expand Down Expand Up @@ -324,12 +325,11 @@ class X509ComparisonTest : public ::testing::Test {

// Helper function to trim whitespace from both ends of a string to test certificate output
static inline std::string &trim(std::string &s) {
s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](unsigned char ch) {
return !std::isspace(ch);
}));
s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char ch) {
return !std::isspace(ch);
}).base(), s.end());
auto is_not_space = [](unsigned char ch) {
return !std::isspace(ch);
};
s.erase(s.begin(), std::find_if(s.begin(), s.end(), is_not_space));
s.erase(std::find_if(s.rbegin(), s.rend(), is_not_space).base(), s.end());
return s;
}

Expand Down

0 comments on commit 5f4cd1a

Please sign in to comment.