18 #include <gtest/gtest.h>
26 TEST(PrettyPrinterTest, Unit) {
37 TEST(PrettyPrinterTest, UnitPerSecond) {
49 TEST(PrettyPrinterTest, CpuTicks) {
55 TEST(PrettyPrinterTest, Bytes) {
70 TEST(PrettyPrinterTest, BytesPerSecond) {
85 TEST(PrettyPrinterTest, Seconds) {
99 TEST(PrettyPrinterTest, NanoSeconds) {
105 TEST(PrettyPrinterTest, DoubleValue) {
109 TEST(PrettyPrinterTest, StringList) {
112 PrettyPrinter::PrintStringList(vals, TUnit::UNIT, &ss1);
113 EXPECT_EQ(ss1.str(),
"[]");
116 vals.push_back(1000);
117 vals.push_back(1000 * 1000);
119 PrettyPrinter::PrintStringList(vals, TUnit::UNIT, &ss2);
120 EXPECT_EQ(ss2.str(),
"[1, 1.00K, 1.00M]");
125 int main(
int argc,
char **argv) {
126 google::InitGoogleLogging(argv[0]);
127 ::testing::InitGoogleTest(&argc, argv);
129 return RUN_ALL_TESTS();
static std::string Print(bool value, TUnit::type ignored, bool verbose=false)
int main(int argc, char **argv)
static void Init()
Initialize CpuInfo.