forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
base: No need to inherit testing::Test in base64 unittest.
TEST=base_unittests TBR=willchan@chromium.org Review URL: https://chromiumcodereview.appspot.com/10969059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158203 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
tfarina@chromium.org
committed
Sep 23, 2012
1 parent
e6b63cd
commit 24f111a
Showing
1 changed file
with
9 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,28 @@ | ||
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | ||
// Copyright (c) 2012 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 "base/base64.h" | ||
#include "testing/gtest/include/gtest/gtest.h" | ||
|
||
namespace { | ||
|
||
class Base64Test : public testing::Test { | ||
}; | ||
#include "testing/gtest/include/gtest/gtest.h" | ||
|
||
} // namespace | ||
namespace base { | ||
|
||
TEST(Base64Test, Basic) { | ||
const std::string kText = "hello world"; | ||
const std::string kBase64Text = "aGVsbG8gd29ybGQ="; | ||
|
||
std::string encoded, decoded; | ||
std::string encoded; | ||
std::string decoded; | ||
bool ok; | ||
|
||
ok = base::Base64Encode(kText, &encoded); | ||
ok = Base64Encode(kText, &encoded); | ||
EXPECT_TRUE(ok); | ||
EXPECT_EQ(kBase64Text, encoded); | ||
|
||
ok = base::Base64Decode(encoded, &decoded); | ||
ok = Base64Decode(encoded, &decoded); | ||
EXPECT_TRUE(ok); | ||
EXPECT_EQ(kText, decoded); | ||
} | ||
|
||
} // namespace base |