mirror of https://github.com/CGAL/cgal
removed assertions
This commit is contained in:
parent
e80e621e46
commit
5676929d03
|
|
@ -33,7 +33,6 @@
|
|||
//| standard C library functions in cctype (isdigit etc.) as macros.
|
||||
//| According to the standard they have to be functions.
|
||||
|
||||
#include <cassert>
|
||||
#include <cctype>
|
||||
using std::isalnum;
|
||||
using std::isalpha;
|
||||
|
|
@ -47,10 +46,12 @@ using std::isspace;
|
|||
using std::isupper;
|
||||
using std::isxdigit;
|
||||
|
||||
bool all_assertions_correct = true;
|
||||
|
||||
int main()
|
||||
{
|
||||
assert(std::isdigit('0'));
|
||||
return 0;
|
||||
all_assertions_correct &= (std::isdigit('0'));
|
||||
return !all_assertions_correct;
|
||||
}
|
||||
|
||||
// EOF //
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <typeinfo>
|
||||
#endif // __GNUG__
|
||||
|
||||
#include <cassert>
|
||||
|
||||
class Base
|
||||
{
|
||||
|
|
@ -41,17 +40,19 @@ class Base
|
|||
class Derived : public Base
|
||||
{ };
|
||||
|
||||
bool all_assertions_correct = true;
|
||||
|
||||
int main()
|
||||
{
|
||||
Base *p_Base_Derived = new Derived;
|
||||
Base *p_Base_Base = new Base;
|
||||
|
||||
Derived* p_Derived_Derived = dynamic_cast<Derived *>(p_Base_Derived);
|
||||
assert(p_Derived_Derived != 0);
|
||||
all_assertions_correct &= (p_Derived_Derived != 0);
|
||||
Derived* p_Derived_Base = dynamic_cast<Derived *>(p_Base_Base);
|
||||
assert(p_Derived_Base == 0);
|
||||
all_assertions_correct &= (p_Derived_Base == 0);
|
||||
|
||||
return 0;
|
||||
return !all_assertions_correct;
|
||||
}
|
||||
|
||||
// EOF //
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
//| including their use in a template class, as a default template
|
||||
//| argument and as a return type of global function.
|
||||
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
|
|
@ -79,6 +78,8 @@ query( I i) {
|
|||
inline
|
||||
int discr( std::bidirectional_iterator_tag tag) { return 42; }
|
||||
|
||||
bool all_assertions_correct = true;
|
||||
|
||||
int main() {
|
||||
std::vector<int> v;
|
||||
v.push_back(32);
|
||||
|
|
@ -86,10 +87,10 @@ int main() {
|
|||
v.push_back(42);
|
||||
Adaptor< std::vector<int>::iterator> i( v.begin());
|
||||
++i;
|
||||
assert( *i == 33);
|
||||
all_assertions_correct &= ( *i == 33);
|
||||
++i;
|
||||
assert( *i == 42);
|
||||
assert( discr( query( i)) == 42);
|
||||
return 0;
|
||||
all_assertions_correct &= ( *i == 42);
|
||||
all_assertions_correct &= ( discr( query( i)) == 42);
|
||||
return !all_assertions_correct;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
//| If a compiler doesn't know namespaces, the flag
|
||||
//| CGAL_CFG_NO_NAMESPACE is set.
|
||||
|
||||
#include <cassert>
|
||||
|
||||
namespace A {
|
||||
int foo() { return 1; }
|
||||
|
|
@ -42,19 +41,21 @@ namespace B {
|
|||
int foo() { return 2; }
|
||||
}
|
||||
|
||||
bool all_assertions_correct = true;
|
||||
|
||||
int main()
|
||||
{
|
||||
assert( A::foo() == 1);
|
||||
assert( B::foo() == 2);
|
||||
all_assertions_correct &= ( A::foo() == 1);
|
||||
all_assertions_correct &= ( B::foo() == 2);
|
||||
{
|
||||
using namespace A;
|
||||
assert( foo() == 1);
|
||||
all_assertions_correct &= ( foo() == 1);
|
||||
}
|
||||
{
|
||||
using namespace B;
|
||||
assert( foo() == 2);
|
||||
all_assertions_correct &= ( foo() == 2);
|
||||
}
|
||||
return 0;
|
||||
return !all_assertions_correct;
|
||||
}
|
||||
|
||||
// EOF //
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
//| The following definition is set if the compiler fails parsing.
|
||||
|
||||
|
||||
#include <cassert>
|
||||
|
||||
template < class T>
|
||||
struct A {
|
||||
|
|
@ -49,10 +48,12 @@ typename T::X B<T>::foo( typename T::X i) {
|
|||
return i + 2;
|
||||
}
|
||||
|
||||
bool all_assertions_correct = true;
|
||||
|
||||
int main() {
|
||||
B<A<int> > b;
|
||||
assert( b.foo(40) == 42);
|
||||
return 0;
|
||||
all_assertions_correct &= ( b.foo(40) == 42);
|
||||
return !all_assertions_correct;
|
||||
}
|
||||
|
||||
// EOF //
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
//| standard C library functions in cctype (isdigit etc.) as macros.
|
||||
//| According to the standard they have to be functions.
|
||||
|
||||
#include <cassert>
|
||||
#include <cctype>
|
||||
using std::isalnum;
|
||||
using std::isalpha;
|
||||
|
|
@ -47,10 +46,12 @@ using std::isspace;
|
|||
using std::isupper;
|
||||
using std::isxdigit;
|
||||
|
||||
bool all_assertions_correct = true;
|
||||
|
||||
int main()
|
||||
{
|
||||
assert(std::isdigit('0'));
|
||||
return 0;
|
||||
all_assertions_correct &= (std::isdigit('0'));
|
||||
return !all_assertions_correct;
|
||||
}
|
||||
|
||||
// EOF //
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <typeinfo>
|
||||
#endif // __GNUG__
|
||||
|
||||
#include <cassert>
|
||||
|
||||
class Base
|
||||
{
|
||||
|
|
@ -41,17 +40,19 @@ class Base
|
|||
class Derived : public Base
|
||||
{ };
|
||||
|
||||
bool all_assertions_correct = true;
|
||||
|
||||
int main()
|
||||
{
|
||||
Base *p_Base_Derived = new Derived;
|
||||
Base *p_Base_Base = new Base;
|
||||
|
||||
Derived* p_Derived_Derived = dynamic_cast<Derived *>(p_Base_Derived);
|
||||
assert(p_Derived_Derived != 0);
|
||||
all_assertions_correct &= (p_Derived_Derived != 0);
|
||||
Derived* p_Derived_Base = dynamic_cast<Derived *>(p_Base_Base);
|
||||
assert(p_Derived_Base == 0);
|
||||
all_assertions_correct &= (p_Derived_Base == 0);
|
||||
|
||||
return 0;
|
||||
return !all_assertions_correct;
|
||||
}
|
||||
|
||||
// EOF //
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
//| including their use in a template class, as a default template
|
||||
//| argument and as a return type of global function.
|
||||
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
|
|
@ -79,6 +78,8 @@ query( I i) {
|
|||
inline
|
||||
int discr( std::bidirectional_iterator_tag tag) { return 42; }
|
||||
|
||||
bool all_assertions_correct = true;
|
||||
|
||||
int main() {
|
||||
std::vector<int> v;
|
||||
v.push_back(32);
|
||||
|
|
@ -86,10 +87,10 @@ int main() {
|
|||
v.push_back(42);
|
||||
Adaptor< std::vector<int>::iterator> i( v.begin());
|
||||
++i;
|
||||
assert( *i == 33);
|
||||
all_assertions_correct &= ( *i == 33);
|
||||
++i;
|
||||
assert( *i == 42);
|
||||
assert( discr( query( i)) == 42);
|
||||
return 0;
|
||||
all_assertions_correct &= ( *i == 42);
|
||||
all_assertions_correct &= ( discr( query( i)) == 42);
|
||||
return !all_assertions_correct;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
//| If a compiler doesn't know namespaces, the flag
|
||||
//| CGAL_CFG_NO_NAMESPACE is set.
|
||||
|
||||
#include <cassert>
|
||||
|
||||
namespace A {
|
||||
int foo() { return 1; }
|
||||
|
|
@ -42,19 +41,21 @@ namespace B {
|
|||
int foo() { return 2; }
|
||||
}
|
||||
|
||||
bool all_assertions_correct = true;
|
||||
|
||||
int main()
|
||||
{
|
||||
assert( A::foo() == 1);
|
||||
assert( B::foo() == 2);
|
||||
all_assertions_correct &= ( A::foo() == 1);
|
||||
all_assertions_correct &= ( B::foo() == 2);
|
||||
{
|
||||
using namespace A;
|
||||
assert( foo() == 1);
|
||||
all_assertions_correct &= ( foo() == 1);
|
||||
}
|
||||
{
|
||||
using namespace B;
|
||||
assert( foo() == 2);
|
||||
all_assertions_correct &= ( foo() == 2);
|
||||
}
|
||||
return 0;
|
||||
return !all_assertions_correct;
|
||||
}
|
||||
|
||||
// EOF //
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
//| The following definition is set if the compiler fails parsing.
|
||||
|
||||
|
||||
#include <cassert>
|
||||
|
||||
template < class T>
|
||||
struct A {
|
||||
|
|
@ -49,10 +48,12 @@ typename T::X B<T>::foo( typename T::X i) {
|
|||
return i + 2;
|
||||
}
|
||||
|
||||
bool all_assertions_correct = true;
|
||||
|
||||
int main() {
|
||||
B<A<int> > b;
|
||||
assert( b.foo(40) == 42);
|
||||
return 0;
|
||||
all_assertions_correct &= ( b.foo(40) == 42);
|
||||
return !all_assertions_correct;
|
||||
}
|
||||
|
||||
// EOF //
|
||||
|
|
|
|||
Loading…
Reference in New Issue