mardi 5 février 2019

Google Test: Action that accepts a vector as a parameter

I have a GoogleTest Action defined below.

ACTION_P5(ReadAction, aa, bb, cc, dd, ee) {

    shared_ptr<DataResponse> response = move(DataResponse::Create());

    response->DataV3.a = aa;
    response->DataV3.b = bb;
    response->DataV3.c = cc;
    response->DataV3.d = dd;
    response->DataV3.e = ee;

    return response;
}

This function gets called when a message is sent to an interface. The first four values in the structure response (i.e a, b, c, d) are numbers. However the fifth one is a vector of uint8_t.

Would the above assignment work correctly ? Am I missing something. Since Action is macro drive how is type safety ensured.

Aucun commentaire:

Enregistrer un commentaire