-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9ecf75
commit 2efe63e
Showing
5 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
var callback = require("./callback"); | ||
|
||
if (callback.foo(2) !== 2) { | ||
throw new Error("Failed."); | ||
} | ||
if (callback.A_bar(2) !== 4) { | ||
throw new Error("Failed."); | ||
} | ||
if (callback.foobar(3, callback.foo) != callback.foo(3)) { | ||
throw new Error("Failed."); | ||
} | ||
if (callback.foobar(3, foo) != callback.foo(3)) { | ||
throw new Error("Failed."); | ||
} | ||
if (callback.foobar(3, callback.A_bar) != callback.A_bar(3)) { | ||
throw new Error("Failed."); | ||
} | ||
if (callback.foobar(3, callback.foof) != callback.foof(3)) { | ||
throw new Error("Failed."); | ||
} | ||
if (callback.foobar_i(3, callback.foo_i) != callback.foo_i(3)) { | ||
throw new Error("Failed."); | ||
} | ||
if (callback.foobar_d(3.5, callback.foo_d) != callback.foo_d(3.5)) { | ||
throw new Error("Failed."); | ||
} | ||
var a = new callback.A(); | ||
if (callback.foobarm(3, a, callback.A.foom_cb_ptr) != a.foom(3)) { | ||
throw new Error("Failed."); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var disown = require("./disown"); | ||
|
||
var a = new disown.A(); | ||
var tmp = a.thisown; | ||
a.thisown = 0 | ||
if (a.thisown) { | ||
throw new Error("Failed."); | ||
} | ||
a.thisown = 1 | ||
if (!a.thisown) { | ||
throw new Error("Failed."); | ||
} | ||
a.thisown = tmp | ||
if (a.thisown != tmp) { | ||
throw new Error("Failed."); | ||
} | ||
|
||
var b = new disown.B(); | ||
b.acquire(a); | ||
if (a.thisown) { | ||
throw new Error("Failed."); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var dynamic_cast = require("./dynamic_cast"); | ||
|
||
var f = new dynamic_cast.Foo(); | ||
var b = new dynamic_cast.Bar(); | ||
|
||
var x = f.blah(); | ||
var y = b.blah(); | ||
|
||
var a = dynamic_cast.do_test(y); | ||
if (a != "Bar::test") { | ||
throw new Error("Failed."); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
var empty = require("./empty"); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
var varargs = require("./varargs"); | ||
|
||
if (varargs.test("Hello") != "Hello") { | ||
throw new Error("Failed"); | ||
} | ||
|
||
var f = new varargs.Foo("Greetings") | ||
if (f.str != "Greetings") { | ||
throw new Error("Failed"); | ||
} | ||
|
||
if (f.test("Hello") != "Hello") { | ||
throw new Error("Failed"); | ||
} | ||
|
||
if (varargs.test_def("Hello",1) != "Hello") { | ||
throw new Error("Failed"); | ||
} | ||
|
||
if (varargs.test_def("Hello") != "Hello") { | ||
throw new Error("Failed"); | ||
} | ||
|
||
if (varargs.test_plenty("Hello") != "Hello") { | ||
throw new Error("Failed"); | ||
} | ||
|
||
if (varargs.test_plenty("Hello", 1) != "Hello") { | ||
throw new Error("Failed"); | ||
} | ||
|
||
if (varargs.test_plenty("Hello", 1, 2) != "Hello") { | ||
throw new Error("Failed"); | ||
} | ||
|
||
var thrown = false; | ||
try { | ||
varargs.test_plenty("Hello", 1, 2, 3); | ||
} catch (err) { | ||
thrown = true; | ||
} | ||
if (!thrown) { | ||
throw new Error("Failed"); | ||
} |