DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
file_test_util.h
1 // Copyright 2015 Google Inc. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file or at
5 // https://developers.google.com/open-source/licenses/bsd
6 
7 #ifndef MEDIA_FILE_FILE_TEST_UTIL_H_
8 #define MEDIA_FILE_FILE_TEST_UTIL_H_
9 
10 #include <string>
11 
12 #include "packager/media/file/file.h"
13 
14 namespace edash_packager {
15 namespace media {
16 
17 #define ASSERT_FILE_EQ(file_name, array) \
18  do { \
19  std::string temp_data; \
20  ASSERT_TRUE(File::ReadFileToString((file_name), &temp_data)); \
21  const char* array_ptr = reinterpret_cast<const char*>(array); \
22  ASSERT_EQ(std::string(array_ptr, arraysize(array)), temp_data); \
23  } while (false)
24 
25 } // namespace media
26 } // namespace edash_packager
27 
28 #endif // MEDIA_FILE_FILE_TEST_UTIL_H_
29