From 0e7483eb7b926e67db83632a5a5baf9c9b8d525f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Sun, 1 Dec 2019 11:41:25 -0400 Subject: [PATCH] Fix code format in tests PR-URL: https://github.com/nodejs/node-addon-api/pull/617 Reviewed-By: Gabriel Schulhof Reviewed-By: Chengzhong Wu Reviewed-By: Michael Dawson --- test/basic_types/array.cc | 8 ++++---- test/basic_types/array.js | 2 +- test/testUtil.js | 4 ++-- test/threadsafe_function/threadsafe_function_sum.cc | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/basic_types/array.cc b/test/basic_types/array.cc index fb0074c40..6482c61fd 100644 --- a/test/basic_types/array.cc +++ b/test/basic_types/array.cc @@ -5,9 +5,9 @@ using namespace Napi; Value CreateArray(const CallbackInfo& info) { if (info.Length() > 0) { size_t length = info[0].As().Uint32Value(); - return Array::New(info.Env(), length); + return Array::New(info.Env(), length); } else { - return Array::New(info.Env()); + return Array::New(info.Env()); } } @@ -19,13 +19,13 @@ Value GetLength(const CallbackInfo& info) { Value GetElement(const CallbackInfo& info) { Array array = info[0].As(); size_t index = info[1].As().Uint32Value(); - return array[index]; + return array[index]; } void SetElement(const CallbackInfo& info) { Array array = info[0].As(); size_t index = info[1].As().Uint32Value(); - array[index] = info[2].As(); + array[index] = info[2].As(); } Object InitBasicTypesArray(Env env) { diff --git a/test/basic_types/array.js b/test/basic_types/array.js index 925022a2d..38ccba448 100644 --- a/test/basic_types/array.js +++ b/test/basic_types/array.js @@ -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 diff --git a/test/testUtil.js b/test/testUtil.js index db2d700c4..402c5c91d 100644 --- a/test/testUtil.js +++ b/test/testUtil.js @@ -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]) { @@ -25,5 +25,5 @@ function runGCTests(tests, i, title) { } module.exports = { - runGCTests, + runGCTests, }; diff --git a/test/threadsafe_function/threadsafe_function_sum.cc b/test/threadsafe_function/threadsafe_function_sum.cc index bba57dd47..eac248816 100644 --- a/test/threadsafe_function/threadsafe_function_sum.cc +++ b/test/threadsafe_function/threadsafe_function_sum.cc @@ -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; }