mkvtoolnix/tests/unit/common/strings_formatting.cpp
Moritz Bunkus 3d045a14f3 unit tests: fix argument order of EXPECT_EQ()
The first argument is supposed to be the expected value, the second the
value calculated by the code to test.
2015-03-11 21:39:43 +01:00

25 lines
860 B
C++

#include "common/common_pch.h"
#include "common/strings/formatting.h"
#include "gtest/gtest.h"
namespace {
TEST(StringsFormatting, FileSize) {
EXPECT_EQ("1023 bytes", format_file_size( 1023ll));
EXPECT_EQ( "1.0 KiB", format_file_size( 1024ll));
EXPECT_EQ( "1.9 KiB", format_file_size( 2047ll));
EXPECT_EQ( "2.0 KiB", format_file_size( 2048ll));
EXPECT_EQ("1023.9 KiB", format_file_size( 1048575ll));
EXPECT_EQ( "1.0 MiB", format_file_size( 1048576ll));
EXPECT_EQ( "1.9 MiB", format_file_size( 2097151ll));
EXPECT_EQ( "2.0 MiB", format_file_size( 2097152ll));
EXPECT_EQ("1023.9 MiB", format_file_size(1073741823ll));
EXPECT_EQ( "1.0 GiB", format_file_size(1073741824ll));
EXPECT_EQ( "1.9 GiB", format_file_size(2147483647ll));
EXPECT_EQ( "2.0 GiB", format_file_size(2147483648ll));
}
}