diff options
author | Howard Hinnant <hhinnant@apple.com> | 2010-08-25 17:32:05 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2010-08-25 17:32:05 +0000 |
commit | dae3481b28ad0bedd4c5b98385af499cbbe2a10b (patch) | |
tree | bb682a9c2b54b54914a58fee5f42fc4c333026b9 /libcxx/test/thread/futures/futures.future_error/code.pass.cpp | |
parent | f1f2133ac088f732be5850b5b53439c9356e1ff1 (diff) | |
download | bcm5719-llvm-dae3481b28ad0bedd4c5b98385af499cbbe2a10b.tar.gz bcm5719-llvm-dae3481b28ad0bedd4c5b98385af499cbbe2a10b.zip |
Getting started on <future>
llvm-svn: 112061
Diffstat (limited to 'libcxx/test/thread/futures/futures.future_error/code.pass.cpp')
-rw-r--r-- | libcxx/test/thread/futures/futures.future_error/code.pass.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/libcxx/test/thread/futures/futures.future_error/code.pass.cpp b/libcxx/test/thread/futures/futures.future_error/code.pass.cpp new file mode 100644 index 00000000000..9b7407ae95b --- /dev/null +++ b/libcxx/test/thread/futures/futures.future_error/code.pass.cpp @@ -0,0 +1,41 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <future> + +// class future_error + +// const error_code& code() const throw(); + +#include <future> +#include <cassert> + +int main() +{ + { + std::error_code ec = std::make_error_code(std::future_errc::broken_promise); + std::future_error f(ec); + assert(f.code() == ec); + } + { + std::error_code ec = std::make_error_code(std::future_errc::future_already_retrieved); + std::future_error f(ec); + assert(f.code() == ec); + } + { + std::error_code ec = std::make_error_code(std::future_errc::promise_already_satisfied); + std::future_error f(ec); + assert(f.code() == ec); + } + { + std::error_code ec = std::make_error_code(std::future_errc::no_state); + std::future_error f(ec); + assert(f.code() == ec); + } +} |