LCOV - code coverage report
Current view: directory - src/trusted/nacl_base - nacl_base_test.c (source / functions) Found Hit Coverage
Test: coverage.lcov Lines: 9 9 100.0 %
Date: 2014-09-25 Functions: 0 0 -

       1                 : /*
       2                 :  * Copyright 2009 The Native Client Authors. All rights reserved.
       3                 :  * Use of this source code is governed by a BSD-style license that can be
       4                 :  * found in the LICENSE file.
       5                 :  */
       6                 : 
       7                 : #include <stdio.h>
       8                 : #include <stdlib.h>
       9                 : #include <sys/types.h>
      10                 : 
      11                 : #include "native_client/src/include/portability.h"
      12                 : #include "native_client/src/include/nacl_macros.h"
      13                 : 
      14               1 : int main(void) {
      15                 :   char buffer[4096];
      16               1 :   char *bufptr = buffer;
      17                 :   size_t ix;
      18                 : 
      19               1 :   NACL_ASSERT_IS_POINTER(bufptr);
      20                 :   NACL_ASSERT_IS_ARRAY(buffer);
      21                 : 
      22                 :   /*
      23                 :    * NACL_ASSERT_IS_ARRAY(bufptr);
      24                 :    */
      25                 : 
      26               1 :   printf("#buffer = %"NACL_PRIuS"\n", NACL_ARRAY_SIZE(buffer));
      27                 : 
      28                 :   /*
      29                 :    * printf("#bufptr = %lu\n", ARRAY_SIZE(bufptr));
      30                 :    */
      31                 : 
      32                 :   /*
      33                 :    * for checking that the store to gNaClArrayCheck is moved out of
      34                 :    * the loop.
      35                 :    */
      36               1 :   for (ix = 0; ix < NACL_ARRAY_SIZE(buffer); ++ix) {
      37               1 :     buffer[ix] = (char) ix;
      38               1 :   }
      39               1 :   return (buffer[10] + buffer[4095] == 0);  /* loop was not dead code! */
      40               1 : }

Generated by: LCOV version 1.7