コード例 #1
0
/**
 * Generates:
 *
 * { "FC_VEGAS" : { } }
 */
CCNxStackConfig *
vegasFlowController_ProtocolStackConfig(CCNxStackConfig *stackConfig)
{
    PARCJSONValue *value = parcJSONValue_CreateFromNULL();
    CCNxStackConfig *result = ccnxStackConfig_Add(stackConfig, vegasFlowController_GetName(), value);
    parcJSONValue_Release(&value);
    return result;
}
コード例 #2
0
/**
 * Generates:
 *
 * { "CODEC_TLV" : { } }
 */
CCNxStackConfig *
tlvCodec_ProtocolStackConfig(CCNxStackConfig *stackConfig)
{
    PARCJSONValue *value = parcJSONValue_CreateFromNULL();
    CCNxStackConfig *result = ccnxStackConfig_Add(stackConfig, tlvCodec_GetName(), value);
    parcJSONValue_Release(&value);

    return result;
}
コード例 #3
0
LONGBOW_TEST_CASE(Global, ccnxStackConfig_AddGet)
{
    CCNxStackConfig *instance = ccnxStackConfig_Create();

    PARCJSONValue *expected = parcJSONValue_CreateFromNULL();
    ccnxStackConfig_Add(instance, "key", expected);

    PARCJSONValue *actual = ccnxStackConfig_Get(instance, "key");

    assertTrue(parcJSONValue_Equals(expected, actual), "ccnxStackConfig_Get did not return what was 'added'");

    parcJSONValue_Release(&expected);

    ccnxStackConfig_Release(&instance);
}
コード例 #4
0
LONGBOW_TEST_CASE(Global, ccnxStackConfig_Equals)
{
    CCNxStackConfig *x = ccnxStackConfig_Create();
    CCNxStackConfig *y = ccnxStackConfig_Create();
    CCNxStackConfig *z = ccnxStackConfig_Create();

    CCNxStackConfig *u1 = ccnxStackConfig_Create();
    PARCJSONValue *val = parcJSONValue_CreateFromNULL();
    ccnxStackConfig_Add(u1, "key", val);
    parcJSONValue_Release(&val);

    parcObjectTesting_AssertEquals(x, y, z, NULL);

    ccnxStackConfig_Release(&x);
    ccnxStackConfig_Release(&y);
    ccnxStackConfig_Release(&z);
    ccnxStackConfig_Release(&u1);
}