opendal icon indicating copy to clipboard operation
opendal copied to clipboard

feat(bindings/c): basic read and write op, a dirty way

Open PsiACE opened this issue 2 years ago • 5 comments

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

cmocka is an elegant unit testing framework for C with support for mock objects. Licensed under Apache-2.0.

PsiACE avatar Mar 15 '23 17:03 PsiACE

🥺, I don't like introducing things that need extra setup...

Xuanwo avatar Mar 15 '23 17:03 Xuanwo

Maybe a simple C program is enough? And I expect we don't need do complex unit tests at bindings level.

Xuanwo avatar Mar 15 '23 17:03 Xuanwo

pleading_face, I don't like introducing things that need extra setup...

There are indeed some unit testing libraries that are head-only. I just want to avoid copying files directly.

Let me reconsider it during the day, in any case, I think testing (may be simple) is necessary.

PsiACE avatar Mar 15 '23 17:03 PsiACE

Yes, I do think testing is important. But we can do this without introducing any other deps.

Considering we don't have a working c binding so far, I prefer to implement the feature first than take the testing infra into consideration.

Xuanwo avatar Mar 15 '23 17:03 Xuanwo

IMHO, you can use rust-bindgen to generate Rust bindings for the C-API and write tests in Rust instead so you can just run cargo test. 😂

messense avatar Mar 16 '23 00:03 messense

Thank you for your effort. I will close this PR to give you more space to continue your work. You are welcome to reopen this PR when you are ready for reviewing. Thank you once again!

Xuanwo avatar Mar 18 '23 11:03 Xuanwo