From: James C. <qu...@la...> - 2016-11-30 00:03:42
|
Fixed in two commits, please review. As "make test" only tests vector.c, it isn't of much use. Lots of other code not being tested. Don't let your users be deceived into thinking the test is comprehensive. On Wed, Nov 30, 2016 at 12:01:52AM +0100, Christoph Biedl wrote: > Hello, > > can please somebody take a look why "make test" fails on several levels? > > At the moment, a "test" binary is to be built, without success. > > $ make test > gcc -c -o vector_test.o vector_test.c > (...) > gcc -o vector_test vector_test.o vector.o > gcc test.o vector_test -o test > /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o: In function `_start': > (.text+0x20): undefined reference to `main' > (...) > > Also running the created vector_test (is this supposed to be done in the test > target?) triggers an assertion failure: > > | vector_test: vector_test.c:78: main: Assertion `j==k' failed. > > Or, with hardening build enabled: > > | *** stack smashing detected ***: ./vector_test terminated > > Looking at the compiler warnings like > > | vector_test.c:29:38: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] > | retval = vector_insert(v, i, (PPTP_CALL *)i); > > this is little surprising. > > Cheers, > > Christoph > -- James Cameron http://quozl.netrek.org/ |