Example #1
0
    void addTestRW(const char* transport_name,
                   uint32_t totalSize,
                   GenericSizeGenerator wSizeGen,
                   GenericSizeGenerator rSizeGen,
                   GenericSizeGenerator wChunkSizeGen = 0,
                   GenericSizeGenerator rChunkSizeGen = 0,
                   uint32_t maxOutstanding = 0,
                   uint32_t expectedFailures = 0) {
        // adjust totalSize by the specified sizeMultiplier_ first
        totalSize = static_cast<uint32_t>(totalSize * sizeMultiplier_);

        std::ostringstream name;
        name << transport_name << "::test_rw(" << totalSize << ", " << wSizeGen.describe() << ", "
             << rSizeGen.describe() << ", " << wChunkSizeGen.describe() << ", "
             << rChunkSizeGen.describe() << ", " << maxOutstanding << ")";

        boost::unit_test::callback0<> test_func
            = apache::thrift::stdcxx::bind(test_rw<CoupledTransports>,
                                           totalSize,
                                           wSizeGen,
                                           rSizeGen,
                                           wChunkSizeGen,
                                           rChunkSizeGen,
                                           maxOutstanding);
        boost::unit_test::test_case* tc = boost::unit_test::make_test_case(test_func, name.str());
        suite_->add(tc, expectedFailures);
    }
Example #2
0
  void addTestRW(const char* transport_name,
                 uint32_t totalSize,
                 GenericSizeGenerator wSizeGen,
                 GenericSizeGenerator rSizeGen,
                 GenericSizeGenerator wChunkSizeGen = 0,
                 GenericSizeGenerator rChunkSizeGen = 0,
                 uint32_t maxOutstanding = 0,
                 uint32_t expectedFailures = 0) {
    // adjust totalSize by the specified sizeMultiplier_ first
    totalSize = static_cast<uint32_t>(totalSize * sizeMultiplier_);

    std::ostringstream name;
    name << transport_name << "::test_rw(" << totalSize << ", " << wSizeGen.describe() << ", "
         << rSizeGen.describe() << ", " << wChunkSizeGen.describe() << ", "
         << rChunkSizeGen.describe() << ", " << maxOutstanding << ")";

#if (BOOST_VERSION >= 105900)
    boost::function<void ()> test_func
#else
    boost::unit_test::callback0<> test_func
#endif
        = apache::thrift::stdcxx::bind(test_rw<CoupledTransports>,
                                       totalSize,
                                       wSizeGen,
                                       rSizeGen,
                                       wChunkSizeGen,
                                       rChunkSizeGen,
                                       maxOutstanding);
    suite_->add(MAKE_TEST_CASE(test_func, name.str()), expectedFailures);
  }