mbedtls/tests/psa-client-server/psasim/include/util.h
Valerio Setti 2eb8cc7d9d psa_sim: improve log prints
- always print ERROR and FATAL messages because they should never
  occur, but when they do it's important to see them immediately;
- keep INFO prints under DEBUG guard;
- set client's PRINT as INFO message because otherwise it will
  mess test_suites's output;
- change some error messages from INFO to ERROR because that's
  what they are.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-06-18 14:10:54 +02:00

32 lines
815 B
C

/* Common definitions used for clients and services */
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/
#include "service.h"
#define PRINT(fmt, ...) \
fprintf(stdout, fmt "\n", ##__VA_ARGS__)
#if defined(DEBUG)
#define INFO(fmt, ...) \
fprintf(stdout, "Info (%s - %d): " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__)
#else /* !DEBUG */
#define INFO(...)
#endif /* DEBUG*/
#define ERROR(fmt, ...) \
fprintf(stderr, "Error (%s - %d): " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__)
#define FATAL(fmt, ...) \
{ \
fprintf(stderr, "Fatal (%s - %d): " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__); \
abort(); \
}
#define PROJECT_ID 'M'
#define PATHNAMESIZE 256
#define TMP_FILE_BASE_PATH "./"