1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Backport of Bug#53303 mytap tests should always have a plan()

The bug was caused by buffered output. Flushing resolved it.
We still recommend to allways call plan().
  
Also fix some compile warnings (formal parameter different from declaration)


unittest/examples/Makefile.am:
  Omit core-t, since it will always fail.
unittest/examples/no_plan-t.c:
  Comment that we recommend calling plan(NO_PLAN)
unittest/mytap/tap.c:
  Use the named constant NO_PLAN
  Flush all output.
unittest/mytap/tap.h:
  Change documentation for the plan() function.
This commit is contained in:
Tor Didriksen
2010-06-10 13:15:35 +02:00
parent 34ceaa6a3d
commit a24df71e95
4 changed files with 26 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2006 MySQL AB
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,14 +20,19 @@
/*
Sometimes, the number of tests is not known beforehand. In those
cases, the plan can be omitted and will instead be written at the
end of the test (inside exit_status()).
cases, you should invoke plan(NO_PLAN).
The plan will be printed at the end of the test (inside exit_status()).
Use this sparingly, it is a last resort: planning how many tests you
are going to run will help you catch that offending case when some
tests are skipped for an unknown reason.
*/
int main() {
/*
We recommend calling plan(NO_PLAN), but want to verify that
omitting the call works as well.
plan(NO_PLAN);
*/
ok(1, " ");
ok(1, " ");
ok(1, " ");