Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
1c6843f4
Kaydet (Commit)
1c6843f4
authored
Kas 28, 2014
tarafından
Michael Meeks
Kaydeden (comit)
Markus Mohrhard
Ara 02, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcl: initial outdev unit test - for VirtualDevices.
Change-Id: Ia2bb1f8110c738cfbf6ff84293af115b32abeb93
üst
d6b51a87
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
120 additions
and
0 deletions
+120
-0
CppunitTest_vcl_outdev.mk
vcl/CppunitTest_vcl_outdev.mk
+52
-0
Module_vcl.mk
vcl/Module_vcl.mk
+1
-0
outdev.cxx
vcl/qa/cppunit/outdev.cxx
+67
-0
No files found.
vcl/CppunitTest_vcl_outdev.mk
0 → 100644
Dosyayı görüntüle @
1c6843f4
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_CppunitTest_CppunitTest,vcl_outdev))
$(eval $(call gb_CppunitTest_set_include,vcl_outdev,\
$$(INCLUDE) \
-I$(SRCDIR)/vcl/inc \
))
$(eval $(call gb_CppunitTest_add_exception_objects,vcl_outdev, \
vcl/qa/cppunit/outdev \
))
$(eval $(call gb_CppunitTest_use_externals,vcl_outdev,boost_headers))
$(eval $(call gb_CppunitTest_use_libraries,vcl_outdev, \
comphelper \
cppu \
cppuhelper \
sal \
svt \
test \
tl \
unotest \
vcl \
$(gb_UWINAPI) \
))
$(eval $(call gb_CppunitTest_use_api,vcl_outdev,\
udkapi \
offapi \
))
$(eval $(call gb_CppunitTest_use_ure,vcl_outdev))
$(eval $(call gb_CppunitTest_use_vcl,vcl_outdev))
$(eval $(call gb_CppunitTest_use_components,vcl_outdev,\
configmgr/source/configmgr \
i18npool/util/i18npool \
ucb/source/core/ucb1 \
))
$(eval $(call gb_CppunitTest_use_configuration,vcl_outdev))
# vim: set noet sw=4 ts=4:
vcl/Module_vcl.mk
Dosyayı görüntüle @
1c6843f4
...
...
@@ -101,6 +101,7 @@ $(eval $(call gb_Module_add_check_targets,vcl,\
CppunitTest_vcl_fontcharmap \
CppunitTest_vcl_complextext \
CppunitTest_vcl_filters_test \
CppunitTest_vcl_outdev \
CppunitTest_vcl_app_test \
CppunitTest_vcl_wmf_test \
))
...
...
vcl/qa/cppunit/outdev.cxx
0 → 100644
Dosyayı görüntüle @
1c6843f4
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <unotest/filters-test.hxx>
#include <test/bootstrapfixture.hxx>
#include <vcl/virdev.hxx>
#include <vcl/salbtype.hxx>
#include <vcl/bmpacc.hxx>
#include <vcl/wrkwin.hxx>
class
VclOutdevTest
:
public
test
::
BootstrapFixture
{
public
:
VclOutdevTest
()
:
BootstrapFixture
(
true
,
false
)
{}
void
testVirtualDevice
();
CPPUNIT_TEST_SUITE
(
VclOutdevTest
);
CPPUNIT_TEST
(
testVirtualDevice
);
CPPUNIT_TEST_SUITE_END
();
};
void
VclOutdevTest
::
testVirtualDevice
()
{
VirtualDevice
aVDev
;
aVDev
.
SetOutputSizePixel
(
Size
(
32
,
32
));
aVDev
.
SetBackground
(
Wallpaper
(
COL_WHITE
));
aVDev
.
Erase
();
aVDev
.
DrawPixel
(
Point
(
1
,
2
),
COL_GREEN
);
aVDev
.
DrawPixel
(
Point
(
31
,
30
),
COL_RED
);
CPPUNIT_ASSERT
(
aVDev
.
GetPixel
(
Point
(
0
,
0
))
==
COL_WHITE
);
CPPUNIT_ASSERT
(
aVDev
.
GetPixel
(
Point
(
1
,
2
))
==
COL_GREEN
);
CPPUNIT_ASSERT
(
aVDev
.
GetPixel
(
Point
(
31
,
30
))
==
COL_RED
);
CPPUNIT_ASSERT
(
aVDev
.
GetPixel
(
Point
(
30
,
31
))
==
COL_WHITE
);
Size
aSize
=
aVDev
.
GetOutputSizePixel
();
CPPUNIT_ASSERT
(
aSize
==
Size
(
32
,
32
));
Bitmap
aBmp
=
aVDev
.
GetBitmap
(
Point
(),
aSize
);
Bitmap
::
ScopedReadAccess
pAcc
(
aBmp
);
// Gotcha: y and x swap for BitmapReadAccess: deep joy.
CPPUNIT_ASSERT
(
pAcc
->
GetPixel
(
0
,
0
)
==
Color
(
COL_WHITE
));
CPPUNIT_ASSERT
(
pAcc
->
GetPixel
(
2
,
1
)
==
Color
(
COL_GREEN
));
CPPUNIT_ASSERT
(
pAcc
->
GetPixel
(
30
,
31
)
==
Color
(
COL_RED
));
CPPUNIT_ASSERT
(
pAcc
->
GetPixel
(
31
,
30
)
==
Color
(
COL_WHITE
));
#if 0
vcl::Window* pWin = new WorkWindow( (vcl::Window *)NULL );
CPPUNIT_ASSERT( pWin != NULL );
OutputDevice *pOutDev = static_cast< OutputDevice * >( pWin );
#endif
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
VclOutdevTest
);
CPPUNIT_PLUGIN_IMPLEMENT
();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment