diff options
| author | ruki <[email protected]> | 2024-04-02 22:49:44 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-04-02 22:49:44 +0800 |
| commit | f0cb5ad5d4aa420151f87ad497656bc68be182da (patch) | |
| tree | 4180f030d8245945a5802bdeec247d25e5ef138a /tests/projects | |
| parent | 6953ca0c43ff4cb08fc9f76eabb5415a892e5167 (diff) | |
call binary module
Diffstat (limited to 'tests/projects')
3 files changed, 4 insertions, 4 deletions
diff --git a/tests/projects/other/native_module/modules/binary/bar/src/add.cpp b/tests/projects/other/native_module/modules/binary/bar/src/add.cpp index 87ef97e6c..e19d07e12 100644 --- a/tests/projects/other/native_module/modules/binary/bar/src/add.cpp +++ b/tests/projects/other/native_module/modules/binary/bar/src/add.cpp @@ -4,6 +4,6 @@ int main(int argc, char** argv) { int a = atoi(argv[1]); int b = atoi(argv[2]); - printf("%s\n", a + b); + printf("%d", a + b); return 0; } diff --git a/tests/projects/other/native_module/modules/binary/bar/src/sub.cpp b/tests/projects/other/native_module/modules/binary/bar/src/sub.cpp index 524930500..980289d1a 100644 --- a/tests/projects/other/native_module/modules/binary/bar/src/sub.cpp +++ b/tests/projects/other/native_module/modules/binary/bar/src/sub.cpp @@ -4,7 +4,7 @@ int main(int argc, char** argv) { int a = atoi(argv[1]); int b = atoi(argv[2]); - printf("%s\n", a - b); + printf("%d", a - b); return 0; } diff --git a/tests/projects/other/native_module/xmake.lua b/tests/projects/other/native_module/xmake.lua index 44b310649..e5564cf4f 100644 --- a/tests/projects/other/native_module/xmake.lua +++ b/tests/projects/other/native_module/xmake.lua @@ -10,7 +10,7 @@ target("test") import("binary.bar") -- print("shared: 1 + 1 = %d", foo.add(1, 1)) -- print("shared: 1 - 1 = %d", foo.sub(1, 1)) - print("binary: 1 + 1 = %s", bar.add("1", "1")) - print("binary: 1 - 1 = %s", bar.sub("1", "1")) + print("binary: 1 + 1 = %s", bar.add(1, 1)) + print("binary: 1 - 1 = %s", bar.sub(1, 1)) end) |
