Skip to content

Commit

Permalink
url: Remove using namespace declaration from url_parse_unittests.cc
Browse files Browse the repository at this point in the history
Instead we wrap the entire file under namespace url_parse and the unnamed
namespace, to be compliant with the ODR.

BUG=82078
TEST=googleurl_unittests
TBR=brettw@chromium.org

Review URL: https://codereview.chromium.org/14243002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194130 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
tfarina@chromium.org committed Apr 15, 2013
1 parent 7a2e2e4 commit ecf0d74
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions url/url_parse_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "url/url_parse.h"

#include "base/basictypes.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/url_parse.h"

// Some implementations of base/basictypes.h may define ARRAYSIZE.
// If it's not defined, we define it to the ARRAYSIZE_UNSAFE macro
Expand Down Expand Up @@ -68,6 +69,7 @@
// it looks like an absolute drive path. Also, slashes and backslashes are
// equally valid here.

namespace url_parse {
namespace {

// Used for regular URL parse cases.
Expand Down Expand Up @@ -143,8 +145,6 @@ void ExpectInvalidComponent(const url_parse::Component& component) {
EXPECT_EQ(-1, component.len);
}

} // namespace

// Parsed ----------------------------------------------------------------------

TEST(URLParser, Length) {
Expand Down Expand Up @@ -177,16 +177,15 @@ TEST(URLParser, Length) {
}

TEST(URLParser, CountCharactersBefore) {
using namespace url_parse;
struct CountCase {
const char* url;
Parsed::ComponentType component;
bool include_delimiter;
int expected_count;
} count_cases[] = {
// Test each possibility in the case where all components are present.
// 0 1 2
// 0123456789012345678901
// Test each possibility in the case where all components are present.
// 0 1 2
// 0123456789012345678901
{"http://u:p@h:8/p?q#r", Parsed::SCHEME, true, 0},
{"http://u:p@h:8/p?q#r", Parsed::SCHEME, false, 0},
{"http://u:p@h:8/p?q#r", Parsed::USERNAME, true, 7},
Expand Down Expand Up @@ -647,3 +646,5 @@ TEST(URLParser, FileSystemURL) {
}
}

} // namespace
} // namespace url_parse

0 comments on commit ecf0d74

Please sign in to comment.