Giter VIP home page Giter VIP logo

Comments (8)

brarcher avatar brarcher commented on August 25, 2024

I have a few questions to help me understand your setup.

I compiled the Framework with gcc 64bits on the same Windows.

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?

from check.

hqbrice avatar hqbrice commented on August 25, 2024

Can you give further details on your build setup? Are you using MinGW to get gcc for Windows, or something else?

I use a gcc produced by makeinfo version 4.11 and the Code::blocks program.
This is the console log after build :
x86_64-pc-mingw32-g++.exe -shared -Wl,--output-def=..\..\project\bin\libCheck.def -Wl,--out-implib=..\..\project\bin\libCheck.a -Wl,--dll obj\Release\check.o obj\Release\check_error.o obj\Release\check_list.o obj\Release\check_log.o obj\Release\check_msg.o obj\Release\check_pack.o obj\Release\check_print.o obj\Release\check_run.o obj\Release\check_str.o -o ..\..\project\bin\libCheck.dll -s Creating library file: ..\..\project\bin\libCheck.a Output file is ..\..\project\bin\libCheck.dll with size 29.00 KB

Are you able to compile and run Check's own unit tests using your toolchain and see if they can run successfully?

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

from check.

brarcher avatar brarcher commented on August 25, 2024

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.

from check.

hqbrice avatar hqbrice commented on August 25, 2024

I asked for help from a colleague to ask you.
So it seems there is a bug into the Framework for test doens't crash thanks to him. Here its modifications :
in check.c line 302, crash on vsnprintf.

Incheck-0.10.0/CMakeLists.txt, comment :
#check_function_exists(snprintf HAVE_SNPRINTF)
#check_function_exists(vsnprintf HAVE_VSNPRINTF)
#check_function_exists(vasnprintf HAVE_VASNPRINTF)
#check_function_exists(asprintf HAVE_ASPRINTF)
#check_function_exists(vasprintf HAVE_VASPRINTF)

In check-0.10.0/src/ CMakeLists.txt
Modify location by absolute path

set(LIBCOMPAT C:/Transfert/check-0.10.0/lib/libcompat.a)
and add ${LIBCOMPAT} after :
target_link_libraries(check ${LIBM} ${LIBRT} ${SUBUNIT} )

I hope this can help you to improve your good Framework

Is there provision for add some assertions ?
For Strings, I use char* whithout the '\0' end of string and, tests crashes too because of memory overrun. I bypassing this by modify the string before. But use a assertion by giving the lenth of the string would be a better solution.

from check.

brarcher avatar brarcher commented on August 25, 2024

For Strings, I use char* whithout the '\0' end of string and, tests crashes too because of memory overrun.

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.

from check.

hqbrice avatar hqbrice commented on August 25, 2024

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.

from check.

brarcher avatar brarcher commented on August 25, 2024

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?

from check.

brarcher avatar brarcher commented on August 25, 2024

This issue is believed to be solved in release 0.11.0. If it is not, please re-open the issue.

from check.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.