| 88 | class SplitLayerInsertionTest : public ::testing::Test { |
| 89 | protected: |
| 90 | void RunInsertionTest( |
| 91 | const string& input_param_string, const string& output_param_string) { |
| 92 | // Test that InsertSplits called on the proto specified by |
| 93 | // input_param_string results in the proto specified by |
| 94 | // output_param_string. |
| 95 | NetParameter input_param; |
| 96 | CHECK(google::protobuf::TextFormat::ParseFromString( |
| 97 | input_param_string, &input_param)); |
| 98 | NetParameter expected_output_param; |
| 99 | CHECK(google::protobuf::TextFormat::ParseFromString( |
| 100 | output_param_string, &expected_output_param)); |
| 101 | NetParameter actual_output_param; |
| 102 | InsertSplits(input_param, &actual_output_param); |
| 103 | EXPECT_EQ(expected_output_param.DebugString(), |
| 104 | actual_output_param.DebugString()); |
| 105 | // Also test idempotence. |
| 106 | NetParameter double_split_insert_param; |
| 107 | InsertSplits(actual_output_param, &double_split_insert_param); |
| 108 | EXPECT_EQ(actual_output_param.DebugString(), |
| 109 | double_split_insert_param.DebugString()); |
| 110 | } |
| 111 | }; |
| 112 | |
| 113 | TEST_F(SplitLayerInsertionTest, TestNoInsertion1) { |
no test coverage detected