-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash on ck_assert_int_eq when false #75
Comments
I have a few questions to help me understand your setup.
Can you give further details on your build setup? Are you using MinGW to get gcc for Windows, or something else? Are you able to compile and run Check's own unit tests using your toolchain and see if they can run successfully? Are you able to run the unit testing program you are developing in a debugger to see where the failure occurs? |
I use a gcc produced by makeinfo version 4.11 and the Code::blocks program.
Not directly. I have to modify files to make it works. And I have to take a time for this. For example clockid_t doesn't exist on our compiler... I do not use any debugger. I can join my test.exe and check compiled as a library |
I've not used Code::blocks before. Check currently is tested to work against MinGW and Visual Studios, and is known to work also against Cygwin. Getting Check to build for those platforms goes through CMake or Autotools. My understanding from looking online is that CMake can generate Makefiles for Code::blocks: https://cmake.org/cmake/help/v3.0/generator/CodeBlocks.html CMake performs some checks on the platform and will enable/disable certain features based on what it finds. You may find that the Makefiles generated by CMake can build Check without any additional modification. If that is not the case, contributions to the CMake setup in Check are welcome if you are up for getting CMake to work with Code::blocks. |
I asked for help from a colleague to ask you. Incheck-0.10.0/CMakeLists.txt, comment : In check-0.10.0/src/ CMakeLists.txt set(LIBCOMPAT C:/Transfert/check-0.10.0/lib/libcompat.a) I hope this can help you to improve your good Framework Is there provision for add some assertions ? |
There will be several new macros which will allow one to check memory contents, for example ck_assert_mem_eq(X, Y, L) will check that two memory regions X and Y are equal to a length L. It sounds like these macros will help. As there has not yet been a release with these macros, you are welcome to take the master branch on git and try it out and give feedback. As for your crash, are you able to generate Makefiles using CMake for Code::blocks? If so, is CMake not able to detect the platform correctly and thus configures Check incorrectly, leading to a crash (SIGSEGV?) in vsnprintf? Not all platforms have a suitable implementation of the *printf functions, so on these platforms a version of these functions packaged with Check is used. Can you provide the output of CMake, as well as the CMakeCache.txt file generated by CMake if it exists. That may help in determining what CMake decided for your platform. |
Use Code::Blocks was a way for me to compile the Framework because C language is not my specialty. My colleague generated a Makefile for make for me. I can provide you CMakeCache.txt file generated by CMake. |
Someone reported a similar issue, that may be the same issue, in #107. They observed that the issue is resolved in Check 0.11.0. Might you check if the crash is no longer reproducible in Check 0.11.0? |
This issue is believed to be solved in release 0.11.0. If it is not, please re-open the issue. |
Hello,
I'm writting a simple test with ck_assert_int_eq and this crashes when tests is failed :
START_TEST (test_int_assert) {
fprintf(stdout, "test_int_assert starting...\n");fflush(stdout);
int exp = 0;
int actual = 1;
}
END_TEST
When I run .exe test, I see on console the first three fprintf and Windows display error message "programm stopped working"...
I compiled the Framework with gcc 64bits on the same Windows.
Thanks
The text was updated successfully, but these errors were encountered: