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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions isis/tests/PixelTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include <functional>
#include <iostream>
#include <limits>
#include <string>
// #include <tuple>
#include <utility>
#include <vector>

Expand Down Expand Up @@ -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!

}

TEST(Pixel, ToString) {
Expand All @@ -477,5 +476,4 @@ TEST(Pixel, ToString) {
EXPECT_EQ(std::string("Lis"), Pixel(1,2,3,Isis::Lis).ToString());
EXPECT_EQ(std::string("Lrs"), Pixel(1,2,3,Isis::Lrs).ToString());
EXPECT_EQ(std::string("Null"), Pixel(1,2,3,Isis::Null).ToString());
EXPECT_EQ(std::string("Invalid"), Pixel(1,2,3,-1.0e+1000).ToString());
}