From 8a845ab078c3fe12ac4edd16c8cbac5b7ec03b98 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 29 Apr 2022 03:59:45 +0300 Subject: libcamera: Replace toString with operator<<() for format classes Now that format classes implement the stream formatting operator<<(), use it instead of the toString() function. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- test/bayer-format.cpp | 24 ++++++++++++------------ test/camera-sensor.cpp | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'test') diff --git a/test/bayer-format.cpp b/test/bayer-format.cpp index 135bcb52..54f03487 100644 --- a/test/bayer-format.cpp +++ b/test/bayer-format.cpp @@ -72,8 +72,8 @@ protected: bayerFmt = BayerFormat::fromV4L2PixelFormat(v4l2FmtExpect); V4L2PixelFormat v4l2Fmt = bayerFmt.toV4L2PixelFormat(); if (v4l2Fmt != v4l2FmtExpect) { - cerr << "Expected: '" << v4l2FmtExpect.toString() - << "' got: '" << v4l2Fmt.toString() << "'" << endl; + cerr << "Expected: '" << v4l2FmtExpect + << "' got: '" << v4l2Fmt << "'" << endl; return TestFail; } @@ -86,7 +86,7 @@ protected: v4l2Fmt = bayerFmt.toV4L2PixelFormat(); if (v4l2Fmt != v4l2FmtExpect) { cerr << "Expected: empty V4L2PixelFormat got: '" - << v4l2Fmt.toString() << "'" << endl; + << v4l2Fmt << "'" << endl; return TestFail; } @@ -101,8 +101,8 @@ protected: bayerFmt = BayerFormat::fromV4L2PixelFormat(v4l2Fmt); if (bayerFmt != bayerFmtExpect) { cerr << "Expected BayerFormat '" - << bayerFmtExpect.toString() << "', got: '" - << bayerFmt.toString() << "'" << endl; + << bayerFmtExpect << "', got: '" + << bayerFmt << "'" << endl; return TestFail; } @@ -115,7 +115,7 @@ protected: bayerFmt = BayerFormat::fromV4L2PixelFormat(v4l2FmtUnknown); if (bayerFmt.isValid()) { cerr << "Expected empty BayerFormat got: '" - << bayerFmt.toString() << "'" << endl; + << bayerFmt << "'" << endl; return TestFail; } @@ -151,8 +151,8 @@ protected: BayerFormat hFlipFmt = bayerFmt.transform(Transform::HFlip); if (hFlipFmt != bayerFmtExpect) { cerr << "Horizontal flip of 'BGGR-8' should result in '" - << bayerFmtExpect.toString() << "', got: '" - << hFlipFmt.toString() << "'" << endl; + << bayerFmtExpect << "', got: '" + << hFlipFmt << "'" << endl; return TestFail; } @@ -166,8 +166,8 @@ protected: BayerFormat vFlipFmt = bayerFmt.transform(Transform::VFlip); if (vFlipFmt != bayerFmtExpect) { cerr << "Vertical flip of 'BGGR-8' should result in '" - << bayerFmtExpect.toString() << "', got: '" - << vFlipFmt.toString() << "'" << endl; + << bayerFmtExpect << "', got: '" + << vFlipFmt << "'" << endl; return TestFail; } @@ -182,7 +182,7 @@ protected: if (transposeFmt != bayerFmt) { cerr << "Transpose with both green pixels on the " << "antidiagonal should not change the order " - << "(got '" << transposeFmt.toString() << "')" + << "(got '" << transposeFmt << "')" << endl; return TestFail; } @@ -199,7 +199,7 @@ protected: if (transposeFmt != bayerFmtExpect) { cerr << "Transpose with the red & blue pixels on the " << "antidiagonal should switch their position " - << "(got '" << transposeFmt.toString() << "')" + << "(got '" << transposeFmt << "')" << endl; return TestFail; } diff --git a/test/camera-sensor.cpp b/test/camera-sensor.cpp index 9b06a60e..d3dcb510 100644 --- a/test/camera-sensor.cpp +++ b/test/camera-sensor.cpp @@ -99,7 +99,7 @@ protected: format.size != Size(4096, 2160)) { cerr << "Failed to get a suitable format, expected 4096x2160-0x" << utils::hex(MEDIA_BUS_FMT_SBGGR10_1X10) - << ", got " << format.toString() << endl; + << ", got " << format << endl; return TestFail; } -- cgit v1.2.1