LCOV - code coverage report
Current view: top level - source3/modules - test_vfs_full_audit.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 9 9 100.0 %
Date: 2021-09-23 10:06:22 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /*
       2             :  *  Unix SMB/CIFS implementation.
       3             :  *
       4             :  *  Unit test for entries in vfs_full_audit arrays.
       5             :  *
       6             :  *  Copyright (C) Jeremy Allison 2020
       7             :  *
       8             :  *  This program is free software; you can redistribute it and/or modify
       9             :  *  it under the terms of the GNU General Public License as published by
      10             :  *  the Free Software Foundation; either version 3 of the License, or
      11             :  *  (at your option) any later version.
      12             :  *
      13             :  *  This program is distributed in the hope that it will be useful,
      14             :  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
      15             :  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      16             :  *  GNU General Public License for more details.
      17             :  *
      18             :  *  You should have received a copy of the GNU General Public License
      19             :  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
      20             :  */
      21             : 
      22             : /* Needed for static build to complete... */
      23             : #include "includes.h"
      24             : #include "smbd/smbd.h"
      25             : NTSTATUS vfs_full_audit_init(TALLOC_CTX *ctx);
      26             : 
      27             : #include "vfs_full_audit.c"
      28             : #include <cmocka.h>
      29             : 
      30           1 : static void test_full_audit_array(void **state)
      31             : {
      32             :         unsigned i;
      33             : 
      34         108 :         for (i=0; i<SMB_VFS_OP_LAST; i++) {
      35         107 :                 assert_non_null(vfs_op_names[i].name);
      36         107 :                 assert_int_equal(vfs_op_names[i].type, i);
      37             :         }
      38           1 : }
      39             : 
      40           1 : int main(int argc, char **argv)
      41             : {
      42           1 :         const struct CMUnitTest tests[] = {
      43             :                 cmocka_unit_test(test_full_audit_array),
      44             :         };
      45             : 
      46           1 :         cmocka_set_message_output(CM_OUTPUT_SUBUNIT);
      47             : 
      48           1 :         return cmocka_run_group_tests(tests, NULL, NULL);
      49             : }

Generated by: LCOV version 1.13