hazy_msg_test_with_triggers.cxx File Reference


Classes

struct  _id_label_vector_entry< T >
struct  worker_thread_info< T >
 structure that has Hazy_Worker and parsed_vec More...
struct  server_thread_info< T >

Functions

int write_func_create_view (message_data msg, size_t length)
 Writes the given msg to the server and retrieves integer from the received msg.
void fvector_to_dbstring_without_cast (const FVector &v, std::string &feature_values)
 Converts FVector to dbstring without using cast as float8[].
void svector_to_dbstring_without_cast (const SVector &s, std::string &feature_vector_str)
 Converts SVector to dbstring without using cast as pair[].
void fillVectors ()
 Randomly fill fvector and svector lists.
void test_query_server_id (bool &success)
 Tests that query server id is working correctly.
void test_close_server_conn (bool &success)
 Tests that close connection query is working correctly.
void test_count (bool &success)
 Tests count hazy message method.
template<class T>
void single_test_update (T vec, bool &success, T *parsed_vec)
 Tests that update message is working correctly.
template<class T>
void single_test_update_bin (T vec, bool dense, bool &success, T *parsed_vec)
 Tests that update message that sends binary data is working correctly.
template<class T>
void single_test_se_lazy_naive (T vec, bool &success, bool dense, T *parsed_vec)
 Tests that single entity read lazy naive message is working correctly.
template<class T>
void single_test_se_lazy_hazy (T vec, bool &success, bool dense, T *parsed_vec)
 Tests that single entity read lazy hazy is working correctly.
template<class T>
void single_test_se_lazy_hazy_bin (T vec, bool &success, bool dense, T *parsed_vec)
 Tests that single entity read lazy hazy that sends binary data is working correctly.
template<class T>
void single_test_se_lazy_naive_bin (T vec, bool &success, bool dense, T *parsed_vec)
 Tests that single entity read lazy naive that sends binary data is working correctly.
template<class T>
void test_update (bool &success, T *parsed_vec)
 Tests that update message is working correctly.
template<class T>
void test_update_bin (bool &success, T *parsed_vec)
 Tests that update message that sends binary data is working correctly.
void create_random_string (char *s, size_t len)
void single_test_create_view (bool &success)
void test_create_view (bool &success)
template<class T>
void test_single_delete_bin (string table_name, int deleted_id, bool &success)
void test_delete_bin (bool &success)
template<class T>
void test_se_lazy_hazy (bool &success, T *parsed_vec)
 Tests that single entity read lazy hazy message is working correctly.
template<class T>
void test_se_lazy_hazy_bin (bool &success, T *parsed_vec)
 Tests that single entity read lazy hazy that sends binary message is working correctly.
template<class T>
void test_se_lazy_naive_bin (bool &success, T *parsed_vec)
 Tests that single entity read lazy naive that sends binary message is working correctly.
template<class T>
void test_se_lazy_naive (bool &success, T *parsed_vec)
 Tests that sends single entity read lazy naive message is working correctly.
void test_se_eager (bool &success)
 Tests that single entity read eager message is working correctly.
template<class T>
void * worker_thread (void *data)
 The thread that simulates the server.
template<class T>
void * server_thread (void *ptr)
template<class T>
void run_server ()
 Runs all regression tests.
int main (int argc, char **argv)

Variables

int bDense = 0
 This class implements regression tests for hazy message class with triggers For each query in hazy message, a test first fills both SVector and FVector lists to be used Then, it creates a msg for that query and sends it to the thread that plays server role.
const int numSVectors = 50
int dim = 100
int max_svector_dim = 100
const int test_num = numSVectors
const int range = 100
FVector fVectorList [numSVectors]
SVector sVectorList [numSVectors]
int parsed_view_id = -1
double parsed_eps = -1
int parsed_entity_id = -1
int parsed_label = -1
int entity_label_answer = -1
int parsed_server_id = 0
int parsed_close_conn = 0
int count_answer = -1
Hazy_Databasedb_conn
string db_name = ""
int parsed_deleted_id = -1
string parsed_db_name = ""
string parsed_rel_name = ""
create_view_bin_strparsed_cv_struct

Function Documentation

void create_random_string ( char *  s,
size_t  len 
)

void fillVectors (  ) 

Randomly fill fvector and svector lists.

void fvector_to_dbstring_without_cast ( const FVector v,
std::string &  feature_values 
)

Converts FVector to dbstring without using cast as float8[].

Parameters:
[in] v FVector
[out] feature_values dbstring which is created

int main ( int  argc,
char **  argv 
)

template<class T>
void run_server (  ) 

Runs all regression tests.

Database connection is closed

template<class T>
void* server_thread ( void *  ptr  ) 

void single_test_create_view ( bool &  success  ) 

template<class T>
void single_test_se_lazy_hazy ( vec,
bool &  success,
bool  dense,
T *  parsed_vec 
)

Tests that single entity read lazy hazy is working correctly.

Parameters:
[in] vec feature vector of the entity
[out] success 
[in] dense whether feature vector is dense or sparse
[in] parsed_vec the vector that is parsed by the server

template<class T>
void single_test_se_lazy_hazy_bin ( vec,
bool &  success,
bool  dense,
T *  parsed_vec 
)

