Files
OpenCellular/core/host/panic.c
Vic Yang 83ea309f44 Add assertion support to emulator
This enables ASSERT() for easier debugging.

BUG=chrome-os-partner:19235
TEST=Add ASSERT(0) in lid_sw test and see error message:
        ASSERTION FAIL: test/lid_sw.c:91:run_test - 0
BRANCH=None

Change-Id: I7df7d5984e5d787fdc5ad2b6b24fec669e95c97e
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56691
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-05-28 12:53:54 -07:00

30 lines
606 B
C

/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <stdio.h>
#include <stdlib.h>
#include "common.h"
#include "panic.h"
#include "util.h"
struct panic_data *panic_get_data(void)
{
return NULL;
}
void panic_assert_fail(const char *msg, const char *func, const char *fname,
int linenum)
{
fprintf(stderr, "ASSERTION FAIL: %s:%d:%s - %s\n",
fname, linenum, func, msg);
fflush(stderr);
puts("Fail!"); /* Inform test runner */
fflush(stdout);
exit(1);
}