Skip to content

Commit

Permalink
split testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed Jan 1, 2019
1 parent 994c290 commit ba22e88
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/unit_tests.cpp
Expand Up @@ -203,11 +203,27 @@ IUTEST(UnitTest, FormatSizeByte)
{
IUTEST_EXPECT_STREQ("0B", ::iutest::detail::FormatSizeByte(0));
IUTEST_EXPECT_STREQ("2B", ::iutest::detail::FormatSizeByte(2));
}

IUTEST(UnitTest, FormatSizeKByte)
{
IUTEST_EXPECT_STREQ("1KB", ::iutest::detail::FormatSizeByte(1024));
IUTEST_EXPECT_STREQ("1.0KB", ::iutest::detail::FormatSizeByte(1025));
}

IUTEST(UnitTest, FormatSizeMByte)
{
IUTEST_EXPECT_STREQ("1MB", ::iutest::detail::FormatSizeByte(1024 * 1024));
IUTEST_EXPECT_STREQ("1.9MB", ::iutest::detail::FormatSizeByte(2 * 1024 * 1024 - 1));
}

IUTEST(UnitTest, FormatSizeGByte)
{
IUTEST_EXPECT_STREQ("1GB", ::iutest::detail::FormatSizeByte(1024 * 1024 * 1024));
}

IUTEST(UnitTest, FormatSizeTByte)
{
IUTEST_EXPECT_STREQ("1TB", ::iutest::detail::FormatSizeByte(1024ull * 1024 * 1024 * 1024));
IUTEST_EXPECT_STREQ("1024TB", ::iutest::detail::FormatSizeByte(1024ull * 1024 * 1024 * 1024 * 1024));
}
Expand Down

0 comments on commit ba22e88

Please sign in to comment.