Skip to content

Commit

Permalink
Rename endskip and endtodo to end_skip and end_todo
Browse files Browse the repository at this point in the history
The other functions use underscore separated names like cmp_ok, dies_ok,
lives_ok, done_testing, BAIL_OUT. These functions should too.
  • Loading branch information
Jake Gelbman committed Jul 13, 2012
1 parent e1329bf commit 0e45669
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -198,16 +198,16 @@ FUNCTIONS

- skip(test, n)
- skip(test, n, fmt, ...)
- endskip
- end_skip

Skip a series of n tests if test is true. You may give a reason why you are
skipping them or not. The (possibly) skipped tests must occur between the
skip and endskip macros.
skip and end_skip macros.

skip(TRUE, 2);
ok(1);
ok(0);
endskip;
end_skip;

prints:

Expand All @@ -216,14 +216,14 @@ FUNCTIONS

- todo()
- todo(fmt, ...)
- endtodo
- end_todo

Specifies a series of tests that you expect to fail because they are not
yet implemented.

todo()
ok(0);
endtodo;
end_todo;

prints:

Expand Down
8 changes: 4 additions & 4 deletions t/skip.c
Expand Up @@ -7,18 +7,18 @@ int main () {
ok(1, "quux");
ok(1, "thud");
ok(1, "wombat");
endskip;
end_skip;
skip(1, 1, "need to be on windows");
ok(0, "blurgle");
endskip;
end_skip;
skip(0, 3);
ok(1, "quux");
ok(1, "thud");
ok(1, "wombat");
endskip;
end_skip;
skip(1, 1);
ok(0, "blurgle");
endskip;
end_skip;
done_testing();
}

4 changes: 2 additions & 2 deletions t/todo.c
Expand Up @@ -7,12 +7,12 @@ int main () {
ok(0, "foo");
ok(1, "bar");
ok(1, "baz");
endtodo;
end_todo;
todo("im not ready");
ok(0, "quux");
ok(1, "thud");
ok(1, "wombat");
endtodo;
end_todo;
done_testing();
}

2 changes: 1 addition & 1 deletion tap.c
Expand Up @@ -262,7 +262,7 @@ todof (int ignore, const char *fmt, ...) {
}

void
endtodof () {
end_todof () {
free(todo_mesg);
todo_mesg = NULL;
}
Expand Down
6 changes: 3 additions & 3 deletions tap.h
Expand Up @@ -40,7 +40,7 @@ int note (const char *fmt, ...);
int exit_status (void);
void skippy (int n, const char *fmt, ...);
void todof (int ignore, const char *fmt, ...);
void endtodof (void);
void end_todof (void);

#define NO_PLAN -1
#define SKIP_ALL -2
Expand All @@ -55,10 +55,10 @@ void endtodof (void);
#define fail(...) ok(0, "" __VA_ARGS__)

#define skip(test, ...) do {if (test) {skippy(__VA_ARGS__, NULL); break;}
#define endskip } while (0)
#define end_skip } while (0)

#define todo(...) todof(0, "" __VA_ARGS__, NULL)
#define endtodo endtodof()
#define end_todo end_todof()

#define dies_ok(...) dies_ok_common(1, __VA_ARGS__)
#define lives_ok(...) dies_ok_common(0, __VA_ARGS__)
Expand Down

0 comments on commit 0e45669

Please sign in to comment.