ReactOS 0.4.16-dev-297-gc569aee
misc.c File Reference
#include "precomp.h"
#include <optary.h>
Include dependency graph for misc.c:

Go to the source code of this file.

Functions

static void test_HTMLLoadOptions (void)
 
 START_TEST (misc)
 

Function Documentation

◆ START_TEST()

START_TEST ( misc  )

Definition at line 102 of file misc.c.

103{
105
107
109}
#define NULL
Definition: types.h:112
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
static void test_HTMLLoadOptions(void)
Definition: misc.c:23

◆ test_HTMLLoadOptions()

static void test_HTMLLoadOptions ( void  )
static

Definition at line 23 of file misc.c.

24{
25 IHtmlLoadOptions *loadopts;
26 BYTE buf[100];
27 DWORD size, i, data = 0xdeadbeef;
29
30 hres = CoCreateInstance(&CLSID_HTMLLoadOptions, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
31 &IID_IHtmlLoadOptions, (void**)&loadopts);
32 ok(hres == S_OK, "creating HTMLLoadOptions failed: %08x\n", hres);
33 if(FAILED(hres))
34 return;
35
36 for(i=0; i <= HTMLLOADOPTION_FRAMELOAD+3; i++) {
37 size = 0xdeadbeef;
38 memset(buf, 0xdd, sizeof(buf));
39 hres = IHtmlLoadOptions_QueryOption(loadopts, i, NULL, &size);
40 ok(hres == S_OK, "QueryOption failed: %08x\n", hres);
41 ok(size == 0, "size = %d\n", size);
42 ok(buf[0] == 0xdd, "buf changed\n");
43 }
44
45 size = 0xdeadbeef;
46 hres = IHtmlLoadOptions_QueryOption(loadopts, HTMLLOADOPTION_CODEPAGE, NULL, &size);
47 ok(hres == S_OK, "QueryOption failed: %08x\n", hres);
48 ok(size == 0, "size = %d\n", size);
49
50 hres = IHtmlLoadOptions_SetOption(loadopts, HTMLLOADOPTION_CODEPAGE, &data, sizeof(data));
51 ok(hres == S_OK, "SetOption failed: %08x\n", hres);
52
53 size = sizeof(data);
54 memset(buf, 0xdd, sizeof(buf));
55 hres = IHtmlLoadOptions_QueryOption(loadopts, HTMLLOADOPTION_CODEPAGE, buf, &size);
56 ok(hres == S_OK, "QueryOption failed: %08x\n", hres);
57 ok(size == sizeof(data), "size = %d\n", size);
58 ok(*(DWORD*)buf == data, "unexpected buf\n");
59
60 size = sizeof(data)-1;
61 memset(buf, 0xdd, sizeof(buf));
62 hres = IHtmlLoadOptions_QueryOption(loadopts, HTMLLOADOPTION_CODEPAGE, buf, &size);
63 ok(hres == E_FAIL, "QueryOption failed: %08x\n", hres);
64 ok(size == sizeof(data) || !size, "size = %d\n", size);
65 ok(buf[0] == 0xdd, "buf changed\n");
66
67 data = 100;
68 hres = IHtmlLoadOptions_SetOption(loadopts, HTMLLOADOPTION_CODEPAGE, &data, 0);
69 ok(hres == S_OK, "SetOption failed: %08x\n", hres);
70
71 size = 0xdeadbeef;
72 memset(buf, 0xdd, sizeof(buf));
73 hres = IHtmlLoadOptions_QueryOption(loadopts, HTMLLOADOPTION_CODEPAGE, buf, &size);
74 ok(hres == S_OK, "QueryOption failed: %08x\n", hres);
75 ok(size == 0, "size = %d\n", size);
76 ok(buf[0] == 0xdd, "buf changed\n");
77
78 hres = IHtmlLoadOptions_SetOption(loadopts, HTMLLOADOPTION_CODEPAGE, NULL, 0);
79 ok(hres == S_OK, "SetOption failed: %08x\n", hres);
80
81 hres = IHtmlLoadOptions_SetOption(loadopts, 1000, &data, sizeof(data));
82 ok(hres == S_OK, "SetOption failed: %08x\n", hres);
83
84 size = sizeof(data);
85 memset(buf, 0xdd, sizeof(buf));
86 hres = IHtmlLoadOptions_QueryOption(loadopts, 1000, buf, &size);
87 ok(hres == S_OK, "QueryOption failed: %08x\n", hres);
88 ok(size == sizeof(data), "size = %d\n", size);
89 ok(*(DWORD*)buf == data, "unexpected buf\n");
90
91 hres = IHtmlLoadOptions_SetOption(loadopts, 1000, buf, sizeof(buf));
92 ok(hres == S_OK, "SetOption failed: %08x\n", hres);
93
94 size = 0xdeadbeef;
95 hres = IHtmlLoadOptions_QueryOption(loadopts, 1000, buf, &size);
96 ok(hres == S_OK, "QueryOption failed: %08x\n", hres);
97 ok(size == sizeof(buf), "size = %d\n", size);
98
99 IHtmlLoadOptions_Release(loadopts);
100}
#define ok(value,...)
Definition: atltest.h:57
#define E_FAIL
Definition: ddrawi.h:102
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hres
Definition: protocol.c:465
#define memset(x, y, z)
Definition: compat.h:39
unsigned char BYTE
Definition: xxhash.c:193

Referenced by START_TEST().