-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsupport.cpp
46 lines (38 loc) · 859 Bytes
/
support.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// Copyright (c) 2005, 2006 by CodeSourcery
// Copyright (c) 2013 Stefan Seefeld
// All rights reserved.
//
// This file is part of OpenVSIP. It is made available under the
// license contained in the accompanying LICENSE.GPL file.
#include <iostream>
#include <vsip/support.hpp>
#include <test.hpp>
using namespace ovxx;
/// Test throw and catch of computation_error exception.
void
test_computation_error()
{
#if VSIP_HAS_EXCEPTIONS
int pass = 0;
try
{
OVXX_DO_THROW(computation_error("TEST: throw exception"));
test_assert(0);
}
catch (const std::exception& error)
{
// cout << "Caught: " << error.what() << endl;
if (error.what() == std::string("TEST: throw exception"))
pass = 1;
}
test_assert(pass);
#else
// Could report untested or not-applicable.
#endif
}
int
main()
{
test_computation_error();
}