Refactored C Tests

The C client tests were getting a bit unwieldy. Moved each block of tests to a separate file based on the functionality being tested. I've just put all of the test code directly in the headers because there doesn't seem to be any reason for the test headers to be included anywhere except in main.c.
This commit is contained in:
Jason Watkins
2015-05-07 10:04:29 -07:00
parent f2e64a30f2
commit ec759cbbff
13 changed files with 940 additions and 1040 deletions

View File

@@ -0,0 +1,25 @@
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
//National Aeronautics and Space Administration. All Rights Reserved.
#ifndef TESTRUNNER_H
#define TESTRUNNER_H
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <math.h>
#define feq(x, y) (fabs(x - y) < 1e-4)
#define IP "127.0.0.1"
extern int testFailed;
extern int testPassed;
void runTest(int(*test)(), char* name);
int compareFloat(float expected, float actual);
int compareArray(float expected[], float actual[], int size);
int compareArrays(float* expected[], int esizes[], float* actual[], int asizes[], int count);
#endif