From 95cb54a77632eef2c0593c86891c957687f96e58 Mon Sep 17 00:00:00 2001 From: realstealthninja <68815218+realstealthninja@users.noreply.github.com> Date: Tue, 22 Sep 2026 05:55:32 +0530 Subject: fix: use cmath and math defines --- gunit_tests/imageDraw.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gunit_tests/imageDraw.cpp b/gunit_tests/imageDraw.cpp index b548b8e..25b6f4d 100644 --- a/gunit_tests/imageDraw.cpp +++ b/gunit_tests/imageDraw.cpp @@ -1,5 +1,6 @@ #include "drawTestBase.h" -#include +#define _USE_MATH_DEFINES +#include class ImageDrawTest : public DrawTestBase { @@ -148,7 +149,7 @@ TEST_F(ImageDrawTest, PaintImageOnImage) { TEST_F(ImageDrawTest, PaintImageClipped) { VkvgContext ctx = vkvg_create(surf); - vkvg_arc(ctx, 140, 140, 100, 0, 2.f*M_PI); + vkvg_arc(ctx, 140, 140, 100, 0, 2.f * M_PI); vkvg_clip(ctx); vkvg_set_source_surface(ctx, imgSurf, 0, 0); vkvg_paint(ctx); @@ -160,8 +161,8 @@ TEST_F(ImageDrawTest, PaintImageClipped) { } TEST_F(ImageDrawTest, PaintImageClipped2) { VkvgContext ctx = vkvg_create(surf); - vkvg_rectangle(ctx, 100,100, 200, 200); - vkvg_arc(ctx, 140, 140, 100, 0, 2.f*M_PI); + vkvg_rectangle(ctx, 100, 100, 200, 200); + vkvg_arc(ctx, 140, 140, 100, 0, 2.f * M_PI); vkvg_clip(ctx); vkvg_set_source_surface(ctx, imgSurf, 0, 0); vkvg_paint(ctx); -- cgit v1.3.1-4-g156e From 59753ce85d561b21acc6b58fcd302b6abe79a04d Mon Sep 17 00:00:00 2001 From: realstealthninja <68815218+realstealthninja@users.noreply.github.com> Date: Tue, 22 Sep 2026 05:57:18 +0530 Subject: chore: use cmath in cpp --- gunit_tests/unitTest.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gunit_tests/unitTest.h b/gunit_tests/unitTest.h index 9c0c4db..9304f0b 100644 --- a/gunit_tests/unitTest.h +++ b/gunit_tests/unitTest.h @@ -1,13 +1,11 @@ #pragma once -#include +#include #define CHECK_MAT(_xx, _yx, _xy, _yy, _x0, _y0) \ -EXPECT_FLOAT_EQ(mat.xx, _xx); \ + EXPECT_FLOAT_EQ(mat.xx, _xx); \ EXPECT_FLOAT_EQ(mat.yx, _yx); \ EXPECT_FLOAT_EQ(mat.xy, _xy); \ EXPECT_FLOAT_EQ(mat.yy, _yy); \ EXPECT_FLOAT_EQ(mat.x0, _x0); \ EXPECT_FLOAT_EQ(mat.y0, _y0); - - -- cgit v1.3.1-4-g156e From ccd92fca2f30e38e124743e18dd2b7d0b2edb168 Mon Sep 17 00:00:00 2001 From: realstealthninja <68815218+realstealthninja@users.noreply.github.com> Date: Tue, 22 Sep 2026 05:57:35 +0530 Subject: chore: use cmath and _use_math_defines in cpp --- gunit_tests/save_restore.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gunit_tests/save_restore.cpp b/gunit_tests/save_restore.cpp index fb0f18d..46d99da 100644 --- a/gunit_tests/save_restore.cpp +++ b/gunit_tests/save_restore.cpp @@ -1,5 +1,7 @@ #include "drawTestBase.h" -#include + +#define _USE_MATH_DEFINES +#include class SaveRestoreTest : public DrawTestBase { @@ -24,7 +26,7 @@ class SaveRestoreTest : public DrawTestBase { vkvg_clip(ctx); vkvg_set_source_rgb(ctx, depthRatio, depthRatio, 1.f); vkvg_paint(ctx); - vkvg_arc(ctx, 256, 256, 256.f - gap * depth, 0, 2.f*M_PI); + vkvg_arc(ctx, 256, 256, 256.f - gap * depth, 0, 2.f * M_PI); vkvg_clip(ctx); vkvg_set_source_surface(ctx, imgSurf, 0, 0); vkvg_paint(ctx); @@ -52,7 +54,7 @@ class SaveRestoreTest : public DrawTestBase { TEST_F(SaveRestoreTest, RestoreClip1) { VkvgContext ctx = vkvg_create(surf); - vkvg_arc(ctx, 140, 140, 100, 0, 2.f*M_PI); + vkvg_arc(ctx, 140, 140, 100, 0, 2.f * M_PI); vkvg_clip(ctx); vkvg_save(ctx); vkvg_reset_clip(ctx); -- cgit v1.3.1-4-g156e From 95bff801689dcb4e64e47113e227704d5b29cbc3 Mon Sep 17 00:00:00 2001 From: realstealthninja <68815218+realstealthninja@users.noreply.github.com> Date: Tue, 22 Sep 2026 06:03:18 +0530 Subject: chore: define math defines first --- gunit_tests/drawTestBase.h | 1 + gunit_tests/imageDraw.cpp | 1 - gunit_tests/save_restore.cpp | 2 -- gunit_tests/unitTest.h | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/gunit_tests/drawTestBase.h b/gunit_tests/drawTestBase.h index 350e08c..403449b 100644 --- a/gunit_tests/drawTestBase.h +++ b/gunit_tests/drawTestBase.h @@ -1,4 +1,5 @@ #pragma once +#define _USE_MATH_DEFINES #include #include "vkvg.h" #include diff --git a/gunit_tests/imageDraw.cpp b/gunit_tests/imageDraw.cpp index 25b6f4d..a988f9d 100644 --- a/gunit_tests/imageDraw.cpp +++ b/gunit_tests/imageDraw.cpp @@ -1,5 +1,4 @@ #include "drawTestBase.h" -#define _USE_MATH_DEFINES #include class ImageDrawTest : public DrawTestBase { diff --git a/gunit_tests/save_restore.cpp b/gunit_tests/save_restore.cpp index 46d99da..f82a208 100644 --- a/gunit_tests/save_restore.cpp +++ b/gunit_tests/save_restore.cpp @@ -1,6 +1,4 @@ #include "drawTestBase.h" - -#define _USE_MATH_DEFINES #include class SaveRestoreTest : public DrawTestBase { diff --git a/gunit_tests/unitTest.h b/gunit_tests/unitTest.h index 9304f0b..a0b75cd 100644 --- a/gunit_tests/unitTest.h +++ b/gunit_tests/unitTest.h @@ -1,5 +1,5 @@ #pragma once - +#define _USE_MATH_DEFINES #include #define CHECK_MAT(_xx, _yx, _xy, _yy, _x0, _y0) \ -- cgit v1.3.1-4-g156e