graphics/bitmap: Fix tests
This commit is contained in:
parent
4bc54a25db
commit
7c782be036
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=502838
@ -22,9 +22,12 @@ PLIST_FILES= include/bitmap_image.hpp
|
||||
do-install:
|
||||
${INSTALL_DATA} ${WRKSRC}/bitmap_image.hpp ${STAGEDIR}${PREFIX}/include
|
||||
|
||||
do-test: # tests failure reported to the author: Error - Failed to open 'image.bmp'
|
||||
do-test:
|
||||
@cd ${WRKSRC} && \
|
||||
${SETENV} ${MAKE_ENV} ${MAKE_CMD} bitmap_test && \
|
||||
./bitmap_test
|
||||
${CXX} ${CXXFLAGS} -o mk-image ${FILESDIR}/mk-image.cpp -I. && \
|
||||
./mk-image && \
|
||||
./bitmap_test && \
|
||||
${ECHO} "Tests succeeded"
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
21
graphics/bitmap/files/mk-image.cpp
Normal file
21
graphics/bitmap/files/mk-image.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include "bitmap_image.hpp"
|
||||
|
||||
// creates the BMP image image.bmp that tests expect
|
||||
|
||||
int main()
|
||||
{
|
||||
bitmap_image base(1024, 800);
|
||||
base.clear();
|
||||
|
||||
const double c1 = 0.8;
|
||||
const double c2 = 0.4;
|
||||
const double c3 = 0.2;
|
||||
const double c4 = 0.6;
|
||||
|
||||
::srand(0xA5AA57A0);
|
||||
plasma(base, 0, 0, base.width(), base.height(), c1, c2, c3, c4, 3.0, jet_colormap);
|
||||
|
||||
base.save_image("image.bmp");
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user