1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/cppstdlib/stl/test/unit/resolve_name.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,83 @@
1.4 +#define _STLP_DO_IMPORT_CSTD_FUNCTIONS
1.5 +#include <cmath>
1.6 +
1.7 +#if !defined (STLPORT) || defined (_STLP_USE_NAMESPACES)
1.8 +
1.9 +namespace NS1 {
1.10 +
1.11 +bool f()
1.12 +{
1.13 + double d( 1.0 );
1.14 +
1.15 + d = sqrt( d );
1.16 + d = ::sqrt( d );
1.17 + d = std::sqrt( d );
1.18 + return d == 1.0;
1.19 +}
1.20 +
1.21 +}
1.22 +
1.23 +namespace {
1.24 +
1.25 +bool g()
1.26 +{
1.27 + double d( 1.0 );
1.28 +
1.29 + d = sqrt( d );
1.30 + d = ::sqrt( d );
1.31 + d = std::sqrt( d );
1.32 + return d == 1.0;
1.33 +}
1.34 +
1.35 +}
1.36 +
1.37 +// VC6 consider call to sqrt ambiguous as soon as using namespace std has
1.38 +// been invoked.
1.39 +#if !defined (STLPORT) || !defined (_STLP_MSVC) || (_STLP_MSVC >= 1300)
1.40 +using namespace std;
1.41 +#endif
1.42 +
1.43 +bool h()
1.44 +{
1.45 + double d( 1.0 );
1.46 +
1.47 + d = sqrt( d );
1.48 + d = ::sqrt( d );
1.49 + d = std::sqrt( d );
1.50 + return d == 1.0;
1.51 +}
1.52 +
1.53 +struct sq
1.54 +{
1.55 + sq() {}
1.56 +
1.57 + double sqroot( double x ) {
1.58 + using std::sqrt;
1.59 + return sqrt(x);
1.60 + }
1.61 +};
1.62 +
1.63 +#endif
1.64 +
1.65 +
1.66 +#if 0 // Do nothing, this should be compiled only
1.67 +
1.68 +#include "cppunit/cppunit_proxy.h"
1.69 +
1.70 +class ResolveNameTest : public CPPUNIT_NS::TestCase
1.71 +{
1.72 + CPPUNIT_TEST_SUITE(ResolveNameTest);
1.73 + CPPUNIT_TEST(cstyle);
1.74 + CPPUNIT_TEST_SUITE_END();
1.75 +
1.76 +protected:
1.77 + void cstyle();
1.78 +};
1.79 +
1.80 +CPPUNIT_TEST_SUITE_REGISTRATION(ResolveNameTest);
1.81 +
1.82 +void ResolveNameTest::cstyle()
1.83 +{
1.84 +}
1.85 +
1.86 +#endif