You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently in tests/main.cpp, we are testing corner cases with a few SonicDBConfig functions, and we test that the string from the exception that is caught, matches an expected string.
However, this is not robust and better practice would be to test for what exception type is thrown as exception strings can be easily changed breaking the test or having to change in multiple locations.
Currently in tests/main.cpp, we are testing corner cases with a few SonicDBConfig functions, and we test that the string from the exception that is caught, matches an expected string.
https://github.com/sonic-net/sonic-swss-common/blob/master/tests/main.cpp#L71
However, this is not robust and better practice would be to test for what exception type is thrown as exception strings can be easily changed breaking the test or having to change in multiple locations.
https://github.com/sonic-net/sonic-swss-common/blob/master/common/dbconnector.cpp#L248
Here we see out_of_range exception thrown; we can use EXPECT_THROW instead to test that the same exception is thrown in our UT.
The text was updated successfully, but these errors were encountered: