how to port c code into java? starting instruction

2019-12-16 20:11发布

I am working on porting a library over from C++ to Java. I want to know the first / initial steps to begin this port. I am not sure how will I test / debug? I could just start with the "main" file and begin rewriting code, but how and when do I test what I am doing? When I am done the COMPLETE port? How do I start about this, any help would be great.

Any cross platform / etc compiler would help? let me know the steps please

标签: java c++ c port
2条回答
何必那么认真
2楼-- · 2019-12-16 20:38

You can wrap the old library in JNI and call it from your unit test to ensure the ported code does exactly the same thing as the old code.

查看更多
男人必须洒脱
3楼-- · 2019-12-16 20:50

You can port piece-by-piece, bottom-up, and test each piece individually with junit or testng.

查看更多
登录 后发表回答