[C-MPI-commits] SF.net SVN: c-mpi:[79] test
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-05-07 21:57:29
|
Revision: 79
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=79&view=rev
Author: jmwozniak
Date: 2010-05-07 21:57:23 +0000 (Fri, 07 May 2010)
Log Message:
-----------
Minor fixes
Modified Paths:
--------------
src/adts/ilist.c
src/adts/llist.c
test/cmpi-db/module.mk.in
test/driver/module.mk.in
Added Paths:
-----------
test/cmpi/test-update02.zsh
Modified: src/adts/ilist.c
===================================================================
--- src/adts/ilist.c 2010-05-07 16:10:58 UTC (rev 78)
+++ src/adts/ilist.c 2010-05-07 21:57:23 UTC (rev 79)
@@ -1,33 +1,33 @@
-#include <stdbool.h>
+#include <stdbool.h>
#include <stdio.h>
-#include <string.h>
+#include <string.h>
-#include "ilist.h"
+#include "ilist.h"
struct ilist*
ilist_create()
{
- // NOTE_F;
+ // NOTE_F;
struct ilist* new_ilist = malloc(sizeof(struct ilist));
if (! new_ilist)
- return NULL;
+ return NULL;
new_ilist->head = NULL;
new_ilist->tail = NULL;
new_ilist->size = 0;
- return new_ilist;
+ return new_ilist;
}
-struct ilist_item*
+struct ilist_item*
ilist_add(struct ilist* target, int key, void* data)
{
struct ilist_item* new_item = malloc(sizeof(struct ilist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
- new_item->next = NULL;
+ new_item->next = NULL;
if (target->size == 0)
{
target->head = new_item;
@@ -37,15 +37,15 @@
{
target->tail->next = new_item;
}
- target->tail = new_item;
+ target->tail = new_item;
target->size++;
- return new_item;
+ return new_item;
}
/**
-
+
*/
-struct ilist_item*
+struct ilist_item*
ilist_replace(struct ilist* target, int key, void* data)
{
struct ilist_item* item;
@@ -53,7 +53,7 @@
if (item->key == key)
{
item->data = data;
- return item;
+ return item;
}
return ilist_add(target, key, data);
}
@@ -65,7 +65,7 @@
for (item = target->head; item; item = item->next)
if (item->key == key)
return true;
- return false;
+ return false;
}
bool
@@ -77,22 +77,22 @@
for (item = target->head; item; item = item->next)
if (cmp(item->data, data) == 0)
return true;
- return false;
+ return false;
}
/**
Insert into list so that keys are in order from smallest at head
to largest at tail.
*/
-struct ilist_item*
+struct ilist_item*
ilist_ordered_insert(struct ilist* target, int key, void* data)
{
- // NOTE_F;
-
+ // NOTE_F;
+
struct ilist_item* new_item = malloc(sizeof(struct ilist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
new_item->next = NULL;
@@ -104,44 +104,44 @@
else
{
struct ilist_item* item = target->head;
- // Are we the new head?
+ // Are we the new head?
if (key < target->head->key)
{
new_item->next = target->head;
- target->head = new_item;
+ target->head = new_item;
}
else
{
do
{
- // Are we inserting after this item?
+ // Are we inserting after this item?
if (item->next == NULL)
{
item->next = new_item;
target->tail = new_item;
- break;
+ break;
}
else
{
if (key < item->next->key)
{
- new_item->next = item->next;
+ new_item->next = item->next;
item->next = new_item;
- break;
+ break;
}
}
} while ((item = item->next));
}
}
target->size++;
- return new_item;
+ return new_item;
}
/**
Does nothing if the key/data pair are in the list.
- Ordered smallest to largest.
+ Ordered smallest to largest.
@return NULL iff the key/data pair are in the list.
- Could optimize to only malloc if insertion point is found.
+ Could optimize to only malloc if insertion point is found.
*/
struct ilist_item*
ilist_ordered_insert_unique(struct ilist* target,
@@ -151,7 +151,7 @@
struct ilist_item* new_item = malloc(sizeof(struct ilist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
new_item->next = NULL;
@@ -163,73 +163,73 @@
else
{
struct ilist_item* item = target->head;
- // Are we the new head?
+ // Are we the new head?
if (key < target->head->key)
{
new_item->next = target->head;
- target->head = new_item;
+ target->head = new_item;
}
- // Are we equal to the head?
+ // Are we equal to the head?
else if (key == target->head->key &&
cmp(data, target->head->data) == 0)
{
- free(new_item);
+ free(new_item);
return NULL;
}
else
{
do
{
- // Are we inserting after this item?
+ // Are we inserting after this item?
if (item->next == NULL)
{
item->next = new_item;
target->tail = new_item;
- break;
+ break;
}
else
{
- if (key == item->next->key &&
+ if (key == item->next->key &&
cmp(data, item->next->data) == 0)
{
- free(new_item);
+ free(new_item);
return NULL;
}
if (key < item->next->key)
{
- new_item->next = item->next;
+ new_item->next = item->next;
item->next = new_item;
- break;
+ break;
}
}
} while ((item = item->next));
}
}
target->size++;
- return new_item;
+ return new_item;
}
/**
This is expensive: singly linked list.
*/
-void*
+void*
ilist_pop(struct ilist* target)
{
- // NOTE_F;
-
- void* data;
+ // NOTE_F;
+
+ void* data;
if (target->size == 0)
return NULL;
if (target->size == 1)
{
- data = target->head->data;
- free(target->head);
+ data = target->head->data;
+ free(target->head);
target->head = NULL;
target->tail = NULL;
- target->size = 0;
- return data;
+ target->size = 0;
+ return data;
}
-
+
struct ilist_item* item;
for (item = target->head; item->next->next;
item = item->next);
@@ -237,35 +237,35 @@
free(item->next);
item->next = NULL;
target->tail = item;
- target->size--;
- return data;
+ target->size--;
+ return data;
}
/**
- Remove and return head of list.
+ Remove and return head of list.
*/
void*
ilist_poll(struct ilist* target)
{
- void* data;
+ void* data;
if (target->size == 0)
return NULL;
if (target->size == 1)
{
- data = target->head->data;
- free(target->head);
+ data = target->head->data;
+ free(target->head);
target->head = NULL;
target->tail = NULL;
- target->size = 0;
- return data;
+ target->size = 0;
+ return data;
}
- struct ilist_item* delendum = target->head;
+ struct ilist_item* delendum = target->head;
data = target->head->data;
target->head = target->head->next;
free(delendum);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
/**
@@ -275,20 +275,20 @@
ilist_get(struct ilist* target, int i)
{
struct ilist_item* item;
- int j = 0;
+ int j = 0;
for (item = target->head; item; item = item->next, j++)
- if (i == j)
+ if (i == j)
return (item->data);
return NULL;
}
/**
- @return The data or NULL if not found.
+ @return The data or NULL if not found.
*/
-void*
+void*
ilist_search(struct ilist* target, int key)
{
- struct ilist_item* item;
+ struct ilist_item* item;
for (item = target->head; item; item = item->next)
if (key == item->key)
return (item->data);
@@ -297,38 +297,38 @@
/**
Removes the ilist_item from the list.
- frees the ilist_item.
- @return The data item or NULL if not found.
+ frees the ilist_item.
+ @return The data item or NULL if not found.
*/
void*
ilist_remove(struct ilist* target, int key)
{
struct ilist_item* item;
- void* data;
+ void* data;
if (target->size == 0)
- return false;
+ return false;
if (target->head->key == key)
{
item = target->head;
target->head = item->next;
- data = item->data;
+ data = item->data;
free(item);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
for (item = target->head; item->next; item = item->next)
if (item->next->key == key)
{
struct ilist_item* delendum = item->next;
- data = delendum->data;
+ data = delendum->data;
if (item->next == target->tail)
- target->tail = item;
+ target->tail = item;
item->next = item->next->next;
free(delendum);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
- return NULL;
+ return NULL;
}
/**
@@ -340,11 +340,11 @@
struct ilist_item* item = target->head;
while (item)
{
- struct ilist_item* next = item->next;
+ struct ilist_item* next = item->next;
free(item);
- item = next;
+ item = next;
}
- free(target);
+ free(target);
}
/**
@@ -353,21 +353,21 @@
void
ilist_destroy(struct ilist* target)
{
- // NOTE_F;
+ // NOTE_F;
struct ilist_item* item = target->head;
while (item)
{
struct ilist_item* next = item->next;
free(item->data);
// free(item);
- item = next;
+ item = next;
}
free(target);
- // DONE;
+ // DONE;
}
/**
- @param format Specifies the output format for the data items.
+ @param format Specifies the output format for the data items.
*/
void
ilist_printf(char* format, struct ilist* target)
@@ -382,15 +382,15 @@
printf(format, item->data);
else if (strcmp(format, "%i") == 0)
printf(format, *((int*) (item->data)));
- printf(")");
+ printf(")");
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
/**
- @param format Specifies the output format for the data items.
+ @param format Specifies the output format for the data items.
*/
void
ilist_fprintf(FILE* file, char* format, struct ilist* target)
@@ -405,15 +405,15 @@
fprintf(file, format, item->data);
else if (strcmp(format, "%i") == 0)
fprintf(file, format, *((int*) (item->data)));
- fprintf(file, ")");
+ fprintf(file, ")");
if (item->next)
- fprintf(file, ",");
+ fprintf(file, ",");
}
fprintf(file, "]\n");
}
/**
- @param f Specifies the output format for the data items.
+ @param f Specifies the output format for the data items.
*/
void
ilist_fdump(FILE* file, char* (f)(void*), struct ilist* target)
@@ -425,15 +425,15 @@
{
fprintf(file, "(%i,", item->key);
fprintf(file, "%s", f(item->data));
- fprintf(file, ")");
+ fprintf(file, ")");
if (item->next)
- fprintf(file, ",");
+ fprintf(file, ",");
}
fprintf(file, "]\n");
}
/**
- Just dump the int keys.
+ Just dump the int keys.
*/
void
ilist_dumpkeys(struct ilist* target)
@@ -445,13 +445,13 @@
{
printf("(%i)", item->key);
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
/**
- Just dump the int keys.
+ Just dump the int keys.
*/
void
ilist_fdumpkeys(FILE* file, struct ilist* target)
@@ -463,13 +463,13 @@
{
fprintf(file, "(%i)", item->key);
if (item->next)
- fprintf(file, ",");
+ fprintf(file, ",");
}
fprintf(file, "]\n");
}
/**
- Dump the int keys in hex.
+ Dump the int keys in hex.
*/
void
ilist_xdumpkeys(struct ilist* target)
@@ -481,31 +481,31 @@
{
printf("(%x)", item->key);
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
/**
Just dump the data pointers.
- @return Allocated memory: 10 * target->size.
+ @return Allocated memory: 10 * target->size.
*/
-char*
-ilist_serialize_ptrs(struct ilist* target)
+char*
+ilist_serialize_ptrs(struct ilist* target)
{
- char* result = malloc(30*target->size);
+ char* result = malloc(30*target->size);
struct ilist_item* item;
- char* p = result;
+ char* p = result;
p += sprintf(p, "PTRS: [");
for (item = target->head;
item; item = item->next)
{
p += sprintf(p, "%p", item->data);
if (item->next)
- p += sprintf(p, " ");
+ p += sprintf(p, " ");
}
sprintf(p, "]\n");
- return result;
+ return result;
}
static char*
@@ -513,10 +513,10 @@
{
ptr += sprintf(ptr, "(%i,", item->key);
ptr += sprintf(ptr, "%s)", s);
-
+
if (item->next)
ptr += sprintf(ptr, ",");
- return ptr;
+ return ptr;
}
/**
@@ -531,10 +531,10 @@
item; item = item->next)
{
printf("(%i,", item->key);
- printf(f(item->data));
+ printf("%s", f(item->data));
printf(")");
if (item->next)
- printf(",");
+ printf(",");
}
printf("] \n");
}
@@ -543,73 +543,73 @@
size must be greater than 2.
format specifies the output format for the data items
returns int greater than size if size limits are exceeded
- indicating result is garbage
- */
+ indicating result is garbage
+ */
int ilist_snprintf(char* str, size_t size,
char* format, struct ilist* target)
{
- int error = size+1;
- char* ptr = str;
+ int error = size+1;
+ char* ptr = str;
struct ilist_item* item;
if (size <= 2)
- return error;
-
+ return error;
+
ptr += sprintf(ptr, "[");
char* s = (char*) malloc(sizeof(char)*ILIST_MAX_DATUM);
-
+
for (item = target->head; item && ptr-str < size;
- item = item->next)
+ item = item->next)
{
int r = snprintf(s, ILIST_MAX_DATUM, format, item->data);
if (r > ILIST_MAX_DATUM)
- return size+1;
+ return size+1;
if ((ptr-str) + 10 + r + 4 < size)
- ptr = append_pair(ptr, item, s);
+ ptr = append_pair(ptr, item, s);
else
- return error;
+ return error;
}
ptr += sprintf(ptr, "]");
- free(s);
- return (ptr-str);
+ free(s);
+ return (ptr-str);
}
/** Dump ilist to string a la snprintf()
size must be greater than 2.
format specifies the output format for the data items
returns int greater than size if size limits are exceeded
- indicating result is garbage
- */
+ indicating result is garbage
+ */
int ilist_marshal(char* str, size_t size,
char* (f)(void*), struct ilist* target)
{
- int error = size+1;
- char* ptr = str;
+ int error = size+1;
+ char* ptr = str;
struct ilist_item* item;
if (size <= 2)
- return error;
-
+ return error;
+
ptr += sprintf(ptr, "[");
for (item = target->head; item && ptr-str < size;
- item = item->next)
+ item = item->next)
{
- char* s = f(item->data);
+ char* s = f(item->data);
int r = sprintf(s, "%s", s);
if (r > ILIST_MAX_DATUM)
- return size+1;
+ return size+1;
if ((ptr-str) + 10 + r + 4 < size)
- ptr = append_pair(ptr, item, s);
+ ptr = append_pair(ptr, item, s);
else
- return error;
+ return error;
}
ptr += sprintf(ptr, "]");
- return (ptr-str);
+ return (ptr-str);
}
#ifdef DEBUG_ILIST
Modified: src/adts/llist.c
===================================================================
--- src/adts/llist.c 2010-05-07 16:10:58 UTC (rev 78)
+++ src/adts/llist.c 2010-05-07 21:57:23 UTC (rev 79)
@@ -1,28 +1,28 @@
-#include "llist.h"
+#include "llist.h"
struct llist*
llist_create()
{
struct llist* new_llist = malloc(sizeof(struct llist));
if (! new_llist)
- return NULL;
+ return NULL;
new_llist->head = NULL;
new_llist->tail = NULL;
new_llist->size = 0;
- return new_llist;
+ return new_llist;
}
-struct llist_item*
+struct llist_item*
llist_add(struct llist* target, long key, void* data)
{
struct llist_item* new_item = malloc(sizeof(struct llist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
- new_item->next = NULL;
+ new_item->next = NULL;
if (target->size == 0)
{
target->head = new_item;
@@ -32,22 +32,22 @@
{
target->tail->next = new_item;
}
- target->tail = new_item;
+ target->tail = new_item;
target->size++;
- return new_item;
+ return new_item;
}
/**
Insert into list so that keys are in order from smallest at head
to largest at tail.
*/
-struct llist_item*
+struct llist_item*
llist_ordered_insert(struct llist* target, long key, void* data)
{
struct llist_item* new_item = malloc(sizeof(struct llist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
new_item->next = NULL;
@@ -59,43 +59,43 @@
else
{
struct llist_item* item = target->head;
- // Are we the new head?
+ // Are we the new head?
if (key < target->head->key)
{
new_item->next = target->head;
- target->head = new_item;
+ target->head = new_item;
}
else
{
do
{
- // Are we inserting after this item?
+ // Are we inserting after this item?
if (item->next == NULL)
{
item->next = new_item;
target->tail = new_item;
- break;
+ break;
}
else
{
if (key < item->next->key)
{
- new_item->next = item->next;
+ new_item->next = item->next;
item->next = new_item;
- break;
+ break;
}
}
} while ((item = item->next));
}
}
target->size++;
- return new_item;
+ return new_item;
}
/**
- Does nothing if the key/data pair are in the list.
+ Does nothing if the key/data pair are in the list.
@return NULL iff the key/data pair are in the list.
- Could optimize to only malloc if insertion point is found.
+ Could optimize to only malloc if insertion point is found.
*/
struct llist_item*
llist_ordered_insertdata(struct llist* target,
@@ -105,7 +105,7 @@
struct llist_item* new_item = malloc(sizeof(struct llist_item));
if (! new_item)
return NULL;
- new_item->key = key;
+ new_item->key = key;
new_item->data = data;
new_item->next = NULL;
@@ -117,71 +117,71 @@
else
{
struct llist_item* item = target->head;
- // Are we the new head?
+ // Are we the new head?
if (key < target->head->key)
{
new_item->next = target->head;
- target->head = new_item;
+ target->head = new_item;
}
- // Are we equal to the head?
+ // Are we equal to the head?
else if (key == target->head->key &&
cmp(data, target->head->data))
{
- free(new_item);
+ free(new_item);
return NULL;
}
else
{
do
{
- // Are we inserting after this item?
+ // Are we inserting after this item?
if (item->next == NULL)
{
item->next = new_item;
target->tail = new_item;
- break;
+ break;
}
else
{
- if (key == item->next->key &&
+ if (key == item->next->key &&
cmp(data, item->next->data))
{
- free(new_item);
+ free(new_item);
return NULL;
}
if (key < item->next->key)
{
- new_item->next = item->next;
+ new_item->next = item->next;
item->next = new_item;
- break;
+ break;
}
}
} while ((item = item->next));
}
}
target->size++;
- return new_item;
+ return new_item;
}
/**
This is expensive: singly linked list.
*/
-void*
+void*
llist_pop(struct llist* target)
{
- void* data;
+ void* data;
if (target->size == 0)
return NULL;
if (target->size == 1)
{
- data = target->head->data;
- free(target->head);
+ data = target->head->data;
+ free(target->head);
target->head = NULL;
target->tail = NULL;
- target->size = 0;
- return data;
+ target->size = 0;
+ return data;
}
-
+
struct llist_item* item;
for (item = target->head; item->next->next;
item = item->next);
@@ -189,35 +189,35 @@
free(item->next);
item->next = NULL;
target->tail = item;
- target->size--;
- return data;
+ target->size--;
+ return data;
}
/**
- Remove and return head of list.
+ Remove and return head of list.
*/
void*
llist_poll(struct llist* target)
{
- void* data;
+ void* data;
if (target->size == 0)
return NULL;
if (target->size == 1)
{
- data = target->head->data;
- free(target->head);
+ data = target->head->data;
+ free(target->head);
target->head = NULL;
target->tail = NULL;
- target->size = 0;
- return data;
+ target->size = 0;
+ return data;
}
- struct llist_item* delendum = target->head;
+ struct llist_item* delendum = target->head;
data = target->head->data;
target->head = target->head->next;
free(delendum);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
/**
@@ -227,17 +227,17 @@
llist_get(struct llist* target, int i)
{
struct llist_item* item;
- int j = 0;
+ int j = 0;
for (item = target->head; item; item = item->next, j++)
- if (i == j)
+ if (i == j)
return (item->data);
return NULL;
}
-void*
+void*
llist_search(struct llist* target, long key)
{
- struct llist_item* item;
+ struct llist_item* item;
for (item = target->head; item; item = item->next)
if (key == item->key)
return (item->data);
@@ -247,37 +247,37 @@
/**
Removes the llist_item from the list.
frees the llist_item and the data pointer.
- @return The removed item or NULL if not found.
+ @return The removed item or NULL if not found.
*/
-void*
+void*
llist_remove(struct llist* target, long key)
{
struct llist_item* item;
- void* data;
+ void* data;
if (target->size == 0)
- return false;
+ return false;
if (target->head->key == key)
{
item = target->head;
target->head = item->next;
- data = item->data;
+ data = item->data;
free(item);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
for (item = target->head; item->next; item = item->next)
if (item->next->key == key)
{
struct llist_item* delendum = item->next;
- data = delendum->data;
+ data = delendum->data;
if (item->next == target->tail)
- target->tail = item;
+ target->tail = item;
item->next = item->next->next;
free(delendum);
- target->size--;
- return data;
+ target->size--;
+ return data;
}
- return NULL;
+ return NULL;
}
/**
@@ -289,11 +289,11 @@
struct llist_item* item = target->head;
while (item)
{
- struct llist_item* next = item->next;
+ struct llist_item* next = item->next;
free(item);
- item = next;
+ item = next;
}
- free(target);
+ free(target);
}
/**
@@ -306,11 +306,11 @@
while (item)
{
struct llist_item* next = item->next;
- free(item->data);
+ free(item->data);
free(item);
- item = next;
+ item = next;
}
- free(target);
+ free(target);
}
/** format specifies the output format for the data items
@@ -328,14 +328,14 @@
printf(format, item->data);
else if (strcmp(format, "%li") == 0)
printf(format, *((long*) (item->data)));
- printf(")");
+ printf(")");
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
-/** Just dump the long keys.
+/** Just dump the long keys.
*/
void
llist_dumpkeys(struct llist* target)
@@ -347,12 +347,12 @@
{
printf("(%li)", item->key);
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
-/** Dump the long keys in hex.
+/** Dump the long keys in hex.
*/
void
llist_xdumpkeys(struct llist* target)
@@ -364,7 +364,7 @@
{
printf("(%lx)", item->key);
if (item->next)
- printf(",");
+ printf(",");
}
printf("]\n");
}
@@ -375,10 +375,10 @@
{
ptr += sprintf(ptr, "(%li,", item->key);
ptr += sprintf(ptr, "%s)", s);
-
+
if (item->next)
ptr += sprintf(ptr, ",");
- return ptr;
+ return ptr;
}
/**
@@ -392,10 +392,10 @@
item; item = item->next)
{
printf("(%li,", item->key);
- printf(f(item->data));
+ printf("%s", f(item->data));
printf(")");
if (item->next)
- printf(",");
+ printf(",");
}
printf("] \n");
}
@@ -404,38 +404,38 @@
size must be greater than 2.
format specifies the output format for the data items
returns int greater than size if size limits are exceeded
- indicating result is garbage
- */
+ indicating result is garbage
+ */
int llist_tostring(char* str, size_t size,
char* format, struct llist* target)
{
- int error = size+1;
- char* ptr = str;
+ int error = size+1;
+ char* ptr = str;
struct llist_item* item;
if (size <= 2)
- return error;
-
+ return error;
+
ptr += sprintf(ptr, "[");
char* s = (char*) malloc(sizeof(char)*LLIST_MAX_DATUM);
-
+
for (item = target->head; item && ptr-str < size;
- item = item->next)
+ item = item->next)
{
int r = snprintf(s, LLIST_MAX_DATUM, format, item->data);
if (r > LLIST_MAX_DATUM)
- return size+1;
+ return size+1;
if ((ptr-str) + 10 + r + 4 < size)
- ptr = append_pair(ptr, item, s);
+ ptr = append_pair(ptr, item, s);
else
- return error;
+ return error;
}
ptr += sprintf(ptr, "]");
- free(s);
- return (ptr-str);
+ free(s);
+ return (ptr-str);
}
#ifdef DEBUG_LLIST
@@ -443,13 +443,13 @@
int
main()
{
- int i;
+ int i;
char s[200];
char* d1 = malloc(50*sizeof(char));
- strcpy(d1, "okey-dokey");
+ strcpy(d1, "okey-dokey");
char* d2 = malloc(50*sizeof(char));
strcpy(d2, "okey-dokey30");
-
+
struct llist* list = llist_create();
llist_ordered_insert(list, 30, d2);
@@ -457,20 +457,20 @@
llist_remove(list, 30);
i = llist_tostring(s, 200, "%s", list);
printf("1: %s \n", s);
-
+
llist_ordered_insert(list, 31, "okey-dokey31");
- //
- llist_ordered_insert(list, 32, "okey-dokey32");
-
+ //
+ llist_ordered_insert(list, 32, "okey-dokey32");
+
i = llist_tostring(s, 200, "%s", list);
printf("2: %s \n", s);
-
+
llist_remove(list, 12);
llist_ordered_insert(list, 33, "okey-dokey33");
- // llist_remove(list, 30);
+ // llist_remove(list, 30);
llist_ordered_insert(list, 20, "okey-dokey20");
-
+
i = llist_tostring(s, 200, "%s", list);
printf("%s \n", s);
}
Added: test/cmpi/test-update02.zsh
===================================================================
--- test/cmpi/test-update02.zsh (rev 0)
+++ test/cmpi/test-update02.zsh 2010-05-07 21:57:23 UTC (rev 79)
@@ -0,0 +1,37 @@
+#!/bin/zsh
+
+# Be sure to make tests with D=1
+
+# set -x
+
+source tools/test-helpers.zsh
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+shift
+LAUNCH=${*}
+
+if (( USE_COMM_WORLD == 1 ))
+then
+
+ # Monolithic execution (5 nodes, 1 client):
+
+ mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
+ CODE=$?
+ [[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+else
+
+ # KDA-2B execution:
+
+ tools/startup_nodes.zsh $(( N-1 )) 100 &
+ mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ sleep $(( N+15 ))
+
+fi
+
+# Should be 6 "Normal exit."s
+N=$( grep -c "Normal exit." ${OUT} )
+(( N == 6 )) || crash "N != 6"
+
+exit 0
Property changes on: test/cmpi/test-update02.zsh
___________________________________________________________________
Added: svn:executable
+ *
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-07 16:10:58 UTC (rev 78)
+++ test/cmpi-db/module.mk.in 2010-05-07 21:57:23 UTC (rev 79)
@@ -1,7 +1,7 @@
-TEST_CMPI_DB_SRC += $(shell find test/driver -name "*.c" ! -name test_helpers.c)
+TEST_CMPI_DB_SRC += # $(shell find test/cmpi-db -name "*.c" ! -name test_helpers.c)
TEST_SRC += $(TEST_CMPI_DB_SRC)
-TEST_HELPER_SRC += test/driver/test_helpers.c
+TEST_HELPER_SRC += test/driver/test_helpers.c
CMPI_DB = bin/cmpi-db
CMPI_CP = bin/cmpi-cp
@@ -14,10 +14,10 @@
$(E) $(<) $(@) 4 3
# test/cmpi-db/test-quit.zsh
-test/cmpi-db/test%.out: test/driver/test%.x $(DRIVER)
- $(Q) " TEST $(@) "
- $(E)touch $(@)
+#test/cmpi-db/test%.out: test/cmpi-db/test%.x $(DRIVER)
+# $(Q) " TEST $(@) "
+# $(E)touch $(@)
-$(DRIVER): $(DRIVER_IMPL) test/driver/test_helpers.o src/cmpi/node.o $(CMPI)
- $(E)$(MPICC) $(MPE) $(<) test/driver/test_helpers.o src/cmpi/node.o \
- $(CMPI) $(LIBS) -o $(@)
+# $(DRIVER): $(DRIVER_IMPL) test/driver/test_helpers.o src/cmpi/node.o $(CMPI)
+# $(E)$(MPICC) $(MPE) $(<) test/driver/test_helpers.o src/cmpi/node.o \
+# $(CMPI) $(LIBS) -o $(@)
Modified: test/driver/module.mk.in
===================================================================
--- test/driver/module.mk.in 2010-05-07 16:10:58 UTC (rev 78)
+++ test/driver/module.mk.in 2010-05-07 21:57:23 UTC (rev 79)
@@ -1,5 +1,5 @@
-TEST_DRIVER_SRC += $(shell find test/driver -name "*.c" ! -name test_helpers.c)
+TEST_DRIVER_SRC += # $(shell find test/driver -name "*.c" ! -name test_helpers.c)
TEST_SRC += $(TEST_DRIVER_SRC)
TEST_HELPER_SRC += test/driver/test_helpers.c
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|