Skip to content

Commit

Permalink
Fix code format in tests
Browse files Browse the repository at this point in the history
PR-URL: #617
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
tniessen authored and Gabriel Schulhof committed Dec 14, 2019
1 parent 6a06463 commit 0e7483e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions test/basic_types/array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ using namespace Napi;
Value CreateArray(const CallbackInfo& info) {
if (info.Length() > 0) {
size_t length = info[0].As<Number>().Uint32Value();
return Array::New(info.Env(), length);
return Array::New(info.Env(), length);
} else {
return Array::New(info.Env());
return Array::New(info.Env());
}
}

Expand All @@ -19,13 +19,13 @@ Value GetLength(const CallbackInfo& info) {
Value GetElement(const CallbackInfo& info) {
Array array = info[0].As<Array>();
size_t index = info[1].As<Number>().Uint32Value();
return array[index];
return array[index];
}

void SetElement(const CallbackInfo& info) {
Array array = info[0].As<Array>();
size_t index = info[1].As<Number>().Uint32Value();
array[index] = info[2].As<Value>();
array[index] = info[2].As<Value>();
}

Object InitBasicTypesArray(Env env) {
Expand Down
2 changes: 1 addition & 1 deletion test/basic_types/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function test(binding) {
assert.strictEqual(binding.basic_types_array.getLength(array), 0);

// create array with length
const arrayWithLength = binding.basic_types_array.createArray(10);
const arrayWithLength = binding.basic_types_array.createArray(10);
assert.strictEqual(binding.basic_types_array.getLength(arrayWithLength), 10);

// set function test
Expand Down
4 changes: 2 additions & 2 deletions test/testUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// with an async delay and GC call between each.
function runGCTests(tests, i, title) {
if (!i) {
i = 0;
i = 0;
}

if (tests[i]) {
Expand All @@ -25,5 +25,5 @@ function runGCTests(tests, i, title) {
}

module.exports = {
runGCTests,
runGCTests,
};
2 changes: 1 addition & 1 deletion test/threadsafe_function/threadsafe_function_sum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void FinalizerCallback(Napi::Env env, TestData* finalizeData){
for (size_t i = 0; i < finalizeData->threads.size(); ++i) {
finalizeData->threads[i].join();
}
finalizeData->deferred.Resolve(Boolean::New(env,true));
finalizeData->deferred.Resolve(Boolean::New(env, true));
delete finalizeData;
}

Expand Down

0 comments on commit 0e7483e

Please sign in to comment.