Skip to content

Commit 6509d81

Browse files
author
Alex Ames
committed
Added a new test suite for SyncPoints.
The new test suit is driven by the same master set of test cases that drive SyncPoint tests on the iOS and Android implementation. All tests are run twice, once at the root, and once again at a deeper level, to ensure that the depth of the changes made does not matter. Some tests currently fail. It's not clear if these are legitimate bugs in the test suite, or if there are some bugs in the DB implementation. For the time being, these tests are skipped using `GTEST_SKIP();` and are annotated with whether they result in an assert being triggered or just a failure due to unmet expectations. Also included is a minor change to what is considered a valid priority (null priorities are valid) and how QueryParams determine if they have a start or end ranges (null values are allowed, if there is a start or end key name supplied). I tried to keep bug fixes in separate commits, but allowing null was necessary or almost none of the tests would pass.
1 parent 886eca4 commit 6509d81

File tree

2 files changed

+888
-3
lines changed

2 files changed

+888
-3
lines changed

database/src/desktop/util_desktop.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ const std::string& GetHash(const Variant& data, std::string* output) {
990990
}
991991

992992
bool IsValidPriority(const Variant& variant) {
993-
return variant.is_numeric() || variant.is_string();
993+
return variant.is_null() || variant.is_numeric() || variant.is_string();
994994
}
995995

996996
std::pair<Variant, Variant> MakePost(const QueryParams& params,
@@ -1022,11 +1022,13 @@ std::pair<Variant, Variant> MakePost(const QueryParams& params,
10221022
}
10231023

10241024
bool HasStart(const QueryParams& params) {
1025-
return !params.start_at_value.is_null() || !params.equal_to_value.is_null();
1025+
return !params.start_at_value.is_null() || !params.equal_to_value.is_null() ||
1026+
GetStartName(params) != QueryParamsComparator::kMinKey;
10261027
}
10271028

10281029
bool HasEnd(const QueryParams& params) {
1029-
return !params.end_at_value.is_null() || !params.equal_to_value.is_null();
1030+
return !params.end_at_value.is_null() || !params.equal_to_value.is_null() ||
1031+
GetEndName(params) != QueryParamsComparator::kMaxKey;
10301032
}
10311033

10321034
std::string GetStartName(const QueryParams& params) {

0 commit comments

Comments
 (0)