~ubuntu-branches/ubuntu/wily/grub2/wily-proposed

« back to all changes in this revision

Viewing changes to tests/lib/test.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Zielcke, Robert Millan, Felix Zielcke
  • Date: 2010-01-26 19:26:25 UTC
  • mfrom: (1.13.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100126192625-coq6czap2ofjollf
Tags: 1.98~20100126-1
* New Bazaar snapshot.
  - Includes mipsel-yeeloong port.

[ Robert Millan ]
* config.in: Lower priority of grub2/linux_cmdline_default.

[ Felix Zielcke ]
* Drop `CFLAGS=-O0' workaround on powerpc. Should be fixed correctly now.
* Ship grub-bin2h and grub-script-check in grub-common.
* Terminate NEWS.Debian with a blank line like lintian would suggest
  if that check would be working correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  GRUB  --  GRand Unified Bootloader
 
3
 *  Copyright (C) 2010 Free Software Foundation, Inc.
 
4
 *
 
5
 *  GRUB is free software: you can redistribute it and/or modify
 
6
 *  it under the terms of the GNU General Public License as published by
 
7
 *  the Free Software Foundation, either version 3 of the License, or
 
8
 *  (at your option) any later version.
 
9
 *
 
10
 *  GRUB is distributed in the hope that it will be useful,
 
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *  GNU General Public License for more details.
 
14
 *
 
15
 *  You should have received a copy of the GNU General Public License
 
16
 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
1
19
#include <grub/mm.h>
2
20
#include <grub/misc.h>
3
21
#include <grub/test.h>
29
47
             const char *funp,
30
48
             grub_uint32_t line, const char *fmt, va_list args)
31
49
{
32
 
  char buf[1024];
33
50
  grub_test_failure_t failure;
34
51
 
35
52
  failure = (grub_test_failure_t) grub_malloc (sizeof (*failure));
36
53
  if (!failure)
37
54
    return;
38
55
 
39
 
  grub_vsprintf (buf, fmt, args);
40
 
 
41
56
  failure->file = grub_strdup (file ? : "<unknown_file>");
42
57
  failure->funp = grub_strdup (funp ? : "<unknown_function>");
43
58
  failure->line = line;
44
 
  failure->message = grub_strdup (buf);
 
59
  failure->message = grub_xvasprintf (fmt, args);
45
60
 
46
61
  grub_list_push (GRUB_AS_LIST_P (&failure_list), GRUB_AS_LIST (failure));
47
62
}