30 MITK_TEST_OUTPUT(<<
"\n** Changing locale from " << setlocale(LC_ALL, NULL) <<
" to '" << locale <<
"'");
31 setlocale(LC_ALL, locale.c_str());
33 std::locale l(locale.c_str());
53 if (pointSet->GetPointIfExists(0, &point))
71 refPointSet->InsertPoint(0, refPoint);
79 std::ifstream stream(tmpFilePath.c_str());
82 std::ifstream refStream(filename.c_str());
88 if (stream.is_open() && refStream.is_open())
90 std::string streamLine;
91 std::string refStreamLine;
92 while (!stream.eof() && !refStream.eof())
94 getline(stream, streamLine);
95 getline(refStream, refStreamLine);
96 if (streamLine.compare(refStreamLine) != 0)
115 refPoint[0] = 32.2946;
116 refPoint[1] = -17.7359;
117 refPoint[2] = 29.6502;
118 refPointSet->SetPoint(0, refPoint);
123 StringList alllocales;
124 alllocales.push_back(
"de_DE");
125 alllocales.push_back(
"de_DE.utf8");
126 alllocales.push_back(
"de_DE.UTF-8");
127 alllocales.push_back(
"de_DE@euro");
128 alllocales.push_back(
"German_Germany");
132 #if defined(__APPLE__) || defined(MACOSX)
133 alllocales.push_back(
"C");
139 MITK_INFO <<
"Reference PointSet in " << referenceFilePath;
144 unsigned int numberOfTestedGermanLocales(0);
145 for (StringList::iterator iter = alllocales.begin(); iter != alllocales.end(); ++iter)
149 ++numberOfTestedGermanLocales;
155 if (numberOfTestedGermanLocales == 0)
static void Save(const mitk::BaseData *data, const std::string &path)
Save a mitk::BaseData instance.
#define MITK_TEST_CONDITION_REQUIRED(COND, MSG)
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
bool ChangeLocale(const std::string &locale)
#define MITK_TEST_OUTPUT(x)
Output some text.
void ReaderLocaleTest(mitk::Point3D &refPoint, std::string filename)
void WriterLocaleTest(mitk::Point3D &refPoint, std::string filename)
int mitkPointSetLocaleTest(int, char *[])
static const std::string filename
#define MITK_TEST_FAILED_MSG(MSG)
Fail and finish test with message MSG.
static mitk::PointSet::Pointer LoadPointSet(const std::string &path)
LoadPointSet Convenience method to load an arbitrary mitkPointSet.
std::vector< std::string > StringList
static std::string CreateTemporaryFile(std::ofstream &tmpStream, const std::string &templateName="XXXXXX", std::string path=std::string())