diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2017-11-15 02:31:14 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2017-11-15 02:31:14 +0000 |
| commit | fc6cc70018cd342b4764ae9df146f27ace35301c (patch) | |
| tree | 80cdc76002f4067ddb4a9afbfa26a826b59d202a /libcxx/test/std | |
| parent | 6be7e289b2962eb4bee90ceeb1ea628781b19be9 (diff) | |
| download | bcm5719-llvm-fc6cc70018cd342b4764ae9df146f27ace35301c.tar.gz bcm5719-llvm-fc6cc70018cd342b4764ae9df146f27ace35301c.zip | |
More missing tests - array<>::size() and array<>::max_size()
llvm-svn: 318256
Diffstat (limited to 'libcxx/test/std')
| -rw-r--r-- | libcxx/test/std/containers/sequences/array/empty.pass.cpp | 36 | ||||
| -rw-r--r-- | libcxx/test/std/containers/sequences/array/max_size.pass.cpp | 36 |
2 files changed, 72 insertions, 0 deletions
diff --git a/libcxx/test/std/containers/sequences/array/empty.pass.cpp b/libcxx/test/std/containers/sequences/array/empty.pass.cpp new file mode 100644 index 00000000000..2c01dfc86c1 --- /dev/null +++ b/libcxx/test/std/containers/sequences/array/empty.pass.cpp @@ -0,0 +1,36 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <array> + +// class array + +// bool empty() const noexcept; + +#include <array> +#include <cassert> + +#include "test_macros.h" +#include "min_allocator.h" + +int main() +{ + { + typedef std::array<int, 2> C; + C c; + ASSERT_NOEXCEPT(c.empty()); + assert(!c.empty()); + } + { + typedef std::array<int, 0> C; + C c; + ASSERT_NOEXCEPT(c.empty()); + assert( c.empty()); + } +} diff --git a/libcxx/test/std/containers/sequences/array/max_size.pass.cpp b/libcxx/test/std/containers/sequences/array/max_size.pass.cpp new file mode 100644 index 00000000000..9a3fed3950e --- /dev/null +++ b/libcxx/test/std/containers/sequences/array/max_size.pass.cpp @@ -0,0 +1,36 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <array> + +// class array + +// bool max_size() const noexcept; + +#include <array> +#include <cassert> + +#include "test_macros.h" +#include "min_allocator.h" + +int main() +{ + { + typedef std::array<int, 2> C; + C c; + ASSERT_NOEXCEPT(c.max_size()); + assert(c.max_size() == 2); + } + { + typedef std::array<int, 0> C; + C c; + ASSERT_NOEXCEPT(c.max_size()); + assert(c.max_size() == 0); + } +} |

