Skip to content

Commit

Permalink
you learn something new every day
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrush committed Mar 10, 2021
1 parent a9559cb commit 400c982
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/tests/conduit/t_conduit_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,34 @@ TEST(conduit_utils, override_error)
TEST(conduit_utils, handler_defaults_are_the_defaults)
{
conduit::utils::conduit_info_handler on_info = conduit::utils::info_handler();
conduit::utils::conduit_info_handler on_info_default = &conduit::utils::default_info_handler;
conduit::utils::conduit_info_handler on_info_default = conduit::utils::default_info_handler;
EXPECT_EQ(on_info,on_info_default);

conduit::utils::conduit_warning_handler on_warning = conduit::utils::warning_handler();
conduit::utils::conduit_warning_handler on_warning_default = &conduit::utils::default_warning_handler;
conduit::utils::conduit_warning_handler on_warning_default = conduit::utils::default_warning_handler;
EXPECT_EQ(on_warning,on_warning_default);

conduit::utils::conduit_error_handler on_error = conduit::utils::error_handler();
conduit::utils::conduit_error_handler on_error_default = &conduit::utils::default_error_handler;
conduit::utils::conduit_error_handler on_error_default = conduit::utils::default_error_handler;
EXPECT_EQ(on_error,on_error_default);


EXPECT_NE(on_info,on_error);
EXPECT_NE(on_info,on_warning);
EXPECT_NE(on_error,on_warning);

//
// NOTE: (Except from "Adventures in fun with compilers")
// The default implementations of:
// conduit::utils::default_warning_handler
// and
// conduit::utils::default_error_handler
// are identical at the source level.
// On windows, we hit a case where the compiler understands this
// and low and behold there is only one copy!
//
// B/c of this we can't expect the following to hold:
// EXPECT_NE(on_error,on_warning);
//

}

Expand Down

0 comments on commit 400c982

Please sign in to comment.