Clean imports and shorten tests

This commit is contained in:
Nick Terrell 2017-01-26 20:47:59 -08:00
parent 9c018cc140
commit 58f499c41e
4 changed files with 32 additions and 43 deletions

View File

@ -37,8 +37,8 @@ class Logger {
return level <= level_; return level <= level_;
} }
template <typename... Args> template <typename String, typename... Args>
void operator()(int level, const char *fmt, Args... args) { void operator()(int level, String fmt, Args... args) {
if (level > level_) { if (level > level_) {
return; return;
} }

View File

@ -7,6 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
#include "Options.h" #include "Options.h"
#include "util.h"
#include "utils/ScopeGuard.h" #include "utils/ScopeGuard.h"
#include <algorithm> #include <algorithm>
@ -15,7 +16,6 @@
#include <cstring> #include <cstring>
#include <iterator> #include <iterator>
#include <thread> #include <thread>
#include <util.h>
#include <vector> #include <vector>
#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32) || \ #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32) || \

View File

@ -9,11 +9,6 @@
#include "ErrorHolder.h" #include "ErrorHolder.h"
#include "Options.h" #include "Options.h"
#include "Pzstd.h" #include "Pzstd.h"
#include "utils/FileSystem.h"
#include "utils/Range.h"
#include "utils/ScopeGuard.h"
#include "utils/ThreadPool.h"
#include "utils/WorkQueue.h"
using namespace pzstd; using namespace pzstd;

View File

@ -41,11 +41,9 @@ TEST(Pzstd, SmallSizes) {
std::fclose(fd); std::fclose(fd);
ASSERT_EQ(written, len); ASSERT_EQ(written, len);
} }
for (unsigned headers = 0; headers <= 1; ++headers) {
for (unsigned numThreads = 1; numThreads <= 2; ++numThreads) { for (unsigned numThreads = 1; numThreads <= 2; ++numThreads) {
for (unsigned level = 1; level <= 4; level *= 4) { for (unsigned level = 1; level <= 4; level *= 4) {
auto errorGuard = makeScopeGuard([&] { auto errorGuard = makeScopeGuard([&] {
std::fprintf(stderr, "pzstd headers: %u\n", headers);
std::fprintf(stderr, "# threads: %u\n", numThreads); std::fprintf(stderr, "# threads: %u\n", numThreads);
std::fprintf(stderr, "compression level: %u\n", level); std::fprintf(stderr, "compression level: %u\n", level);
}); });
@ -61,7 +59,6 @@ TEST(Pzstd, SmallSizes) {
} }
} }
} }
}
TEST(Pzstd, LargeSizes) { TEST(Pzstd, LargeSizes) {
unsigned seed = std::random_device{}(); unsigned seed = std::random_device{}();
@ -79,11 +76,9 @@ TEST(Pzstd, LargeSizes) {
std::fclose(fd); std::fclose(fd);
ASSERT_EQ(written, len); ASSERT_EQ(written, len);
} }
for (unsigned headers = 0; headers <= 1; ++headers) {
for (unsigned numThreads = 1; numThreads <= 16; numThreads *= 4) { for (unsigned numThreads = 1; numThreads <= 16; numThreads *= 4) {
for (unsigned level = 1; level <= 4; level *= 2) { for (unsigned level = 1; level <= 4; level *= 4) {
auto errorGuard = makeScopeGuard([&] { auto errorGuard = makeScopeGuard([&] {
std::fprintf(stderr, "pzstd headers: %u\n", headers);
std::fprintf(stderr, "# threads: %u\n", numThreads); std::fprintf(stderr, "# threads: %u\n", numThreads);
std::fprintf(stderr, "compression level: %u\n", level); std::fprintf(stderr, "compression level: %u\n", level);
}); });
@ -99,9 +94,8 @@ TEST(Pzstd, LargeSizes) {
} }
} }
} }
}
TEST(Pzstd, ExtremelyLargeSize) { TEST(Pzstd, DISABLED_ExtremelyLargeSize) {
unsigned seed = std::random_device{}(); unsigned seed = std::random_device{}();
std::fprintf(stderr, "Pzstd.ExtremelyLargeSize seed: %u\n", seed); std::fprintf(stderr, "Pzstd.ExtremelyLargeSize seed: %u\n", seed);
std::mt19937 gen(seed); std::mt19937 gen(seed);