summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2014-12-20 01:40:03 +0000
committerEric Fiselier <eric@efcs.ca>2014-12-20 01:40:03 +0000
commit5a83710e371fe68a06e6e3876c6a2c8b820a8976 (patch)
treeafde4c82ad6704681781c5cd49baa3fbd05c85db /libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals
parentf11e8eab527fba316c64112f6e05de1a79693a3e (diff)
downloadbcm5719-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.errcat/syserr.errcat.virtuals')
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp25
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_error_code_int.pass.cpp24
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_int_error_condition.pass.cpp25
3 files changed, 74 insertions, 0 deletions
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp
new file mode 100644
index 00000000000..dd51827128b
--- /dev/null
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// 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_category
+
+// virtual error_condition default_error_condition(int ev) const;
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+ const std::error_category& e_cat = std::generic_category();
+ std::error_condition e_cond = e_cat.default_error_condition(static_cast<int>(std::errc::not_a_directory));
+ assert(e_cond.category() == e_cat);
+ assert(e_cond.value() == static_cast<int>(std::errc::not_a_directory));
+}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_error_code_int.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_error_code_int.pass.cpp
new file mode 100644
index 00000000000..d26541d943f
--- /dev/null
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_error_code_int.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_category
+
+// virtual bool equivalent(const error_code& code, int condition) const;
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+ const std::error_category& e_cat = std::generic_category();
+ assert(e_cat.equivalent(std::error_code(5, e_cat), 5));
+ assert(!e_cat.equivalent(std::error_code(5, e_cat), 6));
+}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_int_error_condition.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_int_error_condition.pass.cpp
new file mode 100644
index 00000000000..d7cf844dffe
--- /dev/null
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_int_error_condition.pass.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// 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_category
+
+// virtual bool equivalent(int code, const error_condition& condition) const;
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+ const std::error_category& e_cat = std::generic_category();
+ std::error_condition e_cond = e_cat.default_error_condition(5);
+ assert(e_cat.equivalent(5, e_cond));
+ assert(!e_cat.equivalent(6, e_cond));
+}
OpenPOWER on IntegriCloud