@@ -99,15 +99,15 @@ using torch::executor::testing::ProgramTestFriend;
9999TEST_F (ProgramTest, DataParsesWithMinimalVerification) {
100100 // Parse the Program from the data.
101101 Result<Program> program =
102- Program::Load (add_loader_.get (), Program::Verification::Minimal);
102+ Program::load (add_loader_.get (), Program::Verification::Minimal);
103103
104104 // Should have succeeded.
105105 EXPECT_EQ (program.error (), Error::Ok);
106106}
107107
108108TEST_F (ProgramTest, DataParsesWithInternalConsistencyVerification) {
109109 // Parse the Program from the data.
110- Result<Program> program = Program::Load (
110+ Result<Program> program = Program::load (
111111 add_loader_.get (), Program::Verification::InternalConsistency);
112112
113113 // Should have succeeded.
@@ -139,7 +139,7 @@ TEST_F(ProgramTest, BadMagicFailsToLoad) {
139139 // Parse the Program from the data. Use minimal verification to show that
140140 // even this catches the header problem.
141141 Result<Program> program =
142- Program::Load (&data_loader, Program::Verification::Minimal);
142+ Program::load (&data_loader, Program::Verification::Minimal);
143143
144144 // Should fail.
145145 ASSERT_EQ (program.error (), Error::InvalidProgram);
@@ -152,7 +152,7 @@ TEST_F(ProgramTest, BadMagicFailsToLoad) {
152152 {
153153 // Parse the Program from the data again.
154154 Result<Program> program =
155- Program::Load (&data_loader, Program::Verification::Minimal);
155+ Program::load (&data_loader, Program::Verification::Minimal);
156156
157157 // Should now succeed.
158158 ASSERT_EQ (program.error (), Error::Ok);
@@ -170,7 +170,7 @@ TEST_F(ProgramTest, VerificationCatchesTruncation) {
170170 BufferDataLoader half_data_loader (full_data->data (), full_data_len / 2 );
171171
172172 // Loading with full verification should fail.
173- Result<Program> program = Program::Load (
173+ Result<Program> program = Program::load (
174174 &half_data_loader, Program::Verification::InternalConsistency);
175175 ASSERT_EQ (program.error (), Error::InvalidProgram);
176176}
@@ -195,7 +195,7 @@ TEST_F(ProgramTest, VerificationCatchesCorruption) {
195195
196196 // Should fail to parse corrupted data when using full verification.
197197 Result<Program> program =
198- Program::Load (&data_loader, Program::Verification::InternalConsistency);
198+ Program::load (&data_loader, Program::Verification::InternalConsistency);
199199 ASSERT_EQ (program.error (), Error::InvalidProgram);
200200}
201201
@@ -216,14 +216,14 @@ TEST_F(ProgramTest, UnalignedProgramDataFails) {
216216
217217 // Should refuse to accept unaligned data.
218218 Result<Program> program =
219- Program::Load (&data_loader, Program::Verification::Minimal);
219+ Program::load (&data_loader, Program::Verification::Minimal);
220220 ASSERT_NE (program.error (), Error::Ok);
221221}
222222
223223TEST_F (ProgramTest, LoadSegmentWithNoSegments) {
224224 // Load a program with no segments.
225225 Result<Program> program =
226- Program::Load (add_loader_.get (), kDefaultVerification );
226+ Program::load (add_loader_.get (), kDefaultVerification );
227227 EXPECT_EQ (program.error (), Error::Ok);
228228
229229 // Loading a segment should fail.
@@ -305,7 +305,7 @@ TEST_F(ProgramTest, HeaderNotPresent) {
305305TEST_F (ProgramTest, getMethods) {
306306 // Parse the Program from the data.
307307 Result<Program> program_res =
308- Program::Load (multi_loader_.get (), kDefaultVerification );
308+ Program::load (multi_loader_.get (), kDefaultVerification );
309309 EXPECT_EQ (program_res.error (), Error::Ok);
310310
311311 Program program (std::move (program_res.get ()));
@@ -319,3 +319,10 @@ TEST_F(ProgramTest, getMethods) {
319319 EXPECT_TRUE (res2.ok ());
320320 EXPECT_EQ (strcmp (res2.get (), " forward2" ), 0 );
321321}
322+
323+ // Test that the deprecated Load method (capital 'L') still works.
324+ TEST_F (ProgramTest, DEPRECATEDLoad) {
325+ // Parse the Program from the data.
326+ Result<Program> program_res = Program::Load (multi_loader_.get ());
327+ EXPECT_EQ (program_res.error (), Error::Ok);
328+ }
0 commit comments