view_cache_helper_unittest.cc 717 B

123456789101112131415161718192021222324
  1. // Copyright (c) 2012 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.
  4. #include "net/url_request/view_cache_helper.h"
  5. #include <cstring>
  6. #include "testing/gtest/include/gtest/gtest.h"
  7. namespace net {
  8. TEST(ViewCacheHelper, HexDump) {
  9. std::string out = "Prefix\n";
  10. const char kIn[] = "0123456789ABCDEFGHIJ\x01\x80<&>";
  11. ViewCacheHelper::HexDump(kIn, strlen(kIn), &out);
  12. EXPECT_EQ(
  13. "Prefix\n00000000: 30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46 "
  14. "0123456789ABCDEF\n00000010: 47 48 49 4a 01 80 3c 26 3e "
  15. " GHIJ..&lt;&amp;&gt;\n",
  16. out);
  17. }
  18. } // namespace net