Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update test
  • Loading branch information
maxkorp committed Oct 22, 2014
commit 970ff0db5c87a648169e71a4d8b5a898ab3b7cee
6 changes: 3 additions & 3 deletions generate/partials/sync_function.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

{%partial doc .%}
NAN_METHOD({{ cppClassName }}::{{ cppFunctionName }}) {
NanScope();
//NanScope();
{%partial guardArguments .%}

{%each .|returnsInfo 'true' as _return %}
Expand Down Expand Up @@ -36,7 +36,7 @@ from_{{ arg.name }}
{%if not arg.lastArg %},{%endif%}
{%endeach%}
);

/*
{%each args|argsInfo as arg %}
{%if arg.isCppClassStringOrArray %}
{%if arg.freeFunctionName %}
Expand All @@ -46,7 +46,7 @@ from_{{ arg.name }}
{%endif%}
{%endif%}
{%endeach%}

*/
{%if return.isErrorCode %}
if (result != GIT_OK) {
{%each args|argsInfo as arg %}
Expand Down
62 changes: 22 additions & 40 deletions test/tests/revwalk.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,47 +58,29 @@ describe("Revwalk", function() {
});
});

it("doesnt segfault when accessing commit.author() twice", function(done) {
if (!global.gc) {
assert(global.gc, 'manual garbage collection is not enabled')
}
this.timeout(10000);

function wait(time) {
var then = time + new Date().getTime();
while (then > 0 + new Date().getTime()) { }
}

try {
{

return Repository.open(reposPath).then(function(repository) {
try {
var walker = repository.createRevWalk();
repository.getMaster().then(function(master) {
try {
walker.walk(master, function(error, commit) {
commit.author().name();
commit.author().email();
global.gc();
});
if (global.gc) {
it("doesnt segfault when accessing commit.author() twice", function(done) {
this.timeout(10000);
return Repository.open(reposPath).then(function(repository) {
var walker = repository.createRevWalk();
repository.getMaster().then(function(master) {
var did = false;
walker.walk(master, function(error, commit) {
for (var i = 0; i < 1000; i++) {
if (true) {
commit.author().name();
commit.author().email();
}
catch( e) {
done(e);
}

});
}
catch(e) {
done(e);
}
global.gc();
}
if (!did) {
done();
did = true;
}
});
});
}
done();
}
catch(e) {
done(e);
}
});
});
});
}

});