aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/src/firebase/firestore/geo_point.cc
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-05-22 13:21:08 -0700
committerGravatar GitHub <noreply@github.com>2018-05-22 13:21:08 -0700
commitd439bbccd4b90583a89d209d2cc81308aabca8ac (patch)
tree13fb14cc905f667e1470bcc14a3c84dfb6a7a109 /Firestore/core/src/firebase/firestore/geo_point.cc
parent476be0ba2ba8340296a5b5b05f27f3ded4bd6c72 (diff)
Add a HARD_ASSERT C++ assertion macro (#1304)
* Add HARD_ASSERT * Use HARD_ASSERT * Remove FIREBASE_ASSERT * Remove StringPrintf
Diffstat (limited to 'Firestore/core/src/firebase/firestore/geo_point.cc')
-rw-r--r--Firestore/core/src/firebase/firestore/geo_point.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/Firestore/core/src/firebase/firestore/geo_point.cc b/Firestore/core/src/firebase/firestore/geo_point.cc
index 5aae156..393b8f2 100644
--- a/Firestore/core/src/firebase/firestore/geo_point.cc
+++ b/Firestore/core/src/firebase/firestore/geo_point.cc
@@ -18,7 +18,7 @@
#include <cmath>
-#include "Firestore/core/src/firebase/firestore/util/firebase_assert.h"
+#include "Firestore/core/src/firebase/firestore/util/hard_assert.h"
namespace firebase {
namespace firestore {
@@ -28,14 +28,10 @@ GeoPoint::GeoPoint() : GeoPoint(0, 0) {
GeoPoint::GeoPoint(double latitude, double longitude)
: latitude_(latitude), longitude_(longitude) {
- FIREBASE_ASSERT_MESSAGE_WITH_EXPRESSION(
- !std::isnan(latitude) && -90 <= latitude && latitude <= 90,
- -90 <= latitude && latitude <= 90,
- "Latitude must be in the range of [-90, 90]");
- FIREBASE_ASSERT_MESSAGE_WITH_EXPRESSION(
- !std::isnan(longitude) && -180 <= longitude && longitude <= 180,
- -180 <= longitude && longitude <= 180,
- "Latitude must be in the range of [-180, 180]");
+ HARD_ASSERT(!std::isnan(latitude) && -90 <= latitude && latitude <= 90,
+ "Latitude must be in the range of [-90, 90]");
+ HARD_ASSERT(!std::isnan(longitude) && -180 <= longitude && longitude <= 180,
+ "Latitude must be in the range of [-180, 180]");
}
bool operator<(const GeoPoint& lhs, const GeoPoint& rhs) {