Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

G-API: eliminate std::rand() and RAND_MAX from tests#18929

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@alalek
Copy link
Member

Compilation warning (clang):

modules/gapi/test/common/gapi_parsers_tests_common.hpp:214:59: warning:implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-const-int-float-conversion]        it.confidence = static_cast<float>(std::rand()) / RAND_MAX;                                                        ~ ^~~~~~~~/usr/include/stdlib.h:86:18: note: expanded from macro 'RAND_MAX'#define RAND_MAX        2147483647                        ^~~~~~~~~~

// test that we can obtain it via RMat.as<T>() method
TEST(RMat, UsageInBackend) {
int i =std::rand();
int i =123456;
Copy link
Contributor

Choose a reason for hiding this comment

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

123456 is definitely a random number. Is call of cv::RNG() equal to call of rand()?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

randomization is not really necessary for this test case.

/cc@rgarnov

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering why you didn't use analogue in this case? And i don't mind 123456.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok

Copy link
Contributor

@mpashchenkovmpashchenkov left a comment

Choose a reason for hiding this comment

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

It seems logical about parsers.

@opencv-pushbotopencv-pushbot merged commit3c9d03c intoopencv:masterNov 26, 2020
@alalekalalek mentioned this pull requestNov 27, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@mpashchenkovmpashchenkovmpashchenkov approved these changes

Assignees

@mpashchenkovmpashchenkov

Projects

None yet

Milestone

4.5.1

Development

Successfully merging this pull request may close these issues.

3 participants

@alalek@mpashchenkov@opencv-pushbot

[8]ページ先頭

©2009-2025 Movatter.jp