Print this page
12259 CTF shouldn't assume enum size

Split Close
Expand all
Collapse all
          --- old/usr/src/test/util-tests/tests/ctf/check-common.h
          +++ new/usr/src/test/util-tests/tests/ctf/check-common.h
↓ open down ↓ 2 lines elided ↑ open up ↑
   3    3   * Common Development and Distribution License ("CDDL"), version 1.0.
   4    4   * You may only use this file in accordance with the terms of version
   5    5   * 1.0 of the CDDL.
   6    6   *
   7    7   * A full copy of the text of the CDDL should have accompanied this
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  
  12   12  /*
  13      - * Copyright 2019, Joyent, Inc.
       13 + * Copyright 2020 Joyent, Inc.
  14   14   */
  15   15  
  16   16  #ifndef _CHECK_COMMON_H
  17   17  #define _CHECK_COMMON_H
  18   18  
  19   19  /*
  20   20   * Common definitions for the CTF tests
  21   21   */
  22   22  
  23   23  #include <stdlib.h>
↓ open down ↓ 56 lines elided ↑ open up ↑
  80   80  } check_member_test_t;
  81   81  
  82   82  typedef struct check_function_test {
  83   83          const char *cft_name;
  84   84          const char *cft_rtype;
  85   85          uint_t cft_nargs;
  86   86          uint_t cft_flags;
  87   87          const char **cft_args;
  88   88  } check_function_test_t;
  89   89  
       90 +typedef struct check_size_test {
       91 +        const char *cst_name;
       92 +        size_t cst_size;
       93 +} check_size_test_t;
       94 +
  90   95  /*
  91   96   * Looks up each type and verifies that it matches the expected type.
  92   97   */
  93   98  extern boolean_t ctftest_check_numbers(ctf_file_t *, const check_number_t *);
  94   99  
  95  100  /*
  96  101   * Looks at each symbol specified and verifies that it matches the expected
  97  102   * type.
  98  103   */
  99  104  extern boolean_t ctftest_check_symbols(ctf_file_t *, const check_symbol_t *);
↓ open down ↓ 23 lines elided ↑ open up ↑
 123  128  /*
 124  129   * Check that the named function or function pointer has the correct return
 125  130   * type, arguments, and function flags.
 126  131   */
 127  132  extern boolean_t ctftest_check_function(const char *, ctf_file_t *,
 128  133      const char *, uint_t, uint_t, const char **);
 129  134  extern boolean_t ctftest_check_fptr(const char *, ctf_file_t *,
 130  135      const char *, uint_t, uint_t, const char **);
 131  136  
 132  137  /*
      138 + * Check size of types.
      139 + */
      140 +extern boolean_t ctftest_check_size(const char *, ctf_file_t *, size_t);
      141 +
      142 +/*
 133  143   * Determine whether or not we have a duplicate type or not based on its name.
 134  144   */
 135  145  extern boolean_t ctftest_duplicates(ctf_file_t *);
 136  146  
 137  147  #ifdef __cplusplus
 138  148  }
 139  149  #endif
 140  150  
 141  151  #endif /* _CHECK_COMMON_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX