function gray_code_check_test ( )

%*****************************************************************************80
%
%% gray_code_check_test() tests gray_code_check().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 November 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'gray_code_check test():\n' );
  fprintf ( 1, '  gray_code_check() checks N and T(1:N).\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Check?   N    T(1:N)\n' );
  fprintf ( 1, '\n' );
  
  for test = 1 : 3

    n = 5;

    if ( test == 1 )
      t = [ 0, 1, 1, 0, 1 ];
    elseif ( test == 2 )
      t = [ 1, 0, 7, 1, 0 ];
    elseif ( test == 3 )
      t = [ 1, 1, 1, 1, 1 ];
    end

    check = gray_code_check ( n, t );
    fprintf ( 1, '      %5s  %2d:  ', mat2str ( check ), n );
    for i = 1 : n
      fprintf ( 1, '  %2d', t(i) );
    end
    fprintf ( 1, '\n' );

  end

  return
end
