diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-22 05:32:16 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-22 05:32:16 +0000 |
commit | fd8431c84811e14566423cbc55645074300ec2fa (patch) | |
tree | 1c19eaec8b161244a85ea6ebe24ea14c66a07346 /libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/not_equal.cc | |
parent | dfaec4a91ea4562335a383795530f62a31b9d629 (diff) | |
download | gcc-fd8431c84811e14566423cbc55645074300ec2fa.tar.gz |
2004-10-21 Benjamin Kosnik <bkoz@redhat.com>
* include/tr1/array (array): Make safe for zero-sized arrays.
(array::end): Return one past the end.
(array::at): Use __throw_out_of_range, include functexcept.h.
(operator==): Implement.
(operator!=): Same.
(operator<): Same.
(operator>): Same.
(operator>=): Same.
(operator<=): Same.
* testsuite/tr1/6_containers/array/capacity/(empty.cc,
max_size.cc, size.cc): New.
* testsuite/tr1/6_containers/array/comparison_operators/(equal.cc,
greater.cc, greater_or_equal.cc, less.cc, less_or_equal.cc,
not_equal): New.
* testsuite/tr1/6_containers/array/cons/aggregate_initialization.cc:
New.
* testsuite/tr1/6_containers/array/element_access/at_out_of_range.cc:
New.
* testsuite/tr1/6_containers/array/iterators/end_is_one_past.cc: New.
* testsuite/tr1/6_containers/array/requirements/(contiguous.cc,
instantiate, typedefs, zero_size_arrays): New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89429 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/not_equal.cc')
-rw-r--r-- | libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/not_equal.cc | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/not_equal.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/not_equal.cc new file mode 100644 index 00000000000..f166ae74873 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/not_equal.cc @@ -0,0 +1,45 @@ +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a = { 0, 1, 2, 3, 4 }; + array_type b = { 0, 1, 2, 3, 4 }; + array_type c = { 0, 1, 2, 3 }; + + VERIFY( !(a != b) ); + VERIFY( a != c ); +} + +int main() +{ + test01(); + return 0; +} + |