From 5964f663f30aa3ec25cf4eca98dae81cfb99d162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Villac=C3=ADs=20Lasso?= Date: Tue, 17 Jan 2006 16:00:16 +0100 Subject: [PATCH] msacm: Add parameter tests for ACM_METRIC_DRIVER_PRIORITY and ACM_METRIC_DRIVER_SUPPORT. Fix copy&paste mislabeling on acmDriverID test failure. --- dlls/msacm/tests/msacm.c | 55 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/dlls/msacm/tests/msacm.c b/dlls/msacm/tests/msacm.c index 1d585fd1fc6..4912096814b 100644 --- a/dlls/msacm/tests/msacm.c +++ b/dlls/msacm/tests/msacm.c @@ -61,6 +61,9 @@ static BOOL CALLBACK DriverEnumProc(HACMDRIVERID hadid, MMRESULT rc; ACMDRIVERDETAILS dd; HACMDRIVER had; + + DWORD dwDriverPriority; + DWORD dwDriverSupport; if (winetest_interactive) { trace("id: %p\n", hadid); @@ -139,6 +142,54 @@ static BOOL CALLBACK DriverEnumProc(HACMDRIVERID hadid, trace(" Supports %lu filter formats\n", dd.cFilterTags); } + /* try bad pointer */ + rc = acmMetrics((HACMOBJ)hadid, ACM_METRIC_DRIVER_PRIORITY, 0); + ok(rc == MMSYSERR_INVALPARAM, + "acmMetrics(): rc = %08x, should be %08x\n", + rc, MMSYSERR_INVALPARAM); + + /* try bad handle */ + rc = acmMetrics((HACMOBJ)1, ACM_METRIC_DRIVER_PRIORITY, &dwDriverPriority); + ok(rc == MMSYSERR_INVALHANDLE, + "acmMetrics(): rc = %08x, should be %08x\n", + rc, MMSYSERR_INVALHANDLE); + + /* try bad pointer and handle */ + rc = acmMetrics((HACMOBJ)1, ACM_METRIC_DRIVER_PRIORITY, 0); + ok(rc == MMSYSERR_INVALHANDLE, + "acmMetrics(): rc = %08x, should be %08x\n", + rc, MMSYSERR_INVALHANDLE); + + /* try valid parameters */ + rc = acmMetrics((HACMOBJ)hadid, ACM_METRIC_DRIVER_PRIORITY, &dwDriverSupport); + ok(rc == MMSYSERR_NOERROR, + "acmMetrics(): rc = %08x, should be %08x\n", + rc, MMSYSERR_NOERROR); + + /* try bad pointer */ + rc = acmMetrics((HACMOBJ)hadid, ACM_METRIC_DRIVER_SUPPORT, 0); + ok(rc == MMSYSERR_INVALPARAM, + "acmMetrics(): rc = %08x, should be %08x\n", + rc, MMSYSERR_INVALPARAM); + + /* try bad handle */ + rc = acmMetrics((HACMOBJ)1, ACM_METRIC_DRIVER_SUPPORT, &dwDriverSupport); + ok(rc == MMSYSERR_INVALHANDLE, + "acmMetrics(): rc = %08x, should be %08x\n", + rc, MMSYSERR_INVALHANDLE); + + /* try bad pointer and handle */ + rc = acmMetrics((HACMOBJ)1, ACM_METRIC_DRIVER_SUPPORT, 0); + ok(rc == MMSYSERR_INVALHANDLE, + "acmMetrics(): rc = %08x, should be %08x\n", + rc, MMSYSERR_INVALHANDLE); + + /* try valid parameters */ + rc = acmMetrics((HACMOBJ)hadid, ACM_METRIC_DRIVER_SUPPORT, &dwDriverSupport); + ok(rc == MMSYSERR_NOERROR, + "acmMetrics(): rc = %08x, should be %08x\n", + rc, MMSYSERR_NOERROR); + /* try invalid pointer */ rc = acmDriverOpen(0, hadid, 0); ok(rc == MMSYSERR_INVALPARAM, @@ -176,13 +227,13 @@ static BOOL CALLBACK DriverEnumProc(HACMDRIVERID hadid, /* try bad handle */ rc = acmDriverID((HACMOBJ)1, &hid, 0); ok(rc == MMSYSERR_INVALHANDLE, - "acmMetrics(): rc = %08x, should be %08x\n", + "acmDriverID(): rc = %08x, should be %08x\n", rc, MMSYSERR_INVALHANDLE); /* try bad handle and pointer */ rc = acmDriverID((HACMOBJ)1, 0, 0); ok(rc == MMSYSERR_INVALHANDLE, - "acmMetrics(): rc = %08x, should be %08x\n", + "acmDriverID(): rc = %08x, should be %08x\n", rc, MMSYSERR_INVALHANDLE); /* try bad flag */