From ad6b66909ed1ae02b9eea164d9886f1d36d5241e Mon Sep 17 00:00:00 2001 From: schroedtert <t.schroedter@fz-juelich.de> Date: Wed, 6 Apr 2022 14:36:48 +0200 Subject: [PATCH 1/2] Update docker file and scripts to use clang 14 Signed-off-by: schroedtert <t.schroedter@fz-juelich.de> --- container/ubuntu/Dockerfile | 12 ++++++------ scripts/check-format-cpp.sh | 2 +- scripts/format-cpp.sh | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/container/ubuntu/Dockerfile b/container/ubuntu/Dockerfile index 8d438c64f..c47ce2ce1 100644 --- a/container/ubuntu/Dockerfile +++ b/container/ubuntu/Dockerfile @@ -6,7 +6,7 @@ ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y software-properties-common wget # Install the needed tools -RUN echo "deb [trusted=yes] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-13 main" | tee /etc/apt/sources.list.d/clang.list +RUN echo "deb [trusted=yes] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-14 main" | tee /etc/apt/sources.list.d/clang.list RUN apt-get update && \ apt-get install -y \ @@ -18,12 +18,12 @@ RUN apt-get update && \ parallel \ mesa-common-dev \ libglu1-mesa-dev \ - clang-13 \ - clang-format-13 + clang-14 \ + clang-format-14 -# Set clang-13 as default compiler -RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-13 100 &&\ - update-alternatives --install /usr/bin/cc cc /usr/bin/clang-13 100 +# Set clang-14 as default compiler +RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-14 100 &&\ + update-alternatives --install /usr/bin/cc cc /usr/bin/clang-14 100 # Install python RUN apt-get update && apt-get install -y \ diff --git a/scripts/check-format-cpp.sh b/scripts/check-format-cpp.sh index 5e459e6e3..35f92405d 100755 --- a/scripts/check-format-cpp.sh +++ b/scripts/check-format-cpp.sh @@ -7,4 +7,4 @@ files=$(find "$(readlink -f "${origin}"/../src)" -type f -regex "^.*\.\(hpp\|cpp files+=$'\n'$(find "$(readlink -f "${origin}"/../include)" -type f -regex "^.*\.\(hpp\|cpp\|h\|c\)$") files+=$'\n'$(find "$(readlink -f "${origin}"/../tests)" -type f -regex "^.*\.\(hpp\|cpp\|h\|c\)$") -echo "${files}" | parallel clang-format-13 --dry-run -Werror +echo "${files}" | parallel clang-format-14 --dry-run -Werror diff --git a/scripts/format-cpp.sh b/scripts/format-cpp.sh index 59525056b..93c298946 100755 --- a/scripts/format-cpp.sh +++ b/scripts/format-cpp.sh @@ -7,4 +7,4 @@ files=$(find "$(readlink -f ${origin}/../src)" -type f -regex "^.*\.\(hpp\|cpp\| files+=$'\n'$(find "$(readlink -f ${origin}/../include)" -type f -regex "^.*\.\(hpp\|cpp\|h\|c\)$") files+=$'\n'$(find "$(readlink -f ${origin}/../tests)" -type f -regex "^.*\.\(hpp\|cpp\|h\|c\)$") -echo "${files}" | parallel clang-format-13 -i +echo "${files}" | parallel clang-format-14 -i -- GitLab From 42c9cd0ce22b8f40df2d387e92ebd86330e20d04 Mon Sep 17 00:00:00 2001 From: schroedtert <t.schroedter@fz-juelich.de> Date: Wed, 6 Apr 2022 16:15:30 +0200 Subject: [PATCH 2/2] Reformat with clang-format-14 Signed-off-by: schroedtert <t.schroedter@fz-juelich.de> --- include/aboutDialog.h | 6 +-- include/autosave.h | 10 ++-- include/control.h | 15 ++++-- include/ellipse.h | 8 +-- include/moCapPersonMetadata.h | 10 ++-- include/moCapSelectionWidget.h | 6 +-- include/openMoCapDialog.h | 8 +-- include/petrack.h | 50 ++++++++++++++---- include/skeletonTree.h | 2 +- include/stereoContext.h | 40 ++++++++++++--- include/stereoWidget.h | 10 +++- include/vector.h | 10 ++-- src/qtColorTriangle.cpp | 8 +-- tests/unit_test/tst_apptest.cpp | 5 +- tests/unit_test/tst_codeMarkerWidget.cpp | 65 +++++++++++++++++++----- tests/unit_test/tst_control.cpp | 5 +- tests/unit_test/tst_petrack.cpp | 20 ++++++-- tests/unit_test/tst_recognition.cpp | 10 +++- 18 files changed, 210 insertions(+), 78 deletions(-) diff --git a/include/aboutDialog.h b/include/aboutDialog.h index 993ed2a78..887c02b2d 100644 --- a/include/aboutDialog.h +++ b/include/aboutDialog.h @@ -43,9 +43,9 @@ public: const QString &compileDate, const std::vector<std::string> &authors); - AboutDialog(const AboutDialog &) = delete; - AboutDialog &operator=(AboutDialog) = delete; - AboutDialog(const AboutDialog &&) = delete; + AboutDialog(const AboutDialog &) = delete; + AboutDialog &operator=(AboutDialog) = delete; + AboutDialog(const AboutDialog &&) = delete; AboutDialog &operator=(AboutDialog &&) = delete; ~AboutDialog() override; diff --git a/include/autosave.h b/include/autosave.h index c50a57001..1042eccb0 100644 --- a/include/autosave.h +++ b/include/autosave.h @@ -40,12 +40,12 @@ class Autosave : public QObject Q_OBJECT public: explicit Autosave(Petrack &petrack); - Autosave() = delete; - Autosave(const Autosave &other) = delete; - Autosave(const Autosave &&other) = delete; + Autosave() = delete; + Autosave(const Autosave &other) = delete; + Autosave(const Autosave &&other) = delete; Autosave &operator=(const Autosave &other) = delete; - Autosave &operator=(Autosave &&other) = delete; - ~Autosave() override = default; + Autosave &operator=(Autosave &&other) = delete; + ~Autosave() override = default; void trackPersonModified(); void resetTrackPersonCounter(); diff --git a/include/control.h b/include/control.h index 6e57ddbb1..14ad1e412 100644 --- a/include/control.h +++ b/include/control.h @@ -236,10 +236,16 @@ public: inline ColorPlot *getColorPlot() const { return colorPlot; } #ifdef QWT - inline AnalysePlot *getAnalysePlot() const { return analysePlot; } + inline AnalysePlot *getAnalysePlot() const + { + return analysePlot; + } #endif - inline Petrack *getMainWindow() const { return mMainWindow; } + inline Petrack *getMainWindow() const + { + return mMainWindow; + } private: reco::RecognitionMethod getRecoMethod() const; @@ -419,7 +425,10 @@ private slots: mScene->update(); } } - void on_trackColorMarkerSize_valueChanged(int /*i*/) { mScene->update(); } + void on_trackColorMarkerSize_valueChanged(int /*i*/) + { + mScene->update(); + } void on_trackNumberSize_valueChanged(int /*i*/) { if(!isLoading()) diff --git a/include/ellipse.h b/include/ellipse.h index 21b89775d..013cd2a09 100644 --- a/include/ellipse.h +++ b/include/ellipse.h @@ -42,11 +42,11 @@ public: MyEllipse(); MyEllipse(double x, double y, double r1, double r2, double angle); MyEllipse(QPointF center, QSizeF size, double angle); - MyEllipse(const MyEllipse &c) = default; - MyEllipse(MyEllipse &&c) = default; + MyEllipse(const MyEllipse &c) = default; + MyEllipse(MyEllipse &&c) = default; MyEllipse &operator=(const MyEllipse &c) = default; - MyEllipse &operator=(MyEllipse &&c) = default; - ~MyEllipse() = default; + MyEllipse &operator=(MyEllipse &&c) = default; + ~MyEllipse() = default; Vec2F center() const; QSizeF size() const; diff --git a/include/moCapPersonMetadata.h b/include/moCapPersonMetadata.h index ecdf424b5..3f4fe56ad 100644 --- a/include/moCapPersonMetadata.h +++ b/include/moCapPersonMetadata.h @@ -43,12 +43,12 @@ const std::map<MoCapSystem, std::string> moCapFileExtensions = {{MoCapSystem::XS class MoCapPersonMetadata { public: - MoCapPersonMetadata() = default; - MoCapPersonMetadata(const MoCapPersonMetadata &) = default; - MoCapPersonMetadata(MoCapPersonMetadata &&) = default; + MoCapPersonMetadata() = default; + MoCapPersonMetadata(const MoCapPersonMetadata &) = default; + MoCapPersonMetadata(MoCapPersonMetadata &&) = default; MoCapPersonMetadata &operator=(const MoCapPersonMetadata &) = default; - MoCapPersonMetadata &operator=(MoCapPersonMetadata &&) = default; - ~MoCapPersonMetadata() = default; + MoCapPersonMetadata &operator=(MoCapPersonMetadata &&) = default; + ~MoCapPersonMetadata() = default; MoCapPersonMetadata( std::string filepath, MoCapSystem system, diff --git a/include/moCapSelectionWidget.h b/include/moCapSelectionWidget.h index 84aa65e79..ab35b5001 100644 --- a/include/moCapSelectionWidget.h +++ b/include/moCapSelectionWidget.h @@ -42,10 +42,10 @@ public: QWidget *parent, const QMap<QString, MoCapSystem> &moCapSystems, const MoCapPersonMetadata &metadata); - MoCapSelectionWidget(const MoCapSelectionWidget &) = delete; - MoCapSelectionWidget(MoCapSelectionWidget &&) = delete; + MoCapSelectionWidget(const MoCapSelectionWidget &) = delete; + MoCapSelectionWidget(MoCapSelectionWidget &&) = delete; MoCapSelectionWidget &operator=(const MoCapSelectionWidget &) = delete; - MoCapSelectionWidget &operator=(MoCapSelectionWidget &&) = delete; + MoCapSelectionWidget &operator=(MoCapSelectionWidget &&) = delete; ~MoCapSelectionWidget() override; void setFileName(); diff --git a/include/openMoCapDialog.h b/include/openMoCapDialog.h index 4965cecbc..b99920d62 100644 --- a/include/openMoCapDialog.h +++ b/include/openMoCapDialog.h @@ -46,11 +46,11 @@ class OpenMoCapDialog : public QDialog public: explicit OpenMoCapDialog(QWidget *parent, MoCapController &controller); - OpenMoCapDialog() = delete; - OpenMoCapDialog(const OpenMoCapDialog &) = delete; - OpenMoCapDialog(OpenMoCapDialog &&) = delete; + OpenMoCapDialog() = delete; + OpenMoCapDialog(const OpenMoCapDialog &) = delete; + OpenMoCapDialog(OpenMoCapDialog &&) = delete; OpenMoCapDialog &operator=(const OpenMoCapDialog &) = delete; - OpenMoCapDialog &operator=(OpenMoCapDialog &&) = delete; + OpenMoCapDialog &operator=(OpenMoCapDialog &&) = delete; ~OpenMoCapDialog() override; void clickedOk(); diff --git a/include/petrack.h b/include/petrack.h index 5be00cdaf..59431550d 100644 --- a/include/petrack.h +++ b/include/petrack.h @@ -263,12 +263,27 @@ public: inline CalibFilter *getCalibFilter() { return (CalibFilter *) mCalibFilter; } #ifdef STEREO // Attention: not type save, be care that animation is stereo - inline CalibStereoFilter *getCalibStereoFilter() { return (CalibStereoFilter *) mCalibFilter; } + inline CalibStereoFilter *getCalibStereoFilter() + { + return (CalibStereoFilter *) mCalibFilter; + } #endif - inline BrightContrastFilter *getBrightContrastFilter() { return &mBrightContrastFilter; } - inline BorderFilter *getBorderFilter() { return &mBorderFilter; } - inline SwapFilter *getSwapFilter() { return &mSwapFilter; } - inline BackgroundFilter *getBackgroundFilter() { return &mBackgroundFilter; } + inline BrightContrastFilter *getBrightContrastFilter() + { + return &mBrightContrastFilter; + } + inline BorderFilter *getBorderFilter() + { + return &mBorderFilter; + } + inline SwapFilter *getSwapFilter() + { + return &mSwapFilter; + } + inline BackgroundFilter *getBackgroundFilter() + { + return &mBackgroundFilter; + } inline int getImageBorderSize() { @@ -281,12 +296,27 @@ public: return 0; } } - inline void setImageBorderSize(int sz) { getBorderFilter()->getBorderSize()->setValue(sz); } + inline void setImageBorderSize(int sz) + { + getBorderFilter()->getBorderSize()->setValue(sz); + } - inline AutoCalib *getAutoCalib() { return &mAutoCalib; } - inline ExtrCalibration *getExtrCalibration() { return &mExtrCalibration; } - inline double getStatusFPS() const { return mShowFPS; } - inline MoCapController &getMoCapController() { return mMoCapController; } + inline AutoCalib *getAutoCalib() + { + return &mAutoCalib; + } + inline ExtrCalibration *getExtrCalibration() + { + return &mExtrCalibration; + } + inline double getStatusFPS() const + { + return mShowFPS; + } + inline MoCapController &getMoCapController() + { + return mMoCapController; + } void updateWindowTitle(); diff --git a/include/skeletonTree.h b/include/skeletonTree.h index 4e1761711..6ccb04535 100644 --- a/include/skeletonTree.h +++ b/include/skeletonTree.h @@ -51,7 +51,7 @@ public: ~SkeletonNode() = default; SkeletonNode &operator=(const SkeletonNode &rhs) = default; - SkeletonNode &operator=(SkeletonNode &&rhs) = default; + SkeletonNode &operator=(SkeletonNode &&rhs) = default; /** * @brief Gets the children as a vector. diff --git a/include/stereoContext.h b/include/stereoContext.h index 6dc46d271..152f55d29 100644 --- a/include/stereoContext.h +++ b/include/stereoContext.h @@ -73,7 +73,10 @@ public: #endif // von person.cpp benoetigt, um frame nummer zu erhalten - inline Animation *getAnimation() { return mAnimation; } + inline Animation *getAnimation() + { + return mAnimation; + } // --------------------------------------------------- @@ -94,20 +97,41 @@ public: // --------------------------------------------------- #ifdef STEREO - inline TriclopsContext getContext() { return mTriclopsContext; } + inline TriclopsContext getContext() + { + return mTriclopsContext; + } #endif - inline unsigned char getSurfaceValue() const { return mSurfaceValue; } - inline unsigned char getBackForthValue() const { return mBackForthValue; } + inline unsigned char getSurfaceValue() const + { + return mSurfaceValue; + } + inline unsigned char getBackForthValue() const + { + return mBackForthValue; + } - inline unsigned short int getMin() const { return mMin; } - inline unsigned short int getMax() const { return mMax; } + inline unsigned short int getMin() const + { + return mMin; + } + inline unsigned short int getMax() const + { + return mMax; + } - inline void addStatus(enum stereoStatus s) { mStatus |= s; } + inline void addStatus(enum stereoStatus s) + { + mStatus |= s; + } inline void setStatus(enum stereoStatus s) // set status up to this level { mStatus = s * 2 - 1; } - inline void resetStatus() { mStatus = clean; } + inline void resetStatus() + { + mStatus = clean; + } CvMat *getPointCloud(); diff --git a/include/stereoWidget.h b/include/stereoWidget.h index 1faf327d8..45ad66dc9 100644 --- a/include/stereoWidget.h +++ b/include/stereoWidget.h @@ -93,7 +93,10 @@ private slots: mMainWindow->getScene()->update(); } } - void on_opacity_valueChanged(int i) { mMainWindow->getScene()->update(); } + void on_opacity_valueChanged(int i) + { + mMainWindow->getScene()->update(); + } void on_edgeMaskSize_valueChanged(int i) { if(i % 2 == 0) @@ -136,7 +139,10 @@ private slots: } } - void on_stereoExport_clicked() { mMainWindow->getStereoContext()->exportPointCloud(); } + void on_stereoExport_clicked() + { + mMainWindow->getStereoContext()->exportPointCloud(); + } #endif private: diff --git a/include/vector.h b/include/vector.h index d04674983..0c638a89c 100644 --- a/include/vector.h +++ b/include/vector.h @@ -73,7 +73,7 @@ public: void set(double x, double y, double z); Vec3F &operator=(const Vec3F &v) = default; - Vec3F &operator=(Vec3F &&v) = default; + Vec3F &operator=(Vec3F &&v) = default; Vec3F &operator=(const cv::Point3f &v); @@ -126,11 +126,11 @@ public: Vec2F(const cv::Point2f &p); Vec2F(const CvPoint *v); Vec2F(const CvPoint2D32f *v); - Vec2F(const Vec2F &c) = default; - Vec2F(Vec2F &&c) = default; + Vec2F(const Vec2F &c) = default; + Vec2F(Vec2F &&c) = default; Vec2F &operator=(const Vec2F &c) = default; - Vec2F &operator=(Vec2F &&c) = default; - ~Vec2F() = default; + Vec2F &operator=(Vec2F &&c) = default; + ~Vec2F() = default; cv::Point toCvPoint() const; CvPoint2D32f toCvPoint2D32f() const; diff --git a/src/qtColorTriangle.cpp b/src/qtColorTriangle.cpp index 591b773d2..14a3de054 100644 --- a/src/qtColorTriangle.cpp +++ b/src/qtColorTriangle.cpp @@ -103,11 +103,11 @@ struct DoubleColor DoubleColor() : r(0.0), g(0.0), b(0.0) {} DoubleColor(double red, double green, double blue) : r(red), g(green), b(blue) {} - DoubleColor(const DoubleColor &c) = default; - DoubleColor(DoubleColor &&c) = default; + DoubleColor(const DoubleColor &c) = default; + DoubleColor(DoubleColor &&c) = default; DoubleColor &operator=(const DoubleColor &c) = default; - DoubleColor &operator=(DoubleColor &&c) = default; - ~DoubleColor() = default; + DoubleColor &operator=(DoubleColor &&c) = default; + ~DoubleColor() = default; }; /* diff --git a/tests/unit_test/tst_apptest.cpp b/tests/unit_test/tst_apptest.cpp index 3b1a72c0c..e0ad4b831 100644 --- a/tests/unit_test/tst_apptest.cpp +++ b/tests/unit_test/tst_apptest.cpp @@ -25,5 +25,8 @@ SCENARIO("Application Tests", "[app]") { - GIVEN("Hello World") { REQUIRE(true); } + GIVEN("Hello World") + { + REQUIRE(true); + } } diff --git a/tests/unit_test/tst_codeMarkerWidget.cpp b/tests/unit_test/tst_codeMarkerWidget.cpp index 0d9adf2f6..6125ffbdb 100644 --- a/tests/unit_test/tst_codeMarkerWidget.cpp +++ b/tests/unit_test/tst_codeMarkerWidget.cpp @@ -101,55 +101,82 @@ SCENARIO("The user opens the CodeMarkerWidget", "[ui]") GIVEN("A cornerRefinementWinSize less than 1") { view->cornerRefinementWinSize->setValue(-2); - THEN("The value gets set to 1") { REQUIRE(view->cornerRefinementWinSize->value() == 1); } + THEN("The value gets set to 1") + { + REQUIRE(view->cornerRefinementWinSize->value() == 1); + } } GIVEN("A cornerRefinementMaxIterations less than 1") { view->cornerRefinementMaxIterations->setValue(0); - THEN("The value gets set to 1") { REQUIRE(view->cornerRefinementMaxIterations->value() == 1); } + THEN("The value gets set to 1") + { + REQUIRE(view->cornerRefinementMaxIterations->value() == 1); + } } GIVEN("A cornerRefinementMinAccuracy less than or equal to 0") { view->cornerRefinementMinAccuracy->setValue(-3); - THEN("It is set to 0.01") { REQUIRE(view->cornerRefinementMinAccuracy->value() == Approx(0.01)); } + THEN("It is set to 0.01") + { + REQUIRE(view->cornerRefinementMinAccuracy->value() == Approx(0.01)); + } } GIVEN("markerBorderBits less than 1") { view->markerBorderBits->setValue(0); - THEN("The value is set to 1") { REQUIRE(view->markerBorderBits->value() == 1); } + THEN("The value is set to 1") + { + REQUIRE(view->markerBorderBits->value() == 1); + } } GIVEN("minStdDevOtsu less than or equal to 0") { view->minOtsuStdDev->setValue(-2); - THEN("The value is set to 0.01") { REQUIRE(view->minOtsuStdDev->value() == Approx(0.01)); } + THEN("The value is set to 0.01") + { + REQUIRE(view->minOtsuStdDev->value() == Approx(0.01)); + } } GIVEN("adaptiveThreshSizeMin less than 3") { view->adaptiveThreshWinSizeMin->setValue(1); - THEN("The value is set to 3") { REQUIRE(view->adaptiveThreshWinSizeMin->value() == 3); } + THEN("The value is set to 3") + { + REQUIRE(view->adaptiveThreshWinSizeMin->value() == 3); + } } GIVEN("adaptiveThreshSizeMax less than 3") { view->adaptiveThreshWinSizeMax->setValue(1); - THEN("The value is set to 3") { REQUIRE(view->adaptiveThreshWinSizeMax->value() == 3); } + THEN("The value is set to 3") + { + REQUIRE(view->adaptiveThreshWinSizeMax->value() == 3); + } } GIVEN("adaptiveThreshWinSizeStep less than or equal to 0") { view->adaptiveThreshWinSizeStep->setValue(0); - THEN("The value is set to 1") { REQUIRE(view->adaptiveThreshWinSizeStep->value() == 1); } + THEN("The value is set to 1") + { + REQUIRE(view->adaptiveThreshWinSizeStep->value() == 1); + } } GIVEN("minMarkerPerimeter less than or equal to 0") { view->minMarkerPerimeter->setValue(0); - THEN("The value is set to 0.1") { REQUIRE(view->minMarkerPerimeter->value() == Approx(0.1)); } + THEN("The value is set to 0.1") + { + REQUIRE(view->minMarkerPerimeter->value() == Approx(0.1)); + } } GIVEN("maxMarkerPerimeter less than or equal to 0") @@ -157,24 +184,36 @@ SCENARIO("The user opens the CodeMarkerWidget", "[ui]") auto oldVal = view->maxMarkerPerimeter->value(); view->minMarkerPerimeter->setValue(0); // since max cannot be lower than min view->maxMarkerPerimeter->setValue(0); - THEN("The value is not changed") { REQUIRE(view->maxMarkerPerimeter->value() == Approx(oldVal)); } + THEN("The value is not changed") + { + REQUIRE(view->maxMarkerPerimeter->value() == Approx(oldVal)); + } } GIVEN("cornerRefinementMinAccuracy less than or equal to 0") { view->cornerRefinementMinAccuracy->setValue(0); - THEN("The value is set to 0.01") { REQUIRE(view->cornerRefinementMinAccuracy->value() == Approx(0.01)); } + THEN("The value is set to 0.01") + { + REQUIRE(view->cornerRefinementMinAccuracy->value() == Approx(0.01)); + } } GIVEN("minCornerDistance less than 0") { view->minCornerDistance->setValue(-1); - THEN("The value is set to 1") { REQUIRE(view->minCornerDistance->value() == Approx(0)); } + THEN("The value is set to 1") + { + REQUIRE(view->minCornerDistance->value() == Approx(0)); + } } GIVEN("minDistanceToBorder less than 0") { view->minDistanceToBorder->setValue(-2); - THEN("The value is set to 0") { REQUIRE(view->minDistanceToBorder->value() == 0); } + THEN("The value is set to 0") + { + REQUIRE(view->minDistanceToBorder->value() == 0); + } } } diff --git a/tests/unit_test/tst_control.cpp b/tests/unit_test/tst_control.cpp index b48ab0a46..aadb32ea3 100644 --- a/tests/unit_test/tst_control.cpp +++ b/tests/unit_test/tst_control.cpp @@ -90,7 +90,10 @@ SCENARIO("I open PeTrack with a red image", "[ui][config]") eventList.addMouseClick(Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier); eventList.simulate(colorPickerButton); - THEN("The Button is checked") { REQUIRE(colorPickerButton->isChecked()); } + THEN("The Button is checked") + { + REQUIRE(colorPickerButton->isChecked()); + } AND_GIVEN("I shift+click on one point of the (red) image") { diff --git a/tests/unit_test/tst_petrack.cpp b/tests/unit_test/tst_petrack.cpp index 62dd57d4f..11ae66d20 100644 --- a/tests/unit_test/tst_petrack.cpp +++ b/tests/unit_test/tst_petrack.cpp @@ -135,28 +135,40 @@ SCENARIO("Getting the IDs of the pedestrian from user input", "[petrack][util]") QString input("-1"); auto receivedIDs = util::splitStringToInt(input); - THEN("std::nullopt should be returned") { REQUIRE_FALSE(receivedIDs.has_value()); } + THEN("std::nullopt should be returned") + { + REQUIRE_FALSE(receivedIDs.has_value()); + } } AND_WHEN("invalid range") { QString input("1-"); auto receivedIDs = util::splitStringToInt(input); - THEN("std::nullopt should be returned") { REQUIRE_FALSE(receivedIDs.has_value()); } + THEN("std::nullopt should be returned") + { + REQUIRE_FALSE(receivedIDs.has_value()); + } } AND_WHEN("too many -'s") { QString input("1-2-"); auto receivedIDs = util::splitStringToInt(input); - THEN("std::nullopt should be returned") { REQUIRE_FALSE(receivedIDs.has_value()); } + THEN("std::nullopt should be returned") + { + REQUIRE_FALSE(receivedIDs.has_value()); + } } AND_WHEN("not int values (single values)") { QString input("1, 5, a, b, 6"); auto receivedIDs = util::splitStringToInt(input); - THEN("std::nullopt should be returned") { REQUIRE_FALSE(receivedIDs.has_value()); } + THEN("std::nullopt should be returned") + { + REQUIRE_FALSE(receivedIDs.has_value()); + } } } } \ No newline at end of file diff --git a/tests/unit_test/tst_recognition.cpp b/tests/unit_test/tst_recognition.cpp index 33d21a776..677988903 100644 --- a/tests/unit_test/tst_recognition.cpp +++ b/tests/unit_test/tst_recognition.cpp @@ -51,7 +51,10 @@ SCENARIO("I change Aruco parameters (via UI)") ArucoCodeParams params; params.setAdaptiveThreshConstant(20); options.setDetectorParams(params); - THEN("A corresponding change signal was emitted") { REQUIRE(spy.count() == 1); } + THEN("A corresponding change signal was emitted") + { + REQUIRE(spy.count() == 1); + } } GIVEN("I change the index of the marker dict") @@ -59,7 +62,10 @@ SCENARIO("I change Aruco parameters (via UI)") QSignalSpy spy{&options, &CodeMarkerOptions::indexOfMarkerDictChanged}; const int newIndex = options.getIndexOfMarkerDict() + 1; options.setIndexOfMarkerDict(newIndex); - THEN("A corresponding change signal was emitted") { REQUIRE(spy.count() == 1); } + THEN("A corresponding change signal was emitted") + { + REQUIRE(spy.count() == 1); + } } } -- GitLab