OpenCoverage

backup-find.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/backup-find.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10char *-
11find_backup_file_name (char const *file, enum backup_type backup_type)-
12{-
13 char *result = backupfile_internal (file, backup_type, -
14 0-
15 );-
16 if (!result
!resultDescription
TRUEnever evaluated
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • cp
  • ln
)
0-9
17 xalloc_die ();
never executed: xalloc_die ();
0
18 return
executed 9 times by 2 tests: return result;
Executed by:
  • cp
  • ln
result;
executed 9 times by 2 tests: return result;
Executed by:
  • cp
  • ln
9
19}-
20-
21static char const *const backup_args[] =-
22{-
23-
24-
25 "none", "off",-
26 "simple", "never",-
27 "existing", "nil",-
28 "numbered", "t",-
29 -
30 ((void *)0)-
31-
32};-
33-
34static const enum backup_type backup_types[] =-
35{-
36 no_backups, no_backups,-
37 simple_backups, simple_backups,-
38 numbered_existing_backups, numbered_existing_backups,-
39 numbered_backups, numbered_backups-
40};-
41-
42-
43-
44_Static_assert ((sizeof (backup_args) / sizeof *(backup_args)) == (sizeof (backup_types) / sizeof *(backup_types)) + 1, "verify (" "ARRAY_CARDINALITY (backup_args) == ARRAY_CARDINALITY (backup_types) + 1" ")");-
45-
46-
47-
48-
49-
50-
51enum backup_type-
52get_version (char const *context, char const *version)-
53{-
54 if (version == 0
version == 0Description
TRUEevaluated 21 times by 3 tests
Evaluated by:
  • cp
  • ln
  • mv
FALSEevaluated 138 times by 4 tests
Evaluated by:
  • cp
  • ginstall
  • ln
  • mv
|| *
*version == 0Description
TRUEnever evaluated
FALSEevaluated 138 times by 4 tests
Evaluated by:
  • cp
  • ginstall
  • ln
  • mv
version == 0
*version == 0Description
TRUEnever evaluated
FALSEevaluated 138 times by 4 tests
Evaluated by:
  • cp
  • ginstall
  • ln
  • mv
)
0-138
55 return
executed 21 times by 3 tests: return numbered_existing_backups;
Executed by:
  • cp
  • ln
  • mv
numbered_existing_backups;
executed 21 times by 3 tests: return numbered_existing_backups;
Executed by:
  • cp
  • ln
  • mv
21
56 else-
57 return
executed 138 times by 4 tests: return ((backup_types) [__xargmatch_internal (context, version, backup_args, (char const *) (backup_types), sizeof *(backup_types), argmatch_die)]);
Executed by:
  • cp
  • ginstall
  • ln
  • mv
((backup_types) [__xargmatch_internal (context, version, backup_args, (char const *) (backup_types), sizeof *(backup_types), argmatch_die)]);
executed 138 times by 4 tests: return ((backup_types) [__xargmatch_internal (context, version, backup_args, (char const *) (backup_types), sizeof *(backup_types), argmatch_die)]);
Executed by:
  • cp
  • ginstall
  • ln
  • mv
138
58}-
59enum backup_type-
60xget_version (char const *context, char const *version)-
61{-
62 if (version
versionDescription
TRUEevaluated 94 times by 4 tests
Evaluated by:
  • cp
  • ginstall
  • ln
  • mv
FALSEevaluated 65 times by 3 tests
Evaluated by:
  • cp
  • ln
  • mv
&& *
*versionDescription
TRUEevaluated 94 times by 4 tests
Evaluated by:
  • cp
  • ginstall
  • ln
  • mv
FALSEnever evaluated
version
*versionDescription
TRUEevaluated 94 times by 4 tests
Evaluated by:
  • cp
  • ginstall
  • ln
  • mv
FALSEnever evaluated
)
0-94
63 return
executed 94 times by 4 tests: return get_version (context, version);
Executed by:
  • cp
  • ginstall
  • ln
  • mv
get_version (context, version);
executed 94 times by 4 tests: return get_version (context, version);
Executed by:
  • cp
  • ginstall
  • ln
  • mv
94
64 else-
65 return
executed 65 times by 3 tests: return get_version ("$VERSION_CONTROL", getenv ("VERSION_CONTROL"));
Executed by:
  • cp
  • ln
  • mv
get_version ("$VERSION_CONTROL", getenv ("VERSION_CONTROL"));
executed 65 times by 3 tests: return get_version ("$VERSION_CONTROL", getenv ("VERSION_CONTROL"));
Executed by:
  • cp
  • ln
  • mv
65
66}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2