Skip to content

Commit

Permalink
unittest_compression: naming nit
Browse files Browse the repository at this point in the history
Signed-off-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Oct 7, 2016
1 parent 46b67f3 commit 90de6e0
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/test/compressor/test_compression.cc
Expand Up @@ -25,14 +25,14 @@
#include "common/config.h"
#include "compressor/CompressionPlugin.h"

class CompressionTest : public ::testing::Test,
class CompressorTest : public ::testing::Test,
public ::testing::WithParamInterface<const char*> {
public:
std::string plugin;
CompressorRef compressor;
bool old_zlib_isal;

CompressionTest() {
CompressorTest() {
// note for later
old_zlib_isal = g_conf->compressor_zlib_isal;

Expand All @@ -53,7 +53,7 @@ class CompressionTest : public ::testing::Test,
}
cout << "[plugin " << plugin << " (" << GetParam() << ")]" << std::endl;
}
~CompressionTest() {
~CompressorTest() {
g_conf->set_val("compressor_zlib_isal", old_zlib_isal ? "true" : "false");
g_ceph_context->_conf->apply_changes(NULL);
}
Expand All @@ -67,11 +67,11 @@ class CompressionTest : public ::testing::Test,
}
};

TEST_P(CompressionTest, load_plugin)
TEST_P(CompressorTest, load_plugin)
{
}

TEST_P(CompressionTest, small_round_trip)
TEST_P(CompressorTest, small_round_trip)
{
bufferlist orig;
orig.append("This is a short string. There are many strings like it but this one is mine.");
Expand All @@ -87,7 +87,7 @@ TEST_P(CompressionTest, small_round_trip)
<< " with " << GetParam() << std::endl;
}

TEST_P(CompressionTest, big_round_trip_repeated)
TEST_P(CompressorTest, big_round_trip_repeated)
{
unsigned len = 1048576 * 4;
bufferlist orig;
Expand All @@ -106,7 +106,7 @@ TEST_P(CompressionTest, big_round_trip_repeated)
<< " with " << GetParam() << std::endl;
}

TEST_P(CompressionTest, big_round_trip_randomish)
TEST_P(CompressorTest, big_round_trip_randomish)
{
unsigned len = 1048576 * 100;//269;
bufferlist orig;
Expand Down Expand Up @@ -136,7 +136,7 @@ TEST_P(CompressionTest, big_round_trip_randomish)
}

#if 0
TEST_P(CompressionTest, big_round_trip_file)
TEST_P(CompressorTest, big_round_trip_file)
{
bufferlist orig;
int fd = ::open("bin/ceph-osd", O_RDONLY);
Expand All @@ -158,7 +158,7 @@ TEST_P(CompressionTest, big_round_trip_file)
#endif


TEST_P(CompressionTest, compress_decompress)
TEST_P(CompressorTest, compress_decompress)
{
const char* test = "This is test text";
int res;
Expand Down Expand Up @@ -207,7 +207,7 @@ TEST_P(CompressionTest, compress_decompress)
EXPECT_TRUE(exp.contents_equal(after));
}

TEST_P(CompressionTest, sharded_input_decompress)
TEST_P(CompressorTest, sharded_input_decompress)
{
const size_t small_prefix_size=3;

Expand Down Expand Up @@ -269,60 +269,60 @@ void test_decompress(CompressorRef compressor, size_t size)
}
}

TEST_P(CompressionTest, compress_1024)
TEST_P(CompressorTest, compress_1024)
{
test_compress(compressor, 1024);
}

TEST_P(CompressionTest, compress_2048)
TEST_P(CompressorTest, compress_2048)
{
test_compress(compressor, 2048);
}

TEST_P(CompressionTest, compress_4096)
TEST_P(CompressorTest, compress_4096)
{
test_compress(compressor, 4096);
}

TEST_P(CompressionTest, compress_8192)
TEST_P(CompressorTest, compress_8192)
{
test_compress(compressor, 8192);
}

TEST_P(CompressionTest, compress_16384)
TEST_P(CompressorTest, compress_16384)
{
test_compress(compressor, 16384);
}

TEST_P(CompressionTest, decompress_1024)
TEST_P(CompressorTest, decompress_1024)
{
test_decompress(compressor, 1024);
}

TEST_P(CompressionTest, decompress_2048)
TEST_P(CompressorTest, decompress_2048)
{
test_decompress(compressor, 2048);
}

TEST_P(CompressionTest, decompress_4096)
TEST_P(CompressorTest, decompress_4096)
{
test_decompress(compressor, 4096);
}

TEST_P(CompressionTest, decompress_8192)
TEST_P(CompressorTest, decompress_8192)
{
test_decompress(compressor, 8192);
}

TEST_P(CompressionTest, decompress_16384)
TEST_P(CompressorTest, decompress_16384)
{
test_decompress(compressor, 16384);
}


INSTANTIATE_TEST_CASE_P(
Compression,
CompressionTest,
Compressor,
CompressorTest,
::testing::Values(
// "zlib/isal",
"zlib/noisal",
Expand Down

0 comments on commit 90de6e0

Please sign in to comment.