how to port c code into java? starting instructions [closed]

人走茶凉 提交于 2019-12-13 08:01:30

问题


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


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/6748778/how-to-port-c-code-into-java-starting-instructions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!