File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,23 @@ static void verify_dependency_atoms(void) {
5050 multi_use_atoms |= combined & a ;
5151 combined |= a ;
5252 }
53+
54+ /* Make sure all atoms are used, i.e. there's at least one dependency type that references it. */
55+ assert_se (combined == _UNIT_DEPENDENCY_ATOM_MAX );
56+
57+ for (UnitDependencyAtom a = 1 ; a <= _UNIT_DEPENDENCY_ATOM_MAX ; a <<= 1 ) {
58+
59+ if (multi_use_atoms & a ) {
60+ /* If an atom is used by multiple dep types, then mapping the atom to a dependency is
61+ * not unique and *must* fail */
62+ assert_se (unit_dependency_from_unique_atom (a ) == _UNIT_DEPENDENCY_INVALID );
63+ continue ;
64+ }
65+
66+ /* If only a single dep type uses specific atom, let's guarantee our mapping table is
67+ complete, and thus the atom can be mapped to the single dep type that is used. */
68+ assert_se (unit_dependency_from_unique_atom (a ) >= 0 );
69+ }
5370}
5471
5572int main (int argc , char * argv []) {
You can’t perform that action at this time.
0 commit comments