Currently end-user should include two files: h2unit.cpp and h2unit.h.
If there two files can be merged into one file , it will be more simple to use.
C++ class can be wrote in header file, static member method and static variable can be used to implement global instance. I have wrote a test, it works.
The difficult is how to implement memory leak detection for C source file.
A work around is that consider C source file as C++ source file and compile with C++ compiler.
Currently end-user should include two files: h2unit.cpp and h2unit.h. If there two files can be merged into one file , it will be more simple to use.
C++ class can be wrote in header file, static member method and static variable can be used to implement global instance. I have wrote a test, it works.
The difficult is how to implement memory leak detection for C source file. A work around is that consider C source file as C++ source file and compile with C++ compiler.