/*
 * File:   mat_cell_test.c
 * Author: elenar
 *
 * Created on 31.12.2010, 0:14:44
 */

#include <stdio.h>
#include <stdlib.h>
#include "cell.h"
#include "cell_mat_wrapper.h"

/*
 * Simple C Test Suite
 */

void test1()
{
  printf("mat_cell_test test 1\n");

  element * main_cell_el = cell_mat_load_file("/home/elenar/Dokumenty/Diplomka_zpracovani_reci/c/data/var.mat", "d");

  element * e;
  cell * c, * c01, * c10;
  matrix * m00, * m01, * m1001;
  char * s1000, * s11;

  c = element_get_cell(main_cell_el);
  e = cell_get(c, 0, 0);
  m00 = element_get_matrix(e);
  puts("d{1,1}");
  matrix_print(m00);
  c01 = element_get_cell(cell_get(c, 0, 1));
  m01 = element_get_matrix(cell_get(c01, 0, 0));
  puts("d{1,2}");
  matrix_print(m01);
  c10 = element_get_cell(cell_get(c, 1, 0));
  s1000 = element_get_string(cell_get(c10, 0, 0));
  m1001 = element_get_matrix(cell_get(c10, 0, 1));
  puts("d{1,2}{1,1}");
  printf("%s\n", s1000);
  puts("d{1,2}{1,2}");
  matrix_print(m1001);

}

//void test2()
//{
  //printf("mat_cell_test test 2\n");
  //printf("%%TEST_FAILED%% time=0 testname=test2 (mat_cell_test) message=error message sample\n");
//}

int main(int argc, char** argv)
{
  printf("%%SUITE_STARTING%% mat_cell_test\n");
  printf("%%SUITE_STARTED%%\n");

  printf("%%TEST_STARTED%% test1 (mat_cell_test)\n");
  test1();
  printf("%%TEST_FINISHED%% time=0 test1 (mat_cell_test) \n");

  
  //printf("%%TEST_STARTED%% test2 (mat_cell_test)\n");
  //test2();
  //printf("%%TEST_FINISHED%% time=0 test2 (mat_cell_test) \n");

  //printf("%%SUITE_FINISHED%% time=0\n");
  
  return (EXIT_SUCCESS);
}
