Skip to content

Commit

Permalink
add idempotence test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdonahue authored and shelhamer committed Feb 23, 2014
1 parent bf5e75e commit bb8e0cd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/caffe/test/test_split_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ class SplitLayerInsertionTest : public ::testing::Test {
SplitLayerInsertionTest() { };
void RunInsertionTest(
const string& input_param_string, const string& output_param_string) {
// Test that insert_splits called on the proto specified by
// input_param_string results in the proto specified by
// output_param_string.
NetParameter input_param;
CHECK(google::protobuf::TextFormat::ParseFromString(
input_param_string, &input_param));
Expand All @@ -169,6 +172,11 @@ class SplitLayerInsertionTest : public ::testing::Test {
insert_splits(input_param, &actual_output_param);
EXPECT_EQ(expected_output_param.DebugString(),
actual_output_param.DebugString());
// Also test idempotence.
NetParameter double_split_insert_param;
insert_splits(actual_output_param, &double_split_insert_param);
EXPECT_EQ(actual_output_param.DebugString(),
double_split_insert_param.DebugString());
}
};

Expand Down

0 comments on commit bb8e0cd

Please sign in to comment.