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

Could not parse duration with ',' #143

Closed
cbsuh opened this issue May 10, 2017 · 2 comments
Closed

Could not parse duration with ',' #143

cbsuh opened this issue May 10, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@cbsuh
Copy link

cbsuh commented May 10, 2017

version: 0.10.0.777

[ OK ] Redis.ConnectDockerizedServer (4,656 ms)
Warning: Could not parse duration in line '[ OK ] Redis.ConnectDockerizedServer (4,656 ms)'

I guess that the cause is ',' among duration.

@csoltenborn csoltenborn self-assigned this May 10, 2017
@csoltenborn
Copy link
Owner

csoltenborn commented May 10, 2017

Thanks for your report! Weird - we haven't seen such values up to now. Two questions:

  • How long does this test take? Is it 4656ms (=4.656s) or 4.656ms (=0.004656s)?
  • What is your build environment? This is just out of curiosity - we'd like to know where that value comes from...

We are going to release version 0.10.1 pretty soon - if you answer within the next couple of hours, the fix for this will go into that version.

@jgefele
Copy link
Collaborator

jgefele commented May 10, 2017

In google test internally test times are represented by TimeInMillis:

  // Returns the elapsed time, in milliseconds.
  TimeInMillis elapsed_time() const { return elapsed_time_; }

which is just a 64-bit integer:

typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.

PrettyUnitTestResultPrinter::OnTestCaseEnd just printfs a string it's gotten from internal::StreamableToString(test_case.elapsed_time())

StreamableToString streams this integer into class Message which streams it into std::stringstream.

The output will always be an integer, no decimals.

So what @cbsuh sees is the number fourthousandsixhundredfiftysix in the current locale, i.e. with comma as thousands separator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants