Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 May 2019 23:02:20 +0000 (UTC)
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r502838 - in head/graphics/bitmap: . files
Message-ID:  <201905272302.x4RN2KW0081716@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <bsd.port.mk>

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;
+}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905272302.x4RN2KW0081716>