Skip to content

Commit 22387e3

Browse files
committed
Added integration tests
Added integration test and removed the ability to set logging callback for now. Will add in the future.
1 parent a8422d8 commit 22387e3

File tree

3 files changed

+7
-42
lines changed

3 files changed

+7
-42
lines changed

analytics/integration_test/src/integration_test.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,13 @@ TEST_F(FirebaseAnalyticsTest, TestLogEvents) {
259259
"spoon_welders");
260260
}
261261

262+
TEST_F(FirebaseAnalyticsTest, TestNotifyAppLifecycleChange) {
263+
// Can't confirm that these do anything but just run them all to ensure the
264+
// app doesn't crash.
265+
firebase::analytics::NotifyAppLifecycleChange(firebase::analytics::kUnknown);
266+
firebase::analytics::NotifyAppLifecycleChange(firebase::analytics::kTermination);
267+
}
268+
262269
TEST_F(FirebaseAnalyticsTest, TestLogEventWithMultipleParameters) {
263270
const firebase::analytics::Parameter kLevelUpParameters[] = {
264271
firebase::analytics::Parameter(firebase::analytics::kParameterLevel, 5),

analytics/src/analytics_desktop.cc

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -392,39 +392,6 @@ void NotifyAppLifecycleChange(AppLifecycleState state) {
392392
static_cast<GoogleAnalytics_AppLifecycleState>(state));
393393
}
394394

395-
static void (*firebaseLogCallback)(LogLevel log_level, const char* log_message,
396-
void* callback_data) = nullptr;
397-
398-
void SetLogCallback(LogCallback callback) {
399-
FIREBASE_ASSERT_RETURN_VOID(internal::IsInitialized());
400-
401-
firebaseLogCallback = callback;
402-
403-
GoogleAnalytics_SetLogCallback(
404-
[](GoogleAnalytics_LogLevel log_level, const char* message) {
405-
if (firebaseLogCallback) {
406-
LogLevel fbLogLevel;
407-
switch (log_level) {
408-
case GoogleAnalytics_LogLevel::kDebug:
409-
fbLogLevel = LogLevel::kLogLevelDebug;
410-
break;
411-
case GoogleAnalytics_LogLevel::kInfo:
412-
fbLogLevel = LogLevel::kLogLevelInfo;
413-
break;
414-
case GoogleAnalytics_LogLevel::kWarning:
415-
fbLogLevel = LogLevel::kLogLevelWarning;
416-
break;
417-
case GoogleAnalytics_LogLevel::kError:
418-
fbLogLevel = LogLevel::kLogLevelError;
419-
break;
420-
default:
421-
fbLogLevel = LogLevel::kLogLevelInfo;
422-
}
423-
firebaseLogCallback(fbLogLevel, message, nullptr);
424-
}
425-
});
426-
}
427-
428395
// Overloaded versions of LogEvent for convenience.
429396

430397
void LogEvent(const char* name) {

analytics/src/include/firebase/analytics.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
#include <string>
2424
#include <vector>
2525

26-
#include "app/src/log.h"
27-
2826
#include "firebase/app.h"
2927
#include "firebase/future.h"
3028
#include "firebase/internal/common.h"
@@ -585,13 +583,6 @@ enum AppLifecycleState {
585583

586584
void NotifyAppLifecycleChange(AppLifecycleState state);
587585

588-
/// @brief Allows the passing of a callback to be used when the SDK logs any
589-
/// *messages regarding its behavior.The callback must be thread -
590-
/// safe.
591-
///
592-
/// @param[in] callback The callback to use. Must be thread-safe.
593-
void SetLogCallback(LogCallback callback);
594-
595586
/// Get the instance ID from the analytics service.
596587
///
597588
/// @note This is *not* the same ID as the ID returned by

0 commit comments

Comments
 (0)