Another way to fix this would be to do the sprintf and compare against that, or to use an explicit integer reinterpret_casted to void*, but it doesn't seem too bad to add an extra option for glibc's output.
Jeffrey
commit 98e17198dad6a6e975f83584d203f0b442fa569c Author: Jeffrey Yasskin <[email protected]> Date: Sun Feb 19 01:34:01 2012 -0800 glibc formats null pointers through %p as "(nil)", not "0x0". That's allowed behavior under the standard, so allow it in the test. diff --git a/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_pointer.pass.cpp b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_pointer.pass.cpp index c3769d8..3303db9 100644 --- a/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_pointer.pass.cpp +++ b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_pointer.pass.cpp @@ -38,6 +38,6 @@ int main() char str[50]; output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v); std::string ex(str, iter.base()); - assert(ex == "0x0"); + assert(ex == "0x0" || ex == "(nil)"); } }
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
