diff --git a/gtsam_unstable/nonlinear/tests/testConcurrentBatchFilter.cpp b/gtsam_unstable/nonlinear/tests/testConcurrentBatchFilter.cpp index a502542a9..9eafd8a96 100644 --- a/gtsam_unstable/nonlinear/tests/testConcurrentBatchFilter.cpp +++ b/gtsam_unstable/nonlinear/tests/testConcurrentBatchFilter.cpp @@ -67,7 +67,7 @@ bool hessian_equal(const NonlinearFactorGraph& expected, const NonlinearFactorGr FastSet actualKeys = actual.keys(); // Verify the set of keys in both graphs are the same - if(!std::equal(expectedKeys.begin(), expectedKeys.end(), actualKeys.begin())) + if(expectedKeys.size() != actualKeys.size() || !std::equal(expectedKeys.begin(), expectedKeys.end(), actualKeys.begin())) return false; // Create an ordering