Commit 478b8027 authored by Kenneth Moreland's avatar Kenneth Moreland

Update the tests to use the new header file names and var types.

parent 1a374349
......@@ -15,7 +15,9 @@ Revision 2.0: A major restructuring of the IceT code comprising the
following changes:
* Remove the dependence of OpenGL from the core library. Segregate
all OpenGL references and linkages to its own library.
all OpenGL references and linkages to its own library.
* Use the Glut library for OpenGL window creation in the tests.
Revision 1.0: Basically the same as 0.5.4, which has been stable for years
now, with the addition of offical documentation.
......
......@@ -9,7 +9,7 @@
** Tests to make sure blank tiles are correctly handled.
*****************************************************************************/
#include <GL/ice-t.h>
#include <IceTGL.h>
#include "test-util.h"
#include "test_codes.h"
......@@ -33,9 +33,9 @@ static void draw(void)
static int BlankTilesRun()
{
int i, j, x, y;
GLubyte *cb;
IceTUByte *cb;
int result = TEST_PASSED;
GLint rank, num_proc;
IceTInt rank, num_proc;
icetGetIntegerv(ICET_RANK, &rank);
icetGetIntegerv(ICET_NUM_PROCESSES, &num_proc);
......
......@@ -10,7 +10,7 @@
** the viewing frustum to behind the viewpoint in perspective mode.
*****************************************************************************/
#include <GL/ice-t.h>
#include <IceTGL.h>
#include "test-util.h"
#include "test_codes.h"
......@@ -44,7 +44,7 @@ static int BoundsBehindViewerRun()
{
float mat[16];
GLint rank;
IceTInt rank;
icetGetIntegerv(ICET_RANK, &rank);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
......@@ -91,7 +91,7 @@ static int BoundsBehindViewerRun()
/* Test the resulting image to make sure the polygon was drawn over it. */
if (rank == 0) {
GLuint *cb = (GLuint *)icetGetColorBuffer();
IceTUInt *cb = (IceTUInt *)icetGetColorBuffer();
if (cb[0] != 0xFFFFFFFF) {
printf("First pixel in color buffer wrong: 0x%x\n", cb[0]);
return TEST_FAILED;
......
......@@ -10,7 +10,7 @@
** exceeds the advertised maximum buffer size.
*****************************************************************************/
#include <GL/ice-t.h>
#include <IceTGL.h>
#include "test_codes.h"
#include "test-util.h"
......@@ -45,14 +45,14 @@ static int DoCompressionTest(int num_buffers)
GLint viewport[4];
int pixels;
IceTImage imagebuffer;
GLubyte *colorbuffer;
GLuint *depthbuffer;
IceTUByte *colorbuffer;
IceTUInt *depthbuffer;
IceTSparseImage compressedbuffer;
GLint fardepth;
IceTInt fardepth;
int i;
GLuint size;
IceTUInt size;
int result;
GLint tmp;
IceTInt tmp;
result = TEST_PASSED;
......@@ -93,7 +93,7 @@ static int DoCompressionTest(int num_buffers)
printf("Expected size: %d. Actual size: %d\n",
(int)icetSparseImageSize(pixels), (int)size);
if ( (size > icetSparseImageSize(pixels))
|| (size < (GLuint)(2+2*num_buffers)*pixels) ) {
|| (size < (IceTUInt)(2+2*num_buffers)*pixels) ) {
printf("Size differs from expected size!\n");
result = TEST_FAILED;
}
......@@ -115,7 +115,7 @@ static int DoCompressionTest(int num_buffers)
printf("Expected size: %d. Actual size: %d\n",
(int)icetSparseImageSize(pixels), (int)size);
if ( (size > icetSparseImageSize(pixels))
|| (size < (GLuint)4*num_buffers*pixels) ) {
|| (size < (IceTUInt)4*num_buffers*pixels) ) {
printf("Size differs from expected size!\n");
result = TEST_FAILED;
}
......@@ -148,7 +148,7 @@ static int DoCompressionTest(int num_buffers)
printf("Expected size: %d. Actual size: %d\n",
(int)icetSparseImageSize(pixels), (int)size);
if ( (size > icetSparseImageSize(pixels))
|| (size < (GLuint)4*num_buffers*pixels) ) {
|| (size < (IceTUInt)4*num_buffers*pixels) ) {
printf("Size differs from expected size!\n");
result = TEST_FAILED;
}
......
......@@ -15,7 +15,7 @@
** processors. This should flag some problems with assumed far depths.
*****************************************************************************/
#include <GL/ice-t.h>
#include <IceTGL.h>
#include "test_codes.h"
#include "test-util.h"
......@@ -44,7 +44,7 @@ static DisplayNoDrawRun()
{
int result = TEST_PASSED;
int i;
GLint rank, num_proc;
IceTInt rank, num_proc;
icetGetIntegerv(ICET_RANK, &rank);
icetGetIntegerv(ICET_NUM_PROCESSES, &num_proc);
......@@ -76,7 +76,7 @@ static DisplayNoDrawRun()
glColor4f(1.0, 1.0, 1.0, 1.0);
for (i = 0; i < STRATEGY_LIST_SIZE; i++) {
GLubyte *color_buffer;
IceTUByte *color_buffer;
icetStrategy(strategy_list[i]);
printf("\n\nUsing %s strategy.\n", icetGetStrategyName());
......
......@@ -10,7 +10,7 @@
** Makes sure that all compositions are equivalent.
*****************************************************************************/
#include <GL/ice-t.h>
#include <IceTGL.h>
#include <context.h>
#include "test_codes.h"
#include "test-util.h"
......@@ -39,13 +39,13 @@ static void draw(void)
#define DIFF(x, y) ((x) < (y) ? (y) - (x) : (x) - (y))
static int compare_color_buffers(int local_width, int local_height,
GLubyte *refcbuf, int rank)
IceTUByte *refcbuf, int rank)
{
int ref_off_x, ref_off_y;
int bad_pixel_count;
int x, y;
char filename[FILENAME_MAX];
GLubyte *cb;
IceTUByte *cb;
printf("Checking returned image.\n");
cb = icetGetColorBuffer();
......@@ -138,13 +138,13 @@ static int compare_color_buffers(int local_width, int local_height,
}
static int compare_depth_buffers(int local_width, int local_height,
GLuint *refdbuf, int rank)
IceTUInt *refdbuf, int rank)
{
int ref_off_x, ref_off_y;
int bad_pixel_count;
int x, y;
char filename[FILENAME_MAX];
GLuint *db;
IceTUInt *db;
printf("Checking returned image.\n");
db = icetGetDepthBuffer();
......@@ -178,10 +178,10 @@ static int compare_depth_buffers(int local_width, int local_height,
/* Write encoded image. */
for (y = 0; y < local_height; y++) {
for (x = 0; x < local_width; x++) {
GLuint ref = refdbuf[(y+ref_off_y)*SCREEN_WIDTH
+x + ref_off_x];
GLuint rendered = db[y*local_width + x];
GLubyte *encoded = (GLubyte *)&db[y*local_width+x];
IceTUInt ref = refdbuf[(y+ref_off_y)*SCREEN_WIDTH
+x + ref_off_x];
IceTUInt rendered = db[y*local_width + x];
IceTUByte *encoded = (IceTUByte *)&db[y*local_width+x];
long error = ref - rendered;
if (error < 0) error = -error;
encoded[0] = (error & 0xFF000000) >> 24;
......@@ -190,7 +190,7 @@ static int compare_depth_buffers(int local_width, int local_height,
}
}
sprintf(filename, "depth_error%03d.ppm", rank);
write_ppm(filename, (GLubyte*)db,
write_ppm(filename, (IceTUByte *)db,
local_width, local_height);
return 0;
......@@ -228,19 +228,19 @@ static void check_results(int result)
static int RandomTransformRun()
{
int i, x, y;
GLubyte *cb;
GLubyte *refcbuf = NULL;
GLubyte *refcbuf2 = NULL;
GLuint *db;
GLuint *refdbuf = NULL;
IceTUByte *cb;
IceTUByte *refcbuf = NULL;
IceTUByte *refcbuf2 = NULL;
IceTUInt *db;
IceTUInt *refdbuf = NULL;
int result = TEST_PASSED;
GLfloat mat[16];
IceTFloat mat[16];
int rank, num_proc;
GLint *image_order;
GLint rep_group_size;
GLint *rep_group;
GLfloat color[3];
GLfloat background_color[3];
IceTInt *image_order;
IceTInt rep_group_size;
IceTInt *rep_group;
IceTFloat color[3];
IceTFloat background_color[3];
unsigned int seed;
icetGetIntegerv(ICET_RANK, &rank);
......@@ -251,7 +251,7 @@ static int RandomTransformRun()
srand(seed);
/* Decide on an image order and data replication group size. */
image_order = malloc(num_proc * sizeof(GLint));
image_order = malloc(num_proc * sizeof(IceTInt));
if (rank == 0) {
for (i = 0; i < num_proc; i++) image_order[i] = i;
printf("Image order:\n");
......@@ -372,8 +372,8 @@ static int RandomTransformRun()
memcpy(refcbuf, cb, SCREEN_WIDTH * SCREEN_HEIGHT * 4);
db = icetGetDepthBuffer();
refdbuf = malloc(SCREEN_WIDTH * SCREEN_HEIGHT * sizeof(GLuint));
memcpy(refdbuf, db, SCREEN_WIDTH * SCREEN_HEIGHT * sizeof(GLuint));
refdbuf = malloc(SCREEN_WIDTH * SCREEN_HEIGHT * sizeof(IceTUInt));
memcpy(refdbuf, db, SCREEN_WIDTH * SCREEN_HEIGHT * sizeof(IceTUInt));
printf("Getting base image for color blend.\n");
icetInputOutputBuffers(ICET_COLOR_BUFFER_BIT, ICET_COLOR_BUFFER_BIT);
......@@ -389,7 +389,7 @@ static int RandomTransformRun()
glViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
for (i = 0; i < STRATEGY_LIST_SIZE; i++) {
GLboolean test_ordering;
IceTBoolean test_ordering;
icetStrategy(strategy_list[i]);
printf("\n\nUsing %s strategy.\n", icetGetStrategyName());
......
......@@ -10,7 +10,7 @@
** rendering.
*****************************************************************************/
#include <GL/ice-t.h>
#include <IceTGL.h>
#include "test-util.h"
#include "test_codes.h"
......@@ -25,8 +25,8 @@
#include <stdlib.h>
#include <stdio.h>
GLint rank;
GLint num_proc;
IceTInt rank;
IceTInt num_proc;
static void draw(void)
{
......
......@@ -12,7 +12,7 @@
#define _MPI_COMM_H_
#include "test-util.h"
#include <GL/ice-t_mpi.h>
#include <IceTMPI.h>
void init_mpi_comm(int *argcp, char ***argvp)
{
......
......@@ -13,14 +13,17 @@
#include <stdlib.h>
#include <stdio.h>
// TODO: Delete this line once ICET_COLOR_FORMAT no longer relies on OpenGL
#include <IceTGL.h>
void write_ppm(const char *filename,
const GLubyte *image,
const IceTUByte *image,
int width, int height)
{
FILE *fd;
int x, y;
const unsigned char *color;
GLint color_format;
IceTInt color_format;
icetGetIntegerv(ICET_COLOR_FORMAT, &color_format);
......
......@@ -18,7 +18,7 @@ extern "C" {
}
#endif
#include <GL/ice-t.h>
#include <IceT.h>
extern IceTStrategy strategy_list[];
extern int STRATEGY_LIST_SIZE;
......@@ -35,7 +35,7 @@ void swap_buffers(void);
void finalize_test(int result);
void write_ppm(const char *filename,
const GLubyte *image,
const IceTUByte *image,
int width, int height);
#ifdef __cplusplus
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment