Permalink
Browse files

Add some tests and update the NCI file for the new dev API

This commit uses the API on the 'development' branch of libgit2, adds
a test which actually gets far enough for libgit2 to core dump Parrot
in git_repository_open (repo_out=0x0, path=0x13f5538 "") at /home/leto/git/libgit2/src/repository.c:347
  • Loading branch information...
1 parent 5d32e71 commit e968f7639f2908e04a41c7b65f32873912324744 @leto leto committed Jul 11, 2011
Showing with 51 additions and 17 deletions.
  1. +3 −0 Makefile
  2. +37 −12 src/git2.nci
  3. +11 −5 t/001_load.pir
View
@@ -7,3 +7,6 @@ nci:
pbc:
parrot -o src/git2.pbc src/git2.pir
+
+clean:
+ -rm src/*.pbc src/git2.nci
View
@@ -37,13 +37,14 @@ i git_config_open_ondisk p # git_config_open_ondisk
i git_config_find_global p # git_config_find_global
i git_config_new p # git_config_new
v git_config_free p # git_config_free
+i git_config_del p # git_config_del
i git_config_get_long p # git_config_get_long
i git_config_get_string p # git_config_get_string
i git_config_set_int p # git_config_set_int
i git_config_set_long p # git_config_set_long
i git_config_set_bool p # git_config_set_bool
-i git_config_foreach p # git_config_foreach
p git_strerror i # git_strerror
+v git_clearerror v # git_clearerror
p git_lasterror v # git_lasterror
i git_index_entry_stage v # git_index_entry_stage
i git_index_add2 p # git_index_add2
@@ -55,6 +56,7 @@ i git_index_find p # git_index_find
p git_index_get p # git_index_get
i git_index_open p # git_index_open
i git_index_write p # git_index_write
+v git_index_uniq p # git_index_uniq
i git_index_add p # git_index_add
i git_index_entrycount_unmerged p # git_index_entrycount_unmerged
i git_index_entrycount p # git_index_entrycount
@@ -78,6 +80,7 @@ i git_odb_object_size p # git_odb_object_size
i git_odb_add_alternate p # git_odb_add_alternate
i git_odb_write p # git_odb_write
v git_odb_object_close p # git_odb_object_close
+i git_odb_hashfile p # git_odb_hashfile
i git_odb_new p # git_odb_new
v git_odb_close p # git_odb_close
i git_odb_read_header i # git_odb_read_header
@@ -95,31 +98,47 @@ v git_oid_fmt p # git_oid_fmt
i git_oid_fromstr p # git_oid_fromstr
i git_oid_cmp v # git_oid_cmp
p git_oid_allocfmt v # git_oid_allocfmt
+i git_oid_fromstrn p # git_oid_fromstrn
p git_oid_to_string p # git_oid_to_string
v git_oid_cpy p # git_oid_cpy
v git_oid_pathfmt p # git_oid_pathfmt
-i git_reference_create_oid_f p # git_reference_create_oid_f
-i git_reference_rename_f p # git_reference_rename_f
+i git_reflog_write p # git_reflog_write
+i git_reflog_entrycount v # git_reflog_entrycount
+v git_reflog_free v # git_reflog_free
+i git_reflog_read v # git_reflog_read
+p git_reflog_entry_msg v # git_reflog_entry_msg
+p git_reflog_entry_oidold v # git_reflog_entry_oidold
+p git_reflog_entry_oidnew v # git_reflog_entry_oidnew
+p git_reflog_entry_committer v # git_reflog_entry_committer
+v git_reflog_entry_byindex v # git_reflog_entry_byindex
+i git_reference_rename p # git_reference_rename
+i git_reference_lookup p # git_reference_lookup
+p git_reference_owner p # git_reference_owner
+i git_reference_resolve p # git_reference_resolve
+i git_reference_create_oid p # git_reference_create_oid
+i git_reference_create_symbolic p # git_reference_create_symbolic
i git_reference_set_target p # git_reference_set_target
p git_reference_type p # git_reference_type
i git_reference_delete p # git_reference_delete
i git_reference_set_oid p # git_reference_set_oid
p git_reference_oid p # git_reference_oid
-i git_reference_create_symbolic_f p # git_reference_create_symbolic_f
+p git_reference_name p # git_reference_name
+i git_reference_listall p # git_reference_listall
i git_reference_packall p # git_reference_packall
p git_reference_target p # git_reference_target
i git_reference_foreach p # git_reference_foreach
-i git_reference_lookup p # git_reference_lookup
-i git_reference_rename p # git_reference_rename
-i git_reference_resolve p # git_reference_resolve
-p git_reference_owner p # git_reference_owner
-i git_reference_create_symbolic p # git_reference_create_symbolic
-i git_reference_create_oid p # git_reference_create_oid
-p git_reference_name p # git_reference_name
-i git_reference_listall p # git_reference_listall
+i git_remote_ls v # git_remote_ls
+p git_remote_name v # git_remote_name
+v git_remote_fetchspec v # git_remote_fetchspec
+i git_remote_connect v # git_remote_connect
+i git_remote_get v # git_remote_get
+v git_remote_free v # git_remote_free
+p git_remote_url v # git_remote_url
i git_repository_is_empty p # git_repository_is_empty
i git_repository_open3 ppppp # git_repository_open3
+i git_repository_head_orphan p # git_repository_head_orphan
i git_repository_open p # git_repository_open
+i git_repository_head_detached p # git_repository_head_detached
p git_repository_database p # git_repository_database
i git_repository_open2 ppppp # git_repository_open2
i git_repository_index p # git_repository_index
@@ -141,13 +160,19 @@ p git_signature_now v # git_signature_now
v git_signature_free p # git_signature_free
p git_signature_dup v # git_signature_dup
p git_signature_new v # git_signature_new
+i git_status_file v # git_status_file
+i git_status_foreach p # git_status_foreach
p git_tag_name p # git_tag_name
p git_tag_id p # git_tag_id
p git_tag_tagger p # git_tag_tagger
p git_tag_type p # git_tag_type
i git_tag_target p # git_tag_target
p git_tag_message p # git_tag_message
p git_tag_target_oid p # git_tag_target_oid
+i git_transport_connect v # git_transport_connect
+i git_transport_add v # git_transport_add
+i git_transport_new v # git_transport_new
+i git_transport_ls vv # git_transport_ls
i git_treebuilder_insert p # git_treebuilder_insert
v git_treebuilder_clear p # git_treebuilder_clear
p git_tree_entry_type v # git_tree_entry_type
View
@@ -1,19 +1,25 @@
+#/usr/bin/env parrot
.sub 'main' :main :load :init
.include 'test_more.pir'
- load_bytecode "src/git2.pbc"
+ plan(3)
+
+ load_bytecode "./src/git2.pbc"
.local pmc lib
- loadlib lib, 'libgit2.so'
- plan(1)
+
+ loadlib lib, '/usr/local/lib/libgit2.so'
+ isa_ok(lib, 'ParrotLibrary')
ok(1,"Loaded git2.pbc")
test_git_repo_open(lib)
.end
.sub test_git_repo_open
.param pmc lib
- .local pmc nci
+ .local pmc nci, repo
+ repo = new ['UnManagedStruct']
dlfunc nci, lib, 'git_repository_open', 'ip'
- $P1 = nci($P2)
+ isa_ok(nci, 'NCI')
+ $P1 = nci(repo)
isa_ok($P1, 'Integer')
.end

0 comments on commit e968f76

Please sign in to comment.