Sha256: 0ef8a958337f3c948d57e86ea9777aad43466a0ebb5b0f576cf7de14a33f3d6a

Contents?: true

Size: 859 Bytes

Versions: 1

Compression:

Stored size: 859 Bytes

Contents

require 'test_helper'

context "Allocation Strategies" do

  def setup
    if !defined?(@@alloc_strat_built)
      super
      @@alloc_strat_built = true 
      Extension.new "alloc_strats" do |e|
        e.sources full_dir("headers/alloc_strats.h")
        node = e.namespace "alloc_strats"
      end
    end
  end

  # The test here is simple because if the allocation
  # strategies aren't properly defined, the extension
  # won't even compile. GCC will complain about trying to
  # instantiate an object with a non-public constructor
  # and it all dies.
  specify "properly figures out what allocation to do" do
    assert_nothing_raised LoadError  do
      require 'alloc_strats'
    end 

    # Private constructor, public destructor
    assert defined?(NoConstructor)

    # Private constructor and destructor
    assert defined?(Neither)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rbplusplus-0.9.1 test/allocation_strategies_test.rb