From aab1cbcd0f01bd05da1101e6f33db7604ef2da07 Mon Sep 17 00:00:00 2001 From: srz-zumix Date: Fri, 24 Apr 2015 08:22:12 +0900 Subject: [PATCH] update r829 --- test/iutest_unit_tests.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/iutest_unit_tests.cpp b/test/iutest_unit_tests.cpp index bea248aa20..99d5502e96 100644 --- a/test/iutest_unit_tests.cpp +++ b/test/iutest_unit_tests.cpp @@ -126,6 +126,25 @@ IUTEST(UnitTest, XmlEscape) , HackXmlGeneratorListener::EscapeXmlText("a<> b& \'\"c\r\n")); } +IUTEST(UnitTest, FileLocqtion) +{ + ::iutest::IUTEST_FLAG(file_location_style_msvc) = false; + IUTEST_EXPECT_STREQ("main.cpp:1" + , ::iutest::detail::FormatFileLocation("main.cpp", 1) ); + IUTEST_EXPECT_STREQ("unknown file:1" + , ::iutest::detail::FormatFileLocation(NULL, 1) ); + IUTEST_EXPECT_STREQ("main.cpp" + , ::iutest::detail::FormatFileLocation("main.cpp", -1) ); + + ::iutest::IUTEST_FLAG(file_location_style_msvc) = true; + IUTEST_EXPECT_STREQ("main.cpp(1)" + , ::iutest::detail::FormatFileLocation("main.cpp", 1) ); + IUTEST_EXPECT_STREQ("unknown file(1)" + , ::iutest::detail::FormatFileLocation(NULL, 1) ); + IUTEST_EXPECT_STREQ("main.cpp" + , ::iutest::detail::FormatFileLocation("main.cpp", -1) ); +} + #ifdef UNICODE int wmain(int argc, wchar_t* argv[])