Updating trunk VERSION from 1010.0 to 1011.0
[chromium-blink-merge.git] / base / base64_unittest.cc
blob1d11b1eb10850b3168b6dcbcbbc04f1c58c7f37b
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/base64.h"
6 #include "testing/gtest/include/gtest/gtest.h"
8 namespace {
10 class Base64Test : public testing::Test {
13 } // namespace
15 TEST(Base64Test, Basic) {
16 const std::string kText = "hello world";
17 const std::string kBase64Text = "aGVsbG8gd29ybGQ=";
19 std::string encoded, decoded;
20 bool ok;
22 ok = base::Base64Encode(kText, &encoded);
23 EXPECT_TRUE(ok);
24 EXPECT_EQ(kBase64Text, encoded);
26 ok = base::Base64Decode(encoded, &decoded);
27 EXPECT_TRUE(ok);
28 EXPECT_EQ(kText, decoded);