3 ms·
That tends to matter less if you have a decent test harness and plenty of assertions!
by gouranga 14y ago
That tends to matter less if you have a decent test harness and plenty of assertions!
- ajanuary 14y agoHadn't thought about that. I haven't done much C since I discovered proper automated tests.
- beagle3 14y agoNot everywhere C's undefinededness lies; e.g. shifting more sizof(int) bits - in case the shift parameter is dependent on your input. "Decent test harness" is like "sufficiently smart compiler". Everyone assumes it will be there when planning, but in practice it is only available in very specific and not-generally-useful cases.
- silentbicycle 14y agoHere's a one-file, ISC-licensed test framework I wrote for ANSI C: "greatest" (https://github.com/silentbicycle/greatest https://github.com/silentbicycle/greatest). It doesn't depend on any dynamic allocation, or anything beyond C89, and compiles with zero warnings under -Wall -pedantic.