Sha256: c8a3413b2bb6774c364bab90f50f33a641affd5df16e7ff02a6a7048da8694d9

Contents?: true

Size: 1.07 KB

Versions: 135

Compression:

Stored size: 1.07 KB

Contents

#include <algorithm>
#include <iterator>
#include <memory>

#include "cppunit/cppunit_proxy.h"

#if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
using namespace std;
#endif

class X
{
  public:
    X(int i_ = 0) : i(i_) {}
    ~X() {}
    operator int() const { return i; }

  private:
    int i;
};


//
// TestCase class
//
class RawriterTest : public CPPUNIT_NS::TestCase
{
  CPPUNIT_TEST_SUITE(RawriterTest);
  CPPUNIT_TEST(rawiter1);
  CPPUNIT_TEST_SUITE_END();

protected:
  void rawiter1();
};

CPPUNIT_TEST_SUITE_REGISTRATION(RawriterTest);

//
// tests implementation
//
void RawriterTest::rawiter1()
{
  allocator<X> a;
  typedef X* x_pointer;
  x_pointer save_p, p;
  p = a.allocate(5);
  save_p=p;
  raw_storage_iterator<X*, X> r(p);
  int i;
  for(i = 0; i < 5; i++)
    *r++ = X(i);

  CPPUNIT_ASSERT(*p++ == 0);
  CPPUNIT_ASSERT(*p++ == 1);
  CPPUNIT_ASSERT(*p++ == 2);
  CPPUNIT_ASSERT(*p++ == 3);
  CPPUNIT_ASSERT(*p++ == 4);

//#if defined (STLPORT) || defined (__GNUC__)
  a.deallocate(save_p, 5);
/*
#else
  a.deallocate(save_p);
#endif
*/

  CPPUNIT_ASSERT(true);
}

Version data entries

135 entries across 135 versions & 2 rubygems

Version Path
rhodes-7.6.0 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-7.5.1 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-7.4.1 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-7.1.17 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-6.2.0 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-6.0.11 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-5.5.18 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-5.5.17 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-5.5.15 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-5.5.0.22 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-5.5.2 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-5.5.0.7 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-5.5.0.3 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-5.5.0 platform/shared/stlport/test/unit/rawriter_test.cpp
tauplatform-1.0.3 platform/shared/stlport/test/unit/rawriter_test.cpp
tauplatform-1.0.2 platform/shared/stlport/test/unit/rawriter_test.cpp
tauplatform-1.0.1 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-3.5.1.12 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-3.3.5 platform/shared/stlport/test/unit/rawriter_test.cpp
rhodes-3.4.2 platform/shared/stlport/test/unit/rawriter_test.cpp