mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
Merge branch 'master' of https://gitee.com/lyon1998/pikascript
This commit is contained in:
commit
3b3edeec1b
@ -23,7 +23,7 @@ releases = [
|
||||
"v1.2.9 c35940141816c74e164c83c38bcdab7d6ffe1a2f",
|
||||
"v1.3.0 3032d3d05423b5f3dd2a4efe1f8eadd1d835f58f",
|
||||
"v1.3.1 343a1d56c53bba78fce9a0cd0cc8dfcd580632be",
|
||||
"v1.3.2 fd7c2f93aa8e0870c0acd534b79604265afd265e",
|
||||
"v1.3.2 b54cd1ed5ae45c4f5789e266ea1f4f2e420ec306",
|
||||
]
|
||||
|
||||
[[packages]]
|
||||
@ -39,7 +39,7 @@ releases = [
|
||||
"v1.2.5 c35940141816c74e164c83c38bcdab7d6ffe1a2f",
|
||||
"v1.3.0 5eedf8be911f4c389c5496a79b600004077039f5",
|
||||
"v1.3.1 343a1d56c53bba78fce9a0cd0cc8dfcd580632be",
|
||||
"v1.3.2 fd7c2f93aa8e0870c0acd534b79604265afd265e",
|
||||
"v1.3.2 b54cd1ed5ae45c4f5789e266ea1f4f2e420ec306",
|
||||
]
|
||||
|
||||
[[packages]]
|
||||
@ -48,7 +48,7 @@ releases = [
|
||||
"v0.0.1 74426e4bd3e97060f06b2cb451a38042b5634abc",
|
||||
"v0.0.9 2d22ed170a7766c3ce6716ca123bdf5a83e344ed",
|
||||
"v1.3.1 343a1d56c53bba78fce9a0cd0cc8dfcd580632be",
|
||||
"v1.3.2 fd7c2f93aa8e0870c0acd534b79604265afd265e",
|
||||
"v1.3.2 b54cd1ed5ae45c4f5789e266ea1f4f2e420ec306",
|
||||
]
|
||||
|
||||
[[packages]]
|
||||
|
0
port/linux/api-make-linux.sh
Normal file → Executable file
0
port/linux/api-make-linux.sh
Normal file → Executable file
0
port/linux/api-make-win10.sh
Normal file → Executable file
0
port/linux/api-make-win10.sh
Normal file → Executable file
0
port/linux/api-make.sh
Normal file → Executable file
0
port/linux/api-make.sh
Normal file → Executable file
0
port/linux/ci_benchmark.sh
Normal file → Executable file
0
port/linux/ci_benchmark.sh
Normal file → Executable file
0
port/linux/gtest.sh
Normal file → Executable file
0
port/linux/gtest.sh
Normal file → Executable file
0
port/linux/init.sh
Normal file → Executable file
0
port/linux/init.sh
Normal file → Executable file
0
port/linux/install_dependency.sh
Normal file → Executable file
0
port/linux/install_dependency.sh
Normal file → Executable file
0
port/linux/make.sh
Normal file → Executable file
0
port/linux/make.sh
Normal file → Executable file
0
port/linux/pkg-push.sh
Normal file → Executable file
0
port/linux/pkg-push.sh
Normal file → Executable file
0
port/linux/pull-core.sh
Normal file → Executable file
0
port/linux/pull-core.sh
Normal file → Executable file
0
port/linux/push-core.sh
Normal file → Executable file
0
port/linux/push-core.sh
Normal file → Executable file
0
port/linux/run.sh
Normal file → Executable file
0
port/linux/run.sh
Normal file → Executable file
0
port/linux/test-banchmark.sh
Normal file → Executable file
0
port/linux/test-banchmark.sh
Normal file → Executable file
@ -179,4 +179,19 @@ TEST(args, index) {
|
||||
/* check memory */
|
||||
args_deinit(args);
|
||||
EXPECT_EQ(pikaMemNow(), 0);
|
||||
}
|
||||
|
||||
TEST(args, int_float_convert) {
|
||||
Args* args = New_args(NULL);
|
||||
args_setInt(args, (char*)"a", 10);
|
||||
args_setFloat(args, (char*)"b", 2.333);
|
||||
|
||||
float a = args_getFloat(args, (char*)"a");
|
||||
int b = args_getInt(args, (char*)"b");
|
||||
/* assert */
|
||||
EXPECT_EQ(a, 10);
|
||||
EXPECT_FLOAT_EQ(b, 2);
|
||||
/* check memory */
|
||||
args_deinit(args);
|
||||
EXPECT_EQ(pikaMemNow(), 0);
|
||||
}
|
@ -284,7 +284,7 @@ TEST(pikaMain, PikaStdData) {
|
||||
int b = obj_getInt(pikaMain, (char*)"b");
|
||||
/* assert */
|
||||
EXPECT_EQ(a, 1);
|
||||
EXPECT_EQ(b, 0);
|
||||
EXPECT_EQ(b, -999999999);
|
||||
|
||||
/* deinit */
|
||||
obj_deinit(pikaMain);
|
||||
|
0
port/linux/update-compiler.sh
Normal file → Executable file
0
port/linux/update-compiler.sh
Normal file → Executable file
@ -108,7 +108,13 @@ int64_t args_getInt(Args* self, char* name) {
|
||||
if (NULL == arg) {
|
||||
return -999999999;
|
||||
}
|
||||
return arg_getInt(arg);
|
||||
ArgType arg_type = arg_getType(arg);
|
||||
if (arg_type == TYPE_INT) {
|
||||
return arg_getInt(arg);
|
||||
} else if (arg_type == TYPE_FLOAT) {
|
||||
return (int)arg_getFloat(arg);
|
||||
}
|
||||
return -999999999;
|
||||
}
|
||||
|
||||
int32_t args_getSize(Args* self) {
|
||||
@ -129,7 +135,13 @@ float args_getFloat(Args* self, char* name) {
|
||||
if (NULL == arg) {
|
||||
return -999999999.0;
|
||||
}
|
||||
return arg_getFloat(arg);
|
||||
ArgType arg_type = arg_getType(arg);
|
||||
if (arg_type == TYPE_FLOAT) {
|
||||
return arg_getFloat(arg);
|
||||
} else if (arg_type == TYPE_INT) {
|
||||
return (float)arg_getInt(arg);
|
||||
}
|
||||
return -999999999.0;
|
||||
}
|
||||
|
||||
int32_t args_copyArg(Args* self, Arg* argToBeCopy) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user