Exemplo n.º 1
0
static void test_width(void)
{
    trace ("Testing with default MinWidth\n");
    test_tab(-1);
    trace ("Testing with MinWidth set to -3\n");
    test_tab(-3);
    trace ("Testing with MinWidth set to 24\n");
    test_tab(24);
    trace ("Testing with MinWidth set to 54\n");
    test_tab(54);
    trace ("Testing with MinWidth set to 94\n");
    test_tab(94);
}
Exemplo n.º 2
0
int			get_sphere(t_obj *obj, char *line)
{
	char		**tab;
	t_sphere	*sphere;

	if ((tab = ft_strsplit(line, ' ')) == NULL)
	{
		ft_printf("%rAllocation Fail: ");
		return (-1);
	}
	if (get_size_tab(tab) != 21)
	{
		ft_printf("%rThis line has no 21 param: ");
		return (-1);
	}
	if (!test_tab(tab, 20))
		return (-1);
	if ((sphere = (t_sphere *)malloc(sizeof(t_sphere))) == NULL)
		ft_printf("%rAllocation fail: ");
	set_sphere(sphere, tab);
	sphere->color = get_color(tab[20]);
	if (sphere->color == NULL)
		return (-1);
	calc_matrix((void *)sphere, SPHERE);
	ft_lstadd(&(obj->sphere), ft_lstnew(sphere, sizeof(t_sphere)));
	return (0);
}
Exemplo n.º 3
0
int			get_spot(t_obj *obj, char *line)
{
	char		**tab;
	t_spot		*spot;

	if ((tab = ft_strsplit(line, ' ')) == NULL)
	{
		ft_printf("%rAllocation Fail ");
		return (-1);
	}
	if (get_size_tab(tab) != 5)
	{
		ft_printf("%rThis line has no five param\n");
		return (-1);
	}
	if (!test_tab(tab, 4))
		return (-1);
	if ((spot = (t_spot *)malloc(sizeof(t_spot))) == NULL)
	{
		ft_printf("%rAllocation Fail ");
		return (-1);
	}
	if (fill_spot(spot, tab))
		return (-1);
	ft_lstadd(&(obj->spot), ft_lstnew(spot, sizeof(t_spot)));
	free(tab);
	return (0);
}
Exemplo n.º 4
0
void main(int a) {
  test_ull ();
  test_struct () ;
  test_struct_ptr () ;
  test_tab (13) ;
  test_float_double ();

  int b = init(5);  // TODO: init(5); b = 0;
  z = add3 (a, 0, 0);

  int *p = test_ptr (y);
  //@ assert *p == 7 ;
  int *q = a?p:&y;
  int yy = *q;
  //@ assert a==0 ==> q==&y ;
  //@ assert *q == 7 ;

}