Example #1
0
int
test_main(int,char*[])
{
  typedef boost::multi_array<double, 3> array;
  typedef array::array_view<3>::type array_view;

  typedef array::extent_range erange;
  typedef array::index_range irange;

  array::extent_gen extents;
  array::index_gen indices;

  // Construct with nonzero bases
  {

    array A(extents[erange(1,4)][erange(2,5)][erange(3,6)]);
    //array_view E = A[indices[irange(1,2)][irange(1,2)][irange(1,2)]];
    array_view E = A[indices[irange(1,2)][irange(2,3)][irange(3,4)]];

  }
  
  #ifdef __SYMBIAN32__
	std_log(LOG_FILENAME_LINE,"[End Test Case ]");
   	testResultXml("vc_death");
	close_log_file();
#endif
  return boost::exit_success;
}
int main (int argc, char *argv[])
{
  std_log(LOG_FILENAME_LINE,"[Test Case for string assign]");
   #ifndef __SYMBIAN32__ 
    return rw_test (argc, argv, __FILE__,
                    "lib.string.assign",
                    0 /* no comment */, run_test,
                    0 /* co command line options */);
   #else
    rw_test (argc, argv, __FILE__,
                    "lib.string.assign",
                    0 /* no comment */, run_test,
                    0 /* co command line options */);                 
    if(failures)
      {
            assert_failed = true;
       std_log(LOG_FILENAME_LINE,"Result: Failed");
      }
     else
      {

       std_log(LOG_FILENAME_LINE,"Result: Passed");
      }
  
   std_log(LOG_FILENAME_LINE,"[End Test Case]");  
   
    testResultXml("21_string_assign");
    close_log_file();
  #endif
  
  return failures;
}
int test_main(int , char* [])
{
    typedef boost::variant<int, std::string> var_t;
 	std_log(LOG_FILENAME_LINE,"[Test Case for recursive_comparison_test]");   
    var_t var1(3);
    var_t var2(5);
    var_t var3("goodbye");
    var_t var4("hello");

    assert_equality_comparable(var1, var1, var1);
    assert_equality_comparable(var_t(var1), var_t(var1), var_t(var1));
    assert_equality_comparable(var1, var2, var3);

    assert_less_than_comparable(var1, var2, var3);
    assert_less_than_comparable(var2, var3, var4);

    std::vector<var_t> vec;
    vec.push_back( var3 );
    vec.push_back( var2 );
    vec.push_back( var4 );
    vec.push_back( var1 );
    std::sort(vec.begin(), vec.end());

    std::string sort_result( print_range(vec.begin(), vec.end()) );
    BOOST_CHECK( sort_result == "3 5 goodbye hello " );
#ifdef __SYMBIAN32__
   	testResultXml("variant_comparison_test");
	close_log_file();
#endif
    return boost::exit_success;
}
Example #4
0
void exit_cleanup(void) {
    lispd_running = FALSE;
    /* Close timer file descriptors */
    if (timers_fd != 0){
        remove_sig_timer();
    }
    /* Close receive sockets */
    close_socket(tun_fd);
    close_socket(ipv4_data_input_fd);
    close_socket(ipv4_control_input_fd);
    close_socket(ipv6_data_input_fd);
    close_socket(ipv6_control_input_fd);
    /* Close netlink socket */
    close_socket(netlink_fd);

    free_ifaces_list();
    drop_map_cache();
    drop_local_mappings();
    drop_referral_cache();
    free_map_cache_entry(proxy_etrs);
    free_lisp_addr_list(proxy_itrs, TRUE);
    free_map_server_list(map_servers);
    free(config_file);


    close_log_file();
}
Example #5
0
int main (int argc, char *argv[])
{
    errno_at_startup = errno;

    std_log(LOG_FILENAME_LINE,"[Test Case for cerrno]");
    
    #ifndef __SYMBIAN32__
    return rw_test (argc, argv, __FILE__,
                    "lib.errno",
                    0 /* no comment */, run_test,
                    0 /* no command line options */, 0);
    #else                
      rw_test (argc, argv, __FILE__,
                    "lib.errno",
                    0 /* no comment */, run_test,
                    0 /* no command line options */, 0);
    if(failures)
      {
            assert_failed = true;
       std_log(LOG_FILENAME_LINE,"Result: Failed");
      }
     else
      {

       std_log(LOG_FILENAME_LINE,"Result: Passed");
      }
  
   std_log(LOG_FILENAME_LINE,"[End Test Case]");  
   
   testResultXml("19_cerrno");
    close_log_file();
 #endif
                    
}
Example #6
0
void
exit_cleanup(void) {
    LMLOG(LDBG_2,"Exit Cleanup");

    //lmapi_end(&lmapi_connection);
#ifndef ANDROID
    pid_file_remove();
#endif

    ctrl_destroy(lctrl);

    ifaces_destroy();

    if (!data_plane){
        data_plane->datap_uninit();
    }

    sockmstr_destroy(smaster);

    lmtimers_destroy();

    htable_ptrs_destroy(ptrs_to_timers_ht);
    htable_nonces_destroy(nonces_ht);

    close_log_file();
#ifndef VPNAPI
    LMLOG(LINF,"Exiting ...");
    exit(EXIT_SUCCESS);
#else
    jni_uninit();
#endif

}
Example #7
0
File: oor.c Project: biels/oor
void
exit_cleanup(void) {
    OOR_LOG(LDBG_2,"Exit Cleanup");

#ifndef ANDROID
    pid_file_remove();
#endif
    // Order is important
    ctrl_destroy(lctrl);

    if (data_plane){
        data_plane->datap_uninit();
    }

    ifaces_destroy();

    sockmstr_destroy(smaster);

    oor_timers_destroy();

    htable_ptrs_destroy(ptrs_to_timers_ht);
    htable_nonces_destroy(nonces_ht);

    close_log_file();
#ifndef VPNAPI
    OOR_LOG(LINF,"Exiting ...");
    exit(EXIT_SUCCESS);
#else
    jni_uninit();
#endif

}
int main()
{
	std_log(LOG_FILENAME_LINE,"[Test Case for intrusive_ptr_test]");
    n_element_type::test();
    n_constructors::test();
    n_destructor::test();
    n_assignment::test();
    n_access::test();
    n_swap::test();
    n_comparison::test();
    n_static_cast::test();
    n_dynamic_cast::test();

    n_transitive::test();
    n_report_1::test();

#ifdef __SYMBIAN32__
    int failures = boost::report_errors();
	if(failures)
	{
		std_log(LOG_FILENAME_LINE,"Result : Failed");
		assert_failed = true;
	}
	else
	{
		std_log(LOG_FILENAME_LINE,"Result : Passed");
	}
	std_log(LOG_FILENAME_LINE,"[End Test Case ]");
#endif
	testResultXml("intrusive_ptr_test");
	close_log_file();
	return failures;
}
Example #9
0
/*
 * @brief 初始化队列,将256个空闲node全部入队列,node的获取与回收由get_node和recycle_node完成
 * @brief 在initiate()中调用
 */
