TFCweb
1.0.4 $Rev: 483 $
TFC Primavera 2012: Nucli d'un servidor web
Pàgina principal
Pàgines Relacionades
Espais de Noms
Classes
Fitxers
Llista dels Fitxers
Membres de Fitxers
tests
TestConstraints.cc
Veure la documentació d'aquest fitxer.
1
13
/*
14
* Copyright (c) 2012 Toni Corvera
15
*
16
* This file is part of TFCWeb.
17
*
18
* TFCWeb is free software: you can redistribute it and/or modify
19
* it under the terms of the GNU General Public License as published by
20
* the Free Software Foundation, either version 3 of the License, or
21
* (at your option) any later version.
22
*
23
* TFCWeb is distributed in the hope that it will be useful,
24
* but WITHOUT ANY WARRANTY; without even the implied warranty of
25
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
* GNU General Public License for more details.
27
*
28
* You should have received a copy of the GNU General Public License
29
* along with TFCWeb. If not, see <http://www.gnu.org/licenses/>.
30
*/
31
32
#include <functional>
33
#include <iostream>
34
#include <istream>
35
#include <map>
36
#include <ostream>
37
38
#include <
utils.h
>
39
40
#include "
comu.h
"
41
42
using namespace
std;
43
using namespace
tfc;
44
45
template
<
typename
T>
46
struct
CompatibleAmbPair
{
47
const
T first,
second
;
48
CompatibleAmbPair
(T&t1, T&t2) : first(t1), second(t2) {}
49
};
50
51
struct
Functor
{
52
void
operator()
() {}
53
};
54
struct
Classe
{
55
void
metode
(){}
56
};
57
58
void
fnvoid
() {}
59
60
struct
AmbOperadorsInExExterns
{
61
};
62
// Operadors externs
63
ostream&
operator<<
(ostream& s,
const
AmbOperadorsInExExterns
&) {
64
return
s;
65
}
66
istream&
operator>>
(istream & s,
const
AmbOperadorsInExExterns
&) {
67
return
s;
68
}
69
70
BOOST_AUTO_TEST_SUITE( Constraints_TestSuite )
71
72
BOOST_AUTO_TEST_CASE
( constraints )
73
{
74
Es_Pair_De_Strings< pair<string, string>
>();
75
Es_Pair_De_Strings< CompatibleAmbPair<string>
> ();
76
77
Es_Pot_Cridar_Sense_Arguments<Functor>
();
78
Es_Pot_Cridar_Sense_Arguments<void(*)()>
();
79
Es_Pot_Cridar_Sense_Arguments<void (void)>
();
80
#if __cplusplus >= 201103L
81
// Codi C++11
82
Es_Pot_Cridar_Sense_Arguments<decltype(fnvoid)>
();
83
#endif
84
85
Te_Operador_Insercio<AmbOperadorsInExExterns>
();
86
Te_Operador_Extraccio<AmbOperadorsInExExterns>
();
87
}
88
89
BOOST_AUTO_TEST_SUITE_END()
90
91
// vim:set ts=4 et ai: //
Generat a Dl Jun 17 2013 20:07:39 per a TFCweb per
1.8.1.2