From owner-svn-ports-all@freebsd.org Mon May 27 23:02:21 2019 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 499E815ADA8D; Mon, 27 May 2019 23:02:21 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF3A68ACE4; Mon, 27 May 2019 23:02:20 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BF5F9BC0; Mon, 27 May 2019 23:02:20 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4RN2KSo081718; Mon, 27 May 2019 23:02:20 GMT (envelope-from yuri@FreeBSD.org) Received: (from yuri@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4RN2KW0081716; Mon, 27 May 2019 23:02:20 GMT (envelope-from yuri@FreeBSD.org) Message-Id: <201905272302.x4RN2KW0081716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuri set sender to yuri@FreeBSD.org using -f From: Yuri Victorovich Date: Mon, 27 May 2019 23:02:20 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r502838 - in head/graphics/bitmap: . files X-SVN-Group: ports-head X-SVN-Commit-Author: yuri X-SVN-Commit-Paths: in head/graphics/bitmap: . files X-SVN-Commit-Revision: 502838 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF3A68ACE4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 23:02:21 -0000 Author: yuri Date: Mon May 27 23:02:19 2019 New Revision: 502838 URL: https://svnweb.freebsd.org/changeset/ports/502838 Log: graphics/bitmap: Fix tests Added: head/graphics/bitmap/files/ head/graphics/bitmap/files/mk-image.cpp (contents, props changed) Modified: head/graphics/bitmap/Makefile Modified: head/graphics/bitmap/Makefile ============================================================================== --- head/graphics/bitmap/Makefile Mon May 27 22:52:28 2019 (r502837) +++ head/graphics/bitmap/Makefile Mon May 27 23:02:19 2019 (r502838) @@ -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 Added: head/graphics/bitmap/files/mk-image.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/bitmap/files/mk-image.cpp Mon May 27 23:02:19 2019 (r502838) @@ -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; +}