avifil32: Skip tests when we couldn't create or open the AVI file

Alexandre Goujon ale.goujon at gmail.com
Sun Jan 30 12:29:04 CST 2011


---
 dlls/avifil32/tests/api.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/dlls/avifil32/tests/api.c b/dlls/avifil32/tests/api.c
index 14ad4b4..c1ba878 100644
--- a/dlls/avifil32/tests/api.c
+++ b/dlls/avifil32/tests/api.c
@@ -338,6 +338,12 @@ static void create_avi_file(const COMMON_AVI_HEADERS *cah, char *filename)
 
     ok(hFile != INVALID_HANDLE_VALUE, "Couldn't create file\n");
 
+    if(hFile == INVALID_HANDLE_VALUE)
+    {
+        win_skip("Could not create the AVI file\n");
+        return;
+    }
+
     WriteFile(hFile, &cah->fh, sizeof(deffh), &written, NULL);
     WriteFile(hFile, &cah->mah, sizeof(MainAVIHeader), &written, NULL);
     WriteFile(hFile, streamlist, sizeof(streamlist), &written, NULL);
@@ -380,6 +386,12 @@ static void test_default_data(void)
     ok(res != REGDB_E_CLASSNOTREG, "Unable to open file: error5=%u\n", REGDB_E_CLASSNOTREG);
     ok(res == 0, "Unable to open file: error=%u\n", res);
 
+    if(res != 0)
+    {
+        win_skip("Could not open the file.\n");
+        return;
+    }
+
     res = AVIFileGetStream(pFile, &pStream0, 0, 0);
     ok(res == 0, "Unable to open video stream: error=%u\n", res);
 
-- 
1.7.0.4




More information about the wine-patches mailing list