summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2014-02-16 02:21:59 -0500
committerIlia Mirkin <[email protected]>2014-02-16 23:21:57 -0500
commit6958fb341f6d74aa9712fa82feff2932c15862b3 (patch)
tree857af6f80e28876306b7d4454d9ba88eeccd9256 /src/gallium/state_trackers
parent8b5f894e13c0e290b2d3218ed8305e7428f2242f (diff)
st/xvmc: fix tests so that they pass
Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/xvmc/tests/test_rendering.c12
-rw-r--r--src/gallium/state_trackers/xvmc/tests/test_subpicture.c8
-rw-r--r--src/gallium/state_trackers/xvmc/tests/testlib.c2
3 files changed, 12 insertions, 10 deletions
diff --git a/src/gallium/state_trackers/xvmc/tests/test_rendering.c b/src/gallium/state_trackers/xvmc/tests/test_rendering.c
index 2ea557a8db5..5bfbea726b7 100644
--- a/src/gallium/state_trackers/xvmc/tests/test_rendering.c
+++ b/src/gallium/state_trackers/xvmc/tests/test_rendering.c
@@ -50,9 +50,7 @@
#define DEFAULT_OUTPUT_HEIGHT INPUT_HEIGHT
#define DEFAULT_ACCEPTABLE_ERR 0.01
-void ParseArgs(int argc, char **argv, unsigned int *output_width, unsigned int *output_height, double *acceptable_error, int *prompt);
-
-void ParseArgs(int argc, char **argv, unsigned int *output_width, unsigned int *output_height, double *acceptable_error, int *prompt)
+static void ParseArgs(int argc, char **argv, unsigned int *output_width, unsigned int *output_height, double *acceptable_error, int *prompt)
{
int fail = 0;
int i;
@@ -60,7 +58,7 @@ void ParseArgs(int argc, char **argv, unsigned int *output_width, unsigned int *
*output_width = DEFAULT_OUTPUT_WIDTH;
*output_height = DEFAULT_OUTPUT_HEIGHT;
*acceptable_error = DEFAULT_ACCEPTABLE_ERR;
- *prompt = 1;
+ *prompt = 0;
for (i = 1; i < argc && !fail; ++i)
{
@@ -79,8 +77,8 @@ void ParseArgs(int argc, char **argv, unsigned int *output_width, unsigned int *
if (sscanf(argv[++i], "%lf", acceptable_error) != 1)
fail = 1;
}
- else if (strcmp(argv[i], "-n"))
- *prompt = 0;
+ else if (!strcmp(argv[i], "-p"))
+ *prompt = 1;
else
fail = 1;
}
@@ -95,7 +93,7 @@ void ParseArgs(int argc, char **argv, unsigned int *output_width, unsigned int *
"\t-w <width>\tOutput width\n"
"\t-h <height>\tOutput height\n"
"\t-e <error>\tAcceptable margin of error per pixel, from 0 to 1\n"
- "\t-n\tDon't prompt for quit\n",
+ "\t-p\tPrompt for quit\n",
argv[0]
);
}
diff --git a/src/gallium/state_trackers/xvmc/tests/test_subpicture.c b/src/gallium/state_trackers/xvmc/tests/test_subpicture.c
index 89af093fa1f..8bd4d6d7a08 100644
--- a/src/gallium/state_trackers/xvmc/tests/test_subpicture.c
+++ b/src/gallium/state_trackers/xvmc/tests/test_subpicture.c
@@ -165,8 +165,12 @@ int main(int argc, char **argv)
assert(subpicture.xvimage_id == subpics[i].id);
/* Test width & height assigned and correct */
assert(subpicture.width == width && subpicture.height == height);
- /* Test no palette support */
- assert(subpicture.num_palette_entries == 0 && subpicture.entry_bytes == 0);
+ if (subpics[i].type == XvRGB)
+ /* Test no palette support */
+ assert(subpicture.num_palette_entries == 0 && subpicture.entry_bytes == 0);
+ else
+ /* Test palette support */
+ assert(subpicture.num_palette_entries == 16 && subpicture.entry_bytes == 4);
/* Test valid params */
assert(XvMCDestroySubpicture(display, &subpicture) == Success);
}
diff --git a/src/gallium/state_trackers/xvmc/tests/testlib.c b/src/gallium/state_trackers/xvmc/tests/testlib.c
index 3bae978d654..a943f6bcd95 100644
--- a/src/gallium/state_trackers/xvmc/tests/testlib.c
+++ b/src/gallium/state_trackers/xvmc/tests/testlib.c
@@ -85,7 +85,7 @@ int GetPort
{
for (k = 0; k < num_mc_types && !found_port; ++k)
{
- if (surface_info[j].mc_type == mc_types[k])
+ if ((surface_info[j].mc_type & mc_types[k]) == mc_types[k])
{
for (l = 0; l < adaptor_info[i].num_ports && !found_port; ++l)
{