Flutter Engine
 
Loading...
Searching...
No Matches
assertions.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_TESTING_ASSERTIONS_H_
6#define FLUTTER_TESTING_ASSERTIONS_H_
7
8#include <type_traits>
9
10namespace flutter::testing {
11
12inline bool NumberNear(double a, double b) {
13 static const double epsilon = 1e-3;
14 return (a > (b - epsilon)) && (a < (b + epsilon));
15}
16
17} // namespace flutter::testing
18
19#endif // FLUTTER_TESTING_ASSERTIONS_H_
bool NumberNear(double a, double b)
Definition assertions.h:12