Add a new test checking wxGraphicsContext implementation correctness.
This test verifies that the output of wxGraphicsContext on the current system matches the pregenerated reference output. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
49
tests/drawing/basictest.cpp
Normal file
49
tests/drawing/basictest.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: tests/drawing/basictest.cpp
|
||||
// Purpose: Basic tests for wxGraphicsContext
|
||||
// Author: Armel Asselin
|
||||
// Created: 2014-02-28
|
||||
// Copyright: (c) 2014 Ellié Computing <opensource@elliecomputing.com>
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "testprec.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/app.h"
|
||||
#include "wx/font.h"
|
||||
#include "wx/window.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#define _WX_CURSOR_H_BASE_
|
||||
|
||||
|
||||
#include "drawing.h"
|
||||
|
||||
#if wxUSE_TEST_GC_DRAWING
|
||||
|
||||
const GraphicsContextDrawingTestCase::DrawingTestCase
|
||||
GraphicsContextDrawingTestCase::ms_drawingBasicTc = {
|
||||
1, &GraphicsContextDrawingTestCase::DoBasicDrawings, 800, 600, 72., true
|
||||
};
|
||||
|
||||
void GraphicsContextDrawingTestCase::DoBasicDrawings (wxGraphicsContext *gc)
|
||||
{
|
||||
// this test is expected to be portable, on any platform, in order to keep
|
||||
// that property, it should contain only axis aligned/integer drawings so
|
||||
// that the anti-aliasing method does not cause troubles.
|
||||
|
||||
wxGraphicsBrush gbBackground =
|
||||
gc->CreateBrush (wxBrush (wxColour (255, 255, 255)));
|
||||
|
||||
gc->SetBrush (gbBackground);
|
||||
gc->DrawRectangle (0, 0, 800, 600);
|
||||
}
|
||||
|
||||
#endif // wxUSE_TEST_GC_DRAWING
|
Reference in New Issue
Block a user