minix/external/bsd/libc++/dist/libcxx/test/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category.pass.cpp
Lionel Sambuc 4684ddb6aa LLVM Minix changes
- import libcxx
 - reduce targets to the one when compiled as a tools

Change-Id: Iabb8427f80ff8e89463559a28bcb8b4f2bdbc496
2014-07-28 17:05:59 +02:00

29 lines
873 B
C++

//===----------------------------------------------------------------------===//
//
// 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 system_error
// system_error(int ev, const error_category& ecat);
// Test is slightly non-portable
#include <system_error>
#include <string>
#include <cassert>
int main()
{
std::system_error se(static_cast<int>(std::errc::not_a_directory),
std::generic_category());
assert(se.code() == std::make_error_code(std::errc::not_a_directory));
std::string what_message(se.what());
assert(what_message.find("Not a directory") != std::string::npos);
}