Skip to content

Commit

Permalink
git-clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
areusch committed Jul 28, 2020
1 parent b1ac151 commit 755d3fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/support/hexdump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ void hexdump(const std::string& s, std::ostream& os) {
addr_width++;
}


for (size_t cursor = 0; cursor < s.size(); cursor += 0x10) {
os << std::setw(addr_width) << cursor;
size_t row_end = cursor + 0x10;
Expand Down
24 changes: 12 additions & 12 deletions tests/cpp/support_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@

#include <dmlc/logging.h>
#include <gtest/gtest.h>
#include "../../src/support/hexdump.h"

#include "../../src/support/hexdump.h"

namespace tvm {
namespace test {

TEST(HexDumpTests, Empty) {
EXPECT_EQ("", ::tvm::support::hexdump(""));
}
TEST(HexDumpTests, Empty) { EXPECT_EQ("", ::tvm::support::hexdump("")); }

TEST(HexDumpTests, Aligned) {
EXPECT_EQ("0000 01 23 45 67 89 ab cd ef 01 23 45 67 89 ab cd ef .#Eg.....#Eg....\n"
"0010 01 23 45 67 89 ab cd ef 01 23 45 67 89 ab cd ef .#Eg.....#Eg....\n",
::tvm::support::hexdump("\x01\x23\x45\x67\x89\xab\xcd\xef\x01\x23\x45\x67\x89\xab\xcd\xef"
"\x01\x23\x45\x67\x89\xab\xcd\xef\x01\x23\x45\x67\x89\xab\xcd\xef"));
EXPECT_EQ(
"0000 01 23 45 67 89 ab cd ef 01 23 45 67 89 ab cd ef .#Eg.....#Eg....\n"
"0010 01 23 45 67 89 ab cd ef 01 23 45 67 89 ab cd ef .#Eg.....#Eg....\n",
::tvm::support::hexdump("\x01\x23\x45\x67\x89\xab\xcd\xef\x01\x23\x45\x67\x89\xab\xcd\xef"
"\x01\x23\x45\x67\x89\xab\xcd\xef\x01\x23\x45\x67\x89\xab\xcd\xef"));
}

TEST(HexDumpTests, Unaligned) {
EXPECT_EQ("0000 01 23 45 67 89 ab cd ef 01 23 45 67 89 ab cd ef .#Eg.....#Eg....\n"
"0010 01 23 45 67 89 ab cd ef 01 .#Eg.....\n",
::tvm::support::hexdump("\x01\x23\x45\x67\x89\xab\xcd\xef\x01\x23\x45\x67\x89\xab\xcd\xef"
"\x01\x23\x45\x67\x89\xab\xcd\xef\x01"));
EXPECT_EQ(
"0000 01 23 45 67 89 ab cd ef 01 23 45 67 89 ab cd ef .#Eg.....#Eg....\n"
"0010 01 23 45 67 89 ab cd ef 01 .#Eg.....\n",
::tvm::support::hexdump("\x01\x23\x45\x67\x89\xab\xcd\xef\x01\x23\x45\x67\x89\xab\xcd\xef"
"\x01\x23\x45\x67\x89\xab\xcd\xef\x01"));
}

} // namespace test
Expand Down

0 comments on commit 755d3fa

Please sign in to comment.