File tree Expand file tree Collapse file tree 5 files changed +108
-1
lines changed
src/aws-cpp-sdk-core/include/aws/core/http
tests/aws-cpp-sdk-sns-integration-tests Expand file tree Collapse file tree 5 files changed +108
-1
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ list(APPEND SDK_TEST_PROJECT_LIST "s3:tests/aws-cpp-sdk-s3-unit-tests")
105105list (APPEND SDK_TEST_PROJECT_LIST "s3-crt:tests/aws-cpp-sdk-s3-crt-integration-tests" )
106106list (APPEND SDK_TEST_PROJECT_LIST "s3-encryption:tests/aws-cpp-sdk-s3-encryption-tests,tests/aws-cpp-sdk-s3-encryption-integration-tests" )
107107list (APPEND SDK_TEST_PROJECT_LIST "s3control:tests/aws-cpp-sdk-s3control-integration-tests" )
108+ list (APPEND SDK_TEST_PROJECT_LIST "sns:tests/aws-cpp-sdk-sns-integration-tests" )
108109list (APPEND SDK_TEST_PROJECT_LIST "sqs:tests/aws-cpp-sdk-sqs-integration-tests" )
109110list (APPEND SDK_TEST_PROJECT_LIST "sqs:tests/aws-cpp-sdk-sqs-unit-tests" )
110111list (APPEND SDK_TEST_PROJECT_LIST "transfer:tests/aws-cpp-sdk-transfer-tests" )
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ namespace Aws
153153 {
154154 m_pathSegments.push_back (segment);
155155 }
156- m_pathHasTrailingSlash = (!segments.empty () && segments.back () == ' /' );
156+ m_pathHasTrailingSlash = (m_pathSegments. empty () || !s_preservePathSeparators) && ( !segments.empty () && segments.back () == ' /' );
157157 }
158158
159159 /* *
Original file line number Diff line number Diff line change 1+ add_project(aws-cpp-sdk-sns-integration-tests
2+ "Tests for the AWS SNS C++ SDK"
3+ aws-cpp-sdk-sns
4+ testing-resources
5+ aws-cpp-sdk-core)
6+
7+ file (GLOB AWS_SNS_SRC
8+ "${CMAKE_CURRENT_SOURCE_DIR} /*.cpp"
9+ )
10+
11+ file (GLOB AWS_SNS_INTEGRATION_TESTS_SRC
12+ ${AWS_SNS_SRC}
13+ )
14+
15+ if (MSVC AND BUILD_SHARED_LIBS )
16+ add_definitions (-DGTEST_LINKED_AS_SHARED_LIBRARY=1)
17+ endif ()
18+
19+ enable_testing ()
20+
21+ if (PLATFORM_ANDROID AND BUILD_SHARED_LIBS )
22+ add_library (${PROJECT_NAME} ${AWS_SNS_INTEGRATION_TESTS_SRC} )
23+ else ()
24+ add_executable (${PROJECT_NAME} ${AWS_SNS_INTEGRATION_TESTS_SRC} )
25+ endif ()
26+
27+ set_compiler_flags(${PROJECT_NAME} )
28+ set_compiler_warnings(${PROJECT_NAME} )
29+
30+ target_link_libraries (${PROJECT_NAME} ${PROJECT_LIBS} )
Original file line number Diff line number Diff line change 1+ #include < gtest/gtest.h>
2+ #include < aws/testing/AwsTestHelpers.h>
3+ #include < aws/core/client/ClientConfiguration.h>
4+ #include < aws/core/Aws.h>
5+ #include < aws/core/utils/UUID.h>
6+
7+ #include < aws/sns/SNSClient.h>
8+ #include < aws/sns/model/ListTopicsRequest.h>
9+ #include < aws/sns/model/CreateTopicRequest.h>
10+ #include < aws/sns/model/DeleteTopicRequest.h>
11+
12+ using namespace Aws ;
13+ using namespace Aws ::SNS;
14+ using namespace Aws ::SNS::Model;
15+
16+ namespace
17+ {
18+ static const char ALLOCATION_TAG[] = " PreservePathSeparatorsTest" ;
19+
20+ class PreservePathSeparatorsTest : public ::testing::Test
21+ {
22+ protected:
23+ void SetUp () override
24+ {
25+ options.httpOptions .preservePathSeparators = true ;
26+ Aws::InitAPI (options);
27+ snsClient = Aws::MakeShared<SNSClient>(ALLOCATION_TAG);
28+ }
29+
30+ void TearDown () override
31+ {
32+ snsClient = nullptr ;
33+ Aws::ShutdownAPI (options);
34+ }
35+
36+ std::shared_ptr<SNSClient> snsClient;
37+ Aws::SDKOptions options;
38+ };
39+
40+ TEST_F (PreservePathSeparatorsTest, TestSNSListTopicsWithPreservePathSeparators)
41+ {
42+ ListTopicsRequest request;
43+ auto outcome = snsClient->ListTopics (request);
44+ ASSERT_TRUE (outcome.IsSuccess ());
45+
46+ }
47+
48+ }
Original file line number Diff line number Diff line change 1+ //
2+ // Created by Pulim, Snigdha on 7/31/25.
3+ //
4+ #include < gtest/gtest.h>
5+ #include < aws/core/Aws.h>
6+ #include < aws/testing/platform/PlatformTesting.h>
7+ #include < aws/testing/TestingEnvironment.h>
8+ #include < aws/testing/MemoryTesting.h>
9+
10+ int main (int argc, char ** argv)
11+ {
12+ Aws::Testing::SetDefaultSigPipeHandler ();
13+ Aws::SDKOptions options;
14+ options.loggingOptions .logLevel = Aws::Utils::Logging::LogLevel::Trace;
15+ AWS_BEGIN_MEMORY_TEST_EX (options, 1024 , 128 );
16+
17+ Aws::Testing::InitPlatformTest (options);
18+ Aws::Testing::ParseArgs (argc, argv);
19+
20+ Aws::InitAPI (options);
21+ ::testing::InitGoogleTest (&argc, argv);
22+ int exitCode = RUN_ALL_TESTS ();
23+
24+ Aws::ShutdownAPI (options);
25+ AWS_END_MEMORY_TEST_EX;
26+ Aws::Testing::ShutdownPlatformTest (options);
27+ return exitCode;
28+ }
You can’t perform that action at this time.
0 commit comments