Convert CHECK macro to ABSL_CHECK.

Chrome can't use Absl's CHECK because of collisions with its own version.

PiperOrigin-RevId: 561740965
This commit is contained in:
MediaPipe Team
2023-08-31 13:20:29 -07:00
committed by Copybara-Service
parent 30802b80cd
commit 7c2d654d67
262 changed files with 1881 additions and 1474 deletions
@@ -68,7 +68,7 @@ cc_library(
hdrs = ["piecewise_linear_function.h"],
deps = [
"//mediapipe/framework/port:status",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/log:absl_check",
],
)
@@ -237,7 +237,7 @@ cc_test(
"//mediapipe/framework/port:gtest_main",
"//mediapipe/framework/port:status",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/strings",
],
)
@@ -285,6 +285,7 @@ cc_test(
"//mediapipe/framework/port:gtest_main",
"//mediapipe/framework/port:opencv_core",
"//mediapipe/framework/port:status",
"@com_google_absl//absl/log:absl_check",
],
)
@@ -20,7 +20,7 @@
#include <limits>
#include <vector>
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include "mediapipe/framework/port/status.h"
namespace mediapipe {
@@ -28,7 +28,7 @@ namespace autoflip {
void PiecewiseLinearFunction::AddPoint(double x, double y) {
if (!points_.empty()) {
CHECK_GE(x, points_.back().x)
ABSL_CHECK_GE(x, points_.back().x)
<< "Points must be provided in non-decreasing x order.";
}
points_.push_back(PiecewiseLinearFunction::Point(x, y));
@@ -46,8 +46,8 @@ PiecewiseLinearFunction::GetIntervalIterator(double input) const {
double PiecewiseLinearFunction::Interpolate(
const PiecewiseLinearFunction::Point& p1,
const PiecewiseLinearFunction::Point& p2, double input) const {
CHECK_LT(p1.x, input);
CHECK_GE(p2.x, input);
ABSL_CHECK_LT(p1.x, input);
ABSL_CHECK_GE(p2.x, input);
return p2.y - (p2.x - input) / (p2.x - p1.x) * (p2.y - p1.y);
}
@@ -14,6 +14,7 @@
#include "mediapipe/examples/desktop/autoflip/quality/polynomial_regression_path_solver.h"
#include "absl/log/absl_check.h"
#include "mediapipe/examples/desktop/autoflip/quality/focus_point.pb.h"
#include "mediapipe/framework/port/gmock.h"
#include "mediapipe/framework/port/gtest.h"
@@ -145,8 +146,8 @@ void GenerateDataPointsFromRealVideo(
const int prior_focus_point_frames_length,
std::vector<FocusPointFrame>* focus_point_frames,
std::vector<FocusPointFrame>* prior_focus_point_frames) {
CHECK(focus_point_frames_length + prior_focus_point_frames_length <=
kNumObservations);
ABSL_CHECK(focus_point_frames_length + prior_focus_point_frames_length <=
kNumObservations);
for (int i = 0; i < prior_focus_point_frames_length; i++) {
FocusPoint sp;
sp.set_norm_point_x(data[i]);
@@ -43,7 +43,7 @@ namespace autoflip {
// SceneCameraMotionAnalyzer analyzer(options);
// SceneKeyFrameCropSummary scene_summary;
// std::vector<FocusPointFrame> focus_point_frames;
// CHECK_OK(analyzer.AnalyzeScenePopulateFocusPointFrames(
// ABSL_CHECK_OK(analyzer.AnalyzeScenePopulateFocusPointFrames(
// key_frame_crop_infos, key_frame_crop_options, key_frame_crop_results,
// scene_frame_width, scene_frame_height, scene_frame_timestamps,
// &scene_summary, &focus_point_frames));
@@ -20,7 +20,7 @@
#include <vector>
#include "absl/flags/flag.h"
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include "absl/strings/str_split.h"
#include "mediapipe/examples/desktop/autoflip/autoflip_messages.pb.h"
#include "mediapipe/examples/desktop/autoflip/quality/focus_point.pb.h"
@@ -745,7 +745,7 @@ TEST(SceneCameraMotionAnalyzerTest,
std::vector<std::string> r = absl::StrSplit(line, ',');
records.insert(records.end(), r.begin(), r.end());
}
CHECK_EQ(records.size(), kNumSceneFrames * 3 + 1);
ABSL_CHECK_EQ(records.size(), kNumSceneFrames * 3 + 1);
std::vector<FocusPointFrame> focus_point_frames;
MP_EXPECT_OK(analyzer.PopulateFocusPointFrames(
@@ -41,7 +41,7 @@ namespace autoflip {
// SceneCropperOptions scene_cropper_options;
// SceneCropper scene_cropper(scene_cropper_options);
// std::vector<cv::Mat> cropped_frames;
// CHECK_OK(scene_cropper.CropFrames(
// ABSL_CHECK_OK(scene_cropper.CropFrames(
// scene_summary, scene_frames, focus_point_frames,
// prior_focus_point_frames, &cropped_frames));
class SceneCropper {
@@ -24,6 +24,7 @@ cc_binary(
"//mediapipe/framework:calculator_graph",
"//mediapipe/framework/port:parse_text_proto",
"//mediapipe/framework/port:status",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
],
)
@@ -14,6 +14,7 @@
//
// A simple example to print out "Hello World!" from a MediaPipe graph.
#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include "mediapipe/framework/calculator_graph.h"
#include "mediapipe/framework/port/parse_text_proto.h"
@@ -62,6 +63,6 @@ absl::Status PrintHelloWorld() {
int main(int argc, char** argv) {
google::InitGoogleLogging(argv[0]);
CHECK(mediapipe::PrintHelloWorld().ok());
ABSL_CHECK(mediapipe::PrintHelloWorld().ok());
return 0;
}