Move test into test/std subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224658 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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()
|
||||
{
|
||||
}
|
@@ -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());
|
||||
}
|
||||
}
|
@@ -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());
|
||||
}
|
@@ -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());
|
||||
}
|
||||
}
|
@@ -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());
|
||||
}
|
||||
}
|
@@ -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());
|
||||
}
|
||||
}
|
@@ -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());
|
||||
}
|
||||
}
|
@@ -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);
|
||||
}
|
||||
}
|
@@ -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());
|
||||
}
|
||||
}
|
@@ -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));
|
||||
}
|
||||
}
|
@@ -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());
|
||||
}
|
@@ -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));
|
||||
}
|
@@ -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);
|
||||
}
|
@@ -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()
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user