Skip to content

Commit b9da4cf

Browse files
committed
Fix Installations CMake, and remove absl dependency in the test
1 parent 472cb85 commit b9da4cf

File tree

3 files changed

+29
-15
lines changed

3 files changed

+29
-15
lines changed

installations/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@ else()
4141
"${desktop_SRCS}")
4242
endif()
4343

44-
if(ANDROID OR IOS OR use_stub)
45-
set(additional_link_LIB)
46-
else()
47-
set(additional_link_LIB
48-
firebase_installations_desktop_impl)
49-
endif()
50-
5144
add_library(firebase_installations STATIC
5245
${common_SRCS}
5346
${installations_platform_SRCS})
@@ -58,8 +51,6 @@ set_property(TARGET firebase_installations PROPERTY FOLDER "Firebase Cpp")
5851
target_link_libraries(firebase_installations
5952
PUBLIC
6053
firebase_app
61-
PRIVATE
62-
${additional_link_LIB}
6354
)
6455
# Public headers all refer to each other relative to the src/include directory,
6556
# while private headers are relative to the entire C++ SDK directory.

installations/tests/CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
firebase_cpp_cc_test(
16+
firebase_installations_test
17+
SOURCES
18+
${FIREBASE_SOURCE_DIR}/installations/tests/installations_test.cc
19+
DEPENDS
20+
firebase_app_for_testing
21+
firebase_installations
22+
firebase_testing
23+
)

installations/tests/installations_test.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,21 @@ class InstallationsTest : public ::testing::Test {
104104

105105
// Check SetUp and TearDown working well.
106106
TEST_F(InstallationsTest, InitializeAndTerminate) {
107-
auto installations =
108-
absl::WrapUnique(Installations::GetInstance(firebase_app_));
107+
auto* installations = Installations::GetInstance(firebase_app_);
109108
EXPECT_THAT(installations, NotNull());
109+
delete installations;
110110
}
111111

112112
TEST_F(InstallationsTest, InitializeTwice) {
113-
auto installations1 =
114-
absl::WrapUnique(Installations::GetInstance(firebase_app_));
113+
auto* installations1 = Installations::GetInstance(firebase_app_);
115114
EXPECT_THAT(installations1, NotNull());
116115

117-
auto installations2 =
118-
absl::WrapUnique(Installations::GetInstance(firebase_app_));
116+
auto* installations2 = Installations::GetInstance(firebase_app_);
119117
EXPECT_THAT(installations2, NotNull());
120118

121119
EXPECT_EQ(installations1, installations2);
120+
delete installations1;
121+
delete installations2;
122122
}
123123

124124
TEST_F(InstallationsTest, GetId) {

0 commit comments

Comments
 (0)