IN101 project on Conway's Game of Life
Functions | Variables
test-naive-conway.c File Reference

Test executable source code for a naive implementation of Conway's game of life universe simulator. More...

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include "naive_universe.h"
#include "naive_loader.h"
#include "naive_conway.h"
Include dependency graph for test-naive-conway.c:

Functions

void test_count_neighbors ()
 Test of the naive_count_neighbors function. More...
 
void test_naive_step ()
 Test of the naive_step function. More...
 
void test_naive_simulation ()
 Test of the naive_simulation function. More...
 
int main (void)
 

Variables

universe u
 
char * GLIDER_10STEPS = "................................................................o.................o.o..................oo..........................................................................................................................................................................................................................................................................................................................."
 

Detailed Description

Test executable source code for a naive implementation of Conway's game of life universe simulator.

Author
Victor Colomb
Date
2021-03-01

Contains the following tests:

Function Documentation

◆ test_count_neighbors()

void test_count_neighbors ( )

Test of the naive_count_neighbors function.

This tests uses the data/glider.txt source file and checks 4 neighbors counts, including two with edge positions.

◆ test_naive_simulation()

void test_naive_simulation ( )

Test of the naive_simulation function.

This test uses the data/glider.txt source files, launches a 10 step simulation and compares the result with the exact solution given by the GLIDER_10STEPS constant.

◆ test_naive_step()

void test_naive_step ( )

Test of the naive_step function.

This test uses the data/archive-test directory that contains 512 source files and their next step solution.
It will load each universe from each file, use the naive_step function and compare the return's cell table with the given exact solution.