LinkedList getDefaultArguments(const char *testName) { LinkedList arguments = newLinkedList(); appendItemToList(arguments, "--log-file"); appendItemToList(arguments, _getTestOutputFilename(testName, "txt")); appendItemToList(arguments, "--output"); appendItemToList(arguments, _getTestOutputFilename(testName, "pcm")); return arguments; }
static int _testLinkedListToArray(void) { LinkedList l = newLinkedList(); CharString* arr; appendItemToList(l, newCharStringWithCString("one")); appendItemToList(l, newCharStringWithCString("two")); arr = (CharString*)linkedListToArray(l); assertNotNull(arr); assertCharStringEquals((CharString)arr[0], "one"); assertCharStringEquals((CharString)arr[1], "two"); assertIsNull(arr[2]); return 0; }
/// Function name : appendChildToXMLTreeNode // Description : Append an XML Tree node to a specified node's list of children // // XML_TREE* pTree : [in] XML Tree containing the nodes // XML_TREE_NODE* pParent : [in] XML Tree Node to be appended // XML_TREE_NODE* pChild : [in] XML Tree Node to append // VOID appendChildToXMLTreeNode(XML_TREE* pTree, XML_TREE_NODE* pParent, XML_TREE_NODE* pChild) { // Set ListItem + Index pChild->pParent = pParent; pChild->pItem = createListItem((LPARAM)pChild); pChild->iIndex = getXMLNodeCount(pParent); // Append appendItemToList(&pParent->oChildren, pChild->pItem); // Increment tree size pTree->iCount++; }
static void _appendItemToLinkedList(void* item, void* userData) { LinkedList linkedList = (LinkedList)userData; appendItemToList(linkedList, item); }