mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 10:45:22 +00:00
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>
30 lines
606 B
C
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);
|
|
}
|