diff options
author | Eric Fiselier <eric@efcs.ca> | 2014-12-20 01:40:03 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2014-12-20 01:40:03 +0000 |
commit | 5a83710e371fe68a06e6e3876c6a2c8b820a8976 (patch) | |
tree | afde4c82ad6704681781c5cd49baa3fbd05c85db /libcxx/test/std/diagnostics/syserr/syserr.errcondition | |
parent | f11e8eab527fba316c64112f6e05de1a79693a3e (diff) | |
download | bcm5719-llvm-5a83710e371fe68a06e6e3876c6a2c8b820a8976.tar.gz bcm5719-llvm-5a83710e371fe68a06e6e3876c6a2c8b820a8976.zip |
Move test into test/std subdirectory.
llvm-svn: 224658
Diffstat (limited to 'libcxx/test/std/diagnostics/syserr/syserr.errcondition')
14 files changed, 348 insertions, 0 deletions
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/nothing_to_do.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/nothing_to_do.pass.cpp new file mode 100644 index 00000000000..b58f5c55b64 --- /dev/null +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/nothing_to_do.pass.cpp @@ -0,0 +1,12 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +int main() +{ +} diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/ErrorConditionEnum.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/ErrorConditionEnum.pass.cpp new file mode 100644 index 00000000000..fbc03f1aa02 --- /dev/null +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/ErrorConditionEnum.pass.cpp @@ -0,0 +1,26 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <system_error> + +// class error_condition + +// template <ErrorConditionEnum E> error_condition(E e); + +#include <system_error> +#include <cassert> + +int main() +{ + { + std::error_condition ec(std::errc::not_a_directory); + assert(ec.value() == static_cast<int>(std::errc::not_a_directory)); + assert(ec.category() == std::generic_category()); + } +} diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/default.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/default.pass.cpp new file mode 100644 index 00000000000..a430ee2f7d8 --- /dev/null +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/default.pass.cpp @@ -0,0 +1,24 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <system_error> + +// class error_condition + +// error_condition(); + +#include <system_error> +#include <cassert> + +int main() +{ + std::error_condition ec; + assert(ec.value() == 0); + assert(ec.category() == std::generic_category()); +} diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/int_error_category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/int_error_category.pass.cpp new file mode 100644 index 00000000000..f3b9eada765 --- /dev/null +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/int_error_category.pass.cpp @@ -0,0 +1,31 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <system_error> + +// class error_condition + +// error_condition(int val, const error_category& cat); + +#include <system_error> +#include <cassert> + +int main() +{ + { + std::error_condition ec(6, std::system_category()); + assert(ec.value() == 6); + assert(ec.category() == std::system_category()); + } + { + std::error_condition ec(8, std::generic_category()); + assert(ec.value() == 8); + assert(ec.category() == std::generic_category()); + } +} diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/ErrorConditionEnum.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/ErrorConditionEnum.pass.cpp new file mode 100644 index 00000000000..3773872c7e3 --- /dev/null +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/ErrorConditionEnum.pass.cpp @@ -0,0 +1,27 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <system_error> + +// class error_condition + +// template <ErrorConditionEnum E> error_condition& operator=(E e); + +#include <system_error> +#include <cassert> + +int main() +{ + { + std::error_condition ec; + ec = std::errc::not_enough_memory; + assert(ec.value() == static_cast<int>(std::errc::not_enough_memory)); + assert(ec.category() == std::generic_category()); + } +} diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/assign.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/assign.pass.cpp new file mode 100644 index 00000000000..8fcfcc3603a --- /dev/null +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/assign.pass.cpp @@ -0,0 +1,33 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <system_error> + +// class error_condition + +// void assign(int val, const error_category& cat); + +#include <system_error> +#include <cassert> + +int main() +{ + { + std::error_condition ec; + ec.assign(6, std::system_category()); + assert(ec.value() == 6); + assert(ec.category() == std::system_category()); + } + { + std::error_condition ec; + ec.assign(8, std::generic_category()); + assert(ec.value() == 8); + assert(ec.category() == std::generic_category()); + } +} diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/clear.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/clear.pass.cpp new file mode 100644 index 00000000000..509a8b98118 --- /dev/null +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/clear.pass.cpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <system_error> + +// class error_condition + +// void clear(); + +#include <system_error> +#include <cassert> + +int main() +{ + { + std::error_condition ec; + ec.assign(6, std::system_category()); + assert(ec.value() == 6); + assert(ec.category() == std::system_category()); + ec.clear(); + assert(ec.value() == 0); + assert(ec.category() == std::generic_category()); + } +} diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/lt.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/lt.pass.cpp new file mode 100644 index 00000000000..7ab063853d9 --- /dev/null +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/lt.pass.cpp @@ -0,0 +1,27 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <system_error> + +// class error_condition + +// bool operator<(const error_condition& lhs, const error_condition& rhs); + +#include <system_error> +#include <string> +#include <cassert> + +int main() +{ + { + const std::error_condition ec1(6, std::generic_category()); + const std::error_condition ec2(7, std::generic_category()); + assert(ec1 < ec2); + } +} diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/make_error_condition.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/make_error_condition.pass.cpp new file mode 100644 index 00000000000..acefc4655ab --- /dev/null +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/make_error_condition.pass.cpp @@ -0,0 +1,26 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <system_error> + +// class error_condition + +// error_condition make_error_condition(errc e); + +#include <system_error> +#include <cassert> + +int main() +{ + { + const std::error_condition ec1 = std::make_error_condition(std::errc::message_size); + assert(ec1.value() == static_cast<int>(std::errc::message_size)); + assert(ec1.category() == std::generic_category()); + } +} diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/bool.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/bool.pass.cpp new file mode 100644 index 00000000000..edeca06d38b --- /dev/null +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/bool.pass.cpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <system_error> + +// class error_condition + +// explicit operator bool() const; + +#include <system_error> +#include <string> +#include <cassert> + +int main() +{ + { + const std::error_condition ec(6, std::generic_category()); + assert(static_cast<bool>(ec)); + } + { + const std::error_condition ec(0, std::generic_category()); + assert(!static_cast<bool>(ec)); + } +} diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/category.pass.cpp new file mode 100644 index 00000000000..fd3e698566b --- /dev/null +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/category.pass.cpp @@ -0,0 +1,23 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <system_error> + +// class error_condition + +// const error_category& category() const; + +#include <system_error> +#include <cassert> + +int main() +{ + const std::error_condition ec(6, std::generic_category()); + assert(ec.category() == std::generic_category()); +} diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/message.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/message.pass.cpp new file mode 100644 index 00000000000..6a60f50f410 --- /dev/null +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/message.pass.cpp @@ -0,0 +1,24 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <system_error> + +// class error_condition + +// string message() const; + +#include <system_error> +#include <string> +#include <cassert> + +int main() +{ + const std::error_condition ec(6, std::generic_category()); + assert(ec.message() == std::generic_category().message(6)); +} diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/value.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/value.pass.cpp new file mode 100644 index 00000000000..c755673126b --- /dev/null +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/value.pass.cpp @@ -0,0 +1,23 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <system_error> + +// class error_condition + +// int value() const; + +#include <system_error> +#include <cassert> + +int main() +{ + const std::error_condition ec(6, std::system_category()); + assert(ec.value() == 6); +} diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/nothing_to_do.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/nothing_to_do.pass.cpp new file mode 100644 index 00000000000..b58f5c55b64 --- /dev/null +++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/nothing_to_do.pass.cpp @@ -0,0 +1,12 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +int main() +{ +} |