diff options
author | nick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-16 17:07:46 +0000 |
---|---|---|
committer | nick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-16 17:07:46 +0000 |
commit | 873043ae174de16897b9c9ff84ecd0e4f07ae516 (patch) | |
tree | 22f01a6cd53d44b66e8f2162c23251bf21ea4a01 /chrome/browser/sync | |
parent | 87b7ab7648929263d2f74d4ada0a8714598433e7 (diff) | |
download | chromium_src-873043ae174de16897b9c9ff84ecd0e4f07ae516.zip chromium_src-873043ae174de16897b9c9ff84ecd0e4f07ae516.tar.gz chromium_src-873043ae174de16897b9c9ff84ecd0e4f07ae516.tar.bz2 |
Build the sync unit tests:
- Remove old main(argc, argv) from syncable_unittest.
- Since the old notifier target had only one unittest,
merge it with the syncer tests.
- Remove listener_unittest.cc entirely.
- Don't compile natserver_main.cc, which has another main()
- Use a test main from the test_support_unit library. This
has the downside of pulling in a lot of deps we don't need,
but it gives us a run_all_unittests.cc.
- Fix a few compile errors in test code.
TEST=unit tests pass
BUG=none
Review URL: http://codereview.chromium.org/205021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26358 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r-- | chrome/browser/sync/notifier/listener/listener_unittest.cc | 10 | ||||
-rw-r--r-- | chrome/browser/sync/syncable/syncable_unittest.cc | 21 | ||||
-rw-r--r-- | chrome/browser/sync/util/event_sys_unittest.cc | 4 |
3 files changed, 2 insertions, 33 deletions
diff --git a/chrome/browser/sync/notifier/listener/listener_unittest.cc b/chrome/browser/sync/notifier/listener/listener_unittest.cc deleted file mode 100644 index 26697d6..0000000 --- a/chrome/browser/sync/notifier/listener/listener_unittest.cc +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "testing/gtest/include/gtest/gtest.h" - -int main(int argc, char **argv) { - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/chrome/browser/sync/syncable/syncable_unittest.cc b/chrome/browser/sync/syncable/syncable_unittest.cc index 49424f9..41ad4d5 100644 --- a/chrome/browser/sync/syncable/syncable_unittest.cc +++ b/chrome/browser/sync/syncable/syncable_unittest.cc @@ -1533,24 +1533,3 @@ TEST_F(SyncableDirectoryTest, Bug1509232) { } } // namespace syncable - -#ifdef OS_WIN -class LocalModule : public CAtlExeModuleT<LocalModule> { }; -LocalModule module_; - -int main(int argc, char* argv[]) { - testing::InitGoogleTest(&argc, argv); - - // TODO(chron) Add method to change random seed. - const int32 test_random_seed = time(NULL); - cout << "Random seed: " << test_random_seed << endl; - LOG(INFO) << "Random seed: " << test_random_seed << endl; - srand(test_random_seed); - - // Necessary for NewCallback, scoped to main - base::AtExitManager at_exit_manager; - - int result = RUN_ALL_TESTS(); - return result; -} -#endif diff --git a/chrome/browser/sync/util/event_sys_unittest.cc b/chrome/browser/sync/util/event_sys_unittest.cc index 0e1b112..99ee408 100644 --- a/chrome/browser/sync/util/event_sys_unittest.cc +++ b/chrome/browser/sync/util/event_sys_unittest.cc @@ -152,7 +152,7 @@ class ThreadTester : public EventListener<TestEvent> { } ~ThreadTester() { pair_->event_channel()->RemoveListener(this); - for (int i = 0; i < threads_.size(); i++) { + for (size_t i = 0; i < threads_.size(); i++) { CHECK(pthread_join(threads_[i].thread, NULL) == 0); delete threads_[i].completed; } @@ -229,7 +229,7 @@ class ThreadTester : public EventListener<TestEvent> { sleep(1); #endif - for (int i = 0; i < threads_.size(); i++) { + for (size_t i = 0; i < threads_.size(); i++) { if (*(threads_[i].completed)) LOG(FATAL) << "A test thread exited too early."; } |