diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 0a72876367..b73fb0bd12 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -328,9 +328,9 @@ set_property(TARGET firebase_app PROPERTY FOLDER "Firebase Cpp") # Disable exceptions in std if (MSVC) - target_compile_options(firebase_app PUBLIC /EHs-c-) + target_compile_options(firebase_app PRIVATE /EHs-c-) else() - target_compile_options(firebase_app PUBLIC -fno-exceptions) + target_compile_options(firebase_app PRIVATE -fno-exceptions) endif() target_include_directories(firebase_app diff --git a/app/tests/thread_test.cc b/app/tests/thread_test.cc index bf6237bb40..b822d67229 100644 --- a/app/tests/thread_test.cc +++ b/app/tests/thread_test.cc @@ -20,6 +20,18 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" +#define EXPECT_THROW_ERROR_CODE(statement, error_code) \ + EXPECT_THROW( \ + { \ + try { \ + GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ + } catch (const std::system_error& exception) { \ + EXPECT_EQ(error_code, exception.code()); \ + throw; \ + } \ + }, \ + std::system_error) + namespace { using ::testing::Eq; @@ -107,66 +119,66 @@ TEST(ThreadDeathTest, MovingIntoRunningThreadShouldAbort) { } TEST(ThreadDeathTest, JoinEmptyThreadShouldAbort) { - ASSERT_DEATH( + EXPECT_THROW_ERROR_CODE( { firebase::Thread thread; thread.Join(); }, - ""); + std::errc::invalid_argument); } TEST(ThreadDeathTest, JoinThreadMultipleTimesShouldAbort) { - ASSERT_DEATH( + EXPECT_THROW_ERROR_CODE( { firebase::Thread thread([] {}); thread.Join(); thread.Join(); }, - ""); + std::errc::invalid_argument); } TEST(ThreadDeathTest, JoinDetachedThreadShouldAbort) { - ASSERT_DEATH( + EXPECT_THROW_ERROR_CODE( { firebase::Thread thread([] {}); thread.Detach(); thread.Join(); }, - ""); + std::errc::invalid_argument); } TEST(ThreadDeathTest, DetachJoinedThreadShouldAbort) { - ASSERT_DEATH( + EXPECT_THROW_ERROR_CODE( { firebase::Thread thread([] {}); thread.Join(); thread.Detach(); }, - ""); + std::errc::invalid_argument); } TEST(ThreadDeathTest, DetachEmptyThreadShouldAbort) { - ASSERT_DEATH( + EXPECT_THROW_ERROR_CODE( { firebase::Thread thread; thread.Detach(); }, - ""); + std::errc::invalid_argument); } TEST(ThreadDeathTest, DetachThreadMultipleTimesShouldAbort) { - ASSERT_DEATH( + EXPECT_THROW_ERROR_CODE( { firebase::Thread thread([] {}); thread.Detach(); thread.Detach(); }, - ""); + std::errc::invalid_argument); } TEST(ThreadDeathTest, WhenJoinableThreadIsDestructedShouldAbort) { diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 994b8ca955..0a94ff2a80 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -569,12 +569,15 @@ code. ### 8.3.0 - Changes - - General: This release adds tvOS C++ libraries that wrap the community - supported Firebase tvOS SDK. `libs/tvos` contains tvOS specific - libraries and the `xcframeworks` directory now includes support for both - iOS and tvOS. The following products are currently included for tvOS: - Auth, Database, Firestore, Functions, Installations, Messaging, - Remote Config, Storage. + - General: This release adds tvOS C++ libraries that wrap the + community-supported Firebase tvOS SDK. `libs/tvos` contains + tvOS-specific libraries, and the `xcframeworks` directory now + includes support for both iOS and tvOS. The following products are + currently included for tvOS: Auth, Database, Firestore, Functions, + Installations, Messaging, Remote Config, Storage. + - General: When building from source, the compiler setting of + "no exceptions" on app is PRIVATE now and will not affect any other + targets in the build. - Firestore: Removed the deprecated `Firestore::RunTransaction(TransactionFunction*)` function. Please use the overload that takes a `std::function` argument instead.