Skip to content

Commit 5745be1

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 5745be1

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

analytics/integration_test/src/integration_test.cc

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

278280
TEST_F(FirebaseAnalyticsTest, TestDesktopInitialization) {
279281
// The analytics dll does not work on 32 bit systems.
@@ -283,24 +285,21 @@ TEST_F(FirebaseAnalyticsTest, TestDesktopInitialization) {
283285
bool initialized = firebase::analytics::IsDesktopInitialized();
284286

285287
#if defined(_WIN32)
286-
// On Windows, since we initialized in SetUpTestSuite, it should be true.
288+
// On Windows, it should be true.
287289
EXPECT_TRUE(initialized);
288290
#else
289-
// On other platforms, we made it return false.
291+
// On other platforms, it should return false.
290292
EXPECT_FALSE(initialized);
291293
#endif
292294
}
293295

294296
TEST_F(FirebaseAnalyticsTest, TestDesktopDebugMode) {
295-
// The analytics dll does not work on 32 bit systems.
296-
SKIP_TEST_ON_WINDOWS_32BIT;
297297

298298
// SetDebugMode doesn't return anything, so we just call it to ensure
299299
// it doesn't crash.
300300
firebase::analytics::SetDesktopDebugMode(true);
301301
firebase::analytics::SetDesktopDebugMode(false);
302302
}
303-
#endif // defined(_WIN32)
304303

305304
TEST_F(FirebaseAnalyticsTest, TestLogEvents) {
306305
// 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)