|
- #include <gtest/gtest.h>
- #include <cppcore/misc/hexdump.h>
-
- using namespace ::cppcore;
- using namespace ::testing;
-
- TEST(hexdump_tests, simple)
- {
- std::string s("ahgiupiPTIBPHgGHIbt974ht hPVIb pg ZTPGTiBGBKGSGSQT20Z4TNVK AQHZQ");
- std::ostringstream ss;
- ss << hexdump(s.data(), s.size(), 123, 4);
- EXPECT_EQ(
- ss.str(),
- "0000007b 61 68 67 69 75 70 69 50 54 49 42 50 48 67 47 48 |ahgi|upiP|TIBP|HgGH|\n"
- "0000008b 49 62 74 39 37 34 68 74 20 68 50 56 49 62 20 70 |Ibt9|74ht| hPV|Ib p|\n"
- "0000009b 67 20 5a 54 50 47 54 69 42 47 42 4b 47 53 47 53 |g ZT|PGTi|BGBK|GSGS|\n"
- "000000ab 51 54 32 30 5a 34 54 4e 56 4b 20 20 41 51 48 5a |QT20|Z4TN|VK |AQHZ|\n"
- "000000bb 51 |Q |");
- }
|