[Libva] [PATCH intel-driver 02/11] test: move generic toString to i965_streamable.h

U. Artie Eoff ullysses.a.eoff at intel.com
Wed Sep 28 20:36:02 UTC 2016


The toString template is generic and should be part of the
i965_streamable.h header.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff at intel.com>
---
 test/i965_jpeg_encode_test.cpp | 10 ----------
 test/i965_streamable.h         |  9 +++++++++
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/test/i965_jpeg_encode_test.cpp b/test/i965_jpeg_encode_test.cpp
index 80ca1fdc62be..a196c209ee55 100644
--- a/test/i965_jpeg_encode_test.cpp
+++ b/test/i965_jpeg_encode_test.cpp
@@ -27,9 +27,7 @@
 
 #include <algorithm>
 #include <cstring>
-#include <fstream>
 #include <memory>
-#include <sstream>
 #include <tuple>
 
 namespace JPEG {
@@ -128,14 +126,6 @@ protected:
     virtual void repr(std::ostream& os) const = 0;
 };
 
-template <typename T>
-const std::string toString(const T& t)
-{
-    std::ostringstream os;
-    os << t;
-    return os.str();
-}
-
 const TestInput::Shared NV12toI420(const TestInput::SharedConst& nv12)
 {
     TestInput::Shared i420(
diff --git a/test/i965_streamable.h b/test/i965_streamable.h
index 1c2f217d0a21..aab3111fff56 100644
--- a/test/i965_streamable.h
+++ b/test/i965_streamable.h
@@ -28,6 +28,7 @@
 #include <array>
 #include <iostream>
 #include <iomanip>
+#include <sstream>
 #include <va/va.h>
 
 namespace std {
@@ -56,6 +57,14 @@ namespace std {
     }
 }// namespace std
 
+template <typename T>
+const std::string toString(const T& t)
+{
+    std::ostringstream os;
+    os << t;
+    return os.str();
+}
+
 inline std::ostream&
 operator<<(std::ostream& os, const VAEncPictureParameterBufferJPEG& b)
 {
-- 
2.4.11



More information about the Libva mailing list