Beispiel #1
0
static void
mock_vsyslog( int priority, const char *format, va_list ap ) {
  check_expected( priority );

  char output[ 256 ];
  vsnprintf( output, sizeof( output ), format, ap );

  check_expected( output );
}
Beispiel #2
0
int
mock_accept( int sockfd, struct sockaddr *addr, socklen_t *addrlen ) {
  check_expected( sockfd );
  check_expected( addr );
  check_expected( addrlen );
  check_expected( *addrlen );

  return ( int ) mock();
}
Beispiel #3
0
int
mock_execvp( /* const */ char *file, char * /* const */ argv[] ) {
  check_expected( file );
  check_expected( argv );
  check_expected( argv[ 0 ] );
  check_expected( argv[ 1 ] );

  return ( int ) mock();
}
Beispiel #4
0
jabber_conn_status_t jabber_connect_with_details(const char * const jid,
    const char * const passwd, const char * const altdomain, const int port, const char *const tls_policy)
{
    check_expected(jid);
    check_expected(passwd);
    check_expected(altdomain);
    check_expected(port);
    return (jabber_conn_status_t)mock();
}
Beispiel #5
0
static jabber_conn_status_t
_mock_jabber_connect_with_details(const char * const jid,
    const char * const passwd, const char * const altdomain)
{
    check_expected(jid);
    check_expected(passwd);
    check_expected(altdomain);
    return (jabber_conn_status_t)mock();
}
Beispiel #6
0
static void
callback_hello( uint16_t tag, void *data, size_t len ) {
  check_expected( tag );
  check_expected( data );
  check_expected( len );

  stop_event_handler();
  stop_messenger();
}
Beispiel #7
0
bool
mock_switch_send_openflow_message( buffer *buffer ) {
  struct ofp_header *header = buffer->data;
  check_expected( buffer->length );
  if ( header->type == OFPT_GET_CONFIG_REPLY ) {
    check_expected( ( ( struct ofp_switch_config * ) buffer->data )->flags );
  } 
  return true;
}
Beispiel #8
0
static gboolean
_mock_bookmark_add(const char *jid, const char *nick, const char *password, const char *autojoin_str)
{
    check_expected(jid);
    check_expected(nick);
    check_expected(password);
    check_expected(autojoin_str);
    return (gboolean)mock();
}
Beispiel #9
0
void ui_current_print_formatted_line(const char show_char, int attrs, const char * const msg, ...)
{
    check_expected(show_char);
    check_expected(attrs);
    va_list args;
    va_start(args, msg);
    vsnprintf(output, sizeof(output), msg, args);
    check_expected(output);
    va_end(args);
}
Beispiel #10
0
ssize_t
mock_read( int fd, void *buf, size_t count ) {
  check_expected( fd );
  check_expected( buf );
  check_expected( count );
  if ( read_length > 0 ) {
    memcpy( buf, read_buffer, read_length );
  }
  return ( int ) mock();
}
Beispiel #11
0
pid_t
mock_wait3( int *status, int options, struct rusage *rusage ) {
  check_expected( status );
  check_expected( options );
  check_expected( rusage );

  *status = mock_wait3_status;

  return ( pid_t ) mock();
}
Beispiel #12
0
int
mock_setsockopt( int sockfd, int level, int optname, /* const */ void *optval,
  socklen_t optlen ) {

  check_expected( sockfd );
  check_expected( level );
  check_expected( optname );
  check_expected( optval );
  check_expected( optlen );

  return ( int ) mock();
}
void
mock_insert_match_entry( struct ofp_match *ofp_match, uint16_t priority,
  /* const */ char *service_name, /* const */ char *entry_name ) {
  uint32_t priority32 = priority;

  check_expected( ofp_match );
  check_expected( priority32 );
  check_expected( service_name );
  check_expected( entry_name );

  ( void ) mock();
}
bool
mock_send_message( /* const */ char *service_name, const uint16_t tag,
  /* const */ void *data,
  size_t len ) {
  uint32_t tag32 = tag;

  check_expected( service_name );
  check_expected( tag32 );
  check_expected( data );
  check_expected( len );

  return ( bool ) mock();
}
static void test_mock_ssh_logging_callback(int priority,
                                           const char *function,
                                           const char *buffer,
                                           void *userdata)
{
    struct test_mock_state *t = (struct test_mock_state *)userdata;

    check_expected(priority);
    check_expected(function);
    check_expected(buffer);

    t->executed++;
}
Beispiel #16
0
static size_t __wrap_coco_suite_encode_problem_index(coco_suite_t *suite,
                                                     const size_t function_idx,
                                                     const size_t dimension_idx,
                                                     const size_t instance_idx) {

  printf("INFO: function __wrap_coco_suite_encode_problem_index.\n");

  check_expected(function_idx);
  check_expected(dimension_idx);
  check_expected(instance_idx);

  (void)suite; /* unused */
  return (size_t) mock();
}
void
mock_set_match_from_packet( struct ofp_match *match, const uint16_t in_port,
  const uint32_t wildcards, /* const */ buffer *packet ) {
  uint32_t in_port32 = in_port;

  check_expected( match );
  check_expected( in_port32 );
  check_expected( wildcards );
  check_expected( packet );

  memset( match, 0, sizeof( struct ofp_match ) );
  match->in_port = in_port;
  match->wildcards = wildcards;

  ( void ) mock();
}
Beispiel #18
0
static void
mock_warn_check( char *format, va_list args ) {
  char message[ 1000 ];
  vsnprintf( message, 1000, format, args );

  check_expected( message );
}
Beispiel #19
0
void cons_show_error(const char * const cmd, ...)
{
    va_list args;
    va_start(args, cmd);
    vsnprintf(output, sizeof(output), cmd, args);
    check_expected(output);
    va_end(args);
}
Beispiel #20
0
void cons_show(const char * const msg, ...)
{
    va_list args;
    va_start(args, msg);
    vsnprintf(output, sizeof(output), msg, args);
    check_expected(output);
    va_end(args);
}
Beispiel #21
0
int write_output(const char *buf, size_t buf_len)
{
  check_expected(buf_len);

  return mock();

  (void)buf;
}
Beispiel #22
0
void ui_current_print_line(const char * const msg, ...)
{
    va_list args;
    va_start(args, msg);
    vsnprintf(output, sizeof(output), msg, args);
    check_expected(output);
    va_end(args);
}
Beispiel #23
0
static long __wrap_suite_bbob2009_get_next_problem_index(
    long problem_index, const char *selection_descriptor) {

  printf("INFO: function __wrap_suite_bbob2009_get_next_problem_index.\n");

  check_expected(problem_index);

  return (long) mock();
}
static bool
mock_add_message_replied_callback( const char *service_name,
                                   void ( *callback )( uint16_t tag, void *data, size_t len, void *user_data ) ) {
  check_expected( service_name );
  assert_true( callback != NULL );
  handle_reply = callback;

  return ( bool ) mock();
}
Beispiel #25
0
static int
mock_vprintf( const char *format, va_list ap ) {
  char output[ 256 ];
  vsnprintf( output, sizeof( output ), format, ap );

  check_expected( output );

  return 0;
}
Beispiel #26
0
static void
mock_critical( const char *format, ... ) {
  char output[ 256 ];
  va_list args;
  va_start( args, format );
  vsprintf( output, format, args );
  va_end( args );
  check_expected( output );
}
/* A mock printf function that checks the value of strings printed to the
 * standard output stream. */
int example_test_printf(const char *format, ...) {
	int return_value;
	va_list args;
	va_start(args, format);
	return_value = vsnprintf(temporary_buffer, sizeof(temporary_buffer),
	                         format, args);
	check_expected(temporary_buffer);
	va_end(args);
	return return_value;
}
Beispiel #28
0
void
mock_info( const char *format, ... ) {
  va_list args;
  va_start( args, format );
  char message[ 1000 ];
  vsprintf( message, format, args );
  va_end( args );

  check_expected( message );
}
Beispiel #29
0
static void
mock_die( const char *format, ... ) {
  char output[ 256 ];
  va_list args;
  va_start( args, format );
  vsprintf( output, format, args );
  va_end( args );
  check_expected( output );

  mock_assert( false, "mock_die", __FILE__, __LINE__ ); } // Hoaxes gcov.
Beispiel #30
0
void
mock_die( char *format, ... ) {
  va_list args;
  va_start( args, format );
  char message[ 1000 ];
  vsprintf( message, format, args );
  va_end( args );

  check_expected( message );
  mock_assert( false, "UNREACHABLE", __FILE__, __LINE__ ); } // This hoaxes gcov.