ReactOS 0.4.16-dev-289-g096a551
atltest.h File Reference
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <windows.h>
Include dependency graph for atltest.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ok(value, ...)
 
#define ok_(x1, x2)   atltest_set_location(x1,x2); atltest_ok
 
#define skip(...)
 
#define trace   printf
 
#define START_TEST(x)
 
#define ok_hex(expression, result)
 
#define ok_dec(expression, result)
 
#define ok_ptr(expression, result)
 
#define ok_size_t(expression, result)
 
#define ok_char(expression, result)   ok_hex(expression, result)
 
#define ok_err(error)    ok(GetLastError() == (error), "Wrong last error. Expected " #error ", got 0x%lx\n", GetLastError())
 
#define ok_str(x, y)    ok(strcmp(x, y) == 0, "Wrong string. Expected '%s', got '%s'\n", y, x)
 
#define ok_wstr(x, y)    ok(wcscmp(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x)
 
#define ok_long(expression, result)   ok_hex(expression, result)
 
#define ok_int(expression, result)   ok_dec(expression, result)
 
#define ok_ntstatus(status, expected)   ok_hex(status, expected)
 
#define ok_hdl   ok_ptr
 
#define broken(x)   x
 

Functions

void atltest_set_location (const char *file, int line)
 
void atltest_ok (int value, const char *fmt,...)
 
void atltest_skip (const char *fmt,...)
 
static void atltest_start_test (void)
 
int main (void)
 
charwine_dbgstr_w (const wchar_t *wstr)
 
static const charwine_dbgstr_point (const POINT *ppt)
 
static const charwine_dbgstr_size (const SIZE *psize)
 
static const charwine_dbgstr_rect (const RECT *prc)
 

Variables

int g_atltest_executed = 0
 
int g_atltest_failed = 0
 
int g_atltest_skipped = 0
 
const charg_atltest_file = NULL
 
int g_atltest_line = 0
 
const charg_atltest_name
 

Macro Definition Documentation

◆ broken

#define broken (   x)    x

Definition at line 178 of file atltest.h.

◆ ok

#define ok (   value,
  ... 
)
Value:
do { \
atltest_set_location(__FILE__, __LINE__); \
atltest_ok(value, __VA_ARGS__); \
} while (0)
Definition: pdh_main.c:94

Definition at line 57 of file atltest.h.

◆ ok_

#define ok_ (   x1,
  x2 
)    atltest_set_location(x1,x2); atltest_ok

Definition at line 61 of file atltest.h.

◆ ok_char

#define ok_char (   expression,
  result 
)    ok_hex(expression, result)

Definition at line 122 of file atltest.h.

◆ ok_dec

#define ok_dec (   expression,
  result 
)
Value:
do { \
int _value = (expression); \
ok(_value == (result), "Wrong value for '%s', expected: " #result " (%d), got: %d\n", \
#expression, (int)(result), _value); \
} while (0)
GLuint64EXT * result
Definition: glext.h:11304

Definition at line 101 of file atltest.h.

◆ ok_err

#define ok_err (   error)     ok(GetLastError() == (error), "Wrong last error. Expected " #error ", got 0x%lx\n", GetLastError())

Definition at line 124 of file atltest.h.

◆ ok_hdl

#define ok_hdl   ok_ptr

Definition at line 136 of file atltest.h.

◆ ok_hex

#define ok_hex (   expression,
  result 
)
Value:
do { \
int _value = (expression); \
ok(_value == (result), "Wrong value for '%s', expected: " #result " (0x%x), got: 0x%x\n", \
#expression, (int)(result), _value); \
} while (0)

Definition at line 94 of file atltest.h.

◆ ok_int

#define ok_int (   expression,
  result 
)    ok_dec(expression, result)

Definition at line 134 of file atltest.h.

◆ ok_long

#define ok_long (   expression,
  result 
)    ok_hex(expression, result)

Definition at line 133 of file atltest.h.

◆ ok_ntstatus

#define ok_ntstatus (   status,
  expected 
)    ok_hex(status, expected)

