Doxygen changes
[ACE_TAO.git] / ACE / tests / Compiler_Features_11_Test.cpp
blob6a55167cacc03878bafa93f636c9c9ada1ab6850
1 /**
2 * @file
4 * This program checks if the compiler / platform supports the
5 * string steams. The motivation for this test was a discussion
6 * on the development mailing list, and the documentation was captured
7 * in:
9 * http://bugzilla.dre.vanderbilt.edu/show_bug.cgi?id=3715
12 #include "test_config.h"
14 // The first part of the test is to compile this line. If the program
15 // does not compile the platform is just too broken.
16 #include <sstream>
18 int
19 run_main (int, ACE_TCHAR *[])
21 ACE_START_TEST (ACE_TEXT("Compiler_Features_11_Test"));
23 // As usual, the exit status from the test is 0 on success, 1 on
24 // failure
25 int status = 0;
27 #ifndef ACE_LACKS_IOSTREAM_TOTALLY
29 // Test creation of a output stream ...
30 std::ostringstream os;
32 // ... add some strings and numbers to it ...
33 os << "1" << 2 << 3 << "45";
35 // ... verify the right thing comes out ...
36 std::string const expected("12345");
37 if (os.str() != expected)
39 status = 1;
40 ACE_ERROR ((LM_ERROR, ACE_TEXT("Expected %s got %s\n"),
41 expected.c_str(), os.str().c_str()));
44 // ... create an input stream from the result ...
45 std::istringstream is(os.str());
47 // ... extract as a number ...
48 int v;
49 is >> v;
51 // ... verify the right thing comes out ...
52 if (v != 12345)
54 status = 1;
55 ACE_ERROR ((LM_ERROR, ACE_TEXT("Expected %d got %d\n"),
56 12345, v));
59 #endif
60 ACE_END_TEST;
61 return status;