# lv_test_helpers.h (/api/public/debugging/test/lv_test_helpers_h)



<ApiSummary functions="4" macros="2" />

Functions [#functions]

<ApiTabs items="[&#x22;Getters (2)&#x22;,&#x22;Other (2)&#x22;]">
  <ApiTab value="Getters (2)">
    <ApiMember kind="function" name="lv_test_get_allocation_count" file="public/debugging/test/lv_test_helpers.h" line="57" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/debugging/test/lv_test_helpers.h#L57">
      lv_test_get_allocation_count [#lv_test_get_allocation_count]

      Get the number of live allocations on the LVGL heap.

      ```c title=" " lineNumbers=1
      size_t lv_test_get_allocation_count(void)
      ```

      **Returns:** `size_t` — the number of allocated blocks, or 0 when the heap does not report it
    </ApiMember>

    <ApiMember kind="function" name="lv_test_get_free_mem" file="public/debugging/test/lv_test_helpers.h" line="67" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/debugging/test/lv_test_helpers.h#L67">
      lv_test_get_free_mem [#lv_test_get_free_mem]

      ```c title=" " lineNumbers=1
      static size_t lv_test_get_free_mem(void)
      ```
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (2)">
    <ApiMember kind="function" name="lv_test_wait" file="public/debugging/test/lv_test_helpers.h" line="43" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/debugging/test/lv_test_helpers.h#L43">
      lv_test_wait [#lv_test_wait]

      Emulate a delay. It's not real delay, but it tricks LVGL to think that the required time has been elapsed. `lv_timer_handler` is called after each millisecond, meaning all the events will be fired inside this function. At the end the animations and display will be also updated.

      ```c title=" " lineNumbers=1
      void lv_test_wait(uint32_t ms)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name | Type       | Description                        |
      | ---- | ---------- | ---------------------------------- |
      | `ms` | `uint32_t` | the number of milliseconds to pass |
    </ApiMember>

    <ApiMember kind="function" name="lv_test_fast_forward" file="public/debugging/test/lv_test_helpers.h" line="50" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/debugging/test/lv_test_helpers.h#L50">
      lv_test_fast_forward [#lv_test_fast_forward]

      Emulates some time passing. Update the animations and the display only once at the end.

      ```c title=" " lineNumbers=1
      void lv_test_fast_forward(uint32_t ms)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name | Type       | Description                        |
      | ---- | ---------- | ---------------------------------- |
      | `ms` | `uint32_t` | the number of milliseconds to pass |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Macros [#macros]

<ApiMember kind="macro" name="LV_HEAP_CHECK" file="public/debugging/test/lv_test_helpers.h" line="65" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/debugging/test/lv_test_helpers.h#L65">
  LV_HEAP_CHECK [#lv_heap_check]

  ```c title=" " lineNumbers=1
  #define LV_HEAP_CHECK(x) \
      x
  ```
</ApiMember>

<ApiMember kind="macro" name="LV_TEST_WIDTH_TO_STRIDE" file="public/debugging/test/lv_test_helpers.h" line="79" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/debugging/test/lv_test_helpers.h#L79">
  LV_TEST_WIDTH_TO_STRIDE [#lv_test_width_to_stride]

  ```c title=" " lineNumbers=1
  #define LV_TEST_WIDTH_TO_STRIDE(w, px_size) \
      ((((w) * (px_size) + (LV_DRAW_BUF_STRIDE_ALIGN - 1)) / LV_DRAW_BUF_STRIDE_ALIGN) * LV_DRAW_BUF_STRIDE_ALIGN)
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_types.h&#x22;, &#x22;lv_mem.h&#x22;]" includedBy="[&#x22;lv_test.h&#x22;, &#x22;lvgl.h&#x22;]" />
