Motr  M0
bytecount.c File Reference
#include "ut/ut.h"
#include "lib/ub.h"
#include "lib/misc.h"
#include "lib/memory.h"
#include "be/ut/helper.h"
#include "be/seg.h"
#include "cob/cob.h"
#include "lib/locality.h"
Include dependency graph for bytecount.c:

Go to the source code of this file.

Enumerations

enum  { KEY_VAL_NR = 10 }
 

Functions

static int ut_init (void)
 
static int ut_fini (void)
 
static void ut_tx_open (struct m0_be_tx *tx, struct m0_be_tx_credit *credit)
 
static void test_cob_dom_create (void)
 
static void test_init (void)
 
static void test_fini (void)
 
void test_insert (void)
 
void test_entries_dump (void)
 
void test_iterator (void)
 
void test_lookup (void)
 
void test_update (void)
 

Variables

static struct m0_cob_domain_id id = { 42 }
 
static struct m0_be_ut_backend ut_be
 
static struct m0_sm_groupgrp
 
static struct m0_cob_domaindom
 
static struct m0_cobcob
 
struct m0_cob_bckey bckey [KEY_VAL_NR] = {}
 
struct m0_cob_bcrec bcrec [KEY_VAL_NR] = {}
 
struct m0_ut_suite bytecount_ut
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
KEY_VAL_NR 

Definition at line 32 of file bytecount.c.

Function Documentation

◆ test_cob_dom_create()

static void test_cob_dom_create ( void  )
static

Definition at line 66 of file bytecount.c.

Here is the call graph for this function:

◆ test_entries_dump()

void test_entries_dump ( void  )

Definition at line 145 of file bytecount.c.

Here is the call graph for this function:

◆ test_fini()

static void test_fini ( void  )
static

Definition at line 97 of file bytecount.c.

Here is the call graph for this function:

◆ test_init()

static void test_init ( void  )
static

Definition at line 83 of file bytecount.c.

Here is the call graph for this function:

◆ test_insert()

void test_insert ( void  )

Definition at line 109 of file bytecount.c.

Here is the call graph for this function:

◆ test_iterator()

void test_iterator ( void  )

Definition at line 180 of file bytecount.c.

Here is the call graph for this function:

◆ test_lookup()

void test_lookup ( void  )

Lookup for the keys created in test_insert() in bytecount btree and verify the record values.

Lookup for wrong key which is not present in byteocount tree, this case lookup should fail.

Definition at line 196 of file bytecount.c.

Here is the call graph for this function:

◆ test_update()

void test_update ( void  )

Lookup for the keys in bytecount btree after updating the records. Verify the record values after update operation.

Definition at line 225 of file bytecount.c.

Here is the call graph for this function:

◆ ut_fini()

static int ut_fini ( void  )
static

Definition at line 50 of file bytecount.c.

Here is the caller graph for this function:

◆ ut_init()

static int ut_init ( void  )
static

Definition at line 45 of file bytecount.c.

◆ ut_tx_open()

static void ut_tx_open ( struct m0_be_tx tx,
struct m0_be_tx_credit credit 
)
static

Definition at line 55 of file bytecount.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ bckey

struct m0_cob_bckey bckey[KEY_VAL_NR] = {}

Definition at line 41 of file bytecount.c.

◆ bcrec

struct m0_cob_bcrec bcrec[KEY_VAL_NR] = {}

Definition at line 42 of file bytecount.c.

◆ bytecount_ut

struct m0_ut_suite bytecount_ut
Initial value:
= {
.ts_name = "bytecount-ut",
.ts_init = ut_init,
.ts_fini = ut_fini,
.ts_tests = {
{ "cob-dom-create", test_cob_dom_create },
{ "cob-dom-init", test_init },
{ "bc-tree-insert", test_insert },
{ "bc-entries-dump", test_entries_dump },
{ "bc-tree-iterator", test_iterator },
{ "bc-tree-lookup", test_lookup },
{ "bc-tree-update", test_update },
{ "cob-dom-fini", test_fini },
{ NULL, NULL }
}
}
#define NULL
Definition: misc.h:38
static void test_fini(void)
Definition: bytecount.c:97
static int ut_fini(void)
Definition: bytecount.c:50
void test_update(void)
Definition: bytecount.c:225
void test_lookup(void)
Definition: bytecount.c:196
static void test_init(void)
Definition: bytecount.c:83
void test_entries_dump(void)
Definition: bytecount.c:145
void test_iterator(void)
Definition: bytecount.c:180
void test_insert(void)
Definition: bytecount.c:109
static void test_cob_dom_create(void)
Definition: bytecount.c:66
static int ut_init(void)
Definition: bytecount.c:45

Definition at line 269 of file bytecount.c.

◆ cob

struct m0_cob* cob
static

Definition at line 40 of file bytecount.c.

◆ dom

struct m0_cob_domain* dom
static

Definition at line 39 of file bytecount.c.

◆ grp

struct m0_sm_group* grp
static

Definition at line 38 of file bytecount.c.

◆ id

struct m0_cob_domain_id id = { 42 }
static

Definition at line 36 of file bytecount.c.

◆ ut_be

struct m0_be_ut_backend ut_be
static

Definition at line 37 of file bytecount.c.