Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
February 2022
- 87 participants
- 926 discussions
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/winealsa.drv/alsa.c | 60 ++++++++++++++++++++++++++++++++++++
dlls/winealsa.drv/mmdevdrv.c | 51 +++---------------------------
dlls/winealsa.drv/unixlib.h | 7 +++++
3 files changed, 71 insertions(+), 47 deletions(-)
diff --git a/dlls/winealsa.drv/alsa.c b/dlls/winealsa.drv/alsa.c
index e0a6c613021..5d54df512ac 100644
--- a/dlls/winealsa.drv/alsa.c
+++ b/dlls/winealsa.drv/alsa.c
@@ -1409,6 +1409,47 @@ exit:
NtSetEvent(stream->event, NULL);
}
+static snd_pcm_uframes_t interp_elapsed_frames(struct alsa_stream *stream)
+{
+ LARGE_INTEGER time_freq, current_time, time_diff;
+
+ NtQueryPerformanceCounter(¤t_time, &time_freq);
+ time_diff.QuadPart = current_time.QuadPart - stream->last_period_time.QuadPart;
+ return muldiv(time_diff.QuadPart, stream->fmt->nSamplesPerSec, time_freq.QuadPart);
+}
+
+static int alsa_rewind_best_effort(struct alsa_stream *stream)
+{
+ snd_pcm_uframes_t len, leave;
+
+ /* we can't use snd_pcm_rewindable, some PCM devices crash. so follow
+ * PulseAudio's example and rewind as much data as we believe is in the
+ * buffer, minus 1.33ms for safety. */
+
+ /* amount of data to leave in ALSA buffer */
+ leave = interp_elapsed_frames(stream) + stream->safe_rewind_frames;
+
+ if(stream->held_frames < leave)
+ stream->held_frames = 0;
+ else
+ stream->held_frames -= leave;
+
+ if(stream->data_in_alsa_frames < leave)
+ len = 0;
+ else
+ len = stream->data_in_alsa_frames - leave;
+
+ TRACE("rewinding %lu frames, now held %u\n", len, stream->held_frames);
+
+ if(len)
+ /* snd_pcm_rewind return value is often broken, assume it succeeded */
+ snd_pcm_rewind(stream->pcm_handle, len);
+
+ stream->data_in_alsa_frames = 0;
+
+ return len;
+}
+
static NTSTATUS start(void *args)
{
struct start_params *params = args;
@@ -1455,6 +1496,24 @@ static NTSTATUS start(void *args)
return alsa_unlock_result(stream, ¶ms->result, S_OK);
}
+static NTSTATUS stop(void *args)
+{
+ struct stop_params *params = args;
+ struct alsa_stream *stream = params->stream;
+
+ alsa_lock(stream);
+
+ if(!stream->started)
+ return alsa_unlock_result(stream, ¶ms->result, S_FALSE);
+
+ if(stream->flow == eRender)
+ alsa_rewind_best_effort(stream);
+
+ stream->started = FALSE;
+
+ return alsa_unlock_result(stream, ¶ms->result, S_OK);
+}
+
static NTSTATUS timer_loop(void *args)
{
struct timer_loop_params *params = args;
@@ -1791,6 +1850,7 @@ unixlib_entry_t __wine_unix_call_funcs[] =
create_stream,
release_stream,
start,
+ stop,
timer_loop,
is_format_supported,
get_mix_format,
diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c
index 5eab548e606..d9e96b7790c 100644
--- a/dlls/winealsa.drv/mmdevdrv.c
+++ b/dlls/winealsa.drv/mmdevdrv.c
@@ -972,39 +972,6 @@ static snd_pcm_uframes_t interp_elapsed_frames(struct alsa_stream *stream)
return MulDiv(time_diff.QuadPart, stream->fmt->nSamplesPerSec, time_freq.QuadPart);
}
-static int alsa_rewind_best_effort(ACImpl *This)
-{
- struct alsa_stream *stream = This->stream;
- snd_pcm_uframes_t len, leave;
-
- /* we can't use snd_pcm_rewindable, some PCM devices crash. so follow
- * PulseAudio's example and rewind as much data as we believe is in the
- * buffer, minus 1.33ms for safety. */
-
- /* amount of data to leave in ALSA buffer */
- leave = interp_elapsed_frames(stream) + stream->safe_rewind_frames;
-
- if(stream->held_frames < leave)
- stream->held_frames = 0;
- else
- stream->held_frames -= leave;
-
- if(stream->data_in_alsa_frames < leave)
- len = 0;
- else
- len = stream->data_in_alsa_frames - leave;
-
- TRACE("rewinding %lu frames, now held %u\n", len, stream->held_frames);
-
- if(len)
- /* snd_pcm_rewind return value is often broken, assume it succeeded */
- snd_pcm_rewind(stream->pcm_handle, len);
-
- stream->data_in_alsa_frames = 0;
-
- return len;
-}
-
static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface)
{
ACImpl *This = impl_from_IAudioClient3(iface);
@@ -1036,28 +1003,18 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface)
static HRESULT WINAPI AudioClient_Stop(IAudioClient3 *iface)
{
ACImpl *This = impl_from_IAudioClient3(iface);
- struct alsa_stream *stream = This->stream;
+ struct stop_params params;
TRACE("(%p)\n", This);
if(!This->stream)
return AUDCLNT_E_NOT_INITIALIZED;
- alsa_lock(stream);
-
- if(!stream->started){
- alsa_unlock(stream);
- return S_FALSE;
- }
-
- if(stream->flow == eRender)
- alsa_rewind_best_effort(This);
-
- stream->started = FALSE;
+ params.stream = This->stream;
- alsa_unlock(stream);
+ ALSA_CALL(stop, ¶ms);
- return S_OK;
+ return params.result;
}
static HRESULT WINAPI AudioClient_Reset(IAudioClient3 *iface)
diff --git a/dlls/winealsa.drv/unixlib.h b/dlls/winealsa.drv/unixlib.h
index c058a920b6e..1c3caabcc26 100644
--- a/dlls/winealsa.drv/unixlib.h
+++ b/dlls/winealsa.drv/unixlib.h
@@ -97,6 +97,12 @@ struct start_params
HRESULT result;
};
+struct stop_params
+{
+ struct alsa_stream *stream;
+ HRESULT result;
+};
+
struct timer_loop_params
{
struct alsa_stream *stream;
@@ -147,6 +153,7 @@ enum alsa_funcs
alsa_create_stream,
alsa_release_stream,
alsa_start,
+ alsa_stop,
alsa_timer_loop,
alsa_is_format_supported,
alsa_get_mix_format,
--
2.25.1
1
0
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/winealsa.drv/alsa.c | 56 +++++++++++++++++----
dlls/winealsa.drv/mmdevdrv.c | 97 ++----------------------------------
dlls/winealsa.drv/unixlib.h | 17 +++----
3 files changed, 59 insertions(+), 111 deletions(-)
diff --git a/dlls/winealsa.drv/alsa.c b/dlls/winealsa.drv/alsa.c
index 91ead000497..e0a6c613021 100644
--- a/dlls/winealsa.drv/alsa.c
+++ b/dlls/winealsa.drv/alsa.c
@@ -1214,13 +1214,6 @@ static snd_pcm_sframes_t alsa_write_best_effort(struct alsa_stream *stream, BYTE
return written;
}
-static NTSTATUS write_best_effort(void *args)
-{
- struct write_best_effort_tmp_params *params = args;
- *params->written = alsa_write_best_effort(params->stream, params->buf, params->frames);
- return STATUS_SUCCESS;
-}
-
static snd_pcm_sframes_t alsa_write_buffer_wrap(struct alsa_stream *stream, BYTE *buf,
snd_pcm_uframes_t buflen, snd_pcm_uframes_t offs,
snd_pcm_uframes_t to_write)
@@ -1416,6 +1409,52 @@ exit:
NtSetEvent(stream->event, NULL);
}
+static NTSTATUS start(void *args)
+{
+ struct start_params *params = args;
+ struct alsa_stream *stream = params->stream;
+
+ alsa_lock(stream);
+
+ if((stream->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK) && !stream->event)
+ return alsa_unlock_result(stream, ¶ms->result, AUDCLNT_E_EVENTHANDLE_NOT_SET);
+
+ if(stream->started)
+ return alsa_unlock_result(stream, ¶ms->result, AUDCLNT_E_NOT_STOPPED);
+
+ if(stream->flow == eCapture){
+ /* dump any data that might be leftover in the ALSA capture buffer */
+ snd_pcm_readi(stream->pcm_handle, stream->local_buffer,
+ stream->bufsize_frames);
+ }else{
+ snd_pcm_sframes_t avail, written;
+ snd_pcm_uframes_t offs;
+
+ avail = snd_pcm_avail_update(stream->pcm_handle);
+ avail = min(avail, stream->held_frames);
+
+ if(stream->wri_offs_frames < stream->held_frames)
+ offs = stream->bufsize_frames - stream->held_frames + stream->wri_offs_frames;
+ else
+ offs = stream->wri_offs_frames - stream->held_frames;
+
+ /* fill it with data */
+ written = alsa_write_buffer_wrap(stream, stream->local_buffer,
+ stream->bufsize_frames, offs, avail);
+
+ if(written > 0){
+ stream->lcl_offs_frames = (offs + written) % stream->bufsize_frames;
+ stream->data_in_alsa_frames = written;
+ }else{
+ stream->lcl_offs_frames = offs;
+ stream->data_in_alsa_frames = 0;
+ }
+ }
+ stream->started = TRUE;
+
+ return alsa_unlock_result(stream, ¶ms->result, S_OK);
+}
+
static NTSTATUS timer_loop(void *args)
{
struct timer_loop_params *params = args;
@@ -1751,12 +1790,11 @@ unixlib_entry_t __wine_unix_call_funcs[] =
get_endpoint_ids,
create_stream,
release_stream,
+ start,
timer_loop,
is_format_supported,
get_mix_format,
get_buffer_size,
get_latency,
get_current_padding,
-
- write_best_effort /* temporary */
};
diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c
index 2748cc552a6..5eab548e606 100644
--- a/dlls/winealsa.drv/mmdevdrv.c
+++ b/dlls/winealsa.drv/mmdevdrv.c
@@ -963,51 +963,6 @@ static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient3 *iface,
return S_OK;
}
-static snd_pcm_sframes_t alsa_write_best_effort(struct alsa_stream *stream, BYTE *buf, snd_pcm_uframes_t frames)
-{
- struct write_best_effort_tmp_params params;
- snd_pcm_sframes_t written;
-
- params.stream = stream;
- params.buf = buf;
- params.frames = frames;
- params.written = &written;
-
- ALSA_CALL(write_best_effort_tmp, ¶ms);
-
- return written;
-}
-
-static snd_pcm_sframes_t alsa_write_buffer_wrap(struct alsa_stream *stream, BYTE *buf,
- snd_pcm_uframes_t buflen, snd_pcm_uframes_t offs,
- snd_pcm_uframes_t to_write)
-{
- snd_pcm_sframes_t ret = 0;
-
- while(to_write){
- snd_pcm_uframes_t chunk;
- snd_pcm_sframes_t tmp;
-
- if(offs + to_write > buflen)
- chunk = buflen - offs;
- else
- chunk = to_write;
-
- tmp = alsa_write_best_effort(stream, buf + offs * stream->fmt->nBlockAlign, chunk);
- if(tmp < 0)
- return ret;
- if(!tmp)
- break;
-
- ret += tmp;
- to_write -= tmp;
- offs += tmp;
- offs %= buflen;
- }
-
- return ret;
-}
-
static snd_pcm_uframes_t interp_elapsed_frames(struct alsa_stream *stream)
{
LARGE_INTEGER time_freq, current_time, time_diff;
@@ -1053,7 +1008,7 @@ static int alsa_rewind_best_effort(ACImpl *This)
static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface)
{
ACImpl *This = impl_from_IAudioClient3(iface);
- struct alsa_stream *stream = This->stream;
+ struct start_params params;
TRACE("(%p)\n", This);
@@ -1064,60 +1019,18 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface)
return AUDCLNT_E_NOT_INITIALIZED;
}
- alsa_lock(stream);
-
- if((stream->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK) && !stream->event){
- alsa_unlock(stream);
- LeaveCriticalSection(&g_sessions_lock);
- return AUDCLNT_E_EVENTHANDLE_NOT_SET;
- }
-
- if(stream->started){
- alsa_unlock(stream);
- LeaveCriticalSection(&g_sessions_lock);
- return AUDCLNT_E_NOT_STOPPED;
- }
-
- if(stream->flow == eCapture){
- /* dump any data that might be leftover in the ALSA capture buffer */
- snd_pcm_readi(stream->pcm_handle, stream->local_buffer,
- stream->bufsize_frames);
- }else{
- snd_pcm_sframes_t avail, written;
- snd_pcm_uframes_t offs;
-
- avail = snd_pcm_avail_update(stream->pcm_handle);
- avail = min(avail, stream->held_frames);
-
- if(stream->wri_offs_frames < stream->held_frames)
- offs = stream->bufsize_frames - stream->held_frames + stream->wri_offs_frames;
- else
- offs = stream->wri_offs_frames - stream->held_frames;
+ params.stream = This->stream;
- /* fill it with data */
- written = alsa_write_buffer_wrap(stream, stream->local_buffer,
- stream->bufsize_frames, offs, avail);
+ ALSA_CALL(start, ¶ms);
- if(written > 0){
- stream->lcl_offs_frames = (offs + written) % stream->bufsize_frames;
- stream->data_in_alsa_frames = written;
- }else{
- stream->lcl_offs_frames = offs;
- stream->data_in_alsa_frames = 0;
- }
- }
-
- if(!This->timer_thread){
+ if(SUCCEEDED(params.result) && !This->timer_thread){
This->timer_thread = CreateThread(NULL, 0, alsa_timer_thread, This->stream, 0, NULL);
SetThreadPriority(This->timer_thread, THREAD_PRIORITY_TIME_CRITICAL);
}
- stream->started = TRUE;
-
- alsa_unlock(stream);
LeaveCriticalSection(&g_sessions_lock);
- return S_OK;
+ return params.result;
}
static HRESULT WINAPI AudioClient_Stop(IAudioClient3 *iface)
diff --git a/dlls/winealsa.drv/unixlib.h b/dlls/winealsa.drv/unixlib.h
index 4acbbcbcf11..c058a920b6e 100644
--- a/dlls/winealsa.drv/unixlib.h
+++ b/dlls/winealsa.drv/unixlib.h
@@ -91,6 +91,12 @@ struct release_stream_params
HRESULT result;
};
+struct start_params
+{
+ struct alsa_stream *stream;
+ HRESULT result;
+};
+
struct timer_loop_params
{
struct alsa_stream *stream;
@@ -135,27 +141,18 @@ struct get_current_padding_params
UINT32 *padding;
};
-struct write_best_effort_tmp_params
-{
- struct alsa_stream *stream;
- BYTE *buf;
- snd_pcm_uframes_t frames;
- snd_pcm_sframes_t *written;
-};
-
enum alsa_funcs
{
alsa_get_endpoint_ids,
alsa_create_stream,
alsa_release_stream,
+ alsa_start,
alsa_timer_loop,
alsa_is_format_supported,
alsa_get_mix_format,
alsa_get_buffer_size,
alsa_get_latency,
alsa_get_current_padding,
-
- alsa_write_best_effort_tmp
};
extern unixlib_handle_t alsa_handle;
--
2.25.1
1
0
25 Feb '22
This will allow the timing loop to move over without needing
to move "start" at the same time.
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/winealsa.drv/alsa.c | 237 ++++++++++++++++++++++++++++++++++-
dlls/winealsa.drv/mmdevdrv.c | 230 +--------------------------------
dlls/winealsa.drv/unixlib.h | 10 ++
3 files changed, 252 insertions(+), 225 deletions(-)
diff --git a/dlls/winealsa.drv/alsa.c b/dlls/winealsa.drv/alsa.c
index c73490ebfe6..73971c0f8bb 100644
--- a/dlls/winealsa.drv/alsa.c
+++ b/dlls/winealsa.drv/alsa.c
@@ -970,7 +970,7 @@ static NTSTATUS release_stream(void *args)
size = 0;
NtFreeVirtualMemory(GetCurrentProcess(), (void **)&stream->tmp_buffer, &size, MEM_RELEASE);
}
- /* free(stream->remapping_buf); */
+ free(stream->remapping_buf);
free(stream->silence_buf);
free(stream->hw_params);
free(stream->fmt);
@@ -982,6 +982,239 @@ static NTSTATUS release_stream(void *args)
return STATUS_SUCCESS;
}
+static BYTE *remap_channels(struct alsa_stream *stream, BYTE *buf, snd_pcm_uframes_t frames)
+{
+ snd_pcm_uframes_t i;
+ UINT c;
+ UINT bytes_per_sample = stream->fmt->wBitsPerSample / 8;
+
+ if(!stream->need_remapping)
+ return buf;
+
+ if(stream->remapping_buf_frames < frames){
+ stream->remapping_buf = realloc(stream->remapping_buf,
+ bytes_per_sample * stream->alsa_channels * frames);
+ stream->remapping_buf_frames = frames;
+ }
+
+ snd_pcm_format_set_silence(stream->alsa_format, stream->remapping_buf,
+ frames * stream->alsa_channels);
+
+ switch(stream->fmt->wBitsPerSample){
+ case 8: {
+ UINT8 *tgt_buf, *src_buf;
+ tgt_buf = stream->remapping_buf;
+ src_buf = buf;
+ for(i = 0; i < frames; ++i){
+ for(c = 0; c < stream->fmt->nChannels; ++c)
+ tgt_buf[stream->alsa_channel_map[c]] = src_buf[c];
+ tgt_buf += stream->alsa_channels;
+ src_buf += stream->fmt->nChannels;
+ }
+ break;
+ }
+ case 16: {
+ UINT16 *tgt_buf, *src_buf;
+ tgt_buf = (UINT16*)stream->remapping_buf;
+ src_buf = (UINT16*)buf;
+ for(i = 0; i < frames; ++i){
+ for(c = 0; c < stream->fmt->nChannels; ++c)
+ tgt_buf[stream->alsa_channel_map[c]] = src_buf[c];
+ tgt_buf += stream->alsa_channels;
+ src_buf += stream->fmt->nChannels;
+ }
+ }
+ break;
+ case 32: {
+ UINT32 *tgt_buf, *src_buf;
+ tgt_buf = (UINT32*)stream->remapping_buf;
+ src_buf = (UINT32*)buf;
+ for(i = 0; i < frames; ++i){
+ for(c = 0; c < stream->fmt->nChannels; ++c)
+ tgt_buf[stream->alsa_channel_map[c]] = src_buf[c];
+ tgt_buf += stream->alsa_channels;
+ src_buf += stream->fmt->nChannels;
+ }
+ }
+ break;
+ default: {
+ BYTE *tgt_buf, *src_buf;
+ tgt_buf = stream->remapping_buf;
+ src_buf = buf;
+ for(i = 0; i < frames; ++i){
+ for(c = 0; c < stream->fmt->nChannels; ++c)
+ memcpy(&tgt_buf[stream->alsa_channel_map[c] * bytes_per_sample],
+ &src_buf[c * bytes_per_sample], bytes_per_sample);
+ tgt_buf += stream->alsa_channels * bytes_per_sample;
+ src_buf += stream->fmt->nChannels * bytes_per_sample;
+ }
+ }
+ break;
+ }
+
+ return stream->remapping_buf;
+}
+
+static void adjust_buffer_volume(const struct alsa_stream *stream, BYTE *buf, snd_pcm_uframes_t frames)
+{
+ BOOL adjust = FALSE;
+ UINT32 i, channels, mute = 0;
+ BYTE *end;
+
+ if (stream->vol_adjusted_frames >= frames)
+ return;
+ channels = stream->fmt->nChannels;
+
+ /* Adjust the buffer based on the volume for each channel */
+ for (i = 0; i < channels; i++)
+ {
+ adjust |= stream->vols[i] != 1.0f;
+ if (stream->vols[i] == 0.0f)
+ mute++;
+ }
+
+ if (mute == channels)
+ {
+ int err = snd_pcm_format_set_silence(stream->alsa_format, buf, frames * channels);
+ if (err < 0)
+ WARN("Setting buffer to silence failed: %d (%s)\n", err, snd_strerror(err));
+ return;
+ }
+ if (!adjust) return;
+
+ /* Skip the frames we've already adjusted before */
+ end = buf + frames * stream->fmt->nBlockAlign;
+ buf += stream->vol_adjusted_frames * stream->fmt->nBlockAlign;
+
+ switch (stream->alsa_format)
+ {
+#ifndef WORDS_BIGENDIAN
+#define PROCESS_BUFFER(type) do \
+{ \
+ type *p = (type*)buf; \
+ do \
+ { \
+ for (i = 0; i < channels; i++) \
+ p[i] = p[i] * stream->vols[i]; \
+ p += i; \
+ } while ((BYTE*)p != end); \
+} while (0)
+ case SND_PCM_FORMAT_S16_LE:
+ PROCESS_BUFFER(INT16);
+ break;
+ case SND_PCM_FORMAT_S32_LE:
+ PROCESS_BUFFER(INT32);
+ break;
+ case SND_PCM_FORMAT_FLOAT_LE:
+ PROCESS_BUFFER(float);
+ break;
+ case SND_PCM_FORMAT_FLOAT64_LE:
+ PROCESS_BUFFER(double);
+ break;
+#undef PROCESS_BUFFER
+ case SND_PCM_FORMAT_S20_3LE:
+ case SND_PCM_FORMAT_S24_3LE:
+ {
+ /* Do it 12 bytes at a time until it is no longer possible */
+ UINT32 *q = (UINT32*)buf, mask = ~0xff;
+ BYTE *p;
+
+ /* After we adjust the volume, we need to mask out low bits */
+ if (stream->alsa_format == SND_PCM_FORMAT_S20_3LE)
+ mask = ~0x0fff;
+
+ i = 0;
+ while (end - (BYTE*)q >= 12)
+ {
+ UINT32 v[4], k;
+ v[0] = q[0] << 8;
+ v[1] = q[1] << 16 | (q[0] >> 16 & ~0xff);
+ v[2] = q[2] << 24 | (q[1] >> 8 & ~0xff);
+ v[3] = q[2] & ~0xff;
+ for (k = 0; k < 4; k++)
+ {
+ v[k] = (INT32)((INT32)v[k] * stream->vols[i]);
+ v[k] &= mask;
+ if (++i == channels) i = 0;
+ }
+ *q++ = v[0] >> 8 | v[1] << 16;
+ *q++ = v[1] >> 16 | v[2] << 8;
+ *q++ = v[2] >> 24 | v[3];
+ }
+ p = (BYTE*)q;
+ while (p != end)
+ {
+ UINT32 v = (INT32)((INT32)(p[0] << 8 | p[1] << 16 | p[2] << 24) * stream->vols[i]);
+ v &= mask;
+ *p++ = v >> 8 & 0xff;
+ *p++ = v >> 16 & 0xff;
+ *p++ = v >> 24;
+ if (++i == channels) i = 0;
+ }
+ break;
+ }
+#endif
+ case SND_PCM_FORMAT_U8:
+ {
+ UINT8 *p = (UINT8*)buf;
+ do
+ {
+ for (i = 0; i < channels; i++)
+ p[i] = (int)((p[i] - 128) * stream->vols[i]) + 128;
+ p += i;
+ } while ((BYTE*)p != end);
+ break;
+ }
+ default:
+ TRACE("Unhandled format %i, not adjusting volume.\n", stream->alsa_format);
+ break;
+ }
+}
+
+static snd_pcm_sframes_t alsa_write_best_effort(struct alsa_stream *stream, BYTE *buf, snd_pcm_uframes_t frames)
+{
+ snd_pcm_sframes_t written;
+
+ adjust_buffer_volume(stream, buf, frames);
+
+ /* Mark the frames we've already adjusted */
+ if (stream->vol_adjusted_frames < frames)
+ stream->vol_adjusted_frames = frames;
+
+ buf = remap_channels(stream, buf, frames);
+
+ written = snd_pcm_writei(stream->pcm_handle, buf, frames);
+ if(written < 0){
+ int ret;
+
+ if(written == -EAGAIN)
+ /* buffer full */
+ return 0;
+
+ WARN("writei failed, recovering: %ld (%s)\n", written,
+ snd_strerror(written));
+
+ ret = snd_pcm_recover(stream->pcm_handle, written, 0);
+ if(ret < 0){
+ WARN("Could not recover: %d (%s)\n", ret, snd_strerror(ret));
+ return ret;
+ }
+
+ written = snd_pcm_writei(stream->pcm_handle, buf, frames);
+ }
+
+ if (written > 0)
+ stream->vol_adjusted_frames -= written;
+ return written;
+}
+
+static NTSTATUS write_best_effort(void *args)
+{
+ struct write_best_effort_tmp_params *params = args;
+ *params->written = alsa_write_best_effort(params->stream, params->buf, params->frames);
+ return STATUS_SUCCESS;
+}
+
static NTSTATUS is_format_supported(void *args)
{
struct is_format_supported_params *params = args;
@@ -1294,4 +1527,6 @@ unixlib_entry_t __wine_unix_call_funcs[] =
get_buffer_size,
get_latency,
get_current_padding,
+
+ write_best_effort /* temporary */
};
diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c
index a4ab0e179d1..c06b08709f2 100644
--- a/dlls/winealsa.drv/mmdevdrv.c
+++ b/dlls/winealsa.drv/mmdevdrv.c
@@ -256,9 +256,6 @@ static HRESULT alsa_stream_release(struct alsa_stream *stream)
{
struct release_stream_params params;
- /* FIXME: to be moved with remap_channels() */
- HeapFree(GetProcessHeap(), 0, stream->remapping_buf);
-
params.stream = stream;
ALSA_CALL(release_stream, ¶ms);
@@ -969,233 +966,18 @@ static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient3 *iface,
return S_OK;
}
-static BYTE *remap_channels(struct alsa_stream *stream, BYTE *buf, snd_pcm_uframes_t frames)
-{
- snd_pcm_uframes_t i;
- UINT c;
- UINT bytes_per_sample = stream->fmt->wBitsPerSample / 8;
-
- if(!stream->need_remapping)
- return buf;
-
- if(!stream->remapping_buf){
- stream->remapping_buf = HeapAlloc(GetProcessHeap(), 0,
- bytes_per_sample * stream->alsa_channels * frames);
- stream->remapping_buf_frames = frames;
- }else if(stream->remapping_buf_frames < frames){
- stream->remapping_buf = HeapReAlloc(GetProcessHeap(), 0, stream->remapping_buf,
- bytes_per_sample * stream->alsa_channels * frames);
- stream->remapping_buf_frames = frames;
- }
-
- snd_pcm_format_set_silence(stream->alsa_format, stream->remapping_buf,
- frames * stream->alsa_channels);
-
- switch(stream->fmt->wBitsPerSample){
- case 8: {
- UINT8 *tgt_buf, *src_buf;
- tgt_buf = stream->remapping_buf;
- src_buf = buf;
- for(i = 0; i < frames; ++i){
- for(c = 0; c < stream->fmt->nChannels; ++c)
- tgt_buf[stream->alsa_channel_map[c]] = src_buf[c];
- tgt_buf += stream->alsa_channels;
- src_buf += stream->fmt->nChannels;
- }
- break;
- }
- case 16: {
- UINT16 *tgt_buf, *src_buf;
- tgt_buf = (UINT16*)stream->remapping_buf;
- src_buf = (UINT16*)buf;
- for(i = 0; i < frames; ++i){
- for(c = 0; c < stream->fmt->nChannels; ++c)
- tgt_buf[stream->alsa_channel_map[c]] = src_buf[c];
- tgt_buf += stream->alsa_channels;
- src_buf += stream->fmt->nChannels;
- }
- }
- break;
- case 32: {
- UINT32 *tgt_buf, *src_buf;
- tgt_buf = (UINT32*)stream->remapping_buf;
- src_buf = (UINT32*)buf;
- for(i = 0; i < frames; ++i){
- for(c = 0; c < stream->fmt->nChannels; ++c)
- tgt_buf[stream->alsa_channel_map[c]] = src_buf[c];
- tgt_buf += stream->alsa_channels;
- src_buf += stream->fmt->nChannels;
- }
- }
- break;
- default: {
- BYTE *tgt_buf, *src_buf;
- tgt_buf = stream->remapping_buf;
- src_buf = buf;
- for(i = 0; i < frames; ++i){
- for(c = 0; c < stream->fmt->nChannels; ++c)
- memcpy(&tgt_buf[stream->alsa_channel_map[c] * bytes_per_sample],
- &src_buf[c * bytes_per_sample], bytes_per_sample);
- tgt_buf += stream->alsa_channels * bytes_per_sample;
- src_buf += stream->fmt->nChannels * bytes_per_sample;
- }
- }
- break;
- }
-
- return stream->remapping_buf;
-}
-
-static void adjust_buffer_volume(const struct alsa_stream *stream, BYTE *buf, snd_pcm_uframes_t frames)
-{
- BOOL adjust = FALSE;
- UINT32 i, channels, mute = 0;
- BYTE *end;
-
- if (stream->vol_adjusted_frames >= frames)
- return;
- channels = stream->fmt->nChannels;
-
- /* Adjust the buffer based on the volume for each channel */
- for (i = 0; i < channels; i++)
- {
- adjust |= stream->vols[i] != 1.0f;
- if (stream->vols[i] == 0.0f)
- mute++;
- }
-
- if (mute == channels)
- {
- int err = snd_pcm_format_set_silence(stream->alsa_format, buf, frames * channels);
- if (err < 0)
- WARN("Setting buffer to silence failed: %d (%s)\n", err, snd_strerror(err));
- return;
- }
- if (!adjust) return;
-
- /* Skip the frames we've already adjusted before */
- end = buf + frames * stream->fmt->nBlockAlign;
- buf += stream->vol_adjusted_frames * stream->fmt->nBlockAlign;
-
- switch (stream->alsa_format)
- {
-#ifndef WORDS_BIGENDIAN
-#define PROCESS_BUFFER(type) do \
-{ \
- type *p = (type*)buf; \
- do \
- { \
- for (i = 0; i < channels; i++) \
- p[i] = p[i] * stream->vols[i]; \
- p += i; \
- } while ((BYTE*)p != end); \
-} while (0)
- case SND_PCM_FORMAT_S16_LE:
- PROCESS_BUFFER(INT16);
- break;
- case SND_PCM_FORMAT_S32_LE:
- PROCESS_BUFFER(INT32);
- break;
- case SND_PCM_FORMAT_FLOAT_LE:
- PROCESS_BUFFER(float);
- break;
- case SND_PCM_FORMAT_FLOAT64_LE:
- PROCESS_BUFFER(double);
- break;
-#undef PROCESS_BUFFER
- case SND_PCM_FORMAT_S20_3LE:
- case SND_PCM_FORMAT_S24_3LE:
- {
- /* Do it 12 bytes at a time until it is no longer possible */
- UINT32 *q = (UINT32*)buf, mask = ~0xff;
- BYTE *p;
-
- /* After we adjust the volume, we need to mask out low bits */
- if (stream->alsa_format == SND_PCM_FORMAT_S20_3LE)
- mask = ~0x0fff;
-
- i = 0;
- while (end - (BYTE*)q >= 12)
- {
- UINT32 v[4], k;
- v[0] = q[0] << 8;
- v[1] = q[1] << 16 | (q[0] >> 16 & ~0xff);
- v[2] = q[2] << 24 | (q[1] >> 8 & ~0xff);
- v[3] = q[2] & ~0xff;
- for (k = 0; k < 4; k++)
- {
- v[k] = (INT32)((INT32)v[k] * stream->vols[i]);
- v[k] &= mask;
- if (++i == channels) i = 0;
- }
- *q++ = v[0] >> 8 | v[1] << 16;
- *q++ = v[1] >> 16 | v[2] << 8;
- *q++ = v[2] >> 24 | v[3];
- }
- p = (BYTE*)q;
- while (p != end)
- {
- UINT32 v = (INT32)((INT32)(p[0] << 8 | p[1] << 16 | p[2] << 24) * stream->vols[i]);
- v &= mask;
- *p++ = v >> 8 & 0xff;
- *p++ = v >> 16 & 0xff;
- *p++ = v >> 24;
- if (++i == channels) i = 0;
- }
- break;
- }
-#endif
- case SND_PCM_FORMAT_U8:
- {
- UINT8 *p = (UINT8*)buf;
- do
- {
- for (i = 0; i < channels; i++)
- p[i] = (int)((p[i] - 128) * stream->vols[i]) + 128;
- p += i;
- } while ((BYTE*)p != end);
- break;
- }
- default:
- TRACE("Unhandled format %i, not adjusting volume.\n", stream->alsa_format);
- break;
- }
-}
-
static snd_pcm_sframes_t alsa_write_best_effort(struct alsa_stream *stream, BYTE *buf, snd_pcm_uframes_t frames)
{
+ struct write_best_effort_tmp_params params;
snd_pcm_sframes_t written;
- adjust_buffer_volume(stream, buf, frames);
-
- /* Mark the frames we've already adjusted */
- if (stream->vol_adjusted_frames < frames)
- stream->vol_adjusted_frames = frames;
-
- buf = remap_channels(stream, buf, frames);
-
- written = snd_pcm_writei(stream->pcm_handle, buf, frames);
- if(written < 0){
- int ret;
-
- if(written == -EAGAIN)
- /* buffer full */
- return 0;
-
- WARN("writei failed, recovering: %ld (%s)\n", written,
- snd_strerror(written));
-
- ret = snd_pcm_recover(stream->pcm_handle, written, 0);
- if(ret < 0){
- WARN("Could not recover: %d (%s)\n", ret, snd_strerror(ret));
- return ret;
- }
+ params.stream = stream;
+ params.buf = buf;
+ params.frames = frames;
+ params.written = &written;
- written = snd_pcm_writei(stream->pcm_handle, buf, frames);
- }
+ ALSA_CALL(write_best_effort_tmp, ¶ms);
- if (written > 0)
- stream->vol_adjusted_frames -= written;
return written;
}
diff --git a/dlls/winealsa.drv/unixlib.h b/dlls/winealsa.drv/unixlib.h
index 2484fca8c90..3fd6d2a73ee 100644
--- a/dlls/winealsa.drv/unixlib.h
+++ b/dlls/winealsa.drv/unixlib.h
@@ -129,6 +129,14 @@ struct get_current_padding_params
UINT32 *padding;
};
+struct write_best_effort_tmp_params
+{
+ struct alsa_stream *stream;
+ BYTE *buf;
+ snd_pcm_uframes_t frames;
+ snd_pcm_sframes_t *written;
+};
+
enum alsa_funcs
{
alsa_get_endpoint_ids,
@@ -139,6 +147,8 @@ enum alsa_funcs
alsa_get_buffer_size,
alsa_get_latency,
alsa_get_current_padding,
+
+ alsa_write_best_effort_tmp
};
extern unixlib_handle_t alsa_handle;
--
2.25.1
1
0
From: Eric Pouech <eric.pouech(a)gmail.com>
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
Supersedes 228131 and 228132.
dlls/dwrite/tests/Makefile.in | 1 -
dlls/dwrite/tests/analyzer.c | 196 ++--
dlls/dwrite/tests/font.c | 1885 ++++++++++++++++-----------------
dlls/dwrite/tests/layout.c | 1428 ++++++++++++-------------
4 files changed, 1753 insertions(+), 1757 deletions(-)
diff --git a/dlls/dwrite/tests/Makefile.in b/dlls/dwrite/tests/Makefile.in
index 3df59bf08b3..7fbf9e36c7e 100644
--- a/dlls/dwrite/tests/Makefile.in
+++ b/dlls/dwrite/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = dwrite.dll
IMPORTS = dwrite gdi32 user32
diff --git a/dlls/dwrite/tests/analyzer.c b/dlls/dwrite/tests/analyzer.c
index d1d44c94012..a712e677624 100644
--- a/dlls/dwrite/tests/analyzer.c
+++ b/dlls/dwrite/tests/analyzer.c
@@ -487,7 +487,7 @@ static IDWriteFontFace *create_fontface(void)
HRESULT hr;
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&logfont, 0, sizeof(logfont));
logfont.lfHeight = 12;
@@ -497,10 +497,10 @@ static IDWriteFontFace *create_fontface(void)
lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
IDWriteGdiInterop_Release(interop);
@@ -520,7 +520,7 @@ static WCHAR *create_testfontfile(const WCHAR *filename)
lstrcatW(pathW, filename);
file = CreateFileW(pathW, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
- ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", wine_dbgstr_w(pathW),
+ ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n", wine_dbgstr_w(pathW),
GetLastError());
res = FindResourceA(GetModuleHandleA(NULL), (LPCSTR)MAKEINTRESOURCE(1), (LPCSTR)RT_RCDATA);
@@ -537,7 +537,7 @@ static WCHAR *create_testfontfile(const WCHAR *filename)
static void _delete_testfontfile(const WCHAR *filename, int line)
{
BOOL ret = DeleteFileW(filename);
- ok_(__FILE__,line)(ret, "failed to delete file %s, error %d\n", wine_dbgstr_w(filename), GetLastError());
+ ok_(__FILE__,line)(ret, "failed to delete file %s, error %ld\n", wine_dbgstr_w(filename), GetLastError());
}
static IDWriteFontFace *create_testfontface(const WCHAR *filename)
@@ -547,11 +547,11 @@ static IDWriteFontFace *create_testfontface(const WCHAR *filename)
HRESULT hr;
hr = IDWriteFactory_CreateFontFileReference(factory, filename, NULL, &file);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0,
DWRITE_FONT_SIMULATIONS_NONE, &face);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(file);
return face;
@@ -1041,11 +1041,11 @@ static void get_script_analysis(const WCHAR *str, DWRITE_SCRIPT_ANALYSIS *sa)
init_textsource(&analysissource, str, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT);
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_AnalyzeScript(analyzer, &analysissource.IDWriteTextAnalysisSource_iface, 0,
lstrlenW(analysissource.text), &analysissink2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
*sa = g_sa;
}
@@ -1057,7 +1057,7 @@ static void test_AnalyzeScript(void)
HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (*ptr->string)
{
@@ -1066,7 +1066,7 @@ static void test_AnalyzeScript(void)
init_expected_sa(expected_seq, ptr);
hr = IDWriteTextAnalyzer_AnalyzeScript(analyzer, &analysissource.IDWriteTextAnalysisSource_iface, 0,
lstrlenW(ptr->string), &analysissink);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, ANALYZER_ID, expected_seq[0]->sequence, wine_dbgstr_w(ptr->string), FALSE);
ptr++;
}
@@ -1169,12 +1169,12 @@ static void test_AnalyzeLineBreakpoints(void)
HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
init_textsource(&analysissource, L"", DWRITE_READING_DIRECTION_LEFT_TO_RIGHT);
hr = IDWriteTextAnalyzer_AnalyzeLineBreakpoints(analyzer, &analysissource.IDWriteTextAnalysisSource_iface, 0, 0,
&analysissink);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (*ptr->text)
{
@@ -1193,7 +1193,7 @@ static void test_AnalyzeLineBreakpoints(void)
memset(g_actual_bp, 0, sizeof(g_actual_bp));
hr = IDWriteTextAnalyzer_AnalyzeLineBreakpoints(analyzer, &analysissource.IDWriteTextAnalysisSource_iface,
0, len, &analysissink);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
compare_breakpoints(ptr, g_actual_bp);
i++;
@@ -1212,7 +1212,7 @@ static void test_GetScriptProperties(void)
HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_QueryInterface(analyzer, &IID_IDWriteTextAnalyzer1, (void**)&analyzer1);
IDWriteTextAnalyzer_Release(analyzer);
@@ -1223,14 +1223,14 @@ static void test_GetScriptProperties(void)
sa.script = 1000;
hr = IDWriteTextAnalyzer1_GetScriptProperties(analyzer1, sa, &props);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
if (0) /* crashes on native */
hr = IDWriteTextAnalyzer1_GetScriptProperties(analyzer1, sa, NULL);
sa.script = 0;
hr = IDWriteTextAnalyzer1_GetScriptProperties(analyzer1, sa, &props);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextAnalyzer1_Release(analyzer1);
}
@@ -1277,7 +1277,7 @@ static void test_GetTextComplexity(void)
int i;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_QueryInterface(analyzer, &IID_IDWriteTextAnalyzer1, (void**)&analyzer1);
IDWriteTextAnalyzer_Release(analyzer);
@@ -1297,7 +1297,7 @@ if (0) { /* crashes on native */
len = 1;
simple = TRUE;
hr = IDWriteTextAnalyzer1_GetTextComplexity(analyzer1, NULL, 0, NULL, &simple, &len, NULL);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(len == 0, "got %d\n", len);
ok(simple == FALSE, "got %d\n", simple);
@@ -1305,7 +1305,7 @@ if (0) { /* crashes on native */
simple = TRUE;
indices[0] = 1;
hr = IDWriteTextAnalyzer1_GetTextComplexity(analyzer1, L"ABC", 3, NULL, &simple, &len, NULL);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(len == 0, "got %d\n", len);
ok(simple == FALSE, "got %d\n", simple);
ok(indices[0] == 1, "got %d\n", indices[0]);
@@ -1318,7 +1318,7 @@ if (0) { /* crashes on native */
simple = !ptr->simple;
indices[0] = 0;
hr = IDWriteTextAnalyzer1_GetTextComplexity(analyzer1, ptr->text, ptr->length, fontface, &simple, &len, indices);
- ok(hr == S_OK, "%d: got 0x%08x\n", i, hr);
+ ok(hr == S_OK, "%d: Unexpected hr %#lx.\n", i, hr);
ok(len == ptr->len_read, "%d: read length: got %d, expected %d\n", i, len, ptr->len_read);
ok(simple == ptr->simple, "%d: simple: got %d, expected %d\n", i, simple, ptr->simple);
if (simple && ptr->length)
@@ -1338,43 +1338,43 @@ static void test_numbersubstitution(void)
/* locale is not specified, method does not require it */
hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE, NULL, FALSE, &substitution);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteNumberSubstitution_Release(substitution);
/* invalid locale name, method does not require it */
hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE, L"dummy",
FALSE, &substitution);
- ok(hr == S_OK, "Failed to create number substitution, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create number substitution, hr %#lx.\n", hr);
IDWriteNumberSubstitution_Release(substitution);
/* invalid method */
hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL+1, NULL, FALSE, &substitution);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* invalid method */
hr = IDWriteFactory_CreateNumberSubstitution(factory, -1, NULL, FALSE, &substitution);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* invalid locale */
hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL, NULL, FALSE, &substitution);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL, L"dummy",
FALSE, &substitution);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL, L"dummy",
FALSE, &substitution);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL, L"dummy",
FALSE, &substitution);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* invalid locale, but it's not needed for this method */
hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE, L"dummy", FALSE,
&substitution);
- ok(hr == S_OK, "Failed to create number substitution, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create number substitution, hr %#lx.\n", hr);
IDWriteNumberSubstitution_Release(substitution);
}
@@ -1385,7 +1385,7 @@ static void get_fontface_glyphs(IDWriteFontFace *fontface, const WCHAR *str, UIN
HRESULT hr;
hr = IDWriteFontFace_GetGlyphIndices(fontface, &codepoint, 1, glyphs++);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
str++;
}
}
@@ -1401,7 +1401,7 @@ static void get_fontface_advances(IDWriteFontFace *fontface, FLOAT emsize, const
HRESULT hr;
hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, glyphs + i, 1, &metrics, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
advances[i] = (FLOAT)metrics.advanceWidth * emsize / (FLOAT)fontmetrics.designUnitsPerEm;
}
@@ -1504,14 +1504,14 @@ static void get_enus_string(IDWriteLocalizedStrings *strings, WCHAR *buff, unsig
HRESULT hr;
hr = IDWriteLocalizedStrings_FindLocaleName(strings, L"en-us", &index, &exists);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Not all fonts have an en-us name! */
if (!exists)
index = 0;
hr = IDWriteLocalizedStrings_GetString(strings, index, buff, size);
- ok(hr == S_OK, "Failed to get name string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get name string, hr %#lx.\n", hr);
}
static void test_glyph_props(IDWriteTextAnalyzer *analyzer, const WCHAR *family, const WCHAR *face,
@@ -1526,7 +1526,7 @@ static void test_glyph_props(IDWriteTextAnalyzer *analyzer, const WCHAR *family,
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_GDEF_TAG, (const void **)&gdef.data, &gdef.size,
&gdef.context, &exists);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!exists)
return;
@@ -1545,12 +1545,12 @@ static void test_glyph_props(IDWriteTextAnalyzer *analyzer, const WCHAR *family,
}
hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 0, NULL, &count);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ranges = malloc(count * sizeof(*ranges));
hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, count, ranges, &count);
- ok(hr == S_OK, "Failed to get ranges, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get ranges, hr %#lx.\n", hr);
for (i = 0; i < count; ++i)
{
@@ -1567,7 +1567,7 @@ static void test_glyph_props(IDWriteTextAnalyzer *analyzer, const WCHAR *family,
WCHAR text[1];
hr = IDWriteFontFace1_GetGlyphIndices(fontface1, &ch, 1, &glyph);
- ok(hr == S_OK, "Failed to get glyph index, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get glyph index, hr %#lx.\n", hr);
if (!glyph)
continue;
@@ -1578,7 +1578,7 @@ static void test_glyph_props(IDWriteTextAnalyzer *analyzer, const WCHAR *family,
memset(glyph_props, 0, sizeof(glyph_props));
hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, text, 1, fontface, FALSE, FALSE, &sa, NULL,
NULL, NULL, NULL, 0, ARRAY_SIZE(glyphs), clustermap, text_props, glyphs, glyph_props, &actual_count);
- ok(hr == S_OK, "Failed to shape, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to shape, hr %#lx.\n", hr);
if (actual_count > 1)
continue;
@@ -1631,7 +1631,7 @@ static void test_GetGlyphs(void)
HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fontface = create_fontface();
@@ -1640,7 +1640,7 @@ static void test_GetGlyphs(void)
sa.shapes = DWRITE_SCRIPT_SHAPES_DEFAULT;
hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test1W, lstrlenW(test1W), fontface, FALSE, FALSE, &sa, NULL,
NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
if (0) {
/* NULL fontface - crashes on Windows */
@@ -1655,7 +1655,7 @@ if (0) {
sa.shapes = DWRITE_SCRIPT_SHAPES_DEFAULT;
hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test1W, lstrlenW(test1W), fontface, FALSE, FALSE, &sa, NULL,
NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(actual_count == 4, "got %d\n", actual_count);
ok(sa.script == 999, "got %u\n", sa.script);
@@ -1664,13 +1664,13 @@ if (0) {
actual_count = 0;
hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test1W, lstrlenW(test1W), fontface, FALSE, FALSE, &sa, NULL,
NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(actual_count == 4, "got %d\n", actual_count);
actual_count = 0;
hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test2W, lstrlenW(test2W), fontface, FALSE, FALSE, &sa, NULL,
NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs2, shapingprops, &actual_count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(actual_count == 4, "got %d\n", actual_count);
ok(glyphs1[2] != glyphs2[2], "got %d\n", glyphs1[2]);
@@ -1679,13 +1679,13 @@ if (0) {
actual_count = 0;
hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test1W, lstrlenW(test1W), fontface, FALSE, FALSE, &sa, NULL,
NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(actual_count == 4, "got %d\n", actual_count);
actual_count = 0;
hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test1W, lstrlenW(test1W), fontface, FALSE, TRUE, &sa, NULL,
NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs2, shapingprops, &actual_count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(actual_count == 4, "got %d\n", actual_count);
ok(glyphs1[0] != glyphs2[0], "got %d\n", glyphs1[0]);
@@ -1696,7 +1696,7 @@ if (0) {
actual_count = 0;
hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test3W, lstrlenW(test3W), fontface, FALSE, TRUE, &sa, NULL,
NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(actual_count == 2, "got %d\n", actual_count);
ok(glyphs1[0] == glyphs2[0], "got %u, expected %u\n", glyphs1[0], glyphs2[0]);
ok(glyphs1[1] == glyphs2[1], "got %u, expected %u\n", glyphs1[1], glyphs2[1]);
@@ -1711,7 +1711,7 @@ if (0) {
hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, test3W, clustermap, props, lstrlenW(test3W),
glyphs1, shapingprops, actual_count, fontface, 10.0, FALSE, FALSE, &sa, NULL, NULL,
NULL, 0, advances, offsets);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(advances[0] == advances2[0], "got %.2f, expected %.2f\n", advances[0], advances2[0]);
ok(advances[1] == advances2[1], "got %.2f, expected %.2f\n", advances[1], advances2[1]);
@@ -1722,7 +1722,7 @@ if (0) {
actual_count = 0;
hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test3W, lstrlenW(test3W), fontface, FALSE, FALSE, &sa, NULL,
NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(actual_count == 2, "got %d\n", actual_count);
ok(glyphs1[0] == glyphs2[0], "got %u, expected %u\n", glyphs1[0], glyphs2[0]);
ok(glyphs1[1] == glyphs2[1], "got %u, expected %u\n", glyphs1[1], glyphs2[1]);
@@ -1737,7 +1737,7 @@ if (0) {
hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, test3W, clustermap, props, lstrlenW(test3W),
glyphs1, shapingprops, actual_count, fontface, 10.0, FALSE, FALSE, &sa, NULL, NULL,
NULL, 0, advances, offsets);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(advances[0] == advances2[0], "got %.2f, expected %.2f\n", advances[0], advances2[0]);
ok(advances[1] == advances2[1], "got %.2f, expected %.2f\n", advances[1], advances2[1]);
@@ -1748,7 +1748,7 @@ if (0) {
sa.shapes = DWRITE_SCRIPT_SHAPES_NO_VISUAL;
hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test1W, lstrlenW(test1W), fontface, FALSE, FALSE, &sa, NULL,
NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(actual_count == 4, "got %d\n", actual_count);
ok(sa.script == 0, "got %u\n", sa.script);
ok(!shapingprops[0].isZeroWidthSpace, "got %d\n", shapingprops[0].isZeroWidthSpace);
@@ -1757,7 +1757,7 @@ if (0) {
/* Test setting glyph properties from GDEF. */
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscoll, FALSE);
- ok(hr == S_OK, "Failed to get system collection, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get system collection, hr %#lx.\n", hr);
for (i = 0; i < IDWriteFontCollection_GetFontFamilyCount(syscoll); ++i)
{
@@ -1766,10 +1766,10 @@ if (0) {
WCHAR familyW[256];
hr = IDWriteFontCollection_GetFontFamily(syscoll, i, &family);
- ok(hr == S_OK, "Failed to get font family, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font family, hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "Failed to get family names, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get family names, hr %#lx.\n", hr);
get_enus_string(names, familyW, ARRAY_SIZE(familyW));
IDWriteLocalizedStrings_Release(names);
@@ -1779,13 +1779,13 @@ if (0) {
WCHAR faceW[256];
hr = IDWriteFontFamily_GetFont(family, j, &font);
- ok(hr == S_OK, "Failed to get font instance, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font instance, hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &names);
- ok(hr == S_OK, "Failed to get face names, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get face names, hr %#lx.\n", hr);
get_enus_string(names, faceW, ARRAY_SIZE(faceW));
IDWriteLocalizedStrings_Release(names);
@@ -1815,7 +1815,7 @@ static void test_GetTypographicFeatures(void)
HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_QueryInterface(analyzer, &IID_IDWriteTextAnalyzer2, (void**)&analyzer2);
IDWriteTextAnalyzer_Release(analyzer);
@@ -1829,14 +1829,14 @@ static void test_GetTypographicFeatures(void)
get_script_analysis(L"abc", &sa);
count = 0;
hr = IDWriteTextAnalyzer2_GetTypographicFeatures(analyzer2, fontface, sa, NULL, 0, &count, NULL);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(!!count, "Unexpected count %u.\n", count);
/* invalid locale name is ignored */
get_script_analysis(L"abc", &sa);
count = 0;
hr = IDWriteTextAnalyzer2_GetTypographicFeatures(analyzer2, fontface, sa, L"cadabra", 0, &count, NULL);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(!!count, "Unexpected count %u.\n", count);
/* Make some calls for different scripts. */
@@ -1845,14 +1845,14 @@ static void test_GetTypographicFeatures(void)
memset(tags, 0, sizeof(tags));
count = 0;
hr = IDWriteTextAnalyzer2_GetTypographicFeatures(analyzer2, fontface, sa, NULL, ARRAY_SIZE(tags), &count, tags);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!count, "Unexpected count %u.\n", count);
get_script_analysis(L"abc", &sa);
memset(tags, 0, sizeof(tags));
count = 0;
hr = IDWriteTextAnalyzer2_GetTypographicFeatures(analyzer2, fontface, sa, NULL, ARRAY_SIZE(tags), &count, tags);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!count, "Unexpected count %u.\n", count);
IDWriteFontFace_Release(fontface);
@@ -1875,7 +1875,7 @@ static void test_GetGlyphPlacements(void)
HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
path = create_testfontfile(L"wine_test_font.ttf");
fontface = create_testfontface(path);
@@ -1885,7 +1885,7 @@ static void test_GetGlyphPlacements(void)
len = lstrlenW(aW);
hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, aW, len, fontface, FALSE, FALSE, &sa, NULL,
NULL, NULL, NULL, 0, len, clustermap, textprops, glyphs, glyphprops, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 2, "got %u\n", count);
/* just return on zero glyphs */
@@ -1894,7 +1894,7 @@ static void test_GetGlyphPlacements(void)
hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops,
len, glyphs, glyphprops, 0, fontface, 0.0, FALSE, FALSE, &sa, NULL, NULL,
NULL, 0, advances, offsets);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(advances[0] == 1.0, "got %.2f\n", advances[0]);
ok(offsets[0].advanceOffset == 2.0 && offsets[0].ascenderOffset == 2.0, "got %.2f,%.2f\n",
offsets[0].advanceOffset, offsets[0].ascenderOffset);
@@ -1905,7 +1905,7 @@ static void test_GetGlyphPlacements(void)
hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops,
len, glyphs, glyphprops, len, fontface, 0.0, FALSE, FALSE, &sa, NULL, NULL,
NULL, 0, advances, offsets);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(advances[0] == 0.0, "got %.2f\n", advances[0]);
ok(offsets[0].advanceOffset == 0.0 && offsets[0].ascenderOffset == 0.0, "got %.2f,%.2f\n",
offsets[0].advanceOffset, offsets[0].ascenderOffset);
@@ -1915,7 +1915,7 @@ static void test_GetGlyphPlacements(void)
hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops,
len, glyphs, glyphprops, len, fontface, 2048.0, FALSE, FALSE, &sa, NULL, NULL,
NULL, 0, advances, offsets);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(advances[0] == 1000.0, "got %.2f\n", advances[0]);
ok(offsets[0].advanceOffset == 0.0 && offsets[0].ascenderOffset == 0.0, "got %.2f,%.2f\n",
offsets[0].advanceOffset, offsets[0].ascenderOffset);
@@ -1925,7 +1925,7 @@ static void test_GetGlyphPlacements(void)
hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops,
len, glyphs, glyphprops, len, fontface, 1024.0, FALSE, FALSE, &sa, NULL, NULL,
NULL, 0, advances, offsets);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(advances[0] == 500.0, "got %.2f\n", advances[0]);
ok(advances[1] == 500.0, "got %.2f\n", advances[1]);
ok(offsets[0].advanceOffset == 0.0 && offsets[0].ascenderOffset == 0.0, "got %.2f,%.2f\n",
@@ -1936,7 +1936,7 @@ static void test_GetGlyphPlacements(void)
hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops,
len, glyphs, glyphprops, len, fontface, 20.48, FALSE, FALSE, &sa, NULL, NULL,
NULL, 0, advances, offsets);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(advances[0] == 10.0, "got %.2f\n", advances[0]);
ok(advances[1] == 10.0, "got %.2f\n", advances[1]);
ok(offsets[0].advanceOffset == 0.0 && offsets[0].ascenderOffset == 0.0, "got %.2f,%.2f\n",
@@ -1947,7 +1947,7 @@ static void test_GetGlyphPlacements(void)
hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, NULL, textprops,
len, glyphs, glyphprops, len, fontface, 1024.0, FALSE, FALSE, &sa, NULL, NULL,
NULL, 0, advances, offsets);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(advances[0] == 500.0, "got %.2f\n", advances[0]);
ok(advances[1] == 500.0, "got %.2f\n", advances[1]);
@@ -1957,7 +1957,7 @@ static void test_GetGlyphPlacements(void)
hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops,
len, glyphs, glyphprops, len, fontface, -10.24, FALSE, FALSE, &sa, NULL, NULL,
NULL, 0, advances, offsets);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(advances[0] == -5.0, "got %.2f\n", advances[0]);
ok(offsets[0].advanceOffset == 0.0 && offsets[0].ascenderOffset == 0.0, "got %.2f,%.2f\n",
offsets[0].advanceOffset, offsets[0].ascenderOffset);
@@ -1969,7 +1969,7 @@ static void test_GetGlyphPlacements(void)
hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops,
len, glyphs, glyphprops, len, fontface, 2048.0f, FALSE, FALSE, &sa, NULL, NULL,
NULL, 0, advances, offsets);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(advances[0] == 1000.0f, "got %.2f\n", advances[0]);
ok(advances[1] == 1000.0f, "got %.2f\n", advances[1]);
ok(offsets[0].advanceOffset == 0.0f && offsets[0].ascenderOffset == 0.0f, "got %.2f,%.2f\n",
@@ -1983,7 +1983,7 @@ static void test_GetGlyphPlacements(void)
hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops,
len, glyphs, glyphprops, len, fontface, 2048.0f, FALSE, FALSE, &sa, NULL, NULL,
NULL, 0, advances, offsets);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(advances[0] == 0.0f, "got %.2f\n", advances[0]);
ok(advances[1] == 1000.0f, "got %.2f\n", advances[1]);
ok(offsets[0].advanceOffset == 0.0f && offsets[0].ascenderOffset == 0.0f, "got %.2f,%.2f\n",
@@ -2160,7 +2160,7 @@ static void test_ApplyCharacterSpacing(void)
int i;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_QueryInterface(analyzer, &IID_IDWriteTextAnalyzer1, (void**)&analyzer1);
IDWriteTextAnalyzer_Release(analyzer);
@@ -2216,7 +2216,7 @@ static void test_ApplyCharacterSpacing(void)
props,
advances,
offsets);
- ok(hr == (ptr->min_advance < 0.0f ? E_INVALIDARG : S_OK), "Unexpected hr %#x.\n", hr);
+ ok(hr == (ptr->min_advance < 0.0f ? E_INVALIDARG : S_OK), "Unexpected hr %#lx.\n", hr);
if (hr == S_OK) {
ok(ptr->modified_advances[0] == advances[0], "Got advance[0] %.2f, expected %.2f.\n", advances[0], ptr->modified_advances[0]);
@@ -2270,7 +2270,7 @@ static void test_ApplyCharacterSpacing(void)
props,
advances,
offsets);
- ok(hr == (ptr->min_advance < 0.0f ? E_INVALIDARG : S_OK), "Unexpected hr %#x.\n", hr);
+ ok(hr == (ptr->min_advance < 0.0f ? E_INVALIDARG : S_OK), "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
{
@@ -2346,7 +2346,7 @@ static void test_GetGlyphOrientationTransform(void)
int i;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_QueryInterface(analyzer, &IID_IDWriteTextAnalyzer1, (void**)&analyzer1);
IDWriteTextAnalyzer_Release(analyzer);
@@ -2359,14 +2359,14 @@ static void test_GetGlyphOrientationTransform(void)
memset(&m, 0xcc, sizeof(m));
hr = IDWriteTextAnalyzer1_GetGlyphOrientationTransform(analyzer1,
DWRITE_GLYPH_ORIENTATION_ANGLE_270_DEGREES + 1, FALSE, &m);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(m.m11 == 0.0, "got %.2f\n", m.m11);
for (i = 0; i < ARRAY_SIZE(ot_tests); i++) {
memset(&m, 0, sizeof(m));
hr = IDWriteTextAnalyzer1_GetGlyphOrientationTransform(analyzer1, ot_tests[i].angle,
ot_tests[i].is_sideways, &m);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!memcmp(&ot_tests[i].m, &m, sizeof(m)), "%d: wrong matrix %s\n", i, dbgstr_matrix(&m));
}
@@ -2381,7 +2381,7 @@ static void test_GetGlyphOrientationTransform(void)
memset(&m, 0xcc, sizeof(m));
hr = IDWriteTextAnalyzer2_GetGlyphOrientationTransform(analyzer2,
DWRITE_GLYPH_ORIENTATION_ANGLE_270_DEGREES + 1, FALSE, 0.0, 0.0, &m);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(m.m11 == 0.0, "got %.2f\n", m.m11);
originx = 50.0;
@@ -2395,13 +2395,13 @@ static void test_GetGlyphOrientationTransform(void)
/* zero offset gives same result as a call from IDWriteTextAnalyzer1 */
hr = IDWriteTextAnalyzer2_GetGlyphOrientationTransform(analyzer2, ot_tests[i].angle,
ot_tests[i].is_sideways, 0.0, 0.0, &m);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!memcmp(&ot_tests[i].m, &m, sizeof(m)), "%d: wrong matrix %s\n", i, dbgstr_matrix(&m));
m_exp = ot_tests[i].m;
hr = IDWriteTextAnalyzer2_GetGlyphOrientationTransform(analyzer2, ot_tests[i].angle,
ot_tests[i].is_sideways, originx, originy, &m);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* 90 degrees more for sideways */
if (ot_tests[i].is_sideways) {
@@ -2464,7 +2464,7 @@ static void test_GetBaseline(void)
HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_QueryInterface(analyzer, &IID_IDWriteTextAnalyzer1, (void**)&analyzer1);
IDWriteTextAnalyzer_Release(analyzer);
@@ -2481,7 +2481,7 @@ static void test_GetBaseline(void)
baseline = 456;
hr = IDWriteTextAnalyzer1_GetBaseline(analyzer1, fontface, DWRITE_BASELINE_DEFAULT, FALSE,
TRUE, sa, NULL, &baseline, &exists);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!baseline, "Unexpected baseline %d.\n", baseline);
ok(!exists, "Unexpected flag %d.\n", exists);
@@ -2489,7 +2489,7 @@ static void test_GetBaseline(void)
baseline = 456;
hr = IDWriteTextAnalyzer1_GetBaseline(analyzer1, fontface, DWRITE_BASELINE_DEFAULT, FALSE,
FALSE, sa, NULL, &baseline, &exists);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!baseline, "Unexpected baseline %d.\n", baseline);
ok(!exists, "Unexpected flag %d.\n", exists);
@@ -2497,7 +2497,7 @@ static void test_GetBaseline(void)
baseline = 0;
hr = IDWriteTextAnalyzer1_GetBaseline(analyzer1, fontface, DWRITE_BASELINE_CENTRAL, FALSE,
TRUE, sa, NULL, &baseline, &exists);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(baseline != 0, "Unexpected baseline %d.\n", baseline);
ok(!exists, "Unexpected flag %d.\n", exists);
@@ -2505,7 +2505,7 @@ static void test_GetBaseline(void)
baseline = 0;
hr = IDWriteTextAnalyzer1_GetBaseline(analyzer1, fontface, DWRITE_BASELINE_CENTRAL, FALSE,
FALSE, sa, NULL, &baseline, &exists);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!baseline, "Unexpected baseline %d.\n", baseline);
ok(!exists, "Unexpected flag %d.\n", exists);
@@ -2513,7 +2513,7 @@ static void test_GetBaseline(void)
baseline = 456;
hr = IDWriteTextAnalyzer1_GetBaseline(analyzer1, fontface, DWRITE_BASELINE_DEFAULT + 100, FALSE,
TRUE, sa, NULL, &baseline, &exists);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!baseline, "Unexpected baseline %d.\n", baseline);
ok(!exists, "Unexpected flag %d.\n", exists);
@@ -2551,7 +2551,7 @@ static void test_GetGdiCompatibleGlyphPlacements(void)
float emsize;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fontface = create_fontface();
@@ -2560,7 +2560,7 @@ static void test_GetGdiCompatibleGlyphPlacements(void)
count = 0;
hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, L"A", 1, fontface, FALSE, FALSE, &sa, NULL, NULL, NULL, NULL, 0, 1,
clustermap, textprops, glyphs, glyphprops, &count);
- ok(hr == S_OK, "Failed to get glyphs, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get glyphs, hr %#lx.\n", hr);
ok(count == 1, "got %u\n", count);
for (emsize = 12.0f; emsize <= 20.0f; emsize += 1.0f)
@@ -2570,20 +2570,20 @@ static void test_GetGdiCompatibleGlyphPlacements(void)
hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, L"A", clustermap, textprops, 1, glyphs, glyphprops,
count, fontface, emsize, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, &advance, offsets);
- ok(hr == S_OK, "Failed to get glyph placements, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get glyph placements, hr %#lx.\n", hr);
ok(advance > 0.0f, "Unexpected advance %f.\n", advance);
/* 1 ppdip, no transform */
ppdip = 1.0;
hr = IDWriteFontFace_GetGdiCompatibleGlyphMetrics(fontface, emsize, ppdip, NULL, FALSE,
glyphs, 1, &metrics, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
expected = floorf(metrics.advanceWidth * emsize * ppdip / fontmetrics.designUnitsPerEm + 0.5f) / ppdip;
hr = IDWriteTextAnalyzer_GetGdiCompatibleGlyphPlacements(analyzer, L"A", clustermap, textprops, 1, glyphs,
glyphprops, count, fontface, emsize, ppdip, NULL, FALSE, FALSE, FALSE, &sa, NULL, NULL, NULL, 0,
&compatadvance, offsets);
- ok(hr == S_OK, "Failed to get glyph placements, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get glyph placements, hr %#lx.\n", hr);
ok(compatadvance == expected, "%.0f: got advance %f, expected %f, natural %f\n", emsize,
compatadvance, expected, advance);
@@ -2591,13 +2591,13 @@ static void test_GetGdiCompatibleGlyphPlacements(void)
ppdip = 1.2f;
hr = IDWriteFontFace_GetGdiCompatibleGlyphMetrics(fontface, emsize, ppdip, NULL, FALSE,
glyphs, 1, &metrics, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
expected = floorf(metrics.advanceWidth * emsize * ppdip / fontmetrics.designUnitsPerEm + 0.5f) / ppdip;
hr = IDWriteTextAnalyzer_GetGdiCompatibleGlyphPlacements(analyzer, L"A", clustermap, textprops, 1, glyphs,
glyphprops, count, fontface, emsize, ppdip, NULL, FALSE, FALSE, FALSE, &sa, NULL, NULL, NULL, 0,
&compatadvance, offsets);
- ok(hr == S_OK, "Failed to get glyph placements, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get glyph placements, hr %#lx.\n", hr);
ok(float_eq(compatadvance, expected), "%.0f: got advance %f, expected %f, natural %f\n", emsize,
compatadvance, expected, advance);
}
@@ -2783,7 +2783,7 @@ static void test_AnalyzeBidi(void)
HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (*ptr->text)
{
@@ -2803,7 +2803,7 @@ static void test_AnalyzeBidi(void)
memset(g_resolved_levels, 0, sizeof(g_resolved_levels));
hr = IDWriteTextAnalyzer_AnalyzeBidi(analyzer, &analysissource.IDWriteTextAnalysisSource_iface, 0,
len, &analysissink);
- ok(hr == S_OK, "%u: got 0x%08x\n", i, hr);
+ ok(hr == S_OK, "%u: unexpected hr %#lx.\n", i, hr);
compare_bidi_levels(i, ptr, len, g_explicit_levels, g_resolved_levels);
i++;
@@ -2818,7 +2818,7 @@ START_TEST(analyzer)
HRESULT hr;
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_ISOLATED, &IID_IDWriteFactory, (IUnknown**)&factory);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (hr != S_OK)
{
win_skip("failed to create factory\n");
diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c
index bb70c6f2320..34f38fcc170 100644
--- a/dlls/dwrite/tests/font.c
+++ b/dlls/dwrite/tests/font.c
@@ -71,9 +71,6 @@
#define GET_LE_DWORD(x) (x)
#endif
-#define EXPECT_HR(hr,hr_exp) \
- ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
-
#define DEFINE_EXPECT(func) \
static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
@@ -109,7 +106,7 @@ static void _expect_ref(IUnknown* obj, ULONG ref, int line)
ULONG rc;
IUnknown_AddRef(obj);
rc = IUnknown_Release(obj);
- ok_(__FILE__,line)(rc == ref, "expected refcount %d, got %d\n", ref, rc);
+ ok_(__FILE__,line)(rc == ref, "expected refcount %ld, got %ld\n", ref, rc);
}
#define EXPECT_REF_BROKEN(obj,ref,brokenref) _expect_ref_broken((IUnknown*)obj, ref, brokenref, __LINE__)
@@ -118,7 +115,7 @@ static void _expect_ref_broken(IUnknown* obj, ULONG ref, ULONG brokenref, int li
ULONG rc;
IUnknown_AddRef(obj);
rc = IUnknown_Release(obj);
- ok_(__FILE__,line)(rc == ref || broken(rc == brokenref), "expected refcount %d, got %d\n", ref, rc);
+ ok_(__FILE__,line)(rc == ref || broken(rc == brokenref), "expected refcount %ld, got %ld\n", ref, rc);
}
static BOOL (WINAPI *pGetFontRealizationInfo)(HDC hdc, void *);
@@ -475,7 +472,7 @@ static IDWriteFontFace *create_fontface(IDWriteFactory *factory)
HRESULT hr;
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&logfont, 0, sizeof(logfont));
logfont.lfHeight = 12;
@@ -485,10 +482,10 @@ static IDWriteFontFace *create_fontface(IDWriteFactory *factory)
lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
IDWriteGdiInterop_Release(interop);
@@ -506,20 +503,20 @@ static IDWriteFont *get_font(IDWriteFactory *factory, const WCHAR *name, DWRITE_
HRESULT hr;
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
index = ~0;
exists = FALSE;
hr = IDWriteFontCollection_FindFamilyName(collection, name, &index, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!exists) goto not_found;
hr = IDWriteFontCollection_GetFontFamily(collection, index, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, style, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFamily_Release(family);
not_found:
@@ -546,7 +543,7 @@ static WCHAR *create_testfontfile(const WCHAR *filename)
lstrcatW(pathW, filename);
file = CreateFileW(pathW, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
- ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", wine_dbgstr_w(pathW),
+ ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n", wine_dbgstr_w(pathW),
GetLastError());
res = FindResourceA(GetModuleHandleA(NULL), (LPCSTR)MAKEINTRESOURCE(1), (LPCSTR)RT_RCDATA);
@@ -563,7 +560,7 @@ static WCHAR *create_testfontfile(const WCHAR *filename)
static void _delete_testfontfile(const WCHAR *filename, int line)
{
BOOL ret = DeleteFileW(filename);
- ok_(__FILE__,line)(ret, "failed to delete file %s, error %d\n", wine_dbgstr_w(filename), GetLastError());
+ ok_(__FILE__,line)(ret, "failed to delete file %s, error %ld\n", wine_dbgstr_w(filename), GetLastError());
}
static void get_combined_font_name(const WCHAR *familyW, const WCHAR *faceW, WCHAR *nameW)
@@ -731,10 +728,10 @@ static HRESULT WINAPI resourcecollectionloader_CreateEnumeratorFromKey(IDWriteFo
HRESULT hr;
hr = IDWriteFactory_CreateCustomFontFileReference(factory, collectionKey, collectionKeySize, This->loader, &font_file);
- ok(hr == S_OK, "Failed to create custom file reference, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create custom file reference, hr %#lx.\n", hr);
hr = create_enumerator(font_file, fontFileEnumerator);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(font_file);
return hr;
@@ -1057,7 +1054,7 @@ static void test_CreateFontFromLOGFONT(void)
factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
if (0)
/* null out parameter crashes this call */
@@ -1065,7 +1062,7 @@ static void test_CreateFontFromLOGFONT(void)
font = (void*)0xdeadbeef;
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, NULL, &font);
- EXPECT_HR(hr, E_INVALIDARG);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(font == NULL, "got %p\n", font);
memset(&logfont, 0, sizeof(logfont));
@@ -1076,7 +1073,7 @@ static void test_CreateFontFromLOGFONT(void)
lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font);
- EXPECT_HR(hr, S_OK);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
hfont = CreateFontIndirectW(&logfont);
hdc = CreateCompatibleDC(0);
@@ -1090,12 +1087,12 @@ static void test_CreateFontFromLOGFONT(void)
exists = TRUE;
hr = IDWriteFont_HasCharacter(font, 0xd800, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(exists == FALSE, "got %d\n", exists);
exists = FALSE;
hr = IDWriteFont_HasCharacter(font, 0x20, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(exists == TRUE, "got %d\n", exists);
/* now check properties */
@@ -1121,11 +1118,11 @@ static void test_CreateFontFromLOGFONT(void)
lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font);
- EXPECT_HR(hr, S_OK);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
weight = IDWriteFont_GetWeight(font);
ok(weight == weights[i][1],
- "%d: got %d, expected %d\n", i, weight, weights[i][1]);
+ "%d: got %d, expected %ld\n", i, weight, weights[i][1]);
IDWriteFont_Release(font);
}
@@ -1139,7 +1136,7 @@ static void test_CreateFontFromLOGFONT(void)
font = NULL;
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
weight = IDWriteFont_GetWeight(font);
ok(weight == DWRITE_FONT_WEIGHT_NORMAL || weight == DWRITE_FONT_WEIGHT_BOLD,
@@ -1156,7 +1153,7 @@ static void test_CreateFontFromLOGFONT(void)
font = (void*)0xdeadbeef;
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font);
- ok(hr == DWRITE_E_NOFONT, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_NOFONT, "Unexpected hr %#lx.\n", hr);
ok(font == NULL, "got %p\n", font);
/* Try with name 'Tahoma ' */
@@ -1168,7 +1165,7 @@ static void test_CreateFontFromLOGFONT(void)
font = (void*)0xdeadbeef;
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font);
- ok(hr == DWRITE_E_NOFONT, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_NOFONT, "Unexpected hr %#lx.\n", hr);
ok(font == NULL, "got %p\n", font);
/* empty string as a facename */
@@ -1179,7 +1176,7 @@ static void test_CreateFontFromLOGFONT(void)
font = (void*)0xdeadbeef;
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font);
- ok(hr == DWRITE_E_NOFONT, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_NOFONT, "Unexpected hr %#lx.\n", hr);
ok(font == NULL, "got %p\n", font);
/* IDWriteGdiInterop1::CreateFontFromLOGFONT() */
@@ -1193,7 +1190,7 @@ static void test_CreateFontFromLOGFONT(void)
lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop1_CreateFontFromLOGFONT(interop1, &logfont, NULL, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
IDWriteGdiInterop1_Release(interop1);
@@ -1202,9 +1199,9 @@ static void test_CreateFontFromLOGFONT(void)
win_skip("IDWriteGdiInterop1 is not supported, skipping CreateFontFromLOGFONT() tests.\n");
ref = IDWriteGdiInterop_Release(interop);
- ok(ref == 0, "interop is not released, %u\n", ref);
+ ok(ref == 0, "interop is not released, %lu\n", ref);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory is not released, %u\n", ref);
+ ok(ref == 0, "factory is not released, %lu\n", ref);
}
static void test_CreateBitmapRenderTarget(void)
@@ -1233,24 +1230,24 @@ static void test_CreateBitmapRenderTarget(void)
factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- EXPECT_HR(hr, S_OK);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
target = NULL;
hr = IDWriteGdiInterop_CreateBitmapRenderTarget(interop, NULL, 0, 0, &target);
- EXPECT_HR(hr, S_OK);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
if (0) /* crashes on native */
hr = IDWriteBitmapRenderTarget_GetSize(target, NULL);
size.cx = size.cy = -1;
hr = IDWriteBitmapRenderTarget_GetSize(target, &size);
- EXPECT_HR(hr, S_OK);
- ok(size.cx == 0, "got %d\n", size.cx);
- ok(size.cy == 0, "got %d\n", size.cy);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
+ ok(size.cx == 0, "got %ld\n", size.cx);
+ ok(size.cy == 0, "got %ld\n", size.cy);
target2 = NULL;
hr = IDWriteGdiInterop_CreateBitmapRenderTarget(interop, NULL, 0, 0, &target2);
- EXPECT_HR(hr, S_OK);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
ok(target != target2, "got %p, %p\n", target2, target);
IDWriteBitmapRenderTarget_Release(target2);
@@ -1280,18 +1277,18 @@ static void test_CreateBitmapRenderTarget(void)
target = NULL;
hr = IDWriteGdiInterop_CreateBitmapRenderTarget(interop, NULL, 10, 5, &target);
- EXPECT_HR(hr, S_OK);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
hdc = IDWriteBitmapRenderTarget_GetMemoryDC(target);
ok(hdc != NULL, "got %p\n", hdc);
/* test context settings */
c = GetTextColor(hdc);
- ok(c == RGB(0, 0, 0), "got 0x%08x\n", c);
+ ok(c == RGB(0, 0, 0), "got 0x%08lx\n", c);
ret = GetBkMode(hdc);
ok(ret == OPAQUE, "got %d\n", ret);
c = GetBkColor(hdc);
- ok(c == RGB(255, 255, 255), "got 0x%08x\n", c);
+ ok(c == RGB(255, 255, 255), "got 0x%08lx\n", c);
hbm = GetCurrentObject(hdc, OBJ_BITMAP);
ok(hbm != NULL, "got %p\n", hbm);
@@ -1307,50 +1304,50 @@ static void test_CreateBitmapRenderTarget(void)
size.cx = size.cy = -1;
hr = IDWriteBitmapRenderTarget_GetSize(target, &size);
- EXPECT_HR(hr, S_OK);
- ok(size.cx == 10, "got %d\n", size.cx);
- ok(size.cy == 5, "got %d\n", size.cy);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
+ ok(size.cx == 10, "got %ld\n", size.cx);
+ ok(size.cy == 5, "got %ld\n", size.cy);
/* resize to same size */
hr = IDWriteBitmapRenderTarget_Resize(target, 10, 5);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hbm2 = GetCurrentObject(hdc, OBJ_BITMAP);
ok(hbm2 == hbm, "got %p, %p\n", hbm2, hbm);
/* shrink */
hr = IDWriteBitmapRenderTarget_Resize(target, 5, 5);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size.cx = size.cy = -1;
hr = IDWriteBitmapRenderTarget_GetSize(target, &size);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(size.cx == 5, "got %d\n", size.cx);
- ok(size.cy == 5, "got %d\n", size.cy);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(size.cx == 5, "got %ld\n", size.cx);
+ ok(size.cy == 5, "got %ld\n", size.cy);
hbm2 = GetCurrentObject(hdc, OBJ_BITMAP);
ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm);
hr = IDWriteBitmapRenderTarget_Resize(target, 20, 5);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size.cx = size.cy = -1;
hr = IDWriteBitmapRenderTarget_GetSize(target, &size);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(size.cx == 20, "got %d\n", size.cx);
- ok(size.cy == 5, "got %d\n", size.cy);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(size.cx == 20, "got %ld\n", size.cx);
+ ok(size.cy == 5, "got %ld\n", size.cy);
hbm2 = GetCurrentObject(hdc, OBJ_BITMAP);
ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm);
hr = IDWriteBitmapRenderTarget_Resize(target, 1, 5);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size.cx = size.cy = -1;
hr = IDWriteBitmapRenderTarget_GetSize(target, &size);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(size.cx == 1, "got %d\n", size.cx);
- ok(size.cy == 5, "got %d\n", size.cy);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(size.cx == 1, "got %ld\n", size.cx);
+ ok(size.cy == 5, "got %ld\n", size.cy);
hbm2 = GetCurrentObject(hdc, OBJ_BITMAP);
ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm);
@@ -1365,13 +1362,13 @@ static void test_CreateBitmapRenderTarget(void)
/* empty rectangle */
hr = IDWriteBitmapRenderTarget_Resize(target, 0, 5);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size.cx = size.cy = -1;
hr = IDWriteBitmapRenderTarget_GetSize(target, &size);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(size.cx == 0, "got %d\n", size.cx);
- ok(size.cy == 5, "got %d\n", size.cy);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(size.cx == 0, "got %ld\n", size.cx);
+ ok(size.cy == 5, "got %ld\n", size.cy);
hbm2 = GetCurrentObject(hdc, OBJ_BITMAP);
ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm);
@@ -1390,7 +1387,7 @@ static void test_CreateBitmapRenderTarget(void)
memset(&m, 0xcc, sizeof(m));
hr = IDWriteBitmapRenderTarget_GetCurrentTransform(target, &m);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(m.m11 == 1.0 && m.m22 == 1.0 && m.m12 == 0.0 && m.m21 == 0.0, "got %.1f,%.1f,%.1f,%.1f\n", m.m11, m.m22, m.m12, m.m21);
ok(m.dx == 0.0 && m.dy == 0.0, "got %.1f,%.1f\n", m.dx, m.dy);
ret = GetWorldTransform(hdc, &xform);
@@ -1400,11 +1397,11 @@ static void test_CreateBitmapRenderTarget(void)
memset(&m, 0, sizeof(m));
hr = IDWriteBitmapRenderTarget_SetCurrentTransform(target, &m);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&m, 0xcc, sizeof(m));
hr = IDWriteBitmapRenderTarget_GetCurrentTransform(target, &m);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(m.m11 == 0.0 && m.m22 == 0.0 && m.m12 == 0.0 && m.m21 == 0.0, "got %.1f,%.1f,%.1f,%.1f\n", m.m11, m.m22, m.m12, m.m21);
ok(m.dx == 0.0 && m.dy == 0.0, "got %.1f,%.1f\n", m.dx, m.dy);
ret = GetWorldTransform(hdc, &xform);
@@ -1415,18 +1412,18 @@ static void test_CreateBitmapRenderTarget(void)
memset(&m, 0, sizeof(m));
m.m11 = 2.0; m.m22 = 1.0;
hr = IDWriteBitmapRenderTarget_SetCurrentTransform(target, &m);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ret = GetWorldTransform(hdc, &xform);
ok(ret, "got %d\n", ret);
ok(xform.eM11 == 1.0 && xform.eM22 == 1.0 && xform.eM12 == 0.0 && xform.eM21 == 0.0, "got wrong transform\n");
ok(xform.eDx == 0.0 && xform.eDy == 0.0, "got %.1f,%.1f\n", xform.eDx, xform.eDy);
hr = IDWriteBitmapRenderTarget_SetCurrentTransform(target, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&m, 0xcc, sizeof(m));
hr = IDWriteBitmapRenderTarget_GetCurrentTransform(target, &m);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(m.m11 == 1.0 && m.m22 == 1.0 && m.m12 == 0.0 && m.m21 == 0.0, "got %.1f,%.1f,%.1f,%.1f\n", m.m11, m.m22, m.m12, m.m21);
ok(m.dx == 0.0 && m.dy == 0.0, "got %.1f,%.1f\n", m.dx, m.dy);
@@ -1435,13 +1432,13 @@ static void test_CreateBitmapRenderTarget(void)
ok(pdip == 1.0, "got %.2f\n", pdip);
hr = IDWriteBitmapRenderTarget_SetPixelsPerDip(target, 2.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_SetPixelsPerDip(target, -1.0);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_SetPixelsPerDip(target, 0.0);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
pdip = IDWriteBitmapRenderTarget_GetPixelsPerDip(target);
ok(pdip == 2.0, "got %.2f\n", pdip);
@@ -1454,13 +1451,13 @@ static void test_CreateBitmapRenderTarget(void)
ok(mode == DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE, "got %d\n", mode);
hr = IDWriteBitmapRenderTarget1_SetTextAntialiasMode(target1, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE+1);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
mode = IDWriteBitmapRenderTarget1_GetTextAntialiasMode(target1);
ok(mode == DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE, "got %d\n", mode);
hr = IDWriteBitmapRenderTarget1_SetTextAntialiasMode(target1, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
mode = IDWriteBitmapRenderTarget1_GetTextAntialiasMode(target1);
ok(mode == DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE, "got %d\n", mode);
@@ -1472,14 +1469,14 @@ static void test_CreateBitmapRenderTarget(void)
/* DrawGlyphRun() argument validation. */
hr = IDWriteBitmapRenderTarget_Resize(target, 16, 16);
- ok(hr == S_OK, "Failed to resize target, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to resize target, hr %#lx.\n", hr);
fontface = create_fontface(factory);
ch = 'A';
glyphs[0] = 0;
hr = IDWriteFontFace_GetGlyphIndices(fontface, &ch, 1, glyphs);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(glyphs[0] > 0, "got %u\n", glyphs[0]);
glyphs[1] = glyphs[0];
@@ -1491,46 +1488,46 @@ static void test_CreateBitmapRenderTarget(void)
hr = IDWriteFactory_CreateCustomRenderingParams(factory, 1.0f, 0.0f, 0.0f, DWRITE_PIXEL_GEOMETRY_FLAT,
DWRITE_RENDERING_MODE_DEFAULT, ¶ms);
- ok(hr == S_OK, "Failed to create rendering params, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create rendering params, hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_NATURAL,
&run, NULL, RGB(255, 0, 0), NULL);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_GDI_NATURAL + 1,
&run, NULL, RGB(255, 0, 0), NULL);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_GDI_NATURAL + 1,
&run, params, RGB(255, 0, 0), NULL);
- ok(hr == E_INVALIDARG || broken(hr == S_OK) /* Vista */, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG || broken(hr == S_OK) /* Vista */, "Unexpected hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_GDI_NATURAL,
&run, params, RGB(255, 0, 0), NULL);
- ok(hr == S_OK, "Failed to draw a run, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to draw a run, hr %#lx.\n", hr);
IDWriteRenderingParams_Release(params);
/* Zero sized target returns earlier. */
hr = IDWriteBitmapRenderTarget_Resize(target, 0, 16);
- ok(hr == S_OK, "Failed to resize target, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to resize target, hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_NATURAL,
&run, NULL, RGB(255, 0, 0), NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_GDI_NATURAL + 1,
&run, params, RGB(255, 0, 0), NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace_Release(fontface);
ref = IDWriteBitmapRenderTarget_Release(target);
- ok(ref == 0, "render target not released, %u\n", ref);
+ ok(ref == 0, "render target not released, %lu\n", ref);
ref = IDWriteGdiInterop_Release(interop);
- ok(ref == 0, "interop not released, %u\n", ref);
+ ok(ref == 0, "interop not released, %lu\n", ref);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_GetFontFamily(void)
@@ -1550,10 +1547,10 @@ static void test_GetFontFamily(void)
factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- EXPECT_HR(hr, S_OK);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscoll, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&logfont, 0, sizeof(logfont));
logfont.lfHeight = 12;
@@ -1563,10 +1560,10 @@ static void test_GetFontFamily(void)
lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(font2 != font, "got %p, %p\n", font2, font);
if (0) /* crashes on native */
@@ -1574,32 +1571,32 @@ static void test_GetFontFamily(void)
EXPECT_REF(font, 1);
hr = IDWriteFont_GetFontFamily(font, &family);
- EXPECT_HR(hr, S_OK);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
EXPECT_REF(font, 1);
EXPECT_REF(family, 2);
hr = IDWriteFont_GetFontFamily(font, &family2);
- EXPECT_HR(hr, S_OK);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
ok(family2 == family, "got %p, previous %p\n", family2, family);
EXPECT_REF(font, 1);
EXPECT_REF(family, 3);
IDWriteFontFamily_Release(family2);
hr = IDWriteFont_QueryInterface(font, &IID_IDWriteFontFamily, (void**)&family2);
- EXPECT_HR(hr, E_NOINTERFACE);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
ok(family2 == NULL, "got %p\n", family2);
hr = IDWriteFont_GetFontFamily(font2, &family2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(family2 != family, "got %p, %p\n", family2, family);
collection = NULL;
hr = IDWriteFontFamily_GetFontCollection(family, &collection);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
collection2 = NULL;
hr = IDWriteFontFamily_GetFontCollection(family2, &collection2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(collection == collection2, "got %p, %p\n", collection, collection2);
ok(collection == syscoll, "got %p, %p\n", collection, syscoll);
@@ -1617,25 +1614,25 @@ static void test_GetFontFamily(void)
font3 = (void*)0xdeadbeef;
hr = IDWriteFontFamily1_GetFont(family1, ~0u, &font3);
- ok(hr == E_FAIL, "got 0x%08x\n", hr);
+ ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
ok(font3 == NULL, "got %p\n", font3);
hr = IDWriteFontFamily1_GetFont(family1, 0, &font3);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont3_QueryInterface(font3, &IID_IDWriteFont, (void**)&font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
hr = IDWriteFont3_QueryInterface(font3, &IID_IDWriteFont1, (void**)&font1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont1_Release(font1);
hr = IDWriteFontFamily1_QueryInterface(family1, &IID_IDWriteFontList1, (void **)&fontlist1);
- ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Failed to get interface, hr %#x.\n", hr);
+ ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Failed to get interface, hr %#lx.\n", hr);
if (hr == S_OK) {
hr = IDWriteFontFamily1_QueryInterface(family1, &IID_IDWriteFontList, (void **)&fontlist);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fontlist == (IDWriteFontList *)fontlist1, "Unexpected interface pointer.\n");
ok(fontlist != (IDWriteFontList *)family1, "Unexpected interface pointer.\n");
ok(fontlist != (IDWriteFontList *)family, "Unexpected interface pointer.\n");
@@ -1647,10 +1644,10 @@ static void test_GetFontFamily(void)
ok(fontlist == (IDWriteFontList *)fontlist2, "Unexpected interface pointer.\n");
hr = IDWriteFontList2_GetFontSet(fontlist2, &fontset);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontList2_GetFontSet(fontlist2, &fontset2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fontset != fontset2, "Unexpected instance.\n");
IDWriteFontSet1_Release(fontset2);
@@ -1666,16 +1663,16 @@ static void test_GetFontFamily(void)
}
hr = IDWriteFontFamily1_QueryInterface(family1, &IID_IDWriteFontList, (void**)&fontlist);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontList_Release(fontlist);
IDWriteFont3_Release(font3);
hr = IDWriteFontFamily1_GetFontFaceReference(family1, 0, &ref);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily1_GetFontFaceReference(family1, 0, &ref1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(ref != ref1, "got %p, %p\n", ref, ref1);
IDWriteFontFaceReference_Release(ref);
@@ -1696,11 +1693,11 @@ static void test_GetFontFamily(void)
family2 = (void *)0xdeadbeef;
hr = IDWriteFontCollection2_GetFontFamily(coll2, count, &family2);
- ok(hr == E_FAIL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
ok(!family2, "Unexpected pointer.\n");
hr = IDWriteFontCollection2_GetFontFamily(coll2, 0, &family2);
- ok(hr == S_OK, "Failed to get family, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get family, hr %#lx.\n", hr);
IDWriteFontFamily2_Release(family2);
IDWriteFontCollection2_Release(coll2);
@@ -1715,7 +1712,7 @@ static void test_GetFontFamily(void)
IDWriteFontFamily_Release(family);
IDWriteGdiInterop_Release(interop);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_GetFamilyNames(void)
@@ -1736,7 +1733,7 @@ static void test_GetFamilyNames(void)
factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- EXPECT_HR(hr, S_OK);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
memset(&logfont, 0, sizeof(logfont));
logfont.lfHeight = 12;
@@ -1746,20 +1743,20 @@ static void test_GetFamilyNames(void)
lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font);
- EXPECT_HR(hr, S_OK);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
hr = IDWriteFont_GetFontFamily(font, &family);
- EXPECT_HR(hr, S_OK);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
if (0) /* crashes on native */
hr = IDWriteFontFamily_GetFamilyNames(family, NULL);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(names, 1);
hr = IDWriteFontFamily_GetFamilyNames(family, &names2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(names2, 1);
ok(names != names2, "got %p, was %p\n", names2, names);
@@ -1771,58 +1768,58 @@ static void test_GetFamilyNames(void)
len = 100;
hr = IDWriteLocalizedStrings_GetStringLength(names, 10, &len);
- ok(hr == E_FAIL, "got 0x%08x\n", hr);
+ ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
ok(len == (UINT32)-1, "got %u\n", len);
len = 0;
hr = IDWriteLocalizedStrings_GetStringLength(names, 0, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(len > 0, "got %u\n", len);
/* GetString */
hr = IDWriteLocalizedStrings_GetString(names, 0, NULL, 0);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
hr = IDWriteLocalizedStrings_GetString(names, 10, NULL, 0);
- ok(FAILED(hr), "Unexpected hr %#x.\n", hr);
+ ok(FAILED(hr), "Unexpected hr %#lx.\n", hr);
if (0)
hr = IDWriteLocalizedStrings_GetString(names, 0, NULL, 100);
buffer[0] = 1;
hr = IDWriteLocalizedStrings_GetString(names, 10, buffer, 100);
- ok(hr == E_FAIL, "got 0x%08x\n", hr);
+ ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
ok(buffer[0] == 0, "got %x\n", buffer[0]);
buffer[0] = 1;
hr = IDWriteLocalizedStrings_GetString(names, 0, buffer, len-1);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(buffer[0] == 0 || broken(buffer[0] == 'T'), "Unexpected buffer contents, %#x.\n", buffer[0]);
buffer[0] = 1;
hr = IDWriteLocalizedStrings_GetString(names, 0, buffer, len);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(buffer[0] == 0 || broken(buffer[0] == 'T'), "Unexpected buffer contents, %#x.\n", buffer[0]);
buffer[0] = 0;
hr = IDWriteLocalizedStrings_GetString(names, 0, buffer, len+1);
- ok(hr == S_OK, "Failed to get a string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get a string, hr %#lx.\n", hr);
ok(!lstrcmpW(buffer, L"Tahoma"), "Unexpected family name %s.\n", wine_dbgstr_w(buffer));
IDWriteLocalizedStrings_Release(names);
/* GetFamilyNames() on font face */
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
if (SUCCEEDED(IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (void **)&fontface3)))
{
hr = IDWriteFontFace3_GetFamilyNames(fontface3, &names);
- ok(hr == S_OK, "Failed to get family names, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get family names, hr %#lx.\n", hr);
buffer[0] = 0;
hr = IDWriteLocalizedStrings_GetString(names, 0, buffer, len+1);
- ok(hr == S_OK, "Failed to get a string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get a string, hr %#lx.\n", hr);
ok(!lstrcmpW(buffer, L"Tahoma"), "Unexpected family name %s.\n", wine_dbgstr_w(buffer));
IDWriteLocalizedStrings_Release(names);
@@ -1837,7 +1834,7 @@ static void test_GetFamilyNames(void)
IDWriteFont_Release(font);
IDWriteGdiInterop_Release(interop);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_CreateFontFace(void)
@@ -1862,7 +1859,7 @@ static void test_CreateFontFace(void)
factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- EXPECT_HR(hr, S_OK);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
memset(&logfont, 0, sizeof(logfont));
logfont.lfHeight = 12;
@@ -1873,32 +1870,32 @@ static void test_CreateFontFace(void)
font = NULL;
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
font2 = NULL;
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(font != font2, "got %p, %p\n", font, font2);
hr = IDWriteFont_QueryInterface(font, &IID_IDWriteFontFace, (void**)&fontface);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
if (0) /* crashes on native */
hr = IDWriteFont_CreateFontFace(font, NULL);
fontface = NULL;
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fontface2 = NULL;
hr = IDWriteFont_CreateFontFace(font, &fontface2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fontface == fontface2, "got %p, was %p\n", fontface2, fontface);
IDWriteFontFace_Release(fontface2);
fontface2 = NULL;
hr = IDWriteFont_CreateFontFace(font2, &fontface2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fontface == fontface2, "got %p, was %p\n", fontface2, fontface);
IDWriteFontFace_Release(fontface2);
@@ -1906,36 +1903,36 @@ static void test_CreateFontFace(void)
IDWriteFont_Release(font);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFont, (void**)&font);
- ok(hr == E_NOINTERFACE || broken(hr == E_NOTIMPL), "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE || broken(hr == E_NOTIMPL), "Unexpected hr %#lx.\n", hr);
IDWriteFontFace_Release(fontface);
IDWriteGdiInterop_Release(interop);
/* Create from system collection */
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
font = NULL;
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
font2 = NULL;
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(font != font2, "got %p, %p\n", font, font2);
fontface = NULL;
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fontface2 = NULL;
hr = IDWriteFont_CreateFontFace(font2, &fontface2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fontface == fontface2, "got %p, was %p\n", fontface2, fontface);
/* Trivial equality test */
@@ -1953,21 +1950,21 @@ static void test_CreateFontFace(void)
IDWriteFontFamily_Release(family);
IDWriteFontCollection_Release(collection);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u.\n", ref);
+ ok(ref == 0, "factory not released, %lu.\n", ref);
/* IDWriteFactory::CreateFontFace() */
path = create_testfontfile(test_fontfile);
factory = create_factory();
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
supported = FALSE;
file_type = DWRITE_FONT_FILE_TYPE_UNKNOWN;
face_type = DWRITE_FONT_FACE_TYPE_CFF;
count = 0;
hr = IDWriteFontFile_Analyze(file, &supported, &file_type, &face_type, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(supported == TRUE, "got %i\n", supported);
ok(file_type == DWRITE_FONT_FILE_TYPE_TRUETYPE, "got %i\n", file_type);
ok(face_type == DWRITE_FONT_FACE_TYPE_TRUETYPE, "got %i\n", face_type);
@@ -1975,42 +1972,42 @@ static void test_CreateFontFace(void)
/* invalid simulation flags */
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_CFF, 1, &file, 0, ~0u, &fontface);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_CFF, 1, &file, 0, 0xf, &fontface);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* try mismatching face type, the one that's not supported */
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_CFF, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface);
- ok(hr == DWRITE_E_FILEFORMAT, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_FILEFORMAT, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_OPENTYPE_COLLECTION, 1, &file, 0,
DWRITE_FONT_SIMULATIONS_NONE, &fontface);
- ok(hr == DWRITE_E_FILEFORMAT || broken(hr == E_FAIL) /* < win10 */, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_FILEFORMAT || broken(hr == E_FAIL) /* < win10 */, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_RAW_CFF, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface);
todo_wine
- ok(hr == DWRITE_E_UNSUPPORTEDOPERATION || broken(hr == E_INVALIDARG) /* older versions */, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_UNSUPPORTEDOPERATION || broken(hr == E_INVALIDARG) /* older versions */, "Unexpected hr %#lx.\n", hr);
fontface = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TYPE1, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(fontface == NULL, "got %p\n", fontface);
fontface = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_VECTOR, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(fontface == NULL, "got %p\n", fontface);
fontface = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_BITMAP, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(fontface == NULL, "got %p\n", fontface);
fontface = NULL;
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_UNKNOWN, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface);
todo_wine
- ok(hr == S_OK || broken(hr == E_INVALIDARG) /* < win10 */, "got 0x%08x\n", hr);
+ ok(hr == S_OK || broken(hr == E_INVALIDARG) /* < win10 */, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK) {
ok(fontface != NULL, "got %p\n", fontface);
face_type = IDWriteFontFace_GetType(fontface);
@@ -2020,7 +2017,7 @@ static void test_CreateFontFace(void)
IDWriteFontFile_Release(file);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u.\n", ref);
+ ok(ref == 0, "factory not released, %lu.\n", ref);
DELETE_FONTFILE(path);
}
@@ -2038,13 +2035,13 @@ static void get_expected_font_metrics(IDWriteFontFace *fontface, DWRITE_FONT_MET
memset(metrics, 0, sizeof(*metrics));
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_OS2_TAG, (const void **)&tt_os2, &size, &os2_context, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_HEAD_TAG, (const void**)&tt_head, &size, &head_context, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_HHEA_TAG, (const void**)&tt_hhea, &size, &hhea_context, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_POST_TAG, (const void**)&tt_post, &size, &post_context, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (tt_head) {
metrics->designUnitsPerEm = GET_BE_WORD(tt_head->unitsPerEm);
@@ -2199,11 +2196,11 @@ static void get_enus_string(IDWriteLocalizedStrings *strings, WCHAR *buff, UINT3
HRESULT hr;
hr = IDWriteLocalizedStrings_FindLocaleName(strings, L"en-us", &index, &exists);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!exists)
index = 0;
hr = IDWriteLocalizedStrings_GetString(strings, index, buff, size);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
}
static void test_GetMetrics(void)
@@ -2228,7 +2225,7 @@ static void test_GetMetrics(void)
factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- EXPECT_HR(hr, S_OK);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n");
memset(&logfont, 0, sizeof(logfont));
logfont.lfHeight = 12;
@@ -2238,7 +2235,7 @@ static void test_GetMetrics(void)
lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hfont = CreateFontIndirectW(&logfont);
hdc = CreateCompatibleDC(0);
@@ -2268,7 +2265,7 @@ static void test_GetMetrics(void)
ok(metrics.strikethroughThickness != 0, "strikethroughThickness %u\n", metrics.strikethroughThickness);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&metrics, 0, sizeof(metrics));
IDWriteFontFace_GetMetrics(fontface, &metrics);
@@ -2315,7 +2312,7 @@ static void test_GetMetrics(void)
ok(!metrics1.hasTypographicMetrics, "hasTypographicMetrics %d\n", metrics1.hasTypographicMetrics);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&metrics1, 0, sizeof(metrics1));
IDWriteFontFace1_GetMetrics(fontface1, &metrics1);
@@ -2357,11 +2354,11 @@ static void test_GetMetrics(void)
/* create regulat Tahoma with bold simulation */
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 1;
hr = IDWriteFontFace_GetFiles(fontface, &count, &file);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace_GetMetrics(fontface, &metrics);
ok(IDWriteFontFace_GetSimulations(fontface) == 0, "wrong simulations flags\n");
@@ -2369,7 +2366,7 @@ static void test_GetMetrics(void)
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file,
0, DWRITE_FONT_SIMULATIONS_BOLD, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace_GetMetrics(fontface, &metrics2);
ok(IDWriteFontFace_GetSimulations(fontface) == DWRITE_FONT_SIMULATIONS_BOLD, "wrong simulations flags\n");
@@ -2393,7 +2390,7 @@ static void test_GetMetrics(void)
/* test metrics for whole system collection */
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < count; i++) {
@@ -2405,12 +2402,12 @@ static void test_GetMetrics(void)
IDWriteFont *font;
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fontcount = IDWriteFontFamily_GetFontCount(family);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "Failed to get family names, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get family names, hr %#lx.\n", hr);
get_enus_string(names, familyW, ARRAY_SIZE(familyW));
IDWriteLocalizedStrings_Release(names);
@@ -2418,13 +2415,13 @@ static void test_GetMetrics(void)
WCHAR nameW[256];
hr = IDWriteFontFamily_GetFont(family, j, &font);
- ok(hr == S_OK, "Failed to get a font, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get a font, hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "Failed to create face instance, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create face instance, hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &names);
- ok(hr == S_OK, "Failed to get face names, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get face names, hr %#lx.\n", hr);
get_enus_string(names, faceW, ARRAY_SIZE(faceW));
IDWriteLocalizedStrings_Release(names);
@@ -2451,7 +2448,7 @@ static void test_GetMetrics(void)
}
IDWriteFontCollection_Release(syscollection);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_system_fontcollection(void)
@@ -2476,16 +2473,16 @@ static void test_system_fontcollection(void)
factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_GetSystemFontCollection(factory, &coll2, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(coll2 == collection, "got %p, was %p\n", coll2, collection);
IDWriteFontCollection_Release(coll2);
factory2 = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory2, &coll2, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(coll2 != collection, "got %p, was %p\n", coll2, collection);
IDWriteFontCollection_Release(coll2);
IDWriteFactory_Release(factory2);
@@ -2496,74 +2493,74 @@ static void test_system_fontcollection(void)
/* invalid index */
family = (void*)0xdeadbeef;
hr = IDWriteFontCollection_GetFontFamily(collection, i, &family);
- ok(hr == E_FAIL, "got 0x%08x\n", hr);
+ ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
ok(family == NULL, "got %p\n", family);
ret = FALSE;
i = (UINT32)-1;
hr = IDWriteFontCollection_FindFamilyName(collection, L"Tahoma", &i, &ret);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(ret, "got %d\n", ret);
ok(i != (UINT32)-1, "got %u\n", i);
ret = FALSE;
i = (UINT32)-1;
hr = IDWriteFontCollection_FindFamilyName(collection, L"TAHOMA", &i, &ret);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(ret, "got %d\n", ret);
ok(i != (UINT32)-1, "got %u\n", i);
ret = FALSE;
i = (UINT32)-1;
hr = IDWriteFontCollection_FindFamilyName(collection, L"tAhOmA", &i, &ret);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(ret, "got %d\n", ret);
ok(i != (UINT32)-1, "got %u\n", i);
/* get back local file loader */
hr = IDWriteFontCollection_GetFontFamily(collection, i, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFamily_Release(family);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
i = 1;
file = NULL;
hr = IDWriteFontFace_GetFiles(fontface, &i, &file);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(file != NULL, "got %p\n", file);
IDWriteFontFace_Release(fontface);
hr = IDWriteFontFile_GetLoader(file, &loader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(file);
hr = IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void**)&localloader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteLocalFontFileLoader_Release(localloader);
/* local loader is not registered by default */
hr = IDWriteFactory_RegisterFontFileLoader(factory, loader);
- ok(hr == S_OK || broken(hr == DWRITE_E_ALREADYREGISTERED), "got 0x%08x\n", hr);
+ ok(hr == S_OK || broken(hr == DWRITE_E_ALREADYREGISTERED), "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_UnregisterFontFileLoader(factory, loader);
- ok(hr == S_OK || broken(hr == E_INVALIDARG), "got 0x%08x\n", hr);
+ ok(hr == S_OK || broken(hr == E_INVALIDARG), "Unexpected hr %#lx.\n", hr);
/* try with a different factory */
factory2 = create_factory();
hr = IDWriteFactory_RegisterFontFileLoader(factory2, loader);
- ok(hr == S_OK || broken(hr == DWRITE_E_ALREADYREGISTERED), "got 0x%08x\n", hr);
+ ok(hr == S_OK || broken(hr == DWRITE_E_ALREADYREGISTERED), "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_RegisterFontFileLoader(factory2, loader);
- ok(hr == DWRITE_E_ALREADYREGISTERED, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_ALREADYREGISTERED, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_UnregisterFontFileLoader(factory2, loader);
- ok(hr == S_OK || broken(hr == E_INVALIDARG), "got 0x%08x\n", hr);
+ ok(hr == S_OK || broken(hr == E_INVALIDARG), "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_UnregisterFontFileLoader(factory2, loader);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
IDWriteFactory_Release(factory2);
IDWriteFontFileLoader_Release(loader);
@@ -2571,7 +2568,7 @@ static void test_system_fontcollection(void)
ret = TRUE;
i = 0;
hr = IDWriteFontCollection_FindFamilyName(collection, L"Blah!", &i, &ret);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!ret, "got %d\n", ret);
ok(i == (UINT32)-1, "got %u\n", i);
@@ -2582,17 +2579,17 @@ static void test_system_fontcollection(void)
IDWriteFactory3 *factory3;
hr = IDWriteFontCollection1_QueryInterface(collection1, &IID_IDWriteFontCollection, (void**)&coll2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(coll2 == collection, "got %p, %p\n", collection, coll2);
IDWriteFontCollection_Release(coll2);
family1 = (void*)0xdeadbeef;
hr = IDWriteFontCollection1_GetFontFamily(collection1, ~0u, &family1);
- ok(hr == E_FAIL, "got 0x%08x\n", hr);
+ ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
ok(family1 == NULL, "got %p\n", family1);
hr = IDWriteFontCollection1_GetFontFamily(collection1, 0, &family1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFamily1_Release(family1);
/* system fontset */
@@ -2600,24 +2597,24 @@ static void test_system_fontcollection(void)
EXPECT_REF(factory, 2);
hr = IDWriteFontCollection1_GetFontSet(collection1, &fontset);
todo_wine
- ok(hr == S_OK, "Failed to get fontset, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get fontset, hr %#lx.\n", hr);
if (hr == S_OK) {
EXPECT_REF(collection1, 2);
EXPECT_REF(factory, 2);
EXPECT_REF(fontset, 1);
hr = IDWriteFontCollection1_GetFontSet(collection1, &fontset2);
- ok(hr == S_OK, "Failed to get fontset, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get fontset, hr %#lx.\n", hr);
ok(fontset != fontset2, "Expected new fontset instance.\n");
EXPECT_REF(fontset2, 1);
IDWriteFontSet_Release(fontset2);
hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory3, (void **)&factory3);
- ok(hr == S_OK, "Failed to get IDWriteFactory3 interface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get IDWriteFactory3 interface, hr %#lx.\n", hr);
EXPECT_REF(factory, 3);
hr = IDWriteFactory3_GetSystemFontSet(factory3, &fontset2);
- ok(hr == S_OK, "Failed to get system font set, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get system font set, hr %#lx.\n", hr);
ok(fontset != fontset2, "Expected new fontset instance.\n");
EXPECT_REF(fontset2, 1);
EXPECT_REF(factory, 4);
@@ -2657,18 +2654,18 @@ static void test_system_fontcollection(void)
hr = IDWriteFactory6_GetSystemFontCollection(factory6, FALSE, DWRITE_FONT_FAMILY_MODEL_TYPOGRAPHIC,
&collection2);
todo_wine
- ok(hr == S_OK, "Failed to get collection, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get collection, hr %#lx.\n", hr);
if (SUCCEEDED(hr))
{
hr = IDWriteFactory6_GetSystemFontCollection(factory6, FALSE, DWRITE_FONT_FAMILY_MODEL_TYPOGRAPHIC, &c2);
- ok(hr == S_OK, "Failed to get collection, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get collection, hr %#lx.\n", hr);
ok(c2 == collection2 && collection != (IDWriteFontCollection *)c2, "Unexpected collection instance.\n");
IDWriteFontCollection2_Release(c2);
IDWriteFontCollection2_Release(collection2);
hr = IDWriteFactory6_GetSystemFontCollection(factory6, FALSE, DWRITE_FONT_FAMILY_MODEL_WEIGHT_STRETCH_STYLE,
&collection2);
- ok(hr == S_OK, "Failed to get collection, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get collection, hr %#lx.\n", hr);
IDWriteFontCollection2_Release(collection2);
}
IDWriteFactory6_Release(factory6);
@@ -2677,9 +2674,9 @@ static void test_system_fontcollection(void)
win_skip("IDWriteFactory6 is not supported.\n");
ref = IDWriteFontCollection_Release(collection);
- ok(!ref, "Collection wasn't released, %u.\n", ref);
+ ok(!ref, "Collection wasn't released, %lu.\n", ref);
ref = IDWriteFactory_Release(factory);
- ok(!ref, "Factory wasn't released, %u.\n", ref);
+ ok(!ref, "Factory wasn't released, %lu.\n", ref);
}
static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont)
@@ -2708,15 +2705,15 @@ static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont)
logfont->lfItalic = 0;
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "Failed to create font face, %#x\n", hr);
+ ok(hr == S_OK, "Failed to create font face, %#lx\n", hr);
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_OS2_TAG, (const void **)&tt_os2, &size,
&os2_context, &exists);
- ok(hr == S_OK, "Failed to get OS/2 table, %#x\n", hr);
+ ok(hr == S_OK, "Failed to get OS/2 table, %#lx\n", hr);
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_HEAD_TAG, (const void **)&tt_head, &size,
&head_context, &exists);
- ok(hr == S_OK, "Failed to get head table, %#x\n", hr);
+ ok(hr == S_OK, "Failed to get head table, %#lx\n", hr);
sim = IDWriteFont_GetSimulations(font);
@@ -2781,7 +2778,7 @@ static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont)
if (exists) {
nameW[0] = 0;
hr = IDWriteLocalizedStrings_GetString(names, index, nameW, ARRAY_SIZE(nameW));
- ok(hr == S_OK, "Failed to get name string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get name string, hr %#lx.\n", hr);
lstrcpynW(logfont->lfFaceName, nameW, ARRAY_SIZE(logfont->lfFaceName));
}
}
@@ -2810,7 +2807,7 @@ static void test_ConvertFontFaceToLOGFONT(void)
factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (0) /* crashes on native */
{
@@ -2819,11 +2816,11 @@ if (0) /* crashes on native */
}
memset(&logfont, 0xcc, sizeof(logfont));
hr = IDWriteGdiInterop_ConvertFontFaceToLOGFONT(interop, NULL, &logfont);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(logfont.lfFaceName[0] == 0, "got face name %s\n", wine_dbgstr_w(logfont.lfFaceName));
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(collection);
for (i = 0; i < count; i++) {
@@ -2836,10 +2833,10 @@ if (0) /* crashes on native */
LOGFONTW lf;
hr = IDWriteFontCollection_GetFontFamily(collection, i, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, familynameW, ARRAY_SIZE(familynameW));
IDWriteLocalizedStrings_Release(names);
@@ -2850,10 +2847,10 @@ if (0) /* crashes on native */
IDWriteFontFace *fontface;
hr = IDWriteFontFamily_GetFont(family, j, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &names);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, facenameW, ARRAY_SIZE(facenameW));
IDWriteLocalizedStrings_Release(names);
@@ -2861,7 +2858,7 @@ if (0) /* crashes on native */
get_combined_font_name(familynameW, facenameW, nameW);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (has_face_variations(fontface))
{
@@ -2875,14 +2872,14 @@ if (0) /* crashes on native */
memset(&logfont, 0xcc, sizeof(logfont));
hr = IDWriteGdiInterop_ConvertFontFaceToLOGFONT(interop, fontface, &logfont);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
sim = IDWriteFontFace_GetSimulations(fontface);
get_logfont_from_font(font, &lf);
winetest_push_context("Font %s", wine_dbgstr_w(nameW));
- ok(logfont.lfWeight == lf.lfWeight, "Unexpected lfWeight %d, expected lfWeight %d, font weight %d, "
+ ok(logfont.lfWeight == lf.lfWeight, "Unexpected lfWeight %ld, expected lfWeight %ld, font weight %d, "
"bold simulation %s.\n", logfont.lfWeight, lf.lfWeight, IDWriteFont_GetWeight(font),
sim & DWRITE_FONT_SIMULATIONS_BOLD ? "yes" : "no");
ok(logfont.lfItalic == lf.lfItalic, "Unexpected italic flag %d, oblique simulation %s.\n",
@@ -2907,7 +2904,7 @@ if (0) /* crashes on native */
IDWriteFontCollection_Release(collection);
IDWriteGdiInterop_Release(interop);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static HRESULT WINAPI fontfileenumerator_QueryInterface(IDWriteFontFileEnumerator *iface, REFIID riid, void **obj)
@@ -3046,50 +3043,50 @@ static void test_CustomFontCollection(void)
loader3 = create_collection_loader();
hr = IDWriteFactory_RegisterFontCollectionLoader(factory, NULL);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_UnregisterFontCollectionLoader(factory, NULL);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(loader, 1);
EXPECT_REF(loader2, 1);
hr = IDWriteFactory_RegisterFontCollectionLoader(factory, loader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_RegisterFontCollectionLoader(factory, loader2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_RegisterFontCollectionLoader(factory, loader);
- ok(hr == DWRITE_E_ALREADYREGISTERED, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_ALREADYREGISTERED, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(loader, 2);
EXPECT_REF(loader2, 2);
hr = IDWriteFactory_RegisterFontFileLoader(factory, &rloader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_RegisterFontCollectionLoader(factory, &resource_collection.IDWriteFontFileCollectionLoader_iface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Loader wasn't registered. */
font_collection = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateCustomFontCollection(factory, loader3, "Billy", 6, &font_collection);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(font_collection == NULL, "got %p\n", font_collection);
EXPECT_REF(factory, 1);
hr = IDWriteFactory_CreateCustomFontCollection(factory, loader, "Billy", 6, &font_collection);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine
EXPECT_REF(factory, 1);
EXPECT_REF(loader, 2);
IDWriteFontCollection_Release(font_collection);
hr = IDWriteFactory_CreateCustomFontCollection(factory, loader2, "Billy", 6, &font_collection);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontCollection_Release(font_collection);
font_collection = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateCustomFontCollection(factory, (IDWriteFontCollectionLoader*)0xdeadbeef, "Billy", 6, &font_collection);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(font_collection == NULL, "got %p\n", font_collection);
font = FindResourceA(GetModuleHandleA(NULL), (LPCSTR)MAKEINTRESOURCE(1), (LPCSTR)RT_RCDATA);
@@ -3097,13 +3094,13 @@ static void test_CustomFontCollection(void)
hr = IDWriteFactory_CreateCustomFontCollection(factory, &resource_collection.IDWriteFontFileCollectionLoader_iface,
&font, sizeof(HRSRC), &font_collection);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
EXPECT_REF(font_collection, 1);
index = 1;
exists = FALSE;
hr = IDWriteFontCollection_FindFamilyName(font_collection, L"wine_test", &index, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(index == 0, "got index %i\n", index);
ok(exists, "got exists %i\n", exists);
@@ -3112,65 +3109,65 @@ static void test_CustomFontCollection(void)
family = NULL;
hr = IDWriteFontCollection_GetFontFamily(font_collection, 0, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(family, 1);
family2 = NULL;
hr = IDWriteFontCollection_GetFontFamily(font_collection, 0, &family2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(family2, 1);
ok(family != family2, "got %p, %p\n", family, family2);
hr = IDWriteFontFamily_GetFont(family, 0, &idfont);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(idfont, 1);
EXPECT_REF(family, 2);
hr = IDWriteFontFamily_GetFont(family, 0, &idfont2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(idfont2, 1);
EXPECT_REF(family, 3);
ok(idfont != idfont2, "got %p, %p\n", idfont, idfont2);
IDWriteFont_Release(idfont2);
hr = IDWriteFont_GetInformationalStrings(idfont, DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE, &string, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(exists, "got %d\n", exists);
EXPECT_REF(string, 1);
IDWriteLocalizedStrings_Release(string);
family3 = NULL;
hr = IDWriteFont_GetFontFamily(idfont, &family3);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(family, 3);
ok(family == family3, "got %p, %p\n", family, family3);
IDWriteFontFamily_Release(family3);
idfontface = NULL;
hr = IDWriteFont_CreateFontFace(idfont, &idfontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(idfont, 1);
idfont2 = NULL;
hr = IDWriteFontFamily_GetFont(family2, 0, &idfont2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(idfont2, 1);
EXPECT_REF(idfont, 1);
ok(idfont2 != idfont, "Font instances should not match\n");
idfontface2 = NULL;
hr = IDWriteFont_CreateFontFace(idfont2, &idfontface2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(idfontface2 == idfontface, "fontfaces should match\n");
index = 1;
fontfile = NULL;
hr = IDWriteFontFace_GetFiles(idfontface, &index, &fontfile);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
index = 1;
fontfile2 = NULL;
hr = IDWriteFontFace_GetFiles(idfontface2, &index, &fontfile2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fontfile == fontfile2, "fontfiles should match\n");
IDWriteFont_Release(idfont);
@@ -3184,22 +3181,22 @@ static void test_CustomFontCollection(void)
IDWriteFontCollection_Release(font_collection);
hr = IDWriteFactory_UnregisterFontCollectionLoader(factory, loader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_UnregisterFontCollectionLoader(factory, loader);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_UnregisterFontCollectionLoader(factory, loader2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_UnregisterFontCollectionLoader(factory, &resource_collection.IDWriteFontFileCollectionLoader_iface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_UnregisterFontFileLoader(factory, &rloader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontCollectionLoader_Release(loader);
IDWriteFontCollectionLoader_Release(loader2);
IDWriteFontCollectionLoader_Release(loader3);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static HRESULT WINAPI fontfileloader_QueryInterface(IDWriteFontFileLoader *iface, REFIID riid, void **obj)
@@ -3267,80 +3264,80 @@ static void test_CreateCustomFontFileReference(void)
if (0) { /* crashes on win10 */
hr = IDWriteFactory_RegisterFontFileLoader(factory, NULL);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
}
/* local loader is accepted too */
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFile_GetLoader(file, &loader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFile_GetReferenceKey(file, &key, &key_size);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateCustomFontFileReference(factory, key, key_size, loader, &file2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(file2);
IDWriteFontFile_Release(file);
IDWriteFontFileLoader_Release(loader);
hr = IDWriteFactory_RegisterFontFileLoader(factory, &floader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_RegisterFontFileLoader(factory, &floader2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_RegisterFontFileLoader(factory, &floader);
- ok(hr == DWRITE_E_ALREADYREGISTERED, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_ALREADYREGISTERED, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_RegisterFontFileLoader(factory, &rloader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
file = NULL;
hr = IDWriteFactory_CreateCustomFontFileReference(factory, "test", 4, &floader, &file);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(file);
file = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateCustomFontFileReference(factory, "test", 4, &floader3, &file);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(file == NULL, "got %p\n", file);
file = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateCustomFontFileReference(factory, "test", 4, NULL, &file);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(file == NULL, "got %p\n", file);
file = NULL;
hr = IDWriteFactory_CreateCustomFontFileReference(factory, "test", 4, &floader, &file);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
file_type = DWRITE_FONT_FILE_TYPE_TRUETYPE;
face_type = DWRITE_FONT_FACE_TYPE_TRUETYPE;
support = TRUE;
count = 1;
hr = IDWriteFontFile_Analyze(file, &support, &file_type, &face_type, &count);
- ok(hr == 0x8faecafe, "got 0x%08x\n", hr);
+ ok(hr == 0x8faecafe, "Unexpected hr %#lx.\n", hr);
ok(support == FALSE, "got %i\n", support);
ok(file_type == DWRITE_FONT_FILE_TYPE_UNKNOWN, "got %i\n", file_type);
ok(face_type == DWRITE_FONT_FACE_TYPE_UNKNOWN, "got %i\n", face_type);
ok(count == 0, "got %i\n", count);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_CFF, 1, &file, 0, 0, &face);
- ok(hr == 0x8faecafe, "got 0x%08x\n", hr);
+ ok(hr == 0x8faecafe, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(file);
fontrsrc = FindResourceA(GetModuleHandleA(NULL), (LPCSTR)MAKEINTRESOURCE(1), (LPCSTR)RT_RCDATA);
ok(fontrsrc != NULL, "Failed to find font resource\n");
hr = IDWriteFactory_CreateCustomFontFileReference(factory, &fontrsrc, sizeof(HRSRC), &rloader, &file);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
file_type = DWRITE_FONT_FILE_TYPE_UNKNOWN;
face_type = DWRITE_FONT_FACE_TYPE_UNKNOWN;
support = FALSE;
count = 0;
hr = IDWriteFontFile_Analyze(file, &support, &file_type, &face_type, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(support == TRUE, "got %i\n", support);
ok(file_type == DWRITE_FONT_FILE_TYPE_TRUETYPE, "got %i\n", file_type);
ok(face_type == DWRITE_FONT_FACE_TYPE_TRUETYPE, "got %i\n", face_type);
@@ -3349,14 +3346,14 @@ if (0) { /* crashes on win10 */
/* invalid index */
face = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateFontFace(factory, face_type, 1, &file, 1, DWRITE_FONT_SIMULATIONS_NONE, &face);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(face == NULL, "got %p\n", face);
hr = IDWriteFactory_CreateFontFace(factory, face_type, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &face);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, face_type, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &face2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* fontface instances are reused starting with win7 */
ok(face == face2 || broken(face != face2), "got %p, %p\n", face, face2);
IDWriteFontFace_Release(face2);
@@ -3365,37 +3362,37 @@ if (0) { /* crashes on win10 */
face2 = NULL;
hr = IDWriteFactory_CreateFontFace(factory2, face_type, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &face2);
todo_wine
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (face2) {
IDWriteFontFace_Release(face2);
}
file2 = NULL;
hr = IDWriteFactory_CreateCustomFontFileReference(factory, &fontrsrc, sizeof(HRSRC), &rloader, &file2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(file != file2, "got %p, %p\n", file, file2);
hr = IDWriteFactory_CreateFontFace(factory, face_type, 1, &file2, 0, DWRITE_FONT_SIMULATIONS_NONE, &face2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* fontface instances are reused starting with win7 */
ok(face == face2 || broken(face != face2), "got %p, %p\n", face, face2);
IDWriteFontFace_Release(face2);
IDWriteFontFile_Release(file2);
hr = IDWriteFontFace_GetGlyphIndices(face, NULL, 0, NULL);
- ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_GetGlyphIndices(face, codePoints, 0, NULL);
- ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_GetGlyphIndices(face, codePoints, 0, indices);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_GetGlyphIndices(face, NULL, 0, indices);
- ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "Unexpected hr %#lx.\n", hr);
indices[0] = indices[1] = 11;
hr = IDWriteFontFace_GetGlyphIndices(face, NULL, 1, indices);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(indices[0] == 0, "got index %i\n", indices[0]);
ok(indices[1] == 11, "got index %i\n", indices[1]);
@@ -3403,24 +3400,24 @@ if (face2) {
hr = IDWriteFontFace_GetGlyphIndices(face, NULL, 1, NULL);
hr = IDWriteFontFace_GetGlyphIndices(face, codePoints, 1, indices);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(indices[0] == 7, "Unexpected glyph index, %u.\n", indices[0]);
IDWriteFontFace_Release(face);
IDWriteFontFile_Release(file);
hr = IDWriteFactory_UnregisterFontFileLoader(factory, &floader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_UnregisterFontFileLoader(factory, &floader);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_UnregisterFontFileLoader(factory, &floader2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_UnregisterFontFileLoader(factory, &rloader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ref = IDWriteFactory_Release(factory2);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
DELETE_FONTFILE(path);
}
@@ -3442,30 +3439,30 @@ static void test_CreateFontFileReference(void)
ffile = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateFontFileReference(factory, NULL, NULL, &ffile);
- ok(hr == E_INVALIDARG, "got 0x%08x\n",hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n",hr);
ok(ffile == NULL, "got %p\n", ffile);
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &ffile);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
support = FALSE;
type = DWRITE_FONT_FILE_TYPE_UNKNOWN;
face = DWRITE_FONT_FACE_TYPE_CFF;
count = 0;
hr = IDWriteFontFile_Analyze(ffile, &support, &type, &face, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(support == TRUE, "got %i\n", support);
ok(type == DWRITE_FONT_FILE_TYPE_TRUETYPE, "got %i\n", type);
ok(face == DWRITE_FONT_FACE_TYPE_TRUETYPE, "got %i\n", face);
ok(count == 1, "got %i\n", count);
hr = IDWriteFactory_CreateFontFace(factory, face, 1, &ffile, 0, DWRITE_FONT_SIMULATIONS_NONE, &fface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace_Release(fface);
IDWriteFontFile_Release(ffile);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
DELETE_FONTFILE(path);
}
@@ -3480,15 +3477,15 @@ static void test_shared_isolated(void)
/* invalid type */
shared = NULL;
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED+1, &IID_IDWriteFactory, (IUnknown**)&shared);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(shared != NULL, "got %p\n", shared);
IDWriteFactory_Release(shared);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory, (IUnknown**)&shared);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory, (IUnknown**)&shared2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(shared == shared2, "got %p, and %p\n", shared, shared2);
IDWriteFactory_Release(shared2);
@@ -3496,30 +3493,30 @@ static void test_shared_isolated(void)
/* we got 2 references, released 2 - still same pointer is returned */
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory, (IUnknown**)&shared2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(shared == shared2, "got %p, and %p\n", shared, shared2);
IDWriteFactory_Release(shared2);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_ISOLATED, &IID_IDWriteFactory, (IUnknown**)&isolated);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_ISOLATED, &IID_IDWriteFactory, (IUnknown**)&isolated2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(isolated != isolated2, "got %p, and %p\n", isolated, isolated2);
IDWriteFactory_Release(isolated2);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_ISOLATED, &IID_IUnknown, (IUnknown**)&isolated2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFactory_Release(isolated2);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED+1, &IID_IDWriteFactory, (IUnknown**)&isolated2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(shared != isolated2, "got %p, and %p\n", shared, isolated2);
ref = IDWriteFactory_Release(isolated);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
ref = IDWriteFactory_Release(isolated2);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
struct dwrite_fonttable
@@ -3743,16 +3740,16 @@ static void test_GetUnicodeRanges(void)
factory = create_factory();
hr = IDWriteFactory_RegisterFontFileLoader(factory, &rloader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
font = FindResourceA(GetModuleHandleA(NULL), (LPCSTR)MAKEINTRESOURCE(1), (LPCSTR)RT_RCDATA);
ok(font != NULL, "Failed to find font resource\n");
hr = IDWriteFactory_CreateCustomFontFileReference(factory, &font, sizeof(HRSRC), &rloader, &ffile);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &ffile, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(ffile);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1);
@@ -3765,39 +3762,39 @@ static void test_GetUnicodeRanges(void)
count = 0;
hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 0, NULL, &count);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(count > 0, "got %u\n", count);
count = 1;
hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 1, NULL, &count);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(count == 0, "got %u\n", count);
count = 0;
hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 1, &r, &count);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(count > 1, "got %u\n", count);
ranges = malloc(count*sizeof(DWRITE_UNICODE_RANGE));
hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, count, ranges, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ranges[0].first = ranges[0].last = 0;
hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 1, ranges, &count);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(ranges[0].first != 0 && ranges[0].last != 0, "got 0x%x-0x%0x\n", ranges[0].first, ranges[0].last);
free(ranges);
hr = IDWriteFactory_UnregisterFontFileLoader(factory, &rloader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace1_Release(fontface1);
if (strcmp(winetest_platform, "wine")) {
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE);
- ok(hr == S_OK, "Failed to get system collection, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get system collection, hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
@@ -3809,10 +3806,10 @@ if (strcmp(winetest_platform, "wine")) {
IDWriteFont *font;
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family);
- ok(hr == S_OK, "Failed to get font family, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font family, hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "Failed to get family names, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get family names, hr %#lx.\n", hr);
get_enus_string(names, familynameW, ARRAY_SIZE(familynameW));
IDWriteLocalizedStrings_Release(names);
@@ -3823,13 +3820,13 @@ if (strcmp(winetest_platform, "wine")) {
UINT32 range_count, expected_count;
hr = IDWriteFontFamily_GetFont(family, j, &font);
- ok(hr == S_OK, "Failed to get font, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font, hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &names);
- ok(hr == S_OK, "Failed to get face names, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get face names, hr %#lx.\n", hr);
IDWriteFont_Release(font);
get_enus_string(names, facenameW, ARRAY_SIZE(facenameW));
@@ -3848,12 +3845,12 @@ if (strcmp(winetest_platform, "wine")) {
IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void **)&fontface1);
hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 0, NULL, &range_count);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ranges = malloc(range_count * sizeof(*ranges));
hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, range_count, ranges, &range_count);
- ok(hr == S_OK, "Failed to get ranges, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get ranges, hr %#lx.\n", hr);
expected_count = fontface_get_expected_unicode_ranges(fontface1, &expected_ranges);
ok(expected_count == range_count, "%s - %s: unexpected range count %u, expected %u.\n",
@@ -3885,7 +3882,7 @@ if (strcmp(winetest_platform, "wine")) {
IDWriteFontCollection_Release(syscollection);
}
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_GetFontFromFontFace(void)
@@ -3903,35 +3900,35 @@ static void test_GetFontFromFontFace(void)
factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
font2 = NULL;
hr = IDWriteFontCollection_GetFontFromFontFace(collection, fontface, &font2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(font2 != font, "got %p, %p\n", font2, font);
font3 = NULL;
hr = IDWriteFontCollection_GetFontFromFontFace(collection, fontface, &font3);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(font3 != font && font3 != font2, "got %p, %p, %p\n", font3, font2, font);
hr = IDWriteFont_CreateFontFace(font2, &fontface2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fontface2 == fontface, "got %p, %p\n", fontface2, fontface);
IDWriteFontFace_Release(fontface2);
hr = IDWriteFont_CreateFontFace(font3, &fontface2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fontface2 == fontface, "got %p, %p\n", fontface2, fontface);
IDWriteFontFace_Release(fontface2);
IDWriteFontFace_Release(fontface);
@@ -3943,14 +3940,14 @@ static void test_GetFontFromFontFace(void)
path = create_testfontfile(test_fontfile);
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(file);
hr = IDWriteFontCollection_GetFontFromFontFace(collection, fontface, &font3);
- ok(hr == DWRITE_E_NOFONT, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_NOFONT, "Unexpected hr %#lx.\n", hr);
ok(font3 == NULL, "got %p\n", font3);
IDWriteFontFace_Release(fontface);
@@ -3959,7 +3956,7 @@ static void test_GetFontFromFontFace(void)
IDWriteFontFamily_Release(family);
IDWriteFontCollection_Release(collection);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
DELETE_FONTFILE(path);
}
@@ -3976,34 +3973,34 @@ static void test_GetFirstMatchingFont(void)
factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(font != font2, "got %p, %p\n", font, font2);
IDWriteFont_Release(font);
IDWriteFont_Release(font2);
/* out-of-range font props are allowed */
hr = IDWriteFontFamily_GetFirstMatchingFont(family, 1000, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, 10, DWRITE_FONT_STYLE_NORMAL, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL,
10, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
IDWriteFontFamily_Release(family);
@@ -4015,7 +4012,7 @@ static void test_GetFirstMatchingFont(void)
IDWriteFontCollection_Release(collection);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_GetMatchingFonts(void)
@@ -4032,34 +4029,34 @@ static void test_GetMatchingFonts(void)
factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* out-of-range font props are allowed */
hr = IDWriteFontFamily_GetMatchingFonts(family, 1000, DWRITE_FONT_STRETCH_NORMAL,
DWRITE_FONT_STYLE_NORMAL, &fontlist);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontList_Release(fontlist);
hr = IDWriteFontFamily_GetMatchingFonts(family, DWRITE_FONT_WEIGHT_NORMAL, 10,
DWRITE_FONT_STYLE_NORMAL, &fontlist);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontList_Release(fontlist);
hr = IDWriteFontFamily_GetMatchingFonts(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL,
10, &fontlist);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontList_Release(fontlist);
hr = IDWriteFontFamily_GetMatchingFonts(family, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &fontlist);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetMatchingFonts(family, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &fontlist2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fontlist != fontlist2, "got %p, %p\n", fontlist, fontlist2);
IDWriteFontList_Release(fontlist2);
@@ -4074,23 +4071,23 @@ static void test_GetMatchingFonts(void)
font = (void*)0xdeadbeef;
hr = IDWriteFontList1_GetFont(fontlist1, ~0u, &font);
- ok(hr == E_FAIL, "got 0x%08x\n", hr);
+ ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
ok(font == NULL, "got %p\n", font);
font = (void*)0xdeadbeef;
hr = IDWriteFontList1_GetFont(fontlist1, count, &font);
- ok(hr == E_FAIL, "got 0x%08x\n", hr);
+ ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
ok(font == NULL, "got %p\n", font);
hr = IDWriteFontList1_GetFont(fontlist1, 0, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont3_Release(font);
hr = IDWriteFontList1_GetFontFaceReference(fontlist1, 0, &ref);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontList1_GetFontFaceReference(fontlist1, 0, &ref1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(ref != ref1, "got %p, %p\n", ref, ref1);
IDWriteFontFaceReference_Release(ref1);
@@ -4105,10 +4102,10 @@ static void test_GetMatchingFonts(void)
IDWriteFontSet1 *fontset, *fontset2;
hr = IDWriteFontList2_GetFontSet(fontlist3, &fontset);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontList2_GetFontSet(fontlist3, &fontset2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fontset != fontset2, "Unexpected instance.\n");
IDWriteFontSet1_Release(fontset2);
@@ -4124,7 +4121,7 @@ static void test_GetMatchingFonts(void)
IDWriteFontCollection_Release(collection);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_GetInformationalStrings(void)
@@ -4143,51 +4140,51 @@ static void test_GetInformationalStrings(void)
factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
exists = TRUE;
strings = (void *)0xdeadbeef;
hr = IDWriteFont_GetInformationalStrings(font, 0xdead, &strings, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(exists == FALSE, "got %d\n", exists);
ok(strings == NULL, "got %p\n", strings);
exists = TRUE;
strings = NULL;
hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_NONE, &strings, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(exists == FALSE, "got %d\n", exists);
exists = FALSE;
strings = NULL;
hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &strings, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(exists == TRUE, "got %d\n", exists);
/* strings instance is not reused */
strings2 = NULL;
hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &strings2, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(strings2 != strings, "got %p, %p\n", strings2, strings);
IDWriteLocalizedStrings_Release(strings);
IDWriteLocalizedStrings_Release(strings2);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
if (SUCCEEDED(hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (void **)&fontface3)))
{
hr = IDWriteFontFace3_GetInformationalStrings(fontface3, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES,
&strings, &exists);
- ok(hr == S_OK, "Failed to get info strings, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get info strings, hr %#lx.\n", hr);
IDWriteLocalizedStrings_Release(strings);
IDWriteFontFace3_Release(fontface3);
@@ -4201,7 +4198,7 @@ static void test_GetInformationalStrings(void)
IDWriteFontFamily_Release(family);
IDWriteFontCollection_Release(collection);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_GetGdiInterop(void)
@@ -4217,21 +4214,21 @@ static void test_GetGdiInterop(void)
interop = NULL;
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
interop2 = NULL;
hr = IDWriteFactory_GetGdiInterop(factory, &interop2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(interop == interop2, "got %p, %p\n", interop, interop2);
IDWriteGdiInterop_Release(interop2);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_ISOLATED, &IID_IDWriteFactory, (IUnknown**)&factory2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* each factory gets its own interop */
interop2 = NULL;
hr = IDWriteFactory_GetGdiInterop(factory2, &interop2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(interop != interop2, "got %p, %p\n", interop, interop2);
/* release factory - interop still works */
@@ -4245,13 +4242,13 @@ static void test_GetGdiInterop(void)
lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop2, &logfont, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
IDWriteGdiInterop_Release(interop2);
IDWriteGdiInterop_Release(interop);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void *map_font_file(const WCHAR *filename, DWORD *file_size)
@@ -4320,17 +4317,17 @@ static void test_CreateFontFaceFromHdc(void)
interop = NULL;
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Invalid HDC. */
fontface = (void*)0xdeadbeef;
hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop, NULL, &fontface);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(fontface == NULL, "got %p\n", fontface);
fontface = (void *)0xdeadbeef;
hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop, (HDC)0xdeadbeef, &fontface);
- ok(hr == E_FAIL, "got 0x%08x\n", hr);
+ ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
ok(fontface == NULL, "got %p\n", fontface);
memset(&logfont, 0, sizeof(logfont));
@@ -4346,17 +4343,17 @@ static void test_CreateFontFaceFromHdc(void)
fontface = NULL;
hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop, hdc, &fontface);
- ok(hr == S_OK, "Failed to create font face, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create font face, hr %#lx.\n", hr);
count = 1;
hr = IDWriteFontFace_GetFiles(fontface, &count, &file);
- ok(hr == S_OK, "Failed to get font files, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font files, hr %#lx.\n", hr);
hr = IDWriteFontFile_GetLoader(file, &loader);
- ok(hr == S_OK, "Failed to get file loader, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get file loader, hr %#lx.\n", hr);
hr = IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void **)&unk);
- ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Vista */, "Expected local loader, hr %#x.\n", hr);
+ ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Vista */, "Expected local loader, hr %#lx.\n", hr);
if (unk)
IUnknown_Release(unk);
@@ -4376,7 +4373,7 @@ static void test_CreateFontFaceFromHdc(void)
fontface = (void *)0xdeadbeef;
hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop, hdc, &fontface);
- ok(hr == DWRITE_E_FILEFORMAT || broken(hr == E_FAIL) /* Vista */, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_FILEFORMAT || broken(hr == E_FAIL) /* Vista */, "Unexpected hr %#lx.\n", hr);
ok(fontface == NULL, "got %p\n", fontface);
DeleteObject(SelectObject(hdc, oldhfont));
@@ -4389,7 +4386,7 @@ static void test_CreateFontFaceFromHdc(void)
num_fonts = 0;
resource = AddFontMemResourceEx(font_data, data_size, NULL, &num_fonts);
- ok(resource != NULL, "Failed to add memory resource font, %d.\n", GetLastError());
+ ok(resource != NULL, "Failed to add memory resource font, %ld.\n", GetLastError());
ok(num_fonts == 1, "Unexpected number of fonts.\n");
memset(&lf, 0, sizeof(lf));
@@ -4401,27 +4398,27 @@ static void test_CreateFontFaceFromHdc(void)
oldhfont = SelectObject(hdc, hfont);
hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop, hdc, &fontface);
- ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
count = 1;
hr = IDWriteFontFace_GetFiles(fontface, &count, &file);
- ok(hr == S_OK, "Failed to get font files, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font files, hr %#lx.\n", hr);
hr = IDWriteFontFile_GetLoader(file, &loader);
- ok(hr == S_OK, "Failed to get file loader, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get file loader, hr %#lx.\n", hr);
hr = IDWriteFactory_RegisterFontFileLoader(factory, loader);
- ok(hr == DWRITE_E_ALREADYREGISTERED, "Unexpected hr %#x.\n", hr);
+ ok(hr == DWRITE_E_ALREADYREGISTERED, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteInMemoryFontFileLoader, (void **)&unk);
- ok(hr == E_NOINTERFACE, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void **)&unk);
- ok(hr == E_NOINTERFACE, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
count = 0;
hr = IDWriteFontFile_GetReferenceKey(file, &refkey, &count);
- ok(hr == S_OK, "Failed to get ref key, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get ref key, hr %#lx.\n", hr);
ok(count > 0, "Unexpected key length %u.\n", count);
if (pGetFontRealizationInfo)
@@ -4436,43 +4433,43 @@ static void test_CreateFontFaceFromHdc(void)
win_skip("GetFontRealizationInfo() is not available.\n");
hr = IDWriteFontFileLoader_CreateStreamFromKey(loader, refkey, count, &stream);
- ok(hr == S_OK, "Failed to create file stream, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create file stream, hr %#lx.\n", hr);
hr = IDWriteFontFileLoader_CreateStreamFromKey(loader, refkey, count, &stream2);
- ok(hr == S_OK, "Failed to create file stream, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create file stream, hr %#lx.\n", hr);
ok(stream2 != stream, "Unexpected stream instance.\n");
IDWriteFontFileStream_Release(stream2);
dummy = 1;
hr = IDWriteFontFileLoader_CreateStreamFromKey(loader, &dummy, count, &stream2);
- ok(hr == S_OK, "Failed to create file stream, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create file stream, hr %#lx.\n", hr);
writetime = 1;
hr = IDWriteFontFileStream_GetLastWriteTime(stream2, &writetime);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
ok(writetime == 1, "Unexpected write time.\n");
IDWriteFontFileStream_Release(stream2);
hr = IDWriteFontFileStream_GetFileSize(stream, &size);
- ok(hr == S_OK, "Failed to get stream size, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get stream size, hr %#lx.\n", hr);
ok(size == data_size, "Unexpected stream size.\n");
hr = IDWriteFontFileStream_GetLastWriteTime(stream, &writetime);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
fragment_context = NULL;
hr = IDWriteFontFileStream_ReadFileFragment(stream, &fragment, 0, size, &fragment_context);
- ok(hr == S_OK, "Failed to read fragment, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to read fragment, hr %#lx.\n", hr);
ok(fragment_context != NULL, "Unexpected context %p.\n", fragment_context);
ok(fragment == fragment_context, "Unexpected data pointer %p, context %p.\n", fragment, fragment_context);
IDWriteFontFileStream_ReleaseFileFragment(stream, fragment_context);
hr = IDWriteFontFileStream_ReadFileFragment(stream, &fragment, 0, size + 1, &fragment_context);
- ok(FAILED(hr), "Unexpected hr %#x.\n", hr);
+ ok(FAILED(hr), "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFileStream_ReadFileFragment(stream, &fragment, size - 1, size / 2, &fragment_context);
- ok(FAILED(hr), "Unexpected hr %#x.\n", hr);
+ ok(FAILED(hr), "Unexpected hr %#lx.\n", hr);
IDWriteFontFileStream_Release(stream);
@@ -4482,7 +4479,7 @@ static void test_CreateFontFaceFromHdc(void)
IDWriteFontFace_Release(fontface);
ret = RemoveFontMemResourceEx(resource);
- ok(ret, "Failed to remove memory resource font, %d.\n", GetLastError());
+ ok(ret, "Failed to remove memory resource font, %ld.\n", GetLastError());
UnmapViewOfFile(font_data);
@@ -4492,7 +4489,7 @@ static void test_CreateFontFaceFromHdc(void)
DeleteDC(hdc);
IDWriteGdiInterop_Release(interop);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_GetSimulations(void)
@@ -4509,7 +4506,7 @@ static void test_GetSimulations(void)
factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&logfont, 0, sizeof(logfont));
logfont.lfHeight = 12;
@@ -4519,12 +4516,12 @@ static void test_GetSimulations(void)
lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
simulations = IDWriteFont_GetSimulations(font);
ok(simulations == DWRITE_FONT_SIMULATIONS_OBLIQUE, "got %d\n", simulations);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
simulations = IDWriteFontFace_GetSimulations(fontface);
ok(simulations == DWRITE_FONT_SIMULATIONS_OBLIQUE, "got %d\n", simulations);
IDWriteFontFace_Release(fontface);
@@ -4538,12 +4535,12 @@ static void test_GetSimulations(void)
lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
simulations = IDWriteFont_GetSimulations(font);
ok(simulations == DWRITE_FONT_SIMULATIONS_NONE, "got %d\n", simulations);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
simulations = IDWriteFontFace_GetSimulations(fontface);
ok(simulations == DWRITE_FONT_SIMULATIONS_NONE, "got %d\n", simulations);
IDWriteFontFace_Release(fontface);
@@ -4551,7 +4548,7 @@ static void test_GetSimulations(void)
IDWriteGdiInterop_Release(interop);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_GetFaceNames(void)
@@ -4572,7 +4569,7 @@ static void test_GetFaceNames(void)
factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&logfont, 0, sizeof(logfont));
logfont.lfHeight = 12;
@@ -4582,13 +4579,13 @@ static void test_GetFaceNames(void)
lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &strings);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &strings2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(strings != strings2, "got %p, %p\n", strings2, strings);
IDWriteLocalizedStrings_Release(strings2);
@@ -4598,42 +4595,42 @@ static void test_GetFaceNames(void)
index = 1;
exists = FALSE;
hr = IDWriteLocalizedStrings_FindLocaleName(strings, L"en-Us", &index, &exists);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(index == 0 && exists, "got %d, %d\n", index, exists);
count = 0;
hr = IDWriteLocalizedStrings_GetLocaleNameLength(strings, 1, &count);
- ok(hr == E_FAIL, "got 0x%08x\n", hr);
+ ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
ok(count == ~0, "got %d\n", count);
/* for simulated faces names are also simulated */
buffW[0] = 0;
hr = IDWriteLocalizedStrings_GetLocaleName(strings, 0, buffW, ARRAY_SIZE(buffW));
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(buffW, L"en-us"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW));
buffW[0] = 0;
hr = IDWriteLocalizedStrings_GetString(strings, 0, buffW, ARRAY_SIZE(buffW));
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(buffW, L"Oblique"), "got %s\n", wine_dbgstr_w(buffW));
IDWriteLocalizedStrings_Release(strings);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "Failed to create a font face, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a font face, hr %#lx.\n", hr);
if (SUCCEEDED(IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (void **)&fontface3)))
{
hr = IDWriteFontFace3_GetFaceNames(fontface3, &strings2);
- ok(hr == S_OK, "Failed to get face names, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get face names, hr %#lx.\n", hr);
hr = IDWriteFontFace3_GetFaceNames(fontface3, &strings3);
- ok(hr == S_OK, "Failed to get face names, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get face names, hr %#lx.\n", hr);
ok(strings2 != strings3, "Unexpected instance.\n");
IDWriteLocalizedStrings_Release(strings3);
buffW[0] = 0;
hr = IDWriteLocalizedStrings_GetString(strings2, 0, buffW, ARRAY_SIZE(buffW));
- ok(hr == S_OK, "Failed to get a string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get a string, hr %#lx.\n", hr);
ok(!lstrcmpW(buffW, L"Oblique"), "Unexpected name %s.\n", wine_dbgstr_w(buffW));
IDWriteLocalizedStrings_Release(strings2);
@@ -4647,7 +4644,7 @@ static void test_GetFaceNames(void)
IDWriteFont_Release(font);
IDWriteGdiInterop_Release(interop);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
struct local_refkey
@@ -4679,12 +4676,12 @@ static void test_TryGetFontTable(void)
factory = create_factory();
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
key = NULL;
size = 0;
hr = IDWriteFontFile_GetReferenceKey(file, (const void**)&key, &size);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(size != 0, "got %u\n", size);
ret = GetFileAttributesExW(path, GetFileExInfoStandard, &info);
@@ -4692,27 +4689,27 @@ static void test_TryGetFontTable(void)
ok(!memcmp(&info.ftLastWriteTime, &key->writetime, sizeof(key->writetime)), "got wrong write time\n");
hr = IDWriteFontFile_GetLoader(file, &loader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void**)&localloader);
IDWriteFontFileLoader_Release(loader);
hr = IDWriteLocalFontFileLoader_GetFilePathLengthFromKey(localloader, key, size, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(lstrlenW(key->name) == len, "path length %d\n", len);
hr = IDWriteLocalFontFileLoader_GetFilePathFromKey(localloader, key, size, buffW, ARRAY_SIZE(buffW));
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(buffW, key->name), "got %s, expected %s\n", wine_dbgstr_w(buffW), wine_dbgstr_w(key->name));
IDWriteLocalFontFileLoader_Release(localloader);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, 0, &fontface);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
exists = FALSE;
context = (void*)0xdeadbeef;
table = NULL;
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_CMAP_TAG, &table, &size, &context, &exists);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
ok(exists == TRUE, "got %d\n", exists);
ok(context == NULL && table != NULL, "cmap: context %p, table %p\n", context, table);
@@ -4720,7 +4717,7 @@ static void test_TryGetFontTable(void)
context2 = (void*)0xdeadbeef;
table2 = NULL;
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_CMAP_TAG, &table2, &size, &context2, &exists);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
ok(exists == TRUE, "got %d\n", exists);
ok(context2 == context && table2 == table, "cmap: context2 %p, table2 %p\n", context2, table2);
@@ -4732,14 +4729,14 @@ static void test_TryGetFontTable(void)
context = (void*)0xdeadbeef;
table = (void*)0xdeadbeef;
hr = IDWriteFontFace_TryGetFontTable(fontface, 0xabababab, &table, &size, &context, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(exists == FALSE, "got %d\n", exists);
ok(context == NULL && table == NULL, "got context %p, table pointer %p\n", context, table);
IDWriteFontFace_Release(fontface);
IDWriteFontFile_Release(file);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
DELETE_FONTFILE(path);
}
@@ -4761,17 +4758,17 @@ static void test_ConvertFontToLOGFONT(void)
interop = NULL;
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_GetSystemFontCollection(factory2, &collection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (0) { /* crashes on native */
IDWriteGdiInterop_ConvertFontToLOGFONT(interop, NULL, NULL, NULL);
@@ -4782,7 +4779,7 @@ if (0) { /* crashes on native */
memset(&logfont, 0xcc, sizeof(logfont));
system = TRUE;
hr = IDWriteGdiInterop_ConvertFontToLOGFONT(interop, NULL, &logfont, &system);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!system, "got %d\n", system);
ok(logfont.lfFaceName[0] == 0, "got face name %s\n", wine_dbgstr_w(logfont.lfFaceName));
@@ -4797,10 +4794,10 @@ if (0) { /* crashes on native */
LOGFONTW lf;
hr = IDWriteFontCollection_GetFontFamily(collection, i, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, familynameW, ARRAY_SIZE(familynameW));
IDWriteLocalizedStrings_Release(names);
@@ -4813,10 +4810,10 @@ if (0) { /* crashes on native */
BOOL has_variations;
hr = IDWriteFontFamily_GetFont(family, j, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &names);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, facenameW, ARRAY_SIZE(facenameW));
IDWriteLocalizedStrings_Release(names);
@@ -4826,7 +4823,7 @@ if (0) { /* crashes on native */
lstrcatW(nameW, facenameW);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
has_variations = has_face_variations(fontface);
IDWriteFontFace_Release(fontface);
@@ -4843,7 +4840,7 @@ if (0) { /* crashes on native */
system = FALSE;
memset(&logfont, 0xcc, sizeof(logfont));
hr = IDWriteGdiInterop_ConvertFontToLOGFONT(interop, font, &logfont, &system);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(system, "got %d\n", system);
sim = IDWriteFont_GetSimulations(font);
@@ -4851,7 +4848,7 @@ if (0) { /* crashes on native */
winetest_push_context("Font %s", wine_dbgstr_w(nameW));
get_logfont_from_font(font, &lf);
- ok(logfont.lfWeight == lf.lfWeight, "Unexpected lfWeight %d, expected lfWeight %d, font weight %d, "
+ ok(logfont.lfWeight == lf.lfWeight, "Unexpected lfWeight %ld, expected lfWeight %ld, font weight %d, "
"bold simulation %s.\n", logfont.lfWeight, lf.lfWeight, IDWriteFont_GetWeight(font),
sim & DWRITE_FONT_SIMULATIONS_BOLD ? "yes" : "no");
ok(logfont.lfItalic == lf.lfItalic, "Unexpected italic flag %d, oblique simulation %s.\n",
@@ -4879,7 +4876,7 @@ if (0) { /* crashes on native */
IDWriteFont_Release(font);
IDWriteGdiInterop_Release(interop);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_CreateStreamFromKey(void)
@@ -4901,25 +4898,25 @@ static void test_CreateStreamFromKey(void)
path = create_testfontfile(test_fontfile);
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
key = NULL;
size = 0;
hr = IDWriteFontFile_GetReferenceKey(file, (const void**)&key, &size);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(size != 0, "got %u\n", size);
hr = IDWriteFontFile_GetLoader(file, &loader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void**)&localloader);
IDWriteFontFileLoader_Release(loader);
hr = IDWriteLocalFontFileLoader_CreateStreamFromKey(localloader, key, size, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(stream, 1);
hr = IDWriteLocalFontFileLoader_CreateStreamFromKey(localloader, key, size, &stream2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(stream == stream2 || broken(stream != stream2) /* Win7 SP0 */, "got %p, %p\n", stream, stream2);
if (stream == stream2)
EXPECT_REF(stream, 2);
@@ -4927,12 +4924,12 @@ static void test_CreateStreamFromKey(void)
IDWriteFontFileStream_Release(stream2);
hr = IDWriteLocalFontFileLoader_CreateStreamFromKey(localloader, key, size, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(stream, 1);
writetime = 0;
hr = IDWriteFontFileStream_GetLastWriteTime(stream, &writetime);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(writetime != 0, "got %s\n", wine_dbgstr_longlong(writetime));
IDWriteFontFileStream_Release(stream);
@@ -4940,7 +4937,7 @@ static void test_CreateStreamFromKey(void)
IDWriteLocalFontFileLoader_Release(localloader);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
DELETE_FONTFILE(path);
}
@@ -4964,44 +4961,44 @@ static void test_ReadFileFragment(void)
path = create_testfontfile(test_fontfile);
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
key = NULL;
size = 0;
hr = IDWriteFontFile_GetReferenceKey(file, (const void**)&key, &size);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(size != 0, "got %u\n", size);
hr = IDWriteFontFile_GetLoader(file, &loader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void**)&localloader);
IDWriteFontFileLoader_Release(loader);
hr = IDWriteLocalFontFileLoader_CreateStreamFromKey(localloader, key, size, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFileStream_GetFileSize(stream, &filesize);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* reading past the end of the stream */
fragment = (void*)0xdeadbeef;
context = (void*)0xdeadbeef;
hr = IDWriteFontFileStream_ReadFileFragment(stream, &fragment, 0, filesize+1, &context);
- ok(hr == E_FAIL, "got 0x%08x\n", hr);
+ ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
ok(context == NULL, "got %p\n", context);
ok(fragment == NULL, "got %p\n", fragment);
fragment = (void*)0xdeadbeef;
context = (void*)0xdeadbeef;
hr = IDWriteFontFileStream_ReadFileFragment(stream, &fragment, 0, filesize, &context);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(context == NULL, "got %p\n", context);
ok(fragment != NULL, "got %p\n", fragment);
fragment2 = (void*)0xdeadbeef;
context2 = (void*)0xdeadbeef;
hr = IDWriteFontFileStream_ReadFileFragment(stream, &fragment2, 0, filesize, &context2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(context2 == NULL, "got %p\n", context2);
ok(fragment == fragment2, "got %p, %p\n", fragment, fragment2);
@@ -5012,7 +5009,7 @@ static void test_ReadFileFragment(void)
fragment = (void*)0xdeadbeef;
context = (void*)0xdeadbeef;
hr = IDWriteFontFileStream_ReadFileFragment(stream, &fragment, 0, filesize, &context);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(context == NULL, "got %p\n", context);
ok(fragment == fragment2, "got %p, %p\n", fragment, fragment2);
IDWriteFontFileStream_ReleaseFileFragment(stream, context);
@@ -5021,7 +5018,7 @@ static void test_ReadFileFragment(void)
IDWriteFontFileStream_Release(stream);
IDWriteLocalFontFileLoader_Release(localloader);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
DELETE_FONTFILE(path);
}
@@ -5042,39 +5039,39 @@ static void test_GetDesignGlyphMetrics(void)
path = create_testfontfile(test_fontfile);
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file,
0, DWRITE_FONT_SIMULATIONS_NONE, &fontface);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
IDWriteFontFile_Release(file);
codepoint = 'A';
indices[0] = 0;
hr = IDWriteFontFace_GetGlyphIndices(fontface, &codepoint, 1, &indices[0]);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(indices[0] > 0, "got %u\n", indices[0]);
hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, NULL, 0, metrics, FALSE);
- ok(hr == E_INVALIDARG, "got 0x%08x\n",hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, NULL, 1, metrics, FALSE);
- ok(hr == E_INVALIDARG, "got 0x%08x\n",hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, indices, 0, metrics, FALSE);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
/* missing glyphs are ignored */
indices[1] = 1;
memset(metrics, 0xcc, sizeof(metrics));
hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, indices, 2, metrics, FALSE);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
ok(metrics[0].advanceWidth == 1000, "got %d\n", metrics[0].advanceWidth);
ok(metrics[1].advanceWidth == 0, "got %d\n", metrics[1].advanceWidth);
IDWriteFontFace_Release(fontface);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
DELETE_FONTFILE(path);
}
@@ -5088,7 +5085,7 @@ static BOOL get_expected_is_monospaced(IDWriteFontFace1 *fontface, const DWRITE_
hr = IDWriteFontFace1_TryGetFontTable(fontface, MS_POST_TAG, (const void **)&tt_post, &size,
&post_context, &exists);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (tt_post)
{
@@ -5119,7 +5116,7 @@ static void test_IsMonospacedFont(void)
}
hr = IDWriteFactory1_GetSystemFontCollection(factory, &collection, FALSE);
- ok(hr == S_OK, "Failed to get font collection, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font collection, hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(collection);
for (i = 0; i < count; ++i)
@@ -5130,10 +5127,10 @@ static void test_IsMonospacedFont(void)
WCHAR nameW[256];
hr = IDWriteFontCollection_GetFontFamily(collection, i, &family);
- ok(hr == S_OK, "Failed to get family, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get family, hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "Failed to get names, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get names, hr %#lx.\n", hr);
get_enus_string(names, nameW, ARRAY_SIZE(nameW));
IDWriteLocalizedStrings_Release(names);
@@ -5149,17 +5146,17 @@ static void test_IsMonospacedFont(void)
IDWriteFont *font;
hr = IDWriteFontFamily_GetFont(family, j, &font);
- ok(hr == S_OK, "Failed to get font, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font, hr %#lx.\n", hr);
hr = IDWriteFont_QueryInterface(font, &IID_IDWriteFont1, (void **)&font1);
- ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr);
IDWriteFont_Release(font);
hr = IDWriteFont1_CreateFontFace(font1, &fontface);
- ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void **)&fontface1);
- ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr);
IDWriteFontFace_Release(fontface);
is_monospaced_font = IDWriteFont1_IsMonospacedFont(font1);
@@ -5181,7 +5178,7 @@ static void test_IsMonospacedFont(void)
IDWriteFontCollection_Release(collection);
ref = IDWriteFactory1_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_GetDesignGlyphAdvances(void)
@@ -5199,11 +5196,11 @@ static void test_GetDesignGlyphAdvances(void)
path = create_testfontfile(test_fontfile);
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file,
0, DWRITE_FONT_SIMULATIONS_NONE, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(file);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1);
@@ -5215,17 +5212,17 @@ static void test_GetDesignGlyphAdvances(void)
codepoint = 'A';
index = 0;
hr = IDWriteFontFace1_GetGlyphIndices(fontface1, &codepoint, 1, &index);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(index > 0, "got %u\n", index);
advance = 0;
hr = IDWriteFontFace1_GetDesignGlyphAdvances(fontface1, 1, &index, &advance, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(advance == 1000, "got %i\n", advance);
advance = 0;
hr = IDWriteFontFace1_GetDesignGlyphAdvances(fontface1, 1, &index, &advance, TRUE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine
ok(advance == 2048, "got %i\n", advance);
@@ -5236,7 +5233,7 @@ static void test_GetDesignGlyphAdvances(void)
IDWriteFontFace_Release(fontface);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
DELETE_FONTFILE(path);
}
@@ -5257,24 +5254,24 @@ static void test_GetGlyphRunOutline(void)
factory = create_factory();
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "got 0x%08x\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &face);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(file);
codepoint = 'A';
glyphs[0] = 0;
hr = IDWriteFontFace_GetGlyphIndices(face, &codepoint, 1, glyphs);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(glyphs[0] > 0, "got %u\n", glyphs[0]);
glyphs[1] = glyphs[0];
hr = IDWriteFontFace_GetGlyphRunOutline(face, 2048.0, glyphs, advances, offsets, 1, FALSE, FALSE, NULL);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_GetGlyphRunOutline(face, 2048.0, NULL, NULL, offsets, 1, FALSE, FALSE, &test_geomsink);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
advances[0] = 1.0;
advances[1] = 0.0;
@@ -5289,7 +5286,7 @@ static void test_GetGlyphRunOutline(void)
g_startpoint_count = 0;
SET_EXPECT(setfillmode);
hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, NULL, 2, FALSE, FALSE, &test_geomsink);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(g_startpoint_count == 2, "got %d\n", g_startpoint_count);
if (g_startpoint_count == 2) {
/* glyph advance of 500 is applied */
@@ -5303,7 +5300,7 @@ static void test_GetGlyphRunOutline(void)
g_startpoint_count = 0;
SET_EXPECT(setfillmode);
hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, NULL, 2, FALSE, TRUE, &test_geomsink);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(g_startpoint_count == 2, "got %d\n", g_startpoint_count);
if (g_startpoint_count == 2) {
/* advance is -500 now */
@@ -5317,7 +5314,7 @@ static void test_GetGlyphRunOutline(void)
g_startpoint_count = 0;
SET_EXPECT(setfillmode);
hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, offsets, 2, FALSE, FALSE, &test_geomsink);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(g_startpoint_count == 2, "got %d\n", g_startpoint_count);
if (g_startpoint_count == 2) {
/* offsets applied to first contour */
@@ -5331,7 +5328,7 @@ static void test_GetGlyphRunOutline(void)
g_startpoint_count = 0;
SET_EXPECT(setfillmode);
hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, offsets, 2, FALSE, TRUE, &test_geomsink);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(g_startpoint_count == 2, "got %d\n", g_startpoint_count);
if (g_startpoint_count == 2) {
ok(g_startpoints[0].x == -271.5 && g_startpoints[0].y == -630.0, "0: got (%.2f,%.2f)\n", g_startpoints[0].x, g_startpoints[0].y);
@@ -5344,7 +5341,7 @@ static void test_GetGlyphRunOutline(void)
g_startpoint_count = 0;
SET_EXPECT(setfillmode);
hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, advances, offsets, 2, FALSE, FALSE, &test_geomsink);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(g_startpoint_count == 2, "got %d\n", g_startpoint_count);
if (g_startpoint_count == 2) {
ok(g_startpoints[0].x == 230.5 && g_startpoints[0].y == -630.0, "0: got (%.2f,%.2f)\n", g_startpoints[0].x, g_startpoints[0].y);
@@ -5354,18 +5351,18 @@ static void test_GetGlyphRunOutline(void)
/* 0 glyph count */
hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, NULL, 0, FALSE, FALSE, &test_geomsink2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Glyph with open figure, single contour point. */
codepoint = 'B';
glyphs[0] = 0;
hr = IDWriteFontFace_GetGlyphIndices(face, &codepoint, 1, glyphs);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(glyphs[0] > 0, "got %u\n", glyphs[0]);
SET_EXPECT(setfillmode);
hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, NULL, 1, FALSE, FALSE, &test_geomsink2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_CALLED(setfillmode);
IDWriteFactory_Release(factory);
@@ -5379,17 +5376,17 @@ static void test_GetGlyphRunOutline(void)
codepoint = ' ';
glyphs[0] = 0;
hr = IDWriteFontFace_GetGlyphIndices(face, &codepoint, 1, glyphs);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(glyphs[0] > 0, "got %u\n", glyphs[0]);
SET_EXPECT(setfillmode);
hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, NULL, 1, FALSE, FALSE, &test_geomsink2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_CALLED(setfillmode);
IDWriteFontFace_Release(face);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_GetEudcFontCollection(void)
@@ -5407,17 +5404,17 @@ static void test_GetEudcFontCollection(void)
EXPECT_REF(factory, 1);
hr = IDWriteFactory1_GetEudcFontCollection(factory, &coll, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(factory, 2);
hr = IDWriteFactory1_GetEudcFontCollection(factory, &coll2, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(factory, 2);
ok(coll == coll2, "got %p, %p\n", coll, coll2);
IDWriteFontCollection_Release(coll);
IDWriteFontCollection_Release(coll2);
ref = IDWriteFactory1_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_GetCaretMetrics(void)
@@ -5437,10 +5434,10 @@ static void test_GetCaretMetrics(void)
factory = create_factory();
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(file);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1);
@@ -5448,7 +5445,7 @@ static void test_GetCaretMetrics(void)
if (hr != S_OK) {
win_skip("GetCaretMetrics() is not supported.\n");
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
DELETE_FONTFILE(path);
return;
}
@@ -5465,10 +5462,10 @@ static void test_GetCaretMetrics(void)
factory = create_factory();
font = get_tahoma_instance(factory, DWRITE_FONT_STYLE_NORMAL);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace_Release(fontface);
memset(&caret, 0xcc, sizeof(caret));
@@ -5481,10 +5478,10 @@ static void test_GetCaretMetrics(void)
/* simulated italic */
font = get_tahoma_instance(factory, DWRITE_FONT_STYLE_ITALIC);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace_Release(fontface);
IDWriteFontFace1_GetMetrics(fontface1, &metrics);
@@ -5497,7 +5494,7 @@ static void test_GetCaretMetrics(void)
IDWriteFontFace1_Release(fontface1);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
DELETE_FONTFILE(path);
}
@@ -5515,10 +5512,10 @@ static void test_GetGlyphCount(void)
factory = create_factory();
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(file);
count = IDWriteFontFace_GetGlyphCount(fontface);
@@ -5526,7 +5523,7 @@ static void test_GetGlyphCount(void)
IDWriteFontFace_Release(fontface);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
DELETE_FONTFILE(path);
}
@@ -5544,10 +5541,10 @@ static void test_GetKerningPairAdjustments(void)
factory = create_factory();
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(file);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1);
@@ -5555,14 +5552,14 @@ static void test_GetKerningPairAdjustments(void)
INT32 adjustments[1];
hr = IDWriteFontFace1_GetKerningPairAdjustments(fontface1, 0, NULL, NULL);
- ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "Unexpected hr %#lx.\n", hr);
if (0) /* crashes on native */
hr = IDWriteFontFace1_GetKerningPairAdjustments(fontface1, 1, NULL, NULL);
adjustments[0] = 1;
hr = IDWriteFontFace1_GetKerningPairAdjustments(fontface1, 1, NULL, adjustments);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(adjustments[0] == 0, "got %d\n", adjustments[0]);
IDWriteFontFace1_Release(fontface1);
@@ -5572,7 +5569,7 @@ static void test_GetKerningPairAdjustments(void)
IDWriteFontFace_Release(fontface);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
DELETE_FONTFILE(path);
}
@@ -5591,7 +5588,7 @@ static void test_CreateRenderingParams(void)
hr = IDWriteFactory_CreateCustomRenderingParams(factory, 1.0, 0.0, 0.0, DWRITE_PIXEL_GEOMETRY_FLAT,
DWRITE_RENDERING_MODE_DEFAULT, ¶ms);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteRenderingParams_QueryInterface(params, &IID_IDWriteRenderingParams1, (void**)¶ms1);
if (hr == S_OK) {
@@ -5621,7 +5618,7 @@ static void test_CreateRenderingParams(void)
IDWriteRenderingParams_Release(params);
hr = IDWriteFactory_CreateRenderingParams(factory, ¶ms);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
mode = IDWriteRenderingParams_GetRenderingMode(params);
ok(mode == DWRITE_RENDERING_MODE_DEFAULT, "got %d\n", mode);
@@ -5633,10 +5630,10 @@ static void test_CreateRenderingParams(void)
hr = IDWriteFactory3_CreateCustomRenderingParams(factory3, 1.0f, 0.0f, 0.0f, 1.0f, DWRITE_PIXEL_GEOMETRY_FLAT,
DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED, DWRITE_GRID_FIT_MODE_DEFAULT, ¶ms3);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteRenderingParams3_QueryInterface(params3, &IID_IDWriteRenderingParams, (void**)¶ms);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
mode = IDWriteRenderingParams_GetRenderingMode(params);
ok(mode == DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, "got %d\n", mode);
@@ -5649,7 +5646,7 @@ static void test_CreateRenderingParams(void)
win_skip("IDWriteRenderingParams3 not supported.\n");
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_CreateGlyphRunAnalysis(void)
@@ -5689,11 +5686,11 @@ static void test_CreateGlyphRunAnalysis(void)
ch = 'A';
glyph = 0;
hr = IDWriteFontFace_GetGlyphIndices(face, &ch, 1, &glyph);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(glyph > 0, "got %u\n", glyph);
hr = IDWriteFontFace_GetDesignGlyphMetrics(face, &glyph, 1, &metrics, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
advances[0] = metrics.advanceWidth;
offsets[0].advanceOffset = 0.0;
@@ -5713,7 +5710,7 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 0.0, NULL,
DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(analysis == NULL, "got %p\n", analysis);
/* negative ppdip */
@@ -5721,7 +5718,7 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, -1.0, NULL,
DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(analysis == NULL, "got %p\n", analysis);
/* default mode is not allowed */
@@ -5729,7 +5726,7 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL,
DWRITE_RENDERING_MODE_DEFAULT, DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(analysis == NULL, "got %p\n", analysis);
/* outline too */
@@ -5737,25 +5734,25 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL,
DWRITE_RENDERING_MODE_OUTLINE, DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(analysis == NULL, "got %p\n", analysis);
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL,
DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* invalid texture type */
memset(&rect, 0xcc, sizeof(rect));
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1+1, &rect);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(rect.left == 0 && rect.right == 0 &&
rect.top == 0 && rect.bottom == 0, "unexpected rect\n");
/* check how origin affects bounds */
SetRectEmpty(&rect);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!IsRectEmpty(&rect), "got empty rect\n");
IDWriteGlyphRunAnalysis_Release(analysis);
@@ -5763,10 +5760,10 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 2.0, NULL,
DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect2);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(rect.right - rect.left < rect2.right - rect2.left, "expected wider rect\n");
ok(rect.bottom - rect.top < rect2.bottom - rect2.top, "expected taller rect\n");
IDWriteGlyphRunAnalysis_Release(analysis);
@@ -5774,11 +5771,11 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL,
DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL,
10.0, -5.0, &analysis);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect2);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!IsRectEmpty(&rect2), "got empty rect\n");
IDWriteGlyphRunAnalysis_Release(analysis);
@@ -5790,28 +5787,28 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL,
rendermodes[i], DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (rendermodes[i] == DWRITE_RENDERING_MODE_ALIASED) {
SetRectEmpty(&rect);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!IsRectEmpty(&rect), "got empty rect\n");
SetRect(&rect, 0, 0, 1, 1);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(IsRectEmpty(&rect), "unexpected empty rect\n");
}
else {
SetRect(&rect, 0, 0, 1, 1);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(IsRectEmpty(&rect), "got empty rect\n");
SetRectEmpty(&rect);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!IsRectEmpty(&rect), "got empty rect\n");
}
@@ -5828,15 +5825,15 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL,
DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_GDI_CLASSIC,
0.0, 0.0, &analysis);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_GetGdiCompatibleGlyphMetrics(run.fontFace, run.fontEmSize, 1.0, NULL,
DWRITE_MEASURING_MODE_GDI_CLASSIC, run.glyphIndices, 1, &gm, run.isSideways);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* metrics are in design units */
bboxX = (int)floorf((gm.advanceWidth - gm.leftSideBearing - gm.rightSideBearing) * run.fontEmSize / fm.designUnitsPerEm + 0.5f);
@@ -5844,8 +5841,8 @@ static void test_CreateGlyphRunAnalysis(void)
rect.right -= rect.left;
rect.bottom -= rect.top;
- ok(abs(bboxX - rect.right) <= 2, "%.0f: bbox width %d, from metrics %d\n", run.fontEmSize, rect.right, bboxX);
- ok(abs(bboxY - rect.bottom) <= 2, "%.0f: bbox height %d, from metrics %d\n", run.fontEmSize, rect.bottom, bboxY);
+ ok(abs(bboxX - rect.right) <= 2, "%.0f: bbox width %ld, from metrics %ld\n", run.fontEmSize, rect.right, bboxX);
+ ok(abs(bboxY - rect.bottom) <= 2, "%.0f: bbox height %ld, from metrics %ld\n", run.fontEmSize, rect.bottom, bboxY);
IDWriteGlyphRunAnalysis_Release(analysis);
}
@@ -5863,11 +5860,11 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL,
DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!IsRectEmpty(&rect), "got empty bounds\n");
IDWriteGlyphRunAnalysis_Release(analysis);
@@ -5885,11 +5882,11 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL,
DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!IsRectEmpty(&rect), "got empty bounds\n");
IDWriteGlyphRunAnalysis_Release(analysis);
@@ -5909,37 +5906,37 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL,
DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect2);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!IsRectEmpty(&rect2), "got empty bounds\n");
ok(!EqualRect(&rect, &rect2), "got wrong rect2\n");
- ok((rect2.right - rect.left) > advances[0], "got rect width %d for advance %f\n", rect.right - rect.left, advances[0]);
+ ok((rect2.right - rect.left) > advances[0], "got rect width %ld for advance %f\n", rect.right - rect.left, advances[0]);
IDWriteGlyphRunAnalysis_Release(analysis);
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 2.0, NULL,
DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok((rect.right - rect.left) > 2 * advances[0], "got rect width %d for advance %f\n", rect.right - rect.left, advances[0]);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok((rect.right - rect.left) > 2 * advances[0], "got rect width %ld for advance %f\n", rect.right - rect.left, advances[0]);
IDWriteGlyphRunAnalysis_Release(analysis);
/* with scaling transform */
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL,
DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(!IsRectEmpty(&rect), "got rect width %d\n", rect.right - rect.left);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!IsRectEmpty(&rect), "got rect width %ld\n", rect.right - rect.left);
IDWriteGlyphRunAnalysis_Release(analysis);
memset(&m, 0, sizeof(m));
@@ -5948,18 +5945,18 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, &m,
DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect2);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok((rect2.right - rect2.left) > (rect.right - rect.left), "got rect width %d\n", rect2.right - rect2.left);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok((rect2.right - rect2.left) > (rect.right - rect.left), "got rect width %ld\n", rect2.right - rect2.left);
/* instances are not reused for same runs */
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, &m,
DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(analysis2 != analysis, "got %p, previous instance %p\n", analysis2, analysis);
IDWriteGlyphRunAnalysis_Release(analysis2);
@@ -5972,31 +5969,31 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteFactory2_CreateGlyphRunAnalysis(factory2, &run, NULL, DWRITE_RENDERING_MODE_ALIASED,
DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_DEFAULT, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE + 1,
0.0f, 0.0f, &analysis);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Invalid grid fit mode. */
hr = IDWriteFactory2_CreateGlyphRunAnalysis(factory2, &run, NULL, DWRITE_RENDERING_MODE_ALIASED,
DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_ENABLED + 1, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE,
0.0f, 0.0f, &analysis);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Invalid rendering mode. */
hr = IDWriteFactory2_CreateGlyphRunAnalysis(factory2, &run, NULL, DWRITE_RENDERING_MODE_OUTLINE,
DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_ENABLED, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE,
0.0f, 0.0f, &analysis);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Invalid measuring mode. */
hr = IDWriteFactory2_CreateGlyphRunAnalysis(factory2, &run, NULL, DWRITE_RENDERING_MODE_ALIASED,
DWRITE_MEASURING_MODE_GDI_NATURAL + 1, DWRITE_GRID_FIT_MODE_ENABLED, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE,
0.0f, 0.0f, &analysis);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Win8 does not accept default grid fitting mode. */
hr = IDWriteFactory2_CreateGlyphRunAnalysis(factory2, &run, NULL, DWRITE_RENDERING_MODE_NATURAL,
DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_DEFAULT, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE,
0.0f, 0.0f, &analysis);
- ok(hr == S_OK || broken(hr == E_INVALIDARG) /* Win8 */, "Failed to create analysis, hr %#x.\n", hr);
+ ok(hr == S_OK || broken(hr == E_INVALIDARG) /* Win8 */, "Failed to create analysis, hr %#lx.\n", hr);
if (hr == S_OK)
IDWriteGlyphRunAnalysis_Release(analysis);
@@ -6004,42 +6001,42 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteFactory2_CreateGlyphRunAnalysis(factory2, &run, NULL, DWRITE_RENDERING_MODE_NATURAL,
DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_DISABLED, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE,
0.0f, 0.0f, &analysis);
- ok(hr == S_OK, "Failed to create analysis, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create analysis, hr %#lx.\n", hr);
SetRect(&rect, 0, 1, 0, 1);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect);
- ok(hr == S_OK, "Failed to get texture bounds, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get texture bounds, hr %#lx.\n", hr);
ok(IsRectEmpty(&rect), "Expected empty bbox.\n");
SetRectEmpty(&rect);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect);
- ok(hr == S_OK, "Failed to get texture bounds, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get texture bounds, hr %#lx.\n", hr);
ok(!IsRectEmpty(&rect), "Unexpected empty bbox.\n");
size = (rect.right - rect.left) * (rect.bottom - rect.top);
bits = malloc(size);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect, bits, size);
- ok(hr == S_OK, "Failed to get alpha texture, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get alpha texture, hr %#lx.\n", hr);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect, bits, size - 1);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect, bits, size);
- ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#x.\n", hr);
+ ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect, bits, size - 1);
todo_wine
- ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#x.\n", hr);
+ ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#lx.\n", hr);
free(bits);
hr = IDWriteFactory_CreateCustomRenderingParams(factory, 0.1f, 0.0f, 1.0f, DWRITE_PIXEL_GEOMETRY_FLAT,
DWRITE_RENDERING_MODE_NATURAL, ¶ms);
- ok(hr == S_OK, "Failed to create custom parameters, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create custom parameters, hr %#lx.\n", hr);
hr = IDWriteGlyphRunAnalysis_GetAlphaBlendParams(analysis, params, &gamma, &contrast, &cleartype_level);
- ok(hr == S_OK, "Failed to get alpha blend params, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get alpha blend params, hr %#lx.\n", hr);
todo_wine
ok(cleartype_level == 0.0f, "Unexpected cleartype level %f.\n", cleartype_level);
@@ -6055,63 +6052,63 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteFactory3_CreateGlyphRunAnalysis(factory3, &run, NULL, DWRITE_RENDERING_MODE1_ALIASED,
DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_DEFAULT, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE + 1,
0.0f, 0.0f, &analysis);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Invalid grid fit mode. */
hr = IDWriteFactory3_CreateGlyphRunAnalysis(factory3, &run, NULL, DWRITE_RENDERING_MODE1_ALIASED,
DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_ENABLED + 1, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE,
0.0f, 0.0f, &analysis);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Invalid rendering mode. */
hr = IDWriteFactory3_CreateGlyphRunAnalysis(factory3, &run, NULL, DWRITE_RENDERING_MODE1_OUTLINE,
DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_ENABLED, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE,
0.0f, 0.0f, &analysis);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Invalid measuring mode. */
hr = IDWriteFactory3_CreateGlyphRunAnalysis(factory3, &run, NULL, DWRITE_RENDERING_MODE1_ALIASED,
DWRITE_MEASURING_MODE_GDI_NATURAL + 1, DWRITE_GRID_FIT_MODE_ENABLED,
DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE, 0.0f, 0.0f, &analysis);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory3_CreateGlyphRunAnalysis(factory3, &run, NULL, DWRITE_RENDERING_MODE1_NATURAL,
DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_DEFAULT, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE,
0.0f, 0.0f, &analysis);
- ok(hr == S_OK, "Failed to create analysis, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create analysis, hr %#lx.\n", hr);
IDWriteGlyphRunAnalysis_Release(analysis);
/* Natural mode, grayscale antialiased. */
hr = IDWriteFactory3_CreateGlyphRunAnalysis(factory3, &run, NULL, DWRITE_RENDERING_MODE1_NATURAL,
DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_DISABLED, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE,
0.0f, 0.0f, &analysis);
- ok(hr == S_OK, "Failed to create analysis, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create analysis, hr %#lx.\n", hr);
SetRect(&rect, 0, 1, 0, 1);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect);
- ok(hr == S_OK, "Failed to get texture bounds, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get texture bounds, hr %#lx.\n", hr);
ok(IsRectEmpty(&rect), "Expected empty bbox.\n");
SetRectEmpty(&rect);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect);
- ok(hr == S_OK, "Failed to get texture bounds, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get texture bounds, hr %#lx.\n", hr);
ok(!IsRectEmpty(&rect), "Unexpected empty bbox.\n");
size = (rect.right - rect.left) * (rect.bottom - rect.top);
bits = malloc(size);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect, bits, size);
- ok(hr == S_OK, "Failed to get alpha texture, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get alpha texture, hr %#lx.\n", hr);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect, bits, size - 1);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect, bits, size);
- ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#x.\n", hr);
+ ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect, bits, size - 1);
todo_wine
- ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#x.\n", hr);
+ ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#lx.\n", hr);
free(bits);
@@ -6122,7 +6119,7 @@ static void test_CreateGlyphRunAnalysis(void)
IDWriteFontFace_Release(face);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
#define round(x) ((int)floor((x) + 0.5))
@@ -6312,7 +6309,7 @@ static void get_expected_metrics(IDWriteFontFace *fontface, struct compatmetrics
memset(expected, 0, sizeof(*expected));
hr = IDWriteFontFace_GetGdiCompatibleMetrics(fontface, ptr->ppdip * fabsf(ptr->m.m22) * ptr->emsize, 1.0, NULL, expected);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "got %08lx\n", hr);
}
static void test_gdicompat_metrics(IDWriteFontFace *face)
@@ -6352,26 +6349,26 @@ static void test_gdicompat_metrics(IDWriteFontFace *face)
memset(&comp_metrics, 0xcc, sizeof(comp_metrics));
memset(&expected, 0, sizeof(expected));
hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, -10.0, 1.0, NULL, &comp_metrics);
- ok(hr == E_INVALIDARG, "got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "got %08lx\n", hr);
test_metrics_cmp(0.0, &comp_metrics, &expected);
/* zero emsize */
memset(&comp_metrics, 0xcc, sizeof(comp_metrics));
memset(&expected, 0, sizeof(expected));
hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, 0.0, 1.0, NULL, &comp_metrics);
- ok(hr == E_INVALIDARG, "got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "got %08lx\n", hr);
test_metrics_cmp(0.0, &comp_metrics, &expected);
/* zero pixels per dip */
memset(&comp_metrics, 0xcc, sizeof(comp_metrics));
memset(&expected, 0, sizeof(expected));
hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, 5.0, 0.0, NULL, &comp_metrics);
- ok(hr == E_INVALIDARG, "got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "got %08lx\n", hr);
test_metrics_cmp(5.0, &comp_metrics, &expected);
memset(&comp_metrics, 0xcc, sizeof(comp_metrics));
hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, 5.0, -1.0, NULL, &comp_metrics);
- ok(hr == E_INVALIDARG, "got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "got %08lx\n", hr);
test_metrics_cmp(5.0, &comp_metrics, &expected);
for (i = 0; i < ARRAY_SIZE(compatmetrics_tests); i++) {
@@ -6379,7 +6376,7 @@ static void test_gdicompat_metrics(IDWriteFontFace *face)
get_expected_metrics(face, ptr, (DWRITE_FONT_METRICS*)&expected);
hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, ptr->emsize, ptr->ppdip, &ptr->m, &comp_metrics);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "got %08lx\n", hr);
test_metrics_cmp(ptr->emsize, &comp_metrics, &expected);
}
@@ -6389,11 +6386,11 @@ static void test_gdicompat_metrics(IDWriteFontFace *face)
if (fontface1) {
hr = IDWriteFontFace1_GetGdiCompatibleMetrics(fontface1, emsize, 1.0, NULL, &comp_metrics1);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "got %08lx\n", hr);
}
else {
hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, emsize, 1.0, NULL, &comp_metrics);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "got %08lx\n", hr);
}
scale = emsize / design_metrics.designUnitsPerEm;
@@ -6458,7 +6455,7 @@ static void test_GetGdiCompatibleMetrics(void)
font = get_font(factory, L"Tahoma", DWRITE_FONT_STYLE_NORMAL);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
test_gdicompat_metrics(fontface);
IDWriteFontFace_Release(fontface);
@@ -6469,7 +6466,7 @@ static void test_GetGdiCompatibleMetrics(void)
else
{
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
test_gdicompat_metrics(fontface);
@@ -6477,7 +6474,7 @@ static void test_GetGdiCompatibleMetrics(void)
}
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void get_expected_panose(IDWriteFont1 *font, DWRITE_PANOSE *panose)
@@ -6492,10 +6489,10 @@ static void get_expected_panose(IDWriteFont1 *font, DWRITE_PANOSE *panose)
memset(panose, 0, sizeof(*panose));
hr = IDWriteFont1_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_OS2_TAG, (const void **)&tt_os2, &size, &os2_context, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (tt_os2) {
memcpy(panose, &tt_os2->panose, sizeof(*panose));
@@ -6523,14 +6520,14 @@ static void test_GetPanose(void)
if (FAILED(hr)) {
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
win_skip("GetPanose() is not supported.\n");
return;
}
IDWriteFont1_Release(font1);
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < count; i++) {
@@ -6544,18 +6541,18 @@ static void test_GetPanose(void)
WCHAR nameW[256];
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL,
DWRITE_FONT_STYLE_NORMAL, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_QueryInterface(font, &IID_IDWriteFont1, (void **)&font1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, nameW, ARRAY_SIZE(nameW));
@@ -6590,7 +6587,7 @@ static void test_GetPanose(void)
winetest_pop_context();
hr = IDWriteFont1_CreateFontFace(font1, &fontface);
- ok(hr == S_OK, "Failed to create a font face, %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a font face, %#lx.\n", hr);
if (IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (void **)&fontface3) == S_OK) {
ok(!memcmp(&panose, &expected_panose, sizeof(panose)), "%s: Unexpected panose from font face.\n",
wine_dbgstr_w(nameW));
@@ -6604,7 +6601,7 @@ static void test_GetPanose(void)
IDWriteFontCollection_Release(syscollection);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static INT32 get_gdi_font_advance(HDC hdc, FLOAT emsize)
@@ -6650,7 +6647,7 @@ static void test_GetGdiCompatibleGlyphAdvances(void)
font = get_tahoma_instance(factory, DWRITE_FONT_STYLE_NORMAL);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void **)&fontface1);
@@ -6658,7 +6655,7 @@ static void test_GetGdiCompatibleGlyphAdvances(void)
if (hr != S_OK) {
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
win_skip("GetGdiCompatibleGlyphAdvances() is not supported\n");
return;
}
@@ -6666,35 +6663,35 @@ static void test_GetGdiCompatibleGlyphAdvances(void)
codepoint = 'A';
glyph = 0;
hr = IDWriteFontFace1_GetGlyphIndices(fontface1, &codepoint, 1, &glyph);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(glyph > 0, "got %u\n", glyph);
/* zero emsize */
advance = 1;
hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, 0.0,
1.0, NULL, FALSE, FALSE, 1, &glyph, &advance);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(advance == 0, "got %d\n", advance);
/* negative emsize */
advance = 1;
hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, -1.0,
1.0, NULL, FALSE, FALSE, 1, &glyph, &advance);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(advance == 0, "got %d\n", advance);
/* zero ppdip */
advance = 1;
hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, 1.0,
0.0, NULL, FALSE, FALSE, 1, &glyph, &advance);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(advance == 0, "got %d\n", advance);
/* negative ppdip */
advance = 1;
hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, 1.0,
-1.0, NULL, FALSE, FALSE, 1, &glyph, &advance);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(advance == 0, "got %d\n", advance);
IDWriteFontFace1_GetMetrics(fontface1, &fm);
@@ -6707,7 +6704,7 @@ static void test_GetGdiCompatibleGlyphAdvances(void)
gdi_advance = get_gdi_font_advance(hdc, emsize);
hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, emsize,
1.0, NULL, FALSE, FALSE, 1, &glyph, &advance);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* advance is in design units */
advance = (int)floorf(emsize * advance / fm.designUnitsPerEm + 0.5f);
@@ -6718,7 +6715,7 @@ static void test_GetGdiCompatibleGlyphAdvances(void)
IDWriteFontFace1_Release(fontface1);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static WORD get_gasp_flags(IDWriteFontFace *fontface, FLOAT emsize, FLOAT ppdip)
@@ -6736,7 +6733,7 @@ static WORD get_gasp_flags(IDWriteFontFace *fontface, FLOAT emsize, FLOAT ppdip)
exists = FALSE;
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_GASP_TAG,
(const void**)&ptr, &size, &ctxt, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!exists)
goto done;
@@ -6878,11 +6875,11 @@ static void test_GetRecommendedRenderingMode(void)
mode = 10;
hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, 3.0, 1.0,
DWRITE_MEASURING_MODE_GDI_CLASSIC, NULL, &mode);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(mode == DWRITE_RENDERING_MODE_DEFAULT, "got %d\n", mode);
hr = IDWriteFactory_CreateRenderingParams(factory, ¶ms);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* detect old dwrite version, that is using higher threshold value */
g_is_vista = fontface1 == NULL;
@@ -6905,7 +6902,7 @@ static void test_GetRecommendedRenderingMode(void)
gasp = get_gasp_flags(fontface, emsize, ppdip);
expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests[i].measuring, recmode_tests[i].threshold);
hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, emsize, ppdip, recmode_tests[i].measuring, params, &mode);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == expected, "got %d, ppdip %f, flags 0x%04x, expected %d.\n", mode, ppdip, gasp, expected);
/* some ppdip variants */
@@ -6914,7 +6911,7 @@ static void test_GetRecommendedRenderingMode(void)
gasp = get_gasp_flags(fontface, emsize, ppdip);
expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests[i].measuring, recmode_tests[i].threshold);
hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, emsize, ppdip, recmode_tests[i].measuring, params, &mode);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == expected, "got %d, ppdip %f, flags 0x%04x, expected %d.\n", mode, ppdip, gasp, expected);
/* Only test larger sizes to workaround Win7 differences, where unscaled natural emsize threshold is used;
@@ -6926,7 +6923,7 @@ static void test_GetRecommendedRenderingMode(void)
gasp = get_gasp_flags(fontface, emsize, ppdip);
expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests[i].measuring, recmode_tests[i].threshold);
hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, emsize, ppdip, recmode_tests[i].measuring, params, &mode);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == expected, "got %d, ppdip %f, flags 0x%04x, expected %d.\n", mode, ppdip, gasp, expected);
ppdip = 2.0f;
@@ -6934,7 +6931,7 @@ static void test_GetRecommendedRenderingMode(void)
gasp = get_gasp_flags(fontface, emsize, ppdip);
expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests[i].measuring, recmode_tests[i].threshold);
hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, emsize, ppdip, recmode_tests[i].measuring, params, &mode);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == expected, "got %d, ppdip %f, flags 0x%04x, expected %d.\n", mode, ppdip, gasp, expected);
}
@@ -6957,7 +6954,7 @@ static void test_GetRecommendedRenderingMode(void)
expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold);
hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi, dpi,
NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == expected, "got %d, dpi %f, flags 0x%04x, expected %d.\n", mode, dpi, gasp, expected);
/* Only test larger sizes to workaround Win7 differences, where unscaled natural emsize threshold is used;
@@ -6971,7 +6968,7 @@ static void test_GetRecommendedRenderingMode(void)
expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold);
hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi, dpi,
NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == expected, "got %d, dpi %f, flags 0x%04x, expected %d.\n", mode, dpi, gasp, expected);
ppdip = 0.5f;
@@ -6981,7 +6978,7 @@ static void test_GetRecommendedRenderingMode(void)
expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold);
hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi, dpi,
NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == expected, "got %d, dpi %f, flags 0x%04x, expected %d.\n", mode, dpi, gasp, expected);
/* try different dpis for X and Y direction */
@@ -6992,7 +6989,7 @@ static void test_GetRecommendedRenderingMode(void)
expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold);
hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi * 0.5f, dpi,
NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == expected, "got %d, dpi %f, flags 0x%04x, expected %d.\n", mode, dpi, gasp, expected);
ppdip = 1.0f;
@@ -7002,7 +6999,7 @@ static void test_GetRecommendedRenderingMode(void)
expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold);
hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi, dpi * 0.5f,
NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == expected, "got %d, dpi %f, flags 0x%04x, expected %d.\n", mode, dpi, gasp, expected);
ppdip = 2.0f;
@@ -7012,7 +7009,7 @@ static void test_GetRecommendedRenderingMode(void)
expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold);
hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi * 0.5f, dpi,
NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == expected, "got %d, dpi %f, flags 0x%04x, expected %d.\n", mode, dpi, gasp, expected);
ppdip = 2.0f;
@@ -7022,7 +7019,7 @@ static void test_GetRecommendedRenderingMode(void)
expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold);
hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi, dpi * 0.5f,
NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == expected, "got %d, dpi %f, flags 0x%04x, expected %d.\n", mode, dpi, gasp, expected);
}
@@ -7044,7 +7041,7 @@ static void test_GetRecommendedRenderingMode(void)
expected_gridfit = get_expected_gridfit_mode(emsize, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold);
hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, emsize, 96.0f, 96.0f,
NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, params, &mode, &gridfit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == expected, "got %d, flags 0x%04x, expected %d.\n", mode, gasp, expected);
ok(gridfit == expected_gridfit, "gridfit: got %d, flags 0x%04x, expected %d.\n", gridfit, gasp, expected_gridfit);
@@ -7067,7 +7064,7 @@ static void test_GetRecommendedRenderingMode(void)
expected_gridfit = get_expected_gridfit_mode(emsize, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold);
hr = IDWriteFontFace3_GetRecommendedRenderingMode(fontface3, emsize, 96.0f, 96.0f,
NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, params, &mode1, &gridfit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode1 == expected1, "got %d, flags 0x%04x, expected %d.\n", mode1, gasp, expected1);
ok(gridfit == expected_gridfit, "gridfit: got %d, flags 0x%04x, expected %d.\n", gridfit, gasp, expected_gridfit);
@@ -7083,11 +7080,11 @@ static void test_GetRecommendedRenderingMode(void)
/* test how parameters override returned modes */
hr = IDWriteFactory_CreateCustomRenderingParams(factory, 1.0, 0.0, 0.0, DWRITE_PIXEL_GEOMETRY_FLAT,
DWRITE_RENDERING_MODE_GDI_CLASSIC, ¶ms);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
mode = 10;
hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, 500.0, 1.0, DWRITE_MEASURING_MODE_NATURAL, params, &mode);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == DWRITE_RENDERING_MODE_GDI_CLASSIC, "got %d\n", mode);
IDWriteRenderingParams_Release(params);
@@ -7098,18 +7095,18 @@ static void test_GetRecommendedRenderingMode(void)
DWRITE_GRID_FIT_MODE gridfit;
hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory2, (void**)&factory2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory2_CreateCustomRenderingParams(factory2, 1.0, 0.0, 0.0, 0.5, DWRITE_PIXEL_GEOMETRY_FLAT,
DWRITE_RENDERING_MODE_OUTLINE, DWRITE_GRID_FIT_MODE_ENABLED, ¶ms2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
mode = 10;
gridfit = 10;
hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, 5.0, 96.0, 96.0,
NULL, FALSE, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED, DWRITE_MEASURING_MODE_GDI_CLASSIC,
NULL, &mode, &gridfit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == DWRITE_RENDERING_MODE_GDI_CLASSIC, "got %d\n", mode);
ok(gridfit == DWRITE_GRID_FIT_MODE_ENABLED, "got %d\n", gridfit);
@@ -7118,7 +7115,7 @@ static void test_GetRecommendedRenderingMode(void)
hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, 5.0, 96.0, 96.0,
NULL, FALSE, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED, DWRITE_MEASURING_MODE_GDI_CLASSIC,
(IDWriteRenderingParams*)params2, &mode, &gridfit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == DWRITE_RENDERING_MODE_OUTLINE, "got %d\n", mode);
ok(gridfit == DWRITE_GRID_FIT_MODE_ENABLED, "got %d\n", gridfit);
@@ -7135,11 +7132,11 @@ static void test_GetRecommendedRenderingMode(void)
DWRITE_RENDERING_MODE1 mode1;
hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory3, (void**)&factory3);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory3_CreateCustomRenderingParams(factory3, 1.0f, 0.0f, 0.0f, 0.5f, DWRITE_PIXEL_GEOMETRY_FLAT,
DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED, DWRITE_GRID_FIT_MODE_ENABLED, ¶ms3);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
mode1 = IDWriteRenderingParams3_GetRenderingMode1(params3);
ok(mode1 == DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED, "got %d\n", mode1);
@@ -7148,14 +7145,14 @@ static void test_GetRecommendedRenderingMode(void)
ok(mode == DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, "got %d\n", mode);
hr = IDWriteRenderingParams3_QueryInterface(params3, &IID_IDWriteRenderingParams, (void**)¶ms);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(params == (IDWriteRenderingParams*)params3, "got %p, %p\n", params3, params);
mode = IDWriteRenderingParams_GetRenderingMode(params);
ok(mode == DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, "got %d\n", mode);
IDWriteRenderingParams_Release(params);
hr = IDWriteRenderingParams3_QueryInterface(params3, &IID_IDWriteRenderingParams2, (void**)¶ms2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(params2 == (IDWriteRenderingParams2*)params3, "got %p, %p\n", params3, params2);
mode = IDWriteRenderingParams2_GetRenderingMode(params2);
ok(mode == DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, "got %d\n", mode);
@@ -7166,7 +7163,7 @@ static void test_GetRecommendedRenderingMode(void)
hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, 5.0f, 96.0f, 96.0f,
NULL, FALSE, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED, DWRITE_MEASURING_MODE_GDI_CLASSIC,
NULL, &mode, &gridfit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == DWRITE_RENDERING_MODE_GDI_CLASSIC, "got %d\n", mode);
ok(gridfit == DWRITE_GRID_FIT_MODE_ENABLED, "got %d\n", gridfit);
@@ -7175,7 +7172,7 @@ static void test_GetRecommendedRenderingMode(void)
hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, 5.0f, 96.0f, 96.0f,
NULL, FALSE, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED, DWRITE_MEASURING_MODE_GDI_CLASSIC,
(IDWriteRenderingParams*)params3, &mode, &gridfit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, "got %d\n", mode);
ok(gridfit == DWRITE_GRID_FIT_MODE_ENABLED, "got %d\n", gridfit);
@@ -7191,7 +7188,7 @@ static void test_GetRecommendedRenderingMode(void)
IDWriteFontFace1_Release(fontface1);
IDWriteFontFace_Release(fontface);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static inline BOOL float_eq(FLOAT left, FLOAT right)
@@ -7239,11 +7236,11 @@ static void test_GetAlphaBlendParams(void)
ch = 'A';
glyph = 0;
hr = IDWriteFontFace_GetGlyphIndices(fontface, &ch, 1, &glyph);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(glyph > 0, "got %u\n", glyph);
hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, &glyph, 1, &metrics, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
advance = metrics.advanceWidth;
offset.advanceOffset = 0.0;
@@ -7260,7 +7257,7 @@ static void test_GetAlphaBlendParams(void)
hr = IDWriteFactory_CreateCustomRenderingParams(factory, 0.9, 0.3, 0.1, DWRITE_PIXEL_GEOMETRY_RGB,
DWRITE_RENDERING_MODE_DEFAULT, ¶ms);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = 0;
ret = SystemParametersInfoW(SPI_GETFONTSMOOTHINGCONTRAST, 0, &value, 0);
@@ -7271,18 +7268,18 @@ static void test_GetAlphaBlendParams(void)
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL,
rendermodes[i], DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
gamma = contrast = ctlevel = -1.0;
hr = IDWriteGlyphRunAnalysis_GetAlphaBlendParams(analysis, NULL, &gamma, &contrast, &ctlevel);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(gamma == -1.0, "got %.2f\n", gamma);
ok(contrast == -1.0, "got %.2f\n", contrast);
ok(ctlevel == -1.0, "got %.2f\n", ctlevel);
gamma = contrast = ctlevel = -1.0;
hr = IDWriteGlyphRunAnalysis_GetAlphaBlendParams(analysis, params, &gamma, &contrast, &ctlevel);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (rendermodes[i] == DWRITE_RENDERING_MODE_GDI_CLASSIC || rendermodes[i] == DWRITE_RENDERING_MODE_GDI_NATURAL) {
ok(float_eq(gamma, expected_gdi_gamma), "got %.2f, expected %.2f\n", gamma, expected_gdi_gamma);
@@ -7301,7 +7298,7 @@ static void test_GetAlphaBlendParams(void)
IDWriteRenderingParams_Release(params);
IDWriteFontFace_Release(fontface);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_CreateAlphaTexture(void)
@@ -7326,11 +7323,11 @@ static void test_CreateAlphaTexture(void)
ch = 'A';
glyph = 0;
hr = IDWriteFontFace_GetGlyphIndices(fontface, &ch, 1, &glyph);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(glyph > 0, "got %u\n", glyph);
hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, &glyph, 1, &metrics, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
advance = metrics.advanceWidth;
offset.advanceOffset = 0.0;
@@ -7348,11 +7345,11 @@ static void test_CreateAlphaTexture(void)
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL,
DWRITE_RENDERING_MODE_NATURAL, DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&bounds);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &bounds);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!IsRectEmpty(&bounds), "got empty rect\n");
size = (bounds.right - bounds.left)*(bounds.bottom - bounds.top)*3;
ok(sizeof(buff) >= size, "required %u\n", size);
@@ -7360,23 +7357,23 @@ static void test_CreateAlphaTexture(void)
/* invalid type value */
memset(buff, 0xcf, sizeof(buff));
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1+1, &bounds, buff, sizeof(buff));
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(buff[0] == 0xcf, "got %1x\n", buff[0]);
memset(buff, 0xcf, sizeof(buff));
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &bounds, buff, 2);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(buff[0] == 0xcf, "got %1x\n", buff[0]);
/* vista version allows texture type mismatch, mark it broken for now */
memset(buff, 0xcf, sizeof(buff));
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &bounds, buff, sizeof(buff));
- ok(hr == DWRITE_E_UNSUPPORTEDOPERATION || broken(hr == S_OK), "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_UNSUPPORTEDOPERATION || broken(hr == S_OK), "Unexpected hr %#lx.\n", hr);
ok(buff[0] == 0xcf || broken(buff[0] == 0), "got %1x\n", buff[0]);
memset(buff, 0xcf, sizeof(buff));
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &bounds, buff, size-1);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(buff[0] == 0xcf, "got %1x\n", buff[0]);
IDWriteGlyphRunAnalysis_Release(analysis);
@@ -7384,32 +7381,32 @@ static void test_CreateAlphaTexture(void)
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL,
DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_GDI_CLASSIC,
0.0, 0.0, &analysis);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&bounds);
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &bounds);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!IsRectEmpty(&bounds), "got empty rect\n");
size = (bounds.right - bounds.left)*(bounds.bottom - bounds.top);
ok(sizeof(buff) >= size, "required %u\n", size);
memset(buff, 0xcf, sizeof(buff));
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, NULL, buff, sizeof(buff));
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(buff[0] == 0xcf, "got %1x\n", buff[0]);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, NULL, NULL, sizeof(buff));
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
memset(buff, 0xcf, sizeof(buff));
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, NULL, buff, 0);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(buff[0] == 0xcf, "got %1x\n", buff[0]);
/* buffer size is not enough */
memset(buff, 0xcf, sizeof(buff));
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &bounds, buff, size-1);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(buff[0] == 0xcf, "got %1x\n", buff[0]);
/* request texture for rectangle that doesn't intersect */
@@ -7417,14 +7414,14 @@ static void test_CreateAlphaTexture(void)
r = bounds;
OffsetRect(&r, (bounds.right - bounds.left)*2, 0);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &r, buff, sizeof(buff));
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(buff[0] == 0, "got %1x\n", buff[0]);
memset(buff, 0xcf, sizeof(buff));
r = bounds;
OffsetRect(&r, (bounds.right - bounds.left)*2, 0);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &r, buff, sizeof(buff));
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(buff[0] == 0, "got %1x\n", buff[0]);
/* request texture for rectangle that doesn't intersect, small buffer */
@@ -7432,19 +7429,19 @@ static void test_CreateAlphaTexture(void)
r = bounds;
OffsetRect(&r, (bounds.right - bounds.left)*2, 0);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &r, buff, size-1);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(buff[0] == 0xcf, "got %1x\n", buff[0]);
/* vista version allows texture type mismatch, mark it broken for now */
memset(buff, 0xcf, sizeof(buff));
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &bounds, buff, sizeof(buff));
- ok(hr == DWRITE_E_UNSUPPORTEDOPERATION || broken(hr == S_OK), "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_UNSUPPORTEDOPERATION || broken(hr == S_OK), "Unexpected hr %#lx.\n", hr);
ok(buff[0] == 0xcf || broken(buff[0] == 0), "got %1x\n", buff[0]);
IDWriteGlyphRunAnalysis_Release(analysis);
IDWriteFontFace_Release(fontface);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static BOOL get_expected_is_symbol(IDWriteFontFace *fontface)
@@ -7460,7 +7457,7 @@ static BOOL get_expected_is_symbol(IDWriteFontFace *fontface)
HRESULT hr;
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_OS2_TAG, (const void **)&tt_os2, &size, &os2_context, &exists);
- ok(hr == S_OK, "Failed to get OS/2 table, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get OS/2 table, hr %#lx.\n", hr);
if (tt_os2)
{
@@ -7512,7 +7509,7 @@ static void test_IsSymbolFont(void)
factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(collection);
for (i = 0; i < count; ++i)
@@ -7523,10 +7520,10 @@ static void test_IsSymbolFont(void)
WCHAR nameW[256];
hr = IDWriteFontCollection_GetFontFamily(collection, i, &family);
- ok(hr == S_OK, "Failed to get family, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get family, hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "Failed to get names, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get names, hr %#lx.\n", hr);
get_enus_string(names, nameW, ARRAY_SIZE(nameW));
IDWriteLocalizedStrings_Release(names);
@@ -7537,10 +7534,10 @@ static void test_IsSymbolFont(void)
BOOL is_symbol_font, is_symbol_face, is_symbol_expected;
hr = IDWriteFontFamily_GetFont(family, j, &font);
- ok(hr == S_OK, "Failed to get font, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font, hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
is_symbol_font = IDWriteFont_IsSymbolFont(font);
is_symbol_face = IDWriteFontFace_IsSymbolFont(fontface);
@@ -7560,7 +7557,7 @@ static void test_IsSymbolFont(void)
IDWriteFontCollection_Release(collection);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
struct CPAL_Header_0
@@ -7595,30 +7592,30 @@ static void test_GetPaletteEntries(void)
IDWriteFontFace_Release(fontface);
if (hr != S_OK) {
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
win_skip("GetPaletteEntries() is not supported.\n");
return;
}
hr = IDWriteFontFace2_GetPaletteEntries(fontface2, 0, 0, 1, &color);
- ok(hr == DWRITE_E_NOCOLOR, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace2_Release(fontface2);
/* Segoe UI Emoji, with color support */
font = get_font(factory, L"Segoe UI Emoji", DWRITE_FONT_STYLE_NORMAL);
if (!font) {
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
skip("Segoe UI Emoji font not found.\n");
return;
}
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace2, (void**)&fontface2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace_Release(fontface);
palettecount = IDWriteFontFace2_GetColorPaletteCount(fontface2);
@@ -7629,7 +7626,7 @@ static void test_GetPaletteEntries(void)
exists = FALSE;
hr = IDWriteFontFace2_TryGetFontTable(fontface2, MS_CPAL_TAG, (const void**)&cpal_header, &size, &ctxt, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(exists, "got %d\n", exists);
colorrecords = GET_BE_WORD(cpal_header->numColorRecords);
ok(colorrecords >= 1, "got %u\n", colorrecords);
@@ -7637,33 +7634,33 @@ static void test_GetPaletteEntries(void)
/* invalid palette index */
color.r = color.g = color.b = color.a = 123.0;
hr = IDWriteFontFace2_GetPaletteEntries(fontface2, palettecount, 0, 1, &color);
- ok(hr == DWRITE_E_NOCOLOR, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr);
ok(color.r == 123.0 && color.g == 123.0 && color.b == 123.0 && color.a == 123.0,
"got wrong color %.2fx%.2fx%.2fx%.2f\n", color.r, color.g, color.b, color.a);
/* invalid entry index */
color.r = color.g = color.b = color.a = 123.0;
hr = IDWriteFontFace2_GetPaletteEntries(fontface2, 0, entrycount, 1, &color);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(color.r == 123.0 && color.g == 123.0 && color.b == 123.0 && color.a == 123.0,
"got wrong color %.2fx%.2fx%.2fx%.2f\n", color.r, color.g, color.b, color.a);
color.r = color.g = color.b = color.a = 123.0;
hr = IDWriteFontFace2_GetPaletteEntries(fontface2, 0, entrycount - 1, 1, &color);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(color.r != 123.0 && color.g != 123.0 && color.b != 123.0 && color.a != 123.0,
"got wrong color %.2fx%.2fx%.2fx%.2f\n", color.r, color.g, color.b, color.a);
/* zero return length */
color.r = color.g = color.b = color.a = 123.0;
hr = IDWriteFontFace2_GetPaletteEntries(fontface2, 0, 0, 0, &color);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(color.r == 123.0 && color.g == 123.0 && color.b == 123.0 && color.a == 123.0,
"got wrong color %.2fx%.2fx%.2fx%.2f\n", color.r, color.g, color.b, color.a);
IDWriteFontFace2_Release(fontface2);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_TranslateColorGlyphRun(void)
@@ -7695,7 +7692,7 @@ static void test_TranslateColorGlyphRun(void)
codepoints[0] = 'A';
hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 1, glyphs);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
run.fontFace = fontface;
run.fontEmSize = 20.0f;
@@ -7709,7 +7706,7 @@ static void test_TranslateColorGlyphRun(void)
layers = (void*)0xdeadbeef;
hr = IDWriteFactory2_TranslateColorGlyphRun(factory, 0.0f, 0.0f, &run, NULL,
DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers);
- ok(hr == DWRITE_E_NOCOLOR, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr);
ok(layers == NULL, "got %p\n", layers);
IDWriteFontFace_Release(fontface);
@@ -7722,19 +7719,19 @@ static void test_TranslateColorGlyphRun(void)
}
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
codepoints[0] = 0x26c4;
hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 1, glyphs);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
run.fontFace = fontface;
layers = NULL;
hr = IDWriteFactory2_TranslateColorGlyphRun(factory, 0.0f, 0.0f, &run, NULL,
DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(layers != NULL, "got %p\n", layers);
hr = IDWriteColorGlyphRunEnumerator_QueryInterface(layers, &IID_IDWriteColorGlyphRunEnumerator1, (void **)&layers1);
@@ -7748,13 +7745,13 @@ static void test_TranslateColorGlyphRun(void)
{
hasrun = FALSE;
hr = IDWriteColorGlyphRunEnumerator_MoveNext(layers, &hasrun);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!hasrun)
break;
hr = IDWriteColorGlyphRunEnumerator_GetCurrentRun(layers, &colorrun);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(colorrun->glyphRun.fontFace == fontface, "Unexpected fontface %p.\n", colorrun->glyphRun.fontFace);
ok(colorrun->glyphRun.fontEmSize == 20.0f, "got wrong font size %f\n", colorrun->glyphRun.fontEmSize);
ok(colorrun->glyphRun.glyphCount == 1, "Unexpected glyph count %u.\n", colorrun->glyphRun.glyphCount);
@@ -7765,7 +7762,7 @@ static void test_TranslateColorGlyphRun(void)
if (layers1)
{
hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1);
- ok(hr == S_OK, "Failed to get color runt, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get color runt, hr %#lx.\n", hr);
ok((const DWRITE_COLOR_GLYPH_RUN *)colorrun1 == colorrun, "Unexpected pointer.\n");
ok(colorrun1->glyphImageFormat == (DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE | DWRITE_GLYPH_IMAGE_FORMATS_COLR) ||
colorrun1->glyphImageFormat == DWRITE_GLYPH_IMAGE_FORMATS_NONE,
@@ -7777,12 +7774,12 @@ static void test_TranslateColorGlyphRun(void)
/* iterated all way through */
hr = IDWriteColorGlyphRunEnumerator_GetCurrentRun(layers, &colorrun);
- ok(hr == E_NOT_VALID_STATE, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_VALID_STATE, "Unexpected hr %#lx.\n", hr);
if (layers1)
{
hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1);
- ok(hr == E_NOT_VALID_STATE, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOT_VALID_STATE, "Unexpected hr %#lx.\n", hr);
}
IDWriteColorGlyphRunEnumerator_Release(layers);
@@ -7790,33 +7787,33 @@ static void test_TranslateColorGlyphRun(void)
IDWriteColorGlyphRunEnumerator1_Release(layers1);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace2, (void**)&fontface2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* invalid palette index */
layers = (void*)0xdeadbeef;
hr = IDWriteFactory2_TranslateColorGlyphRun(factory, 0.0f, 0.0f, &run, NULL,
DWRITE_MEASURING_MODE_NATURAL, NULL, IDWriteFontFace2_GetColorPaletteCount(fontface2),
&layers);
- ok(hr == DWRITE_E_NOCOLOR, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr);
ok(layers == NULL, "got %p\n", layers);
layers = NULL;
hr = IDWriteFactory2_TranslateColorGlyphRun(factory, 0.0f, 0.0f, &run, NULL,
DWRITE_MEASURING_MODE_NATURAL, NULL, IDWriteFontFace2_GetColorPaletteCount(fontface2) - 1,
&layers);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteColorGlyphRunEnumerator_Release(layers);
/* color font, glyph without color info */
codepoints[0] = 'A';
hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 1, glyphs);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!*glyphs, "Unexpected glyph.\n");
layers = (void*)0xdeadbeef;
hr = IDWriteFactory2_TranslateColorGlyphRun(factory, 0.0f, 0.0f, &run, NULL,
DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers);
- ok(hr == DWRITE_E_NOCOLOR, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr);
ok(layers == NULL, "got %p\n", layers);
/* one glyph with, one without */
@@ -7824,14 +7821,14 @@ static void test_TranslateColorGlyphRun(void)
codepoints[1] = 0x26c4;
hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 2, glyphs);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
run.glyphCount = 2;
layers = NULL;
hr = IDWriteFactory2_TranslateColorGlyphRun(factory, 0.0f, 0.0f, &run, NULL,
DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(layers != NULL, "got %p\n", layers);
hr = IDWriteColorGlyphRunEnumerator_QueryInterface(layers, &IID_IDWriteColorGlyphRunEnumerator1, (void **)&layers1);
@@ -7841,13 +7838,13 @@ static void test_TranslateColorGlyphRun(void)
{
hasrun = FALSE;
hr = IDWriteColorGlyphRunEnumerator1_MoveNext(layers1, &hasrun);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!hasrun)
break;
hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!colorrun1->glyphRun.fontFace, "Unexpected fontface %p.\n", colorrun1->glyphRun.fontFace);
ok(colorrun1->glyphRun.fontEmSize == 20.0f, "got wrong font size %f\n", colorrun1->glyphRun.fontEmSize);
ok(colorrun1->glyphRun.glyphCount > 0, "Unexpected glyph count %u.\n", colorrun1->glyphRun.glyphCount);
@@ -7873,31 +7870,31 @@ static void test_TranslateColorGlyphRun(void)
origin.x = origin.y = 0.0f;
hr = IDWriteFactory4_TranslateColorGlyphRun(factory4, origin, &run, NULL,
DWRITE_GLYPH_IMAGE_FORMATS_NONE, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers1);
- ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#x.\n", hr);
+ ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory4_TranslateColorGlyphRun(factory4, origin, &run, NULL,
DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers1);
- ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#x.\n", hr);
+ ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory4_TranslateColorGlyphRun(factory4, origin, &run, NULL,
DWRITE_GLYPH_IMAGE_FORMATS_CFF, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers1);
- ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#x.\n", hr);
+ ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory4_TranslateColorGlyphRun(factory4, origin, &run, NULL,
DWRITE_GLYPH_IMAGE_FORMATS_COLR, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
for (;;)
{
hasrun = FALSE;
hr = IDWriteColorGlyphRunEnumerator1_MoveNext(layers1, &hasrun);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!hasrun)
break;
hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!colorrun1->glyphRun.fontFace, "Unexpected fontface %p.\n", colorrun1->glyphRun.fontFace);
ok(colorrun1->glyphRun.fontEmSize == 20.0f, "got wrong font size %f\n", colorrun1->glyphRun.fontEmSize);
ok(colorrun1->glyphRun.glyphCount > 0, "Unexpected glyph count %u.\n", colorrun1->glyphRun.glyphCount);
@@ -7921,7 +7918,7 @@ static void test_TranslateColorGlyphRun(void)
IDWriteFontFace2_Release(fontface2);
IDWriteFontFace_Release(fontface);
ref = IDWriteFactory2_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_HasCharacter(void)
@@ -7943,7 +7940,7 @@ static void test_HasCharacter(void)
hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory3, (void**)&factory3);
if (hr == S_OK) {
hr = IDWriteFont_QueryInterface(font, &IID_IDWriteFont3, (void**)&font3);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ret = IDWriteFont3_HasCharacter(font3, 'A');
ok(ret, "got %d\n", ret);
@@ -7956,7 +7953,7 @@ static void test_HasCharacter(void)
IDWriteFont_Release(font);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static BOOL has_main_axis_values(const DWRITE_FONT_AXIS_VALUE *values, unsigned int count)
@@ -8003,47 +8000,47 @@ static void test_CreateFontFaceReference(void)
path = create_testfontfile(test_fontfile);
hr = IDWriteFactory3_CreateFontFaceReference(factory, NULL, NULL, 0, DWRITE_FONT_SIMULATIONS_NONE, &ref);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* out of range simulation flags */
hr = IDWriteFactory3_CreateFontFaceReference(factory, path, NULL, 0, ~0u, &ref);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* test file is not a collection, but reference could still be created with non-zero face index */
hr = IDWriteFactory3_CreateFontFaceReference(factory, path, NULL, 1, DWRITE_FONT_SIMULATIONS_NONE, &ref);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
index = IDWriteFontFaceReference_GetFontFaceIndex(ref);
ok(index == 1, "got %u\n", index);
hr = IDWriteFontFaceReference_GetFontFile(ref, &file);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(file);
hr = IDWriteFontFaceReference_CreateFontFace(ref, &fontface);
todo_wine
- ok(hr == DWRITE_E_FILEFORMAT, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_FILEFORMAT, "Unexpected hr %#lx.\n", hr);
IDWriteFontFaceReference_Release(ref);
/* path however has to be valid */
hr = IDWriteFactory3_CreateFontFaceReference(factory, L"dummy", NULL, 0, DWRITE_FONT_SIMULATIONS_NONE, &ref);
todo_wine
- ok(hr == DWRITE_E_FILENOTFOUND, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_FILENOTFOUND, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
IDWriteFontFaceReference_Release(ref);
EXPECT_REF(factory, 1);
hr = IDWriteFactory3_CreateFontFaceReference(factory, path, NULL, 0, DWRITE_FONT_SIMULATIONS_NONE, &ref);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(factory, 2);
/* new file is returned */
hr = IDWriteFontFaceReference_GetFontFile(ref, &file);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFaceReference_GetFontFile(ref, &file1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(file != file1, "got %p, previous file %p\n", file1, file);
IDWriteFontFile_Release(file);
@@ -8051,15 +8048,15 @@ static void test_CreateFontFaceReference(void)
/* references are not reused */
hr = IDWriteFactory3_CreateFontFaceReference(factory, path, NULL, 0, DWRITE_FONT_SIMULATIONS_NONE, &ref1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(ref1 != ref, "got %p, previous ref %p\n", ref1, ref);
/* created fontfaces are cached */
hr = IDWriteFontFaceReference_CreateFontFace(ref, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFaceReference_CreateFontFace(ref1, &fontface1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fontface == fontface1, "got %p, expected %p\n", fontface1, fontface);
IDWriteFontFace3_Release(fontface);
IDWriteFontFace3_Release(fontface1);
@@ -8070,13 +8067,13 @@ static void test_CreateFontFaceReference(void)
IDWriteFontFaceReference_Release(ref1);
hr = IDWriteFactory3_CreateFontFaceReference(factory, path, NULL, 1, DWRITE_FONT_SIMULATIONS_NONE, &ref1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ret = IDWriteFontFaceReference_Equals(ref, ref1);
ok(!ret, "got %d\n", ret);
IDWriteFontFaceReference_Release(ref1);
hr = IDWriteFactory3_CreateFontFaceReference(factory, path, NULL, 0, DWRITE_FONT_SIMULATIONS_BOLD, &ref1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ret = IDWriteFontFaceReference_Equals(ref, ref1);
ok(!ret, "got %d\n", ret);
IDWriteFontFaceReference_Release(ref1);
@@ -8085,13 +8082,13 @@ static void test_CreateFontFaceReference(void)
/* create reference from a file */
hr = IDWriteFactory3_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory3_CreateFontFaceReference_(factory, file, 0, DWRITE_FONT_SIMULATIONS_NONE, &ref);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFaceReference_GetFontFile(ref, &file1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(file != file1, "got %p, previous file %p\n", file1, file);
IDWriteFontFaceReference_Release(ref);
@@ -8100,7 +8097,7 @@ static void test_CreateFontFaceReference(void)
/* References returned from IDWriteFont3/IDWriteFontFace3. */
hr = IDWriteFactory3_GetSystemFontCollection(factory, FALSE, &collection, FALSE);
- ok(hr == S_OK, "Failed to get system collection, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get system collection, hr %#lx.\n", hr);
count = IDWriteFontCollection1_GetFontFamilyCount(collection);
for (i = 0; i < count; i++)
@@ -8109,7 +8106,7 @@ static void test_CreateFontFaceReference(void)
UINT32 font_count, j;
hr = IDWriteFontCollection1_GetFontFamily(collection, i, &family);
- ok(hr == S_OK, "Failed to get family, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get family, hr %#lx.\n", hr);
font_count = IDWriteFontFamily1_GetFontCount(family);
@@ -8118,17 +8115,17 @@ static void test_CreateFontFaceReference(void)
IDWriteFontFaceReference1 *ref2;
hr = IDWriteFontFamily1_GetFont(family, j, &font3);
- ok(hr == S_OK, "Failed to get font, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font, hr %#lx.\n", hr);
hr = IDWriteFont3_GetFontFaceReference(font3, &ref);
- ok(hr == S_OK, "Failed to get reference object, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get reference object, hr %#lx.\n", hr);
hr = IDWriteFont3_GetFontFaceReference(font3, &ref1);
- ok(hr == S_OK, "Failed to get reference object, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get reference object, hr %#lx.\n", hr);
ok(ref != ref1, "Unexpected reference object %p, %p.\n", ref1, ref);
hr = IDWriteFont3_CreateFontFace(font3, &fontface);
- ok(hr == S_OK, "Failed to create a fontface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a fontface, hr %#lx.\n", hr);
/* Fonts present regular properties as axis values, for non-variable fonts too.
Normally it would include weight/width/slant/italic, but could also contain optical size axis. */
@@ -8140,7 +8137,7 @@ static void test_CreateFontFaceReference(void)
ok(axis_count >= 4, "Unexpected axis value count.\n");
hr = IDWriteFontFaceReference1_GetFontAxisValues(ref2, axis_values, ARRAY_SIZE(axis_values));
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine
ok(has_main_axis_values(axis_values, axis_count), "Unexpected axis returned.\n");
@@ -8152,16 +8149,16 @@ static void test_CreateFontFaceReference(void)
IDWriteFontFaceReference_Release(ref1);
hr = IDWriteFontFace3_GetFontFaceReference(fontface, &ref);
- ok(hr == S_OK, "Failed to get a reference, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get a reference, hr %#lx.\n", hr);
EXPECT_REF(fontface, 2);
hr = IDWriteFontFace3_GetFontFaceReference(fontface, &ref1);
- ok(hr == S_OK, "Failed to get a reference, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get a reference, hr %#lx.\n", hr);
ok(ref == ref1, "Unexpected reference %p, %p.\n", ref1, ref);
EXPECT_REF(fontface, 3);
hr = IDWriteFontFace3_QueryInterface(fontface, &IID_IDWriteFontFaceReference, (void **)&ref3);
- ok(hr == S_OK || broken(FAILED(hr)), "Failed to get interface, hr %#x.\n", hr);
+ ok(hr == S_OK || broken(FAILED(hr)), "Failed to get interface, hr %#lx.\n", hr);
if (SUCCEEDED(hr))
{
ok(ref == ref3, "Unexpected reference %p.\n", ref3);
@@ -8169,7 +8166,7 @@ static void test_CreateFontFaceReference(void)
}
hr = IDWriteFontFaceReference_CreateFontFace(ref, &fontface1);
- ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
ok(fontface1 == fontface, "Unexpected fontface %p, %p.\n", fontface1, fontface);
IDWriteFontFace3_Release(fontface1);
@@ -8185,7 +8182,7 @@ static void test_CreateFontFaceReference(void)
IDWriteFontCollection1_Release(collection);
refcount = IDWriteFactory3_Release(factory);
- ok(refcount == 0, "factory not released, %u\n", refcount);
+ ok(refcount == 0, "factory not released, %lu\n", refcount);
DELETE_FONTFILE(path);
}
@@ -8201,10 +8198,10 @@ static void get_expected_fontsig(IDWriteFont *font, FONTSIGNATURE *fontsig)
memset(fontsig, 0, sizeof(*fontsig));
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_OS2_TAG, (const void **)&tt_os2, &size, &os2_context, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (tt_os2) {
fontsig->fsUsb[0] = GET_BE_DWORD(tt_os2->ulUnicodeRange1);
@@ -8241,7 +8238,7 @@ static void test_GetFontSignature(void)
factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGdiInterop_QueryInterface(interop, &IID_IDWriteGdiInterop1, (void**)&interop1);
IDWriteGdiInterop_Release(interop);
@@ -8251,13 +8248,13 @@ static void test_GetFontSignature(void)
IDWriteFactory_Release(factory);
return;
};
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGdiInterop1_GetFontSignature(interop1, NULL, &fontsig);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < count; i++) {
@@ -8268,38 +8265,38 @@ static void test_GetFontSignature(void)
WCHAR nameW[256];
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL,
DWRITE_FONT_STYLE_NORMAL, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, nameW, ARRAY_SIZE(nameW));
IDWriteLocalizedStrings_Release(names);
hr = IDWriteGdiInterop1_GetFontSignature(interop1, font, &fontsig);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_expected_fontsig(font, &expected_signature);
winetest_push_context("Font %s\n", wine_dbgstr_w(nameW));
- ok(fontsig.fsUsb[0] == expected_signature.fsUsb[0], "fsUsb[0] %#x, expected %#x.\n",
+ ok(fontsig.fsUsb[0] == expected_signature.fsUsb[0], "fsUsb[0] %#lx, expected %#lx.\n",
fontsig.fsUsb[0], expected_signature.fsUsb[0]);
- ok(fontsig.fsUsb[1] == expected_signature.fsUsb[1], "fsUsb[1] %#x, expected %#x.\n",
+ ok(fontsig.fsUsb[1] == expected_signature.fsUsb[1], "fsUsb[1] %#lx, expected %#lx.\n",
fontsig.fsUsb[1], expected_signature.fsUsb[1]);
- ok(fontsig.fsUsb[2] == expected_signature.fsUsb[2], "fsUsb[2] %#x, expected %#x.\n",
+ ok(fontsig.fsUsb[2] == expected_signature.fsUsb[2], "fsUsb[2] %#lx, expected %#lx.\n",
fontsig.fsUsb[2], expected_signature.fsUsb[2]);
- ok(fontsig.fsUsb[3] == expected_signature.fsUsb[3], "fsUsb[3] %#x, expected %#x.\n",
+ ok(fontsig.fsUsb[3] == expected_signature.fsUsb[3], "fsUsb[3] %#lx, expected %#lx.\n",
fontsig.fsUsb[3], expected_signature.fsUsb[3]);
- ok(fontsig.fsCsb[0] == expected_signature.fsCsb[0], "fsCsb[0] %#x, expected %#x.\n",
+ ok(fontsig.fsCsb[0] == expected_signature.fsCsb[0], "fsCsb[0] %#lx, expected %#lx.\n",
fontsig.fsCsb[0], expected_signature.fsCsb[0]);
- ok(fontsig.fsCsb[1] == expected_signature.fsCsb[1], "fsCsb[1] %#x, expected %#x.\n",
+ ok(fontsig.fsCsb[1] == expected_signature.fsCsb[1], "fsCsb[1] %#lx, expected %#lx.\n",
fontsig.fsCsb[1], expected_signature.fsCsb[1]);
winetest_pop_context();
@@ -8311,7 +8308,7 @@ static void test_GetFontSignature(void)
IDWriteGdiInterop1_Release(interop1);
IDWriteFontCollection_Release(syscollection);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_font_properties(void)
@@ -8333,7 +8330,7 @@ static void test_font_properties(void)
ok(style == DWRITE_FONT_STYLE_OBLIQUE, "got %u\n", style);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (void**)&fontface3);
IDWriteFontFace_Release(fontface);
@@ -8346,7 +8343,7 @@ static void test_font_properties(void)
IDWriteFont_Release(font);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static BOOL has_vertical_glyph_variants(IDWriteFontFace1 *fontface)
@@ -8362,7 +8359,7 @@ static BOOL has_vertical_glyph_variants(IDWriteFontFace1 *fontface)
UINT16 i;
hr = IDWriteFontFace1_TryGetFontTable(fontface, MS_GSUB_TAG, &data, &size, &context, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!exists)
return FALSE;
@@ -8451,7 +8448,7 @@ static void test_HasVerticalGlyphVariants(void)
IDWriteFontFace1_Release(fontface1);
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < count; i++) {
@@ -8462,20 +8459,20 @@ static void test_HasVerticalGlyphVariants(void)
WCHAR nameW[256];
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL,
DWRITE_FONT_STYLE_NORMAL, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, nameW, ARRAY_SIZE(nameW));
@@ -8495,7 +8492,7 @@ static void test_HasVerticalGlyphVariants(void)
IDWriteFontCollection_Release(syscollection);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_HasKerningPairs(void)
@@ -8521,7 +8518,7 @@ static void test_HasKerningPairs(void)
IDWriteFontFace1_Release(fontface1);
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < count; i++) {
@@ -8535,26 +8532,26 @@ static void test_HasKerningPairs(void)
UINT32 size;
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL,
DWRITE_FONT_STYLE_NORMAL, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void **)&fontface1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, nameW, ARRAY_SIZE(nameW));
exists = FALSE;
hr = IDWriteFontFace1_TryGetFontTable(fontface1, MS_KERN_TAG, &data, &size, &context, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace1_ReleaseFontTable(fontface1, context);
has_kerningpairs = IDWriteFontFace1_HasKerningPairs(fontface1);
@@ -8571,7 +8568,7 @@ static void test_HasKerningPairs(void)
IDWriteFontCollection_Release(syscollection);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static float get_scaled_metric(const DWRITE_GLYPH_RUN *run, float metric, const DWRITE_FONT_METRICS *m)
@@ -8591,7 +8588,7 @@ static void get_expected_glyph_origins(D2D1_POINT_2F baseline_origin, const DWRI
hr = IDWriteFontFace_GetDesignGlyphMetrics(run->fontFace, run->glyphIndices, run->glyphCount, glyph_metrics,
run->isSideways);
- ok(hr == S_OK, "Failed to get glyph metrics, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get glyph metrics, hr %#lx.\n", hr);
if (run->bidiLevel & 1)
{
@@ -8694,7 +8691,7 @@ static void test_ComputeGlyphOrigins(void)
memset(origins, 0, sizeof(origins));
hr = IDWriteFactory4_ComputeGlyphOrigins_(factory, &run, origins_tests[i].baseline_origin, origins);
- ok(hr == S_OK, "%u: failed to compute glyph origins, hr %#x.\n", i, hr);
+ ok(hr == S_OK, "%u: failed to compute glyph origins, hr %#lx.\n", i, hr);
for (j = 0; j < run.glyphCount; ++j)
{
todo_wine_if(run.isSideways)
@@ -8723,7 +8720,7 @@ static void test_ComputeGlyphOrigins(void)
memset(origins, 0, sizeof(origins));
hr = IDWriteFactory4_ComputeGlyphOrigins_(factory, &run, baseline_origin, origins);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(origins[0].x == 123.0f && origins[0].y == 321.0f, "origins[0] %f,%f\n", origins[0].x, origins[0].y);
ok(origins[1].x == 133.0f && origins[1].y == 321.0f, "origins[1] %f,%f\n", origins[1].x, origins[1].y);
@@ -8748,7 +8745,7 @@ static void test_ComputeGlyphOrigins(void)
ok(origins[1].x == 133.0f && origins[1].y == 321.0f, "origins[1] %f,%f\n", origins[1].x, origins[1].y);
ref = IDWriteFactory4_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_object_lifetime(void)
@@ -8768,13 +8765,13 @@ static void test_object_lifetime(void)
/* system collection takes factory reference */
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(collection, 1);
EXPECT_REF(factory, 2);
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection2, FALSE);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
ok(collection2 == collection, "expected same collection\n");
EXPECT_REF(collection, 2);
@@ -8791,14 +8788,14 @@ static void test_object_lifetime(void)
/* family takes collection reference */
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(family, 1);
EXPECT_REF(collection, 2);
EXPECT_REF(factory, 2);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family2);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(family2, 1);
EXPECT_REF(collection, 3);
@@ -8813,14 +8810,14 @@ static void test_object_lifetime(void)
/* font takes family reference */
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(family, 2);
EXPECT_REF(collection, 2);
EXPECT_REF(factory, 2);
hr = IDWriteFont_GetFontFamily(font, &family2);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
ok(family2 == family, "unexpected family pointer\n");
IDWriteFontFamily_Release(family2);
@@ -8829,7 +8826,7 @@ static void test_object_lifetime(void)
/* Fontface takes factory reference and nothing else. */
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(font, 1);
EXPECT_REF_BROKEN(fontface, 1, 2);
@@ -8839,7 +8836,7 @@ static void test_object_lifetime(void)
/* get font from fontface */
hr = IDWriteFontCollection_GetFontFromFontFace(collection, fontface, &font2);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(font, 1);
EXPECT_REF(font2, 1);
@@ -8865,7 +8862,7 @@ static void test_object_lifetime(void)
/* Matching fonts list takes family reference. */
hr = IDWriteFontFamily_GetMatchingFonts(family, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &fontlist);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(family, 2);
EXPECT_REF(collection, 2);
@@ -8873,7 +8870,7 @@ static void test_object_lifetime(void)
hr = IDWriteFontFamily_GetMatchingFonts(family, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &fontlist2);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
ok(fontlist2 != fontlist, "unexpected font list\n");
IDWriteFontList_Release(fontlist2);
@@ -8884,17 +8881,17 @@ static void test_object_lifetime(void)
EXPECT_REF(factory, 2);
ref = IDWriteFontCollection_Release(collection);
- ok(ref == 0, "collection not released, %u\n", ref);
+ ok(ref == 0, "collection not released, %lu\n", ref);
EXPECT_REF(factory, 1);
/* GDI interop object takes factory reference */
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(interop, 1);
EXPECT_REF(factory, 2);
hr = IDWriteFactory_GetGdiInterop(factory, &interop2);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
ok(interop == interop2, "got unexpected interop pointer\n");
EXPECT_REF(interop, 2);
@@ -8902,10 +8899,10 @@ static void test_object_lifetime(void)
IDWriteGdiInterop_Release(interop2);
ref = IDWriteGdiInterop_Release(interop);
- ok(ref == 0, "interop not released, %u\n", ref);
+ ok(ref == 0, "interop not released, %lu\n", ref);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
struct testowner_object
@@ -8981,14 +8978,14 @@ static void test_inmemory_file_loader(void)
EXPECT_REF(factory, 1);
hr = IDWriteFactory5_CreateInMemoryFontFileLoader(factory, &loader);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(factory, 1);
testowner_init(&ownerobject);
fontface = create_fontface((IDWriteFactory *)factory);
hr = IDWriteFactory5_CreateInMemoryFontFileLoader(factory, &loader2);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
ok(loader != loader2, "unexpected pointer\n");
IDWriteInMemoryFontFileLoader_Release(loader2);
@@ -9000,41 +8997,41 @@ static void test_inmemory_file_loader(void)
/* Use whole font blob to construct in-memory file. */
count = 1;
hr = IDWriteFontFace_GetFiles(fontface, &count, &file);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
hr = IDWriteFontFile_GetLoader(file, &fileloader);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
hr = IDWriteFontFile_GetReferenceKey(file, &key, &key_size);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
hr = IDWriteFontFileLoader_CreateStreamFromKey(fileloader, key, key_size, &stream);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
IDWriteFontFileLoader_Release(fileloader);
IDWriteFontFile_Release(file);
hr = IDWriteFontFileStream_GetFileSize(stream, &file_size);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
hr = IDWriteFontFileStream_ReadFileFragment(stream, &data, 0, file_size, &context);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
/* Not registered yet. */
hr = IDWriteInMemoryFontFileLoader_CreateInMemoryFontFileReference(inmemory, (IDWriteFactory *)factory, data,
file_size, NULL, &file);
- ok(hr == E_INVALIDARG, "got %#x\n", hr);
+ ok(hr == E_INVALIDARG, "got %#lx\n", hr);
count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory);
ok(count == 1, "Unexpected file count %u.\n", count);
hr = IDWriteFactory5_RegisterFontFileLoader(factory, (IDWriteFontFileLoader *)inmemory);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(inmemory, 2);
EXPECT_REF(&ownerobject.IUnknown_iface, 1);
hr = IDWriteInMemoryFontFileLoader_CreateInMemoryFontFileReference(inmemory, (IDWriteFactory *)factory, data,
file_size, &ownerobject.IUnknown_iface, &file);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(&ownerobject.IUnknown_iface, 2);
EXPECT_REF(inmemory, 3);
@@ -9043,7 +9040,7 @@ static void test_inmemory_file_loader(void)
hr = IDWriteInMemoryFontFileLoader_CreateInMemoryFontFileReference(inmemory, (IDWriteFactory *)factory, data,
file_size, &ownerobject.IUnknown_iface, &file2);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
ok(file2 != file, "got unexpected file\n");
EXPECT_REF(&ownerobject.IUnknown_iface, 3);
EXPECT_REF(inmemory, 4);
@@ -9053,25 +9050,25 @@ static void test_inmemory_file_loader(void)
/* Check in-memory reference key format. */
hr = IDWriteFontFile_GetReferenceKey(file, &key, &key_size);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
ok(key && *(DWORD*)key == 1, "got wrong ref key\n");
ok(key_size == 4, "ref key size %u\n", key_size);
hr = IDWriteFontFile_GetReferenceKey(file2, &key, &key_size);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
ok(key && *(DWORD*)key == 2, "got wrong ref key\n");
ok(key_size == 4, "ref key size %u\n", key_size);
EXPECT_REF(inmemory, 4);
hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, key, key_size, &stream2);
- ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a stream, hr %#lx.\n", hr);
EXPECT_REF(stream2, 1);
EXPECT_REF(inmemory, 4);
hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, key, key_size, &stream3);
- ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a stream, hr %#lx.\n", hr);
ok(stream2 != stream3, "Unexpected stream.\n");
@@ -9081,7 +9078,7 @@ static void test_inmemory_file_loader(void)
/* Release file at index 1, create new one to see if index is reused. */
EXPECT_REF(&ownerobject.IUnknown_iface, 3);
ref = IDWriteFontFile_Release(file);
- ok(ref == 0, "File object not released, %u.\n", ref);
+ ok(ref == 0, "File object not released, %lu.\n", ref);
EXPECT_REF(&ownerobject.IUnknown_iface, 3);
count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory);
@@ -9089,58 +9086,58 @@ static void test_inmemory_file_loader(void)
EXPECT_REF(&ownerobject.IUnknown_iface, 3);
ref = IDWriteFontFile_Release(file2);
- ok(ref == 0, "File object not released, %u.\n", ref);
+ ok(ref == 0, "File object not released, %lu.\n", ref);
EXPECT_REF(&ownerobject.IUnknown_iface, 3);
count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory);
ok(count == 3, "Unexpected file count %u.\n", count);
hr = IDWriteFactory5_UnregisterFontFileLoader(factory, (IDWriteFontFileLoader *)inmemory);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(&ownerobject.IUnknown_iface, 3);
EXPECT_REF(&ownerobject.IUnknown_iface, 3);
ref = IDWriteInMemoryFontFileLoader_Release(inmemory);
- ok(ref == 0, "loader not released, %u.\n", ref);
+ ok(ref == 0, "loader not released, %lu.\n", ref);
EXPECT_REF(&ownerobject.IUnknown_iface, 1);
/* Test reference key for first added file. */
hr = IDWriteFactory5_CreateInMemoryFontFileLoader(factory, &loader);
- ok(hr == S_OK, "Failed to create loader, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create loader, hr %#lx.\n", hr);
inmemory = loader;
hr = IDWriteFactory5_RegisterFontFileLoader(factory, (IDWriteFontFileLoader *)inmemory);
- ok(hr == S_OK, "Failed to register loader, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to register loader, hr %#lx.\n", hr);
ref_key = 0;
hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, &ref_key, sizeof(ref_key), &stream2);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* With owner object. */
hr = IDWriteInMemoryFontFileLoader_CreateInMemoryFontFileReference(inmemory, (IDWriteFactory *)factory, data,
file_size, &ownerobject.IUnknown_iface, &file);
- ok(hr == S_OK, "Failed to create in-memory file reference, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create in-memory file reference, hr %#lx.\n", hr);
ref_key = 0;
hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, &ref_key, sizeof(ref_key), &stream2);
- ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a stream, hr %#lx.\n", hr);
context2 = (void *)0xdeadbeef;
hr = IDWriteFontFileStream_ReadFileFragment(stream2, &frag_start, 0, file_size, &context2);
- ok(hr == S_OK, "Failed to read a fragment, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to read a fragment, hr %#lx.\n", hr);
ok(context2 == NULL, "Unexpected context %p.\n", context2);
ok(frag_start == data, "Unexpected fragment pointer %p.\n", frag_start);
hr = IDWriteFontFileStream_GetFileSize(stream2, &size);
- ok(hr == S_OK, "Failed to get file size, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get file size, hr %#lx.\n", hr);
ok(size == file_size, "Unexpected file size.\n");
IDWriteFontFileStream_ReleaseFileFragment(stream2, context2);
writetime = 1;
hr = IDWriteFontFileStream_GetLastWriteTime(stream2, &writetime);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
ok(writetime == 0, "Unexpected writetime.\n");
IDWriteFontFileStream_Release(stream2);
@@ -9148,27 +9145,27 @@ static void test_inmemory_file_loader(void)
/* Without owner object. */
hr = IDWriteInMemoryFontFileLoader_CreateInMemoryFontFileReference(inmemory, (IDWriteFactory *)factory, data,
file_size, NULL, &file2);
- ok(hr == S_OK, "Failed to create in-memory file reference, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create in-memory file reference, hr %#lx.\n", hr);
ref_key = 1;
hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, &ref_key, sizeof(ref_key), &stream2);
- ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a stream, hr %#lx.\n", hr);
context2 = (void *)0xdeadbeef;
hr = IDWriteFontFileStream_ReadFileFragment(stream2, &frag_start, 0, file_size, &context2);
- ok(hr == S_OK, "Failed to read a fragment, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to read a fragment, hr %#lx.\n", hr);
ok(context2 == NULL, "Unexpected context %p.\n", context2);
ok(frag_start != data, "Unexpected fragment pointer %p.\n", frag_start);
hr = IDWriteFontFileStream_GetFileSize(stream2, &size);
- ok(hr == S_OK, "Failed to get file size, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get file size, hr %#lx.\n", hr);
ok(size == file_size, "Unexpected file size.\n");
IDWriteFontFileStream_ReleaseFileFragment(stream2, context2);
writetime = 1;
hr = IDWriteFontFileStream_GetLastWriteTime(stream2, &writetime);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
ok(writetime == 0, "Unexpected writetime.\n");
IDWriteFontFileStream_Release(stream2);
@@ -9177,21 +9174,21 @@ static void test_inmemory_file_loader(void)
/* Key size validation. */
ref_key = 0;
hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, NULL, sizeof(ref_key) - 1, &stream2);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ref_key = 0;
hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, &ref_key, sizeof(ref_key) - 1, &stream2);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ref_key = 0;
hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, &ref_key, sizeof(ref_key) + 1, &stream2);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory);
ok(count == 2, "Unexpected file count %u.\n", count);
hr = IDWriteFontFile_GetReferenceKey(file, &key, &key_size);
- ok(hr == S_OK, "Failed to get reference key, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get reference key, hr %#lx.\n", hr);
ok(key && *(DWORD*)key == 0, "Unexpected reference key.\n");
ok(key_size == 4, "Unexpected key size %u.\n", key_size);
@@ -9202,17 +9199,17 @@ static void test_inmemory_file_loader(void)
ok(count == 2, "Unexpected file count %u.\n", count);
hr = IDWriteFactory5_UnregisterFontFileLoader(factory, (IDWriteFontFileLoader *)inmemory);
- ok(hr == S_OK, "Failed to unregister loader, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to unregister loader, hr %#lx.\n", hr);
IDWriteFontFileStream_ReleaseFileFragment(stream, context);
IDWriteFontFileStream_Release(stream);
IDWriteFontFace_Release(fontface);
ref = IDWriteInMemoryFontFileLoader_Release(inmemory);
- ok(ref == 0, "loader not released, %u.\n", ref);
+ ok(ref == 0, "loader not released, %lu.\n", ref);
ref = IDWriteFactory5_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static BOOL face_has_table(IDWriteFontFace4 *fontface, UINT32 tag)
@@ -9224,7 +9221,7 @@ static BOOL face_has_table(IDWriteFontFace4 *fontface, UINT32 tag)
HRESULT hr;
hr = IDWriteFontFace4_TryGetFontTable(fontface, tag, &data, &size, &context, &exists);
- ok(hr == S_OK, "TryGetFontTable() failed, %#x\n", hr);
+ ok(hr == S_OK, "TryGetFontTable() failed, %#lx\n", hr);
if (exists)
IDWriteFontFace4_ReleaseFontTable(fontface, context);
@@ -9244,7 +9241,7 @@ static DWORD get_sbix_formats(IDWriteFontFace4 *fontface)
HRESULT hr;
hr = IDWriteFontFace4_TryGetFontTable(fontface, MS_MAXP_TAG, &data, &size, &context, &exists);
- ok(hr == S_OK, "TryGetFontTable() failed, %#x\n", hr);
+ ok(hr == S_OK, "TryGetFontTable() failed, %#lx\n", hr);
ok(exists, "Expected maxp table\n");
if (!exists)
@@ -9254,7 +9251,7 @@ static DWORD get_sbix_formats(IDWriteFontFace4 *fontface)
num_glyphs = GET_BE_WORD(maxp->numGlyphs);
hr = IDWriteFontFace4_TryGetFontTable(fontface, MS_SBIX_TAG, &data, &size, &context, &exists);
- ok(hr == S_OK, "TryGetFontTable() failed, %#x\n", hr);
+ ok(hr == S_OK, "TryGetFontTable() failed, %#lx\n", hr);
ok(exists, "Expected sbix table\n");
header = data;
@@ -9285,7 +9282,7 @@ static DWORD get_sbix_formats(IDWriteFontFace4 *fontface)
ret |= DWRITE_GLYPH_IMAGE_FORMATS_TIFF;
break;
default:
- ok(0, "unexpected format, %#x\n", GET_BE_DWORD(format));
+ ok(0, "unexpected format, %#lx\n", GET_BE_DWORD(format));
}
}
}
@@ -9306,7 +9303,7 @@ static DWORD get_cblc_formats(IDWriteFontFace4 *fontface)
HRESULT hr;
hr = IDWriteFontFace4_TryGetFontTable(fontface, MS_CBLC_TAG, (const void **)&header, &size, &context, &exists);
- ok(hr == S_OK, "TryGetFontTable() failed, %#x\n", hr);
+ ok(hr == S_OK, "TryGetFontTable() failed, %#lx\n", hr);
ok(exists, "Expected CBLC table\n");
if (!exists)
@@ -9378,7 +9375,7 @@ static void test_GetGlyphImageFormats(void)
IDWriteFontFace4_Release(fontface4);
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < count; i++) {
@@ -9389,10 +9386,10 @@ static void test_GetGlyphImageFormats(void)
IDWriteFont *font;
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, familynameW, ARRAY_SIZE(familynameW));
IDWriteLocalizedStrings_Release(names);
@@ -9402,13 +9399,13 @@ static void test_GetGlyphImageFormats(void)
DWORD formats, expected_formats;
hr = IDWriteFontFamily_GetFont(family, j, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &names);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, facenameW, ARRAY_SIZE(facenameW));
@@ -9419,7 +9416,7 @@ static void test_GetGlyphImageFormats(void)
/* Mask describes font as a whole. */
formats = IDWriteFontFace4_GetGlyphImageFormats(fontface4);
expected_formats = get_face_glyph_image_formats(fontface4);
- ok(formats == expected_formats, "%s - %s, expected formats %#x, got formats %#x.\n",
+ ok(formats == expected_formats, "%s - %s, expected formats %#lx, got formats %#lx.\n",
wine_dbgstr_w(familynameW), wine_dbgstr_w(facenameW), expected_formats, formats);
IDWriteFontFace4_Release(fontface4);
@@ -9432,7 +9429,7 @@ static void test_GetGlyphImageFormats(void)
IDWriteFontCollection_Release(syscollection);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_CreateCustomRenderingParams(void)
@@ -9474,7 +9471,7 @@ static void test_CreateCustomRenderingParams(void)
params = (void *)0xdeadbeef;
hr = IDWriteFactory_CreateCustomRenderingParams(factory, params_tests[i].gamma, params_tests[i].contrast,
params_tests[i].cleartype_level, params_tests[i].geometry, params_tests[i].rendering_mode, ¶ms);
- ok(hr == params_tests[i].hr, "unexpected hr %#x, expected %#x.\n", hr, params_tests[i].hr);
+ ok(hr == params_tests[i].hr, "unexpected hr %#lx, expected %#lx.\n", hr, params_tests[i].hr);
if (hr == S_OK) {
ok(params_tests[i].gamma == IDWriteRenderingParams_GetGamma(params), "unexpected gamma %f, expected %f.\n",
@@ -9500,7 +9497,7 @@ static void test_CreateCustomRenderingParams(void)
}
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
}
static void test_localfontfileloader(void)
@@ -9518,17 +9515,17 @@ static void test_localfontfileloader(void)
path = create_testfontfile(test_fontfile);
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "Failed to create file reference, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create file reference, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFileReference(factory2, path, NULL, &file2);
- ok(hr == S_OK, "Failed to create file reference, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create file reference, hr %#lx.\n", hr);
ok(file != file2, "Unexpected file instance.\n");
hr = IDWriteFontFile_GetLoader(file, &loader);
- ok(hr == S_OK, "Failed to get loader, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get loader, hr %#lx.\n", hr);
hr = IDWriteFontFile_GetLoader(file2, &loader2);
- ok(hr == S_OK, "Failed to get loader, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get loader, hr %#lx.\n", hr);
ok(loader == loader2, "Unexpected loader instance\n");
IDWriteFontFile_Release(file);
@@ -9536,9 +9533,9 @@ static void test_localfontfileloader(void)
IDWriteFontFileLoader_Release(loader);
IDWriteFontFileLoader_Release(loader2);
ref = IDWriteFactory_Release(factory);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
ref = IDWriteFactory_Release(factory2);
- ok(ref == 0, "factory not released, %u\n", ref);
+ ok(ref == 0, "factory not released, %lu\n", ref);
DELETE_FONTFILE(path);
}
@@ -9619,7 +9616,7 @@ static void test_fontsetbuilder(void)
EXPECT_REF(factory, 1);
hr = IDWriteFactory3_CreateFontSetBuilder(factory, &builder);
- ok(hr == S_OK, "Failed to create font set builder, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create font set builder, hr %#lx.\n", hr);
EXPECT_REF(factory, 2);
if (SUCCEEDED(hr = IDWriteFontSetBuilder_QueryInterface(builder, &IID_IDWriteFontSetBuilder1, (void **)&builder1)))
@@ -9627,16 +9624,16 @@ static void test_fontsetbuilder(void)
path = create_testfontfile(test_fontfile);
hr = IDWriteFactory3_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFontSetBuilder1_AddFontFile(builder1, file);
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFontSetBuilder1_CreateFontSet(builder1, &fontset);
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFactory3_CreateFontCollectionFromFontSet(factory, fontset, &collection);
todo_wine
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
if (SUCCEEDED(hr))
{
count = IDWriteFontCollection1_GetFontFamilyCount(collection);
@@ -9646,14 +9643,14 @@ static void test_fontsetbuilder(void)
IDWriteFontSet_Release(fontset);
hr = IDWriteFontSetBuilder1_AddFontFile(builder1, file);
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFontSetBuilder1_CreateFontSet(builder1, &fontset);
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFactory3_CreateFontCollectionFromFontSet(factory, fontset, &collection);
todo_wine
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
if (SUCCEEDED(hr))
{
check_familymodel(collection, DWRITE_FONT_FAMILY_MODEL_WEIGHT_STRETCH_STYLE);
@@ -9667,10 +9664,10 @@ static void test_fontsetbuilder(void)
ok(count == 2, "Unexpected font count %u.\n", count);
hr = IDWriteFontSet_GetFontFaceReference(fontset, 0, &ref);
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFontFaceReference_QueryInterface(ref, &IID_IDWriteFontFaceReference1, (void **)&ref1);
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
count = IDWriteFontFaceReference1_GetFontAxisValueCount(ref1);
todo_wine
@@ -9679,7 +9676,7 @@ static void test_fontsetbuilder(void)
if (count == 4)
{
hr = IDWriteFontFaceReference1_GetFontAxisValues(ref1, axis_values, ARRAY_SIZE(axis_values));
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
ok(axis_values[0].axisTag == DWRITE_FONT_AXIS_TAG_WEIGHT, "Unexpected tag[0] %s.\n",
wine_dbgstr_an((char *)&axis_values[0].axisTag, 4));
@@ -9709,7 +9706,7 @@ static void test_fontsetbuilder(void)
IDWriteFontSetBuilder_Release(builder);
hr = IDWriteFactory3_GetSystemFontCollection(factory, FALSE, &collection, FALSE);
- ok(hr == S_OK, "Failed to get system collection, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get system collection, hr %#lx.\n", hr);
count = IDWriteFontCollection1_GetFontFamilyCount(collection);
for (i = 0; i < count; i++) {
@@ -9718,7 +9715,7 @@ static void test_fontsetbuilder(void)
IDWriteFont3 *font;
hr = IDWriteFontCollection1_GetFontFamily(collection, i, &family);
- ok(hr == S_OK, "Failed to get family, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get family, hr %#lx.\n", hr);
fontcount = IDWriteFontFamily1_GetFontCount(family);
for (j = 0; j < fontcount; ++j)
@@ -9727,39 +9724,39 @@ static void test_fontsetbuilder(void)
UINT32 setcount, id;
hr = IDWriteFontFamily1_GetFont(family, j, &font);
- ok(hr == S_OK, "Failed to get font, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font, hr %#lx.\n", hr);
/* Create a set with a single font reference, test set properties. */
hr = IDWriteFactory3_CreateFontSetBuilder(factory, &builder);
- ok(hr == S_OK, "Failed to create font set builder, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create font set builder, hr %#lx.\n", hr);
hr = IDWriteFont3_GetFontFaceReference(font, &ref);
- ok(hr == S_OK, "Failed to get fontface reference, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get fontface reference, hr %#lx.\n", hr);
EXPECT_REF(ref, 1);
hr = IDWriteFontSetBuilder_AddFontFaceReference(builder, ref);
- ok(hr == S_OK, "Failed to add fontface reference, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to add fontface reference, hr %#lx.\n", hr);
EXPECT_REF(ref, 1);
hr = IDWriteFontSetBuilder_CreateFontSet(builder, &fontset);
- ok(hr == S_OK, "Failed to create a font set, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a font set, hr %#lx.\n", hr);
setcount = IDWriteFontSet_GetFontCount(fontset);
ok(setcount == 1, "Unexpected font count %u.\n", setcount);
ref2 = (void *)0xdeadbeef;
hr = IDWriteFontSet_GetFontFaceReference(fontset, setcount, &ref2);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!ref2, "Unexpected pointer.\n");
ref2 = NULL;
hr = IDWriteFontSet_GetFontFaceReference(fontset, 0, &ref2);
- ok(hr == S_OK, "Failed to get font face reference, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font face reference, hr %#lx.\n", hr);
ok(ref2 != ref, "Unexpected reference.\n");
ref3 = NULL;
hr = IDWriteFontSet_GetFontFaceReference(fontset, 0, &ref3);
- ok(hr == S_OK, "Failed to get font face reference, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font face reference, hr %#lx.\n", hr);
ok(ref2 != ref3, "Unexpected reference.\n");
IDWriteFontFaceReference_Release(ref3);
@@ -9773,7 +9770,7 @@ static void test_fontsetbuilder(void)
BOOL exists = FALSE;
hr = IDWriteFontSet_GetPropertyValues(fontset, 0, id, &exists, &values);
- ok(hr == S_OK, "Failed to get property value, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get property value, hr %#lx.\n", hr);
if (id == DWRITE_FONT_PROPERTY_ID_WEIGHT || id == DWRITE_FONT_PROPERTY_ID_STRETCH
|| id == DWRITE_FONT_PROPERTY_ID_STYLE)
@@ -9810,12 +9807,12 @@ static void test_fontsetbuilder(void)
buffW[0] = 'a';
hr = IDWriteLocalizedStrings_GetLocaleName(values, 0, buffW, ARRAY_SIZE(buffW));
- ok(hr == S_OK, "Failed to get locale name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get locale name, hr %#lx.\n", hr);
ok(!*buffW, "Unexpected locale %s.\n", wine_dbgstr_w(buffW));
buff2W[0] = 0;
hr = IDWriteLocalizedStrings_GetString(values, 0, buff2W, ARRAY_SIZE(buff2W));
- ok(hr == S_OK, "Failed to get property string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get property string, hr %#lx.\n", hr);
wsprintfW(buffW, L"%u", ivalue);
ok(!lstrcmpW(buffW, buff2W), "Unexpected property value %s, expected %s.\n", wine_dbgstr_w(buff2W),
@@ -9868,18 +9865,18 @@ static void test_font_resource(void)
count = 1;
hr = IDWriteFontFace_GetFiles(fontface, &count, &fontfile);
- ok(hr == S_OK, "Failed to get file object, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get file object, hr %#lx.\n", hr);
hr = IDWriteFactory6_CreateFontResource(factory, fontfile, 0, &resource);
- ok(hr == S_OK, "Failed to create font resource, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create font resource, hr %#lx.\n", hr);
hr = IDWriteFactory6_CreateFontResource(factory, fontfile, 0, &resource2);
- ok(hr == S_OK, "Failed to create font resource, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create font resource, hr %#lx.\n", hr);
ok(resource != resource2, "Unexpected instance.\n");
IDWriteFontResource_Release(resource2);
hr = IDWriteFontResource_GetFontFile(resource, &fontfile2);
- ok(hr == S_OK, "Failed to get font file, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font file, hr %#lx.\n", hr);
ok(fontfile2 == fontfile, "Unexpected file instance.\n");
IDWriteFontFile_Release(fontfile2);
@@ -9890,7 +9887,7 @@ static void test_font_resource(void)
axis_values[0].axisTag = DWRITE_FONT_AXIS_TAG_WEIGHT;
axis_values[0].value = 400.0f;
hr = IDWriteFontResource_CreateFontFaceReference(resource, DWRITE_FONT_SIMULATIONS_NONE, axis_values, 1, &reference);
- ok(hr == S_OK, "Failed to create reference object, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create reference object, hr %#lx.\n", hr);
count = IDWriteFontFaceReference1_GetFontAxisValueCount(reference);
ok(count == 1, "Unexpected axis value count.\n");
@@ -9905,25 +9902,25 @@ static void test_font_resource(void)
EXPECT_REF(resource, 1);
hr = IDWriteFontResource_CreateFontFaceReference(resource, DWRITE_FONT_SIMULATIONS_NONE, NULL, 0, &reference);
- ok(hr == S_OK, "Failed to create reference object, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create reference object, hr %#lx.\n", hr);
EXPECT_REF(resource, 1);
hr = IDWriteFontResource_CreateFontFaceReference(resource, DWRITE_FONT_SIMULATIONS_NONE, NULL, 0, &reference2);
- ok(hr == S_OK, "Failed to create reference object, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create reference object, hr %#lx.\n", hr);
ok(reference != reference2, "Unexpected reference instance.\n");
IDWriteFontFaceReference1_Release(reference2);
IDWriteFontFaceReference1_Release(reference);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace5, (void **)&fontface5);
- ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr);
hr = IDWriteFontFace5_GetFontResource(fontface5, &resource2);
- ok(hr == S_OK, "Failed to get font resource, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font resource, hr %#lx.\n", hr);
ok(resource != resource2, "Unexpected resource instance.\n");
IDWriteFontResource_Release(resource);
hr = IDWriteFontFace5_GetFontResource(fontface5, &resource);
- ok(hr == S_OK, "Failed to get font resource, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font resource, hr %#lx.\n", hr);
ok(resource != resource2, "Unexpected resource instance.\n");
EXPECT_REF(resource, 1);
IDWriteFontResource_Release(resource);
@@ -9980,16 +9977,16 @@ static void test_font_resource(void)
memset(axis_values, 0, sizeof(axis_values));
hr = IDWriteFontFaceReference1_GetFontAxisValues(reference, axis_values, 1);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(!axis_values[0].axisTag, "Unexpected axis tag.\n");
memset(axis_values, 0, sizeof(axis_values));
hr = IDWriteFontFaceReference1_GetFontAxisValues(reference, axis_values, 2);
- ok(hr == S_OK, "Failed to get axis values, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get axis values, hr %#lx.\n", hr);
ok(axis_values[0].axisTag == DWRITE_FONT_AXIS_TAG_WEIGHT, "Unexpected axis tag.\n");
hr = IDWriteFontFaceReference1_CreateFontFace(reference, &fontface5);
- ok(hr == S_OK, "Failed to create a font face, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a font face, hr %#lx.\n", hr);
IDWriteFontFace5_Release(fontface5);
IDWriteFontFaceReference1_Release(reference);
@@ -9998,7 +9995,7 @@ static void test_font_resource(void)
IDWriteFontFace_Release(fontface);
ref = IDWriteFactory6_Release(factory);
- ok(ref == 0, "Factory wasn't released, %u.\n", ref);
+ ok(ref == 0, "Factory wasn't released, %lu.\n", ref);
}
static BOOL get_expected_is_color(IDWriteFontFace2 *fontface)
@@ -10010,14 +10007,14 @@ static BOOL get_expected_is_color(IDWriteFontFace2 *fontface)
HRESULT hr;
hr = IDWriteFontFace2_TryGetFontTable(fontface, MS_CPAL_TAG, (const void **)&data, &size, &context, &exists);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (context)
IDWriteFontFace2_ReleaseFontTable(fontface, context);
if (exists)
{
hr = IDWriteFontFace2_TryGetFontTable(fontface, MS_COLR_TAG, (const void **)&data, &size, &context, &exists);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (context)
IDWriteFontFace2_ReleaseFontTable(fontface, context);
}
@@ -10042,7 +10039,7 @@ static void test_IsColorFont(void)
}
hr = IDWriteFactory2_GetSystemFontCollection(factory, &collection, FALSE);
- ok(hr == S_OK, "Failed to get font collection, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font collection, hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(collection);
for (i = 0; i < count; ++i)
@@ -10053,10 +10050,10 @@ static void test_IsColorFont(void)
WCHAR nameW[256];
hr = IDWriteFontCollection_GetFontFamily(collection, i, &family);
- ok(hr == S_OK, "Failed to get family, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get family, hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "Failed to get names, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get names, hr %#lx.\n", hr);
get_enus_string(names, nameW, ARRAY_SIZE(nameW));
IDWriteLocalizedStrings_Release(names);
@@ -10071,17 +10068,17 @@ static void test_IsColorFont(void)
IDWriteFont *font;
hr = IDWriteFontFamily_GetFont(family, j, &font);
- ok(hr == S_OK, "Failed to get font, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get font, hr %#lx.\n", hr);
hr = IDWriteFont_QueryInterface(font, &IID_IDWriteFont2, (void **)&font2);
- ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr);
IDWriteFont_Release(font);
hr = IDWriteFont2_CreateFontFace(font2, &fontface);
- ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace2, (void **)&fontface2);
- ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr);
IDWriteFontFace_Release(fontface);
is_color_font = IDWriteFont2_IsColorFont(font2);
@@ -10101,7 +10098,7 @@ static void test_IsColorFont(void)
IDWriteFontCollection_Release(collection);
refcount = IDWriteFactory2_Release(factory);
- ok(refcount == 0, "Factory not released, refcount %u.\n", refcount);
+ ok(refcount == 0, "Factory not released, refcount %lu.\n", refcount);
}
static void test_GetVerticalGlyphVariants(void)
@@ -10130,12 +10127,12 @@ static void test_GetVerticalGlyphVariants(void)
ch = 'A';
*glyphs = 0;
hr = IDWriteFontFace1_GetGlyphIndices(fontface1, &ch, 1, glyphs);
- ok(hr == S_OK, "Failed to get glyph, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get glyph, hr %#lx.\n", hr);
ok(!!*glyphs, "Unexpected glyph %u.\n", glyphs[0]);
memset(glyph_variants, 0, sizeof(glyph_variants));
hr = IDWriteFontFace1_GetVerticalGlyphVariants(fontface1, 1, glyphs, glyph_variants);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(glyphs[0] == glyph_variants[0], "Unexpected glyph.\n");
ret = IDWriteFontFace1_HasVerticalGlyphVariants(fontface1);
@@ -10143,7 +10140,7 @@ static void test_GetVerticalGlyphVariants(void)
IDWriteFontFace1_Release(fontface1);
refcount = IDWriteFactory_Release(factory);
- ok(!refcount, "Factory not released, refcount %u.\n", refcount);
+ ok(!refcount, "Factory not released, refcount %lu.\n", refcount);
}
static HANDLE get_collection_expiration_event(IDWriteFontCollection *collection)
@@ -10153,7 +10150,7 @@ static HANDLE get_collection_expiration_event(IDWriteFontCollection *collection)
HRESULT hr;
hr = IDWriteFontCollection_QueryInterface(collection, &IID_IDWriteFontCollection3, (void **)&collection3);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
event = IDWriteFontCollection3_GetExpirationEvent(collection3);
IDWriteFontCollection3_Release(collection3);
@@ -10172,7 +10169,7 @@ static void test_expiration_event(void)
factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_QueryInterface(collection, &IID_IDWriteFontCollection3, (void **)&collection3);
if (FAILED(hr))
@@ -10192,7 +10189,7 @@ static void test_expiration_event(void)
factory2 = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory2, &collection2, FALSE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
event2 = get_collection_expiration_event(collection2);
todo_wine {
ok(!!event2, "Unexpected event handle.\n");
@@ -10225,17 +10222,17 @@ static void test_family_font_set(void)
factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(IDWriteFontFamily_QueryInterface(family, &IID_IDWriteFontFamily2, (void **)&family2)))
{
hr = IDWriteFontFamily2_GetFontSet(family2, &fontset);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily2_GetFontSet(family2, &fontset2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fontset != fontset2, "Unexpected fontset instance.\n");
count = IDWriteFontSet1_GetFontCount(fontset);
@@ -10244,37 +10241,37 @@ static void test_family_font_set(void)
exists = TRUE;
values = (void *)0xdeadbeef;
hr = IDWriteFontSet1_GetPropertyValues(fontset, 0, 100, &exists, &values);
- ok(FAILED(hr), "Unexpected hr %#x.\n", hr);
+ ok(FAILED(hr), "Unexpected hr %#lx.\n", hr);
ok(!exists && !values, "Unexpected return value.\n");
/* Invalid index. */
exists = TRUE;
values = (void *)0xdeadbeef;
hr = IDWriteFontSet1_GetPropertyValues(fontset, count, DWRITE_FONT_PROPERTY_ID_POSTSCRIPT_NAME, &exists, &values);
- ok(FAILED(hr), "Unexpected hr %#x.\n", hr);
+ ok(FAILED(hr), "Unexpected hr %#lx.\n", hr);
ok(!exists && !values, "Unexpected return value.\n");
exists = TRUE;
values = (void *)0xdeadbeef;
hr = IDWriteFontSet1_GetPropertyValues(fontset, count, 100, &exists, &values);
- ok(FAILED(hr), "Unexpected hr %#x.\n", hr);
+ ok(FAILED(hr), "Unexpected hr %#lx.\n", hr);
ok(!exists && !values, "Unexpected return value.\n");
hr = IDWriteFontSet1_GetPropertyValues(fontset, 0, DWRITE_FONT_PROPERTY_ID_POSTSCRIPT_NAME, &exists, &values);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(exists == !!values, "Unexpected return value.\n");
if (values)
{
hr = IDWriteLocalizedStrings_GetString(values, 0, buffW, ARRAY_SIZE(buffW));
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteLocalizedStrings_Release(values);
}
hr = IDWriteFontSet1_CreateFontResource(fontset, 100, &resource);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontSet1_CreateFontResource(fontset, 0, &resource);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontResource_Release(resource);
IDWriteFontSet1_Release(fontset2);
@@ -10309,7 +10306,7 @@ static void test_system_font_set(void)
}
hr = IDWriteFactory3_GetSystemFontSet(factory, &fontset);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontSet_GetFontCount(fontset);
ok(!!count, "Unexpected font count %u.\n", count);
@@ -10318,15 +10315,15 @@ static void test_system_font_set(void)
p.propertyValue = L"Tahoma";
p.localeName = L"";
hr = IDWriteFontSet_GetMatchingFonts(fontset, &p, 1, &filtered_set);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontSet_GetFontCount(filtered_set);
ok(!!count, "Unexpected font count %u.\n", count);
hr = IDWriteFontSet_GetFontFaceReference(filtered_set, 0, &ref);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFaceReference_CreateFontFace(ref, &fontface);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace3_Release(fontface);
IDWriteFontFaceReference_Release(ref);
@@ -10359,33 +10356,33 @@ static void test_CreateFontCollectionFromFontSet(void)
}
hr = IDWriteFactory5_CreateFontSetBuilder(factory, &builder);
- ok(hr == S_OK, "Failed to create font set builder, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create font set builder, hr %#lx.\n", hr);
path = create_testfontfile(test_fontfile);
hr = IDWriteFactory5_CreateFontFileReference(factory, path, NULL, &file);
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFontSetBuilder1_AddFontFile(builder, file);
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
/* Add same file, with explicit properties. */
hr = IDWriteFactory5_CreateFontFaceReference_(factory, file, 0, DWRITE_FONT_SIMULATIONS_NONE, &ref);
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
props[0].propertyId = DWRITE_FONT_PROPERTY_ID_WEIGHT_STRETCH_STYLE_FAMILY_NAME;
props[0].propertyValue = L"Another Font";
props[0].localeName = L"en-US";
hr = IDWriteFontSetBuilder1_AddFontFaceReference_(builder, ref, props, 1);
todo_wine
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
IDWriteFontFaceReference_Release(ref);
hr = IDWriteFontSetBuilder1_CreateFontSet(builder, &fontset);
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFactory5_CreateFontCollectionFromFontSet(factory, fontset, &collection);
todo_wine
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
if (SUCCEEDED(hr))
{
@@ -10395,7 +10392,7 @@ if (SUCCEEDED(hr))
/* Explicit fontset properties are prioritized and not replaced by actual properties from a file. */
exists = FALSE;
hr = IDWriteFontCollection1_FindFamilyName(collection, L"Another Font", &index, &exists);
- ok(hr == S_OK, "Unexpected hr %#x.\n",hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
ok(!!exists, "Unexpected return value %d.\n", exists);
IDWriteFontCollection1_Release(collection);
@@ -10428,14 +10425,14 @@ static void test_GetMatchingFontsByLOGFONT(void)
}
hr = IDWriteFactory3_GetSystemFontSet(factory, &systemset);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
interop = NULL;
hr = IDWriteFactory3_GetGdiInterop(factory, &interop0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGdiInterop_QueryInterface(interop0, &IID_IDWriteGdiInterop1, (void **)&interop);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteGdiInterop_Release(interop0);
memset(&logfont, 0, sizeof(logfont));
@@ -10446,16 +10443,16 @@ static void test_GetMatchingFontsByLOGFONT(void)
lstrcpyW(logfont.lfFaceName, L"tahoma");
hr = IDWriteGdiInterop1_GetMatchingFontsByLOGFONT(interop, NULL, systemset, &set);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGdiInterop1_GetMatchingFontsByLOGFONT(interop, &logfont, NULL, &set);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGdiInterop1_GetMatchingFontsByLOGFONT(interop, &logfont, systemset, &set);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontSet_GetFontCount(set);
- ok(count > 0, "Unexpected count %u.\n", count);
+ ok(count > 0, "Unexpected count %lu.\n", count);
IDWriteFontSet_Release(set);
@@ -10463,7 +10460,7 @@ static void test_GetMatchingFontsByLOGFONT(void)
IDWriteFontSet_Release(systemset);
refcount = IDWriteFactory3_Release(factory);
- ok(!refcount, "Factory wasn't released, %u.\n", refcount);
+ ok(!refcount, "Factory wasn't released, %lu.\n", refcount);
}
START_TEST(font)
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index 95166376ac7..c77c6ff2034 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -216,10 +216,10 @@ static void get_script_analysis(const WCHAR *str, UINT32 len, DWRITE_SCRIPT_ANAL
factory = create_factory();
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_AnalyzeScript(analyzer, &analysissource, 0, len, &analysissink.IDWriteTextAnalysisSink_iface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
*sa = analysissink.sa;
IDWriteFactory_Release(factory);
@@ -237,16 +237,16 @@ static IDWriteFontFace *get_fontface_from_format(IDWriteTextFormat *format)
HRESULT hr;
hr = IDWriteTextFormat_GetFontCollection(format, &collection);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_GetFontFamilyName(format, nameW, ARRAY_SIZE(nameW));
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_FindFamilyName(collection, nameW, &index, &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, index, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontCollection_Release(collection);
hr = IDWriteFontFamily_GetFirstMatchingFont(family,
@@ -254,10 +254,10 @@ static IDWriteFontFace *get_fontface_from_format(IDWriteTextFormat *format)
IDWriteTextFormat_GetFontStretch(format),
IDWriteTextFormat_GetFontStyle(format),
&font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font);
IDWriteFontFamily_Release(family);
@@ -271,7 +271,7 @@ static void _expect_ref(IUnknown* obj, ULONG ref, int line)
ULONG rc;
IUnknown_AddRef(obj);
rc = IUnknown_Release(obj);
- ok_(__FILE__,line)(rc == ref, "expected refcount %d, got %d\n", ref, rc);
+ ok_(__FILE__,line)(rc == ref, "expected refcount %ld, got %ld\n", ref, rc);
}
enum drawcall_modifiers_kind {
@@ -913,60 +913,60 @@ static void test_CreateTextLayout(void)
layout = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateTextLayout(factory, NULL, 0, NULL, 0.0f, 0.0f, &layout);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, NULL, 0.0f, 0.0f, &layout);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, NULL, 1.0f, 0.0f, &layout);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, NULL, 0.0f, 1.0f, &layout);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, NULL, 1000.0f, 1000.0f, &layout);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "got %p\n", layout);
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create format, hr %#lx.\n", hr);
layout = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateTextLayout(factory, NULL, 0, format, 100.0f, 100.0f, &layout);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "got %p\n", layout);
layout = (void *)0xdeadbeef;
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, -100.0f, 100.0f, &layout);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "Unexpected pointer %p.\n", layout);
layout = (void *)0xdeadbeef;
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 100.0f, -100.0f, &layout);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "Unexpected pointer %p.\n", layout);
layout = (void *)0xdeadbeef;
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, -100.0f, -100.0f, &layout);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "Unexpected pointer %p.\n", layout);
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 0, format, 0.0f, 0.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
IDWriteTextLayout_Release(layout);
EXPECT_REF(format, 1);
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
EXPECT_REF(format, 1);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout2, (void**)&layout2);
@@ -976,33 +976,33 @@ static void test_CreateTextLayout(void)
IDWriteTextFormat *format;
hr = IDWriteTextLayout2_QueryInterface(layout2, &IID_IDWriteTextLayout1, (void**)&layout1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout1_Release(layout1);
EXPECT_REF(layout2, 2);
hr = IDWriteTextLayout2_QueryInterface(layout2, &IID_IDWriteTextFormat1, (void**)&format1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(layout2, 3);
hr = IDWriteTextLayout2_QueryInterface(layout2, &IID_IDWriteTextFormat, (void**)&format);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(format == (IDWriteTextFormat*)format1, "got %p, %p\n", format, format1);
ok(format != (IDWriteTextFormat*)layout2, "got %p, %p\n", format, layout2);
EXPECT_REF(layout2, 4);
hr = IDWriteTextFormat_QueryInterface(format, &IID_IDWriteTextLayout1, (void**)&layout1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout1_Release(layout1);
IDWriteTextFormat1_Release(format1);
IDWriteTextFormat_Release(format);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat1, (void**)&format1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(layout2, 3);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat, (void**)&format);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(format == (IDWriteTextFormat*)format1, "got %p, %p\n", format, format1);
EXPECT_REF(layout2, 4);
@@ -1015,7 +1015,7 @@ static void test_CreateTextLayout(void)
if (layout2 && SUCCEEDED(IDWriteTextLayout2_QueryInterface(layout2, &IID_IDWriteTextLayout4, (void **)&layout4)))
{
hr = IDWriteTextLayout4_QueryInterface(layout4, &IID_IDWriteTextFormat3, (void **)&format3);
- ok(hr == S_OK, "Failed to get text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get text format, hr %#lx.\n", hr);
IDWriteTextFormat3_Release(format3);
}
else
@@ -1051,65 +1051,65 @@ static void test_CreateGdiCompatibleTextLayout(void)
layout = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, NULL, 0, NULL, 0.0f, 0.0f, 0.0f, NULL, FALSE, &layout);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, NULL, 0.0f, 0.0f, 0.0f, NULL,
FALSE, &layout);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, NULL, 1.0f, 0.0f, 0.0f, NULL,
FALSE, &layout);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, NULL, 1.0f, 0.0f, 1.0f, NULL,
FALSE, &layout);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, NULL, 1000.0f, 1000.0f, 1.0f, NULL,
FALSE, &layout);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "got %p\n", layout);
/* create with text format */
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
EXPECT_REF(format, 1);
layout = (void*)0xdeadbeef;
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, NULL, 0, format, 100.0f, 100.0f, 1.0f, NULL, FALSE, &layout);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "got %p\n", layout);
layout = (void *)0xdeadbeef;
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, -100.0f, 100.0f, 1.0f,
NULL, FALSE, &layout);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "Unexpected pointer %p.\n", layout);
layout = (void *)0xdeadbeef;
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, -100.0f, 1.0f,
NULL, FALSE, &layout);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "Unexpected pointer %p.\n", layout);
layout = (void *)0xdeadbeef;
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, -100.0f, -100.0f, 1.0f,
NULL, FALSE, &layout);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(layout == NULL, "Unexpected pointer %p.\n", layout);
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, 1.0f, NULL,
FALSE, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
EXPECT_REF(format, 1);
EXPECT_REF(layout, 1);
@@ -1122,7 +1122,7 @@ static void test_CreateGdiCompatibleTextLayout(void)
/* zero length string is okay */
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 0, format, 100.0f, 100.0f, 1.0f, NULL,
FALSE, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
dimension = IDWriteTextLayout_GetMaxWidth(layout);
ok(dimension == 100.0, "got %f\n", dimension);
@@ -1135,12 +1135,12 @@ static void test_CreateGdiCompatibleTextLayout(void)
/* negative, zero ppdip */
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 1, format, 100.0f, 100.0f, -1.0f, NULL,
FALSE, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
IDWriteTextLayout_Release(layout);
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 1, format, 100.0f, 100.0f, 0.0f, NULL,
FALSE, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
IDWriteTextLayout_Release(layout);
/* transforms */
@@ -1148,7 +1148,7 @@ static void test_CreateGdiCompatibleTextLayout(void)
{
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 1, format, 100.0f, 100.0f, 1.0f,
&layoutcreate_transforms[i], FALSE, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
IDWriteTextLayout_Release(layout);
}
@@ -1177,45 +1177,45 @@ static void test_CreateTextFormat(void)
/* zero/negative font size */
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 0.0f, L"en-us", &format);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, -10.0f, L"en-us", &format);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* invalid font properties */
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, 1000, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_ITALIC + 1, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_ITALIC,
10, 10.0f, L"en-us", &format);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* empty family name */
hr = IDWriteFactory_CreateTextFormat(factory, L"", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
IDWriteTextFormat_Release(format);
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
if (0) /* crashes on native */
hr = IDWriteTextFormat_GetFontCollection(format, NULL);
collection = NULL;
hr = IDWriteTextFormat_GetFontCollection(format, &collection);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(collection != NULL, "got %p\n", collection);
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscoll, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(collection == syscoll, "got %p, was %p\n", syscoll, collection);
IDWriteFontCollection_Release(syscoll);
IDWriteFontCollection_Release(collection);
@@ -1237,7 +1237,7 @@ static void test_CreateTextFormat(void)
ok(flow == DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM, "got %d\n", flow);
hr = IDWriteTextFormat_GetLineSpacing(format, &method, &spacing, &baseline);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(spacing == 0.0, "got %f\n", spacing);
ok(baseline == 0.0, "got %f\n", baseline);
ok(method == DWRITE_LINE_SPACING_METHOD_DEFAULT, "got %d\n", method);
@@ -1247,7 +1247,7 @@ static void test_CreateTextFormat(void)
trimming.delimiterCount = 10;
trimmingsign = (void*)0xdeadbeef;
hr = IDWriteTextFormat_GetTrimming(format, &trimming, &trimmingsign);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(trimming.granularity == DWRITE_TRIMMING_GRANULARITY_NONE, "got %d\n", trimming.granularity);
ok(trimming.delimiter == 0, "got %d\n", trimming.delimiter);
ok(trimming.delimiterCount == 0, "got %d\n", trimming.delimiterCount);
@@ -1255,39 +1255,39 @@ static void test_CreateTextFormat(void)
/* setters */
hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_LEADING);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_JUSTIFIED+1);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetParagraphAlignment(format, DWRITE_PARAGRAPH_ALIGNMENT_NEAR);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetParagraphAlignment(format, DWRITE_PARAGRAPH_ALIGNMENT_CENTER+1);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetWordWrapping(format, DWRITE_WORD_WRAPPING_WRAP);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetWordWrapping(format, DWRITE_WORD_WRAPPING_CHARACTER+1);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetReadingDirection(format, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetFlowDirection(format, DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetTrimming(format, &trimming, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* invalid granularity */
trimming.granularity = 10;
trimming.delimiter = 0;
trimming.delimiterCount = 0;
hr = IDWriteTextFormat_SetTrimming(format, &trimming, NULL);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
IDWriteTextFormat_Release(format);
IDWriteFactory_Release(factory);
@@ -1306,28 +1306,28 @@ static void test_GetLocaleName(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"ru", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 0, format, 100.0f, 100.0f, 1.0f, NULL,
FALSE, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat, (void**)&format2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
len = IDWriteTextFormat_GetLocaleNameLength(format2);
ok(len == 2, "got %u\n", len);
len = IDWriteTextFormat_GetLocaleNameLength(format);
ok(len == 2, "got %u\n", len);
hr = IDWriteTextFormat_GetLocaleName(format2, buff, len);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_GetLocaleName(format2, buff, len+1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(buff, L"ru"), "Unexpected locale name %s.\n", wine_dbgstr_w(buff));
hr = IDWriteTextFormat_GetLocaleName(format, buff, len);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_GetLocaleName(format, buff, len+1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(buff, L"ru"), "Unexpected locale name %s.\n", wine_dbgstr_w(buff));
IDWriteTextLayout_Release(layout);
@@ -1356,20 +1356,20 @@ static void test_CreateEllipsisTrimmingSign(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-GB", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
sign = (void *)0xdeadbeef;
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, NULL, &sign);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(!sign, "Unexpected pointer %p.\n", sign);
EXPECT_REF(format, 1);
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &sign);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(format, 1);
hr = IDWriteInlineObject_QueryInterface(sign, &IID_IDWriteTextLayout, (void**)&unk);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
if (0) {/* crashes on native */
hr = IDWriteInlineObject_GetBreakConditions(sign, NULL, NULL);
@@ -1380,7 +1380,7 @@ if (0) {/* crashes on native */
metrics.baseline = 123.0;
metrics.supportsSideways = TRUE;
hr = IDWriteInlineObject_GetMetrics(sign, &metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.width > 0.0, "got %.2f\n", metrics.width);
ok(metrics.height == 0.0, "got %.2f\n", metrics.height);
ok(metrics.baseline == 0.0, "got %.2f\n", metrics.baseline);
@@ -1388,14 +1388,14 @@ if (0) {/* crashes on native */
before = after = DWRITE_BREAK_CONDITION_CAN_BREAK;
hr = IDWriteInlineObject_GetBreakConditions(sign, &before, &after);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(before == DWRITE_BREAK_CONDITION_NEUTRAL, "got %d\n", before);
ok(after == DWRITE_BREAK_CONDITION_NEUTRAL, "got %d\n", after);
/* Draw tests */
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteInlineObject_Draw(sign, NULL, &testrenderer, 0.0, 0.0, FALSE, FALSE, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, drawellipsis_seq, "ellipsis sign draw test", FALSE);
effect = create_test_effect();
@@ -1403,7 +1403,7 @@ if (0) {/* crashes on native */
EXPECT_REF(effect, 1);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteInlineObject_Draw(sign, NULL, &testrenderer, 0.0f, 0.0f, FALSE, FALSE, effect);
- ok(hr == S_OK, "Failed to draw trimming sign, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to draw trimming sign, hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, drawellipsis_seq, "ellipsis sign draw with effect test", FALSE);
EXPECT_REF(effect, 1);
@@ -1411,39 +1411,39 @@ if (0) {/* crashes on native */
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteInlineObject_Draw(sign, NULL, &testrenderer, 0.0f, 0.0f, FALSE, FALSE, (void *)0xdeadbeef);
- ok(hr == S_OK, "Failed to draw trimming sign, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to draw trimming sign, hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, drawellipsis_seq, "ellipsis sign draw with effect test", FALSE);
memset(&ctxt, 0, sizeof(ctxt));
hr = IDWriteInlineObject_Draw(sign, &ctxt, &testrenderer, 123.0f, 456.0f, FALSE, FALSE, NULL);
- ok(hr == S_OK, "Failed to draw trimming sign, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to draw trimming sign, hr %#lx.\n", hr);
ok(ctxt.originX == 123.0f && ctxt.originY == 456.0f, "Unexpected drawing origin\n");
IDWriteInlineObject_Release(sign);
/* Centered format */
hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_CENTER);
- ok(hr == S_OK, "Failed to set text alignment, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set text alignment, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &sign);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&ctxt, 0, sizeof(ctxt));
hr = IDWriteInlineObject_Draw(sign, &ctxt, &testrenderer, 123.0f, 456.0f, FALSE, FALSE, NULL);
- ok(hr == S_OK, "Failed to draw trimming sign, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to draw trimming sign, hr %#lx.\n", hr);
ok(ctxt.originX == 123.0f && ctxt.originY == 456.0f, "Unexpected drawing origin\n");
IDWriteInlineObject_Release(sign);
/* non-orthogonal flow/reading combination */
hr = IDWriteTextFormat_SetReadingDirection(format, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetFlowDirection(format, DWRITE_FLOW_DIRECTION_LEFT_TO_RIGHT);
- ok(hr == S_OK || broken(hr == E_INVALIDARG) /* vista, win7 */, "got 0x%08x\n", hr);
+ ok(hr == S_OK || broken(hr == E_INVALIDARG) /* vista, win7 */, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK) {
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &sign);
- ok(hr == DWRITE_E_FLOWDIRECTIONCONFLICTS, "got 0x%08x\n", hr);
+ ok(hr == DWRITE_E_FLOWDIRECTIONCONFLICTS, "Unexpected hr %#lx.\n", hr);
}
IDWriteTextFormat_Release(format);
@@ -1464,31 +1464,31 @@ static void test_fontweight(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_BOLD, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0, L"ru", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, 1.0f, NULL,
FALSE, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat, (void**)&fmt2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
weight = IDWriteTextFormat_GetFontWeight(fmt2);
ok(weight == DWRITE_FONT_WEIGHT_BOLD, "got %u\n", weight);
range.startPosition = range.length = 0;
hr = IDWriteTextLayout_GetFontWeight(layout, 0, &weight, &range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.startPosition == 0 && range.length == ~0u, "got %u, %u\n", range.startPosition, range.length);
range.startPosition = 0;
range.length = 6;
hr = IDWriteTextLayout_SetFontWeight(layout, DWRITE_FONT_WEIGHT_NORMAL, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0;
hr = IDWriteTextLayout_GetFontWeight(layout, 0, &weight, &range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.startPosition == 0 && range.length == 6, "got %u, %u\n", range.startPosition, range.length);
/* IDWriteTextFormat methods output doesn't reflect layout changes */
@@ -1498,32 +1498,32 @@ static void test_fontweight(void)
range.length = 0;
weight = DWRITE_FONT_WEIGHT_BOLD;
hr = IDWriteTextLayout_GetFontWeight(layout, 0, &weight, &range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(weight == DWRITE_FONT_WEIGHT_NORMAL, "got %d\n", weight);
ok(range.length == 6, "got %d\n", range.length);
range.startPosition = 0;
range.length = 6;
hr = IDWriteTextLayout_SetFontWeight(layout, 1000, range);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
size = IDWriteTextLayout_GetMaxWidth(layout);
ok(size == 100.0, "got %.2f\n", size);
hr = IDWriteTextLayout_SetMaxWidth(layout, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = IDWriteTextLayout_GetMaxWidth(layout);
ok(size == 0.0, "got %.2f\n", size);
hr = IDWriteTextLayout_SetMaxWidth(layout, -1.0);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
size = IDWriteTextLayout_GetMaxWidth(layout);
ok(size == 0.0, "got %.2f\n", size);
hr = IDWriteTextLayout_SetMaxWidth(layout, 100.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = IDWriteTextLayout_GetMaxWidth(layout);
ok(size == 100.0, "got %.2f\n", size);
@@ -1532,19 +1532,19 @@ static void test_fontweight(void)
ok(size == 100.0, "got %.2f\n", size);
hr = IDWriteTextLayout_SetMaxHeight(layout, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = IDWriteTextLayout_GetMaxHeight(layout);
ok(size == 0.0, "got %.2f\n", size);
hr = IDWriteTextLayout_SetMaxHeight(layout, -1.0);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
size = IDWriteTextLayout_GetMaxHeight(layout);
ok(size == 0.0, "got %.2f\n", size);
hr = IDWriteTextLayout_SetMaxHeight(layout, 100.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = IDWriteTextLayout_GetMaxHeight(layout);
ok(size == 100.0, "got %.2f\n", size);
@@ -1568,42 +1568,42 @@ static void test_SetInlineObject(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_BOLD, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"ru", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, 1.0f, NULL,
FALSE, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &inlineobj);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &inlineobj2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(inlineobj, 1);
EXPECT_REF(inlineobj2, 1);
inlinetest = (void*)0x1;
hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(inlinetest == NULL, "got %p\n", inlinetest);
range.startPosition = 0;
range.length = 2;
hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(inlineobj, 2);
inlinetest = (void*)0x1;
hr = IDWriteTextLayout_GetInlineObject(layout, 2, &inlinetest, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(inlinetest == NULL, "got %p\n", inlinetest);
inlinetest = NULL;
r2.startPosition = r2.length = 100;
hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, &r2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(inlinetest == inlineobj, "got %p\n", inlinetest);
ok(r2.startPosition == 0 && r2.length == 2, "got %d, %d\n", r2.startPosition, r2.length);
IDWriteInlineObject_Release(inlinetest);
@@ -1614,7 +1614,7 @@ static void test_SetInlineObject(void)
inlinetest = NULL;
r2.startPosition = r2.length = 100;
hr = IDWriteTextLayout_GetInlineObject(layout, 1, &inlinetest, &r2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(inlinetest == inlineobj, "got %p\n", inlinetest);
ok(r2.startPosition == 0 && r2.length == 2, "got %d, %d\n", r2.startPosition, r2.length);
IDWriteInlineObject_Release(inlinetest);
@@ -1624,12 +1624,12 @@ static void test_SetInlineObject(void)
range.startPosition = 1;
range.length = 1;
hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj2, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
inlinetest = NULL;
r2.startPosition = r2.length = 100;
hr = IDWriteTextLayout_GetInlineObject(layout, 1, &inlinetest, &r2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(inlinetest == inlineobj2, "got %p\n", inlinetest);
ok(r2.startPosition == 1 && r2.length == 1, "got %d, %d\n", r2.startPosition, r2.length);
IDWriteInlineObject_Release(inlinetest);
@@ -1640,7 +1640,7 @@ static void test_SetInlineObject(void)
inlinetest = NULL;
r2.startPosition = r2.length = 100;
hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, &r2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(inlinetest == inlineobj, "got %p\n", inlinetest);
ok(r2.startPosition == 0 && r2.length == 1, "got %d, %d\n", r2.startPosition, r2.length);
IDWriteInlineObject_Release(inlinetest);
@@ -1650,11 +1650,11 @@ static void test_SetInlineObject(void)
range.startPosition = 1;
range.length = 1;
hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
r2.startPosition = r2.length = 100;
hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, &r2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(inlinetest == inlineobj, "got %p\n", inlinetest);
ok(r2.startPosition == 0 && r2.length == 2, "got %d, %d\n", r2.startPosition, r2.length);
IDWriteInlineObject_Release(inlinetest);
@@ -1664,13 +1664,13 @@ static void test_SetInlineObject(void)
range.startPosition = 1;
range.length = 2;
hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(inlineobj, 2);
r2.startPosition = r2.length = 100;
hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, &r2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(inlinetest == inlineobj, "got %p\n", inlinetest);
ok(r2.startPosition == 0 && r2.length == 3, "got %d, %d\n", r2.startPosition, r2.length);
IDWriteInlineObject_Release(inlinetest);
@@ -1776,100 +1776,100 @@ static void test_Draw(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_BOLD, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"ru", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &inlineobj);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 5;
range.length = 1;
hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 1;
range.length = 1;
hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 4;
range.length = 1;
hr = IDWriteTextLayout_SetDrawingEffect(layout, (IUnknown*)inlineobj, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0;
range.length = 1;
hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draw_seq, "draw test", FALSE);
IDWriteTextLayout_Release(layout);
/* with reduced width DrawGlyphRun() is called for every line */
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 5.0f, 100.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draw_seq2, "draw test 2", TRUE);
hr = IDWriteTextLayout_GetMetrics(layout, &tm);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine
ok(tm.lineCount == 6, "got %u\n", tm.lineCount);
IDWriteTextLayout_Release(layout);
/* string with control characters */
hr = IDWriteFactory_CreateTextLayout(factory, str2W, 4, format, 500.0, 100.0, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draw_seq3, "draw test 3", FALSE);
IDWriteTextLayout_Release(layout);
/* strikethrough splits ranges from renderer point of view, but doesn't break
shaping */
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 500.0f, 100.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
range.startPosition = 0;
range.length = 3;
hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draw_seq4, "draw test 4", FALSE);
IDWriteTextLayout_Release(layout);
/* Strike through somewhere in the middle */
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 500.0f, 100.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
range.startPosition = 2;
range.length = 2;
hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draw_seq5, "draw test 5", FALSE);
IDWriteTextLayout_Release(layout);
/* empty string */
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 0, format, 500.0f, 100.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, empty_seq, "draw test 6", FALSE);
IDWriteTextLayout_Release(layout);
@@ -1879,26 +1879,26 @@ static void test_Draw(void)
/* different parameter combinations with gdi-compatible layout */
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, 1.0f, NULL,
TRUE, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 7", FALSE);
/* text alignment keeps pixel-aligned origin */
hr = IDWriteTextLayout_GetMetrics(layout, &tm);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(tm.width == floorf(tm.width), "got %f\n", tm.width);
hr = IDWriteTextLayout_SetMaxWidth(layout, tm.width + 3.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_CENTER);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ctxt.originX = ctxt.originY = 0.0;
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 7", FALSE);
ok(ctxt.originX != 0.0 && ctxt.originX == floorf(ctxt.originX), "got %f\n", ctxt.originX);
@@ -1909,10 +1909,10 @@ static void test_Draw(void)
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, 1.0f, NULL,
FALSE, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 8", FALSE);
IDWriteTextLayout_Release(layout);
@@ -1923,10 +1923,10 @@ static void test_Draw(void)
m.m12 = m.m21 = m.dx = m.dy = 0.0;
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, 1.0f, &m,
TRUE, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 9", FALSE);
IDWriteTextLayout_Release(layout);
@@ -1937,10 +1937,10 @@ static void test_Draw(void)
m.m12 = m.m21 = m.dx = m.dy = 0.0;
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, 1.0f, &m,
FALSE, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 10", FALSE);
IDWriteTextLayout_Release(layout);
@@ -1948,18 +1948,18 @@ static void test_Draw(void)
/* text that triggers bidi run reordering */
hr = IDWriteFactory_CreateTextLayout(factory, str3W, lstrlenW(str3W), format, 1000.0f, 100.0f, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ctxt.gdicompat = FALSE;
ctxt.use_gdi_natural = FALSE;
ctxt.snapping_disabled = TRUE;
hr = IDWriteTextLayout_SetReadingDirection(layout, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT);
- ok(hr == S_OK, "Failed to set reading direction, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set reading direction, hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0f, 0.0f);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draw_ltr_reordered_run_seq, "draw test 11", FALSE);
IDWriteTextLayout_Release(layout);
@@ -1979,12 +1979,12 @@ static void test_typography(void)
factory = create_factory();
hr = IDWriteFactory_CreateTypography(factory, &typography);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
feature.nameTag = DWRITE_FONT_FEATURE_TAG_KERNING;
feature.parameter = 1;
hr = IDWriteTypography_AddFontFeature(typography, feature);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteTypography_GetFontFeatureCount(typography);
ok(count == 1, "got %u\n", count);
@@ -1993,38 +1993,38 @@ static void test_typography(void)
feature.nameTag = DWRITE_FONT_FEATURE_TAG_KERNING;
feature.parameter = 0;
hr = IDWriteTypography_AddFontFeature(typography, feature);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteTypography_GetFontFeatureCount(typography);
ok(count == 2, "got %u\n", count);
memset(&feature, 0xcc, sizeof(feature));
hr = IDWriteTypography_GetFontFeature(typography, 0, &feature);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(feature.nameTag == DWRITE_FONT_FEATURE_TAG_KERNING, "got tag %x\n", feature.nameTag);
ok(feature.parameter == 1, "got %u\n", feature.parameter);
memset(&feature, 0xcc, sizeof(feature));
hr = IDWriteTypography_GetFontFeature(typography, 1, &feature);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(feature.nameTag == DWRITE_FONT_FEATURE_TAG_KERNING, "got tag %x\n", feature.nameTag);
ok(feature.parameter == 0, "got %u\n", feature.parameter);
hr = IDWriteTypography_GetFontFeature(typography, 2, &feature);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* duplicated with same parameter value */
feature.nameTag = DWRITE_FONT_FEATURE_TAG_KERNING;
feature.parameter = 0;
hr = IDWriteTypography_AddFontFeature(typography, feature);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteTypography_GetFontFeatureCount(typography);
ok(count == 3, "got %u\n", count);
memset(&feature, 0xcc, sizeof(feature));
hr = IDWriteTypography_GetFontFeature(typography, 2, &feature);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(feature.nameTag == DWRITE_FONT_FEATURE_TAG_KERNING, "got tag %x\n", feature.nameTag);
ok(feature.parameter == 0, "got %u\n", feature.parameter);
@@ -2062,27 +2062,27 @@ static void test_GetClusterMetrics(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, str3W, 7, format, 1000.0, 1000.0, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetClusterMetrics(layout, NULL, 0, &count);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(count == 7, "got %u\n", count);
IDWriteTextLayout_Release(layout);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, NULL, 0, &count);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(count == 4, "got %u\n", count);
/* check every cluster width */
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, ARRAY_SIZE(metrics), &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 4, "got %u\n", count);
for (i = 0; i < count; i++) {
ok(metrics[i].width > 0.0, "%u: got width %.2f\n", i, metrics[i].width);
@@ -2098,7 +2098,7 @@ static void test_GetClusterMetrics(void)
leading = trailing = min_advance = 2.0;
hr = IDWriteTextLayout1_GetCharacterSpacing(layout1, 500, &leading, &trailing,
&min_advance, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(leading == 0.0 && trailing == 0.0 && min_advance == 0.0,
"got %.2f, %.2f, %.2f\n", leading, trailing, min_advance);
ok(r.startPosition == 0 && r.length == ~0u, "got %u, %u\n", r.startPosition, r.length);
@@ -2106,18 +2106,18 @@ static void test_GetClusterMetrics(void)
leading = trailing = min_advance = 2.0;
hr = IDWriteTextLayout1_GetCharacterSpacing(layout1, 0, &leading, &trailing,
&min_advance, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(leading == 0.0 && trailing == 0.0 && min_advance == 0.0,
"got %.2f, %.2f, %.2f\n", leading, trailing, min_advance);
r.startPosition = 0;
r.length = 4;
hr = IDWriteTextLayout1_SetCharacterSpacing(layout1, 10.0, 15.0, 0.0, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics2, ARRAY_SIZE(metrics2), &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 4, "got %u\n", count);
for (i = 0; i < count; ++i)
{
@@ -2130,13 +2130,13 @@ static void test_GetClusterMetrics(void)
r.startPosition = 0;
r.length = 4;
hr = IDWriteTextLayout1_SetCharacterSpacing(layout1, 0.0, 0.0, 0.0, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* negative advance limit */
r.startPosition = 0;
r.length = 4;
hr = IDWriteTextLayout1_SetCharacterSpacing(layout1, 0.0, 0.0, -10.0, r);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout1_Release(layout1);
}
@@ -2144,28 +2144,28 @@ static void test_GetClusterMetrics(void)
win_skip("IDWriteTextLayout1 is not supported, cluster spacing test skipped.\n");
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &trimm);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0;
range.length = 2;
hr = IDWriteTextLayout_SetInlineObject(layout, trimm, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* inline object takes a separate cluster, replaced codepoints number doesn't matter */
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, NULL, 0, &count);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(count == 3, "got %u\n", count);
count = 0;
memset(&metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 1, &count);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(count == 3, "got %u\n", count);
ok(metrics[0].length == 2, "got %u\n", metrics[0].length);
hr = IDWriteInlineObject_GetMetrics(trimm, &inline_metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(inline_metrics.width > 0.0 && inline_metrics.width == metrics[0].width, "got %.2f, expected %.2f\n",
inline_metrics.width, metrics[0].width);
@@ -2173,13 +2173,13 @@ static void test_GetClusterMetrics(void)
/* text with non-visual control codes */
hr = IDWriteFactory_CreateTextLayout(factory, str2W, 3, format, 1000.0, 1000.0, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* bidi control codes take a separate cluster */
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 3, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 3, "got %u\n", count);
ok(metrics[0].width == 0.0, "got %.2f\n", metrics[0].width);
@@ -2210,17 +2210,17 @@ static void test_GetClusterMetrics(void)
/* single inline object that fails to report its metrics */
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
range.startPosition = 0;
range.length = 4;
hr = IDWriteTextLayout_SetInlineObject(layout, &testinlineobj, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 3, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got %u\n", count);
/* object sets a width to 123.0, but returns failure from GetMetrics() */
@@ -2236,12 +2236,12 @@ static void test_GetClusterMetrics(void)
range.startPosition = 2;
range.length = 2;
hr = IDWriteTextLayout_SetInlineObject(layout, &testinlineobj2, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 3, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 2, "got %u\n", count);
ok(metrics[0].width == 0.0, "got %.2f\n", metrics[0].width);
@@ -2264,23 +2264,23 @@ static void test_GetClusterMetrics(void)
/* zero length string */
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 0, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 1;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 3, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 0, "got %u\n", count);
IDWriteTextLayout_Release(layout);
/* Whitespace */
hr = IDWriteFactory_CreateTextLayout(factory, L"a ", 2, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 2, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 2, "got %u\n", count);
ok(metrics[0].isWhitespace == 0, "got %d\n", metrics[0].isWhitespace);
ok(metrics[0].canWrapLineAfter == 0, "got %d\n", metrics[0].canWrapLineAfter);
@@ -2290,17 +2290,17 @@ static void test_GetClusterMetrics(void)
/* Layout is fully covered by inline object with after condition DWRITE_BREAK_CONDITION_MAY_NOT_BREAK. */
hr = IDWriteFactory_CreateTextLayout(factory, L"a ", 2, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
range.startPosition = 0;
range.length = ~0u;
hr = IDWriteTextLayout_SetInlineObject(layout, &testinlineobj3, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 2, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got %u\n", count);
ok(metrics[0].canWrapLineAfter == 1, "got %d\n", metrics[0].canWrapLineAfter);
@@ -2308,12 +2308,12 @@ static void test_GetClusterMetrics(void)
/* compare natural cluster width with gdi layout */
hr = IDWriteFactory_CreateTextLayout(factory, L"a ", 1, format, 100.0f, 100.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 1, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got %u\n", count);
ok(metrics[0].width != floorf(metrics[0].width), "got %f\n", metrics[0].width);
@@ -2321,12 +2321,12 @@ static void test_GetClusterMetrics(void)
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"a ", 1, format, 100.0f, 100.0f, 1.0f, NULL,
FALSE, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 1, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got %u\n", count);
ok(metrics[0].width == floorf(metrics[0].width), "got %f\n", metrics[0].width);
@@ -2334,12 +2334,12 @@ static void test_GetClusterMetrics(void)
/* isNewline tests */
hr = IDWriteFactory_CreateTextLayout(factory, str5W, lstrlenW(str5W), format, 100.0f, 200.0f, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, ARRAY_SIZE(metrics), &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 22, "got %u\n", count);
ok(metrics[1].isNewline == 1, "got %d\n", metrics[1].isNewline);
@@ -2383,12 +2383,12 @@ static void test_GetClusterMetrics(void)
/* Test whitespace resolution from linebreaking classes BK, ZW, and SP */
hr = IDWriteFactory_CreateTextLayout(factory, str_white_spaceW, ARRAY_SIZE(str_white_spaceW), format,
100.0f, 200.0f, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 20, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 6, "got %u\n", count);
ok(metrics[0].isWhitespace == 1, "got %d\n", metrics[0].isWhitespace);
@@ -2402,16 +2402,16 @@ static void test_GetClusterMetrics(void)
/* Trigger line trimming. */
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 100.0f, 200.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 4, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 4, "got %u\n", count);
hr = IDWriteTextLayout_GetMetrics(layout, &text_metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
width = metrics[0].width + inline_metrics.width;
ok(width < text_metrics.width, "unexpected trimming sign width\n");
@@ -2421,19 +2421,19 @@ static void test_GetClusterMetrics(void)
trimming_options.delimiter = 0;
trimming_options.delimiterCount = 0;
hr = IDWriteTextLayout_SetTrimming(layout, &trimming_options, trimm);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetMaxWidth(layout, width);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 4, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 4, "got %u\n", count);
hr = IDWriteTextLayout_GetLineMetrics(layout, &line, 1, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got %u\n", count);
ok(line.length == 4, "got %u\n", line.length);
ok(line.isTrimmed, "got %d\n", line.isTrimmed);
@@ -2442,15 +2442,15 @@ static void test_GetClusterMetrics(void)
/* NO_WRAP, check cluster wrapping attribute. */
hr = IDWriteTextFormat_SetWordWrapping(format, DWRITE_WORD_WRAPPING_NO_WRAP);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"a b", 3, format, 1000.0f, 200.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 3, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 3, "got %u\n", count);
ok(metrics[0].canWrapLineAfter == 0, "got %d\n", metrics[0].canWrapLineAfter);
@@ -2461,38 +2461,38 @@ static void test_GetClusterMetrics(void)
/* Single cluster layout, trigger trimming. */
hr = IDWriteFactory_CreateTextLayout(factory, L"a b", 1, format, 1000.0f, 200.0f, &layout);
- ok(hr == S_OK, "Failed to create layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create layout, hr %#lx.\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 1, &count);
- ok(hr == S_OK, "Failed to get cluster metrics, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get cluster metrics, hr %#lx.\n", hr);
ok(count == 1, "Unexpected cluster count %u.\n", count);
hr = IDWriteTextLayout_SetMaxWidth(layout, metrics[0].width / 2.0f);
- ok(hr == S_OK, "Failed to set layout width, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set layout width, hr %#lx.\n", hr);
trimming_options.granularity = DWRITE_TRIMMING_GRANULARITY_CHARACTER;
trimming_options.delimiter = 0;
trimming_options.delimiterCount = 0;
hr = IDWriteTextLayout_SetTrimming(layout, &trimming_options, trimm);
- ok(hr == S_OK, "Failed to set trimming options, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set trimming options, hr %#lx.\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 1, &count);
- ok(hr == S_OK, "Failed to get cluster metrics, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get cluster metrics, hr %#lx.\n", hr);
ok(count == 1, "Unexpected cluster count %u.\n", count);
hr = IDWriteTextLayout_GetLineMetrics(layout, &line, 1, &count);
- ok(hr == S_OK, "Failed to get line metrics, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get line metrics, hr %#lx.\n", hr);
ok(count == 1, "Unexpected line count %u.\n", count);
ok(line.length == 1, "Unexpected line length %u.\n", line.length);
ok(line.isTrimmed, "Unexpected trimming flag %x.\n", line.isTrimmed);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0f, 0.0f);
- ok(hr == S_OK, "Draw() failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "Draw() failed, hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draw_trimmed_seq, "Trimmed draw test", FALSE);
IDWriteTextLayout_Release(layout);
@@ -2516,24 +2516,24 @@ static void test_SetLocaleName(void)
/* create format with mixed case locale name, get it back */
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"eN-uS", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteTextFormat_GetLocaleName(format, buffW, ARRAY_SIZE(buffW));
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(buffW, L"en-us"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW));
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat, (void**)&format2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_GetLocaleName(format2, buffW, ARRAY_SIZE(buffW));
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(buffW, L"en-us"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW));
hr = IDWriteTextLayout_GetLocaleName(layout, 0, buffW, ARRAY_SIZE(buffW), NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(buffW, L"en-us"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW));
IDWriteTextFormat_Release(format2);
@@ -2542,25 +2542,25 @@ static void test_SetLocaleName(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
range.startPosition = 0;
range.length = 1;
hr = IDWriteTextLayout_SetLocaleName(layout, L"en-us", range);
- ok(hr == S_OK, "Failed to set locale name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set locale name, hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetLocaleName(layout, NULL, range);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* invalid locale name is allowed */
hr = IDWriteTextLayout_SetLocaleName(layout, L"abcd", range);
- ok(hr == S_OK, "Failed to set locale name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set locale name, hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetLocaleName(layout, 0, NULL, 0, NULL);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
if (0) /* crashes on native */
hr = IDWriteTextLayout_GetLocaleName(layout, 0, NULL, 1, NULL);
@@ -2568,14 +2568,14 @@ static void test_SetLocaleName(void)
buffW[0] = 0;
range.length = 0;
hr = IDWriteTextLayout_GetLocaleName(layout, 0, buffW, ARRAY_SIZE(buffW), &range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(buffW, L"abcd"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW));
ok(range.startPosition == 0 && range.length == 1, "got %u,%u\n", range.startPosition, range.length);
/* get with a shorter buffer */
buffW[0] = 0xa;
hr = IDWriteTextLayout_GetLocaleName(layout, 0, buffW, 1, NULL);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(buffW[0] == 0, "got %x\n", buffW[0]);
/* name is too long */
@@ -2586,23 +2586,23 @@ static void test_SetLocaleName(void)
range.startPosition = 0;
range.length = 1;
hr = IDWriteTextLayout_SetLocaleName(layout, buffW, range);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
buffW[0] = 0;
hr = IDWriteTextLayout_GetLocaleName(layout, 0, buffW, ARRAY_SIZE(buffW), NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(buffW, L"abcd"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW));
/* set initial locale name for whole text, except with a different casing */
range.startPosition = 0;
range.length = 4;
hr = IDWriteTextLayout_SetLocaleName(layout, L"eN-uS", range);
- ok(hr == S_OK, "Failed to set locale name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set locale name, hr %#lx.\n", hr);
buffW[0] = 0;
range.length = 0;
hr = IDWriteTextLayout_GetLocaleName(layout, 0, buffW, ARRAY_SIZE(buffW), &range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(buffW, L"en-us"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW));
ok((range.startPosition == 0 && range.length == ~0u) ||
broken(range.startPosition == 0 && range.length == 4) /* vista/win7 */, "got %u,%u\n", range.startPosition, range.length);
@@ -2611,7 +2611,7 @@ static void test_SetLocaleName(void)
buffW[0] = 0;
range.length = 0;
hr = IDWriteTextLayout_GetLocaleName(layout, 100, buffW, ARRAY_SIZE(buffW), &range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(buffW, L"en-us"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW));
ok((range.startPosition == 0 && range.length == ~0u) ||
broken(range.startPosition == 4 && range.length == ~0u-4) /* vista/win7 */, "got %u,%u\n", range.startPosition, range.length);
@@ -2638,10 +2638,10 @@ static void test_SetPairKerning(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 1000.0, 1000.0, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextFormat_Release(format);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout1, (void**)&layout1);
@@ -2659,19 +2659,19 @@ if (0) { /* crashes on native */
}
hr = IDWriteTextLayout1_GetPairKerning(layout1, 0, &kerning, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0;
range.length = 0;
kerning = TRUE;
hr = IDWriteTextLayout1_GetPairKerning(layout1, 0, &kerning, &range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!kerning, "got %d\n", kerning);
ok(range.length == ~0u, "got %u\n", range.length);
count = 0;
hr = IDWriteTextLayout1_GetClusterMetrics(layout1, clusters, 4, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 3, "Unexpected cluster count %u.\n", count);
ok(clusters[0].length == 1, "got %u\n", clusters[0].length);
ok(clusters[1].length == 2, "got %u\n", clusters[1].length);
@@ -2682,16 +2682,16 @@ if (0) { /* crashes on native */
range.startPosition = 0;
range.length = 2;
hr = IDWriteTextLayout1_SetPairKerning(layout1, 2, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
kerning = FALSE;
hr = IDWriteTextLayout1_GetPairKerning(layout1, 0, &kerning, &range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(kerning == TRUE, "got %d\n", kerning);
count = 0;
hr = IDWriteTextLayout1_GetClusterMetrics(layout1, clusters, 4, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 4, "got %u\n", count);
ok(clusters[0].length == 1, "got %u\n", clusters[0].length);
ok(clusters[1].length == 1, "got %u\n", clusters[1].length);
@@ -2716,10 +2716,10 @@ static void test_SetVerticalGlyphOrientation(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
IDWriteTextFormat_Release(format);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout2, (void**)&layout2);
@@ -2735,16 +2735,16 @@ static void test_SetVerticalGlyphOrientation(void)
ok(orientation == DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT, "got %d\n", orientation);
hr = IDWriteTextLayout2_SetVerticalGlyphOrientation(layout2, DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED+1);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout2_QueryInterface(layout2, &IID_IDWriteTextFormat1, (void **)&format1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
orientation = IDWriteTextFormat1_GetVerticalGlyphOrientation(format1);
ok(orientation == DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT, "Unexpected orientation %d.\n", orientation);
hr = IDWriteTextLayout2_SetVerticalGlyphOrientation(layout2, DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
orientation = IDWriteTextLayout2_GetVerticalGlyphOrientation(layout2);
ok(orientation == DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED, "Unexpected orientation %d.\n", orientation);
@@ -2753,7 +2753,7 @@ static void test_SetVerticalGlyphOrientation(void)
ok(orientation == DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED, "Unexpected orientation %d.\n", orientation);
hr = IDWriteTextFormat1_SetVerticalGlyphOrientation(format1, DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
orientation = IDWriteTextLayout2_GetVerticalGlyphOrientation(layout2);
ok(orientation == DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT, "Unexpected orientation %d.\n", orientation);
@@ -2787,22 +2787,22 @@ static void test_DetermineMinWidth(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_DetermineMinWidth(layout, NULL);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout_Release(layout);
/* empty string */
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 0, format, 100.0f, 100.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
minwidth = 1.0f;
hr = IDWriteTextLayout_DetermineMinWidth(layout, &minwidth);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(minwidth == 0.0f, "got %f\n", minwidth);
IDWriteTextLayout_Release(layout);
@@ -2811,10 +2811,10 @@ static void test_DetermineMinWidth(void)
/* measure expected width */
hr = IDWriteFactory_CreateTextLayout(factory, minwidth_tests[i].mintext, lstrlenW(minwidth_tests[i].mintext), format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, ARRAY_SIZE(metrics), &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
for (j = 0; j < count; j++)
width += metrics[j].width;
@@ -2822,11 +2822,11 @@ static void test_DetermineMinWidth(void)
IDWriteTextLayout_Release(layout);
hr = IDWriteFactory_CreateTextLayout(factory, minwidth_tests[i].text, lstrlenW(minwidth_tests[i].text), format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
minwidth = 0.0f;
hr = IDWriteTextLayout_DetermineMinWidth(layout, &minwidth);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(minwidth == width, "test %u: expected width %f, got %f\n", i, width, minwidth);
IDWriteTextLayout_Release(layout);
@@ -2849,76 +2849,76 @@ static void test_SetFontSize(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
/* negative/zero size */
r.startPosition = 1;
r.length = 1;
hr = IDWriteTextLayout_SetFontSize(layout, -15.0, r);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetFontSize(layout, 0.0, r);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
r.startPosition = 1;
r.length = 0;
size = 0.0;
hr = IDWriteTextLayout_GetFontSize(layout, 0, &size, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 0 && r.length == ~0u, "got %u, %u\n", r.startPosition, r.length);
ok(size == 10.0, "got %.2f\n", size);
r.startPosition = 1;
r.length = 1;
hr = IDWriteTextLayout_SetFontSize(layout, 15.0, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* zero length range */
r.startPosition = 1;
r.length = 0;
hr = IDWriteTextLayout_SetFontSize(layout, 123.0, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = 0.0;
hr = IDWriteTextLayout_GetFontSize(layout, 1, &size, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(size == 15.0, "got %.2f\n", size);
r.startPosition = 0;
r.length = 4;
hr = IDWriteTextLayout_SetFontSize(layout, 15.0, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = 0.0;
hr = IDWriteTextLayout_GetFontSize(layout, 1, &size, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(size == 15.0, "got %.2f\n", size);
size = 0.0;
hr = IDWriteTextLayout_GetFontSize(layout, 0, &size, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 0 && r.length == 4, "got %u, %u\n", r.startPosition, r.length);
ok(size == 15.0, "got %.2f\n", size);
size = 15.0;
r.startPosition = r.length = 0;
hr = IDWriteTextLayout_GetFontSize(layout, 20, &size, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 4 && r.length == ~0u-4, "got %u, %u\n", r.startPosition, r.length);
ok(size == 10.0, "got %.2f\n", size);
r.startPosition = 100;
r.length = 4;
hr = IDWriteTextLayout_SetFontSize(layout, 25.0, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = 15.0;
r.startPosition = r.length = 0;
hr = IDWriteTextLayout_GetFontSize(layout, 100, &size, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 100 && r.length == 4, "got %u, %u\n", r.startPosition, r.length);
ok(size == 25.0, "got %.2f\n", size);
@@ -2940,63 +2940,63 @@ static void test_SetFontFamilyName(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
/* NULL name */
r.startPosition = 1;
r.length = 1;
hr = IDWriteTextLayout_SetFontFamilyName(layout, NULL, r);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
r.startPosition = 1;
r.length = 0;
nameW[0] = 0;
hr = IDWriteTextLayout_GetFontFamilyName(layout, 1, nameW, ARRAY_SIZE(nameW), &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 0 && r.length == ~0u, "got %u, %u\n", r.startPosition, r.length);
/* set name only different in casing */
r.startPosition = 1;
r.length = 1;
hr = IDWriteTextLayout_SetFontFamilyName(layout, L"TaHoma", r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* zero length range */
r.startPosition = 1;
r.length = 0;
hr = IDWriteTextLayout_SetFontFamilyName(layout, L"Arial", r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
r.startPosition = 0;
r.length = 0;
nameW[0] = 0;
hr = IDWriteTextLayout_GetFontFamilyName(layout, 1, nameW, ARRAY_SIZE(nameW), &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(nameW, L"TaHoma"), "Unexpected family name %s.\n", wine_dbgstr_w(nameW));
ok(r.startPosition == 1 && r.length == 1, "got %u, %u\n", r.startPosition, r.length);
r.startPosition = 1;
r.length = 1;
hr = IDWriteTextLayout_SetFontFamilyName(layout, L"Arial", r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
r.startPosition = 1;
r.length = 0;
hr = IDWriteTextLayout_GetFontFamilyName(layout, 1, nameW, ARRAY_SIZE(nameW), &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 1 && r.length == 1, "got %u, %u\n", r.startPosition, r.length);
r.startPosition = 0;
r.length = 4;
hr = IDWriteTextLayout_SetFontFamilyName(layout, L"Arial", r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
nameW[0] = 0;
hr = IDWriteTextLayout_GetFontFamilyName(layout, 1, nameW, ARRAY_SIZE(nameW), &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 0 && r.length == 4, "got %u, %u\n", r.startPosition, r.length);
ok(!lstrcmpW(nameW, L"Arial"), "Unexpected family name %s.\n", wine_dbgstr_w(nameW));
@@ -3018,72 +3018,72 @@ static void test_SetFontStyle(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
/* invalid style value */
r.startPosition = 1;
r.length = 1;
hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_ITALIC+1, r);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
r.startPosition = 1;
r.length = 0;
hr = IDWriteTextLayout_GetFontStyle(layout, 0, &style, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 0 && r.length == ~0u, "got %u, %u\n", r.startPosition, r.length);
ok(style == DWRITE_FONT_STYLE_NORMAL, "got %d\n", style);
r.startPosition = 1;
r.length = 1;
hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_ITALIC, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* zero length range */
r.startPosition = 1;
r.length = 0;
hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_NORMAL, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
style = DWRITE_FONT_STYLE_NORMAL;
hr = IDWriteTextLayout_GetFontStyle(layout, 1, &style, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(style == DWRITE_FONT_STYLE_ITALIC, "got %d\n", style);
r.startPosition = 0;
r.length = 4;
hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_OBLIQUE, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
style = DWRITE_FONT_STYLE_ITALIC;
hr = IDWriteTextLayout_GetFontStyle(layout, 1, &style, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(style == DWRITE_FONT_STYLE_OBLIQUE, "got %d\n", style);
style = DWRITE_FONT_STYLE_ITALIC;
hr = IDWriteTextLayout_GetFontStyle(layout, 0, &style, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 0 && r.length == 4, "got %u, %u\n", r.startPosition, r.length);
ok(style == DWRITE_FONT_STYLE_OBLIQUE, "got %d\n", style);
style = DWRITE_FONT_STYLE_ITALIC;
r.startPosition = r.length = 0;
hr = IDWriteTextLayout_GetFontStyle(layout, 20, &style, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 4 && r.length == ~0u-4, "got %u, %u\n", r.startPosition, r.length);
ok(style == DWRITE_FONT_STYLE_NORMAL, "got %d\n", style);
r.startPosition = 100;
r.length = 4;
hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_OBLIQUE, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
style = DWRITE_FONT_STYLE_NORMAL;
r.startPosition = r.length = 0;
hr = IDWriteTextLayout_GetFontStyle(layout, 100, &style, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 100 && r.length == 4, "got %u, %u\n", r.startPosition, r.length);
ok(style == DWRITE_FONT_STYLE_OBLIQUE, "got %d\n", style);
@@ -3105,73 +3105,73 @@ static void test_SetFontStretch(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
/* invalid stretch value */
r.startPosition = 1;
r.length = 1;
hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_ULTRA_EXPANDED+1, r);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
r.startPosition = 1;
r.length = 0;
stretch = DWRITE_FONT_STRETCH_UNDEFINED;
hr = IDWriteTextLayout_GetFontStretch(layout, 0, &stretch, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 0 && r.length == ~0u, "got %u, %u\n", r.startPosition, r.length);
ok(stretch == DWRITE_FONT_STRETCH_NORMAL, "got %d\n", stretch);
r.startPosition = 1;
r.length = 1;
hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_CONDENSED, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* zero length range */
r.startPosition = 1;
r.length = 0;
hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_NORMAL, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stretch = DWRITE_FONT_STRETCH_UNDEFINED;
hr = IDWriteTextLayout_GetFontStretch(layout, 1, &stretch, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(stretch == DWRITE_FONT_STRETCH_CONDENSED, "got %d\n", stretch);
r.startPosition = 0;
r.length = 4;
hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_EXPANDED, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stretch = DWRITE_FONT_STRETCH_UNDEFINED;
hr = IDWriteTextLayout_GetFontStretch(layout, 1, &stretch, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(stretch == DWRITE_FONT_STRETCH_EXPANDED, "got %d\n", stretch);
stretch = DWRITE_FONT_STRETCH_UNDEFINED;
hr = IDWriteTextLayout_GetFontStretch(layout, 0, &stretch, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 0 && r.length == 4, "got %u, %u\n", r.startPosition, r.length);
ok(stretch == DWRITE_FONT_STRETCH_EXPANDED, "got %d\n", stretch);
stretch = DWRITE_FONT_STRETCH_UNDEFINED;
r.startPosition = r.length = 0;
hr = IDWriteTextLayout_GetFontStretch(layout, 20, &stretch, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 4 && r.length == ~0u-4, "got %u, %u\n", r.startPosition, r.length);
ok(stretch == DWRITE_FONT_STRETCH_NORMAL, "got %d\n", stretch);
r.startPosition = 100;
r.length = 4;
hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_EXPANDED, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stretch = DWRITE_FONT_STRETCH_UNDEFINED;
r.startPosition = r.length = 0;
hr = IDWriteTextLayout_GetFontStretch(layout, 100, &stretch, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 100 && r.length == 4, "got %u, %u\n", r.startPosition, r.length);
ok(stretch == DWRITE_FONT_STRETCH_EXPANDED, "got %d\n", stretch);
@@ -3179,7 +3179,7 @@ static void test_SetFontStretch(void)
r.startPosition = 0;
r.length = 2;
hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_UNDEFINED, r);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout_Release(layout);
IDWriteTextFormat_Release(format);
@@ -3199,46 +3199,46 @@ static void test_SetStrikethrough(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
r.startPosition = 1;
r.length = 0;
value = TRUE;
hr = IDWriteTextLayout_GetStrikethrough(layout, 0, &value, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 0 && r.length == ~0u, "got %u, %u\n", r.startPosition, r.length);
ok(value == FALSE, "got %d\n", value);
r.startPosition = 1;
r.length = 1;
hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = FALSE;
hr = IDWriteTextLayout_GetStrikethrough(layout, 1, &value, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(value == TRUE, "got %d\n", value);
ok(r.startPosition == 1 && r.length == 1, "got %u, %u\n", r.startPosition, r.length);
value = TRUE;
r.startPosition = r.length = 0;
hr = IDWriteTextLayout_GetStrikethrough(layout, 20, &value, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 2 && r.length == ~0u-2, "got %u, %u\n", r.startPosition, r.length);
ok(value == FALSE, "got %d\n", value);
r.startPosition = 100;
r.length = 4;
hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = FALSE;
r.startPosition = r.length = 0;
hr = IDWriteTextLayout_GetStrikethrough(layout, 100, &value, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 100 && r.length == 4, "got %u, %u\n", r.startPosition, r.length);
ok(value == TRUE, "got %d\n", value);
@@ -3263,21 +3263,21 @@ static void test_GetMetrics(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 500.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 4, "got %u\n", count);
for (i = 0, width = 0.0; i < count; i++)
width += clusters[i].width;
memset(&metrics, 0xcc, sizeof(metrics));
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
@@ -3293,12 +3293,12 @@ static void test_GetMetrics(void)
/* a string with more complex bidi sequence */
hr = IDWriteFactory_CreateTextLayout(factory, str2W, 7, format, 500.0, 1000.0, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&metrics, 0xcc, sizeof(metrics));
metrics.maxBidiReorderingDepth = 0;
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
ok(metrics.width > 0.0, "got %.2f\n", metrics.width);
@@ -3314,16 +3314,16 @@ static void test_GetMetrics(void)
/* single cluster layout */
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 500.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 1, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got %u\n", count);
memset(&metrics, 0xcc, sizeof(metrics));
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
ok(metrics.width == clusters[0].width, "got %.2f, expected %.2f\n", metrics.width, clusters[0].width);
@@ -3337,11 +3337,11 @@ static void test_GetMetrics(void)
/* Whitespace only. */
hr = IDWriteFactory_CreateTextLayout(factory, L" ", 1, format, 500.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
memset(&metrics, 0xcc, sizeof(metrics));
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "Failed to get layout metrics, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get layout metrics, hr %#lx.\n", hr);
ok(metrics.left == 0.0f, "Unexpected value for left %f.\n", metrics.left);
ok(metrics.top == 0.0f, "Unexpected value for top %f.\n", metrics.top);
ok(metrics.width == 0.0f, "Unexpected width %f.\n", metrics.width);
@@ -3371,7 +3371,7 @@ static void test_SetFlowDirection(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
flow = IDWriteTextFormat_GetFlowDirection(format);
ok(flow == DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM, "got %d\n", flow);
@@ -3380,25 +3380,25 @@ static void test_SetFlowDirection(void)
ok(reading == DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, "got %d\n", reading);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 500.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
IDWriteTextLayout_Release(layout);
hr = IDWriteTextFormat_SetFlowDirection(format, DWRITE_FLOW_DIRECTION_LEFT_TO_RIGHT);
- ok(hr == S_OK || broken(hr == E_INVALIDARG) /* vista,win7 */, "got 0x%08x\n", hr);
+ ok(hr == S_OK || broken(hr == E_INVALIDARG) /* vista,win7 */, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
{
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 500.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
IDWriteTextLayout_Release(layout);
hr = IDWriteTextFormat_SetReadingDirection(format, DWRITE_READING_DIRECTION_TOP_TO_BOTTOM);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetFlowDirection(format, DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 500.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
IDWriteTextLayout_Release(layout);
}
else
@@ -3448,28 +3448,28 @@ static void test_SetDrawingEffect(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
/* string with combining mark */
hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 500.0, 1000.0, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* set effect past the end of text */
r.startPosition = 100;
r.length = 10;
hr = IDWriteTextLayout_SetDrawingEffect(layout, effect, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
r.startPosition = r.length = 0;
hr = IDWriteTextLayout_GetDrawingEffect(layout, 101, &unk, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 100 && r.length == 10, "got %u, %u\n", r.startPosition, r.length);
IUnknown_Release(unk);
r.startPosition = r.length = 0;
unk = (void*)0xdeadbeef;
hr = IDWriteTextLayout_GetDrawingEffect(layout, 1000, &unk, &r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(r.startPosition == 110 && r.length == ~0u-110, "got %u, %u\n", r.startPosition, r.length);
ok(unk == NULL, "got %p\n", unk);
@@ -3477,84 +3477,84 @@ static void test_SetDrawingEffect(void)
r.startPosition = 0;
r.length = 2;
hr = IDWriteTextLayout_SetDrawingEffect(layout, effect, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draweffect_seq, "effect draw test", TRUE);
IDWriteTextLayout_Release(layout);
/* simple string */
hr = IDWriteFactory_CreateTextLayout(factory, L"aecd", 4, format, 500.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
r.startPosition = 0;
r.length = 2;
hr = IDWriteTextLayout_SetDrawingEffect(layout, effect, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draweffect2_seq, "effect draw test 2", FALSE);
IDWriteTextLayout_Release(layout);
/* Inline object - effect set for same range */
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &sign);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"aecd", 4, format, 500.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
r.startPosition = 0;
r.length = 4;
hr = IDWriteTextLayout_SetInlineObject(layout, sign, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetDrawingEffect(layout, effect, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draweffect3_seq, "effect draw test 3", FALSE);
/* now set effect somewhere inside a range replaced by inline object */
hr = IDWriteTextLayout_SetDrawingEffect(layout, NULL, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
r.startPosition = 1;
r.length = 1;
hr = IDWriteTextLayout_SetDrawingEffect(layout, effect, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* no effect is reported in this case */
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draweffect4_seq, "effect draw test 4", FALSE);
r.startPosition = 0;
r.length = 4;
hr = IDWriteTextLayout_SetDrawingEffect(layout, NULL, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
r.startPosition = 0;
r.length = 1;
hr = IDWriteTextLayout_SetDrawingEffect(layout, effect, r);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* first range position is all that matters for inline ranges */
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, draweffect3_seq, "effect draw test 5", FALSE);
IDWriteTextLayout_Release(layout);
ref = IUnknown_Release(effect);
- ok(ref == 0, "Unexpected effect refcount %u\n", ref);
+ ok(ref == 0, "Unexpected effect refcount %lu\n", ref);
IDWriteInlineObject_Release(sign);
IDWriteTextFormat_Release(format);
IDWriteFactory_Release(factory);
@@ -3567,11 +3567,11 @@ static BOOL get_enus_string(IDWriteLocalizedStrings *strings, WCHAR *buff, UINT3
HRESULT hr;
hr = IDWriteLocalizedStrings_FindLocaleName(strings, L"en-us", &index, &exists);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (exists) {
hr = IDWriteLocalizedStrings_GetString(strings, index, buff, size);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
}
else
*buff = 0;
@@ -3601,19 +3601,19 @@ static void test_GetLineMetrics(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 2048.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, strW, 5, format, 30000.0, 1000.0, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, 0, &count);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got count %u\n", count);
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, 1, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics[0].length == 5, "got %u\n", metrics[0].length);
ok(metrics[0].trailingWhitespaceLength == 1, "got %u\n", metrics[0].trailingWhitespaceLength);
@@ -3625,7 +3625,7 @@ static void test_GetLineMetrics(void)
/* Test line height and baseline calculation */
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
familycount = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < familycount; i++) {
@@ -3638,17 +3638,17 @@ static void test_GetLineMetrics(void)
layout = NULL;
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL,
DWRITE_FONT_STYLE_NORMAL, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!(exists = get_enus_string(names, nameW, ARRAY_SIZE(nameW)))) {
IDWriteLocalFontFileLoader *localloader;
@@ -3660,20 +3660,20 @@ static void test_GetLineMetrics(void)
count = 1;
hr = IDWriteFontFace_GetFiles(fontface, &count, &file);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFile_GetLoader(file, &loader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void**)&localloader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFileLoader_Release(loader);
hr = IDWriteFontFile_GetReferenceKey(file, &key, &keysize);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteLocalFontFileLoader_GetFilePathFromKey(localloader, key, keysize, nameW, ARRAY_SIZE(nameW));
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
skip("Failed to get English family name, font file %s\n", wine_dbgstr_w(nameW));
@@ -3690,15 +3690,15 @@ static void test_GetLineMetrics(void)
IDWriteFontFace_GetMetrics(fontface, &fontmetrics);
hr = IDWriteFactory_CreateTextFormat(factory, nameW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, fontmetrics.designUnitsPerEm, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"", 1, format, 30000.0f, 100.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
memset(metrics, 0, sizeof(metrics));
count = 0;
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, ARRAY_SIZE(metrics), &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got %u\n", count);
ok(metrics[0].baseline == fontmetrics.ascent + fontmetrics.lineGap, "%s: got %.2f, expected %d, "
@@ -3720,19 +3720,19 @@ static void test_GetLineMetrics(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 2048.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
fontface = get_fontface_from_format(format);
ok(fontface != NULL, "got %p\n", fontface);
/* force 2 lines */
hr = IDWriteFactory_CreateTextLayout(factory, str2W, 5, format, 10000.0, 1000.0, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(metrics, 0, sizeof(metrics));
count = 0;
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, ARRAY_SIZE(metrics), &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 2, "got %u\n", count);
/* baseline is relative to a line, and is not accumulated */
ok(metrics[0].baseline == metrics[1].baseline, "got %.2f, %.2f\n", metrics[0].baseline,
@@ -3744,15 +3744,15 @@ static void test_GetLineMetrics(void)
/* line breaks */
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 12.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, str3W, 10, format, 100.0, 300.0, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(metrics, 0xcc, sizeof(metrics));
count = 0;
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, ARRAY_SIZE(metrics), &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 6, "got %u\n", count);
ok(metrics[0].length == 2, "got %u\n", metrics[0].length);
@@ -3780,12 +3780,12 @@ static void test_GetLineMetrics(void)
/* empty text layout */
hr = IDWriteFactory_CreateTextLayout(factory, strW, 0, format, 100.0f, 300.0f, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, 1, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got %u\n", count);
ok(metrics[0].length == 0, "got %u\n", metrics[0].length);
ok(metrics[0].trailingWhitespaceLength == 0, "got %u\n", metrics[0].trailingWhitespaceLength);
@@ -3798,28 +3798,28 @@ static void test_GetLineMetrics(void)
range.startPosition = 0;
range.length = 1;
hr = IDWriteTextLayout_SetFontSize(layout, 80.0f, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics + 1, 1, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got %u\n", count);
ok(metrics[1].height > metrics[0].height, "got %f\n", metrics[1].height);
ok(metrics[1].baseline > metrics[0].baseline, "got %f\n", metrics[1].baseline);
/* revert font size back to format value, set different size for position 1 */
hr = IDWriteTextLayout_SetFontSize(layout, 12.0f, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 1;
range.length = 1;
hr = IDWriteTextLayout_SetFontSize(layout, 80.0f, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(metrics + 1, 0, sizeof(*metrics));
count = 0;
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics + 1, 1, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got %u\n", count);
ok(metrics[1].height == metrics[0].height, "got %f\n", metrics[1].height);
ok(metrics[1].baseline == metrics[0].baseline, "got %f\n", metrics[1].baseline);
@@ -3828,12 +3828,12 @@ static void test_GetLineMetrics(void)
/* text is "a\r" */
hr = IDWriteFactory_CreateTextLayout(factory, str4W, 2, format, 100.0f, 300.0f, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, ARRAY_SIZE(metrics), &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 2, "got %u\n", count);
ok(metrics[0].length == 2, "got %u\n", metrics[0].length);
ok(metrics[0].newlineLength == 1, "got %u\n", metrics[0].newlineLength);
@@ -3847,29 +3847,29 @@ static void test_GetLineMetrics(void)
range.startPosition = 1;
range.length = 1;
hr = IDWriteTextLayout_SetFontSize(layout, 80.0f, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics + 2, 2, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 2, "got %u\n", count);
ok(metrics[3].height > metrics[1].height, "got %f, old %f\n", metrics[3].height, metrics[1].height);
ok(metrics[3].baseline > metrics[1].baseline, "got %f, old %f\n", metrics[3].baseline, metrics[1].baseline);
/* revert to original format */
hr = IDWriteTextLayout_SetFontSize(layout, 12.0f, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics + 2, 2, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 2, "got %u\n", count);
ok(metrics[3].height == metrics[1].height, "got %f, old %f\n", metrics[3].height, metrics[1].height);
ok(metrics[3].baseline == metrics[1].baseline, "got %f, old %f\n", metrics[3].baseline, metrics[1].baseline);
/* Switch to uniform spacing */
hr = IDWriteTextLayout_SetLineSpacing(layout, DWRITE_LINE_SPACING_METHOD_UNIFORM, 456.0f, 123.0f);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, ARRAY_SIZE(metrics), &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 2, "got %u\n", count);
for (i = 0; i < count; i++) {
@@ -3883,18 +3883,18 @@ static void test_GetLineMetrics(void)
hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_PROPORTIONAL, 2.0f, 4.0f);
if (hr == S_OK) {
hr = IDWriteFactory_CreateTextLayout(factory, str4W, 1, format, 100.0f, 300.0f, &layout);
- ok(hr == S_OK, "Failed to create layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, ARRAY_SIZE(metrics), &count);
- ok(hr == S_OK, "Failed to get line metrics, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get line metrics, hr %#lx.\n", hr);
ok(count == 1, "Unexpected line count %u\n", count);
/* Back to default mode. */
hr = IDWriteTextLayout_SetLineSpacing(layout, DWRITE_LINE_SPACING_METHOD_DEFAULT, 0.0f, 0.0f);
- ok(hr == S_OK, "Failed to set spacing method, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set spacing method, hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics + 1, 1, &count);
- ok(hr == S_OK, "Failed to get line metrics, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get line metrics, hr %#lx.\n", hr);
ok(count == 1, "Unexpected line count %u\n", count);
/* Proportional spacing applies multipliers to default, content based spacing. */
@@ -3932,22 +3932,22 @@ static void test_SetTextAlignment(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 12.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
v = IDWriteTextFormat_GetTextAlignment(format);
ok(v == DWRITE_TEXT_ALIGNMENT_LEADING, "got %d\n", v);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 500.0f, 100.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
v = IDWriteTextLayout_GetTextAlignment(layout);
ok(v == DWRITE_TEXT_ALIGNMENT_LEADING, "got %d\n", v);
hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_TRAILING);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_TRAILING);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
v = IDWriteTextFormat_GetTextAlignment(format);
ok(v == DWRITE_TEXT_ALIGNMENT_LEADING, "got %d\n", v);
@@ -3958,7 +3958,7 @@ static void test_SetTextAlignment(void)
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat1, (void**)&format1);
if (hr == S_OK) {
hr = IDWriteTextFormat1_SetTextAlignment(format1, DWRITE_TEXT_ALIGNMENT_CENTER);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
v = IDWriteTextFormat_GetTextAlignment(format);
ok(v == DWRITE_TEXT_ALIGNMENT_LEADING, "got %d\n", v);
@@ -3980,17 +3980,17 @@ static void test_SetTextAlignment(void)
FLOAT text_width;
hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_LEADING);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, stringsW[i], lstrlenW(stringsW[i]), format, 500.0f, 100.0f, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetWordWrapping(layout, DWRITE_WORD_WRAPPING_NO_WRAP);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, ARRAY_SIZE(clusters), &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (stringsW[i][0])
ok(count > 0, "got %u\n", count);
else
@@ -4002,10 +4002,10 @@ static void test_SetTextAlignment(void)
/* maxwidth is 500, leading alignment */
hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_LEADING);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == 0.0f, "got %.2f\n", metrics.left);
ok(metrics.width == text_width, "got %.2f\n", metrics.width);
@@ -4014,10 +4014,10 @@ static void test_SetTextAlignment(void)
/* maxwidth is 500, trailing alignment */
hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_TRAILING);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == metrics.layoutWidth - metrics.width, "got %.2f\n", metrics.left);
ok(metrics.width == text_width, "got %.2f\n", metrics.width);
@@ -4027,13 +4027,13 @@ static void test_SetTextAlignment(void)
/* initially created with trailing alignment */
hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_TRAILING);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, stringsW[i], lstrlenW(stringsW[i]), format, 500.0f, 100.0f, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == metrics.layoutWidth - metrics.width, "got %.2f\n", metrics.left);
ok(metrics.width == text_width, "got %.2f\n", metrics.width);
@@ -4044,12 +4044,12 @@ static void test_SetTextAlignment(void)
if (stringsW[i][0]) {
/* max width less than total run width, trailing alignment */
hr = IDWriteTextFormat_SetWordWrapping(format, DWRITE_WORD_WRAPPING_NO_WRAP);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, stringsW[i], lstrlenW(stringsW[i]), format, clusters[0].width, 100.0f, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == metrics.layoutWidth - metrics.width, "got %.2f\n", metrics.left);
ok(metrics.width == text_width, "got %.2f\n", metrics.width);
ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount);
@@ -4058,13 +4058,13 @@ static void test_SetTextAlignment(void)
/* maxwidth is 500, centered */
hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_CENTER);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, stringsW[i], lstrlenW(stringsW[i]), format, 500.0f, 100.0f, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == (metrics.layoutWidth - metrics.width) / 2.0f, "got %.2f\n", metrics.left);
ok(metrics.width == text_width, "got %.2f\n", metrics.width);
ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount);
@@ -4091,22 +4091,22 @@ static void test_SetParagraphAlignment(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 12.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
v = IDWriteTextFormat_GetParagraphAlignment(format);
ok(v == DWRITE_PARAGRAPH_ALIGNMENT_NEAR, "got %d\n", v);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 500.0f, 100.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
v = IDWriteTextLayout_GetParagraphAlignment(layout);
ok(v == DWRITE_PARAGRAPH_ALIGNMENT_NEAR, "got %d\n", v);
hr = IDWriteTextLayout_SetParagraphAlignment(layout, DWRITE_PARAGRAPH_ALIGNMENT_FAR);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetParagraphAlignment(layout, DWRITE_PARAGRAPH_ALIGNMENT_FAR);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
v = IDWriteTextFormat_GetParagraphAlignment(format);
ok(v == DWRITE_PARAGRAPH_ALIGNMENT_NEAR, "got %d\n", v);
@@ -4115,22 +4115,22 @@ static void test_SetParagraphAlignment(void)
ok(v == DWRITE_PARAGRAPH_ALIGNMENT_FAR, "got %d\n", v);
hr = IDWriteTextLayout_SetParagraphAlignment(layout, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
v = IDWriteTextLayout_GetParagraphAlignment(layout);
ok(v == DWRITE_PARAGRAPH_ALIGNMENT_CENTER, "got %d\n", v);
count = 0;
hr = IDWriteTextLayout_GetLineMetrics(layout, lines, 1, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got %u\n", count);
/* maxheight is 100, near alignment */
hr = IDWriteTextLayout_SetParagraphAlignment(layout, DWRITE_PARAGRAPH_ALIGNMENT_NEAR);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
ok(metrics.height == lines[0].height, "got %.2f\n", metrics.height);
@@ -4139,10 +4139,10 @@ static void test_SetParagraphAlignment(void)
/* maxwidth is 100, far alignment */
hr = IDWriteTextLayout_SetParagraphAlignment(layout, DWRITE_PARAGRAPH_ALIGNMENT_FAR);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.top == metrics.layoutHeight - metrics.height, "got %.2f\n", metrics.top);
ok(metrics.height == lines[0].height, "got %.2f\n", metrics.height);
@@ -4152,13 +4152,13 @@ static void test_SetParagraphAlignment(void)
/* initially created with centered alignment */
hr = IDWriteTextFormat_SetParagraphAlignment(format, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 500.0f, 100.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.top == (metrics.layoutHeight - lines[0].height) / 2, "got %.2f\n", metrics.top);
ok(metrics.height == lines[0].height, "got %.2f\n", metrics.height);
@@ -4185,13 +4185,13 @@ static void test_SetReadingDirection(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 12.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
v = IDWriteTextFormat_GetReadingDirection(format);
ok(v == DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, "got %d\n", v);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 500.0f, 100.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
v = IDWriteTextLayout_GetReadingDirection(layout);
ok(v == DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, "got %d\n", v);
@@ -4200,21 +4200,21 @@ static void test_SetReadingDirection(void)
ok(v == DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, "got %d\n", v);
hr = IDWriteTextLayout_SetReadingDirection(layout, DWRITE_READING_DIRECTION_RIGHT_TO_LEFT);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
hr = IDWriteTextLayout_GetLineMetrics(layout, lines, 1, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got %u\n", count);
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 1, &count);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got %u\n", count);
/* leading alignment, RTL */
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == metrics.layoutWidth - clusters[0].width, "got %.2f\n", metrics.left);
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
@@ -4226,10 +4226,10 @@ static void test_SetReadingDirection(void)
/* trailing alignment, RTL */
hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_TRAILING);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
@@ -4241,10 +4241,10 @@ static void test_SetReadingDirection(void)
/* centered alignment, RTL */
hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_CENTER);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == (metrics.layoutWidth - clusters[0].width) / 2.0, "got %.2f\n", metrics.left);
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
@@ -4372,13 +4372,13 @@ static void test_pixelsnapping(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 12.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
fontface = get_fontface_from_format(format);
IDWriteFontFace_GetMetrics(fontface, &metrics);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 500.0f, 100.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
/* disabled snapping */
ctxt.snapping_disabled = TRUE;
@@ -4390,7 +4390,7 @@ static void test_pixelsnapping(void)
originX = 0.1;
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, originX, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
baseline = get_scaled_font_metric(metrics.ascent, 12.0, &metrics);
ok(ctxt.originX == originX, "got %f, originX %f\n", ctxt.originX, originX);
@@ -4410,7 +4410,7 @@ static void test_pixelsnapping(void)
expectedY = snap_coord(&ctxt.m, ctxt.ppdip, baseline);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, originX, 0.0);
- ok(hr == S_OK, "%d: got 0x%08x\n", i, hr);
+ ok(hr == S_OK, "%d: unexpected hr %#lx.\n", i, hr);
ok(ctxt.originX == originX, "%d: got %f, originX %f\n", i, ctxt.originX, originX);
ok(float_eq(ctxt.originY, expectedY), "%d: got %f, expected %f, baseline %f\n",
i, ctxt.originY, expectedY, baseline);
@@ -4420,11 +4420,11 @@ static void test_pixelsnapping(void)
{
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"a", 1, format, 500.0f, 100.0f,
1.0f, &compattransforms[j], FALSE, &layout2);
- ok(hr == S_OK, "%d: failed to create text layout, hr %#x.\n", i, hr);
+ ok(hr == S_OK, "%d: failed to create text layout, hr %#lx.\n", i, hr);
expectedY = snap_coord(&ctxt.m, ctxt.ppdip, baseline);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, originX, 0.0);
- ok(hr == S_OK, "%d: got 0x%08x\n", i, hr);
+ ok(hr == S_OK, "%d: unexpected hr %#lx.\n", i, hr);
ok(ctxt.originX == originX, "%d: got %f, originX %f\n", i, ctxt.originX, originX);
ok(float_eq(ctxt.originY, expectedY), "%d: got %f, expected %f, baseline %f\n",
i, ctxt.originY, expectedY, baseline);
@@ -4454,41 +4454,41 @@ static void test_SetWordWrapping(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 12.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
v = IDWriteTextFormat_GetWordWrapping(format);
ok(v == DWRITE_WORD_WRAPPING_WRAP, "got %d\n", v);
hr = IDWriteFactory_CreateTextLayout(factory, strW, ARRAY_SIZE(strW), format, 10.0f, 100.0f, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
v = IDWriteTextLayout_GetWordWrapping(layout);
ok(v == DWRITE_WORD_WRAPPING_WRAP, "got %d\n", v);
hr = IDWriteTextLayout_SetWordWrapping(layout, DWRITE_WORD_WRAPPING_NO_WRAP);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetWordWrapping(layout, DWRITE_WORD_WRAPPING_NO_WRAP);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
v = IDWriteTextFormat_GetWordWrapping(format);
ok(v == DWRITE_WORD_WRAPPING_WRAP, "got %d\n", v);
/* disable wrapping, text has explicit newline */
hr = IDWriteTextLayout_SetWordWrapping(layout, DWRITE_WORD_WRAPPING_NO_WRAP);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
hr = IDWriteTextLayout_GetLineMetrics(layout, NULL, 0, &count);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(count == 2, "got %u\n", count);
hr = IDWriteTextLayout_SetWordWrapping(layout, DWRITE_WORD_WRAPPING_WRAP);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
hr = IDWriteTextLayout_GetLineMetrics(layout, NULL, 0, &count);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ok(count > 2, "got %u\n", count);
IDWriteTextLayout_Release(layout);
@@ -4537,13 +4537,13 @@ static HRESULT WINAPI fontcollection_GetFontFamily(IDWriteFontCollection *iface,
HRESULT hr;
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_FindFamilyName(syscollection, L"Tahoma", &index, &exists);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(syscollection, index, family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontCollection_Release(syscollection);
IDWriteFactory_Release(factory);
@@ -4608,7 +4608,7 @@ static void test_MapCharacters(void)
fallback = NULL;
hr = IDWriteFactory2_GetSystemFontFallback(factory2, &fallback);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fallback != NULL, "got %p\n", fallback);
mappedlength = 1;
@@ -4616,7 +4616,7 @@ static void test_MapCharacters(void)
font = (void*)0xdeadbeef;
hr = IDWriteFontFallback_MapCharacters(fallback, NULL, 0, 0, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 0, "got %u\n", mappedlength);
ok(scale == 1.0f, "got %f\n", scale);
ok(font == NULL, "got %p\n", font);
@@ -4628,7 +4628,7 @@ static void test_MapCharacters(void)
font = (void*)0xdeadbeef;
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 0, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 0, "got %u\n", mappedlength);
ok(scale == 1.0f, "got %f\n", scale);
ok(font == NULL, "got %p\n", font);
@@ -4640,7 +4640,7 @@ static void test_MapCharacters(void)
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 1, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
todo_wine {
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
}
ok(scale == 1.0f, "got %f\n", scale);
@@ -4657,7 +4657,7 @@ if (font) {
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 3, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
todo_wine {
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 3, "got %u\n", mappedlength);
}
ok(scale == 1.0f, "got %f\n", scale);
@@ -4674,7 +4674,7 @@ if (font) {
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 3, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
todo_wine {
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
}
ok(scale == 1.0f, "got %f\n", scale);
@@ -4690,7 +4690,7 @@ if (font) {
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 1, 2, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
todo_wine {
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
}
ok(scale == 1.0f, "got %f\n", scale);
@@ -4707,16 +4707,16 @@ if (font) {
font = NULL;
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 3, &fallbackcollection, g_blahfontW, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
ok(scale == 1.0f, "got %f\n", scale);
ok(font != NULL, "got %p\n", font);
exists = FALSE;
hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &strings, &exists);
- ok(hr == S_OK && exists, "got 0x%08x, exists %d\n", hr, exists);
+ ok(hr == S_OK && exists, "Unexpected hr %#lx, exists %d.\n", hr, exists);
hr = IDWriteLocalizedStrings_GetString(strings, 0, buffW, ARRAY_SIZE(buffW));
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(buffW, L"Tahoma"), "Unexpected string %s.\n", wine_dbgstr_w(buffW));
IDWriteLocalizedStrings_Release(strings);
IDWriteFont_Release(font);
@@ -4728,16 +4728,16 @@ if (font) {
font = NULL;
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 1, 1, &fallbackcollection, g_blahfontW, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
ok(scale == 1.0f, "got %f\n", scale);
ok(font != NULL, "got %p\n", font);
exists = FALSE;
hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &strings, &exists);
- ok(hr == S_OK && exists, "got 0x%08x, exists %d\n", hr, exists);
+ ok(hr == S_OK && exists, "Unexpected hr %#lx, exists %d.\n", hr, exists);
hr = IDWriteLocalizedStrings_GetString(strings, 0, buffW, ARRAY_SIZE(buffW));
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine
ok(lstrcmpW(buffW, L"Tahoma"), "Unexpected string %s.\n", wine_dbgstr_w(buffW));
IDWriteLocalizedStrings_Release(strings);
@@ -4780,7 +4780,7 @@ static void test_FontFallbackBuilder(void)
EXPECT_REF(factory2, 2);
EXPECT_REF(builder, 1);
hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, &fallback);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(factory2, 3);
EXPECT_REF(fallback, 1);
EXPECT_REF(builder, 1);
@@ -4793,54 +4793,54 @@ static void test_FontFallbackBuilder(void)
/* New instance is created every time, even if mappings have not changed. */
hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, &fallback2);
- ok(hr == S_OK, "Failed to create fallback object, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create fallback object, hr %#lx.\n", hr);
ok(fallback != fallback2, "Unexpected fallback instance.\n");
IDWriteFontFallback_Release(fallback2);
hr = IDWriteFontFallbackBuilder_AddMapping(builder, NULL, 0, NULL, 0, NULL, NULL, NULL, 0.0f);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.first = 'A';
range.last = 'B';
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 0, NULL, 0, NULL, NULL, NULL, 0.0f);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 0, NULL, 0, NULL, NULL, NULL, 1.0f);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 0, &familyW, 1, NULL, NULL, NULL, 1.0f);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFallbackBuilder_AddMapping(builder, NULL, 0, &familyW, 1, NULL, NULL, NULL, 1.0f);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* negative scaling factor */
range.first = range.last = 0;
familyW = g_blahfontW;
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, NULL, NULL, NULL, -1.0f);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, NULL, NULL, NULL, 0.0f);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* empty range */
range.first = range.last = 0;
familyW = g_blahfontW;
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, NULL, NULL, NULL, 1.0f);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.first = range.last = 0;
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, NULL, NULL, NULL, 2.0f);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.first = range.last = 'A';
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, NULL, NULL, NULL, 3.0f);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.first = 'B';
range.last = 'A';
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, NULL, NULL, NULL, 4.0f);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFallback_Release(fallback);
@@ -4848,7 +4848,7 @@ static void test_FontFallbackBuilder(void)
hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, NULL);
hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, &fallback);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* fallback font missing from system collection */
g_source = L"A";
@@ -4858,7 +4858,7 @@ static void test_FontFallbackBuilder(void)
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 1, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
todo_wine {
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
ok(scale == 1.0f, "got %f\n", scale);
ok(font == NULL, "got %p\n", font);
@@ -4868,10 +4868,10 @@ todo_wine {
/* remap with custom collection */
range.first = range.last = 'A';
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, &fallbackcollection, NULL, NULL, 5.0f);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, &fallback);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
g_source = L"A";
mappedlength = 0;
@@ -4880,7 +4880,7 @@ todo_wine {
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 1, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
todo_wine {
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
ok(scale == 5.0f, "got %f\n", scale);
ok(font != NULL, "got %p\n", font);
@@ -4893,10 +4893,10 @@ todo_wine {
range.first = 'B';
range.last = 'A';
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, &fallbackcollection, NULL, NULL, 6.0f);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, &fallback);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
g_source = L"A";
mappedlength = 0;
@@ -4905,7 +4905,7 @@ todo_wine {
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 1, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
todo_wine {
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
ok(scale == 5.0f, "got %f\n", scale);
ok(font != NULL, "got %p\n", font);
@@ -4919,10 +4919,10 @@ todo_wine {
range.first = 'A';
range.last = 'B';
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, &fallbackcollection, L"locale", NULL, 6.0f);
- ok(hr == S_OK, "Failed to add mapping, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to add mapping, hr %#lx.\n", hr);
hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, &fallback);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
g_source = L"A";
mappedlength = 0;
@@ -4931,7 +4931,7 @@ todo_wine {
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 1, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
todo_wine {
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
ok(scale == 5.0f, "got %f\n", scale);
ok(font != NULL, "got %p\n", font);
@@ -4950,7 +4950,7 @@ todo_wine {
IDWriteFontFallbackBuilder_Release(builder);
ref = IDWriteFactory2_Release(factory2);
- ok(ref == 0, "Factory is not released, ref %u.\n", ref);
+ ok(ref == 0, "Factory is not released, ref %lu.\n", ref);
}
static void test_fallback(void)
@@ -4974,15 +4974,15 @@ static void test_fallback(void)
/* Font does not exist in system collection. */
hr = IDWriteFactory_CreateTextFormat(factory, g_blahfontW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
todo_wine {
- ok(hr == S_OK, "Failed to get cluster metrics, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get cluster metrics, hr %#lx.\n", hr);
ok(count == 4, "Unexpected count %u.\n", count);
}
for (i = 0, width = 0.0; i < count; i++)
@@ -4990,7 +4990,7 @@ todo_wine {
memset(&metrics, 0xcc, sizeof(metrics));
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "Failed to get layout metrics, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get layout metrics, hr %#lx.\n", hr);
todo_wine {
ok(metrics.width > 0.0 && metrics.width == width, "Unexpected width %.2f, expected %.2f.\n", metrics.width, width);
ok(metrics.height > 0.0, "Unexpected height %.2f.\n", metrics.height);
@@ -5001,11 +5001,11 @@ todo_wine {
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
/* Existing font. */
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
IDWriteTextFormat_Release(format);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout2, (void**)&layout2);
@@ -5022,39 +5022,39 @@ todo_wine {
fallback = (void*)0xdeadbeef;
hr = IDWriteTextLayout2_GetFontFallback(layout2, &fallback);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fallback == NULL, "got %p\n", fallback);
hr = IDWriteTextLayout2_QueryInterface(layout2, &IID_IDWriteTextFormat1, (void**)&format1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fallback = (void*)0xdeadbeef;
hr = IDWriteTextFormat1_GetFontFallback(format1, &fallback);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fallback == NULL, "got %p\n", fallback);
hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory2, (void**)&factory2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fallback = NULL;
hr = IDWriteFactory2_GetSystemFontFallback(factory2, &fallback);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fallback != NULL, "got %p\n", fallback);
hr = IDWriteTextFormat1_SetFontFallback(format1, fallback);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fallback2 = (void*)0xdeadbeef;
hr = IDWriteTextLayout2_GetFontFallback(layout2, &fallback2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fallback2 == fallback, "got %p\n", fallback2);
hr = IDWriteTextLayout2_SetFontFallback(layout2, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fallback2 = (void*)0xdeadbeef;
hr = IDWriteTextFormat1_GetFontFallback(format1, &fallback2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(fallback2 == NULL, "got %p\n", fallback2);
if (SUCCEEDED(IDWriteFontFallback_QueryInterface(fallback, &IID_IDWriteFontFallback1, (void **)&fallback1)))
@@ -5083,40 +5083,40 @@ static void test_SetTypography(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"afib", 4, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
IDWriteTextFormat_Release(format);
hr = IDWriteFactory_CreateTypography(factory, &typography);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(typography, 1);
range.startPosition = 0;
range.length = 2;
hr = IDWriteTextLayout_SetTypography(layout, typography, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(typography, 2);
hr = IDWriteTextLayout_GetTypography(layout, 0, &typography2, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(typography2 == typography, "got %p, expected %p\n", typography2, typography);
IDWriteTypography_Release(typography2);
IDWriteTypography_Release(typography);
hr = IDWriteFactory_CreateTypography(factory, &typography2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0;
range.length = 1;
hr = IDWriteTextLayout_SetTypography(layout, typography2, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(typography2, 2);
IDWriteTypography_Release(typography2);
hr = IDWriteTextLayout_GetTypography(layout, 0, &typography, &range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.length == 1, "got %u\n", range.length);
IDWriteTypography_Release(typography);
@@ -5139,7 +5139,7 @@ static void test_SetLastLineWrapping(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteTextFormat_QueryInterface(format, &IID_IDWriteTextFormat1, (void**)&format1);
IDWriteTextFormat_Release(format);
@@ -5153,20 +5153,20 @@ static void test_SetLastLineWrapping(void)
ok(ret, "got %d\n", ret);
hr = IDWriteTextFormat1_SetLastLineWrapping(format1, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, (IDWriteTextFormat *)format1, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout2, (void**)&layout2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout_Release(layout);
ret = IDWriteTextLayout2_GetLastLineWrapping(layout2);
ok(!ret, "got %d\n", ret);
hr = IDWriteTextLayout2_SetLastLineWrapping(layout2, TRUE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout2_Release(layout2);
IDWriteTextFormat1_Release(format1);
@@ -5187,7 +5187,7 @@ static void test_SetOpticalAlignment(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteTextFormat_QueryInterface(format, &IID_IDWriteTextFormat1, (void**)&format1);
IDWriteTextFormat_Release(format);
@@ -5201,10 +5201,10 @@ static void test_SetOpticalAlignment(void)
ok(alignment == DWRITE_OPTICAL_ALIGNMENT_NONE, "got %d\n", alignment);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, (IDWriteTextFormat *)format1, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout2, (void**)&layout2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout_Release(layout);
IDWriteTextFormat1_Release(format1);
@@ -5212,25 +5212,25 @@ static void test_SetOpticalAlignment(void)
ok(alignment == DWRITE_OPTICAL_ALIGNMENT_NONE, "got %d\n", alignment);
hr = IDWriteTextLayout2_QueryInterface(layout2, &IID_IDWriteTextFormat1, (void**)&format1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
alignment = IDWriteTextFormat1_GetOpticalAlignment(format1);
ok(alignment == DWRITE_OPTICAL_ALIGNMENT_NONE, "got %d\n", alignment);
hr = IDWriteTextLayout2_SetOpticalAlignment(layout2, DWRITE_OPTICAL_ALIGNMENT_NO_SIDE_BEARINGS);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout2_SetOpticalAlignment(layout2, DWRITE_OPTICAL_ALIGNMENT_NO_SIDE_BEARINGS+1);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
alignment = IDWriteTextFormat1_GetOpticalAlignment(format1);
ok(alignment == DWRITE_OPTICAL_ALIGNMENT_NO_SIDE_BEARINGS, "got %d\n", alignment);
hr = IDWriteTextFormat1_SetOpticalAlignment(format1, DWRITE_OPTICAL_ALIGNMENT_NONE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat1_SetOpticalAlignment(format1, DWRITE_OPTICAL_ALIGNMENT_NO_SIDE_BEARINGS+1);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
alignment = IDWriteTextLayout2_GetOpticalAlignment(layout2);
ok(alignment == DWRITE_OPTICAL_ALIGNMENT_NONE, "got %d\n", alignment);
@@ -5286,29 +5286,29 @@ static void test_SetUnderline(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 1000.0, 1000.0, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, ARRAY_SIZE(clusters), &count);
- ok(hr == S_OK, "Failed to get cluster metrics, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get cluster metrics, hr %#lx.\n", hr);
ok(count == 3, "Unexpected cluster count %u.\n", count);
range.startPosition = 0;
range.length = 2;
hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, ARRAY_SIZE(clusters), &count);
- ok(hr == S_OK, "Failed to get cluster metrics, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get cluster metrics, hr %#lx.\n", hr);
ok(count == 3, "Unexpected cluster count %u.\n", count);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, drawunderline_seq, "draw underline test", TRUE);
IDWriteTextLayout_Release(layout);
@@ -5316,53 +5316,53 @@ static void test_SetUnderline(void)
/* 2 characters, same font, significantly different font size. Set underline for both, see how many
underline drawing calls is there. */
hr = IDWriteFactory_CreateTextLayout(factory, strW, 2, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0;
range.length = 2;
hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0;
range.length = 1;
hr = IDWriteTextLayout_SetFontSize(layout, 100.0f, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0f, 0.0f);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, drawunderline2_seq, "draw underline test 2", FALSE);
/* now set different locale for second char, draw again */
range.startPosition = 0;
range.length = 1;
hr = IDWriteTextLayout_SetLocaleName(layout, L"en-CA", range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0f, 0.0f);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, drawunderline3_seq, "draw underline test 2", FALSE);
IDWriteTextLayout_Release(layout);
/* 2 characters, same font properties, first with strikethrough, both underlined */
hr = IDWriteFactory_CreateTextLayout(factory, strW, 2, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0;
range.length = 1;
hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0;
range.length = 2;
hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0f, 0.0f);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_sequence(sequences, RENDERER_ID, drawunderline4_seq, "draw underline test 4", FALSE);
IDWriteTextLayout_Release(layout);
@@ -5371,7 +5371,7 @@ static void test_SetUnderline(void)
/* Test runHeight value with all available fonts */
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < count; ++i)
@@ -5391,17 +5391,17 @@ static void test_SetUnderline(void)
layout = NULL;
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL,
DWRITE_FONT_STYLE_NORMAL, &font);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!(exists = get_enus_string(names, nameW, ARRAY_SIZE(nameW)))) {
IDWriteLocalFontFileLoader *localloader;
@@ -5413,20 +5413,20 @@ static void test_SetUnderline(void)
count = 1;
hr = IDWriteFontFace_GetFiles(fontface, &count, &file);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFile_GetLoader(file, &loader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void**)&localloader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFileLoader_Release(loader);
hr = IDWriteFontFile_GetReferenceKey(file, &key, &keysize);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteLocalFontFileLoader_GetFilePathFromKey(localloader, key, keysize, nameW, ARRAY_SIZE(nameW));
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
skip("Failed to get English family name, font file %s\n", wine_dbgstr_w(nameW));
@@ -5443,7 +5443,7 @@ static void test_SetUnderline(void)
IDWriteFontFace_GetMetrics(fontface, &fontmetrics);
hr = IDWriteFactory_CreateTextFormat(factory, nameW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, fontmetrics.designUnitsPerEm, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
/* Look for first supported character to avoid triggering fallback path. With fallback it's harder to test
DrawUnderline() metrics, because actual resolved fontface is not passed to it. Grabbing fontface instance
@@ -5452,7 +5452,7 @@ static void test_SetUnderline(void)
{
glyph = 0;
hr = IDWriteFontFace_GetGlyphIndices(fontface, &codepoint, 1, &glyph);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (glyph)
break;
}
@@ -5465,18 +5465,18 @@ static void test_SetUnderline(void)
str[0] = codepoint;
hr = IDWriteFactory_CreateTextLayout(factory, str, 1, format, 30000.0f, 100.0f, &layout);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0;
range.length = 2;
hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&ctxt, 0, sizeof(ctxt));
ctxt.format = format;
ctxt.familyW = nameW;
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0f, 0.0f);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
cleanup:
if (layout)
@@ -5503,10 +5503,10 @@ static void test_InvalidateLayout(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout3, (void**)&layout3);
if (hr == S_OK) {
@@ -5514,32 +5514,32 @@ static void test_InvalidateLayout(void)
IDWriteTextFormat2 *format2;
hr = IDWriteTextFormat_QueryInterface(format, &IID_IDWriteTextFormat2, (void**)&format2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextFormat2_Release(format2);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat2, (void**)&format2);
- ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Unexpected hr %#lx.\n", hr);
if (hr == S_OK) {
ok(format != (IDWriteTextFormat *)format2, "Unexpected interface pointer.\n");
IDWriteTextFormat2_Release(format2);
}
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat1, (void**)&format1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat1_QueryInterface(format1, &IID_IDWriteTextFormat2, (void**)&format2);
- ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
IDWriteTextFormat2_Release(format2);
IDWriteTextFormat1_Release(format1);
hr = IDWriteTextLayout3_QueryInterface(layout3, &IID_IDWriteTextFormat2, (void**)&format2);
- ok(hr == S_OK || broken(hr == E_NOINTERFACE), "got 0x%08x\n", hr);
+ ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
IDWriteTextFormat2_Release(format2);
hr = IDWriteTextLayout3_InvalidateLayout(layout3);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout3_Release(layout3);
}
else
@@ -5562,40 +5562,40 @@ static void test_line_spacing(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_DEFAULT, 0.0f, 0.0f);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_DEFAULT, 0.0f, -10.0f);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_DEFAULT, -10.0f, 0.0f);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_PROPORTIONAL+1, 0.0f, 0.0f);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetLineSpacing(layout, DWRITE_LINE_SPACING_METHOD_DEFAULT, 0.0f, 0.0f);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetLineSpacing(layout, DWRITE_LINE_SPACING_METHOD_DEFAULT, 0.0f, -10.0f);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetLineSpacing(layout, DWRITE_LINE_SPACING_METHOD_DEFAULT, -10.0f, 0.0f);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetLineSpacing(layout, DWRITE_LINE_SPACING_METHOD_PROPORTIONAL+1, 0.0f, 0.0f);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
if (IDWriteTextFormat_QueryInterface(format, &IID_IDWriteTextFormat2, (void**)&format2) == S_OK) {
DWRITE_LINE_SPACING spacing;
hr = IDWriteTextFormat2_GetLineSpacing(format2, &spacing);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(spacing.method == DWRITE_LINE_SPACING_METHOD_DEFAULT, "got method %d\n", spacing.method);
ok(spacing.height == 0.0f, "got %f\n", spacing.height);
@@ -5606,29 +5606,29 @@ static void test_line_spacing(void)
spacing.leadingBefore = -1.0f;
hr = IDWriteTextFormat2_SetLineSpacing(format2, &spacing);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
spacing.leadingBefore = 1.1f;
hr = IDWriteTextFormat2_SetLineSpacing(format2, &spacing);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
spacing.leadingBefore = 1.0f;
hr = IDWriteTextFormat2_SetLineSpacing(format2, &spacing);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
spacing.method = DWRITE_LINE_SPACING_METHOD_PROPORTIONAL + 1;
hr = IDWriteTextFormat2_SetLineSpacing(format2, &spacing);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
spacing.method = DWRITE_LINE_SPACING_METHOD_PROPORTIONAL;
spacing.fontLineGapUsage = DWRITE_FONT_LINE_GAP_USAGE_ENABLED + 1;
hr = IDWriteTextFormat2_SetLineSpacing(format2, &spacing);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat2_GetLineSpacing(format2, &spacing);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(spacing.fontLineGapUsage == DWRITE_FONT_LINE_GAP_USAGE_ENABLED + 1, "got %d\n", spacing.fontLineGapUsage);
IDWriteTextFormat2_Release(format2);
@@ -5663,10 +5663,10 @@ static void test_GetOverhangMetrics(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 100.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"A", 1, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(overhangs_tests); i++) {
const struct overhangs_test *test = &overhangs_tests[i];
@@ -5679,16 +5679,16 @@ static void test_GetOverhangMetrics(void)
hr = IDWriteTextLayout_SetLineSpacing(layout, DWRITE_LINE_SPACING_METHOD_UNIFORM, test->metrics.height * 2.0f,
test->uniform_baseline);
- ok(hr == S_OK, "Failed to set line spacing, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set line spacing, hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetInlineObject(layout, NULL, range);
- ok(hr == S_OK, "Failed to reset inline object, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to reset inline object, hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetInlineObject(layout, &obj.IDWriteInlineObject_iface, range);
- ok(hr == S_OK, "Failed to set inline object, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set inline object, hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- ok(hr == S_OK, "Failed to get layout metrics, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get layout metrics, hr %#lx.\n", hr);
ok(metrics.width == test->metrics.width, "%u: unexpected formatted width.\n", i);
ok(metrics.height == test->metrics.height * 2.0f, "%u: unexpected formatted height.\n", i);
@@ -5697,7 +5697,7 @@ static void test_GetOverhangMetrics(void)
hr = IDWriteTextLayout_SetMaxHeight(layout, test->metrics.height);
hr = IDWriteTextLayout_GetOverhangMetrics(layout, &overhang_metrics);
- ok(hr == S_OK, "Failed to get overhang metrics, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get overhang metrics, hr %#lx.\n", hr);
ok(!memcmp(&overhang_metrics, &test->expected, sizeof(overhang_metrics)),
"%u: unexpected overhang metrics (%f, %f, %f, %f).\n", i, overhang_metrics.left, overhang_metrics.top,
@@ -5717,7 +5717,7 @@ static void test_tab_stops(void)
IDWriteFactory *factory;
DWRITE_TEXT_RANGE range;
FLOAT tabstop, size;
- ULONG count;
+ UINT count;
HRESULT hr;
factory = create_factory();
@@ -5727,7 +5727,7 @@ static void test_tab_stops(void)
{
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, size, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
tabstop = IDWriteTextFormat_GetIncrementalTabStop(format);
ok(tabstop == 4.0f * size, "Unexpected tab stop %f.\n", tabstop);
@@ -5737,28 +5737,28 @@ static void test_tab_stops(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetIncrementalTabStop(format, 0.0f);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetIncrementalTabStop(format, -10.0f);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
tabstop = IDWriteTextFormat_GetIncrementalTabStop(format);
ok(tabstop == 40.0f, "Unexpected tab stop %f.\n", tabstop);
hr = IDWriteTextFormat_SetIncrementalTabStop(format, 100.0f);
- ok(hr == S_OK, "Failed to set tab stop value, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set tab stop value, hr %#lx.\n", hr);
tabstop = IDWriteTextFormat_GetIncrementalTabStop(format);
ok(tabstop == 100.0f, "Unexpected tab stop %f.\n", tabstop);
hr = IDWriteFactory_CreateTextLayout(factory, L"\ta\tb", 4, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %lx.\n", hr);
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
- ok(hr == S_OK, "Failed to get cluster metrics, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get cluster metrics, hr %#lx.\n", hr);
ok(clusters[0].isWhitespace, "Unexpected isWhitespace.\n");
ok(!clusters[1].isWhitespace, "Unexpected isWhitespace.\n");
ok(clusters[2].isWhitespace, "Unexpected isWhitespace.\n");
@@ -5770,13 +5770,13 @@ todo_wine {
range.startPosition = 0;
range.length = ~0u;
hr = IDWriteTextLayout_SetFontSize(layout, 20.0f, range);
- ok(hr == S_OK, "Failed to set font size, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set font size, hr %#lx.\n", hr);
tabstop = IDWriteTextLayout_GetIncrementalTabStop(layout);
ok(tabstop == 100.0f, "Unexpected tab stop %f.\n", tabstop);
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
- ok(hr == S_OK, "Failed to get cluster metrics, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get cluster metrics, hr %#lx.\n", hr);
ok(clusters[0].isWhitespace, "Unexpected isWhitespace.\n");
ok(!clusters[1].isWhitespace, "Unexpected isWhitespace.\n");
ok(clusters[2].isWhitespace, "Unexpected isWhitespace.\n");
@@ -5806,10 +5806,10 @@ static void test_automatic_font_axes(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 16.0f, L"en-us", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %lx.\n", hr);
IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout4, (void **)&layout4);
@@ -5824,16 +5824,16 @@ static void test_automatic_font_axes(void)
}
hr = IDWriteTextFormat_QueryInterface(format, &IID_IDWriteTextFormat3, (void **)&format3);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
axes = IDWriteTextFormat3_GetAutomaticFontAxes(format3);
ok(axes == DWRITE_AUTOMATIC_FONT_AXES_NONE, "Unexpected automatic axes %u.\n", axes);
hr = IDWriteTextFormat3_SetAutomaticFontAxes(format3, DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat3_SetAutomaticFontAxes(format3, DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE + 1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextFormat3_Release(format3);
@@ -5841,37 +5841,37 @@ static void test_automatic_font_axes(void)
ok(axes == DWRITE_AUTOMATIC_FONT_AXES_NONE, "Unexpected automatic axes %u.\n", axes);
hr = IDWriteTextLayout4_SetAutomaticFontAxes(layout4, DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE + 1);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout4_SetAutomaticFontAxes(layout4, DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout4_Release(layout4);
/* Out of range values allow for formats, but not for layouts. */
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 1000.0f, 1000.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %lx.\n", hr);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout4, (void **)&layout4);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
axes = IDWriteTextLayout4_GetAutomaticFontAxes(layout4);
ok(axes == DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE + 1, "Unexpected automatic axes %u.\n", axes);
hr = IDWriteTextLayout4_QueryInterface(layout4, &IID_IDWriteTextFormat3, (void **)&format3);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
axes = IDWriteTextFormat3_GetAutomaticFontAxes(format3);
ok(axes == DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE + 1, "Unexpected automatic axes %u.\n", axes);
hr = IDWriteTextLayout4_SetAutomaticFontAxes(layout4, DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
axes = IDWriteTextFormat3_GetAutomaticFontAxes(format3);
ok(axes == DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE, "Unexpected automatic axes %u.\n", axes);
hr = IDWriteTextFormat3_SetAutomaticFontAxes(format3, DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE + 1);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
IDWriteTextFormat3_Release(format3);
@@ -5907,15 +5907,15 @@ static void test_text_format_axes(void)
hr = IDWriteFactory6_CreateTextFormat(factory, L"test_family", NULL, NULL, 0, 10.0f, L"en-us", &format3);
todo_wine
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
{
hr = IDWriteTextFormat3_GetFontCollection(format3, &collection);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_QueryInterface(collection, &IID_IDWriteFontCollection2, (void **)&collection2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
model = IDWriteFontCollection2_GetFontFamilyModel(collection2);
ok(model == DWRITE_FONT_FAMILY_MODEL_TYPOGRAPHIC, "Unexpected model %d.\n", model);
@@ -5939,7 +5939,7 @@ if (SUCCEEDED(hr))
axes[0].axisTag = DWRITE_FONT_AXIS_TAG_WEIGHT;
axes[0].value = 200.0f;
hr = IDWriteTextFormat3_SetFontAxisValues(format3, axes, 1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
weight = IDWriteTextFormat3_GetFontWeight(format3);
ok(weight == DWRITE_FONT_WEIGHT_NORMAL, "Unexpected font weight %d.\n", weight);
@@ -5949,17 +5949,17 @@ if (SUCCEEDED(hr))
hr = IDWriteFactory_CreateTextFormat((IDWriteFactory *)factory, L"test_family", NULL,
DWRITE_FONT_WEIGHT_BOLD, DWRITE_FONT_STYLE_ITALIC, DWRITE_FONT_STRETCH_EXPANDED,
10.0f, L"en-us", &format);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_QueryInterface(format, &IID_IDWriteTextFormat3, (void **)&format3);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteTextFormat3_GetFontAxisValueCount(format3);
ok(!count, "Unexpected axis count %u.\n", count);
axes[0].axisTag = DWRITE_FONT_AXIS_TAG_WEIGHT;
hr = IDWriteTextFormat3_GetFontAxisValues(format3, axes, 1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(axes[0].axisTag == 0 && axes[0].value == 0.0f, "Unexpected value.\n");
axes[0].axisTag = DWRITE_FONT_AXIS_TAG_WEIGHT;
@@ -5967,22 +5967,22 @@ if (SUCCEEDED(hr))
axes[1].axisTag = DWRITE_FONT_AXIS_TAG_WIDTH;
axes[1].value = 2.0f;
hr = IDWriteTextFormat3_SetFontAxisValues(format3, axes, 2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteTextFormat3_GetFontAxisValueCount(format3);
ok(count == 2, "Unexpected axis count %u.\n", count);
hr = IDWriteTextFormat3_GetFontAxisValues(format3, axes, 1);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat3_GetFontAxisValues(format3, axes, 0);
- ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat3_GetFontAxisValues(format3, axes, 2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat3_SetFontAxisValues(format3, axes, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteTextFormat3_GetFontAxisValueCount(format3);
ok(!count, "Unexpected axis count %u.\n", count);
@@ -6013,238 +6013,238 @@ static void test_layout_range_length(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"ru", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
/* Range length is validated when setting properties. */
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
/* Weight */
range.startPosition = 10;
range.length = ~0u;
hr = IDWriteTextLayout_SetFontWeight(layout, DWRITE_FONT_WEIGHT_NORMAL, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 9;
hr = IDWriteTextLayout_SetFontWeight(layout, DWRITE_FONT_WEIGHT_NORMAL, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 10;
hr = IDWriteTextLayout_SetFontWeight(layout, DWRITE_FONT_WEIGHT_HEAVY, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0;
hr = IDWriteTextLayout_GetFontWeight(layout, 0, &weight, &range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.startPosition == 0 && range.length == 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = range.length = 0;
hr = IDWriteTextLayout_GetFontWeight(layout, 10, &weight, &range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.startPosition == 10 && range.length == ~0u - 10, "Unexpected range (%u, %u).\n",
range.startPosition, range.length);
range.startPosition = 0;
range.length = ~0u;
hr = IDWriteTextLayout_SetFontWeight(layout, DWRITE_FONT_WEIGHT_NORMAL, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Family name */
range.startPosition = 10;
range.length = ~0u;
hr = IDWriteTextLayout_SetFontFamilyName(layout, L"family", range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 9;
hr = IDWriteTextLayout_SetFontFamilyName(layout, L"family", range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 10;
hr = IDWriteTextLayout_SetFontFamilyName(layout, L"family", range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0;
range.length = ~0u;
hr = IDWriteTextLayout_SetFontFamilyName(layout, L"Tahoma", range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Style */
range.startPosition = 10;
range.length = ~0u;
hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_ITALIC, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 9;
hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_ITALIC, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 10;
hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_ITALIC, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0;
hr = IDWriteTextLayout_GetFontStyle(layout, 0, &style, &range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.startPosition == 0 && range.length == 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = range.length = 0;
hr = IDWriteTextLayout_GetFontStyle(layout, 10, &style, &range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.startPosition == 10 && range.length == ~0u - 10, "Unexpected range (%u, %u).\n",
range.startPosition, range.length);
range.startPosition = 0;
range.length = ~0u;
hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_NORMAL, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Stretch */
range.startPosition = 10;
range.length = ~0u;
hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_CONDENSED, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 9;
hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_CONDENSED, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 10;
hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_CONDENSED, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0;
hr = IDWriteTextLayout_GetFontStretch(layout, 0, &stretch, &range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.startPosition == 0 && range.length == 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = range.length = 0;
hr = IDWriteTextLayout_GetFontStretch(layout, 10, &stretch, &range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.startPosition == 10 && range.length == ~0u - 10, "Unexpected range (%u, %u).\n",
range.startPosition, range.length);
range.startPosition = 0;
range.length = ~0u;
hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_NORMAL, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Underline */
range.startPosition = 10;
range.length = ~0u;
hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 9;
hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 10;
hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0;
hr = IDWriteTextLayout_GetUnderline(layout, 0, &value, &range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.startPosition == 0 && range.length == 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = range.length = 0;
hr = IDWriteTextLayout_GetUnderline(layout, 10, &value, &range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.startPosition == 10 && range.length == ~0u - 10, "Unexpected range (%u, %u).\n",
range.startPosition, range.length);
range.startPosition = 0;
range.length = ~0u;
hr = IDWriteTextLayout_SetUnderline(layout, FALSE, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Strikethrough */
range.startPosition = 10;
range.length = ~0u;
hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 9;
hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 10;
hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0;
hr = IDWriteTextLayout_GetStrikethrough(layout, 0, &value, &range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.startPosition == 0 && range.length == 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = range.length = 0;
hr = IDWriteTextLayout_GetStrikethrough(layout, 10, &value, &range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.startPosition == 10 && range.length == ~0u - 10, "Unexpected range (%u, %u).\n",
range.startPosition, range.length);
range.startPosition = 0;
range.length = ~0u;
hr = IDWriteTextLayout_SetStrikethrough(layout, FALSE, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Locale name */
range.startPosition = 10;
range.length = ~0u;
hr = IDWriteTextLayout_SetLocaleName(layout, L"locale", range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 9;
hr = IDWriteTextLayout_SetLocaleName(layout, L"locale", range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 10;
hr = IDWriteTextLayout_SetLocaleName(layout, L"locale", range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0;
range.length = ~0u;
hr = IDWriteTextLayout_SetLocaleName(layout, L"ru", range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Inline object */
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &sign);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u;
hr = IDWriteTextLayout_SetInlineObject(layout, sign, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 9;
hr = IDWriteTextLayout_SetInlineObject(layout, sign, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 10;
hr = IDWriteTextLayout_SetInlineObject(layout, sign, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0;
object = NULL;
hr = IDWriteTextLayout_GetInlineObject(layout, 10, &object, &range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.startPosition == 10 && range.length == ~0u - 10, "Unexpected range (%u, %u).\n",
range.startPosition, range.length);
IDWriteInlineObject_Release(object);
@@ -6252,85 +6252,85 @@ static void test_layout_range_length(void)
range.startPosition = 0;
range.length = ~0u;
hr = IDWriteTextLayout_SetInlineObject(layout, NULL, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Drawing effect */
range.startPosition = 10;
range.length = ~0u;
hr = IDWriteTextLayout_SetDrawingEffect(layout, (IUnknown *)sign, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 9;
hr = IDWriteTextLayout_SetDrawingEffect(layout, (IUnknown *)sign, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 10;
hr = IDWriteTextLayout_SetDrawingEffect(layout, (IUnknown *)sign, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0;
range.length = ~0u;
hr = IDWriteTextLayout_SetDrawingEffect(layout, NULL, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteInlineObject_Release(sign);
/* Typography */
hr = IDWriteFactory_CreateTypography(factory, &typography);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u;
hr = IDWriteTextLayout_SetTypography(layout, typography, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 9;
hr = IDWriteTextLayout_SetTypography(layout, typography, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 10;
hr = IDWriteTextLayout_SetTypography(layout, typography, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0;
range.length = ~0u;
hr = IDWriteTextLayout_SetTypography(layout, NULL, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTypography_Release(typography);
/* Font collection */
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE);
- ok(hr == S_OK, "Failed to get system collection, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get system collection, hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u;
hr = IDWriteTextLayout_SetFontCollection(layout, collection, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 9;
hr = IDWriteTextLayout_SetFontCollection(layout, collection, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 10;
hr = IDWriteTextLayout_SetFontCollection(layout, collection, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0;
range.length = ~0u;
hr = IDWriteTextLayout_SetFontCollection(layout, NULL, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0;
collection2 = NULL;
hr = IDWriteTextLayout_GetFontCollection(layout, 10, &collection2, &range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.length == ~0u, "Unexpected range length %u.\n", range.length);
if (collection2)
IDWriteFontCollection_Release(collection2);
@@ -6343,27 +6343,27 @@ static void test_layout_range_length(void)
range.startPosition = 10;
range.length = ~0u;
hr = IDWriteTextLayout1_SetPairKerning(layout1, TRUE, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 9;
hr = IDWriteTextLayout1_SetPairKerning(layout1, TRUE, range);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10;
range.length = ~0u - 10;
hr = IDWriteTextLayout1_SetPairKerning(layout1, TRUE, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0;
hr = IDWriteTextLayout1_GetPairKerning(layout1, 0, &value, &range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.startPosition == 0 && range.length == 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = range.length = 0;
value = FALSE;
hr = IDWriteTextLayout1_GetPairKerning(layout1, 10, &value, &range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(range.startPosition == 10 && range.length == ~0u - 10, "Unexpected range (%u, %u).\n",
range.startPosition, range.length);
ok(!!value, "Unexpected value %d.\n", value);
@@ -6371,7 +6371,7 @@ static void test_layout_range_length(void)
range.startPosition = 0;
range.length = ~0u;
hr = IDWriteTextLayout1_SetPairKerning(layout1, FALSE, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout1_Release(layout1);
}
@@ -6398,16 +6398,16 @@ static void test_HitTestTextRange(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"ru", &format);
- ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, &layout);
- ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
/* Start index exceeding layout text length, dummy range returned. */
count = 0;
hr = IDWriteTextLayout_HitTestTextRange(layout, 7, 10, 0.0f, 0.0f, metrics, ARRAY_SIZE(metrics), &count);
todo_wine
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
{
ok(count == 1, "Unexpected metrics count %u.\n", count);
@@ -6419,7 +6419,7 @@ if (SUCCEEDED(hr))
count = 0;
hr = IDWriteTextLayout_HitTestTextRange(layout, 0, 10, 0.0f, 0.0f, metrics, ARRAY_SIZE(metrics), &count);
todo_wine
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
{
ok(count == 1, "Unexpected metrics count %u.\n", count);
@@ -6431,12 +6431,12 @@ if (SUCCEEDED(hr))
range.startPosition = 3;
range.length = 3;
hr = IDWriteTextLayout_SetFontSize(layout, 20.0f, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
hr = IDWriteTextLayout_HitTestTextRange(layout, 0, 6, 0.0f, 0.0f, metrics, ARRAY_SIZE(metrics), &count);
todo_wine
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
{
ok(count == 1, "Unexpected metrics count %u.\n", count);
@@ -6445,20 +6445,20 @@ if (SUCCEEDED(hr))
ok(!!metrics[0].isText, "Expected text range.\n");
hr = IDWriteTextLayout_GetLineMetrics(layout, &line, 1, &count);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(line.height == metrics[0].height, "Unexpected range height.\n");
}
/* With inline object. */
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &inlineobj);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
hr = IDWriteTextLayout_HitTestTextRange(layout, 0, 6, 0.0f, 0.0f, metrics, ARRAY_SIZE(metrics), &count);
todo_wine
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
{
ok(count == 2, "Unexpected metrics count %u.\n", count);
@@ -6472,7 +6472,7 @@ if (SUCCEEDED(hr))
count = 0;
hr = IDWriteTextLayout_HitTestTextRange(layout, 7, 10, 0.0f, 0.0f, metrics, ARRAY_SIZE(metrics), &count);
todo_wine
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
{
ok(count == 1, "Unexpected metrics count %u.\n", count);
--
2.34.1
1
0
note for reviewers:
- there are a couple of places where a macro (like expect) is used
and is passed several types of pair (expected vs actual) (mostly
the four configurations int vs long on both parameters are seen)
- I tested several approaches (like split expect in two expect_in
and expect_long, moving to a typed approach like compare macro),
but didn't apply them (still requiring too many casts in my
opinion), didn't even consider others (cast everywhere), and
finally used an helper function for the macro and letting the
compiler do the integral conversion (hence hidding all the
discrepancies in types we may have)
Especially for comctl32:
- I forgot to mention in patch change, but the COLORREF casts in
patch for include/commctrl.h are removed in next patch
A+
---
Eric Pouech (31):
dlls/winecrt0: enable compilation with long types
dlls/comctl32/tests: use correct integral type
dlls/comctl32/tests: use inline function in expect*() macros to handle integral conversion
include/commctrl.h: fix definition of CLR_* macros
dlls/comctl32/tests: enable compilation with long types
dlls/d3d10core/tests: enable compilation with long types
dlls/dbghelp/tests: enable compilation with long types
dlls/ddrawex/tests: enable compilation with long types
dlls/ddraw/tests: enable compilation with long types
dlls/devenum/tests: enable compilation with long types
dlls/dhcpcsvc/tests: enable compilation with long types
dlls/directmanipulation/tests: enable compilation with long types
include/ddraw.h: fix some definitions
dlls/dplayx/tests: use correct integral type
dlls/dplayx/tests: use function in checkFlags macro to handle integral conversion
dlls/dplayx/tests: enable compilation with long types
dlls/dpnet/tests: use correct integral type
dlls/dpnet/tests: enable compilation with long types
dlls/dpvoice/tests: enable compilation with long types
dlls/dsdmo/tests: enable compilation with long types
dlls/dsound/tests: enable compilation with long types
dlls/dssenh/tests: enable compilation with long types
dlls/dwmapi/tests: enable compilation with long types
dlls/dwrite/tests: use correct integral type
dlls/dwrite/tests: enable compilation with long types
dlls/dxdiagn/tests: enable compilation with long types
dlls/dxgi/tests: enable compilation with long types
dlls/explorerframe/tests: use correct integral type
dlls/explorerframe/tests: enable compilation with long types
dlls/faultrep/tests: enable compilation with long types
dlls/fusion/tests: enable compilation with long types
dlls/comctl32/tests/Makefile.in | 1 -
dlls/comctl32/tests/animate.c | 4 +-
dlls/comctl32/tests/button.c | 196 +-
dlls/comctl32/tests/combo.c | 114 +-
dlls/comctl32/tests/datetime.c | 62 +-
dlls/comctl32/tests/dpa.c | 72 +-
dlls/comctl32/tests/edit.c | 203 +-
dlls/comctl32/tests/header.c | 78 +-
dlls/comctl32/tests/imagelist.c | 120 +-
dlls/comctl32/tests/listbox.c | 226 +-
dlls/comctl32/tests/listview.c | 150 +-
dlls/comctl32/tests/misc.c | 58 +-
dlls/comctl32/tests/monthcal.c | 49 +-
dlls/comctl32/tests/mru.c | 28 +-
dlls/comctl32/tests/msg.h | 16 +-
dlls/comctl32/tests/pager.c | 32 +-
dlls/comctl32/tests/progress.c | 12 +-
dlls/comctl32/tests/propsheet.c | 84 +-
dlls/comctl32/tests/rebar.c | 22 +-
dlls/comctl32/tests/static.c | 4 +-
dlls/comctl32/tests/status.c | 13 +-
dlls/comctl32/tests/subclass.c | 2 +-
dlls/comctl32/tests/syslink.c | 10 +-
dlls/comctl32/tests/tab.c | 45 +-
dlls/comctl32/tests/taskdialog.c | 16 +-
dlls/comctl32/tests/toolbar.c | 184 +-
dlls/comctl32/tests/tooltips.c | 82 +-
dlls/comctl32/tests/trackbar.c | 15 +-
dlls/comctl32/tests/treeview.c | 62 +-
dlls/comctl32/tests/updown.c | 26 +-
dlls/comctl32/tests/v6util.h | 4 +-
dlls/d3d10core/tests/Makefile.in | 1 -
dlls/d3d10core/tests/d3d10core.c | 1524 ++---
dlls/dbghelp/tests/Makefile.in | 1 -
dlls/dbghelp/tests/dbghelp.c | 10 +-
dlls/ddraw/tests/Makefile.in | 1 -
dlls/ddraw/tests/d3d.c | 620 +-
dlls/ddraw/tests/ddraw1.c | 4082 ++++++-------
dlls/ddraw/tests/ddraw2.c | 4704 +++++++--------
dlls/ddraw/tests/ddraw4.c | 5648 +++++++++---------
dlls/ddraw/tests/ddraw7.c | 5360 ++++++++---------
dlls/ddraw/tests/ddrawmodes.c | 182 +-
dlls/ddraw/tests/dsurface.c | 752 +--
dlls/ddraw/tests/refcount.c | 126 +-
dlls/ddraw/tests/visual.c | 448 +-
dlls/ddrawex/tests/Makefile.in | 1 -
dlls/ddrawex/tests/ddrawex.c | 18 +-
dlls/ddrawex/tests/surface.c | 100 +-
dlls/devenum/tests/Makefile.in | 1 -
dlls/devenum/tests/devenum.c | 266 +-
dlls/dhcpcsvc/tests/Makefile.in | 1 -
dlls/dhcpcsvc/tests/dhcpcsvc.c | 18 +-
dlls/directmanipulation/tests/Makefile.in | 1 -
dlls/directmanipulation/tests/manipulation.c | 4 +-
dlls/dplayx/tests/Makefile.in | 1 -
dlls/dplayx/tests/dplayx.c | 133 +-
dlls/dpnet/tests/Makefile.in | 1 -
dlls/dpnet/tests/address.c | 194 +-
dlls/dpnet/tests/client.c | 362 +-
dlls/dpnet/tests/server.c | 85 +-
dlls/dpnet/tests/thread.c | 108 +-
dlls/dpvoice/tests/Makefile.in | 1 -
dlls/dpvoice/tests/voice.c | 100 +-
dlls/dsdmo/tests/Makefile.in | 1 -
dlls/dsdmo/tests/dsdmo.c | 170 +-
dlls/dsound/tests/Makefile.in | 1 -
dlls/dsound/tests/capture.c | 150 +-
dlls/dsound/tests/ds3d.c | 250 +-
dlls/dsound/tests/ds3d8.c | 238 +-
dlls/dsound/tests/dsound.c | 386 +-
dlls/dsound/tests/dsound8.c | 426 +-
dlls/dsound/tests/duplex.c | 76 +-
dlls/dsound/tests/propset.c | 124 +-
dlls/dssenh/tests/Makefile.in | 1 -
dlls/dssenh/tests/dssenh.c | 254 +-
dlls/dwmapi/tests/Makefile.in | 1 -
dlls/dwmapi/tests/dwmapi.c | 4 +-
dlls/dwrite/tests/Makefile.in | 1 -
dlls/dwrite/tests/analyzer.c | 196 +-
dlls/dwrite/tests/font.c | 1848 +++---
dlls/dwrite/tests/layout.c | 1428 ++---
dlls/dxdiagn/tests/Makefile.in | 1 -
dlls/dxdiagn/tests/container.c | 174 +-
dlls/dxdiagn/tests/provider.c | 30 +-
dlls/dxgi/tests/Makefile.in | 1 -
dlls/dxgi/tests/dxgi.c | 1590 ++---
dlls/explorerframe/tests/Makefile.in | 1 -
dlls/explorerframe/tests/nstc.c | 606 +-
dlls/explorerframe/tests/taskbarlist.c | 66 +-
dlls/faultrep/tests/Makefile.in | 1 -
dlls/faultrep/tests/faultrep.c | 8 +-
dlls/fusion/tests/Makefile.in | 1 -
dlls/fusion/tests/asmcache.c | 344 +-
dlls/fusion/tests/asmenum.c | 82 +-
dlls/fusion/tests/asmname.c | 316 +-
dlls/fusion/tests/fusion.c | 22 +-
dlls/winecrt0/Makefile.in | 1 -
dlls/winecrt0/debug.c | 6 +-
include/commctrl.h | 4 +-
include/ddraw.h | 22 +-
100 files changed, 17856 insertions(+), 17819 deletions(-)
4
39
[PATCH vkd3d v2 6/6] vkd3d-shader/hlsl: Reroute initialization towards a generic variable initializer.
by Francisco Casas 25 Feb '22
by Francisco Casas 25 Feb '22
25 Feb '22
Signed-off-by: Francisco Casas <fcasas(a)codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
v2:
- Use flatten_parse_initializer()'s return value.
- Remove guards for vkd3d_free(v->arrays.sizes).
I think the
if (v->initializer.args_count)
{
if (v->initializer.args_count > 1)
...
else
...
pattern should be kept, since there are instructions common for both cases at the
end of the block.
Signed-off-by: Francisco Casas <fcasas(a)codeweavers.com>
---
libs/vkd3d-shader/hlsl.y | 101 ++++++++++++++++-----------------------
1 file changed, 41 insertions(+), 60 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y
index 704e1eaf..759cebe7 100644
--- a/libs/vkd3d-shader/hlsl.y
+++ b/libs/vkd3d-shader/hlsl.y
@@ -1489,14 +1489,6 @@ static void struct_var_initializer(struct hlsl_ctx *ctx, struct hlsl_ir_var *var
struct hlsl_struct_field *field;
unsigned int i = 0;
- if (initializer_size(initializer) != hlsl_type_component_count(type))
- {
- hlsl_error(ctx, &var->loc, VKD3D_SHADER_ERROR_HLSL_WRONG_PARAMETER_COUNT,
- "Expected %u components in initializer, but got %u.",
- hlsl_type_component_count(type), initializer_size(initializer));
- return;
- }
-
LIST_FOR_EACH_ENTRY(field, type->e.elements, struct hlsl_struct_field, entry)
{
struct hlsl_ir_node *node = initializer->args[i];
@@ -1523,6 +1515,28 @@ static void struct_var_initializer(struct hlsl_ctx *ctx, struct hlsl_ir_var *var
}
}
+static void initialize_generic_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *var,
+ struct parse_initializer *initializer, unsigned int reg_offset, struct hlsl_type *type,
+ unsigned int *initializer_offset)
+{
+ if (type->type <= HLSL_CLASS_LAST_NUMERIC)
+ {
+ initialize_numeric_var(ctx, var, initializer, reg_offset, type, initializer_offset);
+ }
+ else if (type->type == HLSL_CLASS_STRUCT)
+ {
+ struct_var_initializer(ctx, var, initializer);
+ }
+ else if (type->type == HLSL_CLASS_ARRAY)
+ {
+ hlsl_fixme(ctx, &var->loc, "Initializers for arrays not supported yet.");
+ }
+ else if (type->type == HLSL_CLASS_OBJECT)
+ {
+ hlsl_fixme(ctx, &var->loc, "Initializers for objects not supported yet.");
+ }
+}
+
static void free_parse_variable_def(struct parse_variable_def *v)
{
free_parse_initializer(&v->initializer);
@@ -1644,67 +1658,34 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
if (v->initializer.args_count)
{
- unsigned int size = initializer_size(&v->initializer);
-
- if (type->type <= HLSL_CLASS_LAST_NUMERIC && v->initializer.args_count != 1
- && type->dimx * type->dimy != size)
- {
- hlsl_error(ctx, &v->loc, VKD3D_SHADER_ERROR_HLSL_WRONG_PARAMETER_COUNT,
- "Expected %u components in numeric initializer, but got %u.",
- type->dimx * type->dimy, v->initializer.args_count);
- free_parse_initializer(&v->initializer);
- vkd3d_free(v);
- continue;
- }
- if ((type->type == HLSL_CLASS_STRUCT || type->type == HLSL_CLASS_ARRAY)
- && hlsl_type_component_count(type) != size)
- {
- hlsl_error(ctx, &v->loc, VKD3D_SHADER_ERROR_HLSL_WRONG_PARAMETER_COUNT,
- "Expected %u components in initializer, but got %u.", hlsl_type_component_count(type), size);
- free_parse_initializer(&v->initializer);
- vkd3d_free(v);
- continue;
- }
-
- if (type->type == HLSL_CLASS_STRUCT)
- {
- struct_var_initializer(ctx, var, &v->initializer);
- list_move_tail(statements_list, v->initializer.instrs);
-
- free_parse_initializer(&v->initializer);
- vkd3d_free(v);
- continue;
- }
- if (type->type > HLSL_CLASS_LAST_NUMERIC)
- {
- FIXME("Initializers for non scalar/struct variables not supported yet.\n");
- free_parse_initializer(&v->initializer);
- vkd3d_free(v->arrays.sizes);
- vkd3d_free(v);
- continue;
- }
- if (v->arrays.count)
- {
- hlsl_fixme(ctx, &v->loc, "Array initializer.");
- free_parse_initializer(&v->initializer);
- vkd3d_free(v->arrays.sizes);
- vkd3d_free(v);
- continue;
- }
-
if (v->initializer.args_count > 1)
{
+ unsigned int size = initializer_size(&v->initializer);
unsigned int initializer_offset = 0;
- if (!flatten_parse_initializer(ctx, &v->initializer))
+ if (hlsl_type_component_count(type) != size)
{
- hlsl_fixme(ctx, &v->loc, "Could not flatten initializer.");
+ hlsl_error(ctx, &v->loc, VKD3D_SHADER_ERROR_HLSL_WRONG_PARAMETER_COUNT,
+ "Expected %u components in initializer, but got %u.", hlsl_type_component_count(type), size);
free_parse_initializer(&v->initializer);
+ vkd3d_free(v->arrays.sizes);
vkd3d_free(v);
continue;
}
- assert(v->initializer.args_count == size);
- initialize_numeric_var(ctx, var, &v->initializer, 0, type, &initializer_offset);
+
+ if (type->type <= HLSL_CLASS_LAST_NUMERIC)
+ {
+ if (!flatten_parse_initializer(ctx, &v->initializer))
+ {
+ hlsl_fixme(ctx, &v->loc, "Could not flatten initializer.");
+ free_parse_initializer(&v->initializer);
+ vkd3d_free(v->arrays.sizes);
+ vkd3d_free(v);
+ continue;
+ }
+ assert(v->initializer.args_count == size);
+ }
+ initialize_generic_var(ctx, var, &v->initializer, 0, type, &initializer_offset);
}
else
{
--
2.25.1
2
1
25 Feb '22
Signed-off-by: Francisco Casas <fcasas(a)codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
v2:
- formatting.
- flatten_parse_initializer() now returns bool.
Signed-off-by: Francisco Casas <fcasas(a)codeweavers.com>
---
libs/vkd3d-shader/hlsl.y | 122 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 119 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y
index 725cbad3..0e882834 100644
--- a/libs/vkd3d-shader/hlsl.y
+++ b/libs/vkd3d-shader/hlsl.y
@@ -1321,6 +1321,122 @@ static bool add_increment(struct hlsl_ctx *ctx, struct list *instrs, bool decrem
return true;
}
+static bool append_node_components(struct hlsl_ctx *ctx, struct list *instrs,
+ struct hlsl_ir_node *node, struct hlsl_ir_node **comps, unsigned int *comps_count,
+ const struct vkd3d_shader_location *loc)
+{
+ struct hlsl_type *type = node->data_type;
+
+ switch (type->type)
+ {
+ case HLSL_CLASS_SCALAR:
+ {
+ comps[*comps_count] = node;
+ *comps_count += 1;
+ break;
+ }
+
+ case HLSL_CLASS_VECTOR:
+ {
+ struct hlsl_type *cast_type = hlsl_get_scalar_type(ctx, type->base_type);
+ struct hlsl_ir_swizzle *swizzle;
+ struct hlsl_ir_node *cast;
+ unsigned int i;
+
+ for (i = 0; i < type->dimx; i++)
+ {
+ if (!(swizzle = hlsl_new_swizzle(ctx, hlsl_swizzle_from_writemask(1 << i), 1, node, loc)))
+ return false;
+ list_add_tail(instrs, &swizzle->node.entry);
+
+ if (!(cast = add_implicit_conversion(ctx, instrs, &swizzle->node, cast_type, loc)))
+ return false;
+
+ comps[*comps_count] = cast;
+ *comps_count += 1;
+ }
+ break;
+ }
+
+ case HLSL_CLASS_MATRIX:
+ {
+ hlsl_fixme(ctx, loc, "Flattening of matrices.");
+ return false;
+ }
+
+ case HLSL_CLASS_STRUCT:
+ {
+ struct hlsl_struct_field *field;
+ struct hlsl_ir_load *load;
+
+ LIST_FOR_EACH_ENTRY(field, type->e.elements, struct hlsl_struct_field, entry)
+ {
+ if (!(load = add_record_load(ctx, instrs, node, field, *loc)))
+ return false;
+
+ if (!append_node_components(ctx, instrs, &load->node, comps, comps_count, loc))
+ return false;
+ }
+ break;
+ }
+
+ case HLSL_CLASS_ARRAY:
+ {
+ struct hlsl_ir_constant *c;
+ struct hlsl_ir_load *load;
+ unsigned int i;
+
+ for (i = 0; i < type->e.array.elements_count; i++)
+ {
+ if (!(c = hlsl_new_uint_constant(ctx, i, *loc)))
+ return false;
+ list_add_tail(instrs, &c->node.entry);
+
+ if (!(load = add_array_load(ctx, instrs, node, &c->node, *loc)))
+ return false;
+
+ if (!append_node_components(ctx, instrs, &load->node, comps, comps_count, loc))
+ return false;
+ }
+ break;
+ }
+
+ case HLSL_CLASS_OBJECT:
+ {
+ hlsl_fixme(ctx, loc, "Flattening of objects.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+static bool flatten_parse_initializer(struct hlsl_ctx *ctx, struct parse_initializer *initializer)
+{
+ unsigned int size = initializer_size(initializer);
+ unsigned int new_args_count = 0;
+ struct hlsl_ir_node **new_args;
+ bool success = true;
+ unsigned int i = 0;
+
+ new_args = hlsl_alloc(ctx, size * sizeof(struct hlsl_ir_node *));
+ if (!new_args)
+ return false;
+
+ for (i = 0; i < initializer->args_count; i++)
+ {
+ success = append_node_components(ctx, initializer->instrs, initializer->args[i], new_args,
+ &new_args_count, &initializer->args[i]->loc);
+ if (!success)
+ break;
+ }
+
+ vkd3d_free(initializer->args);
+ initializer->args = new_args;
+ initializer->args_count = new_args_count;
+ return success;
+}
+
static void initialize_numeric_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *var,
struct parse_initializer *initializer, unsigned int reg_offset, struct hlsl_type *type,
unsigned int *initializer_offset)
@@ -1583,14 +1699,14 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
{
unsigned int initializer_offset = 0;
- if (v->initializer.args_count != size)
+ if (!flatten_parse_initializer(ctx, &v->initializer))
{
- hlsl_fixme(ctx, &v->loc, "Flatten initializer.");
+ hlsl_fixme(ctx, &v->loc, "Could not flatten initializer.");
free_parse_initializer(&v->initializer);
vkd3d_free(v);
continue;
}
-
+ assert(v->initializer.args_count == size);
initialize_numeric_var(ctx, var, &v->initializer, 0, type, &initializer_offset);
}
else
--
2.25.1
2
1
[PATCH vkd3d v2 3/6] vkd3d-shader/hlsl: Support complex numeric initializers.
by Francisco Casas 25 Feb '22
by Francisco Casas 25 Feb '22
25 Feb '22
Signed-off-by: Francisco Casas <fcasas(a)codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
v2:
- Use new name of hlsl_type_is_single_reg(), hlsl_type_uses_writemask().
Signed-off-by: Francisco Casas <fcasas(a)codeweavers.com>
---
Makefile.am | 1 -
libs/vkd3d-shader/hlsl.y | 93 +++++++++++++++++++++++++++++++---------
2 files changed, 73 insertions(+), 21 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 8617a09d..3fc803c3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -310,7 +310,6 @@ XFAIL_TESTS = \
tests/hlsl-initializer-invalid-arg-count.shader_test \
tests/hlsl-initializer-local-array.shader_test \
tests/hlsl-initializer-nested.shader_test \
- tests/hlsl-initializer-numeric.shader_test \
tests/hlsl-initializer-static-array.shader_test \
tests/hlsl-initializer-struct.shader_test \
tests/hlsl-bool-cast.shader_test \
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y
index 5e142914..725cbad3 100644
--- a/libs/vkd3d-shader/hlsl.y
+++ b/libs/vkd3d-shader/hlsl.y
@@ -1321,6 +1321,51 @@ static bool add_increment(struct hlsl_ctx *ctx, struct list *instrs, bool decrem
return true;
}
+static void initialize_numeric_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *var,
+ struct parse_initializer *initializer, unsigned int reg_offset, struct hlsl_type *type,
+ unsigned int *initializer_offset)
+{
+ unsigned int i;
+
+ if (type->type == HLSL_CLASS_MATRIX)
+ hlsl_fixme(ctx, &var->loc, "Matrix initializer.");
+
+ for (i = 0; i < type->dimx; i++)
+ {
+ struct hlsl_ir_store *store;
+ struct hlsl_ir_constant *c;
+ struct hlsl_ir_node *node;
+
+ node = initializer->args[*initializer_offset];
+ *initializer_offset += 1;
+
+ if (!(node = add_implicit_conversion(ctx, initializer->instrs, node,
+ hlsl_get_scalar_type(ctx, type->base_type), &node->loc)))
+ return;
+
+ if (hlsl_type_uses_writemask(var->data_type))
+ {
+ if (!(c = hlsl_new_uint_constant(ctx, reg_offset, node->loc)))
+ return;
+ list_add_tail(initializer->instrs, &c->node.entry);
+
+ if (!(store = hlsl_new_store(ctx, var, &c->node, node, (1u << i), node->loc)))
+ return;
+ }
+ else
+ {
+ if (!(c = hlsl_new_uint_constant(ctx, reg_offset + i, node->loc)))
+ return;
+ list_add_tail(initializer->instrs, &c->node.entry);
+
+ if (!(store = hlsl_new_store(ctx, var, &c->node, node, 0, node->loc)))
+ return;
+ }
+
+ list_add_tail(initializer->instrs, &store->node.entry);
+ }
+}
+
static void struct_var_initializer(struct hlsl_ctx *ctx, struct list *list, struct hlsl_ir_var *var,
struct parse_initializer *initializer)
{
@@ -1490,20 +1535,16 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
if (v->initializer.args_count)
{
unsigned int size = initializer_size(&v->initializer);
- struct hlsl_ir_load *load;
- if (type->type <= HLSL_CLASS_LAST_NUMERIC
- && type->dimx * type->dimy != size && size != 1)
+ if (type->type <= HLSL_CLASS_LAST_NUMERIC && v->initializer.args_count != 1
+ && type->dimx * type->dimy != size)
{
- if (size < type->dimx * type->dimy)
- {
- hlsl_error(ctx, &v->loc, VKD3D_SHADER_ERROR_HLSL_WRONG_PARAMETER_COUNT,
- "Expected %u components in numeric initializer, but got %u.",
- type->dimx * type->dimy, size);
- free_parse_initializer(&v->initializer);
- vkd3d_free(v);
- continue;
- }
+ hlsl_error(ctx, &v->loc, VKD3D_SHADER_ERROR_HLSL_WRONG_PARAMETER_COUNT,
+ "Expected %u components in numeric initializer, but got %u.",
+ type->dimx * type->dimy, v->initializer.args_count);
+ free_parse_initializer(&v->initializer);
+ vkd3d_free(v);
+ continue;
}
if ((type->type == HLSL_CLASS_STRUCT || type->type == HLSL_CLASS_ARRAY)
&& hlsl_type_component_count(type) != size)
@@ -1537,23 +1578,35 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
vkd3d_free(v);
continue;
}
+
if (v->initializer.args_count > 1)
{
- hlsl_fixme(ctx, &v->loc, "Complex initializer.");
- free_parse_initializer(&v->initializer);
- vkd3d_free(v);
- continue;
+ unsigned int initializer_offset = 0;
+
+ if (v->initializer.args_count != size)
+ {
+ hlsl_fixme(ctx, &v->loc, "Flatten initializer.");
+ free_parse_initializer(&v->initializer);
+ vkd3d_free(v);
+ continue;
+ }
+
+ initialize_numeric_var(ctx, var, &v->initializer, 0, type, &initializer_offset);
}
+ else
+ {
+ struct hlsl_ir_load *load = hlsl_new_var_load(ctx, var, var->loc);
- load = hlsl_new_var_load(ctx, var, var->loc);
- list_add_tail(v->initializer.instrs, &load->node.entry);
- add_assignment(ctx, v->initializer.instrs, &load->node, ASSIGN_OP_ASSIGN, v->initializer.args[0]);
- vkd3d_free(v->initializer.args);
+ list_add_tail(v->initializer.instrs, &load->node.entry);
+ add_assignment(ctx, v->initializer.instrs, &load->node, ASSIGN_OP_ASSIGN, v->initializer.args[0]);
+ }
if (modifiers & HLSL_STORAGE_STATIC)
list_move_tail(&ctx->static_initializers, v->initializer.instrs);
else
list_move_tail(statements_list, v->initializer.instrs);
+
+ vkd3d_free(v->initializer.args);
vkd3d_free(v->initializer.instrs);
}
--
2.25.1
2
1
[PATCH vkd3d v2 1/6] vkd3d-shader/hlsl: Properly free parse_variable_def memory in declare_vars().
by Francisco Casas 25 Feb '22
by Francisco Casas 25 Feb '22
25 Feb '22
Signed-off-by: Francisco Casas <fcasas(a)codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
v2:
- Removed guards for vkd3d_free(v->arrays.sizes).
Signed-off-by: Francisco Casas <fcasas(a)codeweavers.com>
---
libs/vkd3d-shader/hlsl.y | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y
index 459ad03b..5e142914 100644
--- a/libs/vkd3d-shader/hlsl.y
+++ b/libs/vkd3d-shader/hlsl.y
@@ -1467,6 +1467,8 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
hlsl_error(ctx, &v->loc, VKD3D_SHADER_ERROR_HLSL_MISSING_INITIALIZER,
"Const variable \"%s\" is missing an initializer.", var->name);
hlsl_free_var(var);
+ free_parse_initializer(&v->initializer);
+ vkd3d_free(v->arrays.sizes);
vkd3d_free(v);
continue;
}
@@ -1479,6 +1481,8 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
"Variable \"%s\" was already declared in this scope.", var->name);
hlsl_note(ctx, &old->loc, VKD3D_SHADER_LOG_ERROR, "\"%s\" was previously declared here.", old->name);
hlsl_free_var(var);
+ free_parse_initializer(&v->initializer);
+ vkd3d_free(v->arrays.sizes);
vkd3d_free(v);
continue;
}
@@ -1521,6 +1525,7 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
{
FIXME("Initializers for non scalar/struct variables not supported yet.\n");
free_parse_initializer(&v->initializer);
+ vkd3d_free(v->arrays.sizes);
vkd3d_free(v);
continue;
}
@@ -1528,6 +1533,7 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
{
hlsl_fixme(ctx, &v->loc, "Array initializer.");
free_parse_initializer(&v->initializer);
+ vkd3d_free(v->arrays.sizes);
vkd3d_free(v);
continue;
}
@@ -1550,6 +1556,8 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
list_move_tail(statements_list, v->initializer.instrs);
vkd3d_free(v->initializer.instrs);
}
+
+ vkd3d_free(v->arrays.sizes);
vkd3d_free(v);
}
vkd3d_free(var_list);
--
2.25.1
2
1
[PATCH v2] windowscodecs: Correctly handle 8bpp custom conversions
by Alistair Leslie-Hughes 24 Feb '22
by Alistair Leslie-Hughes 24 Feb '22
24 Feb '22
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/windowscodecs/converter.c | 29 +++---
dlls/windowscodecs/tests/converter.c | 128 +++++++++++++++++++++++++++
2 files changed, 144 insertions(+), 13 deletions(-)
diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c
index a401d1cdc4a..ed0babc26f2 100644
--- a/dlls/windowscodecs/converter.c
+++ b/dlls/windowscodecs/converter.c
@@ -69,6 +69,7 @@ struct pixelformatinfo {
enum pixelformat format;
const WICPixelFormatGUID *guid;
copyfunc copy_function;
+ BOOL is_indexed_format;
};
typedef struct FormatConverter {
@@ -1493,10 +1494,10 @@ static HRESULT copypixels_to_8bppIndexed(struct FormatConverter *This, const WIC
}
static const struct pixelformatinfo supported_formats[] = {
- {format_1bppIndexed, &GUID_WICPixelFormat1bppIndexed, NULL},
- {format_2bppIndexed, &GUID_WICPixelFormat2bppIndexed, NULL},
- {format_4bppIndexed, &GUID_WICPixelFormat4bppIndexed, NULL},
- {format_8bppIndexed, &GUID_WICPixelFormat8bppIndexed, copypixels_to_8bppIndexed},
+ {format_1bppIndexed, &GUID_WICPixelFormat1bppIndexed, NULL, TRUE},
+ {format_2bppIndexed, &GUID_WICPixelFormat2bppIndexed, NULL, TRUE},
+ {format_4bppIndexed, &GUID_WICPixelFormat4bppIndexed, NULL, TRUE},
+ {format_8bppIndexed, &GUID_WICPixelFormat8bppIndexed, copypixels_to_8bppIndexed, TRUE},
{format_BlackWhite, &GUID_WICPixelFormatBlackWhite, NULL},
{format_2bppGray, &GUID_WICPixelFormat2bppGray, NULL},
{format_4bppGray, &GUID_WICPixelFormat4bppGray, NULL},
@@ -1689,6 +1690,13 @@ static HRESULT WINAPI FormatConverter_Initialize(IWICFormatConverter *iface,
TRACE("(%p,%p,%s,%u,%p,%0.3f,%u)\n", iface, source, debugstr_guid(dstFormat),
dither, palette, alpha_threshold, palette_type);
+ dstinfo = get_formatinfo(dstFormat);
+ if (!dstinfo)
+ {
+ FIXME("Unsupported destination format %s\n", debugstr_guid(dstFormat));
+ return WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT;
+ }
+
if (!palette)
{
UINT bpp;
@@ -1703,7 +1711,10 @@ static HRESULT WINAPI FormatConverter_Initialize(IWICFormatConverter *iface,
case WICBitmapPaletteTypeCustom:
IWICPalette_Release(palette);
palette = NULL;
- if (bpp <= 8) return E_INVALIDARG;
+
+ /* Indexed types require a palette */
+ if (dstinfo->is_indexed_format)
+ return E_INVALIDARG;
break;
case WICBitmapPaletteTypeMedianCut:
@@ -1747,14 +1758,6 @@ static HRESULT WINAPI FormatConverter_Initialize(IWICFormatConverter *iface,
goto end;
}
- dstinfo = get_formatinfo(dstFormat);
- if (!dstinfo)
- {
- res = WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT;
- FIXME("Unsupported destination format %s\n", debugstr_guid(dstFormat));
- goto end;
- }
-
if (dstinfo->copy_function)
{
IWICBitmapSource_AddRef(source);
diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c
index f0672fceaf8..ca26b5204bc 100644
--- a/dlls/windowscodecs/tests/converter.c
+++ b/dlls/windowscodecs/tests/converter.c
@@ -538,6 +538,18 @@ static const float bits_32bppGrayFloat[] = {
static const struct bitmap_data testdata_32bppGrayFloat = {
&GUID_WICPixelFormat32bppGrayFloat, 32, (const BYTE *)bits_32bppGrayFloat, 32, 2, 96.0, 96.0, &testdata_32bppGrayFloat_xp};
+static const BYTE bits_4bppGray_xp[] = {
+ 77,112,77,112,77,112,77,112,77,112,77,112,77,112,77,112,249,
+ 239,249,239,249,239,249,239,249,239,249,239,249,239,249,239};
+static const struct bitmap_data testdata_4bppGray_xp = {
+ &GUID_WICPixelFormat4bppGray, 4, bits_4bppGray_xp, 32, 2, 96.0, 96.0};
+
+static const BYTE bits_4bppGray[] = {
+ 77,112,77,112,77,112,77,112,77,112,77,112,77,112,77,112,249,
+ 239,249,239,249,239,249,239,249,239,249,239,249,239,249,239};
+static const struct bitmap_data testdata_4bppGray = {
+ &GUID_WICPixelFormat4bppGray, 4, bits_4bppGray, 32, 2, 96.0, 96.0, &testdata_4bppGray_xp};
+
static const BYTE bits_8bppGray_xp[] = {
29,150,76,0,29,150,76,0,29,150,76,0,29,150,76,0,
29,150,76,0,29,150,76,0,29,150,76,0,29,150,76,0,
@@ -637,6 +649,72 @@ static void test_default_converter(void)
DeleteTestBitmap(src_obj);
}
+static void test_converter_4bppGray(void)
+{
+ BitmapTestSrc *src_obj;
+ IWICFormatConverter *converter;
+ BOOL can_convert = TRUE;
+ HRESULT hr;
+
+ CreateTestBitmap(&testdata_32bppBGRA, &src_obj);
+
+ hr = CoCreateInstance(&CLSID_WICDefaultFormatConverter, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IWICFormatConverter, (void**)&converter);
+ ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+ if (SUCCEEDED(hr))
+ {
+ hr = IWICFormatConverter_CanConvert(converter, &GUID_WICPixelFormat32bppBGRA,
+ &GUID_WICPixelFormat4bppGray, &can_convert);
+ ok(SUCCEEDED(hr), "CanConvert returned %x\n", hr);
+ todo_wine ok(can_convert, "expected TRUE, got %i\n", can_convert);
+
+ hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
+ &GUID_WICPixelFormat4bppGray, WICBitmapDitherTypeNone, NULL, 0.0,
+ WICBitmapPaletteTypeCustom);
+ todo_wine ok(SUCCEEDED(hr), "Initialize returned %x\n", hr);
+
+ if (SUCCEEDED(hr))
+ compare_bitmap_data(&testdata_32bppBGRA, &testdata_4bppGray, (IWICBitmapSource*)converter, "4bppGray converter");
+
+ IWICFormatConverter_Release(converter);
+ }
+
+ DeleteTestBitmap(src_obj);
+}
+
+static void test_converter_8bppGray(void)
+{
+ BitmapTestSrc *src_obj;
+ IWICFormatConverter *converter;
+ BOOL can_convert = TRUE;
+ HRESULT hr;
+
+ CreateTestBitmap(&testdata_32bppBGRA, &src_obj);
+
+ hr = CoCreateInstance(&CLSID_WICDefaultFormatConverter, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IWICFormatConverter, (void**)&converter);
+ ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
+ if (SUCCEEDED(hr))
+ {
+ hr = IWICFormatConverter_CanConvert(converter, &GUID_WICPixelFormat32bppBGRA,
+ &GUID_WICPixelFormat8bppGray, &can_convert);
+ ok(SUCCEEDED(hr), "CanConvert returned %x\n", hr);
+ ok(can_convert, "expected TRUE, got %i\n", can_convert);
+
+ hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
+ &GUID_WICPixelFormat8bppGray, WICBitmapDitherTypeNone, NULL, 0.0,
+ WICBitmapPaletteTypeCustom);
+ ok(SUCCEEDED(hr), "Initialize returned %x\n", hr);
+
+ if (SUCCEEDED(hr))
+ compare_bitmap_data(&testdata_32bppBGRA, &testdata_8bppGray, (IWICBitmapSource*)converter, "8bppGray converter");
+
+ IWICFormatConverter_Release(converter);
+ }
+
+ DeleteTestBitmap(src_obj);
+}
+
typedef struct property_opt_test_data
{
LPCOLESTR name;
@@ -1736,6 +1814,54 @@ static void test_converter_8bppIndexed(void)
ok(hr == WINCODEC_ERR_WRONGSTATE, "unexpected error %#x\n", hr);
IWICFormatConverter_Release(converter);
+ hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
+ ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+ hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
+ &GUID_WICPixelFormat4bppIndexed, WICBitmapDitherTypeNone,
+ NULL, 0.0, WICBitmapPaletteTypeCustom);
+ ok(hr == E_INVALIDARG, "unexpected error %#x\n", hr);
+ IWICFormatConverter_Release(converter);
+
+ hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
+ ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+ hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
+ &GUID_WICPixelFormat2bppIndexed, WICBitmapDitherTypeNone,
+ NULL, 0.0, WICBitmapPaletteTypeCustom);
+ ok(hr == E_INVALIDARG, "unexpected error %#x\n", hr);
+ IWICFormatConverter_Release(converter);
+
+ hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
+ ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+ hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
+ &GUID_WICPixelFormat1bppIndexed, WICBitmapDitherTypeNone,
+ NULL, 0.0, WICBitmapPaletteTypeCustom);
+ ok(hr == E_INVALIDARG, "unexpected error %#x\n", hr);
+ IWICFormatConverter_Release(converter);
+
+ hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
+ ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+ hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
+ &GUID_WICPixelFormat1bppIndexed, WICBitmapDitherTypeNone,
+ NULL, 0.0, WICBitmapPaletteTypeMedianCut);
+ todo_wine ok(hr == S_OK, "unexpected error %#x\n", hr);
+ IWICFormatConverter_Release(converter);
+
+ hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
+ ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+ hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
+ &GUID_WICPixelFormat1bppIndexed, WICBitmapDitherTypeNone,
+ NULL, 0.0, WICBitmapPaletteTypeFixedBW);
+ todo_wine ok(hr == S_OK, "unexpected error %#x\n", hr);
+ IWICFormatConverter_Release(converter);
+
+ hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
+ ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
+ hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
+ &GUID_WICPixelFormat1bppIndexed, WICBitmapDitherTypeNone,
+ NULL, 0.0, WICBitmapPaletteTypeFixedHalftone8);
+ todo_wine ok(hr == E_INVALIDARG, "unexpected error %#x\n", hr);
+ IWICFormatConverter_Release(converter);
+
/* empty palette + Custom type */
hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
@@ -1906,6 +2032,8 @@ START_TEST(converter)
test_invalid_conversion();
test_default_converter();
+ test_converter_4bppGray();
+ test_converter_8bppGray();
test_converter_8bppIndexed();
test_encoder(&testdata_8bppIndexed, &CLSID_WICGifEncoder,
--
2.34.1
2
1