Definition at line 135 of file atltest.h.

◆ ok_ptr

#define ok_ptr (   expression,
  result 
)
Value:
do { \
const void *_value = (expression); \
ok(_value == (result), "Wrong value for '%s', expected: " #result " (%p), got: %p\n", \
#expression, (void*)(result), _value); \
} while (0)

Definition at line 108 of file atltest.h.

◆ ok_size_t

#define ok_size_t (   expression,
  result 
)
Value:
do { \
size_t _value = (expression); \
ok(_value == (result), "Wrong value for '%s', expected: " #result " (%Ix), got: %Ix\n", \
#expression, (size_t)(result), _value); \
} while (0)

Definition at line 115 of file atltest.h.

◆ ok_str

#define ok_str (   x,
  y 
)     ok(strcmp(x, y) == 0, "Wrong string. Expected '%s', got '%s'\n", y, x)

Definition at line 127 of file atltest.h.

◆ ok_wstr

#define ok_wstr (   x,
  y 
)     ok(wcscmp(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x)

Definition at line 130 of file atltest.h.

◆ skip

#define skip (   ...)
Value:
do { \
atltest_set_location(__FILE__, __LINE__); \
atltest_skip(__VA_ARGS__); \
} while (0)

Definition at line 64 of file atltest.h.

◆ START_TEST

#define START_TEST (   x)
Value:
const char *g_atltest_name = #x; \
static void atltest_start_test(void)
static void atltest_start_test(void)
const char * g_atltest_name
GLint GLint GLint GLint GLint x
Definition: gl.h:1548

Definition at line 75 of file atltest.h.

◆ trace

#define trace   printf

Definition at line 70 of file atltest.h.

Function Documentation

◆ atltest_ok()

void atltest_ok ( int  value,
const char fmt,
  ... 
)

Definition at line 32 of file atltest.h.

33{
34 va_list va;
35 va_start(va, fmt);
36 if (!value)
37 {
39 vprintf(fmt, va);
41 }
43 va_end(va);
44}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
int g_atltest_executed
Definition: atltest.h:19
int g_atltest_failed
Definition: atltest.h:20
int g_atltest_line
Definition: atltest.h:24
const char * g_atltest_file
Definition: atltest.h:23
#define printf
Definition: freeldr.h:97
_Check_return_opt_ _CRTIMP int __cdecl vprintf(_In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
Definition: dsound.c:943

◆ atltest_set_location()

void atltest_set_location ( const char file,
int  line 
)

Definition at line 26 of file atltest.h.

27{
30}
Definition: fci.c:127
Definition: parser.c:49

◆ atltest_skip()

void atltest_skip ( const char fmt,
  ... 
)

Definition at line 46 of file atltest.h.

47{
48 va_list va;
49 va_start(va, fmt);
50 printf("%s (%d): test skipped: ", g_atltest_file, g_atltest_line);
51 vprintf(fmt, va);
53 va_end(va);
54}
int g_atltest_skipped
Definition: atltest.h:21

◆ atltest_start_test()

static void atltest_start_test ( void  )
static

Referenced by main().

◆ main()

int main ( void  )

Definition at line 79 of file atltest.h.

80{
82 printf("%s: %d tests executed (0 marked as todo, %d failures), %d skipped.\n",
84 return g_atltest_failed;
85}

◆ wine_dbgstr_point()

static const char * wine_dbgstr_point ( const POINT ppt)
inlinestatic

Definition at line 138 of file atltest.h.

139{
140 static char s_asz[4][40]; /* Ring buffer */
141 static int s_i = 0;
142 char *buf;
143
144 if (!ppt)
145 return "(null)";
146 if (IS_INTRESOURCE(ppt))
147 return "(invalid ptr)";
148
149 buf = s_asz[s_i];
150 s_i = (s_i + 1) % _countof(s_asz);
151 sprintf_s(buf, _countof(s_asz[0]), "(%ld, %ld)", ppt->x, ppt->y);
152 return buf;
153}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define _countof(array)
Definition: sndvol32.h:70
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define IS_INTRESOURCE(i)
Definition: winuser.h:580

Referenced by apply_pair_value(), d3d_device7_Load(), DATETIME_HitTest(), debuglvhittestinfo(), debugnmlistview(), GdipDrawImagePointsRect(), GPOS_apply_CursiveAttachment(), GPOS_apply_MarkToBase(), GPOS_apply_MarkToLigature(), GPOS_apply_MarkToMark(), LISTVIEW_DrawItem(), LISTVIEW_GetItemPosition(), LISTVIEW_GetOrigin(), LISTVIEW_HitTest(), LISTVIEW_LButtonDown(), LISTVIEW_SetItemPosition(), MONTHCAL_LButtonDown(), REBAR_NCHitTest(), surface_upload_from_surface(), swapchain_gdi_frontbuffer_updated(), SysMouseWImpl_Unacquire(), TOOLTIPS_RelayEvent(), TRACKBAR_AutoPage(), UI_ShowContextMenu(), UPDOWN_HandleMouseEvent(), wine_dbgstr_size(), and wined3d_surface_upload_data().

◆ wine_dbgstr_rect()

static const char * wine_dbgstr_rect ( const RECT prc)
inlinestatic

Definition at line 160 of file atltest.h.

161{
162 static char s_asz[4][80]; /* Ring buffer */
163 static int s_i = 0;
164 char *buf;
165
166 if (!prc)
167 return "(null)";
168 if (IS_INTRESOURCE(prc))
169 return "(invalid ptr)";
170
171 buf = s_asz[s_i];
172 s_i = (s_i + 1) % _countof(s_asz);
173 sprintf_s(buf, _countof(s_asz[0]), "(%ld, %ld) - (%ld, %ld)",
174 prc->left, prc->top, prc->right, prc->bottom);
175 return buf;
176}
_Out_ LPRECT prc
Definition: ntgdi.h:1658
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306

Referenced by ArrangeCtrlPositions(), CBCalcPlacement(), CFn_WMPaint(), check_update_rgn_(), clip_emf_enum_proc(), column_fill_hditem(), COMBOEX_ComboWndProc(), COMBOEX_Create(), compare_bounds(), CreateEnhMetaFileW(), d3d8_device_Present(), d3d8_surface_LockRect(), d3d8_swapchain_Present(), d3d8_texture_2d_AddDirtyRect(), d3d8_texture_cube_AddDirtyRect(), d3d9_device_PresentEx(), d3d9_device_StretchRect(), d3d9_surface_LockRect(), d3d9_swapchain_Present(), d3d9_texture_2d_AddDirtyRect(), d3d9_texture_cube_AddDirtyRect(), d3d_device1_Pick(), d3d_device7_Load(), d3dx9_sprite_Draw(), D3DXLoadSurfaceFromFileA(), D3DXLoadSurfaceFromFileInMemory(), D3DXLoadSurfaceFromFileW(), D3DXLoadSurfaceFromMemory(), D3DXLoadSurfaceFromResourceA(), D3DXLoadSurfaceFromResourceW(), D3DXLoadSurfaceFromSurface(), D3DXSaveSurfaceToFileA(), D3DXSaveSurfaceToFileInMemory(), D3DXSaveSurfaceToFileW(), ddraw_clipper_GetClipList(), ddraw_surface1_AddOverlayDirtyRect(), ddraw_surface1_Blt(), ddraw_surface1_BltFast(), ddraw_surface1_Lock(), ddraw_surface1_UpdateOverlay(), ddraw_surface2_AddOverlayDirtyRect(), ddraw_surface2_Blt(), ddraw_surface2_BltFast(), ddraw_surface2_Lock(), ddraw_surface2_UpdateOverlay(), ddraw_surface3_AddOverlayDirtyRect(), ddraw_surface3_Blt(), ddraw_surface3_BltFast(), ddraw_surface3_Lock(), ddraw_surface3_UpdateOverlay(), ddraw_surface4_AddOverlayDirtyRect(), ddraw_surface4_Blt(), ddraw_surface4_BltFast(), ddraw_surface4_Lock(), ddraw_surface4_UpdateOverlay(), ddraw_surface7_AddOverlayDirtyRect(), ddraw_surface7_Blt(), ddraw_surface7_BltFast(), ddraw_surface7_Lock(), ddraw_surface7_Unlock(), ddraw_surface7_UpdateOverlay(), DefaultHandler_DoVerb(), device_clear_render_targets(), device_parent_mode_changed(), dialog_adjust_dialog_pos(), DirectDrawMediaStreamImpl_IDirectDrawMediaStream_CreateSample(), DrawTextExWorker(), dump_region(), EMFDC_ExtTextOut(), EMFDRV_ExtTextOut(), EnumEnhMetaFile(), FileMenu_DrawItem(), FileMenu_GetItemExtent(), fullscreen_wnd_proc(), GdipDrawImagePointsRect(), GetThemeBackgroundContentRect(), GetThemeBackgroundExtent(), GetWinMetaFileBits(), ID3DXFontImpl_DrawTextA(), ID3DXFontImpl_DrawTextW(), iterator_frameditems(), iterator_frameditems_absolute(), LISTBOX_GetItemRect(), LISTBOX_PaintItem(), LISTVIEW_DrawItemPart(), LISTVIEW_FillBkgnd(), LISTVIEW_GetItemMetrics(), LISTVIEW_GetItemRect(), LISTVIEW_GetSubItemRect(), LISTVIEW_GetViewRect(), LISTVIEW_HitTest(), LISTVIEW_InvalidateRect(), LISTVIEW_RefreshOwnerDraw(), LISTVIEW_RefreshReportGrid(), LISTVIEW_ScrollOnInsert(), LISTVIEW_UpdateSize(), main_window_proc(), main_window_procA(), MCIAVI_mciPut(), MCIAVI_mciWhere(), MCIQTZ_mciWhere(), MCIWndProc(), mdi_child_wnd_proc_2(), MDI_ChildGetMinMaxInfo(), mdi_main_wnd_procA(), ME_DrawParagraph(), menu_ownerdraw_wnd_proc(), MONTHCAL_GetMinReqRect(), MONTHCAL_UpdateSize(), nccalchelper(), OleInPlaceObject_SetObjectRects(), OleObject_DoVerb(), OLEPictureImpl_Render(), PAGER_DrawButton(), PAGER_MouseMove(), PAGER_NCCalcSize(), pagesetup_change_preview(), parentdc_window_procA(), ParentMsgCheckProcA(), PlayEnhMetaFileRecord(), PROPSHEET_AdjustSize(), PROPSHEET_AdjustSizeWizard(), PROPSHEET_SetCurSel(), PROPSHEET_SizeMismatch(), REBAR_CalcHorzBand(), REBAR_CalcVertBand(), REBAR_Create(), REBAR_DumpBand(), REBAR_EraseBkGnd(), REBAR_GetRect(), REBAR_Layout(), REBAR_MoveChildWindows(), REBAR_NCCalcSize(), REBAR_NCCreate(), REBAR_NCPaint(), REBAR_Paint(), REBAR_SetBandsHeight(), REBAR_SizeToRect(), REBAR_WindowPosChanged(), resize_template_hook(), scissorrect(), ScriptStringOut(), ScriptTextOut(), SHAppBarMessage(), SPY_DumpStructure(), STATUSBAR_DrawPart(), STATUSBAR_DrawSizeGrip(), STATUSBAR_SetPartBounds(), surface_blt_fbo(), surface_blt_special(), surface_depth_blt_fbo(), surface_lock(), surface_upload_from_surface(), swapchain_blit(), TAB_AdjustRect(), TAB_DrawBorder(), TAB_DrawItem(), TAB_DrawItemInterior(), TAB_FocusChanging(), TAB_InsertItemT(), TAB_InternalGetItemRect(), TAB_InvalidateTabArea(), TAB_Paint(), TAB_SetItemBounds(), test_AWR_flags(), test_basics(), test_begin_paint(), test_boundsrect(), test_ChangeDisplaySettingsEx(), test_clipping(), test_clipping_2(), test_CreateWindow(), test_CRect(), test_dc_layout(), test_dc_visrgn(), test_desktop_winproc(), test_device_caps(), test_dpi_mapping(), test_DrawTextCalcRect(), test_edit_control_5(), test_emf_clipping(), test_format_rect(), test_fullscreen(), test_getmenubarinfo(), test_GetRandomRgn(), test_GetScrollBarInfo(), test_GetUpdateRect(), test_hwnd_message(), test_initialization(), test_Input_mouse(), test_IsRectEmpty(), test_layered_window(), test_margin(), test_margins_default(), test_margins_usefontinfo(), test_mbs_help(), test_memory_dc_clipping(), test_mouse_input(), test_nccalcscroll(), test_nonclient_area(), test_ownerdraw(), test_pager(), test_parent_wndproc(), test_redraw(), test_rtl_layout(), test_savedc_2(), test_scroll_window(), test_scrolldc(), test_scrollvalidate(), test_SetParent(), test_SetWindowPos(), test_showwindow(), test_ShowWindow(), test_SubtractRect(), test_tic_settings(), test_validatergn(), test_vis_rgn(), test_window_dc_clipping(), test_winregion(), test_work_area(), texture_resource_sub_resource_map(), TOOLBAR_DrawFlatHorizontalSeparator(), TOOLBAR_DrawString(), TOOLBAR_DumpButton(), TOOLBAR_GetIdealSize(), TOOLBAR_Paint(), TOOLBAR_Size(), TOOLTIPS_NewToolRectT(), TRACKBAR_CalcSelection(), TREEVIEW_DrawItem(), TREEVIEW_GetItemRect(), update_plugin_window(), verify_region(), VideoRenderer_AutoShowWindow(), VideoRenderer_SendSampleData(), VMR7WindowlessControl_SetVideoPosition(), VMR9_ImagePresenter_PresentImage(), VMR9_SendSampleData(), VMR9WindowlessControl_SetVideoPosition(), warp_check(), wined3d_device_clear_rendertarget_view(), wined3d_device_get_scissor_rect(), wined3d_device_set_scissor_rect(), wined3d_surface_blt(), wined3d_surface_upload_data(), wined3d_swapchain_get_front_buffer_data(), wined3d_swapchain_present(), wined3d_texture_blt(), wined3d_texture_update_overlay(), and winsizes_wnd_proc().

◆ wine_dbgstr_size()

static const char * wine_dbgstr_size ( const SIZE psize)
inlinestatic

Definition at line 155 of file atltest.h.

156{
157 return wine_dbgstr_point((const POINT *)psize);
158}
static const char * wine_dbgstr_point(const POINT *ppt)
Definition: atltest.h:138
_Must_inspect_result_ _Out_ LPSIZE psize
Definition: ntgdi.h:1569

Referenced by test_CSize().

◆ wine_dbgstr_w()

char * wine_dbgstr_w ( const wchar_t wstr)

Definition at line 87 of file atltest.h.

88{
89 static char buf[512];
91 return buf;
92}
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111

Variable Documentation

◆ g_atltest_executed

int g_atltest_executed = 0

Definition at line 19 of file atltest.h.

Referenced by atltest_ok(), and main().

◆ g_atltest_failed

int g_atltest_failed = 0

Definition at line 20 of file atltest.h.

Referenced by atltest_ok(), and main().

◆ g_atltest_file

const char* g_atltest_file = NULL

Definition at line 23 of file atltest.h.

Referenced by atltest_ok(), atltest_set_location(), and atltest_skip().

◆ g_atltest_line

int g_atltest_line = 0

Definition at line 24 of file atltest.h.

Referenced by atltest_ok(), atltest_set_location(), and atltest_skip().

◆ g_atltest_name

const char* g_atltest_name
extern

Referenced by main().

◆ g_atltest_skipped

int g_atltest_skipped = 0

Definition at line 21 of file atltest.h.

Referenced by atltest_skip(), and main().