MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / createStudent

Function createStudent

test/test_struct/test_struct_server_impl.cpp:131–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131student *createStudent(const char *name, const float test_scores[3], school_year_t year, int32_t age)
132{
133 // Log::info("returning from createStudent()\n");
134 student *newStudent = (student *)erpc_malloc(sizeof(student));
135 newStudent->name = (char *)erpc_malloc((strlen(name) + 1) * sizeof(char));
136 strcpy(newStudent->name, name);
137 for (uint8_t i = 0; i < 3; ++i)
138 newStudent->test_grades[i] = test_scores[i];
139 newStudent->school_year = year;
140 newStudent->age = age;
141 // Log::info("returning from createStudent()\n");
142 return newStudent;
143}
144
145void test_struct_allDirection(const AllTypes *a, const AllTypes *b, AllTypes *e)
146{

Callers 2

createStudentMethod · 0.85
TESTFunction · 0.85

Calls 1

erpc_mallocFunction · 0.50

Tested by

no test coverage detected