Skip to content

Commit

Permalink
Add back in a base cell test and remove constants.h from h3api.h
Browse files Browse the repository at this point in the history
  • Loading branch information
dfellis committed Jan 22, 2018
1 parent b38afde commit 5d818aa
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/apps/testapps/testCompact.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#include <stdlib.h>
#include "constants.h"
#include "h3Index.h"
#include "test.h"

Expand Down
9 changes: 9 additions & 0 deletions src/apps/testapps/testH3Index.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "constants.h"
#include "h3Index.h"
#include "test.h"
#include "utility.h"
Expand Down Expand Up @@ -61,6 +62,14 @@ TEST(h3IsValidBaseCell) {
}
}

TEST(h3FatIsValidBaseCellInvalid) {
H3Index hWrongBaseCell = H3_INIT;
H3_SET_MODE(hWrongBaseCell, H3_HEXAGON_MODE);
H3_SET_BASE_CELL(hWrongBaseCell, NUM_BASE_CELLS);
t_assert(!h3IsValid(hWrongBaseCell),
"h3IsValid failed on invalid base cell");
}

TEST(h3ToString) {
const size_t bufSz = 17;
char buf[17] = {0};
Expand Down
1 change: 1 addition & 0 deletions src/apps/testapps/testH3ToGeo.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <stdio.h>
#include <stdlib.h>
#include "constants.h"
#include "geoCoord.h"
#include "h3Index.h"
#include "test.h"
Expand Down
1 change: 1 addition & 0 deletions src/apps/testapps/testHexRing.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <stdlib.h>
#include "algos.h"
#include "constants.h"
#include "h3Index.h"
#include "test.h"

Expand Down
1 change: 1 addition & 0 deletions src/apps/testapps/testPolyfill.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <stdlib.h>
#include "algos.h"
#include "constants.h"
#include "geoCoord.h"
#include "h3Index.h"
#include "test.h"
Expand Down
3 changes: 0 additions & 3 deletions src/h3lib/include/h3api.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
/* For size_t */
#include <stdlib.h>

/* For constants used throughout H3 */
#include "constants.h"

/*
* H3 is compiled as C, not C++ code. `extern "C"` is needed for C++ code
* to be able to use the library.
Expand Down

0 comments on commit 5d818aa

Please sign in to comment.