WIP: Morph: Add unit tests #2

Closed
dstepanov-yadro wants to merge 233 commits from TrueCloudLab/frostfs-node:master into object-3608-morph-unit-tests
Showing only changes of commit cab51c8cbe - Show all commits

View file

@ -84,7 +84,7 @@ func (db *DB) Select(ctx context.Context, prm SelectPrm) (res SelectRes, err err
return res, ErrDegradedMode
}
if blindlyProcess(prm.filters) {
if checkNonEmpty(prm.filters) {
success = true
return res, nil
}
@ -556,15 +556,12 @@ func markAddressInCache(cache map[string]int, fNum int, addr string) {
}
}
// returns true if query leads to a deliberately empty result.
func blindlyProcess(fs object.SearchFilters) bool {
// Returns true if at least 1 object can satisfy fs.
func checkNonEmpty(fs object.SearchFilters) bool {
for i := range fs {
if fs[i].Operation() == object.MatchNotPresent && isSystemKey(fs[i].Header()) {
return true
}
// TODO: #1148 check other cases
// e.g. (a == b) && (a != b)
}
return false