Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / ACE / tests / Compiler_Features_26_Test.cpp
blobe48b6709f406acdefc7b1c6b7b8381efe3ad1506
1 /**
2 * This program checks if the compiler doesn't have a certain bug
3 * that we encountered when testing C++11 features
4 */
6 #include "test_config.h"
8 #if defined (ACE_HAS_CPP11)
10 #include <memory>
12 int
13 run_main (int, ACE_TCHAR *[])
15 ACE_START_TEST (ACE_TEXT("Compiler_Features_26_Test"));
17 int retval = 0;
18 std::shared_ptr<int> a,b,c,d;
20 a = std::make_shared<int> (10);
21 b = std::make_shared<int> (10);
22 c = b;
24 if (!(a!=b) || (a==b))
26 ACE_ERROR ((LM_ERROR,
27 ACE_TEXT ("Problem using a!=b\n")));
28 ++retval;
30 if (!(b==c) || (b!=c))
32 ACE_ERROR ((LM_ERROR,
33 ACE_TEXT ("Problem using b==c\n")));
34 ++retval;
36 if ((c==d) || !(d!=c))
38 ACE_ERROR ((LM_ERROR,
39 ACE_TEXT ("Problem using b==c\n")));
40 ++retval;
42 if ((a==nullptr) || !(a!=nullptr))
44 ACE_ERROR ((LM_ERROR,
45 ACE_TEXT ("Problem using a==nullptr\n")));
46 ++retval;
48 if ((b==nullptr) || !(b!=nullptr))
50 ACE_ERROR ((LM_ERROR,
51 ACE_TEXT ("Problem using b==nullptr\n")));
52 ++retval;
54 if ((c==nullptr) || !(c!=nullptr))
56 ACE_ERROR ((LM_ERROR,
57 ACE_TEXT ("Problem using c==nullptr\n")));
58 ++retval;
60 if ((d!=nullptr) || !(d==nullptr))
62 ACE_ERROR ((LM_ERROR,
63 ACE_TEXT ("Problem using d!=nullptr\n")));
64 ++retval;
67 if (retval == 0)
69 ACE_DEBUG ((LM_INFO,
70 ACE_TEXT ("Compiler Feature 26 Test does compile and run.\n")));
73 ACE_END_TEST;
75 return retval;
78 #else
79 int
80 run_main (int, ACE_TCHAR *[])
82 ACE_START_TEST (ACE_TEXT("Compiler_Features_26_Test"));
84 ACE_DEBUG ((LM_INFO,
85 ACE_TEXT ("No C++11 support enabled\n")));
87 ACE_END_TEST;
88 return 0;
91 #endif