Skip to content

Commit d28fde9

Browse files
committed
Fix up test to run on all platforms and sub return false
The test should run on all platforms to make sure they don't fail. The sub for initialize analytics should default to returning false. If it really not load in that case.
1 parent 539b8a9 commit d28fde9

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

analytics/integration_test/src/integration_test.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ TEST_F(FirebaseAnalyticsTest, TestSetLogCallback) {
274274
EXPECT_TRUE(log_callback_called);
275275
firebase::analytics::SetLogCallback(nullptr);
276276
}
277+
#endif // defined(_WIN32)
277278

278279
TEST_F(FirebaseAnalyticsTest, TestDesktopInitialization) {
279280
// The analytics dll does not work on 32 bit systems.
@@ -283,24 +284,20 @@ TEST_F(FirebaseAnalyticsTest, TestDesktopInitialization) {
283284
bool initialized = firebase::analytics::IsDesktopInitialized();
284285

285286
#if defined(_WIN32)
286-
// On Windows, since we initialized in SetUpTestSuite, it should be true.
287+
// On Windows, it should be true.
287288
EXPECT_TRUE(initialized);
288289
#else
289-
// On other platforms, we made it return false.
290+
// On other platforms, it should return false.
290291
EXPECT_FALSE(initialized);
291292
#endif
292293
}
293294

294295
TEST_F(FirebaseAnalyticsTest, TestDesktopDebugMode) {
295-
// The analytics dll does not work on 32 bit systems.
296-
SKIP_TEST_ON_WINDOWS_32BIT;
297-
298296
// SetDebugMode doesn't return anything, so we just call it to ensure
299297
// it doesn't crash.
300298
firebase::analytics::SetDesktopDebugMode(true);
301299
firebase::analytics::SetDesktopDebugMode(false);
302300
}
303-
#endif // defined(_WIN32)
304301

305302
TEST_F(FirebaseAnalyticsTest, TestLogEvents) {
306303
// Log an event with no parameters.

analytics/src/analytics_desktop_dynamic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static void Stub_GoogleAnalytics_EventParameters_Destroy(GoogleAnalytics_EventPa
132132

133133
// Stub for GoogleAnalytics_Initialize
134134
static bool Stub_GoogleAnalytics_Initialize(GoogleAnalytics_Options* options) {
135-
return 1;
135+
return 0;
136136
}
137137

138138
// Stub for GoogleAnalytics_LogEvent

0 commit comments

Comments
 (0)