Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geo: [TEST] Adds tests for GeoUtils #7510

Merged
merged 1 commit into from Sep 12, 2014
Merged

Geo: [TEST] Adds tests for GeoUtils #7510

merged 1 commit into from Sep 12, 2014

Conversation

colings86
Copy link
Contributor

Also added unit tests for GeoUtils

@colings86 colings86 self-assigned this Aug 29, 2014
//
// qNode = qNode.getSubCells(null).iterator().next();
// }
// }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it commented out on purpose?

@colings86
Copy link
Contributor Author

Not completely sure what the commented out test is doing but have uncommented it as it presumably served a purpose. May be superseded by the other tests now though.

Also I can't work out a good way of testing the earthDiameter(double) method.

@colings86 colings86 changed the title Geo: Fixed rounding/casting errors in point normalization Geo: [TEST] Adds tests for GeoUtils Aug 29, 2014
@jpountz
Copy link
Contributor

jpountz commented Aug 29, 2014

LGTM

Also I can't work out a good way of testing the earthDiameter(double) method.

I don't have ideas either. Let's already push these tests?

@jpountz jpountz removed the review label Aug 29, 2014
public void testSpecials() {
assertThat(GeoUtils.normalizeLon(Double.POSITIVE_INFINITY), equalTo(Double.NaN));
public void testGeohashCellWidth() {
double equatorialDistance = 2 * Math.PI * 6378137.0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it make sense to use the GeoUtils constants here? might help people to understand why they are here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spinscale Should we not avoid using constants from the class under test since if we use those constants these tests won't pick up any changes in them?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am good with both options.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine with me as well. go ahead and push!

@colings86 colings86 merged commit 2837800 into elastic:master Sep 12, 2014
@colings86 colings86 deleted the feature/geoTests branch September 12, 2014 09:19
@clintongormley clintongormley added the >test Issues or PRs that are addressing/adding tests label Mar 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>test Issues or PRs that are addressing/adding tests v1.5.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants