aboutsummaryrefslogtreecommitdiff
path: root/tests/utils.h
diff options
context:
space:
mode:
authorBoyuan Yang <byang@debian.org>2021-11-07 08:50:18 -0500
committerBoyuan Yang <byang@debian.org>2021-11-07 08:50:18 -0500
commit320ef65362608ee1148c299d8d5d7618af34e470 (patch)
treec47911c219d1e35b8b0771e9e0176eff0e0d08ec /tests/utils.h
parent2381d803c76105f44717d75f089ec37f51e5cfe4 (diff)
downloadlibgav1-320ef65362608ee1148c299d8d5d7618af34e470.tar.gz
libgav1-320ef65362608ee1148c299d8d5d7618af34e470.tar.bz2
libgav1-320ef65362608ee1148c299d8d5d7618af34e470.zip
New upstream version 0.17.0
Diffstat (limited to 'tests/utils.h')
-rw-r--r--tests/utils.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/utils.h b/tests/utils.h
index b3062da..4d73070 100644
--- a/tests/utils.h
+++ b/tests/utils.h
@@ -22,6 +22,7 @@
#include <string>
#include "absl/base/config.h"
+#include "absl/strings/string_view.h"
#include "absl/time/time.h"
#include "src/gav1/decoder_buffer.h"
#include "src/utils/memory.h"
@@ -132,6 +133,24 @@ void CheckMd5Digest(const char name[], const char function_name[],
const char expected_digest[], const char actual_digest[],
absl::Duration elapsed_time);
+//------------------------------------------------------------------------------
+// Reads the test data from |file_name| as a string into |output|. The
+// |is_output_file| argument controls the expansion of |file_name| to its full
+// path. When |is_output_file| is true GetTestData() reads from
+// utils.cc::GetTempDir(), and when it is false the file is read from
+// utils.cc::GetSourceDir().
+void GetTestData(absl::string_view file_name, bool is_output_file,
+ std::string* output);
+
+//------------------------------------------------------------------------------
+// Returns the full path to |file_name| from libgav1/tests/data.
+std::string GetTestInputFilePath(absl::string_view file_name);
+
+//------------------------------------------------------------------------------
+// Returns the full path to |file_name| in a location where the file can be
+// opened for writing.
+std::string GetTestOutputFilePath(absl::string_view file_name);
+
} // namespace test_utils
} // namespace libgav1