Splitted FileHandler into FrameReader and FrameWriter classes and moved them to testsupport in test.gyp.
Fixed unit tests so they don't use ASSERT_DEATH since that doesn't work with Valgrind.
Fixed all Valgrind warnings except the one caused by CriticalSectionWrapper in system_wrappers.
Reworked all includes and GYP include paths to use full directory paths.
Removed util.h for logging, since it rendered warnings in Valgrind because of gflags. Replaced it with a verbose flag and a new function in video_quality_measurement.cc
BUG=
TEST=Passed test_support_unittests and video_codecs_test_framework_unittests on Linux, Mac and Windows.
Review URL: http://webrtc-codereview.appspot.com/311001
git-svn-id: http://webrtc.googlecode.com/svn/trunk@1126 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/test/testsupport/fileutils.cc b/test/testsupport/fileutils.cc
index 129651f..1e6bbca 100644
--- a/test/testsupport/fileutils.cc
+++ b/test/testsupport/fileutils.cc
@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "fileutils.h"
+#include "testsupport/fileutils.h"
#ifdef WIN32
#include <direct.h>
@@ -85,8 +85,7 @@
if (!GET_CURRENT_DIR(path_buffer, sizeof(path_buffer))) {
fprintf(stderr, "Cannot get current directory!\n");
return kFallbackPath;
- }
- else {
+ } else {
return std::string(path_buffer);
}
}
@@ -131,7 +130,8 @@
std::string architecture = "32";
#endif // WEBRTC_ARCH_64_BITS
- std::string resources_path = ProjectRootPath() + kResourcesDirName + kPathDelimiter;
+ std::string resources_path = ProjectRootPath() + kResourcesDirName +
+ kPathDelimiter;
std::string resource_file = resources_path + name + "_" + platform + "_" +
architecture + "." + extension;
if (FileExists(resource_file)) {
@@ -151,5 +151,17 @@
return resources_path + name + "." + extension;
}
+size_t GetFileSize(std::string filename) {
+ FILE* f = fopen(filename.c_str(), "rb");
+ size_t size = 0;
+ if (f != NULL) {
+ if (fseek(f, 0, SEEK_END) == 0) {
+ size = ftell(f);
+ }
+ fclose(f);
+ }
+ return size;
+}
+
} // namespace test
} // namespace webrtc