7 #ifndef MEDIA_FILE_FILE_TEST_UTIL_H_
8 #define MEDIA_FILE_FILE_TEST_UTIL_H_
10 #include <gmock/gmock.h>
11 #include <gtest/gtest.h>
15 #include "packager/media/file/file.h"
20 #define ASSERT_FILE_EQ(file_name, array) \
22 std::string temp_data; \
23 ASSERT_TRUE(File::ReadFileToString((file_name), &temp_data)); \
24 const char* array_ptr = reinterpret_cast<const char*>(array); \
25 ASSERT_EQ(std::string(array_ptr, arraysize(array)), temp_data); \
28 #define ASSERT_FILE_ENDS_WITH(file_name, array) \
30 std::string temp_data; \
31 ASSERT_TRUE(File::ReadFileToString((file_name), &temp_data)); \
32 EXPECT_THAT(temp_data, \
33 ::testing::EndsWith(std::string( \
34 reinterpret_cast<const char*>(array), sizeof(array)))); \
40 #endif // MEDIA_FILE_FILE_TEST_UTIL_H_