diff options
author | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-08 16:37:43 +0000 |
---|---|---|
committer | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-08 16:37:43 +0000 |
commit | bf92cfbe95ffc13414bb1df4a58ef1ac2643b87a (patch) | |
tree | 1c759d1429a316755069ca11ce56123bebd81903 /base/observer_list_unittest.cc | |
parent | 1da93d8708856c71729bffb812c4c0d2b73d0a86 (diff) | |
download | chromium_src-bf92cfbe95ffc13414bb1df4a58ef1ac2643b87a.zip chromium_src-bf92cfbe95ffc13414bb1df4a58ef1ac2643b87a.tar.gz chromium_src-bf92cfbe95ffc13414bb1df4a58ef1ac2643b87a.tar.bz2 |
Add observer_list_unittest.cc to base test target. Fix gcc warnings with virtual methods w/ non-virtual dtor and members being initialized in the init-list in the wrong order.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@569 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/observer_list_unittest.cc')
-rw-r--r-- | base/observer_list_unittest.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/base/observer_list_unittest.cc b/base/observer_list_unittest.cc index 6bb1d63..4ae5ac3 100644 --- a/base/observer_list_unittest.cc +++ b/base/observer_list_unittest.cc @@ -38,14 +38,16 @@ class ObserverListTest : public testing::Test { class Foo { public: virtual void Observe(int x) = 0; + virtual ~Foo() {} }; class Adder : public Foo { public: - Adder(int scaler) : scaler_(scaler), total(0) {} + Adder(int scaler) : total(0), scaler_(scaler) {} virtual void Observe(int x) { total += x * scaler_; } + virtual ~Adder() { } int total; private: int scaler_; @@ -55,6 +57,7 @@ class Disrupter : public Foo { public: Disrupter(ObserverList<Foo>& list, Foo* doomed) : list_(list), doomed_(doomed) { } + virtual ~Disrupter() { } virtual void Observe(int x) { list_.RemoveObserver(doomed_); } |