summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp')
-rw-r--r--media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp80
1 files changed, 1 insertions, 79 deletions
diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
index 034992ec..40e76c9a 100644
--- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
+++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
@@ -51,85 +51,6 @@ using ::android::sp;
51#include <media_video_hidl_test_common.h> 51#include <media_video_hidl_test_common.h>
52#include <fstream> 52#include <fstream>
53 53
54// A class for test environment setup
55class ComponentTestEnvironment : public ::testing::Environment {
56 public:
57 virtual void SetUp() {}
58 virtual void TearDown() {}
59
60 ComponentTestEnvironment() : instance("default"), res("/sdcard/media/") {}
61
62 void setInstance(const char* _instance) { instance = _instance; }
63
64 void setComponent(const char* _component) { component = _component; }
65
66 void setRole(const char* _role) { role = _role; }
67
68 void setRes(const char* _res) { res = _res; }
69
70 const hidl_string getInstance() const { return instance; }
71
72 const hidl_string getComponent() const { return component; }
73
74 const hidl_string getRole() const { return role; }
75
76 const hidl_string getRes() const { return res; }
77
78 int initFromOptions(int argc, char** argv) {
79 static struct option options[] = {
80 {"instance", required_argument, 0, 'I'},
81 {"component", required_argument, 0, 'C'},
82 {"role", required_argument, 0, 'R'},
83 {"res", required_argument, 0, 'P'},
84 {0, 0, 0, 0}};
85
86 while (true) {
87 int index = 0;
88 int c = getopt_long(argc, argv, "I:C:R:P:", options, &index);
89 if (c == -1) {
90 break;
91 }
92
93 switch (c) {
94 case 'I':
95 setInstance(optarg);
96 break;
97 case 'C':
98 setComponent(optarg);
99 break;
100 case 'R':
101 setRole(optarg);
102 break;
103 case 'P':
104 setRes(optarg);
105 break;
106 case '?':
107 break;
108 }
109 }
110
111 if (optind < argc) {
112 fprintf(stderr,
113 "unrecognized option: %s\n\n"
114 "usage: %s <gtest options> <test options>\n\n"
115 "test options are:\n\n"
116 "-I, --instance: HAL instance to test\n"
117 "-C, --component: OMX component to test\n"
118 "-R, --role: OMX component Role\n"
119 "-P, --res: Resource files directory location\n",
120 argv[optind ?: 1], argv[0]);
121 return 2;
122 }
123 return 0;
124 }
125
126 private:
127 hidl_string instance;
128 hidl_string component;
129 hidl_string role;
130 hidl_string res;
131};
132
133static ComponentTestEnvironment* gEnv = nullptr; 54static ComponentTestEnvironment* gEnv = nullptr;
134 55
135// video decoder test fixture class 56// video decoder test fixture class
@@ -1488,6 +1409,7 @@ int main(int argc, char** argv) {
1488 gEnv = new ComponentTestEnvironment(); 1409 gEnv = new ComponentTestEnvironment();
1489 ::testing::AddGlobalTestEnvironment(gEnv); 1410 ::testing::AddGlobalTestEnvironment(gEnv);
1490 ::testing::InitGoogleTest(&argc, argv); 1411 ::testing::InitGoogleTest(&argc, argv);
1412 gEnv->init(&argc, argv);
1491 int status = gEnv->initFromOptions(argc, argv); 1413 int status = gEnv->initFromOptions(argc, argv);
1492 if (status == 0) { 1414 if (status == 0) {
1493 status = RUN_ALL_TESTS(); 1415 status = RUN_ALL_TESTS();