LCOV - code coverage report
Current view: top level - libstb/test - run-stb-container.c (source / functions) Hit Total Coverage
Test: skiboot.info Lines: 9 9 100.0 %
Date: 2024-01-02 21:04:04 Functions: 1 1 100.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : // SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
       2                 :            : /* Copyright 2016 IBM Corp. */
       3                 :            : 
       4                 :            : #include <config.h>
       5                 :            : 
       6                 :            : #include "../container.c"
       7                 :            : 
       8                 :            : #include <assert.h>
       9                 :            : 
      10                 :          1 : int main(void)
      11                 :            : {
      12                 :          1 :         ROM_container_raw *c = malloc(SECURE_BOOT_HEADERS_SIZE);
      13                 :          1 :         assert(stb_is_container(NULL, 0) == false);
      14                 :          1 :         assert(stb_is_container(NULL, SECURE_BOOT_HEADERS_SIZE) == false);
      15                 :          1 :         c->magic_number = cpu_to_be32(ROM_MAGIC_NUMBER + 1);
      16                 :          1 :         assert(stb_is_container(c, SECURE_BOOT_HEADERS_SIZE) == false);
      17                 :          1 :         c->magic_number = cpu_to_be32(ROM_MAGIC_NUMBER);
      18                 :          1 :         assert(stb_is_container(c, SECURE_BOOT_HEADERS_SIZE) == true);
      19                 :            : 
      20                 :          1 :         return 0;
      21                 :            : }

Generated by: LCOV version 1.14