void file_queue_init()
{
	int i;
	q_node_t *tmp;
	file_queue.head = file_queue.tail = NULL;
	for (i = 0; i < 256; i++) {
		if ((tmp = (q_node_t*)malloc(sizeof(q_node_t))) == NULL) {
			write_log("File_queue init:malloc failed!\n");
			close_log_file();
			exit(-1);
		}
		file_recv_node[i] = tmp;

		file_recv_node[i]->next = NULL;
		file_recv_node[i]->recv_link = NULL;
		file_recv_node[i]->number = i;
		file_recv_node_len[i] = 0;

		if (file_queue.head == NULL)
			file_queue.head = file_queue.tail = file_recv_node[i];
		else {
			file_queue.tail->next = file_recv_node[i];
			file_queue.tail = file_recv_node[i];
		}
	}
}
Example #10
0
void exit_cleanup(void) {
    lispd_running = FALSE;
    /* Remove source routing tables */
    remove_created_rules();
    /* Close timer file descriptors */
    if (timers_fd != 0){
        remove_sig_timer();
    }
    /* Close receive sockets */
    close_socket(tun_fd);
    close_socket(ipv4_data_input_fd);
    close_socket(ipv4_control_input_fd);
    close_socket(ipv6_data_input_fd);
    close_socket(ipv6_control_input_fd);
    /* Close send sockets */
    close_output_sockets();
    /* Close netlink socket */
    close_socket(netlink_fd);

    free_map_cache_entry(proxy_etrs);
    free_lisp_addr_list(proxy_itrs, TRUE);
    free_map_server_list(map_servers);
    free_ifaces_list();
    drop_map_cache();
    drop_local_mappings();
    drop_referral_cache();
    free(config_file);

#ifdef ANDROID
    close_log_file();
#endif
    exit(EXIT_SUCCESS);
}
int main()
{
	std_log(LOG_FILENAME_LINE,"[Test Case for pointer_to_other_test]");
    // shared_ptr

	#ifdef __ARMCC__
  #pragma diag_suppress 550
  #endif  
    assert_same_type< boost::pointer_to_other< boost::shared_ptr<X>, Y >::type, boost::shared_ptr<Y> >();
    assert_same_type< boost::pointer_to_other< boost::shared_ptr<X>, void >::type, boost::shared_ptr<void> >();
    assert_same_type< boost::pointer_to_other< boost::shared_ptr<void>, Y >::type, boost::shared_ptr<Y> >();

    // shared_array

    assert_same_type< boost::pointer_to_other< boost::shared_array<X>, Y >::type, boost::shared_array<Y> >();
    assert_same_type< boost::pointer_to_other< boost::shared_array<X>, void >::type, boost::shared_array<void> >();
    assert_same_type< boost::pointer_to_other< boost::shared_array<void>, Y >::type, boost::shared_array<Y> >();

    // scoped_ptr

    assert_same_type< boost::pointer_to_other< boost::scoped_ptr<X>, Y >::type, boost::scoped_ptr<Y> >();
    assert_same_type< boost::pointer_to_other< boost::scoped_ptr<X>, void >::type, boost::scoped_ptr<void> >();
    assert_same_type< boost::pointer_to_other< boost::scoped_ptr<void>, Y >::type, boost::scoped_ptr<Y> >();

    // scoped_array

    assert_same_type< boost::pointer_to_other< boost::scoped_array<X>, Y >::type, boost::scoped_array<Y> >();
    assert_same_type< boost::pointer_to_other< boost::scoped_array<X>, void >::type, boost::scoped_array<void> >();
    assert_same_type< boost::pointer_to_other< boost::scoped_array<void>, Y >::type, boost::scoped_array<Y> >();

    // intrusive_ptr

    assert_same_type< boost::pointer_to_other< boost::intrusive_ptr<X>, Y >::type, boost::intrusive_ptr<Y> >();
    assert_same_type< boost::pointer_to_other< boost::intrusive_ptr<X>, void >::type, boost::intrusive_ptr<void> >();
    assert_same_type< boost::pointer_to_other< boost::intrusive_ptr<void>, Y >::type, boost::intrusive_ptr<Y> >();

    // auto_ptr

    assert_same_type< boost::pointer_to_other< std::auto_ptr<X>, Y >::type, std::auto_ptr<Y> >();
    assert_same_type< boost::pointer_to_other< std::auto_ptr<X>, void >::type, std::auto_ptr<void> >();
    assert_same_type< boost::pointer_to_other< std::auto_ptr<void>, Y >::type, std::auto_ptr<Y> >();

    // raw pointer

    assert_same_type< boost::pointer_to_other< X *, Y >::type, Y * >();
    assert_same_type< boost::pointer_to_other< X *, void >::type, void * >();
    assert_same_type< boost::pointer_to_other< void *, Y >::type, Y * >();


#ifdef __SYMBIAN32__

	std_log(LOG_FILENAME_LINE,"Result : Passed");

	std_log(LOG_FILENAME_LINE,"[End Test Case ]");
#endif
	testResultXml("pointer_to_other_test");
	close_log_file();
    return 0;
}
void create_xml(int result)
{
	if(result)
		assert_failed = 1;
	
	testResultXml("dbus_connection_return_message0");
	close_log_file();
}
void create_xml(int result)
	{
	if(result)
		assert_failed = 1;
	
	testResultXml("g_proxy_begin_call_timeout");
    close_log_file();
	}
