Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Nov 15, 2022

Conversation

JckXia
Copy link
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
@KevinEady
Copy link
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
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
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