diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-01-21 16:32:49 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-01-21 16:32:49 -0800 |
commit | 45a8edbd5ae6c836317923dc7d2b5baac9feea98 (patch) | |
tree | c8e011c89c1808fe2e520ee41c9bcb2af7911cd0 /test/util/test_util.h | |
parent | b3405a719cbb33dac2deced192209a5584e5e3d6 (diff) | |
parent | 200cf245c4ed43d8e2a37484cdbc36f5fbfa1ac9 (diff) |
Merge pull request #1492 from majek:err_typo_in_netstack_tests
PiperOrigin-RevId: 290840370
Diffstat (limited to 'test/util/test_util.h')
-rw-r--r-- | test/util/test_util.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/util/test_util.h b/test/util/test_util.h index b3235c7e3..6eb46ac76 100644 --- a/test/util/test_util.h +++ b/test/util/test_util.h @@ -264,7 +264,7 @@ std::ostream& operator<<(std::ostream& out, OpenFd const& ofd); PosixErrorOr<std::vector<OpenFd>> GetOpenFDs(); // Returns the number of hard links to a path. -PosixErrorOr<uint64_t> Links(const std::string& path); +PosixErrorOr<uint64> Links(const std::string& path); namespace internal { @@ -706,7 +706,7 @@ inline PosixErrorOr<T> Atoi(absl::string_view str) { return ret; } -inline PosixErrorOr<uint64_t> AtoiBase(absl::string_view str, int base) { +inline PosixErrorOr<uint64> AtoiBase(absl::string_view str, int base) { if (base > 255 || base < 2) { return PosixError(EINVAL, "Invalid Base"); } @@ -737,16 +737,16 @@ inline PosixErrorOr<float> Atof(absl::string_view str) { // Return the smallest number of iovec arrays that can be used to write // "total_bytes" number of bytes, each iovec writing one "buf". -std::vector<std::vector<struct iovec>> GenerateIovecs(uint64_t total_size, +std::vector<std::vector<struct iovec>> GenerateIovecs(uint64 total_size, void* buf, size_t buflen); // Returns bytes in 'n' megabytes. Used for readability. -uint64_t Megabytes(uint64_t n); +uint64 Megabytes(uint64 n); // Predicate for checking that a value is within some tolerance of another // value. Returns true iff current is in the range [target * (1 - tolerance), // target * (1 + tolerance)]. -bool Equivalent(uint64_t current, uint64_t target, double tolerance); +bool Equivalent(uint64 current, uint64 target, double tolerance); // Matcher wrapping the Equivalent predicate. MATCHER_P2(EquivalentWithin, target, tolerance, @@ -756,7 +756,7 @@ MATCHER_P2(EquivalentWithin, target, tolerance, if (target == 0) { *result_listener << ::absl::StreamFormat("difference of infinity%%"); } else { - int64_t delta = static_cast<int64_t>(arg) - static_cast<int64_t>(target); + int64 delta = static_cast<int64>(arg) - static_cast<int64>(target); double delta_percent = static_cast<double>(delta) / static_cast<double>(target) * 100; *result_listener << ::absl::StreamFormat("difference of %.2f%%", |