mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-23 00:25:06 +02:00
added a test routine for testing insertIntoSortedArrays()
This commit is contained in:
parent
0c692ca0c0
commit
732b4879e0
1 changed files with 27 additions and 0 deletions
|
@ -1634,6 +1634,33 @@ int main(int argc, const char * argv[])
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Quick test of sortedArrays helper
|
||||||
|
if (cmdOptionExists(argc, argv, "--testSortedArray")) {
|
||||||
|
void* values[8];
|
||||||
|
float keys[8];
|
||||||
|
int meta[8];
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
|
count = insertIntoSortedArrays((void*)10, 10.0, 1, values, keys, meta, count, 8);
|
||||||
|
printf("after one insert...\n");
|
||||||
|
for (int i=0; i<count; i++){
|
||||||
|
printf("keys[%d]=%f values[%d]=%ld meta[%d]=%d\n",i,keys[i],i,(long)values[i],i,meta[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
count = insertIntoSortedArrays((void*)20, 100.0, 2, values, keys, meta, count, 8);
|
||||||
|
printf("after two insert...\n");
|
||||||
|
for (int i=0; i<count; i++){
|
||||||
|
printf("keys[%d]=%f values[%d]=%ld meta[%d]=%d\n",i,keys[i],i,(long)values[i],i,meta[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
count = insertIntoSortedArrays((void*)30, 1.0, 3, values, keys, meta, count, 8);
|
||||||
|
printf("after three inserts...\n");
|
||||||
|
for (int i=0; i<count; i++){
|
||||||
|
printf("keys[%d]=%f values[%d]=%ld meta[%d]=%d\n",i,keys[i],i,(long)values[i],i,meta[i]);
|
||||||
|
}
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
AgentList::createInstance(AGENT_TYPE_AVATAR);
|
AgentList::createInstance(AGENT_TYPE_AVATAR);
|
||||||
|
|
||||||
gettimeofday(&applicationStartupTime, NULL);
|
gettimeofday(&applicationStartupTime, NULL);
|
||||||
|
|
Loading…
Reference in a new issue