summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/error.c2
-rw-r--r--tests/png.c3
-rw-r--r--tests/pngxx.cpp3
-rw-r--r--tests/raytrace.c2
-rw-r--r--tests/tests.c1
-rw-r--r--tests/tests.h1
-rw-r--r--tests/testsxx.cpp1
-rw-r--r--tests/testsxx.hpp1
-rw-r--r--tests/warning.c2
9 files changed, 16 insertions, 0 deletions
diff --git a/tests/error.c b/tests/error.c
index 7bd8ef6..fd9fc75 100644
--- a/tests/error.c
+++ b/tests/error.c
@@ -18,6 +18,8 @@
* <http://www.gnu.org/licenses/>. *
*************************************************************************/
+/* Make sure that errors terminate us - this test should fail */
+
#include "tests.h"
#include <stdlib.h>
diff --git a/tests/png.c b/tests/png.c
index b80af04..3d46f38 100644
--- a/tests/png.c
+++ b/tests/png.c
@@ -18,6 +18,8 @@
* <http://www.gnu.org/licenses/>. *
*************************************************************************/
+/* Test PNG file I/O */
+
#include "tests.h"
#include <stdlib.h>
#include <stdio.h>
@@ -36,6 +38,7 @@ main() {
unsigned int i, j;
const unsigned int x = 333, y = 300;
+ /* Set the resilience low for tests */
dmnsn_set_resilience(DMNSN_SEVERITY_LOW);
canvas = dmnsn_new_canvas(3*x, y);
diff --git a/tests/pngxx.cpp b/tests/pngxx.cpp
index 4a99370..c7cf0e0 100644
--- a/tests/pngxx.cpp
+++ b/tests/pngxx.cpp
@@ -18,12 +18,15 @@
* <http://www.gnu.org/licenses/>. *
*************************************************************************/
+// Test C++ PNG file I/O
+
#include "testsxx.hpp"
#include <fstream>
int
main()
{
+ // Set the resilience low for tests
Dimension::resilience(Dimension::SEVERITY_LOW);
const unsigned int width = 333, height = 300;
diff --git a/tests/raytrace.c b/tests/raytrace.c
index 7ea28da..83e6b2b 100644
--- a/tests/raytrace.c
+++ b/tests/raytrace.c
@@ -32,6 +32,7 @@ main() {
dmnsn_color color;
dmnsn_matrix trans;
+ /* Set the resilience low for tests */
dmnsn_set_resilience(DMNSN_SEVERITY_LOW);
scene = dmnsn_new_scene();
@@ -80,6 +81,7 @@ main() {
progress = dmnsn_png_write_canvas_async(scene->canvas, file);
progressbar("Writing PNG file: ", progress);
dmnsn_finish_progress(progress);
+ fclose(file);
dmnsn_delete_cube(cube);
dmnsn_delete_sphere(sphere);
diff --git a/tests/tests.c b/tests/tests.c
index 67e5ee1..b938d39 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -20,6 +20,7 @@
#include "tests.h"
+/* Print a progress bar of the progress of `progress' */
void
progressbar(const char *str, const dmnsn_progress *progress)
{
diff --git a/tests/tests.h b/tests/tests.h
index c6b0de6..49e814c 100644
--- a/tests/tests.h
+++ b/tests/tests.h
@@ -21,4 +21,5 @@
#include "../libdimension/dimension.h"
#include <stdio.h>
+/* Print a progress bar of the progress of `progress' */
void progressbar(const char *str, const dmnsn_progress *progress);
diff --git a/tests/testsxx.cpp b/tests/testsxx.cpp
index a4a7d7b..532b3dc 100644
--- a/tests/testsxx.cpp
+++ b/tests/testsxx.cpp
@@ -20,6 +20,7 @@
#include "testsxx.hpp"
+// Print a progress bar of the progress of `progress'
std::ostream&
operator<<(std::ostream& ostr, const Dimension::Progress& progress)
{
diff --git a/tests/testsxx.hpp b/tests/testsxx.hpp
index 43c7593..f7b0bc6 100644
--- a/tests/testsxx.hpp
+++ b/tests/testsxx.hpp
@@ -21,5 +21,6 @@
#include "../libdimensionxx/dimensionxx.hpp"
#include <iostream>
+// Print a progress bar of the progress of `progress'
std::ostream& operator<<(std::ostream& ostr,
const Dimension::Progress& progress);
diff --git a/tests/warning.c b/tests/warning.c
index 80199c9..b2170d4 100644
--- a/tests/warning.c
+++ b/tests/warning.c
@@ -18,6 +18,8 @@
* <http://www.gnu.org/licenses/>. *
*************************************************************************/
+// Make sure warnings don't kill us - this test should pass
+
#include "tests.h"
#include <stdlib.h>