Thinking in C and *nix (CSC 282 2015S) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [Teaching & Learning] - [Calendar]
Current: [Outline] [EBoard] [Lab] [Assignment]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines]
Reference: [EBook] - [ISO] [GNU Coding Standards] [GCC Documentation] - [TAoUP] [Make3]
Previous Offerings: [CSC 295 2013S] [CSC 295 2014S]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker]
Overview
What do we do when we have to unit test our C programs? (You want the computer to read the output!)
Write code by hand
if (fun(input) != expected_value)
fprintf (stderr, "Test case 43.1 failed!");
Write an interactive tester (tester)
inputs)outputs)Write a generalized testing framework. (Using Macros?)
Find an existing testing framework. Just because there's no standard, it doesn't mean there isn't one.
Tradition in C: Use assert
/home/rebelsky/Web/Courses/CSC282/2015S/examples/binary-search
<http://www.cs.grinnell.edu/~rebesky/Courses/CSC282/2015S/examples/binary-search>