Update native-unit-test.yml (#10130)

* Update native-unit-test.yml
This commit is contained in:
江战
2022-02-21 11:49:00 +08:00
committed by GitHub
parent 2b50252397
commit ab939cefdf
2 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ jobs:
- name: Run Unit Tests
shell: bash
run: |
cmake -B tests/unit-test/build -S tests/unit-test -G"Visual Studio 16 2019" -A win32
cmake -B tests/unit-test/build -S tests/unit-test
cmake --build tests/unit-test/build --config Release
./tests/unit-test/build/src/Release/CocosTest.exe
@@ -27,12 +27,12 @@ THE SOFTWARE.
#include "cocos/math/Vertex.h"
#include "utils.h"
#include <math.h>
#include <vector>
#include <array>
TEST(mathVertexTest, test8) {
// ccVertexLineToPolygon
logLabel = "test the vertex ccVertexLineToPolygon function";
cc::Vec2 points[4];
std::array<cc::Vec2,4 > points;
cc::Vec2 p1(1, 1);
points[0] = p1;
cc::Vec2 p2(10, 10);
@@ -41,8 +41,8 @@ TEST(mathVertexTest, test8) {
points[2] = p3;
cc::Vec2 p4(20, 70);
points[3] = p4;
cc::Vec2 outP[6];
cc::ccVertexLineToPolygon(points, 1, outP, 0, 5);
std::array<cc::Vec2, points.size() * 2> outP;
cc::ccVertexLineToPolygon(points.data(), 1, outP.data(), 0, points.size());
ExpectEq(IsEqualF(outP[5].x, -0.468942523) && IsEqualF(outP[5].y, -9.82652664), true);
// ccVertexLineIntersect
logLabel = "test the vertex ccVertexLineIntersect function";
@@ -52,3 +52,4 @@ TEST(mathVertexTest, test8) {
}