@@ -124,13 +124,31 @@ SUITE(h3UniEdge) {
124124 }
125125
126126 TEST (getH3UnidirectionalEdgeFromPentagon ) {
127+ H3Index pentagons [NUM_PENTAGONS ] = {0 };
128+ H3Index ring [7 ] = {0 };
127129 H3Index pentagon ;
128- setH3Index (& pentagon , 0 , 4 , 0 );
129- H3Index adjacent ;
130- setH3Index (& adjacent , 0 , 8 , 0 );
131-
132- H3Index edge = H3_EXPORT (getH3UnidirectionalEdge )(pentagon , adjacent );
133- t_assert (edge != 0 , "Produces a valid edge" );
130+ H3Index edge ;
131+
132+ for (int res = 0 ; res < 16 ; res ++ ) {
133+ H3_EXPORT (getPentagonIndexes )(res , pentagons );
134+ for (int p = 0 ; p < NUM_PENTAGONS ; p ++ ) {
135+ pentagon = pentagons [p ];
136+ H3_EXPORT (kRing )(pentagon , 1 , ring );
137+
138+ for (int i = 0 ; i < 7 ; i ++ ) {
139+ H3Index neighbor = ring [i ];
140+ if (neighbor == pentagon || neighbor == H3_NULL ) continue ;
141+ edge =
142+ H3_EXPORT (getH3UnidirectionalEdge )(pentagon , neighbor );
143+ t_assert (H3_EXPORT (h3UnidirectionalEdgeIsValid )(edge ),
144+ "pentagon-to-neighbor is a valid edge" );
145+ edge =
146+ H3_EXPORT (getH3UnidirectionalEdge )(neighbor , pentagon );
147+ t_assert (H3_EXPORT (h3UnidirectionalEdgeIsValid )(edge ),
148+ "neighbor-to-pentagon is a valid edge" );
149+ }
150+ }
151+ }
134152 }
135153
136154 TEST (h3UnidirectionalEdgeIsValid ) {
0 commit comments