Fix tests on systems with a non-master git defaultBranch #1

Open
zebreus wants to merge 140 commits from fix-tests-without-master into main
3 changed files with 4 additions and 2 deletions
Showing only changes of commit d6e1b11d3e - Show all commits

View file

@ -485,6 +485,7 @@ add_project_arguments(
# TODO(Qyriad): Yes this is how the autoconf+Make system did it. # TODO(Qyriad): Yes this is how the autoconf+Make system did it.
# It would be nice for our headers to be idempotent instead. # It would be nice for our headers to be idempotent instead.
'-include', 'config.h', '-include', 'config.h',
'-Wsign-compare',
'-Wno-deprecated-declarations', '-Wno-deprecated-declarations',
'-Wimplicit-fallthrough', '-Wimplicit-fallthrough',
'-Werror=switch', '-Werror=switch',

View file

@ -247,7 +247,7 @@ Worker::Results Worker::run(std::function<Targets (GoalFactory &)> req)
.exclusiveJoin(std::move(onInterrupt.promise)); .exclusiveJoin(std::move(onInterrupt.promise));
// TODO GC interface? // TODO GC interface?
if (auto localStore = dynamic_cast<LocalStore *>(&store); localStore && settings.minFree != 0) { if (auto localStore = dynamic_cast<LocalStore *>(&store); localStore && settings.minFree != 0u) {
// Periodically wake up to see if we need to run the garbage collector. // Periodically wake up to see if we need to run the garbage collector.
promise = promise.exclusiveJoin(boopGC(*localStore)); promise = promise.exclusiveJoin(boopGC(*localStore));
} }

View file

@ -1,4 +1,5 @@
#include "compression.hh" #include "compression.hh"
#include <cstddef>
#include <gtest/gtest.h> #include <gtest/gtest.h>
namespace nix { namespace nix {
@ -147,7 +148,7 @@ TEST_P(PerTypeNonNullCompressionTest, truncatedValidInput)
/* n.b. This also tests zero-length input, which is also invalid. /* n.b. This also tests zero-length input, which is also invalid.
* As of the writing of this comment, it returns empty output, but is * As of the writing of this comment, it returns empty output, but is
* allowed to throw a compression error instead. */ * allowed to throw a compression error instead. */
for (int i = 0; i < compressed.length(); ++i) { for (size_t i = 0u; i < compressed.length(); ++i) {
auto newCompressed = compressed.substr(compressed.length() - i); auto newCompressed = compressed.substr(compressed.length() - i);
try { try {
decompress(method, newCompressed); decompress(method, newCompressed);