#include <cstdio>
#include <armadillo>

#include <Buffer.hpp>
#include "TestBlock.hpp"

#ifndef LENGTH
#define LENGTH(a) (sizeof(a)/sizeof(a[0]))
#endif

int test01()
{
	arma::mat myMat;
//    myMat.as_col();

	Buffer<double> buffer(8);
	buffer.print("data 10: ");

	{
		double data[] = {1,2,3,4};
		buffer.write(data, LENGTH(data));
	}
	buffer.print("data 20: ");
	buffer.consume(4);

	{
		double data[] = {5,6,7,8,9,10,11,12};
		buffer.write(data, LENGTH(data));
	}
	buffer.print("data 30: ");

	buffer.consume(4);
	buffer.print("data 40: ");

	{
		double data[] = {11,12, 13, 14};
		buffer.write(data, LENGTH(data));
	}
	buffer.print("data 50: ");

	buffer.consume(4);
	buffer.print("data 60: ");

	buffer.consume(4);
	buffer.print("data 70: ");

	{
		double data[] = {1,2,3,4};
		buffer.write(data, LENGTH(data));
	}
	buffer.print("data: ");

	return 0;
}