Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile_robotics
wolf_projects
wolf_lib
wolf
Commits
48026fb9
Commit
48026fb9
authored
5 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Update gtest_time_stamp.cpp
parent
461108d7
No related branches found
No related tags found
1 merge request
!343
WIP: Resolve "Complete state vector new data structure?"
Pipeline
#5142
passed
5 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/gtest_time_stamp.cpp
+26
-18
26 additions, 18 deletions
test/gtest_time_stamp.cpp
with
26 additions
and
18 deletions
test/gtest_time_stamp.cpp
+
26
−
18
View file @
48026fb9
...
...
@@ -3,7 +3,7 @@
#include
<thread>
TEST
(
WolfTest
TimeStamp
,
TimeStamp
InitNow
)
TEST
(
TimeStamp
,
InitNow
)
{
wolf
::
TimeStamp
start
;
...
...
@@ -23,10 +23,10 @@ TEST(WolfTestTimeStamp, TimeStampInitNow)
ASSERT_LT
(
start
.
get
(),
time_stamp
.
get
());
// PRINTF("All good at
WolfTest
TimeStamp::
TimeStamp
InitNow !\n");
// PRINTF("All good at TimeStamp::InitNow !\n");
}
TEST
(
WolfTest
TimeStamp
,
TimeStamp
InitScalar
)
TEST
(
TimeStamp
,
InitScalar
)
{
double
val
(
101010
);
...
...
@@ -41,10 +41,10 @@ TEST(WolfTestTimeStamp, TimeStampInitScalar)
ASSERT_STREQ
(
"101010.000000000"
,
ss
.
str
().
c_str
());
// PRINTF("All good at
WolfTest
TimeStamp::
TimeStamp
InitScalar !\n");
// PRINTF("All good at TimeStamp::InitScalar !\n");
}
TEST
(
WolfTest
TimeStamp
,
TimeStamp
InitScalarSecNano
)
TEST
(
TimeStamp
,
InitScalarSecNano
)
{
double
sec
(
101010
);
double
nano
(
202020
);
...
...
@@ -63,10 +63,10 @@ TEST(WolfTestTimeStamp, TimeStampInitScalarSecNano)
ASSERT_STREQ
(
"101010.000202020"
,
ss
.
str
().
c_str
());
// PRINTF("All good at
WolfTest
TimeStamp::
TimeStamp
InitScalarSecNano !\n");
// PRINTF("All good at TimeStamp::InitScalarSecNano !\n");
}
TEST
(
WolfTest
TimeStamp
,
TimeStamp
SetNow
)
TEST
(
TimeStamp
,
SetNow
)
{
wolf
::
TimeStamp
t1
;
wolf
::
TimeStamp
t2
(
t1
);
...
...
@@ -82,7 +82,7 @@ TEST(WolfTestTimeStamp, TimeStampSetNow)
ASSERT_LT
(
t1
,
t2
);
}
TEST
(
WolfTest
TimeStamp
,
TimeStamp
SetScalar
)
TEST
(
TimeStamp
,
SetScalar
)
{
double
val
(
101010.000202020
);
...
...
@@ -99,7 +99,7 @@ TEST(WolfTestTimeStamp, TimeStampSetScalar)
ASSERT_STREQ
(
"101010.000202020"
,
ss
.
str
().
c_str
());
}
TEST
(
WolfTest
TimeStamp
,
TimeStamp
SetSecNano
)
TEST
(
TimeStamp
,
SetSecNano
)
{
unsigned
long
int
sec
(
101010
);
unsigned
long
int
nano
(
202020
);
...
...
@@ -113,7 +113,7 @@ TEST(WolfTestTimeStamp, TimeStampSetSecNano)
ASSERT_EQ
(
start
.
getNanoSeconds
(),
nano
);
}
TEST
(
WolfTest
TimeStamp
,
TimeStamp
Equality
)
TEST
(
TimeStamp
,
Equality
)
{
wolf
::
TimeStamp
start
;
...
...
@@ -132,10 +132,10 @@ TEST(WolfTestTimeStamp, TimeStampEquality)
ASSERT_EQ
(
time_stamp
.
get
(),
start
.
get
());
// PRINTF("All good at
WolfTest
TimeStamp::
TimeStamp
Equality !\n");
// PRINTF("All good at TimeStamp::Equality !\n");
}
TEST
(
WolfTest
TimeStamp
,
TimeStamp
Inequality
)
TEST
(
TimeStamp
,
Inequality
)
{
wolf
::
TimeStamp
start
;
...
...
@@ -155,10 +155,10 @@ TEST(WolfTestTimeStamp, TimeStampInequality)
ASSERT_GE
(
time_stamp
,
start
);
ASSERT_GE
(
start
,
start
);
// PRINTF("All good at
WolfTest
TimeStamp::
TimeStamp
Inequality !\n");
// PRINTF("All good at TimeStamp::Inequality !\n");
}
TEST
(
WolfTest
TimeStamp
,
TimeStamp
Substraction
)
TEST
(
TimeStamp
,
Substraction
)
{
wolf
::
TimeStamp
t1
;
wolf
::
TimeStamp
t2
(
t1
);
...
...
@@ -171,7 +171,7 @@ TEST(WolfTestTimeStamp, TimeStampSubstraction)
ASSERT_EQ
(
t1
-
t2
,
-
dt
);
}
TEST
(
WolfTest
TimeStamp
,
TimeStamp
Adding
)
TEST
(
TimeStamp
,
Adding
)
{
wolf
::
TimeStamp
t1
,
t3
;
wolf
::
TimeStamp
t2
(
t1
);
...
...
@@ -183,7 +183,7 @@ TEST(WolfTestTimeStamp, TimeStampAdding)
ASSERT_EQ
(
t2
,
t3
);
}
TEST
(
WolfTest
TimeStamp
,
TimeStamp
OperatorOstream
)
TEST
(
TimeStamp
,
OperatorOstream
)
{
wolf
::
TimeStamp
t
(
5
);
double
dt
=
1e-4
;
...
...
@@ -196,10 +196,10 @@ TEST(WolfTestTimeStamp, TimeStampOperatorOstream)
ASSERT_EQ
(
ss1
.
str
(),
ss2
.
str
());
// PRINTF("All good at
WolfTest
TimeStamp::
TimeStamp
OperatorOstream !\n");
// PRINTF("All good at TimeStamp::OperatorOstream !\n");
}
TEST
(
WolfTest
TimeStamp
,
TimeStamp
SecNanoSec
)
TEST
(
TimeStamp
,
SecNanoSec
)
{
unsigned
long
int
sec
=
5
;
unsigned
long
int
nano
=
1e5
;
...
...
@@ -212,6 +212,14 @@ TEST(WolfTestTimeStamp, TimeStampSecNanoSec)
ASSERT_EQ
(
t2
.
getNanoSeconds
(),
nano
);
}
TEST
(
TimeStamp
,
std_min_max
)
{
wolf
::
TimeStamp
t1
(
1.0
),
t2
(
2.0
);
ASSERT_TRUE
(
std
::
min
(
t1
,
t2
)
==
t1
);
ASSERT_TRUE
(
std
::
max
(
t1
,
t2
)
==
t2
);
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment