From d74a94af904c101530cc11d65e8de2f216cfc430 Mon Sep 17 00:00:00 2001 From: zxu123 Date: Wed, 7 Feb 2018 13:28:59 -0500 Subject: [PATCH 1/4] implement SnapshotVersion and test --- .../firebase/firestore/core/CMakeLists.txt | 2 + .../firestore/core/snapshot_version.cc | 36 +++++++++ .../firestore/core/snapshot_version.h | 75 +++++++++++++++++++ .../firebase/firestore/core/CMakeLists.txt | 1 + .../firestore/core/snapshot_version_test.cc | 58 ++++++++++++++ 5 files changed, 172 insertions(+) create mode 100644 Firestore/core/src/firebase/firestore/core/snapshot_version.cc create mode 100644 Firestore/core/src/firebase/firestore/core/snapshot_version.h create mode 100644 Firestore/core/test/firebase/firestore/core/snapshot_version_test.cc diff --git a/Firestore/core/src/firebase/firestore/core/CMakeLists.txt b/Firestore/core/src/firebase/firestore/core/CMakeLists.txt index cf3cafec2da..f4bdacdc2d3 100644 --- a/Firestore/core/src/firebase/firestore/core/CMakeLists.txt +++ b/Firestore/core/src/firebase/firestore/core/CMakeLists.txt @@ -17,6 +17,8 @@ cc_library( SOURCES database_info.cc database_info.h + snapshot_version.cc + snapshot_version.h target_id_generator.cc target_id_generator.h DEPENDS diff --git a/Firestore/core/src/firebase/firestore/core/snapshot_version.cc b/Firestore/core/src/firebase/firestore/core/snapshot_version.cc new file mode 100644 index 00000000000..72dd070f111 --- /dev/null +++ b/Firestore/core/src/firebase/firestore/core/snapshot_version.cc @@ -0,0 +1,36 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/firebase/firestore/core/snapshot_version.h" + +namespace firebase { +namespace firestore { +namespace core { + +using firebase::firestore::model::Timestamp; + +SnapshotVersion::SnapshotVersion(const Timestamp& timestamp) + : timestamp_(timestamp) { +} + +const SnapshotVersion& SnapshotVersion::NoVersion() { + static const SnapshotVersion kNoVersion(Timestamp{}); + return kNoVersion; +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/Firestore/core/src/firebase/firestore/core/snapshot_version.h b/Firestore/core/src/firebase/firestore/core/snapshot_version.h new file mode 100644 index 00000000000..1383c6b34bd --- /dev/null +++ b/Firestore/core/src/firebase/firestore/core/snapshot_version.h @@ -0,0 +1,75 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_SNAPSHOT_VERSION_H_ +#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_SNAPSHOT_VERSION_H_ + +#include "Firestore/core/src/firebase/firestore/model/timestamp.h" + +namespace firebase { +namespace firestore { +namespace core { + +/** + * A version of a document in Firestore. This corresponds to the version + * timestamp, such as update_time or read_time. + */ +class SnapshotVersion { + public: + explicit SnapshotVersion( + const firebase::firestore::model::Timestamp& timestamp); + + const firebase::firestore::model::Timestamp& timestamp() const { + return timestamp_; + } + + /** Creates a new version that is smaller than all other versions. */ + static const SnapshotVersion& NoVersion(); + + private: + firebase::firestore::model::Timestamp timestamp_; +}; + +/** Compares against another SnapshotVersion. */ +inline bool operator<(const SnapshotVersion& lhs, const SnapshotVersion& rhs) { + return lhs.timestamp() < rhs.timestamp(); +} + +inline bool operator>(const SnapshotVersion& lhs, const SnapshotVersion& rhs) { + return lhs.timestamp() > rhs.timestamp(); +} + +inline bool operator>=(const SnapshotVersion& lhs, const SnapshotVersion& rhs) { + return lhs.timestamp() >= rhs.timestamp(); +} + +inline bool operator<=(const SnapshotVersion& lhs, const SnapshotVersion& rhs) { + return lhs.timestamp() <= rhs.timestamp(); +} + +inline bool operator!=(const SnapshotVersion& lhs, const SnapshotVersion& rhs) { + return lhs.timestamp() != rhs.timestamp(); +} + +inline bool operator==(const SnapshotVersion& lhs, const SnapshotVersion& rhs) { + return lhs.timestamp() == rhs.timestamp(); +} + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_SNAPSHOT_VERSION_H_ diff --git a/Firestore/core/test/firebase/firestore/core/CMakeLists.txt b/Firestore/core/test/firebase/firestore/core/CMakeLists.txt index 5b4c55aea70..3e62e5ff07d 100644 --- a/Firestore/core/test/firebase/firestore/core/CMakeLists.txt +++ b/Firestore/core/test/firebase/firestore/core/CMakeLists.txt @@ -16,6 +16,7 @@ cc_test( firebase_firestore_core_test SOURCES database_info_test.cc + snapshot_version_test.cc target_id_generator_test.cc DEPENDS firebase_firestore_core diff --git a/Firestore/core/test/firebase/firestore/core/snapshot_version_test.cc b/Firestore/core/test/firebase/firestore/core/snapshot_version_test.cc new file mode 100644 index 00000000000..86377768ee7 --- /dev/null +++ b/Firestore/core/test/firebase/firestore/core/snapshot_version_test.cc @@ -0,0 +1,58 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/firebase/firestore/core/snapshot_version.h" + +#include "gtest/gtest.h" + +namespace firebase { +namespace firestore { +namespace core { + +using firebase::firestore::model::Timestamp; + +TEST(SnapshotVersion, Getter) { + SnapshotVersion version(Timestamp(123, 456)); + EXPECT_EQ(Timestamp(123, 456), version.timestamp()); + + const SnapshotVersion& no_version = SnapshotVersion::NoVersion(); + EXPECT_EQ(Timestamp(), no_version.timestamp()); +} + +TEST(SnapshotVersion, Comparison) { + EXPECT_LT(SnapshotVersion::NoVersion(), SnapshotVersion(Timestamp(123, 456))); + + EXPECT_LT(SnapshotVersion(Timestamp(123, 456)), + SnapshotVersion(Timestamp(456, 123))); + EXPECT_GT(SnapshotVersion(Timestamp(456, 123)), + SnapshotVersion(Timestamp(123, 456))); + EXPECT_LE(SnapshotVersion(Timestamp(123, 456)), + SnapshotVersion(Timestamp(456, 123))); + EXPECT_LE(SnapshotVersion(Timestamp(123, 456)), + SnapshotVersion(Timestamp(123, 456))); + EXPECT_GE(SnapshotVersion(Timestamp(456, 123)), + SnapshotVersion(Timestamp(123, 456))); + EXPECT_GE(SnapshotVersion(Timestamp(123, 456)), + SnapshotVersion(Timestamp(123, 456))); + EXPECT_EQ(SnapshotVersion(Timestamp(123, 456)), + SnapshotVersion(Timestamp(123, 456))); + EXPECT_NE(SnapshotVersion(Timestamp(123, 456)), + SnapshotVersion(Timestamp(456, 123))); +} + +} // namespace core +} // namespace firestore +} // namespace firebase From 3596c884c56800d59af30972c8c7acc7d80c0bf3 Mon Sep 17 00:00:00 2001 From: zxu123 Date: Wed, 7 Feb 2018 13:36:14 -0500 Subject: [PATCH 2/4] update project --- Firestore/Example/Firestore.xcodeproj/project.pbxproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Firestore/Example/Firestore.xcodeproj/project.pbxproj b/Firestore/Example/Firestore.xcodeproj/project.pbxproj index 8d99eb6aa7c..50becbd8eab 100644 --- a/Firestore/Example/Firestore.xcodeproj/project.pbxproj +++ b/Firestore/Example/Firestore.xcodeproj/project.pbxproj @@ -141,6 +141,7 @@ AB380D04201BC6E400D97691 /* ordered_code_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB380D03201BC6E400D97691 /* ordered_code_test.cc */; }; AB38D93020236E21000A432D /* database_info_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB38D92E20235D22000A432D /* database_info_test.cc */; }; AB7BAB342012B519001E0872 /* geo_point_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB7BAB332012B519001E0872 /* geo_point_test.cc */; }; + ABA495BB202B7E80008A7851 /* snapshot_version_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = ABA495B9202B7E79008A7851 /* snapshot_version_test.cc */; }; ABE6637A201FA81900ED349A /* database_id_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB71064B201FA60300344F18 /* database_id_test.cc */; }; ABF6506C201131F8005F2C74 /* timestamp_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = ABF6506B201131F8005F2C74 /* timestamp_test.cc */; }; AFE6114F0D4DAECBA7B7C089 /* Pods_Firestore_IntegrationTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2FA635DF5D116A67A7441CD /* Pods_Firestore_IntegrationTests.framework */; }; @@ -338,6 +339,7 @@ AB38D92E20235D22000A432D /* database_info_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = database_info_test.cc; sourceTree = ""; }; AB71064B201FA60300344F18 /* database_id_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = database_id_test.cc; sourceTree = ""; }; AB7BAB332012B519001E0872 /* geo_point_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = geo_point_test.cc; path = ../../core/test/firebase/firestore/geo_point_test.cc; sourceTree = ""; }; + ABA495B9202B7E79008A7851 /* snapshot_version_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = snapshot_version_test.cc; sourceTree = ""; }; ABF6506B201131F8005F2C74 /* timestamp_test.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = timestamp_test.cc; sourceTree = ""; }; B2FA635DF5D116A67A7441CD /* Pods_Firestore_IntegrationTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Firestore_IntegrationTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B686F2AD2023DDB20028D6BE /* field_path_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = field_path_test.cc; sourceTree = ""; }; @@ -584,6 +586,7 @@ children = ( AB380CF82019382300D97691 /* target_id_generator_test.cc */, AB38D92E20235D22000A432D /* database_info_test.cc */, + ABA495B9202B7E79008A7851 /* snapshot_version_test.cc */, ); name = core; path = ../../core/test/firebase/firestore/core; @@ -1300,6 +1303,7 @@ 5492E0AE2021552D00B64F25 /* FSTLevelDBQueryCacheTests.mm in Sources */, 5492E059202154AB00B64F25 /* FIRQuerySnapshotTests.mm in Sources */, 5492E050202154AA00B64F25 /* FIRCollectionReferenceTests.mm in Sources */, + ABA495BB202B7E80008A7851 /* snapshot_version_test.cc in Sources */, 5492E0A02021552D00B64F25 /* FSTLevelDBMutationQueueTests.mm in Sources */, 54EB764D202277B30088B8F3 /* array_sorted_map_test.cc in Sources */, 5492E03420213FFC00B64F25 /* FSTMemorySpecTests.mm in Sources */, From 8c048df66f74e3c6e2d34f41415dbbfef28bc1a5 Mon Sep 17 00:00:00 2001 From: zxu123 Date: Wed, 7 Feb 2018 14:43:44 -0500 Subject: [PATCH 3/4] move snapshot-version from core to model --- .../Firestore.xcodeproj/project.pbxproj | 2 +- .../firebase/firestore/core/CMakeLists.txt | 2 -- .../firebase/firestore/model/CMakeLists.txt | 2 ++ .../{core => model}/snapshot_version.cc | 14 ++++++-------- .../{core => model}/snapshot_version.h | 19 +++++++++---------- .../firebase/firestore/core/CMakeLists.txt | 1 - .../firebase/firestore/model/CMakeLists.txt | 1 + .../{core => model}/snapshot_version_test.cc | 8 +++----- 8 files changed, 22 insertions(+), 27 deletions(-) rename Firestore/core/src/firebase/firestore/{core => model}/snapshot_version.cc (73%) rename Firestore/core/src/firebase/firestore/{core => model}/snapshot_version.h (78%) rename Firestore/core/test/firebase/firestore/{core => model}/snapshot_version_test.cc (92%) diff --git a/Firestore/Example/Firestore.xcodeproj/project.pbxproj b/Firestore/Example/Firestore.xcodeproj/project.pbxproj index 50becbd8eab..0832b2e569f 100644 --- a/Firestore/Example/Firestore.xcodeproj/project.pbxproj +++ b/Firestore/Example/Firestore.xcodeproj/project.pbxproj @@ -575,6 +575,7 @@ B686F2AD2023DDB20028D6BE /* field_path_test.cc */, AB71064B201FA60300344F18 /* database_id_test.cc */, AB356EF6200EA5EB0089B766 /* field_value_test.cc */, + ABA495B9202B7E79008A7851 /* snapshot_version_test.cc */, ABF6506B201131F8005F2C74 /* timestamp_test.cc */, ); name = model; @@ -586,7 +587,6 @@ children = ( AB380CF82019382300D97691 /* target_id_generator_test.cc */, AB38D92E20235D22000A432D /* database_info_test.cc */, - ABA495B9202B7E79008A7851 /* snapshot_version_test.cc */, ); name = core; path = ../../core/test/firebase/firestore/core; diff --git a/Firestore/core/src/firebase/firestore/core/CMakeLists.txt b/Firestore/core/src/firebase/firestore/core/CMakeLists.txt index f4bdacdc2d3..cf3cafec2da 100644 --- a/Firestore/core/src/firebase/firestore/core/CMakeLists.txt +++ b/Firestore/core/src/firebase/firestore/core/CMakeLists.txt @@ -17,8 +17,6 @@ cc_library( SOURCES database_info.cc database_info.h - snapshot_version.cc - snapshot_version.h target_id_generator.cc target_id_generator.h DEPENDS diff --git a/Firestore/core/src/firebase/firestore/model/CMakeLists.txt b/Firestore/core/src/firebase/firestore/model/CMakeLists.txt index 8bdbe18d4e5..f790ca0b7f3 100644 --- a/Firestore/core/src/firebase/firestore/model/CMakeLists.txt +++ b/Firestore/core/src/firebase/firestore/model/CMakeLists.txt @@ -22,6 +22,8 @@ cc_library( field_path.h field_value.cc field_value.h + snapshot_version.cc + snapshot_version.h timestamp.cc timestamp.h DEPENDS diff --git a/Firestore/core/src/firebase/firestore/core/snapshot_version.cc b/Firestore/core/src/firebase/firestore/model/snapshot_version.cc similarity index 73% rename from Firestore/core/src/firebase/firestore/core/snapshot_version.cc rename to Firestore/core/src/firebase/firestore/model/snapshot_version.cc index 72dd070f111..114e313f4cc 100644 --- a/Firestore/core/src/firebase/firestore/core/snapshot_version.cc +++ b/Firestore/core/src/firebase/firestore/model/snapshot_version.cc @@ -14,23 +14,21 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/snapshot_version.h" +#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" namespace firebase { namespace firestore { -namespace core { - -using firebase::firestore::model::Timestamp; +namespace model { SnapshotVersion::SnapshotVersion(const Timestamp& timestamp) : timestamp_(timestamp) { } -const SnapshotVersion& SnapshotVersion::NoVersion() { - static const SnapshotVersion kNoVersion(Timestamp{}); - return kNoVersion; +const SnapshotVersion& SnapshotVersion::None() { + static const SnapshotVersion kNone(Timestamp{}); + return kNone; } -} // namespace core +} // namespace model } // namespace firestore } // namespace firebase diff --git a/Firestore/core/src/firebase/firestore/core/snapshot_version.h b/Firestore/core/src/firebase/firestore/model/snapshot_version.h similarity index 78% rename from Firestore/core/src/firebase/firestore/core/snapshot_version.h rename to Firestore/core/src/firebase/firestore/model/snapshot_version.h index 1383c6b34bd..70f6f4a12ec 100644 --- a/Firestore/core/src/firebase/firestore/core/snapshot_version.h +++ b/Firestore/core/src/firebase/firestore/model/snapshot_version.h @@ -14,14 +14,14 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_SNAPSHOT_VERSION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_SNAPSHOT_VERSION_H_ +#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_SNAPSHOT_VERSION_H_ +#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_SNAPSHOT_VERSION_H_ #include "Firestore/core/src/firebase/firestore/model/timestamp.h" namespace firebase { namespace firestore { -namespace core { +namespace model { /** * A version of a document in Firestore. This corresponds to the version @@ -29,18 +29,17 @@ namespace core { */ class SnapshotVersion { public: - explicit SnapshotVersion( - const firebase::firestore::model::Timestamp& timestamp); + explicit SnapshotVersion(const Timestamp& timestamp); - const firebase::firestore::model::Timestamp& timestamp() const { + const Timestamp& timestamp() const { return timestamp_; } /** Creates a new version that is smaller than all other versions. */ - static const SnapshotVersion& NoVersion(); + static const SnapshotVersion& None(); private: - firebase::firestore::model::Timestamp timestamp_; + Timestamp timestamp_; }; /** Compares against another SnapshotVersion. */ @@ -68,8 +67,8 @@ inline bool operator==(const SnapshotVersion& lhs, const SnapshotVersion& rhs) { return lhs.timestamp() == rhs.timestamp(); } -} // namespace core +} // namespace model } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_SNAPSHOT_VERSION_H_ +#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_SNAPSHOT_VERSION_H_ diff --git a/Firestore/core/test/firebase/firestore/core/CMakeLists.txt b/Firestore/core/test/firebase/firestore/core/CMakeLists.txt index 3e62e5ff07d..5b4c55aea70 100644 --- a/Firestore/core/test/firebase/firestore/core/CMakeLists.txt +++ b/Firestore/core/test/firebase/firestore/core/CMakeLists.txt @@ -16,7 +16,6 @@ cc_test( firebase_firestore_core_test SOURCES database_info_test.cc - snapshot_version_test.cc target_id_generator_test.cc DEPENDS firebase_firestore_core diff --git a/Firestore/core/test/firebase/firestore/model/CMakeLists.txt b/Firestore/core/test/firebase/firestore/model/CMakeLists.txt index 63ed813b2e4..282befde2e1 100644 --- a/Firestore/core/test/firebase/firestore/model/CMakeLists.txt +++ b/Firestore/core/test/firebase/firestore/model/CMakeLists.txt @@ -18,6 +18,7 @@ cc_test( database_id_test.cc field_path_test.cc field_value_test.cc + snapshot_version_test.cc timestamp_test.cc resource_path_test.cc DEPENDS diff --git a/Firestore/core/test/firebase/firestore/core/snapshot_version_test.cc b/Firestore/core/test/firebase/firestore/model/snapshot_version_test.cc similarity index 92% rename from Firestore/core/test/firebase/firestore/core/snapshot_version_test.cc rename to Firestore/core/test/firebase/firestore/model/snapshot_version_test.cc index 86377768ee7..6e3071751df 100644 --- a/Firestore/core/test/firebase/firestore/core/snapshot_version_test.cc +++ b/Firestore/core/test/firebase/firestore/model/snapshot_version_test.cc @@ -14,15 +14,13 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/snapshot_version.h" +#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" #include "gtest/gtest.h" namespace firebase { namespace firestore { -namespace core { - -using firebase::firestore::model::Timestamp; +namespace model { TEST(SnapshotVersion, Getter) { SnapshotVersion version(Timestamp(123, 456)); @@ -53,6 +51,6 @@ TEST(SnapshotVersion, Comparison) { SnapshotVersion(Timestamp(456, 123))); } -} // namespace core +} // namespace model } // namespace firestore } // namespace firebase From 2a180207b64b68ba88a1d87f0a61e86c0cb79e65 Mon Sep 17 00:00:00 2001 From: zxu123 Date: Wed, 7 Feb 2018 14:46:40 -0500 Subject: [PATCH 4/4] fix a bug --- .../test/firebase/firestore/model/snapshot_version_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firestore/core/test/firebase/firestore/model/snapshot_version_test.cc b/Firestore/core/test/firebase/firestore/model/snapshot_version_test.cc index 6e3071751df..e359f8449a7 100644 --- a/Firestore/core/test/firebase/firestore/model/snapshot_version_test.cc +++ b/Firestore/core/test/firebase/firestore/model/snapshot_version_test.cc @@ -26,12 +26,12 @@ TEST(SnapshotVersion, Getter) { SnapshotVersion version(Timestamp(123, 456)); EXPECT_EQ(Timestamp(123, 456), version.timestamp()); - const SnapshotVersion& no_version = SnapshotVersion::NoVersion(); + const SnapshotVersion& no_version = SnapshotVersion::None(); EXPECT_EQ(Timestamp(), no_version.timestamp()); } TEST(SnapshotVersion, Comparison) { - EXPECT_LT(SnapshotVersion::NoVersion(), SnapshotVersion(Timestamp(123, 456))); + EXPECT_LT(SnapshotVersion::None(), SnapshotVersion(Timestamp(123, 456))); EXPECT_LT(SnapshotVersion(Timestamp(123, 456)), SnapshotVersion(Timestamp(456, 123)));