Created
April 25, 2014 13:16
-
-
Save abargnesi/11289193 to your computer and use it in GitHub Desktop.
invalid pointer tests in redlander
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'redlander' | |
include Redlander | |
class Node | |
def self.finalize_node(rdf_node_ptr) | |
proc { | |
# XXX Uncommenting the following line seems to invalidate the "rdf_node_ptr". Then the librdf_free_node call always succeeds without error. | |
#Redland.librdf_node_get_type(rdf_node_ptr) | |
Redland.librdf_free_node(rdf_node_ptr) | |
} | |
end | |
end | |
200.times do | |
subject = Node.new(URI.parse("http://www.example.org/subject")) | |
predicate = Node.new(URI.parse("http://www.example.org/predicate")) | |
object = Node.new(URI.parse("http://www.example.org/object")) | |
Statement.new({ | |
subject: subject, | |
predicate: predicate, | |
object: object | |
}) | |
Statement.new({ | |
subject: Node.new(URI.parse("http://www.example.org/subject")), | |
predicate: Node.new(URI.parse("http://www.example.org/predicate")), | |
object: Node.new(URI.parse("http://www.example.org/object")) | |
}) | |
end | |
# vim: ts=2 sw=2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested on ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]