Commit 3d79b71c authored by Glenn Scott's avatar Glenn Scott

Modified for new CCNxName scheme and function name cleanup.

parent 4d632640
......@@ -90,7 +90,7 @@ cpiCancelFlow_GetFlowName(const PARCJSON *controlMessage)
PARCBuffer *sBuf = parcJSONValue_GetString(value);
const char *uri = parcBuffer_Overlay(sBuf, 0);
CCNxName *name = ccnxName_CreateFromURI(uri);
CCNxName *name = ccnxName_CreateFromCString(uri);
return name;
}
......
......@@ -403,7 +403,7 @@ cpiRouteEntry_FromJson(PARCJSON *json)
PARCJSONValue *value = parcJSON_GetValueByName(routeJson, cpiPrefix);
assertNotNull(value, "Couldn't locate tag %s in: %s", cpiPrefix, parcJSON_ToString(json));
PARCBuffer *sBuf = parcJSONValue_GetString(value);
CCNxName *prefix = ccnxName_CreateFromURI(parcBuffer_Overlay(sBuf, 0));
CCNxName *prefix = ccnxName_CreateFromCString(parcBuffer_Overlay(sBuf, 0));
const char *symbolicName = NULL;
value = parcJSON_GetValueByName(routeJson, cpiSymbolic);
......
......@@ -76,7 +76,7 @@ LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
LONGBOW_TEST_CASE(Global, cpiAck_CreateAck)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/foo/bar");
CCNxName *name = ccnxName_CreateFromCString("lci:/foo/bar");
CPIRouteEntry *route = cpiRouteEntry_CreateRouteToSelf(name);
PARCJSON *request = cpiForwarding_CreateAddRouteRequest(route);
......@@ -92,7 +92,7 @@ LONGBOW_TEST_CASE(Global, cpiAck_CreateAck)
LONGBOW_TEST_CASE(Global, cpiAck_CreateNack)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/foo/bar");
CCNxName *name = ccnxName_CreateFromCString("lci:/foo/bar");
CPIRouteEntry *route = cpiRouteEntry_CreateRouteToSelf(name);
PARCJSON *request = cpiForwarding_CreateAddRouteRequest(route);
......
......@@ -78,9 +78,9 @@ LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
LONGBOW_TEST_CASE(Global, cpiCancelFlow_CreateRequest)
{
const char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"CPI_CANCEL_FLOW\":{\"FLOW_NAME\":\"lci:/who/doesnt/like/pie\"}}}";
const char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"CPI_CANCEL_FLOW\":{\"FLOW_NAME\":\"ccnx:/who/doesnt/like/pie\"}}}";
CCNxName *name = ccnxName_CreateFromURI("lci:/who/doesnt/like/pie");
CCNxName *name = ccnxName_CreateFromCString("lci:/who/doesnt/like/pie");
PARCJSON *cpiRequest = cpiCancelFlow_CreateRequest(name);
CCNxControl *controlRequest = ccnxControl_CreateCPIRequest(cpiRequest);
......@@ -100,7 +100,7 @@ LONGBOW_TEST_CASE(Global, cpiCancelFlow_CreateRequest)
LONGBOW_TEST_CASE(Global, cpiCancelFlow_NameFromControlMessage)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/who/doesnt/like/pie");
CCNxName *name = ccnxName_CreateFromCString("lci:/who/doesnt/like/pie");
PARCJSON *cpiRequest = cpiCancelFlow_CreateRequest(name);
CCNxControl *controlRequest = ccnxControl_CreateCPIRequest(cpiRequest);
......
......@@ -111,7 +111,7 @@ LONGBOW_TEST_CASE(Global, ccnxControl_AcquireRelease)
LONGBOW_TEST_CASE(Global, ccnxControl_CreateAddRouteRequest)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/boose/roo/pie");
CCNxName *name = ccnxName_CreateFromCString("lci:/boose/roo/pie");
CPIRouteEntry *route = cpiRouteEntry_CreateRouteToSelf(name);
CCNxControl *control = ccnxControl_CreateAddRouteRequest(route);
......@@ -128,7 +128,7 @@ LONGBOW_TEST_CASE(Global, ccnxControl_CreateAddRouteRequest)
LONGBOW_TEST_CASE(Global, ccnxControl_CreateAddRouteToSelfRequest)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/boose/roo/pie");
CCNxName *name = ccnxName_CreateFromCString("lci:/boose/roo/pie");
CCNxControl *control = ccnxControl_CreateAddRouteToSelfRequest(name);
assertNotNull(control, "Expected control message to be non null");
......@@ -145,7 +145,7 @@ LONGBOW_TEST_CASE(Global, ccnxControl_CreateAddRouteToSelfRequest)
LONGBOW_TEST_CASE(Global, ccnxControl_CreateCancelFlowRequest)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/boose/roo/pie");
CCNxName *name = ccnxName_CreateFromCString("lci:/boose/roo/pie");
CCNxControl *control = ccnxControl_CreateCancelFlowRequest(name);
assertNotNull(control, "Expected control message to be non null");
assertTrue(ccnxControl_IsCPI(control), "Expected control to be a CPI control message");
......@@ -227,7 +227,7 @@ LONGBOW_TEST_CASE(Global, ccnxControl_CreateInterfaceListRequest)
LONGBOW_TEST_CASE(Global, ccnxControl_CreateRemoveRouteRequest)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/boose/roo/pie");
CCNxName *name = ccnxName_CreateFromCString("lci:/boose/roo/pie");
CPIRouteEntry *route = cpiRouteEntry_CreateRouteToSelf(name);
CCNxControl *control = ccnxControl_CreateRemoveRouteRequest(route);
......@@ -245,7 +245,7 @@ LONGBOW_TEST_CASE(Global, ccnxControl_CreateRemoveRouteRequest)
LONGBOW_TEST_CASE(Global, ccnxControl_CreateRemoveRouteToSelfRequest)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/boose/roo/pie");
CCNxName *name = ccnxName_CreateFromCString("lci:/boose/roo/pie");
CCNxControl *control = ccnxControl_CreateRemoveRouteToSelfRequest(name);
assertNotNull(control, "Expected control message to be non null");
......@@ -274,7 +274,7 @@ LONGBOW_TEST_CASE(Global, ccnxControl_CreateRouteListRequest)
LONGBOW_TEST_CASE(Global, ccnxControl_CreateCPIRequest)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/boose/roo/pie");
CCNxName *name = ccnxName_CreateFromCString("lci:/boose/roo/pie");
PARCJSON *cpiRequest = cpiCancelFlow_CreateRequest(name);
CCNxControl *control = ccnxControl_CreateCPIRequest(cpiRequest);
......@@ -361,7 +361,7 @@ LONGBOW_TEST_CASE(Global, ccnxControl_IsNotification)
LONGBOW_TEST_CASE(Global, ccnxControl_GetNotifyStatus)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/boose/roo/pie");
CCNxName *name = ccnxName_CreateFromCString("lci:/boose/roo/pie");
NotifyStatus *expected = notifyStatus_Create(1, notifyStatusCode_CONNECTION_OPEN, name, "There's a spider behind you.");
......
......@@ -99,9 +99,9 @@ LONGBOW_TEST_CASE(Global, cpiForwarding_AddRoute_1)
// The JSON representation depends on the system sockaddr_in format, which
// varies platform to platform.
#if defined(__APPLE__)
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"REGISTER\":{\"PREFIX\":\"lci:/howdie/stranger\",\"INTERFACE\":55,\"FLAGS\":0,\"NEXTHOP\":{\"ADDRESSTYPE\":\"INET\",\"DATA\":\"AAIAAAQDAgEAAAAAAAAAAA==\"},\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":200,\"LIFETIME\":[3600,0]}}}";
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"REGISTER\":{\"PREFIX\":\"ccnx:/howdie/stranger\",\"INTERFACE\":55,\"FLAGS\":0,\"NEXTHOP\":{\"ADDRESSTYPE\":\"INET\",\"DATA\":\"AAIAAAQDAgEAAAAAAAAAAA==\"},\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":200,\"LIFETIME\":[3600,0]}}}";
#elif defined(__linux__)
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"REGISTER\":{\"PREFIX\":\"lci:/howdie/stranger\",\"INTERFACE\":55,\"FLAGS\":0,\"NEXTHOP\":{\"ADDRESSTYPE\":\"INET\",\"DATA\":\"AgAAAAQDAgEAAAAAAAAAAA==\"},\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":200,\"LIFETIME\":[3600,0]}}}";
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"REGISTER\":{\"PREFIX\":\"ccnx:/howdie/stranger\",\"INTERFACE\":55,\"FLAGS\":0,\"NEXTHOP\":{\"ADDRESSTYPE\":\"INET\",\"DATA\":\"AgAAAAQDAgEAAAAAAAAAAA==\"},\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":200,\"LIFETIME\":[3600,0]}}}";
#else
// Case 1033
testUnimplemented("Platform not supported");
......@@ -110,7 +110,7 @@ LONGBOW_TEST_CASE(Global, cpiForwarding_AddRoute_1)
char truth[1024];
CCNxName *prefix = ccnxName_CreateFromURI("lci:/howdie/stranger");
CCNxName *prefix = ccnxName_CreateFromCString("lci:/howdie/stranger");
unsigned ifidx = 55;
CPIAddress *nexthop = cpiAddress_CreateFromInet(&(struct sockaddr_in) { .sin_addr.s_addr = 0x01020304 });
struct timeval lifetime = { 3600, 0 };
......@@ -142,9 +142,9 @@ LONGBOW_TEST_CASE(Global, cpiForwarding_AddRoute_2)
// The JSON representation depends on the system sockaddr_in format, which
// varies platform to platform.
#if defined(__APPLE__)
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"REGISTER\":{\"PREFIX\":\"lci:/howdie/stranger\",\"INTERFACE\":55,\"FLAGS\":0,\"NEXTHOP\":{\"ADDRESSTYPE\":\"INET\",\"DATA\":\"AAIAAAQDAgEAAAAAAAAAAA==\"},\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":200}}}";
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"REGISTER\":{\"PREFIX\":\"ccnx:/howdie/stranger\",\"INTERFACE\":55,\"FLAGS\":0,\"NEXTHOP\":{\"ADDRESSTYPE\":\"INET\",\"DATA\":\"AAIAAAQDAgEAAAAAAAAAAA==\"},\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":200}}}";
#elif defined(__linux__)
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"REGISTER\":{\"PREFIX\":\"lci:/howdie/stranger\",\"INTERFACE\":55,\"FLAGS\":0,\"NEXTHOP\":{\"ADDRESSTYPE\":\"INET\",\"DATA\":\"AgAAAAQDAgEAAAAAAAAAAA==\"},\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":200}}}";
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"REGISTER\":{\"PREFIX\":\"ccnx:/howdie/stranger\",\"INTERFACE\":55,\"FLAGS\":0,\"NEXTHOP\":{\"ADDRESSTYPE\":\"INET\",\"DATA\":\"AgAAAAQDAgEAAAAAAAAAAA==\"},\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":200}}}";
#else
// Case 1033
testUnimplemented("Platform not supported");
......@@ -153,7 +153,7 @@ LONGBOW_TEST_CASE(Global, cpiForwarding_AddRoute_2)
char truth[1024];
CCNxName *prefix = ccnxName_CreateFromURI("lci:/howdie/stranger");
CCNxName *prefix = ccnxName_CreateFromCString("lci:/howdie/stranger");
unsigned ifidx = 55;
CPIAddress *nexthop = cpiAddress_CreateFromInet(&(struct sockaddr_in) { .sin_addr.s_addr = 0x01020304 });
unsigned cost = 200;
......@@ -180,10 +180,10 @@ LONGBOW_TEST_CASE(Global, cpiForwarding_AddRoute_2)
*/
LONGBOW_TEST_CASE(Global, cpiForwarding_AddRoute_3)
{
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"REGISTER\":{\"PREFIX\":\"lci:/howdie/stranger\",\"INTERFACE\":55,\"FLAGS\":0,\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":200}}}";
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"REGISTER\":{\"PREFIX\":\"ccnx:/howdie/stranger\",\"INTERFACE\":55,\"FLAGS\":0,\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":200}}}";
char truth[1024];
CCNxName *prefix = ccnxName_CreateFromURI("lci:/howdie/stranger");
CCNxName *prefix = ccnxName_CreateFromCString("lci:/howdie/stranger");
unsigned ifidx = 55;
unsigned cost = 200;
......@@ -212,10 +212,10 @@ LONGBOW_TEST_CASE(Global, cpiForwarding_AddRouteJsonTag)
LONGBOW_TEST_CASE(Global, cpiForwarding_AddRouteToSelf)
{
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"REGISTER\":{\"PREFIX\":\"lci:/howdie/stranger\",\"INTERFACE\":2147483647,\"FLAGS\":0,\"PROTOCOL\":\"LOCAL\",\"ROUTETYPE\":\"LONGEST\",\"COST\":0}}}";
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"REGISTER\":{\"PREFIX\":\"ccnx:/howdie/stranger\",\"INTERFACE\":2147483647,\"FLAGS\":0,\"PROTOCOL\":\"LOCAL\",\"ROUTETYPE\":\"LONGEST\",\"COST\":0}}}";
char truth[1024];
CCNxName *prefix = ccnxName_CreateFromURI("lci:/howdie/stranger");
CCNxName *prefix = ccnxName_CreateFromCString("lci:/howdie/stranger");
CCNxControl *control = ccnxControl_CreateAddRouteToSelfRequest(prefix);
uint64_t seqnum = cpi_GetSequenceNumber(control);
sprintf(truth, truth_format, seqnum);
......@@ -231,10 +231,10 @@ LONGBOW_TEST_CASE(Global, cpiForwarding_AddRouteToSelf)
LONGBOW_TEST_CASE(Global, cpiForwarding_RemoveRoute)
{
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"UNREGISTER\":{\"PREFIX\":\"lci:/howdie/stranger\",\"INTERFACE\":55,\"FLAGS\":0,\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":200}}}";
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"UNREGISTER\":{\"PREFIX\":\"ccnx:/howdie/stranger\",\"INTERFACE\":55,\"FLAGS\":0,\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":200}}}";
char truth[1024];
CCNxName *prefix = ccnxName_CreateFromURI("lci:/howdie/stranger");
CCNxName *prefix = ccnxName_CreateFromCString("lci:/howdie/stranger");
unsigned ifidx = 55;
unsigned cost = 200;
......@@ -264,10 +264,10 @@ LONGBOW_TEST_CASE(Global, cpiForwarding_RemoveRouteJsonTag)
LONGBOW_TEST_CASE(Global, cpiForwarding_RemoveRouteToSelf)
{
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"UNREGISTER\":{\"PREFIX\":\"lci:/howdie/stranger\",\"INTERFACE\":2147483647,\"FLAGS\":0,\"PROTOCOL\":\"LOCAL\",\"ROUTETYPE\":\"LONGEST\",\"COST\":0}}}";
char truth_format[] = "{\"CPI_REQUEST\":{\"SEQUENCE\":%" PRIu64 ",\"UNREGISTER\":{\"PREFIX\":\"ccnx:/howdie/stranger\",\"INTERFACE\":2147483647,\"FLAGS\":0,\"PROTOCOL\":\"LOCAL\",\"ROUTETYPE\":\"LONGEST\",\"COST\":0}}}";
char truth[1024];
CCNxName *prefix = ccnxName_CreateFromURI("lci:/howdie/stranger");
CCNxName *prefix = ccnxName_CreateFromCString("lci:/howdie/stranger");
CCNxControl *control = ccnxControl_CreateRemoveRouteToSelfRequest(prefix);
uint64_t seqnum = cpi_GetSequenceNumber(control);
......@@ -284,7 +284,7 @@ LONGBOW_TEST_CASE(Global, cpiForwarding_RemoveRouteToSelf)
LONGBOW_TEST_CASE(Global, cpiForwarding_RouteFromControlMessage)
{
CCNxName *prefix = ccnxName_CreateFromURI("lci:/howdie/stranger");
CCNxName *prefix = ccnxName_CreateFromCString("lci:/howdie/stranger");
unsigned ifidx = 55;
CPIAddress *nexthop = cpiAddress_CreateFromInet(&(struct sockaddr_in) { .sin_addr.s_addr = 0x01020304 });
unsigned cost = 200;
......
This diff is collapsed.
......@@ -76,7 +76,7 @@ LONGBOW_TEST_CASE(Global, cpiRouteEntryList_Append)
{
CPIRouteEntryList *list = cpiRouteEntryList_Create();
CPIRouteEntry *entry = cpiRouteEntry_Create(ccnxName_CreateFromURI("lci:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
CPIRouteEntry *entry = cpiRouteEntry_Create(ccnxName_CreateFromCString("ccnx:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
cpiRouteEntryList_Append(list, entry);
assertTrue(parcArrayList_Size(list->listOfRouteEntries) == 1, "got wrong size, expected %u got %zu", 1, parcArrayList_Size(list->listOfRouteEntries));
......@@ -93,10 +93,10 @@ LONGBOW_TEST_CASE(Global, cpiRouteEntryList_Create_Destroy)
LONGBOW_TEST_CASE(Global, cpiRouteEntryList_FromJson)
{
char truth_string[] = "{\"Routes\":[{\"PREFIX\":\"lci:/hello\",\"INTERFACE\":1,\"FLAGS\":0,\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":1}]}";
char truth_string[] = "{\"Routes\":[{\"PREFIX\":\"ccnx:/hello\",\"INTERFACE\":1,\"FLAGS\":0,\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":1}]}";
CPIRouteEntryList *truth_list = cpiRouteEntryList_Create();
CPIRouteEntry *entry = cpiRouteEntry_Create(ccnxName_CreateFromURI("lci:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
CPIRouteEntry *entry = cpiRouteEntry_Create(ccnxName_CreateFromCString("ccnx:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
cpiRouteEntryList_Append(truth_list, entry);
PARCJSON *truth_json = parcJSON_ParseString(truth_string);
......@@ -129,25 +129,25 @@ LONGBOW_TEST_CASE(Global, cpiRouteEntryList_FromJson_EmptyList)
LONGBOW_TEST_CASE(Global, cpiRouteEntryList_Equals)
{
CPIRouteEntryList *list_a = cpiRouteEntryList_Create();
CPIRouteEntry *entry_a = cpiRouteEntry_Create(ccnxName_CreateFromURI("lci:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
CPIRouteEntry *entry_a = cpiRouteEntry_Create(ccnxName_CreateFromCString("ccnx:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
cpiRouteEntryList_Append(list_a, entry_a);
CPIRouteEntryList *list_b = cpiRouteEntryList_Create();
CPIRouteEntry *entry_b = cpiRouteEntry_Create(ccnxName_CreateFromURI("lci:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
CPIRouteEntry *entry_b = cpiRouteEntry_Create(ccnxName_CreateFromCString("ccnx:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
cpiRouteEntryList_Append(list_b, entry_b);
CPIRouteEntryList *list_c = cpiRouteEntryList_Create();
CPIRouteEntry *entry_c = cpiRouteEntry_Create(ccnxName_CreateFromURI("lci:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
CPIRouteEntry *entry_c = cpiRouteEntry_Create(ccnxName_CreateFromCString("ccnx:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
cpiRouteEntryList_Append(list_c, entry_c);
CPIRouteEntryList *unequal_length = cpiRouteEntryList_Create();
CPIRouteEntry *entry_d = cpiRouteEntry_Create(ccnxName_CreateFromURI("lci:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
CPIRouteEntry *entry_e = cpiRouteEntry_Create(ccnxName_CreateFromURI("lci:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
CPIRouteEntry *entry_d = cpiRouteEntry_Create(ccnxName_CreateFromCString("ccnx:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
CPIRouteEntry *entry_e = cpiRouteEntry_Create(ccnxName_CreateFromCString("ccnx:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
cpiRouteEntryList_Append(unequal_length, entry_d);
cpiRouteEntryList_Append(unequal_length, entry_e);
CPIRouteEntryList *unequal_value = cpiRouteEntryList_Create();
CPIRouteEntry *entry_f = cpiRouteEntry_Create(ccnxName_CreateFromURI("lci:/hello"), 2, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
CPIRouteEntry *entry_f = cpiRouteEntry_Create(ccnxName_CreateFromCString("ccnx:/hello"), 2, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
cpiRouteEntryList_Append(unequal_value, entry_f);
assertEqualsContract(cpiRouteEntryList_Equals, list_a, list_b, list_c, unequal_length, unequal_value);
......@@ -162,11 +162,11 @@ LONGBOW_TEST_CASE(Global, cpiRouteEntryList_Equals)
LONGBOW_TEST_CASE(Global, cpiRouteEntryList_ToJson)
{
char truth_string[] = "{\"Routes\":[{\"PREFIX\":\"lci:/hello\",\"INTERFACE\":1,\"FLAGS\":0,\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":1}]}";
char truth_string[] = "{\"Routes\":[{\"PREFIX\":\"ccnx:/hello\",\"INTERFACE\":1,\"FLAGS\":0,\"PROTOCOL\":\"STATIC\",\"ROUTETYPE\":\"LONGEST\",\"COST\":1}]}";
CPIRouteEntryList *list = cpiRouteEntryList_Create();
CPIRouteEntry *entry = cpiRouteEntry_Create(ccnxName_CreateFromURI("lci:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
CPIRouteEntry *entry = cpiRouteEntry_Create(ccnxName_CreateFromCString("lci:/hello"), 1, NULL, cpiNameRouteProtocolType_STATIC, cpiNameRouteType_LONGEST_MATCH, NULL, 1);
cpiRouteEntryList_Append(list, entry);
PARCJSON *json = cpiRouteEntryList_ToJson(list);
......
......@@ -182,7 +182,7 @@ notifyStatus_ParseJSON(const PARCJSON *json)
PARCBuffer *sBuf = parcJSONValue_GetString(nameValue);
const char *p = parcBuffer_Overlay(sBuf, 0);
if (p != NULL) {
name = ccnxName_CreateFromURI(p);
name = ccnxName_CreateFromCString(p);
}
}
......
......@@ -69,7 +69,7 @@ LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
LONGBOW_TEST_CASE(Global, notifyStatus_ToJSON)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/a/b/c");
CCNxName *name = ccnxName_CreateFromCString("lci:/a/b/c");
NotifyStatus *expected = notifyStatus_Create(1, notifyStatusCode_CONNECTION_OPEN, name, "foo");
PARCJSON *json = notifyStatus_ToJSON(expected);
......
......@@ -91,7 +91,7 @@ LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
LONGBOW_TEST_CASE(Global, ccnxMetaMessage_Acquire_Release)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/foo/bar");
CCNxName *name = ccnxName_CreateFromCString("lci:/foo/bar");
CCNxInterest *interest = ccnxInterest_CreateSimple(name);
CCNxMetaMessage *portalMessage = ccnxMetaMessage_CreateFromInterest(interest);
......@@ -115,7 +115,7 @@ LONGBOW_TEST_CASE(Global, ccnxMetaMessage_Acquire_Release)
LONGBOW_TEST_CASE(Global, ccnxMetaMessage_CreateFromContentObject)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/foo/bar");
CCNxName *name = ccnxName_CreateFromCString("lci:/foo/bar");
PARCBuffer *payload = parcBuffer_WrapCString("This is some data. It's not good data, but it is data.");
CCNxContentObject *contentObject = ccnxContentObject_CreateWithDataPayload(name, payload);
......@@ -137,7 +137,7 @@ LONGBOW_TEST_CASE(Global, ccnxMetaMessage_CreateFromControl)
LONGBOW_TEST_CASE(Global, ccnxMetaMessage_CreateFromInterest)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/foo/bar");
CCNxName *name = ccnxName_CreateFromCString("lci:/foo/bar");
CCNxInterest *interest = ccnxInterest_CreateSimple(name);
CCNxMetaMessage *portalMessage = ccnxMetaMessage_CreateFromInterest(interest);
......@@ -157,7 +157,7 @@ LONGBOW_TEST_CASE(Global, ccnxMetaMessage_Display)
LONGBOW_TEST_CASE(Global, ccnxMetaMessage_GetContentObject)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/foo/bar");
CCNxName *name = ccnxName_CreateFromCString("lci:/foo/bar");
PARCBuffer *payload = parcBuffer_WrapCString("This is some data. It's not good data, but it is data.");
CCNxContentObject *contentObject = ccnxContentObject_CreateWithDataPayload(name, payload);
......@@ -187,7 +187,7 @@ LONGBOW_TEST_CASE(Global, ccnxMetaMessage_GetControl)
LONGBOW_TEST_CASE(Global, ccnxMetaMessage_GetInterest)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/foo/bar");
CCNxName *name = ccnxName_CreateFromCString("lci:/foo/bar");
CCNxInterest *interest = ccnxInterest_CreateSimple(name);
CCNxMetaMessage *portalMessage = ccnxMetaMessage_CreateFromInterest(interest);
CCNxInterest *reference = ccnxMetaMessage_GetInterest(portalMessage);
......@@ -202,7 +202,7 @@ LONGBOW_TEST_CASE(Global, ccnxMetaMessage_GetInterest)
LONGBOW_TEST_CASE(Global, ccnxMetaMessage_IsContentObject)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/foo/bar");
CCNxName *name = ccnxName_CreateFromCString("lci:/foo/bar");
PARCBuffer *payload = parcBuffer_WrapCString("This is some data. It's not good data, but it is data.");
CCNxContentObject *contentObject = ccnxContentObject_CreateWithDataPayload(name, payload);
......@@ -227,7 +227,7 @@ LONGBOW_TEST_CASE(Global, ccnxMetaMessage_IsControl)
LONGBOW_TEST_CASE(Global, ccnxMetaMessage_IsInterest)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/foo/bar");
CCNxName *name = ccnxName_CreateFromCString("lci:/foo/bar");
CCNxInterest *interest = ccnxInterest_CreateSimple(name);
CCNxMetaMessage *portalMessage = ccnxMetaMessage_CreateFromInterest(interest);
......@@ -242,7 +242,7 @@ LONGBOW_TEST_CASE(Global, ccnxMetaMessage_IsInterest)
LONGBOW_TEST_CASE(Global, ccnxMetaMessage_EncodeDecode)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/foo/bar");
CCNxName *name = ccnxName_CreateFromCString("lci:/foo/bar");
CCNxInterest *interest = ccnxInterest_CreateSimple(name);
ccnxName_Release(&name);
......
......@@ -127,7 +127,7 @@ trafficTools_ReadAndVerifySegment(PARCEventQueue *queue, CCNxName *basename, uin
CCNxContentObject *
trafficTools_CreateSignedContentObject()
{
CCNxName *name = ccnxName_CreateFromURI("lci:/hello/dolly");
CCNxName *name = ccnxName_CreateFromCString("lci:/hello/dolly");
PARCBuffer *payload = parcBuffer_WrapCString("hello");
CCNxContentObject *result = ccnxContentObject_CreateWithDataPayload(name, payload);
......@@ -151,7 +151,7 @@ trafficTools_CreateSignedContentObject()
CCNxContentObject *
trafficTools_CreateContentObjectWithPayload(PARCBuffer *contents)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/hello/dolly");
CCNxName *name = ccnxName_CreateFromCString("lci:/hello/dolly");
CCNxContentObject *result = ccnxContentObject_CreateWithDataPayload(name, contents);
......@@ -202,7 +202,7 @@ trafficTools_CreateTransportMessageWithSignedContentObjectWithName(RtaConnection
CCNxInterest *
trafficTools_CreateInterest(void)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/there/were/bells/on/the/hill");
CCNxName *name = ccnxName_CreateFromCString("lci:/there/were/bells/on/the/hill");
CCNxInterest *interest = ccnxInterest_CreateSimple(name);
ccnxName_Release(&name);
......@@ -212,7 +212,7 @@ trafficTools_CreateInterest(void)
CCNxTlvDictionary *
trafficTools_CreateDictionaryInterest(void)
{
CCNxName *name = ccnxName_CreateFromURI("lci:/there/were/bells/on/the/hill");
CCNxName *name = ccnxName_CreateFromCString("lci:/there/were/bells/on/the/hill");
CCNxTlvDictionary *interest = ccnxInterest_CreateSimple(name);
ccnxName_Release(&name);
......@@ -241,7 +241,7 @@ TransportMessage *
trafficTools_CreateTransportMessageWithDictionaryInterest(RtaConnection *connection, CCNxTlvDictionary_SchemaVersion schema)
{
CCNxTlvDictionary *interest;
CCNxName *name = ccnxName_CreateFromURI("lci:/lost/in/space");
CCNxName *name = ccnxName_CreateFromCString("lci:/lost/in/space");
CCNxInterestInterface *impl = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment