ICU-6765 StringTest more meaningful order of #includes and tests

X-SVN-Rev: 25482
This commit is contained in:
Markus Scherer 2009-02-25 06:43:12 +00:00
parent 8406b8e2bd
commit 5f031ce140
2 changed files with 19 additions and 15 deletions

View file

@ -17,11 +17,7 @@
#include "intltest.h"
#include "strtest.h"
#include "unicode/ustring.h"
#if defined(U_WINDOWS) && defined(_MSC_VER)
#include <vector>
using namespace std;
#endif
#include "unicode/std_string.h"
StringTest::~StringTest() {}
@ -178,11 +174,7 @@ void StringTest::runIndexedTest(int32_t index, UBool exec, const char *&name, ch
case 7:
name="TestSTLCompatibility";
if(exec) {
#if defined(U_WINDOWS) && defined(_MSC_VER)
/* Just make sure that it compiles with STL's placement new usage. */
vector<UnicodeString> myvect;
myvect.push_back(UnicodeString("blah"));
#endif
TestSTLCompatibility();
}
break;
case 8:
@ -217,14 +209,12 @@ StringTest::TestStdNamespaceQualifier() {
#endif
}
#if U_HAVE_STD_STRING
// Now test that "using namespace std;" is defined correctly.
U_STD_NS_USE
#endif
void
StringTest::TestUsingStdNamespace() {
#if U_HAVE_STD_STRING
// Now test that "using namespace std;" is defined correctly.
U_STD_NS_USE
string s="abc xyz";
string t="abc";
t.append(" ");
@ -234,3 +224,16 @@ StringTest::TestUsingStdNamespace() {
}
#endif
}
#if defined(U_WINDOWS) && defined(_MSC_VER)
#include <vector>
#endif
void
StringTest::TestSTLCompatibility() {
#if defined(U_WINDOWS) && defined(_MSC_VER)
/* Just make sure that it compiles with STL's placement new usage. */
std::vector<UnicodeString> myvect;
myvect.push_back(UnicodeString("blah"));
#endif
}

View file

@ -36,6 +36,7 @@ private:
void TestCharsetFamily(void);
void TestStdNamespaceQualifier();
void TestUsingStdNamespace();
void TestSTLCompatibility();
};
#endif