C bob: added unit testing code
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "bob.h"
|
#include "bob.h"
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
char*answers[] = {
|
char*answers[] = {
|
||||||
"Whatever.",
|
"Whatever.",
|
||||||
@@ -29,15 +28,13 @@ char *hey_bob(char *w)
|
|||||||
* https://github.com/braoult/exercism/blob/master/c/templates/GNUmakefile
|
* https://github.com/braoult/exercism/blob/master/c/templates/GNUmakefile
|
||||||
*/
|
*/
|
||||||
#ifdef UNIT_TEST
|
#ifdef UNIT_TEST
|
||||||
|
#include <stdio.h>
|
||||||
int main(int ac, char **av)
|
int main(int ac, char **av)
|
||||||
{
|
{
|
||||||
int arg=1;
|
int arg=1;
|
||||||
resistor_band_t i[2];
|
|
||||||
|
|
||||||
for (; arg<ac-1; ++arg, ++arg) {
|
for (; arg<ac; ++arg) {
|
||||||
*i=atoi(av[arg]);
|
printf("bob(%s)=%s\n", av[arg], hey_bob(av[arg]));
|
||||||
*(i+1)=atoi(av[arg+1]);
|
|
||||||
printf("color(%d, %d)=%d\n", i[0], i[1], color_code(i));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user