|
|
@ -22,6 +22,16 @@ namespace
|
|
|
|
|
|
|
|
|
|
|
|
struct FilesGetHash : TestWithParam<Params> {};
|
|
|
|
struct FilesGetHash : TestWithParam<Params> {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST(FilesGetHash, shouldClearErrors)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
const std::string fileName = "fileName";
|
|
|
|
|
|
|
|
std::string content;
|
|
|
|
|
|
|
|
std::fill_n(std::back_inserter(content), 1, 'a');
|
|
|
|
|
|
|
|
std::istringstream stream(content);
|
|
|
|
|
|
|
|
stream.exceptions(std::ios::failbit | std::ios::badbit);
|
|
|
|
|
|
|
|
EXPECT_THAT(getHash(fileName, stream), ElementsAre(9607679276477937801ull, 16624257681780017498ull));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TEST_P(FilesGetHash, shouldReturnHashForStringStream)
|
|
|
|
TEST_P(FilesGetHash, shouldReturnHashForStringStream)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const std::string fileName = "fileName";
|
|
|
|
const std::string fileName = "fileName";
|
|
|
|