mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-02-25 10:12:57 +00:00
Limit use of default namespace in tests and utility programs (#71). r=bryner
- main is now the only thing you'll find in the default namespace. Everything else has been moved into an unnamed namespace. http://groups.google.com/group/airbag-dev/browse_thread/thread/14130a0284a0307f git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@63 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
@@ -41,6 +41,9 @@
|
||||
#include "processor/scoped_ptr.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
|
||||
using google_airbag::linked_ptr;
|
||||
using google_airbag::scoped_ptr;
|
||||
using google_airbag::RangeMap;
|
||||
@@ -99,7 +102,7 @@ struct RangeTestSet {
|
||||
// StoreTest uses the data in a RangeTest and calls StoreRange on the
|
||||
// test RangeMap. It returns true if the expected result occurred, and
|
||||
// false if something else happened.
|
||||
bool StoreTest(TestMap *range_map, const RangeTest *range_test) {
|
||||
static bool StoreTest(TestMap *range_map, const RangeTest *range_test) {
|
||||
linked_ptr<CountedObject> object(new CountedObject(range_test->id));
|
||||
bool stored = range_map->StoreRange(range_test->address,
|
||||
range_test->size,
|
||||
@@ -123,7 +126,7 @@ bool StoreTest(TestMap *range_map, const RangeTest *range_test) {
|
||||
// map entry at the specified range,) it returns true, otherwise, it returns
|
||||
// false. RetrieveTest will check the values around the base address and
|
||||
// the high address of a range to guard against off-by-one errors.
|
||||
bool RetrieveTest(TestMap *range_map, const RangeTest *range_test) {
|
||||
static bool RetrieveTest(TestMap *range_map, const RangeTest *range_test) {
|
||||
for (unsigned int side = 0; side <= 1; ++side) {
|
||||
// When side == 0, check the low side (base address) of each range.
|
||||
// When side == 1, check the high side (base + size) of each range.
|
||||
@@ -241,7 +244,7 @@ bool RetrieveTest(TestMap *range_map, const RangeTest *range_test) {
|
||||
|
||||
|
||||
// RunTests runs a series of test sets.
|
||||
bool RunTests() {
|
||||
static bool RunTests() {
|
||||
// These tests will be run sequentially. The first set of tests exercises
|
||||
// most functions of RangeTest, and verifies all of the bounds-checking.
|
||||
const RangeTest range_tests_0[] = {
|
||||
@@ -402,6 +405,10 @@ bool RunTests() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
return RunTests() ? 0 : 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user