-
Notifications
You must be signed in to change notification settings - Fork 0
/
addFun.test.js
55 lines (49 loc) · 1.67 KB
/
addFun.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
var getBass = require("../tools/getBass");
const path = require("path");
var getPlatformDependenciesForOneFile = require("../tools/getPlatformDependenciesForOneFile");
var basslib;
test("Bass generation working ? ", () => {
expect(() => {
basslib = getBass({
silent: true,
generatedFfiFunDeclaration: {
bass: {
ffiFunDeclaration: {
BASS_IsStarted: ["bool", []],
},
},
webm: getPlatformDependenciesForOneFile(
{
BASS_WEBM_StreamCreateURL: [
"int",
["string", "int", "int", "pointer", "pointer", "int"],
],
},
path.join(__dirname, "lib", "macOs", "libbasswebm.dylib"),
path.join(__dirname, "lib", "win32", "basswebm.dll"),
path.join(__dirname, "lib", "win64", "basswebm.dll"),
path.join(__dirname, "lib", "linux32", "libbasswebm.so"),
path.join(__dirname, "lib", "linux64", "libbasswebm.so")
),
},
});
}).not.toThrowError();
});
// const os = require("os");
// if (os.platform() !== "darwin") {
test("Auto enable all available libs", () => {
expect(() => {
// basslib.EnableWebm(true);
basslib.EnableAllAvailable(true); // I test with it to check that it is effectively added in the auto enable list. But the up line would be as fine.
}).not.toThrowError();
});
test("test full new lib file linking", () => {
expect(basslib.BASS_WEBM_StreamCreateURL()).toBe(0);
});
test("Is bass well loaded?", () => {
expect(basslib.BASS_GetVersion()).toBe(33820416);
});
// }
test("test add a single fun to base lib bass", () => {
expect(basslib.BASS_IsStarted()).toBe(false);
});