Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91268185
fixture_test.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 9, 12:39
Size
656 B
Mime Type
text/x-c
Expires
Mon, Nov 11, 12:39 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22233179
Attached To
R7571 SP4E-TB-TL-FR
fixture_test.cc
View Options
#include <algorithm>
#include <cmath>
#include <exception>
#include <gtest/gtest.h>
#include <numeric>
#include <vector>
struct
Particle
{
double
position
[
3
];
double
velocity
[
3
];
double
force
[
3
];
};
struct
System
{
std
::
vector
<
Particle
>
particles
;
};
// Fixture class
class
SystemTest
:
public
::
testing
::
Test
{
protected
:
void
SetUp
()
override
{
// push 10 particles
system
.
particles
.
resize
(
10
);
}
void
TearDown
()
override
{
// clear particles
system
.
particles
.
clear
();
}
System
system
;
};
// Fixture test
TEST_F
(
SystemTest
,
IsNotEmpty
)
{
// check the size of container
EXPECT_EQ
(
system
.
particles
.
size
(),
10
);
}
Event Timeline
Log In to Comment