Implement s3fs_strtoofft via strtoll
This tightens error checking and aligns s3fs with known good behavior.
This commit is contained in:
@ -79,7 +79,12 @@ void test_strtoofft()
|
||||
{
|
||||
ASSERT_EQUALS(s3fs_strtoofft("0"), static_cast<off_t>(0L));
|
||||
ASSERT_EQUALS(s3fs_strtoofft("9"), static_cast<off_t>(9L));
|
||||
ASSERT_EQUALS(s3fs_strtoofft("A"), static_cast<off_t>(0L));
|
||||
try{
|
||||
s3fs_strtoofft("A");
|
||||
abort();
|
||||
}catch(std::exception &e){
|
||||
// expected
|
||||
}
|
||||
ASSERT_EQUALS(s3fs_strtoofft("A", /*is_base_16=*/ true), static_cast<off_t>(10L));
|
||||
ASSERT_EQUALS(s3fs_strtoofft("F", /*is_base_16=*/ true), static_cast<off_t>(15L));
|
||||
ASSERT_EQUALS(s3fs_strtoofft("a", /*is_base_16=*/ true), static_cast<off_t>(10L));
|
||||
|
||||
Reference in New Issue
Block a user