Commit 1929cbfa authored by Roland Levillain's avatar Roland Levillain
Browse files

Add tests for mlc_is_a, mlc_if and mlc_typedef.

	* tests/is_a.cc, tests/if.cc, tests/typedef.cc: New tests.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@401 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent cf9adedd
2006-02-14 Roland Levillain <roland@lrde.epita.fr>
Add tests for mlc_is_a, mlc_if and mlc_typedef.
* tests/is_a.cc, tests/if.cc, tests/typedef.cc: New tests.
2006-02-14 Roland Levillain <roland@lrde.epita.fr> 2006-02-14 Roland Levillain <roland@lrde.epita.fr>
Add some documentation and types to Metalic. Add some documentation and types to Metalic.
......
#include <mlc/if.hh>
#include <mlc/cmp.hh>
struct alpha;
struct beta;
struct gamma;
struct delta;
int
main()
{
typedef mlc_if_(mlc::true_, alpha, beta) x;
mlc_eq(x, alpha)::ensure();
typedef mlc_if_(mlc::false_, gamma, delta) y;
mlc_eq(y, delta)::ensure();
}
#include <mlc/is_a.hh>
struct A {};
struct B : public A {};
template <class T> struct C {};
template <class T> struct D : public C<T> {};
int
main ()
{
mlc_is_a_(B, A)::ensure();
mlc_is_a_(D<int>, C<int>)::ensure();
}
#include <mlc/typedef.hh>
#include <mlc/cmp.hh>
struct foo
{
typedef int good_type;
};
mlc_decl_typedef(good_type);
mlc_decl_typedef(bad_type);
int
main ()
{
mlc_eq(mlc_typedef_(foo, good_type), foo::good_type)::ensure();
mlc_eq(mlc_typedef_(foo, bad_type), mlc::not_found)::ensure();
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment