Skip to content

Commit 9b42a13

Browse files
committed
Merge branch 'v1.3.0-release'
2 parents d2af9dc + f560fbd commit 9b42a13

File tree

3 files changed

+40
-55
lines changed

3 files changed

+40
-55
lines changed

src/stub_facility_tests.cc

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,60 +11,55 @@ using stubs::StubFacility;
1111
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1212
class StubFacilityTest : public ::testing::Test {
1313
protected:
14-
cyclus::TestContext tc_;
15-
StubFacility* src_facility_;
14+
cyclus::TestContext tc;
15+
StubFacility* facility;
1616

1717
virtual void SetUp() {
18-
src_facility_ = new StubFacility(tc_.get());
18+
facility = new StubFacility(tc.get());
1919
}
2020

21-
virtual void TearDown() {}
21+
virtual void TearDown() {
22+
delete facility;
23+
}
2224
};
2325

24-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
25-
TEST_F(StubFacilityTest, clone) {
26-
StubFacility* cloned_fac =
27-
dynamic_cast<StubFacility*> (src_facility_->Clone());
28-
}
29-
3026
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3127
TEST_F(StubFacilityTest, InitialState) {
3228
// Test things about the initial state of the facility here
3329
}
3430

3531
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3632
TEST_F(StubFacilityTest, Print) {
37-
EXPECT_NO_THROW(std::string s = src_facility_->str());
33+
EXPECT_NO_THROW(std::string s = facility->str());
3834
// Test StubFacility specific aspects of the print method here
3935
}
4036

4137
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4238
TEST_F(StubFacilityTest, Tick) {
43-
ASSERT_NO_THROW(src_facility_->Tick());
39+
ASSERT_NO_THROW(facility->Tick());
4440
// Test StubFacility specific behaviors of the Tick function here
4541
}
4642

4743
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4844
TEST_F(StubFacilityTest, Tock) {
49-
EXPECT_NO_THROW(src_facility_->Tock());
45+
EXPECT_NO_THROW(facility->Tock());
5046
// Test StubFacility specific behaviors of the Tock function here
5147
}
5248

53-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
49+
50+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
51+
// Do Not Touch! Below section required for connection with Cyclus
5452
cyclus::Agent* StubFacilityConstructor(cyclus::Context* ctx) {
5553
return new StubFacility(ctx);
5654
}
57-
5855
// Required to get functionality in cyclus agent unit tests library
5956
#ifndef CYCLUS_AGENT_TESTS_CONNECTED
6057
int ConnectAgentTests();
6158
static int cyclus_agent_tests_connected = ConnectAgentTests();
6259
#define CYCLUS_AGENT_TESTS_CONNECTED cyclus_agent_tests_connected
6360
#endif // CYCLUS_AGENT_TESTS_CONNECTED
64-
65-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
6661
INSTANTIATE_TEST_CASE_P(StubFac, FacilityTests,
6762
::testing::Values(&StubFacilityConstructor));
68-
6963
INSTANTIATE_TEST_CASE_P(StubFac, AgentTests,
7064
::testing::Values(&StubFacilityConstructor));
65+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

src/stub_inst_tests.cc

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,60 +12,54 @@ using stubs::StubInst;
1212
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1313
class StubInstTest : public ::testing::Test {
1414
protected:
15-
cyclus::TestContext tc_;
16-
StubInst* src_inst_;
15+
cyclus::TestContext tc;
16+
StubInst* inst;
1717

1818
virtual void SetUp() {
19-
src_inst_ = new StubInst(tc_.get());
19+
inst = new StubInst(tc.get());
2020
}
2121

22-
virtual void TearDown() {}
22+
virtual void TearDown() {
23+
delete inst;
24+
}
2325
};
2426

25-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
26-
TEST_F(StubInstTest, clone) {
27-
StubInst* cloned_fac = dynamic_cast<StubInst*> (src_inst_->Clone());
28-
}
29-
3027
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3128
TEST_F(StubInstTest, InitialState) {
3229
// Test things about the initial state of the inst here
3330
}
3431

3532
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3633
TEST_F(StubInstTest, Print) {
37-
EXPECT_NO_THROW(std::string s = src_inst_->str());
34+
EXPECT_NO_THROW(std::string s = inst->str());
3835
// Test StubInst specific aspects of the print method here
3936
}
4037

