diff --git a/ortools/algorithms/BUILD.bazel b/ortools/algorithms/BUILD.bazel index 308a484fff..4d08db5881 100644 --- a/ortools/algorithms/BUILD.bazel +++ b/ortools/algorithms/BUILD.bazel @@ -100,10 +100,10 @@ cc_test( name = "radix_sort_test", srcs = ["radix_sort_test.cc"], copts = select({ - "on_linux": [], - "on_macos": [], - "on_windows": ["/Zc:preprocessor"], - "//conditions:default": [], + "on_linux": [], + "on_macos": [], + "on_windows": ["/Zc:preprocessor"], + "//conditions:default": [], }), deps = [ ":radix_sort", diff --git a/ortools/base/BUILD.bazel b/ortools/base/BUILD.bazel index bba0215136..a09e8f9ccc 100644 --- a/ortools/base/BUILD.bazel +++ b/ortools/base/BUILD.bazel @@ -234,6 +234,15 @@ cc_library( ], ) +cc_library( + name = "message_matchers", + hdrs = ["message_matchers.h"], + deps = [ + "@com_google_googletest//:gtest", + "@com_google_protobuf//:protobuf", + ], +) + cc_library( name = "gmock", hdrs = ["gmock.h"], @@ -458,15 +467,6 @@ cc_library( ], ) -cc_library( - name = "message_matchers", - hdrs = ["message_matchers.h"], - deps = [ - "@com_google_googletest//:gtest", - "@com_google_protobuf//:protobuf", - ], -) - cc_library( name = "status_macros", hdrs = ["status_macros.h"], diff --git a/ortools/base/gmock.h b/ortools/base/gmock.h index 679a53cfcb..d6d84a7659 100644 --- a/ortools/base/gmock.h +++ b/ortools/base/gmock.h @@ -15,6 +15,7 @@ #define OR_TOOLS_BASE_GMOCK_H_ #include "gmock/gmock.h" +#include "ortools/base/message_matchers.h" #include "ortools/base/status_matchers.h" #endif // OR_TOOLS_BASE_GMOCK_H_ diff --git a/ortools/math_opt/core/empty_bounds.cc b/ortools/math_opt/core/empty_bounds.cc index 4de4926479..a0508f71e1 100644 --- a/ortools/math_opt/core/empty_bounds.cc +++ b/ortools/math_opt/core/empty_bounds.cc @@ -30,7 +30,7 @@ SolveResultProto ResultForIntegerInfeasible(const bool is_maximize, result.mutable_termination()->set_reason(TERMINATION_REASON_INFEASIBLE); result.mutable_termination()->set_detail( absl::StrCat("Problem had one or more integer variables with no integers " - "in domain, e.g. integer variable with id: ", + "in domain, e.g. integer variable with id: ", bad_variable_id, " had bounds: [", RoundTripDoubleFormat(lb), ", ", RoundTripDoubleFormat(ub), "].")); result.mutable_solve_stats()->mutable_problem_status()->set_primal_status( diff --git a/ortools/math_opt/cpp/BUILD.bazel b/ortools/math_opt/cpp/BUILD.bazel index 85d58be873..9d508407e2 100644 --- a/ortools/math_opt/cpp/BUILD.bazel +++ b/ortools/math_opt/cpp/BUILD.bazel @@ -425,8 +425,6 @@ cc_library( ":variable_and_expressions", "//ortools/base:gmock", "//ortools/base:logging", - "//ortools/base:message_matchers", - "//ortools/base:status_matchers", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/log", "@com_google_absl//absl/log:check", diff --git a/ortools/math_opt/cpp/matchers.cc b/ortools/math_opt/cpp/matchers.cc index ad4fe613db..519e8bf78f 100644 --- a/ortools/math_opt/cpp/matchers.cc +++ b/ortools/math_opt/cpp/matchers.cc @@ -30,7 +30,6 @@ #include "gtest/gtest.h" #include "ortools/base/gmock.h" #include "ortools/base/logging.h" -#include "ortools/base/message_matchers.h" #include "ortools/math_opt/cpp/math_opt.h" #include "ortools/math_opt/cpp/update_result.h" #include "ortools/math_opt/cpp/variable_and_expressions.h" diff --git a/ortools/math_opt/cpp/matchers.h b/ortools/math_opt/cpp/matchers.h index 260fb77f6f..95dd854e47 100644 --- a/ortools/math_opt/cpp/matchers.h +++ b/ortools/math_opt/cpp/matchers.h @@ -101,7 +101,6 @@ #include "absl/status/statusor.h" #include "gtest/gtest.h" #include "ortools/base/gmock.h" -#include "ortools/base/status_matchers.h" #include "ortools/math_opt/cpp/linear_constraint.h" #include "ortools/math_opt/cpp/math_opt.h" #include "ortools/math_opt/cpp/update_result.h" diff --git a/ortools/math_opt/cpp/model_solve_parameters.cc b/ortools/math_opt/cpp/model_solve_parameters.cc index f6fe3d3001..304e506e79 100644 --- a/ortools/math_opt/cpp/model_solve_parameters.cc +++ b/ortools/math_opt/cpp/model_solve_parameters.cc @@ -161,8 +161,8 @@ ModelSolveParametersProto ModelSolveParameters::Proto() const { ->mutable_ids(); RepeatedField& constraint_status_values = *ret.mutable_initial_basis() - ->mutable_constraint_status() - ->mutable_values(); + ->mutable_constraint_status() + ->mutable_values(); constraint_status_ids.Reserve( static_cast(initial_basis->constraint_status.size())); constraint_status_values.Reserve( @@ -177,8 +177,8 @@ ModelSolveParametersProto ModelSolveParameters::Proto() const { *ret.mutable_initial_basis()->mutable_variable_status()->mutable_ids(); RepeatedField& variable_status_values = *ret.mutable_initial_basis() - ->mutable_variable_status() - ->mutable_values(); + ->mutable_variable_status() + ->mutable_values(); variable_status_ids.Reserve( static_cast(initial_basis->variable_status.size())); variable_status_values.Reserve( diff --git a/ortools/math_opt/labs/solution_feasibility_checker.cc b/ortools/math_opt/labs/solution_feasibility_checker.cc index ff6cae168b..70024a2298 100644 --- a/ortools/math_opt/labs/solution_feasibility_checker.cc +++ b/ortools/math_opt/labs/solution_feasibility_checker.cc @@ -292,11 +292,11 @@ std::string VariableValuesAsString(std::vector variables, return absl::StrCat( "{", absl::StrJoin(variables, ", ", - [&](std::string* const out, const Variable variable) { - absl::StrAppendFormat( + [&](std::string* const out, const Variable variable) { + absl::StrAppendFormat( out, "{%s, %v}", absl::FormatStreamed(variable), RoundTripDoubleFormat(variable_values.at(variable))); - }), + }), "}"); }