test: dynamic function argument bind test
This commit is contained in:
@@ -10,7 +10,7 @@ int main(int argc, const char **argv)
|
|||||||
};
|
};
|
||||||
|
|
||||||
fx_function *func = fx_function_create(
|
fx_function *func = fx_function_create(
|
||||||
"test_function",
|
"printf",
|
||||||
FX_FUNCTION_F_VARARG,
|
FX_FUNCTION_F_VARARG,
|
||||||
(fx_function_impl)printf,
|
(fx_function_impl)printf,
|
||||||
arg_types,
|
arg_types,
|
||||||
@@ -23,8 +23,10 @@ int main(int argc, const char **argv)
|
|||||||
FX_VALUE_DOUBLE(2.5),
|
FX_VALUE_DOUBLE(2.5),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fx_function_bind(func, args, sizeof args / sizeof args[0]);
|
||||||
|
|
||||||
fx_value result = FX_VALUE_EMPTY;
|
fx_value result = FX_VALUE_EMPTY;
|
||||||
int r = fx_function_invoke(func, args, 3, &result);
|
int r = fx_function_invoke(func, NULL, 0, &result);
|
||||||
printf("%" PRIdPTR "\n", result.v_int);
|
printf("%" PRIdPTR "\n", result.v_int);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user