From 3ee98f3bac24fd1c70a9de3e0fbe774e762c25b3 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 26 Jun 2009 15:31:34 +0000 Subject: Add lots of comments, and some code fixes discovered in the process. --- tests/error.c | 2 ++ tests/png.c | 3 +++ tests/pngxx.cpp | 3 +++ tests/raytrace.c | 2 ++ tests/tests.c | 1 + tests/tests.h | 1 + tests/testsxx.cpp | 1 + tests/testsxx.hpp | 1 + tests/warning.c | 2 ++ 9 files changed, 16 insertions(+) (limited to 'tests') 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 @@ * . * *************************************************************************/ +/* Make sure that errors terminate us - this test should fail */ + #include "tests.h" #include 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 @@ * . * *************************************************************************/ +/* Test PNG file I/O */ + #include "tests.h" #include #include @@ -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 @@ * . * *************************************************************************/ +// Test C++ PNG file I/O + #include "testsxx.hpp" #include 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 +/* 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 +// 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 @@ * . * *************************************************************************/ +// Make sure warnings don't kill us - this test should pass + #include "tests.h" #include -- cgit v1.2.3