From 6b18710bc173320e8f819ed42b1ebd5e83b8a6a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zsolt=20Borb=C3=A9ly?= Date: Thu, 19 May 2016 17:50:55 +0200 Subject: [PATCH] Get rid of the remains of heavy debug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com --- jerry-core/CMakeLists.txt | 4 ++-- jerry-core/jrt/jrt-fatals.c | 6 +++--- jerry-core/jrt/jrt.h | 6 +++--- tests/unit/test-common.h | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/jerry-core/CMakeLists.txt b/jerry-core/CMakeLists.txt index 68954f4d7..845ba25af 100644 --- a/jerry-core/CMakeLists.txt +++ b/jerry-core/CMakeLists.txt @@ -39,10 +39,10 @@ project (JerryCore C ASM) # Build modes # Debug - set(DEFINES_JERRY_DEBUG JERRY_ENABLE_PRETTY_PRINTER JERRY_DISABLE_HEAVY_DEBUG) + set(DEFINES_JERRY_DEBUG JERRY_ENABLE_PRETTY_PRINTER) # Release - set(DEFINES_JERRY_RELEASE JERRY_NDEBUG JERRY_DISABLE_HEAVY_DEBUG) + set(DEFINES_JERRY_RELEASE JERRY_NDEBUG) # Unit tests set(DEFINES_JERRY_UNITTESTS JERRY_ENABLE_PRETTY_PRINTER) diff --git a/jerry-core/jrt/jrt-fatals.c b/jerry-core/jrt/jrt-fatals.c index a0afb3d3f..043f06fa6 100644 --- a/jerry-core/jrt/jrt-fatals.c +++ b/jerry-core/jrt/jrt-fatals.c @@ -82,15 +82,15 @@ jerry_assert_fail (const char *assertion, /**< assertion condition string */ const char *function, /**< function name */ const uint32_t line) /**< line */ { -#if !defined (JERRY_NDEBUG) || !defined (JERRY_DISABLE_HEAVY_DEBUG) +#ifndef JERRY_NDEBUG printf ("ICE: Assertion '%s' failed at %s(%s):%lu.\n", assertion, file, function, (unsigned long) line); -#else /* JERRY_NDEBUG && JERRY_DISABLE_HEAVY_DEBUG */ +#else /* JERRY_NDEBUG */ (void) assertion; (void) file; (void) function; (void) line; -#endif /* !JERRY_NDEBUG || !JERRY_DISABLE_HEAVY_DEBUG */ +#endif /* !JERRY_NDEBUG */ jerry_fatal (ERR_FAILED_INTERNAL_ASSERTION); } /* jerry_assert_fail */ diff --git a/jerry-core/jrt/jrt.h b/jerry-core/jrt/jrt.h index bc22950e1..99d6a45d1 100644 --- a/jerry-core/jrt/jrt.h +++ b/jerry-core/jrt/jrt.h @@ -77,12 +77,12 @@ extern void __noreturn jerry_assert_fail (const char *, const char *, const char extern void __noreturn jerry_unreachable (const char *, const char *, const char *, const uint32_t); extern void __noreturn jerry_unimplemented (const char *, const char *, const char *, const uint32_t); -#if !defined (JERRY_NDEBUG) || !defined (JERRY_DISABLE_HEAVY_DEBUG) +#ifndef JERRY_NDEBUG #define JERRY_ASSERT(x) do { if (__builtin_expect (!(x), 0)) { \ jerry_assert_fail (#x, __FILE__, __func__, __LINE__); } } while (0) -#else /* JERRY_NDEBUG && JERRY_DISABLE_HEAVY_DEBUG */ +#else /* JERRY_NDEBUG */ #define JERRY_ASSERT(x) do { if (false) { (void)(x); } } while (0) -#endif /* !JERRY_NDEBUG || !JERRY_DISABLE_HEAVY_DEBUG */ +#endif /* !JERRY_NDEBUG */ #ifdef JERRY_ENABLE_LOG #define JERRY_LOG(lvl, ...) \ diff --git a/tests/unit/test-common.h b/tests/unit/test-common.h index eaf52e987..f0450bb4b 100644 --- a/tests/unit/test-common.h +++ b/tests/unit/test-common.h @@ -26,11 +26,11 @@ #include /** - * Verify that unit tests are built with all debug checks enabled + * Verify that unit tests are built with enabled debug check */ -#if defined (JERRY_NDEBUG) || defined (JERRY_DISABLE_HEAVY_DEBUG) -# error "defined (JERRY_NDEBUG) || defined (JERRY_DISABLE_HEAVY_DEBUG) in a unit test" -#endif /* JERRY_NDEBUG || JERRY_DISABLE_HEAVY_DEBUG */ +#ifdef JERRY_NDEBUG +# error "defined (JERRY_NDEBUG) in a unit test" +#endif /* JERRY_NDEBUG */ /** * Test initialization statement that should be included