Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[test] update test case for building native modules(node-dtrace-provi…

…der, ref, node-lame)
  • Loading branch information...
commit 3628e54bfc2a41e907ad3c332991387fcd50bf5b 1 parent e13fa60
@kingFighter kingFighter authored
View
29 tests/automatic_tests/node/mocha_test.js
@@ -145,6 +145,35 @@ describe('module', function() {
it('native modules without handle scope', function() {
require('./node_modules/nw_test_loop_without_handle');
});
+
+ it('dtrace-provider should work', function() {
+ var d = require('./node_modules/dtrace-provider');
+ var dtp = d.createDTraceProvider("nodeapp");
+ var p1 = dtp.addProbe("probe1", "int", "int");
+ var p2 = dtp.addProbe("probe2", "char *");
+ dtp.enable();
+ });
+
+ it('ref should work', function() {
+ var ref = require('ref')
+ var buf = new Buffer(4)
+ buf.writeInt32LE(12345, 0)
+ console.log(buf.address()) // ← 140362165284824
+ buf.type = ref.types.int
+ assert.equal(buf.deref(), 12345) // ← 12345
+ var one = buf.ref()
+ assert.equal(one.deref().deref(), 12345) // ← 12345
+ });
+
+ it('lame should work', function() {
+ var lame = require('lame');
+ // create the Encoder instance
+ var encoder = new lame.Encoder({
+ channels: 2, // 2 channels (left and right)
+ bitDepth: 16, // 16-bit samples
+ sampleRate: 44100 // 44,100 Hz sample rate
+ });
+ });
});
});
View
3  tests/package.json
@@ -20,6 +20,9 @@
"mocha": "1.7.4",
"nw_test_loop": "git+https://github.com/owenc4a4/nw_test_loop_without_handle.git",
"bignum": "git+https://github.com/owenc4a4/bignum.git",
+ "node-dtrace-provider": "git+https://github.com/chrisa/node-dtrace-provider.git",
+ "ref": "git+https://github.com/TooTallNate/ref.git",
+ "node-lame": "git+https://github.com/TooTallNate/node-lame.git",
"fs-extra": "*"
},
"user-agent": "%name/%nwver/%ver/%webkit_ver/%osinfo",
View
3  tools/build_native_modules.py
@@ -4,6 +4,9 @@
native_modules = ['nw_test_loop_without_handle',
'bignum',
+ 'dtrace-provider',
+ 'ref',
+ 'lame',
];
script_dir = os.path.dirname(__file__)
Please sign in to comment.
Something went wrong with that request. Please try again.