4138
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4239
TEST_F(StubInstTest, Tick) {
43-
int time = 1;
44-
EXPECT_NO_THROW(src_inst_->Tick());
40+
EXPECT_NO_THROW(inst->Tick());
4541
// Test StubInst specific behaviors of the handleTick function here
4642
}
4743

4844
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4945
TEST_F(StubInstTest, Tock) {
50-
int time = 1;
51-
EXPECT_NO_THROW(src_inst_->Tock());
46+
EXPECT_NO_THROW(inst->Tock());
5247
// Test StubInst specific behaviors of the handleTock function here
5348
}
5449

55-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
56-
cyclus::Agent* StubInstitutionConstructor(cyclus::Context* ctx) {
50+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
51+
// Do Not Touch! Below section required for connection with Cyclus
52+
cyclus::Agent* StubInstConstructor(cyclus::Context* ctx) {
5753
return new StubInst(ctx);
5854
}
59-
6055
// Required to get functionality in cyclus agent unit tests library
6156
#ifndef CYCLUS_AGENT_TESTS_CONNECTED
6257
int ConnectAgentTests();
6358
static int cyclus_agent_tests_connected = ConnectAgentTests();
6459
#define CYCLUS_AGENT_TESTS_CONNECTED cyclus_agent_tests_connected
6560
#endif // CYCLUS_AGENT_TESTS_CONNECTED
66-
67-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
6861
INSTANTIATE_TEST_CASE_P(StubInst, InstitutionTests,
69-
::testing::Values(&StubInstitutionConstructor));
62+
::testing::Values(&StubInstConstructor));
7063
INSTANTIATE_TEST_CASE_P(StubInst, AgentTests,
71-
::testing::Values(&StubInstitutionConstructor));
64+
::testing::Values(&StubInstConstructor));
65+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

src/stub_region_tests.cc

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,58 +10,54 @@ using stubs::StubRegion;
1010
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1111
class StubRegionTest : public ::testing::Test {
1212
protected:
13-
cyclus::TestContext tc_;
14-
StubRegion* src_region_;
13+
cyclus::TestContext tc;
14+
StubRegion* region;
1515

1616
virtual void SetUp() {
17-
src_region_ = new StubRegion(tc_.get());
17+
region = new StubRegion(tc.get());
1818
}
1919

20-
virtual void TearDown() {}
20+
virtual void TearDown() {
21+
delete region;
22+
}
2123
};
2224

23-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
24-
TEST_F(StubRegionTest, clone) {
25-
StubRegion* cloned_fac = dynamic_cast<StubRegion*> (src_region_->Clone());
26-
}
27-
2825
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2926
TEST_F(StubRegionTest, InitialState) {
3027
// Test things about the initial state of the region here
3128
}
3229

3330
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3431
TEST_F(StubRegionTest, Print) {
35-
EXPECT_NO_THROW(std::string s = src_region_->str());
32+
EXPECT_NO_THROW(std::string s = region->str());
3633
// Test StubRegion specific aspects of the print method here
3734
}
3835

3936
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4037
TEST_F(StubRegionTest, Tick) {
41-
EXPECT_NO_THROW(src_region_->Tick());
38+
EXPECT_NO_THROW(region->Tick());
4239
// Test StubRegion specific behaviors of the handleTick function here
4340
}
4441

4542
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4643
TEST_F(StubRegionTest, Tock) {
47-
EXPECT_NO_THROW(src_region_->Tock());
44+
EXPECT_NO_THROW(region->Tock());
4845
// Test StubRegion specific behaviors of the handleTock function here
4946
}
5047

51-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
48+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
49+
// Do Not Touch! Below section required for connection with Cyclus
5250
cyclus::Agent* StubRegionConstructor(cyclus::Context* ctx) {
5351
return new StubRegion(ctx);
5452
}
55-
5653
// Required to get functionality in cyclus agent unit tests library
5754
#ifndef CYCLUS_AGENT_TESTS_CONNECTED
5855
int ConnectAgentTests();
5956
static int cyclus_agent_tests_connected = ConnectAgentTests();
6057
#define CYCLUS_AGENT_TESTS_CONNECTED cyclus_agent_tests_connected
6158
#endif // CYCLUS_AGENT_TESTS_CONNECTED
62-
63-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
6459
INSTANTIATE_TEST_CASE_P(StubRegion, RegionTests,
6560
::testing::Values(&StubRegionConstructor));
6661
INSTANTIATE_TEST_CASE_P(StubRegion, AgentTests,
6762
::testing::Values(&StubRegionConstructor));
63+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

0 commit comments

Comments
 (0)