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

Fix for multiple use. #19

Merged
merged 2 commits into from
May 9, 2019
Merged

Fix for multiple use. #19

merged 2 commits into from
May 9, 2019

Conversation

fujiwara
Copy link
Contributor

@fujiwara fujiwara commented May 9, 2019

Hi.

This PR ensures to apply_prof() called only once per profiler package.
When use Devel::KYTProf called multiple times, Profiler::DBI fails tests as below.

t/dbi.t ...................... 1/?
#   Failed test at t/dbi.t line 29.
#                   'Use of uninitialized value in sprintf at /Users/fujiwara/src/github.com/fujiwara/perl5-devel-kytprof/.build/oJfbj5NQ/blib/lib/Devel/KYTProf.pm line 140.
# Use of uninitialized value in sprintf at /Users/fujiwara/src/github.com/fujiwara/perl5-devel-kytprof/.build/oJfbj5NQ/blib/lib/Devel/KYTProf.pm line 140.
#     0.251 ms  [DBI::st]    (1 rows)  | main:27
# '
#     doesn't match '(?^:\[DBI::st\]  insert into mock \(id, name\) values \(\?,\?\) \(bind: 1, nekokak\) \(1 rows\)  \|)'

#   Failed test at t/dbi.t line 44.
#                   'Use of uninitialized value in sprintf at /Users/fujiwara/src/github.com/fujiwara/perl5-devel-kytprof/.build/oJfbj5NQ/blib/lib/Devel/KYTProf.pm line 140.
# Use of uninitialized value in sprintf at /Users/fujiwara/src/github.com/fujiwara/perl5-devel-kytprof/.build/oJfbj5NQ/blib/lib/Devel/KYTProf.pm line 140.
#     0.075 ms  [DBI::st]    (1 rows)  | main:42
# '
#     doesn't match '(?^:\[DBI::st\]  insert into mock \(id, name\) values \(\?,\?\) \(bind: 2, onishi\) \(1 rows\)  \|)'
# Looks like you failed 2 tests of 2.

@Songmu
Copy link
Collaborator

Songmu commented May 9, 2019

Indeed, I thought this is a needed feature.
Thank you.

@Songmu Songmu merged commit 6abdcf2 into onishi:master May 9, 2019
@Songmu
Copy link
Collaborator

Songmu commented May 9, 2019

Released as 0.9992.

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.

None yet

2 participants