CPP: Fix logger and asyoutypeformatter unit test to let the latest release build...
authorphilip.liard@gmail.com <philip.liard@gmail.com@ee073f10-1060-11df-b6a4-87a95322a99c>
Tue, 29 Nov 2011 09:23:58 +0000 (09:23 +0000)
committerphilip.liard@gmail.com <philip.liard@gmail.com@ee073f10-1060-11df-b6a4-87a95322a99c>
Tue, 29 Nov 2011 09:23:58 +0000 (09:23 +0000)
Patch contributed by georgey@chromium.org.

Review URL: http://codereview.appspot.com/5440052

git-svn-id: http://libphonenumber.googlecode.com/svn/trunk@402 ee073f10-1060-11df-b6a4-87a95322a99c

cpp/src/phonenumbers/default_logger.h
cpp/test/phonenumbers/asyoutypeformatter_test.cc

index 706ebf6..1cde2a5 100644 (file)
 namespace i18n {
 namespace phonenumbers {
 
+// There is no Logger in the new base implementation - provide a NOP one.
+class Logger {
+ public:
+  Logger() {}
+  virtual ~Logger() {}
+
+  static void set_logger_impl(Logger*) {}
+};
+
 // If Google base/ is used, LOG() and VLOG() from base/logging.h are used
 // therefore the default logger implementation (StdoutLogger) instantiated in
 // phonenumberutil will actually never be used. Thus provide a dummy
index 7f7a436..05847ec 100644 (file)
@@ -34,7 +34,7 @@ class AsYouTypeFormatterTest : public testing::Test {
   }
 
   const PhoneMetadata* GetCurrentMetadata() const {
-    return CHECK_NOTNULL(formatter_.get())->current_metadata_;
+    return formatter_.get()->current_metadata_;
   }
 
   int ConvertUnicodeStringPosition(const UnicodeString& s, int pos) const {