ext/h3/src/src/apps/testapps/testHexRanges.c in h3-3.4.0 vs ext/h3/src/src/apps/testapps/testHexRanges.c in h3-3.4.4
- old
+ new
@@ -23,10 +23,11 @@
H3Index sfHex = H3_EXPORT(geoToH3)(&sf, 9);
H3Index* sfHexPtr = &sfHex;
H3Index k1[] = {0x89283080ddbffff, 0x89283080c37ffff, 0x89283080c27ffff,
0x89283080d53ffff, 0x89283080dcfffff, 0x89283080dc3ffff};
+ H3Index withPentagon[] = {0x8029fffffffffff, 0x801dfffffffffff};
TEST(identityKRing) {
int err;
H3Index k0[] = {0};
@@ -71,7 +72,16 @@
t_assert(k1[index] == allKrings2[i],
"The beginning of the segment is the correct hexagon");
}
}
free(allKrings2);
+ }
+
+ TEST(failed) {
+ int err;
+ H3Index* allKrings = calloc(2 * (1 + 6), sizeof(H3Index));
+ err = H3_EXPORT(hexRanges)(withPentagon, 2, 1, allKrings);
+
+ t_assert(err != 0, "Expected error on hexRanges");
+ free(allKrings);
}
}