diff --git a/.vscode/launch.json b/.vscode/launch.json index d748737a4..80d6cae02 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,7 @@ "request": "launch", "program": "${workspaceFolder}/build/src/test/pikascript_test", "args": [ - "--gtest_filter=args*" + "--gtest_filter=args.test3" ], "stopAtEntry": false, "cwd": "${workspaceFolder}", diff --git a/src/boot/banchmark/main.c b/src/boot/banchmark/main.c index 730f830e6..67f6eea12 100644 --- a/src/boot/banchmark/main.c +++ b/src/boot/banchmark/main.c @@ -85,21 +85,21 @@ int32_t main() } { Arg *arg = New_arg(NULL); - arg_setInt(arg, 0); + arg = arg_setInt(arg, 0); checker_printMemUsage("int arg"); arg_deinit(arg); checker_assertMemFree(); } { Arg *arg = New_arg(NULL); - arg_setFloat(arg, 0); + arg = arg_setFloat(arg, 0); checker_printMemUsage("float arg"); arg_deinit(arg); checker_assertMemFree(); } { Arg *arg = New_arg(NULL); - arg_setStr(arg, "test string"); + arg = arg_setStr(arg, "test string"); checker_printMemUsage("str arg"); arg_deinit(arg); checker_assertMemFree(); diff --git a/src/package/pikascript/pikascript-core b/src/package/pikascript/pikascript-core index 8d16db274..3aa6cd163 160000 --- a/src/package/pikascript/pikascript-core +++ b/src/package/pikascript/pikascript-core @@ -1 +1 @@ -Subproject commit 8d16db27496203dd3874ce1d7fc1a559b540a87d +Subproject commit 3aa6cd1631167a50e8957f11b6aa9ecc129a0979 diff --git a/src/test/arg-test.cpp b/src/test/arg-test.cpp index 18bf6bbd1..863f62f2a 100644 --- a/src/test/arg-test.cpp +++ b/src/test/arg-test.cpp @@ -9,7 +9,7 @@ static int mem; TEST(arg_test, int_) { Arg *arg = New_arg(NULL); - arg_setInt(arg, 1); + arg = arg_setInt(arg, 1); int a = arg_getInt(arg); EXPECT_EQ(a, 1); arg_deinit(arg); @@ -19,7 +19,7 @@ TEST(arg_test, int_) TEST(arg_test, float_) { Arg *arg = New_arg(NULL); - arg_setFloat(arg, 1.01); + arg = arg_setFloat(arg, 1.01); float a = arg_getFloat(arg); EXPECT_EQ(a, (float)1.01); arg_deinit(arg); @@ -29,7 +29,7 @@ TEST(arg_test, float_) TEST(arg_test, str_) { Arg *arg = New_arg(NULL); - arg_setStr(arg, (char *)"test str"); + arg = arg_setStr(arg, (char *)"test str"); char *a = arg_getStr(arg); EXPECT_EQ(strEqu(a, (char *)"test str"), 1); arg_deinit(arg); @@ -40,7 +40,7 @@ TEST(arg_test, ptr) { Arg *arg = New_arg(NULL); int a = 1; - arg_setPtr(arg, &a); + arg = arg_setPtr(arg, &a); int *pa = (int *)arg_getPtr(arg); EXPECT_EQ(*pa, 1); arg_deinit(arg); @@ -50,7 +50,7 @@ TEST(arg_test, ptr) TEST(arg_test, name) { Arg *arg = New_arg(NULL); - arg_setName(arg, (char *)"test"); + arg = arg_setName(arg, (char *)"test"); char *name = arg_getName(arg); EXPECT_STREQ((char *)"test", name); arg_deinit(arg); @@ -60,7 +60,7 @@ TEST(arg_test, name) TEST(arg_test, type) { Arg *arg = New_arg(NULL); - arg_setType(arg, (char *)"test"); + arg = arg_setType(arg, (char *)"test"); char *type = arg_getType(arg); EXPECT_EQ(1, strEqu((char *)"test", type)); arg_deinit(arg);