#include<cstdio>
#include<cstdlib>
#include<cassert>
#include "matrix.h"

int main()
{
	// First example
	int nz=3;
	int nx=3; 
	int ny=3;
	
	int*** matrix = build_matrix(nx, ny, nz);
	
	assert(matrix[0][0][0] == 111 && "matrix[0][0][0] must be 111 after assignment");
	assert(matrix[2][2][2] == 333 && "matrix[2][2][2] must be 333 after assignment");
	
	print_matrix(matrix, nx, ny, nz);
	
	free_matrix(matrix, ny, nz);
	
	nz=3;
	nx=1;
	ny=2;
	
	// Second example
	matrix = build_matrix(nx, ny, nz);
	
	assert(matrix[0][0][0] == 111 && "matrix[0][0][0] must be 111 after assignment");
	assert(matrix[2][1][0] == 321 && "matrix[2][1][0] must be 321 after assignment");
	
	print_matrix(matrix, nx, ny, nz);
	
	free_matrix(matrix, ny, nz);
}
