1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
#ifdef WIN32
#ifndef __cplusplus
#error Please compile with a C++ compiler.
#endif
#endif
#if defined(USE_WINDOWS_GDIPLUS)
#include <Windows.h>
#include <GdiPlus.h>
#pragma comment(lib, "gdiplus.lib")
#else
#include <GdiPlusFlat.h>
#endif
#if defined(USE_WINDOWS_GDIPLUS)
using namespace Gdiplus;
using namespace DllExports;
#endif
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "testhelpers.h"
static void test_getBrushType ()
{
GpStatus status;
GpSolidFill *brush;
GpBrushType brushType;
GdipCreateSolidFill (1, &brush);
// Negative tests.
status = GdipGetBrushType (NULL, &brushType);
assertEqualInt (status, InvalidParameter);
status = GdipGetBrushType ((GpBrush *) brush, NULL);
assertEqualInt (status, InvalidParameter);
GdipDeleteBrush ((GpBrush *) brush);
}
static void test_clone ()
{
GpStatus status;
GpSolidFill *brush;
GpBrush *clone;
GdipCreateSolidFill (1, &brush);
// Negative tests.
status = GdipCloneBrush (NULL, &clone);
assertEqualInt (status, InvalidParameter);
status = GdipCloneBrush ((GpBrush *) brush, NULL);
assertEqualInt (status, InvalidParameter);
GdipDeleteBrush ((GpBrush *) brush);
}
static void test_delete ()
{
GpStatus status;
GpSolidFill *brush;
GdipCreateSolidFill (1, &brush);
status = GdipDeleteBrush ((GpBrush *) brush);
assertEqualInt (status, Ok);
// Negative tests.
status = GdipDeleteBrush (NULL);
assertEqualInt (status, InvalidParameter);
}
int
main (int argc, char**argv)
{
STARTUP;
test_getBrushType ();
test_clone ();
test_delete ();
SHUTDOWN;
return 0;
}
|