Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8300759

Metaspace gtests use ASSERT macros inside subfunctions

XMLWordPrintable

      ... e.g.
      ```
        // Allocate a chunk; it must succeed. Test the chunk.
        void alloc_chunk_expect_success(Metachunk** p_return_value, chunklevel_t preferred_level, chunklevel_t max_level, size_t min_committed_size) {
          checked_alloc_chunk_0(p_return_value, preferred_level, max_level, min_committed_size);
          ASSERT_NOT_NULL(*p_return_value);
        }
      ```

      which demonstrates a misunderstanding on my part of how ASSERT_xxx works :-/

      ASSERT_xxx *abort the current function*, so doing it inside a sub function just aborts the sub function, but will continue the test.

            stuefe Thomas Stuefe
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: