BAM
Abstract Machine for Bottom-Up Evaluation with the Push Method
Public Member Functions | Protected Member Functions | List of all members
rtest_c Class Referenceabstract

Abstract superclass for Standard Tests/Benchmarks of relation-like data structures with insert() and lookup() Methods. More...

#include <rtest.h>

Inheritance diagram for rtest_c:
test_set1_c< T > test_set2_c< T >

Public Member Functions

 rtest_c (rel_t rel)
 
virtual int insert ()=0
 
virtual int lookup ()=0
 
virtual int size_value (relsize_t relsize)=0
 
rel_t rel ()
 
int num_rows ()
 
str_t error_row ()
 
virtual void dump (str_t headline=STR_NULL) const
 

Protected Member Functions

void inserted_rows (int n)
 
void error_row_open ()
 
void error_row_int (int val)
 
void error_row_close ()
 

Detailed Description

Abstract superclass for Standard Tests/Benchmarks of relation-like data structures with insert() and lookup() Methods.

Author
Stefan Brass
Date
14.10.2016

Member Function Documentation

str_t rtest_c::error_row ( )
inline

String representation of the row that caused an error to be detected. Of course, this should be printed as part of the error message. Since this superclass should work with tests of arbitrary relations, the row can only be returned as string. Although most relations work with columns of type int, this is not required by the system.

This function should only be called if an error was detected.

Returns
Row that caused an error (string to be printed as part of the error message).
void rtest_c::error_row_close ( )
inlineprotected

Close the buffer for the display version of the row that caused the error.

void rtest_c::error_row_int ( int  val)
inlineprotected

Write an integer column value to the string buffer for the display version of the row that caused the error.

Parameters
valColumn value.
void rtest_c::error_row_open ( )
inlineprotected

Start writing the buffer for the display version of the row at which an error was detected.

virtual int rtest_c::insert ( )
pure virtual

Insert a specified number of rows.

Returns
0 if successful, otherwise number i of the row where insertion failed.
void rtest_c::inserted_rows ( int  n)
inlineprotected

Add number of inserted rows. This function must be called when a test function inserted rows into the relation to be tested. If an error occurred during the test, this must be the number of insert operations that were successfully executed before the error was detected.

Parameters
nNumber of rows that were successfully inserted.
virtual int rtest_c::lookup ( )
pure virtual

Lookup all rows that were inserted.

Returns
0 if successful, otherwise number i of the row where the lookup failed.
int rtest_c::num_rows ( )
inline

Number of rows that were successfully inserted. If an error occurred, this might help in the error diagnosis. If no error occurred, this is the current size of the relation in the test.

Returns
Number of rows that were successfully inserted so far into the relation to be tested.
rel_t rtest_c::rel ( )
inline

This method returns the relation that is being tested.

Returns
Relation that is subject of this test.
virtual int rtest_c::size_value ( relsize_t  relsize)
pure virtual

Return various data structure size measures (e.g. hash table size).

Parameters
relsizeEnumeration value that selects the size measure.
Returns
Value of the size measure or -1 if not applicable

The documentation for this class was generated from the following files: