Skip to content
New issue

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

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

Already on GitHub? # to your account

Fixed warning in Pixel unit tests #652

Merged
merged 1 commit into from
Dec 18, 2018
Merged

Conversation

jessemapel
Copy link
Contributor

The Pixel unit tests were generating a warning.

Description

There was a test using a number that doesn't fit in a double.

Related Issue

#613

Motivation and Context

Removes build warnings

How Has This Been Tested?

Pixel unit test has been re-built and passes with the change.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation change (update to the documentation; no code change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read and agree to abide by the Code of Conduct
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Licensing

This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words:

This work is free and unencumbered software released into the public domain. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain.

  • I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

@krlberry krlberry self-requested a review December 18, 2018 01:17
@@ -465,7 +465,6 @@ TEST(Pixel, static_ToString) {
EXPECT_EQ(std::string("Lis"), Pixel::ToString(Isis::Lis));
EXPECT_EQ(std::string("Lrs"), Pixel::ToString(Isis::Lrs));
EXPECT_EQ(std::string("Null"), Pixel::ToString(Isis::Null));
EXPECT_EQ(std::string("Invalid"), Pixel::ToString(-1.0e+1000));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any way we can test "Invalid" still without exceeding the valid range for doubles? Or is that what "Invalid" checks for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is checking for values below valid minimum. The problem is, all of the double values below valid minimum are special pixels or NaN.

The only way this happens is a double overflow, which I think is such an extreme outlier it's not worth testing.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Sounds good to me, then!

Copy link
Contributor

@krlberry krlberry left a comment

Choose a reason for hiding this comment

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

👍

@krlberry krlberry merged commit 90baaa7 into DOI-USGS:dev Dec 18, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants