X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/35cd3d66a276b47386bab662f867309a91a231c2..3b22c9035de34e3729c1ca058d2689760cb74db0:/testsuite/msg/messages.h diff --git a/testsuite/msg/messages.h b/testsuite/msg/messages.h index 5571a68751..02770d57d6 100644 --- a/testsuite/msg/messages.h +++ b/testsuite/msg/messages.h @@ -1,4 +1,9 @@ -/**** MSG_LICENCE DO NOT REMOVE ****/ +/* $Id$ */ + +/* Copyright (c) 2002,2003,2004 Arnaud Legrand. All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ #ifndef MESSAGES_H #define MESSAGES_H @@ -8,6 +13,24 @@ #include "msg/datatypes.h" #include "xbt/error.h" +static void ASSERT(int value, const char *fmt, ...) +{ + m_process_t self = MSG_process_self(); + va_list ap; + + if(!value) { + va_start(ap, fmt); + if (self) + fprintf(stderr, "[%Lg] P%d | ", MSG_getClock(), + MSG_process_get_PID(self)); + vfprintf(stderr, fmt, ap); + va_end(ap); + + xbt_abort(); + } + return; +} + static void DIE(const char *fmt, ...) { m_process_t self = MSG_process_self(); @@ -32,8 +55,8 @@ static void PRINT_MESSAGE(const char *fmt, ...) va_start(ap, fmt); if (self) - fprintf(stderr, "[%Lg] P%d | ", MSG_getClock(), - MSG_process_get_PID(self)); + fprintf(stderr, "[%Lg] P%d | (%s:%s) ", MSG_getClock(), + MSG_process_get_PID(self), MSG_host_self()->name, self->name); vfprintf(stderr, fmt, ap); va_end(ap); #endif @@ -48,8 +71,8 @@ static void PRINT_DEBUG_MESSAGE(const char *fmt, ...) va_start(ap, fmt); if (self) - fprintf(stderr, "DEBUG [%Lg] P%d | ", MSG_getClock(), - MSG_process_get_PID(self)); + fprintf(stderr, "DEBUG [%Lg] P%d | (%s) ", MSG_getClock(), + MSG_process_get_PID(self), MSG_host_self()->name); vfprintf(stderr, fmt, ap); va_end(ap); #endif