void create_xml(int result)
{
	if(result)
		assert_failed = 1;
	
	testResultXml("DBus_Server_Listen0");
	close_log_file();
}
void create_xml(int result)
{
	if(result)
		assert_failed = 1;
	
	testResultXml("DBus_Type_Basic0");
	close_log_file();
}
Example #16
0
void create_xml(int result)
{
    if(result)
        assert_failed = 1;
    
    testResultXml("test_utils_log");
    close_log_file();
}
void create_xml(int result)
{
    if(result)
        assert_failed = 1;

    testResultXml("dbus_method_call");
    close_log_file();
}
void create_xml(int result)
{
	if(result)
		assert_failed = 1;
	
	testResultXml("dbus_connection_get_outgoing_size0");
	close_log_file();
}
Example #19
0
void create_xml(int result)
{
    if(result)
        assert_failed = 1;
    
    testResultXml("examples_jpeg");
    close_log_file();
}
Example #20
0
void create_xml(int result)
{
    if(result)
        assert_failed = 1;
    
    testResultXml("memcpy-speed");
    close_log_file();
}
Example #21
0
void create_xml(int result)
	{
	if(result)
		assert_failed = 1;
	
	testResultXml("dbus_daemon_test_main");
    close_log_file();
	}
void create_xml(int result)
{
	if(result)
		assert_failed = 1;
	
	testResultXml("dbus_simultaneous_connections");
	close_log_file();
}
Example #23
0
void create_xml(int result)
{
    if(result)
        assert_failed = 1;
    
    testResultXml("testsuite_debug");
    close_log_file();
}
void create_xml(int result)
{
	if(result)
		assert_failed = 1;
	
	testResultXml("dbus_move_error1");
	close_log_file();
}
Example #25
0
void create_xml(int result)
	{
	if(result)
		assert_failed = 1;
	
	testResultXml("g_proxy_path");
    close_log_file();
	}
void create_xml(int result)
{
	if(result)
		assert_failed = 1;
	
	testResultXml("dbus_bus_get_unique_name0");
	close_log_file();
}
Example #27
0
void create_xml(int result)
{
    if(result)
        assert_failed = 1;
    
    testResultXml(xmlfile);
    close_log_file();
}
void create_xml(int result)
{
	if(result)
		assert_failed = 1;
	
	testResultXml("dbus_connection_data_slot0");
	close_log_file();
}
void create_xml(int result)
{
	if(result)
		assert_failed = 1;
	
	testResultXml("dbus_N_messages1");
	close_log_file();
}
void close_data_files(FILE *fp)
{
#ifndef NDEBUG
	open_count--;
	assert(open_count == 0);
#endif
	close_log_file(fp);
}