// ------------------------------------------------------------------------
/*
	author: Jaap Suter
    
    Copyright (C) Electronic Arts Canada Inc. 2002.  All rights reserved.	
*/
// ------------------------------------------------------------------------

/*! \file */

#include "reveal/type_traits/type_traits.h"
#include "reveal/type_traits/unit_test.h"
#include <stddef.h>

#if defined(_MSC_VER)
#pragma warning(disable: 4127)  // conditional expression is constant
#endif

namespace Reveal {
    namespace TypeTraits {
        namespace UnitTest {

// ------------------------------------------------------------------------
bool Test()
{
	if ( ! IsVoid< void >::value ) return false;
	if (   IsVoid< int  >::value ) return false;

	if ( ! IsFloatingPoint< float  >::value ) return false;
	if ( ! IsFloatingPoint< double >::value ) return false;
	if (   IsFloatingPoint< int    >::value ) return false;

	typedef float some_type_that_should_be_float;
	if ( ! IsFloatingPoint< some_type_that_should_be_float >::value ) return false;

	if ( ! IsIntegral< int   >::value ) return false;
	if ( ! IsIntegral< char  >::value ) return false;
	if (   IsIntegral< float >::value ) return false;

	typedef int some_type_that_should_be_int;
	if ( ! IsIntegral< some_type_that_should_be_int >::value ) return false;

	if ( ! IsSame< long, long >::value ) return false;
	if (   IsSame< long*, long >::value ) return false;
	if ( ! IsSame< long*, long* >::value ) return false;
	if (   IsSame< char, bool >::value ) return false;

	if ( ! IsSame< MetaIf< true, char, int >::type, char >::value ) return false;
	if ( ! IsSame< MetaIf< false, char, int >::type, int >::value ) return false;

	return true;
    
}

	    } // Namespace UnitTest
    } // Namespace TypeTraits
} // Namespace Reveal
