LCOV - code coverage report
Current view: top level - libs/mem/tests/src - test_libmem_all.c (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 83 83
Test Date: 2026-07-12 01:01:34 Functions: 100.0 % 1 1
Branches: - 0 0

             Branch data     Line data    Source code
       1                 :             : #include "test_libmem_all.h"
       2                 :             : 
       3                 :             : /**
       4                 :             :  * @brief Run all public libmem test suites
       5                 :             :  *
       6                 :             :  * @return Return status code
       7                 :             :  */
       8                 :           1 : Return test_libmem_all(void)
       9                 :             : {
      10                 :           1 :         INITTEST;
      11                 :             : 
      12                 :           1 :         bool first_header = true;
      13                 :             : 
      14                 :           1 :         HEADER("Allocation Lifecycle");
      15                 :           1 :         SUTE(test_libmem_0000,"Numbered README examples for public libmem usage");
      16                 :           1 :         TEST(test_libmem_0001,"Copying an empty data descriptor clears a populated destination");
      17                 :             : 
      18                 :           1 :         HEADER("Repeated Type Coverage");
      19                 :           1 :         SUTE(test_libmem_0005,"Random-size bounded-buffer imports across element types (SHA-512)");
      20                 :             : 
      21                 :           1 :         HEADER("Telemetry");
      22                 :           1 :         SUTE(test_libmem_0009,"Telemetry counters track libmem state transitions");
      23                 :             : 
      24                 :           1 :         HEADER("Typed Access");
      25                 :           1 :         TEST(test_libmem_0010,"Typed point descriptors and m_resize flags");
      26                 :           1 :         SUTE(test_libmem_0011,"Typed point raw access and descriptor copying");
      27                 :           1 :         SUTE(test_libmem_0012,"Typed point m_concat_data after RELEASE_UNUSED shrink and regrow");
      28                 :             : 
      29                 :           1 :         HEADER("Initial Modes");
      30                 :           1 :         SUTE(test_libmem_0013,"m_create initial modes and fixed-string appends for byte and wide descriptors");
      31                 :             : 
      32                 :           1 :         HEADER("Descriptor Collections");
      33                 :           1 :         TEST(test_libmem_0069,"Descriptor-backed arrays support item access and foreach traversal");
      34                 :             : 
      35                 :           1 :         HEADER("Low-Level Helpers");
      36                 :           1 :         TEST(test_libmem_0052,"m_copy_buffer handles strings, structs, and clearing");
      37                 :           1 :         TEST(test_libmem_0053,"reset clears manually managed raw pointers");
      38                 :           1 :         TEST(test_libmem_0054,"guarded arithmetic helpers catch invalid size math");
      39                 :             : 
      40                 :           1 :         HEADER("Data Invariants");
      41                 :           1 :         TEST(test_libmem_0055,"Data-facing helpers reject descriptors with NULL data and non-zero length");
      42                 :           1 :         TEST(test_libmem_0056,"Data-mode resize keeps string metadata cleared");
      43                 :           1 :         TEST(test_libmem_0057,"Data-mode resize rejects stale string metadata");
      44                 :           1 :         TEST(test_libmem_0058,"Data-mode resize rejects reserves smaller than the logical payload");
      45                 :             : 
      46                 :           1 :         HEADER("Data Transfers");
      47                 :           1 :         TEST(test_libmem_0059,"libmem data wrappers support bytewise append and copy");
      48                 :           1 :         TEST(test_libmem_0060,"libmem data copy wrapper rejects partial destination tails");
      49                 :           1 :         TEST(test_libmem_0061,"libmem data wrappers support cross-type append and copy");
      50                 :           1 :         TEST(test_libmem_0062,"libmem data wrappers reject incompatible cross-type payloads");
      51                 :             : 
      52                 :           1 :         HEADER("String Access");
      53                 :           1 :         SUTE(test_libmem_0015,"String conversion, resize, raw access, and cleanup keep metadata coherent");
      54                 :           1 :         SUTE(test_libmem_0016,"String copy and concat helpers cover fixed, bounded, and descriptor sources");
      55                 :           1 :         TEST(test_libmem_0017,"String m_resize flags preserve terminators and zero-fill");
      56                 :           1 :         TEST(test_libmem_0067,"m_string returns soft read-only views for byte and wide string descriptors");
      57                 :             : 
      58                 :           1 :         HEADER("Conversions");
      59                 :           1 :         TEST(test_libmem_0020,"Explicit string/data mode conversions preserve logical payload");
      60                 :           1 :         TEST(test_libmem_0021,"Data-to-string conversion accepts already-string non-byte descriptors");
      61                 :           1 :         TEST(test_libmem_0022,"String-to-data conversion rejects zero-sized elements");
      62                 :           1 :         TEST(test_libmem_0023,"string_length supports multi-byte descriptors and cached values");
      63                 :           1 :         TEST(test_libmem_0024,"string_length rejects zero-sized elements");
      64                 :           1 :         TEST(test_libmem_0025,"Data-to-string conversion adds a multi-byte zero terminator when needed");
      65                 :           1 :         TEST(test_libmem_0026,"Data-to-string conversion reuses an existing multi-byte zero terminator");
      66                 :             : 
      67                 :           1 :         HEADER("String Transfers");
      68                 :           1 :         TEST(test_libmem_0027,"Bounded string concat supports multi-byte buffers and softly clamped self-aliasing");
      69                 :           1 :         TEST(test_libmem_0028,"Bounded string concat rejects byte counts that split elements");
      70                 :           1 :         TEST(test_libmem_0029,"String-facing helpers reject descriptors with NULL data and non-zero length");
      71                 :           1 :         TEST(test_libmem_0030,"String concat wrappers and empty bounded or fixed-string inputs support byte strings");
      72                 :           1 :         TEST(test_libmem_0031,"Public unbounded wrapper supports multi-byte strings and internal sources");
      73                 :           1 :         TEST(test_libmem_0032,"Source-mode string concat ignores non-zero sizes in unbounded mode");
      74                 :           1 :         TEST(test_libmem_0033,"Source-mode string concat rejects internal unbounded sources past the logical end");
      75                 :           1 :         TEST(test_libmem_0034,"NULL sources and empty bounded or fixed-string inputs are no-ops");
      76                 :           1 :         TEST(test_libmem_0035,"Bounded string concat still rejects internal starts past the visible terminator");
      77                 :           1 :         TEST(test_libmem_0036,"m_string_truncate shortens byte strings without resizing the descriptor");
      78                 :           1 :         TEST(test_libmem_0037,"m_string_truncate supports multi-byte strings and rejects data mode");
      79                 :             : 
      80                 :           1 :         HEADER("String Invariants");
      81                 :           1 :         TEST(test_libmem_0038,"m_resize rejects descriptors with an inconsistent cached string length");
      82                 :           1 :         TEST(test_libmem_0039,"m_to_string rejects stale string metadata in data mode");
      83                 :           1 :         TEST(test_libmem_0040,"m_to_string rejects inconsistent already-string metadata");
      84                 :           1 :         TEST(test_libmem_0041,"m_resize rejects string descriptors whose reserve is smaller than the logical payload");
      85                 :           1 :         TEST(test_libmem_0042,"m_string_truncate rejects descriptors whose reserve is smaller than the logical payload");
      86                 :           1 :         TEST(test_libmem_0043,"Internal replace mode supports multi-byte self-aliasing and empty aliased replacement");
      87                 :           1 :         TEST(test_libmem_0044,"Fixed-string append and m_concat_literal support byte and multi-byte descriptors");
      88                 :           1 :         TEST(test_libmem_0045,"m_concat_string dispatches to bounded and unbounded string helpers");
      89                 :           1 :         TEST(test_libmem_0046,"m_copy_string dispatches to bounded and unbounded replacement helpers");
      90                 :           1 :         TEST(test_libmem_0047,"m_copy_fixed_string and m_copy_literal replace contents through fixed-string mode");
      91                 :           1 :         TEST(test_libmem_0048,"m_finalize_string truncates through m_data() using the cached length");
      92                 :           1 :         TEST(test_libmem_0049,"m_finalize_string truncates through m_data() and adds the terminator itself");
      93                 :           1 :         TEST(test_libmem_0050,"m_finalize_string accepts an already terminated direct write");
      94                 :           1 :         TEST(test_libmem_0051,"m_finalize_string can add a terminator and rejects data descriptors");
      95                 :           1 :         TEST(test_libmem_0070,"m_formatted_string dispatches typed printf-style output for char and wchar_t string descriptors");
      96                 :             : 
      97                 :           1 :         HEADER("Descriptor Boundaries");
      98                 :           1 :         TEST(test_libmem_0063,"libmem string concat and raw byte concat operations");
      99                 :           1 :         TEST(test_libmem_0064,"libmem bounded raw and bounded string concat helpers");
     100                 :             : 
     101                 :           1 :         HEADER("Mode Rejections");
     102                 :           1 :         TEST(test_libmem_0065,"libmem mode mismatches and malformed descriptors are diagnosed");
     103                 :             : 
     104                 :           1 :         HEADER("Aliasing");
     105                 :           1 :         TEST(test_libmem_0066,"libmem aliasing scenarios for string and data descriptors");
     106                 :             : 
     107                 :           1 :         HEADER("Global status propagation");
     108                 :           1 :         TEST(test_libmem_0071,"Process-wide INFO does not skip libmem resize bookkeeping");
     109                 :             : 
     110                 :           1 :         RETURN_STATUS;
     111                 :             : }
        

Generated by: LCOV version 2.0-1