-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathtest_Error.cpp
More file actions
57 lines (36 loc) · 1.28 KB
/
test_Error.cpp
File metadata and controls
57 lines (36 loc) · 1.28 KB
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
47
48
49
50
51
52
53
54
55
56
// See LICENSE_CELLO file for license and copyright information
/// @file test_Error.cpp
/// @author James Bordner (jobordner@ucsd.edu)
/// @date Wed Aug 20 11:24:14 PDT 2008
/// @brief Program implementing unit tests for error classes
#include "main.hpp"
#include "test.hpp"
#include "error.hpp"
PARALLEL_MAIN_BEGIN
{
PARALLEL_INIT;
unit_init(0,1);
unit_class("Error");
//----------------------------------------------------------------------
PARALLEL_PRINTF ("old-style Warning message:\n");
char warning_message[ERROR_LENGTH];
snprintf (warning_message,sizeof(warning_message),"Warning message test");
WARNING("main",warning_message);
unit_func("WARNING");
unit_assert (true);
//----------------------------------------------------------------------
PARALLEL_PRINTF ("new-style Warning message:\n");
char warning_message2[ERROR_LENGTH];
snprintf (warning_message2,sizeof(warning_message2),"Warning message test");
CELLO_WARN("%s", warning_message2);
unit_func("WARNING");
unit_assert (true);
//----------------------------------------------------------------------
PARALLEL_PRINTF ("Incomplete message:\n");
INCOMPLETE("main");
unit_func("INCOMPLETE");
unit_assert (true);
unit_finalize();
exit_();
}
PARALLEL_MAIN_END