Tests that single entity read lazy hazy that sends binary data is working correctly.

Parameters:
[in] vec feature vector of the entity
[out] success 
[in] dense whether the feature vector is dense or not
[in] parsed_vec the vector that is parsed by the server

template<class T>
void single_test_se_lazy_naive ( vec,
bool &  success,
bool  dense,
T *  parsed_vec 
)

Tests that single entity read lazy naive message is working correctly.

Parameters:
[in] vec feature vector of the entity
[out] success 
[in] dense whether vector is sparse or dense
[in] parsed_vec the vector that is parsed by the server

template<class T>
void single_test_se_lazy_naive_bin ( vec,
bool &  success,
bool  dense,
T *  parsed_vec 
)

Tests that single entity read lazy naive that sends binary data is working correctly.

Parameters:
[in] vec feature vector of the entity
[out] success 
[in] dense whether the feature vector is dense or not
[in] parsed_vec the vector that is parsed by the server

template<class T>
void single_test_update ( vec,
bool &  success,
T *  parsed_vec 
)

Tests that update message is working correctly.

Parameters:
[in] vec feature vector of the entity
[out] success 
[in] parsed_vec parsed vector by the server

template<class T>
void single_test_update_bin ( vec,
bool  dense,
bool &  success,
T *  parsed_vec 
)

Tests that update message that sends binary data is working correctly.

Parameters:
[in] vec feature vector of the entity
[in] dense whether the feature vector is dense or sparse
[out] success 
[in] parsed_vec the vector which is parsed by the server

void svector_to_dbstring_without_cast ( const SVector s,
std::string &  feature_vector_str 
)

Converts SVector to dbstring without using cast as pair[].

Parameters:
[in] s SVector
[out] feature_vector_str dbstring which is created

void test_close_server_conn ( bool &  success  ) 

Tests that close connection query is working correctly.

Parameters:
[out] success 

void test_count ( bool &  success  ) 

Tests count hazy message method.

Parameters:
[out] success 

void test_create_view ( bool &  success  ) 

void test_delete_bin ( bool &  success  ) 

void test_query_server_id ( bool &  success  ) 

Tests that query server id is working correctly.

Parameters:
[out] success 

void test_se_eager ( bool &  success  ) 

Tests that single entity read eager message is working correctly.

Parameters:
[out] success 

template<class T>
void test_se_lazy_hazy ( bool &  success,
T *  parsed_vec 
)

Tests that single entity read lazy hazy message is working correctly.

Parameters:
[out] success 
[in] parsed_vec the vector parsed by the server

template<class T>
void test_se_lazy_hazy_bin ( bool &  success,
T *  parsed_vec 
)

Tests that single entity read lazy hazy that sends binary message is working correctly.

Parameters:
[out] success 
[in] parsed_vec the vector parsed by the server

template<class T>
void test_se_lazy_naive ( bool &  success,
T *  parsed_vec 
)

Tests that sends single entity read lazy naive message is working correctly.

Parameters:
[out] success 
[in] parsed_vec the vector parsed by the server

template<class T>
void test_se_lazy_naive_bin ( bool &  success,
T *  parsed_vec 
)

Tests that single entity read lazy naive that sends binary message is working correctly.

Parameters:
[out] success 
[in] parsed_vec the vector parsed by the server

template<class T>
void test_single_delete_bin ( string  table_name,
int  deleted_id,
bool &  success 
)

template<class T>
void test_update ( bool &  success,
T *  parsed_vec 
)

Tests that update message is working correctly.

Parameters:
[out] success 
[in] parsed_vec the vector parsed by the server

template<class T>
void test_update_bin ( bool &  success,
T *  parsed_vec 
)

Tests that update message that sends binary data is working correctly.

Parameters:
[out] success 
[in] parsed_vec the vector parsed by the server

template<class T>
void* worker_thread ( void *  data  ) 

The thread that simulates the server.

int write_func_create_view ( message_data  msg,
size_t  length 
)

Writes the given msg to the server and retrieves integer from the received msg.

Parameters:
[in] msg msg to be written to the server
[in] length size of the msg


Variable Documentation

int bDense = 0

This class implements regression tests for hazy message class with triggers For each query in hazy message, a test first fills both SVector and FVector lists to be used Then, it creates a msg for that query and sends it to the thread that plays server role.

Then, server parses trigger msg and sends the result back to the trigger. Then, the msg sent by the server is retrieved and compared with the one that is expected to see it is correct. Also, we test whether the server parsed the msg correctly or not.

int count_answer = -1

Hazy_Database* db_conn

string db_name = ""

int dim = 100

int entity_label_answer = -1

FVector fVectorList[numSVectors]

int max_svector_dim = 100

const int numSVectors = 50

int parsed_close_conn = 0

struct create_view_bin_str* parsed_cv_struct

string parsed_db_name = ""

int parsed_deleted_id = -1

int parsed_entity_id = -1

double parsed_eps = -1

int parsed_label = -1

string parsed_rel_name = ""

int parsed_server_id = 0

int parsed_view_id = -1

const int range = 100

SVector sVectorList[numSVectors]

const int test_num = numSVectors


Generated on Wed Dec 15 10:46:16 2010 for Hazy_System by  doxygen 1.4.7