Skip to content

test: Add test coverage to TSFN::New() overloads#1201

Merged
legendecas merged 4 commits intonodejs:mainfrom
JckXia:add_covg_to_tsfn_new_overloads
Nov 15, 2022
Merged

test: Add test coverage to TSFN::New() overloads#1201
legendecas merged 4 commits intonodejs:mainfrom
JckXia:add_covg_to_tsfn_new_overloads

Conversation

@JckXia
Copy link
Copy Markdown
Member

@JckXia JckXia commented Aug 27, 2022

Adding test coverage for TSFN::New overloads where we provide the async resource name and/or the async resource object but no finalizer callbacks.

@JckXia JckXia changed the title Add covg to tsfn new overloads test: Add covg to tsfn new overloads Aug 27, 2022
@JckXia JckXia changed the title test: Add covg to tsfn new overloads test: Add test coverage to TSFN::New() overloads Aug 27, 2022
@mhdawson mhdawson requested a review from KevinEady September 23, 2022 15:24
@KevinEady
Copy link
Copy Markdown
Contributor

Hi @JckXia ,

I took a look at this and have a few questions:

  1. This tests TypedThreadSafeFunction, do we have equivalent coverage for the non-typed ThreadSafeFunction...?
  2. I looked at all the TypedTSFN::New tests (including this PR) and I don't see these three... Maybe I overlooked them...?
    1. Callback [missing] Resource [missing] Finalizer [passed]
    2. Callback [missing] Resource [passed] Finalizer [passed]
    3. Callback [passed] Resource [missing] Finalizer [missing]

@JckXia
Copy link
Copy Markdown
Member Author

JckXia commented Sep 30, 2022

Hey @KevinEady,

For your first question, not at the moment. My plan was to complete coverage for TypedThreadSafeFunction and port some of these tests over late.

For your second question, I think I may have missed them and have also made a mistake in the test coverage doc for TSFN::New. Will update accordingly.

Edit: I think
[Callback [missing] Resource [passed] Finalizer [passed]] is covered here https://github.com/nodejs/node-addon-api/blob/main/test/typed_threadsafe_function/typed_threadsafe_function_ctx.cc#L49.

Copy link
Copy Markdown
Contributor

@KevinEady KevinEady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants