summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-08 16:37:43 +0000
committerpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-08 16:37:43 +0000
commitbf92cfbe95ffc13414bb1df4a58ef1ac2643b87a (patch)
tree1c759d1429a316755069ca11ce56123bebd81903
parent1da93d8708856c71729bffb812c4c0d2b73d0a86 (diff)
downloadchromium_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
-rw-r--r--base/base.xcodeproj/project.pbxproj2
-rw-r--r--base/observer_list_unittest.cc5
2 files changed, 6 insertions, 1 deletions
diff --git a/base/base.xcodeproj/project.pbxproj b/base/base.xcodeproj/project.pbxproj
index 8360c13..887fd5d 100644
--- a/base/base.xcodeproj/project.pbxproj
+++ b/base/base.xcodeproj/project.pbxproj
@@ -142,6 +142,7 @@
E49357230E422A38008F8B09 /* timer.h in Headers */ = {isa = PBXBuildFile; fileRef = 825403860D92D2CF0006B936 /* timer.h */; };
E49F18160E4BA46400386AEC /* sys_string_conversions_mac.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7B4C5F480E4B6BF900679E8F /* sys_string_conversions_mac.cc */; };
E49F181A0E4BA47100386AEC /* platform_thread.cc in Sources */ = {isa = PBXBuildFile; fileRef = 82E23FCC0D9C219600F8B40A /* platform_thread.cc */; };
+ E49F18340E4C891000386AEC /* observer_list_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = E4562C580E2802AC005E4685 /* observer_list_unittest.cc */; };
E4A133440E37A3C400110AA2 /* string_escape.cc in Sources */ = {isa = PBXBuildFile; fileRef = E4A133420E37A3C400110AA2 /* string_escape.cc */; };
E4A133450E37A3C400110AA2 /* string_escape.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A133430E37A3C400110AA2 /* string_escape.h */; };
E4A1334C0E37A41D00110AA2 /* command_line.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A1334A0E37A41D00110AA2 /* command_line.h */; };
@@ -1174,6 +1175,7 @@
E45A2C7C0E47B20B00DB1196 /* string_util_mac.cc in Sources */,
E49F18160E4BA46400386AEC /* sys_string_conversions_mac.cc in Sources */,
E49F181A0E4BA47100386AEC /* platform_thread.cc in Sources */,
+ E49F18340E4C891000386AEC /* observer_list_unittest.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
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_);
}