Logo Search packages:      
Sourcecode: sofia-sip version File versions  Download package

torture_rbtree.c File Reference

Test red-black tree. More...

#include "config.h"
#include <stddef.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include "sofia-sip/rbtree.h"
#include <stdio.h>
#include <sofia-sip/tstdef.h>
#include <sofia-sip/su_alloc.h>
Include dependency graph for torture_rbtree.c:

Go to the source code of this file.

Classes

struct  node

Defines

#define CMP(a, b)   ((a)->value - (b)->value)
#define COPY_COLOR(dst, src)   ((dst)->black = (src)->black)
#define INSERT(node)   ((void)0)
#define IS_BLACK(node)   (!(node) || (node)->black == 1)
#define IS_RED(node)   ((node) && (node)->black == 0)
#define LEFT(node)   ((node)->left)
#define PARENT(node)   ((node)->parent)
#define REMOVE(node)   ((node)->left = (node)->right = (node)->parent = NULL)
#define RIGHT(node)   ((node)->right)
#define SET_BLACK(node)   ((node)->black = 1)
#define SET_RED(node)   ((node)->black = 0)
#define TSTFLAGS   tstflags

Typedefs

typedef struct node Node

Functions

unsigned log2ceil (unsigned k)
int main (int argc, char *argv[])
static Nodenode_find (Node *tree, int value)
static Nodenode_new (su_home_t *home, int value)
 RBTREE_BODIES (su_inline, redblack, Node, LEFT, RIGHT, PARENT, IS_RED, SET_RED, IS_BLACK, SET_BLACK, COPY_COLOR, CMP, INSERT, REMOVE)
 RBTREE_PROTOS (su_inline, redblack, Node)
static int redblack_check (Node const *n)
int test_balance (void)
int test_insert (void)
int test_rotate (void)
int test_simple (void)
int test_speed (void)
void usage (int exitcode)

Variables

char const * name = "torture_rbtree"
int tstflags

Detailed Description

Test red-black tree.

Author:
Pekka Pessi <Pekka.Pessi@nokia.com>
Date:
Created: Wed Mar 10 17:05:23 2004 ppessi

Definition in file torture_rbtree.c.


Generated by  Doxygen 1.6.0   Back to index