aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/asn1/test/asn1_SUITE.erl22
-rw-r--r--lib/common_test/doc/src/Makefile43
-rw-r--r--lib/common_test/doc/src/basics_chapter.xml230
-rw-r--r--lib/common_test/doc/src/common_test_app.xml776
-rw-r--r--lib/common_test/doc/src/config_file_chapter.xml558
-rw-r--r--lib/common_test/doc/src/cover_chapter.xml349
-rw-r--r--lib/common_test/doc/src/ct.xml1412
-rw-r--r--lib/common_test/doc/src/ct_cover.xml106
-rw-r--r--lib/common_test/doc/src/ct_ftp.xml277
-rw-r--r--lib/common_test/doc/src/ct_hooks.xml860
-rw-r--r--lib/common_test/doc/src/ct_hooks_chapter.xml691
-rw-r--r--lib/common_test/doc/src/ct_master.xml220
-rw-r--r--lib/common_test/doc/src/ct_master_chapter.xml291
-rw-r--r--lib/common_test/doc/src/ct_netconfc.xml1039
-rw-r--r--lib/common_test/doc/src/ct_property_test.xml116
-rw-r--r--lib/common_test/doc/src/ct_rpc.xml220
-rw-r--r--lib/common_test/doc/src/ct_run.xml297
-rw-r--r--lib/common_test/doc/src/ct_slave.xml221
-rw-r--r--lib/common_test/doc/src/ct_snmp.xml523
-rw-r--r--lib/common_test/doc/src/ct_ssh.xml1150
-rw-r--r--lib/common_test/doc/src/ct_telnet.xml601
-rw-r--r--lib/common_test/doc/src/dependencies_chapter.xml382
-rw-r--r--lib/common_test/doc/src/event_handler_chapter.xml384
-rw-r--r--lib/common_test/doc/src/example_chapter.xml910
-rw-r--r--lib/common_test/doc/src/getting_started_chapter.xml286
-rw-r--r--lib/common_test/doc/src/install_chapter.xml25
-rw-r--r--lib/common_test/doc/src/introduction.xml75
-rw-r--r--lib/common_test/doc/src/part.xml33
-rw-r--r--lib/common_test/doc/src/ref_man.xml38
-rw-r--r--lib/common_test/doc/src/run_test_chapter.xml2230
-rw-r--r--lib/common_test/doc/src/test_structure_chapter.xml146
-rw-r--r--lib/common_test/doc/src/unix_telnet.xml134
-rw-r--r--lib/common_test/doc/src/why_test_chapter.xml43
-rw-r--r--lib/common_test/doc/src/write_test_chapter.xml1363
-rw-r--r--lib/common_test/src/common_test.app.src36
-rw-r--r--lib/common_test/src/ct.erl75
-rw-r--r--lib/common_test/src/ct_conn_log_h.erl48
-rw-r--r--lib/common_test/src/ct_framework.erl127
-rw-r--r--lib/common_test/src/ct_groups.erl121
-rw-r--r--lib/common_test/src/ct_hooks.erl24
-rw-r--r--lib/common_test/src/ct_logs.erl239
-rw-r--r--lib/common_test/src/ct_master_logs.erl13
-rw-r--r--lib/common_test/src/ct_netconfc.erl13
-rw-r--r--lib/common_test/src/ct_release_test.erl27
-rw-r--r--lib/common_test/src/ct_run.erl7
-rw-r--r--lib/common_test/src/ct_testspec.erl109
-rw-r--r--lib/common_test/src/ct_util.erl6
-rw-r--r--lib/common_test/src/cth_conn_log.erl2
-rw-r--r--lib/common_test/src/cth_log_redirect.erl9
-rw-r--r--lib/common_test/src/erl2html2.erl2
-rw-r--r--lib/common_test/src/test_server.app.src39
-rw-r--r--lib/common_test/src/test_server.appup.src22
-rw-r--r--lib/common_test/src/test_server.erl297
-rw-r--r--lib/common_test/src/test_server_ctrl.erl68
-rw-r--r--lib/common_test/src/test_server_gl.erl81
-rw-r--r--lib/common_test/src/test_server_internal.hrl1
-rw-r--r--lib/common_test/src/test_server_node.erl13
-rw-r--r--lib/common_test/src/test_server_sup.erl6
-rw-r--r--lib/common_test/test/Makefile3
-rw-r--r--lib/common_test/test/ct_error_SUITE.erl26
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/lib_error_1_SUITE.erl21
-rw-r--r--lib/common_test/test/ct_hooks_SUITE.erl2
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl48
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl75
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl36
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl130
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl46
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl64
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/prio_cth.erl134
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl134
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl136
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl130
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_end_cth.erl134
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl132
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl154
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl128
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl154
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_config_cth.erl248
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_data_dir_cth.erl178
-rw-r--r--lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl3
-rw-r--r--lib/common_test/test/ct_release_test_SUITE.erl190
-rw-r--r--lib/common_test/test/ct_release_test_SUITE_data/release_test_SUITE.erl118
-rw-r--r--lib/common_test/test/ct_test_support.erl4
-rw-r--r--lib/common_test/test/erl2html2_SUITE.erl2
-rw-r--r--lib/common_test/test_server/ts_install_cth.erl17
-rw-r--r--lib/compiler/src/beam_block.erl10
-rw-r--r--lib/compiler/src/v3_core.erl40
-rw-r--r--lib/compiler/test/Makefile3
-rw-r--r--lib/compiler/test/beam_block_SUITE.erl66
-rw-r--r--lib/compiler/test/bs_bincomp_SUITE.erl46
-rw-r--r--lib/diameter/src/base/diameter_service.erl513
-rw-r--r--lib/diameter/src/base/diameter_traffic.erl9
-rw-r--r--lib/diameter/src/diameter.appup.src44
-rw-r--r--lib/diameter/vsn.mk2
-rw-r--r--lib/erl_interface/configure.in2
-rw-r--r--lib/inets/src/http_server/httpd_request_handler.erl9
-rw-r--r--lib/inets/src/tftp/tftp_engine.erl36
-rw-r--r--lib/inets/test/ftp_suite_lib.erl1
-rw-r--r--lib/inets/test/tftp_SUITE.erl37
-rw-r--r--lib/kernel/doc/src/app.xml2
-rw-r--r--lib/kernel/doc/src/seq_trace.xml2
-rw-r--r--lib/kernel/examples/uds_dist/c_src/uds_drv.c12
-rw-r--r--lib/kernel/src/erl_distribution.erl90
-rw-r--r--lib/kernel/src/erl_epmd.erl18
-rw-r--r--lib/kernel/src/hipe_unified_loader.erl16
-rw-r--r--lib/kernel/src/kernel.app.src2
-rw-r--r--lib/kernel/src/kernel.appup.src8
-rw-r--r--lib/kernel/src/net_kernel.erl131
-rw-r--r--lib/kernel/src/rpc.erl8
-rw-r--r--lib/kernel/test/application_SUITE.erl542
-rw-r--r--lib/kernel/test/bif_SUITE.erl807
-rw-r--r--lib/kernel/test/cleanup.erl21
-rw-r--r--lib/kernel/test/code_SUITE.erl262
-rw-r--r--lib/kernel/test/disk_log_SUITE.erl5954
-rw-r--r--lib/kernel/test/erl_boot_server_SUITE.erl316
-rw-r--r--lib/kernel/test/erl_distribution_SUITE.erl1282
-rw-r--r--lib/kernel/test/erl_distribution_wb_SUITE.erl451
-rw-r--r--lib/kernel/test/erl_prim_loader_SUITE.erl331
-rw-r--r--lib/kernel/test/error_handler_SUITE.erl4
-rw-r--r--lib/kernel/test/error_logger_SUITE.erl158
-rw-r--r--lib/kernel/test/error_logger_warn_SUITE.erl62
-rw-r--r--lib/kernel/test/file_SUITE.erl3904
-rw-r--r--lib/kernel/test/file_name_SUITE.erl525
-rw-r--r--lib/kernel/test/gen_sctp_SUITE.erl1759
-rw-r--r--lib/kernel/test/gen_tcp_api_SUITE.erl335
-rw-r--r--lib/kernel/test/gen_tcp_echo_SUITE.erl476
-rw-r--r--lib/kernel/test/gen_tcp_misc_SUITE.erl431
-rw-r--r--lib/kernel/test/gen_udp_SUITE.erl437
-rw-r--r--lib/kernel/test/global_SUITE.erl3308
-rw-r--r--lib/kernel/test/global_group_SUITE.erl1451
-rw-r--r--lib/kernel/test/heart_SUITE.erl99
-rw-r--r--lib/kernel/test/ignore_cores.erl12
-rw-r--r--lib/kernel/test/inet_SUITE.erl617
-rw-r--r--lib/kernel/test/inet_res_SUITE.erl44
-rw-r--r--lib/kernel/test/inet_sockopt_SUITE.erl804
-rw-r--r--lib/kernel/test/init_SUITE.erl556
-rw-r--r--lib/kernel/test/interactive_shell_SUITE.erl458
-rw-r--r--lib/kernel/test/kernel_SUITE.erl24
-rw-r--r--lib/kernel/test/kernel_config_SUITE.erl44
-rw-r--r--lib/kernel/test/multi_load_SUITE.erl15
-rw-r--r--lib/kernel/test/os_SUITE.erl212
-rw-r--r--lib/kernel/test/pdict_SUITE.erl32
-rw-r--r--lib/kernel/test/pg2_SUITE.erl242
-rw-r--r--lib/kernel/test/prim_file_SUITE.erl1981
-rw-r--r--lib/kernel/test/ram_file_SUITE.erl756
-rw-r--r--lib/kernel/test/rpc_SUITE.erl573
-rw-r--r--lib/kernel/test/sendfile_SUITE.erl2
-rw-r--r--lib/kernel/test/seq_trace_SUITE.erl446
-rw-r--r--lib/kernel/test/wrap_log_reader_SUITE.erl413
-rw-r--r--lib/kernel/test/zlib_SUITE.erl516
-rw-r--r--lib/observer/test/crashdump_viewer_SUITE.erl19
-rw-r--r--lib/public_key/src/pubkey_pem.erl2
-rw-r--r--lib/public_key/test/public_key_SUITE.erl11
-rw-r--r--lib/runtime_tools/c_src/trace_file_drv.c4
-rw-r--r--lib/runtime_tools/c_src/trace_ip_drv.c15
-rw-r--r--lib/sasl/src/sasl.appup.src8
-rw-r--r--lib/ssh/test/ssh_algorithms_SUITE.erl2
-rw-r--r--lib/ssh/test/ssh_basic_SUITE.erl2
-rw-r--r--lib/ssh/test/ssh_connection_SUITE.erl2
-rw-r--r--lib/ssh/test/ssh_options_SUITE.erl2
-rw-r--r--lib/ssh/test/ssh_protocol_SUITE.erl2
-rw-r--r--lib/ssh/test/ssh_renegotiate_SUITE.erl2
-rw-r--r--lib/ssh/test/ssh_sftp_SUITE.erl2
-rw-r--r--lib/ssh/test/ssh_sftpd_SUITE.erl2
-rw-r--r--lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl2
-rw-r--r--lib/ssh/test/ssh_sup_SUITE.erl4
-rw-r--r--lib/ssh/test/ssh_to_openssh_SUITE.erl2
-rw-r--r--lib/ssh/test/ssh_upgrade_SUITE.erl2
-rw-r--r--lib/ssl/doc/src/ssl_distribution.xml23
-rw-r--r--lib/ssl/src/Makefile1
-rw-r--r--lib/ssl/src/inet6_tls_dist.erl46
-rw-r--r--lib/ssl/src/inet_tls_dist.erl95
-rw-r--r--lib/ssl/src/ssl.app.src1
-rw-r--r--lib/ssl/src/ssl_tls_dist_proxy.erl30
-rw-r--r--lib/stdlib/doc/src/filename.xml158
-rw-r--r--lib/stdlib/src/erl_parse.yrl2
-rw-r--r--lib/stdlib/src/filename.erl160
-rw-r--r--lib/stdlib/src/stdlib.appup.src8
-rw-r--r--lib/stdlib/test/array_SUITE.erl77
-rw-r--r--lib/stdlib/test/base64_SUITE.erl57
-rw-r--r--lib/stdlib/test/beam_lib_SUITE.erl739
-rw-r--r--lib/stdlib/test/binary_module_SUITE.erl1241
-rw-r--r--lib/stdlib/test/binref.erl8
-rw-r--r--lib/stdlib/test/c_SUITE.erl181
-rw-r--r--lib/stdlib/test/calendar_SUITE.erl235
-rw-r--r--lib/stdlib/test/dets_SUITE.erl368
-rw-r--r--lib/stdlib/test/dict_SUITE.erl11
-rw-r--r--lib/stdlib/test/digraph_SUITE.erl402
-rw-r--r--lib/stdlib/test/digraph_utils_SUITE.erl327
-rw-r--r--lib/stdlib/test/dummy1_h.erl2
-rw-r--r--lib/stdlib/test/dummy_via.erl2
-rw-r--r--lib/stdlib/test/edlin_expand_SUITE.erl34
-rw-r--r--lib/stdlib/test/epp_SUITE.erl450
-rw-r--r--lib/stdlib/test/erl_anno_SUITE.erl49
-rw-r--r--lib/stdlib/test/erl_eval_SUITE.erl1010
-rw-r--r--lib/stdlib/test/erl_expand_records_SUITE.erl141
-rw-r--r--lib/stdlib/test/erl_internal_SUITE.erl17
-rw-r--r--lib/stdlib/test/erl_lint_SUITE.erl378
-rw-r--r--lib/stdlib/test/erl_pp_SUITE.erl328
-rw-r--r--lib/stdlib/test/erl_scan_SUITE.erl530
-rw-r--r--lib/stdlib/test/error_logger_h_SUITE.erl10
-rw-r--r--lib/stdlib/test/escript_SUITE.erl683
-rw-r--r--lib/stdlib/test/ets_SUITE.erl4698
-rw-r--r--lib/stdlib/test/ets_tough_SUITE.erl57
-rw-r--r--lib/stdlib/test/file_sorter_SUITE.erl1363
-rw-r--r--lib/stdlib/test/filelib_SUITE.erl234
-rw-r--r--lib/stdlib/test/filename_SUITE.erl1106
-rw-r--r--lib/stdlib/test/fixtable_SUITE.erl491
-rw-r--r--lib/stdlib/test/format_SUITE.erl24
-rw-r--r--lib/stdlib/test/gen_event_SUITE.erl1230
-rw-r--r--lib/stdlib/test/gen_fsm_SUITE.erl423
-rw-r--r--lib/stdlib/test/gen_server_SUITE.erl893
-rw-r--r--lib/stdlib/test/id_transform_SUITE.erl21
-rw-r--r--lib/stdlib/test/io_SUITE.erl1759
-rw-r--r--lib/stdlib/test/io_proto_SUITE.erl1461
-rw-r--r--lib/stdlib/test/lists_SUITE.erl2303
-rw-r--r--lib/stdlib/test/log_mf_h_SUITE.erl47
-rw-r--r--lib/stdlib/test/maps_SUITE.erl20
-rw-r--r--lib/stdlib/test/ms_transform_SUITE.erl583
-rw-r--r--lib/stdlib/test/proc_lib_SUITE.erl100
-rw-r--r--lib/stdlib/test/qlc_SUITE.erl613
-rw-r--r--lib/stdlib/test/queue_SUITE.erl434
-rw-r--r--lib/stdlib/test/rand_SUITE.erl59
-rw-r--r--lib/stdlib/test/random_SUITE.erl100
-rw-r--r--lib/stdlib/test/re_SUITE.erl602
-rw-r--r--lib/stdlib/test/run_pcre_tests.erl37
-rw-r--r--lib/stdlib/test/select_SUITE.erl465
-rw-r--r--lib/stdlib/test/sets_SUITE.erl11
-rw-r--r--lib/stdlib/test/shell_SUITE.erl3296
-rw-r--r--lib/stdlib/test/slave_SUITE.erl176
-rw-r--r--lib/stdlib/test/sofs_SUITE.erl2985
-rw-r--r--lib/stdlib/test/stdlib_SUITE.erl51
-rw-r--r--lib/stdlib/test/string_SUITE.erl562
-rw-r--r--lib/stdlib/test/supervisor_SUITE.erl64
-rw-r--r--lib/stdlib/test/supervisor_bridge_SUITE.erl83
-rw-r--r--lib/stdlib/test/sys_SUITE.erl92
-rw-r--r--lib/stdlib/test/tar_SUITE.erl617
-rw-r--r--lib/stdlib/test/timer_SUITE.erl49
-rw-r--r--lib/stdlib/test/timer_simple_SUITE.erl331
-rw-r--r--lib/stdlib/test/unicode_SUITE.erl706
-rw-r--r--lib/stdlib/test/win32reg_SUITE.erl60
-rw-r--r--lib/stdlib/test/y2k_SUITE.erl155
-rw-r--r--lib/stdlib/test/zip_SUITE.erl172
-rw-r--r--lib/tools/src/cover.erl4
-rw-r--r--lib/tools/test/cover_SUITE.erl29
-rw-r--r--lib/wx/api_gen/gl_gen.erl2
-rw-r--r--lib/wx/api_gen/wx_extra/added_func.h7
-rw-r--r--lib/wx/api_gen/wx_gen.erl8
-rw-r--r--lib/wx/api_gen/wx_gen_cpp.erl36
-rw-r--r--lib/wx/api_gen/wx_gen_erl.erl2
-rw-r--r--lib/wx/api_gen/wxapi.conf7
-rw-r--r--lib/wx/c_src/gen/wxe_derived_dest.h6
-rw-r--r--lib/wx/c_src/gen/wxe_funcs.cpp129
-rw-r--r--lib/wx/c_src/gen/wxe_macros.h6366
-rw-r--r--lib/wx/c_src/wxe_driver.c2
-rw-r--r--lib/wx/c_src/wxe_gl.cpp2
-rw-r--r--lib/wx/configure.in8
-rw-r--r--lib/wx/include/wx.hrl6
-rw-r--r--lib/wx/src/gen/wxAuiNotebook.erl41
-rw-r--r--lib/wx/src/gen/wxBitmapButton.erl47
-rw-r--r--lib/wx/src/gen/wxButton.erl43
-rw-r--r--lib/wx/src/gen/wxCalendarCtrl.erl43
-rw-r--r--lib/wx/src/gen/wxCheckBox.erl43
-rw-r--r--lib/wx/src/gen/wxCheckListBox.erl92
-rw-r--r--lib/wx/src/gen/wxChoice.erl80
-rw-r--r--lib/wx/src/gen/wxChoicebook.erl43
-rw-r--r--lib/wx/src/gen/wxColourDialog.erl59
-rw-r--r--lib/wx/src/gen/wxColourPickerCtrl.erl67
-rw-r--r--lib/wx/src/gen/wxComboBox.erl80
-rw-r--r--lib/wx/src/gen/wxControl.erl43
-rw-r--r--lib/wx/src/gen/wxControlWithItems.erl43
-rw-r--r--lib/wx/src/gen/wxDatePickerCtrl.erl67
-rw-r--r--lib/wx/src/gen/wxDialog.erl67
-rw-r--r--lib/wx/src/gen/wxDirDialog.erl59
-rw-r--r--lib/wx/src/gen/wxDirPickerCtrl.erl67
-rw-r--r--lib/wx/src/gen/wxFileDialog.erl59
-rw-r--r--lib/wx/src/gen/wxFilePickerCtrl.erl67
-rw-r--r--lib/wx/src/gen/wxFindReplaceDialog.erl59
-rw-r--r--lib/wx/src/gen/wxFontDialog.erl59
-rw-r--r--lib/wx/src/gen/wxFontPickerCtrl.erl67
-rw-r--r--lib/wx/src/gen/wxFrame.erl67
-rw-r--r--lib/wx/src/gen/wxGLCanvas.erl43
-rw-r--r--lib/wx/src/gen/wxGauge.erl43
-rw-r--r--lib/wx/src/gen/wxGenericDirCtrl.erl43
-rw-r--r--lib/wx/src/gen/wxGrid.erl57
-rw-r--r--lib/wx/src/gen/wxHtmlWindow.erl57
-rw-r--r--lib/wx/src/gen/wxListBox.erl80
-rw-r--r--lib/wx/src/gen/wxListCtrl.erl61
-rw-r--r--lib/wx/src/gen/wxListView.erl43
-rw-r--r--lib/wx/src/gen/wxListbook.erl43
-rw-r--r--lib/wx/src/gen/wxMDIChildFrame.erl61
-rw-r--r--lib/wx/src/gen/wxMDIClientWindow.erl43
-rw-r--r--lib/wx/src/gen/wxMDIParentFrame.erl66
-rw-r--r--lib/wx/src/gen/wxMenuBar.erl48
-rw-r--r--lib/wx/src/gen/wxMessageDialog.erl59
-rw-r--r--lib/wx/src/gen/wxMiniFrame.erl66
-rw-r--r--lib/wx/src/gen/wxMultiChoiceDialog.erl59
-rw-r--r--lib/wx/src/gen/wxNotebook.erl43
-rw-r--r--lib/wx/src/gen/wxPanel.erl43
-rw-r--r--lib/wx/src/gen/wxPasswordEntryDialog.erl50
-rw-r--r--lib/wx/src/gen/wxPickerBase.erl43
-rw-r--r--lib/wx/src/gen/wxPopupTransientWindow.erl47
-rw-r--r--lib/wx/src/gen/wxPopupWindow.erl43
-rw-r--r--lib/wx/src/gen/wxPreviewCanvas.erl57
-rw-r--r--lib/wx/src/gen/wxPreviewControlBar.erl43
-rw-r--r--lib/wx/src/gen/wxPreviewFrame.erl66
-rw-r--r--lib/wx/src/gen/wxPrintDialog.erl59
-rw-r--r--lib/wx/src/gen/wxProgressDialog.erl59
-rw-r--r--lib/wx/src/gen/wxRadioBox.erl46
-rw-r--r--lib/wx/src/gen/wxRadioButton.erl43
-rw-r--r--lib/wx/src/gen/wxSashLayoutWindow.erl34
-rw-r--r--lib/wx/src/gen/wxSashWindow.erl43
-rw-r--r--lib/wx/src/gen/wxScrollBar.erl45
-rw-r--r--lib/wx/src/gen/wxScrolledWindow.erl43
-rw-r--r--lib/wx/src/gen/wxSingleChoiceDialog.erl59
-rw-r--r--lib/wx/src/gen/wxSlider.erl43
-rw-r--r--lib/wx/src/gen/wxSpinButton.erl43
-rw-r--r--lib/wx/src/gen/wxSpinCtrl.erl43
-rw-r--r--lib/wx/src/gen/wxSplashScreen.erl66
-rw-r--r--lib/wx/src/gen/wxSplitterWindow.erl43
-rw-r--r--lib/wx/src/gen/wxStaticBitmap.erl43
-rw-r--r--lib/wx/src/gen/wxStaticBox.erl43
-rw-r--r--lib/wx/src/gen/wxStaticLine.erl43
-rw-r--r--lib/wx/src/gen/wxStaticText.erl43
-rw-r--r--lib/wx/src/gen/wxStatusBar.erl43
-rw-r--r--lib/wx/src/gen/wxStyledTextCtrl.erl60
-rw-r--r--lib/wx/src/gen/wxTextCtrl.erl43
-rw-r--r--lib/wx/src/gen/wxTextEntryDialog.erl59
-rw-r--r--lib/wx/src/gen/wxToggleButton.erl43
-rw-r--r--lib/wx/src/gen/wxToolBar.erl43
-rw-r--r--lib/wx/src/gen/wxToolbook.erl43
-rw-r--r--lib/wx/src/gen/wxTopLevelWindow.erl43
-rw-r--r--lib/wx/src/gen/wxTreeCtrl.erl43
-rw-r--r--lib/wx/src/gen/wxTreebook.erl43
-rw-r--r--lib/wx/src/gen/wxWindow.erl78
-rw-r--r--lib/wx/src/gen/wxe_debug.hrl6366
-rw-r--r--lib/wx/src/gen/wxe_funcs.hrl6366
-rw-r--r--lib/wx/src/wxe_server.erl22
-rw-r--r--lib/wx/test/wx_basic_SUITE.erl14
-rw-r--r--lib/wx/test/wx_event_SUITE.erl30
340 files changed, 58208 insertions, 53329 deletions
diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl
index d392055458..7214c4b300 100644
--- a/lib/asn1/test/asn1_SUITE.erl
+++ b/lib/asn1/test/asn1_SUITE.erl
@@ -628,12 +628,22 @@ ber_other(Config, Rule, Opts) ->
der(Config) ->
asn1_test_lib:compile_all(ber_modules(), Config, [der]).
-module_test(M, Config, Rule, Opts) ->
- asn1_test_lib:compile(M, Config, [Rule|Opts]),
- case asn1ct:test(list_to_atom(M), [{i, ?config(case_dir, Config)}]) of
- ok -> ok;
- Error ->
- erlang:error({test_failed, M, Opts, Error})
+module_test(M0, Config, Rule, Opts) ->
+ asn1_test_lib:compile(M0, Config, [Rule|Opts]),
+ case list_to_atom(M0) of
+ 'LDAP' ->
+ %% Because of the recursive definition of 'Filter' in
+ %% the LDAP module, the construction of a sample
+ %% value for 'Filter' is not guaranteed to terminate.
+ ok;
+ M ->
+ TestOpts = [{i, ?config(case_dir, Config)}],
+ case asn1ct:test(M, TestOpts) of
+ ok ->
+ ok;
+ Error ->
+ erlang:error({test_failed, M, Opts, Error})
+ end
end.
diff --git a/lib/common_test/doc/src/Makefile b/lib/common_test/doc/src/Makefile
index cedddd75ac..a0c89b1222 100644
--- a/lib/common_test/doc/src/Makefile
+++ b/lib/common_test/doc/src/Makefile
@@ -36,26 +36,24 @@ RELSYSDIR = $(RELEASE_PATH)/lib/$(APPLICATION)-$(VSN)
# Target Specs
# ----------------------------------------------------
-# REMEMBER: links to HTML files for these modules in ref_man.xml
-CT_MODULES = \
- ct \
- ct_master \
- ct_cover \
- ct_telnet \
- ct_ftp \
- ct_ssh \
- ct_rpc \
- ct_snmp \
- unix_telnet \
- ct_slave \
- ct_property_test \
- ct_netconfc
-
CT_XML_FILES = $(CT_MODULES:=.xml)
XML_APPLICATION_FILES = ref_man.xml
XML_REF1_FILES = ct_run.xml
-XML_REF3_FILES = $(CT_XML_FILES) ct_hooks.xml
+# REMEMBER: links to HTML files for these modules in ref_man.xml
+XML_REF3_FILES = ct.xml \
+ ct_master.xml \
+ ct_cover.xml \
+ ct_telnet.xml \
+ ct_ftp.xml \
+ ct_ssh.xml \
+ ct_rpc.xml \
+ ct_snmp.xml \
+ unix_telnet.xml \
+ ct_slave.xml \
+ ct_property_test.xml \
+ ct_netconfc.xml \
+ ct_hooks.xml
XML_REF6_FILES = common_test_app.xml
XML_PART_FILES = part.xml
@@ -80,8 +78,6 @@ XML_CHAPTER_FILES = \
notes.xml \
notes_history.xml
-MAKE_EDOC = make_edoc
-
BOOK_FILES = book.xml
GIF_FILES = \
@@ -92,7 +88,7 @@ GIF_FILES = \
INSTALL_NOTES = ../../notes.html
XML_FILES=$(XML_APPLICATION_FILES) $(XML_REF1_FILES) $(XML_REF3_FILES) $(XML_REF6_FILES) \
- $(XML_PART_FILES) $(XML_CHAPTER_FILES) $(XML_REF_FILES) $(BOOK_FILES)
+ $(XML_PART_FILES) $(XML_CHAPTER_FILES) $(BOOK_FILES)
# ----------------------------------------------------
@@ -119,19 +115,11 @@ DVIPS_FLAGS +=
# Targets
# ----------------------------------------------------
-CT_SRC_DIR = $(ERL_TOP)/../internal_tools/common_test/src
-
$(HTMLDIR)/%.gif: %.gif
$(INSTALL_DATA) $< $@
docs: pdf html man
-$(CT_XML_FILES): %.xml: ../../src/%.erl
- escript $(DOCGEN)/priv/bin/xml_from_edoc.escript -preprocess true -i $(XMERL_DIR)/include \
- -i ../../../test_server/include -i ../../include \
- -i ../../../../erts/lib/kernel/include -i ../../../../lib/kernel/include \
- -i ../../../../erts/lib/snmp/include -i ../../../../lib/snmp/include ../../src/$(@:%.xml=%.erl)
-
$(TOP_PDF_FILE): $(XML_FILES)
pdf: $(TOP_PDF_FILE)
@@ -146,7 +134,6 @@ man: $(MAN6_FILES) $(MAN3_FILES) $(MAN1_FILES)
debug opt:
clean clean_docs:
- rm -f $(CT_XML_FILES)
rm -rf $(HTMLDIR)/*
rm -f $(MAN1DIR)/*
rm -f $(MAN3DIR)/*
diff --git a/lib/common_test/doc/src/basics_chapter.xml b/lib/common_test/doc/src/basics_chapter.xml
index a01e3a9272..1a5a686fa0 100644
--- a/lib/common_test/doc/src/basics_chapter.xml
+++ b/lib/common_test/doc/src/basics_chapter.xml
@@ -31,74 +31,74 @@
</header>
<marker id="basics"></marker>
<section>
- <title>Introduction</title>
+ <title>General</title>
- <p>The <em>Common Test</em> framework (CT) is a tool which supports
- implementation and automated execution of test cases towards arbitrary
- types of target systems. The CT framework is based on the OTP Test
- Server and it's the main tool being used in all testing- and verification
- activities that are part of Erlang/OTP system development- and maintenance.
+ <p>The <c>Common Test</c> framework is a tool that supports
+ implementation and automated execution of test cases to any
+ types of target systems. <c>Common Test</c> is the main tool being used
+ in all testing- and verification activities that are part of Erlang/OTP
+ system development and maintenance.
</p>
- <p>Test cases can be executed individually or in batches. Common Test
- also features a distributed testing mode with central control and logging
- (a feature that makes it possible to test multiple systems independently in
- one common session, useful e.g. for running automated large-scale regression
- tests).
+ <p>Test cases can be executed individually or in batches. <c>Common Test</c>
+ also features a distributed testing mode with central control and logging.
+ With this feature, multiple systems can be tested independently in
+ one common session. This is useful, for example, when running automated
+ large-scale regression tests.
</p>
<p>
- The SUT (System Under Test) may consist of one or several target
- nodes. CT contains a generic test server which, together with
- other test utilities, is used to perform test case execution.
- It is possible to start the tests from a GUI or from the OS- or
+ The System Under Test (SUT) can consist of one or more target
+ nodes. <c>Common Test</c> contains a generic test server that,
+ together with other test utilities, is used to perform test case execution.
+ The tests can be started from a GUI, from the OS shell, or from an
Erlang shell. <em>Test suites</em> are files (Erlang
modules) that contain the <em>test cases</em> (Erlang functions)
to be executed. <em>Support modules</em> provide functions
- that the test cases utilize in order to carry out the tests.
+ that the test cases use to do the tests.
</p>
- <p>In a black-box testing scenario, CT based test programs connect to
- the target system(s) via standard O&amp;M and CLI protocols. CT
+ <p>In a black-box testing scenario, <c>Common Test</c>-based test programs connect to
+ the target system(s) through standard O&amp;M and CLI protocols. <c>Common Test</c>
provides implementations of, and wrapper interfaces to, some of these
- protocols (most of which exist as stand-alone components and
+ protocols (most of which exist as standalone components and
applications in OTP). The wrappers simplify configuration and add
- verbosity for logging purposes. CT will be continously extended with
- useful support modules. (Note however that it's
- a straightforward task to use any arbitrary Erlang/OTP component
- for testing purposes with Common Test, without needing a CT wrapper
- for it. It's as simple as calling Erlang functions). There
- are a number of target independent interfaces supported in CT, such as
- Generic Telnet, FTP, etc, which can be specialized or used
- directly for controlling instruments, traffic load generators, etc.
+ verbosity for logging purposes. <c>Common Test</c> is continously extended with
+ useful support modules. However, notice that it is
+ a straightforward task to use any Erlang/OTP component
+ for testing purposes with <c>Common Test</c>, without needing a <c>Common Test</c>
+ wrapper for it. It is as simple as calling Erlang functions. A number of
+ target-independent interfaces are supported in <c>Common Test</c>, such as
+ Generic Telnet and FTP. These can be specialized or used
+ directly for controlling instruments, traffic load generators, and so on.
</p>
- <p>Common Test is also a very useful tool for white-box testing Erlang
- code (e.g. module testing), since the test programs can call exported Erlang
- functions directly and there's very little overhead required for
+ <p><c>Common Test</c> is also a very useful tool for white-box testing Erlang
+ code (for example, module testing), as the test programs can call exported Erlang
+ functions directly. there is very little overhead required for
implementing basic test suites and executing simple tests. For black-box
- testing Erlang software, Erlang RPC as well as standard O&amp;M interfaces
- can for example be used.
+ testing Erlang software, Erlang RPC and standard O&amp;M interfaces
+ can be used for example.
</p>
- <p>A test case can handle several connections towards one or
- several target systems, instruments and traffic generators in
- parallel in order to perform the necessary actions for a
- test. The handling of many connections in parallel is one of
- the major strengths of Common Test (thanks to the efficient
- support for concurrency in the Erlang runtime system - which CT users
- can take great advantage of!).
+ <p>A test case can handle several connections to one or
+ more target systems, instruments, and traffic generators in
+ parallel to perform the necessary actions for a test.
+ The handling of many connections in parallel is one of
+ the major strengths of <c>Common Test</c>, thanks to the efficient
+ support for concurrency in the Erlang runtime system, which <c>Common Test</c>
+ users can take great advantage of.
</p>
</section>
<section>
<title>Test Suite Organisation</title>
<p>
- The test suites are organized in test directories and each test suite
- may have a separate data directory. Typically, these files and directories
- are version controlled similarly to other forms of source code (possibly by
- means of a version control system like GIT or Subversion). However, CT does
- not itself put any requirements on (or has any form of awareness of)
+ Test suites are organized in test directories and each test suite
+ can have a separate data directory. Typically, these files and directories
+ are version-controlled similar to other forms of source code (possibly by
+ a version control system like GIT or Subversion). However, <c>Common Test</c>
+ does not itself put any requirements on (or has any awareness of)
possible file and directory versions.
</p>
</section>
@@ -109,8 +109,8 @@
Support libraries contain functions that are useful for all test suites,
or for test suites in a specific functional area or subsystem.
In addition to the general support libraries provided by the
- CT framework, and the various libraries and applications provided by
- Erlang/OTP, there might also be a need for customized (user specific)
+ <c>Common Test</c> framework, and the various libraries and applications provided by
+ Erlang/OTP, there can also be a need for customized (user specific)
support libraries.
</p>
</section>
@@ -121,118 +121,122 @@
Testing is performed by running test suites (sets of test cases) or
individual test cases. A test suite is implemented as an Erlang module named
<c><![CDATA[<suite_name>_SUITE.erl]]></c> which contains a number of test cases.
- A test case is an Erlang function which tests one or more things.
- The test case is the smallest unit that the CT test server deals with.
+ A test case is an Erlang function that tests one or more things.
+ The test case is the smallest unit that the <c>Common Test</c> test server deals with.
</p>
<p>
- Subsets of test cases, called test case groups, may also be defined. A test case
+ Subsets of test cases, called test case groups, can also be defined. A test case
group can have execution properties associated with it. Execution properties
- specify whether the test cases in the group should be executed in
- random order, in parallel, in sequence, and if the execution of the group
- should be repeated. Test case groups may also be nested (i.e. a group may,
- besides test cases, contain sub-groups).
+ specify if the test cases in the group are to be executed in
+ random order, in parallel, or in sequence, and if the execution of the group
+ is to be repeated. Test case groups can also be nested (that is, a group can,
+ besides test cases, contain subgroups).
</p>
<p>
- Besides test cases and groups, the test suite may also contain configuration
+ Besides test cases and groups, the test suite can also contain configuration
functions. These functions are meant to be used for setting up (and verifying)
- environment and state on the SUT (and/or the CT host node), required for
- the tests to execute correctly. Examples of operations: Opening a connection
- to the SUT, initializing a database, running an installation script, etc.
- Configuration may be performed per suite, per test case group and per
- individual test case.
+ environment and state in the SUT (and/or the <c>Common Test</c> host node),
+ required for the tests to execute correctly. Examples of operations are:
+ Opening a connection to the SUT, initializing a database, running an installation
+ script, and so on. Configuration can be performed per suite, per test case group,
+ and per individual test case.
</p>
<p>
The test suite module must conform to a
<seealso marker="common_test">callback interface</seealso>
- specified by the CT test server. See the
- <seealso marker="write_test_chapter#intro">Writing Test Suites</seealso> chapter
- for more information.
+ specified by the <c>Common Test</c> test server. For details, see section
+ <seealso marker="write_test_chapter#intro">Writing Test Suites</seealso>.
</p>
<p>
A test case is considered successful if it returns to the caller, no matter
- what the returned value is. A few return values have special meaning however
- (such as <c>{skip,Reason}</c> which indicates that the test case is skipped,
- <c>{comment,Comment}</c> which prints a comment in the log for the test case and
- <c>{save_config,Config}</c> which makes the CT test server pass <c>Config</c> to
- the next test case).
+ what the returned value is. However, a few return values have special meaning
+ as follows:</p>
+ <list type="bulleted">
+ <item><c>{skip,Reason}</c> indicates that the test case is skipped.</item>
+ <item><c>{comment,Comment}</c> prints a comment in the log for the test case.</item>
+ <item><c>{save_config,Config}</c> makes the <c>Common Test</c> test server pass
+ <c>Config</c> to the next test case.</item>
+ </list>
+ <p>
A test case failure is specified as a runtime error (a crash), no matter what
the reason for termination is. If you use Erlang pattern matching effectively,
- you can take advantage of this property. The result will be concise and
+ you can take advantage of this property. The result is concise and
readable test case functions that look much more like scripts than actual programs.
- Simple example:
+ A simple example:
</p>
<pre>
- session(_Config) ->
- {started,ServerId} = my_server:start(),
- {clients,[]} = my_server:get_clients(ServerId),
- MyId = self(),
- connected = my_server:connect(ServerId, MyId),
- {clients,[MyId]} = my_server:get_clients(ServerId),
- disconnected = my_server:disconnect(ServerId, MyId),
- {clients,[]} = my_server:get_clients(ServerId),
- stopped = my_server:stop(ServerId).
- </pre>
+ session(_Config) ->
+ {started,ServerId} = my_server:start(),
+ {clients,[]} = my_server:get_clients(ServerId),
+ MyId = self(),
+ connected = my_server:connect(ServerId, MyId),
+ {clients,[MyId]} = my_server:get_clients(ServerId),
+ disconnected = my_server:disconnect(ServerId, MyId),
+ {clients,[]} = my_server:get_clients(ServerId),
+ stopped = my_server:stop(ServerId).</pre>
<p>
As a test suite runs, all information (including output to <c>stdout</c>) is
- recorded in several different log files. A minimum of information is displayed
+ recorded in many different log files. A minimum of information is displayed
in the user console (only start and stop information, plus a note
for each failed test case).
</p>
<p>
The result from each test case is recorded in a dedicated HTML log file, created
for the particular test run. An overview page displays each test case represented
- by row in a table showing total execution time, whether the case was successful,
- failed or skipped, plus an optional user comment. (For a failed test case, the
- reason for termination is also printed in the comment field). The overview page
+ by a table row showing total execution time, if the case was successful,
+ failed, or skipped, plus an optional user comment. For a failed test case, the
+ reason for termination is also printed in the comment field. The overview page
has a link to each test case log file, providing simple navigation with any standard
HTML browser.
</p>
</section>
<section>
+<marker id="External_Interfaces"></marker>
<title>External Interfaces</title>
<p>
- The CT test server requires that the test suite defines and exports the
+ The <c>Common Test</c> test server requires that the test suite defines and exports the
following mandatory or optional callback functions:
</p>
<taglist>
- <tag>all()</tag>
- <item>Returns a list of all test cases and groups in the suite. (Mandatory)</item>
- <tag>suite()</tag>
- <item>Info function used to return properties for the suite. (Optional)</item>
- <tag>groups()</tag>
- <item>For declaring test case groups. (Optional)</item>
- <tag>init_per_suite(Config)</tag>
- <item>Suite level configuration function, executed before the first
- test case. (Optional)</item>
- <tag>end_per_suite(Config)</tag>
- <item>Suite level configuration function, executed after the last
- test case. (Optional)</item>
- <tag>group(GroupName)</tag>
- <item>Info function used to return properties for a test case group. (Optional)</item>
- <tag>init_per_group(GroupName, Config)</tag>
- <item>Configuration function for a group, executed before the first
- test case. (Optional)</item>
- <tag>end_per_group(GroupName, Config)</tag>
- <item>Configuration function for a group, executed after the last
- test case. (Optional)</item>
- <tag>init_per_testcase(TestCase, Config)</tag>
- <item>Configuration function for a testcase, executed before each
- test case. (Optional)</item>
- <tag>end_per_testcase(TestCase, Config)</tag>
- <item>Configuration function for a testcase, executed after each
- test case. (Optional)</item>
+ <tag><c>all()</c></tag>
+ <item><p>Returns a list of all test cases and groups in the suite. (Mandatory)</p></item>
+ <tag><c>suite()</c></tag>
+ <item><p>Information function used to return properties for the suite. (Optional)</p></item>
+ <tag><c>groups()</c></tag>
+ <item><p>For declaring test case groups. (Optional)</p></item>
+ <tag><c>init_per_suite(Config)</c></tag>
+ <item><p>Suite level configuration function, executed before the first
+ test case. (Optional)</p></item>
+ <tag><c>end_per_suite(Config)</c></tag>
+ <item><p>Suite level configuration function, executed after the last
+ test case. (Optional)</p></item>
+ <tag><c>group(GroupName)</c></tag>
+ <item><p>Information function used to return properties for a test case group. (Optional)</p></item>
+ <tag><c>init_per_group(GroupName, Config)</c></tag>
+ <item><p>Configuration function for a group, executed before the first
+ test case. (Optional)</p></item>
+ <tag><c>end_per_group(GroupName, Config)</c></tag>
+ <item><p>Configuration function for a group, executed after the last
+ test case. (Optional)</p></item>
+ <tag><c>init_per_testcase(TestCase, Config)</c></tag>
+ <item><p>Configuration function for a testcase, executed before each
+ test case. (Optional)</p></item>
+ <tag><c>end_per_testcase(TestCase, Config)</c></tag>
+ <item><p>Configuration function for a testcase, executed after each
+ test case. (Optional)</p></item>
</taglist>
<p>
- For each test case the CT test server expects these functions:
+ For each test case, the <c>Common Test</c> test server expects the
+ following functions:
</p>
<taglist>
<tag>Testcasename()</tag>
- <item>Info function that returns a list of test case properties. (Optional)</item>
+ <item><p>Information function that returns a list of test case properties. (Optional)</p></item>
<tag>Testcasename(Config)</tag>
- <item>The actual test case function.</item>
+ <item><p>The test case function.</p></item>
</taglist>
</section>
</chapter>
diff --git a/lib/common_test/doc/src/common_test_app.xml b/lib/common_test/doc/src/common_test_app.xml
index cc554eb84e..10c93e2ed1 100644
--- a/lib/common_test/doc/src/common_test_app.xml
+++ b/lib/common_test/doc/src/common_test_app.xml
@@ -33,89 +33,84 @@
<file>common_test_app.sgml</file>
</header>
<module>common_test</module>
- <modulesummary>A framework for automated testing of arbitrary target nodes</modulesummary>
+ <modulesummary>A framework for automated testing of any target nodes.</modulesummary>
<description>
- <p>The <em>Common Test</em> framework is an environment for
+ <p>The <c>Common Test</c> framework is an environment for
implementing and performing automatic and semi-automatic execution of
- test cases.
+ test cases.</p>
- Common Test uses the OTP Test Server as engine for test case
- execution and logging.</p>
-
- <p>In brief, Common Test supports:</p>
+ <p>In brief, <c>Common Test</c> supports:</p>
<list>
- <item>Automated execution of test suites (sets of test cases).</item>
- <item>Logging of the events during execution.</item>
- <item>HTML presentation of test suite results.</item>
- <item>HTML presentation of test suite code.</item>
- <item>Support functions for test suite authors.</item>
- <item>Step by step execution of test cases.</item>
+ <item>Automated execution of test suites (sets of test cases)</item>
+ <item>Logging of events during execution</item>
+ <item>HTML presentation of test suite results</item>
+ <item>HTML presentation of test suite code</item>
+ <item>Support functions for test suite authors</item>
+ <item>Step-by-step execution of test cases</item>
</list>
-
- <p>The following sections describe the mandatory and optional test suite
- functions Common Test will call during test execution. For more details
- see <seealso marker="write_test_chapter">Common Test User's
- Guide.</seealso> </p>
-
+
+ <p>The following section describes the mandatory and optional test suite
+ functions that <c>Common Test</c> calls during test execution.
+ For more details, see section
+ <seealso marker="write_test_chapter">Writing Test Suites</seealso>
+ in the User's Guide.</p>
+
</description>
<section>
- <title>TEST CASE CALLBACK FUNCTIONS</title>
+ <title>Test Case Callback Functions</title>
<p>The following functions define the callback interface
for a test suite.</p>
</section>
-
+
<funcs>
<func>
<name>Module:all() -> Tests | {skip,Reason} </name>
<fsummary>Returns the list of all test case groups and test cases
in the module.</fsummary>
<type>
- <v>Tests = [TestCase | {group,GroupName} |
- {group,GroupName,Properties} |
- {group,GroupName,Properties,SubGroups}]</v>
+ <v>Tests = [TestCase | {group,GroupName} | {group,GroupName,Properties} | {group,GroupName,Properties,SubGroups}]</v>
<v>TestCase = atom()</v>
<v>GroupName = atom()</v>
- <v>Properties = [parallel | sequence | Shuffle | {RepeatType,N}] |
- default</v>
- <v>SubGroups = [{GroupName,Properties} |
- {GroupName,Properties,SubGroups}]</v>
+ <v>Properties = [parallel | sequence | Shuffle | {RepeatType,N}] | default</v>
+ <v>SubGroups = [{GroupName,Properties} | {GroupName,Properties,SubGroups}]</v>
<v>Shuffle = shuffle | {shuffle,Seed}</v>
<v>Seed = {integer(),integer(),integer()}</v>
- <v>RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
- repeat_until_any_ok | repeat_until_any_fail</v>
+ <v>RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail | repeat_until_any_ok | repeat_until_any_fail</v>
<v>N = integer() | forever</v>
<v>Reason = term()</v>
</type>
-
+
<desc>
- <p> MANDATORY </p>
-
- <p>This function must return the list of all test cases and test
- case groups in the test suite module that are to be executed.
- This list also specifies the order the cases and groups will
- be executed by Common Test. A test case is represented by an atom,
+ <p>MANDATORY</p>
+
+ <p>Returns the list of all test cases and test case groups in the
+ test suite module to be executed. This list also specifies the
+ order the cases and groups are executed by <c>Common Test</c>.
+ A test case is represented by an atom,
the name of the test case function. A test case group is
represented by a <c>group</c> tuple, where <c>GroupName</c>,
- an atom, is the name of the group (defined in <seealso marker="#Module:groups-0"><c>groups/0</c></seealso>).
- Execution properties for groups may also be specified, both
- for a top level group and for any of its sub-groups.
- Group execution properties specified here, will override
- properties in the group definition (see <seealso marker="#Module:groups-0"><c>groups/0</c></seealso>).
+ an atom, is the name of the group (defined in
+ <seealso marker="#Module:groups-0"><c>groups/0</c></seealso>).
+ Execution properties for groups can also be specified, both
+ for a top-level group and for any of its subgroups.
+ Group execution properties specified here override
+ properties in the group definition (see
+ <seealso marker="#Module:groups-0"><c>groups/0</c></seealso>).
(With value <c>default</c>, the group definition properties
- will be used).</p>
-
- <p> If <c>{skip,Reason}</c> is returned, all test cases
- in the module will be skipped, and the <c>Reason</c> will
- be printed on the HTML result page.</p>
-
- <p>For details on groups, see
- <seealso marker="write_test_chapter#test_case_groups">Test case
- groups</seealso> in the User's Guide.</p>
-
+ are used).</p>
+
+ <p>If <c>{skip,Reason}</c> is returned, all test cases
+ in the module are skipped and <c>Reason</c>
+ is printed on the HTML result page.</p>
+
+ <p>For details on groups, see section
+ <seealso marker="write_test_chapter#test_case_groups">Test Case
+ Groups</seealso> in the User's Guide.</p>
+
</desc>
</func>
@@ -123,25 +118,24 @@
<name>Module:groups() -> GroupDefs</name>
<fsummary>Returns a list of test case group definitions.</fsummary>
<type>
- <v>GroupDefs = [Group]</v>
- <v>Group = {GroupName,Properties,GroupsAndTestCases}</v>
- <v>GroupName = atom()</v>
- <v>Properties = [parallel | sequence | Shuffle | {RepeatType,N}]</v>
- <v>GroupsAndTestCases = [Group | {group,GroupName} | TestCase]</v>
- <v>TestCase = atom()</v>
- <v>Shuffle = shuffle | {shuffle,Seed}</v>
- <v>Seed = {integer(),integer(),integer()}</v>
- <v>RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
- repeat_until_any_ok | repeat_until_any_fail</v>
- <v>N = integer() | forever</v>
+ <v>GroupDefs = [Group]</v>
+ <v>Group = {GroupName,Properties,GroupsAndTestCases}</v>
+ <v>GroupName = atom()</v>
+ <v>Properties = [parallel | sequence | Shuffle | {RepeatType,N}]</v>
+ <v>GroupsAndTestCases = [Group | {group,GroupName} | TestCase]</v>
+ <v>TestCase = atom()</v>
+ <v>Shuffle = shuffle | {shuffle,Seed}</v>
+ <v>Seed = {integer(),integer(),integer()}</v>
+ <v>RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail | repeat_until_any_ok | repeat_until_any_fail</v>
+ <v>N = integer() | forever</v>
</type>
-
+
<desc>
- <p> OPTIONAL </p>
-
- <p>Function for defining test case groups. Please see
- <seealso marker="write_test_chapter#test_case_groups">Test case
- groups</seealso> in the User's Guide for details.</p>
+ <p>OPTIONAL</p>
+
+ <p>Defines test case groups. For details, see section
+ <seealso marker="write_test_chapter#test_case_groups">Test Case
+ Groups</seealso> in the User's Guide.</p>
</desc>
</func>
@@ -150,75 +144,71 @@
<fsummary>Test suite info function (providing default data
for the suite).</fsummary>
<type>
- <v> Info = {timetrap,Time} | {require,Required} |
- {require,Name,Required} | {userdata,UserData} |
- {silent_connections,Conns} | {stylesheet,CSSFile} |
- {ct_hooks, CTHs}</v>
- <v> Time = TimeVal | TimeFunc</v>
- <v> TimeVal = MilliSec | {seconds,integer()} | {minutes,integer()} |
- {hours,integer()}</v>
- <v> TimeFunc = {Mod,Func,Args} | Fun</v>
- <v> MilliSec = integer()</v>
- <v> Mod = atom()</v>
- <v> Func = atom()</v>
- <v> Args = list()</v>
- <v> Fun = fun()</v>
- <v> Required = Key | {Key,SubKeys} | {Key,SubKey} | {Key,SubKey,SubKeys}</v>
- <v> Key = atom()</v>
- <v> SubKeys = SubKey | [SubKey]</v>
- <v> SubKey = atom()</v>
- <v> Name = atom()</v>
- <v> UserData = term()</v>
- <v> Conns = [atom()]</v>
- <v> CSSFile = string()</v>
- <v> CTHs = [CTHModule |</v>
- <v>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{CTHModule, CTHInitArgs} |</v>
- <v>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{CTHModule, CTHInitArgs, CTHPriority}]</v>
- <v> CTHModule = atom()</v>
- <v> CTHInitArgs = term()</v>
+ <v>Info = {timetrap,Time} | {require,Required} | {require,Name,Required} | {userdata,UserData} | {silent_connections,Conns} | {stylesheet,CSSFile} | {ct_hooks, CTHs}</v>
+ <v>Time = TimeVal | TimeFunc</v>
+ <v>TimeVal = MilliSec | {seconds,integer()} | {minutes,integer()} | {hours,integer()}</v>
+ <v>TimeFunc = {Mod,Func,Args} | Fun</v>
+ <v>MilliSec = integer()</v>
+ <v>Mod = atom()</v>
+ <v>Func = atom()</v>
+ <v>Args = list()</v>
+ <v>Fun = fun()</v>
+ <v>Required = Key | {Key,SubKeys} | {Key,SubKey} | {Key,SubKey,SubKeys}</v>
+ <v>Key = atom()</v>
+ <v>SubKeys = SubKey | [SubKey]</v>
+ <v>SubKey = atom()</v>
+ <v>Name = atom()</v>
+ <v>UserData = term()</v>
+ <v>Conns = [atom()]</v>
+ <v>CSSFile = string()</v>
+ <v>CTHs = [CTHModule |</v>
+ <v>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{CTHModule, CTHInitArgs} |</v>
+ <v>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{CTHModule, CTHInitArgs, CTHPriority}]</v>
+ <v>CTHModule = atom()</v>
+ <v>CTHInitArgs = term()</v>
</type>
<desc>
-
- <p> OPTIONAL </p>
-
- <p>This is the test suite info function. It is supposed to
- return a list of tagged tuples that specify various properties
- related to the execution of this test suite (common for all
- test cases in the suite).</p>
-
- <p>The <c>timetrap</c> tag sets the maximum time each
- test case is allowed to execute (including <seealso marker="#Module:init_per_testcase-2"><c>init_per_testcase/2</c></seealso>
- and <seealso marker="#Module:end_per_testcase-2"><c>end_per_testcase/2</c></seealso>). If the timetrap time is
- exceeded, the test case fails with reason
+
+ <p>OPTIONAL</p>
+
+ <p>The test suite information function. Returns a list of tagged
+ tuples specifying various properties related to the execution of
+ this test suite (common for all test cases in the suite).</p>
+
+ <p>Tag <c>timetrap</c> sets the maximum time that each
+ test case is allowed to execute (including
+ <seealso marker="#Module:init_per_testcase-2"><c>init_per_testcase/2</c></seealso>
+ and
+ <seealso marker="#Module:end_per_testcase-2"><c>end_per_testcase/2</c></seealso>).
+ If the timetrap time is exceeded, the test case fails with reason
<c>timetrap_timeout</c>. A <c>TimeFunc</c> function can be used to
- set a new timetrap by returning a <c>TimeVal</c>. It may also be
- used to trigger a timetrap timeout by, at some point, returning a
- value other than a <c>TimeVal</c>. (See the
- <seealso marker="write_test_chapter#timetraps">User's Guide</seealso>
- for details).
- </p>
-
- <p>The <c>require</c> tag specifies configuration variables
- that are required by test cases (and/or configuration functions)
+ set a new timetrap by returning a <c>TimeVal</c>. It can also be
+ used to trigger a timetrap time-out by, at some point, returning a
+ value other than a <c>TimeVal</c>. For details, see section
+ <seealso marker="write_test_chapter#timetraps">Timetrap Time-Outs</seealso>
+ in the User's Guide.</p>
+
+ <p>Tag <c>require</c> specifies configuration variables
+ required by test cases (or configuration functions)
in the suite. If the required configuration variables are not found
- in any of the configuration files, all test cases are skipped. For more
- information about the 'require' functionality, see the
- reference manual for the function
- <seealso marker="ct#require-1"><c>ct:require/1/2</c></seealso>.</p>
+ in any of the configuration files, all test cases are skipped.
+ For details about the <c>require</c> functionality, see funtion
+ <seealso marker="ct#require-1"><c>ct:require/1,2</c></seealso>.</p>
- <p>With <c>userdata</c>, it is possible for the user to
- specify arbitrary test suite related information which can be
- read by calling <seealso marker="ct#userdata-2"><c>ct:userdata/2</c></seealso>.</p>
+ <p>With <c>userdata</c>, the user can
+ specify any test suite-related information, which can be
+ read by calling
+ <seealso marker="ct#userdata-2"><c>ct:userdata/2</c></seealso>.</p>
- <p>The <c>ct_hooks</c> tag specifies which
+ <p>Tag <c>ct_hooks</c> specifies the
<seealso marker="ct_hooks_chapter">Common Test Hooks</seealso>
- are to be run together with this suite.</p>
-
- <p>Other tuples than the ones defined will simply be ignored.</p>
+ to be run with this suite.</p>
- <p>For more information about the test suite info function,
- see <seealso marker="write_test_chapter#suite">Test
- suite info function</seealso> in the User's Guide.</p>
+ <p>Other tuples than the ones defined are ignored.</p>
+
+ <p>For details about the test suite information function, see section
+ <seealso marker="write_test_chapter#suite">Test
+ Suite Information Function</seealso> in the User's Guide.</p>
</desc>
</func>
@@ -227,129 +217,133 @@
{skip_and_save,Reason,SaveConfig}</name>
<fsummary>Test suite initializations.</fsummary>
<type>
- <v> Config = NewConfig = SaveConfig = [{Key,Value}]</v>
- <v> Key = atom()</v>
- <v> Value = term()</v>
- <v> Reason = term()</v>
+ <v>Config = NewConfig = SaveConfig = [{Key,Value}]</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
</type>
<desc>
-
- <p> OPTIONAL </p>
-
+
+ <p>OPTIONAL</p>
+
<p>This configuration function is called as the first function in the
- suite. It typically contains initializations which are common for
- all test cases in the suite, and which shall only be done
- once. The <c>Config</c> parameter is the configuration data
- which can be modified here. Whatever is returned from this
- function is given as <c>Config</c> to all configuration functions
- and test cases in the suite. If <c>{skip,Reason}</c>
- is returned, all test cases in the suite will be skipped
- and <c>Reason</c> printed in the overview log for the suite.</p>
- <p>For information on <c>save_config</c> and <c>skip_and_save</c>,
- please see
- <seealso marker="dependencies_chapter#save_config">Dependencies
- between Test Cases and Suites</seealso> in the User's Guide.</p>
- </desc>
+ suite. It typically contains initializations that are common for
+ all test cases in the suite, and that must only be done
+ once. Parameter <c>Config</c> is the configuration data
+ that can be modified. Whatever is returned from this
+ function is specified as <c>Config</c> to all configuration functions
+ and test cases in the suite.</p>
+
+ <p>If <c>{skip,Reason}</c>
+ is returned, all test cases in the suite are skipped
+ and <c>Reason</c> is printed in the overview log for the suite.</p>
+
+ <p>For information on <c>save_config</c> and <c>skip_and_save</c>,
+ see section
+ <seealso marker="dependencies_chapter#save_config">Saving
+ Configuration Data</seealso> in the User's Guide.</p>
+ </desc>
</func>
-
+
<func>
<name>Module:end_per_suite(Config) -> term() |
{save_config,SaveConfig}</name>
- <fsummary>Test suite finalization. </fsummary>
+ <fsummary>Test suite finalization.</fsummary>
<type>
- <v> Config = SaveConfig = [{Key,Value}]</v>
- <v> Key = atom()</v>
- <v> Value = term()</v>
+ <v>Config = SaveConfig = [{Key,Value}]</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
</type>
-
+
<desc>
- <p> OPTIONAL </p>
+ <p>OPTIONAL</p>
<p>This function is called as the last test case in the
suite. It is meant to be used for cleaning up after
- <seealso marker="#Module:init_per_suite-1"><c>init_per_suite/1</c></seealso>.
- For information on <c>save_config</c>, please see
- <seealso marker="dependencies_chapter#save_config">Dependencies
- between Test Cases and Suites</seealso> in the User's Guide.</p>
+ <seealso marker="#Module:init_per_suite-1"><c>init_per_suite/1</c></seealso>.</p>
+ <p>For information on <c>save_config</c>, see section
+ <seealso marker="dependencies_chapter#save_config">Saving
+ Configuration Data</seealso> in the User's Guide.</p>
</desc>
</func>
<func>
<name>Module:group(GroupName) -> [Info] </name>
- <fsummary>Test case group info function (providing default data
- for a test case group, i.e. its test cases and sub-groups).</fsummary>
+ <fsummary>Test case group information function (providing default data
+ for a test case group, that is, its test cases and
+ subgroups).</fsummary>
<type>
- <v> Info = {timetrap,Time} | {require,Required} |
- {require,Name,Required} | {userdata,UserData} |
- {silent_connections,Conns} | {stylesheet,CSSFile} |
- {ct_hooks, CTHs}</v>
- <v> Time = TimeVal | TimeFunc</v>
- <v> TimeVal = MilliSec | {seconds,integer()} | {minutes,integer()} |
- {hours,integer()}</v>
- <v> TimeFunc = {Mod,Func,Args} | Fun</v>
- <v> MilliSec = integer()</v>
- <v> Mod = atom()</v>
- <v> Func = atom()</v>
- <v> Args = list()</v>
- <v> Fun = fun()</v>
- <v> Required = Key | {Key,SubKeys} | {Key,Subkey} | {Key,Subkey,SubKeys}</v>
- <v> Key = atom()</v>
- <v> SubKeys = SubKey | [SubKey]</v>
- <v> SubKey = atom()</v>
- <v> Name = atom()</v>
- <v> UserData = term()</v>
- <v> Conns = [atom()]</v>
- <v> CSSFile = string()</v>
- <v> CTHs = [CTHModule |</v>
- <v> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{CTHModule, CTHInitArgs} |</v>
- <v> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{CTHModule, CTHInitArgs, CTHPriority}]</v>
- <v> CTHModule = atom()</v>
- <v> CTHInitArgs = term()</v>
- </type>
- <desc>
-
- <p> OPTIONAL </p>
-
- <p>This is the test case group info function. It is supposed to
+ <v>Info = {timetrap,Time} | {require,Required} | {require,Name,Required} | {userdata,UserData} | {silent_connections,Conns} | {stylesheet,CSSFile} | {ct_hooks, CTHs}</v>
+ <v>Time = TimeVal | TimeFunc</v>
+ <v>TimeVal = MilliSec | {seconds,integer()} | {minutes,integer()} | {hours,integer()}</v>
+ <v>TimeFunc = {Mod,Func,Args} | Fun</v>
+ <v>MilliSec = integer()</v>
+ <v>Mod = atom()</v>
+ <v>Func = atom()</v>
+ <v>Args = list()</v>
+ <v>Fun = fun()</v>
+ <v>Required = Key | {Key,SubKeys} | {Key,Subkey} | {Key,Subkey,SubKeys}</v>
+ <v>Key = atom()</v>
+ <v>SubKeys = SubKey | [SubKey]</v>
+ <v>SubKey = atom()</v>
+ <v>Name = atom()</v>
+ <v>UserData = term()</v>
+ <v>Conns = [atom()]</v>
+ <v>CSSFile = string()</v>
+ <v>CTHs = [CTHModule |</v>
+ <v>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{CTHModule, CTHInitArgs} |</v>
+ <v>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{CTHModule, CTHInitArgs, CTHPriority}]</v>
+ <v>CTHModule = atom()</v>
+ <v>CTHInitArgs = term()</v>
+ </type>
+ <desc>
+
+ <p>OPTIONAL</p>
+
+ <p>The test case group information function. It is supposed to
return a list of tagged tuples that specify various properties
- related to the execution of a test case group (i.e. its test cases
- and sub-groups). Properties set by
+ related to the execution of a test case group (that is, its test
+ cases and subgroups). Properties set by
<seealso marker="#Module:group-1"><c>group/1</c></seealso> override
- properties with the same key that have been previously set by
+ properties with the same key that have been set previously by
<seealso marker="#Module:suite-0"><c>suite/0</c></seealso>.</p>
- <p>The <c>timetrap</c> tag sets the maximum time each
- test case is allowed to execute (including <seealso marker="#Module:init_per_testcase-2"><c>init_per_testcase/2</c></seealso>
- and <seealso marker="#Module:end_per_testcase-2"><c>end_per_testcase/2</c></seealso>). If the timetrap time is
+ <p>Tag <c>timetrap</c> sets the maximum time that each
+ test case is allowed to execute (including
+ <seealso marker="#Module:init_per_testcase-2"><c>init_per_testcase/2</c></seealso>
+ and
+ <seealso marker="#Module:end_per_testcase-2"><c>end_per_testcase/2</c></seealso>).
+ If the timetrap time is
exceeded, the test case fails with reason
<c>timetrap_timeout</c>. A <c>TimeFunc</c> function can be used to
- set a new timetrap by returning a <c>TimeVal</c>. It may also be
- used to trigger a timetrap timeout by, at some point, returning a
- value other than a <c>TimeVal</c>. (See the
- <seealso marker="write_test_chapter#timetraps">User's Guide</seealso>
- for details).</p>
+ set a new timetrap by returning a <c>TimeVal</c>. It can also be
+ used to trigger a timetrap time-out by, at some point, returning a
+ value other than a <c>TimeVal</c>. For details, see section
+ <seealso marker="write_test_chapter#timetraps">Timetrap
+ Time-Outs</seealso> in the User's Guide.</p>
- <p>The <c>require</c> tag specifies configuration variables
- that are required by test cases (and/or configuration functions)
+ <p>Tag <c>require</c> specifies configuration variables
+ required by test cases (or configuration functions)
in the suite. If the required configuration variables are not found
- in any of the configuration files, all test cases in this group are skipped.
- For more information about the 'require' functionality, see the
- reference manual for the function
- <seealso marker="ct#require-1"><c>ct:require/1/2</c></seealso>.</p>
+ in any of the configuration files, all test cases in this group are
+ skipped. For details about the <c>require</c> functionality, see
+ function
+ <seealso marker="ct#require-1"><c>ct:require/1,2</c></seealso>.</p>
- <p>With <c>userdata</c>, it is possible for the user to
- specify arbitrary test case group related information which can be
- read by calling <seealso marker="ct#userdata-2"><c>ct:userdata/2</c></seealso>.</p>
+ <p>With <c>userdata</c>, the user can
+ specify any test case group related information that can be
+ read by calling
+ <seealso marker="ct#userdata-2"><c>ct:userdata/2</c></seealso>.</p>
- <p>The <c>ct_hooks</c> tag specifies which
+ <p>Tag <c>ct_hooks</c> specifies the
<seealso marker="ct_hooks_chapter">Common Test Hooks</seealso>
- are to be run together with this suite.</p>
-
- <p>Other tuples than the ones defined will simply be ignored.</p>
+ to be run with this suite.</p>
- <p>For more information about the test case group info function,
- see <seealso marker="write_test_chapter#suite">Test
- case group info function</seealso> in the User's Guide.</p>
+ <p>Other tuples than the ones defined are ignored.</p>
+
+ <p>For details about the test case group information function,
+ see section <seealso marker="write_test_chapter#group_info">Group
+ Information Function</seealso> in the User's Guide.</p>
</desc>
</func>
@@ -358,59 +352,66 @@
{skip,Reason}</name>
<fsummary>Test case group initializations.</fsummary>
<type>
- <v> GroupName = atom()</v>
- <v> Config = NewConfig = [{Key,Value}]</v>
- <v> Key = atom()</v>
- <v> Value = term()</v>
- <v> Reason = term()</v>
+ <v>GroupName = atom()</v>
+ <v>Config = NewConfig = [{Key,Value}]</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
</type>
<desc>
-
- <p> OPTIONAL </p>
-
+
+ <p>OPTIONAL</p>
+
<p>This configuration function is called before execution of a
- test case group. It typically contains initializations which are
- common for all test cases and sub-groups in the group, and which
- shall only be performed once. <c>GroupName</c> is the name of the
- group, as specified in the group definition (see <seealso marker="#Module:groups-0"><c>groups/0</c></seealso>). The
- <c>Config</c> parameter is the configuration data which can be modified
- here. The return value of this function is given as <c>Config</c>
- to all test cases and sub-groups in the group. If <c>{skip,Reason}</c>
- is returned, all test cases in the group will be skipped and
- <c>Reason</c> printed in the overview log for the group.</p>
-
- <p>For information about test case groups, please see
- <seealso marker="write_test_chapter#test_case_groups">Test case
- groups</seealso> chapter in the User's Guide.</p>
+ test case group. It typically contains initializations that are
+ common for all test cases and subgroups in the group, and that
+ must only be performed once. <c>GroupName</c> is the name of the
+ group, as specified in the group definition (see
+ <seealso marker="#Module:groups-0"><c>groups/0</c></seealso>).
+ Parameter <c>Config</c> is the configuration data that can be
+ modified.
+ The return value of this function is given as <c>Config</c>
+ to all test cases and subgroups in the group.</p>
+
+ <p>If <c>{skip,Reason}</c>
+ is returned, all test cases in the group are skipped and
+ <c>Reason</c> is printed in the overview log for the group.</p>
+
+ <p>For information about test case groups, see section
+ <seealso marker="write_test_chapter#test_case_groups">Test Case
+ Groups</seealso> in the User's Guide.</p>
</desc>
</func>
-
+
<func>
<name>Module:end_per_group(GroupName, Config) -> term() |
{return_group_result,Status}</name>
<fsummary>Test case group finalization.</fsummary>
<type>
- <v> GroupName = atom()</v>
- <v> Config = [{Key,Value}]</v>
- <v> Key = atom()</v>
- <v> Value = term()</v>
- <v> Status = ok | skipped | failed</v>
+ <v>GroupName = atom()</v>
+ <v>Config = [{Key,Value}]</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Status = ok | skipped | failed</v>
</type>
-
+
<desc>
- <p> OPTIONAL </p>
-
- <p>This function is called after the execution of a test case group is finished.
- It is meant to be used for cleaning up after <seealso marker="#Module:init_per_group-2"><c>init_per_group/2</c></seealso>.
- By means of <c>{return_group_result,Status}</c>, it is possible to return a
- status value for a nested sub-group. The status can be retrieved in
- <seealso marker="#Module:end_per_group-2"><c>end_per_group/2</c></seealso> for the group on the level above. The status will also
- be used by Common Test for deciding if execution of a group should proceed in
- case the property <c>sequence</c> or <c>repeat_until_*</c> is set.</p>
-
- <p>For more information about test case groups, please see
- <seealso marker="write_test_chapter#test_case_groups">Test case
- groups</seealso> chapter in the User's Guide.</p>
+ <p>OPTIONAL</p>
+
+ <p>This function is called after the execution of a test case group
+ is finished. It is meant to be used for cleaning up after
+ <seealso marker="#Module:init_per_group-2"><c>init_per_group/2</c></seealso>.
+ A status value for a nested subgroup can be returned with
+ <c>{return_group_result,Status}</c>. The status can be retrieved in
+ <seealso marker="#Module:end_per_group-2"><c>end_per_group/2</c></seealso>
+ for the group on the level above. The status is also used by
+ <c>Common Test</c> for deciding if execution of a group is to
+ proceed if property <c>sequence</c> or <c>repeat_until_*</c>
+ is set.</p>
+
+ <p>For details about test case groups, see section
+ <seealso marker="write_test_chapter#test_case_groups">Test Case
+ Groups</seealso> in the User's Guide.</p>
</desc>
</func>
@@ -424,168 +425,173 @@
<v> Value = term()</v>
<v> Reason = term()</v>
</type>
- <desc>
-
+ <desc>
+
<p>OPTIONAL</p>
-
- <p>This function is called before each test case. The
- <c>TestCase</c> argument is the name of the test case, and
+
+ <p>This function is called before each test case. Argument
+ <c>TestCase</c> is the test case name, and
<c>Config</c> (list of key-value tuples) is the configuration
- data that can be modified here. The <c>NewConfig</c> list returned
+ data that can be modified. The <c>NewConfig</c> list returned
from this function is given as <c>Config</c> to the test case.
If <c>{fail,Reason}</c> is returned, the test case is
- marked as failed without being executed. If <c>{skip,Reason}</c> is
- returned, the test case will be skipped and <c>Reason</c> printed
- in the overview log for the suite.</p>
+ marked as failed without being executed.</p>
+
+ <p>If <c>{skip,Reason}</c> is returned, the test case is skipped
+ and <c>Reason</c> is printed in the overview log for the suite.</p>
</desc>
</func>
-
+
<func>
<name>Module:end_per_testcase(TestCase, Config) -> term() | {fail,Reason} | {save_config,SaveConfig}</name>
<fsummary>Test case finalization.</fsummary>
<type>
- <v> TestCase = atom()</v>
- <v> Config = SaveConfig = [{Key,Value}]</v>
- <v> Key = atom()</v>
- <v> Value = term()</v>
- <v> Reason = term()</v>
+ <v>TestCase = atom()</v>
+ <v>Config = SaveConfig = [{Key,Value}]</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
</type>
<desc>
-
- <p> OPTIONAL </p>
-
- <p> This function is called after each test case, and can be used
- to clean up after <seealso marker="#Module:init_per_testcase-2"><c>init_per_testcase/2</c></seealso> and the test case.
- Any return value (besides <c>{fail,Reason}</c> and <c>{save_config,SaveConfig}</c>)
- is ignored. By returning <c>{fail,Reason}</c>, <c>TestCase</c> will be marked as
- failed (even though it was actually successful in the sense that it returned
- a value instead of terminating). For information on <c>save_config</c>, please see
- <seealso marker="dependencies_chapter#save_config">Dependencies between
- Test Cases and Suites</seealso> in the User's Guide</p>
+
+ <p>OPTIONAL</p>
+
+ <p>This function is called after each test case, and can be used
+ to clean up after
+ <seealso marker="#Module:init_per_testcase-2"><c>init_per_testcase/2</c></seealso>
+ and the test case. Any return value (besides <c>{fail,Reason}</c>
+ and <c>{save_config,SaveConfig}</c>) is ignored. By returning
+ <c>{fail,Reason}</c>, <c>TestCase</c> is marked as faulty (even
+ though it was successful in the sense that it returned
+ a value instead of terminating).</p>
+
+ <p>For information on <c>save_config</c>, see section
+ <seealso marker="dependencies_chapter#save_config">Saving
+ Configuration Data</seealso> in the User's Guide.</p>
</desc>
</func>
-
+
<func>
<name>Module:Testcase() -> [Info] </name>
- <fsummary>Test case info function. </fsummary>
+ <fsummary>Test case information function.</fsummary>
<type>
- <v> Info = {timetrap,Time} | {require,Required} |
- {require,Name,Required} | {userdata,UserData} |
- {silent_connections,Conns}</v>
- <v> Time = TimeVal | TimeFunc</v>
- <v> TimeVal = MilliSec | {seconds,integer()} | {minutes,integer()} |
- {hours,integer()}</v>
- <v> TimeFunc = {Mod,Func,Args} | Fun</v>
- <v> MilliSec = integer()</v>
- <v> Mod = atom()</v>
- <v> Func = atom()</v>
- <v> Args = list()</v>
- <v> Fun = fun()</v>
- <v> Required = Key | {Key,SubKeys} | {Key,Subkey} | {Key,Subkey,SubKeys}</v>
- <v> Key = atom()</v>
- <v> SubKeys = SubKey | [SubKey]</v>
- <v> SubKey = atom()</v>
- <v> Name = atom()</v>
- <v> UserData = term()</v>
- <v> Conns = [atom()]</v>
+ <v>Info = {timetrap,Time} | {require,Required} | {require,Name,Required} | {userdata,UserData} | {silent_connections,Conns}</v>
+ <v>Time = TimeVal | TimeFunc</v>
+ <v>TimeVal = MilliSec | {seconds,integer()} | {minutes,integer()} | {hours,integer()}</v>
+ <v>TimeFunc = {Mod,Func,Args} | Fun</v>
+ <v>MilliSec = integer()</v>
+ <v>Mod = atom()</v>
+ <v>Func = atom()</v>
+ <v>Args = list()</v>
+ <v>Fun = fun()</v>
+ <v>Required = Key | {Key,SubKeys} | {Key,Subkey} | {Key,Subkey,SubKeys}</v>
+ <v>Key = atom()</v>
+ <v>SubKeys = SubKey | [SubKey]</v>
+ <v>SubKey = atom()</v>
+ <v>Name = atom()</v>
+ <v>UserData = term()</v>
+ <v>Conns = [atom()]</v>
</type>
-
- <desc>
+
+ <desc>
<p>OPTIONAL</p>
-
- <p>This is the test case info function. It is supposed to
+
+ <p>The test case information function. It is supposed to
return a list of tagged tuples that specify various properties
related to the execution of this particular test case.
- Properties set by <seealso marker="#Module:Testcase-0"><c>Testcase/0</c></seealso> override
- properties that have been previously set for the test case
- by <seealso marker="#Module:group-1"><c>group/1</c></seealso> or <seealso marker="#Module:suite-0"><c>suite/0</c></seealso>.</p>
-
- <p>The <c>timetrap</c> tag sets the maximum time the
+ Properties set by
+ <seealso marker="#Module:Testcase-0"><c>Testcase/0</c></seealso>
+ override properties set previously for the test case by
+ <seealso marker="#Module:group-1"><c>group/1</c></seealso> or
+ <seealso marker="#Module:suite-0"><c>suite/0</c></seealso>.</p>
+
+ <p>Tag <c>timetrap</c> sets the maximum time that the
test case is allowed to execute. If the timetrap time is
- exceeded, the test case fails with reason
- <c>timetrap_timeout</c>. <seealso marker="#Module:init_per_testcase-2"><c>init_per_testcase/2</c></seealso>
- and <seealso marker="#Module:end_per_testcase-2"><c>end_per_testcase/2</c></seealso> are included in the
- timetrap time. A <c>TimeFunc</c> function can be used to
- set a new timetrap by returning a <c>TimeVal</c>. It may also be
- used to trigger a timetrap timeout by, at some point, returning a
- value other than a <c>TimeVal</c>. (See the
- <seealso marker="write_test_chapter#timetraps">User's Guide</seealso>
- for details).</p>
+ exceeded, the test case fails with reason <c>timetrap_timeout</c>.
+ <seealso marker="#Module:init_per_testcase-2"><c>init_per_testcase/2</c></seealso>
+ and
+ <seealso marker="#Module:end_per_testcase-2"><c>end_per_testcase/2</c></seealso>
+ are included in the timetrap time.
+ A <c>TimeFunc</c> function can be used to
+ set a new timetrap by returning a <c>TimeVal</c>. It can also be
+ used to trigger a timetrap time-out by, at some point, returning a
+ value other than a <c>TimeVal</c>. For details, see section
+ <seealso marker="write_test_chapter#timetraps">Timetrap
+ Time-Outs</seealso> in the User's Guide.</p>
- <p>The <c>require</c> tag specifies configuration variables
- that are required by the test case (and/or <c>init/end_per_testcase/2</c>).
+ <p>Tag <c>require</c> specifies configuration variables
+ that are required by the test case (or <c>init_per_testcase/2</c>
+ or <c>end_per_testcase/2</c>).
If the required configuration variables are not found in any of the
- configuration files, the test case is skipped. For more
- information about the 'require' functionality, see the
- reference manual for the function
- <seealso marker="ct#require-1"><c>ct:require/1/2</c></seealso>.</p>
-
- <p>If <c>timetrap</c> and/or <c>require</c> is not set, the
- default values specified by <seealso marker="#Module:suite-0"><c>suite/0</c></seealso> (or
- <seealso marker="#Module:group-1"><c>group/1</c></seealso>) will be used.</p>
-
- <p>With <c>userdata</c>, it is possible for the user to
- specify arbitrary test case related information which can be
- read by calling <seealso marker="ct#userdata-3"><c>ct:userdata/3</c></seealso>.</p>
-
- <p>Other tuples than the ones defined will simply be ignored.</p>
+ configuration files, the test case is skipped. For details about
+ the <c>require</c> functionality, see function
+ <seealso marker="ct#require-1"><c>ct:require/1,2</c></seealso>.</p>
+
+ <p>If <c>timetrap</c> or <c>require</c> is not set, the
+ default values specified by
+ <seealso marker="#Module:suite-0"><c>suite/0</c></seealso> (or
+ <seealso marker="#Module:group-1"><c>group/1</c></seealso>) are used.</p>
+
+ <p>With <c>userdata</c>, the user can specify any test case-related
+ information that can be read by calling
+ <seealso marker="ct#userdata-3"><c>ct:userdata/3</c></seealso>.</p>
+
+ <p>Other tuples than the ones defined are ignored.</p>
- <p>For more information about the test case info function,
- see <seealso marker="write_test_chapter#info_function">Test
- case info function</seealso> in the User's Guide.</p>
+ <p>For details about the test case information function, see section
+ <seealso marker="write_test_chapter#info_function">Test
+ Case Information Function</seealso> in the User's Guide.</p>
</desc>
</func>
-
-
+
<func>
<name>Module:Testcase(Config) -> term() | {skip,Reason} | {comment,Comment} | {save_config,SaveConfig} | {skip_and_save,Reason,SaveConfig} | exit() </name>
- <fsummary>A test case</fsummary>
+ <fsummary>A test case.</fsummary>
<type>
- <v> Config = SaveConfig = [{Key,Value}]</v>
- <v> Key = atom()</v>
- <v> Value = term()</v>
- <v> Reason = term()</v>
- <v> Comment = string()</v>
+ <v>Config = SaveConfig = [{Key,Value}]</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
+ <v>Comment = string()</v>
</type>
-
+
<desc>
- <p> MANDATORY </p>
-
- <p>This is the implementation of a test case. Here you must
- call the functions you want to test, and do whatever you
- need to check the result. If something fails, make sure the
- function causes a runtime error, or call <seealso marker="ct#fail-1"><c>ct:fail/1/2</c></seealso>
+ <p>MANDATORY</p>
+
+ <p>The implementation of a test case. Call the functions to test and
+ check the result. If something fails, ensure the
+ function causes a runtime error or call
+ <seealso marker="ct#fail-1"><c>ct:fail/1,2</c></seealso>
(which also causes the test case process to terminate).</p>
-
- <p>Elements from the <c>Config</c> list can e.g. be read
- with <c>proplists:get_value/2</c> (or the macro <c>?config</c>
- defined in <c>ct.hrl</c>).</p>
- <p>You can return <c>{skip,Reason}</c> if you decide not to
- run the test case after all. <c>Reason</c> will then be
- printed in 'Comment' field on the HTML result page.</p>
-
- <p>You can return <c>{comment,Comment}</c> if you wish to
- print some information in the 'Comment' field on the HTML
- result page.</p>
-
- <p>If the function returns anything else, the test case is
- considered successful. (The return value always gets printed
- in the test case log file).</p>
+ <p>Elements from the <c>Config</c> list can, for example, be read
+ with <c>proplists:get_value/2</c> in <c>STDLIB</c>
+ (or the macro <c>?config</c> defined in <c>ct.hrl</c>).</p>
+
+ <p>If you decide not to run the test case after all, return
+ <c>{skip,Reason}</c>. <c>Reason</c> is then
+ printed in field <c>Comment</c> on the HTML result page.</p>
+
+ <p>To print some information in field <c>Comment</c> on the HTML
+ result page, return <c>{comment,Comment}</c>.</p>
- <p>For more information about test case implementation, please
- see <seealso marker="write_test_chapter#test_cases">Test
- cases</seealso> in the User's Guide.</p>
+ <p>If the function returns anything else, the test case is
+ considered successful. The return value always gets printed
+ in the test case log file.</p>
- <p>For information on <c>save_config</c> and <c>skip_and_save</c>, please see
- <seealso marker="dependencies_chapter#save_config">Dependencies between
- Test Cases and Suites</seealso> in the User's Guide.</p>
+ <p>For details about test case implementation, see section
+ <seealso marker="write_test_chapter#test_cases">Test Cases</seealso>
+ in the User's Guide.</p>
+
+ <p>For information on <c>save_config</c> and <c>skip_and_save</c>,
+ see section
+ <seealso marker="dependencies_chapter#save_config">Saving
+ Configuration Data</seealso> in the User's Guide.</p>
</desc>
</func>
-
+
</funcs>
</erlref>
-
diff --git a/lib/common_test/doc/src/config_file_chapter.xml b/lib/common_test/doc/src/config_file_chapter.xml
index c7fd6e0b28..62ebfccb98 100644
--- a/lib/common_test/doc/src/config_file_chapter.xml
+++ b/lib/common_test/doc/src/config_file_chapter.xml
@@ -35,18 +35,18 @@
<section>
<title>General</title>
- <p>To avoid hard coding data values related to the test and/or SUT (System
- Under Test) in the test suites, the data may instead be specified by means
- of configuration files or strings that Common Test reads before
+ <p>To avoid hard-coding data values related to the test and/or System
+ Under Test (SUT) in the test suites, the data can instead be specified through
+ configuration files or strings that <c>Common Test</c> reads before
the start of a test run. External configuration data makes it possible to
- change test properties without having to modify the actual test suites
- using the data. Examples of configuration data:</p>
+ change test properties without modifying the test suites
+ using the data. Examples of configuration data follows:</p>
- <list>
+ <list type="bulleted">
<item>Addresses to the test plant or other instruments</item>
<item>User login information</item>
<item>Names of files needed by the test</item>
- <item>Names of programs that should be executed during the test</item>
+ <item>Names of programs to be executed during the test</item>
<item>Any other variable needed by the test</item>
</list>
@@ -57,154 +57,150 @@
<p>A configuration file can contain any number of elements of the type:</p>
<pre>
- {CfgVarName,Value}.</pre>
+ {CfgVarName,Value}.</pre>
<p>where</p>
<pre>
- CfgVarName = atom()
- Value = term() | [{CfgVarName,Value}]</pre>
+ CfgVarName = atom()
+ Value = term() | [{CfgVarName,Value}]</pre>
</section>
<section>
- <title>Requiring and reading configuration data</title>
+ <title>Requiring and Reading Configuration Data</title>
<marker id="require_config_data"></marker>
<p>In a test suite, one must <em>require</em> that a configuration
- variable (<c>CfgVarName</c> in the definition above) exists before
- attempting to read the associated value in a test case or config function.</p>
-
- <p><c>require</c> is an assert statement that can be part of the <seealso
- marker="write_test_chapter#suite">test suite info function</seealso> or
- <seealso marker="write_test_chapter#info_function">test case info
- function</seealso>. If the required variable is not available, the
- test is skipped (unless a default value has been specified, see the
- <seealso marker="write_test_chapter#info_function">test case info
- function</seealso> chapter for details). There is also a function
- <seealso marker="ct#require-1"><c>ct:require/1/2</c></seealso> which can be called from a test case
- in order to check if a specific variable is available. The return
+ variable (<c>CfgVarName</c> in the previous definition) exists before
+ attempting to read the associated value in a test case or configuration function.</p>
+
+ <p><c>require</c> is an assert statement, which can be part of the <seealso
+ marker="write_test_chapter#suite">Test Suite Information Function</seealso> or
+ <seealso marker="write_test_chapter#info_function">Test Case Information
+ Function</seealso>. If the required variable is unavailable, the
+ test is skipped (unless a default value has been specified, see section
+ <seealso marker="write_test_chapter#info_function">Test Case Information
+ Function</seealso> for details). Also, function
+ <seealso marker="ct#require-1"><c>ct:require/1/2</c></seealso> can be called
+ from a test case to check if a specific variable is available. The return
value from this function must be checked explicitly and appropriate
- action be taken depending on the result (e.g. to skip the test case
- if the variable in question doesn't exist).</p>
+ action be taken depending on the result (for example, to skip the test case
+ if the variable in question does not exist).</p>
- <p>A <c>require</c> statement in the test suite info- or test case
- info-list should look like this:
+ <p>A <c>require</c> statement in the test suite information case or test case
+ information-list is to look like
<c>{require,CfgVarName}</c> or <c>{require,AliasName,CfgVarName}</c>.
The arguments <c>AliasName</c> and <c>CfgVarName</c> are the same as the
- arguments to <seealso marker="ct#require-1"><c>ct:require/1/2</c></seealso> which are described in the
- reference manual for <seealso marker="ct">ct</seealso>.
+ arguments to <seealso marker="ct#require-1"><c>ct:require/1,2</c></seealso>.
<c>AliasName</c> becomes an alias for the configuration variable,
and can be used as reference to the configuration data value.
- The configuration variable may be associated with an
- arbitrary number of alias names, but each name must be unique within
- the same test suite. There are two main uses for alias names:</p>
- <list>
- <item>They may be introduced to identify connections (see below).</item>
- <item>They may used to help adapt configuration data to a test suite
+ The configuration variable can be associated with any
+ number of alias names, but each name must be unique within
+ the same test suite. The two main uses for alias names follows:</p>
+ <list type="bulleted">
+ <item>To identify connections (described later).</item>
+ <item>To help adapt configuration data to a test suite
(or test case) and improve readability.</item>
</list>
- <p>To read the value of a config variable, use the function
- <seealso marker="ct#get_config-1"><c>get_config/1/2/3</c></seealso>
- which is also described in the reference
- manual for <seealso marker="ct">ct</seealso>.</p>
- <p>Example:</p>
+ <p>To read the value of a configuration variable, use function
+ <seealso marker="ct#get_config-1"><c>get_config/1,2,3</c></seealso>.
+ </p>
+ <p><em>Example:</em></p>
<pre>
- suite() ->
- [{require, domain, 'CONN_SPEC_DNS_SUFFIX'}].
+ suite() ->
+ [{require, domain, 'CONN_SPEC_DNS_SUFFIX'}].
- ...
-
- testcase(Config) ->
- Domain = ct:get_config(domain),
- ...</pre>
+ ...
+
+ testcase(Config) ->
+ Domain = ct:get_config(domain),
+ ...</pre>
</section>
<section>
- <title>Using configuration variables defined in multiple files</title>
+ <title>Using Configuration Variables Defined in Multiple Files</title>
<p>If a configuration variable is defined in multiple files and you
- want to access all possible values, you may use the <seealso marker="ct#get_config-3"><c>ct:get_config/3</c></seealso>
- function and specify <c>all</c> in the options list. The values will then
- be returned in a list and the order of the elements corresponds to the order
- that the config files were specified at startup. Please see
- the <seealso marker="ct">ct</seealso> reference manual for details.</p>
+ want to access all possible values, use function
+ <seealso marker="ct#get_config-3"><c>ct:get_config/3</c></seealso>
+ and specify <c>all</c> in the options list. The values are then
+ returned in a list and the order of the elements corresponds to the order
+ that the configuration files were specified at startup.</p>
</section>
<section>
- <title>Encrypted configuration files</title>
+ <title>Encrypted Configuration Files</title>
<marker id="encrypted_config_files"></marker>
- <p>It is possible to encrypt configuration files containing sensitive data
- if these files must be stored in open and shared directories.</p>
- <p>Call <seealso marker="ct#encrypt_config_file-2"><c>ct:encrypt_config_file/2/3</c></seealso> to have Common Test encrypt a
- specified file using the DES3 function in the OTP <c>crypto</c> application.
- The encrypted file can then be used as a regular configuration file,
- in combination with other encrypted files or normal text files. The key
- for decrypting the configuration file must be provided when running the test,
- however. This can be done by means of the <c>decrypt_key</c> or
- <c>decrypt_file</c> flag/option, or a key file in a predefined location.</p>
+ <p>Configuration files containing sensitive data can be encrypted
+ if they must be stored in open and shared directories.</p>
+ <p>To have <c>Common Test</c> encrypt a
+ specified file using function <c>DES3</c> in application <c>Crypto</c>,
+ call <seealso marker="ct#encrypt_config_file-2"><c>ct:encrypt_config_file/2,3</c></seealso>
+ The encrypted file can then be used as a regular configuration file
+ in combination with other encrypted files or normal text files. However, the
+ key for decrypting the configuration file must be provided when running the test.
+ This can be done with flag/option <c>decrypt_key</c> or
+ <c>decrypt_file</c>, or a key file in a predefined location.</p>
- <p>Common Test also provides decryption functions,
- <seealso marker="ct#decrypt_config_file-2"><c>ct:decrypt_config_file/2/3</c></seealso>, for recreating the original text
- files.</p>
-
- <p>Please see the <seealso marker="ct">ct</seealso> reference manual for
- more information.</p>
+ <p><c>Common Test</c> also provides decryption functions,
+ <seealso marker="ct#decrypt_config_file-2"><c>ct:decrypt_config_file/2,3</c></seealso>,
+ for recreating the original text files.</p>
</section>
<section>
- <title>Opening connections by using configuration data</title>
- <p>There are two different methods for opening a connection
- by means of the support functions in e.g. <seealso marker="ct_ssh"><c>ct_ssh</c></seealso>, <seealso marker="ct_ftp"><c>ct_ftp</c></seealso>,
- and <seealso marker="ct_telnet"><c>ct_telnet</c></seealso>:</p>
- <list>
+ <title>Opening Connections Using Configuration Data</title>
+ <p>Two different methods for opening a connection using the support functions
+ in, for example, <seealso marker="ct_ssh"><c>ct_ssh</c></seealso>,
+ <seealso marker="ct_ftp"><c>ct_ftp</c></seealso>, and
+ <seealso marker="ct_telnet"><c>ct_telnet</c></seealso> follows:</p>
+ <list type="bulleted">
<item>Using a configuration target name (an alias) as reference.</item>
<item>Using the configuration variable as reference.</item>
</list>
<p>When a target name is used for referencing the configuration data
- (that specifies the connection to be opened), the same name may be used
+ (that specifies the connection to be opened), the same name can be used
as connection identity in all subsequent calls related to the connection
- (also for closing it). It's only possible to have one open connection
- per target name. If attempting to open a new connection using a name
- already associated with an open connection, Common Test will
- return the already existing handle so that the previously opened connection
- will be used. This is a practical feature since it makes it possible to
+ (also for closing it). Only one open connection per target name
+ is possible. If you attempt to open a new connection using a name
+ already associated with an open connection, <c>Common Test</c>
+ returns the already existing handle so the previously opened connection
+ is used. This feature makes it possible to
call the function for opening a particular connection whenever
- useful. An action like this will not necessarily open any new
- connections unless it's required (which could be the case if e.g. the
- previous connection has been closed unexpectedly by the server).
- Another benefit of using named connections is that it's not
- necessary to pass handle references around in the suite for these
- connections.
+ useful. An action like this does not necessarily open any new
+ connections unless it is required (which could be the case if, for example,
+ the previous connection has been closed unexpectedly by the server).
+ Using named connections also removes the need to pass handle references
+ around in the suite for these connections.
</p>
<p>When a configuration variable name is used as reference to the data
specifying the connection, the handle returned as a result of opening
the connection must be used in all subsequent calls (also for closing
the connection). Repeated calls to the open function with the same
- variable name as reference will result in multiple connections
- being opened. This can be useful e.g. if a test case needs to open
+ variable name as reference results in multiple connections being opened.
+ This can be useful, for example, if a test case needs to open
multiple connections to the same server on the target node (using the
same configuration data for each connection).
</p>
</section>
<section>
- <title>User specific configuration data formats</title>
+ <title>User-Specific Configuration Data Formats</title>
- <p>It is possible for the user to specify configuration data on a
+ <p>The user can specify configuration data on a
different format than key-value tuples in a text file, as described
- so far. The data can e.g. be read from arbitrary files, fetched from
- the web over http, or requested from a user specific process.
- To support this, Common Test provides a callback module plugin
+ so far. The data can, for example, be read from any files, fetched from
+ the web over HTTP, or requested from a user-specific process.
+ To support this, <c>Common Test</c> provides a callback module plugin
mechanism to handle configuration data.</p>
<section>
- <title>Default callback modules for handling configuration data</title>
- <p>The Common Test application includes default callback modules
- for handling configuration data specified in standard config files
- (see above) and in xml files:</p>
- <list>
+ <title>Default Callback Modules for Handling Configuration Data</title>
+ <p><c>Common Test</c> includes default callback modules
+ for handling configuration data specified in standard configuration files
+ (described earlier) and in XML files as follows:</p>
+ <list type="bulleted">
<item>
<c>ct_config_plain</c> - for reading configuration files with
- key-value tuples (standard format). This handler will be used to
+ key-value tuples (standard format). This handler is used to
parse configuration files if no user callback is specified.
</item>
<item>
@@ -215,59 +211,59 @@
</section>
<section>
- <title>Using XML configuration files</title>
- <p>This is an example of an XML configuration file:</p>
- <pre><![CDATA[
-<config>
+ <title>Using XML Configuration Files</title>
+ <p>An example of an XML configuration file follows:</p>
+ <pre>
+ <![CDATA[
+ <config>
<ftp_host>
<ftp>"targethost"</ftp>
<username>"tester"</username>
<password>"letmein"</password>
</ftp_host>
<lm_directory>"/test/loadmodules"</lm_directory>
-</config>]]></pre>
+ </config>]]></pre>
- <p>This configuration file, once read, will produce the same configuration
+ <p>Once read, this file produces the same configuration
variables as the following text file:</p>
<pre>
-{ftp_host, [{ftp,"targethost"},
- {username,"tester"},
- {password,"letmein"}]}.
+ {ftp_host, [{ftp,"targethost"},
+ {username,"tester"},
+ {password,"letmein"}]}.
-{lm_directory, "/test/loadmodules"}.</pre>
+ {lm_directory, "/test/loadmodules"}.</pre>
</section>
<section>
- <title>How to implement a user specific handler</title>
+ <title>Implement a User-Specific Handler</title>
- <p>The user specific handler can be written to handle special
+ <p>The user-specific handler can be written to handle special
configuration file formats. The parameter can be either file
- name(s) or configuration string(s) (the empty list is valid).</p>
+ names or configuration strings (the empty list is valid).</p>
<p>The callback module implementing the handler is responsible for
- checking correctness of configuration strings.</p>
+ checking the correctness of configuration strings.</p>
- <p>To perform validation of the configuration strings, the callback module
- should have the following function exported:</p>
+ <p>To validate the configuration strings, the callback module
+ is to have function <c>Callback:check_parameter/1</c> exported.</p>
- <p><c>Callback:check_parameter/1</c></p>
- <p>The input argument will be passed from Common Test, as defined in the test
- specification or given as an option to <c>ct_run</c> or <c>ct:run_test</c>.</p>
+ <p>The input argument is passed from <c>Common Test</c>, as defined in the test
+ specification, or specified as an option to <c>ct_run</c> or <c>ct:run_test</c>.</p>
- <p>The return value should be any of the following values indicating if given
+ <p>The return value is to be any of the following values, indicating if the specified
configuration parameter is valid:</p>
- <list>
+ <list type="bulleted">
<item>
- <c>{ok, {file, FileName}}</c> - parameter is a file name and
- the file exists,
+ <c>{ok, {file, FileName}}</c> - the parameter is a file name and
+ the file exists.
</item>
<item>
- <c>{ok, {config, ConfigString}}</c> - parameter is a config string
- and it is correct,
+ <c>{ok, {config, ConfigString}}</c> - the parameter is a configuration string
+ and it is correct.
</item>
<item>
- <c>{error, {nofile, FileName}}</c> - there is no file with the given
- name in the current directory,
+ <c>{error, {nofile, FileName}}</c> - there is no file with the specified
+ name in the current directory.
</item>
<item>
<c>{error, {wrong_config, ConfigString}}</c> - the configuration string
@@ -275,196 +271,196 @@
</item>
</list>
- <p>To perform reading of configuration data - initially before the tests
- start, or as a result of data being reloaded during test execution -
- the following function should be exported from the callback module:</p>
-
- <p><c>Callback:read_config/1</c></p>
+ <p>The function <c>Callback:read_config/1</c> is to be exported from the
+ callback module to read configuration data, initially before the tests
+ start, or as a result of data being reloaded during test execution.
+ The input argument is the same as for function <c>check_parameter/1</c>.</p>
- <p>The input argument is the same as for the <c>check_parameter/1</c> function.</p>
- <p>The return value should be either:</p>
+ <p>The return value is to be either of the following:</p>
- <list>
+ <list type="bulleted">
<item>
- <c>{ok, Config}</c> - if the configuration variables are read successfully,
+ <c>{ok, Config}</c> - if the configuration variables are read successfully.
</item>
<item>
<c>{error, {Error, ErrorDetails}}</c> - if the callback module fails to
- proceed with the given configuration parameters.
+ proceed with the specified configuration parameters.
</item>
</list>
<p><c>Config</c> is the proper Erlang key-value list, with possible
- key-value sublists as values, like for the configuration file
- example above:</p>
+ key-value sublists as values, like the earlier configuration file
+ example:</p>
<pre>
- [{ftp_host, [{ftp, "targethost"}, {username, "tester"}, {password, "letmein"}]},
- {lm_directory, "/test/loadmodules"}]</pre>
+ [{ftp_host, [{ftp, "targethost"}, {username, "tester"}, {password, "letmein"}]},
+ {lm_directory, "/test/loadmodules"}]</pre>
</section>
</section>
<section>
- <title>Examples of configuration data handling</title>
+ <title>Examples of Configuration Data Handling</title>
- <p>A config file for using the FTP client to access files on a remote
- host could look like this:</p>
+ <p>A configuration file for using the FTP client to access files on a remote
+ host can look as follows:</p>
<pre>
- {ftp_host, [{ftp,"targethost"},
- {username,"tester"},
- {password,"letmein"}]}.
+ {ftp_host, [{ftp,"targethost"},
+ {username,"tester"},
+ {password,"letmein"}]}.
- {lm_directory, "/test/loadmodules"}.</pre>
+ {lm_directory, "/test/loadmodules"}.</pre>
- <p>The XML version shown in the chapter above can also be used, but it should be
+ <p>The XML version shown earlier can also be used, but it is to be
explicitly specified that the <c>ct_config_xml</c> callback module is to be
- used by Common Test.</p>
+ used by <c>Common Test</c>.</p>
- <p>Example of how to assert that the configuration data is available and
- use it for an FTP session:</p>
+ <p>The following is an example of how to assert that the configuration data is available
+ and can be used for an FTP session:</p>
<pre>
- init_per_testcase(ftptest, Config) ->
- {ok,_} = ct_ftp:open(ftp),
- Config.
-
- end_per_testcase(ftptest, _Config) ->
- ct_ftp:close(ftp).
-
- ftptest() ->
- [{require,ftp,ftp_host},
- {require,lm_directory}].
-
- ftptest(Config) ->
- Remote = filename:join(ct:get_config(lm_directory), "loadmodX"),
- Local = filename:join(?config(priv_dir,Config), "loadmodule"),
- ok = ct_ftp:recv(ftp, Remote, Local),
- ...</pre>
+ init_per_testcase(ftptest, Config) ->
+ {ok,_} = ct_ftp:open(ftp),
+ Config.
+
+ end_per_testcase(ftptest, _Config) ->
+ ct_ftp:close(ftp).
+
+ ftptest() ->
+ [{require,ftp,ftp_host},
+ {require,lm_directory}].
+
+ ftptest(Config) ->
+ Remote = filename:join(ct:get_config(lm_directory), "loadmodX"),
+ Local = filename:join(?config(priv_dir,Config), "loadmodule"),
+ ok = ct_ftp:recv(ftp, Remote, Local),
+ ...</pre>
- <p>An example of how the above functions could be rewritten
- if necessary to open multiple connections to the FTP server:</p>
+ <p>The following is an example of how the functions in the previous example
+ can be rewritten if it is necessary to open multiple connections to the
+ FTP server:</p>
<pre>
- init_per_testcase(ftptest, Config) ->
- {ok,Handle1} = ct_ftp:open(ftp_host),
- {ok,Handle2} = ct_ftp:open(ftp_host),
- [{ftp_handles,[Handle1,Handle2]} | Config].
-
- end_per_testcase(ftptest, Config) ->
- lists:foreach(fun(Handle) -> ct_ftp:close(Handle) end,
- ?config(ftp_handles,Config)).
-
- ftptest() ->
- [{require,ftp_host},
- {require,lm_directory}].
-
- ftptest(Config) ->
- Remote = filename:join(ct:get_config(lm_directory), "loadmodX"),
- Local = filename:join(?config(priv_dir,Config), "loadmodule"),
- [Handle | MoreHandles] = ?config(ftp_handles,Config),
- ok = ct_ftp:recv(Handle, Remote, Local),
- ...</pre>
+ init_per_testcase(ftptest, Config) ->
+ {ok,Handle1} = ct_ftp:open(ftp_host),
+ {ok,Handle2} = ct_ftp:open(ftp_host),
+ [{ftp_handles,[Handle1,Handle2]} | Config].
+
+ end_per_testcase(ftptest, Config) ->
+ lists:foreach(fun(Handle) -> ct_ftp:close(Handle) end,
+ ?config(ftp_handles,Config)).
+
+ ftptest() ->
+ [{require,ftp_host},
+ {require,lm_directory}].
+
+ ftptest(Config) ->
+ Remote = filename:join(ct:get_config(lm_directory), "loadmodX"),
+ Local = filename:join(?config(priv_dir,Config), "loadmodule"),
+ [Handle | MoreHandles] = ?config(ftp_handles,Config),
+ ok = ct_ftp:recv(Handle, Remote, Local),
+ ...</pre>
</section>
<section>
- <title>Example of user specific configuration handler</title>
- <p>A simple configuration handling driver which will ask an external server for
- configuration data can be implemented this way:</p>
+ <title>Example of User-Specific Configuration Handler</title>
+ <p>A simple configuration handling driver, asking an external server for
+ configuration data, can be implemented as follows:</p>
<pre>
--module(config_driver).
--export([read_config/1, check_parameter/1]).
-
-read_config(ServerName)->
- ServerModule = list_to_atom(ServerName),
- ServerModule:start(),
- ServerModule:get_config().
-
-check_parameter(ServerName)->
- ServerModule = list_to_atom(ServerName),
- case code:is_loaded(ServerModule) of
- {file, _}->
- {ok, {config, ServerName}};
- false->
- case code:load_file(ServerModule) of
- {module, ServerModule}->
- {ok, {config, ServerName}};
- {error, nofile}->
- {error, {wrong_config, "File not found: " ++ ServerName ++ ".beam"}}
- end
- end.</pre>
-
- <p>The configuration string for this driver may be "config_server", if the
- config_server.erl module below is compiled and exists in the code path
+ -module(config_driver).
+ -export([read_config/1, check_parameter/1]).
+
+ read_config(ServerName)->
+ ServerModule = list_to_atom(ServerName),
+ ServerModule:start(),
+ ServerModule:get_config().
+
+ check_parameter(ServerName)->
+ ServerModule = list_to_atom(ServerName),
+ case code:is_loaded(ServerModule) of
+ {file, _}->
+ {ok, {config, ServerName}};
+ false->
+ case code:load_file(ServerModule) of
+ {module, ServerModule}->
+ {ok, {config, ServerName}};
+ {error, nofile}->
+ {error, {wrong_config, "File not found: " ++ ServerName ++ ".beam"}}
+ end
+ end.</pre>
+
+ <p>The configuration string for this driver can be <c>config_server</c>, if the
+ <c>config_server.erl</c> module that follows is compiled and exists in the code path
during test execution:</p>
<pre>
--module(config_server).
--export([start/0, stop/0, init/1, get_config/0, loop/0]).
-
--define(REGISTERED_NAME, ct_test_config_server).
-
-start()->
- case whereis(?REGISTERED_NAME) of
- undefined->
- spawn(?MODULE, init, [?REGISTERED_NAME]),
- wait();
- _Pid->
- ok
- end,
- ?REGISTERED_NAME.
-
-init(Name)->
- register(Name, self()),
- loop().
-
-get_config()->
- call(self(), get_config).
-
-stop()->
- call(self(), stop).
-
-call(Client, Request)->
- case whereis(?REGISTERED_NAME) of
- undefined->
- {error, {not_started, Request}};
- Pid->
- Pid ! {Client, Request},
- receive
- Reply->
- {ok, Reply}
- after 4000->
- {error, {timeout, Request}}
- end
- end.
-
-loop()->
- receive
- {Pid, stop}->
- Pid ! ok;
- {Pid, get_config}->
- {D,T} = erlang:localtime(),
- Pid !
- [{localtime, [{date, D}, {time, T}]},
- {node, erlang:node()},
- {now, erlang:now()},
- {config_server_pid, self()},
- {config_server_vsn, ?vsn}],
- ?MODULE:loop()
- end.
-
-wait()->
- case whereis(?REGISTERED_NAME) of
- undefined->
- wait();
- _Pid->
- ok
- end.</pre>
-
- <p>In this example, the handler also provides the ability to dynamically reload
- configuration variables. If <c>ct:reload_config(localtime)</c> is called from
+ -module(config_server).
+ -export([start/0, stop/0, init/1, get_config/0, loop/0]).
+
+ -define(REGISTERED_NAME, ct_test_config_server).
+
+ start()->
+ case whereis(?REGISTERED_NAME) of
+ undefined->
+ spawn(?MODULE, init, [?REGISTERED_NAME]),
+ wait();
+ _Pid->
+ ok
+ end,
+ ?REGISTERED_NAME.
+
+ init(Name)->
+ register(Name, self()),
+ loop().
+
+ get_config()->
+ call(self(), get_config).
+
+ stop()->
+ call(self(), stop).
+
+ call(Client, Request)->
+ case whereis(?REGISTERED_NAME) of
+ undefined->
+ {error, {not_started, Request}};
+ Pid->
+ Pid ! {Client, Request},
+ receive
+ Reply->
+ {ok, Reply}
+ after 4000->
+ {error, {timeout, Request}}
+ end
+ end.
+
+ loop()->
+ receive
+ {Pid, stop}->
+ Pid ! ok;
+ {Pid, get_config}->
+ {D,T} = erlang:localtime(),
+ Pid !
+ [{localtime, [{date, D}, {time, T}]},
+ {node, erlang:node()},
+ {now, erlang:now()},
+ {config_server_pid, self()},
+ {config_server_vsn, ?vsn}],
+ ?MODULE:loop()
+ end.
+
+ wait()->
+ case whereis(?REGISTERED_NAME) of
+ undefined->
+ wait();
+ _Pid->
+ ok
+ end.</pre>
+
+ <p>Here, the handler also provides for dynamically reloading of
+ configuration variables. If
+ <seealso marker="ct#reload_config-1"><c>ct:reload_config(localtime)</c></seealso> is called from
the test case function, all variables loaded with <c>config_driver:read_config/1</c>
- will be updated with their latest values, and the new value for variable
- <c>localtime</c> will be returned.</p>
+ are updated with their latest values, and the new value for variable
+ <c>localtime</c> is returned.</p>
</section>
</chapter>
diff --git a/lib/common_test/doc/src/cover_chapter.xml b/lib/common_test/doc/src/cover_chapter.xml
index f164fff0ad..094aa7d80c 100644
--- a/lib/common_test/doc/src/cover_chapter.xml
+++ b/lib/common_test/doc/src/cover_chapter.xml
@@ -33,256 +33,251 @@
<section>
<marker id="cover"></marker>
<title>General</title>
- <p>Although Common Test was created primarly for the purpose of
- black box testing, nothing prevents it from working perfectly as
- a white box testing tool as well. This is especially true when
+ <p>Although <c>Common Test</c> was created primarily for
+ black-box testing, nothing prevents it from working perfectly as
+ a white-box testing tool as well. This is especially true when
the application to test is written in Erlang. Then the test
- ports are easily realized by means of Erlang function calls.</p>
+ ports are easily realized with Erlang function calls.</p>
- <p>When white box testing an Erlang application, it is useful to
- be able to measure the code coverage of the test. Common Test
+ <p>When white-box testing an Erlang application, it is useful to
+ be able to measure the code coverage of the test. <c>Common Test</c>
provides simple access to the OTP Cover tool for this
- purpose. Common Test handles all necessary communication with
- the Cover tool (starting, compiling, analysing, etc). All the
- Common Test user needs to do is to specify the extent of the
+ purpose. <c>Common Test</c> handles all necessary communication with
+ the Cover tool (starting, compiling, analysing, and so on).
+ The <c>Common Test</c> user only needs to specify the extent of the
code coverage analysis.</p>
</section>
<section>
- <title>Usage</title>
- <p>To specify what modules should be included
- in the code coverage test, you provide a cover specification
- file. Using this file you can point out specific modules or
- specify directories that contain modules which should all be
- included in the analysis. You can also, in the same fashion,
- specify modules that should be excluded from the analysis.</p>
+ <title>Use</title>
+ <p>To specify the modules to be included in the code coverage test,
+ provide a cover specification file. With this file you can point
+ out specific modules or specify directories containing modules to be
+ included in the analysis. You can also specify modules to be excluded
+ from the analysis.</p>
<p>If you are testing a distributed Erlang application, it is
likely that code you want included in the code coverage analysis
- gets executed on an Erlang node other than the one Common Test
- is running on. If this is the case you need to specify these
- other nodes in the cover specification file or add them
- dynamically to the code coverage set of nodes. See the
- <c>ct_cover</c> page in the reference manual for details on the
- latter.</p>
+ gets executed on another Erlang node than the one <c>Common Test</c>
+ is running on. If so, you must specify these other nodes in the
+ cover specification file or add them dynamically to the code coverage
+ set of nodes. For details on the latter, see module
+ <seealso marker="ct_cover"><c>ct_cover</c></seealso>.</p>
<p>In the cover specification file you can also specify your
required level of the code coverage analysis; <c>details</c> or
<c>overview</c>. In detailed mode, you get a coverage overview
- page, showing you per module and total coverage percentages, as
- well as one HTML file printed for each module included in the
- analysis that shows exactly what parts of the code have been
+ page, showing per module and total coverage percentages.
+ You also get an HTML file printed for each module included in the
+ analysis showing exactly what parts of the code have been
executed during the test. In overview mode, only the code
- coverage overview page gets printed.</p>
+ coverage overview page is printed.</p>
<p>You can choose to export and import code coverage data between
tests. If you specify the name of an export file in the cover
- specification file, Common Test will export collected coverage
- data to this file at the end of the test. You may similarly
- specify that previously exported data should be imported and
- included in the analysis for a test (you can specify multiple
- import files). This way it is possible to analyse total code coverage
- without necessarily running all tests at once.</p>
-
- <p>To activate the code coverage support, you simply specify the
- name of the cover specification file as you start Common Test.
- This you do either by using the <c>-cover</c> flag with <c>ct_run</c>.
- Example:</p>
-
- <p><c>$ ct_run -dir $TESTOBJS/db -cover $TESTOBJS/db/config/db.coverspec</c></p>
+ specification file, <c>Common Test</c> exports collected coverage
+ data to this file at the end of the test. You can similarly
+ specify previously exported data to be imported and
+ included in the analysis for a test (multiple import files can be specified).
+ This way, the total code coverage can be analyzed without necessarily
+ running all tests at once.</p>
+
+ <p>To activate the code coverage support, specify the name of the cover
+ specification file as you start <c>Common Test</c>.
+ Do this by using flag <c>-cover</c> with
+ <seealso marker="ct_run"><c>ct_run</c></seealso>,
+ for example:</p>
+ <pre>
+ $ ct_run -dir $TESTOBJS/db -cover $TESTOBJS/db/config/db.coverspec</pre>
- <p>You may also pass the cover specification file name in a
- call to <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>, by adding a <c>{cover,CoverSpec}</c>
- tuple to the <c>Opts</c> argument. Also, you can of course
- enable code coverage in your test specifications (read
- more in the chapter about
- <seealso marker="run_test_chapter#test_specifications">using test
- specifications</seealso>).</p>
+ <p>You can also pass the cover specification file name in a
+ call to <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>,
+ by adding a <c>{cover,CoverSpec}</c> tuple to argument <c>Opts</c>.</p>
+ <p>You can also enable code coverage in your test specifications (see section
+ <seealso marker="run_test_chapter#test_specifications">Test Specifications</seealso>
+ in section Running Tests and Analyzing Results).</p>
</section>
<section>
<marker id="cover_stop"></marker>
- <title>Stopping the cover tool when tests are completed</title>
- <p>By default the Cover tool is automatically stopped when the
- tests are completed. This causes the original (non cover
- compiled) modules to be loaded back in to the test node. If a
- process at this point is still running old code of any of the
+ <title>Stopping the Cover Tool When Tests Are Completed</title>
+ <p>By default, the Cover tool is automatically stopped when the
+ tests are completed. This causes the original (non-cover
+ compiled) modules to be loaded back into the test node. If a
+ process at this point still runs old code of any of the
modules that are cover compiled, meaning that it has not done
any fully qualified function call after the cover compilation,
- the process will now be killed. To avoid this it is possible to
- set the value of the <c>cover_stop</c> option to
- <c>false</c>. This means that the modules will stay cover
- compiled, and it is therefore only recommended if the erlang
- node(s) under test is terminated after the test is completed
- or if cover can be manually stopped.</p>
-
- <p>The option can be set by using the <c>-cover_stop</c> flag with
- <c>ct_run</c>, by adding <c>{cover_stop,true|false}</c> to the
- Opts argument to <seealso
- marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>, or by adding
- a <c>cover_stop</c> term in your test specification (see chapter
- about <seealso
- marker="run_test_chapter#test_specifications">test
- specifications</seealso>).</p>
+ the process is killed. To avoid this, set the value of option
+ <c>cover_stop</c> to <c>false</c>. This means that the
+ modules stay cover compiled. Therefore, this is only recommended
+ if the Erlang nodes under test are terminated after the test is
+ completed, or if cover can be manually stopped.</p>
+
+ <p>The option can be set by using flag <c>-cover_stop</c> with
+ <c>ct_run</c>, by adding <c>{cover_stop,true|false}</c> to argument
+ <c>Opts</c> to
+ <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>,
+ or by adding a <c>cover_stop</c> term in the test specification (see section
+ <seealso marker="run_test_chapter#test_specifications">Test Specifications</seealso>
+ in section Running Tests and Analyzing Results).</p>
</section>
<section>
- <title>The cover specification file</title>
- <p>These are the terms allowed in a cover specification file:</p>
+ <title>The Cover Specification File</title>
+ <p>The following terms are allowed in a cover specification file:</p>
<pre>
- %% List of Nodes on which cover will be active during test.
- %% Nodes = [atom()]
- {nodes, Nodes}.
-
- %% Files with previously exported cover data to include in analysis.
- %% CoverDataFiles = [string()]
- {import, CoverDataFiles}.
-
- %% Cover data file to export from this session.
- %% CoverDataFile = string()
- {export, CoverDataFile}.
-
- %% Cover analysis level.
- %% Level = details | overview
- {level, Level}.
-
- %% Directories to include in cover.
- %% Dirs = [string()]
- {incl_dirs, Dirs}.
-
- %% Directories, including subdirectories, to include.
- {incl_dirs_r, Dirs}.
-
- %% Specific modules to include in cover.
- %% Mods = [atom()]
- {incl_mods, Mods}.
-
- %% Directories to exclude in cover.
- {excl_dirs, Dirs}.
-
- %% Directories, including subdirectories, to exclude.
- {excl_dirs_r, Dirs}.
-
- %% Specific modules to exclude in cover.
- {excl_mods, Mods}.
-
- %% Cross cover compilation
- %% Tag = atom(), an identifier for a test run
- %% Mod = [atom()], modules to compile for accumulated analysis
- {cross,[{Tag,Mods}]}.
- </pre>
-
- <p>The <c>incl_dirs_r</c> and <c>excl_dirs_r</c> terms tell Common
- Test to search the given directories recursively and include
- or exclude any module found during the search. The
- <c>incl_dirs</c> and <c>excl_dirs</c> terms result in a
- non-recursive search for modules (i.e. only modules found in
- the given directories are included or excluded).</p>
- <p><em>Note:</em> Directories containing Erlang modules that are
- to be included in a code coverage test must exist in the code
- server path, or the cover tool will fail to recompile the modules.
- (It is not sufficient to specify these directories in the cover
- specification file for Common Test).</p>
+ %% List of Nodes on which cover will be active during test.
+ %% Nodes = [atom()]
+ {nodes, Nodes}.
+
+ %% Files with previously exported cover data to include in analysis.
+ %% CoverDataFiles = [string()]
+ {import, CoverDataFiles}.
+
+ %% Cover data file to export from this session.
+ %% CoverDataFile = string()
+ {export, CoverDataFile}.
+
+ %% Cover analysis level.
+ %% Level = details | overview
+ {level, Level}.
+
+ %% Directories to include in cover.
+ %% Dirs = [string()]
+ {incl_dirs, Dirs}.
+
+ %% Directories, including subdirectories, to include.
+ {incl_dirs_r, Dirs}.
+
+ %% Specific modules to include in cover.
+ %% Mods = [atom()]
+ {incl_mods, Mods}.
+
+ %% Directories to exclude in cover.
+ {excl_dirs, Dirs}.
+
+ %% Directories, including subdirectories, to exclude.
+ {excl_dirs_r, Dirs}.
+
+ %% Specific modules to exclude in cover.
+ {excl_mods, Mods}.
+
+ %% Cross cover compilation
+ %% Tag = atom(), an identifier for a test run
+ %% Mod = [atom()], modules to compile for accumulated analysis
+ {cross,[{Tag,Mods}]}.</pre>
+
+ <p>The terms <c>incl_dirs_r</c> and <c>excl_dirs_r</c> tell <c>Common
+ Test</c> to search the specified directories recursively and include
+ or exclude any module found during the search. The terms
+ <c>incl_dirs</c> and <c>excl_dirs</c> result in a
+ non-recursive search for modules (that is, only modules found in
+ the specified directories are included or excluded).</p>
+ <note><p>Directories containing Erlang modules to be included in a code
+ coverage test must exist in the code server path. Otherwise,
+ the Cover tool fails to recompile the modules. It is not sufficient to
+ specify these directories in the cover specification file for
+ <c>Common Test</c>.</p></note>
</section>
<section>
<marker id="cross_cover"/>
- <title>Cross cover analysis</title>
+ <title>Cross Cover Analysis</title>
<p>The cross cover mechanism allows cover analysis of modules
- across multiple tests. It is useful if some code, e.g. a library
- module, is used by many different tests and the accumulated cover
- result is desirable.</p>
+ across multiple tests. It is useful if some code, for example, a
+ library module, is used by many different tests and the accumulated
+ cover result is desirable.</p>
- <p>This can of course also be achieved in a more customized way by
- using the <c>export</c> parameter in the cover specification and
- analysing the result off line, but the cross cover mechanism is a
- build in solution which also provides the logging.</p>
+ <p>This can also be achieved in a more customized way by
+ using parameter <c>export</c> in the cover specification and
+ analysing the result off line. However, the cross cover mechanism is a
+ built-in solution that also provides logging.</p>
- <p>The mechanism is easiest explained via an example:</p>
+ <p>The mechanism is easiest explained by an example:</p>
- <p>Let's say that there are two systems, <c>s1</c> and <c>s2</c>,
- which are tested in separate test runs. System <c>s1</c> contains
- a library module <c>m1</c> which is tested by the <c>s1</c> test
- run and is included in <c>s1</c>'s cover specification:</p>
+ <p>Assume that there are two systems, <c>s1</c> and <c>s2</c>,
+ that are tested in separate test runs. System <c>s1</c> contains
+ a library module <c>m1</c> tested by test run <c>s1</c> and
+ is included in the cover specification of <c>s1</c> as follows:</p>
<code type="none">
-s1.cover:
- {incl_mods,[m1]}.</code>
+ s1.cover:
+ {incl_mods,[m1]}.</code>
<p>When analysing code coverage, the result for <c>m1</c> can be
seen in the cover log in the <c>s1</c> test result.</p>
- <p>Now, let's imagine that since <c>m1</c> is a library module, it
- is also used quite a bit by system <c>s2</c>. The <c>s2</c> test
- run does not specifically test <c>m1</c>, but it might still be
- interesting to see which parts of <c>m1</c> is actually covered by
- the <c>s2</c> tests. To do this, <c>m1</c> could be included also
- in <c>s2</c>'s cover specification:</p>
+ <p>Now, imagine that as <c>m1</c> is a library module, it
+ is also often used by system <c>s2</c>. Test run <c>s2</c>
+ does not specifically test <c>m1</c>, but it can still be
+ interesting to see which parts of <c>m1</c> that are covered
+ by the <c>s2</c> tests. To do this, <c>m1</c> can be included also
+ in the cover specification of <c>s2</c> as follows:</p>
<code type="none">
-s2.cover:
- {incl_mods,[m1]}.</code>
+ s2.cover:
+ {incl_mods,[m1]}.</code>
- <p>This would give an entry for <c>m1</c> also in the cover log
- for the <c>s2</c> test run. The problem is that this would only
- reflect the coverage by <c>s2</c> tests, not the accumulated
- result over <c>s1</c> and <c>s2</c>. And this is where the cross
+ <p>This gives an entry for <c>m1</c> also in the cover log
+ for test run <c>s2</c>. The problem is that this only
+ reflects the coverage by <c>s2</c> tests, not the accumulated
+ result over <c>s1</c> and <c>s2</c>. This is where the cross
cover mechanism comes in handy.</p>
- <p>If instead the cover specification for <c>s2</c> was like
- this:</p>
+ <p>If instead the cover specification for <c>s2</c> is like
+ the following:</p>
<code type="none">
-s2.cover:
- {cross,[{s1,[m1]}]}.</code>
+ s2.cover:
+ {cross,[{s1,[m1]}]}.</code>
- <p>then <c>m1</c> would be cover compiled in the <c>s2</c> test
- run, but not shown in the coverage log. Instead, if
- <c>ct_cover:cross_cover_analyse/2</c> is called after both
- <c>s1</c> and <c>s2</c> test runs are completed, the accumulated
- result for <c>m1</c> would be available in the cross cover log for
- the <c>s1</c> test run.</p>
+ <p>Then <c>m1</c> is cover compiled in test run <c>s2</c>,
+ but not shown in the coverage log. Instead, if
+ <seealso marker="ct_cover#cross_cover_analyse-2"><c>ct_cover:cross_cover_analyse/2</c></seealso>
+ is called after both <c>s1</c> and <c>s2</c> test runs are completed,
+ the accumulated result for <c>m1</c> is available in the cross cover
+ log for test run <c>s1</c>.</p>
- <p>The call to the analyse function must be like this:</p>
+ <p>The call to the analyze function must be as follows:</p>
<code type="none">
-ct_cover:cross_cover_analyse(Level, [{s1,S1LogDir},{s2,S2LogDir}]).</code>
+ ct_cover:cross_cover_analyse(Level, [{s1,S1LogDir},{s2,S2LogDir}]).</code>
- <p>where <c>S1LogDir</c> and <c>S2LogDir</c> are the directories
+ <p>Here, <c>S1LogDir</c> and <c>S2LogDir</c> are the directories
named <c>&lt;TestName&gt;.logs</c> for each test respectively.</p>
- <p>Note the tags <c>s1</c> and <c>s2</c> which are used in the
+ <p>Notice the tags <c>s1</c> and <c>s2</c>, which are used in the
cover specification file and in the call to
- <c>ct_cover:cross_cover_analyse/2</c>. The point of these are only
+ <c>ct_cover:cross_cover_analyse/2</c>. The purpose of these is only
to map the modules specified in the cover specification to the log
- directory specified in the call to the analyse function. The name
- of the tag has no meaning beyond this.</p>
+ directory specified in the call to the analyze function. The tag name
+ has no meaning beyond this.</p>
</section>
<section>
<title>Logging</title>
<p>To view the result of a code coverage test, click the button
- labled "COVER LOG" in the top level index page for the test run.</p>
+ labeled "COVER LOG" in the top-level index page for the test run.</p>
- <p>Prior to Erlang/OTP 17.1, if your test run consisted of
+ <p>Before Erlang/OTP 17.1, if your test run consisted of
multiple tests, cover would be started and stopped for each test
- within the test run. Separate logs would be available via the
+ within the test run. Separate logs would be available through the
"Coverage log" link on the test suite result pages. These links
are still available, but now they all point to the same page as
- the button on the top level index page. The log contains the
- accumulated results for the complete test run. See the release
- notes for more information about this change.</p>
+ the button on the top-level index page. The log contains the
+ accumulated results for the complete test run. For details about
+ this change, see the release notes.</p>
- <p>The buttonc takes you to the code coverage overview page. If you
- have successfully performed a detailed coverage analysis, you
- find links to each individual module coverage page here.</p>
+ <p>The button takes you to the code coverage overview page. If you
+ have successfully performed a detailed coverage analysis,
+ links to each individual module coverage page are found here.</p>
- <p>If cross cover analysis has been performed, and there are
- accumulated coverage results for the current test, then the -
- "Coverdata collected over all tests" link will take you to these
+ <p>If cross cover analysis is performed, and there are
+ accumulated coverage results for the current test, the link
+ "Coverdata collected over all tests" takes you to these
results.</p>
</section>
diff --git a/lib/common_test/doc/src/ct.xml b/lib/common_test/doc/src/ct.xml
new file mode 100644
index 0000000000..a87be21d73
--- /dev/null
+++ b/lib/common_test/doc/src/ct.xml
@@ -0,0 +1,1412 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2010</year><year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>ct</title>
+ <prepared></prepared>
+ <responsible></responsible>
+ <docno></docno>
+ <approved></approved>
+ <checked></checked>
+ <date></date>
+ <rev>A</rev>
+ <file>ct.xml</file>
+ </header>
+ <module>ct</module>
+ <modulesummary>Main user interface for the Common Test framework.</modulesummary>
+
+ <description>
+
+ <p>Main user interface for the <c>Common Test</c> framework.</p>
+
+ <p>This module implements the command-line interface for running
+ tests and basic functions for <c>Common Test</c> case issues, such as
+ configuration and logging.</p>
+
+ <p><em>Test Suite Support Macros</em></p>
+
+ <p>The <c>config</c> macro is defined in <c>ct.hrl</c>. This macro is
+ to be used to retrieve information from the <c>Config</c> variable sent
+ to all test cases. It is used with two arguments; the first is the name
+ of the configuration variable to retrieve, the second is the
+ <c>Config</c> variable supplied to the test case.</p>
+
+ <p>Possible configuration variables include:</p>
+
+ <list type="bulleted">
+ <item><p><c>data_dir</c> - Data file directory</p></item>
+ <item><p><c>priv_dir</c> - Scratch file directory</p></item>
+ <item><p>Whatever added by
+ <seealso marker="common_test#Module:init_per_suite-1"><c>init_per_suite/1</c></seealso>
+ or
+ <seealso marker="common_test#Module:init_per_testcase-2"><c>init_per_testcase/2</c></seealso>
+ in the test suite.</p></item>
+ </list>
+
+ </description>
+
+ <section>
+ <title>Data Types</title>
+ <marker id="types"/>
+ <taglist>
+
+ <tag><c>handle() = pid()</c></tag>
+ <item><marker id="type-handle"/>
+ <p>The identity (handle) of a connection.</p></item>
+
+ <tag><c>target_name() = atom()</c></tag>
+ <item><marker id="type-target_name"/>
+ <p>A name and association to configuration data introduced
+ through a require statement, or a call to
+ <seealso marker="#require-2"><c>ct:require/2</c></seealso>,
+ for example,
+ <c>ct:require(mynodename,{node,[telnet]})</c>.</p></item>
+
+ </taglist>
+ </section>
+
+ <funcs>
+ <func>
+ <name>abort_current_testcase(Reason) -&gt; ok | {error, ErrorReason}</name>
+ <fsummary>Aborts the currently executing test case.</fsummary>
+ <type>
+ <v>Reason = term()</v>
+ <v>ErrorReason = no_testcase_running | parallel_group</v>
+ </type>
+ <desc><marker id="abort_current_testcase-1"/>
+ <p>Aborts the currently executing test case. The user must know with
+ certainty which test case is currently executing. The function is
+ therefore only safe to call from a function that has been called
+ (or synchronously invoked) by the test case.</p>
+
+ <p><c>Reason</c>, the reason for aborting the test case, is printed
+ in the test case log.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>add_config(Callback, Config) -&gt; ok | {error, Reason}</name>
+ <fsummary>Loads configuration variables using the specified callback
+ module and configuration string.</fsummary>
+ <type>
+ <v>Callback = atom()</v>
+ <v>Config = string()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="add_config-2"/>
+ <p>Loads configuration variables using the specified callback module and
+ configuration string. The callback module is to be either loaded or
+ present in the code part. Loaded configuration variables can later
+ be removed using function
+ <seealso marker="#remove_config-2"><c>ct:remove_config/2</c></seealso>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name>break(Comment) -&gt; ok | {error, Reason}</name>
+ <fsummary>Cancels any active timetrap and pause the execution of the
+ current test case until the user calls function continue/0.</fsummary>
+ <type>
+ <v>Comment = string()</v>
+ <v>Reason = {multiple_cases_running, TestCases} | 'enable break with release_shell option'</v>
+ <v>TestCases = [atom()]</v>
+ </type>
+ <desc><marker id="break-1"/>
+ <p>Cancels any active timetrap and pauses the execution of the
+ current test case until the user calls function <c>continue/0</c>.
+ The user can then interact with the Erlang node running the tests,
+ for example, for debugging purposes or for manually executing a
+ part of the test case. If a parallel group is executing,
+ <seealso marker="#break-2"><c>ct:break/2</c></seealso> is to be
+ called instead.</p>
+ <p>A cancelled timetrap is not automatically reactivated after the
+ break, but must be started exlicitly with
+ <seealso marker="#timetrap-1"><c>ct:timetrap/1</c></seealso>.</p>
+ <p>In order for the break/continue functionality to work, <c>Common
+ Test</c> must release the shell process controlling <c>stdin</c>.
+ This is done by setting start option <c>release_shell</c>
+ to <c>true</c>. For details, see section
+ <seealso marker="run_test_chapter#erlang_shell_or_program">Running
+ Tests from the Erlang Shell or from an Erlang Program</seealso>
+ in the User's Guide.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>break(TestCase, Comment) -&gt; ok | {error, Reason}</name>
+ <fsummary>Works the same way as break/1, only argument TestCase makes it
+ possible to pause a test case executing in a parallel group.</fsummary>
+ <type>
+ <v>TestCase = atom()</v>
+ <v>Comment = string()</v>
+ <v>Reason = 'test case not running' | 'enable break with release_shell option'</v>
+ </type>
+ <desc><marker id="break-2"/>
+ <p>Works the same way as
+ <seealso marker="#break-1"><c>ct:break/1</c></seealso>, only
+ argument <c>TestCase</c> makes it possible to pause a test case
+ executing in a parallel group. Function
+ <seealso marker="#continue-1"><c>ct:continue/1</c></seealso> is to
+ be used to resume execution of <c>TestCase</c>.</p>
+
+ <p>For details, see
+ <seealso marker="#break/1"><c>ct:break/1</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>capture_get() -&gt; ListOfStrings</name>
+ <fsummary>Equivalent to capture_get([default]).</fsummary>
+ <type>
+ <v>ListOfStrings = [string()]</v>
+ </type>
+ <desc><marker id="capture_get-0"/>
+ <p>Equivalent to
+ <seealso marker="#capture_get-1">ct:capture_get([default])</seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>capture_get(ExclCategories) -&gt; ListOfStrings</name>
+ <fsummary>Returns and purges the list of text strings buffered during
+ the latest session of capturing printouts to stdout.</fsummary>
+ <type>
+ <v>ExclCategories = [atom()]</v>
+ <v>ListOfStrings = [string()]</v>
+ </type>
+ <desc><marker id="capture_get-1"/>
+ <p>Returns and purges the list of text strings buffered during the
+ latest session of capturing printouts to <c>stdout</c>. Log
+ categories that are to be ignored in <c>ListOfStrings</c> can be
+ specified with <c>ExclCategories</c>.
+ If <c>ExclCategories = []</c>, no filtering takes place.</p>
+
+ <p>See also
+ <seealso marker="#capture_start-0"><c>ct:capture_start/0</c></seealso>,
+ <seealso marker="#capture_stop-0"><c>ct:capture_stop/0</c></seealso>,
+ <seealso marker="#log-3"><c>ct:log/3</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>capture_start() -&gt; ok</name>
+ <fsummary>Starts capturing all text strings printed to stdout
+ during execution of the test case.</fsummary>
+ <desc><marker id="capture_start-0"/>
+ <p>Starts capturing all text strings printed to <c>stdout</c>
+ during execution of the test case.</p>
+
+ <p>See also
+ <seealso marker="#capture_get-1"><c>ct:capture_get/1</c></seealso>,
+ <seealso marker="#capture_stop-0"><c>ct:capture_stop/0</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>capture_stop() -&gt; ok</name>
+ <fsummary>Stops capturing text strings (a session started with
+ capture_start/0).</fsummary>
+ <desc><marker id="capture_stop-0"/>
+ <p>Stops capturing text strings (a session started with
+ <c>capture_start/0</c>).</p>
+
+ <p>See also
+ <seealso marker="#capture_get-1"><c>ct:capture_get/1</c></seealso>,
+ <seealso marker="#capture_start-0"><c>ct:capture_start/0</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>comment(Comment) -&gt; ok</name>
+ <fsummary>Prints the specified Comment in the comment field in the
+ table on the test suite result page.</fsummary>
+ <type>
+ <v>Comment = term()</v>
+ </type>
+ <desc><marker id="comment-1"/>
+ <p>Prints the specified <c>Comment</c> in the comment field in the
+ table on the test suite result page.</p>
+
+ <p>If called several times, only the last comment is printed. The
+ test case return value <c>{comment,Comment}</c> overwrites the
+ string set by this function.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>comment(Format, Args) -&gt; ok</name>
+ <fsummary>Prints the formatted string in the comment field in the
+ table on the test suite result page.</fsummary>
+ <type>
+ <v>Format = string()</v>
+ <v>Args = list()</v>
+ </type>
+ <desc><marker id="comment-2"/>
+ <p>Prints the formatted string in the comment field in the table
+ on the test suite result page.</p>
+
+ <p>Arguments <c>Format</c> and <c>Args</c> are used in a call to
+ <c>io_lib:format/2</c> to create the comment string. The behavior
+ of <c>comment/2</c> is otherwise the same as function
+ <seealso marker="#comment-1"><c>ct:comment/1</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>continue() -&gt; ok</name>
+ <fsummary>This function must be called to continue after a test
+ case (not executing in a parallel group) has called break/1.</fsummary>
+ <desc><marker id="continue-0"/>
+ <p>This function must be called to continue after a test case
+ (not executing in a parallel group) has called function
+ <seealso marker="#break-1"><c>ct:break/1</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>continue(TestCase) -&gt; ok</name>
+ <fsummary>This function must be called to continue after a test case
+ has called break/2.</fsummary>
+ <type>
+ <v>TestCase = atom()</v>
+ </type>
+ <desc><marker id="continue-1"/>
+ <p>This function must be called to continue after a test case has
+ called <seealso marker="#break-2"><c>ct:break/2</c></seealso>.
+ If the paused test case, <c>TestCase</c>, executes in a parallel
+ group, this function, rather than <c>continue/0</c>, must be used
+ to let the test case proceed.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>decrypt_config_file(EncryptFileName, TargetFileName) -&gt; ok | {error, Reason}</name>
+ <fsummary>Decrypts EncryptFileName, previously generated with
+ encrypt_config_file/2,3.</fsummary>
+ <type>
+ <v>EncryptFileName = string()</v>
+ <v>TargetFileName = string()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="decrypt_config_file-2"/>
+ <p>Decrypts <c>EncryptFileName</c>, previously generated with
+ <seealso marker="#encrypt_config_file-2"><c>ct:encrypt_config_file/2,3</c></seealso>.
+ The original file contents is saved in the target file. The
+ encryption key, a string, must be available in a text file named
+ <c>.ct_config.crypt</c>, either in the current directory, or the
+ home directory of the user (it is searched for in that order).</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>decrypt_config_file(EncryptFileName, TargetFileName, KeyOrFile) -&gt; ok | {error, Reason}</name>
+ <fsummary>Decrypts EncryptFileName, previously generated with
+ encrypt_config_file/2,3.</fsummary>
+ <type>
+ <v>EncryptFileName = string()</v>
+ <v>TargetFileName = string()</v>
+ <v>KeyOrFile = {key, string()} | {file, string()}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="decrypt_config_file-3"/>
+ <p>Decrypts <c>EncryptFileName</c>, previously generated with
+ <seealso marker="#encrypt_config_file-2"><c>ct:encrypt_config_file/2,3</c></seealso>.
+ The original file contents is saved in the target file. The key
+ must have the same value as that used for encryption.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>encrypt_config_file(SrcFileName, EncryptFileName) -&gt; ok | {error, Reason}</name>
+ <fsummary>Encrypts the source configuration file with DES3 and saves the
+ result in file EncryptFileName.</fsummary>
+ <type>
+ <v>SrcFileName = string()</v>
+ <v>EncryptFileName = string()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="encrypt_config_file-2"/>
+ <p>Encrypts the source configuration file with DES3 and saves the result
+ in file <c>EncryptFileName</c>. The key, a string, must be
+ available in a text file named <c>.ct_config.crypt</c>, either
+ in the current directory, or the home directory of the user (it
+ is searched for in that order).</p>
+
+ <p>For information about using encrypted configuration files when
+ running tests, see section
+ <seealso marker="config_file_chapter#encrypted_config_files">Encrypted
+ Configuration Files</seealso> in the User's Guide.</p>
+
+ <p>For details on DES3 encryption/decryption, see application
+ <seealso marker="crypto:index"><c>Crypto</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>encrypt_config_file(SrcFileName, EncryptFileName, KeyOrFile) -&gt; ok | {error, Reason}</name>
+ <fsummary>Encrypts the source configuration file with DES3 and saves the
+ result in the target file EncryptFileName.</fsummary>
+ <type>
+ <v>SrcFileName = string()</v>
+ <v>EncryptFileName = string()</v>
+ <v>KeyOrFile = {key, string()} | {file, string()}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="encrypt_config_file-3"/>
+ <p>Encrypts the source configuration file with DES3 and saves the result
+ in the target file <c>EncryptFileName</c>. The encryption key
+ to use is either the value in <c>{key,Key}</c> or the value
+ stored in the file specified by <c>{file,File}</c>.</p>
+
+ <p>For information about using encrypted configuration files when
+ running tests, see section
+ <seealso marker="config_file_chapter#encrypted_config_files">Encrypted
+ Configuration Files</seealso> in the User's Guide.</p>
+
+ <p>For details on DES3 encryption/decryption, see application
+ <seealso marker="crypto:index"><c>Crypto</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>fail(Reason) -&gt; ok</name>
+ <fsummary>Terminates a test case with the specified error
+ Reason.</fsummary>
+ <type>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="fail-1"/>
+ <p>Terminates a test case with the specified error <c>Reason</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>fail(Format, Args) -&gt; ok</name>
+ <fsummary>Terminates a test case with an error message specified by
+ a format string and a list of values (used as arguments to
+ io_lib:format/2).</fsummary>
+ <type>
+ <v>Format = string()</v>
+ <v>Args = list()</v>
+ </type>
+ <desc><marker id="fail-2"/>
+ <p>Terminates a test case with an error message specified by a
+ format string and a list of values (used as arguments to
+ <c>io_lib:format/2</c>).</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_config(Required) -&gt; Value</name>
+ <fsummary>Equivalent to get_config(Required, undefined, []).</fsummary>
+ <desc><marker id="get_config-1"/>
+ <p>Equivalent to <seealso marker="#get_config-3"><c>ct:get_config(Required,
+ undefined, [])</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_config(Required, Default) -&gt; Value</name>
+ <fsummary>Equivalent to get_config(Required, Default, []).</fsummary>
+ <desc><marker id="get_config-2"/>
+ <p>Equivalent to <seealso marker="#get_config-3"><c>ct:get_config(Required,
+ Default, [])</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_config(Required, Default, Opts) -&gt; ValueOrElement</name>
+ <fsummary>Reads configuration data values.</fsummary>
+ <type>
+ <v>Required = KeyOrName | {KeyOrName, SubKey} | {KeyOrName, SubKey, SubKey}</v>
+ <v>KeyOrName = atom()</v>
+ <v>SubKey = atom()</v>
+ <v>Default = term()</v>
+ <v>Opts = [Opt] | []</v>
+ <v>Opt = element | all</v>
+ <v>ValueOrElement = term() | Default</v>
+ </type>
+ <desc><marker id="get_config-3"/>
+ <p>Reads configuration data values.</p>
+
+ <p>Returns the matching values or configuration elements, given a
+ configuration variable key or its associated name (if one has been
+ specified with
+ <seealso marker="#require-2"><c>ct:require/2</c></seealso>
+ or a <c>require</c> statement).</p>
+
+ <p><em>Example:</em></p>
+
+ <p>Given the following configuration file:</p>
+
+ <pre>
+ {unix,[{telnet,IpAddr},
+ {user,[{username,Username},
+ {password,Password}]}]}.</pre>
+
+ <p>Then:</p>
+
+ <pre>
+ ct:get_config(unix,Default) -&gt; [{telnet,IpAddr},
+ {user, [{username,Username}, {password,Password}]}]
+ ct:get_config({unix,telnet},Default) -&gt; IpAddr
+ ct:get_config({unix,user,username},Default) -&gt; Username
+ ct:get_config({unix,ftp},Default) -&gt; Default
+ ct:get_config(unknownkey,Default) -&gt; Default</pre>
+
+ <p>If a configuration variable key has been associated with a name (by
+ <seealso marker="#require-2"><c>ct:require/2</c></seealso>
+ or a <c>require</c> statement), the name can be used instead
+ of the key to read the value:</p>
+
+ <pre>
+ ct:require(myuser,{unix,user}) -&gt; ok.
+ ct:get_config(myuser,Default) -&gt; [{username,Username}, {password,Password}]</pre>
+
+ <p>If a configuration variable is defined in multiple files, use option
+ <c>all</c> to access all possible values. The values are returned
+ in a list. The order of the elements corresponds to the order
+ that the configuration files were specified at startup.</p>
+
+ <p>If configuration elements (key-value tuples) are to be returned as
+ result instead of values, use option <c>element</c>. The
+ returned elements are then on the form <c>{Required,Value}</c>.</p>
+
+ <p>See also
+ <seealso marker="#get_config-1"><c>ct:get_config/1</c></seealso>,
+ <seealso marker="#get_config-2"><c>ct:get_config/2</c></seealso>,
+ <seealso marker="#require-1"><c>ct:require/1</c></seealso>,
+ <seealso marker="#require-2"><c>ct:require/2</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_event_mgr_ref() -&gt; EvMgrRef</name>
+ <fsummary>Gets a reference to the <c>Common Test</c> event manager.</fsummary>
+ <type>
+ <v>EvMgrRef = atom()</v>
+ </type>
+ <desc><marker id="get_event_mgr_ref-0"/>
+ <p>Gets a reference to the <c>Common Test</c> event manager.
+ The reference can be used to, for example, add a user-specific
+ event handler while tests are running.</p>
+
+ <p><em>Example:</em></p>
+
+ <pre>
+ gen_event:add_handler(ct:get_event_mgr_ref(), my_ev_h, [])</pre>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_status() -&gt; TestStatus | {error, Reason} | no_tests_running</name>
+ <fsummary>Returns status of ongoing test.</fsummary>
+ <type>
+ <v>TestStatus = [StatusElem]</v>
+ <v>StatusElem = {current, TestCaseInfo} | {successful, Successful} | {failed, Failed} | {skipped, Skipped} | {total, Total}</v>
+ <v>TestCaseInfo = {Suite, TestCase} | [{Suite, TestCase}]</v>
+ <v>Suite = atom()</v>
+ <v>TestCase = atom()</v>
+ <v>Successful = integer()</v>
+ <v>Failed = integer()</v>
+ <v>Skipped = {UserSkipped, AutoSkipped}</v>
+ <v>UserSkipped = integer()</v>
+ <v>AutoSkipped = integer()</v>
+ <v>Total = integer()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="get_status-0"/>
+ <p>Returns status of ongoing test. The returned list contains
+ information about which test case is executing (a list of cases
+ when a parallel test case group is executing), as well as
+ counters for successful, failed, skipped, and total test cases
+ so far.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_target_name(Handle) -&gt; {ok, TargetName} | {error, Reason}</name>
+ <fsummary>Returns the name of the target that the specified connection
+ belongs to.</fsummary>
+ <type>
+ <v>Handle = handle()</v>
+ <v>TargetName = target_name()</v>
+ </type>
+ <desc><marker id="get_target_name-1"/>
+ <p>Returns the name of the target that the specified connection
+ belongs to.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_testspec_terms() -&gt; TestSpecTerms | undefined</name>
+ <fsummary>Gets a list of all test specification terms used to
+ configure and run this test.</fsummary>
+ <type>
+ <v>TestSpecTerms = [{Tag, Value}]</v>
+ <v>Value = [term()]</v>
+ </type>
+ <desc><marker id="get_testspec_terms-0"/>
+ <p>Gets a list of all test specification terms used to configure
+ and run this test.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_testspec_terms(Tags) -&gt; TestSpecTerms | undefined</name>
+ <fsummary>Reads one or more terms from the test specification used to
+ configure and run this test.</fsummary>
+ <type>
+ <v>Tags = [Tag] | Tag</v>
+ <v>Tag = atom()</v>
+ <v>TestSpecTerms = [{Tag, Value}] | {Tag, Value}</v>
+ <v>Value = [{Node, term()}] | [term()]</v>
+ <v>Node = atom()</v>
+ </type>
+ <desc><marker id="get_testspec_terms-1"/>
+ <p>Reads one or more terms from the test specification used to
+ configure and run this test. <c>Tag</c> is any valid test
+ specification tag, for example, <c>label</c>, <c>config</c>, or
+ <c>logdir</c>. User-specific terms are also available to read if
+ option <c>allow_user_terms</c> is set.</p>
+ <p>All value tuples returned, except user terms, have the node
+ name as first element.</p>
+ <p>To read test terms, use <c>Tag = tests</c> (rather than
+ <c>suites</c>, <c>groups</c>, or <c>cases</c>). <c>Value</c> is
+ then the list of <em>all</em> tests on the form
+ <c>[{Node,Dir,[{TestSpec,GroupsAndCases1},...]},...]</c>, where
+ <c>GroupsAndCases = [{Group,[Case]}] | [Case]</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_timetrap_info() -&gt; {Time, Scale}</name>
+ <fsummary>Reads information about the timetrap set for the current
+ test case.</fsummary>
+ <type>
+ <v>Time = integer() | infinity</v>
+ <v>Scale = true | false</v>
+ </type>
+ <desc><marker id="get_timetrap_info-0"/>
+ <p>Reads information about the timetrap set for the current test
+ case. <c>Scale</c> indicates if <c>Common Test</c> will attempt
+ to compensate timetraps automatically for runtime delays
+ introduced by, for example, tools like cover.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>install(Opts) -&gt; ok | {error, Reason}</name>
+ <fsummary>Installs configuration files and event handlers.</fsummary>
+ <type>
+ <v>Opts = [Opt]</v>
+ <v>Opt = {config, ConfigFiles} | {event_handler, Modules} | {decrypt, KeyOrFile}</v>
+ <v>ConfigFiles = [ConfigFile]</v>
+ <v>ConfigFile = string()</v>
+ <v>Modules = [atom()]</v>
+ <v>KeyOrFile = {key, Key} | {file, KeyFile}</v>
+ <v>Key = string()</v>
+ <v>KeyFile = string()</v>
+ </type>
+ <desc><marker id="install-1"/>
+ <p>Installs configuration files and event handlers.</p>
+
+ <p>Run this function once before the first test.</p>
+
+ <p><em>Example:</em></p>
+
+ <pre>
+ install([{config,["config_node.ctc","config_user.ctc"]}])</pre>
+
+ <p>This function is automatically run by program <c>ct_run</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>listenv(Telnet) -&gt; [Env]</name>
+ <fsummary>Performs command listenv on the specified Telnet connection
+ and returns the result as a list of key-value pairs.</fsummary>
+ <type>
+ <v>Telnet = term()</v>
+ <v>Env = {Key, Value}</v>
+ <v>Key = string()</v>
+ <v>Value = string()</v>
+ </type>
+ <desc><marker id="listenv-1"/>
+ <p>Performs command <c>listenv</c> on the specified Telnet connection
+ and returns the result as a list of key-value pairs.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>log(Format) -&gt; ok</name>
+ <fsummary>Equivalent to log(default, 50, Format, [], []).</fsummary>
+ <desc><marker id="log-1"/>
+ <p>Equivalent to
+ <seealso marker="#log-5"><c>ct:log(default, 50, Format, [], [])</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>log(X1, X2) -&gt; ok</name>
+ <fsummary>Equivalent to log(Category, Importance, Format,
+ FormatArgs, []).</fsummary>
+ <type>
+ <v>X1 = Category | Importance | Format</v>
+ <v>X2 = Format | FormatArgs</v>
+ </type>
+ <desc><marker id="log-2"/>
+ <p>Equivalent to <seealso marker="#log-5"><c>ct:log(Category,
+ Importance, Format, FormatArgs, [])</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>log(X1, X2, X3) -&gt; ok</name>
+ <fsummary>Equivalent to log(Category, Importance, Format,
+ FormatArgs, Opts).</fsummary>
+ <type>
+ <v>X1 = Category | Importance</v>
+ <v>X2 = Importance | Format</v>
+ <v>X3 = Format | FormatArgs | Opts</v>
+ </type>
+ <desc><marker id="log-3"/>
+ <p>Equivalent to <seealso marker="#log-5"><c>ct:log(Category,
+ Importance, Format, FormatArgs, Opts)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>log(X1, X2, X3, X4) -&gt; ok</name>
+ <fsummary>Equivalent to log(Category, Importance, Format,
+ FormatArgs, Opts).</fsummary>
+ <type>
+ <v>X1 = Category | Importance</v>
+ <v>X2 = Importance | Format</v>
+ <v>X3 = Format | FormatArgs</v>
+ <v>X4 = FormatArgs | Opts</v>
+ </type>
+ <desc><marker id="log-4"/>
+ <p>Equivalent to <seealso marker="#log-5"><c>ct:log(Category,
+ Importance, Format, FormatArgs, Opts)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>log(Category, Importance, Format, FormatArgs, Opts) -&gt; ok</name>
+ <fsummary>Prints from a test case to the log file.</fsummary>
+ <type>
+ <v>Category = atom()</v>
+ <v>Importance = integer()</v>
+ <v>Format = string()</v>
+ <v>FormatArgs = list()</v>
+ <v>Opts = [Opt]</v>
+ <v>Opt = no_css | esc_chars</v>
+ </type>
+ <desc><marker id="log-5"/>
+ <p>Prints from a test case to the log file.</p>
+
+ <p>This function is meant for printing a string directly from a
+ test case to the test case log file.</p>
+
+ <p>Default <c>Category</c> is <c>default</c>,
+ default <c>Importance</c> is <c>?STD_IMPORTANCE</c>,
+ and default value for <c>FormatArgs</c> is <c>[]</c>.</p>
+
+ <p>For details on <c>Category</c>, <c>Importance</c> and the <c>no_css</c>
+ option, see section <seealso marker="write_test_chapter#logging">
+ Logging - Categories and Verbosity Levels</seealso> in the User's Guide.</p>
+
+ <p>Common Test will not escape special HTML characters (&lt;, &gt; and &amp;)
+ in the text printed with this function, unless the <c>esc_chars</c>
+ option is used.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>make_priv_dir() -&gt; ok | {error, Reason}</name>
+ <fsummary>If the test has been started with option create_priv_dir
+ set to manual_per_tc, in order for the test case to use the private
+ directory, it must first create it by calling this function.</fsummary>
+ <type>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="make_priv_dir-0"/>
+ <p>If the test is started with option <c>create_priv_dir</c>
+ set to <c>manual_per_tc</c>, in order for the test case to use
+ the private directory, it must first create it by calling this
+ function.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>notify(Name, Data) -&gt; ok</name>
+ <fsummary>Sends an asynchronous notification of type Name with Data
+ to the <c>Common Test</c> event manager.</fsummary>
+ <type>
+ <v>Name = atom()</v>
+ <v>Data = term()</v>
+ </type>
+ <desc><marker id="notify-2"/>
+ <p>Sends an asynchronous notification of type <c>Name</c> with
+ <c>Data</c>to the Common Test event manager. This can later be
+ caught by any installed event manager.</p>
+
+ <p>See also
+ <seealso marker="stdlib:gen_event"><c>stdlib:gen_event(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>pal(Format) -&gt; ok</name>
+ <fsummary>Equivalent to pal(default, 50, Format, []).</fsummary>
+ <desc><marker id="pal-1"/>
+ <p>Equivalent to
+ <seealso marker="#pal-4"><c>ct:pal(default, 50, Format,
+ [])</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>pal(X1, X2) -&gt; ok</name>
+ <fsummary>Equivalent to pal(Category, Importance, Format,
+ FormatArgs).</fsummary>
+ <type>
+ <v>X1 = Category | Importance | Format</v>
+ <v>X2 = Format | FormatArgs</v>
+ </type>
+ <desc><marker id="pal-2"/>
+ <p>Equivalent to <seealso marker="#pal-4"><c>ct:pal(Category,
+ Importance, Format, FormatArgs)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>pal(X1, X2, X3) -&gt; ok</name>
+ <fsummary>Equivalent to pal(Category, Importance, Format,
+ FormatArgs).</fsummary>
+ <type>
+ <v>X1 = Category | Importance</v>
+ <v>X2 = Importance | Format</v>
+ <v>X3 = Format | FormatArgs</v>
+ </type>
+ <desc><marker id="pal-3"/>
+ <p>Equivalent to <seealso marker="#pal-4"><c>ct:pal(Category,
+ Importance, Format, FormatArgs)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>pal(Category, Importance, Format, FormatArgs) -&gt; ok</name>
+ <fsummary>Prints and logs from a test case.</fsummary>
+ <type>
+ <v>Category = atom()</v>
+ <v>Importance = integer()</v>
+ <v>Format = string()</v>
+ <v>FormatArgs = list()</v>
+ </type>
+ <desc><marker id="pal-4"/>
+ <p>Prints and logs from a test case.</p>
+
+ <p>This function is meant for printing a string from a test case,
+ both to the test case log file and to the console.</p>
+
+ <p>Default <c>Category</c> is <c>default</c>,
+ default <c>Importance</c> is <c>?STD_IMPORTANCE</c>,
+ and default value for <c>FormatArgs</c> is <c>[]</c>.</p>
+
+ <p>For details on <c>Category</c> and <c>Importance</c>, see section
+ <seealso marker="write_test_chapter#logging">Logging - Categories
+ and Verbosity Levels</seealso> in the User's Guide.</p>
+
+ <p>Note that special characters in the text (&lt;, &gt; and &amp;) will
+ be escaped by Common Test before the text is printed to the log
+ file.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>parse_table(Data) -&gt; {Heading, Table}</name>
+ <fsummary>Parses the printout from an SQL table and returns a list of
+ tuples.</fsummary>
+ <type>
+ <v>Data = [string()]</v>
+ <v>Heading = tuple()</v>
+ <v>Table = [tuple()]</v>
+ </type>
+ <desc><marker id="parse_table-1"/>
+ <p>Parses the printout from an SQL table and returns a list of
+ tuples.</p>
+
+ <p>The printout to parse is typically the result of a <c>select</c>
+ command in SQL. The returned <c>Table</c> is a list of tuples,
+ where each tuple is a row in the table.</p>
+
+ <p><c>Heading</c> is a tuple of strings representing the headings
+ of each column in the table.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>print(Format) -&gt; ok</name>
+ <fsummary>Equivalent to print(default, 50, Format, []).</fsummary>
+ <desc><marker id="print-1"/>
+ <p>Equivalent to <seealso marker="#print-4"><c>ct:print(default,
+ 50, Format, [])</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>print(X1, X2) -&gt; ok</name>
+ <fsummary>Equivalent to print(Category, Importance, Format,
+ FormatArgs).</fsummary>
+ <type>
+ <v>X1 = Category | Importance | Format</v>
+ <v>X2 = Format | FormatArgs</v>
+ </type>
+ <desc><marker id="print-2"/>
+ <p>Equivalent to <seealso marker="#print-4"><c>ct:print(Category,
+ Importance, Format, FormatArgs)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>print(X1, X2, X3) -&gt; ok</name>
+ <fsummary>Equivalent to print(Category, Importance, Format,
+ FormatArgs).</fsummary>
+ <type>
+ <v>X1 = Category | Importance</v>
+ <v>X2 = Importance | Format</v>
+ <v>X3 = Format | FormatArgs</v>
+ </type>
+ <desc><marker id="print-3"/>
+ <p>Equivalent to <seealso marker="#print-4"><c>ct:print(Category,
+ Importance, Format, FormatArgs)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>print(Category, Importance, Format, FormatArgs) -&gt; ok</name>
+ <fsummary>Prints from a test case to the console.</fsummary>
+ <type>
+ <v>Category = atom()</v>
+ <v>Importance = integer()</v>
+ <v>Format = string()</v>
+ <v>FormatArgs = list()</v>
+ </type>
+ <desc><marker id="print-4"/>
+ <p>Prints from a test case to the console.</p>
+
+ <p>This function is meant for printing a string from a test case to
+ the console.</p>
+
+ <p>Default <c>Category</c> is <c>default</c>,
+ default <c>Importance</c> is <c>?STD_IMPORTANCE</c>,
+ and default value for <c>FormatArgs</c> is <c>[]</c>.</p>
+
+ <p>For details on <c>Category</c> and <c>Importance</c>, see section
+ <seealso marker="write_test_chapter#logging">Logging - Categories
+ and Verbosity Levels</seealso> in the User's Guide.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>reload_config(Required) -&gt; ValueOrElement</name>
+ <fsummary>Reloads configuration file containing specified configuration
+ key.</fsummary>
+ <type>
+ <v>Required = KeyOrName | {KeyOrName, SubKey} | {KeyOrName, SubKey, SubKey}</v>
+ <v>KeyOrName = atom()</v>
+ <v>SubKey = atom()</v>
+ <v>ValueOrElement = term()</v>
+ </type>
+ <desc><marker id="reload_config-1"/>
+ <p>Reloads configuration file containing specified configuration key.</p>
+
+ <p>This function updates the configuration data from which the
+ specified configuration variable was read, and returns the (possibly)
+ new value of this variable.</p>
+
+ <p>If some variables were present in the configuration, but are
+ not loaded using this function, they are removed from the
+ configuration table together with their aliases.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>remove_config(Callback, Config) -&gt; ok</name>
+ <fsummary>Removes configuration variables (together with
+ their aliases) that were loaded with specified callback module and
+ configuration string.</fsummary>
+ <type>
+ <v>Callback = atom()</v>
+ <v>Config = string()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="remove_config-2"/>
+ <p>Removes configuration variables (together wih their aliases)
+ that were loaded with specified callback module and configuration
+ string.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>require(Required) -&gt; ok | {error, Reason}</name>
+ <fsummary>Checks if the required configuration is available.</fsummary>
+ <type>
+ <v>Required = Key | {Key, SubKeys} | {Key, SubKey, SubKeys}</v>
+ <v>Key = atom()</v>
+ <v>SubKeys = SubKey | [SubKey]</v>
+ <v>SubKey = atom()</v>
+ </type>
+ <desc><marker id="require-1"/>
+ <p>Checks if the required configuration is available. Arbitrarily
+ deep tuples can be specified as <c>Required</c>. Only the last
+ element of the tuple can be a list of <c>SubKey</c>s.</p>
+
+ <p><em>Example 1.</em> Require the variable <c>myvar</c>:</p>
+
+ <pre>
+ ok = ct:require(myvar).</pre>
+
+ <p>In this case the configuration file must at least contain:</p>
+
+ <pre>
+ {myvar,Value}.</pre>
+
+ <p><em>Example 2.</em> Require key <c>myvar</c> with subkeys
+ <c>sub1</c> and <c>sub2</c>:</p>
+
+ <pre>
+ ok = ct:require({myvar,[sub1,sub2]}).</pre>
+
+ <p>In this case the configuration file must at least contain:</p>
+
+ <pre>
+ {myvar,[{sub1,Value},{sub2,Value}]}.</pre>
+
+ <p><em>Example 3.</em> Require key <c>myvar</c> with subkey
+ <c>sub1</c> with <c>subsub1</c>:</p>
+
+ <pre>
+ ok = ct:require({myvar,sub1,sub2}).</pre>
+
+ <p>In this case the configuration file must at least contain:</p>
+
+ <pre>
+ {myvar,[{sub1,[{sub2,Value}]}]}.</pre>
+
+ <p>See also
+ <seealso marker="#get_config-1"><c>ct:get_config/1</c></seealso>,
+ <seealso marker="#get_config-2"><c>ct:get_config/2</c></seealso>,
+ <seealso marker="#get_config-3"><c>ct:get_config/3</c></seealso>,
+ <seealso marker="#require-2"><c>ct:require/2</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>require(Name, Required) -&gt; ok | {error, Reason}</name>
+ <fsummary>Checks if the required configuration is available and gives
+ it a name.</fsummary>
+ <type>
+ <v>Name = atom()</v>
+ <v>Required = Key | {Key, SubKey} | {Key, SubKey, SubKey}</v>
+ <v>SubKey = Key</v>
+ <v>Key = atom()</v>
+ </type>
+ <desc><marker id="require-2"/>
+ <p>Checks if the required configuration is available and gives it a
+ name. The semantics for <c>Required</c> is the same as in
+ <seealso marker="#require-1"><c>ct:require/1</c></seealso> except
+ that a list of <c>SubKey</c>s cannot be specified.</p>
+
+ <p>If the requested data is available, the subentry is associated
+ with <c>Name</c> so that the value of the element can be read with
+ <seealso marker="#get_config-1"><c>ct:get_config/1,2</c></seealso>
+ provided <c>Name</c> is used instead of the whole <c>Required</c>
+ term.</p>
+
+ <p><em>Example:</em></p>
+
+ <p>Require one node with a Telnet connection and an FTP connection.
+ Name the node <c>a</c>:</p>
+
+ <pre>
+ ok = ct:require(a,{machine,node}).</pre>
+
+ <p>All references to this node can then use the node name. For
+ example, a file over FTP is fetched like follows:</p>
+
+ <pre>
+ ok = ct:ftp_get(a,RemoteFile,LocalFile).</pre>
+
+ <p>For this to work, the configuration file must at least contain:</p>
+
+ <pre>
+ {machine,[{node,[{telnet,IpAddr},{ftp,IpAddr}]}]}.</pre>
+
+ <note><p>The behavior of this function changed radically in
+ <c>Common Test</c> 1.6.2. To keep some backwards compatability,
+ it is still possible to do:<br/>
+ <c>ct:require(a,{node,[telnet,ftp]}).</c><br/>
+ This associates the name <c>a</c> with the top-level <c>node</c>
+ entry. For this to work, the configuration file must at least
+ contain:<br/>
+ <c>{node,[{telnet,IpAddr},{ftp,IpAddr}]}.</c></p>
+ </note>
+
+ <p>See also
+ <seealso marker="#get_config-1"><c>ct:get_config/1</c></seealso>,
+ <seealso marker="#get_config-2"><c>ct:get_config/2</c></seealso>,
+ <seealso marker="#get_config-3"><c>ct:get_config/3</c></seealso>,
+ <seealso marker="#require-1"><c>ct:require/1</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>run(TestDirs) -&gt; Result</name>
+ <fsummary>Runs all test cases in all suites in the specified
+ directories.</fsummary>
+ <type>
+ <v>TestDirs = TestDir | [TestDir]</v>
+ </type>
+ <desc><marker id="run-1"/>
+ <p>Runs all test cases in all suites in the specified directories.</p>
+
+ <p>See also <seealso marker="#run-3"><c>ct:run/3</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>run(TestDir, Suite) -&gt; Result</name>
+ <fsummary>Runs all test cases in the specified suite.</fsummary>
+ <desc><marker id="run-2"/>
+ <p>Runs all test cases in the specified suite.</p>
+
+ <p>See also <seealso marker="#run-3"><c>ct:run/3</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>run(TestDir, Suite, Cases) -&gt; Result</name>
+ <fsummary>Runs the specified test cases.</fsummary>
+ <type>
+ <v>TestDir = string()</v>
+ <v>Suite = atom()</v>
+ <v>Cases = atom() | [atom()]</v>
+ <v>Result = [TestResult] | {error, Reason}</v>
+ </type>
+ <desc><marker id="run-3"/>
+ <p>Runs the specified test cases.</p>
+
+ <p>Requires that
+ <seealso marker="#install-1"><c>ct:install/1</c></seealso> has been
+ run first.</p>
+
+ <p>Suites (<c>*_SUITE.erl</c>) files must be stored in <c>TestDir</c>
+ or <c>TestDir/test</c>. All suites are compiled when the test is
+ run.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>run_test(Opts) -&gt; Result</name>
+ <fsummary>Runs tests as specified by the combination of options in
+ Opts.</fsummary>
+ <type>
+ <v>Opts = [OptTuples]</v>
+ <v>OptTuples = {dir, TestDirs} | {suite, Suites} | {group, Groups} | {testcase, Cases} | {spec, TestSpecs} | {join_specs, Bool} | {label, Label} | {config, CfgFiles} | {userconfig, UserConfig} | {allow_user_terms, Bool} | {logdir, LogDir} | {silent_connections, Conns} | {stylesheet, CSSFile} | {cover, CoverSpecFile} | {cover_stop, Bool} | {step, StepOpts} | {event_handler, EventHandlers} | {include, InclDirs} | {auto_compile, Bool} | {abort_if_missing_suites, Bool} | {create_priv_dir, CreatePrivDir} | {multiply_timetraps, M} | {scale_timetraps, Bool} | {repeat, N} | {duration, DurTime} | {until, StopTime} | {force_stop, ForceStop} | {decrypt, DecryptKeyOrFile} | {refresh_logs, LogDir} | {logopts, LogOpts} | {verbosity, VLevels} | {basic_html, Bool} | {ct_hooks, CTHs} | {enable_builtin_hooks, Bool} | {release_shell, Bool}</v>
+ <v>TestDirs = [string()] | string()</v>
+ <v>Suites = [string()] | [atom()] | string() | atom()</v>
+ <v>Cases = [atom()] | atom()</v>
+ <v>Groups = GroupNameOrPath | [GroupNameOrPath]</v>
+ <v>GroupNameOrPath = [atom()] | atom() | all</v>
+ <v>TestSpecs = [string()] | string()</v>
+ <v>Label = string() | atom()</v>
+ <v>CfgFiles = [string()] | string()</v>
+ <v>UserConfig = [{CallbackMod, CfgStrings}] | {CallbackMod, CfgStrings}</v>
+ <v>CallbackMod = atom()</v>
+ <v>CfgStrings = [string()] | string()</v>
+ <v>LogDir = string()</v>
+ <v>Conns = all | [atom()]</v>
+ <v>CSSFile = string()</v>
+ <v>CoverSpecFile = string()</v>
+ <v>StepOpts = [StepOpt] | []</v>
+ <v>StepOpt = config | keep_inactive</v>
+ <v>EventHandlers = EH | [EH]</v>
+ <v>EH = atom() | {atom(), InitArgs} | {[atom()], InitArgs}</v>
+ <v>InitArgs = [term()]</v>
+ <v>InclDirs = [string()] | string()</v>
+ <v>CreatePrivDir = auto_per_run | auto_per_tc | manual_per_tc</v>
+ <v>M = integer()</v>
+ <v>N = integer()</v>
+ <v>DurTime = string(HHMMSS)</v>
+ <v>StopTime = string(YYMoMoDDHHMMSS) | string(HHMMSS)</v>
+ <v>ForceStop = skip_rest | Bool</v>
+ <v>DecryptKeyOrFile = {key, DecryptKey} | {file, DecryptFile}</v>
+ <v>DecryptKey = string()</v>
+ <v>DecryptFile = string()</v>
+ <v>LogOpts = [LogOpt]</v>
+ <v>LogOpt = no_nl | no_src</v>
+ <v>VLevels = VLevel | [{Category, VLevel}]</v>
+ <v>VLevel = integer()</v>
+ <v>Category = atom()</v>
+ <v>CTHs = [CTHModule | {CTHModule, CTHInitArgs}]</v>
+ <v>CTHModule = atom()</v>
+ <v>CTHInitArgs = term()</v>
+ <v>Result = {Ok, Failed, {UserSkipped, AutoSkipped}} | TestRunnerPid | {error, Reason}</v>
+ <v>Ok = integer()</v>
+ <v>Failed = integer()</v>
+ <v>UserSkipped = integer()</v>
+ <v>AutoSkipped = integer()</v>
+ <v>TestRunnerPid = pid()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="run_test-1"/>
+ <p>Runs tests as specified by the combination of options in
+ <c>Opts</c>. The options are the same as those used with program
+ <c>ct_run</c>, see <seealso marker="ct_run#ct_run">Run Tests from
+ Command Line</seealso> in the <c>ct_run</c> manual page.</p>
+ <p>Here a <c>TestDir</c> can be used to point out the path to a
+ <c>Suite</c>. Option <c>testcase</c> corresponds to option
+ <c>-case</c> in program <c>ct_run</c>. Configuration files
+ specified in <c>Opts</c> are installed automatically at startup.</p>
+
+ <p><c>TestRunnerPid</c> is returned if <c>release_shell == true</c>.
+ For details, see
+ <seealso marker="#break-1"><c>ct:break/1</c></seealso>.</p>
+
+ <p><c>Reason</c> indicates the type of error encountered.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>run_testspec(TestSpec) -&gt; Result</name>
+ <fsummary>Runs a test specified by TestSpec.</fsummary>
+ <type>
+ <v>TestSpec = [term()]</v>
+ <v>Result = {Ok, Failed, {UserSkipped, AutoSkipped}} | {error, Reason}</v>
+ <v>Ok = integer()</v>
+ <v>Failed = integer()</v>
+ <v>UserSkipped = integer()</v>
+ <v>AutoSkipped = integer()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="run_testspec-1"/>
+ <p>Runs a test specified by <c>TestSpec</c>. The same terms are used
+ as in test specification files.</p>
+
+ <p><c>Reason</c> indicates the type of error encountered.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>sleep(Time) -&gt; ok</name>
+ <fsummary>This function, similar to timer:sleep/1, suspends the
+ test case for a specified time.</fsummary>
+ <type>
+ <v>Time = {hours, Hours} | {minutes, Mins} | {seconds, Secs} | Millisecs | infinity</v>
+ <v>Hours = integer()</v>
+ <v>Mins = integer()</v>
+ <v>Secs = integer()</v>
+ <v>Millisecs = integer() | float()</v>
+ </type>
+ <desc><marker id="sleep-1"/>
+ <p>This function, similar to <c>timer:sleep/1</c> in <c>STDLIB</c>,
+ suspends the test case for a specified time.
+ However, this function also multiplies <c>Time</c> with the
+ <c>multiply_timetraps</c> value (if set) and under certain
+ circumstances also scales up the time automatically if
+ <c>scale_timetraps</c> is set to <c>true</c> (default is
+ <c>false</c>).</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>start_interactive() -&gt; ok</name>
+ <fsummary>Starts <c>Common Test</c> in interactive mode.</fsummary>
+ <desc><marker id="start_interactive-0"/>
+ <p>Starts <c>Common Test</c> in interactive mode.</p>
+
+ <p>From this mode, all test case support functions can be executed
+ directly from the Erlang shell. The interactive mode can also be
+ started from the OS command line with <c>ct_run -shell
+ [-config File...]</c>.</p>
+
+ <p>If any functions (for example, Telnet or FTP) using
+ "required configuration data" are to be called from the Erlang shell,
+ configuration data must first be required with
+ <seealso marker="#require-2"><c>ct:require/2</c></seealso>.</p>
+
+ <p><em>Example:</em></p>
+
+ <pre>
+ &gt; ct:require(unix_telnet, unix).
+ ok
+ &gt; ct_telnet:open(unix_telnet).
+ {ok,&lt;0.105.0&gt;}
+ &gt; ct_telnet:cmd(unix_telnet, "ls .").
+ {ok,["ls","file1 ...",...]}</pre>
+ </desc>
+ </func>
+
+ <func>
+ <name>step(TestDir, Suite, Case) -&gt; Result</name>
+ <fsummary>Steps through a test case with the debugger.</fsummary>
+ <type>
+ <v>Case = atom()</v>
+ </type>
+ <desc><marker id="step-3"/>
+ <p>Steps through a test case with the debugger.</p>
+
+ <p>See also <seealso marker="#run-3"><c>ct:run/3</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>step(TestDir, Suite, Case, Opts) -&gt; Result</name>
+ <fsummary>Steps through a test case with the debugger.</fsummary>
+ <type>
+ <v>Case = atom()</v>
+ <v>Opts = [Opt] | []</v>
+ <v>Opt = config | keep_inactive</v>
+ </type>
+ <desc><marker id="step-4"/>
+ <p>Steps through a test case with the debugger. If option
+ <c>config</c> has been specifed, breakpoints are also set on
+ the configuration functions in <c>Suite</c>.</p>
+
+ <p>See also <seealso marker="#run-3"><c>ct:run/3</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>stop_interactive() -&gt; ok</name>
+ <fsummary>Exits the interactive mode.</fsummary>
+ <desc><marker id="stop_interactive-0"/>
+ <p>Exits the interactive mode.</p>
+
+ <p>See also
+ <seealso marker="#start_interactive-0"><c>ct:start_interactive/0</c></seealso>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name>sync_notify(Name, Data) -&gt; ok</name>
+ <fsummary>Sends a synchronous notification of type Name with Data to
+ the <c>Common Test</c> event manager.</fsummary>
+ <type>
+ <v>Name = atom()</v>
+ <v>Data = term()</v>
+ </type>
+ <desc><marker id="sync_notify-2"/>
+ <p>Sends a synchronous notification of type <c>Name</c> with
+ <c>Data</c> to the <c>Common Test</c> event manager. This can later be
+ caught by any installed event manager.</p>
+
+ <p>See also
+ <seealso marker="stdlib:gen_event"><c>stdlib:gen_event(3)</c></seealso>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name>testcases(TestDir, Suite) -&gt; Testcases | {error, Reason}</name>
+ <fsummary>Returns all test cases in the specified suite.</fsummary>
+ <type>
+ <v>TestDir = string()</v>
+ <v>Suite = atom()</v>
+ <v>Testcases = list()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="testcases-2"/>
+ <p>Returns all test cases in the specified suite.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>timetrap(Time) -&gt; ok</name>
+ <fsummary>Sets a new timetrap for the running test case.</fsummary>
+ <type>
+ <v>Time = {hours, Hours} | {minutes, Mins} | {seconds, Secs} | Millisecs | infinity | Func</v>
+ <v>Hours = integer()</v>
+ <v>Mins = integer()</v>
+ <v>Secs = integer()</v>
+ <v>Millisecs = integer() | float()</v>
+ <v>Func = {M, F, A} | function()</v>
+ <v>M = atom()</v>
+ <v>F = atom()</v>
+ <v>A = list()</v>
+ </type>
+ <desc><marker id="timetrap-1"/>
+ <p>Sets a new timetrap for the running test case.</p>
+
+ <p>If the argument is <c>Func</c>, the timetrap is triggered when
+ this function returns. <c>Func</c> can also return a new
+ <c>Time</c> value, which in that case is the value for the new
+ timetrap.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>userdata(TestDir, Suite) -&gt; SuiteUserData | {error, Reason}</name>
+ <fsummary>Returns any data specified with tag userdata in the list of
+ tuples returned from Suite:suite/0.</fsummary>
+ <type>
+ <v>TestDir = string()</v>
+ <v>Suite = atom()</v>
+ <v>SuiteUserData = [term()]</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="userdata-2"/>
+ <p>Returns any data specified with tag <c>userdata</c> in the list
+ of tuples returned from
+ <seealso marker="common_test#Module:suite-0"><c>suite/0</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>userdata(TestDir, Suite, Case::GroupOrCase) -&gt; TCUserData | {error, Reason}</name>
+ <fsummary>Returns any data specified with tag userdata in the list of
+ tuples returned from Suite:group(GroupName) or Suite:Case().</fsummary>
+ <type>
+ <v>TestDir = string()</v>
+ <v>Suite = atom()</v>
+ <v>GroupOrCase = {group, GroupName} | atom()</v>
+ <v>GroupName = atom()</v>
+ <v>TCUserData = [term()]</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="userdata-3"/>
+ <p>Returns any data specified with tag <c>userdata</c> in the list
+ of tuples returned from <c>Suite:group(GroupName)</c> or
+ <c>Suite:Case()</c>.</p>
+ </desc>
+ </func>
+ </funcs>
+
+</erlref>
+
+
diff --git a/lib/common_test/doc/src/ct_cover.xml b/lib/common_test/doc/src/ct_cover.xml
new file mode 100644
index 0000000000..be09c08a68
--- /dev/null
+++ b/lib/common_test/doc/src/ct_cover.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2010</year><year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>ct_cover</title>
+ <prepared></prepared>
+ <responsible></responsible>
+ <docno></docno>
+ <approved></approved>
+ <checked></checked>
+ <date></date>
+ <rev>A</rev>
+ <file>ct_cover.xml</file>
+ </header>
+ <module>ct_cover</module>
+ <modulesummary>Common Test framework code coverage support module.
+ </modulesummary>
+
+<description>
+
+ <p><c>Common Test</c> framework code coverage support module.</p>
+
+ <p>This module exports help functions for performing code coverage
+ analysis.</p>
+
+</description>
+
+ <funcs>
+ <func>
+ <name>add_nodes(Nodes) -&gt; {ok, StartedNodes} | {error, Reason}</name>
+ <fsummary>Adds nodes to current cover test (only works if cover support
+ is active).</fsummary>
+ <type>
+ <v>Nodes = [atom()]</v>
+ <v>StartedNodes = [atom()]</v>
+ <v>Reason = cover_not_running | not_main_node</v>
+ </type>
+ <desc><marker id="add_nodes-1"/>
+ <p>Adds nodes to current cover test. Notice that this only works if
+ cover support is active.</p>
+
+ <p>To have effect, this function is to be called from
+ <c>init_per_suite/1</c> (see
+ <seealso marker="common_test"><c>common_test</c></seealso>)
+ before any tests are performed.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>cross_cover_analyse(Level, Tests) -&gt; ok</name>
+ <fsummary>Accumulates cover results over multiple tests.</fsummary>
+ <type>
+ <v>Level = overview | details</v>
+ <v>Tests = [{Tag, Dir}]</v>
+ <v>Tag = atom()</v>
+ <v>Dir = string()</v>
+ </type>
+ <desc><marker id="cross_cover_analyse-2"/>
+ <p>Accumulates cover results over multiple tests. See section
+ <seealso marker="cover_chapter#cross_cover">Cross Cover
+ Analysis</seealso> in the Users's Guide.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>remove_nodes(Nodes) -&gt; ok | {error, Reason}</name>
+ <fsummary>Removes nodes from the current cover test.</fsummary>
+ <type>
+ <v>Nodes = [atom()]</v>
+ <v>Reason = cover_not_running | not_main_node</v>
+ </type>
+ <desc><marker id="remove_nodes-1"/>
+ <p>Removes nodes from the current cover test.</p>
+
+ <p>Call this function to stop cover test on nodes previously
+ added with
+ <seealso marker="#add_nodes-1"><c>ct_cover:add_nodes/1</c></seealso>.
+ Results on the remote node are transferred to the <c>Common Test</c>
+ node.</p>
+ </desc>
+ </func>
+ </funcs>
+
+</erlref>
+
+
diff --git a/lib/common_test/doc/src/ct_ftp.xml b/lib/common_test/doc/src/ct_ftp.xml
new file mode 100644
index 0000000000..0598dcbe3e
--- /dev/null
+++ b/lib/common_test/doc/src/ct_ftp.xml
@@ -0,0 +1,277 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2010</year><year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>ct_ftp</title>
+ <prepared></prepared>
+ <responsible></responsible>
+ <docno></docno>
+ <approved></approved>
+ <checked></checked>
+ <date></date>
+ <rev>A</rev>
+ <file>ct_ftp.xml</file>
+ </header>
+ <module>ct_ftp</module>
+ <modulesummary>FTP client module (based on the FTP support of the Inets
+ application).</modulesummary>
+
+ <description>
+
+ <p>FTP client module (based on the FTP support of the <c>Inets</c>
+ application).</p>
+
+ </description>
+
+ <section>
+ <title>Data Types</title>
+ <marker id="types"/>
+ <taglist>
+ <tag><c>connection() = handle() | target_name()</c></tag>
+ <item><marker id="type-connection"/>
+ <p>For <c>target_name</c>, see module
+ <seealso marker="ct"><c>ct</c></seealso>.</p></item>
+
+ <tag><c>handle() = handle()</c></tag>
+ <item><marker id="type-handle"/>
+ <p>Handle for a specific FTP connection, see module
+ <seealso marker="ct"><c>ct</c></seealso>.</p></item>
+ </taglist>
+ </section>
+
+ <funcs>
+ <func>
+ <name>cd(Connection, Dir) -&gt; ok | {error, Reason}</name>
+ <fsummary>Changes directory on remote host.</fsummary>
+ <type>
+ <v>Connection = connection()</v>
+ <v>Dir = string()</v>
+ </type>
+ <desc><marker id="cd-2"/>
+ <p>Changes directory on remote host.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>close(Connection) -&gt; ok | {error, Reason}</name>
+ <fsummary>Closes the FTP connection.</fsummary>
+ <type>
+ <v>Connection = connection()</v>
+ </type>
+ <desc><marker id="close-1"/>
+ <p>Closes the FTP connection.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>delete(Connection, File) -&gt; ok | {error, Reason}</name>
+ <fsummary>Deletes a file on remote host.</fsummary>
+ <type>
+ <v>Connection = connection()</v>
+ <v>File = string()</v>
+ </type>
+ <desc><marker id="delete-2"/>
+ <p>Deletes a file on remote host.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get(KeyOrName, RemoteFile, LocalFile) -&gt; ok | {error, Reason}</name>
+ <fsummary>Opens an FTP connection and fetches a file from the remote
+ host.</fsummary>
+ <type>
+ <v>KeyOrName = Key | Name</v>
+ <v>Key = atom()</v>
+ <v>Name = target_name()</v>
+ <v>RemoteFile = string()</v>
+ <v>LocalFile = string()</v>
+ </type>
+ <desc><marker id="get-3"/>
+ <p>Opens an FTP connection and fetches a file from the remote
+ host.</p>
+
+ <p><c>RemoteFile</c> and <c>LocalFile</c> must be absolute paths.</p>
+
+ <p>The configuration file must be as for
+ <seealso marker="#put-3"><c>ct_ftp:put/3</c></seealso>.</p>
+
+ <p>For <c>target_name</c>, see module
+ <seealso marker="ct"><c>ct</c></seealso>.</p>
+
+ <p>See also
+ <seealso marker="ct#require-2"><c>ct:require/2</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>ls(Connection, Dir) -&gt; {ok, Listing} | {error, Reason}</name>
+ <fsummary>Lists directory Dir.</fsummary>
+ <type>
+ <v>Connection = connection()</v>
+ <v>Dir = string()</v>
+ <v>Listing = string()</v>
+ </type>
+ <desc><marker id="ls-2"/>
+ <p>Lists directory <c>Dir</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>open(KeyOrName) -&gt; {ok, Handle} | {error, Reason}</name>
+ <fsummary>Opens an FTP connection to the specified node.</fsummary>
+ <type>
+ <v>KeyOrName = Key | Name</v>
+ <v>Key = atom()</v>
+ <v>Name = target_name()</v>
+ <v>Handle = handle()</v>
+ </type>
+ <desc><marker id="open-1"/>
+ <p>Opens an FTP connection to the specified node.</p>
+
+ <p>You can open a connection for a particular <c>Name</c> and use the
+ same name as reference for all following subsequent operations.
+ If you want
+ the connection to be associated with <c>Handle</c> instead (if you,
+ for example, need to open multiple connections to a host), use
+ <c>Key</c>, the configuration variable name, to specify the target.
+ A connection without an associated target name can only be closed
+ with the handle value.</p>
+
+ <p>For information on how to create a new <c>Name</c>, see
+ <seealso marker="ct#require-2"><c>ct:require/2</c></seealso>.</p>
+
+ <p>For <c>target_name</c>, see module
+ <seealso marker="ct"><c>ct</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>put(KeyOrName, LocalFile, RemoteFile) -&gt; ok | {error, Reason}</name>
+ <fsummary>Opens an FTP connection and sends a file to the remote
+ host.</fsummary>
+ <type>
+ <v>KeyOrName = Key | Name</v>
+ <v>Key = atom()</v>
+ <v>Name = target_name()</v>
+ <v>LocalFile = string()</v>
+ <v>RemoteFile = string()</v>
+ </type>
+ <desc><marker id="put-3"/>
+ <p>Opens an FTP connection and sends a file to the remote host.</p>
+
+ <p><c>LocalFile</c> and <c>RemoteFile</c> must be absolute paths.</p>
+
+ <p>For <c>target_name</c>, see module
+ <seealso marker="ct"><c>ct</c></seealso>.</p>
+
+ <p>If the target host is a "special" node, the FTP address must be
+ specified in the configuration file as follows:</p>
+
+ <pre>
+ {node,[{ftp,IpAddr}]}.</pre>
+
+ <p>If the target host is something else, for example, a UNIX host,
+ the configuration file must also include the username and password
+ (both strings):</p>
+
+ <pre>
+ {unix,[{ftp,IpAddr},
+ {username,Username},
+ {password,Password}]}.</pre>
+
+ <p>See also
+ <seealso marker="ct#require-2"><c>ct:require/2</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>recv(Connection, RemoteFile) -&gt; ok | {error, Reason}</name>
+ <fsummary>Fetches a file over FTP.</fsummary>
+ <desc><marker id="recv-2"/>
+ <p>Fetches a file over FTP.</p>
+
+ <p>The file gets the same name on the local host.</p>
+
+ <p>See also <seealso marker="#recv-3"><c>ct_ftp:recv/3</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>recv(Connection, RemoteFile, LocalFile) -&gt; ok | {error, Reason}</name>
+ <fsummary>Fetches a file over FTP.</fsummary>
+ <type>
+ <v>Connection = connection()</v>
+ <v>RemoteFile = string()</v>
+ <v>LocalFile = string()</v>
+ </type>
+ <desc><marker id="recv-3"/>
+ <p>Fetches a file over FTP.</p>
+
+ <p>The file is named <c>LocalFile</c> on the local host.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>send(Connection, LocalFile) -&gt; ok | {error, Reason}</name>
+ <fsummary>Sends a file over FTP.</fsummary>
+ <desc><marker id="send-2"/>
+ <p>Sends a file over FTP.</p>
+
+ <p>The file gets the same name on the remote host.</p>
+
+ <p>See also
+ <seealso marker="#send-3"><c>ct_ftp:send/3</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>send(Connection, LocalFile, RemoteFile) -&gt; ok | {error, Reason}</name>
+ <fsummary>Sends a file over FTP.</fsummary>
+ <type>
+ <v>Connection = connection()</v>
+ <v>LocalFile = string()</v>
+ <v>RemoteFile = string()</v>
+ </type>
+ <desc><marker id="send-3"/>
+ <p>Sends a file over FTP.</p>
+
+ <p>The file is named <c>RemoteFile</c> on the remote host.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>type(Connection, Type) -&gt; ok | {error, Reason}</name>
+ <fsummary>Changes the file transfer type.</fsummary>
+ <type>
+ <v>Connection = connection()</v>
+ <v>Type = ascii | binary</v>
+ </type>
+ <desc><marker id="type-2"/>
+ <p>Changes the file transfer type.</p>
+ </desc>
+ </func>
+ </funcs>
+
+</erlref>
+
+
diff --git a/lib/common_test/doc/src/ct_hooks.xml b/lib/common_test/doc/src/ct_hooks.xml
index a9f9450dd7..12ec3bcec3 100644
--- a/lib/common_test/doc/src/ct_hooks.xml
+++ b/lib/common_test/doc/src/ct_hooks.xml
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
-
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
@@ -12,7 +11,7 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@@ -34,539 +33,572 @@
<file>ct_hooks.sgml</file>
</header>
<module>ct_hooks</module>
- <modulesummary>A callback interface on top of Common Test</modulesummary>
+ <modulesummary>A callback interface on top of Common Test.</modulesummary>
<description>
- <p>The <em>Common Test Hook</em> (henceforth called CTH) framework allows
- extensions of the default behaviour of Common Test by means of callbacks
- before and after all test suite calls. It is meant for advanced users of
- Common Test which want to abstract out behaviour which is common to
- multiple test suites. </p>
+ <p>The <em>Common Test Hook (CTH)</em> framework allows extensions of the
+ default behavior of <c>Common Test</c> by callbacks before and after all
+ test suite calls. It is intended for advanced users of <c>Common Test</c>
+ who want to abstract out behavior that is common to multiple test suites.
+ </p>
- <p>In brief, Common Test Hooks allows you to:</p>
+ <p>In brief, CTH allows you to:</p>
- <list>
- <item>Manipulate the runtime config before each suite
- configuration call</item>
- <item>Manipulate the return of all suite configuration calls and in
- extension the result of the test themselves.</item>
+ <list type="bulleted">
+ <item><p>Manipulate the runtime configuration before each suite
+ configuration call.</p></item>
+ <item><p>Manipulate the return of all suite configuration calls and by
+ extension the result of the test themselves.</p></item>
</list>
<p>The following sections describe the mandatory and optional CTH
- functions Common Test will call during test execution. For more details
- see <seealso marker="ct_hooks_chapter">Common Test Hooks</seealso> in
- the User's Guide.</p>
+ functions that <c>Common Test</c> calls during test execution.
+ For more details, see section
+ <seealso marker="ct_hooks_chapter">Common Test Hooks</seealso> in the
+ User's Guide.</p>
- <p>For information about how to add a CTH to your suite see
- <seealso marker="ct_hooks_chapter#installing">Installing a CTH
- </seealso> in the User's Guide.</p>
+ <p>For information about how to add a CTH to your suite, see section
+ <seealso marker="ct_hooks_chapter#installing">Installing a CTH</seealso>
+ in the User's Guide.</p>
+
+ <note><p>For a minimal example of a CTH, see section
+ <seealso marker="ct_hooks_chapter#example">Example CTH</seealso>
+ in the User's Guide.</p></note>
- <note><p>See the
- <seealso marker="ct_hooks_chapter#example">Example CTH</seealso>
- in the User's Guide for a minimal example of a CTH. </p></note>
-
</description>
<section>
- <title>CALLBACK FUNCTIONS</title>
- <p>The following functions define the callback interface
- for a Common Test Hook.</p>
+ <title>Callback Functions</title>
+ <p>The following functions define the callback interface for a CTH.</p>
</section>
<funcs>
<func>
- <name>Module:init(Id, Opts) -&gt; {ok, State} |
- {ok, State, Priority}</name>
- <fsummary>Initiates the Common Test Hook</fsummary>
+ <name>Module:init(Id, Opts) -&gt; {ok, State} | {ok, State, Priority}</name>
+ <fsummary>Initiates the Common Test Hook.</fsummary>
<type>
- <v>Id = reference() | term()</v>
- <v>Opts = term()</v>
- <v>State = term()</v>
- <v>Priority = integer()</v>
+ <v>Id = reference() | term()</v>
+ <v>Opts = term()</v>
+ <v>State = term()</v>
+ <v>Priority = integer()</v>
</type>
-
<desc>
- <p> MANDATORY </p>
-
- <p>Always called before any other callback function.
- Use this to initiate any common state.
- It should return a state for this CTH.</p>
-
- <p><c>Id</c> is the return value of
- <seealso marker="#Module:id-1">id/1</seealso>, or a <c>reference</c>
- (created using
- <seealso marker="erts:erlang#make_ref-0">make_ref/0</seealso>)
- if <seealso marker="#Module:id-1">id/1</seealso> is not implemented.
- </p>
-
- <p><c>Priority</c> is the relative priority of this hook. Hooks with a
- lower priority will be executed first. If no priority is given,
- it will be set to 0. </p>
-
- <p>For details about when init is called see
- <seealso marker="ct_hooks_chapter#scope">scope</seealso>
- in the User's Guide.</p>
-
+ <p>MANDATORY</p>
+
+ <p>This function is always called before any other callback function.
+ Use it to initiate any common state. It is to return a state for
+ this CTH.</p>
+
+ <p><c>Id</c> is either the return value of
+ <seealso marker="#Module:id-1"><c>ct_hooks:id/1</c></seealso>,
+ or a <c>reference</c> (created using
+ <seealso marker="erts:erlang#make_ref-0">erlang:make_ref/0</seealso>
+ in <c>ERTS</c>) if
+ <seealso marker="#Module:id-1"><c>ct_hooks:id/1</c></seealso>
+ is not implemented.</p>
+
+ <p><c>Priority</c> is the relative priority of this hook. Hooks with a
+ lower priority are executed first. If no priority is specified, it
+ is set to <c>0</c>.</p>
+
+ <p>For details about when <c>init</c> is called, see section
+ <seealso marker="ct_hooks_chapter#scope">CTH Scope</seealso>
+ in the User's Guide.</p>
</desc>
</func>
<func>
- <name>Module:pre_init_per_suite(SuiteName, InitData, CTHState) -&gt;
- Result</name>
- <fsummary>Called before init_per_suite</fsummary>
+ <name>Module:pre_init_per_suite(SuiteName, InitData, CTHState) -&gt; Result</name>
+ <fsummary>Called before init_per_suite.</fsummary>
<type>
- <v>SuiteName = atom()</v>
- <v>InitData = Config | SkipOrFail</v>
- <v>Config = NewConfig = [{Key,Value}]</v>
- <v>CTHState = NewCTHState = term()</v>
- <v>Result = {Return, NewCTHState}</v>
- <v>Return = NewConfig | SkipOrFail</v>
- <v>SkipOrFail = {fail, Reason} | {skip, Reason}</v>
- <v>Key = atom()</v>
- <v>Value = term()</v>
- <v>Reason = term()</v>
+ <v>SuiteName = atom()</v>
+ <v>InitData = Config | SkipOrFail</v>
+ <v>Config = NewConfig = [{Key,Value}]</v>
+ <v>CTHState = NewCTHState = term()</v>
+ <v>Result = {Return, NewCTHState}</v>
+ <v>Return = NewConfig | SkipOrFail</v>
+ <v>SkipOrFail = {fail, Reason} | {skip, Reason}</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
</type>
-
<desc>
- <p> OPTIONAL </p>
-
- <p>This function is called before
- <seealso marker="common_test#Module:init_per_suite-1">
- init_per_suite</seealso> if it exists.
- It typically contains initialization/logging which needs to be done
- before init_per_suite is called.
- If <c>{skip,Reason}</c> or <c>{fail,Reason}</c> is returned,
- init_per_suite and all test cases of the suite will be skipped and
- Reason printed in the overview log of the suite.</p>
-
- <p><c>SuiteName</c> is the name of the suite to be run.</p>
-
- <p><c>InitData</c> is the original config list of the test suite, or
- a <c>SkipOrFail</c> tuple if a previous CTH has returned this.</p>
-
- <p><c>CTHState</c> is the current internal state of the CTH.</p>
-
- <p><c>Return</c> is the result of the init_per_suite function.
- If it is <c>{skip,Reason}</c> or <c>{fail,Reason}</c>
- <seealso marker="common_test#Module:init_per_suite-1">init_per_suite
- </seealso> will never be called, instead the initiation is considered
- to be skipped/failed respectively. If a <c>NewConfig</c> list
- is returned, <seealso marker="common_test#Module:init_per_suite-1">
- init_per_suite</seealso> will be called with that <c>NewConfig</c> list.
- See <seealso marker="ct_hooks_chapter#pre">
- Pre Hooks</seealso> in the User's Guide for more details.</p>
-
-
- <p>Note that this function is only called if the CTH has been added
- before init_per_suite is run, see
- <seealso marker="ct_hooks_chapter#scope">CTH Scoping</seealso>
- in the User's Guide for details.</p>
+ <p>OPTIONAL</p>
+
+ <p>This function is called before
+ <seealso marker="common_test#Module:init_per_suite-1"><c>init_per_suite</c></seealso>
+ if it exists. It typically contains initialization/logging that must
+ be done before <c>init_per_suite</c> is called. If
+ <c>{skip,Reason}</c> or <c>{fail,Reason}</c> is returned,
+ <c>init_per_suite</c> and all test cases of the suite are skipped
+ and <c>Reason</c> printed in the overview log of the suite.</p>
+
+ <p><c>SuiteName</c> is the name of the suite to be run.</p>
+
+ <p><c>InitData</c> is the original configuration list of the test
+ suite, or a <c>SkipOrFail</c> tuple if a previous CTH has returned
+ this.</p>
+
+ <p><c>CTHState</c> is the current internal state of the CTH.</p>
+
+ <p><c>Return</c> is the result of the <c>init_per_suite</c> function.
+ If it is <c>{skip,Reason}</c> or <c>{fail,Reason}</c>,
+ <seealso marker="common_test#Module:init_per_suite-1"><c>init_per_suite</c></seealso>
+ is never called, instead the initiation is considered to be
+ skipped or failed, respectively. If a <c>NewConfig</c> list is
+ returned,
+ <seealso marker="common_test#Module:init_per_suite-1"><c>init_per_suite</c></seealso>
+ is called with that <c>NewConfig</c> list. For more details, see
+ section <seealso marker="ct_hooks_chapter#pre">Pre Hooks</seealso>
+ in the User's Guide.</p>
+
+ <p>This function is called only if the CTH is added before
+ <c>init_per_suite is run</c>. For details, see section
+ <seealso marker="ct_hooks_chapter#scope">CTH Scope</seealso>
+ in the User's Guide.</p>
</desc>
</func>
-
+
<func>
- <name>Module:post_init_per_suite(SuiteName, Config, Return, CTHState) -&gt;
- Result</name>
- <fsummary>Called after init_per_suite</fsummary>
+ <name>Module:post_init_per_suite(SuiteName, Config, Return, CTHState) -&gt; Result</name>
+ <fsummary>Called after init_per_suite.</fsummary>
<type>
- <v>SuiteName = atom()</v>
- <v>Config = [{Key,Value}]</v>
- <v>Return = NewReturn = Config | SkipOrFail | term()</v>
- <v>SkipOrFail = {fail, Reason} | {skip, Reason} | term()</v>
- <v>CTHState = NewCTHState = term()</v>
- <v>Result = {NewReturn, NewCTHState}</v>
- <v>Key = atom()</v>
- <v>Value = term()</v>
- <v>Reason = term()</v>
+ <v>SuiteName = atom()</v>
+ <v>Config = [{Key,Value}]</v>
+ <v>Return = NewReturn = Config | SkipOrFail | term()</v>
+ <v>SkipOrFail = {fail, Reason} | {skip, Reason} | term()</v>
+ <v>CTHState = NewCTHState = term()</v>
+ <v>Result = {NewReturn, NewCTHState}</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
</type>
-
<desc>
- <p> OPTIONAL </p>
+ <p>OPTIONAL</p>
+
+ <p>This function is called after
+ <seealso marker="common_test#Module:init_per_suite-1"><c>init_per_suite</c></seealso>
+ if it exists. It typically contains extra checks to ensure that all
+ the correct dependencies are started correctly.</p>
+
+ <p><c>Return</c> is what
+ <seealso marker="common_test#Module:init_per_suite-1"><c>init_per_suite</c></seealso>
+ returned, that is, <c>{fail,Reason}</c>, <c>{skip,Reason}</c>, a
+ <c>Config</c> list, or a term describing how
+ <seealso marker="common_test#Module:init_per_suite-1"><c>init_per_suite</c></seealso>
+ failed.</p>
+
+ <p><c>NewReturn</c> is the possibly modified return value of
+ <seealso marker="common_test#Module:init_per_suite-1"><c>init_per_suite</c></seealso>.
+ To recover from a failure in
+ <seealso marker="common_test#Module:init_per_suite-1"><c>init_per_suite</c></seealso>,
+ return <c>ConfigList</c> with the <c>tc_status</c> element removed.
+ For more details, see
+ <seealso marker="ct_hooks_chapter#post"> Post Hooks</seealso> in
+ section "Manipulating Tests" in the User's Guide.</p>
+
+ <p><c>CTHState</c> is the current internal state of the CTH.</p>
+
+ <p>This function is called only if the CTH is added before or in
+ <c>init_per_suite</c>. For details, see section
+ <seealso marker="ct_hooks_chapter#scope">CTH Scope</seealso>
+ in the User's Guide.</p>
+ </desc>
+ </func>
- <p>This function is called after
- <seealso marker="common_test#Module:init_per_suite-1">
- init_per_suite</seealso> if it exists. It typically contains extra
- checks to make sure that all the correct dependencies have
- been started correctly.</p>
-
- <p><c>Return</c> is what
- <seealso marker="common_test#Module:init_per_suite-1">init_per_suite
- </seealso> returned, i.e. {fail,Reason}, {skip,Reason}, a <c>Config</c>
- list or a term describing how
- <seealso marker="common_test#Module:init_per_suite-1">init_per_suite
- </seealso> failed.</p>
-
- <p><c>NewReturn</c> is the possibly modified return value of
- <seealso marker="common_test#Module:init_per_suite-1">init_per_suite
- </seealso>. It is here possible to recover from a failure in
- <seealso marker="common_test#Module:init_per_suite-1">init_per_suite
- </seealso> by returning the <c>ConfigList</c> with the <c>tc_status</c>
- element removed. See <seealso marker="ct_hooks_chapter#post">
- Post Hooks</seealso> in the User's Guide for more details.</p>
-
- <p><c>CTHState</c> is the current internal state of the CTH.</p>
-
- <p>Note that this function is only called if the CTH has been added
- before or in init_per_suite, see
- <seealso marker="ct_hooks_chapter#scope">CTH Scoping</seealso>
- in the User's Guide for details.</p>
+ <func>
+ <name>Module:pre_init_per_group(GroupName, InitData, CTHState) -&gt; Result</name>
+ <fsummary>Called before init_per_group.</fsummary>
+ <type>
+ <v>GroupName = atom()</v>
+ <v>InitData = Config | SkipOrFail</v>
+ <v>Config = NewConfig = [{Key,Value}]</v>
+ <v>CTHState = NewCTHState = term()</v>
+ <v>Result = {NewConfig | SkipOrFail, NewCTHState}</v>
+ <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>OPTIONAL</p>
+
+ <p>This function is called before
+ <seealso marker="common_test#Module:init_per_group-2"><c>init_per_group</c></seealso>
+ if it exists. It behaves the same way as
+ <seealso marker="ct_hooks#Module:pre_init_per_suite-3"><c>pre_init_per_suite</c></seealso>,
+ but for function
+ <seealso marker="common_test#Module:init_per_group-2"><c>init_per_group</c></seealso>
+ instead.</p>
</desc>
</func>
-
+
<func>
- <name>Module:pre_init_per_group(GroupName, InitData, CTHState) -&gt;
- Result</name>
- <fsummary>Called before init_per_group</fsummary>
+ <name>Module:post_init_per_group(GroupName, Config, Return, CTHState) -&gt; Result</name>
+ <fsummary>Called after init_per_group.</fsummary>
<type>
- <v>GroupName = atom()</v>
- <v>InitData = Config | SkipOrFail</v>
- <v>Config = NewConfig = [{Key,Value}]</v>
- <v>CTHState = NewCTHState = term()</v>
- <v>Result = {NewConfig | SkipOrFail, NewCTHState}</v>
- <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
- <v>Key = atom()</v>
- <v>Value = term()</v>
- <v>Reason = term()</v>
+ <v>GroupName = atom()</v>
+ <v>Config = [{Key,Value}]</v>
+ <v>Return = NewReturn = Config | SkipOrFail | term()</v>
+ <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
+ <v>CTHState = NewCTHState = term()</v>
+ <v>Result = {NewReturn, NewCTHState}</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
</type>
-
<desc>
- <p> OPTIONAL </p>
-
- <p>This function is called before
- <seealso marker="common_test#Module:init_per_group-2">
- init_per_group</seealso> if it exists. It behaves the same way as
- <seealso marker="ct_hooks#Module:pre_init_per_suite-3">
- pre_init_per_suite</seealso>, but for the
- <seealso marker="common_test#Module:init_per_group-2">
- init_per_group</seealso> instead.</p>
+ <p>OPTIONAL</p>
+
+ <p>This function is called after
+ <seealso marker="common_test#Module:init_per_group-2"><c>init_per_group</c></seealso>
+ if it exists. It behaves the same way as
+ <seealso marker="ct_hooks#Module:post_init_per_suite-4"><c>post_init_per_suite</c></seealso>,
+ but for function
+ <seealso marker="common_test#Module:init_per_group-2"><c>init_per_group</c></seealso>
+ instead.</p>
</desc>
</func>
-
+
<func>
- <name>Module:post_init_per_group(GroupName, Config, Return, CTHState) -&gt;
- Result</name>
- <fsummary>Called after init_per_group</fsummary>
+ <name>Module:pre_init_per_testcase(TestcaseName, InitData, CTHState) -&gt; Result</name>
+ <fsummary>Called before init_per_testcase.</fsummary>
<type>
- <v>GroupName = atom()</v>
- <v>Config = [{Key,Value}]</v>
- <v>Return = NewReturn = Config | SkipOrFail | term()</v>
- <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
- <v>CTHState = NewCTHState = term()</v>
- <v>Result = {NewReturn, NewCTHState}</v>
- <v>Key = atom()</v>
- <v>Value = term()</v>
- <v>Reason = term()</v>
+ <v>TestcaseName = atom()</v>
+ <v>InitData = Config | SkipOrFail</v>
+ <v>Config = NewConfig = [{Key,Value}]</v>
+ <v>CTHState = NewCTHState = term()</v>
+ <v>Result = {NewConfig | SkipOrFail, NewCTHState}</v>
+ <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
</type>
-
<desc>
- <p> OPTIONAL </p>
-
- <p>This function is called after
- <seealso marker="common_test#Module:init_per_group-2">
- init_per_group</seealso> if it exists. It behaves the same way as
- <seealso marker="ct_hooks#Module:post_init_per_suite-4">
- post_init_per_suite</seealso>, but for the
- <seealso marker="common_test#Module:init_per_group-2">
- init_per_group</seealso> instead.</p>
+ <p>OPTIONAL</p>
+
+ <p>This function is called before
+ <seealso marker="common_test#Module:init_per_testcase-2"><c>init_per_testcase</c></seealso>
+ if it exists. It behaves the same way as
+ <seealso marker="ct_hooks#Module:pre_init_per_suite-3"><c>pre_init_per_suite</c></seealso>,
+ but for function
+ <seealso marker="common_test#Module:init_per_testcase-2"><c>init_per_testcase</c></seealso>
+ instead.</p>
+
+ <p>CTHs cannot be added here right now. That feature may be added in
+ a later release, but it would right now break backwards
+ compatibility.</p>
</desc>
</func>
<func>
- <name>Module:pre_init_per_testcase(TestcaseName, InitData, CTHState) -&gt;
- Result</name>
- <fsummary>Called before init_per_testcase</fsummary>
+ <name>Module:post_init_per_testcase(TestcaseName, Config, Return, CTHState) -&gt; Result</name>
+ <fsummary>Called after init_per_testcase.</fsummary>
<type>
- <v>TestcaseName = atom()</v>
- <v>InitData = Config | SkipOrFail</v>
- <v>Config = NewConfig = [{Key,Value}]</v>
- <v>CTHState = NewCTHState = term()</v>
- <v>Result = {NewConfig | SkipOrFail, NewCTHState}</v>
- <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
- <v>Key = atom()</v>
- <v>Value = term()</v>
- <v>Reason = term()</v>
+ <v>TestcaseName = atom()</v>
+ <v>Config = [{Key,Value}]</v>
+ <v>Return = NewReturn = Config | SkipOrFail | term()</v>
+ <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
+ <v>CTHState = NewCTHState = term()</v>
+ <v>Result = {NewReturn, NewCTHState}</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
</type>
-
<desc>
- <p> OPTIONAL </p>
-
- <p>This function is called before
- <seealso marker="common_test#Module:init_per_testcase-2">
- init_per_testcase</seealso> if it exists. It behaves the same way as
- <seealso marker="ct_hooks#Module:pre_init_per_suite-3">
- pre_init_per_suite</seealso>, but for the
- <seealso marker="common_test#Module:init_per_testcase-2">
- init_per_testcase</seealso> function instead.</p>
-
- <p>Note that it is not possible to add CTH's here right now,
- that feature might be added later,
- but it would right now break backwards compatibility.</p>
+ <p>OPTIONAL</p>
+
+ <p>This function is called after
+ <seealso marker="common_test#Module:init_per_testcase-2"><c>init_per_testcase</c></seealso>
+ if it exists. It behaves the same way as
+ <seealso marker="ct_hooks#Module:post_init_per_suite-4"><c>post_init_per_suite</c></seealso>,
+ but for function
+ <seealso marker="common_test#Module:init_per_testcase-2"><c>init_per_testcase</c></seealso>
+ instead.</p>
</desc>
</func>
<func>
- <name>Module:post_end_per_testcase(TestcaseName, Config, Return, CTHState)
- -&gt; Result</name>
- <fsummary>Called after end_per_testcase</fsummary>
+ <name>Module:pre_end_per_testcase(TestcaseName, InitData, CTHState) -&gt; Result</name>
+ <fsummary>Called before end_per_testcase.</fsummary>
<type>
- <v>TestcaseName = atom()</v>
- <v>Config = [{Key,Value}]</v>
- <v>Return = NewReturn = Config | SkipOrFail | term()</v>
- <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
- <v>CTHState = NewCTHState = term()</v>
- <v>Result = {NewReturn, NewCTHState}</v>
- <v>Key = atom()</v>
- <v>Value = term()</v>
- <v>Reason = term()</v>
+ <v>TestcaseName = atom()</v>
+ <v>InitData = Config</v>
+ <v>Config = NewConfig = [{Key,Value}]</v>
+ <v>CTHState = NewCTHState = term()</v>
+ <v>Result = {NewConfig, NewCTHState}</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
</type>
-
<desc>
- <p> OPTIONAL </p>
-
- <p>This function is called after
- <seealso marker="common_test#Module:end_per_testcase-2">
- end_per_testcase</seealso> if it exists. It behaves the same way as
- <seealso marker="ct_hooks#Module:post_init_per_suite-4">
- post_init_per_suite</seealso>, but for the
- <seealso marker="common_test#Module:end_per_testcase-2">
- end_per_testcase</seealso> function instead.</p>
+ <p>OPTIONAL</p>
+
+ <p>This function is called before
+ <seealso marker="common_test#Module:end_per_testcase-2"><c>end_per_testcase</c></seealso>
+ if it exists. It behaves the same way as
+ <seealso marker="ct_hooks#Module:pre_end_per_suite-3"><c>pre_end_per_suite</c></seealso>,
+ but for function
+ <seealso marker="common_test#Module:end_per_testcase-2"><c>end_per_testcase</c></seealso>
+ instead.</p>
+
+ <p>This function can not change the result of the test case by returning skip or fail
+ tuples, but it may insert items in <c>Config</c> that can be read in
+ <c>end_per_testcase/2</c> or in <c>post_end_per_testcase/4</c>.</p>
</desc>
</func>
<func>
- <name>Module:pre_end_per_group(GroupName, EndData, CTHState) -&gt;
- Result</name>
- <fsummary>Called before end_per_group</fsummary>
+ <name>Module:post_end_per_testcase(TestcaseName, Config, Return, CTHState) -&gt; Result</name>
+ <fsummary>Called after end_per_testcase.</fsummary>
<type>
- <v>GroupName = atom()</v>
- <v>EndData = Config | SkipOrFail</v>
- <v>Config = NewConfig = [{Key,Value}]</v>
- <v>CTHState = NewCTHState = term()</v>
- <v>Result = {NewConfig | SkipOrFail, NewCTHState}</v>
- <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
- <v>Key = atom()</v>
- <v>Value = term()</v>
- <v>Reason = term()</v>
+ <v>TestcaseName = atom()</v>
+ <v>Config = [{Key,Value}]</v>
+ <v>Return = NewReturn = Config | SkipOrFail | term()</v>
+ <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
+ <v>CTHState = NewCTHState = term()</v>
+ <v>Result = {NewReturn, NewCTHState}</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
</type>
-
<desc>
- <p> OPTIONAL </p>
-
- <p>This function is called before
- <seealso marker="common_test#Module:end_per_group-2">
- end_per_group</seealso> if it exists. It behaves the same way as
- <seealso marker="ct_hooks#Module:pre_init_per_suite-3">
- pre_init_per_suite</seealso>, but for the
- <seealso marker="common_test#Module:end_per_group-2">
- end_per_group</seealso> function instead.</p>
+ <p>OPTIONAL</p>
+
+ <p>This function is called after
+ <seealso marker="common_test#Module:end_per_testcase-2"><c>end_per_testcase</c></seealso>
+ if it exists. It behaves the same way as
+ <seealso marker="ct_hooks#Module:post_end_per_suite-4"><c>post_end_per_suite</c></seealso>,
+ but for function
+ <seealso marker="common_test#Module:end_per_testcase-2"><c>end_per_testcase</c></seealso>
+ instead.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>Module:pre_end_per_group(GroupName, EndData, CTHState) -&gt; Result</name>
+ <fsummary>Called before end_per_group.</fsummary>
+ <type>
+ <v>GroupName = atom()</v>
+ <v>EndData = Config | SkipOrFail</v>
+ <v>Config = NewConfig = [{Key,Value}]</v>
+ <v>CTHState = NewCTHState = term()</v>
+ <v>Result = {NewConfig | SkipOrFail, NewCTHState}</v>
+ <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>OPTIONAL</p>
+
+ <p>This function is called before
+ <seealso marker="common_test#Module:end_per_group-2"><c>end_per_group</c></seealso>
+ if it exists. It behaves the same way as
+ <seealso marker="ct_hooks#Module:pre_init_per_suite-3"><c>pre_init_per_suite</c></seealso>,
+ but for function
+ <seealso marker="common_test#Module:end_per_group-2"><c>end_per_group</c></seealso>
+ instead.</p>
</desc>
</func>
<func>
- <name>Module:post_end_per_group(GroupName, Config, Return, CTHState) -&gt;
- Result</name>
- <fsummary>Called after end_per_group</fsummary>
+ <name>Module:post_end_per_group(GroupName, Config, Return, CTHState) -&gt; Result</name>
+ <fsummary>Called after end_per_group.</fsummary>
<type>
- <v>GroupName = atom()</v>
- <v>Config = [{Key,Value}]</v>
- <v>Return = NewReturn = Config | SkipOrFail | term()</v>
- <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
- <v>CTHState = NewCTHState = term()</v>
- <v>Result = {NewReturn, NewCTHState}</v>
- <v>Key = atom()</v>
- <v>Value = term()</v>
- <v>Reason = term()</v>
+ <v>GroupName = atom()</v>
+ <v>Config = [{Key,Value}]</v>
+ <v>Return = NewReturn = Config | SkipOrFail | term()</v>
+ <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
+ <v>CTHState = NewCTHState = term()</v>
+ <v>Result = {NewReturn, NewCTHState}</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
</type>
-
<desc>
- <p> OPTIONAL </p>
-
- <p>This function is called after
- <seealso marker="common_test#Module:end_per_group-2">
- end_per_group</seealso> if it exists. It behaves the same way as
- <seealso marker="ct_hooks#Module:post_init_per_suite-4">
- post_init_per_suite</seealso>, but for the
- <seealso marker="common_test#Module:end_per_group-2">
- end_per_group</seealso> function instead.</p>
+ <p>OPTIONAL</p>
+
+ <p>This function is called after
+ <seealso marker="common_test#Module:end_per_group-2"><c>end_per_group</c></seealso>
+ if it exists. It behaves the same way as
+ <seealso marker="ct_hooks#Module:post_init_per_suite-4"><c>post_init_per_suite</c></seealso>,
+ but for function
+ <seealso marker="common_test#Module:end_per_group-2">end_per_group</seealso>
+ instead.</p>
</desc>
</func>
<func>
- <name>Module:pre_end_per_suite(SuiteName, EndData, CTHState) -&gt;
- Result</name>
- <fsummary>Called before end_per_suite</fsummary>
+ <name>Module:pre_end_per_suite(SuiteName, EndData, CTHState) -&gt; Result</name>
+ <fsummary>Called before end_per_suite.</fsummary>
<type>
- <v>SuiteName = atom()</v>
- <v>EndData = Config | SkipOrFail</v>
- <v>Config = NewConfig = [{Key,Value}]</v>
- <v>CTHState = NewCTHState = term()</v>
- <v>Result = {NewConfig | SkipOrFail, NewCTHState}</v>
- <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
- <v>Key = atom()</v>
- <v>Value = term()</v>
- <v>Reason = term()</v>
+ <v>SuiteName = atom()</v>
+ <v>EndData = Config | SkipOrFail</v>
+ <v>Config = NewConfig = [{Key,Value}]</v>
+ <v>CTHState = NewCTHState = term()</v>
+ <v>Result = {NewConfig | SkipOrFail, NewCTHState}</v>
+ <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
</type>
-
<desc>
- <p> OPTIONAL </p>
-
- <p>This function is called before
- <seealso marker="common_test#Module:end_per_suite-1">
- end_per_suite</seealso> if it exists. It behaves the same way as
- <seealso marker="ct_hooks#Module:pre_init_per_suite-3">
- pre_init_per_suite</seealso>, but for the
- <seealso marker="common_test#Module:end_per_suite-1">
- end_per_suite</seealso> function instead.</p>
+ <p>OPTIONAL</p>
+
+ <p>This function is called before
+ <seealso marker="common_test#Module:end_per_suite-1"><c>end_per_suite</c></seealso>
+ if it exists. It behaves the same way as
+ <seealso marker="ct_hooks#Module:pre_init_per_suite-3"><c>pre_init_per_suite</c></seealso>,
+ but for function
+ <seealso marker="common_test#Module:end_per_suite-1"><c>end_per_suite</c></seealso>
+ instead.</p>
</desc>
</func>
<func>
- <name>Module:post_end_per_suite(SuiteName, Config, Return, CTHState) -&gt;
- Result</name>
- <fsummary>Called after end_per_suite</fsummary>
+ <name>Module:post_end_per_suite(SuiteName, Config, Return, CTHState) -&gt; Result</name>
+ <fsummary>Called after end_per_suite.</fsummary>
<type>
- <v>SuiteName = atom()</v>
- <v>Config = [{Key,Value}]</v>
- <v>Return = NewReturn = Config | SkipOrFail | term()</v>
- <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
- <v>CTHState = NewCTHState = term()</v>
- <v>Result = {NewReturn, NewCTHState}</v>
- <v>Key = atom()</v>
- <v>Value = term()</v>
- <v>Reason = term()</v>
+ <v>SuiteName = atom()</v>
+ <v>Config = [{Key,Value}]</v>
+ <v>Return = NewReturn = Config | SkipOrFail | term()</v>
+ <v>SkipOrFail = {fail,Reason} | {skip, Reason}</v>
+ <v>CTHState = NewCTHState = term()</v>
+ <v>Result = {NewReturn, NewCTHState}</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>Reason = term()</v>
</type>
-
<desc>
- <p> OPTIONAL </p>
-
- <p>This function is called after
- <seealso marker="common_test#Module:end_per_suite-1">
- end_per_suite</seealso> if it exists. It behaves the same way as
- <seealso marker="ct_hooks#Module:post_init_per_suite-4">
- post_init_per_suite</seealso>, but for the
- <seealso marker="common_test#Module:end_per_suite-1">
- end_per_suite</seealso> function instead.</p>
+ <p>OPTIONAL</p>
+
+ <p>This function is called after
+ <seealso marker="common_test#Module:end_per_suite-1"><c>end_per_suite</c></seealso>
+ if it exists. It behaves the same way as
+ <seealso marker="ct_hooks#Module:post_init_per_suite-4"><c>post_init_per_suite</c></seealso>,
+ but for function
+ <seealso marker="common_test#Module:end_per_suite-1"><c>end_per_suite</c></seealso>
+ instead.</p>
</desc>
</func>
<func>
- <name>Module:on_tc_fail(TestName, Reason, CTHState) -&gt;
- NewCTHState</name>
- <fsummary>Called after the CTH scope ends</fsummary>
+ <name>Module:on_tc_fail(TestName, Reason, CTHState) -&gt; NewCTHState</name>
+ <fsummary>Called after the CTH scope ends.</fsummary>
<type>
- <v>TestName = init_per_suite | end_per_suite |
- {init_per_group,GroupName} | {end_per_group,GroupName} |
- {FuncName,GroupName} | FuncName</v>
- <v>FuncName = atom()</v>
- <v>GroupName = atom()</v>
- <v>Reason = term()</v>
- <v>CTHState = NewCTHState = term()</v>
+ <v>TestName = init_per_suite | end_per_suite | {init_per_group,GroupName} | {end_per_group,GroupName} | {FuncName,GroupName} | FuncName</v>
+ <v>FuncName = atom()</v>
+ <v>GroupName = atom()</v>
+ <v>Reason = term()</v>
+ <v>CTHState = NewCTHState = term()</v>
</type>
-
<desc>
- <p> OPTIONAL </p>
-
- <p>This function is called whenever a test case (or config function)
- fails. It is called after the post function has been called for
- the failed test case. I.e. if init_per_suite fails, this function
- is called after
- <seealso marker="#Module:post_init_per_suite-4">
- post_init_per_suite</seealso>, and if a test case fails, it is called
- after <seealso marker="#Module:post_end_per_testcase-4">
- post_end_per_testcase</seealso>. If the failed test case belongs
- to a test case group, the first argument is a tuple
- <c>{FuncName,GroupName}</c>, otherwise simply the function name.</p>
-
- <p>The data which comes with the Reason follows the same format as the
- <seealso marker="event_handler_chapter#failreason">FailReason
- </seealso> in the <seealso marker="event_handler_chapter#tc_done">tc_done</seealso> event.
- See <seealso marker="event_handler_chapter#events">Event Handling
- </seealso> in the User's Guide for details.</p>
+ <p>OPTIONAL</p>
+
+ <p>This function is called whenever a test case (or configuration
+ function) fails. It is called after the post function is called
+ for the failed test case, that is:</p>
+
+ <list type="bulleted">
+ <item><p>If <c>init_per_suite</c> fails, this function is called after
+ <seealso marker="#Module:post_init_per_suite-4"><c>post_init_per_suite</c></seealso>.</p></item>
+ <item><p>If a test case fails, this funcion is called after
+ <seealso marker="#Module:post_end_per_testcase-4"><c>post_end_per_testcase</c></seealso>.</p></item>
+ </list>
+
+ <p>If the failed test case belongs to a test case group, the first
+ argument is a tuple <c>{FuncName,GroupName}</c>, otherwise only
+ the function name.</p>
+
+ <p>The data that comes with <c>Reason</c> follows the same format as
+ <seealso marker="event_handler_chapter#failreason"><c>FailReason</c></seealso>
+ in event
+ <seealso marker="event_handler_chapter#tc_done"><c>tc_done</c></seealso>.
+ For details, see section
+ <seealso marker="event_handler_chapter#events">Event Handling</seealso>
+ in the User's Guide.</p>
</desc>
</func>
<func>
- <name>Module:on_tc_skip(TestName, Reason, CTHState) -&gt;
- NewCTHState</name>
- <fsummary>Called after the CTH scope ends</fsummary>
+ <name>Module:on_tc_skip(TestName, Reason, CTHState) -&gt; NewCTHState</name>
+ <fsummary>Called after the CTH scope ends.</fsummary>
<type>
- <v>TestName = init_per_suite | end_per_suite |
- {init_per_group,GroupName} | {end_per_group,GroupName} |
- {FuncName,GroupName} | FuncName</v>
- <v>FuncName = atom()</v>
- <v>GroupName = atom()</v>
- <v>Reason = {tc_auto_skip | tc_user_skip, term()}</v>
- <v>CTHState = NewCTHState = term()</v>
+ <v>TestName = init_per_suite | end_per_suite | {init_per_group,GroupName} | {end_per_group,GroupName} | {FuncName,GroupName} | FuncName</v>
+ <v>FuncName = atom()</v>
+ <v>GroupName = atom()</v>
+ <v>Reason = {tc_auto_skip | tc_user_skip, term()}</v>
+ <v>CTHState = NewCTHState = term()</v>
</type>
-
<desc>
- <p> OPTIONAL </p>
-
- <p>This function is called whenever a test case (or config function)
- is skipped. It is called after the post function has been called
- for the skipped test case. I.e. if init_per_group is skipped, this
- function is called after
- <seealso marker="#Module:post_init_per_group-4">
- post_init_per_group</seealso>, and if a test case is skipped,
- it is called after
- <seealso marker="#Module:post_end_per_testcase-4">
- post_end_per_testcase</seealso>. If the skipped test case belongs to a
- test case group, the first argument is a tuple <c>{FuncName,GroupName}</c>,
- otherwise simply the function name.</p>
-
- <p>The data which comes with the Reason follows the same format as
- <seealso marker="event_handler_chapter#tc_auto_skip">tc_auto_skip
- </seealso> and <seealso marker="event_handler_chapter#tc_user_skip">
- tc_user_skip</seealso> events.
- See <seealso marker="event_handler_chapter#events">Event Handling
- </seealso> in the User's Guide for details.</p>
+ <p>OPTIONAL</p>
+
+ <p>This function is called whenever a test case (or configuration
+ function) is skipped. It is called after the post function is called
+ for the skipped test case, that is:</p>
+
+ <list type="bulleted">
+ <item><p>If <c>init_per_group</c> is skipped, this function is
+ called after
+ <seealso marker="#Module:post_init_per_group-4"><c>post_init_per_group</c></seealso>.</p></item>
+ <item><p>If a test case is skipped, this function is called after
+ <seealso marker="#Module:post_end_per_testcase-4"><c>post_end_per_testcase</c></seealso>.</p></item>
+ </list>
+
+ <p>If the skipped test case belongs to a test case group, the first
+ argument is a tuple <c>{FuncName,GroupName}</c>, otherwise only
+ the function name.</p>
+
+ <p>The data that comes with <c>Reason</c> follows the same format as
+ events
+ <seealso marker="event_handler_chapter#tc_auto_skip"><c>tc_auto_skip</c></seealso>
+ and
+ <seealso marker="event_handler_chapter#tc_user_skip"><c>tc_user_skip</c></seealso>
+ For details, see section
+ <seealso marker="event_handler_chapter#events">Event Handling</seealso>
+ in the User's Guide.</p>
</desc>
</func>
<func>
<name>Module:terminate(CTHState)</name>
- <fsummary>Called after the CTH scope ends</fsummary>
+ <fsummary>Called after the CTH scope ends.</fsummary>
<type>
- <v>CTHState = term()</v>
+ <v>CTHState = term()</v>
</type>
-
<desc>
- <p> OPTIONAL </p>
+ <p>OPTIONAL</p>
- <p>This function is called at the end of a CTH's
- <seealso marker="ct_hooks_chapter#scope">scope</seealso>.
- </p>
+ <p>This function is called at the end of a CTH
+ <seealso marker="ct_hooks_chapter#scope">scope</seealso>.</p>
</desc>
</func>
<func>
<name>Module:id(Opts) -&gt; Id</name>
- <fsummary>Called before the init function of a CTH</fsummary>
+ <fsummary>Called before the init function of a CTH.</fsummary>
<type>
- <v>Opts = term()</v>
- <v>Id = term()</v>
+ <v>Opts = term()</v>
+ <v>Id = term()</v>
</type>
-
<desc>
- <p> OPTIONAL </p>
-
- <p>The <c>Id</c> is used to uniquely identify a CTH instance,
- if two CTH's return the same <c>Id</c> the second CTH is ignored
- and subsequent calls to the CTH will only be made to the first
- instance. For more information see
- <seealso marker="ct_hooks_chapter#installing">Installing a CTH
- </seealso> in the User's Guide.
- </p>
-
- <p>This function should NOT have any side effects as it might
- be called multiple times by Common Test.</p>
+ <p>OPTIONAL</p>
- <p>If not implemented the CTH will act as if this function returned a
- call to <c>make_ref/0</c>.</p>
- </desc>
+ <p>The <c>Id</c> identifies a CTH instance uniquely. If two CTHs return
+ the same <c>Id</c>, the second CTH is ignored and subsequent calls to
+ the CTH are only made to the first instance. For details, see section
+ <seealso marker="ct_hooks_chapter#installing">Installing a CTH</seealso>
+ in the User's Guide.</p>
+
+ <p>This function is <em>not</em> to have any side effects, as it can
+ be called multiple times by <c>Common Test</c>.</p>
+
+ <p>If not implemented, the CTH acts as if this function returned a call
+ to <c>make_ref/0</c>.</p>
+ </desc>
</func>
-
</funcs>
</erlref>
diff --git a/lib/common_test/doc/src/ct_hooks_chapter.xml b/lib/common_test/doc/src/ct_hooks_chapter.xml
index 3905e23dcc..3eb1945a61 100644
--- a/lib/common_test/doc/src/ct_hooks_chapter.xml
+++ b/lib/common_test/doc/src/ct_hooks_chapter.xml
@@ -34,28 +34,28 @@
<marker id="general"></marker>
<title>General</title>
<p>
- The <em>Common Test Hook</em> (henceforth called CTH) framework allows
- extensions of the default behaviour of Common Test by means of hooks
- before and after all test suite calls. CTHs allow advanced Common Test
- users to abstract out behaviour which is common to multiple test suites
- without littering all test suites with library calls. Some example
- usages are: logging, starting and monitoring external systems,
- building C files needed by the tests and much more!</p>
-
- <p>In brief, Common Test Hooks allows you to:</p>
-
- <list>
- <item>Manipulate the runtime config before each suite
- configuration call</item>
- <item>Manipulate the return of all suite configuration calls and in
- extension the result of the test themselves.</item>
+ The <em>Common Test Hook (CTH)</em> framework allows
+ extensions of the default behavior of <c>Common Test</c> using hooks
+ before and after all test suite calls. CTHs allow advanced <c>Common Test</c>
+ users to abstract out behavior that is common to multiple test suites
+ without littering all test suites with library calls. this can be used
+ for logging, starting, and monitoring external systems,
+ building C files needed by the tests, and so on.</p>
+
+ <p>In brief, CTH allows you to do the following:</p>
+
+ <list type="bulleted">
+ <item>Manipulate the runtime configuration before each suite
+ configuration call.</item>
+ <item>Manipulate the return of all suite configuration calls, and in
+ extension, the result of the tests themselves.</item>
</list>
- <p>The following sections describe how to use CTHs, when they are run
- and how to manipulate your test results in a CTH</p>
+ <p>The following sections describe how to use CTHs, when they are run,
+ and how to manipulate the test results in a CTH.</p>
- <warning><p>When executing within a CTH all timetraps are shutoff. So
- if your CTH never returns, the entire test run will be stalled!</p>
+ <warning><p>When executing within a CTH, all timetraps are shut off. So
+ if your CTH never returns, the entire test run is stalled.</p>
</warning>
</section>
@@ -63,144 +63,148 @@
<section>
<marker id="installing"></marker>
<title>Installing a CTH</title>
- <p>There are multiple ways to install a CTH in your test run. You can do it
- for all tests in a run, for specific test suites and for specific groups
+ <p>A CTH can be installed in multiple ways in your test run. You can do it
+ for all tests in a run, for specific test suites, and for specific groups
within a test suite. If you want a CTH to be present in all test suites
- within your test run there are three different ways to accomplish that.
+ within your test run, there are three ways to accomplish that, as follows:
</p>
- <list>
+ <list type="bulleted">
<item>Add <c>-ct_hooks</c> as an argument to
<seealso marker="run_test_chapter#ct_run">ct_run</seealso>.
- To add multiple CTHs using this method append them to each other
- using the keyword <c>and</c>, i.e.
+ To add multiple CTHs using this method, append them to each other
+ using the keyword <c>and</c>, that is,
<c>ct_run -ct_hooks cth1 [{debug,true}] and cth2 ...</c>.</item>
- <item>Add the <c>ct_hooks</c> tag to your
+ <item>Add tag <c>ct_hooks</c> to your
<seealso marker="run_test_chapter#test_specifications">
- Test Specification</seealso></item>
- <item>Add the <c>ct_hooks</c> tag to your call to
- <seealso marker="ct#run_test-1">ct:run_test/1</seealso></item>
+ Test Specification</seealso>.</item>
+ <item>Add tag <c>ct_hooks</c> to your call to
+ <seealso marker="ct#run_test-1">ct:run_test/1</seealso>.</item>
</list>
- <p>You can also add CTHs within a test suite. This is done by returning
- <c>{ct_hooks,[CTH]}</c> in the config list from
+ <p>CTHs can also be added within a test suite. This is done by returning
+ <c>{ct_hooks,[CTH]}</c> in the configuration list from
<seealso marker="common_test#Module:suite-0">suite/0</seealso>,
<seealso marker="common_test#Module:init_per_suite-1">
- init_per_suite/1</seealso> or
+ init_per_suite/1</seealso>, or
<seealso marker="common_test#Module:init_per_group-2">
- init_per_group/2</seealso>. <c>CTH</c> in this case can be either
- only the module name of the CTH or a tuple with the module name and the
- initial arguments and optionally the hook priority of the CTH. Eg:
- <c>{ct_hooks,[my_cth_module]}</c> or
- <c>{ct_hooks,[{my_cth_module,[{debug,true}]}]}</c> or
- <c>{ct_hooks,[{my_cth_module,[{debug,true}],500}]}</c>
- </p>
+ init_per_group/2</seealso>.</p>
+
+ <p>In this case, <c>CTH</c> can either be only the module name of the CTH
+ or a tuple with the module name and the initial arguments, and optionally
+ the hook priority of the CTH. For example, one of the following:</p>
+ <list type="bulleted">
+ <item><c>{ct_hooks,[my_cth_module]}</c></item>
+ <item><c>{ct_hooks,[{my_cth_module,[{debug,true}]}]}</c></item>
+ <item><c>{ct_hooks,[{my_cth_module,[{debug,true}],500}]}</c></item>
+ </list>
<section>
<title>Overriding CTHs</title>
- <p>By default each installation of a CTH will cause a new instance of it
- to be activated. This can cause problems if you want to be able to
- override CTHs in test specifications while still having them in the
- suite info function. The
+ <p>By default, each installation of a CTH causes a new instance of it
+ to be activated. This can cause problems if you want to override
+ CTHs in test specifications while still having them in the
+ suite information function. The
<seealso marker="ct_hooks#Module:id-1">id/1</seealso>
callback exists to address this problem. By returning the same
- <c>id</c> in both places, Common Test knows that this CTH
- has already been installed and will not try to install it again.</p>
+ <c>id</c> in both places, <c>Common Test</c> knows that this CTH
+ is already installed and does not try to install it again.</p>
</section>
<section>
- <title>CTH Execution order</title>
- <p>By default each CTH installed will be executed in the order which
+ <title>CTH Execution Order</title>
+ <p>By default, each CTH installed is executed in the order that
they are installed for init calls, and then reversed for end calls.
- This is not always wanted so common_test allows
+ This is not always desired, so <c>Common Test</c> allows
the user to specify a priority for each hook. The priority can either
- be specified in the CTH <seealso marker="ct_hooks#Module:init-2">init/2
- </seealso> function or when installing the hook. The priority given at
- installation will override the priority returned by the CTH. </p>
+ be specified in the CTH function
+ <seealso marker="ct_hooks#Module:init-2">init/2</seealso> or when
+ installing the hook. The priority specified at installation overrides the
+ priority returned by the CTH.</p>
</section>
</section>
<section>
<marker id="scope"/>
<title>CTH Scope</title>
- <p>Once the CTH is installed into a certain test run it will be there until
+ <p>Once the CTH is installed into a certain test run it remains there until
its scope is expired. The scope of a CTH depends on when it is
- installed.
- The <seealso marker="ct_hooks#Module:init-2">init/2</seealso> is
- called at the beginning of the scope and the
- <seealso marker="ct_hooks#Module:terminate-1">terminate/1
- </seealso> function is called when the scope ends.</p>
+ installed, see the following table.
+ Function <seealso marker="ct_hooks#Module:init-2">init/2</seealso> is
+ called at the beginning of the scope and function
+ <seealso marker="ct_hooks#Module:terminate-1">terminate/1</seealso>
+ is called when the scope ends.</p>
<table>
<row>
- <cell><em>CTH Installed in</em></cell>
+ <cell><em>CTH installed in</em></cell>
<cell><em>CTH scope begins before</em></cell>
<cell><em>CTH scope ends after</em></cell>
</row>
<row>
<cell><seealso marker="run_test_chapter#ct_run">ct_run</seealso></cell>
- <cell>the first test suite is to be run.</cell>
- <cell>the last test suite has been run.</cell>
+ <cell>the first test suite is to be run</cell>
+ <cell>the last test suite has been run</cell>
</row>
<row>
<cell><seealso marker="ct#run_test-1">ct:run_test</seealso></cell>
- <cell>the first test suite is to be run.</cell>
- <cell>the last test suite has been run.</cell>
+ <cell>the first test suite is run</cell>
+ <cell>the last test suite has been run</cell>
</row>
<row>
<cell><seealso marker="run_test_chapter#test_specifications">
Test Specification</seealso></cell>
- <cell>the first test suite is to be run.</cell>
- <cell>the last test suite has been run.</cell>
+ <cell>the first test suite is run</cell>
+ <cell>the last test suite has been run</cell>
</row>
<row>
<cell><seealso marker="common_test#Module:suite-0">suite/0
</seealso></cell>
<cell><seealso marker="ct_hooks#Module:pre_init_per_suite-3">
- pre_init_per_suite/3</seealso> is called.</cell>
+ pre_init_per_suite/3</seealso> is called</cell>
<cell><seealso marker="ct_hooks#Module:post_end_per_suite-4">
- post_end_per_suite/4</seealso> has been called for that test suite.</cell>
+ post_end_per_suite/4</seealso> has been called for that test suite</cell>
</row>
<row>
<cell><seealso marker="common_test#Module:init_per_suite-1">
init_per_suite/1</seealso></cell>
<cell><seealso marker="ct_hooks#Module:post_init_per_suite-4">
- post_init_per_suite/4</seealso> is called.</cell>
+ post_init_per_suite/4</seealso> is called</cell>
<cell><seealso marker="ct_hooks#Module:post_end_per_suite-4">
- post_end_per_suite/4</seealso> has been called for that test suite.</cell>
+ post_end_per_suite/4</seealso> has been called for that test suite</cell>
</row>
<row>
<cell><seealso marker="common_test#Module:init_per_group-2">
init_per_group/2</seealso></cell>
<cell><seealso marker="ct_hooks#Module:post_init_per_group-4">
- post_init_per_group/4</seealso> is called.</cell>
+ post_init_per_group/4</seealso> is called</cell>
<cell><seealso marker="ct_hooks#Module:post_end_per_suite-4">
- post_end_per_group/4</seealso> has been called for that group.</cell>
+ post_end_per_group/4</seealso> has been called for that group</cell>
</row>
<tcaption>Scope of a CTH</tcaption>
</table>
<section>
<title>CTH Processes and Tables</title>
- <p>CTHs are run with the same process scoping as normal test suites
- i.e. a different process will execute the init_per_suite hooks then the
- init_per_group or per_testcase hooks. So if you want to spawn a
- process in the CTH you cannot link with the CTH process as it will exit
- after the post hook ends. Also if you for some reason need an ETS
- table with your CTH, you will have to spawn a process which handles
- it.</p>
+ <p>CTHs are run with the same process scoping as normal test suites,
+ that is, a different process executes the <c>init_per_suite</c> hooks then the
+ <c>init_per_group</c> or <c>per_testcase</c> hooks. So if you want to spawn a
+ process in the CTH, you cannot link with the CTH process, as it exits
+ after the post hook ends. Also, if you for some reason need an ETS
+ table with your CTH, you must spawn a process that handles it.</p>
</section>
<section>
- <title>External configuration data and Logging</title>
- <p>It's possible in the CTH to read configuration data values
- by calling <seealso marker="ct#get_config-1"><c>ct:get_config/1/2/3</c></seealso> (as explained in the
- <seealso marker="config_file_chapter#require_config_data">
- External configuration data</seealso>
- chapter). The config variables in question must, as always, first have been
- <c>required</c> by means of a suite-, group-, or test case info function,
- or the <seealso marker="ct#require-1"><c>ct:require/1/2</c></seealso> function. Note that the latter can also be used
- in CT hook functions.</p>
- <p>The CT hook functions may call any of the logging functions available
+ <title>External Configuration Data and Logging</title>
+ <p>Configuration data values in the CTH can be read
+ by calling
+ <seealso marker="ct#get_config-1"><c>ct:get_config/1,2,3</c></seealso>
+ (as explained in section
+ <seealso marker="config_file_chapter#require_config_data">Requiring and Reading Configuration Data</seealso>).
+ The configuration variables in question must, as always, first have been
+ required by a suite-, group-, or test case information function,
+ or by function <seealso marker="ct#require-1"><c>ct:require/1/2</c></seealso>.
+ The latter can also be used in CT hook functions.</p>
+ <p>The CT hook functions can call any logging function
in the <c>ct</c> interface to print information to the log files, or to
add comments in the suite overview page.
</p>
@@ -209,306 +213,327 @@
</section>
<section>
- <marker id="manipulating"/>
- <title>Manipulating tests</title>
- <p>It is through CTHs possible to manipulate the results of tests and
- configuration functions. The main purpose of doing this with CTHs is to
- allow common patterns to be abstracted out from test test suites and applied to
- multiple test suites without duplicating any code. All of the callback
- functions for a CTH follow a common interface, this interface is
- described below.</p>
-
- <p>Common Test will always call all available hook functions, even pre- and post
- hooks for configuration functions that are not implemented in the suite.
+ <marker id="manipulating"/>
+ <title>Manipulating Tests</title>
+ <p>Through CTHs the results of tests and configuration functions can be manipulated.
+ The main purpose to do this with CTHs is to allow common
+ patterns to be abstracted out from test suites and applied to
+ multiple test suites without duplicating any code. All the callback
+ functions for a CTH follow a common interface described hereafter.</p>
+
+ <p><c>Common Test</c> always calls all available hook functions, even pre-
+ and post hooks for configuration functions that are not implemented in the suite.
For example, <c>pre_init_per_suite(x_SUITE, ...)</c> and
- <c>post_init_per_suite(x_SUITE, ...)</c> will be called for test suite
- <c>x_SUITE</c>, even if it doesn't export <c>init_per_suite/1</c>. This feature
- makes it possible to use hooks as configuration fallbacks, or even
- completely replace all configuration functions with hook functions.</p>
+ <c>post_init_per_suite(x_SUITE, ...)</c> are called for test suite
+ <c>x_SUITE</c>, even if it does not export <c>init_per_suite/1</c>.
+ With this feature hooks can be used as configuration fallbacks, and all
+ configuration functions can be replaced with hook functions.</p>
<section>
<marker id="pre"/>
<title>Pre Hooks</title>
<p>
- It is possible in a CTH to hook in behaviour before
- <seealso marker="common_test#Module:init_per_suite-1">init_per_suite</seealso>,
- <seealso marker="common_test#Module:init_per_suite-1">init_per_group</seealso>,
- <seealso marker="common_test#Module:init_per_suite-1">init_per_testcase</seealso>,
- <seealso marker="common_test#Module:init_per_suite-1">end_per_group</seealso> and
- <seealso marker="common_test#Module:init_per_suite-1">end_per_suite</seealso>.
+ In a CTH, the behavior can be hooked in before the following functions:</p>
+
+ <list type="bulleted">
+ <item><seealso marker="common_test#Module:init_per_suite-1"><c>init_per_suite</c></seealso></item>
+ <item><seealso marker="common_test#Module:init_per_group-2"><c>init_per_group</c></seealso></item>
+ <item><seealso marker="common_test#Module:init_per_testcase-2"><c>init_per_testcase</c></seealso></item>
+ <item><seealso marker="common_test#Module:end_per_testcase-2"><c>end_per_testcase</c></seealso></item>
+ <item><seealso marker="common_test#Module:end_per_group-2"><c>end_per_group</c></seealso></item>
+ <item><seealso marker="common_test#Module:end_per_suite-1"><c>end_per_suite</c></seealso></item>
+ </list>
+
+ <p>
This is done in the CTH functions called pre_&lt;name of function&gt;.
- All of these functions take the same three arguments: <c>Name</c>,
- <c>Config</c> and <c>CTHState</c>. The return value of the CTH function
- is always a combination of an result for the suite/group/test and an
- updated <c>CTHState</c>. If you want the test suite to continue on
- executing you should return the config list which you want the test to
- use as the result. If you for some reason want to skip/fail the test,
- return a tuple with <c>skip</c> or <c>fail</c> and a reason as the
- result. Example:
- </p>
- <code>pre_init_per_suite(SuiteName, Config, CTHState) -&gt;
- case db:connect() of
- {error,_Reason} -&gt;
- {{fail, "Could not connect to DB"}, CTHState};
- {ok, Handle} -&gt;
- {[{db_handle, Handle} | Config], CTHState#state{ handle = Handle }}
- end.</code>
- <note><p>If using multiple CTHs, the first part of the return tuple will be
- used as input for the next CTH. So in the case above the next CTH might
+ These functions take the same three arguments, <c>Name</c>,
+ <c>Config</c>, and <c>CTHState</c>. The return value of the CTH function
+ is always a combination of a result for the suite/group/test and an
+ updated <c>CTHState</c>.</p>
+
+ <p>To let the test suite continue on executing, return the configuration
+ list that you want the test to use as the result. To skip or
+ fail the test, return a tuple with <c>skip</c> or <c>fail</c>, and a reason
+ as the result.</p>
+
+ <p><em>Example:</em></p>
+ <code>
+ pre_init_per_suite(SuiteName, Config, CTHState) -&gt;
+ case db:connect() of
+ {error,_Reason} -&gt;
+ {{fail, "Could not connect to DB"}, CTHState};
+ {ok, Handle} -&gt;
+ {[{db_handle, Handle} | Config], CTHState#state{ handle = Handle }}
+ end.</code>
+
+ <note><p>If you use multiple CTHs, the first part of the return tuple is
+ used as input for the next CTH. So in the previous example the next CTH can
get <c>{fail,Reason}</c> as the second parameter. If you have many CTHs
- which interact, it might be a good idea to not let each CTH return
- <c>fail</c> or <c>skip</c>. Instead return that an action should be taken
- through the <c>Config</c> list and implement a CTH which at the end takes
- the correct action.</p></note>
+ interacting, do not let each CTH return <c>fail</c> or <c>skip</c>.
+ Instead, return that an action is to be taken through the <c>Config</c>
+ list and implement a CTH that, at the end, takes the correct action.</p></note>
</section>
<section>
<marker id="post"/>
<title>Post Hooks</title>
- <p>It is also possible in a CTH to hook in behaviour after
- <seealso marker="common_test#Module:init_per_suite-1">init_per_suite</seealso>,
- <seealso marker="common_test#Module:init_per_suite-1">init_per_group</seealso>,
- <seealso marker="common_test#Module:init_per_suite-1">end_per_testcase</seealso>,
- <seealso marker="common_test#Module:init_per_suite-1">end_per_group</seealso> and
- <seealso marker="common_test#Module:init_per_suite-1">end_per_suite</seealso>.
- This is done in the CTH functions called post_&lt;name of function&gt;.
- All of these function take the same four arguments: <c>Name</c>,
- <c>Config</c>, <c>Return</c> and <c>CTHState</c>. <c>Config</c> in this
+ <p>In a CTH, behavior can be hooked in after the following functions:</p>
+ <list type="bulleted">
+ <item><seealso marker="common_test#Module:init_per_suite-1"><c>init_per_suite</c></seealso></item>
+ <item><seealso marker="common_test#Module:init_per_group-2"><c>init_per_group</c></seealso></item>
+ <item><seealso marker="common_test#Module:init_per_testcase-2"><c>init_per_testcase</c></seealso></item>
+ <item><seealso marker="common_test#Module:end_per_testcase-2"><c>end_per_testcase</c></seealso></item>
+ <item><seealso marker="common_test#Module:end_per_group-2"><c>end_per_group</c></seealso></item>
+ <item><seealso marker="common_test#Module:end_per_suite-1"><c>end_per_suite</c></seealso></item>
+ </list>
+
+ <p>
+ This is done in the CTH functions called <c>post_&lt;name of function&gt;</c>.
+ These functions take the same four arguments, <c>Name</c>,
+ <c>Config</c>, <c>Return</c>, and <c>CTHState</c>. <c>Config</c> in this
case is the same <c>Config</c> as the testcase is called with.
<c>Return</c> is the value returned by the testcase. If the testcase
- failed by crashing, <c>Return</c> will be
+ fails by crashing, <c>Return</c> is
<c>{'EXIT',{{Error,Reason},Stacktrace}}</c>.</p>
- <p>The return value of the CTH function is always a combination of an
+ <p>The return value of the CTH function is always a combination of a
result for the suite/group/test and an updated <c>CTHState</c>. If
- you want the callback to not affect the outcome of the test you should
+ you do not want the callback to affect the outcome of the test,
return the <c>Return</c> data as it is given to the CTH. You can also
- modify the result of the test. By returning the <c>Config</c> list
- with the <c>tc_status</c> element removed you can recover from a test
+ modify the test result. By returning the <c>Config</c> list
+ with element <c>tc_status</c> removed, you can recover from a test
failure. As in all the pre hooks, it is also possible to fail/skip
- the test case in the post hook. Example: </p>
-
- <code>post_end_per_testcase(_TC, Config, {'EXIT',{_,_}}, CTHState) -&gt;
- case db:check_consistency() of
- true ->
- %% DB is good, pass the test.
- {proplists:delete(tc_status, Config), CTHState};
- false ->
- %% DB is not good, mark as skipped instead of failing
- {{skip, "DB is inconsisten!"}, CTHState}
- end;
-post_end_per_testcase(_TC, Config, Return, CTHState) -&gt;
- %% Do nothing if tc does not crash.
- {Return, CTHState}.</code>
-
- <note><p>Recovering from a testcase failure using CTHs should only be done as
- a last resort. If used wrongly it could become very difficult to
- determine which tests pass or fail in a test run</p></note>
+ the test case in the post hook.</p>
+
+ <p><em>Example:</em></p>
+ <code>
+ post_end_per_testcase(_TC, Config, {'EXIT',{_,_}}, CTHState) -&gt;
+ case db:check_consistency() of
+ true ->
+ %% DB is good, pass the test.
+ {proplists:delete(tc_status, Config), CTHState};
+ false ->
+ %% DB is not good, mark as skipped instead of failing
+ {{skip, "DB is inconsisten!"}, CTHState}
+ end;
+ post_end_per_testcase(_TC, Config, Return, CTHState) -&gt;
+ %% Do nothing if tc does not crash.
+ {Return, CTHState}.</code>
+
+ <note><p>Do recover from a testcase failure using CTHs only a last resort.
+ If used wrongly, it can be very difficult to determine which tests that
+ pass or fail in a test run.</p></note>
</section>
<section>
- <marker id="skip_n_fail"/>
- <title>Skip and Fail hooks</title>
+ <title>Skip and Fail Hooks</title>
<p>
After any post hook has been executed for all installed CTHs,
<seealso marker="ct_hooks#Module:on_tc_fail-3">on_tc_fail</seealso>
- or <seealso marker="ct_hooks#Module:on_tc_fail-3">on_tc_skip</seealso>
- might be called if the testcase failed or was skipped
- respectively. You cannot affect the outcome of the tests any further at
- this point.
+ or <seealso marker="ct_hooks#Module:on_tc_skip-3">on_tc_skip</seealso>
+ is called if the testcase failed or was skipped, respectively.
+ You cannot affect the outcome of the tests any further at this point.
</p>
</section>
</section>
<section>
- <marker id="synchronizing"/>
- <title>Synchronizing external user applications with Common Test</title>
+ <marker id="synchronizing"/>
+ <title>Synchronizing External User Applications with Common Test</title>
<p>CTHs can be used to synchronize test runs with external user applications.
- The init function may e.g. start and/or communicate with an application that
- has the purpose of preparing the SUT for an upcoming test run, or maybe
+ The init function can, for example, start and/or communicate with an application that
+ has the purpose of preparing the SUT for an upcoming test run, or
initialize a database for saving test data to during the test run. The
- terminate function may similarly order such an application to reset the SUT
+ terminate function can similarly order such an application to reset the SUT
after the test run, and/or tell the application to finish active sessions
and terminate.
Any system error- or progress reports generated during the init- or
- termination stage will be saved in the
- <seealso marker="run_test_chapter#pre_post_test_io_log">Pre-
- and post test I/O log</seealso>. (This is also true for any printouts made
+ termination stage are saved in the
+ <seealso marker="run_test_chapter#pre_post_test_io_log">Pre- and Post Test I/O Log</seealso>.
+ (This is also true for any printouts made
with <c>ct:log/2</c> and <c>ct:pal/2</c>).</p>
- <p>In order to ensure that Common Test doesn't start executing tests, or
+
+ <p>To ensure that <c>Common Test</c> does not start executing tests, or
closes its log files and shuts down, before the external application
- is ready for it, Common Test may be synchronized with the application.
- During startup and shutdown, Common Test can be suspended, simply by
+ is ready for it, <c>Common Test</c> can be synchronized with the application.
+ During startup and shutdown, <c>Common Test</c> can be suspended, simply by
having a CTH evaluate a <c>receive</c> expression in the init- or terminate
function. The macros <c>?CT_HOOK_INIT_PROCESS</c> (the process executing the hook
init function) and <c>?CT_HOOK_TERMINATE_PROCESS</c> (the process executing
- the hook terminate function), each specifies the name of the correct Common Test
- process to send a message to in order to return from the <c>receive</c>.
+ the hook terminate function) each specifies the name of the correct <c>Common Test</c>
+ process to send a message to. This is done to return from the <c>receive</c>.
These macros are defined in <c>ct.hrl</c>.
</p>
</section>
<section>
- <marker id="example"/>
+ <marker id="example"/>
<title>Example CTH</title>
- <p>The CTH below will log information about a test run into a format
- parseable by <seealso marker="kernel:file#consult-1">file:consult/1</seealso>.
+ <p>The following CTH logs information about a test run into a format
+ parseable by <seealso marker="kernel:file#consult-1">file:consult/1</seealso>
+ (in <c>Kernel</c>):
</p>
- <code>%%% @doc Common Test Example Common Test Hook module.
--module(example_cth).
-
-%% Callbacks
--export([id/1]).
--export([init/2]).
-
--export([pre_init_per_suite/3]).
--export([post_init_per_suite/4]).
--export([pre_end_per_suite/3]).
--export([post_end_per_suite/4]).
-
--export([pre_init_per_group/3]).
--export([post_init_per_group/4]).
--export([pre_end_per_group/3]).
--export([post_end_per_group/4]).
-
--export([pre_init_per_testcase/3]).
--export([post_end_per_testcase/4]).
-
--export([on_tc_fail/3]).
--export([on_tc_skip/3]).
-
--export([terminate/1]).
-
--record(state, { file_handle, total, suite_total, ts, tcs, data }).
-
-%% @doc Return a unique id for this CTH.
-id(Opts) ->
- proplists:get_value(filename, Opts, "/tmp/file.log").
-
-%% @doc Always called before any other callback function. Use this to initiate
-%% any common state.
-init(Id, Opts) ->
- {ok,D} = file:open(Id,[write]),
- {ok, #state{ file_handle = D, total = 0, data = [] }}.
-
-%% @doc Called before init_per_suite is called.
-pre_init_per_suite(Suite,Config,State) ->
- {Config, State#state{ suite_total = 0, tcs = [] }}.
-
-%% @doc Called after init_per_suite.
-post_init_per_suite(Suite,Config,Return,State) ->
- {Return, State}.
-
-%% @doc Called before end_per_suite.
-pre_end_per_suite(Suite,Config,State) ->
- {Config, State}.
-
-%% @doc Called after end_per_suite.
-post_end_per_suite(Suite,Config,Return,State) ->
- Data = {suites, Suite, State#state.suite_total, lists:reverse(State#state.tcs)},
- {Return, State#state{ data = [Data | State#state.data] ,
- total = State#state.total + State#state.suite_total } }.
-
-%% @doc Called before each init_per_group.
-pre_init_per_group(Group,Config,State) ->
- {Config, State}.
-
-%% @doc Called after each init_per_group.
-post_init_per_group(Group,Config,Return,State) ->
- {Return, State}.
-
-%% @doc Called after each end_per_group.
-pre_end_per_group(Group,Config,State) ->
- {Config, State}.
-
-%% @doc Called after each end_per_group.
-post_end_per_group(Group,Config,Return,State) ->
- {Return, State}.
-
-%% @doc Called before each test case.
-pre_init_per_testcase(TC,Config,State) ->
- {Config, State#state{ ts = now(), total = State#state.suite_total + 1 } }.
-
-%% @doc Called after each test case.
-post_end_per_testcase(TC,Config,Return,State) ->
- TCInfo = {testcase, TC, Return, timer:now_diff(now(), State#state.ts)},
- {Return, State#state{ ts = undefined, tcs = [TCInfo | State#state.tcs] } }.
-
-%% @doc Called after post_init_per_suite, post_end_per_suite, post_init_per_group,
-%% post_end_per_group and post_end_per_testcase if the suite, group or test case failed.
-on_tc_fail(TC, Reason, State) ->
- State.
-
-%% @doc Called when a test case is skipped by either user action
-%% or due to an init function failing.
-on_tc_skip(TC, Reason, State) ->
- State.
-
-%% @doc Called when the scope of the CTH is done
-terminate(State) ->
- io:format(State#state.file_handle, "~p.~n",
- [{test_run, State#state.total, State#state.data}]),
- file:close(State#state.file_handle),
- ok.</code>
+ <code>
+ %%% @doc Common Test Example Common Test Hook module.
+ -module(example_cth).
+
+ %% Callbacks
+ -export([id/1]).
+ -export([init/2]).
+
+ -export([pre_init_per_suite/3]).
+ -export([post_init_per_suite/4]).
+ -export([pre_end_per_suite/3]).
+ -export([post_end_per_suite/4]).
+
+ -export([pre_init_per_group/3]).
+ -export([post_init_per_group/4]).
+ -export([pre_end_per_group/3]).
+ -export([post_end_per_group/4]).
+
+ -export([pre_init_per_testcase/3]).
+ -export([post_init_per_testcase/4]).
+ -export([pre_end_per_testcase/3]).
+ -export([post_end_per_testcase/4]).
+
+ -export([on_tc_fail/3]).
+ -export([on_tc_skip/3]).
+
+ -export([terminate/1]).
+
+ -record(state, { file_handle, total, suite_total, ts, tcs, data }).
+
+ %% @doc Return a unique id for this CTH.
+ id(Opts) ->
+ proplists:get_value(filename, Opts, "/tmp/file.log").
+
+ %% @doc Always called before any other callback function. Use this to initiate
+ %% any common state.
+ init(Id, Opts) ->
+ {ok,D} = file:open(Id,[write]),
+ {ok, #state{ file_handle = D, total = 0, data = [] }}.
+
+ %% @doc Called before init_per_suite is called.
+ pre_init_per_suite(Suite,Config,State) ->
+ {Config, State#state{ suite_total = 0, tcs = [] }}.
+
+ %% @doc Called after init_per_suite.
+ post_init_per_suite(Suite,Config,Return,State) ->
+ {Return, State}.
+
+ %% @doc Called before end_per_suite.
+ pre_end_per_suite(Suite,Config,State) ->
+ {Config, State}.
+
+ %% @doc Called after end_per_suite.
+ post_end_per_suite(Suite,Config,Return,State) ->
+ Data = {suites, Suite, State#state.suite_total, lists:reverse(State#state.tcs)},
+ {Return, State#state{ data = [Data | State#state.data] ,
+ total = State#state.total + State#state.suite_total } }.
+
+ %% @doc Called before each init_per_group.
+ pre_init_per_group(Group,Config,State) ->
+ {Config, State}.
+
+ %% @doc Called after each init_per_group.
+ post_init_per_group(Group,Config,Return,State) ->
+ {Return, State}.
+
+ %% @doc Called before each end_per_group.
+ pre_end_per_group(Group,Config,State) ->
+ {Config, State}.
+
+ %% @doc Called after each end_per_group.
+ post_end_per_group(Group,Config,Return,State) ->
+ {Return, State}.
+
+ %% @doc Called before each init_per_testcase.
+ pre_init_per_testcase(TC,Config,State) ->
+ {Config, State#state{ ts = now(), total = State#state.suite_total + 1 } }.
+
+ %% Called after each init_per_testcase (immediately before the test case).
+ post_init_per_testcase(TC,Config,Return,State) ->
+ {Return, State}
+
+%% @doc Called before each end_per_testcase (immediately after the test case).
+ pre_end_per_testcase(TC,Config,State) ->
+ {Config, State}.
+
+ %% @doc Called after each end_per_testcase.
+ post_end_per_testcase(TC,Config,Return,State) ->
+ TCInfo = {testcase, TC, Return, timer:now_diff(now(), State#state.ts)},
+ {Return, State#state{ ts = undefined, tcs = [TCInfo | State#state.tcs] } }.
+
+ %% @doc Called after post_init_per_suite, post_end_per_suite, post_init_per_group,
+ %% post_end_per_group and post_end_per_testcase if the suite, group or test case failed.
+ on_tc_fail(TC, Reason, State) ->
+ State.
+
+ %% @doc Called when a test case is skipped by either user action
+ %% or due to an init function failing.
+ on_tc_skip(TC, Reason, State) ->
+ State.
+
+ %% @doc Called when the scope of the CTH is done
+ terminate(State) ->
+ io:format(State#state.file_handle, "~p.~n",
+ [{test_run, State#state.total, State#state.data}]),
+ file:close(State#state.file_handle),
+ ok.</code>
</section>
<section>
- <marker id="builtin_cths"/>
- <title>Built-in CTHs</title>
- <p>Common Test is delivered with a couple of general purpose CTHs that
- can be enabled by the user to provide some generic testing functionality.
- Some of these are enabled by default when starting running common_test,
- they can be disabled by setting <c>enable_builtin_hooks</c> to
- <c>false</c> on the command line or in the test specification. In the
- table below there is a list of all current CTHs which are delivered with
- Common Test.</p>
-
- <table>
- <row>
- <cell align="left"><em>CTH Name</em></cell>
- <cell align="left"><em>Is Built-in</em></cell>
- <cell align="left"><em>Description</em></cell>
- </row>
- <row>
- <cell align="left">cth_log_redirect</cell>
- <cell align="left">yes</cell>
- <cell align="left">Captures all error_logger and SASL logging events and prints them
- to the current test case log. If an event can not be associated with a
- testcase it will be printed in the common test framework log. This will
- happen for testcases which are run in parallel and events which occur
- inbetween testcases. You can configure the level of
- <seealso marker="sasl:sasl_app">SASL</seealso> events report
- using the normal SASL mechanisms. </cell>
- </row>
- <row>
- <cell align="left">cth_surefire</cell>
- <cell align="left">no</cell>
- <cell align="left"><p>Captures all test results and outputs them as surefire
- XML into a file. The file which is created is by default
- called junit_report.xml. The file name can be changed by
- setting the <c>path</c> option for this hook, e.g.</p>
-
- <code>-ct_hooks cth_surefire [{path,"/tmp/report.xml"}]</code>
-
- <p>If the <c>url_base</c> option is set, an additional
- attribute named <c>url</c> will be added to each
- <c>testsuite</c> and <c>testcase</c> XML element. The value will
- be constructed from the <c>url_base</c> and a relative path
- to the test suite or test case log respectively, e.g.</p>
-
- <code>-ct_hooks cth_surefire [{url_base, "http://myserver.com/"}]</code>
- <p>will give a url attribute value similar to</p>
-
- <code>"http://myserver.com/[email protected]_11.19.39/
-x86_64-unknown-linux-gnu.my_test.logs/run.2012-12-12_11.19.39/suite.log.html"</code>
-
- <p>Surefire XML can for instance be used by Jenkins to display test
- results.</p></cell>
- </row>
- </table>
+ <marker id="builtin_cths"/>
+ <title>Built-In CTHs</title>
+ <p><c>Common Test</c> is delivered with some general-purpose CTHs that
+ can be enabled by the user to provide generic testing functionality.
+ Some of these CTHs are enabled by default when <c>common_test</c> is started to run.
+ They can be disabled by setting <c>enable_builtin_hooks</c> to
+ <c>false</c> on the command line or in the test specification. The following
+ two CTHs are delivered with <c>Common Test</c>:</p>
+
+ <taglist>
+ <tag><c>cth_log_redirect</c></tag>
+ <item>
+ <p>Built-in</p>
+ <p>Captures all <c>error_logger</c> and <c>SASL</c> logging
+ events and prints them to the current test case log. If an event cannot be
+ associated with a test case, it is printed in the <c>Common Test</c> framework log.
+ This happens for test cases running in parallel and events occuring
+ in-between test cases. You can configure the level of
+ <seealso marker="sasl:sasl_app"><c>SASL</c></seealso> events report
+ using the normal <c>SASL</c> mechanisms.</p>
+ </item>
+ <tag><c>cth_surefire</c></tag>
+ <item>
+ <p>Not built-in</p>
+ <p>Captures all test results and outputs them as surefire
+ XML into a file. The created file is by default
+ called <c>junit_report.xml</c>. The file name can be changed by
+ setting option <c>path</c> for this hook, for example:</p>
+
+ <p><c>-ct_hooks cth_surefire [{path,"/tmp/report.xml"}]</c></p>
+
+ <p>If option <c>url_base</c> is set, an extra
+ attribute named <c>url</c> is added to each
+ <c>testsuite</c> and <c>testcase</c> XML element. The value
+ is constructed from <c>url_base</c> and a relative path
+ to the test suite or test case log, respectively, for example:</p>
+
+ <p><c>-ct_hooks cth_surefire [{url_base, "http://myserver.com/"}]</c></p>
+
+ <p>gives an URL attribute value similar to</p>
+
+ <p><c>"http://myserver.com/[email protected]_11.19.39/
+x86_64-unknown-linux-gnu.my_test.logs/run.2012-12-12_11.19.39/suite.log.html"</c></p>
+
+ <p>Surefire XML can, for example, be used by Jenkins to display test
+ results.</p>
+ </item>
+ </taglist>
</section>
diff --git a/lib/common_test/doc/src/ct_master.xml b/lib/common_test/doc/src/ct_master.xml
new file mode 100644
index 0000000000..06f9b04f1b
--- /dev/null
+++ b/lib/common_test/doc/src/ct_master.xml
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2010</year><year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>ct_master</title>
+ <prepared></prepared>
+ <responsible></responsible>
+ <docno></docno>
+ <approved></approved>
+ <checked></checked>
+ <date></date>
+ <rev>A</rev>
+ <file>ct_master.xml</file>
+ </header>
+ <module>ct_master</module>
+ <modulesummary>Distributed test execution control for Common Test.</modulesummary>
+
+<description>
+
+ <p>Distributed test execution control for <c>Common Test</c>.</p>
+
+ <p>This module exports functions for running <c>Common Test</c> nodes on
+ multiple hosts in parallel.</p>
+
+</description>
+
+ <funcs>
+ <func>
+ <name>abort() -&gt; ok</name>
+ <fsummary>Stops all running tests.</fsummary>
+ <desc><marker id="abort-0"/>
+ <p>Stops all running tests.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>abort(Nodes) -&gt; ok</name>
+ <fsummary>Stops tests on specified nodes.</fsummary>
+ <type>
+ <v>Nodes = atom() | [atom()]</v>
+ </type>
+ <desc><marker id="abort-1"/>
+ <p>Stops tests on specified nodes.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>basic_html(Bool) -&gt; ok</name>
+ <fsummary>If set to true, the ct_master logs are written on a primitive
+ HTML format, not using the <c>Common Test</c> CSS style sheet.</fsummary>
+ <type>
+ <v>Bool = true | false</v>
+ </type>
+ <desc><marker id="basic_html-1"/>
+ <p>If set to <c>true</c>, the <c>ct_master logs</c> are written on a
+ primitive HTML format, not using the <c>Common Test</c> CSS style
+ sheet.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_event_mgr_ref() -&gt; MasterEvMgrRef</name>
+ <fsummary>Gets a reference to the <c>Common Test</c> master event
+ manager.</fsummary>
+ <type>
+ <v>MasterEvMgrRef = atom()</v>
+ </type>
+ <desc><marker id="get_event_mgr_ref-0"/>
+ <p>Gets a reference to the <c>Common Test</c> master event manager.
+ The reference can be used to, for example, add a user-specific
+ event handler while tests are running.</p>
+
+ <p><em>Example:</em></p>
+
+ <pre>
+ gen_event:add_handler(ct_master:get_event_mgr_ref(), my_ev_h, [])</pre>
+ </desc>
+ </func>
+
+ <func>
+ <name>progress() -&gt; [{Node, Status}]</name>
+ <fsummary>Returns test progress.</fsummary>
+ <type>
+ <v>Node = atom()</v>
+ <v>Status = finished_ok | ongoing | aborted | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="progress-0"/>
+ <p>Returns test progress. If <c>Status</c> is <c>ongoing</c>, tests
+ are running on the node and are not yet finished.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>run(TestSpecs) -&gt; ok</name>
+ <fsummary>Equivalent to run(TestSpecs, false, [], []).</fsummary>
+ <type>
+ <v>TestSpecs = string() | [SeparateOrMerged]</v>
+ </type>
+ <desc><marker id="run-1"/>
+ <p>Equivalent to <seealso marker="#run-4"><c>ct_master:run(TestSpecs,
+ false, [], [])</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>run(TestSpecs, InclNodes, ExclNodes) -&gt; ok</name>
+ <fsummary>Equivalent to run(TestSpecs, false, InclNodes, ExclNodes).
+ </fsummary>
+ <type>
+ <v>TestSpecs = string() | [SeparateOrMerged]</v>
+ <v>SeparateOrMerged = string() | [string()]</v>
+ <v>InclNodes = [atom()]</v>
+ <v>ExclNodes = [atom()]</v>
+ </type>
+ <desc><marker id="run-3"/>
+ <p>Equivalent to <seealso marker="#run-4"><c>ct_master:run(TestSpecs,
+ false, InclNodes, ExclNodes)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>run(TestSpecs, AllowUserTerms, InclNodes, ExclNodes) -&gt; ok</name>
+ <fsummary>Tests are spawned on the nodes as specified in TestSpecs.
+ </fsummary>
+ <type>
+ <v>TestSpecs = string() | [SeparateOrMerged]</v>
+ <v>SeparateOrMerged = string() | [string()]</v>
+ <v>AllowUserTerms = bool()</v>
+ <v>InclNodes = [atom()]</v>
+ <v>ExclNodes = [atom()]</v>
+ </type>
+ <desc><marker id="run-4"/>
+ <p>Tests are spawned on the nodes as specified in <c>TestSpecs</c>.
+ Each specification in <c>TestSpec</c> is handled separately.
+ However, it is also possible to specify a list of specifications to
+ be merged into one specification before the tests are executed. Any
+ test without a particular node specification is also executed on
+ the nodes in <c>InclNodes</c>. Nodes in the <c>ExclNodes</c> list
+ are excluded from the test.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>run_on_node(TestSpecs, Node) -&gt; ok</name>
+ <fsummary>Equivalent to run_on_node(TestSpecs, false, Node).</fsummary>
+ <type>
+ <v>TestSpecs = string() | [SeparateOrMerged]</v>
+ <v>SeparateOrMerged = string() | [string()]</v>
+ <v>Node = atom()</v>
+ </type>
+ <desc><marker id="run_on_node-2"/>
+ <p>Equivalent to
+ <seealso marker="#run_on_node-3"><c>ct_master:run_on_node(TestSpecs,
+ false, Node)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>run_on_node(TestSpecs, AllowUserTerms, Node) -&gt; ok</name>
+ <fsummary>Tests are spawned on Node according to TestSpecs.</fsummary>
+ <type>
+ <v>TestSpecs = string() | [SeparateOrMerged]</v>
+ <v>SeparateOrMerged = string() | [string()]</v>
+ <v>AllowUserTerms = bool()</v>
+ <v>Node = atom()</v>
+ </type>
+ <desc><marker id="run_on_node-3"/>
+ <p>Tests are spawned on <c>Node</c> according to <c>TestSpecs</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>run_test(Node, Opts) -&gt; ok</name>
+ <fsummary>Tests are spawned on Node using ct:run_test/1.</fsummary>
+ <type>
+ <v>Node = atom()</v>
+ <v>Opts = [OptTuples]</v>
+ <v>OptTuples = {config, CfgFiles} | {dir, TestDirs} | {suite, Suites} | {testcase, Cases} | {spec, TestSpecs} | {allow_user_terms, Bool} | {logdir, LogDir} | {event_handler, EventHandlers} | {silent_connections, Conns} | {cover, CoverSpecFile} | {cover_stop, Bool} | {userconfig, UserCfgFiles}</v>
+ <v>CfgFiles = string() | [string()]</v>
+ <v>TestDirs = string() | [string()]</v>
+ <v>Suites = atom() | [atom()]</v>
+ <v>Cases = atom() | [atom()]</v>
+ <v>TestSpecs = string() | [string()]</v>
+ <v>LogDir = string()</v>
+ <v>EventHandlers = EH | [EH]</v>
+ <v>EH = atom() | {atom(), InitArgs} | {[atom()], InitArgs}</v>
+ <v>InitArgs = [term()]</v>
+ <v>Conns = all | [atom()]</v>
+ </type>
+ <desc><marker id="run_test-2"/>
+ <p>Tests are spawned on <c>Node</c> using
+ <seealso marker="ct:run_test-1"><c>ct:run_test/1</c></seealso></p>
+ </desc>
+ </func>
+ </funcs>
+
+</erlref>
+
+
diff --git a/lib/common_test/doc/src/ct_master_chapter.xml b/lib/common_test/doc/src/ct_master_chapter.xml
index 16492f39b8..99555164e0 100644
--- a/lib/common_test/doc/src/ct_master_chapter.xml
+++ b/lib/common_test/doc/src/ct_master_chapter.xml
@@ -22,7 +22,7 @@
</legalnotice>
- <title>Using Common Test for Large Scale Testing</title>
+ <title>Using Common Test for Large-Scale Testing</title>
<prepared>Peter Andersson</prepared>
<docno></docno>
<date></date>
@@ -33,217 +33,220 @@
<section>
<marker id="general"></marker>
<title>General</title>
- <p>Large scale automated testing requires running multiple independent
+ <p>Large-scale automated testing requires running multiple independent
test sessions in parallel. This is accomplished by running
- a number of Common Test nodes on one or more hosts, testing
- different target systems. Configuring, starting and controlling the
+ some <c>Common Test</c> nodes on one or more hosts, testing
+ different target systems. Configuring, starting, and controlling the
test nodes independently can be a cumbersome operation. To aid
- this kind of automated large scale testing, CT offers a master test
- node component, CT Master, that handles central configuration and control
- in a system of distributed CT nodes.</p>
+ this kind of automated large-scale testing, <c>Common Test</c> offers a master
+ test node component, <c>Common Test</c> Master, which handles central configuration and control
+ in a system of distributed <c>Common Test</c> nodes.</p>
- <p>The CT Master server runs on one dedicated Erlang node and uses distributed
- Erlang to communicate with any number of CT test nodes, each hosting a regular
- CT server. Test specifications are used as input to specify what to test on which
+ <p>The <c>Common Test</c> Master server runs on one dedicated Erlang node and uses distributed
+ Erlang to communicate with any number of <c>Common Test</c> test nodes, each hosting a regular
+ <c>Common Test</c> server. Test specifications are used as input to specify what to test on which
test nodes, using what configuration.</p>
- <p>The CT Master server writes progress information to HTML log files similarly
- to the regular CT server. The logs contain test statistics and links to the
- log files written by each independent CT server.</p>
+ <p>The <c>Common Test</c> Master server writes progress information to HTML log files similarly
+ to the regular <c>Common Test</c> server. The logs contain test statistics and links to the
+ log files written by each independent <c>Common Test</c> server.</p>
- <p>The CT master API is exported by the <c>ct_master</c> module.</p>
+ <p>The <c>Common Test</c> Master API is exported by module
+ <seealso marker="ct_master"><c>ct_master</c></seealso>.</p>
</section>
<section>
- <title>Usage</title>
- <p>CT Master requires all test nodes to be on the same network and share a common
- file system. As of this date, CT Master can not start test nodes
- automatically. The nodes must have been started in advance for CT Master to be
+ <title>Use</title>
+ <p><c>Common Test</c> Master requires all test nodes to be on the same network and share a common
+ file system. <c>Common Test</c> Master cannot start test nodes
+ automatically. The nodes must be started in advance for <c>Common Test</c> Master to be
able to start test sessions on them.</p>
- <p>Tests are started by calling:</p>
-
- <p><c>ct_master:run(TestSpecs)</c> or
- <c>ct_master:run(TestSpecs, InclNodes, ExclNodes)</c></p>
+ <p>Tests are started by calling
+ <seealso marker="ct_master#run-1"><c>ct_master:run(TestSpecs)</c></seealso> or
+ <seealso marker="ct_master#run-3"><c>ct_master:run(TestSpecs, InclNodes, ExclNodes)</c></seealso></p>
<p><c>TestSpecs</c> is either the name of a test specification file (string) or a list
- of test specifications. In case of a list, the specifications will be handled (and
+ of test specifications. If it is a list, the specifications are handled (and
the corresponding tests executed) in sequence. An element in a <c>TestSpecs</c> list
- can also be list of test specifications. The specifications in such a list will be
- merged into one combined specification prior to test execution. For example:</p>
-
- <p><c>ct_master:run(["ts1","ts2",["ts3","ts4"]])</c></p>
+ can also be list of test specifications. The specifications in such a list are
+ merged into one combined specification before test execution.</p>
- <p>means first the tests specified by "ts1" will run, then the tests specified by "ts2"
+ <p><em>Example:</em></p>
+ <pre>
+ ct_master:run(["ts1","ts2",["ts3","ts4"]])</pre>
+
+ <p>Here, the tests specified by "ts1" run first, then the tests specified by "ts2",
and finally the tests specified by both "ts3" and "ts4".</p>
- <p>The <c>InclNodes</c> argument to <c>run/3</c> is a list of node names. The <c>run/3</c>
- function runs the tests in <c>TestSpecs</c> just like <c>run/1</c> but will also
- take any test in <c>TestSpecs</c> that's not explicitly tagged with a particular
- node name and execute it on the nodes listed in <c>InclNodes</c>. By using <c>run/3</c>
- this way it is possible to use any test specification, with or without node information,
- in a large scale test environment! <c>ExclNodes</c> is a list of nodes that should be
- excluded from the test. I.e. tests that have been specified in the test specification
- to run on a particular node will not be performed if that node is at runtime
- listed in <c>ExclNodes</c>.</p>
-
- <p>If CT Master fails initially to connect to any of the test nodes specified in a
- test specification or in the <c>InclNodes</c> list, the operator will be prompted with
- the option to either start over again (after manually checking the status of the
- node(s) in question), to run without the missing nodes, or to abort the operation.</p>
+ <p>The <c>InclNodes</c> argument to <c>run/3</c> is a list of node names. Function
+ <c>run/3</c> runs the tests in <c>TestSpecs</c> just like <c>run/1</c>, but also
+ takes any test in <c>TestSpecs</c>, which is not explicitly tagged with a particular
+ node name, and execute it on the nodes listed in <c>InclNodes</c>. By using <c>run/3</c>
+ this way, any test specification can be used, with or without node information,
+ in a large-scale test environment.</p>
+
+ <p><c>ExclNodes</c> is a list of nodes to be
+ excluded from the test. That is, tests that are specified in the test specification
+ to run on a particular node are not performed if that node is
+ listed in <c>ExclNodes</c> at runtime.</p>
- <p>When tests start, CT Master prints information to console about the nodes that are
- involved. CT Master also reports when tests finish, successfully or unsuccessfully. If
- connection is lost to a node, the test on that node is considered finished. CT Master
- will not attempt to reestablish contact with the failing node. At any time to get the
- current status of the test nodes, call the function:</p>
+ <p>If <c>Common Test</c> Master fails initially to connect to any of the test nodes specified in a
+ test specification or in the <c>InclNodes</c> list, the operator is prompted with
+ the option to either start over again (after manually checking the status of the
+ nodes in question), to run without the missing nodes, or to abort the operation.</p>
- <p><c>ct_master:progress()</c></p>
+ <p>When tests start, <c>Common Test</c> Master displays information to console about the involved nodes.
+ <c>Common Test</c> Master also reports when tests finish, successfully or unsuccessfully. If
+ connection is lost to a node, the test on that node is considered finished. <c>Common Test</c> Master
+ does not attempt to re-establish contact with the failing node.</p>
- <p>To stop one or more tests, use:</p>
+ <p>At any time, to get the current status of the test nodes, call function
+ <seealso marker="ct_master#progress-0"><c>ct_master:progress()</c></seealso>.</p>
- <p><c>ct_master:abort()</c> (stop all) or <c>ct_master:abort(Nodes)</c></p>
+ <p>To stop one or more tests, use function
+ <seealso marker="ct_master#abort-0"><c>ct_master:abort()</c></seealso> (to stop all) or
+ <seealso marker="ct_master#abort-1"><c>ct_master:abort(Nodes)</c></seealso>.</p>
- <p>For detailed information about the <c>ct_master</c> API, please see the
- <seealso marker="ct_master">manual page</seealso> for this module.</p>
+ <p>For details about the <c>Common Test</c> Master API, see module
+ <seealso marker="ct_master"><c>ct_master</c></seealso>.</p>
</section>
<section>
<marker id="test_specifications"></marker>
<title>Test Specifications</title>
- <p>The test specifications used as input to CT Master are fully compatible with the
- specifications used as input to the regular CT server. The syntax is described in the
- <seealso marker="run_test_chapter#test_specifications">Running Test Suites</seealso>
- chapter.</p>
+ <p>The test specifications used as input to <c>Common Test</c> Master are fully compatible with the
+ specifications used as input to the regular <c>Common Test</c> server. The syntax is described in section
+ <seealso marker="run_test_chapter#test_specifications">Test Specifications</seealso>
+ in section Running Tests and Analyzing Results.</p>
<p>All test specification terms can have a <c>NodeRefs</c> element. This element
specifies which node or nodes a configuration operation or a test is to be executed
- on. <c>NodeRefs</c> is defined as:</p>
+ on. <c>NodeRefs</c> is defined as follows:</p>
<p><c>NodeRefs = all_nodes | [NodeRef] | NodeRef</c></p>
-
- <p>where</p>
<p><c>NodeRef = NodeAlias | node() | master</c></p>
<p>A <c>NodeAlias</c> (<c>atom()</c>) is used in a test specification as a
- reference to a node name (so the actual node name only needs to be declared once,
- which can of course also be achieved using constants).
- The alias is declared with a <c>node</c> term:</p>
+ reference to a node name (so the node name only needs to be declared once,
+ which also can be achieved using constants).
+ The alias is declared with a <c>node</c> term as follows:</p>
<p><c>{node, NodeAlias, NodeName}</c></p>
- <p>If <c>NodeRefs</c> has the value <c>all_nodes</c>, the operation or test will
- be performed on all given test nodes. (Declaring a term without a <c>NodeRefs</c>
- element actually has the same effect). If <c>NodeRefs</c> has the value
- <c>master</c>, the operation is only performed on the CT Master node (namely set
+ <p>If <c>NodeRefs</c> has the value <c>all_nodes</c>, the operation or test
+ is performed on all specified test nodes. (Declaring a term without a <c>NodeRefs</c>
+ element has the same effect). If <c>NodeRefs</c> has the value
+ <c>master</c>, the operation is only performed on the <c>Common Test</c> Master node (namely set
the log directory or install an event handler).</p>
- <p>Consider the example in the
- <seealso marker="run_test_chapter#test_specifications">Running Test Suites</seealso>
- chapter, now extended with node information and intended to be executed by the
- CT Master:</p>
+ <p>Consider the example in section
+ <seealso marker="run_test_chapter#test_specifications">Test Specifications</seealso>
+ in section Running Tests and Analysing Results,
+ now extended with node information and intended to be executed by
+ <c>Common Test</c> Master:</p>
<pre>
- {define, 'Top', "/home/test"}.
- {define, 'T1', "'Top'/t1"}.
- {define, 'T2', "'Top'/t2"}.
- {define, 'T3', "'Top'/t3"}.
- {define, 'CfgFile', "config.cfg"}.
- {define, 'Node', ct_node}.
-
- {node, node1, 'Node@host_x'}.
- {node, node2, 'Node@host_y'}.
-
- {logdir, master, "'Top'/master_logs"}.
- {logdir, "'Top'/logs"}.
-
- {config, node1, "'T1'/'CfgFile'"}.
- {config, node2, "'T2'/'CfgFile'"}.
- {config, "'T3'/'CfgFile'"}.
-
- {suites, node1, 'T1', all}.
- {skip_suites, node1, 'T1', [t1B_SUITE,t1D_SUITE], "Not implemented"}.
- {skip_cases, node1, 'T1', t1A_SUITE, [test3,test4], "Irrelevant"}.
- {skip_cases, node1, 'T1', t1C_SUITE, [test1], "Ignore"}.
-
- {suites, node2, 'T2', [t2B_SUITE,t2C_SUITE]}.
- {cases, node2, 'T2', t2A_SUITE, [test4,test1,test7]}.
-
- {skip_suites, 'T3', all, "Not implemented"}.</pre>
+ {define, 'Top', "/home/test"}.
+ {define, 'T1', "'Top'/t1"}.
+ {define, 'T2', "'Top'/t2"}.
+ {define, 'T3', "'Top'/t3"}.
+ {define, 'CfgFile', "config.cfg"}.
+ {define, 'Node', ct_node}.
+
+ {node, node1, 'Node@host_x'}.
+ {node, node2, 'Node@host_y'}.
+
+ {logdir, master, "'Top'/master_logs"}.
+ {logdir, "'Top'/logs"}.
+
+ {config, node1, "'T1'/'CfgFile'"}.
+ {config, node2, "'T2'/'CfgFile'"}.
+ {config, "'T3'/'CfgFile'"}.
+
+ {suites, node1, 'T1', all}.
+ {skip_suites, node1, 'T1', [t1B_SUITE,t1D_SUITE], "Not implemented"}.
+ {skip_cases, node1, 'T1', t1A_SUITE, [test3,test4], "Irrelevant"}.
+ {skip_cases, node1, 'T1', t1C_SUITE, [test1], "Ignore"}.
+
+ {suites, node2, 'T2', [t2B_SUITE,t2C_SUITE]}.
+ {cases, node2, 'T2', t2A_SUITE, [test4,test1,test7]}.
+
+ {skip_suites, 'T3', all, "Not implemented"}.</pre>
<p>This example specifies the same tests as the original example. But
- now if started with a call to <c>ct_master:run(TestSpecName)</c>, the
- t1 test will be executed on node <c>ct_node@host_x</c> (node1), the
- t2 test on <c>ct_node@host_y</c> (node2) and the t3 test on both
- node1 and node2. The t1 config file will only be read on
- node1 and the t2 config file only on node2, while the t3 config file
- will be read on both node1 and node2. Both test nodes will write log
- files to the same directory. (The CT Master node will however use a
- different log directory than the test nodes).</p>
+ now if started with a call to <c>ct_master:run(TestSpecName)</c>, test
+ <c>t1</c> is executed on node <c>ct_node@host_x</c> (<c>node1</c>), test
+ <c>t2</c> on <c>ct_node@host_y</c> (<c>node2</c>) and test <c>t3</c>
+ on both <c>node1</c> and <c>node2</c>. Configuration file <c>t1</c> is only read on
+ <c>node1</c> and configuration file <c>t2</c> only on <c>node2</c>, while the
+ configuration file <c>t3</c> is read on both <c>node1</c> and <c>node2</c>.
+ Both test nodes write log files to the same directory. (However, the <c>Common Test</c> Master
+ node uses a different log directory than the test nodes.)</p>
<p>If the test session is instead started with a call to
<c>ct_master:run(TestSpecName, [ct_node@host_z], [ct_node@host_x])</c>,
- the result is that the t1 test does not run on
- <c>ct_node@host_x</c> (or any other node) while the t3 test runs on
+ the result is that test <c>t1</c> does not run on
+ <c>ct_node@host_x</c> (or any other node) while test <c>t3</c> runs on both
<c>ct_node@host_y</c> and <c>ct_node@host_z</c>.</p>
<p>A nice feature is that a test specification that includes node
- information can still be used as input to the regular Common Test server
- (as described in the
- <seealso marker="run_test_chapter#test_specifications">Running Test Suites</seealso>
- chapter). The result is that any test specified to run on a node with the same
- name as the Common Test node in question (typically <c>ct@somehost</c> if started
- with the <c>ct_run</c> program), will be performed. Tests without explicit
- node association will always be performed too of course!</p>
+ information can still be used as input to the regular <c>Common Test</c> server
+ (as described in section
+ <seealso marker="run_test_chapter#test_specifications">Test Specifications</seealso>).
+ The result is that any test specified to run on a node with the same
+ name as the <c>Common Test</c> node in question (typically <c>ct@somehost</c> if started
+ with the <c>ct_run</c> program), is performed. Tests without explicit
+ node association are always performed too, of course.</p>
</section>
<section>
- <title>Automatic startup of test target nodes</title>
+ <title>Automatic Startup of Test Target Nodes</title>
<marker id="ct_slave"></marker>
- <p>It is possible to automatically start, and perform initial actions, on
- test target nodes by using the test specification term <c>init</c>.</p>
- <p>Currently, two sub-terms are supported, <c>node_start</c> and <c>eval</c>.</p>
- <p>Example:</p>
+ <p>Initial actions can be started and performed automatically on
+ test target nodes using test specification term <c>init</c>.</p>
+ <p>Two subterms are supported, <c>node_start</c> and <c>eval</c>.</p>
+ <p><em>Example:</em></p>
<pre>
- {node, node1, node1@host1}.
- {node, node2, node1@host2}.
- {node, node3, node2@host2}.
- {node, node4, node1@host3}.
- {init, node1, [{node_start, [{callback_module, my_slave_callback}]}]}.
- {init, [node2, node3], {node_start, [{username, "ct_user"}, {password, "ct_password"}]}}.
- {init, node4, {eval, {module, function, []}}}.</pre>
+ {node, node1, node1@host1}.
+ {node, node2, node1@host2}.
+ {node, node3, node2@host2}.
+ {node, node4, node1@host3}.
+ {init, node1, [{node_start, [{callback_module, my_slave_callback}]}]}.
+ {init, [node2, node3], {node_start, [{username, "ct_user"}, {password, "ct_password"}]}}.
+ {init, node4, {eval, {module, function, []}}}.</pre>
<p>This test specification declares that <c>node1@host1</c> is to be started using
the user callback function <c>callback_module:my_slave_callback/0</c>, and nodes
- <c>node1@host2</c> and <c>node2@host2</c> will be started with the default callback
- module <c>ct_slave</c>. The given user name and password is used to log into remote
- host <c>host2</c>. Also, the function <c>module:function/0</c> will be evaluated on
- <c>node1@host3</c>, and the result of this call will be printed to the log.</p>
+ <c>node1@host2</c> and <c>node2@host2</c> are to be started with the default callback
+ module <c>ct_slave</c>. The specified username and password are used to log on to remote
+ host <c>host2</c>. Also, function <c>module:function/0</c> is evaluated on
+ <c>node1@host3</c>, and the result of this call is printed to the log.</p>
- <p>The default <seealso marker="ct_slave">ct_slave</seealso> callback module,
- which is part of the Common Test application, has the following features:
+ <p>The default callback module <seealso marker="ct_slave">ct_slave</seealso>,
+ has the following features:
</p>
- <list>
+ <list type="bulleted">
<item>Starting Erlang target nodes on local or remote hosts
- (ssh is used for communication).
+ (application <c>SSH</c> is used for communication).
</item>
- <item>Ability to start an Erlang emulator with additional flags
+ <item>Ability to start an Erlang emulator with more flags
(any flags supported by <c>erl</c> are supported).
</item>
- <item>Supervision of a node being started by means of internal callback
- functions. Used to prevent hanging nodes. (Configurable).
+ <item>Supervision of a node being started using internal callback
+ functions. Used to prevent hanging nodes. (Configurable.)
</item>
- <item>Monitoring of the master node by the slaves. A slave node may be
- stopped in case the master node terminates. (Configurable).
+ <item>Monitoring of the master node by the slaves. A slave node can be
+ stopped if the master node terminates. (Configurable.)
</item>
- <item>Execution of user functions after a slave node is started.
- Functions can be given as a list of {Module, Function, Arguments} tuples.
+ <item>Execution of user functions after a slave node is started. Functions can
+ be specified as a list of <c>{Module, Function, Arguments}</c> tuples.
</item>
</list>
- <p>Note that it is possible to specify an <c>eval</c> term for the node as well
- as <c>startup_functions</c> in the <c>node_start</c> options list. In this
- case first the node will be started, then the <c>startup_functions</c> are
+ <note><p>An <c>eval</c> term for the node and
+ <c>startup_functions</c> in the <c>node_start</c> options list can be specified.
+ In this case, the node is started first, then the <c>startup_functions</c> are
executed, and finally functions specified with <c>eval</c> are called.
- </p>
+ </p></note>
</section>
</chapter>
diff --git a/lib/common_test/doc/src/ct_netconfc.xml b/lib/common_test/doc/src/ct_netconfc.xml
new file mode 100644
index 0000000000..d8c82c7f2c
--- /dev/null
+++ b/lib/common_test/doc/src/ct_netconfc.xml
@@ -0,0 +1,1039 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2010</year><year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>ct_netconfc</title>
+ <prepared></prepared>
+ <responsible></responsible>
+ <docno></docno>
+ <approved></approved>
+ <checked></checked>
+ <date></date>
+ <rev>A</rev>
+ <file>ct_netconfc.xml</file>
+ </header>
+ <module>ct_netconfc</module>
+ <modulesummary>NETCONF client module.</modulesummary>
+
+<description>
+
+ <p>NETCONF client module.</p>
+
+ <p>The NETCONF client is compliant with RFC 4741 NETCONF Configuration
+ Protocol and RFC 4742 Using the NETCONF Configuration Protocol over
+ Secure SHell (SSH)..</p>
+
+ <p>For each server to test against, the following entry can be added to a
+ configuration file:</p>
+
+ <pre>
+ {server_id(),options()}.</pre>
+
+ <p>The <c>server_id()</c> or an associated <c>target_name()</c> (see
+ module <seealso marker="ct"><c>ct</c></seealso>) must then be used
+ in calls to
+ <seealso marker="#open-2"><c>ct_netconfc:open/2</c></seealso>.</p>
+
+ <p>If no configuration exists for a server, a session can still be
+ opened by calling
+ <seealso marker="#open-2"><c>ct_netconfc:open/2</c></seealso> with
+ all necessary options specified in the call. The first argument to
+ <seealso marker="#open-2"><c>ct_netconfc:open/2</c></seealso> can
+ then be any atom.</p>
+
+ </description>
+
+ <section>
+ <marker id="Logging"/>
+ <title>Logging</title>
+ <p>The NETCONF server uses <c>error_logger</c> for logging of NETCONF
+ traffic. A special purpose error handler is implemented in
+ <c>ct_conn_log_h</c>. To use this error handler, add the
+ <c>cth_conn_log</c> hook in the test suite, for example:</p>
+
+ <pre>
+ suite() -&gt;
+ [{ct_hooks, [{cth_conn_log, [{conn_mod(),hook_options()}]}]}].</pre>
+
+ <p><c>conn_mod()</c> is the name of the <c>Common Test</c> module
+ implementing the connection protocol, for example, <c>ct_netconfc</c>.</p>
+
+ <p>Hook option <c>log_type</c> specifies the type of logging:</p>
+
+ <taglist>
+ <tag><c>raw</c></tag>
+ <item><p>The sent and received NETCONF data is logged to a separate
+ text file "as is" without any formatting. A link to the file is
+ added to the test case HTML log.</p>.</item>
+
+ <tag><c>pretty</c></tag>
+ <item><p>The sent and received NETCONF data is logged to a separate
+ text file with XML data nicely indented. A link to the file is
+ added to the test case HTML log.</p></item>
+
+ <tag><c>html (default)</c></tag>
+ <item><p>The sent and received NETCONF traffic is pretty printed
+ directly in the test case HTML log.</p></item>
+
+ <tag><c>silent</c></tag>
+ <item><p>NETCONF traffic is not logged.</p></item>
+ </taglist>
+
+ <p>By default, all NETCONF traffic is logged in one single log file.
+ However, different connections can be logged in separate files.
+ To do this, use hook option <c>hosts</c> and list the names of the
+ servers/connections to be used in the suite. The connections
+ must be named for this to work, that is, they must be opened with
+ <seealso marker="#open-2"><c>ct_netconfc:open/2</c></seealso>.</p>
+
+ <p>Option <c>hosts</c> has no effect if <c>log_type</c> is set to
+ <c>html</c> or <c>silent</c>.</p>
+
+ <p>The hook options can also be specified in a configuration file with
+ configuration variable <c>ct_conn_log</c>:</p>
+
+ <pre>
+ {ct_conn_log,[{conn_mod(),hook_options()}]}.</pre>
+
+ <p>For example:</p>
+
+ <pre>
+ {ct_conn_log,[{ct_netconfc,[{log_type,pretty},
+ {hosts,[key_or_name()]}]}]}</pre>
+
+ <note>
+ <p>Hook options specified in a configuration file overwrite the
+ hard-coded hook options in the test suite.</p>
+ </note>
+
+ <p><em>Logging Example 1:</em></p>
+ <marker id="Logging_example_1"/>
+
+ <p>The following <c>ct_hooks</c> statement causes pretty printing of
+ NETCONF traffic to separate logs for the connections named
+ <c>nc_server1</c> and <c>nc_server2</c>. Any other connections are
+ logged to default NETCONF log.</p>
+
+ <pre>
+ suite() -&gt;
+ [{ct_hooks, [{cth_conn_log, [{ct_netconfc,[{log_type,pretty}},
+ {hosts,[nc_server1,nc_server2]}]}
+ ]}]}].</pre>
+
+ <p>Connections must be opened as follows:</p>
+
+ <pre>
+ open(nc_server1,[...]),
+ open(nc_server2,[...]).</pre>
+
+ <p><em>Logging Example 2:</em></p>
+ <marker id="Logging_example_2"/>
+
+ <p>The following configuration file causes raw logging of all NETCONF
+ traffic in to one single text file:</p>
+
+ <pre>
+ {ct_conn_log,[{ct_netconfc,[{log_type,raw}]}]}.</pre>
+
+ <p>The <c>ct_hooks</c> statement must look as follows:</p>
+
+ <pre>
+ suite() -&gt;
+ [{ct_hooks, [{cth_conn_log, []}]}].</pre>
+
+ <p>The same <c>ct_hooks</c> statement without the configuration file
+ would cause HTML logging of all NETCONF connections in to the test
+ case HTML log.</p>
+ </section>
+
+ <section>
+ <marker id="Notifications"/>
+ <title>Notifications</title>
+
+ <p>The NETCONF client is also compliant with RFC 5277 NETCONF Event
+ Notifications, which defines a mechanism for an asynchronous message
+ notification delivery service for the NETCONF protocol.</p>
+
+ <p>Specific functions to support this are
+ <seealso marker="#create_subscription-6"><c>ct_netconfc:create_subscription/6</c></seealso>
+ and
+ <seealso marker="#get_event_streams-3"><c>ct_netconfc:get_event_streams/3</c></seealso>.
+ (The functions also exist with other arities.)</p>
+ </section>
+
+ <section>
+ <title>Data Types</title>
+ <marker id="types"/>
+ <taglist>
+ <tag><c>client() = handle() | key_or_name()</c></tag>
+ <item><marker id="type-client"/>
+ <p>For <c>handle()</c>, see module
+ <seealso marker="ct"><c>ct</c></seealso>.</p></item>
+
+ <tag><c>error_reason() = term()</c></tag>
+ <item><marker id="type-error_reason"/> </item>
+ <tag><c>event_time() = {eventTime, xml_attributes(), [xs_datetime()]}</c></tag>
+ <item><marker id="type-event_time"/> </item>
+
+ <tag><c>handle() = term()</c></tag>
+ <item><marker id="type-handle"/>
+ <p>Opaque reference for a connection (NETCONF session). For more
+ information, see module <seealso marker="ct"><c>ct</c></seealso>.</p>
+ </item>
+
+ <tag><c>host() = <seealso marker="kernel:inet#type-hostname"><c>inet:hostname()</c></seealso> | <seealso marker="kernel:inet#type-ip_address"><c>inet:ip_address()</c></seealso></c></tag>
+ <item><marker id="type-host"/></item>
+
+ <tag><c>key_or_name() = server_id() | target_name()</c></tag>
+ <item><marker id="type-key_or_name"/>
+ <p>For <c>target_name</c>, see module
+ <seealso marker="ct"><c>ct</c></seealso>.</p></item>
+
+ <tag><c>netconf_db() = running | startup | candidate</c></tag>
+ <item><marker id="type-netconf_db"/> </item>
+
+ <tag><c>notification() = {notification, xml_attributes(), notification_content()}</c></tag>
+ <item><marker id="type-notification"/> </item>
+
+ <tag><c>notification_content() = [event_time() | simple_xml()]</c></tag>
+ <item><marker id="type-notification_content"/> </item>
+
+ <tag><c>option() = {ssh, host()} | {port, <seealso marker="kernel:inet#type-port_number"><c>inet:port_number()</c></seealso>} | {timeout, timeout()} | SshConnectOption</c></tag>
+ <item><marker id="type-option"/>
+
+ <p><c>SshConnectOption</c> is any valid option to
+ <seealso marker="ssh:ssh#connect-3"><c>ssh:connect/3,4</c></seealso>.
+ Common options used are <c>user</c>, <c>password</c>
+ and <c>user_dir</c>. The <c>SshConnectOptions</c> are
+ verfied by the SSH application.</p></item>
+
+ <tag><c>options() = [option()]</c></tag>
+ <item><marker id="type-options"/>
+ <p>Options used for setting up an SSH connection to a NETCONF
+ server.</p></item>
+
+ <tag><c>server_id() = atom()</c></tag>
+ <item><marker id="type-server_id"/>
+ <p>The identity of a server, specified in a configuration
+ file.</p></item>
+
+ <tag><c>simple_xml() = {xml_tag(), xml_attributes(), xml_content()} | {xml_tag(), xml_content()} | xml_tag()</c></tag>
+ <item><marker id="type-simple_xml"/>
+ <p>This type is further described in application
+ <seealso marker="xmerl:index"><c>xmerl</c></seealso>.</p></item>
+
+ <tag><c>stream_data() = {description, string()} | {replaySupport, string()} | {replayLogCreationTime, string()} | {replayLogAgedTime, string()}</c></tag>
+ <item><marker id="type-stream_data"/>
+ <p>For details about the data format for the string values, see
+ "XML Schema for Event Notifications" in RFC 5277.</p></item>
+
+ <tag><c>stream_name() = string()</c></tag>
+ <item><marker id="type-stream_name"/> </item>
+
+ <tag><c>streams() = [{stream_name(), [stream_data()]}]</c></tag>
+ <item><marker id="type-streams"/> </item>
+
+ <tag><c>xml_attribute_tag() = atom()</c></tag>
+ <item><marker id="type-xml_attribute_tag"/> </item>
+
+ <tag><c>xml_attribute_value() = string()</c></tag>
+ <item><marker id="type-xml_attribute_value"/> </item>
+
+ <tag><c>xml_attributes() = [{xml_attribute_tag(), xml_attribute_value()}]</c></tag>
+ <item><marker id="type-xml_attributes"/> </item>
+
+ <tag><c>xml_content() = [simple_xml() | iolist()]</c></tag>
+ <item><marker id="type-xml_content"/> </item>
+
+ <tag><c>xml_tag() = atom()</c></tag>
+ <item><marker id="type-xml_tag"/> </item>
+
+ <tag><c>xpath() = {xpath, string()}</c></tag>
+ <item><marker id="type-xpath"/> </item>
+
+ <tag><c>xs_datetime() = string()</c></tag>
+ <item><marker id="type-xs_datetime"/>
+ <p>This date and time identifier has the same format as the XML type
+ <c>dateTime</c> and is compliant with RFC 3339 Date and Time on
+ the Internet Timestamps. The format is as follows:</p>
+ <pre>
+ [-]CCYY-MM-DDThh:mm:ss[.s][Z|(+|-)hh:mm]</pre>
+ </item>
+ </taglist>
+ </section>
+
+ <funcs>
+ <func>
+ <name>action(Client, Action) -&gt; Result</name>
+ <fsummary>Equivalent to action(Client, Action, infinity).</fsummary>
+ <desc><marker id="action-2"/>
+ <p>Equivalent to
+ <seealso marker="#action-3"><c>ct_netconfc:action(Client, Action,
+ infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>action(Client, Action, Timeout) -&gt; Result</name>
+ <fsummary>Executes an action.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>Action = simple_xml()</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = ok | {ok, [simple_xml()]} | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="action-3"/>
+ <p>Executes an action. If the return type is void, <c>ok</c> is
+ returned instead of <c>{ok,[simple_xml()]}</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>close_session(Client) -&gt; Result</name>
+ <fsummary>Equivalent to close_session(Client, infinity).</fsummary>
+ <desc><marker id="close_session-1"/>
+ <p>Equivalent to
+ <seealso marker="#close_session-2"><c>ct_netconfc:close_session(Client,
+ infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>close_session(Client, Timeout) -&gt; Result</name>
+ <fsummary>Requests graceful termination of the session associated with
+ the client.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = ok | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="close_session-2"/>
+ <p>Requests graceful termination of the session associated with the
+ client.</p>
+
+ <p>When a NETCONF server receives a <c>close-session</c> request, it
+ gracefully closes the session. The server releases any locks and
+ resources associated with the session and gracefully closes any
+ associated connections. Any NETCONF requests received after a
+ <c>close-session</c> request are ignored.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>copy_config(Client, Source, Target) -&gt; Result</name>
+ <fsummary>Equivalent to copy_config(Client, Source, Target,
+ infinity).</fsummary>
+ <desc><marker id="copy_config-3"/>
+ <p>Equivalent to
+ <seealso marker="#copy_config-4"><c>ct_netconfc:copy_config(Client,
+ Source, Target, infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>copy_config(Client, Target, Source, Timeout) -&gt; Result</name>
+ <fsummary>Copies configuration data.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>Target = netconf_db()</v>
+ <v>Source = netconf_db()</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = ok | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="copy_config-4"/>
+ <p>Copies configuration data.</p>
+
+ <p>Which source and target options that can be issued depends on the
+ capabilities supported by the server. That is, <c>:candidate</c>
+ and/or <c>:startup</c> are required.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>create_subscription(Client) -&gt; term()</name>
+ <fsummary>Creates a subscription for event notifications.</fsummary>
+ <desc><marker id="create_subscription-1"/></desc>
+ </func>
+
+ <func>
+ <name>create_subscription(Client, Timeout) -&gt; term()</name>
+ <fsummary>Creates a subscription for event notifications.</fsummary>
+ <desc><marker id="create_subscription-2"/></desc>
+ </func>
+
+ <func>
+ <name>create_subscription(Client, Stream, Timeout) -&gt; term()</name>
+ <fsummary>Creates a subscription for event notifications.</fsummary>
+ <desc><marker id="create_subscription-3"/></desc>
+ </func>
+
+ <func>
+ <name>create_subscription(Client, StartTime, StopTime, Timeout) -&gt; term()</name>
+ <fsummary>Creates a subscription for event notifications.</fsummary>
+ <desc><marker id="create_subscription-4"/></desc>
+ </func>
+
+ <func>
+ <name>create_subscription(Client, Stream, StartTime, StopTime, Timeout) -&gt; term()</name>
+ <fsummary>Creates a subscription for event notifications.</fsummary>
+ <desc><marker id="create_subscription-5"/></desc>
+ </func>
+
+ <func>
+ <name>create_subscription(Client, Stream, Filter, StartTime, StopTime, Timeout) -&gt; Result</name>
+ <fsummary>Creates a subscription for event notifications.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>Stream = stream_name()</v>
+ <v>Filter = simple_xml() | [simple_xml()]</v>
+ <v>StartTime = xs_datetime()</v>
+ <v>StopTime = xs_datetime()</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = ok | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="create_subscription-6"/>
+ <p>Creates a subscription for event notifications.</p>
+
+ <p>This function sets up a subscription for NETCONF event
+ notifications of the specified stream type, matching the specified
+ filter. The calling process receives notifications as messages of
+ type <c>notification()</c>.</p>
+
+ <taglist>
+ <tag><c>Stream</c></tag>
+ <item><p>Optional parameter that indicates which stream of event
+ is of interest. If not present, events in the default NETCONF
+ stream are sent.</p></item>
+ <tag><c>Filter</c></tag>
+ <item><p>Optional parameter that indicates which subset of all
+ possible events is of interest. The parameter format is the
+ same as that of the filter parameter in the NETCONF protocol
+ operations. If not present, all events not precluded by other
+ parameters are sent.</p></item>
+ <tag><c>StartTime</c></tag>
+ <item><p>Optional parameter used to trigger the replay feature and
+ indicate that the replay is to start at the time specified.
+ If <c>StartTime</c> is not present, this is not a replay
+ subscription.</p>
+ <p>It is not valid to specify start times that are later than
+ the current time. If <c>StartTime</c> is specified earlier
+ than the log can support, the replay begins with the earliest
+ available notification.</p>
+ <p>This parameter is of type <c>dateTime</c> and compliant to
+ RFC 3339. Implementations must support time zones.</p></item>
+ <tag><c>StopTime</c></tag>
+ <item><p>Optional parameter used with the optional replay feature
+ to indicate the newest notifications of interest. If
+ <c>StopTime</c> is not present, the notifications continues
+ until the subscription is terminated.</p>
+ <p>Must be used with and be later than <c>StartTime</c>. Values
+ of <c>StopTime</c> in the future are valid. This parameter is
+ of type <c>dateTime</c> and compliant to RFC 3339.
+ Implementations must support time zones.</p></item>
+ </taglist>
+
+ <p>For more details about the event notification mechanism, see
+ RFC 5277.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>delete_config(Client, Target) -&gt; Result</name>
+ <fsummary>Equivalent to delete_config(Client, Target,
+ infinity).</fsummary>
+ <desc><marker id="delete_config-2"/>
+ <p>Equivalent to
+ <seealso marker="#delete_config-3"><c>ct_netconfc:delete_config(Client, Target, infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>delete_config(Client, Target, Timeout) -&gt; Result</name>
+ <fsummary>Deletes configuration data.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>Target = startup | candidate</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = ok | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="delete_config-3"/>
+ <p>Deletes configuration data.</p>
+
+ <p>The running configuration cannot be deleted and <c>:candidate</c>
+ or <c>:startup</c> must be advertised by the server.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>edit_config(Client, Target, Config) -&gt; Result</name>
+ <fsummary>Equivalent to edit_config(Client, Target, Config, [],
+ infinity).</fsummary>
+ <desc><marker id="edit_config-3"/>
+ <p>Equivalent to
+ <seealso marker="#edit_config-5"><c>ct_netconfc:edit_config(Client,
+ Target, Config, [], infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>edit_config(Client, Target, Config, OptParamsOrTimeout) -&gt; Result</name>
+ <fsummary>If OptParamsOrTimeout is a time-out value, this function is
+ equivalent to ct_netconfc:edit_config(Client, Target, Config, [],
+ Timeout).</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>Target = netconf_db()</v>
+ <v>Config = simple_xml()</v>
+ <v>OptParamsOrTimeout = [simple_xml()] | timeout()</v>
+ <v>Result = ok | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="edit_config-4"/>
+ <p>If <c>OptParamsOrTimeout</c> is a time-out value, this function is
+ equivalent to
+ <seealso marker="#edit_config-5"><c>ct_netconfc:edit_config(Client,
+ Target, Config, [], Timeout)</c></seealso>.</p>
+
+ <p>If <c>OptParamsOrTimeout</c> is a list of simple XML, this
+ function is equivalent to
+ <seealso marker="#edit_config-5"><c>ct_netconfc:edit_config(Client,
+ Target, Config, OptParams, infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>edit_config(Client, Target, Config, OptParams, Timeout) -&gt; Result</name>
+ <fsummary>Edits configuration data.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>Target = netconf_db()</v>
+ <v>Config = simple_xml()</v>
+ <v>OptParams = [simple_xml()]</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = ok | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="edit_config-5"/>
+ <p>Edits configuration data.</p>
+
+ <p>By default only the running target is available, unless the server
+ includes <c>:candidate</c> or <c>:startup</c> in its list of
+ capabilities.</p>
+
+ <p><c>OptParams</c> can be used for specifying optional parameters
+ (<c>default-operation</c>, <c>test-option</c>, or
+ <c>error-option</c>) to be added to the <c>edit-config</c>
+ request. The value must be a list containing valid simple XML,
+ for example:</p>
+
+ <pre>
+ [{'default-operation', ["none"]},
+ {'error-option', ["rollback-on-error"]}]</pre>
+ </desc>
+ </func>
+
+ <func>
+ <name>get(Client, Filter) -&gt; Result</name>
+ <fsummary>Equivalent to get(Client, Filter, infinity).</fsummary>
+ <desc><marker id="get-2"/>
+ <p>Equivalent to
+ <seealso marker="#get-3"><c>ct_netconfc:get(Client, Filter,
+ infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get(Client, Filter, Timeout) -&gt; Result</name>
+ <fsummary>Gets data.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>Filter = simple_xml() | xpath()</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = {ok, [simple_xml()]} | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="get-3"/>
+ <p>Gets data.</p>
+
+ <p>This operation returns both configuration and state data from the
+ server.</p>
+
+ <p>Filter type <c>xpath</c> can be used only if the server supports
+ <c>:xpath</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_capabilities(Client) -&gt; Result</name>
+ <fsummary>Equivalent to get_capabilities(Client, infinity).</fsummary>
+ <desc><marker id="get_capabilities-1"/>
+ <p>Equivalent to
+ <seealso marker="#get_capabilities-2"><c>ct_netconfc:get_capabilities(Client,
+ infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_capabilities(Client, Timeout) -&gt; Result</name>
+ <fsummary>Returns the server side capabilities.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = [string()] | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="get_capabilities-2"/>
+ <p>Returns the server side capabilities.</p>
+
+ <p>The following capability identifiers, defined in RFC 4741 NETCONF
+ Configuration Protocol, can be returned:</p>
+
+ <list>
+ <item><p><c>"urn:ietf:params:netconf:base:1.0"</c></p></item>
+ <item><p><c>"urn:ietf:params:netconf:capability:writable-running:1.0"</c></p></item>
+ <item><p><c>"urn:ietf:params:netconf:capability:candidate:1.0"</c></p></item>
+ <item><p><c>"urn:ietf:params:netconf:capability:confirmed-commit:1.0"</c></p></item>
+ <item><p><c>"urn:ietf:params:netconf:capability:rollback-on-error:1.0"</c></p></item>
+ <item><p><c>"urn:ietf:params:netconf:capability:startup:1.0"</c></p></item>
+ <item><p><c>"urn:ietf:params:netconf:capability:url:1.0"</c></p></item>
+ <item><p><c>"urn:ietf:params:netconf:capability:xpath:1.0"</c></p></item>
+ </list>
+
+ <p>More identifiers can exist, for example, server-side namespace.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_config(Client, Source, Filter) -&gt; Result</name>
+ <fsummary>Equivalent to get_config(Client, Source, Filter,
+ infinity).</fsummary>
+ <desc><marker id="get_config-3"/>
+ <p>Equivalent to
+ <seealso marker="#get_config-4"><c>ct_netconfc:get_config(Client, Source, Filter, infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_config(Client, Source, Filter, Timeout) -&gt; Result</name>
+ <fsummary>Gets configuration data.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>Source = netconf_db()</v>
+ <v>Filter = simple_xml() | xpath()</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = {ok, [simple_xml()]} | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="get_config-4"/>
+ <p>Gets configuration data.</p>
+
+ <p>To be able to access another source than <c>running</c>, the
+ server must advertise <c>:candidate</c> and/or <c>:startup</c>.</p>
+
+ <p>Filter type <c>xpath</c> can be used only if the server supports
+ <c>:xpath</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_event_streams(Client, Timeout) -&gt; Result</name>
+ <fsummary>Equivalent to get_event_streams(Client, [], Timeout).</fsummary>
+ <desc><marker id="get_event_streams-2"/>
+ <p>Equivalent to
+ <seealso marker="#get_event_streams-3"><c>ct_netconfc:get_event_streams(Client,
+ [], Timeout)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_event_streams(Client, Streams, Timeout) -&gt; Result</name>
+ <fsummary>Sends a request to get the specified event streams.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>Streams = [stream_name()]</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = {ok, streams()} | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="get_event_streams-3"/>
+ <p>Sends a request to get the specified event streams.</p>
+
+ <p><c>Streams</c> is a list of stream names. The following filter is
+ sent to the NETCONF server in a <c>get</c> request:</p>
+
+ <pre>
+ &lt;netconf xmlns="urn:ietf:params:xml:ns:netmod:notification"&gt;
+ &lt;streams&gt;
+ &lt;stream&gt;
+ &lt;name&gt;StreamName1&lt;/name&gt;
+ &lt;/stream&gt;
+ &lt;stream&gt;
+ &lt;name&gt;StreamName2&lt;/name&gt;
+ &lt;/stream&gt;
+ ...
+ &lt;/streams&gt;
+ &lt;/netconf&gt;</pre>
+
+ <p>If <c>Streams</c> is an empty list, <em>all</em> streams are
+ requested by sending the following filter:</p>
+
+ <pre>
+ &lt;netconf xmlns="urn:ietf:params:xml:ns:netmod:notification"&gt;
+ &lt;streams/&gt;
+ &lt;/netconf&gt;</pre>
+
+ <p>If more complex filtering is needed, use
+ <seealso marker="#get-2"><c>ct_netconfc:get/2</c></seealso> or
+ <seealso marker="#get-3"><c>ct_netconfc:get/3</c></seealso> and
+ specify the exact filter according to "XML Schema for Event
+ Notifications" in RFC 5277.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_session_id(Client) -&gt; Result</name>
+ <fsummary>Equivalent to get_session_id(Client, infinity).</fsummary>
+ <desc><marker id="get_session_id-1"/>
+ <p>Equivalent to
+ <seealso marker="#get_session_id-2"><c>ct_netconfc:get_session_id(Client,
+ infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_session_id(Client, Timeout) -&gt; Result</name>
+ <fsummary>Returns the session Id associated with the specified
+ client.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = pos_integer() | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="get_session_id-2"/>
+ <p>Returns the session Id associated with the specified client.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>hello(Client) -&gt; Result</name>
+ <fsummary>Equivalent to hello(Client, [], infinity).</fsummary>
+ <desc><marker id="hello-1"/>
+ <p>Equivalent to
+ <seealso marker="#hello-3"><c>ct_netconfc:hello(Client, [],
+ infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>hello(Client, Timeout) -&gt; Result</name>
+ <fsummary>Equivalent to hello(Client, [], Timeout).</fsummary>
+ <desc><marker id="hello-2"/>
+ <p>Equivalent to
+ <seealso marker="#hello-3"><c>ct_netconfc:hello(Client, [],
+ Timeout)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>hello(Client, Options, Timeout) -&gt; Result</name>
+ <fsummary>Exchanges hello messages with the server.</fsummary>
+ <type>
+ <v>Client = handle()</v>
+ <v>Options = [{capability, [string()]}]</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = ok | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="hello-3"/>
+ <p>Exchanges <c>hello</c> messages with the server.</p>
+
+ <p>Adds optional capabilities and sends a <c>hello</c> message to the
+ server and waits for the return.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>kill_session(Client, SessionId) -&gt; Result</name>
+ <fsummary>Equivalent to kill_session(Client, SessionId,
+ infinity).</fsummary>
+ <desc><marker id="kill_session-2"/>
+ <p>Equivalent to
+ <seealso marker="#kill_session-3"><c>ct_netconfc:kill_session(Client,
+SessionId, infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>kill_session(Client, SessionId, Timeout) -&gt; Result</name>
+ <fsummary>Forces termination of the session associated with the supplied
+ session Id.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>SessionId = pos_integer()</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = ok | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="kill_session-3"/>
+ <p>Forces termination of the session associated with the supplied
+ session Id.</p>
+
+ <p>The server side must abort any ongoing operations, release any
+ locks and resources associated with the session, and close any
+ associated connections.</p>
+
+ <p>Only if the server is in the confirmed commit phase, the
+ configuration is restored to its state before entering the confirmed
+ commit phase. Otherwise, no configuration rollback is performed.</p>
+
+ <p>If the specified <c>SessionId</c> is equal to the current session
+ Id, an error is returned.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>lock(Client, Target) -&gt; Result</name>
+ <fsummary>Equivalent to lock(Client, Target, infinity).</fsummary>
+ <desc><marker id="lock-2"/>
+ <p>Equivalent to
+ <seealso marker="#lock-3"><c>ct_netconfc:lock(Client, Target,
+ infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>lock(Client, Target, Timeout) -&gt; Result</name>
+ <fsummary>Unlocks the configuration target.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>Target = netconf_db()</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = ok | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="lock-3"/>
+ <p>Unlocks the configuration target.</p>
+
+ <p>Which target parameters that can be used depends on if
+ <c>:candidate</c> and/or <c>:startup</c> are supported by the
+ server. If successfull, the configuration system of the device is
+ unavailable to other clients (NETCONF, CORBA, SNMP, and so on).
+ Locks are intended to be short-lived.</p>
+
+ <p>Operation
+ <seealso marker="#kill_session-2"><c>ct_netconfc:kill_session/2</c></seealso>
+ or
+ <seealso marker="#kill_session-3"><c>ct_netconfc:kill_session/3</c></seealso>
+ can be used to force the release of a lock owned by another NETCONF
+ session. How this is achieved by the server side is
+ implementation-specific.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>only_open(Options) -&gt; Result</name>
+ <fsummary>Opens a NETCONF session, but does not send hello.</fsummary>
+ <type>
+ <v>Options = options()</v>
+ <v>Result = {ok, handle()} | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="only_open-1"/>
+ <p>Opens a NETCONF session, but does not send <c>hello</c>.</p>
+
+ <p>As <seealso marker="#open-1"><c>ct_netconfc:open/1</c></seealso>,
+ but does not send a <c>hello</c> message.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>only_open(KeyOrName, ExtraOptions) -&gt; Result</name>
+ <fsummary>Opens a name NETCONF session, but does not send
+ hello.</fsummary>
+ <type>
+ <v>KeyOrName = key_or_name()</v>
+ <v>ExtraOptions = options()</v>
+ <v>Result = {ok, handle()} | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="only_open-2"/>
+ <p>Opens a name NETCONF session, but does not send <c>hello</c>.</p>
+
+ <p>As <seealso marker="#open-2"><c>ct_netconfc:open/2</c></seealso>,
+ but does not send a <c>hello</c> message.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>open(Options) -&gt; Result</name>
+ <fsummary>Opens a NETCONF session and exchanges hello messages.</fsummary>
+ <type>
+ <v>Options = options()</v>
+ <v>Result = {ok, handle()} | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="open-1"/>
+ <p>Opens a NETCONF session and exchanges <c>hello</c> messages.</p>
+
+ <p>If the server options are specified in a configuration file,
+ or if a named client is needed for logging purposes (see section
+ <seealso marker="#Logging">Logging</seealso> in this module), use
+ <seealso marker="#open-2"><c>ct_netconfc:open/2</c></seealso>
+ instead.</p>
+
+ <p>The opaque <c>handle()</c> reference returned from this
+ function is required as client identifier when calling any other
+ function in this module.</p>
+
+ <p>Option <c>timeout</c> (milliseconds) is used when setting up the
+ SSH connection and when waiting for the <c>hello</c> message from
+ the server. It is not used for any other purposes during the
+ lifetime of the connection.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>open(KeyOrName, ExtraOptions) -&gt; Result</name>
+ <fsummary>Opens a named NETCONF session and exchanges hello
+ messages.</fsummary>
+ <type>
+ <v>KeyOrName = key_or_name()</v>
+ <v>ExtraOptions = options()</v>
+ <v>Result = {ok, handle()} | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="open-2"/>
+ <p>Opens a named NETCONF session and exchanges <c>hello</c>
+ messages.</p>
+
+ <p>If <c>KeyOrName</c> is a configured <c>server_id()</c> or a
+ <c>target_name()</c> associated with such an Id, then the options
+ for this server are fetched from the configuration file.</p>
+
+ <p>Argument <c>ExtraOptions</c> is added to the options found in the
+ configuration file. If the same options are specified, the values
+ from the configuration file overwrite <c>ExtraOptions</c>.</p>
+
+ <p>If the server is not specified in a configuration file, use
+ <seealso marker="#open-1"><c>ct_netconfc:open/1</c></seealso>
+ instead.</p>
+
+ <p>The opaque <c>handle()</c> reference returned from this
+ function can be used as client identifier when calling any other
+ function in this module. However, if <c>KeyOrName</c> is a
+ <c>target_name()</c>, that is, if the server is named through a
+ call to <seealso marker="ct#require-2"><c>ct:require/2</c></seealso>
+ or a <c>require</c> statement in the test suite, then this name can
+ be used instead of <c>handle()</c>.</p>
+
+ <p>Option <c>timeout</c> (milliseconds) is used when setting up the
+ SSH connection and when waiting for the <c>hello</c> message from
+ the server. It is not used for any other purposes during the
+ lifetime of the connection.</p>
+
+ <p>See also
+ <seealso marker="ct#require-2"><c>ct:require/2</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>send(Client, SimpleXml) -&gt; Result</name>
+ <fsummary>Equivalent to send(Client, SimpleXml, infinity).</fsummary>
+ <desc><marker id="send-2"/>
+ <p>Equivalent to
+ <seealso marker="#send-3"><c>ct_netconfc:send(Client, SimpleXml,
+ infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>send(Client, SimpleXml, Timeout) -&gt; Result</name>
+ <fsummary>Sends an XML document to the server.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>SimpleXml = simple_xml()</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = simple_xml() | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="send-3"/>
+ <p>Sends an XML document to the server.</p>
+
+ <p>The specified XML document is sent "as is" to the server. This
+ function can be used for sending XML documents that cannot be
+ expressed by other interface functions in this module.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>send_rpc(Client, SimpleXml) -&gt; Result</name>
+ <fsummary>Equivalent to send_rpc(Client, SimpleXml, infinity).</fsummary>
+ <desc><marker id="send_rpc-2"/>
+ <p>Equivalent to
+ <seealso marker="#send_rpc-3"><c>ct_netconfc:send_rpc(Client,
+ SimpleXml, infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>send_rpc(Client, SimpleXml, Timeout) -&gt; Result</name>
+ <fsummary>Sends a NETCONF rpc request to the server.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>SimpleXml = simple_xml()</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = [simple_xml()] | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="send_rpc-3"/>
+ <p>Sends a NETCONF <c>rpc</c> request to the server.</p>
+
+ <p>The specified XML document is wrapped in a valid NETCONF <c>rpc</c>
+ request and sent to the server. The <c>message-id</c> and namespace
+ attributes are added to element <c>rpc</c>.</p>
+
+ <p>This function can be used for sending <c>rpc</c> requests that
+ cannot be expressed by other interface functions in this module.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>unlock(Client, Target) -&gt; Result</name>
+ <fsummary>Equivalent to unlock(Client, Target, infinity).</fsummary>
+ <desc><marker id="unlock-2"/>
+ <p>Equivalent to
+ <seealso marker="#unlock-3"><c>ct_netconfc:unlock(Client, Target,
+ infinity)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>unlock(Client, Target, Timeout) -&gt; Result</name>
+ <fsummary>Unlocks the configuration target.</fsummary>
+ <type>
+ <v>Client = client()</v>
+ <v>Target = netconf_db()</v>
+ <v>Timeout = timeout()</v>
+ <v>Result = ok | {error, error_reason()}</v>
+ </type>
+ <desc><marker id="unlock-3"/>
+ <p>Unlocks the configuration target.</p>
+
+ <p>If the client earlier has acquired a lock through
+ <seealso marker="#lock-2"><c>ct_netconfc:lock/2</c></seealso> or
+ <seealso marker="#lock-3"><c>ct_netconfc:lock/3</c></seealso>, this
+ operation releases the associated lock. To access another target
+ than <c>running</c>, the server must support <c>:candidate</c>
+ and/or <c>:startup</c>.</p>
+ </desc>
+ </func>
+ </funcs>
+
+</erlref>
+
+
diff --git a/lib/common_test/doc/src/ct_property_test.xml b/lib/common_test/doc/src/ct_property_test.xml
new file mode 100644
index 0000000000..2e9bd1969c
--- /dev/null
+++ b/lib/common_test/doc/src/ct_property_test.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2010</year><year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>ct_property_test</title>
+ <prepared></prepared>
+ <responsible></responsible>
+ <docno></docno>
+ <approved></approved>
+ <checked></checked>
+ <date></date>
+ <rev>A</rev>
+ <file>ct_property_test.xml</file>
+ </header>
+ <module>ct_property_test</module>
+ <modulesummary>EXPERIMENTAL support in Common Test for calling
+ property-based tests.</modulesummary>
+
+ <description>
+
+ <p>EXPERIMENTAL support in <c>Common Test</c> for calling property-based
+ tests.</p>
+
+ <p>This module is a first step to run property-based tests in the
+ <c>Common Test</c> framework. A property testing tool like QuickCheck
+ or PropEr is assumed to be installed.</p>
+
+ <p>The idea is to have a <c>Common Test</c> test suite calling a property
+ testing tool with special property test suites as defined by that tool.
+ The usual Erlang application directory structure is assumed. The tests
+ are collected in the <c>test</c> directory of the application. The
+ <c>test</c> directory has a subdirectory <c>property_test</c>, where
+ everything needed for the property tests is collected.</p>
+
+ <p>A typical <c>Common Test</c> test suite using <c>ct_property_test</c>
+ is organized as follows:</p>
+
+ <pre>
+ -include_lib("common_test/include/ct.hrl").
+
+ all() -&gt; [prop_ftp_case].
+
+ init_per_suite(Config) -&gt;
+ ct_property_test:init_per_suite(Config).
+
+ %%%---- test case
+ prop_ftp_case(Config) -&gt;
+ ct_property_test:quickcheck(
+ ftp_simple_client_server:prop_ftp(Config),
+ Config
+ ).</pre>
+
+ <warning>
+ <p>This is experimental code that can be changed or removed anytime
+ without any warning.</p>
+ </warning>
+
+ </description>
+
+ <funcs>
+ <func>
+ <name>init_per_suite(Config) -&gt; Config | {skip, Reason}</name>
+ <fsummary>Initializes Config for property testing.</fsummary>
+ <desc><marker id="init_per_suite-1"/>
+ <p>Initializes <c>Config</c> for property testing.</p>
+
+ <p>This function investigates if support is available for either
+ Quickcheck, PropEr, or Triq. The options
+ <c>{property_dir,AbsPath}</c> and <c>{property_test_tool,Tool}</c>
+ are set in the <c>Config</c> returned.</p>
+
+ <p>The function is intended to be called in function
+ <c>init_per_suite</c> in the test suite.</p>
+
+ <p>The property tests are assumed to be in subdirectory
+ <c>property_test</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>quickcheck(Property, Config) -&gt; true | {fail, Reason}</name>
+ <fsummary>Calls quickcheck and returns the result in a form suitable for
+ Common Test.</fsummary>
+ <desc><marker id="quickcheck-2"/>
+ <p>Calls quickcheck and returns the result in a form suitable for
+ <c>Common Test</c>.</p>
+
+ <p>This function is intended to be called in the test cases in the
+ test suite.</p>
+ </desc>
+ </func>
+ </funcs>
+
+</erlref>
+
+
diff --git a/lib/common_test/doc/src/ct_rpc.xml b/lib/common_test/doc/src/ct_rpc.xml
new file mode 100644
index 0000000000..0169727581
--- /dev/null
+++ b/lib/common_test/doc/src/ct_rpc.xml
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2010</year><year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>ct_rpc</title>
+ <prepared></prepared>
+ <responsible></responsible>
+ <docno></docno>
+ <approved></approved>
+ <checked></checked>
+ <date></date>
+ <rev>A</rev>
+ <file>ct_rpc.xml</file>
+ </header>
+ <module>ct_rpc</module>
+ <modulesummary>Common Test specific layer on Erlang/OTP rpc.</modulesummary>
+
+ <description>
+
+ <p><c>Common Test</c> specific layer on Erlang/OTP <c>rpc</c>.</p>
+
+ </description>
+
+ <funcs>
+ <func>
+ <name>app_node(App, Candidates) -&gt; NodeName</name>
+ <fsummary>From a set of candidate nodes determines which of them is
+ running the application App.</fsummary>
+ <type>
+ <v>App = atom()</v>
+ <v>Candidates = [NodeName]</v>
+ <v>NodeName = atom()</v>
+ </type>
+ <desc><marker id="app_node-2"/>
+ <p>From a set of candidate nodes determines which of them is running
+ the application <c>App</c>. If none of the candidate nodes is
+ running <c>App</c>, the function makes the test case calling
+ this function to fail. This function is the same as calling
+ <c>app_node(App, Candidates, true)</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>app_node(App, Candidates, FailOnBadRPC) -&gt; NodeName</name>
+ <fsummary>Same as app_node/2, except that argument FailOnBadRPC
+ determines if the search for a candidate node is to stop if
+ badrpc is received at some point.</fsummary>
+ <type>
+ <v>App = atom()</v>
+ <v>Candidates = [NodeName]</v>
+ <v>NodeName = atom()</v>
+ <v>FailOnBadRPC = true | false</v>
+ </type>
+ <desc><marker id="app_node-3"/>
+ <p>Same as
+ <seealso marker="#app_node-2"><c>ct_rpc:app_node/2</c></seealso>,
+ except that argument <c>FailOnBadRPC</c> determines if the search
+ for a candidate node is to stop if <c>badrpc</c> is received at
+ some point.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>app_node(App, Candidates, FailOnBadRPC, Cookie) -&gt; NodeName</name>
+ <fsummary>Same as app_node/2, except that argument FailOnBadRPC
+ determines if the search for a candidate node is to stop if badrpc is
+ received at some point.</fsummary>
+ <type>
+ <v>App = atom()</v>
+ <v>Candidates = [NodeName]</v>
+ <v>NodeName = atom()</v>
+ <v>FailOnBadRPC = true | false</v>
+ <v>Cookie = atom()</v>
+ </type>
+ <desc><marker id="app_node-4"/>
+ <p>Same as
+ <seealso marker="#app_node-2"><c>ct_rpc:app_node/2</c></seealso>,
+ except that argument <c>FailOnBadRPC</c> determines if the search
+ for a candidate node is to stop if <c>badrpc</c> is received at
+ some point.</p>
+
+ <p>The cookie on the client node is set to <c>Cookie</c> for this
+ <c>rpc</c> operation (used to match the server node cookie).</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>call(Node, Module, Function, Args) -&gt; term() | {badrpc, Reason}</name>
+ <fsummary>Same as call(Node, Module, Function, Args, infinity).</fsummary>
+ <desc><marker id="call-4"/>
+ <p>Same as <c>call(Node, Module, Function, Args, infinity)</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>call(Node, Module, Function, Args, TimeOut) -&gt; term() | {badrpc, Reason}</name>
+ <fsummary>Evaluates apply(Module, Function, Args) on the node
+ Node.</fsummary>
+ <type>
+ <v>Node = NodeName | {Fun, FunArgs}</v>
+ <v>Fun = function()</v>
+ <v>FunArgs = term()</v>
+ <v>NodeName = atom()</v>
+ <v>Module = atom()</v>
+ <v>Function = atom()</v>
+ <v>Args = [term()]</v>
+ <v>Reason = timeout | term()</v>
+ </type>
+ <desc><marker id="call-5"/>
+ <p>Evaluates <c>apply(Module, Function, Args)</c> on the node
+ <c>Node</c>. Returns either whatever <c>Function</c> returns, or
+ <c>{badrpc, Reason}</c> if the remote procedure call fails. If
+ <c>Node</c> is <c>{Fun, FunArgs}</c>, applying <c>Fun</c> to
+ <c>FunArgs</c> is to return a node name.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>call(Node, Module, Function, Args, TimeOut, Cookie) -&gt; term() | {badrpc, Reason}</name>
+ <fsummary>Evaluates apply(Module, Function, Args) on the node
+ Node.</fsummary>
+ <type>
+ <v>Node = NodeName | {Fun, FunArgs}</v>
+ <v>Fun = function()</v>
+ <v>FunArgs = term()</v>
+ <v>NodeName = atom()</v>
+ <v>Module = atom()</v>
+ <v>Function = atom()</v>
+ <v>Args = [term()]</v>
+ <v>Reason = timeout | term()</v>
+ <v>Cookie = atom()</v>
+ </type>
+ <desc><marker id="call-6"/>
+ <p>Evaluates <c>apply(Module, Function, Args)</c> on the node
+ <c>Node</c>. Returns either whatever <c>Function</c> returns, or
+ <c>{badrpc, Reason}</c> if the remote procedure call fails. If
+ <c>Node</c> is <c>{Fun, FunArgs}</c>, applying <c>Fun</c> to
+ <c>FunArgs</c> is to return a node name.</p>
+
+ <p>The cookie on the client node is set to <c>Cookie</c> for this
+ <c>rpc</c> operation (used to match the server node cookie).</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>cast(Node, Module, Function, Args) -&gt; ok</name>
+ <fsummary>Evaluates apply(Module, Function, Args) on the node
+ Node.</fsummary>
+ <type>
+ <v>Node = NodeName | {Fun, FunArgs}</v>
+ <v>Fun = function()</v>
+ <v>FunArgs = term()</v>
+ <v>NodeName = atom()</v>
+ <v>Module = atom()</v>
+ <v>Function = atom()</v>
+ <v>Args = [term()]</v>
+ <v>Reason = timeout | term()</v>
+ </type>
+ <desc><marker id="cast-4"/>
+ <p>Evaluates <c>apply(Module, Function, Args)</c> on the node
+ <c>Node</c>. No response is delivered and the process that makes
+ the call is not suspended until the evaluation is completed as in
+ the case of <c>call/3,4</c>. If <c>Node</c> is
+ <c>{Fun, FunArgs}</c>, applying <c>Fun</c> to <c>FunArgs</c> is to
+ return a node name.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>cast(Node, Module, Function, Args, Cookie) -&gt; ok</name>
+ <fsummary>Evaluates apply(Module, Function, Args) on the node
+ Node.</fsummary>
+ <type>
+ <v>Node = NodeName | {Fun, FunArgs}</v>
+ <v>Fun = function()</v>
+ <v>FunArgs = term()</v>
+ <v>NodeName = atom()</v>
+ <v>Module = atom()</v>
+ <v>Function = atom()</v>
+ <v>Args = [term()]</v>
+ <v>Reason = timeout | term()</v>
+ <v>Cookie = atom()</v>
+ </type>
+ <desc><marker id="cast-5"/>
+ <p>Evaluates <c>apply(Module, Function, Args)</c> on the node
+ <c>Node</c>. No response is delivered and the process that makes
+ the call is not suspended until the evaluation is completed as in
+ the case of <c>call/3,4</c>. If <c>Node</c> is
+ <c>{Fun, FunArgs}</c>, applying <c>Fun</c> to <c>FunArgs</c> is to
+ return a node name.</p>
+
+ <p>The cookie on the client node is set to <c>Cookie</c> for this
+ <c>rpc</c> operation (used to match the server node cookie).</p>
+ </desc>
+ </func>
+ </funcs>
+
+</erlref>
+
+
diff --git a/lib/common_test/doc/src/ct_run.xml b/lib/common_test/doc/src/ct_run.xml
index 5518bb039b..d0ecc38564 100644
--- a/lib/common_test/doc/src/ct_run.xml
+++ b/lib/common_test/doc/src/ct_run.xml
@@ -34,178 +34,189 @@
</header>
<com>ct_run</com>
<comsummary>Program used for starting Common Test from the
- OS command line.
- </comsummary>
+ OS command line.</comsummary>
<description>
<p>The <c>ct_run</c> program is automatically installed with Erlang/OTP
- and Common Test (please see the Installation chapter in the Common
- Test User's Guide for more information). The program accepts a number
- of different start flags. Some flags trigger <c>ct_run</c>
- to start the Common Test application and pass on data to it. Some
- flags start an Erlang node prepared for running Common Test in a
- particular mode.</p>
-
- <p>There is an interface function that corresponds to this program,
- called <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>, for starting Common Test from the Erlang
- shell (or an Erlang program). Please see the <c>ct</c> man page for
- details.</p>
+ and the <c>Common Test</c> application (for more information, see
+ section <seealso marker="install_chapter">Installation</seealso>
+ in the User's Guide). The program accepts different start flags.
+ Some flags trigger <c>ct_run</c> to start <c>Common Test</c> and
+ pass on data to it. Some flags start an Erlang node prepared for
+ running <c>Common Test</c> in a particular mode.</p>
+
+ <p>The interface function
+ <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>,
+ corresponding to the <c>ct_run</c> program, is used for starting
+ <c>Common Test</c> from the Erlang shell (or an Erlang program).
+ For details, see the <seealso marker="ct"><c>ct</c></seealso>
+ manual page.</p>
<p><c>ct_run</c> also accepts Erlang emulator flags. These are used
- when <c>ct_run</c> calls <c>erl</c> to start the Erlang node
- (making it possible to e.g. add directories to the code server path,
- change the cookie on the node, start additional applications, etc).</p>
-
- <p>With the optional flag:</p>
- <pre>-erl_args</pre>
- <p>it's possible to divide the options on the <c>ct_run</c> command line into
- two groups, one that Common Test should process (those preceding <c>-erl_args</c>),
- and one it should completely ignore and pass on directly to the emulator
- (those following <c>-erl_args</c>). Options preceding <c>-erl_args</c> that Common Test
- doesn't recognize, also get passed on to the emulator untouched.
- By means of <c>-erl_args</c> the user may specify flags with the same name, but
+ when <c>ct_run</c> calls <c>erl</c> to start the Erlang node (this
+ makes it possible to add directories to the code server path,
+ change the cookie on the node, start more applications, and so on).</p>
+
+ <p>With the optional flag <c>-erl_args</c>, options on the <c>ct_run</c>
+ command line can be divided into two groups:</p>
+
+ <list type="bulleted">
+ <item>One group that <c>Common Test</c> is to process (those
+ preceding <c>-erl_args</c>).</item>
+ <item>One group that <c>Common Test</c> is to ignore and pass on
+ directly to the emulator (those following <c>-erl_args</c>).</item>
+ </list>
+
+ <p>Options preceding <c>-erl_args</c> that <c>Common Test</c>
+ does not recognize are also passed on to the emulator untouched.
+ By <c>-erl_args</c> the user can specify flags with the same name, but
with different destinations, on the <c>ct_run</c> command line.</p>
- <p>If <c>-pa</c> or <c>-pz</c> flags are specified in the Common Test group of options
- (preceding <c>-erl_args</c>), relative directories will be converted to
- absolute and re-inserted into the code path by Common Test (to avoid
- problems loading user modules when Common Test changes working directory
- during test runs). Common Test will however ignore <c>-pa</c> and <c>-pz</c> flags
- following <c>-erl_args</c> on the command line. These directories are added
- to the code path normally (i.e. on specified form)</p>
-
- <p>Exit status is set before the program ends. Value <c>0</c> indicates a successful
- test result, <c>1</c> indicates one or more failed or auto-skipped test cases, and
- <c>2</c> indicates test execution failure.</p>
-
- <p>If <c>ct_run</c> is called with option:</p>
- <pre>-help</pre>
- <p>it prints all valid start flags to stdout.</p>
- </description>
+ <p>If flags <c>-pa</c> or <c>-pz</c> are specified in the
+ <c>Common Test</c> group of options (preceding <c>-erl_args</c>),
+ relative directories are converted to absolute and reinserted into
+ the code path by <c>Common Test</c>. This is to avoid problems
+ loading user modules when <c>Common Test</c> changes working directory
+ during test runs. However, <c>Common Test</c> ignores flags <c>-pa</c>
+ and <c>-pz</c> following <c>-erl_args</c> on the command line. These
+ directories are added to the code path normally (that is, on specified
+ form).</p>
+
+ <p>Exit status is set before the program ends. Value <c>0</c> indicates
+ a successful test result, <c>1</c> indicates one or more failed or
+ auto-skipped test cases, and <c>2</c> indicates test execution failure.</p>
+
+ <p>If <c>ct_run</c> is called with option <c>-help</c>, it prints all
+ valid start flags to <c>stdout</c>.</p>
+ </description>
<section>
<marker id="ct_run"></marker>
- <title>Run tests from command line</title>
+ <title>Run Tests from Command Line</title>
<pre>
- ct_run -dir TestDir1 TestDir2 .. TestDirN |
- [-dir TestDir] -suite Suite1 Suite2 .. SuiteN
- [-group Groups1 Groups2 .. GroupsN] [-case Case1 Case2 .. CaseN]
- [-step [config | keep_inactive]]
- [-config ConfigFile1 ConfigFile2 .. ConfigFileN]
- [-userconfig CallbackModule1 ConfigString1 and CallbackModule2
- ConfigString2 and .. CallbackModuleN ConfigStringN]
- [-decrypt_key Key] | [-decrypt_file KeyFile]
- [-label Label]
- [-logdir LogDir]
- [-logopts LogOpts]
- [-verbosity GenVLevel | [Category1 VLevel1 and
- Category2 VLevel2 and .. CategoryN VLevelN]]
- [-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]
- [-stylesheet CSSFile]
- [-cover CoverCfgFile]
- [-cover_stop Bool]
- [-event_handler EvHandler1 EvHandler2 .. EvHandlerN] |
- [-event_handler_init EvHandler1 InitArg1 and
- EvHandler2 InitArg2 and .. EvHandlerN InitArgN]
- [-include InclDir1 InclDir2 .. InclDirN]
- [-no_auto_compile]
- [-abort_if_missing_suites]
- [-muliply_timetraps Multiplier]
- [-scale_timetraps]
- [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]
- [-repeat N] |
- [-duration HHMMSS [-force_stop [skip_rest]]] |
- [-until [YYMoMoDD]HHMMSS [-force_stop [skip_rest]]]
- [-basic_html]
- [-ct_hooks CTHModule1 CTHOpts1 and CTHModule2 CTHOpts2 and ..
- CTHModuleN CTHOptsN]
- [-exit_status ignore_config]
- [-help]
- </pre>
+ ct_run -dir TestDir1 TestDir2 .. TestDirN |
+ [-dir TestDir] -suite Suite1 Suite2 .. SuiteN
+ [-group Groups1 Groups2 .. GroupsN] [-case Case1 Case2 .. CaseN]
+ [-step [config | keep_inactive]]
+ [-config ConfigFile1 ConfigFile2 .. ConfigFileN]
+ [-userconfig CallbackModule1 ConfigString1 and CallbackModule2
+ ConfigString2 and .. CallbackModuleN ConfigStringN]
+ [-decrypt_key Key] | [-decrypt_file KeyFile]
+ [-label Label]
+ [-logdir LogDir]
+ [-logopts LogOpts]
+ [-verbosity GenVLevel | [Category1 VLevel1 and
+ Category2 VLevel2 and .. CategoryN VLevelN]]
+ [-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]
+ [-stylesheet CSSFile]
+ [-cover CoverCfgFile]
+ [-cover_stop Bool]
+ [-event_handler EvHandler1 EvHandler2 .. EvHandlerN] |
+ [-event_handler_init EvHandler1 InitArg1 and
+ EvHandler2 InitArg2 and .. EvHandlerN InitArgN]
+ [-include InclDir1 InclDir2 .. InclDirN]
+ [-no_auto_compile]
+ [-abort_if_missing_suites]
+ [-muliply_timetraps Multiplier]
+ [-scale_timetraps]
+ [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]
+ [-repeat N] |
+ [-duration HHMMSS [-force_stop [skip_rest]]] |
+ [-until [YYMoMoDD]HHMMSS [-force_stop [skip_rest]]]
+ [-basic_html]
+ [-ct_hooks CTHModule1 CTHOpts1 and CTHModule2 CTHOpts2 and ..
+ CTHModuleN CTHOptsN]
+ [-exit_status ignore_config]
+ [-help]</pre>
</section>
+
<section>
- <title>Run tests using test specification</title>
+ <title>Run Tests using Test Specification</title>
<pre>
- ct_run -spec TestSpec1 TestSpec2 .. TestSpecN
- [-join_specs]
- [-config ConfigFile1 ConfigFile2 .. ConfigFileN]
- [-userconfig CallbackModule1 ConfigString1 and CallbackModule2
- ConfigString2 and .. and CallbackModuleN ConfigStringN]
- [-decrypt_key Key] | [-decrypt_file KeyFile]
- [-label Label]
- [-logdir LogDir]
- [-logopts LogOpts]
- [-verbosity GenVLevel | [Category1 VLevel1 and
- Category2 VLevel2 and .. CategoryN VLevelN]]
- [-allow_user_terms]
- [-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]
- [-stylesheet CSSFile]
- [-cover CoverCfgFile]
- [-cover_stop Bool]
- [-event_handler EvHandler1 EvHandler2 .. EvHandlerN] |
- [-event_handler_init EvHandler1 InitArg1 and
- EvHandler2 InitArg2 and .. EvHandlerN InitArgN]
- [-include InclDir1 InclDir2 .. InclDirN]
- [-no_auto_compile]
- [-abort_if_missing_suites]
- [-muliply_timetraps Multiplier]
- [-scale_timetraps]
- [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]
- [-repeat N] |
- [-duration HHMMSS [-force_stop [skip_rest]]] |
- [-until [YYMoMoDD]HHMMSS [-force_stop [skip_rest]]]
- [-basic_html]
- [-ct_hooks CTHModule1 CTHOpts1 and CTHModule2 CTHOpts2 and ..
- CTHModuleN CTHOptsN]
- [-exit_status ignore_config]
- </pre>
+ ct_run -spec TestSpec1 TestSpec2 .. TestSpecN
+ [-join_specs]
+ [-config ConfigFile1 ConfigFile2 .. ConfigFileN]
+ [-userconfig CallbackModule1 ConfigString1 and CallbackModule2
+ ConfigString2 and .. and CallbackModuleN ConfigStringN]
+ [-decrypt_key Key] | [-decrypt_file KeyFile]
+ [-label Label]
+ [-logdir LogDir]
+ [-logopts LogOpts]
+ [-verbosity GenVLevel | [Category1 VLevel1 and
+ Category2 VLevel2 and .. CategoryN VLevelN]]
+ [-allow_user_terms]
+ [-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]
+ [-stylesheet CSSFile]
+ [-cover CoverCfgFile]
+ [-cover_stop Bool]
+ [-event_handler EvHandler1 EvHandler2 .. EvHandlerN] |
+ [-event_handler_init EvHandler1 InitArg1 and
+ EvHandler2 InitArg2 and .. EvHandlerN InitArgN]
+ [-include InclDir1 InclDir2 .. InclDirN]
+ [-no_auto_compile]
+ [-abort_if_missing_suites]
+ [-muliply_timetraps Multiplier]
+ [-scale_timetraps]
+ [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]
+ [-repeat N] |
+ [-duration HHMMSS [-force_stop [skip_rest]]] |
+ [-until [YYMoMoDD]HHMMSS [-force_stop [skip_rest]]]
+ [-basic_html]
+ [-ct_hooks CTHModule1 CTHOpts1 and CTHModule2 CTHOpts2 and ..
+ CTHModuleN CTHOptsN]
+ [-exit_status ignore_config]</pre>
</section>
+
<section>
- <title>Run tests in web based GUI</title>
+ <title>Run Tests in Web-Based GUI</title>
<pre>
- ct_run -vts [-browser Browser]
- [-dir TestDir1 TestDir2 .. TestDirN] |
- [[dir TestDir] -suite Suite [[-group Group] [-case Case]]]
- [-config ConfigFile1 ConfigFile2 .. ConfigFileN]
- [-userconfig CallbackModule1 ConfigString1 and CallbackModule2
- ConfigString2 and .. and CallbackModuleN ConfigStringN]
- [-logopts LogOpts]
- [-verbosity GenVLevel | [Category1 VLevel1 and
- Category2 VLevel2 and .. CategoryN VLevelN]]
- [-decrypt_key Key] | [-decrypt_file KeyFile]
- [-include InclDir1 InclDir2 .. InclDirN]
- [-no_auto_compile]
- [-abort_if_missing_suites]
- [-muliply_timetraps Multiplier]
- [-scale_timetraps]
- [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]
- [-basic_html]</pre>
+ ct_run -vts [-browser Browser]
+ [-dir TestDir1 TestDir2 .. TestDirN] |
+ [[dir TestDir] -suite Suite [[-group Group] [-case Case]]]
+ [-config ConfigFile1 ConfigFile2 .. ConfigFileN]
+ [-userconfig CallbackModule1 ConfigString1 and CallbackModule2
+ ConfigString2 and .. and CallbackModuleN ConfigStringN]
+ [-logopts LogOpts]
+ [-verbosity GenVLevel | [Category1 VLevel1 and
+ Category2 VLevel2 and .. CategoryN VLevelN]]
+ [-decrypt_key Key] | [-decrypt_file KeyFile]
+ [-include InclDir1 InclDir2 .. InclDirN]
+ [-no_auto_compile]
+ [-abort_if_missing_suites]
+ [-muliply_timetraps Multiplier]
+ [-scale_timetraps]
+ [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]
+ [-basic_html]</pre>
</section>
+
<section>
- <title>Refresh the HTML index files</title>
+ <title>Refresh HTML Index Files</title>
<pre>
- ct_run -refresh_logs [-logdir LogDir] [-basic_html]</pre>
+ ct_run -refresh_logs [-logdir LogDir] [-basic_html]</pre>
</section>
+
<section>
- <title>Run CT in interactive mode</title>
+ <title>Run Common Test in Interactive Mode</title>
<pre>
- ct_run -shell
- [-config ConfigFile1 ConfigFile2 ... ConfigFileN]
- [-userconfig CallbackModule1 ConfigString1 and CallbackModule2
- ConfigString2 and .. and CallbackModuleN ConfigStringN]
- [-decrypt_key Key] | [-decrypt_file KeyFile]</pre>
+ ct_run -shell
+ [-config ConfigFile1 ConfigFile2 ... ConfigFileN]
+ [-userconfig CallbackModule1 ConfigString1 and CallbackModule2
+ ConfigString2 and .. and CallbackModuleN ConfigStringN]
+ [-decrypt_key Key] | [-decrypt_file KeyFile]</pre>
</section>
+
<section>
- <title>Start a Common Test Master node</title>
+ <title>Start a Common Test Master Node</title>
<pre>
- ct_run -ctmaster</pre>
+ ct_run -ctmaster</pre>
</section>
<section>
- <title>See also</title>
- <p>Please read the <seealso marker="run_test_chapter">Running Test Suites</seealso>
- chapter in the Common Test User's Guide for information about the meaning of the
- different start flags.</p>
+ <title>See Also</title>
+ <p>For information about the start flags, see section
+ <seealso marker="run_test_chapter">Running Tests and Analyzing
+ Results</seealso> in the User's Guide.</p>
</section>
</comref>
+
diff --git a/lib/common_test/doc/src/ct_slave.xml b/lib/common_test/doc/src/ct_slave.xml
new file mode 100644
index 0000000000..44a7b7873f
--- /dev/null
+++ b/lib/common_test/doc/src/ct_slave.xml
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2010</year><year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>ct_slave</title>
+ <prepared></prepared>
+ <responsible></responsible>
+ <docno></docno>
+ <approved></approved>
+ <checked></checked>
+ <date></date>
+ <rev>A</rev>
+ <file>ct_slave.xml</file>
+ </header>
+ <module>ct_slave</module>
+ <modulesummary>Common Test framework functions for starting and stopping
+ nodes for Large-Scale Testing.</modulesummary>
+
+ <description>
+
+ <p><c>Common Test</c> framework functions for starting and stopping nodes
+ for Large-Scale Testing.</p>
+
+ <p>This module exports functions used by the <c>Common Test</c>
+ Master to start and stop "slave" nodes. It is the default callback
+ module for the <c>{init, node_start}</c> term in the Test
+ Specification.</p>
+
+ </description>
+
+ <funcs>
+ <func>
+ <name>start(Node) -&gt; Result</name>
+ <fsummary>Starts an Erlang node with name Node on the local
+ host.</fsummary>
+ <type>
+ <v>Node = atom()</v>
+ <v>Result = {ok, NodeName} | {error, Reason, NodeName}</v>
+ <v>Reason = already_started | started_not_connected | boot_timeout | init_timeout | startup_timeout | not_alive</v>
+ <v>NodeName = atom()</v>
+ </type>
+ <desc><marker id="start-1"/>
+ <p>Starts an Erlang node with name <c>Node</c> on the local host.</p>
+
+ <p>See also
+ <seealso marker="#start-3"><c>ct_slave:start/3</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>start(HostOrNode, NodeOrOpts) -&gt; Result</name>
+ <fsummary>Starts an Erlang node with default options on a specified
+ host, or on the local host with specified options.</fsummary>
+ <type>
+ <v>HostOrNode = atom()</v>
+ <v>NodeOrOpts = atom() | list()</v>
+ <v>Result = {ok, NodeName} | {error, Reason, NodeName}</v>
+ <v>Reason = already_started | started_not_connected | boot_timeout | init_timeout | startup_timeout | not_alive</v>
+ <v>NodeName = atom()</v>
+ </type>
+ <desc><marker id="start-2"/>
+ <p>Starts an Erlang node with default options on a specified host, or
+ on the local host with specified options. That is, the call is
+ interpreted as <c>start(Host, Node)</c> when the second argument is
+ atom-valued and <c>start(Node, Opts)</c> when it is list-valued.</p>
+
+ <p>See also
+ <seealso marker="#start-3"><c>ct_slave:start/3</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>start(Host, Node, Opts) -&gt; Result</name>
+ <fsummary>Starts an Erlang node with name Node on host Host as
+ specified by the combination of options in Opts.</fsummary>
+ <type>
+ <v>Node = atom()</v>
+ <v>Host = atom()</v>
+ <v>Opts = [OptTuples]</v>
+ <v>OptTuples = {username, Username} | {password, Password} | {boot_timeout, BootTimeout} | {init_timeout, InitTimeout} | {startup_timeout, StartupTimeout} | {startup_functions, StartupFunctions} | {monitor_master, Monitor} | {kill_if_fail, KillIfFail} | {erl_flags, ErlangFlags} | {env, [{EnvVar, Value}]}</v>
+ <v>Username = string()</v>
+ <v>Password = string()</v>
+ <v>BootTimeout = integer()</v>
+ <v>InitTimeout = integer()</v>
+ <v>StartupTimeout = integer()</v>
+ <v>StartupFunctions = [StartupFunctionSpec]</v>
+ <v>StartupFunctionSpec = {Module, Function, Arguments}</v>
+ <v>Module = atom()</v>
+ <v>Function = atom()</v>
+ <v>Arguments = [term]</v>
+ <v>Monitor = bool()</v>
+ <v>KillIfFail = bool()</v>
+ <v>ErlangFlags = string()</v>
+ <v>EnvVar = string()</v>
+ <v>Value = string()</v>
+ <v>Result = {ok, NodeName} | {error, Reason, NodeName}</v>
+ <v>Reason = already_started | started_not_connected | boot_timeout | init_timeout | startup_timeout | not_alive</v>
+ <v>NodeName = atom()</v>
+ </type>
+ <desc><marker id="start-3"/>
+ <p>Starts an Erlang node with name <c>Node</c> on host <c>Host</c> as
+ specified by the combination of options in <c>Opts</c>.</p>
+
+ <p>Options <c>Username</c> and <c>Password</c> are used to log on to the
+ remote host <c>Host</c>. <c>Username</c>, if omitted, defaults to
+ the current username. <c>Password</c> is empty by default.</p>
+
+ <p>A list of functions specified in option <c>Startup</c> are
+ executed after startup of the node. Notice that all used modules
+ are to be present in the code path on <c>Host</c>.</p>
+
+ <p>The time-outs are applied as follows:</p>
+
+ <taglist>
+ <tag><c>BootTimeout</c></tag>
+ <item><p>The time to start the Erlang node, in seconds. Defaults to
+ 3 seconds. If the node is not pingable within this time, the result
+ <c>{error, boot_timeout, NodeName}</c> is returned.</p></item>
+ <tag><c>InitTimeout</c></tag>
+ <item><p>The time to wait for the node until it calls the internal
+ callback function informing master about a successful startup.
+ Defaults to 1 second. In case of a timed out message, the result
+ <c>{error, init_timeout, NodeName}</c> is returned.</p></item>
+ <tag><c>StartupTimeout</c></tag>
+ <item><p>The time to wait until the node stops to run
+ <c>StartupFunctions</c>. Defaults to 1 second. If this time-out
+ occurs, the result <c>{error, startup_timeout, NodeName}</c> is
+ returned.</p></item>
+ </taglist>
+
+ <p><em>Options:</em></p>
+
+ <taglist>
+ <tag><c>monitor_master</c></tag>
+ <item><p>Specifies if the slave node is to be stopped if the
+ master node stops. Defaults to <c>false</c>.</p></item>
+ <tag><c>kill_if_fail</c></tag>
+ <item><p>Specifies if the slave node is to be killed if a time-out
+ occurs during initialization or startup. Defaults to <c>true</c>.
+ Notice that the node can also be still alive it the boot time-out
+ occurred, but it is not killed in this case.</p></item>
+ <tag><c>erlang_flags</c></tag>
+ <item><p>Specifies which flags are added to the parameters of the
+ executable <c>erl</c>.</p></item>
+ <tag><c>env</c></tag>
+ <item><p>Specifies a list of environment variables that will extend
+ the environment.</p></item>
+ </taglist>
+
+ <p><em>Special return values:</em></p>
+
+ <list type="bulleted">
+ <item><p><c>{error, already_started, NodeName}</c> if the node
+ with the specified name is already started on a specified
+ host.</p></item>
+ <item><p><c>{error, started_not_connected, NodeName}</c> if the
+ node is started, but not connected to the master node.</p></item>
+ <item><p><c>{error, not_alive, NodeName}</c> if the node on which
+ <seealso marker="#start-3"><c>ct_slave:start/3</c></seealso> is
+ called, is not alive. Notice that <c>NodeName</c> is the name of
+ the current node in this case.</p></item>
+ </list>
+ </desc>
+ </func>
+
+ <func>
+ <name>stop(Node) -&gt; Result</name>
+ <fsummary>Stops the running Erlang node with name Node on the local
+ host.</fsummary>
+ <type>
+ <v>Node = atom()</v>
+ <v>Result = {ok, NodeName} | {error, Reason, NodeName}</v>
+ <v>Reason = not_started | not_connected | stop_timeout</v>
+ </type>
+ <desc><marker id="stop-1"/>
+ <p>Stops the running Erlang node with name <c>Node</c> on the local
+ host.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>stop(Host, Node) -&gt; Result</name>
+ <fsummary>Stops the running Erlang node with name Node on host
+ Host.</fsummary>
+ <type>
+ <v>Host = atom()</v>
+ <v>Node = atom()</v>
+ <v>Result = {ok, NodeName} | {error, Reason, NodeName}</v>
+ <v>Reason = not_started | not_connected | stop_timeout</v>
+ <v>NodeName = atom()</v>
+ </type>
+ <desc><marker id="stop-2"/>
+ <p>Stops the running Erlang node with name <c>Node</c> on host
+ <c>Host</c>.</p>
+ </desc>
+ </func>
+ </funcs>
+
+</erlref>
+
+
diff --git a/lib/common_test/doc/src/ct_snmp.xml b/lib/common_test/doc/src/ct_snmp.xml
new file mode 100644
index 0000000000..d001fb24ec
--- /dev/null
+++ b/lib/common_test/doc/src/ct_snmp.xml
@@ -0,0 +1,523 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2010</year><year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>ct_snmp</title>
+ <prepared></prepared>
+ <responsible></responsible>
+ <docno></docno>
+ <approved></approved>
+ <checked></checked>
+ <date></date>
+ <rev>A</rev>
+ <file>ct_snmp.xml</file>
+ </header>
+ <module>ct_snmp</module>
+ <modulesummary>Common Test user interface module for the SNMP application.</modulesummary>
+
+ <description>
+
+ <p><c>Common Test</c> user interface module for the <c>SNMP</c>
+ application.</p>
+
+ <p>The purpose of this module is to simplify SNMP configuration for the
+ test case writer. Many test cases can use default values for common
+ operations and then no SNMP configuration files need to be supplied.
+ When it is necessary to change particular configuration parameters, a
+ subset of the relevant SNMP configuration files can be passed to
+ <c>ct_snmp</c> by <c>Common Test</c> configuration files. For more
+ specialized configuration parameters, a simple SNMP configuration file
+ can be placed in the test suite data directory. To simplify the test
+ suite, <c>Common Test</c> keeps track of some of the SNMP manager
+ information. This way the test suite does not have to handle as many
+ input parameters as if it had to interface wthe OTP SNMP manager
+ directly.</p>
+
+ <p><em>Configurable SNMP Manager and Agent Parameters:</em></p>
+
+ <p>Manager configuration:</p>
+
+ <taglist>
+ <tag><c>[{start_manager, boolean()}</c></tag>
+ <item><p>Optional. Default is <c>true</c>.</p></item>
+ <tag><c>{users, [{user_name(), [call_back_module(), user_data()]}]}</c></tag>
+ <item><p>Optional.</p></item>
+ <tag><c>{usm_users, [{usm_user_name(), [usm_config()]}]}</c></tag>
+ <item><p>Optional. SNMPv3 only.</p></item>
+ <tag><c>{managed_agents,[{agent_name(), [user_name(), agent_ip(), agent_port(), [agent_config()]]}]}</c></tag>
+ <item><p><c>managed_agents</c> is optional.</p></item>
+ <tag><c>{max_msg_size, integer()}</c></tag>
+ <item><p>Optional. Default is <c>484</c>.</p></item>
+ <tag><c>{mgr_port, integer()}</c></tag>
+ <item><p>Optional. Default is <c>5000</c>.</p></item>
+ <tag><c>{engine _id, string()}</c></tag>
+ <item><p>Optional. Default is <c>"mgrEngine"</c>.</p></item>
+ </taglist>
+
+ <p>Agent configuration:</p>
+
+ <taglist>
+ <tag><c>{start_agent, boolean()}</c></tag>
+ <item><p>Optional. Default is <c>false</c>.</p></item>
+ <tag><c>{agent_sysname, string()}</c></tag>
+ <item><p>Optional. Default is <c>"ct_test"</c>.</p></item>
+ <tag><c>{agent_manager_ip, manager_ip()}</c></tag>
+ <item><p>Optional. Default is <c>localhost</c>.</p></item>
+ <tag><c>{agent_vsns, list()}</c></tag>
+ <item><p>Optional. Default is <c>[v2]</c>.</p></item>
+ <tag><c>{agent_trap_udp, integer()}</c></tag>
+ <item><p>Optional. Default is <c>5000</c>.</p></item>
+ <tag><c>{agent_udp, integer()}</c></tag>
+ <item><p>Optional. Default is <c>4000</c>.</p></item>
+ <tag><c>{agent_notify_type, atom()}</c></tag>
+ <item><p>Optional. Default is <c>trap</c>.</p></item>
+ <tag><c>{agent_sec_type, sec_type()}</c></tag>
+ <item><p>Optional. Default is <c>none</c>.</p></item>
+ <tag><c>{agent_passwd, string()}</c></tag>
+ <item><p>Optional. Default is <c>""</c>.</p></item>
+ <tag><c>{agent_engine_id, string()}</c></tag>
+ <item><p>Optional. Default is <c>"agentEngine"</c>.</p></item>
+ <tag><c>{agent_max_msg_size, string()}</c></tag>
+ <item><p>Optional. Default is <c>484</c>.</p></item>
+ </taglist>
+
+ <p>The following parameters represents the SNMP configuration files
+ <c>context.conf</c>, <c>standard.conf</c>, <c>community.conf</c>,
+ <c>vacm.conf</c>, <c>usm.conf</c>, <c>notify.conf</c>,
+ <c>target_addr.conf</c>, and <c>target_params.conf</c>. Notice that
+ all values in <c>agent.conf</c> can be modified by the parameters
+ listed above. All these configuration files have default values set by
+ the <c>SNMP</c> application. These values can be overridden by suppling
+ a list of valid configuration values or a file located in the test
+ suites data directory, which can produce a list of valid configuration
+ values if you apply function <c>file:consult/1</c> to the file.</p>
+
+ <taglist>
+ <tag><c>{agent_contexts, [term()] | {data_dir_file, rel_path()}}</c></tag>
+ <item><p>Optional.</p></item>
+ <tag><c>{agent_community, [term()] | {data_dir_file, rel_path()}}</c></tag>
+ <item><p>Optional.</p></item>
+ <tag><c>{agent_sysinfo, [term()] | {data_dir_file, rel_path()}}</c></tag>
+ <item><p>Optional.</p></item>
+ <tag><c>{agent_vacm, [term()] | {data_dir_file, rel_path()}}</c></tag>
+ <item><p>Optional.</p></item>
+ <tag><c>{agent_usm, [term()] | {data_dir_file, rel_path()}}</c></tag>
+ <item><p>Optional.</p></item>
+ <tag><c>{agent_notify_def, [term()] | {data_dir_file, rel_path()}}</c></tag>
+ <item><p>Optional.</p></item>
+ <tag><c>{agent_target_address_def, [term()] | {data_dir_file, rel_path()}}</c></tag>
+ <item><p>Optional.</p></item>
+ <tag><c>{agent_target_param_def, [term()] | {data_dir_file, rel_path()}}</c></tag>
+ <item><p>Optional.</p></item>
+ </taglist>
+
+ <p>Parameter <c>MgrAgentConfName</c> in the functions is to be a name
+ you allocate in your test suite using a <c>require</c> statement.
+ Example (where <c>MgrAgentConfName = snmp_mgr_agent</c>):</p>
+
+ <pre>
+ suite() -&gt; [{require, snmp_mgr_agent, snmp}].</pre>
+
+ <p>or</p>
+
+ <pre>
+ ct:require(snmp_mgr_agent, snmp).</pre>
+
+ <p>Notice that USM users are needed for SNMPv3 configuration and are
+ not to be confused with users.</p>
+
+ <p>SNMP traps, inform, and report messages are handled by the user
+ callback module. For details, see the
+ <seealso marker="snmp:index"><c>SNMP</c></seealso> application.</p>
+
+ <p>It is recommended to use the <c>.hrl</c> files created by the
+ Erlang/OTP MIB compiler to define the Object Identifiers (OIDs).
+ For example, to get the Erlang node name from <c>erlNodeTable</c>
+ in the OTP-MIB:</p>
+
+ <pre>
+ Oid = ?erlNodeEntry ++ [?erlNodeName, 1]</pre>
+
+ <p>Furthermore, values can be set for <c>SNMP</c> application configuration
+ parameters, <c>config</c>, <c>server</c>, <c>net_if</c>, and so on (for
+ a list of valid parameters and types, see the <seealso marker="snmp:users_guide"><c>User's Guide for the SNMP application</c></seealso>). This is
+ done by defining a configuration data variable on the following form:</p>
+
+ <pre>
+ {snmp_app, [{manager, [snmp_app_manager_params()]},
+ {agent, [snmp_app_agent_params()]}]}.</pre>
+
+ <p>A name for the data must be allocated in the suite using
+ <c>require</c> (see the example above). Pass this name as argument
+ <c>SnmpAppConfName</c> to
+ <seealso marker="#start-3"><c>ct_snmp:start/3</c></seealso>.
+ <c>ct_snmp</c> specifies default values for some <c>SNMP</c> application
+ configuration parameters (such as <c>{verbosity,trace}</c> for parameter
+ <c>config</c>). This set of defaults is merged with the parameters
+ specified by the user. The user values override <c>ct_snmp</c>
+ defaults.</p>
+
+ </description>
+
+ <section>
+ <title>Data Types</title>
+ <marker id="types"/>
+ <taglist>
+ <tag><c>agent_config() = {Item, Value}</c></tag>
+ <item><marker id="type-agent_config"/> </item>
+ <tag><c>agent_ip() = ip()</c></tag>
+ <item><marker id="type-agent_ip"/> </item>
+ <tag><c>agent_name() = atom()</c></tag>
+ <item><marker id="type-agent_name"/> </item>
+ <tag><c>agent_port() = integer()</c></tag>
+ <item><marker id="type-agent_port"/> </item>
+ <tag><c>call_back_module() = atom()</c></tag>
+ <item><marker id="type-call_back_module"/> </item>
+ <tag><c>error_index() = integer()</c></tag>
+ <item><marker id="type-error_index"/> </item>
+ <tag><c>error_status() = noError | atom()</c></tag>
+ <item><marker id="type-error_status"/> </item>
+ <tag><c>ip() = string() | {integer(), integer(), integer(), integer()}</c></tag>
+ <item><marker id="type-ip"/> </item>
+ <tag><c>manager_ip() = ip()</c></tag>
+ <item><marker id="type-manager_ip"/> </item>
+ <tag><c>oid() = [byte()]</c></tag>
+ <item><marker id="type-oid"/> </item>
+ <tag><c>oids() = [oid()]</c></tag>
+ <item><marker id="type-oids"/> </item>
+ <tag><c>rel_path() = string()</c></tag>
+ <item><marker id="type-rel_path"/> </item>
+ <tag><c>sec_type() = none | minimum | semi</c></tag>
+ <item><marker id="type-sec_type"/> </item>
+ <tag><c>snmp_app_agent_params() = term()</c></tag>
+ <item><marker id="type-snmp_app_agent_params"/> </item>
+ <tag><c>snmp_app_manager_params() = term()</c></tag>
+ <item><marker id="type-snmp_app_manager_params"/> </item>
+ <tag><c>snmpreply() = {error_status(), error_index(), varbinds()}</c></tag>
+ <item><marker id="type-snmpreply"/> </item>
+ <tag><c>user_data() = term()</c></tag>
+ <item><marker id="type-user_data"/> </item>
+ <tag><c>user_name() = atom()</c></tag>
+ <item><marker id="type-user_name"/> </item>
+ <tag><c>usm_config() = {Item, Value}</c></tag>
+ <item><marker id="type-usm_config"/> </item>
+ <tag><c>usm_user_name() = string()</c></tag>
+ <item><marker id="type-usm_user_name"/> </item>
+ <tag><c>value_type() = o('OBJECT IDENTIFIER') | i('INTEGER') | u('Unsigned32') | g('Unsigned32') | s('OCTET STRING')</c></tag>
+ <item><marker id="type-value_type"/> </item>
+ <tag><c>var_and_val() = {oid(), value_type(), value()}</c></tag>
+ <item><marker id="type-var_and_val"/> </item>
+ <tag><c>varbind() = term()</c></tag>
+ <item><marker id="type-varbind"/> </item>
+ <tag><c>varbinds() = [varbind()]</c></tag>
+ <item><marker id="type-varbinds"/> </item>
+ <tag><c>varsandvals() = [var_and_val()]</c></tag>
+ <item><marker id="type-varsandvals"/> </item>
+ </taglist>
+ <p>These data types are described in the documentation for
+ the <seealso marker="snmp:index"><c>SNMP</c></seealso> application.</p>
+ </section>
+
+ <funcs>
+ <func>
+ <name>get_next_values(Agent, Oids, MgrAgentConfName) -&gt; SnmpReply</name>
+ <fsummary>Issues a synchronous SNMP get next request.</fsummary>
+ <type>
+ <v>Agent = agent_name()</v>
+ <v>Oids = oids()</v>
+ <v>MgrAgentConfName = atom()</v>
+ <v>SnmpReply = snmpreply()</v>
+ </type>
+ <desc><marker id="get_next_values-3"/>
+ <p>Issues a synchronous SNMP <c>get next</c> request.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_values(Agent, Oids, MgrAgentConfName) -&gt; SnmpReply</name>
+ <fsummary>Issues a synchronous SNMP get request.</fsummary>
+ <type>
+ <v>Agent = agent_name()</v>
+ <v>Oids = oids()</v>
+ <v>MgrAgentConfName = atom()</v>
+ <v>SnmpReply = snmpreply()</v>
+ </type>
+ <desc><marker id="get_values-3"/>
+ <p>Issues a synchronous SNMP <c>get</c> request.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>load_mibs(Mibs) -&gt; ok | {error, Reason}</name>
+ <fsummary>Loads the MIBs into agent snmp_master_agent.</fsummary>
+ <type>
+ <v>Mibs = [MibName]</v>
+ <v>MibName = string()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="load_mibs-1"/>
+ <p>Loads the MIBs into agent <c>snmp_master_agent</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>register_agents(MgrAgentConfName, ManagedAgents) -&gt; ok | {error, Reason}</name>
+ <fsummary>Explicitly instructs the manager to handle this
+ agent.</fsummary>
+ <type>
+ <v>MgrAgentConfName = atom()</v>
+ <v>ManagedAgents = [agent()]</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="register_agents-2"/>
+ <p>Explicitly instructs the manager to handle this agent. Corresponds
+ to making an entry in <c>agents.conf</c>.</p>
+
+ <p>This function tries to register the specified managed agents, without
+ checking if any of them exist. To change a registered managed agent,
+ the agent must first be unregistered.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>register_users(MgrAgentConfName, Users) -&gt; ok | {error, Reason}</name>
+ <fsummary>Registers the manager entity (=user) responsible for specific
+ agent(s).</fsummary>
+ <type>
+ <v>MgrAgentConfName = atom()</v>
+ <v>Users = [user()]</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="register_users-2"/>
+ <p>Registers the manager entity (=user) responsible for specific
+ agent(s). Corresponds to making an entry in <c>users.conf</c>.</p>
+
+ <p>This function tries to register the specified users, without checking
+ if any of them exist. To change a registered user, the user must
+ first be unregistered.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>register_usm_users(MgrAgentConfName, UsmUsers) -&gt; ok | {error, Reason}</name>
+ <fsummary>Explicitly instructs the manager to handle this USM user.</fsummary>
+ <type>
+ <v>MgrAgentConfName = atom()</v>
+ <v>UsmUsers = [usm_user()]</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="register_usm_users-2"/>
+ <p>Explicitly instructs the manager to handle this USM user.
+ Corresponds to making an entry in <c>usm.conf</c>.</p>
+
+ <p>This function tries to register the specified users, without checking
+ if any of them exist. To change a registered user, the user must
+ first be unregistered.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>set_info(Config) -&gt; [{Agent, OldVarsAndVals, NewVarsAndVals}]</name>
+ <fsummary>Returns a list of all successful set requests performed in the
+ test case in reverse order.</fsummary>
+ <type>
+ <v>Config = [{Key, Value}]</v>
+ <v>Agent = agent_name()</v>
+ <v>OldVarsAndVals = varsandvals()</v>
+ <v>NewVarsAndVals = varsandvals()</v>
+ </type>
+ <desc><marker id="set_info-1"/>
+ <p>Returns a list of all successful <c>set</c> requests performed in
+ the test case in reverse order. The list contains the involved user
+ and agent, the value before <c>set</c>, and the new value. This is
+ intended to simplify the cleanup in function <c>end_per_testcase</c>,
+ that is, the undoing of the <c>set</c> requests and their possible
+ side-effects.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>set_values(Agent, VarsAndVals, MgrAgentConfName, Config) -&gt; SnmpReply</name>
+ <fsummary>Issues a synchronous SNMP set request.</fsummary>
+ <type>
+ <v>Agent = agent_name()</v>
+ <v>Oids = oids()</v>
+ <v>MgrAgentConfName = atom()</v>
+ <v>Config = [{Key, Value}]</v>
+ <v>SnmpReply = snmpreply()</v>
+ </type>
+ <desc><marker id="set_values-4"/>
+ <p>Issues a synchronous SNMP <c>set</c> request.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>start(Config, MgrAgentConfName) -&gt; ok</name>
+ <fsummary>Equivalent to start(Config, MgrAgentConfName,
+ undefined).</fsummary>
+ <desc><marker id="start-2"/>
+ <p>Equivalent to
+ <seealso marker="#start-3"><c>ct_snmp:start(Config, MgrAgentConfName,
+ undefined)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>start(Config, MgrAgentConfName, SnmpAppConfName) -&gt; ok</name>
+ <fsummary>Starts an SNMP manager and/or agent.</fsummary>
+ <type>
+ <v>Config = [{Key, Value}]</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ <v>MgrAgentConfName = atom()</v>
+ <v>SnmpConfName = atom()</v>
+ </type>
+ <desc><marker id="start-3"/>
+ <p>Starts an SNMP manager and/or agent. In the manager case,
+ registrations of users and agents, as specified by the configuration
+ <c>MgrAgentConfName</c>, are performed. When using SNMPv3, called
+ USM users are also registered. Users, <c>usm_users</c>, and
+ managed agents can also be registered later using
+ <seealso marker="#register_users-2"><c>ct_snmp:register_users/2</c></seealso>,
+ <seealso marker="#register_agents-2"><c>ct_snmp:register_agents/2</c></seealso>,
+ and
+ <seealso marker="#register_usm_users-2"><c>ct_snmp:register_usm_users/2</c></seealso>.</p>
+
+ <p>The agent started is called <c>snmp_master_agent</c>. Use
+ <seealso marker="#load_mibs-1"><c>ct_snmp:load_mibs/1</c></seealso>
+ to load MIBs into the agent.</p>
+
+ <p>With <c>SnmpAppConfName</c> SNMP applications can be configured
+ with parameters <c>config</c>, <c>mibs</c>, <c>net_if</c>, and so on.
+ The values are merged with (and possibly override) default values
+ set by <c>ct_snmp</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>stop(Config) -&gt; ok</name>
+ <fsummary>Stops the SNMP manager and/or agent, and removes all files
+ created.</fsummary>
+ <type>
+ <v>Config = [{Key, Value}]</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ </type>
+ <desc><marker id="stop-1"/>
+ <p>Stops the SNMP manager and/or agent, and removes all files
+ created.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>unload_mibs(Mibs) -&gt; ok | {error, Reason}</name>
+ <fsummary>Unloads the MIBs from agent snmp_master_agent.</fsummary>
+ <type>
+ <v>Mibs = [MibName]</v>
+ <v>MibName = string()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="unload_mibs-1"/>
+ <p>Unloads the MIBs from agent <c>snmp_master_agent</c>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>unregister_agents(MgrAgentConfName) -&gt; ok</name>
+ <fsummary>Unregisters all managed agents.</fsummary>
+ <type>
+ <v>MgrAgentConfName = atom()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="unregister_agents-1"/>
+ <p>Unregisters all managed agents.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>unregister_agents(MgrAgentConfName, ManagedAgents) -&gt; ok</name>
+ <fsummary>Unregisters the specified managed agents.</fsummary>
+ <type>
+ <v>MgrAgentConfName = atom()</v>
+ <v>ManagedAgents = [agent_name()]</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="unregister_agents-2"/>
+ <p>Unregisters the specified managed agents.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>unregister_users(MgrAgentConfName) -&gt; ok</name>
+ <fsummary>Unregisters all users.</fsummary>
+ <type>
+ <v>MgrAgentConfName = atom()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="unregister_users-1"/>
+ <p>Unregisters all users.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>unregister_users(MgrAgentConfName, Users) -&gt; ok</name>
+ <fsummary>Unregisters the specified users.</fsummary>
+ <type>
+ <v>MgrAgentConfName = atom()</v>
+ <v>Users = [user_name()]</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="unregister_users-2"/>
+ <p>Unregisters the specified users.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>unregister_usm_users(MgrAgentConfName) -&gt; ok</name>
+ <fsummary>Unregisters all USM users.</fsummary>
+ <type>
+ <v>MgrAgentConfName = atom()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="unregister_usm_users-1"/>
+ <p>Unregisters all USM users.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>unregister_usm_users(MgrAgentConfName, UsmUsers) -&gt; ok</name>
+ <fsummary>Unregisters the specified USM users.</fsummary>
+ <type>
+ <v>MgrAgentConfName = atom()</v>
+ <v>UsmUsers = [usm_user_name()]</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="unregister_usm_users-2"/>
+ <p>Unregisters the specified USM users.</p>
+ </desc>
+ </func>
+ </funcs>
+
+</erlref>
+
+
diff --git a/lib/common_test/doc/src/ct_ssh.xml b/lib/common_test/doc/src/ct_ssh.xml
new file mode 100644
index 0000000000..92b1f60b8c
--- /dev/null
+++ b/lib/common_test/doc/src/ct_ssh.xml
@@ -0,0 +1,1150 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2010</year><year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>ct_ssh</title>
+ <prepared></prepared>
+ <responsible></responsible>
+ <docno></docno>
+ <approved></approved>
+ <checked></checked>
+ <date></date>
+ <rev>A</rev>
+ <file>ct_ssh.xml</file>
+ </header>
+ <module>ct_ssh</module>
+ <modulesummary>SSH/SFTP client module.</modulesummary>
+
+<description>
+
+ <p>SSH/SFTP client module.</p>
+
+ <p>This module uses application <c>SSH</c>, which provides detailed
+ information about, for example, functions, types, and options.</p>
+
+ <p>Argument <c>Server</c> in the SFTP functions is only to be used for
+ SFTP sessions that have been started on existing SSH connections
+ (that is, when the original connection type is <c>ssh</c>). Whenever
+ the connection type is <c>sftp</c>, use the SSH connection reference
+ only.</p>
+
+ <p>The following options are valid for specifying an SSH/SFTP
+ connection (that is, can be used as configuration elements):</p>
+
+ <pre>
+ [{ConnType, Addr},
+ {port, Port},
+ {user, UserName}
+ {password, Pwd}
+ {user_dir, String}
+ {public_key_alg, PubKeyAlg}
+ {connect_timeout, Timeout}
+ {key_cb, KeyCallbackMod}]</pre>
+
+ <p><c>ConnType = ssh | sftp</c>.</p>
+
+ <p>For other types, see
+ <seealso marker="ssh:ssh"><c>ssh:ssh(3)</c></seealso>.</p>
+
+ <p>All time-out parameters in <c>ct_ssh</c> functions are values in
+ milliseconds.</p>
+
+ </description>
+
+ <section>
+ <title>Data Types</title>
+ <marker id="types"/>
+ <taglist>
+ <tag><c>connection() = handle() | target_name()</c></tag>
+ <item><marker id="type-connection"/>
+ <p>For <c>target_name</c>, see module
+ <seealso marker="ct"><c>ct</c></seealso>.</p></item>
+
+ <tag><c>handle() = handle()</c></tag>
+ <item><marker id="type-handle"/>
+ <p>Handle for a specific SSH/SFTP connection, see module
+ <seealso marker="ct"><c>ct</c></seealso>.</p></item>
+
+ <tag><c>ssh_sftp_return() = term()</c></tag>
+ <item><marker id="type-ssh_sftp_return"/>
+ <p>Return value from an
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp</c></seealso>
+ function.</p></item>
+ </taglist>
+ </section>
+
+ <funcs>
+ <func>
+ <name>apread(SSH, Handle, Position, Length) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="apread-4"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>apread(SSH, Server, Handle, Position, Length) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="apread-5"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>apwrite(SSH, Handle, Position, Data) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="apwrite-4"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>apwrite(SSH, Server, Handle, Position, Data) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="apwrite-5"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>aread(SSH, Handle, Len) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="aread-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>aread(SSH, Server, Handle, Len) -&gt; Result</name>
+ <fsummary>For inforamtion and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="aread-4"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>awrite(SSH, Handle, Data) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="awrite-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>awrite(SSH, Server, Handle, Data) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="awrite-4"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>close(SSH, Handle) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="close-2"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>close(SSH, Server, Handle) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="close-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>connect(KeyOrName) -&gt; {ok, Handle} | {error, Reason}</name>
+ <fsummary>Equivalent to connect(KeyOrName, host, []).</fsummary>
+ <desc><marker id="connect-1"/>
+ <p>Equivalent to
+ <seealso marker="#connect-3"><c>ct_ssh:connect(KeyOrName, host,
+ [])</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>connect(KeyOrName, ConnType) -&gt; {ok, Handle} | {error, Reason}</name>
+ <fsummary>Equivalent to connect(KeyOrName, ConnType, []).</fsummary>
+ <desc><marker id="connect-2"/>
+ <p>Equivalent to
+ <seealso marker="#connect-3"><c>ct_ssh:connect(KeyOrName, ConnType,
+ [])</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>connect(KeyOrName, ConnType, ExtraOpts) -&gt; {ok, Handle} | {error, Reason}</name>
+ <fsummary>Opens an SSH or SFTP connection using the information
+ associated with KeyOrName.</fsummary>
+ <type>
+ <v>KeyOrName = Key | Name</v>
+ <v>Key = atom()</v>
+ <v>Name = target_name()</v>
+ <v>ConnType = ssh | sftp | host</v>
+ <v>ExtraOpts = ssh_connect_options()</v>
+ <v>Handle = handle()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="connect-3"/>
+ <p>Opens an SSH or SFTP connection using the information associated
+ with <c>KeyOrName</c>.</p>
+
+ <p>If <c>Name</c> (an alias name for <c>Key</c>) is used to identify
+ the connection, this name can be used as connection reference for
+ subsequent calls. Only one open connection at a time associated
+ with <c>Name</c> is possible. If <c>Key</c> is used, the returned
+ handle must be used for subsequent calls (multiple connections can
+ be opened using the configuration data specified by <c>Key</c>).</p>
+
+ <p>For information on how to create a new <c>Name</c>, see
+ <seealso marker="ct#require-2"><c>ct:require/2</c></seealso>.</p>
+
+ <p>For <c>target_name</c>, see module
+ <seealso marker="ct"><c>ct</c></seealso>.</p>
+
+ <p><c>ConnType</c> always overrides the type specified in the
+ address tuple in the configuration data (and in <c>ExtraOpts</c>).
+ So it is possible to, for example, open an SFTP connection
+ directly using data originally specifying an SSH connection. Value
+ <c>host</c> means that the connection type specified by the host
+ option (either in the configuration data or in <c>ExtraOpts</c>)
+ is used.</p>
+
+ <p><c>ExtraOpts</c> (optional) are extra SSH options to be added to
+ the configuration data for <c>KeyOrName</c>. The extra options
+ override any existing options with the same key in the
+ configuration data. For details on valid SSH options, see
+ application <seealso marker="ssh:index"><c>SSH</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>del_dir(SSH, Name) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="del_dir-2"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>del_dir(SSH, Server, Name) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="del_dir-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>delete(SSH, Name) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="delete-2"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>delete(SSH, Server, Name) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="delete-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>disconnect(SSH) -&gt; ok | {error, Reason}</name>
+ <fsummary>Closes an SSH/SFTP connection.</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="disconnect-1"/>
+ <p>Closes an SSH/SFTP connection.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>exec(SSH, Command) -&gt; {ok, Data} | {error, Reason}</name>
+ <fsummary>Equivalent to exec(SSH, Command, DefaultTimeout).</fsummary>
+ <desc><marker id="exec-2"/>
+ <p>Equivalent to
+ <seealso marker="#exec-3"><c>ct_ssh:exec(SSH, Command,
+ DefaultTimeout)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>exec(SSH, Command, Timeout) -&gt; {ok, Data} | {error, Reason}</name>
+ <fsummary>Requests server to perform Command.</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Command = string()</v>
+ <v>Timeout = integer()</v>
+ <v>Data = list()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="exec-3"/>
+ <p>Requests server to perform <c>Command</c>. A session channel is
+ opened automatically for the request. <c>Data</c> is received from
+ the server as a result of the command.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>exec(SSH, ChannelId, Command, Timeout) -&gt; {ok, Data} | {error, Reason}</name>
+ <fsummary>Requests server to perform Command.</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>ChannelId = integer()</v>
+ <v>Command = string()</v>
+ <v>Timeout = integer()</v>
+ <v>Data = list()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="exec-4"/>
+ <p>Requests server to perform <c>Command</c>. A previously opened
+ session channel is used for the request. <c>Data</c> is received
+ from the server as a result of the command.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_file_info(SSH, Handle) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="get_file_info-2"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_file_info(SSH, Server, Handle) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="get_file_info-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>list_dir(SSH, Path) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="list_dir-2"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>list_dir(SSH, Server, Path) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="list_dir-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>make_dir(SSH, Name) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="make_dir-2"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>make_dir(SSH, Server, Name) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="make_dir-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>make_symlink(SSH, Name, Target) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="make_symlink-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>make_symlink(SSH, Server, Name, Target) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="make_symlink-4"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>open(SSH, File, Mode) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="open-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>open(SSH, Server, File, Mode) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="open-4"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>opendir(SSH, Path) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="opendir-2"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>opendir(SSH, Server, Path) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="opendir-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>position(SSH, Handle, Location) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="position-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>position(SSH, Server, Handle, Location) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="position-4"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>pread(SSH, Handle, Position, Length) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="pread-4"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>pread(SSH, Server, Handle, Position, Length) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="pread-5"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>pwrite(SSH, Handle, Position, Data) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="pwrite-4"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>pwrite(SSH, Server, Handle, Position, Data) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="pwrite-5"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>read(SSH, Handle, Len) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="read-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>read(SSH, Server, Handle, Len) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="read-4"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>read_file(SSH, File) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="read_file-2"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>read_file(SSH, Server, File) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="read_file-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>read_file_info(SSH, Name) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="read_file_info-2"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>read_file_info(SSH, Server, Name) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="read_file_info-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>read_link(SSH, Name) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="read_link-2"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>read_link(SSH, Server, Name) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="read_link-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>read_link_info(SSH, Name) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="read_link_info-2"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>read_link_info(SSH, Server, Name) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="read_link_info-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>receive_response(SSH, ChannelId) -&gt; {ok, Data} | {error, Reason}</name>
+ <fsummary>Equivalent to receive_response(SSH, ChannelId,
+ close).</fsummary>
+ <desc><marker id="receive_response-2"/>
+ <p>Equivalent to
+ <seealso marker="#receive_response-3"><c>ct_ssh:receive_response(SSH,
+ChannelId, close)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>receive_response(SSH, ChannelId, End) -&gt; {ok, Data} | {error, Reason}</name>
+ <fsummary>Equivalent to receive_response(SSH, ChannelId, End,
+ DefaultTimeout).</fsummary>
+ <desc><marker id="receive_response-3"/>
+ <p>Equivalent to
+ <seealso marker="#receive_response-4"><c>ct_ssh:receive_response(SSH,
+ChannelId, End, DefaultTimeout)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>receive_response(SSH, ChannelId, End, Timeout) -&gt; {ok, Data} | {timeout, Data} | {error, Reason}</name>
+ <fsummary>Receives expected data from server on the specified session
+ channel.</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>ChannelId = integer()</v>
+ <v>End = Fun | close | timeout</v>
+ <v>Timeout = integer()</v>
+ <v>Data = list()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="receive_response-4"/>
+ <p>Receives expected data from server on the specified session
+ channel.</p>
+
+ <p>If <c>End == close</c>, data is returned to the caller when the
+ channel is closed by the server. If a time-out occurs before this
+ happens, the function returns <c>{timeout,Data}</c> (where
+ <c>Data</c> is the data received so far).</p>
+ <p>If <c>End == timeout</c>, a time-out is expected and
+ <c>{ok,Data}</c> is returned both in the case of a time-out and
+ when the channel is closed.</p>
+
+ <p>If <c>End</c> is a fun, this fun is called with one argument, the
+ data value in a received <c>ssh_cm</c> message (see
+ <seealso marker="ssh:ssh_connection"><c>ssh:ssh_connection(3)</c></seealso>.
+ The fun is to return either <c>true</c> to end the receiving
+ operation (and have the so far collected data returned) or
+ <c>false</c> to wait for more data from the server. Even if a fun
+ is supplied, the function returns immediately if the server closes
+ the channel).</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>rename(SSH, OldName, NewName) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="rename-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>rename(SSH, Server, OldName, NewName) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="rename-4"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>send(SSH, ChannelId, Data) -&gt; ok | {error, Reason}</name>
+ <fsummary>Equivalent to send(SSH, ChannelId, 0, Data,
+ DefaultTimeout).</fsummary>
+ <desc><marker id="send-3"/>
+ <p>Equivalent to <seealso marker="#send-5"><c>ct_ssh:send(SSH,
+ ChannelId, 0, Data, DefaultTimeout)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>send(SSH, ChannelId, Data, Timeout) -&gt; ok | {error, Reason}</name>
+ <fsummary>Equivalent to send(SSH, ChannelId, 0, Data, Timeout).</fsummary>
+ <desc><marker id="send-4"/>
+ <p>Equivalent to <seealso marker="#send-5"><c>ct_ssh:send(SSH,
+ ChannelId, 0, Data, Timeout)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>send(SSH, ChannelId, Type, Data, Timeout) -&gt; ok | {error, Reason}</name>
+ <fsummary>Sends data to server on specified session channel.</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>ChannelId = integer()</v>
+ <v>Type = integer()</v>
+ <v>Data = list()</v>
+ <v>Timeout = integer()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="send-5"/>
+ <p>Sends data to server on specified session channel.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>send_and_receive(SSH, ChannelId, Data) -&gt; {ok, Data} | {error, Reason}</name>
+ <fsummary>Equivalent to send_and_receive(SSH, ChannelId, Data,
+ close).</fsummary>
+ <desc><marker id="send_and_receive-3"/>
+ <p>Equivalent to
+ <seealso marker="#send_and_receive-4"><c>ct_ssh:send_and_receive(SSH,
+ ChannelId, Data, close)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>send_and_receive(SSH, ChannelId, Data, End) -&gt; {ok, Data} | {error, Reason}</name>
+ <fsummary>Equivalent to send_and_receive(SSH, ChannelId, 0, Data, End,
+ DefaultTimeout).</fsummary>
+ <desc><marker id="send_and_receive-4"/>
+ <p>Equivalent to
+ <seealso marker="#send_and_receive-6"><c>ct_ssh;send_and_receive(SSH,
+ChannelId, 0, Data, End, DefaultTimeout)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>send_and_receive(SSH, ChannelId, Data, End, Timeout) -&gt; {ok, Data} | {error, Reason}</name>
+ <fsummary>Equivalent to send_and_receive(SSH, ChannelId, 0, Data, End,
+ Timeout).</fsummary>
+ <desc><marker id="send_and_receive-5"/>
+ <p>Equivalent to
+ <seealso marker="#send_and_receive-6"><c>ct_ssh:send_and_receive(SSH,
+ChannelId, 0, Data, End, Timeout)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>send_and_receive(SSH, ChannelId, Type, Data, End, Timeout) -&gt; {ok, Data} | {error, Reason}</name>
+ <fsummary>Sends data to server on specified session channel and waits
+ to receive the server response.</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>ChannelId = integer()</v>
+ <v>Type = integer()</v>
+ <v>Data = list()</v>
+ <v>End = Fun | close | timeout</v>
+ <v>Timeout = integer()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="send_and_receive-6"/>
+ <p>Sends data to server on specified session channel and waits to
+ receive the server response.</p>
+
+ <p>For details on argument <c>End</c>, see
+ <seealso marker="#receive_response-4"><c>ct_ssh:receive_response/4</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>session_close(SSH, ChannelId) -&gt; ok | {error, Reason}</name>
+ <fsummary>Closes an SSH session channel.</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>ChannelId = integer()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="session_close-2"/>
+ <p>Closes an SSH session channel.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>session_open(SSH) -&gt; {ok, ChannelId} | {error, Reason}</name>
+ <fsummary>Equivalent to session_open(SSH, DefaultTimeout).</fsummary>
+ <desc><marker id="session_open-1"/>
+ <p>Equivalent to
+ <seealso marker="#session_open-2"><c>ct_ssh:session_open(SSH,
+ DefaultTimeout)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>session_open(SSH, Timeout) -&gt; {ok, ChannelId} | {error, Reason}</name>
+ <fsummary>Opens a channel for an SSH session.</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Timeout = integer()</v>
+ <v>ChannelId = integer()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="session_open-2"/>
+ <p>Opens a channel for an SSH session.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>sftp_connect(SSH) -&gt; {ok, Server} | {error, Reason}</name>
+ <fsummary>Starts an SFTP session on an already existing SSH
+ connection.</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Server = pid()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="sftp_connect-1"/>
+ <p>Starts an SFTP session on an already existing SSH connection.
+ <c>Server</c> identifies the new session and must be specified
+ whenever SFTP requests are to be sent.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>subsystem(SSH, ChannelId, Subsystem) -&gt; Status | {error, Reason}</name>
+ <fsummary>Equivalent to subsystem(SSH, ChannelId, Subsystem,
+ DefaultTimeout).</fsummary>
+ <desc><marker id="subsystem-3"/>
+ <p>Equivalent to
+ <seealso marker="#subsystem-4"><c>ct_ssh:subsystem(SSH, ChannelId,
+ Subsystem, DefaultTimeout)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>subsystem(SSH, ChannelId, Subsystem, Timeout) -&gt; Status | {error, Reason}</name>
+ <fsummary>Sends a request to execute a predefined subsystem.</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>ChannelId = integer()</v>
+ <v>Subsystem = string()</v>
+ <v>Timeout = integer()</v>
+ <v>Status = success | failure</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="subsystem-4"/>
+ <p>Sends a request to execute a predefined subsystem.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>write(SSH, Handle, Data) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="write-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>write(SSH, Server, Handle, Data) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="write-4"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>write_file(SSH, File, Iolist) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="write_file-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>write_file(SSH, Server, File, Iolist) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="write_file-4"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>write_file_info(SSH, Name, Info) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="write_file_info-3"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>write_file_info(SSH, Server, Name, Info) -&gt; Result</name>
+ <fsummary>For information and other types, see ssh_sftp(3).</fsummary>
+ <type>
+ <v>SSH = connection()</v>
+ <v>Result = ssh_sftp_return() | {error, Reason}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="write_file_info-4"/>
+ <p>For information and other types, see
+ <seealso marker="ssh:ssh_sftp"><c>ssh:ssh_sftp(3)</c></seealso>.</p>
+ </desc>
+ </func>
+ </funcs>
+
+</erlref>
+
+
diff --git a/lib/common_test/doc/src/ct_telnet.xml b/lib/common_test/doc/src/ct_telnet.xml
new file mode 100644
index 0000000000..b7ba352104
--- /dev/null
+++ b/lib/common_test/doc/src/ct_telnet.xml
@@ -0,0 +1,601 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2010</year><year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>ct_telnet</title>
+ <prepared></prepared>
+ <responsible></responsible>
+ <docno></docno>
+ <approved></approved>
+ <checked></checked>
+ <date></date>
+ <rev>A</rev>
+ <file>ct_telnet.xml</file>
+ </header>
+ <module>ct_telnet</module>
+ <modulesummary>Common Test specific layer on top of Telnet client ct_telnet_client.erl</modulesummary>
+
+ <description>
+
+ <p><c>Common Test</c> specific layer on top of Telnet client
+ <c>ct_telnet_client.erl</c>.</p>
+
+ <p>Use this module to set up Telnet connections, send commands, and
+ perform string matching on the result. For information about how to use
+ <c>ct_telnet</c> and configure connections, specifically for UNIX hosts,
+ see the
+ <seealso marker="unix_telnet"><c>unix_telnet</c></seealso> manual page.
+ </p>
+
+ <p>Default values defined in <c>ct_telnet</c>:</p>
+ <marker id="Default_values"/>
+
+ <list type="bulleted">
+ <item><p>Connection timeout (time to wait for connection) = 10
+ seconds</p></item>
+ <item><p>Command timeout (time to wait for a command to return) =
+ 10 seconds</p></item>
+ <item><p>Max number of reconnection attempts = 3</p></item>
+ <item><p>Reconnection interval (time to wait in between
+ reconnection attempts) = 5 seconds</p></item>
+ <item><p>Keep alive (sends NOP to the server every 8 sec if
+ connection is idle) = <c>true</c></p></item>
+ <item><p>Polling limit (max number of times to poll to get a
+ remaining string terminated) = 0</p></item>
+ <item><p>Polling interval (sleep time between polls) = 1 second</p>
+ </item>
+ </list>
+
+ <p>These parameters can be modified by the user with the following
+ configuration term:</p>
+
+ <pre>
+ {telnet_settings, [{connect_timeout,Millisec},
+ {command_timeout,Millisec},
+ {reconnection_attempts,N},
+ {reconnection_interval,Millisec},
+ {keep_alive,Bool},
+ {poll_limit,N},
+ {poll_interval,Millisec}]}.</pre>
+
+ <p><c>Millisec = integer(), N = integer()</c></p>
+
+ <p>Enter the <c>telnet_settings</c> term in a configuration file included
+ in the test and <c>ct_telnet</c> retrieves the information
+ automatically.</p>
+
+ <p><c>keep_alive</c> can be specified per connection, if necessary. For
+ details, see
+ <seealso marker="unix_telnet"><c>unix_telnet</c></seealso>.</p>
+
+ </description>
+
+ <section>
+ <title>Logging</title>
+ <marker id="Logging"/>
+
+ <p>The default logging behavior of <c>ct_telnet</c> is to print information
+ about performed operations, commands, and their corresponding results to
+ the test case HTML log. The following is not printed to the HTML
+ log: text strings sent from the Telnet server that are not explicitly
+ received by a <c>ct_telnet</c> function, such as <c>expect/3</c>.
+ However, <c>ct_telnet</c> can be configured to use a special purpose
+ event handler, implemented in <c>ct_conn_log_h</c>, for logging
+ <em>all</em> Telnet traffic. To use this handler, install a <c>Common
+ Test</c> hook named <c>cth_conn_log</c>. Example (using the test suite
+ information function):</p>
+
+ <pre>
+ suite() -&gt;
+ [{ct_hooks, [{cth_conn_log, [{conn_mod(),hook_options()}]}]}].</pre>
+
+ <p><c>conn_mod()</c> is the name of the <c>Common Test</c> module
+ implementing the connection protocol, that is, <c>ct_telnet</c>.</p>
+
+ <p>The <c>cth_conn_log</c> hook performs unformatted logging of Telnet
+ data to a separate text file. All Telnet communication is captured and
+ printed, including any data sent from the server. The link to
+ this text file is located at the top of the test case HTML log.</p>
+
+ <p>By default, data for all Telnet connections is logged in one common
+ file (named <c>default</c>), which can get messy, for example, if
+ multiple Telnet sessions are running in parallel. Therefore a separate
+ log file can be created for each connection. To configure this, use hook
+ option <c>hosts</c> and list the names of the servers/connections
+ to be used in the suite. The connections must be named for this to
+ work (see
+ <seealso marker="#open-1"><c>ct_telnet:open/1,2,3,4</c></seealso>).</p>
+
+ <p>Hook option <c>log_type</c> can be used to change the
+ <c>cth_conn_log</c> behavior. The default value of this option is
+ <c>raw</c>, which results in the behavior described above. If the value
+ is set to <c>html</c>, all Telnet communication is printed to the test
+ case HTML log instead.</p>
+
+ <p>All <c>cth_conn_log</c> hook options described can also be
+ specified in a configuration file with configuration variable
+ <c>ct_conn_log</c>.</p>
+
+ <p><em>Example:</em></p>
+
+ <pre>
+ {ct_conn_log, [{ct_telnet,[{log_type,raw},
+ {hosts,[key_or_name()]}]}]}</pre>
+
+ <note>
+ <p>Hook options specified in a configuration file overwrite any
+ hard-coded hook options in the test suite.</p>
+ </note>
+
+ <marker id="Logging_example"/>
+ <p><em>Logging Example:</em></p>
+
+ <p>The following <c>ct_hooks</c> statement causes printing of Telnet
+ traffic to separate logs for the connections <c>server1</c> and
+ <c>server2</c>. Traffic for any other connections is logged in the
+ default Telnet log.</p>
+
+ <pre>
+ suite() -&gt;
+ [{ct_hooks,
+ [{cth_conn_log, [{ct_telnet,[{hosts,[server1,server2]}]}]}]}].</pre>
+
+ <p>As previously explained, this specification can also be provided by an
+ entry like the following in a configuration file:</p>
+
+ <pre>
+ {ct_conn_log, [{ct_telnet,[{hosts,[server1,server2]}]}]}.</pre>
+
+ <p>In this case the <c>ct_hooks</c> statement in the test suite can look
+ as follows:</p>
+
+ <pre>
+ suite() -&gt;
+ [{ct_hooks, [{cth_conn_log, []}]}].</pre>
+ </section>
+
+ <section>
+ <title>Data Types</title>
+ <marker id="types"/>
+ <taglist>
+ <tag><c>connection() = handle() | {target_name(), connection_type()} | target_name()</c></tag>
+ <item><marker id="type-connection"/>
+ <p>For <c>target_name()</c>, see module
+ <seealso marker="ct"><c>ct</c></seealso>.</p></item>
+
+ <tag><c>connection_type() = telnet | ts1 | ts2</c></tag>
+ <item><marker id="type-connection_type"/> </item>
+
+ <tag><c>handle() = handle()</c></tag>
+ <item><marker id="type-handle"/>
+ <p>Handle for a specific Telnet connection, see module
+ <seealso marker="ct"><c>ct</c></seealso>.</p></item>
+
+ <tag><c>prompt_regexp() = string()</c></tag>
+ <item><marker id="type-prompt_regexp"/>
+ <p>Regular expression matching all possible prompts for a specific
+ target type. <c>regexp</c> must not have any groups, that is, when
+ matching, <c>re:run/3</c> (in <c>STDLIB</c>) must return a list with
+ one single element.</p></item>
+ </taglist>
+ </section>
+
+ <funcs>
+ <func>
+ <name>close(Connection) -&gt; ok | {error, Reason}</name>
+ <fsummary>Closes the Telnet connection and stops the process managing
+ it.</fsummary>
+ <type>
+ <v>Connection = connection()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="close-1"/>
+ <p>Closes the Telnet connection and stops the process managing it.</p>
+
+ <p>A connection can be associated with a target name and/or a handle.
+ If <c>Connection</c> has no associated target name, it can only
+ be closed with the handle value (see
+ <seealso marker="#open-4"><c>ct_telnet:open/4</c></seealso>).</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>cmd(Connection, Cmd) -&gt; {ok, Data} | {error, Reason}</name>
+ <fsummary>Equivalent to cmd(Connection, Cmd, []).</fsummary>
+ <desc><marker id="cmd-2"/>
+ <p>Equivalent to
+ <seealso marker="#cmd-3"><c>ct_telnet:cmd(Connection, Cmd,
+ [])</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>cmd(Connection, Cmd, Opts) -&gt; {ok, Data} | {error, Reason}</name>
+ <fsummary>Sends a command through Telnet and waits for prompt.</fsummary>
+ <type>
+ <v>Connection = connection()</v>
+ <v>Cmd = string()</v>
+ <v>Opts = [Opt]</v>
+ <v>Opt = {timeout, timeout()} | {newline, boolean()}</v>
+ <v>Data = [string()]</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="cmd-3"/>
+ <p>Sends a command through Telnet and waits for prompt.</p>
+
+ <p>By default, this function adds a new line to the end of the
+ specified command. If this is not desired, use option
+ <c>{newline,false}</c>. This is necessary, for example, when
+ sending Telnet command sequences prefixed with character
+ Interprete As Command (IAC).</p>
+
+ <p>Option <c>timeout</c> specifies how long the client must wait
+ for prompt. If the time expires, the function returns
+ <c>{error,timeout}</c>. For information about the default value
+ for the command timeout, see the
+ <seealso marker="#Default_values">list of default values</seealso>
+ in the beginning of this module.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>cmdf(Connection, CmdFormat, Args) -&gt; {ok, Data} | {error, Reason}</name>
+ <fsummary>Equivalent to cmdf(Connection, CmdFormat, Args, []).</fsummary>
+ <desc><marker id="cmdf-3"/>
+ <p>Equivalent to
+ <seealso marker="#cmdf-4"><c>ct_telnet:cmdf(Connection, CmdFormat,
+ Args, [])</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>cmdf(Connection, CmdFormat, Args, Opts) -&gt; {ok, Data} | {error, Reason}</name>
+ <fsummary>Sends a Telnet command and waits for prompt (uses a format
+ string and a list of arguments to build the command).</fsummary>
+ <type>
+ <v>Connection = connection()</v>
+ <v>CmdFormat = string()</v>
+ <v>Args = list()</v>
+ <v>Opts = [Opt]</v>
+ <v>Opt = {timeout, timeout()} | {newline, boolean()}</v>
+ <v>Data = [string()]</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="cmdf-4"/>
+ <p>Sends a Telnet command and waits for prompt (uses a format string
+ and a list of arguments to build the command).</p>
+
+ <p>For details, see
+ <seealso marker="#cmd-3"><c>ct_telnet:cmd/3</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>expect(Connection, Patterns) -&gt; term()</name>
+ <fsummary>Equivalent to expect(Connections, Patterns, []).</fsummary>
+ <desc><marker id="expect-2"/>
+ <p>Equivalent to
+ <seealso marker="#expect-3"><c>ct_telnet:expect(Connections,
+ Patterns, [])</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>expect(Connection, Patterns, Opts) -&gt; {ok, Match} | {ok, MatchList, HaltReason} | {error, Reason}</name>
+ <fsummary>Gets data from Telnet and waits for the expected
+ pattern.</fsummary>
+ <type>
+ <v>Connection = connection()</v>
+ <v>Patterns = Pattern | [Pattern]</v>
+ <v>Pattern = string() | {Tag, string()} | prompt | {prompt, Prompt}</v>
+ <v>Prompt = string()</v>
+ <v>Tag = term()</v>
+ <v>Opts = [Opt]</v>
+ <v>Opt = {idle_timeout, IdleTimeout} | {total_timeout, TotalTimeout} | repeat | {repeat, N} | sequence | {halt, HaltPatterns} | ignore_prompt | no_prompt_check | wait_for_prompt | {wait_for_prompt, Prompt}</v>
+ <v>IdleTimeout = infinity | integer()</v>
+ <v>TotalTimeout = infinity | integer()</v>
+ <v>N = integer()</v>
+ <v>HaltPatterns = Patterns</v>
+ <v>MatchList = [Match]</v>
+ <v>Match = RxMatch | {Tag, RxMatch} | {prompt, Prompt}</v>
+ <v>RxMatch = [string()]</v>
+ <v>HaltReason = done | Match</v>
+ <v>Reason = timeout | {prompt, Prompt}</v>
+ </type>
+ <desc><marker id="expect-3"/>
+ <p>Gets data from Telnet and waits for the expected pattern.</p>
+
+ <p><c>Pattern</c> can be a POSIX regular expression. The function
+ returns when a pattern is successfully matched (at least one, in
+ the case of multiple patterns).</p>
+
+ <p><c>RxMatch</c> is a list of matched strings. It looks as
+ follows <c>[FullMatch, SubMatch1, SubMatch2, ...]</c>, where
+ <c>FullMatch</c> is the string matched by the whole regular
+ expression, and <c>SubMatchN</c> is the string that matched
+ subexpression number <c>N</c>. Subexpressions are denoted with
+ <c>(' ')</c> in the regular expression.</p>
+
+ <p>If a <c>Tag</c> is speciifed, the returned <c>Match</c> also
+ includes the matched <c>Tag</c>. Otherwise, only <c>RxMatch</c>
+ is returned.</p>
+
+ <p><em>Options:</em></p>
+
+ <taglist>
+ <tag><c>idle_timeout</c></tag>
+ <item><p>Indicates that the function must return if the Telnet
+ client is idle (that is, if no data is received) for more than
+ <c>IdleTimeout</c> milliseconds. Default time-out is 10
+ seconds.</p></item>
+ <tag><c>total_timeout</c></tag>
+ <item><p>Sets a time limit for the complete <c>expect</c> operation.
+ After <c>TotalTimeout</c> milliseconds, <c>{error,timeout}</c>
+ is returned. Default is <c>infinity</c> (that is, no time
+ limit).</p></item>
+ <tag><c>ignore_prompt | no_prompt_check</c></tag>
+ <item><p>>The function returns when a prompt is received, even if
+ no pattern has yet been matched, and
+ <c>{error,{prompt,Prompt}}</c> is returned. However, this
+ behavior can be modified with option <c>ignore_prompt</c> or
+ option <c>no_prompt_check</c>, which tells <c>expect</c> to
+ return only when a match is found or after a time-out.</p></item>
+ <tag><c>ignore_prompt</c></tag>
+ <item><p><c>ct_telnet</c> ignores any prompt found. This option is
+ useful if data sent by the server can include a pattern
+ matching prompt <c>regexp</c> (as returned by
+ <c>TargedMod:get_prompt_regexp/0</c>), but is not to not cause
+ the function to return.</p></item>
+ <tag><c>no_prompt_check</c></tag>
+ <item><p><c>ct_telnet</c> does not search for a prompt at all. This
+ is useful if, for example, <c>Pattern</c> itself matches the
+ prompt.</p></item>
+ <tag><c>wait_for_prompt</c></tag>
+ <item><p>Forces <c>ct_telnet</c> to wait until the prompt string
+ is received before returning (even if a pattern has already been
+ matched). This is equal to calling
+ <c>expect(Conn, Patterns++[{prompt,Prompt}], [sequence|Opts])</c>.
+ Notice that option <c>idle_timeout</c> and <c>total_timeout</c>
+ can abort the operation of waiting for prompt.</p></item>
+ <tag><c>repeat | repeat, N</c></tag>
+ <item><p>The pattern(s) must be matched multiple times. If <c>N</c>
+ is speciified, the pattern(s) are matched <c>N</c> times, and
+ the function returns <c>HaltReason = done</c>. This option can be
+ interrupted by one or more <c>HaltPatterns</c>. <c>MatchList</c>
+ is always returned, that is, a list of <c>Match</c> instead of
+ only one <c>Match</c>. Also <c>HaltReason</c> is returned.</p>
+ </item>
+ <tag><c>sequence</c></tag>
+ <item><p>All patterns must be matched in a sequence. A match is not
+ concluded until all patterns are matched. This option can be
+ interrupted by one or more <c>HaltPatterns</c>. <c>MatchList</c>
+ is always returned, that is, a list of <c>Match</c> instead of
+ only one <c>Match</c>. Also <c>HaltReason</c> is returned.</p>
+ </item>
+ </taglist>
+
+ <p><em>Example 1:</em></p>
+
+ <pre>
+ expect(Connection,[{abc,"ABC"},{xyz,"XYZ"}],[sequence,{halt,[{nnn,"NNN"}]}])</pre>
+
+ <p>First this tries to match <c>"ABC"</c>, and then <c>"XYZ"</c>, but
+ if <c>"NNN"</c> appears, the function returns
+ <c>{error,{nnn,["NNN"]}}</c>. If both <c>"ABC"</c> and <c>"XYZ"</c>
+ are matched, the function returns <c>{ok,[AbcMatch,XyzMatch]}</c>.</p>
+
+ <p><em>Example 2:</em></p>
+
+ <pre>
+ expect(Connection,[{abc,"ABC"},{xyz,"XYZ"}],[{repeat,2},{halt,[{nnn,"NNN"}]}])</pre>
+
+ <p>This tries to match <c>"ABC"</c> or <c>"XYZ"</c> twice. If
+ <c>"NNN"</c> appears, the function returns
+ <c>HaltReason = {nnn,["NNN"]}</c>.</p>
+
+ <p>Options <c>repeat</c> and <c>sequence</c> can be combined to
+ match a sequence multiple times.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_data(Connection) -&gt; {ok, Data} | {error, Reason}</name>
+ <fsummary>Gets all data received by the Telnet client since the last
+ command was sent.</fsummary>
+ <type>
+ <v>Connection = connection()</v>
+ <v>Data = [string()]</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="get_data-1"/>
+ <p>Gets all data received by the Telnet client since the last
+ command was sent. Only newline-terminated strings are returned.
+ If the last received string has not yet been terminated, the
+ connection can be polled automatically until the string is
+ complete.</p>
+
+ <p>The polling feature is controlled by the configuration values
+ <c>poll_limit</c> and <c>poll_interval</c> and is by default
+ disabled. This means that the function immediately returns all
+ complete strings received and saves a remaining non-terminated
+ string for a later <c>get_data</c> call.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>open(Name) -&gt; {ok, Handle} | {error, Reason}</name>
+ <fsummary>Equivalent to open(Name, telnet).</fsummary>
+ <desc><marker id="open-1"/>
+ <p>Equivalent to
+ <seealso marker="#open-2"><c>ct_telnet:open(Name,
+ telnet)</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>open(Name, ConnType) -&gt; {ok, Handle} | {error, Reason}</name>
+ <fsummary>Opens a Telnet connection to the specified target
+ host.</fsummary>
+ <type>
+ <v>Name = target_name()</v>
+ <v>ConnType = connection_type()</v>
+ <v>Handle = handle()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="open-2"/>
+ <p>Opens a Telnet connection to the specified target host.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>open(KeyOrName, ConnType, TargetMod) -&gt; {ok, Handle} | {error, Reason}</name>
+ <fsummary>Equivalent to open(KeyOrName, ConnType, TargetMod, []).</fsummary>
+ <desc><marker id="open-3"/>
+ <p>Equivalent to
+ <seealso marker="#open-4"><c>ct_telnet:ct_telnet:open(KeyOrName,
+ ConnType, TargetMod, [])</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>open(KeyOrName, ConnType, TargetMod, Extra) -&gt; {ok, Handle} | {error, Reason}</name>
+ <fsummary>Opens a Telnet connection to the specified target
+ host.</fsummary>
+ <type>
+ <v>KeyOrName = Key | Name</v>
+ <v>Key = atom()</v>
+ <v>Name = target_name()</v>
+ <v>ConnType = connection_type()</v>
+ <v>TargetMod = atom()</v>
+ <v>Extra = term()</v>
+ <v>Handle = handle()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="open-4"/>
+ <p>Opens a Telnet connection to the specified target host.</p>
+
+ <p>The target data must exist in a configuration file. The connection
+ can be associated with <c>Name</c> and/or the returned <c>Handle</c>.
+ To allocate a name for the target, use one of the following
+ alternatives:</p>
+
+ <list type="bulleted">
+ <item><p><seealso marker="ct#require-2"><c>ct:require/2</c></seealso>
+ in a test case</p></item>
+ <item><p>A <c>require</c> statement in the suite information
+ function (<c>suite/0</c>)</p></item>
+ <item><p>A <c>require</c> statement in a test case information
+ function</p></item>
+ </list>
+
+ <p>If you want the connection to be associated with <c>Handle</c> only
+ (if you, for example, need to open multiple connections to a host),
+ use <c>Key</c>, the configuration variable name, to specify the
+ target. Notice that a connection without an associated target name
+ can only be closed with the <c>Handle</c> value.</p>
+
+ <p><c>TargetMod</c> is a module that exports the functions
+ <c>connect(Ip, Port, KeepAlive, Extra)</c> and
+ <c>get_prompt_regexp()</c> for the specified <c>TargetType</c>
+ (for example, <c>unix_telnet</c>).</p>
+
+ <p>For <c>target_name()</c>, see module
+ <seealso marker="ct"><c>ct</c></seealso>.</p>
+
+ <p>See also
+ <seealso marker="ct#require-2"><c>ct:require/2</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>send(Connection, Cmd) -&gt; ok | {error, Reason}</name>
+ <fsummary>Equivalent to send(Connection, Cmd, []).</fsummary>
+ <desc><marker id="send-2"/>
+ <p>Equivalent to
+ <seealso marker="#send-3"><c>ct_telnet:send(Connection, Cmd,
+ [])</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>send(Connection, Cmd, Opts) -&gt; ok | {error, Reason}</name>
+ <fsummary>Sends a Telnet command and returns immediately.</fsummary>
+ <type>
+ <v>Connection = connection()</v>
+ <v>Cmd = string()</v>
+ <v>Opts = [Opt]</v>
+ <v>Opt = {newline, boolean()}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="send-3"/>
+ <p>Sends a Telnet command and returns immediately.</p>
+
+ <p>By default, this function adds a newline to the end of the
+ specified command. If this is not desired, option
+ <c>{newline,false}</c> can be used. This is necessary, for example,
+ when sending Telnet command sequences prefixed with character
+ Interprete As Command (IAC).</p>
+
+ <p>The resulting output from the command can be read with
+ <seealso marker="#get_data-1"><c>ct_telnet:get_data/2</c></seealso> or
+ <seealso marker="#expect-2"><c>ct_telnet:expect/2,3</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>sendf(Connection, CmdFormat, Args) -&gt; ok | {error, Reason}</name>
+ <fsummary>Equivalent to sendf(Connection, CmdFormat, Args, []).</fsummary>
+ <desc><marker id="sendf-3"/>
+ <p>Equivalent to
+ <seealso marker="#sendf-4"><c>ct_telnet:sendf(Connection, CmdFormat,
+ Args, [])</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>sendf(Connection, CmdFormat, Args, Opts) -&gt; ok | {error, Reason}</name>
+ <fsummary>Sends a Telnet command and returns immediately (uses a format
+ string and a list of arguments to build the command).</fsummary>
+ <type>
+ <v>Connection = connection()</v>
+ <v>CmdFormat = string()</v>
+ <v>Args = list()</v>
+ <v>Opts = [Opt]</v>
+ <v>Opt = {newline, boolean()}</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="sendf-4"/>
+ <p>Sends a Telnet command and returns immediately (uses a format
+ string and a list of arguments to build the command).</p>
+ </desc>
+ </func>
+ </funcs>
+
+ <section>
+ <title>See Also</title>
+ <p><seealso marker="unix_telnet"><c>unix_telnet</c></seealso></p>
+ </section>
+
+</erlref>
+
+
diff --git a/lib/common_test/doc/src/dependencies_chapter.xml b/lib/common_test/doc/src/dependencies_chapter.xml
index fb758d90df..29c54e819a 100644
--- a/lib/common_test/doc/src/dependencies_chapter.xml
+++ b/lib/common_test/doc/src/dependencies_chapter.xml
@@ -33,217 +33,220 @@
<section>
<title>General</title>
<p>When creating test suites, it is strongly recommended to not
- create dependencies between test cases, i.e. letting test cases
+ create dependencies between test cases, that is, letting test cases
depend on the result of previous test cases. There are various
- reasons for this, for example:</p>
+ reasons for this, such as, the following:</p>
- <list>
+ <list type="bulleted">
<item>It makes it impossible to run test cases individually.</item>
- <item>It makes it impossible to run test cases in different order.</item>
- <item>It makes debugging very difficult (since a fault could be
+ <item>It makes it impossible to run test cases in a different order.</item>
+ <item>It makes debugging difficult (as a fault can be
the result of a problem in a different test case than the one failing).</item>
- <item>There exists no good and explicit ways to declare dependencies, so
- it may be very difficult to see and understand these in test suite
+ <item>There are no good and explicit ways to declare dependencies, so
+ it can be difficult to see and understand these in test suite
code and in test logs.</item>
- <item>Extending, restructuring and maintaining test suites with
+ <item>Extending, restructuring, and maintaining test suites with
test case dependencies is difficult.</item>
</list>
<p>There are often sufficient means to work around the need for test
case dependencies. Generally, the problem is related to the state of
- the system under test (SUT). The action of one test case may alter the state
- of the system and for some other test case to run properly, the new state
+ the System Under Test (SUT). The action of one test case can change the
+ system state. For some other test case to run properly, this new state
must be known.</p>
<p>Instead of passing data between test cases, it is recommended
that the test cases read the state from the SUT and perform assertions
- (i.e. let the test case run if the state is as expected, otherwise reset or fail)
- and/or use the state to set variables necessary for the test case to execute
- properly. Common actions can often be implemented as library functions for
- test cases to call to set the SUT in a required state. (Such common actions
- may of course also be separately tested if necessary, to ensure they are
- working as expected). It is sometimes also possible, but not always desirable,
- to group tests together in one test case, i.e. let a test case perform a
- "scenario" test (a test that consists of subtests).</p>
-
- <p>Consider for example a server application under test. The following
+ (that is, let the test case run if the state is as expected, otherwise reset or fail).
+ It is also recommended to use the state to set variables necessary for the
+ test case to execute properly. Common actions can often be implemented as
+ library functions for test cases to call to set the SUT in a required state.
+ (Such common actions can also be separately tested, if necessary,
+ to ensure that they work as expected). It is sometimes also possible,
+ but not always desirable, to group tests together in one test case, that is,
+ let a test case perform a "scenario" test (a test consisting of subtests).</p>
+
+ <p>Consider, for example, a server application under test. The following
functionality is to be tested:</p>
- <list>
- <item>Starting the server.</item>
- <item>Configuring the server.</item>
- <item>Connecting a client to the server.</item>
- <item>Disconnecting a client from the server.</item>
- <item>Stopping the server.</item>
+ <list type="bulleted">
+ <item>Starting the server</item>
+ <item>Configuring the server</item>
+ <item>Connecting a client to the server</item>
+ <item>Disconnecting a client from the server</item>
+ <item>Stopping the server</item>
</list>
- <p>There are obvious dependencies between the listed functions. We can't configure
- the server if it hasn't first been started, we can't connect a client until
- the server has been properly configured, etc. If we want to have one test
- case for each of the functions, we might be tempted to try to always run the
+ <p>There are obvious dependencies between the listed functions. The server cannot
+ be configured if it has not first been started, a client connot be connectd until
+ the server is properly configured, and so on. If we want to have one test
+ case for each function, we might be tempted to try to always run the
test cases in the stated order and carry possible data (identities, handles,
- etc) between the cases and therefore introduce dependencies between them.
- To avoid this we could consider starting and stopping the server for every test.
- We would implement the start and stop action as common functions that may be
- called from init_per_testcase and end_per_testcase. (We would of course test
- the start and stop functionality separately). The configuration could perhaps also
- be implemented as a common function, maybe grouped with the start function.
- Finally the testing of connecting and disconnecting a client may be grouped into
- one test case. The resulting suite would look something like this:</p>
-
+ and so on) between the cases and therefore introduce dependencies between them.</p>
+
+ <p>To avoid this, we can consider starting and stopping the server for every test.
+ We can thus implement the start and stop action as common functions to be
+ called from
+ <seealso marker="common_test#Module:init_per_testcase-2"><c>init_per_testcase</c></seealso> and
+ <seealso marker="common_test#Module:end_per_testcase-2"><c>end_per_testcase</c></seealso>.
+ (Remember to test the start and stop functionality separately.)
+ The configuration can also be implemented as a common function, maybe grouped
+ with the start function. Finally, the testing of connecting and disconnecting a
+ client can be grouped into one test case. The resulting suite can look as
+ follows:</p>
<pre>
- -module(my_server_SUITE).
- -compile(export_all).
- -include_lib("ct.hrl").
+ -module(my_server_SUITE).
+ -compile(export_all).
+ -include_lib("ct.hrl").
+
+ %%% init and end functions...
- %%% init and end functions...
+ suite() -> [{require,my_server_cfg}].
- suite() -> [{require,my_server_cfg}].
+ init_per_testcase(start_and_stop, Config) ->
+ Config;
- init_per_testcase(start_and_stop, Config) ->
- Config;
+ init_per_testcase(config, Config) ->
+ [{server_pid,start_server()} | Config];
- init_per_testcase(config, Config) ->
- [{server_pid,start_server()} | Config];
+ init_per_testcase(_, Config) ->
+ ServerPid = start_server(),
+ configure_server(),
+ [{server_pid,ServerPid} | Config].
- init_per_testcase(_, Config) ->
- ServerPid = start_server(),
- configure_server(),
- [{server_pid,ServerPid} | Config].
+ end_per_testcase(start_and_stop, _) ->
+ ok;
- end_per_testcase(start_and_stop, _) ->
- ok;
+ end_per_testcase(_, _) ->
+ ServerPid = ?config(server_pid),
+ stop_server(ServerPid).
- end_per_testcase(_, _) ->
- ServerPid = ?config(server_pid),
- stop_server(ServerPid).
+ %%% test cases...
- %%% test cases...
+ all() -> [start_and_stop, config, connect_and_disconnect].
- all() -> [start_and_stop, config, connect_and_disconnect].
+ %% test that starting and stopping works
+ start_and_stop(_) ->
+ ServerPid = start_server(),
+ stop_server(ServerPid).
- %% test that starting and stopping works
- start_and_stop(_) ->
- ServerPid = start_server(),
- stop_server(ServerPid).
+ %% configuration test
+ config(Config) ->
+ ServerPid = ?config(server_pid, Config),
+ configure_server(ServerPid).
- %% configuration test
- config(Config) ->
- ServerPid = ?config(server_pid, Config),
- configure_server(ServerPid).
+ %% test connecting and disconnecting client
+ connect_and_disconnect(Config) ->
+ ServerPid = ?config(server_pid, Config),
+ {ok,SessionId} = my_server:connect(ServerPid),
+ ok = my_server:disconnect(ServerPid, SessionId).
- %% test connecting and disconnecting client
- connect_and_disconnect(Config) ->
- ServerPid = ?config(server_pid, Config),
- {ok,SessionId} = my_server:connect(ServerPid),
- ok = my_server:disconnect(ServerPid, SessionId).
+ %%% common functions...
- %%% common functions...
+ start_server() ->
+ {ok,ServerPid} = my_server:start(),
+ ServerPid.
- start_server() ->
- {ok,ServerPid} = my_server:start(),
- ServerPid.
+ stop_server(ServerPid) ->
+ ok = my_server:stop(),
+ ok.
- stop_server(ServerPid) ->
- ok = my_server:stop(),
- ok.
+ configure_server(ServerPid) ->
+ ServerCfgData = ct:get_config(my_server_cfg),
+ ok = my_server:configure(ServerPid, ServerCfgData),
+ ok.</pre>
- configure_server(ServerPid) ->
- ServerCfgData = ct:get_config(my_server_cfg),
- ok = my_server:configure(ServerPid, ServerCfgData),
- ok.
- </pre>
</section>
<section>
<marker id="save_config"></marker>
- <title>Saving configuration data</title>
+ <title>Saving Configuration Data</title>
- <p>There might be situations where it is impossible, or infeasible at least, to
- implement independent test cases. Maybe it is simply not possible to read the
- SUT state. Maybe resetting the SUT is impossible and it takes much too long
+ <p>Sometimes it is impossible, or infeasible, to
+ implement independent test cases. Maybe it is not possible to read the
+ SUT state. Maybe resetting the SUT is impossible and it takes too long time
to restart the system. In situations where test case dependency is necessary,
CT offers a structured way to carry data from one test case to the next. The
- same mechanism may also be used to carry data from one test suite to the next.</p>
+ same mechanism can also be used to carry data from one test suite to the next.</p>
<p>The mechanism for passing data is called <c>save_config</c>. The idea is that
- one test case (or suite) may save the current value of Config - or any list of
- key-value tuples - so that it can be read by the next executing test case
- (or test suite). The configuration data is not saved permanently but can only
- be passed from one case (or suite) to the next.</p>
+ one test case (or suite) can save the current value of <c>Config</c>, or any list of
+ key-value tuples, so that the next executing test case (or test suite) can read it.
+ The configuration data is not saved permanently but can only be passed from one
+ case (or suite) to the next.</p>
- <p>To save <c>Config</c> data, return the tuple:</p>
+ <p>To save <c>Config</c> data, return tuple <c>{save_config,ConfigList}</c>
+ from <c>end_per_testcase</c> or from the main test case function.</p>
- <p><c>{save_config,ConfigList}</c></p>
-
- <p>from <c>end_per_testcase</c> or from the main test case function. To read data
- saved by a previous test case, use the <c>config</c> macro with a
- <c>saved_config</c> key:</p>
+ <p>To read data saved by a previous test case, use macro <c>config</c> with a
+ <c>saved_config</c> key as follows:</p>
<p><c>{Saver,ConfigList} = ?config(saved_config, Config)</c></p>
<p><c>Saver</c> (<c>atom()</c>) is the name of the previous test case (where the
- data was saved). The <c>config</c> macro may be used to extract particular data
+ data was saved). The <c>config</c> macro can be used to extract particular data
also from the recalled <c>ConfigList</c>. It is strongly recommended that
<c>Saver</c> is always matched to the expected name of the saving test case.
- This way problems due to restructuring of the test suite may be avoided. Also it
- makes the dependency more explicit and the test suite easier to read and maintain.</p>
+ This way, problems because of restructuring of the test suite can be avoided.
+ Also, it makes the dependency more explicit and the test suite easier to read
+ and maintain.</p>
<p>To pass data from one test suite to another, the same mechanism is used. The data
- should be saved by the <c>end_per_suite</c> function and read by <c>init_per_suite</c>
+ is to be saved by finction
+ <seealso marker="common_test#Module:end_per_suite-1"><c>end_per_suite</c></seealso>
+ and read by function
+ <seealso marker="common_test#Module:init_per_suite-1"><c>init_per_suite</c></seealso>
in the suite that follows. When passing data between suites, <c>Saver</c> carries the
name of the test suite.</p>
- <p>Example:</p>
+ <p><em>Example:</em></p>
<pre>
- -module(server_b_SUITE).
- -compile(export_all).
- -include_lib("ct.hrl").
-
- %%% init and end functions...
-
- init_per_suite(Config) ->
- %% read config saved by previous test suite
- {server_a_SUITE,OldConfig} = ?config(saved_config, Config),
- %% extract server identity (comes from server_a_SUITE)
- ServerId = ?config(server_id, OldConfig),
- SessionId = connect_to_server(ServerId),
- [{ids,{ServerId,SessionId}} | Config].
-
- end_per_suite(Config) ->
- %% save config for server_c_SUITE (session_id and server_id)
- {save_config,Config}
-
- %%% test cases...
-
- all() -> [allocate, deallocate].
-
- allocate(Config) ->
- {ServerId,SessionId} = ?config(ids, Config),
- {ok,Handle} = allocate_resource(ServerId, SessionId),
- %% save handle for deallocation test
- NewConfig = [{handle,Handle}],
- {save_config,NewConfig}.
-
- deallocate(Config) ->
- {ServerId,SessionId} = ?config(ids, Config),
- {allocate,OldConfig} = ?config(saved_config, Config),
- Handle = ?config(handle, OldConfig),
- ok = deallocate_resource(ServerId, SessionId, Handle).
- </pre>
-
- <p>It is also possible to save <c>Config</c> data from a test case that is to be
- skipped. To accomplish this, return the following tuple:</p>
-
- <p><c>{skip_and_save,Reason,ConfigList}</c></p>
-
- <p>The result will be that the test case is skipped with <c>Reason</c> printed to
- the log file (as described in previous chapters), and <c>ConfigList</c> is saved
- for the next test case. <c>ConfigList</c> may be read by means of
- <c>?config(saved_config, Config)</c>, as described above. <c>skip_and_save</c>
- may also be returned from <c>init_per_suite</c>, in which case the saved data can
+ -module(server_b_SUITE).
+ -compile(export_all).
+ -include_lib("ct.hrl").
+
+ %%% init and end functions...
+
+ init_per_suite(Config) ->
+ %% read config saved by previous test suite
+ {server_a_SUITE,OldConfig} = ?config(saved_config, Config),
+ %% extract server identity (comes from server_a_SUITE)
+ ServerId = ?config(server_id, OldConfig),
+ SessionId = connect_to_server(ServerId),
+ [{ids,{ServerId,SessionId}} | Config].
+
+ end_per_suite(Config) ->
+ %% save config for server_c_SUITE (session_id and server_id)
+ {save_config,Config}
+
+ %%% test cases...
+
+ all() -> [allocate, deallocate].
+
+ allocate(Config) ->
+ {ServerId,SessionId} = ?config(ids, Config),
+ {ok,Handle} = allocate_resource(ServerId, SessionId),
+ %% save handle for deallocation test
+ NewConfig = [{handle,Handle}],
+ {save_config,NewConfig}.
+
+ deallocate(Config) ->
+ {ServerId,SessionId} = ?config(ids, Config),
+ {allocate,OldConfig} = ?config(saved_config, Config),
+ Handle = ?config(handle, OldConfig),
+ ok = deallocate_resource(ServerId, SessionId, Handle).</pre>
+
+ <p>To save <c>Config</c> data from a test case that is to be
+ skipped, return tuple
+ <c>{skip_and_save,Reason,ConfigList}</c>.</p>
+
+ <p>The result is that the test case is skipped with <c>Reason</c> printed to
+ the log file (as described earlier) and <c>ConfigList</c> is saved
+ for the next test case. <c>ConfigList</c> can be read using
+ <c>?config(saved_config, Config)</c>, as described earlier. <c>skip_and_save</c>
+ can also be returned from <c>init_per_suite</c>. In this case, the saved data can
be read by <c>init_per_suite</c> in the suite that follows.</p>
</section>
@@ -251,60 +254,63 @@
<marker id="sequences"></marker>
<title>Sequences</title>
- <p>It is possible that test cases depend on each other so that
- if one case fails, the following test(s) should not be executed.
+ <p>Sometimes test cases depend on each other so that
+ if one case fails, the following tests are not to be executed.
Typically, if the <c>save_config</c> facility is used and a test
case that is expected to save data crashes, the following
- case can not run. CT offers a way to declare such dependencies,
+ case cannot run. <c>Common Test</c> offers a way to declare such dependencies,
called sequences.</p>
<p>A sequence of test cases is defined as a test case group
- with a <c>sequence</c> property. Test case groups are defined by
- means of the <c>groups/0</c> function in the test suite (see the
- <seealso marker="write_test_chapter#test_case_groups">Test case groups</seealso>
- chapter for details).</p>
-
- <p>For example, if we would like to make sure that if <c>allocate</c>
- in <c>server_b_SUITE</c> (above) crashes, <c>deallocate</c> is skipped,
- we may define a sequence like this:</p>
+ with a <c>sequence</c> property. Test case groups are defined
+ through function <c>groups/0</c> in the test suite (for details, see section
+ <seealso marker="write_test_chapter#test_case_groups">Test Case Groups</seealso>.</p>
+
+ <p>For example, to ensure that if <c>allocate</c>
+ in <c>server_b_SUITE</c> crashes, <c>deallocate</c> is skipped,
+ the following sequence can be defined:</p>
<pre>
- groups() -> [{alloc_and_dealloc, [sequence], [alloc,dealloc]}].</pre>
+ groups() -> [{alloc_and_dealloc, [sequence], [alloc,dealloc]}].</pre>
- <p>Let's also assume the suite contains the test case <c>get_resource_status</c>,
- which is independent of the other two cases, then the <c>all</c> function could
- look like this:</p>
+ <p>Assume that the suite contains the test case <c>get_resource_status</c>
+ that is independent of the other two cases, then function <c>all</c> can
+ look as follows:</p>
<pre>
- all() -> [{group,alloc_and_dealloc}, get_resource_status].</pre>
+ all() -> [{group,alloc_and_dealloc}, get_resource_status].</pre>
<p>If <c>alloc</c> succeeds, <c>dealloc</c> is also executed. If <c>alloc</c> fails
- however, <c>dealloc</c> is not executed but marked as SKIPPED in the html log.
- <c>get_resource_status</c> will run no matter what happens to the <c>alloc_and_dealloc</c>
+ however, <c>dealloc</c> is not executed but marked as <c>SKIPPED</c> in the HTML log.
+ <c>get_resource_status</c> runs no matter what happens to the <c>alloc_and_dealloc</c>
cases.</p>
- <p>Test cases in a sequence will be executed in order until they have all succeeded or
- until one case fails. If one fails, all following cases in the sequence are skipped.
- The cases in the sequence that have succeeded up to that point are reported as successful
- in the log. An arbitrary number of sequences may be specified. Example:</p>
+ <p>Test cases in a sequence are executed in order until all succeed or
+ one fails. If one fails, all following cases in the sequence are skipped.
+ The cases in the sequence that have succeeded up to that point are reported as
+ successful in the log. Any number of sequences can be specified.</p>
+ <p><em>Example:</em></p>
<pre>
- groups() -> [{scenarioA, [sequence], [testA1, testA2]},
- {scenarioB, [sequence], [testB1, testB2, testB3]}].
-
- all() -> [test1,
- test2,
- {group,scenarioA},
- test3,
- {group,scenarioB},
- test4].</pre>
-
- <p>It is possible to have sub-groups in a sequence group. Such sub-groups can have
- any property, i.e. they are not required to also be sequences. If you want the status
- of the sub-group to affect the sequence on the level above, return
- <c>{return_group_result,Status}</c> from <c>end_per_group/2</c>, as described in the
- <seealso marker="write_test_chapter#repeated_groups">Repeated groups</seealso>
- chapter. A failed sub-group (<c>Status == failed</c>) will cause the execution of a
+ groups() -> [{scenarioA, [sequence], [testA1, testA2]},
+ {scenarioB, [sequence], [testB1, testB2, testB3]}].
+
+ all() -> [test1,
+ test2,
+ {group,scenarioA},
+ test3,
+ {group,scenarioB},
+ test4].</pre>
+
+ <p>A sequence group can have subgroups. Such subgroups can have
+ any property, that is, they are not required to also be sequences. If you want the
+ status of the subgroup to affect the sequence on the level above, return
+ <c>{return_group_result,Status}</c> from
+ <seealso marker="common_test#Module:end_per_group-2"><c>end_per_group/2</c></seealso>,
+ as described in section
+ <seealso marker="write_test_chapter#repeated_groups">Repeated Groups</seealso>
+ in Writing Test Suites.
+ A failed subgroup (<c>Status == failed</c>) causes the execution of a
sequence to fail in the same way a test case does.</p>
</section>
</chapter>
diff --git a/lib/common_test/doc/src/event_handler_chapter.xml b/lib/common_test/doc/src/event_handler_chapter.xml
index 78e5bb5e70..31128a7114 100644
--- a/lib/common_test/doc/src/event_handler_chapter.xml
+++ b/lib/common_test/doc/src/event_handler_chapter.xml
@@ -33,144 +33,171 @@
<section>
<marker id="event_handling"></marker>
<title>General</title>
- <p>It is possible for the operator of a Common Test system to receive
- event notifications continously during a test run. It is reported e.g.
- when a test case starts and stops, what the current count of successful,
- failed and skipped cases is, etc. This information can be used for
- different purposes such as logging progress and results on
- other format than HTML, saving statistics to a database for report
- generation and test system supervision.</p>
-
- <p>Common Test has a framework for event handling which is based on
- the OTP event manager concept and gen_event behaviour. When the Common Test
- server starts, it spawns an event manager. During test execution the
- manager gets a notification from the server every time something
- of potential interest happens. Any event handler plugged into the
- event manager can match on events of interest, take action, or maybe
- simply pass the information on. Event handlers are Erlang modules
- implemented by the Common Test user according to the gen_event
- behaviour (see the OTP User's Guide and Reference Manual for more
- information).</p>
-
- <p>As already described, a Common Test server always starts an event manager.
- The server also plugs in a default event handler which has as its only
- purpose to relay notifications to a globally registered CT Master
- event manager (if a CT Master server is running in the system).
- The CT Master also spawns an event manager at startup.
- Event handlers plugged into this manager will receive the events from
- all the test nodes as well as information from the CT Master server
- itself.</p>
-
- <p>User specific event handlers may be plugged into a Common Test event
- manager, either by telling Common Test to install them before the test
- run (see below), or by adding the handlers dynamically during the test
- run by means of
- <c>gen_event:add_handler/3</c> or <c>gen_event:add_sup_handler/3</c>.
- In the latter scenario, the reference of the Common Test event manager is
- required. To get it, call <c>ct:get_event_mgr_ref/0</c> or (on the CT
- Master node) <c>ct_master:get_event_mgr_ref/0</c>.</p>
+ <p>The operator of a <c>Common Test</c> system can receive
+ event notifications continuously during a test run. For example,
+ <c>Common Test</c> reports when a test case starts and stops,
+ the current count of successful, failed, and skipped cases, and so on.
+ This information can be used for different purposes such as logging progress
+ and results in another format than HTML, saving statistics to a database
+ for report generation, and test system supervision.</p>
+
+ <p><c>Common Test</c> has a framework for event handling based on
+ the OTP event manager concept and <c>gen_event</c> behavior.
+ When the <c>Common Test</c> server starts, it spawns an event manager.
+ During test execution the manager gets a notification from the server
+ when something of potential interest happens. Any event handler plugged into
+ the event manager can match on events of interest, take action, or
+ pass the information on. The event handlers are Erlang modules
+ implemented by the <c>Common Test</c> user according to the <c>gen_event</c>
+ behavior (for details, see module
+ <seealso marker="stdlib:gen_event"><c>stdlib:gen_event</c></seealso> and
+ section
+ <seealso marker="doc/design_principles:events"><c>gen_event Behaviour</c></seealso>
+ in OTP Design Principles in the System Documentation).
+ </p>
+
+ <p>A <c>Common Test</c> server always starts an event manager.
+ The server also plugs in a default event handler, which only
+ purpose is to relay notifications to a globally registered <c>Common Test</c>
+ Master event manager (if a <c>Common Test</c> Master server is running in the system).
+ The <c>Common Test</c> Master also spawns an event manager at startup.
+ Event handlers plugged into this manager receives the events from
+ all the test nodes, plus information from the <c>Common Test</c> Master server.
+ </p>
+
+ <p>User-specific event handlers can be plugged into a <c>Common Test</c> event
+ manager, either by telling <c>Common Test</c> to install them before the test
+ run (described later), or by adding the handlers dynamically during the test
+ run using
+ <seealso marker="stdlib:gen_event#add_handler-3"><c>stdlib:gen_event:add_handler/3</c></seealso> or
+ <seealso marker="stdlib:gen_event#add_sup_handler-3"><c>stdlib:gen_event:add_sup_handler/3</c></seealso>.
+ In the latter scenario, the reference of the <c>Common Test</c> event manager is
+ required. To get it, call
+ <seealso marker="ct#get_event_mgr_ref-0"><c>ct:get_event_mgr_ref/0</c></seealso>
+ or (on the <c>Common Test</c> Master node)
+ <seealso marker="ct_master#get_event_mgr_ref-0"><c>ct_master:get_event_mgr_ref/0</c></seealso>.</p>
</section>
<section>
<marker id="usage"></marker>
- <title>Usage</title>
- <p>Event handlers may be installed by means of an <c>event_handler</c>
- start flag (<c>ct_run</c>) or option (<seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>), where the
- argument specifies the names of one or more event handler modules.
- Example:</p>
+ <title>Use</title>
+ <p>Event handlers can be installed by an <c>event_handler</c> start flag
+ (<seealso marker="ct_run"><c>ct_run</c></seealso>) or option
+ <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>, where the
+ argument specifies the names of one or more event handler modules.</p>
+
+ <p><em>Example:</em></p>
<p><c>$ ct_run -suite test/my_SUITE -event_handler handlers/my_evh1
handlers/my_evh2 -pa $PWD/handlers</c></p>
- <p>Use the <c><![CDATA[ct_run -event_handler_init]]></c> option instead of
- <c><![CDATA[-event_handler]]></c> to pass start arguments to the event handler
- init function.</p>
- <p>All event handler modules must have gen_event behaviour. Note also that
- these modules must be precompiled, and that their locations must be
- added explicitly to the Erlang code server search path (like in the
- example).</p>
- <p>An event_handler tuple in the argument <c>Opts</c> has the following
- definition (see also <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso> in the reference manual):</p>
+ <p>To pass start arguments to the event handler init function, use option
+ <c><![CDATA[ct_run -event_handler_init]]></c> instead of
+ <c><![CDATA[-event_handler]]></c>.</p>
+
+ <note><p>All event handler modules must have <c>gen_event</c> behavior.
+ These modules must be precompiled and their locations must be
+ added explicitly to the Erlang code server search path (as in the previous
+ example).</p></note>
+
+ <p>An event_handler tuple in argument <c>Opts</c> has the following definition
+ (see <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>):</p>
<pre>
- {event_handler,EventHandlers}
+ {event_handler,EventHandlers}
- EventHandlers = EH | [EH]
- EH = atom() | {atom(),InitArgs} | {[atom()],InitArgs}
- InitArgs = [term()]</pre>
+ EventHandlers = EH | [EH]
+ EH = atom() | {atom(),InitArgs} | {[atom()],InitArgs}
+ InitArgs = [term()]</pre>
- <p>Example:</p>
+ <p>In the following example, two event handlers for the <c>my_SUITE</c> test are installed:</p>
<pre>
- 1> ct:run_test([{suite,"test/my_SUITE"},{event_handler,[my_evh1,{my_evh2,[node()]}]}]).</pre>
- <p>This will install two event handlers for the <c>my_SUITE</c> test. Event handler
- <c>my_evh1</c> is started with <c>[]</c> as argument to the init function. Event handler
- <c>my_evh2</c> is started with the name of the current node in the init argument list.</p>
+ 1> ct:run_test([{suite,"test/my_SUITE"},{event_handler,[my_evh1,{my_evh2,[node()]}]}]).</pre>
+ <p>Event handler <c>my_evh1</c> is started with <c>[]</c> as argument to the init function.
+ Event handler <c>my_evh2</c> is started with the name of the current node in the init argument list.</p>
- <p>Event handlers can also be plugged in by means of
+ <p>Event handlers can also be plugged in using one of the following
<seealso marker="run_test_chapter#test_specifications">test specification</seealso>
terms:</p>
-
- <p><c>{event_handler, EventHandlers}</c>, or</p>
- <p><c>{event_handler, EventHandlers, InitArgs}</c>, or</p>
- <p><c>{event_handler, NodeRefs, EventHandlers}</c>, or</p>
- <p><c>{event_handler, NodeRefs, EventHandlers, InitArgs}</c></p>
+ <list type="bulleted">
+ <item><c>{event_handler, EventHandlers}</c></item>
+ <item><c>{event_handler, EventHandlers, InitArgs}</c></item>
+ <item><c>{event_handler, NodeRefs, EventHandlers}</c></item>
+ <item><c>{event_handler, NodeRefs, EventHandlers, InitArgs}</c></item>
+ </list>
<p><c>EventHandlers</c> is a list of module names. Before a test
session starts, the init function of each plugged in event handler
- is called (with the InitArgs list as argument or [] if
- no start arguments are given).</p>
+ is called (with the <c>InitArgs</c> list as argument or <c>[]</c> if
+ no start arguments are specified).</p>
- <p>To plug a handler into the CT Master event manager, specify
+ <p>To plug in a handler to the <c>Common Test</c> Master event manager, specify
<c>master</c> as the node in <c>NodeRefs</c>.</p>
- <p>For an event handler to be able to match on events, the module must
+ <p>To be able to match on events, the event handler module must
include the header file <c>ct_event.hrl</c>. An event is a record with the
following definition:</p>
<p><c>#event{name, node, data}</c></p>
- <p><c>name</c> is the label (type) of the event. <c>node</c> is the name of the
- node the event has originated from (only relevant for CT Master event handlers).
- <c>data</c> is specific for the particular event.</p>
+ <taglist>
+ <tag><c>name</c></tag>
+ <item><p>Label (type) of the event.</p></item>
+ <tag><c>node</c></tag>
+ <item><p>Name of the node that the event originated from
+ (only relevant for <c>Common Test</c> Master event handlers).</p></item>
+ <tag><c>data</c></tag>
+ <item><p>Specific for the event.</p></item>
+ </taglist>
+
<marker id="events"></marker>
- <p><em>General events:</em></p>
+ <section>
+ <title>General Events</title>
- <list>
- <item><c>#event{name = start_logging, data = LogDir}</c>
- <p><c>LogDir = string()</c>, top level log directory for the test run.</p>
- <p>Indicates that the logging process of Common Test
- has started successfully and is ready to receive IO
+ <p>The general events are as follows:</p>
+
+ <taglist>
+ <tag><c>#event{name = start_logging, data = LogDir}</c></tag>
+ <item>
+ <p><c>LogDir = string()</c>, top-level log directory for the test run.</p>
+ <p>This event indicates that the logging process of <c>Common Test</c>
+ has started successfully and is ready to receive I/O
messages.</p></item>
- <item><c>#event{name = stop_logging, data = []}</c>
- <p>Indicates that the logging process of Common Test
- has been shut down at the end of the test run.
+ <tag><c>#event{name = stop_logging, data = []}</c></tag>
+ <item>
+ <p>This event indicates that the logging process of <c>Common Test</c>
+ was shut down at the end of the test run.
</p></item>
- <item><c>#event{name = test_start, data = {StartTime,LogDir}}</c>
+ <tag><c>#event{name = test_start, data = {StartTime,LogDir}}</c></tag>
+ <item>
<p><c>StartTime = {date(),time()}</c>, test run start date and time.</p>
- <p><c>LogDir = string()</c>, top level log directory for the test run.</p>
- <p>This event indicates that Common Test has finished initial preparations
- and will begin executing test cases.
+ <p><c>LogDir = string()</c>, top-level log directory for the test run.</p>
+ <p>This event indicates that <c>Common Test</c> has finished initial preparations
+ and begins executing test cases.
</p></item>
- <item><c>#event{name = test_done, data = EndTime}</c>
+ <tag><c>#event{name = test_done, data = EndTime}</c></tag>
+ <item>
<p><c>EndTime = {date(),time()}</c>, date and time the test run finished.</p>
- <p>This indicates that the last test case has been executed and
- Common Test is shutting down.
+ <p>This event indicates that the last test case has been executed and
+ <c>Common Test</c> is shutting down.
</p></item>
- <item><c>#event{name = start_info, data = {Tests,Suites,Cases}}</c>
- <p><c>Tests = integer()</c>, the number of tests.</p>
- <p><c>Suites = integer()</c>, the total number of suites.</p>
- <p><c>Cases = integer() | unknown</c>, the total number of test cases.</p>
- <p>Initial test run information that can be interpreted as: "This test
- run will execute <c>Tests</c> separate tests, in total containing
+ <tag><c>#event{name = start_info, data = {Tests,Suites,Cases}}</c></tag>
+ <item>
+ <p><c>Tests = integer()</c>, number of tests.</p>
+ <p><c>Suites = integer()</c>, total number of suites.</p>
+ <p><c>Cases = integer() | unknown</c>, total number of test cases.</p>
+ <p>This event gives initial test run information that can be interpreted as:
+ "This test run will execute <c>Tests</c> separate tests, in total containing
<c>Cases</c> number of test cases, in <c>Suites</c> number of suites".
- Note that if a test case group with a repeat property exists in any test,
- the total number of test cases can not be calculated (unknown).
+ However, if a test case group with a repeat property exists in any test,
+ the total number of test cases cannot be calculated (unknown).
</p></item>
- <item><c>#event{name = tc_start, data = {Suite,FuncOrGroup}}</c>
+ <tag><c>#event{name = tc_start, data = {Suite,FuncOrGroup}}</c></tag>
+ <item>
<p><c>Suite = atom()</c>, name of the test suite.</p>
<p><c>FuncOrGroup = Func | {Conf,GroupName,GroupProperties}</c></p>
<p><c>Func = atom()</c>, name of test case or configuration function.</p>
@@ -180,23 +207,24 @@
<p>This event informs about the start of a test case, or a group configuration
function. The event is sent also for <c>init_per_suite</c> and <c>end_per_suite</c>,
but not for <c>init_per_testcase</c> and <c>end_per_testcase</c>. If a group
- configuration function is starting, the group name and execution properties
- are also given.
+ configuration function starts, the group name and execution properties
+ are also specified.
</p></item>
- <item><c>#event{name = tc_logfile, data = {{Suite,Func},LogFileName}}</c>
+ <tag><c>#event{name = tc_logfile, data = {{Suite,Func},LogFileName}}</c></tag>
+ <item>
<p><c>Suite = atom()</c>, name of the test suite.</p>
<p><c>Func = atom()</c>, name of test case or configuration function.</p>
- <p><c>LogFileName = string()</c>, full name of test case log file.</p>
+ <p><c>LogFileName = string()</c>, full name of the test case log file.</p>
<p>This event is sent at the start of each test case (and configuration function
except <c>init/end_per_testcase</c>) and carries information about the
- full name (i.e. the file name including the absolute directory path) of
+ full name (that is, the file name including the absolute directory path) of
the current test case log file.
</p></item>
+ <tag><c>#event{name = tc_done, data = {Suite,FuncOrGroup,Result}}</c></tag>
<item>
- <marker id="tc_done"/>
- <c>#event{name = tc_done, data = {Suite,FuncOrGroup,Result}}</c>
+ <marker id="tc_done"/>
<p><c>Suite = atom()</c>, name of the suite.</p>
<p><c>FuncOrGroup = Func | {Conf,GroupName,GroupProperties}</c></p>
<p><c>Func = atom()</c>, name of test case or configuration function.</p>
@@ -211,34 +239,37 @@
{require_failed_in_suite0,RequireInfo} |
{failed,{Suite,init_per_testcase,FailInfo}} |
UserTerm</c>,
- the reason why the case has been skipped.</p>
+ why the case was skipped.</p>
<marker id="failreason"/>
<p><c>FailReason = {error,FailInfo} |
{error,{RunTimeError,StackTrace}} |
{timetrap_timeout,integer()} |
{failed,{Suite,end_per_testcase,FailInfo}}</c>, reason for failure.</p>
- <p><c>RequireInfo = {not_available,atom() | tuple()}</c>, why require has failed.</p>
+ <p><c>RequireInfo = {not_available,atom() | tuple()}</c>, why require failed.</p>
<p><c>FailInfo = {timetrap_timeout,integer()} |
{RunTimeError,StackTrace} |
UserTerm</c>,
- detailed information about an error.</p>
- <p><c>RunTimeError = term()</c>, a run-time error, e.g. badmatch, undef, etc.</p>
- <p><c>StackTrace = list()</c>, list of function calls preceeding a run-time error.</p>
- <p><c>UserTerm = term()</c>, arbitrary data specified by user, or <c>exit/1</c> info.</p>
- <p>This event informs about the end of a test case or a configuration function (see the
- <c>tc_start</c> event for details on the FuncOrGroup element). With this event comes the
- final result of the function in question. It is possible to determine on the top level
- of <c>Result</c> if the function was successful, skipped (by the user), or if it failed.
- It is of course possible to dig deeper and also perform pattern matching on the various
- reasons for skipped or failed. Note that <c>{'EXIT',Reason}</c> tuples have been translated into
- <c>{error,Reason}</c>. Note also that if a <c>{failed,{Suite,end_per_testcase,FailInfo}</c>
- result is received, it actually means the test case was successful, but that
+ error details.</p>
+ <p><c>RunTimeError = term()</c>, a runtime error, for example,
+ <c>badmatch</c> or <c>undef</c>.</p>
+ <p><c>StackTrace = list()</c>, list of function calls preceding a runtime error.</p>
+ <p><c>UserTerm = term()</c>, any data specified by user, or <c>exit/1</c> information.</p>
+ <p>This event informs about the end of a test case or a configuration function (see event
+ <c>tc_start</c> for details on element <c>FuncOrGroup</c>). With this event
+ comes the final result of the function in question. It is possible to determine on the
+ top level of <c>Result</c> if the function was successful, skipped (by the user),
+ or if it failed.</p>
+ <p>It is also possible to dig deeper and, for example, perform pattern matching
+ on the various reasons for skipped or failed. Notice that <c>{'EXIT',Reason}</c> tuples
+ are translated into <c>{error,Reason}</c>.
+ Notice also that if a <c>{failed,{Suite,end_per_testcase,FailInfo}</c>
+ result is received, the test case was successful, but
<c>end_per_testcase</c> for the case failed.
</p></item>
+ <tag><c>#event{name = tc_auto_skip, data = {Suite,TestName,Reason}}</c></tag>
<item>
<marker id="tc_auto_skip"></marker>
- <c>#event{name = tc_auto_skip, data = {Suite,TestName,Reason}}</c>
<p><c>Suite = atom()</c>, the name of the suite.</p>
<p><c>TestName = init_per_suite | end_per_suite |
{init_per_group,GroupName} | {end_per_group,GroupName} |
@@ -247,101 +278,116 @@
<p><c>GroupName = atom()</c>, the name of the test case group.</p>
<p><c>Reason = {failed,FailReason} |
{require_failed_in_suite0,RequireInfo}</c>,
- reason for auto skipping <c>Func</c>.</p>
+ reason for auto-skipping <c>Func</c>.</p>
<p><c>FailReason = {Suite,ConfigFunc,FailInfo}} |
{Suite,FailedCaseInSequence}</c>, reason for failure.</p>
- <p><c>RequireInfo = {not_available,atom() | tuple()}</c>, why require has failed.</p>
+ <p><c>RequireInfo = {not_available,atom() | tuple()}</c>, why require failed.</p>
<p><c>ConfigFunc = init_per_suite | init_per_group</c></p>
<p><c>FailInfo = {timetrap_timeout,integer()} |
{RunTimeError,StackTrace} |
bad_return | UserTerm</c>,
- detailed information about an error.</p>
- <p><c>FailedCaseInSequence = atom()</c>, name of a case that has failed in a sequence.</p>
- <p><c>RunTimeError = term()</c>, a run-time error, e.g. badmatch, undef, etc.</p>
- <p><c>StackTrace = list()</c>, list of function calls preceeding a run-time error.</p>
- <p><c>UserTerm = term()</c>, arbitrary data specified by user, or <c>exit/1</c> info.</p>
- <p>This event gets sent for every test case or configuration function that Common Test
+ error details.</p>
+ <p><c>FailedCaseInSequence = atom()</c>, the name of a case that failed in a sequence.</p>
+ <p><c>RunTimeError = term()</c>, a runtime error, for example <c>badmatch</c> or
+ <c>undef</c>.</p>
+ <p><c>StackTrace = list()</c>, list of function calls preceeding a runtime error.</p>
+ <p><c>UserTerm = term()</c>, any data specified by user, or <c>exit/1</c> information.</p>
+ <p>This event is sent for every test case or configuration function that <c>Common Test</c>
has skipped automatically because of either a failed <c>init_per_suite</c> or
<c>init_per_group</c>, a failed <c>require</c> in <c>suite/0</c>, or a failed test case
- in a sequence. Note that this event is never received as a result of a test case getting
- skipped because of <c>init_per_testcase</c> failing, since that information is carried with
- the <c>tc_done</c> event. If a failed test case belongs to a test case group, the second
- data element is a tuple <c>{FuncName,GroupName}</c>, otherwise simply the function name.
+ in a sequence. Notice that this event is never received as a result of a test case getting
+ skipped because of <c>init_per_testcase</c> failing, as that information is carried with
+ event <c>tc_done</c>. If a failed test case belongs to a test case group, the second
+ data element is a tuple <c>{FuncName,GroupName}</c>, otherwise only the function name.
</p></item>
+ <tag><c>#event{name = tc_user_skip, data = {Suite,TestName,Comment}}</c></tag>
<item>
- <marker id="tc_user_skip"></marker>
- <c>#event{name = tc_user_skip, data = {Suite,TestName,Comment}}</c>
+ <marker id="tc_user_skip"></marker>
<p><c>Suite = atom()</c>, the name of the suite.</p>
<p><c>TestName = init_per_suite | end_per_suite |
{init_per_group,GroupName} | {end_per_group,GroupName} |
{FuncName,GroupName} | FuncName</c></p>
<p><c>FuncName = atom()</c>, the name of the test case or configuration function.</p>
<p><c>GroupName = atom()</c>, the name of the test case group.</p>
- <p><c>Comment = string()</c>, reason for skipping the test case.</p>
- <p>This event specifies that a test case has been skipped by the user.
- It is only ever received if the skip was declared in a test specification.
+ <p><c>Comment = string()</c>, why the test case was skipped.</p>
+ <p>This event specifies that a test case was skipped by the user.
+ It is only received if the skip is declared in a test specification.
Otherwise, user skip information is received as a <c>{skipped,SkipReason}</c>
- result in the <c>tc_done</c> event for the test case. If a skipped test case belongs
+ result in event <c>tc_done</c> for the test case. If a skipped test case belongs
to a test case group, the second data element is a tuple <c>{FuncName,GroupName}</c>,
- otherwise simply the function name.
+ otherwise only the function name.
</p></item>
- <item><c>#event{name = test_stats, data = {Ok,Failed,Skipped}}</c>
- <p><c>Ok = integer()</c>, the current number of successful test cases.</p>
- <p><c>Failed = integer()</c>, the current number of failed test cases.</p>
+ <tag><c>#event{name = test_stats, data = {Ok,Failed,Skipped}}</c></tag>
+ <item>
+ <p><c>Ok = integer()</c>, current number of successful test cases.</p>
+ <p><c>Failed = integer()</c>, current number of failed test cases.</p>
<p><c>Skipped = {UserSkipped,AutoSkipped}</c></p>
- <p><c>UserSkipped = integer()</c>, the current number of user skipped test cases.</p>
- <p><c>AutoSkipped = integer()</c>, the current number of auto skipped test cases.</p>
- <p>This is a statistics event with the current count of successful, skipped
- and failed test cases so far. This event gets sent after the end of each test case,
- immediately following the <c>tc_done</c> event.
+ <p><c>UserSkipped = integer()</c>, current number of user-skipped test cases.</p>
+ <p><c>AutoSkipped = integer()</c>, current number of auto-skipped test cases.</p>
+ <p>This is a statistics event with current count of successful, skipped,
+ and failed test cases so far. This event is sent after the end of each test case,
+ immediately following event <c>tc_done</c>.
</p></item>
- </list>
+ </taglist>
+ </section>
+
+ <section>
+ <title>Internal Events</title>
- <p><em>Internal events:</em></p>
+ <p>The internal events are as follows:</p>
- <list>
- <item><c>#event{name = start_make, data = Dir}</c>
+ <taglist>
+ <tag><c>#event{name = start_make, data = Dir}</c></tag>
+ <item>
<p><c>Dir = string()</c>, running make in this directory.</p>
- <p>An internal event saying that Common Test will start compiling
+ <p>This internal event says that <c>Common Test</c> starts compiling
modules in directory <c>Dir</c>.
</p></item>
- <item><c>#event{name = finished_make, data = Dir}</c>
+ <tag><c>#event{name = finished_make, data = Dir}</c></tag>
+ <item>
<p><c>Dir = string()</c>, finished running make in this directory.</p>
- <p>An internal event saying that Common Test is finished compiling
+ <p>This internal event says that <c>Common Test</c> is finished compiling
modules in directory <c>Dir</c>.
</p></item>
- <item><c>#event{name = start_write_file, data = FullNameFile}</c>
+ <tag><c>#event{name = start_write_file, data = FullNameFile}</c></tag>
+ <item>
<p><c>FullNameFile = string(), full name of the file.</c></p>
- <p>An internal event used by the Common Test Master process to
+ <p>This internal event is used by the <c>Common Test</c> Master process to
synchronize particular file operations.
</p></item>
- <item><c>#event{name = finished_write_file, data = FullNameFile}</c>
+ <tag><c>#event{name = finished_write_file, data = FullNameFile}</c></tag>
+ <item>
<p><c>FullNameFile = string(), full name of the file.</c></p>
- <p>An internal event used by the Common Test Master process to
+ <p>This internal event is used by the <c>Common Test</c> Master process to
synchronize particular file operations.
</p></item>
- </list>
-
+ </taglist>
+ </section>
+ <section>
+ <title>Notes</title>
+
<p>The events are also documented in <c>ct_event.erl</c>. This module
- may serve as an example of what an event handler for the CT event
+ can serve as an example of what an event handler for the <c>Common Test</c> event
manager can look like.</p>
- <note><p>To ensure that printouts to standard out (or printouts made with
- <seealso marker="ct#log-2"><c>ct:log/2/3</c></seealso> or <seealso marker="ct:pal-2"><c>ct:pal/2/3</c></seealso>) get written to the test case log
- file, and not to the Common Test framework log, you can syncronize
- with the Common Test server by matching on the <c>tc_start</c> and <c>tc_done</c>
- events. In the period between these events, all IO gets directed to the
+ <note><p>To ensure that printouts to <c>stdout</c> (or printouts made with
+ <seealso marker="ct#log-2"><c>ct:log/2,3</c></seealso> or
+ <seealso marker="ct:pal-2"><c>ct:pal,2,3</c></seealso>) get written to the test case log
+ file, and not to the <c>Common Test</c> framework log, you can synchronize
+ with the <c>Common Test</c> server by matching on evvents <c>tc_start</c> and <c>tc_done</c>.
+ In the period between these events, all I/O is directed to the
test case log file. These events are sent synchronously to avoid potential
- timing problems (e.g. that the test case log file gets closed just before
- an IO message from an external process gets through). Knowing this, you
- need to be careful that your <c>handle_event/2</c> callback function doesn't
- stall the test execution, possibly causing unexpected behaviour as a result.</p></note>
+ timing problems (for example, that the test case log file is closed just before
+ an I/O message from an external process gets through). Knowing this, you
+ need to be careful that your <c>handle_event/2</c> callback function does not
+ stall the test execution, possibly causing unexpected behavior as a result.</p></note>
+ </section>
</section>
</chapter>
diff --git a/lib/common_test/doc/src/example_chapter.xml b/lib/common_test/doc/src/example_chapter.xml
index 8201107c04..8523c9f485 100644
--- a/lib/common_test/doc/src/example_chapter.xml
+++ b/lib/common_test/doc/src/example_chapter.xml
@@ -33,476 +33,472 @@
<marker id="top"></marker>
<section>
- <title>Test suite example</title>
- <p>This example test suite shows some tests of a database server.
+ <title>Test Suite Example</title>
+ <p>The following example test suite shows some tests of a database server:
</p>
<code>
--module(db_data_type_SUITE).
-
--include_lib("common_test/include/ct.hrl").
-
-%% Test server callbacks
--export([suite/0, all/0,
- init_per_suite/1, end_per_suite/1,
- init_per_testcase/2, end_per_testcase/2]).
-
-%% Test cases
--export([string/1, integer/1]).
-
--define(CONNECT_STR, "DSN=sqlserver;UID=alladin;PWD=sesame").
-
-%%--------------------------------------------------------------------
-%% COMMON TEST CALLBACK FUNCTIONS
-%%--------------------------------------------------------------------
-
-%%--------------------------------------------------------------------
-%% Function: suite() -> Info
-%%
-%% Info = [tuple()]
-%% List of key/value pairs.
-%%
-%% Description: Returns list of tuples to set default properties
-%% for the suite.
-%%--------------------------------------------------------------------
-suite() ->
- [{timetrap,{minutes,1}}].
-
-%%--------------------------------------------------------------------
-%% Function: init_per_suite(Config0) -> Config1
-%%
-%% Config0 = Config1 = [tuple()]
-%% A list of key/value pairs, holding the test case configuration.
-%%
-%% Description: Initialization before the suite.
-%%--------------------------------------------------------------------
-init_per_suite(Config) ->
- {ok, Ref} = db:connect(?CONNECT_STR, []),
- TableName = db_lib:unique_table_name(),
- [{con_ref, Ref },{table_name, TableName}| Config].
-
-%%--------------------------------------------------------------------
-%% Function: end_per_suite(Config) -> term()
-%%
-%% Config = [tuple()]
-%% A list of key/value pairs, holding the test case configuration.
-%%
-%% Description: Cleanup after the suite.
-%%--------------------------------------------------------------------
-end_per_suite(Config) ->
- Ref = ?config(con_ref, Config),
- db:disconnect(Ref),
- ok.
+ -module(db_data_type_SUITE).
+
+ -include_lib("common_test/include/ct.hrl").
+
+ %% Test server callbacks
+ -export([suite/0, all/0,
+ init_per_suite/1, end_per_suite/1,
+ init_per_testcase/2, end_per_testcase/2]).
+
+ %% Test cases
+ -export([string/1, integer/1]).
+
+ -define(CONNECT_STR, "DSN=sqlserver;UID=alladin;PWD=sesame").
+
+ %%--------------------------------------------------------------------
+ %% COMMON TEST CALLBACK FUNCTIONS
+ %%--------------------------------------------------------------------
+
+ %%--------------------------------------------------------------------
+ %% Function: suite() -> Info
+ %%
+ %% Info = [tuple()]
+ %% List of key/value pairs.
+ %%
+ %% Description: Returns list of tuples to set default properties
+ %% for the suite.
+ %%--------------------------------------------------------------------
+ suite() ->
+ [{timetrap,{minutes,1}}].
+
+ %%--------------------------------------------------------------------
+ %% Function: init_per_suite(Config0) -> Config1
+ %%
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding the test case configuration.
+ %%
+ %% Description: Initialization before the suite.
+ %%--------------------------------------------------------------------
+ init_per_suite(Config) ->
+ {ok, Ref} = db:connect(?CONNECT_STR, []),
+ TableName = db_lib:unique_table_name(),
+ [{con_ref, Ref },{table_name, TableName}| Config].
+
+ %%--------------------------------------------------------------------
+ %% Function: end_per_suite(Config) -> term()
+ %%
+ %% Config = [tuple()]
+ %% A list of key/value pairs, holding the test case configuration.
+ %%
+ %% Description: Cleanup after the suite.
+ %%--------------------------------------------------------------------
+ end_per_suite(Config) ->
+ Ref = ?config(con_ref, Config),
+ db:disconnect(Ref),
+ ok.
-%%--------------------------------------------------------------------
-%% Function: init_per_testcase(TestCase, Config0) -> Config1
-%%
-%% TestCase = atom()
-%% Name of the test case that is about to run.
-%% Config0 = Config1 = [tuple()]
-%% A list of key/value pairs, holding the test case configuration.
-%%
-%% Description: Initialization before each test case.
-%%--------------------------------------------------------------------
-init_per_testcase(Case, Config) ->
- Ref = ?config(con_ref, Config),
- TableName = ?config(table_name, Config),
- ok = db:create_table(Ref, TableName, table_type(Case)),
- Config.
-
-%%--------------------------------------------------------------------
-%% Function: end_per_testcase(TestCase, Config) -> term()
-%%
-%% TestCase = atom()
-%% Name of the test case that is finished.
-%% Config = [tuple()]
-%% A list of key/value pairs, holding the test case configuration.
-%%
-%% Description: Cleanup after each test case.
-%%--------------------------------------------------------------------
-end_per_testcase(_Case, Config) ->
- Ref = ?config(con_ref, Config),
- TableName = ?config(table_name, Config),
- ok = db:delete_table(Ref, TableName),
- ok.
-
-%%--------------------------------------------------------------------
-%% Function: all() -> GroupsAndTestCases
-%%
-%% GroupsAndTestCases = [{group,GroupName} | TestCase]
-%% GroupName = atom()
-%% Name of a test case group.
-%% TestCase = atom()
-%% Name of a test case.
-%%
-%% Description: Returns the list of groups and test cases that
-%% are to be executed.
-%%--------------------------------------------------------------------
-all() ->
- [string, integer].
-
-
-%%--------------------------------------------------------------------
-%% TEST CASES
-%%--------------------------------------------------------------------
-
-string(Config) ->
- insert_and_lookup(dummy_key, "Dummy string", Config).
-
-integer(Config) ->
- insert_and_lookup(dummy_key, 42, Config).
-
-
-insert_and_lookup(Key, Value, Config) ->
- Ref = ?config(con_ref, Config),
- TableName = ?config(table_name, Config),
- ok = db:insert(Ref, TableName, Key, Value),
- [Value] = db:lookup(Ref, TableName, Key),
- ok = db:delete(Ref, TableName, Key),
- [] = db:lookup(Ref, TableName, Key),
- ok.
-
-</code>
+ %%--------------------------------------------------------------------
+ %% Function: init_per_testcase(TestCase, Config0) -> Config1
+ %%
+ %% TestCase = atom()
+ %% Name of the test case that is about to run.
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding the test case configuration.
+ %%
+ %% Description: Initialization before each test case.
+ %%--------------------------------------------------------------------
+ init_per_testcase(Case, Config) ->
+ Ref = ?config(con_ref, Config),
+ TableName = ?config(table_name, Config),
+ ok = db:create_table(Ref, TableName, table_type(Case)),
+ Config.
+
+ %%--------------------------------------------------------------------
+ %% Function: end_per_testcase(TestCase, Config) -> term()
+ %%
+ %% TestCase = atom()
+ %% Name of the test case that is finished.
+ %% Config = [tuple()]
+ %% A list of key/value pairs, holding the test case configuration.
+ %%
+ %% Description: Cleanup after each test case.
+ %%--------------------------------------------------------------------
+ end_per_testcase(_Case, Config) ->
+ Ref = ?config(con_ref, Config),
+ TableName = ?config(table_name, Config),
+ ok = db:delete_table(Ref, TableName),
+ ok.
+
+ %%--------------------------------------------------------------------
+ %% Function: all() -> GroupsAndTestCases
+ %%
+ %% GroupsAndTestCases = [{group,GroupName} | TestCase]
+ %% GroupName = atom()
+ %% Name of a test case group.
+ %% TestCase = atom()
+ %% Name of a test case.
+ %%
+ %% Description: Returns the list of groups and test cases that
+ %% are to be executed.
+ %%--------------------------------------------------------------------
+ all() ->
+ [string, integer].
+
+
+ %%--------------------------------------------------------------------
+ %% TEST CASES
+ %%--------------------------------------------------------------------
+
+ string(Config) ->
+ insert_and_lookup(dummy_key, "Dummy string", Config).
+
+ integer(Config) ->
+ insert_and_lookup(dummy_key, 42, Config).
+
+
+ insert_and_lookup(Key, Value, Config) ->
+ Ref = ?config(con_ref, Config),
+ TableName = ?config(table_name, Config),
+ ok = db:insert(Ref, TableName, Key, Value),
+ [Value] = db:lookup(Ref, TableName, Key),
+ ok = db:delete(Ref, TableName, Key),
+ [] = db:lookup(Ref, TableName, Key),
+ ok.</code>
</section>
<section>
- <title>Test suite templates</title>
- <p>The Erlang mode for the Emacs editor includes two Common Test test suite
- templates, one with extensive information in the function headers, and
+ <title>Test Suite Templates</title>
+ <p>The Erlang mode for the Emacs editor includes two <c>Common Test</c> test
+ suite templates, one with extensive information in the function headers, and
one with minimal information. A test suite template provides a quick start
- for implementing a suite from scratch and gives you a good overview
- of the available callback functions. Here are the templates in question:
+ for implementing a suite from scratch and gives a good overview
+ of the available callback functions. The two templates follows:
</p>
- <p><em>Large Common Test suite</em></p>
+ <p><em>Large Common Test Suite</em></p>
<code>
-%%%-------------------------------------------------------------------
-%%% File : example_SUITE.erl
-%%% Author :
-%%% Description :
-%%%
-%%% Created :
-%%%-------------------------------------------------------------------
--module(example_SUITE).
-
-%% Note: This directive should only be used in test suites.
--compile(export_all).
-
--include_lib("common_test/include/ct.hrl").
-
-%%--------------------------------------------------------------------
-%% COMMON TEST CALLBACK FUNCTIONS
-%%--------------------------------------------------------------------
-
-%%--------------------------------------------------------------------
-%% Function: suite() -> Info
-%%
-%% Info = [tuple()]
-%% List of key/value pairs.
-%%
-%% Description: Returns list of tuples to set default properties
-%% for the suite.
-%%
-%% Note: The suite/0 function is only meant to be used to return
-%% default data values, not perform any other operations.
-%%--------------------------------------------------------------------
-suite() ->
- [{timetrap,{minutes,10}}].
-
-%%--------------------------------------------------------------------
-%% Function: init_per_suite(Config0) ->
-%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
-%%
-%% Config0 = Config1 = [tuple()]
-%% A list of key/value pairs, holding the test case configuration.
-%% Reason = term()
-%% The reason for skipping the suite.
-%%
-%% Description: Initialization before the suite.
-%%
-%% Note: This function is free to add any key/value pairs to the Config
-%% variable, but should NOT alter/remove any existing entries.
-%%--------------------------------------------------------------------
-init_per_suite(Config) ->
- Config.
-
-%%--------------------------------------------------------------------
-%% Function: end_per_suite(Config0) -> term() | {save_config,Config1}
-%%
-%% Config0 = Config1 = [tuple()]
-%% A list of key/value pairs, holding the test case configuration.
-%%
-%% Description: Cleanup after the suite.
-%%--------------------------------------------------------------------
-end_per_suite(_Config) ->
- ok.
-
-%%--------------------------------------------------------------------
-%% Function: init_per_group(GroupName, Config0) ->
-%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
-%%
-%% GroupName = atom()
-%% Name of the test case group that is about to run.
-%% Config0 = Config1 = [tuple()]
-%% A list of key/value pairs, holding configuration data for the group.
-%% Reason = term()
-%% The reason for skipping all test cases and subgroups in the group.
-%%
-%% Description: Initialization before each test case group.
-%%--------------------------------------------------------------------
-init_per_group(_GroupName, Config) ->
- Config.
-
-%%--------------------------------------------------------------------
-%% Function: end_per_group(GroupName, Config0) ->
-%% term() | {save_config,Config1}
-%%
-%% GroupName = atom()
-%% Name of the test case group that is finished.
-%% Config0 = Config1 = [tuple()]
-%% A list of key/value pairs, holding configuration data for the group.
-%%
-%% Description: Cleanup after each test case group.
-%%--------------------------------------------------------------------
-end_per_group(_GroupName, _Config) ->
- ok.
-
-%%--------------------------------------------------------------------
-%% Function: init_per_testcase(TestCase, Config0) ->
-%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
-%%
-%% TestCase = atom()
-%% Name of the test case that is about to run.
-%% Config0 = Config1 = [tuple()]
-%% A list of key/value pairs, holding the test case configuration.
-%% Reason = term()
-%% The reason for skipping the test case.
-%%
-%% Description: Initialization before each test case.
-%%
-%% Note: This function is free to add any key/value pairs to the Config
-%% variable, but should NOT alter/remove any existing entries.
-%%--------------------------------------------------------------------
-init_per_testcase(_TestCase, Config) ->
- Config.
-
-%%--------------------------------------------------------------------
-%% Function: end_per_testcase(TestCase, Config0) ->
-%% term() | {save_config,Config1} | {fail,Reason}
-%%
-%% TestCase = atom()
-%% Name of the test case that is finished.
-%% Config0 = Config1 = [tuple()]
-%% A list of key/value pairs, holding the test case configuration.
-%% Reason = term()
-%% The reason for failing the test case.
-%%
-%% Description: Cleanup after each test case.
-%%--------------------------------------------------------------------
-end_per_testcase(_TestCase, _Config) ->
- ok.
-
-%%--------------------------------------------------------------------
-%% Function: groups() -> [Group]
-%%
-%% Group = {GroupName,Properties,GroupsAndTestCases}
-%% GroupName = atom()
-%% The name of the group.
-%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
-%% Group properties that may be combined.
-%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]
-%% TestCase = atom()
-%% The name of a test case.
-%% Shuffle = shuffle | {shuffle,Seed}
-%% To get cases executed in random order.
-%% Seed = {integer(),integer(),integer()}
-%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
-%% repeat_until_any_ok | repeat_until_any_fail
-%% To get execution of cases repeated.
-%% N = integer() | forever
-%%
-%% Description: Returns a list of test case group definitions.
-%%--------------------------------------------------------------------
-groups() ->
- [].
-
-%%--------------------------------------------------------------------
-%% Function: all() -> GroupsAndTestCases | {skip,Reason}
-%%
-%% GroupsAndTestCases = [{group,GroupName} | TestCase]
-%% GroupName = atom()
-%% Name of a test case group.
-%% TestCase = atom()
-%% Name of a test case.
-%% Reason = term()
-%% The reason for skipping all groups and test cases.
-%%
-%% Description: Returns the list of groups and test cases that
-%% are to be executed.
-%%--------------------------------------------------------------------
-all() ->
- [my_test_case].
-
-
-%%--------------------------------------------------------------------
-%% TEST CASES
-%%--------------------------------------------------------------------
-
-%%--------------------------------------------------------------------
-%% Function: TestCase() -> Info
-%%
-%% Info = [tuple()]
-%% List of key/value pairs.
-%%
-%% Description: Test case info function - returns list of tuples to set
-%% properties for the test case.
-%%
-%% Note: This function is only meant to be used to return a list of
-%% values, not perform any other operations.
-%%--------------------------------------------------------------------
-my_test_case() ->
- [].
-
-%%--------------------------------------------------------------------
-%% Function: TestCase(Config0) ->
-%% ok | exit() | {skip,Reason} | {comment,Comment} |
-%% {save_config,Config1} | {skip_and_save,Reason,Config1}
-%%
-%% Config0 = Config1 = [tuple()]
-%% A list of key/value pairs, holding the test case configuration.
-%% Reason = term()
-%% The reason for skipping the test case.
-%% Comment = term()
-%% A comment about the test case that will be printed in the html log.
-%%
-%% Description: Test case function. (The name of it must be specified in
-%% the all/0 list or in a test case group for the test case
-%% to be executed).
-%%--------------------------------------------------------------------
-my_test_case(_Config) ->
- ok.
-</code>
+ %%%-------------------------------------------------------------------
+ %%% File : example_SUITE.erl
+ %%% Author :
+ %%% Description :
+ %%%
+ %%% Created :
+ %%%-------------------------------------------------------------------
+ -module(example_SUITE).
+
+ %% Note: This directive should only be used in test suites.
+ -compile(export_all).
+
+ -include_lib("common_test/include/ct.hrl").
+
+ %%--------------------------------------------------------------------
+ %% COMMON TEST CALLBACK FUNCTIONS
+ %%--------------------------------------------------------------------
+
+ %%--------------------------------------------------------------------
+ %% Function: suite() -> Info
+ %%
+ %% Info = [tuple()]
+ %% List of key/value pairs.
+ %%
+ %% Description: Returns list of tuples to set default properties
+ %% for the suite.
+ %%
+ %% Note: The suite/0 function is only meant to be used to return
+ %% default data values, not perform any other operations.
+ %%--------------------------------------------------------------------
+ suite() ->
+ [{timetrap,{minutes,10}}].
+
+ %%--------------------------------------------------------------------
+ %% Function: init_per_suite(Config0) ->
+ %% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+ %%
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding the test case configuration.
+ %% Reason = term()
+ %% The reason for skipping the suite.
+ %%
+ %% Description: Initialization before the suite.
+ %%
+ %% Note: This function is free to add any key/value pairs to the Config
+ %% variable, but should NOT alter/remove any existing entries.
+ %%--------------------------------------------------------------------
+ init_per_suite(Config) ->
+ Config.
+
+ %%--------------------------------------------------------------------
+ %% Function: end_per_suite(Config0) -> term() | {save_config,Config1}
+ %%
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding the test case configuration.
+ %%
+ %% Description: Cleanup after the suite.
+ %%--------------------------------------------------------------------
+ end_per_suite(_Config) ->
+ ok.
+
+ %%--------------------------------------------------------------------
+ %% Function: init_per_group(GroupName, Config0) ->
+ %% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+ %%
+ %% GroupName = atom()
+ %% Name of the test case group that is about to run.
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding configuration data for the group.
+ %% Reason = term()
+ %% The reason for skipping all test cases and subgroups in the group.
+ %%
+ %% Description: Initialization before each test case group.
+ %%--------------------------------------------------------------------
+ init_per_group(_GroupName, Config) ->
+ Config.
+
+ %%--------------------------------------------------------------------
+ %% Function: end_per_group(GroupName, Config0) ->
+ %% term() | {save_config,Config1}
+ %%
+ %% GroupName = atom()
+ %% Name of the test case group that is finished.
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding configuration data for the group.
+ %%
+ %% Description: Cleanup after each test case group.
+ %%--------------------------------------------------------------------
+ end_per_group(_GroupName, _Config) ->
+ ok.
+
+ %%--------------------------------------------------------------------
+ %% Function: init_per_testcase(TestCase, Config0) ->
+ %% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+ %%
+ %% TestCase = atom()
+ %% Name of the test case that is about to run.
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding the test case configuration.
+ %% Reason = term()
+ %% The reason for skipping the test case.
+ %%
+ %% Description: Initialization before each test case.
+ %%
+ %% Note: This function is free to add any key/value pairs to the Config
+ %% variable, but should NOT alter/remove any existing entries.
+ %%--------------------------------------------------------------------
+ init_per_testcase(_TestCase, Config) ->
+ Config.
+
+ %%--------------------------------------------------------------------
+ %% Function: end_per_testcase(TestCase, Config0) ->
+ %% term() | {save_config,Config1} | {fail,Reason}
+ %%
+ %% TestCase = atom()
+ %% Name of the test case that is finished.
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding the test case configuration.
+ %% Reason = term()
+ %% The reason for failing the test case.
+ %%
+ %% Description: Cleanup after each test case.
+ %%--------------------------------------------------------------------
+ end_per_testcase(_TestCase, _Config) ->
+ ok.
+
+ %%--------------------------------------------------------------------
+ %% Function: groups() -> [Group]
+ %%
+ %% Group = {GroupName,Properties,GroupsAndTestCases}
+ %% GroupName = atom()
+ %% The name of the group.
+ %% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
+ %% Group properties that may be combined.
+ %% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]
+ %% TestCase = atom()
+ %% The name of a test case.
+ %% Shuffle = shuffle | {shuffle,Seed}
+ %% To get cases executed in random order.
+ %% Seed = {integer(),integer(),integer()}
+ %% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
+ %% repeat_until_any_ok | repeat_until_any_fail
+ %% To get execution of cases repeated.
+ %% N = integer() | forever
+ %%
+ %% Description: Returns a list of test case group definitions.
+ %%--------------------------------------------------------------------
+ groups() ->
+ [].
+
+ %%--------------------------------------------------------------------
+ %% Function: all() -> GroupsAndTestCases | {skip,Reason}
+ %%
+ %% GroupsAndTestCases = [{group,GroupName} | TestCase]
+ %% GroupName = atom()
+ %% Name of a test case group.
+ %% TestCase = atom()
+ %% Name of a test case.
+ %% Reason = term()
+ %% The reason for skipping all groups and test cases.
+ %%
+ %% Description: Returns the list of groups and test cases that
+ %% are to be executed.
+ %%--------------------------------------------------------------------
+ all() ->
+ [my_test_case].
+
+
+ %%--------------------------------------------------------------------
+ %% TEST CASES
+ %%--------------------------------------------------------------------
+
+ %%--------------------------------------------------------------------
+ %% Function: TestCase() -> Info
+ %%
+ %% Info = [tuple()]
+ %% List of key/value pairs.
+ %%
+ %% Description: Test case info function - returns list of tuples to set
+ %% properties for the test case.
+ %%
+ %% Note: This function is only meant to be used to return a list of
+ %% values, not perform any other operations.
+ %%--------------------------------------------------------------------
+ my_test_case() ->
+ [].
+
+ %%--------------------------------------------------------------------
+ %% Function: TestCase(Config0) ->
+ %% ok | exit() | {skip,Reason} | {comment,Comment} |
+ %% {save_config,Config1} | {skip_and_save,Reason,Config1}
+ %%
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding the test case configuration.
+ %% Reason = term()
+ %% The reason for skipping the test case.
+ %% Comment = term()
+ %% A comment about the test case that will be printed in the html log.
+ %%
+ %% Description: Test case function. (The name of it must be specified in
+ %% the all/0 list or in a test case group for the test case
+ %% to be executed).
+ %%--------------------------------------------------------------------
+ my_test_case(_Config) ->
+ ok.</code>
<br></br>
- <p><em>Small Common Test suite</em></p>
+ <p><em>Small Common Test Suite</em></p>
<code>
-%%%-------------------------------------------------------------------
-%%% File : example_SUITE.erl
-%%% Author :
-%%% Description :
-%%%
-%%% Created :
-%%%-------------------------------------------------------------------
--module(example_SUITE).
-
--compile(export_all).
-
--include_lib("common_test/include/ct.hrl").
-
-%%--------------------------------------------------------------------
-%% Function: suite() -> Info
-%% Info = [tuple()]
-%%--------------------------------------------------------------------
-suite() ->
- [{timetrap,{seconds,30}}].
-
-%%--------------------------------------------------------------------
-%% Function: init_per_suite(Config0) ->
-%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
-%% Config0 = Config1 = [tuple()]
-%% Reason = term()
-%%--------------------------------------------------------------------
-init_per_suite(Config) ->
- Config.
-
-%%--------------------------------------------------------------------
-%% Function: end_per_suite(Config0) -> term() | {save_config,Config1}
-%% Config0 = Config1 = [tuple()]
-%%--------------------------------------------------------------------
-end_per_suite(_Config) ->
- ok.
-
-%%--------------------------------------------------------------------
-%% Function: init_per_group(GroupName, Config0) ->
-%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
-%% GroupName = atom()
-%% Config0 = Config1 = [tuple()]
-%% Reason = term()
-%%--------------------------------------------------------------------
-init_per_group(_GroupName, Config) ->
- Config.
-
-%%--------------------------------------------------------------------
-%% Function: end_per_group(GroupName, Config0) ->
-%% term() | {save_config,Config1}
-%% GroupName = atom()
-%% Config0 = Config1 = [tuple()]
-%%--------------------------------------------------------------------
-end_per_group(_GroupName, _Config) ->
- ok.
-
-%%--------------------------------------------------------------------
-%% Function: init_per_testcase(TestCase, Config0) ->
-%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
-%% TestCase = atom()
-%% Config0 = Config1 = [tuple()]
-%% Reason = term()
-%%--------------------------------------------------------------------
-init_per_testcase(_TestCase, Config) ->
- Config.
-
-%%--------------------------------------------------------------------
-%% Function: end_per_testcase(TestCase, Config0) ->
-%% term() | {save_config,Config1} | {fail,Reason}
-%% TestCase = atom()
-%% Config0 = Config1 = [tuple()]
-%% Reason = term()
-%%--------------------------------------------------------------------
-end_per_testcase(_TestCase, _Config) ->
- ok.
-
-%%--------------------------------------------------------------------
-%% Function: groups() -> [Group]
-%% Group = {GroupName,Properties,GroupsAndTestCases}
-%% GroupName = atom()
-%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
-%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]
-%% TestCase = atom()
-%% Shuffle = shuffle | {shuffle,{integer(),integer(),integer()}}
-%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
-%% repeat_until_any_ok | repeat_until_any_fail
-%% N = integer() | forever
-%%--------------------------------------------------------------------
-groups() ->
- [].
-
-%%--------------------------------------------------------------------
-%% Function: all() -> GroupsAndTestCases | {skip,Reason}
-%% GroupsAndTestCases = [{group,GroupName} | TestCase]
-%% GroupName = atom()
-%% TestCase = atom()
-%% Reason = term()
-%%--------------------------------------------------------------------
-all() ->
- [my_test_case].
-
-%%--------------------------------------------------------------------
-%% Function: TestCase() -> Info
-%% Info = [tuple()]
-%%--------------------------------------------------------------------
-my_test_case() ->
- [].
-
-%%--------------------------------------------------------------------
-%% Function: TestCase(Config0) ->
-%% ok | exit() | {skip,Reason} | {comment,Comment} |
-%% {save_config,Config1} | {skip_and_save,Reason,Config1}
-%% Config0 = Config1 = [tuple()]
-%% Reason = term()
-%% Comment = term()
-%%--------------------------------------------------------------------
-my_test_case(_Config) ->
- ok.
-</code>
+ %%%-------------------------------------------------------------------
+ %%% File : example_SUITE.erl
+ %%% Author :
+ %%% Description :
+ %%%
+ %%% Created :
+ %%%-------------------------------------------------------------------
+ -module(example_SUITE).
+
+ -compile(export_all).
+
+ -include_lib("common_test/include/ct.hrl").
+
+ %%--------------------------------------------------------------------
+ %% Function: suite() -> Info
+ %% Info = [tuple()]
+ %%--------------------------------------------------------------------
+ suite() ->
+ [{timetrap,{seconds,30}}].
+
+ %%--------------------------------------------------------------------
+ %% Function: init_per_suite(Config0) ->
+ %% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+ %% Config0 = Config1 = [tuple()]
+ %% Reason = term()
+ %%--------------------------------------------------------------------
+ init_per_suite(Config) ->
+ Config.
+
+ %%--------------------------------------------------------------------
+ %% Function: end_per_suite(Config0) -> term() | {save_config,Config1}
+ %% Config0 = Config1 = [tuple()]
+ %%--------------------------------------------------------------------
+ end_per_suite(_Config) ->
+ ok.
+
+ %%--------------------------------------------------------------------
+ %% Function: init_per_group(GroupName, Config0) ->
+ %% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+ %% GroupName = atom()
+ %% Config0 = Config1 = [tuple()]
+ %% Reason = term()
+ %%--------------------------------------------------------------------
+ init_per_group(_GroupName, Config) ->
+ Config.
+
+ %%--------------------------------------------------------------------
+ %% Function: end_per_group(GroupName, Config0) ->
+ %% term() | {save_config,Config1}
+ %% GroupName = atom()
+ %% Config0 = Config1 = [tuple()]
+ %%--------------------------------------------------------------------
+ end_per_group(_GroupName, _Config) ->
+ ok.
+
+ %%--------------------------------------------------------------------
+ %% Function: init_per_testcase(TestCase, Config0) ->
+ %% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+ %% TestCase = atom()
+ %% Config0 = Config1 = [tuple()]
+ %% Reason = term()
+ %%--------------------------------------------------------------------
+ init_per_testcase(_TestCase, Config) ->
+ Config.
+
+ %%--------------------------------------------------------------------
+ %% Function: end_per_testcase(TestCase, Config0) ->
+ %% term() | {save_config,Config1} | {fail,Reason}
+ %% TestCase = atom()
+ %% Config0 = Config1 = [tuple()]
+ %% Reason = term()
+ %%--------------------------------------------------------------------
+ end_per_testcase(_TestCase, _Config) ->
+ ok.
+
+ %%--------------------------------------------------------------------
+ %% Function: groups() -> [Group]
+ %% Group = {GroupName,Properties,GroupsAndTestCases}
+ %% GroupName = atom()
+ %% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
+ %% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]
+ %% TestCase = atom()
+ %% Shuffle = shuffle | {shuffle,{integer(),integer(),integer()}}
+ %% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
+ %% repeat_until_any_ok | repeat_until_any_fail
+ %% N = integer() | forever
+ %%--------------------------------------------------------------------
+ groups() ->
+ [].
+
+ %%--------------------------------------------------------------------
+ %% Function: all() -> GroupsAndTestCases | {skip,Reason}
+ %% GroupsAndTestCases = [{group,GroupName} | TestCase]
+ %% GroupName = atom()
+ %% TestCase = atom()
+ %% Reason = term()
+ %%--------------------------------------------------------------------
+ all() ->
+ [my_test_case].
+
+ %%--------------------------------------------------------------------
+ %% Function: TestCase() -> Info
+ %% Info = [tuple()]
+ %%--------------------------------------------------------------------
+ my_test_case() ->
+ [].
+
+ %%--------------------------------------------------------------------
+ %% Function: TestCase(Config0) ->
+ %% ok | exit() | {skip,Reason} | {comment,Comment} |
+ %% {save_config,Config1} | {skip_and_save,Reason,Config1}
+ %% Config0 = Config1 = [tuple()]
+ %% Reason = term()
+ %% Comment = term()
+ %%--------------------------------------------------------------------
+ my_test_case(_Config) ->
+ ok.</code>
</section>
</chapter>
diff --git a/lib/common_test/doc/src/getting_started_chapter.xml b/lib/common_test/doc/src/getting_started_chapter.xml
index ef9c409bf1..802f9ba397 100644
--- a/lib/common_test/doc/src/getting_started_chapter.xml
+++ b/lib/common_test/doc/src/getting_started_chapter.xml
@@ -31,235 +31,247 @@
</header>
<section>
- <title>Are you new around here?</title>
+ <title>Introduction for Newcomers</title>
<p>
- The purpose of this short chapter is to, with a "learning by example"
- approach, give the newcomer a chance to get started quickly writing and
- executing some first simple tests. The chapter will introduce some of the
- basics, but leave most explanations and details for the later
- chapters in this User's Guide. Hopefully though, after this chapter, you
- will be inspired and unintimidated enough to go on and get into the
- nitty-gritty that follows in this rather heavy User's Guide! If you're
- not much into "learning by example" and prefer to get into more technical
- detail right away, go ahead and skip to the next chapter. Again, the basics
- presented here will be covered in detail in later chapters.
+ The purpose of this section is to let the newcomer get started in
+ quickly writing and executing some first simple tests with a
+ "learning by example" approach. Most explanations are left for later sections.
+ If you are not much into "learning by example" and prefer more technical
+ details, go ahead and skip to the next section.
</p>
<p>
- This chapter also tries to demonstrate how dead simple it actually is
- to write a very basic (yet for many module testing purposes, often sufficiently
- complex) test suite, and execute its test cases. This is not necessarily
- obvious when you read the rest of the chapters in the User's Guide.
- </p>
- <p>
- A quick note before we start: In order to understand what's discussed and
- examplified here, it is recommended that you first read through the
- opening <seealso marker="basics_chapter#basics">Common Test Basics</seealso>
- chapter.
+ This section demonstrates how simple it is to write a basic
+ (yet for many module testing purposes, often sufficiently complex)
+ test suite and execute its test cases. This is not necessarily
+ obvious when you read the remaining sections in this User's Guide.
</p>
+ <note>
+ <p>
+ To understand what is discussed and examplified here, we recommended
+ you to first read section
+ <seealso marker="basics_chapter#basics">Common Test Basics</seealso>.
+ </p>
+ </note>
</section>
<section>
- <title>Test case execution</title>
- <p>Execution of test cases is handled this way:</p>
+ <title>Test Case Execution</title>
+ <p>Execution of test cases is handled as follows:</p>
<image file="tc_execution.gif">
<icaption>
- Successful vs unsuccessful test case execution.
+ Successful and Unsuccessful Test Case Execution
</icaption>
</image>
- <p>For each test case that Common Test is told to execute, it spawns a
- dedicated process on which the test case function in question starts
+ <p>For each test case that <c>Common Test</c> is ordered to execute, it spawns a
+ dedicated process on which the test case function starts
running. (In parallel to the test case process, an idle waiting timer
- process is started which is linked to the test case process. If the timer
+ process is started, which is linked to the test case process. If the timer
process runs out of waiting time, it sends an exit signal to terminate
- the test case process and this is what's called a <em>timetrap</em>).
+ the test case process. This is called a <em>timetrap</em>).
</p>
- <p>In scenario 1, the test case process terminates normally after case A has
- finished executing its test code without detecting any errors. The test
- case function simply returns a value and Common Test logs the test case as
- successful.
+ <p>In scenario 1, the test case process terminates normally after
+ <c>case A</c> has finished executing its test code without detecting
+ any errors. The test case function returns a value and <c>Common Test</c>
+ logs the test case as successful.
</p>
- <p>In scenario 2, an error is detected during test case execution
- which causes the test case B function to generate an exception.
- This causes the test case process to exit with reason
- other than normal, and as a result, Common Test will log this as an
- unsuccessful test case.
+ <p>In scenario 2, an error is detected during test <c>case B</c> execution.
+ This causes the test <c>case B</c> function to generate an exception
+ and, as a result, the test case process exits with reason other than normal.
+ <c>Common Test</c> logs this as an unsuccessful (Failed) test case.
</p>
- <p>As you can understand from the illustration above, Common Test requires
- that a test case generates a runtime error to indicate failure (e.g.
- by causing a bad match error or by calling <c>exit/1</c>, preferrably
- through the <seealso marker="ct#fail-1"><c>ct:fail/1,2</c></seealso> help function). A succesful execution is
- indicated by means of a normal return from the test case function.
+ <p>As you can understand from the illustration, <c>Common Test</c> requires
+ a test case to generate a runtime error to indicate failure (for example,
+ by causing a bad match error or by calling <c>exit/1</c>, preferably
+ through the help function
+ <seealso marker="ct#fail-1"><c>ct:fail/1,2</c></seealso>). A successful
+ execution is indicated by a normal return from the test case function.
</p>
</section>
<section>
- <title>A simple test suite</title>
- <p>As you've seen in the basics chapter, the test suite module implements
+ <title>A Simple Test Suite</title>
+ <p>As shown in section
+ <seealso marker="basics_chapter#External_Interfaces">Common Test Basics</seealso>,
+ the test suite module implements
<seealso marker="common_test">callback functions</seealso>
- (mandatory or optional) for various purposes, e.g:
+ (mandatory or optional) for various purposes, for example:
</p>
- <list>
+ <list type="bulleted">
<item>Init/end configuration function for the test suite</item>
<item>Init/end configuration function for a test case</item>
<item>Init/end configuration function for a test case group</item>
<item>Test cases</item>
</list>
<p>
- The configuration functions are optional and if you don't need them for
- your test, a test suite with one simple test case could look like this:
+ The configuration functions are optional. The following example is a test suite
+ without configuration functions, including one simple test case, to
+ check that module <c>mymod</c> exists (that is, can be successfully loaded by the
+ code server):
</p>
<pre>
- -module(my1st_SUITE).
- -compile(export_all).
+ -module(my1st_SUITE).
+ -compile(export_all).
- all() ->
- [mod_exists].
+ all() ->
+ [mod_exists].
- mod_exists(_) ->
- {module,mymod} = code:load_file(mymod).</pre>
+ mod_exists(_) ->
+ {module,mymod} = code:load_file(mymod).</pre>
<p>
- In this example we check that the <c>mymod</c> module exists (i.e. can be
- successfully loaded by the code server). If the operation fails, we will
- get a bad match error which terminates the test case.
+ If the operation fails, a bad match error occurs that terminates the test case.
</p>
</section>
<section>
- <title>A test suite with configuration functions</title>
+ <title>A Test Suite with Configuration Functions</title>
<p>
- If we need to perform configuration operations in order to run our test, we
- implement configuration functions in our suite. The result from a
- configuration function is configuration data, or simply <em><c>Config</c></em>.
- This is a list of key-value tuples which get passed from the configuration
+ If you need to perform configuration operations to run your test, you can
+ implement configuration functions in your suite. The result from a
+ configuration function is configuration data, or <c>Config</c>.
+ This is a list of key-value tuples that get passed from the configuration
function to the test cases (possibly through configuration functions on
- "lower level"). The data flow looks like this:
+ "lower level"). The data flow looks as follows:
</p>
<image file="config.gif">
<icaption>
- Config data flow in the suite.
+ Configuration Data Flow in a Suite
</icaption>
</image>
<p>
- Here's an example of a test suite which uses configuration functions
- to open and close a log file for the test cases (an operation that would
- be unnecessary and irrelevant to perform by each test case):
+ The following example shows a test suite that uses configuration functions
+ to open and close a log file for the test cases (an operation that is
+ unnecessary and irrelevant to perform by each test case):
</p>
<pre>
- -module(check_log_SUITE).
- -export([all/0, init_per_suite/1, end_per_suite/1]).
- -export([check_restart_result/1, check_no_errors/1]).
-
- -define(value(Key,Config), proplists:get_value(Key,Config)).
+ -module(check_log_SUITE).
+ -export([all/0, init_per_suite/1, end_per_suite/1]).
+ -export([check_restart_result/1, check_no_errors/1]).
- all() -> [check_restart_result, check_no_errors].
+ -define(value(Key,Config), proplists:get_value(Key,Config)).
- init_per_suite(InitConfigData) ->
- [{logref,open_log()} | InitConfigData].
+ all() -> [check_restart_result, check_no_errors].
- end_per_suite(ConfigData) ->
- close_log(?value(logref, ConfigData)).
+ init_per_suite(InitConfigData) ->
+ [{logref,open_log()} | InitConfigData].
- check_restart_result(ConfigData) ->
- TestData = read_log(restart, ?value(logref, ConfigData)),
- {match,_Line} = search_for("restart successful", TestData).
-
- check_no_errors(ConfigData) ->
- TestData = read_log(all, ?value(logref, ConfigData)),
- case search_for("error", TestData) of
- {match,Line} -> ct:fail({error_found_in_log,Line});
- nomatch -> ok
- end.</pre>
+ end_per_suite(ConfigData) ->
+ close_log(?value(logref, ConfigData)).
+
+ check_restart_result(ConfigData) ->
+ TestData = read_log(restart, ?value(logref, ConfigData)),
+ {match,_Line} = search_for("restart successful", TestData).
+
+ check_no_errors(ConfigData) ->
+ TestData = read_log(all, ?value(logref, ConfigData)),
+ case search_for("error", TestData) of
+ {match,Line} -> ct:fail({error_found_in_log,Line});
+ nomatch -> ok
+ end.</pre>
<p>
- In this example we have test cases that verify, by parsing a
- log file, that our SUT has performed a successful restart and
- that no unexpected errors have been printed.
+ The test cases verify, by parsing a log file, that our SUT has performed
+ a successful restart and that no unexpected errors are printed.
</p>
- <p>To execute the test cases in the test suite above, we could type this on
- the Unix/Linux command line (assuming for this example that the suite module
+ <p>To execute the test cases in the recent test suite, type the
+ following on the UNIX/Linux command line (assuming that the suite module
is in the current working directory):
</p>
<pre>
- $ ct_run -dir .</pre>
- <p>or</p>
+ $ ct_run -dir .</pre>
+ <p>or:</p>
<pre>
- $ ct_run -suite check_log_SUITE</pre>
+ $ ct_run -suite check_log_SUITE</pre>
- <p>If we want to use the Erlang shell to run our test, we could evaluate this call:
+ <p>To use the Erlang shell to run our test, you can evaluate the following call:
</p>
<pre>
- 1> ct:run_test([{dir, "."}]).</pre>
- <p>or</p>
+ 1> ct:run_test([{dir, "."}]).</pre>
+ <p>or:</p>
<pre>
- 1> ct:run_test([{suite, "check_log_SUITE"}]).</pre>
+ 1> ct:run_test([{suite, "check_log_SUITE"}]).</pre>
<p>
- The result from running our test is printed in log files in HTML format
- (stored in unique log directories on different level). This illustration
- shows the log file structure:
+ The result from running the test is printed in log files in HTML format
+ (stored in unique log directories on a different level). The following
+ illustration shows the log file structure:
</p>
<image file="html_logs.gif">
<icaption>
- HTML log file structure.
+ HTML Log File Structure
</icaption>
</image>
</section>
<section>
- <title>What happens next?</title>
+ <title>Questions and Answers</title>
- <p>Well, you might already be asking yourself questions such as:</p>
+ <p>Here follows some questions that you might have after reading this section
+ with corresponding tips and links to the answers:
+ </p>
- <list>
- <item>"How and where can I specify variable data for my tests that mustn't
- be hard-coded in the test suites (such as host names, addresses,
- user login data, etc)?" The
- <seealso marker="config_file_chapter#top">External Configuration Data</seealso>
- chapter will give you that information.
+ <list type="bulleted">
+ <item><p><em>Question:</em>
+ "How and where can I specify variable data for my tests that must not
+ be hard-coded in the test suites (such as hostnames, addresses, and
+ user login data)?"</p>
+ <p><em>Answer:</em>
+ See section <seealso marker="config_file_chapter#top">External Configuration Data</seealso>.</p>
</item>
- <item>"Is there a way to declare a number of different tests and run them
- in one session without having to write my own scripts? And can such
- declarations be used for regression testing?" The
+
+ <item><p><em>Question:</em> "Is there a way to declare different tests and run them
+ in one session without having to write my own scripts? Also, can such
+ declarations be used for regression testing?"</p>
+ <p><em>Answer:</em> See section
<seealso marker="run_test_chapter#test_specifications">Test Specifications</seealso>
- chapter answers these questions.
+ in section Running Tests and Analyzing Results.
+ </p>
</item>
- <item>"Can test cases and/or test runs be automatically repeated?" Learn more about
+
+ <item><p><em>Question:</em> "Can test cases and/or test runs be automatically repeated?"</p>
+ <p><em>Answer:</em> Learn more about
<seealso marker="write_test_chapter#test_case_groups">Test Case Groups</seealso>
- and also read about start flags/options in the
- <seealso marker="run_test_chapter#ct_run">Running Tests</seealso> chapter and
- the Reference Manual.
+ and read about start flags/options in section
+ <seealso marker="run_test_chapter#ct_run">Running Tests</seealso> and in
+ the Reference Manual.</p>
</item>
- <item>"Will Common Test execute my test cases in sequence or in parallel?" The
+
+ <item><p><em>Question:</em> "Does <c>Common Test</c> execute my test cases in sequence or in parallel?"</p>
+ <p><em>Answer:</em> See
<seealso marker="write_test_chapter#test_case_groups">Test Case Groups</seealso>
- section in the Running Tests chapter will give you the answer.
+ in section Writing Test Suites.</p>
</item>
- <item>"What's the syntax for timetraps (mentioned above), and how do I set them?"
- This is explained in the
- <seealso marker="write_test_chapter#timetraps">Timetrap Timeouts</seealso>
- part of the Writing Test Suites chapter.
+
+ <item><p><em>Question:</em> "What is the syntax for timetraps (mentioned earlier), and how do I set them?"</p>
+ <p><em>Answer:</em> This is explained in the
+ <seealso marker="write_test_chapter#timetraps">Timetrap Time-Outs</seealso>
+ part of section Writing Test Suites.</p>
</item>
- <item>"What functions are available for logging and printing?" Check the
+
+ <item><p><em>Question:</em> "What functions are available for logging and printing?"</p>
+ <p><em>Answer:</em> See
<seealso marker="write_test_chapter#logging">Logging</seealso>
- section in the Writing Test Suites chapter.
+ in section Writing Test Suites.</p>
</item>
- <item>"I need data files for my tests. Where do I store them preferrably?"
- You should read about
+
+ <item><p><em>Question:</em> "I need data files for my tests. Where do I store them preferably?"</p>
+ <p><em>Answer:</em> See
<seealso marker="write_test_chapter#data_priv_dir">Data and Private
- Directories</seealso> for information about this.
+ Directories</seealso>.</p>
</item>
- <item>"May I start with a test suite example, please?"
- <seealso marker="example_chapter#top">Sure!</seealso>
+
+ <item><p><em>Question:</em> "Can I start with a test suite example, please?"</p>
+ <p><em>Answer:</em> <seealso marker="example_chapter#top">Welcome!</seealso></p>
</item>
</list>
- <p>You will probably want to get started on your own first test suites now, while
- at the same time digging deeper into the Common Test User's Guide and Reference Manual.
- You will find that there's lots more to learn about the things that have been introduced
- in this chapter. You will of course also be presented many more useful features, such as the
- ones listed above. Have fun!
+ <p>You probably want to get started on your own first test suites now, while
+ at the same time digging deeper into the <c>Common Test</c> User's Guide and Reference Manual.
+ There are much more to learn about the things that have been introduced
+ in this section. There are also many other useful features to learn,
+ so please continue to the other sections and have fun.
</p>
</section>
</chapter>
diff --git a/lib/common_test/doc/src/install_chapter.xml b/lib/common_test/doc/src/install_chapter.xml
index 107b0e2eac..9dce1e31a4 100644
--- a/lib/common_test/doc/src/install_chapter.xml
+++ b/lib/common_test/doc/src/install_chapter.xml
@@ -32,22 +32,23 @@
<section>
<marker id="general"></marker>
- <title>General information</title>
-
- <p>The two main interfaces for running tests with Common Test
- are an executable program named <c>ct_run</c> and an
- erlang module named <c>ct</c>. The ct_run program
- is compiled for the underlying operating system (e.g. Unix/Linux
- or Windows) during the build of the Erlang/OTP system, and is
- installed automatically with other executable programs in
+ <title>General Information</title>
+
+ <p>The two main interfaces for running tests with <c>Common Test</c>
+ are an executable program named
+ <seealso marker="ct_run"><c>ct_run</c></seealso> and the
+ Erlang module <seealso marker="ct"><c>ct</c></seealso>.
+ <c>ct_run</c> is compiled for the underlying operating system (for example,
+ Unix/Linux or Windows) during the build of the Erlang/OTP system,
+ and is installed automatically with other executable programs in
the top level <c>bin</c> directory of Erlang/OTP.
The <c>ct</c> interface functions can be called from the Erlang shell,
or from any Erlang function, on any supported platform.</p>
- <p>The Common Test application is installed with the Erlang/OTP
- system and no additional installation step is required to start using
- Common Test by means of the <c>ct_run</c> executable program, and/or
- the interface functions in the <c>ct</c> module.</p>
+ <p>The <c>Common Test</c> application is installed with the Erlang/OTP
+ system. No extra installation step is required to start using
+ <c>Common Test</c> through the <c>ct_run</c> executable program,
+ and/or the interface functions in the <c>ct</c> module.</p>
</section>
</chapter>
diff --git a/lib/common_test/doc/src/introduction.xml b/lib/common_test/doc/src/introduction.xml
new file mode 100644
index 0000000000..e2a42bfd33
--- /dev/null
+++ b/lib/common_test/doc/src/introduction.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE chapter SYSTEM "chapter.dtd">
+
+<chapter>
+ <header>
+ <copyright>
+ <year>2003</year><year>2013</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>Introduction</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date>2015-10-05</date>
+ <rev></rev>
+ <file>introduction.xml</file>
+ </header>
+ <section>
+ <title>Scope</title>
+ <p><c>Common Test</c> is a portable application for automated
+ testing. It is suitable for:</p>
+ <list type="bulleted">
+ <item><p>Black-box testing of target systems of any type (that
+ is, not necessarily implemented in Erlang). This is performed
+ through standard O&amp;M interfaces (such as SNMP, HTTP, CORBA,
+ and Telnet) and, if necessary, through user-specific interfaces
+ (often called test ports).</p></item>
+ <item><p>White-box testing of Erlang/OTP programs. This is easily
+ done by calling the target API functions directly from the test
+ case functions.</p></item>
+ </list>
+ <p><c>Common Test</c> also integrates use of the OTP
+ <seealso marker="tools:cover">cover</seealso> tool in application
+ <c>Tools</c> for code coverage analysis of Erlang/OTP programs.</p>
+
+ <p><c>Common Test</c> executes test suite programs automatically,
+ without operator interaction. Test progress and results are
+ printed to logs in HTML format, easily browsed with a standard
+ web browser. <c>Common Test</c> also sends notifications about progress
+ and results through an OTP event manager to event handlers plugged
+ in to the system. This way, users can integrate their own
+ programs for, for example, logging, database storing, or supervision with
+ <c>Common Test</c>.</p>
+
+ <p><c>Common Test</c> provides libraries with useful support
+ functions to fill various testing needs and requirements.
+ There is, for example, support for flexible test declarations
+ through test specifications. There is also support
+ for central configuration and control of multiple
+ independent test sessions (to different target systems)
+ running in parallel.</p>
+
+ </section>
+
+ <section>
+ <title>Prerequisites</title>
+ <p>It is assumed that the reader is familiar with the Erlang
+ programming language.</p >
+ </section>
+
+</chapter>
diff --git a/lib/common_test/doc/src/part.xml b/lib/common_test/doc/src/part.xml
index 0f4c448787..41e74e57c6 100644
--- a/lib/common_test/doc/src/part.xml
+++ b/lib/common_test/doc/src/part.xml
@@ -31,40 +31,9 @@
</header>
<description>
- <p><em>Common Test</em> is a portable application for automated
- testing. It is suitable for black-box testing of target
- systems of any type (i.e. not necessarily implemented in Erlang),
- as well as for white-box testing of Erlang/OTP programs.
- Black-box testing is performed via standard O&amp;M
- interfaces (such as SNMP, HTTP, Corba, Telnet, etc) and,
- if required, via user specific interfaces (often called test
- ports). White-box testing of Erlang/OTP programs is easily
- accomplished by calling the target API functions directly
- from the test case functions. Common Test also integrates
- usage of the OTP cover tool for code coverage analysis of
- Erlang/OTP programs.</p>
-
- <p>Common Test executes test suite programs automatically,
- without operator interaction. Test progress and results is
- printed to logs on HTML format, easily browsed with a standard
- web browser. Common Test also sends notifications about progress
- and results via an OTP event manager to event handlers plugged
- in to the system. This way users can integrate their own
- programs for e.g. logging, database storing or supervision with
- Common Test.</p>
-
- <p>Common Test provides libraries that contain useful support
- functions to fill various testing needs and requirements.
- There is for example support for flexible test declarations
- by means of so called test specifications. There is also support
- for central configuration and control of multiple
- independent test sessions (towards different target systems)
- running in parallel.</p>
-
- <p>Common Test is implemented as a framework based on the OTP Test
- Server application.</p>
</description>
+ <xi:include href="introduction.xml"/>
<xi:include href="basics_chapter.xml"/>
<xi:include href="getting_started_chapter.xml"/>
<xi:include href="install_chapter.xml"/>
diff --git a/lib/common_test/doc/src/ref_man.xml b/lib/common_test/doc/src/ref_man.xml
index f98e2475a9..19960bfea7 100644
--- a/lib/common_test/doc/src/ref_man.xml
+++ b/lib/common_test/doc/src/ref_man.xml
@@ -30,43 +30,10 @@
<file>ref_man.xml</file>
</header>
<description>
- <p><em>Common Test</em> is a portable application for automated
- testing. It is suitable for black-box testing of target
- systems of any type (i.e. not necessarily implemented in Erlang),
- as well as for white-box testing of Erlang/OTP programs.
- Black-box testing is performed via standard O&amp;M
- interfaces (such as SNMP, HTTP, Corba, Telnet, etc) and,
- if required, via user specific interfaces (often called test
- ports). White-box testing of Erlang/OTP programs is easily
- accomplished by calling the target API functions directly
- from the test case functions. Common Test also integrates
- usage of the OTP cover tool for code coverage analysis of
- Erlang/OTP programs.</p>
-
- <p>Common Test executes test suite programs automatically,
- without operator interaction. Test progress and results is
- printed to logs on HTML format, easily browsed with a standard
- web browser. Common Test also sends notifications about progress
- and results via an OTP event manager to event handlers plugged
- in to the system. This way users can integrate their own
- programs for e.g. logging, database storing or supervision with
- Common Test.</p>
-
- <p>Common Test provides libraries that contain useful support
- functions to fill various testing needs and requirements.
- There is for example support for flexible test declarations
- by means of so called test specifications. There is also support
- for central configuration and control of multiple
- independent test sessions (towards different target systems)
- running in parallel.</p>
-
- <p>Common Test is implemented as a framework based on the OTP Test
- Server application.</p>
</description>
+
<xi:include href="common_test_app.xml"/>
<xi:include href="ct_run.xml"/>
- <!-- If you make modifications in the module list below,
- you also need to update CT_MODULES in Makefile. -->
<xi:include href="ct.xml"/>
<xi:include href="ct_master.xml"/>
<xi:include href="ct_cover.xml"/>
@@ -83,6 +50,3 @@
</application>
-
-
-
diff --git a/lib/common_test/doc/src/run_test_chapter.xml b/lib/common_test/doc/src/run_test_chapter.xml
index 082a587c8d..e04bb3e208 100644
--- a/lib/common_test/doc/src/run_test_chapter.xml
+++ b/lib/common_test/doc/src/run_test_chapter.xml
@@ -33,95 +33,96 @@
<section>
<title>Using the Common Test Framework</title>
- <p>The Common Test Framework provides a high level
- operator interface for testing. It adds the following features to
- the Erlang/OTP Test Server:</p>
-
- <list>
- <item>Automatic compilation of test suites (and help modules).</item>
- <item>Creation of additional HTML pages for better overview.</item>
- <item>Single command interface for running all available tests.</item>
+ <p>The <c>Common Test</c> framework provides a high-level
+ operator interface for testing, providing the following features:</p>
+
+ <list type="bulleted">
+ <item>Automatic compilation of test suites (and help modules)</item>
+ <item>Creation of extra HTML pages for improved overview.</item>
+ <item>Single-command interface for running all available tests</item>
<item>Handling of configuration files specifying data related to
- the System Under Test (and any other variable data).</item>
+ the System Under Test (SUT) (and any other variable data)</item>
<item>Mode for running multiple independent test sessions in parallel with
- central control and configuration.</item>
+ central control and configuration</item>
</list>
</section>
<section>
- <title>Automatic compilation of test suites and help modules</title>
- <p>When Common Test starts, it will automatically attempt to compile any
+ <title>Automatic Compilation of Test Suites and Help Modules</title>
+ <p>When <c>Common Test</c> starts, it automatically attempts to compile any
suites included in the specified tests. If particular
- suites have been specified, only those suites will be compiled. If a
- particular test object directory has been specified (meaning all suites
- in this directory should be part of the test), Common Test runs
- make:all/1 in the directory to compile the suites.</p>
+ suites are specified, only those suites are compiled. If a
+ particular test object directory is specified (meaning all suites
+ in this directory are to be part of the test), <c>Common Test</c> runs
+ function <c>make:all/1</c> in the directory to compile the suites.</p>
- <p>If compilation should fail for one or more suites, the compilation errors
- are printed to tty and the operator is asked if the test run should proceed
+ <p>If compilation fails for one or more suites, the compilation errors
+ are printed to tty and the operator is asked if the test run is to proceed
without the missing suites, or be aborted. If the operator chooses to proceed,
- it is noted in the HTML log which tests have missing suites. Also, for each failed
- compilation, the failed tests counter in the return value of
- <c><![CDATA[ct:run_test/1]]></c> is incremented. If Common Test is unable to prompt
- the user after compilation failure (if Common Test doesn't control stdin), the test
- run will proceed automatically without the missing suites. In order to always
- abort the test run (without operator interaction) if one or more suites fail
- to compile, the <c><![CDATA[ct_run]]></c> flag <c><![CDATA[-abort_if_missing_suites]]></c>,
- or the <c><![CDATA[ct:run_test/1]]></c> option
- <c><![CDATA[{abort_if_missing_suites,true}]]></c> should be set.</p>
-
- <p>Any help module (i.e. regular Erlang module with name not ending with
- "_SUITE") that resides in the same test object directory as a suite
- which is part of the test, will also be automatically compiled. A help
- module will not be mistaken for a test suite (unless it has a "_SUITE"
- name of course). All help modules in a particular test object directory
- are compiled no matter if all or only particular suites in the directory
+ the tests having missing suites are noted in the HTML log. If <c>Common Test</c> is
+ unable to prompt the user after compilation failure (if <c>Common Test</c> does not
+ control <c>stdin</c>), the test run proceeds automatically without the missing
+ suites. This behavior can however be modified with the
+ <c><![CDATA[ct_run]]></c> flag <c><![CDATA[-abort_if_missing_suites]]></c>,
+ or the <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso> option
+ <c><![CDATA[{abort_if_missing_suites,TrueOrFalse}]]></c>. If
+ <c><![CDATA[abort_if_missing_suites]]></c> is set to <c>true</c>, the test run
+ stops immediately if some suites fail to compile.</p>
+
+ <p>Any help module (that is, regular Erlang module with name not ending with
+ "_SUITE") that resides in the same test object directory as a suite,
+ which is part of the test, is also automatically compiled. A help
+ module is not mistaken for a test suite (unless it has a "_SUITE" name).
+ All help modules in a particular test object directory
+ are compiled, no matter if all or only particular suites in the directory
are part of the test.</p>
<p>If test suites or help modules include header files stored in other
- locations than the test directory, you may specify these include directories
- by means of the <c><![CDATA[-include]]></c> flag with <c><![CDATA[ct_run]]></c>,
- or the <c><![CDATA[include]]></c> option with <c><![CDATA[ct:run_test/1]]></c>.
- In addition to this, an include path may be specified with an OS
- environment variable; <c><![CDATA[CT_INCLUDE_PATH]]></c>. Example (bash):</p>
+ locations than the test directory, these include directories can be specified
+ by using flag <c><![CDATA[-include]]></c> with
+ <seealso marker="ct_run"><c>ct_run</c></seealso>,
+ or option <c><![CDATA[include]]></c> with <c><![CDATA[ct:run_test/1]]></c>.
+ Also, an include path can be specified with an OS
+ environment variable, <c><![CDATA[CT_INCLUDE_PATH]]></c>.</p>
+ <p><em>Example (bash):</em></p>
<p><c>$ export CT_INCLUDE_PATH=~testuser/common_suite_files/include:~testuser/common_lib_files/include</c></p>
- <p>Common Test will pass all include directories (specified either with the
- <c><![CDATA[include]]></c> flag/option, or the <c><![CDATA[CT_INCLUDE_PATH]]></c>
- variable, or both) to the compiler.</p>
+ <p><c>Common Test</c> passes all include directories (specified either with flag/option
+ <c><![CDATA[include]]></c>, or variable <c><![CDATA[CT_INCLUDE_PATH]]></c>
+ , or both, to the compiler.</p>
- <p>It is also possible to specify include directories in test specifications
- (see below).</p>
+ <p>Include directories can also be specified in test specifications,
+ see <seealso marker="#test_specifications">Test Specifications</seealso>.</p>
- <p>If the user wants to run all test suites for a test object (or OTP application)
- by specifying only the top directory (e.g. with the <c>dir</c> start flag/option),
- Common Test will primarily look for test suite modules in a subdirectory named
- <c>test</c>. If this subdirectory doesn't exist, the specified top directory
- is assumed to be the actual test directory, and test suites will be read from
+ <p>If the user wants to run all test suites for a test object (or an OTP application)
+ by specifying only the top directory (for example, with start flag/option <c>dir</c>),
+ <c>Common Test</c> primarily looks for test suite modules in a subdirectory named
+ <c>test</c>. If this subdirectory does not exist, the specified top directory
+ is assumed to be the test directory, and test suites are read from
there instead.</p>
- <p>It is possible to disable the automatic compilation feature by using the
- <c><![CDATA[-no_auto_compile]]></c> flag with <c><![CDATA[ct_run]]></c>, or
- the <c><![CDATA[{auto_compile,false}]]></c> option with
+ <p>To disable the automatic compilation feature, use flag
+ <c><![CDATA[-no_auto_compile]]></c> with <c><![CDATA[ct_run]]></c>, or
+ option <c><![CDATA[{auto_compile,false}]]></c> with
<c><![CDATA[ct:run_test/1]]></c>. With automatic compilation
disabled, the user is responsible for compiling the test suite modules
- (and any help modules) before the test run. If the modules can not be loaded
- from the local file system during startup of Common Test, the user needs to
- pre-load the modules before starting the test. Common Test will only verify
- that the specified test suites exist (i.e. that they are, or can be, loaded).
- This is useful e.g. if the test suites are transferred and loaded as binaries via
- RPC from a remote node.</p>
+ (and any help modules) before the test run. If the modules cannot be loaded
+ from the local file system during startup of <c>Common Test</c>, the user must
+ preload the modules before starting the test. <c>Common Test</c> only verifies
+ that the specified test suites exist (that is, that they are, or can be, loaded).
+ This is useful, for example, if the test suites are transferred and loaded as
+ binaries through RPC from a remote node.</p>
</section>
<section>
<marker id="ct_run"></marker>
- <title>Running tests from the OS command line</title>
+ <title>Running Tests from the OS Command Line</title>
- <p>The <c>ct_run</c> program can be used for running tests from
- the OS command line, e.g.
+ <p>The <seealso marker="ct_run"><c>ct_run</c></seealso> program can be used
+ for running tests from the OS command line, for example, as follows:
</p>
- <list>
+ <list type="bulleted">
<item><c><![CDATA[ct_run -config <configfilenames> -dir <dirs>]]></c></item>
<item><c><![CDATA[ct_run -config <configfilenames> -suite <suiteswithfullpath>]]></c>
</item>
@@ -130,824 +131,917 @@
<item><c><![CDATA[ct_run -config <configfilenames> -suite <suitewithfullpath>
-group <groups> -case <casenames>]]></c></item>
</list>
- <p>Examples:</p>
- <p><c>$ ct_run -config $CFGS/sys1.cfg $CFGS/sys2.cfg -dir $SYS1_TEST $SYS2_TEST</c></p>
- <p><c>$ ct_run -userconfig ct_config_xml $CFGS/sys1.xml $CFGS/sys2.xml -dir $SYS1_TEST $SYS2_TEST</c></p>
- <p><c>$ ct_run -suite $SYS1_TEST/setup_SUITE $SYS2_TEST/config_SUITE</c></p>
- <p><c>$ ct_run -suite $SYS1_TEST/setup_SUITE -case start stop</c></p>
- <p><c>$ ct_run -suite $SYS1_TEST/setup_SUITE -group installation -case start stop</c></p>
+ <p><em>Examples:</em></p>
+ <pre>
+ $ ct_run -config $CFGS/sys1.cfg $CFGS/sys2.cfg -dir $SYS1_TEST $SYS2_TEST
+ $ ct_run -userconfig ct_config_xml $CFGS/sys1.xml $CFGS/sys2.xml -dir $SYS1_TEST $SYS2_TEST
+ $ ct_run -suite $SYS1_TEST/setup_SUITE $SYS2_TEST/config_SUITE
+ $ ct_run -suite $SYS1_TEST/setup_SUITE -case start stop
+ $ ct_run -suite $SYS1_TEST/setup_SUITE -group installation -case start stop</pre>
- <p>It is also possible to combine the <c>dir</c>, <c>suite</c> and <c>group/case</c> flags. E.g, to run
- <c>x_SUITE</c> and <c>y_SUITE</c> in directory <c>testdir</c>:</p>
-
- <p><c>$ ct_run -dir ./testdir -suite x_SUITE y_SUITE</c></p>
-
- <p>This has the same effect as calling:</p>
-
- <p><c>$ ct_run -suite ./testdir/x_SUITE ./testdir/y_SUITE</c></p>
-
- <p>For more details on <seealso marker="run_test_chapter#group_execution">test case group execution</seealso>, please see below.</p>
-
- <p>Other flags that may be used with <c>ct_run</c>:</p>
- <list>
- <item><c><![CDATA[-help]]></c>, lists all available start flags.</item>
- <item><c><![CDATA[-logdir <dir>]]></c>, specifies where the HTML log files are to be written.</item>
- <item><c><![CDATA[-label <name_of_test_run>]]></c>, associates the test run with a name that gets printed
- in the overview HTML log files.</item>
- <item><c>-refresh_logs</c>, refreshes the top level HTML index files.</item>
- <item><c>-vts</c>, start web based GUI (see below).</item>
- <item><c>-shell</c>, start interactive shell mode (see below).</item>
- <item><c>-step [step_opts]</c>, step through test cases using the Erlang Debugger (see below).</item>
- <item><c><![CDATA[-spec <testspecs>]]></c>, use test specification as input (see below).</item>
- <item><c>-allow_user_terms</c>, allows user specific terms in a test specification (see below).</item>
- <item><c>-silent_connections [conn_types]</c>, tells Common Test to suppress printouts for
- specified connections (see below).</item>
- <item><c><![CDATA[-stylesheet <css_file>]]></c>, points out a user HTML style sheet (see below).</item>
- <item><c><![CDATA[-cover <cover_cfg_file>]]></c>, to perform code coverage test (see
- <seealso marker="cover_chapter#cover">Code Coverage Analysis</seealso>).</item>
- <item><c><![CDATA[-cover_stop <bool>]]></c>, to specify if the cover tool shall be stopped after the test is completed (see
- <seealso marker="cover_chapter#cover_stop">Code Coverage Analysis</seealso>).</item>
- <item><c><![CDATA[-event_handler <event_handlers>]]></c>, to install
- <seealso marker="event_handler_chapter#event_handling">event handlers</seealso>.</item>
- <item><c><![CDATA[-event_handler_init <event_handlers>]]></c>, to install
- <seealso marker="event_handler_chapter#event_handling">event handlers</seealso> including start arguments.</item>
- <item><c><![CDATA[-ct_hooks <ct_hooks>]]></c>, to install
- <seealso marker="ct_hooks_chapter#installing">Common Test Hooks</seealso> including start arguments.</item>
- <item><c><![CDATA[-enable_builtin_hooks <bool>]]></c>, to enable/disable
- <seealso marker="ct_hooks_chapter#builtin_cths">Built-in Common Test Hooks</seealso>. Default is <c>true</c>.</item>
- <item><c><![CDATA[-include]]></c>, specifies include directories (see above).</item>
- <item><c><![CDATA[-no_auto_compile]]></c>, disables the automatic test suite compilation feature (see above).</item>
- <item><c><![CDATA[-abort_if_missing_suites]]></c>, aborts the test run if one or more suites fail to compile (see above).</item>
- <item><c><![CDATA[-multiply_timetraps <n>]]></c>, extends <seealso marker="write_test_chapter#timetraps">timetrap
- timeout</seealso> values.</item>
- <item><c><![CDATA[-scale_timetraps <bool>]]></c>, enables automatic <seealso marker="write_test_chapter#timetraps">timetrap
- timeout</seealso> scaling.</item>
- <item><c><![CDATA[-repeat <n>]]></c>, tells Common Test to repeat the tests n times (see below).</item>
- <item><c><![CDATA[-duration <time>]]></c>, tells Common Test to repeat the tests for duration of time (see below).</item>
- <item><c><![CDATA[-until <stop_time>]]></c>, tells Common Test to repeat the tests until stop_time (see below).</item>
- <item><c>-force_stop [skip_rest]</c>, on timeout, the test run will be aborted when current test job is finished. If <c>skip_rest</c> is provided the rest of the test cases in the current test job will be skipped (see below).</item>
- <item><c><![CDATA[-decrypt_key <key>]]></c>, provides a decryption key for
- <seealso marker="config_file_chapter#encrypted_config_files">encrypted configuration files</seealso>.</item>
- <item><c><![CDATA[-decrypt_file <key_file>]]></c>, points out a file containing a decryption key for
- <seealso marker="config_file_chapter#encrypted_config_files">encrypted configuration files</seealso>.</item>
- <item><c><![CDATA[-basic_html]]></c>, switches off html enhancements that might not be compatible with older browsers.</item>
- <item><c><![CDATA[-logopts <opts>]]></c>, makes it possible to modify aspects of the logging behaviour, see
- <seealso marker="run_test_chapter#logopts">Log options</seealso> below.</item>
- <item><c><![CDATA[-verbosity <levels>]]></c>, sets <seealso marker="write_test_chapter#logging">verbosity levels
- for printouts</seealso>.</item>
- </list>
+ <p>The flags <c>dir</c>, <c>suite</c>, and <c>group/case</c> can be combined.
+ For example, to run <c>x_SUITE</c> and <c>y_SUITE</c>
+ in directory <c>testdir</c>, as follows:</p>
+ <pre>
+ $ ct_run -dir ./testdir -suite x_SUITE y_SUITE</pre>
+
+ <p>This has the same effect as the following:</p>
+ <pre>
+ $ ct_run -suite ./testdir/x_SUITE ./testdir/y_SUITE</pre>
+
+ <p>For details, see
+ <seealso marker="run_test_chapter#group_execution">Test Case Group Execution</seealso>.</p>
+
+ <p>The following flags can also be used with
+ <seealso marker="ct_run"><c>ct_run</c></seealso>:</p>
+ <taglist>
+ <tag><c><![CDATA[-help]]></c></tag>
+ <item><p>Lists all available start flags.</p></item>
+
+ <tag><c><![CDATA[-logdir <dir>]]></c></tag>
+ <item><p>Specifies where the HTML log files are to be written.</p></item>
+
+ <tag><c><![CDATA[-label <name_of_test_run>]]></c></tag>
+ <item><p>Associates the test run with a name that gets printed
+ in the overview HTML log files.</p></item>
+
+ <tag><c>-refresh_logs</c></tag>
+ <item><p>Refreshes the top-level HTML index files.</p></item>
+
+ <tag><c>-vts</c></tag>
+ <item><p>Starts web-based GUI (described later).</p></item>
+
+ <tag><c>-shell</c></tag>
+ <item><p>Starts interactive shell mode (described later).</p></item>
+
+ <tag><c>-step [step_opts]</c></tag>
+ <item><p>Steps through test cases using the Erlang Debugger (described later).</p></item>
+
+ <tag><c><![CDATA[-spec <testspecs>]]></c></tag>
+ <item><p>Uses test specification as input (described later).</p></item>
+
+ <tag><c>-allow_user_terms</c></tag>
+ <item><p>Allows user-specific terms in a test specification (described later).</p></item>
+
+ <tag><c>-silent_connections [conn_types]</c></tag>
+ <item><p>, tells <c>Common Test</c> to suppress printouts for
+ specified connections (described later).</p></item>
+
+ <tag><c><![CDATA[-stylesheet <css_file>]]></c></tag>
+ <item><p>Points out a user HTML style sheet (described later).</p></item>
+
+ <tag><c><![CDATA[-cover <cover_cfg_file>]]></c></tag>
+ <item><p>To perform code coverage test (see
+ <seealso marker="cover_chapter#cover">Code Coverage Analysis</seealso>).</p></item>
+
+ <tag><c><![CDATA[-cover_stop <bool>]]></c></tag>
+ <item><p>To specify if the <c>cover</c> tool is to be stopped
+ after the test is completed (see
+ <seealso marker="cover_chapter#cover_stop">Code Coverage Analysis</seealso>).</p></item>
+
+ <tag><c><![CDATA[-event_handler <event_handlers>]]></c></tag>
+ <item><p>To install
+ <seealso marker="event_handler_chapter#event_handling">event handlers</seealso>.</p></item>
+
+ <tag><c><![CDATA[-event_handler_init <event_handlers>]]></c></tag>
+ <item><p>To install
+ <seealso marker="event_handler_chapter#event_handling">event handlers</seealso>
+ including start arguments.</p></item>
+
+ <tag><c><![CDATA[-ct_hooks <ct_hooks>]]></c></tag>
+ <item><p>To install
+ <seealso marker="ct_hooks_chapter#installing">Common Test Hooks</seealso>
+ including start arguments.</p></item>
- <note><p>Directories passed to Common Test may have either relative or absolute paths.</p></note>
+ <tag><c><![CDATA[-enable_builtin_hooks <bool>]]></c></tag>
+ <item><p>To enable or disable
+ <seealso marker="ct_hooks_chapter#builtin_cths">Built-in Common Test Hooks</seealso>.
+ Default is <c>true</c>.</p></item>
- <note><p>Arbitrary start flags to the Erlang Runtime System may also be passed as
+ <tag><c><![CDATA[-include]]></c></tag>
+ <item><p>Specifies include directories (described earlier).</p></item>
+
+ <tag><c><![CDATA[-no_auto_compile]]></c></tag>
+ <item><p>Disables the automatic test suite compilation feature (described earlier).</p></item>
+
+ <tag><c><![CDATA[-abort_if_missing_suites]]></c></tag>
+ <item><p>Aborts the test run if one or more suites fail to compile (described earlier).</p></item>
+
+ <tag><c><![CDATA[-multiply_timetraps <n>]]></c></tag>
+ <item><p>Extends <seealso marker="write_test_chapter#timetraps">timetrap
+ time-out</seealso> values.</p></item>
+
+ <tag><c><![CDATA[-scale_timetraps <bool>]]></c></tag>
+ <item><p>Enables automatic <seealso marker="write_test_chapter#timetraps">timetrap
+ time-out</seealso> scaling.</p></item>
+
+ <tag><c><![CDATA[-repeat <n>]]></c></tag>
+ <item><p>Tells <c>Common Test</c> to repeat the tests <c>n</c> times (described later).</p></item>
+
+ <tag><c><![CDATA[-duration <time>]]></c></tag>
+ <item><p>Tells <c>Common Test</c> to repeat the tests for duration of time (described later).</p></item>
+
+ <tag><c><![CDATA[-until <stop_time>]]></c></tag>
+ <item><p>Tells <c>Common Test</c> to repeat the tests until <c>stop_time</c> (described later).</p></item>
+
+ <tag><c>-force_stop [skip_rest]</c></tag>
+ <item><p>On time-out, the test run is aborted when the current test job is finished. If <c>skip_rest</c>
+ is provided, the remaining test cases in the current test job are skipped (described later).</p></item>
+
+ <tag><c><![CDATA[-decrypt_key <key>]]></c></tag>
+ <item><p>Provides a decryption key for
+ <seealso marker="config_file_chapter#encrypted_config_files">encrypted configuration files</seealso>.</p></item>
+
+ <tag><c><![CDATA[-decrypt_file <key_file>]]></c></tag>
+ <item><p>Points out a file containing a decryption key for
+ <seealso marker="config_file_chapter#encrypted_config_files">encrypted configuration files</seealso>.</p></item>
+
+ <tag><c><![CDATA[-basic_html]]></c></tag>
+ <item><p>Switches off HTML enhancements that can be incompatible with older browsers.</p></item>
+
+ <tag><c><![CDATA[-logopts <opts>]]></c></tag>
+ <item><p>Enables modification of the logging behavior, see
+ <seealso marker="run_test_chapter#logopts">Log options</seealso>.</p></item>
+
+ <tag><c><![CDATA[-verbosity <levels>]]></c></tag>
+ <item><p>Sets <seealso marker="write_test_chapter#logging">verbosity levels
+ for printouts</seealso>.</p></item>
+ </taglist>
+
+ <note><p>Directories passed to <c>Common Test</c> can have either relative or absolute paths.</p></note>
+
+ <note><p>Any start flags to the Erlang runtime system (application <c>ERTS</c>) can also be passed as
parameters to <c>ct_run</c>. It is, for example, useful to be able to
- pass directories that should be added to the Erlang code server search path
- with the <c>-pa</c> or <c>-pz</c> flag. If you have common help- or library
+ pass directories to be added to the Erlang code server search path
+ with flag <c>-pa</c> or <c>-pz</c>. If you have common help- or library
modules for test suites (separately compiled), stored in other directories
- than the test suite directories, these help/lib directories are preferrably
- added to the code path this way. Example:</p>
+ than the test suite directories, these <c>help/lib</c> directories are preferably
+ added to the code path this way.</p>
+ <p><em>Example:</em></p>
<p><c>$ ct_run -dir ./chat_server -logdir ./chat_server/testlogs -pa $PWD/chat_server/ebin</c></p>
- <p>Note how in this example, the absolute path of the <c>chat_server/ebin</c>
- directory is passed to the code server. This is essential since relative
- paths are stored by the code server as relative, and Common Test changes
- the current working directory of the Erlang Runtime System during the test run!</p>
+ <p>The absolute path of directory <c>chat_server/ebin</c>
+ is here passed to the code server. This is essential because relative
+ paths are stored by the code server as relative, and <c>Common Test</c> changes
+ the current working directory of <c>ERTS</c> during the test run.</p>
</note>
<p>The <c>ct_run</c> program sets the exit status before shutting down. The following values
are defined:</p>
- <list>
- <item><c>0</c> indicates a successful testrun, i.e. one without failed or auto skipped test cases.</item>
- <item><c>1</c> indicates that one or more test cases have failed, or have been auto skipped.</item>
- <item><c>2</c> indicates that the test execution has failed because of e.g. compilation errors, an
- illegal return value from an info function, etc.</item>
+ <list type="bulleted">
+ <item><c>0</c> indicates a successful testrun, that is, without failed or auto-skipped test cases.</item>
+ <item><c>1</c> indicates that one or more test cases have failed, or have been auto-skipped.</item>
+ <item><c>2</c> indicates that the test execution has failed because of, for example, compilation errors, or an
+ illegal return value from an information function.</item>
</list>
- <p>If auto skipped test cases should not affect the exit status, you may change the default
- behaviour using start flag:</p>
- <pre>-exit_status ignore_config</pre>
+ <p>If auto-skipped test cases do not affect the exit status. The default
+ behavior can be changed using start flag:</p>
+ <pre>
+ -exit_status ignore_config</pre>
- <note><p>Executing <c>ct_run</c> without start flags, is equal to the command:
+ <note><p>Executing <c>ct_run</c> without start flags is equal to the command:
<c>ct_run -dir ./</c></p></note>
- <p>For more information about the <c>ct_run</c> program, see the
- <seealso marker="ct_run">Reference Manual</seealso> and the
- <seealso marker="install_chapter#general">Installation</seealso> chapter.
+ <p>For more information about the <c>ct_run</c> program, see module
+ <seealso marker="ct_run"><c>ct_run</c></seealso> and section
+ <seealso marker="install_chapter#general">Installation</seealso>.
</p>
</section>
<section>
- <title>Running tests from the Erlang shell or from an Erlang program</title>
+ <marker id="erlang_shell_or_program"></marker>
+ <title>Running Tests from the Erlang Shell or from an Erlang Program</title>
- <p>Common Test provides an Erlang API for running tests. The main (and most
- flexible) function for specifying and executing tests is called
+ <p><c>Common Test</c> provides an Erlang API for running tests. The main
+ (and most flexible) function for specifying and executing tests is
<seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>.
- This function takes the same start parameters as
- the <seealso marker="run_test_chapter#ct_run"><c>ct_run</c></seealso>
- program described above, only the flags are instead
- given as options in a list of key-value tuples. E.g. a test specified
- with <c>ct_run</c> like:</p>
+ It takes the same start parameters as
+ <seealso marker="run_test_chapter#ct_run"><c>ct_run</c></seealso>,
+ but the flags are instead specified as options in a list of key-value tuples.
+ For example, a test specified with <c>ct_run</c> as follows:</p>
<p><c>$ ct_run -suite ./my_SUITE -logdir ./results</c></p>
<p>is with <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso> specified as:</p>
<p><c>1> ct:run_test([{suite,"./my_SUITE"},{logdir,"./results"}]).</c></p>
- <p>The function returns the test result, represented by the tuple:
+ <p>The function returns the test result, represented by the tuple
<c>{Ok,Failed,{UserSkipped,AutoSkipped}}</c>, where each element is an
- integer. If test execution fails, the function returns the tuple:
+ integer. If test execution fails, the function returns the tuple
<c>{error,Reason}</c>, where the term <c>Reason</c> explains the
failure.</p>
- <p>The default start option <c>{dir,Cwd}</c> (run all suites in the current
+ <p>The default start option <c>{dir,Cwd}</c> (to run all suites in the current
working directory) is used if the function is called with an empty
list of options.</p>
<section>
- <title>Releasing the Erlang shell</title>
- <p>During execution of tests, started with
+ <title>Releasing the Erlang Shell</title>
+ <p>During execution of tests started with
<seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>,
- the Erlang shell process, controlling stdin, will remain the top
- level process of the Common Test system of processes. The result
- is that the Erlang shell is not available for interaction during
- the test run. If this is not desirable, maybe because the shell is needed
- for debugging purposes or for interaction with the SUT during test
- execution, you may set the <c>release_shell</c> start option to
+ the Erlang shell process, controlling <c>stdin</c>, remains the top-level
+ process of the <c>Common Test</c> system of processes. Consequently,
+ the Erlang shell is not available for interaction during
+ the test run. If this is not desirable, for example, because the shell
+ is needed for debugging purposes or for interaction with the SUT during test
+ execution, set start option <c>release_shell</c> to
<c>true</c> (in the call to <c>ct:run_test/1</c> or by
- using the corresponding test specification term, see below). This will
- make Common Test release the shell immediately after the test suite
+ using the corresponding test specification term, described later). This
+ makes <c>Common Test</c> release the shell immediately after the test suite
compilation stage. To accomplish this, a test runner process
- is spawned to take control of the test execution, and the effect is that
+ is spawned to take control of the test execution. The effect is that
<c>ct:run_test/1</c> returns the pid of this process rather than the
- test result - which instead is printed to tty at the end of the test run.</p>
- <note><p>Note that in order to use the
- <seealso marker="ct#break-1"><c>ct:break/1/2</c></seealso> and
- <seealso marker="ct#continue-0"><c>ct:continue/0/1</c></seealso> functions,
+ test result, which instead is printed to tty at the end of the test run.</p>
+ <note><p>To use the functions
+ <seealso marker="ct#break-1"><c>ct:break/1,2</c></seealso> and
+ <seealso marker="ct#continue-0"><c>ct:continue/0,1</c></seealso>,
<c>release_shell</c> <em>must</em> be set to <c>true</c>.</p></note>
</section>
- <p>For detailed documentation about
- <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>,
- please see the
- <seealso marker="ct#run_test-1"><c>ct</c></seealso> manual page.</p>
+ <p>For details, see
+ <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso> manual page.</p>
</section>
<section>
<marker id="group_execution"></marker>
- <title>Test case group execution</title>
+ <title>Test Case Group Execution</title>
<p>With the <c>ct_run</c> flag, or <c>ct:run_test/1</c> option <c>group</c>,
one or more test case groups can be specified, optionally in combination
- with specific test cases. The syntax for specifying groups is as follows
- (on the command line):</p>
+ with specific test cases. The syntax for specifying groups on the command line
+ is as follows:</p>
<pre>
- <![CDATA[$ ct_run -group <group_names_or_paths> [-case <cases>]]]></pre>
- <p>or (in the Erlang shell):</p>
+ <![CDATA[$ ct_run -group <group_names_or_paths> [-case <cases>]]]></pre>
+ <p>The syntax in the Erlang shell is as follows:</p>
<pre>
- <![CDATA[1> ct:run_test([{group,GroupsNamesOrPaths}, {case,Cases}]).]]></pre>
+ <![CDATA[1> ct:run_test([{group,GroupsNamesOrPaths}, {case,Cases}]).]]></pre>
- <p>The <c>group_names_or_paths</c> parameter specifies either one
- or more group names and/or one or more group paths. At start up,
- Common Test will search for matching groups in the group definitions
- tree (i.e. the list returned from <c>Suite:groups/0</c>, please see the
- <seealso marker="write_test_chapter#test_case_groups">Test case groups</seealso>
- chapter for details).
- Given a group name, say <c>g</c>, Common Test will search for all paths
- that lead to <c>g</c>. By path here we mean a sequence of nested groups,
- all of which have to be followed in order to get from the top level
- group to <c>g</c>. Actually, what Common Test needs to do in order to
- execute the test cases in group <c>g</c>, is to call the
- <c>init_per_group/2</c> function for each group in the path to
- <c>g</c>, as well as all corresponding <c>end_per_group/2</c>
- functions afterwards. The obvious reason for this is that the configuration
+ <p>Parameter <c>group_names_or_paths</c> specifies one
+ or more group names and/or one or more group paths. At startup,
+ <c>Common Test</c> searches for matching groups in the group definitions
+ tree (that is, the list returned from <c>Suite:groups/0</c>; for details, see section
+ <seealso marker="write_test_chapter#test_case_groups">Test Case Groups</seealso>.
+ </p>
+
+ <p>Given a group name, say <c>g</c>, <c>Common Test</c> searches for all paths
+ leading to <c>g</c>. By path is meant a sequence of nested groups,
+ which must be followed to get from the top-level
+ group to <c>g</c>. To execute the test cases in group <c>g</c>,
+ <c>Common Test</c> must call the <c>init_per_group/2</c> function for
+ each group in the path to <c>g</c>, and all corresponding <c>end_per_group/2</c>
+ functions afterwards. This is because the configuration
of a test case in <c>g</c> (and its <c>Config</c> input data) depends on
<c>init_per_testcase(TestCase, Config)</c> and its return value, which
in turn depends on <c>init_per_group(g, Config)</c> and its return value,
which in turn depends on <c>init_per_group/2</c> of the group above
- <c>g</c>, etc, all the way up to the top level group.</p>
+ <c>g</c>, and so on, all the way up to the top-level group.</p>
- <p>As you may have already realized, this means that if there is more than
- one way to locate a group (and its test cases) in a path, the result of the
- group search operation is a number of tests, all of which will be performed.
- Common Test actually interprets a group specification that consists of a
- single name this way:</p>
+ <p>This means that if there is more than one way to locate a group
+ (and its test cases) in a path, the result of the group search operation
+ is a number of tests, all of which are to be performed.
+ <c>Common Test</c> interprets a group specification that consists of a
+ single name as follows:</p>
<p>"Search and find all paths in the group definitions tree that lead
- to the specified group and, for each path, create a test which (1) executes
- all configuration functions in the path to the specified group, then (2)
- executes all - or all matching - test cases in this group, as well as (3)
- all - or all matching - test cases in all sub groups of the group".
- </p>
+ to the specified group and, for each path, create a test that does the following,
+ in order:</p>
+ <list type="ordered">
+ <item>Executes all configuration functions in the path to the specified group.</item>
+ <item>Executes all, or all matching, test cases in this group.</item>
+ <item>Executes all, or all matching, test cases in all subgroups of the group."</item>
+ </list>
- <p>It is also possible for the user to specify a specific group path with
- the <c>group_names_or_paths</c> parameter. With this type of specification it's
- possible to avoid execution of unwanted groups (in otherwise matching paths),
- and/or the execution of sub groups. The syntax of the group path is a list of
- group names in the path, e.g. on the command line:
+ <p>The user can specify a specific group path with
+ parameter <c>group_names_or_paths</c>. With this type of specification
+ execution of unwanted groups (in otherwise matching paths),
+ and/or the execution of subgroups can be avoided. The command line syntax of the
+ group path is a list of group names in the path, for example:
</p>
<p><c>$ ct_run -suite "./x_SUITE" -group [g1,g3,g4] -case tc1 tc5</c></p>
- <p>or similarly in the Erlang shell (requires a list within the groups list):</p>
+ <p>The syntax in the Erlang shell is as follows (requires a list within the groups list):</p>
<p><c>1> ct:run_test([{suite,"./x_SUITE"}, {group,[[g1,g3,g4]]}, {testcase,[tc1,tc5]}]).</c></p>
- <p>The last group in the specified path will be the terminating group in
- the test, i.e. no sub groups following this group will be executed. In the
- example above, <c>g4</c> is the terminating group, hence Common Test will
- execute a test that calls all init configuration functions in the path to
- <c>g4</c>, i.e. <c>g1..g3..g4</c>. It will then call test cases <c>tc1</c>
- and <c>tc5</c> in <c>g4</c> and finally all end configuration functions in order
- <c>g4..g3..g1</c>.</p>
+ <p>The last group in the specified path is the terminating group in
+ the test, that is, no subgroups following this group are executed. In the
+ previous example, <c>g4</c> is the terminating group. Hence, <c>Common Test</c>
+ executes a test that calls all <c>init</c> configuration functions in the path to
+ <c>g4</c>, that is, <c>g1..g3..g4</c>. It then calls test cases <c>tc1</c>
+ and <c>tc5</c> in <c>g4</c>, and finally all <c>end</c> configuration functions
+ in order <c>g4..g3..g1</c>.</p>
- <p>Note that the group path specification doesn't necessarily
+ <note><p>The group path specification does not necessarily
have to include <em>all</em> groups in the path to the terminating group.
- Common Test will search for all matching paths if given an incomplete group
- path.</p>
+ <c>Common Test</c> searches for all matching paths if an incomplete
+ group path is specified.</p></note>
- <p>Note also that it's possible to combine group names and group paths with the
- <c>group_names_or_paths</c> parameter. Each element is treated as
- an individual specification in combination with the <c>cases</c> parameter.
- See examples below.</p>
+ <note><p>Group names and group paths can be combined with parameter
+ <c>group_names_or_paths</c>. Each element is treated as an individual specification
+ in combination with parameter <c>cases</c>.
+ The following examples illustrates this.</p></note>
+
+ <p><em>Examples:</em></p>
+ <pre>
+ -module(x_SUITE).
+ ...
+ %% The group definitions:
+ groups() ->
+ [{top1,[],[tc11,tc12,
+ {sub11,[],[tc12,tc13]},
+ {sub12,[],[tc14,tc15,
+ {sub121,[],[tc12,tc16]}]}]},
+
+ {top2,[],[{group,sub21},{group,sub22}]},
+ {sub21,[],[tc21,{group,sub2X2}]},
+ {sub22,[],[{group,sub221},tc21,tc22,{group,sub2X2}]},
+ {sub221,[],[tc21,tc23]},
+ {sub2X2,[],[tc21,tc24]}].</pre>
+
+ <p>The following executes two tests, one for all cases and all subgroups
+ under <c>top1</c>, and one for all under <c>top2</c>:</p>
+ <pre>
+ $ ct_run -suite "x_SUITE" -group all
+ 1> ct:run_test([{suite,"x_SUITE"}, {group,all}]).</pre>
+ <p>Using <c>-group top1 top2</c>, or <c>{group,[top1,top2]}</c> gives the same result.</p>
- <p>Examples:</p>
+ <p>The following executes one test for all cases and subgroups under <c>top1</c>:</p>
<pre>
- -module(x_SUITE).
- ...
- %% The group definitions:
- groups() ->
- [{top1,[],[tc11,tc12,
- {sub11,[],[tc12,tc13]},
- {sub12,[],[tc14,tc15,
- {sub121,[],[tc12,tc16]}]}]},
-
- {top2,[],[{group,sub21},{group,sub22}]},
- {sub21,[],[tc21,{group,sub2X2}]},
- {sub22,[],[{group,sub221},tc21,tc22,{group,sub2X2}]},
- {sub221,[],[tc21,tc23]},
- {sub2X2,[],[tc21,tc24]}].
- </pre>
- <br></br>
- <p><c>$ ct_run -suite "x_SUITE" -group all</c></p>
- <p><c>1> ct:run_test([{suite,"x_SUITE"}, {group,all}]).</c></p>
- <p>Two tests will be executed, one for all cases and all sub groups under <c>top1</c>,
- and one for all under <c>top2</c>. (We would get the same result with
- <c>-group top1 top2</c>, or <c>{group,[top1,top2]}</c>.</p>
- <br></br>
- <p><c>$ ct_run -suite "x_SUITE" -group top1</c></p>
- <p><c>1> ct:run_test([{suite,"x_SUITE"}, {group,[top1]}]).</c></p>
- <p>This will execute one test for all cases and sub groups under <c>top1</c>.</p>
- <br></br>
- <p><c>$ ct_run -suite "x_SUITE" -group top1 -case tc12</c></p>
- <p><c>1> ct:run_test([{suite,"x_SUITE"}, {group,[top1]}, {testcase,[tc12]}]).</c></p>
- <p>This will run a test that executes <c>tc12</c> in <c>top1</c> and any sub group
- under <c>top1</c> where it can be found (<c>sub11</c> and <c>sub121</c>).</p>
- <br></br>
- <p><c>$ ct_run -suite "x_SUITE" -group [top1] -case tc12</c></p>
- <p><c>1> ct:run_test([{suite,"x_SUITE"}, {group,[[top1]]}, {testcase,[tc12]}]).</c></p>
- <p>This will execute <c>tc12</c> <em>only</em> in group <c>top1</c>.</p>
- <br></br>
- <p><c>$ ct_run -suite "x_SUITE" -group top1 -case tc16</c></p>
- <p><c>1> ct:run_test([{suite,"x_SUITE"}, {group,[top1]}, {testcase,[tc16]}]).</c></p>
- <p>This will search <c>top1</c> and all its sub groups for <c>tc16</c> and the result
- will be that this test case executes in group <c>sub121</c>. (The specific path:
- <c>-group [sub121]</c> or <c>{group,[[sub121]]}</c>, would have given
- us the same result in this example).</p>
- <br></br>
- <p><c>$ ct_run -suite "x_SUITE" -group sub12 [sub12]</c></p>
- <p><c>1> ct:run_test([{suite,"x_SUITE"}, {group,[sub12,[sub12]]}]).</c></p>
- <p>This will execute two tests, one that includes all cases and sub groups under
- <c>sub12</c>, and one with <em>only</em> the test cases in <c>sub12</c>.</p>
- <br></br>
- <p><c>$ ct_run -suite "x_SUITE" -group sub2X2</c></p>
- <p><c>1> ct:run_test([{suite,"x_SUITE"}, {group,[sub2X2]}]).</c></p>
- <p>In this example, Common Test will find and execute two tests, one for the path from
- <c>top2</c> to <c>sub2X2</c> via <c>sub21</c>, and one from <c>top2</c> to <c>sub2X2</c>
- via <c>sub22</c>.</p>
- <br></br>
- <p><c>$ ct_run -suite "x_SUITE" -group [sub21,sub2X2]</c></p>
- <p><c>1> ct:run_test([{suite,"x_SUITE"}, {group,[[sub21,sub2X2]]}]).</c></p>
- <p>Here, by specifying the unique path: <c>top2 -> sub21 -> sub2X2</c>, only one test
- is executed. The second possible path from <c>top2</c> to <c>sub2X2</c> (above)
- will be discarded.</p>
- <br></br>
- <p><c>$ ct_run -suite "x_SUITE" -group [sub22] -case tc22 tc21</c></p>
- <p><c>1> ct:run_test([{suite,"x_SUITE"}, {group,[[sub22]]}, {testcase,[tc22,tc21]}]).</c></p>
- <p>In this example only the test cases for <c>sub22</c> will be executed, and in
- reverse order compared to the group definition.</p>
- <br></br>
-
- <p>If a test case that belongs to a group (according to the group definition), is executed
- without a group specification, i.e. simply by means of (command line):</p>
+ $ ct_run -suite "x_SUITE" -group top1
+ 1> ct:run_test([{suite,"x_SUITE"}, {group,[top1]}]).</pre>
+
+ <p>The following runs a test executing <c>tc12</c> in <c>top1</c> and any subgroup
+ under <c>top1</c> where it can be found (<c>sub11</c> and <c>sub121</c>):</p>
+ <pre>
+ $ ct_run -suite "x_SUITE" -group top1 -case tc12
+ 1> ct:run_test([{suite,"x_SUITE"}, {group,[top1]}, {testcase,[tc12]}]).</pre>
+
+ <p>The following executes <c>tc12</c> <em>only</em> in group <c>top1</c>:</p>
+ <pre>
+ $ ct_run -suite "x_SUITE" -group [top1] -case tc12
+ 1> ct:run_test([{suite,"x_SUITE"}, {group,[[top1]]}, {testcase,[tc12]}]).</pre>
+
+ <p>The following searches <c>top1</c> and all its subgroups for <c>tc16</c> resulting
+ in that this test case executes in group <c>sub121</c>:</p>
+ <pre>
+ $ ct_run -suite "x_SUITE" -group top1 -case tc16
+ 1> ct:run_test([{suite,"x_SUITE"}, {group,[top1]}, {testcase,[tc16]}]).</pre>
+ <p>Using the specific path <c>-group [sub121]</c> or <c>{group,[[sub121]]}</c> gives
+ the same result in this example.</p>
+
+ <p>The following executes two tests, one including all cases and subgroups under
+ <c>sub12</c>, and one with <em>only</em> the test cases in <c>sub12</c>:</p>
+ <pre>
+ $ ct_run -suite "x_SUITE" -group sub12 [sub12]
+ 1> ct:run_test([{suite,"x_SUITE"}, {group,[sub12,[sub12]]}]).</pre>
+
+ <p>In the following example, <c>Common Test</c> finds and executes two tests,
+ one for the path from <c>top2</c> to <c>sub2X2</c> through <c>sub21</c>,
+ and one from <c>top2</c> to <c>sub2X2</c> through <c>sub22</c>:</p>
+ <pre>
+ $ ct_run -suite "x_SUITE" -group sub2X2
+ 1> ct:run_test([{suite,"x_SUITE"}, {group,[sub2X2]}]).</pre>
+
+ <p>In the following example, by specifying the unique path <c>top2 -> sub21 -> sub2X2</c>,
+ only one test is executed. The second possible path, from <c>top2</c> to <c>sub2X2</c>
+ (from the former example) is discarded:</p>
+ <pre>
+ $ ct_run -suite "x_SUITE" -group [sub21,sub2X2]
+ 1> ct:run_test([{suite,"x_SUITE"}, {group,[[sub21,sub2X2]]}]).</pre>
+
+ <p>The following executes only the test cases for <c>sub22</c> and in reverse order
+ compared to the group definition:</p>
+ <pre>
+ $ ct_run -suite "x_SUITE" -group [sub22] -case tc22 tc21
+ 1> ct:run_test([{suite,"x_SUITE"}, {group,[[sub22]]}, {testcase,[tc22,tc21]}]).</pre>
+
+ <p>If a test case belonging to a group (according to the group definition) is executed
+ without a group specification, that is, simply by
+ (using the command line):</p>
<p><c>$ ct_run -suite "my_SUITE" -case my_tc</c></p>
- <p>or (Erlang shell):</p>
+ <p>or (using the Erlang shell):</p>
<p><c>1> ct:run_test([{suite,"my_SUITE"}, {testcase,my_tc}]).</c></p>
- <p>then Common Test ignores the group definition and executes the test case in the scope of the
- test suite only (no group configuration functions are called).</p>
+ <p>then <c>Common Test</c> ignores the group definition and executes the test case
+ in the scope of the test suite only (no group configuration functions are called).</p>
- <p>The group specification feature, exactly as it has been presented in this section, can also
+ <p>The group specification feature, as presented in this section, can also
be used in <seealso marker="run_test_chapter#test_specifications">Test
- Specifications</seealso> (with some extra features added). Please see below.</p>
+ Specifications</seealso> (with some extra features added).</p>
</section>
<section>
- <title>Running the interactive shell mode</title>
+ <title>Running the Interactive Shell Mode</title>
- <p>You can start Common Test in an interactive shell mode where no
- automatic testing is performed. Instead, in this mode, Common Test
+ <p>You can start <c>Common Test</c> in an interactive shell mode where no
+ automatic testing is performed. Instead, <c>Common Test</c>
starts its utility processes, installs configuration data (if any),
and waits for the user to call functions (typically test case support
functions) from the Erlang shell.</p>
- <p>The shell mode is useful e.g. for debugging test suites, for analysing
+ <p>The shell mode is useful, for example, for debugging test suites, analyzing
and debugging the SUT during "simulated" test case execution, and
- for trying out various operations during test suite development.</p>
-
- <p>To invoke the interactive shell mode, you can start an Erlang shell
- manually and call <seealso marker="ct#install-1"><c>ct:install/1</c></seealso> to install any configuration
- data you might need (use <c>[]</c> as argument otherwise), then
- call <seealso marker="ct#start_interactive-0"><c>ct:start_interactive/0</c></seealso> to start Common Test. If you use
- the <c>ct_run</c> program, you may start the Erlang shell and Common Test
- in the same go by using the <c>-shell</c> and, optionally, the <c>-config</c>
- and/or <c>-userconfig</c> flag. Examples:
- </p>
- <list>
+ trying out various operations during test suite development.</p>
+
+ <p>To start the interactive shell mode, start an Erlang shell
+ manually and call <seealso marker="ct#install-1"><c>ct:install/1</c></seealso>
+ to install any configuration data you might need (use <c>[]</c> as argument otherwise).
+ Then call <seealso marker="ct#start_interactive-0"><c>ct:start_interactive/0</c></seealso>
+ to start <c>Common Test</c>.</p>
+
+ <p>If you use the <c>ct_run</c> program, you can start
+ the Erlang shell and <c>Common Test</c> in one go by using the flag <c>-shell</c> and,
+ optionally, flag <c>-config</c> and/or <c>-userconfig</c>.</p>
+ <p><em>Examples:</em></p>
+ <list type="bulleted">
<item><c>ct_run -shell</c></item>
<item><c><![CDATA[ct_run -shell -config cfg/db.cfg]]></c></item>
<item><c><![CDATA[ct_run -shell -userconfig db_login testuser x523qZ]]></c></item>
</list>
- <p>If no config file is given with the <c>ct_run</c> command,
- a warning will be displayed. If Common Test has been run from the same
- directory earlier, the same config file(s) will be used
- again. If Common Test has not been run from this directory before, no
- config files will be available.</p>
+ <p>If no configuration file is specified with command <c>ct_run</c>,
+ a warning is displayed. If <c>Common Test</c> has been run from the same
+ directory earlier, the same configuration file(s) are used again. If <c>Common Test</c>
+ has not been run from this directory before, no configuration files are available.</p>
- <p>If any functions using "required config data" (e.g. ct_telnet or
- ct_ftp functions) are to be called from the erlang shell, config
- data must first be required with <seealso marker="ct#require-1"><c>
- ct:require/1/2</c></seealso>. This is
- equivalent to a <c>require</c> statement in the <seealso
- marker="write_test_chapter#suite">Test Suite Info
- Function</seealso> or in the <seealso
- marker="write_test_chapter#info_function">Test Case Info
- Function</seealso>.</p>
-
- <p>Example:</p>
+ <p>If any functions using "required configuration data" (for example, functions
+ <c>ct_telnet</c> or <c>ct_ftp</c>) are to be called from the Erlang shell, first require
+ configuration data with <seealso marker="ct#require-1"><c>
+ ct:require/1,2</c></seealso>. This is equivalent to a <c>require</c> statement
+ in the <seealso marker="write_test_chapter#suite">Test Suite Information Function</seealso>
+ or in the <seealso marker="write_test_chapter#info_function">Test Case Information Function</seealso>.</p>
+
+ <p><em>Example:</em></p>
<pre>
- 1> ct:require(unix_telnet, unix).
- ok
- 2> ct_telnet:open(unix_telnet).
- {ok,&lt;0.105.0&gt;}
- 4> ct_telnet:cmd(unix_telnet, "ls .").
- {ok,["ls .","file1 ...",...]}
- </pre>
+ 1> ct:require(unix_telnet, unix).
+ ok
+ 2> ct_telnet:open(unix_telnet).
+ {ok,&lt;0.105.0&gt;}
+ 4> ct_telnet:cmd(unix_telnet, "ls .").
+ {ok,["ls .","file1 ...",...]}</pre>
- <p>Everything that Common Test normally prints in the test case logs,
- will in the interactive mode be written to a log named
- <c>ctlog.html</c> in the <c><![CDATA[ct_run.<timestamp>]]></c>
- directory. A link to this file will be available in the file
- named <c>last_interactive.html</c> in the directory from which
- you executed <c>ct_run</c>. Currently, specifying a different
- root directory for the logs than the current working directory,
+ <p>Everything that <c>Common Test</c> normally prints in the test case logs,
+ are in the interactive mode written to a log named <c>ctlog.html</c>
+ in directory <c><![CDATA[ct_run.<timestamp>]]></c>. A link to this
+ file is available in the file named <c>last_interactive.html</c> in the
+ directory from which you execute <c>ct_run</c>. Specifying a different
+ root directory for the logs than the current working directory
is not supported.</p>
- <p>If you wish to exit the interactive mode (e.g. to start an
- automated test run with <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>), call the function
- <seealso marker="ct#stop_interactive-0"><c>ct:stop_interactive/0</c></seealso>. This shuts down the
- running <c>ct</c> application. Associations between
+ <p>If you wish to exit the interactive mode (for example, to start an automated
+ test run with <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>),
+ call function
+ <seealso marker="ct#stop_interactive-0"><c>ct:stop_interactive/0</c></seealso>.
+ This shuts down the running <c>ct</c> application. Associations between
configuration names and data created with <c>require</c> are
- consequently deleted. <seealso marker="ct#start_interactive-0"><c>ct:start_interactive/0</c></seealso> will get you
- back into interactive mode, but the previous state is not restored.</p>
+ consequently deleted. Function
+ <seealso marker="ct#start_interactive-0"><c>ct:start_interactive/0</c></seealso>
+ takes you back into interactive mode, but the previous state is not restored.</p>
</section>
<section>
- <title>Step by step execution of test cases with the Erlang Debugger</title>
+ <title>Step-by-Step Execution of Test Cases with the Erlang Debugger</title>
- <p>By means of <c>ct_run -step [opts]</c>, or by passing the
- <c>{step,Opts}</c> option to <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>, it is possible
- to get the Erlang Debugger started automatically and use its
- graphical interface to investigate the state of the current test
- case and to execute it step by step and/or set execution breakpoints.</p>
- <p>If no extra options are given with the <c>step</c> flag/option,
- breakpoints will be set automatically on the test cases that
- are to be executed by Common Test, and those functions only. If
- the step option <c>config</c> is specified, breakpoints will
- also be initially set on the configuration functions in the suite, i.e.
+ <p>Using <c>ct_run -step [opts]</c>, or by passing option <c>{step,Opts}</c>
+ to <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>,
+ the following is possible:</p>
+ <list type="bulleted">
+ <item>Get the Erlang Debugger started automatically.</item>
+ <item>Use its graphical interface to investigate the state of the current test case.</item>
+ <item>Execute the test case step-by-step and/or set execution breakpoints.</item>
+ </list>
+ <p>If no extra options are specified with flag/option <c>step</c>,
+ breakpoints are set automatically on the test cases that
+ are to be executed by <c>Common Test</c>, and those functions only. If
+ step option <c>config</c> is specified, breakpoints are also initially
+ set on the configuration functions in the suite, that is,
<c>init_per_suite/1</c>, <c>end_per_suite/1</c>,
<c>init_per_group/2</c>, <c>end_per_group/2</c>,
<c>init_per_testcase/2</c> and <c>end_per_testcase/2</c>.</p>
- <p>Common Test enables the Debugger auto attach feature, which means
+ <p><c>Common Test</c> enables the Debugger auto-attach feature, which means
that for every new interpreted test case function that starts to execute,
- a new trace window will automatically pop up. (This is because each test
+ a new trace window automatically pops up (as each test
case executes on a dedicated Erlang process). Whenever a new test case starts,
- Common Test will attempt to close the inactive trace window of the previous
- test case. However, if you prefer that Common Test leaves inactive trace
- windows, use the <c>keep_inactive</c> option.</p>
- <p>The step functionality can be used together with the <c>suite</c> and
- the <c>suite</c> + <c>case/testcase</c> flag/option, but not together
- with <c>dir</c>.</p>
+ <c>Common Test</c> attempts to close the inactive trace window of the previous
+ test case. However, if you prefer <c>Common Test</c> to leave inactive trace
+ windows, use option <c>keep_inactive</c>.</p>
+ <p>The step functionality can be used together with flag/option <c>suite</c> and
+ <c>suite</c> + <c>case/testcase</c>, but not together with <c>dir</c>.</p>
</section>
<section>
<marker id="test_specifications"></marker>
<title>Test Specifications</title>
<section>
- <title>General description</title>
- <p>The most flexible way to specify what to test, is to use a so
- called test specification. A test specification is a sequence of
+ <title>General Description</title>
+ <p>The most flexible way to specify what to test, is to use a
+ test specification, which is a sequence of
Erlang terms. The terms are normally declared in one or more text files
(see <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso>), but
- may also be passed to Common Test on the form of a list (see
+ can also be passed to <c>Common Test</c> on the form of a list (see
<seealso marker="ct#run_testspec-1"><c>ct:run_testspec/1</c></seealso>).
There are two general types of terms: configuration terms and test
specification terms.</p>
- <p>With configuration terms it is possible to e.g. label the test
- run (similar to <c>ct_run -label</c>), evaluate arbitrary expressions
- before starting the test, import configuration data (similar to
- <c>ct_run -config/-userconfig</c>), specify the top level HTML log
- directory (similar to <c>ct_run -logdir</c>), enable code coverage
- analysis (similar to <c>ct_run -cover</c>), install Common Test Hooks
- (similar to <c>ct_run -ch_hooks</c>), install event_handler plugins
- (similar to <c>ct_run -event_handler</c>), specify include directories
- that should be passed to the compiler for automatic compilation
- (similar to <c>ct_run -include</c>), disable the auto compilation
- feature (similar to <c>ct_run -no_auto_compile</c>), set verbosity
- levels (similar to <c>ct_run -verbosity</c>), and more.</p>
- <p>Configuration terms can be combined with <c>ct_run</c> start flags,
- or <c>ct:run_test/1</c> options. The result will for some flags/options
- and terms be that the values are merged (e.g. configuration files,
- include directories, verbosity levels, silent connections), and for
+
+ <p>With configuration terms it is, for example, possible to do the following:</p>
+ <list type="bulleted">
+ <item>Label the test run (similar to <c>ct_run -label</c>).</item>
+ <item>Evaluate any expressions before starting the test.</item>
+ <item>Import configuration data (similar to <c>ct_run -config/-userconfig</c>).</item>
+ <item>Specify the top-level HTML log directory (similar to <c>ct_run -logdir</c>).</item>
+ <item>Enable code coverage analysis (similar to <c>ct_run -cover</c>).</item>
+ <item>Install <c>Common Test Hooks</c> (similar to <c>ct_run -ch_hooks</c>).</item>
+ <item>Install <c>event_handler</c> plugins (similar to <c>ct_run -event_handler</c>).</item>
+ <item>Specify include directories to be passed to the compiler for
+ automatic compilation (similar to <c>ct_run -include</c>).</item>
+ <item>Disable the auto-compilation feature (similar to <c>ct_run -no_auto_compile</c>).</item>
+ <item>Set verbosity levels (similar to <c>ct_run -verbosity</c>).</item>
+ </list>
+
+ <p>Configuration terms can be combined with <c>ct_run</c> start flags
+ or <c>ct:run_test/1</c> options. The result is, for some flags/options
+ and terms, that the values are merged (for example, configuration files,
+ include directories, verbosity levels, and silent connections) and for
others that the start flags/options override the test specification
- terms (e.g. log directory, label, style sheet, auto compilation).</p>
- <p>With test specification terms it is possible to state exactly
- which tests should run and in which order. A test term specifies
+ terms (for example, log directory, label, style sheet, and auto-compilation).</p>
+
+ <p>With test specification terms, it is possible to state exactly
+ which tests to run and in which order. A test term specifies
either one or more suites, one or more test case groups (possibly nested),
or one or more test cases in a group (or in multiple groups) or in a suite.</p>
- <p>An arbitrary number of test terms may be declared in sequence.
- Common Test will by default compile the terms into one or more tests
- to be performed in one resulting test run. Note that a term that
- specifies a set of test cases will "swallow" one that only
- specifies a subset of these cases. E.g. the result of merging
- one term that specifies that all cases in suite S should be
+
+ <p>Any number of test terms can be declared in sequence.
+ <c>Common Test</c> compiles by default the terms into one or more tests
+ to be performed in one resulting test run. A term that
+ specifies a set of test cases "swallows" one that only
+ specifies a subset of these cases. For example, the result of merging
+ one term specifying that all cases in suite S are to be
executed, with another term specifying only test case X and Y in
S, is a test of all cases in S. However, if a term specifying
test case X and Y in S is merged with a term specifying case Z
- in S, the result is a test of X, Y and Z in S. To disable this
- behaviour, i.e. to instead perform each test sequentially in a "script-like"
- manner, the term <c>merge_tests</c> can be set to <c>false</c> in
- the test specification.</p>
+ in S, the result is a test of X, Y, and Z in S. To disable this
+ behavior, that is, to instead perform each test sequentially in a
+ "script-like" manner, set term <c>merge_tests</c> to <c>false</c>
+ in the test specification.</p>
+
<p>A test term can also specify one or more test suites, groups,
- or test cases to be skipped. Skipped suites, groups and cases
- are not executed and show up in the HTML log files as
- SKIPPED.</p>
+ or test cases to be skipped. Skipped suites, groups, and cases
+ are not executed and show up in the HTML log files as <c>SKIPPED</c>.</p>
</section>
<section>
- <title>Using multiple test specification files</title>
+ <title>Using Multiple Test Specification Files</title>
- <p>When multiple test specification files are given at startup (either
+ <p>When multiple test specification files are specified at startup (either
with <c>ct_run -spec file1 file2 ...</c> or
<c>ct:run_test([{spec, [File1,File2,...]}])</c>),
- Common Test will either execute one test run per specification file, or
- join the files and perform all tests within one single test run. The first
- behaviour is the default one. The latter requires that the start
- flag/option <c>join_specs</c> is provided, e.g.
+ <c>Common Test</c> either executes one test run per specification file,
+ or joins the files and performs all tests within one single test run.
+ The first behavior is the default one. The latter requires that start
+ flag/option <c>join_specs</c> is provided, for example,
<c>run_test -spec ./my_tests1.ts ./my_tests2.ts -join_specs</c>.</p>
<p>Joining a number of specifications, or running them separately, can
- also be accomplished with (and may be combined with) test specification
- file inclusion, described next.</p>
+ also be accomplished with (and can be combined with) test specification
+ file inclusion.</p>
</section>
<section>
- <title>Test specification file inclusion</title>
- <p>With the <c>specs</c> term (see syntax below), it's possible to have
- a test specification include other specifications. An included
- specification may either be joined with the source specification,
- or used to produce a separate test run (like with the <c>join_specs</c>
- start flag/option above). Example:</p>
+ <title>Test Specification File Inclusion</title>
+ <p>With the term <c>specs</c>, a test specification can include
+ other specifications. An included specification can either be joined
+ with the source specification or used to produce a separate test run
+ (as with start flag/option <c>join_specs</c> above).</p>
+ <p><em>Example:</em></p>
+
<pre>
- %% In specification file "a.spec"
- {specs, join, ["b.spec", "c.spec"]}.
- {specs, separate, ["d.spec", "e.spec"]}.
- %% Config and test terms follow
- ...</pre>
+ %% In specification file "a.spec"
+ {specs, join, ["b.spec", "c.spec"]}.
+ {specs, separate, ["d.spec", "e.spec"]}.
+ %% Config and test terms follow
+ ...</pre>
+
<p>In this example, the test terms defined in files "b.spec" and "c.spec"
- will be joined with the terms in the source specification "a.spec"
+ are joined with the terms in source specification "a.spec"
(if any). The inclusion of specifications "d.spec" and
- "e.spec" will result in two separate, and independent, test runs (i.e.
- one for each included specification).</p>
- <p>Note that the <c>join</c> option does not imply that the test terms
- will be merged (see <c>merge_tests</c> above), only that all tests are
- executed in one single test run.</p>
+ "e.spec" results in two separate, and independent, test runs
+ (one for each included specification).</p>
+
+ <p>Option <c>join</c> does not imply that the test terms
+ are merged, only that all tests are executed in one single test run.</p>
+
<p>Joined specifications share common configuration settings, such as
the list of <c>config</c> files or <c>include</c> directories.
- For configuration that can not be combined, such as settings for <c>logdir</c>
+ For configurations that cannot be combined, such as settings for <c>logdir</c>
or <c>verbosity</c>, it is up to the user to ensure there are no clashes
when the test specifications are joined. Specifications included with
- the <c>separate</c> option, do not share configuration settings with the
- source specification. This is useful e.g. if there are clashing
- configuration settings in included specifications, making it impossible
- to join them.</p>
+ option <c>separate</c> do not share configuration settings with the
+ source specification. This is useful, for example, if there are clashing
+ configuration settings in included specifications, making it them impossible
+ to join.</p>
+
<p>If <c>{merge_tests,true}</c> is set in the source specification
- (which is the default setting), terms in joined specifications will be
+ (which is the default setting), terms in joined specifications are
merged with terms in the source specification (according to the
- description of <c>merge_tests</c> above).</p>
- <p>Note that it is always the <c>merge_tests</c> setting in the source
+ description of <c>merge_tests</c> earlier).</p>
+
+ <p>Notice that it is always the <c>merge_tests</c> setting in the source
specification that is used when joined with other specifications.
- Say e.g. that a source specification A, with tests TA1 and TA2, has
- <c>{merge_tests,false}</c> set, and it includes another specification,
+ Say, for example, that a source specification A, with tests TA1 and TA2, has
+ <c>{merge_tests,false}</c> set, and that it includes another specification,
B, with tests TB1 and TB2, that has <c>{merge_tests,true}</c> set.
- The result will be that the test series: <c>TA1,TA2,merge(TB1,TB2)</c>,
- is executed. The opposite <c>merge_tests</c> settings would result in the
- following the test series: <c>merge(merge(TA1,TA2),TB1,TB2)</c>.</p>
- <p>The <c>specs</c> term may of course be used to nest specifications,
- i.e. have one specification include other specifications, which in turn
- include others, etc.</p>
+ The result is that the test series <c>TA1,TA2,merge(TB1,TB2)</c>
+ is executed. The opposite <c>merge_tests</c> settings would result in
+ the test series <c>merge(merge(TA1,TA2),TB1,TB2)</c>.</p>
+
+ <p>The term <c>specs</c> can be used to nest specifications,
+ that is, have one specification include other specifications, which in turn
+ include others, and so no</p>
</section>
<section>
- <title>Test case groups</title>
+ <title>Test Case Groups</title>
<p>When a test case group is specified, the resulting test
- executes the <c>init_per_group</c> function, followed by all test
- cases and sub groups (including their configuration functions), and
- finally the <c>end_per_group</c> function. Also if particular
+ executes function <c>init_per_group</c>, followed by all test
+ cases and subgroups (including their configuration functions), and
+ finally function <c>end_per_group</c>. Also, if particular
test cases in a group are specified, <c>init_per_group</c>
- and <c>end_per_group</c> for the group in question are
- called. If a group which is defined (in <c>Suite:group/0</c>) to
- be a sub group of another group, is specified (or if particular test
- cases of a sub group are), Common Test will call the configuration
- functions for the top level groups as well as for the sub group
+ and <c>end_per_group</c>, for the group in question, are
+ called. If a group defined (in <c>Suite:group/0</c>) as
+ a subgroup of another group, is specified (or if particular test
+ cases of a subgroup are), <c>Common Test</c> calls the configuration
+ functions for the top-level groups and for the subgroup
in question (making it possible to pass configuration data all
the way from <c>init_per_suite</c> down to the test cases in the
- sub group).</p>
- <p>The test specification utilizes the same mechanism for specifying
- test case groups by means of names and paths, as explained in the
- <seealso marker="run_test_chapter#group_execution">Group Execution</seealso>
- section above, with the addition of the <c>GroupSpec</c> element
- described next.</p>
- <p>The <c>GroupSpec</c> element makes it possible to specify
- group execution properties that will override those in the
- group definition (i.e. in <c>groups/0</c>). Execution properties for
- sub-groups may be overridden as well. This feature makes it possible to
+ subgroup).</p>
+
+ <p>The test specification uses the same mechanism for specifying
+ test case groups through names and paths, as explained in section
+ <seealso marker="run_test_chapter#group_execution">Test Case Group Execution</seealso>,
+ with the addition of element <c>GroupSpec</c>.</p>
+
+ <p>Element <c>GroupSpec</c> makes it possible to specify
+ group execution properties that overrides those in the
+ group definition (that is, in <c>groups/0</c>). Execution properties for
+ subgroups might be overridden as well. This feature makes it possible to
change properties of groups at the time of execution,
- without even having to edit the test suite. The very same
- feature is available for <c>group</c> elements in the <c>Suite:all/0</c>
- list. Therefore, more detailed documentation, and examples, can be
- found in the <seealso marker="write_test_chapter#test_case_groups">
- Test case groups</seealso> chapter.</p>
+ without having to edit the test suite. The same feature is available for
+ <c>group</c> elements in the <c>Suite:all/0</c> list. For details and examples,
+ see section <seealso marker="write_test_chapter#test_case_groups">
+ Test Case Groups</seealso>.</p>
</section>
<section>
- <title>Test specification syntax</title>
-
- <p>Below is the test specification syntax. Test specifications can
- be used to run tests both in a single test host environment and
- in a distributed Common Test environment (Large Scale
- Testing). The node parameters in the <c>init</c> term are only
- relevant in the latter (see the
- <seealso marker="ct_master_chapter#test_specifications">Large
- Scale Testing</seealso> chapter for information). For more information
- about the various terms, please see the corresponding sections in the
- User's Guide, such as e.g. the
- <seealso marker="run_test_chapter#ct_run"><c>ct_run</c>
+ <title>Test Specification Syntax</title>
+
+ <p>Test specifications can be used to run tests both in a single
+ test host environment and in a distributed <c>Common Test</c> environment
+ (Large Scale Testing). The node parameters in term <c>init</c> are only
+ relevant in the latter (see section
+ <seealso marker="ct_master_chapter#test_specifications">Test Specifications</seealso>
+ in Large Scale Testing). For details about the various terms, see the
+ corresponding sections in the User's Guide, for example, the following:
+ </p>
+ <list type="bulleted">
+ <item>The <seealso marker="run_test_chapter#ct_run"><c>ct_run</c>
program</seealso> for an overview of available start flags
- (since most flags have a corresponding configuration term), and
- more detailed explanation of e.g.
- <seealso marker="write_test_chapter#logging">Logging</seealso>
- (for the <c>verbosity</c>, <c>stylesheet</c> and <c>basic_html</c> terms),
- <seealso marker="config_file_chapter#top">External Configuration Data</seealso>
- (for the <c>config</c> and <c>userconfig</c> terms),
- <seealso marker="event_handler_chapter#event_handling">Event
- Handling</seealso> (for the <c>event_handler</c> term),
- <seealso marker="ct_hooks_chapter#installing">Common Test Hooks</seealso>
- (for the <c>ct_hooks</c> term), etc.</p>
- </section>
-
- <p>Config terms:</p>
+ (as most flags have a corresponding configuration term)</item>
+ <item><seealso marker="write_test_chapter#logging">Logging</seealso>
+ (for terms <c>verbosity</c>, <c>stylesheet</c> and <c>basic_html</c>)</item>
+ <item><seealso marker="config_file_chapter#top">External Configuration Data</seealso>
+ (for terms <c>config</c> and <c>userconfig</c>)</item>
+ <item><seealso marker="event_handler_chapter#event_handling">Event
+ Handling</seealso> (for the <c>event_handler</c> term)</item>
+ <item><seealso marker="ct_hooks_chapter#installing">Common Test Hooks</seealso>
+ (for term <c>ct_hooks</c>)</item>
+ </list>
+
+ <p><em>Configuration terms:</em></p>
<pre>
- {merge_tests, Bool}.
-
- {define, Constant, Value}.
-
- {specs, InclSpecsOption, TestSpecs}.
-
- {node, NodeAlias, Node}.
-
- {init, InitOptions}.
- {init, [NodeAlias], InitOptions}.
-
- {label, Label}.
- {label, NodeRefs, Label}.
-
- {verbosity, VerbosityLevels}.
- {verbosity, NodeRefs, VerbosityLevels}.
-
- {stylesheet, CSSFile}.
- {stylesheet, NodeRefs, CSSFile}.
-
- {silent_connections, ConnTypes}.
- {silent_connections, NodeRefs, ConnTypes}.
-
- {multiply_timetraps, N}.
- {multiply_timetraps, NodeRefs, N}.
-
- {scale_timetraps, Bool}.
- {scale_timetraps, NodeRefs, Bool}.
-
- {cover, CoverSpecFile}.
- {cover, NodeRefs, CoverSpecFile}.
-
- {cover_stop, Bool}.
- {cover_stop, NodeRefs, Bool}.
-
- {include, IncludeDirs}.
- {include, NodeRefs, IncludeDirs}.
-
- {auto_compile, Bool},
- {auto_compile, NodeRefs, Bool},
-
- {abort_if_missing_suites, Bool},
- {abort_if_missing_suites, NodeRefs, Bool},
+ {merge_tests, Bool}.
- {config, ConfigFiles}.
- {config, ConfigDir, ConfigBaseNames}.
- {config, NodeRefs, ConfigFiles}.
- {config, NodeRefs, ConfigDir, ConfigBaseNames}.
-
- {userconfig, {CallbackModule, ConfigStrings}}.
- {userconfig, NodeRefs, {CallbackModule, ConfigStrings}}.
-
- {logdir, LogDir}.
- {logdir, NodeRefs, LogDir}.
-
- {logopts, LogOpts}.
- {logopts, NodeRefs, LogOpts}.
-
- {create_priv_dir, PrivDirOption}.
- {create_priv_dir, NodeRefs, PrivDirOption}.
-
- {event_handler, EventHandlers}.
- {event_handler, NodeRefs, EventHandlers}.
- {event_handler, EventHandlers, InitArgs}.
- {event_handler, NodeRefs, EventHandlers, InitArgs}.
-
- {ct_hooks, CTHModules}.
- {ct_hooks, NodeRefs, CTHModules}.
-
- {enable_builtin_hooks, Bool}.
-
- {basic_html, Bool}.
- {basic_html, NodeRefs, Bool}.
-
- {release_shell, Bool}.</pre>
+ {define, Constant, Value}.
+
+ {specs, InclSpecsOption, TestSpecs}.
+
+ {node, NodeAlias, Node}.
+
+ {init, InitOptions}.
+ {init, [NodeAlias], InitOptions}.
+
+ {label, Label}.
+ {label, NodeRefs, Label}.
+
+ {verbosity, VerbosityLevels}.
+ {verbosity, NodeRefs, VerbosityLevels}.
+
+ {stylesheet, CSSFile}.
+ {stylesheet, NodeRefs, CSSFile}.
+
+ {silent_connections, ConnTypes}.
+ {silent_connections, NodeRefs, ConnTypes}.
+
+ {multiply_timetraps, N}.
+ {multiply_timetraps, NodeRefs, N}.
+
+ {scale_timetraps, Bool}.
+ {scale_timetraps, NodeRefs, Bool}.
+
+ {cover, CoverSpecFile}.
+ {cover, NodeRefs, CoverSpecFile}.
+
+ {cover_stop, Bool}.
+ {cover_stop, NodeRefs, Bool}.
+
+ {include, IncludeDirs}.
+ {include, NodeRefs, IncludeDirs}.
+
+ {auto_compile, Bool},
+ {auto_compile, NodeRefs, Bool},
+
+ {abort_if_missing_suites, Bool},
+ {abort_if_missing_suites, NodeRefs, Bool},
+
+ {config, ConfigFiles}.
+ {config, ConfigDir, ConfigBaseNames}.
+ {config, NodeRefs, ConfigFiles}.
+ {config, NodeRefs, ConfigDir, ConfigBaseNames}.
+
+ {userconfig, {CallbackModule, ConfigStrings}}.
+ {userconfig, NodeRefs, {CallbackModule, ConfigStrings}}.
+
+ {logdir, LogDir}.
+ {logdir, NodeRefs, LogDir}.
+
+ {logopts, LogOpts}.
+ {logopts, NodeRefs, LogOpts}.
+
+ {create_priv_dir, PrivDirOption}.
+ {create_priv_dir, NodeRefs, PrivDirOption}.
+
+ {event_handler, EventHandlers}.
+ {event_handler, NodeRefs, EventHandlers}.
+ {event_handler, EventHandlers, InitArgs}.
+ {event_handler, NodeRefs, EventHandlers, InitArgs}.
+
+ {ct_hooks, CTHModules}.
+ {ct_hooks, NodeRefs, CTHModules}.
+
+ {enable_builtin_hooks, Bool}.
+
+ {basic_html, Bool}.
+ {basic_html, NodeRefs, Bool}.
+
+ {release_shell, Bool}.</pre>
- <p>Test terms:</p>
+ <p><em>Test terms:</em></p>
<pre>
- {suites, Dir, Suites}.
- {suites, NodeRefs, Dir, Suites}.
-
- {groups, Dir, Suite, Groups}.
- {groups, NodeRefs, Dir, Suite, Groups}.
-
- {groups, Dir, Suite, Groups, {cases,Cases}}.
- {groups, NodeRefs, Dir, Suite, Groups, {cases,Cases}}.
-
- {cases, Dir, Suite, Cases}.
- {cases, NodeRefs, Dir, Suite, Cases}.
-
- {skip_suites, Dir, Suites, Comment}.
- {skip_suites, NodeRefs, Dir, Suites, Comment}.
-
- {skip_groups, Dir, Suite, GroupNames, Comment}.
- {skip_groups, NodeRefs, Dir, Suite, GroupNames, Comment}.
-
- {skip_cases, Dir, Suite, Cases, Comment}.
- {skip_cases, NodeRefs, Dir, Suite, Cases, Comment}.</pre>
-
- <p>Types:</p>
+ {suites, Dir, Suites}.
+ {suites, NodeRefs, Dir, Suites}.
+
+ {groups, Dir, Suite, Groups}.
+ {groups, NodeRefs, Dir, Suite, Groups}.
+
+ {groups, Dir, Suite, Groups, {cases,Cases}}.
+ {groups, NodeRefs, Dir, Suite, Groups, {cases,Cases}}.
+
+ {cases, Dir, Suite, Cases}.
+ {cases, NodeRefs, Dir, Suite, Cases}.
+
+ {skip_suites, Dir, Suites, Comment}.
+ {skip_suites, NodeRefs, Dir, Suites, Comment}.
+
+ {skip_groups, Dir, Suite, GroupNames, Comment}.
+ {skip_groups, NodeRefs, Dir, Suite, GroupNames, Comment}.
+
+ {skip_cases, Dir, Suite, Cases, Comment}.
+ {skip_cases, NodeRefs, Dir, Suite, Cases, Comment}.</pre>
+
+ <marker id="types"></marker>
+ <p><em>Types:</em></p>
<pre>
- Bool = true | false
- Constant = atom()
- Value = term()
- InclSpecsOption = join | separate
- TestSpecs = string() | [string()]
- NodeAlias = atom()
- Node = node()
- NodeRef = NodeAlias | Node | master
- NodeRefs = all_nodes | [NodeRef] | NodeRef
- InitOptions = term()
- Label = atom() | string()
- VerbosityLevels = integer() | [{Category,integer()}]
- Category = atom()
- CSSFile = string()
- ConnTypes = all | [atom()]
- N = integer()
- CoverSpecFile = string()
- IncludeDirs = string() | [string()]
- ConfigFiles = string() | [string()]
- ConfigDir = string()
- ConfigBaseNames = string() | [string()]
- CallbackModule = atom()
- ConfigStrings = string() | [string()]
- LogDir = string()
- LogOpts = [term()]
- PrivDirOption = auto_per_run | auto_per_tc | manual_per_tc
- EventHandlers = atom() | [atom()]
- InitArgs = [term()]
- CTHModules = [CTHModule |
- {CTHModule, CTHInitArgs} |
- {CTHModule, CTHInitArgs, CTHPriority}]
- CTHModule = atom()
- CTHInitArgs = term()
- Dir = string()
- Suites = atom() | [atom()] | all
- Suite = atom()
- Groups = GroupPath | [GroupPath] | GroupSpec | [GroupSpec] | all
- GroupPath = [GroupName]
- GroupSpec = GroupName | {GroupName,Properties} | {GroupName,Properties,GroupSpec}
- GroupName = atom()
- GroupNames = GroupName | [GroupName]
- Cases = atom() | [atom()] | all
- Comment = string() | ""</pre>
-
- <section>
- <p>The difference between the <c>config</c> terms above, is that with
+ Bool = true | false
+ Constant = atom()
+ Value = term()
+ InclSpecsOption = join | separate
+ TestSpecs = string() | [string()]
+ NodeAlias = atom()
+ Node = node()
+ NodeRef = NodeAlias | Node | master
+ NodeRefs = all_nodes | [NodeRef] | NodeRef
+ InitOptions = term()
+ Label = atom() | string()
+ VerbosityLevels = integer() | [{Category,integer()}]
+ Category = atom()
+ CSSFile = string()
+ ConnTypes = all | [atom()]
+ N = integer()
+ CoverSpecFile = string()
+ IncludeDirs = string() | [string()]
+ ConfigFiles = string() | [string()]
+ ConfigDir = string()
+ ConfigBaseNames = string() | [string()]
+ CallbackModule = atom()
+ ConfigStrings = string() | [string()]
+ LogDir = string()
+ LogOpts = [term()]
+ PrivDirOption = auto_per_run | auto_per_tc | manual_per_tc
+ EventHandlers = atom() | [atom()]
+ InitArgs = [term()]
+ CTHModules = [CTHModule |
+ {CTHModule, CTHInitArgs} |
+ {CTHModule, CTHInitArgs, CTHPriority}]
+ CTHModule = atom()
+ CTHInitArgs = term()
+ Dir = string()
+ Suites = atom() | [atom()] | all
+ Suite = atom()
+ Groups = GroupPath | [GroupPath] | GroupSpec | [GroupSpec] | all
+ GroupPath = [GroupName]
+ GroupSpec = GroupName | {GroupName,Properties} | {GroupName,Properties,GroupSpec}
+ GroupName = atom()
+ GroupNames = GroupName | [GroupName]
+ Cases = atom() | [atom()] | all
+ Comment = string() | ""</pre>
+
+ <p>The difference between the <c>config</c> terms above is that with
<c>ConfigDir</c>, <c>ConfigBaseNames</c> is a list of base names,
- i.e. without directory paths. <c>ConfigFiles</c> must be full names,
- including paths. E.g, these two terms have the same meaning:</p>
+ that is, without directory paths. <c>ConfigFiles</c> must be full names,
+ including paths. For example, the following two terms have the same meaning:</p>
<pre>
- {config, ["/home/testuser/tests/config/nodeA.cfg",
- "/home/testuser/tests/config/nodeB.cfg"]}.
-
- {config, "/home/testuser/tests/config", ["nodeA.cfg","nodeB.cfg"]}.</pre>
+ {config, ["/home/testuser/tests/config/nodeA.cfg",
+ "/home/testuser/tests/config/nodeB.cfg"]}.
+
+ {config, "/home/testuser/tests/config", ["nodeA.cfg","nodeB.cfg"]}.</pre>
- <note><p>Any relative paths specified in the test specification, will be
- relative to the directory which contains the test specification file, if
+ <note><p>Any relative paths, specified in the test specification, are
+ relative to the directory containing the test specification file if
<c>ct_run -spec TestSpecFile ...</c> or
<c>ct:run:test([{spec,TestSpecFile},...])</c>
- executes the test. The path will be relative to the top level log directory, if
+ executes the test.</p>
+ <p>The path is relative to the top-level log directory if
<c>ct:run:testspec(TestSpec)</c> executes the test.</p></note>
</section>
<section>
<title>Constants</title>
- <p>The <c>define</c> term introduces a constant, which is used to
- replace the name <c>Constant</c> with <c>Value</c>, wherever it's found in
- the test specification. This replacement happens during an initial iteration
- through the test specification. Constants may be used anywhere in the test
- specification, e.g. in arbitrary lists and tuples, and even in strings
- and inside the value part of other constant definitions! A constant can
+ <p>The term <c>define</c> introduces a constant that is used to
+ replace the name <c>Constant</c> with <c>Value</c>, wherever it is found in
+ the test specification. This replacement occurs during an initial iteration
+ through the test specification. Constants can be used anywhere in the test
+ specification, for example, in any lists and tuples, and even in strings
+ and inside the value part of other constant definitions. A constant can
also be part of a node name, but that is the only place where a constant
can be part of an atom.</p>
<note><p>For the sake of readability, the name of the constant must always
- begin with an upper case letter, or a <c>$</c>, <c>?</c>, or <c>_</c>.
- This also means that it must always be single quoted (obviously, since
- the constant name is actually an atom, not text).</p></note>
+ begin with an uppercase letter, or a <c>$</c>, <c>?</c>, or <c>_</c>.
+ This means that it must always be single quoted (as the constant name is
+ an atom, not text).</p></note>
<p>The main benefit of constants is that they can be used to reduce the size
- (and avoid repetition) of long strings, such as file paths. Compare these
- terms:</p>
+ (and avoid repetition) of long strings, such as file paths.</p>
+ <p><em>Examples:</em></p>
<pre>
- %% 1a. no constant
- {config, "/home/testuser/tests/config", ["nodeA.cfg","nodeB.cfg"]}.
- {suites, "/home/testuser/tests/suites", all}.
-
- %% 1b. with constant
- {define, 'TESTDIR', "/home/testuser/tests"}.
- {config, "'TESTDIR'/config", ["nodeA.cfg","nodeB.cfg"]}.
- {suites, "'TESTDIR'/suites", all}.
-
- %% 2a. no constants
- {config, [testnode@host1, testnode@host2], "../config", ["nodeA.cfg","nodeB.cfg"]}.
- {suites, [testnode@host1, testnode@host2], "../suites", [x_SUITE, y_SUITE]}.
-
- %% 2b. with constants
- {define, 'NODE', testnode}.
- {define, 'NODES', ['NODE'@host1, 'NODE'@host2]}.
- {config, 'NODES', "../config", ["nodeA.cfg","nodeB.cfg"]}.
- {suites, 'NODES', "../suites", [x_SUITE, y_SUITE]}.</pre>
+ %% 1a. no constant
+ {config, "/home/testuser/tests/config", ["nodeA.cfg","nodeB.cfg"]}.
+ {suites, "/home/testuser/tests/suites", all}.
+
+ %% 1b. with constant
+ {define, 'TESTDIR', "/home/testuser/tests"}.
+ {config, "'TESTDIR'/config", ["nodeA.cfg","nodeB.cfg"]}.
+ {suites, "'TESTDIR'/suites", all}.
+
+ %% 2a. no constants
+ {config, [testnode@host1, testnode@host2], "../config", ["nodeA.cfg","nodeB.cfg"]}.
+ {suites, [testnode@host1, testnode@host2], "../suites", [x_SUITE, y_SUITE]}.
+
+ %% 2b. with constants
+ {define, 'NODE', testnode}.
+ {define, 'NODES', ['NODE'@host1, 'NODE'@host2]}.
+ {config, 'NODES', "../config", ["nodeA.cfg","nodeB.cfg"]}.
+ {suites, 'NODES', "../suites", [x_SUITE, y_SUITE]}.</pre>
<p>Constants make the test specification term <c>alias</c>, in previous
- versions of Common Test, redundant. This term has been deprecated but will
- remain supported in upcoming Common Test releases. Replacing <c>alias</c>
- terms with <c>define</c> is strongly recommended though! Here's an example
- of such a replacement:</p>
+ versions of <c>Common Test</c>, redundant. This term is deprecated but
+ remains supported in upcoming <c>Common Test</c> releases. Replacing <c>alias</c>
+ terms with <c>define</c> is strongly recommended though. An example
+ of such replacement follows:</p>
<pre>
- %% using the old alias term
- {config, "/home/testuser/tests/config/nodeA.cfg"}.
- {alias, suite_dir, "/home/testuser/tests/suites"}.
- {groups, suite_dir, x_SUITE, group1}.
-
- %% replacing with constants
- {define, 'TestDir', "/home/testuser/tests"}.
- {define, 'CfgDir', "'TestDir'/config"}.
- {define, 'SuiteDir', "'TestDir'/suites"}.
- {config, 'CfgDir', "nodeA.cfg"}.
- {groups, 'SuiteDir', x_SUITE, group1}.</pre>
+ %% using the old alias term
+ {config, "/home/testuser/tests/config/nodeA.cfg"}.
+ {alias, suite_dir, "/home/testuser/tests/suites"}.
+ {groups, suite_dir, x_SUITE, group1}.
+
+ %% replacing with constants
+ {define, 'TestDir', "/home/testuser/tests"}.
+ {define, 'CfgDir', "'TestDir'/config"}.
+ {define, 'SuiteDir', "'TestDir'/suites"}.
+ {config, 'CfgDir', "nodeA.cfg"}.
+ {groups, 'SuiteDir', x_SUITE, group1}.</pre>
- <p>Actually, constants could well replace the <c>node</c> term too, but
- this still has declarative value, mainly when used in combination
- with <c>NodeRefs == all_nodes</c> (see types above).</p>
+ <p>Constants can well replace term <c>node</c> also, but
+ this still has a declarative value, mainly when used in combination
+ with <c>NodeRefs == all_nodes</c>
+ (see <seealso marker="#types">Types</seealso>).</p>
</section>
<section>
@@ -955,104 +1049,104 @@
<p>Here follows a simple test specification example:</p>
<pre>
- {define, 'Top', "/home/test"}.
- {define, 'T1', "'Top'/t1"}.
- {define, 'T2', "'Top'/t2"}.
- {define, 'T3', "'Top'/t3"}.
- {define, 'CfgFile', "config.cfg"}.
-
- {logdir, "'Top'/logs"}.
-
- {config, ["'T1'/'CfgFile'", "'T2'/'CfgFile'", "'T3'/'CfgFile'"]}.
-
- {suites, 'T1', all}.
- {skip_suites, 'T1', [t1B_SUITE,t1D_SUITE], "Not implemented"}.
- {skip_cases, 'T1', t1A_SUITE, [test3,test4], "Irrelevant"}.
- {skip_cases, 'T1', t1C_SUITE, [test1], "Ignore"}.
-
- {suites, 'T2', [t2B_SUITE,t2C_SUITE]}.
- {cases, 'T2', t2A_SUITE, [test4,test1,test7]}.
-
- {skip_suites, 'T3', all, "Not implemented"}.</pre>
+ {define, 'Top', "/home/test"}.
+ {define, 'T1', "'Top'/t1"}.
+ {define, 'T2', "'Top'/t2"}.
+ {define, 'T3', "'Top'/t3"}.
+ {define, 'CfgFile', "config.cfg"}.
+
+ {logdir, "'Top'/logs"}.
+
+ {config, ["'T1'/'CfgFile'", "'T2'/'CfgFile'", "'T3'/'CfgFile'"]}.
+
+ {suites, 'T1', all}.
+ {skip_suites, 'T1', [t1B_SUITE,t1D_SUITE], "Not implemented"}.
+ {skip_cases, 'T1', t1A_SUITE, [test3,test4], "Irrelevant"}.
+ {skip_cases, 'T1', t1C_SUITE, [test1], "Ignore"}.
+
+ {suites, 'T2', [t2B_SUITE,t2C_SUITE]}.
+ {cases, 'T2', t2A_SUITE, [test4,test1,test7]}.
+
+ {skip_suites, 'T3', all, "Not implemented"}.</pre>
<p>The example specifies the following:</p>
- <list>
- <item>The specified logdir directory will be used for storing
+ <list type="bulleted">
+ <item>The specified <c>logdir</c> directory is used for storing
the HTML log files (in subdirectories tagged with node name,
- date and time).</item>
- <item>The variables in the specified test system config files will be
+ date, and time).</item>
+ <item>The variables in the specified test system configuration files are
imported for the test.</item>
- <item>The first test to run includes all suites for system t1. Excluded from
- the test are however the t1B and t1D suites. Also test cases test3 and
- test4 in t1A as well as the test1 case in t1C are excluded from
- the test.</item>
- <item>Secondly, the test for system t2 should run. The included suites are
- t2B and t2C. Included are also test cases test4, test1 and test7 in suite
- t2A. Note that the test cases will be executed in the specified order.</item>
- <item>Lastly, all suites for systems t3 are to be completely skipped and this
- should be explicitly noted in the log files.</item>
+ <item>The first test to run includes all suites for system <c>t1</c>.
+ Suites <c>t1B</c> and <c>t1D</c> are excluded from the test. Test cases
+ <c>test3</c> and <c>test4</c> in <c>t1A</c> and <c>test1</c> case in <c>t1C</c>
+ are also excluded from the test.</item>
+ <item>The second test to run is for system <c>t2</c>. The included suites are
+ <c>t2B</c> and <c>t2C</c>. Test cases <c>test4</c>, <c>test1</c>, and <c>test7</c> in suite
+ <c>t2A</c> are also included. The test cases are executed in the specified order.</item>
+ <item>The last test to run is for system <c>t3</c>. Here, all suites are skipped and this
+ is explicitly noted in the log files.</item>
</list>
</section>
<section>
- <title>The init term</title>
- <p>With the <c>init</c> term it's possible to specify initialization options
- for nodes defined in the test specification. Currently, there are options
- to start the node and/or to evaluate any function on the node.
- See the <seealso marker="ct_master_chapter#ct_slave">Automatic startup of
- the test target nodes</seealso> chapter for details.</p>
+ <title>The init Term</title>
+ <p>With term <c>init</c> it is possible to specify initialization options
+ for nodes defined in the test specification. There are options
+ to start the node and to evaluate any function on the node.
+ For details, see section <seealso marker="ct_master_chapter#ct_slave">Automatic Startup of
+ Test Target Nodes</seealso> in section Using Common Test for Large Scale Testing.</p>
</section>
<section>
- <title>User specific terms</title>
- <p>It is possible for the user to provide a test specification that
- includes (for Common Test) unrecognizable terms. If this is desired,
- the <c>-allow_user_terms</c> flag should be used when starting tests with
- <c>ct_run</c>. This forces Common Test to ignore unrecognizable terms.
- Note that in this mode, Common Test is not able to check the specification
- for errors as efficiently as if the scanner runs in default mode.
+ <title>User-Specific Terms</title>
+ <p>The user can provide a test specification including (for <c>Common Test</c>)
+ unrecognizable terms. If this is desired, use flag <c>-allow_user_terms</c>
+ when starting tests with <c>ct_run</c>. This forces <c>Common Test</c> to ignore
+ unrecognizable terms. In this mode, <c>Common Test</c> is not able to check the
+ specification for errors as efficiently as if the scanner runs in default mode.
If <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso> is used
- for starting the tests, the relaxed scanner
- mode is enabled by means of the tuple: <c>{allow_user_terms,true}</c></p>
+ for starting the tests, the relaxed scanner mode is enabled by tuple
+ <c>{allow_user_terms,true}</c>.</p>
</section>
<section>
- <title>Reading test specification terms</title>
- <p>It's possible to look up terms in the current test specification
- (i.e. the spec that's been used to configure and run the current test).
- The function <c>get_testspec_terms()</c> returns a list of all test spec
- terms (both config- and test terms) and <c>get_testspec_terms(Tags)</c>
- returns the term (or a list of terms) matching the tag (or tags) in
- <c>Tags</c>.</p>
+ <title>Reading Test Specification Terms</title>
+ <p>Terms in the current test specification
+ (that is, the specification that has been used to configure and run the current test)
+ can be looked up.
+ The function <seealso marker="ct#get_testspec_terms-0"><c>get_testspec_terms()</c></seealso>
+ returns a list of all test specification terms (both configuration terms and test terms),
+ and <c>get_testspec_terms(Tags)</c> returns the term (or a list of terms) matching the
+ tag (or tags) in <c>Tags</c>.</p>
<p>For example, in the test specification:</p>
<pre>
- ...
- {label, my_server_smoke_test}.
- {config, "../../my_server_setup.cfg"}.
- {config, "../../my_server_interface.cfg"}.
- ...</pre>
- <p>And in e.g. a test suite or a CT hook function:</p>
+ ...
+ {label, my_server_smoke_test}.
+ {config, "../../my_server_setup.cfg"}.
+ {config, "../../my_server_interface.cfg"}.
+ ...</pre>
+ <p>And in, for example, a test suite or a <c>Common Test Hook</c> function:</p>
<pre>
- ...
- [{label,[{_Node,TestType}]}, {config,CfgFiles}] =
- ct:get_testspec_terms([label,config]),
+ ...
+ [{label,[{_Node,TestType}]}, {config,CfgFiles}] =
+ ct:get_testspec_terms([label,config]),
- [verify_my_server_cfg(TestType, CfgFile) || {Node,CfgFile} &lt;- CfgFiles,
- Node == node()];
- ...</pre>
+ [verify_my_server_cfg(TestType, CfgFile) || {Node,CfgFile} &lt;- CfgFiles,
+ Node == node()];
+ ...</pre>
</section>
</section>
<section>
- <title>Running tests from the Web based GUI</title>
+ <title>Running Tests from the Web-Based GUI</title>
- <p>The web based GUI, VTS, is started with the
+ <p>The web-based GUI, Virtual Test Server (VTS), is started with the
<seealso marker="run_test_chapter#ct_run"><c>ct_run</c></seealso>
- program. From the GUI you can load config files, and select
- directories, suites and cases to run. You can also state the
- config files, directories, suites and cases on the command line
- when starting the web based GUI.
+ program. From the GUI, you can load configuration files and select
+ directories, suites, and cases to run. You can also state the
+ configuration files, directories, suites, and cases on the command line
+ when starting the web-based GUI.
</p>
-
- <list>
+ <p><em>Examples:</em></p>
+ <list type="bulleted">
<item><c>ct_run -vts</c></item>
<item><c><![CDATA[ct_run -vts -config <configfilename>]]></c></item>
<item><c><![CDATA[ct_run -vts -config <configfilename> -suite <suitewithfullpath>
@@ -1062,454 +1156,464 @@
<p>From the GUI you can run tests and view the result and the logs.
</p>
- <p>Note that <c>ct_run -vts</c> will try to open the Common Test start
- page in an existing web browser window or start the browser if it is
- not running. Which browser should be started may be specified with
+ <p><c>ct_run -vts</c> tries to open the <c>Common Test</c> start
+ page in an existing web browser window, or start the browser if it is
+ not running. Which browser to start can be specified with
the browser start command option:</p>
<p><c><![CDATA[ct_run -vts -browser <browser_start_cmd>]]></c></p>
- <p>Example:</p>
+ <p><em>Example:</em></p>
<p><c><![CDATA[$ ct_run -vts -browser 'firefox&']]></c></p>
- <p>Note that the browser must run as a separate OS process or VTS will hang!</p>
- <p>If no specific browser start command is specified, Firefox will
- be the default browser on Unix platforms and Internet Explorer on Windows.
- If Common Test fails to start a browser automatically, or <c>'none'</c> is
- specified as the value for -browser (i.e. <c>-browser none</c>), start your
- favourite browser manually and type in the URL that Common Test
+
+ <note><p>The browser must run as a separate OS process, otherwise VTS hangs.</p></note>
+
+ <p>If no specific browser start command is specified, Firefox is
+ the default browser on Unix platforms, and Internet Explorer on Windows.
+ If <c>Common Test</c> fails to start a browser automatically, or <c>none</c> is
+ specified as the value for <c>-browser</c> (that is, <c>-browser none</c>), start your
+ favourite browser manually and type the URL that <c>Common Test</c>
displays in the shell.</p>
</section>
<section>
<marker id="log_files"></marker>
- <title>Log files</title>
+ <title>Log Files</title>
<p>As the execution of the test suites proceed, events are logged in
- four different ways:</p>
+ the following four different ways:</p>
- <list>
- <item>Text to the operator's console.</item>
- <item>Suite related information is sent to the major log file.</item>
- <item>Case related information is sent to the minor log file.</item>
- <item>The HTML overview log file gets updated with test results.</item>
+ <list type="bulleted">
+ <item>Text to the operator console.</item>
+ <item>Suite-related information is sent to the major log file.</item>
+ <item>Case-related information is sent to the minor log file.</item>
+ <item>The HTML overview log file is updated with test results.</item>
<item>A link to all runs executed from a certain directory is written in
- the log named "all_runs.html" and direct links to all tests (the
- latest results) are written to the top level "index.html".</item>
+ the log named <c>all_runs.html</c> and direct links to all tests (the
+ latest results) are written to the top-level <c>index.html</c>.</item>
</list>
- <p>Typically the operator, who may run hundreds or thousands of
- test cases, doesn't want to fill the console with details
- about, or printouts from, the specific test cases. By default, the
- operator will only see:</p>
+ <p>Typically the operator, possibly running hundreds or thousands of
+ test cases, does not want to fill the console with details
+ about, or printouts from, specific test cases. By default, the
+ operator only sees the following:</p>
- <list>
+ <list type="bulleted">
<item>A confirmation that the test has started and information about how
- many test cases will be executed totally.</item>
+ many test cases are executed in total.</item>
<item>A small note about each failed test case.</item>
<item>A summary of all the run test cases.</item>
- <item>A confirmation that the test run is complete.</item>
- <item>Some special information like error reports and progress
- reports, printouts written with erlang:display/1, or io:format/3
+ <item>A confirmation when the test run is complete.</item>
+ <item>Some special information, such as error reports, progress
+ reports, and printouts written with <c>erlang:display/1</c>, or <c>io:format/3</c>
specifically addressed to a receiver other than <c>standard_io</c>
- (e.g. the default group leader process 'user').</item>
+ (for example, the default group leader process <c>user</c>).</item>
</list>
- <p>If/when the operator wants to dig deeper into the general results, or
- the result of a specific test case, he should do so by
- following the links in the HTML presentation and take a look in the
- major or minor log files. The "all_runs.html" page is a practical
- starting point usually. It's located in <c>logdir</c> and contains
- a link to each test run including a quick overview (date and time,
- node name, number of tests, test names and test result totals).</p>
+ <p>To dig deeper into the general results, or
+ the result of a specific test case, the operator can do so by
+ following the links in the HTML presentation and read the
+ major or minor log files. The "all_runs.html" page is a good
+ starting point. It is located in <c>logdir</c> and contains
+ a link to each test run, including a quick overview (with date and time,
+ node name, number of tests, test names, and test result totals).</p>
- <p>An "index.html" page is written for each test run (i.e. stored in
- the "ct_run" directory tagged with node name, date and time). This
- file gives a short overview of all individual tests performed in the
- same test run. The test names follow this convention:</p>
- <list>
- <item><em>TopLevelDir.TestDir</em> (all suites in TestDir executed)</item>
- <item><em>TopLevelDir.TestDir:suites</em> (specific suites were executed)</item>
- <item><em>TopLevelDir.TestDir.Suite</em> (all cases in Suite executed)</item>
- <item><em>TopLevelDir.TestDir.Suite:cases</em> (specific test cases were executed)</item>
- <item><em>TopLevelDir.TestDir.Suite.Case</em> (only Case was executed)</item>
+ <p>An "index.html" page is written for each test run (that is, stored in
+ the <c>ct_run</c> directory tagged with node name, date, and time). This
+ file provides an overview of all individual tests performed in the
+ same test run. The test names follow the following convention:</p>
+ <list type="bulleted">
+ <item><c>TopLevelDir.TestDir</c> (all suites in <c>TestDir</c> executed)</item>
+ <item><c>TopLevelDir.TestDir:suites</c> (specific suites executed)</item>
+ <item><c>TopLevelDir.TestDir.Suite</c> (all cases in <c>Suite</c> executed)</item>
+ <item><c>TopLevelDir.TestDir.Suite:cases</c> (specific test cases executed)</item>
+ <item><c>TopLevelDir.TestDir.Suite.Case</c> (only <c>Case</c> executed)</item>
</list>
- <p>On the test run index page there is a link to the Common Test
+ <p>The "test run index" page includes a link to the <c>Common Test</c>
Framework Log file in which information about imported
configuration data and general test progress is written. This
log file is useful to get snapshot information about the test
- run during execution. It can also be very helpful when
+ run during execution. It can also be helpful when
analyzing test results or debugging test suites.</p>
- <p>On the test run index page it is noted if a test has missing
- suites (i.e. suites that Common Test has failed to
+ <p>The "test run index" page indicates if a test has missing
+ suites (that is, suites that <c>Common Test</c> failed to
compile). Names of the missing suites can be found in the
- Common Test Framework Log file.</p>
+ <c>Common Test</c> Framework Log file.</p>
<p>The major log file shows a detailed report of the test run. It
includes test suite and test case names, execution time, the
- exact reason for failures etc. The information is available in both
+ exact reason for failures, and so on. The information is available in both
a file with textual and with HTML representation. The HTML file shows a
- summary which gives a good overview of the test run. It also has links
+ summary that gives a good overview of the test run. It also has links
to each individual test case log file for quick viewing with an HTML
browser.</p>
<p>The minor log files contain full details of every single test
- case, each one in a separate file. This way, it should be
+ case, each in a separate file. This way, it is
straightforward to compare the latest results to that of previous
- test runs, even if the set of test cases changes. If SASL is running,
- its logs will also be printed to the current minor log file by the
+ test runs, even if the set of test cases changes. If application <c>SASL</c>
+ is running, its logs are also printed to the current minor log file by the
<seealso marker="common_test:ct_hooks_chapter#builtin_cths">
cth_log_redirect built-in hook</seealso>.
</p>
- <p>The full name of the minor log file (i.e. the name of the file
+ <p>The full name of the minor log file (that is, the name of the file
including the absolute directory path) can be read during execution
- of the test case. It comes as value in the tuple
+ of the test case. It comes as value in tuple
<c>{tc_logfile,LogFileName}</c> in the <c>Config</c> list (which means it
- can also be read by a pre- or post Common Test hook function). Also,
+ can also be read by a pre- or post <c>Common Test Hook</c> function). Also,
at the start of a test case, this data is sent with an event
- to any installed event handler. Please see the
- <seealso marker="event_handler_chapter#event_handling">Event Handling</seealso>
- chapter for details.
+ to any installed event handler. For details, see section
+ <seealso marker="event_handler_chapter#event_handling">Event Handling</seealso>.
</p>
-
- <p>Which information goes where is user configurable via the
- test server controller. Three threshold values determine what
- comes out on screen, and in the major or minor log files. See
- the OTP Test Server manual for information. The contents that
- goes to the HTML log file is fixed however and cannot be altered.</p>
-
- <p>The log files are written continously during a test run and links are
- always created initially when a test starts. This makes it possible
- to follow test progress simply by refreshing pages in the HTML browser.
+
+ <p>The log files are written continuously during a test run and links are
+ always created initially when a test starts. Thevtest progress can therefore
+ be followed simply by refreshing pages in the HTML browser.
Statistics totals are not presented until a test is complete however.</p>
<section>
<marker id="logopts"></marker>
- <title>Log options</title>
- <p>With the <c>logopts</c> start flag, it's possible to specify
- options that modify some aspects of the logging behaviour.
- Currently, the following options are available:</p>
- <list>
- <item><c>no_src</c></item>
- <item><c>no_nl</c></item>
- </list>
- <p>With <c>no_src</c>, the html version of the test suite source
- code will not be generated during the test run (and consequently
- not be available in the log file system).</p>
- <p>With <c>no_nl</c>, Common Test will not add a newline character
- (\n) to the end of an output string that it receives from a call to e.g.
- <c>io:format/2</c>, and which it prints to the test case log.</p>
+ <title>Log Options</title>
+ <p>With start flag <c>logopts</c> options that modify some aspects
+ of the logging behavior can be specified.
+ The following options are available:</p>
+ <taglist>
+ <tag><c>no_src</c></tag>
+ <item><p>The HTML version of the test suite source code is not
+ generated during the test run (and is consequently not available
+ in the log file system).</p></item>
+ <tag><c>no_nl</c></tag>
+ <item><p><c>Common Test</c> does not add a newline character <c>(\n)</c>
+ to the end of an output string that it receives from a call to, for example,
+ <c>io:format/2</c>, and which it prints to the test case log.</p></item>
+ </taglist>
+
<p>For example, if a test is started with:</p>
<p><c>$ ct_run -suite my_SUITE -logopts no_src</c></p>
<p>then printouts during the test made by successive calls to <c>io:format("x")</c>,
- will appear in the test case log as:</p>
+ appears in the test case log as:</p>
<p><c>xxx</c></p>
- <p>instead of each <c>x</c> printed on a new line, which is the default behaviour.</p>
+ <p>instead of each <c>x</c> printed on a new line, which is the default behavior.</p>
</section>
<section>
<marker id="table_sorting"></marker>
- <title>Sorting HTML table columns</title>
- <p>By clicking the name in the column header of any table (e.g. "Ok", "Case", "Time", etc),
- the table rows are sorted in whatever order makes sense for the type of value (e.g.
- numerical for "Ok" or "Time", and alphabetical for "Case"). The sorting is performed
- by means of JavaScript code, automatically inserted into the HTML log files. Common Test
- uses the <url href="http://jquery.com">jQuery</url> library and the
- <url href="http://tablesorter.com">tablesorter</url> plugin, with customized sorting
- functions, for this implementation.</p>
+ <title>Sorting HTML Table Columns</title>
+ <p>By clicking the name in the column header of any table
+ (for example, "Ok", "Case", "Time", and so on), the table rows are sorted
+ in whatever order makes sense for the type of value (for example,
+ numerical for "Ok" or "Time", and alphabetical for "Case"). The sorting is
+ performed through JavaScript code, automatically inserted into the HTML
+ log files. <c>Common Test</c> uses the <url href="http://jquery.com">jQuery</url>
+ library and the
+ <url href="http://tablesorter.com">tablesorter</url> plugin,
+ with customized sorting functions, for this implementation.</p>
</section>
<section>
<title>The Unexpected I/O Log</title>
- <p>On the test suites overview page you find a link to the Unexpected I/O Log.
- In this log, Common Test saves printouts made with
- <c>ct:log/2</c> and <c>ct:pal/2</c>, as well as captured system error- and
- progress reports, that cannot be associated with particular test cases and
- therefore cannot be written to individual test case log files. This happens e.g.
- if a log printout is made from an external process (not a test case process),
- or if an error- or progress report comes in, during a short interval while Common
- Test is not executing a test case or configuration function, <em>or</em> while
- Common Test is currently executing a parallell test case group.</p>
+ <p>The test suites overview page includes a link to the Unexpected I/O Log.
+ In this log, <c>Common Test</c> saves printouts made with
+ <seealso marker="ct#log-2"><c>ct:log/2</c></seealso> and
+ <seealso marker="ct#pal-2"><c>ct:pal/2</c></seealso>, as well as captured system
+ error- and progress reports, which cannot be associated with particular test cases and
+ therefore cannot be written to individual test case log files. This occurs,
+ for example, if a log printout is made from an external process (not a test
+ case process), <em>or</em> if an error- or progress report comes in, during a short
+ interval while <c>Common Test</c> is not executing a test case or configuration
+ function, <em>or</em> while <c>Common Test</c> is currently executing a parallel
+ test case group.</p>
</section>
<section>
<marker id="pre_post_test_io_log"></marker>
<title>The Pre- and Post Test I/O Log</title>
- <p>On the Common Test Framework Log page you find links to the so called
- Pre- and Post Test I/O Log. In this log, Common Test saves printouts made with
- <c>ct:log/2</c> and <c>ct:pal/2</c>, as well as captured system error-
- and progress reports, that take place before - and after - the actual test run.
+ <p>The <c>Common Test</c> Framework Log page includes links to the
+ Pre- and Post Test I/O Log. In this log, <c>Common Test</c> saves printouts made
+ with <c>ct:log/2</c> and <c>ct:pal/2</c>, as well as captured system error-
+ and progress reports, which take place before, and after, the test run.
Examples of this are printouts from a CT hook init- or terminate function, or
progress reports generated when an OTP application is started from a CT hook
- init function. Another example is an error report generated due to
+ init function. Another example is an error report generated because of
a failure when an external application is stopped from a CT hook terminate function.
All information in these examples ends up in the Pre- and Post Test I/O Log.
For more information on how to synchronize test runs with external user
- applications, please see the
+ applications, see section
<seealso marker="ct_hooks_chapter#synchronizing">Synchronizing</seealso>
- section in the Common Test Hooks chapter.</p>
- <p>Note that logging to file with <c>ct:log/2</c> or <c>ct:pal/2</c>
- only works when Common Test is running. Printouts with <c>ct:pal/2</c>
- are however always displayed on screen.</p>
+ in section Common Test Hooks.</p>
+ <note><p>Logging to file with <c>ct:log/2</c> or <c>ct:pal/2</c>
+ only works when <c>Common Test</c> is running. Printouts with <c>ct:pal/2</c>
+ are however always displayed on screen.</p></note>
</section>
</section>
<section>
<marker id="html_stylesheet"></marker>
<title>HTML Style Sheets</title>
- <p>Common Test uses an HTML Style Sheet (CSS file) to control the look of
- the HTML log files generated during test runs. If, for some reason, the
- log files are not displayed correctly in the browser of your
- choice, or you prefer a more primitive ("pre Common Test v1.6") look
- of the logs, use the start flag/option:</p>
- <pre>basic_html</pre>
- <p>This disables the use of Style Sheets, as well as JavaScripts (see
- table sorting above).</p>
+ <p><c>Common Test</c> uses an HTML Style Sheet (CSS file) to control the look of
+ the HTML log files generated during test runs. If the log files are not
+ displayed correctly in the browser of your choice, or you prefer a more
+ primitive ("pre <c>Common Test</c> v1.6") look of the logs, use the start
+ flag/option:</p>
+ <pre>
+ basic_html</pre>
+ <p>This disables the use of style sheets and JavaScripts (see
+ <seealso marker="#table_sorting">Sorting HTML Table Columns</seealso>).</p>
- <p>Common Test includes an <em>optional</em> feature to allow
+ <p><c>Common Test</c> includes an <em>optional</em> feature to allow
user HTML style sheets for customizing printouts. The
functions in <c>ct</c> that print to a test case HTML log
file (<c>log/3</c> and <c>pal/3</c>) accept <c>Category</c>
- as first argument. With this argument it's possible to
- specify a category that can be mapped to a selector in a CSS
- definition. This is useful especially for coloring text
+ as first argument. With this argument a category can be specified
+ that can be mapped to a selector in a CSS
+ definition. This is useful, especially for coloring text
differently depending on the type of (or reason for) the
printout. Say you want one color for test system
configuration information, a different one for test system
- state information and finally one for errors detected by the
- test case functions. The corresponding style sheet may
- look like this:</p>
+ state information, and finally one for errors detected by the
+ test case functions. The corresponding style sheet can
+ look as follows:</p>
<pre>
- div.sys_config { background:blue; color:white }
- div.sys_state { background:yellow; color:black }
- div.error { background:red; color:white }</pre>
+ div.sys_config { background:blue; color:white }
+ div.sys_state { background:yellow; color:black }
+ div.error { background:red; color:white }</pre>
- <p>To install the CSS file (Common Test inlines the definition in the
- HTML code), the name may be provided when executing <c>ct_run</c>.
- Example:</p>
+ <p>To install the CSS file (<c>Common Test</c> inlines the definition in the
+ HTML code), the name can be provided when executing <c>ct_run</c>.</p>
+ <p><em>Example:</em></p>
<pre>
- $ ct_run -dir $TEST/prog -stylesheet $TEST/styles/test_categories.css</pre>
+ $ ct_run -dir $TEST/prog -stylesheet $TEST/styles/test_categories.css</pre>
- <p>Categories in a CSS file installed with the <c>-stylesheet</c> flag
+ <p>Categories in a CSS file installed with flag <c>-stylesheet</c>
are on a global test level in the sense that they can be used in any
- suite which is part of the test run.</p>
+ suite that is part of the test run.</p>
- <p>It is also possible to install style sheets on a per suite and
- per test case basis. Example:</p>
+ <p>Style sheets can also be installed on a per suite and
+ per test case basis.</p>
+ <p><em>Example:</em></p>
<pre>
- -module(my_SUITE).
- ...
- suite() -> [..., {stylesheet,"suite_categories.css"}, ...].
- ...
- my_testcase(_) ->
- ...
- ct:log(sys_config, "Test node version: ~p", [VersionInfo]),
- ...
- ct:log(sys_state, "Connections: ~p", [ConnectionInfo]),
- ...
- ct:pal(error, "Error ~p detected! Info: ~p", [SomeFault,ErrorInfo]),
- ct:fail(SomeFault).</pre>
+ -module(my_SUITE).
+ ...
+ suite() -> [..., {stylesheet,"suite_categories.css"}, ...].
+ ...
+ my_testcase(_) ->
+ ...
+ ct:log(sys_config, "Test node version: ~p", [VersionInfo]),
+ ...
+ ct:log(sys_state, "Connections: ~p", [ConnectionInfo]),
+ ...
+ ct:pal(error, "Error ~p detected! Info: ~p", [SomeFault,ErrorInfo]),
+ ct:fail(SomeFault).</pre>
<p>If the style sheet is installed as in this example, the categories are
private to the suite in question. They can be used by all test cases in the
- suite, but can not be used by other suites. A suite private style sheet,
- if specified, will be used in favour of a global style sheet (one specified
- with the <c>-stylesheet</c> flag). A stylesheet tuple (as returned by <c>suite/0</c>
- above) can also be returned from a test case info function. In this case the
+ suite, but cannot be used by other suites. A suite private style sheet,
+ if specified, is used in favor of a global style sheet (one specified
+ with flag <c>-stylesheet</c>). A stylesheet tuple (as returned by <c>suite/0</c>
+ above) can also be returned from a test case information function. In this case the
categories specified in the style sheet can only be used in that particular
- test case. A test case private style sheet is used in favour of a suite or
+ test case. A test case private style sheet is used in favor of a suite or
global level style sheet.
</p>
<p>In a tuple <c>{stylesheet,CSSFile}</c>, if <c>CSSFile</c> is specified
- with a path, e.g. <c>"$TEST/styles/categories.css"</c>, this full
- name will be used to locate the file. If only the file name is specified
- however, e.g. "categories.css", then the CSS file is assumed to be located
- in the data directory, <c>data_dir</c>, of the suite. The latter usage is
- recommended since it is portable compared to hard coding path names in the
- suite!</p>
-
- <p>The <c>Category</c> argument in the example above may have the
+ with a path, for example, <c>"$TEST/styles/categories.css"</c>, this full
+ name is used to locate the file. However, if only the file name is specified,
+ for example, <c>categories.css</c>, the CSS file is assumed to be located
+ in the data directory, <c>data_dir</c>, of the suite. The latter use is
+ recommended, as it is portable compared to hard coding path names in the
+ suite.</p>
+
+ <p>Argument <c>Category</c> in the previous example can have the
value (atom) <c>sys_config</c> (white on blue), <c>sys_state</c>
- (black on yellow) or <c>error</c> (white on red).</p>
+ (black on yellow), or <c>error</c> (white on red).</p>
</section>
<section>
<marker id="repeating_tests"></marker>
- <title>Repeating tests</title>
- <p>You can order Common Test to repeat the tests you specify. You can choose
- to repeat tests a certain number of times, repeat tests for a specific period of time,
+ <title>Repeating Tests</title>
+ <p>You can order <c>Common Test</c> to repeat the tests you specify. You can choose
+ to repeat tests a number of times, repeat tests for a specific period of time,
or repeat tests until a particular stop time is reached. If repetition is controlled by
- means of time, it is also possible to specify what action Common Test should
- take upon timeout. Either Common Test performs all tests in the current run before stopping,
- or it stops as soon as the current test job is finished. Repetition can be activated by
- means of <c>ct_run</c> start flags, or tuples in the <c>ct:run:test/1</c>
- option list argument. The flags (options in parenthesis) are:</p>
- <list>
- <item><c>-repeat N ({repeat,N})</c>, where <c>N</c> is a positive integer.</item>
- <item><c>-duration DurTime ({duration,DurTime})</c>, where <c>DurTime</c> is the duration, see below.</item>
- <item><c>-until StopTime ({until,StopTime})</c>, where <c>StopTime</c> is finish time, see below.</item>
+ time, an action for <c>Common Test</c> to take upon time-out can be specified.
+ Either <c>Common Test</c> performs all tests in the current run
+ before stopping, or it stops when the current test job is finished. Repetition
+ can be activated by <c>ct_run</c> start flags, or tuples in the <c>ct:run:test/1</c>
+ option list argument. The flags (options in parentheses) are the following:</p>
+ <list type="bulleted">
+ <item><c>-repeat N ({repeat,N})</c>, where <c>N</c> is a positive integer</item>
+ <item><c>-duration DurTime ({duration,DurTime})</c>, where <c>DurTime</c> is the duration</item>
+ <item><c>-until StopTime ({until,StopTime})</c>, where <c>StopTime</c> is finish time</item>
<item><c>-force_stop ({force_stop,true})</c></item>
<item><c>-force_stop skip_rest ({force_stop,skip_rest})</c></item>
</list>
- <p>The duration time, <c>DurTime</c>, is specified as <c>HHMMSS</c>. Example:
- <c>-duration 012030</c> or <c>{duration,"012030"}</c>, means the tests will
- be executed and (if time allows) repeated, until timeout occurs after 1 h, 20 min
- and 30 secs.
- <c>StopTime</c> can be specified as <c>HHMMSS</c> and is then interpreted as a time today
- (or possibly tomorrow). <c>StopTime</c> can also be specified as <c>YYMoMoDDHHMMSS</c>.
- Example: <c>-until 071001120000</c> or <c>{until,"071001120000"}</c>, which means the tests
- will be executed and (if time allows) repeated, until 12 o'clock on the 1st of Oct 2007.</p>
-
- <p>When timeout occurs, Common Test will never abort the ongoing test case, since
- this might leave the system under test in an undefined, and possibly bad, state.
- Instead Common Test will by default finish the current test
- run before stopping. If the <c>force_stop</c> flag is
- given, Common Test will stop as soon as the current test job
- is finished, and if the <c>force_stop</c> flag is given with
- <c>skip_rest</c> Common Test will only complete the current
- test case and skip the rest of the tests in the test job.
- Note that since Common Test always finishes off at least the
- current test case,
- the time specified with <c>duration</c> or <c>until</c> is never definitive!</p>
-
- <p>Log files from every single repeated test run is saved in normal Common Test fashion (see above).
- Common Test may later support an optional feature to only store the last (and possibly
- the first) set of logs of repeated test runs, but for now the user must be careful not
- to run out of disk space if tests are repeated during long periods of time.</p>
-
- <p>Note that for each test run that is part of a repeated session, information about the
- particular test run is printed in the Common Test Framework Log. There you can read
- the repetition number, remaining time, etc.</p>
-
- <p>Example 1:</p>
+ <taglist>
+ <tag><c>DurTime</c></tag>
+ <item><p>The duration time is specified as <c>HHMMSS</c>, for example, <c>-duration 012030</c>
+ or <c>{duration,"012030"}</c></p>, which means that the tests are executed and
+ (if time allows) repeated until time-out occurs after 1 hour, 20 minutes, and 30 seconds.
+ </item>
+ <tag><c>StopTime</c></tag>
+ <item><p>The finish time can be specified as <c>HHMMSS</c> and is then interpreted as a
+ time today (or possibly tomorrow), but can also be specified as <c>YYMoMoDDHHMMSS</c>,
+ for example, <c>-until 071001120000</c> or <c>{until,"071001120000"}</c>. This means
+ that the tests are executed and (if time allows) repeated, until 12 o'clock on the 1st
+ of October 2007.</p>
+ </item>
+ </taglist>
+
+ <p>When time-out occurs, <c>Common Test</c> never aborts the ongoing test case,
+ as this can leave the SUT in an undefined, and possibly bad, state.
+ Instead <c>Common Test</c>, by default, finishes the current test
+ run before stopping. If flag <c>force_stop</c> is
+ specified, <c>Common Test</c> stops when the current test job
+ is finished. If flag <c>force_stop</c> is specified with
+ <c>skip_rest</c>, <c>Common Test</c> only completes the current
+ test case and skips the remaining tests in the test job.</p>
+ <note><p>As <c>Common Test</c> always finishes at least the current test case,
+ the time specified with <c>duration</c> or <c>until</c> is never definitive.</p></note>
+
+ <p>Log files from every repeated test run is saved in normal <c>Common Test</c>
+ fashion (described earlier).</p>
+ <p><c>Common Test</c> might later support an optional feature to only store the last (and possibly
+ the first) set of logs of repeated test runs, but for now the user must be careful not
+ to run out of disk space if tests are repeated during long periods of time.</p>
+
+ <p>For each test run that is part of a repeated session, information about the
+ particular test run is printed in the <c>Common Test</c> Framework Log. The information
+ includes the repetition number, remaining time, and so on.</p>
+
+ <p><em>Example 1:</em></p>
<pre>
- $ ct_run -dir $TEST_ROOT/to1 $TEST_ROOT/to2 -duration 001000 -force_stop</pre>
- <p>Here the suites in test directory to1, followed by the suites in to2, will be executed
- in one test run. A timeout event will occur after 10 minutes. As long as there is time
- left, Common Test will repeat the test run (i.e. starting over with the to1 test).
- When the timeout occurs, Common Test will stop as soon as the current job is finished
- (because of the <c>force_stop</c> flag). As a result, the specified test run might be
- aborted after the to1 test and before the to2 test.</p>
-
- <p>Example 2:</p>
+ $ ct_run -dir $TEST_ROOT/to1 $TEST_ROOT/to2 -duration 001000 -force_stop</pre>
+
+ <p>Here, the suites in test directory <c>to1</c>, followed by the suites in <c>to2</c>, are
+ executed in one test run. A time-out event occurs after 10 minutes. As long as there is
+ time left, <c>Common Test</c> repeats the test run (that is, starting over with test <c>to1</c>).
+ After time-out, <c>Common Test</c> stops when the current job is finished
+ (because of flag <c>force_stop</c>). As a result, the specified test run can be
+ aborted after test <c>to1</c> and before test <c>to2</c>.</p>
+
+ <p><em>Example 2:</em></p>
<pre>
- $ ct_run -dir $TEST_ROOT/to1 $TEST_ROOT/to2 -duration 001000 -forces_stop skip_rest</pre>
- <p>Here the same test run as in Example 1, but with the
- <c>force_stop</c> flag set to <c>skip_rest</c>. If the timeout
- occurs while executing tests in directory to1, the rest of the
- test cases in to1 will be skipped and then the test will be
- aborted without running the tests in to2 another time. If the
- timeout occurs while executing tests in directory to2, then the
- rest of the test cases in to2 will be skipped and then the test
- will be aborted.</p>
-
- <p>Example 3:</p>
+ $ ct_run -dir $TEST_ROOT/to1 $TEST_ROOT/to2 -duration 001000 -forces_stop skip_rest</pre>
+
+ <p>Here, the same tests as in Example 1 are run, but with flag <c>force_stop</c> set to
+ <c>skip_rest</c>. If time-out occurs while executing tests in directory <c>to1</c>,
+ the remaining test cases in <c>to1</c> are skipped and the test is aborted without
+ running the tests in <c>to2</c> another time. If time-out occurs while executing
+ tests in directory <c>to2</c>, the remaining test cases in <c>to2</c> are skipped and
+ the test is aborted.</p>
+
+ <p><em>Example 3:</em></p>
<pre>
- $ date
- Fri Sep 28 15:00:00 MEST 2007
-
- $ ct_run -dir $TEST_ROOT/to1 $TEST_ROOT/to2 -until 160000</pre>
- <p>Here the same test run as in the example above will be executed (and possibly repeated).
- In this example, however, the timeout will occur after 1 hour and when that happens,
- Common Test will finish the entire test run before stopping (i.e. the to1 and to2 test
- will always both be executed in the same test run).</p>
+ $ date
+ Fri Sep 28 15:00:00 MEST 2007
+
+ $ ct_run -dir $TEST_ROOT/to1 $TEST_ROOT/to2 -until 160000</pre>
+
+ <p>Here, the same test run as in the previous examples are executed (and possibly repeated).
+ However, when the time-out occurs, after 1 hour, <c>Common Test</c> finishes the entire
+ test run before stopping (that is, both <c>to1</c> and <c>to2</c> are always executed in
+ the same test run).</p>
- <p>Example 4:</p>
+ <p><em>Example 4:</em></p>
<pre>
- $ ct_run -dir $TEST_ROOT/to1 $TEST_ROOT/to2 -repeat 5</pre>
- <p>Here the test run, including both the to1 and the to2 test, will be repeated 5 times.</p>
+ $ ct_run -dir $TEST_ROOT/to1 $TEST_ROOT/to2 -repeat 5</pre>
+
+ <p>Here, the test run, including both the <c>to1</c> and the <c>to2</c> test, is repeated
+ five times.</p>
- <note><p>This feature should not be confused with the <c>repeat</c> property of a test
+ <note><p>Do not confuse this feature with the <c>repeat</c> property of a test
case group. The options described here are used to repeat execution of entire test runs,
while the <c>repeat</c> property of a test case group makes it possible to repeat
execution of sets of test cases within a suite. For more information about the latter,
- see the <seealso marker="write_test_chapter#test_case_groups">Writing Test Suites</seealso>
- chapter.</p></note>
+ see section <seealso marker="write_test_chapter#test_case_groups">Test Case Groups </seealso>
+ in section Writing Test Suites.</p></note>
</section>
<section>
<marker id="silent_connections"></marker>
<title>Silent Connections</title>
- <p>The protocol handling processes in Common Test, implemented by ct_telnet,
- ct_ssh, ct_ftp etc, do verbose printing to the test case logs. This can be switched off
- by means of the <c>-silent_connections</c> flag:</p>
+ <p>The protocol handling processes in <c>Common Test</c>, implemented by <c>ct_telnet</c>,
+ <c>ct_ssh</c>, <c>ct_ftp</c>, and so on, do verbose printing to the test case logs.
+ This can be switched off with flag <c>-silent_connections</c>:</p>
<pre>
- ct_run -silent_connections [conn_types]
- </pre>
+ ct_run -silent_connections [conn_types]</pre>
- <p>where <c>conn_types</c> specifies <c>ssh, telnet, ftp, rpc</c> and/or <c>snmp</c>.</p>
+ <p>Here, <c>conn_types</c> specifies SSH, Telnet, FTP, RPC, and/or SNMP.</p>
- <p>Example:</p>
+ <p><em>Example 1:</em></p>
<pre>
- ct_run ... -silent_connections ssh telnet</pre>
- <p>switches off logging for ssh and telnet connections.</p>
+ ct_run ... -silent_connections ssh telnet</pre>
+ <p>This switches off logging for SSH and Telnet connections.</p>
+
+ <p><em>Example 2:</em></p>
<pre>
- ct_run ... -silent_connections</pre>
- <p>switches off logging for all connection types.</p>
+ ct_run ... -silent_connections</pre>
+ <p>This switches off logging for all connection types.</p>
- <p>Fatal communication error and reconnection attempts will always be printed even
- if logging has been suppressed for the connection type in question. However, operations
- such as sending and receiving data will be performed silently.</p>
+ <p>Fatal communication error and reconnection attempts are always printed, even if
+ logging has been suppressed for the connection type in question. However, operations
+ such as sending and receiving data are performed silently.</p>
- <p>It is possible to also specify <c>silent_connections</c> in a test suite. This is
+ <p><c>silent_connections</c> can also be specified in a test suite. This is
accomplished by returning a tuple, <c>{silent_connections,ConnTypes}</c>, in the
- <c>suite/0</c> or test case info list. If <c>ConnTypes</c> is a list of atoms
- (<c>ssh, telnet, ftp, rpc</c> and/or <c>snmp</c>), output for any corresponding connections
- will be suppressed. Full logging is per default enabled for any connection of type not
+ <c>suite/0</c> or test case information list. If <c>ConnTypes</c> is a list of atoms
+ (SSH, Telnet, FTP, RPC and/or SNMP), output for any corresponding connections
+ are suppressed. Full logging is by default enabled for any connection of type not
specified in <c>ConnTypes</c>. Hence, if <c>ConnTypes</c> is the empty list, logging
is enabled for all connections.</p>
- <p>Example:</p>
+ <p><em>Example 3:</em></p>
<pre>
-
- -module(my_SUITE).
+ -module(my_SUITE).
- suite() -> [..., {silent_connections,[telnet,ssh]}, ...].
+ suite() -> [..., {silent_connections,[telnet,ssh]}, ...].
- ...
+ ...
- my_testcase1() ->
- [{silent_connections,[ssh]}].
+ my_testcase1() ->
+ [{silent_connections,[ssh]}].
- my_testcase1(_) ->
- ...
+ my_testcase1(_) ->
+ ...
- my_testcase2(_) ->
- ...
- </pre>
+ my_testcase2(_) ->
+ ...</pre>
- <p>In this example, <c>suite/0</c> tells Common Test to suppress
- printouts from telnet and ssh connections. This is valid for
+ <p>In this example, <c>suite/0</c> tells <c>Common Test</c> to suppress
+ printouts from Telnet and SSH connections. This is valid for
all test cases. However, <c>my_testcase1/0</c> specifies that
- for this test case, only ssh should be silent. The result is
- that <c>my_testcase1</c> will get telnet info (if any) printed
- in the log, but not ssh info. <c>my_testcase2</c> will get no
- info from either connection printed.</p>
+ for this test case, only SSH is to be silent. The result is
+ that <c>my_testcase1</c> gets Telnet information (if any) printed
+ in the log, but not SSH information. <c>my_testcase2</c> gets no
+ information from either connection printed.</p>
- <p><c>silent_connections</c> may also be specified with a term
+ <p><c>silent_connections</c> can also be specified with a term
in a test specification
- (see <seealso marker="run_test_chapter#test_specifications">Test
- Specifications</seealso>). Connections provided with the
- <c>silent_connections</c> start flag/option, will be merged with
- any connections listed in the test specification.</p>
+ (see section <seealso marker="run_test_chapter#test_specifications">Test
+ Specifications</seealso> in section Running Tests and Analyzing Results).
+ Connections provided with start flag/option <c>silent_connections</c>
+ are merged with any connections listed in the test specification.</p>
- <p>The <c>silent_connections</c> start flag/option and test
- specification term, overrides any settings made by the info functions
+ <p>Start flag/option <c>silent_connections</c> and the test
+ specification term override any settings made by the information functions
inside the test suite.</p>
- <note><p>Note that in the current Common Test version, the
- <c>silent_connections</c> feature only works for telnet
- and ssh connections! Support for other connection types will be added
- in future Common Test versions.</p></note>
+ <note><p>In the current <c>Common Test</c> version, the
+ <c>silent_connections</c> feature only works for Telnet
+ and SSH connections. Support for other connection types can be added
+ in future <c>Common Test</c> versions.</p></note>
</section>
</chapter>
diff --git a/lib/common_test/doc/src/test_structure_chapter.xml b/lib/common_test/doc/src/test_structure_chapter.xml
index d5b92b163f..8076244928 100644
--- a/lib/common_test/doc/src/test_structure_chapter.xml
+++ b/lib/common_test/doc/src/test_structure_chapter.xml
@@ -31,167 +31,167 @@
</header>
<section>
- <title>Test structure</title>
+ <title>General</title>
<p>A test is performed by running one or more test suites. A test suite
- consists of test cases (as well as configuration functions and info
- functions). Test cases may be grouped in so called test case groups.
+ consists of test cases, configuration functions, and information
+ functions. Test cases can be grouped in so called test case groups.
A test suite is an Erlang module and test cases are implemented as
Erlang functions. Test suites are stored in test directories.</p>
</section>
<section>
- <title>Skipping test cases</title>
+ <marker id="skipping_test_cases"></marker>
+ <title>Skipping Test Cases</title>
- <p>It is possible to skip certain test cases, for example if you
- know beforehand that a specific test case fails. This might be
- functionality which isn't yet implemented, a bug that is known but
- not yet fixed or some functionality which doesn't work or isn't
+ <p>Certain test cases can be skipped, for example, if you
+ know beforehand that a specific test case fails. The reason can be
+ functionality that is not yet implemented, a bug that is known but
+ not yet fixed, or some functionality that does not work or is not
applicable on a specific platform.</p>
- <p>There are several different ways to state that one or more
- test cases should be skipped:</p>
- <list>
+ <p>Test cases can be skipped in the following ways:</p>
+ <list type="bulleted">
<item>Using <c>skip_suites</c> and <c>skip_cases</c>
terms in
<seealso marker="run_test_chapter#test_specifications">test specifications</seealso>.
</item>
- <item>Returning <c>{skip,Reason}</c> from the
- <c>init_per_testcase/2</c> or <c>init_per_suite/1</c> functions.</item>
+ <item>Returning <c>{skip,Reason}</c> from function
+ <seealso marker="common_test#Module:init_per_testcase-2"><c>init_per_testcase/2</c></seealso> or
+ <seealso marker="common_test#Module:init_per_suite-1"><c>init_per_suite/1</c></seealso>.</item>
<item>Returning <c>{skip,Reason}</c> from the execution clause
- of the test case.</item>
+ of the test case. The execution clause is called, so the author
+ must ensure that the test case does not run.</item>
</list>
- <p>The latter of course means that the execution clause is
- actually called, so the author must make sure that the test case
- does not run.</p>
-
- <p>When a test case is skipped, it will be noted as <c>SKIPPED</c>
+ <p>When a test case is skipped, it is noted as <c>SKIPPED</c>
in the HTML log.</p>
</section>
<section>
- <title>Definition of terms</title>
+ <title>Definition of Terms</title>
<taglist>
- <tag><em>Auto skipped test case</em></tag>
+ <tag><em>Auto-skipped test case</em></tag>
<item>
- When a configuration function fails (i.e. terminates unexpectedly),
- the test cases that depend on the configuration function will be
- skipped automatically by Common Test. The status of the test cases
- is then "auto skipped". Test cases are also auto skipped by
- Common Test if required configuration data is not available at
- runtime.
+ <p>When a configuration function fails (that is, terminates unexpectedly),
+ the test cases depending on the configuration function are
+ skipped automatically by <c>Common Test</c>. The status of the test cases
+ is then "auto-skipped". Test cases are also "auto-skipped" by
+ <c>Common Test</c> if the required configuration data is unavailable at
+ runtime.</p>
</item>
<tag><em>Configuration function</em></tag>
<item>
- A function in a test suite that is meant to be used for
+ <p>A function in a test suite that is meant to be used for
setting up, cleaning up, and/or verifying the state and
- environment on the SUT (System Under Test) and/or the Common Test
+ environment on the System Under Test (SUT) and/or the <c>Common Test</c>
host node, so that a test case (or a set of test cases) can
- execute correctly.
+ execute correctly.</p>
</item>
<tag><em>Configuration file</em></tag>
<item>
- A file that contains data related to a test and/or an SUT
- (System Under Test), e.g. protocol server addresses, client
- login details, hardware interface addresses, etc - any data
- that should be handled as variable in the suite and not
- be hardcoded.
+ <p>A file containing data related to a test and/or an SUT,
+ for example, protocol server addresses, client
+ login details, and hardware interface addresses. That is, any data
+ that is to be handled as variable in the suite and not
+ be hard-coded.</p>
</item>
<tag><em>Configuration variable</em></tag>
<item>
- A name (an Erlang atom) associated with a data value read from
- a configuration file.
+ <p>A name (an Erlang atom) associated with a data value read from
+ a configuration file.</p>
</item>
- <tag><em>data_dir</em></tag>
+ <tag><c>data_dir</c></tag>
<item>
- Data directory for a test suite. This directory contains
- any files used by the test suite, e.g. additional Erlang
- modules, binaries or data files.
+ <p>Data directory for a test suite. This directory contains
+ any files used by the test suite, for example, extra Erlang
+ modules, binaries, or data files.</p>
</item>
- <tag><em>Info function</em></tag>
+ <tag><em>Information function</em></tag>
<item>
- A function in a test suite that returns a list of properties
- (read by the Common Test server) that describes the conditions
- for executing the test cases in the suite.
+ <p>A function in a test suite that returns a list of properties
+ (read by the <c>Common Test</c> server) that describes the conditions
+ for executing the test cases in the suite.</p>
</item>
<tag><em>Major log file</em></tag>
<item>
- An overview and summary log file for one or more test suites.
+ <p>An overview and summary log file for one or more test suites.</p>
</item>
<tag><em>Minor log file</em></tag>
<item>
- A log file for one particular test case. Also called the
- test case log file.
+ <p>A log file for one particular test case. Also called the
+ test case log file.</p>
</item>
- <tag><em>priv_dir</em></tag>
+
+ <tag><c>priv_dir</c></tag>
<item>
- Private directory for a test suite. This directory should
- be used when the test suite needs to write to files.
+ <p>Private directory for a test suite. This directory is to
+ be used when the test suite needs to write to files.</p>
</item>
- <tag><em>ct_run</em></tag>
+ <tag><c>ct_run</c></tag>
<item>
- The name of an executable program that may be
+ <p>The name of an executable program that can be
used as an interface for specifying and running
- tests with Common Test.
+ tests with <c>Common Test</c>.</p>
</item>
<tag><em>Test case</em></tag>
<item>
- A single test included in a test suite. A test case is
- implemented as a function in a test suite module.
+ <p>A single test included in a test suite. A test case is
+ implemented as a function in a test suite module.</p>
</item>
<tag><em>Test case group</em></tag>
<item>
- A set of test cases that share configuration functions and
- execution properties. The execution properties specify whether
- the test cases in the group should be executed in random order,
- in parallel, in sequence, and if the execution of the group
- should be repeated. Test case groups may also be nested (i.e. a
- group may, besides test cases, contain sub-groups).
+ <p>A set of test cases sharing configuration functions and
+ execution properties. The execution properties specify if
+ the test cases in the group are to be executed in random order,
+ in parallel, or in sequence, and if the execution of the group
+ is be repeated. Test case groups can also be nested. That is,
+ a group can, besides test cases, contain subgroups.</p>
</item>
<tag><em>Test suite</em></tag>
<item>
- An erlang module containing a collection of test cases for
- a specific functional area.
+ <p>An Erlang module containing a collection of test cases for
+ a specific functional area.</p>
</item>
<tag><em>Test directory</em></tag>
<item>
- A directory that contains one or more test suite modules, i.e.
- a group of test suites.
+ <p>A directory containing one or more test suite modules,
+ that is, a group of test suites.</p>
</item>
- <tag><em>The Config argument</em></tag>
+ <tag><em>Argument</em> <c>Config</c></tag>
<item>
- A list of key-value tuples (i.e. a property list) containing
+ <p>A list of key-value tuples (that is, a property list) containing
runtime configuration data passed from the configuration
- functions to the test cases.
+ functions to the test cases.</p>
</item>
- <tag><em>User skipped test case</em></tag>
+ <tag><em>User-skipped test case</em></tag>
<item>
- This is the status of a test case that has been explicitly
- skipped in any of the ways described in the "Skipping test cases"
- section above.
+ <p>The status of a test case explicitly skipped in any of
+ the ways described in section
+ <seealso marker="#skipping_test_cases">Skipping Test Cases</seealso>.
+ </p>
</item>
diff --git a/lib/common_test/doc/src/unix_telnet.xml b/lib/common_test/doc/src/unix_telnet.xml
new file mode 100644
index 0000000000..189379c39a
--- /dev/null
+++ b/lib/common_test/doc/src/unix_telnet.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2010</year><year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>unix_telnet</title>
+ <prepared></prepared>
+ <responsible></responsible>
+ <docno></docno>
+ <approved></approved>
+ <checked></checked>
+ <date></date>
+ <rev>A</rev>
+ <file>unix_telnet.xml</file>
+ </header>
+ <module>unix_telnet</module>
+ <modulesummary>Callback module for ct_telnet, for connecting to a Telnet
+ server on a UNIX host.</modulesummary>
+
+ <description>
+
+ <p>Callback module for
+ <seealso marker="ct_telnet"><c>ct_telnet</c></seealso>,
+ for connecting to a Telnet server on a UNIX host.</p>
+
+ <p>It requires the following entry in the configuration file:</p>
+
+ <pre>
+ {unix,[{telnet,HostNameOrIpAddress},
+ {port,PortNum}, % optional
+ {username,UserName},
+ {password,Password},
+ {keep_alive,Bool}]}. % optional</pre>
+
+ <p>To communicate through Telnet to the host specified by
+ <c>HostNameOrIpAddress</c>, use the interface functions in
+ <seealso marker="ct_telnet"><c>ct_telnet</c></seealso>, for example,
+ <c>open(Name)</c> and <c>cmd(Name,Cmd)</c>.</p>
+
+ <p><c>Name</c> is the name you allocated to the Unix host in your
+ <c>require</c> statement, for example:</p>
+
+ <pre>
+ suite() -&gt; [{require,Name,{unix,[telnet]}}].</pre>
+
+ <p>or</p>
+
+ <pre>
+ ct:require(Name,{unix,[telnet]}).</pre>
+
+ <p>The "keep alive" activity (that is, that <c>Common Test</c> sends NOP
+ to the server every 10 seconds if the connection is idle) can be
+ enabled or disabled for one particular connection as described here.
+ It can be disabled for all connections using <c>telnet_settings</c>
+ (see <seealso marker="ct_telnet"><c>ct_telnet</c></seealso>).</p>
+
+ <p>The <c>{port,PortNum}</c> tuple is optional and if omitted, default
+ Telnet port 23 is used. Also the <c>keep_alive</c> tuple is optional,
+ and the value defauls to <c>true</c> (enabled).</p>
+ </description>
+
+ <funcs>
+ <func>
+ <name>connect(ConnName, Ip, Port, Timeout, KeepAlive, Extra) -&gt; {ok, Handle} | {error, Reason}</name>
+ <fsummary>Callback for ct_telnet.erl.</fsummary>
+ <type>
+ <v>ConnName = target_name()</v>
+ <v>Ip = string() | {integer(), integer(), integer(), integer()}</v>
+ <v>Port = integer()</v>
+ <v>Timeout = integer()</v>
+ <v>KeepAlive = bool()</v>
+ <v>Extra = target_name() | {Username, Password}</v>
+ <v>Username = string()</v>
+ <v>Password = string()</v>
+ <v>Handle = handle()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc><marker id="connect-6"/>
+ <p>Callback for <c>ct_telnet.erl</c>.</p>
+
+ <p>Setup Telnet connection to a Unix host.</p>
+
+ <p>For <c>target_name()</c>, see
+ <seealso marker="ct"><c>ct</c></seealso>. For <c>handle()</c>, see
+ <seealso marker="ct_telnet"><c>ct_telnet</c></seealso>.</p>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_prompt_regexp() -&gt; PromptRegexp</name>
+ <fsummary>Callback for ct_telnet.erl.</fsummary>
+ <type>
+ <v>PromptRegexp = prompt_regexp()</v>
+ </type>
+ <desc><marker id="get_prompt_regexp-0"/>
+ <p>Callback for <c>ct_telnet.erl</c>.</p>
+
+ <p>Returns a suitable <c>regexp</c> string matching common prompts
+ for users on Unix hosts.</p>
+
+ <p>For <c>prompt_regexp()</c>, see
+ <seealso marker="ct_telnet"><c>ct_telnet</c></seealso>.</p>
+ </desc>
+ </func>
+ </funcs>
+
+ <section>
+ <title>See Also</title>
+ <p><seealso marker="ct"><c>ct</c></seealso>,
+ <seealso marker="ct_telnet"><c>ct_telnet</c></seealso></p>
+ </section>
+
+</erlref>
+
+
diff --git a/lib/common_test/doc/src/why_test_chapter.xml b/lib/common_test/doc/src/why_test_chapter.xml
index 15eb1aaed4..ff6000628b 100644
--- a/lib/common_test/doc/src/why_test_chapter.xml
+++ b/lib/common_test/doc/src/why_test_chapter.xml
@@ -22,7 +22,7 @@
</legalnotice>
- <title>Some thoughts about testing</title>
+ <title>Some Thoughts about Testing</title>
<prepared>Siri Hansen</prepared>
<docno></docno>
<date></date>
@@ -34,54 +34,53 @@
<section>
<title>Goals</title>
- <p>It's not possible to prove that a program is correct by
+ <p>It is not possible to prove that a program is correct by
testing. On the contrary, it has been formally proven that it is
impossible to prove programs in general by testing. Theoretical
- program proofs or plain examination of code may be viable options
- for those that wish to certify that a program is correct. The test
+ program proofs or plain examination of code can be viable options
+ for those wishing to certify that a program is correct. The test
server, as it is based on testing, cannot be used for
certification. Its intended use is instead to (cost effectively)
<em>find bugs</em>. A successful test suite is one that reveals a
- bug. If a test suite results in Ok, then we know very little that
- we didn't know before.</p>
+ bug. If a test suite results in OK, then we know very little that
+ we did not know before.</p>
</section>
<section>
- <title>What to test?</title>
+ <title>What to Test</title>
<p>
There are many kinds of test suites. Some concentrate on
calling every function or command (in the documented way) in
a certain interface.
- Some other do the same, but uses all kinds of illegal
- parameters, and verifies that the server stays alive and rejects
+ Some others do the same, but use all kinds of illegal
+ parameters, and verify that the server stays alive and rejects
the requests with reasonable error codes. Some test suites
simulate an application (typically consisting of a few modules of
- an application), some try to do tricky requests in general, some
+ an application), some try to do tricky requests in general, and some
test suites even test internal functions with help of special
- load-modules on target.</p>
+ Load Modules on target.</p>
- <p>Another interesting category of test suites are the ones that
- check that fixed bugs don't reoccur. When a bugfix is introduced,
- a test case that checks for that specific bug should be written
- and submitted to the affected test suite(s).</p>
+ <p>Another interesting category of test suites is the one
+ checking that fixed bugs do not reoccur. When a bugfix is introduced,
+ a test case that checks for that specific bug is written
+ and submitted to the affected test suites.</p>
<p>Aim for finding bugs. Write whatever test that has the highest
probability of finding a bug, now or in the future. Concentrate
- more on the critical parts. Bugs in critical subsystems are a lot
+ more on the critical parts. Bugs in critical subsystems are much
more expensive than others.</p>
<p>Aim for functionality testing rather than implementation
details. Implementation details change quite often, and the test
- suites should be long lived. Often implementation details differ
+ suites are to be long lived. Implementation details often differ
on different platforms and versions. If implementation details
- have to be tested, try to factor them out into separate test
- cases. Later on these test cases may be rewritten, or just
- skipped.</p>
+ must be tested, try to factor them out into separate test
+ cases. These test cases can later be rewritten or skipped.</p>
- <p>Also, aim for testing everything once, no less, no more. It's
- not effective having every test case fail just because one
+ <p>Also, aim for testing everything once, no less, no more. It is
+ not effective having every test case fail only because one
function in the interface changed.</p>
</section>
diff --git a/lib/common_test/doc/src/write_test_chapter.xml b/lib/common_test/doc/src/write_test_chapter.xml
index 1f5650651f..e3811ec4cf 100644
--- a/lib/common_test/doc/src/write_test_chapter.xml
+++ b/lib/common_test/doc/src/write_test_chapter.xml
@@ -32,84 +32,88 @@
<section>
<marker id="intro"></marker>
- <title>Support for test suite authors</title>
+ <title>Support for Test Suite Authors</title>
- <p>The <c>ct</c> module provides the main interface for writing
- test cases. This includes e.g:</p>
+ <p>The <seealso marker="ct"><c>ct</c></seealso> module provides the main
+ interface for writing test cases. This includes for example, the following:</p>
- <list>
+ <list type="bulleted">
<item>Functions for printing and logging</item>
<item>Functions for reading configuration data</item>
<item>Function for terminating a test case with error reason</item>
<item>Function for adding comments to the HTML overview page</item>
</list>
- <p>Please see the reference manual for the <c>ct</c>
- module for details about these functions.</p>
+ <p>For details about these functions, see module <seealso marker="ct"><c>ct</c></seealso>.</p>
- <p>The CT application also includes other modules named
- <c><![CDATA[ct_<component>]]></c> that
+ <p>The <c>Common Test</c> application also includes other modules named
+ <c><![CDATA[ct_<component>]]></c>, which
provide various support, mainly simplified use of communication
- protocols such as rpc, snmp, ftp, telnet, etc.</p>
+ protocols such as RPC, SNMP, FTP, Telnet, and others.</p>
</section>
<section>
- <title>Test suites</title>
+ <title>Test Suites</title>
<p>A test suite is an ordinary Erlang module that contains test
cases. It is recommended that the module has a name on the form
<c>*_SUITE.erl</c>. Otherwise, the directory and auto compilation
- function in CT will not be able to locate it (at least not per default).
+ function in <c>Common Test</c> cannot locate it (at least not by default).
</p>
<p>It is also recommended that the <c>ct.hrl</c> header file is included
in all test suite modules.
</p>
- <p>Each test suite module must export the function <c>all/0</c>
+ <p>Each test suite module must export function
+ <seealso marker="common_test#Module:all-0"><c>all/0</c></seealso>,
which returns the list of all test case groups and test cases
to be executed in that module.
</p>
- <p>The callback functions that the test suite should implement, and
- which will be described in more detail below, are
- all listed in the <seealso marker="common_test">common_test
- reference manual page</seealso>.
+ <p>The callback functions to be implemented by the test suite are
+ all listed in module <seealso marker="common_test">common_test
+ </seealso>. They are also described in more detail later in this User's Guide.
</p>
</section>
<section>
- <title>Init and end per suite</title>
+ <title>Init and End per Suite</title>
- <p>Each test suite module may contain the optional configuration functions
- <c>init_per_suite/1</c> and <c>end_per_suite/1</c>. If the init function
- is defined, so must the end function be.
+ <p>Each test suite module can contain the optional configuration functions
+ <seealso marker="common_test#Module:init_per_suite-1"><c>init_per_suite/1</c></seealso>
+ and <seealso marker="common_test#Module:end_per_suite-1"><c>end_per_suite/1</c></seealso>.
+ If the init function is defined, so must the end function be.
</p>
- <p>If it exists, <c>init_per_suite</c> is called initially before the
- test cases are executed. It typically contains initializations that are
- common for all test cases in the suite, and that are only to be
- performed once. It is recommended to be used for setting up and
- verifying state and environment on the SUT (System Under Test) and/or
- the CT host node, so that the test cases in the suite will execute
- correctly. Examples of initial configuration operations: Opening a connection
- to the SUT, initializing a database, running an installation script, etc.
+ <p>If <c>init_per_suite</c> exists, it is called initially before the
+ test cases are executed. It typically contains initializations common
+ for all test cases in the suite, which are only to be performed once.
+ <c>init_per_suite</c> is recommended for setting up and verifying state
+ and environment on the System Under Test (SUT) or the <c>Common Test</c>
+ host node, or both, so that the test cases in the suite executes correctly.
+ The following are examples of initial configuration operations:
</p>
+ <list type="bulleted">
+ <item>Opening a connection to the SUT</item>
+ <item>Initializing a database</item>
+ <item>Running an installation script</item>
+ </list>
<p><c>end_per_suite</c> is called as the final stage of the test suite execution
(after the last test case has finished). The function is meant to be used
for cleaning up after <c>init_per_suite</c>.
</p>
- <p><c>init_per_suite</c> and <c>end_per_suite</c> will execute on dedicated
+ <p><c>init_per_suite</c> and <c>end_per_suite</c> execute on dedicated
Erlang processes, just like the test cases do. The result of these functions
- is however not included in the test run statistics of successful, failed and
+ is however not included in the test run statistics of successful, failed, and
skipped cases.
</p>
- <p>The argument to <c>init_per_suite</c> is <c>Config</c>, the
+ <p>The argument to <c>init_per_suite</c> is <c>Config</c>, that is, the
same key-value list of runtime configuration data that each test case takes
as input argument. <c>init_per_suite</c> can modify this parameter with
information that the test cases need. The possibly modified <c>Config</c>
@@ -117,671 +121,683 @@
</p>
<p>If <c>init_per_suite</c> fails, all test cases in the test
- suite will be skipped automatically (so called <em>auto skipped</em>),
+ suite are skipped automatically (so called <em>auto skipped</em>),
including <c>end_per_suite</c>.
</p>
- <p>Note that if <c>init_per_suite</c> and <c>end_per_suite</c> do not exist
- in the suite, Common Test calls dummy functions (with the same names)
- instead, so that output generated by hook functions may be saved to the log
- files for these dummies
- (see the <seealso marker="ct_hooks_chapter#manipulating">Common Test Hooks</seealso>
- chapter for more information).
+ <p>Notice that if <c>init_per_suite</c> and <c>end_per_suite</c> do not exist
+ in the suite, <c>Common Test</c> calls dummy functions (with the same names)
+ instead, so that output generated by hook functions can be saved to the log
+ files for these dummies. For details, see
+ <seealso marker="ct_hooks_chapter#manipulating">Common Test Hooks</seealso>.
</p>
</section>
<section>
<marker id="per_testcase"/>
- <title>Init and end per test case</title>
+ <title>Init and End per Test Case</title>
<p>Each test suite module can contain the optional configuration functions
- <c>init_per_testcase/2</c> and <c>end_per_testcase/2</c>. If the init function
- is defined, so must the end function be.</p>
+ <seealso marker="common_test#Module:init_per_testcase-2"><c>init_per_testcase/2</c></seealso>
+ and <seealso marker="common_test#Module:end_per_testcase-2"><c>end_per_testcase/2</c></seealso>.
+ If the init function is defined, so must the end function be.</p>
- <p>If it exists, <c>init_per_testcase</c> is called before each
- test case in the suite. It typically contains initialization which
- must be done for each test case (analogue to <c>init_per_suite</c> for the
+ <p>If <c>init_per_testcase</c> exists, it is called before each
+ test case in the suite. It typically contains initialization that
+ must be done for each test case (analog to <c>init_per_suite</c> for the
suite).</p>
<p><c>end_per_testcase/2</c> is called after each test case has
- finished, giving the opportunity to perform clean-up after
- <c>init_per_testcase</c>.</p>
+ finished, enabling cleanup after <c>init_per_testcase</c>.</p>
<p>The first argument to these functions is the name of the test
case. This value can be used with pattern matching in function clauses
or conditional expressions to choose different initialization and cleanup
- routines for different test cases, or perform the same routine for a number of,
+ routines for different test cases, or perform the same routine for many,
or all, test cases.</p>
<p>The second argument is the <c>Config</c> key-value list of runtime
configuration data, which has the same value as the list returned by
- <c>init_per_suite</c>. <c>init_per_testcase/2</c> may modify this
- parameter or return it as is. The return value of <c>init_per_testcase/2</c>
- is passed as the <c>Config</c> parameter to the test case itself.</p>
+ <c>init_per_suite</c>. <c>init_per_testcase/2</c> can modify this
+ parameter or return it "as is". The return value of <c>init_per_testcase/2</c>
+ is passed as parameter <c>Config</c> to the test case itself.</p>
<p>The return value of <c>end_per_testcase/2</c> is ignored by the
test server, with exception of the
- <seealso marker="dependencies_chapter#save_config">save_config</seealso>
+ <seealso marker="dependencies_chapter#save_config"><c>save_config</c></seealso>
and <c>fail</c> tuple.</p>
- <p>It is possible in <c>end_per_testcase</c> to check if the
- test case was successful or not (which consequently may determine
- how cleanup should be performed). This is done by reading the value
- tagged with <c>tc_status</c> from <c>Config</c>. The value is either
- <c>ok</c>, <c>{failed,Reason}</c> (where <c>Reason</c> is <c>timetrap_timeout</c>,
- info from <c>exit/1</c>, or details of a run-time error), or
- <c>{skipped,Reason}</c> (where Reason is a user specific term).
+ <p><c>end_per_testcase</c> can check if the test case was successful.
+ (which in turn can determine how cleanup is to be performed).
+ This is done by reading the value tagged with <c>tc_status</c> from
+ <c>Config</c>. The value is one of the following:
</p>
-
- <p>The <c>end_per_testcase/2</c> function is called even after a
- test case terminates due to a call to <seealso marker="ct#abort_current_testcase-1"><c>ct:abort_current_testcase/1</c></seealso>,
- or after a timetrap timeout. However, <c>end_per_testcase</c>
- will then execute on a different process than the test case
- function, and in this situation, <c>end_per_testcase</c> will
- not be able to change the reason for test case termination by
- returning <c>{fail,Reason}</c>, nor will it be able to save data with
- <c>{save_config,Data}</c>.</p>
-
- <p>If <c>init_per_testcase</c> crashes, the test case itself gets skipped
- automatically (so called <em>auto skipped</em>). If <c>init_per_testcase</c>
- returns a tuple <c>{skip,Reason}</c>, also then the test case gets skipped
- (so called <em>user skipped</em>). It is also possible, by returning a tuple
- <c>{fail,Reason}</c> from <c>init_per_testcase</c>, to mark the test case
- as failed without actually executing it.
+ <list type="bulleted">
+ <item>
+ <p><c>ok</c></p>
+ </item>
+ <item>
+ <p><c>{failed,Reason}</c></p>
+ <p>where <c>Reason</c> is <c>timetrap_timeout</c>, information from <c>exit/1</c>,
+ or details of a runtime error</p></item>
+ <item>
+ <p><c>{skipped,Reason}</c></p>
+ <p>where <c>Reason</c> is a user-specific term</p></item>
+ </list>
+
+ <p>Function <c>end_per_testcase/2</c> is even called if a
+ test case terminates because of a call to
+ <seealso marker="ct#abort_current_testcase-1"><c>ct:abort_current_testcase/1</c></seealso>,
+ or after a timetrap time-out. However, <c>end_per_testcase</c>
+ then executes on a different process than the test case
+ function. In this situation, <c>end_per_testcase</c> cannot
+ change the reason for test case termination by returning <c>{fail,Reason}</c>
+ or save data with <c>{save_config,Data}</c>.</p>
+
+ <p>The test case is skipped in the following two cases:
</p>
+ <list type="bulleted">
+ <item>If <c>init_per_testcase</c> crashes (called <em>auto skipped</em>).</item>
+ <item>If <c>init_per_testcase</c> returns a tuple <c>{skip,Reason}</c>
+ (called <em>user skipped</em>).</item>
+ </list>
+ <p>The test case can also be marked as failed without executing it
+ by returning a tuple <c>{fail,Reason}</c> from <c>init_per_testcase</c>.</p>
+
<note><p>If <c>init_per_testcase</c> crashes, or returns <c>{skip,Reason}</c>
- or <c>{fail,Reason}</c>, the <c>end_per_testcase</c> function is not called.
+ or <c>{fail,Reason}</c>, function <c>end_per_testcase</c> is not called.
</p></note>
<p>If it is determined during execution of <c>end_per_testcase</c> that
- the status of a successful test case should be changed to failed,
- <c>end_per_testcase</c> may return the tuple: <c>{fail,Reason}</c>
+ the status of a successful test case is to be changed to failed,
+ <c>end_per_testcase</c> can return the tuple <c>{fail,Reason}</c>
(where <c>Reason</c> describes why the test case fails).</p>
- <p><c>init_per_testcase</c> and <c>end_per_testcase</c> execute on the
- same Erlang process as the test case and printouts from these
- configuration functions can be found in the test case log file.</p>
+ <p>As <c>init_per_testcase</c> and <c>end_per_testcase</c> execute on the
+ same Erlang process as the test case, printouts from these
+ configuration functions are included in the test case log file.</p>
</section>
<section>
<marker id="test_cases"></marker>
- <title>Test cases</title>
+ <title>Test Cases</title>
<p>The smallest unit that the test server is concerned with is a
- test case. Each test case can actually test many things, for
- example make several calls to the same interface function with
+ test case. Each test case can test many things, for
+ example, make several calls to the same interface function with
different parameters.
</p>
- <p>It is possible to choose to put many or few tests into each test
- case. What exactly each test case does is of course up to the
- author, but here are some things to keep in mind:
+ <p>The author can choose to put many or few tests into each test
+ case. Some things to keep in mind follows:
</p>
-
- <p>Having many small test cases tend to result in extra, and possibly
+ <list type="bulleted">
+ <item><p>Many small test cases tend to result in extra, and possibly
duplicated code, as well as slow test execution because of
- large overhead for initializations and cleanups. Duplicated
- code should be avoided, e.g. by means of common help functions, or
- the resulting suite will be difficult to read and understand, and
+ large overhead for initializations and cleanups. Avoid duplicated
+ code, for example, by using common help functions. Otherwise,
+ the resulting suite becomes difficult to read and understand, and
expensive to maintain.
- </p>
-
- <p>Larger test cases make it harder to tell what went wrong if it
- fails, and large portions of test code will potentially be skipped
- when errors occur. Furthermore, readability and maintainability suffers
- when test cases become too large and extensive. Also, the resulting log
- files may not reflect very well the number of tests that have
- actually been performed.
- </p>
+ </p></item>
+ <item><p>Larger test cases make it harder to tell what went wrong if it
+ fails. Also, large portions of test code risk being skipped
+ when errors occur.</p>
+ </item>
+ <item><p>Readability and maintainability suffer
+ when test cases become too large and extensive. It is not certain
+ that the resulting log files reflect very well the number of tests
+ performed.
+ </p></item>
+ </list>
<p>The test case function takes one argument, <c>Config</c>, which
contains configuration information such as <c>data_dir</c> and
- <c>priv_dir</c>. (See <seealso marker="#data_priv_dir">Data and
- Private Directories</seealso> for more information about these).
- The value of <c>Config</c> at the time of the call, is the same
- as the return value from <c>init_per_testcase</c>, see above.
+ <c>priv_dir</c>. (For details about these, see section
+ <seealso marker="#data_priv_dir">Data and Private Directories</seealso>.
+ The value of <c>Config</c> at the time of the call, is the same
+ as the return value from <c>init_per_testcase</c>, mentioned earlier.
</p>
- <note><p>The test case function argument <c>Config</c> should not be
- confused with the information that can be retrieved from
+ <note><p>The test case function argument <c>Config</c> is not to be
+ confused with the information that can be retrieved from the
configuration files (using <seealso marker="ct#get_config-1"><c>
- ct:get_config/1/2</c></seealso>). The Config argument
- should be used for runtime configuration of the test suite and the
- test cases, while configuration files should typically contain data
+ ct:get_config/1/2</c></seealso>). The test case argument <c>Config</c>
+ is to be used for runtime configuration of the test suite and the
+ test cases, while configuration files are to contain data
related to the SUT. These two types of configuration data are handled
- differently!</p></note>
+ differently.</p></note>
- <p>Since the <c>Config</c> parameter is a list of key-value tuples, i.e.
- a data type generally called a property list, it can be handled by means of the
- <c>proplists</c> module in the OTP <c>stdlib</c>. A value can for example
- be searched for and returned with the <c>proplists:get_value/2</c> function.
- Also, or alternatively, you might want to look in the general <c>lists</c> module,
- also in <c>stdlib</c>, for useful functions. Normally, the only operations you
- ever perform on <c>Config</c> is insert (adding a tuple to the head of the list)
- and lookup. Common Test provides a simple macro named <c>?config</c>, which returns
- a value of an item in <c>Config</c> given the key (exactly like
+ <p>As parameter <c>Config</c> is a list of key-value tuples, that is,
+ a data type called a property list, it can be handled by the
+ <seealso marker="stdlib:proplists"><c>stdlib:proplists</c></seealso> module.
+ A value can, for example, be searched for and returned with function
+ <seealso marker="stdlib:proplists#get_value-2"><c>proplists:get_value/2</c></seealso>.
+ Also, or alternatively, the general <seealso marker="stdlib:lists"><c>stdlib:lists</c></seealso>
+ module contains useful functions. Normally, the only operations
+ performed on <c>Config</c> is insert (adding a tuple to the head of the list)
+ and lookup. <c>Common Test</c> provides a simple macro named <c>?config</c>,
+ which returns a value of an item in <c>Config</c> given the key (exactly like
<c>proplists:get_value</c>). Example: <c>PrivDir = ?config(priv_dir, Config)</c>.
</p>
<p>If the test case function crashes or exits purposely, it is considered
- <em>failed</em>. If it returns a value (no matter what actual value) it is
+ <em>failed</em>. If it returns a value (no matter what value), it is
considered successful. An exception to this rule is the return value
<c>{skip,Reason}</c>. If this tuple is returned, the test case is considered
- skipped and gets logged as such.</p>
+ skipped and is logged as such.</p>
<p>If the test case returns the tuple <c>{comment,Comment}</c>, the case
- is considered successful and <c>Comment</c> is printed out in the overview
- log file. This is by the way equal to calling <c>ct:comment(Comment)</c>.
+ is considered successful and <c>Comment</c> is printed in the overview
+ log file. This is equal to calling
+ <seealso marker="ct#comment-1"><c>ct:comment(Comment)</c></seealso>.
</p>
</section>
<section>
<marker id="info_function"></marker>
- <title>Test case info function</title>
+ <title>Test Case Information Function</title>
- <p>For each test case function there can be an additional function
- with the same name but with no arguments. This is the test case
- info function. The test case info function is expected to return a
- list of tagged tuples that specifies various properties regarding the
- test case.
+ <p>For each test case function there can be an extra function
+ with the same name but without arguments. This is the test case
+ information function. It is expected to return a list of tagged
+ tuples that specifies various properties regarding the test case.
</p>
<p>The following tags have special meaning:</p>
<taglist>
- <tag><em><c>timetrap</c></em></tag>
+ <tag><c>timetrap</c></tag>
<item>
<p>
- Set the maximum time the test case is allowed to execute. If
- the timetrap time is exceeded, the test case fails with
- reason <c>timetrap_timeout</c>. Note that <c>init_per_testcase</c>
+ Sets the maximum time the test case is allowed to execute. If
+ this time is exceeded, the test case fails with
+ reason <c>timetrap_timeout</c>. Notice that <c>init_per_testcase</c>
and <c>end_per_testcase</c> are included in the timetrap time.
- Please see the <seealso marker="write_test_chapter#timetraps">Timetrap</seealso>
- section for more details.
+ For details, see section
+ <seealso marker="write_test_chapter#timetraps">Timetrap Time-Outs</seealso>.
</p>
</item>
- <tag><em><c>userdata</c></em></tag>
+ <tag><c>userdata</c></tag>
<item>
<p>
- Use this to specify arbitrary data related to the testcase. This
- data can be retrieved at any time using the <seealso marker="ct#userdata-3"><c>ct:userdata/3</c></seealso>
+ Specifies any data related to the test case. This
+ data can be retrieved at any time using the
+ <seealso marker="ct#userdata-3"><c>ct:userdata/3</c></seealso>
utility function.
</p>
</item>
- <tag><em><c>silent_connections</c></em></tag>
+ <tag><c>silent_connections</c></tag>
<item>
<p>
- Please see the
- <seealso marker="run_test_chapter#silent_connections">Silent Connections</seealso>
- chapter for details.
+ For details, see section
+ <seealso marker="run_test_chapter#silent_connections">Silent Connections</seealso>.
</p>
</item>
- <tag><em><c>require</c></em></tag>
+ <tag><c>require</c></tag>
<item>
<p>
- Use this to specify configuration variables that are required by the
+ Specifies configuration variables required by the
test case. If the required configuration variables are not
found in any of the test system configuration files, the test case is
skipped.</p>
<p>
- It is also possible to give a required variable a default value that will
+ A required variable can also be given a default value to
be used if the variable is not found in any configuration file. To specify
- a default value, add a tuple on the form:
- <c>{default_config,ConfigVariableName,Value}</c> to the test case info list
+ a default value, add a tuple on the form
+ <c>{default_config,ConfigVariableName,Value}</c> to the test case information list
(the position in the list is irrelevant).
- Examples:</p>
+ </p>
+ <p><em>Examples:</em></p>
<pre>
- testcase1() ->
- [{require, ftp},
- {default_config, ftp, [{ftp, "my_ftp_host"},
- {username, "aladdin"},
- {password, "sesame"}]}}].</pre>
+ testcase1() ->
+ [{require, ftp},
+ {default_config, ftp, [{ftp, "my_ftp_host"},
+ {username, "aladdin"},
+ {password, "sesame"}]}}].</pre>
<pre>
- testcase2() ->
- [{require, unix_telnet, unix},
- {require, {unix, [telnet, username, password]}},
- {default_config, unix, [{telnet, "my_telnet_host"},
- {username, "aladdin"},
- {password, "sesame"}]}}].</pre>
+ testcase2() ->
+ [{require, unix_telnet, unix},
+ {require, {unix, [telnet, username, password]}},
+ {default_config, unix, [{telnet, "my_telnet_host"},
+ {username, "aladdin"},
+ {password, "sesame"}]}}].</pre>
</item>
</taglist>
- <p>See the <seealso marker="config_file_chapter#require_config_data">Config files</seealso>
- chapter and the <seealso marker="ct#require-1"><c>
- ct:require/1/2</c></seealso> function in the
- <seealso marker="ct">ct</seealso> reference manual for more information about
- <c>require</c>.</p>
+ <p>For more information about <c>require</c>, see section
+ <seealso marker="config_file_chapter#require_config_data">
+ Requiring and Reading Configuration Data</seealso>
+ in section External Configuration Data and function
+ <seealso marker="ct#require-1"><c>ct:require/1/2</c></seealso>.</p>
<note><p>Specifying a default value for a required variable can result
- in a test case always getting executed. This might not be a desired behaviour!</p>
+ in a test case always getting executed. This might not be a desired behavior.</p>
</note>
- <p>If <c>timetrap</c> and/or <c>require</c> is not set specifically for
- a particular test case, default values specified by the <c>suite/0</c>
- function are used.
+ <p>If <c>timetrap</c> or <c>require</c>, or both, is not set specifically for
+ a particular test case, default values specified by function
+ <seealso marker="common_test#Module:suite-0"><c>suite/0</c></seealso>
+ are used.
</p>
- <p>Other tags than the ones mentioned above will simply be ignored by
- the test server.
+ <p>Tags other than the earlier mentioned are ignored by the test server.
</p>
<p>
- Example of a test case info function:
+ An example of a test case information function follows:
</p>
<pre>
- reboot_node() ->
- [
- {timetrap,{seconds,60}},
- {require,interfaces},
- {userdata,
- [{description,"System Upgrade: RpuAddition Normal RebootNode"},
- {fts,"http://someserver.ericsson.se/test_doc4711.pdf"}]}
- ].</pre>
+ reboot_node() ->
+ [
+ {timetrap,{seconds,60}},
+ {require,interfaces},
+ {userdata,
+ [{description,"System Upgrade: RpuAddition Normal RebootNode"},
+ {fts,"http://someserver.ericsson.se/test_doc4711.pdf"}]}
+ ].</pre>
</section>
<section>
<marker id="suite"></marker>
- <title>Test suite info function</title>
-
- <p>The <c>suite/0</c> function can be used in a test suite
- module to e.g. set a default <c>timetrap</c> value and to
- <c>require</c> external configuration data. If a test case-, or
- group info function also specifies any of the info tags, it
- overrides the default values set by <c>suite/0</c>. See the test
- case info function above, and group info function below, for more
- details.
+ <title>Test Suite Information Function</title>
+
+ <p>Function <seealso marker="common_test#Module:suite-0"><c>suite/0</c></seealso>
+ can, for example, be used in a test suite module to set a default
+ <c>timetrap</c> value and to <c>require</c> external configuration data.
+ If a test case, or a group information function also specifies any of the information tags, it
+ overrides the default values set by <c>suite/0</c>. For details,
+ see
+ <seealso marker="#info_function">Test Case Information Function</seealso> and
+ <seealso marker="#test_case_groups">Test Case Groups</seealso>.
</p>
- <p>Other options that may be specified with the suite info list are:</p>
- <list>
+ <p>The following options can also be specified with the suite information list:</p>
+ <list type="bulleted">
<item><c>stylesheet</c>,
- see <seealso marker="run_test_chapter#html_stylesheet">HTML Style Sheets</seealso>.</item>
+ see <seealso marker="run_test_chapter#html_stylesheet">HTML Style Sheets</seealso></item>
<item><c>userdata</c>,
- see <seealso marker="#info_function">Test case info function</seealso>.</item>
+ see <seealso marker="#info_function">Test Case Information Function</seealso></item>
<item><c>silent_connections</c>,
- see <seealso marker="run_test_chapter#silent_connections">Silent Connections</seealso>.</item>
+ see <seealso marker="run_test_chapter#silent_connections">Silent Connections</seealso></item>
</list>
<p>
- Example of the suite info function:
+ An example of the suite information function follows:
</p>
<pre>
- suite() ->
- [
- {timetrap,{minutes,10}},
- {require,global_names},
- {userdata,[{info,"This suite tests database transactions."}]},
- {silent_connections,[telnet]},
- {stylesheet,"db_testing.css"}
- ].</pre>
+ suite() ->
+ [
+ {timetrap,{minutes,10}},
+ {require,global_names},
+ {userdata,[{info,"This suite tests database transactions."}]},
+ {silent_connections,[telnet]},
+ {stylesheet,"db_testing.css"}
+ ].</pre>
</section>
<section>
<marker id="test_case_groups"></marker>
- <title>Test case groups</title>
- <p>A test case group is a set of test cases that share configuration
+ <title>Test Case Groups</title>
+ <p>A test case group is a set of test cases sharing configuration
functions and execution properties. Test case groups are defined by
- means of the <c>groups/0</c> function according to the following syntax:</p>
+ function
+ <seealso marker="common_test#Module:groups-0"><c>groups/0</c></seealso>
+ according to the following syntax:</p>
<pre>
- groups() -> GroupDefs
+ groups() -> GroupDefs
- Types:
+ Types:
- GroupDefs = [GroupDef]
- GroupDef = {GroupName,Properties,GroupsAndTestCases}
- GroupName = atom()
- GroupsAndTestCases = [GroupDef | {group,GroupName} | TestCase]
- TestCase = atom()</pre>
+ GroupDefs = [GroupDef]
+ GroupDef = {GroupName,Properties,GroupsAndTestCases}
+ GroupName = atom()
+ GroupsAndTestCases = [GroupDef | {group,GroupName} | TestCase]
+ TestCase = atom()</pre>
- <p><c>GroupName</c> is the name of the group and should be unique within
- the test suite module. Groups may be nested, and this is accomplished
- simply by including a group definition within the <c>GroupsAndTestCases</c>
- list of another group. <c>Properties</c> is the list of execution
- properties for the group. The possible values are:</p>
+ <p><c>GroupName</c> is the name of the group and must be unique within
+ the test suite module. Groups can be nested, by including a group definition
+ within the <c>GroupsAndTestCases</c> list of another group.
+ <c>Properties</c> is the list of execution
+ properties for the group. The possible values are as follows:</p>
<pre>
- Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
- Shuffle = shuffle | {shuffle,Seed}
- Seed = {integer(),integer(),integer()}
- RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
- repeat_until_any_ok | repeat_until_any_fail
- N = integer() | forever</pre>
-
- <p>If the <c>parallel</c> property is specified, Common Test will execute
- all test cases in the group in parallel. If <c>sequence</c> is specified,
- the cases will be executed in a sequence, as described in the chapter
- <seealso marker="dependencies_chapter#sequences">Dependencies between
- test cases and suites</seealso>. If <c>shuffle</c> is specified, the cases
- in the group will be executed in random order. The <c>repeat</c> property
- orders Common Test to repeat execution of the cases in the group a given
- number of times, or until any, or all, cases fail or succeed.</p>
-
- <p>Example:</p>
+ Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
+ Shuffle = shuffle | {shuffle,Seed}
+ Seed = {integer(),integer(),integer()}
+ RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
+ repeat_until_any_ok | repeat_until_any_fail
+ N = integer() | forever</pre>
+
+ <p><em>Explanations:</em></p>
+ <taglist>
+ <tag><c>parallel</c></tag>
+ <item><p><c>Common Test</c> executes all test cases in the group in parallel.</p></item>
+ <tag><c>sequence</c></tag>
+ <item><p>The cases are executed in a sequence as described in section
+ <seealso marker="dependencies_chapter#sequences">Sequences</seealso> in section
+ Dependencies Between Test Cases and Suites.</p></item>
+ <tag><c>shuffle</c></tag>
+ <item><p>The cases in the group are executed in random order.</p></item>
+ <tag><c>repeat</c></tag>
+ <item><p>Orders <c>Common Test</c> to repeat execution of the cases in the
+ group a given number of times, or until any, or all, cases fail or succeed.</p></item>
+ </taglist>
+
+ <p><em>Example:</em></p>
<pre>
- groups() -> [{group1, [parallel], [test1a,test1b]},
- {group2, [shuffle,sequence], [test2a,test2b,test2c]}].</pre>
+ groups() -> [{group1, [parallel], [test1a,test1b]},
+ {group2, [shuffle,sequence], [test2a,test2b,test2c]}].</pre>
- <p>To specify in which order groups should be executed (also with respect
- to test cases that are not part of any group), tuples on the form
- <c>{group,GroupName}</c> should be added to the <c>all/0</c> list. Example:</p>
+ <p>To specify in which order groups are to be executed (also with respect
+ to test cases that are not part of any group), add tuples on the form
+ <c>{group,GroupName}</c> to the <c>all/0</c> list.</p>
+ <p><em>Example:</em></p>
<pre>
- all() -> [testcase1, {group,group1}, testcase2, {group,group2}].</pre>
+ all() -> [testcase1, {group,group1}, testcase2, {group,group2}].</pre>
- <p>It is also possible to specify execution properties with a group
- tuple in <c>all/0</c>: <c>{group,GroupName,Properties}</c>. These
- properties will override those specified in the group definition (see
- <c>groups/0</c> above). This way, it's possible to run the same set of tests,
+ <p>Execution properties with a group tuple in
+ <c>all/0</c>: <c>{group,GroupName,Properties}</c> can also be specified.
+ These properties override those specified in the group definition (see
+ <c>groups/0</c> earlier). This way, the same set of tests can be run,
but with different properties, without having to make copies of the group
definition in question.</p>
- <p>If a group contains sub-groups, the execution properties for these may
+ <p>If a group contains subgroups, the execution properties for these can
also be specified in the group tuple:
- <c>{group,GroupName,Properties,SubGroups}</c>, where <c>SubGroups</c>
- is a list of tuples, <c>{GroupName,Properties}</c>, or
- <c>{GroupName,Properties,SubGroups}</c>, representing the sub-groups.
- Any sub-groups defined in <c>group/0</c> for a group, that are not specified
- in the <c>SubGroups</c> list, will simply execute with their pre-defined
+ <c>{group,GroupName,Properties,SubGroups}</c>
+ Where, <c>SubGroups</c> is a list of tuples, <c>{GroupName,Properties}</c> or
+ <c>{GroupName,Properties,SubGroups}</c> representing the subgroups.
+ Any subgroups defined in <c>group/0</c> for a group, that are not specified
+ in the <c>SubGroups</c> list, executes with their predefined
properties.</p>
- <p>Example:</p>
+ <p><em>Example:</em></p>
<pre>
- groups() -> {tests1, [], [{tests2, [], [t2a,t2b]},
- {tests3, [], [t31,t3b]}]}.</pre>
- <p>To execute group 'tests1' twice with different properties for 'tests2'
+ groups() -> {tests1, [], [{tests2, [], [t2a,t2b]},
+ {tests3, [], [t31,t3b]}]}.</pre>
+ <p>To execute group <c>tests1</c> twice with different properties for <c>tests2</c>
each time:</p>
<pre>
- all() ->
- [{group, tests1, default, [{tests2, [parallel]}]},
- {group, tests1, default, [{tests2, [shuffle,{repeat,10}]}]}].</pre>
- <p>Note that this is equivalent to this specification:</p>
+ all() ->
+ [{group, tests1, default, [{tests2, [parallel]}]},
+ {group, tests1, default, [{tests2, [shuffle,{repeat,10}]}]}].</pre>
+ <p>This is equivalent to the following specification:</p>
<pre>
- all() ->
- [{group, tests1, default, [{tests2, [parallel]},
- {tests3, default}]},
- {group, tests1, default, [{tests2, [shuffle,{repeat,10}]},
- {tests3, default}]}].</pre>
- <p>The value <c>default</c> states that the pre-defined properties
- should be used.</p>
- <p>Here's an example of how to override properties in a scenario
+ all() ->
+ [{group, tests1, default, [{tests2, [parallel]},
+ {tests3, default}]},
+ {group, tests1, default, [{tests2, [shuffle,{repeat,10}]},
+ {tests3, default}]}].</pre>
+ <p>Value <c>default</c> states that the predefined properties
+ are to be used.</p>
+ <p>The following example shows how to override properties in a scenario
with deeply nested groups:</p>
<pre>
- groups() ->
- [{tests1, [], [{group, tests2}]},
- {tests2, [], [{group, tests3}]},
- {tests3, [{repeat,2}], [t3a,t3b,t3c]}].
-
- all() ->
- [{group, tests1, default,
- [{tests2, default,
- [{tests3, [parallel,{repeat,100}]}]}]}].</pre>
-
- <p>The syntax described above may also be used in Test Specifications
- in order to change properties of groups at the time of execution,
- without even having to edit the test suite (please see the
- <seealso marker="run_test_chapter#test_specifications">Test
- Specifications</seealso> chapter for more info).</p>
-
- <p>As illustrated above, properties may be combined. If e.g.
- <c>shuffle</c>, <c>repeat_until_any_fail</c> and <c>sequence</c>
- are all specified, the test cases in the group will be executed
+ groups() ->
+ [{tests1, [], [{group, tests2}]},
+ {tests2, [], [{group, tests3}]},
+ {tests3, [{repeat,2}], [t3a,t3b,t3c]}].
+
+ all() ->
+ [{group, tests1, default,
+ [{tests2, default,
+ [{tests3, [parallel,{repeat,100}]}]}]}].</pre>
+
+ <p>The described syntax can also be used in test specifications
+ to change group properties at the time of execution,
+ without having to edit the test suite. For more information, see
+ section <seealso marker="run_test_chapter#test_specifications">Test
+ Specifications</seealso> in section Running Tests and Analyzing Results.</p>
+
+ <p>As illustrated, properties can be combined. If, for example,
+ <c>shuffle</c>, <c>repeat_until_any_fail</c>, and <c>sequence</c>
+ are all specified, the test cases in the group are executed
repeatedly, and in random order, until a test case fails. Then
- execution is immediately stopped and the rest of the cases skipped.</p>
+ execution is immediately stopped and the remaining cases are skipped.</p>
<p>Before execution of a group begins, the configuration function
- <c>init_per_group(GroupName, Config)</c> is called. The list of tuples
- returned from this function is passed to the test cases in the usual
- manner by means of the <c>Config</c> argument. <c>init_per_group/2</c>
- is meant to be used for initializations common for the test cases in the
- group. After execution of the group is finished, the
- <c>end_per_group(GroupName, Config</c> function is called. This function
- is meant to be used for cleaning up after <c>init_per_group/2</c>.</p>
+ <seealso marker="common_test#Module:init_per_group-2"><c>init_per_group(GroupName, Config)</c></seealso>
+ is called. The list of tuples returned from this function is passed to the
+ test cases in the usual manner by argument <c>Config</c>.
+ <c>init_per_group/2</c> is meant to be used for initializations common
+ for the test cases in the group. After execution of the group is finished, function
+ <seealso marker="common_test#Module:end_per_group-2"><c>end_per_group(GroupName, Config)</c></seealso>
+ is called. This function is meant to be used for cleaning up after
+ <c>init_per_group/2</c>.</p>
<p>Whenever a group is executed, if <c>init_per_group</c> and
- <c>end_per_group</c> do not exist in the suite, Common Test calls
+ <c>end_per_group</c> do not exist in the suite, <c>Common Test</c> calls
dummy functions (with the same names) instead. Output generated by
- hook functions will be saved to the log files for these dummies
- (see the <seealso marker="ct_hooks_chapter#manipulating">Common Test
- Hooks</seealso> chapter for more information).
+ hook functions are saved to the log files for these dummies.
+ For more information, see section
+ <seealso marker="ct_hooks_chapter#manipulating">Manipulating Tests</seealso>
+ in section Common Test Hooks.
</p>
<note><p><c>init_per_testcase/2</c> and <c>end_per_testcase/2</c>
are always called for each individual test case, no matter if the case
belongs to a group or not.</p></note>
- <p>The properties for a group is always printed on the top of the HTML log
- for <c>init_per_group/2</c>. Also, the total execution time for a group
- can be found at the bottom of the log for <c>end_per_group/2</c>.</p>
+ <p>The properties for a group are always printed in the top of the HTML log
+ for <c>init_per_group/2</c>. The total execution time for a group is
+ included at the bottom of the log for <c>end_per_group/2</c>.</p>
- <p>Test case groups may be nested so that sets of groups can be
+ <p>Test case groups can be nested so sets of groups can be
configured with the same <c>init_per_group/2</c> and <c>end_per_group/2</c>
- functions. Nested groups may be defined by including a group definition,
- or a group name reference, in the test case list of another group. Example:</p>
+ functions. Nested groups can be defined by including a group definition,
+ or a group name reference, in the test case list of another group.</p>
+ <p><em>Example:</em></p>
<pre>
- groups() -> [{group1, [shuffle], [test1a,
- {group2, [], [test2a,test2b]},
- test1b]},
- {group3, [], [{group,group4},
- {group,group5}]},
- {group4, [parallel], [test4a,test4b]},
- {group5, [sequence], [test5a,test5b,test5c]}].</pre>
-
- <p>In the example above, if <c>all/0</c> would return group name references
- in this order: <c>[{group,group1},{group,group3}]</c>, the order of the
- configuration functions and test cases will be the following (note that
+ groups() -> [{group1, [shuffle], [test1a,
+ {group2, [], [test2a,test2b]},
+ test1b]},
+ {group3, [], [{group,group4},
+ {group,group5}]},
+ {group4, [parallel], [test4a,test4b]},
+ {group5, [sequence], [test5a,test5b,test5c]}].</pre>
+
+ <p>In the previous example, if <c>all/0</c> returns group name references
+ in the order <c>[{group,group1},{group,group3}]</c>, the order of the
+ configuration functions and test cases becomes the following (notice that
<c>init_per_testcase/2</c> and <c>end_per_testcase/2:</c> are also
always called, but not included in this example for simplification):</p>
<pre>
-- init_per_group(group1, Config) -> Config1 (*)
-
--- test1a(Config1)
-
--- init_per_group(group2, Config1) -> Config2
-
---- test2a(Config2), test2b(Config2)
-
--- end_per_group(group2, Config2)
-
--- test1b(Config1)
-
-- end_per_group(group1, Config1)
-
-- init_per_group(group3, Config) -> Config3
-
--- init_per_group(group4, Config3) -> Config4
-
---- test4a(Config4), test4b(Config4) (**)
-
--- end_per_group(group4, Config4)
-
--- init_per_group(group5, Config3) -> Config5
-
---- test5a(Config5), test5b(Config5), test5c(Config5)
-
--- end_per_group(group5, Config5)
-
-- end_per_group(group3, Config3)
-
-
- (*) The order of test case test1a, test1b and group2 is not actually
- defined since group1 has a shuffle property.
-
- (**) These cases are not executed in order, but in parallel.</pre>
-
- <p>Properties are not inherited from top level groups to nested
- sub-groups. E.g, in the example above, the test cases in <c>group2</c>
- will not be executed in random order (which is the property of
- <c>group1</c>).</p>
+ init_per_group(group1, Config) -> Config1 (*)
+ test1a(Config1)
+ init_per_group(group2, Config1) -> Config2
+ test2a(Config2), test2b(Config2)
+ end_per_group(group2, Config2)
+ test1b(Config1)
+ end_per_group(group1, Config1)
+ init_per_group(group3, Config) -> Config3
+ init_per_group(group4, Config3) -> Config4
+ test4a(Config4), test4b(Config4) (**)
+ end_per_group(group4, Config4)
+ init_per_group(group5, Config3) -> Config5
+ test5a(Config5), test5b(Config5), test5c(Config5)
+ end_per_group(group5, Config5)
+ end_per_group(group3, Config3)</pre>
+
+ <p>(*) The order of test case <c>test1a</c>, <c>test1b</c>, and <c>group2</c> is
+ undefined, as <c>group1</c> has a shuffle property.</p>
+ <p>(**) These cases are not executed in order, but in parallel.</p>
+ <p>Properties are not inherited from top-level groups to nested
+ subgroups. For instance, in the previous example, the test cases in <c>group2</c>
+ are not executed in random order (which is the property of <c>group1</c>).</p>
</section>
<section>
- <title>The parallel property and nested groups</title>
- <p>If a group has a parallel property, its test cases will be spawned
- simultaneously and get executed in parallel. A test case is not allowed
- to execute in parallel with <c>end_per_group/2</c> however, which means
- that the time it takes to execute a parallel group is equal to the
+ <title>Parallel Property and Nested Groups</title>
+ <p>If a group has a parallel property, its test cases are spawned
+ simultaneously and get executed in parallel. However, a test case is not
+ allowed to execute in parallel with <c>end_per_group/2</c>, which means
+ that the time to execute a parallel group is equal to the
execution time of the slowest test case in the group. A negative side
effect of running test cases in parallel is that the HTML summary pages
- are not updated with links to the individual test case logs until the
- <c>end_per_group/2</c> function for the group has finished.</p>
+ are not updated with links to the individual test case logs until function
+ <c>end_per_group/2</c> for the group has finished.</p>
- <p>A group nested under a parallel group will start executing in parallel
+ <p>A group nested under a parallel group starts executing in parallel
with previous (parallel) test cases (no matter what properties the nested
- group has). Since, however, test cases are never executed in parallel with
- <c>init_per_group/2</c> or <c>end_per_group/2</c> of the same group, it's
- only after a nested group has finished that any remaining parallel cases
- in the previous group get spawned.</p>
+ group has). However, as test cases are never executed in parallel with
+ <c>init_per_group/2</c> or <c>end_per_group/2</c> of the same group, it is
+ only after a nested group has finished that remaining parallel cases
+ in the previous group become spawned.</p>
</section>
<section>
- <title>Parallel test cases and IO</title>
- <p>A parallel test case has a private IO server as its group leader.
- (Please see the Erlang Run-Time System Application documentation for
- a description of the group leader concept). The
- central IO server process that handles the output from regular test
- cases and configuration functions, does not respond to IO messages
+ <title>Parallel Test Cases and I/O</title>
+ <p>A parallel test case has a private I/O server as its group leader.
+ (For a description of the group leader concept, see
+ <seealso marker="erts:index"><c>ERTS</c></seealso>).
+ The central I/O server process, which handles the output from
+ regular test cases and configuration functions, does not respond to I/O messages
during execution of parallel groups. This is important to understand
- in order to avoid certain traps, like this one:</p>
- <p>If a process, <c>P</c>, is spawned during execution of e.g.
- <c>init_per_suite/1</c>, it will inherit the group leader of the
- <c>init_per_suite</c> process. This group leader is the central IO server
- process mentioned above. If, at a later time, <em>during parallel test case
+ to avoid certain traps, like the following:</p>
+ <p>If a process, <c>P</c>, is spawned during execution of, for example,
+ <c>init_per_suite/1</c>, it inherits the group leader of the
+ <c>init_per_suite</c> process. This group leader is the central I/O server
+ process mentioned earlier. If, at a later time, <em>during parallel test case
execution</em>, some event triggers process <c>P</c> to call
- <c>io:format/1/2</c>, that call will never return (since the group leader
- is in a non-responsive state) and cause <c>P</c> to hang.
+ <c>io:format/1/2</c>, that call never returns (as the group leader
+ is in a non-responsive state) and causes <c>P</c> to hang.
</p>
</section>
<section>
- <title>Repeated groups</title>
+ <title>Repeated Groups</title>
<marker id="repeated_groups"></marker>
- <p>A test case group may be repeated a certain number of times
+ <p>A test case group can be repeated a certain number of times
(specified by an integer) or indefinitely (specified by <c>forever</c>).
- The repetition may also be stopped prematurely if any or all cases
- fail or succeed, i.e. if the property <c>repeat_until_any_fail</c>,
+ The repetition can also be stopped too early if any or all cases
+ fail or succeed, that is, if any of the properties <c>repeat_until_any_fail</c>,
<c>repeat_until_any_ok</c>, <c>repeat_until_all_fail</c>, or
<c>repeat_until_all_ok</c> is used. If the basic <c>repeat</c>
property is used, status of test cases is irrelevant for the repeat
operation.</p>
- <p>It is possible to return the status of a sub-group (ok or
- failed), to affect the execution of the group on the level above.
+ <p>The status of a subgroup can be returned (<c>ok</c> or
+ <c>failed</c>), to affect the execution of the group on the level above.
This is accomplished by, in <c>end_per_group/2</c>, looking up the value
of <c>tc_group_properties</c> in the <c>Config</c> list and checking the
- result of the test cases in the group. If status <c>failed</c> should be
- returned from the group as a result, <c>end_per_group/2</c> should return
- the value <c>{return_group_result,failed}</c>. The status of a sub-group
- is taken into account by Common Test when evaluating if execution of a
- group should be repeated or not (unless the basic <c>repeat</c>
+ result of the test cases in the group. If status <c>failed</c> is to be
+ returned from the group as a result, <c>end_per_group/2</c> is to return
+ the value <c>{return_group_result,failed}</c>. The status of a subgroup
+ is taken into account by <c>Common Test</c> when evaluating if execution of a
+ group is to be repeated or not (unless the basic <c>repeat</c>
property is used).</p>
- <p>The <c>tc_group_properties</c> value is a list of status tuples,
- each with the key <c>ok</c>, <c>skipped</c> and <c>failed</c>. The
- value of a status tuple is a list containing names of test cases
+ <p>The value of <c>tc_group_properties</c> is a list of status tuples,
+ each with the key <c>ok</c>, <c>skipped</c>, and <c>failed</c>. The
+ value of a status tuple is a list with names of test cases
that have been executed with the corresponding status as result.</p>
- <p>Here's an example of how to return the status from a group:</p>
+ <p>The following is an example of how to return the status from a group:</p>
<pre>
- end_per_group(_Group, Config) ->
- Status = ?config(tc_group_result, Config),
- case proplists:get_value(failed, Status) of
- [] -> % no failed cases
- {return_group_result,ok};
- _Failed -> % one or more failed
- {return_group_result,failed}
- end.</pre>
-
- <p>It is also possible in <c>end_per_group/2</c> to check the status of
- a sub-group (maybe to determine what status the current group should also
- return). This is as simple as illustrated in the example above, only the
- name of the group is stored in a tuple <c>{group_result,GroupName}</c>,
- which can be searched for in the status lists. Example:</p>
+ end_per_group(_Group, Config) ->
+ Status = ?config(tc_group_result, Config),
+ case proplists:get_value(failed, Status) of
+ [] -> % no failed cases
+ {return_group_result,ok};
+ _Failed -> % one or more failed
+ {return_group_result,failed}
+ end.</pre>
+
+ <p>It is also possible, in <c>end_per_group/2</c>, to check the status of
+ a subgroup (maybe to determine what status the current group is to
+ return). This is as simple as illustrated in the previous example, only the
+ group name is stored in a tuple <c>{group_result,GroupName}</c>,
+ which can be searched for in the status lists.</p>
+ <p><em>Example:</em></p>
<pre>
- end_per_group(group1, Config) ->
- Status = ?config(tc_group_result, Config),
- Failed = proplists:get_value(failed, Status),
- case lists:member({group_result,group2}, Failed) of
- true ->
- {return_group_result,failed};
- false ->
- {return_group_result,ok}
- end;
- ...</pre>
+ end_per_group(group1, Config) ->
+ Status = ?config(tc_group_result, Config),
+ Failed = proplists:get_value(failed, Status),
+ case lists:member({group_result,group2}, Failed) of
+ true ->
+ {return_group_result,failed};
+ false ->
+ {return_group_result,ok}
+ end;
+ ...</pre>
<note><p>When a test case group is repeated, the configuration
- functions, <c>init_per_group/2</c> and <c>end_per_group/2</c>, are
+ functions <c>init_per_group/2</c> and <c>end_per_group/2</c> are
also always called with each repetition.</p></note>
</section>
<section>
- <title>Shuffled test case order</title>
- <p>The order that test cases in a group are executed, is under normal
+ <title>Shuffled Test Case Order</title>
+ <p>The order in which test cases in a group are executed is under normal
circumstances the same as the order specified in the test case list
- in the group definition. With the <c>shuffle</c> property set, however,
- Common Test will instead execute the test cases in random order.</p>
+ in the group definition. With property <c>shuffle</c> set, however,
+ <c>Common Test</c> instead executes the test cases in random order.</p>
- <p>The user may provide a seed value (a tuple of three integers) with
- the shuffle property: <c>{shuffle,Seed}</c>. This way, the same shuffling
+ <p>You can provide a seed value (a tuple of three integers) with
+ the shuffle property <c>{shuffle,Seed}</c>. This way, the same shuffling
order can be created every time the group is executed. If no seed value
- is given, Common Test creates a "random" seed for the shuffling operation
- (using the return value of <c>erlang:now()</c>). The seed value is always
+ is specified, <c>Common Test</c> creates a "random" seed for the shuffling operation
+ (using the return value of <c>erlang:timestamp/0</c>). The seed value is always
printed to the <c>init_per_group/2</c> log file so that it can be used to
recreate the same execution order in a subsequent test run.</p>
- <note><p>If a shuffled test case group is repeated, the seed will not
- be reset in between turns.</p></note>
+ <note><p>If a shuffled test case group is repeated, the seed is not
+ reset between turns.</p></note>
- <p>If a sub-group is specified in a group with a <c>shuffle</c> property,
- the execution order of this sub-group in relation to the test cases
- (and other sub-groups) in the group, is also random. The order of the
- test cases in the sub-group is however not random (unless, of course, the
- sub-group also has a <c>shuffle</c> property).</p>
+ <p>If a subgroup is specified in a group with a <c>shuffle</c> property,
+ the execution order of this subgroup in relation to the test cases
+ (and other subgroups) in the group, is random. The order of the
+ test cases in the subgroup is however not random (unless the
+ subgroup has a <c>shuffle</c> property).</p>
</section>
<section>
<marker id="group_info"></marker>
- <title>Group info function</title>
+ <title>Group Information Function</title>
- <p>The test case group info function, <c>group(GroupName)</c>,
- serves the same purpose as the suite- and test case info
- functions previously described in this chapter. The scope for
- the group info, however, is all test cases and sub-groups in the
+ <p>The test case group information function, <c>group(GroupName)</c>,
+ serves the same purpose as the suite- and test case information
+ functions previously described. However, the scope for
+ the group information function, is all test cases and subgroups in the
group in question (<c>GroupName</c>).</p>
- <p>Example:</p>
+ <p><em>Example:</em></p>
<pre>
- group(connection_tests) ->
- [{require,login_data},
- {timetrap,1000}].</pre>
+ group(connection_tests) ->
+ [{require,login_data},
+ {timetrap,1000}].</pre>
- <p>The group info properties override those set with the
- suite info function, and may in turn be overridden by test
- case info properties. Please see the test case info
- function above for a list of valid info properties and more
- general information.</p>
+ <p>The group information properties override those set with the
+ suite information function, and can in turn be overridden by test
+ case information properties. For a list of valid information properties
+ and more general information, see the
+ <seealso marker="#info_function">Test Case Information Function</seealso>.
+ </p>
</section>
<section>
- <title>Info functions for init- and end-configuration</title>
- <p>It is possible to use info functions also for the <c>init_per_suite</c>,
- <c>end_per_suite</c>, <c>init_per_group</c>, and <c>end_per_group</c>
- functions, and it works the same way as with info functions
- for test cases (see above). This is useful e.g. for setting
- timetraps and requiring external configuration data relevant
- only for the configuration function in question (without
- affecting properties set for groups and test cases in the suite).</p>
-
- <p>The info function <c>init/end_per_suite()</c> is called for
- <c>init/end_per_suite(Config)</c>, and info function
+ <title>Information Functions for Init- and End-Configuration</title>
+ <p>Information functions can also be used for functions <c>init_per_suite</c>,
+ <c>end_per_suite</c>, <c>init_per_group</c>, and <c>end_per_group</c>,
+ and they work the same way as with the
+ <seealso marker="#info_function">Test Case Information Function</seealso>.
+ This is useful, for example, for setting timetraps and requiring
+ external configuration data relevant only for the configuration
+ function in question (without affecting properties set for groups
+ and test cases in the suite).</p>
+
+ <p>The information function <c>init/end_per_suite()</c> is called for
+ <c>init/end_per_suite(Config)</c>, and information function
<c>init/end_per_group(GroupName)</c> is called for
- <c>init/end_per_group(GroupName,Config)</c>. Info functions
- can not be used with <c>init/end_per_testcase(TestCase, Config)</c>,
- however, since these configuration functions execute on the test case process
- and will use the same properties as the test case (i.e. the properties
- set by the test case info function, <c>TestCase()</c>). Please see the test case
- info function above for a list of valid info properties and more
- general information.
+ <c>init/end_per_group(GroupName,Config)</c>. However, information functions
+ cannot be used with <c>init/end_per_testcase(TestCase, Config)</c>,
+ as these configuration functions execute on the test case process
+ and use the same properties as the test case (that is, the properties
+ set by the test case information function, <c>TestCase()</c>). For a list
+ of valid information properties and more general information, see the
+ <seealso marker="#info_function">Test Case Information Function</seealso>.
</p>
</section>
@@ -789,77 +805,67 @@
<marker id="data_priv_dir"></marker>
<title>Data and Private Directories</title>
- <p>The data directory, <c>data_dir</c>, is the directory where the
- test module has its own files needed for the testing. The name
- of the <c>data_dir</c> is the the name of the test suite followed
- by <c>"_data"</c>. For example,
- <c>"some_path/foo_SUITE.beam"</c> has the data directory
+ <p>In the data directory, <c>data_dir</c>, the test module has
+ its own files needed for the testing. The name of <c>data_dir</c>
+ is the the name of the test suite followed by <c>"_data"</c>.
+ For example, <c>"some_path/foo_SUITE.beam"</c> has the data directory
<c>"some_path/foo_SUITE_data/"</c>. Use this directory for portability,
- i.e. to avoid hardcoding directory names in your suite. Since the data
- directory is stored in the same directory as your test suite, you should
- be able to rely on its existence at runtime, even if the path to your
+ that is, to avoid hardcoding directory names in your suite. As the data
+ directory is stored in the same directory as your test suite, you can
+ rely on its existence at runtime, even if the path to your
test suite directory has changed between test suite implementation and
execution.
</p>
-
-<!--
- <p>
- When using the Common Test framework <c>ct</c>, automatic
- compilation of code in the data directory can be obtained by
- placing a makefile source called Makefile.src in the data
- directory. Makefile.src will be converted to a valid makefile by
- <c>ct</c> when the test suite is run. See the reference manual for
- the <c>ct</c> module for details about the syntax of Makefile.src.
- </p>
--->
<p>
<c>priv_dir</c> is the private directory for the test cases.
- This directory may be used whenever a test case (or configuration function)
+ This directory can be used whenever a test case (or configuration function)
needs to write something to file. The name of the private directory is
- generated by Common Test, which also creates the directory.
+ generated by <c>Common Test</c>, which also creates the directory.
</p>
- <p>By default, Common Test creates one central private directory
- per test run that all test cases share. This may not always be suitable,
- especially if the same test cases are executed multiple times during
- a test run (e.g. if they belong to a test case group with repeat
- property), and there's a risk that files in the private directory get
- overwritten. Under these circumstances, it's possible to configure
- Common Test to create one dedicated private directory per
- test case and execution instead. This is accomplished by means of
- the flag/option: <c>create_priv_dir</c> (to be used with the
- <c>ct_run</c> program, the <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso> function, or
+ <p>By default, <c>Common Test</c> creates one central private directory
+ per test run, shared by all test cases. This is not always suitable.
+ Especially if the same test cases are executed multiple times during
+ a test run (that is, if they belong to a test case group with property
+ <c>repeat</c>) and there is a risk that files in the private directory get
+ overwritten. Under these circumstances, <c>Common Test</c> can be
+ configured to create one dedicated private directory per
+ test case and execution instead. This is accomplished with
+ the flag/option <c>create_priv_dir</c> (to be used with the
+ <seealso marker="ct_run"><c>ct_run</c></seealso> program, the
+ <seealso marker="ct#run_test-1"><c>ct:run_test/1</c></seealso> function, or
as test specification term). There are three possible values
- for this option:
+ for this option as follows:
</p>
- <list>
+ <list type="bulleted">
<item><c>auto_per_run</c></item>
<item><c>auto_per_tc</c></item>
<item><c>manual_per_tc</c></item>
</list>
<p>
- The first value indicates the default priv_dir behaviour, i.e.
+ The first value indicates the default <c>priv_dir</c> behavior, that is,
one private directory created per test run. The two latter
- values tell Common Test to generate a unique test directory name
+ values tell <c>Common Test</c> to generate a unique test directory name
per test case and execution. If the auto version is used, <em>all</em>
- private directories will be created automatically. This can obviously
- become very inefficient for test runs with many test cases and/or
- repetitions. Therefore, in case the manual version is instead used, the
- test case must tell Common Test to create priv_dir when it needs it.
- It does this by calling the function <seealso marker="ct#make_priv_dir-0"><c>ct:make_priv_dir/0</c></seealso>.
+ private directories are created automatically. This can become very
+ inefficient for test runs with many test cases or repetitions, or both.
+ Therefore, if the manual version is used instead, the test case must tell
+ <c>Common Test</c> to create <c>priv_dir</c> when it needs it.
+ It does this by calling the function
+ <seealso marker="ct#make_priv_dir-0"><c>ct:make_priv_dir/0</c></seealso>.
</p>
- <note><p>You should not depend on current working directory for
- reading and writing data files since this is not portable. All
+ <note><p>Do not depend on the current working directory for
+ reading and writing data files, as this is not portable. All
scratch files are to be written in the <c>priv_dir</c> and all
- data files should be located in <c>data_dir</c>. Note also that
- the Common Test server sets current working directory to the test case
- log directory at the start of every case.
+ data files are to be located in <c>data_dir</c>. Also,
+ the <c>Common Test</c> server sets the current working directory to
+ the test case log directory at the start of every case.
</p></note>
</section>
<section>
- <title>Execution environment</title>
+ <title>Execution Environment</title>
<p>Each test case is executed by a dedicated Erlang process. The
process is spawned when the test case starts, and terminated when
@@ -876,236 +882,263 @@
<section>
<marker id="timetraps"></marker>
- <title>Timetrap timeouts</title>
+ <title>Timetrap Time-Outs</title>
<p>The default time limit for a test case is 30 minutes, unless a
<c>timetrap</c> is specified either by the suite-, group-,
- or test case info function. The timetrap timeout value defined by
- <c>suite/0</c> is the value that will be used for each test case
- in the suite (as well as for the configuration functions
+ or test case information function. The timetrap time-out value defined by
+ <c>suite/0</c> is the value that is used for each test case
+ in the suite (and for the configuration functions
<c>init_per_suite/1</c>, <c>end_per_suite/1</c>, <c>init_per_group/2</c>,
and <c>end_per_group/2</c>). A timetrap value defined by
<c>group(GroupName)</c> overrides one defined by <c>suite()</c>
- and will be used for each test case in group <c>GroupName</c>, and any
- of its sub-groups. If a timetrap value is defined by <c>group/1</c>
- for a sub-group, it overrides that of its higher level groups. Timetrap
- values set by individual test cases (by means of the test case info
+ and is used for each test case in group <c>GroupName</c>, and any
+ of its subgroups. If a timetrap value is defined by <c>group/1</c>
+ for a subgroup, it overrides that of its higher level groups. Timetrap
+ values set by individual test cases (by the test case information
function) override both group- and suite- level timetraps.</p>
- <p>It is also possible to dynamically set/reset a timetrap during the
- excution of a test case, or configuration function. This is done by calling
- <seealso marker="ct#timetrap-1"><c>ct:timetrap/1</c></seealso>. This function cancels the current timetrap
- and starts a new one (that stays active until timeout, or end of the
- current function).</p>
+ <p>A timetrap can also be set or reset dynamically during the
+ execution of a test case, or configuration function.
+ This is done by calling
+ <seealso marker="ct#timetrap-1"><c>ct:timetrap/1</c></seealso>.
+ This function cancels the current timetrap and starts a new one
+ (that stays active until time-out, or end of the current function).</p>
<p>Timetrap values can be extended with a multiplier value specified at
- startup with the <c>multiply_timetraps</c> option. It is also possible
- to let the test server decide to scale up timetrap timeout values
- automatically, e.g. if tools such as cover or trace are running during
- the test. This feature is disabled by default and can be enabled with
- the <c>scale_timetraps</c> start option.</p>
+ startup with option <c>multiply_timetraps</c>. It is also possible
+ to let the test server decide to scale up timetrap time-out values
+ automatically. That is, if tools such as <c>cover</c> or <c>trace</c>
+ are running during the test. This feature is disabled by default and
+ can be enabled with start option <c>scale_timetraps</c>.</p>
<p>If a test case needs to suspend itself for a time that also gets
multipled by <c>multiply_timetraps</c> (and possibly also scaled up if
- <c>scale_timetraps</c> is enabled), the function <seealso marker="ct#sleep-1"><c>ct:sleep/1</c></seealso>
- may be used (instead of e.g. <c>timer:sleep/1</c>).</p>
+ <c>scale_timetraps</c> is enabled), the function
+ <seealso marker="ct#sleep-1"><c>ct:sleep/1</c></seealso>
+ can be used (instead of, for example, <c>timer:sleep/1</c>).</p>
- <p>A function (<c>fun/0</c> or <c>MFA</c>) may be specified as
- timetrap value in the suite-, group- and test case info function, as
- well as argument to the <seealso marker="ct#timetrap-1"><c>ct:timetrap/1</c></seealso> function. Examples:</p>
+ <p>A function (<c>fun/0</c> or <c>{Mod,Func,Args}</c> (MFA) tuple) can be
+ specified as timetrap value in the suite-, group- and test case information
+ function, and as argument to function
+ <seealso marker="ct#timetrap-1"><c>ct:timetrap/1</c></seealso>.</p>
+ <p><em>Examples:</em></p>
<p><c>{timetrap,{my_test_utils,timetrap,[?MODULE,system_start]}}</c></p>
<p><c>ct:timetrap(fun() -> my_timetrap(TestCaseName, Config) end)</c></p>
- <p>The user timetrap function may be used for two things:</p>
- <list>
- <item>To act as a timetrap - the timeout is triggered when the
+ <p>The user timetrap function can be used for two things as follows:</p>
+ <list type="bulleted">
+ <item>To act as a timetrap. The time-out is triggered when the
function returns.</item>
<item>To return a timetrap time value (other than a function).</item>
</list>
<p>Before execution of the timetrap function (which is performed
- on a parallel, dedicated timetrap process), Common Test cancels
+ on a parallel, dedicated timetrap process), <c>Common Test</c> cancels
any previously set timer for the test case or configuration function.
- When the timetrap function returns, the timeout is triggered, <em>unless</em>
+ When the timetrap function returns, the time-out is triggered, <em>unless</em>
the return value is a valid timetrap time, such as an integer,
- or a <c>{SecMinOrHourTag,Time}</c> tuple (see the
- <seealso marker="common_test">common_test reference manual</seealso> for
- details). If a time value is returned, a new timetrap is started
- to generate a timeout after the specified time.</p>
+ or a <c>{SecMinOrHourTag,Time}</c> tuple (for details, see module
+ <seealso marker="common_test">common_test</seealso>). If a time value
+ is returned, a new timetrap is started to generate a time-out after
+ the specified time.</p>
- <p>The user timetrap function may of course return a time value after a delay,
- and if so, the effective timetrap time is the delay time <em>plus</em> the
+ <p>The user timetrap function can return a time value after a delay.
+ The effective timetrap time is then the delay time <em>plus</em> the
returned time.</p>
</section>
<section>
<marker id="logging"></marker>
- <title>Logging - categories and verbosity levels</title>
- <p>Common Test provides three main functions for printing strings:</p>
- <list>
- <item><c>ct:log(Category, Importance, Format, Args)</c></item>
- <item><c>ct:print(Category, Importance, Format, Args)</c></item>
- <item><c>ct:pal(Category, Importance, Format, Args)</c></item>
+ <title>Logging - Categories and Verbosity Levels</title>
+ <p><c>Common Test</c> provides the following three main functions for
+ printing strings:</p>
+ <list type="bulleted">
+ <item><c>ct:log(Category, Importance, Format, FormatArgs, Opts)</c></item>
+ <item><c>ct:print(Category, Importance, Format, FormatArgs)</c></item>
+ <item><c>ct:pal(Category, Importance, Format, FormatArgs)</c></item>
</list>
- <p>The <c>log/1/2/3/4</c> function will print a string to the test case
- log file. The <c>print/1/2/3/4</c> function will print the string to screen,
- and the <c>pal/1/2/3/4</c> function will print the same string both to file and
- screen. (The functions are documented in the <c>ct</c> reference manual).</p>
-
- <p>The optional <c>Category</c> argument may be used to categorize the
- log printout, and categories can be used for two things:</p>
- <list>
+ <p>The <seealso marker="ct#log-1"><c>log/1,2,3,4,5</c></seealso> function
+ prints a string to the test case log file.
+ The <seealso marker="ct#print-1"><c>print/1,2,3,4</c></seealso> function
+ prints the string to screen.
+ The <seealso marker="ct#pal-1"><c>pal/1,2,3,4</c></seealso> function
+ prints the same string both to file and screen. The functions are described
+ in module <seealso marker="ct">ct</seealso>.
+ </p>
+
+ <p>The optional <c>Category</c> argument can be used to categorize the
+ log printout. Categories can be used for two things as follows:</p>
+ <list type="bulleted">
<item>To compare the importance of the printout to a specific
- verbosity level, and</item>
- <item>to format the printout according to a user specific HTML
+ verbosity level.</item>
+ <item>To format the printout according to a user-specific HTML
Style Sheet (CSS).</item>
</list>
- <p>The <c>Importance</c> argument specifies a level of importance
- which, compared to a verbosity level (general and/or set per category),
- determines if the printout should be visible or not. <c>Importance</c>
- is an arbitrary integer in the range 0..99. Pre-defined constants
+ <p>Argument <c>Importance</c> specifies a level of importance
+ that, compared to a verbosity level (general and/or set per category),
+ determines if the printout is to be visible. <c>Importance</c>
+ is any integer in the range 0..99. Predefined constants
exist in the <c>ct.hrl</c> header file. The default importance level,
- <c>?STD_IMPORTANCE</c> (used if the <c>Importance</c> argument is not
- provided), is 50. This is also the importance used for standard IO, e.g.
- from printouts made with <c>io:format/2</c>, <c>io:put_chars/1</c>, etc.</p>
+ <c>?STD_IMPORTANCE</c> (used if argument <c>Importance</c> is not
+ provided), is 50. This is also the importance used for standard I/O,
+ for example, from printouts made with <c>io:format/2</c>,
+ <c>io:put_chars/1</c>, and so on.</p>
- <p><c>Importance</c> is compared to a verbosity level set by means of the
+ <p><c>Importance</c> is compared to a verbosity level set by the
<c>verbosity</c> start flag/option. The verbosity level can be set per
- category and/or generally. The default verbosity level, <c>?STD_VERBOSITY</c>,
- is 50, i.e. all standard IO gets printed. If a lower verbosity level is set,
- standard IO printouts will be ignored. Common Test performs the following test:</p>
- <pre>Importance >= (100-VerbosityLevel)</pre>
+ category or generally, or both. The default verbosity level,
+ <c>?STD_VERBOSITY</c>, is 50, that is, all standard I/O gets printed.
+ If a lower verbosity level is set, standard I/O printouts are ignored.
+ <c>Common Test</c> performs the following test:</p>
+ <pre>
+ Importance >= (100-VerbosityLevel)</pre>
<p>This also means that verbosity level 0 effectively turns all logging off
- (with the exception of printouts made by Common Test itself).</p>
+ (except from printouts made by <c>Common Test</c> itself).</p>
<p>The general verbosity level is not associated with any particular
- category. This level sets the threshold for the standard IO printouts,
- uncategorized <c>ct:log/print/pal</c> printouts, as well as
+ category. This level sets the threshold for the standard I/O printouts,
+ uncategorized <c>ct:log/print/pal</c> printouts, and
printouts for categories with undefined verbosity level.</p>
- <p>Example:</p>
- <pre>
- Some printouts during test case execution:
-
- io:format("1. Standard IO, importance = ~w~n", [?STD_IMPORTANCE]),
- ct:log("2. Uncategorized, importance = ~w", [?STD_IMPORTANCE]),
- ct:log(info, "3. Categorized info, importance = ~w", [?STD_IMPORTANCE]]),
- ct:log(info, ?LOW_IMPORTANCE, "4. Categorized info, importance = ~w", [?LOW_IMPORTANCE]),
- ct:log(error, "5. Categorized error, importance = ~w", [?HI_IMPORTANCE]),
- ct:log(error, ?HI_IMPORTANCE, "6. Categorized error, importance = ~w", [?MAX_IMPORTANCE]),
-
- If starting the test without specifying any verbosity levels:
-
- $ ct_run ...
-
- the following gets printed:
-
- 1. Standard IO, importance = 50
- 2. Uncategorized, importance = 50
- 3. Categorized info, importance = 50
- 5. Categorized error, importance = 75
- 6. Categorized error, importance = 99
-
- If starting the test with:
-
- $ ct_run -verbosity 1 and info 75
-
- the following gets printed:
-
- 3. Categorized info, importance = 50
- 4. Categorized info, importance = 25
- 6. Categorized error, importance = 99</pre>
-
- <p>How categories can be mapped to CSS tags is documented in the
- <seealso marker="run_test_chapter#html_stylesheet">Running Tests</seealso>
- chapter.</p>
-
- <p>The <c>Format</c> and <c>Args</c> arguments in <c>ct:log/print/pal</c> are
- always passed on to the <c>io:format/3</c> function in <c>stdlib</c>
- (please see the <c>io</c> manual page for details).</p>
+ <p><em>Examples:</em></p>
+ <p>Some printouts during test case execution:</p>
+ <pre>
+ io:format("1. Standard IO, importance = ~w~n", [?STD_IMPORTANCE]),
+ ct:log("2. Uncategorized, importance = ~w", [?STD_IMPORTANCE]),
+ ct:log(info, "3. Categorized info, importance = ~w", [?STD_IMPORTANCE]]),
+ ct:log(info, ?LOW_IMPORTANCE, "4. Categorized info, importance = ~w", [?LOW_IMPORTANCE]),
+ ct:log(error, "5. Categorized error, importance = ~w", [?HI_IMPORTANCE]),
+ ct:log(error, ?HI_IMPORTANCE, "6. Categorized error, importance = ~w", [?MAX_IMPORTANCE]),</pre>
+
+ <p>If starting the test without specifying any verbosity levels as follows:</p>
+ <pre>
+ $ ct_run ...</pre>
+ <p>the following is printed:</p>
+ <pre>
+ 1. Standard IO, importance = 50
+ 2. Uncategorized, importance = 50
+ 3. Categorized info, importance = 50
+ 5. Categorized error, importance = 75
+ 6. Categorized error, importance = 99</pre>
+
+ <p>If starting the test with:</p>
+ <pre>
+ $ ct_run -verbosity 1 and info 75</pre>
+ <p>the following is printed:</p>
+ <pre>
+ 3. Categorized info, importance = 50
+ 4. Categorized info, importance = 25
+ 6. Categorized error, importance = 99</pre>
+
+ <p>The arguments <c>Format</c> and <c>FormatArgs</c> in <c>ct:log/print/pal</c> are
+ always passed on to the <c>stdlib</c> function <c>io:format/3</c> (For details,
+ see the <seealso marker="stdlib:io"><c>stdlib:io</c></seealso> manual page).</p>
+
+ <p><c>ct:pal/4</c> and <c>ct:log/5</c> add headers to strings being printed to the
+ log file. The strings are also wrapped in div tags with a CSS class
+ attribute, so that stylesheet formatting can be applied. To disable this feature for
+ a printout (i.e. to get a result similar to using <c>io:format/2</c>),
+ call <c>ct:log/5</c> with the <c>no_css</c> option.</p>
+
+ <p>How categories can be mapped to CSS tags is documented in section
+ <seealso marker="run_test_chapter#html_stylesheet">HTML Style Sheets</seealso>
+ in section Running Tests and Analyzing Results.</p>
- <p>For more information about log files, please see the
- <seealso marker="run_test_chapter#log_files">Running Tests</seealso> chapter.</p>
+ <p>Common Test will escape special HTML characters (&lt;, &gt; and &amp;) in printouts
+ to the log file made with <c>ct:pal/4</c> and <c>io:format/2</c>. In order to print
+ strings with HTML tags to the log, use the <c>ct:log/5</c> function. The character escaping
+ feature is per default disabled for <c>ct:log/5</c>, but can be enabled with the
+ <c>esc_chars</c> option.</p>
+
+ <p>For more information about log files, see section
+ <seealso marker="run_test_chapter#log_files">Log Files</seealso>
+ in section Running Tests and Analyzing Results.</p>
</section>
<section>
- <title>Illegal dependencies</title>
+ <title>Illegal Dependencies</title>
<p>Even though it is highly efficient to write test suites with
- the Common Test framework, there will surely be mistakes made,
- mainly due to illegal dependencies. Noted below are some of the
+ the <c>Common Test</c> framework, mistakes can be made,
+ mainly because of illegal dependencies. Some of the
more frequent mistakes from our own experience with running the
- Erlang/OTP test suites.</p>
+ Erlang/OTP test suites follows:</p>
- <list>
- <item>Depending on current directory, and writing there:<br></br>
+ <list type="bulleted">
+ <item><p>Depending on current directory, and writing there:</p>
<p>This is a common error in test suites. It is assumed that
- the current directory is the same as what the author used as
+ the current directory is the same as the author used as
current directory when the test case was developed. Many test
cases even try to write scratch files to this directory. Instead
- <c>data_dir</c> and <c>priv_dir</c> should be used to locate
+ <c>data_dir</c> and <c>priv_dir</c> are to be used to locate
data and for writing scratch files.
</p>
</item>
- <item>Depending on execution order:<br></br>
+ <item><p>Depending on execution order:</p>
- <p>During development of test suites, no assumption should preferrably
- be made about the execution order of the test cases or suites.
- E.g. a test case should not assume that a server it depends on,
- has already been started by a previous test case. There are
- several reasons for this:
- </p>
- <p>Firstly, the user/operator may specify the order at will, and maybe
- a different execution order is more relevant or efficient on
- some particular occasion. Secondly, if the user specifies a whole
- directory of test suites for his/her test, the order the suites are
- executed will depend on how the files are listed by the operating
- system, which varies between systems. Thirdly, if a user
- wishes to run only a subset of a test suite, there is no way
- one test case could successfully depend on another.
+ <p>During development of test suites, make no assumptions on the
+ execution order of the test cases or suites. For example, a test
+ case must not assume that a server it depends on is already
+ started by a previous test case. Reasons for this follows:
</p>
+ <list type="bulleted">
+ <item>The user/operator can specify the order at will, and maybe
+ a different execution order is sometimes more relevant or
+ efficient.</item>
+ <item>If the user specifies a whole directory of test suites
+ for the test, the execution order of the suites depends on
+ how the files are listed by the operating system, which varies
+ between systems.</item>
+ <item>If a user wants to run only a subset of a test suite,
+ there is no way one test case could successfully depend on
+ another.</item>
+ </list>
</item>
- <item>Depending on Unix:<br></br>
+ <item><p>Depending on Unix:</p>
- <p>Running unix commands through <c>os:cmd</c> are likely
- not to work on non-unix platforms.
+ <p>Running Unix commands through <c>os:cmd</c> are likely
+ not to work on non-Unix platforms.
</p>
</item>
- <item>Nested test cases:<br></br>
+ <item><p>Nested test cases:</p>
- <p>Invoking a test case from another not only tests the same
- thing twice, but also makes it harder to follow what exactly
- is being tested. Also, if the called test case fails for some
- reason, so will the caller. This way one error gives cause to
- several error reports, which is less than ideal.
+ <p>Starting a test case from another not only tests the same
+ thing twice, but also makes it harder to follow what is being
+ tested. Also, if the called test case fails for some
+ reason, so do the caller. This way, one error gives cause to
+ several error reports, which is to be avoided.
</p>
- <p>Functionality common for many test case functions may be implemented
- in common help functions. If these functions are useful for test cases
- across suites, put the help functions into common help modules.
+ <p>Functionality common for many test case functions can be
+ implemented in common help functions. If these functions are
+ useful for test cases across suites, put the help functions
+ into common help modules.
</p>
</item>
- <item>Failure to crash or exit when things go wrong:<br></br>
+ <item><p>Failure to crash or exit when things go wrong:</p>
<p>Making requests without checking that the return value
- indicates success may be ok if the test case will fail at a
- later stage, but it is never acceptable just to print an error
- message (into the log file) and return successfully. Such test cases
- do harm since they create a false sense of security when overviewing
- the test results.
+ indicates success can be OK if the test case fails
+ later, but it is never acceptable just to print an error
+ message (into the log file) and return successfully. Such test
+ cases do harm, as they create a false sense of security when
+ overviewing the test results.
</p>
</item>
- <item>Messing up for subsequent test cases:<br></br>
+ <item><p>Messing up for subsequent test cases:</p>
- <p>Test cases should restore as much of the execution
- environment as possible, so that the subsequent test cases will
- not crash because of execution order of the test cases.
- The function <c>end_per_testcase</c> is suitable for this.
+ <p>Test cases are to restore as much of the execution
+ environment as possible, so that subsequent test cases
+ do not crash because of their execution order.
+ The function
+ <seealso marker="common_test#Module:end_per_testcase-2"><c>end_per_testcase</c></seealso>
+ is suitable for this.
</p>
</item>
</list>
diff --git a/lib/common_test/src/common_test.app.src b/lib/common_test/src/common_test.app.src
index d847907d75..26bcf00824 100644
--- a/lib/common_test/src/common_test.app.src
+++ b/lib/common_test/src/common_test.app.src
@@ -53,7 +53,13 @@
ct_slave,
cth_log_redirect,
cth_conn_log,
- cth_surefire
+ cth_surefire,
+ erl2html2,
+ test_server_ctrl,
+ test_server,
+ test_server_io,
+ test_server_node,
+ test_server_sup
]},
{registered, [ct_logs,
ct_util_server,
@@ -61,13 +67,27 @@
ct_make_ref,
vts,
ct_master,
- ct_master_logs]},
+ ct_master_logs,
+ test_server_ctrl,
+ test_server,
+ test_server_break_process]},
{applications, [kernel,stdlib]},
{env, []},
- {runtime_dependencies,["xmerl-1.3.8","tools-2.8",
- "test_server-3.9","stdlib-2.5","ssh-4.0",
- "snmp-5.1.2","sasl-2.4.2","runtime_tools-1.8.16",
- "kernel-4.0","inets-6.0","erts-7.0",
- "debugger-4.1","crypto-3.6","compiler-6.0",
- "observer-2.1"]}]}.
+ {runtime_dependencies,
+ ["compiler-6.0",
+ "crypto-3.6",
+ "debugger-4.1",
+ "erts-7.0",
+ "inets-6.0",
+ "kernel-4.0",
+ "observer-2.1",
+ "runtime_tools-1.8.16",
+ "sasl-2.4.2",
+ "snmp-5.1.2",
+ "ssh-4.0",
+ "stdlib-2.5",
+ "syntax_tools-1.7",
+ "tools-2.8",
+ "xmerl-1.3.8"
+ ]}]}.
diff --git a/lib/common_test/src/ct.erl b/lib/common_test/src/ct.erl
index 7958a349b4..538be514d6 100644
--- a/lib/common_test/src/ct.erl
+++ b/lib/common_test/src/ct.erl
@@ -64,7 +64,8 @@
-export([require/1, require/2,
get_config/1, get_config/2, get_config/3,
reload_config/1,
- log/1, log/2, log/3, log/4,
+ escape_chars/1, escape_chars/2,
+ log/1, log/2, log/3, log/4, log/5,
print/1, print/2, print/3, print/4,
pal/1, pal/2, pal/3, pal/4,
capture_start/0, capture_stop/0, capture_get/0, capture_get/1,
@@ -509,44 +510,88 @@ get_testspec_terms(Tags) ->
%%%-----------------------------------------------------------------
+%%% @spec escape_chars(IoList1) -> IoList2 | {error,Reason}
+%%% IoList1 = iolist()
+%%% IoList2 = iolist()
+%%%
+%%% @doc Escape special characters to be printed in html log
+%%%
+escape_chars(IoList) ->
+ ct_logs:escape_chars(IoList).
+
+%%%-----------------------------------------------------------------
+%%% @spec escape_chars(Format, Args) -> IoList | {error,Reason}
+%%% Format = string()
+%%% Args = list()
+%%%
+%%% @doc Escape special characters to be printed in html log
+%%%
+escape_chars(Format, Args) ->
+ try io_lib:format(Format, Args) of
+ IoList ->
+ ct_logs:escape_chars(IoList)
+ catch
+ _:Reason ->
+ {error,Reason}
+ end.
+
+%%%-----------------------------------------------------------------
%%% @spec log(Format) -> ok
-%%% @equiv log(default,50,Format,[])
+%%% @equiv log(default,50,Format,[],[])
log(Format) ->
- log(default,?STD_IMPORTANCE,Format,[]).
+ log(default,?STD_IMPORTANCE,Format,[],[]).
%%%-----------------------------------------------------------------
%%% @spec log(X1,X2) -> ok
%%% X1 = Category | Importance | Format
%%% X2 = Format | Args
-%%% @equiv log(Category,Importance,Format,Args)
+%%% @equiv log(Category,Importance,Format,Args,[])
log(X1,X2) ->
{Category,Importance,Format,Args} =
if is_atom(X1) -> {X1,?STD_IMPORTANCE,X2,[]};
is_integer(X1) -> {default,X1,X2,[]};
is_list(X1) -> {default,?STD_IMPORTANCE,X1,X2}
end,
- log(Category,Importance,Format,Args).
+ log(Category,Importance,Format,Args,[]).
%%%-----------------------------------------------------------------
%%% @spec log(X1,X2,X3) -> ok
+%%% X1 = Category | Importance | Format
+%%% X2 = Importance | Format | Args
+%%% X3 = Format | Args | Opts
+%%% @equiv log(Category,Importance,Format,Args,Opts)
+log(X1,X2,X3) ->
+ {Category,Importance,Format,Args,Opts} =
+ if is_atom(X1), is_integer(X2) -> {X1,X2,X3,[],[]};
+ is_atom(X1), is_list(X2) -> {X1,?STD_IMPORTANCE,X2,X3,[]};
+ is_integer(X1) -> {default,X1,X2,X3,[]};
+ is_list(X1), is_list(X2) -> {default,?STD_IMPORTANCE,X1,X2,X3}
+ end,
+ log(Category,Importance,Format,Args,Opts).
+
+%%%-----------------------------------------------------------------
+%%% @spec log(X1,X2,X3,X4) -> ok
%%% X1 = Category | Importance
%%% X2 = Importance | Format
%%% X3 = Format | Args
-%%% @equiv log(Category,Importance,Format,Args)
-log(X1,X2,X3) ->
- {Category,Importance,Format,Args} =
- if is_atom(X1), is_integer(X2) -> {X1,X2,X3,[]};
- is_atom(X1), is_list(X2) -> {X1,?STD_IMPORTANCE,X2,X3};
- is_integer(X1) -> {default,X1,X2,X3}
+%%% X4 = Args | Opts
+%%% @equiv log(Category,Importance,Format,Args,Opts)
+log(X1,X2,X3,X4) ->
+ {Category,Importance,Format,Args,Opts} =
+ if is_atom(X1), is_integer(X2) -> {X1,X2,X3,X4,[]};
+ is_atom(X1), is_list(X2) -> {X1,?STD_IMPORTANCE,X2,X3,X4};
+ is_integer(X1) -> {default,X1,X2,X3,X4}
end,
- log(Category,Importance,Format,Args).
+ log(Category,Importance,Format,Args,Opts).
%%%-----------------------------------------------------------------
-%%% @spec log(Category,Importance,Format,Args) -> ok
+%%% @spec log(Category,Importance,Format,Args,Opts) -> ok
%%% Category = atom()
%%% Importance = integer()
%%% Format = string()
%%% Args = list()
+%%% Opts = [Opt]
+%%% Opt = esc_chars | no_css
%%%
%%% @doc Printout from a test case to the log file.
%%%
@@ -558,8 +603,8 @@ log(X1,X2,X3) ->
%%% and default value for <c>Args</c> is <c>[]</c>.</p>
%%% <p>Please see the User's Guide for details on <c>Category</c>
%%% and <c>Importance</c>.</p>
-log(Category,Importance,Format,Args) ->
- ct_logs:tc_log(Category,Importance,Format,Args).
+log(Category,Importance,Format,Args,Opts) ->
+ ct_logs:tc_log(Category,Importance,Format,Args,Opts).
%%%-----------------------------------------------------------------
diff --git a/lib/common_test/src/ct_conn_log_h.erl b/lib/common_test/src/ct_conn_log_h.erl
index f7615fdc14..034906a3ba 100644
--- a/lib/common_test/src/ct_conn_log_h.erl
+++ b/lib/common_test/src/ct_conn_log_h.erl
@@ -105,52 +105,62 @@ terminate(_,#state{logs=Logs}) ->
%%% Writing reports
write_report(_Time,#conn_log{header=false,module=ConnMod}=Info,Data,GL,State) ->
case get_log(Info,GL,State) of
- {silent,_} ->
+ {silent,_,_} ->
ok;
- {LogType,Fd} ->
- io:format(Fd,"~n~ts",[format_data(ConnMod,LogType,Data)])
+ {LogType,Dest,Fd} ->
+ Str = if LogType == html, Dest == gl -> ["$tc_html","~n~ts"];
+ true -> "~n~ts"
+ end,
+ io:format(Fd,Str,[format_data(ConnMod,LogType,Data)])
end;
write_report(Time,#conn_log{module=ConnMod}=Info,Data,GL,State) ->
case get_log(Info,GL,State) of
- {silent,_} ->
+ {silent,_,_} ->
ok;
- {LogType,Fd} ->
+ {LogType,Dest,Fd} ->
case format_data(ConnMod,LogType,Data) of
- [] ->
+ [] when Info#conn_log.action==send; Info#conn_log.action==recv ->
ok;
FormattedData ->
- io:format(Fd,"~n~ts~ts~ts",[format_head(ConnMod,LogType,Time),
- format_title(LogType,Info),
- FormattedData])
+ Str = if LogType == html, Dest == gl ->
+ ["$tc_html","~n~ts~ts~ts"];
+ true ->
+ "~n~ts~ts~ts"
+ end,
+ io:format(Fd,Str,[format_head(ConnMod,LogType,Time),
+ format_title(LogType,Info),
+ FormattedData])
end
end.
write_error(Time,#conn_log{module=ConnMod}=Info,Report,GL,State) ->
case get_log(Info,GL,State) of
- {LogType,_} when LogType==html; LogType==silent ->
+ {LogType,_,_} when LogType==html; LogType==silent ->
%% The error will anyway be written in the html log by the
%% sasl error handler, so don't write it again.
ok;
- {LogType,Fd} ->
- io:format(Fd,"~n~ts~ts~ts",
- [format_head(ConnMod,LogType,Time," ERROR"),
- format_title(LogType,Info),
- format_error(LogType,Report)])
+ {LogType,Dest,Fd} ->
+ Str = if LogType == html, Dest == gl -> ["$tc_html","~n~ts~ts~ts"];
+ true -> "~n~ts~ts~ts"
+ end,
+ io:format(Fd,Str,[format_head(ConnMod,LogType,Time," ERROR"),
+ format_title(LogType,Info),
+ format_error(LogType,Report)])
end.
get_log(Info,GL,State) ->
case proplists:get_value(GL,State#state.logs) of
undefined ->
- {html,State#state.default_gl};
+ {html,gl,State#state.default_gl};
ConnLogs ->
case proplists:get_value(Info#conn_log.module,ConnLogs) of
{html,_} ->
- {html,GL};
+ {html,gl,GL};
{LogType,Fds} ->
- {LogType,get_fd(Info,Fds)};
+ {LogType,file,get_fd(Info,Fds)};
undefined ->
- {html,GL}
+ {html,gl,GL}
end
end.
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index f792269c41..19a3a51b88 100644
--- a/lib/common_test/src/ct_framework.erl
+++ b/lib/common_test/src/ct_framework.erl
@@ -28,7 +28,7 @@
-export([init_tc/3, end_tc/3, end_tc/4, get_suite/2, get_all_cases/1]).
-export([report/2, warn/1, error_notification/4]).
--export([get_logopts/0, format_comment/1, get_html_wrapper/4]).
+-export([get_log_dir/0, get_logopts/0, format_comment/1, get_html_wrapper/4]).
-export([error_in_suite/1, init_per_suite/1, end_per_suite/1,
init_per_group/2, end_per_group/2]).
@@ -52,9 +52,23 @@
%%%
%%% @doc Test server framework callback, called by the test_server
%%% when a new test case is started.
-init_tc(Mod,Func,Config) ->
+init_tc(Mod,EPTC={end_per_testcase,_},[Config]) ->
%% in case Mod == ct_framework, lookup the suite name
Suite = get_suite_name(Mod, Config),
+ case ct_hooks:init_tc(Suite,EPTC,Config) of
+ NewConfig when is_list(NewConfig) ->
+ {ok,[NewConfig]};
+ Other->
+ Other
+ end;
+
+init_tc(Mod,Func0,Args) ->
+ %% in case Mod == ct_framework, lookup the suite name
+ Suite = get_suite_name(Mod, Args),
+ {Func,HookFunc} = case Func0 of
+ {init_per_testcase,F} -> {F,Func0};
+ _ -> {Func0,Func0}
+ end,
%% check if previous testcase was interpreted and has left
%% a "dead" trace window behind - if so, kill it
@@ -86,7 +100,7 @@ init_tc(Mod,Func,Config) ->
end, [create]),
case ct_util:read_suite_data({seq,Suite,Func}) of
undefined ->
- init_tc1(Mod,Suite,Func,Config);
+ init_tc1(Mod,Suite,Func,HookFunc,Args);
Seq when is_atom(Seq) ->
case ct_util:read_suite_data({seq,Suite,Seq}) of
[Func|TCs] -> % this is the 1st case in Seq
@@ -102,27 +116,27 @@ init_tc(Mod,Func,Config) ->
_ ->
ok
end,
- init_tc1(Mod,Suite,Func,Config);
+ init_tc1(Mod,Suite,Func,HookFunc,Args);
{failed,Seq,BadFunc} ->
{auto_skip,{sequence_failed,Seq,BadFunc}}
end
end
- end.
+ end.
-init_tc1(?MODULE,_,error_in_suite,[Config0]) when is_list(Config0) ->
+init_tc1(?MODULE,_,error_in_suite,_,[Config0]) when is_list(Config0) ->
ct_logs:init_tc(false),
ct_event:notify(#event{name=tc_start,
node=node(),
data={?MODULE,error_in_suite}}),
- ct_suite_init(?MODULE, error_in_suite, [], Config0),
- case ?val(error, Config0) of
+ ct_suite_init(?MODULE,error_in_suite,[],Config0),
+ case ?val(error,Config0) of
undefined ->
{fail,"unknown_error_in_suite"};
Reason ->
{fail,Reason}
end;
-init_tc1(Mod,Suite,Func,[Config0]) when is_list(Config0) ->
+init_tc1(Mod,Suite,Func,HookFunc,[Config0]) when is_list(Config0) ->
Config1 =
case ct_util:read_suite_data(last_saved_config) of
{{Suite,LastFunc},SavedConfig} -> % last testcase
@@ -156,11 +170,13 @@ init_tc1(Mod,Suite,Func,[Config0]) when is_list(Config0) ->
%% testcase info function (these should only survive the
%% testcase, not the whole suite)
FuncSpec = group_or_func(Func,Config0),
- if is_tuple(FuncSpec) -> % group
- ok;
- true ->
- ct_config:delete_default_config(testcase)
- end,
+ HookFunc1 =
+ if is_tuple(FuncSpec) -> % group
+ FuncSpec;
+ true ->
+ ct_config:delete_default_config(testcase),
+ HookFunc
+ end,
Initialize = fun() ->
ct_logs:init_tc(false),
ct_event:notify(#event{name=tc_start,
@@ -184,14 +200,15 @@ init_tc1(Mod,Suite,Func,[Config0]) when is_list(Config0) ->
Initialize(),
{fail,Reason};
_ ->
- init_tc2(Mod,Suite,Func,SuiteInfo,MergeResult,Config)
+ init_tc2(Mod,Suite,Func,HookFunc1,
+ SuiteInfo,MergeResult,Config)
end
end;
-init_tc1(_Mod,_Suite,_Func,Args) ->
+init_tc1(_Mod,_Suite,_Func,_HookFunc,Args) ->
{ok,Args}.
-init_tc2(Mod,Suite,Func,SuiteInfo,MergeResult,Config) ->
+init_tc2(Mod,Suite,Func,HookFunc,SuiteInfo,MergeResult,Config) ->
%% timetrap must be handled before require
MergedInfo = timetrap_first(MergeResult, [], []),
%% tell logger to use specified style sheet
@@ -238,7 +255,7 @@ init_tc2(Mod,Suite,Func,SuiteInfo,MergeResult,Config) ->
{ok,PostInitHook,Config1} ->
case get('$test_server_framework_test') of
undefined ->
- ct_suite_init(Suite, FuncSpec, PostInitHook, Config1);
+ ct_suite_init(Suite,HookFunc,PostInitHook,Config1);
Fun ->
PostInitHookResult = do_post_init_hook(PostInitHook,
Config1),
@@ -251,16 +268,16 @@ init_tc2(Mod,Suite,Func,SuiteInfo,MergeResult,Config) ->
end
end.
-ct_suite_init(Suite, FuncSpec, PostInitHook, Config) when is_list(Config) ->
- case ct_hooks:init_tc(Suite, FuncSpec, Config) of
+ct_suite_init(Suite,HookFunc,PostInitHook,Config) when is_list(Config) ->
+ case ct_hooks:init_tc(Suite,HookFunc,Config) of
NewConfig when is_list(NewConfig) ->
- PostInitHookResult = do_post_init_hook(PostInitHook, NewConfig),
+ PostInitHookResult = do_post_init_hook(PostInitHook,NewConfig),
{ok, [PostInitHookResult ++ NewConfig]};
Else ->
Else
end.
-do_post_init_hook(PostInitHook, Config) ->
+do_post_init_hook(PostInitHook,Config) ->
lists:flatmap(fun({Tag,Fun}) ->
case lists:keysearch(Tag,1,Config) of
{value,_} ->
@@ -657,9 +674,23 @@ end_tc(Mod,Func,{TCPid,Result,[Args]}, Return) when is_pid(TCPid) ->
end_tc(Mod,Func,{Result,[Args]}, Return) ->
end_tc(Mod,Func,self(),Result,Args,Return).
-end_tc(Mod,Func,TCPid,Result,Args,Return) ->
+end_tc(Mod,IPTC={init_per_testcase,_Func},_TCPid,Result,Args,Return) ->
+ %% in case Mod == ct_framework, lookup the suite name
+ Suite = get_suite_name(Mod, Args),
+ case ct_hooks:end_tc(Suite,IPTC,Args,Result,Return) of
+ '$ct_no_change' ->
+ ok;
+ HookResult ->
+ HookResult
+ end;
+
+end_tc(Mod,Func0,TCPid,Result,Args,Return) ->
%% in case Mod == ct_framework, lookup the suite name
Suite = get_suite_name(Mod, Args),
+ {EPTC,Func} = case Func0 of
+ {end_per_testcase,F} -> {true,F};
+ _ -> {false,Func0}
+ end,
test_server:timetrap_cancel(),
@@ -686,11 +717,15 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) ->
end,
ct_util:delete_suite_data(last_saved_config),
- FuncSpec = group_or_func(Func,Args),
-
+ {FuncSpec,HookFunc} =
+ if not EPTC ->
+ FS = group_or_func(Func,Args),
+ {FS,FS};
+ true ->
+ {Func,Func0}
+ end,
{Result1,FinalNotify} =
- case ct_hooks:end_tc(
- Suite, FuncSpec, Args, Result, Return) of
+ case ct_hooks:end_tc(Suite,HookFunc,Args,Result,Return) of
'$ct_no_change' ->
{ok,Result};
HookResult ->
@@ -831,13 +866,13 @@ tag(_Other) ->
%%% <code>Func</code> in suite <code>Mod</code> crashing.
%%% <code>Error</code> specifies the reason for failing.
error_notification(Mod,Func,_Args,{Error,Loc}) ->
- ErrSpec = case Error of
+ ErrorSpec = case Error of
{What={_E,_R},Trace} when is_list(Trace) ->
What;
What ->
What
end,
- ErrStr = case ErrSpec of
+ ErrorStr = case ErrorSpec of
{badmatch,Descr} ->
Descr1 = lists:flatten(io_lib:format("~P",[Descr,10])),
if length(Descr1) > 50 ->
@@ -859,7 +894,8 @@ error_notification(Mod,Func,_Args,{Error,Loc}) ->
Other ->
io_lib:format("~P", [Other,5])
end,
- ErrorHtml = "<font color=\"brown\">" ++ ErrStr ++ "</font>",
+ ErrorHtml =
+ "<font color=\"brown\">" ++ ct_logs:escape_chars(ErrorStr) ++ "</font>",
case {Mod,Error} of
%% some notifications come from the main test_server process
%% and for these cases the existing comment may not be modified
@@ -887,41 +923,43 @@ error_notification(Mod,Func,_Args,{Error,Loc}) ->
end
end,
- PrintErr = fun(ErrFormat, ErrArgs) ->
+ PrintError = fun(ErrorFormat, ErrorArgs) ->
Div = "~n- - - - - - - - - - - - - - - - - - - "
"- - - - - - - - - - - - - - - - - - - - -~n",
- io:format(user, lists:concat([Div,ErrFormat,Div,"~n"]),
- ErrArgs),
+ ErrorStr2 = io_lib:format(ErrorFormat, ErrorArgs),
+ io:format(user, lists:concat([Div,ErrorStr2,Div,"~n"]),
+ []),
Link =
"\n\n<a href=\"#end\">"
"Full error description and stacktrace"
"</a>",
+ ErrorHtml2 = ct_logs:escape_chars(ErrorStr2),
ct_logs:tc_log(ct_error_notify,
?MAX_IMPORTANCE,
"CT Error Notification",
- ErrFormat++Link, ErrArgs)
+ ErrorHtml2++Link, [], [])
end,
case Loc of
[{?MODULE,error_in_suite}] ->
- PrintErr("Error in suite detected: ~ts", [ErrStr]);
+ PrintError("Error in suite detected: ~ts", [ErrorStr]);
R when R == unknown; R == undefined ->
- PrintErr("Error detected: ~ts", [ErrStr]);
+ PrintError("Error detected: ~ts", [ErrorStr]);
%% if a function specified by all/0 does not exist, we
%% pick up undef here
- [{LastMod,LastFunc}|_] when ErrStr == "undef" ->
- PrintErr("~w:~w could not be executed~nReason: ~ts",
- [LastMod,LastFunc,ErrStr]);
+ [{LastMod,LastFunc}|_] when ErrorStr == "undef" ->
+ PrintError("~w:~w could not be executed~nReason: ~ts",
+ [LastMod,LastFunc,ErrorStr]);
[{LastMod,LastFunc}|_] ->
- PrintErr("~w:~w failed~nReason: ~ts", [LastMod,LastFunc,ErrStr]);
+ PrintError("~w:~w failed~nReason: ~ts", [LastMod,LastFunc,ErrorStr]);
[{LastMod,LastFunc,LastLine}|_] ->
%% print error to console, we are only
%% interested in the last executed expression
- PrintErr("~w:~w failed on line ~w~nReason: ~ts",
- [LastMod,LastFunc,LastLine,ErrStr]),
+ PrintError("~w:~w failed on line ~w~nReason: ~ts",
+ [LastMod,LastFunc,LastLine,ErrorStr]),
case ct_util:read_suite_data({seq,Mod,Func}) of
undefined ->
@@ -1480,3 +1518,8 @@ get_html_wrapper(TestName, PrintLabel, Cwd, TableCols) ->
get_html_wrapper(TestName, PrintLabel, Cwd, TableCols, Encoding) ->
ct_logs:get_ts_html_wrapper(TestName, PrintLabel, Cwd, TableCols, Encoding).
+
+%%%-----------------------------------------------------------------
+%%% @spec get_log_dir() -> {ok,LogDir}
+get_log_dir() ->
+ ct_logs:get_log_dir(true).
diff --git a/lib/common_test/src/ct_groups.erl b/lib/common_test/src/ct_groups.erl
index 7636f15f59..92640cf323 100644
--- a/lib/common_test/src/ct_groups.erl
+++ b/lib/common_test/src/ct_groups.erl
@@ -81,7 +81,7 @@ find(Mod, all, all, [{Name,Props,Tests} | Gs], Known, Defs, _)
find(Mod, all, TCs, [{Name,Props,Tests} | Gs], Known, Defs, _)
when is_atom(Name), is_list(Props), is_list(Tests) ->
cyclic_test(Mod, Name, Known),
- Tests1 = rm_unwanted_tcs(Tests, TCs, []),
+ Tests1 = modify_tc_list(Tests, TCs, []),
trim(make_conf(Mod, Name, Props,
find(Mod, all, TCs, Tests1, [Name | Known],
Defs, true))) ++
@@ -91,7 +91,7 @@ find(Mod, all, TCs, [{Name,Props,Tests} | Gs], Known, Defs, _)
find(Mod, [Name|GrNames]=SPath, TCs, [{Name,Props,Tests} | Gs], Known,
Defs, FindAll) when is_atom(Name), is_list(Props), is_list(Tests) ->
cyclic_test(Mod, Name, Known),
- Tests1 = rm_unwanted_tcs(Tests, TCs, GrNames),
+ Tests1 = modify_tc_list(Tests, TCs, GrNames),
trim(make_conf(Mod, Name, Props,
find(Mod, GrNames, TCs, Tests1, [Name|Known],
Defs, FindAll))) ++
@@ -133,7 +133,7 @@ find(_Mod, [_|_], _TCs, [], _Known, _Defs, _) ->
find(Mod, GrNames, TCs, [{Name,Props,Tests} | Gs], Known,
Defs, FindAll) when is_atom(Name), is_list(Props), is_list(Tests) ->
cyclic_test(Mod, Name, Known),
- Tests1 = rm_unwanted_tcs(Tests, TCs, GrNames),
+ Tests1 = modify_tc_list(Tests, TCs, GrNames),
trim(make_conf(Mod, Name, Props,
find(Mod, GrNames, TCs, Tests1, [Name|Known],
Defs, FindAll))) ++
@@ -284,70 +284,57 @@ trim_test(Test) ->
%% GrNames is [] if the terminating group has been found. From
%% that point, all specified test should be included (as well as
%% sub groups for deeper search).
-rm_unwanted_tcs(Tests, all, []) ->
- Tests;
-
-rm_unwanted_tcs(Tests, TCs, []) ->
- sort_tests(lists:flatmap(fun(Test) when is_tuple(Test),
- (size(Test) > 2) ->
- [Test];
- (Test={group,_}) ->
- [Test];
- (Test={_M,TC}) ->
- case lists:member(TC, TCs) of
- true -> [Test];
- false -> []
- end;
- (Test) when is_atom(Test) ->
- case lists:keysearch(Test, 2, TCs) of
- {value,_} ->
- [Test];
- _ ->
- case lists:member(Test, TCs) of
- true -> [Test];
- false -> []
- end
- end;
- (Test) -> [Test]
- end, Tests), TCs);
-
-rm_unwanted_tcs(Tests, _TCs, _) ->
- [Test || Test <- Tests, not is_atom(Test)].
-
-%% make sure the order of tests is according to the order in TCs
-sort_tests(Tests, TCs) when is_list(TCs)->
- lists:sort(fun(T1, T2) ->
- case {is_tc(T1),is_tc(T2)} of
- {true,true} ->
- (position(T1, TCs) =<
- position(T2, TCs));
- {false,true} ->
- (position(T2, TCs) == (length(TCs)+1));
- _ -> true
-
- end
- end, Tests);
-sort_tests(Tests, _) ->
- Tests.
-
-is_tc(T) when is_atom(T) -> true;
-is_tc({group,_}) -> false;
-is_tc({_M,T}) when is_atom(T) -> true;
-is_tc(_) -> false.
-
-position(T, TCs) ->
- position(T, TCs, 1).
-
-position(T, [T|_TCs], Pos) ->
- Pos;
-position(T, [{_,T}|_TCs], Pos) ->
- Pos;
-position({M,T}, [T|_TCs], Pos) when M /= group ->
- Pos;
-position(T, [_|TCs], Pos) ->
- position(T, TCs, Pos+1);
-position(_, [], Pos) ->
- Pos.
+modify_tc_list(GrSpecTs, all, []) ->
+ GrSpecTs;
+
+modify_tc_list(GrSpecTs, TSCs, []) ->
+ modify_tc_list1(GrSpecTs, TSCs);
+
+modify_tc_list(GrSpecTs, _TSCs, _) ->
+ [Test || Test <- GrSpecTs, not is_atom(Test)].
+
+modify_tc_list1(GrSpecTs, TSCs) ->
+ %% remove all cases in group tc list that should not be executed
+ GrSpecTs1 =
+ lists:flatmap(fun(Test) when is_tuple(Test),
+ (size(Test) > 2) ->
+ [Test];
+ (Test={group,_}) ->
+ [Test];
+ (Test={_M,TC}) ->
+ case lists:member(TC, TSCs) of
+ true -> [Test];
+ false -> []
+ end;
+ (Test) when is_atom(Test) ->
+ case lists:keysearch(Test, 2, TSCs) of
+ {value,_} ->
+ [Test];
+ _ ->
+ case lists:member(Test, TSCs) of
+ true -> [Test];
+ false -> []
+ end
+ end;
+ (Test) -> [Test]
+ end, GrSpecTs),
+ {TSCs2,GrSpecTs3} =
+ lists:foldr(
+ fun(TC, {TSCs1,GrSpecTs2}) ->
+ case lists:member(TC,GrSpecTs1) of
+ true ->
+ {[TC|TSCs1],lists:delete(TC,GrSpecTs2)};
+ false ->
+ case lists:keymember(TC, 2, GrSpecTs) of
+ {value,Test} ->
+ {[Test|TSCs1],
+ lists:keydelete(TC, 2, GrSpecTs2)};
+ false ->
+ {TSCs1,GrSpecTs2}
+ end
+ end
+ end, {[],GrSpecTs1}, TSCs),
+ TSCs2 ++ GrSpecTs3.
%%%-----------------------------------------------------------------
diff --git a/lib/common_test/src/ct_hooks.erl b/lib/common_test/src/ct_hooks.erl
index 86d18696dc..83ad33fdd8 100644
--- a/lib/common_test/src/ct_hooks.erl
+++ b/lib/common_test/src/ct_hooks.erl
@@ -93,7 +93,11 @@ init_tc(Mod, {init_per_group, GroupName, Properties}, Config) ->
call(fun call_generic/3, Config, [pre_init_per_group, GroupName]);
init_tc(_Mod, {end_per_group, GroupName, _}, Config) ->
call(fun call_generic/3, Config, [pre_end_per_group, GroupName]);
-init_tc(_Mod, TC, Config) ->
+init_tc(_Mod, {init_per_testcase,TC}, Config) ->
+ call(fun call_generic/3, Config, [pre_init_per_testcase, TC]);
+init_tc(_Mod, {end_per_testcase,TC}, Config) ->
+ call(fun call_generic/3, Config, [pre_end_per_testcase, TC]);
+init_tc(_Mod, TC = error_in_suite, Config) ->
call(fun call_generic/3, Config, [pre_init_per_testcase, TC]).
%% @doc Called as each test case is completed. This includes all configuration
@@ -126,10 +130,17 @@ end_tc(Mod, {end_per_group, GroupName, Properties}, Config, Result, _Return) ->
[post_end_per_group, GroupName, Config], '$ct_no_change'),
maybe_stop_locker(Mod, GroupName, Properties),
Res;
-end_tc(_Mod, TC, Config, Result, _Return) ->
+end_tc(_Mod, {init_per_testcase,TC}, Config, Result, _Return) ->
+ call(fun call_generic/3, Result, [post_init_per_testcase, TC, Config],
+ '$ct_no_change');
+end_tc(_Mod, {end_per_testcase,TC}, Config, Result, _Return) ->
+ call(fun call_generic/3, Result, [post_end_per_testcase, TC, Config],
+ '$ct_no_change');
+end_tc(_Mod, TC = error_in_suite, Config, Result, _Return) ->
call(fun call_generic/3, Result, [post_end_per_testcase, TC, Config],
'$ct_no_change').
+
%% Case = TestCase | {TestCase,GroupName}
on_tc_skip(How, {Suite, Case, Reason}) ->
call(fun call_cleanup/3, {How, Reason}, [on_tc_skip, Suite, Case]).
@@ -244,6 +255,8 @@ remove(_, Else) ->
%% Translate scopes, i.e. init_per_group,group1 -> end_per_group,group1 etc
scope([pre_init_per_testcase, TC|_]) ->
+ [post_init_per_testcase, TC];
+scope([pre_end_per_testcase, TC|_]) ->
[post_end_per_testcase, TC];
scope([pre_init_per_group, GroupName|_]) ->
[post_end_per_group, GroupName];
@@ -317,7 +330,8 @@ get_hooks() ->
%% If we are doing a cleanup call i.e. {post,pre}_end_per_*, all priorities
%% are reversed. Probably want to make this sorting algorithm pluginable
%% as some point...
-resort(Calls,Hooks,[F|_R]) when F == post_end_per_testcase;
+resort(Calls,Hooks,[F|_R]) when F == pre_end_per_testcase;
+ F == post_end_per_testcase;
F == pre_end_per_group;
F == post_end_per_group;
F == pre_end_per_suite;
@@ -367,10 +381,10 @@ pos(Id,[_|Rest],Num) ->
catch_apply(M,F,A, Default) ->
try
- apply(M,F,A)
+ erlang:apply(M,F,A)
catch _:Reason ->
case erlang:get_stacktrace() of
- %% Return the default if it was the CTH module which did not have the function.
+ %% Return the default if it was the CTH module which did not have the function.
[{M,F,A,_}|_] when Reason == undef ->
Default;
Trace ->
diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl
index 78081380e7..4920383f39 100644
--- a/lib/common_test/src/ct_logs.erl
+++ b/lib/common_test/src/ct_logs.erl
@@ -37,15 +37,17 @@
-export([add_external_logs/1, add_link/3]).
-export([make_last_run_index/0]).
-export([make_all_suites_index/1,make_all_runs_index/1]).
--export([get_ts_html_wrapper/5]).
+-export([get_ts_html_wrapper/5, escape_chars/1]).
-export([xhtml/2, locate_priv_file/1, make_relative/1]).
-export([insert_javascript/1]).
-export([uri/1]).
%% Logging stuff directly from testcase
--export([tc_log/3, tc_log/4, tc_log/5, tc_log_async/3, tc_log_async/5,
+-export([tc_log/3, tc_log/4, tc_log/5, tc_log/6,
+ tc_log_async/3, tc_log_async/5,
tc_print/3, tc_print/4,
- tc_pal/3, tc_pal/4, ct_log/3, basic_html/0]).
+ tc_pal/3, tc_pal/4, ct_log/3,
+ basic_html/0]).
%% Simulate logger process for use without ct environment running
-export([simulate/0]).
@@ -267,7 +269,7 @@ cast(Msg) ->
%%% <p>This function is called by ct_framework:init_tc/3</p>
init_tc(RefreshLog) ->
call({init_tc,self(),group_leader(),RefreshLog}),
- io:format(xhtml("", "<br />")),
+ io:format(["$tc_html",xhtml("", "<br />")]),
ok.
%%%-----------------------------------------------------------------
@@ -314,9 +316,10 @@ unregister_groupleader(Pid) ->
%%% data to log (as in <code>io:format(Format,Args)</code>).</p>
log(Heading,Format,Args) ->
cast({log,sync,self(),group_leader(),ct_internal,?MAX_IMPORTANCE,
- [{int_header(),[log_timestamp(?now),Heading]},
+ [{hd,int_header(),[log_timestamp(?now),Heading]},
{Format,Args},
- {int_footer(),[]}]}),
+ {ft,int_footer(),[]}],
+ true}),
ok.
%%%-----------------------------------------------------------------
@@ -336,7 +339,7 @@ log(Heading,Format,Args) ->
%%% @see end_log/0
start_log(Heading) ->
cast({log,sync,self(),group_leader(),ct_internal,?MAX_IMPORTANCE,
- [{int_header(),[log_timestamp(?now),Heading]}]}),
+ [{hd,int_header(),[log_timestamp(?now),Heading]}],false}),
ok.
%%%-----------------------------------------------------------------
@@ -351,7 +354,7 @@ cont_log([],[]) ->
cont_log(Format,Args) ->
maybe_log_timestamp(),
cast({log,sync,self(),group_leader(),ct_internal,?MAX_IMPORTANCE,
- [{Format,Args}]}),
+ [{Format,Args}],true}),
ok.
%%%-----------------------------------------------------------------
@@ -363,7 +366,7 @@ cont_log(Format,Args) ->
%%% @see cont_log/2
end_log() ->
cast({log,sync,self(),group_leader(),ct_internal,?MAX_IMPORTANCE,
- [{int_footer(), []}]}),
+ [{ft,int_footer(), []}],false}),
ok.
@@ -400,32 +403,46 @@ add_link(Heading,File,Type) ->
%%% @spec tc_log(Category,Format,Args) -> ok
%%% @equiv tc_log(Category,?STD_IMPORTANCE,Format,Args)
tc_log(Category,Format,Args) ->
- tc_log(Category,?STD_IMPORTANCE,Format,Args).
+ tc_log(Category,?STD_IMPORTANCE,"User",Format,Args,[]).
%%%-----------------------------------------------------------------
%%% @spec tc_log(Category,Importance,Format,Args) -> ok
%%% @equiv tc_log(Category,Importance,"User",Format,Args)
tc_log(Category,Importance,Format,Args) ->
- tc_log(Category,Importance,"User",Format,Args).
+ tc_log(Category,Importance,"User",Format,Args,[]).
%%%-----------------------------------------------------------------
-%%% @spec tc_log(Category,Importance,Printer,Format,Args) -> ok
+%%% @spec tc_log(Category,Importance,Format,Args) -> ok
+%%% @equiv tc_log(Category,Importance,"User",Format,Args)
+tc_log(Category,Importance,Format,Args,Opts) ->
+ tc_log(Category,Importance,"User",Format,Args,Opts).
+
+%%%-----------------------------------------------------------------
+%%% @spec tc_log(Category,Importance,Printer,Format,Args,Opts) -> ok
%%% Category = atom()
%%% Importance = integer()
%%% Printer = string()
%%% Format = string()
%%% Args = list()
+%%% Opts = list()
%%%
%%% @doc Printout from a testcase.
%%%
%%% <p>This function is called by <code>ct</code> when logging
%%% stuff directly from a testcase (i.e. not from within the CT
%%% framework).</p>
-tc_log(Category,Importance,Printer,Format,Args) ->
- cast({log,sync,self(),group_leader(),Category,Importance,
- [{div_header(Category,Printer),[]},
- {Format,Args},
- {div_footer(),[]}]}),
+tc_log(Category,Importance,Printer,Format,Args,Opts) ->
+ Data =
+ case lists:member(no_css, Opts) of
+ true ->
+ [{Format,Args}];
+ false ->
+ [{hd,div_header(Category,Printer),[]},
+ {Format,Args},
+ {ft,div_footer(),[]}]
+ end,
+ cast({log,sync,self(),group_leader(),Category,Importance,Data,
+ lists:member(esc_chars, Opts)}),
ok.
%%%-----------------------------------------------------------------
@@ -451,9 +468,10 @@ tc_log_async(Category,Format,Args) ->
%%% asks ct_logs for an html wrapper.</p>
tc_log_async(Category,Importance,Printer,Format,Args) ->
cast({log,async,self(),group_leader(),Category,Importance,
- [{div_header(Category,Printer),[]},
+ [{hd,div_header(Category,Printer),[]},
{Format,Args},
- {div_footer(),[]}]}),
+ {ft,div_footer(),[]}],
+ true}),
ok.
%%%-----------------------------------------------------------------
%%% @spec tc_print(Category,Format,Args)
@@ -522,43 +540,45 @@ tc_pal(Category,Format,Args) ->
tc_pal(Category,Importance,Format,Args) ->
tc_print(Category,Importance,Format,Args),
cast({log,sync,self(),group_leader(),Category,Importance,
- [{div_header(Category),[]},
+ [{hd,div_header(Category),[]},
{Format,Args},
- {div_footer(),[]}]}),
+ {ft,div_footer(),[]}],
+ true}),
ok.
%%%-----------------------------------------------------------------
-%%% @spec ct_pal(Category,Format,Args) -> ok
+%%% @spec ct_log(Category,Format,Args) -> ok
%%% Category = atom()
%%% Format = string()
%%% Args = list()
%%%
-%%% @doc Print and log to the ct framework log
+%%% @doc Print to the ct framework log
%%%
%%% <p>This function is called by internal ct functions to
%%% force logging to the ct framework log</p>
ct_log(Category,Format,Args) ->
- cast({ct_log,[{div_header(Category),[]},
+ cast({ct_log,[{hd,div_header(Category),[]},
{Format,Args},
- {div_footer(),[]}]}),
+ {ft,div_footer(),[]}],
+ true}),
ok.
%%%=================================================================
%%% Internal functions
int_header() ->
- "<div class=\"ct_internal\"><b>*** CT ~s *** ~ts</b>".
+ "</pre>\n<div class=\"ct_internal\"><pre><b>*** CT ~s *** ~ts</b>".
int_footer() ->
- "</div>".
+ "</pre></div>\n<pre>".
div_header(Class) ->
div_header(Class,"User").
div_header(Class,Printer) ->
- "\n<div class=\"" ++ atom_to_list(Class) ++ "\"><b>*** " ++ Printer ++
- " " ++ log_timestamp(?now) ++ " ***</b>".
+ "\n</pre>\n<div class=\"" ++ atom_to_list(Class) ++ "\"><pre><b>*** "
+ ++ Printer ++ " " ++ log_timestamp(?now) ++ " ***</b>".
div_footer() ->
- "</div>".
+ "</pre></div>\n<pre>".
maybe_log_timestamp() ->
@@ -568,7 +588,7 @@ maybe_log_timestamp() ->
ok;
_ ->
cast({log,sync,self(),group_leader(),ct_internal,?MAX_IMPORTANCE,
- [{"<i>~s</i>",[log_timestamp({MS,S,US})]}]})
+ [{hd,"<i>~s</i>",[log_timestamp({MS,S,US})]}],false})
end.
log_timestamp({MS,S,US}) ->
@@ -729,7 +749,7 @@ copy_priv_files([], []) ->
logger_loop(State) ->
receive
- {log,SyncOrAsync,Pid,GL,Category,Importance,List} ->
+ {log,SyncOrAsync,Pid,GL,Category,Importance,Content,EscChars} ->
VLvl = case Category of
ct_internal ->
?MAX_VERBOSITY;
@@ -746,15 +766,15 @@ logger_loop(State) ->
case erlang:is_process_alive(TCGL) of
true ->
State1 = print_to_log(SyncOrAsync, Pid,
- Category,
- TCGL, List, State),
+ Category, TCGL, Content,
+ EscChars, State),
logger_loop(State1#logger_state{
tc_groupleaders = TCGLs});
false ->
%% Group leader is dead, so write to the
%% CtLog or unexpected_io log instead
- unexpected_io(Pid,Category,Importance,
- List,CtLogFd),
+ unexpected_io(Pid, Category, Importance,
+ Content, CtLogFd, EscChars),
logger_loop(State)
end;
@@ -762,7 +782,8 @@ logger_loop(State) ->
%% If category is ct_internal then write
%% to ct_log, else write to unexpected_io
%% log
- unexpected_io(Pid,Category,Importance,List,CtLogFd),
+ unexpected_io(Pid, Category, Importance, Content,
+ CtLogFd, EscChars),
logger_loop(State#logger_state{
tc_groupleaders = TCGLs})
end;
@@ -818,10 +839,17 @@ logger_loop(State) ->
logger_loop(State);
{clear_stylesheet,_} ->
logger_loop(State#logger_state{stylesheet = undefined});
- {ct_log, List} ->
+ {ct_log,Content,EscChars} ->
+ Str = lists:map(fun({_HdOrFt,Str,Args}) ->
+ [io_lib:format(Str,Args),io_lib:nl()];
+ ({Str,Args}) when EscChars ->
+ Io = io_lib:format(Str,Args),
+ [escape_chars(Io),io_lib:nl()];
+ ({Str,Args}) ->
+ [io_lib:format(Str,Args),io_lib:nl()]
+ end, Content),
Fd = State#logger_state.ct_log_fd,
- [begin io:format(Fd,Str,Args),io:nl(Fd) end ||
- {Str,Args} <- List],
+ io:format(Fd, "~ts", [Str]),
logger_loop(State);
{'DOWN',Ref,_,_Pid,_} ->
%% there might be print jobs executing in parallel with ct_logs
@@ -843,45 +871,74 @@ logger_loop(State) ->
ok
end.
-create_io_fun(FromPid, CtLogFd) ->
+create_io_fun(FromPid, CtLogFd, EscChars) ->
%% we have to build one io-list of all strings
%% before printing, or other io printouts (made in
%% parallel) may get printed between this header
%% and footer
- fun({Str,Args}, IoList) ->
- case catch io_lib:format(Str,Args) of
- {'EXIT',_Reason} ->
+ fun(FormatData, IoList) ->
+ {Escapable,Str,Args} =
+ case FormatData of
+ {_HdOrFt,S,A} -> {false,S,A};
+ {S,A} -> {true,S,A}
+ end,
+ try io_lib:format(Str,Args) of
+ IoStr when Escapable, EscChars, IoList == [] ->
+ escape_chars(IoStr);
+ IoStr when Escapable, EscChars ->
+ [IoList,"\n",escape_chars(IoStr)];
+ IoStr when IoList == [] ->
+ IoStr;
+ IoStr ->
+ [IoList,"\n",IoStr]
+ catch
+ _:_Reason ->
io:format(CtLogFd, "Logging fails! Str: ~p, Args: ~p~n",
[Str,Args]),
%% stop the testcase, we need to see the fault
exit(FromPid, {log_printout_error,Str,Args}),
- [];
- IoStr when IoList == [] ->
- [IoStr];
- IoStr ->
- [IoList,"\n",IoStr]
+ []
end
end.
-print_to_log(sync, FromPid, Category, TCGL, List, State) ->
+escape_chars([Bin | Io]) when is_binary(Bin) ->
+ [Bin | escape_chars(Io)];
+escape_chars([List | Io]) when is_list(List) ->
+ [escape_chars(List) | escape_chars(Io)];
+escape_chars([$< | Io]) ->
+ ["&lt;" | escape_chars(Io)];
+escape_chars([$> | Io]) ->
+ ["&gt;" | escape_chars(Io)];
+escape_chars([$& | Io]) ->
+ ["&amp;" | escape_chars(Io)];
+escape_chars([Char | Io]) when is_integer(Char) ->
+ [Char | escape_chars(Io)];
+escape_chars([]) ->
+ [];
+escape_chars(Bin) ->
+ Bin.
+
+print_to_log(sync, FromPid, Category, TCGL, Content, EscChars, State) ->
%% in some situations (exceptions), the printout is made from the
%% test server IO process and there's no valid group leader to send to
CtLogFd = State#logger_state.ct_log_fd,
if FromPid /= TCGL ->
- IoFun = create_io_fun(FromPid, CtLogFd),
- io:format(TCGL,"~ts", [lists:foldl(IoFun, [], List)]);
+ IoFun = create_io_fun(FromPid, CtLogFd, EscChars),
+ IoList = lists:foldl(IoFun, [], Content),
+ io:format(TCGL,["$tc_html","~ts"], [IoList]);
true ->
- unexpected_io(FromPid,Category,?MAX_IMPORTANCE,List,CtLogFd)
+ unexpected_io(FromPid, Category, ?MAX_IMPORTANCE, Content,
+ CtLogFd, EscChars)
end,
State;
-print_to_log(async, FromPid, Category, TCGL, List, State) ->
+print_to_log(async, FromPid, Category, TCGL, Content, EscChars, State) ->
%% in some situations (exceptions), the printout is made from the
%% test server IO process and there's no valid group leader to send to
CtLogFd = State#logger_state.ct_log_fd,
Printer =
if FromPid /= TCGL ->
- IoFun = create_io_fun(FromPid, CtLogFd),
+ IoFun = create_io_fun(FromPid, CtLogFd, EscChars),
fun() ->
test_server:permit_io(TCGL, self()),
@@ -894,25 +951,25 @@ print_to_log(async, FromPid, Category, TCGL, List, State) ->
case erlang:is_process_alive(TCGL) of
true ->
- try io:format(TCGL, "~ts",
- [lists:foldl(IoFun,[],List)]) of
+ try io:format(TCGL, ["$tc_html","~ts"],
+ [lists:foldl(IoFun,[],Content)]) of
_ -> ok
catch
_:terminated ->
unexpected_io(FromPid, Category,
?MAX_IMPORTANCE,
- List, CtLogFd)
+ Content, CtLogFd, EscChars)
end;
false ->
unexpected_io(FromPid, Category,
?MAX_IMPORTANCE,
- List, CtLogFd)
+ Content, CtLogFd, EscChars)
end
end;
true ->
fun() ->
unexpected_io(FromPid, Category, ?MAX_IMPORTANCE,
- List, CtLogFd)
+ Content, CtLogFd, EscChars)
end
end,
case State#logger_state.async_print_jobs of
@@ -1087,12 +1144,6 @@ print_style(Fd,StyleSheet) ->
print_style_error(Fd,StyleSheet,Reason)
end.
-%% Simple link version, doesn't work with all browsers unfortunately. :-(
-%% print_style(Fd, StyleSheet) ->
-%% io:format(Fd,
-%% "<link href=~p rel=\"stylesheet\" type=\"text/css\">",
-%% [StyleSheet]).
-
print_style_error(Fd,StyleSheet,Reason) ->
io:format(Fd,"\n<!-- Failed to load stylesheet ~ts: ~p -->\n",
[StyleSheet,Reason]),
@@ -1364,11 +1415,11 @@ total_row(Success, Fail, UserSkip, AutoSkip, NotBuilt, All) ->
[xhtml("<tr valign=top>\n",
["</tbody>\n<tfoot>\n<tr class=\"",odd_or_even(),"\">\n"]),
"<td><b>Total</b></td>\n", Label, TimestampCell,
- "<td align=right><b>",integer_to_list(Success),"<b></td>\n",
- "<td align=right><b>",integer_to_list(Fail),"<b></td>\n",
+ "<td align=right><b>",integer_to_list(Success),"</b></td>\n",
+ "<td align=right><b>",integer_to_list(Fail),"</b></td>\n",
"<td align=right>",integer_to_list(AllSkip),
" (",UserSkipStr,"/",AutoSkipStr,")</td>\n",
- "<td align=right><b>",integer_to_list(NotBuilt),"<b></td>\n",
+ "<td align=right><b>",integer_to_list(NotBuilt),"</b></td>\n",
AllInfo, "</tr>\n",
xhtml("","</tfoot>\n")].
@@ -1560,10 +1611,12 @@ header1(Title, SubTitle, TableCols) ->
"<!-- autogenerated by '"++atom_to_list(?MODULE)++"' -->\n",
"<head>\n",
"<title>" ++ Title ++ " " ++ SubTitle ++ "</title>\n",
- "<meta http-equiv=\"cache-control\" content=\"no-cache\">\n",
- "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n",
+ "<meta http-equiv=\"cache-control\" content=\"no-cache\"></meta>\n",
+ "<meta http-equiv=\"content-type\" content=\"text/html; "
+ "charset=utf-8\"></meta>\n",
xhtml("",
- ["<link rel=\"stylesheet\" href=\"",uri(CSSFile),"\" type=\"text/css\">\n"]),
+ ["<link rel=\"stylesheet\" href=\"",uri(CSSFile),
+ "\" type=\"text/css\"></link>\n"]),
xhtml("",
["<script type=\"text/javascript\" src=\"",JQueryFile,
"\"></script>\n"]),
@@ -1610,7 +1663,7 @@ footer() ->
"Copyright &copy; ", year(),
" <a href=\"http://www.erlang.org\">Open Telecom Platform</a>",
xhtml("<br>\n", "<br />\n"),
- "Updated: <!date>", current_time(), "<!/date>",
+ "Updated: <!--date-->", current_time(), "<!--/date-->",
xhtml("<br>\n", "<br />\n"),
xhtml("</font></p>\n", "</div>\n"),
"</center>\n"
@@ -1985,9 +2038,9 @@ interactive_link() ->
"<!-- autogenerated by '"++atom_to_list(?MODULE)++"' -->\n",
"<head>\n",
"<title>Last interactive run</title>\n",
- "<meta http-equiv=\"cache-control\" content=\"no-cache\">\n",
+ "<meta http-equiv=\"cache-control\" content=\"no-cache\"></meta>\n",
"<meta http-equiv=\"content-type\" content=\"text/html; "
- "charset=utf-8\">\n",
+ "charset=utf-8\"></meta>\n",
"</head>\n",
"<body>\n",
"Log from last interactive run: <a href=\"",uri(CtLog),"\">",
@@ -2846,8 +2899,12 @@ simulate() ->
simulate_logger_loop() ->
receive
- {log,_,_,_,_,_,List} ->
- S = [[io_lib:format(Str,Args),io_lib:nl()] || {Str,Args} <- List],
+ {log,_,_,_,_,_,Content,_} ->
+ S = lists:map(fun({_,Str,Args}) ->
+ [io_lib:format(Str,Args),io_lib:nl()];
+ ({Str,Args}) ->
+ [io_lib:format(Str,Args),io_lib:nl()]
+ end, Content),
io:format("~ts",[S]),
simulate_logger_loop();
stop ->
@@ -3053,15 +3110,15 @@ get_ts_html_wrapper(TestName, Logdir, PrintLabel, Cwd, TableCols, Encoding) ->
"Copyright &copy; ", year(),
" <a href=\"http://www.erlang.org\">",
"Open Telecom Platform</a><br>\n",
- "Updated: <!date>", current_time(), "<!/date>",
+ "Updated: <!--date-->", current_time(), "<!--/date-->",
"<br>\n</font></p>\n"],
{basic_html,
["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n",
"<html>\n",
"<head><title>", TestName1, "</title>\n",
- "<meta http-equiv=\"cache-control\" content=\"no-cache\">\n",
+ "<meta http-equiv=\"cache-control\" content=\"no-cache\"></meta>\n",
"<meta http-equiv=\"content-type\" content=\"text/html; charset=",
- html_encoding(Encoding),"\">\n",
+ html_encoding(Encoding),"\"></meta>\n",
"</head>\n",
"<body", Bgr, " bgcolor=\"white\" text=\"black\" ",
"link=\"blue\" vlink=\"purple\" alink=\"red\">\n",
@@ -3078,7 +3135,7 @@ get_ts_html_wrapper(TestName, Logdir, PrintLabel, Cwd, TableCols, Encoding) ->
"Copyright &copy; ", year(),
" <a href=\"http://www.erlang.org\">",
"Open Telecom Platform</a><br />\n",
- "Updated: <!date>", current_time(), "<!/date>",
+ "Updated: <!--date-->", current_time(), "<!--/date-->",
"<br />\n</div>\n"],
CSSFile =
xhtml(fun() -> "" end,
@@ -3105,9 +3162,11 @@ get_ts_html_wrapper(TestName, Logdir, PrintLabel, Cwd, TableCols, Encoding) ->
"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n",
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n",
"<head>\n<title>", TestName1, "</title>\n",
- "<meta http-equiv=\"cache-control\" content=\"no-cache\">\n",
- "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n",
- "<link rel=\"stylesheet\" href=\"", uri(CSSFile), "\" type=\"text/css\">\n",
+ "<meta http-equiv=\"cache-control\" content=\"no-cache\"></meta>\n",
+ "<meta http-equiv=\"content-type\" content=\"text/html; ",
+ "charset=utf-8\"></meta>\n",
+ "<link rel=\"stylesheet\" href=\"", uri(CSSFile),
+ "\" type=\"text/css\"></link>\n",
"<script type=\"text/javascript\" src=\"", JQueryFile, "\"></script>\n",
"<script type=\"text/javascript\" src=\"", TableSorterFile, "\"></script>\n"] ++
TableSorterScript ++ ["</head>\n","<body>\n", LabelStr, "\n"],
@@ -3233,11 +3292,11 @@ html_encoding(latin1) ->
html_encoding(utf8) ->
"utf-8".
-unexpected_io(Pid,ct_internal,_Importance,List,CtLogFd) ->
- IoFun = create_io_fun(Pid,CtLogFd),
- io:format(CtLogFd, "~ts", [lists:foldl(IoFun, [], List)]);
-unexpected_io(Pid,_Category,_Importance,List,CtLogFd) ->
- IoFun = create_io_fun(Pid,CtLogFd),
- Data = io_lib:format("~ts", [lists:foldl(IoFun, [], List)]),
+unexpected_io(Pid, ct_internal, _Importance, Content, CtLogFd, EscChars) ->
+ IoFun = create_io_fun(Pid, CtLogFd, EscChars),
+ io:format(CtLogFd, "~ts", [lists:foldl(IoFun, [], Content)]);
+unexpected_io(Pid, _Category, _Importance, Content, CtLogFd, EscChars) ->
+ IoFun = create_io_fun(Pid, CtLogFd, EscChars),
+ Data = io_lib:format("~ts", [lists:foldl(IoFun, [], Content)]),
test_server_io:print_unexpected(Data),
ok.
diff --git a/lib/common_test/src/ct_master_logs.erl b/lib/common_test/src/ct_master_logs.erl
index 2adced42ae..54190a8254 100644
--- a/lib/common_test/src/ct_master_logs.erl
+++ b/lib/common_test/src/ct_master_logs.erl
@@ -238,9 +238,9 @@ config_table1([]) ->
["</tbody>\n</table>\n"].
int_header() ->
- "<div class=\"ct_internal\"><b>*** CT MASTER ~s *** ~ts</b>".
+ "</pre>\n<div class=\"ct_internal\"><pre><b>*** CT MASTER ~s *** ~ts</b>".
int_footer() ->
- "</div>".
+ "</pre></div>\n<pre>".
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% NodeDir Index functions %%%
@@ -387,11 +387,12 @@ header(Title, TableCols) ->
"<!-- autogenerated by '"++atom_to_list(?MODULE)++"' -->\n",
"<head>\n",
"<title>" ++ Title ++ "</title>\n",
- "<meta http-equiv=\"cache-control\" content=\"no-cache\">\n",
- "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n",
+ "<meta http-equiv=\"cache-control\" content=\"no-cache\"></meta>\n",
+ "<meta http-equiv=\"content-type\" content=\"text/html; ",
+ "charset=utf-8\"></meta>\n",
xhtml("",
["<link rel=\"stylesheet\" href=\"",ct_logs:uri(CSSFile),
- "\" type=\"text/css\">"]),
+ "\" type=\"text/css\"></link>\n"]),
xhtml("",
["<script type=\"text/javascript\" src=\"",JQueryFile,
"\"></script>\n"]),
@@ -419,7 +420,7 @@ footer() ->
"Copyright &copy; ", year(),
" <a href=\"http://www.erlang.org\">Open Telecom Platform</a>",
xhtml("<br>\n", "<br />\n"),
- "Updated: <!date>", current_time(), "<!/date>",
+ "Updated: <!--date-->", current_time(), "<--!/date-->",
xhtml("<br>\n", "<br />\n"),
xhtml("</font></p>\n", "</div>\n"),
"</center>\n"
diff --git a/lib/common_test/src/ct_netconfc.erl b/lib/common_test/src/ct_netconfc.erl
index 3da1115c76..8812514ad9 100644
--- a/lib/common_test/src/ct_netconfc.erl
+++ b/lib/common_test/src/ct_netconfc.erl
@@ -234,7 +234,6 @@
%% Internal defines
%%----------------------------------------------------------------------
-define(APPLICATION,?MODULE).
--define(VALID_SSH_OPTS,[user, password, user_dir]).
-define(DEFAULT_STREAM,"NETCONF").
-define(error(ConnName,Report),
@@ -1257,13 +1256,11 @@ check_options([{port,Port}|T], Host, _, #options{} = Options) ->
check_options([{timeout, Timeout}|T], Host, Port, Options)
when is_integer(Timeout); Timeout==infinity ->
check_options(T, Host, Port, Options#options{timeout = Timeout});
-check_options([{X,_}=Opt|T], Host, Port, #options{ssh=SshOpts}=Options) ->
- case lists:member(X,?VALID_SSH_OPTS) of
- true ->
- check_options(T, Host, Port, Options#options{ssh=[Opt|SshOpts]});
- false ->
- {error, {invalid_option, Opt}}
- end.
+check_options([{timeout, _} = Opt|_T], _Host, _Port, _Options) ->
+ {error, {invalid_option, Opt}};
+check_options([Opt|T], Host, Port, #options{ssh=SshOpts}=Options) ->
+ %% Option verified by ssh
+ check_options(T, Host, Port, Options#options{ssh=[Opt|SshOpts]}).
%%%-----------------------------------------------------------------
set_request_timer(infinity) ->
diff --git a/lib/common_test/src/ct_release_test.erl b/lib/common_test/src/ct_release_test.erl
index 6438ea01c1..6c38f51363 100644
--- a/lib/common_test/src/ct_release_test.erl
+++ b/lib/common_test/src/ct_release_test.erl
@@ -131,7 +131,7 @@
-include_lib("kernel/include/file.hrl").
%%-----------------------------------------------------------------
--define(testnode, otp_upgrade).
+-define(testnode, 'ct_release_test-upgrade').
-define(exclude_apps, [hipe, typer, dialyzer]). % never include these apps
%%-----------------------------------------------------------------
@@ -304,7 +304,13 @@ upgrade(Apps,Level,Callback,Config) ->
%% Note, we will not reach this if the test fails with a
%% timetrap timeout in the test suite! Thus we can have
%% hanging nodes...
- Nodes = nodes(),
+ Nodes = lists:filter(fun(Node) ->
+ case atom_to_list(Node) of
+ "ct_release_test-" ++_ -> true;
+ _ -> false
+ end
+ end,
+ nodes()),
[rpc:call(Node,erlang,halt,[]) || Node <- Nodes]
end.
@@ -328,7 +334,14 @@ upgrade(Apps,Level,Callback,Config) ->
%% ct_release_test:cleanup(Config).'''
%%
cleanup(Config) ->
- Nodes = [node_name(?testnode)|nodes()],
+ AllNodes = [node_name(?testnode)|nodes()],
+ Nodes = lists:filter(fun(Node) ->
+ case atom_to_list(Node) of
+ "ct_release_test-" ++_ -> true;
+ _ -> false
+ end
+ end,
+ AllNodes),
[rpc:call(Node,erlang,halt,[]) || Node <- Nodes],
Config.
@@ -455,9 +468,9 @@ get_rels(minor) ->
{CurrentMajor,Current}.
init_upgrade_test(FromVsn,ToVsn,OldRel) ->
- OtpRel = list_to_atom("otp-"++FromVsn),
+ Name = list_to_atom("ct_release_test-otp-"++FromVsn),
ct:log("Starting node to fetch application versions to upgrade from"),
- {ok,Node} = test_server:start_node(OtpRel,peer,[{erl,[OldRel]}]),
+ {ok,Node} = test_server:start_node(Name,peer,[{erl,[OldRel]}]),
{Apps,Path} = fetch_all_apps(Node),
test_server:stop_node(Node),
{FromVsn,ToVsn,Apps,Path}.
@@ -723,7 +736,7 @@ do_callback(Node,Mod,Func,Args) ->
ct:log("~p:~p/~w returned: ~p",[Mod,Func,length(Args),R]),
case R of
{badrpc,Error} ->
- test_server:fail({test_upgrade_callback,Mod,Func,Args,Error});
+ throw({fail,{test_upgrade_callback,Mod,Func,Args,Error}});
NewState ->
NewState
end.
@@ -753,7 +766,7 @@ create_relfile(AppsVsns,CreateDir,RelName0,RelVsn) ->
%% Should test tools really be included? Some library functions
%% here could be used by callback, but not everything since
%% processes of these applications will not be running.
- TestToolAppsVsns0 = get_vsns([test_server,common_test]),
+ TestToolAppsVsns0 = get_vsns([common_test]),
TestToolAppsVsns =
[{A,V,none} || {A,V} <- TestToolAppsVsns0,
false == lists:keymember(A,1,AllAppsVsns0)],
diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl
index 39b2c2a8cd..e156c9b773 100644
--- a/lib/common_test/src/ct_run.erl
+++ b/lib/common_test/src/ct_run.erl
@@ -2055,6 +2055,13 @@ final_tests1([{TestDir,Suite,GrsOrCs}|Tests], Final, Skip, Bad) when
({skipped,Group,TCs}) ->
[ct_groups:make_conf(TestDir, Suite,
Group, [skipped], TCs)];
+ ({skipped,TC}) ->
+ case lists:member(TC, GrsOrCs) of
+ true ->
+ [];
+ false ->
+ [TC]
+ end;
({GrSpec = {GroupName,_},TCs}) ->
Props = [{override,GrSpec}],
[ct_groups:make_conf(TestDir, Suite,
diff --git a/lib/common_test/src/ct_testspec.erl b/lib/common_test/src/ct_testspec.erl
index 5d5448f352..5cd52bd042 100644
--- a/lib/common_test/src/ct_testspec.erl
+++ b/lib/common_test/src/ct_testspec.erl
@@ -70,13 +70,17 @@ prepare_tests(TestSpec) when is_record(TestSpec,testspec) ->
Tests = TestSpec#testspec.tests,
%% Sort Tests into "flat" Run and Skip lists (not sorted per node).
{Run,Skip} = get_run_and_skip(Tests,[],[]),
+
%% Create initial list of {Node,{Run,Skip}} tuples
NodeList = lists:map(fun(N) -> {N,{[],[]}} end, list_nodes(TestSpec)),
+
%% Get all Run tests sorted per node basis.
NodeList1 = run_per_node(Run,NodeList,
- TestSpec#testspec.merge_tests),
+ TestSpec#testspec.merge_tests),
+
%% Get all Skip entries sorted per node basis.
NodeList2 = skip_per_node(Skip,NodeList1),
+
%% Change representation.
Result=
lists:map(fun({Node,{Run1,Skip1}}) ->
@@ -103,7 +107,7 @@ run_per_node([{{Node,Dir},Test}|Ts],Result,MergeTests) ->
true ->
merge_tests(Dir,Test,Run)
end,
- run_per_node(Ts,insert_in_order({Node,{Run1,Skip}},Result),
+ run_per_node(Ts,insert_in_order({Node,{Run1,Skip}},Result,replace),
MergeTests);
run_per_node([],Result,_) ->
Result.
@@ -140,7 +144,7 @@ merge_suites(Dir,Test,[]) ->
skip_per_node([{{Node,Dir},Test}|Ts],Result) ->
{value,{Node,{Run,Skip}}} = lists:keysearch(Node,1,Result),
Skip1 = [{Dir,Test}|Skip],
- skip_per_node(Ts,insert_in_order({Node,{Run,Skip1}},Result));
+ skip_per_node(Ts,insert_in_order({Node,{Run,Skip1}},Result,replace));
skip_per_node([],Result) ->
Result.
@@ -156,7 +160,7 @@ skip_per_node([],Result) ->
%%
%% Skip entry: {Suites,Comment} or {Suite,Cases,Comment}
%%
-get_run_and_skip([{{Node,Dir},Suites}|Tests],Run,Skip) ->
+get_run_and_skip([{{Node,Dir},Suites}|Tests],Run,Skip) ->
TestDir = ct_util:get_testdir(Dir,catch element(1,hd(Suites))),
case lists:keysearch(all,1,Suites) of
{value,_} -> % all Suites in Dir
@@ -183,18 +187,33 @@ prepare_suites(Node,Dir,[{Suite,Cases}|Suites],Run,Skip) ->
[[{{Node,Dir},{Suite,all}}]|Run],
[Skipped|Skip]);
false ->
- {RL,SL} = prepare_cases(Node,Dir,Suite,Cases),
- prepare_suites(Node,Dir,Suites,[RL|Run],[SL|Skip])
+ {Run1,Skip1} = prepare_cases(Node,Dir,Suite,Cases,Run,Skip),
+ prepare_suites(Node,Dir,Suites,Run1,Skip1)
end;
prepare_suites(_Node,_Dir,[],Run,Skip) ->
{lists:flatten(lists:reverse(Run)),
lists:flatten(lists:reverse(Skip))}.
-prepare_cases(Node,Dir,Suite,Cases) ->
+prepare_cases(Node,Dir,Suite,Cases,Run,Skip) ->
case get_skipped_cases(Node,Dir,Suite,Cases) of
- SkipAll=[{{Node,Dir},{Suite,_Cmt}}] -> % all cases to be skipped
- %% note: this adds an 'all' test even if only skip is specified
- {[{{Node,Dir},{Suite,all}}],SkipAll};
+ [SkipAll={{Node,Dir},{Suite,_Cmt}}] -> % all cases to be skipped
+ case lists:any(fun({{N,D},{S,all}}) when N == Node,
+ D == Dir,
+ S == Suite ->
+ true;
+ ({{N,D},{S,Cs}}) when N == Node,
+ D == Dir,
+ S == Suite ->
+ lists:member(all,Cs);
+ (_) -> false
+ end, lists:flatten(Run)) of
+ true ->
+ {Run,[SkipAll|Skip]};
+ false ->
+ %% note: this adds an 'all' test even if
+ %% only skip is specified
+ {[{{Node,Dir},{Suite,all}}|Run],[SkipAll|Skip]}
+ end;
Skipped ->
%% note: this adds a test even if only skip is specified
PrepC = lists:foldr(fun({{G,Cs},{skip,_Cmt}}, Acc) when
@@ -210,11 +229,11 @@ prepare_cases(Node,Dir,Suite,Cases) ->
true ->
Acc;
false ->
- [C|Acc]
+ [{skipped,C}|Acc]
end;
(C,Acc) -> [C|Acc]
end, [], Cases),
- {{{Node,Dir},{Suite,PrepC}},Skipped}
+ {[{{Node,Dir},{Suite,PrepC}}|Run],[Skipped|Skip]}
end.
get_skipped_suites(Node,Dir,Suites) ->
@@ -431,6 +450,7 @@ collect_tests({Replace,Terms},TestSpec=#testspec{alias=As,nodes=Ns},Relaxed) ->
merge_tests = MergeTestsDef}),
TestSpec2 = get_all_nodes(Terms2,TestSpec1),
{Terms3, TestSpec3} = filter_init_terms(Terms2, [], TestSpec2),
+
add_tests(Terms3,TestSpec3).
%% replace names (atoms) in the testspec matching those in 'define' terms by
@@ -1257,7 +1277,7 @@ insert_groups1(Suite,Groups,Suites0) ->
Suites0;
{value,{Suite,GrAndCases0}} ->
GrAndCases = insert_groups2(Groups,GrAndCases0),
- insert_in_order({Suite,GrAndCases},Suites0);
+ insert_in_order({Suite,GrAndCases},Suites0,replace);
false ->
insert_in_order({Suite,Groups},Suites0)
end.
@@ -1282,7 +1302,7 @@ insert_cases(Node,Dir,Suite,Cases,Tests,false) when is_list(Cases) ->
insert_cases(Node,Dir,Suite,Cases,Tests,true) when is_list(Cases) ->
{Tests1,Done} =
lists:foldr(fun(All={{N,D},[{all,_}]},{Merged,_}) when N == Node,
- D == Dir ->
+ D == Dir ->
{[All|Merged],true};
({{N,D},Suites0},{Merged,_}) when N == Node,
D == Dir ->
@@ -1312,7 +1332,7 @@ insert_cases1(Suite,Cases,Suites0) ->
Suites0;
{value,{Suite,Cases0}} ->
Cases1 = insert_in_order(Cases,Cases0),
- insert_in_order({Suite,Cases1},Suites0);
+ insert_in_order({Suite,Cases1},Suites0,replace);
false ->
insert_in_order({Suite,Cases},Suites0)
end.
@@ -1369,9 +1389,9 @@ skip_groups1(Suite,Groups,Cmt,Suites0) ->
case lists:keysearch(Suite,1,Suites0) of
{value,{Suite,GrAndCases0}} ->
GrAndCases1 = GrAndCases0 ++ SkipGroups,
- insert_in_order({Suite,GrAndCases1},Suites0);
+ insert_in_order({Suite,GrAndCases1},Suites0,replace);
false ->
- insert_in_order({Suite,SkipGroups},Suites0)
+ insert_in_order({Suite,SkipGroups},Suites0,replace)
end.
skip_cases(Node,Dir,Suite,Cases,Cmt,Tests,false) when is_list(Cases) ->
@@ -1380,7 +1400,7 @@ skip_cases(Node,Dir,Suite,Cases,Cmt,Tests,false) when is_list(Cases) ->
skip_cases(Node,Dir,Suite,Cases,Cmt,Tests,true) when is_list(Cases) ->
{Tests1,Done} =
lists:foldr(fun({{N,D},Suites0},{Merged,_}) when N == Node,
- D == Dir ->
+ D == Dir ->
Suites1 = skip_cases1(Suite,Cases,Cmt,Suites0),
{[{{N,D},Suites1}|Merged],true};
(T,{Merged,Match}) ->
@@ -1401,32 +1421,55 @@ skip_cases1(Suite,Cases,Cmt,Suites0) ->
case lists:keysearch(Suite,1,Suites0) of
{value,{Suite,Cases0}} ->
Cases1 = Cases0 ++ SkipCases,
- insert_in_order({Suite,Cases1},Suites0);
+ insert_in_order({Suite,Cases1},Suites0,replace);
false ->
- insert_in_order({Suite,SkipCases},Suites0)
+ case Suites0 of
+ [{all,_}=All|Skips]->
+ [All|Skips++[{Suite,SkipCases}]];
+ _ ->
+ insert_in_order({Suite,SkipCases},Suites0,replace)
+ end
end.
append(Elem, List) ->
List ++ [Elem].
-insert_in_order([E|Es],List) ->
- List1 = insert_elem(E,List,[]),
- insert_in_order(Es,List1);
-insert_in_order([],List) ->
+insert_in_order(Elems,Dest) ->
+ insert_in_order1(Elems,Dest,false).
+
+insert_in_order(Elems,Dest,replace) ->
+ insert_in_order1(Elems,Dest,true).
+
+insert_in_order1([_E|Es],all,Replace) ->
+ insert_in_order1(Es,all,Replace);
+
+insert_in_order1([E|Es],List,Replace) ->
+ List1 = insert_elem(E,List,[],Replace),
+ insert_in_order1(Es,List1,Replace);
+insert_in_order1([],List,_Replace) ->
List;
-insert_in_order(E,List) ->
- insert_elem(E,List,[]).
+insert_in_order1(E,List,Replace) ->
+ insert_elem(E,List,[],Replace).
+
-%% replace an existing entry (same key) or add last in list
-insert_elem({Key,_}=E,[{Key,_}|Rest],SoFar) ->
+insert_elem({Key,_}=E,[{Key,_}|Rest],SoFar,true) ->
lists:reverse([E|SoFar]) ++ Rest;
-insert_elem({E,_},[E|Rest],SoFar) ->
+insert_elem({E,_},[E|Rest],SoFar,true) ->
lists:reverse([E|SoFar]) ++ Rest;
-insert_elem(E,[E|Rest],SoFar) ->
+insert_elem(E,[E|Rest],SoFar,true) ->
+ lists:reverse([E|SoFar]) ++ Rest;
+
+insert_elem({all,_}=E,_,SoFar,_Replace) ->
+ lists:reverse([E|SoFar]);
+insert_elem(_E,[all|_],SoFar,_Replace) ->
+ lists:reverse(SoFar);
+insert_elem(_E,[{all,_}],SoFar,_Replace) ->
+ lists:reverse(SoFar);
+insert_elem({Key,_}=E,[{Key,[]}|Rest],SoFar,_Replace) ->
lists:reverse([E|SoFar]) ++ Rest;
-insert_elem(E,[E1|Rest],SoFar) ->
- insert_elem(E,Rest,[E1|SoFar]);
-insert_elem(E,[],SoFar) ->
+insert_elem(E,[E1|Rest],SoFar,Replace) ->
+ insert_elem(E,Rest,[E1|SoFar],Replace);
+insert_elem(E,[],SoFar,_Replace) ->
lists:reverse([E|SoFar]).
ref2node(all_nodes,_Refs) ->
diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl
index 445fce1db8..b7fa7947e2 100644
--- a/lib/common_test/src/ct_util.erl
+++ b/lib/common_test/src/ct_util.erl
@@ -485,6 +485,8 @@ loop(Mode,TestData,StartDir) ->
{'EXIT',Pid,Reason} ->
case ets:lookup(?conn_table,Pid) of
[#conn{address=A,callback=CB}] ->
+ ErrorStr = io_lib:format("~tp", [Reason]),
+ ErrorHtml = ct_logs:escape_chars(ErrorStr),
%% A connection crashed - remove the connection but don't die
ct_logs:tc_log_async(ct_error_notify,
?MAX_IMPORTANCE,
@@ -492,8 +494,8 @@ loop(Mode,TestData,StartDir) ->
"Connection process died: "
"Pid: ~w, Address: ~p, "
"Callback: ~w\n"
- "Reason: ~p\n\n",
- [Pid,A,CB,Reason]),
+ "Reason: ~ts\n\n",
+ [Pid,A,CB,ErrorHtml]),
catch CB:close(Pid),
%% in case CB:close failed to do this:
unregister_connection(Pid),
diff --git a/lib/common_test/src/cth_conn_log.erl b/lib/common_test/src/cth_conn_log.erl
index 9b3dc0b5f1..954b4239af 100644
--- a/lib/common_test/src/cth_conn_log.erl
+++ b/lib/common_test/src/cth_conn_log.erl
@@ -132,7 +132,7 @@ pre_init_per_testcase(TestCase,Config,CthState) ->
[S,ct_logs:uri(L),filename:basename(L)])
|| {S,L} <- Ls] ++
"</table>",
- io:format(Str,[]),
+ ct:log(Str,[],[no_css]),
{ConnMod,{LogType,Ls}};
_ ->
{ConnMod,{LogType,[]}}
diff --git a/lib/common_test/src/cth_log_redirect.erl b/lib/common_test/src/cth_log_redirect.erl
index e6970a2bad..a8c4a455e1 100644
--- a/lib/common_test/src/cth_log_redirect.erl
+++ b/lib/common_test/src/cth_log_redirect.erl
@@ -30,7 +30,8 @@
pre_init_per_suite/3, pre_end_per_suite/3, post_end_per_suite/4,
pre_init_per_group/3, post_init_per_group/4,
pre_end_per_group/3, post_end_per_group/4,
- pre_init_per_testcase/3, post_end_per_testcase/4]).
+ pre_init_per_testcase/3, post_init_per_testcase/4,
+ pre_end_per_testcase/3, post_end_per_testcase/4]).
%% Event handler Callbacks
-export([init/1,
@@ -89,6 +90,12 @@ pre_init_per_testcase(TC, Config, State) ->
set_curr_func(TC, Config),
{Config, State}.
+post_init_per_testcase(_TC, _Config, Return, State) ->
+ {Return, State}.
+
+pre_end_per_testcase(_TC, Config, State) ->
+ {Config, State}.
+
post_end_per_testcase(_TC, _Config, Result, State) ->
%% Make sure that the event queue is flushed
%% before ending this test case.
diff --git a/lib/common_test/src/erl2html2.erl b/lib/common_test/src/erl2html2.erl
index e281c9de1b..d440d0940d 100644
--- a/lib/common_test/src/erl2html2.erl
+++ b/lib/common_test/src/erl2html2.erl
@@ -44,7 +44,7 @@ convert(File, Dest, InclPath) ->
"<html>\n"
"<head>\n"
"<meta http-equiv=\"Content-Type\" content=\"text/html;"
- "charset=",html_encoding(Encoding),"\"/>\n"
+ "charset=",html_encoding(Encoding),"\"/></meta>\n"
"<title>", to_raw_list(File,Encoding), "</title>\n"
"</head>\n\n"
"<body bgcolor=\"white\" text=\"black\""
diff --git a/lib/common_test/src/test_server.app.src b/lib/common_test/src/test_server.app.src
deleted file mode 100644
index 334be8109d..0000000000
--- a/lib/common_test/src/test_server.app.src
+++ /dev/null
@@ -1,39 +0,0 @@
-% This is an -*- erlang -*- file.
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-
-{application, test_server,
- [{description, "The OTP Test Server application"},
- {vsn, "%VSN%"},
- {modules, [
- erl2html2,
- test_server_ctrl,
- test_server,
- test_server_io,
- test_server_node,
- test_server_sup
- ]},
- {registered, [test_server_ctrl,
- test_server,
- test_server_break_process]},
- {applications, [kernel,stdlib]},
- {env, []},
- {runtime_dependencies, ["tools-2.8","stdlib-2.5","runtime_tools-1.8.16",
- "observer-2.1","kernel-4.0","inets-6.0",
- "syntax_tools-1.7","erts-7.0"]}]}.
-
diff --git a/lib/common_test/src/test_server.appup.src b/lib/common_test/src/test_server.appup.src
deleted file mode 100644
index 7c4aa630ae..0000000000
--- a/lib/common_test/src/test_server.appup.src
+++ /dev/null
@@ -1,22 +0,0 @@
-%% -*- erlang -*-
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2014. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-{"%VSN%",
- [{<<".*">>,[{restart_application, test_server}]}],
- [{<<".*">>,[{restart_application, test_server}]}]
-}.
diff --git a/lib/common_test/src/test_server.erl b/lib/common_test/src/test_server.erl
index 73803030a3..34acad6fd1 100644
--- a/lib/common_test/src/test_server.erl
+++ b/lib/common_test/src/test_server.erl
@@ -63,13 +63,11 @@
init_target_info() ->
[$.|Emu] = code:objfile_extension(),
{_, OTPRel} = init:script_id(),
- TestServerDir = filename:absname(filename:dirname(code:which(?MODULE))),
#target_info{os_family=test_server_sup:get_os_family(),
os_type=os:type(),
version=erlang:system_info(version),
system_version=erlang:system_info(system_version),
root_dir=code:root_dir(),
- test_server_dir=TestServerDir,
emulator=Emu,
otp_release=OTPRel,
username=test_server_sup:get_username(),
@@ -716,10 +714,10 @@ call_end_conf(Mod,Func,TCPid,TCExitReason,Loc,Conf,TVal) ->
Starter ! {self(),{call_end_conf,Data,ok}}
end);
true ->
- do_call_end_conf(Starter,Mod,Func,Data,Conf,TVal)
+ do_call_end_conf(Starter,Mod,Func,Data,TCExitReason,Conf,TVal)
end.
-do_call_end_conf(Starter,Mod,Func,Data,Conf,TVal) ->
+do_call_end_conf(Starter,Mod,Func,Data,TCExitReason,Conf,TVal) ->
EndConfProc =
fun() ->
process_flag(trap_exit,true), % to catch timetraps
@@ -727,16 +725,25 @@ do_call_end_conf(Starter,Mod,Func,Data,Conf,TVal) ->
EndConfApply =
fun() ->
timetrap(TVal),
- try apply(Mod,end_per_testcase,[Func,Conf]) of
+ %% We can't handle fails or skips here
+ %% (neither input nor output). The error can
+ %% be read from Conf though (tc_status).
+ EndConf =
+ case do_init_tc_call(Mod,{end_per_testcase,Func},
+ [Conf],
+ {TCExitReason,[Conf]}) of
+ {_,[EPTCInit]} when is_list(EPTCInit) ->
+ EPTCInit;
+ _ ->
+ Conf
+ end,
+ try apply(Mod,end_per_testcase,[Func,EndConf]) of
_ -> ok
catch
- _:Why ->
+ _:Error ->
timer:sleep(1),
- group_leader() ! {printout,12,
- "WARNING! "
- "~w:end_per_testcase(~w, ~p)"
- " crashed!\n\tReason: ~p\n",
- [Mod,Func,Conf,Why]}
+ print_end_conf_result(Mod,Func,Conf,
+ "crashed",Error)
end,
Supervisor ! {self(),end_conf}
end,
@@ -745,10 +752,7 @@ do_call_end_conf(Starter,Mod,Func,Data,Conf,TVal) ->
{Pid,end_conf} ->
Starter ! {self(),{call_end_conf,Data,ok}};
{'EXIT',Pid,Reason} ->
- group_leader() ! {printout,12,
- "WARNING! ~w:end_per_testcase(~w, ~p)"
- " failed!\n\tReason: ~p\n",
- [Mod,Func,Conf,Reason]},
+ print_end_conf_result(Mod,Func,Conf,"failed",Reason),
Starter ! {self(),{call_end_conf,Data,{error,Reason}}};
{'EXIT',_OtherPid,Reason} ->
%% Probably the parent - not much to do about that
@@ -757,28 +761,55 @@ do_call_end_conf(Starter,Mod,Func,Data,Conf,TVal) ->
end,
spawn_link(EndConfProc).
-spawn_fw_call(Mod,{init_per_testcase,Func},CurrConf,Pid,
- {timetrap_timeout,TVal}=Why,
- Loc,SendTo) ->
+print_end_conf_result(Mod,Func,Conf,Cause,Error) ->
+ Str2Print =
+ fun(NoHTML) when NoHTML == stdout; NoHTML == major ->
+ io_lib:format("WARNING! "
+ "~w:end_per_testcase(~w, ~tp)"
+ " ~s!\n\tReason: ~tp\n",
+ [Mod,Func,Conf,Cause,Error]);
+ (minor) ->
+ ErrorStr = test_server_ctrl:escape_chars(Error),
+ io_lib:format("WARNING! "
+ "~w:end_per_testcase(~w, ~tp)"
+ " ~s!\n\tReason: ~ts\n",
+ [Mod,Func,Conf,Cause,ErrorStr])
+ end,
+ group_leader() ! {printout,12,Str2Print}.
+
+
+spawn_fw_call(Mod,IPTC={init_per_testcase,Func},CurrConf,Pid,
+ Why,Loc,SendTo) ->
FwCall =
fun() ->
Skip = {skip,{failed,{Mod,init_per_testcase,Why}}},
%% if init_per_testcase fails, the test case
%% should be skipped
- try do_end_tc_call(Mod,Func, {Pid,Skip,[CurrConf]}, Why) of
+ try begin do_end_tc_call(Mod,IPTC, {Pid,Skip,[CurrConf]}, Why),
+ do_init_tc_call(Mod,{end_per_testcase,Func},
+ [CurrConf],{ok,[CurrConf]}),
+ do_end_tc_call(Mod,{end_per_testcase,Func},
+ {Pid,Skip,[CurrConf]}, Why) end of
_ -> ok
catch
_:FwEndTCErr ->
exit({fw_notify_done,end_tc,FwEndTCErr})
end,
+ Time = case Why of
+ {timetrap_timeout,TVal} -> TVal/1000;
+ _ -> died
+ end,
+ group_leader() ! {printout,12,
+ "ERROR! ~w:init_per_testcase(~w, ~p)"
+ " failed!\n\tReason: ~tp\n",
+ [Mod,Func,CurrConf,Why]},
%% finished, report back
- SendTo ! {self(),fw_notify_done,
- {TVal/1000,Skip,Loc,[],undefined}}
+ SendTo ! {self(),fw_notify_done,{Time,Skip,Loc,[],undefined}}
end,
spawn_link(FwCall);
-spawn_fw_call(Mod,{end_per_testcase,Func},EndConf,Pid,
- {timetrap_timeout,TVal}=Why,_Loc,SendTo) ->
+spawn_fw_call(Mod,EPTC={end_per_testcase,Func},EndConf,Pid,
+ Why,_Loc,SendTo) ->
FwCall =
fun() ->
{RetVal,Report} =
@@ -792,24 +823,38 @@ spawn_fw_call(Mod,{end_per_testcase,Func},EndConf,Pid,
E = {failed,{Mod,end_per_testcase,Why}},
{Result,E}
end,
- group_leader() ! {printout,12,
- "WARNING! ~w:end_per_testcase(~w, ~p)"
- " failed!\n\tReason: timetrap timeout"
- " after ~w ms!\n", [Mod,Func,EndConf,TVal]},
- FailLoc = proplists:get_value(tc_fail_loc, EndConf),
- try do_end_tc_call(Mod,Func,
- {Pid,Report,[EndConf]}, Why) of
+ {Time,Warn} =
+ case Why of
+ {timetrap_timeout,TVal} ->
+ group_leader() !
+ {printout,12,
+ "WARNING! ~w:end_per_testcase(~w, ~p)"
+ " failed!\n\tReason: timetrap timeout"
+ " after ~w ms!\n", [Mod,Func,EndConf,TVal]},
+ W = "<font color=\"red\">"
+ "WARNING: end_per_testcase timed out!</font>",
+ {TVal/1000,W};
+ _ ->
+ group_leader() !
+ {printout,12,
+ "WARNING! ~w:end_per_testcase(~w, ~p)"
+ " failed!\n\tReason: ~tp\n",
+ [Mod,Func,EndConf,Why]},
+ W = "<font color=\"red\">"
+ "WARNING: end_per_testcase failed!</font>",
+ {died,W}
+ end,
+ try do_end_tc_call(Mod,EPTC,{Pid,Report,[EndConf]}, Why) of
_ -> ok
catch
_:FwEndTCErr ->
exit({fw_notify_done,end_tc,FwEndTCErr})
end,
- Warn = "<font color=\"red\">"
- "WARNING: end_per_testcase timed out!</font>",
+ FailLoc = proplists:get_value(tc_fail_loc, EndConf),
%% finished, report back (if end_per_testcase fails, a warning
%% should be printed as part of the comment)
SendTo ! {self(),fw_notify_done,
- {TVal/1000,RetVal,FailLoc,[],Warn}}
+ {Time,RetVal,FailLoc,[],Warn}}
end,
spawn_link(FwCall);
@@ -832,10 +877,12 @@ spawn_fw_call(FwMod,FwFunc,_,_Pid,{framework_error,FwError},_,SendTo) ->
spawn_link(FwCall);
spawn_fw_call(Mod,Func,CurrConf,Pid,Error,Loc,SendTo) ->
- Func1 = case Func of
- {_InitOrEndPerTC,F} -> F;
- F -> F
- end,
+ {Func1,EndTCFunc} = case Func of
+ CF when CF == init_per_suite; CF == end_per_suite;
+ CF == init_per_group; CF == end_per_group ->
+ {CF,CF};
+ TC -> {TC,{end_per_testcase,TC}}
+ end,
FwCall =
fun() ->
try fw_error_notify(Mod,Func1,[],
@@ -847,8 +894,7 @@ spawn_fw_call(Mod,Func,CurrConf,Pid,Error,Loc,SendTo) ->
FwErrorNotifyErr})
end,
Conf = [{tc_status,{failed,Error}}|CurrConf],
- try do_end_tc_call(Mod,Func1,
- {Pid,Error,[Conf]},Error) of
+ try do_end_tc_call(Mod,EndTCFunc,{Pid,Error,[Conf]},Error) of
_ -> ok
catch
_:FwEndTCErr ->
@@ -925,32 +971,38 @@ run_test_case_eval(Mod, Func, Args0, Name, Ref, RunInit,
Where = [{Mod,Func}],
put(test_server_loc, Where),
- FWInitResult = test_server_sup:framework_call(init_tc,[Mod,Func,Args0],
- {ok,Args0}),
+ FWInitFunc = case RunInit of
+ run_init -> {init_per_testcase,Func};
+ _ -> Func
+ end,
+
+ FWInitResult0 = do_init_tc_call(Mod,FWInitFunc,Args0,{ok,Args0}),
+
set_tc_state(running),
{{Time,Value},Loc,Opts} =
- case FWInitResult of
+ case FWInitResult0 of
{ok,Args} ->
run_test_case_eval1(Mod, Func, Args, Name, RunInit, TCCallback);
Error = {error,_Reason} ->
- NewResult = do_end_tc_call(Mod,Func, {Error,Args0},
+ NewResult = do_end_tc_call(Mod,FWInitFunc, {Error,Args0},
{auto_skip,{failed,Error}}),
{{0,NewResult},Where,[]};
{fail,Reason} ->
- Conf = [{tc_status,{failed,Reason}} | hd(Args0)],
+ Conf = [{tc_status,{failed,Reason}} | hd(Args0)],
fw_error_notify(Mod, Func, Conf, Reason),
- NewResult = do_end_tc_call(Mod,Func, {{error,Reason},[Conf]},
+ NewResult = do_end_tc_call(Mod,FWInitFunc,
+ {{error,Reason},[Conf]},
{fail,Reason}),
{{0,NewResult},Where,[]};
Skip = {SkipType,_Reason} when SkipType == skip;
SkipType == skipped ->
- NewResult = do_end_tc_call(Mod,Func,
+ NewResult = do_end_tc_call(Mod,FWInitFunc,
{Skip,Args0}, Skip),
{{0,NewResult},Where,[]};
AutoSkip = {auto_skip,_Reason} ->
%% special case where a conf case "pretends" to be skipped
NewResult =
- do_end_tc_call(Mod,Func, {AutoSkip,Args0}, AutoSkip),
+ do_end_tc_call(Mod,FWInitFunc, {AutoSkip,Args0}, AutoSkip),
{{0,NewResult},Where,[]}
end,
exit({Ref,Time,Value,Loc,Opts}).
@@ -965,31 +1017,41 @@ run_test_case_eval1(Mod, Func, Args, Name, RunInit, TCCallback) ->
SkipType == skipped ->
Line = get_loc(),
Conf = [{tc_status,{skipped,Reason}}|hd(Args)],
- NewRes = do_end_tc_call(Mod,Func,
+ NewRes = do_end_tc_call(Mod,{init_per_testcase,Func},
{Skip,[Conf]}, Skip),
{{0,NewRes},Line,[]};
{skip_and_save,Reason,SaveCfg} ->
Line = get_loc(),
Conf = [{tc_status,{skipped,Reason}},
{save_config,SaveCfg}|hd(Args)],
- NewRes = do_end_tc_call(Mod,Func, {{skip,Reason},[Conf]},
+ NewRes = do_end_tc_call(Mod,{init_per_testcase,Func},
+ {{skip,Reason},[Conf]},
{skip,Reason}),
{{0,NewRes},Line,[]};
FailTC = {fail,Reason} -> % user fails the testcase
EndConf = [{tc_status,{failed,Reason}} | hd(Args)],
fw_error_notify(Mod, Func, EndConf, Reason),
- NewRes = do_end_tc_call(Mod,Func,
+ NewRes = do_end_tc_call(Mod,{init_per_testcase,Func},
{{error,Reason},[EndConf]},
FailTC),
{{0,NewRes},[{Mod,Func}],[]};
{ok,NewConf} ->
- %% call user callback function if defined
- NewConf1 =
- user_callback(TCCallback, Mod, Func, init, NewConf),
- %% save current state in controller loop
- set_tc_state(tc, NewConf1),
- %% execute the test case
- {{T,Return},Loc} = {ts_tc(Mod,Func,[NewConf1]), get_loc()},
+ IPTCEndRes = do_end_tc_call(Mod,{init_per_testcase,Func},
+ {ok,[NewConf]}, NewConf),
+ {{T,Return},Loc,NewConf1} =
+ if not is_list(IPTCEndRes) ->
+ %% received skip or fail, not config
+ {{0,IPTCEndRes},undefined,NewConf};
+ true ->
+ %% call user callback function if defined
+ NewConfUC =
+ user_callback(TCCallback, Mod, Func,
+ init, IPTCEndRes),
+ %% save current state in controller loop
+ set_tc_state(tc, NewConfUC),
+ %% execute the test case
+ {ts_tc(Mod,Func,[NewConfUC]),get_loc(),NewConfUC}
+ end,
{EndConf,TSReturn,FWReturn} =
case Return of
{E,TCError} when E=='EXIT' ; E==failed ->
@@ -1015,36 +1077,47 @@ run_test_case_eval1(Mod, Func, Args, Name, RunInit, TCCallback) ->
%% call user callback function if defined
EndConf1 =
user_callback(TCCallback, Mod, Func, 'end', EndConf),
+
+ %% We can't handle fails or skips here
+ EndConf2 =
+ case do_init_tc_call(Mod,{end_per_testcase,Func},
+ [EndConf1],{ok,[EndConf1]}) of
+ {ok,[EPTCInitRes]} when is_list(EPTCInitRes) ->
+ EPTCInitRes;
+ _ ->
+ EndConf1
+ end,
+
%% update current state in controller loop
- {FWReturn1,TSReturn1,EndConf2} =
- case end_per_testcase(Mod, Func, EndConf1) of
+ {FWReturn1,TSReturn1,EndConf3} =
+ case end_per_testcase(Mod, Func, EndConf2) of
SaveCfg1={save_config,_} ->
{FWReturn,TSReturn,
[SaveCfg1|lists:keydelete(save_config,1,
- EndConf1)]};
+ EndConf2)]};
{fail,ReasonToFail} ->
%% user has failed the testcase
- fw_error_notify(Mod, Func, EndConf1,
+ fw_error_notify(Mod, Func, EndConf2,
ReasonToFail),
{{error,ReasonToFail},
{failed,ReasonToFail},
- EndConf1};
+ EndConf2};
{failed,{_,end_per_testcase,_}} = Failure when
FWReturn == ok ->
%% unexpected termination in end_per_testcase
%% report this as the result to the framework
- {Failure,TSReturn,EndConf1};
+ {Failure,TSReturn,EndConf2};
_ ->
%% test case result should be reported to
%% framework no matter the status of
%% end_per_testcase
- {FWReturn,TSReturn,EndConf1}
+ {FWReturn,TSReturn,EndConf2}
end,
%% clear current state in controller loop
- case do_end_tc_call(Mod,Func,
- {FWReturn1,[EndConf2]}, TSReturn1) of
+ case do_end_tc_call(Mod,{end_per_testcase,Func},
+ {FWReturn1,[EndConf3]}, TSReturn1) of
{failed,Reason} = NewReturn ->
- fw_error_notify(Mod,Func,EndConf2, Reason),
+ fw_error_notify(Mod,Func,EndConf3, Reason),
{{T,NewReturn},[{Mod,Func}],[]};
NewReturn ->
{{T,NewReturn},Loc,[]}
@@ -1070,7 +1143,38 @@ run_test_case_eval1(Mod, Func, Args, Name, RunInit, TCCallback) ->
{{T,Return2},Loc,Opts}
end.
+do_init_tc_call(Mod, Func, Res, Return) ->
+ test_server_sup:framework_call(init_tc,[Mod,Func,Res],Return).
+
+do_end_tc_call(Mod, IPTC={init_per_testcase,Func}, Res, Return) ->
+ case Return of
+ {NOk,_} when NOk == auto_skip; NOk == fail;
+ NOk == skip ; NOk == skipped ->
+ {_,Args} = Res,
+ IPTCEndRes =
+ case do_end_tc_call1(Mod, IPTC, Res, Return) of
+ IPTCEndConfig when is_list(IPTCEndConfig) ->
+ IPTCEndConfig;
+ _ ->
+ Args
+ end,
+ EPTCInitRes =
+ case do_init_tc_call(Mod,{end_per_testcase,Func},
+ IPTCEndRes,Return) of
+ {ok,EPTCInitConfig} when is_list(EPTCInitConfig) ->
+ {Return,EPTCInitConfig};
+ _ ->
+ Return
+ end,
+ do_end_tc_call1(Mod, {end_per_testcase,Func},
+ EPTCInitRes, Return);
+ _Ok ->
+ do_end_tc_call1(Mod, IPTC, Res, Return)
+ end;
do_end_tc_call(Mod, Func, Res, Return) ->
+ do_end_tc_call1(Mod, Func, Res, Return).
+
+do_end_tc_call1(Mod, Func, Res, Return) ->
FwMod = os:getenv("TEST_SERVER_FRAMEWORK"),
Ref = make_ref(),
if FwMod == "ct_framework" ; FwMod == "undefined"; FwMod == false ->
@@ -1209,7 +1313,7 @@ do_init_per_testcase(Mod, Args) ->
Bad ->
group_leader() ! {printout,12,
"ERROR! init_per_testcase has returned "
- "bad elements in Config: ~p\n",[Bad]},
+ "bad elements in Config: ~tp\n",[Bad]},
{skip,{failed,{Mod,init_per_testcase,bad_return}}}
end;
{fail,_Reason}=Res ->
@@ -1227,25 +1331,33 @@ do_init_per_testcase(Mod, Args) ->
throw:Other ->
set_loc(erlang:get_stacktrace()),
Line = get_loc(),
- FormattedLoc = test_server_sup:format_loc(Line),
- group_leader() ! {printout,12,
- "ERROR! init_per_testcase thrown!\n"
- "\tLocation: ~ts\n\tReason: ~p\n",
- [FormattedLoc, Other]},
+ print_init_conf_result(Line,"thrown",Other),
{skip,{failed,{Mod,init_per_testcase,Other}}};
_:Reason0 ->
Stk = erlang:get_stacktrace(),
Reason = {Reason0,Stk},
set_loc(Stk),
Line = get_loc(),
- FormattedLoc = test_server_sup:format_loc(Line),
- group_leader() ! {printout,12,
- "ERROR! init_per_testcase crashed!\n"
- "\tLocation: ~ts\n\tReason: ~p\n",
- [FormattedLoc,Reason]},
+ print_init_conf_result(Line,"crashed",Reason),
{skip,{failed,{Mod,init_per_testcase,Reason}}}
end.
+print_init_conf_result(Line,Cause,Reason) ->
+ FormattedLoc = test_server_sup:format_loc(Line),
+ Str2Print =
+ fun(NoHTML) when NoHTML == stdout; NoHTML == major ->
+ io_lib:format("ERROR! init_per_testcase ~s!\n"
+ "\tLocation: ~p\n\tReason: ~tp\n",
+ [Cause,Line,Reason]);
+ (minor) ->
+ ReasonStr = test_server_ctrl:escape_chars(Reason),
+ io_lib:format("ERROR! init_per_testcase ~s!\n"
+ "\tLocation: ~ts\n\tReason: ~ts\n",
+ [Cause,FormattedLoc,ReasonStr])
+ end,
+ group_leader() ! {printout,12,Str2Print}.
+
+
end_per_testcase(Mod, Func, Conf) ->
case erlang:function_exported(Mod,end_per_testcase,2) of
true ->
@@ -1280,12 +1392,7 @@ do_end_per_testcase(Mod,EndFunc,Func,Conf) ->
comment(io_lib:format("~ts<font color=\"red\">"
"WARNING: ~w thrown!"
"</font>\n",[Comment0,EndFunc])),
- group_leader() ! {printout,12,
- "WARNING: ~w thrown!\n"
- "Reason: ~p\n"
- "Line: ~ts\n",
- [EndFunc, Other,
- test_server_sup:format_loc(get_loc())]},
+ print_end_tc_warning(EndFunc,Other,"thrown",get_loc()),
{failed,{Mod,end_per_testcase,Other}};
Class:Reason ->
Stk = erlang:get_stacktrace(),
@@ -1302,15 +1409,25 @@ do_end_per_testcase(Mod,EndFunc,Func,Conf) ->
comment(io_lib:format("~ts<font color=\"red\">"
"WARNING: ~w crashed!"
"</font>\n",[Comment0,EndFunc])),
- group_leader() ! {printout,12,
- "WARNING: ~w crashed!\n"
- "Reason: ~p\n"
- "Line: ~ts\n",
- [EndFunc, Reason,
- test_server_sup:format_loc(get_loc())]},
+ print_end_tc_warning(EndFunc,Reason,"crashed",get_loc()),
{failed,{Mod,end_per_testcase,Why}}
end.
+print_end_tc_warning(EndFunc,Reason,Cause,Loc) ->
+ FormattedLoc = test_server_sup:format_loc(Loc),
+ Str2Print =
+ fun(NoHTML) when NoHTML == stdout; NoHTML == major ->
+ io_lib:format("WARNING: ~w ~s!\n"
+ "Reason: ~tp\nLine: ~p\n",
+ [EndFunc,Cause,Reason,Loc]);
+ (minor) ->
+ ReasonStr = test_server_ctrl:escape_chars(Reason),
+ io_lib:format("WARNING: ~w ~s!\n"
+ "Reason: ~ts\nLine: ~ts\n",
+ [EndFunc,Cause,ReasonStr,FormattedLoc])
+ end,
+ group_leader() ! {printout,12,Str2Print}.
+
get_loc() ->
get(test_server_loc).
diff --git a/lib/common_test/src/test_server_ctrl.erl b/lib/common_test/src/test_server_ctrl.erl
index cd08a25bd8..833d99907e 100644
--- a/lib/common_test/src/test_server_ctrl.erl
+++ b/lib/common_test/src/test_server_ctrl.erl
@@ -77,7 +77,7 @@
-export([handle_call/3, handle_cast/2, handle_info/2]).
-export([do_test_cases/4]).
-export([do_spec/2, do_spec_list/2]).
--export([xhtml/2]).
+-export([xhtml/2, escape_chars/1]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1825,13 +1825,14 @@ start_minor_log_file1(Mod, Func, LogDir, AbsName, MFA) ->
case {filelib:is_file(filename:join(LogDir, SrcListing)),
lists:member(no_src, get(test_server_logopts))} of
{true,false} ->
- print(Lev, Info ++ "<a href=\"~ts#~ts\">~w:~w/~w</a> "
- "(click for source code)\n",
+ print(Lev, ["$tc_html",
+ Info ++ "<a href=\"~ts#~ts\">~w:~w/~w</a> "
+ "(click for source code)\n"],
[uri_encode(SrcListing),
uri_encode(atom_to_list(Func)++"-1",utf8),
Mod,Func,Arity]);
_ ->
- print(Lev, Info ++ "~w:~w/~w\n", [Mod,Func,Arity])
+ print(Lev, ["$tc_html",Info ++ "~w:~w/~w\n"], [Mod,Func,Arity])
end
end,
@@ -3747,7 +3748,10 @@ run_test_case1(Ref, Num, Mod, Func, Args, RunInit,
true ->
ok
end,
- print(minor, "Config value:\n\n ~tp\n", [Args2Print]),
+
+ print(minor,
+ escape_chars(io_lib:format("Config value:\n\n ~tp\n", [Args2Print])),
+ []),
print(minor, "Current directory is ~tp\n", [Cwd]),
GrNameStr = case GrName of
@@ -3762,7 +3766,7 @@ run_test_case1(Ref, Num, Mod, Func, Args, RunInit,
"<td>" ++ Col0 ++ "~w" ++ Col1 ++ "</td>"
"<td>" ++ Col0 ++ "~ts" ++ Col1 ++ "</td>"
"<td><a href=\"~ts\">~w</a></td>"
- "<td><a href=\"~ts#top\"><</a> <a href=\"~ts#end\">></a></td>",
+ "<td><a href=\"~ts#top\">&lt;</a> <a href=\"~ts#end\">&gt;</a></td>",
[num2str(Num),fw_name(Mod),GrNameStr,EncMinorBase,Func,
EncMinorBase,EncMinorBase]),
@@ -3939,7 +3943,7 @@ progress(skip, CaseNum, Mod, Func, GrName, Loc, Reason, Time,
[get_info_str(Mod,Func, CaseNum, get(test_server_cases))]),
test_server_sup:framework_call(report, [tc_done,{Mod,{Func,GrName},
{ReportTag,Reason1}}]),
- ReasonStr = reason_to_string(Reason1),
+ ReasonStr = escape_chars(reason_to_string(Reason1)),
ReasonStr1 = lists:flatten([string:strip(S,left) ||
S <- string:tokens(ReasonStr,[$\n])]),
ReasonStr2 =
@@ -4011,7 +4015,10 @@ progress(failed, CaseNum, Mod, Func, GrName, Loc, {testcase_aborted,Reason}, _T,
[Comment]),
FormatLoc = test_server_sup:format_loc(Loc),
print(minor, "=== Location: ~ts", [FormatLoc]),
- print(minor, "=== Reason: {testcase_aborted,~p}", [Reason]),
+ print(minor,
+ escape_chars(io_lib:format("=== Reason: {testcase_aborted,~p}",
+ [Reason])),
+ []),
failed;
progress(failed, CaseNum, Mod, Func, GrName, unknown, Reason, Time,
@@ -4024,7 +4031,7 @@ progress(failed, CaseNum, Mod, Func, GrName, unknown, Reason, Time,
TimeStr = io_lib:format(if is_float(Time) -> "~.3fs";
true -> "~w"
end, [Time]),
- ErrorReason = lists:flatten(io_lib:format("~p", [Reason])),
+ ErrorReason = escape_chars(lists:flatten(io_lib:format("~p", [Reason]))),
ErrorReason1 = lists:flatten([string:strip(S,left) ||
S <- string:tokens(ErrorReason,[$\n])]),
ErrorReason2 =
@@ -4047,7 +4054,9 @@ progress(failed, CaseNum, Mod, Func, GrName, unknown, Reason, Time,
[TimeStr,Comment]),
print(minor, "=== Location: ~w", [unknown]),
{FStr,FormattedReason} = format_exception(Reason),
- print(minor, "=== Reason: " ++ FStr, [FormattedReason]),
+ print(minor,
+ escape_chars(io_lib:format("=== Reason: " ++ FStr, [FormattedReason])),
+ []),
failed;
progress(failed, CaseNum, Mod, Func, GrName, Loc, Reason, Time,
@@ -4081,7 +4090,8 @@ progress(failed, CaseNum, Mod, Func, GrName, Loc, Reason, Time,
FormatLoc = test_server_sup:format_loc(LocMin),
print(minor, "=== Location: ~ts", [FormatLoc]),
{FStr,FormattedReason} = format_exception(Reason),
- print(minor, "=== Reason: " ++ FStr, [FormattedReason]),
+ print(minor, "=== Reason: " ++
+ escape_chars(io_lib:format(FStr, [FormattedReason])), []),
failed;
progress(ok, _CaseNum, Mod, Func, GrName, _Loc, RetVal, Time,
@@ -4110,11 +4120,36 @@ progress(ok, _CaseNum, Mod, Func, GrName, _Loc, RetVal, Time,
"<td><font color=\"green\">Ok</font></td>"
"~ts</tr>\n",
[Time,Comment]),
- print(minor, "=== Returned value: ~p", [RetVal]),
+ print(minor,
+ escape_chars(io_lib:format("=== Returned value: ~tp", [RetVal])),
+ []),
ok.
%%--------------------------------------------------------------------
%% various help functions
+escape_chars(Term) when not is_list(Term), not is_binary(Term) ->
+ esc_chars_in_list(io_lib:format("~tp", [Term]));
+escape_chars(List = [Term | _]) when not is_list(Term), not is_integer(Term) ->
+ esc_chars_in_list(io_lib:format("~tp", [List]));
+escape_chars(List) ->
+ esc_chars_in_list(List).
+
+esc_chars_in_list([Bin | Io]) when is_binary(Bin) ->
+ [Bin | esc_chars_in_list(Io)];
+esc_chars_in_list([List | Io]) when is_list(List) ->
+ [esc_chars_in_list(List) | esc_chars_in_list(Io)];
+esc_chars_in_list([$< | Io]) ->
+ ["&lt;" | esc_chars_in_list(Io)];
+esc_chars_in_list([$> | Io]) ->
+ ["&gt;" | esc_chars_in_list(Io)];
+esc_chars_in_list([$& | Io]) ->
+ ["&amp;" | esc_chars_in_list(Io)];
+esc_chars_in_list([Char | Io]) when is_integer(Char) ->
+ [Char | esc_chars_in_list(Io)];
+esc_chars_in_list([]) ->
+ [];
+esc_chars_in_list(Bin) ->
+ Bin.
get_fw_mod(Mod) ->
case get(test_server_framework) of
@@ -4328,6 +4363,10 @@ print(Detail, Format) ->
print(Detail, Format, Args) ->
print(Detail, Format, Args, internal).
+print(Detail, ["$tc_html",Format], Args, Printer) ->
+ Msg = io_lib:format(Format, Args),
+ print_or_buffer(Detail, ["$tc_html",Msg], Printer);
+
print(Detail, Format, Args, Printer) ->
Msg = io_lib:format(Format, Args),
print_or_buffer(Detail, Msg, Printer).
@@ -5570,8 +5609,9 @@ html_header(Title) ->
"<html>\n"
"<head>\n"
"<title>", Title, "</title>\n"
- "<meta http-equiv=\"cache-control\" content=\"no-cache\">\n"
- "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n"
+ "<meta http-equiv=\"cache-control\" content=\"no-cache\"></meta>\n"
+ "<meta http-equiv=\"content-type\" content=\"text/html; "
+ "charset=utf-8\"></meta>\n"
"</head>\n"
"<body bgcolor=\"white\" text=\"black\" "
"link=\"blue\" vlink=\"purple\" alink=\"red\">\n"].
diff --git a/lib/common_test/src/test_server_gl.erl b/lib/common_test/src/test_server_gl.erl
index 31098d9726..233e59172b 100644
--- a/lib/common_test/src/test_server_gl.erl
+++ b/lib/common_test/src/test_server_gl.erl
@@ -37,7 +37,8 @@
reject_io :: boolean(), %Reject I/O requests...
permit_io, %... and exceptions
auto_nl=true :: boolean(), %Automatically add NL
- levels %{Stdout,Major,Minor}
+ levels, %{Stdout,Major,Minor}
+ escape_chars=true %Switch escaping HTML on/off
}).
%% start_link()
@@ -137,7 +138,8 @@ init([]) ->
reject_io=false,
permit_io=gb_sets:empty(),
auto_nl=true,
- levels={1,19,10}
+ levels={1,19,10},
+ escape_chars=true
}}.
req(GL, Req) ->
@@ -182,7 +184,7 @@ handle_info({io_request,From,ReplyAs,Req}=IoReq, St) ->
try io_req(Req, From, St) of
passthrough ->
group_leader() ! IoReq;
- Data ->
+ {EscapeHtml,Data} ->
case is_io_permitted(From, St) of
false ->
ok;
@@ -193,7 +195,13 @@ handle_info({io_request,From,ReplyAs,Req}=IoReq, St) ->
#st{capture=CapturePid} ->
CapturePid ! {captured,Data}
end,
- output(minor, Data, From, From, St)
+ case EscapeHtml andalso St#st.escape_chars of
+ true ->
+ output(minor, test_server_ctrl:escape_chars(Data),
+ From, From, St);
+ false ->
+ output(minor, Data, From, From, St)
+ end
end,
From ! {io_reply,ReplyAs,ok}
catch
@@ -204,9 +212,20 @@ handle_info({io_request,From,ReplyAs,Req}=IoReq, St) ->
handle_info({structured_io,ClientPid,{Detail,Str}}, St) ->
output(Detail, Str, ClientPid, ClientPid, St),
{noreply,St};
+handle_info({printout,Detail,["$tc_html",Format],Args}, St) ->
+ Str = io_lib:format(Format, Args),
+ output(Detail, ["$tc_html",Str], internal, none, St),
+ {noreply,St};
+handle_info({printout,Detail,Fun}, St) when is_function(Fun)->
+ output(Detail, Fun, internal, none, St),
+ {noreply,St};
handle_info({printout,Detail,Format,Args}, St) ->
Str = io_lib:format(Format, Args),
- output(Detail, Str, internal, none, St),
+ if not St#st.escape_chars ->
+ output(Detail, ["$tc_html",Str], internal, none, St);
+ true ->
+ output(Detail, Str, internal, none, St)
+ end,
{noreply,St};
handle_info(Msg, #st{tc_supervisor=Pid}=St) when is_pid(Pid) ->
%% The process overseeing the testcase process also used to be
@@ -231,25 +250,55 @@ do_set_props([{reject_io_reqs,Bool}|Ps], St) ->
do_set_props(Ps, St#st{reject_io=Bool});
do_set_props([], St) -> St.
-io_req({put_chars,Enc,Bytes}, _, _) when Enc =:= latin1; Enc =:= unicode ->
- unicode:characters_to_list(Bytes, Enc);
+io_req({put_chars,Enc,Str}, _, _) when Enc =:= latin1; Enc =:= unicode ->
+ case Str of
+ ["$tc_html",Str0] ->
+ {false,unicode:characters_to_list(Str0, Enc)};
+ _ ->
+ {true,unicode:characters_to_list(Str, Enc)}
+ end;
io_req({put_chars,Encoding,Mod,Func,[Format,Args]}, _, _) ->
- Str = Mod:Func(Format, Args),
- unicode:characters_to_list(Str, Encoding);
+ case Format of
+ ["$tc_html",Format0] ->
+ Str = Mod:Func(Format0, Args),
+ {false,unicode:characters_to_list(Str, Encoding)};
+ _ ->
+ Str = Mod:Func(Format, Args),
+ {true,unicode:characters_to_list(Str, Encoding)}
+ end;
io_req(_, _, _) -> passthrough.
-output(Level, Str, Sender, From, St) when is_integer(Level) ->
+output(Level, StrOrFun, Sender, From, St) when is_integer(Level) ->
case selected_by_level(Level, stdout, St) of
- true -> output(stdout, Str, Sender, From, St);
- false -> ok
+ true when hd(StrOrFun) == "$tc_html" ->
+ output(stdout, tl(StrOrFun), Sender, From, St);
+ true when is_function(StrOrFun) ->
+ output(stdout, StrOrFun(stdout), Sender, From, St);
+ true ->
+ output(stdout, StrOrFun, Sender, From, St);
+ false ->
+ ok
end,
case selected_by_level(Level, major, St) of
- true -> output(major, Str, Sender, From, St);
- false -> ok
+ true when hd(StrOrFun) == "$tc_html" ->
+ output(major, tl(StrOrFun), Sender, From, St);
+ true when is_function(StrOrFun) ->
+ output(major, StrOrFun(major), Sender, From, St);
+ true ->
+ output(major, StrOrFun, Sender, From, St);
+ false ->
+ ok
end,
case selected_by_level(Level, minor, St) of
- true -> output(minor, Str, Sender, From, St);
- false -> ok
+ true when hd(StrOrFun) == "$tc_html" ->
+ output(minor, tl(StrOrFun), Sender, From, St);
+ true when is_function(StrOrFun) ->
+ output(minor, StrOrFun(minor), Sender, From, St);
+ true ->
+ output(minor, test_server_ctrl:escape_chars(StrOrFun),
+ Sender, From, St);
+ false ->
+ ok
end;
output(stdout, Str, _Sender, From, St) ->
output_to_file(stdout, Str, From, St);
diff --git a/lib/common_test/src/test_server_internal.hrl b/lib/common_test/src/test_server_internal.hrl
index 578f359010..1ec2d83417 100644
--- a/lib/common_test/src/test_server_internal.hrl
+++ b/lib/common_test/src/test_server_internal.hrl
@@ -30,7 +30,6 @@
version, % string()
system_version, % string()
root_dir, % string()
- test_server_dir, % string()
emulator, % string()
otp_release, % string()
username, % string()
diff --git a/lib/common_test/src/test_server_node.erl b/lib/common_test/src/test_server_node.erl
index c12832e0d0..c64399e485 100644
--- a/lib/common_test/src/test_server_node.erl
+++ b/lib/common_test/src/test_server_node.erl
@@ -307,11 +307,11 @@ start_node_peer(SlaveName, OptList, From, TI) ->
HostStr, " ", WaitPort]),
% Support for erl_crash_dump files..
- CrashFile = filename:join([TI#target_info.test_server_dir,
+ CrashDir = test_server_sup:crash_dump_dir(),
+ CrashFile = filename:join([CrashDir,
"erl_crash_dump."++cast_to_list(SlaveName)]),
CrashArgs = lists:concat([" -env ERL_CRASH_DUMP \"",CrashFile,"\" "]),
FailOnError = start_node_get_option_value(fail_on_error, OptList, true),
- Pa = TI#target_info.test_server_dir,
Prog0 = start_node_get_option_value(erl, OptList, default),
Prog = quote_progname(pick_erl_program(Prog0)),
Args =
@@ -322,7 +322,6 @@ start_node_peer(SlaveName, OptList, From, TI) ->
Cmd = lists:concat([Prog,
" -detached ",
TI#target_info.naming, " ", SlaveName,
- " -pa \"", Pa,"\"",
NodeStarted,
CrashArgs,
" ", Args]),
@@ -370,15 +369,15 @@ wait_for_node_started_fun(LSock, Tmo, Cleanup, TI, Self) ->
%% Slave nodes are started on a remote host if
%% - the option remote is given when calling test_server:start_node/3
%%
-start_node_slave(SlaveName, OptList, From, TI) ->
+start_node_slave(SlaveName, OptList, From, _TI) ->
SuppliedArgs = start_node_get_option_value(args, OptList, []),
Cleanup = start_node_get_option_value(cleanup, OptList, true),
- CrashFile = filename:join([TI#target_info.test_server_dir,
+ CrashDir = test_server_sup:crash_dump_dir(),
+ CrashFile = filename:join([CrashDir,
"erl_crash_dump."++cast_to_list(SlaveName)]),
CrashArgs = lists:concat([" -env ERL_CRASH_DUMP \"",CrashFile,"\" "]),
- Pa = TI#target_info.test_server_dir,
- Args = lists:concat([" -pa \"", Pa, "\" ", SuppliedArgs, CrashArgs]),
+ Args = lists:concat([" ", SuppliedArgs, CrashArgs]),
Prog0 = start_node_get_option_value(erl, OptList, default),
Prog = pick_erl_program(Prog0),
diff --git a/lib/common_test/src/test_server_sup.erl b/lib/common_test/src/test_server_sup.erl
index fc2cfd57bd..c4530ba62f 100644
--- a/lib/common_test/src/test_server_sup.erl
+++ b/lib/common_test/src/test_server_sup.erl
@@ -594,7 +594,11 @@ cleanup_crash_dumps() ->
delete_files(Dumps).
crash_dump_dir() ->
- filename:dirname(code:which(?MODULE)).
+ %% If no framework is known, then we use current working directory
+ %% - in most cases that will be the same as the default log
+ %% directory.
+ {ok,Dir} = test_server_sup:framework_call(get_log_dir,[],file:get_cwd()),
+ Dir.
tar_crash_dumps() ->
Dir = crash_dump_dir(),
diff --git a/lib/common_test/test/Makefile b/lib/common_test/test/Makefile
index aa99fe1af1..fd96d06aab 100644
--- a/lib/common_test/test/Makefile
+++ b/lib/common_test/test/Makefile
@@ -68,7 +68,8 @@ MODULES= \
ct_telnet_SUITE \
erl2html2_SUITE \
test_server_SUITE \
- test_server_test_lib
+ test_server_test_lib \
+ ct_release_test_SUITE
ERL_FILES= $(MODULES:%=%.erl)
HRL_FILES= test_server_test_lib.hrl
diff --git a/lib/common_test/test/ct_error_SUITE.erl b/lib/common_test/test/ct_error_SUITE.erl
index 8326705575..53cfbd7118 100644
--- a/lib/common_test/test/ct_error_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE.erl
@@ -728,23 +728,25 @@ test_events(lib_error) ->
{lib_error_1_SUITE,no_lines_throw,{failed,{error,{thrown,catch_me_if_u_can}}}}},
{?eh,test_stats,{0,8,{0,0}}},
{?eh,tc_start,{lib_error_1_SUITE,init_tc_error}},
- {?eh,tc_done,{lib_error_1_SUITE,init_tc_error,ok}},
- {?eh,test_stats,{1,8,{0,0}}},
+ {?eh,tc_done,{ct_framework,init_tc,
+ {framework_error,{{badmatch,[1,2]},'_'}}}},
+ {?eh,test_stats,{0,9,{0,0}}},
{?eh,tc_start,{lib_error_1_SUITE,init_tc_exit}},
- {?eh,tc_done,{lib_error_1_SUITE,init_tc_exit,ok}},
- {?eh,test_stats,{2,8,{0,0}}},
+ {?eh,tc_done,{ct_framework,init_tc,{framework_error,byebye}}},
+ {?eh,test_stats,{0,10,{0,0}}},
{?eh,tc_start,{lib_error_1_SUITE,init_tc_throw}},
- {?eh,tc_done,{lib_error_1_SUITE,init_tc_throw,ok}},
- {?eh,test_stats,{3,8,{0,0}}},
+ {?eh,tc_done,{ct_framework,init_tc,{framework_error,catch_me_if_u_can}}},
+ {?eh,test_stats,{0,11,{0,0}}},
{?eh,tc_start,{lib_error_1_SUITE,end_tc_error}},
- {?eh,tc_done,{lib_error_1_SUITE,end_tc_error,ok}},
- {?eh,test_stats,{3,9,{0,0}}},
+ {?eh,tc_done,{ct_framework,end_tc,
+ {framework_error,{{badmatch,[1,2]},'_'}}}},
+ {?eh,test_stats,{0,12,{0,0}}},
{?eh,tc_start,{lib_error_1_SUITE,end_tc_exit}},
- {?eh,tc_done,{lib_error_1_SUITE,end_tc_exit,ok}},
- {?eh,test_stats,{3,10,{0,0}}},
+ {?eh,tc_done,{ct_framework,end_tc,{framework_error,byebye}}},
+ {?eh,test_stats,{0,13,{0,0}}},
{?eh,tc_start,{lib_error_1_SUITE,end_tc_throw}},
- {?eh,tc_done,{lib_error_1_SUITE,end_tc_throw,ok}},
- {?eh,test_stats,{3,11,{0,0}}},
+ {?eh,tc_done,{ct_framework,end_tc,{framework_error,catch_me_if_u_can}}},
+ {?eh,test_stats,{0,14,{0,0}}},
{?eh,tc_start,{lib_error_1_SUITE,end_per_suite}},
{?eh,tc_done,{lib_error_1_SUITE,end_per_suite,ok}},
{?eh,test_done,{'DEF','STOP_TIME'}},
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/lib_error_1_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/lib_error_1_SUITE.erl
index 658c7e8232..6f1b391ae6 100644
--- a/lib/common_test/test/ct_error_SUITE_data/error/test/lib_error_1_SUITE.erl
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/lib_error_1_SUITE.erl
@@ -152,23 +152,32 @@ no_lines_throw(_) ->
lib_no_lines:do_throw(),
ok.
-init_tc_error(_) ->
+init_tc_error() ->
put('$test_server_framework_test',
fun(init_tc, _Default) -> lib_no_lines:do_error(), ok;
(_, Default) -> Default
- end), ok.
+ end), [].
-init_tc_exit(_) ->
+init_tc_error(_) ->
+ ok.
+
+init_tc_exit() ->
put('$test_server_framework_test',
fun(init_tc, _Default) -> lib_no_lines:do_exit(), ok;
(_, Default) -> Default
- end), ok.
+ end), [].
-init_tc_throw(_) ->
+init_tc_exit(_) ->
+ ok.
+
+init_tc_throw() ->
put('$test_server_framework_test',
fun(init_tc, _Default) -> lib_no_lines:do_throw(), ok;
(_, Default) -> Default
- end), ok.
+ end), [].
+
+init_tc_throw(_) ->
+ ok.
end_tc_error(_) ->
put('$test_server_framework_test',
diff --git a/lib/common_test/test/ct_hooks_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE.erl
index 06bc0c07f4..5ec88b438e 100644
--- a/lib/common_test/test/ct_hooks_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE.erl
@@ -324,6 +324,8 @@ test_events(one_empty_cth) ->
{?eh,tc_start,{ct_cth_empty_SUITE,test_case}},
{?eh,cth,{empty_cth,pre_init_per_testcase,[test_case,'$proplist',[]]}},
+ {?eh,cth,{empty_cth,post_init_per_testcase,[test_case,'$proplist','_',[]]}},
+ {?eh,cth,{empty_cth,pre_end_per_testcase,[test_case,'$proplist',[]]}},
{?eh,cth,{empty_cth,post_end_per_testcase,[test_case,'$proplist','_',[]]}},
{?eh,tc_done,{ct_cth_empty_SUITE,test_case,ok}},
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl
index 3b2fd4b3c0..023f6440c2 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,22 +14,22 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-
--module(crash_init_cth).
-
-
--include_lib("common_test/src/ct_util.hrl").
--include_lib("common_test/include/ct_event.hrl").
-
-
-%% CT Hooks
--export([init/2]).
-
-init(Id, Opts) ->
- empty_cth:init(Id, Opts),
- exit(diediedie).
-
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(crash_init_cth).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+
+%% CT Hooks
+-export([init/2]).
+
+init(Id, Opts) ->
+ empty_cth:init(Id, Opts),
+ exit(diediedie).
+
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl
index be2ade0715..c443700dde 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,35 +14,36 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
--module(ct_cth_empty_SUITE).
-
--suite_defaults([{timetrap, {minutes, 10}}]).
-
-%% Note: This directive should only be used in test suites.
--compile(export_all).
-
--include("ct.hrl").
-
-%% Test server callback functions
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_testcase(_TestCase, Config) ->
- Config.
-
-end_per_testcase(_TestCase, _Config) ->
- ok.
-
-all() ->
- [test_case].
-
-%% Test cases starts here.
-test_case(Config) when is_list(Config) ->
- ok.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(ct_cth_empty_SUITE).
+
+-suite_defaults([{timetrap, {minutes, 10}}]).
+
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+
+-include("ct.hrl").
+
+%% Test server callback functions
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(_Config) ->
+ ok.
+
+init_per_testcase(_TestCase, Config) ->
+ Config.
+
+end_per_testcase(_TestCase, _Config) ->
+ ok.
+
+all() ->
+ [test_case].
+
+%% Test cases starts here.
+test_case(Config) when is_list(Config) ->
+ ok.
+
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl
index f223f031d7..e5bb4f3ef6 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl
@@ -50,6 +50,8 @@
-export([post_end_per_group/4]).
-export([pre_init_per_testcase/3]).
+-export([post_init_per_testcase/4]).
+-export([pre_end_per_testcase/3]).
-export([post_end_per_testcase/4]).
-export([on_tc_fail/3]).
@@ -208,7 +210,7 @@ post_end_per_group(Group,Config,Return,State) ->
ct:log("~w:post_end_per_group(~w) called", [?MODULE,Group]),
{Return, State}.
-%% @doc Called before each test case.
+%% @doc Called before init_per_testcase/2 for each test case.
%% You can change the config in this function.
-spec pre_init_per_testcase(TC :: atom(),
Config :: config(),
@@ -222,8 +224,36 @@ pre_init_per_testcase(TC,Config,State) ->
ct:log("~w:pre_init_per_testcase(~w) called", [?MODULE,TC]),
{Config, State}.
-%% @doc Called after each test case. Note that the config cannot be
-%% changed here, only the status of the test case.
+%% @doc Called after init_per_testcase/2, and before the test case.
+-spec post_init_per_testcase(TC :: atom(),
+ Config :: config(),
+ Return :: config() | skip_or_fail(),
+ State :: #state{}) ->
+ {config() | skip_or_fail(), NewState :: #state{}}.
+post_init_per_testcase(TC,Config,Return,State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, post_init_per_testcase,
+ [TC,Config,Return,State]}}),
+ ct:log("~w:post_init_per_testcase(~w) called", [?MODULE,TC]),
+ {Return, State}.
+
+%% @doc Called before end_per_testacse/2. No skip or fail allowed here,
+%% only config additions.
+-spec pre_end_per_testcase(TC :: atom(),
+ Config :: config(),
+ State :: #state{}) ->
+ {config(), NewState :: #state{}}.
+pre_end_per_testcase(TC,Config,State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, pre_end_per_testcase,
+ [TC,Config,State]}}),
+ ct:log("~w:pre_end_per_testcase(~w) called", [?MODULE,TC]),
+ {Config, State}.
+
+%% @doc Called after end_per_testcase/2 for each test case. Note that
+%% the config cannot be changed here, only the status of the test case.
-spec post_end_per_testcase(TC :: atom(),
Config :: config(),
Return :: term(),
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl
index 98e4548864..a79f4d4541 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,60 +14,66 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-
--module(fail_pre_suite_cth).
-
-
--include_lib("common_test/src/ct_util.hrl").
--include_lib("common_test/include/ct_event.hrl").
-
-
-%% CT Hooks
--compile(export_all).
-
-init(Id, Opts) ->
- empty_cth:init(Id, Opts).
-
-pre_init_per_suite(Suite, Config, State) ->
- empty_cth:pre_init_per_suite(Suite,Config,State),
- {{fail, "Test failure"}, State}.
-
-post_init_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_init_per_suite(Suite,Config,Return,State).
-
-pre_end_per_suite(Suite,Config,State) ->
- empty_cth:pre_end_per_suite(Suite,Config,State).
-
-post_end_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_end_per_suite(Suite,Config,Return,State).
-
-pre_init_per_group(Group,Config,State) ->
- empty_cth:pre_init_per_group(Group,Config,State).
-
-post_init_per_group(Group,Config,Return,State) ->
- empty_cth:post_init_per_group(Group,Config,Return,State).
-
-pre_end_per_group(Group,Config,State) ->
- empty_cth:pre_end_per_group(Group,Config,State).
-
-post_end_per_group(Group,Config,Return,State) ->
- empty_cth:post_end_per_group(Group,Config,Return,State).
-
-pre_init_per_testcase(TC,Config,State) ->
- empty_cth:pre_init_per_testcase(TC,Config,State).
-
-post_end_per_testcase(TC,Config,Return,State) ->
- empty_cth:post_end_per_testcase(TC,Config,Return,State).
-
-on_tc_fail(TC, Reason, State) ->
- empty_cth:on_tc_fail(TC,Reason,State).
-
-on_tc_skip(TC, Reason, State) ->
- empty_cth:on_tc_skip(TC,Reason,State).
-
-terminate(State) ->
- empty_cth:terminate(State).
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(fail_pre_suite_cth).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+
+%% CT Hooks
+-compile(export_all).
+
+init(Id, Opts) ->
+ empty_cth:init(Id, Opts).
+
+pre_init_per_suite(Suite, Config, State) ->
+ empty_cth:pre_init_per_suite(Suite,Config,State),
+ {{fail, "Test failure"}, State}.
+
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_init_per_suite(Suite,Config,Return,State).
+
+pre_end_per_suite(Suite,Config,State) ->
+ empty_cth:pre_end_per_suite(Suite,Config,State).
+
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
+
+pre_init_per_group(Group,Config,State) ->
+ empty_cth:pre_init_per_group(Group,Config,State).
+
+post_init_per_group(Group,Config,Return,State) ->
+ empty_cth:post_init_per_group(Group,Config,Return,State).
+
+pre_end_per_group(Group,Config,State) ->
+ empty_cth:pre_end_per_group(Group,Config,State).
+
+post_end_per_group(Group,Config,Return,State) ->
+ empty_cth:post_end_per_group(Group,Config,Return,State).
+
+pre_init_per_testcase(TC,Config,State) ->
+ empty_cth:pre_init_per_testcase(TC,Config,State).
+
+post_init_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_init_per_testcase(TC,Config,Return,State).
+
+pre_end_per_testcase(TC,Config,State) ->
+ empty_cth:pre_end_per_testcase(TC,Config,State).
+
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
+
+on_tc_fail(TC, Reason, State) ->
+ empty_cth:on_tc_fail(TC,Reason,State).
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl
index 8898a54b8d..a084423cf3 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,21 +14,21 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-
--module(minimal_cth).
-
-
--include_lib("common_test/src/ct_util.hrl").
--include_lib("common_test/include/ct_event.hrl").
-
-
-%% CT Hooks
--export([init/2]).
-
-init(Id, Opts) ->
- empty_cth:init(Id, Opts).
-
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(minimal_cth).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+
+%% CT Hooks
+-export([init/2]).
+
+init(Id, Opts) ->
+ empty_cth:init(Id, Opts).
+
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl
index 2414da0683..7895c43aeb 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,30 +14,30 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-
--module(minimal_terminate_cth).
-
-
--include_lib("common_test/src/ct_util.hrl").
--include_lib("common_test/include/ct_event.hrl").
-
-
-%% CT Hooks
--export([init/2]).
--export([terminate/1]).
--export([on_tc_skip/3]).
-
-init(Id, Opts) ->
- empty_cth:init(Id, Opts).
-
-on_tc_skip(TC, Reason, State) ->
- empty_cth:on_tc_skip(TC,Reason,State).
-
-terminate(State) ->
- empty_cth:terminate(State).
-
-
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(minimal_terminate_cth).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+
+%% CT Hooks
+-export([init/2]).
+-export([terminate/1]).
+-export([on_tc_skip/3]).
+
+init(Id, Opts) ->
+ empty_cth:init(Id, Opts).
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+ empty_cth:terminate(State).
+
+
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/prio_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/prio_cth.erl
index 0f6ef7c596..72d6d186ed 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/prio_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/prio_cth.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,62 +14,68 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-
--module(prio_cth).
-
-
--include_lib("common_test/src/ct_util.hrl").
-
-
-%% CT Hooks
--compile(export_all).
-
-id(Opts) ->
- empty_cth:id(Opts).
-
-init(Id, Opts) ->
- {ok, [Prio|_] = State} = empty_cth:init(Id, Opts),
- {ok, State, Prio}.
-
-pre_init_per_suite(Suite, Config, State) ->
- empty_cth:pre_init_per_suite(Suite,Config,State).
-
-post_init_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_init_per_suite(Suite,Config,Return,State).
-
-pre_end_per_suite(Suite,Config,State) ->
- empty_cth:pre_end_per_suite(Suite,Config,State).
-
-post_end_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_end_per_suite(Suite,Config,Return,State).
-
-pre_init_per_group(Group,Config,State) ->
- empty_cth:pre_init_per_group(Group,Config,State).
-
-post_init_per_group(Group,Config,Return,State) ->
- empty_cth:post_init_per_group(Group,Config,Return,State).
-
-pre_end_per_group(Group,Config,State) ->
- empty_cth:pre_end_per_group(Group,Config,State).
-
-post_end_per_group(Group,Config,Return,State) ->
- empty_cth:post_end_per_group(Group,Config,Return,State).
-
-pre_init_per_testcase(TC,Config,State) ->
- empty_cth:pre_init_per_testcase(TC,Config,State).
-
-post_end_per_testcase(TC,Config,Return,State) ->
- empty_cth:post_end_per_testcase(TC,Config,Return,State).
-
-on_tc_fail(TC, Reason, State) ->
- empty_cth:on_tc_fail(TC,Reason,State).
-
-on_tc_skip(TC, Reason, State) ->
- empty_cth:on_tc_skip(TC,Reason,State).
-
-terminate(State) ->
- empty_cth:terminate(State).
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(prio_cth).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+
+
+%% CT Hooks
+-compile(export_all).
+
+id(Opts) ->
+ empty_cth:id(Opts).
+
+init(Id, Opts) ->
+ {ok, [Prio|_] = State} = empty_cth:init(Id, Opts),
+ {ok, State, Prio}.
+
+pre_init_per_suite(Suite, Config, State) ->
+ empty_cth:pre_init_per_suite(Suite,Config,State).
+
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_init_per_suite(Suite,Config,Return,State).
+
+pre_end_per_suite(Suite,Config,State) ->
+ empty_cth:pre_end_per_suite(Suite,Config,State).
+
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
+
+pre_init_per_group(Group,Config,State) ->
+ empty_cth:pre_init_per_group(Group,Config,State).
+
+post_init_per_group(Group,Config,Return,State) ->
+ empty_cth:post_init_per_group(Group,Config,Return,State).
+
+pre_end_per_group(Group,Config,State) ->
+ empty_cth:pre_end_per_group(Group,Config,State).
+
+post_end_per_group(Group,Config,Return,State) ->
+ empty_cth:post_end_per_group(Group,Config,Return,State).
+
+pre_init_per_testcase(TC,Config,State) ->
+ empty_cth:pre_init_per_testcase(TC,Config,State).
+
+post_init_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_init_per_testcase(TC,Config,Return,State).
+
+pre_end_per_testcase(TC,Config,State) ->
+ empty_cth:pre_end_per_testcase(TC,Config,State).
+
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
+
+on_tc_fail(TC, Reason, State) ->
+ empty_cth:on_tc_fail(TC,Reason,State).
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl
index dfb696bcb9..cf484d3cd7 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,62 +14,68 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-
--module(recover_post_suite_cth).
-
-
--include_lib("common_test/src/ct_util.hrl").
--include_lib("common_test/include/ct_event.hrl").
-
-
-%% CT Hooks
--compile(export_all).
-
-init(Id, Opts) ->
- empty_cth:init(Id, Opts).
-
-pre_init_per_suite(Suite, Config, State) ->
- empty_cth:pre_init_per_suite(Suite,Config,State).
-
-post_init_per_suite(Suite,Config,{'EXIT',Reason} = Return,State) ->
- empty_cth:post_init_per_suite(Suite,Config,Return,State),
- {lists:keydelete(tc_status,1,Config),State};
-post_init_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_init_per_suite(Suite,Config,Return,State).
-
-pre_end_per_suite(Suite,Config,State) ->
- empty_cth:pre_end_per_suite(Suite,Config,State).
-
-post_end_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_end_per_suite(Suite,Config,Return,State).
-
-pre_init_per_group(Group,Config,State) ->
- empty_cth:pre_init_per_group(Group,Config,State).
-
-post_init_per_group(Group,Config,Return,State) ->
- empty_cth:post_init_per_group(Group,Config,Return,State).
-
-pre_end_per_group(Group,Config,State) ->
- empty_cth:pre_end_per_group(Group,Config,State).
-
-post_end_per_group(Group,Config,Return,State) ->
- empty_cth:post_end_per_group(Group,Config,Return,State).
-
-pre_init_per_testcase(TC,Config,State) ->
- empty_cth:pre_init_per_testcase(TC,Config,State).
-
-post_end_per_testcase(TC,Config,Return,State) ->
- empty_cth:post_end_per_testcase(TC,Config,Return,State).
-
-on_tc_fail(TC, Reason, State) ->
- empty_cth:on_tc_fail(TC,Reason,State).
-
-on_tc_skip(TC, Reason, State) ->
- empty_cth:on_tc_skip(TC,Reason,State).
-
-terminate(State) ->
- empty_cth:terminate(State).
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(recover_post_suite_cth).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+
+%% CT Hooks
+-compile(export_all).
+
+init(Id, Opts) ->
+ empty_cth:init(Id, Opts).
+
+pre_init_per_suite(Suite, Config, State) ->
+ empty_cth:pre_init_per_suite(Suite,Config,State).
+
+post_init_per_suite(Suite,Config,{'EXIT',Reason} = Return,State) ->
+ empty_cth:post_init_per_suite(Suite,Config,Return,State),
+ {lists:keydelete(tc_status,1,Config),State};
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_init_per_suite(Suite,Config,Return,State).
+
+pre_end_per_suite(Suite,Config,State) ->
+ empty_cth:pre_end_per_suite(Suite,Config,State).
+
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
+
+pre_init_per_group(Group,Config,State) ->
+ empty_cth:pre_init_per_group(Group,Config,State).
+
+post_init_per_group(Group,Config,Return,State) ->
+ empty_cth:post_init_per_group(Group,Config,Return,State).
+
+pre_end_per_group(Group,Config,State) ->
+ empty_cth:pre_end_per_group(Group,Config,State).
+
+post_end_per_group(Group,Config,Return,State) ->
+ empty_cth:post_end_per_group(Group,Config,Return,State).
+
+pre_init_per_testcase(TC,Config,State) ->
+ empty_cth:pre_init_per_testcase(TC,Config,State).
+
+post_init_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_init_per_testcase(TC,Config,Return,State).
+
+pre_end_per_testcase(TC,Config,State) ->
+ empty_cth:pre_end_per_testcase(TC,Config,State).
+
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
+
+on_tc_fail(TC, Reason, State) ->
+ empty_cth:on_tc_fail(TC,Reason,State).
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl
index 50b220d093..60615d97fc 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,63 +14,69 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-
--module(same_id_cth).
-
-
--include_lib("common_test/src/ct_util.hrl").
--include_lib("common_test/include/ct_event.hrl").
-
-
-%% CT Hooks
--compile(export_all).
-
-id(Opts) ->
- empty_cth:id(Opts),
- ?MODULE.
-
-init(Id, Opts) ->
- empty_cth:init(Id, Opts).
-
-pre_init_per_suite(Suite, Config, State) ->
- empty_cth:pre_init_per_suite(Suite,Config,State).
-
-post_init_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_init_per_suite(Suite,Config,Return,State).
-
-pre_end_per_suite(Suite,Config,State) ->
- empty_cth:pre_end_per_suite(Suite,Config,State).
-
-post_end_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_end_per_suite(Suite,Config,Return,State).
-
-pre_init_per_group(Group,Config,State) ->
- empty_cth:pre_init_per_group(Group,Config,State).
-
-post_init_per_group(Group,Config,Return,State) ->
- empty_cth:post_init_per_group(Group,Config,Return,State).
-
-pre_end_per_group(Group,Config,State) ->
- empty_cth:pre_end_per_group(Group,Config,State).
-
-post_end_per_group(Group,Config,Return,State) ->
- empty_cth:post_end_per_group(Group,Config,Return,State).
-
-pre_init_per_testcase(TC,Config,State) ->
- empty_cth:pre_init_per_testcase(TC,Config,State).
-
-post_end_per_testcase(TC,Config,Return,State) ->
- empty_cth:post_end_per_testcase(TC,Config,Return,State).
-
-on_tc_fail(TC, Reason, State) ->
- empty_cth:on_tc_fail(TC,Reason,State).
-
-on_tc_skip(TC, Reason, State) ->
- empty_cth:on_tc_skip(TC,Reason,State).
-
-terminate(State) ->
- empty_cth:terminate(State).
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(same_id_cth).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+
+%% CT Hooks
+-compile(export_all).
+
+id(Opts) ->
+ empty_cth:id(Opts),
+ ?MODULE.
+
+init(Id, Opts) ->
+ empty_cth:init(Id, Opts).
+
+pre_init_per_suite(Suite, Config, State) ->
+ empty_cth:pre_init_per_suite(Suite,Config,State).
+
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_init_per_suite(Suite,Config,Return,State).
+
+pre_end_per_suite(Suite,Config,State) ->
+ empty_cth:pre_end_per_suite(Suite,Config,State).
+
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
+
+pre_init_per_group(Group,Config,State) ->
+ empty_cth:pre_init_per_group(Group,Config,State).
+
+post_init_per_group(Group,Config,Return,State) ->
+ empty_cth:post_init_per_group(Group,Config,Return,State).
+
+pre_end_per_group(Group,Config,State) ->
+ empty_cth:pre_end_per_group(Group,Config,State).
+
+post_end_per_group(Group,Config,Return,State) ->
+ empty_cth:post_end_per_group(Group,Config,Return,State).
+
+pre_init_per_testcase(TC,Config,State) ->
+ empty_cth:pre_init_per_testcase(TC,Config,State).
+
+post_init_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_init_per_testcase(TC,Config,Return,State).
+
+pre_end_per_testcase(TC,Config,State) ->
+ empty_cth:pre_end_per_testcase(TC,Config,State).
+
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
+
+on_tc_fail(TC, Reason, State) ->
+ empty_cth:on_tc_fail(TC,Reason,State).
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl
index d8332f77f6..56163e730c 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,60 +14,66 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-
--module(skip_post_suite_cth).
-
-
--include_lib("common_test/src/ct_util.hrl").
--include_lib("common_test/include/ct_event.hrl").
-
-
-%% CT Hooks
--compile(export_all).
-
-init(Id, Opts) ->
- empty_cth:init(Id, Opts).
-
-pre_init_per_suite(Suite, Config, State) ->
- empty_cth:pre_init_per_suite(Suite,Config,State).
-
-post_init_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_init_per_suite(Suite,Config,Return,State),
- {{skip, "Test skip"}, State}.
-
-pre_end_per_suite(Suite,Config,State) ->
- empty_cth:pre_end_per_suite(Suite,Config,State).
-
-post_end_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_end_per_suite(Suite,Config,Return,State).
-
-pre_init_per_group(Group,Config,State) ->
- empty_cth:pre_init_per_group(Group,Config,State).
-
-post_init_per_group(Group,Config,Return,State) ->
- empty_cth:post_init_per_group(Group,Config,Return,State).
-
-pre_end_per_group(Group,Config,State) ->
- empty_cth:pre_end_per_group(Group,Config,State).
-
-post_end_per_group(Group,Config,Return,State) ->
- empty_cth:post_end_per_group(Group,Config,Return,State).
-
-pre_init_per_testcase(TC,Config,State) ->
- empty_cth:pre_init_per_testcase(TC,Config,State).
-
-post_end_per_testcase(TC,Config,Return,State) ->
- empty_cth:post_end_per_testcase(TC,Config,Return,State).
-
-on_tc_fail(TC, Reason, State) ->
- empty_cth:on_tc_fail(TC,Reason,State).
-
-on_tc_skip(TC, Reason, State) ->
- empty_cth:on_tc_skip(TC,Reason,State).
-
-terminate(State) ->
- empty_cth:terminate(State).
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(skip_post_suite_cth).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+
+%% CT Hooks
+-compile(export_all).
+
+init(Id, Opts) ->
+ empty_cth:init(Id, Opts).
+
+pre_init_per_suite(Suite, Config, State) ->
+ empty_cth:pre_init_per_suite(Suite,Config,State).
+
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_init_per_suite(Suite,Config,Return,State),
+ {{skip, "Test skip"}, State}.
+
+pre_end_per_suite(Suite,Config,State) ->
+ empty_cth:pre_end_per_suite(Suite,Config,State).
+
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
+
+pre_init_per_group(Group,Config,State) ->
+ empty_cth:pre_init_per_group(Group,Config,State).
+
+post_init_per_group(Group,Config,Return,State) ->
+ empty_cth:post_init_per_group(Group,Config,Return,State).
+
+pre_end_per_group(Group,Config,State) ->
+ empty_cth:pre_end_per_group(Group,Config,State).
+
+post_end_per_group(Group,Config,Return,State) ->
+ empty_cth:post_end_per_group(Group,Config,Return,State).
+
+pre_init_per_testcase(TC,Config,State) ->
+ empty_cth:pre_init_per_testcase(TC,Config,State).
+
+post_init_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_init_per_testcase(TC,Config,Return,State).
+
+pre_end_per_testcase(TC,Config,State) ->
+ empty_cth:pre_end_per_testcase(TC,Config,State).
+
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
+
+on_tc_fail(TC, Reason, State) ->
+ empty_cth:on_tc_fail(TC,Reason,State).
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_end_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_end_cth.erl
index 3c490c9fea..deb622b316 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_end_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_end_cth.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,62 +14,68 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-
--module(skip_pre_end_cth).
-
-
--include_lib("common_test/src/ct_util.hrl").
--include_lib("common_test/include/ct_event.hrl").
-
-
-%% CT Hooks
--compile(export_all).
-
-init(Id, Opts) ->
- empty_cth:init(Id, Opts).
-
-
-pre_init_per_suite(Suite, Config, State) ->
- empty_cth:pre_init_per_suite(Suite,Config,State).
-
-post_init_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_init_per_suite(Suite,Config,Return,State).
-
-pre_end_per_suite(Suite,Config,State) ->
- empty_cth:pre_end_per_suite(Suite,Config,State),
- {{skip, "Test skip"}, State}.
-
-post_end_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_end_per_suite(Suite,Config,Return,State).
-
-pre_init_per_group(Group,Config,State) ->
- empty_cth:pre_init_per_group(Group,Config,State).
-
-post_init_per_group(Group,Config,Return,State) ->
- empty_cth:post_init_per_group(Group,Config,Return,State).
-
-pre_end_per_group(Group,Config,State) ->
- empty_cth:pre_end_per_group(Group,Config,State),
- {{skip, "Test skip"}, State}.
-
-post_end_per_group(Group,Config,Return,State) ->
- empty_cth:post_end_per_group(Group,Config,Return,State).
-
-pre_init_per_testcase(TC,Config,State) ->
- empty_cth:pre_init_per_testcase(TC,Config,State).
-
-post_end_per_testcase(TC,Config,Return,State) ->
- empty_cth:post_end_per_testcase(TC,Config,Return,State).
-
-on_tc_fail(TC, Reason, State) ->
- empty_cth:on_tc_fail(TC,Reason,State).
-
-on_tc_skip(TC, Reason, State) ->
- empty_cth:on_tc_skip(TC,Reason,State).
-
-terminate(State) ->
- empty_cth:terminate(State).
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(skip_pre_end_cth).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+
+%% CT Hooks
+-compile(export_all).
+
+init(Id, Opts) ->
+ empty_cth:init(Id, Opts).
+
+
+pre_init_per_suite(Suite, Config, State) ->
+ empty_cth:pre_init_per_suite(Suite,Config,State).
+
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_init_per_suite(Suite,Config,Return,State).
+
+pre_end_per_suite(Suite,Config,State) ->
+ empty_cth:pre_end_per_suite(Suite,Config,State),
+ {{skip, "Test skip"}, State}.
+
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
+
+pre_init_per_group(Group,Config,State) ->
+ empty_cth:pre_init_per_group(Group,Config,State).
+
+post_init_per_group(Group,Config,Return,State) ->
+ empty_cth:post_init_per_group(Group,Config,Return,State).
+
+pre_end_per_group(Group,Config,State) ->
+ empty_cth:pre_end_per_group(Group,Config,State),
+ {{skip, "Test skip"}, State}.
+
+post_end_per_group(Group,Config,Return,State) ->
+ empty_cth:post_end_per_group(Group,Config,Return,State).
+
+pre_init_per_testcase(TC,Config,State) ->
+ empty_cth:pre_init_per_testcase(TC,Config,State).
+
+post_init_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_init_per_testcase(TC,Config,Return,State).
+
+pre_end_per_testcase(TC,Config,State) ->
+ empty_cth:pre_end_per_testcase(TC,Config,State).
+
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
+
+on_tc_fail(TC, Reason, State) ->
+ empty_cth:on_tc_fail(TC,Reason,State).
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl
index 3ef08ff4e1..ea1d485700 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,61 +14,67 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-
--module(skip_pre_suite_cth).
-
-
--include_lib("common_test/src/ct_util.hrl").
--include_lib("common_test/include/ct_event.hrl").
-
-
-%% CT Hooks
--compile(export_all).
-
-init(Id, Opts) ->
- empty_cth:init(Id, Opts).
-
-
-pre_init_per_suite(Suite, Config, State) ->
- empty_cth:pre_init_per_suite(Suite,Config,State),
- {{skip, "Test skip"}, State}.
-
-post_init_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_init_per_suite(Suite,Config,Return,State).
-
-pre_end_per_suite(Suite,Config,State) ->
- empty_cth:pre_end_per_suite(Suite,Config,State).
-
-post_end_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_end_per_suite(Suite,Config,Return,State).
-
-pre_init_per_group(Group,Config,State) ->
- empty_cth:pre_init_per_group(Group,Config,State).
-
-post_init_per_group(Group,Config,Return,State) ->
- empty_cth:post_init_per_group(Group,Config,Return,State).
-
-pre_end_per_group(Group,Config,State) ->
- empty_cth:pre_end_per_group(Group,Config,State).
-
-post_end_per_group(Group,Config,Return,State) ->
- empty_cth:post_end_per_group(Group,Config,Return,State).
-
-pre_init_per_testcase(TC,Config,State) ->
- empty_cth:pre_init_per_testcase(TC,Config,State).
-
-post_end_per_testcase(TC,Config,Return,State) ->
- empty_cth:post_end_per_testcase(TC,Config,Return,State).
-
-on_tc_fail(TC, Reason, State) ->
- empty_cth:on_tc_fail(TC,Reason,State).
-
-on_tc_skip(TC, Reason, State) ->
- empty_cth:on_tc_skip(TC,Reason,State).
-
-terminate(State) ->
- empty_cth:terminate(State).
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(skip_pre_suite_cth).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+
+%% CT Hooks
+-compile(export_all).
+
+init(Id, Opts) ->
+ empty_cth:init(Id, Opts).
+
+
+pre_init_per_suite(Suite, Config, State) ->
+ empty_cth:pre_init_per_suite(Suite,Config,State),
+ {{skip, "Test skip"}, State}.
+
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_init_per_suite(Suite,Config,Return,State).
+
+pre_end_per_suite(Suite,Config,State) ->
+ empty_cth:pre_end_per_suite(Suite,Config,State).
+
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
+
+pre_init_per_group(Group,Config,State) ->
+ empty_cth:pre_init_per_group(Group,Config,State).
+
+post_init_per_group(Group,Config,Return,State) ->
+ empty_cth:post_init_per_group(Group,Config,Return,State).
+
+pre_end_per_group(Group,Config,State) ->
+ empty_cth:pre_end_per_group(Group,Config,State).
+
+post_end_per_group(Group,Config,Return,State) ->
+ empty_cth:post_end_per_group(Group,Config,Return,State).
+
+pre_init_per_testcase(TC,Config,State) ->
+ empty_cth:pre_init_per_testcase(TC,Config,State).
+
+post_init_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_init_per_testcase(TC,Config,Return,State).
+
+pre_end_per_testcase(TC,Config,State) ->
+ empty_cth:pre_end_per_testcase(TC,Config,State).
+
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
+
+on_tc_fail(TC, Reason, State) ->
+ empty_cth:on_tc_fail(TC,Reason,State).
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl
index 338336a140..c2135bbbee 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,71 +14,79 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-
--module(state_update_cth).
-
-
--include_lib("common_test/src/ct_util.hrl").
--include_lib("common_test/include/ct_event.hrl").
-
-%% CT Hooks
--compile(export_all).
-
-init(Id, Opts) ->
- State = empty_cth:init(Id, Opts),
- {ok, [init|State]}.
-
-pre_init_per_suite(Suite, Config, State) ->
- empty_cth:pre_init_per_suite(Suite,Config,State),
- {Config, [pre_init_per_suite|State]}.
-
-post_init_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_init_per_suite(Suite,Config,Return,State),
- {Config, [post_init_per_suite|State]}.
-
-pre_end_per_suite(Suite,Config,State) ->
- empty_cth:pre_end_per_suite(Suite,Config,State),
- {Config, [pre_end_per_suite|State]}.
-
-post_end_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_end_per_suite(Suite,Config,Return,State),
- {Return, [post_end_per_suite|State]}.
-
-pre_init_per_group(Group,Config,State) ->
- empty_cth:pre_init_per_group(Group,Config,State),
- {Config, [pre_init_per_group|State]}.
-
-post_init_per_group(Group,Config,Return,State) ->
- empty_cth:post_init_per_group(Group,Config,Return,State),
- {Return, [post_init_per_group|State]}.
-
-pre_end_per_group(Group,Config,State) ->
- empty_cth:pre_end_per_group(Group,Config,State),
- {Config, [pre_end_per_group|State]}.
-
-post_end_per_group(Group,Config,Return,State) ->
- empty_cth:post_end_per_group(Group,Config,Return,State),
- {Return, [post_end_per_group|State]}.
-
-pre_init_per_testcase(TC,Config,State) ->
- empty_cth:pre_init_per_testcase(TC,Config,State),
- {Config, [pre_init_per_testcase|State]}.
-
-post_end_per_testcase(TC,Config,Return,State) ->
- empty_cth:post_end_per_testcase(TC,Config,Return,State),
- {Return, [post_end_per_testcase|State]}.
-
-on_tc_fail(TC, Reason, State) ->
- empty_cth:on_tc_fail(TC,Reason,State),
- [on_tc_fail|State].
-
-on_tc_skip(TC, Reason, State) ->
- empty_cth:on_tc_skip(TC,Reason,State),
- [on_tc_skip|State].
-
-terminate(State) ->
- empty_cth:terminate(State).
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(state_update_cth).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+%% CT Hooks
+-compile(export_all).
+
+init(Id, Opts) ->
+ State = empty_cth:init(Id, Opts),
+ {ok, [init|State]}.
+
+pre_init_per_suite(Suite, Config, State) ->
+ empty_cth:pre_init_per_suite(Suite,Config,State),
+ {Config, [pre_init_per_suite|State]}.
+
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_init_per_suite(Suite,Config,Return,State),
+ {Config, [post_init_per_suite|State]}.
+
+pre_end_per_suite(Suite,Config,State) ->
+ empty_cth:pre_end_per_suite(Suite,Config,State),
+ {Config, [pre_end_per_suite|State]}.
+
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_end_per_suite(Suite,Config,Return,State),
+ {Return, [post_end_per_suite|State]}.
+
+pre_init_per_group(Group,Config,State) ->
+ empty_cth:pre_init_per_group(Group,Config,State),
+ {Config, [pre_init_per_group|State]}.
+
+post_init_per_group(Group,Config,Return,State) ->
+ empty_cth:post_init_per_group(Group,Config,Return,State),
+ {Return, [post_init_per_group|State]}.
+
+pre_end_per_group(Group,Config,State) ->
+ empty_cth:pre_end_per_group(Group,Config,State),
+ {Config, [pre_end_per_group|State]}.
+
+post_end_per_group(Group,Config,Return,State) ->
+ empty_cth:post_end_per_group(Group,Config,Return,State),
+ {Return, [post_end_per_group|State]}.
+
+pre_init_per_testcase(TC,Config,State) ->
+ empty_cth:pre_init_per_testcase(TC,Config,State),
+ {Config, [pre_init_per_testcase|State]}.
+
+post_init_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_init_per_testcase(TC,Config,Return,State),
+ {Return, [post_init_per_testcase|State]}.
+
+pre_end_per_testcase(TC,Config,State) ->
+ empty_cth:pre_end_per_testcase(TC,Config,State),
+ {Config, [pre_end_per_testcase|State]}.
+
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_end_per_testcase(TC,Config,Return,State),
+ {Return, [post_end_per_testcase|State]}.
+
+on_tc_fail(TC, Reason, State) ->
+ empty_cth:on_tc_fail(TC,Reason,State),
+ [on_tc_fail|State].
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State),
+ [on_tc_skip|State].
+
+terminate(State) ->
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl
index da43d56c12..5ac4bdddf8 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,59 +14,65 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-
--module(undef_cth).
-
-
--include_lib("common_test/src/ct_util.hrl").
--include_lib("common_test/include/ct_event.hrl").
-
-
-%% CT Hooks
--compile(export_all).
-
-init(Id, Opts) ->
- empty_cth:init(Id, Opts).
-
-pre_init_per_suite(_Suite, _Config, _State) ->
- lists:flaten([1,2,[3,4]]).
-
-post_init_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_init_per_suite(Suite,Config,Return,State).
-
-pre_end_per_suite(Suite,Config,State) ->
- empty_cth:pre_end_per_suite(Suite,Config,State).
-
-post_end_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_end_per_suite(Suite,Config,Return,State).
-
-pre_init_per_group(Group,Config,State) ->
- empty_cth:pre_init_per_group(Group,Config,State).
-
-post_init_per_group(Group,Config,Return,State) ->
- empty_cth:post_init_per_group(Group,Config,Return,State).
-
-pre_end_per_group(Group,Config,State) ->
- empty_cth:pre_end_per_group(Group,Config,State).
-
-post_end_per_group(Group,Config,Return,State) ->
- empty_cth:post_end_per_group(Group,Config,Return,State).
-
-pre_init_per_testcase(TC,Config,State) ->
- empty_cth:pre_init_per_testcase(TC,Config,State).
-
-post_end_per_testcase(TC,Config,Return,State) ->
- empty_cth:post_end_per_testcase(TC,Config,Return,State).
-
-on_tc_fail(TC, Reason, State) ->
- empty_cth:on_tc_fail(TC,Reason,State).
-
-on_tc_skip(TC, Reason, State) ->
- empty_cth:on_tc_skip(TC,Reason,State).
-
-terminate(State) ->
- empty_cth:terminate(State).
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(undef_cth).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+
+%% CT Hooks
+-compile(export_all).
+
+init(Id, Opts) ->
+ empty_cth:init(Id, Opts).
+
+pre_init_per_suite(_Suite, _Config, _State) ->
+ lists:flaten([1,2,[3,4]]).
+
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_init_per_suite(Suite,Config,Return,State).
+
+pre_end_per_suite(Suite,Config,State) ->
+ empty_cth:pre_end_per_suite(Suite,Config,State).
+
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
+
+pre_init_per_group(Group,Config,State) ->
+ empty_cth:pre_init_per_group(Group,Config,State).
+
+post_init_per_group(Group,Config,Return,State) ->
+ empty_cth:post_init_per_group(Group,Config,Return,State).
+
+pre_end_per_group(Group,Config,State) ->
+ empty_cth:pre_end_per_group(Group,Config,State).
+
+post_end_per_group(Group,Config,Return,State) ->
+ empty_cth:post_end_per_group(Group,Config,Return,State).
+
+pre_init_per_testcase(TC,Config,State) ->
+ empty_cth:pre_init_per_testcase(TC,Config,State).
+
+post_init_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_init_per_testcase(TC,Config,Return,State).
+
+pre_end_per_testcase(TC,Config,State) ->
+ empty_cth:pre_end_per_testcase(TC,Config,State).
+
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
+
+on_tc_fail(TC, Reason, State) ->
+ empty_cth:on_tc_fail(TC,Reason,State).
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl
index 0202201eed..5503bf85ae 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,71 +14,79 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-
--module(update_config_cth).
-
-
--include_lib("common_test/src/ct_util.hrl").
--include_lib("common_test/include/ct_event.hrl").
-
--define(now, os:timestamp()).
-
-%% CT Hooks
--compile(export_all).
-
-init(Id, Opts) ->
- empty_cth:init(Id, Opts).
-
-pre_init_per_suite(Suite, Config, State) ->
- empty_cth:pre_init_per_suite(Suite,Config,State),
- {[{pre_init_per_suite,?now}|Config],State}.
-
-post_init_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_init_per_suite(Suite,Config,Return,State),
- {[{post_init_per_suite,?now}|Return],State}.
-
-pre_end_per_suite(Suite,Config,State) ->
- empty_cth:pre_end_per_suite(Suite,Config,State),
- {[{pre_end_per_suite,?now}|Config],State}.
-
-post_end_per_suite(Suite,Config,Return,State) ->
- empty_cth:post_end_per_suite(Suite,Config,Return,State),
- NewConfig = [{post_end_per_suite,?now}|Config],
- {NewConfig,NewConfig}.
-
-pre_init_per_group(Group,Config,State) ->
- empty_cth:pre_init_per_group(Group,Config,State),
- {[{pre_init_per_group,?now}|Config],State}.
-
-post_init_per_group(Group,Config,Return,State) ->
- empty_cth:post_init_per_group(Group,Config,Return,State),
- {[{post_init_per_group,?now}|Return],State}.
-
-pre_end_per_group(Group,Config,State) ->
- empty_cth:pre_end_per_group(Group,Config,State),
- {[{pre_end_per_group,?now}|Config],State}.
-
-post_end_per_group(Group,Config,Return,State) ->
- empty_cth:post_end_per_group(Group,Config,Return,State),
- {[{post_end_per_group,?now}|Config],State}.
-
-pre_init_per_testcase(TC,Config,State) ->
- empty_cth:pre_init_per_testcase(TC,Config,State),
- {[{pre_init_per_testcase,?now}|Config],State}.
-
-post_end_per_testcase(TC,Config,Return,State) ->
- empty_cth:post_end_per_testcase(TC,Config,Return,State),
- {[{post_end_per_testcase,?now}|Config],State}.
-
-on_tc_fail(TC, Reason, State) ->
- empty_cth:on_tc_fail(TC,Reason,State).
-
-on_tc_skip(TC, Reason, State) ->
- empty_cth:on_tc_skip(TC,Reason,State).
-
-terminate(State) ->
- empty_cth:terminate(State).
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(update_config_cth).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+-define(now, os:timestamp()).
+
+%% CT Hooks
+-compile(export_all).
+
+init(Id, Opts) ->
+ empty_cth:init(Id, Opts).
+
+pre_init_per_suite(Suite, Config, State) ->
+ empty_cth:pre_init_per_suite(Suite,Config,State),
+ {[{pre_init_per_suite,?now}|Config],State}.
+
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_init_per_suite(Suite,Config,Return,State),
+ {[{post_init_per_suite,?now}|Return],State}.
+
+pre_end_per_suite(Suite,Config,State) ->
+ empty_cth:pre_end_per_suite(Suite,Config,State),
+ {[{pre_end_per_suite,?now}|Config],State}.
+
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_end_per_suite(Suite,Config,Return,State),
+ NewConfig = [{post_end_per_suite,?now}|Config],
+ {NewConfig,NewConfig}.
+
+pre_init_per_group(Group,Config,State) ->
+ empty_cth:pre_init_per_group(Group,Config,State),
+ {[{pre_init_per_group,?now}|Config],State}.
+
+post_init_per_group(Group,Config,Return,State) ->
+ empty_cth:post_init_per_group(Group,Config,Return,State),
+ {[{post_init_per_group,?now}|Return],State}.
+
+pre_end_per_group(Group,Config,State) ->
+ empty_cth:pre_end_per_group(Group,Config,State),
+ {[{pre_end_per_group,?now}|Config],State}.
+
+post_end_per_group(Group,Config,Return,State) ->
+ empty_cth:post_end_per_group(Group,Config,Return,State),
+ {[{post_end_per_group,?now}|Config],State}.
+
+pre_init_per_testcase(TC,Config,State) ->
+ empty_cth:pre_init_per_testcase(TC,Config,State),
+ {[{pre_init_per_testcase,?now}|Config],State}.
+
+post_init_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_init_per_testcase(TC,Config,Return,State),
+ {[{post_init_per_testcase,?now}|Config],State}.
+
+pre_end_per_testcase(TC,Config,State) ->
+ empty_cth:pre_end_per_testcase(TC,Config,State),
+ {[{pre_end_per_testcase,?now}|Config],State}.
+
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_end_per_testcase(TC,Config,Return,State),
+ {[{post_end_per_testcase,?now}|Config],State}.
+
+on_tc_fail(TC, Reason, State) ->
+ empty_cth:on_tc_fail(TC,Reason,State).
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_config_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_config_cth.erl
index 754163abae..1df212f266 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_config_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_config_cth.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,118 +14,126 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
--module(verify_config_cth).
-
--include_lib("common_test/src/ct_util.hrl").
-
-%% CT Hooks
--compile(export_all).
-
--define(val(K, L), proplists:get_value(K, L)).
-
-id(Opts) ->
- ?MODULE.
-
-init(Id, Opts) ->
- {ok, State} = empty_cth:init(Id, Opts),
- {ok, State}.
-
-pre_init_per_suite(Suite, Config, State) ->
- ct_no_config_SUITE = ct:get_config(suite_cfg),
- empty_cth:pre_init_per_suite(Suite,
- [{pre_init_per_suite,true} | Config],
- State).
-
-post_init_per_suite(Suite,Config,Return,State) ->
- true = ?val(pre_init_per_suite, Return),
- ct_no_config_SUITE = ct:get_config(suite_cfg),
- empty_cth:post_init_per_suite(Suite,
- Config,
- [{post_init_per_suite,true} | Return],
- State).
-
-pre_end_per_suite(Suite,Config,State) ->
- true = ?val(post_init_per_suite, Config),
- ct_no_config_SUITE = ct:get_config(suite_cfg),
- empty_cth:pre_end_per_suite(Suite,
- [{pre_end_per_suite,true} | Config],
- State).
-
-post_end_per_suite(Suite,Config,Return,State) ->
- true = ?val(pre_end_per_suite, Config),
- ct_no_config_SUITE = ct:get_config(suite_cfg),
- empty_cth:post_end_per_suite(Suite,Config,Return,State).
-
-pre_init_per_group(Group,Config,State) ->
- true = ?val(post_init_per_suite, Config),
- ct_no_config_SUITE = ct:get_config(suite_cfg),
- test_group = ct:get_config(group_cfg),
- empty_cth:pre_init_per_group(Group,
- [{pre_init_per_group,true} | Config],
- State).
-
-post_init_per_group(Group,Config,Return,State) ->
- true = ?val(pre_init_per_group, Return),
- test_group = ct:get_config(group_cfg),
- empty_cth:post_init_per_group(Group,
- Config,
- [{post_init_per_group,true} | Return],
- State).
-
-pre_end_per_group(Group,Config,State) ->
- true = ?val(post_init_per_group, Config),
- ct_no_config_SUITE = ct:get_config(suite_cfg),
- test_group = ct:get_config(group_cfg),
- empty_cth:pre_end_per_group(Group,
- [{pre_end_per_group,true} | Config],
- State).
-
-post_end_per_group(Group,Config,Return,State) ->
- true = ?val(pre_end_per_group, Config),
- ct_no_config_SUITE = ct:get_config(suite_cfg),
- test_group = ct:get_config(group_cfg),
- empty_cth:post_end_per_group(Group,Config,Return,State).
-
-pre_init_per_testcase(TC,Config,State) ->
- true = ?val(post_init_per_suite, Config),
- case ?val(name, ?val(tc_group_properties, Config)) of
- undefined ->
- ok;
- _ ->
- true = ?val(post_init_per_group, Config),
- test_group = ct:get_config(group_cfg)
- end,
- ct_no_config_SUITE = ct:get_config(suite_cfg),
- CfgKey = list_to_atom(atom_to_list(TC) ++ "_cfg"),
- TC = ct:get_config(CfgKey),
- empty_cth:pre_init_per_testcase(TC,
- [{pre_init_per_testcase,true} | Config],
- State).
-
-post_end_per_testcase(TC,Config,Return,State) ->
- true = ?val(post_init_per_suite, Config),
- true = ?val(pre_init_per_testcase, Config),
- case ?val(name, ?val(tc_group_properties, Config)) of
- undefined ->
- ok;
- _ ->
- true = ?val(post_init_per_group, Config),
- test_group = ct:get_config(group_cfg)
- end,
- ct_no_config_SUITE = ct:get_config(suite_cfg),
- CfgKey = list_to_atom(atom_to_list(TC) ++ "_cfg"),
- TC = ct:get_config(CfgKey),
- empty_cth:post_end_per_testcase(TC,Config,Return,State).
-
-on_tc_fail(TC, Reason, State) ->
- empty_cth:on_tc_fail(TC,Reason,State).
-
-on_tc_skip(TC, Reason, State) ->
- empty_cth:on_tc_skip(TC,Reason,State).
-
-terminate(State) ->
- empty_cth:terminate(State).
+%%
+%% %CopyrightEnd%
+%%
+
+-module(verify_config_cth).
+
+-include_lib("common_test/src/ct_util.hrl").
+
+%% CT Hooks
+-compile(export_all).
+
+-define(val(K, L), proplists:get_value(K, L)).
+
+id(Opts) ->
+ ?MODULE.
+
+init(Id, Opts) ->
+ {ok, State} = empty_cth:init(Id, Opts),
+ {ok, State}.
+
+pre_init_per_suite(Suite, Config, State) ->
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ empty_cth:pre_init_per_suite(Suite,
+ [{pre_init_per_suite,true} | Config],
+ State).
+
+post_init_per_suite(Suite,Config,Return,State) ->
+ true = ?val(pre_init_per_suite, Return),
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ empty_cth:post_init_per_suite(Suite,
+ Config,
+ [{post_init_per_suite,true} | Return],
+ State).
+
+pre_end_per_suite(Suite,Config,State) ->
+ true = ?val(post_init_per_suite, Config),
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ empty_cth:pre_end_per_suite(Suite,
+ [{pre_end_per_suite,true} | Config],
+ State).
+
+post_end_per_suite(Suite,Config,Return,State) ->
+ true = ?val(pre_end_per_suite, Config),
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
+
+pre_init_per_group(Group,Config,State) ->
+ true = ?val(post_init_per_suite, Config),
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ test_group = ct:get_config(group_cfg),
+ empty_cth:pre_init_per_group(Group,
+ [{pre_init_per_group,true} | Config],
+ State).
+
+post_init_per_group(Group,Config,Return,State) ->
+ true = ?val(pre_init_per_group, Return),
+ test_group = ct:get_config(group_cfg),
+ empty_cth:post_init_per_group(Group,
+ Config,
+ [{post_init_per_group,true} | Return],
+ State).
+
+pre_end_per_group(Group,Config,State) ->
+ true = ?val(post_init_per_group, Config),
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ test_group = ct:get_config(group_cfg),
+ empty_cth:pre_end_per_group(Group,
+ [{pre_end_per_group,true} | Config],
+ State).
+
+post_end_per_group(Group,Config,Return,State) ->
+ true = ?val(pre_end_per_group, Config),
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ test_group = ct:get_config(group_cfg),
+ empty_cth:post_end_per_group(Group,Config,Return,State).
+
+pre_init_per_testcase(TC,Config,State) ->
+ true = ?val(post_init_per_suite, Config),
+ case ?val(name, ?val(tc_group_properties, Config)) of
+ undefined ->
+ ok;
+ _ ->
+ true = ?val(post_init_per_group, Config),
+ test_group = ct:get_config(group_cfg)
+ end,
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ CfgKey = list_to_atom(atom_to_list(TC) ++ "_cfg"),
+ TC = ct:get_config(CfgKey),
+ empty_cth:pre_init_per_testcase(TC,
+ [{pre_init_per_testcase,true} | Config],
+ State).
+
+%%! TODO: Verify Config also in post_init and pre_end!
+
+post_init_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_init_per_testcase(TC,Config,Return,State).
+
+pre_end_per_testcase(TC,Config,State) ->
+ empty_cth:pre_end_per_testcase(TC,Config,State).
+
+post_end_per_testcase(TC,Config,Return,State) ->
+ true = ?val(post_init_per_suite, Config),
+ true = ?val(pre_init_per_testcase, Config),
+ case ?val(name, ?val(tc_group_properties, Config)) of
+ undefined ->
+ ok;
+ _ ->
+ true = ?val(post_init_per_group, Config),
+ test_group = ct:get_config(group_cfg)
+ end,
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ CfgKey = list_to_atom(atom_to_list(TC) ++ "_cfg"),
+ TC = ct:get_config(CfgKey),
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
+
+on_tc_fail(TC, Reason, State) ->
+ empty_cth:on_tc_fail(TC,Reason,State).
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_data_dir_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_data_dir_cth.erl
index 2c8f7a50aa..7abcea4393 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_data_dir_cth.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_data_dir_cth.erl
@@ -1,8 +1,8 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
-%%
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
@@ -14,83 +14,91 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
-
--module(verify_data_dir_cth).
-
--include_lib("common_test/src/ct_util.hrl").
-
-%% CT Hooks
--compile(export_all).
-
--define(val(K, L), proplists:get_value(K, L)).
-
-check_dirs(State,Config) ->
- DataDirName = ?val(data_dir_name, State),
- %% check priv_dir
- PrivDir = proplists:get_value(priv_dir, Config),
- "log_private" = filename:basename(PrivDir),
- {ok,_} = file:list_dir(PrivDir),
-
- %% check data_dir
- DataDir = proplists:get_value(data_dir, Config),
- DataDirName = filename:basename(DataDir),
- ok.
-
-id(_Opts) ->
- ?MODULE.
-
-init(Id, _Opts) ->
- {ok, _State} = empty_cth:init(Id, []),
- {ok, [{data_dir_name,"ct_data_dir_SUITE_data"}]}.
-
-pre_init_per_suite(Suite,Config,State) ->
- check_dirs(State,Config),
- empty_cth:pre_init_per_suite(Suite,Config,State).
-
-post_init_per_suite(Suite,Config,Return,State) ->
- check_dirs(State,Return),
- empty_cth:post_init_per_suite(Suite,Config,Return,State).
-
-pre_end_per_suite(Suite,Config,State) ->
- check_dirs(State,Config),
- empty_cth:pre_end_per_suite(Suite,Config,State).
-
-post_end_per_suite(Suite,Config,Return,State) ->
- check_dirs(State,Config),
- empty_cth:post_end_per_suite(Suite,Config,Return,State).
-
-pre_init_per_group(Group,Config,State) ->
- check_dirs(State,Config),
- empty_cth:pre_init_per_group(Group,Config,State).
-
-post_init_per_group(Group,Config,Return,State) ->
- check_dirs(State,Return),
- empty_cth:post_init_per_group(Group,Config,Return,State).
-
-pre_end_per_group(Group,Config,State) ->
- check_dirs(State,Config),
- empty_cth:pre_end_per_group(Group,Config,State).
-
-post_end_per_group(Group,Config,Return,State) ->
- check_dirs(State,Config),
- empty_cth:post_end_per_group(Group,Config,Return,State).
-
-pre_init_per_testcase(TC,Config,State) ->
- check_dirs(State,Config),
- empty_cth:pre_init_per_testcase(TC,Config,State).
-
-post_end_per_testcase(TC,Config,Return,State) ->
- check_dirs(State,Config),
- empty_cth:post_end_per_testcase(TC,Config,Return,State).
-
-on_tc_fail(TC, Reason, State) ->
- empty_cth:on_tc_fail(TC,Reason,State).
-
-on_tc_skip(TC, Reason, State) ->
- empty_cth:on_tc_skip(TC,Reason,State).
-
-terminate(State) ->
- empty_cth:terminate(State).
+%%
+%% %CopyrightEnd%
+%%
+
+-module(verify_data_dir_cth).
+
+-include_lib("common_test/src/ct_util.hrl").
+
+%% CT Hooks
+-compile(export_all).
+
+-define(val(K, L), proplists:get_value(K, L)).
+
+check_dirs(State,Config) ->
+ DataDirName = ?val(data_dir_name, State),
+ %% check priv_dir
+ PrivDir = proplists:get_value(priv_dir, Config),
+ "log_private" = filename:basename(PrivDir),
+ {ok,_} = file:list_dir(PrivDir),
+
+ %% check data_dir
+ DataDir = proplists:get_value(data_dir, Config),
+ DataDirName = filename:basename(DataDir),
+ ok.
+
+id(_Opts) ->
+ ?MODULE.
+
+init(Id, _Opts) ->
+ {ok, _State} = empty_cth:init(Id, []),
+ {ok, [{data_dir_name,"ct_data_dir_SUITE_data"}]}.
+
+pre_init_per_suite(Suite,Config,State) ->
+ check_dirs(State,Config),
+ empty_cth:pre_init_per_suite(Suite,Config,State).
+
+post_init_per_suite(Suite,Config,Return,State) ->
+ check_dirs(State,Return),
+ empty_cth:post_init_per_suite(Suite,Config,Return,State).
+
+pre_end_per_suite(Suite,Config,State) ->
+ check_dirs(State,Config),
+ empty_cth:pre_end_per_suite(Suite,Config,State).
+
+post_end_per_suite(Suite,Config,Return,State) ->
+ check_dirs(State,Config),
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
+
+pre_init_per_group(Group,Config,State) ->
+ check_dirs(State,Config),
+ empty_cth:pre_init_per_group(Group,Config,State).
+
+post_init_per_group(Group,Config,Return,State) ->
+ check_dirs(State,Return),
+ empty_cth:post_init_per_group(Group,Config,Return,State).
+
+pre_end_per_group(Group,Config,State) ->
+ check_dirs(State,Config),
+ empty_cth:pre_end_per_group(Group,Config,State).
+
+post_end_per_group(Group,Config,Return,State) ->
+ check_dirs(State,Config),
+ empty_cth:post_end_per_group(Group,Config,Return,State).
+
+pre_init_per_testcase(TC,Config,State) ->
+ check_dirs(State,Config),
+ empty_cth:pre_init_per_testcase(TC,Config,State).
+
+post_init_per_testcase(TC,Config,Return,State) ->
+ check_dirs(State,Config),
+ empty_cth:post_init_per_testcase(TC,Config,Return,State).
+
+pre_end_per_testcase(TC,Config,State) ->
+ check_dirs(State,Config),
+ empty_cth:pre_end_per_testcase(TC,Config,State).
+
+post_end_per_testcase(TC,Config,Return,State) ->
+ check_dirs(State,Config),
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
+
+on_tc_fail(TC, Reason, State) ->
+ empty_cth:on_tc_fail(TC,Reason,State).
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl
index 49b02d2bba..9d4c798795 100644
--- a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl
+++ b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl
@@ -332,7 +332,8 @@ invalid_opt(Config) ->
Opts1 = ?DEFAULT_SSH_OPTS(DataDir) ++ [{timeout,invalidvalue}],
{error,{invalid_option,{timeout,invalidvalue}}} = ct_netconfc:open(Opts1),
Opts2 = ?DEFAULT_SSH_OPTS(DataDir) ++ [{some_other_opt,true}],
- {error,{invalid_option,{some_other_opt,true}}} = ct_netconfc:open(Opts2),
+ {error,{ssh,could_not_connect_to_server,{options,_}}} =
+ ct_netconfc:open(Opts2),
ok.
timeout_close_session(Config) ->
diff --git a/lib/common_test/test/ct_release_test_SUITE.erl b/lib/common_test/test/ct_release_test_SUITE.erl
new file mode 100644
index 0000000000..66d07155ac
--- /dev/null
+++ b/lib/common_test/test/ct_release_test_SUITE.erl
@@ -0,0 +1,190 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009-2014. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%%-------------------------------------------------------------------
+%%% File: ct_release_test_SUITE
+%%%
+%%% Description:
+%%% Test ct_release_test module
+%%%
+%%%-------------------------------------------------------------------
+-module(ct_release_test_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+-define(eh, ct_test_support_eh).
+-define(suite, release_test_SUITE).
+
+%%--------------------------------------------------------------------
+%% TEST SERVER CALLBACK FUNCTIONS
+%%--------------------------------------------------------------------
+
+%%--------------------------------------------------------------------
+%% Description: Since Common Test starts another Test Server
+%% instance, the tests need to be performed on a separate node (or
+%% there will be clashes with logging processes etc).
+%%--------------------------------------------------------------------
+init_per_suite(Config) ->
+ case os:type() of
+ {win32,_} ->
+ {skipped, "Upgrade tests do currently not work on windows"};
+ _ ->
+ ct_test_support:init_per_suite(Config)
+ end.
+
+end_per_suite(Config) ->
+ ct_test_support:end_per_suite(Config).
+
+init_per_testcase(TestCase, Config) ->
+ ct_test_support:init_per_testcase(TestCase, Config).
+
+end_per_testcase(TestCase, Config) ->
+ ct_test_support:end_per_testcase(TestCase, Config).
+
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [
+ minor,
+ major,
+ major_fail_init,
+ major_fail_upgraded,
+ major_fail_downgraded,
+ major_fail_no_init
+ ].
+
+%%--------------------------------------------------------------------
+%% TEST CASES
+%%--------------------------------------------------------------------
+
+%%%-----------------------------------------------------------------
+%%%
+minor(Config) when is_list(Config) ->
+ {Suite,Cfg} = setup1(Config),
+ {Opts,ERPid} = setup([{suite,Suite},
+ {testcase,minor},
+ {label,minor}|Cfg], Config),
+ execute(minor, Opts, ERPid, Config).
+
+major(Config) when is_list(Config) ->
+ {Suite,Cfg} = setup1(Config),
+ {Opts,ERPid} = setup([{suite,Suite},
+ {testcase,major},
+ {label,major}|Cfg], Config),
+ execute(major, Opts, ERPid, Config).
+
+major_fail_init(Config) when is_list(Config) ->
+ {Suite,Cfg} = setup1(Config),
+ {Opts,ERPid} = setup([{suite,Suite},
+ {testcase,major_fail_init},
+ {label,major_fail_init}|Cfg], Config),
+ execute(major_fail_init, Opts, ERPid, Config).
+
+major_fail_upgraded(Config) when is_list(Config) ->
+ {Suite,Cfg} = setup1(Config),
+ {Opts,ERPid} = setup([{suite,Suite},
+ {testcase,major_fail_upgraded},
+ {label,major_fail_upgraded}|Cfg], Config),
+ execute(major_fail_upgraded, Opts, ERPid, Config).
+
+major_fail_downgraded(Config) when is_list(Config) ->
+ {Suite,Cfg} = setup1(Config),
+ {Opts,ERPid} = setup([{suite,Suite},
+ {testcase,major_fail_downgraded},
+ {label,major_fail_downgraded}|Cfg], Config),
+ execute(major_fail_downgraded, Opts, ERPid, Config).
+
+major_fail_no_init(Config) when is_list(Config) ->
+ {Suite,Cfg} = setup1(Config),
+ {Opts,ERPid} = setup([{suite,Suite},
+ {testcase,major_fail_no_init},
+ {label,major_fail_no_init}|Cfg], Config),
+ execute(major_fail_no_init, Opts, ERPid, Config).
+
+
+%%%-----------------------------------------------------------------
+%%% HELP FUNCTIONS
+%%%-----------------------------------------------------------------
+setup1(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Suite = filename:join(DataDir, atom_to_list(?suite)),
+ Cfg = case ct:get_config(otp_releases) of
+ undefined ->
+ [];
+ Rels ->
+ CfgFile = filename:join(DataDir, "release_test.cfg"),
+ file:write_file(CfgFile,
+ io_lib:format("{otp_releases,~p}.",[Rels])),
+ [{config,CfgFile}]
+ end,
+ {Suite,Cfg}.
+
+setup(Test, Config) ->
+ Opts0 = ct_test_support:get_opts(Config),
+ Level = ?config(trace_level, Config),
+ EvHArgs = [{cbm,ct_test_support},{trace_level,Level}],
+ Opts = Opts0 ++ [{event_handler,{?eh,EvHArgs}}|Test],
+ ERPid = ct_test_support:start_event_receiver(Config),
+ {Opts,ERPid}.
+
+execute(Name, Opts, ERPid, Config) ->
+ ok = ct_test_support:run(Opts, Config),
+ Events = ct_test_support:get_events(ERPid, Config),
+
+ ct_test_support:log_events(Name,
+ reformat(Events, ?eh),
+ ?config(priv_dir, Config),
+ Opts),
+
+ verify_events(Name,Events,Config).
+
+reformat(Events, EH) ->
+ ct_test_support:reformat(Events, EH).
+
+%%%-----------------------------------------------------------------
+%%% TEST EVENTS
+%%%-----------------------------------------------------------------
+verify_events(TC,Events,Config) ->
+ Ok = expected_events(TC,ok),
+ case ct_test_support:verify_events(Ok, Events, Config) of
+ ok ->
+ ok;
+ {event_not_found,{?eh,tc_done,{_Suite,TC,ok}}}=R1 ->
+ ct:log("Did not find 'ok', checking if skipped...",[]),
+ Skipped = expected_events(TC,{skipped,"Old release not available"}),
+ case ct_test_support:verify_events(Skipped, Events, Config) of
+ ok ->
+ {skipped,"Old release not available"};
+ R2 ->
+ ct:log("Did not find skipped case either: ~n~p",[R2]),
+ exit(R1)
+ end
+ end.
+
+expected_events(TC,Result) ->
+ OneTest =
+ [{?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,tc_done,{?suite,TC,Result}},
+ {?eh,stop_logging,[]}],
+ %% 2 tests (ct:run_test + script_start) is default
+ OneTest ++ OneTest.
diff --git a/lib/common_test/test/ct_release_test_SUITE_data/release_test_SUITE.erl b/lib/common_test/test/ct_release_test_SUITE_data/release_test_SUITE.erl
new file mode 100644
index 0000000000..04c92be0d1
--- /dev/null
+++ b/lib/common_test/test/ct_release_test_SUITE_data/release_test_SUITE.erl
@@ -0,0 +1,118 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+%%%----------------------------------------------------------------
+%%% Purpose: Test the support for application upgrade/code_change test
+%%%-----------------------------------------------------------------
+-module(release_test_SUITE).
+-include_lib("common_test/include/ct.hrl").
+
+-compile(export_all).
+
+-define(APP,runtime_tools). % "randomly" selected 'application under test'
+
+%%
+%% all/1
+%%
+all() ->
+ [minor,
+ major,
+ major_fail_init,
+ major_fail_upgraded,
+ major_fail_downgraded,
+ major_fail_no_init].
+
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(_Config) ->
+ ok.
+
+init_per_testcase(major_fail_no_init, Config) ->
+ Config;
+init_per_testcase(_Case, Config) ->
+ ct_release_test:init(Config).
+end_per_testcase(_Case, Config) ->
+ ct_release_test:cleanup(Config).
+
+%%%-----------------------------------------------------------------
+%%% Test cases
+minor(Config) ->
+ ct_release_test:upgrade(?APP,minor,{?MODULE,[]},Config).
+
+major(Config) ->
+ ct_release_test:upgrade(?APP,major,{?MODULE,[]},Config).
+
+major_fail_init(Config) ->
+ try ct_release_test:upgrade(?APP,major,{?MODULE,fail_init},Config)
+ catch exit:{test_case_failed,
+ {test_upgrade_callback,_Mod,_Func,_Args,
+ {'EXIT',{test_case_failed,upgrade_init_failed}}}} ->
+ ok
+ end.
+
+major_fail_upgraded(Config) ->
+ try ct_release_test:upgrade(?APP,major,{?MODULE,fail_upgraded},Config)
+ catch exit:{test_case_failed,
+ {test_upgrade_callback,_Mod,_Func,_Args,
+ {'EXIT',{test_case_failed,upgrade_upgraded_failed}}}} ->
+ ok
+ end.
+
+major_fail_downgraded(Config) ->
+ try ct_release_test:upgrade(?APP,major,{?MODULE,fail_downgraded},Config)
+ catch exit:{test_case_failed,
+ {test_upgrade_callback,_Mod,_Func,_Args,
+ {'EXIT',{test_case_failed,upgrade_downgraded_failed}}}} ->
+ ok
+ end.
+
+major_fail_no_init(Config) ->
+ try ct_release_test:upgrade(?APP,major,[],Config)
+ catch exit:{test_case_failed,"ct_release_test:init/1 not run"} ->
+ ok
+ end.
+
+%%%-----------------------------------------------------------------
+%%% ct_release_test callbacks
+
+%% Version numbers are checked by ct_release_test, so there is nothing
+%% more to check here...
+upgrade_init(CtData,fail_init) ->
+ ct:fail(upgrade_init_failed);
+upgrade_init(CtData,State) ->
+ {ok,{FromVsn,ToVsn}} = ct_release_test:get_app_vsns(CtData,?APP),
+ case ct_release_test:get_appup(CtData,?APP) of
+ {ok,{FromVsn,ToVsn,UpInstrs,DownInstrs}} ->
+ io:format("Upgrade/downgrade ~p: ~p <--> ~p~n"
+ "Upgrade instructions: ~p~n"
+ "Downgrade instructions: ~p",
+ [?APP,FromVsn,ToVsn,UpInstrs,DownInstrs]);
+ {error,{vsn_not_found,_}} when FromVsn==ToVsn ->
+ io:format("No upgrade test for ~p, same version",[?APP])
+ end,
+ State.
+upgrade_upgraded(CtData,fail_upgraded) ->
+ ct:fail(upgrade_upgraded_failed);
+upgrade_upgraded(_CtData,State) ->
+ State.
+upgrade_downgraded(CtData,fail_downgraded) ->
+ ct:fail(upgrade_downgraded_failed);
+upgrade_downgraded(_CtData,State) ->
+ State.
diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl
index 4a47d345e9..0ee83f45b8 100644
--- a/lib/common_test/test/ct_test_support.erl
+++ b/lib/common_test/test/ct_test_support.erl
@@ -1228,8 +1228,8 @@ log_events(TC, Events, EvLogDir, Opts) ->
file:close(Dev),
FullLogFile = join_abs_dirs(proplists:get_value(net_dir, Opts),
LogFile),
- io:format("Events written to logfile: <a href=\"file://~s\">~s</a>~n",
- [FullLogFile,FullLogFile]),
+ ct:log("Events written to logfile: <a href=\"file://~s\">~s</a>~n",
+ [FullLogFile,FullLogFile],[no_css]),
io:format(user, "Events written to logfile: ~p~n", [LogFile]).
log_events1(Evs, Dev, "") ->
diff --git a/lib/common_test/test/erl2html2_SUITE.erl b/lib/common_test/test/erl2html2_SUITE.erl
index 9e6389109b..8e9f6e773a 100644
--- a/lib/common_test/test/erl2html2_SUITE.erl
+++ b/lib/common_test/test/erl2html2_SUITE.erl
@@ -31,7 +31,7 @@
"<html>\n",
"<head><title>Module ", Src, "</title>\n",
"<meta http-equiv=\"cache-control\" ",
- "content=\"no-cache\">\n",
+ "content=\"no-cache\"></meta>\n",
"</head>\n",
"<body bgcolor=\"white\" text=\"black\" ",
"link=\"blue\" vlink=\"purple\" alink=\"red\">\n"]).
diff --git a/lib/common_test/test_server/ts_install_cth.erl b/lib/common_test/test_server/ts_install_cth.erl
index ec0d54ccde..0462e62611 100644
--- a/lib/common_test/test_server/ts_install_cth.erl
+++ b/lib/common_test/test_server/ts_install_cth.erl
@@ -41,6 +41,8 @@
-export([post_end_per_group/4]).
-export([pre_init_per_testcase/3]).
+-export([post_init_per_testcase/4]).
+-export([pre_end_per_testcase/3]).
-export([post_end_per_testcase/4]).
-export([on_tc_fail/3]).
@@ -181,7 +183,22 @@ post_end_per_group(_Group,_Config,Return,State) ->
pre_init_per_testcase(_TC,Config,State) ->
{add_node_name(Config, State), State}.
+-spec post_init_per_testcase(TC :: atom(),
+ Config :: config(),
+ Return :: term(),
+ State :: #state{}) ->
+ {ok | skip_or_fail(), NewState :: #state{}}.
+post_init_per_testcase(_TC,_Config,Return,State) ->
+ {Return, State}.
+
%% @doc Called after each test case.
+-spec pre_end_per_testcase(TC :: atom(),
+ Config :: config(),
+ State :: #state{}) ->
+ {config() | skip_or_fail(), NewState :: #state{}}.
+pre_end_per_testcase(_TC,Config,State) ->
+ {Config, State}.
+
-spec post_end_per_testcase(TC :: atom(),
Config :: config(),
Return :: term(),
diff --git a/lib/compiler/src/beam_block.erl b/lib/compiler/src/beam_block.erl
index 10dbaf462c..d1052303e0 100644
--- a/lib/compiler/src/beam_block.erl
+++ b/lib/compiler/src/beam_block.erl
@@ -58,6 +58,13 @@ blockify(Is) ->
blockify([{loop_rec,{f,Fail},{x,0}},{loop_rec_end,_Lbl},{label,Fail}|Is], Acc) ->
%% Useless instruction sequence.
blockify(Is, Acc);
+blockify([{get_map_elements,F,S,{list,Gets}}|Is0], Acc) ->
+ %% A get_map_elements instruction is only safe at the beginning of
+ %% a block because of the failure label.
+ {Ss,Ds} = beam_utils:split_even(Gets),
+ I = {set,Ds,[S|Ss],{get_map_elements,F}},
+ {Block,Is} = collect_block(Is0, [I]),
+ blockify(Is, [{block,Block}|Acc]);
blockify([I|Is0]=IsAll, Acc) ->
case collect(I) of
error -> blockify(Is0, [I|Acc]);
@@ -101,9 +108,6 @@ collect({get_list,S,D1,D2}) -> {set,[D1,D2],[S],get_list};
collect(remove_message) -> {set,[],[],remove_message};
collect({put_map,F,Op,S,D,R,{list,Puts}}) ->
{set,[D],[S|Puts],{alloc,R,{put_map,Op,F}}};
-collect({get_map_elements,F,S,{list,Gets}}) ->
- {Ss,Ds} = beam_utils:split_even(Gets),
- {set,Ds,[S|Ss],{get_map_elements,F}};
collect({'catch'=Op,R,L}) ->
{set,[R],[],{try_catch,Op,L}};
collect({'try'=Op,R,L}) ->
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl
index 68c9f964d8..830dd9973a 100644
--- a/lib/compiler/src/v3_core.erl
+++ b/lib/compiler/src/v3_core.erl
@@ -1080,13 +1080,39 @@ bc_tq1(Line, E, [#igen{anno=GAnno,ceps=Ceps,
bc_tq1(Line, E, [#ifilter{}=Filter|Qs], Mc, St) ->
filter_tq(Line, E, Filter, Mc, St, Qs, fun bc_tq1/5);
bc_tq1(_, {bin,Bl,Elements}, [], AccVar, St0) ->
- {E,Pre,St} = expr({bin,Bl,[{bin_element,Bl,
- {var,Bl,AccVar#c_var.name},
- {atom,Bl,all},
- [binary,{unit,1}]}|Elements]}, St0),
+ bc_tq_build(Bl, [], AccVar, Elements, St0);
+bc_tq1(Line, E0, [], AccVar, St0) ->
+ BsFlags = [binary,{unit,1}],
+ BsSize = {atom,Line,all},
+ {E1,Pre0,St1} = safe(E0, St0),
+ case E1 of
+ #c_var{name=VarName} ->
+ Var = {var,Line,VarName},
+ Els = [{bin_element,Line,Var,BsSize,BsFlags}],
+ bc_tq_build(Line, Pre0, AccVar, Els, St1);
+ #c_literal{val=Val} when is_bitstring(Val) ->
+ Bits = bit_size(Val),
+ <<Int0:Bits>> = Val,
+ Int = {integer,Line,Int0},
+ Sz = {integer,Line,Bits},
+ Els = [{bin_element,Line,Int,Sz,[integer,{unit,1},big]}],
+ bc_tq_build(Line, Pre0, AccVar, Els, St1);
+ _ ->
+ %% Any other safe (cons, tuple, literal) is not a
+ %% bitstring. Force the evaluation to fail (and
+ %% generate a warning).
+ Els = [{bin_element,Line,{atom,Line,bad_value},BsSize,BsFlags}],
+ bc_tq_build(Line, Pre0, AccVar, Els, St1)
+ end.
+
+bc_tq_build(Line, Pre0, #c_var{name=AccVar}, Elements0, St0) ->
+ Elements = [{bin_element,Line,{var,Line,AccVar},{atom,Line,all},
+ [binary,{unit,1}]}|Elements0],
+ {E,Pre,St} = expr({bin,Line,Elements}, St0),
#a{anno=A} = Anno0 = get_anno(E),
Anno = Anno0#a{anno=[compiler_generated,single_use|A]},
- {set_anno(E, Anno),Pre,St}.
+ {set_anno(E, Anno),Pre0++Pre,St}.
+
%% filter_tq(Line, Expr, Filter, Mc, State, [Qualifier], TqFun) ->
%% {Case,[PreExpr],State}.
@@ -1307,7 +1333,9 @@ bc_elem_size({bin,_,El}, St0) ->
Vs = [V || {_,#c_var{name=V}} <- Vars0],
{E,Pre,St} = bc_mul_pairs(F, #c_literal{val=Bits}, [], St0),
{E,Pre,Vs,St}
- end.
+ end;
+bc_elem_size(_, _) ->
+ throw(impossible).
bc_elem_size_1([{bin_element,_,_,{integer,_,N},Flags}|Es], Bits, Vars) ->
{unit,U} = keyfind(unit, 1, Flags),
diff --git a/lib/compiler/test/Makefile b/lib/compiler/test/Makefile
index c2d757da4d..85118502e3 100644
--- a/lib/compiler/test/Makefile
+++ b/lib/compiler/test/Makefile
@@ -8,6 +8,7 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk
MODULES= \
andor_SUITE \
apply_SUITE \
+ beam_block_SUITE \
beam_validator_SUITE \
beam_disasm_SUITE \
beam_except_SUITE \
@@ -44,6 +45,7 @@ MODULES= \
NO_OPT= \
andor \
apply \
+ beam_block \
beam_except \
beam_reorder \
beam_type \
@@ -67,6 +69,7 @@ NO_OPT= \
INLINE= \
andor \
apply \
+ beam_block \
beam_utils \
bs_bincomp \
bs_bit_binaries \
diff --git a/lib/compiler/test/beam_block_SUITE.erl b/lib/compiler/test/beam_block_SUITE.erl
new file mode 100644
index 0000000000..7b6f2066be
--- /dev/null
+++ b/lib/compiler/test/beam_block_SUITE.erl
@@ -0,0 +1,66 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2015. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(beam_block_SUITE).
+
+-export([all/0,suite/0,groups/0,init_per_suite/1,end_per_suite/1,
+ init_per_group/2,end_per_group/2,
+ get_map_elements/1]).
+
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ test_lib:recompile(?MODULE),
+ [{group,p}].
+
+groups() ->
+ [{p,[parallel],
+ [get_map_elements
+ ]}].
+
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(_Config) ->
+ ok.
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+get_map_elements(_Config) ->
+ [{pred,var}] = get_map_elements([{pred,var}], #{}, []),
+ [{pred,var}] = get_map_elements([{pred,var}], #{pred=>[]}, []),
+ acc = get_map_elements([], #{pred=>[]}, acc),
+ ok.
+
+get_map_elements([{Pred,Var}|Left], Map, Acc) ->
+ case Map of
+ #{Var := List} ->
+ case lists:keyfind(Pred, 1, List) of
+ false ->
+ get_map_elements(Left, Map, [{Pred,Var}|Acc])
+ end;
+ #{} ->
+ get_map_elements(Left, Map, [{Pred,Var}|Acc])
+ end;
+get_map_elements([], _Map, Acc) ->
+ Acc.
diff --git a/lib/compiler/test/bs_bincomp_SUITE.erl b/lib/compiler/test/bs_bincomp_SUITE.erl
index 93bce5c1f6..5e5f6e2169 100644
--- a/lib/compiler/test/bs_bincomp_SUITE.erl
+++ b/lib/compiler/test/bs_bincomp_SUITE.erl
@@ -26,7 +26,7 @@
init_per_group/2,end_per_group/2,
byte_aligned/1,bit_aligned/1,extended_byte_aligned/1,
extended_bit_aligned/1,mixed/1,filters/1,trim_coverage/1,
- nomatch/1,sizes/1]).
+ nomatch/1,sizes/1,general_expressions/1]).
-include_lib("common_test/include/ct.hrl").
@@ -36,7 +36,7 @@ all() ->
test_lib:recompile(?MODULE),
[byte_aligned, bit_aligned, extended_byte_aligned,
extended_bit_aligned, mixed, filters, trim_coverage,
- nomatch, sizes].
+ nomatch, sizes, general_expressions].
groups() ->
[].
@@ -295,6 +295,48 @@ sizes(Config) when is_list(Config) ->
cs_end(),
ok.
+-define(BAD(E), {'EXIT',{badarg,_}} = (catch << (E) || _ <- [1,2,3] >>)).
+-define(BAD_V(E), {'EXIT',{badarg,_}} = (catch << (E) || I <- [1,2,3] >>)).
+
+general_expressions(_) ->
+ <<1,2,3>> = << begin <<1,2,3>> end || _ <- [1] >>,
+ <<"abc">> = << begin <<"abc">> end || _ <- [1] >>,
+ <<1,2,3>> = << begin
+ I = <<(I0+1)>>,
+ id(I)
+ end || <<I0>> <= <<0,1,2>> >>,
+ <<1,2,3>> = << I || I <- [<<1,2>>,<<3>>] >>,
+ <<1,2,3>> = << (id(<<I>>)) || I <- [1,2,3] >>,
+ <<2,4>> = << case I rem 2 of
+ 0 -> <<I>>;
+ 1 -> <<>>
+ end || I <- [1,2,3,4,5] >>,
+ <<2,3,4,5,6,7>> = << << (id(<<J>>)) || J <- [2*I,2*I+1] >> ||
+ I <- [1,2,3] >>,
+ <<1,2,2,3,4,4>> = << if
+ I rem 2 =:= 0 -> <<I,I>>;
+ true -> <<I>>
+ end || I <- [1,2,3,4] >>,
+ self() ! <<42>>,
+ <<42>> = << receive B -> B end || _ <- [1] >>,
+ <<10,5,3>> = << try
+ <<(10 div I)>>
+ catch _:_ ->
+ <<>>
+ end || I <- [0,1,2,3] >>,
+
+ %% Failing expressions.
+ ?BAD(bad_atom),
+ ?BAD(42),
+ ?BAD(42.0),
+ ?BAD_V({ok,I}),
+ ?BAD_V([I]),
+ ?BAD_V(fun() -> I end),
+
+ ok.
+
+-undef(BAD).
+
cs_init() ->
erts_debug:set_internal_state(available_internal_state, true),
ok.
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl
index 58b1cd742b..efa4cc9108 100644
--- a/lib/diameter/src/base/diameter_service.erl
+++ b/lib/diameter/src/base/diameter_service.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -83,16 +83,8 @@
-define(DEFAULT_TC, 30000). %% RFC 3588 ch 2.1
-define(RESTART_TC, 1000). %% if restart was this recent
-%% Used to be able to swap this with anything else dict-like but now
-%% rely on the fact that a service's #state{} record does not change
-%% in storing in it ?STATE table and not always going through the
-%% service process. In particular, rely on the fact that operations on
-%% a ?Dict don't change the handle to it.
--define(Dict, diameter_dict).
-
-%% Maintains state in a table. In contrast to previously, a service's
-%% stat is not constant and is accessed outside of the service
-%% process.
+%% Maintain state in a table since a service's state is accessed
+%% outside of the service process.
-define(STATE_TABLE, ?MODULE).
%% The default sequence mask.
@@ -117,12 +109,11 @@
service :: #diameter_service{},
watchdogT = ets_new(watchdogs) %% #watchdog{} at start
:: ets:tid(),
- peerT = ets_new(peers) %% #peer{pid = TPid} at okay/reopen
- :: ets:tid(),
- shared_peers = ?Dict:new() %% Alias -> [{TPid, Caps}, ...]
- :: ets:tid(),
- local_peers = ?Dict:new() %% Alias -> [{TPid, Caps}, ...]
- :: ets:tid(),
+ peerT, %% undefined in new code, but remain for upgrade
+ shared_peers, %% reasons. Replaced by local/remote.
+ local_peers, %%
+ local :: {ets:tid(), ets:tid(), ets:tid()},
+ remote :: {ets:tid(), ets:tid(), ets:tid()},
monitor = false :: false | pid(), %% process to die with
options
:: [{sequence, diameter:sequence()} %% sequence mask
@@ -146,14 +137,16 @@
peer = false :: match(boolean() | pid())}).
%% true at accepted, pid() at okay/reopen
-%% Record representing an Peer State Machine processes implemented by
+%% Record representing a Peer State Machine processes implemented by
%% diameter_peer_fsm.
-record(peer,
- {pid :: pid(),
- apps :: [{0..16#FFFFFFFF, diameter:app_alias()}], %% {Id, Alias}
- caps :: #diameter_caps{},
- started = diameter_lib:now(), %% at process start
- watchdog :: pid()}). %% key into watchdogT
+ {pid :: pid(),
+ apps :: match([{0..16#FFFFFFFF, diameter:app_alias()}] %% {Id, Alias}
+ | [diameter:app_alias()]), %% remote
+ caps :: match(#diameter_caps{}),
+ started = diameter_lib:now(), %% at process start or sharing
+ watchdog :: match(pid() %% key into watchdogT
+ | undefined)}). %% undefined if remote
%% ---------------------------------------------------------------------------
%% # start/1
@@ -181,7 +174,7 @@ stop(SvcName) ->
end.
stop(ok, Pid) ->
- MRef = erlang:monitor(process, Pid),
+ MRef = monitor(process, Pid),
receive {'DOWN', MRef, process, _, _} -> ok end;
stop(No, _) ->
No.
@@ -495,6 +488,9 @@ transition({service, Pid}, S) ->
transition({peer, TPid, Aliases, Caps}, S) ->
remote_peer_up(TPid, Aliases, Caps, S),
ok;
+transition({peer, TPid}, S) ->
+ remote_peer_down(TPid, S),
+ ok;
%% Remote peer process has died.
transition({'DOWN', _, process, TPid, _}, S) ->
@@ -514,7 +510,7 @@ transition(Req, S) ->
%% # terminate/2
%% ---------------------------------------------------------------------------
-terminate(Reason, #state{service_name = Name, peerT = PeerT} = S) ->
+terminate(Reason, #state{service_name = Name, local = {PeerT, _, _}} = S) ->
send_event(Name, stop),
ets:delete(?STATE_TABLE, Name),
@@ -536,23 +532,80 @@ terminate(Reason, #state{service_name = Name, peerT = PeerT} = S) ->
%% # code_change/3
%% ---------------------------------------------------------------------------
-code_change(FromVsn,
- #state{service_name = SvcName,
- service = #diameter_service{applications = Apps}}
- = S,
- Extra) ->
- lists:foreach(fun(A) ->
- code_change(FromVsn, SvcName, Extra, A)
- end,
- Apps),
+code_change(_FromVsn, #state{} = S, _Extra) ->
+ {ok, S};
+
+%% Don't support downgrade since we won't in appup.
+code_change({down = T, _}, _, _Extra) ->
+ {error, T};
+
+%% Upgrade local/shared peers dicts populated in old code. Don't
+code_change(_FromVsn, S0, _Extra) ->
+ {state, Id, SvcName, Svc, WT, PeerT, SDict, LDict, Monitor, Opts}
+ = S0,
+
+ init_peers(LT = setelement(1, {PT, _, _} = init_peers(), PeerT),
+ fun({_,A}) -> A end),
+ init_peers(init_peers(RT = init_peers(), SDict),
+ fun(A) -> A end),
+
+ S = #state{id = Id,
+ service_name = SvcName,
+ service = Svc,
+ watchdogT = WT,
+ peerT = PT, %% empty
+ shared_peers = SDict,
+ local_peers = LDict,
+ local = LT,
+ remote = RT,
+ monitor = Monitor,
+ options = Opts},
+
+ %% Replacing the table entry and deleting the old shared tables
+ %% can make outgoing requests return {error, no_connection} until
+ %% everyone is running new code. Don't delete the tables to avoid
+ %% crashing request processes.
+ ets:delete_all_objects(SDict),
+ ets:delete_all_objects(LDict),
+ ets:insert(?STATE_TABLE, S),
{ok, S}.
-code_change(FromVsn, SvcName, Extra, #diameter_app{alias = Alias} = A) ->
- {ok, S} = cb(A, code_change, [FromVsn,
- mod_state(Alias),
- Extra,
- SvcName]),
- mod_state(Alias, S).
+%% init_peers/2
+
+%% Populate app and identity bags from a new-style #peer{} sets.
+init_peers({PeerT, _, _} = T, F)
+ when is_function(F) ->
+ ets:foldl(fun(#peer{pid = P, apps = As, caps = C}, N) ->
+ insert_peer(P, lists:map(F, As), C, T),
+ N+1
+ end,
+ 0,
+ PeerT);
+
+%% Populate #peer{} table given a shared peers dict.
+init_peers({PeerT, _, _}, SDict) ->
+ dict:fold(fun(P, As, N) ->
+ ets:update_element(PeerT, P, {#peer.apps, As}),
+ N+1
+ end,
+ 0,
+ diameter_dict:fold(fun(A, Ps, D) ->
+ init_peers(A, Ps, PeerT, D)
+ end,
+ dict:new(),
+ SDict)).
+
+%% init_peers/4
+
+init_peers(App, TCs, PeerT, Dict) ->
+ lists:foldl(fun({P,C}, D) ->
+ ets:insert(PeerT, #peer{pid = P,
+ apps = [],
+ caps = C}),
+ dict:append(P, App, D)
+ end,
+ Dict,
+ TCs).
%% ===========================================================================
%% ===========================================================================
@@ -560,9 +613,6 @@ code_change(FromVsn, SvcName, Extra, #diameter_app{alias = Alias} = A) ->
unexpected(F, A, #state{service_name = Name}) ->
?UNEXPECTED(F, A ++ [Name]).
-cb(#diameter_app{module = [_|_] = M}, F, A) ->
- eval(M, F, A).
-
eval([M|X], F, A) ->
apply(M, F, A ++ X).
@@ -582,10 +632,6 @@ choose(false, _, X) -> X.
ets_new(Tbl) ->
ets:new(Tbl, [{keypos, 2}]).
-insert(Tbl, Rec) ->
- ets:insert(Tbl, Rec),
- Rec.
-
%% Using the process dictionary for the callback state was initially
%% just a way to make what was horrendous trace (big state record and
%% much else everywhere) somewhat more readable. There's not as much
@@ -686,6 +732,8 @@ cfg_acc({SvcName, #diameter_service{applications = Apps} = Rec, Opts},
lists:foreach(fun init_mod/1, Apps),
S = #state{service_name = SvcName,
service = Rec#diameter_service{pid = self()},
+ local = init_peers(),
+ remote = init_peers(),
monitor = mref(get_value(monitor, Opts)),
options = service_options(Opts)},
{S, Acc};
@@ -695,6 +743,13 @@ cfg_acc({_Ref, Type, _Opts} = T, {S, Acc})
Type == listen ->
{S, [T | Acc]}.
+init_peers() ->
+ {ets_new(caps), %% #peer{}
+ ets:new(apps, [bag]), %% {Alias, TPid}
+ ets:new(idents, [bag])}. %% {{host, OH} | {realm, OR} | {OR, OH},
+ %% Alias,
+ %% TPid}
+
service_options(Opts) ->
[{sequence, proplists:get_value(sequence, Opts, ?NOMASK)},
{share_peers, get_value(share_peers, Opts)},
@@ -711,7 +766,7 @@ service_options(Opts) ->
mref(false = No) ->
No;
mref(P) ->
- erlang:monitor(process, P).
+ monitor(process, P).
init_shared(#state{options = [_, _, {_,T} | _],
service_name = Svc}) ->
@@ -810,7 +865,7 @@ start(Ref, Type, Opts, State) ->
%% start/5
start(Ref, Type, Opts, N, #state{watchdogT = WatchdogT,
- peerT = PeerT,
+ local = {PeerT, _, _},
options = SvcOpts,
service_name = SvcName,
service = Svc0})
@@ -841,7 +896,7 @@ binary_caps(#diameter_service{capabilities = Caps} = Svc, false) ->
wd(Type, Ref, T, WatchdogT, Rec) ->
Pid = start_watchdog(Type, Ref, T),
- insert(WatchdogT, Rec#watchdog{pid = Pid}),
+ ets:insert(WatchdogT, Rec#watchdog{pid = Pid}),
Pid.
%% Note that the service record passed into the watchdog is the merged
@@ -898,8 +953,8 @@ accepted(Pid, _TPid, #state{watchdogT = WatchdogT} = S) ->
#watchdog{ref = Ref, type = accept = T, peer = false, options = Opts}
= Wd
= fetch(WatchdogT, Pid),
- insert(WatchdogT, Wd#watchdog{peer = true}),%% mark replacement as started
- start(Ref, T, Opts, S). %% start new watchdog
+ ets:insert(WatchdogT, Wd#watchdog{peer = true}),%% mark replacement started
+ start(Ref, T, Opts, S). %% start new watchdog
fetch(Tid, Key) ->
[T] = ets:lookup(Tid, Key),
@@ -925,13 +980,14 @@ watchdog(TPid, [], ?WD_SUSPECT, ?WD_OKAY, Wd, State) ->
#watchdog{peer = TPid} = Wd, %% assert
connection_up(Wd, State);
-%% Watchdog has an unresponsive connection.
+%% Watchdog has an unresponsive connection. Note that the peer table
+%% entry isn't removed until DOWN.
watchdog(TPid, [], ?WD_OKAY, ?WD_SUSPECT = To, Wd, State) ->
#watchdog{peer = TPid} = Wd, %% assert
watchdog_down(Wd, To, State);
%% Watchdog has lost its connection.
-watchdog(TPid, [], _, ?WD_DOWN = To, Wd, #state{peerT = PeerT} = S) ->
+watchdog(TPid, [], _, ?WD_DOWN = To, Wd, #state{local = {PeerT, _, _}} = S) ->
close(Wd),
watchdog_down(Wd, To, S),
ets:delete(PeerT, TPid);
@@ -940,7 +996,7 @@ watchdog(_, [], _, _, _, _) ->
ok.
watchdog_down(Wd, To, #state{watchdogT = WatchdogT} = S) ->
- insert(WatchdogT, Wd#watchdog{state = To}),
+ ets:insert(WatchdogT, Wd#watchdog{state = To}),
connection_down(Wd, To, S).
%% ---------------------------------------------------------------------------
@@ -952,14 +1008,14 @@ watchdog_down(Wd, To, #state{watchdogT = WatchdogT} = S) ->
connection_up({TPid, {Caps, SupportedApps, Pkt}},
#watchdog{pid = Pid}
= Wd,
- #state{peerT = PeerT}
+ #state{local = {PeerT, _, _}}
= S) ->
- Pr = #peer{pid = TPid,
- apps = SupportedApps,
- caps = Caps,
- watchdog = Pid},
- insert(PeerT, Pr),
- connection_up([Pkt], Wd#watchdog{peer = TPid}, Pr, S).
+ Rec = #peer{pid = TPid,
+ apps = SupportedApps,
+ caps = Caps,
+ watchdog = Pid},
+ ets:insert(PeerT, Rec),
+ connection_up([Pkt], Wd#watchdog{peer = TPid}, Rec, S).
%% ---------------------------------------------------------------------------
%% # reopen/3
@@ -969,22 +1025,23 @@ reopen({TPid, {Caps, SupportedApps, _Pkt}},
#watchdog{pid = Pid}
= Wd,
#state{watchdogT = WatchdogT,
- peerT = PeerT}) ->
- insert(PeerT, #peer{pid = TPid,
- apps = SupportedApps,
- caps = Caps,
- watchdog = Pid}),
- insert(WatchdogT, Wd#watchdog{state = ?WD_REOPEN,
- peer = TPid}).
+ local = {PeerT, _, _}}) ->
+ ets:insert(PeerT, #peer{pid = TPid,
+ apps = SupportedApps,
+ caps = Caps,
+ watchdog = Pid}),
+ ets:insert(WatchdogT, Wd#watchdog{state = ?WD_REOPEN,
+ peer = TPid}).
%% ---------------------------------------------------------------------------
%% # connection_up/2
%% ---------------------------------------------------------------------------
-%% Watchdog has recovered as suspect connection. Note that there has
+%% Watchdog has recovered a suspect connection. Note that there has
%% been no new capabilties exchange in this case.
-connection_up(#watchdog{peer = TPid} = Wd, #state{peerT = PeerT} = S) ->
+connection_up(#watchdog{peer = TPid} = Wd, #state{local = {PeerT, _, _}}
+ = S) ->
connection_up([], Wd, fetch(PeerT, TPid), S).
%% connection_up/4
@@ -995,23 +1052,23 @@ connection_up(Extra,
#peer{apps = SApps, caps = Caps}
= Pr,
#state{watchdogT = WatchdogT,
- local_peers = LDict,
+ local = LT,
service_name = SvcName,
service = #diameter_service{applications = Apps}}
= S) ->
- insert(WatchdogT, Wd#watchdog{state = ?WD_OKAY}),
+ ets:insert(WatchdogT, Wd#watchdog{state = ?WD_OKAY}),
diameter_traffic:peer_up(TPid),
- insert_local_peer(SApps, {{TPid, Caps}, {SvcName, Apps}}, LDict),
+ local_peer_up(SApps, {TPid, Caps}, {SvcName, Apps}, LT),
report_status(up, Wd, Pr, S, Extra).
-insert_local_peer(SApps, T, LDict) ->
- lists:foldl(fun(A,D) -> ilp(A, T, D) end, LDict, SApps).
+local_peer_up(SApps, {TPid, Caps} = TC, SA, LT) ->
+ insert_peer(TPid, [A || {_,A} <- SApps], Caps, LT),
+ lists:foreach(fun(A) -> peer_up(A, TC, SA) end, SApps).
-ilp({Id, Alias}, {TC, SA}, LDict) ->
- init_conn(Id, Alias, TC, SA),
- ?Dict:append(Alias, TC, LDict).
+peer_up({Id, Alias}, TC, SA) ->
+ peer_up(Id, Alias, TC, SA).
-init_conn(Id, Alias, {TPid, _} = TC, {SvcName, Apps}) ->
+peer_up(Id, Alias, {TPid, _} = TC, {SvcName, Apps}) ->
#diameter_app{id = Id} %% assert
= App
= find_app(Alias, Apps),
@@ -1109,17 +1166,17 @@ connection_down(#watchdog{state = ?WD_OKAY,
= Pr,
#state{service_name = SvcName,
service = #diameter_service{applications = Apps},
- local_peers = LDict}
+ local = LT}
= S) ->
report_status(down, Wd, Pr, S, []),
- remove_local_peer(SApps, {{TPid, Caps}, {SvcName, Apps}}, LDict),
+ local_peer_down(SApps, {TPid, Caps}, {SvcName, Apps}, LT),
diameter_traffic:peer_down(TPid);
connection_down(#watchdog{state = ?WD_OKAY,
peer = TPid}
= Wd,
To,
- #state{peerT = PeerT}
+ #state{local = {PeerT, _, _}}
= S)
when is_atom(To) ->
connection_down(Wd, #peer{} = fetch(PeerT, TPid), S);
@@ -1127,15 +1184,14 @@ connection_down(#watchdog{state = ?WD_OKAY,
connection_down(#watchdog{}, _, _) ->
ok.
-remove_local_peer(SApps, T, LDict) ->
- lists:foldl(fun(A,D) -> rlp(A, T, D) end, LDict, SApps).
+local_peer_down(SApps, {TPid, _Caps} = TC, SA, LT) ->
+ delete_peer(TPid, LT),
+ lists:foreach(fun(A) -> peer_down(A, TC, SA) end, SApps).
-rlp({Id, Alias}, {TC, SA}, LDict) ->
- L = ?Dict:fetch(Alias, LDict),
- down_conn(Id, Alias, TC, SA),
- ?Dict:store(Alias, lists:delete(TC, L), LDict).
+peer_down({Id, Alias}, TC, SA) ->
+ peer_down(Id, Alias, TC, SA).
-down_conn(Id, Alias, TC, {SvcName, Apps}) ->
+peer_down(Id, Alias, TC, {SvcName, Apps}) ->
#diameter_app{id = Id} %% assert
= App
= find_app(Alias, Apps),
@@ -1160,7 +1216,7 @@ wd_down(#watchdog{peer = B}, _)
ok;
%% ... or maybe it has.
-wd_down(#watchdog{peer = TPid} = Wd, #state{peerT = PeerT} = S) ->
+wd_down(#watchdog{peer = TPid} = Wd, #state{local = {PeerT, _, _}} = S) ->
connection_down(Wd, ?WD_DOWN, S),
ets:delete(PeerT, TPid).
@@ -1368,19 +1424,37 @@ share_peer(up, Caps, Apps, TPid, #state{options = [_, {_,T} | _],
service_name = Svc}) ->
notify(T, Svc, {peer, TPid, [A || {_,A} <- Apps], Caps});
-share_peer(_, _, _, _, _) ->
- ok.
+share_peer(down, _Caps, _Apps, TPid, #state{options = [_, {_,T} | _],
+ service_name = Svc}) ->
+ notify(T, Svc, {peer, TPid}).
%% ---------------------------------------------------------------------------
%% # share_peers/2
%% ---------------------------------------------------------------------------
-share_peers(Pid, #state{options = [_, {_,T} | _], local_peers = PDict}) ->
- is_remote(Pid, T)
- andalso ?Dict:fold(fun(A,Ps,ok) -> sp(Pid, A, Ps), ok end, ok, PDict).
-
-sp(Pid, Alias, Peers) ->
- lists:foreach(fun({P,C}) -> Pid ! {peer, P, [Alias], C} end, Peers).
+share_peers(Pid, #state{options = [_, {_,SP} | _],
+ local = {PeerT, AppT, _}}) ->
+ is_remote(Pid, SP)
+ andalso ets:foldl(fun(T, N) -> N + sp(Pid, AppT, T) end,
+ 0,
+ PeerT).
+
+%% An entry in the peer table doesn't mean the watchdog state is OKAY,
+%% an entry in the app table does.
+
+sp(Pid, AppT, #peer{pid = TPid,
+ apps = [{_, Alias} | _] = Apps,
+ caps = Caps}) ->
+ Spec = [{{'$1', TPid},
+ [{'==', '$1', {const, Alias}}],
+ ['$_']}],
+ case ets:select(AppT, Spec, 1) of
+ '$end_of_table' ->
+ 0;
+ _ ->
+ Pid ! {peer, TPid, [A || {_,A} <- Apps], Caps},
+ 1
+ end.
is_remote(Pid, T) ->
Node = node(Pid),
@@ -1390,32 +1464,49 @@ is_remote(Pid, T) ->
%% # remote_peer_up/4
%% ---------------------------------------------------------------------------
-remote_peer_up(Pid, Aliases, Caps, #state{options = [_, _, {_,T} | _]} = S) ->
- is_remote(Pid, T)
- andalso rpu(Pid, Aliases, Caps, S).
+remote_peer_up(TPid, Aliases, Caps, #state{options = [_, _, {_,T} | _]} = S) ->
+ is_remote(TPid, T) andalso rpu(TPid, Aliases, Caps, S).
-rpu(Pid, Aliases, Caps, #state{service = Svc, shared_peers = PDict}) ->
+rpu(TPid, Aliases, Caps, #state{service = Svc, remote = RT}) ->
#diameter_service{applications = Apps} = Svc,
Key = #diameter_app.alias,
F = fun(A) -> lists:keymember(A, Key, Apps) end,
- rpu(Pid, lists:filter(F, Aliases), Caps, PDict);
+ rpu(TPid, lists:filter(F, Aliases), Caps, RT);
rpu(_, [] = No, _, _) ->
No;
-rpu(Pid, Aliases, Caps, PDict) ->
- erlang:monitor(process, Pid),
- T = {Pid, Caps},
- lists:foreach(fun(A) -> ?Dict:append(A, T, PDict) end, Aliases).
+rpu(TPid, Aliases, Caps, {PeerT, _, _} = RT) ->
+ monitor(process, TPid),
+ ets:insert(PeerT, #peer{pid = TPid,
+ apps = Aliases,
+ caps = Caps}),
+ insert_peer(TPid, Aliases, Caps, RT).
+
+%% insert_peer/4
+
+insert_peer(TPid, Aliases, Caps, {_PeerT, AppT, IdentT}) ->
+ #diameter_caps{origin_host = {_, OH},
+ origin_realm = {_, OR}}
+ = Caps,
+ ets:insert(AppT, [{A, TPid} || A <- Aliases]),
+ H = iolist_to_binary(OH),
+ R = iolist_to_binary(OR),
+ ets:insert(IdentT, [{T, A, TPid} || T <- [{host, H}, {realm, R}, {R, H}],
+ A <- Aliases]).
%% ---------------------------------------------------------------------------
%% # remote_peer_down/2
%% ---------------------------------------------------------------------------
-remote_peer_down(Pid, #state{shared_peers = PDict}) ->
- lists:foreach(fun(A) -> rpd(Pid, A, PDict) end, ?Dict:fetch_keys(PDict)).
+remote_peer_down(TPid, #state{remote = {PeerT, _, _} = RT}) ->
+ ets:delete(PeerT, TPid),
+ delete_peer(TPid, RT).
+
+%% delete_peer/2
-rpd(Pid, Alias, PDict) ->
- ?Dict:update(Alias, fun(Ps) -> lists:keydelete(Pid, 1, Ps) end, PDict).
+delete_peer(TPid, {_PeerT, AppT, IdentT}) ->
+ ets:select_delete(AppT, [{{'_', TPid}, [], [true]}]),
+ ets:select_delete(IdentT, [{{'_', '_', TPid}, [], [true]}]).
%% ---------------------------------------------------------------------------
%% pick_peer/4
@@ -1425,12 +1516,12 @@ pick_peer(#diameter_app{alias = Alias}
= App,
RealmAndHost,
Filter,
- #state{local_peers = L,
- shared_peers = S,
+ #state{local = LT,
+ remote = RT,
service_name = SvcName,
service = #diameter_service{pid = Pid}}) ->
- pick_peer(peers(Alias, RealmAndHost, Filter, L),
- peers(Alias, RealmAndHost, Filter, S),
+ pick_peer(peers(Alias, RealmAndHost, Filter, LT),
+ peers(Alias, RealmAndHost, Filter, RT),
Pid,
SvcName,
App).
@@ -1495,54 +1586,196 @@ pick_peer(Local,
%% peers/4
-peers(Alias, RH, Filter, Peers) ->
- case ?Dict:find(Alias, Peers) of
- {ok, L} ->
- filter(L, RH, Filter);
- error ->
+peers(Alias, RH, Filter, T) ->
+ filter(Alias, RH, Filter, T, true).
+
+%% filter/5
+%%
+%% Try to limit the peers list by starting with a host/realm lookup.
+
+filter(Alias, RH, {neg, F}, T, B) ->
+ filter(Alias, RH, F, T, not B);
+
+filter(_, _, none, _, false) ->
+ [];
+
+filter(Alias, _, none, T, true) ->
+ all_peers(Alias, T);
+
+filter(Alias, [DR,DH] = RH, K, T, B)
+ when K == realm, DR == undefined;
+ K == host, DH == undefined ->
+ filter(Alias, RH, none, T, B);
+
+filter(Alias, [DR,_] = RH, realm = K, T, B) ->
+ filter(Alias, RH, {K, DR}, T, B);
+
+filter(Alias, [_,DH] = RH, host = K, T, B) ->
+ filter(Alias, RH, {K, DH}, T, B);
+
+filter(Alias, _, {K, D}, {PeerT, _AppT, IdentT}, true)
+ when K == host;
+ K == realm ->
+ try iolist_to_binary(D) of
+ B ->
+ caps(PeerT, ets:select(IdentT, [{{{K, B}, '$1', '$2'},
+ [{'==', '$1', {const, Alias}}],
+ ['$2']}]))
+ catch
+ error:_ ->
[]
- end.
+ end;
-%% filter/3
+filter(Alias, RH, {all, Filters}, T, B)
+ when is_list(Filters) ->
+ fltr_all(Alias, RH, Filters, T, B);
+
+filter(Alias, RH, {first, Filters}, T, B)
+ when is_list(Filters) ->
+ fltr_first(Alias, RH, Filters, T, B);
+
+filter(Alias, RH, Filter, T, B) ->
+ {Ts, Fs} = filter(all_peers(Alias, T), RH, Filter),
+ choose(B, Ts, Fs).
+
+%% fltr_all/5
+
+fltr_all(Alias, RH, [{K, any} | Filters], T, B)
+ when K == host;
+ K == realm ->
+ fltr_all(Alias, RH, Filters, T, B);
+
+fltr_all(Alias, RH, [{host, _} = H, {realm, _} = R | Filters], T, B) ->
+ fltr_all(Alias, RH, [R, H | Filters], T, B);
+
+fltr_all(Alias, RH, [{realm, _} = R, {host, any} | Filters], T, B) ->
+ fltr_all(Alias, RH, [R | Filters], T, B);
+
+fltr_all(Alias, RH, [{realm, OR}, {host, OH} | Filters], T, true) ->
+ {PeerT, _AppT, IdentT} = T,
+ try {iolist_to_binary(OR), iolist_to_binary(OH)} of
+ BT ->
+ Peers = caps(PeerT,
+ ets:select(IdentT, [{{BT, '$1', '$2'},
+ [{'==', '$1', {const, Alias}}],
+ ['$2']}])),
+ {Ts, _} = filter(Peers, RH, {all, Filters}),
+ Ts
+ catch
+ error:_ ->
+ []
+ end;
+
+fltr_all(Alias, [undefined,_] = RH, [realm | Filters], T, B) ->
+ fltr_all(Alias, RH, Filters, T, B);
+
+fltr_all(Alias, [DR,_] = RH, [realm | Filters], T, B) ->
+ fltr_all(Alias, RH, [{realm, DR} | Filters], T, B);
+
+fltr_all(Alias, [_,undefined] = RH, [host | Filters], T, B) ->
+ fltr_all(Alias, RH, Filters, T, B);
+
+fltr_all(Alias, [_,DH] = RH, [host | Filters], T, B) ->
+ fltr_all(Alias, RH, [{host, DH} | Filters], T, B);
+
+fltr_all(Alias, RH, [{K, _} = KT, KA | Filters], T, B)
+ when K == host, KA == realm;
+ K == realm, KA == host ->
+ fltr_all(Alias, RH, [KA, KT | Filters], T, B);
+
+fltr_all(Alias, RH, [F | Filters], T, B) ->
+ {Ts, Fs} = filter(filter(Alias, RH, F, T, B), RH, {all, Filters}),
+ choose(B, Ts, Fs);
+
+fltr_all(Alias, RH, [], T, B) ->
+ filter(Alias, RH, none, T, B).
+
+%% fltr_first/5
%%
-%% Return peers in match order.
+%% Like any, but stop at the first filter with any matches.
+
+fltr_first(Alias, RH, [F | Filters], T, B) ->
+ case filter(Alias, RH, F, T, B) of
+ [] ->
+ fltr_first(Alias, RH, Filters, T, B);
+ [_|_] = Ts ->
+ Ts
+ end;
-filter(Peers, RH, Filter) ->
- {Ts, _} = fltr(Peers, RH, Filter),
- Ts.
+fltr_first(Alias, RH, [], T, B) ->
+ filter(Alias, RH, none, T, not B).
-%% fltr/4
+%% all_peers/2
+
+all_peers(Alias, {PeerT, AppT, _}) ->
+ ets:select(PeerT, [{#peer{pid = P, caps = '$1', _ = '_'},
+ [],
+ [{{P, '$1'}}]}
+ || {_,P} <- ets:lookup(AppT, Alias)]).
-fltr(Peers, _, none) ->
+%% caps/2
+
+caps(PeerT, Pids) ->
+ ets:select(PeerT, [{#peer{pid = P, caps = '$1', _ = '_'},
+ [],
+ [{{P, '$1'}}]}
+ || P <- Pids]).
+
+%% filter/3
+%%
+%% Return peers in match order.
+
+filter(Peers, _, none) ->
{Peers, []};
-fltr(Peers, RH, {neg, F}) ->
- {Ts, Fs} = fltr(Peers, RH, F),
+filter(Peers, RH, {neg, F}) ->
+ {Ts, Fs} = filter(Peers, RH, F),
{Fs, Ts};
-fltr(Peers, RH, {all, L})
+filter(Peers, RH, {all, L})
when is_list(L) ->
lists:foldl(fun(F,A) -> fltr_all(F, A, RH) end,
{Peers, []},
L);
-fltr(Peers, RH, {any, L})
+filter(Peers, RH, {any, L})
when is_list(L) ->
lists:foldl(fun(F,A) -> fltr_any(F, A, RH) end,
{[], Peers},
L);
-fltr(Peers, RH, F) ->
+filter(Peers, RH, {first, L})
+ when is_list(L) ->
+ fltr_first(Peers, RH, L);
+
+filter(Peers, RH, F) ->
lists:partition(fun({_,C}) -> caps_filter(C, RH, F) end, Peers).
+%% fltr_all/3
+
fltr_all(F, {Ts0, Fs0}, RH) ->
- {Ts1, Fs1} = fltr(Ts0, RH, F),
+ {Ts1, Fs1} = filter(Ts0, RH, F),
{Ts1, Fs0 ++ Fs1}.
+%% fltr_any/3
+
fltr_any(F, {Ts0, Fs0}, RH) ->
- {Ts1, Fs1} = fltr(Fs0, RH, F),
+ {Ts1, Fs1} = filter(Fs0, RH, F),
{Ts0 ++ Ts1, Fs1}.
+%% fltr_first/3
+
+fltr_first(Peers, _, []) ->
+ {[], Peers};
+
+fltr_first(Peers, RH, [F | Filters]) ->
+ case filter(Peers, RH, F) of
+ {[], _} ->
+ fltr_first(Peers, RH, Filters);
+ {_, _} = T ->
+ T
+ end.
+
%% caps_filter/3
caps_filter(#diameter_caps{origin_host = {_,OH}}, [_,DH], host) ->
@@ -1586,8 +1819,8 @@ eq(Any, Id, PeerId) ->
transports(#state{watchdogT = WatchdogT}) ->
ets:select(WatchdogT, [{#watchdog{peer = '$1', _ = '_'},
- [{'is_pid', '$1'}],
- ['$1']}]).
+ [{'is_pid', '$1'}],
+ ['$1']}]).
%% ---------------------------------------------------------------------------
%% # service_info/2
@@ -1640,7 +1873,7 @@ tagged_info(Item, S)
undefined
end;
-tagged_info(TPid, #state{watchdogT = WatchdogT, peerT = PeerT})
+tagged_info(TPid, #state{watchdogT = WatchdogT, local = {PeerT, _, _}})
when is_pid(TPid) ->
try
[#peer{watchdog = Pid}] = ets:lookup(PeerT, TPid),
@@ -1790,7 +2023,7 @@ keys(connect = T, Opts) ->
keys(_, _) ->
[{listen, accept}].
-peer_dict(#state{watchdogT = WatchdogT, peerT = PeerT}, Dict0) ->
+peer_dict(#state{watchdogT = WatchdogT, local = {PeerT, _, _}}, Dict0) ->
try ets:tab2list(WatchdogT) of
L -> lists:foldl(fun(T,A) -> peer_acc(PeerT, A, T) end, Dict0, L)
catch
diff --git a/lib/diameter/src/base/diameter_traffic.erl b/lib/diameter/src/base/diameter_traffic.erl
index 07f39c562f..c169d3fc2c 100644
--- a/lib/diameter/src/base/diameter_traffic.erl
+++ b/lib/diameter/src/base/diameter_traffic.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -41,7 +41,6 @@
-export([make_recvdata/1,
peer_up/1,
peer_down/1,
- failover/1,
pending/1]).
%% towards ?MODULE
@@ -1566,6 +1565,8 @@ answer(Pkt,
Req) ->
a(Pkt, SvcName, ModX, AE, Req).
+-spec a(_, _, _) -> no_return(). %% silence dialyzer
+
a(#diameter_packet{errors = Es}
= Pkt,
SvcName,
@@ -1814,7 +1815,7 @@ store_request(T, TPid) ->
ets:member(?REQUEST_TABLE, TPid)
orelse begin
{_Seqs, _Req, TRef} = T,
- (self() ! {failover, TRef}) %% failover/1 may have missed
+ self() ! {failover, TRef} %% failover/1 may have missed
end.
%% lookup_request/2
@@ -1864,7 +1865,7 @@ failover(TPid)
%% notifications are sent here: store_request/2 sends the notification
%% in that case.
-%% Failover as a consequence of request_peer_down/1: inform the
+%% Failover as a consequence of peer_down/1: inform the
%% request process.
failover({_, Req, TRef}) ->
#request{handler = Pid,
diff --git a/lib/diameter/src/diameter.appup.src b/lib/diameter/src/diameter.appup.src
index ba0e79907c..a3e21db012 100644
--- a/lib/diameter/src/diameter.appup.src
+++ b/lib/diameter/src/diameter.appup.src
@@ -46,24 +46,11 @@
{"1.9.2.1", [{restart_application, diameter}]}, %% 17.5.6.3
{"1.9.2.2", [{restart_application, diameter}]}, %% 17.5.6.7
{"1.9.2.3", [{restart_application, diameter}]}, %% 17.5.6.8
- {"1.10", [{load_module, diameter_codec}, %% 18.0
- {load_module, diameter_peer_fsm},
- {load_module, diameter_watchdog},
- {load_module, diameter_stats},
- {load_module, diameter_config},
- {load_module, diameter_lib},
- {load_module, diameter_peer},
- {load_module, diameter_reg},
- {load_module, diameter_traffic},
- {load_module, diameter_service},
- {load_module, diameter_sync},
- {load_module, diameter},
- {load_module, diameter_gen_base_rfc6733},
- {load_module, diameter_gen_acct_rfc6733},
- {load_module, diameter_gen_base_rfc3588},
- {load_module, diameter_gen_base_accounting},
- {load_module, diameter_gen_relay}]},
- {"1.11", [{load_module, diameter_traffic}]} %% 18.1
+ {"1.10", [{restart_application, diameter}]}, %% 18.0
+ {"1.11", [{load_module, diameter_traffic}, %% 18.1
+ {update, diameter_service, {advanced, []}}]},
+ {"1.11.1", [{load_module, diameter_traffic}, %% 18.2
+ {update, diameter_service, {advanced, []}}]}
],
[
{"0.9", [{restart_application, diameter}]},
@@ -91,23 +78,8 @@
{"1.9.2.1", [{restart_application, diameter}]},
{"1.9.2.2", [{restart_application, diameter}]},
{"1.9.2.3", [{restart_application, diameter}]},
- {"1.10", [{load_module, diameter_gen_relay},
- {load_module, diameter_gen_base_accounting},
- {load_module, diameter_gen_base_rfc3588},
- {load_module, diameter_gen_acct_rfc6733},
- {load_module, diameter_gen_base_rfc6733},
- {load_module, diameter},
- {load_module, diameter_sync},
- {load_module, diameter_service},
- {load_module, diameter_traffic},
- {load_module, diameter_reg},
- {load_module, diameter_peer},
- {load_module, diameter_lib},
- {load_module, diameter_config},
- {load_module, diameter_stats},
- {load_module, diameter_watchdog},
- {load_module, diameter_peer_fsm},
- {load_module, diameter_codec}]},
- {"1.11", [{load_module, diameter_traffic}]}
+ {"1.10", [{restart_application, diameter}]},
+ {"1.11", [{restart_application, diameter}]},
+ {"1.11.1", [{restart_application, diameter}]}
]
}.
diff --git a/lib/diameter/vsn.mk b/lib/diameter/vsn.mk
index 7ac4a7adfb..836def8447 100644
--- a/lib/diameter/vsn.mk
+++ b/lib/diameter/vsn.mk
@@ -17,5 +17,5 @@
# %CopyrightEnd%
APPLICATION = diameter
-DIAMETER_VSN = 1.11.1
+DIAMETER_VSN = 1.11.2
APP_VSN = $(APPLICATION)-$(DIAMETER_VSN)$(PRE_VSN)
diff --git a/lib/erl_interface/configure.in b/lib/erl_interface/configure.in
index 3ac9212085..7a3b5ce378 100644
--- a/lib/erl_interface/configure.in
+++ b/lib/erl_interface/configure.in
@@ -251,7 +251,7 @@ case "$threads_disabled" in
;;
win32_threads)
EI_THREADS="true"
- THR_DEFS="$THR_DEFS -D_WIN32_WINNT=0x0500 -DWINVER=0x0500"
+ THR_DEFS="$THR_DEFS -D_WIN32_WINNT=0x0600 -DWINVER=0x0600"
;;
pthread)
EI_THREADS="true"
diff --git a/lib/inets/src/http_server/httpd_request_handler.erl b/lib/inets/src/http_server/httpd_request_handler.erl
index 134576059d..8fae9ac46e 100644
--- a/lib/inets/src/http_server/httpd_request_handler.erl
+++ b/lib/inets/src/http_server/httpd_request_handler.erl
@@ -102,8 +102,8 @@ init([Manager, ConfigDB, AcceptTimeout]) ->
KeepAliveTimeOut = 1000 * httpd_util:lookup(ConfigDB, keep_alive_timeout, 150),
case http_transport:negotiate(SocketType, Socket, ?HANDSHAKE_TIMEOUT) of
- {error, _Error} ->
- exit(shutdown); %% Can be 'normal'.
+ {error, Error} ->
+ exit({shutdown, Error}); %% Can be 'normal'.
ok ->
continue_init(Manager, ConfigDB, SocketType, Socket, KeepAliveTimeOut)
end.
@@ -294,7 +294,10 @@ handle_info(Info, #state{mod = ModData} = State) ->
%% cleaning up. When it returns, the gen_server terminates with Reason.
%% The return value is ignored.
%%--------------------------------------------------------------------
-terminate(normal, State) ->
+terminate(Reason, State) when Reason == normal;
+ Reason == shutdown ->
+ do_terminate(State);
+terminate({shutdown,_}, State) ->
do_terminate(State);
terminate(Reason, #state{response_sent = false, mod = ModData} = State) ->
httpd_response:send_status(ModData, 500, none),
diff --git a/lib/inets/src/tftp/tftp_engine.erl b/lib/inets/src/tftp/tftp_engine.erl
index 79203fd1a4..22dd2f3336 100644
--- a/lib/inets/src/tftp/tftp_engine.erl
+++ b/lib/inets/src/tftp/tftp_engine.erl
@@ -657,22 +657,11 @@ common_read(Config, Callback, Req, _LocalAccess, ExpectedBlockNo, ActualBlockNo,
do_common_read(Config, Callback, Req, LocalAccess, BlockNo, Data, Prepared)
when is_binary(Data), is_record(Prepared, prepared) ->
- NextBlockNo = BlockNo + 1,
- case NextBlockNo =< 65535 of
- true ->
- Reply = #tftp_msg_data{block_no = NextBlockNo, data = Data},
- {Config2, Callback2, TransferRes} =
- transfer(Config, Callback, Req, Reply, LocalAccess, NextBlockNo, Prepared),
- ?MODULE:common_loop(Config2, Callback2, Req, TransferRes, LocalAccess, NextBlockNo);
- false ->
- Code = badblk,
- Text = "Too big transfer ID = " ++
- integer_to_list(NextBlockNo) ++ " > 65535",
- {undefined, Error} =
- callback({abort, {Code, Text}}, Config, Callback, Req),
- send_msg(Config, Req, Error),
- terminate(Config, Req, ?ERROR(read, Code, Text, Req#tftp_msg_req.filename))
- end.
+ NextBlockNo = (BlockNo + 1) rem 65536,
+ Reply = #tftp_msg_data{block_no = NextBlockNo, data = Data},
+ {Config2, Callback2, TransferRes} =
+ transfer(Config, Callback, Req, Reply, LocalAccess, NextBlockNo, Prepared),
+ ?MODULE:common_loop(Config2, Callback2, Req, TransferRes, LocalAccess, NextBlockNo).
-spec common_write(#config{}, #callback{}, _, 'write', integer(), integer(), _, #prepared{}) -> no_return().
@@ -716,21 +705,10 @@ common_write(Config, Callback, Req, _, ExpectedBlockNo, ActualBlockNo, Data, Pre
common_ack(Config, Callback, Req, LocalAccess, BlockNo, Prepared)
when is_record(Prepared, prepared) ->
Reply = #tftp_msg_ack{block_no = BlockNo},
- NextBlockNo = BlockNo + 1,
+ NextBlockNo = (BlockNo + 1) rem 65536,
{Config2, Callback2, TransferRes} =
transfer(Config, Callback, Req, Reply, LocalAccess, NextBlockNo, Prepared),
- case NextBlockNo =< 65535 of
- true ->
- ?MODULE:common_loop(Config2, Callback2, Req, TransferRes, LocalAccess, NextBlockNo);
- false ->
- Code = badblk,
- Text = "Too big transfer ID = " ++
- integer_to_list(NextBlockNo) ++ " > 65535",
- {undefined, Error} =
- callback({abort, {Code, Text}}, Config, Callback2, Req),
- send_msg(Config, Req, Error),
- terminate(Config, Req, ?ERROR(read, Code, Text, Req#tftp_msg_req.filename))
- end.
+ ?MODULE:common_loop(Config2, Callback2, Req, TransferRes, LocalAccess, NextBlockNo).
pre_terminate(Config, Req, Result) ->
if
diff --git a/lib/inets/test/ftp_suite_lib.erl b/lib/inets/test/ftp_suite_lib.erl
index 2f9170fa0c..f15fa2fa8d 100644
--- a/lib/inets/test/ftp_suite_lib.erl
+++ b/lib/inets/test/ftp_suite_lib.erl
@@ -23,7 +23,6 @@
-include_lib("common_test/include/ct.hrl").
--include_lib("common_test/include/ct.hrl").
-include("inets_test_lib.hrl").
%% Test server specific exports
diff --git a/lib/inets/test/tftp_SUITE.erl b/lib/inets/test/tftp_SUITE.erl
index d29d210d7d..497a50e654 100644
--- a/lib/inets/test/tftp_SUITE.erl
+++ b/lib/inets/test/tftp_SUITE.erl
@@ -76,7 +76,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[simple, extra, reuse_connection, resend_client,
- resend_server].
+ resend_server, large_file].
groups() ->
[].
@@ -902,6 +902,41 @@ reuse_connection(Config) when is_list(Config) ->
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Large file: transfer > 65535 blocks
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+large_file(doc) ->
+ ["Start the daemon and test transfer of files greater than 32M."];
+large_file(suite) ->
+ [];
+large_file(Config) when is_list(Config) ->
+ ?VERIFY(ok, application:start(inets)),
+
+ {Port, DaemonPid} = ?IGNORE(?START_DAEMON(0, [{debug, brief}])),
+
+ %% Read fail
+ RemoteFilename = "tftp_temporary_large_file_remote_test_file.txt",
+ LocalFilename = "tftp_temporary_large_file_local_test_file.txt",
+
+ {ok, FH} = file:open(LocalFilename, [write,exclusive]),
+ {ok, Size} = file:position(FH, {eof, 2*512*65535}),
+ ok = file:truncate(FH),
+ ?IGNORE(file:close(FH)),
+
+ %% Write and read
+ ?VERIFY({ok, Size}, tftp:write_file(RemoteFilename, LocalFilename, [{port, Port}])),
+ ?IGNORE(file:delete(LocalFilename)),
+ ?VERIFY({ok, Size}, tftp:read_file(RemoteFilename, LocalFilename, [{port, Port}])),
+
+ %% Cleanup
+ unlink(DaemonPid),
+ exit(DaemonPid, kill),
+ ?VERIFY(ok, file:delete(LocalFilename)),
+ ?VERIFY(ok, file:delete(RemoteFilename)),
+ ?VERIFY(ok, application:stop(inets)),
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Goodies
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/lib/kernel/doc/src/app.xml b/lib/kernel/doc/src/app.xml
index d6d6167923..35feec144e 100644
--- a/lib/kernel/doc/src/app.xml
+++ b/lib/kernel/doc/src/app.xml
@@ -201,7 +201,7 @@ RTDeps [ApplicationVersion] []
how to compare application versions see
<seealso marker="doc/system_principles:versions">the
documentation of versions in the system principles
- guide</seealso>. Note that that the application version
+ guide</seealso>. Note that the application version
specifies a source code version. An additional indirect
requirement is that installed binary application of
the specified version has been built so that it is
diff --git a/lib/kernel/doc/src/seq_trace.xml b/lib/kernel/doc/src/seq_trace.xml
index f4fcd222ec..857444e338 100644
--- a/lib/kernel/doc/src/seq_trace.xml
+++ b/lib/kernel/doc/src/seq_trace.xml
@@ -150,13 +150,13 @@ seq_trace:set_token(OldToken), % activate the trace token again
format and value as produced by
<c>erlang:monotonic_time(nano_seconds)</c>.</p>
</item>
+ </taglist>
<p>If multiple timestamp flags are passed, <c>timestamp</c> has
precedence over <c>strict_monotonic_timestamp</c> which
in turn has precedence over <c>monotonic_timestamp</c>. All
timestamp flags are remembered, so if two are passed
and the one with highest precedence later is disabled
the other one will become active.</p>
- </taglist>
</desc>
</func>
<func>
diff --git a/lib/kernel/examples/uds_dist/c_src/uds_drv.c b/lib/kernel/examples/uds_dist/c_src/uds_drv.c
index e32ad69adf..8c028ba910 100644
--- a/lib/kernel/examples/uds_dist/c_src/uds_drv.c
+++ b/lib/kernel/examples/uds_dist/c_src/uds_drv.c
@@ -957,28 +957,24 @@ static void put_packet_length(char *b, int len)
/*
** Malloc wrappers
-** Note!
-** The function erl_exit is actually not a pert of the
-** driver interface, but it is very nice to use if one wants to halt
-** with a core and an erlang crash dump.
*/
static void *my_malloc(size_t size)
{
- void erl_exit(int, char *, ...);
void *ptr;
if ((ptr = driver_alloc(size)) == NULL) {
- erl_exit(1,"Could not allocate %lu bytes of memory",(unsigned long) size);
+ fprintf(stderr, "Could not allocate %lu bytes of memory",(unsigned long) size);
+ abort();
}
return ptr;
}
static void *my_realloc(void *ptr, size_t size)
{
- void erl_exit(int, char *, ...);
void *nptr;
if ((nptr = driver_realloc(ptr, size)) == NULL) {
- erl_exit(1,"Could not reallocate %lu bytes of memory",(unsigned long) size);
+ fprintf(stderr, "Could not reallocate %lu bytes of memory",(unsigned long) size);
+ abort();
}
return nptr;
}
diff --git a/lib/kernel/src/erl_distribution.erl b/lib/kernel/src/erl_distribution.erl
index 99db7a8bf0..559e2a853b 100644
--- a/lib/kernel/src/erl_distribution.erl
+++ b/lib/kernel/src/erl_distribution.erl
@@ -21,20 +21,47 @@
-behaviour(supervisor).
--export([start_link/0,start_link/1,init/1,start/1,stop/0]).
+-export([start_link/0,start_link/2,init/1,start/1,stop/0]).
-define(DBG,erlang:display([?MODULE,?LINE])).
+%% Called during system start-up.
+
start_link() ->
- case catch start_p() of
- {ok,Args} ->
- start_link(Args);
- _ ->
- ignore
+ do_start_link([{sname,shortnames},{name,longnames}]).
+
+%% Called from net_kernel:start/1 to start distribution after the
+%% system has already started.
+
+start(Args) ->
+ C = {net_sup_dynamic, {?MODULE,start_link,[Args,false]}, permanent,
+ 1000, supervisor, [erl_distribution]},
+ supervisor:start_child(kernel_sup, C).
+
+%% Stop distribution.
+
+stop() ->
+ case supervisor:terminate_child(kernel_sup, net_sup_dynamic) of
+ ok ->
+ supervisor:delete_child(kernel_sup, net_sup_dynamic);
+ Error ->
+ case whereis(net_sup) of
+ Pid when is_pid(Pid) ->
+ %% Dist. started through -sname | -name flags
+ {error, not_allowed};
+ _ ->
+ Error
+ end
end.
-start_link(Args) ->
- supervisor:start_link({local,net_sup},erl_distribution,Args).
+%%%
+%%% Internal helper functions.
+%%%
+
+%% Helper start function.
+
+start_link(Args, CleanHalt) ->
+ supervisor:start_link({local,net_sup}, ?MODULE, [Args,CleanHalt]).
init(NetArgs) ->
Epmd =
@@ -47,31 +74,20 @@ init(NetArgs) ->
permanent,2000,worker,[EpmdMod]}]
end,
Auth = {auth,{auth,start_link,[]},permanent,2000,worker,[auth]},
- Kernel = {net_kernel,{net_kernel,start_link,[NetArgs]},
+ Kernel = {net_kernel,{net_kernel,start_link,NetArgs},
permanent,2000,worker,[net_kernel]},
EarlySpecs = net_kernel:protocol_childspecs(),
{ok,{{one_for_all,0,1}, EarlySpecs ++ Epmd ++ [Auth,Kernel]}}.
-start_p() ->
- sname(),
- lname(),
- false.
-
-sname() ->
- case init:get_argument(sname) of
+do_start_link([{Arg,Flag}|T]) ->
+ case init:get_argument(Arg) of
{ok,[[Name]]} ->
- throw({ok,[list_to_atom(Name),shortnames|ticktime()]});
+ start_link([list_to_atom(Name),Flag|ticktime()], true);
_ ->
- false
- end.
-
-lname() ->
- case init:get_argument(name) of
- {ok,[[Name]]} ->
- throw({ok,[list_to_atom(Name),longnames|ticktime()]});
- _ ->
- false
- end.
+ do_start_link(T)
+ end;
+do_start_link([]) ->
+ ignore.
ticktime() ->
%% catch, in case the system was started with boot file start_old,
@@ -84,23 +100,3 @@ ticktime() ->
_ ->
[]
end.
-
-start(Args) ->
- C = {net_sup_dynamic, {erl_distribution, start_link, [Args]}, permanent,
- 1000, supervisor, [erl_distribution]},
- supervisor:start_child(kernel_sup, C).
-
-stop() ->
- case supervisor:terminate_child(kernel_sup, net_sup_dynamic) of
- ok ->
- supervisor:delete_child(kernel_sup, net_sup_dynamic);
- Error ->
- case whereis(net_sup) of
- Pid when is_pid(Pid) ->
- %% Dist. started through -sname | -name flags
- {error, not_allowed};
- _ ->
- Error
- end
- end.
-
diff --git a/lib/kernel/src/erl_epmd.erl b/lib/kernel/src/erl_epmd.erl
index 55ce9a7e64..c6202dd796 100644
--- a/lib/kernel/src/erl_epmd.erl
+++ b/lib/kernel/src/erl_epmd.erl
@@ -32,7 +32,7 @@
%% External exports
-export([start/0, start_link/0, stop/0, port_please/2,
port_please/3, names/0, names/1,
- register_node/2, open/0, open/1, open/2]).
+ register_node/2, register_node/3, open/0, open/1, open/2]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
@@ -102,7 +102,9 @@ names(EpmdAddr) ->
register_node(Name, PortNo) ->
- gen_server:call(erl_epmd, {register, Name, PortNo}, infinity).
+ register_node(Name, PortNo, inet).
+register_node(Name, PortNo, Family) ->
+ gen_server:call(erl_epmd, {register, Name, PortNo, Family}, infinity).
%%%----------------------------------------------------------------------
%%% Callback functions from gen_server
@@ -120,10 +122,10 @@ init(_) ->
-spec handle_call(calls(), term(), state()) ->
{'reply', term(), state()} | {'stop', 'shutdown', 'ok', state()}.
-handle_call({register, Name, PortNo}, _From, State) ->
+handle_call({register, Name, PortNo, Family}, _From, State) ->
case State#state.socket of
P when P < 0 ->
- case do_register_node(Name, PortNo) of
+ case do_register_node(Name, PortNo, Family) of
{alive, Socket, Creation} ->
S = State#state{socket = Socket,
port_no = PortNo,
@@ -206,8 +208,12 @@ open({A,B,C,D,E,F,G,H}=EpmdAddr, Timeout) when ?ip6(A,B,C,D,E,F,G,H) ->
close(Socket) ->
gen_tcp:close(Socket).
-do_register_node(NodeName, TcpPort) ->
- case open() of
+do_register_node(NodeName, TcpPort, Family) ->
+ Localhost = case Family of
+ inet -> open({127,0,0,1});
+ inet6 -> open({0,0,0,0,0,0,0,1})
+ end,
+ case Localhost of
{ok, Socket} ->
Name = to_string(NodeName),
Extra = "",
diff --git a/lib/kernel/src/hipe_unified_loader.erl b/lib/kernel/src/hipe_unified_loader.erl
index 73fcb2469c..087cceb5d8 100644
--- a/lib/kernel/src/hipe_unified_loader.erl
+++ b/lib/kernel/src/hipe_unified_loader.erl
@@ -105,7 +105,7 @@ load_native_code(Mod, Bin, Architecture) when is_atom(Mod), is_binary(Bin) ->
case code:get_chunk(Bin, chunk_name(Architecture)) of
undefined -> no_native;
NativeCode when is_binary(NativeCode) ->
- erlang:system_flag(multi_scheduling, block),
+ erlang:system_flag(multi_scheduling, block_normal),
try
OldReferencesToPatch = patch_to_emu_step1(Mod),
case load_module(Mod, NativeCode, Bin, OldReferencesToPatch,
@@ -114,7 +114,7 @@ load_native_code(Mod, Bin, Architecture) when is_atom(Mod), is_binary(Bin) ->
Result -> Result
end
after
- erlang:system_flag(multi_scheduling, unblock)
+ erlang:system_flag(multi_scheduling, unblock_normal)
end
end.
@@ -125,12 +125,12 @@ load_native_code(Mod, Bin, Architecture) when is_atom(Mod), is_binary(Bin) ->
post_beam_load([])->
ok;
post_beam_load([_|_]=Mods) ->
- erlang:system_flag(multi_scheduling, block),
+ erlang:system_flag(multi_scheduling, block_normal),
try
_ = [patch_to_emu(Mod) || Mod <- Mods],
ok
after
- erlang:system_flag(multi_scheduling, unblock)
+ erlang:system_flag(multi_scheduling, unblock_normal)
end,
ok.
@@ -151,11 +151,11 @@ version_check(Version, Mod) when is_atom(Mod) ->
'bad_crc' | {'module', Mod} when Mod :: atom().
load_module(Mod, Bin, Beam, Architecture) ->
- erlang:system_flag(multi_scheduling, block),
+ erlang:system_flag(multi_scheduling, block_normal),
try
load_module_nosmp(Mod, Bin, Beam, Architecture)
after
- erlang:system_flag(multi_scheduling, unblock)
+ erlang:system_flag(multi_scheduling, unblock_normal)
end.
load_module_nosmp(Mod, Bin, Beam, Architecture) ->
@@ -173,11 +173,11 @@ load_module(Mod, Bin, Beam, OldReferencesToPatch, Architecture) ->
'bad_crc' | {'module', Mod} when Mod :: atom().
load(Mod, Bin, Architecture) ->
- erlang:system_flag(multi_scheduling, block),
+ erlang:system_flag(multi_scheduling, block_normal),
try
load_nosmp(Mod, Bin, Architecture)
after
- erlang:system_flag(multi_scheduling, unblock)
+ erlang:system_flag(multi_scheduling, unblock_normal)
end.
load_nosmp(Mod, Bin, Architecture) ->
diff --git a/lib/kernel/src/kernel.app.src b/lib/kernel/src/kernel.app.src
index 419dc0a2fc..7452c6bc98 100644
--- a/lib/kernel/src/kernel.app.src
+++ b/lib/kernel/src/kernel.app.src
@@ -116,6 +116,6 @@
{applications, []},
{env, [{error_logger, tty}]},
{mod, {kernel, []}},
- {runtime_dependencies, ["erts-7.3", "stdlib-2.6", "sasl-2.6"]}
+ {runtime_dependencies, ["erts-8.0", "stdlib-2.6", "sasl-2.6"]}
]
}.
diff --git a/lib/kernel/src/kernel.appup.src b/lib/kernel/src/kernel.appup.src
index 860d3640d0..a13819a183 100644
--- a/lib/kernel/src/kernel.appup.src
+++ b/lib/kernel/src/kernel.appup.src
@@ -18,9 +18,9 @@
%% %CopyrightEnd%
{"%VSN%",
%% Up from - max one major revision back
- [{<<"4\\.[0-1](\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-18.*
- {<<"3\\.[0-2](\\.[0-9]+)*">>,[restart_new_emulator]}], % OTP-17
+ [{<<"5\\.0(\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-19.*
+ {<<"4\\.[0-2](\\.[0-9]+)*">>,[restart_new_emulator]}], % OTP-18.*
%% Down to - max one major revision back
- [{<<"4\\.[0-1](\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-18.*
- {<<"3\\.[0-2](\\.[0-9]+)*">>,[restart_new_emulator]}] % OTP-17
+ [{<<"5\\.0(\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-19.*
+ {<<"4\\.[0-2](\\.[0-9]+)*">>,[restart_new_emulator]}] % OTP-18.*
}.
diff --git a/lib/kernel/src/net_kernel.erl b/lib/kernel/src/net_kernel.erl
index 35a54f591e..a19c116388 100644
--- a/lib/kernel/src/net_kernel.erl
+++ b/lib/kernel/src/net_kernel.erl
@@ -53,18 +53,25 @@
-define(tckr_dbg(X), ok).
-endif.
-%% User Interface Exports
--export([start/1, start_link/1, stop/0,
- kernel_apply/3,
+%% Documented API functions.
+
+-export([allow/1,
+ connect_node/1,
monitor_nodes/1,
monitor_nodes/2,
+ start/1,
+ stop/0]).
+
+%% Exports for internal use.
+
+-export([start_link/2,
+ kernel_apply/3,
longnames/0,
- allow/1,
protocol_childspecs/0,
epmd_module/0]).
-export([connect/1, disconnect/1, hidden_connect/1, passive_cnct/1]).
--export([connect_node/1, hidden_connect_node/1]). %% explicit connect
+-export([hidden_connect_node/1]). %% explicit connect
-export([set_net_ticktime/1, set_net_ticktime/2, get_net_ticktime/0]).
-export([node_info/1, node_info/2, nodes_info/0,
@@ -73,7 +80,8 @@
-export([publish_on_node/1, update_publish_nodes/1]).
-%% Internal Exports
+%% Internal exports for spawning processes.
+
-export([do_spawn/3,
spawn_func/6,
ticker/2,
@@ -341,18 +349,18 @@ request(Req) ->
start(Args) ->
erl_distribution:start(Args).
-%% This is the main startup routine for net_kernel
-%% The defaults are longnames and a ticktime of 15 secs to the tcp_drv.
+%% This is the main startup routine for net_kernel (only for internal
+%% use by the Kernel application.
-start_link([Name]) ->
- start_link([Name, longnames]);
+start_link([Name], CleanHalt) ->
+ start_link([Name, longnames], CleanHalt);
+start_link([Name, LongOrShortNames], CleanHalt) ->
+ start_link([Name, LongOrShortNames, 15000], CleanHalt);
-start_link([Name, LongOrShortNames]) ->
- start_link([Name, LongOrShortNames, 15000]);
-
-start_link([Name, LongOrShortNames, Ticktime]) ->
- case gen_server:start_link({local, net_kernel}, net_kernel,
- {Name, LongOrShortNames, Ticktime}, []) of
+start_link([Name, LongOrShortNames, Ticktime], CleanHalt) ->
+ Args = {Name, LongOrShortNames, Ticktime, CleanHalt},
+ case gen_server:start_link({local, net_kernel}, ?MODULE,
+ Args, []) of
{ok, Pid} ->
{ok, Pid};
{error, {already_started, Pid}} ->
@@ -361,12 +369,9 @@ start_link([Name, LongOrShortNames, Ticktime]) ->
exit(nodistribution)
end.
-%% auth:get_cookie should only be able to return an atom
-%% tuple cookies are unknowns
-
-init({Name, LongOrShortNames, TickT}) ->
+init({Name, LongOrShortNames, TickT, CleanHalt}) ->
process_flag(trap_exit,true),
- case init_node(Name, LongOrShortNames) of
+ case init_node(Name, LongOrShortNames, CleanHalt) of
{ok, Node, Listeners} ->
process_flag(priority, max),
Ticktime = to_integer(TickT),
@@ -1201,12 +1206,12 @@ get_proto_mod(_Family, _Protocol, []) ->
%% -------- Initialisation functions ------------------------
-init_node(Name, LongOrShortNames) ->
- {NameWithoutHost,_Host} = lists:splitwith(fun($@)->false;(_)->true end,
- atom_to_list(Name)),
+init_node(Name, LongOrShortNames, CleanHalt) ->
+ {NameWithoutHost0,_Host} = split_node(Name),
case create_name(Name, LongOrShortNames, 1) of
{ok,Node} ->
- case start_protos(list_to_atom(NameWithoutHost),Node) of
+ NameWithoutHost = list_to_atom(NameWithoutHost0),
+ case start_protos(NameWithoutHost, Node, CleanHalt) of
{ok, Ls} ->
{ok, Node, Ls};
Error ->
@@ -1240,8 +1245,7 @@ create_name(Name, LongOrShortNames, Try) ->
end.
create_hostpart(Name, LongOrShortNames) ->
- {Head,Host} = lists:splitwith(fun($@)->false;(_)->true end,
- atom_to_list(Name)),
+ {Head,Host} = split_node(Name),
Host1 = case {Host,LongOrShortNames} of
{[$@,_|_],longnames} ->
{ok,Host};
@@ -1268,6 +1272,9 @@ create_hostpart(Name, LongOrShortNames) ->
end,
{Head,Host1}.
+split_node(Name) ->
+ lists:splitwith(fun(C) -> C =/= $@ end, atom_to_list(Name)).
+
%%
%%
%%
@@ -1307,21 +1314,26 @@ epmd_module() ->
%% Start all protocols
%%
-start_protos(Name,Node) ->
+start_protos(Name, Node, CleanHalt) ->
case init:get_argument(proto_dist) of
{ok, [Protos]} ->
- start_protos(Name,Protos, Node);
+ start_protos(Name, Protos, Node, CleanHalt);
_ ->
- start_protos(Name,["inet_tcp"], Node)
+ start_protos(Name, ["inet_tcp"], Node, CleanHalt)
end.
-start_protos(Name,Ps, Node) ->
- case start_protos(Name, Ps, Node, []) of
- [] -> {error, badarg};
- Ls -> {ok, Ls}
+start_protos(Name, Ps, Node, CleanHalt) ->
+ case start_protos(Name, Ps, Node, [], CleanHalt) of
+ [] ->
+ case CleanHalt of
+ true -> halt(1);
+ false -> {error, badarg}
+ end;
+ Ls ->
+ {ok, Ls}
end.
-start_protos(Name, [Proto | Ps], Node, Ls) ->
+start_protos(Name, [Proto | Ps], Node, Ls, CleanHalt) ->
Mod = list_to_atom(Proto ++ "_dist"),
case catch Mod:listen(Name) of
{ok, {Socket, Address, Creation}} ->
@@ -1334,33 +1346,48 @@ start_protos(Name, [Proto | Ps], Node, Ls) ->
address = Address,
accept = AcceptPid,
module = Mod },
- start_protos(Name,Ps, Node, [L|Ls]);
+ start_protos(Name,Ps, Node, [L|Ls], CleanHalt);
_ ->
Mod:close(Socket),
- error_logger:info_msg("Invalid node name: ~p~n", [Node]),
- start_protos(Name, Ps, Node, Ls)
+ S = "invalid node name: " ++ atom_to_list(Node),
+ proto_error(CleanHalt, Proto, S),
+ start_protos(Name, Ps, Node, Ls, CleanHalt)
end;
{'EXIT', {undef,_}} ->
- error_logger:info_msg("Protocol: ~tp: not supported~n", [Proto]),
- start_protos(Name,Ps, Node, Ls);
+ proto_error(CleanHalt, Proto, "not supported"),
+ start_protos(Name, Ps, Node, Ls, CleanHalt);
{'EXIT', Reason} ->
- error_logger:info_msg("Protocol: ~tp: register error: ~tp~n",
- [Proto, Reason]),
- start_protos(Name,Ps, Node, Ls);
+ register_error(CleanHalt, Proto, Reason),
+ start_protos(Name, Ps, Node, Ls, CleanHalt);
{error, duplicate_name} ->
- error_logger:info_msg("Protocol: ~tp: the name " ++
- atom_to_list(Node) ++
- " seems to be in use by another Erlang node",
- [Proto]),
- start_protos(Name,Ps, Node, Ls);
+ S = "the name " ++ atom_to_list(Node) ++
+ " seems to be in use by another Erlang node",
+ proto_error(CleanHalt, Proto, S),
+ start_protos(Name, Ps, Node, Ls, CleanHalt);
{error, Reason} ->
- error_logger:info_msg("Protocol: ~tp: register/listen error: ~tp~n",
- [Proto, Reason]),
- start_protos(Name,Ps, Node, Ls)
+ register_error(CleanHalt, Proto, Reason),
+ start_protos(Name, Ps, Node, Ls, CleanHalt)
end;
-start_protos(_,[], _Node, Ls) ->
+start_protos(_, [], _Node, Ls, _CleanHalt) ->
Ls.
+register_error(false, Proto, Reason) ->
+ S = io_lib:format("register/listen error: ~p", [Reason]),
+ proto_error(false, Proto, lists:flatten(S));
+register_error(true, Proto, Reason) ->
+ S = "Protocol '" ++ Proto ++ "': register/listen error: ",
+ erlang:display_string(S),
+ erlang:display(Reason).
+
+proto_error(CleanHalt, Proto, String) ->
+ S = "Protocol '" ++ Proto ++ "': " ++ String ++ "\n",
+ case CleanHalt of
+ false ->
+ error_logger:info_msg(S);
+ true ->
+ erlang:display_string(S)
+ end.
+
set_node(Node, Creation) when node() =:= nonode@nohost ->
case catch erlang:setnode(Node, Creation) of
true ->
diff --git a/lib/kernel/src/rpc.erl b/lib/kernel/src/rpc.erl
index d3db8eb80a..b9284487d2 100644
--- a/lib/kernel/src/rpc.erl
+++ b/lib/kernel/src/rpc.erl
@@ -357,8 +357,12 @@ do_call(Node, Request, Timeout) ->
rpc_check_t({'EXIT', {timeout,_}}) -> {badrpc, timeout};
rpc_check_t(X) -> rpc_check(X).
-rpc_check({'EXIT', {{nodedown,_},_}}) -> {badrpc, nodedown};
-rpc_check({'EXIT', X}) -> exit(X);
+rpc_check({'EXIT', {{nodedown,_},_}}) ->
+ {badrpc, nodedown};
+rpc_check({'EXIT', _}=Exit) ->
+ %% Should only happen if the rex process on the other node
+ %% died.
+ {badrpc, Exit};
rpc_check(X) -> X.
diff --git a/lib/kernel/test/application_SUITE.erl b/lib/kernel/test/application_SUITE.erl
index 0ff512bb6e..a0a7632d1b 100644
--- a/lib/kernel/test/application_SUITE.erl
+++ b/lib/kernel/test/application_SUITE.erl
@@ -40,14 +40,14 @@
shutdown_func/1, do_shutdown/1, shutdown_timeout/1, shutdown_deadlock/1]).
-define(TESTCASE, testcase_name).
--define(testcase, ?config(?TESTCASE, Config)).
+-define(testcase, proplists:get_value(?TESTCASE, Config)).
-export([init_per_testcase/2, end_per_testcase/2, start_type/0,
start_phase/0, conf_change/0]).
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(2)).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[failover, failover_comp, permissions, load,
@@ -81,21 +81,15 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(otp_2973=Case, Config) ->
- code:add_path(?config(data_dir,Config)),
- Dog = test_server:timetrap(?default_timeout),
- [{?TESTCASE, Case}, {watchdog, Dog}|Config];
+ code:add_path(proplists:get_value(data_dir,Config)),
+ [{?TESTCASE, Case}|Config];
init_per_testcase(Case, Config) ->
- Dog = test_server:timetrap(?default_timeout),
- [{?TESTCASE, Case}, {watchdog, Dog}|Config].
+ [{?TESTCASE, Case}|Config].
end_per_testcase(otp_2973, Config) ->
- code:del_path(?config(data_dir,Config)),
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ code:del_path(proplists:get_value(data_dir,Config)),
ok;
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-define(UNTIL(Seq), loop_until_true(fun() -> Seq end)).
@@ -120,10 +114,8 @@ loop_until_true(Fun) ->
%% Should be started in a CC view with:
%% erl -sname XXX -rsh ctrsh where XX not in [cp1, cp2, cp3]
%%-----------------------------------------------------------------
-failover(suite) -> [];
-failover(doc) ->
- ["Tests failover and takeover for distributed applications. Tests",
- "start, load etc implicitly."];
+%% Tests failover and takeover for distributed applications. Tests
+%% start, load etc implicitly.
failover(Conf) when is_list(Conf) ->
%% start a help process to check the start type
StPid = spawn_link(?MODULE, start_type, []),
@@ -133,14 +125,14 @@ failover(Conf) when is_list(Conf) ->
NoSyncTime = config_fun_fast(config_fo(NodeNames)),
WithSyncTime = config_fun(config_fo(NodeNames)),
- % Test [cp1, cp2, cp3]
+ %% Test [cp1, cp2, cp3]
{ok, Cp1} = start_node_config(Ncp1, NoSyncTime, Conf),
{ok, Cp2} = start_node_config(Ncp2, NoSyncTime, Conf),
{ok, Cp3} = start_node_config(Ncp3, WithSyncTime, Conf),
Cps = [Cp1, Cp2, Cp3],
wait_for_ready_net(),
- % Start app1 and make sure cp1 starts it
+ %% Start app1 and make sure cp1 starts it
{[ok,ok,ok],[]} =
rpc:multicall(Cps, application, load, [app1()]),
?UNTIL(is_loaded(app1, Cps)),
@@ -150,12 +142,12 @@ failover(Conf) when is_list(Conf) ->
false = is_started(app1, Cp2),
ok = get_start_type(#st{normal = 3}),
- % Stop cp1 and make sure cp2 starts app1
+ %% Stop cp1 and make sure cp2 starts app1
stop_node_nice(Cp1),
?UNTIL(is_started(app1, Cp2)),
ok = get_start_type(#st{normal = 3}),
- % Restart cp1 and make sure it restarts app1
+ %% Restart cp1 and make sure it restarts app1
{ok, Cp1_2} = start_node_config(Ncp1, NoSyncTime, Conf),
global:sync(),
ok = rpc:call(Cp1_2, application, load, [app1()]),
@@ -164,8 +156,8 @@ failover(Conf) when is_list(Conf) ->
?UNTIL(not is_started(app1, Cp2)),
ok = get_start_type(#st{takeover = 3}),
- % Test [{cp1, cp2}, cp3]
- % Start app_sp and make sure cp2 starts it (cp1 has more apps started)
+ %% Test [{cp1, cp2}, cp3]
+ %% Start app_sp and make sure cp2 starts it (cp1 has more apps started)
{[ok,ok,ok],[]} =
rpc:multicall([Cp1_2, Cp2, Cp3], application, load, [app_sp()]),
{[ok,ok,ok],[]} =
@@ -175,17 +167,17 @@ failover(Conf) when is_list(Conf) ->
false = is_started(app_sp, Cp3),
ok = get_start_type(#st{normal = 3}),
- % Stop cp2 and make sure cp1 starts app_sp
+ %% Stop cp2 and make sure cp1 starts app_sp
stop_node_nice(Cp2),
?UNTIL(is_started(app_sp, Cp1_2)),
ok = get_start_type(#st{failover = 3}),
- % Stop cp1 and make sure cp3 starts app_sp
+ %% Stop cp1 and make sure cp3 starts app_sp
stop_node_nice(Cp1_2),
?UNTIL(is_started(app_sp, Cp3)),
ok = get_start_type(#st{normal = 3, failover = 3}),
- % Restart cp2 and make sure it restarts app_sp
+ %% Restart cp2 and make sure it restarts app_sp
{ok, Cp2_2} = start_node_config(Ncp2, NoSyncTime, Conf),
global:sync(),
ok = rpc:call(Cp2_2, application, load, [app_sp()]),
@@ -194,16 +186,16 @@ failover(Conf) when is_list(Conf) ->
?UNTIL(not is_started(app_sp, Cp3)),
ok = get_start_type(#st{takeover = 3}),
- % Restart cp1 and make sure it doesn't restart app_sp
+ %% Restart cp1 and make sure it doesn't restart app_sp
{ok, Cp1_3} = start_node_config(Ncp1, NoSyncTime, Conf),
global:sync(),
ok = rpc:call(Cp1_3, application, load, [app_sp()]),
ok = rpc:call(Cp1_3, application, start, [app_sp, permanent]),
- test_server:sleep(500),
+ ct:sleep(500),
false = is_started(app_sp, Cp1_3),
true = is_started(app_sp, Cp2_2),
- % Force takeover to cp1
+ %% Force takeover to cp1
ok = rpc:call(Cp1_3, application, takeover, [app_sp, permanent]),
?UNTIL(is_started(app_sp, Cp1_3)),
?UNTIL(not is_started(app_sp, Cp2_2)),
@@ -225,11 +217,9 @@ failover(Conf) when is_list(Conf) ->
%% Should be started in a CC view with:
%% erl -sname XXX -rsh ctrsh where XX not in [cp1, cp2, cp3]
%%-----------------------------------------------------------------
-failover_comp(suite) -> [];
-failover_comp(doc) ->
- ["Tests failover and takeover for distributed applications. Tests",
- "start, load etc implicitly. The applications do not use start_phases,"
- "i.e the failover should be trasfered to normal start type."];
+%% Tests failover and takeover for distributed applications. Tests
+%% start, load etc implicitly. The applications do not use start_phases
+%% i.e. the failover should be transfered to normal start type.
failover_comp(Conf) when is_list(Conf) ->
%% start a help process to check the start type
StPid = spawn_link(?MODULE, start_type, []),
@@ -239,14 +229,14 @@ failover_comp(Conf) when is_list(Conf) ->
NoSyncTime = config_fun_fast(config(NodeNames)),
WithSyncTime = config_fun(config(NodeNames)),
- % Test [cp1, cp2, cp3]
+ %% Test [cp1, cp2, cp3]
{ok, Cp1} = start_node_config(Ncp1, NoSyncTime, Conf),
{ok, Cp2} = start_node_config(Ncp2, NoSyncTime, Conf),
{ok, Cp3} = start_node_config(Ncp3, WithSyncTime, Conf),
Cps = [Cp1, Cp2, Cp3],
wait_for_ready_net(),
- % Start app1 and make sure cp1 starts it
+ %% Start app1 and make sure cp1 starts it
{[ok,ok,ok],[]} =
rpc:multicall(Cps, application, load, [app1()]),
?UNTIL(is_loaded(app1, Cps)),
@@ -256,12 +246,12 @@ failover_comp(Conf) when is_list(Conf) ->
false = is_started(app1, Cp2),
ok = get_start_type(#st{normal = 3}),
- % Stop cp1 and make sure cp2 starts app1
+ %% Stop cp1 and make sure cp2 starts app1
stop_node_nice(Cp1),
?UNTIL(is_started(app1, Cp2)),
ok = get_start_type(#st{normal = 3}),
- % Restart cp1 and make sure it restarts app1
+ %% Restart cp1 and make sure it restarts app1
{ok, Cp1_2} = start_node_config(Ncp1, NoSyncTime, Conf),
global:sync(),
ok = rpc:call(Cp1_2, application, load, [app1()]),
@@ -271,8 +261,8 @@ failover_comp(Conf) when is_list(Conf) ->
?UNTIL(not is_started(app1, Cp2)),
ok = get_start_type(#st{takeover = 3}),
- % Test [{cp1, cp2}, cp3]
- % Start app3 and make sure cp2 starts it (cp1 has more apps started)
+ %% Test [{cp1, cp2}, cp3]
+ %% Start app3 and make sure cp2 starts it (cp1 has more apps started)
{[ok,ok,ok],[]} =
rpc:multicall([Cp1_2, Cp2, Cp3], application, load, [app3()]),
?UNTIL(is_loaded(app3, [Cp1_2, Cp2, Cp3])),
@@ -283,17 +273,17 @@ failover_comp(Conf) when is_list(Conf) ->
false = is_started(app3, Cp3),
ok = get_start_type(#st{normal = 3}),
- % Stop cp2 and make sure cp1 starts app3
+ %% Stop cp2 and make sure cp1 starts app3
stop_node_nice(Cp2),
?UNTIL(is_started(app3, Cp1_2)),
ok = get_start_type(#st{normal = 3}),
- % Stop cp1 and make sure cp3 starts app3
+ %% Stop cp1 and make sure cp3 starts app3
stop_node_nice(Cp1_2),
?UNTIL(is_started(app3, Cp3)),
ok = get_start_type(#st{normal = 6}),
- % Restart cp2 and make sure it restarts app3
+ %% Restart cp2 and make sure it restarts app3
{ok, Cp2_2} = start_node_config(Ncp2, NoSyncTime, Conf),
global:sync(),
ok = rpc:call(Cp2_2, application, load, [app3()]),
@@ -303,17 +293,17 @@ failover_comp(Conf) when is_list(Conf) ->
?UNTIL(not is_started(app3, Cp3)),
ok = get_start_type(#st{takeover = 3}),
- % Restart cp1 and make sure it doesn't restart app3
+ %% Restart cp1 and make sure it doesn't restart app3
{ok, Cp1_3} = start_node_config(Ncp1, NoSyncTime, Conf),
global:sync(),
ok = rpc:call(Cp1_3, application, load, [app3()]),
true = is_loaded(app3, Cp1_3),
ok = rpc:call(Cp1_3, application, start, [app3, permanent]),
- test_server:sleep(5000),
+ ct:sleep(5000),
false = is_started(app3, Cp1_3),
true = is_started(app3, Cp2_2),
- % Force takeover to cp1
+ %% Force takeover to cp1
ok = rpc:call(Cp1_3, application, takeover, [app3, permanent]),
?UNTIL(is_started(app3, Cp1_3)),
?UNTIL(not is_started(app3, Cp2_2)),
@@ -335,23 +325,21 @@ failover_comp(Conf) when is_list(Conf) ->
%% Should be started in a CC view with:
%% erl -sname XXX -rsh ctrsh where XX not in [cp1, cp2, cp3]
%%-----------------------------------------------------------------
-permissions(suite) -> [];
-permissions(doc) ->
- ["Tests permissions for distributed applications."];
+%% Tests permissions for distributed applications.
permissions(Conf) when is_list(Conf) ->
NodeNames = [Ncp1, Ncp2, Ncp3] = node_names([cp1, cp2, cp3], Conf),
NoSyncTime = config_fun_fast(config2(NodeNames)),
WithSyncTime = config_fun(config2(NodeNames)),
- % Test [cp1, cp2, cp3]
+ %% Test [cp1, cp2, cp3]
{ok, Cp1} = start_node_config(Ncp1, NoSyncTime, Conf),
{ok, Cp2} = start_node_config(Ncp2, NoSyncTime, Conf),
{ok, Cp3} = start_node_config(Ncp3, WithSyncTime, Conf),
Cps = [Cp1, Cp2, Cp3],
wait_for_ready_net(),
- % Start app1 and make sure cp1 starts it
+ %% Start app1 and make sure cp1 starts it
{[ok,ok,ok],[]} =
rpc:multicall(Cps, application, load, [app1()]),
?UNTIL(is_loaded(app1, Cps)),
@@ -360,50 +348,50 @@ permissions(Conf) when is_list(Conf) ->
?UNTIL(is_started(app1, Cp1)),
false = is_started(app1, Cp2),
- % Unpermit app1 on cp1, make sure cp2 starts it
+ %% Unpermit app1 on cp1, make sure cp2 starts it
ok = rpc:call(Cp1, application, permit, [app1, false]),
false = is_started(app1, Cp1),
true = is_started(app1, Cp2),
- % Unpermit app1 on cp2, make sure cp3 starts it
+ %% Unpermit app1 on cp2, make sure cp3 starts it
ok = rpc:call(Cp2, application, permit, [app1, false]),
false = is_started(app1, Cp1),
false = is_started(app1, Cp2),
true = is_started(app1, Cp3),
- % Permit cp2 again
+ %% Permit cp2 again
ok = rpc:call(Cp2, application, permit, [app1, true]),
false = is_started(app1, Cp1),
false = is_started(app1, Cp3),
true = is_started(app1, Cp2),
- % Start app3, make sure noone starts it
+ %% Start app3, make sure noone starts it
{[ok,ok,ok],[]} =
rpc:multicall(Cps, application, load, [app3()]),
?UNTIL(is_loaded(app3, Cps)),
{[ok,ok,ok],[]} =
rpc:multicall(Cps, application, start, [app3, permanent]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app3, Cp1),
false = is_started(app3, Cp2),
false = is_started(app3, Cp3),
- % Permit app3 on Cp3
+ %% Permit app3 on Cp3
ok = rpc:call(Cp3, application, permit, [app3, true]),
true = is_started(app3, Cp3),
- % Permit app3 on Cp2, make sure it starts it
+ %% Permit app3 on Cp2, make sure it starts it
ok = rpc:call(Cp2, application, permit, [app3, true]),
true = is_started(app3, Cp2),
false = is_started(app3, Cp3),
- % Permit app3 on Cp1, make sure it doesn't start it
+ %% Permit app3 on Cp1, make sure it doesn't start it
ok = rpc:call(Cp1, application, permit, [app3, true]),
false = is_started(app3, Cp1),
true = is_started(app3, Cp2),
false = is_started(app3, Cp3),
- % Stop Cp2, make sure Cp1 starts app3
+ %% Stop Cp2, make sure Cp1 starts app3
stop_node_nice(Cp2),
?UNTIL(is_started(app3, Cp1)),
@@ -415,15 +403,13 @@ permissions(Conf) when is_list(Conf) ->
%% Should be started in a CC view with:
%% erl -sname XXX -rsh ctrsh where XX not in [cp1, cp2, cp3]
%%-----------------------------------------------------------------
-load(suite) -> [];
-load(doc) ->
- ["Tests loading of distributed applications."];
+%% Tests loading of distributed applications.
load(Conf) when is_list(Conf) ->
NodeNames = [Ncp1, Ncp2, Ncp3] = node_names([cp1, cp2, cp3], Conf),
NoSyncTime = config_fun_fast(config3(NodeNames)),
WithSyncTime = config_fun(config3(NodeNames)),
- % Test [cp1, cp2, cp3]
+ %% Test [cp1, cp2, cp3]
{ok, Cp1} = start_node_config(Ncp1, NoSyncTime, Conf),
{ok, Cp2} = start_node_config(Ncp2, NoSyncTime, Conf),
{ok, Cp3} = start_node_config(Ncp3, WithSyncTime, Conf),
@@ -439,7 +425,7 @@ load(Conf) when is_list(Conf) ->
false = is_started(app1, Cp2),
false = is_started(app1, Cp3),
- % Load app1 with different specs and make sure we get an error
+ %% Load app1 with different specs and make sure we get an error
{[{error,_},{error,_}],[]} =
rpc:multicall([Cp1, Cp2], application, load, [app1(), d1(NodeNames)]),
{error, _} = rpc:call(Cp3, application, load, [app1(), d2(NodeNames)]),
@@ -452,15 +438,13 @@ load(Conf) when is_list(Conf) ->
%%-----------------------------------------------------------------
%% Same test as load/1, only with code path cache enabled.
%%-----------------------------------------------------------------
-load_use_cache(suite) -> [];
-load_use_cache(doc) ->
- ["Tests loading of distributed applications. Code path cache enabled."];
+%% Tests loading of distributed applications. Code path cache enabled.
load_use_cache(Conf) when is_list(Conf) ->
NodeNames = [Ncp1, Ncp2, Ncp3] = node_names([cp1, cp2, cp3], Conf),
NoSyncTime = config_fun_fast(config3(NodeNames)),
WithSyncTime = config_fun(config3(NodeNames)),
- % Test [cp1, cp2, cp3]
+ %% Test [cp1, cp2, cp3]
{ok, Cp1} = start_node_with_cache(Ncp1, NoSyncTime, Conf),
{ok, Cp2} = start_node_with_cache(Ncp2, NoSyncTime, Conf),
{ok, Cp3} = start_node_with_cache(Ncp3, WithSyncTime, Conf),
@@ -475,7 +459,7 @@ load_use_cache(Conf) when is_list(Conf) ->
?UNTIL(is_started(app1, Cp1)),
false = is_started(app1, Cp2),
- % Load app1 with different specs and make sure we get an error
+ %% Load app1 with different specs and make sure we get an error
{[{error,_},{error,_}],[]} =
rpc:multicall([Cp1, Cp2], application, load, [app1(), d1(NodeNames)]),
{error, _} = rpc:call(Cp3, application, load, [app1(), d2(NodeNames)]),
@@ -489,9 +473,7 @@ load_use_cache(Conf) when is_list(Conf) ->
%% Should be started in a CC view with:
%% erl -sname XXX -rsh ctrsh where XX not in [cp1, cp2, cp3]
%%-----------------------------------------------------------------
-start_phases(suite) -> [];
-start_phases(doc) ->
- ["Tests new start phases and failover."];
+%% Tests new start phases and failover.
start_phases(Conf) when is_list(Conf) ->
%% start a help process to check the start type
SpPid = spawn_link(?MODULE, start_phase, []),
@@ -553,17 +535,15 @@ start_phases(Conf) when is_list(Conf) ->
ok.
-script_start(doc) ->
- ["Start distributed applications from within a boot script. Test ",
- "same as failover."];
-script_start(suite) -> [];
+%% Start distributed applications from within a boot script. Test
+%% same as failover.
script_start(Conf) when is_list(Conf) ->
%% start a help process to check the start type
StPid = spawn_link(?MODULE, start_type, []),
yes = global:register_name(st_type, StPid),
- % Create the .app files and the boot script
+ %% Create the .app files and the boot script
ok = create_app(),
{{KernelVer,StdlibVer}, _} = create_script("latest"),
case is_real_system(KernelVer, StdlibVer) of
@@ -578,7 +558,7 @@ script_start(Conf) when is_list(Conf) ->
NoSyncTime = config_fun_fast(config_fo(NodeNames)),
WithSyncTime = config_fun(config_fo(NodeNames)),
- % Test [cp1, cp2, cp3]
+ %% Test [cp1, cp2, cp3]
{ok, Cp1} = start_node_boot_config(Ncp1, NoSyncTime, Conf, latest),
{ok, Cp2} = start_node_boot_config(Ncp2, NoSyncTime, Conf, latest),
{ok, Cp3} = start_node_boot_config(Ncp3, WithSyncTime, Conf, latest),
@@ -590,16 +570,16 @@ script_start(Conf) when is_list(Conf) ->
false = is_started(app1, Cp2),
ok = get_start_type(#st{normal = 9}),
- % Stop cp1 and make sure cp2 starts app1, app2 normally (no
- % start_phases defined) and app_sp as failover (start_phases
- % defined)
+ %% Stop cp1 and make sure cp2 starts app1, app2 normally (no
+ %% start_phases defined) and app_sp as failover (start_phases
+ %% defined)
stop_node_nice(Cp1),
?UNTIL(is_started(app1, Cp2)),
?UNTIL(is_started(app2, Cp2)),
?UNTIL(is_started(app_sp, Cp2)),
ok = get_start_type(#st{normal = 6, failover = 3}),
- % Restart cp1, Cp1 takesover app1 and app2
+ %% Restart cp1, Cp1 takesover app1 and app2
{ok, Cp1_2} = start_node_boot_config(Ncp1, NoSyncTime, Conf, latest),
global:sync(),
?UNTIL(is_started(app1, Cp1_2)),
@@ -610,20 +590,20 @@ script_start(Conf) when is_list(Conf) ->
?UNTIL(not is_started(app2, Cp2)),
ok = get_start_type(#st{takeover = 6}),
- % Stop cp2 and make sure cp1 starts app_sp.
+ %% Stop cp2 and make sure cp1 starts app_sp.
false = is_started(app_sp, Cp1_2),
stop_node_nice(Cp2),
?UNTIL(is_started(app_sp, Cp1_2)),
ok = get_start_type(#st{failover = 3}),
- % Stop cp1 and make sure cp3 starts app1, app2 and app_sp
+ %% Stop cp1 and make sure cp3 starts app1, app2 and app_sp
stop_node_nice(Cp1_2),
?UNTIL(is_started(app_sp, Cp3)),
?UNTIL(is_started(app1, Cp3)),
?UNTIL(is_started(app2, Cp3)),
ok = get_start_type(#st{normal = 6, failover = 3}),
- % Restart cp2 and make sure it takesover app1, app2 and app_sp
+ %% Restart cp2 and make sure it takesover app1, app2 and app_sp
{ok, Cp2_2} = start_node_boot_config(Ncp2, NoSyncTime, Conf, latest),
global:sync(),
?UNTIL(is_started(app_sp, Cp2_2)),
@@ -634,7 +614,7 @@ script_start(Conf) when is_list(Conf) ->
?UNTIL(not is_started(app2, Cp3)),
ok = get_start_type(#st{takeover = 9}),
- % Restart cp1 and make sure it takesover app1, app2
+ %% Restart cp1 and make sure it takesover app1, app2
{ok, Cp1_3} = start_node_boot_config(Ncp1, NoSyncTime, Conf, latest),
global:sync(),
?UNTIL(is_started(app1, Cp1_3)),
@@ -645,7 +625,7 @@ script_start(Conf) when is_list(Conf) ->
?UNTIL(not is_started(app2, Cp2_2)),
ok = get_start_type(#st{takeover = 6}),
- % Force takeover to cp1
+ %% Force takeover to cp1
ok = rpc:call(Cp1_3, application, takeover, [app_sp, permanent]),
?UNTIL(is_started(app_sp, Cp1_3)),
?UNTIL(not is_started(app_sp, Cp2_2)),
@@ -668,15 +648,13 @@ script_start(Conf) when is_list(Conf) ->
ok.
-permit_false_start_local(doc) ->
- ["Start local applications with permission false. Set",
- "permit true on different nodes."];
-permit_false_start_local(suite) -> [];
+%% Start local applications with permission false. Set
+%% permit true on different nodes.
permit_false_start_local(Conf) when is_list(Conf) ->
%% This configuration does not start dist_ac.
Config = write_config_file(fun config_perm/1, Conf),
- % Test [cp1, cp2, cp3]
+ %% Test [cp1, cp2, cp3]
[Ncp1, Ncp2, Ncp3] = node_names([cp1, cp2, cp3], Conf),
{ok, Cp1} = start_node(Ncp1, Config),
{ok, Cp2} = start_node(Ncp2, Config),
@@ -694,99 +672,99 @@ permit_false_start_local(Conf) when is_list(Conf) ->
{[ok,ok,ok],[]} =
rpc:multicall([Cp1, Cp2, Cp3], application, load, [app3()]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app1, Cp1),
false = is_started(app1, Cp2),
false = is_started(app1, Cp3),
- %Permit a not started application
+ %% Permit a not started application
ok = rpc:call(Cp1, application, permit, [app3, true]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app3, Cp1),
false = is_started(app3, Cp2),
false = is_started(app3, Cp3),
- %Permit a not loaded application
+ %% Permit a not loaded application
{error,{not_loaded,app_notloaded}} =
rpc:call(Cp1, application, permit, [app_notloaded, true]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app_notloaded, Cp1),
false = is_started(app_notloaded, Cp2),
false = is_started(app_notloaded, Cp3),
- %Unpermit a not started application
+ %% Unpermit a not started application
ok = rpc:call(Cp1, application, permit, [app3, false]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app3, Cp1),
false = is_started(app3, Cp2),
false = is_started(app3, Cp3),
- %Unpermit a not loaded application
+ %% Unpermit a not loaded application
{error,{not_loaded,app_notloaded}} =
rpc:call(Cp1, application, permit, [app_notloaded, false]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app_notloaded, Cp1),
false = is_started(app_notloaded, Cp2),
false = is_started(app_notloaded, Cp3),
- % Permit app1 on CP1 and make sure it is started
+ %% Permit app1 on CP1 and make sure it is started
ok = rpc:call(Cp1, application, permit, [app1, true]),
?UNTIL(is_started(app1, Cp1)),
false = is_started(app1, Cp2),
false = is_started(app1, Cp3),
- % Permit it again
+ %% Permit it again
ok = rpc:call(Cp1, application, permit, [app1, true]),
- test_server:sleep(1000),
+ ct:sleep(1000),
true = is_started(app1, Cp1),
false = is_started(app1, Cp2),
false = is_started(app1, Cp3),
- % Permit app2 on CP1 and make sure it is started
+ %% Permit app2 on CP1 and make sure it is started
ok = rpc:call(Cp1, application, permit, [app2, true]),
?UNTIL(is_started(app2, Cp1)),
false = is_started(app2, Cp2),
false = is_started(app2, Cp3),
- % Permit app1 on CP2 and make sure it is started
+ %% Permit app1 on CP2 and make sure it is started
ok = rpc:call(Cp2, application, permit, [app1, true]),
?UNTIL(is_started(app1, Cp2)),
true = is_started(app1, Cp1),
false = is_started(app1, Cp3),
- % Unpermit app1 on CP1 and make sure it is stopped
+ %% Unpermit app1 on CP1 and make sure it is stopped
ok = rpc:call(Cp1, application, permit, [app1, false]),
?UNTIL(false =:= is_started(app1, Cp1)),
true = is_started(app1, Cp2),
false = is_started(app1, Cp3),
- % Unpermit it agin
+ %% Unpermit it agin
ok = rpc:call(Cp1, application, permit, [app1, false]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app1, Cp1),
true = is_started(app1, Cp2),
false = is_started(app1, Cp3),
- % Permit app1 on CP1 and make sure it is started
+ %% Permit app1 on CP1 and make sure it is started
ok = rpc:call(Cp1, application, permit, [app1, true]),
?UNTIL(is_started(app1, Cp1)),
true = is_started(app1, Cp2),
false = is_started(app1, Cp3),
- % Unpermit app1 on CP1 and make sure it is stopped
+ %% Unpermit app1 on CP1 and make sure it is stopped
ok = rpc:call(Cp1, application, permit, [app1, false]),
?UNTIL(false =:= is_started(app1, Cp1)),
true = is_started(app1, Cp2),
false = is_started(app1, Cp3),
- % Unpermit app1 on CP2 and make sure it is stopped
+ %% Unpermit app1 on CP2 and make sure it is stopped
ok = rpc:call(Cp2, application, permit, [app1, false]),
- test_server:sleep(1000),
+ ct:sleep(1000),
?UNTIL(false =:= is_started(app1, Cp2)),
false = is_started(app1, Cp1),
false = is_started(app1, Cp3),
- % Unpermit app2 on CP1 and make sure it is stopped
+ %% Unpermit app2 on CP1 and make sure it is stopped
ok = rpc:call(Cp1, application, permit, [app2, false]),
?UNTIL(false =:= is_started(app2, Cp2)),
false = is_started(app2, Cp1),
@@ -798,16 +776,14 @@ permit_false_start_local(Conf) when is_list(Conf) ->
ok.
-permit_false_start_dist(doc) ->
- ["Start distributed applications with permission false. Set",
- "permit true on different nodes."];
-permit_false_start_dist(suite) -> [];
+%% Start distributed applications with permission false. Set
+%% permit true on different nodes.
permit_false_start_dist(Conf) when is_list(Conf) ->
NodeNames = [Ncp1, Ncp2, Ncp3] = node_names([cp1, cp2, cp3], Conf),
NoSyncTime = config_fun_fast(config_perm2(NodeNames)),
WithSyncTime = config_fun(config_perm2(NodeNames)),
- % Test [cp1, cp2, cp3]
+ %% Test [cp1, cp2, cp3]
{ok, Cp1} = start_node_config(Ncp1, NoSyncTime, Conf),
{ok, Cp2} = start_node_config(Ncp2, NoSyncTime, Conf),
{ok, Cp3} = start_node_config(Ncp3, WithSyncTime, Conf),
@@ -822,36 +798,36 @@ permit_false_start_dist(Conf) when is_list(Conf) ->
{[ok,ok,ok],[]} =
rpc:multicall(Cps, application, load, [app2()]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app1, Cp1),
false = is_started(app1, Cp2),
false = is_started(app1, Cp3),
- %Permit a not started application
+ %% Permit a not started application
ok = rpc:call(Cp1, application, permit, [app2, true]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app2, Cp1),
false = is_started(app2, Cp2),
false = is_started(app2, Cp3),
- %Permit a not loaded application
+ %% Permit a not loaded application
{error,{not_loaded,app3}} =
rpc:call(Cp1, application, permit, [app3, true]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app3, Cp1),
false = is_started(app3, Cp2),
false = is_started(app3, Cp3),
- %Unpermit a not started application
+ %% Unpermit a not started application
ok = rpc:call(Cp1, application, permit, [app2, false]),
{[ok,ok,ok],[]} =
rpc:multicall([Cp1, Cp2, Cp3], application, start, [app2, permanent]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app2, Cp1),
false = is_started(app2, Cp2),
false = is_started(app2, Cp3),
- %Unpermit a not loaded application
+ %% Unpermit a not loaded application
{error,{not_loaded,app3}} =
rpc:call(Cp1, application, permit, [app3, false]),
{[ok,ok,ok],[]} =
@@ -859,42 +835,42 @@ permit_false_start_dist(Conf) when is_list(Conf) ->
?UNTIL(is_loaded(app3, Cps)),
{[ok,ok,ok],[]} =
rpc:multicall(Cps, application, start, [app3, permanent]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app3, Cp1),
false = is_started(app3, Cp2),
false = is_started(app3, Cp3),
- % Permit app1 on CP1 and make sure it is started
+ %% Permit app1 on CP1 and make sure it is started
ok = rpc:call(Cp1, application, permit, [app1, true]),
?UNTIL(is_started(app1, Cp1)),
false = is_started(app1, Cp2),
false = is_started(app1, Cp3),
- % Permit it again
+ %% Permit it again
ok = rpc:call(Cp1, application, permit, [app1, true]),
?UNTIL(is_started(app1, Cp1)),
false = is_started(app1, Cp2),
false = is_started(app1, Cp3),
- % Permit app2 on CP1 and make sure it is started
+ %% Permit app2 on CP1 and make sure it is started
ok = rpc:call(Cp1, application, permit, [app2, true]),
?UNTIL(is_started(app2, Cp1)),
false = is_started(app2, Cp2),
false = is_started(app2, Cp3),
- % Permit app1 on CP2 and make sure it is not started
+ %% Permit app1 on CP2 and make sure it is not started
ok = rpc:call(Cp2, application, permit, [app1, true]),
- test_server:sleep(1000),
+ ct:sleep(1000),
true = is_started(app1, Cp1),
false = is_started(app1, Cp2),
false = is_started(app1, Cp3),
- % Crash CP1 and make sure app1, but not app2, is started on CP2
+ %% Crash CP1 and make sure app1, but not app2, is started on CP2
stop_node_nice(Cp1),
?UNTIL(is_started(app1, Cp2)),
false = is_started(app2, Cp2),
- % Restart CP1 again, check nothing is running on it
+ %% Restart CP1 again, check nothing is running on it
{ok, Cp1_2} = start_node_config(Ncp1, NoSyncTime, Conf),
global:sync(),
ok = rpc:call(Cp1_2, application, load, [app1()]),
@@ -909,19 +885,19 @@ permit_false_start_dist(Conf) when is_list(Conf) ->
false = is_started(app1, Cp1_2),
false = is_started(app2, Cp1_2),
- % Permit app3 on CP3 and make sure it is started
+ %% Permit app3 on CP3 and make sure it is started
ok = rpc:call(Cp3, application, permit, [app3, true]),
?UNTIL(is_started(app3, Cp3)),
false = is_started(app3, Cp1_2),
false = is_started(app3, Cp2),
- % Permit app3 on CP1 and make sure it is moved there from CP3
+ %% Permit app3 on CP1 and make sure it is moved there from CP3
ok = rpc:call(Cp1_2, application, permit, [app3, true]),
?UNTIL(is_started(app3, Cp1_2)),
false = is_started(app3, Cp2),
false = is_started(app3, Cp3),
- % Unpermit app3 on CP3 and CP1 and make sure it is stopped
+ %% Unpermit app3 on CP3 and CP1 and make sure it is stopped
ok = rpc:call(Cp3, application, permit, [app3, false]),
ok = rpc:call(Cp1_2, application, permit, [app3, false]),
?UNTIL(false =:= is_started(app3, Cp1_2)),
@@ -933,27 +909,25 @@ permit_false_start_dist(Conf) when is_list(Conf) ->
stop_node_nice(Cp3),
ok.
-nodedown_start(doc) ->
- ["app1 distributed as [cp1, cp2]. Call application:start(app1) on",
- "cp2, but not on cp1. Kill cp1. Make sure app1 is started on cp2."];
-nodedown_start(suite) -> [];
+%% app1 distributed as [cp1, cp2]. Call application:start(app1) on
+%% cp2, but not on cp1. Kill cp1. Make sure app1 is started on cp2.
nodedown_start(Conf) when is_list(Conf) ->
NodeNames = [Ncp1, Ncp2] = node_names([cp1, cp2], Conf),
NoSyncTime = config_fun_fast(config4(NodeNames)),
WithSyncTime = config_fun(config4(NodeNames)),
- % Test [cp1, cp2]
+ %% Test [cp1, cp2]
{ok, Cp1} = start_node_config(Ncp1, NoSyncTime, Conf),
{ok, Cp2} = start_node_config(Ncp2, WithSyncTime, Conf),
wait_for_ready_net(),
- % Start app1 and make sure cp1 starts it
+ %% Start app1 and make sure cp1 starts it
{[ok,ok],[]} =
rpc:multicall([Cp1, Cp2], application, load, [app1()]),
_ = rpc:cast(Cp2, application, start, [app1, permanent]),
- test_server:sleep(1000),
+ ct:sleep(1000),
- % Crash CP1 and make sure app1 is started on CP2
+ %% Crash CP1 and make sure app1 is started on CP2
stop_node_nice(Cp1),
?UNTIL(is_started(app1, Cp2)),
@@ -961,8 +935,7 @@ nodedown_start(Conf) when is_list(Conf) ->
ok.
-ensure_started(suite) -> [];
-ensure_started(doc) -> ["Test application:ensure_started/1."];
+%% Test application:ensure_started/1.
ensure_started(_Conf) ->
{ok, Fd} = file:open("app1.app", [write]),
@@ -981,8 +954,7 @@ ensure_started(_Conf) ->
ok = application:unload(app1),
ok.
-ensure_all_started(suite) -> [];
-ensure_all_started(doc) -> ["Test application:ensure_all_started/1-2."];
+%% Test application:ensure_all_started/1-2.
ensure_all_started(_Conf) ->
{ok, Fd1} = file:open("app1.app", [write]),
@@ -1069,11 +1041,9 @@ ensure_all_started(_Conf) ->
%% Ticket: OTP-1586
%% Slogan: recursive load of applications fails
%%-----------------------------------------------------------------
-otp_1586(suite) -> [];
-otp_1586(doc) ->
- ["Test recursive load of applications."];
+%% Test recursive load of applications.
otp_1586(Conf) when is_list(Conf) ->
- Dir = ?config(priv_dir,Conf),
+ Dir = proplists:get_value(priv_dir,Conf),
{ok, Fd} = file:open(filename:join(Dir, "app5.app"), [write]),
w_app5(Fd),
file:close(Fd),
@@ -1090,21 +1060,19 @@ otp_1586(Conf) when is_list(Conf) ->
%% Slogan: start of distrib apps fails when the nodes start
%% simultaneously
%%-----------------------------------------------------------------
-otp_2078(suite) -> [];
-otp_2078(doc) ->
- ["Test start of distrib apps fails when the nodes start simultaneously."];
+%% Test start of distrib apps fails when the nodes start simultaneously.
otp_2078(Conf) when is_list(Conf) ->
NodeNames = [Ncp1, Ncp2] = node_names([cp1, cp2], Conf),
NoSyncTime = config_fun_fast(config4(NodeNames)),
WithSyncTime = config_fun(config4(NodeNames)),
- % Test [cp1, cp2]
+ %% Test [cp1, cp2]
{ok, Cp1} = start_node_config(Ncp1, NoSyncTime, Conf),
{ok, Cp2} = start_node_config(Ncp2, WithSyncTime, Conf),
Cps = [Cp1, Cp2],
wait_for_ready_net(),
- % Start app1 and make sure cp1 starts it
+ %% Start app1 and make sure cp1 starts it
{[ok,ok],[]} =
rpc:multicall(Cps, application, load, [app1()]),
?UNTIL(is_loaded(app1, Cps)),
@@ -1112,8 +1080,8 @@ otp_2078(Conf) when is_list(Conf) ->
?UNTIL(is_started(app1, Cp1)),
false = is_started(app1, Cp2),
- % Start app1 on cp2; make sure it works (the bug was that this start
- % returned error)
+ %% Start app1 on cp2; make sure it works (the bug was that this start
+ %% returned error)
ok = rpc:call(Cp2, application, start, [app1, permanent]),
true = is_started(app1, Cp1),
false = is_started(app1, Cp2),
@@ -1122,15 +1090,13 @@ otp_2078(Conf) when is_list(Conf) ->
stop_node_nice(Cp2),
ok.
-otp_2012(suite) -> [];
-otp_2012(doc) ->
- ["Test change of configuration parameters without changing code."];
+%% Test change of configuration parameters without changing code.
otp_2012(Conf) when is_list(Conf) ->
%% start a help process to check the config change
CcPid = spawn_link(?MODULE, conf_change, []),
yes = global:register_name(conf_change, CcPid),
- % Write a .app file
+ %% Write a .app file
{ok, Fd} = file:open("app1.app", [write]),
w_app1(Fd),
file:close(Fd),
@@ -1138,7 +1104,7 @@ otp_2012(Conf) when is_list(Conf) ->
w_app1(Fd2),
file:close(Fd2),
- % Start app1
+ %% Start app1
ok = application:load(app1()),
ok = application:start(app1, permanent),
@@ -1149,7 +1115,7 @@ otp_2012(Conf) when is_list(Conf) ->
ok = application_controller:config_change(EnvBefore),
ok = get_conf_change([{[], [{new1, hi}, {new2, moi}], []}]),
- % Start app2
+ %% Start app2
ok = application:load(app2()),
ok = application:start(app2, permanent),
@@ -1173,11 +1139,9 @@ otp_2012(Conf) when is_list(Conf) ->
%% Ticket: OTP-2718
%% Slogan: transient app which fails during start is ignored
%%-----------------------------------------------------------------
-otp_2718(suite) -> [];
-otp_2718(doc) ->
- ["Test fail of transient app at start."];
+%% Test fail of transient app at start.
otp_2718(Conf) when is_list(Conf) ->
- {ok, Cp1} = start_node_args(cp1, "-pa " ++ ?config(data_dir,Conf)),
+ {ok, Cp1} = start_node_args(cp1, "-pa " ++ proplists:get_value(data_dir,Conf)),
wait_for_ready_net(),
%% normal exit from the application
@@ -1185,7 +1149,7 @@ otp_2718(Conf) when is_list(Conf) ->
?UNTIL(is_loaded(trans_normal, Cp1)),
{error, {{'EXIT',normal},_}} =
rpc:call(Cp1, application, start, [trans_normal, transient]),
- test_server:sleep(2000),
+ ct:sleep(2000),
false = is_started(trans_normal, Cp1),
%% abnormal exit from the application
@@ -1193,7 +1157,7 @@ otp_2718(Conf) when is_list(Conf) ->
{error, {bad_return,{{trans_abnormal_sup,start,[normal,[]]},
{'EXIT',abnormal}}}} =
rpc:call(Cp1, application, start, [trans_abnormal, transient]),
- test_server:sleep(3000),
+ ct:sleep(3000),
{badrpc,nodedown} = which_applications(Cp1),
ok.
@@ -1201,11 +1165,9 @@ otp_2718(Conf) when is_list(Conf) ->
%% Ticket: OTP-2973
%% Slogan: application:start does not test if an appl is already starting...
%%-----------------------------------------------------------------
-otp_2973(suite) -> [];
-otp_2973(doc) ->
- ["Test of two processes simultanously starting the same application."];
+%% Test of two processes simultanously starting the same application.
otp_2973(Conf) when is_list(Conf) ->
- % Write a .app file
+ %% Write a .app file
{ok, Fd} = file:open("app0.app", [write]),
w_app(Fd, app0()),
file:close(Fd),
@@ -1222,14 +1184,14 @@ otp_2973(Conf) when is_list(Conf) ->
{Pid2, res, Res2x} ->
{Res1x, Res2x}
after 2000 ->
- test_server:fail(timeout_pid2)
+ ct:fail(timeout_pid2)
end;
{Pid2, res, Res2x} ->
receive
{Pid1, res, Res1x} ->
{Res1x, Res2x}
after 2000 ->
- test_server:fail(timeout_pid1)
+ ct:fail(timeout_pid1)
end
end,
@@ -1243,11 +1205,11 @@ otp_2973(Conf) when is_list(Conf) ->
_ ->
Txt = io_lib:format("Illegal results from start: ~p ~p ",
[Res1, Res2]),
- test_server:fail(lists:flatten(Txt))
+ ct:fail(lists:flatten(Txt))
end,
- % Write a .app file
+ %% Write a .app file
{ok, Fda} = file:open("app_start_error.app", [write]),
w_app_start_error(Fda),
file:close(Fda),
@@ -1261,14 +1223,14 @@ otp_2973(Conf) when is_list(Conf) ->
{Pid2, res, Res2y} ->
{Res1y, Res2y}
after 2000 ->
- test_server:fail(timeout_pid2)
+ ct:fail(timeout_pid2)
end;
{Pid2, res, Res2y} ->
receive
{Pid1, res, Res1y} ->
{Res1y, Res2y}
after 2000 ->
- test_server:fail(timeout_pid1)
+ ct:fail(timeout_pid1)
end
end,
@@ -1278,7 +1240,7 @@ otp_2973(Conf) when is_list(Conf) ->
ok;
_ ->
Txta = io_lib:format("Illegal results from start ~p ~p ",[Res1a, Res2a]),
- test_server:fail(lists:flatten(Txta))
+ ct:fail(lists:flatten(Txta))
end,
ok.
@@ -1289,36 +1251,34 @@ otp_2973(Conf) when is_list(Conf) ->
%% Ticket: OTP-3184
%% Slogan: crash the node if permanent appl has illegal env parameter values
%%-----------------------------------------------------------------
-otp_3184(suite) -> [];
-otp_3184(doc) ->
- ["When a distributed application is started the permit flag is checked "
- "that the permit flag is not changed during the start. "
- "Te check must only be made if the application is started on the own node"];
+%% When a distributed application is started the permit flag is checked
+%% that the permit flag is not changed during the start.
+%% The check must only be made if the application is started on the own node.
otp_3184(Conf) when is_list(Conf) ->
NodeNames = [Ncp1, Ncp2] = node_names([cp1, cp2], Conf),
NoSyncTime = config_fun_fast(config3184(NodeNames)),
WithSyncTime = config_fun(config3184(NodeNames)),
- % Test [cp1, cp2]
+ %% Test [cp1, cp2]
{ok, Cp1} = start_node_config(Ncp1, NoSyncTime, Conf),
{ok, Cp2} = start_node_config(Ncp2, WithSyncTime, Conf),
wait_for_ready_net(),
- % Start app1 and make sure it is not started
+ %% Start app1 and make sure it is not started
{[ok,ok],[]} =
rpc:multicall([Cp1, Cp2], application, load, [app1()]),
- test_server:sleep(3000),
+ ct:sleep(3000),
false = is_started(app1, Cp1),
false = is_started(app1, Cp2),
- % Start app1 on cp1
+ %% Start app1 on cp1
ok = rpc:call(Cp1, application, permit, [app1, true]),
ok = rpc:call(Cp1, application, start, [app1, permanent]),
ok = rpc:call(Cp2, application, start, [app1, permanent]),
?UNTIL(is_started(app1, Cp1)),
false = is_started(app1, Cp2),
- % Check that the application is marked as running in application_controller
+ %% Check that the application is marked as running in application_controller
X = rpc:call(Cp1, application_controller, info, []),
{value, {running, Xrunning}} = lists:keysearch(running, 1, X),
{value, Xapp1} = lists:keysearch(app1, 1, Xrunning),
@@ -1337,15 +1297,13 @@ otp_3184(Conf) when is_list(Conf) ->
%% Ticket: OTP-3002
%% Slogan: crash the node if permanent appl has illegal env parameter values
%%-----------------------------------------------------------------
-otp_3002(suite) -> [];
-otp_3002(doc) ->
- ["crash the node if permanent appl has illegal env parameter values."];
+%% crash the node if permanent appl has illegal env parameter values.
otp_3002(Conf) when is_list(Conf) ->
- % Create the boot script
+ %% Create the boot script
{{KernelVer,StdlibVer}, {LatestDir, LatestName}} =
create_script_3002("script_3002"),
- ?t:format(0, "LatestDir = ~p~n", [LatestDir]),
- ?t:format(0, "LatestName = ~p~n", [LatestName]),
+ ct:pal(?HI_VERBOSITY, "LatestDir = ~p~n", [LatestDir]),
+ ct:pal(?HI_VERBOSITY, "LatestName = ~p~n", [LatestName]),
case is_real_system(KernelVer, StdlibVer) of
true ->
@@ -1371,10 +1329,9 @@ otp_3002(Conf) when is_list(Conf) ->
%% when it received dist_ac_app_stopped).
%%-----------------------------------------------------------------
-otp_4066(suite) -> [];
-otp_4066(doc) -> ["Check that application stop don't cause dist_ac crash"];
+%% Check that application stop don't cause dist_ac crash.
otp_4066(Conf) when is_list(Conf) ->
- % Write config files
+ %% Write config files
[Ncp1, Ncp2] = node_names([cp1, cp2], Conf),
Host = from($@, atom_to_list(node())),
Cp1 = list_to_atom(Ncp1 ++ "@" ++ Host),
@@ -1382,12 +1339,12 @@ otp_4066(Conf) when is_list(Conf) ->
AllNodes = [Cp1, Cp2],
App1Nodes = {app1, AllNodes},
- Dir = ?config(priv_dir,Conf),
+ Dir = proplists:get_value(priv_dir,Conf),
{ok, FdC} = file:open(filename:join(Dir, "otp_4066.config"), [write]),
write_config(FdC, config_4066(AllNodes, 5000, [App1Nodes])),
file:close(FdC),
- % Write the app1.app file
+ %% Write the app1.app file
{ok, FdA12} = file:open(filename:join(Dir, "app1.app"), [write]),
w_app1(FdA12),
file:close(FdA12),
@@ -1402,29 +1359,29 @@ otp_4066(Conf) when is_list(Conf) ->
ok = rpc:call(Cp1, application, start, [app1]),
wait_until_started(app1, [Cp1]),
- test_server:format("--- App1 started at Cp1 ---~n", []),
+ io:format("--- App1 started at Cp1 ---~n", []),
print_dac_state(AllNodes),
- % Cp2 previously crashed on this stop
+ %% Cp2 previously crashed on this stop
ok = rpc:call(Cp1, application, stop, [app1]),
wait_until_stopped(app1, [Cp1]),
- test_server:format("--- App1 stopped at Cp1 ---~n", []),
+ io:format("--- App1 stopped at Cp1 ---~n", []),
print_dac_state(AllNodes),
ok = rpc:call(Cp1, application, start, [app1]),
wait_until_started(app1, [Cp1]),
- test_server:format("--- App1 started at Cp1 ---~n", []),
+ io:format("--- App1 started at Cp1 ---~n", []),
print_dac_state(AllNodes),
ok = rpc:call(Cp2, application, load, [app1, App1Nodes]),
ok = rpc:call(Cp2, application, start, [app1]),
- test_server:format("--- App1 started at Cp2 ---~n", []),
+ io:format("--- App1 started at Cp2 ---~n", []),
print_dac_state(AllNodes),
stop_node_nice(Cp1),
wait_until_started(app1, [Cp2]),
- test_server:format("--- Cp1 crashed; failover to Cp2 ---~n", []),
+ io:format("--- Cp1 crashed; failover to Cp2 ---~n", []),
print_dac_state(Cp2),
stop_node_nice(Cp2),
@@ -1440,7 +1397,7 @@ write_config(Fd, Config) ->
print_dac_state(Node) when is_atom(Node) ->
State = gen_server:call({dist_ac, Node}, info),
- test_server:format(" * dist_ac state on node ~p:~n ~p~n",
+ io:format(" * dist_ac state on node ~p:~n ~p~n",
[Node, State]);
print_dac_state(Nodes) when is_list(Nodes) ->
lists:foreach(fun (N) -> print_dac_state(N) end, Nodes).
@@ -1450,9 +1407,7 @@ print_dac_state(Nodes) when is_list(Nodes) ->
%% Ticket: OTP-4227
%% Slogan: Bad return value from application.
%%-----------------------------------------------------------------
-otp_4227(suite) -> [];
-otp_4227(doc) ->
- ["Test start of depending app when required app crashed."];
+%% Test start of depending app when required app crashed.
otp_4227(Conf) when is_list(Conf) ->
NodeNames = [Ncp1, Ncp2] = node_names([cp1, cp2], Conf),
NoSyncTime = config_fun_fast(config_4227(NodeNames)),
@@ -1475,11 +1430,11 @@ otp_4227(Conf) when is_list(Conf) ->
%% Start app9 and brutally kill it, then try to start app10
ok = rpc:call(Cp1, application, start, [app9]),
- test_server:sleep(1000),
+ ct:sleep(1000),
Pid9 = rpc:call(Cp1, erlang, whereis, [ch_sup19]),
true = erlang:is_pid(Pid9),
true = erlang:exit(Pid9, kill),
- test_server:sleep(1000),
+ ct:sleep(1000),
%% This gave {error, no_report} before the patch
{error, {not_running, app9}} =
@@ -1518,7 +1473,7 @@ otp_5363(Conf) when is_list(Conf) ->
%% the code, but only that the correct processes ARE killed.
OldPath = code:get_path(),
- code:add_patha(?config(data_dir,Conf)),
+ code:add_patha(proplists:get_value(data_dir,Conf)),
try
ok = application:load(app_group_leader()),
ok = application:start(group_leader),
@@ -1532,7 +1487,7 @@ otp_5363(Conf) when is_list(Conf) ->
undefined = whereis(nisse);
Bad ->
io:format("~p\n", [Bad]),
- ?t:fail()
+ ct:fail(failed)
end
after
code:set_path(OldPath)
@@ -1543,14 +1498,12 @@ otp_5363(Conf) when is_list(Conf) ->
%% Ticket: OTP-5606
%% Slogan: Problems with starting a distributed application
%%-----------------------------------------------------------------
-otp_5606(suite) -> [];
-otp_5606(doc) ->
- ["Test of several processes simultanously starting the same "
- "distributed application."];
+%% Test of several processes simultanously starting the same
+%% distributed application.
otp_5606(Conf) when is_list(Conf) ->
%% Write a config file
- Dir = ?config(priv_dir, Conf),
+ Dir = proplists:get_value(priv_dir, Conf),
{ok, Fd} = file:open(filename:join(Dir, "sys.config"), [write]),
NodeNames = [Ncp1, Ncp2] = node_names([cp1, cp2], Conf),
(config4(NodeNames))(Fd, 10000),
@@ -1586,7 +1539,7 @@ otp_5606(Conf) when is_list(Conf) ->
[Res1, Res2, Res3, Res4] ->
Txt = io_lib:format("Illegal results from start ~p ~p ~p ~p",
[Res1, Res2, Res3, Res4]),
- test_server:fail(lists:flatten(Txt))
+ ct:fail(lists:flatten(Txt))
end,
{error, {already_started, app1}} =
@@ -1601,7 +1554,7 @@ otp_5606_loop(ResL) when length(ResL)<4 ->
{_Pid, Res} ->
otp_5606_loop([Res|ResL])
after 5000 ->
- test_server:fail(timeout_waiting_for_res)
+ ct:fail(timeout_waiting_for_res)
end;
otp_5606_loop(ResL) ->
ResL.
@@ -1613,9 +1566,7 @@ loop5606(Pid) ->
Pid ! {self(), Res}
end.
-get_env(suite) -> [];
-get_env(doc) ->
- ["Tests get_env/* functions"];
+%% Tests get_env/* functions.
get_env(Conf) when is_list(Conf) ->
{ok, _} = application:get_env(kernel, error_logger),
undefined = application:get_env(undefined_app, a),
@@ -1627,14 +1578,12 @@ get_env(Conf) when is_list(Conf) ->
%% Should be started in a CC view with:
%% erl -sname XXX -rsh ctrsh where XX not in [cp1, cp2, cp3]
%%-----------------------------------------------------------------
-get_key(suite) -> [];
-get_key(doc) ->
- ["Tests read the .app keys."];
+%% Tests read the .app keys.
get_key(Conf) when is_list(Conf) ->
NodeNames = [Ncp1, _Ncp2, _Ncp3] = node_names([cp1, cp2, cp3], Conf),
WithSyncTime = config_fun(config_inc(NodeNames)),
- % Test [cp1, cp2, cp3]
+ %% Test [cp1, cp2, cp3]
{ok, Cp1} = start_node_config(Ncp1, WithSyncTime, Conf),
ok = rpc:call(Cp1, application, load, [appinc(), d3(NodeNames)]),
@@ -1731,8 +1680,7 @@ get_key(Conf) when is_list(Conf) ->
%%% Testing of change of distributed parameter.
%%%-----------------------------------------------------------------
-distr_changed_tc1(suite) -> [];
-distr_changed_tc1(doc) -> ["Test change of distributed parameter."];
+%% Test change of distributed parameter.
distr_changed_tc1(Conf) when is_list(Conf) ->
{OldKernel, OldEnv, {Cp1, Cp2, Cp3}, {_Ncp1, _Ncp2, _Ncp3}, _Config2} =
@@ -1757,7 +1705,7 @@ distr_changed_tc1(Conf) when is_list(Conf) ->
rpc:multicall([Cp1, Cp2, Cp3],
application_controller, config_change, [OldEnv]),
- test_server:sleep(7000),
+ ct:sleep(7000),
DcInfo1 = rpc:call(Cp1, dist_ac, info, []),
DcInfo2 = rpc:call(Cp2, dist_ac, info, []),
@@ -1778,7 +1726,7 @@ distr_changed_tc1(Conf) when is_list(Conf) ->
ok;
EWa1 ->
X1 = io_lib:format("distribution error: Cp1 ~p ",[EWa1]),
- test_server:fail(lists:flatten(X1))
+ ct:fail(lists:flatten(X1))
end,
case lists:sort(Wa2) of
@@ -1786,7 +1734,7 @@ distr_changed_tc1(Conf) when is_list(Conf) ->
ok;
EWa2 ->
X2 = io_lib:format("distribution error: Cp2 ~p ",[EWa2]),
- test_server:fail(lists:flatten(X2))
+ ct:fail(lists:flatten(X2))
end,
case lists:sort(Wa3) of
@@ -1794,7 +1742,7 @@ distr_changed_tc1(Conf) when is_list(Conf) ->
ok;
EWa3 ->
X3 = io_lib:format("distribution error: Cp3 ~p ",[EWa3]),
- test_server:fail(lists:flatten(X3))
+ ct:fail(lists:flatten(X3))
end,
DcInfo1n = rpc:call(Cp1, dist_ac, info, []),
@@ -1816,9 +1764,7 @@ distr_changed_tc1(Conf) when is_list(Conf) ->
ok.
-distr_changed_tc2(suite) -> [];
-distr_changed_tc2(doc) -> ["Test change of distributed parameter, "
- "move appls by crashing a node."];
+%% Test change of distributed parameter, move appls by crashing a node.
distr_changed_tc2(Conf) when is_list(Conf) ->
{OldKernel, OldEnv, {Cp1, Cp2, Cp3}, {Ncp1, _Ncp2, _Ncp3}, Config2} =
@@ -1843,21 +1789,16 @@ distr_changed_tc2(Conf) when is_list(Conf) ->
rpc:multicall([Cp1, Cp2, Cp3],
application_controller, config_change, [OldEnv]),
- test_server:sleep(4000),
+ ct:sleep(4000),
stop_node_nice(Cp1),
- test_server:sleep(10000),
+ ct:sleep(10000),
-% _DcInfo1 = rpc:call(Cp1, dist_ac, info, []),
_DcInfo2 = rpc:call(Cp2, dist_ac, info, []),
_DcInfo3 = rpc:call(Cp3, dist_ac, info, []),
-% ?t:format(0,"#### DcInfo1 ~n~p~n",[_DcInfo1]),
-% DcWa1 = which_applications(Cp1),
DcWa2 = which_applications(Cp2),
DcWa3 = which_applications(Cp3),
-% Wa1 = lists:foldl(fun({A1, _N1, _V1}, AccIn) -> [A1 | AccIn] end,
-% [], DcWa1),
Wa2 = lists:foldl(fun({A2, _N2, _V2}, AccIn) -> [A2 | AccIn] end,
[], DcWa2),
Wa3 = lists:foldl(fun({A3, _N3, _V3}, AccIn) -> [A3 | AccIn] end,
@@ -1869,7 +1810,7 @@ distr_changed_tc2(Conf) when is_list(Conf) ->
ok;
EWa2 ->
X2 = io_lib:format("distribution error: Cp2 ~p ",[EWa2]),
- test_server:fail(lists:flatten(X2))
+ ct:fail(lists:flatten(X2))
end,
case lists:sort(Wa3) of
@@ -1877,12 +1818,12 @@ distr_changed_tc2(Conf) when is_list(Conf) ->
ok;
EWa3 ->
X3 = io_lib:format("distribution error: Cp3 ~p ",[EWa3]),
- test_server:fail(lists:flatten(X3))
+ ct:fail(lists:flatten(X3))
end,
{ok, Cp1} = start_node_boot(Ncp1, Config2, dc),
- test_server:sleep(10000),
+ ct:sleep(10000),
_DcInfo1rs = rpc:call(Cp1, dist_ac, info, []),
_DcInfo2rs = rpc:call(Cp2, dist_ac, info, []),
@@ -1904,7 +1845,7 @@ distr_changed_tc2(Conf) when is_list(Conf) ->
ok;
EWa1rs ->
X1rs = io_lib:format("distribution error: Cp1 ~p ",[EWa1rs]),
- test_server:fail(lists:flatten(X1rs))
+ ct:fail(lists:flatten(X1rs))
end,
case lists:sort(Wa2rs) of
@@ -1912,7 +1853,7 @@ distr_changed_tc2(Conf) when is_list(Conf) ->
ok;
EWa2rs ->
X2rs = io_lib:format("distribution error: Cp2 ~p ",[EWa2rs]),
- test_server:fail(lists:flatten(X2rs))
+ ct:fail(lists:flatten(X2rs))
end,
case lists:sort(Wa3rs) of
@@ -1920,7 +1861,7 @@ distr_changed_tc2(Conf) when is_list(Conf) ->
ok;
EWa3rs ->
X3rs = io_lib:format("distribution error: Cp3 ~p ",[EWa3rs]),
- test_server:fail(lists:flatten(X3rs))
+ ct:fail(lists:flatten(X3rs))
end,
@@ -1939,15 +1880,12 @@ distr_changed_tc2(Conf) when is_list(Conf) ->
%%%-----------------------------------------------------------------
%%% Testing of application configuration change
%%%-----------------------------------------------------------------
-config_change(suite) ->
- [];
-config_change(doc) ->
- ["Test change of application configuration"];
+%% Test change of application configuration.
config_change(Conf) when is_list(Conf) ->
%% Change to data_dir
{ok, CWD} = file:get_cwd(),
- DataDir = ?config(data_dir, Conf),
+ DataDir = proplists:get_value(data_dir, Conf),
ok = file:set_cwd(DataDir),
%% Find out application data from boot script
@@ -2009,10 +1947,7 @@ get_appls([], Res) ->
Res.
-persistent_env(suite) ->
- [];
-persistent_env(doc) ->
- ["Test set_env/4 and unset_env/3 with persistent true"];
+%% Test set_env/4 and unset_env/3 with persistent true.
persistent_env(Conf) when is_list(Conf) ->
ok = application:set_env(appinc, own2, persist, [{persistent, true}]),
ok = application:set_env(appinc, key1, persist, [{persistent, true}]),
@@ -2056,10 +1991,7 @@ persistent_env(Conf) when is_list(Conf) ->
%%%-----------------------------------------------------------------
%%% Tests the 'shutdown_func' kernel config parameter
%%%-----------------------------------------------------------------
-shutdown_func(suite) ->
- [];
-shutdown_func(doc) ->
- ["Tests the 'shutdown_func' kernel config parameter"];
+%% Tests the 'shutdown_func' kernel config parameter.
shutdown_func(Config) when is_list(Config) ->
{ok,Cp1} = start_node(?MODULE_STRING++"_shutdown_func"),
wait_for_ready_net(),
@@ -2077,10 +2009,10 @@ shutdown_func(Config) when is_list(Config) ->
{'DOWN', Mref, _, Pid, noconnection} ->
ok
after 10000 ->
- test_server:fail(timeout)
+ ct:fail(timeout)
end
after 10000 ->
- test_server:fail(timeout)
+ ct:fail(timeout)
end.
@@ -2098,7 +2030,7 @@ do_shutdown(Reason) ->
%%% Tests the 'shutdown_timeout' kernel config parameter
%%%-----------------------------------------------------------------
shutdown_timeout(Config) when is_list(Config) ->
- DataDir = ?config(data_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
{ok,Cp1} = start_node(?MODULE_STRING++"_shutdown_timeout"),
wait_for_ready_net(),
ok = rpc:call(Cp1, application, set_env, [kernel, shutdown_timeout, 1000]),
@@ -2121,7 +2053,7 @@ shutdown_timeout(Config) when is_list(Config) ->
%%% Provokes a (previous) application shutdown deadlock
%%%-----------------------------------------------------------------
shutdown_deadlock(Config) when is_list(Config) ->
- DataDir = ?config(data_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
code:add_path(filename:join([DataDir,deadlock])),
%% ok = rpc:call(Cp1, application, start, [sasl]),
ok = application:start(deadlock),
@@ -2596,7 +2528,7 @@ is_started(Name, Node) ->
false -> false
end.
-% Waits until application Name is started on at least one node.
+%% Waits until application Name is started on at least one node.
wait_until_started(Name, Nodes) ->
case lists:member(true,
lists:map(fun (N) ->
@@ -2606,11 +2538,11 @@ wait_until_started(Name, Nodes) ->
true ->
true;
false ->
- test_server:sleep(500),
+ ct:sleep(500),
wait_until_started(Name, Nodes)
end.
-% Waits until application Name is stopped on all nodes.
+%% Waits until application Name is stopped on all nodes.
wait_until_stopped(Name, Nodes) ->
case lists:member(true,
lists:map(fun (N) ->
@@ -2620,7 +2552,7 @@ wait_until_stopped(Name, Nodes) ->
false ->
true;
true ->
- test_server:sleep(500),
+ ct:sleep(500),
wait_until_stopped(Name, Nodes)
end.
@@ -2662,13 +2594,13 @@ start_node_args(Name, Args) ->
start_node_boot_3002(Name, Boot) ->
Pa = filename:dirname(code:which(?MODULE)),
- ?t:format(0, "start_node_boot ~p~n",
- [" -pa " ++ Pa ++ " -env ERL_CRASH_DUMP erl_crash_dump." ++
- atom_to_list(Name) ++ " -boot " ++ Boot ++
- " -sasl dummy \"missing "]),
+ ct:pal(?HI_VERBOSITY, "start_node_boot ~p~n",
+ [" -pa " ++ Pa ++ " -env ERL_CRASH_DUMP erl_crash_dump." ++
+ atom_to_list(Name) ++ " -boot " ++ Boot ++
+ " -sasl dummy \"missing "]),
test_server:start_node(Name, slave,
[{args, " -pa " ++ Pa ++
- " -env ERL_CRASH_DUMP erl_crash_dump." ++
+ " -env ERL_CRASH_DUMP erl_crash_dump." ++
atom_to_list(Name) ++ " -boot " ++ Boot ++
" -sasl dummy \"missing "}]).
@@ -2678,18 +2610,20 @@ start_node_boot_config(Name, SysConfigFun, Conf, Boot) ->
start_node_boot(Name, Config, Boot) ->
Pa = filename:dirname(code:which(?MODULE)),
- ?t:format(0, "start_node_boot ~p~n",[" -pa " ++ Pa ++ " -config " ++ Config ++
- " -boot " ++ atom_to_list(Boot)]),
- test_server:start_node(Name, slave, [{args, " -pa " ++ Pa ++ " -config " ++ Config ++
- " -boot " ++ atom_to_list(Boot)}]).
+ ct:pal(?HI_VERBOSITY,
+ "start_node_boot ~p~n",[" -pa " ++ Pa ++ " -config " ++ Config ++
+ " -boot " ++ atom_to_list(Boot)]),
+ test_server:start_node(Name, slave,
+ [{args, " -pa " ++ Pa ++ " -config " ++ Config ++
+ " -boot " ++ atom_to_list(Boot)}]).
start_node_config_sf(Name, SysConfigFun, Conf) ->
ConfigFile = write_config_file(SysConfigFun, Conf),
- DataDir = ?config(data_dir, Conf), % is it used?
+ DataDir = proplists:get_value(data_dir, Conf), % is it used?
start_node(Name, ConfigFile, " -pa " ++ DataDir).
write_config_file(SysConfigFun, Conf) ->
- Dir = ?config(priv_dir, Conf),
+ Dir = proplists:get_value(priv_dir, Conf),
{ok, Fd} = file:open(filename:join(Dir, "sys.config"), [write]),
SysConfigFun(Fd),
file:close(Fd),
@@ -2713,8 +2647,8 @@ get_start_type(Expected) ->
get_start_type(Expected, 30*5, #st{}).
get_start_type(_Expected, 0, Ack) ->
- test_server:format("====== ~p ======~n", [Ack]),
- test_server:fail(not_valid_start_type);
+ io:format("====== ~p ======~n", [Ack]),
+ ct:fail(not_valid_start_type);
get_start_type(Expected, Times, Ack0) ->
#st{normal = N0, local = L0, takeover = T0, failover = F0} = Ack0,
global:send(st_type, {st, read, self()}),
@@ -2760,13 +2694,13 @@ get_start_phase(Expected) ->
Expected ->
ok;
{sp, T1, I1, So1, Sp1, G1} ->
- test_server:format("=============== {sp,T,I,So,Sp,G} ~p ~n",[" "]),
- test_server:format("=========== got ~p ~n",
+ io:format("=============== {sp,T,I,So,Sp,G} ~p ~n",[" "]),
+ io:format("=========== got ~p ~n",
[{sp, T1, I1, So1, Sp1, G1}]),
- test_server:format("====== expected ~p ~n", [Expected]),
- test_server:fail(not_valid_start_phase)
+ io:format("====== expected ~p ~n", [Expected]),
+ ct:fail(not_valid_start_phase)
after 5000 ->
- test_server:fail(not_valid_start_phase)
+ ct:fail(not_valid_start_phase)
end.
start_phase() ->
@@ -2797,10 +2731,10 @@ get_conf_change(Expected) ->
{cc, Expected} ->
ok;
{cc, List} ->
- test_server:format("====== ~p ======~n",[{cc, List}]),
- test_server:fail(not_valid_conf_change)
+ io:format("====== ~p ======~n",[{cc, List}]),
+ ct:fail(not_valid_conf_change)
after 5000 ->
- test_server:fail(not_valid_conf_change_to)
+ ct:fail(not_valid_conf_change_to)
end.
conf_change() ->
@@ -2896,7 +2830,7 @@ create_script_3002(ScriptName) ->
distr_changed_prep(Conf) when is_list(Conf) ->
- % Write .app files
+ %% Write .app files
{ok, Fd1} = file:open("app1.app", [write]),
w_app1(Fd1),
file:close(Fd1),
@@ -2917,7 +2851,7 @@ distr_changed_prep(Conf) when is_list(Conf) ->
file:close(Fd6),
- % Create the .app files and the boot script
+ %% Create the .app files and the boot script
{{KernelVer,StdlibVer}, _} = create_script_dc("dc"),
case is_real_system(KernelVer, StdlibVer) of
@@ -2933,13 +2867,13 @@ distr_changed_prep(Conf) when is_list(Conf) ->
NoSyncTime = config_fun_fast(config_dc(NodeNames)),
WithSyncTime = config_fun(config_dc(NodeNames)),
- Dir = ?config(priv_dir,Conf),
+ Dir = proplists:get_value(priv_dir,Conf),
{ok, Fd_dc2} = file:open(filename:join(Dir, "sys2.config"), [write]),
(config_dc2(NodeNames))(Fd_dc2),
file:close(Fd_dc2),
Config2 = filename:join(Dir, "sys2"),
- % Test [cp1, cp2, cp3]
+ %% Test [cp1, cp2, cp3]
{ok, Cp1} = start_node_boot_config(Ncp1, NoSyncTime, Conf, dc),
{ok, Cp2} = start_node_boot_config(Ncp2, NoSyncTime, Conf, dc),
{ok, Cp3} = start_node_boot_config(Ncp3, WithSyncTime, Conf, dc),
diff --git a/lib/kernel/test/bif_SUITE.erl b/lib/kernel/test/bif_SUITE.erl
index 284ca8f377..54c0f1cec4 100644
--- a/lib/kernel/test/bif_SUITE.erl
+++ b/lib/kernel/test/bif_SUITE.erl
@@ -22,36 +22,33 @@
init_per_group/2,end_per_group/2]).
-export([
- spawn1/1, spawn2/1, spawn3/1, spawn4/1,
+ spawn1/1, spawn2/1, spawn3/1, spawn4/1,
-
- spawn_link1/1, spawn_link2/1, spawn_link3/1, spawn_link4/1,
-
- spawn_opt2/1, spawn_opt3/1, spawn_opt4/1, spawn_opt5/1,
+ spawn_link1/1, spawn_link2/1, spawn_link3/1, spawn_link4/1,
- spawn_failures/1,
- run_fun/1,
- decode_packet_delim/1,
- wilderness/1]).
+ spawn_opt2/1, spawn_opt3/1, spawn_opt4/1, spawn_opt5/1,
+
+ spawn_failures/1,
+
+ run_fun/1,
+ decode_packet_delim/1,
+ wilderness/1]).
-export([init_per_testcase/2, end_per_testcase/2]).
-include_lib("common_test/include/ct.hrl").
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[{group, spawn_tests}, {group, spawn_link_tests},
@@ -77,360 +74,333 @@ end_per_group(_GroupName, Config) ->
Config.
-spawn1(doc) -> ["Test spawn/1"];
-spawn1(suite) ->
- [];
+%% Test spawn/1.
spawn1(Config) when is_list(Config) ->
- ?line Node = node(),
- ?line Parent = self(),
- ?line {_, _, FA, _} = fetch_proc_vals(self()),
-
- % spawn
- ?line P = spawn(fun() -> Parent ! {self(), fetch_proc_vals(self())} end),
- ?line receive
- {P, PV} ->
- ?line Node = node(P),
- ?line check_proc_vals(false, normal, FA, 0, PV)
- end,
+ Node = node(),
+ Parent = self(),
+ {_, _, FA, _} = fetch_proc_vals(self()),
+
+ %% spawn
+ P = spawn(fun() -> Parent ! {self(), fetch_proc_vals(self())} end),
+ receive
+ {P, PV} ->
+ Node = node(P),
+ check_proc_vals(false, normal, FA, 0, PV)
+ end,
ok.
-spawn2(doc) -> ["Test spawn/2"];
-spawn2(suite) ->
- [];
+%% Test spawn/2.
spawn2(Config) when is_list(Config) ->
- ?line {ok, Node} = start_node(spawn2),
+ {ok, Node} = start_node(spawn2),
- ?line Parent = self(),
- ?line {_, _, FA, _} = fetch_proc_vals(self()),
+ Parent = self(),
+ {_, _, FA, _} = fetch_proc_vals(self()),
- % spawn_link
- ?line P = spawn(Node,
- fun() -> Parent ! {self(), fetch_proc_vals(self())} end),
- ?line receive
- {P, PV} ->
- ?line Node = node(P),
- ?line check_proc_vals(false, normal, FA, 0, PV)
- end,
+ %% spawn_link
+ P = spawn(Node,
+ fun() -> Parent ! {self(), fetch_proc_vals(self())} end),
+ receive
+ {P, PV} ->
+ Node = node(P),
+ check_proc_vals(false, normal, FA, 0, PV)
+ end,
- ?line true = stop_node(Node),
+ true = stop_node(Node),
ok.
-spawn3(doc) -> ["Test spawn/3"];
-spawn3(suite) ->
- [];
+%% Test spawn/3.
spawn3(Config) when is_list(Config) ->
- ?line Node = node(),
-
- ?line Parent = self(),
- ?line {_, _, FA, _} = fetch_proc_vals(self()),
-
- % spawn_link
- ?line P = spawn(?MODULE,
- run_fun,
- [fun() ->
- Parent ! {self(), fetch_proc_vals(self())}
- end]),
- ?line receive
- {P, PV} ->
- ?line Node = node(P),
- ?line check_proc_vals(false, normal, FA, 0, PV)
- end,
+ Node = node(),
+
+ Parent = self(),
+ {_, _, FA, _} = fetch_proc_vals(self()),
+
+ %% spawn_link
+ P = spawn(?MODULE,
+ run_fun,
+ [fun() ->
+ Parent ! {self(), fetch_proc_vals(self())}
+ end]),
+ receive
+ {P, PV} ->
+ Node = node(P),
+ check_proc_vals(false, normal, FA, 0, PV)
+ end,
ok.
-spawn4(doc) -> ["Test spawn/4"];
-spawn4(suite) ->
- [];
+%% Test spawn/4.
spawn4(Config) when is_list(Config) ->
- ?line {ok, Node} = start_node(spawn4),
-
- ?line Parent = self(),
- ?line {_, _, FA, _} = fetch_proc_vals(self()),
-
- % spawn_link
- ?line P = spawn(Node,
- ?MODULE,
- run_fun,
- [fun() ->
- Parent ! {self(), fetch_proc_vals(self())}
- end]),
- ?line receive
- {P, PV} ->
- ?line Node = node(P),
- ?line check_proc_vals(false, normal, FA, 0, PV)
- end,
-
- ?line true = stop_node(Node),
+ {ok, Node} = start_node(spawn4),
+
+ Parent = self(),
+ {_, _, FA, _} = fetch_proc_vals(self()),
+
+ %% spawn_link
+ P = spawn(Node,
+ ?MODULE,
+ run_fun,
+ [fun() ->
+ Parent ! {self(), fetch_proc_vals(self())}
+ end]),
+ receive
+ {P, PV} ->
+ Node = node(P),
+ check_proc_vals(false, normal, FA, 0, PV)
+ end,
+
+ true = stop_node(Node),
ok.
-spawn_link1(doc) -> ["Test spawn_link/1"];
-spawn_link1(suite) ->
- [];
+%% Test spawn_link/1.
spawn_link1(Config) when is_list(Config) ->
- ?line Node = node(),
- ?line Parent = self(),
- ?line {_, _, FA, _} = fetch_proc_vals(self()),
-
- % spawn_link
- ?line P = spawn_link(fun() -> Parent ! {self(), fetch_proc_vals(self())} end),
- ?line receive
- {P, PV} ->
- ?line Node = node(P),
- ?line check_proc_vals(true, normal, FA, 0, PV)
- end,
+ Node = node(),
+ Parent = self(),
+ {_, _, FA, _} = fetch_proc_vals(self()),
+
+ %% spawn_link
+ P = spawn_link(fun() -> Parent ! {self(), fetch_proc_vals(self())} end),
+ receive
+ {P, PV} ->
+ Node = node(P),
+ check_proc_vals(true, normal, FA, 0, PV)
+ end,
ok.
-spawn_link2(doc) -> ["Test spawn_link/2"];
-spawn_link2(suite) ->
- [];
+%% Test spawn_link/2.
spawn_link2(Config) when is_list(Config) ->
- ?line {ok, Node} = start_node(spawn_link2),
+ {ok, Node} = start_node(spawn_link2),
- ?line Parent = self(),
- ?line {_, _, FA, _} = fetch_proc_vals(self()),
+ Parent = self(),
+ {_, _, FA, _} = fetch_proc_vals(self()),
- % spawn_link
- ?line P = spawn_link(Node,
- fun() -> Parent ! {self(), fetch_proc_vals(self())} end),
- ?line receive
- {P, PV} ->
- ?line Node = node(P),
- ?line check_proc_vals(true, normal, FA, 0, PV)
- end,
+ %% spawn_link
+ P = spawn_link(Node,
+ fun() -> Parent ! {self(), fetch_proc_vals(self())} end),
+ receive
+ {P, PV} ->
+ Node = node(P),
+ check_proc_vals(true, normal, FA, 0, PV)
+ end,
- ?line true = stop_node(Node),
+ true = stop_node(Node),
ok.
-spawn_link3(doc) -> ["Test spawn_link/3"];
-spawn_link3(suite) ->
- [];
+%% Test spawn_link/3.
spawn_link3(Config) when is_list(Config) ->
- ?line Node = node(),
-
- ?line Parent = self(),
- ?line {_, _, FA, _} = fetch_proc_vals(self()),
-
- % spawn_link
- ?line P = spawn_link(?MODULE,
- run_fun,
- [fun() ->
- Parent ! {self(), fetch_proc_vals(self())}
- end]),
- ?line receive
- {P, PV} ->
- ?line Node = node(P),
- ?line check_proc_vals(true, normal, FA, 0, PV)
- end,
+ Node = node(),
+
+ Parent = self(),
+ {_, _, FA, _} = fetch_proc_vals(self()),
+
+ %% spawn_link
+ P = spawn_link(?MODULE,
+ run_fun,
+ [fun() ->
+ Parent ! {self(), fetch_proc_vals(self())}
+ end]),
+ receive
+ {P, PV} ->
+ Node = node(P),
+ check_proc_vals(true, normal, FA, 0, PV)
+ end,
ok.
-spawn_link4(doc) -> ["Test spawn_link/4"];
-spawn_link4(suite) ->
- [];
+%% Test spawn_link/4.
spawn_link4(Config) when is_list(Config) ->
- ?line {ok, Node} = start_node(spawn_link4),
-
- ?line Parent = self(),
- ?line {_, _, FA, _} = fetch_proc_vals(self()),
-
- % spawn_link
- ?line P = spawn_link(Node,
- ?MODULE,
- run_fun,
- [fun() ->
- Parent ! {self(), fetch_proc_vals(self())}
- end]),
- ?line receive
- {P, PV} ->
- ?line Node = node(P),
- ?line check_proc_vals(true, normal, FA, 0, PV)
- end,
-
- ?line true = stop_node(Node),
+ {ok, Node} = start_node(spawn_link4),
+
+ Parent = self(),
+ {_, _, FA, _} = fetch_proc_vals(self()),
+
+ %% spawn_link
+ P = spawn_link(Node,
+ ?MODULE,
+ run_fun,
+ [fun() ->
+ Parent ! {self(), fetch_proc_vals(self())}
+ end]),
+ receive
+ {P, PV} ->
+ Node = node(P),
+ check_proc_vals(true, normal, FA, 0, PV)
+ end,
+
+ true = stop_node(Node),
ok.
-spawn_opt2(doc) -> ["Test spawn_opt/2"];
-spawn_opt2(suite) ->
- [];
+%% Test spawn_opt/2.
spawn_opt2(Config) when is_list(Config) ->
- ?line Node = node(),
- ?line Parent = self(),
- ?line {_, _, FA, _} = fetch_proc_vals(self()),
-
- ?line P1 = spawn_opt(fun() ->
- Parent ! {self(), fetch_proc_vals(self())}
- end,
- [{fullsweep_after, 0},{min_heap_size, 1000},
- link, {priority, max}]),
- ?line receive
- {P1, PV1} ->
- ?line Node = node(P1),
- ?line check_proc_vals(true, max, 0, 1000, PV1)
- end,
- ?line P2 = spawn_opt(fun() -> Parent ! {self(), fetch_proc_vals(self())} end,
- [{min_heap_size, 10}]),
- ?line receive
- {P2, PV2} ->
- ?line Node = node(P2),
- ?line check_proc_vals(false, normal, FA, 10, PV2)
- end,
+ Node = node(),
+ Parent = self(),
+ {_, _, FA, _} = fetch_proc_vals(self()),
+
+ P1 = spawn_opt(fun() ->
+ Parent ! {self(), fetch_proc_vals(self())}
+ end,
+ [{fullsweep_after, 0},{min_heap_size, 1000},
+ link, {priority, max}]),
+ receive
+ {P1, PV1} ->
+ Node = node(P1),
+ check_proc_vals(true, max, 0, 1000, PV1)
+ end,
+ P2 = spawn_opt(fun() -> Parent ! {self(), fetch_proc_vals(self())} end,
+ [{min_heap_size, 10}]),
+ receive
+ {P2, PV2} ->
+ Node = node(P2),
+ check_proc_vals(false, normal, FA, 10, PV2)
+ end,
ok.
-spawn_opt3(doc) -> ["Test spawn_opt/3"];
-spawn_opt3(suite) ->
- [];
+%% Test spawn_opt/3.
spawn_opt3(Config) when is_list(Config) ->
- ?line {ok, Node} = start_node(spawn_opt3),
- ?line Parent = self(),
- ?line {_, _, FA, _} = fetch_proc_vals(self()),
- ?line P1 = spawn_opt(Node,
- fun() ->
- Parent ! {self(), fetch_proc_vals(self())}
- end,
- [{fullsweep_after,0}, {min_heap_size,1000},
- link, {priority, max}]),
- ?line receive
- {P1, PV1} ->
- ?line Node = node(P1),
- ?line check_proc_vals(true, max, 0, 1000, PV1)
- end,
- ?line P2 = spawn_opt(Node,
- fun() -> Parent ! {self(), fetch_proc_vals(self())} end,
- [{min_heap_size, 10}]),
- ?line receive
- {P2, PV2} ->
- ?line Node = node(P2),
- ?line check_proc_vals(false, normal, FA, 10, PV2)
- end,
- ?line true = stop_node(Node),
+ {ok, Node} = start_node(spawn_opt3),
+ Parent = self(),
+ {_, _, FA, _} = fetch_proc_vals(self()),
+ P1 = spawn_opt(Node,
+ fun() ->
+ Parent ! {self(), fetch_proc_vals(self())}
+ end,
+ [{fullsweep_after,0}, {min_heap_size,1000},
+ link, {priority, max}]),
+ receive
+ {P1, PV1} ->
+ Node = node(P1),
+ check_proc_vals(true, max, 0, 1000, PV1)
+ end,
+ P2 = spawn_opt(Node,
+ fun() -> Parent ! {self(), fetch_proc_vals(self())} end,
+ [{min_heap_size, 10}]),
+ receive
+ {P2, PV2} ->
+ Node = node(P2),
+ check_proc_vals(false, normal, FA, 10, PV2)
+ end,
+ true = stop_node(Node),
ok.
-spawn_opt4(doc) -> ["Test spawn_opt/4"];
-spawn_opt4(suite) ->
- [];
+%% Test spawn_opt/4.
spawn_opt4(Config) when is_list(Config) ->
- ?line Node = node(),
- ?line Parent = self(),
- ?line {_, _, FA, _} = fetch_proc_vals(self()),
- ?line P1 = spawn_opt(?MODULE,
- run_fun,
- [fun() ->
- Parent ! {self(), fetch_proc_vals(self())}
- end],
- [{fullsweep_after,0}, {min_heap_size,1000},
- link, {priority, max}]),
- ?line receive
- {P1, PV1} ->
- ?line Node = node(P1),
- ?line check_proc_vals(true, max, 0, 1000, PV1)
- end,
- ?line P2 = spawn_opt(?MODULE,
- run_fun,
- [fun() ->
- Parent ! {self(), fetch_proc_vals(self())}
- end],
- [{min_heap_size, 10}]),
- ?line receive
- {P2, PV2} ->
- ?line Node = node(P2),
- ?line check_proc_vals(false, normal, FA, 10, PV2)
- end,
+ Node = node(),
+ Parent = self(),
+ {_, _, FA, _} = fetch_proc_vals(self()),
+ P1 = spawn_opt(?MODULE,
+ run_fun,
+ [fun() ->
+ Parent ! {self(), fetch_proc_vals(self())}
+ end],
+ [{fullsweep_after,0}, {min_heap_size,1000},
+ link, {priority, max}]),
+ receive
+ {P1, PV1} ->
+ Node = node(P1),
+ check_proc_vals(true, max, 0, 1000, PV1)
+ end,
+ P2 = spawn_opt(?MODULE,
+ run_fun,
+ [fun() ->
+ Parent ! {self(), fetch_proc_vals(self())}
+ end],
+ [{min_heap_size, 10}]),
+ receive
+ {P2, PV2} ->
+ Node = node(P2),
+ check_proc_vals(false, normal, FA, 10, PV2)
+ end,
ok.
-spawn_opt5(doc) -> ["Test spawn_opt/5"];
-spawn_opt5(suite) ->
- [];
+%% Test spawn_opt/5.
spawn_opt5(Config) when is_list(Config) ->
- ?line {ok, Node} = start_node(spawn_opt5),
- ?line Parent = self(),
- ?line {_, _, FA, _} = fetch_proc_vals(self()),
- ?line P1 = spawn_opt(Node,
- ?MODULE,
- run_fun,
- [fun() ->
- Parent ! {self(), fetch_proc_vals(self())}
- end],
- [{fullsweep_after,0}, {min_heap_size,1000},
- link, {priority, max}]),
- ?line receive
- {P1, PV1} ->
- ?line Node = node(P1),
- ?line check_proc_vals(true, max, 0, 1000, PV1)
- end,
- ?line P2 = spawn_opt(Node,
- ?MODULE,
- run_fun,
- [fun() ->
- Parent ! {self(), fetch_proc_vals(self())}
- end],
- [{min_heap_size, 10}]),
- ?line receive
- {P2, PV2} ->
- ?line Node = node(P2),
- ?line check_proc_vals(false, normal, FA, 10, PV2)
- end,
- ?line true = stop_node(Node),
+ {ok, Node} = start_node(spawn_opt5),
+ Parent = self(),
+ {_, _, FA, _} = fetch_proc_vals(self()),
+ P1 = spawn_opt(Node,
+ ?MODULE,
+ run_fun,
+ [fun() ->
+ Parent ! {self(), fetch_proc_vals(self())}
+ end],
+ [{fullsweep_after,0}, {min_heap_size,1000},
+ link, {priority, max}]),
+ receive
+ {P1, PV1} ->
+ Node = node(P1),
+ check_proc_vals(true, max, 0, 1000, PV1)
+ end,
+ P2 = spawn_opt(Node,
+ ?MODULE,
+ run_fun,
+ [fun() ->
+ Parent ! {self(), fetch_proc_vals(self())}
+ end],
+ [{min_heap_size, 10}]),
+ receive
+ {P2, PV2} ->
+ Node = node(P2),
+ check_proc_vals(false, normal, FA, 10, PV2)
+ end,
+ true = stop_node(Node),
ok.
-spawn_failures(doc) ->
- ["Test failure behavior of spawn bifs"];
-spawn_failures(suite) ->
- [];
+%% Test failure behavior of spawn bifs.
spawn_failures(Config) when is_list(Config) ->
- ?line ThisNode = node(),
- ?line {ok, Node} = start_node(spawn_remote_failure),
-
- % unknown nodes
- test_server:format("Testing unknown nodes~n", []),
- ?line CrashPid1 = (catch spawn_opt('unknown@node',
- erlang,
- nodes,
- [],
- [])),
- ?line true = is_pid(CrashPid1),
- ?line ThisNode = node(CrashPid1),
- ?line CrashPid2 = (catch spawn_opt('unknown@node',
- fun () -> erlang:nodes() end,
- [])),
- ?line true = is_pid(CrashPid2),
- ?line ThisNode = node(CrashPid2),
-
- ?line CrashPid3 = (catch spawn('unknown@node',
- erlang,
- nodes,
- [])),
- ?line true = is_pid(CrashPid3),
- ?line ThisNode = node(CrashPid3),
- ?line CrashPid4 = (catch spawn('unknown@node',
- fun () -> erlang:nodes() end)),
- ?line true = is_pid(CrashPid4),
- ?line ThisNode = node(CrashPid4),
-
- ?line OTE = process_flag(trap_exit,true),
- ?line CrashPid5 = (catch spawn_link('unknown@node',
- erlang,
- nodes,
- [])),
+ ThisNode = node(),
+ {ok, Node} = start_node(spawn_remote_failure),
+
+ %% unknown nodes
+ io:format("Testing unknown nodes~n", []),
+ CrashPid1 = (catch spawn_opt('unknown@node',
+ erlang,
+ nodes,
+ [],
+ [])),
+ true = is_pid(CrashPid1),
+ ThisNode = node(CrashPid1),
+ CrashPid2 = (catch spawn_opt('unknown@node',
+ fun () -> erlang:nodes() end,
+ [])),
+ true = is_pid(CrashPid2),
+ ThisNode = node(CrashPid2),
+
+ CrashPid3 = (catch spawn('unknown@node',
+ erlang,
+ nodes,
+ [])),
+ true = is_pid(CrashPid3),
+ ThisNode = node(CrashPid3),
+ CrashPid4 = (catch spawn('unknown@node',
+ fun () -> erlang:nodes() end)),
+ true = is_pid(CrashPid4),
+ ThisNode = node(CrashPid4),
+
+ OTE = process_flag(trap_exit,true),
+ CrashPid5 = (catch spawn_link('unknown@node',
+ erlang,
+ nodes,
+ [])),
receive
{'EXIT', CrashPid5, noconnection} ->
- ?line true = is_pid(CrashPid5),
- ?line ThisNode = node(CrashPid5)
+ true = is_pid(CrashPid5),
+ ThisNode = node(CrashPid5)
end,
- ?line CrashPid6 = (catch spawn_link('unknown@node',
- fun () -> erlang:nodes() end)),
+ CrashPid6 = (catch spawn_link('unknown@node',
+ fun () -> erlang:nodes() end)),
receive
{'EXIT', CrashPid6, noconnection} ->
- ?line true = is_pid(CrashPid6),
- ?line ThisNode = node(CrashPid6)
+ true = is_pid(CrashPid6),
+ ThisNode = node(CrashPid6)
end,
process_flag(trap_exit,OTE),
case OTE of
false ->
receive
{'EXIT', P, R} ->
- ?line test_server:fail({'EXIT', P, R})
+ ct:fail({'EXIT', P, R})
after 0 ->
ok
end;
@@ -438,132 +408,125 @@ spawn_failures(Config) when is_list(Config) ->
ok
end,
- % bad node
- test_server:format("Testing bad nodes~n", []),
- ?line {'EXIT', {badarg, _}} = (catch spawn_opt("Node",erlang,nodes,[],[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn_opt("Node",
- fun () ->
- erlang:nodes()
- end,
- [])),
- ?line {'EXIT', {badarg, _}} = (catch spawn_link("Node",
- fun () ->
- erlang:nodes()
- end)),
- ?line {'EXIT', {badarg, _}} = (catch spawn("Node",erlang,nodes,[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn("Node",
- fun () ->
- erlang:nodes()
- end)),
-
- % bad module
- test_server:format("Testing bad modules~n", []),
- ?line {'EXIT', {badarg, _}} = (catch spawn_opt(Node,"erlang",nodes,[],[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn_opt("erlang",nodes,[],[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn_link(Node,"erlang",nodes,[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn_link("erlang",nodes,[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn(Node,"erlang",nodes,[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn("erlang",nodes,[])),
-
- % bad function
- test_server:format("Testing bad functions~n", []),
- ?line {'EXIT', {badarg, _}} = (catch spawn_opt(Node,erlang,"nodes",[],[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn_opt(Node,not_a_fun,[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn_opt(erlang,"nodes",[],[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn_opt(not_a_fun,[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn_link(Node,erlang,"nodes",[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn_link(Node,not_a_fun)),
- ?line {'EXIT', {badarg, _}} = (catch spawn_link(erlang,"nodes",[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn_link(not_a_fun)),
- ?line {'EXIT', {badarg, _}} = (catch spawn(Node,erlang,"nodes",[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn(Node,not_a_fun)),
- ?line {'EXIT', {badarg, _}} = (catch spawn(erlang,"nodes",[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn(not_a_fun)),
-
-
- % bad argument
- test_server:format("Testing bad arguments~n", []),
- ?line {'EXIT', {badarg, _}} = (catch spawn_opt(Node,erlang,nodes,[a|b],[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn_opt(erlang,nodes,[a|b],[])),
- ?line {'EXIT', {badarg, _}} = (catch spawn_link(Node,erlang,nodes,[a|b])),
- ?line {'EXIT', {badarg, _}} = (catch spawn_link(erlang,nodes,[a|b])),
- ?line {'EXIT', {badarg, _}} = (catch spawn(Node,erlang,nodes,[a|b])),
- ?line {'EXIT', {badarg, _}} = (catch spawn(erlang,nodes,[a|b])),
-
- % bad option
- test_server:format("Testing bad options~n", []),
- ?line {'EXIT', {badarg, _}} = (catch spawn_opt(Node,erlang,nodes,[],[a|b])),
- ?line {'EXIT', {badarg, _}} = (catch spawn_opt(erlang,nodes,[],[a|b])),
-
-
- ?line true = stop_node(Node),
+ %% bad node
+ io:format("Testing bad nodes~n", []),
+ {'EXIT', {badarg, _}} = (catch spawn_opt("Node",erlang,nodes,[],[])),
+ {'EXIT', {badarg, _}} = (catch spawn_opt("Node",
+ fun () ->
+ erlang:nodes()
+ end,
+ [])),
+ {'EXIT', {badarg, _}} = (catch spawn_link("Node",
+ fun () ->
+ erlang:nodes()
+ end)),
+ {'EXIT', {badarg, _}} = (catch spawn("Node",erlang,nodes,[])),
+ {'EXIT', {badarg, _}} = (catch spawn("Node",
+ fun () ->
+ erlang:nodes()
+ end)),
+
+ %% bad module
+ io:format("Testing bad modules~n", []),
+ {'EXIT', {badarg, _}} = (catch spawn_opt(Node,"erlang",nodes,[],[])),
+ {'EXIT', {badarg, _}} = (catch spawn_opt("erlang",nodes,[],[])),
+ {'EXIT', {badarg, _}} = (catch spawn_link(Node,"erlang",nodes,[])),
+ {'EXIT', {badarg, _}} = (catch spawn_link("erlang",nodes,[])),
+ {'EXIT', {badarg, _}} = (catch spawn(Node,"erlang",nodes,[])),
+ {'EXIT', {badarg, _}} = (catch spawn("erlang",nodes,[])),
+
+ %% bad function
+ io:format("Testing bad functions~n", []),
+ {'EXIT', {badarg, _}} = (catch spawn_opt(Node,erlang,"nodes",[],[])),
+ {'EXIT', {badarg, _}} = (catch spawn_opt(Node,not_a_fun,[])),
+ {'EXIT', {badarg, _}} = (catch spawn_opt(erlang,"nodes",[],[])),
+ {'EXIT', {badarg, _}} = (catch spawn_opt(not_a_fun,[])),
+ {'EXIT', {badarg, _}} = (catch spawn_link(Node,erlang,"nodes",[])),
+ {'EXIT', {badarg, _}} = (catch spawn_link(Node,not_a_fun)),
+ {'EXIT', {badarg, _}} = (catch spawn_link(erlang,"nodes",[])),
+ {'EXIT', {badarg, _}} = (catch spawn_link(not_a_fun)),
+ {'EXIT', {badarg, _}} = (catch spawn(Node,erlang,"nodes",[])),
+ {'EXIT', {badarg, _}} = (catch spawn(Node,not_a_fun)),
+ {'EXIT', {badarg, _}} = (catch spawn(erlang,"nodes",[])),
+ {'EXIT', {badarg, _}} = (catch spawn(not_a_fun)),
+
+
+ %% bad argument
+ io:format("Testing bad arguments~n", []),
+ {'EXIT', {badarg, _}} = (catch spawn_opt(Node,erlang,nodes,[a|b],[])),
+ {'EXIT', {badarg, _}} = (catch spawn_opt(erlang,nodes,[a|b],[])),
+ {'EXIT', {badarg, _}} = (catch spawn_link(Node,erlang,nodes,[a|b])),
+ {'EXIT', {badarg, _}} = (catch spawn_link(erlang,nodes,[a|b])),
+ {'EXIT', {badarg, _}} = (catch spawn(Node,erlang,nodes,[a|b])),
+ {'EXIT', {badarg, _}} = (catch spawn(erlang,nodes,[a|b])),
+
+ %% bad option
+ io:format("Testing bad options~n", []),
+ {'EXIT', {badarg, _}} = (catch spawn_opt(Node,erlang,nodes,[],[a|b])),
+ {'EXIT', {badarg, _}} = (catch spawn_opt(erlang,nodes,[],[a|b])),
+
+
+ true = stop_node(Node),
ok.
check_proc_vals(Link, Priority, FullsweepAfter, MinHeapSize, {Ls, P, FA, HS}) ->
- ?line Link = lists:member(self(), Ls),
- ?line Priority = P,
+ Link = lists:member(self(), Ls),
+ Priority = P,
FullsweepAfter = FA,
true = (HS >= MinHeapSize),
- ?line ok.
+ ok.
fetch_proc_vals(Pid) ->
- ?line PI = process_info(Pid),
- ?line {value,{links, Ls}} = lists:keysearch(links, 1, PI),
- ?line {value,{priority,P}} = lists:keysearch(priority, 1, PI),
+ PI = process_info(Pid),
+ {value,{links, Ls}} = lists:keysearch(links, 1, PI),
+ {value,{priority,P}} = lists:keysearch(priority, 1, PI),
{value,{garbage_collection,Gs}} =
lists:keysearch(garbage_collection, 1, PI),
{value,{fullsweep_after,FA}} =
lists:keysearch(fullsweep_after, 1, Gs),
{value,{heap_size,HS}} = lists:keysearch(heap_size, 1, PI),
- ?line {Ls, P, FA, HS}.
-
-decode_packet_delim(doc) ->
- ["Test erlang:packet_delim/3 with {line_delimiter,0} option"];
-decode_packet_delim(suite) ->
- [];
+ {Ls, P, FA, HS}.
+
+%% Test erlang:packet_delim/3 with {line_delimiter,0} option.
decode_packet_delim(Config) when is_list(Config) ->
{ok,<<"abc",0>>,<<"efg",0>>} =
erlang:decode_packet(line, <<"abc",0,"efg",0>>, [{line_delimiter, 0}]),
{more, undefined} = erlang:decode_packet(line, <<"abc",0,"efg",0>>, []).
-% This testcase should probably be moved somewhere else
-wilderness(doc) ->
- ["Test that memory allocation command line options affecting the"
- "wilderness of the heap are interpreted correct by the emulator "];
-wilderness(suite) ->
- [];
+%% This testcase should probably be moved somewhere else
+
+%% Test that memory allocation command line options affecting the
+%% wilderness of the heap are interpreted correct by the emulator.
wilderness(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- ?line OKParams = {512, 8},
- ?line Alloc = erlang:system_info(allocator),
- ?line test_server:format("Test server allocator info:~n~p", [Alloc]),
+ OKParams = {512, 8},
+ Alloc = erlang:system_info(allocator),
+ io:format("Test server allocator info:~n~p", [Alloc]),
Result = case Alloc of
{Allocator, _, _, _} when Allocator == glibc;
Allocator == dlmalloc ->
- ?line run_wilderness_test(OKParams, OKParams),
- ?line {comment,
- "Allocator used: " ++ atom_to_list(Allocator)};
+ run_wilderness_test(OKParams, OKParams),
+ {comment,
+ "Allocator used: " ++ atom_to_list(Allocator)};
{OtherAllocator, _, _, _} ->
- ?line {skipped,
- "Only run when glibc is used. "
- "Allocator used: "
- ++ atom_to_list(OtherAllocator)}
+ {skipped,
+ "Only run when glibc is used. "
+ "Allocator used: "
+ ++ atom_to_list(OtherAllocator)}
end,
- ?line test_server:timetrap_cancel(Dog),
Result.
-
+
run_wilderness_test({Set_tt, Set_tp}, {Exp_tt, Exp_tp}) ->
Self = self(),
Ref = make_ref(),
SuiteDir = filename:dirname(code:which(?MODULE)),
- ?line {ok, Node} = test_server:start_node(allocator_test,
- slave,
- [{args,
- " -pa "
- ++ SuiteDir
- ++" +MYtt "++to_string(Set_tt)
- ++" +MYtp "++to_string(Set_tp)},
- {linked, false}]),
+ {ok, Node} = test_server:start_node(allocator_test,
+ slave,
+ [{args,
+ " -pa "
+ ++ SuiteDir
+ ++" +MYtt "++to_string(Set_tt)
+ ++" +MYtp "++to_string(Set_tp)},
+ {linked, false}]),
spawn(Node, fun () ->
Self ! {Ref, erlang:system_info(allocator)}
end),
@@ -571,15 +534,15 @@ run_wilderness_test({Set_tt, Set_tp}, {Exp_tt, Exp_tp}) ->
{Ref, {A, V, F, S}} ->
Ett = Exp_tt*1024,
Etp = Exp_tp*1024,
- ?line test_server:format("Test allocator info:~n~p",
- [{A, V, F, S}]),
- ?line {value, {sys_alloc, SA_Opts}}
+ io:format("Test allocator info:~n~p",
+ [{A, V, F, S}]),
+ {value, {sys_alloc, SA_Opts}}
= lists:keysearch(sys_alloc, 1, S),
- ?line {value, {tt, Ett}} = lists:keysearch(tt, 1, SA_Opts),
- ?line {value, {tp, Etp}} = lists:keysearch(tp, 1, SA_Opts)
+ {value, {tt, Ett}} = lists:keysearch(tt, 1, SA_Opts),
+ {value, {tp, Etp}} = lists:keysearch(tp, 1, SA_Opts)
end,
stop_node(Node).
-
+
to_string(X) when is_integer(X) ->
integer_to_list(X);
to_string(X) when is_atom(X) ->
@@ -605,12 +568,12 @@ get_nodenames(N, T, Acc) ->
++ integer_to_list(C)) | Acc]).
start_node(TestCase) ->
- ?line [Name] = get_nodenames(1, TestCase),
- ?line Pa = filename:dirname(code:which(?MODULE)),
- ?line test_server:start_node(Name, slave, [{args, "-pa " ++ Pa}]).
+ [Name] = get_nodenames(1, TestCase),
+ Pa = filename:dirname(code:which(?MODULE)),
+ test_server:start_node(Name, slave, [{args, "-pa " ++ Pa}]).
stop_node(Node) ->
- ?line true = test_server:stop_node(Node).
+ true = test_server:stop_node(Node).
run_fun(Fun) ->
Fun().
diff --git a/lib/kernel/test/cleanup.erl b/lib/kernel/test/cleanup.erl
index 7f623b9fc3..26000b545f 100644
--- a/lib/kernel/test/cleanup.erl
+++ b/lib/kernel/test/cleanup.erl
@@ -36,15 +36,14 @@ end_per_group(_GroupName, Config) ->
Config.
-cleanup(suite) -> [];
cleanup(_) ->
- ?line Localhost = list_to_atom(net_adm:localhost()),
- ?line net_adm:world_list([Localhost]),
- ?line case nodes() of
- [] ->
- ok;
- Nodes when is_list(Nodes) ->
- Kill = fun(Node) -> spawn(Node, erlang, halt, []) end,
- ?line lists:foreach(Kill, Nodes),
- ?line test_server:fail({nodes_left, Nodes})
- end.
+ Localhost = list_to_atom(net_adm:localhost()),
+ net_adm:world_list([Localhost]),
+ case nodes() of
+ [] ->
+ ok;
+ Nodes when is_list(Nodes) ->
+ Kill = fun(Node) -> spawn(Node, erlang, halt, []) end,
+ lists:foreach(Kill, Nodes),
+ ct:fail({nodes_left, Nodes})
+ end.
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl
index 00f29aa8ed..298c1f7d6b 100644
--- a/lib/kernel/test/code_SUITE.erl
+++ b/lib/kernel/test/code_SUITE.erl
@@ -46,7 +46,9 @@
-export([compile_load/4]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,5}}].
all() ->
[set_path, get_path, add_path, add_paths, del_path,
@@ -92,34 +94,28 @@ init_per_testcase(big_boot_embedded, Config) ->
{skip, "Needs crypto!"}
end;
init_per_testcase(_Func, Config) ->
- Dog=?t:timetrap(?t:minutes(5)),
- P=code:get_path(),
- P=code:get_path(),
- [{watchdog, Dog}, {code_path, P}|Config].
+ P = code:get_path(),
+ [{code_path, P}|Config].
end_per_testcase(TC, Config) when TC == mult_lib_roots;
TC == big_boot_embedded ->
{ok, HostName} = inet:gethostname(),
NodeName = list_to_atom(atom_to_list(TC)++"@"++HostName),
- ?t:stop_node(NodeName),
+ test_server:stop_node(NodeName),
end_per_testcase(Config);
end_per_testcase(_Func, Config) ->
end_per_testcase(Config).
end_per_testcase(Config) ->
code:purge(code_b_test),
- Dog=?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
- P=?config(code_path, Config),
+ P=proplists:get_value(code_path, Config),
true=code:set_path(P),
P=code:get_path(),
ok.
-set_path(suite) -> [];
-set_path(doc) -> [];
set_path(Config) when is_list(Config) ->
P = code:get_path(),
- NonExDir = filename:join(?config(priv_dir, Config), ?t:temp_name("hej")),
+ NonExDir = filename:join(proplists:get_value(priv_dir, Config), test_server:temp_name("hej")),
{'EXIT',_} = (catch code:set_path({a})),
{error, bad_directory} = (catch code:set_path([{a}])),
{error, bad_directory} = code:set_path(NonExDir),
@@ -133,19 +129,15 @@ set_path(Config) when is_list(Config) ->
[LibDir] = code:get_path(),
ok.
-get_path(suite) -> [];
-get_path(doc) -> [];
get_path(Config) when is_list(Config) ->
P = code:get_path(),
- % test that all directories are strings (lists).
+ %% test that all directories are strings (lists).
[] = lists:filter(fun
(Dir) when is_list(Dir) -> false;
(_) -> true
end, P),
ok.
-add_path(suite) -> [];
-add_path(doc) -> [];
add_path(Config) when is_list(Config) ->
P = code:get_path(),
{'EXIT',_} = (catch code:add_path({})),
@@ -166,8 +158,6 @@ add_path(Config) when is_list(Config) ->
code:set_path(P),
ok.
-add_paths(suite) -> [];
-add_paths(doc) -> [];
add_paths(Config) when is_list(Config) ->
P = code:get_path(),
ok = code:add_paths([{}]),
@@ -213,8 +203,6 @@ add_paths(Config) when is_list(Config) ->
code:set_path(P),
ok.
-del_path(suite) -> [];
-del_path(doc) -> [];
del_path(Config) when is_list(Config) ->
P = code:get_path(),
try
@@ -224,18 +212,18 @@ del_path(Config) when is_list(Config) ->
end.
del_path_1(P) ->
- test_server:format("Initial code:get_path()=~p~n",[P]),
+ io:format("Initial code:get_path()=~p~n",[P]),
{'EXIT',_} = (catch code:del_path(3)),
false = code:del_path(my_dummy_name),
false = code:del_path("/kdlk/my_dummy_dir"),
Dir = filename:join([code:lib_dir(kernel),"ebin"]),
- test_server:format("kernel dir: ~p~n",[Dir]),
+ io:format("kernel dir: ~p~n",[Dir]),
true = code:del_path(kernel),
NewP = code:get_path(),
- test_server:format("Path after removing 'kernel':~p~n",[NewP]),
+ io:format("Path after removing 'kernel':~p~n",[NewP]),
ReferenceP = lists:delete(Dir,P),
- test_server:format("Reference path:~p~n",[ReferenceP]),
+ io:format("Reference path:~p~n",[ReferenceP]),
NewP = ReferenceP, % check that dir is deleted
code:set_path(P),
@@ -249,10 +237,8 @@ del_path_1(P) ->
NewP1 = lists:delete(Dir,P), % check that dir is deleted
ok.
-replace_path(suite) -> [];
-replace_path(doc) -> [];
replace_path(Config) when is_list(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
P = code:get_path(),
{'EXIT',_} = (catch code:replace_path(3,"")),
{error, bad_name} = code:replace_path(dummy_name,""),
@@ -287,10 +273,9 @@ replace_path(Config) when is_list(Config) ->
ok.
-dir_disappeared(suite) -> [];
-dir_disappeared(doc) -> ["OTP-3977"];
+%% OTP-3977.
dir_disappeared(Config) when is_list(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
Dir = filename:join(PrivDir, "temp"),
ok = file:make_dir(Dir),
true = code:add_path(Dir),
@@ -298,8 +283,6 @@ dir_disappeared(Config) when is_list(Config) ->
non_existing = code:which(bubbelskrammel),
ok.
-load_file(suite) -> [];
-load_file(doc) -> [];
load_file(Config) when is_list(Config) ->
{error, nofile} = code:load_file(duuuumy_mod),
{error, badfile} = code:load_file(code_a_test),
@@ -314,8 +297,6 @@ load_file(Config) when is_list(Config) ->
test_dir() ->
filename:dirname(code:which(?MODULE)).
-load_abs(suite) -> [];
-load_abs(doc) -> [];
load_abs(Config) when is_list(Config) ->
TestDir = test_dir(),
{error, nofile} = code:load_abs(TestDir ++ "/duuuumy_mod"),
@@ -328,8 +309,6 @@ load_abs(Config) when is_list(Config) ->
code:unstick_dir(TestDir),
ok.
-ensure_loaded(suite) -> [];
-ensure_loaded(doc) -> [];
ensure_loaded(Config) when is_list(Config) ->
{module, lists} = code:ensure_loaded(lists),
case init:get_argument(mode) of
@@ -346,8 +325,6 @@ ensure_loaded(Config) when is_list(Config) ->
ok
end.
-delete(suite) -> [];
-delete(doc) -> [];
delete(Config) when is_list(Config) ->
OldFlag = process_flag(trap_exit, true),
code:purge(code_b_test),
@@ -364,8 +341,6 @@ delete(Config) when is_list(Config) ->
process_flag(trap_exit, OldFlag),
ok.
-purge(suite) -> [];
-purge(doc) -> [];
purge(Config) when is_list(Config) ->
OldFlag = process_flag(trap_exit, true),
code:purge(code_b_test),
@@ -408,7 +383,7 @@ purge_many_exits_do(PurgeF) ->
end)}
end,
lists:seq(1, 1000)),
- % Give them time to start...
+ %% Give them time to start...
receive after 1000 -> ok end,
true = code:delete(code_b_test),
lists:foreach(fun ({Pid1, Pid2}) ->
@@ -428,8 +403,6 @@ purge_many_exits_do(PurgeF) ->
end, TPids).
-soft_purge(suite) -> [];
-soft_purge(doc) -> [];
soft_purge(Config) when is_list(Config) ->
OldFlag = process_flag(trap_exit, true),
code:purge(code_b_test),
@@ -446,8 +419,6 @@ soft_purge(Config) when is_list(Config) ->
process_flag(trap_exit, OldFlag),
ok.
-is_loaded(suite) -> [];
-is_loaded(doc) -> [];
is_loaded(Config) when is_list(Config) ->
code:purge(code_b_test),
code:delete(code_b_test),
@@ -461,10 +432,8 @@ is_loaded(Config) when is_list(Config) ->
code:delete(code_b_test),
ok.
-all_loaded(suite) -> [];
-all_loaded(doc) -> [];
all_loaded(Config) when is_list(Config) ->
- case ?t:is_cover() of
+ case test_server:is_cover() of
true -> {skip,"Cover is running"};
false -> all_loaded_1()
end.
@@ -492,8 +461,6 @@ all_unique([]) -> ok;
all_unique([_]) -> ok;
all_unique([{X,_}|[{Y,_}|_]=T]) when X < Y -> all_unique(T).
-load_binary(suite) -> [];
-load_binary(doc) -> [];
load_binary(Config) when is_list(Config) ->
TestDir = test_dir(),
File = TestDir ++ "/code_b_test" ++ code:objfile_extension(),
@@ -510,7 +477,7 @@ load_binary(Config) when is_list(Config) ->
ok.
upgrade(Config) ->
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
%%T = [beam, hipe],
T = [beam],
@@ -542,15 +509,11 @@ compile_load(Mod, Dir, Ver, CodeType) ->
CompOpts = [binary, report] ++ Target ++ Version,
Src = filename:join(Dir, atom_to_list(Mod) ++ ".erl"),
- %io:format("compile:file(~p,~p)\n", [Src, CompOpts]),
{ok,Mod,Code} = compile:file(Src, CompOpts),
ObjFile = filename:basename(Src,".erl") ++ ".beam",
{module,Mod} = code:load_binary(Mod, ObjFile, Code),
- %IsNative = code:is_module_native(Mod),
ok.
-dir_req(suite) -> [];
-dir_req(doc) -> [];
dir_req(Config) when is_list(Config) ->
{ok,[[Root0]]} = init:get_argument(root),
Root = filename:join([Root0]), % Normalised form.
@@ -565,8 +528,6 @@ dir_req(Config) when is_list(Config) ->
{error, bad_name} = code:priv_dir(duuumy),
ok.
-object_code(suite) -> [];
-object_code(doc) -> [];
object_code(Config) when is_list(Config) ->
TestDir = test_dir(),
P = code:get_path(),
@@ -587,22 +548,20 @@ object_code(Config) when is_list(Config) ->
P=code:get_path(),
ok.
-set_path_file(suite) -> [];
-set_path_file(doc) -> ["Test that set_path does not accept ",
- "files as pathnames (known previous bug)"];
+%% Test that set_path does not accept
+%% files as pathnames (known previous bug)
set_path_file(Config) when is_list(Config) ->
- File=filename:join(?config(priv_dir, Config), "testfil"),
+ File=filename:join(proplists:get_value(priv_dir, Config), "testfil"),
ok=file:write_file(File, list_to_binary("lite data")),
{error, bad_directory}=code:set_path([File]).
-sticky_dir(suite) -> [];
-sticky_dir(doc) -> ["Test that a module with the same name as a module in ",
- "a sticky directory cannot be loaded."];
+%% Test that a module with the same name as a module in
+%% a sticky directory cannot be loaded.
sticky_dir(Config) when is_list(Config) ->
Pa = filename:dirname(code:which(?MODULE)),
- {ok,Node} = ?t:start_node(sticky_dir, slave, [{args,"-pa "++Pa}]),
+ {ok,Node} = test_server:start_node(sticky_dir, slave, [{args,"-pa "++Pa}]),
Mods = [code,lists,erlang,init],
- OutDir = filename:join(?config(priv_dir, Config), sticky_dir),
+ OutDir = filename:join(proplists:get_value(priv_dir, Config), sticky_dir),
_ = file:make_dir(OutDir),
Ret = rpc:call(Node, erlang, apply,
[fun sticky_compiler/2,[Mods,OutDir]]),
@@ -611,9 +570,9 @@ sticky_dir(Config) when is_list(Config) ->
ok;
Other ->
io:format("~p\n", [Other]),
- ?t:fail()
+ ct:fail(failed)
end,
- ?t:stop_node(Node),
+ test_server:stop_node(Node),
ok.
sticky_compiler(Files, PrivDir) ->
@@ -638,34 +597,31 @@ do_sticky_compile(Mod, Dir) ->
ok
end.
-pa_pz_option(suite) -> [];
-pa_pz_option(doc) -> ["Test that the -pa and -pz options work as expected"];
+%% Test that the -pa and -pz options work as expected.
pa_pz_option(Config) when is_list(Config) ->
- DDir = ?config(data_dir,Config),
+ DDir = proplists:get_value(data_dir,Config),
PaDir = filename:join(DDir,"pa"),
PzDir = filename:join(DDir,"pz"),
- {ok, Node}=?t:start_node(pa_pz1, slave,
+ {ok, Node}=test_server:start_node(pa_pz1, slave,
[{args,
"-pa " ++ PaDir
++ " -pz " ++ PzDir}]),
Ret=rpc:call(Node, code, get_path, []),
[PaDir|Paths] = Ret,
[PzDir|_] = lists:reverse(Paths),
- ?t:stop_node(Node),
- {ok, Node2}=?t:start_node(pa_pz2, slave,
+ test_server:stop_node(Node),
+ {ok, Node2}=test_server:start_node(pa_pz2, slave,
[{args,
"-mode embedded " ++ "-pa "
++ PaDir ++ " -pz " ++ PzDir}]),
Ret2=rpc:call(Node2, code, get_path, []),
[PaDir|Paths2] = Ret2,
[PzDir|_] = lists:reverse(Paths2),
- ?t:stop_node(Node2).
+ test_server:stop_node(Node2).
-add_del_path(suite) ->
- [];
-add_del_path(doc) -> ["add_path, del_path should not cause priv_dir(App) to fail"];
+%% add_path, del_path should not cause priv_dir(App) to fail.
add_del_path(Config) when is_list(Config) ->
- DDir = ?config(data_dir,Config),
+ DDir = proplists:get_value(data_dir,Config),
Dir1 = filename:join(DDir,"dummy_app-1.0/ebin"),
Dir2 = filename:join(DDir,"dummy_app-2.0/ebin"),
code:add_patha(Dir1),
@@ -679,17 +635,17 @@ add_del_path(Config) when is_list(Config) ->
clash(Config) when is_list(Config) ->
- DDir = ?config(data_dir,Config)++"clash/",
+ DDir = proplists:get_value(data_dir,Config)++"clash/",
P = code:get_path(),
%% test non-clashing entries
true = code:add_path(DDir++"foobar-0.1/ebin"),
true = code:add_path(DDir++"zork-0.8/ebin"),
- test_server:capture_start(),
+ ct:capture_start(),
ok = code:clash(),
- test_server:capture_stop(),
- [OKMsg|_] = test_server:capture_get(),
+ ct:capture_stop(),
+ [OKMsg|_] = ct:capture_get(),
true = lists:prefix("** Found 0 name clashes", OKMsg),
true = code:set_path(P),
@@ -697,17 +653,17 @@ clash(Config) when is_list(Config) ->
true = code:add_path(DDir++"foobar-0.1/ebin"),
true = code:add_path(DDir++"foobar-0.1.ez/foobar-0.1/ebin"),
- test_server:capture_start(),
+ ct:capture_start(),
ok = code:clash(),
- test_server:capture_stop(),
- [ClashMsg|_] = test_server:capture_get(),
+ ct:capture_stop(),
+ [ClashMsg|_] = ct:capture_get(),
{match, [" hides "]} = re:run(ClashMsg, "\\*\\* .*( hides ).*",
[{capture,all_but_first,list}]),
true = code:set_path(P),
%% test "Bad path can't read"
- Priv = ?config(priv_dir, Config),
+ Priv = proplists:get_value(priv_dir, Config),
TmpEzFile = Priv++"foobar-0.tmp.ez",
{ok, _} = file:copy(DDir++"foobar-0.1.ez", TmpEzFile),
true = code:add_path(TmpEzFile++"/foobar-0.1/ebin"),
@@ -719,20 +675,17 @@ clash(Config) when is_list(Config) ->
_ ->
ok = file:delete(TmpEzFile)
end,
- test_server:capture_start(),
+ ct:capture_start(),
ok = code:clash(),
- test_server:capture_stop(),
- [BadPathMsg|_] = test_server:capture_get(),
+ ct:capture_stop(),
+ [BadPathMsg|_] = ct:capture_get(),
true = lists:prefix("** Bad path can't read", BadPathMsg),
true = code:set_path(P),
file:delete(TmpEzFile++".moved"), %% Only effect on windows
ok.
-ext_mod_dep(suite) ->
- [];
-ext_mod_dep(doc) ->
- ["Every module that the code_server uses should be preloaded, "
- "this test case verifies that"];
+%% Every module that the code_server uses should be preloaded,
+%% this test case verifies that.
ext_mod_dep(Config) when is_list(Config) ->
xref:start(s),
xref:set_default(s, [{verbose,false},{warnings,false},
@@ -748,7 +701,7 @@ ext_mod_dep(Config) when is_list(Config) ->
xref:stop(s),
case Else of
ok -> ok;
- _ -> test_server:fail(Else)
+ _ -> ct:fail(Else)
end
end.
@@ -877,14 +830,14 @@ check_funs({'$M_EXPR','$F_EXPR',1},
%% check_funs(This = {M,_,_}, Path) ->
%% case catch atom_to_list(M) of
%% [$h,$i,$p,$e | _] ->
-%% test_server:format("hipe_module_ignored(~p, ~p)~n", [This, Path]),
+%% io:format("hipe_module_ignored(~p, ~p)~n", [This, Path]),
%% 0;
%% _ ->
-%% test_server:format("not_verified(~p, ~p)~n", [This, Path]),
+%% io:format("not_verified(~p, ~p)~n", [This, Path]),
%% 1
%% end;
check_funs(This, Path) ->
- test_server:format("not_verified(~p, ~p)~n", [This, Path]),
+ io:format("not_verified(~p, ~p)~n", [This, Path]),
1.
my_usort(List) ->
@@ -909,10 +862,7 @@ where_is_file(Config) when is_list(Config) ->
non_existing = code:where_is_file("kernel"), % no such file
ok.
-purge_stacktrace(suite) ->
- [];
-purge_stacktrace(doc) ->
- ["Test that stacktrace is deleted when purging a referred module"];
+%% Test that stacktrace is deleted when purging a referred module.
purge_stacktrace(Config) when is_list(Config) ->
code:purge(code_b_test),
try code_b_test:call(fun(b) -> ok end, a)
@@ -953,7 +903,7 @@ purge_stacktrace(Config) when is_list(Config) ->
ok.
mult_lib_roots(Config) when is_list(Config) ->
- DataDir = filename:join(?config(data_dir, Config), "mult_lib_roots"),
+ DataDir = filename:join(proplists:get_value(data_dir, Config), "mult_lib_roots"),
mult_lib_compile(DataDir, "my_dummy_app-b/ebin/lists"),
mult_lib_compile(DataDir,
"my_dummy_app-c/ebin/code_SUITE_mult_root_module"),
@@ -963,12 +913,11 @@ mult_lib_roots(Config) when is_list(Config) ->
filename:join(DataDir, "second_root"),
{ok,Node} =
- ?t:start_node(mult_lib_roots, slave,
+ test_server:start_node(mult_lib_roots, slave,
[{args,"-env ERL_LIBS "++ErlLibs}]),
- TSPath = filename:dirname(code:which(test_server)),
Path0 = rpc:call(Node, code, get_path, []),
- [TSPath,"."|Path1] = Path0,
+ ["."|Path1] = Path0,
[Kernel|Path2] = Path1,
[Stdlib|Path3] = Path2,
mult_lib_verify_lib(Kernel, "kernel"),
@@ -1012,16 +961,19 @@ mult_lib_remove_prefix([$/|T], []) -> T.
bad_erl_libs(Config) when is_list(Config) ->
{ok,Node} =
- ?t:start_node(mult_lib_roots, slave,
- [{args,"-env ERL_LIBS "}]),
-
- ?t:stop_node(Node),
+ test_server:start_node(bad_erl_libs, slave, []),
+ Code = rpc:call(Node,code,get_path,[]),
+ test_server:stop_node(Node),
{ok,Node2} =
- ?t:start_node(mult_lib_roots, slave,
- [{args,"-env ERL_LIBS /no/such/dir"}]),
+ test_server:start_node(bad_erl_libs, slave,
+ [{args,"-env ERL_LIBS /no/such/dir"}]),
+ Code2 = rpc:call(Node,code,get_path,[]),
+ test_server:stop_node(Node2),
+
+ %% Test that code path is not affected by the faulty ERL_LIBS
+ Code = Code2,
- ?t:stop_node(Node2),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1036,8 +988,8 @@ code_archive2(Config) when is_list(Config) ->
do_code_archive(Config, Root, StripVsn) when is_list(Config) ->
%% Copy the orig files to priv_dir
- DataDir = ?config(data_dir, Config),
- PrivDir = ?config(priv_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
App = code_archive_dict,
VsnBase = atom_to_list(App) ++ "-1.0",
Base =
@@ -1072,7 +1024,7 @@ do_code_archive(Config, Root, StripVsn) when is_list(Config) ->
%% Set up ERL_LIBS and start a slave node.
{ok, Node} =
- ?t:start_node(code_archive, slave,
+ test_server:start_node(code_archive, slave,
[{args,"-env ERL_LIBS " ++ RootDir}]),
CodePath = rpc:call(Node, code, get_path, []),
AppEbin = filename:join([Archive, Base, "ebin"]),
@@ -1103,7 +1055,7 @@ do_code_archive(Config, Root, StripVsn) when is_list(Config) ->
error = rpc:call(Node, App, find, [Tab, Key]),
ok = rpc:call(Node, App, erase, [Tab]),
- ?t:stop_node(Node),
+ test_server:stop_node(Node),
ok.
compile_app(TopDir, AppName) ->
@@ -1129,15 +1081,12 @@ compile_files([File | Files], SrcDir, OutDir) ->
compile_files([], _, _) ->
ok.
-big_boot_embedded(suite) ->
- [];
-big_boot_embedded(doc) ->
- ["Test that a boot file with (almost) all of OTP can be used to start an"
- " embeddedd system."];
+%% Test that a boot file with (almost) all of OTP can be used to start an
+%% embeddedd system.
big_boot_embedded(Config) when is_list(Config) ->
{BootArg,AppsInBoot} = create_big_boot(Config),
{ok, Node} =
- ?t:start_node(big_boot_embedded, slave,
+ test_server:start_node(big_boot_embedded, slave,
[{args,"-boot "++BootArg++" -mode embedded"}]),
RemoteNodeApps =
[ {X,Y} || {X,_,Y} <-
@@ -1148,7 +1097,7 @@ big_boot_embedded(Config) when is_list(Config) ->
on_load(Config) when is_list(Config) ->
Master = on_load_test_case_process,
- Data = filename:join([?config(data_dir, Config),"on_load"]),
+ Data = filename:join([proplists:get_value(data_dir, Config),"on_load"]),
ok = file:set_cwd(Data),
up_to_date = make:all([{d,'MASTER',Master}]),
@@ -1192,7 +1141,7 @@ on_load(Config) when is_list(Config) ->
on_load_wait_for_all(Refs),
receive
Any ->
- ?t:fail({unexpected,Any})
+ ct:fail({unexpected,Any})
after 10 ->
ok
end.
@@ -1260,7 +1209,7 @@ on_load_embedded(Config) when is_list(Config) ->
end.
on_load_embedded_1(Config) ->
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
%% Link the on_load_app application into the lib directory.
LibRoot = code:lib_dir(),
@@ -1315,7 +1264,7 @@ create_boot(Config, Options) ->
filename:join(LatestDir, LatestName).
create_script(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
Name = PrivDir ++ "on_load_test",
Apps = application_controller:which_applications(),
{value,{_,_,KernelVer}} = lists:keysearch(kernel, 1, Apps),
@@ -1342,33 +1291,46 @@ create_big_boot(Config) ->
ok = file:set_cwd(OldDir),
{filename:join(LatestDir, LatestName),Apps}.
-% The following apps cannot be loaded
-% hipe .app references (or can reference) files that have no
-% corresponding beam file (if hipe is not enabled)
+%% The following apps cannot be loaded.
+%% hipe .app references (or can reference) files that have no
+%% corresponding beam file (if hipe is not enabled).
filter_app("hipe",_) -> false;
-% Dialyzer and typer depends on hipe
+
+%% Dialyzer and typer depends on hipe
filter_app("dialyzer",_) -> false;
filter_app("typer",_) -> false;
-% Orber requires explicit configuration
+
+%% Orber requires explicit configuration
filter_app("orber",_) -> false;
-% cos* depends on orber
+
+%% cos* depends on orber
filter_app("cos"++_,_) -> false;
-% ic has a mod instruction in the app file but no corresponding start function
+
+%% ic has a mod instruction in the app file but no corresponding start
+%% function
filter_app("ic",_) -> false;
-% Netconf has some dependency that I really do not understand (maybe like orber)
+
+%% Netconf has some dependency that I really do not understand (maybe
+%% like orber)
filter_app("netconf",_) -> false;
-% Safe has the same kind of error in the .app file as ic
+
+%% Safe has the same kind of error in the .app file as ic
filter_app("safe",_) -> false;
-% Comte cannot be started in the "usual" way
+
+%% Comte cannot be started in the "usual" way
filter_app("comte",_) -> false;
-% OS_mon does not find it's port program when running cerl
+
+%% OS_mon does not find its port program when running cerl
filter_app("os_mon",true) -> false;
-% erts is not a "real" app either =/
+
+%% erts is not a "real" app either =/
filter_app("erts",_) -> false;
-% Other apps should be OK.
+
+%% Other apps should be OK.
filter_app(_,_) -> true.
+
create_big_script(Config,Local) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
Name = filename:join(PrivDir,"full_script_test"),
InitialApplications=application:loaded_applications(),
%% Applications left loaded by the application suite, unload them!
@@ -1402,7 +1364,7 @@ on_load_errors(Config) when is_list(Config) ->
Master = on_load_error_test_case_process,
register(Master, self()),
- Data = filename:join([?config(data_dir, Config),"on_load_errors"]),
+ Data = filename:join([proplists:get_value(data_dir, Config),"on_load_errors"]),
ok = file:set_cwd(Data),
up_to_date = make:all([{d,'MASTER',Master}]),
@@ -1428,7 +1390,7 @@ on_load_errors(Config) when is_list(Config) ->
%% There should be no more messages.
receive
Unexpected ->
- ?t:fail({unexpected,Unexpected})
+ ct:fail({unexpected,Unexpected})
after 10 ->
ok
end,
@@ -1457,8 +1419,7 @@ do_on_load_error(ReturnValue) ->
{undef,[{on_load_error,main,[],_}|_]} = Exit
end.
-native_early_modules(suite) -> [];
-native_early_modules(doc) -> ["Test that the native code of early loaded modules is loaded"];
+%% Test that the native code of early loaded modules is loaded.
native_early_modules(Config) when is_list(Config) ->
case erlang:system_info(hipe_architecture) of
undefined ->
@@ -1486,8 +1447,7 @@ native_early_modules_1(Architecture) ->
ok
end.
-get_mode(suite) -> [];
-get_mode(doc) -> ["Test that the mode of the code server is properly retrieved"];
+%% Test that the mode of the code server is properly retrieved.
get_mode(Config) when is_list(Config) ->
interactive = code:get_mode().
@@ -1517,7 +1477,7 @@ terminate(_Reason, State) ->
%%%
start_node(Name, Param) ->
- ?t:start_node(Name, slave, [{args, Param}]).
+ test_server:start_node(Name, slave, [{args, Param}]).
stop_node(Node) ->
- ?t:stop_node(Node).
+ test_server:stop_node(Node).
diff --git a/lib/kernel/test/disk_log_SUITE.erl b/lib/kernel/test/disk_log_SUITE.erl
index 21da958c11..135144bbe7 100644
--- a/lib/kernel/test/disk_log_SUITE.erl
+++ b/lib/kernel/test/disk_log_SUITE.erl
@@ -19,7 +19,7 @@
%%
-module(disk_log_SUITE).
-%-define(debug, true).
+%%-define(debug, true).
-ifdef(debug).
-define(format(S, A), io:format(S, A)).
@@ -31,8 +31,8 @@
-else.
-include_lib("common_test/include/ct.hrl").
-define(format(S, A), ok).
--define(privdir(Conf), ?config(priv_dir, Conf)).
--define(datadir(Conf), ?config(data_dir, Conf)).
+-define(privdir(Conf), proplists:get_value(priv_dir, Conf)).
+-define(datadir(Conf), proplists:get_value(data_dir, Conf)).
-endif.
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
@@ -102,8 +102,6 @@
-export([client/4]).
--define(default_timeout, ?t:minutes(1)).
-
%% error_logger
-export([init/1,
handle_event/2, handle_call/2, handle_info/2,
@@ -139,7 +137,9 @@
change_size_after, default_size]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[{group, halt_int}, {group, wrap_int},
@@ -194,259 +194,229 @@ end_per_group(_GroupName, Config) ->
-init_per_testcase(Case, Config) ->
- case should_skip(Case,Config) of
- true ->
- CS = check_nfs(Config),
- {skipped, lists:flatten
- (io_lib:format
- ("The test does not work "
- "with current NFS cache size (~w),"
- " to get this test to run, "
- "~s the NFS cache size~n",
- [CS, case CS of
- 0 ->
- "enlarge";
- _ ->
- "zero"
- end]))};
- _ ->
- Dog=?t:timetrap(?t:minutes(2)),
- [{watchdog, Dog}|Config]
- end.
+init_per_testcase(_Case, Config) ->
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-halt_int_inf(suite) -> [];
-halt_int_inf(doc) -> ["Test simple halt disk log, size infinity"];
+%% Test simple halt disk log, size infinity.
halt_int_inf(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
- ?line ok = disk_log:start(),
+ ok = disk_log:start(),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
- {format,internal},
- {file, File}]),
- ?line simple_log(a),
- ?line ok = disk_log:close(a),
- ?line ok = file:delete(File).
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
+ {format,internal},
+ {file, File}]),
+ simple_log(a),
+ ok = disk_log:close(a),
+ ok = file:delete(File).
-halt_int_sz_1(suite) -> [];
-halt_int_sz_1(doc) -> ["Test simple halt disk log, size defined"];
+%% Test simple halt disk log, size defined.
halt_int_sz_1(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,18000},
- {format,internal},
- {file, File}]),
- ?line simple_log(a),
- ?line ok = disk_log:truncate(a),
- ?line [] = get_all_terms(a),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,18000},
+ {format,internal},
+ {file, File}]),
+ simple_log(a),
+ ok = disk_log:truncate(a),
+ [] = get_all_terms(a),
T1 = mk_bytes(10000),
T2 = mk_bytes(5000),
- ?line ok = disk_log:log(a, T1),
- ?line case get_all_terms(a) of
- [T1] ->
- ok;
- E1 ->
- test_server_fail({bad_terms, E1, [T1]})
- end,
- ?line ok = disk_log:log(a, T2),
- ?line {error, {full, a}} = disk_log:log(a, T1),
- ?line ok = disk_log:alog(a, T1),
- ?line case get_all_terms(a) of
- [T1, T2] ->
- ok;
- E2 ->
- test_server_fail({bad_terms, E2, [T1, T2]})
- end,
- ?line ok = disk_log:close(a),
- ?line ok = file:delete(File).
+ ok = disk_log:log(a, T1),
+ case get_all_terms(a) of
+ [T1] ->
+ ok;
+ E1 ->
+ test_server_fail({bad_terms, E1, [T1]})
+ end,
+ ok = disk_log:log(a, T2),
+ {error, {full, a}} = disk_log:log(a, T1),
+ ok = disk_log:alog(a, T1),
+ case get_all_terms(a) of
+ [T1, T2] ->
+ ok;
+ E2 ->
+ test_server_fail({bad_terms, E2, [T1, T2]})
+ end,
+ ok = disk_log:close(a),
+ ok = file:delete(File).
-halt_int_sz_2(suite) -> [];
-halt_int_sz_2(doc) -> ["Test simple halt disk log, size ~8192"];
+%% Test simple halt disk log, size ~8192.
halt_int_sz_2(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File1 = filename:join(Dir, "a.LOG"),
File2 = filename:join(Dir, "b.LOG"),
File3 = filename:join(Dir, "c.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,8191},
- {format,internal},
- {file, File1}]),
- ?line {ok, b} = disk_log:open([{name,b}, {type,halt}, {size,8192},
- {format,internal},
- {file, File2}]),
- ?line {ok, c} = disk_log:open([{name,c}, {type,halt}, {size,8193},
- {format,internal},
- {file, File3}]),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,8191},
+ {format,internal},
+ {file, File1}]),
+ {ok, b} = disk_log:open([{name,b}, {type,halt}, {size,8192},
+ {format,internal},
+ {file, File2}]),
+ {ok, c} = disk_log:open([{name,c}, {type,halt}, {size,8193},
+ {format,internal},
+ {file, File3}]),
T1 = mk_bytes(8191-16), % 16 is size of header + magics for 1 item
T2 = mk_bytes(8192-16),
T3 = mk_bytes(8193-16),
- ?line ok = disk_log:log(a, T1),
- ?line ok = disk_log:log(b, T2),
- ?line ok = disk_log:log(c, T3),
- ?line case get_all_terms(a) of
- [T1] ->
- ok;
- E1 ->
- test_server_fail({bad_terms, E1, [T1]})
- end,
- ?line case get_all_terms(b) of
- [T2] ->
- ok;
- E2 ->
- test_server_fail({bad_terms, E2, [T2]})
- end,
- ?line case get_all_terms(c) of
- [T3] ->
- ok;
- E3 ->
- test_server_fail({bad_terms, E3, [T3]})
- end,
- ?line ok = disk_log:truncate(a),
- ?line ok = disk_log:truncate(b),
- ?line {error, {full, a}} = disk_log:log(a, T2),
- ?line {error, {full, b}} = disk_log:log(b, T3),
- ?line [] = get_all_terms(a),
- ?line [] = get_all_terms(b),
- ?line ok = disk_log:close(a),
- ?line ok = disk_log:close(b),
- ?line ok = disk_log:close(c),
- ?line ok = file:delete(File1),
- ?line ok = file:delete(File2),
- ?line ok = file:delete(File3),
+ ok = disk_log:log(a, T1),
+ ok = disk_log:log(b, T2),
+ ok = disk_log:log(c, T3),
+ case get_all_terms(a) of
+ [T1] ->
+ ok;
+ E1 ->
+ test_server_fail({bad_terms, E1, [T1]})
+ end,
+ case get_all_terms(b) of
+ [T2] ->
+ ok;
+ E2 ->
+ test_server_fail({bad_terms, E2, [T2]})
+ end,
+ case get_all_terms(c) of
+ [T3] ->
+ ok;
+ E3 ->
+ test_server_fail({bad_terms, E3, [T3]})
+ end,
+ ok = disk_log:truncate(a),
+ ok = disk_log:truncate(b),
+ {error, {full, a}} = disk_log:log(a, T2),
+ {error, {full, b}} = disk_log:log(b, T3),
+ [] = get_all_terms(a),
+ [] = get_all_terms(b),
+ ok = disk_log:close(a),
+ ok = disk_log:close(b),
+ ok = disk_log:close(c),
+ ok = file:delete(File1),
+ ok = file:delete(File2),
+ ok = file:delete(File3),
ok.
-halt_int_ro(suite) -> [];
-halt_int_ro(doc) -> ["Test simple halt disk log, read only, internal"];
+%% Test simple halt disk log, read only, internal.
halt_int_ro(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
- {format,internal}, {file, File}]),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
+ {format,internal}, {file, File}]),
simple_log(a),
- ?line ok = disk_log:close(a),
+ ok = disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
- {format,internal}, {file, File},
- {mode,read_only}]),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
+ {format,internal}, {file, File},
+ {mode,read_only}]),
T1 = "not allowed to write",
- ?line {error, {read_only_mode, a}} = disk_log:log(a, T1),
- ?line ok = disk_log:close(a),
- ?line ok = file:delete(File).
+ {error, {read_only_mode, a}} = disk_log:log(a, T1),
+ ok = disk_log:close(a),
+ ok = file:delete(File).
-halt_ext_ro(suite) -> [];
-halt_ext_ro(doc) -> ["Test simple halt disk log, read only, external"];
+%% Test simple halt disk log, read only, external.
halt_ext_ro(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
- {format,external}, {file, File}]),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
+ {format,external}, {file, File}]),
xsimple_log(File, a),
- ?line ok = disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
- {format,external}, {file, File},
- {mode,read_only}]),
+ ok = disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
+ {format,external}, {file, File},
+ {mode,read_only}]),
T1 = "not allowed to write",
- ?line {error, {read_only_mode, a}} = disk_log:blog(a, T1),
- ?line ok = disk_log:close(a),
- ?line ok = file:delete(File).
+ {error, {read_only_mode, a}} = disk_log:blog(a, T1),
+ ok = disk_log:close(a),
+ ok = file:delete(File).
-wrap_int_ro(suite) -> [];
-wrap_int_ro(doc) -> ["Test simple wrap disk log, read only, internal"];
+%% Test simple wrap disk log, read only, internal.
wrap_int_ro(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
- {format,internal}, {file, File}]),
+ {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
+ {format,internal}, {file, File}]),
simple_log(a),
- ?line ok = disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
- {format,internal}, {file, File}, {mode,read_only}]),
+ ok = disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
+ {format,internal}, {file, File}, {mode,read_only}]),
T1 = "not allowed to write",
- ?line {error, {read_only_mode, a}} = disk_log:log(a, T1),
- ?line ok = disk_log:close(a),
- ?line del(File, 4).
+ {error, {read_only_mode, a}} = disk_log:log(a, T1),
+ ok = disk_log:close(a),
+ del(File, 4).
-wrap_ext_ro(suite) -> [];
-wrap_ext_ro(doc) -> ["Test simple wrap disk log, read only, external"];
+%% Test simple wrap disk log, read only, external.
wrap_ext_ro(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
- {format,external}, {file, File}]),
+ {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
+ {format,external}, {file, File}]),
x2simple_log(File ++ ".1", a),
- ?line ok = disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
- {format,external}, {file, File},
- {mode,read_only}]),
+ ok = disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
+ {format,external}, {file, File},
+ {mode,read_only}]),
T1 = "not allowed to write",
- ?line {error, {read_only_mode, a}} = disk_log:blog(a, T1),
- ?line {error, {read_only_mode, a}} = disk_log:inc_wrap_file(a),
- ?line ok = disk_log:close(a),
+ {error, {read_only_mode, a}} = disk_log:blog(a, T1),
+ {error, {read_only_mode, a}} = disk_log:inc_wrap_file(a),
+ ok = disk_log:close(a),
del(File, 4).
-halt_trunc(suite) -> [];
-halt_trunc(doc) -> ["Test truncation of halt disk log"];
+%% Test truncation of halt disk log.
halt_trunc(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
- {format,internal}, {file, File}]),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
+ {format,internal}, {file, File}]),
simple_log(a),
- ?line ok = disk_log:close(a),
- ?line {error,{badarg,repair_read_only}} =
+ ok = disk_log:close(a),
+ {error,{badarg,repair_read_only}} =
disk_log:open([{name,a}, {type,halt}, {size,infinity},
{repair, truncate}, {format,internal},
{file, File}, {mode,read_only}]),
- ?line ok = file:delete(File).
+ ok = file:delete(File).
-halt_misc(suite) -> [];
-halt_misc(doc) -> ["Test truncation of halt disk log"];
+%% Test truncation of halt disk log.
halt_misc(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
- {format,internal}, {file, File}]),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
+ {format,internal}, {file, File}]),
simple_log(a),
- ?line ok = disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
- {format,internal}, {file, File},
- {mode,read_only}]),
+ ok = disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
+ {format,internal}, {file, File},
+ {mode,read_only}]),
T1 = "not allowed to write",
- ?line {error, {read_only_mode, a}} = disk_log:log(a, T1),
- ?line {error, {read_only_mode, a}} = disk_log:sync(a),
- ?line {error, {read_only_mode, a}} = disk_log:reopen(a, "b.LOG"),
- ?line {error, {read_only_mode, a}} =
+ {error, {read_only_mode, a}} = disk_log:log(a, T1),
+ {error, {read_only_mode, a}} = disk_log:sync(a),
+ {error, {read_only_mode, a}} = disk_log:reopen(a, "b.LOG"),
+ {error, {read_only_mode, a}} =
disk_log:change_header(a, {head,header}),
- ?line {error, {read_only_mode, a}} =
+ {error, {read_only_mode, a}} =
disk_log:change_size(a, infinity),
- ?line ok = disk_log:close(a),
- ?line ok = file:delete(File).
+ ok = disk_log:close(a),
+ ok = file:delete(File).
-halt_ro_alog(suite) -> [];
-halt_ro_alog(doc) -> ["Test truncation of halt disk log, read only"];
+%% Test truncation of halt disk log, read only.
halt_ro_alog(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
- {format,internal}, {file, File}]),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
+ {format,internal}, {file, File}]),
simple_log(a),
- ?line ok = disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
- {notify,true}, {format,internal},
- {file, File}, {mode,read_only}]),
+ ok = disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
+ {notify,true}, {format,internal},
+ {file, File}, {mode,read_only}]),
T1 = "not allowed to write",
- ?line ok = disk_log:alog(a, T1),
- ?line ok = halt_ro_alog_wait_notify(a, T1),
- ?line ok = disk_log:close(a),
- ?line ok = file:delete(File).
+ ok = disk_log:alog(a, T1),
+ ok = halt_ro_alog_wait_notify(a, T1),
+ ok = disk_log:close(a),
+ ok = file:delete(File).
halt_ro_alog_wait_notify(Log, T) ->
Term = term_to_binary(T),
@@ -459,23 +429,22 @@ halt_ro_alog_wait_notify(Log, T) ->
failed
end.
-halt_ro_balog(suite) -> [];
-halt_ro_balog(doc) -> ["Test truncation of halt disk log, read only"];
+%% Test truncation of halt disk log, read only.
halt_ro_balog(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
- {format,internal}, {file, File}]),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
+ {format,internal}, {file, File}]),
simple_log(a),
- ?line ok = disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
- {notify,true}, {format,external},
- {file, File}, {mode,read_only}]),
+ ok = disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
+ {notify,true}, {format,external},
+ {file, File}, {mode,read_only}]),
T1 = "not allowed to write",
- ?line ok = disk_log:balog(a, T1),
- ?line ok = halt_ro_balog_wait_notify(a, T1),
- ?line ok = disk_log:close(a),
- ?line ok = file:delete(File).
+ ok = disk_log:balog(a, T1),
+ ok = halt_ro_balog_wait_notify(a, T1),
+ ok = disk_log:close(a),
+ ok = file:delete(File).
halt_ro_balog_wait_notify(Log, T) ->
Term = list_to_binary(T),
@@ -488,127 +457,123 @@ halt_ro_balog_wait_notify(Log, T) ->
failed
end.
-halt_ro_crash(suite) -> [];
-halt_ro_crash(doc) -> ["Test truncation of halt disk log, read only, repair"];
+%% Test truncation of halt disk log, read only, repair.
halt_ro_crash(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line file:delete(File),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
- {format,internal},{file, File}]),
+ file:delete(File),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
+ {format,internal},{file, File}]),
simple_log(a),
- ?line ok = disk_log:close(a),
+ ok = disk_log:close(a),
crash(File, 10),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
- {notify,true}, {format,internal},
- {file, File}, {mode,read_only}]),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
+ {notify,true}, {format,internal},
+ {file, File}, {mode,read_only}]),
- ?line Error1 = {error, {read_only_mode, a}} = disk_log:truncate(a),
- ?line "The disk log" ++ _ = format_error(Error1),
+ Error1 = {error, {read_only_mode, a}} = disk_log:truncate(a),
+ "The disk log" ++ _ = format_error(Error1),
%% crash/1 sets the length of the first item to something big (2.5 kb).
%% In R6B, binary_to_term accepts garbage at the end of the binary,
%% which means that the first item is recognized!
%% This is how it was before R6B:
- %% ?line {C1,T1,15} = disk_log:chunk(a,start),
- %% ?line {C2,T2} = disk_log:chunk(a,C1),
+ %% {C1,T1,15} = disk_log:chunk(a,start),
+ %% {C2,T2} = disk_log:chunk(a,C1),
{C1,_OneItem,7478} = disk_log:chunk(a,start),
{C2, [], 7} = disk_log:chunk(a,C1),
- ?line eof = disk_log:chunk(a,C2),
- ?line ok = disk_log:close(a),
- ?line ok = file:delete(File).
+ eof = disk_log:chunk(a,C2),
+ ok = disk_log:close(a),
+ ok = file:delete(File).
-wrap_int_1(suite) -> [];
-wrap_int_1(doc) -> ["Test wrap disk log, internal"];
+%% Test wrap disk log, internal.
wrap_int_1(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
- {format,internal},
- {file, File}]),
- ?line [_] =
+ {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
+ {format,internal},
+ {file, File}]),
+ [_] =
lists:filter(fun(P) -> disk_log:pid2name(P) =/= undefined end,
erlang:processes()),
simple_log(a),
- ?line ok = disk_log:close(a),
+ ok = disk_log:close(a),
del(File, 4),
- ?line {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
- {format,internal},
- {file, File}]),
- ?line [] = get_all_terms(a),
+ {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
+ {format,internal},
+ {file, File}]),
+ [] = get_all_terms(a),
T1 = mk_bytes(10000), % file 2
T2 = mk_bytes(5000), % file 3
T3 = mk_bytes(4000), % file 4
T4 = mk_bytes(2000), % file 4
T5 = mk_bytes(5000), % file 1
T6 = mk_bytes(5000), % file 2
- ?line ok = disk_log:log(a, T1),
- ?line ok = disk_log:log(a, T2),
- ?line ok = disk_log:log(a, T3),
- ?line ok = disk_log:log_terms(a, [T4, T5, T6]),
- ?line case get_all_terms(a) of
- [T2,T3,T4,T5,T6] ->
- ok;
- E1 ->
- test_server_fail({bad_terms, E1, [T2,T3,T4,T5,T6]})
- end,
- ?line ok = disk_log:close(a),
+ ok = disk_log:log(a, T1),
+ ok = disk_log:log(a, T2),
+ ok = disk_log:log(a, T3),
+ ok = disk_log:log_terms(a, [T4, T5, T6]),
+ case get_all_terms(a) of
+ [T2,T3,T4,T5,T6] ->
+ ok;
+ E1 ->
+ test_server_fail({bad_terms, E1, [T2,T3,T4,T5,T6]})
+ end,
+ ok = disk_log:close(a),
del(File, 4).
-wrap_int_2(suite) -> [];
-wrap_int_2(doc) -> ["Test wrap disk log, internal"];
+%% Test wrap disk log, internal.
wrap_int_2(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File1 = filename:join(Dir, "a.LOG"),
File2 = filename:join(Dir, "b.LOG"),
File3 = filename:join(Dir, "c.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8191,3}},
- {format,internal},
- {file, File1}]),
- ?line {ok, b} = disk_log:open([{name,b}, {type,wrap}, {size,{8192,3}},
- {format,internal},
- {file, File2}]),
- ?line {ok, c} = disk_log:open([{name,c}, {type,wrap}, {size,{8193,3}},
- {format,internal},
- {file, File3}]),
+ {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8191,3}},
+ {format,internal},
+ {file, File1}]),
+ {ok, b} = disk_log:open([{name,b}, {type,wrap}, {size,{8192,3}},
+ {format,internal},
+ {file, File2}]),
+ {ok, c} = disk_log:open([{name,c}, {type,wrap}, {size,{8193,3}},
+ {format,internal},
+ {file, File3}]),
T1 = mk_bytes(8191-16), % 16 is size of header + magics for 1 item
T2 = mk_bytes(8192-16),
T3 = mk_bytes(8193-16),
- ?line ok = disk_log:log(a, T1),
- ?line ok = disk_log:log(b, T2),
- ?line ok = disk_log:log(c, T3),
- ?line case get_all_terms(a) of
- [T1] ->
- ok;
- E1 ->
- test_server_fail({bad_terms, E1, [T1]})
- end,
- ?line case get_all_terms(b) of
- [T2] ->
- ok;
- E2 ->
- test_server_fail({bad_terms, E2, [T2]})
- end,
- ?line case get_all_terms(c) of
- [T3] ->
- ok;
- E3 ->
- test_server_fail({bad_terms, E3, [T3]})
- end,
- ?line ok = disk_log:close(a),
- ?line ok = disk_log:close(b),
- ?line ok = disk_log:close(c),
+ ok = disk_log:log(a, T1),
+ ok = disk_log:log(b, T2),
+ ok = disk_log:log(c, T3),
+ case get_all_terms(a) of
+ [T1] ->
+ ok;
+ E1 ->
+ test_server_fail({bad_terms, E1, [T1]})
+ end,
+ case get_all_terms(b) of
+ [T2] ->
+ ok;
+ E2 ->
+ test_server_fail({bad_terms, E2, [T2]})
+ end,
+ case get_all_terms(c) of
+ [T3] ->
+ ok;
+ E3 ->
+ test_server_fail({bad_terms, E3, [T3]})
+ end,
+ ok = disk_log:close(a),
+ ok = disk_log:close(b),
+ ok = disk_log:close(c),
del(File1, 3),
del(File2, 3),
del(File3, 3).
-inc_wrap_file(suite) -> [];
-inc_wrap_file(doc) -> ["Test disk log, force a change to next file"];
+%% Test disk log, force a change to next file.
inc_wrap_file(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File1 = filename:join(Dir, "a.LOG"),
@@ -616,262 +581,257 @@ inc_wrap_file(Conf) when is_list(Conf) ->
File3 = filename:join(Dir, "c.LOG"),
%% Test that halt logs gets an error message
- ?line {ok, a} = disk_log:open([{name, a}, {type, halt},
- {format, internal},
- {file, File1}]),
- ?line ok = disk_log:log(a, "message one"),
- ?line {error, {halt_log, a}} = disk_log:inc_wrap_file(a),
+ {ok, a} = disk_log:open([{name, a}, {type, halt},
+ {format, internal},
+ {file, File1}]),
+ ok = disk_log:log(a, "message one"),
+ {error, {halt_log, a}} = disk_log:inc_wrap_file(a),
%% test an internally formatted wrap log file
- ?line {ok, b} = disk_log:open([{name, b}, {type, wrap}, {size, {100,3}},
- {format, internal}, {head, 'thisisahead'},
- {file, File2}]),
- ?line ok = disk_log:log(b, "message one"),
- ?line ok = disk_log:inc_wrap_file(b),
- ?line ok = disk_log:log(b, "message two"),
- ?line ok = disk_log:inc_wrap_file(b),
- ?line ok = disk_log:log(b, "message three"),
- ?line ok = disk_log:inc_wrap_file(b),
- ?line ok = disk_log:log(b, "message four"),
- ?line T1 = get_all_terms(b),
- ?line ['thisisahead', "message two",
- 'thisisahead', "message three",
- 'thisisahead', "message four"] = T1,
+ {ok, b} = disk_log:open([{name, b}, {type, wrap}, {size, {100,3}},
+ {format, internal}, {head, 'thisisahead'},
+ {file, File2}]),
+ ok = disk_log:log(b, "message one"),
+ ok = disk_log:inc_wrap_file(b),
+ ok = disk_log:log(b, "message two"),
+ ok = disk_log:inc_wrap_file(b),
+ ok = disk_log:log(b, "message three"),
+ ok = disk_log:inc_wrap_file(b),
+ ok = disk_log:log(b, "message four"),
+ T1 = get_all_terms(b),
+ ['thisisahead', "message two",
+ 'thisisahead', "message three",
+ 'thisisahead', "message four"] = T1,
%% test an externally formatted wrap log file
- ?line {ok, c} = disk_log:open([{name, c}, {type, wrap}, {size, {100,3}},
- {format,external}, {head,"this is a head "},
- {file, File3}]),
- ?line ok = disk_log:blog(c, "message one"),
- ?line ok = disk_log:inc_wrap_file(c),
- ?line ok = disk_log:blog(c, "message two"),
- ?line ok = disk_log:inc_wrap_file(c),
- ?line ok = disk_log:blog(c, "message three"),
- ?line ok = disk_log:inc_wrap_file(c),
- ?line ok = disk_log:blog(c, "message four"),
- ?line ok = disk_log:sync(c),
- ?line {ok, Fd31} = file:open(File3 ++ ".1", [read]),
- ?line {ok,"this is a head message four"} = file:read(Fd31, 200),
- ?line {ok, Fd32} = file:open(File3 ++ ".2", [read]),
- ?line {ok,"this is a head message two"} = file:read(Fd32, 200),
- ?line {ok, Fd33} = file:open(File3 ++ ".3", [read]),
- ?line {ok,"this is a head message three"} = file:read(Fd33, 200),
- ?line ok = file:close(Fd31),
- ?line ok = file:close(Fd32),
- ?line ok = file:close(Fd33),
-
- ?line ok = disk_log:close(a),
- ?line ok = disk_log:close(b),
- ?line ok = disk_log:close(c),
- ?line ok = file:delete(File1),
+ {ok, c} = disk_log:open([{name, c}, {type, wrap}, {size, {100,3}},
+ {format,external}, {head,"this is a head "},
+ {file, File3}]),
+ ok = disk_log:blog(c, "message one"),
+ ok = disk_log:inc_wrap_file(c),
+ ok = disk_log:blog(c, "message two"),
+ ok = disk_log:inc_wrap_file(c),
+ ok = disk_log:blog(c, "message three"),
+ ok = disk_log:inc_wrap_file(c),
+ ok = disk_log:blog(c, "message four"),
+ ok = disk_log:sync(c),
+ {ok, Fd31} = file:open(File3 ++ ".1", [read]),
+ {ok,"this is a head message four"} = file:read(Fd31, 200),
+ {ok, Fd32} = file:open(File3 ++ ".2", [read]),
+ {ok,"this is a head message two"} = file:read(Fd32, 200),
+ {ok, Fd33} = file:open(File3 ++ ".3", [read]),
+ {ok,"this is a head message three"} = file:read(Fd33, 200),
+ ok = file:close(Fd31),
+ ok = file:close(Fd32),
+ ok = file:close(Fd33),
+
+ ok = disk_log:close(a),
+ ok = disk_log:close(b),
+ ok = disk_log:close(c),
+ ok = file:delete(File1),
del(File2, 3),
del(File3, 3).
-halt_ext_inf(suite) -> [];
-halt_ext_inf(doc) -> ["Test halt disk log, external, infinity"];
+%% Test halt disk log, external, infinity.
halt_ext_inf(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
- {format,external},
- {file, File}]),
- ?line xsimple_log(File, a),
- ?line ok = disk_log:close(a),
- ?line ok = file:delete(File).
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,infinity},
+ {format,external},
+ {file, File}]),
+ xsimple_log(File, a),
+ ok = disk_log:close(a),
+ ok = file:delete(File).
-halt_ext_sz_1(suite) -> [];
-halt_ext_sz_1(doc) -> ["Test halt disk log, external, size defined"];
+%% Test halt disk log, external, size defined.
halt_ext_sz_1(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,18000},
- {format,external},
- {file, File}]),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,18000},
+ {format,external},
+ {file, File}]),
xsimple_log(File, a),
- ?line ok = disk_log:truncate(a),
- ?line [] = get_list(File, a),
+ ok = disk_log:truncate(a),
+ [] = get_list(File, a),
{B1, T1} = x_mk_bytes(10000),
{B2, T2} = x_mk_bytes(5000),
{B3, T3} = x_mk_bytes(1000),
- ?line ok = disk_log:blog(a, B1),
- ?line case get_list(File, a) of
- T1 ->
- ok;
- E1 ->
- test_server_fail({bad_terms, E1, T1})
- end,
- ?line ok = disk_log:blog(a, B2),
- ?line {error, {full, a}} = disk_log:blog_terms(a, [B3,B3,B1]),
- ?line ok = disk_log:balog(a, B1),
- ?line Tmp = T1 ++ T2 ++ T3 ++ T3,
- ?line case get_list(File, a) of
- Tmp ->
- ok;
- E2 ->
- test_server_fail({bad_terms, E2, Tmp})
- end,
- ?line ok = disk_log:close(a),
- ?line ok = file:delete(File).
+ ok = disk_log:blog(a, B1),
+ case get_list(File, a) of
+ T1 ->
+ ok;
+ E1 ->
+ test_server_fail({bad_terms, E1, T1})
+ end,
+ ok = disk_log:blog(a, B2),
+ {error, {full, a}} = disk_log:blog_terms(a, [B3,B3,B1]),
+ ok = disk_log:balog(a, B1),
+ Tmp = T1 ++ T2 ++ T3 ++ T3,
+ case get_list(File, a) of
+ Tmp ->
+ ok;
+ E2 ->
+ test_server_fail({bad_terms, E2, Tmp})
+ end,
+ ok = disk_log:close(a),
+ ok = file:delete(File).
-halt_ext_sz_2(suite) -> [];
-halt_ext_sz_2(doc) -> ["Test halt disk log, external, size defined"];
+%% Test halt disk log, external, size defined.
halt_ext_sz_2(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File1 = filename:join(Dir, "a.LOG"),
File2 = filename:join(Dir, "b.LOG"),
File3 = filename:join(Dir, "c.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,8191},
- {format,external},
- {file, File1}]),
- ?line {ok, b} = disk_log:open([{name,b}, {type,halt}, {size,8192},
- {format,external},
- {file, File2}]),
- ?line {ok, c} = disk_log:open([{name,c}, {type,halt}, {size,8193},
- {format,external},
- {file, File3}]),
+ {ok, a} = disk_log:open([{name,a}, {type,halt}, {size,8191},
+ {format,external},
+ {file, File1}]),
+ {ok, b} = disk_log:open([{name,b}, {type,halt}, {size,8192},
+ {format,external},
+ {file, File2}]),
+ {ok, c} = disk_log:open([{name,c}, {type,halt}, {size,8193},
+ {format,external},
+ {file, File3}]),
{B1, T1} = x_mk_bytes(8191),
{B2, T2} = x_mk_bytes(8192),
{B3, T3} = x_mk_bytes(8193),
- ?line ok = disk_log:blog(a, B1),
- ?line ok = disk_log:blog(b, B2),
- ?line ok = disk_log:blog(c, B3),
- ?line case get_list(File1, a) of
- T1 ->
- ok;
- E1 ->
- test_server_fail({bad_terms, E1, T1})
- end,
- ?line case get_list(File2, b) of
- T2 ->
- ok;
- E2 ->
- test_server_fail({bad_terms, E2, T2})
- end,
- ?line case get_list(File3, c) of
- T3 ->
- ok;
- E3 ->
- test_server_fail({bad_terms, E3, T3})
- end,
- ?line ok = disk_log:truncate(a),
- ?line ok = disk_log:truncate(b),
- ?line {error, {full, a}} = disk_log:blog(a, B2),
- ?line Error1 = {error, {full, b}} = disk_log:blog(b, B3),
- ?line "The halt log" ++ _ = format_error(Error1),
- ?line true = info(b, full, false),
- ?line [] = get_list(File1, a),
- ?line [] = get_list(File2, b),
- ?line ok = disk_log:close(a),
- ?line ok = disk_log:close(b),
- ?line ok = disk_log:close(c),
- ?line ok = file:delete(File1),
- ?line ok = file:delete(File2),
- ?line ok = file:delete(File3),
+ ok = disk_log:blog(a, B1),
+ ok = disk_log:blog(b, B2),
+ ok = disk_log:blog(c, B3),
+ case get_list(File1, a) of
+ T1 ->
+ ok;
+ E1 ->
+ test_server_fail({bad_terms, E1, T1})
+ end,
+ case get_list(File2, b) of
+ T2 ->
+ ok;
+ E2 ->
+ test_server_fail({bad_terms, E2, T2})
+ end,
+ case get_list(File3, c) of
+ T3 ->
+ ok;
+ E3 ->
+ test_server_fail({bad_terms, E3, T3})
+ end,
+ ok = disk_log:truncate(a),
+ ok = disk_log:truncate(b),
+ {error, {full, a}} = disk_log:blog(a, B2),
+ Error1 = {error, {full, b}} = disk_log:blog(b, B3),
+ "The halt log" ++ _ = format_error(Error1),
+ true = info(b, full, false),
+ [] = get_list(File1, a),
+ [] = get_list(File2, b),
+ ok = disk_log:close(a),
+ ok = disk_log:close(b),
+ ok = disk_log:close(c),
+ ok = file:delete(File1),
+ ok = file:delete(File2),
+ ok = file:delete(File3),
ok.
-wrap_ext_1(suite) -> [];
-wrap_ext_1(doc) -> ["Test wrap disk log, external, size defined"];
+%% Test wrap disk log, external, size defined.
wrap_ext_1(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
- {format,external},
- {file, File}]),
+ {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
+ {format,external},
+ {file, File}]),
x2simple_log(File ++ ".1", a),
- ?line ok = disk_log:close(a),
-% del(File, 4),
- ?line {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
- {format,external},
- {file, File}]),
+ ok = disk_log:close(a),
+ %% del(File, 4),
+ {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8000, 4}},
+ {format,external},
+ {file, File}]),
{B1, _T1} = x_mk_bytes(10000), % file 2
{B2, T2} = x_mk_bytes(5000), % file 3
{B3, T3} = x_mk_bytes(4000), % file 4
{B4, T4} = x_mk_bytes(2000), % file 4
{B5, T5} = x_mk_bytes(5000), % file 1
{B6, T6} = x_mk_bytes(5000), % file 2
- ?line ok = disk_log:blog(a, B1),
- ?line ok = disk_log:blog(a, B2),
- ?line ok = disk_log:blog(a, B3),
- ?line ok = disk_log:blog_terms(a, [B4, B5, B6]),
- ?line case get_list(File ++ ".3", a) of
- T2 ->
- ok;
- E2 ->
- test_server_fail({bad_terms, E2, T2})
- end,
- ?line T34 = T3 ++ T4,
- ?line case get_list(File ++ ".4", a) of
- T34 ->
- ok;
- E34 ->
- test_server_fail({bad_terms, E34, T34})
- end,
- ?line case get_list(File ++ ".1", a) of
- T5 ->
- ok;
- E5 ->
- test_server_fail({bad_terms, E5, T5})
- end,
- ?line case get_list(File ++ ".2", a) of
- T6 ->
- ok;
- E6 ->
- test_server_fail({bad_terms, E6, T6})
- end,
- ?line ok = disk_log:close(a),
+ ok = disk_log:blog(a, B1),
+ ok = disk_log:blog(a, B2),
+ ok = disk_log:blog(a, B3),
+ ok = disk_log:blog_terms(a, [B4, B5, B6]),
+ case get_list(File ++ ".3", a) of
+ T2 ->
+ ok;
+ E2 ->
+ test_server_fail({bad_terms, E2, T2})
+ end,
+ T34 = T3 ++ T4,
+ case get_list(File ++ ".4", a) of
+ T34 ->
+ ok;
+ E34 ->
+ test_server_fail({bad_terms, E34, T34})
+ end,
+ case get_list(File ++ ".1", a) of
+ T5 ->
+ ok;
+ E5 ->
+ test_server_fail({bad_terms, E5, T5})
+ end,
+ case get_list(File ++ ".2", a) of
+ T6 ->
+ ok;
+ E6 ->
+ test_server_fail({bad_terms, E6, T6})
+ end,
+ ok = disk_log:close(a),
del(File, 4).
-wrap_ext_2(suite) -> [];
-wrap_ext_2(doc) -> ["Test wrap disk log, external, size defined"];
+%% Test wrap disk log, external, size defined.
wrap_ext_2(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File1 = filename:join(Dir, "a.LOG"),
File2 = filename:join(Dir, "b.LOG"),
File3 = filename:join(Dir, "c.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8191,3}},
- {format,external},
- {file, File1}]),
- ?line {ok, b} = disk_log:open([{name,b}, {type,wrap}, {size,{8192,3}},
- {format,external},
- {file, File2}]),
- ?line {ok, c} = disk_log:open([{name,c}, {type,wrap}, {size,{8193,3}},
- {format,external},
- {file, File3}]),
+ {ok, a} = disk_log:open([{name,a}, {type,wrap}, {size,{8191,3}},
+ {format,external},
+ {file, File1}]),
+ {ok, b} = disk_log:open([{name,b}, {type,wrap}, {size,{8192,3}},
+ {format,external},
+ {file, File2}]),
+ {ok, c} = disk_log:open([{name,c}, {type,wrap}, {size,{8193,3}},
+ {format,external},
+ {file, File3}]),
{B1, T1} = x_mk_bytes(8191),
{B2, T2} = x_mk_bytes(8192),
{B3, T3} = x_mk_bytes(8193),
- ?line ok = disk_log:blog(a, B1),
- ?line ok = disk_log:blog(b, B2),
- ?line ok = disk_log:blog(c, B3),
- ?line case get_list(File1 ++ ".1", a) of
- T1 ->
- ok;
- E1 ->
- test_server_fail({bad_terms, E1, T1})
- end,
- ?line case get_list(File2 ++ ".1", b) of
- T2 ->
- ok;
- E2 ->
- test_server_fail({bad_terms, E2, T2})
- end,
- ?line case get_list(File3 ++ ".1", c) of
- T3 ->
- ok;
- E3 ->
- test_server_fail({bad_terms, E3, T3})
- end,
- ?line ok = disk_log:close(a),
- ?line ok = disk_log:close(b),
- ?line ok = disk_log:close(c),
- ?line del(File1, 3),
- ?line del(File2, 3),
- ?line del(File3, 3),
+ ok = disk_log:blog(a, B1),
+ ok = disk_log:blog(b, B2),
+ ok = disk_log:blog(c, B3),
+ case get_list(File1 ++ ".1", a) of
+ T1 ->
+ ok;
+ E1 ->
+ test_server_fail({bad_terms, E1, T1})
+ end,
+ case get_list(File2 ++ ".1", b) of
+ T2 ->
+ ok;
+ E2 ->
+ test_server_fail({bad_terms, E2, T2})
+ end,
+ case get_list(File3 ++ ".1", c) of
+ T3 ->
+ ok;
+ E3 ->
+ test_server_fail({bad_terms, E3, T3})
+ end,
+ ok = disk_log:close(a),
+ ok = disk_log:close(b),
+ ok = disk_log:close(c),
+ del(File1, 3),
+ del(File2, 3),
+ del(File3, 3),
ok.
simple_log(Log) ->
@@ -879,61 +839,61 @@ simple_log(Log) ->
T2 = hopp,
T3 = {tjena, 12},
T4 = mk_bytes(10000),
- ?line ok = disk_log:log(Log, T1),
- ?line ok = disk_log:log_terms(Log, [T2, T3]),
- ?line case get_all_terms(Log) of
- [T1, T2, T3] ->
- ok;
- E1 ->
- test_server_fail({bad_terms, E1, [T1, T2, T3]})
- end,
- ?line ok = disk_log:log(a, T4),
- ?line case get_all_terms(Log) of
- [T1, T2, T3, T4] ->
- ok;
- E2 ->
- test_server_fail({bad_terms, E2, [T1, T2, T3, T4]})
- end.
+ ok = disk_log:log(Log, T1),
+ ok = disk_log:log_terms(Log, [T2, T3]),
+ case get_all_terms(Log) of
+ [T1, T2, T3] ->
+ ok;
+ E1 ->
+ test_server_fail({bad_terms, E1, [T1, T2, T3]})
+ end,
+ ok = disk_log:log(a, T4),
+ case get_all_terms(Log) of
+ [T1, T2, T3, T4] ->
+ ok;
+ E2 ->
+ test_server_fail({bad_terms, E2, [T1, T2, T3, T4]})
+ end.
xsimple_log(File, Log) ->
T1 = "hej",
T2 = list_to_binary("hopp"),
T3 = list_to_binary(["sena", list_to_binary("sejer")]),
T4 = list_to_binary(By = mk_bytes(10000)),
- ?line ok = disk_log:blog(Log, T1),
- ?line ok = disk_log:blog_terms(Log, [T2, T3]),
- ?line X = "hejhoppsenasejer",
- ?line X2 = get_list(File, Log),
- ?line case X2 of
- X -> ok;
- Z1 -> test_server_fail({bad_terms, Z1, X2})
- end,
- ?line ok = disk_log:blog(Log, T4),
- ?line Tmp = get_list(File, Log),
- ?line case X ++ By of
- Tmp -> ok;
- Z2 -> test_server_fail({bad_terms, Z2, X ++ By})
- end.
+ ok = disk_log:blog(Log, T1),
+ ok = disk_log:blog_terms(Log, [T2, T3]),
+ X = "hejhoppsenasejer",
+ X2 = get_list(File, Log),
+ case X2 of
+ X -> ok;
+ Z1 -> test_server_fail({bad_terms, Z1, X2})
+ end,
+ ok = disk_log:blog(Log, T4),
+ Tmp = get_list(File, Log),
+ case X ++ By of
+ Tmp -> ok;
+ Z2 -> test_server_fail({bad_terms, Z2, X ++ By})
+ end.
x2simple_log(File, Log) ->
T1 = "hej",
T2 = list_to_binary("hopp"),
T3 = list_to_binary(["sena", list_to_binary("sejer")]),
T4 = list_to_binary(By = mk_bytes(1000)),
- ?line ok = disk_log:blog(Log, T1),
- ?line ok = disk_log:blog_terms(Log, [T2, T3]),
- ?line X = "hejhoppsenasejer",
- ?line X2 = get_list(File, Log),
- ?line case X2 of
- X -> ok;
- Z1 -> test_server_fail({bad_terms, Z1, X2})
- end,
- ?line ok = disk_log:blog(Log, T4),
- ?line Tmp = get_list(File, Log),
- ?line case X ++ By of
- Tmp -> ok;
- Z2 -> test_server_fail({bad_terms, Z2, X ++ By})
- end.
+ ok = disk_log:blog(Log, T1),
+ ok = disk_log:blog_terms(Log, [T2, T3]),
+ X = "hejhoppsenasejer",
+ X2 = get_list(File, Log),
+ case X2 of
+ X -> ok;
+ Z1 -> test_server_fail({bad_terms, Z1, X2})
+ end,
+ ok = disk_log:blog(Log, T4),
+ Tmp = get_list(File, Log),
+ case X ++ By of
+ Tmp -> ok;
+ Z2 -> test_server_fail({bad_terms, Z2, X ++ By})
+ end.
x_mk_bytes(N) ->
X = lists:duplicate(N, $a),
@@ -947,7 +907,7 @@ mk_bytes(N) when N > 4 ->
end.
get_list(File, Log) ->
- ?t:format(0, "File ~p~n",[File]),
+ ct:pal(?HI_VERBOSITY, "File ~p~n", [File]),
ok = disk_log:sync(Log),
{ok, B} = file:read_file(File),
binary_to_list(B).
@@ -955,7 +915,7 @@ get_list(File, Log) ->
get_all_terms(Log, File, Type) ->
{ok, _Log} = disk_log:open([{name,Log}, {type,Type}, {size,infinity},
- {format,internal}, {file, File},
+ {format,internal}, {file, File},
{mode, read_only}]),
Ts = get_all_terms(Log),
ok = disk_log:close(Log),
@@ -976,14 +936,14 @@ get_all_terms1(Log, Cont, Res) ->
get_all_terms_and_bad(Log, File, Type) ->
{ok, _Log} = disk_log:open([{name,Log}, {type,Type}, {size,infinity},
- {format,internal}, {file, File},
+ {format,internal}, {file, File},
{mode, read_only}]),
Ts = get_all_terms_and_bad(Log),
ok = disk_log:close(Log),
Ts.
get_all_terms_and_bad(Log) ->
- ?line read_only = info(Log, mode, foo),
+ read_only = info(Log, mode, foo),
get_all_terms_and_bad1(Log, start, [], 0).
%%
@@ -999,7 +959,7 @@ get_all_terms_and_bad1(Log, Cont, Res, Bad0) ->
get_all_binary_terms_and_bad(Log, File, Type) ->
{ok, _Log} = disk_log:open([{name,Log}, {type,Type}, {size,infinity},
- {format,internal}, {file, File},
+ {format,internal}, {file, File},
{mode, read_only}]),
Ts = get_all_binary_terms_and_bad(Log),
ok = disk_log:close(Log),
@@ -1037,7 +997,7 @@ xx() ->
{format,internal}, {file, File}]),
W = xwr(a, 400),
disk_log:close(a),
-% file:delete(File),
+ %% file:delete(File),
W.
%% old: 6150
@@ -1186,73 +1146,72 @@ end_times({T1,W1}) ->
{T2-T1, W2-W1}.
-head_func(suite) -> [];
-head_func(doc) -> ["Test head parameter"];
+%% Test head parameter.
head_func(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
ets:new(xxx, [named_table, set, public]),
ets:insert(xxx, {wrapc, 0}),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
- {size, {100,4}},
- {head_func, {?MODULE, hf, []}}]),
- ?line B = mk_bytes(60),
- ?line disk_log:log(a, B),
- ?line disk_log:alog(a, B),
- ?line disk_log:alog(a, B),
- ?line disk_log:log(a, B),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
+ {size, {100,4}},
+ {head_func, {?MODULE, hf, []}}]),
+ B = mk_bytes(60),
+ disk_log:log(a, B),
+ disk_log:alog(a, B),
+ disk_log:alog(a, B),
+ disk_log:log(a, B),
H = [1,2,3],
- ?line [{wrapc, 4}] = ets:lookup(xxx, wrapc),
+ [{wrapc, 4}] = ets:lookup(xxx, wrapc),
ets:delete(xxx),
- ?line case get_all_terms(a) of
- [H,B,H,B,H,B,H,B] ->
- ok;
- E1 ->
- test_server_fail({bad_terms, E1,
- [H,B,H,B,H,B,H,B]})
- end,
- ?line 8 = no_written_items(a),
+ case get_all_terms(a) of
+ [H,B,H,B,H,B,H,B] ->
+ ok;
+ E1 ->
+ test_server_fail({bad_terms, E1,
+ [H,B,H,B,H,B,H,B]})
+ end,
+ 8 = no_written_items(a),
disk_log:close(a),
del(File, 4),
- % invalid header function
- ?line {error, {invalid_header, {_, {term}}}} =
+ %% invalid header function
+ {error, {invalid_header, {_, {term}}}} =
disk_log:open([{name, n}, {file, File}, {type, halt},
{format, external},
{head_func, {?MODULE, head_fun, [{term}]}}]),
file:delete(File),
- ?line {error, {invalid_header, _}} =
+ {error, {invalid_header, _}} =
disk_log:open([{name, n}, {file, File}, {type, halt},
{format, external},
{head_func, {?MODULE, head_fun, [{ok,{term}}]}}]),
file:delete(File),
- ?line {ok,n} =
+ {ok,n} =
disk_log:open([{name, n}, {file, File}, {type, halt},
{format, external},
{head_func, {?MODULE, head_fun, [{ok,<<"head">>}]}}]),
- ?line ok = disk_log:close(n),
- ?line {ok,<<"head">>} = file:read_file(File),
+ ok = disk_log:close(n),
+ {ok,<<"head">>} = file:read_file(File),
file:delete(File),
- ?line {ok,n} =
+ {ok,n} =
disk_log:open([{name, n}, {file, File}, {type, halt},
{format, external},
{head_func, {?MODULE, head_fun, [{ok,"head"}]}}]),
- ?line ok = disk_log:close(n),
- ?line {ok,<<"head">>} = file:read_file(File),
+ ok = disk_log:close(n),
+ {ok,<<"head">>} = file:read_file(File),
file:delete(File),
- ?line Error1 = {error, {badarg, _}} =
+ Error1 = {error, {badarg, _}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{head_func, {tjo,hej,san}},{size, {100, 4}}]),
- ?line "The argument " ++ _ = format_error(Error1),
-
- ?line Error2 = {error, {invalid_header, _}} =
+ "The argument " ++ _ = format_error(Error1),
+
+ Error2 = {error, {invalid_header, _}} =
disk_log:open([{name, n}, {file, File}, {type, halt},
{head_func, {tjo,hej,[san]}}]),
- ?line "The disk log header" ++ _ = format_error(Error2),
+ "The disk log header" ++ _ = format_error(Error2),
file:delete(File).
@@ -1263,194 +1222,186 @@ hf() ->
ets:update_counter(xxx, wrapc, 1),
{ok, [1,2,3]}.
-plain_head(suite) -> [];
-plain_head(doc) -> ["Test head parameter"];
+%% Test head parameter.
plain_head(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
H = [1,2,3],
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
- {size, {100,4}}, {head, H}]),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
+ {size, {100,4}}, {head, H}]),
%% This one is not "counted".
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
- {size, {100,4}}, {head, H}]),
- ?line B = mk_bytes(60),
- ?line disk_log:log(a, B),
- ?line disk_log:alog(a, B),
- ?line disk_log:alog(a, B),
- ?line disk_log:log(a, B),
- ?line case get_all_terms(a) of
- [H,B,H,B,H,B,H,B] ->
- ok;
- E1 ->
- test_server_fail({bad_terms, E1,
- [H,B,H,B,H,B,H,B]})
- end,
- ?line 8 = no_written_items(a),
- ?line ok = disk_log:close(a),
- ?line {error, no_such_log} = disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
+ {size, {100,4}}, {head, H}]),
+ B = mk_bytes(60),
+ disk_log:log(a, B),
+ disk_log:alog(a, B),
+ disk_log:alog(a, B),
+ disk_log:log(a, B),
+ case get_all_terms(a) of
+ [H,B,H,B,H,B,H,B] ->
+ ok;
+ E1 ->
+ test_server_fail({bad_terms, E1,
+ [H,B,H,B,H,B,H,B]})
+ end,
+ 8 = no_written_items(a),
+ ok = disk_log:close(a),
+ {error, no_such_log} = disk_log:close(a),
del(File, 4).
-one_header(suite) -> [];
-one_header(doc) -> ["Test that a header is just printed once in a log file"];
+%% Test that a header is just printed once in a log file.
one_header(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
H = [1,2,3],
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
- {size, {100,4}}, {head, H}]),
- ?line B = mk_bytes(60),
- ?line ok = disk_log:log(a, B),
- ?line ok = disk_log:alog(a, B),
- ?line ok = disk_log:alog(a, B),
- ?line ok = disk_log:log(a, B),
- ?line case get_all_terms(a) of
- [H,B,H,B,H,B,H,B] ->
- ok;
- E1 ->
- test_server_fail({bad_terms, E1,
- [H,B,H,B,H,B,H,B]})
- end,
- ?line 8 = no_written_items(a),
- ?line ok = disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
+ {size, {100,4}}, {head, H}]),
+ B = mk_bytes(60),
+ ok = disk_log:log(a, B),
+ ok = disk_log:alog(a, B),
+ ok = disk_log:alog(a, B),
+ ok = disk_log:log(a, B),
+ case get_all_terms(a) of
+ [H,B,H,B,H,B,H,B] ->
+ ok;
+ E1 ->
+ test_server_fail({bad_terms, E1,
+ [H,B,H,B,H,B,H,B]})
+ end,
+ 8 = no_written_items(a),
+ ok = disk_log:close(a),
del(File, 4),
Fileb = filename:join(Dir, "b.LOG"),
- ?line {ok, b} = disk_log:open([{name,b}, {file, Fileb}, {head, H}]),
- ?line ok = disk_log:close(b),
- ?line {ok, b} = disk_log:open([{name,b}, {file, Fileb}, {head, H}]),
- ?line ok = disk_log:log(b, "first log"),
- ?line ok = disk_log:alog(b, "second log"),
- ?line ok = disk_log:close(b),
- ?line {ok, b} = disk_log:open([{name,b}, {file, Fileb}, {head, H}]),
- ?line ok = disk_log:alog(b, "3rd log"),
- ?line ok = disk_log:log(b, "4th log"),
- ?line case get_all_terms(b) of
- [H, "first log", "second log", "3rd log", "4th log"] ->
- ok;
- E2 ->
- test_server_fail({bad_terms, E2,
- [H, "first log", "second log",
- "3rd log", "4th log"]})
- end,
- ?line 2 = no_written_items(b),
- ?line ok = disk_log:close(b),
- ?line ok = file:delete(Fileb),
+ {ok, b} = disk_log:open([{name,b}, {file, Fileb}, {head, H}]),
+ ok = disk_log:close(b),
+ {ok, b} = disk_log:open([{name,b}, {file, Fileb}, {head, H}]),
+ ok = disk_log:log(b, "first log"),
+ ok = disk_log:alog(b, "second log"),
+ ok = disk_log:close(b),
+ {ok, b} = disk_log:open([{name,b}, {file, Fileb}, {head, H}]),
+ ok = disk_log:alog(b, "3rd log"),
+ ok = disk_log:log(b, "4th log"),
+ case get_all_terms(b) of
+ [H, "first log", "second log", "3rd log", "4th log"] ->
+ ok;
+ E2 ->
+ test_server_fail({bad_terms, E2,
+ [H, "first log", "second log",
+ "3rd log", "4th log"]})
+ end,
+ 2 = no_written_items(b),
+ ok = disk_log:close(b),
+ ok = file:delete(Fileb),
Filec = filename:join(Dir, "c.LOG"),
H2 = "this is a header ",
- ?line {ok, c} = disk_log:open([{name,c}, {format, external},
- {file, Filec}, {head, H2}]),
- ?line ok = disk_log:close(c),
- ?line {ok, c} = disk_log:open([{name,c}, {format, external},
- {file, Filec}, {head, H2}]),
- ?line ok = disk_log:blog(c, "first log"),
- ?line ok = disk_log:balog(c, "second log"),
- ?line ok = disk_log:close(c),
- ?line {ok, c} = disk_log:open([{name,c}, {format, external},
- {file, Filec}, {head, H2}]),
- ?line ok = disk_log:balog(c, "3rd log"),
- ?line ok = disk_log:blog(c, "4th log"),
- ?line ok = disk_log:sync(c),
- ?line {ok, Fdc} = file:open(Filec, [read]),
- ?line {ok,"this is a header first logsecond log3rd log4th log"} =
+ {ok, c} = disk_log:open([{name,c}, {format, external},
+ {file, Filec}, {head, H2}]),
+ ok = disk_log:close(c),
+ {ok, c} = disk_log:open([{name,c}, {format, external},
+ {file, Filec}, {head, H2}]),
+ ok = disk_log:blog(c, "first log"),
+ ok = disk_log:balog(c, "second log"),
+ ok = disk_log:close(c),
+ {ok, c} = disk_log:open([{name,c}, {format, external},
+ {file, Filec}, {head, H2}]),
+ ok = disk_log:balog(c, "3rd log"),
+ ok = disk_log:blog(c, "4th log"),
+ ok = disk_log:sync(c),
+ {ok, Fdc} = file:open(Filec, [read]),
+ {ok,"this is a header first logsecond log3rd log4th log"} =
file:read(Fdc, 200),
- ?line ok = file:close(Fdc),
- ?line 2 = no_written_items(c),
- ?line disk_log:close(c),
- ?line ok = file:delete(Filec),
+ ok = file:close(Fdc),
+ 2 = no_written_items(c),
+ disk_log:close(c),
+ ok = file:delete(Filec),
ok.
-wrap_notif(suite) -> [];
-wrap_notif(doc) -> ["Test notify parameter, wrap"];
+%% Test notify parameter, wrap.
wrap_notif(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
- {size, {100,4}}, {notify, true}]),
- ?line B = mk_bytes(60),
- ?line disk_log:log(a, B),
- ?line disk_log:alog(a, B),
- ?line disk_log:alog(a, B),
- ?line disk_log:log(a, B),
- ?line disk_log:log(a, B),
- ?line rec(3, {disk_log, node(), a, {wrap, 0}}),
- ?line rec(1, {disk_log, node(), a, {wrap, 1}}),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
+ {size, {100,4}}, {notify, true}]),
+ B = mk_bytes(60),
+ disk_log:log(a, B),
+ disk_log:alog(a, B),
+ disk_log:alog(a, B),
+ disk_log:log(a, B),
+ disk_log:log(a, B),
+ rec(3, {disk_log, node(), a, {wrap, 0}}),
+ rec(1, {disk_log, node(), a, {wrap, 1}}),
disk_log:close(a),
del(File, 4).
-full_notif(suite) -> [];
-full_notif(doc) -> ["Test notify parameter, wrap, filled file"];
+%% Test notify parameter, wrap, filled file.
full_notif(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
file:delete(File),
- ?line {ok, a} = disk_log:open([{name, a}, {file, File}, {type, halt},
- {size, 100}, {notify, true}]),
- ?line B = mk_bytes(60),
- ?line disk_log:log(a, B),
- ?line disk_log:alog(a, B),
- ?line rec(1, {disk_log, node(), a, full}),
+ {ok, a} = disk_log:open([{name, a}, {file, File}, {type, halt},
+ {size, 100}, {notify, true}]),
+ B = mk_bytes(60),
+ disk_log:log(a, B),
+ disk_log:alog(a, B),
+ rec(1, {disk_log, node(), a, full}),
disk_log:close(a),
file:delete(File).
-trunc_notif(suite) -> [];
-trunc_notif(doc) -> ["Test notify parameter, wrap, truncated file"];
+%% Test notify parameter, wrap, truncated file.
trunc_notif(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
File2 = filename:join(Dir, "a.DUMP"),
- ?line {ok, a} = disk_log:open([{name, a}, {file, File}, {type, halt},
- {size, 100}, {notify, true}]),
- ?line B = mk_bytes(60),
- ?line disk_log:log(a, B),
- ?line disk_log:truncate(a),
- ?line rec(1, {disk_log, node(), a, {truncated, 1}}),
- ?line disk_log:log(a, B),
- ?line ok = disk_log:reopen(a, File2),
- ?line rec(1, {disk_log, node(), a, {truncated, 1}}),
+ {ok, a} = disk_log:open([{name, a}, {file, File}, {type, halt},
+ {size, 100}, {notify, true}]),
+ B = mk_bytes(60),
+ disk_log:log(a, B),
+ disk_log:truncate(a),
+ rec(1, {disk_log, node(), a, {truncated, 1}}),
+ disk_log:log(a, B),
+ ok = disk_log:reopen(a, File2),
+ rec(1, {disk_log, node(), a, {truncated, 1}}),
disk_log:close(a),
file:delete(File),
file:delete(File2).
-blocked_notif(suite) -> [];
-blocked_notif(doc) ->
- ["Test notify parameters 'format_external' and 'blocked_log"];
+%% Test notify parameters 'format_external' and 'blocked_log.
blocked_notif(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "n.LOG"),
No = 4,
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {size, {100,No}}, {notify, true},
- {format, external}]),
- ?line B = mk_bytes(60),
- ?line Error1 = {error,{format_external,n}} = disk_log:log(n, B),
- ?line "The requested operation" ++ _ = format_error(Error1),
- ?line ok = disk_log:blog(n, B),
- ?line ok = disk_log:alog(n, B),
- ?line rec(1, {disk_log, node(), n, {format_external, term_to_binary(B)}}),
- ?line ok = disk_log:alog_terms(n, [B,B,B,B]),
- ?line rec(1, {disk_log, node(), n, {format_external,
- lists:map(fun term_to_binary/1, [B,B,B,B])}}),
- ?line ok = disk_log:block(n, false),
- ?line ok = disk_log:alog(n, B),
- ?line rec(1, {disk_log, node(), n, {blocked_log, term_to_binary(B)}}),
- ?line ok = disk_log:balog(n, B),
- ?line rec(1, {disk_log, node(), n, {blocked_log, list_to_binary(B)}}),
- ?line ok = disk_log:balog_terms(n, [B,B,B,B]),
- ?line disk_log:close(n),
- ?line rec(1, {disk_log, node(), n, {blocked_log,
- lists:map(fun list_to_binary/1, [B,B,B,B])}}),
- ?line del(File, No).
-
-
-new_idx_vsn(suite) -> [];
-new_idx_vsn(doc) -> ["Test the new version of the .idx file"];
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {size, {100,No}}, {notify, true},
+ {format, external}]),
+ B = mk_bytes(60),
+ Error1 = {error,{format_external,n}} = disk_log:log(n, B),
+ "The requested operation" ++ _ = format_error(Error1),
+ ok = disk_log:blog(n, B),
+ ok = disk_log:alog(n, B),
+ rec(1, {disk_log, node(), n, {format_external, term_to_binary(B)}}),
+ ok = disk_log:alog_terms(n, [B,B,B,B]),
+ rec(1, {disk_log, node(), n, {format_external,
+ lists:map(fun term_to_binary/1, [B,B,B,B])}}),
+ ok = disk_log:block(n, false),
+ ok = disk_log:alog(n, B),
+ rec(1, {disk_log, node(), n, {blocked_log, term_to_binary(B)}}),
+ ok = disk_log:balog(n, B),
+ rec(1, {disk_log, node(), n, {blocked_log, list_to_binary(B)}}),
+ ok = disk_log:balog_terms(n, [B,B,B,B]),
+ disk_log:close(n),
+ rec(1, {disk_log, node(), n, {blocked_log,
+ lists:map(fun list_to_binary/1, [B,B,B,B])}}),
+ del(File, No).
+
+
+%% Test the new version of the .idx file.
new_idx_vsn(Conf) when is_list(Conf) ->
DataDir = ?datadir(Conf),
PrivDir = ?privdir(Conf),
@@ -1459,201 +1410,197 @@ new_idx_vsn(Conf) when is_list(Conf) ->
Kurt2 = filename:join(PrivDir, "kurt2.LOG"),
%% Test that a wrap log file can have more than 255 files
- ?line {ok, new_vsn} = disk_log:open([{file, File}, {name, new_vsn},
- {type, wrap}, {size, {40, 270}}]),
- ?line ok = log(new_vsn, 280),
- ?line {ok, Bin} = file:read_file(add_ext(File, "idx")),
- ?line <<0,0:32,2,10:32,1:64,1:64,_/binary>> = Bin,
- ?line disk_log:close(new_vsn),
- ?line del(File, 270),
+ {ok, new_vsn} = disk_log:open([{file, File}, {name, new_vsn},
+ {type, wrap}, {size, {40, 270}}]),
+ ok = log(new_vsn, 280),
+ {ok, Bin} = file:read_file(add_ext(File, "idx")),
+ <<0,0:32,2,10:32,1:64,1:64,_/binary>> = Bin,
+ disk_log:close(new_vsn),
+ del(File, 270),
%% convert a very old version (0) of wrap log file to the new format (2)
copy_wrap_log("kurt.LOG", 4, DataDir, PrivDir),
- ?line {repaired, kurt, {recovered, 1}, {badbytes, 0}} =
+ {repaired, kurt, {recovered, 1}, {badbytes, 0}} =
disk_log:open([{file, Kurt}, {name, kurt},
{type, wrap}, {size, {40, 4}}]),
- ?line ok = disk_log:log(kurt, "this is a logged message number X"),
- ?line ok = disk_log:log(kurt, "this is a logged message number Y"),
- ?line {ok, BinK} = file:read_file(add_ext(Kurt, "idx")),
- ?line <<0,0:32,2,2:32,1:64,1:64,1:64,1:64>> = BinK,
- ?line {{40,4}, 2} = disk_log_1:read_size_file_version(Kurt),
+ ok = disk_log:log(kurt, "this is a logged message number X"),
+ ok = disk_log:log(kurt, "this is a logged message number Y"),
+ {ok, BinK} = file:read_file(add_ext(Kurt, "idx")),
+ <<0,0:32,2,2:32,1:64,1:64,1:64,1:64>> = BinK,
+ {{40,4}, 2} = disk_log_1:read_size_file_version(Kurt),
disk_log:close(kurt),
- ?line del(Kurt, 4),
+ del(Kurt, 4),
%% keep the old format (1)
copy_wrap_log("kurt2.LOG", 4, DataDir, PrivDir),
- ?line {repaired, kurt2, {recovered, 1}, {badbytes, 0}} =
+ {repaired, kurt2, {recovered, 1}, {badbytes, 0}} =
disk_log:open([{file, Kurt2}, {name, kurt2},
{type, wrap}, {size, {40, 4}}]),
- ?line ok = disk_log:log(kurt2, "this is a logged message number X"),
- ?line ok = disk_log:log(kurt2, "this is a logged message number Y"),
- ?line {ok, BinK2} = file:read_file(add_ext(Kurt2, "idx")),
- ?line <<0,2:32,1:32,1:32,1:32,1:32>> = BinK2,
- ?line {{40,4}, 1} = disk_log_1:read_size_file_version(Kurt2),
+ ok = disk_log:log(kurt2, "this is a logged message number X"),
+ ok = disk_log:log(kurt2, "this is a logged message number Y"),
+ {ok, BinK2} = file:read_file(add_ext(Kurt2, "idx")),
+ <<0,2:32,1:32,1:32,1:32,1:32>> = BinK2,
+ {{40,4}, 1} = disk_log_1:read_size_file_version(Kurt2),
disk_log:close(kurt2),
- ?line del(Kurt2, 4),
+ del(Kurt2, 4),
ok.
-reopen(suite) -> [];
-reopen(doc) ->
- ["Test reopen/1 on halt and wrap logs."];
+%% Test reopen/1 on halt and wrap logs.
reopen(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
- ?line File = filename:join(Dir, "n.LOG"),
- ?line NewFile = filename:join(Dir, "nn.LOG"),
- ?line B = mk_bytes(60),
-
- ?line file:delete(File), % cleanup
- ?line file:delete(NewFile), % cleanup
- ?line Q = qlen(),
+ File = filename:join(Dir, "n.LOG"),
+ NewFile = filename:join(Dir, "nn.LOG"),
+ B = mk_bytes(60),
+
+ file:delete(File), % cleanup
+ file:delete(NewFile), % cleanup
+ Q = qlen(),
%% External halt log.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {notify, true}, {head, "header"},
- {size, infinity},{format, external}]),
- ?line ok = disk_log:blog(n, B),
- ?line ok = disk_log:breopen(n, NewFile, "head"),
- ?line rec(1, {disk_log, node(), n, {truncated, 2}}),
- ?line ok = disk_log:blog(n, B),
- ?line ok = disk_log:blog(n, B),
- ?line ok = disk_log:breopen(n, NewFile, "head"),
- ?line rec(1, {disk_log, node(), n, {truncated, 3}}),
- ?line ok = disk_log:close(n),
- ?line {ok,BinaryFile} = file:read_file(File),
- ?line "head" = binary_to_list(BinaryFile),
- ?line file:delete(File),
- ?line file:delete(NewFile),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {notify, true}, {head, "header"},
+ {size, infinity},{format, external}]),
+ ok = disk_log:blog(n, B),
+ ok = disk_log:breopen(n, NewFile, "head"),
+ rec(1, {disk_log, node(), n, {truncated, 2}}),
+ ok = disk_log:blog(n, B),
+ ok = disk_log:blog(n, B),
+ ok = disk_log:breopen(n, NewFile, "head"),
+ rec(1, {disk_log, node(), n, {truncated, 3}}),
+ ok = disk_log:close(n),
+ {ok,BinaryFile} = file:read_file(File),
+ "head" = binary_to_list(BinaryFile),
+ file:delete(File),
+ file:delete(NewFile),
%% Internal halt log.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {notify, true}, {head, header},
- {size, infinity}]),
- ?line ok = disk_log:log(n, B),
- ?line Error1 = {error, {same_file_name, n}} = disk_log:reopen(n, File),
- ?line "Current and new" ++ _ = format_error(Error1),
- ?line ok = disk_log:reopen(n, NewFile),
- ?line rec(1, {disk_log, node(), n, {truncated, 2}}),
- ?line ok = disk_log:log(n, B),
- ?line ok = disk_log:log(n, B),
- ?line ok = disk_log:reopen(n, NewFile),
- ?line rec(1, {disk_log, node(), n, {truncated, 3}}),
- ?line ok = disk_log:close(n),
- ?line [header, _B, _B] = get_all_terms(nn, NewFile, halt),
- ?line file:delete(File),
- ?line file:delete(NewFile),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {notify, true}, {head, header},
+ {size, infinity}]),
+ ok = disk_log:log(n, B),
+ Error1 = {error, {same_file_name, n}} = disk_log:reopen(n, File),
+ "Current and new" ++ _ = format_error(Error1),
+ ok = disk_log:reopen(n, NewFile),
+ rec(1, {disk_log, node(), n, {truncated, 2}}),
+ ok = disk_log:log(n, B),
+ ok = disk_log:log(n, B),
+ ok = disk_log:reopen(n, NewFile),
+ rec(1, {disk_log, node(), n, {truncated, 3}}),
+ ok = disk_log:close(n),
+ [header, _B, _B] = get_all_terms(nn, NewFile, halt),
+ file:delete(File),
+ file:delete(NewFile),
%% Internal wrap log.
- ?line No = 4,
- ?line del(File, No), % cleanup
- ?line del(NewFile, No), % cleanup
-
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {notify, true},
- {head, header}, {size, {100, No}}]),
- ?line ok = disk_log:log(n, B),
- ?line ok = disk_log:log_terms(n, [B,B,B]),
+ No = 4,
+ del(File, No), % cleanup
+ del(NewFile, No), % cleanup
+
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {notify, true},
+ {head, header}, {size, {100, No}}]),
+ ok = disk_log:log(n, B),
+ ok = disk_log:log_terms(n, [B,B,B]),
%% Used to be one message, but now one per wrapped file.
- ?line rec(3, {disk_log, node(), n, {wrap, 0}}),
- ?line ok = disk_log:log_terms(n, [B]),
- ?line rec(1, {disk_log, node(), n, {wrap, 2}}),
- ?line ok = disk_log:log_terms(n, [B]),
- ?line rec(1, {disk_log, node(), n, {wrap, 2}}),
- ?line ok = disk_log:reopen(n, NewFile, new_header),
- ?line rec(1, {disk_log, node(), n, {truncated, 8}}),
- ?line ok = disk_log:log_terms(n, [B,B]),
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line ok = disk_log:log_terms(n, [B]),
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line ok = disk_log:close(n),
- ?line [header, _, header, _, header, _, header, _] =
+ rec(3, {disk_log, node(), n, {wrap, 0}}),
+ ok = disk_log:log_terms(n, [B]),
+ rec(1, {disk_log, node(), n, {wrap, 2}}),
+ ok = disk_log:log_terms(n, [B]),
+ rec(1, {disk_log, node(), n, {wrap, 2}}),
+ ok = disk_log:reopen(n, NewFile, new_header),
+ rec(1, {disk_log, node(), n, {truncated, 8}}),
+ ok = disk_log:log_terms(n, [B,B]),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ ok = disk_log:log_terms(n, [B]),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ ok = disk_log:close(n),
+ [header, _, header, _, header, _, header, _] =
get_all_terms(nn, NewFile, wrap),
- ?line [new_header, _, header, _, header, _] = get_all_terms(n, File, wrap),
+ [new_header, _, header, _, header, _] = get_all_terms(n, File, wrap),
- ?line del(NewFile, No),
- ?line file:delete(File ++ ".2"),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {notify, true},
- {head, header}, {size, {100, No}}]),
+ del(NewFile, No),
+ file:delete(File ++ ".2"),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {notify, true},
+ {head, header}, {size, {100, No}}]),
%% One file is missing...
- ?line ok = disk_log:reopen(n, NewFile),
- ?line rec(1, {disk_log, node(), n, {truncated, 6}}),
- ?line ok = disk_log:close(n),
+ ok = disk_log:reopen(n, NewFile),
+ rec(1, {disk_log, node(), n, {truncated, 6}}),
+ ok = disk_log:close(n),
- ?line del(File, No),
- ?line del(NewFile, No),
- ?line Q = qlen(),
+ del(File, No),
+ del(NewFile, No),
+ Q = qlen(),
ok.
-block_blocked(suite) -> [];
-block_blocked(doc) ->
- ["Test block/1 on external and internal logs."];
+%% Test block/1 on external and internal logs.
block_blocked(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
- ?line B = mk_bytes(60),
+ B = mk_bytes(60),
Halt = join(Dir, "halt.LOG"),
- % External logs.
- ?line file:delete(Halt), % cleanup
- ?line {ok, halt} = disk_log:open([{name, halt}, {type, halt},
- {format, external}, {file, Halt}]),
- ?line ok = disk_log:sync(halt),
- ?line ok = disk_log:block(halt, false),
- ?line Error1 = {error, {blocked_log, halt}} = disk_log:block(halt),
- ?line "The blocked disk" ++ _ = format_error(Error1),
- ?line {error, {blocked_log, halt}} = disk_log:sync(halt),
- ?line {error, {blocked_log, halt}} = disk_log:truncate(halt),
- ?line {error, {blocked_log, halt}} = disk_log:change_size(halt, infinity),
- ?line {error, {blocked_log, halt}} =
+ %% External logs.
+ file:delete(Halt), % cleanup
+ {ok, halt} = disk_log:open([{name, halt}, {type, halt},
+ {format, external}, {file, Halt}]),
+ ok = disk_log:sync(halt),
+ ok = disk_log:block(halt, false),
+ Error1 = {error, {blocked_log, halt}} = disk_log:block(halt),
+ "The blocked disk" ++ _ = format_error(Error1),
+ {error, {blocked_log, halt}} = disk_log:sync(halt),
+ {error, {blocked_log, halt}} = disk_log:truncate(halt),
+ {error, {blocked_log, halt}} = disk_log:change_size(halt, infinity),
+ {error, {blocked_log, halt}} =
disk_log:change_notify(halt, self(), false),
- ?line {error, {blocked_log, halt}} =
+ {error, {blocked_log, halt}} =
disk_log:change_header(halt, {head, header}),
- ?line {error, {blocked_log, halt}} = disk_log:reopen(halt, "foo"),
- ?line ok = disk_log:close(halt),
-
- ?line {ok, halt} = disk_log:open([{name, halt}, {type, halt},
- {format, external}]),
- ?line ok = disk_log:sync(halt),
- ?line ok = disk_log:block(halt, true),
- ?line {error, {blocked_log, halt}} = disk_log:blog(halt, B),
- ?line {error, {blocked_log, halt}} = disk_log:blog(halt, B),
- ?line {error, {blocked_log, halt}} = disk_log:block(halt),
- ?line {error, {blocked_log, halt}} = disk_log:sync(halt),
- ?line {error, {blocked_log, halt}} = disk_log:truncate(halt),
- ?line {error, {blocked_log, halt}} = disk_log:change_size(halt, infinity),
- ?line {error, {blocked_log, halt}} =
+ {error, {blocked_log, halt}} = disk_log:reopen(halt, "foo"),
+ ok = disk_log:close(halt),
+
+ {ok, halt} = disk_log:open([{name, halt}, {type, halt},
+ {format, external}]),
+ ok = disk_log:sync(halt),
+ ok = disk_log:block(halt, true),
+ {error, {blocked_log, halt}} = disk_log:blog(halt, B),
+ {error, {blocked_log, halt}} = disk_log:blog(halt, B),
+ {error, {blocked_log, halt}} = disk_log:block(halt),
+ {error, {blocked_log, halt}} = disk_log:sync(halt),
+ {error, {blocked_log, halt}} = disk_log:truncate(halt),
+ {error, {blocked_log, halt}} = disk_log:change_size(halt, infinity),
+ {error, {blocked_log, halt}} =
disk_log:change_notify(halt, self(), false),
- ?line {error, {blocked_log, halt}} =
+ {error, {blocked_log, halt}} =
disk_log:change_header(halt, {head, header}),
- ?line {error, {blocked_log, halt}} = disk_log:reopen(halt, "foo"),
-
- ?line ok = disk_log:unblock(halt),
- ?line ok = disk_log:close(halt),
- ?line file:delete(Halt),
-
- % Internal logs.
- ?line File = filename:join(Dir, "n.LOG"),
- ?line No = 4,
- ?line del(File, No), % cleanup
- ?line {ok, halt} = disk_log:open([{name, halt}, {file, File}, {type, wrap},
- {size, {100, No}}]),
- ?line ok = disk_log:block(halt, true),
- ?line eof = disk_log:chunk(halt, start),
- ?line Error2 = {error, end_of_log} = disk_log:chunk_step(halt, start, 1),
- ?line "An attempt" ++ _ = format_error(Error2),
- ?line {error, {blocked_log, halt}} = disk_log:log(halt, B),
- ?line {error, {blocked_log, halt}} = disk_log:inc_wrap_file(halt),
- ?line ok = disk_log:unblock(halt),
- ?line ok = disk_log:block(halt, false),
- ?line {error, {blocked_log, halt}} = disk_log:log(halt, B),
- ?line {error, {blocked_log, halt}} = disk_log:inc_wrap_file(halt),
- ?line Parent = self(),
- ?line Pid =
+ {error, {blocked_log, halt}} = disk_log:reopen(halt, "foo"),
+
+ ok = disk_log:unblock(halt),
+ ok = disk_log:close(halt),
+ file:delete(Halt),
+
+ %% Internal logs.
+ File = filename:join(Dir, "n.LOG"),
+ No = 4,
+ del(File, No), % cleanup
+ {ok, halt} = disk_log:open([{name, halt}, {file, File}, {type, wrap},
+ {size, {100, No}}]),
+ ok = disk_log:block(halt, true),
+ eof = disk_log:chunk(halt, start),
+ Error2 = {error, end_of_log} = disk_log:chunk_step(halt, start, 1),
+ "An attempt" ++ _ = format_error(Error2),
+ {error, {blocked_log, halt}} = disk_log:log(halt, B),
+ {error, {blocked_log, halt}} = disk_log:inc_wrap_file(halt),
+ ok = disk_log:unblock(halt),
+ ok = disk_log:block(halt, false),
+ {error, {blocked_log, halt}} = disk_log:log(halt, B),
+ {error, {blocked_log, halt}} = disk_log:inc_wrap_file(halt),
+ Parent = self(),
+ Pid =
spawn_link(fun() ->
{error, {blocked_log, halt}} =
disk_log:chunk(halt, start),
@@ -1661,109 +1608,107 @@ block_blocked(Conf) when is_list(Conf) ->
disk_log:chunk_step(halt, start, 1),
Parent ! {self(), stopped}
end),
- ?line receive {Pid,stopped} -> ok end,
- ?line ok = disk_log:close(halt),
- ?line del(File, No).
+ receive {Pid,stopped} -> ok end,
+ ok = disk_log:close(halt),
+ del(File, No).
-block_queue(suite) -> [];
-block_queue(doc) ->
- ["Run commands from the queue by unblocking."];
+%% Run commands from the queue by unblocking.
block_queue(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
- ?line Q = qlen(),
- ?line File = filename:join(Dir, "n.LOG"),
- ?line No = 4,
- ?line del(File, No), % cleanup
- ?line B = mk_bytes(60),
-
- ?line Pid = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = sync_do(Pid, {open, File}),
-
- ?line ok = disk_log:block(n, true),
- ?line async_do(Pid, {blog, B}),
- ?line ok = disk_log:unblock(n),
- ?line ok = get_reply(),
- ?line 1 = no_written_items(n),
- ?line Error1 = {error,{not_blocked,n}} = disk_log:unblock(n),
- ?line "The disk log" ++ _ = format_error(Error1),
-
- ?line ok = disk_log:block(n, true),
- ?line async_do(Pid, {balog, "one string"}),
- ?line ok = disk_log:unblock(n),
- ?line ok = get_reply(),
- ?line 2 = no_written_items(n),
-
- ?line ok = disk_log:block(n, true),
- ?line async_do(Pid, sync),
- ?line ok = disk_log:unblock(n),
- ?line ok = get_reply(),
-
- ?line ok = disk_log:block(n, true),
- ?line async_do(Pid, truncate),
- ?line ok = disk_log:unblock(n),
- ?line ok = get_reply(),
- ?line 0 = no_items(n),
-
- ?line ok = disk_log:block(n, true),
- ?line async_do(Pid, {block, false}),
- ?line ok = disk_log:unblock(n),
- ?line ok = get_reply(),
- ?line {error, {blocked_log, _}} = disk_log:blog(n, B),
- ?line ok = sync_do(Pid, unblock),
-
- ?line ok = disk_log:block(n, true),
- ?line async_do(Pid, {change_notify, Pid, true}),
- ?line ok = disk_log:unblock(n),
- ?line ok = get_reply(),
- ?line [{_, true}] = owners(n),
-
- ?line ok = disk_log:block(n, true),
- ?line async_do(Pid, {change_notify, Pid, false}),
- ?line ok = disk_log:unblock(n),
- ?line ok = get_reply(),
- ?line [{_, false}] = owners(n),
-
- ?line ok = disk_log:block(n, true),
- ?line async_do(Pid, {change_header, {head, header}}),
- ?line ok = disk_log:unblock(n),
- ?line {error, {badarg, head}} = get_reply(),
-
- ?line ok = disk_log:block(n, true),
- ?line async_do(Pid, {change_size, 17}),
- ?line ok = disk_log:unblock(n),
- ?line {error, {badarg, size}} = get_reply(),
-
- ?line ok = disk_log:block(n, true),
- ?line async_do(Pid, inc_wrap_file),
- ?line ok = disk_log:unblock(n),
- ?line ok = get_reply(),
-
- ?line ok = sync_do(Pid, close),
- ?line del(File, No),
-
- ?line _Pid2 = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = sync_do(Pid, {int_open, File}),
-
- ?line ok = disk_log:block(n, true),
- ?line async_do(Pid, {chunk, start}),
- ?line ok = disk_log:unblock(n),
- ?line eof = get_reply(),
-
- ?line ok = disk_log:block(n, true),
- ?line async_do(Pid, {chunk_step, start, 100}),
- ?line ok = disk_log:unblock(n),
- ?line {ok, _Cont} = get_reply(),
-
- ?line ok = disk_log:block(n, true),
- ?line async_do(Pid, {log,a_term}),
- ?line ok = disk_log:unblock(n),
- ?line ok = get_reply(),
- ?line 1 = no_written_items(n),
-
- ?line ok = sync_do(Pid, close),
- ?line sync_do(Pid, terminate),
- ?line del(File, No),
+ Q = qlen(),
+ File = filename:join(Dir, "n.LOG"),
+ No = 4,
+ del(File, No), % cleanup
+ B = mk_bytes(60),
+
+ Pid = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = sync_do(Pid, {open, File}),
+
+ ok = disk_log:block(n, true),
+ async_do(Pid, {blog, B}),
+ ok = disk_log:unblock(n),
+ ok = get_reply(),
+ 1 = no_written_items(n),
+ Error1 = {error,{not_blocked,n}} = disk_log:unblock(n),
+ "The disk log" ++ _ = format_error(Error1),
+
+ ok = disk_log:block(n, true),
+ async_do(Pid, {balog, "one string"}),
+ ok = disk_log:unblock(n),
+ ok = get_reply(),
+ 2 = no_written_items(n),
+
+ ok = disk_log:block(n, true),
+ async_do(Pid, sync),
+ ok = disk_log:unblock(n),
+ ok = get_reply(),
+
+ ok = disk_log:block(n, true),
+ async_do(Pid, truncate),
+ ok = disk_log:unblock(n),
+ ok = get_reply(),
+ 0 = no_items(n),
+
+ ok = disk_log:block(n, true),
+ async_do(Pid, {block, false}),
+ ok = disk_log:unblock(n),
+ ok = get_reply(),
+ {error, {blocked_log, _}} = disk_log:blog(n, B),
+ ok = sync_do(Pid, unblock),
+
+ ok = disk_log:block(n, true),
+ async_do(Pid, {change_notify, Pid, true}),
+ ok = disk_log:unblock(n),
+ ok = get_reply(),
+ [{_, true}] = owners(n),
+
+ ok = disk_log:block(n, true),
+ async_do(Pid, {change_notify, Pid, false}),
+ ok = disk_log:unblock(n),
+ ok = get_reply(),
+ [{_, false}] = owners(n),
+
+ ok = disk_log:block(n, true),
+ async_do(Pid, {change_header, {head, header}}),
+ ok = disk_log:unblock(n),
+ {error, {badarg, head}} = get_reply(),
+
+ ok = disk_log:block(n, true),
+ async_do(Pid, {change_size, 17}),
+ ok = disk_log:unblock(n),
+ {error, {badarg, size}} = get_reply(),
+
+ ok = disk_log:block(n, true),
+ async_do(Pid, inc_wrap_file),
+ ok = disk_log:unblock(n),
+ ok = get_reply(),
+
+ ok = sync_do(Pid, close),
+ del(File, No),
+
+ _Pid2 = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = sync_do(Pid, {int_open, File}),
+
+ ok = disk_log:block(n, true),
+ async_do(Pid, {chunk, start}),
+ ok = disk_log:unblock(n),
+ eof = get_reply(),
+
+ ok = disk_log:block(n, true),
+ async_do(Pid, {chunk_step, start, 100}),
+ ok = disk_log:unblock(n),
+ {ok, _Cont} = get_reply(),
+
+ ok = disk_log:block(n, true),
+ async_do(Pid, {log,a_term}),
+ ok = disk_log:unblock(n),
+ ok = get_reply(),
+ 1 = no_written_items(n),
+
+ ok = sync_do(Pid, close),
+ sync_do(Pid, terminate),
+ del(File, No),
%% Test of the queue. Three processes involved here. Pid1's block
%% request is queued. Pid2's log requests are put in the queue.
@@ -1771,171 +1716,165 @@ block_queue(Conf) when is_list(Conf) ->
%% Pid2's log requests are executed when Pid1 unblocks.
%% (This example should show that the pair 'queue' and 'messages'
%% in State does the trick - one does not need a "real" queue.)
- ?line P0 = pps(),
+ P0 = pps(),
Name = n,
- ?line Pid1 = spawn_link(?MODULE, lserv, [Name]),
- ?line {ok, Name} = sync_do(Pid1, {int_open, File, {1000,2}}),
- ?line Pid2 = spawn_link(?MODULE, lserv, [Name]),
- ?line {ok, Name} = sync_do(Pid2, {int_open, File, {1000,2}}),
- ?line ok = disk_log:block(Name),
- ?line async_do(Pid1, {alog,{1,a}}),
- ?line ok = get_reply(),
- ?line async_do(Pid1, {alog,{2,b}}),
- ?line ok = get_reply(),
- ?line async_do(Pid1, {alog,{3,c}}),
- ?line ok = get_reply(),
- ?line async_do(Pid1, {alog,{4,d}}),
- ?line ok = get_reply(),
- ?line async_do(Pid1, block),
- ?line async_do(Pid2, {alog,{5,e}}),
- ?line ok = get_reply(),
- ?line async_do(Pid2, {alog,{6,f}}),
- ?line ok = get_reply(),
- ?line ok = disk_log:unblock(Name),
- ?line ok = get_reply(),
- ?line async_do(Pid2, {alog,{7,g}}),
- ?line ok = get_reply(),
- ?line async_do(Pid2, {alog,{8,h}}),
- ?line ok = get_reply(),
- ?line async_do(Pid1, unblock),
- ?line ok = get_reply(),
- ?line ok = sync_do(Pid1, close),
- ?line ok = sync_do(Pid2, close),
- ?line sync_do(Pid1, terminate),
- ?line sync_do(Pid2, terminate),
+ Pid1 = spawn_link(?MODULE, lserv, [Name]),
+ {ok, Name} = sync_do(Pid1, {int_open, File, {1000,2}}),
+ Pid2 = spawn_link(?MODULE, lserv, [Name]),
+ {ok, Name} = sync_do(Pid2, {int_open, File, {1000,2}}),
+ ok = disk_log:block(Name),
+ async_do(Pid1, {alog,{1,a}}),
+ ok = get_reply(),
+ async_do(Pid1, {alog,{2,b}}),
+ ok = get_reply(),
+ async_do(Pid1, {alog,{3,c}}),
+ ok = get_reply(),
+ async_do(Pid1, {alog,{4,d}}),
+ ok = get_reply(),
+ async_do(Pid1, block),
+ async_do(Pid2, {alog,{5,e}}),
+ ok = get_reply(),
+ async_do(Pid2, {alog,{6,f}}),
+ ok = get_reply(),
+ ok = disk_log:unblock(Name),
+ ok = get_reply(),
+ async_do(Pid2, {alog,{7,g}}),
+ ok = get_reply(),
+ async_do(Pid2, {alog,{8,h}}),
+ ok = get_reply(),
+ async_do(Pid1, unblock),
+ ok = get_reply(),
+ ok = sync_do(Pid1, close),
+ ok = sync_do(Pid2, close),
+ sync_do(Pid1, terminate),
+ sync_do(Pid2, terminate),
Terms = get_all_terms(Name, File, wrap),
- ?line true = [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g},{8,h}] == Terms,
+ true = [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g},{8,h}] == Terms,
del(File, 2),
- ?line Q = qlen(),
- ?line true = (P0 == pps()),
+ Q = qlen(),
+ true = (P0 == pps()),
ok.
-block_queue2(suite) -> [];
-block_queue2(doc) ->
- ["OTP-4880. Blocked processes did not get disk_log_stopped message."];
+%% OTP-4880. Blocked processes did not get disk_log_stopped message.
block_queue2(Conf) when is_list(Conf) ->
- ?line Q = qlen(),
- ?line P0 = pps(),
+ Q = qlen(),
+ P0 = pps(),
Dir = ?privdir(Conf),
- ?line File = filename:join(Dir, "n.LOG"),
- ?line No = 4,
+ File = filename:join(Dir, "n.LOG"),
+ No = 4,
%% log requests are queued, and processed when the log is closed
- ?line Pid = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = sync_do(Pid, {open, File}),
- ?line ok = sync_do(Pid, block),
+ Pid = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = sync_do(Pid, {open, File}),
+ ok = sync_do(Pid, block),
%% Asynchronous stuff is ignored.
- ?line ok = disk_log:balog_terms(n, [<<"foo">>,<<"bar">>]),
- ?line ok = disk_log:balog_terms(n, [<<"more">>,<<"terms">>]),
+ ok = disk_log:balog_terms(n, [<<"foo">>,<<"bar">>]),
+ ok = disk_log:balog_terms(n, [<<"more">>,<<"terms">>]),
Parent = self(),
- ?line Fun =
+ Fun =
fun() ->
{error,no_such_log} = disk_log:sync(n),
receive {disk_log, _, {error, disk_log_stopped}} -> ok end,
Parent ! disk_log_stopped_ok
end,
- ?line spawn(Fun),
- ?line ok = sync_do(Pid, close),
- ?line receive disk_log_stopped_ok -> ok end,
- ?line sync_do(Pid, terminate),
- ?line {ok,<<>>} = file:read_file(File ++ ".1"),
- ?line del(File, No),
- ?line Q = qlen(),
- ?line true = (P0 == pps()),
+ spawn(Fun),
+ ok = sync_do(Pid, close),
+ receive disk_log_stopped_ok -> ok end,
+ sync_do(Pid, terminate),
+ {ok,<<>>} = file:read_file(File ++ ".1"),
+ del(File, No),
+ Q = qlen(),
+ true = (P0 == pps()),
ok.
-unblock(suite) -> [];
-unblock(doc) ->
- ["Test unblock/1."];
+%% Test unblock/1.
unblock(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "n.LOG"),
No = 1,
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {size, {100,No}}, {notify, true},
- {format, external}]),
- ?line ok = disk_log:block(n),
- ?line spawn_link(?MODULE, try_unblock, [n]),
- ?line timer:sleep(100),
- ?line disk_log:close(n),
- ?line del(File, No).
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {size, {100,No}}, {notify, true},
+ {format, external}]),
+ ok = disk_log:block(n),
+ spawn_link(?MODULE, try_unblock, [n]),
+ timer:sleep(100),
+ disk_log:close(n),
+ del(File, No).
try_unblock(Log) ->
- ?line Error = {error, {not_blocked_by_pid, n}} = disk_log:unblock(Log),
- ?line "The disk log" ++ _ = format_error(Error).
+ Error = {error, {not_blocked_by_pid, n}} = disk_log:unblock(Log),
+ "The disk log" ++ _ = format_error(Error).
-open_overwrite(suite) -> [];
-open_overwrite(doc) ->
- ["Test open/1 when old files exist."];
+%% Test open/1 when old files exist.
open_overwrite(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
- ?line File = filename:join(Dir, "n.LOG"),
- ?line No = 4,
- ?line del(File, No), % cleanup
+ File = filename:join(Dir, "n.LOG"),
+ No = 4,
+ del(File, No), % cleanup
- % read write
- ?line First = "n.LOG.1",
- ?line make_file(Dir, First, 8),
+ %% read write
+ First = "n.LOG.1",
+ make_file(Dir, First, 8),
- ?line Error1 = {error, {not_a_log_file, _}} =
+ Error1 = {error, {not_a_log_file, _}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, internal}, {size, {100, No}}]),
- ?line "The file" ++ _ = format_error(Error1),
- ?line del(File, No),
+ "The file" ++ _ = format_error(Error1),
+ del(File, No),
- ?line make_file(Dir, First, 4),
+ make_file(Dir, First, 4),
- ?line {error, {not_a_log_file, _}} =
+ {error, {not_a_log_file, _}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, internal}, {size, {100, No}}]),
- ?line del(File, No),
+ del(File, No),
- ?line make_file(Dir, First, 0),
+ make_file(Dir, First, 0),
- ?line {error, {not_a_log_file, _}} =
+ {error, {not_a_log_file, _}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, internal}, {size, {100, No}}]),
- % read only
- ?line make_file(Dir, First, 6),
+ %% read only
+ make_file(Dir, First, 6),
- ?line {error, {not_a_log_file, _}} =
+ {error, {not_a_log_file, _}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},{mode, read_only},
{format, internal}, {size, {100, No}}]),
- ?line del(File, No),
+ del(File, No),
- ?line make_file(Dir, First, 0),
+ make_file(Dir, First, 0),
- ?line {error, {not_a_log_file, _}} =
+ {error, {not_a_log_file, _}} =
disk_log:open([{name, n}, {file, File},{type, wrap},
{mode, read_only}, {format, internal},
{size, {100, No}}]),
- ?line del(File, No),
-
- ?line {error, _} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {mode, read_only},
- {format, internal},{size, {100, No}}]),
+ del(File, No),
+
+ {error, _} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {mode, read_only},
+ {format, internal},{size, {100, No}}]),
file:delete(File),
- ?line {ok,n} = disk_log:open([{name,n},{file,File},
- {mode,read_write},{type,halt}]),
- ?line ok = disk_log:close(n),
- ?line ok = unwritable(File),
- ?line {error, {file_error, File, _}} =
- disk_log:open([{name,n},{file,File},{mode,read_write},{type,halt}]),
- ?line ok = writable(File),
+ {ok,n} = disk_log:open([{name,n},{file,File},
+ {mode,read_write},{type,halt}]),
+ ok = disk_log:close(n),
+ ok = unwritable(File),
+ {error, {file_error, File, _}} =
+ disk_log:open([{name,n},{file,File},{mode,read_write},{type,halt}]),
+ ok = writable(File),
file:delete(File),
- ?line {ok,n} = disk_log:open([{name,n},{file,File},{format,external},
- {mode,read_write},{type,halt}]),
- ?line ok = disk_log:close(n),
- ?line ok = unwritable(File),
- ?line {error, {file_error, File, _}} =
+ {ok,n} = disk_log:open([{name,n},{file,File},{format,external},
+ {mode,read_write},{type,halt}]),
+ ok = disk_log:close(n),
+ ok = unwritable(File),
+ {error, {file_error, File, _}} =
disk_log:open([{name,n},{file,File},{format,external},
{mode,read_write},{type,halt}]),
- ?line ok = writable(File),
+ ok = writable(File),
file:delete(File),
ok.
@@ -1953,424 +1892,412 @@ make_file(Dir, File, N) ->
end,
ok = file:close(F).
-open_size(suite) -> [];
-open_size(doc) ->
- ["Test open/1 option size."];
+%% Test open/1 option size.
open_size(Conf) when is_list(Conf) ->
- ?line Dir = ?privdir(Conf),
- ?line File = filename:join(Dir, "n.LOG"),
+ Dir = ?privdir(Conf),
+ File = filename:join(Dir, "n.LOG"),
- ?line No = 4,
- ?line file:delete(File),
- ?line del(File, No), % cleanup
+ No = 4,
+ file:delete(File),
+ del(File, No), % cleanup
%% missing size option
- ?line {error, {badarg, size}} =
+ {error, {badarg, size}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, internal}]),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, internal},{size, {100, No}}]),
- ?line B = mk_bytes(60),
- ?line ok = disk_log:log_terms(n, [B, B, B, B]),
- ?line ok = disk_log:sync(n),
- ?line ok = disk_log:block(n),
+ B = mk_bytes(60),
+ ok = disk_log:log_terms(n, [B, B, B, B]),
+ ok = disk_log:sync(n),
+ ok = disk_log:block(n),
%% size option does not match existing size file, read_only
- ?line Error1 = {error, {size_mismatch, _, _}} =
+ Error1 = {error, {size_mismatch, _, _}} =
disk_log:open([{name, nn}, {file, File}, {type, wrap},
{mode, read_only}, {format, internal},
{size, {100, No + 1}}]),
- ?line "The given size" ++ _ = format_error(Error1),
- ?line {ok, nn} = disk_log:open([{name, nn}, {file, File}, {type, wrap},
+ "The given size" ++ _ = format_error(Error1),
+ {ok, nn} = disk_log:open([{name, nn}, {file, File}, {type, wrap},
{mode, read_only},
{format, internal},{size, {100, No}}]),
- ?line [_, _, _, _] = get_all_terms1(nn, start, []),
- ?line disk_log:close(nn),
+ [_, _, _, _] = get_all_terms1(nn, start, []),
+ disk_log:close(nn),
- ?line ok = disk_log:unblock(n),
- ?line ok = disk_log:close(n),
+ ok = disk_log:unblock(n),
+ ok = disk_log:close(n),
%% size option does not match existing size file, read_write
- ?line {error, {size_mismatch, _, _}} =
+ {error, {size_mismatch, _, _}} =
disk_log:open([{name, nn}, {file, File}, {type, wrap},
{format, internal}, {size, {100, No + 1}}]),
%% size option does not match existing size file, truncating
- ?line {ok, nn} =
+ {ok, nn} =
disk_log:open([{name, nn}, {file, File}, {type, wrap},
{repair, truncate}, {format, internal},
{size, {100, No + 1}}]),
- ?line ok = disk_log:close(nn),
+ ok = disk_log:close(nn),
- ?line del(File, No),
+ del(File, No),
ok.
-open_truncate(suite) -> [];
-open_truncate(doc) ->
- ["Test open/1 with {repair, truncate}."];
+%% Test open/1 with {repair, truncate}.
open_truncate(Conf) when is_list(Conf) ->
- ?line Dir = ?privdir(Conf),
- ?line File = filename:join(Dir, "n.LOG"),
- ?line No = 4,
- ?line del(File, No), % cleanup
-
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, internal},{size, {100, No}}]),
- ?line B = mk_bytes(60),
- ?line ok = disk_log:log_terms(n, [B, B, B, B]),
- ?line ok = disk_log:close(n),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {repair,truncate},
- {format, internal},{size, {100, No}}]),
- ?line ok = disk_log:close(n),
- ?line [] = get_all_terms(n, File, wrap),
- ?line del(File, No),
+ Dir = ?privdir(Conf),
+ File = filename:join(Dir, "n.LOG"),
+ No = 4,
+ del(File, No), % cleanup
+
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, internal},{size, {100, No}}]),
+ B = mk_bytes(60),
+ ok = disk_log:log_terms(n, [B, B, B, B]),
+ ok = disk_log:close(n),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {repair,truncate},
+ {format, internal},{size, {100, No}}]),
+ ok = disk_log:close(n),
+ [] = get_all_terms(n, File, wrap),
+ del(File, No),
ok.
-
-open_error(suite) -> [];
-open_error(doc) ->
- ["Try some invalid open/1 options."];
+
+%% Try some invalid open/1 options.
open_error(Conf) when is_list(Conf) ->
- ?line Dir = ?privdir(Conf),
+ Dir = ?privdir(Conf),
- ?line File = filename:join(Dir, "n.LOG"),
- ?line No = 4,
- ?line del(File, No), % cleanup
+ File = filename:join(Dir, "n.LOG"),
+ No = 4,
+ del(File, No), % cleanup
- ?line {error, {badarg, name}} = disk_log:open([{file, File}]),
- ?line {error, {badarg, file}} = disk_log:open([{name,{foo,bar}}]),
- ?line {error, {badarg, [{foo,bar}]}} = disk_log:open([{foo,bar}]),
+ {error, {badarg, name}} = disk_log:open([{file, File}]),
+ {error, {badarg, file}} = disk_log:open([{name,{foo,bar}}]),
+ {error, {badarg, [{foo,bar}]}} = disk_log:open([{foo,bar}]),
%% external logs, read_only.
- ?line {error, {file_error, _, enoent}} =
+ {error, {file_error, _, enoent}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{size, {100,No}},
{format, external}, {mode, read_only}]),
- ?line Error5 = {error, {file_error, _, enoent}} =
+ Error5 = {error, {file_error, _, enoent}} =
disk_log:open([{name, n}, {file, File}, {type, halt},
{size, 100},
{format, external}, {mode, read_only}]),
- ?line true = lists:prefix("\"" ++ File, format_error(Error5)),
+ true = lists:prefix("\"" ++ File, format_error(Error5)),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, external},{size, {100, No}}]),
%% Already owner, ignored.
- ?line {ok, n} =
+ {ok, n} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, external}, {size, {100, No}}]),
- ?line Error2 = {error, {name_already_open, n}} =
+ Error2 = {error, {name_already_open, n}} =
disk_log:open([{name, n}, {file, another_file}, {type, wrap},
{format, external}, {size, {100, No}}]),
- ?line "The disk log" ++ _ = format_error(Error2),
- ?line Error1 = {error, {arg_mismatch, notify, false, true}} =
+ "The disk log" ++ _ = format_error(Error2),
+ Error1 = {error, {arg_mismatch, notify, false, true}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, external}, {size, {100, No}}, {notify, true}]),
- ?line "The value" ++ _ = format_error(Error1),
- ?line Error3 = {error, {open_read_write, n}} =
+ "The value" ++ _ = format_error(Error1),
+ Error3 = {error, {open_read_write, n}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{mode, read_only},
{format, external}, {size, {100, No}}]),
- ?line "The disk log" ++ _ = format_error(Error3),
- ?line {error, {badarg, size}} =
+ "The disk log" ++ _ = format_error(Error3),
+ {error, {badarg, size}} =
disk_log:open([{name, n}, {file, File}, {type, halt},
{format, external}, {size, {100, No}}]),
- ?line {error, {arg_mismatch, type, wrap, halt}} =
+ {error, {arg_mismatch, type, wrap, halt}} =
disk_log:open([{name, n}, {file, File}, {type, halt},
{format, external}]),
- ?line {error, {arg_mismatch, format, external, internal}} =
+ {error, {arg_mismatch, format, external, internal}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, internal}, {size, {100, No}}]),
- ?line {error, {arg_mismatch, repair, true, false}} =
+ {error, {arg_mismatch, repair, true, false}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, external}, {repair, false}]),
- ?line {error, {size_mismatch, {100,4}, {1000,4}}} =
+ {error, {size_mismatch, {100,4}, {1000,4}}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, external}, {size, {1000, No}}]),
- ?line {error, {arg_mismatch, head, none, _}} =
+ {error, {arg_mismatch, head, none, _}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{head, "header"},
{format, external}, {size, {100, No}}]),
- ?line {error, {badarg, size}} =
+ {error, {badarg, size}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, external}, {size, 100}]),
- ?line ok = disk_log:close(n),
+ ok = disk_log:close(n),
- ?line {ok, n} =
+ {ok, n} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{mode, read_only},
{format, external}, {size, {100, No}}]),
- ?line Error4 = {error, {open_read_only, n}} =
+ Error4 = {error, {open_read_only, n}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{mode, read_write},
{format, external}, {size, {100, No}}]),
- ?line "The disk log" ++ _ = format_error(Error4),
- ?line ok = disk_log:close(n),
+ "The disk log" ++ _ = format_error(Error4),
+ ok = disk_log:close(n),
- ?line del(File, No).
+ del(File, No).
-close_race(suite) -> [];
-close_race(doc) ->
- ["Do something quickly after close/1"];
+%% Do something quickly after close/1.
close_race(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
- ?line File = filename:join(Dir, "n.LOG"),
- ?line No = 1,
- ?line del(File, No), % cleanup
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {size, {100,No}}, {notify, true},
- {format, internal}]),
- ?line ok = disk_log:close(n),
- ?line Error1 = {error, no_such_log} = disk_log:close(n),
- ?line "There is no disk" ++ _ = format_error(Error1),
-
- % Pid1 blocks, Pid2 closes without being suspended.
- ?line Pid1 = spawn_link(?MODULE, lserv, [n]),
- ?line Pid2 = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = sync_do(Pid1, {open, File}),
- ?line {ok, n} = sync_do(Pid2, {open, File}),
- ?line ok = sync_do(Pid1, block),
- ?line [{_, false}, {_, false}] = sync_do(Pid1, owners),
- ?line ok = sync_do(Pid2, close),
- ?line [{_, false}] = sync_do(Pid1, owners),
- ?line ok = sync_do(Pid1, close),
- ?line sync_do(Pid1, terminate),
- ?line sync_do(Pid2, terminate),
- ?line {error, no_such_log} = disk_log:info(n),
-
- % Pid3 blocks, Pid3 closes. Pid4 should still be ablo to use log.
- ?line Pid3 = spawn_link(?MODULE, lserv, [n]),
- ?line Pid4 = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = sync_do(Pid3, {open, File}),
- ?line {ok, n} = sync_do(Pid4, {open, File}),
- ?line ok = sync_do(Pid3, block),
- ?line ok = sync_do(Pid3, close),
- ?line [{_Pid4, false}] = sync_do(Pid4, owners),
- ?line sync_do(Pid3, terminate),
- ?line sync_do(Pid4, terminate),
- ?line {error, no_such_log} = disk_log:info(n),
-
- % Pid5 blocks, Pid5 terminates. Pid6 should still be ablo to use log.
- ?line Pid5 = spawn_link(?MODULE, lserv, [n]),
- ?line Pid6 = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = sync_do(Pid5, {open, File}),
- ?line {ok, n} = sync_do(Pid6, {open, File}),
- ?line ok = sync_do(Pid5, block),
- ?line sync_do(Pid5, terminate),
- ?line [{_Pid6, false}] = sync_do(Pid6, owners),
- ?line sync_do(Pid6, terminate),
- ?line {error, no_such_log} = disk_log:info(n),
- ?line del(File, No), % cleanup
+ File = filename:join(Dir, "n.LOG"),
+ No = 1,
+ del(File, No), % cleanup
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {size, {100,No}}, {notify, true},
+ {format, internal}]),
+ ok = disk_log:close(n),
+ Error1 = {error, no_such_log} = disk_log:close(n),
+ "There is no disk" ++ _ = format_error(Error1),
+
+ %% Pid1 blocks, Pid2 closes without being suspended.
+ Pid1 = spawn_link(?MODULE, lserv, [n]),
+ Pid2 = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = sync_do(Pid1, {open, File}),
+ {ok, n} = sync_do(Pid2, {open, File}),
+ ok = sync_do(Pid1, block),
+ [{_, false}, {_, false}] = sync_do(Pid1, owners),
+ ok = sync_do(Pid2, close),
+ [{_, false}] = sync_do(Pid1, owners),
+ ok = sync_do(Pid1, close),
+ sync_do(Pid1, terminate),
+ sync_do(Pid2, terminate),
+ {error, no_such_log} = disk_log:info(n),
+
+ %% Pid3 blocks, Pid3 closes. Pid4 should still be ablo to use log.
+ Pid3 = spawn_link(?MODULE, lserv, [n]),
+ Pid4 = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = sync_do(Pid3, {open, File}),
+ {ok, n} = sync_do(Pid4, {open, File}),
+ ok = sync_do(Pid3, block),
+ ok = sync_do(Pid3, close),
+ [{_Pid4, false}] = sync_do(Pid4, owners),
+ sync_do(Pid3, terminate),
+ sync_do(Pid4, terminate),
+ {error, no_such_log} = disk_log:info(n),
+
+ %% Pid5 blocks, Pid5 terminates. Pid6 should still be ablo to use log.
+ Pid5 = spawn_link(?MODULE, lserv, [n]),
+ Pid6 = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = sync_do(Pid5, {open, File}),
+ {ok, n} = sync_do(Pid6, {open, File}),
+ ok = sync_do(Pid5, block),
+ sync_do(Pid5, terminate),
+ [{_Pid6, false}] = sync_do(Pid6, owners),
+ sync_do(Pid6, terminate),
+ {error, no_such_log} = disk_log:info(n),
+ del(File, No), % cleanup
ok.
-close_block(suite) -> [];
-close_block(doc) ->
- ["Block, unblock, close, terminate."];
+%% Block, unblock, close, terminate.
close_block(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
- ?line File = filename:join(Dir, "n.LOG"),
+ File = filename:join(Dir, "n.LOG"),
No = 1,
del(File, No), % cleanup
P0 = pps(),
%% One of two owners terminates.
- ?line Pid1 = spawn_link(?MODULE, lserv, [n]),
- ?line Pid2 = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = sync_do(Pid1, {open, File}),
- ?line {ok, n} = sync_do(Pid2, {open, File}),
- ?line [_, _] = sync_do(Pid1, owners),
- ?line [_, _] = sync_do(Pid2, owners),
- ?line 0 = sync_do(Pid1, users),
- ?line 0 = sync_do(Pid2, users),
- ?line sync_do(Pid1, terminate),
- ?line [_] = sync_do(Pid2, owners),
- ?line 0 = sync_do(Pid2, users),
- ?line sync_do(Pid2, terminate),
- ?line {error, no_such_log} = disk_log:info(n),
- ?line true = (P0 == pps()),
+ Pid1 = spawn_link(?MODULE, lserv, [n]),
+ Pid2 = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = sync_do(Pid1, {open, File}),
+ {ok, n} = sync_do(Pid2, {open, File}),
+ [_, _] = sync_do(Pid1, owners),
+ [_, _] = sync_do(Pid2, owners),
+ 0 = sync_do(Pid1, users),
+ 0 = sync_do(Pid2, users),
+ sync_do(Pid1, terminate),
+ [_] = sync_do(Pid2, owners),
+ 0 = sync_do(Pid2, users),
+ sync_do(Pid2, terminate),
+ {error, no_such_log} = disk_log:info(n),
+ true = (P0 == pps()),
%% Users terminate (no link...).
- ?line Pid3 = spawn_link(?MODULE, lserv, [n]),
- ?line Pid4 = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = sync_do(Pid3, {open, File, none}),
- ?line {ok, n} = sync_do(Pid4, {open, File, none}),
- ?line [] = sync_do(Pid3, owners),
- ?line [] = sync_do(Pid4, owners),
- ?line 2 = sync_do(Pid3, users),
- ?line 2 = sync_do(Pid4, users),
- ?line sync_do(Pid3, terminate),
- ?line [] = sync_do(Pid4, owners),
- ?line 2 = sync_do(Pid4, users),
- ?line sync_do(Pid4, terminate),
- ?line disk_log:close(n),
- ?line disk_log:close(n),
- ?line {error, no_such_log} = disk_log:info(n),
- ?line true = (P0 == pps()),
-
- % Blocking owner terminates.
- ?line Pid5 = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {linkto, none},{size, {100,No}},
- {format, external}]),
- ?line {ok, n} = sync_do(Pid5, {open, File}),
- ?line ok = sync_do(Pid5, block),
- ?line {blocked, true} = status(n),
- ?line [_] = owners(n),
- ?line sync_do(Pid5, terminate),
- ?line ok = status(n),
- ?line [] = owners(n),
- ?line 1 = users(n),
- ?line ok = disk_log:close(n),
- ?line {error, no_such_log} = disk_log:info(n),
- ?line true = (P0 == pps()),
-
- % Blocking user terminates.
- ?line Pid6 = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {size, {100,No}}, {format, external}]),
- ?line {ok, n} = sync_do(Pid6, {open, File, none}),
- ?line ok = sync_do(Pid6, block),
- ?line {blocked, true} = status(n),
- ?line [_] = owners(n),
- ?line 1 = users(n),
- ?line sync_do(Pid6, terminate), % very silently...
- ?line ok = status(n),
- ?line [_] = owners(n),
- ?line 1 = users(n),
- ?line ok = disk_log:close(n),
- ?line [] = owners(n),
- ?line 1 = users(n),
- ?line ok = disk_log:close(n),
- ?line {error, no_such_log} = disk_log:info(n),
- ?line true = (P0 == pps()),
-
- % Blocking owner terminates.
- ?line Pid7 = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {linkto, none},
- {size, {100,No}}, {format, external}]),
- ?line {ok, n} = sync_do(Pid7, {open, File}),
- ?line ok = sync_do(Pid7, block),
- ?line {blocked, true} = status(n),
- ?line [_] = owners(n),
- ?line 1 = users(n),
- ?line sync_do(Pid7, terminate),
- ?line ok = status(n),
- ?line [] = owners(n),
- ?line 1 = users(n),
- ?line ok = disk_log:close(n),
- ?line {error, no_such_log} = disk_log:info(n),
- ?line true = (P0 == pps()),
+ Pid3 = spawn_link(?MODULE, lserv, [n]),
+ Pid4 = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = sync_do(Pid3, {open, File, none}),
+ {ok, n} = sync_do(Pid4, {open, File, none}),
+ [] = sync_do(Pid3, owners),
+ [] = sync_do(Pid4, owners),
+ 2 = sync_do(Pid3, users),
+ 2 = sync_do(Pid4, users),
+ sync_do(Pid3, terminate),
+ [] = sync_do(Pid4, owners),
+ 2 = sync_do(Pid4, users),
+ sync_do(Pid4, terminate),
+ disk_log:close(n),
+ disk_log:close(n),
+ {error, no_such_log} = disk_log:info(n),
+ true = (P0 == pps()),
+
+ %% Blocking owner terminates.
+ Pid5 = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {linkto, none},{size, {100,No}},
+ {format, external}]),
+ {ok, n} = sync_do(Pid5, {open, File}),
+ ok = sync_do(Pid5, block),
+ {blocked, true} = status(n),
+ [_] = owners(n),
+ sync_do(Pid5, terminate),
+ ok = status(n),
+ [] = owners(n),
+ 1 = users(n),
+ ok = disk_log:close(n),
+ {error, no_such_log} = disk_log:info(n),
+ true = (P0 == pps()),
+
+ %% Blocking user terminates.
+ Pid6 = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {size, {100,No}}, {format, external}]),
+ {ok, n} = sync_do(Pid6, {open, File, none}),
+ ok = sync_do(Pid6, block),
+ {blocked, true} = status(n),
+ [_] = owners(n),
+ 1 = users(n),
+ sync_do(Pid6, terminate), % very silently...
+ ok = status(n),
+ [_] = owners(n),
+ 1 = users(n),
+ ok = disk_log:close(n),
+ [] = owners(n),
+ 1 = users(n),
+ ok = disk_log:close(n),
+ {error, no_such_log} = disk_log:info(n),
+ true = (P0 == pps()),
+
+ %% Blocking owner terminates.
+ Pid7 = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {linkto, none},
+ {size, {100,No}}, {format, external}]),
+ {ok, n} = sync_do(Pid7, {open, File}),
+ ok = sync_do(Pid7, block),
+ {blocked, true} = status(n),
+ [_] = owners(n),
+ 1 = users(n),
+ sync_do(Pid7, terminate),
+ ok = status(n),
+ [] = owners(n),
+ 1 = users(n),
+ ok = disk_log:close(n),
+ {error, no_such_log} = disk_log:info(n),
+ true = (P0 == pps()),
%% Two owners, the blocking one terminates.
- ?line Pid8 = spawn_link(?MODULE, lserv, [n]),
- ?line Pid9 = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = sync_do(Pid8, {open, File}),
- ?line {ok, n} = sync_do(Pid9, {open, File}),
- ?line ok = sync_do(Pid8, block),
- ?line {blocked, true} = status(n),
- ?line sync_do(Pid8, terminate),
- ?line ok = status(n),
- ?line [_] = sync_do(Pid9, owners),
- ?line 0 = sync_do(Pid9, users),
- ?line sync_do(Pid9, terminate),
- ?line {error, no_such_log} = disk_log:info(n),
- ?line true = (P0 == pps()),
-
- % Blocking user closes.
- ?line Pid10 = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {size, {100,No}}, {format, external}]),
- ?line {ok, n} = sync_do(Pid10, {open, File, none}),
- ?line ok = sync_do(Pid10, block),
- ?line {blocked, true} = status(n),
- ?line [_] = owners(n),
- ?line 1 = users(n),
- ?line ok = sync_do(Pid10, close),
- ?line ok = status(n),
- ?line [_] = owners(n),
- ?line 0 = users(n),
- ?line ok = disk_log:close(n),
- ?line sync_do(Pid10, terminate),
- ?line {error, no_such_log} = disk_log:info(n),
- ?line true = (P0 == pps()),
-
- % Blocking user unblocks and closes.
- ?line Pid11 = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {size, {100,No}}, {format, external}]),
- ?line {ok, n} = sync_do(Pid11, {open, File, none}),
- ?line ok = sync_do(Pid11, block),
- ?line {blocked, true} = status(n),
- ?line [_] = owners(n),
- ?line 1 = users(n),
- ?line ok = sync_do(Pid11, unblock),
- ?line ok = sync_do(Pid11, close),
- ?line ok = status(n),
- ?line [_] = owners(n),
- ?line 0 = users(n),
- ?line ok = disk_log:close(n),
- ?line {error, no_such_log} = disk_log:info(n),
- ?line sync_do(Pid11, terminate),
- ?line true = (P0 == pps()),
-
- % Blocking owner closes.
- ?line Pid12 = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {linkto, none},
- {size, {100,No}}, {format, external}]),
- ?line {ok, n} = sync_do(Pid12, {open, File}),
- ?line ok = sync_do(Pid12, block),
- ?line {blocked, true} = status(n),
- ?line [_] = owners(n),
- ?line 1 = users(n),
- ?line ok = sync_do(Pid12, close),
- ?line ok = status(n),
- ?line [] = owners(n),
- ?line 1 = users(n),
- ?line ok = disk_log:close(n),
- ?line {error, no_such_log} = disk_log:info(n),
- ?line sync_do(Pid12, terminate),
- ?line true = (P0 == pps()),
-
- % Blocking owner unblocks and closes.
- ?line Pid13 = spawn_link(?MODULE, lserv, [n]),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {linkto, none},
- {size, {100,No}}, {format, external}]),
- ?line {ok, n} = sync_do(Pid13, {open, File}),
- ?line ok = sync_do(Pid13, block),
- ?line {blocked, true} = status(n),
- ?line [_] = owners(n),
- ?line 1 = users(n),
- ?line ok = sync_do(Pid13, unblock),
- ?line ok = sync_do(Pid13, close),
- ?line ok = status(n),
- ?line [] = owners(n),
- ?line 1 = users(n),
- ?line ok = disk_log:close(n),
- ?line {error, no_such_log} = disk_log:info(n),
- ?line sync_do(Pid13, terminate),
- ?line true = (P0 == pps()),
+ Pid8 = spawn_link(?MODULE, lserv, [n]),
+ Pid9 = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = sync_do(Pid8, {open, File}),
+ {ok, n} = sync_do(Pid9, {open, File}),
+ ok = sync_do(Pid8, block),
+ {blocked, true} = status(n),
+ sync_do(Pid8, terminate),
+ ok = status(n),
+ [_] = sync_do(Pid9, owners),
+ 0 = sync_do(Pid9, users),
+ sync_do(Pid9, terminate),
+ {error, no_such_log} = disk_log:info(n),
+ true = (P0 == pps()),
+
+ %% Blocking user closes.
+ Pid10 = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {size, {100,No}}, {format, external}]),
+ {ok, n} = sync_do(Pid10, {open, File, none}),
+ ok = sync_do(Pid10, block),
+ {blocked, true} = status(n),
+ [_] = owners(n),
+ 1 = users(n),
+ ok = sync_do(Pid10, close),
+ ok = status(n),
+ [_] = owners(n),
+ 0 = users(n),
+ ok = disk_log:close(n),
+ sync_do(Pid10, terminate),
+ {error, no_such_log} = disk_log:info(n),
+ true = (P0 == pps()),
+
+ %% Blocking user unblocks and closes.
+ Pid11 = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {size, {100,No}}, {format, external}]),
+ {ok, n} = sync_do(Pid11, {open, File, none}),
+ ok = sync_do(Pid11, block),
+ {blocked, true} = status(n),
+ [_] = owners(n),
+ 1 = users(n),
+ ok = sync_do(Pid11, unblock),
+ ok = sync_do(Pid11, close),
+ ok = status(n),
+ [_] = owners(n),
+ 0 = users(n),
+ ok = disk_log:close(n),
+ {error, no_such_log} = disk_log:info(n),
+ sync_do(Pid11, terminate),
+ true = (P0 == pps()),
+
+ %% Blocking owner closes.
+ Pid12 = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {linkto, none},
+ {size, {100,No}}, {format, external}]),
+ {ok, n} = sync_do(Pid12, {open, File}),
+ ok = sync_do(Pid12, block),
+ {blocked, true} = status(n),
+ [_] = owners(n),
+ 1 = users(n),
+ ok = sync_do(Pid12, close),
+ ok = status(n),
+ [] = owners(n),
+ 1 = users(n),
+ ok = disk_log:close(n),
+ {error, no_such_log} = disk_log:info(n),
+ sync_do(Pid12, terminate),
+ true = (P0 == pps()),
+
+ %% Blocking owner unblocks and closes.
+ Pid13 = spawn_link(?MODULE, lserv, [n]),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {linkto, none},
+ {size, {100,No}}, {format, external}]),
+ {ok, n} = sync_do(Pid13, {open, File}),
+ ok = sync_do(Pid13, block),
+ {blocked, true} = status(n),
+ [_] = owners(n),
+ 1 = users(n),
+ ok = sync_do(Pid13, unblock),
+ ok = sync_do(Pid13, close),
+ ok = status(n),
+ [] = owners(n),
+ 1 = users(n),
+ ok = disk_log:close(n),
+ {error, no_such_log} = disk_log:info(n),
+ sync_do(Pid13, terminate),
+ true = (P0 == pps()),
del(File, No), % cleanup
ok.
-close_deadlock(suite) -> [];
-close_deadlock(doc) ->
- ["OTP-4745. Deadlock with just an ordinary log could happen."];
+%% OTP-4745. Deadlock with just an ordinary log could happen.
close_deadlock(Conf) when is_list(Conf) ->
- ?line true = is_alive(),
+ true = is_alive(),
- ?line PrivDir = ?privdir(Conf),
+ PrivDir = ?privdir(Conf),
- ?line F1 = filename:join(PrivDir, "a.LOG"),
- ?line file:delete(F1),
+ F1 = filename:join(PrivDir, "a.LOG"),
+ file:delete(F1),
Self = self(),
%% One process opens the log at the same time as another process
@@ -2378,11 +2305,11 @@ close_deadlock(Conf) when is_list(Conf) ->
Name = a,
Fun = fun() -> open_close(Self, Name, F1) end,
P = spawn(Fun),
- ?line receive {P, Name} -> ok end,
- ?line {ok, L} = disk_log:open([{name,Name},{file,F1}]),
- ?line ok = disk_log:close(L),
- ?line receive {P, done} -> ok end,
- ?line file:delete(F1),
+ receive {P, Name} -> ok end,
+ {ok, L} = disk_log:open([{name,Name},{file,F1}]),
+ ok = disk_log:close(L),
+ receive {P, done} -> ok end,
+ file:delete(F1),
%% One process opens the log at the same time as another process
%% closes the log due to file error while truncating.
@@ -2390,38 +2317,38 @@ close_deadlock(Conf) when is_list(Conf) ->
%% "work". When it works, as it seems to do right now :), the
%% disk_log_server gets {error, no_such_log}, receives the EXIT
%% message caused by truncate, and tries to open the log again.
- ?line No = 4,
- ?line LDir = F1 ++ ".2",
- ?line file:del_dir(LDir),
- ?line del(F1, No),
- ?line ok = file:make_dir(LDir),
+ No = 4,
+ LDir = F1 ++ ".2",
+ file:del_dir(LDir),
+ del(F1, No),
+ ok = file:make_dir(LDir),
Fun2 = fun() -> open_truncate(Self, Name, F1, No) end,
P2 = spawn(Fun2),
- ?line receive {P2, Name} -> ok end,
- ?line {ok, L} = disk_log:open([{name, Name}, {file, F1}, {type, wrap},
- {format, external}]),
+ receive {P2, Name} -> ok end,
+ {ok, L} = disk_log:open([{name, Name}, {file, F1}, {type, wrap},
+ {format, external}]),
%% Note: truncate causes the disk log process to terminate. One
%% cannot say if open above happened before, after, or during the
%% termination. The link to the owner is removed before termination.
- ?line case disk_log:close(L) of
- ok -> ok;
- {error,no_such_log} ->
- ok
- end,
- ?line receive {P2, done} -> ok end,
- ?line del(F1, No),
- ?line file:del_dir(LDir),
+ case disk_log:close(L) of
+ ok -> ok;
+ {error,no_such_log} ->
+ ok
+ end,
+ receive {P2, done} -> ok end,
+ del(F1, No),
+ file:del_dir(LDir),
%% To the same thing, this time using distributed logs.
%% (Does not seem to work very well, unfortunately.)
FunD = fun() -> open_close_dist(Self, Name, F1) end,
PD = spawn(FunD),
receive {PD, Name} -> ok end,
- ?line {[_], []} = disk_log:open([{name,Name},{file,F1},
- {distributed,[node()]}]),
- ?line ok = disk_log:close(L),
+ {[_], []} = disk_log:open([{name,Name},{file,F1},
+ {distributed,[node()]}]),
+ ok = disk_log:close(L),
receive {PD, done} -> ok end,
- ?line file:delete(F1),
+ file:delete(F1),
ok.
@@ -2467,7 +2394,7 @@ sync_do(Pid, Req) ->
end.
lserv(Log) ->
- ?line receive
+ receive
{From, {open, File}} ->
From ! disk_log:open([{name, Log}, {file, File}, {type, wrap},
{size, {100,1}}, {format, external}]);
@@ -2534,664 +2461,652 @@ lserv(Log) ->
lserv(Log).
-error_repair(suite) -> [];
-error_repair(doc) ->
- ["Error while repairing."];
+%% Error while repairing.
error_repair(Conf) when is_list(Conf) ->
- % not all error situations are covered by this test
+ %% not all error situations are covered by this test
DataDir = ?datadir(Conf),
PrivDir = ?privdir(Conf),
- ?line File = filename:join(PrivDir, "n.LOG"),
- ?line No = 4,
- ?line file:delete(File),
- ?line del(File, No), % cleanup
+ File = filename:join(PrivDir, "n.LOG"),
+ No = 4,
+ file:delete(File),
+ del(File, No), % cleanup
- % kurt.LOG is not closed and has four logged items, one is recovered
- ?line copy_wrap_log("kurt.LOG", "n.LOG", No, DataDir, PrivDir),
- ?line {repaired,n,{recovered,1},{badbytes,0}} =
+ %% kurt.LOG is not closed and has four logged items, one is recovered
+ copy_wrap_log("kurt.LOG", "n.LOG", No, DataDir, PrivDir),
+ {repaired,n,{recovered,1},{badbytes,0}} =
disk_log:open([{name, n}, {file, File}, {type, wrap}, {size,{40,No}}]),
- ?line 1 = cur_cnt(n),
- ?line 53 = curb(n),
- ?line 4 = no_items(n),
- ?line ok = disk_log:close(n),
-
- % temporary repair file cannot be created
- ?line copy_wrap_log("kurt.LOG", "n.LOG", No, DataDir, PrivDir),
- ?line Dir = File ++ ".4" ++ ".TMP",
- ?line ok = file:make_dir(Dir),
- ?line P0 = pps(),
- ?line {error, {file_error, _, _}} =
+ 1 = cur_cnt(n),
+ 53 = curb(n),
+ 4 = no_items(n),
+ ok = disk_log:close(n),
+
+ %% temporary repair file cannot be created
+ copy_wrap_log("kurt.LOG", "n.LOG", No, DataDir, PrivDir),
+ Dir = File ++ ".4" ++ ".TMP",
+ ok = file:make_dir(Dir),
+ P0 = pps(),
+ {error, {file_error, _, _}} =
disk_log:open([{name, n}, {file, File}, {type, wrap}, {size,{40,4}}]),
- ?line true = (P0 == pps()),
- ?line del(File, No),
- ?line ok = file:del_dir(Dir),
+ true = (P0 == pps()),
+ del(File, No),
+ ok = file:del_dir(Dir),
%% repair a file
- ?line P1 = pps(),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, internal}, {size, {40,No}}]),
- ?line ok = disk_log:log_terms(n, [{this,is}]), % first file full
- ?line ok = disk_log:log_terms(n, [{some,terms}]), % second file full
- ?line ok = disk_log:close(n),
- ?line BadFile = add_ext(File, 2), % current file
- ?line set_opened(BadFile),
- ?line crash(BadFile, 28), % the binary is now invalid
- ?line {repaired,n,{recovered,0},{badbytes,26}} =
- disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, internal}, {size, {40,No}}]),
- ?line ok = disk_log:close(n),
- ?line true = (P1 == pps()),
- ?line del(File, No),
+ P1 = pps(),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, internal}, {size, {40,No}}]),
+ ok = disk_log:log_terms(n, [{this,is}]), % first file full
+ ok = disk_log:log_terms(n, [{some,terms}]), % second file full
+ ok = disk_log:close(n),
+ BadFile = add_ext(File, 2), % current file
+ set_opened(BadFile),
+ crash(BadFile, 28), % the binary is now invalid
+ {repaired,n,{recovered,0},{badbytes,26}} =
+ disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, internal}, {size, {40,No}}]),
+ ok = disk_log:close(n),
+ true = (P1 == pps()),
+ del(File, No),
%% yet another repair
- ?line P2 = pps(),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, internal}, {size, {4000,No}}]),
- ?line ok = disk_log:log_terms(n, [{this,is},{some,terms}]),
- ?line ok = disk_log:close(n),
- ?line BadFile2 = add_ext(File, 1), % current file
- ?line set_opened(BadFile2),
- ?line crash(BadFile2, 51), % the second binary is now invalid
- ?line {repaired,n,{recovered,1},{badbytes,26}} =
+ P2 = pps(),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, internal}, {size, {4000,No}}]),
+ ok = disk_log:log_terms(n, [{this,is},{some,terms}]),
+ ok = disk_log:close(n),
+ BadFile2 = add_ext(File, 1), % current file
+ set_opened(BadFile2),
+ crash(BadFile2, 51), % the second binary is now invalid
+ {repaired,n,{recovered,1},{badbytes,26}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, internal}, {size, {4000,No}}]),
- ?line ok = disk_log:close(n),
- ?line true = (P2 == pps()),
- ?line del(File, No),
+ ok = disk_log:close(n),
+ true = (P2 == pps()),
+ del(File, No),
%% Repair, large term
- ?line Big = term_to_binary(lists:duplicate(66000,$a)),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, internal}, {size, {40,No}}]),
- ?line ok = disk_log:log_terms(n, [Big]),
- ?line ok = disk_log:close(n),
- ?line set_opened(add_ext(File, 1)),
- ?line {repaired,n,{recovered,1},{badbytes,0}} =
+ Big = term_to_binary(lists:duplicate(66000,$a)),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, internal}, {size, {40,No}}]),
+ ok = disk_log:log_terms(n, [Big]),
+ ok = disk_log:close(n),
+ set_opened(add_ext(File, 1)),
+ {repaired,n,{recovered,1},{badbytes,0}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, internal}, {size, {40,No}}]),
- ?line {_, [Got]} = disk_log:chunk(n, start),
- ?line ok = disk_log:close(n),
- ?line Got = Big,
- ?line del(File, No),
+ {_, [Got]} = disk_log:chunk(n, start),
+ ok = disk_log:close(n),
+ Got = Big,
+ del(File, No),
%% A term a little smaller than a chunk, then big terms.
- ?line BigSmall = mk_bytes(1024*64-8-12),
- ?line file:delete(File),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}]),
- ?line ok = disk_log:log_terms(n, [BigSmall, Big, Big]),
- ?line ok = disk_log:close(n),
- ?line set_opened(File),
- ?line FileSize = file_size(File),
- ?line crash(File, FileSize-byte_size(Big)-4),
- ?line Error1 = {error, {need_repair, _}} =
+ BigSmall = mk_bytes(1024*64-8-12),
+ file:delete(File),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}]),
+ ok = disk_log:log_terms(n, [BigSmall, Big, Big]),
+ ok = disk_log:close(n),
+ set_opened(File),
+ FileSize = file_size(File),
+ crash(File, FileSize-byte_size(Big)-4),
+ Error1 = {error, {need_repair, _}} =
disk_log:open([{name, n}, {file, File}, {repair, false},
{type, halt}, {format, internal}]),
- ?line "The disk log" ++ _ = format_error(Error1),
- ?line {repaired,n,{recovered,2},{badbytes,132013}} =
+ "The disk log" ++ _ = format_error(Error1),
+ {repaired,n,{recovered,2},{badbytes,132013}} =
disk_log:open([{name, n}, {file, File}, {repair, true},
{type, halt}, {format, internal}]),
- ?line ok = disk_log:close(n),
- ?line file:delete(File),
+ ok = disk_log:close(n),
+ file:delete(File),
%% The header is recovered.
- ?line {ok,n} =
+ {ok,n} =
disk_log:open([{name, n}, {file, File}, {type, halt},
{format, internal},
{head_func, {?MODULE, head_fun, [{ok,"head"}]}}]),
- ?line ok = disk_log:log_terms(n, [list,'of',terms]),
- ?line ["head",list,'of',terms] = get_all_terms(n),
- ?line ok = disk_log:close(n),
- ?line set_opened(File),
- ?line crash(File, 30),
- ?line {repaired,n,{recovered,3},{badbytes,16}} =
+ ok = disk_log:log_terms(n, [list,'of',terms]),
+ ["head",list,'of',terms] = get_all_terms(n),
+ ok = disk_log:close(n),
+ set_opened(File),
+ crash(File, 30),
+ {repaired,n,{recovered,3},{badbytes,16}} =
disk_log:open([{name, n}, {file, File}, {type, halt},
{format, internal},{repair,true},
{head_func, {?MODULE, head_fun, [{ok,"head"}]}}]),
- ?line ["head",'of',terms] = get_all_terms(n),
- ?line ok = disk_log:close(n),
+ ["head",'of',terms] = get_all_terms(n),
+ ok = disk_log:close(n),
file:delete(File),
ok.
-
+
set_opened(File) ->
{ok, Fd} = file:open(File, [raw, binary, read, write]),
ok = file:write(Fd, [?LOGMAGIC, ?OPENED]),
ok = file:close(Fd).
-error_log(suite) -> [];
-error_log(doc) ->
- ["Error while repairing."];
+%% Error while repairing.
error_log(Conf) when is_list(Conf) ->
- ?line Dir = ?privdir(Conf),
-
- ?line File = filename:join(Dir, "n.LOG"),
- ?line No = 4,
- ?line file:delete(File),
- ?line del(File, No), % cleanup
- ?line LDir = File ++ ".2",
-
- ?line Q = qlen(),
- % dummy just to get all processes "above" disk_log going
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, external},{size, {100, No}}]),
- ?line ok = disk_log:close(n),
- ?line del(File, No),
-
- % inc_wrap_file fails, the external log is not terminated
- ?line P0 = pps(),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, external},{size, {100, No}}]),
- ?line ok = file:make_dir(LDir),
- ?line {error, {file_error, _, _}} = disk_log:inc_wrap_file(n),
- ?line timer:sleep(500),
- ?line ok = disk_log:close(n),
- ?line del(File, No),
-
- % inc_wrap_file fails, the internal log is not terminated, ./File.2/ exists
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, internal},{size, {100, No}}]),
- ?line {error, {file_error, _, _}} = disk_log:inc_wrap_file(n),
- ?line ok = disk_log:close(n),
- ?line del(File, No),
-
- % truncate fails, the log is terminated, ./File.2/ exists
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, external},{size, {100, No}}]),
- ?line {error, {file_error, _, _}} = disk_log:truncate(n),
- ?line true = (P0 == pps()),
- ?line del(File, No),
+ Dir = ?privdir(Conf),
+
+ File = filename:join(Dir, "n.LOG"),
+ No = 4,
+ file:delete(File),
+ del(File, No), % cleanup
+ LDir = File ++ ".2",
+
+ Q = qlen(),
+ %% dummy just to get all processes "above" disk_log going
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, external},{size, {100, No}}]),
+ ok = disk_log:close(n),
+ del(File, No),
+
+ %% inc_wrap_file fails, the external log is not terminated
+ P0 = pps(),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, external},{size, {100, No}}]),
+ ok = file:make_dir(LDir),
+ {error, {file_error, _, _}} = disk_log:inc_wrap_file(n),
+ timer:sleep(500),
+ ok = disk_log:close(n),
+ del(File, No),
+
+ %% inc_wrap_file fails, the internal log is not terminated, ./File.2/ exists
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, internal},{size, {100, No}}]),
+ {error, {file_error, _, _}} = disk_log:inc_wrap_file(n),
+ ok = disk_log:close(n),
+ del(File, No),
+
+ %% truncate fails, the log is terminated, ./File.2/ exists
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, external},{size, {100, No}}]),
+ {error, {file_error, _, _}} = disk_log:truncate(n),
+ true = (P0 == pps()),
+ del(File, No),
%% OTP-4880.
- % reopen (rename) fails, the log is terminated, ./File.2/ exists
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, external},{size, 100000}]),
- ?line {error, {file_error, _, eisdir}} = disk_log:reopen(n, LDir),
- ?line true = (P0 == pps()),
- ?line file:delete(File),
+ %% reopen (rename) fails, the log is terminated, ./File.2/ exists
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, external},{size, 100000}]),
+ {error, {file_error, _, eisdir}} = disk_log:reopen(n, LDir),
+ true = (P0 == pps()),
+ file:delete(File),
- ?line B = mk_bytes(60),
+ B = mk_bytes(60),
%% OTP-4880. reopen a wrap log, rename fails
- ?line File2 = filename:join(Dir, "n.LOG2"),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File2}, {type, wrap},
- {format, external},{size, {100, No}}]),
- ?line ok = disk_log:blog_terms(n, [B,B,B]),
- ?line {error, {file_error, _, eisdir}} = disk_log:reopen(n, File),
- ?line {error, no_such_log} = disk_log:close(n),
- ?line del(File2, No),
- ?line del(File, No),
-
- % log, external wrap log, ./File.2/ exists
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, external},{size, {100, No}}]),
- ?line {error, {file_error, _, _}} = disk_log:blog_terms(n, [B,B,B]),
- ?line ok = disk_log:close(n),
- ?line del(File, No),
-
- % log, internal wrap log, ./File.2/ exists
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, internal},{size, {100, No}}]),
- ?line {error, {file_error, _, _}} = disk_log:log_terms(n, [B,B,B]),
- ?line ok = disk_log:close(n),
- ?line del(File, No),
-
- ?line ok = file:del_dir(LDir),
-
- % can't remove file when changing size
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, internal},{size, {100, No}}]),
- ?line ok = disk_log:log_terms(n, [B,B,B,B]),
- ?line ok = disk_log:change_size(n, {100, No-2}),
- ?line Three = File ++ ".3",
- ?line ok = file:delete(Three),
- ?line ok = file:make_dir(Three),
- ?line {error, {file_error, _, _}} = disk_log:log_terms(n, [B,B,B]),
- ?line timer:sleep(500),
- ?line ok = disk_log:close(n),
- ?line ok = file:del_dir(Three),
- ?line del(File, No),
- ?line Q = qlen(),
+ File2 = filename:join(Dir, "n.LOG2"),
+ {ok, n} = disk_log:open([{name, n}, {file, File2}, {type, wrap},
+ {format, external},{size, {100, No}}]),
+ ok = disk_log:blog_terms(n, [B,B,B]),
+ {error, {file_error, _, eisdir}} = disk_log:reopen(n, File),
+ {error, no_such_log} = disk_log:close(n),
+ del(File2, No),
+ del(File, No),
+
+ %% log, external wrap log, ./File.2/ exists
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, external},{size, {100, No}}]),
+ {error, {file_error, _, _}} = disk_log:blog_terms(n, [B,B,B]),
+ ok = disk_log:close(n),
+ del(File, No),
+
+ %% log, internal wrap log, ./File.2/ exists
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, internal},{size, {100, No}}]),
+ {error, {file_error, _, _}} = disk_log:log_terms(n, [B,B,B]),
+ ok = disk_log:close(n),
+ del(File, No),
+
+ ok = file:del_dir(LDir),
+
+ %% can't remove file when changing size
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, internal},{size, {100, No}}]),
+ ok = disk_log:log_terms(n, [B,B,B,B]),
+ ok = disk_log:change_size(n, {100, No-2}),
+ Three = File ++ ".3",
+ ok = file:delete(Three),
+ ok = file:make_dir(Three),
+ {error, {file_error, _, _}} = disk_log:log_terms(n, [B,B,B]),
+ timer:sleep(500),
+ ok = disk_log:close(n),
+ ok = file:del_dir(Three),
+ del(File, No),
+ Q = qlen(),
ok.
-
-chunk(suite) -> [];
-chunk(doc) ->
- ["Test chunk and chunk_step."];
+
+%% Test chunk and chunk_step.
chunk(Conf) when is_list(Conf) ->
%% See also halt_ro_crash/1 above.
Dir = ?privdir(Conf),
- ?line File = filename:join(Dir, "n.LOG"),
+ File = filename:join(Dir, "n.LOG"),
No = 4,
- ?line B = mk_bytes(60),
- ?line BB = mk_bytes(64000), % 64 kB chunks
- ?line del(File, No),% cleanup
+ B = mk_bytes(60),
+ BB = mk_bytes(64000), % 64 kB chunks
+ del(File, No),% cleanup
%% Make sure chunk_step skips the rest of the binary.
%% OTP-3716. This was a bug...
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, internal}, {size, {50,No}}]),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, internal}, {size, {50,No}}]),
%% 1, 2 and 3 on file one, 4 on file two.
- ?line ok = disk_log:log_terms(n, [1,2,3,4]),
- ?line {I1, [1]} = disk_log:chunk(n, start, 1),
- ?line [{node,Node}] = disk_log:chunk_info(I1),
- ?line Node = node(),
- ?line Error1 = {error, {no_continuation, foobar}} =
+ ok = disk_log:log_terms(n, [1,2,3,4]),
+ {I1, [1]} = disk_log:chunk(n, start, 1),
+ [{node,Node}] = disk_log:chunk_info(I1),
+ Node = node(),
+ Error1 = {error, {no_continuation, foobar}} =
disk_log:chunk_info(foobar),
- ?line "The term" ++ _ = format_error(Error1),
- ?line {ok, I2} = disk_log:chunk_step(n, I1, 1),
- ?line {error, {badarg, continuation}} = disk_log:chunk_step(n, foobar, 1),
- ?line {I3, [4]} = disk_log:chunk(n, I2, 1),
- ?line {ok, I4} = disk_log:chunk_step(n, I3, -1),
- ?line {_, [1]} = disk_log:chunk(n, I4, 1),
- ?line {error, {badarg, continuation}} = disk_log:bchunk(n, 'begin'),
- ?line {Ib1, [Bin1,Bin2]} = disk_log:bchunk(n, start, 2),
- ?line 1 = binary_to_term(Bin1),
- ?line 2 = binary_to_term(Bin2),
- ?line {ok, Ib2} = disk_log:chunk_step(n, Ib1, 1),
- ?line {Ib3, [Bin3]} = disk_log:bchunk(n, Ib2, 1),
- ?line 4 = binary_to_term(Bin3),
- ?line {ok, Ib4} = disk_log:chunk_step(n, Ib3, -1),
- ?line {_, [Bin4]} = disk_log:bchunk(n, Ib4, 1),
- ?line 1 = binary_to_term(Bin4),
- ?line {Ib5, [Bin1, Bin2, Bin17]} = disk_log:bchunk(n, start),
- ?line 3 = binary_to_term(Bin17),
- ?line {Ib6, [Bin3]} = disk_log:bchunk(n, Ib5, infinity),
- ?line eof = disk_log:bchunk(n, Ib6, infinity),
- ?line ok = disk_log:close(n),
- ?line del(File, No), % cleanup
+ "The term" ++ _ = format_error(Error1),
+ {ok, I2} = disk_log:chunk_step(n, I1, 1),
+ {error, {badarg, continuation}} = disk_log:chunk_step(n, foobar, 1),
+ {I3, [4]} = disk_log:chunk(n, I2, 1),
+ {ok, I4} = disk_log:chunk_step(n, I3, -1),
+ {_, [1]} = disk_log:chunk(n, I4, 1),
+ {error, {badarg, continuation}} = disk_log:bchunk(n, 'begin'),
+ {Ib1, [Bin1,Bin2]} = disk_log:bchunk(n, start, 2),
+ 1 = binary_to_term(Bin1),
+ 2 = binary_to_term(Bin2),
+ {ok, Ib2} = disk_log:chunk_step(n, Ib1, 1),
+ {Ib3, [Bin3]} = disk_log:bchunk(n, Ib2, 1),
+ 4 = binary_to_term(Bin3),
+ {ok, Ib4} = disk_log:chunk_step(n, Ib3, -1),
+ {_, [Bin4]} = disk_log:bchunk(n, Ib4, 1),
+ 1 = binary_to_term(Bin4),
+ {Ib5, [Bin1, Bin2, Bin17]} = disk_log:bchunk(n, start),
+ 3 = binary_to_term(Bin17),
+ {Ib6, [Bin3]} = disk_log:bchunk(n, Ib5, infinity),
+ eof = disk_log:bchunk(n, Ib6, infinity),
+ ok = disk_log:close(n),
+ del(File, No), % cleanup
%% external log, cannot read chunks
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, external}, {size, {100,No}}]),
- ?line {error, {badarg, continuation}} = disk_log:chunk(n, 'begin'),
- ?line {error, {format_external, n}} = disk_log:chunk(n, start),
- ?line Error2 = {error, {not_internal_wrap, n}} =
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, external}, {size, {100,No}}]),
+ {error, {badarg, continuation}} = disk_log:chunk(n, 'begin'),
+ {error, {format_external, n}} = disk_log:chunk(n, start),
+ Error2 = {error, {not_internal_wrap, n}} =
disk_log:chunk_step(n, start, 1),
- ?line "The requested" ++ _ = format_error(Error2),
- ?line ok = disk_log:close(n),
- ?line del(File, No),
+ "The requested" ++ _ = format_error(Error2),
+ ok = disk_log:close(n),
+ del(File, No),
%% wrap, read_write
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, internal}, {size, {100,No}}]),
- ?line ok = disk_log:log_terms(n, [B,B,B,B]),
- ?line {C1, [_]} = disk_log:chunk(n, start),
- ?line {C2, [_]} = disk_log:chunk(n, C1),
- ?line {C3, [_]} = disk_log:chunk(n, C2),
- ?line {C4, [_]} = disk_log:chunk(n, C3, 1),
- ?line eof = disk_log:chunk(n, C4),
- ?line {C5, [_]} = disk_log:chunk(n, start),
- ?line {ok, C6} = disk_log:chunk_step(n, C5, 1),
- ?line {C7, [_]} = disk_log:chunk(n, C6),
- ?line {ok, C8} = disk_log:chunk_step(n, C7, 1),
- ?line {_, [_]} = disk_log:chunk(n, C8),
- ?line ok = disk_log:close(n),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, internal}, {size, {100,No}}]),
+ ok = disk_log:log_terms(n, [B,B,B,B]),
+ {C1, [_]} = disk_log:chunk(n, start),
+ {C2, [_]} = disk_log:chunk(n, C1),
+ {C3, [_]} = disk_log:chunk(n, C2),
+ {C4, [_]} = disk_log:chunk(n, C3, 1),
+ eof = disk_log:chunk(n, C4),
+ {C5, [_]} = disk_log:chunk(n, start),
+ {ok, C6} = disk_log:chunk_step(n, C5, 1),
+ {C7, [_]} = disk_log:chunk(n, C6),
+ {ok, C8} = disk_log:chunk_step(n, C7, 1),
+ {_, [_]} = disk_log:chunk(n, C8),
+ ok = disk_log:close(n),
%% wrap, read_only
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {mode, read_only},
- {format, internal}, {size, {100,No}}]),
- ?line {CC1, [_]} = disk_log:chunk(n, start),
- ?line {CC2, [_]} = disk_log:chunk(n, CC1),
- ?line {CC3, [_]} = disk_log:chunk(n, CC2),
- ?line {CC4, [_]} = disk_log:chunk(n, CC3, 1),
- ?line eof = disk_log:chunk(n, CC4),
- ?line {CC5, [_]} = disk_log:chunk(n, start),
- ?line {ok, CC6} = disk_log:chunk_step(n, CC5, 1),
- ?line {CC7, [_]} = disk_log:chunk(n, CC6),
- ?line {ok, CC8} = disk_log:chunk_step(n, CC7, 1),
- ?line {_, [_]} = disk_log:chunk(n, CC8),
- ?line ok = disk_log:close(n),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {mode, read_only},
+ {format, internal}, {size, {100,No}}]),
+ {CC1, [_]} = disk_log:chunk(n, start),
+ {CC2, [_]} = disk_log:chunk(n, CC1),
+ {CC3, [_]} = disk_log:chunk(n, CC2),
+ {CC4, [_]} = disk_log:chunk(n, CC3, 1),
+ eof = disk_log:chunk(n, CC4),
+ {CC5, [_]} = disk_log:chunk(n, start),
+ {ok, CC6} = disk_log:chunk_step(n, CC5, 1),
+ {CC7, [_]} = disk_log:chunk(n, CC6),
+ {ok, CC8} = disk_log:chunk_step(n, CC7, 1),
+ {_, [_]} = disk_log:chunk(n, CC8),
+ ok = disk_log:close(n),
%% OTP-3716. A bug: {Error, List} and {Error, List, Bad} could be
%% returned from chunk/2.
%% Magic bytes not OK.
%% File header (8 bytes) OK, item header not OK.
- ?line InvalidFile = add_ext(File, 1),
- ?line crash(InvalidFile, 15),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {mode, read_only},
- {format, internal}, {size, {100,No}}]),
- ?line {_, [], 61} = disk_log:chunk(n, start),
- ?line ok = disk_log:close(n),
+ InvalidFile = add_ext(File, 1),
+ crash(InvalidFile, 15),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {mode, read_only},
+ {format, internal}, {size, {100,No}}]),
+ {_, [], 61} = disk_log:chunk(n, start),
+ ok = disk_log:close(n),
%% read_write...
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, internal}, {size, {100,No}}]),
- ?line Error3 = {error, {corrupt_log_file, Culprit}} =
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, internal}, {size, {100,No}}]),
+ Error3 = {error, {corrupt_log_file, Culprit}} =
disk_log:chunk(n, start),
- ?line "The disk log file" ++ _ = format_error(Error3),
- ?line Culprit = InvalidFile,
- ?line ok = disk_log:close(n),
- ?line del(File, No),
+ "The disk log file" ++ _ = format_error(Error3),
+ Culprit = InvalidFile,
+ ok = disk_log:close(n),
+ del(File, No),
%% Two wrap log files, writing the second one, then reading the first
%% one, where a bogus term resides.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, internal}, {size, {40,No}}]),
- ?line ok = disk_log:log_terms(n, [{this,is}]), % first file full
- ?line ok = disk_log:log_terms(n, [{some,terms}]), % second file full
- ?line 2 = curf(n),
- ?line BadFile = add_ext(File, 1),
- ?line crash(BadFile, 28), % the _binary_ is now invalid
- ?line {error, {corrupt_log_file, BFile}} = disk_log:chunk(n, start, 1),
- ?line BadFile = BFile,
- ?line ok = disk_log:close(n),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, internal}, {size, {40,No}}]),
+ ok = disk_log:log_terms(n, [{this,is}]), % first file full
+ ok = disk_log:log_terms(n, [{some,terms}]), % second file full
+ 2 = curf(n),
+ BadFile = add_ext(File, 1),
+ crash(BadFile, 28), % the _binary_ is now invalid
+ {error, {corrupt_log_file, BFile}} = disk_log:chunk(n, start, 1),
+ BadFile = BFile,
+ ok = disk_log:close(n),
%% The same, with a halt log.
- ?line file:delete(File), % cleanup
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}]),
- ?line ok = disk_log:log_terms(n, [{this,is}]),
- ?line ok = disk_log:sync(n),
- ?line crash(File, 28), % the _binary_ is now invalid
- ?line {error, {corrupt_log_file, File2}} = disk_log:chunk(n, start, 1),
- ?line crash(File, 10),
- ?line {error,{corrupt_log_file,_}} = disk_log:bchunk(n, start, 1),
- ?line true = File == File2,
- ?line ok = disk_log:close(n),
- ?line del(File, No),
+ file:delete(File), % cleanup
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}]),
+ ok = disk_log:log_terms(n, [{this,is}]),
+ ok = disk_log:sync(n),
+ crash(File, 28), % the _binary_ is now invalid
+ {error, {corrupt_log_file, File2}} = disk_log:chunk(n, start, 1),
+ crash(File, 10),
+ {error,{corrupt_log_file,_}} = disk_log:bchunk(n, start, 1),
+ true = File == File2,
+ ok = disk_log:close(n),
+ del(File, No),
%% halt, read_write
- ?line file:delete(File), % cleanup
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}]),
- ?line ok = disk_log:log_terms(n, [BB,BB,BB,BB]),
- ?line {D1, [Ch1]} = disk_log:chunk(n, start, 1),
- ?line Ch1 = BB,
- ?line {D2, [Ch2]} = disk_log:chunk(n, D1, 1),
- ?line Ch2 = BB,
- ?line {D3, [Ch3]} = disk_log:chunk(n, D2, 1),
- ?line Ch3 = BB,
- ?line {D4, [Ch4]} = disk_log:chunk(n, D3, 1),
- ?line Ch4 = BB,
- ?line eof = disk_log:chunk(n, D4),
- ?line ok = disk_log:close(n),
+ file:delete(File), % cleanup
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}]),
+ ok = disk_log:log_terms(n, [BB,BB,BB,BB]),
+ {D1, [Ch1]} = disk_log:chunk(n, start, 1),
+ Ch1 = BB,
+ {D2, [Ch2]} = disk_log:chunk(n, D1, 1),
+ Ch2 = BB,
+ {D3, [Ch3]} = disk_log:chunk(n, D2, 1),
+ Ch3 = BB,
+ {D4, [Ch4]} = disk_log:chunk(n, D3, 1),
+ Ch4 = BB,
+ eof = disk_log:chunk(n, D4),
+ ok = disk_log:close(n),
%% halt, read_only
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal},{mode,read_only}]),
- ?line {E1, [Ch5]} = disk_log:chunk(n, start, 1),
- ?line Ch5 = BB,
- ?line {E2, [Ch6]} = disk_log:chunk(n, E1, 1),
- ?line Ch6 = BB,
- ?line {E3, [Ch7]} = disk_log:chunk(n, E2, 1),
- ?line Ch7 = BB,
- ?line {E4, [Ch8]} = disk_log:chunk(n, E3, 1),
- ?line Ch8 = BB,
- ?line eof = disk_log:chunk(n, E4),
- ?line ok = disk_log:close(n),
- ?line file:delete(File), % cleanup
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal},{mode,read_only}]),
+ {E1, [Ch5]} = disk_log:chunk(n, start, 1),
+ Ch5 = BB,
+ {E2, [Ch6]} = disk_log:chunk(n, E1, 1),
+ Ch6 = BB,
+ {E3, [Ch7]} = disk_log:chunk(n, E2, 1),
+ Ch7 = BB,
+ {E4, [Ch8]} = disk_log:chunk(n, E3, 1),
+ Ch8 = BB,
+ eof = disk_log:chunk(n, E4),
+ ok = disk_log:close(n),
+ file:delete(File), % cleanup
%% More than 64 kB term.
- ?line BBB = term_to_binary(lists:duplicate(66000,$a)),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}]),
- ?line ok = disk_log:log_terms(n, [BBB]),
- ?line {F1, [BBB1]} = disk_log:chunk(n, start),
- ?line BBB1 = BBB,
- ?line eof = disk_log:chunk(n, F1),
- ?line ok = disk_log:close(n),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}, {mode, read_only}]),
- ?line {F1r, [BBB2]} = disk_log:chunk(n, start),
- ?line BBB2 = BBB,
- ?line eof = disk_log:chunk(n, F1r),
- ?line ok = disk_log:close(n),
-
- ?line truncate(File, 8192),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}]),
- ?line {error, {corrupt_log_file, _}} = disk_log:chunk(n, start),
- ?line ok = disk_log:close(n),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}, {mode, read_only}]),
- ?line {K1, [], 8176} = disk_log:chunk(n, start),
- ?line eof = disk_log:chunk(n, K1),
- ?line ok = disk_log:close(n),
- ?line file:delete(File), % cleanup
+ BBB = term_to_binary(lists:duplicate(66000,$a)),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}]),
+ ok = disk_log:log_terms(n, [BBB]),
+ {F1, [BBB1]} = disk_log:chunk(n, start),
+ BBB1 = BBB,
+ eof = disk_log:chunk(n, F1),
+ ok = disk_log:close(n),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}, {mode, read_only}]),
+ {F1r, [BBB2]} = disk_log:chunk(n, start),
+ BBB2 = BBB,
+ eof = disk_log:chunk(n, F1r),
+ ok = disk_log:close(n),
+
+ truncate(File, 8192),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}]),
+ {error, {corrupt_log_file, _}} = disk_log:chunk(n, start),
+ ok = disk_log:close(n),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}, {mode, read_only}]),
+ {K1, [], 8176} = disk_log:chunk(n, start),
+ eof = disk_log:chunk(n, K1),
+ ok = disk_log:close(n),
+ file:delete(File), % cleanup
%% OTP-3716. A bug: eof in the middle of the last element is not ok.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}]),
- ?line ok = disk_log:log_terms(n, [B,BB]),
- ?line ok = disk_log:close(n),
- ?line truncate(File, 80),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}]),
- ?line {G1, [_]} = disk_log:chunk(n, start, 1),
- ?line {error, {corrupt_log_file, _}} = disk_log:chunk(n, G1, 1),
- ?line ok = disk_log:close(n),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}, {mode, read_only}]),
- ?line {G1r, [_]} = disk_log:chunk(n, start, 1),
- ?line {_, [], 4} = disk_log:chunk(n, G1r, 1),
- ?line ok = disk_log:close(n),
- ?line file:delete(File), % cleanup
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}]),
+ ok = disk_log:log_terms(n, [B,BB]),
+ ok = disk_log:close(n),
+ truncate(File, 80),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}]),
+ {G1, [_]} = disk_log:chunk(n, start, 1),
+ {error, {corrupt_log_file, _}} = disk_log:chunk(n, G1, 1),
+ ok = disk_log:close(n),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}, {mode, read_only}]),
+ {G1r, [_]} = disk_log:chunk(n, start, 1),
+ {_, [], 4} = disk_log:chunk(n, G1r, 1),
+ ok = disk_log:close(n),
+ file:delete(File), % cleanup
%% Opening a wrap log read-only. The second of four terms is destroyed.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, internal}, {size, {4000,No}}]),
- ?line ok = disk_log:log_terms(n,
- [{this,is},{some,terms},{on,a},{wrap,file}]),
- ?line ok = disk_log:close(n),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, internal}, {mode, read_only}]),
- ?line CrashFile = add_ext(File, 1),
- ?line crash(CrashFile, 51), % the binary term {some,terms} is now bad
- ?line {H1, [{this,is}], 18} = disk_log:chunk(n, start, 10),
- ?line {H2, [{on,a},{wrap,file}]} = disk_log:chunk(n, H1),
- ?line eof = disk_log:chunk(n, H2),
- ?line ok = disk_log:close(n),
- ?line del(File, No),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, internal}, {size, {4000,No}}]),
+ ok = disk_log:log_terms(n,
+ [{this,is},{some,terms},{on,a},{wrap,file}]),
+ ok = disk_log:close(n),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, internal}, {mode, read_only}]),
+ CrashFile = add_ext(File, 1),
+ crash(CrashFile, 51), % the binary term {some,terms} is now bad
+ {H1, [{this,is}], 18} = disk_log:chunk(n, start, 10),
+ {H2, [{on,a},{wrap,file}]} = disk_log:chunk(n, H1),
+ eof = disk_log:chunk(n, H2),
+ ok = disk_log:close(n),
+ del(File, No),
%% The same as last, but with a halt log.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}, {mode, read_write}]),
- ?line ok = disk_log:alog_terms(n, [{this,is},{some,terms}]),
- ?line ok = disk_log:log_terms(n, [{on,a},{halt,file}]),
- ?line ok = disk_log:close(n),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}, {mode, read_only}]),
- ?line crash(File, 51), % the binary term {some,terms} is now bad
- ?line {J1, [{this,is}], 18} = disk_log:chunk(n, start, 10),
- ?line {J2, [{on,a},{halt,file}]} = disk_log:chunk(n, J1),
- ?line eof = disk_log:chunk(n, J2),
- ?line ok = disk_log:close(n),
- ?line file:delete(File),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}, {mode, read_write}]),
+ ok = disk_log:alog_terms(n, [{this,is},{some,terms}]),
+ ok = disk_log:log_terms(n, [{on,a},{halt,file}]),
+ ok = disk_log:close(n),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}, {mode, read_only}]),
+ crash(File, 51), % the binary term {some,terms} is now bad
+ {J1, [{this,is}], 18} = disk_log:chunk(n, start, 10),
+ {J2, [{on,a},{halt,file}]} = disk_log:chunk(n, J1),
+ eof = disk_log:chunk(n, J2),
+ ok = disk_log:close(n),
+ file:delete(File),
%% OTP-7641. Same as last one, but the size of the bad term is
%% less than ?HEADERSz (8) bytes.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}, {mode, read_write}]),
- ?line ok = disk_log:alog_terms(n, [{this,is},{s}]),
- ?line ok = disk_log:log_terms(n, [{on,a},{halt,file}]),
- ?line ok = disk_log:close(n),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}, {mode, read_only}]),
- ?line crash(File, 44), % the binary term {s} is now bad
- ?line {J11, [{this,is}], 7} = disk_log:chunk(n, start, 10),
- ?line {J21, [{on,a},{halt,file}]} = disk_log:chunk(n, J11),
- ?line eof = disk_log:chunk(n, J21),
- ?line ok = disk_log:close(n),
- ?line file:delete(File),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}, {mode, read_write}]),
+ ok = disk_log:alog_terms(n, [{this,is},{s}]),
+ ok = disk_log:log_terms(n, [{on,a},{halt,file}]),
+ ok = disk_log:close(n),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}, {mode, read_only}]),
+ crash(File, 44), % the binary term {s} is now bad
+ {J11, [{this,is}], 7} = disk_log:chunk(n, start, 10),
+ {J21, [{on,a},{halt,file}]} = disk_log:chunk(n, J11),
+ eof = disk_log:chunk(n, J21),
+ ok = disk_log:close(n),
+ file:delete(File),
%% Minimal MD5-proctected term, and maximal unprotected term.
%% A chunk ends in the middle of the MD5-sum.
- ?line MD5term = mk_bytes(64*1024-8),
- ?line NotMD5term = mk_bytes((64*1024-8)-1),
- ?line Term2 = mk_bytes((64*1024-8)-16),
- ?line MD5L = [MD5term,NotMD5term,Term2,MD5term,MD5term,NotMD5term],
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}]),
- ?line ok = disk_log:log_terms(n, MD5L),
- ?line true = MD5L == get_all_terms(n),
- ?line ok = disk_log:close(n),
- ?line true = MD5L == get_all_terms(n, File, halt),
- ?line crash(File, 21), % the MD5-sum of the first term is now bad
- ?line true = {tl(MD5L),64*1024-8} == get_all_terms_and_bad(n, File, halt),
- ?line {_,64*1024-8} = get_all_binary_terms_and_bad(n, File, halt),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
- {format, internal}]),
- ?line {error, {corrupt_log_file, _}} = disk_log:chunk(n, start),
- ?line ok = disk_log:close(n),
- ?line file:delete(File),
+ MD5term = mk_bytes(64*1024-8),
+ NotMD5term = mk_bytes((64*1024-8)-1),
+ Term2 = mk_bytes((64*1024-8)-16),
+ MD5L = [MD5term,NotMD5term,Term2,MD5term,MD5term,NotMD5term],
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}]),
+ ok = disk_log:log_terms(n, MD5L),
+ true = MD5L == get_all_terms(n),
+ ok = disk_log:close(n),
+ true = MD5L == get_all_terms(n, File, halt),
+ crash(File, 21), % the MD5-sum of the first term is now bad
+ true = {tl(MD5L),64*1024-8} == get_all_terms_and_bad(n, File, halt),
+ {_,64*1024-8} = get_all_binary_terms_and_bad(n, File, halt),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {format, internal}]),
+ {error, {corrupt_log_file, _}} = disk_log:chunk(n, start),
+ ok = disk_log:close(n),
+ file:delete(File),
%% A file with "old" terms (magic word is MAGICINT).
DataDir = ?datadir(Conf),
OldTermsFileOrig = filename:join(DataDir, "old_terms.LOG"),
OldTermsFile = filename:join(Dir, "old_terms.LOG"),
- ?line copy_file(OldTermsFileOrig, OldTermsFile),
- ?line {[_,_,_,_],0} = get_all_terms_and_bad(n, OldTermsFile, halt),
- ?line {ok, n} = disk_log:open([{name, n}, {file, OldTermsFile},
- {type, halt}, {format, internal}]),
- ?line [_,_,_,_] = get_all_terms(n),
- ?line ok = disk_log:close(n),
- ?line file:delete(OldTermsFile),
+ copy_file(OldTermsFileOrig, OldTermsFile),
+ {[_,_,_,_],0} = get_all_terms_and_bad(n, OldTermsFile, halt),
+ {ok, n} = disk_log:open([{name, n}, {file, OldTermsFile},
+ {type, halt}, {format, internal}]),
+ [_,_,_,_] = get_all_terms(n),
+ ok = disk_log:close(n),
+ file:delete(OldTermsFile),
ok.
-error_index(suite) -> [];
-error_index(doc) ->
- ["OTP-5558. Keep the contents of index files after disk crash."];
+%% OTP-5558. Keep the contents of index files after disk crash.
error_index(Conf) when is_list(Conf) ->
- ?line Dir = ?privdir(Conf),
+ Dir = ?privdir(Conf),
- ?line File = filename:join(Dir, "n.LOG"),
- ?line IdxFile = File ++ ".idx",
- ?line No = 4,
- ?line file:delete(File),
- ?line del(File, No), % cleanup
+ File = filename:join(Dir, "n.LOG"),
+ IdxFile = File ++ ".idx",
+ No = 4,
+ file:delete(File),
+ del(File, No), % cleanup
Args = [{name,n},{type,wrap},{size,{100,No}},{file,File}],
- ?line {ok, n} = disk_log:open(Args),
- ?line ok = disk_log:close(n),
- ?line Q = qlen(),
+ {ok, n} = disk_log:open(Args),
+ ok = disk_log:close(n),
+ Q = qlen(),
P0 = pps(),
- ?line ok = file:write_file(IdxFile, <<"abc">>),
- ?line {error, {invalid_index_file, _}} = disk_log:open(Args),
- ?line {error, {invalid_index_file, _}} = disk_log:open(Args),
- ?line {error, {invalid_index_file, _}} = disk_log:open(Args),
-
- ?line del(File, No),
- ?line true = (P0 == pps()),
- ?line true = (Q == qlen()),
+ ok = file:write_file(IdxFile, <<"abc">>),
+ {error, {invalid_index_file, _}} = disk_log:open(Args),
+ {error, {invalid_index_file, _}} = disk_log:open(Args),
+ {error, {invalid_index_file, _}} = disk_log:open(Args),
+
+ del(File, No),
+ true = (P0 == pps()),
+ true = (Q == qlen()),
ok.
-
-truncate(suite) -> [];
-truncate(doc) ->
- ["Test truncate/1 on halt and wrap logs."];
+
+%% Test truncate/1 on halt and wrap logs.
truncate(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
- ?line Q = qlen(),
+ Q = qlen(),
Halt = join(Dir, "halt.LOG"),
- % Halt logs.
-
- ?line file:delete(Halt), % cleanup
- ?line {ok, halt} = disk_log:open([{name, halt}, {type, halt}, {file, Halt},
- {head, header}, {notify, true}]),
- ?line infinity = sz(halt),
- ?line ok = disk_log:truncate(halt, tjohej),
- ?line rec(1, {disk_log, node(), halt, {truncated, 1}}),
- ?line ok = disk_log:change_size(halt, 10000),
- ?line 10000 = sz(halt),
- ?line disk_log:close(halt),
- ?line [tjohej] = get_all_terms(halt, Halt, halt),
- ?line file:delete(Halt),
-
- ?line {ok, halt} = disk_log:open([{name, halt}, {type, halt}, {file, Halt},
- {head, header}, {notify, true}]),
- ?line ok = disk_log:truncate(halt),
- ?line rec(1, {disk_log, node(), halt, {truncated, 1}}),
- ?line disk_log:close(halt),
- ?line [header] = get_all_terms(halt, Halt, halt),
- ?line file:delete(Halt),
-
- ?line {ok, halt} = disk_log:open([{name, halt}, {type, halt},
- {file, Halt}, {format, external},
- {head, "header"}, {notify, false}]),
- ?line ok = disk_log:btruncate(halt, "apa"),
- ?line disk_log:close(halt),
- ?line 3 = file_size(Halt),
- ?line file:delete(Halt),
-
+ %% Halt logs.
+
+ file:delete(Halt), % cleanup
+ {ok, halt} = disk_log:open([{name, halt}, {type, halt}, {file, Halt},
+ {head, header}, {notify, true}]),
+ infinity = sz(halt),
+ ok = disk_log:truncate(halt, tjohej),
+ rec(1, {disk_log, node(), halt, {truncated, 1}}),
+ ok = disk_log:change_size(halt, 10000),
+ 10000 = sz(halt),
+ disk_log:close(halt),
+ [tjohej] = get_all_terms(halt, Halt, halt),
+ file:delete(Halt),
+
+ {ok, halt} = disk_log:open([{name, halt}, {type, halt}, {file, Halt},
+ {head, header}, {notify, true}]),
+ ok = disk_log:truncate(halt),
+ rec(1, {disk_log, node(), halt, {truncated, 1}}),
+ disk_log:close(halt),
+ [header] = get_all_terms(halt, Halt, halt),
+ file:delete(Halt),
+
+ {ok, halt} = disk_log:open([{name, halt}, {type, halt},
+ {file, Halt}, {format, external},
+ {head, "header"}, {notify, false}]),
+ ok = disk_log:btruncate(halt, "apa"),
+ disk_log:close(halt),
+ 3 = file_size(Halt),
+ file:delete(Halt),
+
%% Wrap logs.
- ?line File = filename:join(Dir, "n.LOG"),
- ?line No = 4,
- ?line B = mk_bytes(60),
- ?line del(File, No), % cleanup
+ File = filename:join(Dir, "n.LOG"),
+ No = 4,
+ B = mk_bytes(60),
+ del(File, No), % cleanup
%% Internal with header.
- ?line Size = {100, No},
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {head, header}, {notify, true},
- {size, Size}]),
- ?line ok = disk_log:log_terms(n, [B,B,B]),
+ Size = {100, No},
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {head, header}, {notify, true},
+ {size, Size}]),
+ ok = disk_log:log_terms(n, [B,B,B]),
%% Used to be one message, but now one per wrapped file.
- ?line rec(2, {disk_log, node(), n, {wrap, 0}}),
- ?line ok = disk_log:truncate(n, apa),
- ?line rec(1, {disk_log, node(), n, {truncated, 6}}),
- ?line {0, 0} = no_overflows(n),
- ?line 23 = curb(n),
- ?line 1 = curf(n),
- ?line 1 = cur_cnt(n),
- ?line true = (Size == sz(n)),
-
- ?line ok = disk_log:log_terms(n, [B, B]),
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line ok = disk_log:close(n),
- ?line [apa, _, header, _] = get_all_terms(n, File, wrap),
- ?line del(File, No),
-
+ rec(2, {disk_log, node(), n, {wrap, 0}}),
+ ok = disk_log:truncate(n, apa),
+ rec(1, {disk_log, node(), n, {truncated, 6}}),
+ {0, 0} = no_overflows(n),
+ 23 = curb(n),
+ 1 = curf(n),
+ 1 = cur_cnt(n),
+ true = (Size == sz(n)),
+
+ ok = disk_log:log_terms(n, [B, B]),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ ok = disk_log:close(n),
+ [apa, _, header, _] = get_all_terms(n, File, wrap),
+ del(File, No),
+
%% Internal without general header.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {notify, true},
- {size, {100, No}}]),
- ?line ok = disk_log:log_terms(n, [B,B,B]),
- ?line rec(2, {disk_log, node(), n, {wrap, 0}}),
- ?line ok = disk_log:truncate(n, apa),
- ?line rec(1, {disk_log, node(), n, {truncated, 3}}),
- ?line {0, 0} = no_overflows(n),
- ?line 23 = curb(n),
- ?line 1 = curf(n),
- ?line 1 = cur_cnt(n),
- ?line true = (Size == sz(n)),
-
- ?line ok = disk_log:log_terms(n, [B, B]),
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line ok = disk_log:close(n),
- ?line [apa, _, _] = get_all_terms(n, File, wrap),
- ?line del(File, No),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {notify, true},
+ {size, {100, No}}]),
+ ok = disk_log:log_terms(n, [B,B,B]),
+ rec(2, {disk_log, node(), n, {wrap, 0}}),
+ ok = disk_log:truncate(n, apa),
+ rec(1, {disk_log, node(), n, {truncated, 3}}),
+ {0, 0} = no_overflows(n),
+ 23 = curb(n),
+ 1 = curf(n),
+ 1 = cur_cnt(n),
+ true = (Size == sz(n)),
+
+ ok = disk_log:log_terms(n, [B, B]),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ ok = disk_log:close(n),
+ [apa, _, _] = get_all_terms(n, File, wrap),
+ del(File, No),
%% Internal without any header.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {notify, true},
- {size, {100, No}}]),
- ?line ok = disk_log:log_terms(n, [B,B,B]),
- ?line rec(2, {disk_log, node(), n, {wrap, 0}}),
- ?line ok = disk_log:truncate(n),
- ?line rec(1, {disk_log, node(), n, {truncated, 3}}),
- ?line {0, 0} = no_overflows(n),
- ?line 8 = curb(n),
- ?line 1 = curf(n),
- ?line 0 = cur_cnt(n),
- ?line true = (Size == sz(n)),
-
- ?line ok = disk_log:log_terms(n, [B, B]),
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line ok = disk_log:close(n),
- ?line [_, _] = get_all_terms(n, File, wrap),
- ?line del(File, No),
- ?line Q = qlen(),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {notify, true},
+ {size, {100, No}}]),
+ ok = disk_log:log_terms(n, [B,B,B]),
+ rec(2, {disk_log, node(), n, {wrap, 0}}),
+ ok = disk_log:truncate(n),
+ rec(1, {disk_log, node(), n, {truncated, 3}}),
+ {0, 0} = no_overflows(n),
+ 8 = curb(n),
+ 1 = curf(n),
+ 0 = cur_cnt(n),
+ true = (Size == sz(n)),
+
+ ok = disk_log:log_terms(n, [B, B]),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ ok = disk_log:close(n),
+ [_, _] = get_all_terms(n, File, wrap),
+ del(File, No),
+ Q = qlen(),
ok.
-many_users(suite) -> [];
-many_users(doc) ->
- ["Test many users logging and sync:ing at the same time."];
+%% Test many users logging and sync:ing at the same time.
many_users(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
N = 100,
@@ -3199,32 +3114,32 @@ many_users(Conf) when is_list(Conf) ->
Fun1 = fun(Name, Pid, I) -> disk_log:log(Name, {Pid, I}) end,
Fun2 = fun(Name, Pid, I) -> ok = disk_log:log(Name, {Pid, I}),
disk_log:sync(Name) end,
- ?line {C1, T1} = many(Fun2, NoClients, N, halt, internal, infinity, Dir),
- ?line true = lists:duplicate(NoClients, ok) == C1,
- ?line true = length(T1) == N*NoClients,
- ?line {C2, T2} = many(Fun1, NoClients, N, halt, internal, 1000, Dir),
- ?line true = lists:duplicate(NoClients, {error, {full,"log.LOG"}}) == C2,
- ?line true = length(T2) > 0,
- ?line {C3, T3} = many(Fun2, NoClients, N, wrap, internal,
- {300*NoClients,200}, Dir),
- ?line true = lists:duplicate(NoClients, ok) == C3,
- ?line true = length(T3) == N*NoClients,
+ {C1, T1} = many(Fun2, NoClients, N, halt, internal, infinity, Dir),
+ true = lists:duplicate(NoClients, ok) == C1,
+ true = length(T1) == N*NoClients,
+ {C2, T2} = many(Fun1, NoClients, N, halt, internal, 1000, Dir),
+ true = lists:duplicate(NoClients, {error, {full,"log.LOG"}}) == C2,
+ true = length(T2) > 0,
+ {C3, T3} = many(Fun2, NoClients, N, wrap, internal,
+ {300*NoClients,200}, Dir),
+ true = lists:duplicate(NoClients, ok) == C3,
+ true = length(T3) == N*NoClients,
ok.
many(Fun, NoClients, N, Type, Format, Size, Dir) ->
Name = "log.LOG",
File = filename:join(Dir, Name),
del_files(Size, File),
- ?line Q = qlen(),
- ?line {ok, _} = disk_log:open([{name,Name}, {type,Type}, {size,Size},
- {format,Format}, {file,File}]),
- ?line Pids = spawn_clients(NoClients, client, [self(), Name, N, Fun]),
- ?line Checked = check_clients(Pids),
- ?line ok = disk_log:close(Name),
- ?line Terms = get_all_terms(Name, File, Type),
- ?line del_files(Size, File),
- ?line Q = qlen(),
- ?line {Checked, Terms}.
+ Q = qlen(),
+ {ok, _} = disk_log:open([{name,Name}, {type,Type}, {size,Size},
+ {format,Format}, {file,File}]),
+ Pids = spawn_clients(NoClients, client, [self(), Name, N, Fun]),
+ Checked = check_clients(Pids),
+ ok = disk_log:close(Name),
+ Terms = get_all_terms(Name, File, Type),
+ del_files(Size, File),
+ Q = qlen(),
+ {Checked, Terms}.
spawn_clients(0, _F, _A) ->
[];
@@ -3251,211 +3166,208 @@ del_files(_Size, File) ->
-info_current(suite) -> [];
-info_current(doc) ->
- ["Test no_current_{bytes, items} as returned by info/0."];
+%% Test no_current_{bytes, items} as returned by info/0.
info_current(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
- ?line File = filename:join(Dir, "n.LOG"),
+ File = filename:join(Dir, "n.LOG"),
No = 4,
B = mk_bytes(60),
BB = mk_bytes(160), % bigger than a single wrap log file
SB = mk_bytes(10), % much smaller than a single wrap log file
- ?line del(File, No),% cleanup
+ del(File, No),% cleanup
- ?line Q = qlen(),
+ Q = qlen(),
%% Internal with header.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {head, header}, {size, {100,No}}]),
- ?line {26, 1} = {curb(n), cur_cnt(n)},
- ?line {1, 1} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:log(n, B),
- ?line {94, 2} = {curb(n), cur_cnt(n)},
- ?line {2, 2} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:close(n),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {notify, true},
- {head, header}, {size, {100,No}}]),
- ?line {94, 2} = {curb(n), cur_cnt(n)},
- ?line {0, 2} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:log(n, B),
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line {94, 2} = {curb(n), cur_cnt(n)},
- ?line {2, 4} = {no_written_items(n), no_items(n)},
- ?line disk_log:inc_wrap_file(n),
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line {26, 1} = {curb(n), cur_cnt(n)},
- ?line {3, 4} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:log_terms(n, [B,B,B]),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {head, header}, {size, {100,No}}]),
+ {26, 1} = {curb(n), cur_cnt(n)},
+ {1, 1} = {no_written_items(n), no_items(n)},
+ ok = disk_log:log(n, B),
+ {94, 2} = {curb(n), cur_cnt(n)},
+ {2, 2} = {no_written_items(n), no_items(n)},
+ ok = disk_log:close(n),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {notify, true},
+ {head, header}, {size, {100,No}}]),
+ {94, 2} = {curb(n), cur_cnt(n)},
+ {0, 2} = {no_written_items(n), no_items(n)},
+ ok = disk_log:log(n, B),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ {94, 2} = {curb(n), cur_cnt(n)},
+ {2, 4} = {no_written_items(n), no_items(n)},
+ disk_log:inc_wrap_file(n),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ {26, 1} = {curb(n), cur_cnt(n)},
+ {3, 4} = {no_written_items(n), no_items(n)},
+ ok = disk_log:log_terms(n, [B,B,B]),
%% Used to be one message, but now one per wrapped file.
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line rec(1, {disk_log, node(), n, {wrap, 2}}),
- ?line {94, 2} = {curb(n), cur_cnt(n)},
- ?line {8, 7} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:log_terms(n, [B]),
- ?line rec(1, {disk_log, node(), n, {wrap, 2}}),
- ?line ok = disk_log:log_terms(n, [B]),
- ?line rec(1, {disk_log, node(), n, {wrap, 2}}),
- ?line {94, 2} = {curb(n), cur_cnt(n)},
- ?line {12, 7} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:log_terms(n, [BB,BB]),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ rec(1, {disk_log, node(), n, {wrap, 2}}),
+ {94, 2} = {curb(n), cur_cnt(n)},
+ {8, 7} = {no_written_items(n), no_items(n)},
+ ok = disk_log:log_terms(n, [B]),
+ rec(1, {disk_log, node(), n, {wrap, 2}}),
+ ok = disk_log:log_terms(n, [B]),
+ rec(1, {disk_log, node(), n, {wrap, 2}}),
+ {94, 2} = {curb(n), cur_cnt(n)},
+ {12, 7} = {no_written_items(n), no_items(n)},
+ ok = disk_log:log_terms(n, [BB,BB]),
%% Used to be one message, but now one per wrapped file.
- ?line rec(2, {disk_log, node(), n, {wrap, 2}}),
- ?line {194, 2} = {curb(n), cur_cnt(n)},
- ?line {16, 7} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:log_terms(n, [SB,SB,SB]),
- ?line rec(1, {disk_log, node(), n, {wrap, 2}}),
- ?line {80, 4} = {curb(n), cur_cnt(n)},
- ?line {20, 9} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:close(n),
- ?line del(File, No),
+ rec(2, {disk_log, node(), n, {wrap, 2}}),
+ {194, 2} = {curb(n), cur_cnt(n)},
+ {16, 7} = {no_written_items(n), no_items(n)},
+ ok = disk_log:log_terms(n, [SB,SB,SB]),
+ rec(1, {disk_log, node(), n, {wrap, 2}}),
+ {80, 4} = {curb(n), cur_cnt(n)},
+ {20, 9} = {no_written_items(n), no_items(n)},
+ ok = disk_log:close(n),
+ del(File, No),
%% Internal without header.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {size, {100,No}}]),
- ?line {8, 0} = {curb(n), cur_cnt(n)},
- ?line {0, 0} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:log(n, B),
- ?line {76, 1} = {curb(n), cur_cnt(n)},
- ?line {1, 1} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:close(n),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {notify, true}, {size, {100,No}}]),
- ?line {76, 1} = {curb(n), cur_cnt(n)},
- ?line {0, 1} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:log(n, B),
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line {76, 1} = {curb(n), cur_cnt(n)},
- ?line {1, 2} = {no_written_items(n), no_items(n)},
- ?line disk_log:inc_wrap_file(n),
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line {8, 0} = {curb(n), cur_cnt(n)},
- ?line {1, 2} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:log_terms(n, [B,B,B]),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {size, {100,No}}]),
+ {8, 0} = {curb(n), cur_cnt(n)},
+ {0, 0} = {no_written_items(n), no_items(n)},
+ ok = disk_log:log(n, B),
+ {76, 1} = {curb(n), cur_cnt(n)},
+ {1, 1} = {no_written_items(n), no_items(n)},
+ ok = disk_log:close(n),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {notify, true}, {size, {100,No}}]),
+ {76, 1} = {curb(n), cur_cnt(n)},
+ {0, 1} = {no_written_items(n), no_items(n)},
+ ok = disk_log:log(n, B),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ {76, 1} = {curb(n), cur_cnt(n)},
+ {1, 2} = {no_written_items(n), no_items(n)},
+ disk_log:inc_wrap_file(n),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ {8, 0} = {curb(n), cur_cnt(n)},
+ {1, 2} = {no_written_items(n), no_items(n)},
+ ok = disk_log:log_terms(n, [B,B,B]),
%% Used to be one message, but now one per wrapped file.
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line rec(1, {disk_log, node(), n, {wrap, 1}}),
- ?line {76, 1} = {curb(n), cur_cnt(n)},
- ?line {4, 4} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:log_terms(n, [B]),
- ?line rec(1, {disk_log, node(), n, {wrap, 1}}),
- ?line ok = disk_log:log_terms(n, [B]),
- ?line rec(1, {disk_log, node(), n, {wrap, 1}}),
- ?line {76, 1} = {curb(n), cur_cnt(n)},
- ?line {6, 4} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:log_terms(n, [BB,BB]),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ rec(1, {disk_log, node(), n, {wrap, 1}}),
+ {76, 1} = {curb(n), cur_cnt(n)},
+ {4, 4} = {no_written_items(n), no_items(n)},
+ ok = disk_log:log_terms(n, [B]),
+ rec(1, {disk_log, node(), n, {wrap, 1}}),
+ ok = disk_log:log_terms(n, [B]),
+ rec(1, {disk_log, node(), n, {wrap, 1}}),
+ {76, 1} = {curb(n), cur_cnt(n)},
+ {6, 4} = {no_written_items(n), no_items(n)},
+ ok = disk_log:log_terms(n, [BB,BB]),
%% Used to be one message, but now one per wrapped file.
- ?line rec(2, {disk_log, node(), n, {wrap, 1}}),
- ?line {176, 1} = {curb(n), cur_cnt(n)},
- ?line {8, 4} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:log_terms(n, [SB,SB,SB]),
- ?line rec(1, {disk_log, node(), n, {wrap, 1}}),
- ?line {62, 3} = {curb(n), cur_cnt(n)},
- ?line {11, 6} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:close(n),
- ?line del(File, No),
+ rec(2, {disk_log, node(), n, {wrap, 1}}),
+ {176, 1} = {curb(n), cur_cnt(n)},
+ {8, 4} = {no_written_items(n), no_items(n)},
+ ok = disk_log:log_terms(n, [SB,SB,SB]),
+ rec(1, {disk_log, node(), n, {wrap, 1}}),
+ {62, 3} = {curb(n), cur_cnt(n)},
+ {11, 6} = {no_written_items(n), no_items(n)},
+ ok = disk_log:close(n),
+ del(File, No),
%% External with header.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, external}, {head, "header"},
- {size, {100,No}}]),
- ?line {6, 1} = {curb(n), cur_cnt(n)},
- ?line {1, 1} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:blog(n, B),
- ?line {62, 2} = {curb(n), cur_cnt(n)},
- ?line {2, 2} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:close(n),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, external}, {head, "header"},
- {notify, true}, {size, {100,No}}]),
- ?line {62, 2} = {curb(n), cur_cnt(n)},
- ?line {0, 2} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:blog(n, B),
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line {62, 2} = {curb(n), cur_cnt(n)},
- ?line {2, 4} = {no_written_items(n), no_items(n)},
- ?line disk_log:inc_wrap_file(n),
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line {6, 1} = {curb(n), cur_cnt(n)},
- ?line {3, 4} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:blog_terms(n, [B,B,B]),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, external}, {head, "header"},
+ {size, {100,No}}]),
+ {6, 1} = {curb(n), cur_cnt(n)},
+ {1, 1} = {no_written_items(n), no_items(n)},
+ ok = disk_log:blog(n, B),
+ {62, 2} = {curb(n), cur_cnt(n)},
+ {2, 2} = {no_written_items(n), no_items(n)},
+ ok = disk_log:close(n),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, external}, {head, "header"},
+ {notify, true}, {size, {100,No}}]),
+ {62, 2} = {curb(n), cur_cnt(n)},
+ {0, 2} = {no_written_items(n), no_items(n)},
+ ok = disk_log:blog(n, B),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ {62, 2} = {curb(n), cur_cnt(n)},
+ {2, 4} = {no_written_items(n), no_items(n)},
+ disk_log:inc_wrap_file(n),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ {6, 1} = {curb(n), cur_cnt(n)},
+ {3, 4} = {no_written_items(n), no_items(n)},
+ ok = disk_log:blog_terms(n, [B,B,B]),
%% Used to be one message, but now one per wrapped file.
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line rec(1, {disk_log, node(), n, {wrap, 2}}),
- ?line {62, 2} = {curb(n), cur_cnt(n)},
- ?line {8, 7} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:blog_terms(n, [B]),
- ?line rec(1, {disk_log, node(), n, {wrap, 2}}),
- ?line ok = disk_log:blog_terms(n, [B]),
- ?line rec(1, {disk_log, node(), n, {wrap, 2}}),
- ?line {62, 2} = {curb(n), cur_cnt(n)},
- ?line {12, 7} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:blog_terms(n, [BB,BB]),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ rec(1, {disk_log, node(), n, {wrap, 2}}),
+ {62, 2} = {curb(n), cur_cnt(n)},
+ {8, 7} = {no_written_items(n), no_items(n)},
+ ok = disk_log:blog_terms(n, [B]),
+ rec(1, {disk_log, node(), n, {wrap, 2}}),
+ ok = disk_log:blog_terms(n, [B]),
+ rec(1, {disk_log, node(), n, {wrap, 2}}),
+ {62, 2} = {curb(n), cur_cnt(n)},
+ {12, 7} = {no_written_items(n), no_items(n)},
+ ok = disk_log:blog_terms(n, [BB,BB]),
%% Used to be one message, but now one per wrapped file.
- ?line rec(2, {disk_log, node(), n, {wrap, 2}}),
- ?line {162, 2} = {curb(n), cur_cnt(n)},
- ?line {16, 7} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:blog_terms(n, [SB,SB,SB]),
-
- ?line rec(1, {disk_log, node(), n, {wrap, 2}}),
- ?line {24, 4} = {curb(n), cur_cnt(n)},
- ?line {20, 9} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:close(n),
- ?line del(File, No),
+ rec(2, {disk_log, node(), n, {wrap, 2}}),
+ {162, 2} = {curb(n), cur_cnt(n)},
+ {16, 7} = {no_written_items(n), no_items(n)},
+ ok = disk_log:blog_terms(n, [SB,SB,SB]),
+
+ rec(1, {disk_log, node(), n, {wrap, 2}}),
+ {24, 4} = {curb(n), cur_cnt(n)},
+ {20, 9} = {no_written_items(n), no_items(n)},
+ ok = disk_log:close(n),
+ del(File, No),
%% External without header.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {format, external}, {size, {100,No}}]),
- ?line {0, 0} = {curb(n), cur_cnt(n)},
- ?line {0, 0} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:blog(n, B),
- ?line {56, 1} = {curb(n), cur_cnt(n)},
- ?line {1, 1} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:close(n),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
- {notify, true},
- {format, external}, {size, {100,No}}]),
- ?line {56, 1} = {curb(n), cur_cnt(n)},
- ?line {0, 1} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:blog(n, B),
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line {56, 1} = {curb(n), cur_cnt(n)},
- ?line {1, 2} = {no_written_items(n), no_items(n)},
- ?line disk_log:inc_wrap_file(n),
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line {0, 0} = {curb(n), cur_cnt(n)},
- ?line {1, 2} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:blog_terms(n, [B,B,B]),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {format, external}, {size, {100,No}}]),
+ {0, 0} = {curb(n), cur_cnt(n)},
+ {0, 0} = {no_written_items(n), no_items(n)},
+ ok = disk_log:blog(n, B),
+ {56, 1} = {curb(n), cur_cnt(n)},
+ {1, 1} = {no_written_items(n), no_items(n)},
+ ok = disk_log:close(n),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {notify, true},
+ {format, external}, {size, {100,No}}]),
+ {56, 1} = {curb(n), cur_cnt(n)},
+ {0, 1} = {no_written_items(n), no_items(n)},
+ ok = disk_log:blog(n, B),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ {56, 1} = {curb(n), cur_cnt(n)},
+ {1, 2} = {no_written_items(n), no_items(n)},
+ disk_log:inc_wrap_file(n),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ {0, 0} = {curb(n), cur_cnt(n)},
+ {1, 2} = {no_written_items(n), no_items(n)},
+ ok = disk_log:blog_terms(n, [B,B,B]),
%% Used to be one message, but now one per wrapped file.
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line rec(1, {disk_log, node(), n, {wrap, 1}}),
- ?line {56, 1} = {curb(n), cur_cnt(n)},
- ?line {4, 4} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:blog_terms(n, [B]),
- ?line rec(1, {disk_log, node(), n, {wrap, 1}}),
- ?line ok = disk_log:blog_terms(n, [B]),
- ?line rec(1, {disk_log, node(), n, {wrap, 1}}),
- ?line {56, 1} = {curb(n), cur_cnt(n)},
- ?line {6, 4} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:blog_terms(n, [BB,BB]),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ rec(1, {disk_log, node(), n, {wrap, 1}}),
+ {56, 1} = {curb(n), cur_cnt(n)},
+ {4, 4} = {no_written_items(n), no_items(n)},
+ ok = disk_log:blog_terms(n, [B]),
+ rec(1, {disk_log, node(), n, {wrap, 1}}),
+ ok = disk_log:blog_terms(n, [B]),
+ rec(1, {disk_log, node(), n, {wrap, 1}}),
+ {56, 1} = {curb(n), cur_cnt(n)},
+ {6, 4} = {no_written_items(n), no_items(n)},
+ ok = disk_log:blog_terms(n, [BB,BB]),
%% Used to be one message, but now one per wrapped file.
- ?line rec(2, {disk_log, node(), n, {wrap, 1}}),
- ?line {156, 1} = {curb(n), cur_cnt(n)},
- ?line {8, 4} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:blog_terms(n, [SB,SB,SB]),
- ?line rec(1, {disk_log, node(), n, {wrap, 1}}),
- ?line {18, 3} = {curb(n), cur_cnt(n)},
- ?line {11, 6} = {no_written_items(n), no_items(n)},
- ?line ok = disk_log:close(n),
- ?line del(File, No),
-
- ?line Q = qlen(),
+ rec(2, {disk_log, node(), n, {wrap, 1}}),
+ {156, 1} = {curb(n), cur_cnt(n)},
+ {8, 4} = {no_written_items(n), no_items(n)},
+ ok = disk_log:blog_terms(n, [SB,SB,SB]),
+ rec(1, {disk_log, node(), n, {wrap, 1}}),
+ {18, 3} = {curb(n), cur_cnt(n)},
+ {11, 6} = {no_written_items(n), no_items(n)},
+ ok = disk_log:close(n),
+ del(File, No),
+
+ Q = qlen(),
ok.
-change_size_before(suite) -> [];
change_size_before(doc) ->
["Change size of a wrap log file before we have reached "
"to the file index corresponding to the new size"];
@@ -3478,138 +3390,136 @@ change_size_before(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
del(File, 5),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File},
- {type, wrap}, {size, {100,5}}]),
- ?line disk_log:log(a, Log_1_1),
- ?line disk_log:log(a, Log_1_2),
- ?line disk_log:log(a, Log_2_1),
- ?line disk_log:log(a, Log_2_2),
- ?line disk_log:change_size(a, {100, 3}),
- ?line [Log_1_1, Log_1_2,
- Log_2_1, Log_2_2] = get_all_terms(a),
- ?line disk_log:log(a, Log_3_1),
- ?line disk_log:log(a, Log_3_2),
- ?line disk_log:log(a, Log_1_2_1),
- ?line disk_log:log(a, Log_1_2_2),
- ?line [Log_2_1, Log_2_2,
- Log_3_1, Log_3_2,
- Log_1_2_1, Log_1_2_2] = get_all_terms(a),
-
- ?line disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
- {size, {100,3}}]),
- ?line [Log_2_1, Log_2_2,
- Log_3_1, Log_3_2,
- Log_1_2_1, Log_1_2_2] = get_all_terms(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File},
+ {type, wrap}, {size, {100,5}}]),
+ disk_log:log(a, Log_1_1),
+ disk_log:log(a, Log_1_2),
+ disk_log:log(a, Log_2_1),
+ disk_log:log(a, Log_2_2),
+ disk_log:change_size(a, {100, 3}),
+ [Log_1_1, Log_1_2,
+ Log_2_1, Log_2_2] = get_all_terms(a),
+ disk_log:log(a, Log_3_1),
+ disk_log:log(a, Log_3_2),
+ disk_log:log(a, Log_1_2_1),
+ disk_log:log(a, Log_1_2_2),
+ [Log_2_1, Log_2_2,
+ Log_3_1, Log_3_2,
+ Log_1_2_1, Log_1_2_2] = get_all_terms(a),
+
+ disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
+ {size, {100,3}}]),
+ [Log_2_1, Log_2_2,
+ Log_3_1, Log_3_2,
+ Log_1_2_1, Log_1_2_2] = get_all_terms(a),
disk_log:close(a),
del(File, 5),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
- {size, {60,5}}, {format, external}]),
- ?line disk_log:blog(a, Log_1_1),
- ?line disk_log:blog(a, Log_1_2),
- ?line disk_log:blog(a, Log_2_1),
- ?line disk_log:blog(a, Log_2_2),
- ?line disk_log:change_size(a, {60, 3}),
- ?line ok = disk_log:sync(a),
- ?line {ok, Fd1} = file:open(File ++ ".1", [read]),
- ?line Log11_12 = Log_1_1 ++ Log_1_2,
- ?line {ok,Log11_12} = file:read(Fd1, 200),
- ?line ok = file:close(Fd1),
- ?line {ok, Fd2} = file:open(File ++ ".2", [read]),
-% ?t:format(0, "~p~n",[file:read(Fd2, 200)]),
- ?line Log21_22 = Log_2_1 ++ Log_2_2,
- ?line {ok,Log21_22} = file:read(Fd2, 200),
- ?line ok = file:close(Fd2),
- ?line disk_log:blog(a, Log_3_1),
- ?line disk_log:blog(a, Log_3_2),
- ?line disk_log:blog(a, Log_1_2_1),
- ?line disk_log:blog(a, Log_1_2_2),
- ?line ok = disk_log:sync(a),
- ?line {ok, Fd2a} = file:open(File ++ ".2", [read]),
- ?line {ok,Log21_22} = file:read(Fd2a, 200),
- ?line ok = file:close(Fd2a),
- ?line {ok, Fd3a} = file:open(File ++ ".3", [read]),
- ?line Log31_32 = Log_3_1 ++ Log_3_2,
- ?line {ok,Log31_32} = file:read(Fd3a, 200),
- ?line ok = file:close(Fd3a),
- ?line {ok, Fd1a} = file:open(File ++ ".1", [read]),
- ?line Log121_122 = Log_1_2_1 ++ Log_1_2_2,
- ?line {ok,Log121_122} = file:read(Fd1a, 200),
- ?line ok = file:close(Fd1a),
-
- ?line disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
- {size, {60,3}}, {format, external}]),
- ?line {ok, Fd2b} = file:open(File ++ ".2", [read]),
- ?line {ok,Log21_22} = file:read(Fd2b, 200),
- ?line ok = file:close(Fd2b),
- ?line {ok, Fd3b} = file:open(File ++ ".3", [read]),
- ?line {ok,Log31_32} = file:read(Fd3b, 200),
- ?line ok = file:close(Fd3b),
- ?line {ok, Fd1b} = file:open(File ++ ".1", [read]),
- ?line {ok,Log121_122} = file:read(Fd1b, 200),
- ?line ok = file:close(Fd1b),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
+ {size, {60,5}}, {format, external}]),
+ disk_log:blog(a, Log_1_1),
+ disk_log:blog(a, Log_1_2),
+ disk_log:blog(a, Log_2_1),
+ disk_log:blog(a, Log_2_2),
+ disk_log:change_size(a, {60, 3}),
+ ok = disk_log:sync(a),
+ {ok, Fd1} = file:open(File ++ ".1", [read]),
+ Log11_12 = Log_1_1 ++ Log_1_2,
+ {ok,Log11_12} = file:read(Fd1, 200),
+ ok = file:close(Fd1),
+ {ok, Fd2} = file:open(File ++ ".2", [read]),
+ Log21_22 = Log_2_1 ++ Log_2_2,
+ {ok,Log21_22} = file:read(Fd2, 200),
+ ok = file:close(Fd2),
+ disk_log:blog(a, Log_3_1),
+ disk_log:blog(a, Log_3_2),
+ disk_log:blog(a, Log_1_2_1),
+ disk_log:blog(a, Log_1_2_2),
+ ok = disk_log:sync(a),
+ {ok, Fd2a} = file:open(File ++ ".2", [read]),
+ {ok,Log21_22} = file:read(Fd2a, 200),
+ ok = file:close(Fd2a),
+ {ok, Fd3a} = file:open(File ++ ".3", [read]),
+ Log31_32 = Log_3_1 ++ Log_3_2,
+ {ok,Log31_32} = file:read(Fd3a, 200),
+ ok = file:close(Fd3a),
+ {ok, Fd1a} = file:open(File ++ ".1", [read]),
+ Log121_122 = Log_1_2_1 ++ Log_1_2_2,
+ {ok,Log121_122} = file:read(Fd1a, 200),
+ ok = file:close(Fd1a),
+
+ disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
+ {size, {60,3}}, {format, external}]),
+ {ok, Fd2b} = file:open(File ++ ".2", [read]),
+ {ok,Log21_22} = file:read(Fd2b, 200),
+ ok = file:close(Fd2b),
+ {ok, Fd3b} = file:open(File ++ ".3", [read]),
+ {ok,Log31_32} = file:read(Fd3b, 200),
+ ok = file:close(Fd3b),
+ {ok, Fd1b} = file:open(File ++ ".1", [read]),
+ {ok,Log121_122} = file:read(Fd1b, 200),
+ ok = file:close(Fd1b),
disk_log:close(a),
del(File, 5),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {100,5}}]),
- ?line disk_log:log(a, Log_1_1),
- ?line disk_log:log(a, Log_1_2),
- ?line disk_log:log(a, Log_2_1),
- ?line disk_log:log(a, Log_2_2),
- ?line disk_log:change_size(a, {60, 3}),
- ?line [Log_1_1, Log_1_2,
- Log_2_1, Log_2_2] = get_all_terms(a),
- ?line disk_log:log(a, Log_3_1),
- ?line disk_log:log(a, Log_1_2_1),
- ?line [Log_2_1, Log_2_2,
- Log_3_1,
- Log_1_2_1] = get_all_terms(a),
-
- ?line disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {60,3}}]),
- ?line [Log_2_1, Log_2_2,
- Log_3_1,
- Log_1_2_1] = get_all_terms(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {100,5}}]),
+ disk_log:log(a, Log_1_1),
+ disk_log:log(a, Log_1_2),
+ disk_log:log(a, Log_2_1),
+ disk_log:log(a, Log_2_2),
+ disk_log:change_size(a, {60, 3}),
+ [Log_1_1, Log_1_2,
+ Log_2_1, Log_2_2] = get_all_terms(a),
+ disk_log:log(a, Log_3_1),
+ disk_log:log(a, Log_1_2_1),
+ [Log_2_1, Log_2_2,
+ Log_3_1,
+ Log_1_2_1] = get_all_terms(a),
+
+ disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {60,3}}]),
+ [Log_2_1, Log_2_2,
+ Log_3_1,
+ Log_1_2_1] = get_all_terms(a),
disk_log:close(a),
del(File, 5),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {60, 3}}]),
- ?line disk_log:log(a, Log_1_1),
- ?line disk_log:log(a, Log_2_1),
- ?line disk_log:change_size(a, {100, 5}),
- ?line [Log_1_1,
- Log_2_1] = get_all_terms(a),
- ?line disk_log:log(a, Log_2_2),
- ?line disk_log:log(a, Log_3_1),
- ?line disk_log:log(a, Log_3_2),
- ?line disk_log:log(a, Log_4_1),
- ?line disk_log:log(a, Log_4_2),
- ?line disk_log:log(a, Log_5_1),
- ?line disk_log:log(a, Log_5_2),
- ?line disk_log:log(a, Log_1_2_1),
- ?line [Log_2_1, Log_2_2,
- Log_3_1, Log_3_2,
- Log_4_1, Log_4_2,
- Log_5_1, Log_5_2,
- Log_1_2_1] = get_all_terms(a),
-
- ?line disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {100, 5}}]),
- ?line [Log_2_1, Log_2_2,
- Log_3_1, Log_3_2,
- Log_4_1, Log_4_2,
- Log_5_1, Log_5_2,
- Log_1_2_1] = get_all_terms(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {60, 3}}]),
+ disk_log:log(a, Log_1_1),
+ disk_log:log(a, Log_2_1),
+ disk_log:change_size(a, {100, 5}),
+ [Log_1_1,
+ Log_2_1] = get_all_terms(a),
+ disk_log:log(a, Log_2_2),
+ disk_log:log(a, Log_3_1),
+ disk_log:log(a, Log_3_2),
+ disk_log:log(a, Log_4_1),
+ disk_log:log(a, Log_4_2),
+ disk_log:log(a, Log_5_1),
+ disk_log:log(a, Log_5_2),
+ disk_log:log(a, Log_1_2_1),
+ [Log_2_1, Log_2_2,
+ Log_3_1, Log_3_2,
+ Log_4_1, Log_4_2,
+ Log_5_1, Log_5_2,
+ Log_1_2_1] = get_all_terms(a),
+
+ disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {100, 5}}]),
+ [Log_2_1, Log_2_2,
+ Log_3_1, Log_3_2,
+ Log_4_1, Log_4_2,
+ Log_5_1, Log_5_2,
+ Log_1_2_1] = get_all_terms(a),
disk_log:close(a),
del(File, 5).
-change_size_during(suite) -> [];
-change_size_during(doc) -> ["Change size of a wrap log file while logging "
- "to a file index between the old and the new size"];
+%% Change size of a wrap log file while logging to a file index
+%% between the old and the new size.
change_size_during(Conf) when is_list(Conf) ->
Log_1_1 = "first log first message",
@@ -3633,114 +3543,111 @@ change_size_during(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {100,5}}]),
- ?line disk_log:log(a, Log_1_1),
- ?line disk_log:log(a, Log_1_2),
- ?line disk_log:log(a, Log_2_1),
- ?line disk_log:log(a, Log_2_2),
- ?line disk_log:log(a, Log_3_1),
- ?line disk_log:log(a, Log_3_2),
- ?line disk_log:log(a, Log_4_1),
- ?line disk_log:log(a, Log_4_2),
- ?line disk_log:log(a, Log_5_1),
- ?line disk_log:log(a, Log_5_2),
- ?line disk_log:log(a, Log_1_1),
- ?line disk_log:log(a, Log_1_2),
- ?line disk_log:log(a, Log_2_1),
- ?line disk_log:log(a, Log_2_2),
- ?line disk_log:log(a, Log_3_1),
- ?line disk_log:log(a, Log_3_2),
- ?line disk_log:log(a, Log_4_1),
- ?line disk_log:log(a, Log_4_2),
- ?line disk_log:change_size(a, {100, 3}),
- ?line [Log_5_1, Log_5_2,
- Log_1_1, Log_1_2,
- Log_2_1, Log_2_2,
- Log_3_1, Log_3_2,
- Log_4_1, Log_4_2] = get_all_terms(a),
- ?line disk_log:log(a, Log_1_2_1),
- ?line disk_log:log(a, Log_1_2_2),
- ?line [Log_2_1, Log_2_2,
- Log_3_1, Log_3_2,
- Log_4_1, Log_4_2,
- Log_1_2_1, Log_1_2_2] = get_all_terms(a),
-
- ?line disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {100,3}}]),
- ?line [Log_2_1, Log_2_2,
- Log_3_1, Log_3_2,
- Log_4_1, Log_4_2,
- Log_1_2_1, Log_1_2_2] = get_all_terms(a),
- ?line disk_log:log(a, Log_2_2_1),
- ?line disk_log:log(a, Log_2_2_2),
- ?line disk_log:log(a, Log_3_2_1),
- ?line disk_log:log(a, Log_3_2_2),
- ?line disk_log:log(a, Log_1_3_1),
- ?line disk_log:log(a, Log_1_3_2),
- ?line [Log_2_2_1, Log_2_2_2,
- Log_3_2_1, Log_3_2_2,
- Log_1_3_1, Log_1_3_2] = get_all_terms(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {100,5}}]),
+ disk_log:log(a, Log_1_1),
+ disk_log:log(a, Log_1_2),
+ disk_log:log(a, Log_2_1),
+ disk_log:log(a, Log_2_2),
+ disk_log:log(a, Log_3_1),
+ disk_log:log(a, Log_3_2),
+ disk_log:log(a, Log_4_1),
+ disk_log:log(a, Log_4_2),
+ disk_log:log(a, Log_5_1),
+ disk_log:log(a, Log_5_2),
+ disk_log:log(a, Log_1_1),
+ disk_log:log(a, Log_1_2),
+ disk_log:log(a, Log_2_1),
+ disk_log:log(a, Log_2_2),
+ disk_log:log(a, Log_3_1),
+ disk_log:log(a, Log_3_2),
+ disk_log:log(a, Log_4_1),
+ disk_log:log(a, Log_4_2),
+ disk_log:change_size(a, {100, 3}),
+ [Log_5_1, Log_5_2,
+ Log_1_1, Log_1_2,
+ Log_2_1, Log_2_2,
+ Log_3_1, Log_3_2,
+ Log_4_1, Log_4_2] = get_all_terms(a),
+ disk_log:log(a, Log_1_2_1),
+ disk_log:log(a, Log_1_2_2),
+ [Log_2_1, Log_2_2,
+ Log_3_1, Log_3_2,
+ Log_4_1, Log_4_2,
+ Log_1_2_1, Log_1_2_2] = get_all_terms(a),
+
disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {100,3}}]),
- ?line [Log_2_2_1, Log_2_2_2,
- Log_3_2_1, Log_3_2_2,
- Log_1_3_1, Log_1_3_2] = get_all_terms(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {100,3}}]),
+ [Log_2_1, Log_2_2,
+ Log_3_1, Log_3_2,
+ Log_4_1, Log_4_2,
+ Log_1_2_1, Log_1_2_2] = get_all_terms(a),
+ disk_log:log(a, Log_2_2_1),
+ disk_log:log(a, Log_2_2_2),
+ disk_log:log(a, Log_3_2_1),
+ disk_log:log(a, Log_3_2_2),
+ disk_log:log(a, Log_1_3_1),
+ disk_log:log(a, Log_1_3_2),
+ [Log_2_2_1, Log_2_2_2,
+ Log_3_2_1, Log_3_2_2,
+ Log_1_3_1, Log_1_3_2] = get_all_terms(a),
+ disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {100,3}}]),
+ [Log_2_2_1, Log_2_2_2,
+ Log_3_2_1, Log_3_2_2,
+ Log_1_3_1, Log_1_3_2] = get_all_terms(a),
disk_log:close(a),
del(File, 5),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {100,5}}]),
- ?line disk_log:log(a, Log_1_1),
- ?line disk_log:log(a, Log_1_2),
- ?line disk_log:log(a, Log_2_1),
- ?line disk_log:log(a, Log_2_2),
- ?line disk_log:log(a, Log_3_1),
- ?line disk_log:log(a, Log_3_2),
- ?line disk_log:log(a, Log_4_1),
- ?line disk_log:log(a, Log_4_2),
- ?line disk_log:log(a, Log_5_1),
- ?line disk_log:log(a, Log_5_2),
- ?line disk_log:log(a, Log_1_1),
- ?line disk_log:log(a, Log_1_2),
- ?line disk_log:log(a, Log_2_1),
- ?line disk_log:log(a, Log_2_2),
- ?line disk_log:log(a, Log_3_1),
- ?line disk_log:log(a, Log_3_2),
- ?line disk_log:log(a, Log_4_1),
- ?line disk_log:log(a, Log_4_2),
- ?line disk_log:log(a, Log_5_1),
- ?line disk_log:log(a, Log_5_2),
- ?line disk_log:change_size(a, {100, 3}),
- ?line [Log_1_1, Log_1_2,
- Log_2_1, Log_2_2,
- Log_3_1, Log_3_2,
- Log_4_1, Log_4_2,
- Log_5_1, Log_5_2] = get_all_terms(a),
- ?line disk_log:log(a, Log_1_2_1),
- ?line disk_log:log(a, Log_1_2_2),
- ?line disk_log:log(a, Log_2_2_1),
- ?line disk_log:log(a, Log_2_2_2),
- ?line disk_log:log(a, Log_3_2_1),
- ?line disk_log:log(a, Log_3_2_2),
- ?line disk_log:log(a, Log_1_3_1),
- ?line disk_log:log(a, Log_1_3_2),
- ?line [Log_2_2_1, Log_2_2_2,
- Log_3_2_1, Log_3_2_2,
- Log_1_3_1, Log_1_3_2] = get_all_terms(a),
-
- ?line disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {100,3}}]),
- ?line [Log_2_2_1, Log_2_2_2,
- Log_3_2_1, Log_3_2_2,
- Log_1_3_1, Log_1_3_2] = get_all_terms(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {100,5}}]),
+ disk_log:log(a, Log_1_1),
+ disk_log:log(a, Log_1_2),
+ disk_log:log(a, Log_2_1),
+ disk_log:log(a, Log_2_2),
+ disk_log:log(a, Log_3_1),
+ disk_log:log(a, Log_3_2),
+ disk_log:log(a, Log_4_1),
+ disk_log:log(a, Log_4_2),
+ disk_log:log(a, Log_5_1),
+ disk_log:log(a, Log_5_2),
+ disk_log:log(a, Log_1_1),
+ disk_log:log(a, Log_1_2),
+ disk_log:log(a, Log_2_1),
+ disk_log:log(a, Log_2_2),
+ disk_log:log(a, Log_3_1),
+ disk_log:log(a, Log_3_2),
+ disk_log:log(a, Log_4_1),
+ disk_log:log(a, Log_4_2),
+ disk_log:log(a, Log_5_1),
+ disk_log:log(a, Log_5_2),
+ disk_log:change_size(a, {100, 3}),
+ [Log_1_1, Log_1_2,
+ Log_2_1, Log_2_2,
+ Log_3_1, Log_3_2,
+ Log_4_1, Log_4_2,
+ Log_5_1, Log_5_2] = get_all_terms(a),
+ disk_log:log(a, Log_1_2_1),
+ disk_log:log(a, Log_1_2_2),
+ disk_log:log(a, Log_2_2_1),
+ disk_log:log(a, Log_2_2_2),
+ disk_log:log(a, Log_3_2_1),
+ disk_log:log(a, Log_3_2_2),
+ disk_log:log(a, Log_1_3_1),
+ disk_log:log(a, Log_1_3_2),
+ [Log_2_2_1, Log_2_2_2,
+ Log_3_2_1, Log_3_2_2,
+ Log_1_3_1, Log_1_3_2] = get_all_terms(a),
+
+ disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}, {size, {100,3}}]),
+ [Log_2_2_1, Log_2_2_2,
+ Log_3_2_1, Log_3_2_2,
+ Log_1_3_1, Log_1_3_2] = get_all_terms(a),
disk_log:close(a),
del(File, 5).
-change_size_after(suite) -> [];
-change_size_after(doc) ->
- ["Change size of a wrap log file before we have reached "
- "(on the second round) "
- "to the file index corresponding to the new size"];
+%% Change size of a wrap log file before we have reached (on the
+%% second round) to the file index corresponding to the new size.
change_size_after(Conf) when is_list(Conf) ->
Log_1_1 = "first log first message",
@@ -3758,172 +3665,169 @@ change_size_after(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "a.LOG"),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
- {size, {100,5}}]),
- ?line disk_log:log(a, Log_1_1),
- ?line disk_log:log(a, Log_1_2),
- ?line disk_log:log(a, Log_2_1),
- ?line disk_log:log(a, Log_2_2),
- ?line disk_log:log(a, Log_3_1),
- ?line disk_log:log(a, Log_3_2),
- ?line disk_log:log(a, Log_4_1),
- ?line disk_log:log(a, Log_4_2),
- ?line disk_log:log(a, Log_5_1),
- ?line disk_log:log(a, Log_5_2),
- ?line disk_log:log(a, Log_1_1),
- ?line disk_log:log(a, Log_1_2),
- ?line disk_log:log(a, Log_2_1),
- ?line disk_log:log(a, Log_2_2),
- ?line disk_log:change_size(a, {100, 3}),
- ?line [Log_3_1,Log_3_2,
- Log_4_1, Log_4_2,
- Log_5_1, Log_5_2,
- Log_1_1, Log_1_2,
- Log_2_1, Log_2_2] = get_all_terms(a),
- ?line disk_log:log(a, Log_3_1),
- ?line disk_log:log(a, Log_3_2),
- ?line disk_log:log(a, Log_1_2_1),
- ?line disk_log:log(a, Log_1_2_2),
- ?line [Log_2_1, Log_2_2,
- Log_3_1, Log_3_2,
- Log_1_2_1, Log_1_2_2] = get_all_terms(a),
-
- ?line disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
- {size, {100,3}}]),
- ?line [Log_2_1, Log_2_2,
- Log_3_1, Log_3_2,
- Log_1_2_1, Log_1_2_2] = get_all_terms(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
+ {size, {100,5}}]),
+ disk_log:log(a, Log_1_1),
+ disk_log:log(a, Log_1_2),
+ disk_log:log(a, Log_2_1),
+ disk_log:log(a, Log_2_2),
+ disk_log:log(a, Log_3_1),
+ disk_log:log(a, Log_3_2),
+ disk_log:log(a, Log_4_1),
+ disk_log:log(a, Log_4_2),
+ disk_log:log(a, Log_5_1),
+ disk_log:log(a, Log_5_2),
+ disk_log:log(a, Log_1_1),
+ disk_log:log(a, Log_1_2),
+ disk_log:log(a, Log_2_1),
+ disk_log:log(a, Log_2_2),
+ disk_log:change_size(a, {100, 3}),
+ [Log_3_1,Log_3_2,
+ Log_4_1, Log_4_2,
+ Log_5_1, Log_5_2,
+ Log_1_1, Log_1_2,
+ Log_2_1, Log_2_2] = get_all_terms(a),
+ disk_log:log(a, Log_3_1),
+ disk_log:log(a, Log_3_2),
+ disk_log:log(a, Log_1_2_1),
+ disk_log:log(a, Log_1_2_2),
+ [Log_2_1, Log_2_2,
+ Log_3_1, Log_3_2,
+ Log_1_2_1, Log_1_2_2] = get_all_terms(a),
+
+ disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
+ {size, {100,3}}]),
+ [Log_2_1, Log_2_2,
+ Log_3_1, Log_3_2,
+ Log_1_2_1, Log_1_2_2] = get_all_terms(a),
disk_log:close(a),
del(File, 5),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
- {size, {100,5}}]),
- ?line disk_log:log(a, Log_1_1),
- ?line disk_log:log(a, Log_1_2),
- ?line disk_log:log(a, Log_2_1),
- ?line disk_log:log(a, Log_2_2),
- ?line disk_log:log(a, Log_3_1),
- ?line disk_log:log(a, Log_3_2),
- ?line disk_log:log(a, Log_4_1),
- ?line disk_log:log(a, Log_4_2),
- ?line disk_log:log(a, Log_5_1),
- ?line disk_log:log(a, Log_5_2),
- ?line disk_log:log(a, Log_1_1),
- ?line disk_log:log(a, Log_1_2),
- ?line disk_log:log(a, Log_2_1),
- ?line disk_log:log(a, Log_2_2),
- ?line disk_log:change_size(a, {60, 3}),
- ?line [Log_3_1,Log_3_2,
- Log_4_1, Log_4_2,
- Log_5_1, Log_5_2,
- Log_1_1, Log_1_2,
- Log_2_1, Log_2_2] = get_all_terms(a),
- ?line disk_log:log(a, Log_3_1),
- ?line disk_log:log(a, Log_1_2_1),
- ?line [Log_2_1, Log_2_2,
- Log_3_1,
- Log_1_2_1] = get_all_terms(a),
-
- ?line disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
- {size, {60,3}}]),
- ?line [Log_2_1, Log_2_2,
- Log_3_1,
- Log_1_2_1] = get_all_terms(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
+ {size, {100,5}}]),
+ disk_log:log(a, Log_1_1),
+ disk_log:log(a, Log_1_2),
+ disk_log:log(a, Log_2_1),
+ disk_log:log(a, Log_2_2),
+ disk_log:log(a, Log_3_1),
+ disk_log:log(a, Log_3_2),
+ disk_log:log(a, Log_4_1),
+ disk_log:log(a, Log_4_2),
+ disk_log:log(a, Log_5_1),
+ disk_log:log(a, Log_5_2),
+ disk_log:log(a, Log_1_1),
+ disk_log:log(a, Log_1_2),
+ disk_log:log(a, Log_2_1),
+ disk_log:log(a, Log_2_2),
+ disk_log:change_size(a, {60, 3}),
+ [Log_3_1,Log_3_2,
+ Log_4_1, Log_4_2,
+ Log_5_1, Log_5_2,
+ Log_1_1, Log_1_2,
+ Log_2_1, Log_2_2] = get_all_terms(a),
+ disk_log:log(a, Log_3_1),
+ disk_log:log(a, Log_1_2_1),
+ [Log_2_1, Log_2_2,
+ Log_3_1,
+ Log_1_2_1] = get_all_terms(a),
+
+ disk_log:close(a),
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
+ {size, {60,3}}]),
+ [Log_2_1, Log_2_2,
+ Log_3_1,
+ Log_1_2_1] = get_all_terms(a),
disk_log:close(a),
del(File, 5).
-default_size(suite) -> [];
-default_size(doc) -> ["Open an existing wrap log without size option "];
+%% Open an existing wrap log without size option .
default_size(Conf) when is_list(Conf) ->
- ?line Dir = ?privdir(Conf),
- ?line File = filename:join(Dir, "a.LOG"),
- ?line {error, {badarg, size}} = disk_log:open([{name,a}, {file, File},
+ Dir = ?privdir(Conf),
+ File = filename:join(Dir, "a.LOG"),
+ {error, {badarg, size}} = disk_log:open([{name,a}, {file, File},
{type, wrap}]),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap},
{size, {100,5}}]),
- ?line disk_log:close(a),
+ disk_log:close(a),
- ?line {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}]),
- ?line {100, 5} = disk_log_1:read_size_file(File),
- ?line ok = disk_log:close(a),
- ?line del(File, 5).
+ {ok, a} = disk_log:open([{name,a}, {file, File}, {type, wrap}]),
+ {100, 5} = disk_log_1:read_size_file(File),
+ ok = disk_log:close(a),
+ del(File, 5).
-change_size2(suite) -> [];
-change_size2(doc) -> ["Testing change_size/2 a bit more..."];
+%% Testing change_size/2 a bit more...
change_size2(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
- ?line File = filename:join(Dir, "n.LOG"),
- ?line No = 4,
- ?line del(File, No), % cleanup
+ File = filename:join(Dir, "n.LOG"),
+ No = 4,
+ del(File, No), % cleanup
%% External halt.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {size, 100000},
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {size, 100000},
{format, external}, {type, halt}]),
- ?line B = mk_bytes(60), % 56 actually...
- ?line ok = disk_log:blog_terms(n, [B,list_to_binary(B),B]),
- ?line Error1 = {error, {new_size_too_small,n,168}} =
+ B = mk_bytes(60), % 56 actually...
+ ok = disk_log:blog_terms(n, [B,list_to_binary(B),B]),
+ Error1 = {error, {new_size_too_small,n,168}} =
disk_log:change_size(n, 167),
- ?line "The current size" ++ _ = format_error(Error1),
- ?line ok = disk_log:change_size(n, infinity),
- ?line ok = disk_log:change_size(n, 168),
- ?line ok = disk_log:close(n),
- ?line file:delete(File), % cleanup
+ "The current size" ++ _ = format_error(Error1),
+ ok = disk_log:change_size(n, infinity),
+ ok = disk_log:change_size(n, 168),
+ ok = disk_log:close(n),
+ file:delete(File), % cleanup
%% External wrap.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
{size, {100,No}}, {notify, true},
{format, external}]),
- ?line BB = mk_bytes(160),
- ?line ok = disk_log:blog_terms(n, [BB, BB, BB, BB]), % create all files
+ BB = mk_bytes(160),
+ ok = disk_log:blog_terms(n, [BB, BB, BB, BB]), % create all files
%% Used to be one message, but now one per wrapped file.
- ?line rec(3, {disk_log, node(), n, {wrap, 0}}),
- ?line ok = disk_log:blog_terms(n, [BB, BB]),
+ rec(3, {disk_log, node(), n, {wrap, 0}}),
+ ok = disk_log:blog_terms(n, [BB, BB]),
%% Used to be one message, but now one per wrapped file.
- ?line rec(2, {disk_log, node(), n, {wrap, 1}}),
- ?line ok = disk_log:change_size(n, {100, 2}),
- ?line ok = disk_log:change_size(n, {100, 2}),
- ?line {100, 2} = sz(n),
- ?line ok = disk_log:balog_terms(n, [BB, BB]),
- ?line ok = disk_log:balog_terms(n, [BB]),
- ?line ok = disk_log:blog_terms(n, [BB]),
+ rec(2, {disk_log, node(), n, {wrap, 1}}),
+ ok = disk_log:change_size(n, {100, 2}),
+ ok = disk_log:change_size(n, {100, 2}),
+ {100, 2} = sz(n),
+ ok = disk_log:balog_terms(n, [BB, BB]),
+ ok = disk_log:balog_terms(n, [BB]),
+ ok = disk_log:blog_terms(n, [BB]),
%% Used to be one message, but now one per wrapped file.
- ?line rec(4, {disk_log, node(), n, {wrap, 1}}),
- ?line ok = disk_log:change_size(n, {100, 4}),
- ?line ok = disk_log:close(n),
- ?line del(File, No),
+ rec(4, {disk_log, node(), n, {wrap, 1}}),
+ ok = disk_log:change_size(n, {100, 4}),
+ ok = disk_log:close(n),
+ del(File, No),
%% Internal wrap.
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
{size, {100,No}}, {notify, true},
{format, internal}]),
- ?line ok = disk_log:blog_terms(n, [BB, BB, BB, BB]), % create all files
+ ok = disk_log:blog_terms(n, [BB, BB, BB, BB]), % create all files
%% Used to be one message, but now one per wrapped file.
- ?line rec(3, {disk_log, node(), n, {wrap, 0}}),
- ?line ok = disk_log:blog_terms(n, [BB, BB]),
+ rec(3, {disk_log, node(), n, {wrap, 0}}),
+ ok = disk_log:blog_terms(n, [BB, BB]),
%% Used to be one message, but now one per wrapped file.
- ?line rec(2, {disk_log, node(), n, {wrap, 1}}),
- ?line ok = disk_log:change_size(n, {100, 2}),
- ?line {100, 2} = sz(n),
- ?line ok = disk_log:blog_terms(n, [BB, BB, BB, BB]),
+ rec(2, {disk_log, node(), n, {wrap, 1}}),
+ ok = disk_log:change_size(n, {100, 2}),
+ {100, 2} = sz(n),
+ ok = disk_log:blog_terms(n, [BB, BB, BB, BB]),
%% Used to be one message, but now one per wrapped file.
- ?line rec(4, {disk_log, node(), n, {wrap, 1}}),
- ?line ok = disk_log:close(n),
- ?line del(File, No).
+ rec(4, {disk_log, node(), n, {wrap, 1}}),
+ ok = disk_log:close(n),
+ del(File, No).
-change_size_truncate(suite) -> [];
-change_size_truncate(doc) -> ["OTP-3484: truncating index file"];
+%% OTP-3484: truncating index file.
change_size_truncate(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
- ?line File = filename:join(Dir, "bert.LOG"),
- ?line No = 3,
- ?line B = mk_bytes(60),
+ File = filename:join(Dir, "bert.LOG"),
+ No = 3,
+ B = mk_bytes(60),
%% The problem here is truncation of the index file. One cannot easily
%% check that the index file is correctly updated, but print_index_file()
@@ -3933,541 +3837,527 @@ change_size_truncate(Conf) when is_list(Conf) ->
%% Change the size immediately after creating the log, while there
%% are no log files. This used to write stuff a negative offset
%% from the beginning of the file.
- ?line del(File, No+1),
- ?line {ok, bert} = disk_log:open([{name,bert}, {type,wrap}, {file, File},
+ del(File, No+1),
+ {ok, bert} = disk_log:open([{name,bert}, {type,wrap}, {file, File},
{notify, true}, {size,{1000,255}}]),
- ?line ok = disk_log:change_size(bert,{100,No}),
- ?line ok = disk_log:blog(bert, B),
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 0}}),
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 0}}),
- ?line 3 = curf(bert),
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 1}}),
- ?line 1 = curf(bert),
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 1}}),
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 1}}),
-
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 1}}),
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 1}}),
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 1}}),
-
- % Three items expected.
- % disk_log_1:print_index_file("bert.LOG.idx"),
- ?line 3 = curf(bert),
- ?line ok = disk_log:change_size(bert,{100,1}),
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 1}}),
- % Three items expected.
- % disk_log_1:print_index_file("bert.LOG.idx"),
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 1}}),
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 1}}),
- % One item expected.
- % disk_log_1:print_index_file("bert.LOG.idx"),
-
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 1}}),
- ?line ok = disk_log:close(bert),
- ?line del(File, No),
+ ok = disk_log:change_size(bert,{100,No}),
+ ok = disk_log:blog(bert, B),
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 0}}),
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 0}}),
+ 3 = curf(bert),
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 1}}),
+ 1 = curf(bert),
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 1}}),
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 1}}),
+
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 1}}),
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 1}}),
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 1}}),
+
+ %% Three items expected.
+ %% disk_log_1:print_index_file("bert.LOG.idx"),
+ 3 = curf(bert),
+ ok = disk_log:change_size(bert,{100,1}),
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 1}}),
+ %% Three items expected.
+ %% disk_log_1:print_index_file("bert.LOG.idx"),
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 1}}),
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 1}}),
+ %% One item expected.
+ %% disk_log_1:print_index_file("bert.LOG.idx"),
+
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 1}}),
+ ok = disk_log:close(bert),
+ del(File, No),
%% Part 2.
%% Change the size twice, the second time while the the effects of
%% the first changed have not yet been handled. Finally close before
%% the index file has been truncated.
- ?line del(File, No),
- ?line {ok, bert} = disk_log:open([{name,bert}, {type,wrap}, {file, File},
+ del(File, No),
+ {ok, bert} = disk_log:open([{name,bert}, {type,wrap}, {file, File},
{notify, true}, {size,{100,No}}]),
- ?line ok = disk_log:blog(bert, B),
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 0}}),
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 0}}),
+ ok = disk_log:blog(bert, B),
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 0}}),
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 0}}),
- ?line 3 = curf(bert),
- ?line ok = disk_log:change_size(bert,{100,No-1}),
+ 3 = curf(bert),
+ ok = disk_log:change_size(bert,{100,No-1}),
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 1}}),
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 1}}),
- ?line 1 = curf(bert),
- ?line ok = disk_log:change_size(bert,{100,No+1}),
+ 1 = curf(bert),
+ ok = disk_log:change_size(bert,{100,No+1}),
- % Three items expected.
- % disk_log_1:print_index_file("bert.LOG.idx"),
+ %% Three items expected.
+ %% disk_log_1:print_index_file("bert.LOG.idx"),
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 1}}),
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 1}}),
- % Three items expected.
- % disk_log_1:print_index_file("bert.LOG.idx"),
+ %% Three items expected.
+ %% disk_log_1:print_index_file("bert.LOG.idx"),
- ?line 2 = curf(bert),
- ?line ok = disk_log:change_size(bert,{100,1}),
+ 2 = curf(bert),
+ ok = disk_log:change_size(bert,{100,1}),
- % Three items expected.
- % disk_log_1:print_index_file("bert.LOG.idx"),
+ %% Three items expected.
+ %% disk_log_1:print_index_file("bert.LOG.idx"),
- ?line ok = disk_log:close(bert),
+ ok = disk_log:close(bert),
- % State: .siz is 1, current file is 2, index file size is 3...
+ %% State: .siz is 1, current file is 2, index file size is 3...
- ?line {ok, bert} = disk_log:open([{name,bert}, {file, File},
+ {ok, bert} = disk_log:open([{name,bert}, {file, File},
{type,wrap}, {notify, true}]),
- % Three items expected.
- % disk_log_1:print_index_file("bert.LOG.idx"),
+ %% Three items expected.
+ %% disk_log_1:print_index_file("bert.LOG.idx"),
- ?line 2 = curf(bert),
- ?line ok = disk_log:blog(bert, B),
- ?line rec(1, {disk_log, node(), bert, {wrap, 1}}),
- ?line ok = disk_log:close(bert),
+ 2 = curf(bert),
+ ok = disk_log:blog(bert, B),
+ rec(1, {disk_log, node(), bert, {wrap, 1}}),
+ ok = disk_log:close(bert),
- ?line {ok, bert} = disk_log:open([{name,bert}, {file, File},
+ {ok, bert} = disk_log:open([{name,bert}, {file, File},
{type,wrap}, {notify, true}]),
- % Two items expected.
- % disk_log_1:print_index_file("bert.LOG.idx"),
+ %% Two items expected.
+ %% disk_log_1:print_index_file("bert.LOG.idx"),
- ?line 1 = curf(bert),
- ?line ok = disk_log:blog(bert, B),
+ 1 = curf(bert),
+ ok = disk_log:blog(bert, B),
%% Expect {wrap 0}. Nothing lost now, last wrap notification
%% reported one lost item.
- ?line rec(1, {disk_log, node(), bert, {wrap, 0}}),
+ rec(1, {disk_log, node(), bert, {wrap, 0}}),
- % One item expected.
- % disk_log_1:print_index_file("bert.LOG.idx"),
- ?line ok = disk_log:close(bert),
+ %% One item expected.
+ %% disk_log_1:print_index_file("bert.LOG.idx"),
+ ok = disk_log:close(bert),
- ?line del(File, No),
+ del(File, No),
ok.
-change_attribute(suite) -> [];
-change_attribute(doc) ->
- ["Change notify and head"];
+%% Change notify and head.
change_attribute(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
- ?line File = filename:join(Dir, "n.LOG"),
- ?line No = 4,
- ?line del(File, No), % cleanup
- ?line B = mk_bytes(60),
+ File = filename:join(Dir, "n.LOG"),
+ No = 4,
+ del(File, No), % cleanup
+ B = mk_bytes(60),
- ?line Q = qlen(),
+ Q = qlen(),
- % test change_notify
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ %% test change_notify
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
{size, {100,No}}]),
- ?line {ok, n} = disk_log:open([{name, n}]), % ignored...
- ?line ok = disk_log:log_terms(n, [B,B]),
- ?line {error, {badarg, notify}} = disk_log:change_notify(n, self(), wrong),
- ?line ok = disk_log:change_notify(n, self(), false),
- ?line ok = disk_log:change_notify(n, self(), true),
- ?line Error1 = {error, {not_owner, _}} =
+ {ok, n} = disk_log:open([{name, n}]), % ignored...
+ ok = disk_log:log_terms(n, [B,B]),
+ {error, {badarg, notify}} = disk_log:change_notify(n, self(), wrong),
+ ok = disk_log:change_notify(n, self(), false),
+ ok = disk_log:change_notify(n, self(), true),
+ Error1 = {error, {not_owner, _}} =
disk_log:change_notify(n, none, true),
- ?line "The pid" ++ _ = format_error(Error1),
- ?line 2 = no_written_items(n),
- ?line 0 = users(n),
- ?line Parent = self(),
- ?line Pid = spawn(fun() -> disk_log:close(n), Parent ! {self(),done} end),
- ?line receive {Pid, done} -> ok end,
- ?line 0 = users(n),
- ?line 1 = length(owners(n)),
-
- % test change_header
- ?line {error, {badarg, head}} = disk_log:change_header(n, none),
- ?line {error, {badarg, head}} =
+ "The pid" ++ _ = format_error(Error1),
+ 2 = no_written_items(n),
+ 0 = users(n),
+ Parent = self(),
+ Pid = spawn(fun() -> disk_log:close(n), Parent ! {self(),done} end),
+ receive {Pid, done} -> ok end,
+ 0 = users(n),
+ 1 = length(owners(n)),
+
+ %% test change_header
+ {error, {badarg, head}} = disk_log:change_header(n, none),
+ {error, {badarg, head}} =
disk_log:change_header(n, {head_func, {1,2,3}}),
- ?line ok = disk_log:change_header(n, {head, header}),
- ?line ok = disk_log:log(n, B),
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line 4 = no_written_items(n),
- ?line ok = disk_log:change_header(n, {head, none}),
- ?line ok = disk_log:log(n, B),
- ?line rec(1, {disk_log, node(), n, {wrap, 0}}),
- ?line 5 = no_written_items(n),
- ?line ok = disk_log:change_header(n,
+ ok = disk_log:change_header(n, {head, header}),
+ ok = disk_log:log(n, B),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ 4 = no_written_items(n),
+ ok = disk_log:change_header(n, {head, none}),
+ ok = disk_log:log(n, B),
+ rec(1, {disk_log, node(), n, {wrap, 0}}),
+ 5 = no_written_items(n),
+ ok = disk_log:change_header(n,
{head_func, {?MODULE, head_fun, [{ok,header}]}}),
- ?line ok = disk_log:log(n, B),
- ?line rec(1, {disk_log, node(), n, {wrap, 1}}),
- ?line 7 = no_written_items(n),
- ?line ok = disk_log:close(n),
- ?line {error, no_such_log} = disk_log:close(n),
- ?line del(File, No),
- ?line file:delete(File), % cleanup
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {format, external},
+ ok = disk_log:log(n, B),
+ rec(1, {disk_log, node(), n, {wrap, 1}}),
+ 7 = no_written_items(n),
+ ok = disk_log:close(n),
+ {error, no_such_log} = disk_log:close(n),
+ del(File, No),
+ file:delete(File), % cleanup
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {format, external},
{type, halt}]),
- ?line {error, {badarg, head}} = disk_log:change_header(n, {head, header}),
- ?line ok = disk_log:change_header(n, {head, "header"}),
- ?line ok = disk_log:close(n),
- ?line file:delete(File),
+ {error, {badarg, head}} = disk_log:change_header(n, {head, header}),
+ ok = disk_log:change_header(n, {head, "header"}),
+ ok = disk_log:close(n),
+ file:delete(File),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
{size, {100,No}}]),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
{size, {100,No}}]),
- ?line ok = disk_log:change_notify(n, self(), true),
- ?line ok = disk_log:change_header(n, {head, tjolahopp}),
- ?line {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
+ ok = disk_log:change_notify(n, self(), true),
+ ok = disk_log:change_header(n, {head, tjolahopp}),
+ {ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
{size, {100,No}}, {notify, true}]),
- ?line ok = disk_log:close(n),
- ?line {error, no_such_log} = disk_log:info(n),
- ?line Q = qlen(),
- ?line del(File, No).
+ ok = disk_log:close(n),
+ {error, no_such_log} = disk_log:info(n),
+ Q = qlen(),
+ del(File, No).
-dist_open(suite) -> [];
-dist_open(doc) ->
- ["Open a distributed log"];
+%% Open a distributed log.
dist_open(Conf) when is_list(Conf) ->
- ?line PrivDir = ?privdir(Conf),
- ?line true = is_alive(),
-
- ?line Q = qlen(),
- ?line File = filename:join(PrivDir, "n.LOG"),
- ?line File1 = filename:join(PrivDir, "n1.LOG"),
- ?line No = 3,
- ?line file:delete(File),
- ?line del(File, No), % cleanup
- ?line del(File1, No), % cleanup
- ?line B = mk_bytes(60),
-
- ?line PA = filename:dirname(code:which(?MODULE)),
- ?line {ok, Node} = start_node(disk_log, "-pa " ++ PA),
- ?line wait_for_ready_net(),
+ PrivDir = ?privdir(Conf),
+ true = is_alive(),
+
+ Q = qlen(),
+ File = filename:join(PrivDir, "n.LOG"),
+ File1 = filename:join(PrivDir, "n1.LOG"),
+ No = 3,
+ file:delete(File),
+ del(File, No), % cleanup
+ del(File1, No), % cleanup
+ B = mk_bytes(60),
+
+ PA = filename:dirname(code:which(?MODULE)),
+ {ok, Node} = start_node(disk_log, "-pa " ++ PA),
+ wait_for_ready_net(),
%% open non-distributed on this node:
- ?line {ok,n} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {ok,n} = disk_log:open([{name, n}, {file, File}, {type, halt},
{distributed, []}]),
- ?line Error1 = {error, {halt_log, n}} = disk_log:inc_wrap_file(n),
- ?line "The halt log" ++ _ = format_error(Error1),
- ?line ok = disk_log:lclose(n),
- ?line file:delete(File),
+ Error1 = {error, {halt_log, n}} = disk_log:inc_wrap_file(n),
+ "The halt log" ++ _ = format_error(Error1),
+ ok = disk_log:lclose(n),
+ file:delete(File),
%% open distributed on this node:
- ?line {[_],[]} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {[_],[]} = disk_log:open([{name, n}, {file, File}, {type, halt},
{distributed, [node()]}]),
%% the error message is ignored:
- ?line ok = disk_log:inc_wrap_file(n),
- ?line ok = disk_log:close(n),
- ?line file:delete(File),
+ ok = disk_log:inc_wrap_file(n),
+ ok = disk_log:close(n),
+ file:delete(File),
%% open a wrap log on this node, write something on this node
- ?line {[_],[]} = disk_log:open([{name, n}, {file, File},
+ {[_],[]} = disk_log:open([{name, n}, {file, File},
{type, wrap}, {size, {50, No}},
{distributed, [node()]}]),
- ?line ok = disk_log:log(n, B),
- ?line ok = disk_log:close(n),
+ ok = disk_log:log(n, B),
+ ok = disk_log:close(n),
%% open a wrap log on this node and aother node, write something
- ?line {[_],[]} = disk_log:open([{name, n}, {file, File},
+ {[_],[]} = disk_log:open([{name, n}, {file, File},
{type, wrap}, {size, {50, No}},
{distributed, [node()]}]),
- ?line {[_],[]} = disk_log:open([{name, n}, {file, File1},
+ {[_],[]} = disk_log:open([{name, n}, {file, File1},
{type, wrap}, {size, {50, No}},
{distributed, [Node]}]),
- ?line ok = disk_log:log(n, B),
- ?line ok = rpc:call(Node, disk_log, log, [n, B]),
- ?line ok = disk_log:close(n),
- ?line del(File, No),
- ?line del(File1, No),
- ?line file:delete(File),
+ ok = disk_log:log(n, B),
+ ok = rpc:call(Node, disk_log, log, [n, B]),
+ ok = disk_log:close(n),
+ del(File, No),
+ del(File1, No),
+ file:delete(File),
%% open a wrap log on this node and another node, use lclose
- ?line {[_],[]} = disk_log:open([{name, n}, {file, File},
+ {[_],[]} = disk_log:open([{name, n}, {file, File},
{type, wrap}, {size, {50, No}},
{distributed, [node()]}]),
- ?line {[_],[]} = disk_log:open([{name, n}, {file, File},
+ {[_],[]} = disk_log:open([{name, n}, {file, File},
{type, wrap}, {size, {50, No}},
{distributed, [node()]},
{linkto,none}]),
- ?line {[_],[]} = disk_log:open([{name, n}, {file, File1},
+ {[_],[]} = disk_log:open([{name, n}, {file, File1},
{type, wrap}, {size, {50, No}},
{distributed, [Node]}]),
- ?line [_, _] = distributed(n),
- ?line ok = disk_log:lclose(n, Node),
- ?line [_] = distributed(n),
- ?line ok = disk_log:lclose(n),
- ?line ok = disk_log:lclose(n),
- ?line {error, no_such_log} = disk_log:info(n),
- ?line del(File, No),
- ?line del(File1, No),
- ?line file:delete(File),
-
- % open an invalid log file, and see how error are handled
- ?line First = "n.LOG.1",
- ?line make_file(PrivDir, First, 8),
-
- ?line {[], [_,_]} = disk_log:open([{name, n}, {file, File},
+ [_, _] = distributed(n),
+ ok = disk_log:lclose(n, Node),
+ [_] = distributed(n),
+ ok = disk_log:lclose(n),
+ ok = disk_log:lclose(n),
+ {error, no_such_log} = disk_log:info(n),
+ del(File, No),
+ del(File1, No),
+ file:delete(File),
+
+ %% open an invalid log file, and see how error are handled
+ First = "n.LOG.1",
+ make_file(PrivDir, First, 8),
+
+ {[], [_,_]} = disk_log:open([{name, n}, {file, File},
{type, wrap}, {size, {50, No}},
{distributed, [Node,node()]}]),
- ?line del(File, No),
- ?line file:delete(File),
+ del(File, No),
+ file:delete(File),
- % open a wrap on one other node (not on this node)
- ?line {[_],[]} = disk_log:open([{name, n}, {file, File},
+ %% open a wrap on one other node (not on this node)
+ {[_],[]} = disk_log:open([{name, n}, {file, File},
{type, wrap}, {size, {50, No}},
{distributed, [Node]}]),
- ?line ok = rpc:call(Node, disk_log, log, [n, B]),
- ?line {error, no_such_log} = disk_log:lclose(n),
- ?line ok = disk_log:close(n),
+ ok = rpc:call(Node, disk_log, log, [n, B]),
+ {error, no_such_log} = disk_log:lclose(n),
+ ok = disk_log:close(n),
- ?line Q = qlen(),
+ Q = qlen(),
- ?line {error, no_such_log} = disk_log:info(n),
- ?line del(File, No),
- ?line file:delete(File),
- ?line stop_node(Node),
+ {error, no_such_log} = disk_log:info(n),
+ del(File, No),
+ file:delete(File),
+ stop_node(Node),
ok.
-dist_error_open(suite) -> [];
-dist_error_open(doc) ->
- ["Open a log distributed and not distributed"];
+%% Open a log distributed and not distributed.
dist_error_open(Conf) when is_list(Conf) ->
- ?line PrivDir = ?privdir(Conf),
- ?line true = is_alive(),
-
- ?line Q = qlen(),
- ?line File = filename:join(PrivDir, "bert.LOG"),
- ?line File1 = filename:join(PrivDir, "bert1.LOG"),
- ?line No = 3,
- ?line file:delete(File),
- ?line del(File, No), % cleanup
- ?line del(File1, No), % cleanup
-
- ?line PA = filename:dirname(code:which(?MODULE)),
- ?line {ok, Node} = start_node(disk_log, "-pa " ++ PA),
- ?line wait_for_ready_net(),
-
- % open non-distributed on this node:
- ?line {ok,n} = disk_log:open([{name, n}, {file, File},
+ PrivDir = ?privdir(Conf),
+ true = is_alive(),
+
+ Q = qlen(),
+ File = filename:join(PrivDir, "bert.LOG"),
+ File1 = filename:join(PrivDir, "bert1.LOG"),
+ No = 3,
+ file:delete(File),
+ del(File, No), % cleanup
+ del(File1, No), % cleanup
+
+ PA = filename:dirname(code:which(?MODULE)),
+ {ok, Node} = start_node(disk_log, "-pa " ++ PA),
+ wait_for_ready_net(),
+
+ %% open non-distributed on this node:
+ {ok,n} = disk_log:open([{name, n}, {file, File},
{type, wrap}, {size, {50, No}}]),
- % trying to open distributed on this node (error):
- ?line {[],[Error1={ENode,{error,{node_already_open,n}}}]} =
+ %% trying to open distributed on this node (error):
+ {[],[Error1={ENode,{error,{node_already_open,n}}}]} =
disk_log:open([{name, n}, {file, File},
{type, wrap}, {size, {50, No}},
{distributed, [node()]}]),
- ?line true =
+ true =
lists:prefix(lists:flatten(io_lib:format("~p: The distribution",
[ENode])),
format_error(Error1)),
- ?line ok = disk_log:lclose(n),
+ ok = disk_log:lclose(n),
- % open distributed on this node:
- ?line {[_],[]} = disk_log:open([{name, n}, {file, File},
+ %% open distributed on this node:
+ {[_],[]} = disk_log:open([{name, n}, {file, File},
{type, wrap}, {size, {50, No}},
{distributed, [node()]}]),
- % trying to open non-distributed on this node (error):
- ?line {_,{node_already_open,n}} =
+ %% trying to open non-distributed on this node (error):
+ {_,{node_already_open,n}} =
disk_log:open([{name, n}, {file, File},
{type, wrap}, {size, {50, No}}]),
- ?line ok = disk_log:close(n),
- ?line Q = qlen(),
+ ok = disk_log:close(n),
+ Q = qlen(),
- ?line del(File, No),
- ?line del(File1, No),
- ?line file:delete(File),
- ?line stop_node(Node),
+ del(File, No),
+ del(File1, No),
+ file:delete(File),
+ stop_node(Node),
ok.
-dist_notify(suite) -> [];
-dist_notify(doc) ->
- ["Notification from other node"];
+%% Notification from other node.
dist_notify(Conf) when is_list(Conf) ->
- ?line PrivDir = ?privdir(Conf),
- ?line true = is_alive(),
+ PrivDir = ?privdir(Conf),
+ true = is_alive(),
- ?line File = filename:join(PrivDir, "bert.LOG"),
- ?line File1 = filename:join(PrivDir, "bert1.LOG"),
- ?line No = 3,
- ?line B = mk_bytes(60),
- ?line file:delete(File),
- ?line file:delete(File1),
- ?line del(File, No), % cleanup
- ?line del(File1, No),
-
- ?line PA = filename:dirname(code:which(?MODULE)),
- ?line {ok, Node} = start_node(disk_log, "-pa " ++ PA),
- ?line wait_for_ready_net(),
-
- % opening distributed on this node:
- ?line {[_],[]} = disk_log:open([{name, n}, {file, File}, {notify, false},
+ File = filename:join(PrivDir, "bert.LOG"),
+ File1 = filename:join(PrivDir, "bert1.LOG"),
+ No = 3,
+ B = mk_bytes(60),
+ file:delete(File),
+ file:delete(File1),
+ del(File, No), % cleanup
+ del(File1, No),
+
+ PA = filename:dirname(code:which(?MODULE)),
+ {ok, Node} = start_node(disk_log, "-pa " ++ PA),
+ wait_for_ready_net(),
+
+ %% opening distributed on this node:
+ {[_],[]} = disk_log:open([{name, n}, {file, File}, {notify, false},
{type, wrap}, {size, {50, No}},
{distributed, [node()]}]),
- % opening distributed on other node:
- ?line {[_],[]} = disk_log:open([{name, n}, {file, File1},
+ %% opening distributed on other node:
+ {[_],[]} = disk_log:open([{name, n}, {file, File1},
{notify, true}, {linkto, self()},
{type, wrap}, {size, {50, No}},
{distributed, [Node]}]),
- ?line disk_log:alog(n, B),
- ?line disk_log:alog(n, B),
- ?line ok = disk_log:sync(n),
- ?line rec(1, {disk_log, Node, n, {wrap, 0}}),
- ?line ok = disk_log:close(n),
-
- ?line del(File, No),
- ?line del(File1, No),
- ?line file:delete(File),
- ?line stop_node(Node),
+ disk_log:alog(n, B),
+ disk_log:alog(n, B),
+ ok = disk_log:sync(n),
+ rec(1, {disk_log, Node, n, {wrap, 0}}),
+ ok = disk_log:close(n),
+
+ del(File, No),
+ del(File1, No),
+ file:delete(File),
+ stop_node(Node),
ok.
-dist_terminate(suite) -> [];
-dist_terminate(doc) ->
- ["Terminating nodes with distributed logs"];
+%% Terminating nodes with distributed logs.
dist_terminate(Conf) when is_list(Conf) ->
- ?line Dir = ?privdir(Conf),
- ?line true = is_alive(),
+ Dir = ?privdir(Conf),
+ true = is_alive(),
- ?line File = filename:join(Dir, "n.LOG"),
- ?line File1 = filename:join(Dir, "n1.LOG"),
+ File = filename:join(Dir, "n.LOG"),
+ File1 = filename:join(Dir, "n1.LOG"),
No = 1,
del(File, No), % cleanup
del(File1, No), % cleanup
- ?line PA = filename:dirname(code:which(?MODULE)),
- ?line {ok, Node} = start_node(disk_log, "-pa " ++ PA),
- ?line wait_for_ready_net(),
+ PA = filename:dirname(code:which(?MODULE)),
+ {ok, Node} = start_node(disk_log, "-pa " ++ PA),
+ wait_for_ready_net(),
%% Distributed versions of two of the situations in close_block(/1.
%% One of two owners terminates.
- ?line Pid1 = spawn_link(?MODULE, lserv, [n]),
- ?line Pid2 = spawn_link(?MODULE, lserv, [n]),
- ?line {[{_, {ok, n}}], []} = sync_do(Pid1, {dist_open, File, node()}),
- ?line {[{_, {ok, n}}], []} = sync_do(Pid2, {dist_open, File1, Node}),
- ?line [_] = sync_do(Pid1, owners),
- ?line [_] = sync_do(Pid2, owners),
- ?line 0 = sync_do(Pid1, users),
- ?line 0 = sync_do(Pid2, users),
- ?line sync_do(Pid1, terminate),
- ?line [_] = sync_do(Pid2, owners),
- ?line 0 = sync_do(Pid2, users),
- ?line sync_do(Pid2, terminate),
- ?line {error, no_such_log} = disk_log:info(n),
+ Pid1 = spawn_link(?MODULE, lserv, [n]),
+ Pid2 = spawn_link(?MODULE, lserv, [n]),
+ {[{_, {ok, n}}], []} = sync_do(Pid1, {dist_open, File, node()}),
+ {[{_, {ok, n}}], []} = sync_do(Pid2, {dist_open, File1, Node}),
+ [_] = sync_do(Pid1, owners),
+ [_] = sync_do(Pid2, owners),
+ 0 = sync_do(Pid1, users),
+ 0 = sync_do(Pid2, users),
+ sync_do(Pid1, terminate),
+ [_] = sync_do(Pid2, owners),
+ 0 = sync_do(Pid2, users),
+ sync_do(Pid2, terminate),
+ {error, no_such_log} = disk_log:info(n),
%% Users terminate (no link...).
- ?line Pid3 = spawn_link(?MODULE, lserv, [n]),
- ?line Pid4 = spawn_link(?MODULE, lserv, [n]),
- ?line {[{_, {ok, n}}], []} =
+ Pid3 = spawn_link(?MODULE, lserv, [n]),
+ Pid4 = spawn_link(?MODULE, lserv, [n]),
+ {[{_, {ok, n}}], []} =
sync_do(Pid3, {dist_open, File, none, node()}),
- ?line {[{_, {ok, n}}], []} =
+ {[{_, {ok, n}}], []} =
sync_do(Pid4, {dist_open, File1, none, Node}),
- ?line [] = sync_do(Pid3, owners),
- ?line [] = sync_do(Pid4, owners),
- ?line 1 = sync_do(Pid3, users),
- ?line 1 = sync_do(Pid4, users),
- ?line sync_do(Pid3, terminate),
- ?line [] = sync_do(Pid4, owners),
- ?line 1 = sync_do(Pid4, users),
- ?line sync_do(Pid4, terminate),
- ?line ok = disk_log:close(n), % closing all nodes
- ?line {error, no_such_log} = disk_log:info(n),
+ [] = sync_do(Pid3, owners),
+ [] = sync_do(Pid4, owners),
+ 1 = sync_do(Pid3, users),
+ 1 = sync_do(Pid4, users),
+ sync_do(Pid3, terminate),
+ [] = sync_do(Pid4, owners),
+ 1 = sync_do(Pid4, users),
+ sync_do(Pid4, terminate),
+ ok = disk_log:close(n), % closing all nodes
+ {error, no_such_log} = disk_log:info(n),
- ?line del(File, No),
- ?line del(File1, No),
- ?line stop_node(Node),
+ del(File, No),
+ del(File1, No),
+ stop_node(Node),
ok.
-dist_accessible(suite) -> [];
-dist_accessible(doc) ->
- ["Accessible logs on nodes"];
+%% Accessible logs on nodes.
dist_accessible(Conf) when is_list(Conf) ->
- ?line PrivDir = ?privdir(Conf),
-
- ?line true = is_alive(),
-
- ?line F1 = filename:join(PrivDir, "a.LOG"),
- ?line file:delete(F1),
- ?line F2 = filename:join(PrivDir, "b.LOG"),
- ?line file:delete(F2),
- ?line F3 = filename:join(PrivDir, "c.LOG"),
- ?line file:delete(F3),
- ?line F4 = filename:join(PrivDir, "d.LOG"),
- ?line file:delete(F1),
- ?line F5 = filename:join(PrivDir, "e.LOG"),
- ?line file:delete(F2),
- ?line F6 = filename:join(PrivDir, "f.LOG"),
- ?line file:delete(F3),
-
- ?line {[],[]} = disk_log:accessible_logs(),
- ?line {ok, a} = disk_log:open([{name, a}, {type, halt}, {file, F1}]),
- ?line {[a],[]} = disk_log:accessible_logs(),
- ?line {ok, b} = disk_log:open([{name, b}, {type, halt}, {file, F2}]),
- ?line {[a,b],[]} = disk_log:accessible_logs(),
- ?line {ok, c} = disk_log:open([{name, c}, {type, halt}, {file, F3}]),
- ?line {[a,b,c],[]} = disk_log:accessible_logs(),
-
- ?line PA = filename:dirname(code:which(?MODULE)),
- ?line {ok, Node} = start_node(disk_log, "-pa " ++ PA),
- ?line wait_for_ready_net(),
-
- ?line {[_],[]} = disk_log:open([{name, a}, {file, F4}, {type, halt},
+ PrivDir = ?privdir(Conf),
+
+ true = is_alive(),
+
+ F1 = filename:join(PrivDir, "a.LOG"),
+ file:delete(F1),
+ F2 = filename:join(PrivDir, "b.LOG"),
+ file:delete(F2),
+ F3 = filename:join(PrivDir, "c.LOG"),
+ file:delete(F3),
+ F4 = filename:join(PrivDir, "d.LOG"),
+ file:delete(F1),
+ F5 = filename:join(PrivDir, "e.LOG"),
+ file:delete(F2),
+ F6 = filename:join(PrivDir, "f.LOG"),
+ file:delete(F3),
+
+ {[],[]} = disk_log:accessible_logs(),
+ {ok, a} = disk_log:open([{name, a}, {type, halt}, {file, F1}]),
+ {[a],[]} = disk_log:accessible_logs(),
+ {ok, b} = disk_log:open([{name, b}, {type, halt}, {file, F2}]),
+ {[a,b],[]} = disk_log:accessible_logs(),
+ {ok, c} = disk_log:open([{name, c}, {type, halt}, {file, F3}]),
+ {[a,b,c],[]} = disk_log:accessible_logs(),
+
+ PA = filename:dirname(code:which(?MODULE)),
+ {ok, Node} = start_node(disk_log, "-pa " ++ PA),
+ wait_for_ready_net(),
+
+ {[_],[]} = disk_log:open([{name, a}, {file, F4}, {type, halt},
{distributed, [Node]}]),
- ?line {[a,b,c],[]} = disk_log:accessible_logs(),
- ?line {[],[a]} = rpc:call(Node, disk_log, accessible_logs, []),
- ?line {[_],[]} = disk_log:open([{name, b}, {file, F5}, {type, halt},
+ {[a,b,c],[]} = disk_log:accessible_logs(),
+ {[],[a]} = rpc:call(Node, disk_log, accessible_logs, []),
+ {[_],[]} = disk_log:open([{name, b}, {file, F5}, {type, halt},
{distributed, [Node]}]),
- ?line {[],[a,b]} = rpc:call(Node, disk_log, accessible_logs, []),
- ?line {[_],[]} = disk_log:open([{name, c}, {file, F6}, {type, halt},
+ {[],[a,b]} = rpc:call(Node, disk_log, accessible_logs, []),
+ {[_],[]} = disk_log:open([{name, c}, {file, F6}, {type, halt},
{distributed, [Node]}]),
- ?line {[],[a,b,c]} = rpc:call(Node, disk_log, accessible_logs, []),
- ?line {[a,b,c],[]} = disk_log:accessible_logs(),
- ?line ok = disk_log:close(a),
- ?line {[b,c],[a]} = disk_log:accessible_logs(),
- ?line ok = disk_log:close(b),
- ?line {[c],[a,b]} = disk_log:accessible_logs(),
- ?line ok = disk_log:close(b),
- ?line {[c],[a]} = disk_log:accessible_logs(),
- ?line {[],[a,c]} = rpc:call(Node, disk_log, accessible_logs, []),
- ?line ok = disk_log:close(c),
- ?line {[],[a,c]} = disk_log:accessible_logs(),
- ?line ok = disk_log:close(c),
- ?line {[],[a]} = disk_log:accessible_logs(),
- ?line {[],[a]} = rpc:call(Node, disk_log, accessible_logs, []),
- ?line ok = disk_log:close(a),
- ?line {[],[]} = disk_log:accessible_logs(),
- ?line {[],[]} = rpc:call(Node, disk_log, accessible_logs, []),
-
- ?line file:delete(F1),
- ?line file:delete(F2),
- ?line file:delete(F3),
- ?line file:delete(F4),
- ?line file:delete(F5),
- ?line file:delete(F6),
-
- ?line stop_node(Node),
+ {[],[a,b,c]} = rpc:call(Node, disk_log, accessible_logs, []),
+ {[a,b,c],[]} = disk_log:accessible_logs(),
+ ok = disk_log:close(a),
+ {[b,c],[a]} = disk_log:accessible_logs(),
+ ok = disk_log:close(b),
+ {[c],[a,b]} = disk_log:accessible_logs(),
+ ok = disk_log:close(b),
+ {[c],[a]} = disk_log:accessible_logs(),
+ {[],[a,c]} = rpc:call(Node, disk_log, accessible_logs, []),
+ ok = disk_log:close(c),
+ {[],[a,c]} = disk_log:accessible_logs(),
+ ok = disk_log:close(c),
+ {[],[a]} = disk_log:accessible_logs(),
+ {[],[a]} = rpc:call(Node, disk_log, accessible_logs, []),
+ ok = disk_log:close(a),
+ {[],[]} = disk_log:accessible_logs(),
+ {[],[]} = rpc:call(Node, disk_log, accessible_logs, []),
+
+ file:delete(F1),
+ file:delete(F2),
+ file:delete(F3),
+ file:delete(F4),
+ file:delete(F5),
+ file:delete(F6),
+
+ stop_node(Node),
ok.
-dist_deadlock(suite) -> [];
-dist_deadlock(doc) ->
- ["OTP-4405. Deadlock between two nodes could happen."];
+%% OTP-4405. Deadlock between two nodes could happen.
dist_deadlock(Conf) when is_list(Conf) ->
- ?line PrivDir = ?privdir(Conf),
+ PrivDir = ?privdir(Conf),
- ?line true = is_alive(),
+ true = is_alive(),
- ?line F1 = filename:join(PrivDir, "a.LOG"),
- ?line file:delete(F1),
- ?line F2 = filename:join(PrivDir, "b.LOG"),
- ?line file:delete(F2),
+ F1 = filename:join(PrivDir, "a.LOG"),
+ file:delete(F1),
+ F2 = filename:join(PrivDir, "b.LOG"),
+ file:delete(F2),
- ?line PA = filename:dirname(code:which(?MODULE)),
- ?line {ok, Node1} = start_node(disk_log_node1, "-pa " ++ PA),
- ?line {ok, Node2} = start_node(disk_log_node2, "-pa " ++ PA),
- ?line wait_for_ready_net(),
+ PA = filename:dirname(code:which(?MODULE)),
+ {ok, Node1} = start_node(disk_log_node1, "-pa " ++ PA),
+ {ok, Node2} = start_node(disk_log_node2, "-pa " ++ PA),
+ wait_for_ready_net(),
Self = self(),
Fun1 = fun() -> dist_dl(Node2, a, F1, Self) end,
@@ -4477,11 +4367,11 @@ dist_deadlock(Conf) when is_list(Conf) ->
receive {P1, a} -> ok end,
receive {P2, b} -> ok end,
- ?line stop_node(Node1),
- ?line stop_node(Node2),
+ stop_node(Node1),
+ stop_node(Node2),
- ?line file:delete(F1),
- ?line file:delete(F2),
+ file:delete(F1),
+ file:delete(F2),
ok.
dist_dl(Node, Name, File, Pid) ->
@@ -4492,12 +4382,10 @@ dist_dl(Node, Name, File, Pid) ->
Pid ! {self(), Name},
ok.
-dist_open2(suite) -> [];
-dist_open2(doc) ->
- ["OTP-4480. Opening several logs simultaneously."];
+%% OTP-4480. Opening several logs simultaneously.
dist_open2(Conf) when is_list(Conf) ->
- ?line true = is_alive(),
- ?line {ok, _Pg2} = pg2:start(),
+ true = is_alive(),
+ {ok, _Pg2} = pg2:start(),
dist_open2_1(Conf, 0),
dist_open2_1(Conf, 100),
@@ -4513,9 +4401,9 @@ dist_open2(Conf) when is_list(Conf) ->
%% to open the log. The second one succeeds, and the third one is
%% attached.
P0 = pps(),
- ?line File0 = "n.LOG",
- ?line File = filename:join(PrivDir, File0),
- ?line make_file(PrivDir, File0, 8),
+ File0 = "n.LOG",
+ File = filename:join(PrivDir, File0),
+ make_file(PrivDir, File0, 8),
Parent = self(),
F1 = fun() -> R = disk_log:open([{name, Log}, {file, File},
@@ -4529,18 +4417,18 @@ dist_open2(Conf) when is_list(Conf) ->
Parent ! {self(), R},
timer:sleep(300)
end,
- ?line Pid1 = spawn(F1),
+ Pid1 = spawn(F1),
timer:sleep(10),
- ?line Pid2 = spawn(F2),
- ?line Pid3 = spawn(F2),
+ Pid2 = spawn(F2),
+ Pid3 = spawn(F2),
- ?line receive {Pid1,R1} -> {[],[_]} = R1 end,
- ?line receive {Pid2,R2} -> {[_],[]} = R2 end,
- ?line receive {Pid3,R3} -> {[_],[]} = R3 end,
+ receive {Pid1,R1} -> {[],[_]} = R1 end,
+ receive {Pid2,R2} -> {[_],[]} = R2 end,
+ receive {Pid3,R3} -> {[_],[]} = R3 end,
timer:sleep(500),
- ?line file:delete(File),
- ?line true = (P0 == pps()),
+ file:delete(File),
+ true = (P0 == pps()),
%% This time the first process has a naughty head_func. This test
%% does not add very much. Perhaps it should be removed. However,
@@ -4561,15 +4449,15 @@ dist_open2(Conf) when is_list(Conf) ->
{type,halt}]),
Parent ! {self(), R}
end,
- ?line Pid4 = spawn(F3),
+ Pid4 = spawn(F3),
timer:sleep(10),
- ?line Pid5 = spawn(F4),
- ?line Pid6 = spawn(F4),
+ Pid5 = spawn(F4),
+ Pid6 = spawn(F4),
%% The timing is crucial here.
- ?line R = case receive {Pid4,R4} -> R4 end of
+ R = case receive {Pid4,R4} -> R4 end of
{error, no_such_log} ->
- ?line R5 = receive {Pid5, R5a} -> R5a end,
- ?line R6 = receive {Pid6, R6a} -> R6a end,
+ R5 = receive {Pid5, R5a} -> R5a end,
+ R6 = receive {Pid6, R6a} -> R6a end,
case {R5, R6} of
{{repaired, _, _, _}, {ok, Log}} -> ok;
{{ok, Log}, {repaired, _, _, _}} -> ok;
@@ -4577,16 +4465,16 @@ dist_open2(Conf) when is_list(Conf) ->
end,
ok;
{ok, Log} -> % uninteresting case
- ?line receive {Pid5,_R5} -> ok end,
- ?line receive {Pid6,_R6} -> ok end,
+ receive {Pid5,_R5} -> ok end,
+ receive {Pid6,_R6} -> ok end,
{comment,
"Timing dependent test did not check anything."}
end,
timer:sleep(100),
- ?line {error, no_such_log} = disk_log:close(Log),
+ {error, no_such_log} = disk_log:close(Log),
file:delete(File),
- ?line true = (P0 == pps()),
+ true = (P0 == pps()),
No = 2,
Log2 = n2,
@@ -4598,7 +4486,7 @@ dist_open2(Conf) when is_list(Conf) ->
%% processes should be able to attach to other log without having to
%% wait.
- ?line {ok,Log} =
+ {ok,Log} =
disk_log:open([{name,Log},{file,File},{type,wrap},{size,{100,No}}]),
Pid = spawn(fun() ->
receive {HeadPid, start} -> ok end,
@@ -4607,15 +4495,15 @@ dist_open2(Conf) when is_list(Conf) ->
HeadPid ! {self(), done}
end),
HeadFunc = {?MODULE, slow_header, [Pid]},
- ?line ok = disk_log:change_header(Log, {head_func, HeadFunc}),
- ?line ok = disk_log:inc_wrap_file(Log), % header is written
+ ok = disk_log:change_header(Log, {head_func, HeadFunc}),
+ ok = disk_log:inc_wrap_file(Log), % header is written
timer:sleep(100),
- ?line ok = disk_log:close(Log),
+ ok = disk_log:close(Log),
file:delete(File2),
del(File, No),
- ?line true = (P0 == pps()),
+ true = (P0 == pps()),
R.
@@ -4625,13 +4513,13 @@ dist_open2_1(Conf, Delay) ->
Log = n,
A0 = [{name,Log},{file,File},{type,halt}],
- ?line create_opened_log(File, A0),
+ create_opened_log(File, A0),
P0 = pps(),
Log2 = log2,
File2 = "log2.LOG",
- ?line file:delete(File2),
- ?line {ok,Log2} = disk_log:open([{name,Log2},{file,File2},{type,halt}]),
+ file:delete(File2),
+ {ok,Log2} = disk_log:open([{name,Log2},{file,File2},{type,halt}]),
Parent = self(),
F = fun() ->
@@ -4639,28 +4527,28 @@ dist_open2_1(Conf, Delay) ->
timer:sleep(Delay),
Parent ! {self(), R}
end,
- ?line Pid1 = spawn(F),
+ Pid1 = spawn(F),
timer:sleep(10),
- ?line Pid2 = spawn(F),
- ?line Pid3 = spawn(F),
- ?line {error, no_such_log} = disk_log:log(Log, term), % is repairing now
- ?line 0 = qlen(),
+ Pid2 = spawn(F),
+ Pid3 = spawn(F),
+ {error, no_such_log} = disk_log:log(Log, term), % is repairing now
+ 0 = qlen(),
%% The file is already open, so this will not take long.
- ?line {ok,Log2} = disk_log:open([{name,Log2},{file,File2},{type,halt}]),
- ?line 0 = qlen(), % still repairing
- ?line ok = disk_log:close(Log2),
- ?line {error, no_such_log} = disk_log:close(Log2),
- ?line file:delete(File2),
-
- ?line receive {Pid1,R1} -> {repaired,_,_,_} = R1 end,
- ?line receive {Pid2,R2} -> {ok,_} = R2 end,
- ?line receive {Pid3,R3} -> {ok,_} = R3 end,
+ {ok,Log2} = disk_log:open([{name,Log2},{file,File2},{type,halt}]),
+ 0 = qlen(), % still repairing
+ ok = disk_log:close(Log2),
+ {error, no_such_log} = disk_log:close(Log2),
+ file:delete(File2),
+
+ receive {Pid1,R1} -> {repaired,_,_,_} = R1 end,
+ receive {Pid2,R2} -> {ok,_} = R2 end,
+ receive {Pid3,R3} -> {ok,_} = R3 end,
timer:sleep(500),
- ?line {error, no_such_log} = disk_log:info(Log),
+ {error, no_such_log} = disk_log:info(Log),
file:delete(File),
- ?line true = (P0 == pps()),
+ true = (P0 == pps()),
ok.
@@ -4669,18 +4557,18 @@ dist_open2_2(Conf, Delay) ->
File = filename:join(Dir, "n.LOG"),
Log = n,
- ?line PA = filename:dirname(code:which(?MODULE)),
- ?line {ok, Node1} = start_node(disk_log_node2, "-pa " ++ PA),
- ?line wait_for_ready_net(),
+ PA = filename:dirname(code:which(?MODULE)),
+ {ok, Node1} = start_node(disk_log_node2, "-pa " ++ PA),
+ wait_for_ready_net(),
P0 = pps(),
A0 = [{name,Log},{file,File},{type,halt}],
- ?line create_opened_log(File, A0),
+ create_opened_log(File, A0),
Log2 = log2,
File2 = "log2.LOG",
- ?line file:delete(File2),
- ?line {[{Node1,{ok,Log2}}],[]} =
+ file:delete(File2),
+ {[{Node1,{ok,Log2}}],[]} =
disk_log:open([{name,Log2},{file,File2},{type,halt},
{distributed,[Node1]}]),
@@ -4693,32 +4581,32 @@ dist_open2_2(Conf, Delay) ->
Parent ! {self(), R}
end,
%% And {priority, ...} probably has no effect either.
- ?line Pid1 = spawn_opt(F, [{priority, low}]),
- % timer:sleep(1), % no guarantee that Pid1 will return {repaired, ...}
- ?line Pid2 = spawn_opt(F, [{priority, low}]),
- ?line {error, no_such_log} =
+ Pid1 = spawn_opt(F, [{priority, low}]),
+ %% timer:sleep(1), % no guarantee that Pid1 will return {repaired, ...}
+ Pid2 = spawn_opt(F, [{priority, low}]),
+ {error, no_such_log} =
disk_log:log(Log, term), % maybe repairing now
- ?line 0 = qlen(),
+ 0 = qlen(),
%% The file is already open, so this will not take long.
- ?line {[{Node1,{ok,Log2}}],[]} =
+ {[{Node1,{ok,Log2}}],[]} =
disk_log:open([{name,Log2},{file,File2},{type,halt},
{distributed,[Node1]}]),
- ?line 0 = qlen(), % probably still repairing
- ?line ok = disk_log:close(Log2),
- ?line file:delete(File2),
+ 0 = qlen(), % probably still repairing
+ ok = disk_log:close(Log2),
+ file:delete(File2),
- ?line receive {Pid1,R1} -> R1 end,
- ?line receive {Pid2,R2} -> R2 end,
- ?line case {R1, R2} of
+ receive {Pid1,R1} -> R1 end,
+ receive {Pid2,R2} -> R2 end,
+ case {R1, R2} of
{{[{Node1,{repaired,_,_,_}}],[]},
{[{Node1,{ok,Log}}],[]}} -> ok;
{{[{Node1,{ok,Log}}],[]},
{[{Node1,{repaired,_,_,_}}],[]}} -> ok
end,
- ?line true = (P0 == pps()),
- ?line stop_node(Node1),
+ true = (P0 == pps()),
+ stop_node(Node1),
file:delete(File),
ok.
@@ -4751,38 +4639,35 @@ log_terms(Log, N) ->
ok = disk_log:log(Log, {term, N}),
log_terms(Log, N-1).
-other_groups(suite) -> [];
-other_groups(doc) ->
- ["OTP-5810. Cope with pg2 groups that are not disk logs."];
+%% OTP-5810. Cope with pg2 groups that are not disk logs.
other_groups(Conf) when is_list(Conf) ->
- ?line true = is_alive(),
- ?line PrivDir = ?privdir(Conf),
+ true = is_alive(),
+ PrivDir = ?privdir(Conf),
- ?line File = filename:join(PrivDir, "n.LOG"),
- ?line file:delete(File),
+ File = filename:join(PrivDir, "n.LOG"),
+ file:delete(File),
- ?line {[],[]} = disk_log:accessible_logs(),
- ?line {[_],[]} = disk_log:open([{name, n}, {file, File}, {type, halt},
+ {[],[]} = disk_log:accessible_logs(),
+ {[_],[]} = disk_log:open([{name, n}, {file, File}, {type, halt},
{distributed, [node()]}]),
- ?line {[],[n]} = disk_log:accessible_logs(),
+ {[],[n]} = disk_log:accessible_logs(),
Group = grupp,
- ?line pg2:create(Group),
- ?line ok = pg2:join(Group, self()),
- ?line {[],[n]} = disk_log:accessible_logs(),
- ?line [_] =
+ pg2:create(Group),
+ ok = pg2:join(Group, self()),
+ {[],[n]} = disk_log:accessible_logs(),
+ [_] =
lists:filter(fun(P) -> disk_log:pid2name(P) =/= undefined end,
erlang:processes()),
- ?line pg2:delete(Group),
- ?line {[],[n]} = disk_log:accessible_logs(),
- ?line ok = disk_log:close(n),
- ?line {[],[]} = disk_log:accessible_logs(),
- ?line file:delete(File),
+ pg2:delete(Group),
+ {[],[n]} = disk_log:accessible_logs(),
+ ok = disk_log:close(n),
+ {[],[]} = disk_log:accessible_logs(),
+ file:delete(File),
ok.
-define(MAX, 16384). % MAX in disk_log_1.erl
-evil(suite) -> [];
-evil(doc) -> ["Evil cases such as closed file descriptor port."];
+%% Evil cases such as closed file descriptor port.
evil(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "n.LOG"),
@@ -4790,62 +4675,62 @@ evil(Conf) when is_list(Conf) ->
%% Not a very thorough test.
- ?line ok = setup_evil_filled_cache_wrap(Log, Dir),
- ?line {error, {file_error,_,einval}} = disk_log:log(Log, apa),
- ?line ok = disk_log:close(Log),
+ ok = setup_evil_filled_cache_wrap(Log, Dir),
+ {error, {file_error,_,einval}} = disk_log:log(Log, apa),
+ ok = disk_log:close(Log),
- ?line ok = setup_evil_filled_cache_halt(Log, Dir),
- ?line {error, {file_error,_,einval}} = disk_log:truncate(Log, apa),
- ?line ok = stop_evil(Log),
+ ok = setup_evil_filled_cache_halt(Log, Dir),
+ {error, {file_error,_,einval}} = disk_log:truncate(Log, apa),
+ ok = stop_evil(Log),
%% White box test.
file:delete(File),
- ?line Ports0 = erlang:ports(),
- ?line {ok, Log} = disk_log:open([{name,Log},{file,File},{type,halt},
+ Ports0 = erlang:ports(),
+ {ok, Log} = disk_log:open([{name,Log},{file,File},{type,halt},
{size,?MAX+50},{format,external}]),
- ?line [Fd] = erlang:ports() -- Ports0,
- ?line {B,_} = x_mk_bytes(30),
- ?line ok = disk_log:blog(Log, <<0:(?MAX+1)/unit:8>>),
- ?line exit(Fd, kill),
- ?line {error, {file_error,_,einval}} = disk_log:blog_terms(Log, [B,B]),
- ?line ok= disk_log:close(Log),
+ [Fd] = erlang:ports() -- Ports0,
+ {B,_} = x_mk_bytes(30),
+ ok = disk_log:blog(Log, <<0:(?MAX+1)/unit:8>>),
+ exit(Fd, kill),
+ {error, {file_error,_,einval}} = disk_log:blog_terms(Log, [B,B]),
+ ok= disk_log:close(Log),
file:delete(File),
- ?line ok = setup_evil_wrap(Log, Dir),
- ?line {error, {file_error,_,einval}} = disk_log:close(Log),
+ ok = setup_evil_wrap(Log, Dir),
+ {error, {file_error,_,einval}} = disk_log:close(Log),
- ?line ok = setup_evil_wrap(Log, Dir),
- ?line {error, {file_error,_,einval}} = disk_log:log(Log, apa),
- ?line ok = stop_evil(Log),
+ ok = setup_evil_wrap(Log, Dir),
+ {error, {file_error,_,einval}} = disk_log:log(Log, apa),
+ ok = stop_evil(Log),
- ?line ok = setup_evil_halt(Log, Dir),
- ?line {error, {file_error,_,einval}} = disk_log:log(Log, apa),
- ?line ok = stop_evil(Log),
+ ok = setup_evil_halt(Log, Dir),
+ {error, {file_error,_,einval}} = disk_log:log(Log, apa),
+ ok = stop_evil(Log),
- ?line ok = setup_evil_wrap(Log, Dir),
- ?line {error, {file_error,_,einval}} = disk_log:reopen(Log, apa),
- ?line {error, {file_error,_,einval}} = disk_log:reopen(Log, apa),
- ?line ok = stop_evil(Log),
+ ok = setup_evil_wrap(Log, Dir),
+ {error, {file_error,_,einval}} = disk_log:reopen(Log, apa),
+ {error, {file_error,_,einval}} = disk_log:reopen(Log, apa),
+ ok = stop_evil(Log),
- ?line ok = setup_evil_wrap(Log, Dir),
- ?line {error, {file_error,_,einval}} = disk_log:reopen(Log, apa),
- ?line ok = stop_evil(Log),
+ ok = setup_evil_wrap(Log, Dir),
+ {error, {file_error,_,einval}} = disk_log:reopen(Log, apa),
+ ok = stop_evil(Log),
- ?line ok = setup_evil_wrap(Log, Dir),
- ?line {error, {file_error,_,einval}} = disk_log:inc_wrap_file(Log),
- ?line ok = stop_evil(Log),
+ ok = setup_evil_wrap(Log, Dir),
+ {error, {file_error,_,einval}} = disk_log:inc_wrap_file(Log),
+ ok = stop_evil(Log),
- ?line ok = setup_evil_wrap(Log, Dir),
- ?line {error, {file_error,_,einval}} = disk_log:chunk(Log, start),
- ?line ok = stop_evil(Log),
+ ok = setup_evil_wrap(Log, Dir),
+ {error, {file_error,_,einval}} = disk_log:chunk(Log, start),
+ ok = stop_evil(Log),
- ?line ok = setup_evil_wrap(Log, Dir),
- ?line {error, {file_error,_,einval}} = disk_log:truncate(Log),
- ?line ok = stop_evil(Log),
+ ok = setup_evil_wrap(Log, Dir),
+ {error, {file_error,_,einval}} = disk_log:truncate(Log),
+ ok = stop_evil(Log),
- ?line ok = setup_evil_wrap(Log, Dir),
- ?line {error, {file_error,_,einval}} = disk_log:chunk_step(Log, start, 1),
- ?line ok = stop_evil(Log),
+ ok = setup_evil_wrap(Log, Dir),
+ {error, {file_error,_,einval}} = disk_log:chunk_step(Log, start, 1),
+ ok = stop_evil(Log),
io:format("messages: ~p~n", [erlang:process_info(self(), messages)]),
del(File, 2),
@@ -4894,25 +4779,23 @@ setup_evil_filled_cache(Log, Args, Dir) ->
exit(Fd, kill),
ok.
-otp_6278(suite) -> [];
-otp_6278(doc) -> ["OTP-6278. open/1 creates no status or crash report."];
+%% OTP-6278. open/1 creates no status or crash report.
otp_6278(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = filename:join(Dir, "no_such_dir/no_such_file"),
- ?line error_logger:add_report_handler(?MODULE, self()),
- ?line {error, {file_error, _, _}} =
+ error_logger:add_report_handler(?MODULE, self()),
+ {error, {file_error, _, _}} =
disk_log:open([{name,n},{file,File}]),
receive
{crash_report,_Pid,Report} ->
- ?line io:format("Unexpected: ~p\n", [Report]),
- ?line ?t:fail()
+ io:format("Unexpected: ~p\n", [Report]),
+ ct:fail(failed)
after 1000 ->
ok
end,
- ?line error_logger:delete_report_handler(?MODULE).
+ error_logger:delete_report_handler(?MODULE).
-otp_10131(suite) -> [];
-otp_10131(doc) -> ["OTP-10131. head_func type."];
+%% OTP-10131. head_func type.
otp_10131(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
Log = otp_10131,
@@ -4979,7 +4862,7 @@ copy_wrap_log(FromName, ToName, N, FromDir, ToDir) ->
-define(BUFSIZE, 8192).
copy_file(Src, Dest) ->
- % ?t:format("copying from ~p to ~p~n", [Src, Dest]),
+ %% io:format("copying from ~p to ~p~n", [Src, Dest]),
{ok, InFd} = file:open(Src, [raw, binary, read]),
{ok, OutFd} = file:open(Dest, [raw, binary, write]),
ok = copy_file1(InFd, OutFd),
@@ -5104,50 +4987,15 @@ get_known(Node) ->
%% Copied from erl_distribution_SUITE.erl:
start_node(Name, Param) ->
- ?t:start_node(Name, slave, [{args, Param}]).
+ test_server:start_node(Name, slave, [{args, Param}]).
stop_node(Node) ->
- ?t:stop_node(Node).
-
-%from(H, [H | T]) -> T;
-%from(H, [_ | T]) -> from(H, T);
-%from(_H, []) -> [].
-
-
-%% Check for NFS cache size, this is called from init_per_testcase() and
-%% makes different tests run depending on the size of the NFS cache on
-%% VxWorks. Possibly this could be adopted to Windows too, but we seldom use
-%% NFS when testing on windows, so I can find better things to do.
-%% The port program used simply reads the nfsCacheSize variable on the board.
-%% If the board is configured without NFS, the port program will fail to load
-%% and this will return 0, which may or may not be the wrong thing to do.
-
-check_nfs(_Config) ->
- 0.
+ test_server:stop_node(Node).
-skip_expand([]) ->
- [];
-skip_expand([Case | T]) ->
- case (catch apply(?MODULE, Case, [suite])) of
- {'EXIT', _} ->
- [Case | skip_expand(T)];
- [] ->
- [Case | skip_expand(T)];
- Res ->
- skip_expand(Res) ++ skip_expand(T)
- end.
-
-
-skip_list(Config) ->
- case check_nfs(Config) of
- 0 ->
- skip_expand(?SKIP_NO_CACHE);
- _ ->
- skip_expand(?SKIP_LARGE_CACHE)
- end.
+%% from(H, [H | T]) -> T;
+%% from(H, [_ | T]) -> from(H, T);
+%% from(_H, []) -> [].
-should_skip(_Test,_Config) ->
- false.
%%-----------------------------------------------------------------
%% The error_logger handler used.
diff --git a/lib/kernel/test/erl_boot_server_SUITE.erl b/lib/kernel/test/erl_boot_server_SUITE.erl
index 2450761ac9..aef1d69f62 100644
--- a/lib/kernel/test/erl_boot_server_SUITE.erl
+++ b/lib/kernel/test/erl_boot_server_SUITE.erl
@@ -34,7 +34,9 @@
%% Changed for the new erl_boot_server for R3A by Bjorn Gustavsson.
%%-----------------------------------------------------------------
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[start, start_link, stop, add, delete, responses].
@@ -57,274 +59,262 @@ end_per_group(_GroupName, Config) ->
-define(all_ones, {255, 255, 255, 255}).
-start(doc) -> "Tests the erl_boot_server:start/1 function.";
+%% Tests the erl_boot_server:start/1 function.
start(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(50)),
- ?line [Host1, Host2|_] = good_hosts(Config),
+ [Host1, Host2|_] = good_hosts(Config),
%% Bad arguments.
BadHost = "bad__host",
- ?line {error, {badarg, {}}} = erl_boot_server:start({}),
- ?line {error, {badarg, atom}} = erl_boot_server:start(atom),
- ?line {error, {badarg, [atom, BadHost]}} =
+ {error, {badarg, {}}} = erl_boot_server:start({}),
+ {error, {badarg, atom}} = erl_boot_server:start(atom),
+ {error, {badarg, [atom, BadHost]}} =
erl_boot_server:start([atom, BadHost]),
- ?line {error, {badarg, [Host1, BadHost]}} =
+ {error, {badarg, [Host1, BadHost]}} =
erl_boot_server:start([Host1, BadHost]),
%% Test once.
- ?line {ok, Pid1} = erl_boot_server:start([Host1]),
- ?line {error, {already_started, Pid1}} =
+ {ok, Pid1} = erl_boot_server:start([Host1]),
+ {error, {already_started, Pid1}} =
erl_boot_server:start([Host1]),
- ?line exit(Pid1, kill),
+ exit(Pid1, kill),
%% Test again.
- test_server:sleep(1),
- ?line {ok, Pid2} = erl_boot_server:start([Host1, Host2]),
- ?line {error, {already_started, Pid2}} =
+ ct:sleep(1),
+ {ok, Pid2} = erl_boot_server:start([Host1, Host2]),
+ {error, {already_started, Pid2}} =
erl_boot_server:start([Host1, Host2]),
- ?line exit(Pid2, kill),
- test_server:sleep(1),
+ exit(Pid2, kill),
+ ct:sleep(1),
- ?line test_server:timetrap_cancel(Dog),
ok.
-start_link(doc) -> "Tests the erl_boot_server:start_link/1 function.";
+%% Tests the erl_boot_server:start_link/1 function.
start_link(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line [Host1, Host2|_] = good_hosts(Config),
+ [Host1, Host2|_] = good_hosts(Config),
OldFlag = process_flag(trap_exit, true),
- ?line {error, {badarg, {}}} = erl_boot_server:start_link({}),
- ?line {error, {badarg, atom}} = erl_boot_server:start_link(atom),
- ?line BadHost = "bad__host",
- ?line {error, {badarg, [atom, BadHost]}} =
+ {error, {badarg, {}}} = erl_boot_server:start_link({}),
+ {error, {badarg, atom}} = erl_boot_server:start_link(atom),
+ BadHost = "bad__host",
+ {error, {badarg, [atom, BadHost]}} =
erl_boot_server:start_link([atom, BadHost]),
- ?line {ok, Pid1} = erl_boot_server:start_link([Host1]),
- ?line {error, {already_started, Pid1}} =
+ {ok, Pid1} = erl_boot_server:start_link([Host1]),
+ {error, {already_started, Pid1}} =
erl_boot_server:start_link([Host1]),
- ?line shutdown(Pid1),
+ shutdown(Pid1),
- ?line {ok, Pid2} = erl_boot_server:start_link([Host1, Host2]),
- ?line {error, {already_started, Pid2}} =
+ {ok, Pid2} = erl_boot_server:start_link([Host1, Host2]),
+ {error, {already_started, Pid2}} =
erl_boot_server:start_link([Host1, Host2]),
- ?line shutdown(Pid2),
+ shutdown(Pid2),
process_flag(trap_exit, OldFlag),
- ?line test_server:timetrap_cancel(Dog),
ok.
-stop(doc) -> "Tests that no processes are left if a boot server is killed.";
+%% Tests that no processes are left if a boot server is killed.
stop(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(50)),
- ?line [Host1|_] = good_hosts(Config),
+ [Host1|_] = good_hosts(Config),
%% Start a boot server and kill it. Make sure that any helper processes
%% dies.
- % Make sure the inet_gethost_native server is already started,
- % otherwise it will make this test fail:
- ?line inet:getaddr(localhost, inet),
- ?line Before = processes(),
- ?line {ok, Pid} = erl_boot_server:start([Host1]),
- ?line New = processes() -- [Pid|Before],
- ?line exit(Pid, kill),
- ?line receive after 100 -> ok end,
- ?line case [P || P <- New, is_process_alive(P)] of
- [] ->
- ok;
- NotKilled ->
- test_server:fail({not_killed, NotKilled})
- end,
- ?line test_server:timetrap_cancel(Dog),
+ %% Make sure the inet_gethost_native server is already started,
+ %% otherwise it will make this test fail:
+ inet:getaddr(localhost, inet),
+ Before = processes(),
+ {ok, Pid} = erl_boot_server:start([Host1]),
+ New = processes() -- [Pid|Before],
+ exit(Pid, kill),
+ receive after 100 -> ok end,
+ case [P || P <- New, is_process_alive(P)] of
+ [] ->
+ ok;
+ NotKilled ->
+ ct:fail({not_killed, NotKilled})
+ end,
ok.
-add(doc) -> "Tests the erl_boot_server:add/1 function.";
+%% Tests the erl_boot_server:add/1 function.
add(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line OldFlag = process_flag(trap_exit, true),
- ?line {ok, Pid1} = erl_boot_server:start_link([]),
- ?line [] = erl_boot_server:which_slaves(),
- ?line [Host1, Host2, Host3|_] = good_hosts(Config),
+ OldFlag = process_flag(trap_exit, true),
+ {ok, Pid1} = erl_boot_server:start_link([]),
+ [] = erl_boot_server:which_slaves(),
+ [Host1, Host2, Host3|_] = good_hosts(Config),
%% Try bad values.
- ?line {error, {badarg, {}}} = erl_boot_server:add_slave({}),
- ?line {error, {badarg, [atom]}} = erl_boot_server:add_slave([atom]),
- ?line BadHost = "bad__host",
- ?line {error, {badarg, BadHost}} = erl_boot_server:add_slave(BadHost),
- ?line [] = erl_boot_server:which_slaves(),
+ {error, {badarg, {}}} = erl_boot_server:add_slave({}),
+ {error, {badarg, [atom]}} = erl_boot_server:add_slave([atom]),
+ BadHost = "bad__host",
+ {error, {badarg, BadHost}} = erl_boot_server:add_slave(BadHost),
+ [] = erl_boot_server:which_slaves(),
%% Add good host names.
- ?line {ok, Ip1} = inet:getaddr(Host1, inet),
- ?line {ok, Ip2} = inet:getaddr(Host2, inet),
- ?line {ok, Ip3} = inet:getaddr(Host3, inet),
- ?line MIp1 = {?all_ones, Ip1},
- ?line MIp2 = {?all_ones, Ip2},
- ?line MIp3 = {?all_ones, Ip3},
- ?line ok = erl_boot_server:add_slave(Host1),
- ?line [MIp1] = erl_boot_server:which_slaves(),
- ?line ok = erl_boot_server:add_slave(Host2),
- ?line M_Ip1_Ip2 = lists:sort([MIp1, MIp2]),
- ?line M_Ip1_Ip2 = lists:sort(erl_boot_server:which_slaves()),
- ?line ok = erl_boot_server:add_slave(Host3),
- ?line M_Ip1_Ip2_Ip3 = lists:sort([MIp3|M_Ip1_Ip2]),
- ?line M_Ip1_Ip2_Ip3 = erl_boot_server:which_slaves(),
+ {ok, Ip1} = inet:getaddr(Host1, inet),
+ {ok, Ip2} = inet:getaddr(Host2, inet),
+ {ok, Ip3} = inet:getaddr(Host3, inet),
+ MIp1 = {?all_ones, Ip1},
+ MIp2 = {?all_ones, Ip2},
+ MIp3 = {?all_ones, Ip3},
+ ok = erl_boot_server:add_slave(Host1),
+ [MIp1] = erl_boot_server:which_slaves(),
+ ok = erl_boot_server:add_slave(Host2),
+ M_Ip1_Ip2 = lists:sort([MIp1, MIp2]),
+ M_Ip1_Ip2 = lists:sort(erl_boot_server:which_slaves()),
+ ok = erl_boot_server:add_slave(Host3),
+ M_Ip1_Ip2_Ip3 = lists:sort([MIp3|M_Ip1_Ip2]),
+ M_Ip1_Ip2_Ip3 = erl_boot_server:which_slaves(),
%% Add duplicate names.
- ?line ok = erl_boot_server:add_slave(Host3),
- ?line M_Ip1_Ip2_Ip3 = erl_boot_server:which_slaves(),
+ ok = erl_boot_server:add_slave(Host3),
+ M_Ip1_Ip2_Ip3 = erl_boot_server:which_slaves(),
%% More bad names.
- ?line {error, {badarg, BadHost}} = erl_boot_server:add_slave(BadHost),
- ?line M_Ip1_Ip2_Ip3 = erl_boot_server:which_slaves(),
+ {error, {badarg, BadHost}} = erl_boot_server:add_slave(BadHost),
+ M_Ip1_Ip2_Ip3 = erl_boot_server:which_slaves(),
%% Cleanup.
- ?line shutdown(Pid1),
- ?line process_flag(trap_exit, OldFlag),
- ?line test_server:timetrap_cancel(Dog),
+ shutdown(Pid1),
+ process_flag(trap_exit, OldFlag),
ok.
-delete(doc) -> "Tests the erl_boot_server:delete/1 function.";
+%% Tests the erl_boot_server:delete/1 function.
delete(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line OldFlag = process_flag(trap_exit, true),
+ OldFlag = process_flag(trap_exit, true),
- ?line [Host1, Host2, Host3|_] = good_hosts(Config),
- ?line {ok, Ip1} = inet:getaddr(Host1, inet),
- ?line {ok, Ip2} = inet:getaddr(Host2, inet),
- ?line {ok, Ip3} = inet:getaddr(Host3, inet),
- ?line MIp1 = {?all_ones, Ip1},
- ?line MIp2 = {?all_ones, Ip2},
- ?line MIp3 = {?all_ones, Ip3},
+ [Host1, Host2, Host3|_] = good_hosts(Config),
+ {ok, Ip1} = inet:getaddr(Host1, inet),
+ {ok, Ip2} = inet:getaddr(Host2, inet),
+ {ok, Ip3} = inet:getaddr(Host3, inet),
+ MIp1 = {?all_ones, Ip1},
+ MIp2 = {?all_ones, Ip2},
+ MIp3 = {?all_ones, Ip3},
- ?line {ok, Pid1} = erl_boot_server:start_link([Host1, Host2, Host3]),
- ?line M_Ip123 = lists:sort([MIp1, MIp2, MIp3]),
- ?line M_Ip123 = erl_boot_server:which_slaves(),
+ {ok, Pid1} = erl_boot_server:start_link([Host1, Host2, Host3]),
+ M_Ip123 = lists:sort([MIp1, MIp2, MIp3]),
+ M_Ip123 = erl_boot_server:which_slaves(),
%% Do some bad attempts and check that the list of slaves is intact.
- ?line {error, {badarg, {}}} = erl_boot_server:delete_slave({}),
- ?line {error, {badarg, [atom]}} = erl_boot_server:delete_slave([atom]),
- ?line BadHost = "bad__host",
- ?line {error, {badarg, BadHost}} = erl_boot_server:delete_slave(BadHost),
- ?line M_Ip123 = erl_boot_server:which_slaves(),
+ {error, {badarg, {}}} = erl_boot_server:delete_slave({}),
+ {error, {badarg, [atom]}} = erl_boot_server:delete_slave([atom]),
+ BadHost = "bad__host",
+ {error, {badarg, BadHost}} = erl_boot_server:delete_slave(BadHost),
+ M_Ip123 = erl_boot_server:which_slaves(),
%% Delete Host2 and make sure it's gone.
- ?line ok = erl_boot_server:delete_slave(Host2),
- ?line M_Ip13 = lists:sort([MIp1, MIp3]),
- ?line M_Ip13 = erl_boot_server:which_slaves(),
-
- ?line ok = erl_boot_server:delete_slave(Host1),
- ?line [MIp3] = erl_boot_server:which_slaves(),
- ?line ok = erl_boot_server:delete_slave(Host1),
- ?line [MIp3] = erl_boot_server:which_slaves(),
-
- ?line {error, {badarg, BadHost}} = erl_boot_server:delete_slave(BadHost),
- ?line [MIp3] = erl_boot_server:which_slaves(),
-
- ?line ok = erl_boot_server:delete_slave(Ip3),
- ?line [] = erl_boot_server:which_slaves(),
- ?line ok = erl_boot_server:delete_slave(Ip3),
- ?line [] = erl_boot_server:which_slaves(),
-
- ?line shutdown(Pid1),
- ?line process_flag(trap_exit, OldFlag),
- ?line test_server:timetrap_cancel(Dog),
+ ok = erl_boot_server:delete_slave(Host2),
+ M_Ip13 = lists:sort([MIp1, MIp3]),
+ M_Ip13 = erl_boot_server:which_slaves(),
+
+ ok = erl_boot_server:delete_slave(Host1),
+ [MIp3] = erl_boot_server:which_slaves(),
+ ok = erl_boot_server:delete_slave(Host1),
+ [MIp3] = erl_boot_server:which_slaves(),
+
+ {error, {badarg, BadHost}} = erl_boot_server:delete_slave(BadHost),
+ [MIp3] = erl_boot_server:which_slaves(),
+
+ ok = erl_boot_server:delete_slave(Ip3),
+ [] = erl_boot_server:which_slaves(),
+ ok = erl_boot_server:delete_slave(Ip3),
+ [] = erl_boot_server:which_slaves(),
+
+ shutdown(Pid1),
+ process_flag(trap_exit, OldFlag),
ok.
-responses(doc) -> "Tests erl_boot_server responses to slave requests.";
+%% Tests erl_boot_server responses to slave requests.
responses(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(30)),
- ?line process_flag(trap_exit, true),
+ process_flag(trap_exit, true),
%% Copy from inet_boot.hrl
EBOOT_PORT = 4368,
EBOOT_REQUEST = "EBOOTQ",
EBOOT_REPLY = "EBOOTR",
- ?line {ok,Host} = inet:gethostname(),
- ?line {ok,Ip} = inet:getaddr(Host, inet),
+ {ok,Host} = inet:gethostname(),
+ {ok,Ip} = inet:getaddr(Host, inet),
ThisVer = erlang:system_info(version),
- ?line {ok,BootPid} = erl_boot_server:start_link([Host]),
+ {ok,BootPid} = erl_boot_server:start_link([Host]),
%% Send junk
- ?line S1 = open_udp(),
- ?line prim_inet:sendto(S1, Ip, EBOOT_PORT, ["0"]),
+ S1 = open_udp(),
+ prim_inet:sendto(S1, Ip, EBOOT_PORT, ["0"]),
receive
What ->
- ?line close_udp(S1),
- ?line ?t:fail({"got unexpected response",What})
+ close_udp(S1),
+ ct:fail({"got unexpected response",What})
after 100 ->
ok
end,
%% Req from a slave with same erlang vsn.
- ?line S2 = open_udp(),
- ?line prim_inet:sendto(S2, Ip, EBOOT_PORT, [EBOOT_REQUEST,ThisVer]),
+ S2 = open_udp(),
+ prim_inet:sendto(S2, Ip, EBOOT_PORT, [EBOOT_REQUEST,ThisVer]),
receive
{udp,S2,Ip,_Port1,Resp1} ->
- ?line close_udp(S2),
- ?line EBOOT_REPLY = string:substr(Resp1, 1, length(EBOOT_REPLY)),
- ?line Rest1 = string:substr(Resp1, length(EBOOT_REPLY)+1, length(Resp1)),
- ?line [_,_,_ | ThisVer] = Rest1
+ close_udp(S2),
+ EBOOT_REPLY = string:substr(Resp1, 1, length(EBOOT_REPLY)),
+ Rest1 = string:substr(Resp1, length(EBOOT_REPLY)+1, length(Resp1)),
+ [_,_,_ | ThisVer] = Rest1
after 2000 ->
- ?line close_udp(S2),
- ?line ?t:fail("no boot server response; same vsn")
+ close_udp(S2),
+ ct:fail("no boot server response; same vsn")
end,
-
+
%% Req from a slave with other erlang vsn.
- ?line S3 = open_udp(),
- ?line prim_inet:sendto(S3, Ip, EBOOT_PORT, [EBOOT_REQUEST,"1.0"]),
+ S3 = open_udp(),
+ prim_inet:sendto(S3, Ip, EBOOT_PORT, [EBOOT_REQUEST,"1.0"]),
receive
Anything ->
- ?line close_udp(S3),
- ?line ?t:fail({"got unexpected response",Anything})
+ close_udp(S3),
+ ct:fail({"got unexpected response",Anything})
after 100 ->
ok
end,
%% Kill the boot server and wait for it to disappear.
- ?line unlink(BootPid),
- ?line BootPidMref = erlang:monitor(process, BootPid),
- ?line exit(BootPid, kill),
+ unlink(BootPid),
+ BootPidMref = erlang:monitor(process, BootPid),
+ exit(BootPid, kill),
receive
{'DOWN',BootPidMref,_,_,_} -> ok
end,
- ?line {ok,BootPid2} = erl_boot_server:start_link(["127.0.0.1"]),
+ {ok,BootPid2} = erl_boot_server:start_link(["127.0.0.1"]),
%% Req from slave with invalid ip address.
- ?line S4 = open_udp(),
+ S4 = open_udp(),
Ret =
case Ip of
{127,0,0,1} ->
{comment,"IP address for this host is 127.0.0.1"};
_ ->
- ?line prim_inet:sendto(S4, Ip, EBOOT_PORT,
- [EBOOT_REQUEST,ThisVer]),
+ prim_inet:sendto(S4, Ip, EBOOT_PORT,
+ [EBOOT_REQUEST,ThisVer]),
receive
Huh ->
- ?line close_udp(S4),
- ?line ?t:fail({"got unexpected response",Huh})
+ close_udp(S4),
+ ct:fail({"got unexpected response",Huh})
after 100 ->
ok
end
end,
- ?line unlink(BootPid2),
- ?line exit(BootPid2, kill),
+ unlink(BootPid2),
+ exit(BootPid2, kill),
%% Now wait for any late unexpected messages.
receive
Whatever ->
- ?line ?t:fail({unexpected_message,Whatever})
+ ct:fail({unexpected_message,Whatever})
after 4000 ->
- ?line close_udp(S1),
- ?line close_udp(S3),
- ?line close_udp(S4),
+ close_udp(S1),
+ close_udp(S3),
+ close_udp(S4),
ok
end,
- ?line test_server:timetrap_cancel(Dog),
Ret.
shutdown(Pid) ->
@@ -335,7 +325,7 @@ shutdown(Pid) ->
after 1000 ->
%% The timeout used to be 1 ms, which could be too short time for the
%% SMP emulator on a slow computer with one CPU.
- test_server:fail(shutdown)
+ ct:fail(shutdown)
end.
good_hosts(_Config) ->
@@ -347,10 +337,10 @@ good_hosts(_Config) ->
[GoodHost1, GoodHost2, GoodHost3].
open_udp() ->
- ?line {ok, S} = prim_inet:open(udp, inet, dgram),
- ?line ok = prim_inet:setopts(S, [{mode,list},{active,true},
- {deliver,term},{broadcast,true}]),
- ?line {ok,_} = prim_inet:bind(S, {0,0,0,0}, 0),
+ {ok, S} = prim_inet:open(udp, inet, dgram),
+ ok = prim_inet:setopts(S, [{mode,list},{active,true},
+ {deliver,term},{broadcast,true}]),
+ {ok,_} = prim_inet:bind(S, {0,0,0,0}, 0),
S.
close_udp(S) ->
diff --git a/lib/kernel/test/erl_distribution_SUITE.erl b/lib/kernel/test/erl_distribution_SUITE.erl
index 3ac87384b4..9951ac17e9 100644
--- a/lib/kernel/test/erl_distribution_SUITE.erl
+++ b/lib/kernel/test/erl_distribution_SUITE.erl
@@ -19,7 +19,6 @@
%%
-module(erl_distribution_SUITE).
-%-define(line_trace, 1).
-include_lib("common_test/include/ct.hrl").
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
@@ -61,7 +60,9 @@
%% erl -sname master -rsh ctrsh
%%-----------------------------------------------------------------
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,4}}].
all() ->
[tick, tick_change, illegal_nodenames, hidden_node,
@@ -91,27 +92,22 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
- Dog=?t:timetrap(?t:minutes(4)),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- ?t:timetrap_cancel(Dog).
+end_per_testcase(_Func, _Config) ->
+ ok.
-tick(suite) -> [];
-tick(doc) -> [];
tick(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(120)),
PaDir = filename:dirname(code:which(erl_distribution_SUITE)),
-
+
%% First check that the normal case is OK!
- ?line {ok, Node} = start_node(dist_test, "-pa " ++ PaDir),
+ {ok, Node} = start_node(dist_test, "-pa " ++ PaDir),
rpc:call(Node, erl_distribution_SUITE, tick_cli_test, [node()]),
-
+
erlang:monitor_node(Node, true),
receive
{nodedown, Node} ->
- test_server:fail("nodedown from other node")
+ ct:fail("nodedown from other node")
after 30000 ->
erlang:monitor_node(Node, false),
stop_node(Node)
@@ -129,20 +125,20 @@ tick(Config) when is_list(Config) ->
%% Set the ticktime on the server node to 100 secs so the server
%% node doesn't tick the client node within the interval ...
- ?line {ok, ServNode} = start_node(dist_test_server,
- "-kernel net_ticktime 100 "
- "-pa " ++ PaDir),
+ {ok, ServNode} = start_node(dist_test_server,
+ "-kernel net_ticktime 100 "
+ "-pa " ++ PaDir),
rpc:call(ServNode, erl_distribution_SUITE, tick_serv_test, [Node, node()]),
- ?line {ok, _} = start_node(dist_test,
- "-kernel net_ticktime 12 "
- "-pa " ++ PaDir),
+ {ok, _} = start_node(dist_test,
+ "-kernel net_ticktime 12 "
+ "-pa " ++ PaDir),
rpc:call(Node, erl_distribution_SUITE, tick_cli_test, [ServNode]),
-
+
spawn_link(erl_distribution_SUITE, keep_conn, [Node]),
{tick_serv, ServNode} ! {i_want_the_result, self()},
-
+
monitor_node(ServNode, true),
monitor_node(Node, true),
@@ -154,56 +150,47 @@ tick(Config) when is_list(Config) ->
{tick_test, Error} ->
stop_node(ServNode),
stop_node(Node),
- test_server:fail(Error);
+ ct:fail(Error);
{nodedown, Node} ->
stop_node(ServNode),
- test_server:fail("client node died");
+ ct:fail("client node died");
{nodedown, ServNode} ->
stop_node(Node),
- test_server:fail("server node died")
+ ct:fail("server node died")
end,
- ?line test_server:timetrap_cancel(Dog),
ok.
-table_waste(doc) ->
- ["Checks that pinging nonexistyent nodes does not waste space in distribution table"];
-table_waste(suite) ->
- [];
+%% Checks that pinging nonexistyent nodes does not waste space in distribution table.
table_waste(Config) when is_list(Config) ->
- ?line {ok, HName} = inet:gethostname(),
+ {ok, HName} = inet:gethostname(),
F = fun(0,_F) -> [];
(N,F) ->
- ?line Name = list_to_atom("erl_distribution_"++integer_to_list(N)++
- "@"++HName),
- ?line pang = net_adm:ping(Name),
- ?line F(N-1,F)
+ Name = list_to_atom("erl_distribution_"++integer_to_list(N)++
+ "@"++HName),
+ pang = net_adm:ping(Name),
+ F(N-1,F)
end,
- ?line F(256,F),
- ?line {ok, N} = start_node(erl_distribution_300,""),
- ?line stop_node(N),
+ F(256,F),
+ {ok, N} = start_node(erl_distribution_300,""),
+ stop_node(N),
ok.
-
-
-illegal_nodenames(doc) ->
- ["Test that pinging an illegal nodename does not kill the node"];
-illegal_nodenames(suite) ->
- [];
+
+
+%% Test that pinging an illegal nodename does not kill the node.
illegal_nodenames(Config) when is_list(Config) ->
- ?line Dog=?t:timetrap(?t:minutes(2)),
PaDir = filename:dirname(code:which(erl_distribution_SUITE)),
- ?line {ok, Node}=start_node(illegal_nodenames, "-pa " ++ PaDir),
+ {ok, Node}=start_node(illegal_nodenames, "-pa " ++ PaDir),
monitor_node(Node, true),
- ?line RPid=rpc:call(Node, erlang, spawn,
- [?MODULE, pinger, [self()]]),
+ RPid=rpc:call(Node, erlang, spawn,
+ [?MODULE, pinger, [self()]]),
receive
{RPid, pinged} ->
ok;
{nodedown, Node} ->
- ?t:fail("Remote node died.")
+ ct:fail("Remote node died.")
end,
stop_node(Node),
- ?t:timetrap_cancel(Dog),
ok.
pinger(Starter) ->
@@ -213,7 +200,7 @@ pinger(Starter) ->
ok.
-net_setuptime(doc) -> ["Test that you can set the net_setuptime properly"];
+%% Test that you can set the net_setuptime properly.
net_setuptime(Config) when is_list(Config) ->
%% In this test case, we reluctantly accept shorter times than the given
%% setup time, because the connection attempt can end in a
@@ -221,18 +208,18 @@ net_setuptime(Config) when is_list(Config) ->
Res0 = do_test_setuptime("2"),
io:format("Res0 = ~p", [Res0]),
- ?line true = (Res0 =< 4000),
+ true = (Res0 =< 4000),
Res1 = do_test_setuptime("0.3"),
io:format("Res1 = ~p", [Res1]),
- ?line true = (Res1 =< 500),
+ true = (Res1 =< 500),
ok.
do_test_setuptime(Setuptime) when is_list(Setuptime) ->
- ?line PaDir = filename:dirname(code:which(?MODULE)),
- ?line {ok, Node} = start_node(dist_setuptime_test, "-pa " ++ PaDir ++
- " -kernel net_setuptime " ++ Setuptime),
- ?line Res = rpc:call(Node,?MODULE,time_ping,[?DUMMY_NODE]),
- ?line stop_node(Node),
+ PaDir = filename:dirname(code:which(?MODULE)),
+ {ok, Node} = start_node(dist_setuptime_test, "-pa " ++ PaDir ++
+ " -kernel net_setuptime " ++ Setuptime),
+ Res = rpc:call(Node,?MODULE,time_ping,[?DUMMY_NODE]),
+ stop_node(Node),
Res.
time_ping(Node) ->
@@ -296,160 +283,159 @@ tick_cli_test1(Node) ->
end.
-tick_change(doc) -> ["OTP-4255"];
-tick_change(suite) -> [];
+%% OTP-4255.
tick_change(Config) when is_list(Config) ->
- ?line PaDir = filename:dirname(code:which(?MODULE)),
- ?line [BN, CN] = get_nodenames(2, tick_change),
- ?line DefaultTT = net_kernel:get_net_ticktime(),
- ?line unchanged = net_kernel:set_net_ticktime(DefaultTT, 60),
- ?line case DefaultTT of
- I when is_integer(I) -> ?line ok;
- _ -> ?line ?t:fail(DefaultTT)
- end,
-
- % In case other nodes are connected
+ PaDir = filename:dirname(code:which(?MODULE)),
+ [BN, CN] = get_nodenames(2, tick_change),
+ DefaultTT = net_kernel:get_net_ticktime(),
+ unchanged = net_kernel:set_net_ticktime(DefaultTT, 60),
+ case DefaultTT of
+ I when is_integer(I) -> ok;
+ _ -> ct:fail(DefaultTT)
+ end,
+
+ %% In case other nodes are connected
case nodes(connected) of
- [] -> ?line net_kernel:set_net_ticktime(10, 0);
- _ -> ?line rpc:multicall(nodes([this, connected]), net_kernel,
- set_net_ticktime, [10, 5])
+ [] -> net_kernel:set_net_ticktime(10, 0);
+ _ -> rpc:multicall(nodes([this, connected]), net_kernel,
+ set_net_ticktime, [10, 5])
end,
- ?line wait_until(fun () -> 10 == net_kernel:get_net_ticktime() end),
- ?line {ok, B} = start_node(BN, "-kernel net_ticktime 10 -pa " ++ PaDir),
- ?line {ok, C} = start_node(CN, "-kernel net_ticktime 10 -hidden -pa "
- ++ PaDir),
+ wait_until(fun () -> 10 == net_kernel:get_net_ticktime() end),
+ {ok, B} = start_node(BN, "-kernel net_ticktime 10 -pa " ++ PaDir),
+ {ok, C} = start_node(CN, "-kernel net_ticktime 10 -hidden -pa "
+ ++ PaDir),
- ?line OTE = process_flag(trap_exit, true),
+ OTE = process_flag(trap_exit, true),
case catch begin
- ?line run_tick_change_test(B, C, 10, 1, PaDir),
- ?line run_tick_change_test(B, C, 1, 10, PaDir)
+ run_tick_change_test(B, C, 10, 1, PaDir),
+ run_tick_change_test(B, C, 1, 10, PaDir)
end of
{'EXIT', Reason} ->
- ?line stop_node(B),
- ?line stop_node(C),
+ stop_node(B),
+ stop_node(C),
%% In case other nodes are connected
case nodes(connected) of
- [] -> ?line net_kernel:set_net_ticktime(DefaultTT, 0);
- _ -> ?line rpc:multicall(nodes([this, connected]), net_kernel,
- set_net_ticktime, [DefaultTT, 10])
+ [] -> net_kernel:set_net_ticktime(DefaultTT, 0);
+ _ -> rpc:multicall(nodes([this, connected]), net_kernel,
+ set_net_ticktime, [DefaultTT, 10])
end,
- ?line wait_until(fun () ->
- DefaultTT == net_kernel:get_net_ticktime()
- end),
- ?line process_flag(trap_exit, OTE),
- ?t:fail(Reason);
+ wait_until(fun () ->
+ DefaultTT == net_kernel:get_net_ticktime()
+ end),
+ process_flag(trap_exit, OTE),
+ ct:fail(Reason);
_ ->
ok
end,
- ?line process_flag(trap_exit, OTE),
- ?line stop_node(B),
- ?line stop_node(C),
+ process_flag(trap_exit, OTE),
+ stop_node(B),
+ stop_node(C),
- % In case other nodes are connected
+ %% In case other nodes are connected
case nodes(connected) of
- [] -> ?line net_kernel:set_net_ticktime(DefaultTT, 0);
- _ -> ?line rpc:multicall(nodes([this, connected]), net_kernel,
- set_net_ticktime, [DefaultTT, 5])
+ [] -> net_kernel:set_net_ticktime(DefaultTT, 0);
+ _ -> rpc:multicall(nodes([this, connected]), net_kernel,
+ set_net_ticktime, [DefaultTT, 5])
end,
- ?line wait_until(fun () -> DefaultTT == net_kernel:get_net_ticktime() end),
- ?line ok.
+ wait_until(fun () -> DefaultTT == net_kernel:get_net_ticktime() end),
+ ok.
wait_for_nodedowns(Tester, Ref) ->
receive
{nodedown, Node} ->
- ?t:format("~p~n", [{node(), {nodedown, Node}}]),
- ?line Tester ! {Ref, {node(), {nodedown, Node}}}
+ io:format("~p~n", [{node(), {nodedown, Node}}]),
+ Tester ! {Ref, {node(), {nodedown, Node}}}
end,
wait_for_nodedowns(Tester, Ref).
run_tick_change_test(B, C, PrevTT, TT, PaDir) ->
- ?line [DN, EN] = get_nodenames(2, tick_change),
-
- ?line Tester = self(),
- ?line Ref = make_ref(),
- ?line MonitorNodes = fun (Nodes) ->
- ?line lists:foreach(
- fun (N) ->
- ?line monitor_node(N,true)
- end,
- Nodes),
- wait_for_nodedowns(Tester, Ref)
- end,
-
- ?line {ok, D} = start_node(DN, "-kernel net_ticktime "
- ++ integer_to_list(PrevTT) ++ " -pa " ++ PaDir),
-
- ?line NMA = spawn_link(fun () -> MonitorNodes([B, C, D]) end),
- ?line NMB = spawn_link(B, fun () -> MonitorNodes([node(), C, D]) end),
- ?line NMC = spawn_link(C, fun () -> MonitorNodes([node(), B, D]) end),
-
- ?line MaxTT = case PrevTT > TT of
- true -> ?line PrevTT;
- false -> ?line TT
- end,
+ [DN, EN] = get_nodenames(2, tick_change),
- ?line CheckResult = make_ref(),
- ?line spawn_link(fun () ->
- receive
- after (25 + MaxTT)*1000 ->
- Tester ! CheckResult
- end
- end),
+ Tester = self(),
+ Ref = make_ref(),
+ MonitorNodes = fun (Nodes) ->
+ lists:foreach(
+ fun (N) ->
+ monitor_node(N,true)
+ end,
+ Nodes),
+ wait_for_nodedowns(Tester, Ref)
+ end,
+
+ {ok, D} = start_node(DN, "-kernel net_ticktime "
+ ++ integer_to_list(PrevTT) ++ " -pa " ++ PaDir),
+
+ NMA = spawn_link(fun () -> MonitorNodes([B, C, D]) end),
+ NMB = spawn_link(B, fun () -> MonitorNodes([node(), C, D]) end),
+ NMC = spawn_link(C, fun () -> MonitorNodes([node(), B, D]) end),
+
+ MaxTT = case PrevTT > TT of
+ true -> PrevTT;
+ false -> TT
+ end,
- % In case other nodes than these are connected
+ CheckResult = make_ref(),
+ spawn_link(fun () ->
+ receive
+ after (25 + MaxTT)*1000 ->
+ Tester ! CheckResult
+ end
+ end),
+
+ %% In case other nodes than these are connected
case nodes(connected) -- [B, C, D] of
- [] -> ?line ok;
- OtherNodes -> ?line rpc:multicall(OtherNodes, net_kernel,
- set_net_ticktime, [TT, 20])
+ [] -> ok;
+ OtherNodes -> rpc:multicall(OtherNodes, net_kernel,
+ set_net_ticktime, [TT, 20])
end,
- ?line change_initiated = net_kernel:set_net_ticktime(TT,20),
- ?line {ongoing_change_to,_} = net_kernel:set_net_ticktime(TT,20),
- ?line sleep(3),
- ?line change_initiated = rpc:call(B,net_kernel,set_net_ticktime,[TT,15]),
- ?line sleep(7),
- ?line change_initiated = rpc:call(C,net_kernel,set_net_ticktime,[TT,10]),
-
- ?line {ok, E} = start_node(EN, "-kernel net_ticktime "
- ++ integer_to_list(TT) ++ " -pa " ++ PaDir),
- ?line NME = spawn_link(E, fun () -> MonitorNodes([node(), B, C, D]) end),
- ?line NMA2 = spawn_link(fun () -> MonitorNodes([E]) end),
- ?line NMB2 = spawn_link(B, fun () -> MonitorNodes([E]) end),
- ?line NMC2 = spawn_link(C, fun () -> MonitorNodes([E]) end),
-
- receive CheckResult -> ?line ok end,
-
- ?line unlink(NMA), exit(NMA, kill),
- ?line unlink(NMB), exit(NMB, kill),
- ?line unlink(NMC), exit(NMC, kill),
- ?line unlink(NME), exit(NME, kill),
- ?line unlink(NMA2), exit(NMA2, kill),
- ?line unlink(NMB2), exit(NMB2, kill),
- ?line unlink(NMC2), exit(NMC2, kill),
+ change_initiated = net_kernel:set_net_ticktime(TT,20),
+ {ongoing_change_to,_} = net_kernel:set_net_ticktime(TT,20),
+ sleep(3),
+ change_initiated = rpc:call(B,net_kernel,set_net_ticktime,[TT,15]),
+ sleep(7),
+ change_initiated = rpc:call(C,net_kernel,set_net_ticktime,[TT,10]),
+
+ {ok, E} = start_node(EN, "-kernel net_ticktime "
+ ++ integer_to_list(TT) ++ " -pa " ++ PaDir),
+ NME = spawn_link(E, fun () -> MonitorNodes([node(), B, C, D]) end),
+ NMA2 = spawn_link(fun () -> MonitorNodes([E]) end),
+ NMB2 = spawn_link(B, fun () -> MonitorNodes([E]) end),
+ NMC2 = spawn_link(C, fun () -> MonitorNodes([E]) end),
+
+ receive CheckResult -> ok end,
+
+ unlink(NMA), exit(NMA, kill),
+ unlink(NMB), exit(NMB, kill),
+ unlink(NMC), exit(NMC, kill),
+ unlink(NME), exit(NME, kill),
+ unlink(NMA2), exit(NMA2, kill),
+ unlink(NMB2), exit(NMB2, kill),
+ unlink(NMC2), exit(NMC2, kill),
%% The node not changing ticktime should have been disconnected from the
%% other nodes
- receive {Ref, {Node, {nodedown, D}}} when Node == node() -> ?line ok
- after 0 -> ?line exit({?LINE, no_nodedown})
+ receive {Ref, {Node, {nodedown, D}}} when Node == node() -> ok
+ after 0 -> exit({?LINE, no_nodedown})
end,
- receive {Ref, {B, {nodedown, D}}} -> ?line ok
- after 0 -> ?line exit({?LINE, no_nodedown})
+ receive {Ref, {B, {nodedown, D}}} -> ok
+ after 0 -> exit({?LINE, no_nodedown})
end,
- receive {Ref, {C, {nodedown, D}}} -> ?line ok
- after 0 -> ?line exit({?LINE, no_nodedown})
+ receive {Ref, {C, {nodedown, D}}} -> ok
+ after 0 -> exit({?LINE, no_nodedown})
end,
- receive {Ref, {E, {nodedown, D}}} -> ?line ok
- after 0 -> ?line exit({?LINE, no_nodedown})
+ receive {Ref, {E, {nodedown, D}}} -> ok
+ after 0 -> exit({?LINE, no_nodedown})
end,
%% No other connections should have been broken
receive
{Ref, Reason} ->
- ?line stop_node(E),
- ?line exit({?LINE, Reason});
+ stop_node(E),
+ exit({?LINE, Reason});
{'EXIT', Pid, Reason} when Pid == NMA;
Pid == NMB;
Pid == NMC;
@@ -457,70 +443,65 @@ run_tick_change_test(B, C, PrevTT, TT, PaDir) ->
Pid == NMA2;
Pid == NMB2;
Pid == NMC2 ->
- ?line stop_node(E),
+ stop_node(E),
- ?line exit({?LINE, {node(Pid), Reason}})
+ exit({?LINE, {node(Pid), Reason}})
after 0 ->
- ?line TT = net_kernel:get_net_ticktime(),
- ?line TT = rpc:call(B, net_kernel, get_net_ticktime, []),
- ?line TT = rpc:call(C, net_kernel, get_net_ticktime, []),
- ?line TT = rpc:call(E, net_kernel, get_net_ticktime, []),
- ?line stop_node(E),
- ?line ok
+ TT = net_kernel:get_net_ticktime(),
+ TT = rpc:call(B, net_kernel, get_net_ticktime, []),
+ TT = rpc:call(C, net_kernel, get_net_ticktime, []),
+ TT = rpc:call(E, net_kernel, get_net_ticktime, []),
+ stop_node(E),
+ ok
end.
%%
%% Basic tests of hidden node.
%%
-hidden_node(doc) ->
- ["Basic test of hidden node"];
-hidden_node(suite) ->
- [];
+%% Basic test of hidden node.
hidden_node(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(40)),
PaDir = filename:dirname(code:which(?MODULE)),
VArgs = "-pa " ++ PaDir,
HArgs = "-hidden -pa " ++ PaDir,
- ?line {ok, V} = start_node(visible_node, VArgs),
+ {ok, V} = start_node(visible_node, VArgs),
VMN = start_monitor_nodes_proc(V),
- ?line {ok, H} = start_node(hidden_node, HArgs),
- % Connect visible_node -> hidden_node
+ {ok, H} = start_node(hidden_node, HArgs),
+ %% Connect visible_node -> hidden_node
connect_nodes(V, H),
test_nodes(V, H),
stop_node(H),
sleep(5),
check_monitor_nodes_res(VMN, H),
stop_node(V),
- ?line {ok, H} = start_node(hidden_node, HArgs),
+ {ok, H} = start_node(hidden_node, HArgs),
HMN = start_monitor_nodes_proc(H),
- ?line {ok, V} = start_node(visible_node, VArgs),
- % Connect hidden_node -> visible_node
+ {ok, V} = start_node(visible_node, VArgs),
+ %% Connect hidden_node -> visible_node
connect_nodes(H, V),
test_nodes(V, H),
stop_node(V),
sleep(5),
check_monitor_nodes_res(HMN, V),
stop_node(H),
- ?line ?t:timetrap_cancel(Dog),
ok.
connect_nodes(A, B) ->
- % Check that they haven't already connected.
- ?line false = lists:member(A, rpc:call(B, erlang, nodes, [connected])),
- ?line false = lists:member(B, rpc:call(A, erlang, nodes, [connected])),
- % Connect them.
- ?line pong = rpc:call(A, net_adm, ping, [B]).
-
+ %% Check that they haven't already connected.
+ false = lists:member(A, rpc:call(B, erlang, nodes, [connected])),
+ false = lists:member(B, rpc:call(A, erlang, nodes, [connected])),
+ %% Connect them.
+ pong = rpc:call(A, net_adm, ping, [B]).
+
test_nodes(V, H) ->
- % No nodes should be visible on hidden_node
- ?line [] = rpc:call(H, erlang, nodes, []),
- % visible_node should be hidden on hidden_node
- ?line true = lists:member(V, rpc:call(H, erlang, nodes, [hidden])),
- % hidden_node node shouldn't be visible on visible_node
- ?line false = lists:member(H, rpc:call(V, erlang, nodes, [])),
- % hidden_node should be hidden on visible_node
- ?line true = lists:member(H, rpc:call(V, erlang, nodes, [hidden])).
+ %% No nodes should be visible on hidden_node
+ [] = rpc:call(H, erlang, nodes, []),
+ %% visible_node should be hidden on hidden_node
+ true = lists:member(V, rpc:call(H, erlang, nodes, [hidden])),
+ %% hidden_node node shouldn't be visible on visible_node
+ false = lists:member(H, rpc:call(V, erlang, nodes, [])),
+ %% hidden_node should be hidden on visible_node
+ true = lists:member(H, rpc:call(V, erlang, nodes, [hidden])).
mn_loop(MNs) ->
receive
@@ -548,21 +529,19 @@ start_monitor_nodes_proc(Node) ->
ok
end,
Pid.
-
+
check_monitor_nodes_res(Pid, Node) ->
Ref = make_ref(),
Pid ! {monitor_nodes_result, Ref, self()},
receive
{Ref, MNs} ->
- ?line false = lists:keysearch(Node, 2, MNs)
+ false = lists:keysearch(Node, 2, MNs)
end.
-inet_dist_options_options(suite) -> [];
-inet_dist_options_options(doc) ->
- ["Check the kernel inet_dist_{listen,connect}_options options"];
+%% Check the kernel inet_dist_{listen,connect}_options options.
inet_dist_options_options(Config) when is_list(Config) ->
Prio = 1,
case gen_udp:open(0, [{priority,Prio}]) of
@@ -571,7 +550,7 @@ inet_dist_options_options(Config) when is_list(Config) ->
{ok,[{priority,Prio}]} ->
ok = gen_udp:close(Socket),
do_inet_dist_options_options(Prio);
- _ ->
+ _ ->
ok = gen_udp:close(Socket),
{skip,
"Can not set priority "++integer_to_list(Prio)++
@@ -595,25 +574,25 @@ do_inet_dist_options_options(Prio) ->
"-hidden "
"-kernel inet_dist_connect_options "++PriorityString++" "
"-kernel inet_dist_listen_options "++PriorityString,
- ?line {ok,Node1} =
+ {ok,Node1} =
start_node(inet_dist_options_1, InetDistOptions),
- ?line {ok,Node2} =
+ {ok,Node2} =
start_node(inet_dist_options_2, InetDistOptions),
%%
- ?line pong =
+ pong =
rpc:call(Node1, net_adm, ping, [Node2]),
- ?line PrioritiesNode1 =
+ PrioritiesNode1 =
rpc:call(Node1, ?MODULE, get_socket_priorities, []),
- ?line PrioritiesNode2 =
+ PrioritiesNode2 =
rpc:call(Node2, ?MODULE, get_socket_priorities, []),
- ?line ?t:format("PrioritiesNode1 = ~p", [PrioritiesNode1]),
- ?line ?t:format("PrioritiesNode2 = ~p", [PrioritiesNode2]),
- ?line Elevated = [P || P <- PrioritiesNode1, P =:= Prio],
- ?line Elevated = [P || P <- PrioritiesNode2, P =:= Prio],
- ?line [_|_] = Elevated,
+ io:format("PrioritiesNode1 = ~p", [PrioritiesNode1]),
+ io:format("PrioritiesNode2 = ~p", [PrioritiesNode2]),
+ Elevated = [P || P <- PrioritiesNode1, P =:= Prio],
+ Elevated = [P || P <- PrioritiesNode2, P =:= Prio],
+ [_|_] = Elevated,
%%
- ?line stop_node(Node2),
- ?line stop_node(Node1),
+ stop_node(Node2),
+ stop_node(Node1),
ok.
get_socket_priorities() ->
@@ -624,185 +603,178 @@ get_socket_priorities() ->
element(2, erlang:port_info(Port, name)) =:= "tcp_inet"]].
-
+
%%
%% Testcase:
%% monitor_nodes_nodedown_reason
%%
-monitor_nodes_nodedown_reason(doc) -> [];
-monitor_nodes_nodedown_reason(suite) -> [];
monitor_nodes_nodedown_reason(Config) when is_list(Config) ->
- ?line MonNodeState = monitor_node_state(),
- ?line ok = net_kernel:monitor_nodes(true),
- ?line ok = net_kernel:monitor_nodes(true, [nodedown_reason]),
-
- ?line Names = get_numbered_nodenames(5, node),
- ?line [NN1, NN2, NN3, NN4, NN5] = Names,
-
- ?line {ok, N1} = start_node(NN1),
- ?line {ok, N2} = start_node(NN2),
- ?line {ok, N3} = start_node(NN3),
- ?line {ok, N4} = start_node(NN4, "-hidden"),
-
- ?line receive {nodeup, N1} -> ok end,
- ?line receive {nodeup, N2} -> ok end,
- ?line receive {nodeup, N3} -> ok end,
-
- ?line receive {nodeup, N1, []} -> ok end,
- ?line receive {nodeup, N2, []} -> ok end,
- ?line receive {nodeup, N3, []} -> ok end,
-
- ?line stop_node(N1),
- ?line stop_node(N4),
- ?line true = net_kernel:disconnect(N2),
- ?line TickTime = net_kernel:get_net_ticktime(),
- ?line SleepTime = TickTime + (TickTime div 4),
- ?line spawn(N3, fun () ->
- block_emu(SleepTime*1000),
- halt()
- end),
-
- ?line receive {nodedown, N1} -> ok end,
- ?line receive {nodedown, N2} -> ok end,
- ?line receive {nodedown, N3} -> ok end,
-
- ?line receive {nodedown, N1, [{nodedown_reason, R1}]} -> connection_closed = R1 end,
- ?line receive {nodedown, N2, [{nodedown_reason, R2}]} -> disconnect = R2 end,
- ?line receive {nodedown, N3, [{nodedown_reason, R3}]} -> net_tick_timeout = R3 end,
-
- ?line ok = net_kernel:monitor_nodes(false, [nodedown_reason]),
-
- ?line {ok, N5} = start_node(NN5),
- ?line stop_node(N5),
-
- ?line receive {nodeup, N5} -> ok end,
- ?line receive {nodedown, N5} -> ok end,
- ?line print_my_messages(),
- ?line ok = check_no_nodedown_nodeup(1000),
- ?line ok = net_kernel:monitor_nodes(false),
- ?line MonNodeState = monitor_node_state(),
- ?line ok.
-
-
-monitor_nodes_complex_nodedown_reason(doc) -> [];
-monitor_nodes_complex_nodedown_reason(suite) -> [];
+ MonNodeState = monitor_node_state(),
+ ok = net_kernel:monitor_nodes(true),
+ ok = net_kernel:monitor_nodes(true, [nodedown_reason]),
+
+ Names = get_numbered_nodenames(5, node),
+ [NN1, NN2, NN3, NN4, NN5] = Names,
+
+ {ok, N1} = start_node(NN1),
+ {ok, N2} = start_node(NN2),
+ {ok, N3} = start_node(NN3),
+ {ok, N4} = start_node(NN4, "-hidden"),
+
+ receive {nodeup, N1} -> ok end,
+ receive {nodeup, N2} -> ok end,
+ receive {nodeup, N3} -> ok end,
+
+ receive {nodeup, N1, []} -> ok end,
+ receive {nodeup, N2, []} -> ok end,
+ receive {nodeup, N3, []} -> ok end,
+
+ stop_node(N1),
+ stop_node(N4),
+ true = net_kernel:disconnect(N2),
+ TickTime = net_kernel:get_net_ticktime(),
+ SleepTime = TickTime + (TickTime div 4),
+ spawn(N3, fun () ->
+ block_emu(SleepTime*1000),
+ halt()
+ end),
+
+ receive {nodedown, N1} -> ok end,
+ receive {nodedown, N2} -> ok end,
+ receive {nodedown, N3} -> ok end,
+
+ receive {nodedown, N1, [{nodedown_reason, R1}]} -> connection_closed = R1 end,
+ receive {nodedown, N2, [{nodedown_reason, R2}]} -> disconnect = R2 end,
+ receive {nodedown, N3, [{nodedown_reason, R3}]} -> net_tick_timeout = R3 end,
+
+ ok = net_kernel:monitor_nodes(false, [nodedown_reason]),
+
+ {ok, N5} = start_node(NN5),
+ stop_node(N5),
+
+ receive {nodeup, N5} -> ok end,
+ receive {nodedown, N5} -> ok end,
+ print_my_messages(),
+ ok = check_no_nodedown_nodeup(1000),
+ ok = net_kernel:monitor_nodes(false),
+ MonNodeState = monitor_node_state(),
+ ok.
+
+
monitor_nodes_complex_nodedown_reason(Config) when is_list(Config) ->
- ?line MonNodeState = monitor_node_state(),
- ?line Me = self(),
- ?line ok = net_kernel:monitor_nodes(true, [nodedown_reason]),
- ?line [Name] = get_nodenames(1, monitor_nodes_complex_nodedown_reason),
- ?line {ok, Node} = start_node(Name, ""),
- ?line Pid = spawn(Node,
- fun() ->
- Me ! {stuff,
- self(),
- [make_ref(),
- {processes(), erlang:ports()}]}
- end),
- ?line receive {nodeup, Node, []} -> ok end,
- ?line {ok, NodeInfo} = net_kernel:node_info(Node),
- ?line {value,{owner, Owner}} = lists:keysearch(owner, 1, NodeInfo),
- ?line ComplexTerm = receive {stuff, Pid, _} = Msg ->
- {Msg, term_to_binary(Msg)}
- end,
- ?line exit(Owner, ComplexTerm),
- ?line receive
- {nodedown, Node, [{nodedown_reason, NodeDownReason}]} ->
- ?line ok
- end,
+ MonNodeState = monitor_node_state(),
+ Me = self(),
+ ok = net_kernel:monitor_nodes(true, [nodedown_reason]),
+ [Name] = get_nodenames(1, monitor_nodes_complex_nodedown_reason),
+ {ok, Node} = start_node(Name, ""),
+ Pid = spawn(Node,
+ fun() ->
+ Me ! {stuff,
+ self(),
+ [make_ref(),
+ {processes(), erlang:ports()}]}
+ end),
+ receive {nodeup, Node, []} -> ok end,
+ {ok, NodeInfo} = net_kernel:node_info(Node),
+ {value,{owner, Owner}} = lists:keysearch(owner, 1, NodeInfo),
+ ComplexTerm = receive {stuff, Pid, _} = Msg ->
+ {Msg, term_to_binary(Msg)}
+ end,
+ exit(Owner, ComplexTerm),
+ receive
+ {nodedown, Node, [{nodedown_reason, NodeDownReason}]} ->
+ ok
+ end,
%% If the complex nodedown_reason messed something up garbage collections
%% are likely to dump core
- ?line garbage_collect(),
- ?line garbage_collect(),
- ?line garbage_collect(),
- ?line ComplexTerm = NodeDownReason,
- ?line ok = net_kernel:monitor_nodes(false, [nodedown_reason]),
- ?line no_msgs(),
- ?line MonNodeState = monitor_node_state(),
- ?line ok.
-
-
-
+ garbage_collect(),
+ garbage_collect(),
+ garbage_collect(),
+ ComplexTerm = NodeDownReason,
+ ok = net_kernel:monitor_nodes(false, [nodedown_reason]),
+ no_msgs(),
+ MonNodeState = monitor_node_state(),
+ ok.
+
+
+
%%
%% Testcase:
%% monitor_nodes_node_type
%%
-monitor_nodes_node_type(doc) -> [];
-monitor_nodes_node_type(suite) -> [];
monitor_nodes_node_type(Config) when is_list(Config) ->
- ?line MonNodeState = monitor_node_state(),
- ?line ok = net_kernel:monitor_nodes(true),
- ?line ok = net_kernel:monitor_nodes(true, [{node_type, all}]),
- ?line Names = get_numbered_nodenames(9, node),
-% ?line ?t:format("Names: ~p~n", [Names]),
- ?line [NN1, NN2, NN3, NN4, NN5, NN6, NN7, NN8, NN9] = Names,
-
- ?line {ok, N1} = start_node(NN1),
- ?line {ok, N2} = start_node(NN2),
- ?line {ok, N3} = start_node(NN3, "-hidden"),
- ?line {ok, N4} = start_node(NN4, "-hidden"),
-
- ?line receive {nodeup, N1} -> ok end,
- ?line receive {nodeup, N2} -> ok end,
-
- ?line receive {nodeup, N1, [{node_type, visible}]} -> ok end,
- ?line receive {nodeup, N2, [{node_type, visible}]} -> ok end,
- ?line receive {nodeup, N3, [{node_type, hidden}]} -> ok end,
- ?line receive {nodeup, N4, [{node_type, hidden}]} -> ok end,
-
- ?line stop_node(N1),
- ?line stop_node(N2),
- ?line stop_node(N3),
- ?line stop_node(N4),
-
- ?line receive {nodedown, N1} -> ok end,
- ?line receive {nodedown, N2} -> ok end,
-
- ?line receive {nodedown, N1, [{node_type, visible}]} -> ok end,
- ?line receive {nodedown, N2, [{node_type, visible}]} -> ok end,
- ?line receive {nodedown, N3, [{node_type, hidden}]} -> ok end,
- ?line receive {nodedown, N4, [{node_type, hidden}]} -> ok end,
-
- ?line ok = net_kernel:monitor_nodes(false, [{node_type, all}]),
- ?line {ok, N5} = start_node(NN5),
-
- ?line receive {nodeup, N5} -> ok end,
- ?line stop_node(N5),
- ?line receive {nodedown, N5} -> ok end,
-
- ?line ok = net_kernel:monitor_nodes(true, [{node_type, hidden}]),
- ?line {ok, N6} = start_node(NN6),
- ?line {ok, N7} = start_node(NN7, "-hidden"),
-
-
- ?line receive {nodeup, N6} -> ok end,
- ?line receive {nodeup, N7, [{node_type, hidden}]} -> ok end,
- ?line stop_node(N6),
- ?line stop_node(N7),
-
- ?line receive {nodedown, N6} -> ok end,
- ?line receive {nodedown, N7, [{node_type, hidden}]} -> ok end,
-
- ?line ok = net_kernel:monitor_nodes(true, [{node_type, visible}]),
- ?line ok = net_kernel:monitor_nodes(false, [{node_type, hidden}]),
- ?line ok = net_kernel:monitor_nodes(false),
-
- ?line {ok, N8} = start_node(NN8),
- ?line {ok, N9} = start_node(NN9, "-hidden"),
-
- ?line receive {nodeup, N8, [{node_type, visible}]} -> ok end,
- ?line stop_node(N8),
- ?line stop_node(N9),
-
- ?line receive {nodedown, N8, [{node_type, visible}]} -> ok end,
- ?line print_my_messages(),
- ?line ok = check_no_nodedown_nodeup(1000),
- ?line ok = net_kernel:monitor_nodes(false, [{node_type, visible}]),
- ?line MonNodeState = monitor_node_state(),
- ?line ok.
+ MonNodeState = monitor_node_state(),
+ ok = net_kernel:monitor_nodes(true),
+ ok = net_kernel:monitor_nodes(true, [{node_type, all}]),
+ Names = get_numbered_nodenames(9, node),
+ [NN1, NN2, NN3, NN4, NN5, NN6, NN7, NN8, NN9] = Names,
+
+ {ok, N1} = start_node(NN1),
+ {ok, N2} = start_node(NN2),
+ {ok, N3} = start_node(NN3, "-hidden"),
+ {ok, N4} = start_node(NN4, "-hidden"),
+
+ receive {nodeup, N1} -> ok end,
+ receive {nodeup, N2} -> ok end,
+
+ receive {nodeup, N1, [{node_type, visible}]} -> ok end,
+ receive {nodeup, N2, [{node_type, visible}]} -> ok end,
+ receive {nodeup, N3, [{node_type, hidden}]} -> ok end,
+ receive {nodeup, N4, [{node_type, hidden}]} -> ok end,
+
+ stop_node(N1),
+ stop_node(N2),
+ stop_node(N3),
+ stop_node(N4),
+
+ receive {nodedown, N1} -> ok end,
+ receive {nodedown, N2} -> ok end,
+
+ receive {nodedown, N1, [{node_type, visible}]} -> ok end,
+ receive {nodedown, N2, [{node_type, visible}]} -> ok end,
+ receive {nodedown, N3, [{node_type, hidden}]} -> ok end,
+ receive {nodedown, N4, [{node_type, hidden}]} -> ok end,
+
+ ok = net_kernel:monitor_nodes(false, [{node_type, all}]),
+ {ok, N5} = start_node(NN5),
+
+ receive {nodeup, N5} -> ok end,
+ stop_node(N5),
+ receive {nodedown, N5} -> ok end,
+
+ ok = net_kernel:monitor_nodes(true, [{node_type, hidden}]),
+ {ok, N6} = start_node(NN6),
+ {ok, N7} = start_node(NN7, "-hidden"),
+
+
+ receive {nodeup, N6} -> ok end,
+ receive {nodeup, N7, [{node_type, hidden}]} -> ok end,
+ stop_node(N6),
+ stop_node(N7),
+
+ receive {nodedown, N6} -> ok end,
+ receive {nodedown, N7, [{node_type, hidden}]} -> ok end,
+
+ ok = net_kernel:monitor_nodes(true, [{node_type, visible}]),
+ ok = net_kernel:monitor_nodes(false, [{node_type, hidden}]),
+ ok = net_kernel:monitor_nodes(false),
+
+ {ok, N8} = start_node(NN8),
+ {ok, N9} = start_node(NN9, "-hidden"),
+
+ receive {nodeup, N8, [{node_type, visible}]} -> ok end,
+ stop_node(N8),
+ stop_node(N9),
+
+ receive {nodedown, N8, [{node_type, visible}]} -> ok end,
+ print_my_messages(),
+ ok = check_no_nodedown_nodeup(1000),
+ ok = net_kernel:monitor_nodes(false, [{node_type, visible}]),
+ MonNodeState = monitor_node_state(),
+ ok.
%%
@@ -810,95 +782,89 @@ monitor_nodes_node_type(Config) when is_list(Config) ->
%% monitor_nodes
%%
-monitor_nodes_misc(doc) -> [];
-monitor_nodes_misc(suite) -> [];
monitor_nodes_misc(Config) when is_list(Config) ->
- ?line MonNodeState = monitor_node_state(),
- ?line ok = net_kernel:monitor_nodes(true),
- ?line ok = net_kernel:monitor_nodes(true, [{node_type, all}, nodedown_reason]),
- ?line ok = net_kernel:monitor_nodes(true, [nodedown_reason, {node_type, all}]),
- ?line Names = get_numbered_nodenames(3, node),
-% ?line ?t:format("Names: ~p~n", [Names]),
- ?line [NN1, NN2, NN3] = Names,
-
- ?line {ok, N1} = start_node(NN1),
- ?line {ok, N2} = start_node(NN2, "-hidden"),
-
- ?line receive {nodeup, N1} -> ok end,
-
- ?line receive {nodeup, N1, [{node_type, visible}]} -> ok end,
- ?line receive {nodeup, N1, [{node_type, visible}]} -> ok end,
- ?line receive {nodeup, N2, [{node_type, hidden}]} -> ok end,
- ?line receive {nodeup, N2, [{node_type, hidden}]} -> ok end,
-
- ?line stop_node(N1),
- ?line stop_node(N2),
-
- ?line VisbleDownInfo = lists:sort([{node_type, visible},
- {nodedown_reason, connection_closed}]),
- ?line HiddenDownInfo = lists:sort([{node_type, hidden},
- {nodedown_reason, connection_closed}]),
-
- ?line receive {nodedown, N1} -> ok end,
-
- ?line receive {nodedown, N1, Info1A} -> VisbleDownInfo = lists:sort(Info1A) end,
- ?line receive {nodedown, N1, Info1B} -> VisbleDownInfo = lists:sort(Info1B) end,
- ?line receive {nodedown, N2, Info2A} -> HiddenDownInfo = lists:sort(Info2A) end,
- ?line receive {nodedown, N2, Info2B} -> HiddenDownInfo = lists:sort(Info2B) end,
-
- ?line ok = net_kernel:monitor_nodes(false, [{node_type, all}, nodedown_reason]),
-
- ?line {ok, N3} = start_node(NN3),
- ?line receive {nodeup, N3} -> ok end,
- ?line stop_node(N3),
- ?line receive {nodedown, N3} -> ok end,
- ?line print_my_messages(),
- ?line ok = check_no_nodedown_nodeup(1000),
- ?line ok = net_kernel:monitor_nodes(false),
- ?line MonNodeState = monitor_node_state(),
- ?line ok.
-
-
-monitor_nodes_otp_6481(doc) ->
- ["Tests that {nodeup, Node} messages are received before "
- "messages from Node and that {nodedown, Node} messages are"
- "received after messages from Node"];
-monitor_nodes_otp_6481(suite) ->
- [];
+ MonNodeState = monitor_node_state(),
+ ok = net_kernel:monitor_nodes(true),
+ ok = net_kernel:monitor_nodes(true, [{node_type, all}, nodedown_reason]),
+ ok = net_kernel:monitor_nodes(true, [nodedown_reason, {node_type, all}]),
+ Names = get_numbered_nodenames(3, node),
+ [NN1, NN2, NN3] = Names,
+
+ {ok, N1} = start_node(NN1),
+ {ok, N2} = start_node(NN2, "-hidden"),
+
+ receive {nodeup, N1} -> ok end,
+
+ receive {nodeup, N1, [{node_type, visible}]} -> ok end,
+ receive {nodeup, N1, [{node_type, visible}]} -> ok end,
+ receive {nodeup, N2, [{node_type, hidden}]} -> ok end,
+ receive {nodeup, N2, [{node_type, hidden}]} -> ok end,
+
+ stop_node(N1),
+ stop_node(N2),
+
+ VisbleDownInfo = lists:sort([{node_type, visible},
+ {nodedown_reason, connection_closed}]),
+ HiddenDownInfo = lists:sort([{node_type, hidden},
+ {nodedown_reason, connection_closed}]),
+
+ receive {nodedown, N1} -> ok end,
+
+ receive {nodedown, N1, Info1A} -> VisbleDownInfo = lists:sort(Info1A) end,
+ receive {nodedown, N1, Info1B} -> VisbleDownInfo = lists:sort(Info1B) end,
+ receive {nodedown, N2, Info2A} -> HiddenDownInfo = lists:sort(Info2A) end,
+ receive {nodedown, N2, Info2B} -> HiddenDownInfo = lists:sort(Info2B) end,
+
+ ok = net_kernel:monitor_nodes(false, [{node_type, all}, nodedown_reason]),
+
+ {ok, N3} = start_node(NN3),
+ receive {nodeup, N3} -> ok end,
+ stop_node(N3),
+ receive {nodedown, N3} -> ok end,
+ print_my_messages(),
+ ok = check_no_nodedown_nodeup(1000),
+ ok = net_kernel:monitor_nodes(false),
+ MonNodeState = monitor_node_state(),
+ ok.
+
+
+%% Tests that {nodeup, Node} messages are received before
+%% messages from Node and that {nodedown, Node} messages are
+%% received after messages from Node.
monitor_nodes_otp_6481(Config) when is_list(Config) ->
- ?line ?t:format("Testing nodedown...~n"),
- ?line monitor_nodes_otp_6481_test(Config, nodedown),
- ?line ?t:format("ok~n"),
- ?line ?t:format("Testing nodeup...~n"),
- ?line monitor_nodes_otp_6481_test(Config, nodeup),
- ?line ?t:format("ok~n"),
- ?line ok.
+ io:format("Testing nodedown...~n"),
+ monitor_nodes_otp_6481_test(Config, nodedown),
+ io:format("ok~n"),
+ io:format("Testing nodeup...~n"),
+ monitor_nodes_otp_6481_test(Config, nodeup),
+ io:format("ok~n"),
+ ok.
monitor_nodes_otp_6481_test(Config, TestType) when is_list(Config) ->
- ?line MonNodeState = monitor_node_state(),
- ?line NodeMsg = make_ref(),
- ?line Me = self(),
- ?line [Name] = get_nodenames(1, monitor_nodes_otp_6481),
- ?line case TestType of
- nodedown -> ?line ok = net_kernel:monitor_nodes(true);
- nodeup -> ?line ok
- end,
- ?line Seq = lists:seq(1,10000),
- ?line MN = spawn_link(
- fun () ->
- ?line lists:foreach(
- fun (_) ->
- ?line ok = net_kernel:monitor_nodes(true)
- end,
- Seq),
- ?line Me ! {mon_set, self()},
- ?line receive after infinity -> ok end
- end),
- ?line receive {mon_set, MN} -> ok end,
- ?line case TestType of
- nodedown -> ?line ok;
- nodeup -> ?line ok = net_kernel:monitor_nodes(true)
- end,
+ MonNodeState = monitor_node_state(),
+ NodeMsg = make_ref(),
+ Me = self(),
+ [Name] = get_nodenames(1, monitor_nodes_otp_6481),
+ case TestType of
+ nodedown -> ok = net_kernel:monitor_nodes(true);
+ nodeup -> ok
+ end,
+ Seq = lists:seq(1,10000),
+ MN = spawn_link(
+ fun () ->
+ lists:foreach(
+ fun (_) ->
+ ok = net_kernel:monitor_nodes(true)
+ end,
+ Seq),
+ Me ! {mon_set, self()},
+ receive after infinity -> ok end
+ end),
+ receive {mon_set, MN} -> ok end,
+ case TestType of
+ nodedown -> ok;
+ nodeup -> ok = net_kernel:monitor_nodes(true)
+ end,
%% Whitebox:
%% nodedown test: Since this process was the first one monitoring
@@ -909,60 +875,60 @@ monitor_nodes_otp_6481_test(Config, TestType) when is_list(Config) ->
%% on nodeup
%% Verify the monitor_nodes order expected
- ?line TestMonNodeState = monitor_node_state(),
- %?line ?t:format("~p~n", [TestMonNodeState]),
- ?line TestMonNodeState =
+ TestMonNodeState = monitor_node_state(),
+ %% io:format("~p~n", [TestMonNodeState]),
+ TestMonNodeState =
MonNodeState
++ case TestType of
- nodedown -> [{self(), []}];
- nodeup -> []
+ nodedown -> [{self(), []}];
+ nodeup -> []
end
++ lists:map(fun (_) -> {MN, []} end, Seq)
++ case TestType of
- nodedown -> [];
- nodeup -> [{self(), []}]
+ nodedown -> [];
+ nodeup -> [{self(), []}]
end,
- ?line {ok, Node} = start_node(Name, "", this),
- ?line receive {nodeup, Node} -> ok end,
-
- ?line RemotePid = spawn(Node,
- fun () ->
- receive after 1500 -> ok end,
- % infinit loop of msgs
- % we want an endless stream of messages and the kill
- % the node mercilessly.
- % We then want to ensure that the nodedown message arrives
- % last ... without garbage after it.
- _ = spawn(fun() -> node_loop_send(Me, NodeMsg, 1) end),
- receive {Me, kill_it} -> ok end,
- halt()
- end),
+ {ok, Node} = start_node(Name, "", this),
+ receive {nodeup, Node} -> ok end,
+
+ RemotePid = spawn(Node,
+ fun () ->
+ receive after 1500 -> ok end,
+ %% infinit loop of msgs
+ %% we want an endless stream of messages and the kill
+ %% the node mercilessly.
+ %% We then want to ensure that the nodedown message arrives
+ %% last ... without garbage after it.
+ _ = spawn(fun() -> node_loop_send(Me, NodeMsg, 1) end),
+ receive {Me, kill_it} -> ok end,
+ halt()
+ end),
- ?line net_kernel:disconnect(Node),
- ?line receive {nodedown, Node} -> ok end,
+ net_kernel:disconnect(Node),
+ receive {nodedown, Node} -> ok end,
%% Verify that '{nodeup, Node}' comes before '{NodeMsg, 1}' (the message
%% bringing up the connection).
- ?line no_msgs(500),
- ?line {nodeup, Node} = receive Msg1 -> Msg1 end,
- ?line {NodeMsg, 1} = receive Msg2 -> Msg2 end,
- % msg stream has begun, kill the node
- ?line RemotePid ! {self(), kill_it},
+ no_msgs(500),
+ {nodeup, Node} = receive Msg1 -> Msg1 end,
+ {NodeMsg, 1} = receive Msg2 -> Msg2 end,
+ %% msg stream has begun, kill the node
+ RemotePid ! {self(), kill_it},
%% Verify that '{nodedown, Node}' comes after the last '{NodeMsg, N}'
%% message.
- ?line {nodedown, Node} = flush_node_msgs(NodeMsg, 2),
- ?line no_msgs(500),
-
- ?line Mon = erlang:monitor(process, MN),
- ?line unlink(MN),
- ?line exit(MN, bang),
- ?line receive {'DOWN', Mon, process, MN, bang} -> ok end,
- ?line ok = net_kernel:monitor_nodes(false),
- ?line MonNodeState = monitor_node_state(),
- ?line ok.
+ {nodedown, Node} = flush_node_msgs(NodeMsg, 2),
+ no_msgs(500),
+
+ Mon = erlang:monitor(process, MN),
+ unlink(MN),
+ exit(MN, bang),
+ receive {'DOWN', Mon, process, MN, bang} -> ok end,
+ ok = net_kernel:monitor_nodes(false),
+ MonNodeState = monitor_node_state(),
+ ok.
flush_node_msgs(NodeMsg, No) ->
case receive Msg -> Msg end of
@@ -974,105 +940,97 @@ node_loop_send(Pid, Msg, No) ->
Pid ! {Msg, No},
node_loop_send(Pid, Msg, No + 1).
-monitor_nodes_errors(doc) ->
- [];
-monitor_nodes_errors(suite) ->
- [];
monitor_nodes_errors(Config) when is_list(Config) ->
- ?line MonNodeState = monitor_node_state(),
- ?line error = net_kernel:monitor_nodes(asdf),
- ?line {error,
- {unknown_options,
- [gurka]}} = net_kernel:monitor_nodes(true,
- [gurka]),
- ?line {error,
- {options_not_a_list,
- gurka}} = net_kernel:monitor_nodes(true,
- gurka),
- ?line {error,
- {option_value_mismatch,
- [{node_type,visible},
- {node_type,hidden}]}}
+ MonNodeState = monitor_node_state(),
+ error = net_kernel:monitor_nodes(asdf),
+ {error,
+ {unknown_options,
+ [gurka]}} = net_kernel:monitor_nodes(true,
+ [gurka]),
+ {error,
+ {options_not_a_list,
+ gurka}} = net_kernel:monitor_nodes(true,
+ gurka),
+ {error,
+ {option_value_mismatch,
+ [{node_type,visible},
+ {node_type,hidden}]}}
= net_kernel:monitor_nodes(true,
[{node_type,hidden},
{node_type,visible}]),
- ?line {error,
- {option_value_mismatch,
- [{node_type,visible},
- {node_type,all}]}}
+ {error,
+ {option_value_mismatch,
+ [{node_type,visible},
+ {node_type,all}]}}
= net_kernel:monitor_nodes(true,
[{node_type,all},
{node_type,visible}]),
- ?line {error,
- {bad_option_value,
- {node_type,
- blaha}}}
+ {error,
+ {bad_option_value,
+ {node_type,
+ blaha}}}
= net_kernel:monitor_nodes(true, [{node_type, blaha}]),
- ?line MonNodeState = monitor_node_state(),
- ?line ok.
+ MonNodeState = monitor_node_state(),
+ ok.
-monitor_nodes_combinations(doc) ->
- [];
-monitor_nodes_combinations(suite) ->
- [];
monitor_nodes_combinations(Config) when is_list(Config) ->
- ?line MonNodeState = monitor_node_state(),
- ?line monitor_nodes_all_comb(true),
- ?line [VisibleName, HiddenName] = get_nodenames(2,
- monitor_nodes_combinations),
- ?line {ok, Visible} = start_node(VisibleName, ""),
- ?line receive_all_comb_nodeup_msgs(visible, Visible),
- ?line no_msgs(),
- ?line stop_node(Visible),
- ?line receive_all_comb_nodedown_msgs(visible, Visible, connection_closed),
- ?line no_msgs(),
- ?line {ok, Hidden} = start_node(HiddenName, "-hidden"),
- ?line receive_all_comb_nodeup_msgs(hidden, Hidden),
- ?line no_msgs(),
- ?line stop_node(Hidden),
- ?line receive_all_comb_nodedown_msgs(hidden, Hidden, connection_closed),
- ?line no_msgs(),
- ?line monitor_nodes_all_comb(false),
- ?line MonNodeState = monitor_node_state(),
- ?line no_msgs(),
- ?line ok.
+ MonNodeState = monitor_node_state(),
+ monitor_nodes_all_comb(true),
+ [VisibleName, HiddenName] = get_nodenames(2,
+ monitor_nodes_combinations),
+ {ok, Visible} = start_node(VisibleName, ""),
+ receive_all_comb_nodeup_msgs(visible, Visible),
+ no_msgs(),
+ stop_node(Visible),
+ receive_all_comb_nodedown_msgs(visible, Visible, connection_closed),
+ no_msgs(),
+ {ok, Hidden} = start_node(HiddenName, "-hidden"),
+ receive_all_comb_nodeup_msgs(hidden, Hidden),
+ no_msgs(),
+ stop_node(Hidden),
+ receive_all_comb_nodedown_msgs(hidden, Hidden, connection_closed),
+ no_msgs(),
+ monitor_nodes_all_comb(false),
+ MonNodeState = monitor_node_state(),
+ no_msgs(),
+ ok.
monitor_nodes_all_comb(Flag) ->
- ?line ok = net_kernel:monitor_nodes(Flag),
- ?line ok = net_kernel:monitor_nodes(Flag,
- [nodedown_reason]),
- ?line ok = net_kernel:monitor_nodes(Flag,
- [{node_type, hidden}]),
- ?line ok = net_kernel:monitor_nodes(Flag,
- [{node_type, visible}]),
- ?line ok = net_kernel:monitor_nodes(Flag,
- [{node_type, all}]),
- ?line ok = net_kernel:monitor_nodes(Flag,
- [nodedown_reason,
- {node_type, hidden}]),
- ?line ok = net_kernel:monitor_nodes(Flag,
- [nodedown_reason,
- {node_type, visible}]),
- ?line ok = net_kernel:monitor_nodes(Flag,
- [nodedown_reason,
- {node_type, all}]),
+ ok = net_kernel:monitor_nodes(Flag),
+ ok = net_kernel:monitor_nodes(Flag,
+ [nodedown_reason]),
+ ok = net_kernel:monitor_nodes(Flag,
+ [{node_type, hidden}]),
+ ok = net_kernel:monitor_nodes(Flag,
+ [{node_type, visible}]),
+ ok = net_kernel:monitor_nodes(Flag,
+ [{node_type, all}]),
+ ok = net_kernel:monitor_nodes(Flag,
+ [nodedown_reason,
+ {node_type, hidden}]),
+ ok = net_kernel:monitor_nodes(Flag,
+ [nodedown_reason,
+ {node_type, visible}]),
+ ok = net_kernel:monitor_nodes(Flag,
+ [nodedown_reason,
+ {node_type, all}]),
%% There currently are 8 different combinations
- ?line 8.
+ 8.
receive_all_comb_nodeup_msgs(visible, Node) ->
- ?t:format("Receive nodeup visible...~n"),
+ io:format("Receive nodeup visible...~n"),
Exp = [{nodeup, Node},
{nodeup, Node, []}]
++ mk_exp_mn_all_comb_nodeup_msgs_common(visible, Node),
receive_mn_msgs(Exp),
- ?t:format("ok~n"),
+ io:format("ok~n"),
ok;
receive_all_comb_nodeup_msgs(hidden, Node) ->
- ?t:format("Receive nodeup hidden...~n"),
+ io:format("Receive nodeup hidden...~n"),
Exp = mk_exp_mn_all_comb_nodeup_msgs_common(hidden, Node),
receive_mn_msgs(Exp),
- ?t:format("ok~n"),
+ io:format("ok~n"),
ok.
mk_exp_mn_all_comb_nodeup_msgs_common(Type, Node) ->
@@ -1083,20 +1041,20 @@ mk_exp_mn_all_comb_nodeup_msgs_common(Type, Node) ->
{nodeup, Node, InfoNt}].
receive_all_comb_nodedown_msgs(visible, Node, Reason) ->
- ?t:format("Receive nodedown visible...~n"),
+ io:format("Receive nodedown visible...~n"),
Exp = [{nodedown, Node},
{nodedown, Node, [{nodedown_reason, Reason}]}]
++ mk_exp_mn_all_comb_nodedown_msgs_common(visible,
Node,
Reason),
receive_mn_msgs(Exp),
- ?t:format("ok~n"),
+ io:format("ok~n"),
ok;
receive_all_comb_nodedown_msgs(hidden, Node, Reason) ->
- ?t:format("Receive nodedown hidden...~n"),
+ io:format("Receive nodedown hidden...~n"),
Exp = mk_exp_mn_all_comb_nodedown_msgs_common(hidden, Node, Reason),
receive_mn_msgs(Exp),
- ?t:format("ok~n"),
+ io:format("ok~n"),
ok.
mk_exp_mn_all_comb_nodedown_msgs_common(Type, Node, Reason) ->
@@ -1110,81 +1068,73 @@ mk_exp_mn_all_comb_nodedown_msgs_common(Type, Node, Reason) ->
receive_mn_msgs([]) ->
ok;
receive_mn_msgs(Msgs) ->
- ?t:format("Expecting msgs: ~p~n", [Msgs]),
+ io:format("Expecting msgs: ~p~n", [Msgs]),
receive
{_Dir, _Node} = Msg ->
- ?t:format("received ~p~n", [Msg]),
+ io:format("received ~p~n", [Msg]),
case lists:member(Msg, Msgs) of
true -> receive_mn_msgs(lists:delete(Msg, Msgs));
- false -> ?t:fail({unexpected_message, Msg,
+ false -> ct:fail({unexpected_message, Msg,
expected_messages, Msgs})
end;
{Dir, Node, Info} ->
Msg = {Dir, Node, lists:sort(Info)},
- ?t:format("received ~p~n", [Msg]),
+ io:format("received ~p~n", [Msg]),
case lists:member(Msg, Msgs) of
true -> receive_mn_msgs(lists:delete(Msg, Msgs));
- false -> ?t:fail({unexpected_message, Msg,
+ false -> ct:fail({unexpected_message, Msg,
expected_messages, Msgs})
end;
Msg ->
- ?t:format("received ~p~n", [Msg]),
- ?t:fail({unexpected_message, Msg,
+ io:format("received ~p~n", [Msg]),
+ ct:fail({unexpected_message, Msg,
expected_messages, Msgs})
end.
-monitor_nodes_cleanup(doc) ->
- [];
-monitor_nodes_cleanup(suite) ->
- [];
monitor_nodes_cleanup(Config) when is_list(Config) ->
- ?line MonNodeState = monitor_node_state(),
- ?line Me = self(),
- ?line No = monitor_nodes_all_comb(true),
- ?line Inf = spawn(fun () ->
- monitor_nodes_all_comb(true),
- Me ! {mons_set, self()},
- receive after infinity -> ok end
- end),
- ?line TO = spawn(fun () ->
- monitor_nodes_all_comb(true),
- Me ! {mons_set, self()},
- receive after 500 -> ok end
- end),
- ?line receive {mons_set, Inf} -> ok end,
- ?line receive {mons_set, TO} -> ok end,
- ?line MNLen = length(MonNodeState) + No*3,
- ?line MNLen = length(monitor_node_state()),
- ?line MonInf = erlang:monitor(process, Inf),
- ?line MonTO = erlang:monitor(process, TO),
- ?line exit(Inf, bang),
- ?line No = monitor_nodes_all_comb(false),
- ?line receive {'DOWN', MonInf, process, Inf, bang} -> ok end,
- ?line receive {'DOWN', MonTO, process, TO, normal} -> ok end,
- ?line MonNodeState = monitor_node_state(),
- ?line no_msgs(),
- ?line ok.
-
-monitor_nodes_many(doc) ->
- [];
-monitor_nodes_many(suite) ->
- [];
+ MonNodeState = monitor_node_state(),
+ Me = self(),
+ No = monitor_nodes_all_comb(true),
+ Inf = spawn(fun () ->
+ monitor_nodes_all_comb(true),
+ Me ! {mons_set, self()},
+ receive after infinity -> ok end
+ end),
+ TO = spawn(fun () ->
+ monitor_nodes_all_comb(true),
+ Me ! {mons_set, self()},
+ receive after 500 -> ok end
+ end),
+ receive {mons_set, Inf} -> ok end,
+ receive {mons_set, TO} -> ok end,
+ MNLen = length(MonNodeState) + No*3,
+ MNLen = length(monitor_node_state()),
+ MonInf = erlang:monitor(process, Inf),
+ MonTO = erlang:monitor(process, TO),
+ exit(Inf, bang),
+ No = monitor_nodes_all_comb(false),
+ receive {'DOWN', MonInf, process, Inf, bang} -> ok end,
+ receive {'DOWN', MonTO, process, TO, normal} -> ok end,
+ MonNodeState = monitor_node_state(),
+ no_msgs(),
+ ok.
+
monitor_nodes_many(Config) when is_list(Config) ->
- ?line MonNodeState = monitor_node_state(),
- ?line [Name] = get_nodenames(1, monitor_nodes_many),
+ MonNodeState = monitor_node_state(),
+ [Name] = get_nodenames(1, monitor_nodes_many),
%% We want to perform more than 2^16 net_kernel:monitor_nodes
%% since this will wrap an internal counter
- ?line No = (1 bsl 16) + 17,
- ?line repeat(fun () -> ok = net_kernel:monitor_nodes(true) end, No),
- ?line No = length(monitor_node_state()) - length(MonNodeState),
- ?line {ok, Node} = start_node(Name),
- ?line repeat(fun () -> receive {nodeup, Node} -> ok end end, No),
- ?line stop_node(Node),
- ?line repeat(fun () -> receive {nodedown, Node} -> ok end end, No),
- ?line ok = net_kernel:monitor_nodes(false),
- ?line no_msgs(10),
- ?line MonNodeState = monitor_node_state(),
- ?line ok.
+ No = (1 bsl 16) + 17,
+ repeat(fun () -> ok = net_kernel:monitor_nodes(true) end, No),
+ No = length(monitor_node_state()) - length(MonNodeState),
+ {ok, Node} = start_node(Name),
+ repeat(fun () -> receive {nodeup, Node} -> ok end end, No),
+ stop_node(Node),
+ repeat(fun () -> receive {nodedown, Node} -> ok end end, No),
+ ok = net_kernel:monitor_nodes(false),
+ no_msgs(10),
+ MonNodeState = monitor_node_state(),
+ ok.
%% Misc. functions
@@ -1196,59 +1146,45 @@ monitor_node_state() ->
check_no_nodedown_nodeup(TimeOut) ->
- ?line receive
- {nodeup, _, _} = Msg -> ?line ?t:fail({unexpected_nodeup, Msg});
- {nodeup, _} = Msg -> ?line ?t:fail({unexpected_nodeup, Msg});
- {nodedown, _, _} = Msg -> ?line ?t:fail({unexpected_nodedown, Msg});
- {nodedown, _} = Msg -> ?line ?t:fail({unexpected_nodedown, Msg})
- after TimeOut ->
- ok
- end.
+ receive
+ {nodeup, _, _} = Msg -> ct:fail({unexpected_nodeup, Msg});
+ {nodeup, _} = Msg -> ct:fail({unexpected_nodeup, Msg});
+ {nodedown, _, _} = Msg -> ct:fail({unexpected_nodedown, Msg});
+ {nodedown, _} = Msg -> ct:fail({unexpected_nodedown, Msg})
+ after TimeOut ->
+ ok
+ end.
print_my_messages() ->
- ?line {messages, Messages} = process_info(self(), messages),
- ?line ?t:format("Messages: ~p~n", [Messages]),
- ?line ok.
+ {messages, Messages} = process_info(self(), messages),
+ io:format("Messages: ~p~n", [Messages]),
+ ok.
sleep(T) -> receive after T * 1000 -> ok end.
start_node(Name, Param, this) ->
NewParam = Param ++ " -pa " ++ filename:dirname(code:which(?MODULE)),
- ?t:start_node(Name, peer, [{args, NewParam}, {erl, [this]}]);
+ test_server:start_node(Name, peer, [{args, NewParam}, {erl, [this]}]);
start_node(Name, Param, "this") ->
NewParam = Param ++ " -pa " ++ filename:dirname(code:which(?MODULE)),
- ?t:start_node(Name, peer, [{args, NewParam}, {erl, [this]}]);
+ test_server:start_node(Name, peer, [{args, NewParam}, {erl, [this]}]);
start_node(Name, Param, Rel) when is_atom(Rel) ->
NewParam = Param ++ " -pa " ++ filename:dirname(code:which(?MODULE)),
- ?t:start_node(Name, peer, [{args, NewParam}, {erl, [{release, atom_to_list(Rel)}]}]);
+ test_server:start_node(Name, peer, [{args, NewParam}, {erl, [{release, atom_to_list(Rel)}]}]);
start_node(Name, Param, Rel) when is_list(Rel) ->
NewParam = Param ++ " -pa " ++ filename:dirname(code:which(?MODULE)),
- ?t:start_node(Name, peer, [{args, NewParam}, {erl, [{release, Rel}]}]).
+ test_server:start_node(Name, peer, [{args, NewParam}, {erl, [{release, Rel}]}]).
start_node(Name, Param) ->
NewParam = Param ++ " -pa " ++ filename:dirname(code:which(?MODULE)),
- ?t:start_node(Name, slave, [{args, NewParam}]).
-% M = list_to_atom(from($@, atom_to_list(node()))),
-% slave:start_link(M, Name, Param).
+ test_server:start_node(Name, slave, [{args, NewParam}]).
start_node(Name) ->
start_node(Name, "").
stop_node(Node) ->
- ?t:stop_node(Node).
-% erlang:monitor_node(Node, true),
-% rpc:cast(Node, init, stop, []),
-% receive
-% {nodedown, Node} ->
-% ok
-% after 10000 ->
-% test_server:fail({stop_node, Node})
-% end.
-
-% from(H, [H | T]) -> T;
-% from(H, [_ | T]) -> from(H, T);
-% from(H, []) -> [].
+ test_server:stop_node(Node).
get_nodenames(N, T) ->
get_nodenames(N, T, []).
diff --git a/lib/kernel/test/erl_distribution_wb_SUITE.erl b/lib/kernel/test/erl_distribution_wb_SUITE.erl
index e453cb2cdd..dc60b8b9e9 100644
--- a/lib/kernel/test/erl_distribution_wb_SUITE.erl
+++ b/lib/kernel/test/erl_distribution_wb_SUITE.erl
@@ -71,7 +71,7 @@
-define(i16(X1,X0),
(?u16(X1,X0) -
- (if (X1) > 127 -> 16#10000; true -> 0 end))).
+ (if (X1) > 127 -> 16#10000; true -> 0 end))).
-define(u16(X1,X0),
(((X1) bsl 8) bor (X0))).
@@ -79,7 +79,9 @@
-define(u32(X3,X2,X1,X0),
(((X3) bsl 24) bor ((X2) bsl 16) bor ((X1) bsl 8) bor (X0))).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[whitebox, switch_options, missing_compulsory_dflags].
@@ -101,39 +103,33 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
- Dog=?t:timetrap(?t:minutes(1)),
- [{watchdog, Dog}|Config].
-
-end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- ?t:timetrap_cancel(Dog).
-
-switch_options(doc) ->
- ["Tests switching of options for the tcp port, as this is done"
- " when the distribution port is to be shortcut into the emulator."
- " Maybe this should be in the inet test suite, but only the distribution"
- " does such horrible things..."];
+ Config.
+
+end_per_testcase(_Func, _Config) ->
+ ok.
+
+%% Tests switching of options for the tcp port, as this is done
+%% when the distribution port is to be shortcut into the emulator.
+%% Maybe this should be in the inet test suite, but only the distribution
+%% does such horrible things...
switch_options(Config) when is_list(Config) ->
ok = test_switch_active(),
ok = test_switch_active_partial() ,
ok = test_switch_active_and_packet(),
ok.
-
-whitebox(doc) ->
- ["Whitebox testing of distribution handshakes. Tests both BC with R5 and "
- "the md5 version. Note that after R6B, this should be revised to "
- "remove BC code."];
+
+%% Whitebox testing of distribution handshakes.
whitebox(Config) when is_list(Config) ->
- ?line {ok, Node} = start_node(?MODULE,""),
- ?line Cookie = erlang:get_cookie(),
- ?line {_,Host} = split(node()),
- ?line ok = pending_up_md5(Node, join(ccc,Host), Cookie),
- ?line ok = simultaneous_md5(Node, join('A',Host), Cookie),
- ?line ok = simultaneous_md5(Node, join(zzzzzzzzzzzzzz,Host), Cookie),
- ?line stop_node(Node),
+ {ok, Node} = start_node(?MODULE,""),
+ Cookie = erlang:get_cookie(),
+ {_,Host} = split(node()),
+ ok = pending_up_md5(Node, join(ccc,Host), Cookie),
+ ok = simultaneous_md5(Node, join('A',Host), Cookie),
+ ok = simultaneous_md5(Node, join(zzzzzzzzzzzzzz,Host), Cookie),
+ stop_node(Node),
ok.
-
+
%%
%% The actual tests
%%
@@ -143,56 +139,56 @@ whitebox(Config) when is_list(Config) ->
%%
test_switch_active() ->
- ?line {Client, Server} = socket_pair(0, 4),
- ?line ok = write_packets_32(Client, 1, 5),
+ {Client, Server} = socket_pair(0, 4),
+ ok = write_packets_32(Client, 1, 5),
receive after 2000 -> ok end,
- ?line ok = read_packets(Server, 1, 1),
+ ok = read_packets(Server, 1, 1),
receive after 2000 -> ok end,
- ?line ok = read_packets(Server, 2, 2),
- ?line inet:setopts(Server, [{active, true}]),
- ?line ok = receive_packets(Server, 3, 5),
+ ok = read_packets(Server, 2, 2),
+ inet:setopts(Server, [{active, true}]),
+ ok = receive_packets(Server, 3, 5),
close_pair({Client, Server}),
ok.
-
+
test_switch_active_partial() ->
- ?line {Client, Server} = socket_pair(0, 4),
- ?line ok = write_packets_32(Client, 1, 2),
- ?line ok = gen_tcp:send(Client,[?int32(4), [0,0,0]]),
+ {Client, Server} = socket_pair(0, 4),
+ ok = write_packets_32(Client, 1, 2),
+ ok = gen_tcp:send(Client,[?int32(4), [0,0,0]]),
receive after 2000 -> ok end,
- ?line ok = read_packets(Server, 1, 1),
+ ok = read_packets(Server, 1, 1),
receive after 2000 -> ok end,
- ?line ok = read_packets(Server, 2, 2),
- ?line inet:setopts(Server, [{active, true}]),
- ?line ok = gen_tcp:send(Client,[3]),
- ?line ok = write_packets_32(Client, 4, 5),
- ?line ok = receive_packets(Server, 3, 5),
+ ok = read_packets(Server, 2, 2),
+ inet:setopts(Server, [{active, true}]),
+ ok = gen_tcp:send(Client,[3]),
+ ok = write_packets_32(Client, 4, 5),
+ ok = receive_packets(Server, 3, 5),
close_pair({Client, Server}),
ok.
-
+
do_test_switch_active_and_packet(SendBefore, SendAfter) ->
- ?line {Client, Server} = socket_pair(0, 2),
- ?line ok = write_packets_16(Client, 1, 2),
- ?line ok = gen_tcp:send(Client,SendBefore),
+ {Client, Server} = socket_pair(0, 2),
+ ok = write_packets_16(Client, 1, 2),
+ ok = gen_tcp:send(Client,SendBefore),
receive after 2000 -> ok end,
- ?line ok = read_packets(Server, 1, 1),
+ ok = read_packets(Server, 1, 1),
receive after 2000 -> ok end,
- ?line ok = read_packets(Server, 2, 2),
- ?line inet:setopts(Server, [{packet,4}, {active, true}]),
- ?line ok = gen_tcp:send(Client,SendAfter),
- ?line ok = write_packets_32(Client, 4, 5),
- ?line ok = receive_packets(Server, 3, 5),
+ ok = read_packets(Server, 2, 2),
+ inet:setopts(Server, [{packet,4}, {active, true}]),
+ ok = gen_tcp:send(Client,SendAfter),
+ ok = write_packets_32(Client, 4, 5),
+ ok = receive_packets(Server, 3, 5),
close_pair({Client, Server}),
ok.
test_switch_active_and_packet() ->
- ?line ok = do_test_switch_active_and_packet([0],[0,0,4,0,0,0,3]),
- ?line ok = do_test_switch_active_and_packet([0,0],[0,4,0,0,0,3]),
- ?line ok = do_test_switch_active_and_packet([0,0,0],[4,0,0,0,3]),
- ?line ok = do_test_switch_active_and_packet([0,0,0,4],[0,0,0,3]),
- ?line ok = do_test_switch_active_and_packet([0,0,0,4,0],[0,0,3]),
- ?line ok = do_test_switch_active_and_packet([0,0,0,4,0,0],[0,3]),
- ?line ok = do_test_switch_active_and_packet([0,0,0,4,0,0,0],[3]),
- ?line ok = do_test_switch_active_and_packet([0,0,0,4,0,0,0,3],[]),
+ ok = do_test_switch_active_and_packet([0],[0,0,4,0,0,0,3]),
+ ok = do_test_switch_active_and_packet([0,0],[0,4,0,0,0,3]),
+ ok = do_test_switch_active_and_packet([0,0,0],[4,0,0,0,3]),
+ ok = do_test_switch_active_and_packet([0,0,0,4],[0,0,0,3]),
+ ok = do_test_switch_active_and_packet([0,0,0,4,0],[0,0,3]),
+ ok = do_test_switch_active_and_packet([0,0,0,4,0,0],[0,3]),
+ ok = do_test_switch_active_and_packet([0,0,0,4,0,0,0],[3]),
+ ok = do_test_switch_active_and_packet([0,0,0,4,0,0,0,3],[]),
ok.
@@ -200,181 +196,180 @@ test_switch_active_and_packet() ->
%% Handshake tests
%%
pending_up_md5(Node,OurName,Cookie) ->
- ?line {NA,NB} = split(Node),
- ?line {port,PortNo,_} = erl_epmd:port_please(NA,NB),
- ?line {ok, SocketA} = gen_tcp:connect(atom_to_list(NB),PortNo,
- [{active,false},
- {packet,2}]),
- ?line send_name(SocketA,OurName,5),
- ?line ok = recv_status(SocketA),
- ?line {hidden,Node,5,HisChallengeA} = recv_challenge(SocketA), % See 1)
- ?line OurChallengeA = gen_challenge(),
- ?line OurDigestA = gen_digest(HisChallengeA, Cookie),
- ?line send_challenge_reply(SocketA, OurChallengeA, OurDigestA),
- ?line ok = recv_challenge_ack(SocketA, OurChallengeA, Cookie),
- %%%
- %%% OK, one connection is up, now lets be nasty and try another up:
- %%%
- %%% But wait for a while, the other node might not have done setnode
- %%% just yet...
- ?line receive after 1000 -> ok end,
- ?line {ok, SocketB} = gen_tcp:connect(atom_to_list(NB),PortNo,
- [{active,false},
- {packet,2}]),
- ?line send_name(SocketB,OurName,5),
- ?line alive = recv_status(SocketB),
- ?line send_status(SocketB, true),
- ?line gen_tcp:close(SocketA),
- ?line {hidden,Node,5,HisChallengeB} = recv_challenge(SocketB), % See 1)
- ?line OurChallengeB = gen_challenge(),
- ?line OurDigestB = gen_digest(HisChallengeB, Cookie),
- ?line send_challenge_reply(SocketB, OurChallengeB, OurDigestB),
- ?line ok = recv_challenge_ack(SocketB, OurChallengeB, Cookie),
- %%%
- %%% Well, are we happy?
- %%%
-
- ?line inet:setopts(SocketB, [{active, false},
- {packet, 4}]),
- ?line gen_tcp:send(SocketB,build_rex_message('',OurName)),
- ?line {Header, Message} = recv_message(SocketB),
- ?line io:format("Received header ~p, data ~p.~n",
+ {NA,NB} = split(Node),
+ {port,PortNo,_} = erl_epmd:port_please(NA,NB),
+ {ok, SocketA} = gen_tcp:connect(atom_to_list(NB),PortNo,
+ [{active,false},
+ {packet,2}]),
+ send_name(SocketA,OurName,5),
+ ok = recv_status(SocketA),
+ {hidden,Node,5,HisChallengeA} = recv_challenge(SocketA), % See 1)
+ OurChallengeA = gen_challenge(),
+ OurDigestA = gen_digest(HisChallengeA, Cookie),
+ send_challenge_reply(SocketA, OurChallengeA, OurDigestA),
+ ok = recv_challenge_ack(SocketA, OurChallengeA, Cookie),
+%%%
+%%% OK, one connection is up, now lets be nasty and try another up:
+%%%
+%%% But wait for a while, the other node might not have done setnode
+%%% just yet...
+ receive after 1000 -> ok end,
+ {ok, SocketB} = gen_tcp:connect(atom_to_list(NB),PortNo,
+ [{active,false},
+ {packet,2}]),
+ send_name(SocketB,OurName,5),
+ alive = recv_status(SocketB),
+ send_status(SocketB, true),
+ gen_tcp:close(SocketA),
+ {hidden,Node,5,HisChallengeB} = recv_challenge(SocketB), % See 1)
+ OurChallengeB = gen_challenge(),
+ OurDigestB = gen_digest(HisChallengeB, Cookie),
+ send_challenge_reply(SocketB, OurChallengeB, OurDigestB),
+ ok = recv_challenge_ack(SocketB, OurChallengeB, Cookie),
+%%%
+%%% Well, are we happy?
+%%%
+
+ inet:setopts(SocketB, [{active, false},
+ {packet, 4}]),
+ gen_tcp:send(SocketB,build_rex_message('',OurName)),
+ {Header, Message} = recv_message(SocketB),
+ io:format("Received header ~p, data ~p.~n",
[Header, Message]),
- ?line gen_tcp:close(SocketB),
+ gen_tcp:close(SocketB),
ok.
simultaneous_md5(Node, OurName, Cookie) when OurName < Node ->
- ?line pong = net_adm:ping(Node),
- ?line LSocket = case gen_tcp:listen(0, [{active, false}, {packet,2}]) of
+ pong = net_adm:ping(Node),
+ LSocket = case gen_tcp:listen(0, [{active, false}, {packet,2}]) of
{ok, Socket} ->
Socket;
Else ->
exit(Else)
end,
- ?line EpmdSocket = register(OurName, LSocket, 1, 5),
- ?line {NA, NB} = split(Node),
- ?line rpc:cast(Node, net_adm, ping, [OurName]),
- ?line receive after 1000 -> ok end,
- ?line {port, PortNo, _} = erl_epmd:port_please(NA,NB),
- ?line {ok, SocketA} = gen_tcp:connect(atom_to_list(NB),PortNo,
- [{active,false},
- {packet,2}]),
- ?line send_name(SocketA,OurName,5),
+ EpmdSocket = register(OurName, LSocket, 1, 5),
+ {NA, NB} = split(Node),
+ rpc:cast(Node, net_adm, ping, [OurName]),
+ receive after 1000 -> ok end,
+ {port, PortNo, _} = erl_epmd:port_please(NA,NB),
+ {ok, SocketA} = gen_tcp:connect(atom_to_list(NB),PortNo,
+ [{active,false},
+ {packet,2}]),
+ send_name(SocketA,OurName,5),
%% We are still not marked up on the other side, as our first message
%% is not sent.
- ?line SocketB = case gen_tcp:accept(LSocket) of
+ SocketB = case gen_tcp:accept(LSocket) of
{ok, Socket1} ->
- ?line Socket1;
+ Socket1;
Else2 ->
- ?line exit(Else2)
+ exit(Else2)
end,
- ?line nok = recv_status(SocketA),
- % Now we are expected to close A
- ?line gen_tcp:close(SocketA),
- % But still Socket B will continue
- ?line {normal,Node,5} = recv_name(SocketB), % See 1)
- ?line send_status(SocketB, ok_simultaneous),
- ?line MyChallengeB = gen_challenge(),
- ?line send_challenge(SocketB, OurName, MyChallengeB,5),
- ?line HisChallengeB = recv_challenge_reply(SocketB, MyChallengeB, Cookie),
- ?line DigestB = gen_digest(HisChallengeB,Cookie),
- ?line send_challenge_ack(SocketB, DigestB),
- ?line inet:setopts(SocketB, [{active, false},
- {packet, 4}]),
- % This should be the ping message.
- ?line {Header, Message} = recv_message(SocketB),
- ?line io:format("Received header ~p, data ~p.~n",
+ nok = recv_status(SocketA),
+ %% Now we are expected to close A
+ gen_tcp:close(SocketA),
+ %% But still Socket B will continue
+ {normal,Node,5} = recv_name(SocketB), % See 1)
+ send_status(SocketB, ok_simultaneous),
+ MyChallengeB = gen_challenge(),
+ send_challenge(SocketB, OurName, MyChallengeB,5),
+ HisChallengeB = recv_challenge_reply(SocketB, MyChallengeB, Cookie),
+ DigestB = gen_digest(HisChallengeB,Cookie),
+ send_challenge_ack(SocketB, DigestB),
+ inet:setopts(SocketB, [{active, false},
+ {packet, 4}]),
+ %% This should be the ping message.
+ {Header, Message} = recv_message(SocketB),
+ io:format("Received header ~p, data ~p.~n",
[Header, Message]),
- ?line gen_tcp:close(SocketB),
- ?line gen_tcp:close(LSocket),
- ?line gen_tcp:close(EpmdSocket),
+ gen_tcp:close(SocketB),
+ gen_tcp:close(LSocket),
+ gen_tcp:close(EpmdSocket),
ok;
-
+
simultaneous_md5(Node, OurName, Cookie) when OurName > Node ->
- ?line pong = net_adm:ping(Node),
- ?line LSocket = case gen_tcp:listen(0, [{active, false}, {packet,2}]) of
- {ok, Socket} ->
- ?line Socket;
- Else ->
- ?line exit(Else)
- end,
- ?line EpmdSocket = register(OurName, LSocket, 1, 5),
- ?line {NA, NB} = split(Node),
- ?line rpc:cast(Node, net_adm, ping, [OurName]),
- ?line receive after 1000 -> ok end,
- ?line {port, PortNo, _} = erl_epmd:port_please(NA,NB),
- ?line {ok, SocketA} = gen_tcp:connect(atom_to_list(NB),PortNo,
- [{active,false},
- {packet,2}]),
- ?line SocketB = case gen_tcp:accept(LSocket) of
+ pong = net_adm:ping(Node),
+ LSocket = case gen_tcp:listen(0, [{active, false}, {packet,2}]) of
+ {ok, Socket} ->
+ Socket;
+ Else ->
+ exit(Else)
+ end,
+ EpmdSocket = register(OurName, LSocket, 1, 5),
+ {NA, NB} = split(Node),
+ rpc:cast(Node, net_adm, ping, [OurName]),
+ receive after 1000 -> ok end,
+ {port, PortNo, _} = erl_epmd:port_please(NA,NB),
+ {ok, SocketA} = gen_tcp:connect(atom_to_list(NB),PortNo,
+ [{active,false},
+ {packet,2}]),
+ SocketB = case gen_tcp:accept(LSocket) of
{ok, Socket1} ->
- ?line Socket1;
+ Socket1;
Else2 ->
- ?line exit(Else2)
+ exit(Else2)
end,
- ?line send_name(SocketA,OurName,5),
- ?line ok_simultaneous = recv_status(SocketA),
+ send_name(SocketA,OurName,5),
+ ok_simultaneous = recv_status(SocketA),
%% Socket B should die during this
- ?line case catch begin
- ?line {normal,Node,5} = recv_name(SocketB), % See 1)
- ?line send_status(SocketB, ok_simultaneous),
- ?line MyChallengeB = gen_challenge(),
- ?line send_challenge(SocketB, OurName, MyChallengeB,
- 5),
- ?line HisChallengeB = recv_challenge_reply(
- SocketB,
- MyChallengeB,
- Cookie),
- ?line DigestB = gen_digest(HisChallengeB,Cookie),
- ?line send_challenge_ack(SocketB, DigestB),
- ?line inet:setopts(SocketB, [{active, false},
- {packet, 4}]),
- ?line {HeaderB, MessageB} = recv_message(SocketB),
- ?line io:format("Received header ~p, data ~p.~n",
- [HeaderB, MessageB])
- end of
- {'EXIT', Exitcode} ->
- ?line io:format("Expected exitsignal caught: ~p.~n",
- [Exitcode]);
- Success ->
- ?line io:format("Unexpected success: ~p~n",
- [Success]),
- ?line exit(unexpected_success)
- end,
- ?line gen_tcp:close(SocketB),
+ case catch begin
+ {normal,Node,5} = recv_name(SocketB), % See 1)
+ send_status(SocketB, ok_simultaneous),
+ MyChallengeB = gen_challenge(),
+ send_challenge(SocketB, OurName, MyChallengeB,
+ 5),
+ HisChallengeB = recv_challenge_reply(
+ SocketB,
+ MyChallengeB,
+ Cookie),
+ DigestB = gen_digest(HisChallengeB,Cookie),
+ send_challenge_ack(SocketB, DigestB),
+ inet:setopts(SocketB, [{active, false},
+ {packet, 4}]),
+ {HeaderB, MessageB} = recv_message(SocketB),
+ io:format("Received header ~p, data ~p.~n",
+ [HeaderB, MessageB])
+ end of
+ {'EXIT', Exitcode} ->
+ io:format("Expected exitsignal caught: ~p.~n",
+ [Exitcode]);
+ Success ->
+ io:format("Unexpected success: ~p~n",
+ [Success]),
+ exit(unexpected_success)
+ end,
+ gen_tcp:close(SocketB),
%% But still Socket A will continue
- ?line {hidden,Node,5,HisChallengeA} = recv_challenge(SocketA), % See 1)
- ?line OurChallengeA = gen_challenge(),
- ?line OurDigestA = gen_digest(HisChallengeA, Cookie),
- ?line send_challenge_reply(SocketA, OurChallengeA, OurDigestA),
- ?line ok = recv_challenge_ack(SocketA, OurChallengeA, Cookie),
-
- ?line inet:setopts(SocketA, [{active, false},
- {packet, 4}]),
- ?line gen_tcp:send(SocketA,build_rex_message('',OurName)),
- ?line {Header, Message} = recv_message(SocketA),
- ?line io:format("Received header ~p, data ~p.~n",
+ {hidden,Node,5,HisChallengeA} = recv_challenge(SocketA), % See 1)
+ OurChallengeA = gen_challenge(),
+ OurDigestA = gen_digest(HisChallengeA, Cookie),
+ send_challenge_reply(SocketA, OurChallengeA, OurDigestA),
+ ok = recv_challenge_ack(SocketA, OurChallengeA, Cookie),
+
+ inet:setopts(SocketA, [{active, false},
+ {packet, 4}]),
+ gen_tcp:send(SocketA,build_rex_message('',OurName)),
+ {Header, Message} = recv_message(SocketA),
+ io:format("Received header ~p, data ~p.~n",
[Header, Message]),
- ?line gen_tcp:close(SocketA),
- ?line gen_tcp:close(LSocket),
- ?line gen_tcp:close(EpmdSocket),
+ gen_tcp:close(SocketA),
+ gen_tcp:close(LSocket),
+ gen_tcp:close(EpmdSocket),
ok.
-missing_compulsory_dflags(doc) -> [];
missing_compulsory_dflags(Config) when is_list(Config) ->
- ?line [Name1, Name2] = get_nodenames(2, missing_compulsory_dflags),
- ?line {ok, Node} = start_node(Name1,""),
- ?line {NA,NB} = split(Node),
- ?line {port,PortNo,_} = erl_epmd:port_please(NA,NB),
- ?line {ok, SocketA} = gen_tcp:connect(atom_to_list(NB),PortNo,
- [{active,false},
- {packet,2}]),
- ?line BadNode = list_to_atom(atom_to_list(Name2)++"@"++atom_to_list(NB)),
- ?line send_name(SocketA,BadNode,5,0),
- ?line not_allowed = recv_status(SocketA),
- ?line gen_tcp:close(SocketA),
- ?line stop_node(Node),
- ?line ok.
+ [Name1, Name2] = get_nodenames(2, missing_compulsory_dflags),
+ {ok, Node} = start_node(Name1,""),
+ {NA,NB} = split(Node),
+ {port,PortNo,_} = erl_epmd:port_please(NA,NB),
+ {ok, SocketA} = gen_tcp:connect(atom_to_list(NB),PortNo,
+ [{active,false},
+ {packet,2}]),
+ BadNode = list_to_atom(atom_to_list(Name2)++"@"++atom_to_list(NB)),
+ send_name(SocketA,BadNode,5,0),
+ not_allowed = recv_status(SocketA),
+ gen_tcp:close(SocketA),
+ stop_node(Node),
+ ok.
%%
%% Here comes the utilities
@@ -437,7 +432,7 @@ socket_pair(ClientPack, ServerPack) ->
{ok, Server} = gen_tcp:accept(Listen),
gen_tcp:close(Listen),
{Client, Server}.
-
+
close_pair({Client, Server}) ->
gen_tcp:close(Client),
gen_tcp:close(Server),
@@ -454,7 +449,7 @@ close_pair({Client, Server}) ->
gen_challenge() ->
rand:uniform(1000000).
-
+
%% Generate a message digest from Challenge number and Cookie
gen_digest(Challenge, Cookie) when is_integer(Challenge), is_atom(Cookie) ->
C0 = erlang:md5_init(),
@@ -595,15 +590,15 @@ do_register_node(NodeName, TcpPort, VLow, VHigh) ->
Elen = length(Extra),
Len = 1+2+1+1+2+2+2+length(Name)+2+Elen,
gen_tcp:send(Socket, [?int16(Len), $x,
- ?int16(TcpPort),
- $M,
- 0,
- ?int16(VHigh),
- ?int16(VLow),
- ?int16(length(Name)),
- Name,
- ?int16(Elen),
- Extra]),
+ ?int16(TcpPort),
+ $M,
+ 0,
+ ?int16(VHigh),
+ ?int16(VLow),
+ ?int16(length(Name)),
+ Name,
+ ?int16(Elen),
+ Extra]),
case wait_for_reg_reply(Socket, []) of
{error, epmd_close} ->
exit(epmd_broken);
@@ -666,11 +661,11 @@ split(Atom) ->
build_rex_message(Cookie,OurName) ->
[$?,term_to_binary({6,self(),Cookie,rex}),
term_to_binary({'$gen_cast',
- {cast,
- rpc,
- cast,
- [OurName, hello, world, []],
- self()} })].
+ {cast,
+ rpc,
+ cast,
+ [OurName, hello, world, []],
+ self()} })].
%% Receive a distribution message
recv_message(Socket) ->
@@ -698,10 +693,10 @@ join(Name,Host) ->
%% start/stop slave.
start_node(Name, Param) ->
- ?t:start_node(Name, slave, [{args, Param}]).
+ test_server:start_node(Name, slave, [{args, Param}]).
stop_node(Node) ->
- ?t:stop_node(Node).
+ test_server:stop_node(Node).
get_nodenames(N, T) ->
diff --git a/lib/kernel/test/erl_prim_loader_SUITE.erl b/lib/kernel/test/erl_prim_loader_SUITE.erl
index bccca59b93..3ea925ee9a 100644
--- a/lib/kernel/test/erl_prim_loader_SUITE.erl
+++ b/lib/kernel/test/erl_prim_loader_SUITE.erl
@@ -23,6 +23,7 @@
-include_lib("common_test/include/ct.hrl").
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
+ init_per_testcase/2,end_per_testcase/2,
init_per_group/2,end_per_group/2]).
-export([get_path/1, set_path/1, get_file/1, normalize_and_backslash/1,
@@ -32,13 +33,14 @@
primary_archive/1, virtual_dir_in_archive/1,
get_modules/1]).
--export([init_per_testcase/2, end_per_testcase/2]).
%%-----------------------------------------------------------------
%% Test suite for erl_prim_loader. (Most code is run during system start/stop.)
%%-----------------------------------------------------------------
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,3}}].
all() ->
[get_path, set_path, get_file,
@@ -64,54 +66,55 @@ end_per_group(_GroupName, Config) ->
Config.
-init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
- Dog=?t:timetrap(?t:minutes(3)),
- [{watchdog, Dog}|Config].
+init_per_testcase(_Func, Config) ->
+ Config.
-end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- ?t:timetrap_cancel(Dog).
+end_per_testcase(_Func, _Config) ->
+ ok.
-get_path(doc) -> [];
get_path(Config) when is_list(Config) ->
- ?line case erl_prim_loader:get_path() of
- {ok, Path} when is_list(Path) ->
- ok;
- _ ->
- test_server:fail(get_path)
- end,
+ case erl_prim_loader:get_path() of
+ {ok, Path} when is_list(Path) ->
+ ok;
+ _ ->
+ ct:fail(get_path)
+ end,
ok.
-set_path(doc) -> [];
set_path(Config) when is_list(Config) ->
- ?line {ok, Path} = erl_prim_loader:get_path(),
- ?line ok = erl_prim_loader:set_path(Path),
- ?line {ok, Path} = erl_prim_loader:get_path(),
+ {ok, Path} = erl_prim_loader:get_path(),
+ ok = erl_prim_loader:set_path(Path),
+ {ok, Path} = erl_prim_loader:get_path(),
NewPath = Path ++ ["dummy_dir","/dummy_dir/dummy_dir"],
- ?line ok = erl_prim_loader:set_path(NewPath),
- ?line {ok, NewPath} = erl_prim_loader:get_path(),
+ ok = erl_prim_loader:set_path(NewPath),
+ {ok, NewPath} = erl_prim_loader:get_path(),
- ?line ok = erl_prim_loader:set_path(Path), % Reset path.
- ?line {ok, Path} = erl_prim_loader:get_path(),
+ ok = erl_prim_loader:set_path(Path), % Reset path.
+ {ok, Path} = erl_prim_loader:get_path(),
- ?line {'EXIT',_} = (catch erl_prim_loader:set_path(not_a_list)),
- ?line {ok, Path} = erl_prim_loader:get_path(),
+ {'EXIT',_} = (catch erl_prim_loader:set_path(not_a_list)),
+ {ok, Path} = erl_prim_loader:get_path(),
ok.
-get_file(doc) -> [];
get_file(Config) when is_list(Config) ->
- ?line case erl_prim_loader:get_file("lists" ++ code:objfile_extension()) of
- {ok,Bin,File} when is_binary(Bin), is_list(File) ->
- ok;
- _ ->
- test_server:fail(get_valid_file)
- end,
- ?line error = erl_prim_loader:get_file("duuuuuuummmy_file"),
- ?line error = erl_prim_loader:get_file(duuuuuuummmy_file),
- ?line error = erl_prim_loader:get_file({dummy}),
+ case erl_prim_loader:get_file("lists" ++ code:objfile_extension()) of
+ {ok,Bin,File} when is_binary(Bin), is_list(File) ->
+ ok;
+ _ ->
+ ct:fail(get_valid_file)
+ end,
+ error = erl_prim_loader:get_file("duuuuuuummmy_file"),
+ error = erl_prim_loader:get_file(duuuuuuummmy_file),
+ error = erl_prim_loader:get_file({dummy}),
ok.
get_modules(_Config) ->
+ case test_server:is_cover() of
+ false -> do_get_modules();
+ true -> {skip,"Cover"}
+ end.
+
+do_get_modules() ->
MsGood = lists:sort([lists,gen_server,gb_trees,code_server]),
Ms = [certainly_not_existing|MsGood],
SuccExp = [begin
@@ -121,6 +124,9 @@ get_modules(_Config) ->
end || M <- MsGood],
FailExp = [{certainly_not_existing,enoent}],
+ io:format("SuccExp = ~p\n", [SuccExp]),
+ io:format("FailExp = ~p\n", [FailExp]),
+
Path = code:get_path(),
Process = fun(_, F, Code) -> {ok,{F,erlang:md5(Code)}} end,
{ok,{Succ,FailExp}} = erl_prim_loader:get_modules(Ms, Process, Path),
@@ -132,7 +138,7 @@ get_modules(_Config) ->
true = rpc:call(Node, code, add_patha, [ThisDir]),
_ = rpc:call(Node, code, ensure_loaded, [?MODULE]),
{ok,{InetSucc,FailExp}} = rpc:call(Node, erl_prim_loader,
- get_modules, [Ms,Process,Path]),
+ get_modules, [Ms,Process,Path]),
SuccExp = lists:sort(InetSucc),
stop_node(Node),
@@ -151,7 +157,7 @@ normalize_and_backslash(Config) ->
test_normalize_and_backslash(Config)
end.
test_normalize_and_backslash(Config) ->
- PrivDir = ?config(priv_dir,Config),
+ PrivDir = proplists:get_value(priv_dir,Config),
Dir = filename:join(PrivDir,"\\"),
File = filename:join(Dir,"file-OTP-11170"),
ok = file:make_dir(Dir),
@@ -162,8 +168,8 @@ test_normalize_and_backslash(Config) ->
ok = file:del_dir(Dir),
ok.
-inet_existing(doc) -> ["Start a node using the 'inet' loading method, ",
- "from an already started boot server."];
+%% Start a node using the 'inet' loading method,
+%% from an already started boot server.
inet_existing(Config) when is_list(Config) ->
Name = erl_prim_test_inet_existing,
BootPid = start_boot_server(),
@@ -174,14 +180,14 @@ inet_existing(Config) when is_list(Config) ->
exit(BootPid, kill),
ok.
-inet_coming_up(doc) -> ["Start a node using the 'inet' loading method, ",
- "but start the boot server afterwards."];
+%% Start a node using the 'inet' loading method,
+%% but start the boot server afterwards.
inet_coming_up(Config) when is_list(Config) ->
Name = erl_prim_test_inet_coming_up,
Node = start_node_using_inet(Name, [{wait,false}]),
%% Wait a while, then start boot server, and wait for node to start.
- test_server:sleep(test_server:seconds(6)),
+ ct:sleep({seconds,6}),
BootPid = start_boot_server(),
wait_really_started(Node, 25),
@@ -193,25 +199,25 @@ inet_coming_up(Config) when is_list(Config) ->
ok.
wait_really_started(Node, 0) ->
- test_server:fail({not_booted,Node});
+ ct:fail({not_booted,Node});
wait_really_started(Node, N) ->
case rpc:call(Node, init, get_status, []) of
{started, _} ->
ok;
_ ->
- test_server:sleep(1000),
+ ct:sleep(1000),
wait_really_started(Node, N - 1)
end.
-inet_disconnects(doc) -> ["Start a node using the 'inet' loading method, ",
- "then lose the connection."];
+%% Start a node using the 'inet' loading method,
+%% then lose the connection.
inet_disconnects(Config) when is_list(Config) ->
case test_server:is_native(erl_boot_server) of
true ->
{skip,"erl_boot_server is native"};
false ->
Name = erl_prim_test_inet_disconnects,
-
+
BootPid = start_boot_server(),
unlink(BootPid),
Self = self(),
@@ -230,9 +236,9 @@ inet_disconnects(Config) when is_list(Config) ->
{Stopper,ok} ->
ok;
{Stopper,{error,Reason}} ->
- ?line ?t:fail(Reason)
+ ct:fail(Reason)
after 60000 ->
- ?line ?t:fail(stopper_died)
+ ct:fail(stopper_died)
end,
%% Start new boot server to see that loading is continued.
@@ -270,13 +276,12 @@ get_calls(Count, Pid) ->
{error,{trace_msg_timeout,Count}}
end.
-multiple_slaves(doc) ->
- ["Start nodes in parallell, all using the 'inet' loading method, ",
- "verify that the boot server manages"];
+%% Start nodes in parallel, all using the 'inet' loading method;
+%% verify that the boot server manages.
multiple_slaves(Config) when is_list(Config) ->
- ?line Name = erl_prim_test_multiple_slaves,
- ?line Host = host(),
- ?line IpStr = ip_str(Host),
+ Name = erl_prim_test_multiple_slaves,
+ Host = host(),
+ IpStr = ip_str(Host),
Args = " -loader inet -hosts " ++ IpStr,
NoOfNodes = 10, % no of slave nodes to be started
@@ -289,54 +294,54 @@ multiple_slaves(Config) when is_list(Config) ->
{list_to_atom(NameN),list_to_atom(NodeN)}
end, lists:seq(1, NoOfNodes)),
- ?line Nodes = start_multiple_nodes(NamesAndNodes, Args, []),
+ Nodes = start_multiple_nodes(NamesAndNodes, Args, []),
%% "queue up" the nodes to wait for the boot server to respond
%% (note: test_server supervises each node start by accept()
%% on a socket, the timeout value for the accept has to be quite
%% long for this test to work).
- ?line test_server:sleep(test_server:seconds(5)),
+ ct:sleep({seconds,5}),
%% start the code loading circus!
BootPid = start_boot_server(),
%% give the nodes a chance to boot up before attempting to stop them
- ?line test_server:sleep(test_server:seconds(10)),
+ ct:sleep({seconds,10}),
- ?line wait_and_shutdown(lists:reverse(Nodes), 30),
+ wait_and_shutdown(lists:reverse(Nodes), 30),
- ?line unlink(BootPid),
- ?line exit(BootPid, kill),
+ unlink(BootPid),
+ exit(BootPid, kill),
ok.
start_multiple_nodes([{Name,Node} | NNs], Args, Started) ->
- ?line {ok,Node} = start_node(Name, Args, [{wait, false}]),
+ {ok,Node} = start_node(Name, Args, [{wait, false}]),
start_multiple_nodes(NNs, Args, [Node | Started]);
start_multiple_nodes([], _, Nodes) ->
Nodes.
wait_and_shutdown([Node | Nodes], Tries) ->
- ?line wait_really_started(Node, Tries),
- ?line {ok,[["inet"]]} = rpc:call(Node, init, get_argument, [loader]),
- ?line stop_node(Node),
+ wait_really_started(Node, Tries),
+ {ok,[["inet"]]} = rpc:call(Node, init, get_argument, [loader]),
+ stop_node(Node),
wait_and_shutdown(Nodes, Tries);
wait_and_shutdown([], _) ->
ok.
-file_requests(doc) -> ["Start a node using the 'inet' loading method, ",
- "verify that the boot server responds to file requests."];
+%% Start a node using the 'inet' loading method,
+%% verify that the boot server responds to file requests.
file_requests(Config) when is_list(Config) ->
- ?line {ok, Node, BootPid} = complete_start_node(erl_prim_test_file_req),
+ {ok, Node, BootPid} = complete_start_node(erl_prim_test_file_req),
%% compare with results from file server calls (the
%% boot server uses the same file sys and cwd)
{ok,Files} = file:list_dir("."),
io:format("Files: ~p~n",[Files]),
- ?line {ok,Files} = rpc:call(Node, erl_prim_loader, list_dir, ["."]),
+ {ok,Files} = rpc:call(Node, erl_prim_loader, list_dir, ["."]),
{ok,Info} = file:read_file_info(code:which(test_server)),
- ?line {ok,Info} = rpc:call(Node, erl_prim_loader, read_file_info,
- [code:which(test_server)]),
+ {ok,Info} = rpc:call(Node, erl_prim_loader, read_file_info,
+ [code:which(test_server)]),
- PrivDir = ?config(priv_dir,Config),
+ PrivDir = proplists:get_value(priv_dir,Config),
Dir = filename:join(PrivDir,?MODULE_STRING++"_file_requests"),
ok = file:make_dir(Dir),
Alias = filename:join(Dir,"symlink"),
@@ -360,149 +365,140 @@ file_requests(Config) when is_list(Config) ->
end,
{ok,Cwd} = file:get_cwd(),
- ?line {ok,Cwd} = rpc:call(Node, erl_prim_loader, get_cwd, []),
+ {ok,Cwd} = rpc:call(Node, erl_prim_loader, get_cwd, []),
case file:get_cwd("C:") of
{error,enotsup} ->
ok;
{ok,DCwd} ->
- ?line {ok,DCwd} = rpc:call(Node, erl_prim_loader, get_cwd, ["C:"])
+ {ok,DCwd} = rpc:call(Node, erl_prim_loader, get_cwd, ["C:"])
end,
- ?line stop_node(Node),
- ?line unlink(BootPid),
- ?line exit(BootPid, kill),
+ stop_node(Node),
+ unlink(BootPid),
+ exit(BootPid, kill),
ok.
-local_archive(suite) ->
- [];
-local_archive(doc) ->
- ["Read files from local archive."];
+%% Read files from local archive.
local_archive(Config) when is_list(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
KernelDir = filename:basename(code:lib_dir(kernel)),
Archive = filename:join([PrivDir, KernelDir ++ init:archive_extension()]),
file:delete(Archive),
- ?line {ok, Archive} = create_archive(Archive, [KernelDir]),
+ {ok, Archive} = create_archive(Archive, [KernelDir]),
Node = node(),
BeamName = "inet.beam",
- ?line ok = test_archive(Node, Archive, KernelDir, BeamName),
+ ok = test_archive(Node, Archive, KernelDir, BeamName),
%% Cleanup
ok = rpc:call(Node, erl_prim_loader, purge_archive_cache, []),
- ?line ok = file:delete(Archive),
+ ok = file:delete(Archive),
ok.
-remote_archive(suite) ->
- {req, [{local_slave_nodes, 1}, {time, 10}]};
-remote_archive(doc) ->
- ["Read files from remote archive."];
+%% Read files from remote archive.
remote_archive(Config) when is_list(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
KernelDir = filename:basename(code:lib_dir(kernel)),
Archive = filename:join([PrivDir, KernelDir ++ init:archive_extension()]),
file:delete(Archive),
- ?line {ok, Archive} = create_archive(Archive, [KernelDir]),
+ {ok, Archive} = create_archive(Archive, [KernelDir]),
- ?line {ok, Node, BootPid} = complete_start_node(remote_archive),
+ {ok, Node, BootPid} = complete_start_node(remote_archive),
BeamName = "inet.beam",
- ?line ok = test_archive(Node, Archive, KernelDir, BeamName),
+ ok = test_archive(Node, Archive, KernelDir, BeamName),
%% Cleanup
- ?line stop_node(Node),
- ?line unlink(BootPid),
- ?line exit(BootPid, kill),
+ stop_node(Node),
+ unlink(BootPid),
+ exit(BootPid, kill),
ok.
-primary_archive(suite) ->
- {req, [{local_slave_nodes, 1}, {time, 10}]};
-primary_archive(doc) ->
- ["Read files from primary archive."];
+%% Read files from primary archive.
primary_archive(Config) when is_list(Config) ->
%% Copy the orig files to priv_dir
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
Archive = filename:join([PrivDir, "primary_archive.zip"]),
file:delete(Archive),
- DataDir = ?config(data_dir, Config),
- ?line {ok, _} = zip:create(Archive, ["primary_archive"],
- [{compress, []}, {cwd, DataDir}]),
- ?line {ok, _} = zip:extract(Archive, [{cwd, PrivDir}]),
+ DataDir = proplists:get_value(data_dir, Config),
+ {ok, _} = zip:create(Archive, ["primary_archive"],
+ [{compress, []}, {cwd, DataDir}]),
+ {ok, _} = zip:extract(Archive, [{cwd, PrivDir}]),
TopDir = filename:join([PrivDir, "primary_archive"]),
%% Compile the code
DictDir = "primary_archive_dict-1.0",
DummyDir = "primary_archive_dummy",
- ?line ok = compile_app(TopDir, DictDir),
- ?line ok = compile_app(TopDir, DummyDir),
-
+ ok = compile_app(TopDir, DictDir),
+ ok = compile_app(TopDir, DummyDir),
+
%% Create the archive
{ok, TopFiles} = file:list_dir(TopDir),
- ?line {ok, {_, ArchiveBin}} = zip:create(Archive, TopFiles,
- [memory, {compress, []}, {cwd, TopDir}]),
-
+ {ok, {_, ArchiveBin}} = zip:create(Archive, TopFiles,
+ [memory, {compress, []}, {cwd, TopDir}]),
+
%% Use temporary node to simplify cleanup
- ?line Cookie = atom_to_list(erlang:get_cookie()),
- ?line Args = " -setcookie " ++ Cookie,
- ?line {ok,Node} = start_node(primary_archive, Args),
- ?line wait_really_started(Node, 25),
- ?line {_,_,_} = rpc:call(Node, erlang, date, []),
+ Cookie = atom_to_list(erlang:get_cookie()),
+ Args = " -setcookie " ++ Cookie,
+ {ok,Node} = start_node(primary_archive, Args),
+ wait_really_started(Node, 25),
+ {_,_,_} = rpc:call(Node, erlang, date, []),
%% Set primary archive
ExpectedEbins = [Archive, DictDir ++ "/ebin", DummyDir ++ "/ebin"],
io:format("ExpectedEbins: ~p\n", [ExpectedEbins]),
- ?line {ok, FileInfo} = prim_file:read_file_info(Archive),
- ?line {ok, Ebins} = rpc:call(Node, erl_prim_loader, set_primary_archive,
- [Archive, ArchiveBin, FileInfo,
- fun escript:parse_file/1]),
- ?line ExpectedEbins = lists:sort(Ebins), % assert
-
- ?line {ok, TopFiles2} = rpc:call(Node, erl_prim_loader, list_dir, [Archive]),
- ?line [DictDir, DummyDir] = lists:sort(TopFiles2),
+ {ok, FileInfo} = prim_file:read_file_info(Archive),
+ {ok, Ebins} = rpc:call(Node, erl_prim_loader, set_primary_archive,
+ [Archive, ArchiveBin, FileInfo,
+ fun escript:parse_file/1]),
+ ExpectedEbins = lists:sort(Ebins), % assert
+
+ {ok, TopFiles2} = rpc:call(Node, erl_prim_loader, list_dir, [Archive]),
+ [DictDir, DummyDir] = lists:sort(TopFiles2),
BeamName = "primary_archive_dict_app.beam",
- ?line ok = test_archive(Node, Archive, DictDir, BeamName),
-
+ ok = test_archive(Node, Archive, DictDir, BeamName),
+
%% Cleanup
- ?line {ok, []} = rpc:call(Node, erl_prim_loader, set_primary_archive,
- [undefined, undefined, undefined,
- fun escript:parse_file/1]),
- ?line stop_node(Node),
- ?line ok = file:delete(Archive),
+ {ok, []} = rpc:call(Node, erl_prim_loader, set_primary_archive,
+ [undefined, undefined, undefined,
+ fun escript:parse_file/1]),
+ stop_node(Node),
+ ok = file:delete(Archive),
ok.
test_archive(Node, TopDir, AppDir, BeamName) ->
%% List dir
io:format("test_archive: ~p\n", [rpc:call(Node, erl_prim_loader, list_dir, [TopDir])]),
- ?line {ok, TopFiles} = rpc:call(Node, erl_prim_loader, list_dir, [TopDir]),
- ?line true = lists:member(AppDir, TopFiles),
+ {ok, TopFiles} = rpc:call(Node, erl_prim_loader, list_dir, [TopDir]),
+ true = lists:member(AppDir, TopFiles),
AbsAppDir = TopDir ++ "/" ++ AppDir,
- ?line {ok, AppFiles} = rpc:call(Node, erl_prim_loader, list_dir, [AbsAppDir]),
- ?line true = lists:member("ebin", AppFiles),
+ {ok, AppFiles} = rpc:call(Node, erl_prim_loader, list_dir, [AbsAppDir]),
+ true = lists:member("ebin", AppFiles),
Ebin = AbsAppDir ++ "/ebin",
- ?line {ok, EbinFiles} = rpc:call(Node, erl_prim_loader, list_dir, [Ebin]),
+ {ok, EbinFiles} = rpc:call(Node, erl_prim_loader, list_dir, [Ebin]),
Beam = Ebin ++ "/" ++ BeamName,
- ?line true = lists:member(BeamName, EbinFiles),
- ?line error = rpc:call(Node, erl_prim_loader, list_dir, [TopDir ++ "/no_such_file"]),
- ?line error = rpc:call(Node, erl_prim_loader, list_dir, [TopDir ++ "/ebin/no_such_file"]),
-
+ true = lists:member(BeamName, EbinFiles),
+ error = rpc:call(Node, erl_prim_loader, list_dir, [TopDir ++ "/no_such_file"]),
+ error = rpc:call(Node, erl_prim_loader, list_dir, [TopDir ++ "/ebin/no_such_file"]),
+
%% File info
- ?line {ok, #file_info{type = directory}} =
+ {ok, #file_info{type = directory}} =
rpc:call(Node, erl_prim_loader, read_file_info, [TopDir]),
- ?line {ok, #file_info{type = directory}} =
+ {ok, #file_info{type = directory}} =
rpc:call(Node, erl_prim_loader, read_file_info, [Ebin]),
- ?line {ok, #file_info{type = regular} = FI} =
+ {ok, #file_info{type = regular} = FI} =
rpc:call(Node, erl_prim_loader, read_file_info, [Beam]),
- ?line error = rpc:call(Node, erl_prim_loader, read_file_info, [TopDir ++ "/no_such_file"]),
- ?line error = rpc:call(Node, erl_prim_loader, read_file_info, [TopDir ++ "/ebin/no_such_file"]),
-
+ error = rpc:call(Node, erl_prim_loader, read_file_info, [TopDir ++ "/no_such_file"]),
+ error = rpc:call(Node, erl_prim_loader, read_file_info, [TopDir ++ "/ebin/no_such_file"]),
+
%% Get file
- ?line {ok, Bin, Beam} = rpc:call(Node, erl_prim_loader, get_file, [Beam]),
- ?line if
- FI#file_info.size =:= byte_size(Bin) -> ok;
- true -> exit({FI#file_info.size, byte_size(Bin)})
- end,
- ?line error = rpc:call(Node, erl_prim_loader, get_file, ["/no_such_file"]),
- ?line error = rpc:call(Node, erl_prim_loader, get_file, ["/ebin/no_such_file"]),
+ {ok, Bin, Beam} = rpc:call(Node, erl_prim_loader, get_file, [Beam]),
+ if
+ FI#file_info.size =:= byte_size(Bin) -> ok;
+ true -> exit({FI#file_info.size, byte_size(Bin)})
+ end,
+ error = rpc:call(Node, erl_prim_loader, get_file, ["/no_such_file"]),
+ error = rpc:call(Node, erl_prim_loader, get_file, ["/ebin/no_such_file"]),
ok.
create_archive(Archive, AppDirs) ->
@@ -512,12 +508,9 @@ create_archive(Archive, AppDirs) ->
zip:create(Archive, AppDirs, Opts).
-virtual_dir_in_archive(suite) ->
- [];
-virtual_dir_in_archive(doc) ->
- ["Read virtual directories from archive."];
+%% Read virtual directories from archive.
virtual_dir_in_archive(Config) when is_list(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
Data = <<"A little piece of data.">>,
ArchiveBase = "archive_with_virtual_dirs",
Archive = filename:join([PrivDir, ArchiveBase ++ init:archive_extension()]),
@@ -526,29 +519,29 @@ virtual_dir_in_archive(Config) when is_list(Config) ->
FileInArchive = filename:join([ArchiveBase, EbinBase, FileBase]),
BinFiles = [{FileInArchive, Data}],
Opts = [{compress, []}],
- ?line file:delete(Archive),
+ file:delete(Archive),
io:format("zip:create(~p,\n\t~p,\n\t~p).\n", [Archive, BinFiles, Opts]),
- ?line {ok, Archive} = zip:create(Archive, BinFiles, Opts),
+ {ok, Archive} = zip:create(Archive, BinFiles, Opts),
%% Verify that there is no directories
- ?line {ok, BinFiles} = zip:unzip(Archive, [memory]),
+ {ok, BinFiles} = zip:unzip(Archive, [memory]),
FullPath = filename:join([Archive, FileInArchive]),
- ?line {ok, _} = erl_prim_loader:read_file_info(FullPath),
+ {ok, _} = erl_prim_loader:read_file_info(FullPath),
%% Read one virtual dir
EbinDir = filename:dirname(FullPath),
- ?line {ok, _} = erl_prim_loader:read_file_info(EbinDir),
- ?line {ok, [FileBase]} = erl_prim_loader:list_dir(EbinDir),
+ {ok, _} = erl_prim_loader:read_file_info(EbinDir),
+ {ok, [FileBase]} = erl_prim_loader:list_dir(EbinDir),
%% Read another virtual dir
AppDir = filename:dirname(EbinDir),
- ?line {ok, _} = erl_prim_loader:read_file_info(AppDir),
- ?line {ok, [EbinBase]} = erl_prim_loader:list_dir(AppDir),
-
+ {ok, _} = erl_prim_loader:read_file_info(AppDir),
+ {ok, [EbinBase]} = erl_prim_loader:list_dir(AppDir),
+
%% Cleanup
ok = erl_prim_loader:purge_archive_cache(),
- ?line ok = file:delete(Archive),
+ ok = file:delete(Archive),
ok.
%%%
@@ -611,7 +604,7 @@ compile_app(TopDir, AppName) ->
AppDir = filename:join([TopDir, AppName]),
SrcDir = filename:join([AppDir, "src"]),
OutDir = filename:join([AppDir, "ebin"]),
- ?line {ok, Files} = file:list_dir(SrcDir),
+ {ok, Files} = file:list_dir(SrcDir),
compile_files(Files, SrcDir, OutDir).
compile_files([File | Files], SrcDir, OutDir) ->
diff --git a/lib/kernel/test/error_handler_SUITE.erl b/lib/kernel/test/error_handler_SUITE.erl
index d93ec643ce..6092eebb62 100644
--- a/lib/kernel/test/error_handler_SUITE.erl
+++ b/lib/kernel/test/error_handler_SUITE.erl
@@ -26,7 +26,9 @@
%% Callback from error_handler.
-export(['$handle_undefined_function'/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[undefined_function_handler].
diff --git a/lib/kernel/test/error_logger_SUITE.erl b/lib/kernel/test/error_logger_SUITE.erl
index fa0fc5b75c..07d039349c 100644
--- a/lib/kernel/test/error_logger_SUITE.erl
+++ b/lib/kernel/test/error_logger_SUITE.erl
@@ -40,7 +40,9 @@
terminate/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[error_report, info_report, error, info, emulator, tty,
@@ -64,159 +66,149 @@ end_per_group(_GroupName, Config) ->
%%-----------------------------------------------------------------
-error_report(suite) -> [];
-error_report(doc) -> [];
error_report(Config) when is_list(Config) ->
- ?line error_logger:add_report_handler(?MODULE, self()),
+ error_logger:add_report_handler(?MODULE, self()),
Rep1 = [{tag1,"data1"},{tag2,data2},{tag3,3}],
Rep2 = [testing,"testing",{tag1,"tag1"}],
Rep3 = "This is a string !",
Rep4 = {this,is,a,tuple},
- ?line ok = error_logger:error_report(Rep1),
+ ok = error_logger:error_report(Rep1),
reported(error_report, std_error, Rep1),
- ?line ok = error_logger:error_report(Rep2),
+ ok = error_logger:error_report(Rep2),
reported(error_report, std_error, Rep2),
- ?line ok = error_logger:error_report(Rep3),
+ ok = error_logger:error_report(Rep3),
reported(error_report, std_error, Rep3),
- ?line ok = error_logger:error_report(Rep4),
+ ok = error_logger:error_report(Rep4),
reported(error_report, std_error, Rep4),
- ?line ok = error_logger:error_report(test_type, Rep1),
+ ok = error_logger:error_report(test_type, Rep1),
reported(error_report, test_type, Rep1),
- ?line ok = error_logger:error_report(test_type, Rep2),
+ ok = error_logger:error_report(test_type, Rep2),
reported(error_report, test_type, Rep2),
- ?line ok = error_logger:error_report(test_type, Rep3),
+ ok = error_logger:error_report(test_type, Rep3),
reported(error_report, test_type, Rep3),
- ?line ok = error_logger:error_report(test_type, Rep4),
+ ok = error_logger:error_report(test_type, Rep4),
reported(error_report, test_type, Rep4),
- ?line ok = error_logger:error_report("test_type", Rep1),
+ ok = error_logger:error_report("test_type", Rep1),
reported(error_report, "test_type", Rep1),
- ?line ok = error_logger:error_report({test,type}, Rep2),
+ ok = error_logger:error_report({test,type}, Rep2),
reported(error_report, {test,type}, Rep2),
- ?line ok = error_logger:error_report([test,type], Rep3),
+ ok = error_logger:error_report([test,type], Rep3),
reported(error_report, [test,type], Rep3),
- ?line ok = error_logger:error_report(1, Rep4),
+ ok = error_logger:error_report(1, Rep4),
reported(error_report, 1, Rep4),
- ?line my_yes = error_logger:delete_report_handler(?MODULE),
+ my_yes = error_logger:delete_report_handler(?MODULE),
ok.
%%-----------------------------------------------------------------
-info_report(suite) -> [];
-info_report(doc) -> [];
info_report(Config) when is_list(Config) ->
- ?line error_logger:add_report_handler(?MODULE, self()),
+ error_logger:add_report_handler(?MODULE, self()),
Rep1 = [{tag1,"data1"},{tag2,data2},{tag3,3}],
Rep2 = [testing,"testing",{tag1,"tag1"}],
Rep3 = "This is a string !",
Rep4 = {this,is,a,tuple},
- ?line ok = error_logger:info_report(Rep1),
+ ok = error_logger:info_report(Rep1),
reported(info_report, std_info, Rep1),
- ?line ok = error_logger:info_report(Rep2),
+ ok = error_logger:info_report(Rep2),
reported(info_report, std_info, Rep2),
- ?line ok = error_logger:info_report(Rep3),
+ ok = error_logger:info_report(Rep3),
reported(info_report, std_info, Rep3),
- ?line ok = error_logger:info_report(Rep4),
+ ok = error_logger:info_report(Rep4),
reported(info_report, std_info, Rep4),
- ?line ok = error_logger:info_report(test_type, Rep1),
+ ok = error_logger:info_report(test_type, Rep1),
reported(info_report, test_type, Rep1),
- ?line ok = error_logger:info_report(test_type, Rep2),
+ ok = error_logger:info_report(test_type, Rep2),
reported(info_report, test_type, Rep2),
- ?line ok = error_logger:info_report(test_type, Rep3),
+ ok = error_logger:info_report(test_type, Rep3),
reported(info_report, test_type, Rep3),
- ?line ok = error_logger:info_report(test_type, Rep4),
+ ok = error_logger:info_report(test_type, Rep4),
reported(info_report, test_type, Rep4),
- ?line ok = error_logger:info_report("test_type", Rep1),
+ ok = error_logger:info_report("test_type", Rep1),
reported(info_report, "test_type", Rep1),
- ?line ok = error_logger:info_report({test,type}, Rep2),
+ ok = error_logger:info_report({test,type}, Rep2),
reported(info_report, {test,type}, Rep2),
- ?line ok = error_logger:info_report([test,type], Rep3),
+ ok = error_logger:info_report([test,type], Rep3),
reported(info_report, [test,type], Rep3),
- ?line ok = error_logger:info_report(1, Rep4),
+ ok = error_logger:info_report(1, Rep4),
reported(info_report, 1, Rep4),
- ?line my_yes = error_logger:delete_report_handler(?MODULE),
+ my_yes = error_logger:delete_report_handler(?MODULE),
ok.
%%-----------------------------------------------------------------
-error(suite) -> [];
-error(doc) -> [];
error(Config) when is_list(Config) ->
- ?line error_logger:add_report_handler(?MODULE, self()),
+ error_logger:add_report_handler(?MODULE, self()),
Msg1 = "This is a plain text string~n",
Msg2 = "This is a text with arguments ~p~n",
Arg2 = "This is the argument",
Msg3 = {erroneous,msg},
- ?line ok = error_logger:error_msg(Msg1),
+ ok = error_logger:error_msg(Msg1),
reported(error, Msg1, []),
- ?line ok = error_logger:error_msg(Msg2, Arg2),
+ ok = error_logger:error_msg(Msg2, Arg2),
reported(error, Msg2, Arg2),
- ?line ok = error_logger:error_msg(Msg3),
+ ok = error_logger:error_msg(Msg3),
reported(error, Msg3, []),
- ?line ok = error_logger:error_msg(Msg1, []),
+ ok = error_logger:error_msg(Msg1, []),
reported(error, Msg1, []),
- ?line ok = error_logger:error_msg(Msg2, Arg2),
+ ok = error_logger:error_msg(Msg2, Arg2),
reported(error, Msg2, Arg2),
- ?line ok = error_logger:error_msg(Msg3, []),
+ ok = error_logger:error_msg(Msg3, []),
reported(error, Msg3, []),
- ?line ok = error_logger:format(Msg1, []),
+ ok = error_logger:format(Msg1, []),
reported(error, Msg1, []),
- ?line ok = error_logger:format(Msg2, Arg2),
+ ok = error_logger:format(Msg2, Arg2),
reported(error, Msg2, Arg2),
- ?line ok = error_logger:format(Msg3, []),
+ ok = error_logger:format(Msg3, []),
reported(error, Msg3, []),
- ?line my_yes = error_logger:delete_report_handler(?MODULE),
+ my_yes = error_logger:delete_report_handler(?MODULE),
ok.
%%-----------------------------------------------------------------
-info(suite) -> [];
-info(doc) -> [];
info(Config) when is_list(Config) ->
- ?line error_logger:add_report_handler(?MODULE, self()),
+ error_logger:add_report_handler(?MODULE, self()),
Msg1 = "This is a plain text string~n",
Msg2 = "This is a text with arguments ~p~n",
Arg2 = "This is the argument",
Msg3 = {erroneous,msg},
- ?line ok = error_logger:info_msg(Msg1),
+ ok = error_logger:info_msg(Msg1),
reported(info_msg, Msg1, []),
- ?line ok = error_logger:info_msg(Msg2, Arg2),
+ ok = error_logger:info_msg(Msg2, Arg2),
reported(info_msg, Msg2, Arg2),
- ?line ok = error_logger:info_msg(Msg3),
+ ok = error_logger:info_msg(Msg3),
reported(info_msg, Msg3, []),
- ?line ok = error_logger:info_msg(Msg1, []),
+ ok = error_logger:info_msg(Msg1, []),
reported(info_msg, Msg1, []),
- ?line ok = error_logger:info_msg(Msg2, Arg2),
+ ok = error_logger:info_msg(Msg2, Arg2),
reported(info_msg, Msg2, Arg2),
- ?line ok = error_logger:info_msg(Msg3, []),
+ ok = error_logger:info_msg(Msg3, []),
reported(info_msg, Msg3, []),
- ?line my_yes = error_logger:delete_report_handler(?MODULE),
+ my_yes = error_logger:delete_report_handler(?MODULE),
ok.
%%-----------------------------------------------------------------
-emulator(suite) -> [];
-emulator(doc) -> [];
emulator(Config) when is_list(Config) ->
- ?line error_logger:add_report_handler(?MODULE, self()),
+ error_logger:add_report_handler(?MODULE, self()),
Msg = "Error in process ~p on node ~p with exit value:~n~p~n",
Error = {badmatch,4},
Stack = [{module, function, 2, []}],
Pid = spawn(?MODULE, generate_error, [Error, Stack]),
reported(error, Msg, [Pid, node(), {Error, Stack}]),
- ?line my_yes = error_logger:delete_report_handler(?MODULE),
+ my_yes = error_logger:delete_report_handler(?MODULE),
ok.
generate_error(Error, Stack) ->
@@ -227,52 +219,44 @@ generate_error(Error, Stack) ->
%% want to interact with the test run.
%%-----------------------------------------------------------------
-tty(suite) -> [];
-tty(doc) -> [];
tty(Config) when is_list(Config) ->
- ?line {'EXIT', _Reason} = (catch error_logger:tty(dummy)),
+ {'EXIT', _Reason} = (catch error_logger:tty(dummy)),
ok.
%%-----------------------------------------------------------------
%% If where already exists a logfile we skip this test case !!
%%-----------------------------------------------------------------
-logfile(suite) -> [];
-logfile(doc) -> [];
logfile(Config) when is_list(Config) ->
- ?line case error_logger:logfile(filename) of
- {error, no_log_file} -> % Ok, we continues.
- do_logfile();
- _ ->
- ok
- end.
+ case error_logger:logfile(filename) of
+ {error, no_log_file} -> % Ok, we continues.
+ do_logfile();
+ _ ->
+ ok
+ end.
do_logfile() ->
- ?line {error, _} = error_logger:logfile(close),
- ?line {error, _} = error_logger:logfile({open,{error}}),
- ?line ok = error_logger:logfile({open, "dummy_logfile.log"}),
- ?line "dummy_logfile.log" = error_logger:logfile(filename),
- ?line ok = error_logger:logfile(close),
- ?line {'EXIT',_} = (catch error_logger:logfile(dummy)),
+ {error, _} = error_logger:logfile(close),
+ {error, _} = error_logger:logfile({open,{error}}),
+ ok = error_logger:logfile({open, "dummy_logfile.log"}),
+ "dummy_logfile.log" = error_logger:logfile(filename),
+ ok = error_logger:logfile(close),
+ {'EXIT',_} = (catch error_logger:logfile(dummy)),
ok.
%%-----------------------------------------------------------------
-add(suite) -> [];
-add(doc) -> [];
add(Config) when is_list(Config) ->
- ?line {'EXIT',_} = (catch error_logger:add_report_handler("dummy")),
- ?line {'EXIT',_} = error_logger:add_report_handler(non_existing),
- ?line my_error = error_logger:add_report_handler(?MODULE, [error]),
+ {'EXIT',_} = (catch error_logger:add_report_handler("dummy")),
+ {'EXIT',_} = error_logger:add_report_handler(non_existing),
+ my_error = error_logger:add_report_handler(?MODULE, [error]),
ok.
%%-----------------------------------------------------------------
-delete(suite) -> [];
-delete(doc) -> [];
delete(Config) when is_list(Config) ->
- ?line {'EXIT',_} = (catch error_logger:delete_report_handler("dummy")),
- ?line {error,_} = error_logger:delete_report_handler(non_existing),
+ {'EXIT',_} = (catch error_logger:delete_report_handler("dummy")),
+ {error,_} = error_logger:delete_report_handler(non_existing),
ok.
%%-----------------------------------------------------------------
@@ -284,7 +268,7 @@ reported(Tag, Type, Report) ->
test_server:messages_get(),
ok
after 1000 ->
- test_server:fail(no_report_received)
+ ct:fail(no_report_received)
end.
%%-----------------------------------------------------------------
diff --git a/lib/kernel/test/error_logger_warn_SUITE.erl b/lib/kernel/test/error_logger_warn_SUITE.erl
index 40b3f6bd53..d8bbd42517 100644
--- a/lib/kernel/test/error_logger_warn_SUITE.erl
+++ b/lib/kernel/test/error_logger_warn_SUITE.erl
@@ -42,11 +42,10 @@
end
end)()).
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[basic, warnings_info, warnings_errors, rb_basic,
@@ -70,69 +69,58 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
-basic(doc) ->
- ["Tests basic error logger functionality"];
+%% Tests basic error logger functionality.
basic(Config) when is_list(Config) ->
put(elw_config,Config),
basic().
-warnings_info(doc) ->
- ["Tests mapping warnings to info functionality"];
+%% Tests mapping warnings to info functionality.
warnings_info(Config) when is_list(Config) ->
put(elw_config,Config),
warnings_info().
-warnings_errors(doc) ->
- ["Tests mapping warnings to errors functionality"];
+%% Tests mapping warnings to errors functionality.
warnings_errors(Config) when is_list(Config) ->
put(elw_config,Config),
warnings_errors().
-rb_basic(doc) ->
- ["Tests basic rb functionality"];
+%% Tests basic rb functionality.
rb_basic(Config) when is_list(Config) ->
put(elw_config,Config),
rb_basic().
-rb_warnings_info(doc) ->
- ["Tests warnings as info rb functionality"];
+%% Tests warnings as info rb functionality.
rb_warnings_info(Config) when is_list(Config) ->
put(elw_config,Config),
rb_warnings_info().
-rb_warnings_errors(doc) ->
- ["Tests warnings as errors rb functionality"];
+%% Tests warnings as errors rb functionality.
rb_warnings_errors(Config) when is_list(Config) ->
put(elw_config,Config),
rb_warnings_errors().
-rb_trunc(doc) ->
- ["Tests rb functionality on truncated data"];
+%% Tests rb functionality on truncated data.
rb_trunc(Config) when is_list(Config) ->
put(elw_config,Config),
rb_trunc().
-rb_utc(doc) ->
- ["Tests UTC mapping in rb (-sasl utc_log true)"];
+%% Tests UTC mapping in rb (-sasl utc_log true).
rb_utc(Config) when is_list(Config) ->
put(elw_config,Config),
rb_utc().
-file_utc(doc) ->
- ["Tests UTC mapping in file logger (-stdlib utc_log true)"];
+%% Tests UTC mapping in file logger (-stdlib utc_log true).
file_utc(Config) when is_list(Config) ->
put(elw_config,Config),
file_utc().
-% a small gen_event
+%% a small gen_event
init([Pid]) ->
{ok, Pid}.
@@ -236,7 +224,7 @@ warnings_errors() ->
stop_node(Node),
ok.
-% RB...
+%% RB...
quote(String) ->
case os:type() of
@@ -283,7 +271,7 @@ findstrc(String,File) ->
0
end.
-% Doesn't count empty lines
+%% Doesn't count empty lines
lines(File) ->
length(
string:tokens(
@@ -291,17 +279,17 @@ lines(File) ->
element(2,file:read_file(File))),
"\n")).
-%directories anf filenames
+%% Directories and filenames
ld() ->
Config = get(elw_config),
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
filename:absname(PrivDir).
lf() ->
filename:join([ld(),"logfile.txt"]).
rd() ->
Config = get(elw_config),
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
LogDir = filename:join(PrivDir,"log"),
file:make_dir(LogDir),
filename:absname(LogDir).
@@ -315,7 +303,7 @@ nice_stop_node(Name) ->
{nodedown,Name} -> ok
end.
-%clean out rd() before each report test in order to get only one file...
+%% Clean out rd() before each report test in order to get only one file...
clean_rd() ->
{ok,L} = file:list_dir(rd()),
lists:foreach(fun(F) ->
@@ -352,10 +340,10 @@ one_rb_findstr(Param,String) ->
rb:stop_log(),
findstr(String,lf()).
-% Tests
+%% Tests
rb_basic() ->
clean_rd(),
- % Behold, the magic parameters to activate rb logging...
+ %% Behold, the magic parameters to activate rb logging...
Node = start_node(nn(),"-boot start_sasl -sasl error_logger_mf_dir "++
quote(rd())++" error_logger_mf_maxbytes 5000 "
"error_logger_mf_maxfiles 5"),
@@ -513,9 +501,7 @@ rb_utc() ->
file_utc() ->
file:delete(lf()),
SS="-stdlib utc_log true -kernel error_logger "++ oquote("{file,"++iquote(lf())++"}"),
- %erlang:display(SS),
Node = start_node(nn(),SS),
- %erlang:display(rpc:call(Node,application,get_env,[kernel,error_logger])),
Self = self(),
GL = group_leader(),
fake_gl(Node,error_msg,"~p~n",[Self]),
diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl
index e9401e26ef..74db2970af 100644
--- a/lib/kernel/test/file_SUITE.erl
+++ b/lib/kernel/test/file_SUITE.erl
@@ -51,20 +51,20 @@
pos1/1, pos2/1, pos3/1]).
-export([close/1, consult1/1, path_consult/1, delete/1]).
-export([ eval1/1, path_eval/1, script1/1, path_script/1,
- open1/1,
- old_modes/1, new_modes/1, path_open/1, open_errors/1]).
+ open1/1,
+ old_modes/1, new_modes/1, path_open/1, open_errors/1]).
-export([ file_info_basic_file/1, file_info_basic_directory/1,
- file_info_bad/1, file_info_times/1, file_write_file_info/1]).
+ file_info_bad/1, file_info_times/1, file_write_file_info/1]).
-export([rename/1, access/1, truncate/1, datasync/1, sync/1,
read_write/1, pread_write/1, append/1, exclusive/1]).
-export([ e_delete/1, e_rename/1, e_make_dir/1, e_del_dir/1]).
-export([otp_5814/1, otp_10852/1]).
-export([ read_not_really_compressed/1,
- read_compressed_cooked/1, read_compressed_cooked_binary/1,
- read_cooked_tar_problem/1,
- write_compressed/1, compress_errors/1, catenated_gzips/1,
- compress_async_crash/1]).
+ read_compressed_cooked/1, read_compressed_cooked_binary/1,
+ read_cooked_tar_problem/1,
+ write_compressed/1, compress_errors/1, catenated_gzips/1,
+ compress_async_crash/1]).
-export([ make_link/1, read_link_info_for_non_link/1, symlinks/1]).
@@ -83,7 +83,7 @@
-export([unicode/1]).
-export([altname/1]).
--export([large_file/1, large_write/1]).
+-export([large_file/0, large_file/1, large_write/1]).
-export([read_line_1/1, read_line_2/1, read_line_3/1,read_line_4/1]).
@@ -112,7 +112,9 @@
-define(THROW_ERROR(RES), throw({fail, ?LINE, RES})).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[unicode, altname, read_write_file, {group, dirs},
@@ -172,7 +174,7 @@ init_per_suite(Config) when is_list(Config) ->
case os:type() of
{win32, _} ->
- Priv = ?config(priv_dir, Config),
+ Priv = proplists:get_value(priv_dir, Config),
HasAccessTime =
case ?FILE_MODULE:read_file_info(Priv) of
{ok, #file_info{atime={_, {0, 0, 0}}}} ->
@@ -261,73 +263,66 @@ mini_server(Parent) ->
mini_server(Parent)
end.
-standard_io(suite) ->
- [];
-standard_io(doc) ->
- ["Test that standard i/o-servers work with file module"];
+%% Test that standard i/o-servers work with file module.
standard_io(Config) when is_list(Config) ->
%% Really just a smoke test
- ?line Pid = spawn(?MODULE,mini_server,[self()]),
- ?line register(mini_server,Pid),
- ?line ok = file:write(mini_server,<<"hej\n">>),
- ?line receive
- {io_request,_,_,{put_chars,<<"hej\n">>}} ->
- ok
- after 1000 ->
- exit(noreply)
- end,
- ?line {ok,"aaaaa"} = file:read(mini_server,5),
- ?line receive
- {io_request,_,_,{get_chars,'',5}} ->
- ok
- after 1000 ->
- exit(noreply)
- end,
- ?line {ok,"hej\n"} = file:read_line(mini_server),
- ?line receive
- {io_request,_,_,{get_line,''}} ->
- ok
- after 1000 ->
- exit(noreply)
- end,
- ?line OldGL = group_leader(),
- ?line group_leader(Pid,self()),
- ?line ok = file:write(standard_io,<<"hej\n">>),
- ?line group_leader(OldGL,self()),
- ?line receive
- {io_request,_,_,{put_chars,<<"hej\n">>}} ->
- ok
- after 1000 ->
- exit(noreply)
- end,
- ?line group_leader(Pid,self()),
- ?line {ok,"aaaaa"} = file:read(standard_io,5),
- ?line group_leader(OldGL,self()),
- ?line receive
- {io_request,_,_,{get_chars,'',5}} ->
- ok
- after 1000 ->
- exit(noreply)
- end,
- ?line group_leader(Pid,self()),
- ?line {ok,"hej\n"} = file:read_line(standard_io),
- ?line group_leader(OldGL,self()),
- ?line receive
- {io_request,_,_,{get_line,''}} ->
- ok
- after 1000 ->
- exit(noreply)
- end,
+ Pid = spawn(?MODULE,mini_server,[self()]),
+ register(mini_server,Pid),
+ ok = file:write(mini_server,<<"hej\n">>),
+ receive
+ {io_request,_,_,{put_chars,<<"hej\n">>}} ->
+ ok
+ after 1000 ->
+ exit(noreply)
+ end,
+ {ok,"aaaaa"} = file:read(mini_server,5),
+ receive
+ {io_request,_,_,{get_chars,'',5}} ->
+ ok
+ after 1000 ->
+ exit(noreply)
+ end,
+ {ok,"hej\n"} = file:read_line(mini_server),
+ receive
+ {io_request,_,_,{get_line,''}} ->
+ ok
+ after 1000 ->
+ exit(noreply)
+ end,
+ OldGL = group_leader(),
+ group_leader(Pid,self()),
+ ok = file:write(standard_io,<<"hej\n">>),
+ group_leader(OldGL,self()),
+ receive
+ {io_request,_,_,{put_chars,<<"hej\n">>}} ->
+ ok
+ after 1000 ->
+ exit(noreply)
+ end,
+ group_leader(Pid,self()),
+ {ok,"aaaaa"} = file:read(standard_io,5),
+ group_leader(OldGL,self()),
+ receive
+ {io_request,_,_,{get_chars,'',5}} ->
+ ok
+ after 1000 ->
+ exit(noreply)
+ end,
+ group_leader(Pid,self()),
+ {ok,"hej\n"} = file:read_line(standard_io),
+ group_leader(OldGL,self()),
+ receive
+ {io_request,_,_,{get_line,''}} ->
+ ok
+ after 1000 ->
+ exit(noreply)
+ end,
Pid ! die,
receive after 1000 -> ok end.
-old_io_protocol(suite) ->
- [];
-old_io_protocol(doc) ->
- ["Test that the old file IO protocol =< R16B still works"];
+%% Test that the old file IO protocol =< R16B still works.
old_io_protocol(Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(5)),
- RootDir = ?config(priv_dir,Config),
+ RootDir = proplists:get_value(priv_dir,Config),
Name = filename:join(RootDir,
atom_to_list(?MODULE)
++"old_io_protocol.fil"),
@@ -340,14 +335,11 @@ old_io_protocol(Config) when is_list(Config) ->
end,
ok = ?FILE_MODULE:close(Fd),
{ok, <<>>} = ?FILE_MODULE:read_file(Name),
- test_server:timetrap_cancel(Dog),
[] = flush(),
ok.
-unicode_mode(suite) -> [];
-unicode_mode(doc) -> [""];
unicode_mode(Config) ->
- Dir = {dir, ?config(priv_dir,Config)},
+ Dir = {dir, proplists:get_value(priv_dir,Config)},
OptVariants = [[Dir],
[Dir, {encoding, utf8}],
[Dir, binary],
@@ -493,105 +485,98 @@ um_filename(Str = [_|_], Dir, Options) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-read_write_file(suite) -> [];
-read_write_file(doc) -> [];
read_write_file(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_read_write_file"),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_read_write_file"),
%% Try writing and reading back some term
- ?line SomeTerm = {"This term",{will,be},[written,$t,$o],1,file,[]},
- ?line ok = ?FILE_MODULE:write_file(Name,term_to_binary(SomeTerm)),
- ?line {ok,Bin1} = ?FILE_MODULE:read_file(Name),
- ?line SomeTerm = binary_to_term(Bin1),
-
+ SomeTerm = {"This term",{will,be},[written,$t,$o],1,file,[]},
+ ok = ?FILE_MODULE:write_file(Name,term_to_binary(SomeTerm)),
+ {ok,Bin1} = ?FILE_MODULE:read_file(Name),
+ SomeTerm = binary_to_term(Bin1),
+
%% Try a "null" term
- ?line NullTerm = [],
- ?line ok = ?FILE_MODULE:write_file(Name,term_to_binary(NullTerm)),
- ?line {ok,Bin2} = ?FILE_MODULE:read_file(Name),
- ?line NullTerm = binary_to_term(Bin2),
+ NullTerm = [],
+ ok = ?FILE_MODULE:write_file(Name,term_to_binary(NullTerm)),
+ {ok,Bin2} = ?FILE_MODULE:read_file(Name),
+ NullTerm = binary_to_term(Bin2),
%% Try some "complicated" types
- ?line BigNum = 123456789012345678901234567890,
- ?line ComplTerm = {self(),make_ref(),BigNum,3.14159},
- ?line ok = ?FILE_MODULE:write_file(Name,term_to_binary(ComplTerm)),
- ?line {ok,Bin3} = ?FILE_MODULE:read_file(Name),
- ?line ComplTerm = binary_to_term(Bin3),
+ BigNum = 123456789012345678901234567890,
+ ComplTerm = {self(),make_ref(),BigNum,3.14159},
+ ok = ?FILE_MODULE:write_file(Name,term_to_binary(ComplTerm)),
+ {ok,Bin3} = ?FILE_MODULE:read_file(Name),
+ ComplTerm = binary_to_term(Bin3),
%% Try reading a nonexistent file
- ?line Name2 = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_nonexistent_file"),
- ?line {error, enoent} = ?FILE_MODULE:read_file(Name2),
- ?line {error, enoent} = ?FILE_MODULE:read_file(""),
- ?line {error, enoent} = ?FILE_MODULE:read_file(''),
-
- % Try writing to a bad filename
- ?line {error, enoent} =
+ Name2 = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_nonexistent_file"),
+ {error, enoent} = ?FILE_MODULE:read_file(Name2),
+ {error, enoent} = ?FILE_MODULE:read_file(""),
+ {error, enoent} = ?FILE_MODULE:read_file(''),
+
+ %% Try writing to a bad filename
+ {error, enoent} =
?FILE_MODULE:write_file("",term_to_binary(NullTerm)),
- % Try writing something else than a binary
- ?line {error, badarg} = ?FILE_MODULE:write_file(Name,{1,2,3}),
- ?line {error, badarg} = ?FILE_MODULE:write_file(Name,self()),
+ %% Try writing something else than a binary
+ {error, badarg} = ?FILE_MODULE:write_file(Name,{1,2,3}),
+ {error, badarg} = ?FILE_MODULE:write_file(Name,self()),
%% Some non-term binaries
- ?line ok = ?FILE_MODULE:write_file(Name,[]),
- ?line {ok,Bin4} = ?FILE_MODULE:read_file(Name),
- ?line 0 = byte_size(Bin4),
+ ok = ?FILE_MODULE:write_file(Name,[]),
+ {ok,Bin4} = ?FILE_MODULE:read_file(Name),
+ 0 = byte_size(Bin4),
- ?line ok = ?FILE_MODULE:write_file(Name,[Bin1,[],[[Bin2]]]),
- ?line {ok,Bin5} = ?FILE_MODULE:read_file(Name),
- ?line {Bin1,Bin2} = split_binary(Bin5,byte_size(Bin1)),
+ ok = ?FILE_MODULE:write_file(Name,[Bin1,[],[[Bin2]]]),
+ {ok,Bin5} = ?FILE_MODULE:read_file(Name),
+ {Bin1,Bin2} = split_binary(Bin5,byte_size(Bin1)),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-make_del_dir(suite) -> [];
-make_del_dir(doc) -> [];
make_del_dir(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_mk-dir"),
- ?line ok = ?FILE_MODULE:make_dir(NewDir),
- ?line {error, eexist} = ?FILE_MODULE:make_dir(NewDir),
- ?line ok = ?FILE_MODULE:del_dir(NewDir),
- ?line {error, enoent} = ?FILE_MODULE:del_dir(NewDir),
- % Make sure we are not in a directory directly under test_server
- % as that would result in eacces errors when trying to delete '..',
- % because there are processes having that directory as current.
- ?line ok = ?FILE_MODULE:make_dir(NewDir),
- ?line {ok,CurrentDir} = file:get_cwd(),
+ RootDir = proplists:get_value(priv_dir,Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_mk-dir"),
+ ok = ?FILE_MODULE:make_dir(NewDir),
+ {error, eexist} = ?FILE_MODULE:make_dir(NewDir),
+ ok = ?FILE_MODULE:del_dir(NewDir),
+ {error, enoent} = ?FILE_MODULE:del_dir(NewDir),
+ %% Make sure we are not in a directory directly under test_server
+ %% as that would result in eacces errors when trying to delete '..',
+ %% because there are processes having that directory as current.
+ ok = ?FILE_MODULE:make_dir(NewDir),
+ {ok,CurrentDir} = file:get_cwd(),
case {os:type(), length(NewDir) >= 260 } of
{{win32,_}, true} ->
io:format("Skip set_cwd for windows path longer than 260 (MAX_PATH)\n", []),
io:format("\nNewDir = ~p\n", [NewDir]);
_ ->
- ?line ok = ?FILE_MODULE:set_cwd(NewDir)
+ ok = ?FILE_MODULE:set_cwd(NewDir)
end,
try
%% Check that we get an error when trying to create...
%% a deep directory
- ?line NewDir2 = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_mk-dir-noexist/foo"),
- ?line {error, enoent} = ?FILE_MODULE:make_dir(NewDir2),
+ NewDir2 = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_mk-dir-noexist/foo"),
+ {error, enoent} = ?FILE_MODULE:make_dir(NewDir2),
%% a nameless directory
- ?line {error, enoent} = ?FILE_MODULE:make_dir(""),
+ {error, enoent} = ?FILE_MODULE:make_dir(""),
%% a directory with illegal name
- ?line {error, badarg} = ?FILE_MODULE:make_dir({1,2,3}),
-
+ {error, badarg} = ?FILE_MODULE:make_dir({1,2,3}),
+
%% a directory with illegal name, even if it's a (bad) list
- ?line {error, badarg} = ?FILE_MODULE:make_dir([1,2,3,{}]),
-
+ {error, badarg} = ?FILE_MODULE:make_dir([1,2,3,{}]),
+
%% Maybe this isn't an error, exactly, but worth mentioning anyway:
%% ok = ?FILE_MODULE:make_dir([$f,$o,$o,0,$b,$a,$r])),
%% The above line works, and created a directory "./foo"
@@ -599,40 +584,36 @@ make_del_dir(Config) when is_list(Config) ->
%% a directory, but with a name that incorporates the "bar" part of
%% the list, so that [$f,$o,$o,0,$f,$o,$o] wouldn't refer to the same
%% dir. But this would slow it down.
-
+
%% Try deleting some bad directories
%% Deleting the parent directory to the current, sounds dangerous, huh?
%% Don't worry ;-) the parent directory should never be empty, right?
- ?line case ?FILE_MODULE:del_dir('..') of
- {error, eexist} -> ok;
- {error, eacces} -> ok; %OpenBSD
- {error, einval} -> ok %FreeBSD
- end,
- ?line {error, enoent} = ?FILE_MODULE:del_dir(""),
- ?line {error, badarg} = ?FILE_MODULE:del_dir([3,2,1,{}]),
-
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog)
+ case ?FILE_MODULE:del_dir('..') of
+ {error, eexist} -> ok;
+ {error, eacces} -> ok; %OpenBSD
+ {error, einval} -> ok %FreeBSD
+ end,
+ {error, enoent} = ?FILE_MODULE:del_dir(""),
+ {error, badarg} = ?FILE_MODULE:del_dir([3,2,1,{}]),
+
+ [] = flush()
after
- ?FILE_MODULE:set_cwd(CurrentDir)
+ ?FILE_MODULE:set_cwd(CurrentDir)
end,
ok.
-cur_dir_0(suite) -> [];
-cur_dir_0(doc) -> [];
cur_dir_0(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
%% Find out the current dir, and cd to it ;-)
- ?line {ok,BaseDir} = ?FILE_MODULE:get_cwd(),
- ?line Dir1 = BaseDir ++ "", %% Check that it's a string
- ?line ok = ?FILE_MODULE:set_cwd(Dir1),
+ {ok,BaseDir} = ?FILE_MODULE:get_cwd(),
+ Dir1 = BaseDir ++ "", %% Check that it's a string
+ ok = ?FILE_MODULE:set_cwd(Dir1),
%% Make a new dir, and cd to that
- ?line RootDir = ?config(priv_dir,Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_curdir"),
- ?line ok = ?FILE_MODULE:make_dir(NewDir),
+ RootDir = proplists:get_value(priv_dir,Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_curdir"),
+ ok = ?FILE_MODULE:make_dir(NewDir),
case {os:type(), length(NewDir) >= 260} of
{{win32,_}, true} ->
io:format("Skip set_cwd for windows path longer than 260 (MAX_PATH):\n"),
@@ -665,50 +646,44 @@ cur_dir_0(Config) when is_list(Config) ->
{ok,OldDirFiles} = ?FILE_MODULE:list_dir("."),
false = lists:member(UncommonName,OldDirFiles)
end,
-
+
%% Try doing some bad things
- ?line {error, badarg} = ?FILE_MODULE:set_cwd({foo,bar}),
- ?line {error, enoent} = ?FILE_MODULE:set_cwd(""),
- ?line {error, enoent} = ?FILE_MODULE:set_cwd(".......a......"),
- ?line {ok,BaseDir} = ?FILE_MODULE:get_cwd(), %% Still there?
+ {error, badarg} = ?FILE_MODULE:set_cwd({foo,bar}),
+ {error, enoent} = ?FILE_MODULE:set_cwd(""),
+ {error, enoent} = ?FILE_MODULE:set_cwd(".......a......"),
+ {ok,BaseDir} = ?FILE_MODULE:get_cwd(), %% Still there?
%% On Windows, there should only be slashes, no backslashes,
%% in the return value of get_cwd().
%% (The test is harmless on Unix, because filenames usually
%% don't contain backslashes.)
- ?line {ok, BaseDir} = ?FILE_MODULE:get_cwd(),
- ?line false = lists:member($\\, BaseDir),
+ {ok, BaseDir} = ?FILE_MODULE:get_cwd(),
+ false = lists:member($\\, BaseDir),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
%% Tests ?FILE_MODULE:get_cwd/1.
-cur_dir_1(suite) -> [];
-cur_dir_1(doc) -> [];
cur_dir_1(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
-
- ?line case os:type() of
- {win32, _} ->
- win_cur_dir_1(Config);
- _ ->
- ?line {error, enotsup} = ?FILE_MODULE:get_cwd("d:")
- end,
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ case os:type() of
+ {win32, _} ->
+ win_cur_dir_1(Config);
+ _ ->
+ {error, enotsup} = ?FILE_MODULE:get_cwd("d:")
+ end,
+ [] = flush(),
ok.
-
+
win_cur_dir_1(_Config) ->
- ?line {ok,BaseDir} = ?FILE_MODULE:get_cwd(),
+ {ok,BaseDir} = ?FILE_MODULE:get_cwd(),
%% Get the drive letter from the current directory,
%% and try to get current directory for that drive.
- ?line [Drive,$:|_] = BaseDir,
- ?line {ok,BaseDir} = ?FILE_MODULE:get_cwd([Drive,$:]),
+ [Drive,$:|_] = BaseDir,
+ {ok,BaseDir} = ?FILE_MODULE:get_cwd([Drive,$:]),
io:format("BaseDir = ~s\n", [BaseDir]),
%% Unfortunately, there is no way to move away from the
@@ -723,7 +698,7 @@ win_cur_dir_1(_Config) ->
%%%
list_dir_error(Config) ->
- Priv = ?config(priv_dir, Config),
+ Priv = proplists:get_value(priv_dir, Config),
NonExisting = filename:join(Priv, "non-existing-dir"),
{error,enoent} = ?FILE_MODULE:list_dir(NonExisting),
ok.
@@ -733,7 +708,7 @@ list_dir_error(Config) ->
%%%
list_dir(Config) ->
- RootDir = ?config(priv_dir, Config),
+ RootDir = proplists:get_value(priv_dir, Config),
TestDir = filename:join(RootDir, ?MODULE_STRING++"_list_dir"),
?FILE_MODULE:make_dir(TestDir),
list_dir_1(TestDir, 42, []).
@@ -763,7 +738,7 @@ untranslatable_names(Config) ->
untranslatable_names_1(Config) ->
{ok,OldCwd} = file:get_cwd(),
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
Dir = filename:join(PrivDir, "untranslatable_names"),
ok = file:make_dir(Dir),
Node = start_node(untranslatable_names, "+fnu"),
@@ -804,7 +779,7 @@ untranslatable_names_error(Config) ->
untranslatable_names_error_1(Config) ->
{ok,OldCwd} = file:get_cwd(),
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
Dir = filename:join(PrivDir, "untranslatable_names_error"),
ok = file:make_dir(Dir),
Node = start_node(untranslatable_names, "+fnue"),
@@ -852,7 +827,7 @@ start_node(Name, Args) ->
ct:log("Trying to start ~w@~s~n", [Name,Host]),
case test_server:start_node(Name, peer, [{args,Args}]) of
{error,Reason} ->
- test_server:fail(Reason);
+ ct:fail(Reason);
{ok,Node} ->
ct:log("Node ~p started~n", [Node]),
Node
@@ -863,565 +838,504 @@ start_node(Name, Args) ->
-open1(suite) -> [];
-open1(doc) -> [];
open1(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_files"),
- ?line ok = ?FILE_MODULE:make_dir(NewDir),
- ?line Name = filename:join(NewDir, "foo1.fil"),
- ?line {ok,Fd1} = ?FILE_MODULE:open(Name,read_write),
- ?line {ok,Fd2} = ?FILE_MODULE:open(Name,read),
- ?line Str = "{a,tuple}.\n",
- ?line io:format(Fd1,Str,[]),
- ?line {ok,0} = ?FILE_MODULE:position(Fd1,bof),
- ?line Str = io:get_line(Fd1,''),
- ?line Str = io:get_line(Fd2,''),
- ?line ok = ?FILE_MODULE:close(Fd2),
- ?line {ok,0} = ?FILE_MODULE:position(Fd1,bof),
- ?line ok = ?FILE_MODULE:truncate(Fd1),
- ?line eof = io:get_line(Fd1,''),
- ?line ok = ?FILE_MODULE:close(Fd1),
- ?line {ok,Fd3} = ?FILE_MODULE:open(Name,read),
- ?line eof = io:get_line(Fd3,''),
- ?line ok = ?FILE_MODULE:close(Fd3),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ RootDir = proplists:get_value(priv_dir,Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_files"),
+ ok = ?FILE_MODULE:make_dir(NewDir),
+ Name = filename:join(NewDir, "foo1.fil"),
+ {ok,Fd1} = ?FILE_MODULE:open(Name,read_write),
+ {ok,Fd2} = ?FILE_MODULE:open(Name,read),
+ Str = "{a,tuple}.\n",
+ io:format(Fd1,Str,[]),
+ {ok,0} = ?FILE_MODULE:position(Fd1,bof),
+ Str = io:get_line(Fd1,''),
+ Str = io:get_line(Fd2,''),
+ ok = ?FILE_MODULE:close(Fd2),
+ {ok,0} = ?FILE_MODULE:position(Fd1,bof),
+ ok = ?FILE_MODULE:truncate(Fd1),
+ eof = io:get_line(Fd1,''),
+ ok = ?FILE_MODULE:close(Fd1),
+ {ok,Fd3} = ?FILE_MODULE:open(Name,read),
+ eof = io:get_line(Fd3,''),
+ ok = ?FILE_MODULE:close(Fd3),
+ [] = flush(),
ok.
%% Tests all open modes.
-old_modes(suite) -> [];
-old_modes(doc) -> [];
old_modes(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_old_open_modes"),
- ?line ok = ?FILE_MODULE:make_dir(NewDir),
- ?line Name1 = filename:join(NewDir, "foo1.fil"),
- ?line Marker = "hello, world",
+ RootDir = proplists:get_value(priv_dir, Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_old_open_modes"),
+ ok = ?FILE_MODULE:make_dir(NewDir),
+ Name1 = filename:join(NewDir, "foo1.fil"),
+ Marker = "hello, world",
%% write
- ?line {ok, Fd1} = ?FILE_MODULE:open(Name1, write),
- ?line ok = io:write(Fd1, Marker),
- ?line ok = io:put_chars(Fd1, ".\n"),
- ?line ok = ?FILE_MODULE:close(Fd1),
+ {ok, Fd1} = ?FILE_MODULE:open(Name1, write),
+ ok = io:write(Fd1, Marker),
+ ok = io:put_chars(Fd1, ".\n"),
+ ok = ?FILE_MODULE:close(Fd1),
%% read
- ?line {ok, Fd2} = ?FILE_MODULE:open(Name1, read),
- ?line {ok, Marker} = io:read(Fd2, prompt),
- ?line ok = ?FILE_MODULE:close(Fd2),
+ {ok, Fd2} = ?FILE_MODULE:open(Name1, read),
+ {ok, Marker} = io:read(Fd2, prompt),
+ ok = ?FILE_MODULE:close(Fd2),
%% read_write
- ?line {ok, Fd3} = ?FILE_MODULE:open(Name1, read_write),
- ?line {ok, Marker} = io:read(Fd3, prompt),
- ?line ok = io:write(Fd3, Marker),
- ?line ok = ?FILE_MODULE:close(Fd3),
+ {ok, Fd3} = ?FILE_MODULE:open(Name1, read_write),
+ {ok, Marker} = io:read(Fd3, prompt),
+ ok = io:write(Fd3, Marker),
+ ok = ?FILE_MODULE:close(Fd3),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
-new_modes(suite) -> [];
-new_modes(doc) -> [];
new_modes(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_new_open_modes"),
- ?line ok = ?FILE_MODULE:make_dir(NewDir),
- ?line Name1 = filename:join(NewDir, "foo1.fil"),
- ?line Marker = "hello, world",
+ RootDir = proplists:get_value(priv_dir, Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_new_open_modes"),
+ ok = ?FILE_MODULE:make_dir(NewDir),
+ Name1 = filename:join(NewDir, "foo1.fil"),
+ Marker = "hello, world",
%% write
- ?line {ok, Fd1} = ?FILE_MODULE:open(Name1, [write]),
- ?line ok = io:write(Fd1, Marker),
- ?line ok = io:put_chars(Fd1, ".\n"),
- ?line ok = ?FILE_MODULE:close(Fd1),
+ {ok, Fd1} = ?FILE_MODULE:open(Name1, [write]),
+ ok = io:write(Fd1, Marker),
+ ok = io:put_chars(Fd1, ".\n"),
+ ok = ?FILE_MODULE:close(Fd1),
%% read
- ?line {ok, Fd2} = ?FILE_MODULE:open(Name1, [read]),
- ?line {ok, Marker} = io:read(Fd2, prompt),
- ?line ok = ?FILE_MODULE:close(Fd2),
+ {ok, Fd2} = ?FILE_MODULE:open(Name1, [read]),
+ {ok, Marker} = io:read(Fd2, prompt),
+ ok = ?FILE_MODULE:close(Fd2),
%% read and write
- ?line {ok, Fd3} = ?FILE_MODULE:open(Name1, [read, write]),
- ?line {ok, Marker} = io:read(Fd3, prompt),
- ?line ok = io:write(Fd3, Marker),
- ?line ok = ?FILE_MODULE:close(Fd3),
+ {ok, Fd3} = ?FILE_MODULE:open(Name1, [read, write]),
+ {ok, Marker} = io:read(Fd3, prompt),
+ ok = io:write(Fd3, Marker),
+ ok = ?FILE_MODULE:close(Fd3),
%% read by default
- ?line {ok, Fd4} = ?FILE_MODULE:open(Name1, []),
- ?line {ok, Marker} = io:read(Fd4, prompt),
- ?line ok = ?FILE_MODULE:close(Fd4),
+ {ok, Fd4} = ?FILE_MODULE:open(Name1, []),
+ {ok, Marker} = io:read(Fd4, prompt),
+ ok = ?FILE_MODULE:close(Fd4),
%% read and binary
- ?line {ok, Fd5} = ?FILE_MODULE:open(Name1, [read, binary]),
- ?line {ok, Marker} = io:read(Fd5, prompt),
- ?line ok = ?FILE_MODULE:close(Fd5),
+ {ok, Fd5} = ?FILE_MODULE:open(Name1, [read, binary]),
+ {ok, Marker} = io:read(Fd5, prompt),
+ ok = ?FILE_MODULE:close(Fd5),
%% read, raw
- ?line {ok, Fd6} = ?FILE_MODULE:open(Name1, [read, raw]),
- ?line {ok, [$\[]} = ?FILE_MODULE:read(Fd6, 1),
- ?line ok = ?FILE_MODULE:close(Fd6),
-
- %% write and sync
- case ?FILE_MODULE:open(Name1, [write, sync]) of
- {ok, Fd7} ->
- ok = io:write(Fd7, Marker),
- ok = io:put_chars(Fd7, ".\n"),
- ok = ?FILE_MODULE:close(Fd7),
- {ok, Fd8} = ?FILE_MODULE:open(Name1, [read]),
- {ok, Marker} = io:read(Fd8, prompt),
- ok = ?FILE_MODULE:close(Fd8);
- {error, enotsup} ->
- %% for platforms that don't support the sync option
- ok
- end,
-
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
- ok.
+ {ok, Fd6} = ?FILE_MODULE:open(Name1, [read, raw]),
+ {ok, [$\[]} = ?FILE_MODULE:read(Fd6, 1),
+ ok = ?FILE_MODULE:close(Fd6),
+
+ %% write and sync
+ case ?FILE_MODULE:open(Name1, [write, sync]) of
+ {ok, Fd7} ->
+ ok = io:write(Fd7, Marker),
+ ok = io:put_chars(Fd7, ".\n"),
+ ok = ?FILE_MODULE:close(Fd7),
+ {ok, Fd8} = ?FILE_MODULE:open(Name1, [read]),
+ {ok, Marker} = io:read(Fd8, prompt),
+ ok = ?FILE_MODULE:close(Fd8);
+ {error, enotsup} ->
+ %% for platforms that don't support the sync option
+ ok
+ end,
+
+ [] = flush(),
+ ok.
-path_open(suite) -> [];
-path_open(doc) -> [];
path_open(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_path_open"),
- ?line ok = ?FILE_MODULE:make_dir(NewDir),
- ?line FileName = "path_open.fil",
- ?line Name = filename:join(RootDir, FileName),
- ?line {ok,Fd1,_FullName1} =
+ RootDir = proplists:get_value(priv_dir,Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_path_open"),
+ ok = ?FILE_MODULE:make_dir(NewDir),
+ FileName = "path_open.fil",
+ Name = filename:join(RootDir, FileName),
+ {ok,Fd1,_FullName1} =
?FILE_MODULE:path_open(
- [RootDir,
- "nosuch1",
- NewDir],FileName,write),
- ?line io:format(Fd1,"ABCDEFGH",[]),
- ?line ok = ?FILE_MODULE:close(Fd1),
+ [RootDir,
+ "nosuch1",
+ NewDir],FileName,write),
+ io:format(Fd1,"ABCDEFGH",[]),
+ ok = ?FILE_MODULE:close(Fd1),
%% locate it in the last dir
- ?line {ok,Fd2,_FullName2} =
+ {ok,Fd2,_FullName2} =
?FILE_MODULE:path_open(
- ["nosuch1",
- NewDir,
- RootDir],FileName,read),
- ?line {ok,2} =
+ ["nosuch1",
+ NewDir,
+ RootDir],FileName,read),
+ {ok,2} =
?FILE_MODULE:position(Fd2,2), "C" = io:get_chars(Fd2,'',1),
- ?line ok = ?FILE_MODULE:close(Fd2),
+ ok = ?FILE_MODULE:close(Fd2),
%% Try a failing path
- ?line {error, enoent} = ?FILE_MODULE:path_open(
- ["nosuch1",
- NewDir],FileName,read),
+ {error, enoent} = ?FILE_MODULE:path_open(
+ ["nosuch1",
+ NewDir],FileName,read),
%% Check that it's found regardless of path, if an absolute name given
- ?line {ok,Fd3,_FullPath3} =
+ {ok,Fd3,_FullPath3} =
?FILE_MODULE:path_open(
- ["nosuch1",
- NewDir],Name,read),
- ?line {ok,2} =
+ ["nosuch1",
+ NewDir],Name,read),
+ {ok,2} =
?FILE_MODULE:position(Fd3,2), "C" = io:get_chars(Fd3,'',1),
- ?line ok = ?FILE_MODULE:close(Fd3),
+ ok = ?FILE_MODULE:close(Fd3),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
-close(suite) -> [];
-close(doc) -> [];
close(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_close.fil"),
- ?line {ok,Fd1} = ?FILE_MODULE:open(Name,read_write),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_close.fil"),
+ {ok,Fd1} = ?FILE_MODULE:open(Name,read_write),
%% Just closing it is no fun, we did that a million times already
%% This is a common error, for code written before Erlang 4.3
%% bacause then ?FILE_MODULE:open just returned a Pid, and not everyone
%% really checked what they got.
- ?line {'EXIT',_Msg} = (catch ok = ?FILE_MODULE:close({ok,Fd1})),
- ?line ok = ?FILE_MODULE:close(Fd1),
+ {'EXIT',_Msg} = (catch ok = ?FILE_MODULE:close({ok,Fd1})),
+ ok = ?FILE_MODULE:close(Fd1),
%% Try closing one more time
- ?line Val = ?FILE_MODULE:close(Fd1),
- ?line io:format("Second close gave: ~p",[Val]),
+ Val = ?FILE_MODULE:close(Fd1),
+ io:format("Second close gave: ~p",[Val]),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
-access(suite) -> [];
-access(doc) -> [];
access(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_access.fil"),
- ?line Str = "ABCDEFGH",
- ?line {ok,Fd1} = ?FILE_MODULE:open(Name,write),
- ?line io:format(Fd1,Str,[]),
- ?line ok = ?FILE_MODULE:close(Fd1),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_access.fil"),
+ Str = "ABCDEFGH",
+ {ok,Fd1} = ?FILE_MODULE:open(Name,write),
+ io:format(Fd1,Str,[]),
+ ok = ?FILE_MODULE:close(Fd1),
%% Check that we can't write when in read only mode
- ?line {ok,Fd2} = ?FILE_MODULE:open(Name,read),
- ?line case catch io:format(Fd2,"XXXX",[]) of
- ok ->
- test_server:fail({format,write});
- _ ->
- ok
- end,
- ?line ok = ?FILE_MODULE:close(Fd2),
- ?line {ok,Fd3} = ?FILE_MODULE:open(Name,read),
- ?line Str = io:get_line(Fd3,''),
- ?line ok = ?FILE_MODULE:close(Fd3),
+ {ok,Fd2} = ?FILE_MODULE:open(Name,read),
+ case catch io:format(Fd2,"XXXX",[]) of
+ ok ->
+ ct:fail({format,write});
+ _ ->
+ ok
+ end,
+ ok = ?FILE_MODULE:close(Fd2),
+ {ok,Fd3} = ?FILE_MODULE:open(Name,read),
+ Str = io:get_line(Fd3,''),
+ ok = ?FILE_MODULE:close(Fd3),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
%% Tests ?FILE_MODULE:read/2 and ?FILE_MODULE:write/2.
-read_write(suite) -> [];
-read_write(doc) -> [];
read_write(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_read_write"),
- ?line ok = ?FILE_MODULE:make_dir(NewDir),
- ?line Marker = "hello, world",
- ?line MarkerB = list_to_binary(Marker),
+ RootDir = proplists:get_value(priv_dir, Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_read_write"),
+ ok = ?FILE_MODULE:make_dir(NewDir),
+ Marker = "hello, world",
+ MarkerB = list_to_binary(Marker),
%% Plain file.
- ?line Name1 = filename:join(NewDir, "plain.fil"),
- ?line {ok, Fd1} = ?FILE_MODULE:open(Name1, [read, write]),
- ?line read_write_test(Fd1, Marker, []),
+ Name1 = filename:join(NewDir, "plain.fil"),
+ {ok, Fd1} = ?FILE_MODULE:open(Name1, [read, write]),
+ read_write_test(Fd1, Marker, []),
%% Raw file.
- ?line Name2 = filename:join(NewDir, "raw.fil"),
- ?line {ok, Fd2} = ?FILE_MODULE:open(Name2, [read, write, raw]),
- ?line read_write_test(Fd2, Marker, []),
+ Name2 = filename:join(NewDir, "raw.fil"),
+ {ok, Fd2} = ?FILE_MODULE:open(Name2, [read, write, raw]),
+ read_write_test(Fd2, Marker, []),
%% Plain binary file.
- ?line Name3 = filename:join(NewDir, "plain-b.fil"),
- ?line {ok, Fd3} = ?FILE_MODULE:open(Name3, [read, write, binary]),
- ?line read_write_test(Fd3, MarkerB, <<>>),
+ Name3 = filename:join(NewDir, "plain-b.fil"),
+ {ok, Fd3} = ?FILE_MODULE:open(Name3, [read, write, binary]),
+ read_write_test(Fd3, MarkerB, <<>>),
%% Raw binary file.
- ?line Name4 = filename:join(NewDir, "raw-b.fil"),
- ?line {ok, Fd4} = ?FILE_MODULE:open(Name4, [read, write, raw, binary]),
- ?line read_write_test(Fd4, MarkerB, <<>>),
+ Name4 = filename:join(NewDir, "raw-b.fil"),
+ {ok, Fd4} = ?FILE_MODULE:open(Name4, [read, write, raw, binary]),
+ read_write_test(Fd4, MarkerB, <<>>),
- ?line test_server:timetrap_cancel(Dog),
ok.
read_write_test(File, Marker, Empty) ->
- ?line ok = ?FILE_MODULE:write(File, Marker),
- ?line {ok, 0} = ?FILE_MODULE:position(File, 0),
- ?line {ok, Empty} = ?FILE_MODULE:read(File, 0),
- ?line {ok, Marker} = ?FILE_MODULE:read(File, 100),
- ?line eof = ?FILE_MODULE:read(File, 100),
- ?line {ok, Empty} = ?FILE_MODULE:read(File, 0),
- ?line ok = ?FILE_MODULE:close(File),
- ?line [] = flush(),
+ ok = ?FILE_MODULE:write(File, Marker),
+ {ok, 0} = ?FILE_MODULE:position(File, 0),
+ {ok, Empty} = ?FILE_MODULE:read(File, 0),
+ {ok, Marker} = ?FILE_MODULE:read(File, 100),
+ eof = ?FILE_MODULE:read(File, 100),
+ {ok, Empty} = ?FILE_MODULE:read(File, 0),
+ ok = ?FILE_MODULE:close(File),
+ [] = flush(),
ok.
%% Tests ?FILE_MODULE:pread/2 and ?FILE_MODULE:pwrite/2.
-pread_write(suite) -> [];
-pread_write(doc) -> [];
pread_write(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_pread_write"),
- ?line ok = ?FILE_MODULE:make_dir(NewDir),
- ?line List = "hello, world",
- ?line Bin = list_to_binary(List),
+ RootDir = proplists:get_value(priv_dir, Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_pread_write"),
+ ok = ?FILE_MODULE:make_dir(NewDir),
+ List = "hello, world",
+ Bin = list_to_binary(List),
%% Plain file.
- ?line Name1 = filename:join(NewDir, "plain.fil"),
- ?line {ok, Fd1} = ?FILE_MODULE:open(Name1, [read, write]),
- ?line pread_write_test(Fd1, List),
+ Name1 = filename:join(NewDir, "plain.fil"),
+ {ok, Fd1} = ?FILE_MODULE:open(Name1, [read, write]),
+ pread_write_test(Fd1, List),
%% Raw file.
- ?line Name2 = filename:join(NewDir, "raw.fil"),
- ?line {ok, Fd2} = ?FILE_MODULE:open(Name2, [read, write, raw]),
- ?line pread_write_test(Fd2, List),
+ Name2 = filename:join(NewDir, "raw.fil"),
+ {ok, Fd2} = ?FILE_MODULE:open(Name2, [read, write, raw]),
+ pread_write_test(Fd2, List),
%% Plain file. Binary mode.
- ?line Name3 = filename:join(NewDir, "plain-binary.fil"),
- ?line {ok, Fd3} = ?FILE_MODULE:open(Name3, [binary, read, write]),
- ?line pread_write_test(Fd3, Bin),
+ Name3 = filename:join(NewDir, "plain-binary.fil"),
+ {ok, Fd3} = ?FILE_MODULE:open(Name3, [binary, read, write]),
+ pread_write_test(Fd3, Bin),
%% Raw file. Binary mode.
- ?line Name4 = filename:join(NewDir, "raw-binary.fil"),
- ?line {ok, Fd4} = ?FILE_MODULE:open(Name4, [binary, read, write, raw]),
- ?line pread_write_test(Fd4, Bin),
+ Name4 = filename:join(NewDir, "raw-binary.fil"),
+ {ok, Fd4} = ?FILE_MODULE:open(Name4, [binary, read, write, raw]),
+ pread_write_test(Fd4, Bin),
- ?line test_server:timetrap_cancel(Dog),
ok.
pread_write_test(File, Data) ->
- ?line io:format("~p:pread_write_test(~p,~p)~n", [?MODULE, File, Data]),
- ?line Size = if is_binary(Data) -> byte_size(Data);
- is_list(Data) -> length(Data)
- end,
- ?line I = Size + 17,
- ?line ok = ?FILE_MODULE:pwrite(File, 0, Data),
+ io:format("~p:pread_write_test(~p,~p)~n", [?MODULE, File, Data]),
+ Size = if is_binary(Data) -> byte_size(Data);
+ is_list(Data) -> length(Data)
+ end,
+ I = Size + 17,
+ ok = ?FILE_MODULE:pwrite(File, 0, Data),
Res = ?FILE_MODULE:pread(File, 0, I),
- ?line {ok, Data} = Res,
- ?line eof = ?FILE_MODULE:pread(File, I, 1),
- ?line ok = ?FILE_MODULE:pwrite(File, [{0, Data}, {I, Data}]),
- ?line {ok, [Data, eof, Data]} =
+ {ok, Data} = Res,
+ eof = ?FILE_MODULE:pread(File, I, 1),
+ ok = ?FILE_MODULE:pwrite(File, [{0, Data}, {I, Data}]),
+ {ok, [Data, eof, Data]} =
?FILE_MODULE:pread(File, [{0, Size}, {2*I, 1}, {I, Size}]),
- ?line Plist = lists:seq(21*I, 0, -I),
- ?line Pwrite = lists:map(fun(P)->{P,Data}end, Plist),
- ?line Pread = [{22*I,Size} | lists:map(fun(P)->{P,Size}end, Plist)],
- ?line Presult = [eof | lists:map(fun(_)->Data end, Plist)],
- ?line ok = ?FILE_MODULE:pwrite(File, Pwrite),
- ?line {ok, Presult} = ?FILE_MODULE:pread(File, Pread),
- ?line ok = ?FILE_MODULE:close(File),
- ?line [] = flush(),
+ Plist = lists:seq(21*I, 0, -I),
+ Pwrite = lists:map(fun(P)->{P,Data}end, Plist),
+ Pread = [{22*I,Size} | lists:map(fun(P)->{P,Size}end, Plist)],
+ Presult = [eof | lists:map(fun(_)->Data end, Plist)],
+ ok = ?FILE_MODULE:pwrite(File, Pwrite),
+ {ok, Presult} = ?FILE_MODULE:pread(File, Pread),
+ ok = ?FILE_MODULE:close(File),
+ [] = flush(),
ok.
-append(doc) -> "Test appending to a file.";
-append(suite) -> [];
+%% Test appending to a file.
append(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_append"),
- ?line ok = ?FILE_MODULE:make_dir(NewDir),
+ RootDir = proplists:get_value(priv_dir, Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_append"),
+ ok = ?FILE_MODULE:make_dir(NewDir),
- ?line First = "First line\n",
- ?line Second = "Seond lines comes here\n",
- ?line Third = "And here is the third line\n",
+ First = "First line\n",
+ Second = "Seond lines comes here\n",
+ Third = "And here is the third line\n",
%% Write a small text file.
- ?line Name1 = filename:join(NewDir, "a_file.txt"),
- ?line {ok, Fd1} = ?FILE_MODULE:open(Name1, [write]),
- ?line ok = io:format(Fd1, First, []),
- ?line ok = io:format(Fd1, Second, []),
- ?line ok = ?FILE_MODULE:close(Fd1),
+ Name1 = filename:join(NewDir, "a_file.txt"),
+ {ok, Fd1} = ?FILE_MODULE:open(Name1, [write]),
+ ok = io:format(Fd1, First, []),
+ ok = io:format(Fd1, Second, []),
+ ok = ?FILE_MODULE:close(Fd1),
%% Open it a again and a append a line to it.
- ?line {ok, Fd2} = ?FILE_MODULE:open(Name1, [append]),
- ?line ok = io:format(Fd2, Third, []),
- ?line ok = ?FILE_MODULE:close(Fd2),
+ {ok, Fd2} = ?FILE_MODULE:open(Name1, [append]),
+ ok = io:format(Fd2, Third, []),
+ ok = ?FILE_MODULE:close(Fd2),
%% Read it back and verify.
- ?line Expected = list_to_binary([First, Second, Third]),
- ?line {ok, Expected} = ?FILE_MODULE:read_file(Name1),
+ Expected = list_to_binary([First, Second, Third]),
+ {ok, Expected} = ?FILE_MODULE:read_file(Name1),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
-open_errors(suite) -> [];
-open_errors(doc) -> [];
open_errors(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line DataDir =
+ DataDir =
filename:dirname(
- filename:join(?config(data_dir, Config), "x")),
- ?line DataDirSlash = DataDir++"/",
- ?line {error, E1} = ?FILE_MODULE:open(DataDir, [read]),
- ?line {error, E2} = ?FILE_MODULE:open(DataDirSlash, [read]),
- ?line {error, E3} = ?FILE_MODULE:open(DataDir, [write]),
- ?line {error, E4} = ?FILE_MODULE:open(DataDirSlash, [write]),
- ?line {eisdir,eisdir,eisdir,eisdir} = {E1,E2,E3,E4},
-
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ filename:join(proplists:get_value(data_dir, Config), "x")),
+ DataDirSlash = DataDir++"/",
+ {error, E1} = ?FILE_MODULE:open(DataDir, [read]),
+ {error, E2} = ?FILE_MODULE:open(DataDirSlash, [read]),
+ {error, E3} = ?FILE_MODULE:open(DataDir, [write]),
+ {error, E4} = ?FILE_MODULE:open(DataDirSlash, [write]),
+ {eisdir,eisdir,eisdir,eisdir} = {E1,E2,E3,E4},
+
+ [] = flush(),
ok.
-exclusive(suite) -> [];
-exclusive(doc) -> "Test exclusive access to a file.";
+%% Test exclusive access to a file.
exclusive(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_exclusive"),
- ?line ok = ?FILE_MODULE:make_dir(NewDir),
- ?line Name = filename:join(NewDir, "ex_file.txt"),
- ?line {ok, Fd} = ?FILE_MODULE:open(Name, [write, exclusive]),
- ?line {error, eexist} = ?FILE_MODULE:open(Name, [write, exclusive]),
- ?line ok = ?FILE_MODULE:close(Fd),
- ?line test_server:timetrap_cancel(Dog),
+ RootDir = proplists:get_value(priv_dir,Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_exclusive"),
+ ok = ?FILE_MODULE:make_dir(NewDir),
+ Name = filename:join(NewDir, "ex_file.txt"),
+ {ok, Fd} = ?FILE_MODULE:open(Name, [write, exclusive]),
+ {error, eexist} = ?FILE_MODULE:open(Name, [write, exclusive]),
+ ok = ?FILE_MODULE:close(Fd),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-pos1(suite) -> [];
-pos1(doc) -> [];
pos1(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_pos1.fil"),
- ?line {ok,Fd1} = ?FILE_MODULE:open(Name,write),
- ?line io:format(Fd1,"ABCDEFGH",[]),
- ?line ok = ?FILE_MODULE:close(Fd1),
- ?line {ok,Fd2} = ?FILE_MODULE:open(Name,read),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_pos1.fil"),
+ {ok,Fd1} = ?FILE_MODULE:open(Name,write),
+ io:format(Fd1,"ABCDEFGH",[]),
+ ok = ?FILE_MODULE:close(Fd1),
+ {ok,Fd2} = ?FILE_MODULE:open(Name,read),
%% Start pos is first char
- ?line io:format("Relative positions"),
- ?line "A" = io:get_chars(Fd2,'',1),
- ?line {ok,2} = ?FILE_MODULE:position(Fd2,{cur,1}),
- ?line "C" = io:get_chars(Fd2,'',1),
- ?line {ok,0} = ?FILE_MODULE:position(Fd2,{cur,-3}),
- ?line "A" = io:get_chars(Fd2,'',1),
+ io:format("Relative positions"),
+ "A" = io:get_chars(Fd2,'',1),
+ {ok,2} = ?FILE_MODULE:position(Fd2,{cur,1}),
+ "C" = io:get_chars(Fd2,'',1),
+ {ok,0} = ?FILE_MODULE:position(Fd2,{cur,-3}),
+ "A" = io:get_chars(Fd2,'',1),
%% Backwards from first char should be an error
- ?line {ok,0} = ?FILE_MODULE:position(Fd2,{cur,-1}),
- ?line {error, einval} = ?FILE_MODULE:position(Fd2,{cur,-1}),
+ {ok,0} = ?FILE_MODULE:position(Fd2,{cur,-1}),
+ {error, einval} = ?FILE_MODULE:position(Fd2,{cur,-1}),
%% Reset position and move again
- ?line {ok,0} = ?FILE_MODULE:position(Fd2,0),
- ?line {ok,2} = ?FILE_MODULE:position(Fd2,{cur,2}),
- ?line "C" = io:get_chars(Fd2,'',1),
+ {ok,0} = ?FILE_MODULE:position(Fd2,0),
+ {ok,2} = ?FILE_MODULE:position(Fd2,{cur,2}),
+ "C" = io:get_chars(Fd2,'',1),
%% Go a lot forwards
- ?line {ok,13} = ?FILE_MODULE:position(Fd2,{cur,10}),
- ?line eof = io:get_chars(Fd2,'',1),
+ {ok,13} = ?FILE_MODULE:position(Fd2,{cur,10}),
+ eof = io:get_chars(Fd2,'',1),
%% Try some fixed positions
- ?line io:format("Fixed positions"),
- ?line {ok,8} =
+ io:format("Fixed positions"),
+ {ok,8} =
?FILE_MODULE:position(Fd2,8), eof = io:get_chars(Fd2,'',1),
- ?line {ok,8} =
+ {ok,8} =
?FILE_MODULE:position(Fd2,cur), eof = io:get_chars(Fd2,'',1),
- ?line {ok,7} =
+ {ok,7} =
?FILE_MODULE:position(Fd2,7), "H" = io:get_chars(Fd2,'',1),
- ?line {ok,0} =
+ {ok,0} =
?FILE_MODULE:position(Fd2,0), "A" = io:get_chars(Fd2,'',1),
- ?line {ok,3} =
+ {ok,3} =
?FILE_MODULE:position(Fd2,3), "D" = io:get_chars(Fd2,'',1),
- ?line {ok,12} =
+ {ok,12} =
?FILE_MODULE:position(Fd2,12), eof = io:get_chars(Fd2,'',1),
- ?line {ok,3} =
+ {ok,3} =
?FILE_MODULE:position(Fd2,3), "D" = io:get_chars(Fd2,'',1),
%% Try the {bof,X} notation
- ?line {ok,3} = ?FILE_MODULE:position(Fd2,{bof,3}),
- ?line "D" = io:get_chars(Fd2,'',1),
+ {ok,3} = ?FILE_MODULE:position(Fd2,{bof,3}),
+ "D" = io:get_chars(Fd2,'',1),
%% Try eof positions
- ?line io:format("EOF positions"),
- ?line {ok,8} =
+ io:format("EOF positions"),
+ {ok,8} =
?FILE_MODULE:position(Fd2,{eof,0}), eof=io:get_chars(Fd2,'',1),
- ?line {ok,7} =
+ {ok,7} =
?FILE_MODULE:position(Fd2,{eof,-1}),
- ?line "H" = io:get_chars(Fd2,'',1),
- ?line {ok,0} =
+ "H" = io:get_chars(Fd2,'',1),
+ {ok,0} =
?FILE_MODULE:position(Fd2,{eof,-8}), "A"=io:get_chars(Fd2,'',1),
- ?line {error, einval} = ?FILE_MODULE:position(Fd2,{eof,-9}),
+ {error, einval} = ?FILE_MODULE:position(Fd2,{eof,-9}),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
-pos2(suite) -> [];
-pos2(doc) -> [];
pos2(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_pos2.fil"),
- ?line {ok,Fd1} = ?FILE_MODULE:open(Name,write),
- ?line io:format(Fd1,"ABCDEFGH",[]),
- ?line ok = ?FILE_MODULE:close(Fd1),
- ?line {ok,Fd2} = ?FILE_MODULE:open(Name,read),
- ?line {error, einval} = ?FILE_MODULE:position(Fd2,-1),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_pos2.fil"),
+ {ok,Fd1} = ?FILE_MODULE:open(Name,write),
+ io:format(Fd1,"ABCDEFGH",[]),
+ ok = ?FILE_MODULE:close(Fd1),
+ {ok,Fd2} = ?FILE_MODULE:open(Name,read),
+ {error, einval} = ?FILE_MODULE:position(Fd2,-1),
%% Make sure that we still can search after an error.
- ?line {ok,0} = ?FILE_MODULE:position(Fd2, 0),
- ?line {ok,3} = ?FILE_MODULE:position(Fd2, {bof,3}),
- ?line "D" = io:get_chars(Fd2,'',1),
+ {ok,0} = ?FILE_MODULE:position(Fd2, 0),
+ {ok,3} = ?FILE_MODULE:position(Fd2, {bof,3}),
+ "D" = io:get_chars(Fd2,'',1),
- ?line [] = flush(),
- ?line io:format("DONE"),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
+ io:format("DONE"),
ok.
-pos3(suite) -> [];
-pos3(doc) -> ["When it does not use raw mode, file:position had a bug."];
+%% When it does not use raw mode, file:position had a bug.
pos3(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(data_dir, Config),
- ?line Name = filename:join(RootDir, "realmen.html.gz"),
+ RootDir = proplists:get_value(data_dir, Config),
+ Name = filename:join(RootDir, "realmen.html.gz"),
- ?line {ok, Fd} = ?FILE_MODULE:open(Name, [read, binary]),
- ?line {ok, _} = ?FILE_MODULE:read(Fd, 5),
- ?line {error, einval} = ?FILE_MODULE:position(Fd, {bof, -1}),
+ {ok, Fd} = ?FILE_MODULE:open(Name, [read, binary]),
+ {ok, _} = ?FILE_MODULE:read(Fd, 5),
+ {error, einval} = ?FILE_MODULE:position(Fd, {bof, -1}),
%% Here ok had returned =(
- ?line {error, einval} = ?FILE_MODULE:position(Fd, {cur, -10}),
+ {error, einval} = ?FILE_MODULE:position(Fd, {cur, -10}),
%% That test is actually questionable since file:position/2
%% is documented to leave the file position undefined after
%% it has returned an error. But on Posix systems the position
%% is guaranteed to be unchanged after an error return. On e.g
%% Windows there is nothing stated about this in the documentation.
- ?line test_server:timetrap_cancel(Dog),
ok.
-file_info_basic_file(suite) -> [];
-file_info_basic_file(doc) -> [];
file_info_basic_file(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir, Config),
+ RootDir = proplists:get_value(priv_dir, Config),
%% Create a short file.
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_basic_test.fil"),
- ?line {ok,Fd1} = ?FILE_MODULE:open(Name, write),
- ?line io:put_chars(Fd1, "foo bar"),
- ?line ok = ?FILE_MODULE:close(Fd1),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_basic_test.fil"),
+ {ok,Fd1} = ?FILE_MODULE:open(Name, write),
+ io:put_chars(Fd1, "foo bar"),
+ ok = ?FILE_MODULE:close(Fd1),
%% Test that the file has the expected attributes.
%% The times are tricky, so we will save them to a separate test case.
{ok,FileInfo} = ?FILE_MODULE:read_file_info(Name),
{ok,FileInfo} = ?FILE_MODULE:read_file_info(Name, [raw]),
#file_info{size=Size,type=Type,access=Access,
- atime=AccessTime,mtime=ModifyTime} = FileInfo,
- ?line io:format("Access ~p, Modify ~p", [AccessTime, ModifyTime]),
- ?line Size = 7,
- ?line Type = regular,
- ?line read_write = Access,
- ?line true = abs(time_dist(filter_atime(AccessTime, Config),
- filter_atime(ModifyTime,
- Config))) < 2,
- ?line all_integers(tuple_to_list(AccessTime) ++ tuple_to_list(ModifyTime)),
-
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ atime=AccessTime,mtime=ModifyTime} = FileInfo,
+ io:format("Access ~p, Modify ~p", [AccessTime, ModifyTime]),
+ Size = 7,
+ Type = regular,
+ read_write = Access,
+ true = abs(time_dist(filter_atime(AccessTime, Config),
+ filter_atime(ModifyTime,
+ Config))) < 2,
+ all_integers(tuple_to_list(AccessTime) ++ tuple_to_list(ModifyTime)),
+
+ [] = flush(),
ok.
-file_info_basic_directory(suite) -> [];
-file_info_basic_directory(doc) -> [];
file_info_basic_directory(Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(5)),
-
%% Note: filename:join/1 removes any trailing slash,
%% which is essential for ?FILE_MODULE:file_info/1 to work on
%% platforms such as Windows95.
- RootDir = filename:join([?config(priv_dir, Config)]),
+ RootDir = filename:join([proplists:get_value(priv_dir, Config)]),
%% Test that the RootDir directory has the expected attributes.
test_directory(RootDir, read_write),
@@ -1432,65 +1346,57 @@ file_info_basic_directory(Config) when is_list(Config) ->
%% directories.
case os:type() of
{win32, _} ->
- ?line test_directory("/", read_write),
- ?line test_directory("c:/", read_write),
- ?line test_directory("c:\\", read_write);
+ test_directory("/", read_write),
+ test_directory("c:/", read_write),
+ test_directory("c:\\", read_write);
_ ->
- ?line test_directory("/", read)
+ test_directory("/", read)
end,
- test_server:timetrap_cancel(Dog).
+ ok.
test_directory(Name, ExpectedAccess) ->
{ok,FileInfo} = ?FILE_MODULE:read_file_info(Name),
{ok,FileInfo} = ?FILE_MODULE:read_file_info(Name, [raw]),
#file_info{size=Size,type=Type,access=Access,
atime=AccessTime,mtime=ModifyTime} = FileInfo,
- ?line io:format("Testing directory ~s", [Name]),
- ?line io:format("Directory size is ~p", [Size]),
- ?line io:format("Access ~p", [Access]),
- ?line io:format("Access time ~p; Modify time~p",
- [AccessTime, ModifyTime]),
- ?line Type = directory,
- ?line Access = ExpectedAccess,
- ?line all_integers(tuple_to_list(AccessTime) ++ tuple_to_list(ModifyTime)),
- ?line [] = flush(),
+ io:format("Testing directory ~s", [Name]),
+ io:format("Directory size is ~p", [Size]),
+ io:format("Access ~p", [Access]),
+ io:format("Access time ~p; Modify time~p",
+ [AccessTime, ModifyTime]),
+ Type = directory,
+ Access = ExpectedAccess,
+ all_integers(tuple_to_list(AccessTime) ++ tuple_to_list(ModifyTime)),
+ [] = flush(),
ok.
all_integers([{A,B,C}|T]) ->
all_integers([A,B,C|T]);
all_integers([Int|Rest]) when is_integer(Int) ->
- ?line all_integers(Rest);
+ all_integers(Rest);
all_integers([]) -> ok.
%% Try something nonexistent.
-file_info_bad(suite) -> [];
-file_info_bad(doc) -> [];
file_info_bad(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = filename:join([?config(priv_dir, Config)]),
+ RootDir = filename:join([proplists:get_value(priv_dir, Config)]),
FileName = filename:join(RootDir, atom_to_list(?MODULE) ++ "_nonexistent"),
{error,enoent} = ?FILE_MODULE:read_file_info(FileName),
{error,enoent} = ?FILE_MODULE:read_file_info(FileName, [raw]),
- ?line {error, enoent} = ?FILE_MODULE:read_file_info(""),
+ {error, enoent} = ?FILE_MODULE:read_file_info(""),
{error, enoent} = ?FILE_MODULE:read_file_info("", [raw]),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
%% Test that the file times behave as they should.
-file_info_times(suite) -> [];
-file_info_times(doc) -> [];
file_info_times(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(60)),
%% We have to try this twice, since if the test runs across the change
%% of a month the time diff calculations will fail. But it won't happen
%% if you run it twice in succession.
- ?line test_server:m_out_of_n(
- 1,2,
- fun() -> ?line file_info_int(Config) end),
- ?line test_server:timetrap_cancel(Dog),
+ test_server:m_out_of_n(
+ 1,2,
+ fun() -> file_info_int(Config) end),
ok.
file_info_int(Config) ->
@@ -1498,14 +1404,14 @@ file_info_int(Config) ->
%% which is essential for ?FILE_MODULE:file_info/1 to work on
%% platforms such as Windows95.
- ?line RootDir = filename:join([?config(priv_dir, Config)]),
- ?line test_server:format("RootDir = ~p", [RootDir]),
+ RootDir = filename:join([proplists:get_value(priv_dir, Config)]),
+ io:format("RootDir = ~p", [RootDir]),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_file_info.fil"),
- ?line {ok,Fd1} = ?FILE_MODULE:open(Name,write),
- ?line io:put_chars(Fd1,"foo"),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_file_info.fil"),
+ {ok,Fd1} = ?FILE_MODULE:open(Name,write),
+ io:put_chars(Fd1,"foo"),
%% check that the file got a modify date max a few seconds away from now
{ok,FileInfo1} = ?FILE_MODULE:read_file_info(Name),
@@ -1518,31 +1424,31 @@ file_info_int(Config) ->
#file_info{type=regular,atime=AccTime1,mtime=ModTime1} = FileInfo1,
- ?line Now = erlang:localtime(), %???
- ?line io:format("Now ~p",[Now]),
- ?line io:format("Open file Acc ~p Mod ~p",[AccTime1,ModTime1]),
- ?line true = abs(time_dist(filter_atime(Now, Config),
- filter_atime(AccTime1,
- Config))) < 8,
- ?line true = abs(time_dist(Now,ModTime1)) < 8,
+ Now = erlang:localtime(), %???
+ io:format("Now ~p",[Now]),
+ io:format("Open file Acc ~p Mod ~p",[AccTime1,ModTime1]),
+ true = abs(time_dist(filter_atime(Now, Config),
+ filter_atime(AccTime1,
+ Config))) < 8,
+ true = abs(time_dist(Now,ModTime1)) < 8,
%% Sleep until we can be sure the seconds value has changed.
%% Note: FAT-based filesystem (like on Windows 95) have
%% a resolution of 2 seconds.
- ?line test_server:sleep(test_server:seconds(2.2)),
+ timer:sleep(2200),
%% close the file, and watch the modify date change
- ?line ok = ?FILE_MODULE:close(Fd1),
+ ok = ?FILE_MODULE:close(Fd1),
{ok,FileInfo2} = ?FILE_MODULE:read_file_info(Name),
{ok,FileInfo2} = ?FILE_MODULE:read_file_info(Name, [raw]),
#file_info{size=Size,type=regular,access=Access,
atime=AccTime2,mtime=ModTime2} = FileInfo2,
- ?line io:format("Closed file Acc ~p Mod ~p",[AccTime2,ModTime2]),
- ?line true = time_dist(ModTime1,ModTime2) >= 0,
+ io:format("Closed file Acc ~p Mod ~p",[AccTime2,ModTime2]),
+ true = time_dist(ModTime1,ModTime2) >= 0,
%% this file is supposed to be binary, so it'd better keep it's size
- ?line Size = 3,
- ?line Access = read_write,
+ Size = 3,
+ Access = read_write,
%% Do some directory checking
{ok,FileInfo3} = ?FILE_MODULE:read_file_info(RootDir),
@@ -1550,12 +1456,12 @@ file_info_int(Config) ->
#file_info{size=DSize,type=directory,access=DAccess,
atime=AccTime3,mtime=ModTime3} = FileInfo3,
%% this dir was modified only a few secs ago
- ?line io:format("Dir Acc ~p; Mod ~p; Now ~p", [AccTime3, ModTime3, Now]),
- ?line true = abs(time_dist(Now,ModTime3)) < 5,
- ?line DAccess = read_write,
- ?line io:format("Dir size is ~p",[DSize]),
+ io:format("Dir Acc ~p; Mod ~p; Now ~p", [AccTime3, ModTime3, Now]),
+ true = abs(time_dist(Now,ModTime3)) < 5,
+ DAccess = read_write,
+ io:format("Dir size is ~p",[DSize]),
- ?line [] = flush(),
+ [] = flush(),
ok.
%% Filter access times, to copy with a deficiency of FAT file systems
@@ -1566,9 +1472,9 @@ filter_atime(Atime, Config) ->
true ->
case Atime of
{Date, _} ->
- {Date, {0, 0, 0}};
+ {Date, {0, 0, 0}};
{Y, M, D, _, _, _} ->
- {Y, M, D, 0, 0, 0}
+ {Y, M, D, 0, 0, 0}
end;
false ->
Atime
@@ -1576,50 +1482,47 @@ filter_atime(Atime, Config) ->
%% Test the write_file_info/2 function.
-file_write_file_info(suite) -> [];
-file_write_file_info(doc) -> [];
file_write_file_info(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = get_good_directory(Config),
- ?line test_server:format("RootDir = ~p", [RootDir]),
+ RootDir = get_good_directory(Config),
+ io:format("RootDir = ~p", [RootDir]),
%% Set the file to read only AND update the file times at the same time.
%% (This used to fail on Windows NT/95 for a local filesystem.)
%% Note: Seconds must be even; see note in file_info_times/1.
- ?line Name1 = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_write_file_info_ro"),
- ?line ok = ?FILE_MODULE:write_file(Name1, "hello"),
- ?line Time = {{1997, 01, 02}, {12, 35, 42}},
- ?line Info = #file_info{mode=8#400, atime=Time, mtime=Time, ctime=Time},
- ?line ok = ?FILE_MODULE:write_file_info(Name1, Info),
+ Name1 = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_write_file_info_ro"),
+ ok = ?FILE_MODULE:write_file(Name1, "hello"),
+ Time = {{1997, 01, 02}, {12, 35, 42}},
+ Info = #file_info{mode=8#400, atime=Time, mtime=Time, ctime=Time},
+ ok = ?FILE_MODULE:write_file_info(Name1, Info),
%% Read back the times.
- ?line {ok, ActualInfo} = ?FILE_MODULE:read_file_info(Name1),
- ?line #file_info{mode=_Mode, atime=ActAtime, mtime=Time,
- ctime=ActCtime} = ActualInfo,
- ?line FilteredAtime = filter_atime(Time, Config),
- ?line FilteredAtime = filter_atime(ActAtime, Config),
- ?line case os:type() of
- {win32, _} ->
- %% On Windows, "ctime" means creation time and it can
- %% be set.
- ActCtime = Time;
- _ ->
- ok
- end,
- ?line {error, eacces} = ?FILE_MODULE:write_file(Name1, "hello again"),
+ {ok, ActualInfo} = ?FILE_MODULE:read_file_info(Name1),
+ #file_info{mode=_Mode, atime=ActAtime, mtime=Time,
+ ctime=ActCtime} = ActualInfo,
+ FilteredAtime = filter_atime(Time, Config),
+ FilteredAtime = filter_atime(ActAtime, Config),
+ case os:type() of
+ {win32, _} ->
+ %% On Windows, "ctime" means creation time and it can
+ %% be set.
+ ActCtime = Time;
+ _ ->
+ ok
+ end,
+ {error, eacces} = ?FILE_MODULE:write_file(Name1, "hello again"),
%% Make the file writable again.
- ?line ?FILE_MODULE:write_file_info(Name1, #file_info{mode=8#600}),
- ?line ok = ?FILE_MODULE:write_file(Name1, "hello again"),
+ ?FILE_MODULE:write_file_info(Name1, #file_info{mode=8#600}),
+ ok = ?FILE_MODULE:write_file(Name1, "hello again"),
%% And unwritable.
- ?line ?FILE_MODULE:write_file_info(Name1, #file_info{mode=8#400}),
- ?line {error, eacces} = ?FILE_MODULE:write_file(Name1, "hello again"),
+ ?FILE_MODULE:write_file_info(Name1, #file_info{mode=8#400}),
+ {error, eacces} = ?FILE_MODULE:write_file(Name1, "hello again"),
%% Same with raw.
?FILE_MODULE:write_file_info(Name1, #file_info{mode=8#600}, [raw]),
@@ -1630,634 +1533,577 @@ file_write_file_info(Config) when is_list(Config) ->
%% Write the times again.
%% Note: Seconds must be even; see note in file_info_times/1.
- ?line NewTime = {{1997, 02, 15}, {13, 18, 20}},
- ?line NewInfo = #file_info{atime=NewTime, mtime=NewTime, ctime=NewTime},
- ?line ok = ?FILE_MODULE:write_file_info(Name1, NewInfo),
- ?line {ok, ActualInfo2} = ?FILE_MODULE:read_file_info(Name1),
- ?line #file_info{atime=NewActAtime, mtime=NewTime,
- ctime=NewActCtime} = ActualInfo2,
- ?line NewFilteredAtime = filter_atime(NewTime, Config),
- ?line NewFilteredAtime = filter_atime(NewActAtime, Config),
- ?line case os:type() of
- {win32, _} -> NewActCtime = NewTime;
- _ -> ok
- end,
+ NewTime = {{1997, 02, 15}, {13, 18, 20}},
+ NewInfo = #file_info{atime=NewTime, mtime=NewTime, ctime=NewTime},
+ ok = ?FILE_MODULE:write_file_info(Name1, NewInfo),
+ {ok, ActualInfo2} = ?FILE_MODULE:read_file_info(Name1),
+ #file_info{atime=NewActAtime, mtime=NewTime,
+ ctime=NewActCtime} = ActualInfo2,
+ NewFilteredAtime = filter_atime(NewTime, Config),
+ NewFilteredAtime = filter_atime(NewActAtime, Config),
+ case os:type() of
+ {win32, _} -> NewActCtime = NewTime;
+ _ -> ok
+ end,
%% The file should still be unwritable.
- ?line {error, eacces} = ?FILE_MODULE:write_file(Name1, "hello again"),
+ {error, eacces} = ?FILE_MODULE:write_file(Name1, "hello again"),
%% Make the file writeable again, so that we can remove the
%% test suites ... :-)
- ?line ?FILE_MODULE:write_file_info(Name1, #file_info{mode=8#600}),
+ ?FILE_MODULE:write_file_info(Name1, #file_info{mode=8#600}),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
%% Returns a directory on a file system that has correct file times.
get_good_directory(Config) ->
- ?line ?config(priv_dir, Config).
+ proplists:get_value(priv_dir, Config).
-consult1(suite) -> [];
-consult1(doc) -> [];
consult1(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_consult.fil"),
- ?line {ok,Fd1} = ?FILE_MODULE:open(Name,write),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_consult.fil"),
+ {ok,Fd1} = ?FILE_MODULE:open(Name,write),
%% note that there is no final \n (only a space)
- ?line io:format(Fd1,
- "{this,[is,1.0],'journey'}.\n\"into\". (sound). ",
- []),
- ?line ok = ?FILE_MODULE:close(Fd1),
- ?line {ok,[{this,[is,1.0],journey},"into",sound]} =
+ io:format(Fd1,
+ "{this,[is,1.0],'journey'}.\n\"into\". (sound). ",
+ []),
+ ok = ?FILE_MODULE:close(Fd1),
+ {ok,[{this,[is,1.0],journey},"into",sound]} =
?FILE_MODULE:consult(Name),
- ?line {ok,Fd2} = ?FILE_MODULE:open(Name,write),
+ {ok,Fd2} = ?FILE_MODULE:open(Name,write),
%% note the missing double quote
- ?line io:format(
- Fd2,"{this,[is,1.0],'journey'}.\n \"into. (sound). ",[]),
- ?line ok = ?FILE_MODULE:close(Fd2),
- ?line {error, {_, _, _} = Msg} = ?FILE_MODULE:consult(Name),
- ?line io:format("Errmsg: ~p",[Msg]),
+ io:format(
+ Fd2,"{this,[is,1.0],'journey'}.\n \"into. (sound). ",[]),
+ ok = ?FILE_MODULE:close(Fd2),
+ {error, {_, _, _} = Msg} = ?FILE_MODULE:consult(Name),
+ io:format("Errmsg: ~p",[Msg]),
- ?line {error, enoent} = ?FILE_MODULE:consult(Name ++ ".nonexistent"),
+ {error, enoent} = ?FILE_MODULE:consult(Name ++ ".nonexistent"),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
-path_consult(suite) -> [];
-path_consult(doc) -> [];
path_consult(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line FileName = atom_to_list(?MODULE)++"_path_consult.fil",
- ?line Name = filename:join(RootDir, FileName),
- ?line {ok,Fd1} = ?FILE_MODULE:open(Name,write),
- ?line io:format(Fd1,"{this,is,a,journey,into,sound}.\n",[]),
- ?line ok = ?FILE_MODULE:close(Fd1),
+ RootDir = proplists:get_value(priv_dir,Config),
+ FileName = atom_to_list(?MODULE)++"_path_consult.fil",
+ Name = filename:join(RootDir, FileName),
+ {ok,Fd1} = ?FILE_MODULE:open(Name,write),
+ io:format(Fd1,"{this,is,a,journey,into,sound}.\n",[]),
+ ok = ?FILE_MODULE:close(Fd1),
%% File last in path
- ?line {ok,[{this,is,a,journey,into,sound}],Dir} =
+ {ok,[{this,is,a,journey,into,sound}],Dir} =
?FILE_MODULE:path_consult(
- [filename:join(RootDir, "dir1"),
- filename:join(RootDir, ".."),
- filename:join(RootDir, "dir2"),
- RootDir], FileName),
- ?line true = lists:prefix(RootDir,Dir),
+ [filename:join(RootDir, "dir1"),
+ filename:join(RootDir, ".."),
+ filename:join(RootDir, "dir2"),
+ RootDir], FileName),
+ true = lists:prefix(RootDir,Dir),
%% While maybe not an error, it may be worth noting that
%% when the full path to a file is given, it's always found
%% regardless of the contents of the path
- ?line {ok,_,_} = ?FILE_MODULE:path_consult(["nosuch1","nosuch2"],Name),
+ {ok,_,_} = ?FILE_MODULE:path_consult(["nosuch1","nosuch2"],Name),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
-eval1(suite) -> [];
-eval1(doc) -> [];
eval1(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)++"_eval.fil"),
- ?line {ok,Fd1} = ?FILE_MODULE:open(Name,write),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)++"_eval.fil"),
+ {ok,Fd1} = ?FILE_MODULE:open(Name,write),
%% note that there is no final \n (only a space)
- ?line io:format(Fd1,"put(evaluated_ok,\ntrue). ",[]),
- ?line ok = ?FILE_MODULE:close(Fd1),
- ?line ok = ?FILE_MODULE:eval(Name),
- ?line true = get(evaluated_ok),
-
- ?line {ok,Fd2} = ?FILE_MODULE:open(Name,write),
+ io:format(Fd1,"put(evaluated_ok,\ntrue). ",[]),
+ ok = ?FILE_MODULE:close(Fd1),
+ ok = ?FILE_MODULE:eval(Name),
+ true = get(evaluated_ok),
+
+ {ok,Fd2} = ?FILE_MODULE:open(Name,write),
%% note that there is no final \n (only a space)
- ?line io:format(Fd2,"put(evaluated_ok,\nR). ",[]),
- ?line ok = ?FILE_MODULE:close(Fd2),
- ?line ok = ?FILE_MODULE:eval(
- Name,
- erl_eval:add_binding('R', true, erl_eval:new_bindings())),
- ?line true = get(evaluated_ok),
-
- ?line {ok,Fd3} = ?FILE_MODULE:open(Name,write),
+ io:format(Fd2,"put(evaluated_ok,\nR). ",[]),
+ ok = ?FILE_MODULE:close(Fd2),
+ ok = ?FILE_MODULE:eval(
+ Name,
+ erl_eval:add_binding('R', true, erl_eval:new_bindings())),
+ true = get(evaluated_ok),
+
+ {ok,Fd3} = ?FILE_MODULE:open(Name,write),
%% garbled
- ?line io:format(Fd3,"puGARBLED-GARBLED\ntrue). ",[]),
- ?line ok = ?FILE_MODULE:close(Fd3),
- ?line {error, {_, _, _} = Msg} = ?FILE_MODULE:eval(Name),
- ?line io:format("Errmsg1: ~p",[Msg]),
-
- ?line {error, enoent} = ?FILE_MODULE:eval(Name ++ ".nonexistent"),
-
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ io:format(Fd3,"puGARBLED-GARBLED\ntrue). ",[]),
+ ok = ?FILE_MODULE:close(Fd3),
+ {error, {_, _, _} = Msg} = ?FILE_MODULE:eval(Name),
+ io:format("Errmsg1: ~p",[Msg]),
+
+ {error, enoent} = ?FILE_MODULE:eval(Name ++ ".nonexistent"),
+
+ [] = flush(),
ok.
-path_eval(suite) -> [];
-path_eval(doc) -> [];
path_eval(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line FileName = atom_to_list(?MODULE)++"_path_eval.fil",
- ?line Name = filename:join(RootDir, FileName),
- ?line {ok,Fd1} = ?FILE_MODULE:open(Name,write),
- ?line io:format(Fd1,"put(evaluated_ok,true).\n",[]),
- ?line ok = ?FILE_MODULE:close(Fd1),
+ RootDir = proplists:get_value(priv_dir,Config),
+ FileName = atom_to_list(?MODULE)++"_path_eval.fil",
+ Name = filename:join(RootDir, FileName),
+ {ok,Fd1} = ?FILE_MODULE:open(Name,write),
+ io:format(Fd1,"put(evaluated_ok,true).\n",[]),
+ ok = ?FILE_MODULE:close(Fd1),
%% File last in path
- ?line {ok,Dir} =
+ {ok,Dir} =
?FILE_MODULE:path_eval(
- [filename:join(RootDir, "dir1"),
- filename:join(RootDir, ".."),
- filename:join(RootDir, "dir2"),
- RootDir],FileName),
- ?line true = get(evaluated_ok),
- ?line true = lists:prefix(RootDir,Dir),
-
+ [filename:join(RootDir, "dir1"),
+ filename:join(RootDir, ".."),
+ filename:join(RootDir, "dir2"),
+ RootDir],FileName),
+ true = get(evaluated_ok),
+ true = lists:prefix(RootDir,Dir),
+
%% While maybe not an error, it may be worth noting that
%% when the full path to a file is given, it's always found
%% regardless of the contents of the path
- ?line {ok,Fd2} = ?FILE_MODULE:open(Name,write),
- ?line io:format(Fd2,"put(evaluated_ok,R).\n",[]),
- ?line ok = ?FILE_MODULE:close(Fd2),
- ?line {ok,_} = ?FILE_MODULE:path_eval(
- ["nosuch1","nosuch2"],
- Name,
- erl_eval:add_binding('R', true, erl_eval:new_bindings())),
-
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ {ok,Fd2} = ?FILE_MODULE:open(Name,write),
+ io:format(Fd2,"put(evaluated_ok,R).\n",[]),
+ ok = ?FILE_MODULE:close(Fd2),
+ {ok,_} = ?FILE_MODULE:path_eval(
+ ["nosuch1","nosuch2"],
+ Name,
+ erl_eval:add_binding('R', true, erl_eval:new_bindings())),
+
+ [] = flush(),
ok.
-script1(suite) -> [];
-script1(doc) -> "";
script1(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)++"_script.fil"),
- ?line {ok,Fd1} = ?FILE_MODULE:open(Name,write),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)++"_script.fil"),
+ {ok,Fd1} = ?FILE_MODULE:open(Name,write),
%% note that there is no final \n (only a space)
- ?line io:format(Fd1,"A = 11,\nB = 6,\nA+B. ",[]),
- ?line ok = ?FILE_MODULE:close(Fd1),
- ?line {ok,17} = ?FILE_MODULE:script(Name),
-
- ?line {ok,Fd2} = ?FILE_MODULE:open(Name,write),
+ io:format(Fd1,"A = 11,\nB = 6,\nA+B. ",[]),
+ ok = ?FILE_MODULE:close(Fd1),
+ {ok,17} = ?FILE_MODULE:script(Name),
+
+ {ok,Fd2} = ?FILE_MODULE:open(Name,write),
%% note that there is no final \n (only a space)
- ?line io:format(Fd2,"A = 11,\nA+B. ",[]),
- ?line ok = ?FILE_MODULE:close(Fd2),
- ?line {ok,17} = ?FILE_MODULE:script(
- Name,
- erl_eval:add_binding('B', 6, erl_eval:new_bindings())),
-
- ?line {ok,Fd3} = ?FILE_MODULE:open(Name,write),
- ?line io:format(Fd3,"A = 11,\nB = six,\nA+B. ",[]),
- ?line ok = ?FILE_MODULE:close(Fd3),
- ?line {error, {_, _, _} = Msg} = ?FILE_MODULE:script(Name),
- ?line io:format("Errmsg1: ~p",[Msg]),
-
- ?line {error, enoent} = ?FILE_MODULE:script(Name ++ ".nonexistent"),
-
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ io:format(Fd2,"A = 11,\nA+B. ",[]),
+ ok = ?FILE_MODULE:close(Fd2),
+ {ok,17} = ?FILE_MODULE:script(
+ Name,
+ erl_eval:add_binding('B', 6, erl_eval:new_bindings())),
+
+ {ok,Fd3} = ?FILE_MODULE:open(Name,write),
+ io:format(Fd3,"A = 11,\nB = six,\nA+B. ",[]),
+ ok = ?FILE_MODULE:close(Fd3),
+ {error, {_, _, _} = Msg} = ?FILE_MODULE:script(Name),
+ io:format("Errmsg1: ~p",[Msg]),
+
+ {error, enoent} = ?FILE_MODULE:script(Name ++ ".nonexistent"),
+
+ [] = flush(),
ok.
-
-path_script(suite) -> [];
-path_script(doc) -> [];
+
path_script(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line FileName = atom_to_list(?MODULE)++"_path_script.fil",
- ?line Name = filename:join(RootDir, FileName),
- ?line {ok,Fd1} = ?FILE_MODULE:open(Name,write),
- ?line io:format(Fd1,"A = 11,\nB = 6,\nA+B.\n",[]),
- ?line ok = ?FILE_MODULE:close(Fd1),
+ RootDir = proplists:get_value(priv_dir,Config),
+ FileName = atom_to_list(?MODULE)++"_path_script.fil",
+ Name = filename:join(RootDir, FileName),
+ {ok,Fd1} = ?FILE_MODULE:open(Name,write),
+ io:format(Fd1,"A = 11,\nB = 6,\nA+B.\n",[]),
+ ok = ?FILE_MODULE:close(Fd1),
%% File last in path
- ?line {ok, 17, Dir} =
+ {ok, 17, Dir} =
?FILE_MODULE:path_script(
[filename:join(RootDir, "dir1"),
filename:join(RootDir, ".."),
filename:join(RootDir, "dir2"),
RootDir],FileName),
- ?line true = lists:prefix(RootDir,Dir),
-
+ true = lists:prefix(RootDir,Dir),
+
%% While maybe not an error, it may be worth noting that
%% when the full path to a file is given, it's always found
%% regardless of the contents of the path
- ?line {ok,Fd2} = ?FILE_MODULE:open(Name,write),
- ?line io:format(Fd2,"A = 11,\nA+B.",[]),
- ?line ok = ?FILE_MODULE:close(Fd2),
- ?line {ok, 17, Dir} =
+ {ok,Fd2} = ?FILE_MODULE:open(Name,write),
+ io:format(Fd2,"A = 11,\nA+B.",[]),
+ ok = ?FILE_MODULE:close(Fd2),
+ {ok, 17, Dir} =
?FILE_MODULE:path_script(
["nosuch1","nosuch2"],
Name,
erl_eval:add_binding('B', 6, erl_eval:new_bindings())),
-
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+
+ [] = flush(),
ok.
-
-truncate(suite) -> [];
-truncate(doc) -> [];
+
truncate(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_truncate.fil"),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_truncate.fil"),
%% Create a file with some data.
- ?line MyData = "0123456789abcdefghijklmnopqrstuvxyz",
- ?line ok = ?FILE_MODULE:write_file(Name, MyData),
+ MyData = "0123456789abcdefghijklmnopqrstuvxyz",
+ ok = ?FILE_MODULE:write_file(Name, MyData),
%% Truncate the file to 10 characters.
- ?line {ok, Fd} = ?FILE_MODULE:open(Name, read_write),
- ?line {ok, 10} = ?FILE_MODULE:position(Fd, 10),
- ?line ok = ?FILE_MODULE:truncate(Fd),
- ?line ok = ?FILE_MODULE:close(Fd),
+ {ok, Fd} = ?FILE_MODULE:open(Name, read_write),
+ {ok, 10} = ?FILE_MODULE:position(Fd, 10),
+ ok = ?FILE_MODULE:truncate(Fd),
+ ok = ?FILE_MODULE:close(Fd),
%% Read back the file and check that it has been truncated.
- ?line Expected = list_to_binary("0123456789"),
- ?line {ok, Expected} = ?FILE_MODULE:read_file(Name),
+ Expected = list_to_binary("0123456789"),
+ {ok, Expected} = ?FILE_MODULE:read_file(Name),
%% Open the file read only and verify that it is not possible to
%% truncate it, OTP-1960
- ?line {ok, Fd2} = ?FILE_MODULE:open(Name, read),
- ?line {ok, 5} = ?FILE_MODULE:position(Fd2, 5),
- ?line {error, _} = ?FILE_MODULE:truncate(Fd2),
+ {ok, Fd2} = ?FILE_MODULE:open(Name, read),
+ {ok, 5} = ?FILE_MODULE:position(Fd2, 5),
+ {error, _} = ?FILE_MODULE:truncate(Fd2),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
-datasync(suite) -> [];
-datasync(doc) -> "Tests that ?FILE_MODULE:datasync/1 at least doesn't crash.";
+%% Tests that ?FILE_MODULE:datasync/1 at least doesn't crash.
datasync(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Sync = filename:join(PrivDir,
- atom_to_list(?MODULE)
- ++"_sync.fil"),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Sync = filename:join(PrivDir,
+ atom_to_list(?MODULE)
+ ++"_sync.fil"),
%% Raw open.
- ?line {ok, Fd} = ?FILE_MODULE:open(Sync, [write, raw]),
- ?line ok = ?FILE_MODULE:datasync(Fd),
- ?line ok = ?FILE_MODULE:close(Fd),
+ {ok, Fd} = ?FILE_MODULE:open(Sync, [write, raw]),
+ ok = ?FILE_MODULE:datasync(Fd),
+ ok = ?FILE_MODULE:close(Fd),
%% Ordinary open.
- ?line {ok, Fd2} = ?FILE_MODULE:open(Sync, [write]),
- ?line ok = ?FILE_MODULE:datasync(Fd2),
- ?line ok = ?FILE_MODULE:close(Fd2),
+ {ok, Fd2} = ?FILE_MODULE:open(Sync, [write]),
+ ok = ?FILE_MODULE:datasync(Fd2),
+ ok = ?FILE_MODULE:close(Fd2),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
-sync(suite) -> [];
-sync(doc) -> "Tests that ?FILE_MODULE:sync/1 at least doesn't crash.";
+%% Tests that ?FILE_MODULE:sync/1 at least doesn't crash.
sync(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Sync = filename:join(PrivDir,
- atom_to_list(?MODULE)
- ++"_sync.fil"),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Sync = filename:join(PrivDir,
+ atom_to_list(?MODULE)
+ ++"_sync.fil"),
%% Raw open.
- ?line {ok, Fd} = ?FILE_MODULE:open(Sync, [write, raw]),
- ?line ok = ?FILE_MODULE:sync(Fd),
- ?line ok = ?FILE_MODULE:close(Fd),
+ {ok, Fd} = ?FILE_MODULE:open(Sync, [write, raw]),
+ ok = ?FILE_MODULE:sync(Fd),
+ ok = ?FILE_MODULE:close(Fd),
%% Ordinary open.
- ?line {ok, Fd2} = ?FILE_MODULE:open(Sync, [write]),
- ?line ok = ?FILE_MODULE:sync(Fd2),
- ?line ok = ?FILE_MODULE:close(Fd2),
+ {ok, Fd2} = ?FILE_MODULE:open(Sync, [write]),
+ ok = ?FILE_MODULE:sync(Fd2),
+ ok = ?FILE_MODULE:close(Fd2),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
-advise(suite) -> [];
-advise(doc) -> "Tests that ?FILE_MODULE:advise/4 at least doesn't crash.";
+%% Tests that ?FILE_MODULE:advise/4 at least doesn't crash.
advise(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Advise = filename:join(PrivDir,
- atom_to_list(?MODULE)
- ++"_advise.fil"),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Advise = filename:join(PrivDir,
+ atom_to_list(?MODULE)
+ ++"_advise.fil"),
Line1 = "Hello\n",
Line2 = "World!\n",
- ?line {ok, Fd} = ?FILE_MODULE:open(Advise, [write]),
- ?line ok = ?FILE_MODULE:advise(Fd, 0, 0, normal),
- ?line ok = io:format(Fd, "~s", [Line1]),
- ?line ok = io:format(Fd, "~s", [Line2]),
- ?line ok = ?FILE_MODULE:close(Fd),
-
- ?line {ok, Fd2} = ?FILE_MODULE:open(Advise, [write]),
- ?line ok = ?FILE_MODULE:advise(Fd2, 0, 0, random),
- ?line ok = io:format(Fd2, "~s", [Line1]),
- ?line ok = io:format(Fd2, "~s", [Line2]),
- ?line ok = ?FILE_MODULE:close(Fd2),
-
- ?line {ok, Fd3} = ?FILE_MODULE:open(Advise, [write]),
- ?line ok = ?FILE_MODULE:advise(Fd3, 0, 0, sequential),
- ?line ok = io:format(Fd3, "~s", [Line1]),
- ?line ok = io:format(Fd3, "~s", [Line2]),
- ?line ok = ?FILE_MODULE:close(Fd3),
-
- ?line {ok, Fd4} = ?FILE_MODULE:open(Advise, [write]),
- ?line ok = ?FILE_MODULE:advise(Fd4, 0, 0, will_need),
- ?line ok = io:format(Fd4, "~s", [Line1]),
- ?line ok = io:format(Fd4, "~s", [Line2]),
- ?line ok = ?FILE_MODULE:close(Fd4),
-
- ?line {ok, Fd5} = ?FILE_MODULE:open(Advise, [write]),
- ?line ok = ?FILE_MODULE:advise(Fd5, 0, 0, dont_need),
- ?line ok = io:format(Fd5, "~s", [Line1]),
- ?line ok = io:format(Fd5, "~s", [Line2]),
- ?line ok = ?FILE_MODULE:close(Fd5),
-
- ?line {ok, Fd6} = ?FILE_MODULE:open(Advise, [write]),
- ?line ok = ?FILE_MODULE:advise(Fd6, 0, 0, no_reuse),
- ?line ok = io:format(Fd6, "~s", [Line1]),
- ?line ok = io:format(Fd6, "~s", [Line2]),
- ?line ok = ?FILE_MODULE:close(Fd6),
-
- ?line {ok, Fd7} = ?FILE_MODULE:open(Advise, [write]),
- ?line {error, einval} = ?FILE_MODULE:advise(Fd7, 0, 0, bad_advise),
- ?line ok = ?FILE_MODULE:close(Fd7),
+ {ok, Fd} = ?FILE_MODULE:open(Advise, [write]),
+ ok = ?FILE_MODULE:advise(Fd, 0, 0, normal),
+ ok = io:format(Fd, "~s", [Line1]),
+ ok = io:format(Fd, "~s", [Line2]),
+ ok = ?FILE_MODULE:close(Fd),
+
+ {ok, Fd2} = ?FILE_MODULE:open(Advise, [write]),
+ ok = ?FILE_MODULE:advise(Fd2, 0, 0, random),
+ ok = io:format(Fd2, "~s", [Line1]),
+ ok = io:format(Fd2, "~s", [Line2]),
+ ok = ?FILE_MODULE:close(Fd2),
+
+ {ok, Fd3} = ?FILE_MODULE:open(Advise, [write]),
+ ok = ?FILE_MODULE:advise(Fd3, 0, 0, sequential),
+ ok = io:format(Fd3, "~s", [Line1]),
+ ok = io:format(Fd3, "~s", [Line2]),
+ ok = ?FILE_MODULE:close(Fd3),
+
+ {ok, Fd4} = ?FILE_MODULE:open(Advise, [write]),
+ ok = ?FILE_MODULE:advise(Fd4, 0, 0, will_need),
+ ok = io:format(Fd4, "~s", [Line1]),
+ ok = io:format(Fd4, "~s", [Line2]),
+ ok = ?FILE_MODULE:close(Fd4),
+
+ {ok, Fd5} = ?FILE_MODULE:open(Advise, [write]),
+ ok = ?FILE_MODULE:advise(Fd5, 0, 0, dont_need),
+ ok = io:format(Fd5, "~s", [Line1]),
+ ok = io:format(Fd5, "~s", [Line2]),
+ ok = ?FILE_MODULE:close(Fd5),
+
+ {ok, Fd6} = ?FILE_MODULE:open(Advise, [write]),
+ ok = ?FILE_MODULE:advise(Fd6, 0, 0, no_reuse),
+ ok = io:format(Fd6, "~s", [Line1]),
+ ok = io:format(Fd6, "~s", [Line2]),
+ ok = ?FILE_MODULE:close(Fd6),
+
+ {ok, Fd7} = ?FILE_MODULE:open(Advise, [write]),
+ {error, einval} = ?FILE_MODULE:advise(Fd7, 0, 0, bad_advise),
+ ok = ?FILE_MODULE:close(Fd7),
%% test write without advise, then a read after an advise
- ?line {ok, Fd8} = ?FILE_MODULE:open(Advise, [write]),
- ?line ok = io:format(Fd8, "~s", [Line1]),
- ?line ok = io:format(Fd8, "~s", [Line2]),
- ?line ok = ?FILE_MODULE:close(Fd8),
- ?line {ok, Fd9} = ?FILE_MODULE:open(Advise, [read]),
+ {ok, Fd8} = ?FILE_MODULE:open(Advise, [write]),
+ ok = io:format(Fd8, "~s", [Line1]),
+ ok = io:format(Fd8, "~s", [Line2]),
+ ok = ?FILE_MODULE:close(Fd8),
+ {ok, Fd9} = ?FILE_MODULE:open(Advise, [read]),
Offset = 0,
%% same as a 0 length in some implementations
Length = length(Line1) + length(Line2),
- ?line ok = ?FILE_MODULE:advise(Fd9, Offset, Length, sequential),
- ?line {ok, Line1} = ?FILE_MODULE:read_line(Fd9),
- ?line {ok, Line2} = ?FILE_MODULE:read_line(Fd9),
- ?line eof = ?FILE_MODULE:read_line(Fd9),
- ?line ok = ?FILE_MODULE:close(Fd9),
-
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ ok = ?FILE_MODULE:advise(Fd9, Offset, Length, sequential),
+ {ok, Line1} = ?FILE_MODULE:read_line(Fd9),
+ {ok, Line2} = ?FILE_MODULE:read_line(Fd9),
+ eof = ?FILE_MODULE:read_line(Fd9),
+ ok = ?FILE_MODULE:close(Fd9),
+
+ [] = flush(),
ok.
-allocate(suite) -> [];
-allocate(doc) -> "Tests that ?FILE_MODULE:allocate/3 at least doesn't crash.";
+%% Tests that ?FILE_MODULE:allocate/3 at least doesn't crash.
allocate(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Allocate = filename:join(PrivDir,
- atom_to_list(?MODULE)
- ++"_allocate.fil"),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Allocate = filename:join(PrivDir,
+ atom_to_list(?MODULE)
+ ++"_allocate.fil"),
Line1 = "Hello\n",
Line2 = "World!\n",
- ?line {ok, Fd} = ?FILE_MODULE:open(Allocate, [write, binary]),
+ {ok, Fd} = ?FILE_MODULE:open(Allocate, [write, binary]),
allocate_and_assert(Fd, 1, iolist_size([Line1, Line2])),
- ?line ok = io:format(Fd, "~s", [Line1]),
- ?line ok = io:format(Fd, "~s", [Line2]),
- ?line ok = ?FILE_MODULE:close(Fd),
+ ok = io:format(Fd, "~s", [Line1]),
+ ok = io:format(Fd, "~s", [Line2]),
+ ok = ?FILE_MODULE:close(Fd),
- ?line {ok, Fd2} = ?FILE_MODULE:open(Allocate, [write, binary]),
+ {ok, Fd2} = ?FILE_MODULE:open(Allocate, [write, binary]),
allocate_and_assert(Fd2, 1, iolist_size(Line1)),
- ?line ok = io:format(Fd2, "~s", [Line1]),
- ?line ok = io:format(Fd2, "~s", [Line2]),
- ?line ok = ?FILE_MODULE:close(Fd2),
+ ok = io:format(Fd2, "~s", [Line1]),
+ ok = io:format(Fd2, "~s", [Line2]),
+ ok = ?FILE_MODULE:close(Fd2),
- ?line {ok, Fd3} = ?FILE_MODULE:open(Allocate, [write, binary]),
+ {ok, Fd3} = ?FILE_MODULE:open(Allocate, [write, binary]),
allocate_and_assert(Fd3, 1, iolist_size(Line1) + 1),
- ?line ok = io:format(Fd3, "~s", [Line1]),
- ?line ok = io:format(Fd3, "~s", [Line2]),
- ?line ok = ?FILE_MODULE:close(Fd3),
+ ok = io:format(Fd3, "~s", [Line1]),
+ ok = io:format(Fd3, "~s", [Line2]),
+ ok = ?FILE_MODULE:close(Fd3),
- ?line {ok, Fd4} = ?FILE_MODULE:open(Allocate, [write, binary]),
+ {ok, Fd4} = ?FILE_MODULE:open(Allocate, [write, binary]),
allocate_and_assert(Fd4, 1, 4 * iolist_size([Line1, Line2])),
- ?line ok = io:format(Fd4, "~s", [Line1]),
- ?line ok = io:format(Fd4, "~s", [Line2]),
- ?line ok = ?FILE_MODULE:close(Fd4),
+ ok = io:format(Fd4, "~s", [Line1]),
+ ok = io:format(Fd4, "~s", [Line2]),
+ ok = ?FILE_MODULE:close(Fd4),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
allocate_and_assert(Fd, Offset, Length) ->
- % Just verify that calls to ?PRIM_FILE:allocate/3 don't crash or have
- % any other negative side effect. We can't really asssert against a
- % specific return value, because support for file space pre-allocation
- % depends on the OS, OS version and underlying filesystem.
- %
- % The Linux kernel added support for fallocate() in version 2.6.23,
- % which currently works only for the ext4, ocfs2, xfs and btrfs file
- % systems. posix_fallocate() is available in glibc as of version
- % 2.1.94, but it was buggy until glibc version 2.7.
- %
- % Mac OS X, as of version 10.3, supports the fcntl operation F_PREALLOCATE.
- %
- % Solaris supports posix_fallocate() but only for the UFS file system
- % apparently (not supported for ZFS).
- %
- % FreeBSD 9.0 is the first FreeBSD release supporting posix_fallocate().
- %
- % For Windows there's apparently no way to pre-allocate file space, at
- % least with same semantics as posix_fallocate(), fallocate() and
- % fcntl F_PREALLOCATE.
+ %% Just verify that calls to ?PRIM_FILE:allocate/3 don't crash or have
+ %% any other negative side effect. We can't really asssert against a
+ %% specific return value, because support for file space pre-allocation
+ %% depends on the OS, OS version and underlying filesystem.
+ %%
+ %% The Linux kernel added support for fallocate() in version 2.6.23,
+ %% which currently works only for the ext4, ocfs2, xfs and btrfs file
+ %% systems. posix_fallocate() is available in glibc as of version
+ %% 2.1.94, but it was buggy until glibc version 2.7.
+ %%
+ %% Mac OS X, as of version 10.3, supports the fcntl operation F_PREALLOCATE.
+ %%
+ %% Solaris supports posix_fallocate() but only for the UFS file system
+ %% apparently (not supported for ZFS).
+ %%
+ %% FreeBSD 9.0 is the first FreeBSD release supporting posix_fallocate().
+ %%
+ %% For Windows there's apparently no way to pre-allocate file space, at
+ %% least with same semantics as posix_fallocate(), fallocate() and
+ %% fcntl F_PREALLOCATE.
Result = ?FILE_MODULE:allocate(Fd, Offset, Length),
case os:type() of
{win32, _} ->
- ?line {error, enotsup} = Result;
+ {error, enotsup} = Result;
_ ->
- ?line _ = Result
+ _ = Result
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-delete(suite) -> [];
-delete(doc) -> [];
delete(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_delete.fil"),
- ?line {ok, Fd1} = ?FILE_MODULE:open(Name, write),
- ?line io:format(Fd1,"ok.\n",[]),
- ?line ok = ?FILE_MODULE:close(Fd1),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_delete.fil"),
+ {ok, Fd1} = ?FILE_MODULE:open(Name, write),
+ io:format(Fd1,"ok.\n",[]),
+ ok = ?FILE_MODULE:close(Fd1),
%% Check that the file is readable
- ?line {ok, Fd2} = ?FILE_MODULE:open(Name, read),
- ?line ok = ?FILE_MODULE:close(Fd2),
- ?line ok = ?FILE_MODULE:delete(Name),
+ {ok, Fd2} = ?FILE_MODULE:open(Name, read),
+ ok = ?FILE_MODULE:close(Fd2),
+ ok = ?FILE_MODULE:delete(Name),
%% Check that the file is not readable anymore
- ?line {error, _} = ?FILE_MODULE:open(Name, read),
+ {error, _} = ?FILE_MODULE:open(Name, read),
%% Try deleting a nonexistent file
- ?line {error, enoent} = ?FILE_MODULE:delete(Name),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ {error, enoent} = ?FILE_MODULE:delete(Name),
+ [] = flush(),
ok.
-rename(suite) ->[];
-rename(doc) ->[];
rename(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line FileName1 = atom_to_list(?MODULE)++"_rename.fil",
- ?line FileName2 = atom_to_list(?MODULE)++"_rename.ful",
- ?line Name1 = filename:join(RootDir, FileName1),
- ?line Name2 = filename:join(RootDir, FileName2),
- ?line {ok,Fd1} = ?FILE_MODULE:open(Name1,write),
- ?line ok = ?FILE_MODULE:close(Fd1),
+ RootDir = proplists:get_value(priv_dir,Config),
+ FileName1 = atom_to_list(?MODULE)++"_rename.fil",
+ FileName2 = atom_to_list(?MODULE)++"_rename.ful",
+ Name1 = filename:join(RootDir, FileName1),
+ Name2 = filename:join(RootDir, FileName2),
+ {ok,Fd1} = ?FILE_MODULE:open(Name1,write),
+ ok = ?FILE_MODULE:close(Fd1),
%% Rename, and check that id really changed name
- ?line ok = ?FILE_MODULE:rename(Name1,Name2),
- ?line {error, _} = ?FILE_MODULE:open(Name1,read),
- ?line {ok,Fd2} = ?FILE_MODULE:open(Name2,read),
- ?line ok = ?FILE_MODULE:close(Fd2),
+ ok = ?FILE_MODULE:rename(Name1,Name2),
+ {error, _} = ?FILE_MODULE:open(Name1,read),
+ {ok,Fd2} = ?FILE_MODULE:open(Name2,read),
+ ok = ?FILE_MODULE:close(Fd2),
%% Try renaming something to itself
- ?line ok = ?FILE_MODULE:rename(Name2,Name2),
+ ok = ?FILE_MODULE:rename(Name2,Name2),
%% Try renaming something that doesn't exist
- ?line {error, enoent} = ?FILE_MODULE:rename(Name1,Name2),
+ {error, enoent} = ?FILE_MODULE:rename(Name1,Name2),
%% Try renaming to something else than a string
- ?line {error, badarg} = ?FILE_MODULE:rename(Name1,{foo,bar}),
-
+ {error, badarg} = ?FILE_MODULE:rename(Name1,{foo,bar}),
+
%% Move between directories
- ?line DirName1 = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_rename_dir"),
- ?line DirName2 = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_second_rename_dir"),
- ?line Name1foo = filename:join(DirName1, "foo.fil"),
- ?line Name2foo = filename:join(DirName2, "foo.fil"),
- ?line Name2bar = filename:join(DirName2, "bar.dir"),
- ?line ok = ?FILE_MODULE:make_dir(DirName1),
+ DirName1 = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_rename_dir"),
+ DirName2 = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_second_rename_dir"),
+ Name1foo = filename:join(DirName1, "foo.fil"),
+ Name2foo = filename:join(DirName2, "foo.fil"),
+ Name2bar = filename:join(DirName2, "bar.dir"),
+ ok = ?FILE_MODULE:make_dir(DirName1),
%% The name has to include the full file name, path in not enough
- ?line expect({error, eisdir}, {error, eexist},
- ?FILE_MODULE:rename(Name2,DirName1)),
- ?line ok = ?FILE_MODULE:rename(Name2, Name1foo),
+ expect({error, eisdir}, {error, eexist},
+ ?FILE_MODULE:rename(Name2,DirName1)),
+ ok = ?FILE_MODULE:rename(Name2, Name1foo),
%% Now rename the directory
- ?line ok = ?FILE_MODULE:rename(DirName1,DirName2),
+ ok = ?FILE_MODULE:rename(DirName1,DirName2),
%% And check that the file is there now
- ?line {ok,Fd3} = ?FILE_MODULE:open(Name2foo, read),
- ?line ok = ?FILE_MODULE:close(Fd3),
+ {ok,Fd3} = ?FILE_MODULE:open(Name2foo, read),
+ ok = ?FILE_MODULE:close(Fd3),
%% Try some dirty things now: move the directory into itself
- ?line {error, Msg1} = ?FILE_MODULE:rename(DirName2, Name2bar),
- ?line io:format("Errmsg1: ~p",[Msg1]),
+ {error, Msg1} = ?FILE_MODULE:rename(DirName2, Name2bar),
+ io:format("Errmsg1: ~p",[Msg1]),
%% move dir into a file in itself
- ?line {error, Msg2} = ?FILE_MODULE:rename(DirName2, Name2foo),
- ?line io:format("Errmsg2: ~p",[Msg2]),
+ {error, Msg2} = ?FILE_MODULE:rename(DirName2, Name2foo),
+ io:format("Errmsg2: ~p",[Msg2]),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-names(suite) -> [];
-names(doc) -> [];
names(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
- ?line RootDir = ?config(priv_dir,Config),
- ?line FileName = "foo1.fil",
- ?line Name1 = filename:join(RootDir, FileName),
- ?line Name2 = [RootDir,"/","foo1",".","fil"],
- ?line Name3 = [RootDir,"/",foo,$1,[[[],[],'.']],"f",il],
- ?line {ok,Fd0} = ?FILE_MODULE:open(Name1,write),
- ?line ok = ?FILE_MODULE:close(Fd0),
+ RootDir = proplists:get_value(priv_dir,Config),
+ FileName = "foo1.fil",
+ Name1 = filename:join(RootDir, FileName),
+ Name2 = [RootDir,"/","foo1",".","fil"],
+ Name3 = [RootDir,"/",foo,$1,[[[],[],'.']],"f",il],
+ {ok,Fd0} = ?FILE_MODULE:open(Name1,write),
+ ok = ?FILE_MODULE:close(Fd0),
%% Try some file names
- ?line {ok,Fd1} = ?FILE_MODULE:open(Name1,read),
- ?line ok = ?FILE_MODULE:close(Fd1),
- ?line {ok,Fd2f} = ?FILE_MODULE:open(lists:flatten(Name2),read),
- ?line ok = ?FILE_MODULE:close(Fd2f),
- ?line {ok,Fd2} = ?FILE_MODULE:open(Name2,read),
- ?line ok = ?FILE_MODULE:close(Fd2),
- ?line {ok,Fd3} = ?FILE_MODULE:open(Name3,read),
- ?line ok = ?FILE_MODULE:close(Fd3),
- case length(Name1) > 255 of
- true ->
- io:format("Path too long for an atom:\n\n~p\n", [Name1]);
- false ->
- Name4 = list_to_atom(Name1),
- {ok,Fd4} = ?FILE_MODULE:open(Name4,read),
- ok = ?FILE_MODULE:close(Fd4)
- end,
+ {ok,Fd1} = ?FILE_MODULE:open(Name1,read),
+ ok = ?FILE_MODULE:close(Fd1),
+ {ok,Fd2f} = ?FILE_MODULE:open(lists:flatten(Name2),read),
+ ok = ?FILE_MODULE:close(Fd2f),
+ {ok,Fd2} = ?FILE_MODULE:open(Name2,read),
+ ok = ?FILE_MODULE:close(Fd2),
+ {ok,Fd3} = ?FILE_MODULE:open(Name3,read),
+ ok = ?FILE_MODULE:close(Fd3),
+ case length(Name1) > 255 of
+ true ->
+ io:format("Path too long for an atom:\n\n~p\n", [Name1]);
+ false ->
+ Name4 = list_to_atom(Name1),
+ {ok,Fd4} = ?FILE_MODULE:open(Name4,read),
+ ok = ?FILE_MODULE:close(Fd4)
+ end,
%% Try some path names
- ?line Path1 = RootDir,
- ?line Path2 = [RootDir],
- ?line Path3 = ['',[],[RootDir,[[]]]],
- ?line {ok,Fd11,_} = ?FILE_MODULE:path_open([Path1],FileName,read),
- ?line ok = ?FILE_MODULE:close(Fd11),
- ?line {ok,Fd12,_} = ?FILE_MODULE:path_open([Path2],FileName,read),
- ?line ok = ?FILE_MODULE:close(Fd12),
- ?line {ok,Fd13,_} = ?FILE_MODULE:path_open([Path3],FileName,read),
- ?line ok = ?FILE_MODULE:close(Fd13),
- case length(Path1) > 255 of
- true->
- io:format("Path too long for an atom:\n\n~p\n", [Path1]);
- false ->
- Path4 = list_to_atom(Path1),
- {ok,Fd14,_} = ?FILE_MODULE:path_open([Path4],FileName,read),
- ok = ?FILE_MODULE:close(Fd14)
- end,
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ Path1 = RootDir,
+ Path2 = [RootDir],
+ Path3 = ['',[],[RootDir,[[]]]],
+ {ok,Fd11,_} = ?FILE_MODULE:path_open([Path1],FileName,read),
+ ok = ?FILE_MODULE:close(Fd11),
+ {ok,Fd12,_} = ?FILE_MODULE:path_open([Path2],FileName,read),
+ ok = ?FILE_MODULE:close(Fd12),
+ {ok,Fd13,_} = ?FILE_MODULE:path_open([Path3],FileName,read),
+ ok = ?FILE_MODULE:close(Fd13),
+ case length(Path1) > 255 of
+ true->
+ io:format("Path too long for an atom:\n\n~p\n", [Path1]);
+ false ->
+ Path4 = list_to_atom(Path1),
+ {ok,Fd14,_} = ?FILE_MODULE:path_open([Path4],FileName,read),
+ ok = ?FILE_MODULE:close(Fd14)
+ end,
+ [] = flush(),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-e_delete(suite) -> [];
-e_delete(doc) -> [];
e_delete(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line Base = filename:join(RootDir,
- atom_to_list(?MODULE)++"_e_delete"),
- ?line ok = ?FILE_MODULE:make_dir(Base),
+ RootDir = proplists:get_value(priv_dir, Config),
+ Base = filename:join(RootDir,
+ atom_to_list(?MODULE)++"_e_delete"),
+ ok = ?FILE_MODULE:make_dir(Base),
%% Delete a non-existing file.
- ?line {error, enoent} =
+ {error, enoent} =
?FILE_MODULE:delete(filename:join(Base, "non_existing")),
%% Delete a directory.
- ?line {error, eperm} = ?FILE_MODULE:delete(Base),
+ {error, eperm} = ?FILE_MODULE:delete(Base),
%% Use a path-name with a non-directory component.
- ?line Afile = filename:join(Base, "a_file"),
- ?line ok = ?FILE_MODULE:write_file(Afile, "hello\n"),
- ?line {error, E} =
+ Afile = filename:join(Base, "a_file"),
+ ok = ?FILE_MODULE:write_file(Afile, "hello\n"),
+ {error, E} =
expect({error, enotdir}, {error, enoent},
?FILE_MODULE:delete(filename:join(Afile, "another_file"))),
- ?line io:format("Result: ~p~n", [E]),
+ io:format("Result: ~p~n", [E]),
%% No permission.
- ?line case os:type() of
- {win32, _} ->
- %% Remove a character device.
- ?line {error, eacces} = ?FILE_MODULE:delete("nul");
- _ ->
- ?line ?FILE_MODULE:write_file_info(
- Base, #file_info {mode=0}),
- ?line {error, eacces} = ?FILE_MODULE:delete(Afile),
- ?line ?FILE_MODULE:write_file_info(
- Base, #file_info {mode=8#600})
- end,
+ case os:type() of
+ {win32, _} ->
+ %% Remove a character device.
+ {error, eacces} = ?FILE_MODULE:delete("nul");
+ _ ->
+ ?FILE_MODULE:write_file_info(
+ Base, #file_info {mode=0}),
+ {error, eacces} = ?FILE_MODULE:delete(Afile),
+ ?FILE_MODULE:write_file_info(
+ Base, #file_info {mode=8#600})
+ end,
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
%%% FreeBSD gives EEXIST when renaming a file to an empty dir, although the
@@ -2265,13 +2111,10 @@ e_delete(Config) when is_list(Config) ->
%%% (What about FreeBSD? We store our nightly build results on a FreeBSD
%%% file system, that's what.)
-e_rename(suite) -> [];
-e_rename(doc) -> [];
e_rename(Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(10)),
- RootDir = ?config(priv_dir, Config),
+ RootDir = proplists:get_value(priv_dir, Config),
Base = filename:join(RootDir,
- atom_to_list(?MODULE)++"_e_rename"),
+ atom_to_list(?MODULE)++"_e_rename"),
ok = ?FILE_MODULE:make_dir(Base),
%% Create an empty directory.
@@ -2282,15 +2125,15 @@ e_rename(Config) when is_list(Config) ->
NonEmptyDir = filename:join(Base, "non_empty_dir"),
ok = ?FILE_MODULE:make_dir(NonEmptyDir),
ok = ?FILE_MODULE:write_file(
- filename:join(NonEmptyDir, "a_file"),
- "hello\n"),
+ filename:join(NonEmptyDir, "a_file"),
+ "hello\n"),
%% Create another non-empty directory.
ADirectory = filename:join(Base, "a_directory"),
ok = ?FILE_MODULE:make_dir(ADirectory),
ok = ?FILE_MODULE:write_file(
- filename:join(ADirectory, "a_file"),
- "howdy\n\n"),
+ filename:join(ADirectory, "a_file"),
+ "howdy\n\n"),
%% Create a data file.
File = filename:join(Base, "just_a_file"),
@@ -2304,15 +2147,15 @@ e_rename(Config) when is_list(Config) ->
%% Move Base into Base/new_name.
{error, einval} =
- ?FILE_MODULE:rename(Base, filename:join(Base, "new_name")),
+ ?FILE_MODULE:rename(Base, filename:join(Base, "new_name")),
%% Overwrite a directory with a file.
expect({error, eexist}, %FreeBSD (?)
- {error, eisdir},
- ?FILE_MODULE:rename(File, EmptyDir)),
+ {error, eisdir},
+ ?FILE_MODULE:rename(File, EmptyDir)),
expect({error, eexist}, %FreeBSD (?)
- {error, eisdir},
- ?FILE_MODULE:rename(File, NonEmptyDir)),
+ {error, eisdir},
+ ?FILE_MODULE:rename(File, NonEmptyDir)),
%% Move a non-existing file.
NonExistingFile = filename:join(Base, "non_existing_file"),
@@ -2320,8 +2163,8 @@ e_rename(Config) when is_list(Config) ->
%% Overwrite a file with a directory.
expect({error, eexist}, %FreeBSD (?)
- {error, enotdir},
- ?FILE_MODULE:rename(ADirectory, File)),
+ {error, enotdir},
+ ?FILE_MODULE:rename(ADirectory, File)),
%% Move a file to another filesystem.
%% XXX - This test case is bogus. We cannot be guaranteed that
@@ -2330,46 +2173,42 @@ e_rename(Config) when is_list(Config) ->
%%
%% XXX - Gross hack!
Comment = case os:type() of
- {unix, _} ->
- OtherFs = "/tmp",
- NameOnOtherFs = filename:join(OtherFs, filename:basename(File)),
- {ok, Com} = case ?FILE_MODULE:rename(File, NameOnOtherFs) of
- {error, exdev} ->
- %% The file could be in
- %% the same filesystem!
- {ok, ok};
- ok ->
- {ok, {comment,
- "Moving between filesystems "
- "suceeded, files are probably "
- "in the same filesystem!"}};
- {error, eperm} ->
- {ok, {comment, "SBS! You don't "
- "have the permission to do "
- "this test!"}};
- Else ->
- Else
- end,
- Com;
- {win32, _} ->
- %% At least Windows NT can
- %% successfully move a file to
- %% another drive.
- ok
- end,
+ {unix, _} ->
+ OtherFs = "/tmp",
+ NameOnOtherFs = filename:join(OtherFs, filename:basename(File)),
+ {ok, Com} = case ?FILE_MODULE:rename(File, NameOnOtherFs) of
+ {error, exdev} ->
+ %% The file could be in
+ %% the same filesystem!
+ {ok, ok};
+ ok ->
+ {ok, {comment,
+ "Moving between filesystems "
+ "suceeded, files are probably "
+ "in the same filesystem!"}};
+ {error, eperm} ->
+ {ok, {comment, "SBS! You don't "
+ "have the permission to do "
+ "this test!"}};
+ Else ->
+ Else
+ end,
+ Com;
+ {win32, _} ->
+ %% At least Windows NT can
+ %% successfully move a file to
+ %% another drive.
+ ok
+ end,
[] = flush(),
- test_server:timetrap_cancel(Dog),
Comment.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-e_make_dir(suite) -> [];
-e_make_dir(doc) -> [];
e_make_dir(Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(10)),
- RootDir = ?config(priv_dir, Config),
+ RootDir = proplists:get_value(priv_dir, Config),
Base = filename:join(RootDir,
- atom_to_list(?MODULE)++"_e_make_dir"),
+ atom_to_list(?MODULE)++"_e_make_dir"),
ok = ?FILE_MODULE:make_dir(Base),
%% A component of the path does not exist.
@@ -2392,18 +2231,14 @@ e_make_dir(Config) when is_list(Config) ->
?FILE_MODULE:write_file_info(Base, #file_info {mode=0}),
{error, eacces} = ?FILE_MODULE:make_dir(filename:join(Base, "xxxx")),
?FILE_MODULE:write_file_info(
- Base, #file_info {mode=8#600})
+ Base, #file_info {mode=8#600})
end,
- test_server:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-e_del_dir(suite) -> [];
-e_del_dir(doc) -> [];
e_del_dir(Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(10)),
- RootDir = ?config(priv_dir, Config),
+ RootDir = proplists:get_value(priv_dir, Config),
Base = test_server:temp_name(filename:join(RootDir, "e_del_dir")),
io:format("Base: ~p", [Base]),
ok = ?FILE_MODULE:make_dir(Base),
@@ -2416,21 +2251,21 @@ e_del_dir(Config) when is_list(Config) ->
Afile = filename:join(Base, "a_directory"),
ok = ?FILE_MODULE:write_file(Afile, "hello\n"),
{error, E1} = expect({error, enotdir}, {error, enoent},
- ?FILE_MODULE:del_dir(
- filename:join(Afile, "another_directory"))),
+ ?FILE_MODULE:del_dir(
+ filename:join(Afile, "another_directory"))),
io:format("Result: ~p", [E1]),
%% Delete a non-empty directory.
{error, E2} = expect({error, enotempty}, {error, eexist}, {error, eacces},
- ?FILE_MODULE:del_dir(Base)),
+ ?FILE_MODULE:del_dir(Base)),
io:format("Result: ~p", [E2]),
%% Remove the current directory.
{error, E3} = expect({error, einval},
- {error, eperm}, % Linux and DUX
- {error, eacces},
- {error, ebusy},
- ?FILE_MODULE:del_dir(".")),
+ {error, eperm}, % Linux and DUX
+ {error, eacces},
+ {error, ebusy},
+ ?FILE_MODULE:del_dir(".")),
io:format("Result: ~p", [E3]),
%% No permission.
@@ -2445,7 +2280,6 @@ e_del_dir(Config) when is_list(Config) ->
?FILE_MODULE:write_file_info( Base, #file_info {mode=8#600})
end,
[] = flush(),
- test_server:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2454,35 +2288,35 @@ e_del_dir(Config) when is_list(Config) ->
%% Trying reading and positioning from a compressed file.
read_compressed_cooked(Config) when is_list(Config) ->
- ?line Data = ?config(data_dir, Config),
- ?line Real = filename:join(Data, "realmen.html.gz"),
- ?line {ok, Fd} = ?FILE_MODULE:open(Real, [read,compressed]),
- ?line try_read_file_list(Fd).
+ Data = proplists:get_value(data_dir, Config),
+ Real = filename:join(Data, "realmen.html.gz"),
+ {ok, Fd} = ?FILE_MODULE:open(Real, [read,compressed]),
+ try_read_file_list(Fd).
read_compressed_cooked_binary(Config) when is_list(Config) ->
- ?line Data = ?config(data_dir, Config),
- ?line Real = filename:join(Data, "realmen.html.gz"),
- ?line {ok, Fd} = ?FILE_MODULE:open(Real, [read,compressed,binary]),
- ?line try_read_file_binary(Fd).
+ Data = proplists:get_value(data_dir, Config),
+ Real = filename:join(Data, "realmen.html.gz"),
+ {ok, Fd} = ?FILE_MODULE:open(Real, [read,compressed,binary]),
+ try_read_file_binary(Fd).
%% Trying reading and positioning from an uncompressed file,
%% but with the compressed flag given.
read_not_really_compressed(Config) when is_list(Config) ->
- ?line Data = ?config(data_dir, Config),
- ?line Priv = ?config(priv_dir, Config),
+ Data = proplists:get_value(data_dir, Config),
+ Priv = proplists:get_value(priv_dir, Config),
%% The file realmen.html might have got CRs added (by WinZip).
%% Remove them, or the file positions will not be correct.
- ?line Real = filename:join(Data, "realmen.html"),
- ?line RealPriv = filename:join(Priv,
- atom_to_list(?MODULE)++"_realmen.html"),
- ?line {ok, RealDataBin} = ?FILE_MODULE:read_file(Real),
- ?line RealData = remove_crs(binary_to_list(RealDataBin), []),
- ?line ok = ?FILE_MODULE:write_file(RealPriv, RealData),
- ?line {ok, Fd} = ?FILE_MODULE:open(RealPriv, [read, compressed]),
- ?line try_read_file_list(Fd).
+ Real = filename:join(Data, "realmen.html"),
+ RealPriv = filename:join(Priv,
+ atom_to_list(?MODULE)++"_realmen.html"),
+ {ok, RealDataBin} = ?FILE_MODULE:read_file(Real),
+ RealData = remove_crs(binary_to_list(RealDataBin), []),
+ ok = ?FILE_MODULE:write_file(RealPriv, RealData),
+ {ok, Fd} = ?FILE_MODULE:open(RealPriv, [read, compressed]),
+ try_read_file_list(Fd).
remove_crs([$\r|Rest], Result) ->
remove_crs(Rest, Result);
@@ -2492,146 +2326,134 @@ remove_crs([], Result) ->
lists:reverse(Result).
try_read_file_list(Fd) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
-
%% Seek to the current position (nothing should happen).
- ?line {ok, 0} = ?FILE_MODULE:position(Fd, 0),
- ?line {ok, 0} = ?FILE_MODULE:position(Fd, {cur, 0}),
+ {ok, 0} = ?FILE_MODULE:position(Fd, 0),
+ {ok, 0} = ?FILE_MODULE:position(Fd, {cur, 0}),
%% Read a few lines from a compressed file.
- ?line ShouldBe = "<TITLE>Real Programmers Don't Use PASCAL</TITLE>\n",
- ?line ShouldBe = io:get_line(Fd, ''),
+ ShouldBe = "<TITLE>Real Programmers Don't Use PASCAL</TITLE>\n",
+ ShouldBe = io:get_line(Fd, ''),
%% Now seek forward.
- ?line {ok, 381} = ?FILE_MODULE:position(Fd, 381),
- ?line Back = "Back in the good old days -- the \"Golden Era\" " ++
+ {ok, 381} = ?FILE_MODULE:position(Fd, 381),
+ Back = "Back in the good old days -- the \"Golden Era\" " ++
"of computers, it was\n",
- ?line Back = io:get_line(Fd, ''),
+ Back = io:get_line(Fd, ''),
%% Try to search forward relative to the current position.
- ?line {ok, CurPos} = ?FILE_MODULE:position(Fd, {cur, 0}),
- ?line RealPos = 4273,
- ?line {ok, RealPos} = ?FILE_MODULE:position(Fd, {cur, RealPos-CurPos}),
- ?line RealProg = "<LI> Real Programmers aren't afraid to use GOTOs.\n",
- ?line RealProg = io:get_line(Fd, ''),
+ {ok, CurPos} = ?FILE_MODULE:position(Fd, {cur, 0}),
+ RealPos = 4273,
+ {ok, RealPos} = ?FILE_MODULE:position(Fd, {cur, RealPos-CurPos}),
+ RealProg = "<LI> Real Programmers aren't afraid to use GOTOs.\n",
+ RealProg = io:get_line(Fd, ''),
%% Seek backward.
- ?line AfterTitle = length("<TITLE>"),
- ?line {ok, AfterTitle} = ?FILE_MODULE:position(Fd, AfterTitle),
- ?line Title = "Real Programmers Don't Use PASCAL</TITLE>\n",
- ?line Title = io:get_line(Fd, ''),
+ AfterTitle = length("<TITLE>"),
+ {ok, AfterTitle} = ?FILE_MODULE:position(Fd, AfterTitle),
+ Title = "Real Programmers Don't Use PASCAL</TITLE>\n",
+ Title = io:get_line(Fd, ''),
%% Seek past the end of the file.
- ?line {ok, _} = ?FILE_MODULE:position(Fd, 25000),
+ {ok, _} = ?FILE_MODULE:position(Fd, 25000),
%% Done.
- ?line ?FILE_MODULE:close(Fd),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ ?FILE_MODULE:close(Fd),
+ [] = flush(),
ok.
try_read_file_binary(Fd) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
-
%% Seek to the current position (nothing should happen).
- ?line {ok, 0} = ?FILE_MODULE:position(Fd, 0),
- ?line {ok, 0} = ?FILE_MODULE:position(Fd, {cur, 0}),
+ {ok, 0} = ?FILE_MODULE:position(Fd, 0),
+ {ok, 0} = ?FILE_MODULE:position(Fd, {cur, 0}),
%% Read a few lines from a compressed file.
- ?line ShouldBe = <<"<TITLE>Real Programmers Don't Use PASCAL</TITLE>\n">>,
- ?line ShouldBe = io:get_line(Fd, ''),
+ ShouldBe = <<"<TITLE>Real Programmers Don't Use PASCAL</TITLE>\n">>,
+ ShouldBe = io:get_line(Fd, ''),
%% Now seek forward.
- ?line {ok, 381} = ?FILE_MODULE:position(Fd, 381),
- ?line Back = <<"Back in the good old days -- the \"Golden Era\" "
- "of computers, it was\n">>,
- ?line Back = io:get_line(Fd, ''),
+ {ok, 381} = ?FILE_MODULE:position(Fd, 381),
+ Back = <<"Back in the good old days -- the \"Golden Era\" "
+ "of computers, it was\n">>,
+ Back = io:get_line(Fd, ''),
%% Try to search forward relative to the current position.
- ?line {ok, CurPos} = ?FILE_MODULE:position(Fd, {cur, 0}),
- ?line RealPos = 4273,
- ?line {ok, RealPos} = ?FILE_MODULE:position(Fd, {cur, RealPos-CurPos}),
- ?line RealProg = <<"<LI> Real Programmers aren't afraid to use GOTOs.\n">>,
- ?line RealProg = io:get_line(Fd, ''),
+ {ok, CurPos} = ?FILE_MODULE:position(Fd, {cur, 0}),
+ RealPos = 4273,
+ {ok, RealPos} = ?FILE_MODULE:position(Fd, {cur, RealPos-CurPos}),
+ RealProg = <<"<LI> Real Programmers aren't afraid to use GOTOs.\n">>,
+ RealProg = io:get_line(Fd, ''),
%% Seek backward.
- ?line AfterTitle = length("<TITLE>"),
- ?line {ok, AfterTitle} = ?FILE_MODULE:position(Fd, AfterTitle),
- ?line Title = <<"Real Programmers Don't Use PASCAL</TITLE>\n">>,
- ?line Title = io:get_line(Fd, ''),
+ AfterTitle = length("<TITLE>"),
+ {ok, AfterTitle} = ?FILE_MODULE:position(Fd, AfterTitle),
+ Title = <<"Real Programmers Don't Use PASCAL</TITLE>\n">>,
+ Title = io:get_line(Fd, ''),
%% Done.
- ?line ?FILE_MODULE:close(Fd),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ ?FILE_MODULE:close(Fd),
+ [] = flush(),
ok.
read_cooked_tar_problem(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
+ Data = proplists:get_value(data_dir, Config),
+ ProblemFile = filename:join(Data, "cooked_tar_problem.tar.gz"),
+ {ok,Fd} = ?FILE_MODULE:open(ProblemFile, [read,compressed,binary]),
+
+ {ok,34304} = file:position(Fd, 34304),
+ {ok,Bin} = file:read(Fd, 512),
+ 512 = byte_size(Bin),
- ?line Data = ?config(data_dir, Config),
- ?line ProblemFile = filename:join(Data, "cooked_tar_problem.tar.gz"),
- ?line {ok,Fd} = ?FILE_MODULE:open(ProblemFile, [read,compressed,binary]),
+ {ok,34304+512+1024} = file:position(Fd, {cur,1024}),
- ?line {ok,34304} = file:position(Fd, 34304),
- ?line {ok,Bin} = file:read(Fd, 512),
- ?line 512 = byte_size(Bin),
-
- ?line {ok,34304+512+1024} = file:position(Fd, {cur,1024}),
-
- ?line ok = file:close(Fd),
+ ok = file:close(Fd),
- ?line test_server:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-write_compressed(suite) -> [];
-write_compressed(doc) -> [];
write_compressed(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line Priv = ?config(priv_dir, Config),
- ?line MyFile = filename:join(Priv,
- atom_to_list(?MODULE)++"_test.gz"),
+ Priv = proplists:get_value(priv_dir, Config),
+ MyFile = filename:join(Priv,
+ atom_to_list(?MODULE)++"_test.gz"),
%% Write a file.
- ?line {ok, Fd} = ?FILE_MODULE:open(MyFile, [write, compressed]),
- ?line {ok, 0} = ?FILE_MODULE:position(Fd, 0),
- ?line Prefix = "hello\n",
- ?line End = "end\n",
- ?line ok = io:put_chars(Fd, Prefix),
- ?line {ok, 143} = ?FILE_MODULE:position(Fd, 143),
- ?line ok = io:put_chars(Fd, End),
- ?line ok = ?FILE_MODULE:close(Fd),
+ {ok, Fd} = ?FILE_MODULE:open(MyFile, [write, compressed]),
+ {ok, 0} = ?FILE_MODULE:position(Fd, 0),
+ Prefix = "hello\n",
+ End = "end\n",
+ ok = io:put_chars(Fd, Prefix),
+ {ok, 143} = ?FILE_MODULE:position(Fd, 143),
+ ok = io:put_chars(Fd, End),
+ ok = ?FILE_MODULE:close(Fd),
%% Read the file and verify the contents.
- ?line {ok, Fd1} = ?FILE_MODULE:open(MyFile, [read, compressed]),
- ?line Prefix = io:get_line(Fd1, ''),
- ?line Second = lists:duplicate(143-length(Prefix), 0) ++ End,
- ?line Second = io:get_line(Fd1, ''),
- ?line ok = ?FILE_MODULE:close(Fd1),
+ {ok, Fd1} = ?FILE_MODULE:open(MyFile, [read, compressed]),
+ Prefix = io:get_line(Fd1, ''),
+ Second = lists:duplicate(143-length(Prefix), 0) ++ End,
+ Second = io:get_line(Fd1, ''),
+ ok = ?FILE_MODULE:close(Fd1),
%% Verify successful compression by uncompressing the file
%% using zlib:gunzip/1.
- ?line {ok,Contents} = file:read_file(MyFile),
- ?line <<"hello\n",0:137/unit:8,"end\n">> = zlib:gunzip(Contents),
+ {ok,Contents} = file:read_file(MyFile),
+ <<"hello\n",0:137/unit:8,"end\n">> = zlib:gunzip(Contents),
%% Ensure that the file is compressed.
@@ -2640,99 +2462,92 @@ write_compressed(Config) when is_list(Config) ->
{ok, #file_info{size=Size}} when Size < TotalSize ->
ok;
{ok, #file_info{size=Size}} when Size == TotalSize ->
- test_server:fail(file_not_compressed)
+ ct:fail(file_not_compressed)
end,
%% Write again to ensure that the file is truncated.
- ?line {ok, Fd2} = ?FILE_MODULE:open(MyFile, [write, compressed]),
- ?line NewString = "aaaaaaaaaaa",
- ?line ok = io:put_chars(Fd2, NewString),
- ?line ok = ?FILE_MODULE:close(Fd2),
- ?line {ok, Fd3} = ?FILE_MODULE:open(MyFile, [read, compressed]),
- ?line {ok, NewString} = ?FILE_MODULE:read(Fd3, 1024),
- ?line ok = ?FILE_MODULE:close(Fd3),
+ {ok, Fd2} = ?FILE_MODULE:open(MyFile, [write, compressed]),
+ NewString = "aaaaaaaaaaa",
+ ok = io:put_chars(Fd2, NewString),
+ ok = ?FILE_MODULE:close(Fd2),
+ {ok, Fd3} = ?FILE_MODULE:open(MyFile, [read, compressed]),
+ {ok, NewString} = ?FILE_MODULE:read(Fd3, 1024),
+ ok = ?FILE_MODULE:close(Fd3),
%% Done.
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
catenated_gzips(Config) when is_list(Config) ->
- ?line Priv = ?config(priv_dir, Config),
- ?line MyFile = filename:join(Priv, ?MODULE_STRING++"_test.gz"),
+ Priv = proplists:get_value(priv_dir, Config),
+ MyFile = filename:join(Priv, ?MODULE_STRING++"_test.gz"),
First = "Hello, all good men going to search parties. ",
Second = "Now I really need your help.",
All = iolist_to_binary([First|Second]),
- ?line Cat = [zlib:gzip(First),zlib:gzip(Second)],
-
- ?line ok = file:write_file(MyFile, Cat),
+ Cat = [zlib:gzip(First),zlib:gzip(Second)],
+
+ ok = file:write_file(MyFile, Cat),
- ?line {ok,Fd} = file:open(MyFile, [read,compressed,binary]),
- ?line {ok,All} = file:read(Fd, 100000),
- ?line ok = file:close(Fd),
+ {ok,Fd} = file:open(MyFile, [read,compressed,binary]),
+ {ok,All} = file:read(Fd, 100000),
+ ok = file:close(Fd),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-compress_errors(suite) -> [];
-compress_errors(doc) -> [];
compress_errors(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line DataDir =
+ DataDir =
filename:dirname(
- filename:join(?config(data_dir, Config), "x")),
- ?line DataDirSlash = DataDir++"/",
- ?line {error, enoent} = ?FILE_MODULE:open("non_existing__",
- [compressed, read]),
- ?line {error, einval} = ?FILE_MODULE:open("non_existing__",
- [compressed, read, write]),
- ?line {error, einval} = ?FILE_MODULE:open("non_existing__",
- [compressed, read, append]),
- ?line {error, einval} = ?FILE_MODULE:open("non_existing__",
- [compressed, write, append]),
- ?line {error, E1} = ?FILE_MODULE:open(DataDir, [compressed, read]),
- ?line {error, E2} = ?FILE_MODULE:open(DataDirSlash, [compressed, read]),
- ?line {error, E3} = ?FILE_MODULE:open(DataDir, [compressed, write]),
- ?line {error, E4} = ?FILE_MODULE:open(DataDirSlash, [compressed, write]),
- ?line {eisdir,eisdir,eisdir,eisdir} = {E1,E2,E3,E4},
+ filename:join(proplists:get_value(data_dir, Config), "x")),
+ DataDirSlash = DataDir++"/",
+ {error, enoent} = ?FILE_MODULE:open("non_existing__",
+ [compressed, read]),
+ {error, einval} = ?FILE_MODULE:open("non_existing__",
+ [compressed, read, write]),
+ {error, einval} = ?FILE_MODULE:open("non_existing__",
+ [compressed, read, append]),
+ {error, einval} = ?FILE_MODULE:open("non_existing__",
+ [compressed, write, append]),
+ {error, E1} = ?FILE_MODULE:open(DataDir, [compressed, read]),
+ {error, E2} = ?FILE_MODULE:open(DataDirSlash, [compressed, read]),
+ {error, E3} = ?FILE_MODULE:open(DataDir, [compressed, write]),
+ {error, E4} = ?FILE_MODULE:open(DataDirSlash, [compressed, write]),
+ {eisdir,eisdir,eisdir,eisdir} = {E1,E2,E3,E4},
%% Read a corrupted .gz file.
- ?line Corrupted = filename:join(DataDir, "corrupted.gz"),
- ?line {ok, Fd} = ?FILE_MODULE:open(Corrupted, [read, compressed]),
- ?line {error, eio} = ?FILE_MODULE:read(Fd, 100),
- ?line ?FILE_MODULE:close(Fd),
+ Corrupted = filename:join(DataDir, "corrupted.gz"),
+ {ok, Fd} = ?FILE_MODULE:open(Corrupted, [read, compressed]),
+ {error, eio} = ?FILE_MODULE:read(Fd, 100),
+ ?FILE_MODULE:close(Fd),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-compress_async_crash(suite) -> [];
-compress_async_crash(doc) -> [];
compress_async_crash(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line Path = filename:join(DataDir, "test.gz"),
+ DataDir = proplists:get_value(data_dir, Config),
+ Path = filename:join(DataDir, "test.gz"),
ExpectedData = <<"qwerty">>,
- ?line _ = ?FILE_MODULE:delete(Path),
- ?line {ok, Fd} = ?FILE_MODULE:open(Path, [write, binary, compressed]),
- ?line ok = ?FILE_MODULE:write(Fd, ExpectedData),
- ?line ok = ?FILE_MODULE:close(Fd),
+ _ = ?FILE_MODULE:delete(Path),
+ {ok, Fd} = ?FILE_MODULE:open(Path, [write, binary, compressed]),
+ ok = ?FILE_MODULE:write(Fd, ExpectedData),
+ ok = ?FILE_MODULE:close(Fd),
- % Test that when using async thread pool, the emulator doesn't crash
- % when the efile port driver is stopped while a compressed file operation
- % is in progress (being carried by an async thread).
- ?line ok = compress_async_crash_loop(10000, Path, ExpectedData),
- ?line ok = ?FILE_MODULE:delete(Path),
+ %% Test that when using async thread pool, the emulator doesn't crash
+ %% when the efile port driver is stopped while a compressed file operation
+ %% is in progress (being carried by an async thread).
+ ok = compress_async_crash_loop(10000, Path, ExpectedData),
+ ok = ?FILE_MODULE:delete(Path),
ok.
compress_async_crash_loop(0, _Path, _ExpectedData) ->
@@ -2740,35 +2555,35 @@ compress_async_crash_loop(0, _Path, _ExpectedData) ->
compress_async_crash_loop(N, Path, ExpectedData) ->
Parent = self(),
{Pid, Ref} = spawn_monitor(
- fun() ->
- ?line {ok, Fd} = ?FILE_MODULE:open(
- Path, [read, compressed, raw, binary]),
- Len = byte_size(ExpectedData),
- Parent ! {self(), continue},
- ?line {ok, ExpectedData} = ?FILE_MODULE:read(Fd, Len),
- ?line ok = ?FILE_MODULE:close(Fd),
- receive foobar -> ok end
- end),
+ fun() ->
+ {ok, Fd} = ?FILE_MODULE:open(
+ Path, [read, compressed, raw, binary]),
+ Len = byte_size(ExpectedData),
+ Parent ! {self(), continue},
+ {ok, ExpectedData} = ?FILE_MODULE:read(Fd, Len),
+ ok = ?FILE_MODULE:close(Fd),
+ receive foobar -> ok end
+ end),
receive
{Pid, continue} ->
exit(Pid, shutdown),
receive
{'DOWN', Ref, _, _, Reason} ->
- ?line shutdown = Reason
+ shutdown = Reason
end;
{'DOWN', Ref, _, _, Reason2} ->
- test_server:fail({worker_exited, Reason2})
+ ct:fail({worker_exited, Reason2})
after 60000 ->
exit(Pid, shutdown),
erlang:demonitor(Ref, [flush]),
- test_server:fail(worker_timeout)
+ ct:fail(worker_timeout)
end,
compress_async_crash_loop(N - 1, Path, ExpectedData).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
unicode(Config) when is_list(Config) ->
- Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
Name = filename:join(Dir, "data-utf8.txt"),
Txt = lists:seq(128, 255),
D = unicode:characters_to_binary(Txt, latin1, latin1),
@@ -2801,53 +2616,46 @@ unicode(Config) when is_list(Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-altname(doc) ->
- "Test the file:altname/1 function";
-altname(suite) ->
- [];
+%% Test the file:altname/1 function.
altname(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line NewDir = filename:join(RootDir,
- "long alternative path name with spaces"),
- ?line ok = ?FILE_MODULE:make_dir(NewDir),
- ?line Name = filename:join(NewDir, "a_file_with_long_name"),
- ?line ShortName = filename:join(NewDir, "short"),
- ?line NonexName = filename:join(NewDir, "nonexistent"),
- ?line ok = ?FILE_MODULE:write_file(Name, "some contents\n"),
- ?line ok = ?FILE_MODULE:write_file(ShortName, "some contents\n"),
- ?line Result =
+ RootDir = proplists:get_value(priv_dir, Config),
+ NewDir = filename:join(RootDir,
+ "long alternative path name with spaces"),
+ ok = ?FILE_MODULE:make_dir(NewDir),
+ Name = filename:join(NewDir, "a_file_with_long_name"),
+ ShortName = filename:join(NewDir, "short"),
+ NonexName = filename:join(NewDir, "nonexistent"),
+ ok = ?FILE_MODULE:write_file(Name, "some contents\n"),
+ ok = ?FILE_MODULE:write_file(ShortName, "some contents\n"),
+ Result =
case ?FILE_MODULE:altname(NewDir) of
{error, enotsup} ->
{skipped, "Altname not supported on this platform"};
{ok, "LONGAL~1"} ->
- ?line {ok, "A_FILE~1"} = ?FILE_MODULE:altname(Name),
- ?line {ok, "C:/"} = ?FILE_MODULE:altname("C:/"),
- ?line {ok, "C:\\"} = ?FILE_MODULE:altname("C:\\"),
- ?line {error,enoent} = ?FILE_MODULE:altname(NonexName),
- ?line {ok, "short"} = ?FILE_MODULE:altname(ShortName),
+ {ok, "A_FILE~1"} = ?FILE_MODULE:altname(Name),
+ {ok, "C:/"} = ?FILE_MODULE:altname("C:/"),
+ {ok, "C:\\"} = ?FILE_MODULE:altname("C:\\"),
+ {error,enoent} = ?FILE_MODULE:altname(NonexName),
+ {ok, "short"} = ?FILE_MODULE:altname(ShortName),
ok
end,
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
Result.
-make_link(doc) -> "Test creating a hard link.";
-make_link(suite) -> [];
+%% Test creating a hard link.
make_link(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_make_link"),
- ?line ok = ?FILE_MODULE:make_dir(NewDir),
-
- ?line Name = filename:join(NewDir, "a_file"),
- ?line ok = ?FILE_MODULE:write_file(Name, "some contents\n"),
-
- ?line Alias = filename:join(NewDir, "an_alias"),
- ?line Result =
+ RootDir = proplists:get_value(priv_dir, Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_make_link"),
+ ok = ?FILE_MODULE:make_dir(NewDir),
+
+ Name = filename:join(NewDir, "a_file"),
+ ok = ?FILE_MODULE:write_file(Name, "some contents\n"),
+
+ Alias = filename:join(NewDir, "an_alias"),
+ Result =
case ?FILE_MODULE:make_link(Name, Alias) of
{error, enotsup} ->
{skipped, "Links not supported on this platform"};
@@ -2857,53 +2665,45 @@ make_link(Config) when is_list(Config) ->
%% which should in behave exactly as
%% ?FILE_MODULE:read_file_info/1
%% since they are not used on symbolic links.
-
- ?line {ok, Info} = ?FILE_MODULE:read_link_info(Name),
+
+ {ok, Info} = ?FILE_MODULE:read_link_info(Name),
{ok,Info} = ?FILE_MODULE:read_link_info(Name, [raw]),
- ?line {ok, Info} = ?FILE_MODULE:read_link_info(Alias),
+ {ok, Info} = ?FILE_MODULE:read_link_info(Alias),
{ok,Info} = ?FILE_MODULE:read_link_info(Alias, [raw]),
- ?line #file_info{links = 2, type = regular} = Info,
- ?line {error, eexist} =
+ #file_info{links = 2, type = regular} = Info,
+ {error, eexist} =
?FILE_MODULE:make_link(Name, Alias),
ok
end,
-
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+
+ [] = flush(),
Result.
-read_link_info_for_non_link(doc) ->
- "Test that reading link info for an ordinary file or directory works "
- "(on all platforms).";
-read_link_info_for_non_link(suite) -> [];
+%% Test that reading link info for an ordinary file or directory works
+%% (on all platforms).
read_link_info_for_non_link(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
-
- ?line {ok, #file_info{type=directory}} =
+ {ok, #file_info{type=directory}} =
?FILE_MODULE:read_link_info("."),
{ok, #file_info{type=directory}} = ?FILE_MODULE:read_link_info(".", [raw]),
-
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+
+ [] = flush(),
ok.
-symlinks(doc) -> "Test operations on symbolic links (for Unix).";
-symlinks(suite) -> [];
+%% Test operations on symbolic links (for Unix).
symlinks(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line {error, _} = ?FILE_MODULE:read_link(lists:duplicate(10000,$a)),
+ {error, _} = ?FILE_MODULE:read_link(lists:duplicate(10000,$a)),
{error, _} = ?FILE_MODULE:read_link_all(lists:duplicate(10000,$a)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_symlinks"),
- ?line ok = ?FILE_MODULE:make_dir(NewDir),
-
- ?line Name = filename:join(NewDir, "a_plain_file"),
- ?line ok = ?FILE_MODULE:write_file(Name, "some stupid content\n"),
-
- ?line Alias = filename:join(NewDir, "a_symlink_alias"),
- ?line Result =
+ RootDir = proplists:get_value(priv_dir, Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_symlinks"),
+ ok = ?FILE_MODULE:make_dir(NewDir),
+
+ Name = filename:join(NewDir, "a_plain_file"),
+ ok = ?FILE_MODULE:write_file(Name, "some stupid content\n"),
+
+ Alias = filename:join(NewDir, "a_symlink_alias"),
+ Result =
case ?FILE_MODULE:make_symlink(Name, Alias) of
{error, enotsup} ->
{skipped, "Links not supported on this platform"};
@@ -2911,41 +2711,37 @@ symlinks(Config) when is_list(Config) ->
{win32,_} = os:type(),
{skipped, "Windows user not privileged to create symlinks"};
ok ->
- ?line {ok, Info1} = ?FILE_MODULE:read_file_info(Name),
+ {ok, Info1} = ?FILE_MODULE:read_file_info(Name),
{ok,Info1} = ?FILE_MODULE:read_file_info(Name, [raw]),
- ?line {ok, Info1} = ?FILE_MODULE:read_file_info(Alias),
+ {ok, Info1} = ?FILE_MODULE:read_file_info(Alias),
{ok,Info1} = ?FILE_MODULE:read_file_info(Alias, [raw]),
- ?line {ok, Info1} = ?FILE_MODULE:read_link_info(Name),
+ {ok, Info1} = ?FILE_MODULE:read_link_info(Name),
{ok,Info1} = ?FILE_MODULE:read_link_info(Name, [raw]),
- ?line #file_info{links = 1, type = regular} = Info1,
-
- ?line {ok, Info2} = ?FILE_MODULE:read_link_info(Alias),
+ #file_info{links = 1, type = regular} = Info1,
+
+ {ok, Info2} = ?FILE_MODULE:read_link_info(Alias),
{ok,Info2} = ?FILE_MODULE:read_link_info(Alias, [raw]),
- ?line #file_info{links=1, type=symlink} = Info2,
- ?line {ok, Name} = ?FILE_MODULE:read_link(Alias),
+ #file_info{links=1, type=symlink} = Info2,
+ {ok, Name} = ?FILE_MODULE:read_link(Alias),
{ok, Name} = ?FILE_MODULE:read_link_all(Alias),
%% If all is good, delete dir again (avoid hanging dir on windows)
rm_rf(?FILE_MODULE,NewDir),
ok
- end,
-
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ end,
+
+ [] = flush(),
Result.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-copy(doc) -> [];
-copy(suite) -> [];
copy(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
+ RootDir = proplists:get_value(priv_dir, Config),
%% Create a text file.
- ?line Name1 = filename:join(RootDir, atom_to_list(?MODULE)++"_copy_1.txt"),
- ?line Line = "The quick brown fox jumps over a lazy dog. 0123456789\n",
- ?line Len = length(Line),
- ?line {ok, Handle1} = ?FILE_MODULE:open(Name1, [write]),
- ?line {_, Size1} =
+ Name1 = filename:join(RootDir, atom_to_list(?MODULE)++"_copy_1.txt"),
+ Line = "The quick brown fox jumps over a lazy dog. 0123456789\n",
+ Len = length(Line),
+ {ok, Handle1} = ?FILE_MODULE:open(Name1, [write]),
+ {_, Size1} =
iterate({0, 0},
done,
fun({_, S}) when S >= 128*1024 ->
@@ -2955,45 +2751,44 @@ copy(Config) when is_list(Config) ->
ok = ?FILE_MODULE:write(Handle1, [H, " ", Line]),
{N + 1, S + length(H) + 1 + Len}
end),
- ?line ?FILE_MODULE:close(Handle1),
+ ?FILE_MODULE:close(Handle1),
%% Make a copy
- ?line Name2 = filename:join(RootDir, atom_to_list(?MODULE)++"_copy_2.txt"),
- ?line {ok, Size1} = ?FILE_MODULE:copy(Name1, Name2),
+ Name2 = filename:join(RootDir, atom_to_list(?MODULE)++"_copy_2.txt"),
+ {ok, Size1} = ?FILE_MODULE:copy(Name1, Name2),
%% Concatenate 1
- ?line Name3 = filename:join(RootDir, atom_to_list(?MODULE)++"_copy_3.txt"),
- ?line {ok, Handle3} = ?FILE_MODULE:open(Name3, [raw, write, binary]),
- ?line {ok, Size1} = ?FILE_MODULE:copy(Name1, Handle3),
- ?line {ok, Handle2} = ?FILE_MODULE:open(Name2, [read, binary]),
- ?line {ok, Size1} = ?FILE_MODULE:copy(Handle2, Handle3),
- ?line ok = ?FILE_MODULE:close(Handle3),
- ?line ok = ?FILE_MODULE:close(Handle2),
+ Name3 = filename:join(RootDir, atom_to_list(?MODULE)++"_copy_3.txt"),
+ {ok, Handle3} = ?FILE_MODULE:open(Name3, [raw, write, binary]),
+ {ok, Size1} = ?FILE_MODULE:copy(Name1, Handle3),
+ {ok, Handle2} = ?FILE_MODULE:open(Name2, [read, binary]),
+ {ok, Size1} = ?FILE_MODULE:copy(Handle2, Handle3),
+ ok = ?FILE_MODULE:close(Handle3),
+ ok = ?FILE_MODULE:close(Handle2),
%% Concatenate 2
- ?line Name4 = filename:join(RootDir, atom_to_list(?MODULE)++"_copy_4.txt"),
- ?line {ok, Handle4} = ?FILE_MODULE:open(Name4, [write, binary]),
- ?line {ok, Size1} = ?FILE_MODULE:copy(Name1, Handle4),
- ?line {ok, Handle5} = ?FILE_MODULE:open(Name2, [raw, read, binary]),
- ?line {ok, Size1} = ?FILE_MODULE:copy(Handle5, Handle4),
- ?line ok = ?FILE_MODULE:close(Handle5),
- ?line ok = ?FILE_MODULE:close(Handle4),
+ Name4 = filename:join(RootDir, atom_to_list(?MODULE)++"_copy_4.txt"),
+ {ok, Handle4} = ?FILE_MODULE:open(Name4, [write, binary]),
+ {ok, Size1} = ?FILE_MODULE:copy(Name1, Handle4),
+ {ok, Handle5} = ?FILE_MODULE:open(Name2, [raw, read, binary]),
+ {ok, Size1} = ?FILE_MODULE:copy(Handle5, Handle4),
+ ok = ?FILE_MODULE:close(Handle5),
+ ok = ?FILE_MODULE:close(Handle4),
%% %% Just for test of the test
- %% ?line {ok, Handle2q} = ?FILE_MODULE:open(Name2, [write, append]),
- %% ?line ok = ?FILE_MODULE:write(Handle2q, "q"),
- %% ?line ok = ?FILE_MODULE:close(Handle2q),
+ %% {ok, Handle2q} = ?FILE_MODULE:open(Name2, [write, append]),
+ %% ok = ?FILE_MODULE:write(Handle2q, "q"),
+ %% ok = ?FILE_MODULE:close(Handle2q),
%% Compare the files
- ?line {ok, Handle1a} = ?FILE_MODULE:open(Name1, [raw, read]),
- ?line {ok, Handle2a} = ?FILE_MODULE:open(Name2, [raw, read]),
- ?line true = stream_cmp(fd_stream_factory([Handle1a]),
- fd_stream_factory([Handle2a])),
- ?line {ok, 0} = ?FILE_MODULE:position(Handle1a, 0),
- ?line {ok, 0} = ?FILE_MODULE:position(Handle2a, 0),
- ?line {ok, Handle3a} = ?FILE_MODULE:open(Name3, [raw, read]),
- ?line true = stream_cmp(fd_stream_factory([Handle1a, Handle2a]),
- fd_stream_factory([Handle2a])),
- ?line ok = ?FILE_MODULE:close(Handle1a),
- ?line ok = ?FILE_MODULE:close(Handle2a),
- ?line ok = ?FILE_MODULE:close(Handle3a),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ {ok, Handle1a} = ?FILE_MODULE:open(Name1, [raw, read]),
+ {ok, Handle2a} = ?FILE_MODULE:open(Name2, [raw, read]),
+ true = stream_cmp(fd_stream_factory([Handle1a]),
+ fd_stream_factory([Handle2a])),
+ {ok, 0} = ?FILE_MODULE:position(Handle1a, 0),
+ {ok, 0} = ?FILE_MODULE:position(Handle2a, 0),
+ {ok, Handle3a} = ?FILE_MODULE:open(Name3, [raw, read]),
+ true = stream_cmp(fd_stream_factory([Handle1a, Handle2a]),
+ fd_stream_factory([Handle2a])),
+ ok = ?FILE_MODULE:close(Handle1a),
+ ok = ?FILE_MODULE:close(Handle2a),
+ ok = ?FILE_MODULE:close(Handle3a),
+ [] = flush(),
ok.
@@ -3014,7 +2809,7 @@ fd_stream_factory([Fd | T] = L) ->
end
end.
-
+
stream_cmp(F1, F2) when is_function(F1), is_function(F2) ->
stream_cmp(F1(), F2());
@@ -3039,80 +2834,75 @@ stream_cmp([H | T1], [H | T2]) ->
%% Test the get_cwd(), open(), and copy() file server calls.
new_slave(_RootDir, Cwd) ->
- ?line L = "qwertyuiopasdfghjklzxcvbnm",
- ?line N = length(L),
- ?line {ok, Cwd} = ?FILE_MODULE:get_cwd(),
- ?line {error, enotsup} = ?FILE_MODULE:get_cwd("C:"), % Unix only testcase
- ?line {ok, FD1} = ?FILE_MODULE:open("file1.txt", write),
- ?line ok = ?FILE_MODULE:close(FD1),
- ?line {ok, FD2} = ?FILE_MODULE:open("file1.txt",
- [write, append,
- binary, compressed,
- delayed_write,
- {delayed_write, 0, 0},
- read_ahead,
- {read_ahead, 0}]),
- ?line ok = ?FILE_MODULE:write(FD2, L),
- ?line ok = ?FILE_MODULE:close(FD2),
- ?line {ok, N2} = ?FILE_MODULE:copy("file1.txt", "file2.txt"),
- ?line io:format("Size ~p, compressed ~p.~n", [N, N2]),
- ?line {ok, FD3} = ?FILE_MODULE:open("file2.txt",
- [binary, compressed]),
+ L = "qwertyuiopasdfghjklzxcvbnm",
+ N = length(L),
+ {ok, Cwd} = ?FILE_MODULE:get_cwd(),
+ {error, enotsup} = ?FILE_MODULE:get_cwd("C:"), % Unix only testcase
+ {ok, FD1} = ?FILE_MODULE:open("file1.txt", write),
+ ok = ?FILE_MODULE:close(FD1),
+ {ok, FD2} = ?FILE_MODULE:open("file1.txt",
+ [write, append,
+ binary, compressed,
+ delayed_write,
+ {delayed_write, 0, 0},
+ read_ahead,
+ {read_ahead, 0}]),
+ ok = ?FILE_MODULE:write(FD2, L),
+ ok = ?FILE_MODULE:close(FD2),
+ {ok, N2} = ?FILE_MODULE:copy("file1.txt", "file2.txt"),
+ io:format("Size ~p, compressed ~p.~n", [N, N2]),
+ {ok, FD3} = ?FILE_MODULE:open("file2.txt",
+ [binary, compressed]),
%% The file_io_server will translate the binary into a list
- ?line {ok, L} = ?FILE_MODULE:read(FD3, N+1),
- ?line ok = ?FILE_MODULE:close(FD3),
+ {ok, L} = ?FILE_MODULE:read(FD3, N+1),
+ ok = ?FILE_MODULE:close(FD3),
%%
- ?line ok = ?FILE_MODULE:delete("file1.txt"),
- ?line ok = ?FILE_MODULE:delete("file2.txt"),
- ?line [] = flush(),
+ ok = ?FILE_MODULE:delete("file1.txt"),
+ ok = ?FILE_MODULE:delete("file2.txt"),
+ [] = flush(),
ok.
%% Test the get_cwd() and open() file server calls.
old_slave(_RootDir, Cwd) ->
- ?line L = "qwertyuiopasdfghjklzxcvbnm",
- ?line N = length(L),
- ?line {ok, Cwd} = ?FILE_MODULE:get_cwd(),
- ?line {error, enotsup} = ?FILE_MODULE:get_cwd("C:"), % Unix only testcase
- ?line {ok, FD1} = ?FILE_MODULE:open("file1.txt", write),
- ?line ok = ?FILE_MODULE:close(FD1),
- ?line {ok, FD2} = ?FILE_MODULE:open("file1.txt",
- [write, binary, compressed]),
- ?line ok = ?FILE_MODULE:write(FD2, L),
- ?line ok = ?FILE_MODULE:close(FD2),
- ?line {ok, FD3} = ?FILE_MODULE:open("file1.txt", [write, append]),
- ?line ok = ?FILE_MODULE:close(FD3),
- ?line {ok, FD4} = ?FILE_MODULE:open("file1.txt",
- [binary, compressed]),
+ L = "qwertyuiopasdfghjklzxcvbnm",
+ N = length(L),
+ {ok, Cwd} = ?FILE_MODULE:get_cwd(),
+ {error, enotsup} = ?FILE_MODULE:get_cwd("C:"), % Unix only testcase
+ {ok, FD1} = ?FILE_MODULE:open("file1.txt", write),
+ ok = ?FILE_MODULE:close(FD1),
+ {ok, FD2} = ?FILE_MODULE:open("file1.txt",
+ [write, binary, compressed]),
+ ok = ?FILE_MODULE:write(FD2, L),
+ ok = ?FILE_MODULE:close(FD2),
+ {ok, FD3} = ?FILE_MODULE:open("file1.txt", [write, append]),
+ ok = ?FILE_MODULE:close(FD3),
+ {ok, FD4} = ?FILE_MODULE:open("file1.txt",
+ [binary, compressed]),
%% The file_io_server will translate the binary into a list
- ?line {ok, L} = ?FILE_MODULE:read(FD4, N+1),
- ?line ok = ?FILE_MODULE:close(FD4),
+ {ok, L} = ?FILE_MODULE:read(FD4, N+1),
+ ok = ?FILE_MODULE:close(FD4),
%%
- ?line ok = ?FILE_MODULE:delete("file1.txt"),
- ?line [] = flush(),
+ ok = ?FILE_MODULE:delete("file1.txt"),
+ [] = flush(),
ok.
run_test(Test, Args) ->
- ?line case (catch apply(?MODULE, Test, Args)) of
- {'EXIT', _} = Exit ->
- {done, Exit, get(test_server_loc)};
- Result ->
- {done, Result}
- end.
+ case (catch apply(?MODULE, Test, Args)) of
+ {'EXIT', _} = Exit ->
+ {done, Exit, get(test_server_loc)};
+ Result ->
+ {done, Result}
+ end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-delayed_write(suite) ->
- [];
-delayed_write(doc) ->
- ["Tests the file open option {delayed_write, Size, Delay}"];
+%% Tests the file open option {delayed_write, Size, Delay}.
delayed_write(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:seconds(20)),
-
- RootDir = ?config(priv_dir, Config),
+ RootDir = proplists:get_value(priv_dir, Config),
File = filename:join(RootDir,
- atom_to_list(?MODULE)++"_delayed_write.txt"),
+ atom_to_list(?MODULE)++"_delayed_write.txt"),
Data1 = "asdfghjkl",
Data2 = "qwertyuio",
Data3 = "zxcvbnm,.",
@@ -3127,18 +2917,18 @@ delayed_write(Config) when is_list(Config) ->
{ok, Fd1} =
?FILE_MODULE:open(File, [write, {delayed_write, Size+1, 2000}]),
ok = ?FILE_MODULE:write(Fd1, Data1),
- ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
{ok, Fd2} = ?FILE_MODULE:open(File, [read]),
eof = ?FILE_MODULE:read(Fd2, 1),
ok = ?FILE_MODULE:write(Fd1, Data1), % Data flush on size
- ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
{ok, Data1Data1} = ?FILE_MODULE:pread(Fd2, bof, 2*Size+1),
ok = ?FILE_MODULE:write(Fd1, Data1),
- ?t:sleep(3000), % Wait until data flush on timeout
+ timer:sleep(3000), % Wait until data flush on timeout
{ok, Data1Data1Data1} = ?FILE_MODULE:pread(Fd2, bof, 3*Size+1),
ok = ?FILE_MODULE:write(Fd1, Data1),
ok = ?FILE_MODULE:close(Fd1), % Data flush on close
- ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
{ok, Data1Data1Data1Data1} = ?FILE_MODULE:pread(Fd2, bof, 4*Size+1),
ok = ?FILE_MODULE:close(Fd2),
%%
@@ -3146,33 +2936,33 @@ delayed_write(Config) when is_list(Config) ->
%% raw file, default parameters.
Parent = self(),
Fun = fun() ->
- Child = self(),
- Test =
- fun () ->
- {ok, Fd} = ?FILE_MODULE:open(File,
- [raw, write, delayed_write]),
- ok = ?FILE_MODULE:write(Fd, Data1),
- Parent ! {Child, wrote},
- receive
- {Parent, continue, Reason} ->
- {ok, Reason}
- end
- end,
- case (catch Test()) of
- {ok, Reason} -> exit(Reason);
- Unknown ->
- exit({Unknown, get(test_server_loc)})
- end
- end,
+ Child = self(),
+ Test =
+ fun () ->
+ {ok, Fd} = ?FILE_MODULE:open(File,
+ [raw, write, delayed_write]),
+ ok = ?FILE_MODULE:write(Fd, Data1),
+ Parent ! {Child, wrote},
+ receive
+ {Parent, continue, Reason} ->
+ {ok, Reason}
+ end
+ end,
+ case (catch Test()) of
+ {ok, Reason} -> exit(Reason);
+ Unknown ->
+ exit({Unknown, get(test_server_loc)})
+ end
+ end,
Child1 = spawn(Fun),
Mref1 = erlang:monitor(process, Child1),
receive
{Child1, wrote} ->
ok;
{'DOWN', Mref1, _, _, _} = Down1a ->
- ?t:fail(Down1a)
+ ct:fail(Down1a)
end,
- ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
{ok, Fd3} = ?FILE_MODULE:open(File, [read]),
eof = ?FILE_MODULE:read(Fd3, 1),
Child1 ! {Parent, continue, normal},
@@ -3180,9 +2970,9 @@ delayed_write(Config) when is_list(Config) ->
{'DOWN', Mref1, process, Child1, normal} ->
ok;
{'DOWN', Mref1, _, _, _} = Down1b ->
- ?t:fail(Down1b)
+ ct:fail(Down1b)
end,
- ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
{ok, Data1} = ?FILE_MODULE:pread(Fd3, bof, Size+1),
ok = ?FILE_MODULE:close(Fd3),
%%
@@ -3193,9 +2983,9 @@ delayed_write(Config) when is_list(Config) ->
{Child2, wrote} ->
ok;
{'DOWN', Mref2, _, _, _} = Down2a ->
- ?t:fail(Down2a)
+ ct:fail(Down2a)
end,
- ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
{ok, Fd4} = ?FILE_MODULE:open(File, [read]),
eof = ?FILE_MODULE:read(Fd4, 1),
Child2 ! {Parent, continue, kill},
@@ -3203,15 +2993,15 @@ delayed_write(Config) when is_list(Config) ->
{'DOWN', Mref2, process, Child2, kill} ->
ok;
{'DOWN', Mref2, _, _, _} = Down2b ->
- ?t:fail(Down2b)
+ ct:fail(Down2b)
end,
- ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
eof = ?FILE_MODULE:pread(Fd4, bof, 1),
ok = ?FILE_MODULE:close(Fd4),
%%
%% Test if file position works with delayed_write
{ok, Fd5} = ?FILE_MODULE:open(File, [raw, read, write,
- delayed_write]),
+ delayed_write]),
ok = ?FILE_MODULE:truncate(Fd5),
ok = ?FILE_MODULE:write(Fd5, [Data1|Data2]),
{ok, 0} = ?FILE_MODULE:position(Fd5, bof),
@@ -3223,93 +3013,82 @@ delayed_write(Config) when is_list(Config) ->
ok = ?FILE_MODULE:close(Fd5),
%%
[] = flush(),
- ?t:timetrap_cancel(Dog),
ok.
-pid2name(doc) -> "Tests file:pid2name/1.";
-pid2name(suite) -> [];
+%% Tests file:pid2name/1.
pid2name(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line Base = test_server:temp_name(
- filename:join(RootDir, "pid2name_")),
- ?line Name1 = [Base, '.txt'],
- ?line Name2 = Base ++ ".txt",
+ RootDir = proplists:get_value(priv_dir, Config),
+ Base = test_server:temp_name(
+ filename:join(RootDir, "pid2name_")),
+ Name1 = [Base, '.txt'],
+ Name2 = Base ++ ".txt",
%%
- ?line {ok, Pid} = file:open(Name1, [write]),
- ?line {ok, Name2} = file:pid2name(Pid),
- ?line undefined = file:pid2name(self()),
- ?line ok = file:close(Pid),
- ?line test_server:sleep(1000),
- ?line false = is_process_alive(Pid),
- ?line undefined = file:pid2name(Pid),
- %%
- ?line test_server:timetrap_cancel(Dog),
+ {ok, Pid} = file:open(Name1, [write]),
+ {ok, Name2} = file:pid2name(Pid),
+ undefined = file:pid2name(self()),
+ ok = file:close(Pid),
+ ct:sleep(1000),
+ false = is_process_alive(Pid),
+ undefined = file:pid2name(Pid),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-read_ahead(suite) ->
- [];
-read_ahead(doc) ->
- ["Tests the file open option {read_ahead, Size}"];
+%% Tests the file open option {read_ahead, Size}.
read_ahead(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(20)),
- %%
- ?line RootDir = ?config(priv_dir, Config),
- ?line File = filename:join(RootDir,
- atom_to_list(?MODULE)++"_read_ahead.txt"),
- ?line Data1 = "asdfghjkl", % Must be
- ?line Data2 = "qwertyuio", % same
- ?line Data3 = "zxcvbnm,.", % length
- ?line Size = length(Data1),
- ?line Size = length(Data2),
- ?line Size = length(Data3),
+ RootDir = proplists:get_value(priv_dir, Config),
+ File = filename:join(RootDir,
+ atom_to_list(?MODULE)++"_read_ahead.txt"),
+ Data1 = "asdfghjkl", % Must be
+ Data2 = "qwertyuio", % same
+ Data3 = "zxcvbnm,.", % length
+ Size = length(Data1),
+ Size = length(Data2),
+ Size = length(Data3),
%%
%% Test caching of normal non-raw file
- ?line {ok, Fd1} = ?FILE_MODULE:open(File, [write]),
- ?line ok = ?FILE_MODULE:write(Fd1, [Data1|Data1]),
- ?line ?t:sleep(1000), % Just in case the file system is slow
- ?line {ok, Fd2} = ?FILE_MODULE:open(File, [read, {read_ahead, 2*Size}]),
- ?line {ok, Data1} = ?FILE_MODULE:read(Fd2, Size),
- ?line ok = ?FILE_MODULE:pwrite(Fd1, Size, Data2),
- ?line ?t:sleep(1000), % Just in case the file system is slow
- ?line {ok, Data1} = ?FILE_MODULE:read(Fd2, Size), % Will read cached data
- ?line Data2Data2Data2 = Data2++Data2++Data2,
- ?line ok = ?FILE_MODULE:pwrite(Fd1, eof, Data2Data2Data2),
- ?line ?t:sleep(1000), % Just in case the file system is slow
- ?line {ok, Data2Data2Data2} =
+ {ok, Fd1} = ?FILE_MODULE:open(File, [write]),
+ ok = ?FILE_MODULE:write(Fd1, [Data1|Data1]),
+ timer:sleep(1000), % Just in case the file system is slow
+ {ok, Fd2} = ?FILE_MODULE:open(File, [read, {read_ahead, 2*Size}]),
+ {ok, Data1} = ?FILE_MODULE:read(Fd2, Size),
+ ok = ?FILE_MODULE:pwrite(Fd1, Size, Data2),
+ timer:sleep(1000), % Just in case the file system is slow
+ {ok, Data1} = ?FILE_MODULE:read(Fd2, Size), % Will read cached data
+ Data2Data2Data2 = Data2++Data2++Data2,
+ ok = ?FILE_MODULE:pwrite(Fd1, eof, Data2Data2Data2),
+ timer:sleep(1000), % Just in case the file system is slow
+ {ok, Data2Data2Data2} =
?FILE_MODULE:read(Fd2, 3*Size), % Read more than cache buffer
- ?line ok = ?FILE_MODULE:close(Fd1),
- ?line ok = ?FILE_MODULE:close(Fd2),
+ ok = ?FILE_MODULE:close(Fd1),
+ ok = ?FILE_MODULE:close(Fd2),
%% Test caching of raw file and default parameters
- ?line {ok, Fd3} = ?FILE_MODULE:open(File, [raw, write]),
- ?line ok = ?FILE_MODULE:write(Fd3, [Data1|Data1]),
- ?line ?t:sleep(1000), % Just in case the file system is slow
- ?line {ok, Fd4} = ?FILE_MODULE:open(File, [raw, read, read_ahead]),
- ?line {ok, Data1} = ?FILE_MODULE:read(Fd4, Size),
- ?line ok = ?FILE_MODULE:pwrite(Fd3, Size, Data2),
- ?line ?t:sleep(1000), % Just in case the file system is slow
- ?line {ok, Data1} = ?FILE_MODULE:read(Fd4, Size), % Will read cached data
- ?line ok = ?FILE_MODULE:close(Fd3),
- ?line ok = ?FILE_MODULE:close(Fd4),
+ {ok, Fd3} = ?FILE_MODULE:open(File, [raw, write]),
+ ok = ?FILE_MODULE:write(Fd3, [Data1|Data1]),
+ timer:sleep(1000), % Just in case the file system is slow
+ {ok, Fd4} = ?FILE_MODULE:open(File, [raw, read, read_ahead]),
+ {ok, Data1} = ?FILE_MODULE:read(Fd4, Size),
+ ok = ?FILE_MODULE:pwrite(Fd3, Size, Data2),
+ timer:sleep(1000), % Just in case the file system is slow
+ {ok, Data1} = ?FILE_MODULE:read(Fd4, Size), % Will read cached data
+ ok = ?FILE_MODULE:close(Fd3),
+ ok = ?FILE_MODULE:close(Fd4),
%% Test if the file position works in combination with read_ahead
- ?line {ok, Fd5} = ?FILE_MODULE:open(File, [raw, read, write, read_ahead]),
- ?line ok = ?FILE_MODULE:truncate(Fd5),
- ?line ok = ?FILE_MODULE:write(Fd5, [Data1,Data1|Data3]),
- ?line {ok, 0} = ?FILE_MODULE:position(Fd5, bof),
- ?line {ok, Data1} = ?FILE_MODULE:read(Fd5, Size),
- ?line ok = ?FILE_MODULE:write(Fd5, Data2),
- ?line {ok, 0} = ?FILE_MODULE:position(Fd5, bof),
- ?line Data1Data2Data3 = Data1++Data2++Data3,
- ?line {ok, Data1Data2Data3} = ?FILE_MODULE:read(Fd5, 3*Size+1),
- ?line ok = ?FILE_MODULE:close(Fd5),
+ {ok, Fd5} = ?FILE_MODULE:open(File, [raw, read, write, read_ahead]),
+ ok = ?FILE_MODULE:truncate(Fd5),
+ ok = ?FILE_MODULE:write(Fd5, [Data1,Data1|Data3]),
+ {ok, 0} = ?FILE_MODULE:position(Fd5, bof),
+ {ok, Data1} = ?FILE_MODULE:read(Fd5, Size),
+ ok = ?FILE_MODULE:write(Fd5, Data2),
+ {ok, 0} = ?FILE_MODULE:position(Fd5, bof),
+ Data1Data2Data3 = Data1++Data2++Data3,
+ {ok, Data1Data2Data3} = ?FILE_MODULE:read(Fd5, 3*Size+1),
+ ok = ?FILE_MODULE:close(Fd5),
%%
- ?line [] = flush(),
- ?line ?t:timetrap_cancel(Dog),
+ [] = flush(),
ok.
@@ -3318,137 +3097,131 @@ read_ahead(Config) when is_list(Config) ->
-segment_read(suite) ->
- [];
-segment_read(doc) ->
- ["Tests the segmenting of large reads"];
+%% Tests the segmenting of large reads.
segment_read(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(60)),
- %%
- ?line Name = filename:join(?config(priv_dir, Config),
- ?MODULE_STRING ++ "_segment_read"),
- ?line SegSize = 256*1024,
- ?line SegCnt = SegSize div 4,
- ?line Cnt = 4 * SegCnt,
- ?line ok = create_file(Name, Cnt),
+ Name = filename:join(proplists:get_value(priv_dir, Config),
+ ?MODULE_STRING ++ "_segment_read"),
+ SegSize = 256*1024,
+ SegCnt = SegSize div 4,
+ Cnt = 4 * SegCnt,
+ ok = create_file(Name, Cnt),
%%
%% read_file/1
%%
- ?line {ok, Bin} = ?FILE_MODULE:read_file(Name),
- ?line true = verify_bin(Bin, 0, Cnt),
+ {ok, Bin} = ?FILE_MODULE:read_file(Name),
+ true = verify_bin(Bin, 0, Cnt),
%%
%% read/2
%%
%% Not segmented
- ?line {ok, FD1} = ?FILE_MODULE:open(Name, [read, raw, binary]),
- ?line {ok, B1a} = ?FILE_MODULE:read(FD1, SegSize),
- ?line {ok, B1b} = ?FILE_MODULE:read(FD1, SegSize),
- ?line {ok, B1c} = ?FILE_MODULE:read(FD1, SegSize),
- ?line {ok, B1d} = ?FILE_MODULE:read(FD1, SegSize),
- ?line ok = ?FILE_MODULE:close(FD1),
- ?line true = verify_bin(B1a, 0*SegCnt, SegCnt),
- ?line true = verify_bin(B1b, 1*SegCnt, SegCnt),
- ?line true = verify_bin(B1c, 2*SegCnt, SegCnt),
- ?line true = verify_bin(B1d, 3*SegCnt, SegCnt),
+ {ok, FD1} = ?FILE_MODULE:open(Name, [read, raw, binary]),
+ {ok, B1a} = ?FILE_MODULE:read(FD1, SegSize),
+ {ok, B1b} = ?FILE_MODULE:read(FD1, SegSize),
+ {ok, B1c} = ?FILE_MODULE:read(FD1, SegSize),
+ {ok, B1d} = ?FILE_MODULE:read(FD1, SegSize),
+ ok = ?FILE_MODULE:close(FD1),
+ true = verify_bin(B1a, 0*SegCnt, SegCnt),
+ true = verify_bin(B1b, 1*SegCnt, SegCnt),
+ true = verify_bin(B1c, 2*SegCnt, SegCnt),
+ true = verify_bin(B1d, 3*SegCnt, SegCnt),
%%
%% Segmented
- ?line {ok, FD2} = ?FILE_MODULE:open(Name, [read, raw, binary]),
- ?line {ok, B2a} = ?FILE_MODULE:read(FD2, 1*SegSize),
- ?line {ok, B2b} = ?FILE_MODULE:read(FD2, 2*SegSize),
- ?line {ok, B2c} = ?FILE_MODULE:read(FD2, 2*SegSize),
- ?line ok = ?FILE_MODULE:close(FD2),
- ?line true = verify_bin(B2a, 0*SegCnt, 1*SegCnt),
- ?line true = verify_bin(B2b, 1*SegCnt, 2*SegCnt),
- ?line true = verify_bin(B2c, 3*SegCnt, 1*SegCnt),
+ {ok, FD2} = ?FILE_MODULE:open(Name, [read, raw, binary]),
+ {ok, B2a} = ?FILE_MODULE:read(FD2, 1*SegSize),
+ {ok, B2b} = ?FILE_MODULE:read(FD2, 2*SegSize),
+ {ok, B2c} = ?FILE_MODULE:read(FD2, 2*SegSize),
+ ok = ?FILE_MODULE:close(FD2),
+ true = verify_bin(B2a, 0*SegCnt, 1*SegCnt),
+ true = verify_bin(B2b, 1*SegCnt, 2*SegCnt),
+ true = verify_bin(B2c, 3*SegCnt, 1*SegCnt),
%%
%% pread/3
%%
- ?line {ok, FD3} = ?FILE_MODULE:open(Name, [read, raw, binary]),
+ {ok, FD3} = ?FILE_MODULE:open(Name, [read, raw, binary]),
%%
%% Not segmented
- ?line {ok, B3d} = ?FILE_MODULE:pread(FD3, 3*SegSize, SegSize),
- ?line {ok, B3c} = ?FILE_MODULE:pread(FD3, 2*SegSize, SegSize),
- ?line {ok, B3b} = ?FILE_MODULE:pread(FD3, 1*SegSize, SegSize),
- ?line {ok, B3a} = ?FILE_MODULE:pread(FD3, 0*SegSize, SegSize),
- ?line true = verify_bin(B3a, 0*SegCnt, SegCnt),
- ?line true = verify_bin(B3b, 1*SegCnt, SegCnt),
- ?line true = verify_bin(B3c, 2*SegCnt, SegCnt),
- ?line true = verify_bin(B3d, 3*SegCnt, SegCnt),
+ {ok, B3d} = ?FILE_MODULE:pread(FD3, 3*SegSize, SegSize),
+ {ok, B3c} = ?FILE_MODULE:pread(FD3, 2*SegSize, SegSize),
+ {ok, B3b} = ?FILE_MODULE:pread(FD3, 1*SegSize, SegSize),
+ {ok, B3a} = ?FILE_MODULE:pread(FD3, 0*SegSize, SegSize),
+ true = verify_bin(B3a, 0*SegCnt, SegCnt),
+ true = verify_bin(B3b, 1*SegCnt, SegCnt),
+ true = verify_bin(B3c, 2*SegCnt, SegCnt),
+ true = verify_bin(B3d, 3*SegCnt, SegCnt),
%%
%% Segmented
- ?line {ok, B3g} = ?FILE_MODULE:pread(FD3, 3*SegSize, 2*SegSize),
- ?line {ok, B3f} = ?FILE_MODULE:pread(FD3, 1*SegSize, 2*SegSize),
- ?line {ok, B3e} = ?FILE_MODULE:pread(FD3, 0*SegSize, 1*SegSize),
- ?line true = verify_bin(B3e, 0*SegCnt, 1*SegCnt),
- ?line true = verify_bin(B3f, 1*SegCnt, 2*SegCnt),
- ?line true = verify_bin(B3g, 3*SegCnt, 1*SegCnt),
+ {ok, B3g} = ?FILE_MODULE:pread(FD3, 3*SegSize, 2*SegSize),
+ {ok, B3f} = ?FILE_MODULE:pread(FD3, 1*SegSize, 2*SegSize),
+ {ok, B3e} = ?FILE_MODULE:pread(FD3, 0*SegSize, 1*SegSize),
+ true = verify_bin(B3e, 0*SegCnt, 1*SegCnt),
+ true = verify_bin(B3f, 1*SegCnt, 2*SegCnt),
+ true = verify_bin(B3g, 3*SegCnt, 1*SegCnt),
%%
- ?line ok = ?FILE_MODULE:close(FD3),
+ ok = ?FILE_MODULE:close(FD3),
%%
%% pread/2
%%
- ?line {ok, FD5} = ?FILE_MODULE:open(Name, [read, raw, binary]),
+ {ok, FD5} = ?FILE_MODULE:open(Name, [read, raw, binary]),
%%
%% +---+---+---+---+
%% | 4 | 3 | 2 | 1 |
%% +---+---+---+---+
%% < ^ >
- ?line {ok, [B5d, B5c, B5b, B5a]} =
+ {ok, [B5d, B5c, B5b, B5a]} =
?FILE_MODULE:pread(FD5, [{3*SegSize, SegSize},
{2*SegSize, SegSize},
{1*SegSize, SegSize},
{0*SegSize, SegSize}]),
- ?line true = verify_bin(B5a, 0*SegCnt, SegCnt),
- ?line true = verify_bin(B5b, 1*SegCnt, SegCnt),
- ?line true = verify_bin(B5c, 2*SegCnt, SegCnt),
- ?line true = verify_bin(B5d, 3*SegCnt, SegCnt),
+ true = verify_bin(B5a, 0*SegCnt, SegCnt),
+ true = verify_bin(B5b, 1*SegCnt, SegCnt),
+ true = verify_bin(B5c, 2*SegCnt, SegCnt),
+ true = verify_bin(B5d, 3*SegCnt, SegCnt),
%%
%% +---+-------+-------+
%% | 3 | 2 | 1 |
%% +---+-------+-------+
%% < ^ ^ >
- ?line {ok, [B5g, B5f, B5e]} =
+ {ok, [B5g, B5f, B5e]} =
?FILE_MODULE:pread(FD5, [{3*SegSize, 2*SegSize},
{1*SegSize, 2*SegSize},
{0*SegSize, 1*SegSize}]),
- ?line true = verify_bin(B5e, 0*SegCnt, 1*SegCnt),
- ?line true = verify_bin(B5f, 1*SegCnt, 2*SegCnt),
- ?line true = verify_bin(B5g, 3*SegCnt, 1*SegCnt),
+ true = verify_bin(B5e, 0*SegCnt, 1*SegCnt),
+ true = verify_bin(B5f, 1*SegCnt, 2*SegCnt),
+ true = verify_bin(B5g, 3*SegCnt, 1*SegCnt),
%%
%%
%% +-------+-----------+
%% | 2 | 1 |
%% +-------+-----------+
%% < ^ ^ >
- ?line {ok, [B5i, B5h]} =
+ {ok, [B5i, B5h]} =
?FILE_MODULE:pread(FD5, [{2*SegSize, 3*SegSize},
{0*SegSize, 2*SegSize}]),
- ?line true = verify_bin(B5h, 0*SegCnt, 2*SegCnt),
- ?line true = verify_bin(B5i, 2*SegCnt, 2*SegCnt),
+ true = verify_bin(B5h, 0*SegCnt, 2*SegCnt),
+ true = verify_bin(B5i, 2*SegCnt, 2*SegCnt),
%%
%% +-------+---+---+
%% | 3 | 2 | 1 |
%% +-------+---+---+
%% < ^ ^ >
- ?line {ok, [B5l, B5k, B5j]} =
+ {ok, [B5l, B5k, B5j]} =
?FILE_MODULE:pread(FD5, [{3*SegSize, 1*SegSize},
{2*SegSize, 1*SegSize},
{0*SegSize, 2*SegSize}]),
- ?line true = verify_bin(B5j, 0*SegCnt, 2*SegCnt),
- ?line true = verify_bin(B5k, 2*SegCnt, 1*SegCnt),
- ?line true = verify_bin(B5l, 3*SegCnt, 1*SegCnt),
+ true = verify_bin(B5j, 0*SegCnt, 2*SegCnt),
+ true = verify_bin(B5k, 2*SegCnt, 1*SegCnt),
+ true = verify_bin(B5l, 3*SegCnt, 1*SegCnt),
%%
%% Real time response time test.
%%
Req = lists:flatten(lists:duplicate(17,
[{2*SegSize, 2*SegSize},
{0*SegSize, 2*SegSize}])),
- ?line {{ok, _}, Comment} =
+ {{ok, _}, Comment} =
response_analysis(?FILE_MODULE, pread, [FD5, Req]),
- ?line ok = ?FILE_MODULE:close(FD5),
+ ok = ?FILE_MODULE:close(FD5),
%%
- ?line [] = flush(),
- ?line ?t:timetrap_cancel(Dog),
+ [] = flush(),
{comment, Comment}.
@@ -3457,100 +3230,95 @@ segment_read(Config) when is_list(Config) ->
-segment_write(suite) ->
- [];
-segment_write(doc) ->
- ["Tests the segmenting of large writes"];
+%% Tests the segmenting of large writes.
segment_write(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(60)),
- %%
- ?line Name = filename:join(?config(priv_dir, Config),
- ?MODULE_STRING ++ "_segment_write"),
- ?line SegSize = 256*1024,
- ?line SegCnt = SegSize div 4,
- ?line Cnt = 4 * SegCnt,
- ?line Bin = create_bin(0, Cnt),
+ Name = filename:join(proplists:get_value(priv_dir, Config),
+ ?MODULE_STRING ++ "_segment_write"),
+ SegSize = 256*1024,
+ SegCnt = SegSize div 4,
+ Cnt = 4 * SegCnt,
+ Bin = create_bin(0, Cnt),
%%
%% write/2
%%
%% Not segmented
- ?line {ok, FD1} = ?FILE_MODULE:open(Name, [write, raw, binary]),
- ?line ok = ?FILE_MODULE:write(FD1, subbin(Bin, 0*SegSize, 1*SegSize)),
- ?line ok = ?FILE_MODULE:write(FD1, subbin(Bin, 1*SegSize, 1*SegSize)),
- ?line ok = ?FILE_MODULE:write(FD1, subbin(Bin, 2*SegSize, 1*SegSize)),
- ?line ok = ?FILE_MODULE:write(FD1, subbin(Bin, 3*SegSize, 1*SegSize)),
- ?line ok = ?FILE_MODULE:close(FD1),
- ?line true = verify_file(Name, Cnt),
+ {ok, FD1} = ?FILE_MODULE:open(Name, [write, raw, binary]),
+ ok = ?FILE_MODULE:write(FD1, subbin(Bin, 0*SegSize, 1*SegSize)),
+ ok = ?FILE_MODULE:write(FD1, subbin(Bin, 1*SegSize, 1*SegSize)),
+ ok = ?FILE_MODULE:write(FD1, subbin(Bin, 2*SegSize, 1*SegSize)),
+ ok = ?FILE_MODULE:write(FD1, subbin(Bin, 3*SegSize, 1*SegSize)),
+ ok = ?FILE_MODULE:close(FD1),
+ true = verify_file(Name, Cnt),
%%
%% Segmented
- ?line {ok, FD2} = ?FILE_MODULE:open(Name, [write, raw, binary]),
- ?line ok = ?FILE_MODULE:write(FD2, subbin(Bin, 0*SegSize, 1*SegSize)),
- ?line ok = ?FILE_MODULE:write(FD2, subbin(Bin, 1*SegSize, 2*SegSize)),
- ?line ok = ?FILE_MODULE:write(FD2, subbin(Bin, 3*SegSize, 1*SegSize)),
- ?line ok = ?FILE_MODULE:close(FD2),
- ?line true = verify_file(Name, Cnt),
+ {ok, FD2} = ?FILE_MODULE:open(Name, [write, raw, binary]),
+ ok = ?FILE_MODULE:write(FD2, subbin(Bin, 0*SegSize, 1*SegSize)),
+ ok = ?FILE_MODULE:write(FD2, subbin(Bin, 1*SegSize, 2*SegSize)),
+ ok = ?FILE_MODULE:write(FD2, subbin(Bin, 3*SegSize, 1*SegSize)),
+ ok = ?FILE_MODULE:close(FD2),
+ true = verify_file(Name, Cnt),
%%
%% +---+---+---+---+
%% | | | | |
%% +---+---+---+---+
%% < ^ >
- ?line ok = write_file(Name, [subbin(Bin, 0*SegSize, 1*SegSize),
- subbin(Bin, 1*SegSize, 1*SegSize),
- subbin(Bin, 2*SegSize, 1*SegSize),
- subbin(Bin, 3*SegSize, 1*SegSize)]),
- ?line true = verify_file(Name, Cnt),
+ ok = write_file(Name, [subbin(Bin, 0*SegSize, 1*SegSize),
+ subbin(Bin, 1*SegSize, 1*SegSize),
+ subbin(Bin, 2*SegSize, 1*SegSize),
+ subbin(Bin, 3*SegSize, 1*SegSize)]),
+ true = verify_file(Name, Cnt),
%%
%% +---+-------+---+
%% | | | |
%% +---+-------+---+
%% < ^ ^ >
- ?line ok = write_file(Name, [subbin(Bin, 0*SegSize, 1*SegSize),
- subbin(Bin, 1*SegSize, 2*SegSize),
- subbin(Bin, 3*SegSize, 1*SegSize)]),
- ?line true = verify_file(Name, Cnt),
+ ok = write_file(Name, [subbin(Bin, 0*SegSize, 1*SegSize),
+ subbin(Bin, 1*SegSize, 2*SegSize),
+ subbin(Bin, 3*SegSize, 1*SegSize)]),
+ true = verify_file(Name, Cnt),
%%
%% +-------+-------+
%% | | |
%% +-------+-------+
%% < ^ ^ >
- ?line ok = write_file(Name, [subbin(Bin, 0*SegSize, 2*SegSize),
- subbin(Bin, 2*SegSize, 2*SegSize)]),
- ?line true = verify_file(Name, Cnt),
+ ok = write_file(Name, [subbin(Bin, 0*SegSize, 2*SegSize),
+ subbin(Bin, 2*SegSize, 2*SegSize)]),
+ true = verify_file(Name, Cnt),
%%
%% +-------+---+---+
%% | | | |
%% +-------+---+---+
%% < ^ ^ >
- ?line ok = write_file(Name, [subbin(Bin, 0*SegSize, 2*SegSize),
- subbin(Bin, 2*SegSize, 1*SegSize),
- subbin(Bin, 3*SegSize, 1*SegSize)]),
- ?line true = verify_file(Name, Cnt),
+ ok = write_file(Name, [subbin(Bin, 0*SegSize, 2*SegSize),
+ subbin(Bin, 2*SegSize, 1*SegSize),
+ subbin(Bin, 3*SegSize, 1*SegSize)]),
+ true = verify_file(Name, Cnt),
%%
%% pwrite/3
%%
%% Not segmented
- ?line {ok, FD3} = ?FILE_MODULE:open(Name, [write, raw, binary]),
- ?line ok = ?FILE_MODULE:pwrite(FD3, 3*SegSize,
- subbin(Bin, 3*SegSize, 1*SegSize)),
- ?line ok = ?FILE_MODULE:pwrite(FD3, 2*SegSize,
- subbin(Bin, 2*SegSize, 1*SegSize)),
- ?line ok = ?FILE_MODULE:pwrite(FD3, 1*SegSize,
- subbin(Bin, 1*SegSize, 1*SegSize)),
- ?line ok = ?FILE_MODULE:pwrite(FD3, 0*SegSize,
- subbin(Bin, 0*SegSize, 1*SegSize)),
- ?line ok = ?FILE_MODULE:close(FD3),
- ?line true = verify_file(Name, Cnt),
+ {ok, FD3} = ?FILE_MODULE:open(Name, [write, raw, binary]),
+ ok = ?FILE_MODULE:pwrite(FD3, 3*SegSize,
+ subbin(Bin, 3*SegSize, 1*SegSize)),
+ ok = ?FILE_MODULE:pwrite(FD3, 2*SegSize,
+ subbin(Bin, 2*SegSize, 1*SegSize)),
+ ok = ?FILE_MODULE:pwrite(FD3, 1*SegSize,
+ subbin(Bin, 1*SegSize, 1*SegSize)),
+ ok = ?FILE_MODULE:pwrite(FD3, 0*SegSize,
+ subbin(Bin, 0*SegSize, 1*SegSize)),
+ ok = ?FILE_MODULE:close(FD3),
+ true = verify_file(Name, Cnt),
%%
%% Segmented
- ?line {ok, FD4} = ?FILE_MODULE:open(Name, [write, raw, binary]),
- ?line ok = ?FILE_MODULE:pwrite(FD4, 3*SegSize,
- subbin(Bin, 3*SegSize, 1*SegSize)),
- ?line ok = ?FILE_MODULE:pwrite(FD4, 1*SegSize,
- subbin(Bin, 1*SegSize, 2*SegSize)),
- ?line ok = ?FILE_MODULE:pwrite(FD4, 0*SegSize,
- subbin(Bin, 0*SegSize, 1*SegSize)),
- ?line ok = ?FILE_MODULE:close(FD4),
- ?line true = verify_file(Name, Cnt),
+ {ok, FD4} = ?FILE_MODULE:open(Name, [write, raw, binary]),
+ ok = ?FILE_MODULE:pwrite(FD4, 3*SegSize,
+ subbin(Bin, 3*SegSize, 1*SegSize)),
+ ok = ?FILE_MODULE:pwrite(FD4, 1*SegSize,
+ subbin(Bin, 1*SegSize, 2*SegSize)),
+ ok = ?FILE_MODULE:pwrite(FD4, 0*SegSize,
+ subbin(Bin, 0*SegSize, 1*SegSize)),
+ ok = ?FILE_MODULE:close(FD4),
+ true = verify_file(Name, Cnt),
@@ -3558,125 +3326,118 @@ segment_write(Config) when is_list(Config) ->
%% pwrite/2
%%
%% Not segmented
- ?line {ok, FD5} = ?FILE_MODULE:open(Name, [write, raw, binary]),
- ?line ok = ?FILE_MODULE:pwrite(FD5, [{3*SegSize,
- subbin(Bin, 3*SegSize, 1*SegSize)}]),
- ?line ok = ?FILE_MODULE:pwrite(FD5, [{2*SegSize,
- subbin(Bin, 2*SegSize, 1*SegSize)}]),
- ?line ok = ?FILE_MODULE:pwrite(FD5, [{1*SegSize,
- subbin(Bin, 1*SegSize, 1*SegSize)}]),
- ?line ok = ?FILE_MODULE:pwrite(FD5, [{0*SegSize,
- subbin(Bin, 0*SegSize, 1*SegSize)}]),
- ?line ok = ?FILE_MODULE:close(FD5),
- ?line true = verify_file(Name, Cnt),
+ {ok, FD5} = ?FILE_MODULE:open(Name, [write, raw, binary]),
+ ok = ?FILE_MODULE:pwrite(FD5, [{3*SegSize,
+ subbin(Bin, 3*SegSize, 1*SegSize)}]),
+ ok = ?FILE_MODULE:pwrite(FD5, [{2*SegSize,
+ subbin(Bin, 2*SegSize, 1*SegSize)}]),
+ ok = ?FILE_MODULE:pwrite(FD5, [{1*SegSize,
+ subbin(Bin, 1*SegSize, 1*SegSize)}]),
+ ok = ?FILE_MODULE:pwrite(FD5, [{0*SegSize,
+ subbin(Bin, 0*SegSize, 1*SegSize)}]),
+ ok = ?FILE_MODULE:close(FD5),
+ true = verify_file(Name, Cnt),
%%
%% Segmented
- ?line {ok, FD6} = ?FILE_MODULE:open(Name, [write, raw, binary]),
- ?line ok = ?FILE_MODULE:pwrite(FD6, [{3*SegSize,
- subbin(Bin, 3*SegSize, 1*SegSize)}]),
- ?line ok = ?FILE_MODULE:pwrite(FD6, [{1*SegSize,
- subbin(Bin, 1*SegSize, 2*SegSize)}]),
- ?line ok = ?FILE_MODULE:pwrite(FD6, [{0*SegSize,
- subbin(Bin, 0*SegSize, 1*SegSize)}]),
- ?line ok = ?FILE_MODULE:close(FD6),
- ?line true = verify_file(Name, Cnt),
+ {ok, FD6} = ?FILE_MODULE:open(Name, [write, raw, binary]),
+ ok = ?FILE_MODULE:pwrite(FD6, [{3*SegSize,
+ subbin(Bin, 3*SegSize, 1*SegSize)}]),
+ ok = ?FILE_MODULE:pwrite(FD6, [{1*SegSize,
+ subbin(Bin, 1*SegSize, 2*SegSize)}]),
+ ok = ?FILE_MODULE:pwrite(FD6, [{0*SegSize,
+ subbin(Bin, 0*SegSize, 1*SegSize)}]),
+ ok = ?FILE_MODULE:close(FD6),
+ true = verify_file(Name, Cnt),
%%
%% +---+---+---+---+
%% | 4 | 3 | 2 | 1 |
%% +---+---+---+---+
%% < ^ >
- ?line ok = pwrite_file(Name, [{3*SegSize,
- subbin(Bin, 3*SegSize, 1*SegSize)},
- {2*SegSize,
- subbin(Bin, 2*SegSize, 1*SegSize)},
- {1*SegSize,
- subbin(Bin, 1*SegSize, 1*SegSize)},
- {0*SegSize,
- subbin(Bin, 0*SegSize, 1*SegSize)}]),
- ?line true = verify_file(Name, Cnt),
+ ok = pwrite_file(Name, [{3*SegSize,
+ subbin(Bin, 3*SegSize, 1*SegSize)},
+ {2*SegSize,
+ subbin(Bin, 2*SegSize, 1*SegSize)},
+ {1*SegSize,
+ subbin(Bin, 1*SegSize, 1*SegSize)},
+ {0*SegSize,
+ subbin(Bin, 0*SegSize, 1*SegSize)}]),
+ true = verify_file(Name, Cnt),
%%
%% +---+-------+---+
%% | 3 | 2 | 1 |
%% +---+-------+---+
%% < ^ ^ >
- ?line ok = pwrite_file(Name, [{3*SegSize,
- subbin(Bin, 3*SegSize, 1*SegSize)},
- {1*SegSize,
- subbin(Bin, 1*SegSize, 2*SegSize)},
- {0*SegSize,
- subbin(Bin, 0*SegSize, 1*SegSize)}]),
- ?line true = verify_file(Name, Cnt),
+ ok = pwrite_file(Name, [{3*SegSize,
+ subbin(Bin, 3*SegSize, 1*SegSize)},
+ {1*SegSize,
+ subbin(Bin, 1*SegSize, 2*SegSize)},
+ {0*SegSize,
+ subbin(Bin, 0*SegSize, 1*SegSize)}]),
+ true = verify_file(Name, Cnt),
%%
%% +-------+-------+
%% | 2 | 1 |
%% +-------+-------+
%% < ^ ^ >
- ?line ok = pwrite_file(Name, [{2*SegSize,
- subbin(Bin, 2*SegSize, 2*SegSize)},
- {0*SegSize,
- subbin(Bin, 0*SegSize, 2*SegSize)}]),
- ?line true = verify_file(Name, Cnt),
+ ok = pwrite_file(Name, [{2*SegSize,
+ subbin(Bin, 2*SegSize, 2*SegSize)},
+ {0*SegSize,
+ subbin(Bin, 0*SegSize, 2*SegSize)}]),
+ true = verify_file(Name, Cnt),
%%
%% +-------+---+---+
%% | 3 | 2 | 1 |
%% +-------+---+---+
%% < ^ ^ >
- ?line ok = pwrite_file(Name, [{3*SegSize,
- subbin(Bin, 3*SegSize, 1*SegSize)},
- {2*SegSize,
- subbin(Bin, 2*SegSize, 1*SegSize)},
- {0*SegSize,
- subbin(Bin, 0*SegSize, 2*SegSize)}]),
- ?line true = verify_file(Name, Cnt),
+ ok = pwrite_file(Name, [{3*SegSize,
+ subbin(Bin, 3*SegSize, 1*SegSize)},
+ {2*SegSize,
+ subbin(Bin, 2*SegSize, 1*SegSize)},
+ {0*SegSize,
+ subbin(Bin, 0*SegSize, 2*SegSize)}]),
+ true = verify_file(Name, Cnt),
%%
%% Real time response time test.
%%
- ?line {ok, FD7} = ?FILE_MODULE:open(Name, [write, raw, binary]),
+ {ok, FD7} = ?FILE_MODULE:open(Name, [write, raw, binary]),
Req = lists:flatten(lists:duplicate(17,
[{2*SegSize,
subbin(Bin, 2*SegSize, 2*SegSize)},
- {0*SegSize,
- subbin(Bin, 0*SegSize, 2*SegSize)}])),
- ?line {ok, Comment} =
+ {0*SegSize,
+ subbin(Bin, 0*SegSize, 2*SegSize)}])),
+ {ok, Comment} =
response_analysis(?FILE_MODULE, pwrite, [FD7, Req]),
- ?line ok = ?FILE_MODULE:close(FD7),
+ ok = ?FILE_MODULE:close(FD7),
%%
- ?line [] = flush(),
- ?line ?t:timetrap_cancel(Dog),
+ [] = flush(),
{comment, Comment}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-ipread(suite) ->
- [];
-ipread(doc) ->
- ["Test Dets special indirect pread"];
+%% Test Dets special indirect pread.
ipread(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(30)),
+ Dir = proplists:get_value(priv_dir, Config),
+ ok = ipread_int(Dir, [raw, binary]),
+ ok = ipread_int(Dir, [raw]),
+ ok = ipread_int(Dir, [binary]),
+ ok = ipread_int(Dir, []),
+ ok = ipread_int(Dir, [ram, binary]),
+ ok = ipread_int(Dir, [ram]),
%%
- ?line Dir = ?config(priv_dir, Config),
- ?line ok = ipread_int(Dir, [raw, binary]),
- ?line ok = ipread_int(Dir, [raw]),
- ?line ok = ipread_int(Dir, [binary]),
- ?line ok = ipread_int(Dir, []),
- ?line ok = ipread_int(Dir, [ram, binary]),
- ?line ok = ipread_int(Dir, [ram]),
- %%
- ?line [] = flush(),
- ?line ?t:timetrap_cancel(Dog),
+ [] = flush(),
ok.
ipread_int(Dir, ModeList) ->
- ?line Name =
+ Name =
filename:join(Dir,
lists:flatten([?MODULE_STRING, "_ipread",
- lists:map(fun (X) ->
- ["_", atom_to_list(X)]
- end,
- ModeList)])),
- ?line io:format("ipread_int<~p, ~p>~n", [Name, ModeList]),
- ?line {Conv, Sizeof} =
+ lists:map(fun (X) ->
+ ["_", atom_to_list(X)]
+ end,
+ ModeList)])),
+ io:format("ipread_int<~p, ~p>~n", [Name, ModeList]),
+ {Conv, Sizeof} =
case lists:member(binary, ModeList) of
true ->
{fun (Bin) when is_binary(Bin) -> Bin;
@@ -3689,144 +3450,130 @@ ipread_int(Dir, ModeList) ->
end,
fun erlang:length/1}
end,
- ?line Pos = 4711,
- ?line Data = Conv("THE QUICK BROWN FOX JUMPS OVER A LAZY DOG"),
- ?line Size = Sizeof(Data),
- ?line Init = Conv(" "),
- ?line SizeInit = Sizeof(Init),
- ?line Head = Conv(<<Size:32/big-unsigned, Pos:32/big-unsigned>>),
- ?line Filler = Conv(bytes($ , Pos-SizeInit-Sizeof(Head))),
- ?line Size1 = Size+1,
- ?line SizePos = Size+Pos,
+ Pos = 4711,
+ Data = Conv("THE QUICK BROWN FOX JUMPS OVER A LAZY DOG"),
+ Size = Sizeof(Data),
+ Init = Conv(" "),
+ SizeInit = Sizeof(Init),
+ Head = Conv(<<Size:32/big-unsigned, Pos:32/big-unsigned>>),
+ Filler = Conv(bytes($ , Pos-SizeInit-Sizeof(Head))),
+ Size1 = Size+1,
+ SizePos = Size+Pos,
%%
- ?line {ok, FD} = ?FILE_MODULE:open(Name, [write, read | ModeList]),
- ?line ok = ?FILE_MODULE:truncate(FD),
- ?line ok = ?FILE_MODULE:write(FD, Init),
- ?line ok = ?FILE_MODULE:write(FD, Head),
- ?line ok = ?FILE_MODULE:write(FD, Filler),
- ?line ok = ?FILE_MODULE:write(FD, Data),
+ {ok, FD} = ?FILE_MODULE:open(Name, [write, read | ModeList]),
+ ok = ?FILE_MODULE:truncate(FD),
+ ok = ?FILE_MODULE:write(FD, Init),
+ ok = ?FILE_MODULE:write(FD, Head),
+ ok = ?FILE_MODULE:write(FD, Filler),
+ ok = ?FILE_MODULE:write(FD, Data),
%% Correct read
- ?line {ok, {Size, Pos, Data}} =
+ {ok, {Size, Pos, Data}} =
?FILE_MODULE:ipread_s32bu_p32bu(FD, SizeInit, infinity),
%% Invalid header - size > max
- ?line eof =
+ eof =
?FILE_MODULE:ipread_s32bu_p32bu(FD, SizeInit, Size-1),
%% Data block protudes over eof
- ?line ok =
+ ok =
?FILE_MODULE:pwrite(FD, SizeInit,
<<Size1:32/big-unsigned,
- Pos:32/big-unsigned>>),
- ?line {ok, {Size1, Pos, Data}} =
+ Pos:32/big-unsigned>>),
+ {ok, {Size1, Pos, Data}} =
?FILE_MODULE:ipread_s32bu_p32bu(FD, SizeInit, Size1),
%% Data block outside file
- ?line ok =
+ ok =
?FILE_MODULE:pwrite(FD, SizeInit,
<<Size:32/big-unsigned,
- SizePos:32/big-unsigned>>),
- ?line {ok, {Size, SizePos, eof}} =
+ SizePos:32/big-unsigned>>),
+ {ok, {Size, SizePos, eof}} =
?FILE_MODULE:ipread_s32bu_p32bu(FD, SizeInit, Size),
%% Zero size
- ?line ok =
+ ok =
?FILE_MODULE:pwrite(FD, SizeInit,
<<0:32/big-unsigned,
- Pos:32/big-unsigned>>),
- ?line {ok, {0, Pos, eof}} =
+ Pos:32/big-unsigned>>),
+ {ok, {0, Pos, eof}} =
?FILE_MODULE:ipread_s32bu_p32bu(FD, SizeInit, Size),
%% Invalid header - protudes over eof
- ?line eof =
+ eof =
?FILE_MODULE:ipread_s32bu_p32bu(FD,
Pos+Size-(Sizeof(Head)-1),
infinity),
%% Header not even in file
- ?line eof =
+ eof =
?FILE_MODULE:ipread_s32bu_p32bu(FD, Pos+Size, infinity),
%%
- ?line ok = ?FILE_MODULE:close(FD),
+ ok = ?FILE_MODULE:close(FD),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-interleaved_read_write(suite) ->
- [];
-interleaved_read_write(doc) ->
- ["Tests interleaved read and writes"];
+%% Tests interleaved read and writes.
interleaved_read_write(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(30)),
- %%
- ?line Dir = ?config(priv_dir, Config),
- ?line File =
+ Dir = proplists:get_value(priv_dir, Config),
+ File =
filename:join(Dir, ?MODULE_STRING++"interleaved_read_write.txt"),
- ?line {ok,F1} = ?FILE_MODULE:open(File, [write]),
- ?line ok = ?FILE_MODULE:write(F1, "data---r1."), % 10 chars each
- ?line ok = ?FILE_MODULE:write(F1, "data---r2."),
- ?line ok = ?FILE_MODULE:write(F1, "data---r3."),
- ?line ok = ?FILE_MODULE:close(F1),
- ?line {ok,F2} = ?FILE_MODULE:open(File, [read, write]),
- ?line {ok, "data---r1."} = ?FILE_MODULE:read(F2, 10),
- ?line ok = ?FILE_MODULE:write(F2, "data---w2."),
- ?line ok = ?FILE_MODULE:close(F2),
- ?line {ok,F3} = ?FILE_MODULE:open(File, [read]),
- ?line {ok, "data---r1."} = ?FILE_MODULE:read(F3, 10),
- ?line {ok, "data---w2."} = ?FILE_MODULE:read(F3, 10),
- ?line {ok, "data---r3."} = ?FILE_MODULE:read(F3, 10),
- ?line eof = ?FILE_MODULE:read(F3, 1),
- ?line ok = ?FILE_MODULE:close(F2),
+ {ok,F1} = ?FILE_MODULE:open(File, [write]),
+ ok = ?FILE_MODULE:write(F1, "data---r1."), % 10 chars each
+ ok = ?FILE_MODULE:write(F1, "data---r2."),
+ ok = ?FILE_MODULE:write(F1, "data---r3."),
+ ok = ?FILE_MODULE:close(F1),
+ {ok,F2} = ?FILE_MODULE:open(File, [read, write]),
+ {ok, "data---r1."} = ?FILE_MODULE:read(F2, 10),
+ ok = ?FILE_MODULE:write(F2, "data---w2."),
+ ok = ?FILE_MODULE:close(F2),
+ {ok,F3} = ?FILE_MODULE:open(File, [read]),
+ {ok, "data---r1."} = ?FILE_MODULE:read(F3, 10),
+ {ok, "data---w2."} = ?FILE_MODULE:read(F3, 10),
+ {ok, "data---r3."} = ?FILE_MODULE:read(F3, 10),
+ eof = ?FILE_MODULE:read(F3, 1),
+ ok = ?FILE_MODULE:close(F2),
%%
- ?line [] = flush(),
- ?line ?t:timetrap_cancel(Dog),
+ [] = flush(),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-otp_5814(suite) ->
- [];
-otp_5814(doc) ->
- ["OTP-5814. eval/consult/script return correct line numbers"];
+%% OTP-5814. eval/consult/script return correct line numbers.
otp_5814(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(10)),
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
File = filename:join(PrivDir, "otp_5814"),
Path = [PrivDir],
- ?line ok = file:write_file(File, <<"{a,b,c}.
+ ok = file:write_file(File, <<"{a,b,c}.
a.
- b.
- c.
- {d,e,
- [}.">>),
- ?line {error, {6,erl_parse,_}} = file:eval(File),
- ?line {error, {6,erl_parse,_}} = file:consult(File),
- ?line {error, {6,erl_parse,_}} = file:path_consult(Path, File),
- ?line {error, {6,erl_parse,_}} = file:path_eval(Path, File),
- ?line {error, {6,erl_parse,_}} = file:script(File),
- ?line {error, {6,erl_parse,_}} = file:path_script(Path, File),
-
- ?line ok = file:write_file(File, <<>>),
- ?line {error, {1,file,undefined_script}} = file:path_script(Path, File),
+b.
+c.
+{d,e,
+ [}.">>),
+ {error, {6,erl_parse,_}} = file:eval(File),
+ {error, {6,erl_parse,_}} = file:consult(File),
+ {error, {6,erl_parse,_}} = file:path_consult(Path, File),
+ {error, {6,erl_parse,_}} = file:path_eval(Path, File),
+ {error, {6,erl_parse,_}} = file:script(File),
+ {error, {6,erl_parse,_}} = file:path_script(Path, File),
+
+ ok = file:write_file(File, <<>>),
+ {error, {1,file,undefined_script}} = file:path_script(Path, File),
%% The error is not propagated...
- ?line ok = file:write_file(File, <<"a.
+ ok = file:write_file(File, <<"a.
b.
- 1/0.">>),
- ?line {error, {3, file, {error, badarith, _}}} = file:eval(File),
-
- ?line ok = file:write_file(File, <<"erlang:raise(throw, apa, []).">>),
- ?line {error, {1, file, {throw, apa, _}}} = file:eval(File),
+1/0.">>),
+ {error, {3, file, {error, badarith, _}}} = file:eval(File),
- file:delete(File),
- ?line ?t:timetrap_cancel(Dog),
- ok.
+ok = file:write_file(File, <<"erlang:raise(throw, apa, []).">>),
+{error, {1, file, {throw, apa, _}}} = file:eval(File),
+
+file:delete(File),
+ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-otp_10852(suite) ->
- [];
-otp_10852(doc) ->
- ["OTP-10852. +fnu and latin1 filenames"];
+%% OTP-10852. +fnu and latin1 filenames.
otp_10852(Config) when is_list(Config) ->
Node = start_node(erl_pp_helper, "+fnu"),
- Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
B = filename:join(Dir, <<"\xE4">>),
ok = rpc_call(Node, get_cwd, [B]),
{error, no_translation} = rpc_call(Node, set_cwd, [B]),
@@ -3841,10 +3588,10 @@ otp_10852(Config) when is_list(Config) ->
ok = rpc_call(Node, read_file, [B]),
ok = rpc_call(Node, make_link, [B,B]),
case rpc_call(Node, make_symlink, [B,B]) of
- ok -> ok;
- {error, E} when (E =:= enotsup) or (E =:= eperm) ->
- {win32,_} = os:type()
- end,
+ ok -> ok;
+ {error, E} when (E =:= enotsup) or (E =:= eperm) ->
+ {win32,_} = os:type()
+ end,
ok = rpc_call(Node, delete, [B]),
ok = rpc_call(Node, make_dir, [B]),
ok = rpc_call(Node, del_dir, [B]),
@@ -3867,54 +3614,51 @@ rpc_call(N, F, As) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-large_file(suite) ->
- [];
-large_file(doc) ->
- ["Tests positioning in large files (> 4G)"];
+large_file() ->
+ [{timetrap,{minutes,20}}].
+
+%% Tests positioning in large files (> 4G).
large_file(Config) when is_list(Config) ->
run_large_file_test(Config,
fun(Name) -> do_large_file(Name) end,
"_large_file").
do_large_file(Name) ->
- ?line Watchdog = ?t:timetrap(?t:minutes(20)),
-
- ?line S = "1234567890",
+ S = "1234567890",
L = length(S),
R = lists:reverse(S),
P = 1 bsl 32,
Ss = lists:sort(S),
Rs = lists:reverse(Ss),
- ?line {ok,F} = ?FILE_MODULE:open(Name, [raw,read,write]),
- ?line ok = ?FILE_MODULE:write(F, S),
- ?line {ok,P} = ?FILE_MODULE:position(F, P),
- ?line ok = ?FILE_MODULE:write(F, R),
- ?line {ok,0} = ?FILE_MODULE:position(F, bof),
- ?line {ok,S} = ?FILE_MODULE:read(F, L),
- ?line {ok,P} = ?FILE_MODULE:position(F, {eof,-L}),
- ?line {ok,R} = ?FILE_MODULE:read(F, L+1),
- ?line {ok,S} = ?FILE_MODULE:pread(F, 0, L),
- ?line {ok,R} = ?FILE_MODULE:pread(F, P, L+1),
- ?line ok = ?FILE_MODULE:pwrite(F, 0, Ss),
- ?line ok = ?FILE_MODULE:pwrite(F, P, Rs),
- ?line {ok,0} = ?FILE_MODULE:position(F, bof),
- ?line {ok,Ss} = ?FILE_MODULE:read(F, L),
- ?line {ok,P} = ?FILE_MODULE:position(F, {eof,-L}),
- ?line {ok,Rs} = ?FILE_MODULE:read(F, L+1),
- ?line ok = ?FILE_MODULE:close(F),
+ {ok,F} = ?FILE_MODULE:open(Name, [raw,read,write]),
+ ok = ?FILE_MODULE:write(F, S),
+ {ok,P} = ?FILE_MODULE:position(F, P),
+ ok = ?FILE_MODULE:write(F, R),
+ {ok,0} = ?FILE_MODULE:position(F, bof),
+ {ok,S} = ?FILE_MODULE:read(F, L),
+ {ok,P} = ?FILE_MODULE:position(F, {eof,-L}),
+ {ok,R} = ?FILE_MODULE:read(F, L+1),
+ {ok,S} = ?FILE_MODULE:pread(F, 0, L),
+ {ok,R} = ?FILE_MODULE:pread(F, P, L+1),
+ ok = ?FILE_MODULE:pwrite(F, 0, Ss),
+ ok = ?FILE_MODULE:pwrite(F, P, Rs),
+ {ok,0} = ?FILE_MODULE:position(F, bof),
+ {ok,Ss} = ?FILE_MODULE:read(F, L),
+ {ok,P} = ?FILE_MODULE:position(F, {eof,-L}),
+ {ok,Rs} = ?FILE_MODULE:read(F, L+1),
+ ok = ?FILE_MODULE:close(F),
%% Reopen the file with 'append'; used to fail on Windows causing
%% writes to go to the beginning of the file for files > 4GB.
- ?line PL = P + L,
- ?line PLL = PL + L,
- ?line {ok,F1} = ?FILE_MODULE:open(Name, [raw,read,write,append]),
- ?line ok = ?FILE_MODULE:write(F1, R),
- ?line {ok,PLL} = ?FILE_MODULE:position(F1, {cur,0}),
- ?line {ok,Rs} = ?FILE_MODULE:pread(F1, P, L),
- ?line {ok,PL} = ?FILE_MODULE:position(F1, {eof,-L}),
- ?line {ok,R} = ?FILE_MODULE:read(F1, L+1),
- ?line ok = ?FILE_MODULE:close(F1),
- %%
- ?line ?t:timetrap_cancel(Watchdog),
+ PL = P + L,
+ PLL = PL + L,
+ {ok,F1} = ?FILE_MODULE:open(Name, [raw,read,write,append]),
+ ok = ?FILE_MODULE:write(F1, R),
+ {ok,PLL} = ?FILE_MODULE:position(F1, {cur,0}),
+ {ok,Rs} = ?FILE_MODULE:pread(F1, P, L),
+ {ok,PL} = ?FILE_MODULE:position(F1, {eof,-L}),
+ {ok,R} = ?FILE_MODULE:read(F1, L+1),
+ ok = ?FILE_MODULE:close(F1),
+
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -3948,8 +3692,8 @@ do_large_write(Name) ->
response_analysis(Module, Function, Arguments) ->
Parent = self(),
- ?line erlang:yield(), % Schedule out before test
- ?line Child =
+ erlang:yield(), % Schedule out before test
+ Child =
spawn_link(
fun () ->
receive {Parent, start, Ts} -> ok end,
@@ -3969,19 +3713,19 @@ response_analysis(Module, Function, Arguments) ->
Parent ! {self(), stopped, response_stat(Stat, micro_ts())}
end),
Child ! {Parent, start, micro_ts()},
- ?line Result = apply(Module, Function, Arguments),
- ?line Child ! {Parent, stop},
- ?line {N, Sum, _, M, Max} = receive {Child, stopped, X} -> X end,
- ?line Mean_ms = (0.001*Sum) / (N-1),
- ?line Max_ms = 0.001 * Max,
- ?line Comment =
+ Result = apply(Module, Function, Arguments),
+ Child ! {Parent, stop},
+ {N, Sum, _, M, Max} = receive {Child, stopped, X} -> X end,
+ Mean_ms = (0.001*Sum) / (N-1),
+ Max_ms = 0.001 * Max,
+ Comment =
lists:flatten(
io_lib:format(
"Scheduling interval: Mean = ~.3f ms, "
++"Max = ~.3f ms for no ~p of ~p.~n",
[Mean_ms, Max_ms, M, (N-1)])),
- ?line {Result, Comment}.
-
+ {Result, Comment}.
+
micro_ts() ->
erlang:monotonic_time(micro_seconds).
@@ -4005,10 +3749,10 @@ response_stat({N, Sum, Ts0, M, Max}, Ts) ->
%% create_file/2 below is some 44 times faster.
create_file_slow(Name, N) when is_integer(N), N >= 0 ->
- ?line {ok, FD} =
+ {ok, FD} =
?FILE_MODULE:open(Name, [raw, write, delayed_write, binary]),
- ?line ok = create_file_slow(FD, 0, N),
- ?line ok = ?FILE_MODULE:close(FD),
+ ok = create_file_slow(FD, 0, N),
+ ok = ?FILE_MODULE:close(FD),
ok.
create_file_slow(_FD, M, M) ->
@@ -4023,10 +3767,10 @@ create_file_slow(FD, M, N) ->
%% from 0 to N-1.
create_file(Name, N) when is_integer(N), N >= 0 ->
- ?line {ok, FD} =
+ {ok, FD} =
?FILE_MODULE:open(Name, [raw, write, delayed_write, binary]),
- ?line ok = create_file(FD, 0, N),
- ?line ok = ?FILE_MODULE:close(FD),
+ ok = create_file(FD, 0, N),
+ ok = ?FILE_MODULE:close(FD),
ok.
create_file(_FD, M, M) ->
@@ -4043,10 +3787,10 @@ create_file(FD, M, N0, R) when M + 8 =< N0 ->
N1 = N0-1, N2 = N0-2, N3 = N0-3, N4 = N0-4,
N5 = N0-5, N6 = N0-6, N7 = N0-7, N8 = N0-8,
create_file(FD, M, N8,
- [<<N8:32/unsigned, N7:32/unsigned,
- N6:32/unsigned, N5:32/unsigned,
- N4:32/unsigned, N3:32/unsigned,
- N2:32/unsigned, N1:32/unsigned>> | R]);
+ [<<N8:32/unsigned, N7:32/unsigned,
+ N6:32/unsigned, N5:32/unsigned,
+ N4:32/unsigned, N3:32/unsigned,
+ N2:32/unsigned, N1:32/unsigned>> | R]);
create_file(FD, M, N0, R) ->
N1 = N0-1,
create_file(FD, M, N1, [<<N1:32/unsigned>> | R]).
@@ -4063,14 +3807,14 @@ create_bin(M, N0, R) when M+8 =< N0 ->
N5 = N0-5, N6 = N0-6, N7 = N0-7, N8 = N0-8,
create_bin(M, N8,
[<<N8:32/unsigned, N7:32/unsigned,
- N6:32/unsigned, N5:32/unsigned,
- N4:32/unsigned, N3:32/unsigned,
- N2:32/unsigned, N1:32/unsigned>> | R]);
+ N6:32/unsigned, N5:32/unsigned,
+ N4:32/unsigned, N3:32/unsigned,
+ N2:32/unsigned, N1:32/unsigned>> | R]);
create_bin(M, N0, R) ->
N1 = N0-1,
create_bin(M, N1, [<<N1:32/unsigned>> | R]).
-
-
+
+
verify_bin(<<>>, _, 0) ->
@@ -4082,8 +3826,8 @@ verify_bin(Bin, N, Cnt) ->
N4 = N + 4, N5 = N + 5, N6 = N + 6, N7 = N + 7,
case Bin of
<<N0:32/unsigned, N1:32/unsigned, N2:32/unsigned, N3:32/unsigned,
- N4:32/unsigned, N5:32/unsigned, N6:32/unsigned, N7:32/unsigned,
- B/binary>> ->
+ N4:32/unsigned, N5:32/unsigned, N6:32/unsigned, N7:32/unsigned,
+ B/binary>> ->
verify_bin(B, N+8, Cnt-8);
<<N:32/unsigned, B/binary>> ->
verify_bin(B, N+1, Cnt-1);
@@ -4164,13 +3908,13 @@ pwrite_file(Name, Data) ->
read_line_testdata(PrivDir) ->
All0 = [{fun read_line_create0/1,"Testdata1.txt",5,10},
- {fun read_line_create1/1,"Testdata2.txt",401,802},
- {fun read_line_create2/1,"Testdata3.txt",1,2},
- {fun read_line_create3/1,"Testdata4.txt",601,fail},
- {fun read_line_create4/1,"Testdata5.txt",601,1002},
- {fun read_line_create5/1,"Testdata6.txt",601,1202},
- {fun read_line_create6/1,"Testdata7.txt",601,1202},
- {fun read_line_create7/1,"Testdata8.txt",4001,8002}],
+ {fun read_line_create1/1,"Testdata2.txt",401,802},
+ {fun read_line_create2/1,"Testdata3.txt",1,2},
+ {fun read_line_create3/1,"Testdata4.txt",601,fail},
+ {fun read_line_create4/1,"Testdata5.txt",601,1002},
+ {fun read_line_create5/1,"Testdata6.txt",601,1202},
+ {fun read_line_create6/1,"Testdata7.txt",601,1202},
+ {fun read_line_create7/1,"Testdata8.txt",4001,8002}],
[ {A,filename:join([PrivDir,B]),C,D} || {A,B,C,D} <- All0 ].
read_line_create_files(TestData) ->
@@ -4179,105 +3923,93 @@ read_line_create_files(TestData) ->
read_line_remove_files(TestData) ->
[ file:delete(File) || {_Function,File,_,_} <- TestData ].
-read_line_1(suite) ->
- [];
-read_line_1(doc) ->
- ["read_line with prim_file"];
+%% read_line with prim_file.
read_line_1(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line All = read_line_testdata(PrivDir),
- ?line read_line_create_files(All),
- ?line [ begin
- io:format("read_line_all: ~s~n",[File]),
- {X,_} = read_line_all(File),
- true
- end || {_,File,X,_} <- All ],
- ?line [ begin
- io:format("read_line_all_alternating: ~s~n",[File]),
- {Y,_} = read_line_all_alternating(File),
- true
- end || {_,File,_,Y} <- All , Y =/= fail],
- ?line [ begin
- io:format("read_line_all_alternating (failing as should): ~s~n",[File]),
- {'EXIT',_} = (catch read_line_all_alternating(File)),
- true
- end || {_,File,_,Y} <- All , Y =:= fail],
- ?line read_line_remove_files(All),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ All = read_line_testdata(PrivDir),
+ read_line_create_files(All),
+ [ begin
+ io:format("read_line_all: ~s~n",[File]),
+ {X,_} = read_line_all(File),
+ true
+ end || {_,File,X,_} <- All ],
+ [ begin
+ io:format("read_line_all_alternating: ~s~n",[File]),
+ {Y,_} = read_line_all_alternating(File),
+ true
+ end || {_,File,_,Y} <- All , Y =/= fail],
+ [ begin
+ io:format("read_line_all_alternating (failing as should): ~s~n",[File]),
+ {'EXIT',_} = (catch read_line_all_alternating(File)),
+ true
+ end || {_,File,_,Y} <- All , Y =:= fail],
+ read_line_remove_files(All),
ok.
-read_line_2(suite) ->
- [];
-read_line_2(doc) ->
- ["read_line with file"];
+%% read_line with file.
read_line_2(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line All = read_line_testdata(PrivDir),
- ?line read_line_create_files(All),
- ?line [ begin
- io:format("read_line_all: ~s~n",[File]),
- {X,_} = read_line_all2(File),
- true
- end || {_,File,X,_} <- All ],
- ?line [ begin
- io:format("read_line_all_alternating: ~s~n",[File]),
- {Y,_} = read_line_all_alternating2(File),
- true
- end || {_,File,_,Y} <- All , Y =/= fail],
- ?line [ begin
- io:format("read_line_all_alternating (failing as should): ~s~n",[File]),
- {'EXIT',_} = (catch read_line_all_alternating2(File)),
- true
- end || {_,File,_,Y} <- All , Y =:= fail],
- ?line read_line_remove_files(All),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ All = read_line_testdata(PrivDir),
+ read_line_create_files(All),
+ [ begin
+ io:format("read_line_all: ~s~n",[File]),
+ {X,_} = read_line_all2(File),
+ true
+ end || {_,File,X,_} <- All ],
+ [ begin
+ io:format("read_line_all_alternating: ~s~n",[File]),
+ {Y,_} = read_line_all_alternating2(File),
+ true
+ end || {_,File,_,Y} <- All , Y =/= fail],
+ [ begin
+ io:format("read_line_all_alternating (failing as should): ~s~n",[File]),
+ {'EXIT',_} = (catch read_line_all_alternating2(File)),
+ true
+ end || {_,File,_,Y} <- All , Y =:= fail],
+ read_line_remove_files(All),
ok.
-read_line_3(suite) ->
- [];
-read_line_3(doc) ->
- ["read_line with raw file"];
+%% read_line with raw file.
read_line_3(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line All = read_line_testdata(PrivDir),
- ?line read_line_create_files(All),
- ?line [ begin
- io:format("read_line_all: ~s~n",[File]),
- {X,_} = read_line_all3(File),
- true
- end || {_,File,X,_} <- All ],
- ?line [ begin
- io:format("read_line_all_alternating: ~s~n",[File]),
- {Y,_} = read_line_all_alternating3(File),
- true
- end || {_,File,_,Y} <- All , Y =/= fail],
- ?line [ begin
- io:format("read_line_all_alternating (failing as should): ~s~n",[File]),
- {'EXIT',_} = (catch read_line_all_alternating3(File)),
- true
- end || {_,File,_,Y} <- All , Y =:= fail],
- ?line read_line_remove_files(All),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ All = read_line_testdata(PrivDir),
+ read_line_create_files(All),
+ [ begin
+ io:format("read_line_all: ~s~n",[File]),
+ {X,_} = read_line_all3(File),
+ true
+ end || {_,File,X,_} <- All ],
+ [ begin
+ io:format("read_line_all_alternating: ~s~n",[File]),
+ {Y,_} = read_line_all_alternating3(File),
+ true
+ end || {_,File,_,Y} <- All , Y =/= fail],
+ [ begin
+ io:format("read_line_all_alternating (failing as should): ~s~n",[File]),
+ {'EXIT',_} = (catch read_line_all_alternating3(File)),
+ true
+ end || {_,File,_,Y} <- All , Y =:= fail],
+ read_line_remove_files(All),
ok.
-read_line_4(suite) ->
- [];
-read_line_4(doc) ->
- ["read_line with raw buffered file"];
+%% read_line with raw buffered file.
read_line_4(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line All = read_line_testdata(PrivDir),
- ?line read_line_create_files(All),
- ?line [ begin
- io:format("read_line_all: ~s~n",[File]),
- {X,_} = read_line_all4(File),
- true
- end || {_,File,X,_} <- All ],
- ?line [ begin
- io:format("read_line_all_alternating: ~s~n",[File]),
- {Y,_} = read_line_all_alternating4(File),
- true
- end || {_,File,_,Y} <- All , Y =/= fail],
- ?line [ begin
- io:format("read_line_all_alternating (failing as should): ~s~n",[File]),
- {'EXIT',_} = (catch read_line_all_alternating4(File)),
- true
- end || {_,File,_,Y} <- All , Y =:= fail],
- ?line read_line_remove_files(All),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ All = read_line_testdata(PrivDir),
+ read_line_create_files(All),
+ [ begin
+ io:format("read_line_all: ~s~n",[File]),
+ {X,_} = read_line_all4(File),
+ true
+ end || {_,File,X,_} <- All ],
+ [ begin
+ io:format("read_line_all_alternating: ~s~n",[File]),
+ {Y,_} = read_line_all_alternating4(File),
+ true
+ end || {_,File,_,Y} <- All , Y =/= fail],
+ [ begin
+ io:format("read_line_all_alternating (failing as should): ~s~n",[File]),
+ {'EXIT',_} = (catch read_line_all_alternating4(File)),
+ true
+ end || {_,File,_,Y} <- All , Y =:= fail],
+ read_line_remove_files(All),
ok.
rl_lines() ->
@@ -4532,7 +4264,7 @@ run_large_file_test(Config, Run, Name) ->
{{unix,sunos},OsVersion} when OsVersion < {5,5,1} ->
{skip,"Only supported on Win32, Unix or SunOS >= 5.5.1"};
{{unix,_},_} ->
- N = disc_free(?config(priv_dir, Config)),
+ N = disc_free(proplists:get_value(priv_dir, Config)),
io:format("Free disk: ~w KByte~n", [N]),
if N < 5 * (1 bsl 20) ->
%% Less than 5 GByte free
@@ -4546,9 +4278,9 @@ run_large_file_test(Config, Run, Name) ->
do_run_large_file_test(Config, Run, Name0) ->
- Name = filename:join(?config(priv_dir, Config),
+ Name = filename:join(proplists:get_value(priv_dir, Config),
?MODULE_STRING ++ Name0),
-
+
%% Set up a process that will delete this file.
Tester = self(),
Deleter =
@@ -4561,7 +4293,7 @@ do_run_large_file_test(Config, Run, Name0) ->
end,
?FILE_MODULE:delete(Name)
end),
-
+
%% Run the test case.
Res = Run(Name),
diff --git a/lib/kernel/test/file_name_SUITE.erl b/lib/kernel/test/file_name_SUITE.erl
index e6f8761f95..be4ef9c394 100644
--- a/lib/kernel/test/file_name_SUITE.erl
+++ b/lib/kernel/test/file_name_SUITE.erl
@@ -79,14 +79,14 @@
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:seconds(60)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+end_per_testcase(_Func, _Config) ->
+ ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[normal, icky, very_icky, normalize, home_dir].
@@ -101,19 +101,16 @@ end_per_suite(_Config) ->
ok.
init_per_group(_GroupName, Config) ->
- Config.
+ Config.
end_per_group(_GroupName, Config) ->
- Config.
+ Config.
-home_dir(suite) ->
- [];
-home_dir(doc) ->
- ["Check that Erlang can be started with unicode named home directory"];
+%% Check that Erlang can be started with unicode named home directory.
home_dir(Config) when is_list(Config) ->
try
Name=[960,945,964,961,953,954],
- Priv = ?config(priv_dir, Config),
+ Priv = proplists:get_value(priv_dir, Config),
UniMode = file:native_name_encoding() =/= latin1,
if
not UniMode ->
@@ -154,45 +151,39 @@ home_dir(Config) when is_list(Config) ->
{skipped,"Runs only on Unix/Windows"}
end.
-normalize(suite) ->
- [];
-normalize(doc) ->
- ["Check that filename normalization works"];
+%% Check that filename normalization works.
normalize(Config) when is_list(Config) ->
rand:seed(exsplus, {1290,431421,830412}),
try
- ?line UniMode = file:native_name_encoding() =/= latin1,
+ UniMode = file:native_name_encoding() =/= latin1,
if
not UniMode ->
throw(need_unicode_mode);
true ->
ok
end,
- ?line Pairs = [rand_comp_decomp(200) || _ <- lists:seq(1,1000)],
+ Pairs = [rand_comp_decomp(200) || _ <- lists:seq(1,1000)],
case os:type() of
{unix,darwin} ->
- ?line [ true = (A =:= prim_file:internal_native2name(B)) ||
+ [ true = (A =:= prim_file:internal_native2name(B)) ||
{A,B} <- Pairs ];
_ ->
ok
end,
- ?line [ true = (A =:= prim_file:internal_normalize_utf8(B)) ||
- {A,B} <- Pairs ]
-
+ [ true = (A =:= prim_file:internal_normalize_utf8(B)) ||
+ {A,B} <- Pairs ]
+
catch
throw:need_unicode_mode ->
io:format("Sorry, can only run in unicode mode.~n"),
{skipped,"VM needs to be started in Unicode filename mode"}
end.
-
-normal(suite) ->
- [];
-normal(doc) ->
- "Check file operations on normal file names regardless of unicode mode";
+
+%% Check file operations on normal file names regardless of unicode mode.
normal(Config) when is_list(Config) ->
{ok,Dir} = file:get_cwd(),
try
- Priv = ?config(priv_dir, Config),
+ Priv = proplists:get_value(priv_dir, Config),
file:set_cwd(Priv),
put(file_module,prim_file),
ok = check_normal(prim_file),
@@ -204,12 +195,9 @@ normal(Config) when is_list(Config) ->
after
file:set_cwd(Dir)
end.
-
-icky(suite) ->
- [];
-icky(doc) ->
- "Check file operations on normal file names regardless of unicode mode";
+
+%% Check file operations on normal file names regardless of unicode mode.
icky(Config) when is_list(Config) ->
case hopeless_darwin() of
true ->
@@ -217,7 +205,7 @@ icky(Config) when is_list(Config) ->
false ->
{ok,Dir} = file:get_cwd(),
try
- Priv = ?config(priv_dir, Config),
+ Priv = proplists:get_value(priv_dir, Config),
file:set_cwd(Priv),
put(file_module,prim_file),
ok = check_icky(prim_file),
@@ -230,10 +218,7 @@ icky(Config) when is_list(Config) ->
file:set_cwd(Dir)
end
end.
-very_icky(suite) ->
- [];
-very_icky(doc) ->
- "Check file operations on normal file names regardless of unicode mode";
+%% Check file operations on normal file names regardless of unicode mode.
very_icky(Config) when is_list(Config) ->
case hopeless_darwin() of
true ->
@@ -241,7 +226,7 @@ very_icky(Config) when is_list(Config) ->
false ->
{ok,Dir} = file:get_cwd(),
try
- Priv = ?config(priv_dir, Config),
+ Priv = proplists:get_value(priv_dir, Config),
file:set_cwd(Priv),
put(file_module,prim_file),
case check_very_icky(prim_file) of
@@ -259,78 +244,77 @@ very_icky(Config) when is_list(Config) ->
file:set_cwd(Dir)
end
end.
-
+
check_normal(Mod) ->
{ok,Dir} = Mod:get_cwd(),
try
- ?line make_normal_dir(Mod),
- ?line {ok, L0} = Mod:list_dir("."),
- ?line L1 = lists:sort(L0),
- %erlang:display(L1),
- ?line L1 = lists:sort(list(normal_dir())),
- ?line {ok,D2} = Mod:get_cwd(),
- ?line true = is_list(D2),
- ?line case Mod:altname("fil1") of
+ make_normal_dir(Mod),
+ {ok, L0} = Mod:list_dir("."),
+ L1 = lists:sort(L0),
+ L1 = lists:sort(list(normal_dir())),
+ {ok,D2} = Mod:get_cwd(),
+ true = is_list(D2),
+ case Mod:altname("fil1") of
{error,enotsup} ->
ok;
{ok,LLL} when is_list(LLL) ->
ok
end,
- ?line [ true = is_list(El) || El <- L1],
- ?line Syms = [ {S,Targ,list_to_binary(get_data(Targ,normal_dir()))}
+ [ true = is_list(El) || El <- L1],
+ Syms = [ {S,Targ,list_to_binary(get_data(Targ,normal_dir()))}
|| {T,S,Targ} <- normal_dir(), T =:= symlink ],
- ?line [ {ok, Cont} = Mod:read_file(SymL) || {SymL,_,Cont} <- Syms ],
- ?line [ {ok, Targ} = fixlink(Mod:read_link(SymL)) || {SymL,Targ,_} <- Syms ],
- ?line chk_cre_dir(Mod,[{directory,"temp_dir",normal_dir()}]),
- ?line {ok,BeginAt} = Mod:get_cwd(),
- ?line true = is_list(BeginAt),
- ?line {error,enoent} = Mod:set_cwd("tmp_dir"),
- ?line ok = Mod:set_cwd("temp_dir"),
- ?line {ok, NowAt} = Mod:get_cwd(),
- ?line true = BeginAt =/= NowAt,
- ?line ok = Mod:set_cwd(".."),
- ?line {ok,BeginAt} = Mod:get_cwd(),
- ?line rm_r(Mod,"temp_dir"),
- ?line true = is_list(Dir),
- ?line [ true = is_list(FN) || FN <- L0 ],
+ [ {ok, Cont} = Mod:read_file(SymL) || {SymL,_,Cont} <- Syms ],
+ [ {ok, Targ} = fixlink(Mod:read_link(SymL)) || {SymL,Targ,_} <- Syms ],
+ chk_cre_dir(Mod,[{directory,"temp_dir",normal_dir()}]),
+ {ok,BeginAt} = Mod:get_cwd(),
+ true = is_list(BeginAt),
+ {error,enoent} = Mod:set_cwd("tmp_dir"),
+ ok = Mod:set_cwd("temp_dir"),
+ {ok, NowAt} = Mod:get_cwd(),
+ true = BeginAt =/= NowAt,
+ ok = Mod:set_cwd(".."),
+ {ok,BeginAt} = Mod:get_cwd(),
+ rm_r(Mod,"temp_dir"),
+ true = is_list(Dir),
+ [ true = is_list(FN) || FN <- L0 ],
case has_links() of
true ->
- ?line ok = Mod:make_link("fil1","nisse"),
- ?line {ok, <<"fil1">>} = Mod:read_file("nisse"),
- ?line {ok, #file_info{type = regular}} = Mod:read_link_info("nisse"),
- ?line ok = Mod:delete("nisse"),
- ?line {ok, <<"fil1">>} = Mod:read_file("fil1"),
- ?line {error,enoent} = Mod:read_file("nisse"),
- ?line {error,enoent} = Mod:read_link_info("nisse");
+ ok = Mod:make_link("fil1","nisse"),
+ {ok, <<"fil1">>} = Mod:read_file("nisse"),
+ {ok, #file_info{type = regular}} = Mod:read_link_info("nisse"),
+ ok = Mod:delete("nisse"),
+ {ok, <<"fil1">>} = Mod:read_file("fil1"),
+ {error,enoent} = Mod:read_file("nisse"),
+ {error,enoent} = Mod:read_link_info("nisse");
false ->
ok
end,
- ?line [ begin
- ?line {ok, FD} = Mod:open(Name,[read]),
- ?line {ok, Content} = Mod:read(FD,1024),
- ?line ok = file:close(FD)
+ [ begin
+ {ok, FD} = Mod:open(Name,[read]),
+ {ok, Content} = Mod:read(FD,1024),
+ ok = file:close(FD)
end || {regular,Name,Content} <- normal_dir() ],
- ?line [ begin
- ?line {ok, FD} = Mod:open(Name,[read,binary]),
- ?line BC = list_to_binary(Content),
- ?line {ok, BC} = Mod:read(FD,1024),
- ?line ok = file:close(FD)
+ [ begin
+ {ok, FD} = Mod:open(Name,[read,binary]),
+ BC = list_to_binary(Content),
+ {ok, BC} = Mod:read(FD,1024),
+ ok = file:close(FD)
end || {regular,Name,Content} <- normal_dir() ],
- ?line Mod:rename("fil1","tmp_fil1"),
- ?line {ok, <<"fil1">>} = Mod:read_file("tmp_fil1"),
- ?line {error,enoent} = Mod:read_file("fil1"),
- ?line Mod:rename("tmp_fil1","fil1"),
- ?line {ok, <<"fil1">>} = Mod:read_file("fil1"),
- ?line {error,enoent} = Mod:read_file("tmp_fil1"),
- ?line {ok,FI} = Mod:read_file_info("fil1"),
- ?line NewMode = FI#file_info.mode band (bnot 8#333),
- ?line NewMode2 = NewMode bor 8#222,
- ?line true = NewMode2 =/= NewMode,
- ?line ok = Mod:write_file_info("fil1",FI#file_info{mode = NewMode}),
- ?line {ok,#file_info{mode = NewMode}} = Mod:read_file_info("fil1"),
- ?line ok = Mod:write_file_info("fil1",FI#file_info{mode = NewMode2}),
- ?line {ok,#file_info{mode = NewMode2}} = Mod:read_file_info("fil1"),
+ Mod:rename("fil1","tmp_fil1"),
+ {ok, <<"fil1">>} = Mod:read_file("tmp_fil1"),
+ {error,enoent} = Mod:read_file("fil1"),
+ Mod:rename("tmp_fil1","fil1"),
+ {ok, <<"fil1">>} = Mod:read_file("fil1"),
+ {error,enoent} = Mod:read_file("tmp_fil1"),
+ {ok,FI} = Mod:read_file_info("fil1"),
+ NewMode = FI#file_info.mode band (bnot 8#333),
+ NewMode2 = NewMode bor 8#222,
+ true = NewMode2 =/= NewMode,
+ ok = Mod:write_file_info("fil1",FI#file_info{mode = NewMode}),
+ {ok,#file_info{mode = NewMode}} = Mod:read_file_info("fil1"),
+ ok = Mod:write_file_info("fil1",FI#file_info{mode = NewMode2}),
+ {ok,#file_info{mode = NewMode2}} = Mod:read_file_info("fil1"),
ok
after
case Mod:read_file_info("fil1") of
@@ -347,129 +331,129 @@ check_normal(Mod) ->
check_icky(Mod) ->
{ok,Dir} = Mod:get_cwd(),
try
- ?line true=(length("åäö") =:= 3),
- ?line UniMode = file:native_name_encoding() =/= latin1,
- ?line make_icky_dir(Mod),
+ true=(length("åäö") =:= 3),
+ UniMode = file:native_name_encoding() =/= latin1,
+ make_icky_dir(Mod),
{ok, L0} = Mod:list_dir_all("."),
- ?line L1 = lists:sort(L0),
+ L1 = lists:sort(L0),
io:format("~p~n~p~n~n",[L1,lists:sort(list(icky_dir()))]),
- ?line L1 = lists:sort(convlist(list(icky_dir()))),
- ?line {ok,D2} = Mod:get_cwd(),
- ?line true = is_list(D2),
-%% Altname only on windows, and there are no non native filenames there
-%% ?line case Mod:altname("fil1") of
-%% {error,enotsup} ->
-%% ok;
-%% {ok,LLL} when is_list(LLL) ->
-%% ok
-%% end,
- ?line [ true = ((is_list(El) or (UniMode and is_binary(El)))) || El <- L1],
- ?line Syms = [ {S,conv(Targ),list_to_binary(get_data(Targ,icky_dir()))}
+ L1 = lists:sort(convlist(list(icky_dir()))),
+ {ok,D2} = Mod:get_cwd(),
+ true = is_list(D2),
+ %% Altname only on windows, and there are no non native filenames there
+ %% case Mod:altname("fil1") of
+ %% {error,enotsup} ->
+ %% ok;
+ %% {ok,LLL} when is_list(LLL) ->
+ %% ok
+ %% end,
+ [ true = ((is_list(El) or (UniMode and is_binary(El)))) || El <- L1],
+ Syms = [ {S,conv(Targ),list_to_binary(get_data(Targ,icky_dir()))}
|| {T,S,Targ} <- icky_dir(), T =:= symlink ],
- ?line [ {ok, Cont} = Mod:read_file(SymL) || {SymL,_,Cont} <- Syms ],
+ [ {ok, Cont} = Mod:read_file(SymL) || {SymL,_,Cont} <- Syms ],
[ {ok, Targ} = fixlink(Mod:read_link_all(SymL)) ||
{SymL,Targ,_} <- Syms ],
- ?line chk_cre_dir(Mod,[{directory,"åäö_dir",icky_dir()}]),
- ?line {ok,BeginAt} = Mod:get_cwd(),
- ?line true = is_list(BeginAt),
- ?line {error,enoent} = Mod:set_cwd("åä_dir"),
- ?line ok = Mod:set_cwd("åäö_dir"),
- ?line {ok, NowAt} = Mod:get_cwd(),
- ?line true = is_list(NowAt),
- ?line true = BeginAt =/= NowAt,
- ?line ok = Mod:set_cwd(".."),
- ?line {ok,BeginAt} = Mod:get_cwd(),
- ?line rm_r2(Mod,"åäö_dir"),
+ chk_cre_dir(Mod,[{directory,"åäö_dir",icky_dir()}]),
+ {ok,BeginAt} = Mod:get_cwd(),
+ true = is_list(BeginAt),
+ {error,enoent} = Mod:set_cwd("åä_dir"),
+ ok = Mod:set_cwd("åäö_dir"),
+ {ok, NowAt} = Mod:get_cwd(),
+ true = is_list(NowAt),
+ true = BeginAt =/= NowAt,
+ ok = Mod:set_cwd(".."),
+ {ok,BeginAt} = Mod:get_cwd(),
+ rm_r2(Mod,"åäö_dir"),
{OS,_} = os:type(),
- % Check that treat_icky really converts to the same as the OS
+ %% Check that treat_icky really converts to the same as the OS
case UniMode of
true ->
- ?line chk_cre_dir(Mod,[{directory,"åäö_dir",[]}]),
- ?line ok = Mod:set_cwd("åäö_dir"),
- ?line ok = Mod:write_file(<<"ååå">>,<<"hello">>),
- ?line Treated = treat_icky(<<"ååå">>),
+ chk_cre_dir(Mod,[{directory,"åäö_dir",[]}]),
+ ok = Mod:set_cwd("åäö_dir"),
+ ok = Mod:write_file(<<"ååå">>,<<"hello">>),
+ Treated = treat_icky(<<"ååå">>),
{ok,[Treated]} = Mod:list_dir_all("."),
- ?line ok = Mod:delete(<<"ååå">>),
- ?line {ok,[]} = Mod:list_dir("."),
- ?line ok = Mod:set_cwd(".."),
- ?line rm_r2(Mod,"åäö_dir");
+ ok = Mod:delete(<<"ååå">>),
+ {ok,[]} = Mod:list_dir("."),
+ ok = Mod:set_cwd(".."),
+ rm_r2(Mod,"åäö_dir");
false ->
ok
end,
- ?line chk_cre_dir(Mod,[{directory,treat_icky(<<"åäö_dir">>),icky_dir()}]),
+ chk_cre_dir(Mod,[{directory,treat_icky(<<"åäö_dir">>),icky_dir()}]),
if
UniMode and (OS =/= win32) ->
- ?line {error,enoent} = Mod:set_cwd("åäö_dir");
+ {error,enoent} = Mod:set_cwd("åäö_dir");
true ->
ok
end,
- ?line {ok,BeginAt} = Mod:get_cwd(),
+ {ok,BeginAt} = Mod:get_cwd(),
case has_links() of
true ->
- ?line ok = Mod:make_link("fil1","nisseö"),
- ?line {ok, <<"fil1">>} = Mod:read_file("nisseö"),
- ?line {ok, #file_info{type = regular}} = Mod:read_link_info("nisseö"),
- ?line ok = Mod:delete("nisseö"),
- ?line ok = Mod:make_link("fil1",treat_icky(<<"nisseö">>)),
- ?line {ok, <<"fil1">>} = Mod:read_file(treat_icky(<<"nisseö">>)),
- ?line {ok, #file_info{type = regular}} = Mod:read_link_info(treat_icky(<<"nisseö">>)),
- ?line ok = Mod:delete(treat_icky(<<"nisseö">>)),
- ?line {ok, <<"fil1">>} = Mod:read_file("fil1"),
- ?line {error,enoent} = Mod:read_file("nisseö"),
- ?line {error,enoent} = Mod:read_link_info("nisseö"),
- ?line {error,enoent} = Mod:read_file(treat_icky(<<"nisseö">>)),
- ?line {error,enoent} = Mod:read_link_info(treat_icky(<<"nisseö">>));
+ ok = Mod:make_link("fil1","nisseö"),
+ {ok, <<"fil1">>} = Mod:read_file("nisseö"),
+ {ok, #file_info{type = regular}} = Mod:read_link_info("nisseö"),
+ ok = Mod:delete("nisseö"),
+ ok = Mod:make_link("fil1",treat_icky(<<"nisseö">>)),
+ {ok, <<"fil1">>} = Mod:read_file(treat_icky(<<"nisseö">>)),
+ {ok, #file_info{type = regular}} = Mod:read_link_info(treat_icky(<<"nisseö">>)),
+ ok = Mod:delete(treat_icky(<<"nisseö">>)),
+ {ok, <<"fil1">>} = Mod:read_file("fil1"),
+ {error,enoent} = Mod:read_file("nisseö"),
+ {error,enoent} = Mod:read_link_info("nisseö"),
+ {error,enoent} = Mod:read_file(treat_icky(<<"nisseö">>)),
+ {error,enoent} = Mod:read_link_info(treat_icky(<<"nisseö">>));
false ->
ok
end,
- ?line [ begin
- ?line {ok, FD} = Mod:open(Name,[read]),
- ?line {ok, Content} = Mod:read(FD,1024),
- ?line ok = file:close(FD)
+ [ begin
+ {ok, FD} = Mod:open(Name,[read]),
+ {ok, Content} = Mod:read(FD,1024),
+ ok = file:close(FD)
end || {regular,Name,Content} <- icky_dir() ],
- ?line [ begin
- ?line {ok, FD} = Mod:open(Name,[read,binary]),
- ?line BC = list_to_binary([Content]),
- ?line {ok, BC} = Mod:read(FD,1024),
- ?line ok = file:close(FD)
+ [ begin
+ {ok, FD} = Mod:open(Name,[read,binary]),
+ BC = list_to_binary([Content]),
+ {ok, BC} = Mod:read(FD,1024),
+ ok = file:close(FD)
end || {regular,Name,Content} <- icky_dir() ],
- ?line Mod:rename("åäö2","åäö_fil1"),
- ?line {ok, <<"åäö2">>} = Mod:read_file("åäö_fil1"),
- ?line {error,enoent} = Mod:read_file("åäö2"),
- ?line Mod:rename("åäö_fil1","åäö2"),
- ?line {ok, <<"åäö2">>} = Mod:read_file("åäö2"),
- ?line {error,enoent} = Mod:read_file("åäö_fil1"),
+ Mod:rename("åäö2","åäö_fil1"),
+ {ok, <<"åäö2">>} = Mod:read_file("åäö_fil1"),
+ {error,enoent} = Mod:read_file("åäö2"),
+ Mod:rename("åäö_fil1","åäö2"),
+ {ok, <<"åäö2">>} = Mod:read_file("åäö2"),
+ {error,enoent} = Mod:read_file("åäö_fil1"),
- ?line Mod:rename("åäö2",treat_icky(<<"åäö_fil1">>)),
- ?line {ok, <<"åäö2">>} = Mod:read_file(treat_icky(<<"åäö_fil1">>)),
+ Mod:rename("åäö2",treat_icky(<<"åäö_fil1">>)),
+ {ok, <<"åäö2">>} = Mod:read_file(treat_icky(<<"åäö_fil1">>)),
if
UniMode and (OS =/= win32) ->
{error,enoent} = Mod:read_file("åäö_fil1");
true ->
ok
end,
- ?line {error,enoent} = Mod:read_file("åäö2"),
- ?line Mod:rename(treat_icky(<<"åäö_fil1">>),"åäö2"),
- ?line {ok, <<"åäö2">>} = Mod:read_file("åäö2"),
- ?line {error,enoent} = Mod:read_file("åäö_fil1"),
- ?line {error,enoent} = Mod:read_file(treat_icky(<<"åäö_fil1">>)),
+ {error,enoent} = Mod:read_file("åäö2"),
+ Mod:rename(treat_icky(<<"åäö_fil1">>),"åäö2"),
+ {ok, <<"åäö2">>} = Mod:read_file("åäö2"),
+ {error,enoent} = Mod:read_file("åäö_fil1"),
+ {error,enoent} = Mod:read_file(treat_icky(<<"åäö_fil1">>)),
- ?line {ok,FI} = Mod:read_file_info("åäö2"),
- ?line NewMode = FI#file_info.mode band (bnot 8#333),
- ?line NewMode2 = NewMode bor 8#222,
- ?line true = NewMode2 =/= NewMode,
- ?line ok = Mod:write_file_info("åäö2",FI#file_info{mode = NewMode}),
- ?line {ok,#file_info{mode = NewMode}} = Mod:read_file_info("åäö2"),
- ?line ok = Mod:write_file_info("åäö2",FI#file_info{mode = NewMode2}),
- ?line {ok,#file_info{mode = NewMode2}} = Mod:read_file_info("åäö2"),
+ {ok,FI} = Mod:read_file_info("åäö2"),
+ NewMode = FI#file_info.mode band (bnot 8#333),
+ NewMode2 = NewMode bor 8#222,
+ true = NewMode2 =/= NewMode,
+ ok = Mod:write_file_info("åäö2",FI#file_info{mode = NewMode}),
+ {ok,#file_info{mode = NewMode}} = Mod:read_file_info("åäö2"),
+ ok = Mod:write_file_info("åäö2",FI#file_info{mode = NewMode2}),
+ {ok,#file_info{mode = NewMode2}} = Mod:read_file_info("åäö2"),
- ?line {ok,FII} = Mod:read_file_info(treat_icky(<<"åäö5">>)),
- ?line true = NewMode2 =/= NewMode,
- ?line ok = Mod:write_file_info(treat_icky(<<"åäö5">>),FII#file_info{mode = NewMode}),
- ?line {ok,#file_info{mode = NewMode}} = Mod:read_file_info(treat_icky(<<"åäö5">>)),
- ?line ok = Mod:write_file_info(<<"åäö5">>,FII#file_info{mode = NewMode2}),
- ?line {ok,#file_info{mode = NewMode2}} = Mod:read_file_info(treat_icky(<<"åäö5">>)),
+ {ok,FII} = Mod:read_file_info(treat_icky(<<"åäö5">>)),
+ true = NewMode2 =/= NewMode,
+ ok = Mod:write_file_info(treat_icky(<<"åäö5">>),FII#file_info{mode = NewMode}),
+ {ok,#file_info{mode = NewMode}} = Mod:read_file_info(treat_icky(<<"åäö5">>)),
+ ok = Mod:write_file_info(<<"åäö5">>,FII#file_info{mode = NewMode2}),
+ {ok,#file_info{mode = NewMode2}} = Mod:read_file_info(treat_icky(<<"åäö5">>)),
ok
after
Mod:set_cwd(Dir),
@@ -479,90 +463,90 @@ check_icky(Mod) ->
check_very_icky(Mod) ->
{ok,Dir} = Mod:get_cwd(),
try
- ?line true=(length("åäö") =:= 3),
- ?line UniMode = file:native_name_encoding() =/= latin1,
+ true=(length("åäö") =:= 3),
+ UniMode = file:native_name_encoding() =/= latin1,
if
not UniMode ->
throw(need_unicode_mode);
true ->
ok
end,
- ?line make_very_icky_dir(Mod),
+ make_very_icky_dir(Mod),
{ok, L0} = Mod:list_dir_all("."),
- ?line L1 = lists:sort(L0),
- ?line L1 = lists:sort(convlist(list(very_icky_dir()))),
- ?line {ok,D2} = Mod:get_cwd(),
- ?line true = is_list(D2),
- ?line [ true = ((is_list(El) or is_binary(El))) || El <- L1],
- ?line Syms = [ {S,conv(Targ),list_to_binary(get_data(Targ,very_icky_dir()))}
+ L1 = lists:sort(L0),
+ L1 = lists:sort(convlist(list(very_icky_dir()))),
+ {ok,D2} = Mod:get_cwd(),
+ true = is_list(D2),
+ [ true = ((is_list(El) or is_binary(El))) || El <- L1],
+ Syms = [ {S,conv(Targ),list_to_binary(get_data(Targ,very_icky_dir()))}
|| {T,S,Targ} <- very_icky_dir(), T =:= symlink ],
- ?line [ {ok, Cont} = Mod:read_file(SymL) || {SymL,_,Cont} <- Syms ],
- ?line [ {ok, Targ} = fixlink(Mod:read_link_all(SymL)) ||
- {SymL,Targ,_} <- Syms ],
- ?line chk_cre_dir(Mod,[{directory,[1088,1079,1091]++"_dir",very_icky_dir()}]),
- ?line {ok,BeginAt} = Mod:get_cwd(),
- ?line true = is_list(BeginAt),
- ?line {error,enoent} = Mod:set_cwd("åä_dir"),
- ?line ok = Mod:set_cwd([1088,1079,1091]++"_dir"),
- ?line {ok, NowAt} = Mod:get_cwd(),
- ?line true = is_list(NowAt),
- ?line true = BeginAt =/= NowAt,
- ?line ok = Mod:set_cwd(".."),
- ?line {ok,BeginAt} = Mod:get_cwd(),
- ?line rm_r2(Mod,[1088,1079,1091]++"_dir"),
+ [ {ok, Cont} = Mod:read_file(SymL) || {SymL,_,Cont} <- Syms ],
+ [ {ok, Targ} = fixlink(Mod:read_link_all(SymL)) ||
+ {SymL,Targ,_} <- Syms ],
+ chk_cre_dir(Mod,[{directory,[1088,1079,1091]++"_dir",very_icky_dir()}]),
+ {ok,BeginAt} = Mod:get_cwd(),
+ true = is_list(BeginAt),
+ {error,enoent} = Mod:set_cwd("åä_dir"),
+ ok = Mod:set_cwd([1088,1079,1091]++"_dir"),
+ {ok, NowAt} = Mod:get_cwd(),
+ true = is_list(NowAt),
+ true = BeginAt =/= NowAt,
+ ok = Mod:set_cwd(".."),
+ {ok,BeginAt} = Mod:get_cwd(),
+ rm_r2(Mod,[1088,1079,1091]++"_dir"),
case has_links() of
true ->
- ?line ok = Mod:make_link("fil1","nisse"++[1088,1079,1091]),
- ?line {ok, <<"fil1">>} =
+ ok = Mod:make_link("fil1","nisse"++[1088,1079,1091]),
+ {ok, <<"fil1">>} =
Mod:read_file("nisse"++[1088,1079,1091]),
- ?line {ok, #file_info{type = regular}} =
+ {ok, #file_info{type = regular}} =
Mod:read_link_info("nisse"++[1088,1079,1091]),
- ?line ok = Mod:delete("nisse"++[1088,1079,1091]),
- ?line ok = Mod:make_link("fil1",<<"nisseö">>),
- ?line {ok, <<"fil1">>} = Mod:read_file(<<"nisseö">>),
- ?line {ok, #file_info{type = regular}} =
+ ok = Mod:delete("nisse"++[1088,1079,1091]),
+ ok = Mod:make_link("fil1",<<"nisseö">>),
+ {ok, <<"fil1">>} = Mod:read_file(<<"nisseö">>),
+ {ok, #file_info{type = regular}} =
Mod:read_link_info(<<"nisseö">>),
- ?line ok = Mod:delete(<<"nisseö">>),
- ?line {ok, <<"fil1">>} = Mod:read_file("fil1"),
- ?line {error,enoent} = Mod:read_file("nisse"++[1088,1079,1091]),
- ?line {error,enoent} = Mod:read_link_info("nisse"++[1088,1079,1091]),
- ?line {error,enoent} = Mod:read_file(<<"nisseö">>),
- ?line {error,enoent} = Mod:read_link_info(<<"nisseö">>);
+ ok = Mod:delete(<<"nisseö">>),
+ {ok, <<"fil1">>} = Mod:read_file("fil1"),
+ {error,enoent} = Mod:read_file("nisse"++[1088,1079,1091]),
+ {error,enoent} = Mod:read_link_info("nisse"++[1088,1079,1091]),
+ {error,enoent} = Mod:read_file(<<"nisseö">>),
+ {error,enoent} = Mod:read_link_info(<<"nisseö">>);
false ->
ok
end,
- ?line [ begin
- ?line {ok, FD} = Mod:open(Name,[read]),
- ?line {ok, Content} = Mod:read(FD,1024),
- ?line ok = file:close(FD)
+ [ begin
+ {ok, FD} = Mod:open(Name,[read]),
+ {ok, Content} = Mod:read(FD,1024),
+ ok = file:close(FD)
end || {regular,Name,Content} <- very_icky_dir() ],
- ?line [ begin
- ?line {ok, FD} = Mod:open(Name,[read,binary]),
- ?line BC = list_to_binary([Content]),
- ?line {ok, BC} = Mod:read(FD,1024),
- ?line ok = file:close(FD)
+ [ begin
+ {ok, FD} = Mod:open(Name,[read,binary]),
+ BC = list_to_binary([Content]),
+ {ok, BC} = Mod:read(FD,1024),
+ ok = file:close(FD)
end || {regular,Name,Content} <- very_icky_dir() ],
- ?line Mod:rename([956,965,963,954,959,49],
- [956,965,963,954,959]++"_fil1"),
- ?line {ok, <<"åäö2">>} = Mod:read_file([956,965,963,954,959]++"_fil1"),
- ?line {error,enoent} = Mod:read_file([956,965,963,954,959,49]),
- ?line Mod:rename([956,965,963,954,959]++"_fil1",[956,965,963,954,959,49]),
- ?line {ok, <<"åäö2">>} = Mod:read_file([956,965,963,954,959,49]),
- ?line {error,enoent} = Mod:read_file([956,965,963,954,959]++"_fil1"),
+ Mod:rename([956,965,963,954,959,49],
+ [956,965,963,954,959]++"_fil1"),
+ {ok, <<"åäö2">>} = Mod:read_file([956,965,963,954,959]++"_fil1"),
+ {error,enoent} = Mod:read_file([956,965,963,954,959,49]),
+ Mod:rename([956,965,963,954,959]++"_fil1",[956,965,963,954,959,49]),
+ {ok, <<"åäö2">>} = Mod:read_file([956,965,963,954,959,49]),
+ {error,enoent} = Mod:read_file([956,965,963,954,959]++"_fil1"),
- ?line {ok,FI} = Mod:read_file_info([956,965,963,954,959,49]),
- ?line NewMode = FI#file_info.mode band (bnot 8#333),
- ?line NewMode2 = NewMode bor 8#222,
- ?line true = NewMode2 =/= NewMode,
- ?line ok = Mod:write_file_info([956,965,963,954,959,49],
- FI#file_info{mode = NewMode}),
- ?line {ok,#file_info{mode = NewMode}} =
- Mod:read_file_info([956,965,963,954,959,49]),
- ?line ok = Mod:write_file_info([956,965,963,954,959,49],
- FI#file_info{mode = NewMode2}),
- ?line {ok,#file_info{mode = NewMode2}} =
- Mod:read_file_info([956,965,963,954,959,49]),
+ {ok,FI} = Mod:read_file_info([956,965,963,954,959,49]),
+ NewMode = FI#file_info.mode band (bnot 8#333),
+ NewMode2 = NewMode bor 8#222,
+ true = NewMode2 =/= NewMode,
+ ok = Mod:write_file_info([956,965,963,954,959,49],
+ FI#file_info{mode = NewMode}),
+ {ok,#file_info{mode = NewMode}} =
+ Mod:read_file_info([956,965,963,954,959,49]),
+ ok = Mod:write_file_info([956,965,963,954,959,49],
+ FI#file_info{mode = NewMode2}),
+ {ok,#file_info{mode = NewMode2}} =
+ Mod:read_file_info([956,965,963,954,959,49]),
ok
catch
throw:need_unicode_mode ->
@@ -592,7 +576,6 @@ rm_rf(Mod,Dir) ->
end.
rm_r(Mod,Dir) ->
- %erlang:display({rm_r,Dir}),
case Mod:read_link_info(Dir) of
{ok, #file_info{type = directory}} ->
{ok,#file_info{type = directory}} = Mod:read_file_info(Dir),
@@ -610,7 +593,7 @@ rm_r(Mod,Dir) ->
end.
%% For icky test, allow binaries sometimes
rm_r2(Mod,Dir) ->
- %erlang:display({rm_r2,Dir}),
+ %% erlang:display({rm_r2,Dir}),
case Mod:read_link_info(Dir) of
{ok, #file_info{type = directory}} ->
{ok,#file_info{type = directory}} = Mod:read_file_info(Dir),
@@ -630,7 +613,7 @@ rm_r2(Mod,Dir) ->
chk_cre_dir(_,[]) ->
ok;
chk_cre_dir(Mod,[{regular,Name,Content}|T]) ->
- %io:format("~p~n",[Name]),
+ %% io:format("~p~n",[Name]),
ok = Mod:write_file(Name,Content),
chk_cre_dir(Mod,T);
chk_cre_dir(Mod,[{link,Name,Target}|T]) ->
@@ -641,12 +624,12 @@ chk_cre_dir(Mod,[{symlink,Name,Target}|T]) ->
chk_cre_dir(Mod,T);
chk_cre_dir(Mod,[{directory,Name,Content}|T]) ->
ok = Mod:make_dir(Name),
- %io:format("Content = ~p~n",[Content]),
+ %% io:format("Content = ~p~n",[Content]),
Content2 = [{Ty,filename:join(Name,N),case Ty of link -> filename:join(Name,C); _ -> C end} || {Ty,N,C} <- Content ],
- %io:format("Content2 = ~p~n",[Content2]),
+ %% io:format("Content2 = ~p~n",[Content2]),
chk_cre_dir(Mod,Content2),
chk_cre_dir(Mod,T).
-
+
has_links() ->
case os:type() of
{win32,_} ->
@@ -676,7 +659,7 @@ make_normal_dir(Mod) ->
Mod:make_dir("subdir"),
Mod:write_file(filename:join("subdir","subfil1"),"subfil1"),
ok.
-
+
normal_dir() ->
[{regular,"fil1","fil1"},
{regular,"fil2","fil2"}] ++
@@ -731,12 +714,12 @@ icky_dir() ->
[]
end ++
[{regular,treat_icky(<<"åäö5">>),"åäö5"}] ++
- case has_links() of
- true ->
- [{symlink,treat_icky(<<"åäö6">>),treat_icky(<<"åäö5">>)}];
- false ->
- []
- end ++
+ case has_links() of
+ true ->
+ [{symlink,treat_icky(<<"åäö6">>),treat_icky(<<"åäö5">>)}];
+ false ->
+ []
+ end ++
[{directory,treat_icky(<<"åäösubdir2">>),
[{regular,treat_icky(<<"åäösubfil2">>),"åäösubfil12"},
{regular,"åäösubfil3","åäösubfil13"}]},
@@ -760,18 +743,18 @@ very_icky_dir() ->
false ->
[]
end ++
- [{regular,treat_icky(<<"åäö5">>),"åäö5"}] ++
+ [{regular,treat_icky(<<"åäö5">>),"åäö5"}] ++
case has_links() of
true ->
[{symlink,treat_icky(<<"åäö6">>),treat_icky(<<"åäö5">>)}];
false ->
[]
end ++
- [{directory,treat_icky(<<"åäösubdir2">>),
- [{regular,treat_icky(<<"åäösubfil2">>),"åäösubfil12"},
- {regular,"åäösubfil3","åäösubfil13"}]},
- {directory,[956,965,963,954,959]++"subdir1",
- [{regular,[956,965,963,954,959]++"subfil1","åäösubfil1"}]}].
+ [{directory,treat_icky(<<"åäösubdir2">>),
+ [{regular,treat_icky(<<"åäösubfil2">>),"åäösubfil12"},
+ {regular,"åäösubfil3","åäösubfil13"}]},
+ {directory,[956,965,963,954,959]++"subdir1",
+ [{regular,[956,965,963,954,959]++"subfil1","åäösubfil1"}]}].
%% Some OS'es simply do not allow non UTF8 filenames
treat_icky(Bin) ->
@@ -784,7 +767,7 @@ treat_icky(Bin) ->
Bin
end.
-% Handle windows having absolute soft link targets.
+%% Handle windows having absolute soft link targets.
fixlink({ok,Link}) ->
case os:type() of
{win32,_} ->
@@ -811,7 +794,7 @@ list([]) ->
[];
list([{_,Name,_} | T]) ->
[Name | list(T)].
-
+
get_data(FN,List) ->
case lists:keysearch(FN,2,List) of
@@ -827,7 +810,7 @@ get_data(FN,List) ->
convlist(L) ->
convlist(file:native_name_encoding(),L).
convlist(latin1,[Bin|T]) when is_binary(Bin) ->
- %erlang:display('Convert...'),
+ %% erlang:display('Convert...'),
[binary_to_list(Bin)| convlist(latin1,T)];
convlist(Any,[H|T]) ->
[H|convlist(Any,T)];
@@ -851,7 +834,7 @@ rand_comp_decomp(Max) ->
LD = lists:flatten([B || {_,B} <- L]),
LB = unicode:characters_to_binary(LD,unicode,utf8),
{LC,LB}.
-
+
rand_decomp() ->
BT = bigtup(),
SZ = tuple_size(BT),
diff --git a/lib/kernel/test/gen_sctp_SUITE.erl b/lib/kernel/test/gen_sctp_SUITE.erl
index 99f8625ba9..8e53da210e 100644
--- a/lib/kernel/test/gen_sctp_SUITE.erl
+++ b/lib/kernel/test/gen_sctp_SUITE.erl
@@ -42,7 +42,9 @@
names_unihoming_ipv4/1, names_unihoming_ipv6/1,
names_multihoming_ipv4/1, names_multihoming_ipv6/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[basic, api_open_close, api_listen, api_connect_init,
@@ -81,48 +83,40 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:seconds(15)),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+ Config.
+end_per_testcase(_Func, _Config) ->
+ ok.
-define(LOGVAR(Var), begin io:format(??Var" = ~p~n", [Var]) end).
-basic(doc) ->
- "Hello world";
-basic(suite) ->
- [];
+%% Hello world.
basic(Config) when is_list(Config) ->
- ?line {ok,S} = gen_sctp:open(),
- ?line ok = gen_sctp:close(S),
+ {ok,S} = gen_sctp:open(),
+ ok = gen_sctp:close(S),
ok.
-xfer_min(doc) ->
- "Minimal data transfer";
-xfer_min(suite) ->
- [];
+%% Minimal data transfer.
xfer_min(Config) when is_list(Config) ->
- ?line Stream = 0,
- ?line Data = <<"The quick brown fox jumps over a lazy dog 0123456789">>,
- ?line Loopback = {127,0,0,1},
- ?line {ok,Sb} = gen_sctp:open([{type,seqpacket}]),
- ?line {ok,Pb} = inet:port(Sb),
- ?line ok = gen_sctp:listen(Sb, true),
-
- ?line {ok,Sa} = gen_sctp:open(),
- ?line {ok,Pa} = inet:port(Sa),
- ?line {ok,#sctp_assoc_change{state=comm_up,
- error=0,
- outbound_streams=SaOutboundStreams,
- inbound_streams=SaInboundStreams,
- assoc_id=SaAssocId}=SaAssocChange} =
+ Stream = 0,
+ Data = <<"The quick brown fox jumps over a lazy dog 0123456789">>,
+ Loopback = {127,0,0,1},
+ {ok,Sb} = gen_sctp:open([{type,seqpacket}]),
+ {ok,Pb} = inet:port(Sb),
+ ok = gen_sctp:listen(Sb, true),
+
+ {ok,Sa} = gen_sctp:open(),
+ {ok,Pa} = inet:port(Sa),
+ {ok,#sctp_assoc_change{state=comm_up,
+ error=0,
+ outbound_streams=SaOutboundStreams,
+ inbound_streams=SaInboundStreams,
+ assoc_id=SaAssocId}=SaAssocChange} =
gen_sctp:connect(Sa, Loopback, Pb, []),
- ?line {SbAssocId,SaOutboundStreams,SaInboundStreams} =
+ {SbAssocId,SaOutboundStreams,SaInboundStreams} =
case recv_event(log_ok(gen_sctp:recv(Sb, infinity))) of
{Loopback,Pa,
#sctp_assoc_change{state=comm_up,
@@ -142,184 +136,181 @@ xfer_min(Config) when is_list(Config) ->
outbound_streams=SbOutboundStreams,
inbound_streams=SbInboundStreams,
assoc_id=AssocId}} =
- ?line recv_event(log_ok(gen_sctp:recv(Sb, infinity))),
+ recv_event(log_ok(gen_sctp:recv(Sb, infinity))),
{AssocId,SbInboundStreams,SbOutboundStreams}
end,
- ?line ok = gen_sctp:send(Sa, SaAssocId, 0, Data),
- ?line case log_ok(gen_sctp:recv(Sb, infinity)) of
- {Loopback,
- Pa,
- [#sctp_sndrcvinfo{stream=Stream,
- assoc_id=SbAssocId}],
- Data} -> ok;
- Event1 ->
- case recv_event(Event1) of
- {Loopback,Pa,
- #sctp_paddr_change{addr = {Loopback,_},
- state = State,
- error = 0,
- assoc_id = SbAssocId}}
- when State =:= addr_available;
- State =:= addr_confirmed ->
- {Loopback,
- Pa,
- [#sctp_sndrcvinfo{stream=Stream,
- assoc_id=SbAssocId}],
- Data} = log_ok(gen_sctp:recv(Sb, infinity))
- end
- end,
- ?line ok = gen_sctp:send(Sb, SbAssocId, 0, Data),
- ?line case log_ok(gen_sctp:recv(Sa, infinity)) of
- {Loopback,Pb,
- [#sctp_sndrcvinfo{stream=Stream,
- assoc_id=SaAssocId}],
- Data} ->
- ok;
- Event2 ->
- {Loopback,Pb,
- #sctp_paddr_change{addr={_,Pb},
- state=addr_confirmed,
- error=0,
- assoc_id=SaAssocId}} =
- ?line recv_event(Event2),
- ?line {Loopback,
- Pb,
- [#sctp_sndrcvinfo{stream=Stream,
- assoc_id=SaAssocId}],
- Data} =
- log_ok(gen_sctp:recv(Sa, infinity))
- end,
+ ok = gen_sctp:send(Sa, SaAssocId, 0, Data),
+ case log_ok(gen_sctp:recv(Sb, infinity)) of
+ {Loopback,
+ Pa,
+ [#sctp_sndrcvinfo{stream=Stream,
+ assoc_id=SbAssocId}],
+ Data} -> ok;
+ Event1 ->
+ case recv_event(Event1) of
+ {Loopback,Pa,
+ #sctp_paddr_change{addr = {Loopback,_},
+ state = State,
+ error = 0,
+ assoc_id = SbAssocId}}
+ when State =:= addr_available;
+ State =:= addr_confirmed ->
+ {Loopback,
+ Pa,
+ [#sctp_sndrcvinfo{stream=Stream,
+ assoc_id=SbAssocId}],
+ Data} = log_ok(gen_sctp:recv(Sb, infinity))
+ end
+ end,
+ ok = gen_sctp:send(Sb, SbAssocId, 0, Data),
+ case log_ok(gen_sctp:recv(Sa, infinity)) of
+ {Loopback,Pb,
+ [#sctp_sndrcvinfo{stream=Stream,
+ assoc_id=SaAssocId}],
+ Data} ->
+ ok;
+ Event2 ->
+ {Loopback,Pb,
+ #sctp_paddr_change{addr={_,Pb},
+ state=addr_confirmed,
+ error=0,
+ assoc_id=SaAssocId}} =
+ recv_event(Event2),
+ {Loopback,
+ Pb,
+ [#sctp_sndrcvinfo{stream=Stream,
+ assoc_id=SaAssocId}],
+ Data} =
+ log_ok(gen_sctp:recv(Sa, infinity))
+ end,
%%
- ?line ok = gen_sctp:eof(Sa, SaAssocChange),
- ?line {Loopback,Pa,#sctp_shutdown_event{assoc_id=SbAssocId}} =
+ ok = gen_sctp:eof(Sa, SaAssocChange),
+ {Loopback,Pa,#sctp_shutdown_event{assoc_id=SbAssocId}} =
recv_event(log_ok(gen_sctp:recv(Sb, infinity))),
- ?line {Loopback,Pb,
- #sctp_assoc_change{state=shutdown_comp,
- error=0,
- assoc_id=SaAssocId}} =
+ {Loopback,Pb,
+ #sctp_assoc_change{state=shutdown_comp,
+ error=0,
+ assoc_id=SaAssocId}} =
recv_event(log_ok(gen_sctp:recv(Sa, infinity))),
- ?line {Loopback,Pa,
- #sctp_assoc_change{state=shutdown_comp,
- error=0,
- assoc_id=SbAssocId}} =
+ {Loopback,Pa,
+ #sctp_assoc_change{state=shutdown_comp,
+ error=0,
+ assoc_id=SbAssocId}} =
recv_event(log_ok(gen_sctp:recv(Sb, infinity))),
- ?line ok = gen_sctp:close(Sa),
- ?line ok = gen_sctp:close(Sb),
+ ok = gen_sctp:close(Sa),
+ ok = gen_sctp:close(Sb),
- ?line receive
- Msg -> test_server:fail({received,Msg})
- after 17 -> ok
- end,
+ receive
+ Msg -> ct:fail({received,Msg})
+ after 17 -> ok
+ end,
ok.
-xfer_active(doc) ->
- "Minimal data transfer in active mode";
-xfer_active(suite) ->
- [];
+%% Minimal data transfer in active mode.
xfer_active(Config) when is_list(Config) ->
- ?line Timeout = 2000,
- ?line Stream = 0,
- ?line Data = <<"The quick brown fox jumps over a lazy dog 0123456789">>,
- ?line Loopback = {127,0,0,1},
- ?line {ok,Sb} = gen_sctp:open([{active,true}]),
- ?line {ok,Pb} = inet:port(Sb),
- ?line ok = gen_sctp:listen(Sb, true),
-
- ?line {ok,Sa} = gen_sctp:open([{active,true}]),
- ?line {ok,Pa} = inet:port(Sa),
- ?line ok = gen_sctp:connect_init(Sa, Loopback, Pb, []),
- ?line #sctp_assoc_change{state=comm_up,
- error=0,
- outbound_streams=SaOutboundStreams,
- inbound_streams=SaInboundStreams,
- assoc_id=SaAssocId} = SaAssocChange =
+ Timeout = 2000,
+ Stream = 0,
+ Data = <<"The quick brown fox jumps over a lazy dog 0123456789">>,
+ Loopback = {127,0,0,1},
+ {ok,Sb} = gen_sctp:open([{active,true}]),
+ {ok,Pb} = inet:port(Sb),
+ ok = gen_sctp:listen(Sb, true),
+
+ {ok,Sa} = gen_sctp:open([{active,true}]),
+ {ok,Pa} = inet:port(Sa),
+ ok = gen_sctp:connect_init(Sa, Loopback, Pb, []),
+ #sctp_assoc_change{state=comm_up,
+ error=0,
+ outbound_streams=SaOutboundStreams,
+ inbound_streams=SaInboundStreams,
+ assoc_id=SaAssocId} = SaAssocChange =
recv_assoc_change(Sa, Loopback, Pb, Timeout),
- ?line io:format("Sa=~p, Pa=~p, Sb=~p, Pb=~p, SaAssocId=~p, "
- "SaOutboundStreams=~p, SaInboundStreams=~p~n",
- [Sa,Pa,Sb,Pb,SaAssocId,
- SaOutboundStreams,SaInboundStreams]),
- ?line #sctp_assoc_change{state=comm_up,
- error=0,
- outbound_streams=SbOutboundStreams,
- inbound_streams=SbInboundStreams,
- assoc_id=SbAssocId} =
+ io:format("Sa=~p, Pa=~p, Sb=~p, Pb=~p, SaAssocId=~p, "
+ "SaOutboundStreams=~p, SaInboundStreams=~p~n",
+ [Sa,Pa,Sb,Pb,SaAssocId,
+ SaOutboundStreams,SaInboundStreams]),
+ #sctp_assoc_change{state=comm_up,
+ error=0,
+ outbound_streams=SbOutboundStreams,
+ inbound_streams=SbInboundStreams,
+ assoc_id=SbAssocId} =
recv_assoc_change(Sb, Loopback, Pa, Timeout),
- ?line SbOutboundStreams = SaInboundStreams,
- ?line SbInboundStreams = SaOutboundStreams,
- ?line io:format("SbAssocId=~p~n", [SbAssocId]),
-
- ?line case recv_paddr_change(Sa, Loopback, Pb, 314) of
- #sctp_paddr_change{state=addr_confirmed,
- addr={_,Pb},
- error=0,
- assoc_id=SaAssocId} -> ok;
- #sctp_paddr_change{state=addr_available,
- addr={_,Pb},
- error=0,
- assoc_id=SaAssocId} -> ok;
- timeout -> ok
- end,
- ?line case recv_paddr_change(Sb, Loopback, Pa, 314) of
- #sctp_paddr_change{state=addr_confirmed,
- addr={Loopback,Pa},
- error=0,
- assoc_id=SbAssocId} -> ok;
- #sctp_paddr_change{state=addr_available,
- addr={Loopback,P},
- error=0,
- assoc_id=SbAssocId} ->
- ?line match_unless_solaris(Pa, P);
- timeout -> ok
- end,
- ?line [] = flush(),
-
- ?line ok =
+ SbOutboundStreams = SaInboundStreams,
+ SbInboundStreams = SaOutboundStreams,
+ io:format("SbAssocId=~p~n", [SbAssocId]),
+
+ case recv_paddr_change(Sa, Loopback, Pb, 314) of
+ #sctp_paddr_change{state=addr_confirmed,
+ addr={_,Pb},
+ error=0,
+ assoc_id=SaAssocId} -> ok;
+ #sctp_paddr_change{state=addr_available,
+ addr={_,Pb},
+ error=0,
+ assoc_id=SaAssocId} -> ok;
+ timeout -> ok
+ end,
+ case recv_paddr_change(Sb, Loopback, Pa, 314) of
+ #sctp_paddr_change{state=addr_confirmed,
+ addr={Loopback,Pa},
+ error=0,
+ assoc_id=SbAssocId} -> ok;
+ #sctp_paddr_change{state=addr_available,
+ addr={Loopback,P},
+ error=0,
+ assoc_id=SbAssocId} ->
+ match_unless_solaris(Pa, P);
+ timeout -> ok
+ end,
+ [] = flush(),
+
+ ok =
do_from_other_process(
fun () -> gen_sctp:send(Sa, SaAssocId, 0, Data) end),
- ?line receive
- {sctp,Sb,Loopback,Pa,
- {[#sctp_sndrcvinfo{stream=Stream,
- assoc_id=SbAssocId}],
- Data}} -> ok
- after Timeout ->
- ?line test_server:fail({timeout,flush()})
- end,
- ?line ok = gen_sctp:send(Sb, SbAssocId, 0, Data),
- ?line receive
- {sctp,Sa,Loopback,Pb,
- {[#sctp_sndrcvinfo{stream=Stream,
- assoc_id=SaAssocId}],
- Data}} -> ok
- after Timeout ->
- ?line test_server:fail({timeout,flush()})
- end,
+ receive
+ {sctp,Sb,Loopback,Pa,
+ {[#sctp_sndrcvinfo{stream=Stream,
+ assoc_id=SbAssocId}],
+ Data}} -> ok
+ after Timeout ->
+ ct:fail({timeout,flush()})
+ end,
+ ok = gen_sctp:send(Sb, SbAssocId, 0, Data),
+ receive
+ {sctp,Sa,Loopback,Pb,
+ {[#sctp_sndrcvinfo{stream=Stream,
+ assoc_id=SaAssocId}],
+ Data}} -> ok
+ after Timeout ->
+ ct:fail({timeout,flush()})
+ end,
%%
- ?line ok = gen_sctp:abort(Sa, SaAssocChange),
- ?line case recv_assoc_change(Sb, Loopback, Pa, Timeout) of
- #sctp_assoc_change{state=comm_lost,
- assoc_id=SbAssocId} -> ok;
- timeout ->
- ?line test_server:fail({timeout,flush()})
- end,
- ?line ok = gen_sctp:close(Sb),
- ?line case recv_assoc_change(Sa, Loopback, Pb, Timeout) of
- #sctp_assoc_change{state=comm_lost,
- assoc_id=SaAssocId} -> ok;
- timeout ->
- ?line io:format("timeout waiting for comm_lost on Sa~n"),
- ?line match_unless_solaris(ok, {timeout,flush()})
- end,
- ?line receive
- {sctp_error,Sa,enotconn} -> ok % Solaris
- after 17 -> ok
- end,
- ?line ok = gen_sctp:close(Sa),
+ ok = gen_sctp:abort(Sa, SaAssocChange),
+ case recv_assoc_change(Sb, Loopback, Pa, Timeout) of
+ #sctp_assoc_change{state=comm_lost,
+ assoc_id=SbAssocId} -> ok;
+ timeout ->
+ ct:fail({timeout,flush()})
+ end,
+ ok = gen_sctp:close(Sb),
+ case recv_assoc_change(Sa, Loopback, Pb, Timeout) of
+ #sctp_assoc_change{state=comm_lost,
+ assoc_id=SaAssocId} -> ok;
+ timeout ->
+ io:format("timeout waiting for comm_lost on Sa~n"),
+ match_unless_solaris(ok, {timeout,flush()})
+ end,
+ receive
+ {sctp_error,Sa,enotconn} -> ok % Solaris
+ after 17 -> ok
+ end,
+ ok = gen_sctp:close(Sa),
%%
- ?line receive
- Msg -> test_server:fail({unexpected,[Msg]++flush()})
- after 17 -> ok
- end,
+ receive
+ Msg -> ct:fail({unexpected,[Msg]++flush()})
+ after 17 -> ok
+ end,
ok.
recv_assoc_change(S, Addr, Port, Timeout) ->
@@ -346,142 +337,139 @@ recv_paddr_change(S, Addr, Port, Timeout) ->
timeout
end.
-def_sndrcvinfo(doc) ->
- "Test that #sctp_sndrcvinfo{} parameters set on a socket "
- "are used by gen_sctp:send/4";
-def_sndrcvinfo(suite) ->
- [];
+%% Test that #sctp_sndrcvinfo{} parameters set on a socket
+%% are used by gen_sctp:send/4.
def_sndrcvinfo(Config) when is_list(Config) ->
- ?line Loopback = {127,0,0,1},
- ?line Data = <<"What goes up, must come down.">>,
+ Loopback = {127,0,0,1},
+ Data = <<"What goes up, must come down.">>,
%%
- ?line S1 =
+ S1 =
log_ok(gen_sctp:open(
0, [{sctp_default_send_param,#sctp_sndrcvinfo{ppid=17}}])),
?LOGVAR(S1),
- ?line P1 =
+ P1 =
log_ok(inet:port(S1)),
?LOGVAR(P1),
- ?line #sctp_sndrcvinfo{ppid=17, context=0, timetolive=0, assoc_id=0} =
+ #sctp_sndrcvinfo{ppid=17, context=0, timetolive=0, assoc_id=0} =
getopt(S1, sctp_default_send_param),
- ?line ok =
+ ok =
gen_sctp:listen(S1, true),
%%
- ?line S2 =
+ S2 =
log_ok(gen_sctp:open()),
?LOGVAR(S2),
- ?line P2 =
+ P2 =
log_ok(inet:port(S2)),
?LOGVAR(P2),
- ?line #sctp_sndrcvinfo{ppid=0, context=0, timetolive=0, assoc_id=0} =
+ #sctp_sndrcvinfo{ppid=0, context=0, timetolive=0, assoc_id=0} =
getopt(S2, sctp_default_send_param),
%%
- ?line #sctp_assoc_change{
+ #sctp_assoc_change{
state=comm_up,
error=0,
assoc_id=S2AssocId} = S2AssocChange =
log_ok(gen_sctp:connect(S2, Loopback, P1, [])),
?LOGVAR(S2AssocChange),
- ?line case recv_event(log_ok(gen_sctp:recv(S1))) of
- {Loopback,P2,
- #sctp_assoc_change{
- state=comm_up,
- error=0,
- assoc_id=S1AssocId}} ->
- ?LOGVAR(S1AssocId);
- {Loopback,P2,
- #sctp_paddr_change{
- state=addr_confirmed,
- error=0,
- assoc_id=S1AssocId}} ->
- ?LOGVAR(S1AssocId),
- {Loopback,P2,
- #sctp_assoc_change{
- state=comm_up,
- error=0,
- assoc_id=S1AssocId}} =
- recv_event(log_ok(gen_sctp:recv(S1)))
- end,
-
- ?line #sctp_sndrcvinfo{
+ case recv_event(log_ok(gen_sctp:recv(S1))) of
+ {Loopback,P2,
+ #sctp_assoc_change{
+ state=comm_up,
+ error=0,
+ assoc_id=S1AssocId}} ->
+ ?LOGVAR(S1AssocId);
+ {Loopback,P2,
+ #sctp_paddr_change{
+ state=addr_confirmed,
+ error=0,
+ assoc_id=S1AssocId}} ->
+ ?LOGVAR(S1AssocId),
+ {Loopback,P2,
+ #sctp_assoc_change{
+ state=comm_up,
+ error=0,
+ assoc_id=S1AssocId}} =
+ recv_event(log_ok(gen_sctp:recv(S1)))
+ end,
+
+ #sctp_sndrcvinfo{
ppid=17, context=0, timetolive=0} = %, assoc_id=S1AssocId} =
getopt(
S1, sctp_default_send_param, #sctp_sndrcvinfo{assoc_id=S1AssocId}),
- ?line #sctp_sndrcvinfo{
+ #sctp_sndrcvinfo{
ppid=0, context=0, timetolive=0} = %, assoc_id=S2AssocId} =
getopt(
S2, sctp_default_send_param, #sctp_sndrcvinfo{assoc_id=S2AssocId}),
%%
- ?line ok =
+ ok =
gen_sctp:send(S1, S1AssocId, 1, <<"1: ",Data/binary>>),
- ?line case log_ok(gen_sctp:recv(S2)) of
- {Loopback,P1,
- [#sctp_sndrcvinfo{
- stream=1, ppid=17, context=0, assoc_id=S2AssocId}],
- <<"1: ",Data/binary>>} -> ok;
- Event1 ->
- ?line {Loopback,P1,
- #sctp_paddr_change{state=addr_confirmed,
- addr={_,P1},
- error=0,
- assoc_id=S2AssocId}} =
- recv_event(Event1),
- ?line {Loopback,P1,
- [#sctp_sndrcvinfo{
- stream=1, ppid=17, context=0, assoc_id=S2AssocId}],
- <<"1: ",Data/binary>>} =
- log_ok(gen_sctp:recv(S2))
- end,
+ case log_ok(gen_sctp:recv(S2)) of
+ {Loopback,P1,
+ [#sctp_sndrcvinfo{
+ stream=1, ppid=17, context=0, assoc_id=S2AssocId}],
+ <<"1: ",Data/binary>>} -> ok;
+ Event1 ->
+ {Loopback,P1,
+ #sctp_paddr_change{state=addr_confirmed,
+ addr={_,P1},
+ error=0,
+ assoc_id=S2AssocId}} =
+ recv_event(Event1),
+ {Loopback,P1,
+ [#sctp_sndrcvinfo{
+ stream=1, ppid=17, context=0, assoc_id=S2AssocId}],
+ <<"1: ",Data/binary>>} =
+ log_ok(gen_sctp:recv(S2))
+ end,
%%
- ?line ok =
+ ok =
setopt(
S1, sctp_default_send_param, #sctp_sndrcvinfo{ppid=18}),
- ?line ok =
+ ok =
setopt(
S1, sctp_default_send_param,
#sctp_sndrcvinfo{ppid=19, assoc_id=S1AssocId}),
- ?line #sctp_sndrcvinfo{
+ #sctp_sndrcvinfo{
ppid=18, context=0, timetolive=0, assoc_id=0} =
getopt(S1, sctp_default_send_param),
- ?line #sctp_sndrcvinfo{
+ #sctp_sndrcvinfo{
ppid=19, context=0, timetolive=0, assoc_id=S1AssocId} =
getopt(
S1, sctp_default_send_param, #sctp_sndrcvinfo{assoc_id=S1AssocId}),
%%
- ?line ok =
+ ok =
gen_sctp:send(S1, S1AssocId, 0, <<"2: ",Data/binary>>),
- ?line case log_ok(gen_sctp:recv(S2)) of
- {Loopback,P1,
- [#sctp_sndrcvinfo{
- stream=0, ppid=19, context=0, assoc_id=S2AssocId}],
- <<"2: ",Data/binary>>} -> ok
- end,
- ?line ok =
+ case log_ok(gen_sctp:recv(S2)) of
+ {Loopback,P1,
+ [#sctp_sndrcvinfo{
+ stream=0, ppid=19, context=0, assoc_id=S2AssocId}],
+ <<"2: ",Data/binary>>} -> ok
+ end,
+ ok =
gen_sctp:send(S2, S2AssocChange, 1, <<"3: ",Data/binary>>),
- ?line case log_ok(gen_sctp:recv(S1)) of
- {Loopback,P2,
- [#sctp_sndrcvinfo{
- stream=1, ppid=0, context=0, assoc_id=S1AssocId}],
- <<"3: ",Data/binary>>} -> ok;
- Event2 ->
- case recv_event(Event2) of
- {Loopback,P2,
- #sctp_paddr_change{
- addr={Loopback,_},
- state=State,
- error=0, assoc_id=S1AssocId}}
- when State =:= addr_available;
- State =:= addr_confirmed ->
- ?line case log_ok(gen_sctp:recv(S1)) of
- {Loopback,P2,
- [#sctp_sndrcvinfo{
- stream=1, ppid=0, context=0,
- assoc_id=S1AssocId}],
- <<"3: ",Data/binary>>} -> ok
- end
- end
- end,
- ?line ok =
+ case log_ok(gen_sctp:recv(S1)) of
+ {Loopback,P2,
+ [#sctp_sndrcvinfo{
+ stream=1, ppid=0, context=0, assoc_id=S1AssocId}],
+ <<"3: ",Data/binary>>} -> ok;
+ Event2 ->
+ case recv_event(Event2) of
+ {Loopback,P2,
+ #sctp_paddr_change{
+ addr={Loopback,_},
+ state=State,
+ error=0, assoc_id=S1AssocId}}
+ when State =:= addr_available;
+ State =:= addr_confirmed ->
+ case log_ok(gen_sctp:recv(S1)) of
+ {Loopback,P2,
+ [#sctp_sndrcvinfo{
+ stream=1, ppid=0, context=0,
+ assoc_id=S1AssocId}],
+ <<"3: ",Data/binary>>} -> ok
+ end
+ end
+ end,
+ ok =
do_from_other_process(
fun () ->
gen_sctp:send(
@@ -489,22 +477,22 @@ def_sndrcvinfo(Config) when is_list(Config) ->
#sctp_sndrcvinfo{stream=0, ppid=20, assoc_id=S2AssocId},
<<"4: ",Data/binary>>)
end),
- ?line case log_ok(do_from_other_process(fun() -> gen_sctp:recv(S1) end)) of
- {Loopback,P2,
- [#sctp_sndrcvinfo{
- stream=0, ppid=20, context=0, assoc_id=S1AssocId}],
- <<"4: ",Data/binary>>} -> ok
- end,
+ case log_ok(do_from_other_process(fun() -> gen_sctp:recv(S1) end)) of
+ {Loopback,P2,
+ [#sctp_sndrcvinfo{
+ stream=0, ppid=20, context=0, assoc_id=S1AssocId}],
+ <<"4: ",Data/binary>>} -> ok
+ end,
%%
- ?line ok =
+ ok =
gen_sctp:close(S1),
- ?line ok =
+ ok =
gen_sctp:close(S2),
- ?line receive
- Msg ->
- test_server:fail({received,Msg})
- after 17 -> ok
- end,
+ receive
+ Msg ->
+ ct:fail({received,Msg})
+ after 17 -> ok
+ end,
ok.
getopt(S, Opt) ->
@@ -541,147 +529,138 @@ flush() ->
[]
end.
-api_open_close(doc) ->
- "Test the API function open/1,2 and close/1";
-api_open_close(suite) ->
- [];
+%% Test the API function open/1,2 and close/1.
api_open_close(Config) when is_list(Config) ->
- ?line {ok,S1} = gen_sctp:open(0),
- ?line {ok,P} = inet:port(S1),
- ?line ok = gen_sctp:close(S1),
+ {ok,S1} = gen_sctp:open(0),
+ {ok,P} = inet:port(S1),
+ ok = gen_sctp:close(S1),
- ?line {ok,S2} = gen_sctp:open(P),
- ?line {ok,P} = inet:port(S2),
- ?line ok = gen_sctp:close(S2),
+ {ok,S2} = gen_sctp:open(P),
+ {ok,P} = inet:port(S2),
+ ok = gen_sctp:close(S2),
- ?line {ok,S3} = gen_sctp:open([{port,P}]),
- ?line {ok,P} = inet:port(S3),
- ?line ok = gen_sctp:close(S3),
+ {ok,S3} = gen_sctp:open([{port,P}]),
+ {ok,P} = inet:port(S3),
+ ok = gen_sctp:close(S3),
- ?line {ok,S4} = gen_sctp:open(P, []),
- ?line {ok,P} = inet:port(S4),
- ?line ok = gen_sctp:close(S4),
+ {ok,S4} = gen_sctp:open(P, []),
+ {ok,P} = inet:port(S4),
+ ok = gen_sctp:close(S4),
- ?line {ok,S5} = gen_sctp:open(P, [{ifaddr,any}]),
- ?line {ok,P} = inet:port(S5),
- ?line ok = gen_sctp:close(S5),
+ {ok,S5} = gen_sctp:open(P, [{ifaddr,any}]),
+ {ok,P} = inet:port(S5),
+ ok = gen_sctp:close(S5),
- ?line ok = gen_sctp:close(S5),
+ ok = gen_sctp:close(S5),
- ?line try gen_sctp:close(0)
- catch error:badarg -> ok
- end,
+ try gen_sctp:close(0)
+ catch error:badarg -> ok
+ end,
- ?line try gen_sctp:open({})
- catch error:badarg -> ok
- end,
+ try gen_sctp:open({})
+ catch error:badarg -> ok
+ end,
- ?line try gen_sctp:open(-1)
- catch error:badarg -> ok
- end,
+ try gen_sctp:open(-1)
+ catch error:badarg -> ok
+ end,
- ?line try gen_sctp:open(65536)
- catch error:badarg -> ok
- end,
+ try gen_sctp:open(65536)
+ catch error:badarg -> ok
+ end,
- ?line try gen_sctp:open(make_ref(), [])
- catch error:badarg -> ok
- end,
+ try gen_sctp:open(make_ref(), [])
+ catch error:badarg -> ok
+ end,
- ?line try gen_sctp:open(0, {})
- catch error:badarg -> ok
- end,
+ try gen_sctp:open(0, {})
+ catch error:badarg -> ok
+ end,
- ?line try gen_sctp:open(0, [make_ref()])
- catch error:badarg -> ok
- end,
+ try gen_sctp:open(0, [make_ref()])
+ catch error:badarg -> ok
+ end,
- ?line try gen_sctp:open([{invalid_option,0}])
- catch error:badarg -> ok
- end,
+ try gen_sctp:open([{invalid_option,0}])
+ catch error:badarg -> ok
+ end,
- ?line try gen_sctp:open(0, [{mode,invalid_mode}])
- catch error:badarg -> ok
- end,
+ try gen_sctp:open(0, [{mode,invalid_mode}])
+ catch error:badarg -> ok
+ end,
ok.
-api_listen(doc) ->
- "Test the API function listen/2";
-api_listen(suite) ->
- [];
+%% Test the API function listen/2.
api_listen(Config) when is_list(Config) ->
- ?line Localhost = {127,0,0,1},
-
- ?line try gen_sctp:listen(0, true)
- catch error:badarg -> ok
- end,
-
- ?line {ok,S} = gen_sctp:open(),
- ?line {ok,Pb} = inet:port(S),
- ?line try gen_sctp:listen(S, not_allowed_for_listen)
- catch error:badarg -> ok
- end,
- ?line ok = gen_sctp:close(S),
- ?line {error,closed} = gen_sctp:listen(S, true),
-
- ?line {ok,Sb} = gen_sctp:open(Pb),
- ?line {ok,Sa} = gen_sctp:open(),
- ?line case gen_sctp:connect(Sa, localhost, Pb, []) of
- {error,econnrefused} ->
- ?line {ok,{Localhost,
- Pb,[],
- #sctp_assoc_change{
- state=comm_lost}}} =
- gen_sctp:recv(Sa, infinity);
- {error,#sctp_assoc_change{state=cant_assoc}} ->
- ok%;
- %% {error,{Localhost,Pb,_,#sctp_assoc_change{state=cant_assoc}}} ->
- %% ok
- end,
- ?line ok = gen_sctp:listen(Sb, true),
- ?line {ok,#sctp_assoc_change{state=comm_up,
- error=0}} =
+ Localhost = {127,0,0,1},
+
+ try gen_sctp:listen(0, true)
+ catch error:badarg -> ok
+ end,
+
+ {ok,S} = gen_sctp:open(),
+ {ok,Pb} = inet:port(S),
+ try gen_sctp:listen(S, not_allowed_for_listen)
+ catch error:badarg -> ok
+ end,
+ ok = gen_sctp:close(S),
+ {error,closed} = gen_sctp:listen(S, true),
+
+ {ok,Sb} = gen_sctp:open(Pb),
+ {ok,Sa} = gen_sctp:open(),
+ case gen_sctp:connect(Sa, localhost, Pb, []) of
+ {error,econnrefused} ->
+ {ok,{Localhost,
+ Pb,[],
+ #sctp_assoc_change{
+ state=comm_lost}}} =
+ gen_sctp:recv(Sa, infinity);
+ {error,#sctp_assoc_change{state=cant_assoc}} ->
+ ok%;
+ %% {error,{Localhost,Pb,_,#sctp_assoc_change{state=cant_assoc}}} ->
+ %% ok
+ end,
+ ok = gen_sctp:listen(Sb, true),
+ {ok,#sctp_assoc_change{state=comm_up,
+ error=0}} =
gen_sctp:connect(Sa, localhost, Pb, []),
- ?line ok = gen_sctp:close(Sa),
- ?line ok = gen_sctp:close(Sb),
+ ok = gen_sctp:close(Sa),
+ ok = gen_sctp:close(Sb),
ok.
-api_connect_init(doc) ->
- "Test the API function connect_init/4";
-api_connect_init(suite) ->
- [];
+%% Test the API function connect_init/4.
api_connect_init(Config) when is_list(Config) ->
- ?line Localhost = {127,0,0,1},
-
- ?line {ok,S} = gen_sctp:open(),
- ?line {ok,Pb} = inet:port(S),
- ?line try gen_sctp:connect_init(S, Localhost, not_allowed_for_port, [])
- catch error:badarg -> ok
- end,
- ?line try gen_sctp:connect_init(S, Localhost, 12345, not_allowed_for_opts)
- catch error:badarg -> ok
- end,
- ?line ok = gen_sctp:close(S),
- ?line {error,closed} = gen_sctp:connect_init(S, Localhost, 12345, []),
-
- ?line {ok,Sb} = gen_sctp:open(Pb),
- ?line {ok,Sa} = gen_sctp:open(),
- ?line case gen_sctp:connect_init(Sa, localhost, Pb, []) of
- {error,econnrefused} ->
- ?line {Localhost,Pb,#sctp_assoc_change{state=comm_lost}} =
- recv_event(log_ok(gen_sctp:recv(Sa, infinity)));
- ok ->
- ?line {Localhost,Pb,#sctp_assoc_change{state=cant_assoc}} =
- recv_event(log_ok(gen_sctp:recv(Sa, infinity)))
- end,
- ?line ok = gen_sctp:listen(Sb, true),
- ?line case gen_sctp:connect_init(Sa, localhost, Pb, []) of
- ok ->
- ?line {Localhost,Pb,#sctp_assoc_change{state=comm_up}} =
- recv_event(log_ok(gen_sctp:recv(Sa, infinity)))
- end,
- ?line ok = gen_sctp:close(Sa),
- ?line ok = gen_sctp:close(Sb),
+ Localhost = {127,0,0,1},
+
+ {ok,S} = gen_sctp:open(),
+ {ok,Pb} = inet:port(S),
+ try gen_sctp:connect_init(S, Localhost, not_allowed_for_port, [])
+ catch error:badarg -> ok
+ end,
+ try gen_sctp:connect_init(S, Localhost, 12345, not_allowed_for_opts)
+ catch error:badarg -> ok
+ end,
+ ok = gen_sctp:close(S),
+ {error,closed} = gen_sctp:connect_init(S, Localhost, 12345, []),
+
+ {ok,Sb} = gen_sctp:open(Pb),
+ {ok,Sa} = gen_sctp:open(),
+ case gen_sctp:connect_init(Sa, localhost, Pb, []) of
+ {error,econnrefused} ->
+ {Localhost,Pb,#sctp_assoc_change{state=comm_lost}} =
+ recv_event(log_ok(gen_sctp:recv(Sa, infinity)));
+ ok ->
+ {Localhost,Pb,#sctp_assoc_change{state=cant_assoc}} =
+ recv_event(log_ok(gen_sctp:recv(Sa, infinity)))
+ end,
+ ok = gen_sctp:listen(Sb, true),
+ case gen_sctp:connect_init(Sa, localhost, Pb, []) of
+ ok ->
+ {Localhost,Pb,#sctp_assoc_change{state=comm_up}} =
+ recv_event(log_ok(gen_sctp:recv(Sa, infinity)))
+ end,
+ ok = gen_sctp:close(Sa),
+ ok = gen_sctp:close(Sb),
ok.
recv_event({Addr,Port,[],#sctp_assoc_change{}=AssocChange}) ->
@@ -703,94 +682,86 @@ recv_event({Addr,Port,
#sctp_shutdown_event{assoc_id=Assoc}=ShutdownEvent}) ->
{Addr,Port,ShutdownEvent}.
-api_opts(doc) ->
- "Test socket options";
-api_opts(suite) ->
- [];
+%% Test socket options.
api_opts(Config) when is_list(Config) ->
- ?line Sndbuf = 32768,
- ?line Recbuf = 65536,
- ?line {ok,S} = gen_sctp:open(0),
- ?line OSType = os:type(),
- ?line case {inet:setopts(S, [{linger,{true,2}}]),OSType} of
- {ok,_} ->
- ok;
- {{error,einval},{unix,sunos}} ->
- ok
- end,
- ?line ok = inet:setopts(S, [{sndbuf,Sndbuf}]),
- ?line ok = inet:setopts(S, [{recbuf,Recbuf}]),
- ?line case inet:getopts(S, [sndbuf]) of
- {ok,[{sndbuf,SB}]} when SB >= Sndbuf -> ok
- end,
- ?line case inet:getopts(S, [recbuf]) of
- {ok,[{recbuf,RB}]} when RB >= Recbuf -> ok
- end.
+ Sndbuf = 32768,
+ Recbuf = 65536,
+ {ok,S} = gen_sctp:open(0),
+ OSType = os:type(),
+ case {inet:setopts(S, [{linger,{true,2}}]),OSType} of
+ {ok,_} ->
+ ok;
+ {{error,einval},{unix,sunos}} ->
+ ok
+ end,
+ ok = inet:setopts(S, [{sndbuf,Sndbuf}]),
+ ok = inet:setopts(S, [{recbuf,Recbuf}]),
+ case inet:getopts(S, [sndbuf]) of
+ {ok,[{sndbuf,SB}]} when SB >= Sndbuf -> ok
+ end,
+ case inet:getopts(S, [recbuf]) of
+ {ok,[{recbuf,RB}]} when RB >= Recbuf -> ok
+ end.
implicit_inet6(Config) when is_list(Config) ->
- ?line Hostname = log_ok(inet:gethostname()),
- ?line
- case gen_sctp:open(0, [inet6]) of
- {ok,S1} ->
- ?line
- case inet:getaddr(Hostname, inet6) of
- {ok,Host} ->
- ?line Loopback = {0,0,0,0,0,0,0,1},
- ?line io:format("~s ~p~n", ["Loopback",Loopback]),
- ?line implicit_inet6(S1, Loopback),
- ?line ok = gen_sctp:close(S1),
- %%
- ?line Localhost =
- log_ok(inet:getaddr("localhost", inet6)),
- ?line io:format("~s ~p~n", ["localhost",Localhost]),
- ?line S2 =
- log_ok(gen_sctp:open(0, [{ip,Localhost}])),
- ?line implicit_inet6(S2, Localhost),
- ?line ok = gen_sctp:close(S2),
- %%
- ?line io:format("~s ~p~n", [Hostname,Host]),
- ?line S3 =
- log_ok(gen_sctp:open(0, [{ifaddr,Host}])),
- ?line implicit_inet6(S3, Host),
- ?line ok = gen_sctp:close(S1);
- {error,eafnosupport} ->
- ?line ok = gen_sctp:close(S1),
- {skip,"Can not look up IPv6 address"}
- end;
- _ ->
- {skip,"IPv6 not supported"}
- end.
+ Hostname = log_ok(inet:gethostname()),
+ case gen_sctp:open(0, [inet6]) of
+ {ok,S1} ->
+ case inet:getaddr(Hostname, inet6) of
+ {ok,Host} ->
+ Loopback = {0,0,0,0,0,0,0,1},
+ io:format("~s ~p~n", ["Loopback",Loopback]),
+ implicit_inet6(S1, Loopback),
+ ok = gen_sctp:close(S1),
+ %%
+ Localhost =
+ log_ok(inet:getaddr("localhost", inet6)),
+ io:format("~s ~p~n", ["localhost",Localhost]),
+ S2 =
+ log_ok(gen_sctp:open(0, [{ip,Localhost}])),
+ implicit_inet6(S2, Localhost),
+ ok = gen_sctp:close(S2),
+ %%
+ io:format("~s ~p~n", [Hostname,Host]),
+ S3 =
+ log_ok(gen_sctp:open(0, [{ifaddr,Host}])),
+ implicit_inet6(S3, Host),
+ ok = gen_sctp:close(S1);
+ {error,eafnosupport} ->
+ ok = gen_sctp:close(S1),
+ {skip,"Can not look up IPv6 address"}
+ end;
+ _ ->
+ {skip,"IPv6 not supported"}
+ end.
implicit_inet6(S1, Addr) ->
- ?line ok = gen_sctp:listen(S1, true),
- ?line P1 = log_ok(inet:port(S1)),
- ?line S2 = log_ok(gen_sctp:open(0, [inet6])),
- ?line P2 = log_ok(inet:port(S2)),
- ?line #sctp_assoc_change{state=comm_up} =
+ ok = gen_sctp:listen(S1, true),
+ P1 = log_ok(inet:port(S1)),
+ S2 = log_ok(gen_sctp:open(0, [inet6])),
+ P2 = log_ok(inet:port(S2)),
+ #sctp_assoc_change{state=comm_up} =
log_ok(gen_sctp:connect(S2, Addr, P1, [])),
- ?line case recv_event(log_ok(gen_sctp:recv(S1))) of
- {Addr,P2,#sctp_assoc_change{state=comm_up}} ->
- ok;
- {Addr,P2,#sctp_paddr_change{state=addr_confirmed,
- addr={Addr,P2},
- error=0}} ->
- {Addr,P2,#sctp_assoc_change{state=comm_up}} =
- recv_event(log_ok(gen_sctp:recv(S1)))
- end,
- ?line case log_ok(inet:sockname(S1)) of
- {Addr,P1} -> ok;
- {{0,0,0,0,0,0,0,0},P1} -> ok
- end,
- ?line case log_ok(inet:sockname(S2)) of
- {Addr,P2} -> ok;
- {{0,0,0,0,0,0,0,0},P2} -> ok
- end,
- ?line ok = gen_sctp:close(S2).
-
-active_n(doc) ->
- "Verify {active,N} socket management";
-active_n(suite) ->
- [];
+ case recv_event(log_ok(gen_sctp:recv(S1))) of
+ {Addr,P2,#sctp_assoc_change{state=comm_up}} ->
+ ok;
+ {Addr,P2,#sctp_paddr_change{state=addr_confirmed,
+ addr={Addr,P2},
+ error=0}} ->
+ {Addr,P2,#sctp_assoc_change{state=comm_up}} =
+ recv_event(log_ok(gen_sctp:recv(S1)))
+ end,
+ case log_ok(inet:sockname(S1)) of
+ {Addr,P1} -> ok;
+ {{0,0,0,0,0,0,0,0},P1} -> ok
+ end,
+ case log_ok(inet:sockname(S2)) of
+ {Addr,P2} -> ok;
+ {{0,0,0,0,0,0,0,0},P2} -> ok
+ end,
+ ok = gen_sctp:close(S2).
+
+%% Verify {active,N} socket management.
active_n(Config) when is_list(Config) ->
N = 3,
S1 = ok(gen_sctp:open([{active,N}])),
@@ -887,51 +858,45 @@ active_n(Config) when is_list(Config) ->
ok = gen_sctp:close(S1),
ok.
-basic_stream(doc) ->
- "Hello world stream socket";
-basic_stream(suite) ->
- [];
+%% Hello world stream socket.
basic_stream(Config) when is_list(Config) ->
- ?line {ok,S} = gen_sctp:open([{type,stream}]),
- ?line ok = gen_sctp:listen(S, true),
- ?line ok =
+ {ok,S} = gen_sctp:open([{type,stream}]),
+ ok = gen_sctp:listen(S, true),
+ ok =
do_from_other_process(
fun () -> gen_sctp:listen(S, 10) end),
- ?line ok = gen_sctp:close(S),
+ ok = gen_sctp:close(S),
ok.
-xfer_stream_min(doc) ->
- "Minimal data transfer";
-xfer_stream_min(suite) ->
- [];
+%% Minimal data transfer.
xfer_stream_min(Config) when is_list(Config) ->
- ?line Stream = 0,
- ?line Data = <<"The quick brown fox jumps over a lazy dog 0123456789">>,
- ?line Loopback = {127,0,0,1},
- ?line {ok,Sb} = gen_sctp:open([{type,seqpacket}]),
- ?line ?LOGVAR(Sb),
- ?line {ok,Pb} = inet:port(Sb),
- ?line ?LOGVAR(Pb),
- ?line ok = gen_sctp:listen(Sb, true),
-
- ?line {ok,Sa} = gen_sctp:open([{type,stream}]),
- ?line ?LOGVAR(Sa),
- ?line {ok,Pa} = inet:port(Sa),
- ?line ?LOGVAR(Pa),
- ?line #sctp_assoc_change{state=comm_up,
- error=0,
- outbound_streams=SaOutboundStreams,
- inbound_streams=SaInboundStreams,
- assoc_id=SaAssocId_X} =
+ Stream = 0,
+ Data = <<"The quick brown fox jumps over a lazy dog 0123456789">>,
+ Loopback = {127,0,0,1},
+ {ok,Sb} = gen_sctp:open([{type,seqpacket}]),
+ ?LOGVAR(Sb),
+ {ok,Pb} = inet:port(Sb),
+ ?LOGVAR(Pb),
+ ok = gen_sctp:listen(Sb, true),
+
+ {ok,Sa} = gen_sctp:open([{type,stream}]),
+ ?LOGVAR(Sa),
+ {ok,Pa} = inet:port(Sa),
+ ?LOGVAR(Pa),
+ #sctp_assoc_change{state=comm_up,
+ error=0,
+ outbound_streams=SaOutboundStreams,
+ inbound_streams=SaInboundStreams,
+ assoc_id=SaAssocId_X} =
log_ok(gen_sctp:connect(Sa, Loopback, Pb, [])),
- ?line ?LOGVAR(SaAssocId_X),
- ?line [{_,#sctp_paddrinfo{assoc_id=SaAssocId,state=active}}] =
+ ?LOGVAR(SaAssocId_X),
+ [{_,#sctp_paddrinfo{assoc_id=SaAssocId,state=active}}] =
log_ok(inet:getopts(Sa, [{sctp_get_peer_addr_info,
#sctp_paddrinfo{address={Loopback,Pb}}}])),
- ?line ?LOGVAR(SaAssocId),
- ?line match_unless_solaris(SaAssocId_X, SaAssocId),
+ ?LOGVAR(SaAssocId),
+ match_unless_solaris(SaAssocId_X, SaAssocId),
- ?line {SbOutboundStreams,SbInboundStreams,SbAssocId} =
+ {SbOutboundStreams,SbInboundStreams,SbAssocId} =
case recv_event(log_ok(gen_sctp:recv(Sb, infinity))) of
{Loopback,Pa,
#sctp_assoc_change{state=comm_up,
@@ -946,87 +911,87 @@ xfer_stream_min(Config) when is_list(Config) ->
error=0,
assoc_id=AI}} ->
{Loopback,Pa,
- ?line #sctp_assoc_change{state=comm_up,
- error=0,
- outbound_streams=OS,
- inbound_streams=IS,
- assoc_id=AI}} =
+ #sctp_assoc_change{state=comm_up,
+ error=0,
+ outbound_streams=OS,
+ inbound_streams=IS,
+ assoc_id=AI}} =
recv_event(log_ok(gen_sctp:recv(Sb, infinity))),
{OS,IS,AI}
end,
- ?line ?LOGVAR(SbAssocId),
- ?line SaOutboundStreams = SbInboundStreams,
- ?line ?LOGVAR(SaOutboundStreams),
- ?line SbOutboundStreams = SaInboundStreams,
- ?line ?LOGVAR(SbOutboundStreams),
- ?line ok = gen_sctp:send(Sa, SaAssocId, 0, Data),
- ?line case log_ok(gen_sctp:recv(Sb, infinity)) of
- {Loopback,
- Pa,
- [#sctp_sndrcvinfo{stream=Stream,
- assoc_id=SbAssocId}],
- Data} -> ok;
- {Loopback,
- Pa,[],
- #sctp_paddr_change{addr = {Loopback,_},
- state = addr_available,
- error = 0,
- assoc_id = SbAssocId}} ->
- {Loopback,
- Pa,
- [#sctp_sndrcvinfo{stream=Stream,
- assoc_id=SbAssocId}],
- Data} = log_ok(gen_sctp:recv(Sb, infinity));
- {Loopback,
- Pa,
- [#sctp_sndrcvinfo{stream=Stream,
- assoc_id=SbAssocId}],
- #sctp_paddr_change{addr = {Loopback,_},
- state = addr_confirmed,
- error = 0,
- assoc_id = SbAssocId}} ->
- {Loopback,
- Pa,
- [#sctp_sndrcvinfo{stream=Stream,
- assoc_id=SbAssocId}],
- Data} = log_ok(gen_sctp:recv(Sb, infinity))
- end,
- ?line ok =
+ ?LOGVAR(SbAssocId),
+ SaOutboundStreams = SbInboundStreams,
+ ?LOGVAR(SaOutboundStreams),
+ SbOutboundStreams = SaInboundStreams,
+ ?LOGVAR(SbOutboundStreams),
+ ok = gen_sctp:send(Sa, SaAssocId, 0, Data),
+ case log_ok(gen_sctp:recv(Sb, infinity)) of
+ {Loopback,
+ Pa,
+ [#sctp_sndrcvinfo{stream=Stream,
+ assoc_id=SbAssocId}],
+ Data} -> ok;
+ {Loopback,
+ Pa,[],
+ #sctp_paddr_change{addr = {Loopback,_},
+ state = addr_available,
+ error = 0,
+ assoc_id = SbAssocId}} ->
+ {Loopback,
+ Pa,
+ [#sctp_sndrcvinfo{stream=Stream,
+ assoc_id=SbAssocId}],
+ Data} = log_ok(gen_sctp:recv(Sb, infinity));
+ {Loopback,
+ Pa,
+ [#sctp_sndrcvinfo{stream=Stream,
+ assoc_id=SbAssocId}],
+ #sctp_paddr_change{addr = {Loopback,_},
+ state = addr_confirmed,
+ error = 0,
+ assoc_id = SbAssocId}} ->
+ {Loopback,
+ Pa,
+ [#sctp_sndrcvinfo{stream=Stream,
+ assoc_id=SbAssocId}],
+ Data} = log_ok(gen_sctp:recv(Sb, infinity))
+ end,
+ ok =
do_from_other_process(
fun () -> gen_sctp:send(Sb, SbAssocId, 0, Data) end),
- ?line case log_ok(gen_sctp:recv(Sa, infinity)) of
- {Loopback,Pb,
- [#sctp_sndrcvinfo{stream=Stream,
- assoc_id=SaAssocId}],
- Data} -> ok;
- Event1 ->
- ?line {Loopback,Pb,
- #sctp_paddr_change{state=addr_confirmed,
- addr={_,Pb},
- error=0,
- assoc_id=SaAssocId}} =
- recv_event(Event1),
- ?line {Loopback,Pb,
- [#sctp_sndrcvinfo{stream=Stream,
- assoc_id=SaAssocId}],
- Data} =
- log_ok(gen_sctp:recv(Sa, infinity))
- end,
- ?line ok = gen_sctp:close(Sa),
- ?line {Loopback,Pa,
- #sctp_shutdown_event{assoc_id=SbAssocId}} =
+ case log_ok(gen_sctp:recv(Sa, infinity)) of
+ {Loopback,Pb,
+ [#sctp_sndrcvinfo{stream=Stream,
+ assoc_id=SaAssocId}],
+ Data} -> ok;
+ Event1 ->
+ {Loopback,Pb,
+ #sctp_paddr_change{state=addr_confirmed,
+ addr={_,Pb},
+ error=0,
+ assoc_id=SaAssocId}} =
+ recv_event(Event1),
+ {Loopback,Pb,
+ [#sctp_sndrcvinfo{stream=Stream,
+ assoc_id=SaAssocId}],
+ Data} =
+ log_ok(gen_sctp:recv(Sa, infinity))
+ end,
+ ok = gen_sctp:close(Sa),
+ {Loopback,Pa,
+ #sctp_shutdown_event{assoc_id=SbAssocId}} =
recv_event(log_ok(gen_sctp:recv(Sb, infinity))),
- ?line {Loopback,Pa,
- #sctp_assoc_change{state=shutdown_comp,
- error=0,
- assoc_id=SbAssocId}} =
+ {Loopback,Pa,
+ #sctp_assoc_change{state=shutdown_comp,
+ error=0,
+ assoc_id=SbAssocId}} =
recv_event(log_ok(gen_sctp:recv(Sb, infinity))),
- ?line ok = gen_sctp:close(Sb),
+ ok = gen_sctp:close(Sb),
- ?line receive
- Msg -> test_server:fail({received,Msg})
- after 17 -> ok
- end,
+ receive
+ Msg -> ct:fail({received,Msg})
+ after 17 -> ok
+ end,
ok.
@@ -1058,205 +1023,184 @@ do_from_other_process(Fun) ->
end.
-peeloff_active_once(doc) ->
- "Peel off an SCTP stream socket ({active,once})";
-peeloff_active_once(suite) ->
- [];
+%% Peel off an SCTP stream socket ({active,once}).
peeloff_active_once(Config) ->
peeloff(Config, [{active,once}]).
-peeloff_active_true(doc) ->
- "Peel off an SCTP stream socket ({active,true})";
-peeloff_active_true(suite) ->
- [];
+%% Peel off an SCTP stream socket ({active,true}).
peeloff_active_true(Config) ->
peeloff(Config, [{active,true}]).
-peeloff_active_n(doc) ->
- "Peel off an SCTP stream socket ({active,N})";
-peeloff_active_n(suite) ->
- [];
+%% Peel off an SCTP stream socket ({active,N}).
peeloff_active_n(Config) ->
peeloff(Config, [{active,1}]).
peeloff(Config, SockOpts) when is_list(Config) ->
- ?line Addr = {127,0,0,1},
- ?line Stream = 0,
- ?line Timeout = 333,
- ?line S1 = socket_open([{ifaddr,Addr}|SockOpts], Timeout),
- ?line ?LOGVAR(S1),
- ?line P1 = socket_call(S1, get_port),
- ?line ?LOGVAR(P1),
- ?line Socket1 = socket_call(S1, get_socket),
- ?line ?LOGVAR(Socket1),
- ?line socket_call(S1, {listen,true}),
- ?line S2 = socket_open([{ifaddr,Addr}|SockOpts], Timeout),
- ?line ?LOGVAR(S2),
- ?line P2 = socket_call(S2, get_port),
- ?line ?LOGVAR(P2),
- ?line Socket2 = socket_call(S2, get_socket),
- ?line ?LOGVAR(Socket2),
+ Addr = {127,0,0,1},
+ Stream = 0,
+ Timeout = 333,
+ S1 = socket_open([{ifaddr,Addr}|SockOpts], Timeout),
+ ?LOGVAR(S1),
+ P1 = socket_call(S1, get_port),
+ ?LOGVAR(P1),
+ Socket1 = socket_call(S1, get_socket),
+ ?LOGVAR(Socket1),
+ socket_call(S1, {listen,true}),
+ S2 = socket_open([{ifaddr,Addr}|SockOpts], Timeout),
+ ?LOGVAR(S2),
+ P2 = socket_call(S2, get_port),
+ ?LOGVAR(P2),
+ Socket2 = socket_call(S2, get_socket),
+ ?LOGVAR(Socket2),
%%
- ?line socket_call(S2, {connect_init,Addr,P1,[]}),
- ?line S2Ai =
+ socket_call(S2, {connect_init,Addr,P1,[]}),
+ S2Ai =
receive
{S2,{Addr,P1,
#sctp_assoc_change{
- state=comm_up,
- assoc_id=AssocId2}}} -> AssocId2
+ state=comm_up,
+ assoc_id=AssocId2}}} -> AssocId2
after Timeout ->
socket_bailout([S1,S2])
end,
- ?line ?LOGVAR(S2Ai),
- ?line S1Ai =
+ ?LOGVAR(S2Ai),
+ S1Ai =
receive
{S1,{Addr,P2,
#sctp_assoc_change{
- state=comm_up,
- assoc_id=AssocId1}}} -> AssocId1
+ state=comm_up,
+ assoc_id=AssocId1}}} -> AssocId1
after Timeout ->
socket_bailout([S1,S2])
end,
- ?line ?LOGVAR(S1Ai),
+ ?LOGVAR(S1Ai),
%%
- ?line socket_call(S2, {send,S2Ai,Stream,<<"Number one">>}),
- ?line
- receive
- {S1,{Addr,P2,S1Ai,Stream,<<"Number one">>}} -> ok
- after Timeout ->
- socket_bailout([S1,S2])
- end,
- ?line socket_call(S2, {send,Socket1,S1Ai,Stream,<<"Number two">>}),
- ?line
- receive
- {S2,{Addr,P1,S2Ai,Stream,<<"Number two">>}} -> ok
- after Timeout ->
- socket_bailout([S1,S2])
- end,
+ socket_call(S2, {send,S2Ai,Stream,<<"Number one">>}),
+ receive
+ {S1,{Addr,P2,S1Ai,Stream,<<"Number one">>}} -> ok
+ after Timeout ->
+ socket_bailout([S1,S2])
+ end,
+ socket_call(S2, {send,Socket1,S1Ai,Stream,<<"Number two">>}),
+ receive
+ {S2,{Addr,P1,S2Ai,Stream,<<"Number two">>}} -> ok
+ after Timeout ->
+ socket_bailout([S1,S2])
+ end,
%%
- ?line S3 = socket_peeloff(Socket1, S1Ai, SockOpts, Timeout),
- ?line ?LOGVAR(S3),
- ?line P3_X = socket_call(S3, get_port),
- ?line ?LOGVAR(P3_X),
- ?line P3 = case P3_X of 0 -> P1; _ -> P3_X end,
- ?line [{_,#sctp_paddrinfo{assoc_id=S3Ai,state=active}}] =
+ S3 = socket_peeloff(Socket1, S1Ai, SockOpts, Timeout),
+ ?LOGVAR(S3),
+ P3_X = socket_call(S3, get_port),
+ ?LOGVAR(P3_X),
+ P3 = case P3_X of 0 -> P1; _ -> P3_X end,
+ [{_,#sctp_paddrinfo{assoc_id=S3Ai,state=active}}] =
socket_call(S3,
{getopts,[{sctp_get_peer_addr_info,
#sctp_paddrinfo{address={Addr,P2}}}]}),
- %%?line S3Ai = S1Ai,
- ?line ?LOGVAR(S3Ai),
+ %%S3Ai = S1Ai,
+ ?LOGVAR(S3Ai),
%%
- ?line socket_call(S3, {send,S3Ai,Stream,<<"Number three">>}),
- ?line
- receive
- {S2,{Addr,P3,S2Ai,Stream,<<"Number three">>}} -> ok
- after Timeout ->
- socket_bailout([S1,S2,S3])
- end,
- ?line socket_call(S3, {send,Socket2,S2Ai,Stream,<<"Number four">>}),
- ?line
- receive
- {S3,{Addr,P2,S3Ai,Stream,<<"Number four">>}} -> ok
- after Timeout ->
- socket_bailout([S1,S2,S3])
- end,
+ socket_call(S3, {send,S3Ai,Stream,<<"Number three">>}),
+ receive
+ {S2,{Addr,P3,S2Ai,Stream,<<"Number three">>}} -> ok
+ after Timeout ->
+ socket_bailout([S1,S2,S3])
+ end,
+ socket_call(S3, {send,Socket2,S2Ai,Stream,<<"Number four">>}),
+ receive
+ {S3,{Addr,P2,S3Ai,Stream,<<"Number four">>}} -> ok
+ after Timeout ->
+ socket_bailout([S1,S2,S3])
+ end,
%%
- ?line inet:i(sctp),
- ?line socket_close_verbose(S1),
- ?line socket_close_verbose(S2),
- ?line
- receive
- {S3,{Addr,P2,#sctp_shutdown_event{assoc_id=S3Ai_X}}} ->
- ?line match_unless_solaris(S3Ai, S3Ai_X)
- after Timeout ->
- socket_bailout([S3])
- end,
- ?line
- receive
- {S3,{Addr,P2,#sctp_assoc_change{state=shutdown_comp,
- assoc_id=S3Ai}}} -> ok
- after Timeout ->
- socket_bailout([S3])
- end,
- ?line socket_close_verbose(S3),
- ?line [] = flush(),
+ inet:i(sctp),
+ socket_close_verbose(S1),
+ socket_close_verbose(S2),
+ receive
+ {S3,{Addr,P2,#sctp_shutdown_event{assoc_id=S3Ai_X}}} ->
+ match_unless_solaris(S3Ai, S3Ai_X)
+ after Timeout ->
+ socket_bailout([S3])
+ end,
+ receive
+ {S3,{Addr,P2,#sctp_assoc_change{state=shutdown_comp,
+ assoc_id=S3Ai}}} -> ok
+ after Timeout ->
+ socket_bailout([S3])
+ end,
+ socket_close_verbose(S3),
+ [] = flush(),
ok.
-buffers(doc) ->
- ["Check sndbuf and recbuf behaviour"];
-buffers(suite) ->
- [];
+%% Check sndbuf and recbuf behaviour.
buffers(Config) when is_list(Config) ->
- ?line Limit = 4096,
- ?line Addr = {127,0,0,1},
- ?line Stream = 1,
- ?line Timeout = 3333,
- ?line S1 = socket_open([{ip,Addr}], Timeout),
- ?line ?LOGVAR(S1),
- ?line P1 = socket_call(S1, get_port),
- ?line ?LOGVAR(P1),
- ?line ok = socket_call(S1, {listen,true}),
- ?line S2 = socket_open([{ip,Addr}], Timeout),
- ?line ?LOGVAR(S2),
- ?line P2 = socket_call(S2, get_port),
- ?line ?LOGVAR(P2),
+ Limit = 4096,
+ Addr = {127,0,0,1},
+ Stream = 1,
+ Timeout = 3333,
+ S1 = socket_open([{ip,Addr}], Timeout),
+ ?LOGVAR(S1),
+ P1 = socket_call(S1, get_port),
+ ?LOGVAR(P1),
+ ok = socket_call(S1, {listen,true}),
+ S2 = socket_open([{ip,Addr}], Timeout),
+ ?LOGVAR(S2),
+ P2 = socket_call(S2, get_port),
+ ?LOGVAR(P2),
%%
- ?line socket_call(S2, {connect_init,Addr,P1,[]}),
- ?line S2Ai =
+ socket_call(S2, {connect_init,Addr,P1,[]}),
+ S2Ai =
receive
{S2,{Addr,P1,
#sctp_assoc_change{
- state=comm_up,
- assoc_id=AssocId2}}} -> AssocId2
+ state=comm_up,
+ assoc_id=AssocId2}}} -> AssocId2
after Timeout ->
socket_bailout([S1,S2])
end,
- ?line S1Ai =
+ S1Ai =
receive
{S1,{Addr,P2,
#sctp_assoc_change{
- state=comm_up,
- assoc_id=AssocId1}}} -> AssocId1
+ state=comm_up,
+ assoc_id=AssocId1}}} -> AssocId1
after Timeout ->
socket_bailout([S1,S2])
end,
%%
- ?line socket_call(S1, {setopts,[{recbuf,Limit}]}),
- ?line Recbuf =
+ socket_call(S1, {setopts,[{recbuf,Limit}]}),
+ Recbuf =
case socket_call(S1, {getopts,[recbuf]}) of
[{recbuf,RB1}] when RB1 >= Limit -> RB1
end,
- ?line Data = mk_data(Recbuf+Limit),
- ?line socket_call(S2, {setopts,[{sndbuf,Recbuf+Limit}]}),
- ?line socket_call(S2, {send,S2Ai,Stream,Data}),
- ?line
- receive
- {S1,{Addr,P2,S1Ai,Stream,Data}} -> ok
- after Timeout ->
- socket_bailout([S1,S2])
- end,
+ Data = mk_data(Recbuf+Limit),
+ socket_call(S2, {setopts,[{sndbuf,Recbuf+Limit}]}),
+ socket_call(S2, {send,S2Ai,Stream,Data}),
+ receive
+ {S1,{Addr,P2,S1Ai,Stream,Data}} -> ok
+ after Timeout ->
+ socket_bailout([S1,S2])
+ end,
%%
- ?line socket_close_verbose(S1),
- ?line
- receive
- {S2,{Addr,P1,#sctp_shutdown_event{assoc_id=S2Ai}}} -> ok
- after Timeout ->
- socket_bailout([S2])
- end,
- ?line
- receive
- {S2,{Addr,P1,#sctp_assoc_change{state=shutdown_comp,
- assoc_id=S2Ai}}} -> ok
- after Timeout ->
- socket_bailout([S2])
- end,
- ?line socket_close_verbose(S2),
- ?line [] = flush(),
+ socket_close_verbose(S1),
+ receive
+ {S2,{Addr,P1,#sctp_shutdown_event{assoc_id=S2Ai}}} -> ok
+ after Timeout ->
+ socket_bailout([S2])
+ end,
+ receive
+ {S2,{Addr,P1,#sctp_assoc_change{state=shutdown_comp,
+ assoc_id=S2Ai}}} -> ok
+ after Timeout ->
+ socket_bailout([S2])
+ end,
+ socket_close_verbose(S2),
+ [] = flush(),
ok.
mk_data(Bytes) ->
@@ -1269,153 +1213,129 @@ mk_data(_, _, Bin) ->
-open_multihoming_ipv4_socket(doc) ->
- "Test opening a multihoming ipv4 socket";
-open_multihoming_ipv4_socket(suite) ->
- [];
+%% Test opening a multihoming ipv4 socket.
open_multihoming_ipv4_socket(Config) when is_list(Config) ->
- ?line case get_addrs_by_family(inet, 2) of
- {ok, [Addr1, Addr2]} ->
- ?line do_open_and_connect([Addr1, Addr2], Addr1);
- {error, Reason} ->
- {skip, Reason}
- end.
-
-open_unihoming_ipv6_socket(doc) ->
- %% This test is mostly aimed to indicate
- %% whether host has a non-working ipv6 setup
- "Test opening a unihoming (non-multihoming) ipv6 socket";
-open_unihoming_ipv6_socket(suite) ->
- [];
+ case get_addrs_by_family(inet, 2) of
+ {ok, [Addr1, Addr2]} ->
+ do_open_and_connect([Addr1, Addr2], Addr1);
+ {error, Reason} ->
+ {skip, Reason}
+ end.
+
+%% This test is mostly aimed to indicate whether host has a
+%% non-working ipv6 setup. Test opening a unihoming (non-multihoming)
+%% ipv6 socket.
open_unihoming_ipv6_socket(Config) when is_list(Config) ->
- ?line case get_addrs_by_family(inet6, 1) of
- {ok, [Addr]} ->
- ?line do_open_and_connect([Addr], Addr);
- {error, Reason} ->
- {skip, Reason}
- end.
-
-
-open_multihoming_ipv6_socket(doc) ->
- "Test opening a multihoming ipv6 socket";
-open_multihoming_ipv6_socket(suite) ->
- [];
+ case get_addrs_by_family(inet6, 1) of
+ {ok, [Addr]} ->
+ do_open_and_connect([Addr], Addr);
+ {error, Reason} ->
+ {skip, Reason}
+ end.
+
+
+%% Test opening a multihoming ipv6 socket.
open_multihoming_ipv6_socket(Config) when is_list(Config) ->
- ?line case get_addrs_by_family(inet6, 2) of
- {ok, [Addr1, Addr2]} ->
- ?line do_open_and_connect([Addr1, Addr2], Addr1);
- {error, Reason} ->
- {skip, Reason}
- end.
-
-open_multihoming_ipv4_and_ipv6_socket(doc) ->
- "Test opening a multihoming ipv6 socket with ipv4 and ipv6 addresses";
-open_multihoming_ipv4_and_ipv6_socket(suite) ->
- [];
+ case get_addrs_by_family(inet6, 2) of
+ {ok, [Addr1, Addr2]} ->
+ do_open_and_connect([Addr1, Addr2], Addr1);
+ {error, Reason} ->
+ {skip, Reason}
+ end.
+
+%% Test opening a multihoming ipv6 socket with ipv4 and ipv6 addresses.
open_multihoming_ipv4_and_ipv6_socket(Config) when is_list(Config) ->
- ?line case get_addrs_by_family(inet_and_inet6, 2) of
- {ok, [[InetAddr1, InetAddr2], [Inet6Addr1, Inet6Addr2]]} ->
- %% Connect to the first address to test bind
- ?line do_open_and_connect([InetAddr1, Inet6Addr1, InetAddr2],
- InetAddr1),
- ?line do_open_and_connect([Inet6Addr1, InetAddr1],
- Inet6Addr1),
-
- %% Connect an address, not the first,
- %% to test sctp_bindx
- ?line do_open_and_connect([Inet6Addr1, Inet6Addr2, InetAddr1],
- Inet6Addr2),
- ?line do_open_and_connect([Inet6Addr1, Inet6Addr2, InetAddr1],
- InetAddr1);
- {error, Reason} ->
- {skip, Reason}
- end.
-
-names_unihoming_ipv4(doc) ->
- "Test inet:socknames/peernames on unihoming IPv4 sockets";
-names_unihoming_ipv4(suite) ->
- [];
+ case get_addrs_by_family(inet_and_inet6, 2) of
+ {ok, [[InetAddr1, InetAddr2], [Inet6Addr1, Inet6Addr2]]} ->
+ %% Connect to the first address to test bind
+ do_open_and_connect([InetAddr1, Inet6Addr1, InetAddr2],
+ InetAddr1),
+ do_open_and_connect([Inet6Addr1, InetAddr1],
+ Inet6Addr1),
+
+ %% Connect an address, not the first,
+ %% to test sctp_bindx
+ do_open_and_connect([Inet6Addr1, Inet6Addr2, InetAddr1],
+ Inet6Addr2),
+ do_open_and_connect([Inet6Addr1, Inet6Addr2, InetAddr1],
+ InetAddr1);
+ {error, Reason} ->
+ {skip, Reason}
+ end.
+
+%% Test inet:socknames/peernames on unihoming IPv4 sockets.
names_unihoming_ipv4(Config) when is_list(Config) ->
- ?line do_names(Config, inet, 1).
+ do_names(Config, inet, 1).
-names_unihoming_ipv6(doc) ->
- "Test inet:socknames/peernames on unihoming IPv6 sockets";
-names_unihoming_ipv6(suite) ->
- [];
+%% Test inet:socknames/peernames on unihoming IPv6 sockets.
names_unihoming_ipv6(Config) when is_list(Config) ->
- ?line do_names(Config, inet6, 1).
+ do_names(Config, inet6, 1).
-names_multihoming_ipv4(doc) ->
- "Test inet:socknames/peernames on multihoming IPv4 sockets";
-names_multihoming_ipv4(suite) ->
- [];
+%% Test inet:socknames/peernames on multihoming IPv4 sockets.
names_multihoming_ipv4(Config) when is_list(Config) ->
- ?line do_names(Config, inet, 2).
+ do_names(Config, inet, 2).
-names_multihoming_ipv6(doc) ->
- "Test inet:socknames/peernames on multihoming IPv6 sockets";
-names_multihoming_ipv6(suite) ->
- [];
+%% Test inet:socknames/peernames on multihoming IPv6 sockets.
names_multihoming_ipv6(Config) when is_list(Config) ->
- ?line do_names(Config, inet6, 2).
+ do_names(Config, inet6, 2).
do_names(_, FamilySpec, AddressCount) ->
Fun =
fun (ServerSocket, _, ServerAssoc, ClientSocket, _, ClientAssoc) ->
- ?line ServerSocknamesNoassoc =
+ ServerSocknamesNoassoc =
lists:sort(ok(inet:socknames(ServerSocket))),
- ?line ?LOGVAR(ServerSocknamesNoassoc),
- ?line ServerSocknames =
+ ?LOGVAR(ServerSocknamesNoassoc),
+ ServerSocknames =
lists:sort(ok(inet:socknames(ServerSocket, ServerAssoc))),
- ?line ?LOGVAR(ServerSocknames),
- ?line [_|_] =
+ ?LOGVAR(ServerSocknames),
+ [_|_] =
ordsets:intersection
(ServerSocknamesNoassoc, ServerSocknames),
- ?line ClientSocknamesNoassoc =
+ ClientSocknamesNoassoc =
lists:sort(ok(inet:socknames(ClientSocket))),
- ?line ?LOGVAR(ClientSocknamesNoassoc),
- ?line ClientSocknames =
+ ?LOGVAR(ClientSocknamesNoassoc),
+ ClientSocknames =
lists:sort(ok(inet:socknames(ClientSocket, ClientAssoc))),
- ?line ?LOGVAR(ClientSocknames),
- ?line [_|_] =
+ ?LOGVAR(ClientSocknames),
+ [_|_] =
ordsets:intersection
(ClientSocknamesNoassoc, ClientSocknames),
- ?line err([einval,enotconn], inet:peernames(ServerSocket)),
- ?line ServerPeernames =
+ err([einval,enotconn], inet:peernames(ServerSocket)),
+ ServerPeernames =
lists:sort(ok(inet:peernames(ServerSocket, ServerAssoc))),
- ?line ?LOGVAR(ServerPeernames),
- ?line err([einval,enotconn], inet:peernames(ClientSocket)),
- ?line ClientPeernames =
+ ?LOGVAR(ServerPeernames),
+ err([einval,enotconn], inet:peernames(ClientSocket)),
+ ClientPeernames =
lists:sort(ok(inet:peernames(ClientSocket, ClientAssoc))),
- ?line ?LOGVAR(ClientPeernames),
- ?line ServerSocknames = ClientPeernames,
- ?line ClientSocknames = ServerPeernames,
- ?line {ok,Socket} =
+ ?LOGVAR(ClientPeernames),
+ ServerSocknames = ClientPeernames,
+ ClientSocknames = ServerPeernames,
+ {ok,Socket} =
gen_sctp:peeloff(ServerSocket, ServerAssoc),
- ?line SocknamesNoassoc =
+ SocknamesNoassoc =
lists:sort(ok(inet:socknames(Socket))),
- ?line ?LOGVAR(SocknamesNoassoc),
- ?line Socknames =
+ ?LOGVAR(SocknamesNoassoc),
+ Socknames =
lists:sort(ok(inet:socknames(Socket, ServerAssoc))),
- ?line ?LOGVAR(Socknames),
- ?line true =
+ ?LOGVAR(Socknames),
+ true =
ordsets:is_subset(SocknamesNoassoc, Socknames),
- ?line Peernames =
+ Peernames =
lists:sort(ok(inet:peernames(Socket, ServerAssoc))),
- ?line ?LOGVAR(Peernames),
- ?line ok = gen_sctp:close(Socket),
- ?line Socknames = ClientPeernames,
- ?line ClientSocknames = Peernames,
+ ?LOGVAR(Peernames),
+ ok = gen_sctp:close(Socket),
+ Socknames = ClientPeernames,
+ ClientSocknames = Peernames,
ok
end,
- ?line case get_addrs_by_family(FamilySpec, AddressCount) of
- {ok, Addresses} when length(Addresses) =:= AddressCount ->
- ?line do_open_and_connect(Addresses, hd(Addresses), Fun);
- {error, Reason} ->
- {skip, Reason}
- end.
+ case get_addrs_by_family(FamilySpec, AddressCount) of
+ {ok, Addresses} when length(Addresses) =:= AddressCount ->
+ do_open_and_connect(Addresses, hd(Addresses), Fun);
+ {error, Reason} ->
+ {skip, Reason}
+ end.
@@ -1451,29 +1371,28 @@ get_addrs_by_family(Family, NumAddrs) ->
get_addrs_by_family_aux(Family, NumAddrs) when Family =:= inet;
Family =:= inet6 ->
- ?line
- case inet:getaddr(localhost, Family) of
- {error,eafnosupport} ->
- {skip, f("No support for ~p", Family)};
- {ok, _} ->
- ?line IfAddrs = ok(inet:getifaddrs()),
- ?line case filter_addrs_by_family(IfAddrs, Family) of
- Addrs when length(Addrs) >= NumAddrs ->
- {ok, lists:sublist(Addrs, NumAddrs)};
- [] ->
- {error, f("Need ~p ~p address(es) found none~n",
- [NumAddrs, Family])};
- Addrs ->
- {error,
- f("Need ~p ~p address(es) found only ~p: ~p~n",
- [NumAddrs, Family, length(Addrs), Addrs])}
- end
- end;
+ case inet:getaddr(localhost, Family) of
+ {error,eafnosupport} ->
+ {skip, f("No support for ~p", Family)};
+ {ok, _} ->
+ IfAddrs = ok(inet:getifaddrs()),
+ case filter_addrs_by_family(IfAddrs, Family) of
+ Addrs when length(Addrs) >= NumAddrs ->
+ {ok, lists:sublist(Addrs, NumAddrs)};
+ [] ->
+ {error, f("Need ~p ~p address(es) found none~n",
+ [NumAddrs, Family])};
+ Addrs ->
+ {error,
+ f("Need ~p ~p address(es) found only ~p: ~p~n",
+ [NumAddrs, Family, length(Addrs), Addrs])}
+ end
+ end;
get_addrs_by_family_aux(inet_and_inet6, NumAddrs) ->
- ?line catch {ok, [case get_addrs_by_family_aux(Family, NumAddrs) of
- {ok, Addrs} -> Addrs;
- {error, Reason} -> throw({error, Reason})
- end || Family <- [inet, inet6]]}.
+ catch {ok, [case get_addrs_by_family_aux(Family, NumAddrs) of
+ {ok, Addrs} -> Addrs;
+ {error, Reason} -> throw({error, Reason})
+ end || Family <- [inet, inet6]]}.
filter_addrs_by_family(IfAddrs, Family) ->
lists:flatten([[Addr || {addr, Addr} <- Info,
@@ -1502,21 +1421,21 @@ f(F, A) ->
lists:flatten(io_lib:format(F, A)).
do_open_and_connect(ServerAddresses, AddressToConnectTo) ->
- ?line Fun = fun (_, _, _, _, _, _) -> ok end,
- ?line do_open_and_connect(ServerAddresses, AddressToConnectTo, Fun).
+ Fun = fun (_, _, _, _, _, _) -> ok end,
+ do_open_and_connect(ServerAddresses, AddressToConnectTo, Fun).
%%
do_open_and_connect(ServerAddresses, AddressToConnectTo, Fun) ->
- ?line ServerFamily = get_family_by_addrs(ServerAddresses),
- ?line io:format("Serving ~p addresses: ~p~n",
- [ServerFamily, ServerAddresses]),
- ?line S1 = ok(gen_sctp:open(0, [{ip,Addr} || Addr <- ServerAddresses] ++
- [ServerFamily])),
- ?line ok = gen_sctp:listen(S1, true),
- ?line P1 = ok(inet:port(S1)),
- ?line ClientFamily = get_family_by_addr(AddressToConnectTo),
- ?line io:format("Connecting to ~p ~p~n",
- [ClientFamily, AddressToConnectTo]),
- ?line ClientOpts =
+ ServerFamily = get_family_by_addrs(ServerAddresses),
+ io:format("Serving ~p addresses: ~p~n",
+ [ServerFamily, ServerAddresses]),
+ S1 = ok(gen_sctp:open(0, [{ip,Addr} || Addr <- ServerAddresses] ++
+ [ServerFamily])),
+ ok = gen_sctp:listen(S1, true),
+ P1 = ok(inet:port(S1)),
+ ClientFamily = get_family_by_addr(AddressToConnectTo),
+ io:format("Connecting to ~p ~p~n",
+ [ClientFamily, AddressToConnectTo]),
+ ClientOpts =
[ClientFamily |
case ClientFamily of
inet6 ->
@@ -1524,39 +1443,39 @@ do_open_and_connect(ServerAddresses, AddressToConnectTo, Fun) ->
_ ->
[]
end],
- ?line S2 = ok(gen_sctp:open(0, ClientOpts)),
+ S2 = ok(gen_sctp:open(0, ClientOpts)),
log(open),
%% Verify client can connect
- ?line #sctp_assoc_change{state=comm_up} = S2Assoc =
+ #sctp_assoc_change{state=comm_up} = S2Assoc =
ok(gen_sctp:connect(S2, AddressToConnectTo, P1, [])),
log(comm_up),
%% verify server side also receives comm_up from client
- ?line S1Assoc = recv_comm_up_eventually(S1),
- ?line Result = Fun(S1, ServerFamily, S1Assoc, S2, ClientFamily, S2Assoc),
- ?line ok = gen_sctp:close(S2),
- ?line ok = gen_sctp:close(S1),
+ S1Assoc = recv_comm_up_eventually(S1),
+ Result = Fun(S1, ServerFamily, S1Assoc, S2, ClientFamily, S2Assoc),
+ ok = gen_sctp:close(S2),
+ ok = gen_sctp:close(S1),
Result.
%% If at least one of the addresses is an ipv6 address, return inet6, else inet.
get_family_by_addrs(Addresses) ->
- ?line case lists:usort([get_family_by_addr(Addr) || Addr <- Addresses]) of
- [inet, inet6] -> inet6;
- [inet] -> inet;
- [inet6] -> inet6
- end.
+ case lists:usort([get_family_by_addr(Addr) || Addr <- Addresses]) of
+ [inet, inet6] -> inet6;
+ [inet] -> inet;
+ [inet6] -> inet6
+ end.
get_family_by_addr(Addr) when tuple_size(Addr) =:= 4 -> inet;
get_family_by_addr(Addr) when tuple_size(Addr) =:= 8 -> inet6.
recv_comm_up_eventually(S) ->
- ?line case ok(gen_sctp:recv(S)) of
- {_Addr, _Port, _Info,
- #sctp_assoc_change{state=comm_up} = Assoc} ->
- Assoc;
- {_Addr, _Port, _Info, _OtherSctpMsg} = Msg ->
- ?line log({unexpected,Msg}),
- ?line recv_comm_up_eventually(S)
- end.
+ case ok(gen_sctp:recv(S)) of
+ {_Addr, _Port, _Info,
+ #sctp_assoc_change{state=comm_up} = Assoc} ->
+ Assoc;
+ {_Addr, _Port, _Info, _OtherSctpMsg} = Msg ->
+ log({unexpected,Msg}),
+ recv_comm_up_eventually(S)
+ end.
%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% socket gen_server ultra light
@@ -1609,7 +1528,7 @@ socket_bailout([S|Ss]) ->
socket_bailout(Ss);
socket_bailout([]) ->
io:format("flush: ~p.~n", [flush()]),
- test_server:fail(socket_bailout).
+ ct:fail(socket_bailout).
socket_history({State,Flush}) ->
{lists:keysort(
@@ -1697,8 +1616,8 @@ s_loop(Socket, Timeout, Parent, Handler, State) ->
case gb_get({assoc_change,AssocId}, State) of
[{_,{Addr,Port,
#sctp_assoc_change{
- state=comm_up,
- inbound_streams=Is}}}|_]
+ state=comm_up,
+ inbound_streams=Is}}}|_]
when 0 =< Stream, Stream < Is-> ok;
[] -> ok
end,
diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl
index 962471c20c..4d829bcac6 100644
--- a/lib/kernel/test/gen_tcp_api_SUITE.erl
+++ b/lib/kernel/test/gen_tcp_api_SUITE.erl
@@ -38,7 +38,9 @@
-export([getsockfd/0,closesockfd/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[{group, t_accept}, {group, t_connect}, {group, t_recv},
@@ -65,74 +67,67 @@ end_per_group(_,_Config) ->
ok.
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:seconds(60)),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+ Config.
+
+end_per_testcase(_Func, _Config) ->
+ ok.
%%% gen_tcp:accept/1,2
-t_accept_timeout(doc) -> "Test that gen_tcp:accept/2 (with timeout) works.";
-t_accept_timeout(suite) -> [];
+%% Test that gen_tcp:accept/2 (with timeout) works.
t_accept_timeout(Config) when is_list(Config) ->
- ?line {ok, L} = gen_tcp:listen(0, []),
- ?line timeout({gen_tcp, accept, [L, 200]}, 0.2, 1.0).
+ {ok, L} = gen_tcp:listen(0, []),
+ timeout({gen_tcp, accept, [L, 200]}, 0.2, 1.0).
%%% gen_tcp:connect/X
-t_connect_timeout(doc) -> "Test that gen_tcp:connect/4 (with timeout) works.";
+%% Test that gen_tcp:connect/4 (with timeout) works.
t_connect_timeout(Config) when is_list(Config) ->
- %%?line BadAddr = {134,138,177,16},
- %%?line TcpPort = 80,
- ?line {ok, BadAddr} = unused_ip(),
- ?line TcpPort = 45638,
- ?line ok = io:format("Connecting to ~p, port ~p", [BadAddr, TcpPort]),
- ?line connect_timeout({gen_tcp,connect,[BadAddr,TcpPort,[],200]}, 0.2, 5.0).
-
-t_connect_bad(doc) ->
- ["Test that gen_tcp:connect/3 handles non-existings hosts, and other ",
- "invalid things."];
-t_connect_bad(suite) -> [];
+ %%BadAddr = {134,138,177,16},
+ %%TcpPort = 80,
+ {ok, BadAddr} = unused_ip(),
+ TcpPort = 45638,
+ ok = io:format("Connecting to ~p, port ~p", [BadAddr, TcpPort]),
+ connect_timeout({gen_tcp,connect,[BadAddr,TcpPort,[],200]}, 0.2, 5.0).
+
+%% Test that gen_tcp:connect/3 handles non-existings hosts, and other
+%% invalid things.
t_connect_bad(Config) when is_list(Config) ->
- ?line NonExistingPort = 45638, % Not in use, I hope.
- ?line {error, Reason1} = gen_tcp:connect(localhost, NonExistingPort, []),
- ?line io:format("Error for connection attempt to port not in use: ~p",
- [Reason1]),
-
- ?line {error, Reason2} = gen_tcp:connect("non-existing-host-xxx", 7, []),
- ?line io:format("Error for connection attempt to non-existing host: ~p",
- [Reason2]),
+ NonExistingPort = 45638, % Not in use, I hope.
+ {error, Reason1} = gen_tcp:connect(localhost, NonExistingPort, []),
+ io:format("Error for connection attempt to port not in use: ~p",
+ [Reason1]),
+
+ {error, Reason2} = gen_tcp:connect("non-existing-host-xxx", 7, []),
+ io:format("Error for connection attempt to non-existing host: ~p",
+ [Reason2]),
ok.
%%% gen_tcp:recv/X
-t_recv_timeout(doc) -> "Test that gen_tcp:recv/3 (with timeout works).";
-t_recv_timeout(suite) -> [];
+%% Test that gen_tcp:recv/3 (with timeout works).
t_recv_timeout(Config) when is_list(Config) ->
- ?line {ok, L} = gen_tcp:listen(0, []),
- ?line {ok, Port} = inet:port(L),
- ?line {ok, Client} = gen_tcp:connect(localhost, Port, [{active, false}]),
- ?line {ok, _A} = gen_tcp:accept(L),
- ?line timeout({gen_tcp, recv, [Client, 0, 200]}, 0.2, 5.0).
-
-t_recv_eof(doc) -> "Test that end of file on a socket is reported correctly.";
-t_recv_eof(suite) -> [];
+ {ok, L} = gen_tcp:listen(0, []),
+ {ok, Port} = inet:port(L),
+ {ok, Client} = gen_tcp:connect(localhost, Port, [{active, false}]),
+ {ok, _A} = gen_tcp:accept(L),
+ timeout({gen_tcp, recv, [Client, 0, 200]}, 0.2, 5.0).
+
+%% Test that end of file on a socket is reported correctly.
t_recv_eof(Config) when is_list(Config) ->
- ?line {ok, L} = gen_tcp:listen(0, []),
- ?line {ok, Port} = inet:port(L),
- ?line {ok, Client} = gen_tcp:connect(localhost, Port, [{active, false}]),
- ?line {ok, A} = gen_tcp:accept(L),
- ?line ok = gen_tcp:close(A),
- ?line {error, closed} = gen_tcp:recv(Client, 0),
+ {ok, L} = gen_tcp:listen(0, []),
+ {ok, Port} = inet:port(L),
+ {ok, Client} = gen_tcp:connect(localhost, Port, [{active, false}]),
+ {ok, A} = gen_tcp:accept(L),
+ ok = gen_tcp:close(A),
+ {error, closed} = gen_tcp:recv(Client, 0),
ok.
-t_recv_delim(doc) -> "Test using message delimiter $X";
-t_recv_delim(suite) -> [];
+%% Test using message delimiter $X.
t_recv_delim(Config) when is_list(Config) ->
{ok, L} = gen_tcp:listen(0, []),
{ok, Port} = inet:port(L),
@@ -149,96 +144,96 @@ t_recv_delim(Config) when is_list(Config) ->
%%% gen_tcp:shutdown/2
t_shutdown_write(Config) when is_list(Config) ->
- ?line {ok, L} = gen_tcp:listen(0, []),
- ?line {ok, Port} = inet:port(L),
- ?line {ok, Client} = gen_tcp:connect(localhost, Port, [{active, false}]),
- ?line {ok, A} = gen_tcp:accept(L),
- ?line ok = gen_tcp:shutdown(A, write),
- ?line {error, closed} = gen_tcp:recv(Client, 0),
+ {ok, L} = gen_tcp:listen(0, []),
+ {ok, Port} = inet:port(L),
+ {ok, Client} = gen_tcp:connect(localhost, Port, [{active, false}]),
+ {ok, A} = gen_tcp:accept(L),
+ ok = gen_tcp:shutdown(A, write),
+ {error, closed} = gen_tcp:recv(Client, 0),
ok.
t_shutdown_both(Config) when is_list(Config) ->
- ?line {ok, L} = gen_tcp:listen(0, []),
- ?line {ok, Port} = inet:port(L),
- ?line {ok, Client} = gen_tcp:connect(localhost, Port, [{active, false}]),
- ?line {ok, A} = gen_tcp:accept(L),
- ?line ok = gen_tcp:shutdown(A, read_write),
- ?line {error, closed} = gen_tcp:recv(Client, 0),
+ {ok, L} = gen_tcp:listen(0, []),
+ {ok, Port} = inet:port(L),
+ {ok, Client} = gen_tcp:connect(localhost, Port, [{active, false}]),
+ {ok, A} = gen_tcp:accept(L),
+ ok = gen_tcp:shutdown(A, read_write),
+ {error, closed} = gen_tcp:recv(Client, 0),
ok.
t_shutdown_error(Config) when is_list(Config) ->
- ?line {ok, L} = gen_tcp:listen(0, []),
- ?line {error, enotconn} = gen_tcp:shutdown(L, read_write),
- ?line ok = gen_tcp:close(L),
- ?line {error, closed} = gen_tcp:shutdown(L, read_write),
+ {ok, L} = gen_tcp:listen(0, []),
+ {error, enotconn} = gen_tcp:shutdown(L, read_write),
+ ok = gen_tcp:close(L),
+ {error, closed} = gen_tcp:shutdown(L, read_write),
ok.
t_shutdown_async(Config) when is_list(Config) ->
- ?line {OS, _} = os:type(),
- ?line {ok, L} = gen_tcp:listen(0, [{sndbuf, 4096}]),
- ?line {ok, Port} = inet:port(L),
- ?line {ok, Client} = gen_tcp:connect(localhost, Port,
- [{recbuf, 4096},
- {active, false}]),
- ?line {ok, S} = gen_tcp:accept(L),
- ?line PayloadSize = 1024 * 1024,
- ?line Payload = lists:duplicate(PayloadSize, $.),
- ?line ok = gen_tcp:send(S, Payload),
- ?line case erlang:port_info(S, queue_size) of
- {queue_size, N} when N > 0 -> ok;
- {queue_size, 0} when OS =:= win32 -> ok;
- {queue_size, 0} = T -> ?t:fail({unexpected, T})
- end,
-
- ?line ok = gen_tcp:shutdown(S, write),
- ?line {ok, Buf} = gen_tcp:recv(Client, PayloadSize),
- ?line {error, closed} = gen_tcp:recv(Client, 0),
- ?line case length(Buf) of
- PayloadSize -> ok;
- Sz -> ?t:fail({payload_size,
- {expected, PayloadSize},
- {received, Sz}})
- end.
+ {OS, _} = os:type(),
+ {ok, L} = gen_tcp:listen(0, [{sndbuf, 4096}]),
+ {ok, Port} = inet:port(L),
+ {ok, Client} = gen_tcp:connect(localhost, Port,
+ [{recbuf, 4096},
+ {active, false}]),
+ {ok, S} = gen_tcp:accept(L),
+ PayloadSize = 1024 * 1024,
+ Payload = lists:duplicate(PayloadSize, $.),
+ ok = gen_tcp:send(S, Payload),
+ case erlang:port_info(S, queue_size) of
+ {queue_size, N} when N > 0 -> ok;
+ {queue_size, 0} when OS =:= win32 -> ok;
+ {queue_size, 0} = T -> ct:fail({unexpected, T})
+ end,
+
+ ok = gen_tcp:shutdown(S, write),
+ {ok, Buf} = gen_tcp:recv(Client, PayloadSize),
+ {error, closed} = gen_tcp:recv(Client, 0),
+ case length(Buf) of
+ PayloadSize -> ok;
+ Sz -> ct:fail({payload_size,
+ {expected, PayloadSize},
+ {received, Sz}})
+ end.
%%% gen_tcp:fdopen/2
t_fdopen(Config) when is_list(Config) ->
- ?line Question = "Aaaa... Long time ago in a small town in Germany,",
- ?line Question1 = list_to_binary(Question),
- ?line Question2 = [<<"Aaaa">>, "... ", $L, <<>>, $o, "ng time ago ",
- ["in ", [], <<"a small town">>, [" in Germany,", <<>>]]],
- ?line Question1 = iolist_to_binary(Question2),
- ?line Answer = "there was a shoemaker, Schumacher was his name.",
- ?line {ok, L} = gen_tcp:listen(0, [{active, false}]),
- ?line {ok, Port} = inet:port(L),
- ?line {ok, Client} = gen_tcp:connect(localhost, Port, [{active, false}]),
- ?line {ok, A} = gen_tcp:accept(L),
- ?line {ok, FD} = prim_inet:getfd(A),
- ?line {ok, Server} = gen_tcp:fdopen(FD, []),
- ?line ok = gen_tcp:send(Client, Question),
- ?line {ok, Question} = gen_tcp:recv(Server, length(Question), 2000),
- ?line ok = gen_tcp:send(Client, Question1),
- ?line {ok, Question} = gen_tcp:recv(Server, length(Question), 2000),
- ?line ok = gen_tcp:send(Client, Question2),
- ?line {ok, Question} = gen_tcp:recv(Server, length(Question), 2000),
- ?line ok = gen_tcp:send(Server, Answer),
- ?line {ok, Answer} = gen_tcp:recv(Client, length(Answer), 2000),
- ?line ok = gen_tcp:close(Client),
- ?line {error,closed} = gen_tcp:recv(A, 1, 2000),
- ?line ok = gen_tcp:close(Server),
- ?line ok = gen_tcp:close(A),
- ?line ok = gen_tcp:close(L),
+ Question = "Aaaa... Long time ago in a small town in Germany,",
+ Question1 = list_to_binary(Question),
+ Question2 = [<<"Aaaa">>, "... ", $L, <<>>, $o, "ng time ago ",
+ ["in ", [], <<"a small town">>, [" in Germany,", <<>>]]],
+ Question1 = iolist_to_binary(Question2),
+ Answer = "there was a shoemaker, Schumacher was his name.",
+ {ok, L} = gen_tcp:listen(0, [{active, false}]),
+ {ok, Port} = inet:port(L),
+ {ok, Client} = gen_tcp:connect(localhost, Port, [{active, false}]),
+ {ok, A} = gen_tcp:accept(L),
+ {ok, FD} = prim_inet:getfd(A),
+ {ok, Server} = gen_tcp:fdopen(FD, []),
+ ok = gen_tcp:send(Client, Question),
+ {ok, Question} = gen_tcp:recv(Server, length(Question), 2000),
+ ok = gen_tcp:send(Client, Question1),
+ {ok, Question} = gen_tcp:recv(Server, length(Question), 2000),
+ ok = gen_tcp:send(Client, Question2),
+ {ok, Question} = gen_tcp:recv(Server, length(Question), 2000),
+ ok = gen_tcp:send(Server, Answer),
+ {ok, Answer} = gen_tcp:recv(Client, length(Answer), 2000),
+ ok = gen_tcp:close(Client),
+ {error,closed} = gen_tcp:recv(A, 1, 2000),
+ ok = gen_tcp:close(Server),
+ ok = gen_tcp:close(A),
+ ok = gen_tcp:close(L),
ok.
t_fdconnect(Config) when is_list(Config) ->
Question = "Aaaa... Long time ago in a small town in Germany,",
Question1 = list_to_binary(Question),
Question2 = [<<"Aaaa">>, "... ", $L, <<>>, $o, "ng time ago ",
- ["in ", [], <<"a small town">>, [" in Germany,", <<>>]]],
+ ["in ", [], <<"a small town">>, [" in Germany,", <<>>]]],
Question1 = iolist_to_binary(Question2),
Answer = "there was a shoemaker, Schumacher was his name.",
- Path = ?config(data_dir, Config),
+ Path = proplists:get_value(data_dir, Config),
Lib = "gen_tcp_api_SUITE",
ok = erlang:load_nif(filename:join(Path,Lib), []),
{ok, L} = gen_tcp:listen(0, [{active, false}]),
@@ -266,53 +261,51 @@ t_fdconnect(Config) when is_list(Config) ->
%%% implicit inet6 option to api functions
t_implicit_inet6(Config) when is_list(Config) ->
- ?line Host = ok(inet:gethostname()),
- ?line
- case inet:getaddr(Host, inet6) of
- {ok,Addr} ->
- ?line t_implicit_inet6(Host, Addr);
- {error,Reason} ->
- {skip,
- "Can not look up IPv6 address: "
- ++atom_to_list(Reason)}
- end.
+ Host = ok(inet:gethostname()),
+ case inet:getaddr(Host, inet6) of
+ {ok,Addr} ->
+ t_implicit_inet6(Host, Addr);
+ {error,Reason} ->
+ {skip,
+ "Can not look up IPv6 address: "
+ ++atom_to_list(Reason)}
+ end.
t_implicit_inet6(Host, Addr) ->
- ?line
- case gen_tcp:listen(0, [inet6]) of
- {ok,S1} ->
- ?line Loopback = {0,0,0,0,0,0,0,1},
- ?line io:format("~s ~p~n", ["::1",Loopback]),
- ?line implicit_inet6(S1, Loopback),
- ?line ok = gen_tcp:close(S1),
- %%
- ?line Localhost = "localhost",
- ?line Localaddr = ok(inet:getaddr(Localhost, inet6)),
- ?line io:format("~s ~p~n", [Localhost,Localaddr]),
- ?line S2 = ok(gen_tcp:listen(0, [{ip,Localaddr}])),
- ?line implicit_inet6(S2, Localaddr),
- ?line ok = gen_tcp:close(S2),
- %%
- ?line io:format("~s ~p~n", [Host,Addr]),
- ?line S3 = ok(gen_tcp:listen(0, [{ifaddr,Addr}])),
- ?line implicit_inet6(S3, Addr),
- ?line ok = gen_tcp:close(S3);
- {error,_} ->
- {skip,"IPv6 not supported"}
- end.
+ case gen_tcp:listen(0, [inet6]) of
+ {ok,S1} ->
+ Loopback = {0,0,0,0,0,0,0,1},
+ io:format("~s ~p~n", ["::1",Loopback]),
+ implicit_inet6(S1, Loopback),
+ ok = gen_tcp:close(S1),
+ %%
+ Localhost = "localhost",
+ Localaddr = ok(inet:getaddr(Localhost, inet6)),
+ io:format("~s ~p~n", [Localhost,Localaddr]),
+ S2 = ok(gen_tcp:listen(0, [{ip,Localaddr}])),
+ implicit_inet6(S2, Localaddr),
+ ok = gen_tcp:close(S2),
+ %%
+ io:format("~s ~p~n", [Host,Addr]),
+ S3 = ok(gen_tcp:listen(0, [{ifaddr,Addr}])),
+ implicit_inet6(S3, Addr),
+ ok = gen_tcp:close(S3);
+ {error,_} ->
+ {skip,"IPv6 not supported"}
+ end.
implicit_inet6(S, Addr) ->
- ?line P = ok(inet:port(S)),
- ?line S2 = ok(gen_tcp:connect(Addr, P, [])),
- ?line P2 = ok(inet:port(S2)),
- ?line S1 = ok(gen_tcp:accept(S)),
- ?line P1 = P = ok(inet:port(S1)),
- ?line {Addr,P2} = ok(inet:peername(S1)),
- ?line {Addr,P1} = ok(inet:peername(S2)),
- ?line {Addr,P1} = ok(inet:sockname(S1)),
- ?line {Addr,P2} = ok(inet:sockname(S2)),
- ?line ok = gen_tcp:close(S2),
- ?line ok = gen_tcp:close(S1).
+ P = ok(inet:port(S)),
+ S2 = ok(gen_tcp:connect(Addr, P, [])),
+ P2 = ok(inet:port(S2)),
+ S1 = ok(gen_tcp:accept(S)),
+ P1 = P = ok(inet:port(S1)),
+ {Addr,P2} = ok(inet:peername(S1)),
+ {Addr,P1} = ok(inet:peername(S2)),
+ {Addr,P1} = ok(inet:sockname(S1)),
+ {Addr,P2} = ok(inet:sockname(S2)),
+ ok = gen_tcp:close(S2),
+ ok = gen_tcp:close(S1).
%%% Utilities
@@ -323,13 +316,13 @@ implicit_inet6(S, Addr) ->
timeout({M,F,A}, Lower, Upper) ->
case test_server:timecall(M, F, A) of
{Time, Result} when Time < Lower ->
- test_server:fail({too_short_time, Time, Result});
+ ct:fail({too_short_time, Time, Result});
{Time, Result} when Time > Upper ->
- test_server:fail({too_long_time, Time, Result});
+ ct:fail({too_long_time, Time, Result});
{_, {error, timeout}} ->
ok;
{_, Result} ->
- test_server:fail({unexpected_result, Result})
+ ct:fail({unexpected_result, Result})
end.
connect_timeout({M,F,A}, Lower, Upper) ->
@@ -344,28 +337,28 @@ connect_timeout({M,F,A}, Lower, Upper) ->
Pinfo = erlang:port_info(Socket),
Db = inet_db:lookup_socket(Socket),
Peer = inet:peername(Socket),
- test_server:fail({too_short_time, Time,
- [Result,Pinfo,Db,Peer]});
+ ct:fail({too_short_time, Time,
+ [Result,Pinfo,Db,Peer]});
_ ->
- test_server:fail({too_short_time, Time, Result})
+ ct:fail({too_short_time, Time, Result})
end;
{Time, Result} when Time > Upper ->
- test_server:fail({too_long_time, Time, Result});
+ ct:fail({too_long_time, Time, Result});
{_, {error, timeout}} ->
ok;
{_, Result} ->
- test_server:fail({unexpected_result, Result})
+ ct:fail({unexpected_result, Result})
end.
%% Try to obtain an unused IP address in the local network.
unused_ip() ->
- ?line {ok, Host} = inet:gethostname(),
- ?line {ok, Hent} = inet:gethostbyname(Host),
- ?line #hostent{h_addr_list=[{A, B, C, _D}|_]} = Hent,
+ {ok, Host} = inet:gethostname(),
+ {ok, Hent} = inet:gethostbyname(Host),
+ #hostent{h_addr_list=[{A, B, C, _D}|_]} = Hent,
%% Note: In our net, addresses below 16 are reserved for routers and
%% other strange creatures.
- ?line IP = unused_ip(A, B, C, 16),
+ IP = unused_ip(A, B, C, 16),
io:format("we = ~p, unused_ip = ~p~n", [Hent, IP]),
IP.
diff --git a/lib/kernel/test/gen_tcp_echo_SUITE.erl b/lib/kernel/test/gen_tcp_echo_SUITE.erl
index fe81cbac18..f4b67af8c8 100644
--- a/lib/kernel/test/gen_tcp_echo_SUITE.erl
+++ b/lib/kernel/test/gen_tcp_echo_SUITE.erl
@@ -34,7 +34,9 @@
-define(TPKT_VRSN, 3).
-define(LINE_LENGTH, 1023). % (default value of gen_tcp option 'recbuf') - 1
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,5}}].
all() ->
[active_echo, passive_echo, active_once_echo,
@@ -59,94 +61,75 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:minutes(5)),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
-
-active_echo(doc) ->
- ["Test sending packets of various sizes and various packet types ",
- "to the echo port and receiving them again (socket in active mode)."];
-active_echo(suite) -> [];
+ Config.
+
+end_per_testcase(_Func, _Config) ->
+ ok.
+
+%% Test sending packets of various sizes and various packet types
+%% to the echo port and receiving them again (socket in active mode).
active_echo(Config) when is_list(Config) ->
- ?line echo_test([], fun active_echo/4, [{echo, fun echo_server/0}]).
+ echo_test([], fun active_echo/4, [{echo, fun echo_server/0}]).
-passive_echo(doc) ->
- ["Test sending packets of various sizes and various packet types ",
- "to the echo port and receiving them again (socket in passive mode)."];
-passive_echo(suite) -> [];
+%% Test sending packets of various sizes and various packet types
+%% to the echo port and receiving them again (socket in passive mode).
passive_echo(Config) when is_list(Config) ->
- ?line echo_test([{active, false}], fun passive_echo/4,
- [{echo, fun echo_server/0}]).
+ echo_test([{active, false}], fun passive_echo/4,
+ [{echo, fun echo_server/0}]).
-active_once_echo(doc) ->
- ["Test sending packets of various sizes and various packet types ",
- "to the echo port and receiving them again (socket in active once mode)."];
-active_once_echo(suite) -> [];
+%% Test sending packets of various sizes and various packet types
+%% to the echo port and receiving them again (socket in active once mode).
active_once_echo(Config) when is_list(Config) ->
- ?line echo_test([{active, once}], fun active_once_echo/4,
- [{echo, fun echo_server/0}]).
-
-slow_active_echo(doc) ->
- ["Test sending packets of various sizes and various packet types ",
- "to the echo port and receiving them again (socket in active mode). ",
- "The echo server is a special one that delays between every character."];
-slow_active_echo(suite) -> [];
+ echo_test([{active, once}], fun active_once_echo/4,
+ [{echo, fun echo_server/0}]).
+
+%% Test sending packets of various sizes and various packet types
+%% to the echo port and receiving them again (socket in active mode).
+%% The echo server is a special one that delays between every character.
slow_active_echo(Config) when is_list(Config) ->
- ?line echo_test([], fun active_echo/4,
- [slow_echo, {echo, fun slow_echo_server/0}]).
-
-slow_passive_echo(doc) ->
- ["Test sending packets of various sizes and various packet types ",
- "to an echo server and receiving them again (socket in passive mode).",
- "The echo server is a special one that delays between every character."];
-slow_passive_echo(suite) -> [];
+ echo_test([], fun active_echo/4,
+ [slow_echo, {echo, fun slow_echo_server/0}]).
+
+%% Test sending packets of various sizes and various packet types
+%% to an echo server and receiving them again (socket in passive mode).
+%% The echo server is a special one that delays between every character.
slow_passive_echo(Config) when is_list(Config) ->
- ?line echo_test([{active, false}], fun passive_echo/4,
- [slow_echo, {echo, fun slow_echo_server/0}]).
-
-limit_active_echo(doc) ->
- ["Test sending packets of various sizes and various packet types ",
- "to the echo port and receiving them again (socket in active mode) "
- "with packet_size limitation."];
-limit_active_echo(suite) -> [];
+ echo_test([{active, false}], fun passive_echo/4,
+ [slow_echo, {echo, fun slow_echo_server/0}]).
+
+%% Test sending packets of various sizes and various packet types
+%% to the echo port and receiving them again (socket in active mode)
+%% with packet_size limitation.
limit_active_echo(Config) when is_list(Config) ->
- ?line echo_test([{packet_size, 10}],
- fun active_echo/4,
- [{packet_size, 10}, {echo, fun echo_server/0}]).
-
-limit_passive_echo(doc) ->
- ["Test sending packets of various sizes and various packet types ",
- "to the echo port and receiving them again (socket in passive mode) ",
- "with packet_size limitation."];
-limit_passive_echo(suite) -> [];
+ echo_test([{packet_size, 10}],
+ fun active_echo/4,
+ [{packet_size, 10}, {echo, fun echo_server/0}]).
+
+%% Test sending packets of various sizes and various packet types
+%% to the echo port and receiving them again (socket in passive mode)
+%% with packet_size limitation.
limit_passive_echo(Config) when is_list(Config) ->
- ?line echo_test([{packet_size, 10},{active, false}],
- fun passive_echo/4,
- [{packet_size, 10}, {echo, fun echo_server/0}]).
-
-large_limit_active_echo(doc) ->
- ["Test sending packets of various sizes and various packet types ",
- "to the echo port and receiving them again (socket in active mode) "
- "with large packet_size limitation."];
-large_limit_active_echo(suite) -> [];
+ echo_test([{packet_size, 10},{active, false}],
+ fun passive_echo/4,
+ [{packet_size, 10}, {echo, fun echo_server/0}]).
+
+%% Test sending packets of various sizes and various packet types
+%% to the echo port and receiving them again (socket in active mode)
+%% with large packet_size limitation.
large_limit_active_echo(Config) when is_list(Config) ->
- ?line echo_test([{packet_size, 10}],
- fun active_echo/4,
- [{packet_size, (1 bsl 32)-1},
- {echo, fun echo_server/0}]).
-
-large_limit_passive_echo(doc) ->
- ["Test sending packets of various sizes and various packet types ",
- "to the echo port and receiving them again (socket in passive mode) ",
- "with large packet_size limitation."];
-large_limit_passive_echo(suite) -> [];
+ echo_test([{packet_size, 10}],
+ fun active_echo/4,
+ [{packet_size, (1 bsl 32)-1},
+ {echo, fun echo_server/0}]).
+
+%% Test sending packets of various sizes and various packet types
+%% to the echo port and receiving them again (socket in passive mode)
+%% with large packet_size limitation.
large_limit_passive_echo(Config) when is_list(Config) ->
- ?line echo_test([{packet_size, 10},{active, false}],
- fun passive_echo/4,
- [{packet_size, (1 bsl 32) -1},
- {echo, fun echo_server/0}]).
+ echo_test([{packet_size, 10},{active, false}],
+ fun passive_echo/4,
+ [{packet_size, (1 bsl 32) -1},
+ {echo, fun echo_server/0}]).
echo_test(SockOpts, EchoFun, Config0) ->
echo_test_1(SockOpts, EchoFun, Config0),
@@ -154,53 +137,53 @@ echo_test(SockOpts, EchoFun, Config0) ->
echo_test_1([{delay_send,true}|SockOpts], EchoFun, Config0).
echo_test_1(SockOpts, EchoFun, Config0) ->
- ?line EchoSrvFun = ?config(echo, Config0),
- ?line {ok, EchoPort} = EchoSrvFun(),
- ?line Config = [{echo_port, EchoPort}|Config0],
-
- ?line echo_packet([{packet, 1}|SockOpts], EchoFun, Config),
- ?line echo_packet([{packet, 2}|SockOpts], EchoFun, Config),
- ?line echo_packet([{packet, 4}|SockOpts], EchoFun, Config),
- ?line echo_packet([{packet, sunrm}|SockOpts], EchoFun, Config),
- ?line echo_packet([{packet, cdr}|SockOpts], EchoFun,
- [{type, {cdr, big}}|Config]),
- ?line echo_packet([{packet, cdr}|SockOpts], EchoFun,
- [{type, {cdr, little}}|Config]),
- ?line case lists:keymember(packet_size, 1, SockOpts) of
- false ->
- % This is cheating, we should test that packet_size
- % also works for line and http.
- echo_packet([{packet, line}|SockOpts], EchoFun, Config),
- echo_packet([{packet, http}|SockOpts], EchoFun, Config),
- echo_packet([{packet, http_bin}|SockOpts], EchoFun, Config);
-
- true -> ok
- end,
- ?line echo_packet([{packet, tpkt}|SockOpts], EchoFun, Config),
-
- ?line ShortTag = [16#E0],
- ?line LongTag = [16#1F, 16#83, 16#27],
- ?line echo_packet([{packet, asn1}|SockOpts], EchoFun,
- [{type, {asn1, short, ShortTag}}|Config]),
- ?line echo_packet([{packet, asn1}|SockOpts], EchoFun,
- [{type, {asn1, long, ShortTag}}|Config]),
- ?line echo_packet([{packet, asn1}|SockOpts], EchoFun,
- [{type, {asn1, short, LongTag}}|Config]),
- ?line echo_packet([{packet, asn1}|SockOpts], EchoFun,
- [{type, {asn1, long, LongTag}}|Config]),
+ EchoSrvFun = proplists:get_value(echo, Config0),
+ {ok, EchoPort} = EchoSrvFun(),
+ Config = [{echo_port, EchoPort}|Config0],
+
+ echo_packet([{packet, 1}|SockOpts], EchoFun, Config),
+ echo_packet([{packet, 2}|SockOpts], EchoFun, Config),
+ echo_packet([{packet, 4}|SockOpts], EchoFun, Config),
+ echo_packet([{packet, sunrm}|SockOpts], EchoFun, Config),
+ echo_packet([{packet, cdr}|SockOpts], EchoFun,
+ [{type, {cdr, big}}|Config]),
+ echo_packet([{packet, cdr}|SockOpts], EchoFun,
+ [{type, {cdr, little}}|Config]),
+ case lists:keymember(packet_size, 1, SockOpts) of
+ false ->
+ %% This is cheating, we should test that packet_size
+ %% also works for line and http.
+ echo_packet([{packet, line}|SockOpts], EchoFun, Config),
+ echo_packet([{packet, http}|SockOpts], EchoFun, Config),
+ echo_packet([{packet, http_bin}|SockOpts], EchoFun, Config);
+
+ true -> ok
+ end,
+ echo_packet([{packet, tpkt}|SockOpts], EchoFun, Config),
+
+ ShortTag = [16#E0],
+ LongTag = [16#1F, 16#83, 16#27],
+ echo_packet([{packet, asn1}|SockOpts], EchoFun,
+ [{type, {asn1, short, ShortTag}}|Config]),
+ echo_packet([{packet, asn1}|SockOpts], EchoFun,
+ [{type, {asn1, long, ShortTag}}|Config]),
+ echo_packet([{packet, asn1}|SockOpts], EchoFun,
+ [{type, {asn1, short, LongTag}}|Config]),
+ echo_packet([{packet, asn1}|SockOpts], EchoFun,
+ [{type, {asn1, long, LongTag}}|Config]),
ok.
echo_packet(SockOpts, EchoFun, Opts) ->
Type = case lists:keysearch(type, 1, Opts) of
- {value, {type, T}} ->
- T;
- _ ->
- {value, {packet, T}} = lists:keysearch(packet, 1, SockOpts),
- T
- end,
+ {value, {type, T}} ->
+ T;
+ _ ->
+ {value, {packet, T}} = lists:keysearch(packet, 1, SockOpts),
+ T
+ end,
%% Connect to the echo server.
- EchoPort = ?config(echo_port, Opts),
+ EchoPort = proplists:get_value(echo_port, Opts),
{ok, Echo} = gen_tcp:connect(localhost, EchoPort, SockOpts),
SlowEcho = lists:member(slow_echo, Opts),
@@ -223,83 +206,78 @@ echo_packet_http(Echo, Type, EchoFun) ->
EchoFun(Echo, Type, P2, http_reply(P2, Type)).
echo_packet0(Echo, Type, EchoFun, SlowEcho, Opts) ->
- ?line PacketSize =
+ PacketSize =
case lists:keysearch(packet_size, 1, Opts) of
{value,{packet_size,Sz}} when Sz < 10 -> Sz;
{value,{packet_size,_}} -> 10;
false -> 0
end,
%% Echo small packets first.
- ?line echo_packet1(Echo, Type, EchoFun, 0),
- ?line echo_packet1(Echo, Type, EchoFun, 1),
- ?line echo_packet1(Echo, Type, EchoFun, 2),
- ?line echo_packet1(Echo, Type, EchoFun, 3),
- ?line echo_packet1(Echo, Type, EchoFun, 4),
- ?line echo_packet1(Echo, Type, EchoFun, 7),
+ echo_packet1(Echo, Type, EchoFun, 0),
+ echo_packet1(Echo, Type, EchoFun, 1),
+ echo_packet1(Echo, Type, EchoFun, 2),
+ echo_packet1(Echo, Type, EchoFun, 3),
+ echo_packet1(Echo, Type, EchoFun, 4),
+ echo_packet1(Echo, Type, EchoFun, 7),
if PacketSize =/= 0 ->
- ?line echo_packet1(Echo, Type, EchoFun,
- {PacketSize-1, PacketSize}),
- ?line echo_packet1(Echo, Type, EchoFun,
- {PacketSize, PacketSize}),
- ?line echo_packet1(Echo, Type, EchoFun,
- {PacketSize+1, PacketSize});
+ echo_packet1(Echo, Type, EchoFun,
+ {PacketSize-1, PacketSize}),
+ echo_packet1(Echo, Type, EchoFun,
+ {PacketSize, PacketSize}),
+ echo_packet1(Echo, Type, EchoFun,
+ {PacketSize+1, PacketSize});
not SlowEcho -> % Go on with bigger packets if not slow echo server.
- ?line echo_packet1(Echo, Type, EchoFun, 10),
- ?line echo_packet1(Echo, Type, EchoFun, 13),
- ?line echo_packet1(Echo, Type, EchoFun, 126),
- ?line echo_packet1(Echo, Type, EchoFun, 127),
- ?line echo_packet1(Echo, Type, EchoFun, 128),
- ?line echo_packet1(Echo, Type, EchoFun, 255),
- ?line echo_packet1(Echo, Type, EchoFun, 256),
- ?line echo_packet1(Echo, Type, EchoFun, 1023),
- ?line echo_packet1(Echo, Type, EchoFun, 3747),
- ?line echo_packet1(Echo, Type, EchoFun, 32767),
- ?line echo_packet1(Echo, Type, EchoFun, 32768),
- ?line echo_packet1(Echo, Type, EchoFun, 65531),
- ?line echo_packet1(Echo, Type, EchoFun, 65535),
- ?line echo_packet1(Echo, Type, EchoFun, 65536),
- ?line echo_packet1(Echo, Type, EchoFun, 70000),
- ?line echo_packet1(Echo, Type, EchoFun, infinite);
+ echo_packet1(Echo, Type, EchoFun, 10),
+ echo_packet1(Echo, Type, EchoFun, 13),
+ echo_packet1(Echo, Type, EchoFun, 126),
+ echo_packet1(Echo, Type, EchoFun, 127),
+ echo_packet1(Echo, Type, EchoFun, 128),
+ echo_packet1(Echo, Type, EchoFun, 255),
+ echo_packet1(Echo, Type, EchoFun, 256),
+ echo_packet1(Echo, Type, EchoFun, 1023),
+ echo_packet1(Echo, Type, EchoFun, 3747),
+ echo_packet1(Echo, Type, EchoFun, 32767),
+ echo_packet1(Echo, Type, EchoFun, 32768),
+ echo_packet1(Echo, Type, EchoFun, 65531),
+ echo_packet1(Echo, Type, EchoFun, 65535),
+ echo_packet1(Echo, Type, EchoFun, 65536),
+ echo_packet1(Echo, Type, EchoFun, 70000),
+ echo_packet1(Echo, Type, EchoFun, infinite);
true -> ok
end,
- ?line gen_tcp:close(Echo),
+ gen_tcp:close(Echo),
ok.
echo_packet1(EchoSock, Type, EchoFun, Size) ->
- ?line case packet(Size, Type) of
- false ->
- ok;
- Packet ->
- ?line io:format("Type ~p, size ~p, time ~p",
- [Type, Size, time()]),
- ?line
- case EchoFun(EchoSock, Type, Packet, [Packet]) of
- ok ->
- ?line
- case Size of
- {N, Max} when N > Max ->
- ?line
- test_server:fail(
- {packet_through, {N, Max}});
- _ -> ok
- end;
- {error, emsgsize} ->
- ?line
- case Size of
- {N, Max} when N > Max ->
- io:format(" Blocked!");
- _ ->
- ?line
- test_server:fail(
- {packet_blocked, Size})
- end;
- Error ->
- ?line test_server:fail(Error)
- end
- end.
+ case packet(Size, Type) of
+ false ->
+ ok;
+ Packet ->
+ io:format("Type ~p, size ~p, time ~p",
+ [Type, Size, time()]),
+ case EchoFun(EchoSock, Type, Packet, [Packet]) of
+ ok ->
+ case Size of
+ {N, Max} when N > Max ->
+ ct:fail(
+ {packet_through, {N, Max}});
+ _ -> ok
+ end;
+ {error, emsgsize} ->
+ case Size of
+ {N, Max} when N > Max ->
+ io:format(" Blocked!");
+ _ ->
+ ct:fail(
+ {packet_blocked, Size})
+ end;
+ Error ->
+ ct:fail(Error)
+ end
+ end.
active_echo(Sock, Type, Packet, PacketEchos) ->
- ?line ok = gen_tcp:send(Sock, Packet),
+ ok = gen_tcp:send(Sock, Packet),
active_recv(Sock, Type, PacketEchos).
active_recv(_, _, []) ->
@@ -310,21 +288,21 @@ active_recv(Sock, Type, [PacketEcho|Tail]) ->
http_bin -> http;
_ -> tcp
end,
- ?line receive Recv->Recv end,
+ receive Recv->Recv end,
%%io:format("Active received: ~p\n",[Recv]),
- ?line case Recv of
- {Tag, Sock, PacketEcho} ->
- active_recv(Sock, Type, Tail);
- {Tag, Sock, Bad} ->
- ?line test_server:fail({wrong_data, Bad, expected, PacketEcho});
- {tcp_error, Sock, Reason} ->
- {error, Reason};
- Other ->
- ?line test_server:fail({unexpected_message, Other, Tag})
- end.
+ case Recv of
+ {Tag, Sock, PacketEcho} ->
+ active_recv(Sock, Type, Tail);
+ {Tag, Sock, Bad} ->
+ ct:fail({wrong_data, Bad, expected, PacketEcho});
+ {tcp_error, Sock, Reason} ->
+ {error, Reason};
+ Other ->
+ ct:fail({unexpected_message, Other, Tag})
+ end.
passive_echo(Sock, _Type, Packet, PacketEchos) ->
- ?line ok = gen_tcp:send(Sock, Packet),
+ ok = gen_tcp:send(Sock, Packet),
passive_recv(Sock, PacketEchos).
passive_recv(_, []) ->
@@ -332,22 +310,22 @@ passive_recv(_, []) ->
passive_recv(Sock, [PacketEcho | Tail]) ->
Recv = gen_tcp:recv(Sock, 0),
%%io:format("Passive received: ~p\n",[Recv]),
- ?line case Recv of
- {ok, PacketEcho} ->
- passive_recv(Sock, Tail);
- {ok, Bad} ->
- io:format("Expected: ~p\nGot: ~p\n",[PacketEcho,Bad]),
- ?line test_server:fail({wrong_data, Bad});
- {error,PacketEcho} ->
- passive_recv(Sock, Tail); % expected error
- {error, _}=Error ->
- Error;
- Other ->
- ?line test_server:fail({unexpected_message, Other})
- end.
+ case Recv of
+ {ok, PacketEcho} ->
+ passive_recv(Sock, Tail);
+ {ok, Bad} ->
+ io:format("Expected: ~p\nGot: ~p\n",[PacketEcho,Bad]),
+ ct:fail({wrong_data, Bad});
+ {error,PacketEcho} ->
+ passive_recv(Sock, Tail); % expected error
+ {error, _}=Error ->
+ Error;
+ Other ->
+ ct:fail({unexpected_message, Other})
+ end.
active_once_echo(Sock, Type, Packet, PacketEchos) ->
- ?line ok = gen_tcp:send(Sock, Packet),
+ ok = gen_tcp:send(Sock, Packet),
active_once_recv(Sock, Type, PacketEchos).
active_once_recv(_, _, []) ->
@@ -358,17 +336,17 @@ active_once_recv(Sock, Type, [PacketEcho | Tail]) ->
http_bin -> http;
_ -> tcp
end,
- ?line receive
- {Tag, Sock, PacketEcho} ->
- inet:setopts(Sock, [{active, once}]),
- active_once_recv(Sock, Type, Tail);
- {Tag, Sock, Bad} ->
- ?line test_server:fail({wrong_data, Bad});
- {tcp_error, Sock, Reason} ->
- {error, Reason};
- Other ->
- ?line test_server:fail({unexpected_message, Other, expected, {Tag, Sock, PacketEcho}})
- end.
+ receive
+ {Tag, Sock, PacketEcho} ->
+ inet:setopts(Sock, [{active, once}]),
+ active_once_recv(Sock, Type, Tail);
+ {Tag, Sock, Bad} ->
+ ct:fail({wrong_data, Bad});
+ {tcp_error, Sock, Reason} ->
+ {error, Reason};
+ Other ->
+ ct:fail({unexpected_message, Other, expected, {Tag, Sock, PacketEcho}})
+ end.
%%% Building of random packets.
@@ -451,9 +429,9 @@ put_int32(X, big, List) ->
(X) band 16#ff | List ];
put_int32(X, little, List) ->
[ (X) band 16#ff,
- (X bsr 8) band 16#ff,
- (X bsr 16) band 16#ff,
- (X bsr 24) band 16#ff | List].
+ (X bsr 8) band 16#ff,
+ (X bsr 16) band 16#ff,
+ (X bsr 24) band 16#ff | List].
put_int16(X, ByteOrder) ->
put_int16(X, ByteOrder, []).
@@ -463,16 +441,16 @@ put_int16(X, big, List) ->
(X) band 16#ff | List ];
put_int16(X, little, List) ->
[ (X) band 16#ff,
- (X bsr 8) band 16#ff | List ].
+ (X bsr 8) band 16#ff | List ].
%%% A normal echo server, for systems that don't have one.
echo_server() ->
Self = self(),
- ?line spawn_link(fun() -> echo_server(Self) end),
- ?line receive
- {echo_port, Port} ->
- {ok, Port}
+ spawn_link(fun() -> echo_server(Self) end),
+ receive
+ {echo_port, Port} ->
+ {ok, Port}
end.
echo_server(ReplyTo) ->
@@ -505,11 +483,11 @@ echoer_loop(Sock) ->
slow_echo_server() ->
Self = self(),
- ?line spawn_link(fun() -> slow_echo_server(Self) end),
- ?line receive
- {echo_port, Port} ->
- {ok, Port}
- end.
+ spawn_link(fun() -> slow_echo_server(Self) end),
+ receive
+ {echo_port, Port} ->
+ {ok, Port}
+ end.
slow_echo_server(ReplyTo) ->
{ok, S} = gen_tcp:listen(0, [{active, false}, {nodelay, true}]),
@@ -545,17 +523,17 @@ slow_send(_, []) ->
http_request(Uri) ->
list_to_binary(["POST ", Uri, <<" HTTP/1.1\r\n"
- "Connection: close\r\n"
- "Host: localhost:8000\r\n"
- "User-Agent: perl post\r\n"
- "Content-Length: 4\r\n"
- "Content-Type: text/xml; charset=utf-8\r\n"
- "Other-Field: with some text\r\n"
- "Multi-Line: Once upon a time in a land far far away,\r\n"
- " there lived a princess imprisoned in the highest tower\r\n"
- " of the most haunted castle.\r\n"
- "Invalid line without a colon\r\n"
- "\r\n">>]).
+ "Connection: close\r\n"
+ "Host: localhost:8000\r\n"
+ "User-Agent: perl post\r\n"
+ "Content-Length: 4\r\n"
+ "Content-Type: text/xml; charset=utf-8\r\n"
+ "Other-Field: with some text\r\n"
+ "Multi-Line: Once upon a time in a land far far away,\r\n"
+ " there lived a princess imprisoned in the highest tower\r\n"
+ " of the most haunted castle.\r\n"
+ "Invalid line without a colon\r\n"
+ "\r\n">>]).
http_uri_variants() ->
["*",
@@ -568,11 +546,11 @@ http_uri_variants() ->
http_response() ->
<<"HTTP/1.0 404 Object Not Found\r\n"
- "Server: inets/4.7.16\r\n"
- "Date: Fri, 04 Jul 2008 17:16:22 GMT\r\n"
- "Content-Type: text/html\r\n"
- "Content-Length: 207\r\n"
- "\r\n">>.
+ "Server: inets/4.7.16\r\n"
+ "Date: Fri, 04 Jul 2008 17:16:22 GMT\r\n"
+ "Content-Type: text/html\r\n"
+ "Content-Length: 207\r\n"
+ "\r\n">>.
http_reply(Bin, Type) ->
{ok, Line, Rest} = erlang:decode_packet(Type,Bin,[]),
@@ -589,7 +567,3 @@ http_reply(<<>>, Acc, _) ->
http_reply(Bin, Acc, HType) ->
{ok, Line, Rest} = erlang:decode_packet(HType,Bin,[]),
http_reply(Rest, [Line | Acc], HType).
-
-
-
-
diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl
index 323796665b..7c3b011eb9 100644
--- a/lib/kernel/test/gen_tcp_misc_SUITE.erl
+++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl
@@ -21,13 +21,13 @@
-include_lib("common_test/include/ct.hrl").
-%-compile(export_all).
-
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
controlling_process/1, controlling_process_self/1,
no_accept/1, close_with_pending_output/1, active_n/1,
- data_before_close/1, iter_max_socks/1, get_status/1,
+ data_before_close/1,
+ iter_max_socks/0, iter_max_socks/1,
+ get_status/1,
passive_sockets/1, accept_closed_by_other_process/1,
init_per_testcase/2, end_per_testcase/2,
otp_3924/1, otp_3924_sender/4, closed_socket/1,
@@ -41,7 +41,7 @@
busy_send/1, busy_disconnect_passive/1, busy_disconnect_active/1,
fill_sendq/1, partial_recv_and_close/1,
partial_recv_and_close_2/1,partial_recv_and_close_3/1,so_priority/1,
- % Accept tests
+ %% Accept tests
primitive_accept/1,multi_accept_close_listen/1,accept_timeout/1,
accept_timeouts_in_order/1,accept_timeouts_in_order2/1,
accept_timeouts_in_order3/1,accept_timeouts_in_order4/1,
@@ -50,7 +50,8 @@
killing_acceptor/1,killing_multi_acceptors/1,killing_multi_acceptors2/1,
several_accepts_in_one_go/1, accept_system_limit/1,
active_once_closed/1, send_timeout/1, send_timeout_active/1,
- otp_7731/1, zombie_sockets/1, otp_7816/1, otp_8102/1, wrapping_oct/1,
+ otp_7731/1, zombie_sockets/1, otp_7816/1, otp_8102/1,
+ wrapping_oct/0, wrapping_oct/1,
otp_9389/1]).
%% Internal exports.
@@ -58,25 +59,15 @@
oct_acceptor/1,
otp_7731_server/1, zombie_server/2, do_iter_max_socks/2]).
-init_per_testcase(iter_max_socks, Config) when is_list(Config) ->
- Dog = case os:type() of
- {win32,_} ->
- test_server:timetrap(test_server:minutes(30));
- _Else ->
- test_server:timetrap(test_server:seconds(240))
- end,
- [{watchdog, Dog}|Config];
-init_per_testcase(wrapping_oct, Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(600)),
- [{watchdog, Dog}|Config];
-init_per_testcase(_Func, Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(240)),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+init_per_testcase(_Func, Config) ->
+ Config.
+
+end_per_testcase(_Func, _Config) ->
+ ok.
+
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,4}}].
all() ->
[controlling_process, controlling_process_self, no_accept,
@@ -120,11 +111,13 @@ init_per_group(_GroupName, Config) ->
end_per_group(_GroupName, Config) ->
Config.
-default_options(doc) ->
- ["Tests kernel application variables inet_default_listen_options and "
- "inet_default_connect_options"];
-default_options(suite) ->
- [];
+-define(UNIQ_NODE_NAME,
+ list_to_atom(?MODULE_STRING ++ "__" ++
+ atom_to_list(?FUNCTION_NAME) ++ "_" ++
+ integer_to_list(erlang:unique_integer([positive])))).
+
+%% Tests kernel application variables inet_default_listen_options and
+%% inet_default_connect_options.
default_options(Config) when is_list(Config) ->
%% First check the delay_send option
{true,true,true}=do_delay_send_1(),
@@ -199,7 +192,7 @@ default_options(Config) when is_list(Config) ->
do_delay_on_other_node(XArgs, Function) ->
Dir = filename:dirname(code:which(?MODULE)),
- {ok,Node} = test_server:start_node(test_default_options_slave,slave,
+ {ok,Node} = test_server:start_node(?UNIQ_NODE_NAME, slave,
[{args,"-pa " ++ Dir ++ " " ++ XArgs}]),
Res = rpc:call(Node,erlang,apply,[Function,[]]),
test_server:stop_node(Node),
@@ -296,11 +289,9 @@ do_delay_send_7() ->
gen_tcp:close(LS),
{B1,B2,B3}.
-controlling_process(doc) ->
- ["Open a listen port and change controlling_process for it",
- "The result should be ok of done by the owner process,"
- "Otherwise is should return {error,not_owner} or similar"];
-controlling_process(suite) -> [];
+%% Open a listen port and change controlling_process for it
+%% The result should be ok of done by the owner process,
+%% Otherwise is should return {error,not_owner} or similar.
controlling_process(Config) when is_list(Config) ->
{ok,S} = gen_tcp:listen(0,[]),
Pid2 = spawn(?MODULE,not_owner,[S]),
@@ -329,9 +320,8 @@ not_owner(S) ->
ok
end.
-controlling_process_self(doc) ->
- ["Open a listen port and assign the controlling process to "
- "it self, then exit and make sure the port is closed properly."];
+%% Open a listen port and assign the controlling process to
+%% it self, then exit and make sure the port is closed properly.
controlling_process_self(Config) when is_list(Config) ->
S = self(),
process_flag(trap_exit,true),
@@ -355,11 +345,9 @@ controlling_process_self(Config) when is_list(Config) ->
end.
-no_accept(doc) ->
- ["Open a listen port and connect to it, then close the listen port ",
- "without doing any accept. The connected socket should receive ",
- "a tcp_closed message."];
-no_accept(suite) -> [];
+%% Open a listen port and connect to it, then close the listen port
+%% without doing any accept. The connected socket should receive
+%% a tcp_closed message.
no_accept(Config) when is_list(Config) ->
{ok, L} = gen_tcp:listen(0, []),
{ok, {_, Port}} = inet:sockname(L),
@@ -369,14 +357,12 @@ no_accept(Config) when is_list(Config) ->
{tcp_closed, Client} ->
ok
after 5000 ->
- test_server:fail(never_closed)
+ ct:fail(never_closed)
end.
-close_with_pending_output(doc) ->
- ["Send several packets to a socket and close it. All packets should arrive ",
- "to the other end."];
-close_with_pending_output(suite) -> [];
+%% Send several packets to a socket and close it. All packets should
+%% arrive to the other end.
close_with_pending_output(Config) when is_list(Config) ->
{ok, L} = gen_tcp:listen(0, [binary, {active, false}]),
{ok, {_, Port}} = inet:sockname(L),
@@ -392,16 +378,16 @@ close_with_pending_output(Config) when is_list(Config) ->
gen_tcp:close(A),
gen_tcp:close(L);
{ok, Bin} ->
- test_server:fail({small_packet,
+ ct:fail({small_packet,
byte_size(Bin)});
Error ->
- test_server:fail({unexpected, Error})
+ ct:fail({unexpected, Error})
end,
ok;
{error, no_remote_hosts} ->
{skipped,"No remote hosts"};
{error, Other} ->
- ?t:fail({failed_to_start_slave_node, Other})
+ ct:fail({failed_to_start_slave_node, Other})
end.
sender(Port, Packets, Host) ->
@@ -419,9 +405,7 @@ send_loop(Sock, Data, Left) ->
send_loop(Sock, Data, Left-1).
%% Test {active,N} option
-active_n(doc) ->
- ["Verify operation of the {active,N} option."];
-active_n(suite) -> [];
+%% Verify operation of the {active,N} option.
active_n(Config) when is_list(Config) ->
N = 3,
LS = ok(gen_tcp:listen(0, [{active,N}])),
@@ -531,9 +515,7 @@ active_n(Config) when is_list(Config) ->
%% I expect propagation of a close to be quite fast
%% so 100 ms seems reasonable.
-otp_3924(doc) ->
- ["Tests that a socket can be closed fast enough."];
-otp_3924(suite) -> [];
+%% Tests that a socket can be closed fast enough.
otp_3924(Config) when is_list(Config) ->
MaxDelay = (case has_superfluous_schedulers() of
true -> 4;
@@ -551,8 +533,8 @@ otp_3924_1(MaxDelay) ->
{ok, Node} = start_node(otp_3924),
DataLen = 100*1024,
Data = otp_3924_data(DataLen),
- % Repeat the test a couple of times to prevent the test from passing
- % by chance.
+ %% Repeat the test a couple of times to prevent the test from passing
+ %% by chance.
repeat(10, fun(N) ->
ok = otp_3924(MaxDelay, Node, Data, DataLen, N)
end),
@@ -591,17 +573,17 @@ otp_3924_receive_data(LSock, Sender, MaxDelay, Len, N) ->
process_flag(priority, OP),
receive
{'EXIT', _, TimeoutRef} ->
- test_server:fail({close_not_fast_enough,MaxDelay,N});
+ ct:fail({close_not_fast_enough,MaxDelay,N});
{'EXIT', Sender, Reason} ->
- test_server:fail({sender_exited, Reason});
+ ct:fail({sender_exited, Reason});
{'EXIT', _Other, Reason} ->
- test_server:fail({linked_process_exited, Reason})
+ ct:fail({linked_process_exited, Reason})
after 0 ->
case Data of
{'EXIT', {A,B}} ->
- test_server:fail({A,B,N});
+ ct:fail({A,B,N});
{'EXIT', Failure} ->
- test_server:fail(Failure);
+ ct:fail(Failure);
_ ->
Data
end
@@ -660,8 +642,7 @@ otp_3924_sender(Receiver, Host, Port, Data) ->
end.
-data_before_close(doc) ->
- ["Tests that a huge amount of data can be received before a close."];
+%% Tests that a huge amount of data can be received before a close.
data_before_close(Config) when is_list(Config) ->
{ok, L} = gen_tcp:listen(0, [binary]),
{ok, {_, TcpPort}} = inet:sockname(L),
@@ -673,7 +654,7 @@ data_before_close(Config) when is_list(Config) ->
io:format("Result: ~p", [Result]);
{Wrong, Result} ->
io:format("Result: ~p", [Result]),
- test_server:fail({wrong_count, Wrong})
+ ct:fail({wrong_count, Wrong})
end,
ok.
@@ -698,11 +679,9 @@ make_zero_packet(N) when N rem 2 == 0 ->
make_zero_packet(N) ->
P = make_zero_packet(N div 2),
[0, P|P].
-get_status(doc) ->
- ["OTP-2924",
- "test that the socket process does not crash when sys:get_status(Pid)",
- "is called."];
-get_status(suite) -> [];
+
+%% OTP-2924. Test that the socket process does not crash when
+%% sys:get_status(Pid) is called.
get_status(Config) when is_list(Config) ->
{ok,{socket,Pid,_,_}} = gen_tcp:listen(5678,[]),
{status,Pid,_,_} = sys:get_status(Pid).
@@ -710,9 +689,11 @@ get_status(Config) when is_list(Config) ->
-define(RECOVER_SLEEP, 60000).
-define(RETRY_SLEEP, 15000).
-iter_max_socks(doc) ->
- ["Open as many sockets as possible. Do this several times and check ",
- "that we get the same number of sockets every time."];
+iter_max_socks() ->
+ [{timetrap,{minutes,30}}].
+
+%% Open as many sockets as possible. Do this several times and check
+%% that we get the same number of sockets every time.
iter_max_socks(Config) when is_list(Config) ->
N = case os:type() of {win32,_} -> 10; _ -> 20 end,
%% Run on a different node in order to limit the effect if this test fails.
@@ -741,7 +722,7 @@ do_iter_max_socks(N, First) when is_integer(First) ->
true ->
io:format("Sleeping for ~p seconds...~n",
[?RETRY_SLEEP/1000]),
- ?t:sleep(?RETRY_SLEEP),
+ ct:sleep(?RETRY_SLEEP),
io:format("Trying again...~n", []),
RetryMS = max_socks(),
if RetryMS == First ->
@@ -759,10 +740,10 @@ all_equal([Rule | T]) ->
all_equal(Rule, [Rule | T]) ->
all_equal(Rule, T);
all_equal(_, [_ | _]) ->
- ?t:sleep(?RECOVER_SLEEP), % Wait a while and *hope* that we'll
- % recover so other tests won't be
- % affected.
- ?t:fail(max_socket_mismatch);
+ ct:sleep(?RECOVER_SLEEP), % Wait a while and *hope* that we'll
+ %% recover so other tests won't be
+ %% affected.
+ ct:fail(max_socket_mismatch);
all_equal(_Rule, []) ->
ok.
@@ -804,21 +785,20 @@ start_remote(Name) ->
Pa = filename:dirname(code:which(?MODULE)),
test_server:start_node(Name, slave, [{remote, true}, {args, "-pa " ++ Pa}]).
-passive_sockets(doc) ->
- ["Tests that when 'the other side' on a passive socket closes, the connecting",
- "side still can read until the end of data."];
+%% Tests that when 'the other side' on a passive socket closes, the
+%% connecting, side still can read until the end of data.
passive_sockets(Config) when is_list(Config) ->
spawn_link(?MODULE, passive_sockets_server,
[[{active,false}],self()]),
receive
{socket,Port} -> ok
end,
- ?t:sleep(500),
+ ct:sleep(500),
case gen_tcp:connect("localhost", Port, [{active, false}]) of
{ok, Sock} ->
passive_sockets_read(Sock);
Error ->
- ?t:fail({"Could not connect to server", Error})
+ ct:fail({"Could not connect to server", Error})
end.
%%
@@ -834,7 +814,7 @@ passive_sockets_read(Sock) ->
gen_tcp:close(Sock);
Error ->
gen_tcp:close(Sock),
- ?t:fail({"Did not get {error, closed} before other error", Error})
+ ct:fail({"Did not get {error, closed} before other error", Error})
end.
passive_sockets_server(Opts, Parent) ->
@@ -844,17 +824,17 @@ passive_sockets_server(Opts, Parent) ->
Parent ! {socket,Port},
passive_sockets_server_accept(LSock);
Error ->
- ?t:fail({"Could not create listen socket", Error})
+ ct:fail({"Could not create listen socket", Error})
end.
passive_sockets_server_accept(Sock) ->
case gen_tcp:accept(Sock) of
{ok, Socket} ->
- ?t:sleep(500), % Simulate latency
+ timer:sleep(500), % Simulate latency
passive_sockets_server_send(Socket, 5),
passive_sockets_server_accept(Sock);
Error ->
- ?t:fail({"Could not accept connection", Error})
+ ct:fail({"Could not accept connection", Error})
end.
passive_sockets_server_send(Socket, 0) ->
@@ -864,16 +844,15 @@ passive_sockets_server_send(Socket, X) ->
Data = lists:duplicate(1024*X, $a),
case gen_tcp:send(Socket, Data) of
ok ->
- ?t:sleep(50), % Simulate some processing.
+ ct:sleep(50), % Simulate some processing.
passive_sockets_server_send(Socket, X-1);
{error, _Reason} ->
- ?t:fail("Failed to send data")
+ ct:fail("Failed to send data")
end.
-accept_closed_by_other_process(doc) ->
- ["Tests the return value from gen_tcp:accept when ",
- "the socket is closed from another process. (OTP-3817)"];
+%% Tests the return value from gen_tcp:accept when
+%% the socket is closed from another process. (OTP-3817)
accept_closed_by_other_process(Config) when is_list(Config) ->
Parent = self(),
{ok, ListenSocket} = gen_tcp:listen(0, []),
@@ -888,7 +867,7 @@ accept_closed_by_other_process(Config) when is_list(Config) ->
{Child, {error, closed}} ->
ok;
{Child, Other} ->
- ?t:fail({"Wrong result of gen_tcp:accept", Other})
+ ct:fail({"Wrong result of gen_tcp:accept", Other})
end.
repeat(N, Fun) ->
@@ -901,10 +880,7 @@ repeat(_, _, _) ->
ok.
-closed_socket(suite) ->
- [];
-closed_socket(doc) ->
- ["Tests the response when using a closed socket as argument"];
+%% Tests the response when using a closed socket as argument.
closed_socket(Config) when is_list(Config) ->
{ok, LS1} = gen_tcp:listen(0, []),
erlang:yield(),
@@ -916,7 +892,7 @@ closed_socket(Config) when is_list(Config) ->
%% in inet_db processes the 'EXIT' message from the port,
%% the socket is unregistered.
%%
- %% test_server:sleep(test_server:seconds(2)),
+ %% ct:sleep({seconds,2})
%%
{error, R_send} = gen_tcp:send(LS1, "data"),
{error, R_recv} = gen_tcp:recv(LS1, 17),
@@ -958,7 +934,7 @@ shutdown_common(Active) ->
do_sort(P, []),
receive
Any ->
- ?t:fail({unexpected_message,Any})
+ ct:fail({unexpected_message,Any})
after 0 -> ok
end.
@@ -1039,7 +1015,7 @@ shutdown_pending(Config) when is_list(Config) ->
io:format("~p\n", [Msg]),
N = list_to_integer(Msg) - 5;
Other ->
- ?t:fail({unexpected,Other})
+ ct:fail({unexpected,Other})
end,
ok.
@@ -1091,9 +1067,9 @@ show_econnreset_active(Config) when is_list(Config) ->
{tcp_closed, S} ->
ok;
Other ->
- ?t:fail({unexpected1, Other})
+ ct:fail({unexpected1, Other})
after 1000 ->
- ?t:fail({timeout, {server, no_tcp_closed}})
+ ct:fail({timeout, {server, no_tcp_closed}})
end,
%% Now test with option switched on.
@@ -1112,14 +1088,14 @@ show_econnreset_active(Config) when is_list(Config) ->
{tcp_closed, S1} ->
ok;
Other1 ->
- ?t:fail({unexpected2, Other1})
+ ct:fail({unexpected2, Other1})
after 1 ->
- ?t:fail({timeout, {server, no_tcp_closed}})
+ ct:fail({timeout, {server, no_tcp_closed}})
end;
Other2 ->
- ?t:fail({unexpected3, Other2})
+ ct:fail({unexpected3, Other2})
after 1000 ->
- ?t:fail({timeout, {server, no_tcp_error}})
+ ct:fail({timeout, {server, no_tcp_error}})
end.
show_econnreset_active_once(Config) when is_list(Config) ->
@@ -1133,7 +1109,7 @@ show_econnreset_active_once(Config) when is_list(Config) ->
ok = gen_tcp:close(L),
ok = inet:setopts(Client, [{linger, {true, 0}}]),
ok = gen_tcp:close(Client),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
ok = receive Msg -> {unexpected_msg, Msg} after 0 -> ok end,
ok = inet:setopts(S, [{active, once}]),
receive
@@ -1142,14 +1118,14 @@ show_econnreset_active_once(Config) when is_list(Config) ->
{tcp_closed, S} ->
ok;
Other1 ->
- ?t:fail({unexpected1, Other1})
+ ct:fail({unexpected1, Other1})
after 1 ->
- ?t:fail({timeout, {server, no_tcp_closed}})
+ ct:fail({timeout, {server, no_tcp_closed}})
end;
Other2 ->
- ?t:fail({unexpected2, Other2})
+ ct:fail({unexpected2, Other2})
after 1000 ->
- ?t:fail({timeout, {server, no_tcp_error}})
+ ct:fail({timeout, {server, no_tcp_error}})
end.
show_econnreset_passive(Config) when is_list(Config) ->
@@ -1161,7 +1137,7 @@ show_econnreset_passive(Config) when is_list(Config) ->
ok = gen_tcp:close(L),
ok = inet:setopts(S, [{linger, {true, 0}}]),
ok = gen_tcp:close(S),
- ok = ?t:sleep(1),
+ ok = ct:sleep(1),
{error, closed} = gen_tcp:recv(Client, 0),
%% Now test with option switched on.
@@ -1174,7 +1150,7 @@ show_econnreset_passive(Config) when is_list(Config) ->
ok = gen_tcp:close(L1),
ok = inet:setopts(S1, [{linger, {true, 0}}]),
ok = gen_tcp:close(S1),
- ok = ?t:sleep(1),
+ ok = ct:sleep(1),
{error, econnreset} = gen_tcp:recv(Client1, 0).
econnreset_after_sync_send(Config) when is_list(Config) ->
@@ -1186,7 +1162,7 @@ econnreset_after_sync_send(Config) when is_list(Config) ->
ok = gen_tcp:close(L),
ok = inet:setopts(S, [{linger, {true, 0}}]),
ok = gen_tcp:close(S),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
{error, closed} = gen_tcp:send(Client, "Whatever"),
%% Now test with option switched on.
@@ -1199,7 +1175,7 @@ econnreset_after_sync_send(Config) when is_list(Config) ->
ok = gen_tcp:close(L1),
ok = inet:setopts(S1, [{linger, {true, 0}}]),
ok = gen_tcp:close(S1),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
{error, econnreset} = gen_tcp:send(Client1, "Whatever").
econnreset_after_async_send_active(Config) when is_list(Config) ->
@@ -1216,23 +1192,23 @@ econnreset_after_async_send_active(Config) when is_list(Config) ->
case erlang:port_info(Client, queue_size) of
{queue_size, N} when N > 0 -> ok;
{queue_size, 0} when OS =:= win32 -> ok;
- {queue_size, 0} = T -> ?t:fail(T)
+ {queue_size, 0} = T -> ct:fail(T)
end,
ok = gen_tcp:send(S, "Whatever"),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
ok = inet:setopts(S, [{linger, {true, 0}}]),
ok = gen_tcp:close(S),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
receive
{tcp, Client, "Whatever"} ->
receive
{tcp_closed, Client} ->
ok;
Other1 ->
- ?t:fail({unexpected1, Other1})
+ ct:fail({unexpected1, Other1})
end;
Other2 ->
- ?t:fail({unexpected2, Other2})
+ ct:fail({unexpected2, Other2})
end,
%% Now test with option switched on.
@@ -1247,13 +1223,13 @@ econnreset_after_async_send_active(Config) when is_list(Config) ->
case erlang:port_info(Client1, queue_size) of
{queue_size, N1} when N1 > 0 -> ok;
{queue_size, 0} when OS =:= win32 -> ok;
- {queue_size, 0} = T1 -> ?t:fail(T1)
+ {queue_size, 0} = T1 -> ct:fail(T1)
end,
ok = gen_tcp:send(S1, "Whatever"),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
ok = inet:setopts(S1, [{linger, {true, 0}}]),
ok = gen_tcp:close(S1),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
receive
{tcp, Client1, "Whatever"} ->
receive
@@ -1262,13 +1238,13 @@ econnreset_after_async_send_active(Config) when is_list(Config) ->
{tcp_closed, Client1} ->
ok;
Other3 ->
- ?t:fail({unexpected3, Other3})
+ ct:fail({unexpected3, Other3})
end;
Other4 ->
- ?t:fail({unexpected4, Other4})
+ ct:fail({unexpected4, Other4})
end;
Other5 ->
- ?t:fail({unexpected5, Other5})
+ ct:fail({unexpected5, Other5})
end.
econnreset_after_async_send_active_once(Config) when is_list(Config) ->
@@ -1286,13 +1262,13 @@ econnreset_after_async_send_active_once(Config) when is_list(Config) ->
case erlang:port_info(Client, queue_size) of
{queue_size, N} when N > 0 -> ok;
{queue_size, 0} when OS =:= win32 -> ok;
- {queue_size, 0} = T -> ?t:fail(T)
+ {queue_size, 0} = T -> ct:fail(T)
end,
ok = gen_tcp:send(S, "Whatever"),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
ok = inet:setopts(S, [{linger, {true, 0}}]),
ok = gen_tcp:close(S),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
ok = receive Msg -> {unexpected_msg, Msg} after 0 -> ok end,
ok = inet:setopts(Client, [{active, once}]),
receive
@@ -1301,10 +1277,10 @@ econnreset_after_async_send_active_once(Config) when is_list(Config) ->
{tcp_closed, Client} ->
ok;
Other ->
- ?t:fail({unexpected1, Other})
+ ct:fail({unexpected1, Other})
end;
Other ->
- ?t:fail({unexpected2, Other})
+ ct:fail({unexpected2, Other})
end.
econnreset_after_async_send_passive(Config) when is_list(Config) ->
@@ -1325,10 +1301,10 @@ econnreset_after_async_send_passive(Config) when is_list(Config) ->
case erlang:port_info(Client, queue_size) of
{queue_size, N} when N > 0 -> ok;
{queue_size, 0} when OS =:= win32 -> ok;
- {queue_size, 0} = T -> ?t:fail(T)
+ {queue_size, 0} = T -> ct:fail(T)
end,
ok = gen_tcp:close(S),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
{error, closed} = gen_tcp:recv(Client, 0),
%% Now test with option switched on.
@@ -1344,7 +1320,7 @@ econnreset_after_async_send_passive(Config) when is_list(Config) ->
ok = gen_tcp:send(S1, "Whatever"),
ok = gen_tcp:send(Client1, Payload),
ok = gen_tcp:close(S1),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
{error, econnreset} = gen_tcp:recv(Client1, 0).
%%
@@ -1371,11 +1347,11 @@ linger_zero(Config) when is_list(Config) ->
case erlang:port_info(Client, queue_size) of
{queue_size, N} when N > 0 -> ok;
{queue_size, 0} when OS =:= win32 -> ok;
- {queue_size, 0} = T -> ?t:fail(T)
+ {queue_size, 0} = T -> ct:fail(T)
end,
ok = inet:setopts(Client, [{linger, {true, 0}}]),
ok = gen_tcp:close(Client),
- ok = ?t:sleep(1),
+ ok = ct:sleep(1),
undefined = erlang:port_info(Client, connected),
{error, econnreset} = gen_tcp:recv(S, PayloadSize).
@@ -1450,7 +1426,7 @@ busy_send_loop(Server, Client, N) ->
busy_send_2(Server, Client, N+1)
after 10000 ->
%% If this happens, see busy_send_srv
- ?t:fail({timeout,{server,not_send,flush([])}})
+ ct:fail({timeout,{server,not_send,flush([])}})
end
end.
@@ -1461,7 +1437,7 @@ busy_send_2(Server, Client, _N) ->
{Server,[closed]} ->
receive {Client,[0,{error,closed}]} -> ok end
after 10000 ->
- ?t:fail({timeout,{server,not_closed,flush([])}})
+ ct:fail({timeout,{server,not_closed,flush([])}})
end.
busy_send_srv(L, Master, Msg) ->
@@ -1551,7 +1527,7 @@ busy_disconnect_active_send(S, Data) ->
{error,closed} ->
receive
{tcp_closed,S} -> ok;
- _Other -> ?t:fail()
+ _Other -> ct:fail(failed)
end
end.
@@ -1630,7 +1606,7 @@ fill_sendq_loop(Server, Client, Reader) ->
("Got reader closed.~n"),
ok
after 3000 ->
- ?t:fail({timeout,{closed,reader}})
+ ct:fail({timeout,{closed,reader}})
end;
{Reader,[{error,closed}]} ->
io:format("Got reader closed.~n"),
@@ -1638,10 +1614,10 @@ fill_sendq_loop(Server, Client, Reader) ->
io:format("Got server closed~n"),
ok
after 3000 ->
- ?t:fail({timeout,{closed,server}})
+ ct:fail({timeout,{closed,server}})
end
after 3000 ->
- ?t:fail({timeout,{closed,[server,reader]}})
+ ct:fail({timeout,{closed,[server,reader]}})
end
end.
@@ -1849,7 +1825,7 @@ test_prio_accept_async() ->
spawn(?MODULE,priority_server,[{self(),Ref}]),
Port = receive
{Ref,P} -> P
- after 5000 -> ?t:fail({error,"helper process timeout"})
+ after 5000 -> ct:fail({error,"helper process timeout"})
end,
receive
after 3000 -> ok
@@ -1863,15 +1839,15 @@ test_prio_accept_async() ->
{Ref,{ok,[{priority,4},{tos,Tos1}]}} ->
ok;
{Ref,Error} ->
- ?t:fail({missmatch,Error})
- after 5000 -> ?t:fail({error,"helper process timeout"})
+ ct:fail({missmatch,Error})
+ after 5000 -> ct:fail({error,"helper process timeout"})
end,
receive
{Ref,{ok,[{priority,4},{tos,Tos1}]}} ->
ok;
{Ref,Error2} ->
- ?t:fail({missmatch,Error2})
- after 5000 -> ?t:fail({error,"helper process timeout"})
+ ct:fail({missmatch,Error2})
+ after 5000 -> ct:fail({error,"helper process timeout"})
end,
{ok,[{priority,4},{tos,Tos2}]} = inet:getopts(Sock2,[priority,tos]),
@@ -1893,10 +1869,6 @@ priority_server({Parent,Ref}) ->
test_prio_fail() ->
{ok,L} = gen_tcp:listen(0, [{active,false}]),
{error,_} = inet:setopts(L,[{priority,1000}]),
-% This error could only happen in linux kernels earlier than 2.6.24.4
-% Privilege check is now disabled and IP_TOS can never fail (only silently
-% be masked).
-% {error,_} = inet:setopts(L,[{tos,6 bsl 5}]),
gen_tcp:close(L),
ok.
@@ -1908,10 +1880,7 @@ test_prio_udp() ->
gen_udp:close(S),
ok.
-so_priority(doc) ->
- ["Tests the so_priority and ip_tos options on sockets when applicable."];
-so_priority(suite) ->
- [];
+%% Tests the so_priority and ip_tos options on sockets when applicable.
so_priority(Config) when is_list(Config) ->
{ok,L} = gen_tcp:listen(0, [{active,false}]),
ok = inet:setopts(L,[{priority,1}]),
@@ -1931,7 +1900,7 @@ so_priority(Config) when is_list(Config) ->
{unix,linux} ->
case os:version() of
{X,Y,_} when (X > 2) or ((X =:= 2) and (Y >= 4)) ->
- ?t:fail({error,
+ ct:fail({error,
"so_priority should work on this "
"OS, but does not"});
_ ->
@@ -1990,10 +1959,7 @@ mktmofun(Tmo,Parent,LS) ->
fun() -> Parent ! {accepted,self(), catch gen_tcp:accept(LS,Tmo)} end.
%% Accept tests
-primitive_accept(suite) ->
- [];
-primitive_accept(doc) ->
- ["Test singular accept"];
+%% Test singular accept.
primitive_accept(Config) when is_list(Config) ->
{ok,LS}=gen_tcp:listen(0,[]),
{ok,PortNo}=inet:port(LS),
@@ -2011,10 +1977,7 @@ primitive_accept(Config) when is_list(Config) ->
end.
-multi_accept_close_listen(suite) ->
- [];
-multi_accept_close_listen(doc) ->
- ["Closing listen socket when multi-accepting"];
+%% Closing listen socket when multi-accepting.
multi_accept_close_listen(Config) when is_list(Config) ->
{ok,LS}=gen_tcp:listen(0,[]),
Parent = self(),
@@ -2027,10 +1990,7 @@ multi_accept_close_listen(Config) when is_list(Config) ->
ok = ?EXPECT_ACCEPTS([{_,{error,closed}},{_,{error,closed}},
{_,{error,closed}},{_,{error,closed}}],4,500).
-accept_timeout(suite) ->
- [];
-accept_timeout(doc) ->
- ["Single accept with timeout"];
+%% Single accept with timeout.
accept_timeout(Config) when is_list(Config) ->
{ok,LS}=gen_tcp:listen(0,[]),
Parent = self(),
@@ -2038,10 +1998,7 @@ accept_timeout(Config) when is_list(Config) ->
P = spawn(F),
ok = ?EXPECT_ACCEPTS([{P,{error,timeout}}],1,2000).
-accept_timeouts_in_order(suite) ->
- [];
-accept_timeouts_in_order(doc) ->
- ["Check that multi-accept timeouts happen in the correct order"];
+%% Check that multi-accept timeouts happen in the correct order.
accept_timeouts_in_order(Config) when is_list(Config) ->
{ok,LS}=gen_tcp:listen(0,[]),
Parent = self(),
@@ -2052,10 +2009,7 @@ accept_timeouts_in_order(Config) when is_list(Config) ->
ok = ?EXPECT_ACCEPTS([{P1,{error,timeout}},{P2,{error,timeout}},
{P3,{error,timeout}},{P4,{error,timeout}}],infinity,2000).
-accept_timeouts_in_order2(suite) ->
- [];
-accept_timeouts_in_order2(doc) ->
- ["Check that multi-accept timeouts happen in the correct order (more)"];
+%% Check that multi-accept timeouts happen in the correct order (more).
accept_timeouts_in_order2(Config) when is_list(Config) ->
{ok,LS}=gen_tcp:listen(0,[]),
Parent = self(),
@@ -2066,10 +2020,7 @@ accept_timeouts_in_order2(Config) when is_list(Config) ->
ok = ?EXPECT_ACCEPTS([{P4,{error,timeout}},{P3,{error,timeout}},
{P2,{error,timeout}},{P1,{error,timeout}}],infinity,2000).
-accept_timeouts_in_order3(suite) ->
- [];
-accept_timeouts_in_order3(doc) ->
- ["Check that multi-accept timeouts happen in the correct order (even more)"];
+%% Check that multi-accept timeouts happen in the correct order (even more).
accept_timeouts_in_order3(Config) when is_list(Config) ->
{ok,LS}=gen_tcp:listen(0,[]),
Parent = self(),
@@ -2080,11 +2031,8 @@ accept_timeouts_in_order3(Config) when is_list(Config) ->
ok = ?EXPECT_ACCEPTS([{P4,{error,timeout}},{P1,{error,timeout}},
{P3,{error,timeout}},{P2,{error,timeout}}],infinity,2000).
-accept_timeouts_in_order4(suite) ->
- [];
-accept_timeouts_in_order4(doc) ->
- ["Check that multi-accept timeouts happen in the correct order after "
- "mixing millsec and sec timeouts"];
+%% Check that multi-accept timeouts happen in the correct order after
+%% mixing millsec and sec timeouts.
accept_timeouts_in_order4(Config) when is_list(Config) ->
{ok,LS}=gen_tcp:listen(0,[]),
Parent = self(),
@@ -2095,11 +2043,8 @@ accept_timeouts_in_order4(Config) when is_list(Config) ->
ok = ?EXPECT_ACCEPTS([{P1,{error,timeout}},{P2,{error,timeout}},
{P4,{error,timeout}},{P3,{error,timeout}}],infinity,2000).
-accept_timeouts_in_order5(suite) ->
- [];
-accept_timeouts_in_order5(doc) ->
- ["Check that multi-accept timeouts happen in the correct order after "
- "mixing millsec and sec timeouts (more)"];
+%% Check that multi-accept timeouts happen in the correct order after
+%% mixing millsec and sec timeouts (more).
accept_timeouts_in_order5(Config) when is_list(Config) ->
{ok,LS}=gen_tcp:listen(0,[]),
Parent = self(),
@@ -2110,11 +2055,8 @@ accept_timeouts_in_order5(Config) when is_list(Config) ->
ok = ?EXPECT_ACCEPTS([{P4,{error,timeout}},{P1,{error,timeout}},
{P3,{error,timeout}},{P2,{error,timeout}}],infinity,2000).
-accept_timeouts_in_order6(suite) ->
- [];
-accept_timeouts_in_order6(doc) ->
- ["Check that multi-accept timeouts happen in the correct order after "
- "mixing millsec and sec timeouts (even more)"];
+%% Check that multi-accept timeouts happen in the correct order after
+%% mixing millsec and sec timeouts (even more).
accept_timeouts_in_order6(Config) when is_list(Config) ->
{ok,LS}=gen_tcp:listen(0,[]),
Parent = self(),
@@ -2125,11 +2067,8 @@ accept_timeouts_in_order6(Config) when is_list(Config) ->
ok = ?EXPECT_ACCEPTS([{P4,{error,timeout}},{P2,{error,timeout}},
{P3,{error,timeout}},{P1,{error,timeout}}],infinity,2000).
-accept_timeouts_in_order7(suite) ->
- [];
-accept_timeouts_in_order7(doc) ->
- ["Check that multi-accept timeouts happen in the correct order after "
- "mixing millsec and sec timeouts (even more++)"];
+%% Check that multi-accept timeouts happen in the correct order after
+%% mixing millsec and sec timeouts (even more++).
accept_timeouts_in_order7(Config) when is_list(Config) ->
{ok,LS}=gen_tcp:listen(0,[]),
Parent = self(),
@@ -2146,10 +2085,7 @@ accept_timeouts_in_order7(Config) when is_list(Config) ->
{P1,{error,timeout}},{P3,{error,timeout}},
{P8,{error,timeout}},{P7,{error,timeout}}],infinity,2000).
-accept_timeouts_mixed(suite) ->
- [];
-accept_timeouts_mixed(doc) ->
- ["Check that multi-accept timeouts behave correctly when mixed with successful timeouts"];
+%% Check that multi-accept timeouts behave correctly when mixed with successful timeouts.
accept_timeouts_mixed(Config) when is_list(Config) ->
{ok,LS}=gen_tcp:listen(0,[]),
Parent = self(),
@@ -2169,10 +2105,7 @@ accept_timeouts_mixed(Config) when is_list(Config) ->
gen_tcp:connect("localhost",PortNo,[]),
ok = ?EXPECT_ACCEPTS([{P4,{ok,Port1}}] when is_port(Port1),infinity,100).
-killing_acceptor(suite) ->
- [];
-killing_acceptor(doc) ->
- ["Check that single acceptor behaves as expected when killed"];
+%% Check that single acceptor behaves as expected when killed.
killing_acceptor(Config) when is_list(Config) ->
{ok,LS}=gen_tcp:listen(0,[]),
Pid = spawn(fun() -> erlang:display({accepted,self(),gen_tcp:accept(LS)}) end),
@@ -2187,10 +2120,7 @@ killing_acceptor(Config) when is_list(Config) ->
false = lists:member(accepting, L2),
ok.
-killing_multi_acceptors(suite) ->
- [];
-killing_multi_acceptors(doc) ->
- ["Check that multi acceptors behaves as expected when killed"];
+%% Check that multi acceptors behaves as expected when killed.
killing_multi_acceptors(Config) when is_list(Config) ->
{ok,LS}=gen_tcp:listen(0,[]),
Parent = self(),
@@ -2212,10 +2142,7 @@ killing_multi_acceptors(Config) when is_list(Config) ->
false = lists:member(accepting, L3),
ok.
-killing_multi_acceptors2(suite) ->
- [];
-killing_multi_acceptors2(doc) ->
- ["Check that multi acceptors behaves as expected when killed (more)"];
+%% Check that multi acceptors behaves as expected when killed (more).
killing_multi_acceptors2(Config) when is_list(Config) ->
{ok,LS}=gen_tcp:listen(0,[]),
Parent = self(),
@@ -2249,11 +2176,8 @@ killing_multi_acceptors2(Config) when is_list(Config) ->
false = lists:member(accepting, L5),
ok.
-several_accepts_in_one_go(suite) ->
- [];
-several_accepts_in_one_go(doc) ->
- ["checks that multi-accept works when more than one accept can be "
- "done at once (wb test of inet_driver)"];
+%% Checks that multi-accept works when more than one accept can be
+%% done at once (wb test of inet_driver).
several_accepts_in_one_go(Config) when is_list(Config) ->
{ok,LS}=gen_tcp:listen(0,[]),
Parent = self(),
@@ -2296,11 +2220,8 @@ wait_until_accepting(Proc,N) ->
end.
-accept_system_limit(suite) ->
- [];
-accept_system_limit(doc) ->
- ["Check that accept returns {error, system_limit} "
- "(and not {error, enfile}) when running out of ports"];
+%% Check that accept returns {error, system_limit}
+%% (and not {error, enfile}) when running out of ports.
accept_system_limit(Config) when is_list(Config) ->
{ok, LS} = gen_tcp:listen(0, []),
{ok, TcpPort} = inet:port(LS),
@@ -2349,10 +2270,7 @@ open_ports(L) ->
end.
-active_once_closed(suite) ->
- [];
-active_once_closed(doc) ->
- ["Check that active once and tcp_close messages behave as expected"];
+%% Check that active once and tcp_close messages behave as expected.
active_once_closed(Config) when is_list(Config) ->
(fun() ->
{Loop,A} = setup_closed_ao(),
@@ -2400,10 +2318,7 @@ active_once_closed(Config) when is_list(Config) ->
ok = receive {tcp_closed, A} -> ok after 1000 -> error end
end)().
-send_timeout(suite) ->
- [];
-send_timeout(doc) ->
- ["Test the send_timeout socket option"];
+%% Test the send_timeout socket option.
send_timeout(Config) when is_list(Config) ->
%% Basic
BasicFun =
@@ -2484,18 +2399,13 @@ mad_sender(S) ->
flush() ->
receive
_X ->
- %erlang:display(_X),
flush()
after 0 ->
ok
end.
-send_timeout_active(suite) ->
- [];
-send_timeout_active(doc) ->
- ["Test the send_timeout socket option for active sockets"];
+%% Test the send_timeout socket option for active sockets.
send_timeout_active(Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(20)),
%% Basic
BasicFun =
fun(AutoClose) ->
@@ -2508,7 +2418,6 @@ send_timeout_active(Config) when is_list(Config) ->
{tcp, _Sock, _Data} ->
inet:setopts(A, [{active, once}]),
Res = gen_tcp:send(A,lists:duplicate(1000, $a)),
- %erlang:display(Res),
Res;
Err ->
io:format("sock closed: ~p~n", [Err]),
@@ -2523,7 +2432,6 @@ send_timeout_active(Config) when is_list(Config) ->
flush(),
BasicFun(true),
flush(),
- test_server:timetrap_cancel(Dog),
ok.
after_send_timeout(AutoClose) ->
@@ -2565,7 +2473,7 @@ get_max_diff(Max) ->
setup_closed_ao() ->
Dir = filename:dirname(code:which(?MODULE)),
- {ok,R} = test_server:start_node(test_default_options_slave,slave,
+ {ok,R} = test_server:start_node(?UNIQ_NODE_NAME, slave,
[{args,"-pa " ++ Dir}]),
Host = list_to_atom(lists:nth(2,string:tokens(atom_to_list(node()),"@"))),
{ok, L} = gen_tcp:listen(0, [{active,false},{packet,2}]),
@@ -2608,7 +2516,7 @@ setup_closed_ao() ->
setup_timeout_sink(Timeout, AutoClose) ->
Dir = filename:dirname(code:which(?MODULE)),
- {ok,R} = test_server:start_node(test_default_options_slave,slave,
+ {ok,R} = test_server:start_node(?UNIQ_NODE_NAME, slave,
[{args,"-pa " ++ Dir}]),
Host = list_to_atom(lists:nth(2,string:tokens(atom_to_list(node()),"@"))),
{ok, L} = gen_tcp:listen(0, [{active,false},{packet,2},
@@ -2651,7 +2559,7 @@ setup_timeout_sink(Timeout, AutoClose) ->
setup_active_timeout_sink(Timeout, AutoClose) ->
Dir = filename:dirname(code:which(?MODULE)),
- {ok,R} = test_server:start_node(test_default_options_slave,slave,
+ {ok,R} = test_server:start_node(?UNIQ_NODE_NAME, slave,
[{args,"-pa " ++ Dir}]),
Host = list_to_atom(lists:nth(2,string:tokens(atom_to_list(node()),"@"))),
{ok, L} = gen_tcp:listen(0, [binary,{active,false},{packet,0},{nodelay, true},{keepalive, true},
@@ -2702,10 +2610,8 @@ has_superfluous_schedulers() ->
end.
-otp_7731(suite) -> [];
-otp_7731(doc) ->
- "Leaking message from inet_drv {inet_reply,P,ok} "
- "when a socket sending resumes working after a send_timeout";
+%% Leaking message from inet_drv {inet_reply,P,ok}
+%% when a socket sending resumes working after a send_timeout.
otp_7731(Config) when is_list(Config) ->
ServerPid = spawn_link(?MODULE, otp_7731_server, [self()]),
receive {ServerPid, ready, PortNum} -> ok end,
@@ -2722,7 +2628,7 @@ otp_7731(Config) when is_list(Config) ->
%% Now make sure inet_drv does not leak any internal messages.
receive Msg ->
- test_server:fail({unexpected, Msg})
+ ct:fail({unexpected, Msg})
after 1000 ->
ok
end,
@@ -2775,8 +2681,7 @@ otp_7731_recv(Socket) ->
%% OTP-7615: TCP-ports hanging in CLOSING state when sending large
%% buffer followed by a recv() that returns error due to closed
%% connection.
-zombie_sockets(suite) -> [];
-zombie_sockets(doc) -> ["OTP-7615 Leaking closed ports."];
+%% OTP-7615 Leaking closed ports.
zombie_sockets(Config) when is_list(Config) ->
register(zombie_collector,self()),
Calls = 10,
@@ -2856,9 +2761,7 @@ zombie_serve_client(Socket, Bin) ->
gen_tcp:close(Socket),
zombie_collector ! {closed, Socket}.
-otp_7816(suite) -> [];
-otp_7816(doc) ->
- "Hanging send on windows when sending iolist with more than 16 binaries.";
+%% Hanging send on windows when sending iolist with more than 16 binaries.
otp_7816(Config) when is_list(Config) ->
Client = self(),
Server = spawn_link(fun()-> otp_7816_server(Client) end),
@@ -2947,8 +2850,7 @@ otp_7816_recv(CSocket, BytesLeft) ->
error
end.
-otp_8102(doc) -> ["Receive a packet with a faulty packet header"];
-otp_8102(suite) -> [];
+%% Receive a packet with a faulty packet header.
otp_8102(Config) when is_list(Config) ->
{ok, LSocket} = gen_tcp:listen(0, []),
{ok, {_, PortNum}} = inet:sockname(LSocket),
@@ -2988,8 +2890,7 @@ otp_8102_do(LSocket, PortNum, {Bin,PType}) ->
gen_tcp:close(SSocket),
gen_tcp:close(RSocket).
-otp_9389(doc) -> ["Verify packet_size handles long HTTP header lines"];
-otp_9389(suite) -> [];
+%% Verify packet_size handles long HTTP header lines.
otp_9389(Config) when is_list(Config) ->
{ok, LS} = gen_tcp:listen(0, [{active,false}]),
{ok, {_, PortNum}} = inet:sockname(LS),
@@ -3048,10 +2949,10 @@ otp_9389_loop(S, OrigLinkHdr, State) ->
error({timeout,header})
end.
-wrapping_oct(doc) ->
- "Check that 64bit octet counters work.";
-wrapping_oct(suite) ->
- [];
+wrapping_oct() ->
+ [{timetrap,{minutes,10}}].
+
+%% Check that 64bit octet counters work.
wrapping_oct(Config) when is_list(Config) ->
{ok,Sock} = gen_tcp:listen(0,[{active,false},{mode,binary}]),
{ok,Port} = inet:port(Sock),
diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl
index 2efbf26e1c..19cdc03603 100644
--- a/lib/kernel/test/gen_udp_SUITE.erl
+++ b/lib/kernel/test/gen_udp_SUITE.erl
@@ -17,17 +17,16 @@
%%
%% %CopyrightEnd%
%%
-%
-% test the behavior of gen_udp. Testing udp is really a very unfunny task,
-% because udp is not deterministic.
-%
+
+%%
+%% Test the behavior of gen_udp. Testing udp is really a very unfunny task,
+%% because udp is not deterministic.
+%%
-module(gen_udp_SUITE).
-include_lib("common_test/include/ct.hrl").
--define(default_timeout, ?t:minutes(1)).
-
-% XXX - we should pick a port that we _know_ is closed. That's pretty hard.
+%% XXX - we should pick a port that we _know_ is closed. That's pretty hard.
-define(CLOSED_PORT, 6666).
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
@@ -38,7 +37,9 @@
buffer_size/1, binary_passive_recv/1, bad_address/1,
read_packets/1, open_fd/1, connect/1, implicit_inet6/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[send_to_closed, buffer_size, binary_passive_recv,
@@ -62,28 +63,22 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- ?line Dog=test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config].
+ Config.
end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
ok.
%%-------------------------------------------------------------
%% Send two packets to a closed port (on some systems this causes the socket
%% to be closed).
-send_to_closed(doc) ->
- ["Tests core functionality."];
-send_to_closed(suite) ->
- [];
+%% Tests core functionality.
send_to_closed(Config) when is_list(Config) ->
- ?line {ok, Sock} = gen_udp:open(0),
- ?line ok = gen_udp:send(Sock, {127,0,0,1}, ?CLOSED_PORT, "foo"),
+ {ok, Sock} = gen_udp:open(0),
+ ok = gen_udp:send(Sock, {127,0,0,1}, ?CLOSED_PORT, "foo"),
timer:sleep(2),
- ?line ok = gen_udp:send(Sock, {127,0,0,1}, ?CLOSED_PORT, "foo"),
- ?line ok = gen_udp:close(Sock),
+ ok = gen_udp:send(Sock, {127,0,0,1}, ?CLOSED_PORT, "foo"),
+ ok = gen_udp:close(Sock),
ok.
@@ -91,19 +86,16 @@ send_to_closed(Config) when is_list(Config) ->
%%-------------------------------------------------------------
%% Test that the UDP socket buffer sizes are settable
-buffer_size(suite) ->
- [];
-buffer_size(doc) ->
- ["Test UDP buffer size setting."];
+%% Test UDP buffer size setting.
buffer_size(Config) when is_list(Config) ->
- ?line Len = 256,
- ?line Bin = list_to_binary(lists:seq(0, Len-1)),
- ?line M = 8192 div Len,
- ?line Spec0 =
+ Len = 256,
+ Bin = list_to_binary(lists:seq(0, Len-1)),
+ M = 8192 div Len,
+ Spec0 =
[{opt,M},{safe,M-3},{long,M+1},
{opt,2*M},{safe,2*M-3},{long,2*M+1},
{opt,4*M},{safe,4*M-3},{long,4*M+1}],
- ?line Spec =
+ Spec =
[case Tag of
opt ->
[{recbuf,Val*Len},{sndbuf,(Val + 2)*Len}];
@@ -115,12 +107,12 @@ buffer_size(Config) when is_list(Config) ->
[truncated,emsgsize,timeout]}
end || {Tag,Val} <- Spec0],
%%
- ?line {ok, ClientSocket} = gen_udp:open(0, [binary]),
- ?line {ok, ClientPort} = inet:port(ClientSocket),
- ?line Client = self(),
- ?line ClientIP = {127,0,0,1},
- ?line ServerIP = {127,0,0,1},
- ?line Server =
+ {ok, ClientSocket} = gen_udp:open(0, [binary]),
+ {ok, ClientPort} = inet:port(ClientSocket),
+ Client = self(),
+ ClientIP = {127,0,0,1},
+ ServerIP = {127,0,0,1},
+ Server =
spawn_link(
fun () ->
{ok, ServerSocket} = gen_udp:open(0, [binary]),
@@ -130,78 +122,77 @@ buffer_size(Config) when is_list(Config) ->
ServerSocket, 1, Spec),
ok = gen_udp:close(ServerSocket)
end),
- ?line Mref = erlang:monitor(process, Server),
- ?line receive
- {Server,port,ServerPort} ->
- ?line buffer_size_client(Server, ServerIP, ServerPort,
- ClientSocket, 1, Spec)
- end,
- ?line ok = gen_udp:close(ClientSocket),
- ?line receive
- {'DOWN',Mref,_,_,normal} ->
- ?line ok
- end.
+ Mref = erlang:monitor(process, Server),
+ receive
+ {Server,port,ServerPort} ->
+ buffer_size_client(Server, ServerIP, ServerPort,
+ ClientSocket, 1, Spec)
+ end,
+ ok = gen_udp:close(ClientSocket),
+ receive
+ {'DOWN',Mref,_,_,normal} ->
+ ok
+ end.
buffer_size_client(_, _, _, _, _, []) ->
- ?line ok;
+ ok;
buffer_size_client(Server, IP, Port,
Socket, Cnt, [Opts|T]) when is_list(Opts) ->
- ?line io:format("buffer_size_client Cnt=~w setopts ~p.~n", [Cnt,Opts]),
- ?line ok = inet:setopts(Socket, Opts),
- ?line Server ! {self(),setopts,Cnt},
- ?line receive {Server,setopts,Cnt} -> ok end,
- ?line buffer_size_client(Server, IP, Port, Socket, Cnt+1, T);
+ io:format("buffer_size_client Cnt=~w setopts ~p.~n", [Cnt,Opts]),
+ ok = inet:setopts(Socket, Opts),
+ Server ! {self(),setopts,Cnt},
+ receive {Server,setopts,Cnt} -> ok end,
+ buffer_size_client(Server, IP, Port, Socket, Cnt+1, T);
buffer_size_client(Server, IP, Port,
Socket, Cnt, [{B,Replies}|T]=Opts) when is_binary(B) ->
- ?line io:format(
- "buffer_size_client Cnt=~w send size ~w expecting ~p.~n",
- [Cnt,size(B),Replies]),
- ?line ok = gen_udp:send(Socket, IP, Port, <<Cnt,B/binary>>),
- ?line receive
- {Server,Cnt,Reply} ->
- ?line Tag =
- if
- is_tuple(Reply) ->
- element(1, Reply);
- is_atom(Reply) ->
- Reply
- end,
- ?line case lists:member(Tag, Replies) of
- true -> ok;
- false ->
- ?line
- ?t:fail({reply_mismatch,Cnt,Reply,Replies,
- byte_size(B),
- inet:getopts(Socket,
- [sndbuf,recbuf])})
- end,
- ?line buffer_size_client(Server, IP, Port, Socket, Cnt+1, T)
- after 1313 ->
- ?line buffer_size_client(Server, IP, Port, Socket, Cnt, Opts)
- end.
+ io:format(
+ "buffer_size_client Cnt=~w send size ~w expecting ~p.~n",
+ [Cnt,size(B),Replies]),
+ ok = gen_udp:send(Socket, IP, Port, <<Cnt,B/binary>>),
+ receive
+ {Server,Cnt,Reply} ->
+ Tag =
+ if
+ is_tuple(Reply) ->
+ element(1, Reply);
+ is_atom(Reply) ->
+ Reply
+ end,
+ case lists:member(Tag, Replies) of
+ true -> ok;
+ false ->
+ ct:fail({reply_mismatch,Cnt,Reply,Replies,
+ byte_size(B),
+ inet:getopts(Socket,
+ [sndbuf,recbuf])})
+ end,
+ buffer_size_client(Server, IP, Port, Socket, Cnt+1, T)
+ after 1313 ->
+ buffer_size_client(Server, IP, Port, Socket, Cnt, Opts)
+ end.
buffer_size_server(_, _, _, _, _, []) ->
ok;
buffer_size_server(Client, IP, Port,
Socket, Cnt, [Opts|T]) when is_list(Opts) ->
receive {Client,setopts,Cnt} -> ok end,
- ?line io:format("buffer_size_server Cnt=~w setopts ~p.~n", [Cnt,Opts]),
+ io:format("buffer_size_server Cnt=~w setopts ~p.~n", [Cnt,Opts]),
ok = inet:setopts(Socket, Opts),
Client ! {self(),setopts,Cnt},
buffer_size_server(Client, IP, Port, Socket, Cnt+1, T);
buffer_size_server(Client, IP, Port,
Socket, Cnt, [{B,_}|T]) when is_binary(B) ->
- ?line io:format(
- "buffer_size_server Cnt=~w expecting size ~w.~n",
- [Cnt,size(B)]),
+ io:format(
+ "buffer_size_server Cnt=~w expecting size ~w.~n",
+ [Cnt,size(B)]),
Client !
{self(),Cnt,
case buffer_size_server_recv(Socket, IP, Port, Cnt) of
D when is_binary(D) ->
SizeD = byte_size(D),
- ?line io:format(
- "buffer_size_server Cnt=~w received size ~w.~n",
- [Cnt,SizeD]),
+ io:format(
+ "buffer_size_server Cnt=~w received size ~w.~n",
+ [Cnt,SizeD]),
case B of
D ->
correct;
@@ -211,9 +202,9 @@ buffer_size_server(Client, IP, Port,
{unexpected,D}
end;
Error ->
- ?line io:format(
- "buffer_size_server Cnt=~w received error ~w.~n",
- [Cnt,Error]),
+ io:format(
+ "buffer_size_server Cnt=~w received error ~w.~n",
+ [Cnt,Error]),
Error
end},
buffer_size_server(Client, IP, Port, Socket, Cnt+1, T).
@@ -236,50 +227,44 @@ buffer_size_server_recv(Socket, IP, Port, Cnt) ->
%% OTP-3823 gen_udp:recv does not return address in binary mode
%%
-binary_passive_recv(suite) ->
- [];
-binary_passive_recv(doc) ->
- ["OTP-3823 gen_udp:recv does not return address in binary mode"];
+%% OTP-3823 gen_udp:recv does not return address in binary mode.
binary_passive_recv(Config) when is_list(Config) ->
- ?line D1 = "The quick brown fox jumps over a lazy dog",
- ?line D2 = list_to_binary(D1),
- ?line D3 = ["The quick", <<" brown ">>, "fox jumps ", <<"over ">>,
- <<>>, $a, [[], " lazy ", <<"dog">>]],
- ?line D2 = iolist_to_binary(D3),
- ?line B = D2,
- ?line {ok, R} = gen_udp:open(0, [binary, {active, false}]),
- ?line {ok, RP} = inet:port(R),
- ?line {ok, S} = gen_udp:open(0),
- ?line {ok, SP} = inet:port(S),
- ?line ok = gen_udp:send(S, localhost, RP, D1),
- ?line {ok, {{127, 0, 0, 1}, SP, B}} = gen_udp:recv(R, byte_size(B)+1),
- ?line ok = gen_udp:send(S, localhost, RP, D2),
- ?line {ok, {{127, 0, 0, 1}, SP, B}} = gen_udp:recv(R, byte_size(B)+1),
- ?line ok = gen_udp:send(S, localhost, RP, D3),
- ?line {ok, {{127, 0, 0, 1}, SP, B}} = gen_udp:recv(R, byte_size(B)+1),
- ?line ok = gen_udp:close(S),
- ?line ok = gen_udp:close(R),
+ D1 = "The quick brown fox jumps over a lazy dog",
+ D2 = list_to_binary(D1),
+ D3 = ["The quick", <<" brown ">>, "fox jumps ", <<"over ">>,
+ <<>>, $a, [[], " lazy ", <<"dog">>]],
+ D2 = iolist_to_binary(D3),
+ B = D2,
+ {ok, R} = gen_udp:open(0, [binary, {active, false}]),
+ {ok, RP} = inet:port(R),
+ {ok, S} = gen_udp:open(0),
+ {ok, SP} = inet:port(S),
+ ok = gen_udp:send(S, localhost, RP, D1),
+ {ok, {{127, 0, 0, 1}, SP, B}} = gen_udp:recv(R, byte_size(B)+1),
+ ok = gen_udp:send(S, localhost, RP, D2),
+ {ok, {{127, 0, 0, 1}, SP, B}} = gen_udp:recv(R, byte_size(B)+1),
+ ok = gen_udp:send(S, localhost, RP, D3),
+ {ok, {{127, 0, 0, 1}, SP, B}} = gen_udp:recv(R, byte_size(B)+1),
+ ok = gen_udp:close(S),
+ ok = gen_udp:close(R),
ok.
%%-------------------------------------------------------------
%% OTP-3836 inet_udp crashes when IP-address is larger than 255.
-bad_address(suite) ->
- [];
-bad_address(doc) ->
- ["OTP-3836 inet_udp crashes when IP-address is larger than 255."];
+%% OTP-3836 inet_udp crashes when IP-address is larger than 255.
bad_address(Config) when is_list(Config) ->
- ?line {ok, R} = gen_udp:open(0),
- ?line {ok, RP} = inet:port(R),
- ?line {ok, S} = gen_udp:open(0),
- ?line {ok, _SP} = inet:port(S),
- ?line {'EXIT', badarg} =
+ {ok, R} = gen_udp:open(0),
+ {ok, RP} = inet:port(R),
+ {ok, S} = gen_udp:open(0),
+ {ok, _SP} = inet:port(S),
+ {'EXIT', badarg} =
(catch gen_udp:send(S, {127,0,0,1,0}, RP, "void")),
- ?line {'EXIT', badarg} =
+ {'EXIT', badarg} =
(catch gen_udp:send(S, {127,0,0,256}, RP, "void")),
- ?line ok = gen_udp:close(S),
- ?line ok = gen_udp:close(R),
+ ok = gen_udp:close(S),
+ ok = gen_udp:close(R),
ok.
@@ -298,8 +283,7 @@ bad_address(Config) when is_list(Config) ->
%% What happens on the SMP emulator remains to be seen...
%%
-read_packets(doc) ->
- ["OTP-6249 UDP option for number of packet reads."];
+%% OTP-6249 UDP option for number of packet reads.
read_packets(Config) when is_list(Config) ->
case erlang:system_info(smp_support) of
false ->
@@ -311,35 +295,35 @@ read_packets(Config) when is_list(Config) ->
end.
read_packets_1() ->
- ?line N1 = 5,
- ?line N2 = 7,
- ?line {ok,R} = gen_udp:open(0, [{read_packets,N1}]),
- ?line {ok,RP} = inet:port(R),
- ?line {ok,Node} = start_node(gen_udp_SUITE_read_packets),
- ?line Die = make_ref(),
- ?line Loop = erlang:spawn_link(fun () -> infinite_loop(Die) end),
+ N1 = 5,
+ N2 = 7,
+ {ok,R} = gen_udp:open(0, [{read_packets,N1}]),
+ {ok,RP} = inet:port(R),
+ {ok,Node} = start_node(gen_udp_SUITE_read_packets),
+ Die = make_ref(),
+ Loop = erlang:spawn_link(fun () -> infinite_loop(Die) end),
%%
- ?line Msgs1 = [erlang:integer_to_list(M) || M <- lists:seq(1, N1*3)],
- ?line [V1|_] = read_packets_test(R, RP, Msgs1, Node),
- ?line {ok,[{read_packets,N1}]} = inet:getopts(R, [read_packets]),
+ Msgs1 = [erlang:integer_to_list(M) || M <- lists:seq(1, N1*3)],
+ [V1|_] = read_packets_test(R, RP, Msgs1, Node),
+ {ok,[{read_packets,N1}]} = inet:getopts(R, [read_packets]),
%%
- ?line ok = inet:setopts(R, [{read_packets,N2}]),
- ?line Msgs2 = [erlang:integer_to_list(M) || M <- lists:seq(1, N2*3)],
- ?line [V2|_] = read_packets_test(R, RP, Msgs2, Node),
- ?line {ok,[{read_packets,N2}]} = inet:getopts(R, [read_packets]),
+ ok = inet:setopts(R, [{read_packets,N2}]),
+ Msgs2 = [erlang:integer_to_list(M) || M <- lists:seq(1, N2*3)],
+ [V2|_] = read_packets_test(R, RP, Msgs2, Node),
+ {ok,[{read_packets,N2}]} = inet:getopts(R, [read_packets]),
%%
- ?line stop_node(Node),
- ?line Mref = erlang:monitor(process, Loop),
- ?line Loop ! Die,
- ?line receive
- {'DOWN',Mref,_,_, normal} ->
- case {V1,V2} of
- {N1,N2} ->
- ok;
- _ when V1 =/= N1, V2 =/= N2 ->
- ok
- end
- end.
+ stop_node(Node),
+ Mref = erlang:monitor(process, Loop),
+ Loop ! Die,
+ receive
+ {'DOWN',Mref,_,_, normal} ->
+ case {V1,V2} of
+ {N1,N2} ->
+ ok;
+ _ when V1 =/= N1, V2 =/= N2 ->
+ ok
+ end
+ end.
infinite_loop(Die) ->
receive
@@ -407,21 +391,21 @@ read_packets_recv(N) ->
read_packets_verify(R, SP, Msg, Trace) ->
lists:reverse(
- lists:sort(read_packets_verify(R, SP, Msg, Trace, 0))).
-
+ lists:sort(read_packets_verify(R, SP, Msg, Trace, 0))).
+
read_packets_verify(R, SP, Msgs, [{trace,Self,OutIn,_}|Trace], M)
when Self =:= self(), OutIn =:= out;
Self =:= self(), OutIn =:= in ->
push(M, read_packets_verify(R, SP, Msgs, Trace, 0));
read_packets_verify(R, SP, [Msg|Msgs],
- [{trace,Self,'receive',{udp,R,{127,0,0,1},SP,Msg}}
- |Trace], M)
+ [{trace,Self,'receive',{udp,R,{127,0,0,1},SP,Msg}}
+ |Trace], M)
when Self =:= self() ->
read_packets_verify(R, SP, Msgs, Trace, M+1);
read_packets_verify(_R, _SP, [], [], M) ->
push(M, []);
read_packets_verify(_R, _SP, Msgs, Trace, M) ->
- ?t:fail({read_packets_verify,mismatch,Msgs,Trace,M}).
+ ct:fail({read_packets_verify,mismatch,Msgs,Trace,M}).
push(0, Vs) ->
Vs;
@@ -438,10 +422,7 @@ flush() ->
-open_fd(suite) ->
- [];
-open_fd(doc) ->
- ["Test that the 'fd' option works"];
+%% Test that the 'fd' option works.
open_fd(Config) when is_list(Config) ->
Msg = "Det gör ont när knoppar brista. Varför skulle annars våren tveka?",
Addr = {127,0,0,1},
@@ -460,10 +441,10 @@ open_fd(Config) when is_list(Config) ->
{udp,S3,Addr,P2,Msg} ->
ok
after 1000 ->
- ?t:fail(io_lib:format("~w", [flush()]))
+ ct:fail(io_lib:format("~w", [flush()]))
end
after 1000 ->
- ?t:fail(io_lib:format("~w", [flush()]))
+ ct:fail(io_lib:format("~w", [flush()]))
end.
active_n(Config) when is_list(Config) ->
@@ -569,88 +550,84 @@ active_n(Config) when is_list(Config) ->
ok = gen_udp:close(S1),
ok.
-%
-% Utils
-%
+%%
+%% Utils
+%%
+
start_node(Name) ->
Pa = filename:dirname(code:which(?MODULE)),
- ?t:start_node(Name, slave, [{args, "-pa " ++ Pa}]).
+ test_server:start_node(Name, slave, [{args, "-pa " ++ Pa}]).
stop_node(Node) ->
- ?t:stop_node(Node).
+ test_server:stop_node(Node).
-connect(suite) ->
- [];
-connect(doc) ->
- ["Test that connect/3 has effect"];
+%% Test that connect/3 has effect.
connect(Config) when is_list(Config) ->
- ?line Addr = {127,0,0,1},
- ?line {ok,S1} = gen_udp:open(0),
- ?line {ok,P1} = inet:port(S1),
- ?line {ok,S2} = gen_udp:open(0),
- ?line ok = inet:setopts(S2, [{active,false}]),
- ?line ok = gen_udp:close(S1),
- ?line ok = gen_udp:connect(S2, Addr, P1),
- ?line ok = gen_udp:send(S2, <<16#deadbeef:32>>),
- ?line ok = case gen_udp:recv(S2, 0, 5) of
- {error,econnrefused} -> ok;
- {error,econnreset} -> ok;
- Other -> Other
- end,
+ Addr = {127,0,0,1},
+ {ok,S1} = gen_udp:open(0),
+ {ok,P1} = inet:port(S1),
+ {ok,S2} = gen_udp:open(0),
+ ok = inet:setopts(S2, [{active,false}]),
+ ok = gen_udp:close(S1),
+ ok = gen_udp:connect(S2, Addr, P1),
+ ok = gen_udp:send(S2, <<16#deadbeef:32>>),
+ ok = case gen_udp:recv(S2, 0, 5) of
+ {error,econnrefused} -> ok;
+ {error,econnreset} -> ok;
+ Other -> Other
+ end,
ok.
implicit_inet6(Config) when is_list(Config) ->
- ?line Host = ok(inet:gethostname()),
- ?line
- case inet:getaddr(Host, inet6) of
- {ok,Addr} ->
- ?line implicit_inet6(Host, Addr);
- {error,Reason} ->
- {skip,
- "Can not look up IPv6 address: "
- ++atom_to_list(Reason)}
- end.
+ Host = ok(inet:gethostname()),
+ case inet:getaddr(Host, inet6) of
+ {ok,Addr} ->
+ implicit_inet6(Host, Addr);
+ {error,Reason} ->
+ {skip,
+ "Can not look up IPv6 address: "
+ ++atom_to_list(Reason)}
+ end.
implicit_inet6(Host, Addr) ->
- ?line Active = {active,false},
- ?line
- case gen_udp:open(0, [inet6,Active]) of
- {ok,S1} ->
- ?line Loopback = {0,0,0,0,0,0,0,1},
- ?line io:format("~s ~p~n", ["::1",Loopback]),
- ?line implicit_inet6(S1, Active, Loopback),
- ?line ok = gen_udp:close(S1),
- %%
- ?line Localhost = "localhost",
- ?line Localaddr = ok(inet:getaddr(Localhost, inet6)),
- ?line io:format("~s ~p~n", [Localhost,Localaddr]),
- ?line S2 = ok(gen_udp:open(0, [{ip,Localaddr},Active])),
- ?line implicit_inet6(S2, Active, Localaddr),
- ?line ok = gen_udp:close(S2),
- %%
- ?line io:format("~s ~p~n", [Host,Addr]),
- ?line S3 = ok(gen_udp:open(0, [{ifaddr,Addr},Active])),
- ?line implicit_inet6(S3, Active, Addr),
- ?line ok = gen_udp:close(S3);
- _ ->
- {skip,"IPv6 not supported"}
- end.
+ Active = {active,false},
+ case gen_udp:open(0, [inet6,Active]) of
+ {ok,S1} ->
+ Loopback = {0,0,0,0,0,0,0,1},
+ io:format("~s ~p~n", ["::1",Loopback]),
+ implicit_inet6(S1, Active, Loopback),
+ ok = gen_udp:close(S1),
+ %%
+ Localhost = "localhost",
+ Localaddr = ok(inet:getaddr(Localhost, inet6)),
+ io:format("~s ~p~n", [Localhost,Localaddr]),
+ S2 = ok(gen_udp:open(0, [{ip,Localaddr},Active])),
+ implicit_inet6(S2, Active, Localaddr),
+ ok = gen_udp:close(S2),
+ %%
+ io:format("~s ~p~n", [Host,Addr]),
+ S3 = ok(gen_udp:open(0, [{ifaddr,Addr},Active])),
+ implicit_inet6(S3, Active, Addr),
+ ok = gen_udp:close(S3);
+ _ ->
+ {skip,"IPv6 not supported"}
+ end.
implicit_inet6(S1, Active, Addr) ->
- ?line P1 = ok(inet:port(S1)),
- ?line S2 = ok(gen_udp:open(0, [inet6,Active])),
- ?line P2 = ok(inet:port(S2)),
- ?line ok = gen_udp:connect(S2, Addr, P1),
- ?line ok = gen_udp:connect(S1, Addr, P2),
- ?line {Addr,P2} = ok(inet:peername(S1)),
- ?line {Addr,P1} = ok(inet:peername(S2)),
- ?line {Addr,P1} = ok(inet:sockname(S1)),
- ?line {Addr,P2} = ok(inet:sockname(S2)),
- ?line ok = gen_udp:send(S1, Addr, P2, "ping"),
- ?line {Addr,P1,"ping"} = ok(gen_udp:recv(S2, 1024, 1000)),
- ?line ok = gen_udp:send(S2, Addr, P1, "pong"),
- ?line {Addr,P2,"pong"} = ok(gen_udp:recv(S1, 1024)),
- ?line ok = gen_udp:close(S2).
+ P1 = ok(inet:port(S1)),
+ S2 = ok(gen_udp:open(0, [inet6,Active])),
+ P2 = ok(inet:port(S2)),
+ ok = gen_udp:connect(S2, Addr, P1),
+ ok = gen_udp:connect(S1, Addr, P2),
+ {Addr,P2} = ok(inet:peername(S1)),
+ {Addr,P1} = ok(inet:peername(S2)),
+ {Addr,P1} = ok(inet:sockname(S1)),
+ {Addr,P2} = ok(inet:sockname(S2)),
+ ok = gen_udp:send(S1, Addr, P2, "ping"),
+ {Addr,P1,"ping"} = ok(gen_udp:recv(S2, 1024, 1000)),
+ ok = gen_udp:send(S2, Addr, P1, "pong"),
+ {Addr,P2,"pong"} = ok(gen_udp:recv(S1, 1024)),
+ ok = gen_udp:close(S2).
ok({ok,V}) -> V.
diff --git a/lib/kernel/test/global_SUITE.erl b/lib/kernel/test/global_SUITE.erl
index 0046fdafa4..dd4cf82d4a 100644
--- a/lib/kernel/test/global_SUITE.erl
+++ b/lib/kernel/test/global_SUITE.erl
@@ -19,8 +19,6 @@
%%
-module(global_SUITE).
-%-define(line_trace, 1).
-
-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,
init_per_suite/1, end_per_suite/1,
names/1, names_hidden/1, locks/1, locks_hidden/1,
@@ -61,7 +59,8 @@
-define(GLOBAL_LOCK, global).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
all() ->
case init:get_argument(ring_line) of
@@ -86,10 +85,10 @@ groups() ->
ring]}].
init_per_group(_GroupName, Config) ->
- Config.
+ Config.
end_per_group(_GroupName, Config) ->
- Config.
+ Config.
init_per_suite(Config) ->
Config.
@@ -99,9 +98,9 @@ end_per_suite(_Config) ->
-define(TESTCASE, testcase_name).
--define(testcase, ?config(?TESTCASE, Config)).
+-define(testcase, proplists:get_value(?TESTCASE, Config)).
-define(nodes_tag, '$global_nodes').
--define(registered, ?config(registered, Config)).
+-define(registered, proplists:get_value(registered, Config)).
init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) ->
ok = gen_server:call(global_name_server, high_level_trace_start,infinity),
@@ -115,16 +114,16 @@ init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) ->
end_per_testcase(_Case, Config) ->
ct:log("Calling end_per_testcase!",[]),
- ?line write_high_level_trace(Config),
- ?line _ =
+ write_high_level_trace(Config),
+ _ =
gen_server:call(global_name_server, high_level_trace_stop, infinity),
[global:unregister_name(N) || N <- global:registered_names()],
- ?line InitRegistered = ?registered,
- ?line Registered = registered(),
- ?line [io:format("~s local names: ~p~n", [What, N]) ||
- {What, N} <- [{"Added", Registered -- InitRegistered},
- {"Removed", InitRegistered -- Registered}],
- N =/= []],
+ InitRegistered = ?registered,
+ Registered = registered(),
+ [io:format("~s local names: ~p~n", [What, N]) ||
+ {What, N} <- [{"Added", Registered -- InitRegistered},
+ {"Removed", InitRegistered -- Registered}],
+ N =/= []],
ok.
@@ -147,12 +146,11 @@ end_per_testcase(_Case, Config) ->
%%% and releases the lock. Now the name should exist on both our own node
%%% and on the slave node (we wait until that is true; it seems that we
%%% can do rpc calls to another node before the connection is really up).
-register_1(suite) -> [];
register_1(Config) when is_list(Config) ->
Timeout = 15,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
+ init_condition(Config),
P = spawn_link(?MODULE, lock_global, [self(), Config]),
receive
{P, ok} ->
@@ -161,7 +159,7 @@ register_1(Config) when is_list(Config) ->
end,
P ! step2,
io:format("p1: sent step2~n"),
- ?line yes = global:register_name(foo, self()),
+ yes = global:register_name(foo, self()),
io:format("p1: registered~n"),
P ! step3,
receive
@@ -172,11 +170,11 @@ register_1(Config) when is_list(Config) ->
I =:= I2 ->
ok;
true ->
- test_server:fail({notsync, I, I2})
+ ct:fail({notsync, I, I2})
end,
- ?line _ = global:unregister_name(foo),
+ _ = global:unregister_name(foo),
write_high_level_trace(Config),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
lock_global(Parent, Config) ->
@@ -203,7 +201,7 @@ lock_global(Parent, Config) ->
io:format("p2: received step3~n"),
I = global:whereis_name(foo),
io:format("p2: name ~p~n", [I]),
- ?line ?UNTIL(I =:= rpc:call(N1, global, whereis_name, [foo])),
+ ?UNTIL(I =:= rpc:call(N1, global, whereis_name, [foo])),
I2 = I,
slave:stop(N1),
io:format("p2: name2 ~p~n", [I2]),
@@ -216,75 +214,73 @@ lock_global(Parent, Config) ->
%%% 'try_again_locker' would be called, and this time cause both 1 and 2
%%% to obtain a lock for 'global' on node 3, which would keep the
%%% name registry from ever becoming consistent again.
-both_known_1(suite) -> [];
both_known_1(Config) when is_list(Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
+ init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ OrigNames = global:registered_names(),
- ?line [Cp1, Cp2, Cp3] = start_nodes([cp1, cp2, cp3], slave, Config),
+ [Cp1, Cp2, Cp3] = start_nodes([cp1, cp2, cp3], slave, Config),
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
- ?line rpc_disconnect_node(Cp1, Cp2, Config),
+ rpc_disconnect_node(Cp1, Cp2, Config),
- ?line {_Pid1, yes} = rpc:call(Cp1, ?MODULE, start_proc, [p1]),
- ?line {_Pid2, yes} = rpc:call(Cp2, ?MODULE, start_proc, [p2]),
+ {_Pid1, yes} = rpc:call(Cp1, ?MODULE, start_proc, [p1]),
+ {_Pid2, yes} = rpc:call(Cp2, ?MODULE, start_proc, [p2]),
- ?line Names10 = rpc:call(Cp1, global, registered_names, []),
- ?line Names20 = rpc:call(Cp2, global, registered_names, []),
- ?line Names30 = rpc:call(Cp3, global, registered_names, []),
+ Names10 = rpc:call(Cp1, global, registered_names, []),
+ Names20 = rpc:call(Cp2, global, registered_names, []),
+ Names30 = rpc:call(Cp3, global, registered_names, []),
Names1 = Names10 -- OrigNames,
Names2 = Names20 -- OrigNames,
Names3 = Names30 -- OrigNames,
- ?line [p1] = lists:sort(Names1),
- ?line [p2] = lists:sort(Names2),
- ?line [p1, p2] = lists:sort(Names3),
+ [p1] = lists:sort(Names1),
+ [p2] = lists:sort(Names2),
+ [p1, p2] = lists:sort(Names3),
- ?line Locker = spawn(Cp3, ?MODULE, lock_global2, [{global, l3},
- self()]),
+ Locker = spawn(Cp3, ?MODULE, lock_global2, [{global, l3},
+ self()]),
- ?line receive
- {locked, S} ->
- true = S
- end,
+ receive
+ {locked, S} ->
+ true = S
+ end,
- ?line pong = rpc:call(Cp1, net_adm, ping, [Cp2]),
+ pong = rpc:call(Cp1, net_adm, ping, [Cp2]),
%% Bring cp1 and cp2 together, while someone has locked global.
%% They will now loop in 'loop_locker'.
- ?line Names10_2 = rpc:call(Cp1, global, registered_names, []),
- ?line Names20_2 = rpc:call(Cp2, global, registered_names, []),
- ?line Names30_2 = rpc:call(Cp3, global, registered_names, []),
+ Names10_2 = rpc:call(Cp1, global, registered_names, []),
+ Names20_2 = rpc:call(Cp2, global, registered_names, []),
+ Names30_2 = rpc:call(Cp3, global, registered_names, []),
Names1_2 = Names10_2 -- OrigNames,
Names2_2 = Names20_2 -- OrigNames,
Names3_2 = Names30_2 -- OrigNames,
- ?line [p1] = lists:sort(Names1_2),
- ?line [p2] = lists:sort(Names2_2),
- ?line [p1, p2] = lists:sort(Names3_2),
+ [p1] = lists:sort(Names1_2),
+ [p2] = lists:sort(Names2_2),
+ [p1, p2] = lists:sort(Names3_2),
%% Let go of the lock, and expect the lockers to resolve the name
%% registry.
Locker ! {ok, self()},
- ?line
?UNTIL(begin
- ?line Names10_3 = rpc:call(Cp1, global, registered_names, []),
- ?line Names20_3 = rpc:call(Cp2, global, registered_names, []),
- ?line Names30_3 = rpc:call(Cp3, global, registered_names, []),
-
+ Names10_3 = rpc:call(Cp1, global, registered_names, []),
+ Names20_3 = rpc:call(Cp2, global, registered_names, []),
+ Names30_3 = rpc:call(Cp3, global, registered_names, []),
+
Names1_3 = Names10_3 -- OrigNames,
Names2_3 = Names20_3 -- OrigNames,
Names3_3 = Names30_3 -- OrigNames,
-
+
N1 = lists:sort(Names1_3),
N2 = lists:sort(Names2_3),
N3 = lists:sort(Names3_3),
@@ -296,51 +292,49 @@ both_known_1(Config) when is_list(Config) ->
stop_node(Cp2),
stop_node(Cp3),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-lost_unregister(suite) -> [];
-lost_unregister(doc) ->
- ["OTP-6428. An unregistered name reappears."];
+%% OTP-6428. An unregistered name reappears.
lost_unregister(Config) when is_list(Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
+ init_condition(Config),
- ?line {ok, B} = start_node(b, Config),
- ?line {ok, C} = start_node(c, Config),
+ {ok, B} = start_node(b, Config),
+ {ok, C} = start_node(c, Config),
Nodes = [node(), B, C],
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
- % start a proc and register it
- ?line {Pid, yes} = start_proc(test),
+ %% start a proc and register it
+ {Pid, yes} = start_proc(test),
- ?line ?UNTIL(Pid =:= global:whereis_name(test)),
- ?line check_everywhere(Nodes, test, Config),
+ ?UNTIL(Pid =:= global:whereis_name(test)),
+ check_everywhere(Nodes, test, Config),
- ?line rpc_disconnect_node(B, C, Config),
- ?line check_everywhere(Nodes, test, Config),
- ?line _ = rpc:call(B, global, unregister_name, [test]),
- ?line ?UNTIL(undefined =:= global:whereis_name(test)),
- ?line Pid = rpc:call(C, global, whereis_name, [test]),
- ?line check_everywhere(Nodes--[C], test, Config),
- ?line pong = rpc:call(B, net_adm, ping, [C]),
+ rpc_disconnect_node(B, C, Config),
+ check_everywhere(Nodes, test, Config),
+ _ = rpc:call(B, global, unregister_name, [test]),
+ ?UNTIL(undefined =:= global:whereis_name(test)),
+ Pid = rpc:call(C, global, whereis_name, [test]),
+ check_everywhere(Nodes--[C], test, Config),
+ pong = rpc:call(B, net_adm, ping, [C]),
%% Now the name has reappeared on node B.
- ?line ?UNTIL(Pid =:= global:whereis_name(test)),
- ?line check_everywhere(Nodes, test, Config),
+ ?UNTIL(Pid =:= global:whereis_name(test)),
+ check_everywhere(Nodes, test, Config),
exit_p(Pid),
- ?line ?UNTIL(undefined =:= global:whereis_name(test)),
- ?line check_everywhere(Nodes, test, Config),
+ ?UNTIL(undefined =:= global:whereis_name(test)),
+ check_everywhere(Nodes, test, Config),
write_high_level_trace(Config),
stop_node(B),
stop_node(C),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-define(UNTIL_LOOP, 300).
@@ -350,7 +344,7 @@ lost_unregister(Config) when is_list(Config) ->
init_high_level_trace(Time) ->
Mul = try
test_server:timetrap_scale_factor()
- catch _:_ -> 1
+ catch _:_ -> 1
end,
put(?end_tag, msec() + Time * Mul * 1000),
%% Assures that started nodes start the high level trace automatically.
@@ -395,7 +389,7 @@ write_high_level_trace(Nodes, Config) ->
%% 'info' returns more than the trace, which is nice.
Data = [{Node, {info, rpc:call(Node, global, info, [])}} ||
Node <- Nodes],
- Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
DataFile = filename:join([Dir, lists:concat(["global_", ?testcase])]),
file:write_file(DataFile, term_to_binary({high_level_trace, When, Data})).
@@ -413,37 +407,35 @@ lock_global2(Id, Parent) ->
%% erl -sname XXX -rsh ctrsh where XX not in [cp1, cp2, cp3]
%%-----------------------------------------------------------------
-%cp1 - cp3 are started, and the name 'test' registered for a process on
-%test_server. Then it is checked that the name is registered on all
-%nodes, using whereis_name. Check that the same
-%name can't be registered with another value. Exit the registered
-%process and check that the name disappears. Register a new process
-%(Pid2) under the name 'test'. Let another new process (Pid3)
-%reregister itself under the same name. Test global:send/2. Test
-%unregister. Kill Pid3. Start a process (Pid6) on cp3,
-%register it as 'test', stop cp1 - cp3 and check that 'test' disappeared.
-%Kill Pid2 and check that 'test' isn't registered.
-
-names(suite) -> [];
+%% cp1 - cp3 are started, and the name 'test' registered for a process on
+%% test_server. Then it is checked that the name is registered on all
+%% nodes, using whereis_name. Check that the same
+%% name can't be registered with another value. Exit the registered
+%% process and check that the name disappears. Register a new process
+%% (Pid2) under the name 'test'. Let another new process (Pid3)
+%% reregister itself under the same name. Test global:send/2. Test
+%% unregister. Kill Pid3. Start a process (Pid6) on cp3,
+%% register it as 'test', stop cp1 - cp3 and check that 'test' disappeared.
+%% Kill Pid2 and check that 'test' isn't registered.
+
names(Config) when is_list(Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
- ?line {ok, Cp1} = start_node(cp1, Config),
- ?line {ok, Cp2} = start_node(cp2, Config),
- ?line {ok, Cp3} = start_node(cp3, Config),
+ {ok, Cp1} = start_node(cp1, Config),
+ {ok, Cp2} = start_node(cp2, Config),
+ {ok, Cp3} = start_node(cp3, Config),
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
- % start a proc and register it
- ?line {Pid, yes} = start_proc(test),
+ %% start a proc and register it
+ {Pid, yes} = start_proc(test),
- % test that it is registered at all nodes
- ?line
- ?UNTIL(begin
+ %% test that it is registered at all nodes
+ ?UNTIL(begin
(Pid =:= global:whereis_name(test)) and
(Pid =:= rpc:call(Cp1, global, whereis_name, [test])) and
(Pid =:= rpc:call(Cp2, global, whereis_name, [test])) and
@@ -451,156 +443,148 @@ names(Config) when is_list(Config) ->
([test] =:= global:registered_names() -- OrigNames)
end),
- % try to register the same name
- ?line no = global:register_name(test, self()),
- ?line no = rpc:call(Cp1, global, register_name, [test, self()]),
+ %% try to register the same name
+ no = global:register_name(test, self()),
+ no = rpc:call(Cp1, global, register_name, [test, self()]),
- % let process exit, check that it is unregistered automatically
+ %% let process exit, check that it is unregistered automatically
exit_p(Pid),
- ?line
- ?UNTIL((undefined =:= global:whereis_name(test)) and
+ ?UNTIL((undefined =:= global:whereis_name(test)) and
(undefined =:= rpc:call(Cp1, global, whereis_name, [test])) and
(undefined =:= rpc:call(Cp2, global, whereis_name, [test])) and
(undefined =:= rpc:call(Cp3, global, whereis_name, [test]))),
- % test re_register
- ?line {Pid2, yes} = start_proc(test),
- ?line ?UNTIL(Pid2 =:= rpc:call(Cp3, global, whereis_name, [test])),
+ %% test re_register
+ {Pid2, yes} = start_proc(test),
+ ?UNTIL(Pid2 =:= rpc:call(Cp3, global, whereis_name, [test])),
Pid3 = rpc:call(Cp3, ?MODULE, start_proc2, [test]),
- ?line ?UNTIL(Pid3 =:= rpc:call(Cp3, global, whereis_name, [test])),
+ ?UNTIL(Pid3 =:= rpc:call(Cp3, global, whereis_name, [test])),
Pid3 = global:whereis_name(test),
- % test sending
+ %% test sending
global:send(test, {ping, self()}),
receive
{pong, Cp3} -> ok
after
- 2000 -> test_server:fail(timeout1)
+ 2000 -> ct:fail(timeout1)
end,
rpc:call(Cp1, global, send, [test, {ping, self()}]),
receive
{pong, Cp3} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line _ = global:unregister_name(test),
- ?line
- ?UNTIL((undefined =:= global:whereis_name(test)) and
+ _ = global:unregister_name(test),
+ ?UNTIL((undefined =:= global:whereis_name(test)) and
(undefined =:= rpc:call(Cp1, global, whereis_name, [test])) and
(undefined =:= rpc:call(Cp2, global, whereis_name, [test])) and
(undefined =:= rpc:call(Cp3, global, whereis_name, [test]))),
exit_p(Pid3),
- ?line ?UNTIL(undefined =:= global:whereis_name(test)),
+ ?UNTIL(undefined =:= global:whereis_name(test)),
- % register a proc
- ?line {_Pid6, yes} = rpc:call(Cp3, ?MODULE, start_proc, [test]),
+ %% register a proc
+ {_Pid6, yes} = rpc:call(Cp3, ?MODULE, start_proc, [test]),
write_high_level_trace(Config),
- % stop the nodes, and make sure names are released.
+
+ %% stop the nodes, and make sure names are released.
stop_node(Cp1),
stop_node(Cp2),
stop_node(Cp3),
- ?line ?UNTIL(undefined =:= global:whereis_name(test)),
+ ?UNTIL(undefined =:= global:whereis_name(test)),
exit_p(Pid2),
- ?line ?UNTIL(undefined =:= global:whereis_name(test)),
- ?line init_condition(Config),
+ ?UNTIL(undefined =:= global:whereis_name(test)),
+ init_condition(Config),
ok.
-names_hidden(suite) -> [];
-names_hidden(doc) ->
- ["Tests that names on a hidden node doesn't interfere with names on "
- "visible nodes."];
+%% Tests that names on a hidden node doesn't interfere with names on
+%% visible nodes.
names_hidden(Config) when is_list(Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
- ?line OrigNodes = nodes(),
-
- ?line {ok, Cp1} = start_node(cp1, Config),
- ?line {ok, Cp2} = start_node(cp2, Config),
- ?line {ok, Cp3} = start_hidden_node(cp3, Config),
- ?line pong = rpc:call(Cp1, net_adm, ping, [Cp3]),
- ?line pong = rpc:call(Cp3, net_adm, ping, [Cp2]),
- ?line pong = rpc:call(Cp3, net_adm, ping, [node()]),
-
- ?line [] = [Cp1, Cp2 | OrigNodes] -- nodes(),
-
- % start a proc on hidden node and register it
- ?line {HPid, yes} = rpc:call(Cp3, ?MODULE, start_proc, [test]),
- ?line Cp3 = node(HPid),
-
- % Check that it didn't get registered on visible nodes
- ?line
- ?UNTIL((undefined =:= global:whereis_name(test)) and
+ init_condition(Config),
+ OrigNames = global:registered_names(),
+ OrigNodes = nodes(),
+
+ {ok, Cp1} = start_node(cp1, Config),
+ {ok, Cp2} = start_node(cp2, Config),
+ {ok, Cp3} = start_hidden_node(cp3, Config),
+ pong = rpc:call(Cp1, net_adm, ping, [Cp3]),
+ pong = rpc:call(Cp3, net_adm, ping, [Cp2]),
+ pong = rpc:call(Cp3, net_adm, ping, [node()]),
+
+ [] = [Cp1, Cp2 | OrigNodes] -- nodes(),
+
+ %% start a proc on hidden node and register it
+ {HPid, yes} = rpc:call(Cp3, ?MODULE, start_proc, [test]),
+ Cp3 = node(HPid),
+
+ %% Check that it didn't get registered on visible nodes
+ ?UNTIL((undefined =:= global:whereis_name(test)) and
(undefined =:= rpc:call(Cp1, global, whereis_name, [test])) and
(undefined =:= rpc:call(Cp2, global, whereis_name, [test]))),
- % start a proc on visible node and register it
- ?line {Pid, yes} = start_proc(test),
- ?line true = (Pid =/= HPid),
+ %% start a proc on visible node and register it
+ {Pid, yes} = start_proc(test),
+ true = (Pid =/= HPid),
- % test that it is registered at all nodes
- ?line
- ?UNTIL((Pid =:= global:whereis_name(test)) and
+ %% test that it is registered at all nodes
+ ?UNTIL((Pid =:= global:whereis_name(test)) and
(Pid =:= rpc:call(Cp1, global, whereis_name, [test])) and
(Pid =:= rpc:call(Cp2, global, whereis_name, [test])) and
(HPid =:= rpc:call(Cp3, global, whereis_name, [test])) and
([test] =:= global:registered_names() -- OrigNames)),
- % try to register the same name
- ?line no = global:register_name(test, self()),
- ?line no = rpc:call(Cp1, global, register_name, [test, self()]),
+ %% try to register the same name
+ no = global:register_name(test, self()),
+ no = rpc:call(Cp1, global, register_name, [test, self()]),
- % let process exit, check that it is unregistered automatically
+ %% let process exit, check that it is unregistered automatically
exit_p(Pid),
- ?line
- ?UNTIL((undefined =:= global:whereis_name(test)) and
+ ?UNTIL((undefined =:= global:whereis_name(test)) and
(undefined =:= rpc:call(Cp1, global, whereis_name, [test])) and
(undefined =:= rpc:call(Cp2, global, whereis_name, [test])) and
(HPid =:= rpc:call(Cp3, global, whereis_name, [test]))),
- % test re_register
- ?line {Pid2, yes} = start_proc(test),
- ?line ?UNTIL(Pid2 =:= rpc:call(Cp2, global, whereis_name, [test])),
+ %% test re_register
+ {Pid2, yes} = start_proc(test),
+ ?UNTIL(Pid2 =:= rpc:call(Cp2, global, whereis_name, [test])),
Pid3 = rpc:call(Cp2, ?MODULE, start_proc2, [test]),
- ?line ?UNTIL(Pid3 =:= rpc:call(Cp2, global, whereis_name, [test])),
- ?line Pid3 = global:whereis_name(test),
+ ?UNTIL(Pid3 =:= rpc:call(Cp2, global, whereis_name, [test])),
+ Pid3 = global:whereis_name(test),
- % test sending
- ?line Pid3 = global:send(test, {ping, self()}),
+ %% test sending
+ Pid3 = global:send(test, {ping, self()}),
receive
{pong, Cp2} -> ok
after
- 2000 -> test_server:fail(timeout1)
+ 2000 -> ct:fail(timeout1)
end,
rpc:call(Cp1, global, send, [test, {ping, self()}]),
receive
{pong, Cp2} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line _ = rpc:call(Cp3, global, unregister_name, [test]),
- ?line
- ?UNTIL((Pid3 =:= global:whereis_name(test)) and
+ _ = rpc:call(Cp3, global, unregister_name, [test]),
+ ?UNTIL((Pid3 =:= global:whereis_name(test)) and
(Pid3 =:= rpc:call(Cp1, global, whereis_name, [test])) and
(Pid3 =:= rpc:call(Cp2, global, whereis_name, [test])) and
(undefined =:= rpc:call(Cp3, global, whereis_name, [test]))),
- ?line _ = global:unregister_name(test),
- ?line
- ?UNTIL((undefined =:= global:whereis_name(test)) and
+ _ = global:unregister_name(test),
+ ?UNTIL((undefined =:= global:whereis_name(test)) and
(undefined =:= rpc:call(Cp1, global, whereis_name, [test])) and
(undefined =:= rpc:call(Cp2, global, whereis_name, [test])) and
(undefined =:= rpc:call(Cp3, global, whereis_name, [test]))),
@@ -608,277 +592,297 @@ names_hidden(Config) when is_list(Config) ->
exit_p(Pid3),
exit_p(HPid),
- ?line ?UNTIL(undefined =:= global:whereis_name(test)),
+ ?UNTIL(undefined =:= global:whereis_name(test)),
write_high_level_trace(Config),
- % stop the nodes, and make sure names are released.
+
+ %% stop the nodes, and make sure names are released.
stop_node(Cp1),
stop_node(Cp2),
stop_node(Cp3),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-locks(suite) -> [];
locks(Config) when is_list(Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line {ok, Cp1} = start_node(cp1, Config),
- ?line {ok, Cp2} = start_node(cp2, Config),
- ?line {ok, Cp3} = start_node(cp3, Config),
-
- ?line wait_for_ready_net(Config),
-
- % start two procs
- ?line Pid = start_proc(),
- ?line Pid2 = rpc:call(Cp1, ?MODULE, start_proc, []),
- % set a lock, and make sure noone else can set the same lock
- ?line true = global:set_lock({test_lock, self()}, ?NODES, 1),
- ?line false = req(Pid, {set_lock, test_lock, self()}),
- ?line false = req(Pid2, {set_lock, test_lock, self()}),
- % delete, and let another proc set the lock
+ init_condition(Config),
+ {ok, Cp1} = start_node(cp1, Config),
+ {ok, Cp2} = start_node(cp2, Config),
+ {ok, Cp3} = start_node(cp3, Config),
+
+ wait_for_ready_net(Config),
+
+ %% start two procs
+ Pid = start_proc(),
+ Pid2 = rpc:call(Cp1, ?MODULE, start_proc, []),
+
+ %% set a lock, and make sure noone else can set the same lock
+ true = global:set_lock({test_lock, self()}, ?NODES, 1),
+ false = req(Pid, {set_lock, test_lock, self()}),
+ false = req(Pid2, {set_lock, test_lock, self()}),
+
+ %% delete, and let another proc set the lock
global:del_lock({test_lock, self()}),
- ?line true = req(Pid, {set_lock, test_lock, self()}),
- ?line false = req(Pid2, {set_lock, test_lock, self()}),
- ?line false = global:set_lock({test_lock, self()}, ?NODES,1),
- % kill lock-holding proc, make sure the lock is released
+ true = req(Pid, {set_lock, test_lock, self()}),
+ false = req(Pid2, {set_lock, test_lock, self()}),
+ false = global:set_lock({test_lock, self()}, ?NODES,1),
+
+ %% kill lock-holding proc, make sure the lock is released
exit_p(Pid),
?UNTIL(true =:= global:set_lock({test_lock, self()}, ?NODES,1)),
Pid2 ! {set_lock_loop, test_lock, self()},
- % make sure we don't have the msg
+
+ %% make sure we don't have the msg
receive
- {got_lock, Pid2} -> test_server:fail(got_lock)
+ {got_lock, Pid2} -> ct:fail(got_lock)
after
1000 -> ok
end,
global:del_lock({test_lock, self()}),
- % make sure pid2 got the lock
+
+ %% make sure pid2 got the lock
receive
{got_lock, Pid2} -> ok
after
- % 12000 >> 5000, which is the max time before a new retry for
- % set_lock
- 12000 -> test_server:fail(got_lock2)
+ %% 12000 >> 5000, which is the max time before a new retry for
+ %% set_lock
+ 12000 -> ct:fail(got_lock2)
end,
- % let proc set the same lock
- ?line true = req(Pid2, {set_lock, test_lock, self()}),
- % let proc set new lock
- ?line true = req(Pid2, {set_lock, test_lock2, self()}),
- ?line false = global:set_lock({test_lock, self()},?NODES,1),
- ?line false = global:set_lock({test_lock2, self()}, ?NODES,1),
+ %% let proc set the same lock
+ true = req(Pid2, {set_lock, test_lock, self()}),
+
+ %% let proc set new lock
+ true = req(Pid2, {set_lock, test_lock2, self()}),
+ false = global:set_lock({test_lock, self()},?NODES,1),
+ false = global:set_lock({test_lock2, self()}, ?NODES,1),
exit_p(Pid2),
-% erlang:display({locks1, ets:tab2list(global_locks)}),
?UNTIL(true =:= global:set_lock({test_lock, self()}, ?NODES, 1)),
?UNTIL(true =:= global:set_lock({test_lock2, self()}, ?NODES, 1)),
- ?line global:del_lock({test_lock, self()}),
- ?line global:del_lock({test_lock2, self()}),
-
- % let proc set two locks
- ?line Pid3 = rpc:call(Cp1, ?MODULE, start_proc, []),
- ?line true = req(Pid3, {set_lock, test_lock, self()}),
- ?line true = req(Pid3, {set_lock, test_lock2, self()}),
- % del one lock
- ?line Pid3 ! {del_lock, test_lock2},
- ?line test_server:sleep(100),
- % check that one lock is still set, but not the other
- ?line false = global:set_lock({test_lock, self()}, ?NODES, 1),
- ?line true = global:set_lock({test_lock2, self()}, ?NODES, 1),
- ?line global:del_lock({test_lock2, self()}),
- % kill lock-holder
+ global:del_lock({test_lock, self()}),
+ global:del_lock({test_lock2, self()}),
+
+ %% let proc set two locks
+ Pid3 = rpc:call(Cp1, ?MODULE, start_proc, []),
+ true = req(Pid3, {set_lock, test_lock, self()}),
+ true = req(Pid3, {set_lock, test_lock2, self()}),
+
+ %% del one lock
+ Pid3 ! {del_lock, test_lock2},
+ ct:sleep(100),
+
+ %% check that one lock is still set, but not the other
+ false = global:set_lock({test_lock, self()}, ?NODES, 1),
+ true = global:set_lock({test_lock2, self()}, ?NODES, 1),
+ global:del_lock({test_lock2, self()}),
+
+ %% kill lock-holder
exit_p(Pid3),
-% erlang:display({locks2, ets:tab2list(global_locks)}),
+
?UNTIL(true =:= global:set_lock({test_lock, self()}, ?NODES, 1)),
- ?line global:del_lock({test_lock, self()}),
+ global:del_lock({test_lock, self()}),
?UNTIL(true =:= global:set_lock({test_lock2, self()}, ?NODES, 1)),
- ?line global:del_lock({test_lock2, self()}),
-
- % start one proc on each node
- ?line Pid4 = start_proc(),
- ?line Pid5 = rpc:call(Cp1, ?MODULE, start_proc, []),
- ?line Pid6 = rpc:call(Cp2, ?MODULE, start_proc, []),
- ?line Pid7 = rpc:call(Cp3, ?MODULE, start_proc, []),
- % set lock on two nodes
- ?line true = req(Pid4, {set_lock, test_lock, self(), [node(), Cp1]}),
- ?line false = req(Pid5, {set_lock, test_lock, self(), [node(), Cp1]}),
- % set same lock on other two nodes
- ?line true = req(Pid6, {set_lock, test_lock, self(), [Cp2, Cp3]}),
- ?line false = req(Pid7, {set_lock, test_lock, self(), [Cp2, Cp3]}),
- % release lock
+ global:del_lock({test_lock2, self()}),
+
+ %% start one proc on each node
+ Pid4 = start_proc(),
+ Pid5 = rpc:call(Cp1, ?MODULE, start_proc, []),
+ Pid6 = rpc:call(Cp2, ?MODULE, start_proc, []),
+ Pid7 = rpc:call(Cp3, ?MODULE, start_proc, []),
+
+ %% set lock on two nodes
+ true = req(Pid4, {set_lock, test_lock, self(), [node(), Cp1]}),
+ false = req(Pid5, {set_lock, test_lock, self(), [node(), Cp1]}),
+
+ %% set same lock on other two nodes
+ true = req(Pid6, {set_lock, test_lock, self(), [Cp2, Cp3]}),
+ false = req(Pid7, {set_lock, test_lock, self(), [Cp2, Cp3]}),
+
+ %% release lock
Pid6 ! {del_lock, test_lock, [Cp2, Cp3]},
- % try to set lock on a node that already has the lock
- ?line false = req(Pid6, {set_lock, test_lock, self(), [Cp1, Cp2, Cp3]}),
- % set lock on a node
+ %% try to set lock on a node that already has the lock
+ false = req(Pid6, {set_lock, test_lock, self(), [Cp1, Cp2, Cp3]}),
+
+ %% set lock on a node
exit_p(Pid4),
?UNTIL(true =:= req(Pid5, {set_lock, test_lock, self(), [node(), Cp1]})),
- ?line Pid8 = start_proc(),
- ?line false = req(Pid8, {set_lock, test_lock, self()}),
+ Pid8 = start_proc(),
+ false = req(Pid8, {set_lock, test_lock, self()}),
write_high_level_trace(Config),
- % stop the nodes, and make sure locks are released.
+
+ %% stop the nodes, and make sure locks are released.
stop_node(Cp1),
stop_node(Cp2),
stop_node(Cp3),
- ?line test_server:sleep(100),
- ?line true = req(Pid8, {set_lock, test_lock, self()}),
+ ct:sleep(100),
+ true = req(Pid8, {set_lock, test_lock, self()}),
exit_p(Pid8),
- ?line test_server:sleep(10),
+ ct:sleep(10),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-
-locks_hidden(suite) -> [];
-locks_hidden(doc) ->
- ["Tests that locks on a hidden node doesn't interere with locks on "
- "visible nodes."];
+
+%% Tests that locks on a hidden node doesn't interere with locks on
+%% visible nodes.
locks_hidden(Config) when is_list(Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNodes = nodes(),
- ?line {ok, Cp1} = start_node(cp1, Config),
- ?line {ok, Cp2} = start_node(cp2, Config),
- ?line {ok, Cp3} = start_hidden_node(cp3, Config),
- ?line pong = rpc:call(Cp1, net_adm, ping, [Cp3]),
- ?line pong = rpc:call(Cp3, net_adm, ping, [Cp2]),
- ?line pong = rpc:call(Cp3, net_adm, ping, [node()]),
-
- ?line [] = [Cp1, Cp2 | OrigNodes] -- nodes(),
-
- % start two procs
- ?line Pid = start_proc(),
- ?line Pid2 = rpc:call(Cp1, ?MODULE, start_proc, []),
- ?line HPid = rpc:call(Cp3, ?MODULE, start_proc, []),
- % Make sure hidden node doesn't interfere with visible nodes lock
- ?line true = req(HPid, {set_lock, test_lock, self()}),
- ?line true = global:set_lock({test_lock, self()}, ?NODES, 1),
- ?line false = req(Pid, {set_lock, test_lock, self()}),
- ?line true = req(HPid, {del_lock_sync, test_lock, self()}),
- ?line false = req(Pid2, {set_lock, test_lock, self()}),
- % delete, and let another proc set the lock
+ init_condition(Config),
+ OrigNodes = nodes(),
+ {ok, Cp1} = start_node(cp1, Config),
+ {ok, Cp2} = start_node(cp2, Config),
+ {ok, Cp3} = start_hidden_node(cp3, Config),
+ pong = rpc:call(Cp1, net_adm, ping, [Cp3]),
+ pong = rpc:call(Cp3, net_adm, ping, [Cp2]),
+ pong = rpc:call(Cp3, net_adm, ping, [node()]),
+
+ [] = [Cp1, Cp2 | OrigNodes] -- nodes(),
+
+ %% start two procs
+ Pid = start_proc(),
+ Pid2 = rpc:call(Cp1, ?MODULE, start_proc, []),
+ HPid = rpc:call(Cp3, ?MODULE, start_proc, []),
+
+ %% Make sure hidden node doesn't interfere with visible nodes lock
+ true = req(HPid, {set_lock, test_lock, self()}),
+ true = global:set_lock({test_lock, self()}, ?NODES, 1),
+ false = req(Pid, {set_lock, test_lock, self()}),
+ true = req(HPid, {del_lock_sync, test_lock, self()}),
+ false = req(Pid2, {set_lock, test_lock, self()}),
+
+ %% delete, and let another proc set the lock
global:del_lock({test_lock, self()}),
- ?line true = req(Pid, {set_lock, test_lock, self()}),
- ?line false = req(Pid2, {set_lock, test_lock, self()}),
- ?line false = global:set_lock({test_lock, self()}, ?NODES,1),
- % kill lock-holding proc, make sure the lock is released
+ true = req(Pid, {set_lock, test_lock, self()}),
+ false = req(Pid2, {set_lock, test_lock, self()}),
+ false = global:set_lock({test_lock, self()}, ?NODES,1),
+
+ %% kill lock-holding proc, make sure the lock is released
exit_p(Pid),
?UNTIL(true =:= global:set_lock({test_lock, self()}, ?NODES, 1)),
?UNTIL(true =:= req(HPid, {set_lock, test_lock, self()})),
Pid2 ! {set_lock_loop, test_lock, self()},
- % make sure we don't have the msg
+
+ %% make sure we don't have the msg
receive
- {got_lock, Pid2} -> test_server:fail(got_lock)
+ {got_lock, Pid2} -> ct:fail(got_lock)
after
1000 -> ok
end,
global:del_lock({test_lock, self()}),
- % make sure pid2 got the lock
+
+ %% make sure pid2 got the lock
receive
{got_lock, Pid2} -> ok
after
- % 12000 >> 5000, which is the max time before a new retry for
- % set_lock
- 12000 -> test_server:fail(got_lock2)
+ %% 12000 >> 5000, which is the max time before a new retry for
+ %% set_lock
+ 12000 -> ct:fail(got_lock2)
end,
- ?line true = req(HPid, {del_lock_sync, test_lock, self()}),
-
- % let proc set the same lock
- ?line true = req(Pid2, {set_lock, test_lock, self()}),
- % let proc set new lock
- ?line true = req(Pid2, {set_lock, test_lock2, self()}),
- ?line true = req(HPid, {set_lock, test_lock, self()}),
- ?line true = req(HPid, {set_lock, test_lock2, self()}),
+ true = req(HPid, {del_lock_sync, test_lock, self()}),
+
+ %% let proc set the same lock
+ true = req(Pid2, {set_lock, test_lock, self()}),
+
+ %% let proc set new lock
+ true = req(Pid2, {set_lock, test_lock2, self()}),
+ true = req(HPid, {set_lock, test_lock, self()}),
+ true = req(HPid, {set_lock, test_lock2, self()}),
exit_p(HPid),
- ?line false = global:set_lock({test_lock, self()},?NODES,1),
- ?line false = global:set_lock({test_lock2, self()}, ?NODES,1),
+ false = global:set_lock({test_lock, self()},?NODES,1),
+ false = global:set_lock({test_lock2, self()}, ?NODES,1),
+
exit_p(Pid2),
-% erlang:display({locks1, ets:tab2list(global_locks)}),
?UNTIL(true =:= global:set_lock({test_lock, self()}, ?NODES, 1)),
?UNTIL(true =:= global:set_lock({test_lock2, self()}, ?NODES, 1)),
- ?line global:del_lock({test_lock, self()}),
- ?line global:del_lock({test_lock2, self()}),
+ global:del_lock({test_lock, self()}),
+ global:del_lock({test_lock2, self()}),
write_high_level_trace(Config),
- % stop the nodes, and make sure locks are released.
+
+ %% stop the nodes, and make sure locks are released.
stop_node(Cp1),
stop_node(Cp2),
stop_node(Cp3),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-
-bad_input(suite) -> [];
+
bad_input(Config) when is_list(Config) ->
Timeout = 15,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
+ init_condition(Config),
Pid = whereis(global_name_server),
- ?line {'EXIT', _} = (catch global:set_lock(bad_id)),
- ?line {'EXIT', _} = (catch global:set_lock({id, self()}, bad_nodes)),
- ?line {'EXIT', _} = (catch global:del_lock(bad_id)),
- ?line {'EXIT', _} = (catch global:del_lock({id, self()}, bad_nodes)),
- ?line {'EXIT', _} = (catch global:register_name(name, bad_pid)),
- ?line {'EXIT', _} = (catch global:reregister_name(name, bad_pid)),
- ?line {'EXIT', _} = (catch global:trans(bad_id, {m,f})),
- ?line {'EXIT', _} = (catch global:trans({id, self()}, {m,f}, [node()], -1)),
- ?line Pid = whereis(global_name_server),
- ?line init_condition(Config),
+ {'EXIT', _} = (catch global:set_lock(bad_id)),
+ {'EXIT', _} = (catch global:set_lock({id, self()}, bad_nodes)),
+ {'EXIT', _} = (catch global:del_lock(bad_id)),
+ {'EXIT', _} = (catch global:del_lock({id, self()}, bad_nodes)),
+ {'EXIT', _} = (catch global:register_name(name, bad_pid)),
+ {'EXIT', _} = (catch global:reregister_name(name, bad_pid)),
+ {'EXIT', _} = (catch global:trans(bad_id, {m,f})),
+ {'EXIT', _} = (catch global:trans({id, self()}, {m,f}, [node()], -1)),
+ Pid = whereis(global_name_server),
+ init_condition(Config),
ok.
-names_and_locks(suite) -> [];
names_and_locks(Config) when is_list(Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
-
- ?line {ok, Cp1} = start_node(cp1, Config),
- ?line {ok, Cp2} = start_node(cp2, Config),
- ?line {ok, Cp3} = start_node(cp3, Config),
-
- % start one proc on each node
- ?line PidTS = start_proc(),
- ?line Pid1 = rpc:call(Cp1, ?MODULE, start_proc, []),
- ?line Pid2 = rpc:call(Cp2, ?MODULE, start_proc, []),
- ?line Pid3 = rpc:call(Cp3, ?MODULE, start_proc, []),
- % register some of them
- ?line yes = global:register_name(test1, Pid1),
- ?line yes = global:register_name(test2, Pid2),
- ?line yes = global:register_name(test3, Pid3),
- ?line no = global:register_name(test3, PidTS),
- ?line yes = global:register_name(test4, PidTS),
-
- % set lock on two nodes
- ?line true = req(PidTS, {set_lock, test_lock, self(), [node(), Cp1]}),
- ?line false = req(Pid1, {set_lock, test_lock, self(), [node(), Cp1]}),
- % set same lock on other two nodes
- ?line true = req(Pid2, {set_lock, test_lock, self(), [Cp2, Cp3]}),
- ?line false = req(Pid3, {set_lock, test_lock, self(), [Cp2, Cp3]}),
- % release lock
+ init_condition(Config),
+ OrigNames = global:registered_names(),
+
+ {ok, Cp1} = start_node(cp1, Config),
+ {ok, Cp2} = start_node(cp2, Config),
+ {ok, Cp3} = start_node(cp3, Config),
+
+ %% start one proc on each node
+ PidTS = start_proc(),
+ Pid1 = rpc:call(Cp1, ?MODULE, start_proc, []),
+ Pid2 = rpc:call(Cp2, ?MODULE, start_proc, []),
+ Pid3 = rpc:call(Cp3, ?MODULE, start_proc, []),
+
+ %% register some of them
+ yes = global:register_name(test1, Pid1),
+ yes = global:register_name(test2, Pid2),
+ yes = global:register_name(test3, Pid3),
+ no = global:register_name(test3, PidTS),
+ yes = global:register_name(test4, PidTS),
+
+ %% set lock on two nodes
+ true = req(PidTS, {set_lock, test_lock, self(), [node(), Cp1]}),
+ false = req(Pid1, {set_lock, test_lock, self(), [node(), Cp1]}),
+
+ %% set same lock on other two nodes
+ true = req(Pid2, {set_lock, test_lock, self(), [Cp2, Cp3]}),
+ false = req(Pid3, {set_lock, test_lock, self(), [Cp2, Cp3]}),
+
+ %% release lock
Pid2 ! {del_lock, test_lock, [Cp2, Cp3]},
- ?line test_server:sleep(100),
- % try to set lock on a node that already has the lock
- ?line false = req(Pid2, {set_lock, test_lock, self(), [Cp1, Cp2, Cp3]}),
- % set two locks
- ?line true = req(Pid2, {set_lock, test_lock, self(), [Cp2, Cp3]}),
- ?line true = req(Pid2, {set_lock, test_lock2, self(), [Cp2, Cp3]}),
-
- % kill some processes, make sure all locks/names are released
+ ct:sleep(100),
+
+ %% try to set lock on a node that already has the lock
+ false = req(Pid2, {set_lock, test_lock, self(), [Cp1, Cp2, Cp3]}),
+
+ %% set two locks
+ true = req(Pid2, {set_lock, test_lock, self(), [Cp2, Cp3]}),
+ true = req(Pid2, {set_lock, test_lock2, self(), [Cp2, Cp3]}),
+
+ %% kill some processes, make sure all locks/names are released
exit_p(PidTS),
- ?line ?UNTIL(undefined =:= global:whereis_name(test4)),
- ?line true = global:set_lock({test_lock, self()}, [node(), Cp1], 1),
+ ?UNTIL(undefined =:= global:whereis_name(test4)),
+ true = global:set_lock({test_lock, self()}, [node(), Cp1], 1),
global:del_lock({test_lock, self()}, [node(), Cp1]),
exit_p(Pid2),
- ?line
- ?UNTIL((undefined =:= global:whereis_name(test2)) and
+ ?UNTIL((undefined =:= global:whereis_name(test2)) and
(true =:= global:set_lock({test_lock, self()}, [Cp2, Cp3], 1)) and
(true =:= global:set_lock({test_lock2, self()}, [Cp2, Cp3], 1))),
@@ -888,117 +892,113 @@ names_and_locks(Config) when is_list(Config) ->
exit_p(Pid1),
exit_p(Pid3),
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
+ ?UNTIL(OrigNames =:= global:registered_names()),
write_high_level_trace(Config),
stop_node(Cp1),
stop_node(Cp2),
stop_node(Cp3),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-
-lock_die(suite) -> [];
-lock_die(doc) ->
- ["OTP-6341. Remove locks using monitors."];
+
+%% OTP-6341. Remove locks using monitors.
lock_die(Config) when is_list(Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
- ?line {ok, Cp1} = start_node(cp1, Config),
- ?line {ok, Cp2} = start_node(cp2, Config),
+ {ok, Cp1} = start_node(cp1, Config),
+ {ok, Cp2} = start_node(cp2, Config),
%% First test.
LockId = {id, self()},
- ?line Pid2 = start_proc(),
- ?line true = req(Pid2, {set_lock2, LockId, self()}),
+ Pid2 = start_proc(),
+ true = req(Pid2, {set_lock2, LockId, self()}),
- ?line true = global:set_lock(LockId, [Cp1]),
+ true = global:set_lock(LockId, [Cp1]),
%% Id is locked on Cp1 and Cp2 (by Pid2) but not by self():
%% (there is no mon. ref)
- ?line _ = global:del_lock(LockId, [node(), Cp1, Cp2]),
+ _ = global:del_lock(LockId, [node(), Cp1, Cp2]),
+
+ exit_p(Pid2),
- ?line exit_p(Pid2),
-
%% Second test.
- ?line Pid3 = start_proc(),
- ?line true = req(Pid3, {set_lock, id, self(), [Cp1]}),
+ Pid3 = start_proc(),
+ true = req(Pid3, {set_lock, id, self(), [Cp1]}),
%% The lock is removed from Cp1 thanks to monitors.
- ?line exit_p(Pid3),
-
- ?line true = global:set_lock(LockId, [node(), Cp1]),
- ?line _ = global:del_lock(LockId, [node(), Cp1]),
+ exit_p(Pid3),
+
+ true = global:set_lock(LockId, [node(), Cp1]),
+ _ = global:del_lock(LockId, [node(), Cp1]),
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
+ ?UNTIL(OrigNames =:= global:registered_names()),
write_high_level_trace(Config),
stop_node(Cp1),
stop_node(Cp2),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-name_die(suite) -> [];
-name_die(doc) ->
- ["OTP-6341. Remove names using monitors."];
+%% OTP-6341. Remove names using monitors.
name_die(Config) when is_list(Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
- ?line [Cp1] = Cps = start_nodes([z], peer, Config), % z > test_server
+ init_condition(Config),
+ OrigNames = global:registered_names(),
+ [Cp1] = Cps = start_nodes([z], peer, Config), % z > test_server
Nodes = lists:sort([node() | Cps]),
- ?line wait_for_ready_net(Config),
-
+ wait_for_ready_net(Config),
+
Name = name_die,
- ?line Pid = rpc:call(Cp1, ?MODULE, start_proc, []),
+ Pid = rpc:call(Cp1, ?MODULE, start_proc, []),
%% Test 1. No resolver is called if the same pid is registered on
%% both partitions.
T1 = node(),
Part1 = [T1],
Part2 = [Cp1],
- ?line rpc_cast(Cp1,
- ?MODULE, part_2_2, [Config,
- Part1,
- Part2,
- []]),
- ?line ?UNTIL(is_ready_partition(Config)),
- ?line ?UNTIL(undefined =:= global:whereis_name(Name)),
- ?line yes = global:register_name(Name, Pid),
-
- ?line pong = net_adm:ping(Cp1),
- ?line wait_for_ready_net(Nodes, Config),
- ?line assert_pid(global:whereis_name(Name)),
+ rpc_cast(Cp1,
+ ?MODULE, part_2_2, [Config,
+ Part1,
+ Part2,
+ []]),
+ ?UNTIL(is_ready_partition(Config)),
+ ?UNTIL(undefined =:= global:whereis_name(Name)),
+ yes = global:register_name(Name, Pid),
+
+ pong = net_adm:ping(Cp1),
+ wait_for_ready_net(Nodes, Config),
+ assert_pid(global:whereis_name(Name)),
exit_p(Pid),
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
+ ?UNTIL(OrigNames =:= global:registered_names()),
%% Test 2. Register a name running outside the current partition.
%% Killing the pid will not remove the name from the current
%% partition, unless monitors are used.
- ?line Pid2 = rpc:call(Cp1, ?MODULE, start_proc, []),
- Dir = ?config(priv_dir, Config),
+ Pid2 = rpc:call(Cp1, ?MODULE, start_proc, []),
+ Dir = proplists:get_value(priv_dir, Config),
KillFile = filename:join([Dir, "kill.txt"]),
file:delete(KillFile),
- ?line erlang:spawn(Cp1, fun() -> kill_pid(Pid2, KillFile, Config) end),
- ?line rpc_cast(Cp1,
- ?MODULE, part_2_2, [Config,
- Part1,
- Part2,
- []]),
- ?line ?UNTIL(is_ready_partition(Config)),
- ?line ?UNTIL(undefined =:= global:whereis_name(Name)),
- ?line yes = global:register_name(Name, Pid2),
- ?line touch(KillFile, "kill"),
- ?line file_contents(KillFile, "done", Config),
+ erlang:spawn(Cp1, fun() -> kill_pid(Pid2, KillFile, Config) end),
+ rpc_cast(Cp1,
+ ?MODULE, part_2_2, [Config,
+ Part1,
+ Part2,
+ []]),
+ ?UNTIL(is_ready_partition(Config)),
+ ?UNTIL(undefined =:= global:whereis_name(Name)),
+ yes = global:register_name(Name, Pid2),
+ touch(KillFile, "kill"),
+ file_contents(KillFile, "done", Config),
file:delete(KillFile),
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
+ ?UNTIL(OrigNames =:= global:registered_names()),
write_high_level_trace(Config),
stop_nodes(Cps),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
kill_pid(Pid, File, Config) ->
@@ -1006,186 +1006,178 @@ kill_pid(Pid, File, Config) ->
exit_p(Pid),
touch(File, "done").
-basic_partition(suite) -> [];
-basic_partition(doc) ->
- ["Tests that two partitioned networks exchange correct info."];
+%% Tests that two partitioned networks exchange correct info.
basic_partition(Config) when is_list(Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
-
- ?line [Cp1, Cp2, Cp3] = start_nodes([cp1, cp2, cp3], peer, Config),
- ?line [Cp1, Cp2, Cp3] = lists:sort(nodes()),
-
- ?line wait_for_ready_net(Config),
-
- % make cp2 and cp3 connected, partitioned from us and cp1
- ?line rpc_cast(Cp2, ?MODULE, part1, [Config, node(), Cp1, Cp3]),
- ?line ?UNTIL(is_ready_partition(Config)),
-
- % start different processes in both partitions
- ?line {Pid, yes} = start_proc(test),
-
- % connect to other partition
- ?line pong = net_adm:ping(Cp2),
- ?line pong = net_adm:ping(Cp3),
- ?line [Cp1, Cp2, Cp3] = lists:sort(nodes()),
-
- % check names
- ?line ?UNTIL(Pid =:= rpc:call(Cp2, global, whereis_name, [test])),
- ?line ?UNTIL(undefined =/= global:whereis_name(test2)),
- ?line Pid2 = global:whereis_name(test2),
- ?line Pid2 = rpc:call(Cp2, global, whereis_name, [test2]),
- ?line assert_pid(Pid2),
- ?line Pid3 = global:whereis_name(test4),
- ?line ?UNTIL(Pid3 =:= rpc:call(Cp1, global, whereis_name, [test4])),
- ?line assert_pid(Pid3),
-
- % kill all procs
- ?line Pid3 = global:send(test4, die),
- % sleep to let the proc die
+ init_condition(Config),
+ OrigNames = global:registered_names(),
+
+ [Cp1, Cp2, Cp3] = start_nodes([cp1, cp2, cp3], peer, Config),
+ [Cp1, Cp2, Cp3] = lists:sort(nodes()),
+
+ wait_for_ready_net(Config),
+
+ %% make cp2 and cp3 connected, partitioned from us and cp1
+ rpc_cast(Cp2, ?MODULE, part1, [Config, node(), Cp1, Cp3]),
+ ?UNTIL(is_ready_partition(Config)),
+
+ %% start different processes in both partitions
+ {Pid, yes} = start_proc(test),
+
+ %% connect to other partition
+ pong = net_adm:ping(Cp2),
+ pong = net_adm:ping(Cp3),
+ [Cp1, Cp2, Cp3] = lists:sort(nodes()),
+
+ %% check names
+ ?UNTIL(Pid =:= rpc:call(Cp2, global, whereis_name, [test])),
+ ?UNTIL(undefined =/= global:whereis_name(test2)),
+ Pid2 = global:whereis_name(test2),
+ Pid2 = rpc:call(Cp2, global, whereis_name, [test2]),
+ assert_pid(Pid2),
+ Pid3 = global:whereis_name(test4),
+ ?UNTIL(Pid3 =:= rpc:call(Cp1, global, whereis_name, [test4])),
+ assert_pid(Pid3),
+
+ %% kill all procs
+ Pid3 = global:send(test4, die),
+ %% sleep to let the proc die
wait_for_exit(Pid3),
- ?line ?UNTIL(undefined =:= global:whereis_name(test4)),
-
+ ?UNTIL(undefined =:= global:whereis_name(test4)),
+
exit_p(Pid),
exit_p(Pid2),
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
+ ?UNTIL(OrigNames =:= global:registered_names()),
write_high_level_trace(Config),
stop_node(Cp1),
stop_node(Cp2),
stop_node(Cp3),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-basic_name_partition(suite) ->
- [];
-basic_name_partition(doc) ->
- ["Creates two partitions with two nodes in each partition.",
- "Tests that names are exchanged correctly, and that EXITs",
- "during connect phase are handled correctly."];
+%% Creates two partitions with two nodes in each partition.
+%% Tests that names are exchanged correctly, and that EXITs
+%% during connect phase are handled correctly.
basic_name_partition(Config) when is_list(Config) ->
Timeout = 60,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
- ?line [Cp1, Cp2, Cp3] = start_nodes([cp1, cp2, cp3], peer, Config),
- ?line [Cp1, Cp2, Cp3] = lists:sort(nodes()),
+ [Cp1, Cp2, Cp3] = start_nodes([cp1, cp2, cp3], peer, Config),
+ [Cp1, Cp2, Cp3] = lists:sort(nodes()),
Nodes = ?NODES,
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
- % There used to be more than one name registered for some
- % processes. That was a mistake; there is no support for more than
- % one name per process, and the manual is quite clear about that
- % ("equivalent to the register/2 and whereis/1 BIFs"). The
- % resolver procedure did not take care of such "duplicated" names,
- % which caused this testcase to fail every now and then.
+ %% There used to be more than one name registered for some
+ %% processes. That was a mistake; there is no support for more than
+ %% one name per process, and the manual is quite clear about that
+ %% ("equivalent to the register/2 and whereis/1 BIFs"). The
+ %% resolver procedure did not take care of such "duplicated" names,
+ %% which caused this testcase to fail every now and then.
- % make cp2 and cp3 connected, partitioned from us and cp1
- % us: register name03
- % cp1: register name12
- % cp2: register name12
- % cp3: register name03
-
- ?line rpc_cast(Cp2, ?MODULE, part1_5, [Config, node(), Cp1, Cp3]),
- ?line ?UNTIL(is_ready_partition(Config)),
-
- % start different processes in both partitions
- ?line {_, yes} = start_proc_basic(name03),
- ?line {_, yes} = rpc:call(Cp1, ?MODULE, start_proc_basic, [name12]),
- test_server:sleep(1000),
+ %% make cp2 and cp3 connected, partitioned from us and cp1
+ %% us: register name03
+ %% cp1: register name12
+ %% cp2: register name12
+ %% cp3: register name03
- % connect to other partition
- ?line pong = net_adm:ping(Cp3),
-
- ?line ?UNTIL([Cp1, Cp2, Cp3] =:= lists:sort(nodes())),
- ?line wait_for_ready_net(Config),
- % check names
- ?line Pid03 = global:whereis_name(name03),
- ?line assert_pid(Pid03),
- ?line true = lists:member(node(Pid03), [node(), Cp3]),
- ?line check_everywhere(Nodes, name03, Config),
-
- ?line Pid12 = global:whereis_name(name12),
- ?line assert_pid(Pid12),
- ?line true = lists:member(node(Pid12), [Cp1, Cp2]),
- ?line check_everywhere(Nodes, name12, Config),
-
- % kill all procs
- ?line Pid12 = global:send(name12, die),
- ?line Pid03 = global:send(name03, die),
- % sleep to let the procs die
+ rpc_cast(Cp2, ?MODULE, part1_5, [Config, node(), Cp1, Cp3]),
+ ?UNTIL(is_ready_partition(Config)),
+
+ %% start different processes in both partitions
+ {_, yes} = start_proc_basic(name03),
+ {_, yes} = rpc:call(Cp1, ?MODULE, start_proc_basic, [name12]),
+ ct:sleep(1000),
+
+ %% connect to other partition
+ pong = net_adm:ping(Cp3),
+
+ ?UNTIL([Cp1, Cp2, Cp3] =:= lists:sort(nodes())),
+ wait_for_ready_net(Config),
+
+ %% check names
+ Pid03 = global:whereis_name(name03),
+ assert_pid(Pid03),
+ true = lists:member(node(Pid03), [node(), Cp3]),
+ check_everywhere(Nodes, name03, Config),
+
+ Pid12 = global:whereis_name(name12),
+ assert_pid(Pid12),
+ true = lists:member(node(Pid12), [Cp1, Cp2]),
+ check_everywhere(Nodes, name12, Config),
+
+ %% kill all procs
+ Pid12 = global:send(name12, die),
+ Pid03 = global:send(name03, die),
+
+ %% sleep to let the procs die
wait_for_exit(Pid12),
wait_for_exit(Pid03),
- ?line
?UNTIL(begin
Names = [name03, name12],
lists:duplicate(length(Names), undefined)
=:= [global:whereis_name(Name) || Name <- Names]
end),
-
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
+
+ ?UNTIL(OrigNames =:= global:registered_names()),
write_high_level_trace(Config),
stop_node(Cp1),
stop_node(Cp2),
stop_node(Cp3),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-%Peer nodes cp0 - cp6 are started. Break apart the connections from
-%cp3-cp6 to cp0-cp2 and test_server so we get two partitions.
-%In the cp3-cp6 partition, start one process on each node and register
-%using both erlang:register, and global:register (test1 on cp3, test2 on
-%cp4, test3 on cp5, test4 on cp6), using different resolution functions:
-%default for test1, notify_all_name for test2, random_notify_name for test3
-%and one for test4 that sends a message to test_server and keeps the
-%process which is greater in the standard ordering. In the other partition,
-%do the same (test1 on test_server, test2 on cp0, test3 on cp1, test4 on cp2).
-%Sleep a little, then from test_server, connect to cp3-cp6 in order.
-%Check that the values for the registered names are the expected ones, and
-%that the messages from test4 arrive.
-
-advanced_partition(suite) ->
- [];
-advanced_partition(doc) ->
- ["Test that names are resolved correctly when two",
- "partitioned networks connect."];
+%% Peer nodes cp0 - cp6 are started. Break apart the connections from
+%% cp3-cp6 to cp0-cp2 and test_server so we get two partitions.
+%% In the cp3-cp6 partition, start one process on each node and register
+%% using both erlang:register, and global:register (test1 on cp3, test2 on
+%% cp4, test3 on cp5, test4 on cp6), using different resolution functions:
+%% default for test1, notify_all_name for test2, random_notify_name for test3
+%% and one for test4 that sends a message to test_server and keeps the
+%% process which is greater in the standard ordering. In the other partition,
+%% do the same (test1 on test_server, test2 on cp0, test3 on cp1, test4 on cp2).
+%% Sleep a little, then from test_server, connect to cp3-cp6 in order.
+%% Check that the values for the registered names are the expected ones, and
+%% that the messages from test4 arrive.
+
+%% Test that names are resolved correctly when two
+%% partitioned networks connect.
advanced_partition(Config) when is_list(Config) ->
Timeout = 60,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
- ?line [Cp0, Cp1, Cp2, Cp3, Cp4, Cp5, Cp6]
+ [Cp0, Cp1, Cp2, Cp3, Cp4, Cp5, Cp6]
= start_nodes([cp0, cp1, cp2, cp3, cp4, cp5, cp6], peer, Config),
Nodes = lists:sort([node(), Cp0, Cp1, Cp2, Cp3, Cp4, Cp5, Cp6]),
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
- % make cp3-cp6 connected, partitioned from us and cp0-cp2
- ?line rpc_cast(Cp3, ?MODULE, part2,
- [Config, self(), node(), Cp0, Cp1, Cp2, Cp3, Cp4, Cp5,Cp6]),
- ?line ?UNTIL(is_ready_partition(Config)),
-
- % start different processes in this partition
- ?line start_procs(self(), Cp0, Cp1, Cp2, Config),
-
- % connect to other partition
- ?line pong = net_adm:ping(Cp3),
- ?line pong = net_adm:ping(Cp4),
- ?line pong = net_adm:ping(Cp5),
- ?line pong = net_adm:ping(Cp6),
-
- ?line wait_for_ready_net(Config),
+ %% make cp3-cp6 connected, partitioned from us and cp0-cp2
+ rpc_cast(Cp3, ?MODULE, part2,
+ [Config, self(), node(), Cp0, Cp1, Cp2, Cp3, Cp4, Cp5,Cp6]),
+ ?UNTIL(is_ready_partition(Config)),
+
+ %% start different processes in this partition
+ start_procs(self(), Cp0, Cp1, Cp2, Config),
+
+ %% connect to other partition
+ pong = net_adm:ping(Cp3),
+ pong = net_adm:ping(Cp4),
+ pong = net_adm:ping(Cp5),
+ pong = net_adm:ping(Cp6),
+
+ wait_for_ready_net(Config),
- ?line
?UNTIL(lists:member(undefined,
[rpc:call(Cp3, erlang, whereis, [test1]),
rpc:call(node(), erlang, whereis, [test1])])),
@@ -1200,43 +1192,42 @@ advanced_partition(Config) when is_list(Config) ->
Mt3 = rpc:call(Cp1, erlang, whereis, [test3]),
_Mt4 = rpc:call(Cp2, erlang, whereis, [test4]),
- % check names
- ?line Pid1 = global:whereis_name(test1),
- ?line Pid1 = rpc:call(Cp3, global, whereis_name, [test1]),
- ?line assert_pid(Pid1),
- ?line true = lists:member(Pid1, [Nt1, Mt1]),
- ?line true = lists:member(undefined, [Nt1, Mt1]),
- ?line check_everywhere(Nodes, test1, Config),
-
- ?line undefined = global:whereis_name(test2),
- ?line undefined = rpc:call(Cp3, global, whereis_name, [test2]),
- ?line yes = sreq(Nt2, {got_notify, self()}),
- ?line yes = sreq(Mt2, {got_notify, self()}),
- ?line check_everywhere(Nodes, test2, Config),
-
- ?line Pid3 = global:whereis_name(test3),
- ?line Pid3 = rpc:call(Cp3, global, whereis_name, [test3]),
- ?line assert_pid(Pid3),
- ?line true = lists:member(Pid3, [Nt3, Mt3]),
- ?line no = sreq(Pid3, {got_notify, self()}),
- ?line yes = sreq(other(Pid3, [Nt2, Nt3]), {got_notify, self()}),
- ?line check_everywhere(Nodes, test3, Config),
-
- ?line Pid4 = global:whereis_name(test4),
- ?line Pid4 = rpc:call(Cp3, global, whereis_name, [test4]),
- ?line assert_pid(Pid4),
-% ?line true = lists:member(Pid4, [Nt4, Mt4]),
- ?line Pid4 = Nt4,
- ?line check_everywhere(Nodes, test4, Config),
-
- ?line 1 = collect_resolves(),
-
- ?line Pid1 = global:send(test1, die),
+ %% check names
+ Pid1 = global:whereis_name(test1),
+ Pid1 = rpc:call(Cp3, global, whereis_name, [test1]),
+ assert_pid(Pid1),
+ true = lists:member(Pid1, [Nt1, Mt1]),
+ true = lists:member(undefined, [Nt1, Mt1]),
+ check_everywhere(Nodes, test1, Config),
+
+ undefined = global:whereis_name(test2),
+ undefined = rpc:call(Cp3, global, whereis_name, [test2]),
+ yes = sreq(Nt2, {got_notify, self()}),
+ yes = sreq(Mt2, {got_notify, self()}),
+ check_everywhere(Nodes, test2, Config),
+
+ Pid3 = global:whereis_name(test3),
+ Pid3 = rpc:call(Cp3, global, whereis_name, [test3]),
+ assert_pid(Pid3),
+ true = lists:member(Pid3, [Nt3, Mt3]),
+ no = sreq(Pid3, {got_notify, self()}),
+ yes = sreq(other(Pid3, [Nt2, Nt3]), {got_notify, self()}),
+ check_everywhere(Nodes, test3, Config),
+
+ Pid4 = global:whereis_name(test4),
+ Pid4 = rpc:call(Cp3, global, whereis_name, [test4]),
+ assert_pid(Pid4),
+ Pid4 = Nt4,
+ check_everywhere(Nodes, test4, Config),
+
+ 1 = collect_resolves(),
+
+ Pid1 = global:send(test1, die),
exit_p(Pid3),
exit_p(Pid4),
wait_for_exit(Pid1),
wait_for_exit(Pid3),
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
+ ?UNTIL(OrigNames =:= global:registered_names()),
write_high_level_trace(Config),
stop_node(Cp0),
@@ -1246,93 +1237,90 @@ advanced_partition(Config) when is_list(Config) ->
stop_node(Cp4),
stop_node(Cp5),
stop_node(Cp6),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-
-%Peer nodes cp0 - cp6 are started, and partitioned just like in
-%advanced_partition. Start cp8, only connected to test_server. Let cp6
-%break apart from the rest, and 12 s later, ping cp0 and cp3, and
-%register the name test5. After the same 12 s, let cp5 halt.
-%Wait for the death of cp5. Ping cp3 (at the same time as cp6 does).
-%Take down cp2. Start cp7, restart cp2. Ping cp4, cp6 and cp8.
-%Now, expect all nodes to be connected and have the same picture of all
-%registered names.
-
-stress_partition(suite) ->
- [];
-stress_partition(doc) ->
- ["Stress global, make a partitioned net, make some nodes",
- "go up/down a bit."];
+
+%% Peer nodes cp0 - cp6 are started, and partitioned just like in
+%% advanced_partition. Start cp8, only connected to test_server. Let cp6
+%% break apart from the rest, and 12 s later, ping cp0 and cp3, and
+%% register the name test5. After the same 12 s, let cp5 halt.
+%% Wait for the death of cp5. Ping cp3 (at the same time as cp6 does).
+%% Take down cp2. Start cp7, restart cp2. Ping cp4, cp6 and cp8.
+%% Now, expect all nodes to be connected and have the same picture of all
+%% registered names.
+
+%% Stress global, make a partitioned net, make some nodes
+%% go up/down a bit.
stress_partition(Config) when is_list(Config) ->
Timeout = 90,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
- ?line [Cp0, Cp1, Cp2, Cp3, Cp4, Cp5, Cp6]
+ [Cp0, Cp1, Cp2, Cp3, Cp4, Cp5, Cp6]
= start_nodes([cp0, cp1, cp2, cp3, cp4, cp5, cp6], peer, Config),
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
- % make cp3-cp5 connected, partitioned from us and cp0-cp2
- % cp6 is alone (single node). cp6 pings cp0 and cp3 in 12 secs...
- ?line rpc_cast(Cp3, ?MODULE, part3,
- [Config, self(), node(), Cp0, Cp1, Cp2, Cp3, Cp4, Cp5,Cp6]),
- ?line ?UNTIL(is_ready_partition(Config)),
-
- % start different processes in this partition
- ?line start_procs(self(), Cp0, Cp1, Cp2, Config),
+ %% make cp3-cp5 connected, partitioned from us and cp0-cp2
+ %% cp6 is alone (single node). cp6 pings cp0 and cp3 in 12 secs...
+ rpc_cast(Cp3, ?MODULE, part3,
+ [Config, self(), node(), Cp0, Cp1, Cp2, Cp3, Cp4, Cp5,Cp6]),
+ ?UNTIL(is_ready_partition(Config)),
+
+ %% start different processes in this partition
+ start_procs(self(), Cp0, Cp1, Cp2, Config),
+
+ {ok, Cp8} = start_peer_node(cp8, Config),
- ?line {ok, Cp8} = start_peer_node(cp8, Config),
-
monitor_node(Cp5, true),
receive
{nodedown, Cp5} -> ok
after
- 20000 -> test_server:fail({no_nodedown, Cp5})
+ 20000 -> ct:fail({no_nodedown, Cp5})
end,
monitor_node(Cp5, false),
- % Ok, now cp6 pings us, and cp5 will go down.
-
- % connect to other partition
- ?line pong = net_adm:ping(Cp3),
- ?line rpc_cast(Cp2, ?MODULE, crash, [0]),
-
- % Start new nodes
- ?line {ok, Cp7} = start_peer_node(cp7, Config),
- ?line {ok, Cp2_2} = start_peer_node(cp2, Config),
+ %% Ok, now cp6 pings us, and cp5 will go down.
+
+ %% connect to other partition
+ pong = net_adm:ping(Cp3),
+ rpc_cast(Cp2, ?MODULE, crash, [0]),
+
+ %% Start new nodes
+ {ok, Cp7} = start_peer_node(cp7, Config),
+ {ok, Cp2_2} = start_peer_node(cp2, Config),
Nodes = lists:sort([node(), Cp0, Cp1, Cp2_2, Cp3, Cp4, Cp6, Cp7, Cp8]),
put(?nodes_tag, Nodes),
- ?line pong = net_adm:ping(Cp4),
- ?line pong = net_adm:ping(Cp6),
- ?line pong = net_adm:ping(Cp8),
+ pong = net_adm:ping(Cp4),
+ pong = net_adm:ping(Cp6),
+ pong = net_adm:ping(Cp8),
- ?line wait_for_ready_net(Nodes, Config),
+ wait_for_ready_net(Nodes, Config),
- % Make sure that all nodes have the same picture of all names
- ?line check_everywhere(Nodes, test1, Config),
- ?line assert_pid(global:whereis_name(test1)),
-
- ?line check_everywhere(Nodes, test2, Config),
- ?line undefined = global:whereis_name(test2),
+ %% Make sure that all nodes have the same picture of all names
+ check_everywhere(Nodes, test1, Config),
+ assert_pid(global:whereis_name(test1)),
- ?line check_everywhere(Nodes, test3, Config),
- ?line assert_pid(global:whereis_name(test3)),
+ check_everywhere(Nodes, test2, Config),
+ undefined = global:whereis_name(test2),
- ?line check_everywhere(Nodes, test4, Config),
- ?line assert_pid(global:whereis_name(test4)),
+ check_everywhere(Nodes, test3, Config),
+ assert_pid(global:whereis_name(test3)),
- ?line check_everywhere(Nodes, test5, Config),
- ?line ?UNTIL(undefined =:= global:whereis_name(test5)),
-
- ?line assert_pid(global:send(test1, die)),
- ?line assert_pid(global:send(test3, die)),
- ?line assert_pid(global:send(test4, die)),
+ check_everywhere(Nodes, test4, Config),
+ assert_pid(global:whereis_name(test4)),
+
+ check_everywhere(Nodes, test5, Config),
+ ?UNTIL(undefined =:= global:whereis_name(test5)),
+
+ assert_pid(global:send(test1, die)),
+ assert_pid(global:send(test3, die)),
+ assert_pid(global:send(test4, die)),
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
+ ?UNTIL(OrigNames =:= global:registered_names()),
write_high_level_trace(Config),
stop_node(Cp0),
@@ -1344,15 +1332,13 @@ stress_partition(Config) when is_list(Config) ->
stop_node(Cp6),
stop_node(Cp7),
stop_node(Cp8),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
%% Use this one to test alot of connection tests
%% erl -sname ts -ring_line 10000 -s test_server run_test global_SUITE
-ring_line(suite) -> [];
-ring_line(doc) -> [""];
ring_line(Config) when is_list(Config) ->
{ok, [[N]]} = init:get_argument(ring_line),
loop_it(list_to_integer(N), Config).
@@ -1361,74 +1347,70 @@ loop_it(N, Config) -> loop_it(N,N, Config).
loop_it(0,_, _Config) -> ok;
loop_it(N,M, Config) ->
- test_server:format(1, "Round: ~w", [M-N]),
+ ct:pal(?HI_VERBOSITY, "Round: ~w", [M-N]),
ring(Config),
line(Config),
loop_it(N-1,M, Config).
-ring(suite) ->
- [];
-ring(doc) ->
- ["Make 10 single nodes, all having the same name.",
- "Make all ping its predecessor, pinging in a ring.",
- "Make sure that there's just one winner."];
+%% Make 10 single nodes, all having the same name.
+%% Make all ping its predecessor, pinging in a ring.
+%% Make sure that there's just one winner.
ring(Config) when is_list(Config) ->
Timeout = 60,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
- ?line [Cp0, Cp1, Cp2, Cp3, Cp4, Cp5, Cp6, Cp7, Cp8]
+ [Cp0, Cp1, Cp2, Cp3, Cp4, Cp5, Cp6, Cp7, Cp8]
= start_nodes([cp0, cp1, cp2, cp3, cp4, cp5, cp6, cp7, cp8],
peer, Config),
Nodes = lists:sort([node(), Cp0, Cp1, Cp2, Cp3, Cp4, Cp5, Cp6, Cp7, Cp8]),
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
Time = msec() + 7000,
- ?line rpc_cast(Cp0, ?MODULE, single_node, [Time, Cp8, Config]),
- ?line rpc_cast(Cp1, ?MODULE, single_node, [Time, Cp0, Config]),
- ?line rpc_cast(Cp2, ?MODULE, single_node, [Time, Cp1, Config]),
- ?line rpc_cast(Cp3, ?MODULE, single_node, [Time, Cp2, Config]),
- ?line rpc_cast(Cp4, ?MODULE, single_node, [Time, Cp3, Config]),
- ?line rpc_cast(Cp5, ?MODULE, single_node, [Time, Cp4, Config]),
- ?line rpc_cast(Cp6, ?MODULE, single_node, [Time, Cp5, Config]),
- ?line rpc_cast(Cp7, ?MODULE, single_node, [Time, Cp6, Config]),
- ?line rpc_cast(Cp8, ?MODULE, single_node, [Time, Cp7, Config]),
-
- % sleep to make the partitioned net ready
- test_server:sleep(Time - msec()),
-
- ?line pong = net_adm:ping(Cp0),
- ?line pong = net_adm:ping(Cp1),
- ?line pong = net_adm:ping(Cp2),
- ?line pong = net_adm:ping(Cp3),
- ?line pong = net_adm:ping(Cp4),
- ?line pong = net_adm:ping(Cp5),
- ?line pong = net_adm:ping(Cp6),
- ?line pong = net_adm:ping(Cp7),
- ?line pong = net_adm:ping(Cp8),
-
- ?line pong = net_adm:ping(Cp0),
- ?line pong = net_adm:ping(Cp1),
- ?line pong = net_adm:ping(Cp2),
- ?line pong = net_adm:ping(Cp3),
- ?line pong = net_adm:ping(Cp4),
- ?line pong = net_adm:ping(Cp5),
- ?line pong = net_adm:ping(Cp6),
- ?line pong = net_adm:ping(Cp7),
- ?line pong = net_adm:ping(Cp8),
-
- ?line wait_for_ready_net(Nodes, Config),
-
- % Just make sure that all nodes have the same picture of all names
- ?line check_everywhere(Nodes, single_name, Config),
- ?line assert_pid(global:whereis_name(single_name)),
-
- ?line
+ rpc_cast(Cp0, ?MODULE, single_node, [Time, Cp8, Config]),
+ rpc_cast(Cp1, ?MODULE, single_node, [Time, Cp0, Config]),
+ rpc_cast(Cp2, ?MODULE, single_node, [Time, Cp1, Config]),
+ rpc_cast(Cp3, ?MODULE, single_node, [Time, Cp2, Config]),
+ rpc_cast(Cp4, ?MODULE, single_node, [Time, Cp3, Config]),
+ rpc_cast(Cp5, ?MODULE, single_node, [Time, Cp4, Config]),
+ rpc_cast(Cp6, ?MODULE, single_node, [Time, Cp5, Config]),
+ rpc_cast(Cp7, ?MODULE, single_node, [Time, Cp6, Config]),
+ rpc_cast(Cp8, ?MODULE, single_node, [Time, Cp7, Config]),
+
+ %% sleep to make the partitioned net ready
+ ct:sleep(Time - msec()),
+
+ pong = net_adm:ping(Cp0),
+ pong = net_adm:ping(Cp1),
+ pong = net_adm:ping(Cp2),
+ pong = net_adm:ping(Cp3),
+ pong = net_adm:ping(Cp4),
+ pong = net_adm:ping(Cp5),
+ pong = net_adm:ping(Cp6),
+ pong = net_adm:ping(Cp7),
+ pong = net_adm:ping(Cp8),
+
+ pong = net_adm:ping(Cp0),
+ pong = net_adm:ping(Cp1),
+ pong = net_adm:ping(Cp2),
+ pong = net_adm:ping(Cp3),
+ pong = net_adm:ping(Cp4),
+ pong = net_adm:ping(Cp5),
+ pong = net_adm:ping(Cp6),
+ pong = net_adm:ping(Cp7),
+ pong = net_adm:ping(Cp8),
+
+ wait_for_ready_net(Nodes, Config),
+
+ %% Just make sure that all nodes have the same picture of all names
+ check_everywhere(Nodes, single_name, Config),
+ assert_pid(global:whereis_name(single_name)),
+
?UNTIL(begin
{Ns2, []} = rpc:multicall(Nodes, erlang, whereis,
[single_name]),
@@ -1437,10 +1419,10 @@ ring(Config) when is_list(Config) ->
end,
0, Ns2)
end),
-
- ?line assert_pid(global:send(single_name, die)),
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
+ assert_pid(global:send(single_name, die)),
+
+ ?UNTIL(OrigNames =:= global:registered_names()),
write_high_level_trace(Config),
stop_node(Cp0),
@@ -1452,64 +1434,60 @@ ring(Config) when is_list(Config) ->
stop_node(Cp6),
stop_node(Cp7),
stop_node(Cp8),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-simple_ring(suite) ->
- [];
-simple_ring(doc) ->
- ["Simpler version of the ring case. Used because there are some",
- "distribution problems with many nodes.",
- "Make 6 single nodes, all having the same name.",
- "Make all ping its predecessor, pinging in a ring.",
- "Make sure that there's just one winner."];
+%% Simpler version of the ring case. Used because there are some
+%% distribution problems with many nodes.
+%% Make 6 single nodes, all having the same name.
+%% Make all ping its predecessor, pinging in a ring.
+%% Make sure that there's just one winner.
simple_ring(Config) when is_list(Config) ->
Timeout = 60,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
Names = [cp0, cp1, cp2, cp3, cp4, cp5],
- ?line [Cp0, Cp1, Cp2, Cp3, Cp4, Cp5]
+ [Cp0, Cp1, Cp2, Cp3, Cp4, Cp5]
= start_nodes(Names, peer, Config),
Nodes = lists:sort([node(), Cp0, Cp1, Cp2, Cp3, Cp4, Cp5]),
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
Time = msec() + 5000,
- ?line rpc_cast(Cp0, ?MODULE, single_node, [Time, Cp5, Config]),
- ?line rpc_cast(Cp1, ?MODULE, single_node, [Time, Cp0, Config]),
- ?line rpc_cast(Cp2, ?MODULE, single_node, [Time, Cp1, Config]),
- ?line rpc_cast(Cp3, ?MODULE, single_node, [Time, Cp2, Config]),
- ?line rpc_cast(Cp4, ?MODULE, single_node, [Time, Cp3, Config]),
- ?line rpc_cast(Cp5, ?MODULE, single_node, [Time, Cp4, Config]),
-
- % sleep to make the partitioned net ready
- test_server:sleep(Time - msec()),
-
- ?line pong = net_adm:ping(Cp0),
- ?line pong = net_adm:ping(Cp1),
- ?line pong = net_adm:ping(Cp2),
- ?line pong = net_adm:ping(Cp3),
- ?line pong = net_adm:ping(Cp4),
- ?line pong = net_adm:ping(Cp5),
-
- ?line pong = net_adm:ping(Cp0),
- ?line pong = net_adm:ping(Cp1),
- ?line pong = net_adm:ping(Cp2),
- ?line pong = net_adm:ping(Cp3),
- ?line pong = net_adm:ping(Cp4),
- ?line pong = net_adm:ping(Cp5),
-
- ?line wait_for_ready_net(Nodes, Config),
-
- % Just make sure that all nodes have the same picture of all names
- ?line check_everywhere(Nodes, single_name, Config),
- ?line assert_pid(global:whereis_name(single_name)),
-
- ?line
+ rpc_cast(Cp0, ?MODULE, single_node, [Time, Cp5, Config]),
+ rpc_cast(Cp1, ?MODULE, single_node, [Time, Cp0, Config]),
+ rpc_cast(Cp2, ?MODULE, single_node, [Time, Cp1, Config]),
+ rpc_cast(Cp3, ?MODULE, single_node, [Time, Cp2, Config]),
+ rpc_cast(Cp4, ?MODULE, single_node, [Time, Cp3, Config]),
+ rpc_cast(Cp5, ?MODULE, single_node, [Time, Cp4, Config]),
+
+ %% sleep to make the partitioned net ready
+ ct:sleep(Time - msec()),
+
+ pong = net_adm:ping(Cp0),
+ pong = net_adm:ping(Cp1),
+ pong = net_adm:ping(Cp2),
+ pong = net_adm:ping(Cp3),
+ pong = net_adm:ping(Cp4),
+ pong = net_adm:ping(Cp5),
+
+ pong = net_adm:ping(Cp0),
+ pong = net_adm:ping(Cp1),
+ pong = net_adm:ping(Cp2),
+ pong = net_adm:ping(Cp3),
+ pong = net_adm:ping(Cp4),
+ pong = net_adm:ping(Cp5),
+
+ wait_for_ready_net(Nodes, Config),
+
+ %% Just make sure that all nodes have the same picture of all names
+ check_everywhere(Nodes, single_name, Config),
+ assert_pid(global:whereis_name(single_name)),
+
?UNTIL(begin
{Ns2, []} = rpc:multicall(Nodes, erlang, whereis,
[single_name]),
@@ -1518,10 +1496,10 @@ simple_ring(Config) when is_list(Config) ->
end,
0, Ns2)
end),
-
- ?line assert_pid(global:send(single_name, die)),
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
+ assert_pid(global:send(single_name, die)),
+
+ ?UNTIL(OrigNames =:= global:registered_names()),
write_high_level_trace(Config),
stop_node(Cp0),
@@ -1530,72 +1508,68 @@ simple_ring(Config) when is_list(Config) ->
stop_node(Cp3),
stop_node(Cp4),
stop_node(Cp5),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-line(suite) ->
- [];
-line(doc) ->
- ["Make 6 single nodes, all having the same name.",
- "Make all ping its predecessor, pinging in a line.",
- "Make sure that there's just one winner."];
+%% Make 6 single nodes, all having the same name.
+%% Make all ping its predecessor, pinging in a line.
+%% Make sure that there's just one winner.
line(Config) when is_list(Config) ->
Timeout = 60,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
- ?line [Cp0, Cp1, Cp2, Cp3, Cp4, Cp5, Cp6, Cp7, Cp8]
+ [Cp0, Cp1, Cp2, Cp3, Cp4, Cp5, Cp6, Cp7, Cp8]
= start_nodes([cp0, cp1, cp2, cp3, cp4, cp5, cp6, cp7, cp8],
peer, Config),
Nodes = lists:sort([node(), Cp0, Cp1, Cp2, Cp3, Cp4, Cp5, Cp6, Cp7, Cp8]),
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
Time = msec() + 7000,
- ?line rpc_cast(Cp0, ?MODULE, single_node,
- [Time, Cp0, Config]), % ping ourself!
- ?line rpc_cast(Cp1, ?MODULE, single_node, [Time, Cp0, Config]),
- ?line rpc_cast(Cp2, ?MODULE, single_node, [Time, Cp1, Config]),
- ?line rpc_cast(Cp3, ?MODULE, single_node, [Time, Cp2, Config]),
- ?line rpc_cast(Cp4, ?MODULE, single_node, [Time, Cp3, Config]),
- ?line rpc_cast(Cp5, ?MODULE, single_node, [Time, Cp4, Config]),
- ?line rpc_cast(Cp6, ?MODULE, single_node, [Time, Cp5, Config]),
- ?line rpc_cast(Cp7, ?MODULE, single_node, [Time, Cp6, Config]),
- ?line rpc_cast(Cp8, ?MODULE, single_node, [Time, Cp7, Config]),
-
- % sleep to make the partitioned net ready
- test_server:sleep(Time - msec()),
-
- ?line pong = net_adm:ping(Cp0),
- ?line pong = net_adm:ping(Cp1),
- ?line pong = net_adm:ping(Cp2),
- ?line pong = net_adm:ping(Cp3),
- ?line pong = net_adm:ping(Cp4),
- ?line pong = net_adm:ping(Cp5),
- ?line pong = net_adm:ping(Cp6),
- ?line pong = net_adm:ping(Cp7),
- ?line pong = net_adm:ping(Cp8),
-
- ?line pong = net_adm:ping(Cp0),
- ?line pong = net_adm:ping(Cp1),
- ?line pong = net_adm:ping(Cp2),
- ?line pong = net_adm:ping(Cp3),
- ?line pong = net_adm:ping(Cp4),
- ?line pong = net_adm:ping(Cp5),
- ?line pong = net_adm:ping(Cp6),
- ?line pong = net_adm:ping(Cp7),
- ?line pong = net_adm:ping(Cp8),
-
- ?line wait_for_ready_net(Nodes, Config),
-
- % Just make sure that all nodes have the same picture of all names
- ?line check_everywhere(Nodes, single_name, Config),
- ?line assert_pid(global:whereis_name(single_name)),
-
- ?line
+ rpc_cast(Cp0, ?MODULE, single_node,
+ [Time, Cp0, Config]), % ping ourself!
+ rpc_cast(Cp1, ?MODULE, single_node, [Time, Cp0, Config]),
+ rpc_cast(Cp2, ?MODULE, single_node, [Time, Cp1, Config]),
+ rpc_cast(Cp3, ?MODULE, single_node, [Time, Cp2, Config]),
+ rpc_cast(Cp4, ?MODULE, single_node, [Time, Cp3, Config]),
+ rpc_cast(Cp5, ?MODULE, single_node, [Time, Cp4, Config]),
+ rpc_cast(Cp6, ?MODULE, single_node, [Time, Cp5, Config]),
+ rpc_cast(Cp7, ?MODULE, single_node, [Time, Cp6, Config]),
+ rpc_cast(Cp8, ?MODULE, single_node, [Time, Cp7, Config]),
+
+ %% Sleep to make the partitioned net ready
+ ct:sleep(Time - msec()),
+
+ pong = net_adm:ping(Cp0),
+ pong = net_adm:ping(Cp1),
+ pong = net_adm:ping(Cp2),
+ pong = net_adm:ping(Cp3),
+ pong = net_adm:ping(Cp4),
+ pong = net_adm:ping(Cp5),
+ pong = net_adm:ping(Cp6),
+ pong = net_adm:ping(Cp7),
+ pong = net_adm:ping(Cp8),
+
+ pong = net_adm:ping(Cp0),
+ pong = net_adm:ping(Cp1),
+ pong = net_adm:ping(Cp2),
+ pong = net_adm:ping(Cp3),
+ pong = net_adm:ping(Cp4),
+ pong = net_adm:ping(Cp5),
+ pong = net_adm:ping(Cp6),
+ pong = net_adm:ping(Cp7),
+ pong = net_adm:ping(Cp8),
+
+ wait_for_ready_net(Nodes, Config),
+
+ %% Just make sure that all nodes have the same picture of all names
+ check_everywhere(Nodes, single_name, Config),
+ assert_pid(global:whereis_name(single_name)),
+
?UNTIL(begin
{Ns2, []} = rpc:multicall(Nodes, erlang, whereis,
[single_name]),
@@ -1604,10 +1578,10 @@ line(Config) when is_list(Config) ->
end,
0, Ns2)
end),
-
- ?line assert_pid(global:send(single_name, die)),
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
+ assert_pid(global:send(single_name, die)),
+
+ ?UNTIL(OrigNames =:= global:registered_names()),
write_high_level_trace(Config),
stop_node(Cp0),
@@ -1619,65 +1593,61 @@ line(Config) when is_list(Config) ->
stop_node(Cp6),
stop_node(Cp7),
stop_node(Cp8),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-simple_line(suite) ->
- [];
-simple_line(doc) ->
- ["Simpler version of the line case. Used because there are some",
- "distribution problems with many nodes.",
- "Make 6 single nodes, all having the same name.",
- "Make all ping its predecessor, pinging in a line.",
- "Make sure that there's just one winner."];
+%% Simpler version of the line case. Used because there are some
+%% distribution problems with many nodes.
+%% Make 6 single nodes, all having the same name.
+%% Make all ping its predecessor, pinging in a line.
+%% Make sure that there's just one winner.
simple_line(Config) when is_list(Config) ->
Timeout = 60,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
- ?line [Cp0, Cp1, Cp2, Cp3, Cp4, Cp5]
+ [Cp0, Cp1, Cp2, Cp3, Cp4, Cp5]
= start_nodes([cp0, cp1, cp2, cp3, cp4, cp5], peer, Config),
Nodes = lists:sort([node(), Cp0, Cp1, Cp2, Cp3, Cp4, Cp5]),
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
Time = msec() + 5000,
- ?line rpc_cast(Cp0, ?MODULE, single_node,
- [Time, Cp0, Config]), % ping ourself!
- ?line rpc_cast(Cp1, ?MODULE, single_node, [Time, Cp0, Config]),
- ?line rpc_cast(Cp2, ?MODULE, single_node, [Time, Cp1, Config]),
- ?line rpc_cast(Cp3, ?MODULE, single_node, [Time, Cp2, Config]),
- ?line rpc_cast(Cp4, ?MODULE, single_node, [Time, Cp3, Config]),
- ?line rpc_cast(Cp5, ?MODULE, single_node, [Time, Cp4, Config]),
-
- % sleep to make the partitioned net ready
- test_server:sleep(Time - msec()),
-
- ?line pong = net_adm:ping(Cp0),
- ?line pong = net_adm:ping(Cp1),
- ?line pong = net_adm:ping(Cp2),
- ?line pong = net_adm:ping(Cp3),
- ?line pong = net_adm:ping(Cp4),
- ?line pong = net_adm:ping(Cp5),
-
- ?line pong = net_adm:ping(Cp0),
- ?line pong = net_adm:ping(Cp1),
- ?line pong = net_adm:ping(Cp2),
- ?line pong = net_adm:ping(Cp3),
- ?line pong = net_adm:ping(Cp4),
- ?line pong = net_adm:ping(Cp5),
-
- ?line wait_for_ready_net(Nodes, Config),
-
- % Just make sure that all nodes have the same picture of all names
- ?line check_everywhere(Nodes, single_name, Config),
- ?line assert_pid(global:whereis_name(single_name)),
-
- ?line
+ rpc_cast(Cp0, ?MODULE, single_node,
+ [Time, Cp0, Config]), % ping ourself!
+ rpc_cast(Cp1, ?MODULE, single_node, [Time, Cp0, Config]),
+ rpc_cast(Cp2, ?MODULE, single_node, [Time, Cp1, Config]),
+ rpc_cast(Cp3, ?MODULE, single_node, [Time, Cp2, Config]),
+ rpc_cast(Cp4, ?MODULE, single_node, [Time, Cp3, Config]),
+ rpc_cast(Cp5, ?MODULE, single_node, [Time, Cp4, Config]),
+
+ %% sleep to make the partitioned net ready
+ ct:sleep(Time - msec()),
+
+ pong = net_adm:ping(Cp0),
+ pong = net_adm:ping(Cp1),
+ pong = net_adm:ping(Cp2),
+ pong = net_adm:ping(Cp3),
+ pong = net_adm:ping(Cp4),
+ pong = net_adm:ping(Cp5),
+
+ pong = net_adm:ping(Cp0),
+ pong = net_adm:ping(Cp1),
+ pong = net_adm:ping(Cp2),
+ pong = net_adm:ping(Cp3),
+ pong = net_adm:ping(Cp4),
+ pong = net_adm:ping(Cp5),
+
+ wait_for_ready_net(Nodes, Config),
+
+ %% Just make sure that all nodes have the same picture of all names
+ check_everywhere(Nodes, single_name, Config),
+ assert_pid(global:whereis_name(single_name)),
+
?UNTIL(begin
{Ns2, []} = rpc:multicall(Nodes, erlang, whereis,
[single_name]),
@@ -1686,10 +1656,10 @@ simple_line(Config) when is_list(Config) ->
end,
0, Ns2)
end),
-
- ?line assert_pid(global:send(single_name, die)),
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
+ assert_pid(global:send(single_name, die)),
+
+ ?UNTIL(OrigNames =:= global:registered_names()),
write_high_level_trace(Config),
stop_node(Cp0),
@@ -1698,82 +1668,74 @@ simple_line(Config) when is_list(Config) ->
stop_node(Cp3),
stop_node(Cp4),
stop_node(Cp5),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-
-otp_1849(suite) -> [];
-otp_1849(doc) ->
- ["Test ticket: Global should keep track of all pids that set the same lock."];
+
+%% Test ticket: Global should keep track of all pids that set the same lock.
otp_1849(Config) when is_list(Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line {ok, Cp1} = start_node(cp1, Config),
- ?line {ok, Cp2} = start_node(cp2, Config),
- ?line {ok, Cp3} = start_node(cp3, Config),
-
- ?line wait_for_ready_net(Config),
-
- % start procs on each node
- ?line Pid1 = rpc:call(Cp1, ?MODULE, start_proc, []),
- ?line assert_pid(Pid1),
- ?line Pid2 = rpc:call(Cp2, ?MODULE, start_proc, []),
- ?line assert_pid(Pid2),
- ?line Pid3 = rpc:call(Cp3, ?MODULE, start_proc, []),
- ?line assert_pid(Pid3),
-
- % set a lock on every node
- ?line true = req(Pid1, {set_lock2, {test_lock, ?MODULE}, self()}),
- ?line true = req(Pid2, {set_lock2, {test_lock, ?MODULE}, self()}),
- ?line true = req(Pid3, {set_lock2, {test_lock, ?MODULE}, self()}),
-
- ?line
- ?UNTIL(begin
+ init_condition(Config),
+ {ok, Cp1} = start_node(cp1, Config),
+ {ok, Cp2} = start_node(cp2, Config),
+ {ok, Cp3} = start_node(cp3, Config),
+
+ wait_for_ready_net(Config),
+
+ %% start procs on each node
+ Pid1 = rpc:call(Cp1, ?MODULE, start_proc, []),
+ assert_pid(Pid1),
+ Pid2 = rpc:call(Cp2, ?MODULE, start_proc, []),
+ assert_pid(Pid2),
+ Pid3 = rpc:call(Cp3, ?MODULE, start_proc, []),
+ assert_pid(Pid3),
+
+ %% set a lock on every node
+ true = req(Pid1, {set_lock2, {test_lock, ?MODULE}, self()}),
+ true = req(Pid2, {set_lock2, {test_lock, ?MODULE}, self()}),
+ true = req(Pid3, {set_lock2, {test_lock, ?MODULE}, self()}),
+
+ ?UNTIL(begin
[{test_lock, ?MODULE, Lock1}] =
rpc:call(Cp1, ets, tab2list, [global_locks]),
3 =:= length(Lock1)
end),
- ?line true = req(Pid3, {del_lock2, {test_lock, ?MODULE}, self()}),
- ?line
+ true = req(Pid3, {del_lock2, {test_lock, ?MODULE}, self()}),
?UNTIL(begin
[{test_lock, ?MODULE, Lock2}] =
rpc:call(Cp1, ets, tab2list, [global_locks]),
2 =:= length(Lock2)
end),
- ?line true = req(Pid2, {del_lock2, {test_lock, ?MODULE}, self()}),
- ?line
+ true = req(Pid2, {del_lock2, {test_lock, ?MODULE}, self()}),
?UNTIL(begin
[{test_lock, ?MODULE, Lock3}] =
rpc:call(Cp1, ets, tab2list, [global_locks]),
1 =:= length(Lock3)
end),
- ?line true = req(Pid1, {del_lock2, {test_lock, ?MODULE}, self()}),
- ?line ?UNTIL([] =:= rpc:call(Cp1, ets, tab2list, [global_locks])),
+ true = req(Pid1, {del_lock2, {test_lock, ?MODULE}, self()}),
+ ?UNTIL([] =:= rpc:call(Cp1, ets, tab2list, [global_locks])),
- ?line true = req(Pid1, {set_lock2, {test_lock, ?MODULE}, self()}),
- ?line true = req(Pid2, {set_lock2, {test_lock, ?MODULE}, self()}),
- ?line true = req(Pid3, {set_lock2, {test_lock, ?MODULE}, self()}),
- ?line false = req(Pid2, {set_lock2, {test_lock, not_valid}, self()}),
+ true = req(Pid1, {set_lock2, {test_lock, ?MODULE}, self()}),
+ true = req(Pid2, {set_lock2, {test_lock, ?MODULE}, self()}),
+ true = req(Pid3, {set_lock2, {test_lock, ?MODULE}, self()}),
+ false = req(Pid2, {set_lock2, {test_lock, not_valid}, self()}),
exit_p(Pid1),
- ?line
?UNTIL(begin
[{test_lock, ?MODULE, Lock10}] =
rpc:call(Cp1, ets, tab2list, [global_locks]),
2 =:= length(Lock10)
end),
- ?line
?UNTIL(begin
[{test_lock, ?MODULE, Lock11}] =
rpc:call(Cp2, ets, tab2list, [global_locks]),
2 =:= length(Lock11)
end),
- ?line
?UNTIL(begin
[{test_lock, ?MODULE, Lock12}] =
rpc:call(Cp3, ets, tab2list, [global_locks]),
@@ -1784,13 +1746,11 @@ otp_1849(Config) when is_list(Config) ->
stop_node(Cp1),
stop_node(Cp2),
stop_node(Cp3),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-
-otp_3162(suite) -> [];
-otp_3162(doc) ->
- ["Test ticket: Deadlock in global"];
+
+%% Test ticket: Deadlock in global.
otp_3162(Config) when is_list(Config) ->
StartFun = fun() ->
{ok, Cp1} = start_node(cp1, Config),
@@ -1804,77 +1764,74 @@ do_otp_3162(StartFun, Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line [Cp1, Cp2, Cp3] = StartFun(),
+ init_condition(Config),
+ [Cp1, Cp2, Cp3] = StartFun(),
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
- % start procs on each node
- ?line Pid1 = rpc:call(Cp1, ?MODULE, start_proc4, [kalle]),
- ?line assert_pid(Pid1),
- ?line Pid2 = rpc:call(Cp2, ?MODULE, start_proc4, [stina]),
- ?line assert_pid(Pid2),
- ?line Pid3 = rpc:call(Cp3, ?MODULE, start_proc4, [vera]),
- ?line assert_pid(Pid3),
+ %% start procs on each node
+ Pid1 = rpc:call(Cp1, ?MODULE, start_proc4, [kalle]),
+ assert_pid(Pid1),
+ Pid2 = rpc:call(Cp2, ?MODULE, start_proc4, [stina]),
+ assert_pid(Pid2),
+ Pid3 = rpc:call(Cp3, ?MODULE, start_proc4, [vera]),
+ assert_pid(Pid3),
- ?line rpc_disconnect_node(Cp1, Cp2, Config),
+ rpc_disconnect_node(Cp1, Cp2, Config),
- ?line ?UNTIL
+ ?UNTIL
([Cp3] =:= lists:sort(rpc:call(Cp1, erlang, nodes, [])) -- [node()]),
?UNTIL([kalle, vera] =:=
- lists:sort(rpc:call(Cp1, global, registered_names, []))),
- ?line ?UNTIL
+ lists:sort(rpc:call(Cp1, global, registered_names, []))),
+ ?UNTIL
([Cp3] =:= lists:sort(rpc:call(Cp2, erlang, nodes, [])) -- [node()]),
?UNTIL([stina, vera] =:=
- lists:sort(rpc:call(Cp2, global, registered_names, []))),
- ?line ?UNTIL
+ lists:sort(rpc:call(Cp2, global, registered_names, []))),
+ ?UNTIL
([Cp1, Cp2] =:=
- lists:sort(rpc:call(Cp3, erlang, nodes, [])) -- [node()]),
+ lists:sort(rpc:call(Cp3, erlang, nodes, [])) -- [node()]),
?UNTIL([kalle, stina, vera] =:=
- lists:sort(rpc:call(Cp3, global, registered_names, []))),
+ lists:sort(rpc:call(Cp3, global, registered_names, []))),
- ?line pong = rpc:call(Cp2, net_adm, ping, [Cp1]),
+ pong = rpc:call(Cp2, net_adm, ping, [Cp1]),
- ?line ?UNTIL
+ ?UNTIL
([Cp2, Cp3] =:=
- lists:sort(rpc:call(Cp1, erlang, nodes, [])) -- [node()]),
- ?line
+ lists:sort(rpc:call(Cp1, erlang, nodes, [])) -- [node()]),
?UNTIL(begin
NN = lists:sort(rpc:call(Cp1, global, registered_names, [])),
[kalle, stina, vera] =:= NN
end),
- ?line ?UNTIL
+ ?UNTIL
([Cp1, Cp3] =:=
- lists:sort(rpc:call(Cp2, erlang, nodes, [])) -- [node()]),
+ lists:sort(rpc:call(Cp2, erlang, nodes, [])) -- [node()]),
?UNTIL([kalle, stina, vera] =:=
- lists:sort(rpc:call(Cp2, global, registered_names, []))),
- ?line ?UNTIL
+ lists:sort(rpc:call(Cp2, global, registered_names, []))),
+ ?UNTIL
([Cp1, Cp2] =:=
- lists:sort(rpc:call(Cp3, erlang, nodes, [])) -- [node()]),
+ lists:sort(rpc:call(Cp3, erlang, nodes, [])) -- [node()]),
?UNTIL([kalle, stina, vera] =:=
- lists:sort(rpc:call(Cp3, global, registered_names, []))),
+ lists:sort(rpc:call(Cp3, global, registered_names, []))),
write_high_level_trace(Config),
stop_node(Cp1),
stop_node(Cp2),
stop_node(Cp3),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-
-otp_5640(suite) -> [];
-otp_5640(doc) ->
- ["OTP-5640. 'allow' multiple names for registered processes."];
+
+%% OTP-5640. 'allow' multiple names for registered processes.
otp_5640(Config) when is_list(Config) ->
Timeout = 25,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
init_condition(Config),
- ?line {ok, B} = start_node(b, Config),
+ {ok, B} = start_node(b, Config),
- ?line Nodes = lists:sort([node(), B]),
- ?line wait_for_ready_net(Nodes, Config),
+ Nodes = lists:sort([node(), B]),
+ wait_for_ready_net(Nodes, Config),
Server = whereis(global_name_server),
ServerB = rpc:call(B, erlang, whereis, [global_name_server]),
@@ -1882,50 +1839,50 @@ otp_5640(Config) when is_list(Config) ->
Me = self(),
Proc = spawn(fun() -> otp_5640_proc(Me) end),
- ?line yes = global:register_name(name1, Proc),
- ?line no = global:register_name(name2, Proc),
+ yes = global:register_name(name1, Proc),
+ no = global:register_name(name2, Proc),
- ?line ok = application:set_env(kernel, global_multi_name_action, allow),
- ?line yes = global:register_name(name2, Proc),
+ ok = application:set_env(kernel, global_multi_name_action, allow),
+ yes = global:register_name(name2, Proc),
- test_server:sleep(100),
- ?line Proc = global:whereis_name(name1),
- ?line Proc = global:whereis_name(name2),
- ?line check_everywhere(Nodes, name1, Config),
- ?line check_everywhere(Nodes, name2, Config),
+ ct:sleep(100),
+ Proc = global:whereis_name(name1),
+ Proc = global:whereis_name(name2),
+ check_everywhere(Nodes, name1, Config),
+ check_everywhere(Nodes, name2, Config),
- ?line {monitors_2levels, MonBy1} = mon_by_servers(Proc),
- ?line [] = ([Server,Server,ServerB,ServerB] -- MonBy1),
- ?line {links,[]} = process_info(Proc, links),
- ?line _ = global:unregister_name(name1),
+ {monitors_2levels, MonBy1} = mon_by_servers(Proc),
+ [] = ([Server,Server,ServerB,ServerB] -- MonBy1),
+ {links,[]} = process_info(Proc, links),
+ _ = global:unregister_name(name1),
- test_server:sleep(100),
- ?line undefined = global:whereis_name(name1),
- ?line Proc = global:whereis_name(name2),
- ?line check_everywhere(Nodes, name1, Config),
- ?line check_everywhere(Nodes, name2, Config),
+ ct:sleep(100),
+ undefined = global:whereis_name(name1),
+ Proc = global:whereis_name(name2),
+ check_everywhere(Nodes, name1, Config),
+ check_everywhere(Nodes, name2, Config),
- ?line {monitors_2levels, MonBy2} = mon_by_servers(Proc),
- ?line [] = ([Server,ServerB] -- MonBy2),
+ {monitors_2levels, MonBy2} = mon_by_servers(Proc),
+ [] = ([Server,ServerB] -- MonBy2),
TmpMonBy2 = MonBy2 -- [Server,ServerB],
- ?line TmpMonBy2 = TmpMonBy2 -- [Server,ServerB],
- ?line {links,[]} = process_info(Proc, links),
+ TmpMonBy2 = TmpMonBy2 -- [Server,ServerB],
+ {links,[]} = process_info(Proc, links),
- ?line yes = global:register_name(name1, Proc),
+ yes = global:register_name(name1, Proc),
Proc ! die,
- test_server:sleep(100),
- ?line undefined = global:whereis_name(name1),
- ?line undefined = global:whereis_name(name2),
- ?line check_everywhere(Nodes, name1, Config),
- ?line check_everywhere(Nodes, name2, Config),
- ?line {monitors, GMonitors} = process_info(Server, monitors),
- ?line false = lists:member({process, Proc}, GMonitors),
+ ct:sleep(100),
+ undefined = global:whereis_name(name1),
+ undefined = global:whereis_name(name2),
+ check_everywhere(Nodes, name1, Config),
+ check_everywhere(Nodes, name2, Config),
+ {monitors, GMonitors} = process_info(Server, monitors),
+ false = lists:member({process, Proc}, GMonitors),
write_high_level_trace(Config),
stop_node(B),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
otp_5640_proc(_Parent) ->
@@ -1934,45 +1891,42 @@ otp_5640_proc(_Parent) ->
exit(normal)
end.
-otp_5737(suite) -> [];
-otp_5737(doc) ->
- ["OTP-5737. set_lock/3 and trans/4 accept Retries = 0."];
+%% OTP-5737. set_lock/3 and trans/4 accept Retries = 0.
otp_5737(Config) when is_list(Config) ->
Timeout = 25,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
+ init_condition(Config),
LockId = {?MODULE,self()},
Nodes = [node()],
- ?line {'EXIT', _} = (catch global:set_lock(LockId, Nodes, -1)),
- ?line {'EXIT', _} = (catch global:set_lock(LockId, Nodes, a)),
- ?line true = global:set_lock(LockId, Nodes, 0),
+ {'EXIT', _} = (catch global:set_lock(LockId, Nodes, -1)),
+ {'EXIT', _} = (catch global:set_lock(LockId, Nodes, a)),
+ true = global:set_lock(LockId, Nodes, 0),
Time1 = now(),
- ?line false = global:set_lock({?MODULE,not_me}, Nodes, 0),
- ?line true = timer:now_diff(now(), Time1) < 5000,
- ?line _ = global:del_lock(LockId, Nodes),
+ false = global:set_lock({?MODULE,not_me}, Nodes, 0),
+ true = timer:now_diff(now(), Time1) < 5000,
+ _ = global:del_lock(LockId, Nodes),
Fun = fun() -> ok end,
- ?line {'EXIT', _} = (catch global:trans(LockId, Fun, Nodes, -1)),
- ?line {'EXIT', _} = (catch global:trans(LockId, Fun, Nodes, a)),
- ?line ok = global:trans(LockId, Fun, Nodes, 0),
+ {'EXIT', _} = (catch global:trans(LockId, Fun, Nodes, -1)),
+ {'EXIT', _} = (catch global:trans(LockId, Fun, Nodes, a)),
+ ok = global:trans(LockId, Fun, Nodes, 0),
write_high_level_trace(Config),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-otp_6931(suite) -> [];
-otp_6931(doc) -> ["OTP-6931. Ignore nodeup when connect_all=false."];
+%% OTP-6931. Ignore nodeup when connect_all=false.
otp_6931(Config) when is_list(Config) ->
Me = self(),
- ?line {ok, CAf} = start_non_connecting_node(ca_false, Config),
- ?line ok = rpc:call(CAf, error_logger, add_report_handler, [?MODULE, Me]),
- ?line info = rpc:call(CAf, error_logger, warning_map, []),
- ?line {global_name_server,CAf} ! {nodeup, fake_node},
+ {ok, CAf} = start_non_connecting_node(ca_false, Config),
+ ok = rpc:call(CAf, error_logger, add_report_handler, [?MODULE, Me]),
+ info = rpc:call(CAf, error_logger, warning_map, []),
+ {global_name_server,CAf} ! {nodeup, fake_node},
timer:sleep(100),
stop_node(CAf),
- receive {nodeup,fake_node} -> test_server:fail({info_report, was, sent})
+ receive {nodeup,fake_node} -> ct:fail({info_report, was, sent})
after 1000 -> ok
end,
ok.
@@ -1980,18 +1934,17 @@ otp_6931(Config) when is_list(Config) ->
%%%-----------------------------------------------------------------
%%% Testing a disconnected node. Not two partitions.
%%%-----------------------------------------------------------------
-simple_disconnect(suite) -> [];
-simple_disconnect(doc) -> ["OTP-5563. Disconnected nodes (not partitions)"];
+%% OTP-5563. Disconnected nodes (not partitions).
simple_disconnect(Config) when is_list(Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
%% Three nodes (test_server, n_1, n_2).
- ?line [Cp1, Cp2] = Cps = start_nodes([n_1, n_2], peer, Config),
- ?line wait_for_ready_net(Config),
+ [Cp1, Cp2] = Cps = start_nodes([n_1, n_2], peer, Config),
+ wait_for_ready_net(Config),
Nodes = lists:sort([node() | Cps]),
@@ -2001,39 +1954,39 @@ simple_disconnect(Config) when is_list(Config) ->
Resolver = {no_module, resolve_none}, % will never be called
PingNode = Cp2,
- ?line {_Pid1, yes} =
+ {_Pid1, yes} =
rpc:call(Cp1, ?MODULE, start_resolver, [Name, Resolver]),
- test_server:sleep(100),
+ ct:sleep(100),
%% Disconnect test_server and Cp2.
- ?line true = erlang:disconnect_node(Cp2),
- test_server:sleep(500),
+ true = erlang:disconnect_node(Cp2),
+ ct:sleep(500),
%% _Pid is registered on Cp1. The exchange of names between Cp2 and
%% test_server sees two identical pids.
- ?line pong = net_adm:ping(PingNode),
- ?line ?UNTIL(Cps =:= lists:sort(nodes())),
+ pong = net_adm:ping(PingNode),
+ ?UNTIL(Cps =:= lists:sort(nodes())),
- ?line {_, Trace0} = collect_tracers(Nodes),
- ?line Resolvers = [P || {_Node,new_resolver,{pid,P}} <- Trace0],
- ?line lists:foreach(fun(P) -> P ! die end, Resolvers),
- ?line lists:foreach(fun(P) -> wait_for_exit(P) end, Resolvers),
- ?line check_everywhere(Nodes, Name, Config),
- ?line undefined = global:whereis_name(Name),
+ {_, Trace0} = collect_tracers(Nodes),
+ Resolvers = [P || {_Node,new_resolver,{pid,P}} <- Trace0],
+ lists:foreach(fun(P) -> P ! die end, Resolvers),
+ lists:foreach(fun(P) -> wait_for_exit(P) end, Resolvers),
+ check_everywhere(Nodes, Name, Config),
+ undefined = global:whereis_name(Name),
- ?line {_, Trace1} = collect_tracers(Nodes),
+ {_, Trace1} = collect_tracers(Nodes),
Trace = Trace0 ++ Trace1,
- ?line [] = [foo || {_, resolve_none, _, _} <- Trace],
+ [] = [foo || {_, resolve_none, _, _} <- Trace],
- ?line Gs = name_servers(Nodes),
- ?line [_, _, _] = monitored_by_node(Trace, Gs),
+ Gs = name_servers(Nodes),
+ [_, _, _] = monitored_by_node(Trace, Gs),
lists:foreach(fun(N) -> rpc:call(N, ?MODULE, stop_tracer, []) end, Nodes),
- ?line OrigNames = global:registered_names(),
+ OrigNames = global:registered_names(),
write_high_level_trace(Config),
stop_nodes(Cps),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
%% Not used right now.
@@ -2052,7 +2005,7 @@ simple_dis(Nodes0, Name, Resolver, Config) ->
simple_dis_node(_Node, DisNodes, _Name, _Resolver, Config) ->
lists:foreach(
fun(OtherNode) -> _ = erlang:disconnect_node(OtherNode) end, DisNodes),
- ?line ?UNTIL(DisNodes -- nodes() =:= DisNodes),
+ ?UNTIL(DisNodes -- nodes() =:= DisNodes),
ok.
@@ -2072,19 +2025,18 @@ simple_dis_node(_Node, DisNodes, _Name, _Resolver, Config) ->
-define(RES(F), {F, fun ?MODULE:F/3}).
-simple_resolve(suite) -> [];
-simple_resolve(doc) -> ["OTP-5563. Partitions and names."];
+%% OTP-5563. Partitions and names.
simple_resolve(Config) when is_list(Config) ->
Timeout = 360,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
- ?line [N1, A2, Z2] = Cps = start_nodes([n_1, a_2, z_2], peer, Config),
+ [N1, A2, Z2] = Cps = start_nodes([n_1, a_2, z_2], peer, Config),
Nodes = lists:sort([node() | Cps]),
- ?line wait_for_ready_net(Config),
-
+ wait_for_ready_net(Config),
+
lists:foreach(fun(N) ->
rpc:call(N, ?MODULE, start_tracer, [])
end, Nodes),
@@ -2193,20 +2145,19 @@ simple_resolve(Config) when is_list(Config) ->
%% then a new attempt (nodeup etc.) is made. This time the
%% resolver does not disconnect any node.
res(?RES(disconnect_first), Cps, Cf#cf{link = Z2, n2 = Z2,
- nodes = [node(), N1, A2, Z2]}),
+ nodes = [node(), N1, A2, Z2]}),
- ?line lists:foreach(fun(N) ->
- rpc:call(N, ?MODULE, stop_tracer, [])
- end, Nodes),
+ lists:foreach(fun(N) ->
+ rpc:call(N, ?MODULE, stop_tracer, [])
+ end, Nodes),
- ?line OrigNames = global:registered_names(),
+ OrigNames = global:registered_names(),
write_high_level_trace(Config),
stop_nodes(Cps),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-simple_resolve2(suite) -> [];
-simple_resolve2(doc) -> ["OTP-5563. Partitions and names."];
+%% OTP-5563. Partitions and names.
simple_resolve2(Config) when is_list(Config) ->
%% Continuation of simple_resolve. Of some reason it did not
%% always work to re-start z_2. "Cannot be a global bug."
@@ -2214,13 +2165,13 @@ simple_resolve2(Config) when is_list(Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
- ?line [N1, A2, Z2] = Cps = start_nodes([n_1, a_2, z_2], peer, Config),
- ?line wait_for_ready_net(Config),
+ [N1, A2, Z2] = Cps = start_nodes([n_1, a_2, z_2], peer, Config),
+ wait_for_ready_net(Config),
Nodes = lists:sort([node() | Cps]),
-
+
lists:foreach(fun(N) ->
rpc:call(N, ?MODULE, start_tracer, [])
end, Nodes),
@@ -2230,33 +2181,32 @@ simple_resolve2(Config) when is_list(Config) ->
%% Halt z_2.
res(?RES(halt_second), Cps, Cf#cf{link = N1, n1 = N1, n2 = Z2, ping = A2,
- nodes = [node(), N1, A2], n_res = 1}),
+ nodes = [node(), N1, A2], n_res = 1}),
- ?line lists:foreach(fun(N) ->
- rpc:call(N, ?MODULE, stop_tracer, [])
- end, Nodes),
+ lists:foreach(fun(N) ->
+ rpc:call(N, ?MODULE, stop_tracer, [])
+ end, Nodes),
- ?line OrigNames = global:registered_names(),
+ OrigNames = global:registered_names(),
write_high_level_trace(Config),
stop_nodes(Cps), % Not all nodes may be present, but it works anyway.
- ?line init_condition(Config),
+ init_condition(Config),
ok.
-simple_resolve3(suite) -> [];
-simple_resolve3(doc) -> ["OTP-5563. Partitions and names."];
+%% OTP-5563. Partitions and names.
simple_resolve3(Config) when is_list(Config) ->
%% Continuation of simple_resolve.
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
- ?line [N1, A2, Z2] = Cps = start_nodes([n_1, a_2, z_2], peer, Config),
- ?line wait_for_ready_net(Config),
+ [N1, A2, Z2] = Cps = start_nodes([n_1, a_2, z_2], peer, Config),
+ wait_for_ready_net(Config),
Nodes = lists:sort([node() | Cps]),
-
+
lists:foreach(fun(N) ->
rpc:call(N, ?MODULE, start_tracer, [])
end, Nodes),
@@ -2267,27 +2217,27 @@ simple_resolve3(Config) when is_list(Config) ->
%% Halt a_2.
res(?RES(halt_second), Cps, Cf#cf{link = node(), n2 = A2,
nodes = [node(), N1], n_res = 1}),
-
- ?line lists:foreach(fun(N) ->
- rpc:call(N, ?MODULE, stop_tracer, [])
- end, Nodes),
- ?line OrigNames = global:registered_names(),
+ lists:foreach(fun(N) ->
+ rpc:call(N, ?MODULE, stop_tracer, [])
+ end, Nodes),
+
+ OrigNames = global:registered_names(),
write_high_level_trace(Config),
stop_nodes(Cps), % Not all nodes may be present, but it works anyway.
- ?line init_condition(Config),
+ init_condition(Config),
ok.
res({Res,Resolver}, [N1, A2, Z2], Cf) ->
%% Note: there are no links anymore, but monitors.
#cf{link = LinkedNode, ping = PingNode, n1 = Res1, n2 = OtherNode,
nodes = Nodes0, n_res = NRes, config = Config} = Cf,
- ?t:format("~n~nResolver: ~p", [Res]),
- ?t:format(" Registered on partition 1: ~p", [Res1]),
- ?t:format(" Registered on partition 2: ~p", [OtherNode]),
- ?t:format(" Pinged node: ~p", [PingNode]),
- ?t:format(" Linked node: ~p", [LinkedNode]),
- ?t:format(" Expected # resolvers: ~p", [NRes]),
+ io:format("~n~nResolver: ~p", [Res]),
+ io:format(" Registered on partition 1: ~p", [Res1]),
+ io:format(" Registered on partition 2: ~p", [OtherNode]),
+ io:format(" Pinged node: ~p", [PingNode]),
+ io:format(" Linked node: ~p", [LinkedNode]),
+ io:format(" Expected # resolvers: ~p", [NRes]),
Nodes = lists:sort(Nodes0),
T1 = node(),
Part1 = [T1, N1],
@@ -2299,67 +2249,67 @@ res({Res,Resolver}, [N1, A2, Z2], Cf) ->
%% expected monitors remain between registered processes and the
%% global_name_server.
- ?line rpc_cast(OtherNode,
- ?MODULE,
- part_2_2,
- [Config, Part1, Part2, [{Name, Resolver}]]),
- ?line ?UNTIL(is_ready_partition(Config)),
- ?line {_Pid1, yes} =
+ rpc_cast(OtherNode,
+ ?MODULE,
+ part_2_2,
+ [Config, Part1, Part2, [{Name, Resolver}]]),
+ ?UNTIL(is_ready_partition(Config)),
+ {_Pid1, yes} =
rpc:call(Res1, ?MODULE, start_resolver, [Name, Resolver]),
- ?line pong = net_adm:ping(PingNode),
- ?line wait_for_ready_net(Nodes, Config),
+ pong = net_adm:ping(PingNode),
+ wait_for_ready_net(Nodes, Config),
- ?line check_everywhere(Nodes, Name, Config),
- ?line case global:whereis_name(Name) of
- undefined when LinkedNode =:= none -> ok;
- Pid -> assert_pid(Pid)
- end,
+ check_everywhere(Nodes, Name, Config),
+ case global:whereis_name(Name) of
+ undefined when LinkedNode =:= none -> ok;
+ Pid -> assert_pid(Pid)
+ end,
- ?line {_, Trace0} = collect_tracers(Nodes),
- ?line Resolvers = [P || {_Node,new_resolver,{pid,P}} <- Trace0],
+ {_, Trace0} = collect_tracers(Nodes),
+ Resolvers = [P || {_Node,new_resolver,{pid,P}} <- Trace0],
- ?line NRes = length(Resolvers),
+ NRes = length(Resolvers),
%% Wait for extra monitor processes to be created.
%% This applies as long as global:do_monitor/1 spawns processes.
%% (Some day monitor() will be truly synchronous.)
- test_server:sleep(100),
+ ct:sleep(100),
- ?line lists:foreach(fun(P) -> P ! die end, Resolvers),
- ?line lists:foreach(fun(P) -> wait_for_exit(P) end, Resolvers),
+ lists:foreach(fun(P) -> P ! die end, Resolvers),
+ lists:foreach(fun(P) -> wait_for_exit(P) end, Resolvers),
- ?line check_everywhere(Nodes, Name, Config),
- ?line undefined = global:whereis_name(Name),
+ check_everywhere(Nodes, Name, Config),
+ undefined = global:whereis_name(Name),
%% Wait for monitors to remove names.
- test_server:sleep(100),
+ ct:sleep(100),
- ?line {_, Trace1} = collect_tracers(Nodes),
+ {_, Trace1} = collect_tracers(Nodes),
Trace = Trace0 ++ Trace1,
- ?line Gs = name_servers([T1, N1, A2, Z2]),
- ?line MonitoredByNode = monitored_by_node(Trace, Gs),
- ?line MonitoredBy = [M || {_N,M} <- MonitoredByNode],
-
+ Gs = name_servers([T1, N1, A2, Z2]),
+ MonitoredByNode = monitored_by_node(Trace, Gs),
+ MonitoredBy = [M || {_N,M} <- MonitoredByNode],
+
X = MonitoredBy -- Gs,
LengthGs = length(Gs),
- ?line case MonitoredBy of
- [] when LinkedNode =:= none -> ok;
- Gs -> ok;
- _ when LengthGs < 4, X =:= [] -> ok;
- _ -> ?t:format("ERROR:~nMonitoredBy ~p~n"
- "global_name_servers ~p~n",
- [MonitoredByNode, Gs]),
- ?t:fail(monitor_mismatch)
- end,
+ case MonitoredBy of
+ [] when LinkedNode =:= none -> ok;
+ Gs -> ok;
+ _ when LengthGs < 4, X =:= [] -> ok;
+ _ -> io:format("ERROR:~nMonitoredBy ~p~n"
+ "global_name_servers ~p~n",
+ [MonitoredByNode, Gs]),
+ ct:fail(monitor_mismatch)
+ end,
ok.
name_servers(Nodes) ->
lists:sort([rpc:call(N, erlang, whereis, [global_name_server]) ||
N <- Nodes,
pong =:= net_adm:ping(N)]).
-
+
monitored_by_node(Trace, Servers) ->
lists:sort([{node(M),M} ||
{_Node,_P,died,{monitors_2levels,ML}} <- Trace,
@@ -2371,7 +2321,7 @@ part_2_2(Config, Part1, Part2, NameResolvers) ->
make_partition(Config, Part1, Part2),
lists:foreach
(fun({Name, Resolver}) ->
- ?line {Pid2, yes} = start_resolver(Name, Resolver),
+ {Pid2, yes} = start_resolver(Name, Resolver),
trace_message({node(), part_2_2, nodes(), {pid2,Pid2}})
end, NameResolvers).
@@ -2396,7 +2346,7 @@ exit_resolver(name, _Pid1, _Pid2) ->
lock_resolver(name, Pid1, _Pid2) ->
Id = {?MODULE, self()},
Nodes = [node()],
- ?line true = global:set_lock(Id, Nodes),
+ true = global:set_lock(Id, Nodes),
_ = global:del_lock(Id, Nodes),
Pid1.
@@ -2426,7 +2376,7 @@ start_resolver(Name, Resolver) ->
receive
{Pid, Res} -> {Pid, Res}
end.
-
+
init_resolver(Parent, Name, Resolver) ->
X = global:register_name(Name, self(), Resolver),
Parent ! {self(), X},
@@ -2455,18 +2405,17 @@ mon_by_servers(Proc) ->
-define(REGNAME, contact_a_2).
-leftover_name(suite) -> [];
-leftover_name(doc) -> ["OTP-5563. Bug: nodedown while synching."];
+%% OTP-5563. Bug: nodedown while synching.
leftover_name(Config) when is_list(Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
- ?line [N1, A2, Z2] = Cps = start_nodes([n_1, a_2, z_2], peer, Config),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
+ [N1, A2, Z2] = Cps = start_nodes([n_1, a_2, z_2], peer, Config),
Nodes = lists:sort([node() | Cps]),
- ?line wait_for_ready_net(Config),
-
+ wait_for_ready_net(Config),
+
lists:foreach(fun(N) ->
rpc:call(N, ?MODULE, start_tracer, [])
end, Nodes),
@@ -2474,20 +2423,20 @@ leftover_name(Config) when is_list(Config) ->
Name = name, % registered on a_2
ResName = resolved_name, % registered on n_1 and a_2
%%
- ?line _Pid = ping_a_2_fun(?REGNAME, N1, A2),
+ _Pid = ping_a_2_fun(?REGNAME, N1, A2),
T1 = node(),
Part1 = [T1, N1],
Part2 = [A2, Z2],
NoResolver = {no_module, resolve_none},
Resolver = fun contact_a_2/3,
- ?line rpc_cast(A2,
- ?MODULE, part_2_2, [Config,
- Part1,
- Part2,
- [{Name, NoResolver},
- {ResName, Resolver}]]),
- ?line ?UNTIL(is_ready_partition(Config)),
+ rpc_cast(A2,
+ ?MODULE, part_2_2, [Config,
+ Part1,
+ Part2,
+ [{Name, NoResolver},
+ {ResName, Resolver}]]),
+ ?UNTIL(is_ready_partition(Config)),
%% resolved_name is resolved to run on a_2, an insert operation is
%% sent to n_1. The resolver function halts a_2, but the nodedown
@@ -2496,36 +2445,36 @@ leftover_name(Config) when is_list(Config) ->
%% delayed). Unless "artificial" nodedown messages are sent the
%% name would linger on indefinitely. [There is no test case for
%% the situation that no nodedown message at all is sent.]
- ?line {_Pid1, yes} =
+ {_Pid1, yes} =
rpc:call(N1, ?MODULE, start_resolver,
[ResName, fun contact_a_2/3]),
- test_server:sleep(1000),
+ ct:sleep(1000),
- ?line trace_message({node(), pinging, z_2}),
- ?line pong = net_adm:ping(Z2),
- ?line ?UNTIL((Nodes -- [A2]) =:= lists:sort(?NODES)),
- ?t:sleep(1000),
+ trace_message({node(), pinging, z_2}),
+ pong = net_adm:ping(Z2),
+ ?UNTIL((Nodes -- [A2]) =:= lists:sort(?NODES)),
+ ct:sleep(1000),
- ?line {_,Trace0} = collect_tracers(Nodes),
+ {_,Trace0} = collect_tracers(Nodes),
- ?line Resolvers = [P || {_Node,new_resolver,{pid,P}} <- Trace0],
- ?line lists:foreach(fun(P) -> P ! die end, Resolvers),
- ?line lists:foreach(fun(P) -> wait_for_exit(P) end, Resolvers),
+ Resolvers = [P || {_Node,new_resolver,{pid,P}} <- Trace0],
+ lists:foreach(fun(P) -> P ! die end, Resolvers),
+ lists:foreach(fun(P) -> wait_for_exit(P) end, Resolvers),
- ?line lists:foreach(fun(N) ->
- rpc:call(N, ?MODULE, stop_tracer, [])
- end, Nodes),
+ lists:foreach(fun(N) ->
+ rpc:call(N, ?MODULE, stop_tracer, [])
+ end, Nodes),
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
+ ?UNTIL(OrigNames =:= global:registered_names()),
write_high_level_trace(Config),
stop_nodes(Cps),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
%% Runs on n_1
contact_a_2(resolved_name, Pid1, Pid2) ->
trace_message({node(), ?REGNAME, {pid1,Pid1}, {pid2,Pid2},
- {node1,node(Pid1)}, {node2,node(Pid2)}}),
+ {node1,node(Pid1)}, {node2,node(Pid2)}}),
?REGNAME ! doit,
Pid2.
@@ -2543,15 +2492,14 @@ ping_a_2(RegName, N1, A2) ->
{nodedown, A2} -> ok
end
end.
-
+
halt_node(Node) ->
rpc:call(Node, erlang, halt, []).
%%%-----------------------------------------------------------------
%%% Testing re-registration of a name.
%%%-----------------------------------------------------------------
-re_register_name(suite) -> [];
-re_register_name(doc) -> ["OTP-5563. Name is re-registered."];
+%% OTP-5563. Name is re-registered.
re_register_name(Config) when is_list(Config) ->
%% When re-registering a name the link to the old pid used to
%% linger on. Don't think is was a serious bug though--some memory
@@ -2560,18 +2508,18 @@ re_register_name(Config) when is_list(Config) ->
Timeout = 15,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
+ init_condition(Config),
Me = self(),
Pid1 = spawn(fun() -> proc(Me) end),
- ?line yes = global:register_name(name, Pid1),
+ yes = global:register_name(name, Pid1),
Pid2 = spawn(fun() -> proc(Me) end),
- ?line _ = global:re_register_name(name, Pid2),
+ _ = global:re_register_name(name, Pid2),
Pid2 ! die,
Pid1 ! die,
receive {Pid1, MonitoredBy1} -> [] = MonitoredBy1 end,
receive {Pid2, MonitoredBy2} -> [_] = MonitoredBy2 end,
- ?line _ = global:unregister_name(name),
- ?line init_condition(Config),
+ _ = global:unregister_name(name),
+ init_condition(Config),
ok.
proc(Parent) ->
@@ -2583,15 +2531,14 @@ proc(Parent) ->
%%%-----------------------------------------------------------------
%%%
%%%-----------------------------------------------------------------
-name_exit(suite) -> [];
-name_exit(doc) -> ["OTP-5563. Registered process dies."];
+%% OTP-5563. Registered process dies.
name_exit(Config) when is_list(Config) ->
StartFun = fun() ->
{ok, N1} = start_node_rel(n_1, this, Config),
{ok, N2} = start_node_rel(n_2, this, Config),
[N1, N2]
end,
- ?t:format("Test of current release~n"),
+ io:format("Test of current release~n"),
do_name_exit(StartFun, current, Config).
do_name_exit(StartFun, Version, Config) ->
@@ -2607,17 +2554,17 @@ do_name_exit(StartFun, Version, Config) ->
Timeout = 60,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
%% Three nodes (test_server, n_1, n_2).
- ?line Cps = StartFun(),
+ Cps = StartFun(),
Nodes = lists:sort([node() | Cps]),
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
lists:foreach(fun(N) -> rpc:call(N, ?MODULE, start_tracer, []) end,Nodes),
Name = name,
- ?line {Pid, yes} = start_proc(Name),
+ {Pid, yes} = start_proc(Name),
Me = self(),
LL = spawn(fun() -> long_lock(Me) end),
@@ -2628,23 +2575,23 @@ do_name_exit(StartFun, Version, Config) ->
Pid ! die,
wait_for_exit_fast(Pid),
- ?t:sleep(100),
+ ct:sleep(100),
%% Name has been removed from node()'s table, but nowhere else
%% since there is a lock on 'global'.
{R1,[]} = rpc:multicall(Nodes, global, whereis_name, [Name]),
- ?line case Version of
- old -> [_,_] = lists:usort(R1);
- current -> [undefined, undefined, undefined] = R1
- end,
- ?t:sleep(3000),
- ?line check_everywhere(Nodes, Name, Config),
+ case Version of
+ old -> [_,_] = lists:usort(R1);
+ current -> [undefined, undefined, undefined] = R1
+ end,
+ ct:sleep(3000),
+ check_everywhere(Nodes, Name, Config),
lists:foreach(fun(N) -> rpc:call(N, ?MODULE, stop_tracer, []) end, Nodes),
- ?line OrigNames = global:registered_names(),
+ OrigNames = global:registered_names(),
exit(LL, kill),
write_high_level_trace(Config),
stop_nodes(Cps),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
long_lock(Parent) ->
@@ -2657,17 +2604,16 @@ long_lock(Parent) ->
%%%-----------------------------------------------------------------
%%% Testing the support for external nodes (cnodes)
%%%-----------------------------------------------------------------
-external_nodes(suite) -> [];
-external_nodes(doc) -> ["OTP-5563. External nodes (cnodes)."];
+%% OTP-5563. External nodes (cnodes).
external_nodes(Config) when is_list(Config) ->
Timeout = 30,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
- ?line [NodeB, NodeC] = start_nodes([b, c], peer, Config),
- ?line wait_for_ready_net(Config),
+ [NodeB, NodeC] = start_nodes([b, c], peer, Config),
+ wait_for_ready_net(Config),
%% Nodes = ?NODES,
%% lists:foreach(fun(N) -> rpc:call(N, ?MODULE, start_tracer, []) end,
@@ -2676,75 +2622,75 @@ external_nodes(Config) when is_list(Config) ->
%% Two partitions: [test_server] and [b, c].
%% c registers an external name on b
- ?line rpc_cast(NodeB, ?MODULE, part_ext,
- [Config, node(), NodeC, Name]),
- ?line ?UNTIL(is_ready_partition(Config)),
+ rpc_cast(NodeB, ?MODULE, part_ext,
+ [Config, node(), NodeC, Name]),
+ ?UNTIL(is_ready_partition(Config)),
- ?line pong = net_adm:ping(NodeB),
- ?line ?UNTIL([NodeB, NodeC] =:= lists:sort(nodes())),
- ?line wait_for_ready_net(Config),
+ pong = net_adm:ping(NodeB),
+ ?UNTIL([NodeB, NodeC] =:= lists:sort(nodes())),
+ wait_for_ready_net(Config),
- ?line Cpid = rpc:call(NodeC, erlang, whereis, [Name]),
+ Cpid = rpc:call(NodeC, erlang, whereis, [Name]),
ExternalName = [{name,Cpid,NodeB}],
- ?line ExternalName = get_ext_names(),
- ?line ExternalName = rpc:call(NodeB, gen_server, call,
- [global_name_server, get_names_ext]),
- ?line ExternalName = rpc:call(NodeC, gen_server, call,
- [global_name_server, get_names_ext]),
-
- ?line [_] = cnode_links(Cpid),
- ?line [_,_,_] = cnode_monitored_by(Cpid),
- ?line no = global:register_name(Name, self()),
- ?line yes = global:re_register_name(Name, self()),
- ?line ?UNTIL([] =:= cnode_monitored_by(Cpid)),
- ?line ?UNTIL([] =:= cnode_links(Cpid)),
- ?line [] = gen_server:call(global_name_server, get_names_ext, infinity),
-
- ?line Cpid ! {register, self(), Name},
- ?line receive {Cpid, Reply1} -> no = Reply1 end,
- ?line _ = global:unregister_name(Name),
- test_server:sleep(1000),
- ?line Cpid ! {register, self(), Name},
- ?line ?UNTIL(length(get_ext_names()) =:= 1),
- ?line receive {Cpid, Reply2} -> yes = Reply2 end,
-
- ?line Cpid ! {unregister, self(), Name},
- ?line ?UNTIL(length(get_ext_names()) =:= 0),
- ?line receive {Cpid, Reply3} -> ok = Reply3 end,
+ ExternalName = get_ext_names(),
+ ExternalName = rpc:call(NodeB, gen_server, call,
+ [global_name_server, get_names_ext]),
+ ExternalName = rpc:call(NodeC, gen_server, call,
+ [global_name_server, get_names_ext]),
+
+ [_] = cnode_links(Cpid),
+ [_,_,_] = cnode_monitored_by(Cpid),
+ no = global:register_name(Name, self()),
+ yes = global:re_register_name(Name, self()),
+ ?UNTIL([] =:= cnode_monitored_by(Cpid)),
+ ?UNTIL([] =:= cnode_links(Cpid)),
+ [] = gen_server:call(global_name_server, get_names_ext, infinity),
+
+ Cpid ! {register, self(), Name},
+ receive {Cpid, Reply1} -> no = Reply1 end,
+ _ = global:unregister_name(Name),
+ ct:sleep(1000),
+ Cpid ! {register, self(), Name},
+ ?UNTIL(length(get_ext_names()) =:= 1),
+ receive {Cpid, Reply2} -> yes = Reply2 end,
+
+ Cpid ! {unregister, self(), Name},
+ ?UNTIL(length(get_ext_names()) =:= 0),
+ receive {Cpid, Reply3} -> ok = Reply3 end,
Cpid ! die,
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
- ?line [] = get_ext_names(),
- ?line [] = rpc:call(NodeB, gen_server, call,
- [global_name_server, get_names_ext]),
- ?line [] = rpc:call(NodeC, gen_server, call,
- [global_name_server, get_names_ext]),
+ ?UNTIL(OrigNames =:= global:registered_names()),
+ [] = get_ext_names(),
+ [] = rpc:call(NodeB, gen_server, call,
+ [global_name_server, get_names_ext]),
+ [] = rpc:call(NodeC, gen_server, call,
+ [global_name_server, get_names_ext]),
- ?line Cpid2 = erlang:spawn(NodeC, fun() -> cnode_proc(NodeB) end),
- ?line Cpid2 ! {register, self(), Name},
- ?line receive {Cpid2, Reply4} -> yes = Reply4 end,
+ Cpid2 = erlang:spawn(NodeC, fun() -> cnode_proc(NodeB) end),
+ Cpid2 ! {register, self(), Name},
+ receive {Cpid2, Reply4} -> yes = Reply4 end,
%% It could be a bug that Cpid2 is linked to 'global_name_server'
%% at node 'b'. The effect: Cpid2 dies when node 'b' crashes.
stop_node(NodeB),
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
- ?line [] = get_ext_names(),
- ?line [] = rpc:call(NodeC, gen_server, call,
- [global_name_server, get_names_ext]),
+ ?UNTIL(OrigNames =:= global:registered_names()),
+ [] = get_ext_names(),
+ [] = rpc:call(NodeC, gen_server, call,
+ [global_name_server, get_names_ext]),
- %% ?line {_, Trace} = collect_tracers(Nodes),
+ %% {_, Trace} = collect_tracers(Nodes),
%% lists:foreach(fun(M) -> erlang:display(M) end, Trace),
ThisNode = node(),
- ?line Cpid3 = erlang:spawn(NodeC, fun() -> cnode_proc(ThisNode) end),
- ?line Cpid3 ! {register, self(), Name},
- ?line receive {Cpid3, Reply5} -> yes = Reply5 end,
+ Cpid3 = erlang:spawn(NodeC, fun() -> cnode_proc(ThisNode) end),
+ Cpid3 ! {register, self(), Name},
+ receive {Cpid3, Reply5} -> yes = Reply5 end,
- ?line ?UNTIL(length(get_ext_names()) =:= 1),
+ ?UNTIL(length(get_ext_names()) =:= 1),
stop_node(NodeC),
- ?line ?UNTIL(length(get_ext_names()) =:= 0),
+ ?UNTIL(length(get_ext_names()) =:= 0),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
get_ext_names() ->
@@ -2791,19 +2737,16 @@ cnode_proc(E) ->
cnode_proc(E).
-many_nodes(suite) ->
- [];
-many_nodes(doc) ->
- ["OTP-5770. Start many nodes. Make them connect at the same time."];
+%% OTP-5770. Start many nodes. Make them connect at the same time.
many_nodes(Config) when is_list(Config) ->
Timeout = 240,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
{Rels, N_cps} =
- case ?t:os_type() of
+ case test_server:os_type() of
{unix, Osname} when Osname =:= linux;
Osname =:= openbsd;
Osname =:= darwin ->
@@ -2814,12 +2757,12 @@ many_nodes(Config) when is_list(Config) ->
_ ->
{node_rel(1, 32, this), 32}
end,
- ?line Cps = [begin {ok, Cp} = start_node_rel(Name, Rel, Config), Cp end ||
- {Name,Rel} <- Rels],
+ Cps = [begin {ok, Cp} = start_node_rel(Name, Rel, Config), Cp end ||
+ {Name,Rel} <- Rels],
Nodes = lists:sort(?NODES),
- ?line wait_for_ready_net(Nodes, Config),
+ wait_for_ready_net(Nodes, Config),
- ?line Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
GoFile = filename:join([Dir, "go.txt"]),
file:delete(GoFile),
@@ -2830,34 +2773,34 @@ many_nodes(Config) when is_list(Config) ->
file:delete(File),
rpc_cast(N, ?MODULE, isolated_node, [File, GoFile, Cps, Config])
end,
- ?line lists:foreach(IsoFun, CpsFiles),
-
- ?line all_nodes_files(CpsFiles, "isolated", Config),
- ?line Time = msec(),
- ?line sync_until(),
+ lists:foreach(IsoFun, CpsFiles),
+
+ all_nodes_files(CpsFiles, "isolated", Config),
+ Time = msec(),
+ sync_until(),
erlang:display(ready_to_go),
- ?line touch(GoFile, "go"),
- ?line all_nodes_files(CpsFiles, "done", Config),
- ?line Time2 = msec(),
+ touch(GoFile, "go"),
+ all_nodes_files(CpsFiles, "done", Config),
+ Time2 = msec(),
- ?line lists:foreach(fun(N) -> pong = net_adm:ping(N) end, Cps),
+ lists:foreach(fun(N) -> pong = net_adm:ping(N) end, Cps),
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
write_high_level_trace(Config), % The test succeeded, but was it slow?
- ?line lists:foreach(fun({_N, File}) -> file:delete(File) end, CpsFiles),
- ?line file:delete(GoFile),
+ lists:foreach(fun({_N, File}) -> file:delete(File) end, CpsFiles),
+ file:delete(GoFile),
- ?line ?UNTIL(OrigNames =:= global:registered_names()),
+ ?UNTIL(OrigNames =:= global:registered_names()),
write_high_level_trace(Config),
- ?line stop_nodes(Cps),
- ?line init_condition(Config),
+ stop_nodes(Cps),
+ init_condition(Config),
Diff = Time2 - Time,
Return = lists:flatten(io_lib:format("~w nodes took ~w ms",
[N_cps, Diff])),
erlang:display({{nodes,N_cps},{time,Diff}}),
- ?t:format("~s~n", [Return]),
+ io:format("~s~n", [Return]),
{comment, Return}.
node_rel(From, To, Rel) ->
@@ -2883,7 +2826,7 @@ isolated_node(File, GoFile, Nodes, Config) ->
touch(File, "got_go"),
lists:foreach(fun(N) -> _ = net_adm:ping(N) end, shuffle(Nodes)),
touch(File, "pinged"),
- ?line ?UNTIL((Ns -- get_known(node())) =:= []),
+ ?UNTIL((Ns -- get_known(node())) =:= []),
touch(File, "done").
touch(File, List) ->
@@ -2933,17 +2876,15 @@ sync_until(LogFile) ->
shuffle(L) ->
[E || {_, E} <- lists:keysort(1, [{rand:uniform(), E} || E <- L])].
-sync_0(suite) -> [];
-sync_0(doc) ->
- ["OTP-5770. sync/0."];
+%% OTP-5770. sync/0.
sync_0(Config) when is_list(Config) ->
Timeout = 180,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
+ init_condition(Config),
N_cps =
- case ?t:os_type() of
+ case test_server:os_type() of
{unix, Osname} when Osname =:= linux;
Osname =:= openbsd;
Osname =:= darwin ->
@@ -2958,82 +2899,80 @@ sync_0(Config) when is_list(Config) ->
Names = [lists:concat([cp,N]) || N <- lists:seq(1, N_cps)],
Cps = start_and_sync(Names),
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
write_high_level_trace(Config),
stop_nodes(Cps),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
start_and_sync([]) ->
[];
start_and_sync([Name | Names]) ->
- ?line {ok, N} = start_node(Name, slave, []),
- ?line {Time, _Void} = rpc:call(N, timer, tc, [global, sync, []]),
- ?t:format("~p: ~p~n", [Name, Time]),
+ {ok, N} = start_node(Name, slave, []),
+ {Time, _Void} = rpc:call(N, timer, tc, [global, sync, []]),
+ io:format("~p: ~p~n", [Name, Time]),
[N | start_and_sync(Names)].
%%%-----------------------------------------------------------------
%%% Testing of change of global_groups parameter.
%%%-----------------------------------------------------------------
-global_groups_change(suite) -> [];
-global_groups_change(doc) -> ["Test change of global_groups parameter."];
+%% Test change of global_groups parameter.
global_groups_change(Config) ->
Timeout = 90,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line M = from($@, atom_to_list(node())),
-
- % Create the .app files and the boot script
- ?line {KernelVer, StdlibVer} = create_script_dc("dc"),
- ?line case is_real_system(KernelVer, StdlibVer) of
- true ->
- Options = [];
- false ->
- Options = [local]
- end,
+ init_condition(Config),
+ M = from($@, atom_to_list(node())),
+
+ %% Create the .app files and the boot script
+ {KernelVer, StdlibVer} = create_script_dc("dc"),
+ case is_real_system(KernelVer, StdlibVer) of
+ true ->
+ Options = [];
+ false ->
+ Options = [local]
+ end,
+
+ ok = systools:make_script("dc", Options),
- ?line ok = systools:make_script("dc", Options),
-
[Ncp1,Ncp2,Ncp3,Ncp4,Ncp5,NcpA,NcpB,NcpC,NcpD,NcpE] =
node_names([cp1,cp2,cp3,cp4,cp5,cpA,cpB,cpC,cpD,cpE], Config),
- % Write config files
- ?line Dir = ?config(priv_dir,Config),
- ?line {ok, Fd_dc} = file:open(filename:join(Dir, "sys.config"), [write]),
- ?line config_dc1(Fd_dc, Ncp1, Ncp2, Ncp3, NcpA, NcpB, NcpC, NcpD, NcpE),
- ?line file:close(Fd_dc),
- ?line Config1 = filename:join(Dir, "sys"),
-
- % Test [cp1, cp2, cp3]
- ?line {ok, Cp1} = start_node_boot(Ncp1, Config1, dc),
- ?line {ok, Cp2} = start_node_boot(Ncp2, Config1, dc),
- ?line {ok, Cp3} = start_node_boot(Ncp3, Config1, dc),
- ?line {ok, CpA} = start_node_boot(NcpA, Config1, dc),
- ?line {ok, CpB} = start_node_boot(NcpB, Config1, dc),
- ?line {ok, CpC} = start_node_boot(NcpC, Config1, dc),
- ?line {ok, CpD} = start_node_boot(NcpD, Config1, dc),
- ?line {ok, CpE} = start_node_boot(NcpE, Config1, dc),
-
- ?line pong = rpc:call(Cp1, net_adm, ping, [Cp2]),
- ?line pong = rpc:call(Cp1, net_adm, ping, [Cp3]),
- ?line pang = rpc:call(Cp1, net_adm, ping,
- [list_to_atom(lists:concat(["cp5@", M]))]),
- ?line pong = rpc:call(Cp2, net_adm, ping, [Cp3]),
- ?line pang = rpc:call(Cp2, net_adm, ping,
- [list_to_atom(lists:concat(["cp5@", M]))]),
-
- ?line {TestGG4, yes} = rpc:call(CpB, ?MODULE, start_proc, [test]),
- ?line {TestGG5, yes} = rpc:call(CpE, ?MODULE, start_proc, [test]),
-
-
- ?line pong = rpc:call(CpA, net_adm, ping, [CpC]),
- ?line pong = rpc:call(CpC, net_adm, ping, [CpB]),
- ?line pong = rpc:call(CpD, net_adm, ping, [CpC]),
- ?line pong = rpc:call(CpE, net_adm, ping, [CpD]),
-
- ?line
+ %% Write config files
+ Dir = proplists:get_value(priv_dir,Config),
+ {ok, Fd_dc} = file:open(filename:join(Dir, "sys.config"), [write]),
+ config_dc1(Fd_dc, Ncp1, Ncp2, Ncp3, NcpA, NcpB, NcpC, NcpD, NcpE),
+ file:close(Fd_dc),
+ Config1 = filename:join(Dir, "sys"),
+
+ %% Test [cp1, cp2, cp3]
+ {ok, Cp1} = start_node_boot(Ncp1, Config1, dc),
+ {ok, Cp2} = start_node_boot(Ncp2, Config1, dc),
+ {ok, Cp3} = start_node_boot(Ncp3, Config1, dc),
+ {ok, CpA} = start_node_boot(NcpA, Config1, dc),
+ {ok, CpB} = start_node_boot(NcpB, Config1, dc),
+ {ok, CpC} = start_node_boot(NcpC, Config1, dc),
+ {ok, CpD} = start_node_boot(NcpD, Config1, dc),
+ {ok, CpE} = start_node_boot(NcpE, Config1, dc),
+
+ pong = rpc:call(Cp1, net_adm, ping, [Cp2]),
+ pong = rpc:call(Cp1, net_adm, ping, [Cp3]),
+ pang = rpc:call(Cp1, net_adm, ping,
+ [list_to_atom(lists:concat(["cp5@", M]))]),
+ pong = rpc:call(Cp2, net_adm, ping, [Cp3]),
+ pang = rpc:call(Cp2, net_adm, ping,
+ [list_to_atom(lists:concat(["cp5@", M]))]),
+
+ {TestGG4, yes} = rpc:call(CpB, ?MODULE, start_proc, [test]),
+ {TestGG5, yes} = rpc:call(CpE, ?MODULE, start_proc, [test]),
+
+
+ pong = rpc:call(CpA, net_adm, ping, [CpC]),
+ pong = rpc:call(CpC, net_adm, ping, [CpB]),
+ pong = rpc:call(CpD, net_adm, ping, [CpC]),
+ pong = rpc:call(CpE, net_adm, ping, [CpD]),
+
?UNTIL(begin
TestGG4_1 = rpc:call(CpA, global, whereis_name, [test]),
TestGG4_2 = rpc:call(CpB, global, whereis_name, [test]),
@@ -3050,88 +2989,87 @@ global_groups_change(Config) ->
(TestGG5_2 =:= TestGG5)
end),
- ?line ?t:format( "#### nodes() ~p~n",[nodes()]),
+ io:format( "#### nodes() ~p~n",[nodes()]),
- ?line XDcWa1 = rpc:call(Cp1, global_group, info, []),
- ?line XDcWa2 = rpc:call(Cp2, global_group, info, []),
- ?line XDcWa3 = rpc:call(Cp3, global_group, info, []),
- ?line ?t:format( "#### XDcWa1 ~p~n",[XDcWa1]),
- ?line ?t:format( "#### XDcWa2 ~p~n",[XDcWa2]),
- ?line ?t:format( "#### XDcWa3 ~p~n",[XDcWa3]),
+ XDcWa1 = rpc:call(Cp1, global_group, info, []),
+ XDcWa2 = rpc:call(Cp2, global_group, info, []),
+ XDcWa3 = rpc:call(Cp3, global_group, info, []),
+ io:format( "#### XDcWa1 ~p~n",[XDcWa1]),
+ io:format( "#### XDcWa2 ~p~n",[XDcWa2]),
+ io:format( "#### XDcWa3 ~p~n",[XDcWa3]),
+
+ stop_node(CpC),
- ?line stop_node(CpC),
-
%% Read the current configuration parameters, and change them
- ?line OldEnv =
+ OldEnv =
rpc:call(Cp1, application_controller, prep_config_change, []),
- ?line {value, {kernel, OldKernel}} = lists:keysearch(kernel, 1, OldEnv),
+ {value, {kernel, OldKernel}} = lists:keysearch(kernel, 1, OldEnv),
- ?line GG1 =
+ GG1 =
lists:sort([mk_node(Ncp1, M), mk_node(Ncp2, M), mk_node(Ncp5, M)]),
- ?line GG2 = lists:sort([mk_node(Ncp3, M)]),
- ?line GG3 = lists:sort([mk_node(Ncp4, M)]),
- ?line GG4 = lists:sort([mk_node(NcpA, M), mk_node(NcpB, M)]),
- ?line GG5 =
+ GG2 = lists:sort([mk_node(Ncp3, M)]),
+ GG3 = lists:sort([mk_node(Ncp4, M)]),
+ GG4 = lists:sort([mk_node(NcpA, M), mk_node(NcpB, M)]),
+ GG5 =
lists:sort([mk_node(NcpC, M), mk_node(NcpD, M), mk_node(NcpE, M)]),
- ?line NewNG = {global_groups,[{gg1, normal, GG1},
- {gg2, normal, GG2},
- {gg3, normal, GG3},
- {gg4, normal, GG4},
- {gg5, hidden, GG5}]},
-
- ?line NewKernel =
+ NewNG = {global_groups,[{gg1, normal, GG1},
+ {gg2, normal, GG2},
+ {gg3, normal, GG3},
+ {gg4, normal, GG4},
+ {gg5, hidden, GG5}]},
+
+ NewKernel =
[{kernel, lists:keyreplace(global_groups, 1, OldKernel, NewNG)}],
- ?line ok = rpc:call(Cp1, application_controller, test_change_apps,
- [[kernel], [NewKernel]]),
- ?line ok = rpc:call(Cp2, application_controller, test_change_apps,
- [[kernel], [NewKernel]]),
- ?line ok = rpc:call(Cp3, application_controller, test_change_apps,
- [[kernel], [NewKernel]]),
- ?line ok = rpc:call(CpA, application_controller, test_change_apps,
- [[kernel], [NewKernel]]),
- ?line ok = rpc:call(CpB, application_controller, test_change_apps,
- [[kernel], [NewKernel]]),
- ?line ok = rpc:call(CpD, application_controller, test_change_apps,
- [[kernel], [NewKernel]]),
- ?line ok = rpc:call(CpE, application_controller, test_change_apps,
- [[kernel], [NewKernel]]),
-
- ?line ?t:format("#### ~p~n",[multicall]),
- ?line ?t:format( "#### ~p~n",[multicall]),
+ ok = rpc:call(Cp1, application_controller, test_change_apps,
+ [[kernel], [NewKernel]]),
+ ok = rpc:call(Cp2, application_controller, test_change_apps,
+ [[kernel], [NewKernel]]),
+ ok = rpc:call(Cp3, application_controller, test_change_apps,
+ [[kernel], [NewKernel]]),
+ ok = rpc:call(CpA, application_controller, test_change_apps,
+ [[kernel], [NewKernel]]),
+ ok = rpc:call(CpB, application_controller, test_change_apps,
+ [[kernel], [NewKernel]]),
+ ok = rpc:call(CpD, application_controller, test_change_apps,
+ [[kernel], [NewKernel]]),
+ ok = rpc:call(CpE, application_controller, test_change_apps,
+ [[kernel], [NewKernel]]),
+
+ io:format("#### ~p~n",[multicall]),
+ io:format( "#### ~p~n",[multicall]),
%% no idea to check the result from the rpc because the other
%% nodes will disconnect test server, and thus the result will
%% always be {badrpc, nodedown}
- ?line rpc:multicall([Cp1, Cp2, Cp3, CpA, CpB, CpD, CpE],
- application_controller, config_change, [OldEnv]),
+ rpc:multicall([Cp1, Cp2, Cp3, CpA, CpB, CpD, CpE],
+ application_controller, config_change, [OldEnv]),
- ?line {ok, Fd_dc2} = file:open(filename:join(Dir, "sys2.config"), [write]),
- ?line config_dc2(Fd_dc2, NewNG, Ncp1, Ncp2, Ncp3),
- ?line file:close(Fd_dc2),
- ?line Config2 = filename:join(Dir, "sys2"),
- ?line {ok, CpC} = start_node_boot(NcpC, Config2, dc),
+ {ok, Fd_dc2} = file:open(filename:join(Dir, "sys2.config"), [write]),
+ config_dc2(Fd_dc2, NewNG, Ncp1, Ncp2, Ncp3),
+ file:close(Fd_dc2),
+ Config2 = filename:join(Dir, "sys2"),
+ {ok, CpC} = start_node_boot(NcpC, Config2, dc),
- ?line sync_and_wait(CpA),
- ?line sync_and_wait(CpD),
-
- ?line pong = rpc:call(CpA, net_adm, ping, [CpC]),
- ?line pong = rpc:call(CpC, net_adm, ping, [CpB]),
- ?line pong = rpc:call(CpD, net_adm, ping, [CpC]),
- ?line pong = rpc:call(CpE, net_adm, ping, [CpD]),
-
- ?line GG5 =
+ sync_and_wait(CpA),
+ sync_and_wait(CpD),
+
+ pong = rpc:call(CpA, net_adm, ping, [CpC]),
+ pong = rpc:call(CpC, net_adm, ping, [CpB]),
+ pong = rpc:call(CpD, net_adm, ping, [CpC]),
+ pong = rpc:call(CpE, net_adm, ping, [CpD]),
+
+ GG5 =
lists:sort([mk_node(NcpC, M)|rpc:call(CpC, erlang, nodes, [])]),
- ?line GG5 =
+ GG5 =
lists:sort([mk_node(NcpD, M)|rpc:call(CpD, erlang, nodes, [])]),
- ?line GG5 =
+ GG5 =
lists:sort([mk_node(NcpE, M)|rpc:call(CpE, erlang, nodes, [])]),
- ?line false =
+ false =
lists:member(mk_node(NcpC, M), rpc:call(CpA, erlang, nodes, [])),
- ?line false =
+ false =
lists:member(mk_node(NcpC, M), rpc:call(CpB, erlang, nodes, [])),
- ?line
?UNTIL(begin
TestGG4a = rpc:call(CpA, global, whereis_name, [test]),
TestGG4b = rpc:call(CpB, global, whereis_name, [test]),
@@ -3148,171 +3086,171 @@ global_groups_change(Config) ->
(TestGG5 =:= TestGG5e)
end),
- ?line Info1 = rpc:call(Cp1, global_group, info, []),
- ?line Info2 = rpc:call(Cp2, global_group, info, []),
- ?line Info3 = rpc:call(Cp3, global_group, info, []),
- ?line InfoA = rpc:call(CpA, global_group, info, []),
- ?line InfoB = rpc:call(CpB, global_group, info, []),
- ?line InfoC = rpc:call(CpC, global_group, info, []),
- ?line InfoD = rpc:call(CpD, global_group, info, []),
- ?line InfoE = rpc:call(CpE, global_group, info, []),
- ?line ?t:format( "#### Info1 ~p~n",[Info1]),
- ?line ?t:format( "#### Info2 ~p~n",[Info2]),
- ?line ?t:format( "#### Info3 ~p~n",[Info3]),
- ?line ?t:format( "#### InfoA ~p~n",[InfoA]),
- ?line ?t:format( "#### InfoB ~p~n",[InfoB]),
- ?line ?t:format( "#### InfoC ~p~n",[InfoC]),
- ?line ?t:format( "#### InfoD ~p~n",[InfoD]),
- ?line ?t:format( "#### InfoE ~p~n",[InfoE]),
-
- ?line {global_groups, GGNodes} = NewNG,
-
- ?line Info1ok = [{state, synced},
- {own_group_name, gg1},
- {own_group_nodes, GG1},
- {synced_nodes, [mk_node(Ncp2, M)]},
- {sync_error, []},
- {no_contact, [mk_node(Ncp5, M)]},
- {other_groups, remove_gg_pub_type(lists:keydelete
- (gg1, 1, GGNodes))},
- {monitoring, []}],
-
-
- ?line Info2ok = [{state, synced},
- {own_group_name, gg1},
- {own_group_nodes, GG1},
- {synced_nodes, [mk_node(Ncp1, M)]},
- {sync_error, []},
- {no_contact, [mk_node(Ncp5, M)]},
- {other_groups, remove_gg_pub_type(lists:keydelete
- (gg1, 1, GGNodes))},
- {monitoring, []}],
-
- ?line Info3ok = [{state, synced},
- {own_group_name, gg2},
- {own_group_nodes, GG2},
- {synced_nodes, []},
- {sync_error, []},
- {no_contact, []},
- {other_groups, remove_gg_pub_type(lists:keydelete
- (gg2, 1, GGNodes))},
- {monitoring, []}],
-
- ?line InfoAok = [{state, synced},
- {own_group_name, gg4},
- {own_group_nodes, GG4},
- {synced_nodes, lists:delete(mk_node(NcpA, M), GG4)},
- {sync_error, []},
- {no_contact, []},
- {other_groups, remove_gg_pub_type(lists:keydelete
- (gg4, 1, GGNodes))},
- {monitoring, []}],
-
- ?line InfoBok = [{state, synced},
- {own_group_name, gg4},
- {own_group_nodes, GG4},
- {synced_nodes, lists:delete(mk_node(NcpB, M), GG4)},
- {sync_error, []},
- {no_contact, []},
- {other_groups, remove_gg_pub_type(lists:keydelete
- (gg4, 1, GGNodes))},
- {monitoring, []}],
-
- ?line InfoCok = [{state, synced},
- {own_group_name, gg5},
- {own_group_nodes, GG5},
- {synced_nodes, lists:delete(mk_node(NcpC, M), GG5)},
- {sync_error, []},
- {no_contact, []},
- {other_groups, remove_gg_pub_type(lists:keydelete
- (gg5, 1, GGNodes))},
- {monitoring, []}],
-
- ?line InfoDok = [{state, synced},
- {own_group_name, gg5},
- {own_group_nodes, GG5},
- {synced_nodes, lists:delete(mk_node(NcpD, M), GG5)},
- {sync_error, []},
- {no_contact, []},
- {other_groups, remove_gg_pub_type(lists:keydelete
- (gg5, 1, GGNodes))},
- {monitoring, []}],
-
- ?line InfoEok = [{state, synced},
- {own_group_name, gg5},
- {own_group_nodes, GG5},
- {synced_nodes, lists:delete(mk_node(NcpE, M), GG5)},
- {sync_error, []},
- {no_contact, []},
- {other_groups, remove_gg_pub_type(lists:keydelete
- (gg5, 1, GGNodes))},
- {monitoring, []}],
-
-
- ?line case Info1 of
- Info1ok ->
- ok;
- _ ->
- test_server:fail({{"could not change the global groups"
- " in node", Cp1}, {Info1, Info1ok}})
- end,
+ Info1 = rpc:call(Cp1, global_group, info, []),
+ Info2 = rpc:call(Cp2, global_group, info, []),
+ Info3 = rpc:call(Cp3, global_group, info, []),
+ InfoA = rpc:call(CpA, global_group, info, []),
+ InfoB = rpc:call(CpB, global_group, info, []),
+ InfoC = rpc:call(CpC, global_group, info, []),
+ InfoD = rpc:call(CpD, global_group, info, []),
+ InfoE = rpc:call(CpE, global_group, info, []),
+ io:format( "#### Info1 ~p~n",[Info1]),
+ io:format( "#### Info2 ~p~n",[Info2]),
+ io:format( "#### Info3 ~p~n",[Info3]),
+ io:format( "#### InfoA ~p~n",[InfoA]),
+ io:format( "#### InfoB ~p~n",[InfoB]),
+ io:format( "#### InfoC ~p~n",[InfoC]),
+ io:format( "#### InfoD ~p~n",[InfoD]),
+ io:format( "#### InfoE ~p~n",[InfoE]),
+
+ {global_groups, GGNodes} = NewNG,
+
+ Info1ok = [{state, synced},
+ {own_group_name, gg1},
+ {own_group_nodes, GG1},
+ {synced_nodes, [mk_node(Ncp2, M)]},
+ {sync_error, []},
+ {no_contact, [mk_node(Ncp5, M)]},
+ {other_groups, remove_gg_pub_type(lists:keydelete
+ (gg1, 1, GGNodes))},
+ {monitoring, []}],
+
+
+ Info2ok = [{state, synced},
+ {own_group_name, gg1},
+ {own_group_nodes, GG1},
+ {synced_nodes, [mk_node(Ncp1, M)]},
+ {sync_error, []},
+ {no_contact, [mk_node(Ncp5, M)]},
+ {other_groups, remove_gg_pub_type(lists:keydelete
+ (gg1, 1, GGNodes))},
+ {monitoring, []}],
+
+ Info3ok = [{state, synced},
+ {own_group_name, gg2},
+ {own_group_nodes, GG2},
+ {synced_nodes, []},
+ {sync_error, []},
+ {no_contact, []},
+ {other_groups, remove_gg_pub_type(lists:keydelete
+ (gg2, 1, GGNodes))},
+ {monitoring, []}],
+
+ InfoAok = [{state, synced},
+ {own_group_name, gg4},
+ {own_group_nodes, GG4},
+ {synced_nodes, lists:delete(mk_node(NcpA, M), GG4)},
+ {sync_error, []},
+ {no_contact, []},
+ {other_groups, remove_gg_pub_type(lists:keydelete
+ (gg4, 1, GGNodes))},
+ {monitoring, []}],
+
+ InfoBok = [{state, synced},
+ {own_group_name, gg4},
+ {own_group_nodes, GG4},
+ {synced_nodes, lists:delete(mk_node(NcpB, M), GG4)},
+ {sync_error, []},
+ {no_contact, []},
+ {other_groups, remove_gg_pub_type(lists:keydelete
+ (gg4, 1, GGNodes))},
+ {monitoring, []}],
+
+ InfoCok = [{state, synced},
+ {own_group_name, gg5},
+ {own_group_nodes, GG5},
+ {synced_nodes, lists:delete(mk_node(NcpC, M), GG5)},
+ {sync_error, []},
+ {no_contact, []},
+ {other_groups, remove_gg_pub_type(lists:keydelete
+ (gg5, 1, GGNodes))},
+ {monitoring, []}],
+
+ InfoDok = [{state, synced},
+ {own_group_name, gg5},
+ {own_group_nodes, GG5},
+ {synced_nodes, lists:delete(mk_node(NcpD, M), GG5)},
+ {sync_error, []},
+ {no_contact, []},
+ {other_groups, remove_gg_pub_type(lists:keydelete
+ (gg5, 1, GGNodes))},
+ {monitoring, []}],
+
+ InfoEok = [{state, synced},
+ {own_group_name, gg5},
+ {own_group_nodes, GG5},
+ {synced_nodes, lists:delete(mk_node(NcpE, M), GG5)},
+ {sync_error, []},
+ {no_contact, []},
+ {other_groups, remove_gg_pub_type(lists:keydelete
+ (gg5, 1, GGNodes))},
+ {monitoring, []}],
+
+
+ case Info1 of
+ Info1ok ->
+ ok;
+ _ ->
+ ct:fail({{"could not change the global groups"
+ " in node", Cp1}, {Info1, Info1ok}})
+ end,
- ?line case Info2 of
- Info2ok ->
- ok;
- _ ->
- test_server:fail({{"could not change the global groups"
- " in node", Cp2}, {Info2, Info2ok}})
- end,
+ case Info2 of
+ Info2ok ->
+ ok;
+ _ ->
+ ct:fail({{"could not change the global groups"
+ " in node", Cp2}, {Info2, Info2ok}})
+ end,
- ?line case Info3 of
- Info3ok ->
- ok;
- _ ->
- test_server:fail({{"could not change the global groups"
- " in node", Cp3}, {Info3, Info3ok}})
- end,
+ case Info3 of
+ Info3ok ->
+ ok;
+ _ ->
+ ct:fail({{"could not change the global groups"
+ " in node", Cp3}, {Info3, Info3ok}})
+ end,
- ?line case InfoA of
- InfoAok ->
- ok;
- _ ->
- test_server:fail({{"could not change the global groups"
- " in node", CpA}, {InfoA, InfoAok}})
- end,
+ case InfoA of
+ InfoAok ->
+ ok;
+ _ ->
+ ct:fail({{"could not change the global groups"
+ " in node", CpA}, {InfoA, InfoAok}})
+ end,
- ?line case InfoB of
- InfoBok ->
- ok;
- _ ->
- test_server:fail({{"could not change the global groups"
- " in node", CpB}, {InfoB, InfoBok}})
- end,
+ case InfoB of
+ InfoBok ->
+ ok;
+ _ ->
+ ct:fail({{"could not change the global groups"
+ " in node", CpB}, {InfoB, InfoBok}})
+ end,
- ?line case InfoC of
- InfoCok ->
- ok;
- _ ->
- test_server:fail({{"could not change the global groups"
- " in node", CpC}, {InfoC, InfoCok}})
- end,
+ case InfoC of
+ InfoCok ->
+ ok;
+ _ ->
+ ct:fail({{"could not change the global groups"
+ " in node", CpC}, {InfoC, InfoCok}})
+ end,
- ?line case InfoD of
- InfoDok ->
- ok;
- _ ->
- test_server:fail({{"could not change the global groups"
- " in node", CpD}, {InfoD, InfoDok}})
- end,
+ case InfoD of
+ InfoDok ->
+ ok;
+ _ ->
+ ct:fail({{"could not change the global groups"
+ " in node", CpD}, {InfoD, InfoDok}})
+ end,
- ?line case InfoE of
- InfoEok ->
- ok;
- _ ->
- test_server:fail({{"could not change the global groups"
- " in node", CpE}, {InfoE, InfoEok}})
- end,
+ case InfoE of
+ InfoEok ->
+ ok;
+ _ ->
+ ct:fail({{"could not change the global groups"
+ " in node", CpE}, {InfoE, InfoEok}})
+ end,
write_high_level_trace(Config), % no good since CpC was restarted
stop_node(Cp1),
@@ -3324,7 +3262,7 @@ global_groups_change(Config) ->
stop_node(CpD),
stop_node(CpE),
- ?line init_condition(Config),
+ init_condition(Config),
ok.
sync_and_wait(Node) ->
@@ -3354,43 +3292,43 @@ sync_and_wait(Node) ->
is_real_system(KernelVsn, StdlibVsn) ->
LibDir = code:lib_dir(),
filelib:is_dir(filename:join(LibDir, "kernel-" ++ KernelVsn))
- andalso
- filelib:is_dir(filename:join(LibDir, "stdlib-" ++ StdlibVsn)).
+ andalso
+ filelib:is_dir(filename:join(LibDir, "stdlib-" ++ StdlibVsn)).
create_script_dc(ScriptName) ->
- ?line Name = filename:join(".", ScriptName),
- ?line Apps = application_controller:which_applications(),
- ?line {value,{_,_,KernelVer}} = lists:keysearch(kernel,1,Apps),
- ?line {value,{_,_,StdlibVer}} = lists:keysearch(stdlib,1,Apps),
- ?line {ok,Fd} = file:open(Name ++ ".rel", [write]),
- ?line {_, Version} = init:script_id(),
- ?line io:format(Fd,
- "{release, {\"Test release 3\", \"~s\"}, \n"
- " {erts, \"4.4\"}, \n"
- " [{kernel, \"~s\"}, {stdlib, \"~s\"}]}.\n",
- [Version, KernelVer, StdlibVer]),
- ?line file:close(Fd),
+ Name = filename:join(".", ScriptName),
+ Apps = application_controller:which_applications(),
+ {value,{_,_,KernelVer}} = lists:keysearch(kernel,1,Apps),
+ {value,{_,_,StdlibVer}} = lists:keysearch(stdlib,1,Apps),
+ {ok,Fd} = file:open(Name ++ ".rel", [write]),
+ {_, Version} = init:script_id(),
+ io:format(Fd,
+ "{release, {\"Test release 3\", \"~s\"}, \n"
+ " {erts, \"4.4\"}, \n"
+ " [{kernel, \"~s\"}, {stdlib, \"~s\"}]}.\n",
+ [Version, KernelVer, StdlibVer]),
+ file:close(Fd),
{KernelVer, StdlibVer}.
%% Not used?
config_dc(Fd, Ncp1, Ncp2, Ncp3) ->
M = from($@, atom_to_list(node())),
io:format(Fd, "[{kernel, [{sync_nodes_optional, ['~s@~s','~s@~s','~s@~s']},"
- "{sync_nodes_timeout, 1000},"
- "{global_groups, [{gg1, ['~s@~s', '~s@~s']},"
- " {gg2, ['~s@~s']}]}"
- " ]}].~n",
+ "{sync_nodes_timeout, 1000},"
+ "{global_groups, [{gg1, ['~s@~s', '~s@~s']},"
+ " {gg2, ['~s@~s']}]}"
+ " ]}].~n",
[Ncp1, M, Ncp2, M, Ncp3, M, Ncp1, M, Ncp2, M, Ncp3, M]).
config_dc1(Fd, Ncp1, Ncp2, Ncp3, NcpA, NcpB, NcpC, NcpD, NcpE) ->
M = from($@, atom_to_list(node())),
io:format(Fd, "[{kernel, [{sync_nodes_optional, ['~s@~s','~s@~s','~s@~s','~s@~s','~s@~s','~s@~s','~s@~s','~s@~s']},"
- "{sync_nodes_timeout, 1000},"
- "{global_groups, [{gg1, ['~s@~s', '~s@~s']},"
- " {gg2, ['~s@~s']},"
- " {gg4, normal, ['~s@~s','~s@~s','~s@~s']},"
- " {gg5, hidden, ['~s@~s','~s@~s']}]}]}].~n",
+ "{sync_nodes_timeout, 1000},"
+ "{global_groups, [{gg1, ['~s@~s', '~s@~s']},"
+ " {gg2, ['~s@~s']},"
+ " {gg4, normal, ['~s@~s','~s@~s','~s@~s']},"
+ " {gg5, hidden, ['~s@~s','~s@~s']}]}]}].~n",
[Ncp1, M, Ncp2, M, Ncp3, M,
NcpA, M, NcpB, M, NcpC, M, NcpD, M, NcpE, M,
Ncp1, M, Ncp2, M,
@@ -3401,8 +3339,8 @@ config_dc1(Fd, Ncp1, Ncp2, Ncp3, NcpA, NcpB, NcpC, NcpD, NcpE) ->
config_dc2(Fd, NewGG, Ncp1, Ncp2, Ncp3) ->
M = from($@, atom_to_list(node())),
io:format(Fd, "[{kernel, [{sync_nodes_optional, ['~s@~s','~s@~s','~s@~s']},"
- "{sync_nodes_timeout, 1000},"
- "~p]}].~n",
+ "{sync_nodes_timeout, 1000},"
+ "~p]}].~n",
[Ncp1, M, Ncp2, M, Ncp3, M, NewGG]).
@@ -3414,33 +3352,33 @@ from(_H, []) -> [].
other(A, [A, _B]) -> A;
other(_, [_A, B]) -> B.
-
+
%% this one runs at cp2
part1(Config, Main, Cp1, Cp3) ->
case catch begin
make_partition(Config, [Main, Cp1], [node(), Cp3]),
- ?line {_Pid, yes} = start_proc(test2),
- ?line {_Pid2, yes} = start_proc(test4)
+ {_Pid, yes} = start_proc(test2),
+ {_Pid2, yes} = start_proc(test4)
end of
{_, yes} -> ok; % w("ok", []);
{'EXIT', _R} ->
ok
- % w("global_SUITE line:~w: ~p", [?LINE, _R])
+ %% w("global_SUITE line:~w: ~p", [?LINE, _R])
end.
%% Runs at Cp2
part1_5(Config, Main, Cp1, Cp3) ->
case catch begin
make_partition(Config, [Main, Cp1], [node(), Cp3]),
- ?line {_Pid1, yes} = start_proc_basic(name12),
- ?line {_Pid2, yes} =
+ {_Pid1, yes} = start_proc_basic(name12),
+ {_Pid2, yes} =
rpc:call(Cp3, ?MODULE, start_proc_basic, [name03])
end of
{_, yes} -> ok; % w("ok", []);
{'EXIT', _R} ->
ok
- % w("global_SUITE line:~w: ~p", [?LINE, _R])
+ %% w("global_SUITE line:~w: ~p", [?LINE, _R])
end.
w(X,Y) ->
@@ -3451,7 +3389,7 @@ w(X,Y) ->
%% this one runs on one node in Part2
%% The partition is ready when is_ready_partition(Config) returns (true).
make_partition(Config, Part1, Part2) ->
- Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
Ns = [begin
Name = lists:concat([atom_to_list(N),"_",msec(),".part"]),
File = filename:join([Dir, Name]),
@@ -3503,7 +3441,7 @@ is_ready_partition(Config) ->
true.
make_partition_file(Config) ->
- Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
filename:join([Dir, atom_to_list(make_partition_done)]).
%% this one runs at cp3
@@ -3514,37 +3452,36 @@ part2(Config, Parent, Main, Cp0, Cp1, Cp2, Cp3, Cp4, Cp5, Cp6) ->
part3(Config, Parent, Main, Cp0, Cp1, Cp2, Cp3, Cp4, Cp5, Cp6) ->
make_partition(Config, [Main, Cp0, Cp1, Cp2], [Cp3, Cp4, Cp5, Cp6]),
start_procs(Parent, Cp4, Cp5, Cp6, Config),
- % Make Cp6 alone
- ?line rpc_cast(Cp5, ?MODULE, crash, [12000]),
- ?line rpc_cast(Cp6, ?MODULE, alone, [Cp0, Cp3]).
+ %% Make Cp6 alone
+ rpc_cast(Cp5, ?MODULE, crash, [12000]),
+ rpc_cast(Cp6, ?MODULE, alone, [Cp0, Cp3]).
start_procs(Parent, N1, N2, N3, Config) ->
S1 = lists:sort([N1, N2, N3]),
- ?line
?UNTIL(begin
NN = lists:sort(nodes()),
S1 =:= NN
end),
- ?line Pid3 = start_proc3(test1),
- ?line Pid4 = rpc:call(N1, ?MODULE, start_proc3, [test2]),
- ?line assert_pid(Pid4),
- ?line Pid5 = rpc:call(N2, ?MODULE, start_proc3, [test3]),
- ?line assert_pid(Pid5),
- ?line Pid6 = rpc:call(N3, ?MODULE, start_proc3, [test4]),
- ?line assert_pid(Pid6),
- ?line yes = global:register_name(test1, Pid3),
- ?line yes = global:register_name(test2, Pid4, {global, notify_all_name}),
- ?line yes = global:register_name(test3, Pid5, {global, random_notify_name}),
+ Pid3 = start_proc3(test1),
+ Pid4 = rpc:call(N1, ?MODULE, start_proc3, [test2]),
+ assert_pid(Pid4),
+ Pid5 = rpc:call(N2, ?MODULE, start_proc3, [test3]),
+ assert_pid(Pid5),
+ Pid6 = rpc:call(N3, ?MODULE, start_proc3, [test4]),
+ assert_pid(Pid6),
+ yes = global:register_name(test1, Pid3),
+ yes = global:register_name(test2, Pid4, {global, notify_all_name}),
+ yes = global:register_name(test3, Pid5, {global, random_notify_name}),
Resolve = fun(Name, Pid1, Pid2) ->
Parent ! {resolve_called, Name, node()},
{Min, Max} = minmax(Pid1, Pid2),
exit(Min, kill),
Max
end,
- ?line yes = global:register_name(test4, Pid6, Resolve).
+ yes = global:register_name(test4, Pid6, Resolve).
+
-
collect_resolves() -> cr(0).
cr(Res) ->
receive
@@ -3574,7 +3511,7 @@ start_proc() ->
receive
Pid -> Pid
end.
-
+
start_proc(Name) ->
Pid = spawn(?MODULE, p_init, [self(), Name]),
@@ -3618,7 +3555,7 @@ single_node(Time, Node, Config) ->
lists:foreach(fun(N) -> _ = erlang:disconnect_node(N) end, nodes()),
?UNTIL(get_known(node()) =:= [node()]),
spawn(?MODULE, init_2, []),
- test_server:sleep(Time - msec()),
+ ct:sleep(Time - msec()),
net_adm:ping(Node).
init_2() ->
@@ -3630,12 +3567,12 @@ loop_2() ->
receive
die -> ok
end.
-
+
msec() ->
msec(now()).
msec(T) ->
- element(1,T)*1000000000 + element(2,T)*1000 + element(3,T) div 1000.
+ element(1,T)*1000000000 + element(2,T)*1000 + element(3,T) div 1000.
assert_pid(Pid) ->
if
@@ -3680,13 +3617,15 @@ sreq(Pid, Msg) ->
alone(N1, N2) ->
lists:foreach(fun(Node) -> true = erlang:disconnect_node(Node) end,
nodes()),
- test_server:sleep(12000),
+ ct:sleep(12000),
net_adm:ping(N1),
net_adm:ping(N2),
yes = global:register_name(test5, self()).
crash(Time) ->
- test_server:sleep(Time),
+ %% ct:sleep/1 will not work because it calls a server process
+ %% that does not run on other nodes.
+ timer:sleep(Time),
erlang:halt().
loop() ->
@@ -3748,23 +3687,23 @@ pr_diff(Str, T0, T1) ->
{_, {H,M,S}} = calendar:time_difference(T0, T1),
((H*60+M)*60)+S
end,
- test_server:format(1,"~13s: ~w (diff: ~w)",[Str, T1, Diff]),
+ ct:pal(?HI_VERBOSITY,"~13s: ~w (diff: ~w)",[Str, T1, Diff]),
if
Diff > 100 ->
- test_server:format(1,"~s: ** LARGE DIFF ~w~n", [Str, Diff]);
+ io:format(1,"~s: ** LARGE DIFF ~w~n", [Str, Diff]);
true ->
ok
end.
-endif.
now_diff({A1,B1,C1},{A2,B2,C2}) ->
- C1-C2 + 1000000*((B1-B2) + 1000000*(A1-A2)).
+ C1-C2 + 1000000*((B1-B2) + 1000000*(A1-A2)).
start_node_boot(Name, Config, Boot) ->
Pa = filename:dirname(code:which(?MODULE)),
Res = test_server:start_node(Name, peer, [{args, " -pa " ++ Pa ++
- " -config " ++ Config ++
- " -boot " ++ atom_to_list(Boot)}]),
+ " -config " ++ Config ++
+ " -boot " ++ atom_to_list(Boot)}]),
record_started_node(Res).
%% Increase the timeout for when an upcoming connection is teared down
@@ -3790,13 +3729,13 @@ start_node(Name0, How, Args, Config) ->
Pa = filename:dirname(code:which(?MODULE)),
R = test_server:start_node(Name, How, [{args,
Args ++ " " ++
- "-kernel net_setuptime 100 "
-% "-noshell "
+ "-kernel net_setuptime 100 "
+ %% "-noshell "
"-pa " ++ Pa},
{linked, false}
-]),
+ ]),
%% {linked,false} only seems to work for slave nodes.
-% test_server:sleep(1000),
+ %% ct:sleep(1000),
record_started_node(R).
start_node_rel(Name0, Rel, Config) ->
@@ -3807,14 +3746,14 @@ start_node_rel(Name0, Rel, Config) ->
Rel when is_atom(Rel) ->
{[{release, atom_to_list(Rel)}], ""};
RelList ->
- {RelList, ""}
- end,
+ {RelList, ""}
+ end,
Env = [],
Pa = filename:dirname(code:which(?MODULE)),
Res = test_server:start_node(Name, peer,
[{args,
Compat ++
- " -kernel net_setuptime 100 "
+ " -kernel net_setuptime 100 "
" -pa " ++ Pa},
{erl, Release}] ++ Env),
record_started_node(Res).
@@ -3844,12 +3783,12 @@ stop_nodes(Nodes) ->
lists:foreach(fun(Node) -> stop_node(Node) end, Nodes).
stop_node(Node) ->
- ?line ?t:stop_node(Node).
+ test_server:stop_node(Node).
stop() ->
lists:foreach(fun(Node) ->
- ?t:stop_node(Node)
+ test_server:stop_node(Node)
end, nodes()).
dbg_logs(Name) -> dbg_logs(Name, ?NODES).
@@ -3857,44 +3796,41 @@ dbg_logs(Name) -> dbg_logs(Name, ?NODES).
dbg_logs(Name, Nodes) ->
lists:foreach(fun(N) ->
F = lists:concat([Name, ".log.", N, ".txt"]),
- ?line ok = sys:log_to_file({global_name_server, N}, F)
+ ok = sys:log_to_file({global_name_server, N}, F)
end, Nodes).
-global_lost_nodes(suite) ->
- [];
-global_lost_nodes(doc) ->
- ["Tests that locally loaded nodes do not loose contact with other nodes."];
+%% Tests that locally loaded nodes do not loose contact with other nodes.
global_lost_nodes(Config) when is_list(Config) ->
Timeout = 60,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
-
- ?line {ok, Node1} = start_node(node1, Config),
- ?line {ok, Node2} = start_node(node2, Config),
+ init_condition(Config),
+
+ {ok, Node1} = start_node(node1, Config),
+ {ok, Node2} = start_node(node2, Config),
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
- ?line io:format("Nodes: ~p", [nodes()]),
- ?line io:format("Nodes at node1: ~p",
- [rpc:call(Node1, erlang, nodes, [])]),
- ?line io:format("Nodes at node2: ~p",
- [rpc:call(Node2, erlang, nodes, [])]),
+ io:format("Nodes: ~p", [nodes()]),
+ io:format("Nodes at node1: ~p",
+ [rpc:call(Node1, erlang, nodes, [])]),
+ io:format("Nodes at node2: ~p",
+ [rpc:call(Node2, erlang, nodes, [])]),
- ?line rpc_cast(Node1, ?MODULE, global_load, [node_1,Node2,node_2]),
- ?line rpc_cast(Node2, ?MODULE, global_load, [node_2,Node1,node_1]),
+ rpc_cast(Node1, ?MODULE, global_load, [node_1,Node2,node_2]),
+ rpc_cast(Node2, ?MODULE, global_load, [node_2,Node1,node_1]),
lost_nodes_waiter(Node1, Node2),
write_high_level_trace(Config),
- ?line stop_node(Node1),
- ?line stop_node(Node2),
- ?line init_condition(Config),
+ stop_node(Node1),
+ stop_node(Node2),
+ init_condition(Config),
ok.
global_load(MyName, OtherNode, OtherName) ->
- ?line yes = global:register_name(MyName, self()),
+ yes = global:register_name(MyName, self()),
io:format("Registered ~p",[MyName]),
global_load1(OtherNode, OtherName, 0).
@@ -3902,32 +3838,32 @@ global_load1(_OtherNode, _OtherName, 2) ->
io:format("*** ~p giving up. No use.", [node()]),
init:stop();
global_load1(OtherNode, OtherName, Fails) ->
- test_server:sleep(1000),
- ?line case catch global:whereis_name(OtherName) of
- Pid when is_pid(Pid) ->
- io:format("~p says: ~p is still there.",
- [node(),OtherName]),
- global_load1(OtherNode, OtherName, Fails);
- Other ->
- io:format("~p says: ~p is lost (~p) Pinging.",
- [ node(), OtherName, Other]),
- case net_adm:ping(OtherNode) of
- pong ->
- io:format("Re-established contact to ~p",
- [OtherName]);
- pang ->
- io:format("PANIC! Other node is DEAD.", []),
- init:stop()
- end,
- global_load1(OtherNode, OtherName, Fails+1)
- end.
+ ct:sleep(1000),
+ case catch global:whereis_name(OtherName) of
+ Pid when is_pid(Pid) ->
+ io:format("~p says: ~p is still there.",
+ [node(),OtherName]),
+ global_load1(OtherNode, OtherName, Fails);
+ Other ->
+ io:format("~p says: ~p is lost (~p) Pinging.",
+ [ node(), OtherName, Other]),
+ case net_adm:ping(OtherNode) of
+ pong ->
+ io:format("Re-established contact to ~p",
+ [OtherName]);
+ pang ->
+ io:format("PANIC! Other node is DEAD.", []),
+ init:stop()
+ end,
+ global_load1(OtherNode, OtherName, Fails+1)
+ end.
lost_nodes_waiter(N1, N2) ->
- ?line net_kernel:monitor_nodes(true),
+ net_kernel:monitor_nodes(true),
receive
{nodedown, Node} when Node =:= N1 ; Node =:= N2 ->
io:format("~p went down!",[Node]),
- ?line ?t:fail("Node went down.")
+ ct:fail("Node went down.")
after 10000 ->
ok
end,
@@ -3935,36 +3871,33 @@ lost_nodes_waiter(N1, N2) ->
-mass_death(suite) ->
- [];
-mass_death(doc) ->
- ["Tests the simultaneous death of many processes with registered names"];
+%% Tests the simultaneous death of many processes with registered names.
mass_death(Config) when is_list(Config) ->
Timeout = 90,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line OrigNames = global:registered_names(),
+ init_condition(Config),
+ OrigNames = global:registered_names(),
%% Start nodes
- ?line Cps = [cp1,cp2,cp3,cp4,cp5],
- ?line Nodes = [begin {ok, Node} = start_node(Cp, Config), Node end ||
- Cp <- Cps],
- ?line io:format("Nodes: ~p~n", [Nodes]),
- ?line Ns = lists:seq(1, 40),
+ Cps = [cp1,cp2,cp3,cp4,cp5],
+ Nodes = [begin {ok, Node} = start_node(Cp, Config), Node end ||
+ Cp <- Cps],
+ io:format("Nodes: ~p~n", [Nodes]),
+ Ns = lists:seq(1, 40),
%% Start processes with globally registered names on the nodes
- ?line {Pids,[]} = rpc:multicall(Nodes, ?MODULE, mass_spawn, [Ns]),
- ?line io:format("Pids: ~p~n", [Pids]),
+ {Pids,[]} = rpc:multicall(Nodes, ?MODULE, mass_spawn, [Ns]),
+ io:format("Pids: ~p~n", [Pids]),
%% Wait...
- ?line test_server:sleep(10000),
+ ct:sleep(10000),
%% Check the globally registered names
- ?line NewNames = global:registered_names(),
- ?line io:format("NewNames: ~p~n", [NewNames]),
- ?line Ndiff = lists:sort(NewNames--OrigNames),
- ?line io:format("Ndiff: ~p~n", [Ndiff]),
- ?line Ndiff = lists:sort(mass_names(Nodes, Ns)),
+ NewNames = global:registered_names(),
+ io:format("NewNames: ~p~n", [NewNames]),
+ Ndiff = lists:sort(NewNames--OrigNames),
+ io:format("Ndiff: ~p~n", [Ndiff]),
+ Ndiff = lists:sort(mass_names(Nodes, Ns)),
%%
%% Kill the root pids
- ?line lists:foreach(fun (Pid) -> Pid ! drop_dead end, Pids),
+ lists:foreach(fun (Pid) -> Pid ! drop_dead end, Pids),
%% Start probing and wait for all registered names to disappear
{YYYY,MM,DD} = date(),
{H,M,S} = time(),
@@ -3973,22 +3906,21 @@ mass_death(Config) when is_list(Config) ->
wait_mass_death(Nodes, OrigNames, erlang:now(), Config).
wait_mass_death(Nodes, OrigNames, Then, Config) ->
- ?line Names = global:registered_names(),
- ?line
- case Names--OrigNames of
- [] ->
- ?line T = now_diff(erlang:now(), Then) div 1000,
- ?line lists:foreach(
- fun (Node) ->
- stop_node(Node)
- end, Nodes),
- ?line init_condition(Config),
- {comment,lists:flatten(io_lib:format("~.3f s~n", [T/1000.0]))};
- Ndiff ->
- ?line io:format("Ndiff: ~p~n", [Ndiff]),
- ?line test_server:sleep(1000),
- ?line wait_mass_death(Nodes, OrigNames, Then, Config)
- end.
+ Names = global:registered_names(),
+ case Names--OrigNames of
+ [] ->
+ T = now_diff(erlang:now(), Then) div 1000,
+ lists:foreach(
+ fun (Node) ->
+ stop_node(Node)
+ end, Nodes),
+ init_condition(Config),
+ {comment,lists:flatten(io_lib:format("~.3f s~n", [T/1000.0]))};
+ Ndiff ->
+ io:format("Ndiff: ~p~n", [Ndiff]),
+ ct:sleep(1000),
+ wait_mass_death(Nodes, OrigNames, Then, Config)
+ end.
mass_spawn([]) ->
ok;
@@ -4018,7 +3950,7 @@ mass_name(Node, N) ->
start_nodes(L, How, Config) ->
start_nodes2(L, How, 0, Config),
Nodes = collect_nodes(0, length(L)),
- ?line ?UNTIL([] =:= Nodes -- nodes()),
+ ?UNTIL([] =:= Nodes -- nodes()),
put(?nodes_tag, Nodes),
%% Pinging doesn't help, we have to wait too, for nodes() to become
%% correct on the other node.
@@ -4042,7 +3974,7 @@ verify_nodes(Nodes, Config) ->
verify_nodes([], _N, _Config) ->
[];
verify_nodes([Node | Rest], N, Config) ->
- ?line ?UNTIL(
+ ?UNTIL(
case rpc:call(Node, erlang, nodes, []) of
Nodes when is_list(Nodes) ->
case N =:= lists:sort([Node | Nodes]) of
@@ -4074,7 +4006,7 @@ start_nodes2([Name | Rest], How, N, Config) ->
Self ! {N, R},
%% sleeping is necessary, or with peer nodes, they will
%% go down again, despite {linked, false}.
- test_server:sleep(100000)
+ ct:sleep(100000)
end),
start_nodes2(Rest, How, N+1, Config).
@@ -4155,14 +4087,12 @@ remove_gg_pub_type([{GG, _, Nodes}|Rest]) ->
%% Better do this in a slave node.
%% (The transition from links to monitors does not affect this case.)
-garbage_messages(suite) ->
- [];
garbage_messages(Config) when is_list(Config) ->
Timeout = 25,
ct:timetrap({seconds,Timeout}),
init_high_level_trace(Timeout),
- ?line init_condition(Config),
- ?line [Slave] = start_nodes([garbage_messages], slave, Config),
+ init_condition(Config),
+ [Slave] = start_nodes([garbage_messages], slave, Config),
Fun = fun() ->
{links,L} = process_info(whereis(global_name_server), links),
lists:foreach(fun(Pid) -> Pid ! {garbage,to,you} end, L),
@@ -4170,15 +4100,15 @@ garbage_messages(Config) when is_list(Config) ->
_Any -> ok
end
end,
- ?line Pid = spawn_link(Slave, erlang, apply, [Fun,[]]),
- ?t:sleep(2000),
- ?line Global = rpc:call(Slave, erlang, whereis, [global_name_server]),
- ?line {registered_name,global_name_server} =
+ Pid = spawn_link(Slave, erlang, apply, [Fun,[]]),
+ ct:sleep(2000),
+ Global = rpc:call(Slave, erlang, whereis, [global_name_server]),
+ {registered_name,global_name_server} =
rpc:call(Slave, erlang, process_info, [Global,registered_name]),
- ?line true = unlink(Pid),
+ true = unlink(Pid),
write_high_level_trace(Config),
- ?line stop_node(Slave),
- ?line init_condition(Config),
+ stop_node(Slave),
+ init_condition(Config),
ok.
wait_for_ready_net(Config) ->
@@ -4186,13 +4116,13 @@ wait_for_ready_net(Config) ->
wait_for_ready_net(Nodes0, Config) ->
Nodes = lists:sort(Nodes0),
- ?t:format("wait_for_ready_net ~p~n", [Nodes]),
+ io:format("wait_for_ready_net ~p~n", [Nodes]),
?UNTIL(begin
lists:all(fun(N) -> Nodes =:= get_known(N) end, Nodes) and
- lists:all(fun(N) ->
- LNs = rpc:call(N, erlang, nodes, []),
- Nodes =:= lists:sort([N | LNs])
- end, Nodes)
+ lists:all(fun(N) ->
+ LNs = rpc:call(N, erlang, nodes, []),
+ Nodes =:= lists:sort([N | LNs])
+ end, Nodes)
end).
get_known(Node) ->
@@ -4207,7 +4137,7 @@ quite_a_few_nodes(Max) ->
N = try
ulimit("ulimit -u")
catch _:_ ->
- ulimit("ulimit -p") % can fail...
+ ulimit("ulimit -p") % can fail...
end,
lists:min([(N - 40) div 3, Max]).
@@ -4264,15 +4194,15 @@ start_tracer() ->
Pid = spawn(fun() -> tracer([]) end),
case catch register(my_tracer, Pid) of
{'EXIT', _} ->
- ?t:fail(re_register_my_tracer);
+ ct:fail(re_register_my_tracer);
_ ->
ok
end.
tracer(L) ->
receive
- % {save, Term} ->
- % tracer([{now(),Term} | L]);
+ %% {save, Term} ->
+ %% tracer([{now(),Term} | L]);
{get, From} ->
From ! {trace, lists:reverse(L)},
tracer([]);
@@ -4305,7 +4235,7 @@ collect_tracers(Nodes) ->
trace_message(M) ->
case catch my_tracer ! M of
{'EXIT', _} ->
- ?t:fail(my_tracer_not_registered);
+ ct:fail(my_tracer_not_registered);
_ ->
ok
end.
diff --git a/lib/kernel/test/global_group_SUITE.erl b/lib/kernel/test/global_group_SUITE.erl
index e7d321418c..8b9e1c5ae8 100644
--- a/lib/kernel/test/global_group_SUITE.erl
+++ b/lib/kernel/test/global_group_SUITE.erl
@@ -28,7 +28,7 @@
-export([init_per_testcase/2, end_per_testcase/2]).
-%-compile(export_all).
+%%-compile(export_all).
-include_lib("common_test/include/ct.hrl").
@@ -36,7 +36,9 @@
-define(UNTIL(Seq), loop_until_true(fun() -> Seq end)).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,5}}].
all() ->
[start_gg_proc, no_gg_proc, no_gg_proc_sync, compatible,
@@ -46,10 +48,10 @@ groups() ->
[].
init_per_group(_GroupName, Config) ->
- Config.
+ Config.
end_per_group(_GroupName, Config) ->
- Config.
+ Config.
init_per_suite(Config) ->
@@ -77,15 +79,13 @@ end_per_suite(_Config) ->
ok.
-define(TESTCASE, testcase_name).
--define(testcase, ?config(?TESTCASE, Config)).
+-define(testcase, proplists:get_value(?TESTCASE, Config)).
-init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) ->
- Dog=?t:timetrap(?t:minutes(5)),
- [{?TESTCASE, Case}, {watchdog, Dog}|Config].
+init_per_testcase(Case, Config) ->
+ Config.
-end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- ?t:timetrap_cancel(Dog).
+end_per_testcase(_Func, _Config) ->
+ ok.
%%-----------------------------------------------------------------
%% Test suites for global groups.
@@ -94,198 +94,191 @@ end_per_testcase(_Func, Config) ->
%%-----------------------------------------------------------------
-start_gg_proc(suite) -> [];
-start_gg_proc(doc) -> ["Check that the global_group processes are started automatically. "];
+%% Check that the global_group processes are started automatically. .
start_gg_proc(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(120)),
-
- ?line Dir = ?config(priv_dir, Config),
- ?line File = filename:join(Dir, "global_group.config"),
- ?line {ok, Fd}=file:open(File, [write]),
+ Dir = proplists:get_value(priv_dir, Config),
+ File = filename:join(Dir, "global_group.config"),
+ {ok, Fd}=file:open(File, [write]),
[Ncp1,Ncp2,Ncp3] = node_names([cp1, cp2, cp3], Config),
- ?line config(Fd, Ncp1, Ncp2, Ncp3, "cpx", "cpy", "cpz", "cpq"),
+ config(Fd, Ncp1, Ncp2, Ncp3, "cpx", "cpy", "cpz", "cpq"),
- ?line Cp1nn = node_at(Ncp1),
- ?line Cp2nn = node_at(Ncp2),
- ?line Cp3nn = node_at(Ncp3),
+ Cp1nn = node_at(Ncp1),
+ Cp2nn = node_at(Ncp2),
+ Cp3nn = node_at(Ncp3),
- ?line {ok, Cp1} = start_node(Ncp1, Config),
- ?line {ok, Cp2} = start_node(Ncp2, Config),
- ?line {ok, Cp3} = start_node(Ncp3, Config),
+ {ok, Cp1} = start_node(Ncp1, Config),
+ {ok, Cp2} = start_node(Ncp2, Config),
+ {ok, Cp3} = start_node(Ncp3, Config),
- ?line [] = rpc:call(Cp1, global_group, registered_names, [{node, Cp1nn}]),
- ?line [] = rpc:call(Cp2, global_group, registered_names, [{node, Cp2nn}]),
- ?line [] = rpc:call(Cp3, global_group, registered_names, [{node, Cp3nn}]),
+ [] = rpc:call(Cp1, global_group, registered_names, [{node, Cp1nn}]),
+ [] = rpc:call(Cp2, global_group, registered_names, [{node, Cp2nn}]),
+ [] = rpc:call(Cp3, global_group, registered_names, [{node, Cp3nn}]),
- % stop the nodes, and make sure names are released.
+ %% stop the nodes, and make sure names are released.
stop_node(Cp1),
stop_node(Cp2),
stop_node(Cp3),
- ?line ?UNTIL(undefined =:= global:whereis_name(test)),
- ?line test_server:timetrap_cancel(Dog),
+ ?UNTIL(undefined =:= global:whereis_name(test)),
ok.
-
-no_gg_proc(suite) -> [];
-no_gg_proc(doc) -> ["Start a system without global groups. Nodes are not "
- "synced at start (sync_nodes_optional is not defined)"];
+
+%% Start a system without global groups. Nodes are not
+%% synced at start (sync_nodes_optional is not defined).
no_gg_proc(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(200)),
-
- ?line Dir = ?config(priv_dir, Config),
- ?line File = filename:join(Dir, "no_global_group.config"),
- ?line {ok, Fd} = file:open(File, [write]),
- ?line config_no(Fd),
-
- ?line NN = node_name(atom_to_list(node())),
- ?line Cp1nn = list_to_atom("cp1@" ++ NN),
- ?line Cp2nn = list_to_atom("cp2@" ++ NN),
- ?line Cp3nn = list_to_atom("cp3@" ++ NN),
- ?line Cpxnn = list_to_atom("cpx@" ++ NN),
- ?line Cpynn = list_to_atom("cpy@" ++ NN),
- ?line Cpznn = list_to_atom("cpz@" ++ NN),
-
- ?line {ok, Cp1} = start_node_no(cp1, Config),
- ?line {ok, Cp2} = start_node_no(cp2, Config),
- ?line {ok, Cp3} = start_node_no(cp3, Config),
- ?line {ok, Cpx} = start_node_no(cpx, Config),
- ?line {ok, Cpy} = start_node_no(cpy, Config),
- ?line {ok, Cpz} = start_node_no(cpz, Config),
+ Dir = proplists:get_value(priv_dir, Config),
+ File = filename:join(Dir, "no_global_group.config"),
+ {ok, Fd} = file:open(File, [write]),
+ config_no(Fd),
+
+ NN = node_name(atom_to_list(node())),
+ Cp1nn = list_to_atom("cp1@" ++ NN),
+ Cp2nn = list_to_atom("cp2@" ++ NN),
+ Cp3nn = list_to_atom("cp3@" ++ NN),
+ Cpxnn = list_to_atom("cpx@" ++ NN),
+ Cpynn = list_to_atom("cpy@" ++ NN),
+ Cpznn = list_to_atom("cpz@" ++ NN),
+
+ {ok, Cp1} = start_node_no(cp1, Config),
+ {ok, Cp2} = start_node_no(cp2, Config),
+ {ok, Cp3} = start_node_no(cp3, Config),
+ {ok, Cpx} = start_node_no(cpx, Config),
+ {ok, Cpy} = start_node_no(cpy, Config),
+ {ok, Cpz} = start_node_no(cpz, Config),
%% let the nodes know of each other
- ?line pong = rpc:call(Cp1, net_adm, ping, [Cp2nn]),
- ?line pong = rpc:call(Cp2, net_adm, ping, [Cp3nn]),
- ?line pong = rpc:call(Cp3, net_adm, ping, [Cpxnn]),
- ?line pong = rpc:call(Cpx, net_adm, ping, [Cpynn]),
- ?line pong = rpc:call(Cpy, net_adm, ping, [Cpznn]),
+ pong = rpc:call(Cp1, net_adm, ping, [Cp2nn]),
+ pong = rpc:call(Cp2, net_adm, ping, [Cp3nn]),
+ pong = rpc:call(Cp3, net_adm, ping, [Cpxnn]),
+ pong = rpc:call(Cpx, net_adm, ping, [Cpynn]),
+ pong = rpc:call(Cpy, net_adm, ping, [Cpznn]),
- ?line wait_for_ready_net(),
+ wait_for_ready_net(),
- ?line [test_server] = rpc:call(Cp1, global_group, registered_names, [{node, Cp1nn}]),
- ?line [test_server] = rpc:call(Cp2, global_group, registered_names, [{node, Cp2nn}]),
- ?line [test_server] = rpc:call(Cp3, global_group, registered_names, [{node, Cp3nn}]),
- ?line [test_server] = rpc:call(Cp1, global_group, registered_names, [{node, Cpxnn}]),
- ?line [test_server] = rpc:call(Cp2, global_group, registered_names, [{node, Cpynn}]),
- ?line [test_server] = rpc:call(Cp3, global_group, registered_names, [{node, Cpznn}]),
+ [test_server] = rpc:call(Cp1, global_group, registered_names, [{node, Cp1nn}]),
+ [test_server] = rpc:call(Cp2, global_group, registered_names, [{node, Cp2nn}]),
+ [test_server] = rpc:call(Cp3, global_group, registered_names, [{node, Cp3nn}]),
+ [test_server] = rpc:call(Cp1, global_group, registered_names, [{node, Cpxnn}]),
+ [test_server] = rpc:call(Cp2, global_group, registered_names, [{node, Cpynn}]),
+ [test_server] = rpc:call(Cp3, global_group, registered_names, [{node, Cpznn}]),
- % start a proc and register it
- ?line {Pid2, yes} = rpc:call(Cp2, ?MODULE, start_proc, [test2]),
+ %% start a proc and register it
+ {Pid2, yes} = rpc:call(Cp2, ?MODULE, start_proc, [test2]),
- ?line RegNames = lists:sort([test2,test_server]),
+ RegNames = lists:sort([test2,test_server]),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp1, global_group, registered_names, [{node, Cp1nn}])),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp2, global_group, registered_names, [{node, Cp2nn}])),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp3, global_group, registered_names, [{node, Cp3nn}])),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp1, global_group, registered_names, [{node, Cpxnn}])),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp2, global_group, registered_names, [{node, Cpynn}])),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp3, global_group, registered_names, [{node, Cpznn}])),
- ?line undefined = rpc:call(Cp3, global_group, global_groups, []),
+ undefined = rpc:call(Cp3, global_group, global_groups, []),
+
+ Own_nodes_should = [node(), Cp1nn, Cp2nn, Cp3nn,
+ Cpxnn, Cpynn, Cpznn],
+ Own_nodes = rpc:call(Cp3, global_group, own_nodes, []),
+ [] = (Own_nodes -- Own_nodes_should),
+ [] = (Own_nodes_should -- Own_nodes),
+
+ Pid2 = rpc:call(Cp1, global_group, send, [test2, {ping, self()}]),
+ receive
+ {pong, Cp2} -> ok
+ after
+ 2000 -> ct:fail(timeout2)
+ end,
+ Pid2 = rpc:call(Cp2, global_group, send, [test2, {ping, self()}]),
+ receive
+ {pong, Cp2} -> ok
+ after
+ 2000 -> ct:fail(timeout3)
+ end,
+ Pid2 = rpc:call(Cpz, global_group, send, [test2, {ping, self()}]),
+ receive
+ {pong, Cp2} -> ok
+ after
+ 2000 -> ct:fail(timeout4)
+ end,
- ?line Own_nodes_should = [node(), Cp1nn, Cp2nn, Cp3nn,
- Cpxnn, Cpynn, Cpznn],
- ?line Own_nodes = rpc:call(Cp3, global_group, own_nodes, []),
- ?line [] = (Own_nodes -- Own_nodes_should),
- ?line [] = (Own_nodes_should -- Own_nodes),
-
- ?line Pid2 = rpc:call(Cp1, global_group, send, [test2, {ping, self()}]),
- ?line receive
- {pong, Cp2} -> ok
- after
- 2000 -> test_server:fail(timeout2)
- end,
- ?line Pid2 = rpc:call(Cp2, global_group, send, [test2, {ping, self()}]),
- ?line receive
- {pong, Cp2} -> ok
- after
- 2000 -> test_server:fail(timeout3)
- end,
- ?line Pid2 = rpc:call(Cpz, global_group, send, [test2, {ping, self()}]),
- ?line receive
- {pong, Cp2} -> ok
- after
- 2000 -> test_server:fail(timeout4)
- end,
-
-
- % start a proc and register it
- ?line {PidX, yes} = rpc:call(Cpx, ?MODULE, start_proc, [test]),
+
+ %% start a proc and register it
+ {PidX, yes} = rpc:call(Cpx, ?MODULE, start_proc, [test]),
%%------------------------------------
%% Test monitor nodes
%%------------------------------------
- ?line Pid2 = rpc:call(Cp1, global_group, send, [{node, Cp2nn}, test2, monitor]),
- ?line PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, monitor]),
+ Pid2 = rpc:call(Cp1, global_group, send, [{node, Cp2nn}, test2, monitor]),
+ PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, monitor]),
- % Kill node Cp1
- ?line Pid2 =
+ %% Kill node Cp1
+ Pid2 =
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodedown, Cp1}]),
- ?line PidX =
+ PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodedown, Cp1}]),
- ?line test_server:sleep(100),
- ?line stop_node(Cp1),
- ?line test_server:sleep(1000),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+ ct:sleep(100),
+ stop_node(Cp1),
+ ct:sleep(1000),
+
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
- % Kill node Cpz
- ?line Pid2 =
+ %% Kill node Cpz
+ Pid2 =
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodedown, Cpz}]),
- ?line PidX =
+ PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodedown, Cpz}]),
- ?line test_server:sleep(100),
- ?line stop_node(Cpz),
- ?line test_server:sleep(1000),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+ ct:sleep(100),
+ stop_node(Cpz),
+ ct:sleep(1000),
- % Restart node Cp1
- ?line Pid2 =
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+
+ %% Restart node Cp1
+ Pid2 =
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodeup, Cp1}]),
- ?line PidX =
+ PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodeup, Cp1}]),
- ?line {ok, Cp1} = start_node_no(cp1, Config),
- ?line pong = rpc:call(Cp2, net_adm, ping, [Cp1nn]),
- ?line pong = rpc:call(Cpx, net_adm, ping, [Cp1nn]),
- ?line wait_for_ready_net(),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+ {ok, Cp1} = start_node_no(cp1, Config),
+ pong = rpc:call(Cp2, net_adm, ping, [Cp1nn]),
+ pong = rpc:call(Cpx, net_adm, ping, [Cp1nn]),
+ wait_for_ready_net(),
- % Restart node Cpz
- ?line Pid2 =
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+
+ %% Restart node Cpz
+ Pid2 =
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodeup, Cpz}]),
- ?line PidX =
+ PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodeup, Cpz}]),
- ?line {ok, Cpz} = start_node_no(cpz, Config),
- ?line pong = rpc:call(Cp2, net_adm, ping, [Cpznn]),
- ?line pong = rpc:call(Cpx, net_adm, ping, [Cpznn]),
- ?line wait_for_ready_net(),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+ {ok, Cpz} = start_node_no(cpz, Config),
+ pong = rpc:call(Cp2, net_adm, ping, [Cpznn]),
+ pong = rpc:call(Cpx, net_adm, ping, [Cpznn]),
+ wait_for_ready_net(),
- % stop the nodes, and make sure names are released.
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+
+ %% stop the nodes, and make sure names are released.
stop_node(Cp1),
stop_node(Cp2),
stop_node(Cp3),
@@ -293,174 +286,169 @@ no_gg_proc(Config) when is_list(Config) ->
stop_node(Cpy),
stop_node(Cpz),
- ?line ?UNTIL(undefined =:= global:whereis_name(test)),
- ?line test_server:timetrap_cancel(Dog),
+ ?UNTIL(undefined =:= global:whereis_name(test)),
ok.
-
-no_gg_proc_sync(suite) -> [];
-no_gg_proc_sync(doc) ->
- ["Start a system without global groups, but syncing the nodes by using "
- "sync_nodes_optional."];
-no_gg_proc_sync(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(200)),
- ?line Dir = ?config(priv_dir, Config),
- ?line File = filename:join(Dir, "no_global_group_sync.config"),
- ?line {ok, Fd} = file:open(File, [write]),
+%% Start a system without global groups, but syncing the nodes by using
+%% sync_nodes_optional.
+no_gg_proc_sync(Config) when is_list(Config) ->
+ Dir = proplists:get_value(priv_dir, Config),
+ File = filename:join(Dir, "no_global_group_sync.config"),
+ {ok, Fd} = file:open(File, [write]),
[Ncp1,Ncp2,Ncp3,Ncpx,Ncpy,Ncpz] =
node_names([cp1,cp2,cp3,cpx,cpy,cpz], Config),
- ?line config_sync(Fd, Ncp1, Ncp2, Ncp3, Ncpx, Ncpy, Ncpz),
-
- ?line Cp1nn = node_at(Ncp1),
- ?line Cp2nn = node_at(Ncp2),
- ?line Cp3nn = node_at(Ncp3),
- ?line Cpxnn = node_at(Ncpx),
- ?line Cpynn = node_at(Ncpy),
- ?line Cpznn = node_at(Ncpz),
-
- ?line {ok, Cp1} = start_node_no2(Ncp1, Config),
- ?line {ok, Cp2} = start_node_no2(Ncp2, Config),
- ?line {ok, Cp3} = start_node_no2(Ncp3, Config),
- ?line {ok, Cpx} = start_node_no2(Ncpx, Config),
- ?line {ok, Cpy} = start_node_no2(Ncpy, Config),
- ?line {ok, Cpz} = start_node_no2(Ncpz, Config),
+ config_sync(Fd, Ncp1, Ncp2, Ncp3, Ncpx, Ncpy, Ncpz),
+
+ Cp1nn = node_at(Ncp1),
+ Cp2nn = node_at(Ncp2),
+ Cp3nn = node_at(Ncp3),
+ Cpxnn = node_at(Ncpx),
+ Cpynn = node_at(Ncpy),
+ Cpznn = node_at(Ncpz),
+
+ {ok, Cp1} = start_node_no2(Ncp1, Config),
+ {ok, Cp2} = start_node_no2(Ncp2, Config),
+ {ok, Cp3} = start_node_no2(Ncp3, Config),
+ {ok, Cpx} = start_node_no2(Ncpx, Config),
+ {ok, Cpy} = start_node_no2(Ncpy, Config),
+ {ok, Cpz} = start_node_no2(Ncpz, Config),
%% let the nodes know of each other
- ?line pong = rpc:call(Cp1, net_adm, ping, [Cp2nn]),
- ?line pong = rpc:call(Cp2, net_adm, ping, [Cp3nn]),
- ?line pong = rpc:call(Cp3, net_adm, ping, [Cpxnn]),
- ?line pong = rpc:call(Cpx, net_adm, ping, [Cpynn]),
- ?line pong = rpc:call(Cpy, net_adm, ping, [Cpznn]),
+ pong = rpc:call(Cp1, net_adm, ping, [Cp2nn]),
+ pong = rpc:call(Cp2, net_adm, ping, [Cp3nn]),
+ pong = rpc:call(Cp3, net_adm, ping, [Cpxnn]),
+ pong = rpc:call(Cpx, net_adm, ping, [Cpynn]),
+ pong = rpc:call(Cpy, net_adm, ping, [Cpznn]),
- ?line wait_for_ready_net(),
+ wait_for_ready_net(),
- ?line [test_server] = rpc:call(Cp1, global_group, registered_names, [{node, Cp1nn}]),
- ?line [test_server] = rpc:call(Cp2, global_group, registered_names, [{node, Cp2nn}]),
- ?line [test_server] = rpc:call(Cp3, global_group, registered_names, [{node, Cp3nn}]),
- ?line [test_server] = rpc:call(Cp1, global_group, registered_names, [{node, Cpxnn}]),
- ?line [test_server] = rpc:call(Cp2, global_group, registered_names, [{node, Cpynn}]),
- ?line [test_server] = rpc:call(Cp3, global_group, registered_names, [{node, Cpznn}]),
+ [test_server] = rpc:call(Cp1, global_group, registered_names, [{node, Cp1nn}]),
+ [test_server] = rpc:call(Cp2, global_group, registered_names, [{node, Cp2nn}]),
+ [test_server] = rpc:call(Cp3, global_group, registered_names, [{node, Cp3nn}]),
+ [test_server] = rpc:call(Cp1, global_group, registered_names, [{node, Cpxnn}]),
+ [test_server] = rpc:call(Cp2, global_group, registered_names, [{node, Cpynn}]),
+ [test_server] = rpc:call(Cp3, global_group, registered_names, [{node, Cpznn}]),
- % start a proc and register it
- ?line {Pid2, yes} = rpc:call(Cp2, ?MODULE, start_proc, [test2]),
+ %% start a proc and register it
+ {Pid2, yes} = rpc:call(Cp2, ?MODULE, start_proc, [test2]),
- ?line RegNames = lists:sort([test2,test_server]),
+ RegNames = lists:sort([test2,test_server]),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp1, global_group, registered_names, [{node, Cp1nn}])),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp2, global_group, registered_names, [{node, Cp2nn}])),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp3, global_group, registered_names, [{node, Cp3nn}])),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp1, global_group, registered_names, [{node, Cpxnn}])),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp2, global_group, registered_names, [{node, Cpynn}])),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp3, global_group, registered_names, [{node, Cpznn}])),
- ?line undefined = rpc:call(Cp3, global_group, global_groups, []),
+ undefined = rpc:call(Cp3, global_group, global_groups, []),
- ?line Own_nodes_should = [node(), Cp1nn, Cp2nn, Cp3nn,
- Cpxnn, Cpynn, Cpznn],
- ?line Own_nodes = rpc:call(Cp3, global_group, own_nodes, []),
- ?line [] = (Own_nodes -- Own_nodes_should),
- ?line [] = (Own_nodes_should -- Own_nodes),
-
- ?line Pid2 = rpc:call(Cp1, global_group, send, [test2, {ping, self()}]),
- ?line receive
- {pong, Cp2} -> ok
- after
- 2000 -> test_server:fail(timeout2)
- end,
- ?line Pid2 = rpc:call(Cp2, global_group, send, [test2, {ping, self()}]),
- ?line receive
- {pong, Cp2} -> ok
- after
- 2000 -> test_server:fail(timeout3)
- end,
- ?line Pid2 = rpc:call(Cpz, global_group, send, [test2, {ping, self()}]),
- ?line receive
- {pong, Cp2} -> ok
- after
- 2000 -> test_server:fail(timeout4)
- end,
-
-
- % start a proc and register it
- ?line {PidX, yes} = rpc:call(Cpx, ?MODULE, start_proc, [test]),
+ Own_nodes_should = [node(), Cp1nn, Cp2nn, Cp3nn,
+ Cpxnn, Cpynn, Cpznn],
+ Own_nodes = rpc:call(Cp3, global_group, own_nodes, []),
+ [] = (Own_nodes -- Own_nodes_should),
+ [] = (Own_nodes_should -- Own_nodes),
+
+ Pid2 = rpc:call(Cp1, global_group, send, [test2, {ping, self()}]),
+ receive
+ {pong, Cp2} -> ok
+ after
+ 2000 -> ct:fail(timeout2)
+ end,
+ Pid2 = rpc:call(Cp2, global_group, send, [test2, {ping, self()}]),
+ receive
+ {pong, Cp2} -> ok
+ after
+ 2000 -> ct:fail(timeout3)
+ end,
+ Pid2 = rpc:call(Cpz, global_group, send, [test2, {ping, self()}]),
+ receive
+ {pong, Cp2} -> ok
+ after
+ 2000 -> ct:fail(timeout4)
+ end,
+
+
+ %% start a proc and register it
+ {PidX, yes} = rpc:call(Cpx, ?MODULE, start_proc, [test]),
%%------------------------------------
%% Test monitor nodes
%%------------------------------------
- ?line Pid2 = rpc:call(Cp1, global_group, send, [{node, Cp2nn}, test2, monitor]),
- ?line PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, monitor]),
+ Pid2 = rpc:call(Cp1, global_group, send, [{node, Cp2nn}, test2, monitor]),
+ PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, monitor]),
- % Kill node Cp1
- ?line Pid2 =
+ %% Kill node Cp1
+ Pid2 =
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodedown, Cp1}]),
- ?line PidX =
+ PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodedown, Cp1}]),
- ?line test_server:sleep(100),
- ?line stop_node(Cp1),
- ?line test_server:sleep(1000),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+ ct:sleep(100),
+ stop_node(Cp1),
+ ct:sleep(1000),
+
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
- % Kill node Cpz
- ?line Pid2 =
+ %% Kill node Cpz
+ Pid2 =
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodedown, Cpz}]),
- ?line PidX =
+ PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodedown, Cpz}]),
- ?line test_server:sleep(100),
- ?line stop_node(Cpz),
- ?line test_server:sleep(1000),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+ ct:sleep(100),
+ stop_node(Cpz),
+ ct:sleep(1000),
- % Restart node Cp1
- ?line Pid2 =
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+
+ %% Restart node Cp1
+ Pid2 =
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodeup, Cp1}]),
- ?line PidX =
+ PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodeup, Cp1}]),
- ?line {ok, Cp1} = start_node_no2(Ncp1, Config),
- ?line pong = rpc:call(Cp2, net_adm, ping, [Cp1nn]),
- ?line pong = rpc:call(Cpx, net_adm, ping, [Cp1nn]),
- ?line wait_for_ready_net(),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+ {ok, Cp1} = start_node_no2(Ncp1, Config),
+ pong = rpc:call(Cp2, net_adm, ping, [Cp1nn]),
+ pong = rpc:call(Cpx, net_adm, ping, [Cp1nn]),
+ wait_for_ready_net(),
- % Restart node Cpz
- ?line Pid2 =
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+
+ %% Restart node Cpz
+ Pid2 =
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodeup, Cpz}]),
- ?line PidX =
+ PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodeup, Cpz}]),
- ?line {ok, Cpz} = start_node_no2(Ncpz, Config),
- ?line pong = rpc:call(Cp2, net_adm, ping, [Cpznn]),
- ?line pong = rpc:call(Cpx, net_adm, ping, [Cpznn]),
- ?line wait_for_ready_net(),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+ {ok, Cpz} = start_node_no2(Ncpz, Config),
+ pong = rpc:call(Cp2, net_adm, ping, [Cpznn]),
+ pong = rpc:call(Cpx, net_adm, ping, [Cpznn]),
+ wait_for_ready_net(),
- % stop the nodes, and make sure names are released.
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+
+ %% stop the nodes, and make sure names are released.
stop_node(Cp1),
stop_node(Cp2),
stop_node(Cp3),
@@ -468,173 +456,168 @@ no_gg_proc_sync(Config) when is_list(Config) ->
stop_node(Cpy),
stop_node(Cpz),
- ?line ?UNTIL(undefined =:= global:whereis_name(test)),
- ?line test_server:timetrap_cancel(Dog),
+ ?UNTIL(undefined =:= global:whereis_name(test)),
ok.
-
-compatible(suite) -> [];
-compatible(doc) ->
- ["Check that a system without global groups is compatible with the old R4 system."];
-compatible(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(200)),
- ?line Dir = ?config(priv_dir, Config),
- ?line File = filename:join(Dir, "global_group_comp.config"),
- ?line {ok, Fd} = file:open(File, [write]),
+%% Check that a system without global groups is compatible with the old R4 system.
+compatible(Config) when is_list(Config) ->
+ Dir = proplists:get_value(priv_dir, Config),
+ File = filename:join(Dir, "global_group_comp.config"),
+ {ok, Fd} = file:open(File, [write]),
[Ncp1,Ncp2,Ncp3,Ncpx,Ncpy,Ncpz] =
node_names([cp1,cp2,cp3,cpx,cpy,cpz], Config),
- ?line config_comp(Fd, Ncp1, Ncp2, Ncp3, Ncpx, Ncpy, Ncpz),
-
- ?line Cp1nn = node_at(Ncp1),
- ?line Cp2nn = node_at(Ncp2),
- ?line Cp3nn = node_at(Ncp3),
- ?line Cpxnn = node_at(Ncpx),
- ?line Cpynn = node_at(Ncpy),
- ?line Cpznn = node_at(Ncpz),
-
- ?line {ok, Cp1} = start_node_comp(Ncp1, Config),
- ?line {ok, Cp2} = start_node_comp(Ncp2, Config),
- ?line {ok, Cp3} = start_node_comp(Ncp3, Config),
- ?line {ok, Cpx} = start_node_comp(Ncpx, Config),
- ?line {ok, Cpy} = start_node_comp(Ncpy, Config),
- ?line {ok, Cpz} = start_node_comp(Ncpz, Config),
+ config_comp(Fd, Ncp1, Ncp2, Ncp3, Ncpx, Ncpy, Ncpz),
+
+ Cp1nn = node_at(Ncp1),
+ Cp2nn = node_at(Ncp2),
+ Cp3nn = node_at(Ncp3),
+ Cpxnn = node_at(Ncpx),
+ Cpynn = node_at(Ncpy),
+ Cpznn = node_at(Ncpz),
+
+ {ok, Cp1} = start_node_comp(Ncp1, Config),
+ {ok, Cp2} = start_node_comp(Ncp2, Config),
+ {ok, Cp3} = start_node_comp(Ncp3, Config),
+ {ok, Cpx} = start_node_comp(Ncpx, Config),
+ {ok, Cpy} = start_node_comp(Ncpy, Config),
+ {ok, Cpz} = start_node_comp(Ncpz, Config),
%% let the nodes know of each other
- ?line pong = rpc:call(Cp1, net_adm, ping, [Cp2nn]),
- ?line pong = rpc:call(Cp2, net_adm, ping, [Cp3nn]),
- ?line pong = rpc:call(Cp3, net_adm, ping, [Cpxnn]),
- ?line pong = rpc:call(Cpx, net_adm, ping, [Cpynn]),
- ?line pong = rpc:call(Cpy, net_adm, ping, [Cpznn]),
+ pong = rpc:call(Cp1, net_adm, ping, [Cp2nn]),
+ pong = rpc:call(Cp2, net_adm, ping, [Cp3nn]),
+ pong = rpc:call(Cp3, net_adm, ping, [Cpxnn]),
+ pong = rpc:call(Cpx, net_adm, ping, [Cpynn]),
+ pong = rpc:call(Cpy, net_adm, ping, [Cpznn]),
- ?line wait_for_ready_net(),
+ wait_for_ready_net(),
- ?line [test_server] = rpc:call(Cp1, global_group, registered_names, [{node, Cp1nn}]),
- ?line [test_server] = rpc:call(Cp2, global_group, registered_names, [{node, Cp2nn}]),
- ?line [test_server] = rpc:call(Cp3, global_group, registered_names, [{node, Cp3nn}]),
- ?line [test_server] = rpc:call(Cp1, global_group, registered_names, [{node, Cpxnn}]),
- ?line [test_server] = rpc:call(Cp2, global_group, registered_names, [{node, Cpynn}]),
- ?line [test_server] = rpc:call(Cp3, global_group, registered_names, [{node, Cpznn}]),
+ [test_server] = rpc:call(Cp1, global_group, registered_names, [{node, Cp1nn}]),
+ [test_server] = rpc:call(Cp2, global_group, registered_names, [{node, Cp2nn}]),
+ [test_server] = rpc:call(Cp3, global_group, registered_names, [{node, Cp3nn}]),
+ [test_server] = rpc:call(Cp1, global_group, registered_names, [{node, Cpxnn}]),
+ [test_server] = rpc:call(Cp2, global_group, registered_names, [{node, Cpynn}]),
+ [test_server] = rpc:call(Cp3, global_group, registered_names, [{node, Cpznn}]),
- % start a proc and register it
- ?line {Pid2, yes} = rpc:call(Cp2, ?MODULE, start_proc, [test2]),
+ %% start a proc and register it
+ {Pid2, yes} = rpc:call(Cp2, ?MODULE, start_proc, [test2]),
- ?line RegNames = lists:sort([test2,test_server]),
+ RegNames = lists:sort([test2,test_server]),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp1, global_group, registered_names, [{node, Cp1nn}])),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp2, global_group, registered_names, [{node, Cp2nn}])),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp3, global_group, registered_names, [{node, Cp3nn}])),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp1, global_group, registered_names, [{node, Cpxnn}])),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp2, global_group, registered_names, [{node, Cpynn}])),
- ?line RegNames =
+ RegNames =
lists:sort(
rpc:call(Cp3, global_group, registered_names, [{node, Cpznn}])),
- ?line undefined = rpc:call(Cp3, global_group, global_groups, []),
+ undefined = rpc:call(Cp3, global_group, global_groups, []),
- ?line Own_nodes_should = [node(), Cp1nn, Cp2nn, Cp3nn,
- Cpxnn, Cpynn, Cpznn],
- ?line Own_nodes = rpc:call(Cp3, global_group, own_nodes, []),
- ?line [] = (Own_nodes -- Own_nodes_should),
- ?line [] = (Own_nodes_should -- Own_nodes),
-
- ?line Pid2 = rpc:call(Cp1, global_group, send, [test2, {ping, self()}]),
- ?line receive
- {pong, Cp2} -> ok
- after
- 2000 -> test_server:fail(timeout2)
- end,
- ?line Pid2 = rpc:call(Cp2, global_group, send, [test2, {ping, self()}]),
- ?line receive
- {pong, Cp2} -> ok
- after
- 2000 -> test_server:fail(timeout3)
- end,
- ?line Pid2 = rpc:call(Cpz, global_group, send, [test2, {ping, self()}]),
- ?line receive
- {pong, Cp2} -> ok
- after
- 2000 -> test_server:fail(timeout4)
- end,
-
-
- % start a proc and register it
- ?line {PidX, yes} = rpc:call(Cpx, ?MODULE, start_proc, [test]),
+ Own_nodes_should = [node(), Cp1nn, Cp2nn, Cp3nn,
+ Cpxnn, Cpynn, Cpznn],
+ Own_nodes = rpc:call(Cp3, global_group, own_nodes, []),
+ [] = (Own_nodes -- Own_nodes_should),
+ [] = (Own_nodes_should -- Own_nodes),
+
+ Pid2 = rpc:call(Cp1, global_group, send, [test2, {ping, self()}]),
+ receive
+ {pong, Cp2} -> ok
+ after
+ 2000 -> ct:fail(timeout2)
+ end,
+ Pid2 = rpc:call(Cp2, global_group, send, [test2, {ping, self()}]),
+ receive
+ {pong, Cp2} -> ok
+ after
+ 2000 -> ct:fail(timeout3)
+ end,
+ Pid2 = rpc:call(Cpz, global_group, send, [test2, {ping, self()}]),
+ receive
+ {pong, Cp2} -> ok
+ after
+ 2000 -> ct:fail(timeout4)
+ end,
+
+
+ %% start a proc and register it
+ {PidX, yes} = rpc:call(Cpx, ?MODULE, start_proc, [test]),
%%------------------------------------
%% Test monitor nodes
%%------------------------------------
- ?line Pid2 = rpc:call(Cp1, global_group, send, [{node, Cp2nn}, test2, monitor]),
- ?line PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, monitor]),
+ Pid2 = rpc:call(Cp1, global_group, send, [{node, Cp2nn}, test2, monitor]),
+ PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, monitor]),
- % Kill node Cp1
- ?line Pid2 =
+ %% Kill node Cp1
+ Pid2 =
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodedown, Cp1}]),
- ?line PidX =
+ PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodedown, Cp1}]),
- ?line test_server:sleep(100),
- ?line stop_node(Cp1),
- ?line test_server:sleep(1000),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+ ct:sleep(100),
+ stop_node(Cp1),
+ ct:sleep(1000),
+
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
- % Kill node Cpz
- ?line Pid2 =
+ %% Kill node Cpz
+ Pid2 =
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodedown, Cpz}]),
- ?line PidX =
+ PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodedown, Cpz}]),
- ?line test_server:sleep(100),
- ?line stop_node(Cpz),
- ?line test_server:sleep(1000),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+ ct:sleep(100),
+ stop_node(Cpz),
+ ct:sleep(1000),
+
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
- % Restart node Cp1
- ?line Pid2 =
+ %% Restart node Cp1
+ Pid2 =
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodeup, Cp1}]),
- ?line PidX =
+ PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodeup, Cp1}]),
- ?line {ok, Cp1} = start_node_comp(Ncp1, Config),
- ?line pong = rpc:call(Cp2, net_adm, ping, [Cp1nn]),
- ?line pong = rpc:call(Cpx, net_adm, ping, [Cp1nn]),
- ?line wait_for_ready_net(),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+ {ok, Cp1} = start_node_comp(Ncp1, Config),
+ pong = rpc:call(Cp2, net_adm, ping, [Cp1nn]),
+ pong = rpc:call(Cpx, net_adm, ping, [Cp1nn]),
+ wait_for_ready_net(),
+
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
- % Restart node Cpz
- ?line Pid2 =
+ %% Restart node Cpz
+ Pid2 =
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodeup, Cpz}]),
- ?line PidX =
+ PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodeup, Cpz}]),
- ?line {ok, Cpz} = start_node_comp(Ncpz, Config),
- ?line pong = rpc:call(Cp2, net_adm, ping, [Cpznn]),
- ?line pong = rpc:call(Cpx, net_adm, ping, [Cpznn]),
- ?line wait_for_ready_net(),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+ {ok, Cpz} = start_node_comp(Ncpz, Config),
+ pong = rpc:call(Cp2, net_adm, ping, [Cpznn]),
+ pong = rpc:call(Cpx, net_adm, ping, [Cpznn]),
+ wait_for_ready_net(),
+
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
- % stop the nodes, and make sure names are released.
+ %% stop the nodes, and make sure names are released.
stop_node(Cp1),
stop_node(Cp2),
stop_node(Cp3),
@@ -642,147 +625,137 @@ compatible(Config) when is_list(Config) ->
stop_node(Cpy),
stop_node(Cpz),
- ?line ?UNTIL(undefined =:= global:whereis_name(test)),
- ?line test_server:timetrap_cancel(Dog),
+ ?UNTIL(undefined =:= global:whereis_name(test)),
ok.
-
-one_grp(suite) -> [];
-one_grp(doc) -> ["Test a system with only one global group. "];
-one_grp(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(120)),
- ?line Dir = ?config(priv_dir, Config),
- ?line File = filename:join(Dir, "global_group.config"),
- ?line {ok, Fd} = file:open(File, [write]),
+%% Test a system with only one global group. .
+one_grp(Config) when is_list(Config) ->
+ Dir = proplists:get_value(priv_dir, Config),
+ File = filename:join(Dir, "global_group.config"),
+ {ok, Fd} = file:open(File, [write]),
[Ncp1,Ncp2,Ncp3] = node_names([cp1, cp2, cp3], Config),
- ?line config(Fd, Ncp1, Ncp2, Ncp3, "cpx", "cpy", "cpz", "cpq"),
+ config(Fd, Ncp1, Ncp2, Ncp3, "cpx", "cpy", "cpz", "cpq"),
- ?line {ok, Cp1} = start_node(Ncp1, Config),
- ?line {ok, Cp2} = start_node(Ncp2, Config),
- ?line {ok, Cp3} = start_node(Ncp3, Config),
+ {ok, Cp1} = start_node(Ncp1, Config),
+ {ok, Cp2} = start_node(Ncp2, Config),
+ {ok, Cp3} = start_node(Ncp3, Config),
- % sleep a while to make the global_group to sync...
- test_server:sleep(1000),
+ %% sleep a while to make the global_group to sync...
+ ct:sleep(1000),
- % start a proc and register it
- ?line {Pid, yes} = rpc:call(Cp1, ?MODULE, start_proc, [test]),
+ %% start a proc and register it
+ {Pid, yes} = rpc:call(Cp1, ?MODULE, start_proc, [test]),
- % test that it is registered at all nodes
- ?line Pid = rpc:call(Cp1, global, whereis_name, [test]),
- ?line Pid = rpc:call(Cp2, global, whereis_name, [test]),
- ?line Pid = rpc:call(Cp3, global, whereis_name, [test]),
+ %% test that it is registered at all nodes
+ Pid = rpc:call(Cp1, global, whereis_name, [test]),
+ Pid = rpc:call(Cp2, global, whereis_name, [test]),
+ Pid = rpc:call(Cp3, global, whereis_name, [test]),
- % try to register the same name
- ?line no = rpc:call(Cp1, global, register_name, [test, self()]),
+ %% try to register the same name
+ no = rpc:call(Cp1, global, register_name, [test, self()]),
- % let process exit, check that it is unregistered automatically
+ %% let process exit, check that it is unregistered automatically
Pid ! die,
- ?line
- ?UNTIL(begin
+ ?UNTIL(begin
(undefined =:= rpc:call(Cp1, global, whereis_name, [test])) and
(undefined =:= rpc:call(Cp2, global, whereis_name, [test])) and
(undefined =:= rpc:call(Cp3, global, whereis_name, [test]))
end),
- % test re_register
- ?line {Pid2, yes} = rpc:call(Cp1, ?MODULE, start_proc, [test]),
- ?line Pid2 = rpc:call(Cp3, global, whereis_name, [test]),
+ %% test re_register
+ {Pid2, yes} = rpc:call(Cp1, ?MODULE, start_proc, [test]),
+ Pid2 = rpc:call(Cp3, global, whereis_name, [test]),
Pid3 = rpc:call(Cp3, ?MODULE, start_proc_rereg, [test]),
- ?line Pid3 = rpc:call(Cp3, global, whereis_name, [test]),
+ Pid3 = rpc:call(Cp3, global, whereis_name, [test]),
- % test sending
+ %% test sending
rpc:call(Cp1, global, send, [test, {ping, self()}]),
receive
{pong, Cp3} -> ok
after
- 2000 -> test_server:fail(timeout1)
+ 2000 -> ct:fail(timeout1)
end,
rpc:call(Cp3, global, send, [test, {ping, self()}]),
receive
{pong, Cp3} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line rpc:call(Cp3, global, unregister_name, [test]),
- ?line undefined = rpc:call(Cp1, global, whereis_name, [test]),
- ?line undefined = rpc:call(Cp2, global, whereis_name, [test]),
- ?line undefined = rpc:call(Cp3, global, whereis_name, [test]),
+ rpc:call(Cp3, global, unregister_name, [test]),
+ undefined = rpc:call(Cp1, global, whereis_name, [test]),
+ undefined = rpc:call(Cp2, global, whereis_name, [test]),
+ undefined = rpc:call(Cp3, global, whereis_name, [test]),
Pid3 ! die,
- ?line ?UNTIL(undefined =:= rpc:call(Cp3, global, whereis_name, [test])),
+ ?UNTIL(undefined =:= rpc:call(Cp3, global, whereis_name, [test])),
- % register a proc
- ?line {_, yes} = rpc:call(Cp3, ?MODULE, start_proc, [test]),
+ %% register a proc
+ {_, yes} = rpc:call(Cp3, ?MODULE, start_proc, [test]),
- % stop the nodes, and make sure names are released.
+ %% stop the nodes, and make sure names are released.
stop_node(Cp3),
- ?line ?UNTIL(undefined =:= rpc:call(Cp1, global, whereis_name, [test])),
+ ?UNTIL(undefined =:= rpc:call(Cp1, global, whereis_name, [test])),
Pid2 ! die,
stop_node(Cp1),
stop_node(Cp2),
- ?line test_server:timetrap_cancel(Dog),
ok.
-
-one_grp_x(suite) -> [];
-one_grp_x(doc) -> ["Check a system with only one global group. "
- "Start the nodes with different time intervals. "];
-one_grp_x(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(120)),
- ?line Dir = ?config(priv_dir, Config),
- ?line File = filename:join(Dir, "global_group.config"),
- ?line {ok, Fd} = file:open(File, [write]),
+%% Check a system with only one global group.
+%% Start the nodes with different time intervals.
+one_grp_x(Config) when is_list(Config) ->
+ Dir = proplists:get_value(priv_dir, Config),
+ File = filename:join(Dir, "global_group.config"),
+ {ok, Fd} = file:open(File, [write]),
[Ncp1,Ncp2,Ncp3] = node_names([cp1, cp2, cp3], Config),
- ?line config(Fd, Ncp1, Ncp2, Ncp3, "cpx", "cpy", "cpz", "cpq"),
+ config(Fd, Ncp1, Ncp2, Ncp3, "cpx", "cpy", "cpz", "cpq"),
- ?line {ok, Cp1} = start_node(Ncp1, Config),
- % sleep a while to make the global_group to sync...
- test_server:sleep(1000),
+ {ok, Cp1} = start_node(Ncp1, Config),
+ %% sleep a while to make the global_group to sync...
+ ct:sleep(1000),
- % start a proc and register it
- ?line {Pid, yes} = rpc:call(Cp1, ?MODULE, start_proc, [test]),
+ %% start a proc and register it
+ {Pid, yes} = rpc:call(Cp1, ?MODULE, start_proc, [test]),
- ?line {ok, Cp2} = start_node(Ncp2, Config),
- % sleep a while to make the global_group to sync...
- test_server:sleep(1000),
+ {ok, Cp2} = start_node(Ncp2, Config),
+ %% sleep a while to make the global_group to sync...
+ ct:sleep(1000),
- % test that it is registered at all nodes
- ?line Pid = rpc:call(Cp1, global, whereis_name, [test]),
- ?line Pid = rpc:call(Cp2, global, whereis_name, [test]),
+ %% test that it is registered at all nodes
+ Pid = rpc:call(Cp1, global, whereis_name, [test]),
+ Pid = rpc:call(Cp2, global, whereis_name, [test]),
- ?line {ok, Cp3} = start_node(Ncp3, Config),
- % sleep a while to make the global_group to sync...
- test_server:sleep(1000),
+ {ok, Cp3} = start_node(Ncp3, Config),
+ %% sleep a while to make the global_group to sync...
+ ct:sleep(1000),
- ?line Pid = rpc:call(Cp3, global, whereis_name, [test]),
+ Pid = rpc:call(Cp3, global, whereis_name, [test]),
- % try to register the same name
- ?line no = rpc:call(Cp1, global, register_name, [test, self()]),
+ %% try to register the same name
+ no = rpc:call(Cp1, global, register_name, [test, self()]),
- % let process exit, check that it is unregistered automatically
+ %% let process exit, check that it is unregistered automatically
Pid ! die,
- ?line
- ?UNTIL(begin
+ ?UNTIL(begin
(undefined =:= rpc:call(Cp1, global, whereis_name, [test])) and
(undefined =:= rpc:call(Cp2, global, whereis_name, [test])) and
(undefined =:= rpc:call(Cp3, global, whereis_name, [test]))
end),
- % test re_register
- ?line {Pid2, yes} = rpc:call(Cp1, ?MODULE, start_proc, [test]),
- ?line Pid2 = rpc:call(Cp3, global, whereis_name, [test]),
+ %% test re_register
+ {Pid2, yes} = rpc:call(Cp1, ?MODULE, start_proc, [test]),
+ Pid2 = rpc:call(Cp3, global, whereis_name, [test]),
Pid2 ! die,
@@ -790,296 +763,291 @@ one_grp_x(Config) when is_list(Config) ->
stop_node(Cp2),
stop_node(Cp3),
- ?line test_server:timetrap_cancel(Dog),
ok.
-
-two_grp(suite) -> [];
-two_grp(doc) -> ["Test a two global group system. "];
-two_grp(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(200)),
- ?line Dir = ?config(priv_dir, Config),
- ?line File = filename:join(Dir, "global_group.config"),
- ?line {ok, Fd} = file:open(File, [write]),
+%% Test a two global group system. .
+two_grp(Config) when is_list(Config) ->
+ Dir = proplists:get_value(priv_dir, Config),
+ File = filename:join(Dir, "global_group.config"),
+ {ok, Fd} = file:open(File, [write]),
[Ncp1,Ncp2,Ncp3,Ncpx,Ncpy,Ncpz,Ncpq] =
node_names([cp1,cp2,cp3,cpx,cpy,cpz,cpq], Config),
- ?line config(Fd, Ncp1, Ncp2, Ncp3, Ncpx, Ncpy, Ncpz, Ncpq),
-
- ?line Cp1nn = node_at(Ncp1),
- ?line Cp2nn = node_at(Ncp2),
- ?line Cp3nn = node_at(Ncp3),
- ?line Cpxnn = node_at(Ncpx),
- ?line Cpynn = node_at(Ncpy),
- ?line Cpznn = node_at(Ncpz),
-
- ?line {ok, Cp1} = start_node(Ncp1, Config),
- ?line {ok, Cp2} = start_node(Ncp2, Config),
- ?line {ok, Cp3} = start_node(Ncp3, Config),
- ?line {ok, Cpx} = start_node(Ncpx, Config),
- ?line {ok, Cpy} = start_node(Ncpy, Config),
- ?line {ok, Cpz} = start_node(Ncpz, Config),
+ config(Fd, Ncp1, Ncp2, Ncp3, Ncpx, Ncpy, Ncpz, Ncpq),
+
+ Cp1nn = node_at(Ncp1),
+ Cp2nn = node_at(Ncp2),
+ Cp3nn = node_at(Ncp3),
+ Cpxnn = node_at(Ncpx),
+ Cpynn = node_at(Ncpy),
+ Cpznn = node_at(Ncpz),
+
+ {ok, Cp1} = start_node(Ncp1, Config),
+ {ok, Cp2} = start_node(Ncp2, Config),
+ {ok, Cp3} = start_node(Ncp3, Config),
+ {ok, Cpx} = start_node(Ncpx, Config),
+ {ok, Cpy} = start_node(Ncpy, Config),
+ {ok, Cpz} = start_node(Ncpz, Config),
%% The groups (cpq not started):
%% [{nc1, [cp1,cp2,cp3]}, {nc2, [cpx,cpy,cpz]}, {nc3, [cpq]}]
- % sleep a while to make the global_groups to sync...
- test_server:sleep(1000),
-
- % check the global group names
- ?line {nc1, [nc2, nc3]} = rpc:call(Cp1, global_group, global_groups, []),
- ?line {nc1, [nc2, nc3]} = rpc:call(Cp2, global_group, global_groups, []),
- ?line {nc1, [nc2, nc3]} = rpc:call(Cp3, global_group, global_groups, []),
- ?line {nc2, [nc1, nc3]} = rpc:call(Cpx, global_group, global_groups, []),
- ?line {nc2, [nc1, nc3]} = rpc:call(Cpy, global_group, global_groups, []),
- ?line {nc2, [nc1, nc3]} = rpc:call(Cpz, global_group, global_groups, []),
-
- % check the global group nodes
- ?line [Cp1nn, Cp2nn, Cp3nn] = rpc:call(Cp1, global_group, own_nodes, []),
- ?line [Cp1nn, Cp2nn, Cp3nn] = rpc:call(Cp2, global_group, own_nodes, []),
- ?line [Cp1nn, Cp2nn, Cp3nn] = rpc:call(Cp3, global_group, own_nodes, []),
- ?line [Cpxnn, Cpynn, Cpznn] = rpc:call(Cpx, global_group, own_nodes, []),
- ?line [Cpxnn, Cpynn, Cpznn] = rpc:call(Cpy, global_group, own_nodes, []),
- ?line [Cpxnn, Cpynn, Cpznn] = rpc:call(Cpz, global_group, own_nodes, []),
-
-
- % start a proc and register it
- ?line {Pid1, yes} = rpc:call(Cp1, ?MODULE, start_proc, [test]),
-
- ?line Pid1 = rpc:call(Cp1, global_group, send, [test, {io, from_cp1}]),
- ?line Pid1 = rpc:call(Cpx, global_group, send, [test, {io, from_cpx}]),
- ?line Pid1 = rpc:call(Cp1, global_group, send, [{group,nc1}, test,
- {io, from_cp1}]),
- ?line [test] =
+ %% sleep a while to make the global_groups to sync...
+ ct:sleep(1000),
+
+ %% check the global group names
+ {nc1, [nc2, nc3]} = rpc:call(Cp1, global_group, global_groups, []),
+ {nc1, [nc2, nc3]} = rpc:call(Cp2, global_group, global_groups, []),
+ {nc1, [nc2, nc3]} = rpc:call(Cp3, global_group, global_groups, []),
+ {nc2, [nc1, nc3]} = rpc:call(Cpx, global_group, global_groups, []),
+ {nc2, [nc1, nc3]} = rpc:call(Cpy, global_group, global_groups, []),
+ {nc2, [nc1, nc3]} = rpc:call(Cpz, global_group, global_groups, []),
+
+ %% check the global group nodes
+ [Cp1nn, Cp2nn, Cp3nn] = rpc:call(Cp1, global_group, own_nodes, []),
+ [Cp1nn, Cp2nn, Cp3nn] = rpc:call(Cp2, global_group, own_nodes, []),
+ [Cp1nn, Cp2nn, Cp3nn] = rpc:call(Cp3, global_group, own_nodes, []),
+ [Cpxnn, Cpynn, Cpznn] = rpc:call(Cpx, global_group, own_nodes, []),
+ [Cpxnn, Cpynn, Cpznn] = rpc:call(Cpy, global_group, own_nodes, []),
+ [Cpxnn, Cpynn, Cpznn] = rpc:call(Cpz, global_group, own_nodes, []),
+
+
+ %% start a proc and register it
+ {Pid1, yes} = rpc:call(Cp1, ?MODULE, start_proc, [test]),
+
+ Pid1 = rpc:call(Cp1, global_group, send, [test, {io, from_cp1}]),
+ Pid1 = rpc:call(Cpx, global_group, send, [test, {io, from_cpx}]),
+ Pid1 = rpc:call(Cp1, global_group, send, [{group,nc1}, test,
+ {io, from_cp1}]),
+ [test] =
rpc:call(Cpx, global_group, registered_names, [{node, Cp1nn}]),
- ?line [test] =
+ [test] =
rpc:call(Cpx, global_group, registered_names, [{group, nc1}]),
- ?line [] = rpc:call(Cpx, global_group, registered_names, [{node, Cpxnn}]),
- ?line [] = rpc:call(Cpx, global_group, registered_names, [{group, nc2}]),
- ?line Pid1 = rpc:call(Cpx, global_group, send, [{group,nc1}, test,
- {io, from_cp1}]),
- ?line {badarg,{test,{io,from_cpx}}} =
+ [] = rpc:call(Cpx, global_group, registered_names, [{node, Cpxnn}]),
+ [] = rpc:call(Cpx, global_group, registered_names, [{group, nc2}]),
+ Pid1 = rpc:call(Cpx, global_group, send, [{group,nc1}, test,
+ {io, from_cp1}]),
+ {badarg,{test,{io,from_cpx}}} =
rpc:call(Cp1, global_group, send, [{group,nc2}, test, {io, from_cpx}]),
- ?line {badarg,{test,{io,from_cpx}}} =
+ {badarg,{test,{io,from_cpx}}} =
rpc:call(Cpx, global_group, send, [{group,nc2}, test, {io, from_cpx}]),
- % test that it is registered at all nodes
- ?line Pid1 = rpc:call(Cp1, global, whereis_name, [test]),
- ?line Pid1 = rpc:call(Cp2, global, whereis_name, [test]),
- ?line Pid1 = rpc:call(Cp3, global, whereis_name, [test]),
- ?line undefined = rpc:call(Cpx, global, whereis_name, [test]),
- ?line undefined = rpc:call(Cpy, global, whereis_name, [test]),
- ?line undefined = rpc:call(Cpz, global, whereis_name, [test]),
-
- % start a proc and register it
- ?line {PidX, yes} = rpc:call(Cpx, ?MODULE, start_proc, [test]),
-
- % test that it is registered at all nodes
- ?line Pid1 = rpc:call(Cp1, global, whereis_name, [test]),
- ?line Pid1 = rpc:call(Cp2, global, whereis_name, [test]),
- ?line Pid1 = rpc:call(Cp3, global, whereis_name, [test]),
- ?line PidX = rpc:call(Cpx, global, whereis_name, [test]),
- ?line PidX = rpc:call(Cpy, global, whereis_name, [test]),
- ?line PidX = rpc:call(Cpz, global, whereis_name, [test]),
-
+ %% test that it is registered at all nodes
+ Pid1 = rpc:call(Cp1, global, whereis_name, [test]),
+ Pid1 = rpc:call(Cp2, global, whereis_name, [test]),
+ Pid1 = rpc:call(Cp3, global, whereis_name, [test]),
+ undefined = rpc:call(Cpx, global, whereis_name, [test]),
+ undefined = rpc:call(Cpy, global, whereis_name, [test]),
+ undefined = rpc:call(Cpz, global, whereis_name, [test]),
+
+ %% start a proc and register it
+ {PidX, yes} = rpc:call(Cpx, ?MODULE, start_proc, [test]),
+
+ %% test that it is registered at all nodes
+ Pid1 = rpc:call(Cp1, global, whereis_name, [test]),
+ Pid1 = rpc:call(Cp2, global, whereis_name, [test]),
+ Pid1 = rpc:call(Cp3, global, whereis_name, [test]),
+ PidX = rpc:call(Cpx, global, whereis_name, [test]),
+ PidX = rpc:call(Cpy, global, whereis_name, [test]),
+ PidX = rpc:call(Cpz, global, whereis_name, [test]),
+
Pid1 ! die,
%% If we don't wait for global on other nodes to have updated its
%% tables, 'test' may still be defined at the point when it is
%% tested a few lines below.
- ?line
- ?UNTIL(begin
+ ?UNTIL(begin
Pid = rpc:call(Cp2, global, whereis_name, [test]),
undefined =:= Pid
end),
- % start a proc and register it
- ?line {Pid2, yes} = rpc:call(Cp2, ?MODULE, start_proc, [test2]),
+ %% start a proc and register it
+ {Pid2, yes} = rpc:call(Cp2, ?MODULE, start_proc, [test2]),
+
+ %% test that it is registered at all nodes
+ Pid2 = rpc:call(Cp1, global, whereis_name, [test2]),
+ Pid2 = rpc:call(Cp2, global, whereis_name, [test2]),
+ Pid2 = rpc:call(Cp3, global, whereis_name, [test2]),
+ PidX = rpc:call(Cpx, global, whereis_name, [test]),
+ PidX = rpc:call(Cpy, global, whereis_name, [test]),
+ PidX = rpc:call(Cpz, global, whereis_name, [test]),
+
+ undefined = rpc:call(Cp1, global, whereis_name, [test]),
+ undefined = rpc:call(Cp2, global, whereis_name, [test]),
+ undefined = rpc:call(Cp3, global, whereis_name, [test]),
+ undefined = rpc:call(Cpx, global, whereis_name, [test2]),
+ undefined = rpc:call(Cpy, global, whereis_name, [test2]),
+ undefined = rpc:call(Cpz, global, whereis_name, [test2]),
- % test that it is registered at all nodes
- ?line Pid2 = rpc:call(Cp1, global, whereis_name, [test2]),
- ?line Pid2 = rpc:call(Cp2, global, whereis_name, [test2]),
- ?line Pid2 = rpc:call(Cp3, global, whereis_name, [test2]),
- ?line PidX = rpc:call(Cpx, global, whereis_name, [test]),
- ?line PidX = rpc:call(Cpy, global, whereis_name, [test]),
- ?line PidX = rpc:call(Cpz, global, whereis_name, [test]),
-
- ?line undefined = rpc:call(Cp1, global, whereis_name, [test]),
- ?line undefined = rpc:call(Cp2, global, whereis_name, [test]),
- ?line undefined = rpc:call(Cp3, global, whereis_name, [test]),
- ?line undefined = rpc:call(Cpx, global, whereis_name, [test2]),
- ?line undefined = rpc:call(Cpy, global, whereis_name, [test2]),
- ?line undefined = rpc:call(Cpz, global, whereis_name, [test2]),
-
- ?line Pid2 = rpc:call(Cp1, global_group, send, [test2, {ping, self()}]),
+ Pid2 = rpc:call(Cp1, global_group, send, [test2, {ping, self()}]),
receive
{pong, Cp2} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line Pid2 = rpc:call(Cp2, global_group, send, [test2, {ping, self()}]),
+ Pid2 = rpc:call(Cp2, global_group, send, [test2, {ping, self()}]),
receive
{pong, Cp2} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line Pid2 = rpc:call(Cp3, global_group, send, [test2, {ping, self()}]),
+ Pid2 = rpc:call(Cp3, global_group, send, [test2, {ping, self()}]),
receive
{pong, Cp2} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line PidX = rpc:call(Cpx, global_group, send, [test, {ping, self()}]),
+ PidX = rpc:call(Cpx, global_group, send, [test, {ping, self()}]),
receive
{pong, Cpx} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line PidX = rpc:call(Cpy, global_group, send, [test, {ping, self()}]),
+ PidX = rpc:call(Cpy, global_group, send, [test, {ping, self()}]),
receive
{pong, Cpx} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line PidX = rpc:call(Cpz, global_group, send, [test, {ping, self()}]),
+ PidX = rpc:call(Cpz, global_group, send, [test, {ping, self()}]),
receive
{pong, Cpx} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line Pid2 = rpc:call(Cpx, global_group, send, [{node, Cp1nn}, test2,
- {ping, self()}]),
+ Pid2 = rpc:call(Cpx, global_group, send, [{node, Cp1nn}, test2,
+ {ping, self()}]),
receive
{pong, Cp2} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line Pid2 = rpc:call(Cpy, global_group, send, [{node, Cp2nn}, test2,
- {ping, self()}]),
+ Pid2 = rpc:call(Cpy, global_group, send, [{node, Cp2nn}, test2,
+ {ping, self()}]),
receive
{pong, Cp2} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line Pid2 = rpc:call(Cpz, global_group, send, [{node, Cp3nn}, test2,
- {ping, self()}]),
+ Pid2 = rpc:call(Cpz, global_group, send, [{node, Cp3nn}, test2,
+ {ping, self()}]),
receive
{pong, Cp2} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line PidX = rpc:call(Cpx, global_group, send, [{node, Cpznn}, test,
- {ping, self()}]),
+ PidX = rpc:call(Cpx, global_group, send, [{node, Cpznn}, test,
+ {ping, self()}]),
receive
{pong, Cpx} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line PidX = rpc:call(Cpy, global_group, send, [{node, Cpxnn}, test,
- {ping, self()}]),
+ PidX = rpc:call(Cpy, global_group, send, [{node, Cpxnn}, test,
+ {ping, self()}]),
receive
{pong, Cpx} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line PidX = rpc:call(Cpz, global_group, send, [{node, Cpynn}, test,
- {ping, self()}]),
+ PidX = rpc:call(Cpz, global_group, send, [{node, Cpynn}, test,
+ {ping, self()}]),
receive
{pong, Cpx} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line Pid2 = rpc:call(Cpx, global_group, send, [{group, nc1}, test2,
- {ping, self()}]),
+ Pid2 = rpc:call(Cpx, global_group, send, [{group, nc1}, test2,
+ {ping, self()}]),
receive
{pong, Cp2} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
- ?line PidX = rpc:call(Cpy, global_group, send, [{group, nc2}, test,
- {ping, self()}]),
+ PidX = rpc:call(Cpy, global_group, send, [{group, nc2}, test,
+ {ping, self()}]),
receive
{pong, Cpx} -> ok
after
- 2000 -> test_server:fail(timeout2)
+ 2000 -> ct:fail(timeout2)
end,
%%------------------------------------
%% Test monitor nodes
%%------------------------------------
- ?line Pid2 =
+ Pid2 =
rpc:call(Cp1, global_group, send, [{node, Cp2nn}, test2, monitor]),
- ?line PidX =
+ PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, monitor]),
- % Kill node Cp1
- ?line Pid2 = rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2,
- {wait_nodedown, Cp1}]),
- ?line PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test,
- {wait_nodedown, Cp1}]),
- ?line test_server:sleep(100),
- ?line stop_node(Cp1),
- ?line test_server:sleep(1000),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop_nodedown),
- ?line PidX =
+ %% Kill node Cp1
+ Pid2 = rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2,
+ {wait_nodedown, Cp1}]),
+ PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test,
+ {wait_nodedown, Cp1}]),
+ ct:sleep(100),
+ stop_node(Cp1),
+ ct:sleep(1000),
+
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop_nodedown),
+ PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, to_loop]),
- % Kill node Cpz
- ?line Pid2 = rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2,
- {wait_nodedown, Cpz}]),
- ?line PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test,
- {wait_nodedown, Cpz}]),
- ?line test_server:sleep(100),
- ?line stop_node(Cpz),
- ?line test_server:sleep(1000),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop_nodedown),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
- ?line Pid2 =
+ %% Kill node Cpz
+ Pid2 = rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2,
+ {wait_nodedown, Cpz}]),
+ PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test,
+ {wait_nodedown, Cpz}]),
+ ct:sleep(100),
+ stop_node(Cpz),
+ ct:sleep(1000),
+
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop_nodedown),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+ Pid2 =
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, to_loop]),
- % Restart node Cp1
- ?line [Cp1nn, Cp2nn, Cp3nn] = rpc:call(Cp2, global_group, own_nodes, []),
- ?line Pid2 = rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2,
- {wait_nodeup, Cp1}]),
- ?line PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test,
- {wait_nodeup, Cp1}]),
- ?line test_server:sleep(100),
- ?line {ok, Cp1} = start_node(Ncp1, Config),
- ?line test_server:sleep(5000),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop_nodeup),
- ?line PidX =
+ %% Restart node Cp1
+ [Cp1nn, Cp2nn, Cp3nn] = rpc:call(Cp2, global_group, own_nodes, []),
+ Pid2 = rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2,
+ {wait_nodeup, Cp1}]),
+ PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test,
+ {wait_nodeup, Cp1}]),
+ ct:sleep(100),
+ {ok, Cp1} = start_node(Ncp1, Config),
+ ct:sleep(5000),
+
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop_nodeup),
+ PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, to_loop]),
- % Restart node Cpz
- ?line Pid2 = rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2,
- {wait_nodeup, Cpz}]),
- ?line PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test,
- {wait_nodeup, Cpz}]),
- ?line test_server:sleep(100),
- ?line {ok, Cpz} = start_node(Ncpz, Config),
- ?line test_server:sleep(5000),
-
- ?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop_nodeup),
- ?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
- ?line Pid2 =
+ %% Restart node Cpz
+ Pid2 = rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2,
+ {wait_nodeup, Cpz}]),
+ PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test,
+ {wait_nodeup, Cpz}]),
+ ct:sleep(100),
+ {ok, Cpz} = start_node(Ncpz, Config),
+ ct:sleep(5000),
+
+ ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop_nodeup),
+ ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
+ Pid2 =
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, to_loop]),
@@ -1093,72 +1061,68 @@ two_grp(Config) when is_list(Config) ->
stop_node(Cpy),
stop_node(Cpz),
- ?line test_server:timetrap_cancel(Dog),
ok.
-
-hidden_groups(suite) -> [];
-hidden_groups(doc) -> ["Test hidden global groups."];
-hidden_groups(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(200)),
- ?line Dir = ?config(priv_dir, Config),
- ?line File = filename:join(Dir, "global_group.config"),
- ?line {ok, Fd} = file:open(File, [write]),
+%% Test hidden global groups.
+hidden_groups(Config) when is_list(Config) ->
+ Dir = proplists:get_value(priv_dir, Config),
+ File = filename:join(Dir, "global_group.config"),
+ {ok, Fd} = file:open(File, [write]),
[Ncp1,Ncp2,Ncp3,Ncpx,Ncpy,Ncpz,Ncpq] =
node_names([cp1,cp2,cp3,cpx,cpy,cpz,cpq], Config),
- ?line config_hidden(Fd, Ncp1, Ncp2, Ncp3, Ncpx, Ncpy, Ncpz, Ncpq),
-
- ?line {ok, Cp1} = start_node(Ncp1, Config),
- ?line {ok, Cp2} = start_node(Ncp2, Config),
- ?line {ok, Cp3} = start_node(Ncp3, Config),
- ?line {ok, Cpx} = start_node(Ncpx, Config),
- ?line {ok, Cpy} = start_node(Ncpy, Config),
- ?line {ok, Cpz} = start_node(Ncpz, Config),
- ?line {ok, Cpq} = start_node(Ncpq, Config),
-
- % sleep a while to make the global_groups to sync...
- test_server:sleep(1000),
-
- % check the global group names
- ?line {nc1, [nc2, nc3]} = rpc:call(Cp1, global_group, global_groups, []),
- ?line {nc1, [nc2, nc3]} = rpc:call(Cp2, global_group, global_groups, []),
- ?line {nc1, [nc2, nc3]} = rpc:call(Cp3, global_group, global_groups, []),
- ?line {nc2, [nc1, nc3]} = rpc:call(Cpx, global_group, global_groups, []),
- ?line {nc2, [nc1, nc3]} = rpc:call(Cpy, global_group, global_groups, []),
- ?line {nc2, [nc1, nc3]} = rpc:call(Cpz, global_group, global_groups, []),
-
- % check the global group nodes
- ?line [Cp1, Cp2, Cp3] = rpc:call(Cp1, global_group, own_nodes, []),
- ?line [Cp1, Cp2, Cp3] = rpc:call(Cp2, global_group, own_nodes, []),
- ?line [Cp1, Cp2, Cp3] = rpc:call(Cp3, global_group, own_nodes, []),
- ?line [Cpx, Cpy, Cpz] = rpc:call(Cpx, global_group, own_nodes, []),
- ?line [Cpx, Cpy, Cpz] = rpc:call(Cpy, global_group, own_nodes, []),
- ?line [Cpx, Cpy, Cpz] = rpc:call(Cpz, global_group, own_nodes, []),
- ?line [Cpq] = rpc:call(Cpq, global_group, own_nodes, []),
-
- % Make some inter group connections
- ?line pong = rpc:call(Cp1, net_adm, ping, [Cpx]),
- ?line pong = rpc:call(Cpy, net_adm, ping, [Cp2]),
- ?line pong = rpc:call(Cp3, net_adm, ping, [Cpx]),
- ?line pong = rpc:call(Cpz, net_adm, ping, [Cp3]),
- ?line pong = rpc:call(Cpq, net_adm, ping, [Cp1]),
- ?line pong = rpc:call(Cpz, net_adm, ping, [Cpq]),
-
- % Check that no inter group connections are visible
+ config_hidden(Fd, Ncp1, Ncp2, Ncp3, Ncpx, Ncpy, Ncpz, Ncpq),
+
+ {ok, Cp1} = start_node(Ncp1, Config),
+ {ok, Cp2} = start_node(Ncp2, Config),
+ {ok, Cp3} = start_node(Ncp3, Config),
+ {ok, Cpx} = start_node(Ncpx, Config),
+ {ok, Cpy} = start_node(Ncpy, Config),
+ {ok, Cpz} = start_node(Ncpz, Config),
+ {ok, Cpq} = start_node(Ncpq, Config),
+
+ %% sleep a while to make the global_groups to sync...
+ ct:sleep(1000),
+
+ %% check the global group names
+ {nc1, [nc2, nc3]} = rpc:call(Cp1, global_group, global_groups, []),
+ {nc1, [nc2, nc3]} = rpc:call(Cp2, global_group, global_groups, []),
+ {nc1, [nc2, nc3]} = rpc:call(Cp3, global_group, global_groups, []),
+ {nc2, [nc1, nc3]} = rpc:call(Cpx, global_group, global_groups, []),
+ {nc2, [nc1, nc3]} = rpc:call(Cpy, global_group, global_groups, []),
+ {nc2, [nc1, nc3]} = rpc:call(Cpz, global_group, global_groups, []),
+
+ %% check the global group nodes
+ [Cp1, Cp2, Cp3] = rpc:call(Cp1, global_group, own_nodes, []),
+ [Cp1, Cp2, Cp3] = rpc:call(Cp2, global_group, own_nodes, []),
+ [Cp1, Cp2, Cp3] = rpc:call(Cp3, global_group, own_nodes, []),
+ [Cpx, Cpy, Cpz] = rpc:call(Cpx, global_group, own_nodes, []),
+ [Cpx, Cpy, Cpz] = rpc:call(Cpy, global_group, own_nodes, []),
+ [Cpx, Cpy, Cpz] = rpc:call(Cpz, global_group, own_nodes, []),
+ [Cpq] = rpc:call(Cpq, global_group, own_nodes, []),
+
+ %% Make some inter group connections
+ pong = rpc:call(Cp1, net_adm, ping, [Cpx]),
+ pong = rpc:call(Cpy, net_adm, ping, [Cp2]),
+ pong = rpc:call(Cp3, net_adm, ping, [Cpx]),
+ pong = rpc:call(Cpz, net_adm, ping, [Cp3]),
+ pong = rpc:call(Cpq, net_adm, ping, [Cp1]),
+ pong = rpc:call(Cpz, net_adm, ping, [Cpq]),
+
+ %% Check that no inter group connections are visible
NC1Nodes = lists:sort([Cp1, Cp2, Cp3]),
NC2Nodes = lists:sort([Cpx, Cpy, Cpz]),
- ?line NC1Nodes = lists:sort([Cp1|rpc:call(Cp1, erlang, nodes, [])]),
- ?line NC1Nodes = lists:sort([Cp2|rpc:call(Cp2, erlang, nodes, [])]),
- ?line NC1Nodes = lists:sort([Cp3|rpc:call(Cp3, erlang, nodes, [])]),
- ?line NC2Nodes = lists:sort([Cpx|rpc:call(Cpx, erlang, nodes, [])]),
- ?line NC2Nodes = lists:sort([Cpy|rpc:call(Cpy, erlang, nodes, [])]),
- ?line NC2Nodes = lists:sort([Cpz|rpc:call(Cpz, erlang, nodes, [])]),
+ NC1Nodes = lists:sort([Cp1|rpc:call(Cp1, erlang, nodes, [])]),
+ NC1Nodes = lists:sort([Cp2|rpc:call(Cp2, erlang, nodes, [])]),
+ NC1Nodes = lists:sort([Cp3|rpc:call(Cp3, erlang, nodes, [])]),
+ NC2Nodes = lists:sort([Cpx|rpc:call(Cpx, erlang, nodes, [])]),
+ NC2Nodes = lists:sort([Cpy|rpc:call(Cpy, erlang, nodes, [])]),
+ NC2Nodes = lists:sort([Cpz|rpc:call(Cpz, erlang, nodes, [])]),
NC12Nodes = lists:append(NC1Nodes, NC2Nodes),
- ?line false = lists:any(fun(N) -> lists:member(N, NC12Nodes) end,
- rpc:call(Cpq, erlang, nodes, [])),
+ false = lists:any(fun(N) -> lists:member(N, NC12Nodes) end,
+ rpc:call(Cpq, erlang, nodes, [])),
stop_node(Cp1),
@@ -1169,63 +1133,58 @@ hidden_groups(Config) when is_list(Config) ->
stop_node(Cpz),
stop_node(Cpq),
- ?line test_server:timetrap_cancel(Dog),
ok.
-
-test_exit(suite) -> [];
-test_exit(doc) -> ["Checks when the search process exits. "];
-test_exit(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(120)),
- ?line NN = node_name(atom_to_list(node())),
- ?line Cp1nn = list_to_atom("cp1@" ++ NN),
+%% Checks when the search process exits. .
+test_exit(Config) when is_list(Config) ->
+ NN = node_name(atom_to_list(node())),
+ Cp1nn = list_to_atom("cp1@" ++ NN),
- ?line {ok, Cp1} = start_node(cp1, Config),
- ?line {ok, Cp2} = start_node(cp2, Config),
- ?line {ok, Cp3} = start_node(cp3, Config),
+ {ok, Cp1} = start_node(cp1, Config),
+ {ok, Cp2} = start_node(cp2, Config),
+ {ok, Cp3} = start_node(cp3, Config),
- test_server:sleep(1000),
+ ct:sleep(1000),
- ?line {error, illegal_function_call} =
+ {error, illegal_function_call} =
rpc:call(Cp1, global_group, registered_names_test, [{node, Cp1nn}]),
- ?line {badarg,_} =
+ {badarg,_} =
rpc:call(Cp1, global_group, send, [king, "The message"]),
- ?line undefined = rpc:call(Cp1, global_group, whereis_name, [king]),
+ undefined = rpc:call(Cp1, global_group, whereis_name, [king]),
- % stop the nodes, and make sure names are released.
+ %% stop the nodes, and make sure names are released.
stop_node(Cp1),
stop_node(Cp2),
stop_node(Cp3),
- % sleep to let the nodes die
- test_server:sleep(1000),
+ %% sleep to let the nodes die
+ ct:sleep(1000),
- ?line test_server:timetrap_cancel(Dog),
ok.
-
+
start_node(Name, Config) ->
Pa=filename:dirname(code:which(?MODULE)),
- Dir=?config(priv_dir, Config),
+ Dir=proplists:get_value(priv_dir, Config),
ConfFile = " -config " ++ filename:join(Dir, "global_group"),
test_server:start_node(Name, slave, [{args, "-pa " ++ Pa ++ ConfFile}]).
start_node_no(Name, Config) ->
Pa=filename:dirname(code:which(?MODULE)),
- Dir=?config(priv_dir, Config),
+ Dir=proplists:get_value(priv_dir, Config),
ConfFile = " -config " ++ filename:join(Dir, "no_global_group"),
test_server:start_node(Name, slave, [{args, "-pa " ++ Pa ++ ConfFile}]).
start_node_no2(Name, Config) ->
Pa=filename:dirname(code:which(?MODULE)),
- Dir=?config(priv_dir, Config),
+ Dir=proplists:get_value(priv_dir, Config),
ConfFile = " -config " ++ filename:join(Dir, "no_global_group_sync"),
test_server:start_node(Name, slave, [{args, "-pa " ++ Pa ++ ConfFile}]).
start_node_comp(Name, Config) ->
Pa=filename:dirname(code:which(?MODULE)),
- Dir=?config(priv_dir, Config),
+ Dir=proplists:get_value(priv_dir, Config),
ConfFile = " -config " ++ filename:join(Dir, "global_group_comp"),
test_server:start_node(Name, slave, [{args, "-pa " ++ Pa ++ ConfFile}]).
@@ -1242,17 +1201,17 @@ node_name(Name, Config) ->
lists:concat([Name,U,?testcase,U,Pid,U,U,L]).
stop_node(Node) ->
- ?t:stop_node(Node).
+ test_server:stop_node(Node).
wait_for_ready_net() ->
Nodes = lists:sort(?NODES),
?UNTIL(begin
lists:all(fun(N) -> Nodes =:= get_known(N) end, Nodes) and
- lists:all(fun(N) ->
- LNs = rpc:call(N, erlang, nodes, []),
- Nodes =:= lists:sort([N | LNs])
- end, Nodes)
+ lists:all(fun(N) ->
+ LNs = rpc:call(N, erlang, nodes, []),
+ Nodes =:= lists:sort([N | LNs])
+ end, Nodes)
end).
get_known(Node) ->
@@ -1262,11 +1221,11 @@ get_known(Node) ->
config_hidden(Fd, Ncp1, Ncp2, Ncp3, Ncpx, Ncpy, Ncpz, Ncpq) ->
M = from($@, atom_to_list(node())),
io:format(Fd, "[{kernel, [{sync_nodes_optional, ['~s@~s','~s@~s','~s@~s', "
- " '~s@~s','~s@~s','~s@~s']},"
- "{sync_nodes_timeout, 1000},"
- "{global_groups, [{nc1, hidden, ['~s@~s','~s@~s','~s@~s']}, "
- "{nc2, hidden, ['~s@~s','~s@~s','~s@~s']}, "
- "{nc3, normal, ['~s@~s']}]} ] }]. ~n",
+ " '~s@~s','~s@~s','~s@~s']},"
+ "{sync_nodes_timeout, 1000},"
+ "{global_groups, [{nc1, hidden, ['~s@~s','~s@~s','~s@~s']}, "
+ "{nc2, hidden, ['~s@~s','~s@~s','~s@~s']}, "
+ "{nc3, normal, ['~s@~s']}]} ] }]. ~n",
[Ncp1, M, Ncp2, M, Ncp3, M,
Ncpx, M, Ncpy, M, Ncpz, M,
Ncp1, M, Ncp2, M, Ncp3, M,
@@ -1276,11 +1235,11 @@ config_hidden(Fd, Ncp1, Ncp2, Ncp3, Ncpx, Ncpy, Ncpz, Ncpq) ->
config(Fd, Ncp1, Ncp2, Ncp3, Ncpx, Ncpy, Ncpz, Ncpq) ->
M = from($@, atom_to_list(node())),
io:format(Fd, "[{kernel, [{sync_nodes_optional, ['~s@~s','~s@~s','~s@~s', "
- " '~s@~s','~s@~s','~s@~s']},"
- "{sync_nodes_timeout, 1000},"
- "{global_groups, [{nc1, ['~s@~s','~s@~s','~s@~s']}, "
- " {nc2, ['~s@~s','~s@~s','~s@~s']}, "
- "{nc3, ['~s@~s']}]} ] }]. ~n",
+ " '~s@~s','~s@~s','~s@~s']},"
+ "{sync_nodes_timeout, 1000},"
+ "{global_groups, [{nc1, ['~s@~s','~s@~s','~s@~s']}, "
+ " {nc2, ['~s@~s','~s@~s','~s@~s']}, "
+ "{nc3, ['~s@~s']}]} ] }]. ~n",
[Ncp1, M, Ncp2, M, Ncp3, M,
Ncpx, M, Ncpy, M, Ncpz, M,
Ncp1, M, Ncp2, M, Ncp3, M,
@@ -1293,9 +1252,9 @@ config_no(Fd) ->
config_sync(Fd, Ncp1, Ncp2, Ncp3, Ncpx, Ncpy, Ncpz) ->
M = from($@, atom_to_list(node())),
io:format(Fd, "[{kernel, [{sync_nodes_optional, ['~s@~s','~s@~s','~s@~s', "
- " '~s@~s','~s@~s','~s@~s']},"
- "{sync_nodes_timeout, 1000},"
- "{global_groups, []} ] }] .~n",
+ " '~s@~s','~s@~s','~s@~s']},"
+ "{sync_nodes_timeout, 1000},"
+ "{global_groups, []} ] }] .~n",
[Ncp1, M, Ncp2, M, Ncp3, M,
Ncpx, M, Ncpy, M, Ncpz, M]).
@@ -1303,8 +1262,8 @@ config_sync(Fd, Ncp1, Ncp2, Ncp3, Ncpx, Ncpy, Ncpz) ->
config_comp(Fd, Ncp1, Ncp2, Ncp3, Ncpx, Ncpy, Ncpz) ->
M = from($@, atom_to_list(node())),
io:format(Fd, "[{kernel, [{sync_nodes_optional, ['~s@~s','~s@~s','~s@~s', "
- " '~s@~s','~s@~s','~s@~s']},"
- "{sync_nodes_timeout, 1000} ] }] .~n",
+ " '~s@~s','~s@~s','~s@~s']},"
+ "{sync_nodes_timeout, 1000} ] }] .~n",
[Ncp1, M, Ncp2, M, Ncp3, M,
Ncpx, M, Ncpy, M, Ncpz, M]).
@@ -1325,7 +1284,7 @@ start_proc(Name) ->
receive
{Pid, Res} -> {Pid, Res}
end.
-
+
start_proc_rereg(Name) ->
Pid = spawn(?MODULE, init2, [self(), Name]),
receive
@@ -1437,9 +1396,9 @@ assert_loop(Cp, CpName, Name, NamePid, Loop) ->
Loop ->
ok;
Other1 ->
- test_server:fail(Other1)
+ ct:fail(Other1)
after 5000 ->
- test_server:fail(timeout)
+ ct:fail(timeout)
end.
loop_until_true(Fun) ->
diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl
index eb6cb06622..dd6348c610 100644
--- a/lib/kernel/test/heart_SUITE.erl
+++ b/lib/kernel/test/heart_SUITE.erl
@@ -38,30 +38,29 @@
-define(DEFAULT_TIMEOUT_SECS, 120).
init_per_testcase(_Func, Config) ->
- Dog=test_server:timetrap(test_server:seconds(?DEFAULT_TIMEOUT_SECS)),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Func, Config) ->
+end_per_testcase(_Func, _Config) ->
Nodes = nodes(),
lists:foreach(fun(X) ->
NNam = list_to_atom(hd(string:tokens(atom_to_list(X),"@"))),
case NNam of
heart_test ->
- ?t:format(1, "WARNING: Killed ~p~n", [X]),
+ ct:pal(?HI_VERBOSITY, "WARNING: Killed ~p~n", [X]),
rpc:cast(X, erlang, halt, []);
_ ->
ok
end
- end, Nodes),
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+ end, Nodes).
%%-----------------------------------------------------------------
%% Test suite for heart.
%% Should be started in a CC view with:
%% erl -sname master -rsh ctrsh
%%-----------------------------------------------------------------
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() -> [
start, restart, reboot,
@@ -97,7 +96,7 @@ end_per_suite(Config) when is_list(Config) ->
start_check(Type, Name) ->
start_check(Type, Name, []).
start_check(Type, Name, Envs) ->
- Args = case ?t:os_type() of
+ Args = case test_server:os_type() of
{win32,_} ->
"+t50000 -heart " ++ env_encode([{"HEART_COMMAND", no_reboot}|Envs]);
_ ->
@@ -107,32 +106,30 @@ start_check(Type, Name, Envs) ->
loose ->
loose_node:start(Name, Args, ?DEFAULT_TIMEOUT_SECS);
_ ->
- ?t:start_node(Name, Type, [{args, Args}])
+ test_server:start_node(Name, Type, [{args, Args}])
end,
erlang:monitor_node(Node, true),
case rpc:call(Node, erlang, whereis, [heart]) of
Pid when is_pid(Pid) ->
ok;
_ ->
- test_server:fail(heart_not_started)
+ ct:fail(heart_not_started)
end,
{ok, Node}.
-start(doc) -> [];
-start(suite) -> {req, [{time, 10}]};
start(Config) when is_list(Config) ->
{ok, Node} = start_check(slave, heart_test),
rpc:call(Node, init, reboot, []),
receive
{nodedown, Node} -> ok
- after 2000 -> test_server:fail(node_not_closed)
+ after 2000 -> ct:fail(node_not_closed)
end,
- test_server:sleep(5000),
+ timer:sleep(5000),
case net_adm:ping(Node) of
pang ->
ok;
_ ->
- test_server:fail(node_rebooted)
+ ct:fail(node_rebooted)
end,
test_server:stop_node(Node).
@@ -145,14 +142,6 @@ start(Config) when is_list(Config) ->
%% restart
%% Purpose:
%% Check that a node is up and running after a init:restart/0
-restart(doc) -> [];
-restart(suite) ->
- case ?t:os_type() of
- {Fam, _} when Fam == unix; Fam == win32 ->
- {req, [{time,10}]};
- _ ->
- {skip, "Only run on unix and win32"}
- end;
restart(Config) when is_list(Config) ->
{ok, Node} = start_check(loose, heart_test),
rpc:call(Node, init, restart, []),
@@ -160,17 +149,15 @@ restart(Config) when is_list(Config) ->
{nodedown, Node} ->
ok
after 2000 ->
- test_server:fail(node_not_closed)
+ ct:fail(node_not_closed)
end,
- test_server:sleep(5000),
+ timer:sleep(5000),
node_check_up_down(Node, 2000),
loose_node:stop(Node).
%% reboot
%% Purpose:
%% Check that a node is up and running after a init:reboot/0
-reboot(doc) -> [];
-reboot(suite) -> {req, [{time, 10}]};
reboot(Config) when is_list(Config) ->
{ok, Node} = start_check(slave, heart_test),
@@ -182,9 +169,9 @@ reboot(Config) when is_list(Config) ->
{nodedown, Node} ->
ok
after 2000 ->
- test_server:fail(node_not_closed)
+ ct:fail(node_not_closed)
end,
- test_server:sleep(5000),
+ timer:sleep(5000),
node_check_up_down(Node, 2000),
ok.
@@ -196,7 +183,6 @@ reboot(Config) when is_list(Config) ->
%% May currently dump core in beam debug build due to lock-order violation
%% This should be removed when a non-lockad information retriever is implemented
%% for crash dumps
-node_start_immediately_after_crash(suite) -> {req, [{time, 10}]};
node_start_immediately_after_crash(Config) when is_list(Config) ->
Config2 = ignore_cores:setup(?MODULE, node_start_immediately_after_crash, Config, true),
try
@@ -229,13 +215,13 @@ node_start_immediately_after_crash_test(Config) when is_list(Config) ->
T0 = now(),
receive {nodedown, Node} ->
- test_server:format("Took ~.2f s. for node to go down~n", [timer:now_diff(now(), T0)/1000000]),
+ io:format("Took ~.2f s. for node to go down~n", [timer:now_diff(now(), T0)/1000000]),
ok
%% timeout is very liberal here. nodedown is received in about 1 s. on linux (palantir)
%% and in about 10 s. on solaris (carcharoth)
- after (15000*test_server:timetrap_scale_factor()) -> test_server:fail(node_not_closed)
+ after (15000*test_server:timetrap_scale_factor()) -> ct:fail(node_not_closed)
end,
- test_server:sleep(3000),
+ timer:sleep(3000),
node_check_up_down(Node, 2000),
loose_node:stop(Node).
@@ -248,7 +234,6 @@ node_start_immediately_after_crash_test(Config) when is_list(Config) ->
%% May currently dump core in beam debug build due to lock-order violation
%% This should be removed when a non-lockad information retriever is implemented
%% for crash dumps
-node_start_soon_after_crash(suite) -> {req, [{time, 10}]};
node_start_soon_after_crash(Config) when is_list(Config) ->
Config2 = ignore_cores:setup(?MODULE, node_start_soon_after_crash, Config, true),
try
@@ -278,9 +263,9 @@ node_start_soon_after_crash_test(Config) when is_list(Config) ->
rpc:cast(Node, Mod, do, []),
receive {nodedown, Node} -> ok
- after (15000*test_server:timetrap_scale_factor()) -> test_server:fail(node_not_closed)
+ after (15000*test_server:timetrap_scale_factor()) -> ct:fail(node_not_closed)
end,
- test_server:sleep(20000),
+ timer:sleep(20000),
node_check_up_down(Node, 15000),
loose_node:stop(Node).
@@ -293,14 +278,13 @@ node_check_up_down(Node, Tmo) ->
receive
{nodedown, Node} -> ok
after Tmo ->
- test_server:fail(node_not_closed2)
+ ct:fail(node_not_closed2)
end;
_ ->
- test_server:fail(node_not_rebooted)
+ ct:fail(node_not_rebooted)
end.
%% Only tests bad command, correct behaviour is tested in reboot/1.
-set_cmd(suite) -> [];
set_cmd(Config) when is_list(Config) ->
{ok, Node} = start_check(slave, heart_test),
Cmd = wrong_atom,
@@ -314,7 +298,6 @@ set_cmd(Config) when is_list(Config) ->
stop_node(Node),
ok.
-clear_cmd(suite) -> {req,[{time,15}]};
clear_cmd(Config) when is_list(Config) ->
{ok, Node} = start_check(slave, heart_test),
ok = rpc:call(Node, heart, set_cmd,
@@ -325,14 +308,14 @@ clear_cmd(Config) when is_list(Config) ->
{nodedown, Node} ->
ok
after 2000 ->
- test_server:fail(node_not_closed)
+ ct:fail(node_not_closed)
end,
- test_server:sleep(5000),
+ timer:sleep(5000),
case net_adm:ping(Node) of
pong ->
erlang:monitor_node(Node, true);
_ ->
- test_server:fail(node_not_rebooted)
+ ct:fail(node_not_rebooted)
end,
ok = rpc:call(Node, heart, set_cmd,
["erl -noshell -heart " ++ name(Node) ++ "&"]),
@@ -342,18 +325,17 @@ clear_cmd(Config) when is_list(Config) ->
{nodedown, Node} ->
ok
after 2000 ->
- test_server:fail(node_not_closed)
+ ct:fail(node_not_closed)
end,
- test_server:sleep(5000),
+ timer:sleep(5000),
case net_adm:ping(Node) of
pang ->
ok;
_ ->
- test_server:fail(node_rebooted)
+ ct:fail(node_rebooted)
end,
ok.
-get_cmd(suite) -> [];
get_cmd(Config) when is_list(Config) ->
{ok, Node} = start_check(slave, heart_test),
Cmd = "test",
@@ -391,7 +373,7 @@ callback_api(Config) when is_list(Config) ->
{ok, {M2,F2}} = rpc:call(Node, heart, get_callback, []),
ok = rpc:call(Node, heart, set_callback, [M2,F3]),
receive {nodedown, Node} -> ok
- after 5000 -> test_server:fail(node_not_killed)
+ after 5000 -> ct:fail(node_not_killed)
end,
stop_node(Node),
ok.
@@ -425,15 +407,13 @@ options_api(Config) when is_list(Config) ->
ok.
-dont_drop(suite) ->
%%% Removed as it may crash epmd/distribution in colourful
%%% ways. While we ARE finding out WHY, it would
%%% be nice for others to be able to run the kernel test suite
-%%% without "exploding machines", so thats why I removed it for now.
- [];
-dont_drop(doc) ->
- ["Tests that the heart command does not get dropped when ",
- "set just before halt on very high I/O load."];
+%%% without "exploding machines", so that's why I removed it for now.
+
+%% Tests that the heart command does not get dropped when
+%% set just before halt on very high I/O load..
dont_drop(Config) when is_list(Config) ->
%%% Have to do it some times to make it happen...
[ok,ok,ok,ok,ok,ok,ok,ok,ok,ok] = do_dont_drop(Config,10),
@@ -455,7 +435,7 @@ do_dont_drop(Config,N) ->
Env = [{"HEART_COMMAND", FirstCmd}],
Func = "start_heart_stress",
Arg = NN3 ++ "@" ++ Host ++ " " ++
- filename:join(?config(data_dir, Config), "simple_echo"),
+ filename:join(proplists:get_value(data_dir, Config), "simple_echo"),
start_node_run(Name,Env,Func,Arg),
case wait_for_any_of(list_to_atom(NN2 ++ "@" ++ Host),
list_to_atom(NN3 ++ "@" ++ Host)) of
@@ -488,11 +468,8 @@ wait_for_any_of(N1,N2,Times) ->
end.
-kill_pid(suite) ->
- [];
-kill_pid(doc) ->
- ["Tests that heart kills the old erlang node before executing ",
- "heart command."];
+%% Tests that heart kills the old erlang node before executing
+%% heart command.
kill_pid(Config) when is_list(Config) ->
ok = do_kill_pid(Config).
diff --git a/lib/kernel/test/ignore_cores.erl b/lib/kernel/test/ignore_cores.erl
index 6a37b48189..24b95e273c 100644
--- a/lib/kernel/test/ignore_cores.erl
+++ b/lib/kernel/test/ignore_cores.erl
@@ -53,7 +53,7 @@ init(Config) ->
fini(Config) ->
#ignore_cores{org_cwd = OrgCWD,
org_path = OrgPath,
- org_pwd_env = OrgPWD} = ?config(ignore_cores, Config),
+ org_pwd_env = OrgPWD} = proplists:get_value(ignore_cores, Config),
ok = file:set_cwd(OrgCWD),
true = code:set_path(OrgPath),
case OrgPWD of
@@ -70,10 +70,10 @@ setup(Suite, Testcase, Config, SetCwd) when is_atom(Suite),
is_list(Config) ->
#ignore_cores{org_cwd = OrgCWD,
org_path = OrgPath,
- org_pwd_env = OrgPWD} = ?config(ignore_cores, Config),
+ org_pwd_env = OrgPWD} = proplists:get_value(ignore_cores, Config),
Path = lists:map(fun (".") -> OrgCWD; (Dir) -> Dir end, OrgPath),
true = code:set_path(Path),
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
IgnDir = filename:join([PrivDir,
atom_to_list(Suite)
++ "_"
@@ -94,7 +94,7 @@ setup(Suite, Testcase, Config, SetCwd) when is_atom(Suite),
end,
ok = file:write_file(filename:join([IgnDir, "ignore_core_files"]), <<>>),
%% cores are dumped in /cores on MacOS X
- CoresDir = case {?t:os_type(), filelib:is_dir("/cores")} of
+ CoresDir = case {test_server:os_type(), filelib:is_dir("/cores")} of
{{unix,darwin}, true} ->
filelib:fold_files("/cores",
"^core.*$",
@@ -119,7 +119,7 @@ restore(Config) ->
org_path = OrgPath,
org_pwd_env = OrgPWD,
ign_dir = IgnDir,
- cores_dir = CoresDir} = ?config(ignore_cores, Config),
+ cores_dir = CoresDir} = proplists:get_value(ignore_cores, Config),
try
case CoresDir of
false ->
@@ -155,5 +155,5 @@ restore(Config) ->
dir(Config) ->
- #ignore_cores{ign_dir = Dir} = ?config(ignore_cores, Config),
+ #ignore_cores{ign_dir = Dir} = proplists:get_value(ignore_cores, Config),
Dir.
diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl
index 0a36bc9673..ee10747b0a 100644
--- a/lib/kernel/test/inet_SUITE.erl
+++ b/lib/kernel/test/inet_SUITE.erl
@@ -46,7 +46,9 @@
kill_gethost/0, parallell_gethost/0, test_netns/0]).
-export([init_per_testcase/2, end_per_testcase/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[t_gethostbyaddr, t_gethostbyname, t_getaddr,
@@ -97,35 +99,30 @@ init_per_testcase(lookup_bad_search_option, Config) ->
Prev = ets:lookup(Db, Key),
ets:delete(Db, Key),
ets:insert(Db, {Key,[lookup_bad_search_option]}),
- ?t:format("Misconfigured resolver lookup order", []),
- Dog = test_server:timetrap(test_server:seconds(60)),
- [{Key,Prev},{watchdog,Dog}|Config];
+ io:format("Misconfigured resolver lookup order", []),
+ [{Key,Prev}|Config];
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:seconds(60)),
- [{watchdog,Dog}|Config].
+ Config.
end_per_testcase(lookup_bad_search_option, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
Db = inet_db,
Key = res_lookup,
- Prev = ?config(Key, Config),
+ Prev = proplists:get_value(Key, Config),
ets:delete(Db, Key),
ets:insert(Db, Prev),
- ?t:format("Restored resolver lookup order", []);
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+ io:format("Restored resolver lookup order", []);
+end_per_testcase(_Func, _Config) ->
+ ok.
t_gethostbyaddr() ->
required(v4).
-t_gethostbyaddr(doc) -> "Test the inet:gethostbyaddr/1 function.";
+%% Test the inet:gethostbyaddr/1 function.
t_gethostbyaddr(Config) when is_list(Config) ->
{Name,FullName,IPStr,{A,B,C,D}=IP,Aliases,_,_} = ct:get_config(test_host_ipv4_only),
Rname = integer_to_list(D) ++ "." ++
- integer_to_list(C) ++ "." ++
- integer_to_list(B) ++ "." ++
- integer_to_list(A) ++ ".in-addr.arpa",
+ integer_to_list(C) ++ "." ++
+ integer_to_list(B) ++ "." ++
+ integer_to_list(A) ++ ".in-addr.arpa",
{ok,HEnt} = inet:gethostbyaddr(IPStr),
{ok,HEnt} = inet:gethostbyaddr(IP),
{error,Error} = inet:gethostbyaddr(Name),
@@ -155,79 +152,77 @@ t_gethostbyaddr(Config) when is_list(Config) ->
ok.
t_gethostbyaddr_v6() -> required(v6).
-t_gethostbyaddr_v6(doc) -> "Test the inet:gethostbyaddr/1 inet6 function.";
+%% Test the inet:gethostbyaddr/1 inet6 function.
t_gethostbyaddr_v6(Config) when is_list(Config) ->
- ?line {Name6, FullName6, IPStr6, IP6, Aliases6} =
+ {Name6, FullName6, IPStr6, IP6, Aliases6} =
ct:get_config(test_host_ipv6_only),
- ?line case inet:gethostbyaddr(IPStr6) of
+ case inet:gethostbyaddr(IPStr6) of
%% Even if IPv6 is not supported, the native resolver may succeed
%% looking up the host. DNS lookup will probably fail.
{error,nxdomain} ->
{skip, "IPv6 test fails! IPv6 not supported on this host!?"};
{ok,HEnt6} ->
- ?line {ok,HEnt6} = inet:gethostbyaddr(IP6),
- ?line {error,Error6} = inet:gethostbyaddr(Name6),
- ?line ok = io:format("Failure reason: ~p: ~s",
- [Error6, inet:format_error(Error6)]),
- ?line HEnt6_ = HEnt6#hostent{h_addrtype = inet6,
- h_length = 16,
- h_addr_list = [IP6]},
- ?line HEnt6_ = HEnt6,
- ?line check_elems([{HEnt6#hostent.h_name,[Name6,FullName6]},
- {HEnt6#hostent.h_aliases,[[],Aliases6]}]),
-
- ?line {_DName6, _DFullName6, DIPStr6, DIP6, _} =
- ct:get_config(test_dummy_ipv6_host),
- ?line {error,nxdomain} = inet:gethostbyaddr(DIPStr6),
- ?line {error,nxdomain} = inet:gethostbyaddr(DIP6),
+ {ok,HEnt6} = inet:gethostbyaddr(IP6),
+ {error,Error6} = inet:gethostbyaddr(Name6),
+ ok = io:format("Failure reason: ~p: ~s",
+ [Error6, inet:format_error(Error6)]),
+ HEnt6_ = HEnt6#hostent{h_addrtype = inet6,
+ h_length = 16,
+ h_addr_list = [IP6]},
+ HEnt6_ = HEnt6,
+ check_elems([{HEnt6#hostent.h_name,[Name6,FullName6]},
+ {HEnt6#hostent.h_aliases,[[],Aliases6]}]),
+
+ {_DName6, _DFullName6, DIPStr6, DIP6, _} =
+ ct:get_config(test_dummy_ipv6_host),
+ {error,nxdomain} = inet:gethostbyaddr(DIPStr6),
+ {error,nxdomain} = inet:gethostbyaddr(DIP6),
ok
end.
t_gethostbyname() -> required(v4).
-t_gethostbyname(doc) -> "Test the inet:gethostbyname/1 function.";
-t_gethostbyname(suite) -> [];
+%% Test the inet:gethostbyname/1 function.
t_gethostbyname(Config) when is_list(Config) ->
- ?line {Name,FullName,IPStr,IP,Aliases,IP_46_Str,_} =
+ {Name,FullName,IPStr,IP,Aliases,IP_46_Str,_} =
ct:get_config(test_host_ipv4_only),
- ?line {ok,_} = inet:gethostbyname(IPStr),
- ?line {ok,HEnt} = inet:gethostbyname(Name),
- ?line {ok,HEnt} = inet:gethostbyname(list_to_atom(Name)),
- ?line HEnt_ = HEnt#hostent{h_addrtype = inet,
- h_length = 4,
- h_addr_list = [IP]},
-
- ?line HEnt_ = HEnt,
- ?line check_elems([{HEnt#hostent.h_name,[Name,FullName]},
- {HEnt#hostent.h_aliases,[[],Aliases]}]),
- ?line {ok,HEntF} = inet:gethostbyname(FullName),
- ?line HEntF_ = HEntF#hostent{h_name = FullName,
- h_addrtype = inet,
- h_length = 4,
- h_addr_list = [IP]},
- ?line HEntF_ = HEntF,
- ?line check_elems([{HEnt#hostent.h_aliases,[[],Aliases]}]),
+ {ok,_} = inet:gethostbyname(IPStr),
+ {ok,HEnt} = inet:gethostbyname(Name),
+ {ok,HEnt} = inet:gethostbyname(list_to_atom(Name)),
+ HEnt_ = HEnt#hostent{h_addrtype = inet,
+ h_length = 4,
+ h_addr_list = [IP]},
+
+ HEnt_ = HEnt,
+ check_elems([{HEnt#hostent.h_name,[Name,FullName]},
+ {HEnt#hostent.h_aliases,[[],Aliases]}]),
+ {ok,HEntF} = inet:gethostbyname(FullName),
+ HEntF_ = HEntF#hostent{h_name = FullName,
+ h_addrtype = inet,
+ h_length = 4,
+ h_addr_list = [IP]},
+ HEntF_ = HEntF,
+ check_elems([{HEnt#hostent.h_aliases,[[],Aliases]}]),
%%
- ?line FullNameU = toupper(FullName),
- ?line {ok,HEntU} = inet:gethostbyname(FullNameU),
- ?line FullNameU = toupper(HEntU#hostent.h_name),
- ?line #hostent{
+ FullNameU = toupper(FullName),
+ {ok,HEntU} = inet:gethostbyname(FullNameU),
+ FullNameU = toupper(HEntU#hostent.h_name),
+ #hostent{
h_addrtype = inet,
h_length = 4,
h_addr_list = [IP]} = HEntU,
- ?line check_elems(
- [{[toupper(H) || H <- HEntU#hostent.h_aliases],
- [[],[toupper(A) || A <- Aliases]]}]),
+ check_elems(
+ [{[toupper(H) || H <- HEntU#hostent.h_aliases],
+ [[],[toupper(A) || A <- Aliases]]}]),
- ?line {DName, _DFullName, _DIPStr, _DIP, _, _, _} =
+ {DName, _DFullName, _DIPStr, _DIP, _, _, _} =
ct:get_config(test_dummy_host),
- ?line {error,nxdomain} = inet:gethostbyname(DName),
- ?line {error,nxdomain} = inet:gethostbyname(IP_46_Str),
+ {error,nxdomain} = inet:gethostbyname(DName),
+ {error,nxdomain} = inet:gethostbyname(IP_46_Str),
ok.
t_gethostbyname_v6() -> required(v6).
-t_gethostbyname_v6(doc) -> "Test the inet:gethostbyname/1 inet6 function.";
-t_gethostbyname_v6(suite) -> [];
+%% Test the inet:gethostbyname/1 inet6 function.
t_gethostbyname_v6(Config) when is_list(Config) ->
{Name, FullName, IPStr, IP, Aliases} =
ct:get_config(test_host_ipv6_only),
@@ -287,33 +282,31 @@ check_elem(Val, [Val|_], _) -> ok;
check_elem(Val, [_|Tests], Tests0) ->
check_elem(Val, Tests, Tests0);
check_elem(Val, [], Tests0) ->
- ?t:fail({no_match,Val,Tests0}).
+ ct:fail({no_match,Val,Tests0}).
t_getaddr() -> required(v4).
-t_getaddr(doc) -> "Test the inet:getaddr/2 function.";
-t_getaddr(suite) -> [];
+%% Test the inet:getaddr/2 function.
t_getaddr(Config) when is_list(Config) ->
- ?line {Name,FullName,IPStr,IP,_,IP_46_Str,IP46} =
+ {Name,FullName,IPStr,IP,_,IP_46_Str,IP46} =
ct:get_config(test_host_ipv4_only),
- ?line {ok,IP} = inet:getaddr(list_to_atom(Name), inet),
- ?line {ok,IP} = inet:getaddr(Name, inet),
- ?line {ok,IP} = inet:getaddr(FullName, inet),
- ?line {ok,IP} = inet:getaddr(IP, inet),
- ?line {ok,IP} = inet:getaddr(IPStr, inet),
- ?line {error,nxdomain} = inet:getaddr(IP_46_Str, inet),
- ?line {error,eafnosupport} = inet:getaddr(IP46, inet),
-
- ?line {DName, DFullName, DIPStr, DIP, _, _, _} = ct:get_config(test_dummy_host),
- ?line {error,nxdomain} = inet:getaddr(DName, inet),
- ?line {error,nxdomain} = inet:getaddr(DFullName, inet),
- ?line {ok,DIP} = inet:getaddr(DIPStr, inet),
- ?line {ok,DIP} = inet:getaddr(DIP, inet),
+ {ok,IP} = inet:getaddr(list_to_atom(Name), inet),
+ {ok,IP} = inet:getaddr(Name, inet),
+ {ok,IP} = inet:getaddr(FullName, inet),
+ {ok,IP} = inet:getaddr(IP, inet),
+ {ok,IP} = inet:getaddr(IPStr, inet),
+ {error,nxdomain} = inet:getaddr(IP_46_Str, inet),
+ {error,eafnosupport} = inet:getaddr(IP46, inet),
+
+ {DName, DFullName, DIPStr, DIP, _, _, _} = ct:get_config(test_dummy_host),
+ {error,nxdomain} = inet:getaddr(DName, inet),
+ {error,nxdomain} = inet:getaddr(DFullName, inet),
+ {ok,DIP} = inet:getaddr(DIPStr, inet),
+ {ok,DIP} = inet:getaddr(DIP, inet),
ok.
t_getaddr_v6() -> required(v4) ++ required(v6).
-t_getaddr_v6(doc) -> "Test the inet:getaddr/2 function.";
-t_getaddr_v6(suite) -> [];
+%% Test the inet:getaddr/2 function.
t_getaddr_v6(Config) when is_list(Config) ->
{Name,FullName,IPStr,IP,_} =
ct:get_config(test_host_ipv6_only),
@@ -341,16 +334,15 @@ t_getaddr_v6(Config) when is_list(Config) ->
end.
ipv4_to_ipv6() -> required(v4).
-ipv4_to_ipv6(doc) -> "Test if IPv4 address is converted to IPv6 address.";
-ipv4_to_ipv6(suite) -> [];
+%% Test if IPv4 address is converted to IPv6 address.
ipv4_to_ipv6(Config) when is_list(Config) ->
%% Test what happens if an IPv4 address is looked up in an IPv6 context.
%% If the native resolver succeeds to look it up, an IPv4 compatible
%% address should be returned. If no IPv6 support on this host, an
%% error should beturned.
- ?line {_Name,_FullName,IPStr,_IP,Aliases,IP_46_Str,IP_46} =
+ {_Name,_FullName,IPStr,_IP,Aliases,IP_46_Str,IP_46} =
ct:get_config(test_host_ipv4_only),
- ?line IP4to6Res =
+ IP4to6Res =
case inet:getaddr(IPStr, inet6) of
{ok,IP_46} ->
io:format("IPv4->IPv6: success~n"),
@@ -362,36 +354,34 @@ ipv4_to_ipv6(Config) when is_list(Config) ->
io:format("IPv6->IPv4: eafnosupport~n"),
E;
Other ->
- ?line ?t:fail({ipv4_to_ipv6_lookup_failed,Other})
+ ct:fail({ipv4_to_ipv6_lookup_failed,Other})
end,
- ?line case {IP4to6Res,inet:gethostbyname(IPStr, inet6)} of
- {true,{ok,HEnt}} ->
- ?line HEnt_ = HEnt#hostent{h_addrtype = inet6,
- h_length = 16,
- h_addr_list = [IP_46]},
- ?line HEnt_ = HEnt,
- ?line check_elems([{HEnt#hostent.h_name,[IP_46_Str,IPStr]},
- {HEnt#hostent.h_aliases,[[],Aliases]}]);
- {_,IP4to6Res} -> ok
- end,
+ case {IP4to6Res,inet:gethostbyname(IPStr, inet6)} of
+ {true,{ok,HEnt}} ->
+ HEnt_ = HEnt#hostent{h_addrtype = inet6,
+ h_length = 16,
+ h_addr_list = [IP_46]},
+ HEnt_ = HEnt,
+ check_elems([{HEnt#hostent.h_name,[IP_46_Str,IPStr]},
+ {HEnt#hostent.h_aliases,[[],Aliases]}]);
+ {_,IP4to6Res} -> ok
+ end,
ok.
-host_and_addr() -> required(hosts).
-host_and_addr(doc) -> ["Test looking up hosts and addresses. Use 'ypcat hosts' ",
- "or the local eqivalent to find all hosts."];
-host_and_addr(suite) -> [];
-host_and_addr(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:minutes(5)),
+host_and_addr() ->
+ [{timetrap,{minutes,5}}|required(hosts)].
- ?line lists:foreach(fun try_host/1, get_hosts(Config)),
- ?line test_server:timetrap_cancel(Dog),
+%% Test looking up hosts and addresses. Use 'ypcat hosts'
+%% or the local eqivalent to find all hosts.
+host_and_addr(Config) when is_list(Config) ->
+ lists:foreach(fun try_host/1, get_hosts(Config)),
ok.
try_host({Ip0, Host}) ->
- ?line {ok,Ip} = inet:getaddr(Ip0, inet),
- ?line {ok,{hostent, _, _, inet, _, Ips1}} = inet:gethostbyaddr(Ip),
- ?line {ok,{hostent, _, _, inet, _, _Ips2}} = inet:gethostbyname(Host),
- ?line true = lists:member(Ip, Ips1),
+ {ok,Ip} = inet:getaddr(Ip0, inet),
+ {ok,{hostent, _, _, inet, _, Ips1}} = inet:gethostbyaddr(Ip),
+ {ok,{hostent, _, _, inet, _, _Ips2}} = inet:gethostbyname(Host),
+ true = lists:member(Ip, Ips1),
ok.
%% Get all hosts from the system using 'ypcat hosts' or the local
@@ -438,18 +428,18 @@ get_hosts([C|Rest], Cur, Ip, Result) ->
get_hosts(Rest, [C|Cur], Ip, Result);
get_hosts([], _, _, Result) ->
Result.
-
+
parse_hosts(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line HostFile = filename:join(DataDir, "hosts"),
- ?line inet_parse:hosts(HostFile),
- ?line HostFileErr1 = filename:join(DataDir, "hosts_err1"),
- ?line inet_parse:hosts(HostFileErr1),
- ?line Resolv = filename:join(DataDir,"resolv.conf"),
- ?line inet_parse:resolv(Resolv),
- ?line ResolvErr1 = filename:join(DataDir,"resolv.conf.err1"),
- ?line inet_parse:resolv(ResolvErr1).
+ DataDir = proplists:get_value(data_dir,Config),
+ HostFile = filename:join(DataDir, "hosts"),
+ inet_parse:hosts(HostFile),
+ HostFileErr1 = filename:join(DataDir, "hosts_err1"),
+ inet_parse:hosts(HostFileErr1),
+ Resolv = filename:join(DataDir,"resolv.conf"),
+ inet_parse:resolv(Resolv),
+ ResolvErr1 = filename:join(DataDir,"resolv.conf.err1"),
+ inet_parse:resolv(ResolvErr1).
parse_address(Config) when is_list(Config) ->
V4Strict =
@@ -521,10 +511,10 @@ parse_address(Config) when is_list(Config) ->
{{0,0,0,0,0,65535,258,65534},"::FFFF:1.2.255.254"},
{{16#ffff,16#ffff,16#ffff,16#ffff,16#ffff,16#ffff,16#ffff,16#ffff},
"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"}
- |[{{D2,0,0,0,0,P,(D1 bsl 8) bor D2,(D3 bsl 8) bor D4},
- erlang:integer_to_list(D2, 16)++"::"++Q++S}
- || {{D1,D2,D3,D4},S} <- V4Strict,
- {P,Q} <- [{0,""},{16#17,"17:"},{16#ff0,"0ff0:"}]]],
+ |[{{D2,0,0,0,0,P,(D1 bsl 8) bor D2,(D3 bsl 8) bor D4},
+ erlang:integer_to_list(D2, 16)++"::"++Q++S}
+ || {{D1,D2,D3,D4},S} <- V4Strict,
+ {P,Q} <- [{0,""},{16#17,"17:"},{16#ff0,"0ff0:"}]]],
V4Sloppy =
[{{10,1,16#98,16#76},"10.0x019876"},
{{8#12,1,8#130,8#321},"012.01.054321"},
@@ -624,42 +614,37 @@ parse_strict_address(Config) when is_list(Config) ->
{ok, {3089,3106,23603,50240,0,0,119,136}} =
inet:parse_strict_address("c11:0c22:5c33:c440::077:0088").
-t_gethostnative(suite) ->[];
-t_gethostnative(doc) ->[];
t_gethostnative(Config) when is_list(Config) ->
-%% this will result in 26 bytes sent which causes problem in Windows
-%% if the port-program has not assured stdin to be read in BINARY mode
-%% OTP-2555
- ?line case inet_gethost_native:gethostbyname(
- "a23456789012345678901234") of
+ %% this will result in 26 bytes sent which causes problem in Windows
+ %% if the port-program has not assured stdin to be read in BINARY mode
+ %% OTP-2555
+ case inet_gethost_native:gethostbyname(
+ "a23456789012345678901234") of
{error,notfound} ->
- ?line ok;
+ ok;
{error,no_data} ->
- ?line ok
+ ok
end.
-gethostnative_parallell(suite) ->
- [];
-gethostnative_parallell(doc) ->
- ["Check that the emulator survives crashes in gethost_native"];
+%% Check that the emulator survives crashes in gethost_native.
gethostnative_parallell(Config) when is_list(Config) ->
- ?line {ok,Hostname} = inet:gethostname(),
- ?line {ok,_} = inet:gethostbyname(Hostname),
+ {ok,Hostname} = inet:gethostname(),
+ {ok,_} = inet:gethostbyname(Hostname),
case whereis(inet_gethost_native) of
Pid when is_pid(Pid) ->
- ?line do_gethostnative_parallell();
+ do_gethostnative_parallell();
_ ->
- ?line {skipped, "Not running native gethostbyname"}
+ {skipped, "Not running native gethostbyname"}
end.
do_gethostnative_parallell() ->
- ?line PA = filename:dirname(code:which(?MODULE)),
- ?line {ok,Node} = ?t:start_node(gethost_parallell, slave,
- [{args, "-pa " ++ PA}]),
- ?line ok = rpc:call(Node, ?MODULE, parallell_gethost, []),
- ?line receive after 10000 -> ok end,
- ?line pong = net_adm:ping(Node),
- ?line ?t:stop_node(Node),
+ PA = filename:dirname(code:which(?MODULE)),
+ {ok,Node} = test_server:start_node(gethost_parallell, slave,
+ [{args, "-pa " ++ PA}]),
+ ok = rpc:call(Node, ?MODULE, parallell_gethost, []),
+ receive after 10000 -> ok end,
+ pong = net_adm:ping(Node),
+ test_server:stop_node(Node),
ok.
parallell_gethost() ->
@@ -752,7 +737,7 @@ wait_for_gethost(N) ->
%% This is what I call an exit tuple :)
exit({inet,gethostbyname, returned, Otherwise, 'when',
'N','=',N,'and','hostname','=',Hostname,'and',
- kill_gethost_n,'=',get(kill_gethost_n)})
+ kill_gethost_n,'=',get(kill_gethost_n)})
end,
case whereis(inet_gethost_native) of
Pid when is_pid(Pid) ->
@@ -764,23 +749,20 @@ wait_for_gethost(N) ->
end,
wait_for_gethost(N-1)
end.
-
-cname_loop(suite) ->
- [];
-cname_loop(doc) ->
- ["Check that the resolver handles a CNAME loop"];
+
+%% Check that the resolver handles a CNAME loop.
cname_loop(Config) when is_list(Config) ->
%% getbyname (hostent_by_domain)
- ?line ok = inet_db:add_rr("mydomain.com", in, ?S_CNAME, ttl, "mydomain.com"),
- ?line {error,nxdomain} = inet_db:getbyname("mydomain.com", ?S_A),
- ?line ok = inet_db:del_rr("mydomain.com", in, ?S_CNAME, "mydomain.com"),
+ ok = inet_db:add_rr("mydomain.com", in, ?S_CNAME, ttl, "mydomain.com"),
+ {error,nxdomain} = inet_db:getbyname("mydomain.com", ?S_A),
+ ok = inet_db:del_rr("mydomain.com", in, ?S_CNAME, "mydomain.com"),
%% res_hostent_by_domain
RR = #dns_rr{domain = "mydomain.com",
class = in,
type = ?S_CNAME,
data = "mydomain.com"},
Rec = #dns_rec{anlist = [RR]},
- ?line {error,nxdomain} = inet_db:res_hostent_by_domain("mydomain.com", ?S_A, Rec),
+ {error,nxdomain} = inet_db:res_hostent_by_domain("mydomain.com", ?S_A, Rec),
ok.
@@ -795,77 +777,73 @@ cname_loop(Config) when is_list(Config) ->
lookup_processes=20}).
gethostnative_soft_restart() -> required(hosts).
-gethostnative_soft_restart(suite) ->
- [];
-gethostnative_soft_restart(doc) ->
- ["Check that no name lookups fails during soft restart "
- "of inet_gethost_native"];
+
+%% Check that no name lookups fails during soft restart
+%% of inet_gethost_native.
gethostnative_soft_restart(Config) when is_list(Config) ->
- ?line gethostnative_control(Config,
- #gethostnative_control{
- control_seq=[soft_restart]}).
+ gethostnative_control(Config,
+ #gethostnative_control{
+ control_seq=[soft_restart]}).
gethostnative_debug_level() -> required(hosts).
-gethostnative_debug_level(suite) ->
- [];
-gethostnative_debug_level(doc) ->
- ["Check that no name lookups fails during debug level change "
- "of inet_gethost_native"];
+
+%% Check that no name lookups fails during debug level change
+%% of inet_gethost_native.
gethostnative_debug_level(Config) when is_list(Config) ->
- ?line gethostnative_control(Config,
- #gethostnative_control{
- control_seq=[{debug_level,1},
- {debug_level,0}]}).
+ gethostnative_control(Config,
+ #gethostnative_control{
+ control_seq=[{debug_level,1},
+ {debug_level,0}]}).
gethostnative_control(Config, Optrec) ->
- ?line case inet_db:res_option(lookup) of
- [native] ->
- case whereis(inet_gethost_native) of
- Pid when is_pid(Pid) ->
- ?line gethostnative_control_1(Config, Optrec);
- _ ->
- ?line {skipped, "Not running native gethostbyname"}
- end;
- _ ->
- ?line {skipped, "Native not only lookup metod"}
- end.
+ case inet_db:res_option(lookup) of
+ [native] ->
+ case whereis(inet_gethost_native) of
+ Pid when is_pid(Pid) ->
+ gethostnative_control_1(Config, Optrec);
+ _ ->
+ {skipped, "Not running native gethostbyname"}
+ end;
+ _ ->
+ {skipped, "Native not only lookup metod"}
+ end.
gethostnative_control_1(Config,
#gethostnative_control{
- control_seq=Seq,
- control_interval=Interval,
- lookup_delay=Delay,
- lookup_count=Cnt,
- lookup_processes=N}) ->
- ?line {ok, Hostname} = inet:gethostname(),
- ?line {ok, _} = inet:gethostbyname(Hostname),
- ?line Hosts =
+ control_seq=Seq,
+ control_interval=Interval,
+ lookup_delay=Delay,
+ lookup_count=Cnt,
+ lookup_processes=N}) ->
+ {ok, Hostname} = inet:gethostname(),
+ {ok, _} = inet:gethostbyname(Hostname),
+ Hosts =
[Hostname|[H || {_,H} <- get_hosts(Config)]
++[H++D || H <- ["www.","www1.","www2.",""],
D <- ["erlang.org","erlang.se"]]
++[H++"cslab.ericsson.net" || H <- ["morgoth.","hades.","styx."]]],
%% Spawn some processes to do parallel lookups while
%% I repeatedly do inet_gethost_native:control/1.
- ?line TrapExit = process_flag(trap_exit, true),
- ?line gethostnative_control_2([undefined], Interval, Delay, Cnt, N, Hosts),
- ?line test_server:format(
- "First intermission: now starting control sequence ~w\n",
- [Seq]),
- ?line erlang:display(first_intermission),
- ?line gethostnative_control_2(Seq, Interval, Delay, Cnt, N, Hosts),
- ?line erlang:display(second_intermission),
- ?line test_server:format(
- "Second intermission: now stopping control sequence ~w\n",
- [Seq]),
- ?line gethostnative_control_2([undefined], Interval, Delay, Cnt, N, Hosts),
- ?line true = process_flag(trap_exit, TrapExit),
- ?line ok.
+ TrapExit = process_flag(trap_exit, true),
+ gethostnative_control_2([undefined], Interval, Delay, Cnt, N, Hosts),
+ io:format(
+ "First intermission: now starting control sequence ~w\n",
+ [Seq]),
+ erlang:display(first_intermission),
+ gethostnative_control_2(Seq, Interval, Delay, Cnt, N, Hosts),
+ erlang:display(second_intermission),
+ io:format(
+ "Second intermission: now stopping control sequence ~w\n",
+ [Seq]),
+ gethostnative_control_2([undefined], Interval, Delay, Cnt, N, Hosts),
+ true = process_flag(trap_exit, TrapExit),
+ ok.
gethostnative_control_2(Seq, Interval, Delay, Cnt, N, Hosts) ->
- ?line Tag = make_ref(),
- ?line Parent = self(),
- ?line Lookupers =
+ Tag = make_ref(),
+ Parent = self(),
+ Lookupers =
[spawn_link(
fun () ->
lookup_loop(Hosts, Delay, Tag, Parent, Cnt, Hosts)
@@ -877,7 +855,7 @@ gethostnative_control_2(Seq, Interval, Delay, Cnt, N, Hosts) ->
gethostnative_control_3(Tag, Reason) ->
receive
{Tag,Error} ->
- ?line gethostnative_control_3(Tag, Error)
+ gethostnative_control_3(Tag, Error)
after 0 ->
Reason
end.
@@ -892,27 +870,26 @@ control_loop([Op|Ops], Interval, Tag, Lookupers, Seq) ->
Seq).
control_loop_1(Op, Interval, Tag, Lookupers) ->
- ?line
- receive
- {'EXIT',Pid,Reason} ->
- ?line case Reason of
- Tag -> % Done
- ?line control_loop_1
- (Op, Interval, Tag,
- lists:delete(Pid, Lookupers));
- _ ->
- ?line io:format("Lookuper ~p died: ~p",
- [Pid,Reason]),
- ?line test_server:fail("Lookuper died")
- end
- after Interval ->
- ?line if Op =/= undefined ->
- ?line ok = inet_gethost_native:control(Op);
- true ->
- ?line ok
- end,
- ?line Lookupers
- end.
+ receive
+ {'EXIT',Pid,Reason} ->
+ case Reason of
+ Tag -> % Done
+ control_loop_1
+ (Op, Interval, Tag,
+ lists:delete(Pid, Lookupers));
+ _ ->
+ io:format("Lookuper ~p died: ~p",
+ [Pid,Reason]),
+ ct:fail("Lookuper died")
+ end
+ after Interval ->
+ if Op =/= undefined ->
+ ok = inet_gethost_native:control(Op);
+ true ->
+ ok
+ end,
+ Lookupers
+ end.
lookup_loop(_, _Delay, Tag, _Parent, 0, _Hosts) ->
exit(Tag);
@@ -923,8 +900,8 @@ lookup_loop([H|Hs], Delay, Tag, Parent, Cnt, Hosts) ->
{ok,_Hent} -> ok;
{error,nxdomain} -> ok;
Error ->
- ?line io:format("Name lookup error for ~p for ~p: ~p",
- [self(),H,Error]),
+ io:format("Name lookup error for ~p for ~p: ~p",
+ [self(),H,Error]),
Parent ! {Tag,Error}
end,
receive
@@ -934,10 +911,7 @@ lookup_loop([H|Hs], Delay, Tag, Parent, Cnt, Hosts) ->
-lookup_bad_search_option(suite) ->
- [];
-lookup_bad_search_option(doc) ->
- ["Test lookup with erroneously configured lookup option (OTP-12133)"];
+%% Test lookup with erroneously configured lookup option (OTP-12133).
lookup_bad_search_option(Config) when is_list(Config) ->
%% Manipulation of resolver config is done in init_per_testcase
%% and end_per_testcase to ensure cleanup.
@@ -947,24 +921,21 @@ lookup_bad_search_option(Config) when is_list(Config) ->
-getif(suite) ->
- [];
-getif(doc) ->
- ["Tests basic functionality of getiflist, getif, and ifget"];
+%% Tests basic functionality of getiflist, getif, and ifget.
getif(Config) when is_list(Config) ->
- ?line case os:type() of
- {unix,Osname} ->
- ?line do_getif(Osname);
- {_,_} ->
- {skip,"inet:getif/0 probably not supported"}
- end.
+ case os:type() of
+ {unix,Osname} ->
+ do_getif(Osname);
+ {_,_} ->
+ {skip,"inet:getif/0 probably not supported"}
+ end.
do_getif(Osname) ->
- ?line {ok,Hostname} = inet:gethostname(),
- ?line {ok,Address} = inet:getaddr(Hostname, inet),
- ?line {ok,Loopback} = inet:getaddr("localhost", inet),
- ?line {ok,Interfaces} = inet:getiflist(),
- ?line HWAs =
+ {ok,Hostname} = inet:gethostname(),
+ {ok,Address} = inet:getaddr(Hostname, inet),
+ {ok,Loopback} = inet:getaddr("localhost", inet),
+ {ok,Interfaces} = inet:getiflist(),
+ HWAs =
lists:sort(
lists:foldl(
fun (I, Acc) ->
@@ -973,10 +944,10 @@ do_getif(Osname) ->
{ok,[]} -> Acc
end
end, [], Interfaces)),
- ?line io:format("HWAs = ~p~n", [HWAs]),
- ?line (Osname =/= sunos)
- andalso ((length(HWAs) > 0) orelse (?t:fail(no_HWAs))),
- ?line Addresses =
+ io:format("HWAs = ~p~n", [HWAs]),
+ (Osname =/= sunos)
+ andalso ((length(HWAs) > 0) orelse (ct:fail(no_HWAs))),
+ Addresses =
lists:sort(
lists:foldl(
fun (I, Acc) ->
@@ -985,99 +956,95 @@ do_getif(Osname) ->
{ok,[]} -> Acc
end
end, [], Interfaces)),
- ?line {ok,Getif} = inet:getif(),
- ?line Addresses = lists:sort([A || {A,_,_} <- Getif]),
- ?line true = ip_member(Address, Addresses),
- ?line true = ip_member(Loopback, Addresses),
- ?line ok.
-
-getif_ifr_name_overflow(doc) ->
- "Test long interface names do not overrun buffer";
+ {ok,Getif} = inet:getif(),
+ Addresses = lists:sort([A || {A,_,_} <- Getif]),
+ true = ip_member(Address, Addresses),
+ true = ip_member(Loopback, Addresses),
+ ok.
+
+%% Test long interface names do not overrun buffer.
getif_ifr_name_overflow(Config) when is_list(Config) ->
- ?line case os:type() of
- {unix,Osname} ->
- ?line do_getif_ifr_name_overflow(Osname);
- {_,_} ->
- {skip,"inet:ifget/2 probably not supported"}
- end.
+ case os:type() of
+ {unix,Osname} ->
+ do_getif_ifr_name_overflow(Osname);
+ {_,_} ->
+ {skip,"inet:ifget/2 probably not supported"}
+ end.
do_getif_ifr_name_overflow(_) ->
%% emulator should not crash
- ?line {ok,[]} = inet:ifget(lists:duplicate(128, "x"), [addr]),
+ {ok,[]} = inet:ifget(lists:duplicate(128, "x"), [addr]),
ok.
-getservbyname_overflow(doc) ->
- "Test long service names do not overrun buffer";
+%% Test long service names do not overrun buffer.
getservbyname_overflow(Config) when is_list(Config) ->
%% emulator should not crash
- ?line {error,einval} = inet:getservbyname(list_to_atom(lists:flatten(lists:duplicate(128, "x"))), tcp),
+ {error,einval} = inet:getservbyname(list_to_atom(lists:flatten(lists:duplicate(128, "x"))), tcp),
ok.
-getifaddrs(doc) ->
- "Test inet:gifaddrs/0";
+%% Test inet:gifaddrs/0.
getifaddrs(Config) when is_list (Config) ->
- ?line {ok,IfAddrs} = inet:getifaddrs(),
- ?line ?t:format("IfAddrs = ~p.~n", [IfAddrs]),
- ?line
- case
- {os:type(),
- [If ||
- {If,Opts} <- IfAddrs,
- lists:keymember(hwaddr, 1, Opts)]} of
- {{unix,sunos},[]} -> ok;
- {OT,[]} ->
- ?t:fail({should_have_hwaddr,OT});
- _ -> ok
- end,
- ?line Addrs =
+ {ok,IfAddrs} = inet:getifaddrs(),
+ io:format("IfAddrs = ~p.~n", [IfAddrs]),
+ case
+ {os:type(),
+ [If ||
+ {If,Opts} <- IfAddrs,
+ lists:keymember(hwaddr, 1, Opts)]} of
+ {{unix,sunos},[]} -> ok;
+ {OT,[]} ->
+ ct:fail({should_have_hwaddr,OT});
+ _ -> ok
+ end,
+ Addrs =
[element(1, A) || A <- ifaddrs(IfAddrs)],
- ?line ?t:format("Addrs = ~p.~n", [Addrs]),
- ?line [check_addr(Addr) || Addr <- Addrs],
+ io:format("Addrs = ~p.~n", [Addrs]),
+ [check_addr(Addr) || Addr <- Addrs],
ok.
check_addr(Addr)
when tuple_size(Addr) =:= 8,
element(1, Addr) band 16#FFC0 =:= 16#FE80 ->
- ?line ?t:format("Addr: ~p link local; SKIPPED!~n", [Addr]),
+ io:format("Addr: ~p link local; SKIPPED!~n", [Addr]),
ok;
check_addr(Addr) ->
- ?line ?t:format("Addr: ~p.~n", [Addr]),
- ?line Ping = "ping",
- ?line Pong = "pong",
- ?line {ok,L} = gen_tcp:listen(0, [{ip,Addr},{active,false}]),
- ?line {ok,P} = inet:port(L),
- ?line {ok,S1} = gen_tcp:connect(Addr, P, [{active,false}]),
- ?line {ok,S2} = gen_tcp:accept(L),
- ?line ok = gen_tcp:send(S2, Ping),
- ?line {ok,Ping} = gen_tcp:recv(S1, length(Ping)),
- ?line ok = gen_tcp:send(S1, Pong),
- ?line ok = gen_tcp:close(S1),
- ?line {ok,Pong} = gen_tcp:recv(S2, length(Pong)),
- ?line ok = gen_tcp:close(S2),
- ?line ok = gen_tcp:close(L),
+ io:format("Addr: ~p.~n", [Addr]),
+ Ping = "ping",
+ Pong = "pong",
+ {ok,L} = gen_tcp:listen(0, [{ip,Addr},{active,false}]),
+ {ok,P} = inet:port(L),
+ {ok,S1} = gen_tcp:connect(Addr, P, [{active,false}]),
+ {ok,S2} = gen_tcp:accept(L),
+ ok = gen_tcp:send(S2, Ping),
+ {ok,Ping} = gen_tcp:recv(S1, length(Ping)),
+ ok = gen_tcp:send(S1, Pong),
+ ok = gen_tcp:close(S1),
+ {ok,Pong} = gen_tcp:recv(S2, length(Pong)),
+ ok = gen_tcp:close(S2),
+ ok = gen_tcp:close(L),
ok.
-record(ifopts, {name,flags,addrs=[],hwaddr}).
ifaddrs([]) -> [];
ifaddrs([{If,Opts}|IOs]) ->
- ?line #ifopts{flags=Flags} = Ifopts =
+ #ifopts{flags=Flags} = Ifopts =
check_ifopts(Opts, #ifopts{name=If}),
- ?line case Flags =/= undefined andalso lists:member(up, Flags) of
- true ->
- Ifopts#ifopts.addrs;
- false ->
- []
- end++ifaddrs(IOs).
+ case Flags =/= undefined andalso lists:member(up, Flags) of
+ true ->
+ Ifopts#ifopts.addrs;
+ false ->
+ []
+ end++ifaddrs(IOs).
check_ifopts([], #ifopts{name=If,flags=Flags,addrs=Raddrs}=Ifopts) ->
Addrs = lists:reverse(Raddrs),
R = Ifopts#ifopts{addrs=Addrs},
- ?t:format("~p.~n", [R]),
+ io:format("~p.~n", [R]),
%% See how we did...
if is_list(Flags) -> ok;
true ->
- ?t:fail({flags_undefined,If})
+ ct:fail({flags_undefined,If})
end,
case lists:member(broadcast, Flags) of
true ->
@@ -1085,12 +1052,12 @@ check_ifopts([], #ifopts{name=If,flags=Flags,addrs=Raddrs}=Ifopts) ->
{_,_,_} -> A;
{T,_} when tuple_size(T) =:= 8 -> A;
_ ->
- ?t:fail({broaddr_missing,If,A})
+ ct:fail({broaddr_missing,If,A})
end || A <- Addrs];
false ->
[case A of {_,_} -> A;
_ ->
- ?t:fail({should_have_netmask,If,A})
+ ct:fail({should_have_netmask,If,A})
end || A <- Addrs]
end,
R;
@@ -1101,7 +1068,7 @@ check_ifopts([{flags,Fs}|Opts], #ifopts{flags=Flags}=Ifopts) ->
Flags ->
check_ifopts(Opts, Ifopts#ifopts{});
_ ->
- ?t:fail({multiple_flags,Fs,Ifopts})
+ ct:fail({multiple_flags,Fs,Ifopts})
end;
check_ifopts(
[{addr,Addr},{netmask,Netmask},{broadaddr,Broadaddr}|Opts],
@@ -1117,7 +1084,7 @@ check_ifopts([{hwaddr,Hwaddr}|Opts], #ifopts{hwaddr=undefined}=Ifopts)
when is_list(Hwaddr) ->
check_ifopts(Opts, Ifopts#ifopts{hwaddr=Hwaddr});
check_ifopts([{hwaddr,HwAddr}|_], #ifopts{}=Ifopts) ->
- ?t:fail({multiple_hwaddrs,HwAddr,Ifopts}).
+ ct:fail({multiple_hwaddrs,HwAddr,Ifopts}).
%% Works just like lists:member/2, except that any {127,_,_,_} tuple
%% matches any other {127,_,_,_}. We do this to handle Linux systems
diff --git a/lib/kernel/test/inet_res_SUITE.erl b/lib/kernel/test/inet_res_SUITE.erl
index ea06061c74..a82849b2d3 100644
--- a/lib/kernel/test/inet_res_SUITE.erl
+++ b/lib/kernel/test/inet_res_SUITE.erl
@@ -42,7 +42,9 @@
-define(RUN_NAMED, "run-named").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[basic, resolve, edns0, txt_record, files_monitor,
@@ -77,8 +79,8 @@ zone_dir(TC) ->
end.
init_per_testcase(Func, Config) ->
- PrivDir = ?config(priv_dir, Config),
- DataDir = ?config(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
try ns_init(zone_dir(Func), PrivDir, DataDir) of
NsSpec ->
Lookup = inet_db:res_option(lookup),
@@ -88,29 +90,27 @@ init_per_testcase(Func, Config) ->
inet_db:ins_alt_ns(IP, Port);
_ -> ok
end,
- Dog = test_server:timetrap(test_server:seconds(20)),
- [{nameserver,NsSpec},{res_lookup,Lookup},{watchdog,Dog}|Config]
+ [{nameserver,NsSpec},{res_lookup,Lookup}|Config]
catch
SkipReason ->
{skip,SkipReason}
end.
end_per_testcase(_Func, Config) ->
- test_server:timetrap_cancel(?config(watchdog, Config)),
- inet_db:set_lookup(?config(res_lookup, Config)),
- NsSpec = ?config(nameserver, Config),
+ inet_db:set_lookup(proplists:get_value(res_lookup, Config)),
+ NsSpec = proplists:get_value(nameserver, Config),
case NsSpec of
{_,{IP,Port},_} ->
inet_db:del_alt_ns(IP, Port);
_ -> ok
end,
- ns_end(NsSpec, ?config(priv_dir, Config)).
+ ns_end(NsSpec, proplists:get_value(priv_dir, Config)).
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Nameserver control
ns(Config) ->
- {_ZoneDir,NS,_P} = ?config(nameserver, Config),
+ {_ZoneDir,NS,_P} = proplists:get_value(nameserver, Config),
NS.
ns_init(ZoneDir, PrivDir, DataDir) ->
@@ -277,8 +277,7 @@ proxy_ns({proxy,_,_,ProxyNS}) -> ProxyNS.
%%
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-basic(doc) ->
- ["Lookup an A record with different API functions"];
+%% Lookup an A record with different API functions.
basic(Config) when is_list(Config) ->
NS = ns(Config),
Name = "ns.otptest",
@@ -340,8 +339,7 @@ basic(Config) when is_list(Config) ->
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-resolve(doc) ->
- ["Lookup different records using resolve/2..4"];
+%% Lookup different records using resolve/2..4.
resolve(Config) when is_list(Config) ->
Class = in,
NS = ns(Config),
@@ -471,8 +469,7 @@ check_msg(Class, Type, Msg, AnList, NsList) ->
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-edns0(doc) ->
- ["Test EDNS and truncation"];
+%% Test EDNS and truncation.
edns0(Config) when is_list(Config) ->
NS = ns(Config),
Domain = "otptest",
@@ -533,10 +530,7 @@ inet_res_filter(Anlist, Class, Type) ->
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-txt_record(suite) ->
- [];
-txt_record(doc) ->
- ["Tests TXT records"];
+%% Tests TXT records.
txt_record(Config) when is_list(Config) ->
D1 = "cslab.ericsson.net",
D2 = "mail1.cslab.ericsson.net",
@@ -555,10 +549,7 @@ txt_record(Config) when is_list(Config) ->
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-files_monitor(suite) ->
- [];
-files_monitor(doc) ->
- ["Tests monitoring of /etc/hosts and /etc/resolv.conf, but not them"];
+%% Tests monitoring of /etc/hosts and /etc/resolv.conf, but not them.
files_monitor(Config) when is_list(Config) ->
Search = inet_db:res_option(search),
HostsFile = inet_db:res_option(hosts_file),
@@ -573,7 +564,7 @@ files_monitor(Config) when is_list(Config) ->
end.
do_files_monitor(Config) ->
- Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
{ok,Hostname} = inet:gethostname(),
io:format("Hostname = ~p.~n", [Hostname]),
FQDN =
@@ -647,8 +638,7 @@ do_files_monitor(Config) ->
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-last_ms_answer(doc) ->
- ["Answer just when timeout is triggered (OTP-9221)"];
+%% Answer just when timeout is triggered (OTP-9221).
last_ms_answer(Config) when is_list(Config) ->
NS = ns(Config),
Name = "ns.otptest",
diff --git a/lib/kernel/test/inet_sockopt_SUITE.erl b/lib/kernel/test/inet_sockopt_SUITE.erl
index a6981854c8..d682398ba8 100644
--- a/lib/kernel/test/inet_sockopt_SUITE.erl
+++ b/lib/kernel/test/inet_sockopt_SUITE.erl
@@ -62,7 +62,9 @@
-export([init_per_testcase/2, end_per_testcase/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[simple, loop_all, simple_raw, simple_raw_getbin,
@@ -90,97 +92,91 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:seconds(60)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+end_per_testcase(_Func, _Config) ->
+ ok.
-simple(suite) -> [];
-simple(doc) -> "Test inet:setopt/getopt simple functionality.";
+%% Test inet:setopt/getopt simple functionality.
simple(Config) when is_list(Config) ->
- ?line XOpt = case os:type() of
- {unix,_} -> [{reuseaddr,true}];
- _ -> []
- end,
- ?line Opt = [{nodelay,true},
- {keepalive,true},{packet,4},
- {active,false}|XOpt],
- ?line OptTags = [X || {X,_} <- Opt],
- ?line {S1,S2} = create_socketpair(Opt, Opt),
- ?line {ok,Opt} = inet:getopts(S1,OptTags),
- ?line {ok,Opt} = inet:getopts(S2,OptTags),
- ?line COpt = [{X,case X of nodelay -> false;_ -> Y end} || {X,Y} <- Opt],
- ?line inet:setopts(S1,COpt),
- ?line {ok,COpt} = inet:getopts(S1,OptTags),
- ?line {ok,Opt} = inet:getopts(S2,OptTags),
- ?line gen_tcp:close(S1),
- ?line gen_tcp:close(S2),
+ XOpt = case os:type() of
+ {unix,_} -> [{reuseaddr,true}];
+ _ -> []
+ end,
+ Opt = [{nodelay,true},
+ {keepalive,true},{packet,4},
+ {active,false}|XOpt],
+ OptTags = [X || {X,_} <- Opt],
+ {S1,S2} = create_socketpair(Opt, Opt),
+ {ok,Opt} = inet:getopts(S1,OptTags),
+ {ok,Opt} = inet:getopts(S2,OptTags),
+ COpt = [{X,case X of nodelay -> false;_ -> Y end} || {X,Y} <- Opt],
+ inet:setopts(S1,COpt),
+ {ok,COpt} = inet:getopts(S1,OptTags),
+ {ok,Opt} = inet:getopts(S2,OptTags),
+ gen_tcp:close(S1),
+ gen_tcp:close(S2),
ok.
-loop_all(suite) -> [];
-loop_all(doc) -> "Loop through all socket options and check that they work";
+%% Loop through all socket options and check that they work.
loop_all(Config) when is_list(Config) ->
- ?line ListenFailures =
+ ListenFailures =
lists:foldr(make_check_fun(listen,1),[],all_listen_options()),
- ?line ConnectFailures =
+ ConnectFailures =
lists:foldr(make_check_fun(connect,2),[],all_connect_options()),
- ?line case ListenFailures++ConnectFailures of
- [] ->
- ?line ok;
- Failed ->
- ?line {comment,lists:flatten(
- io_lib:format("Non mandatory failed:~w",
- [Failed]))}
- end.
+ case ListenFailures++ConnectFailures of
+ [] ->
+ ok;
+ Failed ->
+ {comment,lists:flatten(
+ io_lib:format("Non mandatory failed:~w",
+ [Failed]))}
+ end.
-simple_raw(suite) -> [];
-simple_raw(doc) -> "Test simple setopt/getopt of raw options.";
+%% Test simple setopt/getopt of raw options.
simple_raw(Config) when is_list(Config) ->
do_simple_raw(Config,false).
-simple_raw_getbin(suite) -> [];
-simple_raw_getbin(doc) -> "Test simple setopt/getopt of raw options, "
- "with binaries in getopt.";
+
+%% Test simple setopt/getopt of raw options, with binaries in getopt.
simple_raw_getbin(Config) when is_list(Config) ->
do_simple_raw(Config,true).
do_simple_raw(Config,Binary) when is_list(Config) ->
- ?line Port = start_helper(Config),
- ?line SolSocket = ask_helper(Port,?C_GET_SOL_SOCKET),
- ?line SoKeepAlive = ask_helper(Port,?C_GET_SO_KEEPALIVE),
- ?line OptionTrue = {raw,SolSocket,SoKeepAlive,<<1:32/native>>},
- ?line OptionFalse = {raw,SolSocket,SoKeepAlive,<<0:32/native>>},
- ?line {S1,S2} = create_socketpair([OptionTrue],[{keepalive,true}]),
- ?line {ok,[{keepalive,true}]} = inet:getopts(S1,[keepalive]),
- ?line {ok,[{keepalive,true}]} = inet:getopts(S2,[keepalive]),
- ?line {ok,[{raw,SolSocket,SoKeepAlive,X1B}]} =
+ Port = start_helper(Config),
+ SolSocket = ask_helper(Port,?C_GET_SOL_SOCKET),
+ SoKeepAlive = ask_helper(Port,?C_GET_SO_KEEPALIVE),
+ OptionTrue = {raw,SolSocket,SoKeepAlive,<<1:32/native>>},
+ OptionFalse = {raw,SolSocket,SoKeepAlive,<<0:32/native>>},
+ {S1,S2} = create_socketpair([OptionTrue],[{keepalive,true}]),
+ {ok,[{keepalive,true}]} = inet:getopts(S1,[keepalive]),
+ {ok,[{keepalive,true}]} = inet:getopts(S2,[keepalive]),
+ {ok,[{raw,SolSocket,SoKeepAlive,X1B}]} =
inet:getopts(S1,[{raw,SolSocket,SoKeepAlive,binarify(4,Binary)}]),
- ?line X1 = nintbin2int(X1B),
- ?line {ok,[{raw,SolSocket,SoKeepAlive,X2B}]} =
+ X1 = nintbin2int(X1B),
+ {ok,[{raw,SolSocket,SoKeepAlive,X2B}]} =
inet:getopts(S2,[{raw,SolSocket,SoKeepAlive,binarify(4,Binary)}]),
- ?line X2 = nintbin2int(X2B),
- ?line true = X1 > 0,
- ?line true = X2 > 0,
- ?line inet:setopts(S1,[{keepalive,false}]),
- ?line inet:setopts(S2,[OptionFalse]),
- ?line {ok,[{keepalive,false}]} = inet:getopts(S1,[keepalive]),
- ?line {ok,[{keepalive,false}]} = inet:getopts(S2,[keepalive]),
- ?line {ok,[{raw,SolSocket,SoKeepAlive,Y1B}]} =
+ X2 = nintbin2int(X2B),
+ true = X1 > 0,
+ true = X2 > 0,
+ inet:setopts(S1,[{keepalive,false}]),
+ inet:setopts(S2,[OptionFalse]),
+ {ok,[{keepalive,false}]} = inet:getopts(S1,[keepalive]),
+ {ok,[{keepalive,false}]} = inet:getopts(S2,[keepalive]),
+ {ok,[{raw,SolSocket,SoKeepAlive,Y1B}]} =
inet:getopts(S1,[{raw,SolSocket,SoKeepAlive,binarify(4,Binary)}]),
- ?line Y1 = nintbin2int(Y1B),
- ?line {ok,[{raw,SolSocket,SoKeepAlive,Y2B}]} =
+ Y1 = nintbin2int(Y1B),
+ {ok,[{raw,SolSocket,SoKeepAlive,Y2B}]} =
inet:getopts(S2,[{raw,SolSocket,SoKeepAlive,binarify(4,Binary)}]),
- ?line Y2 = nintbin2int(Y2B),
- ?line true = Y1 == 0,
- ?line true = Y2 == 0,
- ?line gen_tcp:close(S1),
- ?line gen_tcp:close(S2),
- ?line stop_helper(Port),
+ Y2 = nintbin2int(Y2B),
+ true = Y1 == 0,
+ true = Y2 == 0,
+ gen_tcp:close(S1),
+ gen_tcp:close(S2),
+ stop_helper(Port),
ok.
-
+
nintbin2int(<<Int:32/native>>) -> Int;
nintbin2int(<<Int:24/native>>) -> Int;
nintbin2int(<<Int:16/native>>) -> Int;
@@ -189,13 +185,12 @@ nintbin2int(<<>>) -> 0.
-multiple_raw(suite) -> [];
-multiple_raw(doc) -> "Test setopt/getopt of multiple raw options.";
+%% Test setopt/getopt of multiple raw options.
multiple_raw(Config) when is_list(Config) ->
do_multiple_raw(Config,false).
-multiple_raw_getbin(suite) -> [];
-multiple_raw_getbin(doc) -> "Test setopt/getopt of multiple raw options, "
- "with binaries in getopt.";
+
+%% Test setopt/getopt of multiple raw options, with binaries in
+%% getopt.
multiple_raw_getbin(Config) when is_list(Config) ->
do_multiple_raw(Config,true).
@@ -265,145 +260,143 @@ do_multiple_raw(Config, Binary) ->
-doc_examples_raw(suite) -> [];
-doc_examples_raw(doc) -> "Test that the example code from the documentation "
- "works";
+%% Test that the example code from the documentation works.
doc_examples_raw(Config) when is_list(Config) ->
do_doc_examples_raw(Config,false).
-doc_examples_raw_getbin(suite) -> [];
-doc_examples_raw_getbin(doc) -> "Test that the example code from the "
- "documentation works when getopt uses "
- "binaries";
+
+%% Test that the example code from the documentation works when getopt
+%% uses binaries.
doc_examples_raw_getbin(Config) when is_list(Config) ->
do_doc_examples_raw(Config,true).
+
do_doc_examples_raw(Config,Binary) when is_list(Config) ->
- ?line Port = start_helper(Config),
- ?line Proto = ask_helper(Port,?C_GET_IPPROTO_TCP),
- ?line TcpInfo = ask_helper(Port,?C_GET_TCP_INFO),
- ?line TcpInfoSize = ask_helper(Port,?C_GET_TCP_INFO_SIZE),
- ?line TcpiSackedOffset = ask_helper(Port,?C_GET_OFF_TCPI_SACKED),
- ?line TcpiOptionsOffset = ask_helper(Port,?C_GET_OFF_TCPI_OPTIONS),
- ?line TcpiSackedSize = ask_helper(Port,?C_GET_SIZ_TCPI_SACKED),
- ?line TcpiOptionsSize = ask_helper(Port,?C_GET_SIZ_TCPI_OPTIONS),
- ?line TcpLinger2 = ask_helper(Port,?C_GET_TCP_LINGER2),
- ?line stop_helper(Port),
+ Port = start_helper(Config),
+ Proto = ask_helper(Port,?C_GET_IPPROTO_TCP),
+ TcpInfo = ask_helper(Port,?C_GET_TCP_INFO),
+ TcpInfoSize = ask_helper(Port,?C_GET_TCP_INFO_SIZE),
+ TcpiSackedOffset = ask_helper(Port,?C_GET_OFF_TCPI_SACKED),
+ TcpiOptionsOffset = ask_helper(Port,?C_GET_OFF_TCPI_OPTIONS),
+ TcpiSackedSize = ask_helper(Port,?C_GET_SIZ_TCPI_SACKED),
+ TcpiOptionsSize = ask_helper(Port,?C_GET_SIZ_TCPI_OPTIONS),
+ TcpLinger2 = ask_helper(Port,?C_GET_TCP_LINGER2),
+ stop_helper(Port),
case all_ok([Proto,TcpInfo,TcpInfoSize,TcpiSackedOffset,
TcpiOptionsOffset,TcpiSackedSize,TcpiOptionsSize,
TcpLinger2]) of
false ->
{skipped,"Does not run on this OS."};
true ->
- ?line {Sock,I} = create_socketpair([],[]),
- ?line {ok,[{raw,Proto,TcpLinger2,<<OrigLinger:32/native>>}]} =
+ {Sock,I} = create_socketpair([],[]),
+ {ok,[{raw,Proto,TcpLinger2,<<OrigLinger:32/native>>}]} =
inet:getopts(Sock,[{raw,Proto,TcpLinger2,binarify(4,Binary)}]),
- ?line NewLinger = OrigLinger div 2,
- ?line ok = inet:setopts(Sock,[{raw,Proto,TcpLinger2,
- <<NewLinger:32/native>>}]),
- ?line {ok,[{raw,Proto,TcpLinger2,<<NewLinger:32/native>>}]} =
+ NewLinger = OrigLinger div 2,
+ ok = inet:setopts(Sock,[{raw,Proto,TcpLinger2,
+ <<NewLinger:32/native>>}]),
+ {ok,[{raw,Proto,TcpLinger2,<<NewLinger:32/native>>}]} =
inet:getopts(Sock,[{raw,Proto,TcpLinger2,binarify(4,Binary)}]),
- ?line ok = inet:setopts(Sock,[{raw,Proto,TcpLinger2,
- <<OrigLinger:32/native>>}]),
- ?line {ok,[{raw,Proto,TcpLinger2,<<OrigLinger:32/native>>}]} =
+ ok = inet:setopts(Sock,[{raw,Proto,TcpLinger2,
+ <<OrigLinger:32/native>>}]),
+ {ok,[{raw,Proto,TcpLinger2,<<OrigLinger:32/native>>}]} =
inet:getopts(Sock,[{raw,Proto,TcpLinger2,binarify(4,Binary)}]),
- ?line {ok,[{raw,_,_,Info}]} =
+ {ok,[{raw,_,_,Info}]} =
inet:getopts(Sock,[{raw,Proto,TcpInfo,
binarify(TcpInfoSize,Binary)}]),
- ?line Bit1 = TcpiSackedSize * 8,
- ?line <<_:TcpiSackedOffset/binary,
- TcpiSacked:Bit1/native,_/binary>> =
+ Bit1 = TcpiSackedSize * 8,
+ <<_:TcpiSackedOffset/binary,
+ TcpiSacked:Bit1/native,_/binary>> =
Info,
- ?line 0 = TcpiSacked,
- ?line Bit2 = TcpiOptionsSize * 8,
- ?line <<_:TcpiOptionsOffset/binary,
- TcpiOptions:Bit2/native,_/binary>> =
+ 0 = TcpiSacked,
+ Bit2 = TcpiOptionsSize * 8,
+ <<_:TcpiOptionsOffset/binary,
+ TcpiOptions:Bit2/native,_/binary>> =
Info,
- ?line true = TcpiOptions =/= 0,
- ?line gen_tcp:close(Sock),
- ?line gen_tcp:close(I),
+ true = TcpiOptions =/= 0,
+ gen_tcp:close(Sock),
+ gen_tcp:close(I),
ok
end.
-
-large_raw(suite) -> [];
-large_raw(doc) -> "Test structs and large/too large buffers when raw";
+
+%% Test structs and large/too large buffers when raw.
large_raw(Config) when is_list(Config) ->
do_large_raw(Config,false).
-large_raw_getbin(suite) -> [];
-large_raw_getbin(doc) -> "Test structs and large/too large buffers when raw"
- "using binaries to getopts";
+
+%% Test structs and large/too large buffers when raw
+%% using binaries to getopts.
large_raw_getbin(Config) when is_list(Config) ->
do_large_raw(Config,true).
+
do_large_raw(Config,Binary) when is_list(Config) ->
- ?line Port = start_helper(Config),
- ?line Proto = ask_helper(Port,?C_GET_SOL_SOCKET),
- ?line Linger = ask_helper(Port,?C_GET_SO_LINGER),
- ?line LingerSize = ask_helper(Port,?C_GET_LINGER_SIZE),
- ?line LingerOnOffOffset = ask_helper(Port,?C_GET_OFF_LINGER_L_ONOFF),
- ?line LingerLingerOffset = ask_helper(Port,?C_GET_OFF_LINGER_L_LINGER),
- ?line LingerOnOffSize = ask_helper(Port,?C_GET_SIZ_LINGER_L_ONOFF),
- ?line LingerLingerSize = ask_helper(Port,?C_GET_SIZ_LINGER_L_LINGER),
- ?line stop_helper(Port),
+ Port = start_helper(Config),
+ Proto = ask_helper(Port,?C_GET_SOL_SOCKET),
+ Linger = ask_helper(Port,?C_GET_SO_LINGER),
+ LingerSize = ask_helper(Port,?C_GET_LINGER_SIZE),
+ LingerOnOffOffset = ask_helper(Port,?C_GET_OFF_LINGER_L_ONOFF),
+ LingerLingerOffset = ask_helper(Port,?C_GET_OFF_LINGER_L_LINGER),
+ LingerOnOffSize = ask_helper(Port,?C_GET_SIZ_LINGER_L_ONOFF),
+ LingerLingerSize = ask_helper(Port,?C_GET_SIZ_LINGER_L_LINGER),
+ stop_helper(Port),
case all_ok([Proto,Linger,LingerSize,LingerOnOffOffset,
LingerLingerOffset,LingerOnOffSize,LingerLingerSize]) of
false ->
{skipped,"Does not run on this OS."};
true ->
- ?line {Sock1,Sock2} = create_socketpair([{linger,{true,10}}],
- [{linger,{false,0}}]),
- ?line LargeSize = 1024, % Solaris can take up to 1024*9,
- % linux 1024*63...
- ?line TooLargeSize = 1024*64,
- ?line {ok,[{raw,Proto,Linger,Linger1}]} =
+ {Sock1,Sock2} = create_socketpair([{linger,{true,10}}],
+ [{linger,{false,0}}]),
+ LargeSize = 1024, % Solaris can take up to 1024*9,
+ % linux 1024*63...
+ TooLargeSize = 1024*64,
+ {ok,[{raw,Proto,Linger,Linger1}]} =
inet:getopts(Sock1,[{raw,Proto,Linger,
binarify(LargeSize,Binary)}]),
- ?line {ok,[{raw,Proto,Linger,Linger2}]} =
+ {ok,[{raw,Proto,Linger,Linger2}]} =
inet:getopts(Sock2,[{raw,Proto,Linger,
binarify(LingerSize,Binary)}]),
- ?line true = byte_size(Linger1) =:= LingerSize,
- ?line LingerLingerBits = LingerLingerSize * 8,
- ?line LingerOnOffBits = LingerOnOffSize * 8,
- ?line <<_:LingerLingerOffset/binary,
- Ling1:LingerLingerBits/native,_/binary>> = Linger1,
- ?line <<_:LingerOnOffOffset/binary,
- Off1:LingerOnOffBits/native,_/binary>> = Linger1,
- ?line <<_:LingerOnOffOffset/binary,
- Off2:LingerOnOffBits/native,_/binary>> = Linger2,
- ?line true = Off1 =/= 0,
- ?line true = Off2 == 0,
- ?line true = Ling1 == 10,
- ?line {error,einval} =
+ true = byte_size(Linger1) =:= LingerSize,
+ LingerLingerBits = LingerLingerSize * 8,
+ LingerOnOffBits = LingerOnOffSize * 8,
+ <<_:LingerLingerOffset/binary,
+ Ling1:LingerLingerBits/native,_/binary>> = Linger1,
+ <<_:LingerOnOffOffset/binary,
+ Off1:LingerOnOffBits/native,_/binary>> = Linger1,
+ <<_:LingerOnOffOffset/binary,
+ Off2:LingerOnOffBits/native,_/binary>> = Linger2,
+ true = Off1 =/= 0,
+ true = Off2 == 0,
+ true = Ling1 == 10,
+ {error,einval} =
inet:getopts(Sock1,[{raw,Proto,Linger,TooLargeSize}]),
- ?line gen_tcp:close(Sock1),
- ?line gen_tcp:close(Sock2),
+ gen_tcp:close(Sock1),
+ gen_tcp:close(Sock2),
ok
end.
-combined(suite) -> [];
-combined(doc) -> "Test raw structs combined w/ other options ";
+%% Test raw structs combined w/ other options .
combined(Config) when is_list(Config) ->
do_combined(Config,false).
-combined_getbin(suite) -> [];
-combined_getbin(doc) -> "Test raw structs combined w/ other options and "
- "binarise in getopts";
+
+%% Test raw structs combined w/ other options and
+%% binarise in getopts.
combined_getbin(Config) when is_list(Config) ->
do_combined(Config,true).
+
do_combined(Config,Binary) when is_list(Config) ->
- ?line Port = start_helper(Config),
- ?line Proto = ask_helper(Port,?C_GET_SOL_SOCKET),
- ?line Linger = ask_helper(Port,?C_GET_SO_LINGER),
- ?line LingerSize = ask_helper(Port,?C_GET_LINGER_SIZE),
- ?line LingerOnOffOffset = ask_helper(Port,?C_GET_OFF_LINGER_L_ONOFF),
- ?line LingerLingerOffset = ask_helper(Port,?C_GET_OFF_LINGER_L_LINGER),
- ?line LingerOnOffSize = ask_helper(Port,?C_GET_SIZ_LINGER_L_ONOFF),
- ?line LingerLingerSize = ask_helper(Port,?C_GET_SIZ_LINGER_L_LINGER),
- ?line stop_helper(Port),
+ Port = start_helper(Config),
+ Proto = ask_helper(Port,?C_GET_SOL_SOCKET),
+ Linger = ask_helper(Port,?C_GET_SO_LINGER),
+ LingerSize = ask_helper(Port,?C_GET_LINGER_SIZE),
+ LingerOnOffOffset = ask_helper(Port,?C_GET_OFF_LINGER_L_ONOFF),
+ LingerLingerOffset = ask_helper(Port,?C_GET_OFF_LINGER_L_LINGER),
+ LingerOnOffSize = ask_helper(Port,?C_GET_SIZ_LINGER_L_ONOFF),
+ LingerLingerSize = ask_helper(Port,?C_GET_SIZ_LINGER_L_LINGER),
+ stop_helper(Port),
case all_ok([Proto,Linger,LingerSize,LingerOnOffOffset,
LingerLingerOffset,LingerOnOffSize,LingerLingerSize]) of
false ->
{skipped,"Does not run on this OS."};
true ->
- ?line LingerLingerBits = LingerLingerSize * 8,
- ?line LingerOnOffBits = LingerOnOffSize * 8,
- ?line {LingerOn,LingerOff} =
+ LingerLingerBits = LingerLingerSize * 8,
+ LingerOnOffBits = LingerOnOffSize * 8,
+ {LingerOn,LingerOff} =
case LingerOnOffOffset < LingerLingerOffset of
true ->
Pad1 =
@@ -423,11 +416,11 @@ do_combined(Config,Binary) when is_list(Config) ->
lists:duplicate(Pad3Siz,
0)),
{<<Pad1/binary,1:LingerOnOffBits/native,
- Pad2/binary,10:LingerLingerBits/native,
- Pad3/binary>>,
+ Pad2/binary,10:LingerLingerBits/native,
+ Pad3/binary>>,
<<Pad1/binary,0:LingerOnOffBits/native,
- Pad2/binary,0:LingerLingerBits/native,
- Pad3/binary>>};
+ Pad2/binary,0:LingerLingerBits/native,
+ Pad3/binary>>};
false ->
Pad1 =
list_to_binary(
@@ -446,177 +439,174 @@ do_combined(Config,Binary) when is_list(Config) ->
lists:duplicate(Pad3Siz,
0)),
{<<Pad1/binary,1:LingerLingerBits/native,
- Pad2/binary,10:LingerOnOffBits/native,
- Pad3/binary>>,
+ Pad2/binary,10:LingerOnOffBits/native,
+ Pad3/binary>>,
<<Pad1/binary,0:LingerLingerBits/native,
- Pad2/binary,0:LingerOnOffBits/native,
- Pad3/binary>>}
+ Pad2/binary,0:LingerOnOffBits/native,
+ Pad3/binary>>}
end,
- ?line RawLingerOn = {raw,Proto,Linger,LingerOn},
- ?line RawLingerOff = {raw,Proto,Linger,LingerOff},
- ?line {Sock1,Sock2} =
+ RawLingerOn = {raw,Proto,Linger,LingerOn},
+ RawLingerOff = {raw,Proto,Linger,LingerOff},
+ {Sock1,Sock2} =
create_socketpair([{keepalive,true},
RawLingerOn],
[{keepalive,false},
RawLingerOff]),
- ?line {ok,[{raw,Proto,Linger,Linger1},{keepalive,Keep1}]} =
+ {ok,[{raw,Proto,Linger,Linger1},{keepalive,Keep1}]} =
inet:getopts(Sock1,[{raw,Proto,Linger,
binarify(LingerSize,Binary)},keepalive]),
- ?line {ok,[{raw,Proto,Linger,Linger2},{keepalive,Keep2}]} =
+ {ok,[{raw,Proto,Linger,Linger2},{keepalive,Keep2}]} =
inet:getopts(Sock2,[{raw,Proto,Linger,
binarify(LingerSize,Binary)},keepalive]),
- ?line true = byte_size(Linger1) =:= LingerSize,
- ?line <<_:LingerLingerOffset/binary,
- Ling1:LingerLingerBits/native,_/binary>> = Linger1,
- ?line <<_:LingerOnOffOffset/binary,
- Off1:LingerOnOffBits/native,_/binary>> = Linger1,
- ?line <<_:LingerOnOffOffset/binary,
- Off2:LingerOnOffBits/native,_/binary>> = Linger2,
- ?line true = Off1 =/= 0,
- ?line true = Off2 == 0,
- ?line true = Ling1 == 10,
- ?line true = Keep1 =:= true,
- ?line true = Keep2 =:= false,
- ?line {Sock3,Sock4} =
+ true = byte_size(Linger1) =:= LingerSize,
+ <<_:LingerLingerOffset/binary,
+ Ling1:LingerLingerBits/native,_/binary>> = Linger1,
+ <<_:LingerOnOffOffset/binary,
+ Off1:LingerOnOffBits/native,_/binary>> = Linger1,
+ <<_:LingerOnOffOffset/binary,
+ Off2:LingerOnOffBits/native,_/binary>> = Linger2,
+ true = Off1 =/= 0,
+ true = Off2 == 0,
+ true = Ling1 == 10,
+ true = Keep1 =:= true,
+ true = Keep2 =:= false,
+ {Sock3,Sock4} =
create_socketpair([RawLingerOn,{keepalive,true}],
[RawLingerOff,{keepalive,false}]),
- ?line {ok,[{raw,Proto,Linger,Linger3},{keepalive,Keep3}]} =
+ {ok,[{raw,Proto,Linger,Linger3},{keepalive,Keep3}]} =
inet:getopts(Sock3,[{raw,Proto,Linger,
binarify(LingerSize,Binary)},keepalive]),
- ?line {ok,[{raw,Proto,Linger,Linger4},{keepalive,Keep4}]} =
+ {ok,[{raw,Proto,Linger,Linger4},{keepalive,Keep4}]} =
inet:getopts(Sock4,[{raw,Proto,Linger,
binarify(LingerSize,Binary)},keepalive]),
- ?line true = byte_size(Linger3) =:= LingerSize,
- ?line <<_:LingerLingerOffset/binary,
- Ling3:LingerLingerBits/native,_/binary>> = Linger3,
- ?line <<_:LingerOnOffOffset/binary,
- Off3:LingerOnOffBits/native,_/binary>> = Linger3,
- ?line <<_:LingerOnOffOffset/binary,
- Off4:LingerOnOffBits/native,_/binary>> = Linger4,
- ?line true = Off3 =/= 0,
- ?line true = Off4 == 0,
- ?line true = Ling3 == 10,
- ?line true = Keep3 =:= true,
- ?line true = Keep4 =:= false,
- ?line {Sock5,Sock6} =
+ true = byte_size(Linger3) =:= LingerSize,
+ <<_:LingerLingerOffset/binary,
+ Ling3:LingerLingerBits/native,_/binary>> = Linger3,
+ <<_:LingerOnOffOffset/binary,
+ Off3:LingerOnOffBits/native,_/binary>> = Linger3,
+ <<_:LingerOnOffOffset/binary,
+ Off4:LingerOnOffBits/native,_/binary>> = Linger4,
+ true = Off3 =/= 0,
+ true = Off4 == 0,
+ true = Ling3 == 10,
+ true = Keep3 =:= true,
+ true = Keep4 =:= false,
+ {Sock5,Sock6} =
create_socketpair([{packet,4},RawLingerOn,{keepalive,true}],
[{packet,2},RawLingerOff,{keepalive,false}]),
- ?line {ok,[{packet,Pack5},{raw,Proto,Linger,Linger5},
- {keepalive,Keep5}]} =
+ {ok,[{packet,Pack5},{raw,Proto,Linger,Linger5},
+ {keepalive,Keep5}]} =
inet:getopts(Sock5,[packet,{raw,Proto,Linger,
binarify(LingerSize,Binary)},
keepalive]),
- ?line {ok,[{packet,Pack6},{raw,Proto,Linger,Linger6},
- {keepalive,Keep6}]} =
+ {ok,[{packet,Pack6},{raw,Proto,Linger,Linger6},
+ {keepalive,Keep6}]} =
inet:getopts(Sock6,[packet,{raw,Proto,Linger,
binarify(LingerSize,Binary)},
keepalive]),
- ?line true = byte_size(Linger5) =:= LingerSize,
- ?line <<_:LingerLingerOffset/binary,
- Ling5:LingerLingerBits/native,_/binary>> = Linger5,
- ?line <<_:LingerOnOffOffset/binary,
- Off5:LingerOnOffBits/native,_/binary>> = Linger5,
- ?line <<_:LingerOnOffOffset/binary,
- Off6:LingerOnOffBits/native,_/binary>> = Linger6,
- ?line true = Off5 =/= 0,
- ?line true = Off6 == 0,
- ?line true = Ling5 == 10,
- ?line true = Keep5 =:= true,
- ?line true = Keep6 =:= false,
- ?line true = Pack5 =:= 4,
- ?line true = Pack6 =:= 2,
- ?line inet:setopts(Sock6,[{packet,4},RawLingerOn,
- {keepalive,true}]),
- ?line {ok,[{packet,Pack7},{raw,Proto,Linger,Linger7},
- {keepalive,Keep7}]} =
+ true = byte_size(Linger5) =:= LingerSize,
+ <<_:LingerLingerOffset/binary,
+ Ling5:LingerLingerBits/native,_/binary>> = Linger5,
+ <<_:LingerOnOffOffset/binary,
+ Off5:LingerOnOffBits/native,_/binary>> = Linger5,
+ <<_:LingerOnOffOffset/binary,
+ Off6:LingerOnOffBits/native,_/binary>> = Linger6,
+ true = Off5 =/= 0,
+ true = Off6 == 0,
+ true = Ling5 == 10,
+ true = Keep5 =:= true,
+ true = Keep6 =:= false,
+ true = Pack5 =:= 4,
+ true = Pack6 =:= 2,
+ inet:setopts(Sock6,[{packet,4},RawLingerOn,
+ {keepalive,true}]),
+ {ok,[{packet,Pack7},{raw,Proto,Linger,Linger7},
+ {keepalive,Keep7}]} =
inet:getopts(Sock6,[packet,{raw,Proto,Linger,
binarify(LingerSize,Binary)},
keepalive]),
- ?line <<_:LingerOnOffOffset/binary,
- Off7:LingerOnOffBits/native,_/binary>> = Linger7,
- ?line true = Off7 =/= 0,
- ?line true = Keep7 =:= true,
- ?line true = Pack7 =:= 4,
- ?line gen_tcp:close(Sock1),
- ?line gen_tcp:close(Sock2),
- ?line gen_tcp:close(Sock3),
- ?line gen_tcp:close(Sock4),
- ?line gen_tcp:close(Sock5),
- ?line gen_tcp:close(Sock6),
+ <<_:LingerOnOffOffset/binary,
+ Off7:LingerOnOffBits/native,_/binary>> = Linger7,
+ true = Off7 =/= 0,
+ true = Keep7 =:= true,
+ true = Pack7 =:= 4,
+ gen_tcp:close(Sock1),
+ gen_tcp:close(Sock2),
+ gen_tcp:close(Sock3),
+ gen_tcp:close(Sock4),
+ gen_tcp:close(Sock5),
+ gen_tcp:close(Sock6),
ok
end.
-ipv6_v6only_udp(suite) -> [];
-ipv6_v6only_udp(doc) -> "Test socket option ipv6_v6only for UDP";
+%% Test socket option ipv6_v6only for UDP.
ipv6_v6only_udp(Config) when is_list(Config) ->
ipv6_v6only(Config, gen_udp).
-ipv6_v6only_tcp(suite) -> [];
-ipv6_v6only_tcp(doc) -> "Test socket option ipv6_v6only for TCP";
+%% Test socket option ipv6_v6only for TCP.
ipv6_v6only_tcp(Config) when is_list(Config) ->
ipv6_v6only(Config, gen_tcp).
-ipv6_v6only_sctp(suite) -> [];
-ipv6_v6only_sctp(doc) -> "Test socket option ipv6_v6only for SCTP";
+%% Test socket option ipv6_v6only for SCTP.
ipv6_v6only_sctp(Config) when is_list(Config) ->
ipv6_v6only(Config, gen_sctp).
ipv6_v6only(Config, Module) when is_list(Config) ->
- ?line case ipv6_v6only_open(Module, []) of
- {ok,S1} ->
- ?line case inet:getopts(S1, [ipv6_v6only]) of
- {ok,[{ipv6_v6only,Default}]}
- when is_boolean(Default) ->
- ?line ok =
- ipv6_v6only_close(Module, S1),
- ?line ipv6_v6only(Config, Module, Default);
- {ok,[]} ->
- ?line io:format("Not implemented.~n", []),
- %% This list of OS:es where the option is
- %% supposed to be not implemented is just
- %% a guess, and may grow with time.
- ?line case {os:type(),os:version()} of
- {{unix,linux},{2,M,_}}
- when M =< 4 -> ok
- end,
- %% At least this should work
- ?line {ok,S2} =
- ipv6_v6only_open(
- Module,
- [{ipv6_v6only,true}]),
- ?line ok =
- ipv6_v6only_close(Module, S2)
- end;
- {error,_} ->
- {skipped,"Socket type not supported"}
- end.
+ case ipv6_v6only_open(Module, []) of
+ {ok,S1} ->
+ case inet:getopts(S1, [ipv6_v6only]) of
+ {ok,[{ipv6_v6only,Default}]}
+ when is_boolean(Default) ->
+ ok =
+ ipv6_v6only_close(Module, S1),
+ ipv6_v6only(Config, Module, Default);
+ {ok,[]} ->
+ io:format("Not implemented.~n", []),
+ %% This list of OS:es where the option is
+ %% supposed to be not implemented is just
+ %% a guess, and may grow with time.
+ case {os:type(),os:version()} of
+ {{unix,linux},{2,M,_}}
+ when M =< 4 -> ok
+ end,
+ %% At least this should work
+ {ok,S2} =
+ ipv6_v6only_open(
+ Module,
+ [{ipv6_v6only,true}]),
+ ok =
+ ipv6_v6only_close(Module, S2)
+ end;
+ {error,_} ->
+ {skipped,"Socket type not supported"}
+ end.
ipv6_v6only(Config, Module, Default) when is_list(Config) ->
- ?line io:format("Default ~w.~n", [Default]),
- ?line {ok,S1} =
+ io:format("Default ~w.~n", [Default]),
+ {ok,S1} =
ipv6_v6only_open(Module, [{ipv6_v6only,Default}]),
- ?line {ok,[{ipv6_v6only,Default}]} =
+ {ok,[{ipv6_v6only,Default}]} =
inet:getopts(S1, [ipv6_v6only]),
- ?line ok =
+ ok =
ipv6_v6only_close(Module, S1),
- ?line NotDefault = not Default,
- ?line case ipv6_v6only_open(Module, [{ipv6_v6only,NotDefault}]) of
- {ok,S2} ->
- ?line io:format("Read-write.~n", []),
- ?line {ok,[{ipv6_v6only,NotDefault}]} =
- inet:getopts(S2, [ipv6_v6only]),
- ok;
- {error,einval} ->
- ?line io:format("Read-only.~n", []),
- %% This option is known to be read-only and true
- %% on Windows and OpenBSD
- ?line case os:type() of
- {unix,openbsd} when Default =:= true -> ok;
- {win32,_} when Default =:= true -> ok
- end
- end.
+ NotDefault = not Default,
+ case ipv6_v6only_open(Module, [{ipv6_v6only,NotDefault}]) of
+ {ok,S2} ->
+ io:format("Read-write.~n", []),
+ {ok,[{ipv6_v6only,NotDefault}]} =
+ inet:getopts(S2, [ipv6_v6only]),
+ ok;
+ {error,einval} ->
+ io:format("Read-only.~n", []),
+ %% This option is known to be read-only and true
+ %% on Windows and OpenBSD
+ case os:type() of
+ {unix,openbsd} when Default =:= true -> ok;
+ {win32,_} when Default =:= true -> ok
+ end
+ end.
ipv6_v6only_open(Module, Opts) ->
Module:case Module of
@@ -628,47 +618,46 @@ ipv6_v6only_close(Module, Socket) ->
Module:close(Socket).
-use_ipv6_v6only_udp(suite) -> [];
-use_ipv6_v6only_udp(doc) -> "Test using socket option ipv6_v6only for UDP";
+%% Test using socket option ipv6_v6only for UDP.
use_ipv6_v6only_udp(Config) when is_list(Config) ->
- ?line case gen_udp:open(0, [inet6,{ipv6_v6only,true}]) of
- {ok,S6} ->
- ?line case inet:getopts(S6, [ipv6_v6only]) of
- {ok,[{ipv6_v6only,true}]} ->
- use_ipv6_v6only_udp(Config, S6);
- {ok,Other} ->
- {skipped,{getopts,Other}}
- end;
- {error,_} ->
- {skipped,"Socket type not supported"}
- end.
+ case gen_udp:open(0, [inet6,{ipv6_v6only,true}]) of
+ {ok,S6} ->
+ case inet:getopts(S6, [ipv6_v6only]) of
+ {ok,[{ipv6_v6only,true}]} ->
+ use_ipv6_v6only_udp(Config, S6);
+ {ok,Other} ->
+ {skipped,{getopts,Other}}
+ end;
+ {error,_} ->
+ {skipped,"Socket type not supported"}
+ end.
use_ipv6_v6only_udp(_Config, S6) ->
- ?line {ok,Port} = inet:port(S6),
- ?line {ok,S4} = gen_udp:open(Port, [inet]),
- ?line E6 = " IPv6-echo.",
- ?line E4 = " IPv4-echo.",
- ?line Sender =
+ {ok,Port} = inet:port(S6),
+ {ok,S4} = gen_udp:open(Port, [inet]),
+ E6 = " IPv6-echo.",
+ E4 = " IPv4-echo.",
+ Sender =
spawn_link(fun () -> use_ipv6_v6only_udp_sender(Port, E6, E4) end),
- ?line use_ipv6_v6only_udp_listener(
- S6, S4, E6, E4, monitor(process, Sender)).
+ use_ipv6_v6only_udp_listener(
+ S6, S4, E6, E4, monitor(process, Sender)).
use_ipv6_v6only_udp_listener(S6, S4, E6, E4, Mref) ->
- ?line receive
- {udp,S6,IP,P,Data} ->
- ?line ok = gen_udp:send(S6, IP, P, [Data|E6]),
- ?line use_ipv6_v6only_udp_listener(S6, S4, E6, E4, Mref);
- {udp,S4,IP,P,Data} ->
- ?line ok = gen_udp:send(S4, IP, P, [Data|E4]),
- ?line use_ipv6_v6only_udp_listener(S6, S4, E6, E4, Mref);
- {'DOWN',Mref,_,_,normal} ->
- ok;
- {'DOWN',Mref,_,_,Result} ->
- %% Since we are linked we will never arrive here
- Result;
- Other ->
- ?line exit({failed,{listener_unexpected,Other}})
- end.
+ receive
+ {udp,S6,IP,P,Data} ->
+ ok = gen_udp:send(S6, IP, P, [Data|E6]),
+ use_ipv6_v6only_udp_listener(S6, S4, E6, E4, Mref);
+ {udp,S4,IP,P,Data} ->
+ ok = gen_udp:send(S4, IP, P, [Data|E4]),
+ use_ipv6_v6only_udp_listener(S6, S4, E6, E4, Mref);
+ {'DOWN',Mref,_,_,normal} ->
+ ok;
+ {'DOWN',Mref,_,_,Result} ->
+ %% Since we are linked we will never arrive here
+ Result;
+ Other ->
+ exit({failed,{listener_unexpected,Other}})
+ end.
use_ipv6_v6only_udp_sender(Port, E6, E4) ->
D6 = "IPv6-send.",
@@ -693,12 +682,9 @@ sndrcv(Ip, Port, Opts, Data) ->
-type_errors(suite) ->
- [];
-type_errors(doc) ->
- "Test that raw data requests are not executed for bad types";
+%% Test that raw data requests are not executed for bad types.
type_errors(Config) when is_list(Config) ->
- ?line BadSetOptions =
+ BadSetOptions =
[
{raw,x,3,<<1:32>>},
{raw,1,tre,<<1:32>>},
@@ -716,7 +702,7 @@ type_errors(Config) when is_list(Config) ->
rav,
{linger,banan}
],
- ?line BadGetOptions =
+ BadGetOptions =
[
{raw,x,3,<<1:32>>},
{raw,1,tre,<<1:32>>},
@@ -735,46 +721,46 @@ type_errors(Config) when is_list(Config) ->
rav,
{linger,banan}
],
- ?line lists:foreach(fun(Option) ->
- ?line case
- catch create_socketpair([Option],[]) of
- {'EXIT',badarg} ->
- ?line ok;
- Unexpected1 ->
- ?line exit({unexpected,
- Unexpected1})
- end,
- ?line case
- catch create_socketpair([],[Option]) of
- {'EXIT',badarg} ->
- ?line ok;
- Unexpected2 ->
- ?line exit({unexpected,
- Unexpected2})
- end,
- ?line {Sock1,Sock2} = create_socketpair([],[]),
- ?line case inet:setopts(Sock1, [Option]) of
- {error,einval} ->
- ?line ok;
- Unexpected3 ->
- ?line exit({unexpected,
- Unexpected3})
- end,
- ?line gen_tcp:close(Sock1),
- ?line gen_tcp:close(Sock2)
- end,BadSetOptions),
- ?line {Sock1,Sock2} = create_socketpair([],[]),
- ?line lists:foreach(fun(Option) ->
- ?line case inet:getopts(Sock1, [Option]) of
- {error,einval} ->
- ?line ok;
- Unexpected ->
- ?line exit({unexpected,
- Unexpected})
- end
- end,BadGetOptions),
- ?line gen_tcp:close(Sock1),
- ?line gen_tcp:close(Sock2),
+ lists:foreach(fun(Option) ->
+ case
+ catch create_socketpair([Option],[]) of
+ {'EXIT',badarg} ->
+ ok;
+ Unexpected1 ->
+ exit({unexpected,
+ Unexpected1})
+ end,
+ case
+ catch create_socketpair([],[Option]) of
+ {'EXIT',badarg} ->
+ ok;
+ Unexpected2 ->
+ exit({unexpected,
+ Unexpected2})
+ end,
+ {Sock1,Sock2} = create_socketpair([],[]),
+ case inet:setopts(Sock1, [Option]) of
+ {error,einval} ->
+ ok;
+ Unexpected3 ->
+ exit({unexpected,
+ Unexpected3})
+ end,
+ gen_tcp:close(Sock1),
+ gen_tcp:close(Sock2)
+ end,BadSetOptions),
+ {Sock1,Sock2} = create_socketpair([],[]),
+ lists:foreach(fun(Option) ->
+ case inet:getopts(Sock1, [Option]) of
+ {error,einval} ->
+ ok;
+ Unexpected ->
+ exit({unexpected,
+ Unexpected})
+ end
+ end,BadGetOptions),
+ gen_tcp:close(Sock1),
+ gen_tcp:close(Sock2),
ok.
all_ok([]) ->
@@ -784,59 +770,59 @@ all_ok([H|T]) when H >= 0 ->
all_ok(_) ->
false.
-
+
make_check_fun(Type,Element) ->
fun({Name,V1,V2,Mand,Chang},Acc) ->
- ?line {LO1,CO1} = setelement(Element,{[],[]}, [{Name,V1}]),
- ?line {LO2,CO2} = setelement(Element,{[],[]}, [{Name,V2}]),
- ?line {X1,Y1} = create_socketpair(LO1,CO1),
- ?line {X2,Y2} = create_socketpair(LO2,CO2),
- ?line S1 = element(Element,{X1,Y1}),
- ?line S2 = element(Element,{X2,Y2}),
- ?line {ok,[{Name,R1}]} = inet:getopts(S1,[Name]),
- ?line {ok,[{Name,R2}]} = inet:getopts(S2,[Name]),
+ {LO1,CO1} = setelement(Element,{[],[]}, [{Name,V1}]),
+ {LO2,CO2} = setelement(Element,{[],[]}, [{Name,V2}]),
+ {X1,Y1} = create_socketpair(LO1,CO1),
+ {X2,Y2} = create_socketpair(LO2,CO2),
+ S1 = element(Element,{X1,Y1}),
+ S2 = element(Element,{X2,Y2}),
+ {ok,[{Name,R1}]} = inet:getopts(S1,[Name]),
+ {ok,[{Name,R2}]} = inet:getopts(S2,[Name]),
NewAcc =
case R1 =/= R2 of
true ->
case Chang of
true ->
- ?line inet:setopts(S1,[{Name,V2}]),
- ?line {ok,[{Name,R3}]} =
+ inet:setopts(S1,[{Name,V2}]),
+ {ok,[{Name,R3}]} =
inet:getopts(S1,[Name]),
case {R3 =/= R1, R3 =:= R2} of
{true,true} ->
- ?line Acc;
+ Acc;
_ ->
case Mand of
true ->
- ?line exit
- ({failed_sockopt,
- {change,
- Name}});
+ exit
+ ({failed_sockopt,
+ {change,
+ Name}});
false ->
- ?line [{change,Name}|Acc]
+ [{change,Name}|Acc]
end
end;
false ->
- ?line Acc
+ Acc
end;
false ->
case Mand of
true ->
- ?line exit({failed_sockopt,
- {Type,Name}});
+ exit({failed_sockopt,
+ {Type,Name}});
false ->
- ?line [{Type,Name}|Acc]
+ [{Type,Name}|Acc]
end
end,
- ?line gen_tcp:close(X1),
- ?line gen_tcp:close(Y1),
- ?line gen_tcp:close(X2),
- ?line gen_tcp:close(Y2),
+ gen_tcp:close(X1),
+ gen_tcp:close(Y1),
+ gen_tcp:close(X2),
+ gen_tcp:close(Y2),
NewAcc
- end.
+ end.
-% {OptionName,Value1,Value2,Mandatory,Changeable}
+%% {OptionName,Value1,Value2,Mandatory,Changeable}
all_listen_options() ->
[{tos,0,1,false,true},
{priority,0,1,false,true},
@@ -887,19 +873,19 @@ all_connect_options() ->
{delay_send,false,true,true,true},
{packet_size,0,4,true,true}
].
-
+
create_socketpair(ListenOptions,ConnectOptions) ->
- ?line {ok,LS}=gen_tcp:listen(0,ListenOptions),
- ?line {ok,Port}=inet:port(LS),
- ?line {ok,CS}=gen_tcp:connect(localhost,Port,ConnectOptions),
- ?line {ok,AS}=gen_tcp:accept(LS),
- ?line gen_tcp:close(LS),
+ {ok,LS}=gen_tcp:listen(0,ListenOptions),
+ {ok,Port}=inet:port(LS),
+ {ok,CS}=gen_tcp:connect(localhost,Port,ConnectOptions),
+ {ok,AS}=gen_tcp:accept(LS),
+ gen_tcp:close(LS),
{AS,CS}.
start_helper(Config) ->
- Progname = filename:join(?config(data_dir, Config), "sockopt_helper"),
+ Progname = filename:join(proplists:get_value(data_dir, Config), "sockopt_helper"),
Port = open_port({spawn,Progname},[eof,line]),
Port.
diff --git a/lib/kernel/test/init_SUITE.erl b/lib/kernel/test/init_SUITE.erl
index cb531f7b57..0fa97b585c 100644
--- a/lib/kernel/test/init_SUITE.erl
+++ b/lib/kernel/test/init_SUITE.erl
@@ -25,7 +25,7 @@
init_per_group/2,end_per_group/2]).
-export([get_arguments/1, get_argument/1, boot_var/1, restart/1,
- many_restarts/1,
+ many_restarts/0, many_restarts/1,
get_plain_arguments/1,
reboot/1, stop/1, get_status/1, script_id/1]).
-export([boot1/1, boot2/1]).
@@ -41,7 +41,9 @@
%% Should be started in a CC view with:
%% erl -sname master -rsh ctrsh
%%-----------------------------------------------------------------
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[get_arguments, get_argument, boot_var,
@@ -65,46 +67,35 @@ end_per_group(_GroupName, Config) ->
Config.
-init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
- Dog=?t:timetrap(?t:seconds(?DEFAULT_TIMEOUT_SEC)),
- [{watchdog, Dog}|Config].
+init_per_testcase(Func, Config) ->
+ Config.
-end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- ?t:timetrap_cancel(Dog).
+end_per_testcase(_Func, _Config) ->
+ ok.
-init(doc) -> [];
-init(suite) -> [];
init(Config) when is_list(Config) ->
Config.
-fini(doc) -> [];
-fini(suite) -> [];
fini(Config) when is_list(Config) ->
Host = list_to_atom(from($@, atom_to_list(node()))),
Node = list_to_atom(lists:concat([init_test, "@", Host])),
stop_node(Node),
Config.
-get_arguments(doc) ->[];
-get_arguments(suite) -> {req, [distribution, {local_slave_nodes, 1}]};
get_arguments(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(10)),
-
Args = args(),
- ?line {ok, Node} = start_node(init_test, Args),
- ?line case rpc:call(Node, init, get_arguments, []) of
- Arguments when is_list(Arguments) ->
- stop_node(Node),
- check_a(Arguments),
- check_b(Arguments),
- check_c(Arguments),
- check_d(Arguments);
- _ ->
- stop_node(Node),
- ?t:fail(get_arguments)
- end,
- ?line ?t:timetrap_cancel(Dog),
+ {ok, Node} = start_node(init_test, Args),
+ case rpc:call(Node, init, get_arguments, []) of
+ Arguments when is_list(Arguments) ->
+ stop_node(Node),
+ check_a(Arguments),
+ check_b(Arguments),
+ check_c(Arguments),
+ check_d(Arguments);
+ _ ->
+ stop_node(Node),
+ ct:fail(get_arguments)
+ end,
ok.
check_a(Args) ->
@@ -115,10 +106,10 @@ check_a(Args) ->
false ->
ok;
_ ->
- ?t:fail(check_a1)
+ ct:fail(check_a1)
end;
_ ->
- ?t:fail(check_a2)
+ ct:fail(check_a2)
end.
check_b(Args) ->
@@ -132,13 +123,13 @@ check_b(Args) ->
false ->
ok;
_ ->
- ?t:fail(check_b1)
+ ct:fail(check_b1)
end;
_ ->
- ?t:fail(check_b2)
+ ct:fail(check_b2)
end;
_ ->
- ?t:fail(check_b3)
+ ct:fail(check_b3)
end.
check_c(Args) ->
@@ -152,13 +143,13 @@ check_c(Args) ->
false ->
ok;
_ ->
- ?t:fail(check_c1)
+ ct:fail(check_c1)
end;
_ ->
- ?t:fail(check_c2)
+ ct:fail(check_c2)
end;
_ ->
- ?t:fail(check_c3)
+ ct:fail(check_c3)
end.
check_d(Args) ->
@@ -169,62 +160,54 @@ check_d(Args) ->
false ->
ok;
_ ->
- ?t:fail(check_d1)
+ ct:fail(check_d1)
end;
_ ->
- ?t:fail(check_d2)
+ ct:fail(check_d2)
end.
-get_argument(doc) ->[];
-get_argument(suite) -> {req, [distribution, {local_slave_nodes, 1}]};
get_argument(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(10)),
-
Args = args(),
- ?line {ok, Node} = start_node(init_test, Args),
- ?line case rpc:call(Node, init, get_argument, [b]) of
- {ok, [["hej", "hopp"],["san", "sa"]]} ->
- ok;
- _ ->
- stop_node(Node),
- ?t:fail({get_argument, b})
- end,
- ?line case rpc:call(Node, init, get_argument, [a]) of
- {ok, [["kalle"]]} ->
- ok;
- _ ->
- stop_node(Node),
- ?t:fail({get_argument, a})
- end,
- ?line case rpc:call(Node, init, get_argument, [c]) of
- {ok, [["4", "5", "6"], ["7", "8", "9"]]} ->
- ok;
- _ ->
- stop_node(Node),
- ?t:fail({get_argument, c})
- end,
- ?line case rpc:call(Node, init, get_argument, [d]) of
- {ok, [[]]} ->
- ok;
- _ ->
- stop_node(Node),
- ?t:fail({get_argument, d})
- end,
- ?line case rpc:call(Node, init, get_argument, [e]) of
- error ->
- ok;
- _ ->
- stop_node(Node),
- ?t:fail({get_argument, e})
- end,
+ {ok, Node} = start_node(init_test, Args),
+ case rpc:call(Node, init, get_argument, [b]) of
+ {ok, [["hej", "hopp"],["san", "sa"]]} ->
+ ok;
+ _ ->
+ stop_node(Node),
+ ct:fail({get_argument, b})
+ end,
+ case rpc:call(Node, init, get_argument, [a]) of
+ {ok, [["kalle"]]} ->
+ ok;
+ _ ->
+ stop_node(Node),
+ ct:fail({get_argument, a})
+ end,
+ case rpc:call(Node, init, get_argument, [c]) of
+ {ok, [["4", "5", "6"], ["7", "8", "9"]]} ->
+ ok;
+ _ ->
+ stop_node(Node),
+ ct:fail({get_argument, c})
+ end,
+ case rpc:call(Node, init, get_argument, [d]) of
+ {ok, [[]]} ->
+ ok;
+ _ ->
+ stop_node(Node),
+ ct:fail({get_argument, d})
+ end,
+ case rpc:call(Node, init, get_argument, [e]) of
+ error ->
+ ok;
+ _ ->
+ stop_node(Node),
+ ct:fail({get_argument, e})
+ end,
stop_node(Node),
- ?line ?t:timetrap_cancel(Dog),
ok.
-get_plain_arguments(doc) ->[];
-get_plain_arguments(suite) -> {req, [distribution, {local_slave_nodes, 1}]};
get_plain_arguments(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(10)),
Longstring =
"fjdkfjdkfjfdaa2fjdkfjdkfjfdaa2fjdkfjdkfjfdaa2"
"fjdkfjdkfjfdaa2fjdkfjdkfjfdaa2fjdkfjdkfjfdaa2"
@@ -235,18 +218,17 @@ get_plain_arguments(Config) when is_list(Config) ->
"fjdkfjdkfjfdaa2fjdkfjdkfjfdaa2fjdkfjdkfjfdaa2"
"fjdkfjdkfjfdaa2fjdkfjdkfjfdaa2fjdkfjdkfjfdaa2"
"fjdkfjdkfjfdaa2fjdkfjdkfjfdaa2fjdkfjdkfjfdaa2",
- ?line true = (length(Longstring) > 255),
+ true = (length(Longstring) > 255),
Args = long_args(Longstring),
- ?line {ok, Node} = start_node(init_test, Args),
- ?line case rpc:call(Node, init, get_plain_arguments, []) of
- ["a", "b", "c", Longstring] ->
- ok;
- As ->
- stop_node(Node),
- ?t:fail({get_argument, As})
- end,
+ {ok, Node} = start_node(init_test, Args),
+ case rpc:call(Node, init, get_plain_arguments, []) of
+ ["a", "b", "c", Longstring] ->
+ ok;
+ As ->
+ stop_node(Node),
+ ct:fail({get_argument, As})
+ end,
stop_node(Node),
- ?line ?t:timetrap_cancel(Dog),
ok.
@@ -254,205 +236,182 @@ get_plain_arguments(Config) when is_list(Config) ->
%% ------------------------------------------------
%% Use -boot_var flag to set $TEST_VAR in boot script.
%% ------------------------------------------------
-boot_var(doc) -> [];
-boot_var(suite) -> {req, [distribution, {local_slave_nodes, 1}]};
boot_var(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(100)),
-
{BootScript, TEST_VAR, KernelVsn, StdlibVsn} = create_boot(Config),
%% Should fail as we have not given -boot_var TEST_VAR
- ?line {error, timeout} =
- start_node(init_test, "-boot " ++ BootScript),
+ {error, timeout} =
+ start_node(init_test, "-boot " ++ BootScript),
case is_real_system(KernelVsn, StdlibVsn) of
true ->
%% Now it should work !!
- ?line {ok, Node} =
- start_node(init_test,
- "-boot " ++ BootScript ++
- " -boot_var TEST_VAR " ++ TEST_VAR),
+ {ok, Node} =
+ start_node(init_test,
+ "-boot " ++ BootScript ++
+ " -boot_var TEST_VAR " ++ TEST_VAR),
stop_node(Node),
Res = ok;
_ ->
%% What we need is not so much version numbers on the directories, but
%% for the boot var TEST_VAR to appear in the boot script, and it doesn't
%% if we give the 'local' option to systools:make_script.
- ?t:format(
- "Test case not complete as we are not~n"
- "running in a real system!~n"
- "Probably this test is performed in a "
- "clearcase view or source tree.~n"
- "Need version numbers on the kernel and "
- "stdlib directories!~n",
- []),
+ io:format(
+ "Test case not complete as we are not~n"
+ "running in a real system!~n"
+ "Probably this test is performed in a "
+ "clearcase view or source tree.~n"
+ "Need version numbers on the kernel and "
+ "stdlib directories!~n",
+ []),
Res = {skip,
- "Test case only partially run since it is run "
- "in a clearcase view or in a source tree. "
- "Need an installed system to complete this test."}
+ "Test case only partially run since it is run "
+ "in a clearcase view or in a source tree. "
+ "Need an installed system to complete this test."}
end,
- ?line ?t:timetrap_cancel(Dog),
Res.
create_boot(Config) ->
- ?line {ok, OldDir} = file:get_cwd(),
- ?line {LatestDir, LatestName, KernelVsn, StdlibVsn} =
+ {ok, OldDir} = file:get_cwd(),
+ {LatestDir, LatestName, KernelVsn, StdlibVsn} =
create_script(Config),
LibDir = code:lib_dir(),
- ?line ok = file:set_cwd(LatestDir),
- ?line ok = systools:make_script(LatestName,
- [{variables, [{"TEST_VAR", LibDir}]}]),
- ?line ok = file:set_cwd(OldDir),
+ ok = file:set_cwd(LatestDir),
+ ok = systools:make_script(LatestName,
+ [{variables, [{"TEST_VAR", LibDir}]}]),
+ ok = file:set_cwd(OldDir),
{LatestDir ++ "/" ++ LatestName, LibDir, KernelVsn, StdlibVsn}.
is_real_system(KernelVsn, StdlibVsn) ->
LibDir = code:lib_dir(),
filelib:is_dir(filename:join(LibDir, "kernel-"++KernelVsn)) andalso
filelib:is_dir(filename:join(LibDir, "stdlib-"++StdlibVsn)).
-
+
%% ------------------------------------------------
%% Slave executes erlang:halt() on master nodedown.
%% Therefore the slave process must be killed
%% before restart.
%% ------------------------------------------------
-many_restarts(doc) -> [];
-many_restarts(suite) ->
- case ?t:os_type() of
- {Fam, _} when Fam == unix; Fam == win32 ->
- {req, [distribution, {local_slave_nodes, 1}, {time, 5}]};
- _ ->
- {skip, "Only run on unix and win32"}
- end;
+many_restarts() ->
+ [{timetrap,{minutes,8}}].
many_restarts(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(480)),
- ?line {ok, Node} = loose_node:start(init_test, "", ?DEFAULT_TIMEOUT_SEC),
- ?line loop_restart(30,Node,rpc:call(Node,erlang,whereis,[error_logger])),
- ?line loose_node:stop(Node),
- ?line ?t:timetrap_cancel(Dog),
+ {ok, Node} = loose_node:start(init_test, "", ?DEFAULT_TIMEOUT_SEC),
+ loop_restart(30,Node,rpc:call(Node,erlang,whereis,[error_logger])),
+ loose_node:stop(Node),
ok.
loop_restart(0,_,_) ->
ok;
loop_restart(N,Node,EHPid) ->
- ?line erlang:monitor_node(Node, true),
- ?line ok = rpc:call(Node, init, restart, []),
- ?line receive
- {nodedown, Node} ->
- ok
- after 10000 ->
- loose_node:stop(Node),
- ?t:fail(not_stopping)
- end,
- ?line ok = wait_for(30, Node, EHPid),
- ?line loop_restart(N-1,Node,rpc:call(Node,erlang,whereis,[error_logger])).
+ erlang:monitor_node(Node, true),
+ ok = rpc:call(Node, init, restart, []),
+ receive
+ {nodedown, Node} ->
+ ok
+ after 10000 ->
+ loose_node:stop(Node),
+ ct:fail(not_stopping)
+ end,
+ ok = wait_for(30, Node, EHPid),
+ loop_restart(N-1,Node,rpc:call(Node,erlang,whereis,[error_logger])).
wait_for(0,Node,_) ->
loose_node:stop(Node),
error;
wait_for(N,Node,EHPid) ->
- ?line case rpc:call(Node, erlang, whereis, [error_logger]) of
+ case rpc:call(Node, erlang, whereis, [error_logger]) of
Pid when is_pid(Pid), Pid =/= EHPid ->
- %% ?line erlang:display(ok),
- ?line ok;
+ %% erlang:display(ok),
+ ok;
_X ->
- %% ?line erlang:display(_X),
- %% ?line Procs = rpc:call(Node, erlang, processes, []),
- %% ?line erlang:display(Procs),
- %% case is_list(Procs) of
- %% true ->
- %% ?line [(catch erlang:display(
- %% rpc:call(Node,
- %% erlang,
- %% process_info,
- %% [Y,registered_name])))
- %% || Y <- Procs];
- %% _ ->
- %% ok
- %% end,
- receive
- after 100 ->
- ok
- end,
- ?line wait_for(N-1,Node,EHPid)
- end.
+ %% erlang:display(_X),
+ %% Procs = rpc:call(Node, erlang, processes, []),
+ %% erlang:display(Procs),
+ %% case is_list(Procs) of
+ %% true ->
+ %% [(catch erlang:display(
+ %% rpc:call(Node,
+ %% erlang,
+ %% process_info,
+ %% [Y,registered_name])))
+ %% || Y <- Procs];
+ %% _ ->
+ %% ok
+ %% end,
+ receive
+ after 100 ->
+ ok
+ end,
+ wait_for(N-1,Node,EHPid)
+ end.
%% ------------------------------------------------
%% Slave executes erlang:halt() on master nodedown.
%% Therefore the slave process must be killed
%% before restart.
%% ------------------------------------------------
-restart(doc) -> [];
-restart(suite) ->
- case ?t:os_type() of
- {Fam, _} when Fam == unix; Fam == win32 ->
- {req, [distribution, {local_slave_nodes, 1}, {time, 5}]};
- _ ->
- {skip, "Only run on unix and win32"}
- end;
restart(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(40)),
- ?line Args = args(),
+ Args = args(),
%% Currently test_server:start_node cannot be used. The restarted
%% node immediately halts due to the implementation of
%% test_server:start_node.
- ?line {ok, Node} = loose_node:start(init_test, Args, ?DEFAULT_TIMEOUT_SEC),
+ {ok, Node} = loose_node:start(init_test, Args, ?DEFAULT_TIMEOUT_SEC),
%% Ok, the node is up, now the real test test begins.
- ?line erlang:monitor_node(Node, true),
- ?line InitPid = rpc:call(Node, erlang, whereis, [init]),
- ?line PurgerPid = rpc:call(Node, erlang, whereis, [erts_code_purger]),
- ?line Procs = rpc:call(Node, erlang, processes, []),
- ?line MaxPid = lists:last(Procs),
- ?line ok = rpc:call(Node, init, restart, []),
- ?line receive
- {nodedown, Node} ->
- ok
- after 10000 ->
- loose_node:stop(Node),
- ?t:fail(not_stopping)
- end,
- ?line ok = wait_restart(30, Node),
+ erlang:monitor_node(Node, true),
+ InitPid = rpc:call(Node, erlang, whereis, [init]),
+ PurgerPid = rpc:call(Node, erlang, whereis, [erts_code_purger]),
+ Procs = rpc:call(Node, erlang, processes, []),
+ MaxPid = lists:last(Procs),
+ ok = rpc:call(Node, init, restart, []),
+ receive
+ {nodedown, Node} ->
+ ok
+ after 10000 ->
+ loose_node:stop(Node),
+ ct:fail(not_stopping)
+ end,
+ ok = wait_restart(30, Node),
%% Still the same init process!
- ?line InitPid1 = rpc:call(Node, erlang, whereis, [init]),
+ InitPid1 = rpc:call(Node, erlang, whereis, [init]),
InitP = pid_to_list(InitPid),
- ?line InitP = pid_to_list(InitPid1),
+ InitP = pid_to_list(InitPid1),
%% and same purger process!
- ?line PurgerPid1 = rpc:call(Node, erlang, whereis, [erts_code_purger]),
+ PurgerPid1 = rpc:call(Node, erlang, whereis, [erts_code_purger]),
PurgerP = pid_to_list(PurgerPid),
- ?line PurgerP = pid_to_list(PurgerPid1),
+ PurgerP = pid_to_list(PurgerPid1),
- ?line NewProcs0 = rpc:call(Node, erlang, processes, []),
+ NewProcs0 = rpc:call(Node, erlang, processes, []),
NewProcs = NewProcs0 -- [InitPid1, PurgerPid1],
- ?line case check_processes(NewProcs, MaxPid) of
- true ->
- ok;
- _ ->
- loose_node:stop(Node),
- ?t:fail(processes_not_greater)
- end,
+ case check_processes(NewProcs, MaxPid) of
+ true ->
+ ok;
+ _ ->
+ loose_node:stop(Node),
+ ct:fail(processes_not_greater)
+ end,
%% Test that, for instance, the same argument still exists.
- ?line case rpc:call(Node, init, get_argument, [c]) of
- {ok, [["4", "5", "6"], ["7", "8", "9"]]} ->
- ok;
- _ ->
- loose_node:stop(Node),
- ?t:fail({get_argument, restart_fail})
- end,
+ case rpc:call(Node, init, get_argument, [c]) of
+ {ok, [["4", "5", "6"], ["7", "8", "9"]]} ->
+ ok;
+ _ ->
+ loose_node:stop(Node),
+ ct:fail({get_argument, restart_fail})
+ end,
loose_node:stop(Node),
- ?line ?t:timetrap_cancel(Dog),
ok.
wait_restart(0, _Node) ->
- ?t:fail(not_restarted);
+ ct:fail(not_restarted);
wait_restart(N, Node) ->
case net_adm:ping(Node) of
pong -> ok;
_ ->
- ?t:sleep(1000),
+ ct:sleep(1000),
wait_restart(N - 1, Node)
end.
@@ -480,124 +439,98 @@ apid(Pid) ->
%% The reboot facility using heart is tested
%% in the heart_SUITE.
%% ------------------------------------------------
-reboot(doc) -> [];
-reboot(suite) -> {req, [distribution, {local_slave_nodes, 1}]};
reboot(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(40)),
-
Args = args(),
- ?line {ok, Node} = start_node(init_test, Args),
+ {ok, Node} = start_node(init_test, Args),
erlang:monitor_node(Node, true),
- ?line ok = rpc:call(Node, init, reboot, []),
- ?line receive
- {nodedown, Node} ->
- ok
- after 10000 ->
- stop_node(Node),
- ?t:fail(not_stopping)
- end,
- ?t:sleep(5000),
- ?line case net_adm:ping(Node) of
- pang ->
- ok;
- _ ->
- stop_node(Node),
- ?t:fail(system_rebooted)
- end,
- ?line ?t:timetrap_cancel(Dog),
+ ok = rpc:call(Node, init, reboot, []),
+ receive
+ {nodedown, Node} ->
+ ok
+ after 10000 ->
+ stop_node(Node),
+ ct:fail(not_stopping)
+ end,
+ ct:sleep(5000),
+ case net_adm:ping(Node) of
+ pang ->
+ ok;
+ _ ->
+ stop_node(Node),
+ ct:fail(system_rebooted)
+ end,
ok.
%% ------------------------------------------------
%%
%% ------------------------------------------------
-stop(doc) -> [];
-stop(suite) -> [];
stop(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(20)),
Args = args(),
- ?line {ok, Node} = start_node(init_test, Args),
+ {ok, Node} = start_node(init_test, Args),
erlang:monitor_node(Node, true),
- ?line ok = rpc:call(Node, init, reboot, []),
- ?line receive
- {nodedown, Node} ->
- ok
- after 10000 ->
- stop_node(Node),
- ?t:fail(not_stopping)
- end,
- ?t:sleep(5000),
- ?line case net_adm:ping(Node) of
- pang ->
- ok;
- _ ->
- stop_node(Node),
- ?t:fail(system_rebooted)
- end,
- ?line ?t:timetrap_cancel(Dog),
+ ok = rpc:call(Node, init, reboot, []),
+ receive
+ {nodedown, Node} ->
+ ok
+ after 10000 ->
+ stop_node(Node),
+ ct:fail(not_stopping)
+ end,
+ ct:sleep(5000),
+ case net_adm:ping(Node) of
+ pang ->
+ ok;
+ _ ->
+ stop_node(Node),
+ ct:fail(system_rebooted)
+ end,
ok.
%% ------------------------------------------------
%%
%% ------------------------------------------------
-get_status(doc) -> [];
-get_status(suite) -> [];
get_status(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(10)),
- ?line ?t:timetrap_cancel(Dog),
+ {Start, _} = init:get_status(),
- ?line {Start, _} = init:get_status(),
%% Depending on how the test_server is started Start has
%% different values. staring if test_server started with
%% -s flag.
- ?line case lists:member(Start, [started, starting]) of
- true ->
- ok;
- _ ->
- ?t:fail(get_status)
- end.
+ case lists:member(Start, [started, starting]) of
+ true ->
+ ok;
+ _ ->
+ ct:fail(get_status)
+ end.
%% ------------------------------------------------
%%
%% ------------------------------------------------
-script_id(doc) -> [];
-script_id(suite) -> [];
script_id(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(10)),
-
- ?line {Name, Vsn} = init:script_id(),
- ?line if
- is_list(Name), is_list(Vsn) ->
- ok;
- true ->
- ?t:fail(not_standard_script)
- end,
- ?line ?t:timetrap_cancel(Dog),
+ {Name, Vsn} = init:script_id(),
+ if
+ is_list(Name), is_list(Vsn) ->
+ ok;
+ true ->
+ ct:fail(not_standard_script)
+ end,
ok.
%% ------------------------------------------------
%% Start the slave system with -boot flag.
%% ------------------------------------------------
-boot1(doc) -> [];
-boot1(suite) -> {req, [distribution, {local_slave_nodes, 1}, {time, 35}]};
boot1(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(80)),
Args = args() ++ " -boot start_sasl",
- ?line {ok, Node} = start_node(init_test, Args),
- ?line stop_node(Node),
+ {ok, Node} = start_node(init_test, Args),
+ stop_node(Node),
%% Try to start with non existing boot file.
Args1 = args() ++ " -boot dummy_script",
- ?line {error, timeout} = start_node(init_test, Args1),
+ {error, timeout} = start_node(init_test, Args1),
- ?line ?t:timetrap_cancel(Dog),
ok.
-boot2(doc) -> [];
-boot2(suite) -> {req, [distribution, {local_slave_nodes, 1}, {time, 35}]};
boot2(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:seconds(80)),
-
%% Absolute boot file name
Boot = filename:join([code:root_dir(), "bin", "start_sasl"]),
@@ -610,9 +543,9 @@ boot2(Config) when is_list(Config) ->
%% Absolute boot file name for Windows -- all slashes are
%% converted to backslashes.
Win_boot = lists:map(fun
- ($/) -> $\\;
- (C) -> C
- end, Boot),
+ ($/) -> $\\;
+ (C) -> C
+ end, Boot),
Args2 = args() ++ " -boot \"" ++ Win_boot ++ "\"",
{ok, Node2} = start_node(init_test, Args2),
stop_node(Node2);
@@ -620,16 +553,15 @@ boot2(Config) when is_list(Config) ->
ok
end,
- ?t:timetrap_cancel(Dog),
ok.
%% Misc. functions
start_node(Name, Param) ->
- ?t:start_node(Name, slave, [{args, Param}]).
+ test_server:start_node(Name, slave, [{args, Param}]).
stop_node(Node) ->
- ?t:stop_node(Node).
+ test_server:stop_node(Node).
from(H, [H | T]) -> T;
from(H, [_ | T]) -> from(H, T);
@@ -645,18 +577,18 @@ long_args(A) ->
[A])).
create_script(Config) ->
- ?line PrivDir = ?config(priv_dir,Config),
- ?line Name = PrivDir ++ "boot_var_test",
- ?line Apps = application_controller:which_applications(),
- ?line {value,{_,_,KernelVer}} = lists:keysearch(kernel,1,Apps),
- ?line {value,{_,_,StdlibVer}} = lists:keysearch(stdlib,1,Apps),
- ?line {ok,Fd} = file:open(Name ++ ".rel", [write]),
- ?line io:format(Fd,
- "{release, {\"Test release 3\", \"P2A\"}, \n"
- " {erts, \"4.4\"}, \n"
- " [{kernel, \"~s\"}, {stdlib, \"~s\"}]}.\n",
- [KernelVer,StdlibVer]),
- ?line file:close(Fd),
+ PrivDir = proplists:get_value(priv_dir,Config),
+ Name = PrivDir ++ "boot_var_test",
+ Apps = application_controller:which_applications(),
+ {value,{_,_,KernelVer}} = lists:keysearch(kernel,1,Apps),
+ {value,{_,_,StdlibVer}} = lists:keysearch(stdlib,1,Apps),
+ {ok,Fd} = file:open(Name ++ ".rel", [write]),
+ io:format(Fd,
+ "{release, {\"Test release 3\", \"P2A\"}, \n"
+ " {erts, \"4.4\"}, \n"
+ " [{kernel, \"~s\"}, {stdlib, \"~s\"}]}.\n",
+ [KernelVer,StdlibVer]),
+ file:close(Fd),
{filename:dirname(Name), filename:basename(Name),
- KernelVer, StdlibVer}.
+ KernelVer, StdlibVer}.
diff --git a/lib/kernel/test/interactive_shell_SUITE.erl b/lib/kernel/test/interactive_shell_SUITE.erl
index d7fa52b721..414504e257 100644
--- a/lib/kernel/test/interactive_shell_SUITE.erl
+++ b/lib/kernel/test/interactive_shell_SUITE.erl
@@ -30,15 +30,14 @@
-export([toerl_server/3]).
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:minutes(3)),
- [{watchdog,Dog}|Config].
-
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+ Config.
+end_per_testcase(_Func, _Config) ->
+ ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,3}}].
all() ->
[get_columns_and_rows, exit_initial, job_control_local,
@@ -55,7 +54,7 @@ init_per_suite(Config) ->
[{default_shell,DefShell},{term,Term}|Config].
end_per_suite(Config) ->
- Term = ?config(term,Config),
+ Term = proplists:get_value(term,Config),
os:putenv("TERM",Term),
ok.
@@ -66,68 +65,66 @@ end_per_group(_GroupName, Config) ->
Config.
-%-define(DEBUG,1).
+%%-define(DEBUG,1).
-ifdef(DEBUG).
-define(dbg(Data),erlang:display(Data)).
-else.
-define(dbg(Data),noop).
-endif.
-get_columns_and_rows(suite) -> [];
-get_columns_and_rows(doc) -> ["Test that the shell can access columns and rows"];
+%% Test that the shell can access columns and rows.
get_columns_and_rows(Config) when is_list(Config) ->
case proplists:get_value(default_shell,Config) of
old ->
%% Old shell tests
?dbg(old_shell),
- ?line rtnode([{putline,""},
- {putline, "2."},
- {getline, "2"},
- {putline,"io:columns()."},
- {getline_re,".*{error,enotsup}"},
- {putline,"io:rows()."},
- {getline_re,".*{error,enotsup}"}
-
- ],[]),
- ?line rtnode([{putline,""},
- {putline, "2."},
- {getline, "2"},
- {putline,"io:columns()."},
- {getline_re,".*{ok,90}"},
- {putline,"io:rows()."},
- {getline_re,".*{ok,40}"}],
- [],
- "stty rows 40; stty columns 90; ");
+ rtnode([{putline,""},
+ {putline, "2."},
+ {getline, "2"},
+ {putline,"io:columns()."},
+ {getline_re,".*{error,enotsup}"},
+ {putline,"io:rows()."},
+ {getline_re,".*{error,enotsup}"}
+
+ ],[]),
+ rtnode([{putline,""},
+ {putline, "2."},
+ {getline, "2"},
+ {putline,"io:columns()."},
+ {getline_re,".*{ok,90}"},
+ {putline,"io:rows()."},
+ {getline_re,".*{ok,40}"}],
+ [],
+ "stty rows 40; stty columns 90; ");
new ->
- % New shell tests
+ %% New shell tests
?dbg(new_shell),
- ?line rtnode([{putline,""},
- {putline, "2."},
- {getline, "2"},
- {putline,"io:columns()."},
- %% Behaviour change in R12B-5, returns 80
- %% {getline,"{error,enotsup}"},
- {getline,"{ok,80}"},
- {putline,"io:rows()."},
- %% Behaviour change in R12B-5, returns 24
- %% {getline,"{error,enotsup}"}
- {getline,"{ok,24}"}
- ],[]),
- ?line rtnode([{putline,""},
- {putline, "2."},
- {getline, "2"},
- {putline,"io:columns()."},
- {getline,"{ok,90}"},
- {putline,"io:rows()."},
- {getline,"{ok,40}"}],
- [],
- "stty rows 40; stty columns 90; ")
+ rtnode([{putline,""},
+ {putline, "2."},
+ {getline, "2"},
+ {putline,"io:columns()."},
+ %% Behaviour change in R12B-5, returns 80
+ %% {getline,"{error,enotsup}"},
+ {getline,"{ok,80}"},
+ {putline,"io:rows()."},
+ %% Behaviour change in R12B-5, returns 24
+ %% {getline,"{error,enotsup}"}
+ {getline,"{ok,24}"}
+ ],[]),
+ rtnode([{putline,""},
+ {putline, "2."},
+ {getline, "2"},
+ {putline,"io:columns()."},
+ {getline,"{ok,90}"},
+ {putline,"io:rows()."},
+ {getline,"{ok,40}"}],
+ [],
+ "stty rows 40; stty columns 90; ")
end.
-
-
-exit_initial(suite) -> [];
-exit_initial(doc) -> ["Tests that exit of initial shell restarts shell"];
+
+
+%% Tests that exit of initial shell restarts shell.
exit_initial(Config) when is_list(Config) ->
case proplists:get_value(default_shell,Config) of
old ->
@@ -152,9 +149,7 @@ exit_initial(Config) when is_list(Config) ->
{getline_re,"35"}],[])
end.
-job_control_local(suite) -> [];
-job_control_local(doc) -> [ "Tests that local shell can be "
- "started by means of job control" ];
+%% Tests that local shell can be started by means of job control.
job_control_local(Config) when is_list(Config) ->
case proplists:get_value(default_shell,Config) of
old ->
@@ -162,133 +157,130 @@ job_control_local(Config) when is_list(Config) ->
{skip,"No new shell found"};
new ->
%% New shell tests
- ?line rtnode([{putline,""},
- {putline, "2."},
- {getline, "2"},
- {putline,[7]},
- {sleep,timeout(short)},
- {putline,""},
- {getline," -->"},
- {putline,"s"},
- {putline,"c"},
- {putline_raw,""},
- {getline,"Eshell"},
- {putline_raw,""},
- {getline,"1>"},
- {putline,"35."},
- {getline,"35"}],[])
+ rtnode([{putline,""},
+ {putline, "2."},
+ {getline, "2"},
+ {putline,[7]},
+ {sleep,timeout(short)},
+ {putline,""},
+ {getline," -->"},
+ {putline,"s"},
+ {putline,"c"},
+ {putline_raw,""},
+ {getline,"Eshell"},
+ {putline_raw,""},
+ {getline,"1>"},
+ {putline,"35."},
+ {getline,"35"}],[])
end.
-job_control_remote(suite) -> [];
job_control_remote(doc) -> [ "Tests that remote shell can be "
"started by means of job control" ];
job_control_remote(Config) when is_list(Config) ->
case {node(),proplists:get_value(default_shell,Config)} of
{nonode@nohost,_} ->
- ?line exit(not_distributed);
+ exit(not_distributed);
{_,old} ->
{skip,"No new shell found"};
_ ->
- ?line RNode = create_nodename(),
- ?line MyNode = atom2list(node()),
- ?line Pid = spawn_link(fun() ->
- receive die ->
- ok
- end
- end),
- ?line PidStr = pid_to_list(Pid),
- ?line register(kalaskula,Pid),
- ?line CookieString = lists:flatten(
- io_lib:format("~w",
- [erlang:get_cookie()])),
- ?line Res = rtnode([{putline,""},
- {putline, "erlang:get_cookie()."},
- {getline, CookieString},
- {putline,[7]},
- {sleep,timeout(short)},
- {putline,""},
- {getline," -->"},
- {putline,"r '"++MyNode++"'"},
- {putline,"c"},
- {putline_raw,""},
- {getline,"Eshell"},
- {sleep,timeout(short)},
- {putline_raw,""},
- {getline,"("++MyNode++")1>"},
- {putline,"whereis(kalaskula)."},
- {getline,PidStr},
- {sleep,timeout(short)}, % Race, known bug.
- {putline_raw,"exit()."},
- {getline,"***"},
- {putline,[7]},
- {putline,""},
- {getline," -->"},
- {putline,"c 1"},
- {putline,""},
- {sleep,timeout(short)},
- {putline_raw,""},
- {getline,"("++RNode++")"}],RNode),
- ?line Pid ! die,
- ?line Res
+ RNode = create_nodename(),
+ MyNode = atom2list(node()),
+ Pid = spawn_link(fun() ->
+ receive die ->
+ ok
+ end
+ end),
+ PidStr = pid_to_list(Pid),
+ register(kalaskula,Pid),
+ CookieString = lists:flatten(
+ io_lib:format("~w",
+ [erlang:get_cookie()])),
+ Res = rtnode([{putline,""},
+ {putline, "erlang:get_cookie()."},
+ {getline, CookieString},
+ {putline,[7]},
+ {sleep,timeout(short)},
+ {putline,""},
+ {getline," -->"},
+ {putline,"r '"++MyNode++"'"},
+ {putline,"c"},
+ {putline_raw,""},
+ {getline,"Eshell"},
+ {sleep,timeout(short)},
+ {putline_raw,""},
+ {getline,"("++MyNode++")1>"},
+ {putline,"whereis(kalaskula)."},
+ {getline,PidStr},
+ {sleep,timeout(short)}, % Race, known bug.
+ {putline_raw,"exit()."},
+ {getline,"***"},
+ {putline,[7]},
+ {putline,""},
+ {getline," -->"},
+ {putline,"c 1"},
+ {putline,""},
+ {sleep,timeout(short)},
+ {putline_raw,""},
+ {getline,"("++RNode++")"}],RNode),
+ Pid ! die,
+ Res
end.
-job_control_remote_noshell(suite) -> [];
-job_control_remote_noshell(doc) ->
- [ "Tests that remote shell can be "
- "started by means of job control to -noshell node" ];
+
+%% Tests that remote shell can be
+%% started by means of job control to -noshell node.
job_control_remote_noshell(Config) when is_list(Config) ->
case {node(),proplists:get_value(default_shell,Config)} of
{nonode@nohost,_} ->
- ?line exit(not_distributed);
+ exit(not_distributed);
{_,old} ->
{skip,"No new shell found"};
_ ->
- ?line RNode = create_nodename(),
- ?line NSNode = start_noshell_node(interactive_shell_noshell),
- ?line Pid = spawn_link(NSNode, fun() ->
- receive die ->
- ok
- end
- end),
- ?line PidStr = rpc:call(NSNode,erlang,pid_to_list,[Pid]),
- ?line true = rpc:call(NSNode,erlang,register,[kalaskula,Pid]),
- ?line NSNodeStr = atom2list(NSNode),
- ?line CookieString = lists:flatten(
- io_lib:format("~w",
- [erlang:get_cookie()])),
- ?line Res = rtnode([{putline,""},
- {putline, "erlang:get_cookie()."},
- {getline, CookieString},
- {putline,[7]},
- {sleep,timeout(short)},
- {putline,""},
- {getline," -->"},
- {putline,"r '"++NSNodeStr++"'"},
- {putline,"c"},
- {putline_raw,""},
- {getline,"Eshell"},
- {sleep,timeout(short)},
- {putline_raw,""},
- {getline,"("++NSNodeStr++")1>"},
- {putline,"whereis(kalaskula)."},
- {getline,PidStr},
- {sleep,timeout(short)}, % Race, known bug.
- {putline_raw,"exit()."},
- {getline,"***"},
- {putline,[7]},
- {putline,""},
- {getline," -->"},
- {putline,"c 1"},
- {putline,""},
- {sleep,timeout(short)},
- {putline_raw,""},
- {getline,"("++RNode++")"}],RNode),
- ?line Pid ! die,
- ?line stop_noshell_node(NSNode),
- ?line Res
+ RNode = create_nodename(),
+ NSNode = start_noshell_node(interactive_shell_noshell),
+ Pid = spawn_link(NSNode, fun() ->
+ receive die ->
+ ok
+ end
+ end),
+ PidStr = rpc:call(NSNode,erlang,pid_to_list,[Pid]),
+ true = rpc:call(NSNode,erlang,register,[kalaskula,Pid]),
+ NSNodeStr = atom2list(NSNode),
+ CookieString = lists:flatten(
+ io_lib:format("~w",
+ [erlang:get_cookie()])),
+ Res = rtnode([{putline,""},
+ {putline, "erlang:get_cookie()."},
+ {getline, CookieString},
+ {putline,[7]},
+ {sleep,timeout(short)},
+ {putline,""},
+ {getline," -->"},
+ {putline,"r '"++NSNodeStr++"'"},
+ {putline,"c"},
+ {putline_raw,""},
+ {getline,"Eshell"},
+ {sleep,timeout(short)},
+ {putline_raw,""},
+ {getline,"("++NSNodeStr++")1>"},
+ {putline,"whereis(kalaskula)."},
+ {getline,PidStr},
+ {sleep,timeout(short)}, % Race, known bug.
+ {putline_raw,"exit()."},
+ {getline,"***"},
+ {putline,[7]},
+ {putline,""},
+ {getline," -->"},
+ {putline,"c 1"},
+ {putline,""},
+ {sleep,timeout(short)},
+ {putline_raw,""},
+ {getline,"("++RNode++")"}],RNode),
+ Pid ! die,
+ stop_noshell_node(NSNode),
+ Res
end.
-ctrl_keys(suite) -> [];
-ctrl_keys(doc) -> ["Tests various control keys"];
+%% Tests various control keys.
ctrl_keys(_Conf) when is_list(_Conf) ->
Cu=[$\^u],
Cw=[$\^w],
@@ -308,7 +300,7 @@ ctrl_keys(_Conf) when is_list(_Conf) ->
{getline,"\"hello world\""},
{putline,"\"hello world\""++Cu++Cy++"."},
{getline,"\"hello world\""}]
- ++wordLeft()++wordRight(),[]).
+ ++wordLeft()++wordRight(),[]).
wordLeft() ->
@@ -337,46 +329,46 @@ wordRight(Chars) ->
rtnode(C,N) ->
rtnode(C,N,[]).
rtnode(Commands,Nodename,ErlPrefix) ->
- ?line case get_progs() of
- {error,_Reason} ->
- ?line {skip,"No runerl present"};
- {RunErl,ToErl,Erl} ->
- ?line case create_tempdir() of
- {error, Reason2} ->
- ?line {skip, Reason2};
- Tempdir ->
- ?line SPid =
- start_runerl_node(RunErl,ErlPrefix++"\\\""++Erl++"\\\"",
- Tempdir,Nodename),
- ?line CPid = start_toerl_server(ToErl,Tempdir),
- ?line erase(getline_skipped),
- ?line Res =
- (catch get_and_put(CPid, Commands,1)),
- ?line case stop_runerl_node(CPid) of
- {error,_} ->
- ?line CPid2 =
- start_toerl_server
- (ToErl,Tempdir),
- ?line erase(getline_skipped),
- ?line ok = get_and_put
- (CPid2,
- [{putline,[7]},
- {sleep,
- timeout(short)},
- {putline,""},
- {getline," -->"},
- {putline,"s"},
- {putline,"c"},
- {putline,""}],1),
- ?line stop_runerl_node(CPid2);
- _ ->
- ?line ok
- end,
- ?line wait_for_runerl_server(SPid),
- ?line ok = rm_rf(Tempdir),
- ?line ok = Res
- end
- end.
+ case get_progs() of
+ {error,_Reason} ->
+ {skip,"No runerl present"};
+ {RunErl,ToErl,Erl} ->
+ case create_tempdir() of
+ {error, Reason2} ->
+ {skip, Reason2};
+ Tempdir ->
+ SPid =
+ start_runerl_node(RunErl,ErlPrefix++"\\\""++Erl++"\\\"",
+ Tempdir,Nodename),
+ CPid = start_toerl_server(ToErl,Tempdir),
+ erase(getline_skipped),
+ Res =
+ (catch get_and_put(CPid, Commands,1)),
+ case stop_runerl_node(CPid) of
+ {error,_} ->
+ CPid2 =
+ start_toerl_server
+ (ToErl,Tempdir),
+ erase(getline_skipped),
+ ok = get_and_put
+ (CPid2,
+ [{putline,[7]},
+ {sleep,
+ timeout(short)},
+ {putline,""},
+ {getline," -->"},
+ {putline,"s"},
+ {putline,"c"},
+ {putline,""}],1),
+ stop_runerl_node(CPid2);
+ _ ->
+ ok
+ end,
+ wait_for_runerl_server(SPid),
+ ok = rm_rf(Tempdir),
+ ok = Res
+ end
+ end.
timeout(long) ->
2 * timeout(normal);
@@ -389,7 +381,7 @@ timeout(normal) ->
start_noshell_node(Name) ->
PADir = filename:dirname(code:which(?MODULE)),
{ok, Node} = test_server:start_node(Name,slave,[{args," -noshell -pa "++
- PADir++" "}]),
+ PADir++" "}]),
Node.
stop_noshell_node(Node) ->
test_server:stop_node(Node).
@@ -397,20 +389,20 @@ stop_noshell_node(Node) ->
rm_rf(Dir) ->
try
- {ok,List} = file:list_dir(Dir),
- Files = [filename:join([Dir,X]) || X <- List],
- [case file:list_dir(Y) of
- {error, enotdir} ->
- ok = file:delete(Y);
- _ ->
- ok = rm_rf(Y)
- end || Y <- Files],
- ok = file:del_dir(Dir),
- ok
+ {ok,List} = file:list_dir(Dir),
+ Files = [filename:join([Dir,X]) || X <- List],
+ [case file:list_dir(Y) of
+ {error, enotdir} ->
+ ok = file:delete(Y);
+ _ ->
+ ok = rm_rf(Y)
+ end || Y <- Files],
+ ok = file:del_dir(Dir),
+ ok
catch
_:Exception -> {error, {Exception,Dir}}
end.
-
+
get_and_put(_CPid,[],_) ->
ok;
@@ -479,7 +471,7 @@ get_and_put(CPid, [{putline_raw, Line}|T],N) ->
Timeout = timeout(normal),
receive
{send_line, ok} ->
- get_and_put(CPid, T,N+1)
+ get_and_put(CPid, T,N+1)
after Timeout ->
error_logger:error_msg("~p: putline_raw timeout (~p) sending "
"\"~s\" (command number ~p)~n",
@@ -493,7 +485,7 @@ get_and_put(CPid, [{putline, Line}|T],N) ->
Timeout = timeout(normal),
receive
{send_line, ok} ->
- get_and_put(CPid, [{getline, []}|T],N)
+ get_and_put(CPid, [{getline, []}|T],N)
after Timeout ->
error_logger:error_msg("~p: putline timeout (~p) sending "
"\"~s\" (command number ~p)~n[~p]~n",
@@ -510,8 +502,8 @@ wait_for_runerl_server(SPid) ->
after Timeout ->
{error, timeout}
end.
-
-
+
+
stop_runerl_node(CPid) ->
Ref = erlang:monitor(process, CPid),
@@ -562,11 +554,11 @@ create_tempdir(Dir,X) when X > $Z, X < $a ->
create_tempdir(Dir,$a);
create_tempdir(Dir,X) when X > $z ->
Estr = lists:flatten(
- io_lib:format("Unable to create ~s, reason eexist",
- [Dir++[$z]])),
+ io_lib:format("Unable to create ~s, reason eexist",
+ [Dir++[$z]])),
{error, Estr};
create_tempdir(Dir0, Ch) ->
- % Expect fairly standard unix.
+ %% Expect fairly standard unix.
Dir = Dir0++[Ch],
case file:make_dir(Dir) of
{error, eexist} ->
@@ -604,13 +596,13 @@ start_runerl_node(RunErl,Erl,Tempdir,Nodename) ->
[];
_ ->
" -sname "++(if is_atom(Nodename) -> atom_to_list(Nodename);
- true -> Nodename
- end)++
+ true -> Nodename
+ end)++
" -setcookie "++atom_to_list(erlang:get_cookie())
end,
spawn(fun() ->
os:cmd("\""++RunErl++"\" "++Tempdir++"/ "++Tempdir++" \""++
- Erl++XArg++"\"")
+ Erl++XArg++"\"")
end).
start_toerl_server(ToErl,Tempdir) ->
@@ -668,7 +660,7 @@ toerl_loop(Port,Acc) ->
_ ->
toerl_loop(Port,[{Tag0,Data}|Acc])
end;
- {Pid,{get_line,Timeout}} ->
+ {Pid,{get_line,Timeout}} ->
case Acc of
[] ->
case get_data_within(Port,Timeout,[]) of
@@ -717,10 +709,10 @@ toerl_loop(Port,Acc) ->
Other ->
{error, {unexpected, Other}}
end.
-
+
millistamp() ->
erlang:monotonic_time(milli_seconds).
-
+
get_data_within(Port, X, Acc) when X =< 0 ->
?dbg({get_data_within, X, Acc, ?LINE}),
receive
@@ -751,7 +743,7 @@ get_data_within(Port, Timeout, Acc) ->
after Timeout ->
timeout
end.
-
+
get_default_shell() ->
try
rtnode([{putline,""},
diff --git a/lib/kernel/test/kernel_SUITE.erl b/lib/kernel/test/kernel_SUITE.erl
index 64c7ce6136..e02aa2aa8d 100644
--- a/lib/kernel/test/kernel_SUITE.erl
+++ b/lib/kernel/test/kernel_SUITE.erl
@@ -24,18 +24,17 @@
-include_lib("common_test/include/ct.hrl").
-% Test server specific exports
+%% Test server specific exports
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2]).
-export([init_per_testcase/2, end_per_testcase/2]).
-% Test cases must be exported.
+%% Test cases must be exported.
-export([app_test/1, appup_test/1]).
-%%
-%% all/1
-%%
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[app_test, appup_test].
@@ -61,15 +60,12 @@ init_per_testcase(_Case, Config) ->
end_per_testcase(_Case, _Config) ->
ok.
-%
-% Test cases starts here.
-%
-app_test(doc) ->
- ["Tests the applications consistency."];
-app_test(suite) ->
- [];
+%%
+%% Test cases starts here.
+%%
+%% Tests the applications consistency.
app_test(Config) when is_list(Config) ->
- ?line ok=?t:app_test(kernel),
+ ok=test_server:app_test(kernel),
ok.
diff --git a/lib/kernel/test/kernel_config_SUITE.erl b/lib/kernel/test/kernel_config_SUITE.erl
index 1486619b1c..5f36ad995c 100644
--- a/lib/kernel/test/kernel_config_SUITE.erl
+++ b/lib/kernel/test/kernel_config_SUITE.erl
@@ -25,7 +25,9 @@
-export([init_per_suite/1, end_per_suite/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[sync].
@@ -40,13 +42,9 @@ end_per_group(_GroupName, Config) ->
Config.
-init_per_suite(doc) -> [];
-init_per_suite(suite) -> [];
init_per_suite(Config) when is_list(Config) ->
Config.
-end_per_suite(doc) -> [];
-end_per_suite(suite) -> [];
end_per_suite(Config) when is_list(Config) ->
stop_node(init_test),
Config.
@@ -54,7 +52,7 @@ end_per_suite(Config) when is_list(Config) ->
config(Fd) ->
M = from($@, atom_to_list(node())),
io:format(Fd, "[{kernel, [{sync_nodes_optional, ['cp1@~s','cp2@~s']},"
- "{sync_nodes_timeout, 15000}]}].~n",
+ "{sync_nodes_timeout, 15000}]}].~n",
[M, M]).
from(H, [H | T]) -> T;
@@ -67,12 +65,9 @@ from(_, []) -> [].
%% Should be started in a CC view with:
%% erl -sname XXX where XX not in [cp1, cp2]
%%-----------------------------------------------------------------
-sync(doc) -> [];
-sync(suite) -> [];
sync(Conf) when is_list(Conf) ->
- ?line Dog = ?t:timetrap(?t:seconds(120)),
- % Write a config file
- Dir = ?config(priv_dir,Conf),
+ %% Write a config file
+ Dir = proplists:get_value(priv_dir,Conf),
{ok, Fd} = file:open(Dir ++ "sys.config", [write]),
config(Fd),
file:close(Fd),
@@ -81,34 +76,33 @@ sync(Conf) when is_list(Conf) ->
%% Reset wall_clock
{T1,_} = erlang:statistics(wall_clock),
io:format("~p~n", [{t1, T1}]),
- ?line Command = lists:concat([lib:progname(),
- " -detached -sname cp1 ",
- "-config ", Config,
- " -env ERL_CRASH_DUMP erl_crash_dump.cp1"]),
+ Command = lists:concat([lib:progname(),
+ " -detached -sname cp1 ",
+ "-config ", Config,
+ " -env ERL_CRASH_DUMP erl_crash_dump.cp1"]),
io:format("Command: ~s", [Command]),
- ?line open_port({spawn, Command}, [stream]),
+ open_port({spawn, Command}, [stream]),
io:format("started~n"),
- ?line ?t:sleep(12000),
+ ct:sleep(12000),
io:format("waited12~n"),
- ?line Host = from($@, atom_to_list(node())),
- ?line Cp1 = list_to_atom("cp1@"++Host),
- ?line wait_for_node(Cp1),
+ Host = from($@, atom_to_list(node())),
+ Cp1 = list_to_atom("cp1@"++Host),
+ wait_for_node(Cp1),
io:format("waitednode~n"),
%% Check time since last call
- ?line {TT, T} = erlang:statistics(wall_clock),
+ {TT, T} = erlang:statistics(wall_clock),
io:format("~p~n", [{t2, {TT, T}}]),
- ?line stop_node(cp1),
+ stop_node(cp1),
if
- TT-T1 < 15000 -> ?line ?t:fail({too_short_time, TT-T1});
+ TT-T1 < 15000 -> ct:fail({too_short_time, TT-T1});
true -> ok
end,
- ?line ?t:timetrap_cancel(Dog),
ok.
wait_for_node(Node) ->
case rpc:call(Node, init, get_status, []) of
{started,_} -> ok;
- {badrpc, R} -> ?line ?t:fail({rpc_failed, R});
+ {badrpc, R} -> ct:fail({rpc_failed, R});
_Other -> wait_for_node(Node)
end.
diff --git a/lib/kernel/test/multi_load_SUITE.erl b/lib/kernel/test/multi_load_SUITE.erl
index bb87443e36..9cba6fc06e 100644
--- a/lib/kernel/test/multi_load_SUITE.erl
+++ b/lib/kernel/test/multi_load_SUITE.erl
@@ -28,7 +28,9 @@
-include_lib("common_test/include/ct.hrl").
-include_lib("syntax_tools/include/merl.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[basic_atomic_load,basic_errors,sticky_dir,on_load_failing,
@@ -272,7 +274,12 @@ do_ensure_modules_loaded(Dir) ->
true = is_loaded(Mod),
true = is_loaded(OLMod),
true = is_loaded(NativeMod),
- true = NativeMod:module_info(native),
+
+ ModuleNative = case erlang:system_info(hipe_architecture) of
+ undefined -> false;
+ _ -> true
+ end,
+ ModuleNative = NativeMod:module_info(native),
ok.
@@ -357,9 +364,9 @@ atomic_load_error(Modules, ErrorInFinishLoading) ->
{B,B} ->
Errors;
{false,true} ->
- ct:fail("LastAction fun must not be called");
+ ct:fail("code:prepare_loading/1 should have failed");
{true,false} ->
- ct:fail("LastAction fun was not called")
+ ct:fail("code:prepare_loading/1 should have succeeded")
end.
is_loaded(Mod) ->
diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl
index 29fc3a2ea5..782d34416b 100644
--- a/lib/kernel/test/os_SUITE.erl
+++ b/lib/kernel/test/os_SUITE.erl
@@ -28,7 +28,9 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[space_in_cwd, quoting, cmd_unicode, space_in_name, bad_command,
@@ -56,15 +58,13 @@ init_per_testcase(_TC,Config) ->
end_per_testcase(_,_Config) ->
ok.
-space_in_cwd(doc) ->
- "Test that executing a command in a current working directory "
- "with space in its name works.";
-space_in_cwd(suite) -> [];
+%% Test that executing a command in a current working directory
+%% with space in its name works.
space_in_cwd(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Dirname = filename:join(PrivDir, "cwd with space"),
- ?line ok = file:make_dir(Dirname),
- ?line ok = file:set_cwd(Dirname),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Dirname = filename:join(PrivDir, "cwd with space"),
+ ok = file:make_dir(Dirname),
+ ok = file:set_cwd(Dirname),
%% Using `more' gives the almost the same result on both Unix and Windows.
@@ -75,70 +75,66 @@ space_in_cwd(Config) when is_list(Config) ->
"more </dev/null"
end,
- ?line case os:cmd(Cmd) of
- [] -> ok; % Unix.
- "\r\n" -> ok; % Windows.
- Other ->
- ?line test_server:fail({unexpected, Other})
- end,
+ case os:cmd(Cmd) of
+ [] -> ok; % Unix.
+ "\r\n" -> ok; % Windows.
+ Other ->
+ ct:fail({unexpected, Other})
+ end,
- ?t:sleep(5),
- ?line [] = receive_all(),
+ ct:sleep(5),
+ [] = receive_all(),
ok.
-quoting(doc) -> "Test that various ways of quoting arguments work.";
-quoting(suite) -> [];
+%% Test that various ways of quoting arguments work.
quoting(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line Echo = filename:join(DataDir, "my_echo"),
-
- ?line comp("one", os:cmd(Echo ++ " one")),
- ?line comp("one::two", os:cmd(Echo ++ " one two")),
- ?line comp("one two", os:cmd(Echo ++ " \"one two\"")),
- ?line comp("x::one two::y", os:cmd(Echo ++ " x \"one two\" y")),
- ?line comp("x::one two", os:cmd(Echo ++ " x \"one two\"")),
- ?line comp("one two::y", os:cmd(Echo ++ " \"one two\" y")),
- ?line comp("x::::y", os:cmd(Echo ++ " x \"\" y")),
- ?t:sleep(5),
- ?line [] = receive_all(),
+ DataDir = proplists:get_value(data_dir, Config),
+ Echo = filename:join(DataDir, "my_echo"),
+
+ comp("one", os:cmd(Echo ++ " one")),
+ comp("one::two", os:cmd(Echo ++ " one two")),
+ comp("one two", os:cmd(Echo ++ " \"one two\"")),
+ comp("x::one two::y", os:cmd(Echo ++ " x \"one two\" y")),
+ comp("x::one two", os:cmd(Echo ++ " x \"one two\"")),
+ comp("one two::y", os:cmd(Echo ++ " \"one two\" y")),
+ comp("x::::y", os:cmd(Echo ++ " x \"\" y")),
+ ct:sleep(5),
+ [] = receive_all(),
ok.
-cmd_unicode(doc) -> "Test that unicode arguments work.";
-cmd_unicode(suite) -> [];
+%% Test that unicode arguments work.
cmd_unicode(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line Echo = filename:join(DataDir, "my_echo"),
-
- ?line comp("one", os:cmd(Echo ++ " one")),
- ?line comp("one::two", os:cmd(Echo ++ " one two")),
- ?line comp("åäö::ϼΩ", os:cmd(Echo ++ " åäö " ++ [1020, 937])),
- ?t:sleep(5),
- ?line [] = receive_all(),
+ DataDir = proplists:get_value(data_dir, Config),
+ Echo = filename:join(DataDir, "my_echo"),
+
+ comp("one", os:cmd(Echo ++ " one")),
+ comp("one::two", os:cmd(Echo ++ " one two")),
+ comp("åäö::ϼΩ", os:cmd(Echo ++ " åäö " ++ [1020, 937])),
+ ct:sleep(5),
+ [] = receive_all(),
ok.
-space_in_name(doc) ->
- "Test that program with a space in its name can be executed.";
-space_in_name(suite) -> [];
+%% Test that program with a space in its name can be executed.
space_in_name(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line DataDir = ?config(data_dir, Config),
- ?line Spacedir = filename:join(PrivDir, "program files"),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ Spacedir = filename:join(PrivDir, "program files"),
Ext = case os:type() of
{win32,_} -> ".exe";
_ -> ""
end,
- ?line OrigEcho = filename:join(DataDir, "my_echo" ++ Ext),
- ?line Echo0 = filename:join(Spacedir, "my_echo" ++ Ext),
+ OrigEcho = filename:join(DataDir, "my_echo" ++ Ext),
+ Echo0 = filename:join(Spacedir, "my_echo" ++ Ext),
%% Copy the `my_echo' program to a directory whose name contains a space.
- ?line ok = file:make_dir(Spacedir),
- ?line {ok, Bin} = file:read_file(OrigEcho),
- ?line ok = file:write_file(Echo0, Bin),
- ?line Echo = filename:nativename(Echo0),
- ?line ok = file:change_mode(Echo, 8#777), % Make it executable on Unix.
+ ok = file:make_dir(Spacedir),
+ {ok, Bin} = file:read_file(OrigEcho),
+ ok = file:write_file(Echo0, Bin),
+ Echo = filename:nativename(Echo0),
+ ok = file:change_mode(Echo, 8#777), % Make it executable on Unix.
%% Run the echo program.
%% Quoting on windows depends on if the full path of the executable
@@ -154,78 +150,74 @@ space_in_name(Config) when is_list(Config) ->
_ ->
"\""
end,
- ?line comp("", os:cmd(Quote ++ Echo ++ Quote)),
- ?line comp("a::b::c", os:cmd(Quote ++ Echo ++ Quote ++ " a b c")),
- ?t:sleep(5),
- ?line [] = receive_all(),
+ comp("", os:cmd(Quote ++ Echo ++ Quote)),
+ comp("a::b::c", os:cmd(Quote ++ Echo ++ Quote ++ " a b c")),
+ ct:sleep(5),
+ [] = receive_all(),
ok.
-bad_command(doc) ->
- "Check that a bad command doesn't crasch the server or the emulator (it used to).";
-bad_command(suite) -> [];
+%% Check that a bad command doesn't crasch the server or the emulator (it used to).
bad_command(Config) when is_list(Config) ->
- ?line catch os:cmd([a|b]),
- ?line catch os:cmd({bad, thing}),
+ catch os:cmd([a|b]),
+ catch os:cmd({bad, thing}),
%% This should at least not crash (on Unix it typically returns
%% a message from the shell).
- ?line os:cmd("xxxxx"),
+ os:cmd("xxxxx"),
ok.
-find_executable(suite) -> [];
-find_executable(doc) -> [];
find_executable(Config) when is_list(Config) ->
case os:type() of
{win32, _} ->
- ?line DataDir = filename:join(?config(data_dir, Config), "win32"),
- ?line ok = file:set_cwd(filename:join([DataDir, "current"])),
- ?line Bin = filename:join(DataDir, "bin"),
- ?line Abin = filename:join(DataDir, "abin"),
- ?line UsrBin = filename:join([DataDir, "usr", "bin"]),
- ?line {ok, Current} = file:get_cwd(),
+ DataDir = filename:join(proplists:get_value(data_dir, Config), "win32"),
+ ok = file:set_cwd(filename:join([DataDir, "current"])),
+ Bin = filename:join(DataDir, "bin"),
+ Abin = filename:join(DataDir, "abin"),
+ UsrBin = filename:join([DataDir, "usr", "bin"]),
+ {ok, Current} = file:get_cwd(),
- ?line Path = lists:concat([Bin, ";", Abin, ";", UsrBin]),
- ?line io:format("Path = ~s", [Path]),
+ Path = lists:concat([Bin, ";", Abin, ";", UsrBin]),
+ io:format("Path = ~s", [Path]),
%% Search for programs in Bin (second element in PATH).
- ?line find_exe(Abin, "my_ar", ".exe", Path),
- ?line find_exe(Abin, "my_ascii", ".com", Path),
- ?line find_exe(Abin, "my_adb", ".bat", Path),
+ find_exe(Abin, "my_ar", ".exe", Path),
+ find_exe(Abin, "my_ascii", ".com", Path),
+ find_exe(Abin, "my_adb", ".bat", Path),
%% OTP-3626 find names of executables given with extension
- ?line find_exe(Abin, "my_ar.exe", "", Path),
- ?line find_exe(Abin, "my_ascii.com", "", Path),
- ?line find_exe(Abin, "my_adb.bat", "", Path),
- ?line find_exe(Abin, "my_ar.EXE", "", Path),
- ?line find_exe(Abin, "my_ascii.COM", "", Path),
- ?line find_exe(Abin, "MY_ADB.BAT", "", Path),
+ find_exe(Abin, "my_ar.exe", "", Path),
+ find_exe(Abin, "my_ascii.com", "", Path),
+ find_exe(Abin, "my_adb.bat", "", Path),
+ find_exe(Abin, "my_ar.EXE", "", Path),
+ find_exe(Abin, "my_ascii.COM", "", Path),
+ find_exe(Abin, "MY_ADB.BAT", "", Path),
%% Search for programs in Abin (second element in PATH).
- ?line find_exe(Abin, "my_ar", ".exe", Path),
- ?line find_exe(Abin, "my_ascii", ".com", Path),
- ?line find_exe(Abin, "my_adb", ".bat", Path),
+ find_exe(Abin, "my_ar", ".exe", Path),
+ find_exe(Abin, "my_ascii", ".com", Path),
+ find_exe(Abin, "my_adb", ".bat", Path),
%% Search for programs in the current working directory.
- ?line find_exe(Current, "my_program", ".exe", Path),
- ?line find_exe(Current, "my_command", ".com", Path),
- ?line find_exe(Current, "my_batch", ".bat", Path),
+ find_exe(Current, "my_program", ".exe", Path),
+ find_exe(Current, "my_command", ".com", Path),
+ find_exe(Current, "my_batch", ".bat", Path),
ok;
{unix, _} ->
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
%% Smoke test.
case lib:progname() of
erl ->
- ?line ErlPath = os:find_executable("erl"),
- ?line true = is_list(ErlPath),
- ?line true = filelib:is_regular(ErlPath);
+ ErlPath = os:find_executable("erl"),
+ true = is_list(ErlPath),
+ true = filelib:is_regular(ErlPath);
_ ->
%% Don't bother -- the progname could include options.
ok
end,
%% Never return a directory name.
- ?line false = os:find_executable("unix", [DataDir]),
+ false = os:find_executable("unix", [DataDir]),
ok
end.
@@ -241,29 +233,23 @@ find_exe(Where, Name, Ext, Path) ->
Other ->
io:format("Expected ~p; got (converted to absolute) ~p",
[Expected, Other]),
- test_server:fail()
+ ct:fail(failed)
end;
Other ->
io:format("Expected ~p; got ~p", [Expected, Other]),
- test_server:fail()
+ ct:fail(failed)
end.
-unix_comment_in_command(doc) ->
- "OTP-1805: Test that os:cmd(\"ls #\") works correctly (used to hang).";
-unix_comment_in_command(suite) -> [];
+%% OTP-1805: Test that os:cmd(\ls #\) works correctly (used to hang).
unix_comment_in_command(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(20)),
- ?line Priv = ?config(priv_dir, Config),
- ?line ok = file:set_cwd(Priv),
- ?line _ = os:cmd("ls #"), % Any result is ok.
- ?t:sleep(5),
- ?line [] = receive_all(),
- ?line test_server:timetrap_cancel(Dog),
+ Priv = proplists:get_value(priv_dir, Config),
+ ok = file:set_cwd(Priv),
+ _ = os:cmd("ls #"), % Any result is ok.
+ ct:sleep(5),
+ [] = receive_all(),
ok.
-deep_list_command(doc) ->
- "Check that a deep list in command works equally on unix and on windows.";
-deep_list_command(suite) -> [];
+%% Check that a deep list in command works equally on unix and on windows.
deep_list_command(Config) when is_list(Config) ->
%% As a 'io_lib' module description says: "There is no guarantee that the
%% character lists returned from some of the functions are flat, they can
@@ -275,10 +261,8 @@ deep_list_command(Config) when is_list(Config) ->
%% FYI: [$e, $c, "ho"] =:= io_lib:format("ec~s", ["ho"])
ok.
-large_output_command(doc) ->
- "Test to take sure that the correct data is"
- "received when doing large commands";
-large_output_command(suite) -> [];
+%% Test to take sure that the correct data is
+%% received when doing large commands.
large_output_command(Config) when is_list(Config) ->
%% Maximum allowed on windows is 8192, so we test well below that
AAA = lists:duplicate(7000, $a),
@@ -325,7 +309,7 @@ comp(Expected, Got) ->
Other ->
ok = io:format("Expected: ~ts\n", [Expected]),
ok = io:format("Got: ~ts\n", [Other]),
- test_server:fail()
+ ct:fail(failed)
end.
%% Like lib:nonl/1, but strips \r as well as \n.
diff --git a/lib/kernel/test/pdict_SUITE.erl b/lib/kernel/test/pdict_SUITE.erl
index 80025d2fd9..a89fdf4797 100644
--- a/lib/kernel/test/pdict_SUITE.erl
+++ b/lib/kernel/test/pdict_SUITE.erl
@@ -18,7 +18,6 @@
%% %CopyrightEnd%
%%
-module(pdict_SUITE).
-%% NB: The ?line macro cannot be used when testing the dictionary.
-include_lib("common_test/include/ct.hrl").
@@ -38,14 +37,14 @@
-export([other_process/2]).
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(test_server:minutes(10)),
- [{watchdog, Dog} | Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[simple, complicated, heavy, simple_all_keys, info,
@@ -67,10 +66,7 @@ end_per_group(_GroupName, Config) ->
Config.
-simple(doc) ->
- ["Tests simple functionality in process dictionary."];
-simple(suite) ->
- [];
+%% Tests simple functionality in process dictionary.
simple(Config) when is_list(Config) ->
XX = get(),
ok = match_keys(XX),
@@ -111,7 +107,7 @@ complicated(Config) when is_list(Config) ->
Previous = get(),
ok = match_keys(Previous),
Previous = erase(),
- N = case ?t:is_debug() of
+ N = case test_server:is_debug() of
false -> 500000;
true -> 5000
end,
@@ -145,10 +141,7 @@ comp_4([{{key,_}=K,{value,_}=Val}|T]) ->
comp_4(T);
comp_4([]) -> ok.
-heavy(doc) ->
- ["Tests heavy usage of the process dictionary"];
-heavy(suite) ->
- [];
+%% Tests heavy usage of the process dictionary.
heavy(Config) when is_list(Config) ->
XX = get(),
erase(),
@@ -158,7 +151,7 @@ heavy(Config) when is_list(Config) ->
?M([],get()),
time(5000),
?M([],get()),
- case {os:type(),?t:is_debug()} of
+ case {os:type(),test_server:is_debug()} of
{_,true} -> ok;
_ ->
time(50000),
@@ -187,10 +180,7 @@ simple_all_keys_del_loop([K|Ks]) ->
ok = match_keys(get()),
simple_all_keys_del_loop(Ks).
-info(doc) ->
- ["Tests process_info(Pid, dictionary)"];
-info(suite) ->
- [];
+%% Tests process_info(Pid, dictionary).
info(Config) when is_list(Config) ->
L = [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,
q,r,s,t,u,v,x,y,z,'A','B','C','D'],
diff --git a/lib/kernel/test/pg2_SUITE.erl b/lib/kernel/test/pg2_SUITE.erl
index 6e4f5ee682..53544be763 100644
--- a/lib/kernel/test/pg2_SUITE.erl
+++ b/lib/kernel/test/pg2_SUITE.erl
@@ -22,8 +22,8 @@
-module(pg2_SUITE).
-include_lib("common_test/include/ct.hrl").
--define(datadir, ?config(data_dir, Config)).
--define(privdir, ?config(priv_dir, Config)).
+-define(datadir, proplists:get_value(data_dir, Config)).
+-define(privdir, proplists:get_value(priv_dir, Config)).
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
@@ -33,27 +33,23 @@
otp_7277/1, otp_8259/1, otp_8653/1,
compat/1, basic/1]).
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
-define(TESTCASE, testcase_name).
--define(testcase, ?config(?TESTCASE, Config)).
+-define(testcase, proplists:get_value(?TESTCASE, Config)).
%% Internal export.
-export([mk_part_node_and_group/3, part2/4,
mk_part_node/3, part1/5, p_init/3, start_proc/1, sane/0]).
init_per_testcase(Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{?TESTCASE, Case}, {watchdog, Dog} | Config].
+ [{?TESTCASE, Case}| Config].
end_per_testcase(_Case, _Config) ->
test_server_ctrl:kill_slavenodes(),
- Dog = ?config(watchdog, _Config),
- test_server:timetrap_cancel(Dog),
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[{group, tickets}].
@@ -76,67 +72,59 @@ end_per_group(_GroupName, Config) ->
-otp_7277(doc) ->
- "OTP-7277. Bugfix leave().";
-otp_7277(suite) -> [];
+%% OTP-7277. Bugfix leave().
otp_7277(Config) when is_list(Config) ->
- ?line ok = pg2:create(a),
- ?line ok = pg2:create(b),
+ ok = pg2:create(a),
+ ok = pg2:create(b),
P = spawn(forever()),
- ?line ok = pg2:join(a, P),
- ?line ok = pg2:leave(b, P),
- ?line true = exit(P, kill),
+ ok = pg2:join(a, P),
+ ok = pg2:leave(b, P),
+ true = exit(P, kill),
case {pg2:get_members(a), pg2:get_local_members(a)} of
{[], []} ->
ok;
_ ->
timer:sleep(100),
- ?line [] = pg2:get_members(a),
- ?line [] = pg2:get_local_members(a)
+ [] = pg2:get_members(a),
+ [] = pg2:get_local_members(a)
end,
- ?line _ = pg2:delete(a),
- ?line _ = pg2:delete(b),
+ _ = pg2:delete(a),
+ _ = pg2:delete(b),
ok.
-define(UNTIL(Seq), loop_until_true(fun() -> Seq end, Config)).
-define(UNTIL_LOOP, 300).
-otp_8653(suite) -> [];
-otp_8653(doc) ->
- ["OTP-8259. Member was not removed after being killed."];
+%% OTP-8259. Member was not removed after being killed.
otp_8653(Config) when is_list(Config) ->
- Timeout = 15,
- ?line Dog = test_server:timetrap({seconds,Timeout}),
-
- ?line [A, B, C] = start_nodes([a, b, c], peer, Config),
+ [A, B, C] = start_nodes([a, b, c], peer, Config),
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
- % make b and c connected, partitioned from node() and a
- ?line rpc_cast(B, ?MODULE, part2, [Config, node(), A, C]),
- ?line ?UNTIL(is_ready_partition(Config)),
+ %% make b and c connected, partitioned from node() and a
+ rpc_cast(B, ?MODULE, part2, [Config, node(), A, C]),
+ ?UNTIL(is_ready_partition(Config)),
- % Connect to the other partition.
- ?line pong = net_adm:ping(B),
+ %% Connect to the other partition.
+ pong = net_adm:ping(B),
timer:sleep(100),
- ?line pong = net_adm:ping(C),
- ?line _ = global:sync(),
- ?line [A, B, C] = lists:sort(nodes()),
+ pong = net_adm:ping(C),
+ _ = global:sync(),
+ [A, B, C] = lists:sort(nodes()),
G = pg2_otp_8653,
- ?line ?UNTIL(begin
- GA = lists:sort(rpc:call(A, pg2, get_members, [G])),
- GB = lists:sort(rpc:call(B, pg2, get_members, [G])),
- GC = lists:sort(rpc:call(C, pg2, get_members, [G])),
- GT = lists:sort(pg2:get_members(G)),
- GA =:= GB andalso
- GB =:= GC andalso
- GC =:= GT andalso
- 8 =:= length(GA)
- end),
- ?line ok = pg2:delete(G),
- ?line stop_nodes([A,B,C]),
- ?line test_server:timetrap_cancel(Dog),
+ ?UNTIL(begin
+ GA = lists:sort(rpc:call(A, pg2, get_members, [G])),
+ GB = lists:sort(rpc:call(B, pg2, get_members, [G])),
+ GC = lists:sort(rpc:call(C, pg2, get_members, [G])),
+ GT = lists:sort(pg2:get_members(G)),
+ GA =:= GB andalso
+ GB =:= GC andalso
+ GC =:= GT andalso
+ 8 =:= length(GA)
+ end),
+ ok = pg2:delete(G),
+ stop_nodes([A,B,C]),
ok.
part2(Config, Main, A, C) ->
@@ -158,54 +146,48 @@ mk_part_node_and_group(File, MyPart0, Config) ->
_ = [ok = pg2:join(G, Pid) || _ <- [1,1]],
touch(File, "done").
-otp_8259(suite) -> [];
-otp_8259(doc) ->
- ["OTP-8259. Member was not removed after being killed."];
+%% OTP-8259. Member was not removed after being killed.
otp_8259(Config) when is_list(Config) ->
- Timeout = 15,
- ?line Dog = test_server:timetrap({seconds,Timeout}),
-
- ?line [A, B, C] = start_nodes([a, b, c], peer, Config),
+ [A, B, C] = start_nodes([a, b, c], peer, Config),
- ?line wait_for_ready_net(Config),
+ wait_for_ready_net(Config),
G = pg2_otp_8259,
Name = otp_8259_a_global_name,
- % start different processes in both partitions
- ?line {Pid, yes} = rpc:call(A, ?MODULE, start_proc, [Name]),
+ %% start different processes in both partitions
+ {Pid, yes} = rpc:call(A, ?MODULE, start_proc, [Name]),
- ?line ok = pg2:create(G),
- ?line ok = pg2:join(G, Pid),
+ ok = pg2:create(G),
+ ok = pg2:join(G, Pid),
- % make b and c connected, partitioned from node() and a
- ?line rpc_cast(B, ?MODULE, part1, [Config, node(), A, C, Name]),
- ?line ?UNTIL(is_ready_partition(Config)),
+ %% make b and c connected, partitioned from node() and a
+ rpc_cast(B, ?MODULE, part1, [Config, node(), A, C, Name]),
+ ?UNTIL(is_ready_partition(Config)),
- % Connect to the other partition.
- % The resolver on node b will be called.
- ?line pong = net_adm:ping(B),
+ %% Connect to the other partition.
+ %% The resolver on node b will be called.
+ pong = net_adm:ping(B),
timer:sleep(100),
- ?line pong = net_adm:ping(C),
- ?line _ = global:sync(),
- ?line [A, B, C] = lists:sort(nodes()),
+ pong = net_adm:ping(C),
+ _ = global:sync(),
+ [A, B, C] = lists:sort(nodes()),
%% Pid has been killed by the resolver.
%% Pid has been removed from pg2 on all nodes, in particular node B.
- ?line ?UNTIL([] =:= rpc:call(B, pg2, get_members, [G])),
- ?line ?UNTIL([] =:= pg2:get_members(G)),
- ?line ?UNTIL([] =:= rpc:call(A, pg2, get_members, [G])),
- ?line ?UNTIL([] =:= rpc:call(C, pg2, get_members, [G])),
-
- ?line ok = pg2:delete(G),
- ?line stop_nodes([A,B,C]),
- ?line test_server:timetrap_cancel(Dog),
+ ?UNTIL([] =:= rpc:call(B, pg2, get_members, [G])),
+ ?UNTIL([] =:= pg2:get_members(G)),
+ ?UNTIL([] =:= rpc:call(A, pg2, get_members, [G])),
+ ?UNTIL([] =:= rpc:call(C, pg2, get_members, [G])),
+
+ ok = pg2:delete(G),
+ stop_nodes([A,B,C]),
ok.
part1(Config, Main, A, C, Name) ->
case catch begin
make_partition(Config, [Main, A], [node(), C]),
- ?line {_Pid, yes} = start_proc(Name)
+ {_Pid, yes} = start_proc(Name)
end of
{_, yes} -> ok
end.
@@ -236,39 +218,33 @@ loop() ->
exit(normal)
end.
-compat(suite) -> [];
-compat(doc) ->
- ["OTP-8259. Check that 'exchange' and 'del_member' work."];
+%% OTP-8259. Check that 'exchange' and 'del_member' work.
compat(Config) when is_list(Config) ->
- case ?t:is_release_available("r13b") of
+ case test_server:is_release_available("r13b") of
true ->
- Timeout = 15,
- ?line Dog = test_server:timetrap({seconds,Timeout}),
Pid = spawn(forever()),
G = a,
- ?line ok = pg2:create(G),
- ?line ok = pg2:join(G, Pid),
- ?line ok = pg2:join(G, Pid),
- ?line {ok, A} = start_node_rel(r13, r13b, slave),
- ?line pong = net_adm:ping(A),
- ?line wait_for_ready_net(Config),
- ?line {ok, _} = rpc:call(A, pg2, start, []),
- ?line ?UNTIL([Pid,Pid] =:= rpc:call(A, pg2, get_members, [a])),
- ?line true = exit(Pid, kill),
- ?line ?UNTIL([] =:= pg2:get_members(a)),
- ?line ?UNTIL([] =:= rpc:call(A, pg2, get_members, [a])),
- ?t:stop_node(A),
- ?line test_server:timetrap_cancel(Dog);
+ ok = pg2:create(G),
+ ok = pg2:join(G, Pid),
+ ok = pg2:join(G, Pid),
+ {ok, A} = start_node_rel(r13, r13b, slave),
+ pong = net_adm:ping(A),
+ wait_for_ready_net(Config),
+ {ok, _} = rpc:call(A, pg2, start, []),
+ ?UNTIL([Pid,Pid] =:= rpc:call(A, pg2, get_members, [a])),
+ true = exit(Pid, kill),
+ ?UNTIL([] =:= pg2:get_members(a)),
+ ?UNTIL([] =:= rpc:call(A, pg2, get_members, [a])),
+ test_server:stop_node(A),
+ ok;
false ->
{skipped, "No support for old node"}
end.
-basic(suite) -> [];
-basic(doc) ->
- ["OTP-8259. Some basic tests."];
+%% OTP-8259. Some basic tests.
basic(Config) when is_list(Config) ->
_ = [pg2:delete(G) || G <- pg2:which_groups()],
- ?line _ = [do(Cs, T, Config) || {T,Cs} <- ts()],
+ _ = [do(Cs, T, Config) || {T,Cs} <- ts()],
ok.
ts() ->
@@ -373,7 +349,7 @@ ts() ->
].
do(Cs, T, Config) ->
- ?t:format("*** Test ~p ***~n", [T]),
+ io:format("*** Test ~p ***~n", [T]),
{ok,T} = (catch {do(Cs, [], [], Config),T}).
do([{nodeup,N} | Cs], Ps, Ns, Config) ->
@@ -425,7 +401,7 @@ doit(N, C, Ps, Ns) ->
Result when Result =:= R orelse R =:= ignore ->
sane(Ns);
Else ->
- ?t:format("~p and ~p: expected ~p, but got ~p~n",
+ io:format("~p and ~p: expected ~p, but got ~p~n",
[F, As, R, Else]),
throw({error,{F, As, R, Else}})
end.
@@ -446,8 +422,8 @@ killit(N, P, Ps, Ns) ->
lists:keydelete(P, 1, Ps).
pr(Node, C) ->
- _ = [?t:format("~p: ", [Node]) || Node =/= node()],
- ?t:format("do ~p~n", [C]).
+ _ = [io:format("~p: ", [Node]) || Node =/= node()],
+ io:format("do ~p~n", [C]).
get_node(N, Ns) ->
if
@@ -475,7 +451,7 @@ replace_pids(A, Ps) ->
sane(Ns) ->
Nodes = [node()] ++ [NN || {_,NN} <- Ns],
- _ = [?t:format("~p, pg2_table:~n ~p~n", % debug
+ _ = [io:format("~p, pg2_table:~n ~p~n", % debug
[N, rpc:call(N, ets, tab2list, [pg2_table])]) ||
N <- Nodes],
R = [case rpc:call(Node, ?MODULE, sane, []) of
@@ -509,7 +485,7 @@ wsane(Ns) ->
Pid when is_pid(Pid), node(Pid) =:= N ->
true =
lists:member(Pid, rpc:call(N, pg2, get_local_members, [G]));
-%% FIXME. Om annan nod: member, local = [].
+ %% FIXME. Om annan nod: member, local = [].
_ -> [] = rpc:call(N, pg2, get_local_members, [G])
end || N <- Ns]
|| G <- pg2:which_groups()].
@@ -558,21 +534,21 @@ start_node_rel(Name, Rel, How) ->
Rel when is_atom(Rel) ->
{[{release, atom_to_list(Rel)}], ""};
RelList ->
- {RelList, ""}
- end,
- ?line Pa = filename:dirname(code:which(?MODULE)),
- ?line Res = test_server:start_node(Name, How,
- [{args,
- Compat ++
- " -kernel net_setuptime 100 "
- " -pa " ++ Pa},
- {erl, Release}]),
+ {RelList, ""}
+ end,
+ Pa = filename:dirname(code:which(?MODULE)),
+ Res = test_server:start_node(Name, How,
+ [{args,
+ Compat ++
+ " -kernel net_setuptime 100 "
+ " -pa " ++ Pa},
+ {erl, Release}]),
Res.
start_nodes(L, How, Config) ->
start_nodes2(L, How, 0, Config),
Nodes = collect_nodes(0, length(L)),
- ?line ?UNTIL([] =:= Nodes -- nodes()),
+ ?UNTIL([] =:= Nodes -- nodes()),
%% Pinging doesn't help, we have to wait too, for nodes() to become
%% correct on the other node.
lists:foreach(fun(E) ->
@@ -588,7 +564,7 @@ verify_nodes(Nodes, Config) ->
verify_nodes([], _N, _Config) ->
[];
verify_nodes([Node | Rest], N, Config) ->
- ?line ?UNTIL(
+ ?UNTIL(
case rpc:call(Node, erlang, nodes, []) of
Nodes when is_list(Nodes) ->
case N =:= lists:sort([Node | Nodes]) of
@@ -620,7 +596,7 @@ start_nodes2([Name | Rest], How, N, Config) ->
Self ! {N, R},
%% sleeping is necessary, or with peer nodes, they will
%% go down again, despite {linked, false}.
- test_server:sleep(100000)
+ ct:sleep(100000)
end),
start_nodes2(Rest, How, N+1, Config).
@@ -640,7 +616,7 @@ start_node(Name0, How, Args, Config) ->
Pa = filename:dirname(code:which(?MODULE)),
test_server:start_node(Name, How, [{args,
Args ++ " " ++
- "-kernel net_setuptime 100 "
+ "-kernel net_setuptime 100 "
"-noshell "
"-pa " ++ Pa},
{linked, false}]).
@@ -648,7 +624,7 @@ stop_nodes(Nodes) ->
lists:foreach(fun(Node) -> stop_node(Node) end, Nodes).
stop_node(Node) ->
- ?t:stop_node(Node).
+ test_server:stop_node(Node).
get_known(Node) ->
case catch gen_server:call({global_name_server,Node},get_known,infinity) of
@@ -672,7 +648,7 @@ make_partition(Config, Part1, Part2) ->
make_partition(Config, Part1, Part2, mk_part_node).
make_partition(Config, Part1, Part2, Function) ->
- Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
Ns = [begin
Name = lists:concat([atom_to_list(N),"_",msec(),".part"]),
File = filename:join([Dir, Name]),
@@ -726,13 +702,13 @@ wait_for_ready_net(Config) ->
wait_for_ready_net(Nodes0, Config) ->
Nodes = lists:sort(Nodes0),
- ?t:format("wait_for_ready_net ~p~n", [Nodes]),
+ io:format("wait_for_ready_net ~p~n", [Nodes]),
?UNTIL(begin
lists:all(fun(N) -> Nodes =:= get_known(N) end, Nodes) and
- lists:all(fun(N) ->
- LNs = rpc:call(N, erlang, nodes, []),
- Nodes =:= lists:sort([N | LNs])
- end, Nodes)
+ lists:all(fun(N) ->
+ LNs = rpc:call(N, erlang, nodes, []),
+ Nodes =:= lists:sort([N | LNs])
+ end, Nodes)
end).
%% To make it less probable that some low-level problem causes
@@ -788,11 +764,11 @@ file_contents(File, ContentsList, Config, LogFile) ->
end).
make_partition_file(Config) ->
- Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
filename:join([Dir, atom_to_list(make_partition_done)]).
msec() ->
msec(now()).
msec(T) ->
- element(1,T)*1000000000 + element(2,T)*1000 + element(3,T) div 1000.
+ element(1,T)*1000000000 + element(2,T)*1000 + element(3,T) div 1000.
diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl
index 1265180354..149cc6c816 100644
--- a/lib/kernel/test/prim_file_SUITE.erl
+++ b/lib/kernel/test/prim_file_SUITE.erl
@@ -36,7 +36,7 @@
file_write_file_info_a/1, file_write_file_info_b/1,
file_read_file_info_opts/1, file_write_file_info_opts/1,
file_write_read_file_info_opts/1
- ]).
+ ]).
-export([rename_a/1, rename_b/1,
access/1, truncate/1, datasync/1, sync/1,
read_write/1, pread_write/1, append/1, exclusive/1]).
@@ -105,7 +105,7 @@ groups() ->
file_write_file_info_a, file_write_file_info_b,
file_read_file_info_opts, file_write_file_info_opts,
file_write_read_file_info_opts
- ]},
+ ]},
{errors, [],
[e_delete, e_rename, e_make_dir, e_del_dir]},
{compression, [],
@@ -125,7 +125,7 @@ end_per_group(_GroupName, Config) ->
init_per_suite(Config) when is_list(Config) ->
case os:type() of
{win32, _} ->
- Priv = ?config(priv_dir, Config),
+ Priv = proplists:get_value(priv_dir, Config),
HasAccessTime =
case file:read_file_info(Priv) of
{ok, #file_info{atime={_, {0, 0, 0}}}} ->
@@ -181,92 +181,86 @@ time_dist({_D1, _T1} = DT1, {_D2, _T2} = DT2) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-read_write_file(suite) -> [];
-read_write_file(doc) -> [];
read_write_file(Config) when is_list(Config) ->
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_read_write_file"),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_read_write_file"),
%% Try writing and reading back some term
- ?line SomeTerm = {"This term",{will,be},[written,$t,$o],1,file,[]},
- ?line ok = ?PRIM_FILE:write_file(Name,term_to_binary(SomeTerm)),
- ?line {ok,Bin1} = ?PRIM_FILE:read_file(Name),
- ?line SomeTerm = binary_to_term(Bin1),
-
+ SomeTerm = {"This term",{will,be},[written,$t,$o],1,file,[]},
+ ok = ?PRIM_FILE:write_file(Name,term_to_binary(SomeTerm)),
+ {ok,Bin1} = ?PRIM_FILE:read_file(Name),
+ SomeTerm = binary_to_term(Bin1),
+
%% Try a "null" term
- ?line NullTerm = [],
- ?line ok = ?PRIM_FILE:write_file(Name,term_to_binary(NullTerm)),
- ?line {ok,Bin2} = ?PRIM_FILE:read_file(Name),
- ?line NullTerm = binary_to_term(Bin2),
+ NullTerm = [],
+ ok = ?PRIM_FILE:write_file(Name,term_to_binary(NullTerm)),
+ {ok,Bin2} = ?PRIM_FILE:read_file(Name),
+ NullTerm = binary_to_term(Bin2),
%% Try some "complicated" types
- ?line BigNum = 123456789012345678901234567890,
- ?line ComplTerm = {self(),make_ref(),BigNum,3.14159},
- ?line ok = ?PRIM_FILE:write_file(Name,term_to_binary(ComplTerm)),
- ?line {ok,Bin3} = ?PRIM_FILE:read_file(Name),
- ?line ComplTerm = binary_to_term(Bin3),
+ BigNum = 123456789012345678901234567890,
+ ComplTerm = {self(),make_ref(),BigNum,3.14159},
+ ok = ?PRIM_FILE:write_file(Name,term_to_binary(ComplTerm)),
+ {ok,Bin3} = ?PRIM_FILE:read_file(Name),
+ ComplTerm = binary_to_term(Bin3),
%% Try reading a nonexistent file
- ?line Name2 = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_nonexistent_file"),
- ?line {error, enoent} = ?PRIM_FILE:read_file(Name2),
- ?line {error, enoent} = ?PRIM_FILE:read_file(""),
-
- % Try writing to a bad filename
- ?line {error, enoent} =
+ Name2 = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_nonexistent_file"),
+ {error, enoent} = ?PRIM_FILE:read_file(Name2),
+ {error, enoent} = ?PRIM_FILE:read_file(""),
+
+ %% Try writing to a bad filename
+ {error, enoent} =
?PRIM_FILE:write_file("",term_to_binary(NullTerm)),
- % Try writing something else than a binary
- ?line {error, badarg} = ?PRIM_FILE:write_file(Name,{1,2,3}),
- ?line {error, badarg} = ?PRIM_FILE:write_file(Name,self()),
+ %% Try writing something else than a binary
+ {error, badarg} = ?PRIM_FILE:write_file(Name,{1,2,3}),
+ {error, badarg} = ?PRIM_FILE:write_file(Name,self()),
%% Some non-term binaries
- ?line ok = ?PRIM_FILE:write_file(Name,[]),
- ?line {ok,Bin4} = ?PRIM_FILE:read_file(Name),
- ?line 0 = byte_size(Bin4),
+ ok = ?PRIM_FILE:write_file(Name,[]),
+ {ok,Bin4} = ?PRIM_FILE:read_file(Name),
+ 0 = byte_size(Bin4),
- ?line ok = ?PRIM_FILE:write_file(Name,[Bin1,[],[[Bin2]]]),
- ?line {ok,Bin5} = ?PRIM_FILE:read_file(Name),
- ?line {Bin1,Bin2} = split_binary(Bin5,byte_size(Bin1)),
+ ok = ?PRIM_FILE:write_file(Name,[Bin1,[],[[Bin2]]]),
+ {ok,Bin5} = ?PRIM_FILE:read_file(Name),
+ {Bin1,Bin2} = split_binary(Bin5,byte_size(Bin1)),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-make_del_dir_a(suite) -> [];
-make_del_dir_a(doc) -> [];
make_del_dir_a(Config) when is_list(Config) ->
make_del_dir(Config, [], "_a").
-make_del_dir_b(suite) -> [];
-make_del_dir_b(doc) -> [];
make_del_dir_b(Config) when is_list(Config) ->
- ?line {ok, Handle} = ?PRIM_FILE:start(),
+ {ok, Handle} = ?PRIM_FILE:start(),
Result = make_del_dir(Config, Handle, "_b"),
- ?line ok = ?PRIM_FILE:stop(Handle),
+ ok = ?PRIM_FILE:stop(Handle),
%% Just to make sure the state of the server makes a difference
- ?line {error, einval} = ?PRIM_FILE_call(get_cwd, Handle, []),
+ {error, einval} = ?PRIM_FILE_call(get_cwd, Handle, []),
Result.
make_del_dir(Config, Handle, Suffix) ->
- ?line RootDir = ?config(priv_dir,Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_mk-dir"++Suffix),
- ?line ok = ?PRIM_FILE_call(make_dir, Handle, [NewDir]),
- ?line {error, eexist} = ?PRIM_FILE_call(make_dir, Handle, [NewDir]),
- ?line ok = ?PRIM_FILE_call(del_dir, Handle, [NewDir]),
- ?line {error, enoent} = ?PRIM_FILE_call(del_dir, Handle, [NewDir]),
-
- % Make sure we are not in a directory directly under test_server
- % as that would result in eacces errors when trying to delete '..',
- % because there are processes having that directory as current.
- ?line ok = ?PRIM_FILE_call(make_dir, Handle, [NewDir]),
- ?line {ok, CurrentDir} = ?PRIM_FILE_call(get_cwd, Handle, []),
+ RootDir = proplists:get_value(priv_dir,Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_mk-dir"++Suffix),
+ ok = ?PRIM_FILE_call(make_dir, Handle, [NewDir]),
+ {error, eexist} = ?PRIM_FILE_call(make_dir, Handle, [NewDir]),
+ ok = ?PRIM_FILE_call(del_dir, Handle, [NewDir]),
+ {error, enoent} = ?PRIM_FILE_call(del_dir, Handle, [NewDir]),
+
+ %% Make sure we are not in a directory directly under test_server
+ %% as that would result in eacces errors when trying to delete '..',
+ %% because there are processes having that directory as current.
+ ok = ?PRIM_FILE_call(make_dir, Handle, [NewDir]),
+ {ok, CurrentDir} = ?PRIM_FILE_call(get_cwd, Handle, []),
case {os:type(), length(NewDir) >= 260 } of
{{win32,_}, true} ->
io:format("Skip set_cwd for windows path longer than 260 (MAX_PATH)\n", []),
@@ -277,18 +271,18 @@ make_del_dir(Config, Handle, Suffix) ->
try
%% Check that we get an error when trying to create...
%% a deep directory
- ?line NewDir2 = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_mk-dir-noexist/foo"),
- ?line {error, enoent} = ?PRIM_FILE_call(make_dir, Handle, [NewDir2]),
+ NewDir2 = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_mk-dir-noexist/foo"),
+ {error, enoent} = ?PRIM_FILE_call(make_dir, Handle, [NewDir2]),
%% a nameless directory
- ?line {error, enoent} = ?PRIM_FILE_call(make_dir, Handle, [""]),
+ {error, enoent} = ?PRIM_FILE_call(make_dir, Handle, [""]),
%% a directory with illegal name
- ?line {error, badarg} = ?PRIM_FILE_call(make_dir, Handle, ['mk-dir']),
-
+ {error, badarg} = ?PRIM_FILE_call(make_dir, Handle, ['mk-dir']),
+
%% a directory with illegal name, even if it's a (bad) list
- ?line {error, badarg} = ?PRIM_FILE_call(make_dir, Handle, [[1,2,3,{}]]),
-
+ {error, badarg} = ?PRIM_FILE_call(make_dir, Handle, [[1,2,3,{}]]),
+
%% Maybe this isn't an error, exactly, but worth mentioning anyway:
%% ok = ?PRIM_FILE:make_dir([$f,$o,$o,0,$b,$a,$r])),
%% The above line works, and created a directory "./foo"
@@ -296,41 +290,37 @@ make_del_dir(Config, Handle, Suffix) ->
%% a directory, but with a name that incorporates the "bar" part of
%% the list, so that [$f,$o,$o,0,$f,$o,$o] wouldn't refer to the same
%% dir. But this would slow it down.
-
+
%% Try deleting some bad directories
%% Deleting the parent directory to the current, sounds dangerous, huh?
%% Don't worry ;-) the parent directory should never be empty, right?
- ?line case ?PRIM_FILE_call(del_dir, Handle, [".."]) of
- {error, eexist} -> ok;
- {error, eacces} -> ok; %OpenBSD
- {error, einval} -> ok %FreeBSD
- end,
- ?line {error, enoent} = ?PRIM_FILE_call(del_dir, Handle, [""]),
- ?line {error, badarg} = ?PRIM_FILE_call(del_dir, Handle, [[3,2,1,{}]])
+ case ?PRIM_FILE_call(del_dir, Handle, [".."]) of
+ {error, eexist} -> ok;
+ {error, eacces} -> ok; %OpenBSD
+ {error, einval} -> ok %FreeBSD
+ end,
+ {error, enoent} = ?PRIM_FILE_call(del_dir, Handle, [""]),
+ {error, badarg} = ?PRIM_FILE_call(del_dir, Handle, [[3,2,1,{}]])
after
- ?line ok = ?PRIM_FILE_call(set_cwd, Handle, [CurrentDir])
+ ok = ?PRIM_FILE_call(set_cwd, Handle, [CurrentDir])
end,
ok.
-cur_dir_0a(suite) -> [];
-cur_dir_0a(doc) -> [];
cur_dir_0a(Config) when is_list(Config) ->
cur_dir_0(Config, []).
-cur_dir_0b(suite) -> [];
-cur_dir_0b(doc) -> [];
cur_dir_0b(Config) when is_list(Config) ->
- ?line {ok, Handle} = ?PRIM_FILE:start(),
+ {ok, Handle} = ?PRIM_FILE:start(),
Result = cur_dir_0(Config, Handle),
- ?line ok = ?PRIM_FILE:stop(Handle),
+ ok = ?PRIM_FILE:stop(Handle),
Result.
cur_dir_0(Config, Handle) ->
%% Find out the current dir, and cd to it ;-)
- ?line {ok,BaseDir} = ?PRIM_FILE_call(get_cwd, Handle, []),
- ?line Dir1 = BaseDir ++ "", %% Check that it's a string
- ?line ok = ?PRIM_FILE_call(set_cwd, Handle, [Dir1]),
- ?line DirName = atom_to_list(?MODULE) ++
+ {ok,BaseDir} = ?PRIM_FILE_call(get_cwd, Handle, []),
+ Dir1 = BaseDir ++ "", %% Check that it's a string
+ ok = ?PRIM_FILE_call(set_cwd, Handle, [Dir1]),
+ DirName = atom_to_list(?MODULE) ++
case Handle of
[] ->
"_curdir";
@@ -339,9 +329,9 @@ cur_dir_0(Config, Handle) ->
end,
%% Make a new dir, and cd to that
- ?line RootDir = ?config(priv_dir,Config),
- ?line NewDir = filename:join(RootDir, DirName),
- ?line ok = ?PRIM_FILE_call(make_dir, Handle, [NewDir]),
+ RootDir = proplists:get_value(priv_dir,Config),
+ NewDir = filename:join(RootDir, DirName),
+ ok = ?PRIM_FILE_call(make_dir, Handle, [NewDir]),
case {os:type(), length(NewDir) >= 260} of
{{win32,_}, true} ->
io:format("Skip set_cwd for windows path longer than 260 (MAX_PATH):\n"),
@@ -361,7 +351,7 @@ cur_dir_0(Config, Handle) ->
%% Delete the directory and return to the old current directory
%% and check that the created file isn't there (too!)
expect({error, einval}, {error, eacces}, {error, eexist},
- ?PRIM_FILE_call(del_dir, Handle, [NewDir])),
+ ?PRIM_FILE_call(del_dir, Handle, [NewDir])),
?PRIM_FILE_call(delete, Handle, [UncommonName]),
{ok,[]} = ?PRIM_FILE_call(list_dir, Handle, ["."]),
ok = ?PRIM_FILE_call(set_cwd, Handle, [Dir1]),
@@ -375,13 +365,13 @@ cur_dir_0(Config, Handle) ->
end,
%% Try doing some bad things
- ?line {error, badarg} =
+ {error, badarg} =
?PRIM_FILE_call(set_cwd, Handle, [{foo,bar}]),
- ?line {error, enoent} =
+ {error, enoent} =
?PRIM_FILE_call(set_cwd, Handle, [""]),
- ?line {error, enoent} =
+ {error, enoent} =
?PRIM_FILE_call(set_cwd, Handle, [".......a......"]),
- ?line {ok,BaseDir} =
+ {ok,BaseDir} =
?PRIM_FILE_call(get_cwd, Handle, []), %% Still there?
%% On Windows, there should only be slashes, no backslashes,
@@ -389,44 +379,40 @@ cur_dir_0(Config, Handle) ->
%% (The test is harmless on Unix, because filenames usually
%% don't contain backslashes.)
- ?line {ok, BaseDir} = ?PRIM_FILE_call(get_cwd, Handle, []),
- ?line false = lists:member($\\, BaseDir),
+ {ok, BaseDir} = ?PRIM_FILE_call(get_cwd, Handle, []),
+ false = lists:member($\\, BaseDir),
ok.
%% Tests ?PRIM_FILE:get_cwd/1.
-cur_dir_1a(suite) -> [];
-cur_dir_1a(doc) -> [];
cur_dir_1a(Config) when is_list(Config) ->
cur_dir_1(Config, []).
-cur_dir_1b(suite) -> [];
-cur_dir_1b(doc) -> [];
cur_dir_1b(Config) when is_list(Config) ->
- ?line {ok, Handle} = ?PRIM_FILE:start(),
+ {ok, Handle} = ?PRIM_FILE:start(),
Result = cur_dir_1(Config, Handle),
- ?line ok = ?PRIM_FILE:stop(Handle),
+ ok = ?PRIM_FILE:stop(Handle),
Result.
cur_dir_1(Config, Handle) ->
- ?line case os:type() of
- {win32, _} ->
- win_cur_dir_1(Config, Handle);
- _ ->
- ?line {error, enotsup} =
- ?PRIM_FILE_call(get_cwd, Handle, ["d:"])
- end,
+ case os:type() of
+ {win32, _} ->
+ win_cur_dir_1(Config, Handle);
+ _ ->
+ {error, enotsup} =
+ ?PRIM_FILE_call(get_cwd, Handle, ["d:"])
+ end,
ok.
-
+
win_cur_dir_1(_Config, Handle) ->
- ?line {ok, BaseDir} = ?PRIM_FILE_call(get_cwd, Handle, []),
+ {ok, BaseDir} = ?PRIM_FILE_call(get_cwd, Handle, []),
%% Get the drive letter from the current directory,
%% and try to get current directory for that drive.
- ?line [Drive, $:|_] = BaseDir,
- ?line {ok, BaseDir} = ?PRIM_FILE_call(get_cwd, Handle, [[Drive, $:]]),
+ [Drive, $:|_] = BaseDir,
+ {ok, BaseDir} = ?PRIM_FILE_call(get_cwd, Handle, [[Drive, $:]]),
io:format("BaseDir = ~s\n", [BaseDir]),
%% Unfortunately, there is no way to move away from the
@@ -439,437 +425,405 @@ win_cur_dir_1(_Config, Handle) ->
-open1(suite) -> [];
-open1(doc) -> [];
open1(Config) when is_list(Config) ->
- ?line RootDir = ?config(priv_dir,Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_files"),
- ?line ok = ?PRIM_FILE:make_dir(NewDir),
- ?line Name = filename:join(NewDir, "foo1.fil"),
- ?line {ok,Fd1} = ?PRIM_FILE:open(Name, [read, write]),
- ?line {ok,Fd2} = ?PRIM_FILE:open(Name, [read]),
- ?line Str = "{a,tuple}.\n",
- ?line Length = length(Str),
- ?line ?PRIM_FILE:write(Fd1,Str),
- ?line {ok,0} = ?PRIM_FILE:position(Fd1,bof),
- ?line {ok, Str} = ?PRIM_FILE:read(Fd1,Length),
- ?line {ok, Str} = ?PRIM_FILE:read(Fd2,Length),
- ?line ok = ?PRIM_FILE:close(Fd2),
- ?line {ok,0} = ?PRIM_FILE:position(Fd1,bof),
- ?line ok = ?PRIM_FILE:truncate(Fd1),
- ?line eof = ?PRIM_FILE:read(Fd1,Length),
- ?line ok = ?PRIM_FILE:close(Fd1),
- ?line {ok,Fd3} = ?PRIM_FILE:open(Name, [read]),
- ?line eof = ?PRIM_FILE:read(Fd3,Length),
- ?line ok = ?PRIM_FILE:close(Fd3),
+ RootDir = proplists:get_value(priv_dir,Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_files"),
+ ok = ?PRIM_FILE:make_dir(NewDir),
+ Name = filename:join(NewDir, "foo1.fil"),
+ {ok,Fd1} = ?PRIM_FILE:open(Name, [read, write]),
+ {ok,Fd2} = ?PRIM_FILE:open(Name, [read]),
+ Str = "{a,tuple}.\n",
+ Length = length(Str),
+ ?PRIM_FILE:write(Fd1,Str),
+ {ok,0} = ?PRIM_FILE:position(Fd1,bof),
+ {ok, Str} = ?PRIM_FILE:read(Fd1,Length),
+ {ok, Str} = ?PRIM_FILE:read(Fd2,Length),
+ ok = ?PRIM_FILE:close(Fd2),
+ {ok,0} = ?PRIM_FILE:position(Fd1,bof),
+ ok = ?PRIM_FILE:truncate(Fd1),
+ eof = ?PRIM_FILE:read(Fd1,Length),
+ ok = ?PRIM_FILE:close(Fd1),
+ {ok,Fd3} = ?PRIM_FILE:open(Name, [read]),
+ eof = ?PRIM_FILE:read(Fd3,Length),
+ ok = ?PRIM_FILE:close(Fd3),
ok.
%% Tests all open modes.
-modes(suite) -> [];
-modes(doc) -> [];
modes(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_open_modes"),
- ?line ok = ?PRIM_FILE:make_dir(NewDir),
- ?line Name1 = filename:join(NewDir, "foo1.fil"),
- ?line Marker = "hello, world",
- ?line Length = length(Marker),
+ RootDir = proplists:get_value(priv_dir, Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_open_modes"),
+ ok = ?PRIM_FILE:make_dir(NewDir),
+ Name1 = filename:join(NewDir, "foo1.fil"),
+ Marker = "hello, world",
+ Length = length(Marker),
%% write
- ?line {ok, Fd1} = ?PRIM_FILE:open(Name1, [write]),
- ?line ok = ?PRIM_FILE:write(Fd1, Marker),
- ?line ok = ?PRIM_FILE:write(Fd1, ".\n"),
- ?line ok = ?PRIM_FILE:close(Fd1),
+ {ok, Fd1} = ?PRIM_FILE:open(Name1, [write]),
+ ok = ?PRIM_FILE:write(Fd1, Marker),
+ ok = ?PRIM_FILE:write(Fd1, ".\n"),
+ ok = ?PRIM_FILE:close(Fd1),
%% read
- ?line {ok, Fd2} = ?PRIM_FILE:open(Name1, [read]),
- ?line {ok, Marker} = ?PRIM_FILE:read(Fd2, Length),
- ?line ok = ?PRIM_FILE:close(Fd2),
+ {ok, Fd2} = ?PRIM_FILE:open(Name1, [read]),
+ {ok, Marker} = ?PRIM_FILE:read(Fd2, Length),
+ ok = ?PRIM_FILE:close(Fd2),
%% read and write
- ?line {ok, Fd3} = ?PRIM_FILE:open(Name1, [read, write]),
- ?line {ok, Marker} = ?PRIM_FILE:read(Fd3, Length),
- ?line ok = ?PRIM_FILE:write(Fd3, Marker),
- ?line ok = ?PRIM_FILE:close(Fd3),
+ {ok, Fd3} = ?PRIM_FILE:open(Name1, [read, write]),
+ {ok, Marker} = ?PRIM_FILE:read(Fd3, Length),
+ ok = ?PRIM_FILE:write(Fd3, Marker),
+ ok = ?PRIM_FILE:close(Fd3),
%% read by default
- ?line {ok, Fd4} = ?PRIM_FILE:open(Name1, []),
- ?line {ok, Marker} = ?PRIM_FILE:read(Fd4, Length),
- ?line ok = ?PRIM_FILE:close(Fd4),
+ {ok, Fd4} = ?PRIM_FILE:open(Name1, []),
+ {ok, Marker} = ?PRIM_FILE:read(Fd4, Length),
+ ok = ?PRIM_FILE:close(Fd4),
%% read and binary
- ?line BinaryMarker = list_to_binary(Marker),
- ?line {ok, Fd5} = ?PRIM_FILE:open(Name1, [read, binary]),
- ?line {ok, BinaryMarker} = ?PRIM_FILE:read(Fd5, Length),
- ?line ok = ?PRIM_FILE:close(Fd5),
+ BinaryMarker = list_to_binary(Marker),
+ {ok, Fd5} = ?PRIM_FILE:open(Name1, [read, binary]),
+ {ok, BinaryMarker} = ?PRIM_FILE:read(Fd5, Length),
+ ok = ?PRIM_FILE:close(Fd5),
- ?line test_server:timetrap_cancel(Dog),
ok.
-close(suite) -> [];
-close(doc) -> [];
close(Config) when is_list(Config) ->
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_close.fil"),
- ?line {ok,Fd1} = ?PRIM_FILE:open(Name, [read, write]),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_close.fil"),
+ {ok,Fd1} = ?PRIM_FILE:open(Name, [read, write]),
%% Just closing it is no fun, we did that a million times already
%% This is a common error, for code written before Erlang 4.3
%% bacause then ?PRIM_FILE:open just returned a Pid, and not everyone
%% really checked what they got.
- ?line {'EXIT',_Msg} = (catch ok = ?PRIM_FILE:close({ok,Fd1})),
- ?line ok = ?PRIM_FILE:close(Fd1),
+ {'EXIT',_Msg} = (catch ok = ?PRIM_FILE:close({ok,Fd1})),
+ ok = ?PRIM_FILE:close(Fd1),
%% Try closing one more time
- ?line Val = ?PRIM_FILE:close(Fd1),
- ?line io:format("Second close gave: ~p", [Val]),
+ Val = ?PRIM_FILE:close(Fd1),
+ io:format("Second close gave: ~p", [Val]),
ok.
-access(suite) -> [];
-access(doc) -> [];
access(Config) when is_list(Config) ->
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_access.fil"),
- ?line Str = "ABCDEFGH",
- ?line {ok,Fd1} = ?PRIM_FILE:open(Name, [write]),
- ?line ?PRIM_FILE:write(Fd1,Str),
- ?line ok = ?PRIM_FILE:close(Fd1),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_access.fil"),
+ Str = "ABCDEFGH",
+ {ok,Fd1} = ?PRIM_FILE:open(Name, [write]),
+ ?PRIM_FILE:write(Fd1,Str),
+ ok = ?PRIM_FILE:close(Fd1),
%% Check that we can't write when in read only mode
- ?line {ok,Fd2} = ?PRIM_FILE:open(Name, [read]),
- ?line case catch ?PRIM_FILE:write(Fd2,"XXXX") of
- ok ->
- test_server:fail({access,write});
- _ ->
- ok
- end,
- ?line ok = ?PRIM_FILE:close(Fd2),
- ?line {ok, Fd3} = ?PRIM_FILE:open(Name, [read]),
- ?line {ok, Str} = ?PRIM_FILE:read(Fd3,length(Str)),
- ?line ok = ?PRIM_FILE:close(Fd3),
+ {ok,Fd2} = ?PRIM_FILE:open(Name, [read]),
+ case catch ?PRIM_FILE:write(Fd2,"XXXX") of
+ ok ->
+ ct:fail({access,write});
+ _ ->
+ ok
+ end,
+ ok = ?PRIM_FILE:close(Fd2),
+ {ok, Fd3} = ?PRIM_FILE:open(Name, [read]),
+ {ok, Str} = ?PRIM_FILE:read(Fd3,length(Str)),
+ ok = ?PRIM_FILE:close(Fd3),
ok.
%% Tests ?PRIM_FILE:read/2 and ?PRIM_FILE:write/2.
-read_write(suite) -> [];
-read_write(doc) -> [];
read_write(Config) when is_list(Config) ->
- ?line RootDir = ?config(priv_dir, Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_read_write"),
- ?line ok = ?PRIM_FILE:make_dir(NewDir),
+ RootDir = proplists:get_value(priv_dir, Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_read_write"),
+ ok = ?PRIM_FILE:make_dir(NewDir),
%% Raw file.
- ?line Name = filename:join(NewDir, "raw.fil"),
- ?line {ok, Fd} = ?PRIM_FILE:open(Name, [read, write]),
- ?line read_write_test(Fd),
+ Name = filename:join(NewDir, "raw.fil"),
+ {ok, Fd} = ?PRIM_FILE:open(Name, [read, write]),
+ read_write_test(Fd),
ok.
read_write_test(File) ->
- ?line Marker = "hello, world",
- ?line ok = ?PRIM_FILE:write(File, Marker),
- ?line {ok, 0} = ?PRIM_FILE:position(File, 0),
- ?line {ok, Marker} = ?PRIM_FILE:read(File, 100),
- ?line eof = ?PRIM_FILE:read(File, 100),
- ?line ok = ?PRIM_FILE:close(File),
+ Marker = "hello, world",
+ ok = ?PRIM_FILE:write(File, Marker),
+ {ok, 0} = ?PRIM_FILE:position(File, 0),
+ {ok, Marker} = ?PRIM_FILE:read(File, 100),
+ eof = ?PRIM_FILE:read(File, 100),
+ ok = ?PRIM_FILE:close(File),
ok.
%% Tests ?PRIM_FILE:pread/2 and ?PRIM_FILE:pwrite/2.
-pread_write(suite) -> [];
-pread_write(doc) -> [];
pread_write(Config) when is_list(Config) ->
- ?line RootDir = ?config(priv_dir, Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_pread_write"),
- ?line ok = ?PRIM_FILE:make_dir(NewDir),
+ RootDir = proplists:get_value(priv_dir, Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_pread_write"),
+ ok = ?PRIM_FILE:make_dir(NewDir),
%% Raw file.
- ?line Name = filename:join(NewDir, "raw.fil"),
- ?line {ok, Fd} = ?PRIM_FILE:open(Name, [read, write]),
- ?line pread_write_test(Fd),
+ Name = filename:join(NewDir, "raw.fil"),
+ {ok, Fd} = ?PRIM_FILE:open(Name, [read, write]),
+ pread_write_test(Fd),
ok.
pread_write_test(File) ->
- ?line Marker = "hello, world",
- ?line Len = length(Marker),
- ?line ok = ?PRIM_FILE:write(File, Marker),
- ?line {ok, Marker} = ?PRIM_FILE:pread(File, 0, 100),
- ?line eof = ?PRIM_FILE:pread(File, 100, 1),
- ?line ok = ?PRIM_FILE:pwrite(File, Len, Marker),
- ?line {ok, Marker} = ?PRIM_FILE:pread(File, Len, 100),
- ?line eof = ?PRIM_FILE:pread(File, 100, 1),
- ?line MM = Marker ++ Marker,
- ?line {ok, MM} = ?PRIM_FILE:pread(File, 0, 100),
- ?line ok = ?PRIM_FILE:close(File),
+ Marker = "hello, world",
+ Len = length(Marker),
+ ok = ?PRIM_FILE:write(File, Marker),
+ {ok, Marker} = ?PRIM_FILE:pread(File, 0, 100),
+ eof = ?PRIM_FILE:pread(File, 100, 1),
+ ok = ?PRIM_FILE:pwrite(File, Len, Marker),
+ {ok, Marker} = ?PRIM_FILE:pread(File, Len, 100),
+ eof = ?PRIM_FILE:pread(File, 100, 1),
+ MM = Marker ++ Marker,
+ {ok, MM} = ?PRIM_FILE:pread(File, 0, 100),
+ ok = ?PRIM_FILE:close(File),
ok.
-append(doc) -> "Test appending to a file.";
-append(suite) -> [];
+%% Test appending to a file.
append(Config) when is_list(Config) ->
- ?line RootDir = ?config(priv_dir, Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_append"),
- ?line ok = ?PRIM_FILE:make_dir(NewDir),
+ RootDir = proplists:get_value(priv_dir, Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_append"),
+ ok = ?PRIM_FILE:make_dir(NewDir),
- ?line First = "First line\n",
- ?line Second = "Seond lines comes here\n",
- ?line Third = "And here is the third line\n",
+ First = "First line\n",
+ Second = "Seond lines comes here\n",
+ Third = "And here is the third line\n",
%% Write a small text file.
- ?line Name1 = filename:join(NewDir, "a_file.txt"),
- ?line {ok, Fd1} = ?PRIM_FILE:open(Name1, [write]),
- ?line ok = ?PRIM_FILE:write(Fd1, First),
- ?line ok = ?PRIM_FILE:write(Fd1, Second),
- ?line ok = ?PRIM_FILE:close(Fd1),
+ Name1 = filename:join(NewDir, "a_file.txt"),
+ {ok, Fd1} = ?PRIM_FILE:open(Name1, [write]),
+ ok = ?PRIM_FILE:write(Fd1, First),
+ ok = ?PRIM_FILE:write(Fd1, Second),
+ ok = ?PRIM_FILE:close(Fd1),
%% Open it a again and a append a line to it.
- ?line {ok, Fd2} = ?PRIM_FILE:open(Name1, [append]),
- ?line ok = ?PRIM_FILE:write(Fd2, Third),
- ?line ok = ?PRIM_FILE:close(Fd2),
+ {ok, Fd2} = ?PRIM_FILE:open(Name1, [append]),
+ ok = ?PRIM_FILE:write(Fd2, Third),
+ ok = ?PRIM_FILE:close(Fd2),
%% Read it back and verify.
- ?line Expected = list_to_binary([First, Second, Third]),
- ?line {ok, Expected} = ?PRIM_FILE:read_file(Name1),
+ Expected = list_to_binary([First, Second, Third]),
+ {ok, Expected} = ?PRIM_FILE:read_file(Name1),
ok.
-exclusive(suite) -> [];
-exclusive(doc) -> "Test exclusive access to a file.";
+%% Test exclusive access to a file.
exclusive(Config) when is_list(Config) ->
- ?line RootDir = ?config(priv_dir,Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_exclusive"),
- ?line ok = ?PRIM_FILE:make_dir(NewDir),
- ?line Name = filename:join(NewDir, "ex_file.txt"),
- ?line {ok,Fd} = ?PRIM_FILE:open(Name, [write, exclusive]),
- ?line {error, eexist} = ?PRIM_FILE:open(Name, [write, exclusive]),
- ?line ok = ?PRIM_FILE:close(Fd),
+ RootDir = proplists:get_value(priv_dir,Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_exclusive"),
+ ok = ?PRIM_FILE:make_dir(NewDir),
+ Name = filename:join(NewDir, "ex_file.txt"),
+ {ok,Fd} = ?PRIM_FILE:open(Name, [write, exclusive]),
+ {error, eexist} = ?PRIM_FILE:open(Name, [write, exclusive]),
+ ok = ?PRIM_FILE:close(Fd),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-pos1(suite) -> [];
-pos1(doc) -> [];
pos1(Config) when is_list(Config) ->
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_pos1.fil"),
- ?line {ok, Fd1} = ?PRIM_FILE:open(Name, [write]),
- ?line ?PRIM_FILE:write(Fd1,"ABCDEFGH"),
- ?line ok = ?PRIM_FILE:close(Fd1),
- ?line {ok, Fd2} = ?PRIM_FILE:open(Name, [read]),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_pos1.fil"),
+ {ok, Fd1} = ?PRIM_FILE:open(Name, [write]),
+ ?PRIM_FILE:write(Fd1,"ABCDEFGH"),
+ ok = ?PRIM_FILE:close(Fd1),
+ {ok, Fd2} = ?PRIM_FILE:open(Name, [read]),
%% Start pos is first char
- ?line io:format("Relative positions"),
- ?line {ok, "A"} = ?PRIM_FILE:read(Fd2,1),
- ?line {ok, 2} = ?PRIM_FILE:position(Fd2,{cur,1}),
- ?line {ok, "C"} = ?PRIM_FILE:read(Fd2,1),
- ?line {ok, 0} = ?PRIM_FILE:position(Fd2,{cur,-3}),
- ?line {ok, "A"} = ?PRIM_FILE:read(Fd2,1),
+ io:format("Relative positions"),
+ {ok, "A"} = ?PRIM_FILE:read(Fd2,1),
+ {ok, 2} = ?PRIM_FILE:position(Fd2,{cur,1}),
+ {ok, "C"} = ?PRIM_FILE:read(Fd2,1),
+ {ok, 0} = ?PRIM_FILE:position(Fd2,{cur,-3}),
+ {ok, "A"} = ?PRIM_FILE:read(Fd2,1),
%% Backwards from first char should be an error
- ?line {ok,0} = ?PRIM_FILE:position(Fd2,{cur,-1}),
- ?line {error, einval} = ?PRIM_FILE:position(Fd2,{cur,-1}),
+ {ok,0} = ?PRIM_FILE:position(Fd2,{cur,-1}),
+ {error, einval} = ?PRIM_FILE:position(Fd2,{cur,-1}),
%% Reset position and move again
- ?line {ok, 0} = ?PRIM_FILE:position(Fd2,0),
- ?line {ok, 2} = ?PRIM_FILE:position(Fd2,{cur,2}),
- ?line {ok, "C"} = ?PRIM_FILE:read(Fd2,1),
+ {ok, 0} = ?PRIM_FILE:position(Fd2,0),
+ {ok, 2} = ?PRIM_FILE:position(Fd2,{cur,2}),
+ {ok, "C"} = ?PRIM_FILE:read(Fd2,1),
%% Go a lot forwards
- ?line {ok, 13} = ?PRIM_FILE:position(Fd2,{cur,10}),
- ?line eof = ?PRIM_FILE:read(Fd2,1),
+ {ok, 13} = ?PRIM_FILE:position(Fd2,{cur,10}),
+ eof = ?PRIM_FILE:read(Fd2,1),
%% Try some fixed positions
- ?line io:format("Fixed positions"),
- ?line {ok, 8} = ?PRIM_FILE:position(Fd2,8),
- ?line eof = ?PRIM_FILE:read(Fd2,1),
- ?line {ok, 8} = ?PRIM_FILE:position(Fd2,cur),
- ?line eof = ?PRIM_FILE:read(Fd2,1),
- ?line {ok, 7} = ?PRIM_FILE:position(Fd2,7),
- ?line {ok, "H"} = ?PRIM_FILE:read(Fd2,1),
- ?line {ok, 0} = ?PRIM_FILE:position(Fd2,0),
- ?line {ok, "A"} = ?PRIM_FILE:read(Fd2,1),
- ?line {ok, 3} = ?PRIM_FILE:position(Fd2,3),
- ?line {ok, "D"} = ?PRIM_FILE:read(Fd2,1),
- ?line {ok, 12} = ?PRIM_FILE:position(Fd2,12),
- ?line eof = ?PRIM_FILE:read(Fd2,1),
- ?line {ok, 3} = ?PRIM_FILE:position(Fd2,3),
- ?line {ok, "D"} = ?PRIM_FILE:read(Fd2,1),
+ io:format("Fixed positions"),
+ {ok, 8} = ?PRIM_FILE:position(Fd2,8),
+ eof = ?PRIM_FILE:read(Fd2,1),
+ {ok, 8} = ?PRIM_FILE:position(Fd2,cur),
+ eof = ?PRIM_FILE:read(Fd2,1),
+ {ok, 7} = ?PRIM_FILE:position(Fd2,7),
+ {ok, "H"} = ?PRIM_FILE:read(Fd2,1),
+ {ok, 0} = ?PRIM_FILE:position(Fd2,0),
+ {ok, "A"} = ?PRIM_FILE:read(Fd2,1),
+ {ok, 3} = ?PRIM_FILE:position(Fd2,3),
+ {ok, "D"} = ?PRIM_FILE:read(Fd2,1),
+ {ok, 12} = ?PRIM_FILE:position(Fd2,12),
+ eof = ?PRIM_FILE:read(Fd2,1),
+ {ok, 3} = ?PRIM_FILE:position(Fd2,3),
+ {ok, "D"} = ?PRIM_FILE:read(Fd2,1),
%% Try the {bof,X} notation
- ?line {ok, 3} = ?PRIM_FILE:position(Fd2,{bof,3}),
- ?line {ok, "D"} = ?PRIM_FILE:read(Fd2,1),
+ {ok, 3} = ?PRIM_FILE:position(Fd2,{bof,3}),
+ {ok, "D"} = ?PRIM_FILE:read(Fd2,1),
%% Try eof positions
- ?line io:format("EOF positions"),
- ?line {ok, 8} = ?PRIM_FILE:position(Fd2,{eof,0}),
- ?line eof = ?PRIM_FILE:read(Fd2,1),
- ?line {ok, 7} = ?PRIM_FILE:position(Fd2,{eof,-1}),
- ?line {ok, "H"} = ?PRIM_FILE:read(Fd2,1),
- ?line {ok, 0} = ?PRIM_FILE:position(Fd2,{eof,-8}),
- ?line {ok, "A"} = ?PRIM_FILE:read(Fd2,1),
- ?line {error, einval} = ?PRIM_FILE:position(Fd2,{eof,-9}),
+ io:format("EOF positions"),
+ {ok, 8} = ?PRIM_FILE:position(Fd2,{eof,0}),
+ eof = ?PRIM_FILE:read(Fd2,1),
+ {ok, 7} = ?PRIM_FILE:position(Fd2,{eof,-1}),
+ {ok, "H"} = ?PRIM_FILE:read(Fd2,1),
+ {ok, 0} = ?PRIM_FILE:position(Fd2,{eof,-8}),
+ {ok, "A"} = ?PRIM_FILE:read(Fd2,1),
+ {error, einval} = ?PRIM_FILE:position(Fd2,{eof,-9}),
ok.
-pos2(suite) -> [];
-pos2(doc) -> [];
pos2(Config) when is_list(Config) ->
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_pos2.fil"),
- ?line {ok,Fd1} = ?PRIM_FILE:open(Name, [write]),
- ?line ?PRIM_FILE:write(Fd1,"ABCDEFGH"),
- ?line ok = ?PRIM_FILE:close(Fd1),
- ?line {ok, Fd2} = ?PRIM_FILE:open(Name, [read]),
- ?line {error, einval} = ?PRIM_FILE:position(Fd2,-1),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_pos2.fil"),
+ {ok,Fd1} = ?PRIM_FILE:open(Name, [write]),
+ ?PRIM_FILE:write(Fd1,"ABCDEFGH"),
+ ok = ?PRIM_FILE:close(Fd1),
+ {ok, Fd2} = ?PRIM_FILE:open(Name, [read]),
+ {error, einval} = ?PRIM_FILE:position(Fd2,-1),
%% Make sure that we still can search after an error.
- ?line {ok, 0} = ?PRIM_FILE:position(Fd2, 0),
- ?line {ok, 3} = ?PRIM_FILE:position(Fd2, {bof,3}),
- ?line {ok, "D"} = ?PRIM_FILE:read(Fd2,1),
+ {ok, 0} = ?PRIM_FILE:position(Fd2, 0),
+ {ok, 3} = ?PRIM_FILE:position(Fd2, {bof,3}),
+ {ok, "D"} = ?PRIM_FILE:read(Fd2,1),
- ?line io:format("DONE"),
+ io:format("DONE"),
ok.
-file_info_basic_file_a(suite) -> [];
-file_info_basic_file_a(doc) -> [];
file_info_basic_file_a(Config) when is_list(Config) ->
file_info_basic_file(Config, [], "_a").
-file_info_basic_file_b(suite) -> [];
-file_info_basic_file_b(doc) -> [];
file_info_basic_file_b(Config) when is_list(Config) ->
- ?line {ok, Handle} = ?PRIM_FILE:start(),
+ {ok, Handle} = ?PRIM_FILE:start(),
Result = file_info_basic_file(Config, Handle, "_b"),
- ?line ok = ?PRIM_FILE:stop(Handle),
+ ok = ?PRIM_FILE:stop(Handle),
Result.
file_info_basic_file(Config, Handle, Suffix) ->
- ?line RootDir = ?config(priv_dir, Config),
+ RootDir = proplists:get_value(priv_dir, Config),
%% Create a short file.
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_basic_test"++Suffix++".fil"),
- ?line {ok,Fd1} = ?PRIM_FILE:open(Name, [write]),
- ?line ?PRIM_FILE:write(Fd1, "foo bar"),
- ?line ok = ?PRIM_FILE:close(Fd1),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_basic_test"++Suffix++".fil"),
+ {ok,Fd1} = ?PRIM_FILE:open(Name, [write]),
+ ?PRIM_FILE:write(Fd1, "foo bar"),
+ ok = ?PRIM_FILE:close(Fd1),
%% Test that the file has the expected attributes.
%% The times are tricky, so we will save them to a separate test case.
- ?line {ok, FileInfo} = ?PRIM_FILE_call(read_file_info, Handle, [Name]),
- ?line #file_info{size = Size, type = Type, access = Access,
- atime = AccessTime, mtime = ModifyTime} =
+ {ok, FileInfo} = ?PRIM_FILE_call(read_file_info, Handle, [Name]),
+ #file_info{size = Size, type = Type, access = Access,
+ atime = AccessTime, mtime = ModifyTime} =
FileInfo,
- ?line io:format("Access ~p, Modify ~p", [AccessTime, ModifyTime]),
- ?line Size = 7,
- ?line Type = regular,
- ?line Access = read_write,
- ?line true = abs(time_dist(filter_atime(AccessTime, Config),
- filter_atime(ModifyTime,
- Config))) < 2,
- ?line {AD, AT} = AccessTime,
- ?line all_integers(tuple_to_list(AD) ++ tuple_to_list(AT)),
- ?line {MD, MT} = ModifyTime,
- ?line all_integers(tuple_to_list(MD) ++ tuple_to_list(MT)),
+ io:format("Access ~p, Modify ~p", [AccessTime, ModifyTime]),
+ Size = 7,
+ Type = regular,
+ Access = read_write,
+ true = abs(time_dist(filter_atime(AccessTime, Config),
+ filter_atime(ModifyTime,
+ Config))) < 2,
+ {AD, AT} = AccessTime,
+ all_integers(tuple_to_list(AD) ++ tuple_to_list(AT)),
+ {MD, MT} = ModifyTime,
+ all_integers(tuple_to_list(MD) ++ tuple_to_list(MT)),
ok.
-file_info_basic_directory_a(suite) -> [];
-file_info_basic_directory_a(doc) -> [];
file_info_basic_directory_a(Config) when is_list(Config) ->
file_info_basic_directory(Config, []).
-file_info_basic_directory_b(suite) -> [];
-file_info_basic_directory_b(doc) -> [];
file_info_basic_directory_b(Config) when is_list(Config) ->
- ?line {ok, Handle} = ?PRIM_FILE:start(),
+ {ok, Handle} = ?PRIM_FILE:start(),
Result = file_info_basic_directory(Config, Handle),
- ?line ok = ?PRIM_FILE:stop(Handle),
+ ok = ?PRIM_FILE:stop(Handle),
Result.
file_info_basic_directory(Config, Handle) ->
%% Note: filename:join/1 removes any trailing slash,
%% which is essential for ?PRIM_FILE:read_file_info/1 to work on
%% platforms such as Windows95.
- ?line RootDir = filename:join([?config(priv_dir, Config)]),
+ RootDir = filename:join([proplists:get_value(priv_dir, Config)]),
%% Test that the RootDir directory has the expected attributes.
- ?line test_directory(RootDir, read_write, Handle),
+ test_directory(RootDir, read_write, Handle),
%% Note that on Windows file systems, "/" or "c:/" are *NOT* directories.
%% Therefore, test that ?PRIM_FILE:read_file_info/1 behaves
%% as if they were directories.
- ?line case os:type() of
- {win32, _} ->
- ?line test_directory("/", read_write, Handle),
- ?line test_directory("c:/", read_write, Handle),
- ?line test_directory("c:\\", read_write, Handle);
- _ ->
- ?line test_directory("/", read, Handle)
- end,
+ case os:type() of
+ {win32, _} ->
+ test_directory("/", read_write, Handle),
+ test_directory("c:/", read_write, Handle),
+ test_directory("c:\\", read_write, Handle);
+ _ ->
+ test_directory("/", read, Handle)
+ end,
ok.
test_directory(Name, ExpectedAccess, Handle) ->
- ?line {ok, FileInfo} = ?PRIM_FILE_call(read_file_info, Handle, [Name]),
- ?line #file_info{size = Size, type = Type, access = Access,
- atime = AccessTime, mtime = ModifyTime} =
+ {ok, FileInfo} = ?PRIM_FILE_call(read_file_info, Handle, [Name]),
+ #file_info{size = Size, type = Type, access = Access,
+ atime = AccessTime, mtime = ModifyTime} =
FileInfo,
- ?line io:format("Testing directory ~s", [Name]),
- ?line io:format("Directory size is ~p", [Size]),
- ?line io:format("Access ~p", [Access]),
- ?line io:format("Access time ~p; Modify time~p",
- [AccessTime, ModifyTime]),
- ?line Type = directory,
- ?line Access = ExpectedAccess,
- ?line {AD, AT} = AccessTime,
- ?line all_integers(tuple_to_list(AD) ++ tuple_to_list(AT)),
- ?line {MD, MT} = ModifyTime,
- ?line all_integers(tuple_to_list(MD) ++ tuple_to_list(MT)),
+ io:format("Testing directory ~s", [Name]),
+ io:format("Directory size is ~p", [Size]),
+ io:format("Access ~p", [Access]),
+ io:format("Access time ~p; Modify time~p",
+ [AccessTime, ModifyTime]),
+ Type = directory,
+ Access = ExpectedAccess,
+ {AD, AT} = AccessTime,
+ all_integers(tuple_to_list(AD) ++ tuple_to_list(AT)),
+ {MD, MT} = ModifyTime,
+ all_integers(tuple_to_list(MD) ++ tuple_to_list(MT)),
ok.
all_integers([Int|Rest]) when is_integer(Int) ->
- ?line all_integers(Rest);
+ all_integers(Rest);
all_integers([]) ->
ok.
%% Try something nonexistent.
-file_info_bad_a(suite) -> [];
-file_info_bad_a(doc) -> [];
file_info_bad_a(Config) when is_list(Config) ->
file_info_bad(Config, []).
-file_info_bad_b(suite) -> [];
-file_info_bad_b(doc) -> [];
file_info_bad_b(Config) when is_list(Config) ->
- ?line {ok, Handle} = ?PRIM_FILE:start(),
+ {ok, Handle} = ?PRIM_FILE:start(),
Result = file_info_bad(Config, Handle),
- ?line ok = ?PRIM_FILE:stop(Handle),
+ ok = ?PRIM_FILE:stop(Handle),
Result.
file_info_bad(Config, Handle) ->
- ?line RootDir = filename:join([?config(priv_dir, Config)]),
- ?line {error, enoent} =
+ RootDir = filename:join([proplists:get_value(priv_dir, Config)]),
+ {error, enoent} =
?PRIM_FILE_call(
read_file_info, Handle,
[filename:join(RootDir,
@@ -878,28 +832,22 @@ file_info_bad(Config, Handle) ->
%% Test that the file times behave as they should.
-file_info_times_a(suite) -> [];
-file_info_times_a(doc) -> [];
file_info_times_a(Config) when is_list(Config) ->
file_info_times(Config, [], "_a").
-file_info_times_b(suite) -> [];
-file_info_times_b(doc) -> [];
file_info_times_b(Config) when is_list(Config) ->
- ?line {ok, Handle} = ?PRIM_FILE:start(),
+ {ok, Handle} = ?PRIM_FILE:start(),
Result = file_info_times(Config, Handle, "_b"),
- ?line ok = ?PRIM_FILE:stop(Handle),
+ ok = ?PRIM_FILE:stop(Handle),
Result.
file_info_times(Config, Handle, Suffix) ->
- ?line Dog = test_server:timetrap(test_server:seconds(60)),
%% We have to try this twice, since if the test runs across the change
%% of a month the time diff calculations will fail. But it won't happen
%% if you run it twice in succession.
- ?line test_server:m_out_of_n(
- 1,2,
- fun() -> ?line file_info_int(Config, Handle, Suffix) end),
- ?line test_server:timetrap_cancel(Dog),
+ test_server:m_out_of_n(
+ 1,2,
+ fun() -> file_info_int(Config, Handle, Suffix) end),
ok.
file_info_int(Config, Handle, Suffix) ->
@@ -907,55 +855,55 @@ file_info_int(Config, Handle, Suffix) ->
%% which is essential for ?PRIM_FILE:read_file_info/1 to work on
%% platforms such as Windows95.
- ?line RootDir = filename:join([?config(priv_dir, Config)]),
- ?line test_server:format("RootDir = ~p", [RootDir]),
+ RootDir = filename:join([proplists:get_value(priv_dir, Config)]),
+ io:format("RootDir = ~p", [RootDir]),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_file_info"++Suffix++".fil"),
- ?line {ok,Fd1} = ?PRIM_FILE:open(Name, [write]),
- ?line ?PRIM_FILE:write(Fd1,"foo"),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_file_info"++Suffix++".fil"),
+ {ok,Fd1} = ?PRIM_FILE:open(Name, [write]),
+ ?PRIM_FILE:write(Fd1,"foo"),
%% check that the file got a modify date max a few seconds away from now
- ?line {ok, #file_info{type = regular,
- atime = AccTime1, mtime = ModTime1}} =
+ {ok, #file_info{type = regular,
+ atime = AccTime1, mtime = ModTime1}} =
?PRIM_FILE_call(read_file_info, Handle, [Name]),
- ?line Now = erlang:localtime(),
- ?line io:format("Now ~p",[Now]),
- ?line io:format("Open file Acc ~p Mod ~p",[AccTime1,ModTime1]),
- ?line true = abs(time_dist(filter_atime(Now, Config),
- filter_atime(AccTime1,
- Config))) < 8,
- ?line true = abs(time_dist(Now, ModTime1)) < 8,
-
+ Now = erlang:localtime(),
+ io:format("Now ~p",[Now]),
+ io:format("Open file Acc ~p Mod ~p",[AccTime1,ModTime1]),
+ true = abs(time_dist(filter_atime(Now, Config),
+ filter_atime(AccTime1,
+ Config))) < 8,
+ true = abs(time_dist(Now, ModTime1)) < 8,
+
%% Sleep until we can be sure the seconds value has changed.
%% Note: FAT-based filesystem (like on Windows 95) have
%% a resolution of 2 seconds.
- ?line test_server:sleep(test_server:seconds(2.2)),
+ ct:sleep({seconds,2.2}),
%% close the file, and watch the modify date change
- ?line ok = ?PRIM_FILE:close(Fd1),
- ?line {ok, #file_info{size = Size, type = regular, access = Access,
- atime = AccTime2, mtime = ModTime2}} =
+ ok = ?PRIM_FILE:close(Fd1),
+ {ok, #file_info{size = Size, type = regular, access = Access,
+ atime = AccTime2, mtime = ModTime2}} =
?PRIM_FILE_call(read_file_info, Handle, [Name]),
- ?line io:format("Closed file Acc ~p Mod ~p",[AccTime2,ModTime2]),
- ?line true = time_dist(ModTime1, ModTime2) >= 0,
+ io:format("Closed file Acc ~p Mod ~p",[AccTime2,ModTime2]),
+ true = time_dist(ModTime1, ModTime2) >= 0,
%% this file is supposed to be binary, so it'd better keep it's size
- ?line Size = 3,
- ?line Access = read_write,
+ Size = 3,
+ Access = read_write,
%% Do some directory checking
- ?line {ok, #file_info{size = DSize, type = directory,
- access = DAccess,
- atime = AccTime3, mtime = ModTime3}} =
+ {ok, #file_info{size = DSize, type = directory,
+ access = DAccess,
+ atime = AccTime3, mtime = ModTime3}} =
?PRIM_FILE_call(read_file_info, Handle, [RootDir]),
%% this dir was modified only a few secs ago
- ?line io:format("Dir Acc ~p; Mod ~p; Now ~p",
- [AccTime3, ModTime3, Now]),
- ?line true = abs(time_dist(Now, ModTime3)) < 5,
- ?line DAccess = read_write,
- ?line io:format("Dir size is ~p",[DSize]),
+ io:format("Dir Acc ~p; Mod ~p; Now ~p",
+ [AccTime3, ModTime3, Now]),
+ true = abs(time_dist(Now, ModTime3)) < 5,
+ DAccess = read_write,
+ io:format("Dir size is ~p",[DSize]),
ok.
%% Filter access times, to cope with a deficiency of FAT file systems
@@ -966,9 +914,9 @@ filter_atime(Atime, Config) ->
true ->
case Atime of
{Date, _} ->
- {Date, {0, 0, 0}};
+ {Date, {0, 0, 0}};
{Y, M, D, _, _, _} ->
- {Y, M, D, 0, 0, 0}
+ {Y, M, D, 0, 0, 0}
end;
false ->
Atime
@@ -976,163 +924,146 @@ filter_atime(Atime, Config) ->
%% Test the write_file_info/2 function.
-file_write_file_info_a(suite) -> [];
-file_write_file_info_a(doc) -> [];
file_write_file_info_a(Config) when is_list(Config) ->
file_write_file_info(Config, [], "_a").
-file_write_file_info_b(suite) -> [];
-file_write_file_info_b(doc) -> [];
file_write_file_info_b(Config) when is_list(Config) ->
- ?line {ok, Handle} = ?PRIM_FILE:start(),
+ {ok, Handle} = ?PRIM_FILE:start(),
Result = file_write_file_info(Config, Handle, "_b"),
- ?line ok = ?PRIM_FILE:stop(Handle),
+ ok = ?PRIM_FILE:stop(Handle),
Result.
file_write_file_info(Config, Handle, Suffix) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = get_good_directory(Config),
- ?line test_server:format("RootDir = ~p", [RootDir]),
+ RootDir = get_good_directory(Config),
+ io:format("RootDir = ~p", [RootDir]),
%% Set the file to read only AND update the file times at the same time.
%% (This used to fail on Windows NT/95 for a local filesystem.)
%% Note: Seconds must be even; see note in file_info_times/1.
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_write_file_info_ro"++Suffix),
- ?line ok = ?PRIM_FILE:write_file(Name, "hello"),
- ?line Time = {{1997, 01, 02}, {12, 35, 42}},
- ?line Info = #file_info{mode=8#400, atime=Time, mtime=Time, ctime=Time},
- ?line ok = ?PRIM_FILE_call(write_file_info, Handle, [Name, Info]),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_write_file_info_ro"++Suffix),
+ ok = ?PRIM_FILE:write_file(Name, "hello"),
+ Time = {{1997, 01, 02}, {12, 35, 42}},
+ Info = #file_info{mode=8#400, atime=Time, mtime=Time, ctime=Time},
+ ok = ?PRIM_FILE_call(write_file_info, Handle, [Name, Info]),
%% Read back the times.
- ?line {ok, ActualInfo} =
+ {ok, ActualInfo} =
?PRIM_FILE_call(read_file_info, Handle, [Name]),
- ?line #file_info{mode=_Mode, atime=ActAtime, mtime=Time,
- ctime=ActCtime} = ActualInfo,
- ?line FilteredAtime = filter_atime(Time, Config),
- ?line FilteredAtime = filter_atime(ActAtime, Config),
- ?line case os:type() of
- {win32, _} ->
- %% On Windows, "ctime" means creation time and it can
- %% be set.
- ActCtime = Time;
- _ ->
- ok
- end,
- ?line {error, eacces} = ?PRIM_FILE:write_file(Name, "hello again"),
+ #file_info{mode=_Mode, atime=ActAtime, mtime=Time,
+ ctime=ActCtime} = ActualInfo,
+ FilteredAtime = filter_atime(Time, Config),
+ FilteredAtime = filter_atime(ActAtime, Config),
+ case os:type() of
+ {win32, _} ->
+ %% On Windows, "ctime" means creation time and it can
+ %% be set.
+ ActCtime = Time;
+ _ ->
+ ok
+ end,
+ {error, eacces} = ?PRIM_FILE:write_file(Name, "hello again"),
%% Make the file writable again.
- ?line ?PRIM_FILE_call(write_file_info, Handle,
- [Name, #file_info{mode=8#600}]),
- ?line ok = ?PRIM_FILE:write_file(Name, "hello again"),
+ ?PRIM_FILE_call(write_file_info, Handle,
+ [Name, #file_info{mode=8#600}]),
+ ok = ?PRIM_FILE:write_file(Name, "hello again"),
%% And unwritable.
- ?line ?PRIM_FILE_call(write_file_info, Handle,
- [Name, #file_info{mode=8#400}]),
- ?line {error, eacces} = ?PRIM_FILE:write_file(Name, "hello again"),
+ ?PRIM_FILE_call(write_file_info, Handle,
+ [Name, #file_info{mode=8#400}]),
+ {error, eacces} = ?PRIM_FILE:write_file(Name, "hello again"),
%% Write the times again.
%% Note: Seconds must be even; see note in file_info_times/1.
- ?line NewTime = {{1997, 02, 15}, {13, 18, 20}},
- ?line NewInfo = #file_info{atime=NewTime, mtime=NewTime, ctime=NewTime},
- ?line ok = ?PRIM_FILE_call(write_file_info, Handle, [Name, NewInfo]),
- ?line {ok, ActualInfo2} =
+ NewTime = {{1997, 02, 15}, {13, 18, 20}},
+ NewInfo = #file_info{atime=NewTime, mtime=NewTime, ctime=NewTime},
+ ok = ?PRIM_FILE_call(write_file_info, Handle, [Name, NewInfo]),
+ {ok, ActualInfo2} =
?PRIM_FILE_call(read_file_info, Handle, [Name]),
- ?line #file_info{atime=NewActAtime, mtime=NewTime,
- ctime=NewActCtime} = ActualInfo2,
- ?line NewFilteredAtime = filter_atime(NewTime, Config),
- ?line NewFilteredAtime = filter_atime(NewActAtime, Config),
- ?line case os:type() of
- {win32, _} -> NewActCtime = NewTime;
- _ -> ok
- end,
+ #file_info{atime=NewActAtime, mtime=NewTime,
+ ctime=NewActCtime} = ActualInfo2,
+ NewFilteredAtime = filter_atime(NewTime, Config),
+ NewFilteredAtime = filter_atime(NewActAtime, Config),
+ case os:type() of
+ {win32, _} -> NewActCtime = NewTime;
+ _ -> ok
+ end,
%% The file should still be unwritable.
- ?line {error, eacces} = ?PRIM_FILE:write_file(Name, "hello again"),
+ {error, eacces} = ?PRIM_FILE:write_file(Name, "hello again"),
%% Make the file writeable again, so that we can remove the
%% test suites ... :-)
- ?line ?PRIM_FILE_call(write_file_info, Handle,
- [Name, #file_info{mode=8#600}]),
- ?line test_server:timetrap_cancel(Dog),
+ ?PRIM_FILE_call(write_file_info, Handle,
+ [Name, #file_info{mode=8#600}]),
ok.
%% Test the write_file_info/3 function.
-file_write_file_info_opts(suite) -> [];
-file_write_file_info_opts(doc) -> [];
file_write_file_info_opts(Config) when is_list(Config) ->
{ok, Handle} = ?PRIM_FILE:start(),
- Dog = test_server:timetrap(test_server:seconds(10)),
RootDir = get_good_directory(Config),
- test_server:format("RootDir = ~p", [RootDir]),
+ io:format("RootDir = ~p", [RootDir]),
Name = filename:join(RootDir, atom_to_list(?MODULE) ++"_write_file_info_opts"),
ok = ?PRIM_FILE:write_file(Name, "hello_opts"),
lists:foreach(fun
- ({FI, Opts}) ->
- ok = ?PRIM_FILE_call(write_file_info, Handle, [Name, FI, Opts])
- end, [
- {#file_info{ mode=8#600, atime = Time, mtime = Time, ctime = Time}, Opts} ||
- Opts <- [[{time, posix}]],
- Time <- [ 0,1,-1,100,-100,1000,-1000,10000,-10000 ]
- ]),
-
- % REM: determine date range dependent on time_t = Uint32 | Sint32 | Sint64
- % Determine time_t on os:type()?
+ ({FI, Opts}) ->
+ ok = ?PRIM_FILE_call(write_file_info, Handle, [Name, FI, Opts])
+ end, [
+ {#file_info{ mode=8#600, atime = Time, mtime = Time, ctime = Time}, Opts} ||
+ Opts <- [[{time, posix}]],
+ Time <- [ 0,1,-1,100,-100,1000,-1000,10000,-10000 ]
+ ]),
+
+ %% REM: determine date range dependent on time_t = Uint32 | Sint32 | Sint64
+ %% Determine time_t on os:type()?
lists:foreach(fun
- ({FI, Opts}) ->
- ok = ?PRIM_FILE_call(write_file_info, Handle, [Name, FI, Opts])
- end, [
- {#file_info{ mode=8#400, atime = Time, mtime = Time, ctime = Time}, Opts} ||
- Opts <- [[{time, universal}],[{time, local}]],
- Time <- [
- {{1970,1,1},{0,0,0}},
- {{1970,1,1},{0,0,1}},
- {{1969,12,31},{23,59,59}},
- {{1908,2,3},{23,59,59}},
- {{2012,2,3},{23,59,59}},
- {{2037,2,3},{23,59,59}},
- erlang:localtime()
- ]]),
+ ({FI, Opts}) ->
+ ok = ?PRIM_FILE_call(write_file_info, Handle, [Name, FI, Opts])
+ end, [
+ {#file_info{ mode=8#400, atime = Time, mtime = Time, ctime = Time}, Opts} ||
+ Opts <- [[{time, universal}],[{time, local}]],
+ Time <- [
+ {{1970,1,1},{0,0,0}},
+ {{1970,1,1},{0,0,1}},
+ {{1969,12,31},{23,59,59}},
+ {{1908,2,3},{23,59,59}},
+ {{2012,2,3},{23,59,59}},
+ {{2037,2,3},{23,59,59}},
+ erlang:localtime()
+ ]]),
ok = ?PRIM_FILE:stop(Handle),
- test_server:timetrap_cancel(Dog),
ok.
-file_read_file_info_opts(suite) -> [];
-file_read_file_info_opts(doc) -> [];
file_read_file_info_opts(Config) when is_list(Config) ->
{ok, Handle} = ?PRIM_FILE:start(),
- Dog = test_server:timetrap(test_server:seconds(10)),
RootDir = get_good_directory(Config),
- test_server:format("RootDir = ~p", [RootDir]),
+ io:format("RootDir = ~p", [RootDir]),
Name = filename:join(RootDir, atom_to_list(?MODULE) ++"_read_file_info_opts"),
ok = ?PRIM_FILE:write_file(Name, "hello_opts"),
lists:foreach(fun
- (Opts) ->
- {ok,_} = ?PRIM_FILE_call(read_file_info, Handle, [Name, Opts])
- end, [[{time, Type}] || Type <- [local, universal, posix]]),
+ (Opts) ->
+ {ok,_} = ?PRIM_FILE_call(read_file_info, Handle, [Name, Opts])
+ end, [[{time, Type}] || Type <- [local, universal, posix]]),
ok = ?PRIM_FILE:stop(Handle),
- test_server:timetrap_cancel(Dog),
ok.
%% Test the write and read back *_file_info/3 functions.
-file_write_read_file_info_opts(suite) -> [];
-file_write_read_file_info_opts(doc) -> [];
file_write_read_file_info_opts(Config) when is_list(Config) ->
{ok, Handle} = ?PRIM_FILE:start(),
- Dog = test_server:timetrap(test_server:seconds(10)),
RootDir = get_good_directory(Config),
- test_server:format("RootDir = ~p", [RootDir]),
+ io:format("RootDir = ~p", [RootDir]),
Name = filename:join(RootDir, atom_to_list(?MODULE) ++"_read_write_file_info_opts"),
ok = ?PRIM_FILE:write_file(Name, "hello_opts2"),
@@ -1148,7 +1079,6 @@ file_write_read_file_info_opts(Config) when is_list(Config) ->
ok = file_write_read_file_info_opts(Handle, Name, 0, [{time, posix}]),
ok = ?PRIM_FILE:stop(Handle),
- test_server:timetrap_cancel(Dog),
ok.
file_write_read_file_info_opts(Handle, Name, Mtime, Opts) ->
@@ -1163,136 +1093,131 @@ file_write_read_file_info_opts(Handle, Name, Mtime, Opts) ->
%% Returns a directory on a file system that has correct file times.
get_good_directory(Config) ->
- ?line ?config(priv_dir, Config).
+ proplists:get_value(priv_dir, Config).
-truncate(suite) -> [];
-truncate(doc) -> [];
truncate(Config) when is_list(Config) ->
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_truncate.fil"),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_truncate.fil"),
%% Create a file with some data.
- ?line MyData = "0123456789abcdefghijklmnopqrstuvxyz",
- ?line ok = ?PRIM_FILE:write_file(Name, MyData),
+ MyData = "0123456789abcdefghijklmnopqrstuvxyz",
+ ok = ?PRIM_FILE:write_file(Name, MyData),
%% Truncate the file to 10 characters.
- ?line {ok, Fd} = ?PRIM_FILE:open(Name, [read, write]),
- ?line {ok, 10} = ?PRIM_FILE:position(Fd, 10),
- ?line ok = ?PRIM_FILE:truncate(Fd),
- ?line ok = ?PRIM_FILE:close(Fd),
+ {ok, Fd} = ?PRIM_FILE:open(Name, [read, write]),
+ {ok, 10} = ?PRIM_FILE:position(Fd, 10),
+ ok = ?PRIM_FILE:truncate(Fd),
+ ok = ?PRIM_FILE:close(Fd),
%% Read back the file and check that it has been truncated.
- ?line Expected = list_to_binary("0123456789"),
- ?line {ok, Expected} = ?PRIM_FILE:read_file(Name),
+ Expected = list_to_binary("0123456789"),
+ {ok, Expected} = ?PRIM_FILE:read_file(Name),
%% Open the file read only and verify that it is not possible to
%% truncate it, OTP-1960
- ?line {ok, Fd2} = ?PRIM_FILE:open(Name, [read]),
- ?line {ok, 5} = ?PRIM_FILE:position(Fd2, 5),
- ?line {error, _} = ?PRIM_FILE:truncate(Fd2),
+ {ok, Fd2} = ?PRIM_FILE:open(Name, [read]),
+ {ok, 5} = ?PRIM_FILE:position(Fd2, 5),
+ {error, _} = ?PRIM_FILE:truncate(Fd2),
ok.
-datasync(suite) -> [];
-datasync(doc) -> "Tests that ?PRIM_FILE:datasync/1 at least doesn't crash.";
+%% Tests that ?PRIM_FILE:datasync/1 at least doesn't crash.
datasync(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Sync = filename:join(PrivDir,
- atom_to_list(?MODULE)
- ++"_sync.fil"),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Sync = filename:join(PrivDir,
+ atom_to_list(?MODULE)
+ ++"_sync.fil"),
%% Raw open.
- ?line {ok, Fd} = ?PRIM_FILE:open(Sync, [write]),
- ?line ok = ?PRIM_FILE:datasync(Fd),
- ?line ok = ?PRIM_FILE:close(Fd),
+ {ok, Fd} = ?PRIM_FILE:open(Sync, [write]),
+ ok = ?PRIM_FILE:datasync(Fd),
+ ok = ?PRIM_FILE:close(Fd),
ok.
-sync(suite) -> [];
-sync(doc) -> "Tests that ?PRIM_FILE:sync/1 at least doesn't crash.";
+%% Tests that ?PRIM_FILE:sync/1 at least doesn't crash.
sync(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Sync = filename:join(PrivDir,
- atom_to_list(?MODULE)
- ++"_sync.fil"),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Sync = filename:join(PrivDir,
+ atom_to_list(?MODULE)
+ ++"_sync.fil"),
%% Raw open.
- ?line {ok, Fd} = ?PRIM_FILE:open(Sync, [write]),
- ?line ok = ?PRIM_FILE:sync(Fd),
- ?line ok = ?PRIM_FILE:close(Fd),
+ {ok, Fd} = ?PRIM_FILE:open(Sync, [write]),
+ ok = ?PRIM_FILE:sync(Fd),
+ ok = ?PRIM_FILE:close(Fd),
ok.
-advise(suite) -> [];
-advise(doc) -> "Tests that ?PRIM_FILE:advise/4 at least doesn't crash.";
+%% Tests that ?PRIM_FILE:advise/4 at least doesn't crash.
advise(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Advise = filename:join(PrivDir,
- atom_to_list(?MODULE)
- ++"_advise.fil"),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Advise = filename:join(PrivDir,
+ atom_to_list(?MODULE)
+ ++"_advise.fil"),
Line1 = "Hello\n",
Line2 = "World!\n",
- ?line {ok, Fd} = ?PRIM_FILE:open(Advise, [write]),
- ?line ok = ?PRIM_FILE:advise(Fd, 0, 0, normal),
- ?line ok = ?PRIM_FILE:write(Fd, Line1),
- ?line ok = ?PRIM_FILE:write(Fd, Line2),
- ?line ok = ?PRIM_FILE:close(Fd),
-
- ?line {ok, Fd2} = ?PRIM_FILE:open(Advise, [write]),
- ?line ok = ?PRIM_FILE:advise(Fd2, 0, 0, random),
- ?line ok = ?PRIM_FILE:write(Fd2, Line1),
- ?line ok = ?PRIM_FILE:write(Fd2, Line2),
- ?line ok = ?PRIM_FILE:close(Fd2),
-
- ?line {ok, Fd3} = ?PRIM_FILE:open(Advise, [write]),
- ?line ok = ?PRIM_FILE:advise(Fd3, 0, 0, sequential),
- ?line ok = ?PRIM_FILE:write(Fd3, Line1),
- ?line ok = ?PRIM_FILE:write(Fd3, Line2),
- ?line ok = ?PRIM_FILE:close(Fd3),
-
- ?line {ok, Fd4} = ?PRIM_FILE:open(Advise, [write]),
- ?line ok = ?PRIM_FILE:advise(Fd4, 0, 0, will_need),
- ?line ok = ?PRIM_FILE:write(Fd4, Line1),
- ?line ok = ?PRIM_FILE:write(Fd4, Line2),
- ?line ok = ?PRIM_FILE:close(Fd4),
-
- ?line {ok, Fd5} = ?PRIM_FILE:open(Advise, [write]),
- ?line ok = ?PRIM_FILE:advise(Fd5, 0, 0, dont_need),
- ?line ok = ?PRIM_FILE:write(Fd5, Line1),
- ?line ok = ?PRIM_FILE:write(Fd5, Line2),
- ?line ok = ?PRIM_FILE:close(Fd5),
-
- ?line {ok, Fd6} = ?PRIM_FILE:open(Advise, [write]),
- ?line ok = ?PRIM_FILE:advise(Fd6, 0, 0, no_reuse),
- ?line ok = ?PRIM_FILE:write(Fd6, Line1),
- ?line ok = ?PRIM_FILE:write(Fd6, Line2),
- ?line ok = ?PRIM_FILE:close(Fd6),
-
- ?line {ok, Fd7} = ?PRIM_FILE:open(Advise, [write]),
- ?line {error, einval} = ?PRIM_FILE:advise(Fd7, 0, 0, bad_advise),
- ?line ok = ?PRIM_FILE:close(Fd7),
+ {ok, Fd} = ?PRIM_FILE:open(Advise, [write]),
+ ok = ?PRIM_FILE:advise(Fd, 0, 0, normal),
+ ok = ?PRIM_FILE:write(Fd, Line1),
+ ok = ?PRIM_FILE:write(Fd, Line2),
+ ok = ?PRIM_FILE:close(Fd),
+
+ {ok, Fd2} = ?PRIM_FILE:open(Advise, [write]),
+ ok = ?PRIM_FILE:advise(Fd2, 0, 0, random),
+ ok = ?PRIM_FILE:write(Fd2, Line1),
+ ok = ?PRIM_FILE:write(Fd2, Line2),
+ ok = ?PRIM_FILE:close(Fd2),
+
+ {ok, Fd3} = ?PRIM_FILE:open(Advise, [write]),
+ ok = ?PRIM_FILE:advise(Fd3, 0, 0, sequential),
+ ok = ?PRIM_FILE:write(Fd3, Line1),
+ ok = ?PRIM_FILE:write(Fd3, Line2),
+ ok = ?PRIM_FILE:close(Fd3),
+
+ {ok, Fd4} = ?PRIM_FILE:open(Advise, [write]),
+ ok = ?PRIM_FILE:advise(Fd4, 0, 0, will_need),
+ ok = ?PRIM_FILE:write(Fd4, Line1),
+ ok = ?PRIM_FILE:write(Fd4, Line2),
+ ok = ?PRIM_FILE:close(Fd4),
+
+ {ok, Fd5} = ?PRIM_FILE:open(Advise, [write]),
+ ok = ?PRIM_FILE:advise(Fd5, 0, 0, dont_need),
+ ok = ?PRIM_FILE:write(Fd5, Line1),
+ ok = ?PRIM_FILE:write(Fd5, Line2),
+ ok = ?PRIM_FILE:close(Fd5),
+
+ {ok, Fd6} = ?PRIM_FILE:open(Advise, [write]),
+ ok = ?PRIM_FILE:advise(Fd6, 0, 0, no_reuse),
+ ok = ?PRIM_FILE:write(Fd6, Line1),
+ ok = ?PRIM_FILE:write(Fd6, Line2),
+ ok = ?PRIM_FILE:close(Fd6),
+
+ {ok, Fd7} = ?PRIM_FILE:open(Advise, [write]),
+ {error, einval} = ?PRIM_FILE:advise(Fd7, 0, 0, bad_advise),
+ ok = ?PRIM_FILE:close(Fd7),
%% test write without advise, then a read after an advise
- ?line {ok, Fd8} = ?PRIM_FILE:open(Advise, [write]),
- ?line ok = ?PRIM_FILE:write(Fd8, Line1),
- ?line ok = ?PRIM_FILE:write(Fd8, Line2),
- ?line ok = ?PRIM_FILE:close(Fd8),
- ?line {ok, Fd9} = ?PRIM_FILE:open(Advise, [read]),
+ {ok, Fd8} = ?PRIM_FILE:open(Advise, [write]),
+ ok = ?PRIM_FILE:write(Fd8, Line1),
+ ok = ?PRIM_FILE:write(Fd8, Line2),
+ ok = ?PRIM_FILE:close(Fd8),
+ {ok, Fd9} = ?PRIM_FILE:open(Advise, [read]),
Offset = 0,
%% same as a 0 length in some implementations
Length = length(Line1) + length(Line2),
- ?line ok = ?PRIM_FILE:advise(Fd9, Offset, Length, sequential),
- ?line {ok, Line1} = ?PRIM_FILE:read_line(Fd9),
- ?line {ok, Line2} = ?PRIM_FILE:read_line(Fd9),
- ?line eof = ?PRIM_FILE:read_line(Fd9),
- ?line ok = ?PRIM_FILE:close(Fd9),
+ ok = ?PRIM_FILE:advise(Fd9, Offset, Length, sequential),
+ {ok, Line1} = ?PRIM_FILE:read_line(Fd9),
+ {ok, Line2} = ?PRIM_FILE:read_line(Fd9),
+ eof = ?PRIM_FILE:read_line(Fd9),
+ ok = ?PRIM_FILE:close(Fd9),
ok.
@@ -1304,7 +1229,6 @@ large_write(Config) when is_list(Config) ->
"_large_write").
do_large_write(Name) ->
- Dog = test_server:timetrap(test_server:minutes(60)),
ChunkSize = (256 bsl 20) + 1, % 256 M + 1
Chunks = 16, % times 16 -> 4 G + 16
Base = 100,
@@ -1317,187 +1241,177 @@ do_large_write(Name) ->
ok when Wordsize =:= 8 ->
{ok,#file_info{size=Size}} = file:read_file_info(Name),
{ok,Fd} = prim_file:open(Name, [read]),
- check_large_write(Dog, Fd, ChunkSize, 0, Interleave);
+ check_large_write(Fd, ChunkSize, 0, Interleave);
{error,einval} when Wordsize =:= 4 ->
ok
end.
-check_large_write(Dog, Fd, ChunkSize, Pos, [X|Interleave]) ->
+check_large_write(Fd, ChunkSize, Pos, [X|Interleave]) ->
Pos1 = Pos + ChunkSize,
{ok,Pos1} = prim_file:position(Fd, {cur,ChunkSize}),
{ok,[X]} = prim_file:read(Fd, 1),
- check_large_write(Dog, Fd, ChunkSize, Pos1+1, Interleave);
-check_large_write(Dog, Fd, _, _, []) ->
+ check_large_write(Fd, ChunkSize, Pos1+1, Interleave);
+check_large_write(Fd, _, _, []) ->
eof = prim_file:read(Fd, 1),
- test_server:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-allocate(suite) -> [];
-allocate(doc) -> "Tests that ?PRIM_FILE:allocate/3 at least doesn't crash.";
+%% Tests that ?PRIM_FILE:allocate/3 at least doesn't crash.
allocate(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Allocate = filename:join(PrivDir,
- atom_to_list(?MODULE)
- ++"_allocate.fil"),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Allocate = filename:join(PrivDir,
+ atom_to_list(?MODULE)
+ ++"_allocate.fil"),
Line1 = "Hello\n",
Line2 = "World!\n",
- ?line {ok, Fd} = ?PRIM_FILE:open(Allocate, [write, binary]),
+ {ok, Fd} = ?PRIM_FILE:open(Allocate, [write, binary]),
allocate_and_assert(Fd, 1, iolist_size([Line1, Line2])),
- ?line ok = ?PRIM_FILE:write(Fd, Line1),
- ?line ok = ?PRIM_FILE:write(Fd, Line2),
- ?line ok = ?PRIM_FILE:close(Fd),
+ ok = ?PRIM_FILE:write(Fd, Line1),
+ ok = ?PRIM_FILE:write(Fd, Line2),
+ ok = ?PRIM_FILE:close(Fd),
- ?line {ok, Fd2} = ?PRIM_FILE:open(Allocate, [write, binary]),
+ {ok, Fd2} = ?PRIM_FILE:open(Allocate, [write, binary]),
allocate_and_assert(Fd2, 1, iolist_size(Line1)),
- ?line ok = ?PRIM_FILE:write(Fd2, Line1),
- ?line ok = ?PRIM_FILE:write(Fd2, Line2),
- ?line ok = ?PRIM_FILE:close(Fd2),
+ ok = ?PRIM_FILE:write(Fd2, Line1),
+ ok = ?PRIM_FILE:write(Fd2, Line2),
+ ok = ?PRIM_FILE:close(Fd2),
- ?line {ok, Fd3} = ?PRIM_FILE:open(Allocate, [write, binary]),
+ {ok, Fd3} = ?PRIM_FILE:open(Allocate, [write, binary]),
allocate_and_assert(Fd3, 1, iolist_size(Line1) + 1),
- ?line ok = ?PRIM_FILE:write(Fd3, Line1),
- ?line ok = ?PRIM_FILE:write(Fd3, Line2),
- ?line ok = ?PRIM_FILE:close(Fd3),
+ ok = ?PRIM_FILE:write(Fd3, Line1),
+ ok = ?PRIM_FILE:write(Fd3, Line2),
+ ok = ?PRIM_FILE:close(Fd3),
- ?line {ok, Fd4} = ?PRIM_FILE:open(Allocate, [write, binary]),
+ {ok, Fd4} = ?PRIM_FILE:open(Allocate, [write, binary]),
allocate_and_assert(Fd4, 1, 4 * iolist_size([Line1, Line2])),
- ?line ok = ?PRIM_FILE:write(Fd4, Line1),
- ?line ok = ?PRIM_FILE:write(Fd4, Line2),
- ?line ok = ?PRIM_FILE:close(Fd4),
+ ok = ?PRIM_FILE:write(Fd4, Line1),
+ ok = ?PRIM_FILE:write(Fd4, Line2),
+ ok = ?PRIM_FILE:close(Fd4),
ok.
allocate_and_assert(Fd, Offset, Length) ->
- % Just verify that calls to ?PRIM_FILE:allocate/3 don't crash or have
- % any other negative side effect. We can't really asssert against a
- % specific return value, because support for file space pre-allocation
- % depends on the OS, OS version and underlying filesystem.
- %
- % The Linux kernel added support for fallocate() in version 2.6.23,
- % which currently works only for the ext4, ocfs2, xfs and btrfs file
- % systems. posix_fallocate() is available in glibc as of version
- % 2.1.94, but it was buggy until glibc version 2.7.
- %
- % Mac OS X, as of version 10.3, supports the fcntl operation F_PREALLOCATE.
- %
- % Solaris supports posix_fallocate() but only for the UFS file system
- % apparently (not supported for ZFS).
- %
- % FreeBSD 9.0 is the first FreeBSD release supporting posix_fallocate().
- %
- % For Windows there's apparently no way to pre-allocate file space, at
- % least with similar API/semantics as posix_fallocate(), fallocate() or
- % fcntl F_PREALLOCATE.
+ %% Just verify that calls to ?PRIM_FILE:allocate/3 don't crash or have
+ %% any other negative side effect. We can't really asssert against a
+ %% specific return value, because support for file space pre-allocation
+ %% depends on the OS, OS version and underlying filesystem.
+ %%
+ %% The Linux kernel added support for fallocate() in version 2.6.23,
+ %% which currently works only for the ext4, ocfs2, xfs and btrfs file
+ %% systems. posix_fallocate() is available in glibc as of version
+ %% 2.1.94, but it was buggy until glibc version 2.7.
+ %%
+ %% Mac OS X, as of version 10.3, supports the fcntl operation F_PREALLOCATE.
+ %%
+ %% Solaris supports posix_fallocate() but only for the UFS file system
+ %% apparently (not supported for ZFS).
+ %%
+ %% FreeBSD 9.0 is the first FreeBSD release supporting posix_fallocate().
+ %%
+ %% For Windows there's apparently no way to pre-allocate file space, at
+ %% least with similar API/semantics as posix_fallocate(), fallocate() or
+ %% fcntl F_PREALLOCATE.
Result = ?PRIM_FILE:allocate(Fd, Offset, Length),
case os:type() of
{win32, _} ->
- ?line {error, enotsup} = Result;
+ {error, enotsup} = Result;
_ ->
- ?line _ = Result
+ _ = Result
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-delete_a(suite) -> [];
-delete_a(doc) -> [];
delete_a(Config) when is_list(Config) ->
delete(Config, [], "_a").
-delete_b(suite) -> [];
-delete_b(doc) -> [];
delete_b(Config) when is_list(Config) ->
- ?line {ok, Handle} = ?PRIM_FILE:start(),
+ {ok, Handle} = ?PRIM_FILE:start(),
Result = delete(Config, Handle, "_b"),
- ?line ok = ?PRIM_FILE:stop(Handle),
+ ok = ?PRIM_FILE:stop(Handle),
Result.
delete(Config, Handle, Suffix) ->
- ?line RootDir = ?config(priv_dir,Config),
- ?line Name = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_delete"++Suffix++".fil"),
- ?line {ok, Fd1} = ?PRIM_FILE:open(Name, [write]),
- ?line ?PRIM_FILE:write(Fd1,"ok.\n"),
- ?line ok = ?PRIM_FILE:close(Fd1),
+ RootDir = proplists:get_value(priv_dir,Config),
+ Name = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_delete"++Suffix++".fil"),
+ {ok, Fd1} = ?PRIM_FILE:open(Name, [write]),
+ ?PRIM_FILE:write(Fd1,"ok.\n"),
+ ok = ?PRIM_FILE:close(Fd1),
%% Check that the file is readable
- ?line {ok, Fd2} = ?PRIM_FILE:open(Name, [read]),
- ?line ok = ?PRIM_FILE:close(Fd2),
- ?line ok = ?PRIM_FILE_call(delete, Handle, [Name]),
+ {ok, Fd2} = ?PRIM_FILE:open(Name, [read]),
+ ok = ?PRIM_FILE:close(Fd2),
+ ok = ?PRIM_FILE_call(delete, Handle, [Name]),
%% Check that the file is not readable anymore
- ?line {error, _} = ?PRIM_FILE:open(Name, [read]),
+ {error, _} = ?PRIM_FILE:open(Name, [read]),
%% Try deleting a nonexistent file
- ?line {error, enoent} = ?PRIM_FILE_call(delete, Handle, [Name]),
+ {error, enoent} = ?PRIM_FILE_call(delete, Handle, [Name]),
ok.
-rename_a(suite) ->[];
-rename_a(doc) ->[];
rename_a(Config) when is_list(Config) ->
rename(Config, [], "_a").
-rename_b(suite) ->[];
-rename_b(doc) ->[];
rename_b(Config) when is_list(Config) ->
- ?line {ok, Handle} = ?PRIM_FILE:start(),
+ {ok, Handle} = ?PRIM_FILE:start(),
Result = rename(Config, Handle, "_b"),
- ?line ok = ?PRIM_FILE:stop(Handle),
+ ok = ?PRIM_FILE:stop(Handle),
Result.
rename(Config, Handle, Suffix) ->
- ?line RootDir = ?config(priv_dir,Config),
- ?line FileName1 = atom_to_list(?MODULE)++"_rename"++Suffix++".fil",
- ?line FileName2 = atom_to_list(?MODULE)++"_rename"++Suffix++".ful",
- ?line Name1 = filename:join(RootDir, FileName1),
- ?line Name2 = filename:join(RootDir, FileName2),
- ?line {ok,Fd1} = ?PRIM_FILE:open(Name1, [write]),
- ?line ok = ?PRIM_FILE:close(Fd1),
+ RootDir = proplists:get_value(priv_dir,Config),
+ FileName1 = atom_to_list(?MODULE)++"_rename"++Suffix++".fil",
+ FileName2 = atom_to_list(?MODULE)++"_rename"++Suffix++".ful",
+ Name1 = filename:join(RootDir, FileName1),
+ Name2 = filename:join(RootDir, FileName2),
+ {ok,Fd1} = ?PRIM_FILE:open(Name1, [write]),
+ ok = ?PRIM_FILE:close(Fd1),
%% Rename, and check that it really changed name
- ?line ok = ?PRIM_FILE_call(rename, Handle, [Name1, Name2]),
- ?line {error, _} = ?PRIM_FILE:open(Name1, [read]),
- ?line {ok, Fd2} = ?PRIM_FILE:open(Name2, [read]),
- ?line ok = ?PRIM_FILE:close(Fd2),
+ ok = ?PRIM_FILE_call(rename, Handle, [Name1, Name2]),
+ {error, _} = ?PRIM_FILE:open(Name1, [read]),
+ {ok, Fd2} = ?PRIM_FILE:open(Name2, [read]),
+ ok = ?PRIM_FILE:close(Fd2),
%% Try renaming something to itself
- ?line ok = ?PRIM_FILE_call(rename, Handle, [Name2, Name2]),
+ ok = ?PRIM_FILE_call(rename, Handle, [Name2, Name2]),
%% Try renaming something that doesn't exist
- ?line {error, enoent} =
+ {error, enoent} =
?PRIM_FILE_call(rename, Handle, [Name1, Name2]),
%% Try renaming to something else than a string
- ?line {error, badarg} =
+ {error, badarg} =
?PRIM_FILE_call(rename, Handle, [Name1, foobar]),
-
+
%% Move between directories
- ?line DirName1 = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_rename_dir"++Suffix),
- ?line DirName2 = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_second_rename_dir"++Suffix),
- ?line Name1foo = filename:join(DirName1, "foo.fil"),
- ?line Name2foo = filename:join(DirName2, "foo.fil"),
- ?line Name2bar = filename:join(DirName2, "bar.dir"),
- ?line ok = ?PRIM_FILE:make_dir(DirName1),
+ DirName1 = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_rename_dir"++Suffix),
+ DirName2 = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_second_rename_dir"++Suffix),
+ Name1foo = filename:join(DirName1, "foo.fil"),
+ Name2foo = filename:join(DirName2, "foo.fil"),
+ Name2bar = filename:join(DirName2, "bar.dir"),
+ ok = ?PRIM_FILE:make_dir(DirName1),
%% The name has to include the full file name, path is not enough
- ?line expect(
- {error, eexist}, {error, eisdir},
- ?PRIM_FILE_call(rename, Handle, [Name2, DirName1])),
- ?line ok =
+ expect(
+ {error, eexist}, {error, eisdir},
+ ?PRIM_FILE_call(rename, Handle, [Name2, DirName1])),
+ ok =
?PRIM_FILE_call(rename, Handle, [Name2, Name1foo]),
%% Now rename the directory
- ?line ok = ?PRIM_FILE_call(rename, Handle, [DirName1, DirName2]),
+ ok = ?PRIM_FILE_call(rename, Handle, [DirName1, DirName2]),
%% And check that the file is there now
- ?line {ok,Fd3} = ?PRIM_FILE:open(Name2foo, [read]),
- ?line ok = ?PRIM_FILE:close(Fd3),
+ {ok,Fd3} = ?PRIM_FILE:open(Name2foo, [read]),
+ ok = ?PRIM_FILE:close(Fd3),
%% Try some dirty things now: move the directory into itself
- ?line {error, Msg1} =
+ {error, Msg1} =
?PRIM_FILE_call(rename, Handle, [DirName2, Name2bar]),
- ?line io:format("Errmsg1: ~p",[Msg1]),
+ io:format("Errmsg1: ~p",[Msg1]),
%% move dir into a file in itself
- ?line {error, Msg2} =
+ {error, Msg2} =
?PRIM_FILE_call(rename, Handle, [DirName2, Name2foo]),
- ?line io:format("Errmsg2: ~p",[Msg2]),
+ io:format("Errmsg2: ~p",[Msg2]),
ok.
@@ -1506,45 +1420,41 @@ rename(Config, Handle, Suffix) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-e_delete(suite) -> [];
-e_delete(doc) -> [];
e_delete(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line Base = filename:join(RootDir,
- atom_to_list(?MODULE)++"_e_delete"),
- ?line ok = ?PRIM_FILE:make_dir(Base),
+ RootDir = proplists:get_value(priv_dir, Config),
+ Base = filename:join(RootDir,
+ atom_to_list(?MODULE)++"_e_delete"),
+ ok = ?PRIM_FILE:make_dir(Base),
%% Delete a non-existing file.
- ?line {error, enoent} =
+ {error, enoent} =
?PRIM_FILE:delete(filename:join(Base, "non_existing")),
%% Delete a directory.
- ?line {error, eperm} = ?PRIM_FILE:delete(Base),
+ {error, eperm} = ?PRIM_FILE:delete(Base),
%% Use a path-name with a non-directory component.
- ?line Afile = filename:join(Base, "a_file"),
- ?line ok = ?PRIM_FILE:write_file(Afile, "hello\n"),
- ?line {error, E} =
+ Afile = filename:join(Base, "a_file"),
+ ok = ?PRIM_FILE:write_file(Afile, "hello\n"),
+ {error, E} =
expect(
{error, enotdir}, {error, enoent},
?PRIM_FILE:delete(filename:join(Afile, "another_file"))),
- ?line io:format("Result: ~p~n", [E]),
+ io:format("Result: ~p~n", [E]),
%% No permission.
- ?line case os:type() of
- {win32, _} ->
- %% Remove a character device.
- ?line {error, eacces} = ?PRIM_FILE:delete("nul");
- _ ->
- ?line ?PRIM_FILE:write_file_info(
- Base, #file_info {mode=0}),
- ?line {error, eacces} = ?PRIM_FILE:delete(Afile),
- ?line ?PRIM_FILE:write_file_info(
- Base, #file_info {mode=8#600})
- end,
-
- ?line test_server:timetrap_cancel(Dog),
+ case os:type() of
+ {win32, _} ->
+ %% Remove a character device.
+ {error, eacces} = ?PRIM_FILE:delete("nul");
+ _ ->
+ ?PRIM_FILE:write_file_info(
+ Base, #file_info {mode=0}),
+ {error, eacces} = ?PRIM_FILE:delete(Afile),
+ ?PRIM_FILE:write_file_info(
+ Base, #file_info {mode=8#600})
+ end,
+
ok.
%%% FreeBSD gives EEXIST when renaming a file to an empty dir, although the
@@ -1552,66 +1462,63 @@ e_delete(Config) when is_list(Config) ->
%%% (What about FreeBSD? We store our nightly build results on a FreeBSD
%%% file system, that's what.)
-e_rename(suite) -> [];
-e_rename(doc) -> [];
e_rename(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line Base = filename:join(RootDir,
- atom_to_list(?MODULE)++"_e_rename"),
- ?line ok = ?PRIM_FILE:make_dir(Base),
+ RootDir = proplists:get_value(priv_dir, Config),
+ Base = filename:join(RootDir,
+ atom_to_list(?MODULE)++"_e_rename"),
+ ok = ?PRIM_FILE:make_dir(Base),
%% Create an empty directory.
- ?line EmptyDir = filename:join(Base, "empty_dir"),
- ?line ok = ?PRIM_FILE:make_dir(EmptyDir),
+ EmptyDir = filename:join(Base, "empty_dir"),
+ ok = ?PRIM_FILE:make_dir(EmptyDir),
%% Create a non-empty directory.
- ?line NonEmptyDir = filename:join(Base, "non_empty_dir"),
- ?line ok = ?PRIM_FILE:make_dir(NonEmptyDir),
- ?line ok = ?PRIM_FILE:write_file(
- filename:join(NonEmptyDir, "a_file"),
- "hello\n"),
+ NonEmptyDir = filename:join(Base, "non_empty_dir"),
+ ok = ?PRIM_FILE:make_dir(NonEmptyDir),
+ ok = ?PRIM_FILE:write_file(
+ filename:join(NonEmptyDir, "a_file"),
+ "hello\n"),
%% Create another non-empty directory.
- ?line ADirectory = filename:join(Base, "a_directory"),
- ?line ok = ?PRIM_FILE:make_dir(ADirectory),
- ?line ok = ?PRIM_FILE:write_file(
- filename:join(ADirectory, "a_file"),
- "howdy\n\n"),
+ ADirectory = filename:join(Base, "a_directory"),
+ ok = ?PRIM_FILE:make_dir(ADirectory),
+ ok = ?PRIM_FILE:write_file(
+ filename:join(ADirectory, "a_file"),
+ "howdy\n\n"),
%% Create a data file.
- ?line File = filename:join(Base, "just_a_file"),
- ?line ok = ?PRIM_FILE:write_file(File, "anything goes\n\n"),
+ File = filename:join(Base, "just_a_file"),
+ ok = ?PRIM_FILE:write_file(File, "anything goes\n\n"),
%% Move an existing directory to a non-empty directory.
- ?line {error, eexist} =
- ?PRIM_FILE:rename(ADirectory, NonEmptyDir),
+ {error, eexist} =
+ ?PRIM_FILE:rename(ADirectory, NonEmptyDir),
%% Move a root directory.
- ?line {error, einval} = ?PRIM_FILE:rename("/", "arne"),
+ {error, einval} = ?PRIM_FILE:rename("/", "arne"),
%% Move Base into Base/new_name.
- ?line {error, einval} =
- ?PRIM_FILE:rename(Base, filename:join(Base, "new_name")),
+ {error, einval} =
+ ?PRIM_FILE:rename(Base, filename:join(Base, "new_name")),
%% Overwrite a directory with a file.
- ?line expect({error, eexist}, % FreeBSD (?)
- {error, eisdir},
- ?PRIM_FILE:rename(File, EmptyDir)),
- ?line expect({error, eexist}, % FreeBSD (?)
- {error, eisdir},
- ?PRIM_FILE:rename(File, NonEmptyDir)),
+ expect({error, eexist}, % FreeBSD (?)
+ {error, eisdir},
+ ?PRIM_FILE:rename(File, EmptyDir)),
+ expect({error, eexist}, % FreeBSD (?)
+ {error, eisdir},
+ ?PRIM_FILE:rename(File, NonEmptyDir)),
%% Move a non-existing file.
- ?line NonExistingFile = filename:join(
- Base, "non_existing_file"),
- ?line {error, enoent} =
- ?PRIM_FILE:rename(NonExistingFile, NonEmptyDir),
+ NonExistingFile = filename:join(
+ Base, "non_existing_file"),
+ {error, enoent} =
+ ?PRIM_FILE:rename(NonExistingFile, NonEmptyDir),
%% Overwrite a file with a directory.
- ?line expect({error, eexist}, % FreeBSD (?)
- {error, enotdir},
- ?PRIM_FILE:rename(ADirectory, File)),
+ expect({error, eexist}, % FreeBSD (?)
+ {error, enotdir},
+ ?PRIM_FILE:rename(ADirectory, File)),
%% Move a file to another filesystem.
%% XXX - This test case is bogus. We cannot be guaranteed that
@@ -1619,163 +1526,149 @@ e_rename(Config) when is_list(Config) ->
%% different filesystems.
%%
%% XXX - Gross hack!
- ?line Comment =
- case os:type() of
- {win32, _} ->
- %% At least Windows NT can
- %% successfully move a file to
- %% another drive.
- ok;
- _ ->
- OtherFs = "/tmp",
- ?line NameOnOtherFs =
- filename:join(OtherFs,
- filename:basename(File)),
- ?line {ok, Com} =
- case ?PRIM_FILE:rename(
- File, NameOnOtherFs) of
- {error, exdev} ->
- %% The file could be in
- %% the same filesystem!
- {ok, ok};
- ok ->
- {ok, {comment,
- "Moving between filesystems "
- "suceeded, files are probably "
- "in the same filesystem!"}};
- {error, eperm} ->
- {ok, {comment, "SBS! You don't "
- "have the permission to do "
- "this test!"}};
- Else ->
- Else
- end,
- Com
- end,
- ?line test_server:timetrap_cancel(Dog),
+ Comment =
+ case os:type() of
+ {win32, _} ->
+ %% At least Windows NT can
+ %% successfully move a file to
+ %% another drive.
+ ok;
+ _ ->
+ OtherFs = "/tmp",
+ NameOnOtherFs =
+ filename:join(OtherFs,
+ filename:basename(File)),
+ {ok, Com} =
+ case ?PRIM_FILE:rename(
+ File, NameOnOtherFs) of
+ {error, exdev} ->
+ %% The file could be in
+ %% the same filesystem!
+ {ok, ok};
+ ok ->
+ {ok, {comment,
+ "Moving between filesystems "
+ "suceeded, files are probably "
+ "in the same filesystem!"}};
+ {error, eperm} ->
+ {ok, {comment, "SBS! You don't "
+ "have the permission to do "
+ "this test!"}};
+ Else ->
+ Else
+ end,
+ Com
+ end,
Comment.
-e_make_dir(suite) -> [];
-e_make_dir(doc) -> [];
e_make_dir(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line Base = filename:join(RootDir,
- atom_to_list(?MODULE)++"_e_make_dir"),
- ?line ok = ?PRIM_FILE:make_dir(Base),
+ RootDir = proplists:get_value(priv_dir, Config),
+ Base = filename:join(RootDir,
+ atom_to_list(?MODULE)++"_e_make_dir"),
+ ok = ?PRIM_FILE:make_dir(Base),
%% A component of the path does not exist.
- ?line {error, enoent} =
+ {error, enoent} =
?PRIM_FILE:make_dir(filename:join([Base, "a", "b"])),
%% Use a path-name with a non-directory component.
- ?line Afile = filename:join(Base, "a_directory"),
- ?line ok = ?PRIM_FILE:write_file(Afile, "hello\n"),
- ?line case ?PRIM_FILE:make_dir(
- filename:join(Afile, "another_directory")) of
- {error, enotdir} -> io:format("Result: enotdir");
- {error, enoent} -> io:format("Result: enoent")
- end,
+ Afile = filename:join(Base, "a_directory"),
+ ok = ?PRIM_FILE:write_file(Afile, "hello\n"),
+ case ?PRIM_FILE:make_dir(
+ filename:join(Afile, "another_directory")) of
+ {error, enotdir} -> io:format("Result: enotdir");
+ {error, enoent} -> io:format("Result: enoent")
+ end,
%% No permission (on Unix only).
case os:type() of
{win32, _} ->
ok;
_ ->
- ?line ?PRIM_FILE:write_file_info(Base, #file_info {mode=0}),
- ?line {error, eacces} =
+ ?PRIM_FILE:write_file_info(Base, #file_info {mode=0}),
+ {error, eacces} =
?PRIM_FILE:make_dir(filename:join(Base, "xxxx")),
- ?line
- ?PRIM_FILE:write_file_info(Base, #file_info {mode=8#600})
+ ?PRIM_FILE:write_file_info(Base, #file_info {mode=8#600})
end,
- ?line test_server:timetrap_cancel(Dog),
ok.
-e_del_dir(suite) -> [];
-e_del_dir(doc) -> [];
e_del_dir(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line Base = filename:join(RootDir,
- atom_to_list(?MODULE)++"_e_del_dir"),
- ?line io:format("Base: ~p", [Base]),
- ?line ok = ?PRIM_FILE:make_dir(Base),
+ RootDir = proplists:get_value(priv_dir, Config),
+ Base = filename:join(RootDir,
+ atom_to_list(?MODULE)++"_e_del_dir"),
+ io:format("Base: ~p", [Base]),
+ ok = ?PRIM_FILE:make_dir(Base),
%% Delete a non-existent directory.
- ?line {error, enoent} =
+ {error, enoent} =
?PRIM_FILE:del_dir(filename:join(Base, "non_existing")),
%% Use a path-name with a non-directory component.
- ?line Afile = filename:join(Base, "a_directory"),
- ?line ok = ?PRIM_FILE:write_file(Afile, "hello\n"),
- ?line {error, E1} =
+ Afile = filename:join(Base, "a_directory"),
+ ok = ?PRIM_FILE:write_file(Afile, "hello\n"),
+ {error, E1} =
expect({error, enotdir}, {error, enoent},
?PRIM_FILE:del_dir(
filename:join(Afile, "another_directory"))),
- ?line io:format("Result: ~p", [E1]),
+ io:format("Result: ~p", [E1]),
%% Delete a non-empty directory.
%% Delete a non-empty directory.
- ?line {error, E2} =
+ {error, E2} =
expect({error, enotempty}, {error, eexist}, {error, eacces},
?PRIM_FILE:del_dir(Base)),
- ?line io:format("Result: ~p", [E2]),
+ io:format("Result: ~p", [E2]),
%% Remove the current directory.
- ?line {error, E3} =
+ {error, E3} =
expect({error, einval},
{error, eperm}, % Linux and DUX
{error, eacces},
{error, ebusy},
?PRIM_FILE:del_dir(".")),
- ?line io:format("Result: ~p", [E3]),
+ io:format("Result: ~p", [E3]),
%% No permission.
case os:type() of
{win32, _} ->
ok;
_ ->
- ?line ADirectory = filename:join(Base, "no_perm"),
- ?line ok = ?PRIM_FILE:make_dir(ADirectory),
- ?line ?PRIM_FILE:write_file_info(Base, #file_info {mode=0}),
- ?line {error, eacces} = ?PRIM_FILE:del_dir(ADirectory),
- ?line ?PRIM_FILE:write_file_info(
- Base, #file_info {mode=8#600})
+ ADirectory = filename:join(Base, "no_perm"),
+ ok = ?PRIM_FILE:make_dir(ADirectory),
+ ?PRIM_FILE:write_file_info(Base, #file_info {mode=0}),
+ {error, eacces} = ?PRIM_FILE:del_dir(ADirectory),
+ ?PRIM_FILE:write_file_info(
+ Base, #file_info {mode=8#600})
end,
- ?line test_server:timetrap_cancel(Dog),
ok.
%% Trying reading and positioning from a compressed file.
-read_compressed(suite) -> [];
-read_compressed(doc) -> [];
read_compressed(Config) when is_list(Config) ->
- ?line Data = ?config(data_dir, Config),
- ?line Real = filename:join(Data, "realmen.html.gz"),
- ?line {ok, Fd} = ?PRIM_FILE:open(Real, [read, compressed]),
- ?line try_read_file(Fd).
+ Data = proplists:get_value(data_dir, Config),
+ Real = filename:join(Data, "realmen.html.gz"),
+ {ok, Fd} = ?PRIM_FILE:open(Real, [read, compressed]),
+ try_read_file(Fd).
%% Trying reading and positioning from an uncompressed file,
%% but with the compressed flag given.
-read_not_really_compressed(suite) -> [];
-read_not_really_compressed(doc) -> [];
read_not_really_compressed(Config) when is_list(Config) ->
- ?line Data = ?config(data_dir, Config),
- ?line Priv = ?config(priv_dir, Config),
+ Data = proplists:get_value(data_dir, Config),
+ Priv = proplists:get_value(priv_dir, Config),
%% The file realmen.html might have got CRs added (by WinZip).
%% Remove them, or the file positions will not be correct.
- ?line Real = filename:join(Data, "realmen.html"),
- ?line RealPriv = filename:join(Priv,
- atom_to_list(?MODULE)++"_realmen.html"),
- ?line {ok, RealDataBin} = ?PRIM_FILE:read_file(Real),
- ?line RealData = remove_crs(binary_to_list(RealDataBin), []),
- ?line ok = ?PRIM_FILE:write_file(RealPriv, RealData),
- ?line {ok, Fd} = ?PRIM_FILE:open(RealPriv, [read, compressed]),
- ?line try_read_file(Fd).
+ Real = filename:join(Data, "realmen.html"),
+ RealPriv = filename:join(Priv,
+ atom_to_list(?MODULE)++"_realmen.html"),
+ {ok, RealDataBin} = ?PRIM_FILE:read_file(Real),
+ RealData = remove_crs(binary_to_list(RealDataBin), []),
+ ok = ?PRIM_FILE:write_file(RealPriv, RealData),
+ {ok, Fd} = ?PRIM_FILE:open(RealPriv, [read, compressed]),
+ try_read_file(Fd).
remove_crs([$\r|Rest], Result) ->
remove_crs(Rest, Result);
@@ -1785,72 +1678,66 @@ remove_crs([], Result) ->
lists:reverse(Result).
try_read_file(Fd) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
-
%% Seek to the current position (nothing should happen).
- ?line {ok, 0} = ?PRIM_FILE:position(Fd, 0),
- ?line {ok, 0} = ?PRIM_FILE:position(Fd, {cur, 0}),
+ {ok, 0} = ?PRIM_FILE:position(Fd, 0),
+ {ok, 0} = ?PRIM_FILE:position(Fd, {cur, 0}),
%% Read a few lines from a compressed file.
- ?line ShouldBe = "<TITLE>Real Programmers Don't Use PASCAL</TITLE>\n",
- ?line {ok, ShouldBe} = ?PRIM_FILE:read(Fd, length(ShouldBe)),
+ ShouldBe = "<TITLE>Real Programmers Don't Use PASCAL</TITLE>\n",
+ {ok, ShouldBe} = ?PRIM_FILE:read(Fd, length(ShouldBe)),
%% Now seek forward.
- ?line {ok, 381} = ?PRIM_FILE:position(Fd, 381),
- ?line Back = "Back in the good old days -- the \"Golden Era\" " ++
+ {ok, 381} = ?PRIM_FILE:position(Fd, 381),
+ Back = "Back in the good old days -- the \"Golden Era\" " ++
"of computers, it was\n",
- ?line {ok, Back} = ?PRIM_FILE:read(Fd, length(Back)),
+ {ok, Back} = ?PRIM_FILE:read(Fd, length(Back)),
%% Try to search forward relative to the current position.
- ?line {ok, CurPos} = ?PRIM_FILE:position(Fd, {cur, 0}),
- ?line RealPos = 4273,
- ?line {ok, RealPos} = ?PRIM_FILE:position(Fd, {cur, RealPos-CurPos}),
- ?line RealProg = "<LI> Real Programmers aren't afraid to use GOTOs.\n",
- ?line {ok, RealProg} = ?PRIM_FILE:read(Fd, length(RealProg)),
+ {ok, CurPos} = ?PRIM_FILE:position(Fd, {cur, 0}),
+ RealPos = 4273,
+ {ok, RealPos} = ?PRIM_FILE:position(Fd, {cur, RealPos-CurPos}),
+ RealProg = "<LI> Real Programmers aren't afraid to use GOTOs.\n",
+ {ok, RealProg} = ?PRIM_FILE:read(Fd, length(RealProg)),
%% Seek backward.
- ?line AfterTitle = length("<TITLE>"),
- ?line {ok, AfterTitle} = ?PRIM_FILE:position(Fd, AfterTitle),
- ?line Title = "Real Programmers Don't Use PASCAL</TITLE>\n",
- ?line {ok, Title} = ?PRIM_FILE:read(Fd, length(Title)),
+ AfterTitle = length("<TITLE>"),
+ {ok, AfterTitle} = ?PRIM_FILE:position(Fd, AfterTitle),
+ Title = "Real Programmers Don't Use PASCAL</TITLE>\n",
+ {ok, Title} = ?PRIM_FILE:read(Fd, length(Title)),
%% Done.
- ?line ?PRIM_FILE:close(Fd),
- ?line test_server:timetrap_cancel(Dog),
+ ?PRIM_FILE:close(Fd),
ok.
-write_compressed(suite) -> [];
-write_compressed(doc) -> [];
write_compressed(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line Priv = ?config(priv_dir, Config),
- ?line MyFile = filename:join(Priv,
- atom_to_list(?MODULE)++"_test.gz"),
+ Priv = proplists:get_value(priv_dir, Config),
+ MyFile = filename:join(Priv,
+ atom_to_list(?MODULE)++"_test.gz"),
%% Write a file.
- ?line {ok, Fd} = ?PRIM_FILE:open(MyFile, [write, compressed]),
- ?line {ok, 0} = ?PRIM_FILE:position(Fd, 0),
- ?line Prefix = "hello\n",
- ?line End = "end\n",
- ?line ok = ?PRIM_FILE:write(Fd, Prefix),
- ?line {ok, 143} = ?PRIM_FILE:position(Fd, 143),
- ?line ok = ?PRIM_FILE:write(Fd, End),
- ?line ok = ?PRIM_FILE:close(Fd),
+ {ok, Fd} = ?PRIM_FILE:open(MyFile, [write, compressed]),
+ {ok, 0} = ?PRIM_FILE:position(Fd, 0),
+ Prefix = "hello\n",
+ End = "end\n",
+ ok = ?PRIM_FILE:write(Fd, Prefix),
+ {ok, 143} = ?PRIM_FILE:position(Fd, 143),
+ ok = ?PRIM_FILE:write(Fd, End),
+ ok = ?PRIM_FILE:close(Fd),
%% Read the file and verify the contents.
- ?line {ok, Fd1} = ?PRIM_FILE:open(MyFile, [read, compressed]),
- ?line {ok, Prefix} = ?PRIM_FILE:read(Fd1, length(Prefix)),
- ?line Second = lists:duplicate(143-length(Prefix), 0) ++ End,
- ?line {ok, Second} = ?PRIM_FILE:read(Fd1, length(Second)),
- ?line ok = ?PRIM_FILE:close(Fd1),
+ {ok, Fd1} = ?PRIM_FILE:open(MyFile, [read, compressed]),
+ {ok, Prefix} = ?PRIM_FILE:read(Fd1, length(Prefix)),
+ Second = lists:duplicate(143-length(Prefix), 0) ++ End,
+ {ok, Second} = ?PRIM_FILE:read(Fd1, length(Second)),
+ ok = ?PRIM_FILE:close(Fd1),
%% Ensure that the file is compressed.
@@ -1859,71 +1746,61 @@ write_compressed(Config) when is_list(Config) ->
{ok, #file_info{size=Size}} when Size < TotalSize ->
ok;
{ok, #file_info{size=Size}} when Size == TotalSize ->
- test_server:fail(file_not_compressed)
+ ct:fail(file_not_compressed)
end,
%% Write again to ensure that the file is truncated.
- ?line {ok, Fd2} = ?PRIM_FILE:open(MyFile, [write, compressed]),
- ?line NewString = "aaaaaaaaaaa",
- ?line ok = ?PRIM_FILE:write(Fd2, NewString),
- ?line ok = ?PRIM_FILE:close(Fd2),
- ?line {ok, Fd3} = ?PRIM_FILE:open(MyFile, [read, compressed]),
- ?line {ok, NewString} = ?PRIM_FILE:read(Fd3, 1024),
- ?line ok = ?PRIM_FILE:close(Fd3),
+ {ok, Fd2} = ?PRIM_FILE:open(MyFile, [write, compressed]),
+ NewString = "aaaaaaaaaaa",
+ ok = ?PRIM_FILE:write(Fd2, NewString),
+ ok = ?PRIM_FILE:close(Fd2),
+ {ok, Fd3} = ?PRIM_FILE:open(MyFile, [read, compressed]),
+ {ok, NewString} = ?PRIM_FILE:read(Fd3, 1024),
+ ok = ?PRIM_FILE:close(Fd3),
- %% Done.
-
- ?line test_server:timetrap_cancel(Dog),
ok.
-compress_errors(suite) -> [];
-compress_errors(doc) -> [];
compress_errors(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line Data = ?config(data_dir, Config),
- ?line {error, enoent} = ?PRIM_FILE:open("non_existing__",
+ Data = proplists:get_value(data_dir, Config),
+ {error, enoent} = ?PRIM_FILE:open("non_existing__",
[compressed, read]),
- ?line {error, einval} = ?PRIM_FILE:open("non_existing__",
+ {error, einval} = ?PRIM_FILE:open("non_existing__",
[compressed, read, write]),
%% Read a corrupted .gz file.
- ?line Corrupted = filename:join(Data, "corrupted.gz"),
- ?line {ok, Fd} = ?PRIM_FILE:open(Corrupted, [read, compressed]),
- ?line {error, eio} = ?PRIM_FILE:read(Fd, 100),
- ?line ?PRIM_FILE:close(Fd),
+ Corrupted = filename:join(Data, "corrupted.gz"),
+ {ok, Fd} = ?PRIM_FILE:open(Corrupted, [read, compressed]),
+ {error, eio} = ?PRIM_FILE:read(Fd, 100),
+ ?PRIM_FILE:close(Fd),
- ?line test_server:timetrap_cancel(Dog),
ok.
-make_link_a(doc) -> "Test creating a hard link.";
-make_link_a(suite) -> [];
+%% Test creating a hard link.
make_link_a(Config) when is_list(Config) ->
make_link(Config, [], "_a").
-make_link_b(doc) -> "Test creating a hard link.";
-make_link_b(suite) -> [];
+%% Test creating a hard link.
make_link_b(Config) when is_list(Config) ->
- ?line {ok, Handle} = ?PRIM_FILE:start(),
+ {ok, Handle} = ?PRIM_FILE:start(),
Result = make_link(Config, Handle, "_b"),
- ?line ok = ?PRIM_FILE:stop(Handle),
+ ok = ?PRIM_FILE:stop(Handle),
Result.
make_link(Config, Handle, Suffix) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_make_link"++Suffix),
- ?line ok = ?PRIM_FILE_call(make_dir, Handle, [NewDir]),
-
- ?line Name = filename:join(NewDir, "a_file"),
- ?line ok = ?PRIM_FILE:write_file(Name, "some contents\n"),
-
- ?line Alias = filename:join(NewDir, "an_alias"),
- ?line Result =
+ RootDir = proplists:get_value(priv_dir, Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_make_link"++Suffix),
+ ok = ?PRIM_FILE_call(make_dir, Handle, [NewDir]),
+
+ Name = filename:join(NewDir, "a_file"),
+ ok = ?PRIM_FILE:write_file(Name, "some contents\n"),
+
+ Alias = filename:join(NewDir, "an_alias"),
+ Result =
case ?PRIM_FILE_call(make_link, Handle, [Name, Alias]) of
{error, enotsup} ->
{skipped, "Links not supported on this platform"};
@@ -1933,58 +1810,48 @@ make_link(Config, Handle, Suffix) ->
%% which should in behave exactly as
%% ?PRIM_FILE:read_file_info/1
%% since they are not used on symbolic links.
-
- ?line {ok, Info} =
+
+ {ok, Info} =
?PRIM_FILE_call(read_link_info, Handle, [Name]),
- ?line {ok, Info} =
+ {ok, Info} =
?PRIM_FILE_call(read_link_info, Handle, [Alias]),
- ?line #file_info{links = 2, type = regular} = Info,
- ?line {error, eexist} =
+ #file_info{links = 2, type = regular} = Info,
+ {error, eexist} =
?PRIM_FILE_call(make_link, Handle, [Name, Alias]),
ok
end,
-
- ?line test_server:timetrap_cancel(Dog),
+
Result.
-read_link_info_for_non_link(doc) ->
- "Test that reading link info for an ordinary file or directory works "
- "(on all platforms).";
-read_link_info_for_non_link(suite) -> [];
+%% Test that reading link info for an ordinary file or directory works
+%% (on all platforms).
read_link_info_for_non_link(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
-
- ?line {ok, #file_info{type=directory}} = ?PRIM_FILE:read_link_info("."),
-
- ?line test_server:timetrap_cancel(Dog),
+ {ok, #file_info{type=directory}} = ?PRIM_FILE:read_link_info("."),
ok.
-
-symlinks_a(doc) -> "Test operations on symbolic links (for Unix).";
-symlinks_a(suite) -> [];
+
+%% Test operations on symbolic links (for Unix).
symlinks_a(Config) when is_list(Config) ->
symlinks(Config, [], "_a").
-symlinks_b(doc) -> "Test operations on symbolic links (for Unix).";
-symlinks_b(suite) -> [];
+%% Test operations on symbolic links (for Unix).
symlinks_b(Config) when is_list(Config) ->
- ?line {ok, Handle} = ?PRIM_FILE:start(),
+ {ok, Handle} = ?PRIM_FILE:start(),
Result = symlinks(Config, Handle, "_b"),
- ?line ok = ?PRIM_FILE:stop(Handle),
+ ok = ?PRIM_FILE:stop(Handle),
Result.
symlinks(Config, Handle, Suffix) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)
- ++"_make_symlink"++Suffix),
- ?line ok = ?PRIM_FILE_call(make_dir, Handle, [NewDir]),
-
- ?line Name = filename:join(NewDir, "a_plain_file"),
- ?line ok = ?PRIM_FILE:write_file(Name, "some stupid content\n"),
-
- ?line Alias = filename:join(NewDir, "a_symlink_alias"),
- ?line Result =
+ RootDir = proplists:get_value(priv_dir, Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)
+ ++"_make_symlink"++Suffix),
+ ok = ?PRIM_FILE_call(make_dir, Handle, [NewDir]),
+
+ Name = filename:join(NewDir, "a_plain_file"),
+ ok = ?PRIM_FILE:write_file(Name, "some stupid content\n"),
+
+ Alias = filename:join(NewDir, "a_symlink_alias"),
+ Result =
case ?PRIM_FILE_call(make_symlink, Handle, [Name, Alias]) of
{error, enotsup} ->
{skipped, "Links not supported on this platform"};
@@ -1992,18 +1859,18 @@ symlinks(Config, Handle, Suffix) ->
{win32,_} = os:type(),
{skipped, "Windows user not privileged to create links"};
ok ->
- ?line {ok, Info1} =
+ {ok, Info1} =
?PRIM_FILE_call(read_file_info, Handle, [Name]),
- ?line {ok, Info1} =
+ {ok, Info1} =
?PRIM_FILE_call(read_file_info, Handle, [Alias]),
- ?line {ok, Info1} =
+ {ok, Info1} =
?PRIM_FILE_call(read_link_info, Handle, [Name]),
- ?line #file_info{links = 1, type = regular} = Info1,
-
- ?line {ok, Info2} =
+ #file_info{links = 1, type = regular} = Info1,
+
+ {ok, Info2} =
?PRIM_FILE_call(read_link_info, Handle, [Alias]),
- ?line #file_info{links=1, type=symlink} = Info2,
- ?line {ok, Name} =
+ #file_info{links=1, type=symlink} = Info2,
+ {ok, Name} =
?PRIM_FILE_call(read_link, Handle, [Alias]),
{ok, Name} =
?PRIM_FILE_call(read_link_all, Handle, [Alias]),
@@ -2011,45 +1878,39 @@ symlinks(Config, Handle, Suffix) ->
rm_rf(?PRIM_FILE,NewDir),
ok
end,
-
- ?line test_server:timetrap_cancel(Dog),
+
Result.
%% Creates as many files as possible during a certain time,
%% periodically calls list_dir/2 to check if it works,
%% then deletes all files.
-list_dir_limit(doc) ->
- "Tests if large directories can be read";
-list_dir_limit(suite) ->
- [];
+%% Tests if large directories can be read.
list_dir_limit(Config) when is_list(Config) ->
- ?line MaxTime = 120,
- ?line MaxNumber = 20000,
- ?line Dog = test_server:timetrap(
- test_server:seconds(2*MaxTime + MaxTime)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line NewDir = filename:join(RootDir,
- atom_to_list(?MODULE)++"_list_dir_limit"),
- ?line {ok, Handle1} = ?PRIM_FILE:start(),
- ?line ok = ?PRIM_FILE_call(make_dir, Handle1, [NewDir]),
+ MaxTime = 120,
+ MaxNumber = 20000,
+ ct:timetrap({seconds,2*MaxTime + MaxTime}),
+ RootDir = proplists:get_value(priv_dir, Config),
+ NewDir = filename:join(RootDir,
+ atom_to_list(?MODULE)++"_list_dir_limit"),
+ {ok, Handle1} = ?PRIM_FILE:start(),
+ ok = ?PRIM_FILE_call(make_dir, Handle1, [NewDir]),
Ref = erlang:start_timer(MaxTime*1000, self(), []),
- ?line Result = list_dir_limit_loop(NewDir, Handle1, Ref, MaxNumber, 0),
- ?line Time = case erlang:cancel_timer(Ref) of
- false -> MaxTime;
- T -> MaxTime - (T div 1000)
- end,
- ?line Number = case Result of
- {ok, N} -> N;
- {error, _Reason, N} -> N;
- _ -> 0
- end,
- ?line {ok, Handle2} = ?PRIM_FILE:start(),
- ?line list_dir_limit_cleanup(NewDir, Handle2, Number, 0),
- ?line ok = ?PRIM_FILE:stop(Handle1),
- ?line ok = ?PRIM_FILE:stop(Handle2),
- ?line {ok, Number} = Result,
- ?line test_server:timetrap_cancel(Dog),
+ Result = list_dir_limit_loop(NewDir, Handle1, Ref, MaxNumber, 0),
+ Time = case erlang:cancel_timer(Ref) of
+ false -> MaxTime;
+ T -> MaxTime - (T div 1000)
+ end,
+ Number = case Result of
+ {ok, N} -> N;
+ {error, _Reason, N} -> N;
+ _ -> 0
+ end,
+ {ok, Handle2} = ?PRIM_FILE:start(),
+ list_dir_limit_cleanup(NewDir, Handle2, Number, 0),
+ ok = ?PRIM_FILE:stop(Handle1),
+ ok = ?PRIM_FILE:stop(Handle2),
+ {ok, Number} = Result,
{comment,
"Created " ++ integer_to_list(Number) ++ " files in "
++ integer_to_list(Time) ++ " seconds."}.
@@ -2118,7 +1979,7 @@ list_dir_limit_cleanup(Dir, Handle, N, Cnt) ->
%%%
list_dir_error(Config) ->
- Priv = ?config(priv_dir, Config),
+ Priv = proplists:get_value(priv_dir, Config),
NonExisting = filename:join(Priv, "non-existing-dir"),
{error,enoent} = prim_file:list_dir(NonExisting),
ok.
@@ -2128,7 +1989,7 @@ list_dir_error(Config) ->
%%%
list_dir(Config) ->
- RootDir = ?config(priv_dir, Config),
+ RootDir = proplists:get_value(priv_dir, Config),
TestDir = filename:join(RootDir, ?MODULE_STRING++"_list_dir"),
?PRIM_FILE:make_dir(TestDir),
list_dir_1(TestDir, 42, []).
@@ -2159,7 +2020,7 @@ run_large_file_test(Config, Run, Name) ->
{{unix,sunos},OsVersion} when OsVersion < {5,5,1} ->
{skip,"Only supported on Win32, Unix or SunOS >= 5.5.1"};
{{unix,_},_} ->
- N = unix_free(?config(priv_dir, Config)),
+ N = unix_free(proplists:get_value(priv_dir, Config)),
io:format("Free disk: ~w KByte~n", [N]),
if N < 5 bsl 20 ->
%% Less than 5 GByte free
@@ -2173,9 +2034,9 @@ run_large_file_test(Config, Run, Name) ->
do_run_large_file_test(Config, Run, Name0) ->
- Name = filename:join(?config(priv_dir, Config),
+ Name = filename:join(proplists:get_value(priv_dir, Config),
?MODULE_STRING ++ Name0),
-
+
%% Set up a process that will delete this file.
Tester = self(),
Deleter =
@@ -2188,7 +2049,7 @@ do_run_large_file_test(Config, Run, Name0) ->
end,
prim_file:delete(Name)
end),
-
+
%% Run the test case.
Res = Run(Name),
diff --git a/lib/kernel/test/ram_file_SUITE.erl b/lib/kernel/test/ram_file_SUITE.erl
index fdb61a3619..d90995923a 100644
--- a/lib/kernel/test/ram_file_SUITE.erl
+++ b/lib/kernel/test/ram_file_SUITE.erl
@@ -26,7 +26,8 @@
init_per_testcase/2, end_per_testcase/2]).
-export([open_modes/1, open_old_modes/1, pread_pwrite/1, position/1,
truncate/1, sync/1, get_set_file/1, compress/1, uuencode/1,
- large_file_errors/1, large_file_light/1, large_file_heavy/1]).
+ large_file_errors/1, large_file_light/1,
+ large_file_heavy/0, large_file_heavy/1]).
-include_lib("common_test/include/ct.hrl").
-include_lib("kernel/include/file.hrl").
@@ -36,7 +37,9 @@
%%--------------------------------------------------------------------------
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[open_modes, open_old_modes, pread_pwrite, position,
@@ -59,37 +62,23 @@ end_per_group(_GroupName, Config) ->
Config.
-init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
- Time =
- case Func of
- large_file_heavy ->
- ?t:minutes(5);
- _ ->
- ?t:seconds(10)
- end,
- Dog = ?t:timetrap(Time),
- %% error_logger:info_msg("~p:~p *****~n", [?MODULE, Func]),
- [{watchdog, Dog} | Config].
+init_per_testcase(Func, Config) ->
+ Config.
end_per_testcase(_Func, Config) ->
- %% error_logger:info_msg("~p:~p END *****~n", [?MODULE, Func]),
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog).
+ Config.
%%--------------------------------------------------------------------------
%% Test suites
-open_modes(suite) ->
- [];
-open_modes(doc) ->
- ["Test that the basic read, write and binary options works for open/2."];
+%% Test that the basic read, write and binary options works for open/2.
open_modes(Config) when is_list(Config) ->
- ?line Str1 = "The quick brown fox ",
- ?line Str2 = "jumps over a lazy dog ",
- ?line Str = Str1 ++ Str2,
- ?line Bin1 = list_to_binary(Str1),
- ?line Bin2 = list_to_binary(Str2),
- ?line Bin = list_to_binary(Str),
+ Str1 = "The quick brown fox ",
+ Str2 = "jumps over a lazy dog ",
+ Str = Str1 ++ Str2,
+ Bin1 = list_to_binary(Str1),
+ Bin2 = list_to_binary(Str2),
+ Bin = list_to_binary(Str),
%%
open_read_write(?FILE_MODULE, Str1, [ram, read, write], Str2),
open_read(?FILE_MODULE, Str, [ram]),
@@ -98,18 +87,15 @@ open_modes(Config) when is_list(Config) ->
%%
ok.
-open_old_modes(suite) ->
- [];
-open_old_modes(doc) ->
- ["Test that the old style read, write and binary options ",
- "works for open/2."];
+%% Test that the old style read, write and binary options
+%% works for open/2.
open_old_modes(Config) when is_list(Config) ->
- ?line Str1 = "The quick brown fox ",
- ?line Str2 = "jumps over a lazy dog ",
- ?line Str = Str1 ++ Str2,
- ?line Bin1 = list_to_binary(Str1),
- ?line Bin2 = list_to_binary(Str2),
- ?line Bin = list_to_binary(Str),
+ Str1 = "The quick brown fox ",
+ Str2 = "jumps over a lazy dog ",
+ Str = Str1 ++ Str2,
+ Bin1 = list_to_binary(Str1),
+ Bin2 = list_to_binary(Str2),
+ Bin = list_to_binary(Str),
%%
open_read_write(?RAM_FILE_MODULE, Str1, read_write, Str2),
open_read(?RAM_FILE_MODULE, Str, read),
@@ -119,57 +105,54 @@ open_old_modes(Config) when is_list(Config) ->
ok.
open_read_write(Module, Data1, Options, Data2) ->
- ?line io:format("~p:open_read_write(~p, ~p, ~p, ~p)~n",
- [?MODULE, Module, Data1, Options, Data2]),
- %%
- ?line Size1 = sizeof(Data1),
- ?line Size2 = sizeof(Data2),
- ?line Data = append(Data1, Data2),
- ?line Size = Size1 + Size2,
- %%
- ?line {ok, Fd} = Module:open(Data1, Options),
- ?line {ok, Data1} = Module:read(Fd, Size1),
- ?line eof = Module:read(Fd, 1),
- ?line {ok, Zero} = Module:read(Fd, 0),
- ?line 0 = sizeof(Zero),
- ?line ok = Module:write(Fd, Data2),
- ?line {ok, 0} = Module:position(Fd, bof),
- ?line {ok, Data} = Module:read(Fd, Size),
- ?line eof = Module:read(Fd, 1),
- ?line {ok, Zero} = Module:read(Fd, 0),
- ?line ok = Module:close(Fd),
- %%
- ?line ok.
+ io:format("~p:open_read_write(~p, ~p, ~p, ~p)~n",
+ [?MODULE, Module, Data1, Options, Data2]),
+ %%
+ Size1 = sizeof(Data1),
+ Size2 = sizeof(Data2),
+ Data = append(Data1, Data2),
+ Size = Size1 + Size2,
+ %%
+ {ok, Fd} = Module:open(Data1, Options),
+ {ok, Data1} = Module:read(Fd, Size1),
+ eof = Module:read(Fd, 1),
+ {ok, Zero} = Module:read(Fd, 0),
+ 0 = sizeof(Zero),
+ ok = Module:write(Fd, Data2),
+ {ok, 0} = Module:position(Fd, bof),
+ {ok, Data} = Module:read(Fd, Size),
+ eof = Module:read(Fd, 1),
+ {ok, Zero} = Module:read(Fd, 0),
+ ok = Module:close(Fd),
+ %%
+ ok.
open_read(Module, Data, Options) ->
- ?line io:format("~p:open_read(~p, ~p, ~p)~n",
- [?MODULE, Module, Data, Options]),
- %%
- ?line Size = sizeof(Data),
- %%
- ?line {ok, Fd} = Module:open(Data, Options),
- ?line {ok, Data} = Module:read(Fd, Size),
- ?line eof = Module:read(Fd, 1),
- ?line {ok, Zero} = Module:read(Fd, 0),
- ?line 0 = sizeof(Zero),
- ?line {error, ebadf} = Module:write(Fd, Data),
- ?line {ok, 0} = Module:position(Fd, bof),
- ?line {ok, Data} = Module:read(Fd, Size),
- ?line eof = Module:read(Fd, 1),
- ?line {ok, Zero} = Module:read(Fd, 0),
- ?line ok = Module:close(Fd),
+ io:format("~p:open_read(~p, ~p, ~p)~n",
+ [?MODULE, Module, Data, Options]),
+ %%
+ Size = sizeof(Data),
+ %%
+ {ok, Fd} = Module:open(Data, Options),
+ {ok, Data} = Module:read(Fd, Size),
+ eof = Module:read(Fd, 1),
+ {ok, Zero} = Module:read(Fd, 0),
+ 0 = sizeof(Zero),
+ {error, ebadf} = Module:write(Fd, Data),
+ {ok, 0} = Module:position(Fd, bof),
+ {ok, Data} = Module:read(Fd, Size),
+ eof = Module:read(Fd, 1),
+ {ok, Zero} = Module:read(Fd, 0),
+ ok = Module:close(Fd),
%%
- ?line ok.
+ ok.
-pread_pwrite(suite) ->
- [];
-pread_pwrite(doc) ->
- ["Test that pread/2,3 and pwrite/2,3 works."];
+%% Test that pread/2,3 and pwrite/2,3 works.
pread_pwrite(Config) when is_list(Config) ->
- ?line Str = "Flygande bäckaziner söka hwila på mjuqa tuvor x",
- ?line Bin = list_to_binary(Str),
+ Str = "Flygande bäckaziner söka hwila på mjuqa tuvor x",
+ Bin = list_to_binary(Str),
%%
pread_pwrite_test(?FILE_MODULE, Str, [ram, read, write]),
pread_pwrite_test(?FILE_MODULE, Bin, [ram, binary, read, write]),
@@ -179,36 +162,33 @@ pread_pwrite(Config) when is_list(Config) ->
ok.
pread_pwrite_test(Module, Data, Options) ->
- ?line io:format("~p:pread_pwrite_test(~p, ~p, ~p)~n",
- [?MODULE, Module, Data, Options]),
- %%
- ?line Size = sizeof(Data),
- %%
- ?line {ok, Fd} = Module:open([], Options),
- ?line ok = Module:pwrite(Fd, 0, Data),
- ?line {ok, Data} = Module:pread(Fd, 0, Size+1),
- ?line eof = Module:pread(Fd, Size+1, 1),
- ?line {ok, Zero} = Module:pread(Fd, Size+1, 0),
- ?line 0 = sizeof(Zero),
- ?line ok = Module:pwrite(Fd, [{0, Data}, {Size+17, Data}]),
- ?line {ok, [Data,
- eof,
- Data,
- Zero]} = Module:pread(Fd, [{Size+17, Size+1},
- {2*Size+17+1, 1},
- {0, Size},
- {2*Size+17+1, 0}]),
- ?line ok = Module:close(Fd),
- %%
- ?line ok.
-
-position(suite) ->
- [];
-position(doc) ->
- ["Test that position/2 works."];
+ io:format("~p:pread_pwrite_test(~p, ~p, ~p)~n",
+ [?MODULE, Module, Data, Options]),
+ %%
+ Size = sizeof(Data),
+ %%
+ {ok, Fd} = Module:open([], Options),
+ ok = Module:pwrite(Fd, 0, Data),
+ {ok, Data} = Module:pread(Fd, 0, Size+1),
+ eof = Module:pread(Fd, Size+1, 1),
+ {ok, Zero} = Module:pread(Fd, Size+1, 0),
+ 0 = sizeof(Zero),
+ ok = Module:pwrite(Fd, [{0, Data}, {Size+17, Data}]),
+ {ok, [Data,
+ eof,
+ Data,
+ Zero]} = Module:pread(Fd, [{Size+17, Size+1},
+ {2*Size+17+1, 1},
+ {0, Size},
+ {2*Size+17+1, 0}]),
+ ok = Module:close(Fd),
+ %%
+ ok.
+
+%% Test that position/2 works.
position(Config) when is_list(Config) ->
- ?line Str = "Att vara eller icke vara, det är frågan. ",
- ?line Bin = list_to_binary(Str),
+ Str = "Att vara eller icke vara, det är frågan. ",
+ Bin = list_to_binary(Str),
%%
position_test(?FILE_MODULE, Str, [ram, read]),
position_test(?FILE_MODULE, Bin, [ram, binary]),
@@ -218,79 +198,76 @@ position(Config) when is_list(Config) ->
ok.
position_test(Module, Data, Options) ->
- ?line io:format("~p:position_test(~p, ~p, ~p)~n",
- [?MODULE, Module, Data, Options]),
- %%
- ?line Size = sizeof(Data),
- ?line Size_7 = Size+7,
- %%
- ?line Slice_0_2 = slice(Data, 0, 2),
- ?line Slice_0_3 = slice(Data, 0, 3),
- ?line Slice_2_5 = slice(Data, 2, 5),
- ?line Slice_3_4 = slice(Data, 3, 4),
- ?line Slice_5 = slice(Data, 5, Size),
- %%
- ?line {ok, Fd} = Module:open(Data, Options),
- %%
- ?line io:format("CUR positions"),
- ?line {ok, Slice_0_2} = Module:read(Fd, 2),
- ?line {ok, 2} = Module:position(Fd, cur),
- ?line {ok, Slice_2_5} = Module:read(Fd, 5),
- ?line {ok, 3} = Module:position(Fd, {cur, -4}),
- ?line {ok, Slice_3_4} = Module:read(Fd, 4),
- ?line {ok, 0} = Module:position(Fd, {cur, -7}),
- ?line {ok, Slice_0_3} = Module:read(Fd, 3),
- ?line {ok, 0} = Module:position(Fd, {cur, -3}),
- ?line {error, einval} = Module:position(Fd, {cur, -1}),
- ?line {ok, 0} = Module:position(Fd, 0),
- ?line {ok, 2} = Module:position(Fd, {cur, 2}),
- ?line {ok, Slice_2_5} = Module:read(Fd, 5),
- ?line {ok, Size_7} = Module:position(Fd, {cur, Size}),
- ?line {ok, Zero} = Module:read(Fd, 0),
- ?line 0 = sizeof(Zero),
- ?line eof = Module:read(Fd, 1),
- %%
- ?line io:format("Absolute and BOF positions"),
- ?line {ok, Size} = Module:position(Fd, Size),
- ?line eof = Module:read(Fd, 1),
- ?line {ok, 5} = Module:position(Fd, 5),
- ?line {ok, Slice_5} = Module:read(Fd, Size),
- ?line {ok, 2} = Module:position(Fd, {bof, 2}),
- ?line {ok, Slice_2_5} = Module:read(Fd, 5),
- ?line {ok, 3} = Module:position(Fd, 3),
- ?line {ok, Slice_3_4} = Module:read(Fd, 4),
- ?line {ok, 0} = Module:position(Fd, bof),
- ?line {ok, Slice_0_2} = Module:read(Fd, 2),
- ?line {ok, Size_7} = Module:position(Fd, {bof, Size_7}),
- ?line {ok, Zero} = Module:read(Fd, 0),
- %%
- ?line io:format("EOF positions"),
- ?line {ok, Size} = Module:position(Fd, eof),
- ?line eof = Module:read(Fd, 1),
- ?line {ok, 5} = Module:position(Fd, {eof, -Size+5}),
- ?line {ok, Slice_5} = Module:read(Fd, Size),
- ?line {ok, 2} = Module:position(Fd, {eof, -Size+2}),
- ?line {ok, Slice_2_5} = Module:read(Fd, 5),
- ?line {ok, 3} = Module:position(Fd, {eof, -Size+3}),
- ?line {ok, Slice_3_4} = Module:read(Fd, 4),
- ?line {ok, 0} = Module:position(Fd, {eof, -Size}),
- ?line {ok, Slice_0_2} = Module:read(Fd, 2),
- ?line {ok, Size_7} = Module:position(Fd, {eof, 7}),
- ?line {ok, Zero} = Module:read(Fd, 0),
- ?line eof = Module:read(Fd, 1),
- %%
- ?line ok.
-
-
-
-truncate(suite) ->
- [];
-truncate(doc) ->
- ["Test that truncate/1 works."];
+ io:format("~p:position_test(~p, ~p, ~p)~n",
+ [?MODULE, Module, Data, Options]),
+ %%
+ Size = sizeof(Data),
+ Size_7 = Size+7,
+ %%
+ Slice_0_2 = slice(Data, 0, 2),
+ Slice_0_3 = slice(Data, 0, 3),
+ Slice_2_5 = slice(Data, 2, 5),
+ Slice_3_4 = slice(Data, 3, 4),
+ Slice_5 = slice(Data, 5, Size),
+ %%
+ {ok, Fd} = Module:open(Data, Options),
+ %%
+ io:format("CUR positions"),
+ {ok, Slice_0_2} = Module:read(Fd, 2),
+ {ok, 2} = Module:position(Fd, cur),
+ {ok, Slice_2_5} = Module:read(Fd, 5),
+ {ok, 3} = Module:position(Fd, {cur, -4}),
+ {ok, Slice_3_4} = Module:read(Fd, 4),
+ {ok, 0} = Module:position(Fd, {cur, -7}),
+ {ok, Slice_0_3} = Module:read(Fd, 3),
+ {ok, 0} = Module:position(Fd, {cur, -3}),
+ {error, einval} = Module:position(Fd, {cur, -1}),
+ {ok, 0} = Module:position(Fd, 0),
+ {ok, 2} = Module:position(Fd, {cur, 2}),
+ {ok, Slice_2_5} = Module:read(Fd, 5),
+ {ok, Size_7} = Module:position(Fd, {cur, Size}),
+ {ok, Zero} = Module:read(Fd, 0),
+ 0 = sizeof(Zero),
+ eof = Module:read(Fd, 1),
+ %%
+ io:format("Absolute and BOF positions"),
+ {ok, Size} = Module:position(Fd, Size),
+ eof = Module:read(Fd, 1),
+ {ok, 5} = Module:position(Fd, 5),
+ {ok, Slice_5} = Module:read(Fd, Size),
+ {ok, 2} = Module:position(Fd, {bof, 2}),
+ {ok, Slice_2_5} = Module:read(Fd, 5),
+ {ok, 3} = Module:position(Fd, 3),
+ {ok, Slice_3_4} = Module:read(Fd, 4),
+ {ok, 0} = Module:position(Fd, bof),
+ {ok, Slice_0_2} = Module:read(Fd, 2),
+ {ok, Size_7} = Module:position(Fd, {bof, Size_7}),
+ {ok, Zero} = Module:read(Fd, 0),
+ %%
+ io:format("EOF positions"),
+ {ok, Size} = Module:position(Fd, eof),
+ eof = Module:read(Fd, 1),
+ {ok, 5} = Module:position(Fd, {eof, -Size+5}),
+ {ok, Slice_5} = Module:read(Fd, Size),
+ {ok, 2} = Module:position(Fd, {eof, -Size+2}),
+ {ok, Slice_2_5} = Module:read(Fd, 5),
+ {ok, 3} = Module:position(Fd, {eof, -Size+3}),
+ {ok, Slice_3_4} = Module:read(Fd, 4),
+ {ok, 0} = Module:position(Fd, {eof, -Size}),
+ {ok, Slice_0_2} = Module:read(Fd, 2),
+ {ok, Size_7} = Module:position(Fd, {eof, 7}),
+ {ok, Zero} = Module:read(Fd, 0),
+ eof = Module:read(Fd, 1),
+ %%
+ ok.
+
+
+
+%% Test that truncate/1 works.
truncate(Config) when is_list(Config) ->
- ?line Str = "Mån ädlare att lida och fördraga "
+ Str = "Mån ädlare att lida och fördraga "
++ "ett bittert ödes stygn av pilar, ",
- ?line Bin = list_to_binary(Str),
+ Bin = list_to_binary(Str),
%%
ok = truncate_test(?FILE_MODULE, Str, [ram, read, write]),
ok = truncate_test(?FILE_MODULE, Bin, [ram, binary, read, write]),
@@ -305,35 +282,32 @@ truncate(Config) when is_list(Config) ->
ok.
truncate_test(Module, Data, Options) ->
- ?line io:format("~p:truncate_test(~p, ~p, ~p)~n",
- [?MODULE, Module, Data, Options]),
- %%
- ?line Size = sizeof(Data),
- ?line Size1 = Size-2,
- ?line Data1 = slice(Data, 0, Size1),
- %%
- ?line {ok, Fd} = Module:open(Data, Options),
- ?line {ok, Size1} = Module:position(Fd, Size1),
- ?line case Module:truncate(Fd) of
- ok ->
- ?line {ok, 0} = Module:position(Fd, 0),
- ?line {ok, Data1} = Module:read(Fd, Size),
- ?line ok = Module:close(Fd),
- ?line ok;
- Error ->
- ?line ok = Module:close(Fd),
- ?line Error
- end.
-
-
-
-sync(suite) ->
- [];
-sync(doc) ->
- ["Test that sync/1 at least does not crash."];
+ io:format("~p:truncate_test(~p, ~p, ~p)~n",
+ [?MODULE, Module, Data, Options]),
+ %%
+ Size = sizeof(Data),
+ Size1 = Size-2,
+ Data1 = slice(Data, 0, Size1),
+ %%
+ {ok, Fd} = Module:open(Data, Options),
+ {ok, Size1} = Module:position(Fd, Size1),
+ case Module:truncate(Fd) of
+ ok ->
+ {ok, 0} = Module:position(Fd, 0),
+ {ok, Data1} = Module:read(Fd, Size),
+ ok = Module:close(Fd),
+ ok;
+ Error ->
+ ok = Module:close(Fd),
+ Error
+ end.
+
+
+
+%% Test that sync/1 at least does not crash.
sync(Config) when is_list(Config) ->
- ?line Str = "än att ta till vapen mot ett hav av kval. ",
- ?line Bin = list_to_binary(Str),
+ Str = "än att ta till vapen mot ett hav av kval. ",
+ Bin = list_to_binary(Str),
%%
sync_test(?FILE_MODULE, Str, [ram, read, write]),
sync_test(?FILE_MODULE, Bin, [ram, binary, read, write]),
@@ -348,28 +322,25 @@ sync(Config) when is_list(Config) ->
ok.
sync_test(Module, Data, Options) ->
- ?line io:format("~p:sync_test(~p, ~p, ~p)~n",
- [?MODULE, Module, Data, Options]),
+ io:format("~p:sync_test(~p, ~p, ~p)~n",
+ [?MODULE, Module, Data, Options]),
%%
- ?line Size = sizeof(Data),
+ Size = sizeof(Data),
%%
- ?line {ok, Fd} = Module:open(Data, Options),
- ?line ok = Module:sync(Fd),
- ?line {ok, Data} = Module:read(Fd, Size+1),
- ?line ok.
+ {ok, Fd} = Module:open(Data, Options),
+ ok = Module:sync(Fd),
+ {ok, Data} = Module:read(Fd, Size+1),
+ ok.
-get_set_file(suite) ->
- [];
-get_set_file(doc) ->
- ["Tests get_file/1, set_file/2, get_file_close/1 and get_size/1."];
+%% Tests get_file/1, set_file/2, get_file_close/1 and get_size/1.
get_set_file(Config) when is_list(Config) ->
%% These two strings should not be of equal length.
- ?line Str = "När högan nord blir snöbetäckt, ",
- ?line Str2 = "får alla harar byta dräkt. ",
- ?line Bin = list_to_binary(Str),
- ?line Bin2 = list_to_binary(Str2),
+ Str = "När högan nord blir snöbetäckt, ",
+ Str2 = "får alla harar byta dräkt. ",
+ Bin = list_to_binary(Str),
+ Bin2 = list_to_binary(Str2),
%%
ok = get_set_file_test(Str, read_write, Str2),
ok = get_set_file_test(Bin, [binary, read, write], Bin2),
@@ -379,87 +350,84 @@ get_set_file(Config) when is_list(Config) ->
ok.
get_set_file_test(Data, Options, Data2) ->
- ?line io:format("~p:get_set_file_test(~p, ~p, ~p)~n",
- [?MODULE, Data, Options, Data2]),
- %%
- ?line Size = sizeof(Data),
- ?line Size2 = sizeof(Data2),
- %%
- ?line {ok, Fd} = ?RAM_FILE_MODULE:open(Data, Options),
- ?line {ok, Size} = ?RAM_FILE_MODULE:get_size(Fd),
- ?line {ok, Data} = ?RAM_FILE_MODULE:get_file(Fd),
- ?line {ok, Data} = ?RAM_FILE_MODULE:get_file_close(Fd),
- ?line {error, einval} = ?RAM_FILE_MODULE:get_size(Fd),
- ?line {ok, Fd2} = ?RAM_FILE_MODULE:open(Data, Options),
- ?line case ?RAM_FILE_MODULE:set_file(Fd2, Data2) of
- {ok, Size2} ->
- ?line {ok, Size2} = ?RAM_FILE_MODULE:get_size(Fd2),
- ?line {ok, Data2} = ?RAM_FILE_MODULE:get_file(Fd2),
- ?line {ok, Data2} = ?RAM_FILE_MODULE:get_file_close(Fd2),
- ?line ok;
- {error, _} = Error ->
- ?line {ok, Data} = ?RAM_FILE_MODULE:get_file_close(Fd2),
- ?line Error
- end.
-
-
-
-compress(suite) ->
- [];
-compress(doc) ->
- ["Test that compress/1 and uncompress/1 works."];
+ io:format("~p:get_set_file_test(~p, ~p, ~p)~n",
+ [?MODULE, Data, Options, Data2]),
+ %%
+ Size = sizeof(Data),
+ Size2 = sizeof(Data2),
+ %%
+ {ok, Fd} = ?RAM_FILE_MODULE:open(Data, Options),
+ {ok, Size} = ?RAM_FILE_MODULE:get_size(Fd),
+ {ok, Data} = ?RAM_FILE_MODULE:get_file(Fd),
+ {ok, Data} = ?RAM_FILE_MODULE:get_file_close(Fd),
+ {error, einval} = ?RAM_FILE_MODULE:get_size(Fd),
+ {ok, Fd2} = ?RAM_FILE_MODULE:open(Data, Options),
+ case ?RAM_FILE_MODULE:set_file(Fd2, Data2) of
+ {ok, Size2} ->
+ {ok, Size2} = ?RAM_FILE_MODULE:get_size(Fd2),
+ {ok, Data2} = ?RAM_FILE_MODULE:get_file(Fd2),
+ {ok, Data2} = ?RAM_FILE_MODULE:get_file_close(Fd2),
+ ok;
+ {error, _} = Error ->
+ {ok, Data} = ?RAM_FILE_MODULE:get_file_close(Fd2),
+ Error
+ end.
+
+
+
+%% Test that compress/1 and uncompress/1 works.
compress(Config) when is_list(Config) ->
- ?line Data = ?config(data_dir, Config),
- ?line Real = filename:join(Data, "realmen.html"),
- ?line RealGz = filename:join(Data, "realmen.html.gz"),
+ Data = proplists:get_value(data_dir, Config),
+ Real = filename:join(Data, "realmen.html"),
+ RealGz = filename:join(Data, "realmen.html.gz"),
%%
%% Uncompress test
%%
- ?line {ok, FdReal} = ?FILE_MODULE:open(Real, []),
- ?line {ok, Fd} = ?FILE_MODULE:open([], [ram, read, write]),
- ?line {ok, FdRealGz} = ?FILE_MODULE:open(RealGz, []),
+ {ok, FdReal} = ?FILE_MODULE:open(Real, []),
+ {ok, Fd} = ?FILE_MODULE:open([], [ram, read, write]),
+ {ok, FdRealGz} = ?FILE_MODULE:open(RealGz, []),
%%
- ?line {ok, SzGz} = ?FILE_MODULE:copy(FdRealGz, Fd),
- ?line {ok, Sz} = ?RAM_FILE_MODULE:uncompress(Fd),
- ?line {ok, 0} = ?FILE_MODULE:position(Fd, bof),
- ?line true = compare(FdReal, Fd),
+ {ok, SzGz} = ?FILE_MODULE:copy(FdRealGz, Fd),
+ {ok, Sz} = ?RAM_FILE_MODULE:uncompress(Fd),
+ {ok, 0} = ?FILE_MODULE:position(Fd, bof),
+ true = compare(FdReal, Fd),
%%
- ?line true = (SzGz =< Sz),
+ true = (SzGz =< Sz),
%%
%% Compress and uncompress test
%%
- ?line {ok, 0} = ?FILE_MODULE:position(FdReal, bof),
- ?line {ok, 0} = ?FILE_MODULE:position(Fd, bof),
- ?line ok = ?FILE_MODULE:truncate(Fd),
- ?line {ok, Sz} = ?FILE_MODULE:copy(FdReal, Fd),
- ?line {ok, SzGz} = ?RAM_FILE_MODULE:compress(Fd),
- ?line {ok, Sz} = ?RAM_FILE_MODULE:uncompress(Fd),
- ?line {ok, 0} = ?FILE_MODULE:position(Fd, bof),
- ?line {ok, 0} = ?FILE_MODULE:position(FdReal, bof),
- ?line true = compare(FdReal, Fd),
+ {ok, 0} = ?FILE_MODULE:position(FdReal, bof),
+ {ok, 0} = ?FILE_MODULE:position(Fd, bof),
+ ok = ?FILE_MODULE:truncate(Fd),
+ {ok, Sz} = ?FILE_MODULE:copy(FdReal, Fd),
+ {ok, SzGz} = ?RAM_FILE_MODULE:compress(Fd),
+ {ok, Sz} = ?RAM_FILE_MODULE:uncompress(Fd),
+ {ok, 0} = ?FILE_MODULE:position(Fd, bof),
+ {ok, 0} = ?FILE_MODULE:position(FdReal, bof),
+ true = compare(FdReal, Fd),
%%
- ?line ok = ?FILE_MODULE:close(FdReal),
- ?line ok = ?FILE_MODULE:close(Fd),
- ?line ok = ?FILE_MODULE:close(FdRealGz),
+ ok = ?FILE_MODULE:close(FdReal),
+ ok = ?FILE_MODULE:close(Fd),
+ ok = ?FILE_MODULE:close(FdRealGz),
%% Test uncompressing data that will be expanded many times.
- ?line Huge = iolist_to_binary(mk_42(18)),
- ?line HugeSize = byte_size(Huge),
- ?line HugeGz = zlib:gzip(Huge),
+ Huge = iolist_to_binary(mk_42(18)),
+ HugeSize = byte_size(Huge),
+ HugeGz = zlib:gzip(Huge),
- ?line {ok,HugeFd} = ?FILE_MODULE:open([], [ram,read,write,binary]),
- ?line ok = ?FILE_MODULE:write(HugeFd, HugeGz),
- ?line {ok,HugeSize} = ?RAM_FILE_MODULE:uncompress(HugeFd),
- ?line {ok,0} = ?FILE_MODULE:position(HugeFd, bof),
- ?line {ok,Huge} = ?FILE_MODULE:read(HugeFd, HugeSize),
+ {ok,HugeFd} = ?FILE_MODULE:open([], [ram,read,write,binary]),
+ ok = ?FILE_MODULE:write(HugeFd, HugeGz),
+ {ok,HugeSize} = ?RAM_FILE_MODULE:uncompress(HugeFd),
+ {ok,0} = ?FILE_MODULE:position(HugeFd, bof),
+ {ok,Huge} = ?FILE_MODULE:read(HugeFd, HugeSize),
%% Uncompressing again should do nothing.
- ?line {ok,HugeSize} = ?RAM_FILE_MODULE:uncompress(HugeFd),
- ?line {ok,0} = ?FILE_MODULE:position(HugeFd, bof),
- ?line {ok,Huge} = ?FILE_MODULE:read(HugeFd, HugeSize),
+ {ok,HugeSize} = ?RAM_FILE_MODULE:uncompress(HugeFd),
+ {ok,0} = ?FILE_MODULE:position(HugeFd, bof),
+ {ok,Huge} = ?FILE_MODULE:read(HugeFd, HugeSize),
- ?line ok = ?FILE_MODULE:close(HugeFd),
+ ok = ?FILE_MODULE:close(HugeFd),
ok.
@@ -469,118 +437,108 @@ mk_42(N) ->
B = mk_42(N-1),
[B|B].
-uuencode(suite) ->
- [];
-uuencode(doc) ->
- ["Test that uuencode/1 and uudecode/1 works."];
+%% Test that uuencode/1 and uudecode/1 works.
uuencode(Config) when is_list(Config) ->
- ?line Data = ?config(data_dir, Config),
- ?line Real = filename:join(Data, "realmen.html"),
- ?line RealUu = filename:join(Data, "realmen.html.uu"),
+ Data = proplists:get_value(data_dir, Config),
+ Real = filename:join(Data, "realmen.html"),
+ RealUu = filename:join(Data, "realmen.html.uu"),
%%
%% Uudecode test
%%
- ?line {ok, FdReal} = ?FILE_MODULE:open(Real, []),
- ?line {ok, Fd} = ?FILE_MODULE:open([], [ram, read, write]),
- ?line {ok, FdRealUu} = ?FILE_MODULE:open(RealUu, []),
+ {ok, FdReal} = ?FILE_MODULE:open(Real, []),
+ {ok, Fd} = ?FILE_MODULE:open([], [ram, read, write]),
+ {ok, FdRealUu} = ?FILE_MODULE:open(RealUu, []),
%%
- ?line {ok, SzUu} = ?FILE_MODULE:copy(FdRealUu, Fd),
- ?line {ok, Sz} = ?RAM_FILE_MODULE:uudecode(Fd),
- ?line true = (Sz =< SzUu),
- ?line {ok, 0} = ?FILE_MODULE:position(Fd, bof),
- ?line true = compare(FdReal, Fd),
+ {ok, SzUu} = ?FILE_MODULE:copy(FdRealUu, Fd),
+ {ok, Sz} = ?RAM_FILE_MODULE:uudecode(Fd),
+ true = (Sz =< SzUu),
+ {ok, 0} = ?FILE_MODULE:position(Fd, bof),
+ true = compare(FdReal, Fd),
%%
%% Uuencode and decode test
%%
F = fun(Offs) ->
Size = Sz - Offs,
- ?line {ok, Offs} = ?FILE_MODULE:position(FdReal, {bof,Offs}),
- ?line {ok, 0} = ?FILE_MODULE:position(Fd, bof),
- ?line ok = ?FILE_MODULE:truncate(Fd),
- ?line {ok, Size} = ?FILE_MODULE:copy(FdReal, Fd),
- ?line {ok, SizeUu} = ?RAM_FILE_MODULE:uuencode(Fd),
- ?line true = (Size =< SizeUu),
- ?line {ok, Size} = ?RAM_FILE_MODULE:uudecode(Fd),
- ?line {ok, Offs} = ?FILE_MODULE:position(FdReal, {bof,Offs}),
- ?line {ok, 0} = ?FILE_MODULE:position(Fd, bof),
- ?line true = compare(FdReal, Fd)
+ {ok, Offs} = ?FILE_MODULE:position(FdReal, {bof,Offs}),
+ {ok, 0} = ?FILE_MODULE:position(Fd, bof),
+ ok = ?FILE_MODULE:truncate(Fd),
+ {ok, Size} = ?FILE_MODULE:copy(FdReal, Fd),
+ {ok, SizeUu} = ?RAM_FILE_MODULE:uuencode(Fd),
+ true = (Size =< SizeUu),
+ {ok, Size} = ?RAM_FILE_MODULE:uudecode(Fd),
+ {ok, Offs} = ?FILE_MODULE:position(FdReal, {bof,Offs}),
+ {ok, 0} = ?FILE_MODULE:position(Fd, bof),
+ true = compare(FdReal, Fd)
end,
lists:foreach(F, lists:seq(0,Sz-1, 43)),
- ?line ok = ?FILE_MODULE:close(FdReal),
- ?line ok = ?FILE_MODULE:close(Fd),
- ?line ok = ?FILE_MODULE:close(FdRealUu),
+ ok = ?FILE_MODULE:close(FdReal),
+ ok = ?FILE_MODULE:close(Fd),
+ ok = ?FILE_MODULE:close(FdRealUu),
%%
ok.
-
-large_file_errors(suite) ->
- [];
-large_file_errors(doc) ->
- ["Test error checking of large file offsets."];
+%% Test error checking of large file offsets.
large_file_errors(Config) when is_list(Config) ->
- ?line TwoGig = 1 bsl 31,
- ?line {ok,Fd} = ?RAM_FILE_MODULE:open("1234567890", [read,write]),
- ?line {error, einval} = ?FILE_MODULE:read(Fd, TwoGig),
- ?line {error, badarg} = ?FILE_MODULE:read(Fd, -1),
- ?line {error, einval} = ?FILE_MODULE:position(Fd, {bof,TwoGig}),
- ?line {error, einval} = ?FILE_MODULE:position(Fd, {bof,-TwoGig-1}),
- ?line {error, einval} = ?FILE_MODULE:position(Fd, {bof,-1}),
- ?line {error, einval} = ?FILE_MODULE:position(Fd, {cur,TwoGig}),
- ?line {error, einval} = ?FILE_MODULE:position(Fd, {cur,-TwoGig-1}),
- ?line {error, einval} = ?FILE_MODULE:position(Fd, {eof,TwoGig}),
- ?line {error, einval} = ?FILE_MODULE:position(Fd, {eof,-TwoGig-1}),
- ?line {error, einval} = ?FILE_MODULE:pread(Fd, TwoGig, 1),
- ?line {error, einval} = ?FILE_MODULE:pread(Fd, -TwoGig-1, 1),
- ?line {error, einval} = ?FILE_MODULE:pread(Fd, -1, 1),
- ?line {error, einval} = ?FILE_MODULE:pwrite(Fd, TwoGig, "@"),
- ?line {error, einval} = ?FILE_MODULE:pwrite(Fd, -TwoGig-1, "@"),
- ?line {error, einval} = ?FILE_MODULE:pwrite(Fd, -1, "@"),
- ?line {error, einval} = ?FILE_MODULE:pread(Fd, TwoGig, 0),
- ?line {error, einval} = ?FILE_MODULE:pread(Fd, -TwoGig-1, 0),
- ?line {error, einval} = ?FILE_MODULE:pread(Fd, -1, 0),
- ?line ok = ?FILE_MODULE:close(Fd),
+ TwoGig = 1 bsl 31,
+ {ok,Fd} = ?RAM_FILE_MODULE:open("1234567890", [read,write]),
+ {error, einval} = ?FILE_MODULE:read(Fd, TwoGig),
+ {error, badarg} = ?FILE_MODULE:read(Fd, -1),
+ {error, einval} = ?FILE_MODULE:position(Fd, {bof,TwoGig}),
+ {error, einval} = ?FILE_MODULE:position(Fd, {bof,-TwoGig-1}),
+ {error, einval} = ?FILE_MODULE:position(Fd, {bof,-1}),
+ {error, einval} = ?FILE_MODULE:position(Fd, {cur,TwoGig}),
+ {error, einval} = ?FILE_MODULE:position(Fd, {cur,-TwoGig-1}),
+ {error, einval} = ?FILE_MODULE:position(Fd, {eof,TwoGig}),
+ {error, einval} = ?FILE_MODULE:position(Fd, {eof,-TwoGig-1}),
+ {error, einval} = ?FILE_MODULE:pread(Fd, TwoGig, 1),
+ {error, einval} = ?FILE_MODULE:pread(Fd, -TwoGig-1, 1),
+ {error, einval} = ?FILE_MODULE:pread(Fd, -1, 1),
+ {error, einval} = ?FILE_MODULE:pwrite(Fd, TwoGig, "@"),
+ {error, einval} = ?FILE_MODULE:pwrite(Fd, -TwoGig-1, "@"),
+ {error, einval} = ?FILE_MODULE:pwrite(Fd, -1, "@"),
+ {error, einval} = ?FILE_MODULE:pread(Fd, TwoGig, 0),
+ {error, einval} = ?FILE_MODULE:pread(Fd, -TwoGig-1, 0),
+ {error, einval} = ?FILE_MODULE:pread(Fd, -1, 0),
+ ok = ?FILE_MODULE:close(Fd),
ok.
-large_file_light(suite) ->
- [];
-large_file_light(doc) ->
- ["Test light operations on a \"large\" ram_file."];
+%% Test light operations on a \large\ ram_file.
large_file_light(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
%% Marker for next test case that is to heavy to run in a suite.
- ?line ok = ?FILE_MODULE:write_file(
- filename:join(PrivDir, "large_file_light"),
- <<"TAG">>),
- %%
- ?line Data = "abcdefghijklmnopqrstuvwzyz",
- ?line Size = sizeof(Data),
- ?line Max = (1 bsl 31) - 1,
- ?line Max__1 = Max - 1,
- ?line {ok, Fd} = ?RAM_FILE_MODULE:open(Data, [read]),
- ?line {ok, Data} = ?FILE_MODULE:read(Fd, Size+1),
- ?line {ok, Max__1} = ?FILE_MODULE:position(Fd, {eof, Max-Size-1}),
- ?line eof = ?FILE_MODULE:read(Fd, 1),
- ?line {ok, Max} = ?FILE_MODULE:position(Fd, {bof, Max}),
- ?line {ok, Zero} = ?FILE_MODULE:read(Fd, 0),
- ?line 0 = sizeof(Zero),
- ?line eof = ?FILE_MODULE:read(Fd, 1),
- ?line eof = ?FILE_MODULE:pread(Fd, Max__1, 1),
- ?line {ok, Zero} = ?FILE_MODULE:pread(Fd, Max, 0),
- ?line eof = ?FILE_MODULE:pread(Fd, Max, 1),
+ ok = ?FILE_MODULE:write_file(
+ filename:join(PrivDir, "large_file_light"),
+ <<"TAG">>),
+ %%
+ Data = "abcdefghijklmnopqrstuvwzyz",
+ Size = sizeof(Data),
+ Max = (1 bsl 31) - 1,
+ Max__1 = Max - 1,
+ {ok, Fd} = ?RAM_FILE_MODULE:open(Data, [read]),
+ {ok, Data} = ?FILE_MODULE:read(Fd, Size+1),
+ {ok, Max__1} = ?FILE_MODULE:position(Fd, {eof, Max-Size-1}),
+ eof = ?FILE_MODULE:read(Fd, 1),
+ {ok, Max} = ?FILE_MODULE:position(Fd, {bof, Max}),
+ {ok, Zero} = ?FILE_MODULE:read(Fd, 0),
+ 0 = sizeof(Zero),
+ eof = ?FILE_MODULE:read(Fd, 1),
+ eof = ?FILE_MODULE:pread(Fd, Max__1, 1),
+ {ok, Zero} = ?FILE_MODULE:pread(Fd, Max, 0),
+ eof = ?FILE_MODULE:pread(Fd, Max, 1),
ok.
-large_file_heavy(suite) ->
- [];
-large_file_heavy(doc) ->
- ["Test operations on a maximum size (2 GByte - 1) ram_file."];
+large_file_heavy() ->
+ [{timetrap,{minutes,5}}].
+
+%% Test operations on a maximum size (2 GByte - 1) ram_file.
large_file_heavy(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
%% Check previous test case marker.
case ?FILE_MODULE:read_file_info(
filename:join(PrivDir, "large_file_light")) of
@@ -591,33 +549,33 @@ large_file_heavy(Config) when is_list(Config) ->
end.
do_large_file_heavy(_Config) ->
- ?line Data = "qwertyuiopasdfghjklzxcvbnm",
- ?line Size = sizeof(Data),
- ?line Max = (1 bsl 31) - 1,
- ?line Max__1 = Max - 1,
- ?line Max__3 = Max - 3,
- ?line {ok, Fd} = ?RAM_FILE_MODULE:open(Data, [read,write]),
- ?line {ok, Data} = ?FILE_MODULE:read(Fd, Size+1),
- ?line {ok, Max} = ?FILE_MODULE:position(Fd, {eof, Max-Size}),
- ?line eof = ?FILE_MODULE:read(Fd, 1),
- ?line erlang:display({allocating,2,'GByte',please,be,patient,'...'}),
- ?line ok = ?FILE_MODULE:write(Fd, ""),
- ?line erlang:display({allocating,2,'GByte',succeeded}),
- ?line {ok, Max__1} = ?FILE_MODULE:position(Fd, {eof, -1}),
- ?line {ok, [0]} = ?FILE_MODULE:read(Fd, 1),
- ?line {ok, []} = ?FILE_MODULE:read(Fd, 0),
- ?line eof = ?FILE_MODULE:read(Fd, 1),
- ?line ok = ?FILE_MODULE:pwrite(Fd, Max-3, "TAG"),
- ?line {ok, Max} = ?FILE_MODULE:position(Fd, cur),
- ?line {ok, Max__3} = ?FILE_MODULE:position(Fd, {eof, -3}),
- ?line {ok, "TAG"} = ?FILE_MODULE:read(Fd, 3+1),
- ?line {ok, Max__3} = ?FILE_MODULE:position(Fd, {cur, -3}),
- ?line ok = ?FILE_MODULE:write(Fd, "tag"),
- ?line {ok, Max} = ?FILE_MODULE:position(Fd, cur),
- ?line {ok, 0} = ?FILE_MODULE:position(Fd, bof),
- ?line {ok, "tag"} = ?FILE_MODULE:pread(Fd, Max__3, 3+1),
- ?line {ok, 0} = ?FILE_MODULE:position(Fd, cur),
- ?line ok = ?FILE_MODULE:close(Fd),
+ Data = "qwertyuiopasdfghjklzxcvbnm",
+ Size = sizeof(Data),
+ Max = (1 bsl 31) - 1,
+ Max__1 = Max - 1,
+ Max__3 = Max - 3,
+ {ok, Fd} = ?RAM_FILE_MODULE:open(Data, [read,write]),
+ {ok, Data} = ?FILE_MODULE:read(Fd, Size+1),
+ {ok, Max} = ?FILE_MODULE:position(Fd, {eof, Max-Size}),
+ eof = ?FILE_MODULE:read(Fd, 1),
+ erlang:display({allocating,2,'GByte',please,be,patient,'...'}),
+ ok = ?FILE_MODULE:write(Fd, ""),
+ erlang:display({allocating,2,'GByte',succeeded}),
+ {ok, Max__1} = ?FILE_MODULE:position(Fd, {eof, -1}),
+ {ok, [0]} = ?FILE_MODULE:read(Fd, 1),
+ {ok, []} = ?FILE_MODULE:read(Fd, 0),
+ eof = ?FILE_MODULE:read(Fd, 1),
+ ok = ?FILE_MODULE:pwrite(Fd, Max-3, "TAG"),
+ {ok, Max} = ?FILE_MODULE:position(Fd, cur),
+ {ok, Max__3} = ?FILE_MODULE:position(Fd, {eof, -3}),
+ {ok, "TAG"} = ?FILE_MODULE:read(Fd, 3+1),
+ {ok, Max__3} = ?FILE_MODULE:position(Fd, {cur, -3}),
+ ok = ?FILE_MODULE:write(Fd, "tag"),
+ {ok, Max} = ?FILE_MODULE:position(Fd, cur),
+ {ok, 0} = ?FILE_MODULE:position(Fd, bof),
+ {ok, "tag"} = ?FILE_MODULE:pread(Fd, Max__3, 3+1),
+ {ok, 0} = ?FILE_MODULE:position(Fd, cur),
+ ok = ?FILE_MODULE:close(Fd),
ok.
%%--------------------------------------------------------------------------
@@ -651,7 +609,7 @@ compare_data(A, B) when is_binary(A), is_list(B) ->
A == list_to_binary(B);
compare_data(A, B) when is_binary(A), is_binary(B) ->
A == B.
-
+
sizeof(Data) when is_list(Data) ->
length(Data);
sizeof(Data) when is_binary(Data) ->
diff --git a/lib/kernel/test/rpc_SUITE.erl b/lib/kernel/test/rpc_SUITE.erl
index 42c522b1bd..101cff7ed2 100644
--- a/lib/kernel/test/rpc_SUITE.erl
+++ b/lib/kernel/test/rpc_SUITE.erl
@@ -30,7 +30,9 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[call, block_call, multicall, multicall_timeout,
@@ -55,272 +57,252 @@ end_per_group(_GroupName, Config) ->
-call(doc) -> "Test different rpc calls";
+%% Test different rpc calls.
call(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(30)),
- ?line PA = filename:dirname(code:which(?MODULE)),
+ PA = filename:dirname(code:which(?MODULE)),
%% Note. First part of nodename sets response delay in seconds
- ?line {ok, N1} = ?t:start_node('3_rpc_SUITE_call', slave,
- [{args, "-pa " ++ PA}]),
- ?line {ok, N2} = ?t:start_node('1_rcp_SUITE_call', slave,
- [{args, "-pa " ++ PA}]),
- ?line {ok, N3} = ?t:start_node('4_rcp_SUITE_call', slave,
- [{args, "-pa " ++ PA}]),
- ?line {ok, N4} = ?t:start_node('8_rcp_SUITE_call', slave,
- [{args, "-pa " ++ PA}]),
- ?line ok = io:format("~p~n", [[N1, N2, N3]]),
- ?line {hej,_,N1} = rpc:call(N1, ?MODULE, f, []),
- ?line {hej,_,N2} = rpc:call(N2, ?MODULE, f, [], 2000),
- ?line {badrpc,timeout} = rpc:call(N3, ?MODULE, f, [], 2000),
- ?line receive after 6000 -> ok end,
- ?line [] = flush([]),
- ?line {hej,_,N4} = rpc:call(N4, ?MODULE, f, []),
- ?line ?t:stop_node(N1),
- ?line ?t:stop_node(N2),
- ?line ?t:stop_node(N3),
- ?line ?t:stop_node(N4),
- ?t:timetrap_cancel(Timetrap),
+ {ok, N1} = test_server:start_node('3_rpc_SUITE_call', slave,
+ [{args, "-pa " ++ PA}]),
+ {ok, N2} = test_server:start_node('1_rcp_SUITE_call', slave,
+ [{args, "-pa " ++ PA}]),
+ {ok, N3} = test_server:start_node('4_rcp_SUITE_call', slave,
+ [{args, "-pa " ++ PA}]),
+ {ok, N4} = test_server:start_node('8_rcp_SUITE_call', slave,
+ [{args, "-pa " ++ PA}]),
+ ok = io:format("~p~n", [[N1, N2, N3]]),
+ {hej,_,N1} = rpc:call(N1, ?MODULE, f, []),
+ {hej,_,N2} = rpc:call(N2, ?MODULE, f, [], 2000),
+ {badrpc,timeout} = rpc:call(N3, ?MODULE, f, [], 2000),
+ receive after 6000 -> ok end,
+ [] = flush([]),
+ {hej,_,N4} = rpc:call(N4, ?MODULE, f, []),
+ test_server:stop_node(N1),
+ test_server:stop_node(N2),
+ test_server:stop_node(N3),
+ test_server:stop_node(N4),
ok.
-block_call(doc) -> "Test different rpc calls";
+%% Test different rpc calls.
block_call(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(30)),
- ?line PA = filename:dirname(code:which(?MODULE)),
+ PA = filename:dirname(code:which(?MODULE)),
%% Note. First part of nodename sets response delay in seconds
- ?line {ok, N1} = ?t:start_node('3_rpc_SUITE_block_call', slave,
- [{args, "-pa " ++ PA}]),
- ?line {ok, N2} = ?t:start_node('1_rcp_SUITE_block_call', slave,
- [{args, "-pa " ++ PA}]),
- ?line {ok, N3} = ?t:start_node('4_rcp_SUITE_block_call', slave,
- [{args, "-pa " ++ PA}]),
- ?line {ok, N4} = ?t:start_node('8_rcp_SUITE_block_call', slave,
- [{args, "-pa " ++ PA}]),
- ?line ok = io:format("~p~n", [[N1, N2, N3]]),
- ?line {hej,_,N1} = rpc:block_call(N1, ?MODULE, f, []),
- ?line {hej,_,N2} = rpc:block_call(N2, ?MODULE, f, [], 2000),
- ?line {badrpc,timeout} = rpc:block_call(N3, ?MODULE, f, [], 2000),
- ?line receive after 6000 -> ok end,
- ?line [] = flush([]),
- ?line {hej,_,N4} = rpc:block_call(N4, ?MODULE, f, []),
- ?line ?t:stop_node(N1),
- ?line ?t:stop_node(N2),
- ?line ?t:stop_node(N3),
- ?line ?t:stop_node(N4),
- ?t:timetrap_cancel(Timetrap),
+ {ok, N1} = test_server:start_node('3_rpc_SUITE_block_call', slave,
+ [{args, "-pa " ++ PA}]),
+ {ok, N2} = test_server:start_node('1_rcp_SUITE_block_call', slave,
+ [{args, "-pa " ++ PA}]),
+ {ok, N3} = test_server:start_node('4_rcp_SUITE_block_call', slave,
+ [{args, "-pa " ++ PA}]),
+ {ok, N4} = test_server:start_node('8_rcp_SUITE_block_call', slave,
+ [{args, "-pa " ++ PA}]),
+ ok = io:format("~p~n", [[N1, N2, N3]]),
+ {hej,_,N1} = rpc:block_call(N1, ?MODULE, f, []),
+ {hej,_,N2} = rpc:block_call(N2, ?MODULE, f, [], 2000),
+ {badrpc,timeout} = rpc:block_call(N3, ?MODULE, f, [], 2000),
+ receive after 6000 -> ok end,
+ [] = flush([]),
+ {hej,_,N4} = rpc:block_call(N4, ?MODULE, f, []),
+ test_server:stop_node(N1),
+ test_server:stop_node(N2),
+ test_server:stop_node(N3),
+ test_server:stop_node(N4),
ok.
-multicall(doc) ->
- "OTP-3449";
+%% OTP-3449.
multicall(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(20)),
- ?line PA = filename:dirname(code:which(?MODULE)),
+ PA = filename:dirname(code:which(?MODULE)),
%% Note. First part of nodename sets response delay in seconds
- ?line {ok, N1} = ?t:start_node('3_rpc_SUITE_multicall', slave,
- [{args, "-pa " ++ PA}]),
- ?line {ok, N2} = ?t:start_node('1_rcp_SUITE_multicall', slave,
- [{args, "-pa " ++ PA}]),
- ?line ok = io:format("~p~n", [[N1, N2]]),
- ?line {[{hej,_,N1},{hej,_,N2}],[]} =
- rpc:multicall([N1, N2], ?MODULE, f, []),
- ?line Msgs = flush([]),
- ?line [] = Msgs,
- ?line ?t:stop_node(N1),
- ?line ?t:stop_node(N2),
- ?t:timetrap_cancel(Timetrap),
+ {ok, N1} = test_server:start_node('3_rpc_SUITE_multicall', slave,
+ [{args, "-pa " ++ PA}]),
+ {ok, N2} = test_server:start_node('1_rcp_SUITE_multicall', slave,
+ [{args, "-pa " ++ PA}]),
+ ok = io:format("~p~n", [[N1, N2]]),
+ {[{hej,_,N1},{hej,_,N2}],[]} =
+ rpc:multicall([N1, N2], ?MODULE, f, []),
+ Msgs = flush([]),
+ [] = Msgs,
+ test_server:stop_node(N1),
+ test_server:stop_node(N2),
ok.
multicall_timeout(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(30)),
- ?line PA = filename:dirname(code:which(?MODULE)),
+ PA = filename:dirname(code:which(?MODULE)),
%% Note. First part of nodename sets response delay in seconds
- ?line {ok, N1} = ?t:start_node('11_rpc_SUITE_multicall', slave,
- [{args, "-pa " ++ PA}]),
- ?line {ok, N2} = ?t:start_node('8_rpc_SUITE_multicall', slave,
- [{args, "-pa " ++ PA}]),
- ?line {ok, N3} = ?t:start_node('5_rpc_SUITE_multicall', slave,
- [{args, "-pa " ++ PA}]),
- ?line {ok, N4} = ?t:start_node('2_rcp_SUITE_multicall', slave,
- [{args, "-pa " ++ PA}]),
- ?line ok = io:format("~p~n", [[N1, N2]]),
- ?line {[{hej,_,N3},{hej,_,N4}],[N1, N2]} =
- rpc:multicall([N3, N1, N2, N4], ?MODULE, f, [], ?t:seconds(6)),
- ?t:sleep(?t:seconds(8)), %% Wait for late answers
- ?line Msgs = flush([]),
- ?line [] = Msgs,
- ?line ?t:stop_node(N1),
- ?line ?t:stop_node(N2),
- ?line ?t:stop_node(N3),
- ?line ?t:stop_node(N4),
- ?t:timetrap_cancel(Timetrap),
+ {ok, N1} = test_server:start_node('11_rpc_SUITE_multicall', slave,
+ [{args, "-pa " ++ PA}]),
+ {ok, N2} = test_server:start_node('8_rpc_SUITE_multicall', slave,
+ [{args, "-pa " ++ PA}]),
+ {ok, N3} = test_server:start_node('5_rpc_SUITE_multicall', slave,
+ [{args, "-pa " ++ PA}]),
+ {ok, N4} = test_server:start_node('2_rcp_SUITE_multicall', slave,
+ [{args, "-pa " ++ PA}]),
+ ok = io:format("~p~n", [[N1, N2]]),
+ {[{hej,_,N3},{hej,_,N4}],[N1, N2]} =
+ rpc:multicall([N3, N1, N2, N4], ?MODULE, f, [], 6000),
+ ct:sleep({seconds,8}), %Wait for late answers
+ Msgs = flush([]),
+ [] = Msgs,
+ test_server:stop_node(N1),
+ test_server:stop_node(N2),
+ test_server:stop_node(N3),
+ test_server:stop_node(N4),
ok.
multicall_dies(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(30)),
- ?line PA = filename:dirname(code:which(?MODULE)),
- ?line {ok, N1} = ?t:start_node('rpc_SUITE_multicall_dies_1', slave,
- [{args, "-pa " ++ PA}]),
- ?line {ok, N2} = ?t:start_node('rcp_SUITE_multicall_dies_2', slave,
- [{args, "-pa " ++ PA}]),
- ?line Nodes = [N1, N2],
+ PA = filename:dirname(code:which(?MODULE)),
+ {ok, N1} = test_server:start_node('rpc_SUITE_multicall_dies_1', slave,
+ [{args, "-pa " ++ PA}]),
+ {ok, N2} = test_server:start_node('rcp_SUITE_multicall_dies_2', slave,
+ [{args, "-pa " ++ PA}]),
+ Nodes = [N1, N2],
%%
- ?line {[{badrpc, {'EXIT', normal}}, {badrpc, {'EXIT', normal}}], []} =
+ {[{badrpc, {'EXIT', normal}}, {badrpc, {'EXIT', normal}}], []} =
do_multicall(Nodes, erlang, exit, [normal]),
- ?line {[{badrpc, {'EXIT', abnormal}}, {badrpc, {'EXIT', abnormal}}], []} =
+ {[{badrpc, {'EXIT', abnormal}}, {badrpc, {'EXIT', abnormal}}], []} =
do_multicall(Nodes, erlang, exit, [abnormal]),
- ?line {[{badrpc, {'EXIT', {badarith, _}}},
- {badrpc, {'EXIT', {badarith, _}}}],
- []} =
+ {[{badrpc, {'EXIT', {badarith, _}}},
+ {badrpc, {'EXIT', {badarith, _}}}],
+ []} =
do_multicall(Nodes, erlang, 'div', [1, 0]),
- ?line {[{badrpc, {'EXIT', {badarg, _}}},
- {badrpc, {'EXIT', {badarg, _}}}],
- []} =
+ {[{badrpc, {'EXIT', {badarg, _}}},
+ {badrpc, {'EXIT', {badarg, _}}}],
+ []} =
do_multicall(Nodes, erlang, atom_to_list, [1]),
- ?line {[{badrpc, {'EXIT', {undef, _}}},
- {badrpc, {'EXIT', {undef, _}}}],
- []} =
+ {[{badrpc, {'EXIT', {undef, _}}},
+ {badrpc, {'EXIT', {undef, _}}}],
+ []} =
do_multicall(Nodes, ?MODULE, suicide, []),
- ?line {[timeout, timeout], []} =
+ {[timeout, timeout], []} =
do_multicall(Nodes, ?MODULE, suicide, [link, normal]),
- ?line {[{badrpc, {'EXIT', abnormal}}, {badrpc, {'EXIT', abnormal}}], []} =
+ {[{badrpc, {'EXIT', abnormal}}, {badrpc, {'EXIT', abnormal}}], []} =
do_multicall(Nodes, ?MODULE, suicide, [link, abnormal]),
- ?line {[timeout, timeout], []} =
+ {[timeout, timeout], []} =
do_multicall(Nodes, ?MODULE, suicide, [exit, normal]),
- ?line {[{badrpc, {'EXIT', abnormal}}, {badrpc, {'EXIT', abnormal}}], []} =
+ {[{badrpc, {'EXIT', abnormal}}, {badrpc, {'EXIT', abnormal}}], []} =
do_multicall(Nodes, ?MODULE, suicide, [exit, abnormal]),
- ?line {[{badrpc, {'EXIT', killed}}, {badrpc, {'EXIT', killed}}], []} =
+ {[{badrpc, {'EXIT', killed}}, {badrpc, {'EXIT', killed}}], []} =
do_multicall(Nodes, ?MODULE, suicide, [exit, kill]),
%%
- ?line ?t:stop_node(N1),
- ?line ?t:stop_node(N2),
- ?t:timetrap_cancel(Timetrap),
+ test_server:stop_node(N1),
+ test_server:stop_node(N2),
ok.
do_multicall(Nodes, Mod, Func, Args) ->
- ?line ok = io:format("~p:~p~p~n", [Mod, Func, Args]),
- ?line Result = rpc:multicall(Nodes, Mod, Func, Args),
- ?line Msgs = flush([]),
- ?line [] = Msgs,
+ ok = io:format("~p:~p~p~n", [Mod, Func, Args]),
+ Result = rpc:multicall(Nodes, Mod, Func, Args),
+ Msgs = flush([]),
+ [] = Msgs,
Result.
-multicall_node_dies(doc) ->
- "";
multicall_node_dies(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(60)),
- %%
do_multicall_2_nodes_dies(?MODULE, suicide, [erlang, halt, []]),
do_multicall_2_nodes_dies(?MODULE, suicide, [init, stop, []]),
do_multicall_2_nodes_dies(?MODULE, suicide, [rpc, stop, []]),
- %%
- ?t:timetrap_cancel(Timetrap),
ok.
do_multicall_2_nodes_dies(Mod, Func, Args) ->
- ?line ok = io:format("~p:~p~p~n", [Mod, Func, Args]),
- ?line PA = filename:dirname(code:which(?MODULE)),
- ?line {ok, N1} = ?t:start_node('rpc_SUITE_multicall_node_dies_1', slave,
- [{args, "-pa " ++ PA}]),
- ?line {ok, N2} = ?t:start_node('rcp_SUITE_multicall_node_dies_2', slave,
- [{args, "-pa " ++ PA}]),
- ?line Nodes = [N1, N2],
- ?line {[], Nodes} = rpc:multicall(Nodes, Mod, Func, Args),
- ?line Msgs = flush([]),
- ?line [] = Msgs,
+ ok = io:format("~p:~p~p~n", [Mod, Func, Args]),
+ PA = filename:dirname(code:which(?MODULE)),
+ {ok, N1} = test_server:start_node('rpc_SUITE_multicall_node_dies_1', slave,
+ [{args, "-pa " ++ PA}]),
+ {ok, N2} = test_server:start_node('rcp_SUITE_multicall_node_dies_2', slave,
+ [{args, "-pa " ++ PA}]),
+ Nodes = [N1, N2],
+ {[], Nodes} = rpc:multicall(Nodes, Mod, Func, Args),
+ Msgs = flush([]),
+ [] = Msgs,
ok.
-called_dies(doc) ->
- "OTP-3766";
+%% OTP-3766.
called_dies(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(210)),
- ?line PA = filename:dirname(code:which(?MODULE)),
- ?line {ok, N} = ?t:start_node(rpc_SUITE_called_dies, slave,
- [{args, "-pa " ++ PA}]),
+ PA = filename:dirname(code:which(?MODULE)),
+ {ok, N} = test_server:start_node(rpc_SUITE_called_dies, slave,
+ [{args, "-pa " ++ PA}]),
%%
- ?line rep(fun (Tag, Call, Args) ->
- {Tag,{badrpc,{'EXIT',normal}}} =
- {Tag,apply(rpc, Call, Args)}
- end, N, erlang, exit, [normal]),
- ?line rep(fun (Tag, Call, Args) ->
- {Tag,{badrpc,{'EXIT',abnormal}}} =
- {Tag,apply(rpc, Call, Args)}
- end, N, erlang, exit, [abnormal]),
- ?line rep(fun (Tag, Call, Args) ->
- {Tag,{badrpc,{'EXIT',{badarith,_}}}} =
- {Tag,apply(rpc, Call, Args)}
- end, N, erlang, 'div', [1,0]),
- ?line rep(fun (Tag, Call, Args) ->
- {Tag,{badrpc,{'EXIT',{badarg,_}}}} =
- {Tag,apply(rpc, Call, Args)}
- end, N, erlang, atom_to_list, [1]),
- ?line rep(fun (Tag, Call, Args) ->
- {Tag,{badrpc,{'EXIT',{undef,_}}}} =
- {Tag,apply(rpc, Call, Args)}
- end, N, ?MODULE, suicide, []),
+ rep(fun (Tag, Call, Args) ->
+ {Tag,{badrpc,{'EXIT',normal}}} =
+ {Tag,apply(rpc, Call, Args)}
+ end, N, erlang, exit, [normal]),
+ rep(fun (Tag, Call, Args) ->
+ {Tag,{badrpc,{'EXIT',abnormal}}} =
+ {Tag,apply(rpc, Call, Args)}
+ end, N, erlang, exit, [abnormal]),
+ rep(fun (Tag, Call, Args) ->
+ {Tag,{badrpc,{'EXIT',{badarith,_}}}} =
+ {Tag,apply(rpc, Call, Args)}
+ end, N, erlang, 'div', [1,0]),
+ rep(fun (Tag, Call, Args) ->
+ {Tag,{badrpc,{'EXIT',{badarg,_}}}} =
+ {Tag,apply(rpc, Call, Args)}
+ end, N, erlang, atom_to_list, [1]),
+ rep(fun (Tag, Call, Args) ->
+ {Tag,{badrpc,{'EXIT',{undef,_}}}} =
+ {Tag,apply(rpc, Call, Args)}
+ end, N, ?MODULE, suicide, []),
%%
TrapExit = process_flag(trap_exit, true),
%%
- ?line rep(fun (Tag, Call, Args=[Node|_]) when Node == node() ->
- {Tag,timeout} =
- {Tag,apply(rpc, Call, Args)},
- {Tag,flush,[{'EXIT',_,normal}]} =
- {Tag,flush,flush([])};
- (Tag, Call, Args) ->
- {Tag,timeout} =
- {Tag,apply(rpc, Call, Args)}
- end, N, ?MODULE, suicide, [link,normal]),
- ?line rep(fun (Tag, Call, Args=[Node|_]) when Node == node() ->
- {Tag,timeout} =
- {Tag,apply(rpc, Call, Args)},
- {Tag,flush,[{'EXIT',_,abnormal}]} =
- {Tag,flush,flush([])};
- (Tag, block_call, Args) ->
- {Tag,timeout} =
- {Tag,apply(rpc, block_call, Args)};
- (Tag, Call, Args) ->
- {Tag,{badrpc,{'EXIT',abnormal}}} =
- {Tag,apply(rpc, Call, Args)}
- end, N, ?MODULE, suicide, [link,abnormal]),
- ?line rep(fun (Tag, Call, Args=[Node|_]) when Node == node() ->
- {Tag,timeout} =
- {Tag,apply(rpc, Call, Args)},
- {Tag,flush,[{'EXIT',_,normal}]} =
- {Tag,flush,flush([])};
- (Tag, Call, Args) ->
- {Tag,timeout} =
- {Tag,apply(rpc, Call, Args)}
- end, N, ?MODULE, suicide, [exit,normal]),
- ?line rep(fun (Tag, Call, Args=[Node|_]) when Node == node() ->
- {Tag,timeout} =
- {Tag,apply(rpc, Call, Args)},
- {Tag,flush,[{'EXIT',_,abnormal}]} =
- {Tag,flush,flush([])};
- (Tag, block_call, Args) ->
- {Tag,timeout} =
- {Tag,apply(rpc, block_call, Args)};
- (Tag, Call, Args) ->
- {Tag,{badrpc,{'EXIT',abnormal}}} =
- {Tag,apply(rpc, Call, Args)}
- end, N, ?MODULE, suicide, [exit,abnormal]),
+ rep(fun (Tag, Call, Args=[Node|_]) when Node == node() ->
+ {Tag,timeout} =
+ {Tag,apply(rpc, Call, Args)},
+ {Tag,flush,[{'EXIT',_,normal}]} =
+ {Tag,flush,flush([])};
+ (Tag, Call, Args) ->
+ {Tag,timeout} =
+ {Tag,apply(rpc, Call, Args)}
+ end, N, ?MODULE, suicide, [link,normal]),
+ rep(fun (Tag, Call, Args=[Node|_]) when Node == node() ->
+ {Tag,timeout} =
+ {Tag,apply(rpc, Call, Args)},
+ {Tag,flush,[{'EXIT',_,abnormal}]} =
+ {Tag,flush,flush([])};
+ (Tag, block_call, Args) ->
+ {Tag,timeout} =
+ {Tag,apply(rpc, block_call, Args)};
+ (Tag, Call, Args) ->
+ {Tag,{badrpc,{'EXIT',abnormal}}} =
+ {Tag,apply(rpc, Call, Args)}
+ end, N, ?MODULE, suicide, [link,abnormal]),
+ rep(fun (Tag, Call, Args=[Node|_]) when Node == node() ->
+ {Tag,timeout} =
+ {Tag,apply(rpc, Call, Args)},
+ {Tag,flush,[{'EXIT',_,normal}]} =
+ {Tag,flush,flush([])};
+ (Tag, Call, Args) ->
+ {Tag,timeout} =
+ {Tag,apply(rpc, Call, Args)}
+ end, N, ?MODULE, suicide, [exit,normal]),
+ rep(fun (Tag, Call, Args=[Node|_]) when Node == node() ->
+ {Tag,timeout} =
+ {Tag,apply(rpc, Call, Args)},
+ {Tag,flush,[{'EXIT',_,abnormal}]} =
+ {Tag,flush,flush([])};
+ (Tag, block_call, Args) ->
+ {Tag,timeout} =
+ {Tag,apply(rpc, block_call, Args)};
+ (Tag, Call, Args) ->
+ {Tag,{badrpc,{'EXIT',abnormal}}} =
+ {Tag,apply(rpc, Call, Args)}
+ end, N, ?MODULE, suicide, [exit,abnormal]),
%%
process_flag(trap_exit, TrapExit),
%%
- ?line rep(fun %% A local [exit,kill] would kill the test case process
- (_Tag, _Call, [Node|_]) when Node == node() ->
- ok;
- %% A block_call [exit,kill] would kill the rpc server
- (_Tag, block_call, _Args) -> ok;
- (Tag, Call, Args) ->
- {Tag,{badrpc,{'EXIT',killed}}} =
- {Tag,apply(rpc, Call, Args)}
- end, N, ?MODULE, suicide, [exit,kill]),
+ rep(fun %% A local [exit,kill] would kill the test case process
+ (_Tag, _Call, [Node|_]) when Node == node() ->
+ ok;
+ %% A block_call [exit,kill] would kill the rpc server
+ (_Tag, block_call, _Args) -> ok;
+ (Tag, Call, Args) ->
+ {Tag,{badrpc,{'EXIT',killed}}} =
+ {Tag,apply(rpc, Call, Args)}
+ end, N, ?MODULE, suicide, [exit,kill]),
%%
- ?line [] = flush([]),
- ?line ?t:stop_node(N),
- ?t:timetrap_cancel(Timetrap),
+ [] = flush([]),
+ test_server:stop_node(N),
ok.
rep(Fun, N, M, F, A) ->
@@ -335,7 +317,7 @@ rep(Fun, N, M, F, A) ->
Fun(9, block_call, [N, M, F, A, infinity]),
Fun(10, block_call, [N, M, F, A, 3000]),
ok.
-
+
suicide(link, Reason) ->
spawn_link(
@@ -364,109 +346,83 @@ suicide(Mod, Func, Args) ->
-called_node_dies(doc) ->
- "";
-called_node_dies(suite) -> [];
called_node_dies(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:minutes(2)),
- ?line PA = filename:dirname(code:which(?MODULE)),
- %%
- ?line node_rep(
- fun (Tag, Call, Args) ->
- {Tag,{badrpc,nodedown}} =
- {Tag,apply(rpc, Call, Args)}
- end, "rpc_SUITE_called_node_dies_1",
- PA, ?MODULE, suicide, [erlang,halt,[]]),
- ?line node_rep(
- fun (Tag, Call, Args) ->
- {Tag,{badrpc,nodedown}} =
- {Tag,apply(rpc, Call, Args)}
- end, "rpc_SUITE_called_node_dies_2",
- PA, ?MODULE, suicide, [init,stop,[]]),
- ?line node_rep(
- fun (Tag, Call, Args=[_|_]) ->
- {Tag,{'EXIT',{killed,_}}} =
- {Tag,catch {noexit,apply(rpc, Call, Args)}}
- end, "rpc_SUITE_called_node_dies_3",
- PA, ?MODULE, suicide, [erlang,exit,[rex,kill]]),
- ?line node_rep(
- fun %% Cannot block call rpc - will hang
- (_Tag, block_call, _Args) -> ok;
- (Tag, Call, Args=[_|_]) ->
- {Tag,{'EXIT',{normal,_}}} =
- {Tag,catch {noexit,apply(rpc, Call, Args)}}
- end, "rpc_SUITE_called_node_dies_4",
- PA, ?MODULE, suicide, [rpc,stop,[]]),
- %%
- ?t:timetrap_cancel(Timetrap),
+ PA = filename:dirname(code:which(?MODULE)),
+
+ node_rep(
+ fun (Call, Args) ->
+ {badrpc,nodedown} = apply(rpc, Call, Args)
+ end, "rpc_SUITE_called_node_dies_1",
+ PA, ?MODULE, suicide, [erlang,halt,[]]),
+
+ node_rep(
+ fun (Call, Args) ->
+ {badrpc,nodedown} = apply(rpc, Call, Args)
+ end, "rpc_SUITE_called_node_dies_2",
+ PA, ?MODULE, suicide, [init,stop,[]]),
+
+ node_rep(
+ fun (Call, Args=[_|_]) ->
+ {badrpc,{'EXIT',{killed,_}}} = apply(rpc, Call, Args)
+ end, "rpc_SUITE_called_node_dies_3",
+ PA, ?MODULE, suicide, [erlang,exit,[rex,kill]]),
+
+ node_rep(
+ fun (block_call, _Args) ->
+ %% Cannot block call rpc - will hang
+ ok;
+ (Call, Args=[_|_]) ->
+ {badrpc,{'EXIT',{normal,_}}} = apply(rpc, Call, Args)
+ end, "rpc_SUITE_called_node_dies_4",
+ PA, ?MODULE, suicide, [rpc,stop,[]]),
+
ok.
node_rep(Fun, Name, PA, M, F, A) ->
- {ok, Na} = ?t:start_node(list_to_atom(Name++"_a"), slave,
- [{args, "-pa " ++ PA}]),
- Fun(a, call, [Na, M, F, A]),
- catch ?t:stop_node(Na),
- {ok, Nb} = ?t:start_node(list_to_atom(Name++"_b"), slave,
- [{args, "-pa " ++ PA}]),
- Fun(b, call, [Nb, M, F, A, infinity]),
- catch ?t:stop_node(Nb),
- {ok, Nc} = ?t:start_node(list_to_atom(Name++"_c"), slave,
- [{args, "-pa " ++ PA}]),
- Fun(c, call, [Nc, M, F, A, infinity]),
- catch ?t:stop_node(Nc),
- %%
- {ok, Nd} = ?t:start_node(list_to_atom(Name++"_d"), slave,
- [{args, "-pa " ++ PA}]),
- Fun(d, block_call, [Nd, M, F, A]),
- catch ?t:stop_node(Nd),
- {ok, Ne} = ?t:start_node(list_to_atom(Name++"_e"), slave,
- [{args, "-pa " ++ PA}]),
- Fun(e, block_call, [Ne, M, F, A, infinity]),
- catch ?t:stop_node(Ne),
- {ok, Nf} = ?t:start_node(list_to_atom(Name++"_f"), slave,
- [{args, "-pa " ++ PA}]),
- Fun(f, block_call, [Nf, M, F, A, infinity]),
- catch ?t:stop_node(Nf),
+ node_rep_call(a, call, [M,F,A], Fun, Name, PA),
+ node_rep_call(b, call, [M,F,A,infinity], Fun, Name, PA),
+ node_rep_call(c, block_call, [M,F,A], Fun, Name, PA),
+ node_rep_call(d, block_call, [M,F,A,infinity], Fun, Name, PA).
+
+node_rep_call(Tag, Call, Args, Fun, Name0, PA) ->
+ Name = list_to_atom(Name0 ++ "_" ++ atom_to_list(Tag)),
+ {ok, N} = test_server:start_node(Name, slave,
+ [{args, "-pa " ++ PA}]),
+ Fun(Call, [N|Args]),
+ catch test_server:stop_node(N),
ok.
-
-
-called_throws(doc) ->
- "OTP-3766";
+%% OTP-3766.
called_throws(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(10)),
- ?line PA = filename:dirname(code:which(?MODULE)),
+ PA = filename:dirname(code:which(?MODULE)),
%%
- ?line {ok, N} = ?t:start_node(rpc_SUITE_called_throws, slave,
- [{args, "-pa " ++ PA}]),
+ {ok, N} = test_server:start_node(rpc_SUITE_called_throws, slave,
+ [{args, "-pa " ++ PA}]),
%%
- ?line rep(fun (Tag, Call, Args) ->
- {Tag,up} =
- {Tag,apply(rpc, Call, Args)}
- end, N, erlang, throw, [up]),
- ?line rep(fun (Tag, Call, Args) ->
- {Tag,{badrpc,{'EXIT',reason}}} =
- {Tag,apply(rpc, Call, Args)}
- end, N, erlang, throw, [{'EXIT',reason}]),
+ rep(fun (Tag, Call, Args) ->
+ {Tag,up} =
+ {Tag,apply(rpc, Call, Args)}
+ end, N, erlang, throw, [up]),
+ rep(fun (Tag, Call, Args) ->
+ {Tag,{badrpc,{'EXIT',reason}}} =
+ {Tag,apply(rpc, Call, Args)}
+ end, N, erlang, throw, [{'EXIT',reason}]),
%%
- ?line ?t:stop_node(N),
- ?t:timetrap_cancel(Timetrap),
+ test_server:stop_node(N),
ok.
call_benchmark(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(120)),
PA = filename:dirname(code:which(?MODULE)),
- {ok, Node} = ?t:start_node(rpc_SUITE_call_benchmark, slave,
- [{args, "-pa " ++ PA}]),
+ {ok, Node} = test_server:start_node(rpc_SUITE_call_benchmark, slave,
+ [{args, "-pa " ++ PA}]),
Iter = case erlang:system_info(modified_timing_level) of
undefined -> 10000;
_ -> 500 %Modified timing - spawn is slower
end,
Res = do_call_benchmark(Node, Iter),
- ?t:stop_node(Node),
- ?t:timetrap_cancel(Timetrap),
+ test_server:stop_node(Node),
Res.
do_call_benchmark(Node, M) when is_integer(M), M > 0 ->
@@ -486,31 +442,28 @@ do_call_benchmark(Node, I, M) ->
do_call_benchmark(Node, I+1, M).
async_call(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:seconds(120)),
-
%% Note: First part of nodename sets response delay in seconds.
- ?line PA = filename:dirname(code:which(?MODULE)),
- ?line NodeArgs = [{args,"-pa "++ PA}],
- ?line {ok,Node1} = ?t:start_node('1_rpc_SUITE_call', slave, NodeArgs),
- ?line {ok,Node2} = ?t:start_node('10_rpc_SUITE_call', slave, NodeArgs),
- ?line {ok,Node3} = ?t:start_node('20_rpc_SUITE_call', slave, NodeArgs),
- ?line Promise1 = rpc:async_call(Node1, ?MODULE, f, []),
- ?line Promise2 = rpc:async_call(Node2, ?MODULE, f, []),
- ?line Promise3 = rpc:async_call(Node3, ?MODULE, f, []),
+ PA = filename:dirname(code:which(?MODULE)),
+ NodeArgs = [{args,"-pa "++ PA}],
+ {ok,Node1} = test_server:start_node('1_rpc_SUITE_call', slave, NodeArgs),
+ {ok,Node2} = test_server:start_node('10_rpc_SUITE_call', slave, NodeArgs),
+ {ok,Node3} = test_server:start_node('20_rpc_SUITE_call', slave, NodeArgs),
+ Promise1 = rpc:async_call(Node1, ?MODULE, f, []),
+ Promise2 = rpc:async_call(Node2, ?MODULE, f, []),
+ Promise3 = rpc:async_call(Node3, ?MODULE, f, []),
%% Test fast timeouts.
- ?line timeout = rpc:nb_yield(Promise2),
- ?line timeout = rpc:nb_yield(Promise2, 10),
+ timeout = rpc:nb_yield(Promise2),
+ timeout = rpc:nb_yield(Promise2, 10),
%% Let Node1 finish its work before yielding.
- ?t:sleep(?t:seconds(2)),
- ?line {hej,_,Node1} = rpc:yield(Promise1),
+ ct:sleep({seconds,2}),
+ {hej,_,Node1} = rpc:yield(Promise1),
%% Wait for the Node2 and Node3.
- ?line {value,{hej,_,Node2}} = rpc:nb_yield(Promise2, infinity),
- ?line {hej,_,Node3} = rpc:yield(Promise3),
+ {value,{hej,_,Node2}} = rpc:nb_yield(Promise2, infinity),
+ {hej,_,Node3} = rpc:yield(Promise3),
- ?t:timetrap_cancel(Dog),
ok.
%%%
diff --git a/lib/kernel/test/sendfile_SUITE.erl b/lib/kernel/test/sendfile_SUITE.erl
index a82b9c5fcd..775689a6bc 100644
--- a/lib/kernel/test/sendfile_SUITE.erl
+++ b/lib/kernel/test/sendfile_SUITE.erl
@@ -53,7 +53,7 @@ init_per_suite(Config) ->
{{unix,sunos}, {5,8,_}} ->
{skip, "Solaris 8 not supported for now"};
_ ->
- Priv = ?config(priv_dir, Config),
+ Priv = proplists:get_value(priv_dir, Config),
SFilename = filename:join(Priv, "sendfile_small.html"),
{ok, DS} = file:open(SFilename,[write,raw]),
file:write(DS,"yo baby yo"),
diff --git a/lib/kernel/test/seq_trace_SUITE.erl b/lib/kernel/test/seq_trace_SUITE.erl
index fb6f62d2e5..15128ab69c 100644
--- a/lib/kernel/test/seq_trace_SUITE.erl
+++ b/lib/kernel/test/seq_trace_SUITE.erl
@@ -27,12 +27,11 @@
trace_exit/1, distributed_exit/1, call/1, port/1,
match_set_seq_token/1, gc_seq_token/1]).
-% internal exports
+%% internal exports
-export([simple_tracer/2, one_time_receiver/0, one_time_receiver/1,
start_tracer/0, stop_tracer/1,
do_match_set_seq_token/1, do_gc_seq_token/1, countdown_start/2]).
- %-define(line_trace, 1).
-include_lib("common_test/include/ct.hrl").
-define(TIMESTAMP_MODES, [no_timestamp,
@@ -40,9 +39,9 @@
monotonic_timestamp,
strict_monotonic_timestamp]).
--define(default_timeout, ?t:minutes(1)).
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[token_set_get, tracer_set_get, print, send,
@@ -67,18 +66,13 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- ?line Dog = test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
%% Verifies that the set_token and get_token functions work as expected
-token_set_get(doc) -> [];
-token_set_get(suite) -> [];
token_set_get(Config) when is_list(Config) ->
do_token_set_get(timestamp),
do_token_set_get(monotonic_timestamp),
@@ -91,371 +85,351 @@ do_token_set_get(TsType) ->
strict_monotonic_timestamp -> 23;
monotonic_timestamp -> 39
end,
- ?line Self = self(),
- ?line seq_trace:reset_trace(),
+ Self = self(),
+ seq_trace:reset_trace(),
%% Test that initial seq_trace is disabled
- ?line [] = seq_trace:get_token(),
+ [] = seq_trace:get_token(),
%% Test setting and reading the different fields
- ?line 0 = seq_trace:set_token(label,17),
- ?line {label,17} = seq_trace:get_token(label),
- ?line false = seq_trace:set_token(print,true),
- ?line {print,true} = seq_trace:get_token(print),
- ?line false = seq_trace:set_token(send,true),
- ?line {send,true} = seq_trace:get_token(send),
- ?line false = seq_trace:set_token('receive',true),
- ?line {'receive',true} = seq_trace:get_token('receive'),
- ?line false = seq_trace:set_token(TsType,true),
- ?line {TsType,true} = seq_trace:get_token(TsType),
+ 0 = seq_trace:set_token(label,17),
+ {label,17} = seq_trace:get_token(label),
+ false = seq_trace:set_token(print,true),
+ {print,true} = seq_trace:get_token(print),
+ false = seq_trace:set_token(send,true),
+ {send,true} = seq_trace:get_token(send),
+ false = seq_trace:set_token('receive',true),
+ {'receive',true} = seq_trace:get_token('receive'),
+ false = seq_trace:set_token(TsType,true),
+ {TsType,true} = seq_trace:get_token(TsType),
%% Check the whole token
- ?line {Flags,17,0,Self,0} = seq_trace:get_token(), % all flags are set
+ {Flags,17,0,Self,0} = seq_trace:get_token(), % all flags are set
%% Test setting and reading the 'serial' field
- ?line {0,0} = seq_trace:set_token(serial,{3,5}),
- ?line {serial,{3,5}} = seq_trace:get_token(serial),
+ {0,0} = seq_trace:set_token(serial,{3,5}),
+ {serial,{3,5}} = seq_trace:get_token(serial),
%% Check the whole token, test that a whole token can be set and get
- ?line {Flags,17,5,Self,3} = seq_trace:get_token(),
- ?line seq_trace:set_token({Flags,19,7,Self,5}),
- ?line {Flags,19,7,Self,5} = seq_trace:get_token(),
+ {Flags,17,5,Self,3} = seq_trace:get_token(),
+ seq_trace:set_token({Flags,19,7,Self,5}),
+ {Flags,19,7,Self,5} = seq_trace:get_token(),
%% Check that receive timeout does not reset token
- ?line receive after 0 -> ok end,
- ?line {Flags,19,7,Self,5} = seq_trace:get_token(),
+ receive after 0 -> ok end,
+ {Flags,19,7,Self,5} = seq_trace:get_token(),
%% Check that token can be unset
- ?line {Flags,19,7,Self,5} = seq_trace:set_token([]),
- ?line [] = seq_trace:get_token(),
+ {Flags,19,7,Self,5} = seq_trace:set_token([]),
+ [] = seq_trace:get_token(),
%% Check that Previous serial counter survived unset token
- ?line 0 = seq_trace:set_token(label, 17),
- ?line {0,17,0,Self,5} = seq_trace:get_token(),
+ 0 = seq_trace:set_token(label, 17),
+ {0,17,0,Self,5} = seq_trace:get_token(),
%% Check that reset_trace resets the token and clears
%% the Previous serial counter
- ?line seq_trace:reset_trace(),
- ?line [] = seq_trace:get_token(),
- ?line 0 = seq_trace:set_token(label, 19),
- ?line {0,19,0,Self,0} = seq_trace:get_token(),
+ seq_trace:reset_trace(),
+ [] = seq_trace:get_token(),
+ 0 = seq_trace:set_token(label, 19),
+ {0,19,0,Self,0} = seq_trace:get_token(),
%% Cleanup
- ?line seq_trace:reset_trace(),
+ seq_trace:reset_trace(),
ok.
-tracer_set_get(doc) -> [];
-tracer_set_get(suite) -> [];
tracer_set_get(Config) when is_list(Config) ->
- ?line Self = self(),
- ?line seq_trace:set_system_tracer(self()),
- ?line Self = seq_trace:get_system_tracer(),
- ?line Self = seq_trace:set_system_tracer(false),
- ?line false = seq_trace:get_system_tracer(),
+ Self = self(),
+ seq_trace:set_system_tracer(self()),
+ Self = seq_trace:get_system_tracer(),
+ Self = seq_trace:set_system_tracer(false),
+ false = seq_trace:get_system_tracer(),
%% Set the system tracer to a port.
- ?line Port = load_tracer(Config),
- ?line seq_trace:set_system_tracer(Port),
- ?line Port = seq_trace:get_system_tracer(),
- ?line Port = seq_trace:set_system_tracer(false),
- ?line false = seq_trace:get_system_tracer(),
+ Port = load_tracer(Config),
+ seq_trace:set_system_tracer(Port),
+ Port = seq_trace:get_system_tracer(),
+ Port = seq_trace:set_system_tracer(false),
+ false = seq_trace:get_system_tracer(),
ok.
-print(doc) -> [];
-print(suite) -> [];
print(Config) when is_list(Config) ->
lists:foreach(fun do_print/1, ?TIMESTAMP_MODES).
do_print(TsType) ->
- ?line start_tracer(),
- ?line set_token_flags([print, TsType]),
- ?line seq_trace:print(0,print1),
- ?line seq_trace:print(1,print2),
- ?line seq_trace:print(print3),
- ?line seq_trace:reset_trace(),
- ?line [{0,{print,_,_,[],print1}, Ts0},
+ start_tracer(),
+ set_token_flags([print, TsType]),
+ seq_trace:print(0,print1),
+ seq_trace:print(1,print2),
+ seq_trace:print(print3),
+ seq_trace:reset_trace(),
+ [{0,{print,_,_,[],print1}, Ts0},
{0,{print,_,_,[],print3}, Ts1}] = stop_tracer(2),
check_ts(TsType, Ts0),
check_ts(TsType, Ts1).
-send(doc) -> [];
-send(suite) -> [];
send(Config) when is_list(Config) ->
lists:foreach(fun do_send/1, ?TIMESTAMP_MODES).
do_send(TsType) ->
- ?line seq_trace:reset_trace(),
- ?line start_tracer(),
- ?line Receiver = spawn(?MODULE,one_time_receiver,[]),
- ?line set_token_flags([send, TsType]),
- ?line Receiver ! send,
- ?line Self = self(),
- ?line seq_trace:reset_trace(),
- ?line [{0,{send,_,Self,Receiver,send}, Ts}] = stop_tracer(1),
+ seq_trace:reset_trace(),
+ start_tracer(),
+ Receiver = spawn(?MODULE,one_time_receiver,[]),
+ set_token_flags([send, TsType]),
+ Receiver ! send,
+ Self = self(),
+ seq_trace:reset_trace(),
+ [{0,{send,_,Self,Receiver,send}, Ts}] = stop_tracer(1),
check_ts(TsType, Ts).
-distributed_send(doc) -> [];
-distributed_send(suite) -> [];
distributed_send(Config) when is_list(Config) ->
lists:foreach(fun do_distributed_send/1, ?TIMESTAMP_MODES).
do_distributed_send(TsType) ->
- ?line {ok,Node} = start_node(seq_trace_other,[]),
- ?line {_,Dir} = code:is_loaded(?MODULE),
- ?line Mdir = filename:dirname(Dir),
- ?line true = rpc:call(Node,code,add_patha,[Mdir]),
- ?line seq_trace:reset_trace(),
- ?line start_tracer(),
- ?line Receiver = spawn(Node,?MODULE,one_time_receiver,[]),
- ?line set_token_flags([send,TsType]),
- ?line Receiver ! send,
- ?line Self = self(),
- ?line seq_trace:reset_trace(),
- ?line stop_node(Node),
- ?line [{0,{send,_,Self,Receiver,send}, Ts}] = stop_tracer(1),
+ {ok,Node} = start_node(seq_trace_other,[]),
+ {_,Dir} = code:is_loaded(?MODULE),
+ Mdir = filename:dirname(Dir),
+ true = rpc:call(Node,code,add_patha,[Mdir]),
+ seq_trace:reset_trace(),
+ start_tracer(),
+ Receiver = spawn(Node,?MODULE,one_time_receiver,[]),
+ set_token_flags([send,TsType]),
+ Receiver ! send,
+ Self = self(),
+ seq_trace:reset_trace(),
+ stop_node(Node),
+ [{0,{send,_,Self,Receiver,send}, Ts}] = stop_tracer(1),
check_ts(TsType, Ts).
-recv(doc) -> [];
-recv(suite) -> [];
recv(Config) when is_list(Config) ->
lists:foreach(fun do_recv/1, ?TIMESTAMP_MODES).
do_recv(TsType) ->
- ?line seq_trace:reset_trace(),
- ?line start_tracer(),
- ?line Receiver = spawn(?MODULE,one_time_receiver,[]),
- ?line set_token_flags(['receive',TsType]),
- ?line Receiver ! 'receive',
+ seq_trace:reset_trace(),
+ start_tracer(),
+ Receiver = spawn(?MODULE,one_time_receiver,[]),
+ set_token_flags(['receive',TsType]),
+ Receiver ! 'receive',
%% let the other process receive the message:
- ?line receive after 1 -> ok end,
- ?line Self = self(),
- ?line seq_trace:reset_trace(),
- ?line [{0,{'receive',_,Self,Receiver,'receive'}, Ts}] = stop_tracer(1),
+ receive after 1 -> ok end,
+ Self = self(),
+ seq_trace:reset_trace(),
+ [{0,{'receive',_,Self,Receiver,'receive'}, Ts}] = stop_tracer(1),
check_ts(TsType, Ts).
-distributed_recv(doc) -> [];
-distributed_recv(suite) -> [];
distributed_recv(Config) when is_list(Config) ->
lists:foreach(fun do_distributed_recv/1, ?TIMESTAMP_MODES).
do_distributed_recv(TsType) ->
- ?line {ok,Node} = start_node(seq_trace_other,[]),
- ?line {_,Dir} = code:is_loaded(?MODULE),
- ?line Mdir = filename:dirname(Dir),
- ?line true = rpc:call(Node,code,add_patha,[Mdir]),
- ?line seq_trace:reset_trace(),
- ?line rpc:call(Node,?MODULE,start_tracer,[]),
- ?line Receiver = spawn(Node,?MODULE,one_time_receiver,[]),
- ?line set_token_flags(['receive',TsType]),
- ?line Receiver ! 'receive',
+ {ok,Node} = start_node(seq_trace_other,[]),
+ {_,Dir} = code:is_loaded(?MODULE),
+ Mdir = filename:dirname(Dir),
+ true = rpc:call(Node,code,add_patha,[Mdir]),
+ seq_trace:reset_trace(),
+ rpc:call(Node,?MODULE,start_tracer,[]),
+ Receiver = spawn(Node,?MODULE,one_time_receiver,[]),
+ set_token_flags(['receive',TsType]),
+ Receiver ! 'receive',
%% let the other process receive the message:
- ?line receive after 1 -> ok end,
- ?line Self = self(),
- ?line seq_trace:reset_trace(),
- ?line Result = rpc:call(Node,?MODULE,stop_tracer,[1]),
- ?line stop_node(Node),
- ?line ok = io:format("~p~n",[Result]),
- ?line [{0,{'receive',_,Self,Receiver,'receive'}, Ts}] = Result,
+ receive after 1 -> ok end,
+ Self = self(),
+ seq_trace:reset_trace(),
+ Result = rpc:call(Node,?MODULE,stop_tracer,[1]),
+ stop_node(Node),
+ ok = io:format("~p~n",[Result]),
+ [{0,{'receive',_,Self,Receiver,'receive'}, Ts}] = Result,
check_ts(TsType, Ts).
-trace_exit(doc) -> [];
-trace_exit(suite) -> [];
trace_exit(Config) when is_list(Config) ->
lists:foreach(fun do_trace_exit/1, ?TIMESTAMP_MODES).
do_trace_exit(TsType) ->
- ?line seq_trace:reset_trace(),
- ?line start_tracer(),
- ?line Receiver = spawn_link(?MODULE, one_time_receiver, [exit]),
- ?line process_flag(trap_exit, true),
- ?line set_token_flags([send, TsType]),
- ?line Receiver ! {before, exit},
+ seq_trace:reset_trace(),
+ start_tracer(),
+ Receiver = spawn_link(?MODULE, one_time_receiver, [exit]),
+ process_flag(trap_exit, true),
+ set_token_flags([send, TsType]),
+ Receiver ! {before, exit},
%% let the other process receive the message:
- ?line receive
+ receive
{'EXIT', Receiver, {exit, {before, exit}}} ->
seq_trace:set_token([]);
Other ->
seq_trace:set_token([]),
- ?t:fail({received, Other})
+ ct:fail({received, Other})
end,
- ?line Self = self(),
- ?line Result = stop_tracer(2),
- ?line seq_trace:reset_trace(),
- ?line ok = io:format("~p~n", [Result]),
- ?line [{0, {send, {0,1}, Self, Receiver, {before, exit}}, Ts0},
+ Self = self(),
+ Result = stop_tracer(2),
+ seq_trace:reset_trace(),
+ ok = io:format("~p~n", [Result]),
+ [{0, {send, {0,1}, Self, Receiver, {before, exit}}, Ts0},
{0, {send, {1,2}, Receiver, Self,
{'EXIT', Receiver, {exit, {before, exit}}}}, Ts1}] = Result,
check_ts(TsType, Ts0),
check_ts(TsType, Ts1).
-distributed_exit(doc) -> [];
-distributed_exit(suite) -> [];
distributed_exit(Config) when is_list(Config) ->
lists:foreach(fun do_distributed_exit/1, ?TIMESTAMP_MODES).
do_distributed_exit(TsType) ->
- ?line {ok, Node} = start_node(seq_trace_other, []),
- ?line {_, Dir} = code:is_loaded(?MODULE),
- ?line Mdir = filename:dirname(Dir),
- ?line true = rpc:call(Node, code, add_patha, [Mdir]),
- ?line seq_trace:reset_trace(),
- ?line rpc:call(Node, ?MODULE, start_tracer,[]),
- ?line Receiver = spawn_link(Node, ?MODULE, one_time_receiver, [exit]),
- ?line process_flag(trap_exit, true),
- ?line set_token_flags([send, TsType]),
- ?line Receiver ! {before, exit},
+ {ok, Node} = start_node(seq_trace_other, []),
+ {_, Dir} = code:is_loaded(?MODULE),
+ Mdir = filename:dirname(Dir),
+ true = rpc:call(Node, code, add_patha, [Mdir]),
+ seq_trace:reset_trace(),
+ rpc:call(Node, ?MODULE, start_tracer,[]),
+ Receiver = spawn_link(Node, ?MODULE, one_time_receiver, [exit]),
+ process_flag(trap_exit, true),
+ set_token_flags([send, TsType]),
+ Receiver ! {before, exit},
%% let the other process receive the message:
- ?line receive
+ receive
{'EXIT', Receiver, {exit, {before, exit}}} ->
seq_trace:set_token([]);
Other ->
seq_trace:set_token([]),
- ?t:fail({received, Other})
+ ct:fail({received, Other})
end,
- ?line Self = self(),
- ?line Result = rpc:call(Node, ?MODULE, stop_tracer, [1]),
- ?line seq_trace:reset_trace(),
- ?line stop_node(Node),
- ?line ok = io:format("~p~n", [Result]),
- ?line [{0, {send, {1, 2}, Receiver, Self,
+ Self = self(),
+ Result = rpc:call(Node, ?MODULE, stop_tracer, [1]),
+ seq_trace:reset_trace(),
+ stop_node(Node),
+ ok = io:format("~p~n", [Result]),
+ [{0, {send, {1, 2}, Receiver, Self,
{'EXIT', Receiver, {exit, {before, exit}}}}, Ts}] = Result,
check_ts(TsType, Ts).
call(doc) ->
"Tests special forms {is_seq_trace} and {get_seq_token} "
"in trace match specs.";
-call(suite) ->
- [];
call(Config) when is_list(Config) ->
- ?line Self = self(),
- ?line seq_trace:reset_trace(),
- ?line TrA = transparent_tracer(),
- ?line 1 =
+ Self = self(),
+ seq_trace:reset_trace(),
+ TrA = transparent_tracer(),
+ 1 =
erlang:trace(Self, true,
[call, set_on_spawn, {tracer, TrA(pid)}]),
- ?line 1 =
+ 1 =
erlang:trace_pattern({?MODULE, call_tracee_1, 1},
[{'_',
[],
[{message, {{{self}, {get_seq_token}}}}]}],
[local]),
- ?line 1 =
+ 1 =
erlang:trace_pattern({?MODULE, call_tracee_2, 1},
[{'_',
[{is_seq_trace}],
[{message, {{{self}, {get_seq_token}}}}]}],
[local]),
- ?line RefA = make_ref(),
- ?line Pid2A = spawn_link(
+ RefA = make_ref(),
+ Pid2A = spawn_link(
fun() ->
receive {_, msg, RefA} -> ok end,
RefA = call_tracee_2(RefA),
Self ! {self(), msg, RefA}
end),
- ?line Pid1A = spawn_link(
+ Pid1A = spawn_link(
fun() ->
receive {_, msg, RefA} -> ok end,
RefA = call_tracee_1(RefA),
Pid2A ! {self(), msg, RefA}
end),
- ?line Pid1A ! {Self, msg, RefA},
+ Pid1A ! {Self, msg, RefA},
%% The message is passed Self -> Pid1B -> Pid2B -> Self.
%% Traced functions are called in Pid1B and Pid2B.
- ?line receive {Pid2A, msg, RefA} -> ok end,
+ receive {Pid2A, msg, RefA} -> ok end,
%% Only call_tracee1 will be traced since the guard for
%% call_tracee2 requires a sequential trace. The trace
%% token is undefined.
- ?line Token2A = [],
- ?line {ok, [{trace, Pid1A, call,
+ Token2A = [],
+ {ok, [{trace, Pid1A, call,
{?MODULE, call_tracee_1, [RefA]},
{Pid1A, Token2A}}]} =
TrA({stop, 1}),
- ?line seq_trace:reset_trace(),
+ seq_trace:reset_trace(),
- ?line TrB = transparent_tracer(),
- ?line 1 =
+ TrB = transparent_tracer(),
+ 1 =
erlang:trace(Self, true,
[call, set_on_spawn, {tracer, TrB(pid)}]),
- ?line Label = 17,
- ?line seq_trace:set_token(label, Label), % Token enters here!!
- ?line RefB = make_ref(),
- ?line Pid2B = spawn_link(
+ Label = 17,
+ seq_trace:set_token(label, Label), % Token enters here!!
+ RefB = make_ref(),
+ Pid2B = spawn_link(
fun() ->
receive {_, msg, RefB} -> ok end,
RefB = call_tracee_2(RefB),
Self ! {self(), msg, RefB}
end),
- ?line Pid1B = spawn_link(
+ Pid1B = spawn_link(
fun() ->
receive {_, msg, RefB} -> ok end,
RefB = call_tracee_1(RefB),
Pid2B ! {self(), msg, RefB}
end),
- ?line Pid1B ! {Self, msg, RefB},
+ Pid1B ! {Self, msg, RefB},
%% The message is passed Self -> Pid1B -> Pid2B -> Self, and the
%% seq_trace token follows invisibly. Traced functions are
%% called in Pid1B and Pid2B. Seq_trace flags == 0 so no
%% seq_trace messages are generated.
- ?line receive {Pid2B, msg, RefB} -> ok end,
+ receive {Pid2B, msg, RefB} -> ok end,
%% The values of these counters {.., 1, _, 0}, {.., 2, _, 1}
%% depend on that seq_trace has been reset just before this test.
- ?line Token1B = {0, Label, 1, Self, 0},
- ?line Token2B = {0, Label, 2, Pid1B, 1},
- ?line {ok, [{trace, Pid1B, call,
+ Token1B = {0, Label, 1, Self, 0},
+ Token2B = {0, Label, 2, Pid1B, 1},
+ {ok, [{trace, Pid1B, call,
{?MODULE, call_tracee_1, [RefB]},
{Pid1B, Token1B}},
{trace, Pid2B, call,
{?MODULE, call_tracee_2, [RefB]},
{Pid2B, Token2B}}]} =
TrB({stop,2}),
- ?line seq_trace:reset_trace(),
+ seq_trace:reset_trace(),
ok.
-port(doc) ->
- "Send trace messages to a port.";
-port(suite) -> [];
+%% Send trace messages to a port.
port(Config) when is_list(Config) ->
lists:foreach(fun (TsType) -> do_port(TsType, Config) end,
?TIMESTAMP_MODES).
do_port(TsType, Config) ->
io:format("Testing ~p~n",[TsType]),
- ?line Port = load_tracer(Config),
- ?line seq_trace:set_system_tracer(Port),
+ Port = load_tracer(Config),
+ seq_trace:set_system_tracer(Port),
- ?line set_token_flags([print, TsType]),
- ?line Small = [small,term],
- ?line seq_trace:print(0, Small),
- ?line case get_port_message(Port) of
+ set_token_flags([print, TsType]),
+ Small = [small,term],
+ seq_trace:print(0, Small),
+ case get_port_message(Port) of
{seq_trace,0,{print,_,_,[],Small}} when TsType == no_timestamp ->
ok;
{seq_trace,0,{print,_,_,[],Small},Ts0} when TsType /= no_timestamp ->
check_ts(TsType, Ts0),
ok;
Other ->
- ?line seq_trace:reset_trace(),
- ?line ?t:fail({unexpected,Other})
+ seq_trace:reset_trace(),
+ ct:fail({unexpected,Other})
end,
%% OTP-4218 Messages from ports should not affect seq trace token.
%%
%% Check if trace token still is active on this process after
%% the get_port_message/1 above that receives from a port.
- ?line OtherSmall = [other | Small],
- ?line seq_trace:print(0, OtherSmall),
- ?line seq_trace:reset_trace(),
- ?line case get_port_message(Port) of
+ OtherSmall = [other | Small],
+ seq_trace:print(0, OtherSmall),
+ seq_trace:reset_trace(),
+ case get_port_message(Port) of
{seq_trace,0,{print,_,_,[],OtherSmall}} when TsType == no_timestamp ->
ok;
{seq_trace,0,{print,_,_,[],OtherSmall}, Ts1} when TsType /= no_timestamp ->
check_ts(TsType, Ts1),
ok;
Other1 ->
- ?line ?t:fail({unexpected,Other1})
+ ct:fail({unexpected,Other1})
end,
- ?line seq_trace:set_token(print, true),
- ?line Huge = huge_data(),
- ?line seq_trace:print(0, Huge),
- ?line seq_trace:reset_trace(),
- ?line case get_port_message(Port) of
+ seq_trace:set_token(print, true),
+ Huge = huge_data(),
+ seq_trace:print(0, Huge),
+ seq_trace:reset_trace(),
+ case get_port_message(Port) of
{seq_trace,0,{print,_,_,[],Huge}} ->
ok;
Other2 ->
- ?line ?t:fail({unexpected,Other2})
+ ct:fail({unexpected,Other2})
end,
unlink(Port),
exit(Port,kill),
@@ -466,21 +440,19 @@ get_port_message(Port) ->
{Port,{data,Bin}} when is_binary(Bin) ->
binary_to_term(Bin);
Other ->
- ?t:fail({unexpected,Other})
+ ct:fail({unexpected,Other})
after 5000 ->
- ?t:fail(timeout)
+ ct:fail(timeout)
end.
-match_set_seq_token(suite) ->
- [];
match_set_seq_token(doc) ->
["Tests that match spec function set_seq_token does not "
"corrupt the heap"];
match_set_seq_token(Config) when is_list(Config) ->
- ?line Parent = self(),
- ?line Timetrap = test_server:timetrap(test_server:seconds(20)),
+ Parent = self(),
+
%% OTP-4222 Match spec 'set_seq_token' corrupts heap
%%
%% This test crashes the emulator if the bug in question is present,
@@ -488,13 +460,13 @@ match_set_seq_token(Config) when is_list(Config) ->
%%
%% All the timeout stuff is here to get decent accuracy of the error
%% return value, instead of just 'timeout'.
- %
- ?line {ok, Sandbox} = start_node(seq_trace_other, []),
- ?line true = rpc:call(Sandbox, code, add_patha,
+ %%
+ {ok, Sandbox} = start_node(seq_trace_other, []),
+ true = rpc:call(Sandbox, code, add_patha,
[filename:dirname(code:which(?MODULE))]),
- ?line Lbl = 4711,
+ Lbl = 4711,
%% Do the possibly crashing test
- ?line P1 =
+ P1 =
spawn(
fun () ->
Parent ! {self(),
@@ -502,16 +474,16 @@ match_set_seq_token(Config) when is_list(Config) ->
?MODULE, do_match_set_seq_token, [Lbl])}
end),
%% Probe the node with a simple rpc request, to see if it is alive.
- ?line P2 =
+ P2 =
spawn(
fun () ->
receive after 4000 -> ok end,
Parent ! {self(), rpc:call(Sandbox, erlang, abs, [-1])}
end),
%% If the test node hangs completely, this timer expires.
- ?line R3 = erlang:start_timer(8000, self(), void),
+ R3 = erlang:start_timer(8000, self(), void),
%%
- ?line {ok, Log} =
+ {ok, Log} =
receive
{P1, Result} ->
exit(P2, done),
@@ -526,10 +498,9 @@ match_set_seq_token(Config) when is_list(Config) ->
exit(P2, timeout),
{error, "Test node hung"}
end,
- ?line ok = check_match_set_seq_token_log(Lbl, Log),
+ ok = check_match_set_seq_token_log(Lbl, Log),
%%
- ?line stop_node(Sandbox),
- ?line test_server:timetrap_cancel(Timetrap),
+ stop_node(Sandbox),
ok.
%% OTP-4222 Match spec 'set_seq_token' corrupts heap
@@ -621,14 +592,12 @@ bounce(Ref) ->
-gc_seq_token(suite) ->
- [];
gc_seq_token(doc) ->
["Tests that a seq_trace token on a message in the inqueue ",
"can be garbage collected."];
gc_seq_token(Config) when is_list(Config) ->
- ?line Parent = self(),
- ?line Timetrap = test_server:timetrap(test_server:seconds(20)),
+ Parent = self(),
+
%% OTP-4555 Seq trace token causes free mem read in gc
%%
%% This test crashes the emulator if the bug in question is present,
@@ -636,13 +605,13 @@ gc_seq_token(Config) when is_list(Config) ->
%%
%% All the timeout stuff is here to get decent accuracy of the error
%% return value, instead of just 'timeout'.
- %
- ?line {ok, Sandbox} = start_node(seq_trace_other, []),
- ?line true = rpc:call(Sandbox, code, add_patha,
+ %%
+ {ok, Sandbox} = start_node(seq_trace_other, []),
+ true = rpc:call(Sandbox, code, add_patha,
[filename:dirname(code:which(?MODULE))]),
- ?line Label = 4711,
+ Label = 4711,
%% Do the possibly crashing test
- ?line P1 =
+ P1 =
spawn(
fun () ->
Parent ! {self(),
@@ -650,16 +619,16 @@ gc_seq_token(Config) when is_list(Config) ->
?MODULE, do_gc_seq_token, [Label])}
end),
%% Probe the node with a simple rpc request, to see if it is alive.
- ?line P2 =
+ P2 =
spawn(
fun () ->
receive after 4000 -> ok end,
Parent ! {self(), rpc:call(Sandbox, erlang, abs, [-1])}
end),
%% If the test node hangs completely, this timer expires.
- ?line R3 = erlang:start_timer(8000, self(), void),
+ R3 = erlang:start_timer(8000, self(), void),
%%
- ?line ok =
+ ok =
receive
{P1, Result} ->
exit(P2, done),
@@ -675,8 +644,7 @@ gc_seq_token(Config) when is_list(Config) ->
{error, "Test node hung"}
end,
%%
- ?line stop_node(Sandbox),
- ?line test_server:timetrap_cancel(Timetrap),
+ stop_node(Sandbox),
ok.
do_gc_seq_token(Label) ->
@@ -836,7 +804,7 @@ check_ts(no_timestamp, Ts) ->
no_timestamp = Ts
catch
_ : _ ->
- ?t:fail({unexpected_timestamp, Ts})
+ ct:fail({unexpected_timestamp, Ts})
end,
ok;
check_ts(timestamp, Ts) ->
@@ -847,7 +815,7 @@ check_ts(timestamp, Ts) ->
true = is_integer(Us)
catch
_ : _ ->
- ?t:fail({unexpected_timestamp, Ts})
+ ct:fail({unexpected_timestamp, Ts})
end,
ok;
check_ts(monotonic_timestamp, Ts) ->
@@ -855,7 +823,7 @@ check_ts(monotonic_timestamp, Ts) ->
true = is_integer(Ts)
catch
_ : _ ->
- ?t:fail({unexpected_timestamp, Ts})
+ ct:fail({unexpected_timestamp, Ts})
end,
ok;
check_ts(strict_monotonic_timestamp, Ts) ->
@@ -865,7 +833,7 @@ check_ts(strict_monotonic_timestamp, Ts) ->
true = is_integer(UMI)
catch
_ : _ ->
- ?t:fail({unexpected_timestamp, Ts})
+ ct:fail({unexpected_timestamp, Ts})
end,
ok.
@@ -876,7 +844,7 @@ stop_node(Node) ->
test_server:stop_node(Node).
load_tracer(Config) ->
- Path = ?config(data_dir, Config),
+ Path = proplists:get_value(data_dir, Config),
ok = erl_ddll:load_driver(Path, echo_drv),
open_port({spawn,echo_drv}, [eof,binary]).
diff --git a/lib/kernel/test/wrap_log_reader_SUITE.erl b/lib/kernel/test/wrap_log_reader_SUITE.erl
index 27ff98dc17..c797354a3e 100644
--- a/lib/kernel/test/wrap_log_reader_SUITE.erl
+++ b/lib/kernel/test/wrap_log_reader_SUITE.erl
@@ -20,7 +20,7 @@
-module(wrap_log_reader_SUITE).
-%-define(debug, true).
+%%-define(debug, true).
-ifdef(debug).
-define(format(S, A), io:format(S, A)).
@@ -31,7 +31,7 @@
-else.
-include_lib("common_test/include/ct.hrl").
-define(format(S, A), ok).
--define(privdir(Conf), ?config(priv_dir, Conf)).
+-define(privdir(Conf), proplists:get_value(priv_dir, Conf)).
-endif.
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
@@ -47,7 +47,9 @@
-export([init_per_testcase/2, end_per_testcase/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[no_file, {group, one}, {group, two}, {group, four},
@@ -71,75 +73,70 @@ end_per_group(_GroupName, Config) ->
Config.
-init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
- Dog=?t:timetrap(?t:seconds(60)),
- [{watchdog, Dog} | Config].
+init_per_testcase(Func, Config) ->
+ Config.
end_per_testcase(_Func, _Config) ->
- Dog=?config(watchdog, _Config),
- ?t:timetrap_cancel(Dog).
+ ok.
-no_file(suite) -> [];
-no_file(doc) -> ["No log file exists"];
+%% No log file exists.
no_file(Conf) when is_list(Conf) ->
- ?line code:add_path(?config(data_dir,Conf)),
+ code:add_path(proplists:get_value(data_dir,Conf)),
Dir = ?privdir(Conf),
File = join(Dir, "sune.LOG"),
delete_files(File),
start(),
wlt ! {open, self(), File},
- ?line rec({error, {index_file_not_found, File}}, ?LINE),
+ rec({error, {index_file_not_found, File}}, ?LINE),
wlt ! {open, self(), File, 1},
- ?line rec({error, {index_file_not_found, File}}, ?LINE),
+ rec({error, {index_file_not_found, File}}, ?LINE),
wlt ! {open, self(), File, 4},
- ?line rec({error, {index_file_not_found, File}}, ?LINE),
+ rec({error, {index_file_not_found, File}}, ?LINE),
stop(),
delete_files(File),
ok.
-one_empty(suite) -> [];
-one_empty(doc) -> ["One empty index file"];
+%% One empty index file.
one_empty(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = join(Dir, "sune.LOG"),
delete_files(File),
start(),
- ?line open(sune, File, ?LINE),
+ open(sune, File, ?LINE),
%% open
- ?line do_chunk([{open,File}, eof], wlt, ?LINE),
- ?line do_chunk([{open,File,1}, eof], wlt, ?LINE),
+ do_chunk([{open,File}, eof], wlt, ?LINE),
+ do_chunk([{open,File,1}, eof], wlt, ?LINE),
wlt ! {open, self(), File, 2},
- ?line rec({error, {file_not_found, add_ext(File, 2)}}, ?LINE),
- ?line close(sune),
+ rec({error, {file_not_found, add_ext(File, 2)}}, ?LINE),
+ close(sune),
%% closed
- ?line do_chunk([{open,File}, eof], wlt, ?LINE),
- ?line do_chunk([{open,File,1}, eof], wlt, ?LINE),
+ do_chunk([{open,File}, eof], wlt, ?LINE),
+ do_chunk([{open,File,1}, eof], wlt, ?LINE),
wlt ! {open, self(), File, 2},
- ?line rec({error, {file_not_found, add_ext(File, 2)}}, ?LINE),
+ rec({error, {file_not_found, add_ext(File, 2)}}, ?LINE),
stop(),
delete_files(File),
ok.
-one_filled(suite) -> [];
-one_filled(doc) -> ["One filled index file"];
+%% One filled index file.
one_filled(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = join(Dir, "sune.LOG"),
delete_files(File),
start(),
- ?line open(sune, File, ?LINE),
- ?line log_terms(sune, ["first round, one", "first round, two"]),
- ?line sync(sune),
+ open(sune, File, ?LINE),
+ log_terms(sune, ["first round, one", "first round, two"]),
+ sync(sune),
%% open
test_one(File),
- ?line close(sune),
+ close(sune),
%% closed
test_one(File),
@@ -148,34 +145,33 @@ one_filled(Conf) when is_list(Conf) ->
ok.
test_one(File) ->
- ?line do_chunk([{open,File},
- {chunk, ["first round, one", "first round, two"]},
- eof], wlt, ?LINE),
- ?line do_chunk([{open,File,1},
- {chunk, ["first round, one", "first round, two"]},
- eof], wlt, ?LINE),
+ do_chunk([{open,File},
+ {chunk, ["first round, one", "first round, two"]},
+ eof], wlt, ?LINE),
+ do_chunk([{open,File,1},
+ {chunk, ["first round, one", "first round, two"]},
+ eof], wlt, ?LINE),
wlt ! {open, self(), File, 2},
- ?line rec({error, {file_not_found, add_ext(File, 2)}}, ?LINE),
- ?line do_chunk([{open,File,1}, {chunk, 1, ["first round, one"]},
- {chunk, 1, ["first round, two"]}, eof], wlt, ?LINE),
+ rec({error, {file_not_found, add_ext(File, 2)}}, ?LINE),
+ do_chunk([{open,File,1}, {chunk, 1, ["first round, one"]},
+ {chunk, 1, ["first round, two"]}, eof], wlt, ?LINE),
ok.
-two_filled(suite) -> [];
-two_filled(doc) -> ["Two filled index files"];
+%% Two filled index files.
two_filled(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = list_to_atom(join(Dir, "sune.LOG")),
delete_files(File),
start(),
- ?line open(sune, File, ?LINE),
- ?line log_terms(sune, ["first round, 11", "first round, 12"]),
- ?line log_terms(sune, ["first round, 21", "first round, 22"]),
- ?line sync(sune),
+ open(sune, File, ?LINE),
+ log_terms(sune, ["first round, 11", "first round, 12"]),
+ log_terms(sune, ["first round, 21", "first round, 22"]),
+ sync(sune),
%% open
test_two(File),
- ?line close(sune),
+ close(sune),
%% closed
test_two(File),
@@ -184,37 +180,36 @@ two_filled(Conf) when is_list(Conf) ->
ok.
test_two(File) ->
- ?line do_chunk([{open,File},
- {chunk, infinity, ["first round, 11", "first round, 12"]},
- {chunk, ["first round, 21", "first round, 22"]},
- eof], wlt, ?LINE),
- ?line do_chunk([{open,File,1},
- {chunk, ["first round, 11", "first round, 12"]},
- eof], wlt, ?LINE),
- ?line do_chunk([{open,File,2},
- {chunk, ["first round, 21", "first round, 22"]},
- eof], wlt, ?LINE),
+ do_chunk([{open,File},
+ {chunk, infinity, ["first round, 11", "first round, 12"]},
+ {chunk, ["first round, 21", "first round, 22"]},
+ eof], wlt, ?LINE),
+ do_chunk([{open,File,1},
+ {chunk, ["first round, 11", "first round, 12"]},
+ eof], wlt, ?LINE),
+ do_chunk([{open,File,2},
+ {chunk, ["first round, 21", "first round, 22"]},
+ eof], wlt, ?LINE),
wlt ! {open, self(), File, 3},
- ?line rec({error, {file_not_found, add_ext(File, 3)}}, ?LINE),
- ?line do_chunk([{open,File,1}, {chunk, 1, ["first round, 11"]},
- {chunk, 2, ["first round, 12"]}, eof], wlt, ?LINE),
+ rec({error, {file_not_found, add_ext(File, 3)}}, ?LINE),
+ do_chunk([{open,File,1}, {chunk, 1, ["first round, 11"]},
+ {chunk, 2, ["first round, 12"]}, eof], wlt, ?LINE),
ok.
-four_filled(suite) -> [];
-four_filled(doc) -> ["Four filled index files"];
+%% Four filled index files.
four_filled(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = join(Dir, "sune.LOG"),
delete_files(File),
start(),
- ?line open(sune, File, ?LINE),
- ?line init_files(0),
- ?line sync(sune),
+ open(sune, File, ?LINE),
+ init_files(0),
+ sync(sune),
%% open
test_four(File),
- ?line close(sune),
+ close(sune),
%% closed
test_four(File),
@@ -223,42 +218,41 @@ four_filled(Conf) when is_list(Conf) ->
ok.
test_four(File) ->
- ?line do_chunk([{open,File},
- {chunk, ["first round, 11", "first round, 12"]},
- {chunk, ["first round, 21", "first round, 22"]},
- {chunk, ["first round, 31", "first round, 32"]},
- {chunk, ["first round, 41", "first round, 42"]},
- eof], wlt, ?LINE),
- ?line do_chunk([{open,File,1},
- {chunk, ["first round, 11", "first round, 12"]},
- eof], wlt, ?LINE),
- ?line do_chunk([{open,File,4},
- {chunk, ["first round, 41", "first round, 42"]},
- eof], wlt, ?LINE),
+ do_chunk([{open,File},
+ {chunk, ["first round, 11", "first round, 12"]},
+ {chunk, ["first round, 21", "first round, 22"]},
+ {chunk, ["first round, 31", "first round, 32"]},
+ {chunk, ["first round, 41", "first round, 42"]},
+ eof], wlt, ?LINE),
+ do_chunk([{open,File,1},
+ {chunk, ["first round, 11", "first round, 12"]},
+ eof], wlt, ?LINE),
+ do_chunk([{open,File,4},
+ {chunk, ["first round, 41", "first round, 42"]},
+ eof], wlt, ?LINE),
wlt ! {open, self(), File, 5},
- ?line rec({error, {file_not_found, add_ext(File, 5)}}, ?LINE),
- ?line do_chunk([{open,File,1}, {chunk, 1, ["first round, 11"]},
- {chunk, 2, ["first round, 12"]}, eof], wlt, ?LINE),
- ?line do_chunk([{open,File,4}, {chunk, 1, ["first round, 41"]},
- {chunk, 2, ["first round, 42"]}, eof], wlt, ?LINE),
+ rec({error, {file_not_found, add_ext(File, 5)}}, ?LINE),
+ do_chunk([{open,File,1}, {chunk, 1, ["first round, 11"]},
+ {chunk, 2, ["first round, 12"]}, eof], wlt, ?LINE),
+ do_chunk([{open,File,4}, {chunk, 1, ["first round, 41"]},
+ {chunk, 2, ["first round, 42"]}, eof], wlt, ?LINE),
ok.
-wrap_filled(suite) -> [];
-wrap_filled(doc) -> ["First wrap, open, filled index file"];
+%% First wrap, open, filled index file.
wrap_filled(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = join(Dir, "sune.LOG"),
delete_files(File),
start(),
- ?line open(sune, File, ?LINE),
- ?line init_files(0),
- ?line log_terms(sune, ["second round, 11", "second round, 12"]),
- ?line sync(sune),
+ open(sune, File, ?LINE),
+ init_files(0),
+ log_terms(sune, ["second round, 11", "second round, 12"]),
+ sync(sune),
%% open
test_wrap(File),
- ?line close(sune),
+ close(sune),
%% closed
test_wrap(File),
@@ -267,103 +261,100 @@ wrap_filled(Conf) when is_list(Conf) ->
ok.
test_wrap(File) ->
- ?line do_chunk([{open,File},
- {chunk, ["first round, 21", "first round, 22"]},
- {chunk, ["first round, 31", "first round, 32"]},
- {chunk, ["first round, 41", "first round, 42"]},
- {chunk, ["second round, 11", "second round, 12"]},
- eof], wlt, ?LINE),
- ?line do_chunk([{open,File,1},
- {chunk, ["second round, 11", "second round, 12"]},
- eof], wlt, ?LINE),
- ?line do_chunk([{open,File,2},
- {chunk, ["first round, 21", "first round, 22"]},
- eof], wlt, ?LINE),
+ do_chunk([{open,File},
+ {chunk, ["first round, 21", "first round, 22"]},
+ {chunk, ["first round, 31", "first round, 32"]},
+ {chunk, ["first round, 41", "first round, 42"]},
+ {chunk, ["second round, 11", "second round, 12"]},
+ eof], wlt, ?LINE),
+ do_chunk([{open,File,1},
+ {chunk, ["second round, 11", "second round, 12"]},
+ eof], wlt, ?LINE),
+ do_chunk([{open,File,2},
+ {chunk, ["first round, 21", "first round, 22"]},
+ eof], wlt, ?LINE),
wlt ! {open, self(), File, 5},
- ?line rec({error, {file_not_found, add_ext(File, 5)}}, ?LINE),
- ?line do_chunk([{open,File,1}, {chunk, 1, ["second round, 11"]},
- {chunk, 2, ["second round, 12"]}, eof], wlt, ?LINE),
- ?line do_chunk([{open,File,4}, {chunk, 1, ["first round, 41"]},
- {chunk, 2, ["first round, 42"]}, eof], wlt, ?LINE),
+ rec({error, {file_not_found, add_ext(File, 5)}}, ?LINE),
+ do_chunk([{open,File,1}, {chunk, 1, ["second round, 11"]},
+ {chunk, 2, ["second round, 12"]}, eof], wlt, ?LINE),
+ do_chunk([{open,File,4}, {chunk, 1, ["first round, 41"]},
+ {chunk, 2, ["first round, 42"]}, eof], wlt, ?LINE),
ok.
-wrapping(suite) -> [];
-wrapping(doc) -> ["Wrapping at the same time as reading"];
+%% Wrapping at the same time as reading.
wrapping(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = join(Dir, "sune.LOG"),
delete_files(File),
start(),
- ?line open(sune, File, ?LINE),
- ?line init_files(1100),
- ?line sync(sune),
- ?line C1 =
+ open(sune, File, ?LINE),
+ init_files(1100),
+ sync(sune),
+ C1 =
do_chunk([{open,File}, {chunk, 1, ["first round, 11"]}], wlt, ?LINE),
- ?line log_terms(sune, ["second round, 11", "second round, 12"]),
- ?line sync(sune),
- ?line do_chunk([{chunk, 1, ["first round, 12"]},
- %% Here two bad bytes are found.
- {chunk, ["first round, 21", "first round, 22"]},
- {chunk, ["first round, 31", "first round, 32"]},
- {chunk, ["first round, 41", "first round, 42"]}, eof],
- wlt, ?LINE, C1),
+ log_terms(sune, ["second round, 11", "second round, 12"]),
+ sync(sune),
+ do_chunk([{chunk, 1, ["first round, 12"]},
+ %% Here two bad bytes are found.
+ {chunk, ["first round, 21", "first round, 22"]},
+ {chunk, ["first round, 31", "first round, 32"]},
+ {chunk, ["first round, 41", "first round, 42"]}, eof],
+ wlt, ?LINE, C1),
start(),
delete_files(File),
- ?line open(sune, File, ?LINE),
- ?line init_files(1100),
- ?line sync(sune),
- ?line C2 =
+ open(sune, File, ?LINE),
+ init_files(1100),
+ sync(sune),
+ C2 =
do_chunk([{open,File}, {chunk, 1, ["first round, 11"]}], wlt, ?LINE),
- ?line log_terms(sune, ["second round, 11", "second round, 12"]),
- ?line close(sune),
- ?line do_chunk([{chunk, 1, ["first round, 12"]},
- %% Here two bad bytes are found.
- {chunk, ["first round, 21", "first round, 22"]},
- {chunk, ["first round, 31", "first round, 32"]},
- {chunk, ["first round, 41", "first round, 42"]}, eof],
- wlt, ?LINE, C2),
+ log_terms(sune, ["second round, 11", "second round, 12"]),
+ close(sune),
+ do_chunk([{chunk, 1, ["first round, 12"]},
+ %% Here two bad bytes are found.
+ {chunk, ["first round, 21", "first round, 22"]},
+ {chunk, ["first round, 31", "first round, 32"]},
+ {chunk, ["first round, 41", "first round, 42"]}, eof],
+ wlt, ?LINE, C2),
start(),
delete_files(File),
- ?line open(sune, File, ?LINE),
- ?line init_files(1100),
- ?line sync(sune),
- ?line C3 = do_chunk([{open,File}], wlt, ?LINE),
- ?line log_terms(sune, ["second round, 11"]),
- ?line sync(sune),
- ?line do_chunk([{chunk, 1, ["second round, 11"]},
- {chunk, 1, ["first round, 21"]},
- {chunk, 1, ["first round, 22"]},
- {chunk, ["first round, 31", "first round, 32"]},
- {chunk, ["first round, 41", "first round, 42"]}, eof],
- wlt, ?LINE, C3),
+ open(sune, File, ?LINE),
+ init_files(1100),
+ sync(sune),
+ C3 = do_chunk([{open,File}], wlt, ?LINE),
+ log_terms(sune, ["second round, 11"]),
+ sync(sune),
+ do_chunk([{chunk, 1, ["second round, 11"]},
+ {chunk, 1, ["first round, 21"]},
+ {chunk, 1, ["first round, 22"]},
+ {chunk, ["first round, 31", "first round, 32"]},
+ {chunk, ["first round, 41", "first round, 42"]}, eof],
+ wlt, ?LINE, C3),
stop(),
delete_files(File),
ok.
-external(suite) -> [];
-external(doc) -> ["External format"];
+%% External format.
external(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = join(Dir, "sune.LOG"),
delete_files(File),
start(),
- ?line open_ext(sune, File, ?FILE),
- ?line init_files_ext(0),
- ?line close(sune),
+ open_ext(sune, File, ?FILE),
+ init_files_ext(0),
+ close(sune),
P0 = pps(),
wlt ! {open, self(), File},
- ?line rec({error, {not_a_log_file, add_ext(File, 1)}}, ?LINE),
- ?line true = (P0 == pps()),
+ rec({error, {not_a_log_file, add_ext(File, 1)}}, ?LINE),
+ true = (P0 == pps()),
stop(),
delete_files(File),
ok.
-error(suite) -> [];
-error(doc) -> ["Error situations"];
+%% Error situations.
error(Conf) when is_list(Conf) ->
Dir = ?privdir(Conf),
File = join(Dir, "sune.LOG"),
@@ -372,69 +363,69 @@ error(Conf) when is_list(Conf) ->
P0 = pps(),
wlt ! {open, self(), File, 1},
- ?line rec({error, {index_file_not_found, File}}, ?LINE),
+ rec({error, {index_file_not_found, File}}, ?LINE),
wlt ! {open, self(), File},
- ?line rec({error, {index_file_not_found, File}}, ?LINE),
- ?line true = (P0 == pps()),
+ rec({error, {index_file_not_found, File}}, ?LINE),
+ true = (P0 == pps()),
- ?line open(sune, File, ?LINE),
- ?line close(sune),
+ open(sune, File, ?LINE),
+ close(sune),
P1 = pps(),
- ?line First = add_ext(File, 1),
- ?line ok = file:delete(First),
+ First = add_ext(File, 1),
+ ok = file:delete(First),
wlt ! {open, self(), File},
- ?line rec({error, {not_a_log_file, First}}, ?LINE),
- ?line true = (P1 == pps()),
+ rec({error, {not_a_log_file, First}}, ?LINE),
+ true = (P1 == pps()),
delete_files(File),
- ?line open(sune, File, ?LINE),
- ?line init_files(0),
- ?line close(sune),
+ open(sune, File, ?LINE),
+ init_files(0),
+ close(sune),
P2 = pps(),
- ?line C = do_chunk([{open,File},
- {chunk, ["first round, 11", "first round, 12"]}],
- wlt, ?LINE),
- ?line Second = add_ext(File, 2),
- ?line ok = file:delete(Second),
+ C = do_chunk([{open,File},
+ {chunk, ["first round, 11", "first round, 12"]}],
+ wlt, ?LINE),
+ Second = add_ext(File, 2),
+ ok = file:delete(Second),
wlt ! {chunk, self(), C},
- ?line rec({error, {file_error, Second, {error, enoent}}}, ?LINE),
- ?line ok = file:write_file(Second, <<17:(3*8)>>), % three bytes
+ rec({error, {file_error, Second, {error, enoent}}}, ?LINE),
+ ok = file:write_file(Second, <<17:(3*8)>>), % three bytes
wlt ! {chunk, self(), C},
- ?line rec({error, {not_a_log_file, Second}}, ?LINE),
- ?line do_chunk([close], wlt, ?LINE, C),
- ?line true = (P2 == pps()),
+ rec({error, {not_a_log_file, Second}}, ?LINE),
+ do_chunk([close], wlt, ?LINE, C),
+ true = (P2 == pps()),
delete_files(File),
- ?line open(sune, File, ?LINE),
- ?line init_files(0),
- ?line close(sune),
+ open(sune, File, ?LINE),
+ init_files(0),
+ close(sune),
P3 = pps(),
timer:sleep(1100),
Now = calendar:local_time(),
- ?line ok = file:change_time(First, Now),
- ?line C2 = do_chunk([{open,File},
- {chunk, ["first round, 11", "first round, 12"]}],
- wlt, ?LINE),
+ ok = file:change_time(First, Now),
+ C2 = do_chunk([{open,File},
+ {chunk, ["first round, 11", "first round, 12"]}],
+ wlt, ?LINE),
wlt ! {chunk, self(), C2},
- ?line rec({error,{is_wrapped,First}}, ?LINE),
- ?line do_chunk([close], wlt, ?LINE, C2),
+ rec({error,{is_wrapped,First}}, ?LINE),
+ do_chunk([close], wlt, ?LINE, C2),
IndexFile = add_ext(File, idx),
- ?line ok = file:write_file(IndexFile, <<17:(3*8)>>),
+ ok = file:write_file(IndexFile, <<17:(3*8)>>),
wlt ! {open, self(), File, 1},
- ?line rec({error, {index_file_not_found, File}}, ?LINE),
- ?line true = (P3 == pps()),
+ rec({error, {index_file_not_found, File}}, ?LINE),
+ true = (P3 == pps()),
stop(),
delete_files(File),
ok.
start() ->
- ?line ok = wrap_log_test:stop(),
+ ok = wrap_log_test:stop(),
dl_wait(),
- ?line ok = wrap_log_test:init().
+ ok = wrap_log_test:init().
stop() ->
- ?line ok = wrap_log_test:stop(),
+ ok = wrap_log_test:stop(),
dl_wait().
%% Give disk logs opened by 'logger' and 'wlt' time to close after
@@ -458,24 +449,24 @@ delete_files(File) ->
ok.
init_files(Delay) ->
- ?line log_terms(sune, ["first round, 11", "first round, 12"]),
+ log_terms(sune, ["first round, 11", "first round, 12"]),
timer:sleep(Delay),
- ?line log_terms(sune, ["first round, 21", "first round, 22"]),
+ log_terms(sune, ["first round, 21", "first round, 22"]),
timer:sleep(Delay),
- ?line log_terms(sune, ["first round, 31", "first round, 32"]),
+ log_terms(sune, ["first round, 31", "first round, 32"]),
timer:sleep(Delay),
- ?line log_terms(sune, ["first round, 41", "first round, 42"]),
+ log_terms(sune, ["first round, 41", "first round, 42"]),
timer:sleep(Delay),
ok.
init_files_ext(Delay) ->
- ?line blog_terms(sune, ["first round, 11", "first round, 12"]),
+ blog_terms(sune, ["first round, 11", "first round, 12"]),
timer:sleep(Delay),
- ?line blog_terms(sune, ["first round, 21", "first round, 22"]),
+ blog_terms(sune, ["first round, 21", "first round, 22"]),
timer:sleep(Delay),
- ?line blog_terms(sune, ["first round, 31", "first round, 32"]),
+ blog_terms(sune, ["first round, 31", "first round, 32"]),
timer:sleep(Delay),
- ?line blog_terms(sune, ["first round, 41", "first round, 42"]),
+ blog_terms(sune, ["first round, 41", "first round, 42"]),
timer:sleep(Delay),
ok.
@@ -487,27 +478,27 @@ do_chunk(Commands, Server, Where) ->
do_chunk([{open, File, One} | Cs], S, W, _C) ->
S ! {open, self(), File, One},
- ?line NC = rec1(ok, {W,?LINE}),
+ NC = rec1(ok, {W,?LINE}),
do_chunk(Cs, S, W, NC);
do_chunk([{open, File} | Cs], S, W, _C) ->
S ! {open, self(), File},
- ?line NC = rec1(ok, {W,?LINE}),
+ NC = rec1(ok, {W,?LINE}),
do_chunk(Cs, S, W, NC);
do_chunk([{chunk, Terms} | Cs], S, W, C) ->
S ! {chunk, self(), C},
- ?line NC = rec2(Terms, {W,?LINE}),
+ NC = rec2(Terms, {W,?LINE}),
do_chunk(Cs, S, W, NC);
do_chunk([{chunk, N, Terms} | Cs], S, W, C) ->
S ! {chunk, self(), C, N},
- ?line NC = rec2(Terms, {W,?LINE}),
+ NC = rec2(Terms, {W,?LINE}),
do_chunk(Cs, S, W, NC);
do_chunk([eof], S, W, C) ->
S ! {chunk, self(), C},
- ?line C1 = rec2(eof, {W,?LINE}),
+ C1 = rec2(eof, {W,?LINE}),
do_chunk([close], S, W, C1);
do_chunk([close], S, W, C) ->
S ! {close, self(), C},
- ?line rec(ok, {W,?LINE});
+ rec(ok, {W,?LINE});
do_chunk([], _S, _W, C) ->
C.
@@ -542,24 +533,24 @@ blog_terms(File, Terms) ->
rec1(M, Where) ->
receive
{M, C} -> C;
- Else -> test_server:fail({error, {Where, Else}})
- after 1000 -> test_server:fail({error, {Where, time_out}})
+ Else -> ct:fail({error, {Where, Else}})
+ after 1000 -> ct:fail({error, {Where, time_out}})
end.
rec2(M, Where) ->
receive
{C, M} -> C;
- Else -> test_server:fail({error, {Where, Else}})
- after 1000 -> test_server:fail({error, {Where, time_out}})
+ Else -> ct:fail({error, {Where, Else}})
+ after 1000 -> ct:fail({error, {Where, time_out}})
end.
rec(M, Where) ->
receive
M ->
ok;
- Else -> ?t:fail({error, {Where, Else}})
- after 5000 -> ?t:fail({error, {Where, time_out}})
+ Else -> ct:fail({error, {Where, Else}})
+ after 5000 -> ct:fail({error, {Where, time_out}})
end.
-
+
pps() ->
{erlang:ports(), lists:filter(fun erlang:is_process_alive/1, processes())}.
diff --git a/lib/kernel/test/zlib_SUITE.erl b/lib/kernel/test/zlib_SUITE.erl
index d9d4c138d5..97e1e2caa5 100644
--- a/lib/kernel/test/zlib_SUITE.erl
+++ b/lib/kernel/test/zlib_SUITE.erl
@@ -47,11 +47,10 @@
-define(DATA_ERROR, {'EXIT',{data_error,[{zlib,_,_,_}|_]}}).
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:seconds(60)),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+ Config.
+
+end_per_testcase(_Func, _Config) ->
+ ok.
error(Format, Args, File, Line) ->
io:format("~p:~p: ERROR: " ++ Format, [File,Line|Args]),
@@ -70,7 +69,9 @@ error(Format, Args, File, Line) ->
%% end,
%% log("<>ERROR<>~n" ++ Format, Args, File, Line).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[{group, api}, {group, examples}, {group, func}, smp,
@@ -106,80 +107,78 @@ end_per_group(_GroupName, Config) ->
-api_open_close(doc) -> "Test open/0 and close/1";
-api_open_close(suite) -> [];
+%% Test open/0 and close/1.
api_open_close(Config) when is_list(Config) ->
- ?line Fd1 = zlib:open(),
- ?line Fd2 = zlib:open(),
+ Fd1 = zlib:open(),
+ Fd2 = zlib:open(),
?m(false,Fd1 == Fd2),
?m(ok,zlib:close(Fd1)),
?m(?BARG, zlib:close(Fd1)),
?m(ok,zlib:close(Fd2)),
-
+
%% Make sure that we don't get any EXIT messages if trap_exit is enabled.
- ?line process_flag(trap_exit, true),
- ?line Fd3 = zlib:open(),
+ process_flag(trap_exit, true),
+ Fd3 = zlib:open(),
?m(ok,zlib:close(Fd3)),
receive
- Any -> ?line ?t:fail({unexpected_message,Any})
+ Any -> ct:fail({unexpected_message,Any})
after 10 -> ok
end.
-api_deflateInit(doc) -> "Test deflateInit/2 and /6";
-api_deflateInit(suite) -> [];
+%% Test deflateInit/2 and /6.
api_deflateInit(Config) when is_list(Config) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
?m(?BARG, zlib:deflateInit(gurka, none)),
?m(?BARG, zlib:deflateInit(gurka, gurka)),
?m(?BARG, zlib:deflateInit(Z1, gurka)),
Levels = [none, default, best_speed, best_compression] ++ lists:seq(0,9),
lists:foreach(fun(Level) ->
- ?line Z = zlib:open(),
+ Z = zlib:open(),
?m(ok, zlib:deflateInit(Z, Level)),
?m(ok,zlib:close(Z))
end, Levels),
%% /6
?m(?BARG, zlib:deflateInit(Z1,gurka,deflated,-15,8,default)),
-
+
?m(?BARG, zlib:deflateInit(Z1,default,undefined,-15,8,default)),
-
+
?m(?BARG, zlib:deflateInit(Z1,default,deflated,48,8,default)),
?m(?BARG, zlib:deflateInit(Z1,default,deflated,-20,8,default)),
?m(?BARG, zlib:deflateInit(Z1,default,deflated,-7,8,default)),
?m(?BARG, zlib:deflateInit(Z1,default,deflated,7,8,default)),
-
+
?m(?BARG, zlib:deflateInit(Z1,default,deflated,-15,0,default)),
?m(?BARG, zlib:deflateInit(Z1,default,deflated,-15,10,default)),
-
+
?m(?BARG, zlib:deflateInit(Z1,default,deflated,-15,8,0)),
?m(?BARG, zlib:deflateInit(Z1,default,deflated,-15,8,undefined)),
-
+
lists:foreach(fun(Level) ->
- ?line Z = zlib:open(),
+ Z = zlib:open(),
?m(ok, zlib:deflateInit(Z, Level, deflated, -15, 8, default)),
?m(ok,zlib:close(Z))
end, Levels),
-
+
lists:foreach(fun(Wbits) ->
- ?line Z11 = zlib:open(),
+ Z11 = zlib:open(),
?m(ok, zlib:deflateInit(Z11,best_compression,deflated,
Wbits,8,default)),
- ?line Z12 = zlib:open(),
+ Z12 = zlib:open(),
?m(ok, zlib:deflateInit(Z12,default,deflated,-Wbits,8,default)),
?m(ok,zlib:close(Z11)),
?m(ok,zlib:close(Z12))
end, lists:seq(8, 15)),
-
+
lists:foreach(fun(MemLevel) ->
- ?line Z = zlib:open(),
+ Z = zlib:open(),
?m(ok, zlib:deflateInit(Z,default,deflated,-15,
MemLevel,default)),
?m(ok,zlib:close(Z))
end, lists:seq(1,8)),
-
+
Strategies = [filtered,huffman_only,rle,default],
lists:foreach(fun(Strategy) ->
- ?line Z = zlib:open(),
+ Z = zlib:open(),
?m(ok, zlib:deflateInit(Z,best_speed,deflated,-15,8,Strategy)),
?m(ok,zlib:close(Z))
end, Strategies),
@@ -187,10 +186,9 @@ api_deflateInit(Config) when is_list(Config) ->
?m({'EXIT',_}, zlib:deflateInit(Z1,none,deflated,-15,8,default)), %% ??
?m(ok, zlib:close(Z1)).
-api_deflateSetDictionary(doc) -> "Test deflateSetDictionary";
-api_deflateSetDictionary(suite) -> [];
+%% Test deflateSetDictionary.
api_deflateSetDictionary(Config) when is_list(Config) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
?m(ok, zlib:deflateInit(Z1, default)),
?m(Id when is_integer(Id), zlib:deflateSetDictionary(Z1, <<1,1,2,3,4,5,1>>)),
?m(Id when is_integer(Id), zlib:deflateSetDictionary(Z1, [1,1,2,3,4,5,1])),
@@ -200,10 +198,9 @@ api_deflateSetDictionary(Config) when is_list(Config) ->
?m({'EXIT',{stream_error,_}},zlib:deflateSetDictionary(Z1,<<1,1,2,3,4,5,1>>)),
?m(ok, zlib:close(Z1)).
-api_deflateReset(doc) -> "Test deflateReset";
-api_deflateReset(suite) -> [];
+%% Test deflateReset.
api_deflateReset(Config) when is_list(Config) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
?m(ok, zlib:deflateInit(Z1, default)),
?m(_, zlib:deflate(Z1, <<1,1,1,1,1,1,1,1,1>>, none)),
?m(ok, zlib:deflateReset(Z1)),
@@ -211,20 +208,18 @@ api_deflateReset(Config) when is_list(Config) ->
%% FIXME how do I make this go wrong??
?m(ok, zlib:close(Z1)).
-api_deflateParams(doc) -> "Test deflateParams";
-api_deflateParams(suite) -> [];
+%% Test deflateParams.
api_deflateParams(Config) when is_list(Config) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
?m(ok, zlib:deflateInit(Z1, default)),
?m(_, zlib:deflate(Z1, <<1,1,1,1,1,1,1,1,1>>, none)),
?m(ok, zlib:deflateParams(Z1, best_compression, huffman_only)),
?m(_, zlib:deflate(Z1, <<1,1,1,1,1,1,1,1,1>>, sync)),
?m(ok, zlib:close(Z1)).
-api_deflate(doc) -> "Test deflate";
-api_deflate(suite) -> [];
+%% Test deflate.
api_deflate(Config) when is_list(Config) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
?m(ok, zlib:deflateInit(Z1, default)),
?m([B] when is_binary(B), zlib:deflate(Z1, <<1,1,1,1,1,1,1,1,1>>, finish)),
?m(ok, zlib:deflateReset(Z1)),
@@ -235,19 +230,18 @@ api_deflate(Config) when is_list(Config) ->
?m(B when is_list(B), zlib:deflate(Z1, <<1,1,1,1,1,1,1,1,1>>, sync)),
?m(B when is_list(B), zlib:deflate(Z1, <<1,1,1,1,1,1,1,1,1>>, full)),
?m(B when is_list(B), zlib:deflate(Z1, <<>>, finish)),
-
+
?m(?BARG, zlib:deflate(gurka, <<1,1,1,1,1,1,1,1,1>>, full)),
?m(?BARG, zlib:deflate(Z1, <<1,1,1,1,1,1,1,1,1>>, asdj)),
?m(?BARG, zlib:deflate(Z1, <<1,1,1,1,1,1,1,1,1>>, 198)),
%% Causes problems ERROR REPORT
?m(?BARG, zlib:deflate(Z1, [asdj,asd], none)),
-
+
?m(ok, zlib:close(Z1)).
-api_deflateEnd(doc) -> "Test deflateEnd";
-api_deflateEnd(suite) -> [];
+%% Test deflateEnd.
api_deflateEnd(Config) when is_list(Config) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
?m(ok, zlib:deflateInit(Z1, default)),
?m(ok, zlib:deflateEnd(Z1)),
?m({'EXIT', {einval,_}}, zlib:deflateEnd(Z1)), %% ??
@@ -259,20 +253,19 @@ api_deflateEnd(Config) when is_list(Config) ->
?m(B when is_list(B), zlib:deflate(Z1, <<"Kilroy was here">>)),
?m(B when is_list(B), zlib:deflate(Z1, <<"Kilroy was here">>, finish)),
?m(ok, zlib:deflateEnd(Z1)),
-
+
?m(ok, zlib:close(Z1)).
-api_inflateInit(doc) -> "Test inflateInit /1 and /2";
-api_inflateInit(suite) -> [];
+%% Test inflateInit /1 and /2.
api_inflateInit(Config) when is_list(Config) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
?m(?BARG, zlib:inflateInit(gurka)),
?m(ok, zlib:inflateInit(Z1)),
?m({'EXIT',{einval,_}}, zlib:inflateInit(Z1, 15)), %% ??
lists:foreach(fun(Wbits) ->
- ?line Z11 = zlib:open(),
+ Z11 = zlib:open(),
?m(ok, zlib:inflateInit(Z11,Wbits)),
- ?line Z12 = zlib:open(),
+ Z12 = zlib:open(),
?m(ok, zlib:inflateInit(Z12,-Wbits)),
?m(ok,zlib:close(Z11)),
?m(ok,zlib:close(Z12))
@@ -284,10 +277,9 @@ api_inflateInit(Config) when is_list(Config) ->
?m(?BARG, zlib:inflateInit(Z1, -16)),
?m(ok, zlib:close(Z1)).
-api_inflateSetDictionary(doc) -> "Test inflateSetDictionary";
-api_inflateSetDictionary(suite) -> [];
+%% Test inflateSetDictionary.
api_inflateSetDictionary(Config) when is_list(Config) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
?m(ok, zlib:inflateInit(Z1)),
?m(?BARG, zlib:inflateSetDictionary(gurka,<<1,1,1,1,1>>)),
?m(?BARG, zlib:inflateSetDictionary(Z1,102)),
@@ -296,27 +288,26 @@ api_inflateSetDictionary(Config) when is_list(Config) ->
?m({'EXIT',{stream_error,_}}, zlib:inflateSetDictionary(Z1,Dict)),
?m(ok, zlib:close(Z1)).
-api_inflateSync(doc) -> "Test inflateSync";
-api_inflateSync(suite) -> [];
+%% Test inflateSync.
api_inflateSync(Config) when is_list(Config) ->
{skip,"inflateSync/1 sucks"}.
-%% ?line Z1 = zlib:open(),
+%% Z1 = zlib:open(),
%% ?m(ok, zlib:deflateInit(Z1)),
-%% ?line B1list0 = zlib:deflate(Z1, "gurkan gurra ger galna tunnor", full),
-%% ?line B2 = zlib:deflate(Z1, "grodan boll", finish),
+%% B1list0 = zlib:deflate(Z1, "gurkan gurra ger galna tunnor", full),
+%% B2 = zlib:deflate(Z1, "grodan boll", finish),
%% io:format("~p\n", [B1list0]),
%% io:format("~p\n", [B2]),
%% ?m(ok, zlib:deflateEnd(Z1)),
-%% ?line B1 = clobber(14, list_to_binary(B1list0)),
-%% ?line Compressed = list_to_binary([B1,B2]),
-%% ?line io:format("~p\n", [Compressed]),
+%% B1 = clobber(14, list_to_binary(B1list0)),
+%% Compressed = list_to_binary([B1,B2]),
+%% io:format("~p\n", [Compressed]),
%% ?m(ok, zlib:inflateInit(Z1)),
%% ?m(?BARG, zlib:inflateSync(gurka)),
%% ?m({'EXIT',{data_error,_}}, zlib:inflate(Z1, Compressed)),
%% ?m(ok, zlib:inflateSync(Z1)),
-%% ?line Ubs = zlib:inflate(Z1, []),
-%% ?line <<"grodan boll">> = list_to_binary(Ubs),
+%% Ubs = zlib:inflate(Z1, []),
+%% <<"grodan boll">> = list_to_binary(Ubs),
%% ?m(ok, zlib:close(Z1)).
clobber(N, Bin) when is_binary(Bin) ->
@@ -327,21 +318,19 @@ clobber(N, Bin) when is_binary(Bin) ->
end,
list_to_binary(tuple_to_list(setelement(N, T, Byte))).
-api_inflateReset(doc) -> "Test inflateReset";
-api_inflateReset(suite) -> [];
+%% Test inflateReset.
api_inflateReset(Config) when is_list(Config) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
?m(ok, zlib:inflateInit(Z1)),
?m(?BARG, zlib:inflateReset(gurka)),
?m(ok, zlib:inflateReset(Z1)),
?m(ok, zlib:close(Z1)).
-api_inflate(doc) -> "Test inflate";
-api_inflate(suite) -> [];
+%% Test inflate.
api_inflate(Config) when is_list(Config) ->
Data = [<<1,2,2,3,3,3,4,4,4,4>>],
- ?line Compressed = zlib:compress(Data),
- ?line Z1 = zlib:open(),
+ Compressed = zlib:compress(Data),
+ Z1 = zlib:open(),
?m(ok, zlib:inflateInit(Z1)),
?m([], zlib:inflate(Z1, <<>>)),
?m(Data, zlib:inflate(Z1, Compressed)),
@@ -356,17 +345,16 @@ api_inflate(Config) when is_list(Config) ->
?m({'EXIT',{data_error,_}}, zlib:inflate(Z1, <<2,1,2,1,2>>)),
?m(ok, zlib:close(Z1)).
-api_inflateChunk(doc) -> "Test inflateChunk";
-api_inflateChunk(suite) -> [];
+%% Test inflateChunk.
api_inflateChunk(Config) when is_list(Config) ->
ChunkSize = 1024,
Data = << <<(I rem 150)>> || I <- lists:seq(1, 3 * ChunkSize) >>,
Part1 = binary:part(Data, 0, ChunkSize),
Part2 = binary:part(Data, ChunkSize, ChunkSize),
Part3 = binary:part(Data, ChunkSize * 2, ChunkSize),
- ?line Compressed = zlib:compress(Data),
- ?line Z1 = zlib:open(),
- ?line zlib:setBufSize(Z1, ChunkSize),
+ Compressed = zlib:compress(Data),
+ Z1 = zlib:open(),
+ zlib:setBufSize(Z1, ChunkSize),
?m(ok, zlib:inflateInit(Z1)),
?m([], zlib:inflateChunk(Z1, <<>>)),
?m({more, Part1}, zlib:inflateChunk(Z1, Compressed)),
@@ -379,7 +367,7 @@ api_inflateChunk(Config) when is_list(Config) ->
?m(ok, zlib:inflateReset(Z1)),
- ?line zlib:setBufSize(Z1, size(Data)),
+ zlib:setBufSize(Z1, size(Data)),
?m(Data, zlib:inflateChunk(Z1, Compressed)),
?m(ok, zlib:inflateEnd(Z1)),
@@ -389,10 +377,9 @@ api_inflateChunk(Config) when is_list(Config) ->
?m({'EXIT',{data_error,_}}, zlib:inflateEnd(Z1)),
?m(ok, zlib:close(Z1)).
-api_inflateEnd(doc) -> "Test inflateEnd";
-api_inflateEnd(suite) -> [];
+%% Test inflateEnd.
api_inflateEnd(Config) when is_list(Config) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
?m({'EXIT',{einval,_}}, zlib:inflateEnd(Z1)),
?m(ok, zlib:inflateInit(Z1)),
?m(?BARG, zlib:inflateEnd(gurka)),
@@ -403,18 +390,16 @@ api_inflateEnd(Config) when is_list(Config) ->
?m(ok, zlib:inflateEnd(Z1)),
?m(ok, zlib:close(Z1)).
-api_getBufsz(doc) -> "Test getBufsz";
-api_getBufsz(suite) -> [];
+%% Test getBufsz.
api_getBufsz(Config) when is_list(Config) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
?m(Val when is_integer(Val), zlib:getBufSize(Z1)),
?m(?BARG, zlib:getBufSize(gurka)),
?m(ok, zlib:close(Z1)).
-api_setBufsz(doc) -> "Test setBufsz";
-api_setBufsz(suite) -> [];
+%% Test setBufsz.
api_setBufsz(Config) when is_list(Config) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
?m(?BARG, zlib:setBufSize(Z1, gurka)),
?m(?BARG, zlib:setBufSize(gurka, 1232330)),
Sz = ?m( Val when is_integer(Val), zlib:getBufSize(Z1)),
@@ -424,25 +409,23 @@ api_setBufsz(Config) when is_list(Config) ->
?m(ok, zlib:close(Z1)).
%%% Debug function ??
-api_getQSize(doc) -> "Test getQSize";
-api_getQSize(suite) -> [];
+%% Test getQSize.
api_getQSize(Config) when is_list(Config) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
Q = ?m(Val when is_integer(Val), zlib:getQSize(Z1)),
io:format("QSize ~p ~n", [Q]),
?m(?BARG, zlib:getQSize(gurka)),
?m(ok, zlib:close(Z1)).
-api_crc32(doc) -> "Test crc32";
-api_crc32(suite) -> [];
+%% Test crc32.
api_crc32(Config) when is_list(Config) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
?m(ok, zlib:deflateInit(Z1,best_speed,deflated,-15,8,default)),
Bin = <<1,1,1,1,1,1,1,1,1>>,
Compressed1 = ?m(_, zlib:deflate(Z1, Bin, none)),
Compressed2 = ?m(_, zlib:deflate(Z1, <<>>, finish)),
Compressed = list_to_binary(Compressed1 ++ Compressed2),
- CRC1 = ?m( CRC1 when is_integer(CRC1), zlib:crc32(Z1)),
+ CRC1 = ?m( CRC1 when is_integer(CRC1), zlib:crc32(Z1)),
?m(CRC1 when is_integer(CRC1), zlib:crc32(Z1,Bin)),
?m(CRC1 when is_integer(CRC1), zlib:crc32(Z1,binary_to_list(Bin))),
?m(CRC2 when is_integer(CRC2), zlib:crc32(Z1,Compressed)),
@@ -460,10 +443,9 @@ api_crc32(Config) when is_list(Config) ->
?m(ok, zlib:deflateEnd(Z1)),
?m(ok, zlib:close(Z1)).
-api_adler32(doc) -> "Test adler32";
-api_adler32(suite) -> [];
+%% Test adler32.
api_adler32(Config) when is_list(Config) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
?m(ok, zlib:deflateInit(Z1,best_speed,deflated,-15,8,default)),
Bin = <<1,1,1,1,1,1,1,1,1>>,
Compressed1 = ?m(_, zlib:deflate(Z1, Bin, none)),
@@ -484,12 +466,11 @@ api_adler32(Config) when is_list(Config) ->
?m(ok, zlib:deflateEnd(Z1)),
?m(ok, zlib:close(Z1)).
-api_un_compress(doc) -> "Test compress";
-api_un_compress(suite) -> [];
+%% Test compress.
api_un_compress(Config) when is_list(Config) ->
?m(?BARG,zlib:compress(not_a_binary)),
Bin = <<1,11,1,23,45>>,
- ?line Comp = zlib:compress(Bin),
+ Comp = zlib:compress(Bin),
?m(?BARG,zlib:uncompress(not_a_binary)),
?m({'EXIT',{data_error,_}}, zlib:uncompress(<<171,171,171,171,171>>)),
?m({'EXIT',{data_error,_}}, zlib:uncompress(<<>>)),
@@ -501,58 +482,40 @@ api_un_compress(Config) when is_list(Config) ->
?m(Bin, zlib:uncompress(binary_to_list(Comp))),
?m(Bin, zlib:uncompress(Comp)).
-api_un_zip(doc) -> "Test zip";
-api_un_zip(suite) -> [];
+%% Test zip.
api_un_zip(Config) when is_list(Config) ->
?m(?BARG,zlib:zip(not_a_binary)),
Bin = <<1,11,1,23,45>>,
- ?line Comp = zlib:zip(Bin),
+ Comp = zlib:zip(Bin),
?m(Comp, zlib:zip(binary_to_list(Bin))),
?m(?BARG,zlib:unzip(not_a_binary)),
?m({'EXIT',{data_error,_}}, zlib:unzip(<<171,171,171,171,171>>)),
?m({'EXIT',{data_error,_}}, zlib:unzip(<<>>)),
?m(Bin, zlib:unzip(Comp)),
?m(Bin, zlib:unzip(binary_to_list(Comp))),
-
+
%% OTP-6396
B = <<131,104,19,100,0,13,99,95,99,105,100,95,99,115,103,115,110,95,50,97,1,107,0,4,208,161,246,29,107,0,3,237,166,224,107,0,6,66,240,153,0,2,10,1,0,8,97,116,116,97,99,104,101,100,104,2,100,0,22,117,112,100,97,116,101,95,112,100,112,95,99,111,110,116,101,120,116,95,114,101,113,107,0,114,69,3,12,1,11,97,31,113,150,64,104,132,61,64,104,12,3,197,31,113,150,64,104,132,61,64,104,12,1,11,97,31,115,150,64,104,116,73,64,104,0,0,0,0,0,0,65,149,16,61,65,149,16,61,1,241,33,4,5,0,33,4,4,10,6,10,181,4,10,6,10,181,38,15,99,111,109,109,97,110,100,1,114,45,97,112,110,45,49,3,99,111,109,5,109,110,99,57,57,6,109,99,99,50,52,48,4,103,112,114,115,8,0,104,2,104,2,100,0,8,97,99,116,105,118,97,116,101,104,23,100,0,11,112,100,112,95,99,111,110,116,1,120,116,100,0,7,112,114,105,109,97,114,121,97,1,100,0,9,117,110,100,101,102,105,110,101,100,97,1,97,4,97,4,97,7,100,0,9,117,110,100,101,102,105,110,101,100,100,0,9,117,110,100,101,102,105,110,10100,100,0,9,117,110,100,101,102,105,110,101,100,100,0,5,102,97,108,115,101,100,0,9,117,110,100,101,102,105,110,101,100,100,0,9,117,110,100,101,102,105,110,101,100,100,0,9,117,110,100,101,102,105,1,101,100,97,0,100,0,9,117,110,100,101,102,105,110,101,100,107,0,4,16,0,1,144,107,0,4,61,139,186,181,107,0,4,10,8,201,49,100,0,9,117,110,100,101,102,105,110,101,100,100,0,9,117,110,100,101,102,105,0,101,100,100,0,9,117,110,100,101,102,105,110,101,100,104,2,104,3,98,0,0,7,214,97,11,97,20,104,3,97,17,97,16,97,21,106,108,0,0,0,3,104,2,97,1,104,2,104,3,98,0,0,7,214,97,11,97,20,104,3,97,17,97,167,20,104,2,97,4,104,2,104,3,98,0,0,7,214,97,11,97,20,104,3,97,17,97,16,97,21,104,2,97,10,104,2,104,3,98,0,0,7,214,97,11,97,20,104,3,97,17,97,16,97,26,106,100,0,5,118,101,114,57,57,100,0,9,117,110,0,101,102,105,110,101,100,107,0,2,0,244,107,0,4,10,6,102,195,107,0,4,10,6,102,195,100,0,9,117,110,100,101,102,105,110,101,100,100,0,9,117,110,100,101,102,105,110,101,100,107,0,125,248,143,0,203,25115,157,116,65,185,65,172,55,87,164,88,225,50,203,251,115,157,116,65,185,65,172,55,87,164,88,225,50,0,0,82,153,50,0,200,98,87,148,237,193,185,65,149,167,69,144,14,16,153,50,3,81,70,94,13,109,193,1,120,5,181,113,198,118,50,3,81,70,94,13,109,193,185,120,5,181,113,198,118,153,3,81,70,94,13,109,193,185,120,5,181,113,198,118,153,50,16,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,113,92,2,119,128,0,0,108,0,0,1,107,0,114,69,3,12,1,11,97,31,113,150,64,104,132,61,64,104,12,3,11,97,31,113,150,64,104,132,61,64,104,12,1,11,97,31,115,150,64,104,116,73,64,104,0,0,0,0,0,0,65,149,16,61,65,149,16,61,1,241,33,4,0,33,4,4,10,6,10,181,4,10,6,10,181,38,15,99,111,109,109,97,110,100,101,114,45,97,112,110,45,49,3,99,111,109,5,109,110,99,57,57,6,109,99,99,50,52,48,4,103,112,114,115,8,0,106>>,
Z = zlib:zip(B),
?m(B, zlib:unzip(Z)).
-%% api_g_un_zip_file(doc) -> "Test gunzip_file";
-%% api_g_un_zip_file(suite) -> [];
-%% api_g_un_zip_file(Config) when is_list(Config) ->
-%% ?line Out = conf(data_dir,Config),
-%% io:format("Using OutDir ~p ~n", [Out]),
-%% F = filename:join(Out,"testing1"),
-%% Data = <<1,1,255,255,255,1,1>>,
-%% ?m(ok, file:write_file(F,Data)),
-%% ?line Compressed = zlib:gzip_file(F),
-%% ?m(ok, file:write_file(F++".gz",Compressed)),
-%% ?m(Data, zlib:gunzip_file(F++".gz")),
-%% ?m({error,enoent}, zlib:gunzip_file(gurka)),
-%% ?m({error,enoent}, zlib:gzip_file(gurka)),
-%% ?m({error,what}, zlib:gunzip_file(F)),
-%% ?line ok.
-
-api_g_un_zip(doc) -> "Test gunzip";
-api_g_un_zip(suite) -> [];
+%% Test gunzip.
api_g_un_zip(Config) when is_list(Config) ->
?m(?BARG,zlib:gzip(not_a_binary)),
Bin = <<1,11,1,23,45>>,
- ?line Comp = zlib:gzip(Bin),
+ Comp = zlib:gzip(Bin),
?m(Comp, zlib:gzip(binary_to_list(Bin))),
?m(?BARG, zlib:gunzip(not_a_binary)),
?m(?DATA_ERROR, zlib:gunzip(<<171,171,171,171,171>>)),
?m(?DATA_ERROR, zlib:gunzip(<<>>)),
?m(Bin, zlib:gunzip(Comp)),
?m(Bin, zlib:gunzip(binary_to_list(Comp))),
-
+
%% Bad CRC; bad length.
BadCrc = bad_crc_data(),
- ?line ?m({'EXIT',{data_error,_}},(catch zlib:gunzip(BadCrc))),
+ ?m({'EXIT',{data_error,_}},(catch zlib:gunzip(BadCrc))),
BadLen = bad_len_data(),
- ?line ?m({'EXIT',{data_error,_}},(catch zlib:gunzip(BadLen))),
+ ?m({'EXIT',{data_error,_}},(catch zlib:gunzip(BadLen))),
ok.
bad_crc_data() ->
@@ -564,45 +527,42 @@ bad_len_data() ->
<<31,139,8,0,0,0,0,0,0,3,211,2,0,91,38,185,9,2,0,0,0>>.
-intro(suite) -> [];
-intro(doc) -> "";
intro(Config) when is_list(Config) ->
D = <<"This is a binary">>,
[put({ex, N}, <<"This is a binary">>) || N <- [0,1,2,3,4]],
put({ex, 5}, end_of_data),
put(ex,0),
- ?line Read = fun() ->
- N = get(ex),
- put(ex,N+1),
- get({ex,N})
- end,
-
- ?line Z = zlib:open(),
- ?line ok = zlib:deflateInit(Z,default),
-
- ?line Compress = fun(end_of_data, _Cont) -> [];
- (Data, Cont) ->
- [zlib:deflate(Z, Data)|Cont(Read(),Cont)]
- end,
- ?line Compressed = Compress(Read(),Compress),
- ?line Last = zlib:deflate(Z, [], finish),
- ?line ok = zlib:deflateEnd(Z),
- ?line zlib:close(Z),
- ?line Res = list_to_binary([Compressed|Last]),
+ Read = fun() ->
+ N = get(ex),
+ put(ex,N+1),
+ get({ex,N})
+ end,
+
+ Z = zlib:open(),
+ ok = zlib:deflateInit(Z,default),
+
+ Compress = fun(end_of_data, _Cont) -> [];
+ (Data, Cont) ->
+ [zlib:deflate(Z, Data)|Cont(Read(),Cont)]
+ end,
+ Compressed = Compress(Read(),Compress),
+ Last = zlib:deflate(Z, [], finish),
+ ok = zlib:deflateEnd(Z),
+ zlib:close(Z),
+ Res = list_to_binary([Compressed|Last]),
Orig = list_to_binary(lists:duplicate(5, D)),
?m(Orig, zlib:uncompress(Res)).
-large_deflate(doc) -> "Test deflate large file, which had a bug reported on erlang-bugs";
-large_deflate(suite) -> [];
+%% Test deflate large file, which had a bug reported on erlang-bugs.
large_deflate(Config) when is_list(Config) ->
large_deflate_do().
large_deflate_do() ->
- ?line Z = zlib:open(),
- ?line Plain = rand_bytes(zlib:getBufSize(Z)*5),
- ?line ok = zlib:deflateInit(Z),
- ?line _ZlibHeader = zlib:deflate(Z, [], full),
- ?line Deflated = zlib:deflate(Z, Plain, full),
+ Z = zlib:open(),
+ Plain = rand_bytes(zlib:getBufSize(Z)*5),
+ ok = zlib:deflateInit(Z),
+ _ZlibHeader = zlib:deflate(Z, [], full),
+ Deflated = zlib:deflate(Z, Plain, full),
?m(ok, zlib:close(Z)),
?m(Plain, zlib:unzip(list_to_binary([Deflated, 3, 0]))).
@@ -617,23 +577,22 @@ rand_bytes(Bin, Sz) ->
rand_bytes(<<(erlang:md5(Bin))/binary, Bin/binary>>, Sz).
-zip_usage(doc) -> "Test a standard compressed zip file";
-zip_usage(suite) -> [];
+%% Test a standard compressed zip file.
zip_usage(Config) when is_list(Config) ->
zip_usage(zip_usage({get_arg,Config}));
zip_usage({get_arg,Config}) ->
- ?line Out = conf(data_dir,Config),
- ?line {ok,ZIP} = file:read_file(filename:join(Out,"zipdoc.zip")),
- ?line {ok,ORIG} = file:read_file(filename:join(Out,"zipdoc")),
+ Out = conf(data_dir,Config),
+ {ok,ZIP} = file:read_file(filename:join(Out,"zipdoc.zip")),
+ {ok,ORIG} = file:read_file(filename:join(Out,"zipdoc")),
{run,ZIP,ORIG};
zip_usage({run,ZIP,ORIG}) ->
- ?line <<_:14/binary, CRC:32/little,
- CompSz:32/little, UnCompSz:32/little,_:31/binary,
- Compressed:CompSz/binary, _/binary>> = ZIP,
-
+ <<_:14/binary, CRC:32/little,
+ CompSz:32/little, UnCompSz:32/little,_:31/binary,
+ Compressed:CompSz/binary, _/binary>> = ZIP,
+
%%io:format("CRC ~p CSz ~p UnCSz ~p ~n", [CRC,CompSz,UnCompSz]),
- ?line Split = split_bin(Compressed,[]),
- ?line Z = zlib:open(),
+ Split = split_bin(Compressed,[]),
+ Z = zlib:open(),
?m(ok, zlib:inflateInit(Z, -15)),
Bs = [zlib:inflate(Z, Part) || Part <- Split],
@@ -643,86 +602,84 @@ zip_usage({run,ZIP,ORIG}) ->
?m(true, zlib:crc32(Z,UC0) == zlib:crc32(Z,ORIG)),
?m(ok, zlib:inflateEnd(Z)),
- ?line UC1 = zlib:unzip(Compressed),
+ UC1 = zlib:unzip(Compressed),
?m(UnCompSz, byte_size(UC1)),
?m(true, zlib:crc32(Z,UC1) == zlib:crc32(Z,ORIG)),
-
+
?m(ok, zlib:inflateInit(Z, -15)),
- ?line UC2 = zlib:inflate(Z, Compressed),
+ UC2 = zlib:inflate(Z, Compressed),
?m(UnCompSz, byte_size(list_to_binary(UC2))),
?m(CRC, zlib:crc32(Z)),
?m(true, zlib:crc32(Z,UC2) == zlib:crc32(Z,ORIG)),
?m(ok, zlib:inflateEnd(Z)),
-
+
?m(ok, zlib:inflateInit(Z, -15)),
- ?line UC3 = zlib:inflate(Z, Split), % Test multivec.
+ UC3 = zlib:inflate(Z, Split), % Test multivec.
?m(UnCompSz, byte_size(list_to_binary(UC3))),
?m(true, zlib:crc32(Z,UC3) == zlib:crc32(Z,ORIG)),
?m(CRC, zlib:crc32(Z)),
?m(ok, zlib:inflateEnd(Z)),
-
+
?m(ok, zlib:inflateInit(Z, -15)),
?m(ok, zlib:setBufSize(Z, UnCompSz *2)),
- ?line UC4 = zlib:inflate(Z, Compressed),
+ UC4 = zlib:inflate(Z, Compressed),
?m(UnCompSz, byte_size(list_to_binary(UC4))),
?m(CRC, zlib:crc32(Z)),
?m(CRC, zlib:crc32(Z,UC4)),
?m(true, zlib:crc32(Z,UC4) == zlib:crc32(Z,ORIG)),
?m(ok, zlib:inflateEnd(Z)),
-
- ?line C1 = zlib:zip(ORIG),
- ?line UC5 = zlib:unzip(C1),
+
+ C1 = zlib:zip(ORIG),
+ UC5 = zlib:unzip(C1),
?m(CRC, zlib:crc32(Z,UC5)),
?m(true,zlib:crc32(Z,UC5) == zlib:crc32(Z,ORIG)),
-
+
?m(ok, zlib:deflateInit(Z, default, deflated, -15, 8, default)),
- ?line C2 = zlib:deflate(Z, ORIG, finish),
+ C2 = zlib:deflate(Z, ORIG, finish),
?m(true, C1 == list_to_binary(C2)),
?m(ok, zlib:deflateEnd(Z)),
-
+
?m(ok, zlib:deflateInit(Z, none, deflated, -15, 8, filtered)),
?m(ok, zlib:deflateParams(Z, default, default)),
- ?line C3 = zlib:deflate(Z, ORIG, finish),
+ C3 = zlib:deflate(Z, ORIG, finish),
?m(true, C1 == list_to_binary(C3)),
?m(ok, zlib:deflateEnd(Z)),
- ?line ok = zlib:close(Z),
- ?line ok.
+ ok = zlib:close(Z),
+ ok.
-gz_usage(doc) -> "Test a standard compressed gzipped file";
-gz_usage(suite) -> [];
+%% Test a standard compressed gzipped file.
gz_usage(Config) when is_list(Config) ->
gz_usage(gz_usage({get_arg,Config}));
gz_usage({get_arg,Config}) ->
- ?line Out = conf(data_dir,Config),
- ?line {ok,GZIP} = file:read_file(filename:join(Out,"zipdoc.1.gz")),
- ?line {ok,ORIG} = file:read_file(filename:join(Out,"zipdoc")),
- ?line {ok,GZIP2} = file:read_file(filename:join(Out,"zipdoc.txt.gz")),
+ Out = conf(data_dir,Config),
+ {ok,GZIP} = file:read_file(filename:join(Out,"zipdoc.1.gz")),
+ {ok,ORIG} = file:read_file(filename:join(Out,"zipdoc")),
+ {ok,GZIP2} = file:read_file(filename:join(Out,"zipdoc.txt.gz")),
{run,GZIP,ORIG,GZIP2};
gz_usage({run,GZIP,ORIG,GZIP2}) ->
- ?line Z = zlib:open(),
- ?line UC1 = zlib:gunzip(GZIP),
+ Z = zlib:open(),
+ UC1 = zlib:gunzip(GZIP),
?m(true,zlib:crc32(Z,UC1) == zlib:crc32(Z,ORIG)),
- ?line UC3 = zlib:gunzip(GZIP2),
+ UC3 = zlib:gunzip(GZIP2),
?m(true,zlib:crc32(Z,UC3) == zlib:crc32(Z,ORIG)),
- ?line Compressed = zlib:gzip(ORIG),
- ?line UC5 = zlib:gunzip(Compressed),
+ Compressed = zlib:gzip(ORIG),
+ UC5 = zlib:gunzip(Compressed),
?m(true,zlib:crc32(Z,UC5) == zlib:crc32(Z,ORIG)),
- ?line ok = zlib:close(Z).
+ ok = zlib:close(Z).
-gz_usage2(doc) -> "Test more of a standard compressed gzipped file";
-gz_usage2(suite) -> [];
+%% Test more of a standard compressed gzipped file.
gz_usage2(Config) ->
case os:find_executable("gzip") of
Name when is_list(Name) ->
- ?line Z = zlib:open(),
- ?line Out = conf(data_dir,Config),
- ?line {ok,ORIG} = file:read_file(filename:join(Out,"zipdoc")),
- ?line Compressed = zlib:gzip(ORIG),
+ Z = zlib:open(),
+ Out = conf(data_dir,Config),
+ {ok,ORIG} = file:read_file(filename:join(Out,"zipdoc")),
+ Compressed = zlib:gzip(ORIG),
GzOutFile = filename:join(Out,"out.gz"),
OutFile = filename:join(Out,"out.txt"),
?m(ok, file:write_file(GzOutFile,Compressed)),
- ?line os:cmd("gzip -c -d " ++ GzOutFile ++ " > " ++ OutFile),
+ os:cmd("gzip -c -d " ++ GzOutFile ++ " > " ++ OutFile),
case file:read_file(OutFile) of
{ok,ExtDecompressed} ->
?m(true,
@@ -731,83 +688,80 @@ gz_usage2(Config) ->
io:format("Couldn't test external decompressor ~p\n",
[Error])
end,
- ?line ok = zlib:close(Z),
+ ok = zlib:close(Z),
ok;
false ->
{skipped,"No gzip in path"}
end.
-
-compress_usage(doc) ->
- "Test that (de)compress funcs work with"
- " standard tools, for example a chunk from a png file";
-compress_usage(suite) -> [];
+
+%% Test that (de)compress funcs work with standard tools, for example
+%% a chunk from a png file.
compress_usage(Config) when is_list(Config) ->
compress_usage(compress_usage({get_arg,Config}));
compress_usage({get_arg,Config}) ->
- ?line Out = conf(data_dir,Config),
- ?line {ok,C1} = file:read_file(filename:join(Out,"png-compressed.zlib")),
+ Out = conf(data_dir,Config),
+ {ok,C1} = file:read_file(filename:join(Out,"png-compressed.zlib")),
{run,C1};
compress_usage({run,C1}) ->
- ?line Z = zlib:open(),
+ Z = zlib:open(),
%% See that we can uncompress a file generated with external prog.
- ?line UC1 = zlib:uncompress(C1),
+ UC1 = zlib:uncompress(C1),
%% Check that the crc are correct.
?m(4125865008,zlib:crc32(Z,UC1)),
- ?line C2 = zlib:compress(UC1),
- ?line UC2 = zlib:uncompress(C2),
+ C2 = zlib:compress(UC1),
+ UC2 = zlib:uncompress(C2),
%% Check that the crc are correct.
?m(4125865008,zlib:crc32(Z,UC2)),
-
- ?line ok = zlib:close(Z),
+
+ ok = zlib:close(Z),
D = [<<"We tests some partial">>,
<<"data, sent over">>,
<<"the stream">>,
<<"we check that we can unpack">>,
<<"every message we get">>],
-
- ?line ZC = zlib:open(),
- ?line ZU = zlib:open(),
+
+ ZC = zlib:open(),
+ ZU = zlib:open(),
Test = fun(finish, {_,Tot}) ->
- ?line Compressed = zlib:deflate(ZC, <<>>, finish),
+ Compressed = zlib:deflate(ZC, <<>>, finish),
Data = zlib:inflate(ZU, Compressed),
[Tot|Data];
(Data, {Op,Tot}) ->
- ?line Compressed = zlib:deflate(ZC, Data, Op),
+ Compressed = zlib:deflate(ZC, Data, Op),
Res1 = ?m([Data],zlib:inflate(ZU, Compressed)),
{Op, [Tot|Res1]}
end,
- ?line zlib:deflateInit(ZC),
- ?line zlib:inflateInit(ZU),
- ?line T1 = lists:foldl(Test,{sync,[]},D++[finish]),
+ zlib:deflateInit(ZC),
+ zlib:inflateInit(ZU),
+ T1 = lists:foldl(Test,{sync,[]},D++[finish]),
?m(true, list_to_binary(D) == list_to_binary(T1)),
- ?line zlib:deflateEnd(ZC),
- ?line zlib:inflateEnd(ZU),
-
- ?line zlib:deflateInit(ZC),
- ?line zlib:inflateInit(ZU),
- ?line T2 = lists:foldl(Test,{full,[]},D++[finish]),
+ zlib:deflateEnd(ZC),
+ zlib:inflateEnd(ZU),
+
+ zlib:deflateInit(ZC),
+ zlib:inflateInit(ZU),
+ T2 = lists:foldl(Test,{full,[]},D++[finish]),
?m(true, list_to_binary(D) == list_to_binary(T2)),
- ?line zlib:deflateEnd(ZC),
- ?line zlib:inflateEnd(ZU),
-
- ?line ok = zlib:close(ZC),
- ?line ok = zlib:close(ZU).
+ zlib:deflateEnd(ZC),
+ zlib:inflateEnd(ZU),
+ ok = zlib:close(ZC),
+ ok = zlib:close(ZU).
-crc(doc) -> "Check that crc works as expected";
-crc(suite) -> [];
+
+%% Check that crc works as expected.
crc(Config) when is_list(Config) ->
crc(crc({get_arg,Config}));
crc({get_arg,Config}) ->
- ?line Out = conf(data_dir,Config),
- ?line {ok,C1} = file:read_file(filename:join(Out,"zipdoc")),
+ Out = conf(data_dir,Config),
+ {ok,C1} = file:read_file(filename:join(Out,"zipdoc")),
{run,C1};
crc({run,C1}) ->
- ?line Z = zlib:open(),
- ?line Crc = zlib:crc32(Z, C1),
+ Z = zlib:open(),
+ Crc = zlib:crc32(Z, C1),
Bins = split_bin(C1,[]),
%%io:format("Length ~p ~p ~n", [length(Bins), [size(Bin) || Bin <- Bins]]),
Last = lists:last(Bins),
@@ -817,29 +771,28 @@ crc({run,C1}) ->
Crc1
end, 0, Bins),
?m(Crc,SCrc),
- ?line [First|Rest] = Bins,
+ [First|Rest] = Bins,
Combine = fun(Bin, CS1) ->
CS2 = zlib:crc32(Z, Bin),
S2 = byte_size(Bin),
zlib:crc32_combine(Z,CS1,CS2,S2)
end,
- ?line Comb = lists:foldl(Combine, zlib:crc32(Z, First), Rest),
+ Comb = lists:foldl(Combine, zlib:crc32(Z, First), Rest),
?m(Crc,Comb),
- ?line ok = zlib:close(Z).
+ ok = zlib:close(Z).
-adler(doc) -> "Check that adler works as expected";
-adler(suite) -> [];
+%% Check that adler works as expected.
adler(Config) when is_list(Config) ->
adler(adler({get_arg,Config}));
adler({get_arg,Config}) ->
- ?line Out = conf(data_dir,Config),
+ Out = conf(data_dir,Config),
File1 = filename:join(Out,"zipdoc"),
- ?line {ok,C1} = file:read_file(File1),
+ {ok,C1} = file:read_file(File1),
{run,C1};
adler({run,C1}) ->
- ?line Z = zlib:open(),
+ Z = zlib:open(),
?m(1, zlib:adler32(Z,<<>>)),
- ?line Crc = zlib:adler32(Z, C1),
+ Crc = zlib:adler32(Z, C1),
Bins = split_bin(C1,[]),
Last = lists:last(Bins),
SCrc = lists:foldl(fun(Bin,Crc0) ->
@@ -848,43 +801,42 @@ adler({run,C1}) ->
Crc1
end, zlib:adler32(Z,<<>>), Bins),
?m(Crc,SCrc),
- ?line [First|Rest] = Bins,
+ [First|Rest] = Bins,
Combine = fun(Bin, CS1) ->
CS2 = zlib:adler32(Z, Bin),
S2 = byte_size(Bin),
zlib:adler32_combine(Z,CS1,CS2,S2)
end,
- ?line Comb = lists:foldl(Combine, zlib:adler32(Z, First), Rest),
+ Comb = lists:foldl(Combine, zlib:adler32(Z, First), Rest),
?m(Crc,Comb),
- ?line ok = zlib:close(Z).
+ ok = zlib:close(Z).
-dictionary_usage(doc) -> "Test dictionary usage";
-dictionary_usage(suite) -> [];
+%% Test dictionary usage.
dictionary_usage(Config) when is_list(Config) ->
dictionary_usage(dictionary_usage({get_arg,Config}));
dictionary_usage({get_arg,_Config}) ->
{run}; % no args
dictionary_usage({run}) ->
- ?line Z1 = zlib:open(),
+ Z1 = zlib:open(),
Dict = <<"Anka">>,
Data = <<"Kalle Anka">>,
?m(ok, zlib:deflateInit(Z1)),
- ?line DictID = zlib:deflateSetDictionary(Z1, Dict),
- %% ?line io:format("DictID = ~p\n", [DictID]),
- ?line B1 = zlib:deflate(Z1, Data),
- ?line B2 = zlib:deflate(Z1, <<>>, finish),
+ DictID = zlib:deflateSetDictionary(Z1, Dict),
+ %% io:format("DictID = ~p\n", [DictID]),
+ B1 = zlib:deflate(Z1, Data),
+ B2 = zlib:deflate(Z1, <<>>, finish),
?m(ok, zlib:deflateEnd(Z1)),
?m(ok, zlib:close(Z1)),
Compressed = list_to_binary([B1,B2]),
%% io:format("~p\n", [Compressed]),
%% Now uncompress.
- ?line Z2 = zlib:open(),
+ Z2 = zlib:open(),
?m(ok, zlib:inflateInit(Z2)),
- ?line {'EXIT',{{need_dictionary,DictID},_}} = (catch zlib:inflate(Z2, Compressed)),
+ {'EXIT',{{need_dictionary,DictID},_}} = (catch zlib:inflate(Z2, Compressed)),
?m(ok, zlib:inflateSetDictionary(Z2, Dict)),
?m(ok, zlib:inflateSetDictionary(Z2, binary_to_list(Dict))),
- ?line Uncompressed = ?m(B when is_list(B), zlib:inflate(Z2, [])),
+ Uncompressed = ?m(B when is_list(B), zlib:inflate(Z2, [])),
?m(ok, zlib:inflateEnd(Z2)),
?m(ok, zlib:close(Z2)),
?m(Data, list_to_binary(Uncompressed)).
@@ -895,8 +847,7 @@ split_bin(Last,Acc) ->
lists:reverse([Last|Acc]).
-smp(doc) -> "Check concurrent access to zlib driver";
-smp(suite) -> [];
+%% Check concurrent access to zlib driver.
smp(Config) ->
case erlang:system_info(smp_support) of
true ->
@@ -921,7 +872,7 @@ smp(Config) ->
false ->
{skipped,"No smp support"}
end.
-
+
worker(Seed, FnATpl, Parent) ->
io:format("smp worker ~p, seed=~p~n",[self(),Seed]),
@@ -936,30 +887,29 @@ worker_loop(N, FnATpl) ->
{F,A} = element(rand:uniform(tuple_size(FnATpl)), FnATpl),
?MODULE:F(A),
worker_loop(N-1, FnATpl).
-
+
wait_pids([]) ->
ok;
wait_pids(Pids) ->
receive
Pid ->
- ?line true = lists:member(Pid,Pids),
+ true = lists:member(Pid,Pids),
Others = lists:delete(Pid,Pids),
io:format("wait_pid got ~p, still waiting for ~p\n",[Pid,Others]),
wait_pids(Others)
end.
-otp_7359(doc) -> "Deflate/inflate data with size close to multiple of internal buffer size";
-otp_7359(suite) -> [];
+%% Deflate/inflate data with size close to multiple of internal buffer size.
otp_7359(_Config) ->
%% Find compressed size
ZTry = zlib:open(),
ok = zlib:deflateInit(ZTry),
ISize = zlib:getBufSize(ZTry),
IData = list_to_binary([Byte band 255 || Byte <- lists:seq(1,ISize)]),
- ?line ISize = byte_size(IData),
+ ISize = byte_size(IData),
- ?line DSize = iolist_size(zlib:deflate(ZTry, IData, sync)),
+ DSize = iolist_size(zlib:deflate(ZTry, IData, sync)),
zlib:close(ZTry),
io:format("Deflated try ~p -> ~p bytes~n", [ISize, DSize]),
@@ -981,19 +931,19 @@ otp_7359(_Config) ->
otp_7359_def_inf(Data,{DefSize,InfSize}) ->
%%io:format("Try: DefSize=~p InfSize=~p~n", [DefSize,InfSize]),
- ?line ZDef = zlib:open(),
- ?line ok = zlib:deflateInit(ZDef),
- ?line ok = zlib:setBufSize(ZDef,DefSize),
- ?line DefData = iolist_to_binary(zlib:deflate(ZDef, Data, sync)),
+ ZDef = zlib:open(),
+ ok = zlib:deflateInit(ZDef),
+ ok = zlib:setBufSize(ZDef,DefSize),
+ DefData = iolist_to_binary(zlib:deflate(ZDef, Data, sync)),
%%io:format("Deflated ~p(~p) -> ~p(~p) bytes~n",
%% [byte_size(Data), InfSize, byte_size(DefData), DefSize]),
- ?line ok = zlib:close(ZDef),
+ ok = zlib:close(ZDef),
- ?line ZInf = zlib:open(),
- ?line ok = zlib:inflateInit(ZInf),
- ?line ok = zlib:setBufSize(ZInf,InfSize),
- ?line Data = iolist_to_binary(zlib:inflate(ZInf, DefData)),
- ?line ok = zlib:close(ZInf),
+ ZInf = zlib:open(),
+ ok = zlib:inflateInit(ZInf),
+ ok = zlib:setBufSize(ZInf,InfSize),
+ Data = iolist_to_binary(zlib:inflate(ZInf, DefData)),
+ ok = zlib:close(ZInf),
ok.
otp_9981(Config) when is_list(Config) ->
@@ -1013,13 +963,13 @@ otp_9981(Config) when is_list(Config) ->
Ports = lists:sort(erlang:ports()),
ok.
-
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Helps with testing directly %%%%%%%%%%%%%
conf(What,Config) ->
- try ?config(What,Config) of
+ try proplists:get_value(What,Config) of
undefined ->
"./zlib_SUITE_data";
Dir ->
diff --git a/lib/observer/test/crashdump_viewer_SUITE.erl b/lib/observer/test/crashdump_viewer_SUITE.erl
index 2d47054600..a2b96ecb88 100644
--- a/lib/observer/test/crashdump_viewer_SUITE.erl
+++ b/lib/observer/test/crashdump_viewer_SUITE.erl
@@ -563,22 +563,11 @@ dump_with_strange_module_name(DataDir,Rel,DumpName) ->
CD.
dump(Node,DataDir,Rel,DumpName) ->
+ Crashdump = filename:join(DataDir, dump_prefix(Rel)++DumpName),
+ rpc:call(Node,os,putenv,["ERL_CRASH_DUMP",Crashdump]),
rpc:call(Node,erlang,halt,[DumpName]),
- Crashdump0 = filename:join(filename:dirname(code:which(?t)),
- "erl_crash_dump.n1"),
- Crashdump1 = filename:join(DataDir, dump_prefix(Rel)++DumpName),
- ok = rename(Crashdump0,Crashdump1),
- Crashdump1.
-
-rename(From,To) ->
- ok = check_complete(From),
- case file:rename(From,To) of
- {error,exdev} ->
- {ok,_} = file:copy(From,To),
- ok = file:delete(From);
- ok ->
- ok
- end.
+ ok = check_complete(Crashdump),
+ Crashdump.
check_complete(File) ->
check_complete1(File,10).
diff --git a/lib/public_key/src/pubkey_pem.erl b/lib/public_key/src/pubkey_pem.erl
index 6a722b0525..d163004c7c 100644
--- a/lib/public_key/src/pubkey_pem.erl
+++ b/lib/public_key/src/pubkey_pem.erl
@@ -103,7 +103,7 @@ encode_pem_entry({'PrivateKeyInfo', Der, EncParams}) ->
[StartStr, "\n", b64encode_and_split(EncDer), "\n", pem_end(StartStr) ,"\n\n"];
encode_pem_entry({Type, Der, {Cipher, Salt}}) ->
StartStr = pem_start(Type),
- [StartStr,"\n", pem_decrypt(),"\n", pem_decrypt_info(Cipher, Salt),"\n",
+ [StartStr,"\n", pem_decrypt(),"\n", pem_decrypt_info(Cipher, Salt),"\n\n",
b64encode_and_split(Der), "\n", pem_end(StartStr) ,"\n\n"].
decode_pem_entries([], Entries) ->
diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl
index 5e677f31d6..ea5e036a7e 100644
--- a/lib/public_key/test/public_key_SUITE.erl
+++ b/lib/public_key/test/public_key_SUITE.erl
@@ -189,6 +189,8 @@ encrypted_pem(Config) when is_list(Config) ->
erl_make_certs:der_to_pem(DesKeyFile, [Entry1]),
[{'RSAPrivateKey', _, {"DES-CBC", Salt1}} =Entry2] =
erl_make_certs:pem_to_der(DesKeyFile),
+ {ok, Pem} = file:read_file(DesKeyFile),
+ check_encapsulated_header(Pem),
true = check_entry_type(public_key:pem_entry_decode(Entry2, "4567efgh"),
'RSAPrivateKey').
@@ -826,6 +828,15 @@ check_entry_type(#'Certificate'{}, 'Certificate') ->
check_entry_type(_,_) ->
false.
+check_encapsulated_header(Pem) when is_binary(Pem)->
+ check_encapsulated_header( binary:split(Pem, <<"\n">>, [global]));
+check_encapsulated_header([<<"DEK-Info: DES-CBC,FB7577791A9056A1">>, <<>> | _]) ->
+ true;
+check_encapsulated_header([ _ | Rest]) ->
+ check_encapsulated_header(Rest);
+check_encapsulated_header([]) ->
+ false.
+
strip_ending_newlines(Bin) ->
string:strip(binary_to_list(Bin), right, 10).
diff --git a/lib/runtime_tools/c_src/trace_file_drv.c b/lib/runtime_tools/c_src/trace_file_drv.c
index a63a7d3ad9..8863b0d6ac 100644
--- a/lib/runtime_tools/c_src/trace_file_drv.c
+++ b/lib/runtime_tools/c_src/trace_file_drv.c
@@ -75,12 +75,8 @@
#ifdef DEBUG
-#ifndef __WIN32__
-#define ASSERT(X) do {if (!(X)) {erl_exit(1,"%s",#X);} } while(0)
-#else
#include <assert.h>
#define ASSERT(X) assert(X)
-#endif
#else
#define ASSERT(X)
#endif
diff --git a/lib/runtime_tools/c_src/trace_ip_drv.c b/lib/runtime_tools/c_src/trace_ip_drv.c
index f7b5ea65cb..5b43f8179e 100644
--- a/lib/runtime_tools/c_src/trace_ip_drv.c
+++ b/lib/runtime_tools/c_src/trace_ip_drv.c
@@ -44,19 +44,8 @@
#endif
#ifdef DEBUG
-# ifndef __WIN32__
- /* erl_exit is not available to dll_drivers on windows. */
- void erl_exit(int, char *, ...);
-# define ASSERT(X) \
- do { \
- if (!(X)) { \
- erl_exit(1,"%s",#X); \
- } \
- } while(0)
-# else
-# include <assert.h>
-# define ASSERT(X) assert(X)
-# endif
+# include <assert.h>
+# define ASSERT(X) assert(X)
#else
# define ASSERT(X)
#endif
diff --git a/lib/sasl/src/sasl.appup.src b/lib/sasl/src/sasl.appup.src
index 8faa0afbd4..ca5122dab4 100644
--- a/lib/sasl/src/sasl.appup.src
+++ b/lib/sasl/src/sasl.appup.src
@@ -18,9 +18,9 @@
%% %CopyrightEnd%
{"%VSN%",
%% Up from - max one major revision back
- [{<<"2\\.[5-6](\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-18.*
- {<<"2\\.4(\\.[0-9]+)*">>,[restart_new_emulator]}], % OTP-17
+ [{<<"3\\.0(\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-19.*
+ {<<"2\\.[5-7](\\.[0-9]+)*">>,[restart_new_emulator]}], % OTP-18.*
%% Down to - max one major revision back
- [{<<"2\\.[5-6](\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-18.*
- {<<"2\\.4(\\.[0-9]+)*">>,[restart_new_emulator]}] % OTP-17
+ [{<<"3\\.0(\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-19.*
+ {<<"2\\.[5-7](\\.[0-9]+)*">>,[restart_new_emulator]}] % OTP-18.*
}.
diff --git a/lib/ssh/test/ssh_algorithms_SUITE.erl b/lib/ssh/test/ssh_algorithms_SUITE.erl
index a03a9ee0f2..49ed15698c 100644
--- a/lib/ssh/test/ssh_algorithms_SUITE.erl
+++ b/lib/ssh/test/ssh_algorithms_SUITE.erl
@@ -36,7 +36,7 @@
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,5}}].
+ {timetrap,{minutes,10}}].
all() ->
%% [{group,kex},{group,cipher}... etc
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl
index 564fb66586..094d28e879 100644
--- a/lib/ssh/test/ssh_basic_SUITE.erl
+++ b/lib/ssh/test/ssh_basic_SUITE.erl
@@ -79,7 +79,7 @@
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,5}}].
+ {timetrap,{minutes,10}}].
all() ->
[app_test,
diff --git a/lib/ssh/test/ssh_connection_SUITE.erl b/lib/ssh/test/ssh_connection_SUITE.erl
index 67d870bea4..6e90faf0e8 100644
--- a/lib/ssh/test/ssh_connection_SUITE.erl
+++ b/lib/ssh/test/ssh_connection_SUITE.erl
@@ -37,7 +37,7 @@
%% [{ct_hooks,[ts_install_cth]}].
suite() ->
- [{timetrap,{minutes,5}}].
+ [{timetrap,{minutes,2}}].
all() ->
[
diff --git a/lib/ssh/test/ssh_options_SUITE.erl b/lib/ssh/test/ssh_options_SUITE.erl
index e0ef3a4b05..ba0107efd6 100644
--- a/lib/ssh/test/ssh_options_SUITE.erl
+++ b/lib/ssh/test/ssh_options_SUITE.erl
@@ -80,7 +80,7 @@
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,5}}].
+ {timetrap,{minutes,6}}].
all() ->
[connectfun_disconnectfun_server,
diff --git a/lib/ssh/test/ssh_protocol_SUITE.erl b/lib/ssh/test/ssh_protocol_SUITE.erl
index cabdd35615..dbba48c726 100644
--- a/lib/ssh/test/ssh_protocol_SUITE.erl
+++ b/lib/ssh/test/ssh_protocol_SUITE.erl
@@ -43,7 +43,7 @@
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,5}}].
+ {timetrap,{minutes,2}}].
all() ->
[{group,tool_tests},
diff --git a/lib/ssh/test/ssh_renegotiate_SUITE.erl b/lib/ssh/test/ssh_renegotiate_SUITE.erl
index fabe9a5829..6d2c97aa68 100644
--- a/lib/ssh/test/ssh_renegotiate_SUITE.erl
+++ b/lib/ssh/test/ssh_renegotiate_SUITE.erl
@@ -31,7 +31,7 @@
%%--------------------------------------------------------------------
suite() -> [{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,15}}].
+ {timetrap,{minutes,12}}].
all() -> [{group,default_algs},
diff --git a/lib/ssh/test/ssh_sftp_SUITE.erl b/lib/ssh/test/ssh_sftp_SUITE.erl
index 6066221fc7..c2b04d7a05 100644
--- a/lib/ssh/test/ssh_sftp_SUITE.erl
+++ b/lib/ssh/test/ssh_sftp_SUITE.erl
@@ -36,7 +36,7 @@
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,5}}].
+ {timetrap,{minutes,2}}].
all() ->
diff --git a/lib/ssh/test/ssh_sftpd_SUITE.erl b/lib/ssh/test/ssh_sftpd_SUITE.erl
index 687f327206..45439ce0fa 100644
--- a/lib/ssh/test/ssh_sftpd_SUITE.erl
+++ b/lib/ssh/test/ssh_sftpd_SUITE.erl
@@ -45,7 +45,7 @@
%%--------------------------------------------------------------------
suite() ->
- [{timetrap,{minutes,5}}].
+ [{timetrap,{minutes,3}}].
all() ->
[open_close_file,
diff --git a/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl b/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
index 84410f60e6..02a2ac4cf9 100644
--- a/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
+++ b/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
@@ -37,7 +37,7 @@
suite() ->
[{ct_hooks,[ts_install_cth]},
- {timetrap,{minutes,5}}].
+ {timetrap,{minutes,2}}].
all() ->
diff --git a/lib/ssh/test/ssh_sup_SUITE.erl b/lib/ssh/test/ssh_sup_SUITE.erl
index 5c77fcf1ef..18e91a9af3 100644
--- a/lib/ssh/test/ssh_sup_SUITE.erl
+++ b/lib/ssh/test/ssh_sup_SUITE.erl
@@ -34,6 +34,10 @@
%% Common Test interface functions -----------------------------------
%%--------------------------------------------------------------------
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
+
all() ->
[default_tree, sshc_subtree, sshd_subtree, sshd_subtree_profile].
diff --git a/lib/ssh/test/ssh_to_openssh_SUITE.erl b/lib/ssh/test/ssh_to_openssh_SUITE.erl
index 37885dfdef..2788bc6b58 100644
--- a/lib/ssh/test/ssh_to_openssh_SUITE.erl
+++ b/lib/ssh/test/ssh_to_openssh_SUITE.erl
@@ -34,7 +34,7 @@
%%--------------------------------------------------------------------
suite() ->
- [{timetrap,{minutes,5}}].
+ [{timetrap,{minutes,1}}].
all() ->
case os:find_executable("ssh") of
diff --git a/lib/ssh/test/ssh_upgrade_SUITE.erl b/lib/ssh/test/ssh_upgrade_SUITE.erl
index 006483d3ee..bf8874b118 100644
--- a/lib/ssh/test/ssh_upgrade_SUITE.erl
+++ b/lib/ssh/test/ssh_upgrade_SUITE.erl
@@ -39,7 +39,7 @@
%%% CommonTest callbacks
%%%
suite() ->
- [{timetrap,{minutes,5}}].
+ [{timetrap,{minutes,2}}].
all() ->
[
diff --git a/lib/ssl/doc/src/ssl_distribution.xml b/lib/ssl/doc/src/ssl_distribution.xml
index a347ce5ae6..dc04d446b0 100644
--- a/lib/ssl/doc/src/ssl_distribution.xml
+++ b/lib/ssl/doc/src/ssl_distribution.xml
@@ -271,4 +271,27 @@ Eshell V5.0 (abort with ^G)
<p>The <c>init:get_arguments()</c> call verifies that the correct
arguments are supplied to the emulator.</p>
</section>
+
+ <section>
+ <title>Using SSL distribution over IPv6</title>
+ <p>It is possible to use SSL distribution over IPv6 instead of
+ IPv4. To do this, pass the option <c>-proto_dist inet6_tls</c>
+ instead of <c>-proto_dist inet_tls</c> when starting Erlang,
+ either on the command line or in the <c>ERL_FLAGS</c> environment
+ variable.</p>
+
+ <p>An example command line with this option would look like this:</p>
+ <code type="none">
+$ erl -boot /home/me/ssl/start_ssl -proto_dist inet6_tls
+ -ssl_dist_opt server_certfile "/home/me/ssl/erlserver.pem"
+ -ssl_dist_opt server_secure_renegotiate true client_secure_renegotiate true
+ -sname ssl_test
+Erlang (BEAM) emulator version 5.0 [source]
+
+Eshell V5.0 (abort with ^G)
+(ssl_test@myhost)1> </code>
+
+ <p>A node started in this way will only be able to communicate with
+ other nodes using SSL distribution over IPv6.</p>
+ </section>
</chapter>
diff --git a/lib/ssl/src/Makefile b/lib/ssl/src/Makefile
index 790328dc45..7a7a373487 100644
--- a/lib/ssl/src/Makefile
+++ b/lib/ssl/src/Makefile
@@ -51,6 +51,7 @@ MODULES= \
ssl_dist_sup\
ssl_sup \
inet_tls_dist \
+ inet6_tls_dist \
ssl_certificate\
ssl_pkix_db\
ssl_cipher \
diff --git a/lib/ssl/src/inet6_tls_dist.erl b/lib/ssl/src/inet6_tls_dist.erl
new file mode 100644
index 0000000000..ffd7296f93
--- /dev/null
+++ b/lib/ssl/src/inet6_tls_dist.erl
@@ -0,0 +1,46 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2015. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+-module(inet6_tls_dist).
+
+-export([childspecs/0, listen/1, accept/1, accept_connection/5,
+ setup/5, close/1, select/1]).
+
+childspecs() ->
+ inet_tls_dist:childspecs().
+
+select(Node) ->
+ inet_tls_dist:gen_select(inet6_tcp, Node).
+
+listen(Name) ->
+ inet_tls_dist:gen_listen(inet6_tcp, Name).
+
+accept(Listen) ->
+ inet_tls_dist:gen_accept(inet6_tcp, Listen).
+
+accept_connection(AcceptPid, Socket, MyNode, Allowed, SetupTime) ->
+ inet_tls_dist:gen_accept_connection(inet6_tcp, AcceptPid, Socket, MyNode, Allowed, SetupTime).
+
+setup(Node, Type, MyNode, LongOrShortNames,SetupTime) ->
+ inet_tls_dist:gen_setup(inet6_tcp, Node, Type, MyNode, LongOrShortNames,SetupTime).
+
+close(Socket) ->
+ inet_tls_dist:close(Socket).
diff --git a/lib/ssl/src/inet_tls_dist.erl b/lib/ssl/src/inet_tls_dist.erl
index 6fe99a81c5..ec26142a75 100644
--- a/lib/ssl/src/inet_tls_dist.erl
+++ b/lib/ssl/src/inet_tls_dist.erl
@@ -24,6 +24,10 @@
-export([childspecs/0, listen/1, accept/1, accept_connection/5,
setup/5, close/1, select/1, is_node_name/1]).
+%% Generalized dist API
+-export([gen_listen/2, gen_accept/2, gen_accept_connection/6,
+ gen_setup/6, gen_select/2]).
+
-include_lib("kernel/include/net_address.hrl").
-include_lib("kernel/include/dist.hrl").
-include_lib("kernel/include/dist_util.hrl").
@@ -33,9 +37,15 @@ childspecs() ->
permanent, infinity, supervisor, [ssl_dist_sup]}]}.
select(Node) ->
+ gen_select(inet_tcp, Node).
+
+gen_select(Driver, Node) ->
case split_node(atom_to_list(Node), $@, []) of
- [_,_Host] ->
- true;
+ [_, Host] ->
+ case inet:getaddr(Host, Driver:family()) of
+ {ok, _} -> true;
+ _ -> false
+ end;
_ ->
false
end.
@@ -46,23 +56,35 @@ is_node_name(_) ->
false.
listen(Name) ->
- ssl_tls_dist_proxy:listen(Name).
+ gen_listen(inet_tcp, Name).
+
+gen_listen(Driver, Name) ->
+ ssl_tls_dist_proxy:listen(Driver, Name).
accept(Listen) ->
- ssl_tls_dist_proxy:accept(Listen).
+ gen_accept(inet_tcp, Listen).
+
+gen_accept(Driver, Listen) ->
+ ssl_tls_dist_proxy:accept(Driver, Listen).
accept_connection(AcceptPid, Socket, MyNode, Allowed, SetupTime) ->
+ gen_accept_connection(inet_tcp, AcceptPid, Socket, MyNode, Allowed, SetupTime).
+
+gen_accept_connection(Driver, AcceptPid, Socket, MyNode, Allowed, SetupTime) ->
Kernel = self(),
- spawn_link(fun() -> do_accept(Kernel, AcceptPid, Socket,
+ spawn_link(fun() -> do_accept(Driver, Kernel, AcceptPid, Socket,
MyNode, Allowed, SetupTime) end).
setup(Node, Type, MyNode, LongOrShortNames,SetupTime) ->
+ gen_setup(inet_tcp, Node, Type, MyNode, LongOrShortNames,SetupTime).
+
+gen_setup(Driver, Node, Type, MyNode, LongOrShortNames,SetupTime) ->
Kernel = self(),
- spawn_opt(fun() -> do_setup(Kernel, Node, Type, MyNode, LongOrShortNames, SetupTime) end, [link, {priority, max}]).
+ spawn_opt(fun() -> do_setup(Driver, Kernel, Node, Type, MyNode, LongOrShortNames, SetupTime) end, [link, {priority, max}]).
-do_setup(Kernel, Node, Type, MyNode, LongOrShortNames, SetupTime) ->
- [Name, Address] = splitnode(Node, LongOrShortNames),
- case inet:getaddr(Address, inet) of
+do_setup(Driver, Kernel, Node, Type, MyNode, LongOrShortNames, SetupTime) ->
+ [Name, Address] = splitnode(Driver, Node, LongOrShortNames),
+ case inet:getaddr(Address, Driver:family()) of
{ok, Ip} ->
Timer = dist_util:start_timer(SetupTime),
case erl_epmd:port_please(Name, Ip) of
@@ -70,7 +92,7 @@ do_setup(Kernel, Node, Type, MyNode, LongOrShortNames, SetupTime) ->
?trace("port_please(~p) -> version ~p~n",
[Node,Version]),
dist_util:reset_timer(Timer),
- case ssl_tls_dist_proxy:connect(Ip, TcpPort) of
+ case ssl_tls_dist_proxy:connect(Driver, Ip, TcpPort) of
{ok, Socket} ->
HSData = connect_hs_data(Kernel, Node, MyNode, Socket,
Timer, Version, Ip, TcpPort, Address,
@@ -99,12 +121,12 @@ close(Socket) ->
gen_tcp:close(Socket),
ok.
-do_accept(Kernel, AcceptPid, Socket, MyNode, Allowed, SetupTime) ->
+do_accept(Driver, Kernel, AcceptPid, Socket, MyNode, Allowed, SetupTime) ->
process_flag(priority, max),
receive
{AcceptPid, controller} ->
Timer = dist_util:start_timer(SetupTime),
- case check_ip(Socket) of
+ case check_ip(Driver, Socket) of
true ->
HSData = accept_hs_data(Kernel, MyNode, Socket, Timer, Allowed),
dist_util:handshake_other_started(HSData);
@@ -118,12 +140,12 @@ do_accept(Kernel, AcceptPid, Socket, MyNode, Allowed, SetupTime) ->
%% Do only accept new connection attempts from nodes at our
%% own LAN, if the check_ip environment parameter is true.
%% ------------------------------------------------------------
-check_ip(Socket) ->
+check_ip(Driver, Socket) ->
case application:get_env(check_ip) of
{ok, true} ->
case get_ifs(Socket) of
{ok, IFs, IP} ->
- check_ip(IFs, IP);
+ check_ip(Driver, IFs, IP);
_ ->
?shutdown(no_node)
end;
@@ -142,37 +164,21 @@ get_ifs(Socket) ->
Error
end.
-check_ip([{OwnIP, _, Netmask}|IFs], PeerIP) ->
- case {mask(Netmask, PeerIP), mask(Netmask, OwnIP)} of
+check_ip(Driver, [{OwnIP, _, Netmask}|IFs], PeerIP) ->
+ case {Driver:mask(Netmask, PeerIP), Driver:mask(Netmask, OwnIP)} of
{M, M} -> true;
_ -> check_ip(IFs, PeerIP)
end;
-check_ip([], PeerIP) ->
+check_ip(_Driver, [], PeerIP) ->
{false, PeerIP}.
-mask({M1,M2,M3,M4}, {IP1,IP2,IP3,IP4}) ->
- {M1 band IP1,
- M2 band IP2,
- M3 band IP3,
- M4 band IP4};
-
-mask({M1,M2,M3,M4, M5, M6, M7, M8}, {IP1,IP2,IP3,IP4, IP5, IP6, IP7, IP8}) ->
- {M1 band IP1,
- M2 band IP2,
- M3 band IP3,
- M4 band IP4,
- M5 band IP5,
- M6 band IP6,
- M7 band IP7,
- M8 band IP8}.
-
%% If Node is illegal terminate the connection setup!!
-splitnode(Node, LongOrShortNames) ->
+splitnode(Driver, Node, LongOrShortNames) ->
case split_node(atom_to_list(Node), $@, []) of
[Name|Tail] when Tail =/= [] ->
Host = lists:append(Tail),
- check_node(Name, Node, Host, LongOrShortNames);
+ check_node(Driver, Name, Node, Host, LongOrShortNames);
[_] ->
error_logger:error_msg("** Nodename ~p illegal, no '@' character **~n",
[Node]),
@@ -182,15 +188,20 @@ splitnode(Node, LongOrShortNames) ->
?shutdown(Node)
end.
-check_node(Name, Node, Host, LongOrShortNames) ->
+check_node(Driver, Name, Node, Host, LongOrShortNames) ->
case split_node(Host, $., []) of
[_] when LongOrShortNames == longnames ->
- error_logger:error_msg("** System running to use "
- "fully qualified "
- "hostnames **~n"
- "** Hostname ~s is illegal **~n",
- [Host]),
- ?shutdown(Node);
+ case Driver:parse_address(Host) of
+ {ok, _} ->
+ [Name, Host];
+ _ ->
+ error_logger:error_msg("** System running to use "
+ "fully qualified "
+ "hostnames **~n"
+ "** Hostname ~s is illegal **~n",
+ [Host]),
+ ?shutdown(Node)
+ end;
[_, _ | _] when LongOrShortNames == shortnames ->
error_logger:error_msg("** System NOT running to use fully qualified "
"hostnames **~n"
diff --git a/lib/ssl/src/ssl.app.src b/lib/ssl/src/ssl.app.src
index 619ab7b610..1a2bf90ccf 100644
--- a/lib/ssl/src/ssl.app.src
+++ b/lib/ssl/src/ssl.app.src
@@ -31,6 +31,7 @@
ssl_listen_tracker_sup,
%% Erlang Distribution over SSL/TLS
inet_tls_dist,
+ inet6_tls_dist,
ssl_tls_dist_proxy,
ssl_dist_sup,
%% SSL/TLS session handling
diff --git a/lib/ssl/src/ssl_tls_dist_proxy.erl b/lib/ssl/src/ssl_tls_dist_proxy.erl
index 211badef56..4c789793ec 100644
--- a/lib/ssl/src/ssl_tls_dist_proxy.erl
+++ b/lib/ssl/src/ssl_tls_dist_proxy.erl
@@ -20,7 +20,7 @@
-module(ssl_tls_dist_proxy).
--export([listen/1, accept/1, connect/2, get_tcp_address/1]).
+-export([listen/2, accept/2, connect/3, get_tcp_address/1]).
-export([init/1, start_link/0, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3, ssl_options/2]).
@@ -39,14 +39,14 @@
%% Internal application API
%%====================================================================
-listen(Name) ->
- gen_server:call(?MODULE, {listen, Name}, infinity).
+listen(Driver, Name) ->
+ gen_server:call(?MODULE, {listen, Driver, Name}, infinity).
-accept(Listen) ->
- gen_server:call(?MODULE, {accept, Listen}, infinity).
+accept(Driver, Listen) ->
+ gen_server:call(?MODULE, {accept, Driver, Listen}, infinity).
-connect(Ip, Port) ->
- gen_server:call(?MODULE, {connect, Ip, Port}, infinity).
+connect(Driver, Ip, Port) ->
+ gen_server:call(?MODULE, {connect, Driver, Ip, Port}, infinity).
do_listen(Options) ->
@@ -108,10 +108,11 @@ init([]) ->
process_flag(priority, max),
{ok, #state{}}.
-handle_call({listen, Name}, _From, State) ->
+handle_call({listen, Driver, Name}, _From, State) ->
case gen_tcp:listen(0, [{active, false}, {packet,?PPRE}, {ip, loopback}]) of
{ok, Socket} ->
- {ok, World} = do_listen([{active, false}, binary, {packet,?PPRE}, {reuseaddr, true}]),
+ {ok, World} = do_listen([{active, false}, binary, {packet,?PPRE}, {reuseaddr, true},
+ Driver:family()]),
{ok, TcpAddress} = get_tcp_address(Socket),
{ok, WorldTcpAddress} = get_tcp_address(World),
{_,Port} = WorldTcpAddress#net_address.address,
@@ -126,15 +127,15 @@ handle_call({listen, Name}, _From, State) ->
{reply, Error, State}
end;
-handle_call({accept, Listen}, {From, _}, State = #state{listen={_, World}}) ->
+handle_call({accept, _Driver, Listen}, {From, _}, State = #state{listen={_, World}}) ->
Self = self(),
ErtsPid = spawn_link(fun() -> accept_loop(Self, erts, Listen, From) end),
WorldPid = spawn_link(fun() -> accept_loop(Self, world, World, Listen) end),
{reply, ErtsPid, State#state{accept_loop={ErtsPid, WorldPid}}};
-handle_call({connect, Ip, Port}, {From, _}, State) ->
+handle_call({connect, Driver, Ip, Port}, {From, _}, State) ->
Me = self(),
- Pid = spawn_link(fun() -> setup_proxy(Ip, Port, Me) end),
+ Pid = spawn_link(fun() -> setup_proxy(Driver, Ip, Port, Me) end),
receive
{Pid, go_ahead, LPort} ->
Res = {ok, Socket} = try_connect(LPort),
@@ -263,10 +264,11 @@ try_connect(Port) ->
try_connect(Port)
end.
-setup_proxy(Ip, Port, Parent) ->
+setup_proxy(Driver, Ip, Port, Parent) ->
process_flag(trap_exit, true),
Opts = connect_options(get_ssl_options(client)),
- case ssl:connect(Ip, Port, [{active, true}, binary, {packet,?PPRE}, nodelay()] ++ Opts) of
+ case ssl:connect(Ip, Port, [{active, true}, binary, {packet,?PPRE}, nodelay(),
+ Driver:family()] ++ Opts) of
{ok, World} ->
{ok, ErtsL} = gen_tcp:listen(0, [{active, true}, {ip, loopback}, binary, {packet,?PPRE}]),
{ok, #net_address{address={_,LPort}}} = get_tcp_address(ErtsL),
diff --git a/lib/stdlib/doc/src/filename.xml b/lib/stdlib/doc/src/filename.xml
index 77e262dbe6..ce6aba3657 100644
--- a/lib/stdlib/doc/src/filename.xml
+++ b/lib/stdlib/doc/src/filename.xml
@@ -47,7 +47,12 @@
<p>The module supports raw file names in the way that if a binary is present, or the file name cannot be interpreted according to the return value of
<seealso marker="kernel:file#native_name_encoding/0">file:native_name_encoding/0</seealso>, a raw file name will also be returned. For example filename:join/1 provided with a path component being a binary (and also not being possible to interpret under the current native file name encoding) will result in a raw file name being returned (the join operation will have been performed of course). For more information about raw file names, see the <seealso marker="kernel:file">file</seealso> module.</p>
</description>
-
+ <datatypes>
+ <datatype>
+ <name name="basedir_type"/>
+ </datatype>
+ </datatypes>
+
<funcs>
<func>
<name name="absname" arity="1"/>
@@ -102,6 +107,155 @@
</desc>
</func>
<func>
+ <name name="basedir" arity="2"/>
+ <fsummary>Equivalent to <c>basedir(<anno>Type</anno>,<anno>Application</anno>,#{})</c>.</fsummary>
+ <desc>
+ <p>
+ Equivalent to <seealso marker="#basedir-3">
+ basedir(<anno>Type</anno>, <anno>Application</anno>, #{})</seealso>.
+ </p>
+ </desc>
+ </func>
+ <func>
+ <name name="basedir" arity="3"/>
+ <fsummary></fsummary>
+ <desc><marker id="basedir-3"/>
+ <p>
+ Returns a suitable path, or paths, for a given type.
+ If <c>os</c> is not set in <c><anno>Opts</anno></c> the function will default to
+ the native option, i.e. <c>'linux'</c>, <c>'darwin'</c> or <c>'windows'</c>, as understood
+ by <c>os:type/0</c>. Anything not recognized as <c>'darwin'</c> or <c>'windows'</c> is
+ interpreted as <c>'linux'</c>.</p>
+ <p>
+ The options <c>'author'</c> and <c>'version'</c> are only used with <c>'windows'</c> option mode.
+ </p>
+ <list type="bulleted">
+ <item><c>user_cache</c>
+ <p>The path location is intended for transient data files on a local machine.</p>
+ <p>
+ On Linux:
+ Respects the os environment variable <c>XDG_CACHE_HOME</c>.
+ </p>
+ <pre>
+1> <input>filename:basedir(user_cache, "my_application", #{os=>linux}).</input>
+"/home/otptest/.cache/my_application"</pre>
+ On Darwin: <pre>
+1> <input>filename:basedir(user_cache, "my_application", #{os=>darwin}).</input>
+"/home/otptest/Library/Caches/my_application"</pre>
+ On Windows: <pre>
+1> <input>filename:basedir(user_cache, "My App").</input>
+"c:/Users/otptest/AppData/Local/My App/Cache"
+2> <input>filename:basedir(user_cache, "My App").</input>
+"c:/Users/otptest/AppData/Local/My App/Cache"
+3> <input>filename:basedir(user_cache, "My App", #{author=>"Erlang"}).</input>
+"c:/Users/otptest/AppData/Local/Erlang/My App/Cache"
+4> <input>filename:basedir(user_cache, "My App", #{version=>"1.2"}).</input>
+"c:/Users/otptest/AppData/Local/My App/1.2/Cache"
+5> <input>filename:basedir(user_cache, "My App", #{author=>"Erlang",version=>"1.2"}).</input>
+"c:/Users/otptest/AppData/Local/Erlang/My App/1.2/Cache"</pre>
+ </item>
+ <item><c>user_config</c>
+ <p>
+ The path location is intended for persistent configuration files.
+ </p>
+ <p>
+ On Linux:
+ Respects the os environment variable <c>XDG_CONFIG_HOME</c>.
+ </p>
+ <pre>
+2> <input>filename:basedir(user_config, "my_application", #{os=>linux}).</input>
+"/home/otptest/.config/my_application"</pre>
+ On Darwin:<pre>
+2> <input>filename:basedir(user_config, "my_application", #{os=>darwin}).</input>
+"/home/otptest/Library/Application Support/my_application"</pre>
+ On Windows:<pre>
+1> <input>filename:basedir(user_config, "My App").</input>
+"c:/Users/otptest/AppData/Roaming/My App"
+2> <input>filename:basedir(user_config, "My App", #{author=>"Erlang", version=>"1.2"}).</input>
+"c:/Users/otptest/AppData/Roaming/Erlang/My App/1.2"</pre>
+ </item>
+ <item><c>user_data</c>
+ <p>
+ The path location is intended for persistent data files.
+ </p>
+ <p>
+ On Linux:
+ Respects the os environment variable <c>XDG_DATA_HOME</c>.
+ </p>
+ <pre>
+3> <input>filename:basedir(user_data, "my_application", #{os=>linux}).</input>
+"/home/otptest/.local/my_application"</pre>
+ On Darwin:<pre>
+3> <input>filename:basedir(user_data, "my_application", #{os=>darwin}).</input>
+"/home/otptest/Library/Application Support/my_application"</pre>
+ On Windows:<pre>
+8> <input>filename:basedir(user_data, "My App").</input>
+"c:/Users/otptest/AppData/Local/My App"
+9> <input>filename:basedir(user_data, "My App",#{author=>"Erlang",version=>"1.2"}).</input>
+"c:/Users/otptest/AppData/Local/Erlang/My App/1.2"</pre>
+ </item>
+ <item><c>user_log</c>
+ <p>The path location is intended for transient log files on a local machine.</p>
+ <p>
+ On Linux:
+ Respects the os environment variable <c>XDG_CACHE_HOME</c>.</p>
+ <pre>
+4> <input>filename:basedir(user_log, "my_application", #{os=>linux}).</input>
+"/home/otptest/.cache/my_application/log"</pre>
+ On Darwin:<pre>
+4> <input>filename:basedir(user_log, "my_application", #{os=>darwin}).</input>
+"/home/otptest/Library/Caches/my_application"</pre>
+ On Windows:<pre>
+12> <input>filename:basedir(user_log, "My App").</input>
+"c:/Users/otptest/AppData/Local/My App/Logs"
+13> <input>filename:basedir(user_log, "My App",#{author=>"Erlang",version=>"1.2"}).</input>
+"c:/Users/otptest/AppData/Local/Erlang/My App/1.2/Logs"</pre>
+ </item>
+ <item><c>site_config</c><p>
+ On Linux:
+ Respects the os environment variable <c>XDG_CONFIG_DIRS</c>.</p>
+<pre>
+5> <input>filename:basedir(site_data, "my_application", #{os=>linux}).</input>
+["/usr/local/share/my_application",
+ "/usr/share/my_application"]
+6> <input>os:getenv("XDG_CONFIG_DIRS").</input>
+"/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg"
+7> <input>filename:basedir(site_config, "my_application", #{os=>linux}).</input>
+["/etc/xdg/xdg-ubuntu/my_application",
+ "/usr/share/upstart/xdg/my_application",
+ "/etc/xdg/my_application"]
+8> <input>os:unsetenv("XDG_CONFIG_DIRS").</input>
+true
+9> <input>filename:basedir(site_config, "my_application", #{os=>linux}).</input>
+["/etc/xdg/my_application"]</pre>
+ On Darwin:<pre>
+5> <input>filename:basedir(site_config, "my_application", #{os=>darwin}).</input>
+["/Library/Application Support/my_application"]</pre>
+ </item>
+ <item><c>site_data</c><p>
+ On Linux:
+ Respects the os environment variable <c>XDG_DATA_DIRS</c>.</p>
+ <pre>
+10> <input>os:getenv("XDG_DATA_DIRS").</input>
+"/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/"
+11> <input>filename:basedir(site_data, "my_application", #{os=>linux}).</input>
+["/usr/share/ubuntu/my_application",
+ "/usr/share/gnome/my_application",
+ "/usr/local/share/my_application",
+ "/usr/share/my_application"]
+12> <input>os:unsetenv("XDG_DATA_DIRS").</input>
+true
+13> <input>filename:basedir(site_data, "my_application", #{os=>linux}).</input>
+["/usr/local/share/my_application",
+ "/usr/share/my_application"]</pre>
+ On Darwin:<pre>
+5> <input>filename:basedir(site_data, "my_application", #{os=>darwin}).</input>
+["/Library/Application Support/my_application"]</pre>
+ </item>
+ </list>
+ </desc>
+ </func>
+ <func>
<name name="basename" arity="1"/>
<fsummary>Return the last component of a filename</fsummary>
<desc>
@@ -214,7 +368,7 @@
<desc>
<p>Converts <c><anno>Path</anno></c> to a form accepted by the command shell
and native applications on the current platform. On Windows,
- forward slashes is converted to backward slashes. On all
+ forward slashes are converted to backward slashes. On all
platforms, the name is normalized as done by <c>join/1</c>.</p>
<pre>
19> <input>filename:nativename("/usr/local/bin/").</input> % Unix
diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl
index b1c574ea60..6f8e5e8449 100644
--- a/lib/stdlib/src/erl_parse.yrl
+++ b/lib/stdlib/src/erl_parse.yrl
@@ -311,7 +311,7 @@ bit_size_expr -> expr_max : '$1'.
list_comprehension -> '[' expr '||' lc_exprs ']' :
{lc,?anno('$1'),'$2','$4'}.
-binary_comprehension -> '<<' binary '||' lc_exprs '>>' :
+binary_comprehension -> '<<' expr_max '||' lc_exprs '>>' :
{bc,?anno('$1'),'$2','$4'}.
lc_exprs -> lc_expr : ['$1'].
lc_exprs -> lc_expr ',' lc_exprs : ['$1'|'$3'].
diff --git a/lib/stdlib/src/filename.erl b/lib/stdlib/src/filename.erl
index 008beb8b67..d921a69108 100644
--- a/lib/stdlib/src/filename.erl
+++ b/lib/stdlib/src/filename.erl
@@ -36,6 +36,7 @@
extension/1, join/1, join/2, pathtype/1,
rootname/1, rootname/2, split/1, nativename/1]).
-export([find_src/1, find_src/2, flatten/1]).
+-export([basedir/2, basedir/3]).
%% Undocumented and unsupported exports.
-export([append/2]).
@@ -139,6 +140,7 @@ absname_join(AbsBase, Name) ->
-spec basename(Filename) -> file:filename_all() when
Filename :: file:name_all().
+
basename(Name) when is_binary(Name) ->
case os:type() of
{win32,_} ->
@@ -954,3 +956,161 @@ filename_string_to_binary(List) ->
Bin
end.
+%% Application Base Directories
+%% basedir
+%% http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+
+-type basedir_type() :: 'user_cache' | 'user_config' | 'user_data'
+ | 'user_log'
+ | 'site_config' | 'site_data'.
+
+-spec basedir(Type,Application) -> file:filename_all() when
+ Type :: basedir_type(),
+ Application :: string() | binary().
+
+basedir(Type,Application) when is_atom(Type), is_list(Application) orelse
+ is_binary(Application) ->
+ basedir(Type, Application, #{}).
+
+-spec basedir(Type,Application,Opts) -> file:filename_all() when
+ Type :: basedir_type(),
+ Application :: string() | binary(),
+ Opts :: #{author => string() | binary(),
+ os => 'windows' | 'darwin' | 'linux',
+ version => string() | binary()}.
+
+basedir(Type,Application,Opts) when is_atom(Type), is_map(Opts),
+ is_list(Application) orelse
+ is_binary(Application) ->
+ Os = basedir_os_from_opts(Opts),
+ Name = basedir_name_from_opts(Os,Application,Opts),
+ Base = basedir_from_os(Type,Os),
+ case {Type,Os} of
+ {user_log,linux} ->
+ filename:join([Base,Name,"log"]);
+ {user_log,windows} ->
+ filename:join([Base,Name,"Logs"]);
+ {user_cache,windows} ->
+ filename:join([Base,Name,"Cache"]);
+ {Type,_} when Type =:= site_config orelse Type =:= site_data ->
+ [filename:join([B,Name]) || B <- Base];
+ _ ->
+ filename:join([Base,Name])
+ end.
+
+basedir_os_from_opts(#{os := linux}) -> linux;
+basedir_os_from_opts(#{os := windows}) -> windows;
+basedir_os_from_opts(#{os := darwin}) -> darwin;
+basedir_os_from_opts(#{}) -> basedir_os_type().
+
+basedir_name_from_opts(windows,App,#{author:=Author,version:=Vsn}) ->
+ filename:join([Author,App,Vsn]);
+basedir_name_from_opts(windows,App,#{author:=Author}) ->
+ filename:join([Author,App]);
+basedir_name_from_opts(_,App,#{version:=Vsn}) ->
+ filename:join([App,Vsn]);
+basedir_name_from_opts(_,App,_) ->
+ App.
+
+basedir_from_os(Type,Os) ->
+ case Os of
+ linux -> basedir_linux(Type);
+ darwin -> basedir_darwin(Type);
+ windows -> basedir_windows(Type)
+ end.
+
+-define(basedir_linux_user_data, ".local/share").
+-define(basedir_linux_user_config, ".config").
+-define(basedir_linux_user_cache, ".cache").
+-define(basedir_linux_user_log, ".cache"). %% .cache/App/log
+-define(basedir_linux_site_data, "/usr/local/share/:/usr/share/").
+-define(basedir_linux_site_config, "/etc/xdg").
+
+basedir_linux(Type) ->
+ case Type of
+ user_data -> getenv("XDG_DATA_HOME", ?basedir_linux_user_data, true);
+ user_config -> getenv("XDG_CONFIG_HOME",?basedir_linux_user_config,true);
+ user_cache -> getenv("XDG_CACHE_HOME", ?basedir_linux_user_cache, true);
+ user_log -> getenv("XDG_CACHE_HOME", ?basedir_linux_user_log, true);
+ site_data ->
+ Base = getenv("XDG_DATA_DIRS",?basedir_linux_site_data,false),
+ string:tokens(Base,":");
+ site_config ->
+ Base = getenv("XDG_CONFIG_DIRS",?basedir_linux_site_config,false),
+ string:tokens(Base,":")
+ end.
+
+-define(basedir_darwin_user_data, "Library/Application Support").
+-define(basedir_darwin_user_config, "Library/Application Support").
+-define(basedir_darwin_user_cache, "Library/Caches").
+-define(basedir_darwin_user_log, "Library/Logs").
+-define(basedir_darwin_site_data, "/Library/Application Support").
+-define(basedir_darwin_site_config, "/Library/Application Support").
+
+basedir_darwin(Type) ->
+ case Type of
+ user_data -> basedir_join_home(?basedir_darwin_user_data);
+ user_config -> basedir_join_home(?basedir_darwin_user_config);
+ user_cache -> basedir_join_home(?basedir_darwin_user_cache);
+ user_log -> basedir_join_home(?basedir_darwin_user_log);
+ site_data -> [?basedir_darwin_site_data];
+ site_config -> [?basedir_darwin_site_config]
+ end.
+
+%% On Windows:
+%% ex. C:\Users\egil\AppData\Local\Ericsson\Erlang
+%% %LOCALAPPDATA% is defined on Windows 7 and onwards
+%% %APPDATA% is used instead of %LOCALAPPDATA% if it's not defined.
+%% %APPDATA% is used for roaming, i.e. for user_config on Windows 7 and beyond.
+%%
+%% user_data %LOCALAPPDATA%[/$author]/$appname[/$version]
+%% user_config %APPDATA%[/$author]/$appname[/$version]
+%% user_cache %LOCALAPPDATA%[/$author]/$appname[/$version]/Cache
+%% user_log %LOCALAPPDATA%[/$author]/$appname[/$version]/Logs
+
+basedir_windows(Type) ->
+ %% If LOCALAPPDATA is not defined we are likely on an
+ %% XP machine. Use APPDATA instead.
+ AppData = basedir_windows_appdata(),
+ case Type of
+ user_data -> getenv("LOCALAPPDATA", AppData);
+ user_config -> AppData;
+ user_cache -> getenv("LOCALAPPDATA", AppData);
+ user_log -> getenv("LOCALAPPDATA", AppData);
+ site_data -> [];
+ site_config -> []
+ end.
+
+basedir_windows_appdata() ->
+ case os:getenv("APPDATA") of
+ Invalid when Invalid =:= false orelse Invalid =:= [] ->
+ erlang:error(noappdata);
+ Val -> Val
+ end.
+
+%% basedir aux
+
+getenv(K,Def,false) -> getenv(K,Def);
+getenv(K,Def,true) -> getenv(K,basedir_join_home(Def)).
+
+getenv(K,Def) ->
+ case os:getenv(K) of
+ [] -> Def;
+ false -> Def;
+ Val -> Val
+ end.
+
+basedir_join_home(Dir) ->
+ case os:getenv("HOME") of
+ false ->
+ {ok,[[Home]]} = init:get_argument(home),
+ filename:join(Home,Dir);
+ Home -> filename:join(Home,Dir)
+ end.
+
+basedir_os_type() ->
+ case os:type() of
+ {unix,darwin} -> darwin;
+ {win32,_} -> windows;
+ _ -> linux
+ end.
diff --git a/lib/stdlib/src/stdlib.appup.src b/lib/stdlib/src/stdlib.appup.src
index 04cdf31ada..15d8857656 100644
--- a/lib/stdlib/src/stdlib.appup.src
+++ b/lib/stdlib/src/stdlib.appup.src
@@ -18,9 +18,9 @@
%% %CopyrightEnd%
{"%VSN%",
%% Up from - max one major revision back
- [{<<"2\\.[5-7](\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-18.*
- {<<"2\\.[0-4](\\.[0-9]+)*">>,[restart_new_emulator]}], % 17.0-17.5
+ [{<<"3\\.0(\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-19.*
+ {<<"2\\.[5-8](\\.[0-9]+)*">>,[restart_new_emulator]}], % OTP-18.*
%% Down to - max one major revision back
- [{<<"2\\.[5-7](\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-18.*
- {<<"2\\.[0-4](\\.[0-9]+)*">>,[restart_new_emulator]}] % 17.0-17.5
+ [{<<"3\\.0(\\.[0-9]+)*">>,[restart_new_emulator]}, % OTP-19.*
+ {<<"2\\.[5-8](\\.[0-9]+)*">>,[restart_new_emulator]}] % OTP-18.*
}.
diff --git a/lib/stdlib/test/array_SUITE.erl b/lib/stdlib/test/array_SUITE.erl
index 6fec03a2f7..8d031ed490 100644
--- a/lib/stdlib/test/array_SUITE.erl
+++ b/lib/stdlib/test/array_SUITE.erl
@@ -22,11 +22,6 @@
-include_lib("common_test/include/ct.hrl").
-%% Default timetrap timeout (set in init_per_testcase).
-%% This should be set relatively high (10-15 times the expected
-%% max testcasetime).
--define(default_timeout, ?t:seconds(60)).
-
%% Test server specific exports
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2]).
@@ -66,7 +61,9 @@
%%
%% all/1
%%
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[new_test, fix_test, relax_test, resize_test,
@@ -93,12 +90,9 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- ?line Dog=test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-define(LEAFSIZE,10).
@@ -111,19 +105,19 @@ end_per_testcase(_Case, Config) ->
}).
-define(_assert(What),
- begin ?line true = What end
+ begin true = What end
).
-define(_assertNot(What),
- begin ?line false = What end
+ begin false = What end
).
-define(_assertMatch(Res,What),
begin
- ?line case What of Res -> ok end
+ case What of Res -> ok end
end
).
-define(_assertError(Reas,What),
- begin ?line fun() ->
+ begin fun() ->
try What of
A_Success -> exit({test_error, A_Success})
catch error:Reas -> ok end
@@ -131,9 +125,9 @@ end_per_testcase(_Case, Config) ->
end
).
--define(LET(Var,Expr, Test), begin ?line fun() -> Var = Expr, Test end() end).
+-define(LET(Var,Expr, Test), begin fun() -> Var = Expr, Test end() end).
--define(_test(Expr), begin ?line Expr end).
+-define(_test(Expr), begin Expr end).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Some helpers to be able to run the tests without testserver
@@ -152,18 +146,7 @@ t(What) ->
io:format("Failed ~p:~p ~p ~p~n ~p~n",
[T,Line,_E,_R, erlang:get_stacktrace()])
end
- end, expand(What)).
-
-expand(All) ->
- lists:reverse(expand(All,[])).
-expand([H|T], Acc) ->
- case ?MODULE:H(suite) of
- [] -> expand(T,[H|Acc]);
- Cs ->
- R = expand(Cs, Acc),
- expand(T, R)
- end;
-expand([], Acc) -> Acc.
+ end, What).
%%%%% extract tests
@@ -173,8 +156,6 @@ extract_tests() ->
try
Tests = extract_tests(In,Out,[]),
Call = fun(Test) ->
- io:format(Out, "~s(doc) -> [];~n", [Test]),
- io:format(Out, "~s(suite) -> [];~n", [Test]),
io:format(Out, "~s(Config) when is_list(Config) -> ~s_(), ok.~n",
[Test, Test])
end,
@@ -775,54 +756,20 @@ sparse_foldr_test_() ->
set(0,0,new())))))
].
-new_test(doc) -> [];
-new_test(suite) -> [];
new_test(Config) when is_list(Config) -> new_test_(), ok.
-fix_test(doc) -> [];
-fix_test(suite) -> [];
fix_test(Config) when is_list(Config) -> fix_test_(), ok.
-relax_test(doc) -> [];
-relax_test(suite) -> [];
relax_test(Config) when is_list(Config) -> relax_test_(), ok.
-resize_test(doc) -> [];
-resize_test(suite) -> [];
resize_test(Config) when is_list(Config) -> resize_test_(), ok.
-set_get_test(doc) -> [];
-set_get_test(suite) -> [];
set_get_test(Config) when is_list(Config) -> set_get_test_(), ok.
-to_list_test(doc) -> [];
-to_list_test(suite) -> [];
to_list_test(Config) when is_list(Config) -> to_list_test_(), ok.
-sparse_to_list_test(doc) -> [];
-sparse_to_list_test(suite) -> [];
sparse_to_list_test(Config) when is_list(Config) -> sparse_to_list_test_(), ok.
-from_list_test(doc) -> [];
-from_list_test(suite) -> [];
from_list_test(Config) when is_list(Config) -> from_list_test_(), ok.
-to_orddict_test(doc) -> [];
-to_orddict_test(suite) -> [];
to_orddict_test(Config) when is_list(Config) -> to_orddict_test_(), ok.
-sparse_to_orddict_test(doc) -> [];
-sparse_to_orddict_test(suite) -> [];
sparse_to_orddict_test(Config) when is_list(Config) -> sparse_to_orddict_test_(), ok.
-from_orddict_test(doc) -> [];
-from_orddict_test(suite) -> [];
from_orddict_test(Config) when is_list(Config) -> from_orddict_test_(), ok.
-map_test(doc) -> [];
-map_test(suite) -> [];
map_test(Config) when is_list(Config) -> map_test_(), ok.
-sparse_map_test(doc) -> [];
-sparse_map_test(suite) -> [];
sparse_map_test(Config) when is_list(Config) -> sparse_map_test_(), ok.
-foldl_test(doc) -> [];
-foldl_test(suite) -> [];
foldl_test(Config) when is_list(Config) -> foldl_test_(), ok.
-sparse_foldl_test(doc) -> [];
-sparse_foldl_test(suite) -> [];
sparse_foldl_test(Config) when is_list(Config) -> sparse_foldl_test_(), ok.
-foldr_test(doc) -> [];
-foldr_test(suite) -> [];
foldr_test(Config) when is_list(Config) -> foldr_test_(), ok.
-sparse_foldr_test(doc) -> [];
-sparse_foldr_test(suite) -> [];
sparse_foldr_test(Config) when is_list(Config) -> sparse_foldr_test_(), ok.
diff --git a/lib/stdlib/test/base64_SUITE.erl b/lib/stdlib/test/base64_SUITE.erl
index f750145ef0..074047c7c5 100644
--- a/lib/stdlib/test/base64_SUITE.erl
+++ b/lib/stdlib/test/base64_SUITE.erl
@@ -34,19 +34,17 @@
roundtrip_1/1, roundtrip_2/1, roundtrip_3/1, roundtrip_4/1]).
init_per_testcase(_, Config) ->
- Dog = test_server:timetrap(?t:minutes(4)),
- NewConfig = lists:keydelete(watchdog, 1, Config),
- [{watchdog, Dog} | NewConfig].
+ Config.
-end_per_testcase(_, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_, _Config) ->
ok.
%%-------------------------------------------------------------------------
%% Test cases starts here.
%%-------------------------------------------------------------------------
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,4}}].
all() ->
[base64_encode, base64_decode, base64_otp_5635,
@@ -72,10 +70,7 @@ end_per_group(_GroupName, Config) ->
%%-------------------------------------------------------------------------
-base64_encode(doc) ->
- ["Test base64:encode/1."];
-base64_encode(suite) ->
- [];
+%% Test base64:encode/1.
base64_encode(Config) when is_list(Config) ->
%% Two pads
<<"QWxhZGRpbjpvcGVuIHNlc2FtZQ==">> =
@@ -90,10 +85,7 @@ base64_encode(Config) when is_list(Config) ->
base64:encode_to_string(<<"0123456789!@#0^&*();:<>,. []{}">>),
ok.
%%-------------------------------------------------------------------------
-base64_decode(doc) ->
- ["Test base64:decode/1."];
-base64_decode(suite) ->
- [];
+%% Test base64:decode/1.
base64_decode(Config) when is_list(Config) ->
%% Two pads
<<"Aladdin:open sesame">> =
@@ -117,28 +109,18 @@ base64_decode(Config) when is_list(Config) ->
<<"MDEy MzQ1Njc4 \tOSFAIzBeJ \niooKTs6 PD4sLi \r\nBbXXt9">>),
ok.
%%-------------------------------------------------------------------------
-base64_otp_5635(doc) ->
- ["OTP-5635: Some data doesn't pass through base64:decode/1 "
- "correctly"];
-base64_otp_5635(suite) ->
- [];
+%% OTP-5635: Some data doesn't pass through base64:decode/1 correctly.
base64_otp_5635(Config) when is_list(Config) ->
<<"===">> = base64:decode(base64:encode("===")),
ok.
%%-------------------------------------------------------------------------
-base64_otp_6279(doc) ->
- ["OTP-6279: Guard needed so that function fails in a correct"
- "way for faulty input i.e. function_clause"];
-base64_otp_6279(suite) ->
- [];
+%% OTP-6279: Guard needed so that function fails in a correct
+%% way for faulty input, i.e. function_clause.
base64_otp_6279(Config) when is_list(Config) ->
{'EXIT',{function_clause, _}} = (catch base64:decode("dGVzda==a")),
ok.
%%-------------------------------------------------------------------------
-big(doc) ->
- ["Encode and decode big binaries."];
-big(suite) ->
- [];
+%% Encode and decode big binaries.
big(Config) when is_list(Config) ->
Big = make_big_binary(300000),
B = base64:encode(Big),
@@ -148,10 +130,7 @@ big(Config) when is_list(Config) ->
Big = base64:mime_decode(B),
ok.
%%-------------------------------------------------------------------------
-illegal(doc) ->
- ["Make sure illegal characters are rejected when decoding."];
-illegal(suite) ->
- [];
+%% Make sure illegal characters are rejected when decoding.
illegal(Config) when is_list(Config) ->
{'EXIT',{function_clause, _}} = (catch base64:decode("()")),
ok.
@@ -159,10 +138,8 @@ illegal(Config) when is_list(Config) ->
%% mime_decode and mime_decode_to_string have different implementations
%% so test both with the same input separately. Both functions have
%% the same implementation for binary/string arguments.
-mime_decode(doc) ->
- ["Test base64:mime_decode/1."];
-mime_decode(suite) ->
- [];
+%%
+%% Test base64:mime_decode/1.
mime_decode(Config) when is_list(Config) ->
%% Test correct padding
<<"one">> = base64:mime_decode(<<"b25l">>),
@@ -202,10 +179,8 @@ mime_decode(Config) when is_list(Config) ->
%%-------------------------------------------------------------------------
%% Repeat of mime_decode() tests
-mime_decode_to_string(doc) ->
- ["Test base64:mime_decode_to_string/1."];
-mime_decode_to_string(suite) ->
- [];
+
+%% Test base64:mime_decode_to_string/1.
mime_decode_to_string(Config) when is_list(Config) ->
%% Test correct padding
"one" = base64:mime_decode_to_string(<<"b25l">>),
diff --git a/lib/stdlib/test/beam_lib_SUITE.erl b/lib/stdlib/test/beam_lib_SUITE.erl
index 5de7b661e5..bf6e30ec83 100644
--- a/lib/stdlib/test/beam_lib_SUITE.erl
+++ b/lib/stdlib/test/beam_lib_SUITE.erl
@@ -19,7 +19,7 @@
%%
-module(beam_lib_SUITE).
-%-define(debug, true).
+%%-define(debug, true).
-ifdef(debug).
-define(format(S, A), io:format(S, A)).
@@ -30,7 +30,7 @@
-else.
-include_lib("common_test/include/ct.hrl").
-define(format(S, A), ok).
--define(privdir, ?config(priv_dir, Conf)).
+-define(privdir, proplists:get_value(priv_dir, Conf)).
-endif.
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
@@ -40,7 +40,9 @@
-export([init_per_testcase/2, end_per_testcase/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[error, normal, cmp, cmp_literals, strip, otp_6711,
@@ -63,78 +65,74 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- Dog=?t:timetrap(?t:minutes(2)),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-normal(suite) -> [];
-normal(doc) -> ["Read correct beam file"];
+%% Read correct beam file.
normal(Conf) when is_list(Conf) ->
- ?line PrivDir = ?privdir,
- ?line Simple = filename:join(PrivDir, "simple"),
- ?line Source = Simple ++ ".erl",
- ?line BeamFile = Simple ++ ".beam",
- ?line simple_file(Source),
+ PrivDir = ?privdir,
+ Simple = filename:join(PrivDir, "simple"),
+ Source = Simple ++ ".erl",
+ BeamFile = Simple ++ ".beam",
+ simple_file(Source),
- ?line NoOfTables = length(ets:all()),
- ?line P0 = pps(),
+ NoOfTables = length(ets:all()),
+ P0 = pps(),
CompileFlags = [{outdir,PrivDir}, debug_info],
- ?line {ok,_} = compile:file(Source, CompileFlags),
- ?line {ok, Binary} = file:read_file(BeamFile),
+ {ok,_} = compile:file(Source, CompileFlags),
+ {ok, Binary} = file:read_file(BeamFile),
- ?line do_normal(BeamFile),
- ?line do_normal(Binary),
+ do_normal(BeamFile),
+ do_normal(Binary),
- ?line {ok,_} = compile:file(Source, [{outdir,PrivDir}, no_debug_info]),
- ?line {ok, {simple, [{abstract_code, no_abstract_code}]}} =
+ {ok,_} = compile:file(Source, [{outdir,PrivDir}, no_debug_info]),
+ {ok, {simple, [{abstract_code, no_abstract_code}]}} =
beam_lib:chunks(BeamFile, [abstract_code]),
- %% ?line {ok,_} = compile:file(Source, [compressed | CompileFlags]),
- %% ?line do_normal(BeamFile),
+ %% {ok,_} = compile:file(Source, [compressed | CompileFlags]),
+ %% do_normal(BeamFile),
- ?line file:delete(BeamFile),
- ?line file:delete(Source),
- ?line NoOfTables = length(ets:all()),
- ?line true = (P0 == pps()),
+ file:delete(BeamFile),
+ file:delete(Source),
+ NoOfTables = length(ets:all()),
+ true = (P0 == pps()),
ok.
do_normal(BeamFile) ->
- ?line Imports = {imports, [{erlang, get_module_info, 1},
- {erlang, get_module_info, 2},
- {lists, member, 2}]},
- ?line Exports = {exports, [{module_info, 0}, {module_info, 1}, {t, 0}]},
- ?line Local = {locals, [{t, 1}]},
- ?line {ok, {simple, [Imports]}} = beam_lib:chunks(BeamFile, [imports]),
- ?line {ok, {simple, [{"ImpT",_Bin}]}} =
+ Imports = {imports, [{erlang, get_module_info, 1},
+ {erlang, get_module_info, 2},
+ {lists, member, 2}]},
+ Exports = {exports, [{module_info, 0}, {module_info, 1}, {t, 0}]},
+ Local = {locals, [{t, 1}]},
+ {ok, {simple, [Imports]}} = beam_lib:chunks(BeamFile, [imports]),
+ {ok, {simple, [{"ImpT",_Bin}]}} =
beam_lib:chunks(BeamFile, ["ImpT"]),
- ?line {ok, {simple, [Exports]}} = beam_lib:chunks(BeamFile, [exports]),
- ?line {ok, {simple, [{attributes, [{vsn, [_]}]}]}} =
+ {ok, {simple, [Exports]}} = beam_lib:chunks(BeamFile, [exports]),
+ {ok, {simple, [{attributes, [{vsn, [_]}]}]}} =
beam_lib:chunks(BeamFile, [attributes]),
- ?line {ok, {simple, [{compile_info, _}=CompileInfo]}} =
+ {ok, {simple, [{compile_info, _}=CompileInfo]}} =
beam_lib:chunks(BeamFile, [compile_info]),
- ?line {ok, {simple, [Local]}} = beam_lib:chunks(BeamFile, [locals]),
- ?line {ok, {simple, [{attributes, [{vsn, [_]}]}, CompileInfo,
- Exports, Imports, Local]}} =
+ {ok, {simple, [Local]}} = beam_lib:chunks(BeamFile, [locals]),
+ {ok, {simple, [{attributes, [{vsn, [_]}]}, CompileInfo,
+ Exports, Imports, Local]}} =
beam_lib:chunks(BeamFile, [attributes, compile_info, exports, imports, locals]),
- ?line {ok, {simple, [{atoms, _Atoms}]}} =
+ {ok, {simple, [{atoms, _Atoms}]}} =
beam_lib:chunks(BeamFile, [atoms]),
- ?line {ok, {simple, [{labeled_exports, _LExports}]}} =
+ {ok, {simple, [{labeled_exports, _LExports}]}} =
beam_lib:chunks(BeamFile, [labeled_exports]),
- ?line {ok, {simple, [{labeled_locals, _LLocals}]}} =
+ {ok, {simple, [{labeled_locals, _LLocals}]}} =
beam_lib:chunks(BeamFile, [labeled_locals]),
- ?line {ok, {simple, [_Vsn]}} = beam_lib:version(BeamFile),
- ?line {ok, {simple, [{abstract_code, _}]}} =
+ {ok, {simple, [_Vsn]}} = beam_lib:version(BeamFile),
+ {ok, {simple, [{abstract_code, _}]}} =
beam_lib:chunks(BeamFile, [abstract_code]),
-
+
%% Test reading optional chunks.
All = ["Atom", "Code", "StrT", "ImpT", "ExpT", "FunT", "LitT"],
- ?line {ok,{simple,Chunks}} = beam_lib:chunks(BeamFile, All, [allow_missing_chunks]),
- ?line verify_simple(Chunks).
+ {ok,{simple,Chunks}} = beam_lib:chunks(BeamFile, All, [allow_missing_chunks]),
+ verify_simple(Chunks).
verify_simple([{"Atom", AtomBin},
{"Code", CodeBin},
@@ -147,64 +145,61 @@ verify_simple([{"Atom", AtomBin},
is_binary(ImpBin), is_binary(ExpBin) ->
ok.
-error(suite) -> [];
-error(doc) -> ["Read invalid beam files"];
+%% Read invalid beam files.
error(Conf) when is_list(Conf) ->
- ?line PrivDir = ?privdir,
- ?line Simple = filename:join(PrivDir, "simple"),
- ?line Source = Simple ++ ".erl",
- ?line BeamFile = Simple ++ ".beam",
- ?line WrongFile = Simple ++ "foo.beam",
- ?line simple_file(Source),
-
- ?line NoOfTables = length(ets:all()),
- ?line P0 = pps(),
- ?line {ok,_} = compile:file(Source, [{outdir,PrivDir},debug_info]),
- ?line ACopy = filename:join(PrivDir, "a_copy.beam"),
- ?line copy_file(BeamFile, ACopy),
-
- ?line {ok, Binary} = file:read_file(BeamFile),
-
- ?line copy_file(ACopy, WrongFile),
- ?line verify(file_error, beam_lib:info("./does_simply_not_exist")),
-
- ?line do_error(BeamFile, ACopy),
- ?line do_error(Binary, ACopy),
-
- ?line copy_file(ACopy, BeamFile),
- ?line verify(unknown_chunk, beam_lib:chunks(BeamFile, [not_a_chunk])),
-
- ?line ok = file:write_file(BeamFile, <<>>),
- ?line verify(not_a_beam_file, beam_lib:info(BeamFile)),
- ?line verify(not_a_beam_file, beam_lib:info(<<>>)),
- ?line ok = file:write_file(BeamFile, <<"short">>),
- ?line verify(not_a_beam_file, beam_lib:info(BeamFile)),
- ?line verify(not_a_beam_file, beam_lib:info(<<"short">>)),
-
- ?line {Binary1, _} = split_binary(Binary, byte_size(Binary)-10),
+ PrivDir = ?privdir,
+ Simple = filename:join(PrivDir, "simple"),
+ Source = Simple ++ ".erl",
+ BeamFile = Simple ++ ".beam",
+ WrongFile = Simple ++ "foo.beam",
+ simple_file(Source),
+
+ NoOfTables = length(ets:all()),
+ P0 = pps(),
+ {ok,_} = compile:file(Source, [{outdir,PrivDir},debug_info]),
+ ACopy = filename:join(PrivDir, "a_copy.beam"),
+ copy_file(BeamFile, ACopy),
+
+ {ok, Binary} = file:read_file(BeamFile),
+
+ copy_file(ACopy, WrongFile),
+ verify(file_error, beam_lib:info("./does_simply_not_exist")),
+
+ do_error(BeamFile, ACopy),
+ do_error(Binary, ACopy),
+
+ copy_file(ACopy, BeamFile),
+ verify(unknown_chunk, beam_lib:chunks(BeamFile, [not_a_chunk])),
+
+ ok = file:write_file(BeamFile, <<>>),
+ verify(not_a_beam_file, beam_lib:info(BeamFile)),
+ verify(not_a_beam_file, beam_lib:info(<<>>)),
+ ok = file:write_file(BeamFile, <<"short">>),
+ verify(not_a_beam_file, beam_lib:info(BeamFile)),
+ verify(not_a_beam_file, beam_lib:info(<<"short">>)),
+
+ {Binary1, _} = split_binary(Binary, byte_size(Binary)-10),
LastChunk = last_chunk(Binary),
- ?line verify(chunk_too_big, beam_lib:chunks(Binary1, [LastChunk])),
- ?line Chunks = chunk_info(Binary),
- ?line {value, {_, AbstractStart, _}} = lists:keysearch("Abst", 1, Chunks),
- ?line {Binary2, _} = split_binary(Binary, AbstractStart),
- ?line verify(chunk_too_big, beam_lib:chunks(Binary2, ["Abst"])),
- ?line {Binary3, _} = split_binary(Binary, AbstractStart-4),
- ?line verify(invalid_beam_file, beam_lib:chunks(Binary3, ["Abst"])),
+ verify(chunk_too_big, beam_lib:chunks(Binary1, [LastChunk])),
+ Chunks = chunk_info(Binary),
+ {value, {_, AbstractStart, _}} = lists:keysearch("Abst", 1, Chunks),
+ {Binary2, _} = split_binary(Binary, AbstractStart),
+ verify(chunk_too_big, beam_lib:chunks(Binary2, ["Abst"])),
+ {Binary3, _} = split_binary(Binary, AbstractStart-4),
+ verify(invalid_beam_file, beam_lib:chunks(Binary3, ["Abst"])),
%% Instead of the 5:32 field below, there used to be control characters
%% (including zero bytes) directly in the string. Because inferior programs
%% such as sed and clearcasediff don't like zero bytes in text files,
%% we have eliminated them.
- ?line ok = file:write_file(BeamFile, <<"FOR1",5:32,"BEAMfel">>),
-% ?line verify(invalid_beam_file, beam_lib:info(BeamFile)),
-% ?line verify(invalid_beam_file, beam_lib:info(<<"FOR1",5:32,"BEAMfel">>)),
-
- ?line NoOfTables = length(ets:all()),
- ?line true = (P0 == pps()),
- ?line file:delete(Source),
- ?line file:delete(WrongFile),
- ?line file:delete(BeamFile),
- ?line file:delete(ACopy),
+ ok = file:write_file(BeamFile, <<"FOR1",5:32,"BEAMfel">>),
+
+ NoOfTables = length(ets:all()),
+ true = (P0 == pps()),
+ file:delete(Source),
+ file:delete(WrongFile),
+ file:delete(BeamFile),
+ file:delete(ACopy),
ok.
last_chunk(Bin) ->
@@ -214,213 +209,210 @@ last_chunk(Bin) ->
Last.
do_error(BeamFile, ACopy) ->
- % evil tests
- ?line Chunks = chunk_info(BeamFile),
- ?line {value, {_, AtomStart, _}} = lists:keysearch("Atom", 1, Chunks),
- ?line {value, {_, ImportStart, _}} = lists:keysearch("ImpT", 1, Chunks),
- ?line {value, {_, AbstractStart, _}} = lists:keysearch("Abst", 1, Chunks),
- ?line {value, {_, AttributesStart, _}} =
+ %% evil tests
+ Chunks = chunk_info(BeamFile),
+ {value, {_, AtomStart, _}} = lists:keysearch("Atom", 1, Chunks),
+ {value, {_, ImportStart, _}} = lists:keysearch("ImpT", 1, Chunks),
+ {value, {_, AbstractStart, _}} = lists:keysearch("Abst", 1, Chunks),
+ {value, {_, AttributesStart, _}} =
lists:keysearch("Attr", 1, Chunks),
- ?line {value, {_, CompileInfoStart, _}} =
+ {value, {_, CompileInfoStart, _}} =
lists:keysearch("CInf", 1, Chunks),
- ?line verify(missing_chunk, beam_lib:chunks(BeamFile, ["__"])),
- ?line BF2 = set_byte(ACopy, BeamFile, ImportStart+4, 17),
- ?line verify(invalid_chunk, beam_lib:chunks(BF2, [imports])),
- ?line BF3 = set_byte(ACopy, BeamFile, AtomStart-6, 17),
- ?line verify(missing_chunk, beam_lib:chunks(BF3, [imports])),
- ?line BF4 = set_byte(ACopy, BeamFile, AbstractStart+10, 17),
- ?line verify(invalid_chunk, beam_lib:chunks(BF4, [abstract_code])),
- ?line BF5 = set_byte(ACopy, BeamFile, AttributesStart+10, 17),
- ?line verify(invalid_chunk, beam_lib:chunks(BF5, [attributes])),
-
- ?line BF6 = set_byte(ACopy, BeamFile, 1, 17),
- ?line verify(not_a_beam_file, beam_lib:info(BF6)),
- ?line BF7 = set_byte(ACopy, BeamFile, 9, 17),
- ?line verify(not_a_beam_file, beam_lib:info(BF7)),
-
- ?line BF8 = set_byte(ACopy, BeamFile, 13, 17),
- ?line verify(missing_chunk, beam_lib:chunks(BF8, ["Atom"])),
-
- ?line BF9 = set_byte(ACopy, BeamFile, CompileInfoStart+10, 17),
- ?line verify(invalid_chunk, beam_lib:chunks(BF9, [compile_info])).
-
-
-cmp(suite) -> [];
-cmp(doc) -> ["Compare contents of BEAM files and directories"];
+ verify(missing_chunk, beam_lib:chunks(BeamFile, ["__"])),
+ BF2 = set_byte(ACopy, BeamFile, ImportStart+4, 17),
+ verify(invalid_chunk, beam_lib:chunks(BF2, [imports])),
+ BF3 = set_byte(ACopy, BeamFile, AtomStart-6, 17),
+ verify(missing_chunk, beam_lib:chunks(BF3, [imports])),
+ BF4 = set_byte(ACopy, BeamFile, AbstractStart+10, 17),
+ verify(invalid_chunk, beam_lib:chunks(BF4, [abstract_code])),
+ BF5 = set_byte(ACopy, BeamFile, AttributesStart+10, 17),
+ verify(invalid_chunk, beam_lib:chunks(BF5, [attributes])),
+
+ BF6 = set_byte(ACopy, BeamFile, 1, 17),
+ verify(not_a_beam_file, beam_lib:info(BF6)),
+ BF7 = set_byte(ACopy, BeamFile, 9, 17),
+ verify(not_a_beam_file, beam_lib:info(BF7)),
+
+ BF8 = set_byte(ACopy, BeamFile, 13, 17),
+ verify(missing_chunk, beam_lib:chunks(BF8, ["Atom"])),
+
+ BF9 = set_byte(ACopy, BeamFile, CompileInfoStart+10, 17),
+ verify(invalid_chunk, beam_lib:chunks(BF9, [compile_info])).
+
+
+%% Compare contents of BEAM files and directories.
cmp(Conf) when is_list(Conf) ->
- ?line PrivDir = ?privdir,
+ PrivDir = ?privdir,
- ?line Dir1 = filename:join(PrivDir, "dir1"),
- ?line Dir2 = filename:join(PrivDir, "dir2"),
+ Dir1 = filename:join(PrivDir, "dir1"),
+ Dir2 = filename:join(PrivDir, "dir2"),
ok = file:make_dir(Dir1),
ok = file:make_dir(Dir2),
- ?line {SourceD1, BeamFileD1} = make_beam(Dir1, simple, member),
- ?line {Source2D1, BeamFile2D1} = make_beam(Dir1, simple2, concat),
- ?line {SourceD2, BeamFileD2} = make_beam(Dir2, simple, concat),
+ {SourceD1, BeamFileD1} = make_beam(Dir1, simple, member),
+ {Source2D1, BeamFile2D1} = make_beam(Dir1, simple2, concat),
+ {SourceD2, BeamFileD2} = make_beam(Dir2, simple, concat),
- ?line NoOfTables = length(ets:all()),
- ?line P0 = pps(),
+ NoOfTables = length(ets:all()),
+ P0 = pps(),
%% cmp
- ?line ok = beam_lib:cmp(BeamFileD1, BeamFileD1),
- ?line ver(modules_different, beam_lib:cmp(BeamFileD1, BeamFile2D1)),
- ?line ver(chunks_different, beam_lib:cmp(BeamFileD1, BeamFileD2)),
- ?line verify(file_error, beam_lib:cmp(foo, bar)),
-
- ?line {ok, B1} = file:read_file(BeamFileD1),
- ?line ok = beam_lib:cmp(B1, BeamFileD1),
- ?line {ok, B2} = file:read_file(BeamFileD2),
- ?line ver(chunks_different, beam_lib:cmp(B1, B2)),
+ ok = beam_lib:cmp(BeamFileD1, BeamFileD1),
+ ver(modules_different, beam_lib:cmp(BeamFileD1, BeamFile2D1)),
+ ver(chunks_different, beam_lib:cmp(BeamFileD1, BeamFileD2)),
+ verify(file_error, beam_lib:cmp(foo, bar)),
+
+ {ok, B1} = file:read_file(BeamFileD1),
+ ok = beam_lib:cmp(B1, BeamFileD1),
+ {ok, B2} = file:read_file(BeamFileD2),
+ ver(chunks_different, beam_lib:cmp(B1, B2)),
%% cmp_dirs
- ?line {[],[],[]} = beam_lib:cmp_dirs(Dir1, Dir1),
- ?line true = {[BeamFile2D1], [], [{BeamFileD1,BeamFileD2}]} ==
- beam_lib:cmp_dirs(Dir1, Dir2),
- ?line true = {[], [BeamFile2D1], [{BeamFileD2,BeamFileD1}]} ==
- beam_lib:cmp_dirs(Dir2, Dir1),
- ?line ver(not_a_directory, beam_lib:cmp_dirs(foo, bar)),
-
+ {[],[],[]} = beam_lib:cmp_dirs(Dir1, Dir1),
+ true = {[BeamFile2D1], [], [{BeamFileD1,BeamFileD2}]} ==
+ beam_lib:cmp_dirs(Dir1, Dir2),
+ true = {[], [BeamFile2D1], [{BeamFileD2,BeamFileD1}]} ==
+ beam_lib:cmp_dirs(Dir2, Dir1),
+ ver(not_a_directory, beam_lib:cmp_dirs(foo, bar)),
+
%% diff_dirs
- ?line ok = beam_lib:diff_dirs(Dir1, Dir1),
- ?line ver(not_a_directory, beam_lib:diff_dirs(foo, bar)),
+ ok = beam_lib:diff_dirs(Dir1, Dir1),
+ ver(not_a_directory, beam_lib:diff_dirs(foo, bar)),
- ?line true = (P0 == pps()),
- ?line NoOfTables = length(ets:all()),
- ?line delete_files([SourceD1, BeamFileD1, Source2D1,
- BeamFile2D1, SourceD2, BeamFileD2]),
+ true = (P0 == pps()),
+ NoOfTables = length(ets:all()),
+ delete_files([SourceD1, BeamFileD1, Source2D1,
+ BeamFile2D1, SourceD2, BeamFileD2]),
file:del_dir(Dir1),
file:del_dir(Dir2),
ok.
-cmp_literals(suite) -> [];
-cmp_literals(doc) -> ["Compare contents of BEAM files having literals"];
+%% Compare contents of BEAM files having literals.
cmp_literals(Conf) when is_list(Conf) ->
- ?line PrivDir = ?privdir,
+ PrivDir = ?privdir,
- ?line Dir1 = filename:join(PrivDir, "dir1"),
- ?line Dir2 = filename:join(PrivDir, "dir2"),
+ Dir1 = filename:join(PrivDir, "dir1"),
+ Dir2 = filename:join(PrivDir, "dir2"),
ok = file:make_dir(Dir1),
ok = file:make_dir(Dir2),
- ?line {SourceD1, BeamFileD1} = make_beam(Dir1, simple, constant),
- ?line {SourceD2, BeamFileD2} = make_beam(Dir2, simple, constant2),
+ {SourceD1, BeamFileD1} = make_beam(Dir1, simple, constant),
+ {SourceD2, BeamFileD2} = make_beam(Dir2, simple, constant2),
- ?line NoOfTables = length(ets:all()),
- ?line P0 = pps(),
+ NoOfTables = length(ets:all()),
+ P0 = pps(),
%% cmp
- ?line ok = beam_lib:cmp(BeamFileD1, BeamFileD1),
- ?line ver(chunks_different, beam_lib:cmp(BeamFileD1, BeamFileD2)),
-
- ?line {ok, B1} = file:read_file(BeamFileD1),
- ?line ok = beam_lib:cmp(B1, BeamFileD1),
- ?line {ok, B2} = file:read_file(BeamFileD2),
- ?line ver(chunks_different, beam_lib:cmp(B1, B2)),
+ ok = beam_lib:cmp(BeamFileD1, BeamFileD1),
+ ver(chunks_different, beam_lib:cmp(BeamFileD1, BeamFileD2)),
+
+ {ok, B1} = file:read_file(BeamFileD1),
+ ok = beam_lib:cmp(B1, BeamFileD1),
+ {ok, B2} = file:read_file(BeamFileD2),
+ ver(chunks_different, beam_lib:cmp(B1, B2)),
- ?line true = (P0 == pps()),
- ?line NoOfTables = length(ets:all()),
+ true = (P0 == pps()),
+ NoOfTables = length(ets:all()),
- ?line delete_files([SourceD1, BeamFileD1, SourceD2, BeamFileD2]),
+ delete_files([SourceD1, BeamFileD1, SourceD2, BeamFileD2]),
file:del_dir(Dir1),
file:del_dir(Dir2),
ok.
-strip(suite) -> [];
-strip(doc) -> ["Strip BEAM files"];
+%% Strip BEAM files.
strip(Conf) when is_list(Conf) ->
- ?line PrivDir = ?privdir,
- ?line {SourceD1, BeamFileD1} = make_beam(PrivDir, simple, member),
- ?line {Source2D1, BeamFile2D1} = make_beam(PrivDir, simple2, concat),
- ?line {Source3D1, BeamFile3D1} = make_beam(PrivDir, make_fun, make_fun),
- ?line {Source4D1, BeamFile4D1} = make_beam(PrivDir, constant, constant),
- ?line {Source5D1, BeamFile5D1} = make_beam(PrivDir, lines, lines),
+ PrivDir = ?privdir,
+ {SourceD1, BeamFileD1} = make_beam(PrivDir, simple, member),
+ {Source2D1, BeamFile2D1} = make_beam(PrivDir, simple2, concat),
+ {Source3D1, BeamFile3D1} = make_beam(PrivDir, make_fun, make_fun),
+ {Source4D1, BeamFile4D1} = make_beam(PrivDir, constant, constant),
+ {Source5D1, BeamFile5D1} = make_beam(PrivDir, lines, lines),
- ?line NoOfTables = length(ets:all()),
- ?line P0 = pps(),
+ NoOfTables = length(ets:all()),
+ P0 = pps(),
%% strip binary
- ?line verify(not_a_beam_file, beam_lib:strip(<<>>)),
- ?line {ok, B1} = file:read_file(BeamFileD1),
- ?line {ok, {simple, NB1}} = beam_lib:strip(B1),
- ?line BId1 = chunk_ids(B1),
- ?line NBId1 = chunk_ids(NB1),
- ?line true = length(BId1) > length(NBId1),
- ?line compare_chunks(B1, NB1, NBId1),
+ verify(not_a_beam_file, beam_lib:strip(<<>>)),
+ {ok, B1} = file:read_file(BeamFileD1),
+ {ok, {simple, NB1}} = beam_lib:strip(B1),
+ BId1 = chunk_ids(B1),
+ NBId1 = chunk_ids(NB1),
+ true = length(BId1) > length(NBId1),
+ compare_chunks(B1, NB1, NBId1),
%% strip file
- ?line verify(file_error, beam_lib:strip(foo)),
- ?line {ok, {simple, _}} = beam_lib:strip(BeamFileD1),
- ?line compare_chunks(NB1, BeamFileD1, NBId1),
+ verify(file_error, beam_lib:strip(foo)),
+ {ok, {simple, _}} = beam_lib:strip(BeamFileD1),
+ compare_chunks(NB1, BeamFileD1, NBId1),
%% strip_files
- ?line {ok, B2} = file:read_file(BeamFile2D1),
- ?line {ok, [{simple,_},{simple2,_}]} = beam_lib:strip_files([B1, B2]),
- ?line {ok, [{simple,_},{simple2,_},{make_fun,_},{constant,_}]} =
+ {ok, B2} = file:read_file(BeamFile2D1),
+ {ok, [{simple,_},{simple2,_}]} = beam_lib:strip_files([B1, B2]),
+ {ok, [{simple,_},{simple2,_},{make_fun,_},{constant,_}]} =
beam_lib:strip_files([BeamFileD1, BeamFile2D1, BeamFile3D1, BeamFile4D1]),
%% check that each module can be loaded.
- ?line {module, simple} = code:load_abs(filename:rootname(BeamFileD1)),
- ?line {module, simple2} = code:load_abs(filename:rootname(BeamFile2D1)),
- ?line {module, make_fun} = code:load_abs(filename:rootname(BeamFile3D1)),
- ?line {module, constant} = code:load_abs(filename:rootname(BeamFile4D1)),
+ {module, simple} = code:load_abs(filename:rootname(BeamFileD1)),
+ {module, simple2} = code:load_abs(filename:rootname(BeamFile2D1)),
+ {module, make_fun} = code:load_abs(filename:rootname(BeamFile3D1)),
+ {module, constant} = code:load_abs(filename:rootname(BeamFile4D1)),
%% check that line number information is still present after stripping
- ?line {module, lines} = code:load_abs(filename:rootname(BeamFile5D1)),
- ?line {'EXIT',{badarith,[{lines,t,1,Info}|_]}} =
+ {module, lines} = code:load_abs(filename:rootname(BeamFile5D1)),
+ {'EXIT',{badarith,[{lines,t,1,Info}|_]}} =
(catch lines:t(atom)),
- ?line true = code:delete(lines),
- ?line false = code:purge(lines),
- ?line {ok, {lines,BeamFile5D1}} = beam_lib:strip(BeamFile5D1),
- ?line {module, lines} = code:load_abs(filename:rootname(BeamFile5D1)),
- ?line {'EXIT',{badarith,[{lines,t,1,Info}|_]}} =
+ true = code:delete(lines),
+ false = code:purge(lines),
+ {ok, {lines,BeamFile5D1}} = beam_lib:strip(BeamFile5D1),
+ {module, lines} = code:load_abs(filename:rootname(BeamFile5D1)),
+ {'EXIT',{badarith,[{lines,t,1,Info}|_]}} =
(catch lines:t(atom)),
- ?line true = (P0 == pps()),
- ?line NoOfTables = length(ets:all()),
+ true = (P0 == pps()),
+ NoOfTables = length(ets:all()),
- ?line delete_files([SourceD1, BeamFileD1,
- Source2D1, BeamFile2D1,
- Source3D1, BeamFile3D1,
- Source4D1, BeamFile4D1,
- Source5D1, BeamFile5D1]),
+ delete_files([SourceD1, BeamFileD1,
+ Source2D1, BeamFile2D1,
+ Source3D1, BeamFile3D1,
+ Source4D1, BeamFile4D1,
+ Source5D1, BeamFile5D1]),
ok.
otp_6711(Conf) when is_list(Conf) ->
- ?line {'EXIT',{function_clause,_}} = (catch {a, beam_lib:info(3)}),
- ?line {'EXIT',{function_clause,_}} = (catch {a, beam_lib:chunks(a, b)}),
- ?line {'EXIT',{function_clause,_}} = (catch {a, beam_lib:chunks(a,b,c)}),
- ?line {'EXIT',{function_clause,_}} = (catch {a, beam_lib:all_chunks(3)}),
- ?line {'EXIT',{function_clause,_}} = (catch {a, beam_lib:cmp(3,4)}),
- ?line {'EXIT',{function_clause,_}} = (catch {a, beam_lib:strip(3)}),
- ?line {'EXIT',{function_clause,_}} =
+ {'EXIT',{function_clause,_}} = (catch {a, beam_lib:info(3)}),
+ {'EXIT',{function_clause,_}} = (catch {a, beam_lib:chunks(a, b)}),
+ {'EXIT',{function_clause,_}} = (catch {a, beam_lib:chunks(a,b,c)}),
+ {'EXIT',{function_clause,_}} = (catch {a, beam_lib:all_chunks(3)}),
+ {'EXIT',{function_clause,_}} = (catch {a, beam_lib:cmp(3,4)}),
+ {'EXIT',{function_clause,_}} = (catch {a, beam_lib:strip(3)}),
+ {'EXIT',{function_clause,_}} =
(catch {a, beam_lib:strip_files([3])}),
- ?line PrivDir = ?privdir,
- ?line Dir = filename:join(PrivDir, "dir"),
- ?line Lib = filename:join(Dir, "lib"),
- ?line App = filename:join(Lib, "app"),
- ?line EBin = filename:join(App, "ebin"),
+ PrivDir = ?privdir,
+ Dir = filename:join(PrivDir, "dir"),
+ Lib = filename:join(Dir, "lib"),
+ App = filename:join(Lib, "app"),
+ EBin = filename:join(App, "ebin"),
ok = file:make_dir(Dir),
ok = file:make_dir(Lib),
ok = file:make_dir(App),
ok = file:make_dir(EBin),
-
- ?line {SourceD, BeamFileD} = make_beam(EBin, simple, member),
+
+ {SourceD, BeamFileD} = make_beam(EBin, simple, member),
unwritable(BeamFileD),
%% There is no way that strip_release can fail with
%% function_clause or something like that...
- ?line {error,_,{file_error,_,_}} = beam_lib:strip_release(Dir),
+ {error,_,{file_error,_,_}} = beam_lib:strip_release(Dir),
- ?line delete_files([SourceD, BeamFileD]),
+ delete_files([SourceD, BeamFileD]),
file:del_dir(EBin),
file:del_dir(App),
file:del_dir(Lib),
@@ -434,59 +426,58 @@ unwritable(Fname) ->
Mode = Info#file_info.mode - 8#00200,
file:write_file_info(Fname, Info#file_info{mode = Mode}).
-building(doc) -> "Testing building of BEAM files.";
+%% Testing building of BEAM files.
building(Conf) when is_list(Conf) ->
- ?line PrivDir = ?privdir,
+ PrivDir = ?privdir,
- ?line Dir1 = filename:join(PrivDir, "b_dir1"),
- ?line Dir2 = filename:join(PrivDir, "b_dir2"),
+ Dir1 = filename:join(PrivDir, "b_dir1"),
+ Dir2 = filename:join(PrivDir, "b_dir2"),
ok = file:make_dir(Dir1),
ok = file:make_dir(Dir2),
- ?line {SourceD1, BeamFileD1} = make_beam(Dir1, building, member),
+ {SourceD1, BeamFileD1} = make_beam(Dir1, building, member),
- ?line NoOfTables = length(ets:all()),
- ?line P0 = pps(),
+ NoOfTables = length(ets:all()),
+ P0 = pps(),
%% read all chunks
- ?line ChunkIds = chunk_ids(BeamFileD1),
- ?line {ok, _Mod, Chunks} = beam_lib:all_chunks(BeamFileD1),
- ?line ChunkIds = lists:map(fun ({Id, Data}) when is_binary(Data) -> Id
- end, Chunks),
+ ChunkIds = chunk_ids(BeamFileD1),
+ {ok, _Mod, Chunks} = beam_lib:all_chunks(BeamFileD1),
+ ChunkIds = lists:map(fun ({Id, Data}) when is_binary(Data) -> Id
+ end, Chunks),
%% write a new beam file, with reversed chunk order
- ?line BeamFileD2 = filename:join(Dir2, "building.beam"),
- ?line {ok,RevBeam} = beam_lib:build_module(lists:reverse(Chunks)),
- ?line file:write_file(BeamFileD2, RevBeam),
+ BeamFileD2 = filename:join(Dir2, "building.beam"),
+ {ok,RevBeam} = beam_lib:build_module(lists:reverse(Chunks)),
+ file:write_file(BeamFileD2, RevBeam),
%% compare files
- ?line compare_chunks(BeamFileD1, BeamFileD2, ChunkIds),
+ compare_chunks(BeamFileD1, BeamFileD2, ChunkIds),
%% test that we can retrieve a chunk before the atom table
%% (actually, try to retrieve all chunks)
- ?line lists:foreach(fun(Id) ->
- {ok, {building, [{Id, _Data}]}} =
- beam_lib:chunks(BeamFileD1, [Id])
- end, ChunkIds),
- ?line lists:foreach(fun(Id) ->
- {ok, {building, [{Id, _Data}]}} =
- beam_lib:chunks(BeamFileD2, [Id])
- end, ChunkIds),
+ lists:foreach(fun(Id) ->
+ {ok, {building, [{Id, _Data}]}} =
+ beam_lib:chunks(BeamFileD1, [Id])
+ end, ChunkIds),
+ lists:foreach(fun(Id) ->
+ {ok, {building, [{Id, _Data}]}} =
+ beam_lib:chunks(BeamFileD2, [Id])
+ end, ChunkIds),
- ?line true = (P0 == pps()),
- ?line NoOfTables = length(ets:all()),
+ true = (P0 == pps()),
+ NoOfTables = length(ets:all()),
- ?line delete_files([SourceD1, BeamFileD1, BeamFileD2]),
+ delete_files([SourceD1, BeamFileD1, BeamFileD2]),
file:del_dir(Dir1),
file:del_dir(Dir2),
ok.
-md5(suite) -> [];
-md5(doc) -> ["Compare beam_lib:md5/1 and code:module_md5/1."];
+%% Compare beam_lib:md5/1 and code:module_md5/1.
md5(Conf) when is_list(Conf) ->
- ?line Beams = collect_beams(),
+ Beams = collect_beams(),
io:format("Found ~w beam files", [length(Beams)]),
md5_1(Beams).
@@ -497,7 +488,7 @@ md5_1([N|Ns]) ->
{Mod,MD5} = {Mod,code:module_md5(Beam)},
md5_1(Ns);
md5_1([]) -> ok.
-
+
collect_beams() ->
SuperDir = filename:dirname(filename:dirname(code:which(?MODULE))),
TestDirs = filelib:wildcard(filename:join([SuperDir,"*_test"])),
@@ -511,90 +502,89 @@ collect_beams_1([]) -> [].
maybe_uncompress(<<"FOR1",_/binary>>=Beam) -> Beam;
maybe_uncompress(Beam) -> zlib:gunzip(Beam).
-encrypted_abstr(suite) -> [];
-encrypted_abstr(doc) -> ["Test encrypted abstract format"];
+%% Test encrypted abstract format.
encrypted_abstr(Conf) when is_list(Conf) ->
run_if_crypto_works(fun() -> encrypted_abstr_1(Conf) end).
encrypted_abstr_1(Conf) ->
- ?line PrivDir = ?privdir,
- ?line Simple = filename:join(PrivDir, "simple"),
- ?line Source = Simple ++ ".erl",
- ?line BeamFile = Simple ++ ".beam",
- ?line simple_file(Source),
+ PrivDir = ?privdir,
+ Simple = filename:join(PrivDir, "simple"),
+ Source = Simple ++ ".erl",
+ BeamFile = Simple ++ ".beam",
+ simple_file(Source),
%% Avoid getting an extra port when crypto starts erl_ddll.
- ?line erl_ddll:start(),
+ erl_ddll:start(),
- ?line NoOfTables = length(ets:all()),
- ?line P0 = pps(),
+ NoOfTables = length(ets:all()),
+ P0 = pps(),
Key = "#a_crypto_key",
CompileFlags = [{outdir,PrivDir}, debug_info, {debug_info_key,Key}],
- ?line {ok,_} = compile:file(Source, CompileFlags),
- ?line {ok, Binary} = file:read_file(BeamFile),
+ {ok,_} = compile:file(Source, CompileFlags),
+ {ok, Binary} = file:read_file(BeamFile),
- ?line do_encrypted_abstr(BeamFile, Key),
- ?line do_encrypted_abstr(Binary, Key),
+ do_encrypted_abstr(BeamFile, Key),
+ do_encrypted_abstr(Binary, Key),
- ?line ok = crypto:stop(), %To get rid of extra ets tables.
- ?line file:delete(BeamFile),
- ?line file:delete(Source),
- ?line NoOfTables = length(ets:all()),
- ?line true = (P0 == pps()),
+ ok = crypto:stop(), %To get rid of extra ets tables.
+ file:delete(BeamFile),
+ file:delete(Source),
+ NoOfTables = length(ets:all()),
+ true = (P0 == pps()),
ok.
do_encrypted_abstr(Beam, Key) ->
- ?line verify(key_missing_or_invalid, beam_lib:chunks(Beam, [abstract_code])),
+ verify(key_missing_or_invalid, beam_lib:chunks(Beam, [abstract_code])),
%% The raw chunk "Abst" can still be read even without a key.
- ?line {ok,{simple,[{"Abst",Abst}]}} = beam_lib:chunks(Beam, ["Abst"]),
- ?line <<0:8,8:8,"des3_cbc",_/binary>> = Abst,
+ {ok,{simple,[{"Abst",Abst}]}} = beam_lib:chunks(Beam, ["Abst"]),
+ <<0:8,8:8,"des3_cbc",_/binary>> = Abst,
%% Try som invalid funs.
- ?line bad_fun(badfun, fun() -> ok end),
- ?line bad_fun(badfun, {a,b}),
- ?line bad_fun(blurf),
- ?line {function_clause,_} = bad_fun(fun(glurf) -> ok end),
+ bad_fun(badfun, fun() -> ok end),
+ bad_fun(badfun, {a,b}),
+ bad_fun(blurf),
+ {function_clause,_} = bad_fun(fun(glurf) -> ok end),
%% Funs that return something strange.
- ?line bad_fun(badfun, fun(init) -> {ok,fun() -> ok end} end),
- ?line glurf = bad_fun(fun(init) -> {error,glurf} end),
+ bad_fun(badfun, fun(init) -> {ok,fun() -> ok end} end),
+ glurf = bad_fun(fun(init) -> {error,glurf} end),
%% Try clearing (non-existing fun).
- ?line undefined = beam_lib:clear_crypto_key_fun(),
+ undefined = beam_lib:clear_crypto_key_fun(),
%% Install a fun which cannot retrieve a key.
- ?line ok = beam_lib:crypto_key_fun(fun(init) -> ok end),
- ?line {error,beam_lib,Error} = beam_lib:chunks(Beam, [abstract_code]),
+ ok = beam_lib:crypto_key_fun(fun(init) -> ok end),
+ {error,beam_lib,Error} = beam_lib:chunks(Beam, [abstract_code]),
%% Install a fun which returns an incorrect key.
- ?line {ok,_} = beam_lib:clear_crypto_key_fun(),
- ?line ok = beam_lib:crypto_key_fun(simple_crypto_fun("wrong key...")),
- ?line {error,beam_lib,Error} = beam_lib:chunks(Beam, [abstract_code]),
-
+ {ok,_} = beam_lib:clear_crypto_key_fun(),
+ ok = beam_lib:crypto_key_fun(simple_crypto_fun("wrong key...")),
+ {error,beam_lib,Error} = beam_lib:chunks(Beam, [abstract_code]),
+
%% Installing a new key fun is not possible without clearing the old.
- ?line verify(exists, beam_lib:crypto_key_fun(simple_crypto_fun(Key))),
+ verify(exists, beam_lib:crypto_key_fun(simple_crypto_fun(Key))),
%% Install the simplest possible working key fun.
- ?line {ok,_} = beam_lib:clear_crypto_key_fun(),
- ?line ok = beam_lib:crypto_key_fun(simple_crypto_fun(Key)),
- ?line verify_abstract(Beam),
- ?line {ok,{simple,[{"Abst",Abst}]}} = beam_lib:chunks(Beam, ["Abst"]),
+ {ok,_} = beam_lib:clear_crypto_key_fun(),
+ ok = beam_lib:crypto_key_fun(simple_crypto_fun(Key)),
+ verify_abstract(Beam),
+ {ok,{simple,[{"Abst",Abst}]}} = beam_lib:chunks(Beam, ["Abst"]),
%% Installing a new key fun is not possible without clearing the old.
verify(exists, beam_lib:crypto_key_fun(ets_crypto_fun(Key))),
%% Install a key using an ets table.
- ?line {ok,_} = beam_lib:clear_crypto_key_fun(),
- ?line ok = beam_lib:crypto_key_fun(ets_crypto_fun(Key)),
- ?line verify_abstract(Beam),
- ?line {ok,{simple,[{"Abst",Abst}]}} = beam_lib:chunks(Beam, ["Abst"]),
+ {ok,_} = beam_lib:clear_crypto_key_fun(),
+ ok = beam_lib:crypto_key_fun(ets_crypto_fun(Key)),
+ verify_abstract(Beam),
+ {ok,{simple,[{"Abst",Abst}]}} = beam_lib:chunks(Beam, ["Abst"]),
- ?line {ok,cleared} = beam_lib:clear_crypto_key_fun(),
+ {ok,cleared} = beam_lib:clear_crypto_key_fun(),
%% Try to force a stop/start race.
- ?line start_stop_race(10000),
+ start_stop_race(10000),
ok.
@@ -635,69 +625,67 @@ ets_crypto_fun(Key) ->
end}
end.
-encrypted_abstr_file(suite) -> [];
-encrypted_abstr_file(doc) ->
- ["Test encrypted abstract format with the key in .erlang.crypt"];
+%% Test encrypted abstract format with the key in .erlang.crypt.
encrypted_abstr_file(Conf) when is_list(Conf) ->
run_if_crypto_works(fun() -> encrypted_abstr_file_1(Conf) end).
encrypted_abstr_file_1(Conf) ->
- ?line PrivDir = ?privdir,
- ?line Simple = filename:join(PrivDir, "simple"),
- ?line Source = Simple ++ ".erl",
- ?line BeamFile = Simple ++ ".beam",
- ?line simple_file(Source),
+ PrivDir = ?privdir,
+ Simple = filename:join(PrivDir, "simple"),
+ Source = Simple ++ ".erl",
+ BeamFile = Simple ++ ".beam",
+ simple_file(Source),
%% Avoid getting an extra port when crypto starts erl_ddll.
- ?line erl_ddll:start(),
+ erl_ddll:start(),
- ?line NoOfTables = length(ets:all()),
- ?line P0 = pps(),
+ NoOfTables = length(ets:all()),
+ P0 = pps(),
Key = "Long And niCe 99Krypto Key",
CompileFlags = [{outdir,PrivDir}, debug_info, {debug_info_key,Key}],
- ?line {ok,_} = compile:file(Source, CompileFlags),
- ?line {ok, Binary} = file:read_file(BeamFile),
-
- ?line {ok,OldCwd} = file:get_cwd(),
- ?line ok = file:set_cwd(PrivDir),
- ?line do_encrypted_abstr_file(BeamFile, Key),
- ?line do_encrypted_abstr_file(Binary, Key),
- ?line ok = file:set_cwd(OldCwd),
-
- ?line ok = crypto:stop(), %To get rid of extra ets tables.
- ?line file:delete(filename:join(PrivDir, ".erlang.crypt")),
- ?line file:delete(BeamFile),
- ?line file:delete(Source),
- ?line NoOfTables = length(ets:all()),
- ?line true = (P0 == pps()),
+ {ok,_} = compile:file(Source, CompileFlags),
+ {ok, Binary} = file:read_file(BeamFile),
+
+ {ok,OldCwd} = file:get_cwd(),
+ ok = file:set_cwd(PrivDir),
+ do_encrypted_abstr_file(BeamFile, Key),
+ do_encrypted_abstr_file(Binary, Key),
+ ok = file:set_cwd(OldCwd),
+
+ ok = crypto:stop(), %To get rid of extra ets tables.
+ file:delete(filename:join(PrivDir, ".erlang.crypt")),
+ file:delete(BeamFile),
+ file:delete(Source),
+ NoOfTables = length(ets:all()),
+ true = (P0 == pps()),
ok.
do_encrypted_abstr_file(Beam, Key) ->
%% No key.
- ?line write_crypt_file(""),
- ?line {error,beam_lib,Error} = beam_lib:chunks(Beam, [abstract_code]),
+ write_crypt_file(""),
+ {error,beam_lib,Error} = beam_lib:chunks(Beam, [abstract_code]),
%% A wrong key.
- ?line write_crypt_file(["[{debug_info,des3_cbc,simple,\"A Wrong Key\"}].\n"]),
- ?line {error,beam_lib,Error} = beam_lib:chunks(Beam, [abstract_code]),
+ write_crypt_file(["[{debug_info,des3_cbc,simple,\"A Wrong Key\"}].\n"]),
+ {error,beam_lib,Error} = beam_lib:chunks(Beam, [abstract_code]),
%% Write correct key...
- ?line write_crypt_file(["[{debug_info,des3_cbc,simple,\"",Key,"\"}].\n"]),
+ write_crypt_file(["[{debug_info,des3_cbc,simple,\"",Key,"\"}].\n"]),
%% ... but the fun with the wrong key is still there.
- ?line {error,beam_lib,Error} = beam_lib:chunks(Beam, [abstract_code]),
+ {error,beam_lib,Error} = beam_lib:chunks(Beam, [abstract_code]),
%% Clear the fun. Now it should work.
- ?line {ok,_} = beam_lib:clear_crypto_key_fun(),
- ?line verify_abstract(Beam),
- ?line verify_abstract(Beam),
- ?line ok = file:delete(".erlang.crypt"),
- ?line verify_abstract(Beam),
+ {ok,_} = beam_lib:clear_crypto_key_fun(),
+ verify_abstract(Beam),
+ verify_abstract(Beam),
+ ok = file:delete(".erlang.crypt"),
+ verify_abstract(Beam),
%% Clear, otherwise the second pass will fail.
- ?line {ok,_} = beam_lib:clear_crypto_key_fun(),
- ?line {error,beam_lib,Error} = beam_lib:chunks(Beam, [abstract_code]),
+ {ok,_} = beam_lib:clear_crypto_key_fun(),
+ {error,beam_lib,Error} = beam_lib:chunks(Beam, [abstract_code]),
ok.
write_crypt_file(Contents0) ->
@@ -706,45 +694,44 @@ write_crypt_file(Contents0) ->
ok = file:write_file(".erlang.crypt", Contents).
compare_chunks(File1, File2, ChunkIds) ->
- ?line {ok, {_, Chunks1}} = beam_lib:chunks(File1, ChunkIds),
- ?line {ok, {_, Chunks2}} = beam_lib:chunks(File2, ChunkIds),
- ?line true = Chunks1 == Chunks2.
+ {ok, {_, Chunks1}} = beam_lib:chunks(File1, ChunkIds),
+ {ok, {_, Chunks2}} = beam_lib:chunks(File2, ChunkIds),
+ true = Chunks1 == Chunks2.
chunk_ids(File) ->
- ?line lists:map(fun({Id,_Start,_Size}) -> Id end, chunk_info(File)).
-
+ lists:map(fun({Id,_Start,_Size}) -> Id end, chunk_info(File)).
+
chunk_info(File) ->
- ?line {value, {chunks, Chunks}} =
+ {value, {chunks, Chunks}} =
lists:keysearch(chunks, 1, beam_lib:info(File)),
Chunks.
-
+
make_beam(Dir, Module, F) ->
- ?line FileBase = filename:join(Dir, atom_to_list(Module)),
- ?line Source = FileBase ++ ".erl",
- ?line BeamFile = FileBase ++ ".beam",
- ?line simple_file(Source, Module, F),
- ?line {ok, _} = compile:file(Source, [{outdir,Dir}, debug_info, report]),
+ FileBase = filename:join(Dir, atom_to_list(Module)),
+ Source = FileBase ++ ".erl",
+ BeamFile = FileBase ++ ".beam",
+ simple_file(Source, Module, F),
+ {ok, _} = compile:file(Source, [{outdir,Dir}, debug_info, report]),
{Source, BeamFile}.
set_byte(_Backup, Binary, Pos, Byte) when is_binary(Binary) ->
- ?line <<B1:Pos/binary, _:1/binary, B2/binary>> = Binary,
+ <<B1:Pos/binary, _:1/binary, B2/binary>> = Binary,
NB = <<B1/binary, Byte:8, B2/binary>>,
NB;
set_byte(Backup, File, Pos, Byte) ->
- ?line copy_file(Backup, File),
- ?line set_byte(File, Pos, Byte),
+ copy_file(Backup, File),
+ set_byte(File, Pos, Byte),
File.
set_byte(File, Pos, Byte) ->
- ?line {ok, Fd} = file:open(File, [read, write]),
- ?line {ok, _} = file:position(Fd, Pos),
- ?line ok = file:write(Fd, [Byte]),
- ?line file:close(Fd).
+ {ok, Fd} = file:open(File, [read, write]),
+ {ok, _} = file:position(Fd, Pos),
+ ok = file:write(Fd, [Byte]),
+ file:close(Fd).
copy_file(Src, Dest) ->
- % ?t:format("copying from ~p to ~p~n", [Src, Dest]),
- ?line {ok, _} = file:copy(Src, Dest),
- ?line ok = file:change_mode(Dest, 8#0666).
+ {ok, _} = file:copy(Src, Dest),
+ ok = file:change_mode(Dest, 8#0666).
delete_files(Files) ->
lists:foreach(fun(F) -> file:delete(F) end, Files).
@@ -772,7 +759,7 @@ ver(S, {error, beam_lib, R}) ->
[S|_] = tuple_to_list(R),
case lists:flatten(beam_lib:format_error(R)) of
[${ | _] ->
- test_server:fail({bad_format_error, R});
+ ct:fail({bad_format_error, R});
_ ->
ok
end.
diff --git a/lib/stdlib/test/binary_module_SUITE.erl b/lib/stdlib/test/binary_module_SUITE.erl
index 8bb29b6a26..285740d3e0 100644
--- a/lib/stdlib/test/binary_module_SUITE.erl
+++ b/lib/stdlib/test/binary_module_SUITE.erl
@@ -20,6 +20,7 @@
-module(binary_module_SUITE).
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
+ init_per_testcase/2, end_per_testcase/2,
init_per_group/2,end_per_group/2,
interesting/1,scope_return/1,random_ref_comp/1,random_ref_sr_comp/1,
random_ref_fla_comp/1,parts/1, bin_to_list/1, list_to_bin/1,
@@ -27,45 +28,17 @@
-export([random_number/1, make_unaligned/1]).
-
-
-%%-define(STANDALONE,1).
-
--ifdef(STANDALONE).
-
--define(line,erlang:display({?MODULE,?LINE}),).
-
--else.
-
-include_lib("common_test/include/ct.hrl").
--export([init_per_testcase/2, end_per_testcase/2]).
-% Default timetrap timeout (set in init_per_testcase).
-% Some of these testcases are really heavy...
--define(default_timeout, ?t:minutes(30)).
-
--endif.
-
-
-
--ifdef(STANDALONE).
--export([run/0]).
-
-run() ->
- [ apply(?MODULE,X,[[]]) || X <- all(suite) ].
-
--else.
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- ?line Dog = ?config(watchdog, Config),
- ?line test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
--endif.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,30}}].
all() ->
[scope_return,interesting, random_ref_fla_comp, random_ref_sr_comp,
@@ -92,300 +65,297 @@ end_per_group(_GroupName, Config) ->
-define(MASK_ERROR(EXPR),mask_error((catch (EXPR)))).
-badargs(doc) ->
- ["Tests various badarg exceptions in the module"];
+%% Test various badarg exceptions in the module.
badargs(Config) when is_list(Config) ->
- ?line badarg = ?MASK_ERROR(binary:compile_pattern([<<1,2,3:3>>])),
- ?line badarg = ?MASK_ERROR(binary:compile_pattern([<<1,2,3>>|<<1,2>>])),
- ?line badarg = ?MASK_ERROR(binary:compile_pattern(<<1,2,3:3>>)),
- ?line badarg = ?MASK_ERROR(binary:compile_pattern(<<>>)),
- ?line badarg = ?MASK_ERROR(binary:match(<<1,2,3:3>>,<<1>>)),
- ?line badarg = ?MASK_ERROR(binary:matches(<<1,2,3:3>>,<<1>>)),
- ?line badarg = ?MASK_ERROR(binary:match(<<1,2,3>>,<<1>>,
- [{scope,{0,1},1}])),
- ?line badarg = ?MASK_ERROR(binary:match(<<1,2,3>>,<<1>>,
- [{scape,{0,1}}])),
- ?line badarg = ?MASK_ERROR(binary:match(<<1,2,3>>,<<1>>,
- [{scope,{0,1,1}}])),
- ?line badarg = ?MASK_ERROR(binary:match(<<1,2,3>>,<<1>>,[{scope,0,1}])),
- ?line badarg = ?MASK_ERROR(binary:match(<<1,2,3>>,<<1>>,[{scope,[0,1]}])),
- ?line badarg = ?MASK_ERROR(binary:match(<<1,2,3>>,<<1>>,
- [{scope,{0.1,1}}])),
- ?line badarg = ?MASK_ERROR(binary:match(<<1,2,3>>,<<1>>,
- [{scope,{1,1.1}}])),
- ?line badarg =
+ badarg = ?MASK_ERROR(binary:compile_pattern([<<1,2,3:3>>])),
+ badarg = ?MASK_ERROR(binary:compile_pattern([<<1,2,3>>|<<1,2>>])),
+ badarg = ?MASK_ERROR(binary:compile_pattern(<<1,2,3:3>>)),
+ badarg = ?MASK_ERROR(binary:compile_pattern(<<>>)),
+ badarg = ?MASK_ERROR(binary:match(<<1,2,3:3>>,<<1>>)),
+ badarg = ?MASK_ERROR(binary:matches(<<1,2,3:3>>,<<1>>)),
+ badarg = ?MASK_ERROR(binary:match(<<1,2,3>>,<<1>>,
+ [{scope,{0,1},1}])),
+ badarg = ?MASK_ERROR(binary:match(<<1,2,3>>,<<1>>,
+ [{scape,{0,1}}])),
+ badarg = ?MASK_ERROR(binary:match(<<1,2,3>>,<<1>>,
+ [{scope,{0,1,1}}])),
+ badarg = ?MASK_ERROR(binary:match(<<1,2,3>>,<<1>>,[{scope,0,1}])),
+ badarg = ?MASK_ERROR(binary:match(<<1,2,3>>,<<1>>,[{scope,[0,1]}])),
+ badarg = ?MASK_ERROR(binary:match(<<1,2,3>>,<<1>>,
+ [{scope,{0.1,1}}])),
+ badarg = ?MASK_ERROR(binary:match(<<1,2,3>>,<<1>>,
+ [{scope,{1,1.1}}])),
+ badarg =
?MASK_ERROR(
binary:match(<<1,2,3>>,<<1>>,
[{scope,{16#FF,
16#FFFFFFFFFFFFFFFF}}])),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:match(<<1,2,3>>,<<1>>,
[{scope,{16#FFFFFFFFFFFFFFFF,
-16#7FFFFFFFFFFFFFFF-1}}])),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:match(<<1,2,3>>,<<1>>,
[{scope,{16#FFFFFFFFFFFFFFFF,
16#7FFFFFFFFFFFFFFF}}])),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:part(<<1,2,3>>,{16#FF,
- 16#FFFFFFFFFFFFFFFF})),
- ?line badarg =
+ 16#FFFFFFFFFFFFFFFF})),
+ badarg =
?MASK_ERROR(
binary:part(<<1,2,3>>,{16#FFFFFFFFFFFFFFFF,
- -16#7FFFFFFFFFFFFFFF-1})),
- ?line badarg =
+ -16#7FFFFFFFFFFFFFFF-1})),
+ badarg =
?MASK_ERROR(
binary:part(<<1,2,3>>,{16#FFFFFFFFFFFFFFFF,
- 16#7FFFFFFFFFFFFFFF})),
- ?line badarg =
+ 16#7FFFFFFFFFFFFFFF})),
+ badarg =
?MASK_ERROR(
binary:part(make_unaligned(<<1,2,3>>),{1,1,1})),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary_part(make_unaligned(<<1,2,3>>),{1,1,1})),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary_part(make_unaligned(<<1,2,3>>),{16#FFFFFFFFFFFFFFFF,
- -16#7FFFFFFFFFFFFFFF-1})),
- ?line badarg =
+ -16#7FFFFFFFFFFFFFFF-1})),
+ badarg =
?MASK_ERROR(
binary_part(make_unaligned(<<1,2,3>>),{16#FF,
- 16#FFFFFFFFFFFFFFFF})),
- ?line badarg =
+ 16#FFFFFFFFFFFFFFFF})),
+ badarg =
?MASK_ERROR(
binary_part(make_unaligned(<<1,2,3>>),{16#FFFFFFFFFFFFFFFF,
- 16#7FFFFFFFFFFFFFFF})),
- ?line badarg =
+ 16#7FFFFFFFFFFFFFFF})),
+ badarg =
?MASK_ERROR(
binary_part(make_unaligned(<<1,2,3>>),{16#FFFFFFFFFFFFFFFFFF,
- -16#7FFF})),
- ?line badarg =
+ -16#7FFF})),
+ badarg =
?MASK_ERROR(
binary_part(make_unaligned(<<1,2,3>>),{16#FF,
- -16#7FFF})),
- ?line badarg =
+ -16#7FFF})),
+ badarg =
?MASK_ERROR(
binary:bin_to_list(<<1,2,3>>,{16#FF,
- 16#FFFFFFFFFFFFFFFF})),
- ?line badarg =
+ 16#FFFFFFFFFFFFFFFF})),
+ badarg =
?MASK_ERROR(
binary:bin_to_list(<<1,2,3>>,{16#FFFFFFFFFFFFFFFF,
- -16#7FFFFFFFFFFFFFFF-1})),
- ?line badarg =
+ -16#7FFFFFFFFFFFFFFF-1})),
+ badarg =
?MASK_ERROR(
binary:bin_to_list(<<1,2,3>>,{16#FFFFFFFFFFFFFFFF,
- 16#7FFFFFFFFFFFFFFF})),
- ?line [1,2,3] =
+ 16#7FFFFFFFFFFFFFFF})),
+ [1,2,3] =
?MASK_ERROR(
binary:bin_to_list(<<1,2,3>>)),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:bin_to_list(<<1,2,3>>,[])),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:bin_to_list(<<1,2,3>>,{1,2,3})),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:bin_to_list(<<1,2,3>>,{1.0,1})),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:bin_to_list(<<1,2,3>>,{1,1.0})),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:bin_to_list(<<1,2,3:3>>,{1,1})),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:bin_to_list(<<1,2,3:3>>)),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:bin_to_list([1,2,3])),
- ?line nomatch =
+ nomatch =
?MASK_ERROR(binary:match(<<1,2,3>>,<<1>>,[{scope,{0,0}}])),
- ?line badarg =
+ badarg =
?MASK_ERROR(binary:match(<<1,2,3>>,{bm,<<>>},[{scope,{0,1}}])),
- ?line badarg =
+ badarg =
?MASK_ERROR(binary:match(<<1,2,3>>,[],[{scope,{0,1}}])),
- ?line badarg =
+ badarg =
?MASK_ERROR(binary:match(<<1,2,3>>,{ac,<<>>},[{scope,{0,1}}])),
- ?line {bm,BMMagic} = binary:compile_pattern([<<1,2,3>>]),
- ?line {ac,ACMagic} = binary:compile_pattern([<<1,2,3>>,<<4,5>>]),
- ?line badarg =
+ {bm,BMMagic} = binary:compile_pattern([<<1,2,3>>]),
+ {ac,ACMagic} = binary:compile_pattern([<<1,2,3>>,<<4,5>>]),
+ badarg =
?MASK_ERROR(binary:match(<<1,2,3>>,{bm,ACMagic},[{scope,{0,1}}])),
- ?line badarg =
+ badarg =
?MASK_ERROR(binary:match(<<1,2,3>>,{ac,BMMagic},[{scope,{0,1}}])),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:match(<<1,2,3>>,
{bm,ets:match_spec_compile([{'_',[],['$_']}])},
[{scope,{0,1}}])),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:match(<<1,2,3>>,
{ac,ets:match_spec_compile([{'_',[],['$_']}])},
[{scope,{0,1}}])),
- ?line [] =
+ [] =
?MASK_ERROR(binary:matches(<<1,2,3>>,<<1>>,[{scope,{0,0}}])),
- ?line badarg =
+ badarg =
?MASK_ERROR(binary:matches(<<1,2,3>>,{bm,<<>>},[{scope,{0,1}}])),
- ?line badarg =
+ badarg =
?MASK_ERROR(binary:matches(<<1,2,3>>,[],[{scope,{0,1}}])),
- ?line badarg =
+ badarg =
?MASK_ERROR(binary:matches(<<1,2,3>>,{ac,<<>>},[{scope,{0,1}}])),
- ?line badarg =
+ badarg =
?MASK_ERROR(binary:matches(<<1,2,3>>,{bm,ACMagic},[{scope,{0,1}}])),
- ?line badarg =
+ badarg =
?MASK_ERROR(binary:matches(<<1,2,3>>,{ac,BMMagic},[{scope,{0,1}}])),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:matches(<<1,2,3>>,
- {bm,ets:match_spec_compile([{'_',[],['$_']}])},
- [{scope,{0,1}}])),
- ?line badarg =
+ {bm,ets:match_spec_compile([{'_',[],['$_']}])},
+ [{scope,{0,1}}])),
+ badarg =
?MASK_ERROR(
binary:matches(<<1,2,3>>,
- {ac,ets:match_spec_compile([{'_',[],['$_']}])},
- [{scope,{0,1}}])),
+ {ac,ets:match_spec_compile([{'_',[],['$_']}])},
+ [{scope,{0,1}}])),
%% OTP-11350
badarg = ?MASK_ERROR(
binary:matches(<<"foo">>,
[<<>>, <<"f">>])),
- ?line badarg =
+ badarg =
?MASK_ERROR(binary:longest_common_prefix(
[<<0:10000,1,2,4,1:3>>,
<<0:10000,1,2,3>>])),
- ?line badarg =
+ badarg =
?MASK_ERROR(binary:longest_common_suffix(
[<<0:10000,1,2,4,1:3>>,
<<0:10000,1,2,3>>])),
- ?line badarg =
+ badarg =
?MASK_ERROR(binary:encode_unsigned(-1)),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:encode_unsigned(-16#FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:first(<<1,2,4,1:3>>)),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:first([1,2,4])),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:last(<<1,2,4,1:3>>)),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:last([1,2,4])),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:at(<<1,2,4,1:3>>,2)),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:at(<<>>,2)),
- ?line badarg =
+ badarg =
?MASK_ERROR(
binary:at([1,2,4],2)),
ok.
-longest_common_trap(doc) ->
- ["Whitebox test to force special trap conditions in longest_common_{prefix,suffix}"];
+%% Whitebox test to force special trap conditions in
+%% longest_common_{prefix,suffix}.
longest_common_trap(Config) when is_list(Config) ->
- ?line erts_debug:set_internal_state(available_internal_state,true),
- ?line io:format("oldlimit: ~p~n",
- [erts_debug:set_internal_state(binary_loop_limit,10)]),
+ erts_debug:set_internal_state(available_internal_state,true),
+ io:format("oldlimit: ~p~n",
+ [erts_debug:set_internal_state(binary_loop_limit,10)]),
erlang:bump_reductions(10000000),
- ?line _ = binary:longest_common_prefix(
- [<<0:10000,1,2,4>>,
- <<0:10000,1,2,3>>,
- <<0:10000,1,3,3>>,
- <<0:10000,1,2,4>>,
- <<0:10000,1,2,4>>,
- <<0:10000,1,2,3>>,
- <<0:10000,1,3,3>>,
- <<0:10000,1,2,3>>,
- <<0:10000,1,3,3>>,
- <<0:10000,1,2,4>>,
- <<0:10000,1,2,4>>,
- <<0:10000,1,2,3>>,
- <<0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0:10000,1,3,3>>,
- <<0:10000,1,2,4>>]),
- ?line _ = binary:longest_common_prefix(
- [<<0:10000,1,2,4>>,
- <<0:10000,1,2,3>>,
- <<0:10000,1,3,3>>,
- <<0:10000,1,2,4>>,
- <<0:10000,1,2,4>>,
- <<0:10000,1,2,3>>,
- <<0:10000,1,3,3>>,
- <<0:10000,1,2,3>>,
- <<0:10000,1,3,3>>,
- <<0:10000,1,2,4>>,
- <<0:10000,1,2,4>>,
- <<0:10000,1,2,3>>,
- <<0,0,0,0,0,0,0,0,0,0,0,0,0,0>>,
- <<0:10000,1,2,4>>]),
+ _ = binary:longest_common_prefix(
+ [<<0:10000,1,2,4>>,
+ <<0:10000,1,2,3>>,
+ <<0:10000,1,3,3>>,
+ <<0:10000,1,2,4>>,
+ <<0:10000,1,2,4>>,
+ <<0:10000,1,2,3>>,
+ <<0:10000,1,3,3>>,
+ <<0:10000,1,2,3>>,
+ <<0:10000,1,3,3>>,
+ <<0:10000,1,2,4>>,
+ <<0:10000,1,2,4>>,
+ <<0:10000,1,2,3>>,
+ <<0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0:10000,1,3,3>>,
+ <<0:10000,1,2,4>>]),
+ _ = binary:longest_common_prefix(
+ [<<0:10000,1,2,4>>,
+ <<0:10000,1,2,3>>,
+ <<0:10000,1,3,3>>,
+ <<0:10000,1,2,4>>,
+ <<0:10000,1,2,4>>,
+ <<0:10000,1,2,3>>,
+ <<0:10000,1,3,3>>,
+ <<0:10000,1,2,3>>,
+ <<0:10000,1,3,3>>,
+ <<0:10000,1,2,4>>,
+ <<0:10000,1,2,4>>,
+ <<0:10000,1,2,3>>,
+ <<0,0,0,0,0,0,0,0,0,0,0,0,0,0>>,
+ <<0:10000,1,2,4>>]),
erlang:bump_reductions(10000000),
- ?line _ = binary:longest_common_suffix(
- [<<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,3,3,0:10000,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>,
- <<1,2,4,0:10000>>]),
- ?line _ = binary:longest_common_suffix(
- [<<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<1,2,4,0:10000>>,
- <<0,0,0,0,0,0,0,0,0,0,0,0,0,0>>,
- <<1,2,4,0:10000>>]),
+ _ = binary:longest_common_suffix(
+ [<<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,3,3,0:10000,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>,
+ <<1,2,4,0:10000>>]),
+ _ = binary:longest_common_suffix(
+ [<<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<1,2,4,0:10000>>,
+ <<0,0,0,0,0,0,0,0,0,0,0,0,0,0>>,
+ <<1,2,4,0:10000>>]),
Subj = subj(),
Len = byte_size(Subj),
- ?line Len = binary:longest_common_suffix(
- [Subj,Subj,Subj]),
- ?line io:format("limit was: ~p~n",
- [erts_debug:set_internal_state(binary_loop_limit,
- default)]),
- ?line erts_debug:set_internal_state(available_internal_state,false),
+ Len = binary:longest_common_suffix(
+ [Subj,Subj,Subj]),
+ io:format("limit was: ~p~n",
+ [erts_debug:set_internal_state(binary_loop_limit,
+ default)]),
+ erts_debug:set_internal_state(available_internal_state,false),
ok.
subj() ->
- Me = self(),
- spawn(fun() ->
- X0 = iolist_to_binary([
- "1234567890",
- %lists:seq(16#21, 16#7e),
- lists:duplicate(100, $x)
- ]),
- Me ! X0,
- receive X -> X end
- end),
- X0 = receive A -> A end,
- <<X1:32/binary,_/binary>> = X0,
- Subject= <<X1/binary>>,
- Subject.
-
-
-scope_return(doc) ->
- ["Test correct return values for scopes (OTP-9701)."];
+ Me = self(),
+ spawn(fun() ->
+ X0 = iolist_to_binary([
+ "1234567890",
+ lists:duplicate(100, $x)
+ ]),
+ Me ! X0,
+ receive X -> X end
+ end),
+ X0 = receive A -> A end,
+ <<X1:32/binary,_/binary>> = X0,
+ Subject= <<X1/binary>>,
+ Subject.
+
+
+%% Test correct return values for scopes (OTP-9701).
scope_return(Config) when is_list(Config) ->
N=10000,
Bin=binary:copy(<<"a">>,N),
@@ -394,364 +364,362 @@ scope_return(Config) when is_list(Config) ->
scope_loop(_,N,N) ->
ok;
scope_loop(Bin,N,M) ->
- ?line {N,1} = binary:match(Bin,<<"a">>,[{scope,{N,1}}]),
- ?line {N,1} = binary:match(Bin,[<<"a">>,<<"b">>],[{scope,{N,1}}]),
+ {N,1} = binary:match(Bin,<<"a">>,[{scope,{N,1}}]),
+ {N,1} = binary:match(Bin,[<<"a">>,<<"b">>],[{scope,{N,1}}]),
scope_loop(Bin,N+1,M).
-interesting(doc) ->
- ["Try some interesting patterns"];
+%% Try some interesting patterns.
interesting(Config) when is_list(Config) ->
X = do_interesting(binary),
X = do_interesting(binref).
do_interesting(Module) ->
- ?line {0,4} = Module:match(<<"123456">>,
+ {0,4} = Module:match(<<"123456">>,
Module:compile_pattern([<<"12">>,<<"1234">>,
<<"23">>,<<"3">>,
<<"34">>,<<"456">>,
<<"45">>,<<"6">>])),
- ?line [{0,4},{5,1}] = Module:matches(<<"123456">>,
+ [{0,4},{5,1}] = Module:matches(<<"123456">>,
Module:compile_pattern([<<"12">>,<<"1234">>,
<<"23">>,<<"3">>,
<<"34">>,<<"456">>,
<<"45">>,<<"6">>])),
- ?line [{0,4}] = Module:matches(<<"123456">>,
+ [{0,4}] = Module:matches(<<"123456">>,
Module:compile_pattern([<<"12">>,<<"1234">>,
<<"23">>,<<"3">>,
<<"34">>,<<"456">>,
<<"45">>])),
- ?line [{0,2},{2,2}] = Module:matches(<<"123456">>,
- Module:compile_pattern([<<"12">>,
- <<"23">>,<<"3">>,
- <<"34">>,<<"456">>,
- <<"45">>])),
- ?line {1,4} = Module:match(<<"123456">>,
+ [{0,2},{2,2}] = Module:matches(<<"123456">>,
+ Module:compile_pattern([<<"12">>,
+ <<"23">>,<<"3">>,
+ <<"34">>,<<"456">>,
+ <<"45">>])),
+ {1,4} = Module:match(<<"123456">>,
Module:compile_pattern([<<"34">>,<<"34">>,
<<"12347">>,<<"2345">>])),
- ?line [{1,4}] = Module:matches(<<"123456">>,
+ [{1,4}] = Module:matches(<<"123456">>,
Module:compile_pattern([<<"34">>,<<"34">>,
<<"12347">>,<<"2345">>])),
- ?line [{2,2}] = Module:matches(<<"123456">>,
+ [{2,2}] = Module:matches(<<"123456">>,
Module:compile_pattern([<<"34">>,<<"34">>,
<<"12347">>,<<"2346">>])),
- ?line {0,4} = Module:match(<<"123456">>,
+ {0,4} = Module:match(<<"123456">>,
[<<"12">>,<<"1234">>,
<<"23">>,<<"3">>,
<<"34">>,<<"456">>,
<<"45">>,<<"6">>]),
- ?line [{0,4},{5,1}] = Module:matches(<<"123456">>,
+ [{0,4},{5,1}] = Module:matches(<<"123456">>,
[<<"12">>,<<"1234">>,
<<"23">>,<<"3">>,
<<"34">>,<<"456">>,
<<"45">>,<<"6">>]),
- ?line [{0,4}] = Module:matches(<<"123456">>,
+ [{0,4}] = Module:matches(<<"123456">>,
[<<"12">>,<<"1234">>,
<<"23">>,<<"3">>,
<<"34">>,<<"456">>,
<<"45">>]),
- ?line [{0,2},{2,2}] = Module:matches(<<"123456">>,
- [<<"12">>,
- <<"23">>,<<"3">>,
- <<"34">>,<<"456">>,
- <<"45">>]),
- ?line {1,4} = Module:match(<<"123456">>,
- [<<"34">>,<<"34">>,
- <<"12347">>,<<"2345">>]),
- ?line [{1,4}] = Module:matches(<<"123456">>,
- [<<"34">>,<<"34">>,
- <<"12347">>,<<"2345">>]),
- ?line [{2,2}] = Module:matches(<<"123456">>,
- [<<"34">>,<<"34">>,
- <<"12347">>,<<"2346">>]),
- ?line nomatch = Module:match(<<1,2,3,4>>,<<2>>,[{scope,{0,1}}]),
- ?line {1,1} = Module:match(<<1,2,3,4>>,<<2>>,[{scope,{0,2}}]),
- ?line nomatch = Module:match(<<1,2,3,4>>,<<2,3>>,[{scope,{0,2}}]),
- ?line {1,2} = Module:match(<<1,2,3,4>>,<<2,3>>,[{scope,{0,3}}]),
- ?line {1,2} = Module:match(<<1,2,3,4>>,<<2,3>>,[{scope,{0,4}}]),
- ?line badarg = ?MASK_ERROR(Module:match(<<1,2,3,4>>,<<2,3>>,
- [{scope,{0,5}}])),
- ?line {1,2} = Module:match(<<1,2,3,4>>,<<2,3>>,[{scope,{4,-4}}]),
- ?line {0,3} = Module:match(<<1,2,3,4>>,<<1,2,3>>,[{scope,{4,-4}}]),
- ?line {0,4} = Module:match(<<1,2,3,4>>,<<1,2,3,4>>,[{scope,{4,-4}}]),
- ?line badarg = ?MASK_ERROR(Module:match(<<1,2,3,4>>,<<1,2,3,4>>,
- [{scope,{3,-4}}])),
- ?line [] = Module:matches(<<1,2,3,4>>,<<2>>,[{scope,{0,1}}]),
- ?line [{1,1}] = Module:matches(<<1,2,3,4>>,[<<2>>,<<3>>],[{scope,{0,2}}]),
- ?line [] = Module:matches(<<1,2,3,4>>,<<2,3>>,[{scope,{0,2}}]),
- ?line [{1,2}] = Module:matches(<<1,2,3,4>>,<<2,3>>,[{scope,{0,3}}]),
- ?line [{1,2}] = Module:matches(<<1,2,3,4>>,<<2,3>>,[{scope,{0,4}}]),
- ?line [{1,2}] = Module:matches(<<1,2,3,4>>,[<<2,3>>,<<4>>],
- [{scope,{0,3}}]),
- ?line [{1,2},{3,1}] = Module:matches(<<1,2,3,4>>,[<<2,3>>,<<4>>],
- [{scope,{0,4}}]),
- ?line badarg = ?MASK_ERROR(Module:matches(<<1,2,3,4>>,<<2,3>>,
- [{scope,{0,5}}])),
- ?line [{1,2}] = Module:matches(<<1,2,3,4>>,<<2,3>>,[{scope,{4,-4}}]),
- ?line [{1,2},{3,1}] = Module:matches(<<1,2,3,4>>,[<<2,3>>,<<4>>],
- [{scope,{4,-4}}]),
- ?line [{0,3}] = Module:matches(<<1,2,3,4>>,<<1,2,3>>,[{scope,{4,-4}}]),
- ?line [{0,4}] = Module:matches(<<1,2,3,4>>,<<1,2,3,4>>,[{scope,{4,-4}}]),
- ?line badarg = ?MASK_ERROR(Module:matches(<<1,2,3,4>>,<<1,2,3,4>>,
- [{scope,{3,-4}}])),
- ?line badarg = ?MASK_ERROR(Module:matches(<<1,2,3,4>>,[<<1,2,3,4>>],
- [{scope,{3,-4}}])),
- ?line [<<1,2,3>>,<<6,7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,<<4,5>>),
- ?line [<<1,2,3>>,<<6,7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>]),
- ?line [<<1,2,3>>,<<6>>,<<8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>],[global]),
- ?line [<<1,2,3>>,<<6>>,<<>>,<<>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>,<<8>>],
- [global]),
- ?line [<<1,2,3>>,<<6>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>,<<8>>],
- [global,trim]),
- ?line [<<1,2,3>>,<<6>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>,<<8>>],
- [global,trim_all]),
- ?line [<<1,2,3,4,5,6,7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>,<<8>>],
- [global,trim,{scope,{0,4}}]),
- ?line [<<1,2,3>>,<<6,7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
+ [{0,2},{2,2}] = Module:matches(<<"123456">>,
+ [<<"12">>,
+ <<"23">>,<<"3">>,
+ <<"34">>,<<"456">>,
+ <<"45">>]),
+ {1,4} = Module:match(<<"123456">>,
+ [<<"34">>,<<"34">>,
+ <<"12347">>,<<"2345">>]),
+ [{1,4}] = Module:matches(<<"123456">>,
+ [<<"34">>,<<"34">>,
+ <<"12347">>,<<"2345">>]),
+ [{2,2}] = Module:matches(<<"123456">>,
+ [<<"34">>,<<"34">>,
+ <<"12347">>,<<"2346">>]),
+ nomatch = Module:match(<<1,2,3,4>>,<<2>>,[{scope,{0,1}}]),
+ {1,1} = Module:match(<<1,2,3,4>>,<<2>>,[{scope,{0,2}}]),
+ nomatch = Module:match(<<1,2,3,4>>,<<2,3>>,[{scope,{0,2}}]),
+ {1,2} = Module:match(<<1,2,3,4>>,<<2,3>>,[{scope,{0,3}}]),
+ {1,2} = Module:match(<<1,2,3,4>>,<<2,3>>,[{scope,{0,4}}]),
+ badarg = ?MASK_ERROR(Module:match(<<1,2,3,4>>,<<2,3>>,
+ [{scope,{0,5}}])),
+ {1,2} = Module:match(<<1,2,3,4>>,<<2,3>>,[{scope,{4,-4}}]),
+ {0,3} = Module:match(<<1,2,3,4>>,<<1,2,3>>,[{scope,{4,-4}}]),
+ {0,4} = Module:match(<<1,2,3,4>>,<<1,2,3,4>>,[{scope,{4,-4}}]),
+ badarg = ?MASK_ERROR(Module:match(<<1,2,3,4>>,<<1,2,3,4>>,
+ [{scope,{3,-4}}])),
+ [] = Module:matches(<<1,2,3,4>>,<<2>>,[{scope,{0,1}}]),
+ [{1,1}] = Module:matches(<<1,2,3,4>>,[<<2>>,<<3>>],[{scope,{0,2}}]),
+ [] = Module:matches(<<1,2,3,4>>,<<2,3>>,[{scope,{0,2}}]),
+ [{1,2}] = Module:matches(<<1,2,3,4>>,<<2,3>>,[{scope,{0,3}}]),
+ [{1,2}] = Module:matches(<<1,2,3,4>>,<<2,3>>,[{scope,{0,4}}]),
+ [{1,2}] = Module:matches(<<1,2,3,4>>,[<<2,3>>,<<4>>],
+ [{scope,{0,3}}]),
+ [{1,2},{3,1}] = Module:matches(<<1,2,3,4>>,[<<2,3>>,<<4>>],
+ [{scope,{0,4}}]),
+ badarg = ?MASK_ERROR(Module:matches(<<1,2,3,4>>,<<2,3>>,
+ [{scope,{0,5}}])),
+ [{1,2}] = Module:matches(<<1,2,3,4>>,<<2,3>>,[{scope,{4,-4}}]),
+ [{1,2},{3,1}] = Module:matches(<<1,2,3,4>>,[<<2,3>>,<<4>>],
+ [{scope,{4,-4}}]),
+ [{0,3}] = Module:matches(<<1,2,3,4>>,<<1,2,3>>,[{scope,{4,-4}}]),
+ [{0,4}] = Module:matches(<<1,2,3,4>>,<<1,2,3,4>>,[{scope,{4,-4}}]),
+ badarg = ?MASK_ERROR(Module:matches(<<1,2,3,4>>,<<1,2,3,4>>,
+ [{scope,{3,-4}}])),
+ badarg = ?MASK_ERROR(Module:matches(<<1,2,3,4>>,[<<1,2,3,4>>],
+ [{scope,{3,-4}}])),
+ [<<1,2,3>>,<<6,7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,<<4,5>>),
+ [<<1,2,3>>,<<6,7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>]),
+ [<<1,2,3>>,<<6>>,<<8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>],[global]),
+ [<<1,2,3>>,<<6>>,<<>>,<<>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
[<<4,5>>,<<7>>,<<8>>],
- [global,trim,{scope,{0,5}}]),
-
- ?line [<<>>,<<>>,<<3>>,<<6,7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
- [<<1>>,<<2>>,<<4,5>>],
- [global,trim]),
- ?line [<<3>>,<<6,7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
- [<<1>>,<<2>>,<<4,5>>],
- [global,trim_all]),
-
- ?line [<<1,2,3>>,<<>>,<<7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<6>>],
- [global,trim]),
- ?line [<<1,2,3>>,<<7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<6>>],
- [global,trim_all]),
- ?line [<<>>,<<>>,<<3>>,<<>>,<<6>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
- [<<1>>,<<2>>,<<4>>,<<5>>,<<7>>,<<8>>],
- [global,trim]),
- ?line [<<3>>,<<6>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
- [<<1>>,<<2>>,<<4>>,<<5>>,<<7>>,<<8>>],
- [global,trim_all]),
+ [global]),
+ [<<1,2,3>>,<<6>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>,<<8>>],
+ [global,trim]),
+ [<<1,2,3>>,<<6>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>,<<8>>],
+ [global,trim_all]),
+ [<<1,2,3,4,5,6,7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>,<<8>>],
+ [global,trim,{scope,{0,4}}]),
+ [<<1,2,3>>,<<6,7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>,<<8>>],
+ [global,trim,{scope,{0,5}}]),
+
+ [<<>>,<<>>,<<3>>,<<6,7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
+ [<<1>>,<<2>>,<<4,5>>],
+ [global,trim]),
+ [<<3>>,<<6,7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
+ [<<1>>,<<2>>,<<4,5>>],
+ [global,trim_all]),
+
+ [<<1,2,3>>,<<>>,<<7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<6>>],
+ [global,trim]),
+ [<<1,2,3>>,<<7,8>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<6>>],
+ [global,trim_all]),
+ [<<>>,<<>>,<<3>>,<<>>,<<6>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
+ [<<1>>,<<2>>,<<4>>,<<5>>,<<7>>,<<8>>],
+ [global,trim]),
+ [<<3>>,<<6>>] = Module:split(<<1,2,3,4,5,6,7,8>>,
+ [<<1>>,<<2>>,<<4>>,<<5>>,<<7>>,<<8>>],
+ [global,trim_all]),
[<<>>] = binary:split(<<>>, <<",">>, []),
[] = binary:split(<<>>, <<",">>, [trim]),
[] = binary:split(<<>>, <<",">>, [trim_all]),
[] = binary:split(<<>>, <<",">>, [global,trim]),
[] = binary:split(<<>>, <<",">>, [global,trim_all]),
- ?line badarg = ?MASK_ERROR(
- Module:replace(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>,<<8>>],<<99>>,
- [global,trim,{scope,{0,5}}])),
- ?line <<1,2,3,99,6,7,8>> = Module:replace(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>,<<8>>],<<99>>,[]),
- ?line <<1,2,3,99,6,99,99>> = Module:replace(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>,<<8>>],<<99>>,
- [global]),
- ?line <<1,2,3,99,6,7,8>> = Module:replace(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>,<<8>>],<<99>>,
- [global,{scope,{0,5}}]),
- ?line <<1,2,3,99,6,7,8>> = Module:replace(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>,<<8>>],<<99>>,
- [global,{scope,{0,5}}]),
- ?line <<1,2,3,99,6,7,8>> = Module:replace(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>,<<8>>],<<99>>,
- [global,{scope,{0,5}}]),
- ?line badarg = ?MASK_ERROR(Module:replace(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>,<<8>>],<<99>>,
- [global,{scope,{0,5}},
- {insert,1}])),
- ?line <<1,2,3,99,4,5,6,7,8>> = Module:replace(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>,<<8>>],<<99>>,
- [global,{scope,{0,5}},
- {insert_replaced,1}]),
- ?line <<1,2,3,9,4,5,9,6,7,8>> = Module:replace(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>,<<8>>],
- <<9,9>>,
- [global,{scope,{0,5}},
- {insert_replaced,1}]),
- ?line badarg = ?MASK_ERROR(Module:replace(<<1,2,3,4,5,6,7,8>>,
- [<<4,5>>,<<7>>,<<8>>],<<>>,
- [global,{scope,{0,5}},
- {insert_replaced,1}])),
- ?line 2 = Module:longest_common_prefix([<<1,2,4>>,<<1,2,3>>]),
- ?line 2 = Module:longest_common_prefix([<<1,2,4>>,<<1,2>>]),
- ?line 1 = Module:longest_common_prefix([<<1,2,4>>,<<1>>]),
- ?line 0 = Module:longest_common_prefix([<<1,2,4>>,<<>>]),
- ?line 1 = Module:longest_common_prefix([<<1,2,4>>,<<1,2,3>>,<<1,3,3>>]),
- ?line 1 = Module:longest_common_prefix([<<1,2,4>>,<<1,2,3>>,<<1,3,3>>,<<1,2,4>>]),
- ?line 1251 = Module:longest_common_prefix([<<0:10000,1,2,4>>,
- <<0:10000,1,2,3>>,
- <<0:10000,1,3,3>>,
- <<0:10000,1,2,4>>]),
- ?line 12501 = Module:longest_common_prefix([<<0:100000,1,2,4>>,
- <<0:100000,1,2,3>>,
- <<0:100000,1,3,3>>,
- <<0:100000,1,2,4>>]),
- ?line 1251 = Module:longest_common_prefix(
- [make_unaligned(<<0:10000,1,2,4>>),
- <<0:10000,1,2,3>>,
- make_unaligned(<<0:10000,1,3,3>>),
- <<0:10000,1,2,4>>]),
- ?line 12501 = Module:longest_common_prefix(
- [<<0:100000,1,2,4>>,
- make_unaligned(<<0:100000,1,2,3>>),
- <<0:100000,1,3,3>>,
- make_unaligned(<<0:100000,1,2,4>>)]),
- ?line 1250001 = Module:longest_common_prefix([<<0:10000000,1,2,4>>,
- <<0:10000000,1,2,3>>,
- <<0:10000000,1,3,3>>,
- <<0:10000000,1,2,4>>]),
+ badarg = ?MASK_ERROR(
+ Module:replace(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>,<<8>>],<<99>>,
+ [global,trim,{scope,{0,5}}])),
+ <<1,2,3,99,6,7,8>> = Module:replace(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>,<<8>>],<<99>>,[]),
+ <<1,2,3,99,6,99,99>> = Module:replace(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>,<<8>>],<<99>>,
+ [global]),
+ <<1,2,3,99,6,7,8>> = Module:replace(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>,<<8>>],<<99>>,
+ [global,{scope,{0,5}}]),
+ <<1,2,3,99,6,7,8>> = Module:replace(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>,<<8>>],<<99>>,
+ [global,{scope,{0,5}}]),
+ <<1,2,3,99,6,7,8>> = Module:replace(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>,<<8>>],<<99>>,
+ [global,{scope,{0,5}}]),
+ badarg = ?MASK_ERROR(Module:replace(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>,<<8>>],<<99>>,
+ [global,{scope,{0,5}},
+ {insert,1}])),
+ <<1,2,3,99,4,5,6,7,8>> = Module:replace(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>,<<8>>],<<99>>,
+ [global,{scope,{0,5}},
+ {insert_replaced,1}]),
+ <<1,2,3,9,4,5,9,6,7,8>> = Module:replace(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>,<<8>>],
+ <<9,9>>,
+ [global,{scope,{0,5}},
+ {insert_replaced,1}]),
+ badarg = ?MASK_ERROR(Module:replace(<<1,2,3,4,5,6,7,8>>,
+ [<<4,5>>,<<7>>,<<8>>],<<>>,
+ [global,{scope,{0,5}},
+ {insert_replaced,1}])),
+ 2 = Module:longest_common_prefix([<<1,2,4>>,<<1,2,3>>]),
+ 2 = Module:longest_common_prefix([<<1,2,4>>,<<1,2>>]),
+ 1 = Module:longest_common_prefix([<<1,2,4>>,<<1>>]),
+ 0 = Module:longest_common_prefix([<<1,2,4>>,<<>>]),
+ 1 = Module:longest_common_prefix([<<1,2,4>>,<<1,2,3>>,<<1,3,3>>]),
+ 1 = Module:longest_common_prefix([<<1,2,4>>,<<1,2,3>>,<<1,3,3>>,<<1,2,4>>]),
+ 1251 = Module:longest_common_prefix([<<0:10000,1,2,4>>,
+ <<0:10000,1,2,3>>,
+ <<0:10000,1,3,3>>,
+ <<0:10000,1,2,4>>]),
+ 12501 = Module:longest_common_prefix([<<0:100000,1,2,4>>,
+ <<0:100000,1,2,3>>,
+ <<0:100000,1,3,3>>,
+ <<0:100000,1,2,4>>]),
+ 1251 = Module:longest_common_prefix(
+ [make_unaligned(<<0:10000,1,2,4>>),
+ <<0:10000,1,2,3>>,
+ make_unaligned(<<0:10000,1,3,3>>),
+ <<0:10000,1,2,4>>]),
+ 12501 = Module:longest_common_prefix(
+ [<<0:100000,1,2,4>>,
+ make_unaligned(<<0:100000,1,2,3>>),
+ <<0:100000,1,3,3>>,
+ make_unaligned(<<0:100000,1,2,4>>)]),
+ 1250001 = Module:longest_common_prefix([<<0:10000000,1,2,4>>,
+ <<0:10000000,1,2,3>>,
+ <<0:10000000,1,3,3>>,
+ <<0:10000000,1,2,4>>]),
if % Too cruel for the reference implementation
Module =:= binary ->
- ?line erts_debug:set_internal_state(available_internal_state,true),
- ?line io:format("oldlimit: ~p~n",
- [erts_debug:set_internal_state(
- binary_loop_limit,100)]),
- ?line 1250001 = Module:longest_common_prefix(
- [<<0:10000000,1,2,4>>,
- <<0:10000000,1,2,3>>,
- <<0:10000000,1,3,3>>,
- <<0:10000000,1,2,4>>]),
- ?line io:format("limit was: ~p~n",
- [erts_debug:set_internal_state(binary_loop_limit,
- default)]),
- ?line erts_debug:set_internal_state(available_internal_state,
- false);
+ erts_debug:set_internal_state(available_internal_state,true),
+ io:format("oldlimit: ~p~n",
+ [erts_debug:set_internal_state(
+ binary_loop_limit,100)]),
+ 1250001 = Module:longest_common_prefix(
+ [<<0:10000000,1,2,4>>,
+ <<0:10000000,1,2,3>>,
+ <<0:10000000,1,3,3>>,
+ <<0:10000000,1,2,4>>]),
+ io:format("limit was: ~p~n",
+ [erts_debug:set_internal_state(binary_loop_limit,
+ default)]),
+ erts_debug:set_internal_state(available_internal_state,
+ false);
true ->
ok
end,
- ?line 1 = Module:longest_common_suffix([<<0:100000000,1,2,4,5>>,
- <<0:100000000,1,2,3,5>>,
- <<0:100000000,1,3,3,5>>,
- <<0:100000000,1,2,4,5>>]),
- ?line 1 = Module:longest_common_suffix([<<1,2,4,5>>,
- <<0:100000000,1,2,3,5>>,
- <<0:100000000,1,3,3,5>>,
- <<0:100000000,1,2,4,5>>]),
- ?line 1 = Module:longest_common_suffix([<<1,2,4,5,5>>,<<5,5>>,
- <<0:100000000,1,3,3,5,5>>,
- <<0:100000000,1,2,4,5>>]),
- ?line 0 = Module:longest_common_suffix([<<1,2,4,5,5>>,<<5,5>>,
- <<0:100000000,1,3,3,5,5>>,
- <<0:100000000,1,2,4>>]),
- ?line 2 = Module:longest_common_suffix([<<1,2,4,5,5>>,<<5,5>>,
- <<0:100000000,1,3,3,5,5>>,
- <<0:100000000,1,2,4,5,5>>]),
- ?line 1 = Module:longest_common_suffix([<<1,2,4,5,5>>,<<5>>,
- <<0:100000000,1,3,3,5,5>>,
- <<0:100000000,1,2,4,5,5>>]),
- ?line 0 = Module:longest_common_suffix([<<1,2,4,5,5>>,<<>>,
- <<0:100000000,1,3,3,5,5>>,
- <<0:100000000,1,2,4,5,5>>]),
- ?line 0 = Module:longest_common_suffix([<<>>,<<0:100000000,1,3,3,5,5>>,
- <<0:100000000,1,2,4,5,5>>]),
- ?line 0 = Module:longest_common_suffix([<<>>,<<0:100000000,1,3,3,5,5>>,
- <<0:100000000,1,2,4,5,5>>]),
- ?line 2 = Module:longest_common_suffix([<<5,5>>,<<0:100000000,1,3,3,5,5>>,
- <<0:100000000,1,2,4,5,5>>]),
- ?line 2 = Module:longest_common_suffix([<<5,5>>,<<5,5>>,<<4,5,5>>]),
- ?line 2 = Module:longest_common_suffix([<<5,5>>,<<5,5>>,<<5,5>>]),
- ?line 3 = Module:longest_common_suffix([<<4,5,5>>,<<4,5,5>>,<<4,5,5>>]),
- ?line 0 = Module:longest_common_suffix([<<>>]),
- ?line badarg = ?MASK_ERROR(Module:longest_common_suffix([])),
- ?line badarg = ?MASK_ERROR(Module:longest_common_suffix([apa])),
- ?line badarg = ?MASK_ERROR(Module:longest_common_suffix([[<<>>]])),
- ?line badarg = ?MASK_ERROR(Module:longest_common_suffix([[<<0>>,
- <<1:9>>]])),
- ?line 0 = Module:longest_common_prefix([<<>>]),
- ?line badarg = ?MASK_ERROR(Module:longest_common_prefix([])),
- ?line badarg = ?MASK_ERROR(Module:longest_common_prefix([apa])),
- ?line badarg = ?MASK_ERROR(Module:longest_common_prefix([[<<>>]])),
- ?line badarg = ?MASK_ERROR(Module:longest_common_prefix([[<<0>>,
- <<1:9>>]])),
-
- ?line <<1:6,Bin:3/binary,_:2>> = <<1:6,1,2,3,1:2>>,
- ?line <<1,2,3>> = Bin,
- ?line 1 = Module:first(Bin),
- ?line 1 = Module:first(<<1>>),
- ?line 1 = Module:first(<<1,2,3>>),
- ?line badarg = ?MASK_ERROR(Module:first(<<>>)),
- ?line badarg = ?MASK_ERROR(Module:first(apa)),
- ?line 3 = Module:last(Bin),
- ?line 1 = Module:last(<<1>>),
- ?line 3 = Module:last(<<1,2,3>>),
- ?line badarg = ?MASK_ERROR(Module:last(<<>>)),
- ?line badarg = ?MASK_ERROR(Module:last(apa)),
- ?line 1 = Module:at(Bin,0),
- ?line 1 = Module:at(<<1>>,0),
- ?line 1 = Module:at(<<1,2,3>>,0),
- ?line 2 = Module:at(<<1,2,3>>,1),
- ?line 3 = Module:at(<<1,2,3>>,2),
- ?line badarg = ?MASK_ERROR(Module:at(<<1,2,3>>,3)),
- ?line badarg = ?MASK_ERROR(Module:at(<<1,2,3>>,-1)),
- ?line badarg = ?MASK_ERROR(Module:at(<<1,2,3>>,apa)),
- ?line "hejsan" = [ Module:at(<<"hejsan">>,I) || I <- lists:seq(0,5) ],
-
- ?line badarg = ?MASK_ERROR(Module:bin_to_list(<<1,2,3>>,3,-4)),
- ?line [1,2,3] = ?MASK_ERROR(Module:bin_to_list(<<1,2,3>>,3,-3)),
-
- ?line badarg = ?MASK_ERROR(Module:decode_unsigned(<<1,2,1:2>>,big)),
- ?line badarg = ?MASK_ERROR(Module:decode_unsigned(<<1,2,1:2>>,little)),
- ?line badarg = ?MASK_ERROR(Module:decode_unsigned(apa)),
- ?line badarg = ?MASK_ERROR(Module:decode_unsigned(125,little)),
- ?line 0 = ?MASK_ERROR(Module:decode_unsigned(<<>>,little)),
- ?line 0 = ?MASK_ERROR(Module:decode_unsigned(<<>>,big)),
- ?line 0 = ?MASK_ERROR(Module:decode_unsigned(<<0>>,little)),
- ?line 0 = ?MASK_ERROR(Module:decode_unsigned(<<0>>,big)),
- ?line 0 = ?MASK_ERROR(Module:decode_unsigned(make_unaligned(<<0>>),
- little)),
- ?line 0 = ?MASK_ERROR(Module:decode_unsigned(make_unaligned(<<0>>),big)),
- ?line badarg = ?MASK_ERROR(Module:encode_unsigned(apa)),
- ?line badarg = ?MASK_ERROR(Module:encode_unsigned(125.3,little)),
- ?line badarg = ?MASK_ERROR(Module:encode_unsigned({1},little)),
- ?line badarg = ?MASK_ERROR(Module:encode_unsigned([1],little)),
- ?line <<0>> = ?MASK_ERROR(Module:encode_unsigned(0,little)),
- ?line <<0>> = ?MASK_ERROR(Module:encode_unsigned(0,big)),
+ 1 = Module:longest_common_suffix([<<0:100000000,1,2,4,5>>,
+ <<0:100000000,1,2,3,5>>,
+ <<0:100000000,1,3,3,5>>,
+ <<0:100000000,1,2,4,5>>]),
+ 1 = Module:longest_common_suffix([<<1,2,4,5>>,
+ <<0:100000000,1,2,3,5>>,
+ <<0:100000000,1,3,3,5>>,
+ <<0:100000000,1,2,4,5>>]),
+ 1 = Module:longest_common_suffix([<<1,2,4,5,5>>,<<5,5>>,
+ <<0:100000000,1,3,3,5,5>>,
+ <<0:100000000,1,2,4,5>>]),
+ 0 = Module:longest_common_suffix([<<1,2,4,5,5>>,<<5,5>>,
+ <<0:100000000,1,3,3,5,5>>,
+ <<0:100000000,1,2,4>>]),
+ 2 = Module:longest_common_suffix([<<1,2,4,5,5>>,<<5,5>>,
+ <<0:100000000,1,3,3,5,5>>,
+ <<0:100000000,1,2,4,5,5>>]),
+ 1 = Module:longest_common_suffix([<<1,2,4,5,5>>,<<5>>,
+ <<0:100000000,1,3,3,5,5>>,
+ <<0:100000000,1,2,4,5,5>>]),
+ 0 = Module:longest_common_suffix([<<1,2,4,5,5>>,<<>>,
+ <<0:100000000,1,3,3,5,5>>,
+ <<0:100000000,1,2,4,5,5>>]),
+ 0 = Module:longest_common_suffix([<<>>,<<0:100000000,1,3,3,5,5>>,
+ <<0:100000000,1,2,4,5,5>>]),
+ 0 = Module:longest_common_suffix([<<>>,<<0:100000000,1,3,3,5,5>>,
+ <<0:100000000,1,2,4,5,5>>]),
+ 2 = Module:longest_common_suffix([<<5,5>>,<<0:100000000,1,3,3,5,5>>,
+ <<0:100000000,1,2,4,5,5>>]),
+ 2 = Module:longest_common_suffix([<<5,5>>,<<5,5>>,<<4,5,5>>]),
+ 2 = Module:longest_common_suffix([<<5,5>>,<<5,5>>,<<5,5>>]),
+ 3 = Module:longest_common_suffix([<<4,5,5>>,<<4,5,5>>,<<4,5,5>>]),
+ 0 = Module:longest_common_suffix([<<>>]),
+ badarg = ?MASK_ERROR(Module:longest_common_suffix([])),
+ badarg = ?MASK_ERROR(Module:longest_common_suffix([apa])),
+ badarg = ?MASK_ERROR(Module:longest_common_suffix([[<<>>]])),
+ badarg = ?MASK_ERROR(Module:longest_common_suffix([[<<0>>,
+ <<1:9>>]])),
+ 0 = Module:longest_common_prefix([<<>>]),
+ badarg = ?MASK_ERROR(Module:longest_common_prefix([])),
+ badarg = ?MASK_ERROR(Module:longest_common_prefix([apa])),
+ badarg = ?MASK_ERROR(Module:longest_common_prefix([[<<>>]])),
+ badarg = ?MASK_ERROR(Module:longest_common_prefix([[<<0>>,
+ <<1:9>>]])),
+
+ <<1:6,Bin:3/binary,_:2>> = <<1:6,1,2,3,1:2>>,
+ <<1,2,3>> = Bin,
+ 1 = Module:first(Bin),
+ 1 = Module:first(<<1>>),
+ 1 = Module:first(<<1,2,3>>),
+ badarg = ?MASK_ERROR(Module:first(<<>>)),
+ badarg = ?MASK_ERROR(Module:first(apa)),
+ 3 = Module:last(Bin),
+ 1 = Module:last(<<1>>),
+ 3 = Module:last(<<1,2,3>>),
+ badarg = ?MASK_ERROR(Module:last(<<>>)),
+ badarg = ?MASK_ERROR(Module:last(apa)),
+ 1 = Module:at(Bin,0),
+ 1 = Module:at(<<1>>,0),
+ 1 = Module:at(<<1,2,3>>,0),
+ 2 = Module:at(<<1,2,3>>,1),
+ 3 = Module:at(<<1,2,3>>,2),
+ badarg = ?MASK_ERROR(Module:at(<<1,2,3>>,3)),
+ badarg = ?MASK_ERROR(Module:at(<<1,2,3>>,-1)),
+ badarg = ?MASK_ERROR(Module:at(<<1,2,3>>,apa)),
+ "hejsan" = [ Module:at(<<"hejsan">>,I) || I <- lists:seq(0,5) ],
+
+ badarg = ?MASK_ERROR(Module:bin_to_list(<<1,2,3>>,3,-4)),
+ [1,2,3] = ?MASK_ERROR(Module:bin_to_list(<<1,2,3>>,3,-3)),
+
+ badarg = ?MASK_ERROR(Module:decode_unsigned(<<1,2,1:2>>,big)),
+ badarg = ?MASK_ERROR(Module:decode_unsigned(<<1,2,1:2>>,little)),
+ badarg = ?MASK_ERROR(Module:decode_unsigned(apa)),
+ badarg = ?MASK_ERROR(Module:decode_unsigned(125,little)),
+ 0 = ?MASK_ERROR(Module:decode_unsigned(<<>>,little)),
+ 0 = ?MASK_ERROR(Module:decode_unsigned(<<>>,big)),
+ 0 = ?MASK_ERROR(Module:decode_unsigned(<<0>>,little)),
+ 0 = ?MASK_ERROR(Module:decode_unsigned(<<0>>,big)),
+ 0 = ?MASK_ERROR(Module:decode_unsigned(make_unaligned(<<0>>),
+ little)),
+ 0 = ?MASK_ERROR(Module:decode_unsigned(make_unaligned(<<0>>),big)),
+ badarg = ?MASK_ERROR(Module:encode_unsigned(apa)),
+ badarg = ?MASK_ERROR(Module:encode_unsigned(125.3,little)),
+ badarg = ?MASK_ERROR(Module:encode_unsigned({1},little)),
+ badarg = ?MASK_ERROR(Module:encode_unsigned([1],little)),
+ <<0>> = ?MASK_ERROR(Module:encode_unsigned(0,little)),
+ <<0>> = ?MASK_ERROR(Module:encode_unsigned(0,big)),
ok.
-encode_decode(doc) ->
- ["test binary:encode_unsigned/1,2 and binary:decode_unsigned/1,2"];
+%% Test binary:encode_unsigned/1,2 and binary:decode_unsigned/1,2.
encode_decode(Config) when is_list(Config) ->
rand:seed(exsplus, {1271,769940,559934}),
- ?line ok = encode_decode_loop({1,200},1000), % Need to be long enough
- % to create offheap binaries
+ ok = encode_decode_loop({1,200},1000), % Need to be long enough
+ % to create offheap binaries
ok.
encode_decode_loop(_Range,0) ->
ok;
encode_decode_loop(Range, X) ->
- ?line N = random_number(Range),
- ?line A = binary:encode_unsigned(N),
- ?line B = binary:encode_unsigned(N,big),
- ?line C = binref:encode_unsigned(N),
- ?line D = binref:encode_unsigned(N,big),
- ?line E = binary:encode_unsigned(N,little),
- ?line F = binref:encode_unsigned(N,little),
- ?line G = binary:decode_unsigned(A),
- ?line H = binary:decode_unsigned(A,big),
- ?line I = binref:decode_unsigned(A),
- ?line J = binary:decode_unsigned(E,little),
- ?line K = binref:decode_unsigned(E,little),
- ?line L = binary:decode_unsigned(make_unaligned(A)),
- ?line M = binary:decode_unsigned(make_unaligned(E),little),
- ?line PaddedBig = <<0:48,A/binary>>,
- ?line PaddedLittle = <<E/binary,0:48>>,
- ?line O = binary:decode_unsigned(PaddedBig),
- ?line P = binary:decode_unsigned(make_unaligned(PaddedBig)),
- ?line Q = binary:decode_unsigned(PaddedLittle,little),
- ?line R = binary:decode_unsigned(make_unaligned(PaddedLittle),little),
- ?line S = binref:decode_unsigned(PaddedLittle,little),
- ?line T = binref:decode_unsigned(PaddedBig),
+ N = random_number(Range),
+ A = binary:encode_unsigned(N),
+ B = binary:encode_unsigned(N,big),
+ C = binref:encode_unsigned(N),
+ D = binref:encode_unsigned(N,big),
+ E = binary:encode_unsigned(N,little),
+ F = binref:encode_unsigned(N,little),
+ G = binary:decode_unsigned(A),
+ H = binary:decode_unsigned(A,big),
+ I = binref:decode_unsigned(A),
+ J = binary:decode_unsigned(E,little),
+ K = binref:decode_unsigned(E,little),
+ L = binary:decode_unsigned(make_unaligned(A)),
+ M = binary:decode_unsigned(make_unaligned(E),little),
+ PaddedBig = <<0:48,A/binary>>,
+ PaddedLittle = <<E/binary,0:48>>,
+ O = binary:decode_unsigned(PaddedBig),
+ P = binary:decode_unsigned(make_unaligned(PaddedBig)),
+ Q = binary:decode_unsigned(PaddedLittle,little),
+ R = binary:decode_unsigned(make_unaligned(PaddedLittle),little),
+ S = binref:decode_unsigned(PaddedLittle,little),
+ T = binref:decode_unsigned(PaddedBig),
case (((A =:= B) and (B =:= C) and (C =:= D)) and
- ((E =:= F)) and
- ((N =:= G) and (G =:= H) and (H =:= I) and
- (I =:= J) and (J =:= K) and (K =:= L) and (L =:= M)) and
- ((M =:= O) and (O =:= P) and (P =:= Q) and (Q =:= R) and
- (R =:= S) and (S =:= T)))of
+ ((E =:= F)) and
+ ((N =:= G) and (G =:= H) and (H =:= I) and
+ (I =:= J) and (J =:= K) and (K =:= L) and (L =:= M)) and
+ ((M =:= O) and (O =:= P) and (P =:= Q) and (Q =:= R) and
+ (R =:= S) and (S =:= T)))of
true ->
encode_decode_loop(Range,X-1);
_ ->
@@ -760,90 +728,86 @@ encode_decode_loop(Range, X) ->
exit(mismatch)
end.
-guard(doc) ->
- ["Smoke test of the guard BIFs binary_part/2,3"];
+%% Smoke test of the guard BIFs binary_part/2,3.
guard(Config) when is_list(Config) ->
{comment, "Guard tests are run in emulator test suite"}.
-referenced(doc) ->
- ["Test refernced_byte_size/1 bif."];
+%% Test referenced_byte_size/1 bif.
referenced(Config) when is_list(Config) ->
- ?line badarg = ?MASK_ERROR(binary:referenced_byte_size([])),
- ?line badarg = ?MASK_ERROR(binary:referenced_byte_size(apa)),
- ?line badarg = ?MASK_ERROR(binary:referenced_byte_size({})),
- ?line badarg = ?MASK_ERROR(binary:referenced_byte_size(1)),
- ?line A = <<1,2,3>>,
- ?line B = binary:copy(A,1000),
- ?line 3 = binary:referenced_byte_size(A),
- ?line 3000 = binary:referenced_byte_size(B),
- ?line <<_:8,C:2/binary>> = A,
- ?line 3 = binary:referenced_byte_size(C),
- ?line 2 = binary:referenced_byte_size(binary:copy(C)),
- ?line <<_:7,D:2/binary,_:1>> = A,
- ?line 2 = binary:referenced_byte_size(binary:copy(D)),
- ?line 3 = binary:referenced_byte_size(D),
- ?line <<_:8,E:2/binary,_/binary>> = B,
- ?line 3000 = binary:referenced_byte_size(E),
- ?line 2 = binary:referenced_byte_size(binary:copy(E)),
- ?line <<_:7,F:2/binary,_:1,_/binary>> = B,
- ?line 2 = binary:referenced_byte_size(binary:copy(F)),
- ?line 3000 = binary:referenced_byte_size(F),
+ badarg = ?MASK_ERROR(binary:referenced_byte_size([])),
+ badarg = ?MASK_ERROR(binary:referenced_byte_size(apa)),
+ badarg = ?MASK_ERROR(binary:referenced_byte_size({})),
+ badarg = ?MASK_ERROR(binary:referenced_byte_size(1)),
+ A = <<1,2,3>>,
+ B = binary:copy(A,1000),
+ 3 = binary:referenced_byte_size(A),
+ 3000 = binary:referenced_byte_size(B),
+ <<_:8,C:2/binary>> = A,
+ 3 = binary:referenced_byte_size(C),
+ 2 = binary:referenced_byte_size(binary:copy(C)),
+ <<_:7,D:2/binary,_:1>> = A,
+ 2 = binary:referenced_byte_size(binary:copy(D)),
+ 3 = binary:referenced_byte_size(D),
+ <<_:8,E:2/binary,_/binary>> = B,
+ 3000 = binary:referenced_byte_size(E),
+ 2 = binary:referenced_byte_size(binary:copy(E)),
+ <<_:7,F:2/binary,_:1,_/binary>> = B,
+ 2 = binary:referenced_byte_size(binary:copy(F)),
+ 3000 = binary:referenced_byte_size(F),
ok.
-list_to_bin(doc) ->
- ["Test list_to_bin/1 bif"];
+%% Test list_to_bin/1 BIF.
list_to_bin(Config) when is_list(Config) ->
%% Just some smoke_tests first, then go nuts with random cases
- ?line badarg = ?MASK_ERROR(binary:list_to_bin({})),
- ?line badarg = ?MASK_ERROR(binary:list_to_bin(apa)),
- ?line badarg = ?MASK_ERROR(binary:list_to_bin(<<"apa">>)),
+ badarg = ?MASK_ERROR(binary:list_to_bin({})),
+ badarg = ?MASK_ERROR(binary:list_to_bin(apa)),
+ badarg = ?MASK_ERROR(binary:list_to_bin(<<"apa">>)),
F1 = fun(L) ->
?MASK_ERROR(binref:list_to_bin(L))
end,
F2 = fun(L) ->
?MASK_ERROR(binary:list_to_bin(L))
end,
- ?line random_iolist:run(1000,F1,F2),
+ random_iolist:run(1000,F1,F2),
ok.
-copy(doc) ->
- ["Test copy/1,2 bif's"];
+%% Test copy/1,2 BIFs.
copy(Config) when is_list(Config) ->
- ?line <<1,2,3>> = binary:copy(<<1,2,3>>),
- ?line RS = random_string({1,10000}),
- ?line RS = RS2 = binary:copy(RS),
- ?line false = erts_debug:same(RS,RS2),
- ?line <<>> = ?MASK_ERROR(binary:copy(<<1,2,3>>,0)),
- ?line badarg = ?MASK_ERROR(binary:copy(<<1,2,3:3>>,2)),
- ?line badarg = ?MASK_ERROR(binary:copy([],0)),
- ?line <<>> = ?MASK_ERROR(binary:copy(<<>>,0)),
- ?line badarg = ?MASK_ERROR(binary:copy(<<1,2,3>>,1.0)),
- ?line badarg = ?MASK_ERROR(binary:copy(<<1,2,3>>,
- 16#FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)),
- ?line <<>> = binary:copy(<<>>,10000),
+ <<1,2,3>> = binary:copy(<<1,2,3>>),
+ RS = random_string({1,10000}),
+ RS = RS2 = binary:copy(RS),
+ false = erts_debug:same(RS,RS2),
+ <<>> = ?MASK_ERROR(binary:copy(<<1,2,3>>,0)),
+ badarg = ?MASK_ERROR(binary:copy(<<1,2,3:3>>,2)),
+ badarg = ?MASK_ERROR(binary:copy([],0)),
+ <<>> = ?MASK_ERROR(binary:copy(<<>>,0)),
+ badarg = ?MASK_ERROR(binary:copy(<<1,2,3>>,1.0)),
+ badarg = ?MASK_ERROR(binary:copy(<<1,2,3>>,
+ 16#FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)),
+ <<>> = binary:copy(<<>>,10000),
rand:seed(exsplus, {1271,769940,559934}),
- ?line ok = random_copy(3000),
- ?line erts_debug:set_internal_state(available_internal_state,true),
- ?line io:format("oldlimit: ~p~n",
- [erts_debug:set_internal_state(binary_loop_limit,10)]),
- ?line Subj = subj(),
- ?line XX = binary:copy(Subj,1000),
- ?line XX = binref:copy(Subj,1000),
- ?line ok = random_copy(1000),
- ?line kill_copy_loop(1000),
- ?line io:format("limit was: ~p~n",
- [erts_debug:set_internal_state(binary_loop_limit,
- default)]),
- ?line erts_debug:set_internal_state(available_internal_state,false),
+ ok = random_copy(3000),
+ erts_debug:set_internal_state(available_internal_state,true),
+ io:format("oldlimit: ~p~n",
+ [erts_debug:set_internal_state(binary_loop_limit,10)]),
+ Subj = subj(),
+ XX = binary:copy(Subj,1000),
+ XX = binref:copy(Subj,1000),
+ ok = random_copy(1000),
+ kill_copy_loop(1000),
+ io:format("limit was: ~p~n",
+ [erts_debug:set_internal_state(binary_loop_limit,
+ default)]),
+ erts_debug:set_internal_state(available_internal_state,false),
ok.
kill_copy_loop(0) ->
ok;
kill_copy_loop(N) ->
{Pid,Ref} = spawn_monitor(fun() ->
- ok = random_copy(1000)
+ ok = random_copy(1000)
end),
receive
after 10 ->
@@ -876,34 +840,33 @@ random_copy(N) ->
exit(mismatch)
end.
-bin_to_list(doc) ->
- ["Test bin_to_list/1,2,3 bif's"];
+%% Test bin_to_list/1,2,3 BIFs.
bin_to_list(Config) when is_list(Config) ->
%% Just some smoke_tests first, then go nuts with random cases
- ?line X = <<1,2,3,4,0:1000000,5>>,
- ?line Y = make_unaligned(X),
- ?line LX = binary:bin_to_list(X),
- ?line LX = binary:bin_to_list(X,0,byte_size(X)),
- ?line LX = binary:bin_to_list(X,byte_size(X),-byte_size(X)),
- ?line LX = binary:bin_to_list(X,{0,byte_size(X)}),
- ?line LX = binary:bin_to_list(X,{byte_size(X),-byte_size(X)}),
- ?line LY = binary:bin_to_list(Y),
- ?line LY = binary:bin_to_list(Y,0,byte_size(Y)),
- ?line LY = binary:bin_to_list(Y,byte_size(Y),-byte_size(Y)),
- ?line LY = binary:bin_to_list(Y,{0,byte_size(Y)}),
- ?line LY = binary:bin_to_list(Y,{byte_size(Y),-byte_size(Y)}),
- ?line 1 = hd(LX),
- ?line 5 = lists:last(LX),
- ?line 1 = hd(LY),
- ?line 5 = lists:last(LY),
- ?line X = list_to_binary(LY),
- ?line Y = list_to_binary(LY),
- ?line X = list_to_binary(LY),
- ?line [5] = lists:nthtail(byte_size(X)-1,LX),
- ?line [0,5] = lists:nthtail(byte_size(X)-2,LX),
- ?line [0,5] = lists:nthtail(byte_size(Y)-2,LY),
+ X = <<1,2,3,4,0:1000000,5>>,
+ Y = make_unaligned(X),
+ LX = binary:bin_to_list(X),
+ LX = binary:bin_to_list(X,0,byte_size(X)),
+ LX = binary:bin_to_list(X,byte_size(X),-byte_size(X)),
+ LX = binary:bin_to_list(X,{0,byte_size(X)}),
+ LX = binary:bin_to_list(X,{byte_size(X),-byte_size(X)}),
+ LY = binary:bin_to_list(Y),
+ LY = binary:bin_to_list(Y,0,byte_size(Y)),
+ LY = binary:bin_to_list(Y,byte_size(Y),-byte_size(Y)),
+ LY = binary:bin_to_list(Y,{0,byte_size(Y)}),
+ LY = binary:bin_to_list(Y,{byte_size(Y),-byte_size(Y)}),
+ 1 = hd(LX),
+ 5 = lists:last(LX),
+ 1 = hd(LY),
+ 5 = lists:last(LY),
+ X = list_to_binary(LY),
+ Y = list_to_binary(LY),
+ X = list_to_binary(LY),
+ [5] = lists:nthtail(byte_size(X)-1,LX),
+ [0,5] = lists:nthtail(byte_size(X)-2,LX),
+ [0,5] = lists:nthtail(byte_size(Y)-2,LY),
rand:seed(exsplus, {1271,769940,559934}),
- ?line ok = random_bin_to_list(5000),
+ ok = random_bin_to_list(5000),
ok.
random_bin_to_list(0) ->
@@ -914,10 +877,10 @@ random_bin_to_list(N) ->
Parts1 = Parts0 ++ [ {X+Y,-Y} || {X,Y} <- Parts0 ],
[ begin
try
- true = ?MASK_ERROR(binary:bin_to_list(Str,Z)) =:=
- ?MASK_ERROR(binref:bin_to_list(Str,Z)),
- true = ?MASK_ERROR(binary:bin_to_list(Str,Z)) =:=
- ?MASK_ERROR(binary:bin_to_list(make_unaligned(Str),Z))
+ true = ?MASK_ERROR(binary:bin_to_list(Str,Z)) =:=
+ ?MASK_ERROR(binref:bin_to_list(Str,Z)),
+ true = ?MASK_ERROR(binary:bin_to_list(Str,Z)) =:=
+ ?MASK_ERROR(binary:bin_to_list(make_unaligned(Str),Z))
catch
_:_ ->
io:format("Error, Str = <<\"~s\">>.~nZ = ~p.~n",
@@ -927,10 +890,10 @@ random_bin_to_list(N) ->
end || Z <- Parts1 ],
[ begin
try
- true = ?MASK_ERROR(binary:bin_to_list(Str,A,B)) =:=
- ?MASK_ERROR(binref:bin_to_list(Str,A,B)),
- true = ?MASK_ERROR(binary:bin_to_list(Str,A,B)) =:=
- ?MASK_ERROR(binary:bin_to_list(make_unaligned(Str),A,B))
+ true = ?MASK_ERROR(binary:bin_to_list(Str,A,B)) =:=
+ ?MASK_ERROR(binref:bin_to_list(Str,A,B)),
+ true = ?MASK_ERROR(binary:bin_to_list(Str,A,B)) =:=
+ ?MASK_ERROR(binary:bin_to_list(make_unaligned(Str),A,B))
catch
_:_ ->
io:format("Error, Str = <<\"~s\">>.~nA = ~p.~nB = ~p.~n",
@@ -940,37 +903,36 @@ random_bin_to_list(N) ->
end || {A,B} <- Parts1 ],
random_bin_to_list(N-1).
-parts(doc) ->
- ["Test the part/2,3 bif's"];
+%% Test the part/2,3 BIFs.
parts(Config) when is_list(Config) ->
%% Some simple smoke tests to begin with
- ?line Simple = <<1,2,3,4,5,6,7,8>>,
- ?line <<1,2>> = binary:part(Simple,0,2),
- ?line <<1,2>> = binary:part(Simple,{0,2}),
- ?line Simple = binary:part(Simple,0,8),
- ?line Simple = binary:part(Simple,{0,8}),
- ?line badarg = ?MASK_ERROR(binary:part(Simple,0,9)),
- ?line badarg = ?MASK_ERROR(binary:part(Simple,{0,9})),
- ?line badarg = ?MASK_ERROR(binary:part(Simple,1,8)),
- ?line badarg = ?MASK_ERROR(binary:part(Simple,{1,8})),
- ?line badarg = ?MASK_ERROR(binary:part(Simple,{3,-4})),
- ?line badarg = ?MASK_ERROR(binary:part(Simple,{3.0,1})),
- ?line badarg = ?MASK_ERROR(
- binary:part(Simple,{16#FFFFFFFFFFFFFFFFFFFFFFFFFFFFF
- ,1})),
- ?line <<2,3,4,5,6,7,8>> = binary:part(Simple,{1,7}),
- ?line <<2,3,4,5,6,7,8>> = binary:part(Simple,{8,-7}),
- ?line Simple = binary:part(Simple,{8,-8}),
- ?line badarg = ?MASK_ERROR(binary:part(Simple,{1,-8})),
- ?line badarg = ?MASK_ERROR(binary:part(Simple,{8,-9})),
- ?line badarg = ?MASK_ERROR(binary:part(Simple,{0,-1})),
- ?line <<>> = binary:part(Simple,{8,0}),
- ?line badarg = ?MASK_ERROR(binary:part(Simple,{9,0})),
- ?line badarg = ?MASK_ERROR(binary:part(Simple,{-1,0})),
- ?line badarg = ?MASK_ERROR(binary:part(Simple,{7,2})),
- ?line <<8>> = binary:part(Simple,{7,1}),
+ Simple = <<1,2,3,4,5,6,7,8>>,
+ <<1,2>> = binary:part(Simple,0,2),
+ <<1,2>> = binary:part(Simple,{0,2}),
+ Simple = binary:part(Simple,0,8),
+ Simple = binary:part(Simple,{0,8}),
+ badarg = ?MASK_ERROR(binary:part(Simple,0,9)),
+ badarg = ?MASK_ERROR(binary:part(Simple,{0,9})),
+ badarg = ?MASK_ERROR(binary:part(Simple,1,8)),
+ badarg = ?MASK_ERROR(binary:part(Simple,{1,8})),
+ badarg = ?MASK_ERROR(binary:part(Simple,{3,-4})),
+ badarg = ?MASK_ERROR(binary:part(Simple,{3.0,1})),
+ badarg = ?MASK_ERROR(
+ binary:part(Simple,{16#FFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ ,1})),
+ <<2,3,4,5,6,7,8>> = binary:part(Simple,{1,7}),
+ <<2,3,4,5,6,7,8>> = binary:part(Simple,{8,-7}),
+ Simple = binary:part(Simple,{8,-8}),
+ badarg = ?MASK_ERROR(binary:part(Simple,{1,-8})),
+ badarg = ?MASK_ERROR(binary:part(Simple,{8,-9})),
+ badarg = ?MASK_ERROR(binary:part(Simple,{0,-1})),
+ <<>> = binary:part(Simple,{8,0}),
+ badarg = ?MASK_ERROR(binary:part(Simple,{9,0})),
+ badarg = ?MASK_ERROR(binary:part(Simple,{-1,0})),
+ badarg = ?MASK_ERROR(binary:part(Simple,{7,2})),
+ <<8>> = binary:part(Simple,{7,1}),
rand:seed(exsplus, {1271,769940,559934}),
- ?line random_parts(5000),
+ random_parts(5000),
ok.
@@ -997,8 +959,7 @@ random_parts(X,N) ->
Len = rand:uniform((Pos * 12) div 10),
[{Pos,Len} | random_parts(X-1,N)].
-random_ref_comp(doc) ->
- ["Test pseudorandomly generated cases against reference imlementation"];
+%% Test pseudorandomly generated cases against reference implementation.
random_ref_comp(Config) when is_list(Config) ->
put(success_counter,0),
rand:seed(exsplus, {1271,769940,559934}),
@@ -1027,8 +988,8 @@ random_ref_comp(Config) when is_list(Config) ->
erts_debug:set_internal_state(available_internal_state,false),
ok.
-random_ref_sr_comp(doc) ->
- ["Test pseudorandomly generated cases against reference imlementation of split and replace"];
+%% Test pseudorandomly generated cases against reference implementation
+%% of split and replace.
random_ref_sr_comp(Config) when is_list(Config) ->
put(success_counter,0),
rand:seed(exsplus, {1271,769940,559934}),
@@ -1045,14 +1006,14 @@ random_ref_sr_comp(Config) when is_list(Config) ->
io:format("Number of successes: ~p~n",[get(success_counter)]),
ok.
-random_ref_fla_comp(doc) ->
- ["Test pseudorandomly generated cases against reference imlementation of split and replace"];
+%% Test pseudorandomly generated cases against reference implementation
+%% of split and replace.
random_ref_fla_comp(Config) when is_list(Config) ->
- ?line put(success_counter,0),
+ put(success_counter,0),
rand:seed(exsplus, {1271,769940,559934}),
- ?line do_random_first_comp(5000,{1,1000}),
- ?line do_random_last_comp(5000,{1,1000}),
- ?line do_random_at_comp(5000,{1,1000}),
+ do_random_first_comp(5000,{1,1000}),
+ do_random_last_comp(5000,{1,1000}),
+ do_random_at_comp(5000,{1,1000}),
io:format("Number of successes: ~p~n",[get(success_counter)]),
ok.
@@ -1332,7 +1293,7 @@ do_random_replace_comp(N,NeedleRange,HaystackRange) ->
true = do_replace_comp(Needle,Haystack,Repl,[]),
true = do_replace_comp(Needle,Haystack,Repl,[global]),
true = do_replace_comp(Needle,Haystack,Repl,
- [global,{insert_replaced,Insertat}]),
+ [global,{insert_replaced,Insertat}]),
do_random_replace_comp(N-1,NeedleRange,HaystackRange).
do_random_replace_comp2(0,_,_) ->
ok;
@@ -1346,7 +1307,7 @@ do_random_replace_comp2(N,NeedleRange,HaystackRange) ->
true = do_replace_comp(Needles,Haystack,Repl,[]),
true = do_replace_comp(Needles,Haystack,Repl,[global]),
true = do_replace_comp(Needles,Haystack,Repl,
- [global,{insert_replaced,Insertat}]),
+ [global,{insert_replaced,Insertat}]),
do_random_replace_comp2(N-1,NeedleRange,HaystackRange).
do_replace_comp(N,H,R,Opts) ->
@@ -1382,7 +1343,7 @@ one_random(N) ->
$Ä,$Ö,$0,$1,$2,$3,$4,$5,$6,$7,$8,$9}).
random_number({Min,Max}) -> % Min and Max are *length* of number in
- % decimal positions
+ % decimal positions
X = rand:uniform(Max - Min + 1) + Min - 1,
list_to_integer([one_random_number(rand:uniform(10)) || _ <- lists:seq(1,X)]).
diff --git a/lib/stdlib/test/binref.erl b/lib/stdlib/test/binref.erl
index a52ea98e5a..deb1ede4df 100644
--- a/lib/stdlib/test/binref.erl
+++ b/lib/stdlib/test/binref.erl
@@ -89,7 +89,7 @@ mloop(_Haystack,_Needles,N,M) when N >= M ->
mloop(Haystack,Needles,N,M) ->
case mloop2(Haystack,Needles,N,nomatch) of
nomatch ->
- % Not found
+ %% Not found
<<_:8,NewStack/binary>> = Haystack,
mloop(NewStack,Needles,N+1,M);
{N,Len} ->
@@ -104,7 +104,7 @@ msloop(_Haystack,_Needles,N,M) when N >= M ->
msloop(Haystack,Needles,N,M) ->
case mloop2(Haystack,Needles,N,nomatch) of
nomatch ->
- % Not found
+ %% Not found
<<_:8,NewStack/binary>> = Haystack,
msloop(NewStack,Needles,N+1,M);
{N,Len} ->
@@ -325,7 +325,7 @@ at(Subject,X) ->
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% bin_to_list
+%% bin_to_list
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bin_to_list(Subject) ->
try
@@ -358,7 +358,7 @@ bin_to_list(Subject,A,B) ->
erlang:error(badarg)
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% list_to_bin
+%% list_to_bin
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
list_to_bin(List) ->
try
diff --git a/lib/stdlib/test/c_SUITE.erl b/lib/stdlib/test/c_SUITE.erl
index 47dd95f86b..266918581b 100644
--- a/lib/stdlib/test/c_SUITE.erl
+++ b/lib/stdlib/test/c_SUITE.erl
@@ -50,144 +50,117 @@ end_per_group(_GroupName, Config) ->
%%% Write output to a directory other than current directory:
-c_1(doc) ->
- ["Checks that c:c works also with option 'outdir' [ticket OTP-1209]."];
-c_1(suite) ->
- [];
+%% OTP-1209: Check that c:c/2 works also with option 'outdir'.
c_1(Config) when is_list(Config) ->
- ?line R = filename:join(?config(data_dir, Config), "m.erl"),
- ?line W = ?config(priv_dir, Config),
- ?line Result = c(R,[{outdir,W}]),
- ?line {ok, m} = Result.
-
-c_2(doc) ->
- ["Checks that c:c works also with option 'outdir' [ticket OTP-1209]."];
-c_2(suite) ->
- [];
+ R = filename:join(proplists:get_value(data_dir, Config), "m.erl"),
+ W = proplists:get_value(priv_dir, Config),
+ Result = c(R,[{outdir,W}]),
+ {ok, m} = Result.
+
+%% OTP-1209: Check that c:c/2 works also with option 'outdir'.
c_2(Config) when is_list(Config) ->
- ?line R = filename:join(?config(data_dir, Config), "m"),
- ?line W = ?config(priv_dir, Config),
- ?line Result = c(R,[{outdir,W}]),
- ?line {ok, m} = Result.
+ R = filename:join(proplists:get_value(data_dir, Config), "m"),
+ W = proplists:get_value(priv_dir, Config),
+ Result = c(R,[{outdir,W}]),
+ {ok, m} = Result.
%%% Put results in current directory (or rather, change current dir
%%% to the output dir):
-c_3(doc) ->
- ["Checks that c:c works also with option 'outdir' (same as current"
- "directory). [ticket OTP-1209]."];
-c_3(suite) ->
- [];
+%% OTP-1209: Check that c:c/2 works also with option 'outdir'
+%% (same as current directory).
c_3(Config) when is_list(Config) ->
- ?line R = filename:join(?config(data_dir, Config), "m.erl"),
- ?line W = ?config(priv_dir, Config),
- ?line file:set_cwd(W),
- ?line Result = c(R,[{outdir,W}]),
- ?line {ok, m} = Result.
-
-c_4(doc) ->
- ["Checks that c:c works also with option 'outdir' (same as current"
- "directory). [ticket OTP-1209]."];
-c_4(suite) ->
- [];
+ R = filename:join(proplists:get_value(data_dir, Config), "m.erl"),
+ W = proplists:get_value(priv_dir, Config),
+ file:set_cwd(W),
+ Result = c(R,[{outdir,W}]),
+ {ok, m} = Result.
+
+%% OTP-1209: Check that c:c/2 works also with option 'outdir'
+%% (same as current directory).
c_4(Config) when is_list(Config) ->
- ?line R = filename:join(?config(data_dir, Config), "m"),
- ?line W = ?config(priv_dir, Config),
- ?line file:set_cwd(W),
- ?line Result = c(R,[{outdir,W}]),
- ?line {ok, m} = Result.
+ R = filename:join(proplists:get_value(data_dir, Config), "m"),
+ W = proplists:get_value(priv_dir, Config),
+ file:set_cwd(W),
+ Result = c(R,[{outdir,W}]),
+ {ok, m} = Result.
%%% Write output to a directory other than current directory:
-nc_1(doc) ->
- ["Checks that c:nc works also with option 'outdir'."];
-nc_1(suite) ->
- [];
+%% Check that c:nc/2 works also with option 'outdir'.
nc_1(Config) when is_list(Config) ->
- ?line R = filename:join(?config(data_dir, Config), "m.erl"),
- ?line W = ?config(priv_dir, Config),
- ?line Result = nc(R,[{outdir,W}]),
- ?line {ok, m} = Result.
-
-nc_2(doc) ->
- ["Checks that c:nc works also with option 'outdir'."];
-nc_2(suite) ->
- [];
+ R = filename:join(proplists:get_value(data_dir, Config), "m.erl"),
+ W = proplists:get_value(priv_dir, Config),
+ Result = nc(R,[{outdir,W}]),
+ {ok, m} = Result.
+
+%% Check that c:nc/2 works also with option 'outdir'.
nc_2(Config) when is_list(Config) ->
- ?line R = filename:join(?config(data_dir, Config), "m"),
- ?line W = ?config(priv_dir, Config),
- ?line Result = nc(R,[{outdir,W}]),
- ?line {ok, m} = Result.
+ R = filename:join(proplists:get_value(data_dir, Config), "m"),
+ W = proplists:get_value(priv_dir, Config),
+ Result = nc(R,[{outdir,W}]),
+ {ok, m} = Result.
%%% Put results in current directory (or rather, change current dir
%%% to the output dir):
-nc_3(doc) ->
- ["Checks that c:nc works also with option 'outdir' (same as current"
- "directory)."];
-nc_3(suite) ->
- [];
+%% Check that c:nc/2 works also with option 'outdir'
+%% (same as current directory).
nc_3(Config) when is_list(Config) ->
- ?line R = filename:join(?config(data_dir, Config), "m.erl"),
- ?line W = ?config(priv_dir, Config),
- ?line file:set_cwd(W),
- ?line Result = nc(R,[{outdir,W}]),
- ?line {ok, m} = Result.
-
-nc_4(doc) ->
- ["Checks that c:nc works also with option 'outdir' (same as current"
- "directory)."];
-nc_4(suite) ->
- [];
+ R = filename:join(proplists:get_value(data_dir, Config), "m.erl"),
+ W = proplists:get_value(priv_dir, Config),
+ file:set_cwd(W),
+ Result = nc(R,[{outdir,W}]),
+ {ok, m} = Result.
+
+%% Check that c:nc/2 works also with option 'outdir'
+%% (same as current directory).
nc_4(Config) when is_list(Config) ->
- ?line R = filename:join(?config(data_dir, Config), "m"),
- ?line W = ?config(priv_dir, Config),
- ?line file:set_cwd(W),
- ?line Result = nc(R,[{outdir,W}]),
- ?line {ok, m} = Result.
+ R = filename:join(proplists:get_value(data_dir, Config), "m"),
+ W = proplists:get_value(priv_dir, Config),
+ file:set_cwd(W),
+ Result = nc(R,[{outdir,W}]),
+ {ok, m} = Result.
ls(Config) when is_list(Config) ->
- Directory = ?config(data_dir, Config),
+ Directory = proplists:get_value(data_dir, Config),
ok = c:ls(Directory),
File = filename:join(Directory, "m.erl"),
ok = c:ls(File),
ok = c:ls("no_such_file").
-memory(doc) ->
- ["Checks that c:memory/[0,1] returns consistent results."];
-memory(suite) ->
- [];
+%% Check that c:memory/[0,1] returns consistent results.
memory(Config) when is_list(Config) ->
try
- ?line ML = c:memory(),
- ?line T = mget(total, ML),
- ?line P = mget(processes, ML),
- ?line S = mget(system, ML),
- ?line A = mget(atom, ML),
- ?line AU = mget(atom_used, ML),
- ?line B = mget(binary, ML),
- ?line C = mget(code, ML),
- ?line E = mget(ets, ML),
- ?line T = P + S,
- ?line if S >= A + B + C + E -> ok end,
- ?line if A >= AU -> ok end,
- ?line ok
+ ML = c:memory(),
+ T = mget(total, ML),
+ P = mget(processes, ML),
+ S = mget(system, ML),
+ A = mget(atom, ML),
+ AU = mget(atom_used, ML),
+ B = mget(binary, ML),
+ C = mget(code, ML),
+ E = mget(ets, ML),
+ T = P + S,
+ if S >= A + B + C + E -> ok end,
+ if A >= AU -> ok end,
+ ok
catch
error:notsup ->
- ?line {skipped,
- "erlang:memory/[0,1] and c:memory/[0,1] not supported"}
+ {skipped,
+ "erlang:memory/[0,1] and c:memory/[0,1] not supported"}
end.
-% Help function for c_SUITE:memory/1
+%% Help function for c_SUITE:memory/1
mget(K, L) ->
- ?line {value,{K,V}} = lists:keysearch(K, 1, L),
- ?line test_v(c:memory(K)), % Check that c:memory/1 also accept this
- % argument and returns an integer (usally
- % *not* the same as V).
- ?line test_v(V).
+ {value,{K,V}} = lists:keysearch(K, 1, L),
+ test_v(c:memory(K)), % Check that c:memory/1 also accept this
+ % argument and returns an integer (usally
+ % *not* the same as V).
+ test_v(V).
-% Help function for c_SUITE:memory/1
+%% Help function for c_SUITE:memory/1
test_v(V) when is_integer(V) ->
- ?line V.
+ V.
diff --git a/lib/stdlib/test/calendar_SUITE.erl b/lib/stdlib/test/calendar_SUITE.erl
index bddc3a4821..7372288492 100644
--- a/lib/stdlib/test/calendar_SUITE.erl
+++ b/lib/stdlib/test/calendar_SUITE.erl
@@ -57,69 +57,48 @@ init_per_group(_GroupName, Config) ->
end_per_group(_GroupName, Config) ->
Config.
-gregorian_days(doc) ->
- "Tests that date_to_gregorian_days and gregorian_days_to_date "
- "are each others inverses from ?START_YEAR-01-01 up to ?END_YEAR-01-01. "
- "At the same time valid_date is tested.";
-gregorian_days(suite) ->
- [];
+%% Tests that date_to_gregorian_days and gregorian_days_to_date
+%% are each others inverses from ?START_YEAR-01-01 up to ?END_YEAR-01-01.
+%% At the same time valid_date is tested.
gregorian_days(Config) when is_list(Config) ->
- ?line Days = calendar:date_to_gregorian_days({?START_YEAR, 1, 1}),
- ?line MaxDays = calendar:date_to_gregorian_days({?END_YEAR, 1, 1}),
- ?line check_gregorian_days(Days, MaxDays).
-
-gregorian_seconds(doc) ->
- "Tests that datetime_to_gregorian_seconds and "
- "gregorian_seconds_to_date are each others inverses for a sampled "
- "number of seconds from ?START_YEAR-01-01 up to ?END_YEAR-01-01: We check "
- "every 2 days + 1 second.";
-gregorian_seconds(suite) ->
- [];
+ Days = calendar:date_to_gregorian_days({?START_YEAR, 1, 1}),
+ MaxDays = calendar:date_to_gregorian_days({?END_YEAR, 1, 1}),
+ check_gregorian_days(Days, MaxDays).
+
+%% Tests that datetime_to_gregorian_seconds and
+%% gregorian_seconds_to_date are each others inverses for a sampled
+%% number of seconds from ?START_YEAR-01-01 up to ?END_YEAR-01-01: We check
+%% every 2 days + 1 second.
gregorian_seconds(Config) when is_list(Config) ->
- ?line Secs = calendar:datetime_to_gregorian_seconds({{?START_YEAR, 1, 1},
- {0, 0, 0}}),
- ?line MaxSecs = calendar:datetime_to_gregorian_seconds({{?END_YEAR, 1, 1},
- {0, 0, 0}}),
- ?line check_gregorian_seconds(Secs, MaxSecs).
-
-day_of_the_week(doc) ->
- "Tests that day_of_the_week reports correctly the day of the week from "
- "year ?START_YEAR up to ?END_YEAR.";
-day_of_the_week(suite) ->
- [];
+ Secs = calendar:datetime_to_gregorian_seconds({{?START_YEAR, 1, 1},
+ {0, 0, 0}}),
+ MaxSecs = calendar:datetime_to_gregorian_seconds({{?END_YEAR, 1, 1},
+ {0, 0, 0}}),
+ check_gregorian_seconds(Secs, MaxSecs).
+
+%% Tests that day_of_the_week reports correctly the day of the week from
+%% year ?START_YEAR up to ?END_YEAR.
day_of_the_week(Config) when is_list(Config) ->
- ?line Days = calendar:date_to_gregorian_days({?START_YEAR, 1, 1}),
- ?line MaxDays = calendar:date_to_gregorian_days({?END_YEAR, 1, 1}),
- ?line DayNumber = calendar:day_of_the_week({?START_YEAR, 1, 1}),
- ?line check_day_of_the_week(Days, MaxDays, DayNumber).
+ Days = calendar:date_to_gregorian_days({?START_YEAR, 1, 1}),
+ MaxDays = calendar:date_to_gregorian_days({?END_YEAR, 1, 1}),
+ DayNumber = calendar:day_of_the_week({?START_YEAR, 1, 1}),
+ check_day_of_the_week(Days, MaxDays, DayNumber).
-day_of_the_week_calibrate(doc) ->
- "Tests that day_of_the_week for 1997-11-11 is Tuesday (2)";
-day_of_the_week_calibrate(suite) ->
- [];
+%% Tests that day_of_the_week for 1997-11-11 is Tuesday (2).
day_of_the_week_calibrate(Config) when is_list(Config) ->
- ?line 2 = calendar:day_of_the_week({1997, 11, 11}).
+ 2 = calendar:day_of_the_week({1997, 11, 11}).
-leap_years(doc) ->
- "Tests that is_leap_year reports correctly the leap years from "
- "year ?START_YEAR up to ?END_YEAR.";
-leap_years(suite) ->
- [];
+%% Tests that is_leap_year reports correctly the leap years from
+%% year ?START_YEAR up to ?END_YEAR.
leap_years(Config) when is_list(Config) ->
- ?line check_leap_years(?START_YEAR, ?END_YEAR).
+ check_leap_years(?START_YEAR, ?END_YEAR).
-last_day_of_the_month(doc) ->
- "Tests that last_day_of_the_month reports correctly from "
- "year ?START_YEAR up to ?END_YEAR.";
-last_day_of_the_month(suite) ->
- [];
+%% Tests that last_day_of_the_month reports correctly from
+%% year ?START_YEAR up to ?END_YEAR.
last_day_of_the_month(Config) when is_list(Config) ->
- ?line check_last_day_of_the_month({?START_YEAR, 1}, {?END_YEAR, 1}).
+ check_last_day_of_the_month({?START_YEAR, 1}, {?END_YEAR, 1}).
-local_time_to_universal_time_dst(doc) ->
- "Tests local_time_to_universal_time_dst for MET";
-local_time_to_universal_time_dst(suite) ->
- [];
+%% Tests local_time_to_universal_time_dst for MET.
local_time_to_universal_time_dst(Config) when is_list(Config) ->
case os:type() of
{unix,_} ->
@@ -134,35 +113,35 @@ local_time_to_universal_time_dst(Config) when is_list(Config) ->
end.
local_time_to_universal_time_dst_x(Config) when is_list(Config) ->
%% Assumes MET (UTC+1 / UTC+2(dst)
- ?line LtW = {{2003,01,15},{14,00,00}}, % Winter
- ?line UtW = {{2003,01,15},{13,00,00}}, %
- ?line UtWd = {{2003,01,15},{12,00,00}}, % dst
- ?line LtS = {{2003,07,15},{14,00,00}}, % Summer
- ?line UtS = {{2003,07,15},{13,00,00}}, %
- ?line UtSd = {{2003,07,15},{12,00,00}}, % dst
- ?line LtWS = {{2003,03,30},{02,30,00}}, % Winter->Summer
- ?line UtWS = {{2003,03,30},{01,30,00}}, %
- ?line UtWSd = {{2003,03,30},{00,30,00}}, % dst
- ?line LtSW = {{2003,10,26},{02,30,00}}, % Summer->Winter
- ?line UtSW = {{2003,10,26},{01,30,00}}, %
- ?line UtSWd = {{2003,10,26},{00,30,00}}, % dst
+ LtW = {{2003,01,15},{14,00,00}}, % Winter
+ UtW = {{2003,01,15},{13,00,00}}, %
+ UtWd = {{2003,01,15},{12,00,00}}, % dst
+ LtS = {{2003,07,15},{14,00,00}}, % Summer
+ UtS = {{2003,07,15},{13,00,00}}, %
+ UtSd = {{2003,07,15},{12,00,00}}, % dst
+ LtWS = {{2003,03,30},{02,30,00}}, % Winter->Summer
+ UtWS = {{2003,03,30},{01,30,00}}, %
+ UtWSd = {{2003,03,30},{00,30,00}}, % dst
+ LtSW = {{2003,10,26},{02,30,00}}, % Summer->Winter
+ UtSW = {{2003,10,26},{01,30,00}}, %
+ UtSWd = {{2003,10,26},{00,30,00}}, % dst
%%
- ?line UtW = calendar:local_time_to_universal_time(LtW, false),
- ?line UtWd = calendar:local_time_to_universal_time(LtW, true),
- ?line UtW = calendar:local_time_to_universal_time(LtW, undefined),
+ UtW = calendar:local_time_to_universal_time(LtW, false),
+ UtWd = calendar:local_time_to_universal_time(LtW, true),
+ UtW = calendar:local_time_to_universal_time(LtW, undefined),
%%
- ?line UtS = calendar:local_time_to_universal_time(LtS, false),
- ?line UtSd = calendar:local_time_to_universal_time(LtS, true),
- ?line UtSd = calendar:local_time_to_universal_time(LtS, undefined),
+ UtS = calendar:local_time_to_universal_time(LtS, false),
+ UtSd = calendar:local_time_to_universal_time(LtS, true),
+ UtSd = calendar:local_time_to_universal_time(LtS, undefined),
%%
case calendar:local_time_to_universal_time(LtWS, false) of
UtWS ->
- ?line UtWSd = calendar:local_time_to_universal_time(LtWS, true),
- ?line [] = calendar:local_time_to_universal_time_dst(LtWS),
+ UtWSd = calendar:local_time_to_universal_time(LtWS, true),
+ [] = calendar:local_time_to_universal_time_dst(LtWS),
%%
- ?line UtSW = calendar:local_time_to_universal_time(LtSW, false),
- ?line UtSWd = calendar:local_time_to_universal_time(LtSW, true),
- ?line [UtSWd, UtSW] = calendar:local_time_to_universal_time_dst(LtSW),
+ UtSW = calendar:local_time_to_universal_time(LtSW, false),
+ UtSWd = calendar:local_time_to_universal_time(LtSW, true),
+ [UtSWd, UtSW] = calendar:local_time_to_universal_time_dst(LtSW),
ok;
{{1969,12,31},{23,59,59}} ->
%% It seems that Apple has no intention of fixing this bug in
@@ -171,15 +150,12 @@ local_time_to_universal_time_dst_x(Config) when is_list(Config) ->
{comment,"Bug in mktime() in this OS"}
end.
-iso_week_number(doc) ->
- "Test the iso week number calculation for all three possibilities."
- " When the date falls on the last week of the previous year,"
- " when the date falls on a week within the given year and finally,"
- " when the date falls on the first week of the next year.";
-iso_week_number(suite) ->
- [];
+%% Test the iso week number calculation for all three possibilities:
+%% When the date falls on the last week of the previous year,
+%% when the date falls on a week within the given year and finally,
+%% when the date falls on the first week of the next year.
iso_week_number(Config) when is_list(Config) ->
- ?line check_iso_week_number().
+ check_iso_week_number().
%%
%% LOCAL FUNCTIONS
@@ -188,10 +164,10 @@ iso_week_number(Config) when is_list(Config) ->
%% check_gregorian_days
%%
check_gregorian_days(Days, MaxDays) when Days < MaxDays ->
- ?line Date = calendar:gregorian_days_to_date(Days),
- ?line true = calendar:valid_date(Date),
- ?line Days = calendar:date_to_gregorian_days(Date),
- ?line check_gregorian_days(Days + 1, MaxDays);
+ Date = calendar:gregorian_days_to_date(Days),
+ true = calendar:valid_date(Date),
+ Days = calendar:date_to_gregorian_days(Date),
+ check_gregorian_days(Days + 1, MaxDays);
check_gregorian_days(_Days, _MaxDays) ->
ok.
@@ -200,9 +176,9 @@ check_gregorian_days(_Days, _MaxDays) ->
%% We increment with something prime (172801 = 2 days + 1 second).
%%
check_gregorian_seconds(Secs, MaxSecs) when Secs < MaxSecs ->
- ?line DateTime = calendar:gregorian_seconds_to_datetime(Secs),
- ?line Secs = calendar:datetime_to_gregorian_seconds(DateTime),
- ?line check_gregorian_seconds(Secs + 172801, MaxSecs);
+ DateTime = calendar:gregorian_seconds_to_datetime(Secs),
+ Secs = calendar:datetime_to_gregorian_seconds(DateTime),
+ check_gregorian_seconds(Secs + 172801, MaxSecs);
check_gregorian_seconds(_Secs, _MaxSecs) ->
ok.
@@ -210,10 +186,10 @@ check_gregorian_seconds(_Secs, _MaxSecs) ->
%% check_day_of_the_week
%%
check_day_of_the_week(Days, MaxDays, DayNumber) when Days < MaxDays ->
- ?line Date = calendar:gregorian_days_to_date(Days),
- ?line DayNumber = calendar:day_of_the_week(Date),
- ?line check_day_of_the_week(Days + 1, MaxDays,
- ((DayNumber rem 7) + 1));
+ Date = calendar:gregorian_days_to_date(Days),
+ DayNumber = calendar:day_of_the_week(Date),
+ check_day_of_the_week(Days + 1, MaxDays,
+ ((DayNumber rem 7) + 1));
check_day_of_the_week(_Days, _MaxDays, _DayNumber) ->
ok.
@@ -222,59 +198,56 @@ check_day_of_the_week(_Days, _MaxDays, _DayNumber) ->
%% SYr must be larger than 1800, and EYr must be less than ?END_YEAR.
%%
check_leap_years(SYr, EYr) when SYr < EYr ->
- ?line Rem = SYr rem 4,
+ Rem = SYr rem 4,
case Rem of
0 ->
case SYr of
1900 ->
- ?line false = calendar:is_leap_year(SYr);
+ false = calendar:is_leap_year(SYr);
2000 ->
- ?line true = calendar:is_leap_year(SYr);
+ true = calendar:is_leap_year(SYr);
_ ->
- ?line true = calendar:is_leap_year(SYr)
+ true = calendar:is_leap_year(SYr)
end;
_ ->
- ?line false = calendar:is_leap_year(SYr)
+ false = calendar:is_leap_year(SYr)
end,
check_leap_years(SYr + 1, EYr);
check_leap_years(_SYr, _EYr) ->
ok.
check_last_day_of_the_month({SYr, SMon}, {EYr, EMon}) when SYr < EYr ->
- ?line LastDay = calendar:last_day_of_the_month(SYr, SMon),
- ?line LastDay = case SMon of
- 1 -> 31;
- 2 ->
- case calendar:is_leap_year(SYr) of
- true -> 29;
- false -> 28
- end;
- 3 -> 31;
- 4 -> 30;
- 5 -> 31;
- 6 -> 30;
- 7 -> 31;
- 8 -> 31;
- 9 -> 30;
- 10 -> 31;
- 11 -> 30;
- 12 -> 31
- end,
- ?line NYr = case SMon of
- 12 -> SYr + 1;
- _ -> SYr
- end,
- ?line check_last_day_of_the_month({NYr, (SMon rem 12) + 1},
- {EYr, EMon});
+ LastDay = calendar:last_day_of_the_month(SYr, SMon),
+ LastDay = case SMon of
+ 1 -> 31;
+ 2 ->
+ case calendar:is_leap_year(SYr) of
+ true -> 29;
+ false -> 28
+ end;
+ 3 -> 31;
+ 4 -> 30;
+ 5 -> 31;
+ 6 -> 30;
+ 7 -> 31;
+ 8 -> 31;
+ 9 -> 30;
+ 10 -> 31;
+ 11 -> 30;
+ 12 -> 31
+ end,
+ NYr = case SMon of
+ 12 -> SYr + 1;
+ _ -> SYr
+ end,
+ check_last_day_of_the_month({NYr, (SMon rem 12) + 1},
+ {EYr, EMon});
check_last_day_of_the_month(_, _) ->
ok.
%% check_iso_week_number
%%
check_iso_week_number() ->
- ?line {2004, 53} = calendar:iso_week_number({2005, 1, 1}),
- ?line {2007, 1} = calendar:iso_week_number({2007, 1, 1}),
- ?line {2009, 1} = calendar:iso_week_number({2008, 12, 29}).
-
-
-
+ {2004, 53} = calendar:iso_week_number({2005, 1, 1}),
+ {2007, 1} = calendar:iso_week_number({2007, 1, 1}),
+ {2009, 1} = calendar:iso_week_number({2008, 12, 29}).
diff --git a/lib/stdlib/test/dets_SUITE.erl b/lib/stdlib/test/dets_SUITE.erl
index ee3a812e24..8948f496c4 100644
--- a/lib/stdlib/test/dets_SUITE.erl
+++ b/lib/stdlib/test/dets_SUITE.erl
@@ -19,7 +19,7 @@
%%
-module(dets_SUITE).
-%-define(debug, true).
+%%-define(debug, true).
-ifdef(debug).
-define(format(S, A), io:format(S, A)).
@@ -30,8 +30,8 @@
-else.
-include_lib("common_test/include/ct.hrl").
-define(format(S, A), ok).
--define(privdir(Conf), ?config(priv_dir, Conf)).
--define(datadir(Conf), ?config(data_dir, Conf)).
+-define(privdir(Conf), proplists:get_value(priv_dir, Conf)).
+-define(datadir(Conf), proplists:get_value(data_dir, Conf)).
-endif.
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
@@ -83,15 +83,14 @@
-define(CLOSED_PROPERLY,1).
init_per_testcase(_Case, Config) ->
- Dog=?t:timetrap(?t:minutes(15)),
- [{watchdog, Dog}|Config].
+ Config.
end_per_testcase(_Case, _Config) ->
- Dog=?config(watchdog, _Config),
- test_server:timetrap_cancel(Dog),
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,15}}].
all() ->
[
@@ -130,10 +129,7 @@ init_per_group(_GroupName, Config) ->
end_per_group(_GroupName, Config) ->
Config.
-newly_started(doc) ->
- ["OTP-3621"];
-newly_started(suite) ->
- [];
+%% OTP-3621
newly_started(Config) when is_list(Config) ->
true = is_alive(),
{ok, Node} = test_server:start_node(slave1, slave, []),
@@ -141,17 +137,11 @@ newly_started(Config) when is_list(Config) ->
test_server:stop_node(Node),
ok.
-basic_v8(doc) ->
- ["Basic test case."];
-basic_v8(suite) ->
- [];
+%% Basic test case.
basic_v8(Config) when is_list(Config) ->
basic(Config, 8).
-basic_v9(doc) ->
- ["Basic test case."];
-basic_v9(suite) ->
- [];
+%% Basic test case.
basic_v9(Config) when is_list(Config) ->
basic(Config, 9).
@@ -184,17 +174,9 @@ basic(Config, Version) ->
ok.
-open_v8(doc) ->
- [];
-open_v8(suite) ->
- [];
open_v8(Config) when is_list(Config) ->
open(Config, 8).
-open_v9(doc) ->
- [];
-open_v9(suite) ->
- [];
open_v9(Config) when is_list(Config) ->
open(Config, 9).
@@ -283,17 +265,11 @@ bad(_Tab, _Item) ->
?format("Can't find item ~p in ~p ~n", [_Item, _Tab]),
exit(badtab).
-sets_v8(doc) ->
- ["Performs traversal and match testing on set type dets tables."];
-sets_v8(suite) ->
- [];
+%% Perform traversal and match testing on set type dets tables.
sets_v8(Config) when is_list(Config) ->
sets(Config, 8).
-sets_v9(doc) ->
- ["Performs traversal and match testing on set type dets tables."];
-sets_v9(suite) ->
- [];
+%% Perform traversal and match testing on set type dets tables.
sets_v9(Config) when is_list(Config) ->
sets(Config, 9).
@@ -325,17 +301,11 @@ sets(Config, Version) ->
check_pps(P0),
ok.
-bags_v8(doc) ->
- ["Performs traversal and match testing on bag type dets tables."];
-bags_v8(suite) ->
- [];
+%% Perform traversal and match testing on bag type dets tables.
bags_v8(Config) when is_list(Config) ->
bags(Config, 8).
-bags_v9(doc) ->
- ["Performs traversal and match testing on bag type dets tables."];
-bags_v9(suite) ->
- [];
+%% Perform traversal and match testing on bag type dets tables.
bags_v9(Config) when is_list(Config) ->
bags(Config, 9).
@@ -365,17 +335,11 @@ bags(Config, Version) ->
ok.
-duplicate_bags_v8(doc) ->
- ["Performs traversal and match testing on duplicate_bag type dets tables."];
-duplicate_bags_v8(suite) ->
- [];
+%% Perform traversal and match testing on duplicate_bag type dets tables.
duplicate_bags_v8(Config) when is_list(Config) ->
duplicate_bags(Config, 8).
-duplicate_bags_v9(doc) ->
- ["Performs traversal and match testing on duplicate_bag type dets tables."];
-duplicate_bags_v9(suite) ->
- [];
+%% Perform traversal and match testing on duplicate_bag type dets tables.
duplicate_bags_v9(Config) when is_list(Config) ->
duplicate_bags(Config, 9).
@@ -405,17 +369,9 @@ duplicate_bags(Config, Version) when is_list(Config) ->
ok.
-access_v8(doc) ->
- [];
-access_v8(suite) ->
- [];
access_v8(Config) when is_list(Config) ->
access(Config, 8).
-access_v9(doc) ->
- [];
-access_v9(suite) ->
- [];
access_v9(Config) when is_list(Config) ->
access(Config, 9).
@@ -448,10 +404,7 @@ access(Config, Version) ->
ok.
-dirty_mark(doc) ->
- ["Test that the table is not marked dirty if not written"];
-dirty_mark(suite) ->
- [];
+%% Test that the table is not marked dirty if not written.
dirty_mark(Config) when is_list(Config) ->
true = is_alive(),
Tab = dets_dirty_mark_test,
@@ -500,10 +453,7 @@ dirty_mark(Config) when is_list(Config) ->
check_pps(P0),
ok.
-dirty_mark2(doc) ->
- ["Test that the table is flushed when auto_save is in effect"];
-dirty_mark2(suite) ->
- [];
+%% Test that the table is flushed when auto_save is in effect.
dirty_mark2(Config) when is_list(Config) ->
true = is_alive(),
Tab = dets_dirty_mark2_test,
@@ -571,17 +521,11 @@ dets_dirty_loop() ->
end.
-bag_next_v8(suite) ->
- [];
-bag_next_v8(doc) ->
- ["Check that bags and next work as expected."];
+%% Check that bags and next work as expected.
bag_next_v8(Config) when is_list(Config) ->
bag_next(Config, 8).
-bag_next_v9(suite) ->
- [];
-bag_next_v9(doc) ->
- ["Check that bags and next work as expected."];
+%% Check that bags and next work as expected.
bag_next_v9(Config) when is_list(Config) ->
Tab = dets_bag_next_test,
FName = filename(Tab, Config),
@@ -634,17 +578,9 @@ bag_next(Config, Version) ->
check_pps(P0),
ok.
-oldbugs_v8(doc) ->
- [];
-oldbugs_v8(suite) ->
- [];
oldbugs_v8(Config) when is_list(Config) ->
oldbugs(Config, 8).
-oldbugs_v9(doc) ->
- [];
-oldbugs_v9(suite) ->
- [];
oldbugs_v9(Config) when is_list(Config) ->
oldbugs(Config, 9).
@@ -662,9 +598,7 @@ oldbugs(Config, Version) ->
check_pps(P0),
ok.
-unsafe_assumptions(suite) -> [];
-unsafe_assumptions(doc) ->
- "Tests that shrinking an object and then expanding it works.";
+%% Test that shrinking an object and then expanding it works.
unsafe_assumptions(Config) when is_list(Config) ->
FName = filename(dets_suite_unsafe_assumptions_test, Config),
file:delete(FName),
@@ -693,17 +627,13 @@ unsafe_assumptions(Config) when is_list(Config) ->
check_pps(P0),
ok.
-truncated_segment_array_v8(suite) -> [];
-truncated_segment_array_v8(doc) ->
- "Tests that a file where the segment array has been truncated "
- "is possible to repair.";
+%% Test that a file where the segment array has been truncated
+%% is possible to repair.
truncated_segment_array_v8(Config) when is_list(Config) ->
trunc_seg_array(Config, 8).
-truncated_segment_array_v9(suite) -> [];
-truncated_segment_array_v9(doc) ->
- "Tests that a file where the segment array has been truncated "
- "is possible to repair.";
+%% Test that a file where the segment array has been truncated
+%% is possible to repair.
truncated_segment_array_v9(Config) when is_list(Config) ->
trunc_seg_array(Config, 9).
@@ -729,17 +659,11 @@ trunc_seg_array(Config, V) ->
check_pps(P0),
ok.
-open_file_v8(doc) ->
- ["open_file/1 test case."];
-open_file_v8(suite) ->
- [];
+%% Test open_file/1.
open_file_v8(Config) when is_list(Config) ->
open_1(Config, 8).
-open_file_v9(doc) ->
- ["open_file/1 test case."];
-open_file_v9(suite) ->
- [];
+%% Test open_file/1.
open_file_v9(Config) when is_list(Config) ->
T = open_v9,
Fname = filename(T, Config),
@@ -797,17 +721,11 @@ open_1(Config, V) ->
check_pps(P0),
ok.
-init_table_v8(doc) ->
- ["initialize_table/2 and from_ets/2 test case."];
-init_table_v8(suite) ->
- [];
+%% Test initialize_table/2 and from_ets/2.
init_table_v8(Config) when is_list(Config) ->
init_table(Config, 8).
-init_table_v9(doc) ->
- ["initialize_table/2 and from_ets/2 test case."];
-init_table_v9(suite) ->
- [];
+%% Test initialize_table/2 and from_ets/2.
init_table_v9(Config) when is_list(Config) ->
%% Objects are returned in "time order".
T = init_table_v9,
@@ -1270,17 +1188,11 @@ items(I, N, C, L) when I =:= N; C =:= 0 ->
items(I, N, C, L) ->
items(I+1, N, C-1, [{I, item(I)} | L]).
-repair_v8(doc) ->
- ["open_file and repair."];
-repair_v8(suite) ->
- [];
+%% Test open_file and repair.
repair_v8(Config) when is_list(Config) ->
repair(Config, 8).
-repair_v9(doc) ->
- ["open_file and repair."];
-repair_v9(suite) ->
- [];
+%% Test open_file and repair.
repair_v9(Config) when is_list(Config) ->
%% Convert from format 9 to format 8.
T = convert_98,
@@ -1617,11 +1529,9 @@ repair(Config, V) ->
check_pps(P0),
ok.
-hash_v8b_v8c(doc) ->
- ["Test the use of different hashing algorithms in v8b and v8c of the "
- "Dets file format."];
-hash_v8b_v8c(suite) ->
- [];
+
+%% Test the use of different hashing algorithms in v8b and v8c of the
+%% Dets file format.
hash_v8b_v8c(Config) when is_list(Config) ->
Source =
filename:join(?datadir(Config), "dets_test_v8b.dets"),
@@ -1696,10 +1606,7 @@ hash_v8b_v8c(Config) when is_list(Config) ->
check_pps(P0),
{comment, Mess}.
-phash(doc) ->
- ["Test version 9(b) with erlang:phash/2 as hash function."];
-phash(suite) ->
- [];
+%% Test version 9(b) with erlang:phash/2 as hash function.
phash(Config) when is_list(Config) ->
T = phash,
Phash_v9bS = filename:join(?datadir(Config), "version_9b_phash.dat"),
@@ -1757,17 +1664,11 @@ phash(Config) when is_list(Config) ->
file:delete(Fname),
ok.
-fold_v8(doc) ->
- ["foldl, foldr, to_ets"];
-fold_v8(suite) ->
- [];
+%% Test foldl, foldr, to_ets.
fold_v8(Config) when is_list(Config) ->
fold(Config, 8).
-fold_v9(doc) ->
- ["foldl, foldr, to_ets"];
-fold_v9(suite) ->
- [];
+%% Test foldl, foldr, to_ets.
fold_v9(Config) when is_list(Config) ->
fold(Config, 9).
@@ -1836,17 +1737,11 @@ fold(Config, Version) ->
check_pps(P0),
ok.
-fixtable_v8(doc) ->
- ["Add objects to a fixed table."];
-fixtable_v8(suite) ->
- [];
+%% Add objects to a fixed table.
fixtable_v8(Config) when is_list(Config) ->
fixtable(Config, 8).
-fixtable_v9(doc) ->
- ["Add objects to a fixed table."];
-fixtable_v9(suite) ->
- [];
+%% Add objects to a fixed table.
fixtable_v9(Config) when is_list(Config) ->
fixtable(Config, 9).
@@ -1936,17 +1831,11 @@ fixtable(Config, Version) when is_list(Config) ->
check_pps(P0),
ok.
-match_v8(doc) ->
- ["Matching objects of a fixed table."];
-match_v8(suite) ->
- [];
+%% Matching objects of a fixed table.
match_v8(Config) when is_list(Config) ->
match(Config, 8).
-match_v9(doc) ->
- ["Matching objects of a fixed table."];
-match_v9(suite) ->
- [];
+%% Matching objects of a fixed table.
match_v9(Config) when is_list(Config) ->
match(Config, 9).
@@ -2118,17 +2007,11 @@ match(Config, Version) ->
check_pps(P0),
ok.
-select_v8(doc) ->
- ["Selecting objects of a fixed table."];
-select_v8(suite) ->
- [];
+%% Selecting objects of a fixed table.
select_v8(Config) when is_list(Config) ->
select(Config, 8).
-select_v9(doc) ->
- ["Selecting objects of a fixed table."];
-select_v9(suite) ->
- [];
+%% Selecting objects of a fixed table.
select_v9(Config) when is_list(Config) ->
select(Config, 9).
@@ -2232,10 +2115,7 @@ select(Config, Version) ->
check_pps(P0),
ok.
-update_counter(doc) ->
- ["Test update_counter/1."];
-update_counter(suite) ->
- [];
+%% Test update_counter/1.
update_counter(Config) when is_list(Config) ->
T = update_counter,
Fname = filename(select, Config),
@@ -2269,10 +2149,7 @@ update_counter(Config) when is_list(Config) ->
ok.
-badarg(doc) ->
- ["Call some functions with bad arguments."];
-badarg(suite) ->
- [];
+%% Call some functions with bad arguments.
badarg(Config) when is_list(Config) ->
T = badarg,
Fname = filename(select, Config),
@@ -2281,7 +2158,6 @@ badarg(Config) when is_list(Config) ->
Args = [{file,Fname},{keypos,3}],
{ok, _} = dets:open_file(T, [{type,set} | Args]),
- % dets:verbose(),
%% badargs are tested in match, select and fixtable too.
@@ -2404,17 +2280,11 @@ badarg(Config) when is_list(Config) ->
check_pps(P0),
ok.
-cache_sets_v8(doc) ->
- ["Test the write cache for sets."];
-cache_sets_v8(suite) ->
- [];
+%% Test the write cache for sets.
cache_sets_v8(Config) when is_list(Config) ->
cache_sets(Config, 8).
-cache_sets_v9(doc) ->
- ["Test the write cache for sets."];
-cache_sets_v9(suite) ->
- [];
+%% Test the write cache for sets.
cache_sets_v9(Config) when is_list(Config) ->
cache_sets(Config, 9).
@@ -2548,7 +2418,7 @@ cache_sets(Config, DelayedWrite, Extra, Sz, Version) ->
{[],[]} -> ok;
{X,Y} ->
NoBad = length(X) + length(Y),
- test_server:fail({sets,DelayedWrite,Extra,Sz,NoBad})
+ ct:fail({sets,DelayedWrite,Extra,Sz,NoBad})
end;
true ->
ok
@@ -2559,17 +2429,11 @@ cache_sets(Config, DelayedWrite, Extra, Sz, Version) ->
check_pps(P0),
ok.
-cache_bags_v8(doc) ->
- ["Test the write cache for bags."];
-cache_bags_v8(suite) ->
- [];
+%% Test the write cache for bags.
cache_bags_v8(Config) when is_list(Config) ->
cache_bags(Config, 8).
-cache_bags_v9(doc) ->
- ["Test the write cache for bags."];
-cache_bags_v9(suite) ->
- [];
+%% Test the write cache for bags.
cache_bags_v9(Config) when is_list(Config) ->
cache_bags(Config, 9).
@@ -2712,7 +2576,7 @@ cache_bags(Config, DelayedWrite, Extra, Sz, Version) ->
{[],[]} -> ok;
{X,Y} ->
NoBad = length(X) + length(Y),
- test_server:fail({bags,DelayedWrite,Extra,Sz,NoBad})
+ ct:fail({bags,DelayedWrite,Extra,Sz,NoBad})
end;
true ->
ok
@@ -2741,17 +2605,11 @@ cache_bags(Config, DelayedWrite, Extra, Sz, Version) ->
check_pps(P0),
ok.
-cache_duplicate_bags_v8(doc) ->
- ["Test the write cache for duplicate bags."];
-cache_duplicate_bags_v8(suite) ->
- [];
+%% Test the write cache for duplicate bags.
cache_duplicate_bags_v8(Config) when is_list(Config) ->
cache_duplicate_bags(Config, 8).
-cache_duplicate_bags_v9(doc) ->
- ["Test the write cache for duplicate bags."];
-cache_duplicate_bags_v9(suite) ->
- [];
+%% Test the write cache for duplicate bags.
cache_duplicate_bags_v9(Config) when is_list(Config) ->
cache_duplicate_bags(Config, 9).
@@ -2870,7 +2728,7 @@ cache_dup_bags(Config, DelayedWrite, Extra, Sz, Version) ->
{[],[]} -> ok;
{X,Y} ->
NoBad = length(X) + length(Y),
- test_server:fail({dup_bags,DelayedWrite,Extra,Sz,NoBad})
+ ct:fail({dup_bags,DelayedWrite,Extra,Sz,NoBad})
end;
true ->
ok
@@ -2936,10 +2794,7 @@ symdiff(L1, L2) ->
sofs:symmetric_partition(sofs:set(L1), sofs:set(L2)),
{sofs:to_external(X), sofs:to_external(Y)}.
-otp_4208(doc) ->
- ["Read only table and traversal caused crash."];
-otp_4208(suite) ->
- [];
+%% Test read-only tables and traversal caused crashes.
otp_4208(Config) when is_list(Config) ->
Tab = otp_4208,
FName = filename(Tab, Config),
@@ -2958,10 +2813,7 @@ otp_4208(Config) when is_list(Config) ->
ok.
-otp_4989(doc) ->
- ["Read only table and growth."];
-otp_4989(suite) ->
- [];
+%% Test read-only tables and growth.
otp_4989(Config) when is_list(Config) ->
Tab = otp_4989,
FName = filename(Tab, Config),
@@ -2989,10 +2841,7 @@ ets_init(Tab, N) ->
ets:insert(Tab, {N,N}),
ets_init(Tab, N - 1).
-otp_8898(doc) ->
- ["OTP-8898. Truncated Dets file."];
-otp_8898(suite) ->
- [];
+%% OTP-8898. Truncated Dets file.
otp_8898(Config) when is_list(Config) ->
Tab = otp_8898,
FName = filename(Tab, Config),
@@ -3012,10 +2861,7 @@ otp_8898(Config) when is_list(Config) ->
ok.
-otp_8899(doc) ->
- ["OTP-8899. Several clients. Updated Head was ignored."];
-otp_8899(suite) ->
- [];
+%% OTP-8899. Several clients. Updated Head was ignored.
otp_8899(Config) when is_list(Config) ->
Tab = many_clients,
FName = filename(Tab, Config),
@@ -3040,10 +2886,7 @@ otp_8899(Config) when is_list(Config) ->
ok.
-many_clients(doc) ->
- ["Several clients accessing a table simultaneously."];
-many_clients(suite) ->
- [];
+%% Test several clients accessing a table simultaneously.
many_clients(Config) when is_list(Config) ->
Tab = many_clients,
FName = filename(Tab, Config),
@@ -3229,10 +3072,7 @@ eval([{info,Tag,Expected} | L], Tab) ->
eval(Else, _Tab) ->
{error, {bad_request,Else}}.
-otp_4906(doc) ->
- ["More than 128k keys caused crash."];
-otp_4906(suite) ->
- [];
+%% More than 128k keys caused crash.
otp_4906(Config) when is_list(Config) ->
N = 256*512 + 400,
Tab = otp_4906,
@@ -3276,10 +3116,7 @@ ins_small(T, I, N) ->
ok = dets:insert(T, {I}),
ins_small(T, I+1, N).
-otp_5402(doc) ->
- ["Unwritable ramfile caused krasch."];
-otp_5402(suite) ->
- [];
+%% Unwritable ramfile caused crash.
otp_5402(Config) when is_list(Config) ->
Tab = otp_5402,
File = filename:join(["cannot", "write", "this", "file"]),
@@ -3306,10 +3143,7 @@ otp_5402(Config) when is_list(Config) ->
{error,{file_error,_,_}} = dets:close(T),
ok.
-simultaneous_open(doc) ->
- ["Several clients open and close tables simultaneously."];
-simultaneous_open(suite) ->
- [];
+%% Several clients open and close tables simultaneously.
simultaneous_open(Config) ->
Tab = sim_open,
File = filename(Tab, Config),
@@ -3528,10 +3362,7 @@ create_opened_log(File) ->
crash(File, ?CLOSED_PROPERLY_POS+3, ?NOT_PROPERLY_CLOSED),
ok.
-insert_new(doc) ->
- ["OTP-5075. insert_new/2"];
-insert_new(suite) ->
- [];
+%% OTP-5075. insert_new/2
insert_new(Config) ->
Tab = insert_new,
File = filename(Tab, Config),
@@ -3559,10 +3390,7 @@ insert_new(Config) ->
file:delete(File),
ok.
-repair_continuation(doc) ->
- ["OTP-5126. repair_continuation/2"];
-repair_continuation(suite) ->
- [];
+%% OTP-5126. repair_continuation/2
repair_continuation(Config) ->
Tab = repair_continuation_table,
Fname = filename(repair_cont, Config),
@@ -3585,10 +3413,7 @@ repair_continuation(Config) ->
file:delete(Fname),
ok.
-otp_5487(doc) ->
- ["OTP-5487. Growth of read-only table (again)."];
-otp_5487(suite) ->
- [];
+%% OTP-5487. Growth of read-only table (again).
otp_5487(Config) ->
otp_5487(Config, 9),
otp_5487(Config, 8),
@@ -3611,10 +3436,7 @@ otp_5487(Config, Version) ->
ets:delete(Ets),
file:delete(Fname).
-otp_6206(doc) ->
- ["OTP-6206. Badly formed free lists."];
-otp_6206(suite) ->
- [];
+%% OTP-6206. Badly formed free lists.
otp_6206(Config) ->
Tab = otp_6206,
File = filename(Tab, Config),
@@ -3633,10 +3455,7 @@ otp_6206(Config) ->
file:delete(File),
ok.
-otp_6359(doc) ->
- ["OTP-6359. select and match never return the empty list."];
-otp_6359(suite) ->
- [];
+%% OTP-6359. select and match never return the empty list.
otp_6359(Config) ->
Tab = otp_6359,
File = filename(Tab, Config),
@@ -3649,10 +3468,7 @@ otp_6359(Config) ->
file:delete(File),
ok.
-otp_4738(doc) ->
- ["OTP-4738. ==/2 and =:=/2."];
-otp_4738(suite) ->
- [];
+%% OTP-4738. ==/2 and =:=/2.
otp_4738(Config) ->
%% Version 8 has not been corrected.
%% (The constant -12857447 is for version 9 only.)
@@ -3804,10 +3620,7 @@ otp_4738_set(Version, Config) ->
file:delete(File),
ok.
-otp_7146(doc) ->
- ["OTP-7146. Bugfix: missing test when re-hashing."];
-otp_7146(suite) ->
- [];
+%% OTP-7146. Bugfix: missing test when re-hashing.
otp_7146(Config) ->
Tab = otp_7146,
File = filename(Tab, Config),
@@ -3830,10 +3643,7 @@ write_dets(Tab, N, Max) ->
ok = dets:insert(Tab,{ N, {entry,N}}),
write_dets(Tab, N+1, Max).
-otp_8070(doc) ->
- ["OTP-8070. Duplicated objects with insert_new() and duplicate_bag."];
-otp_8070(suite) ->
- [];
+%% OTP-8070. Duplicated objects with insert_new() and duplicate_bag.
otp_8070(Config) when is_list(Config) ->
Tab = otp_8070,
File = filename(Tab, Config),
@@ -3846,10 +3656,7 @@ otp_8070(Config) when is_list(Config) ->
file:delete(File),
ok.
-otp_8856(doc) ->
- ["OTP-8856. insert_new() bug."];
-otp_8856(suite) ->
- [];
+%% OTP-8856. insert_new() bug.
otp_8856(Config) when is_list(Config) ->
Tab = otp_8856,
File = filename(Tab, Config),
@@ -3871,10 +3678,7 @@ otp_8856(Config) when is_list(Config) ->
file:delete(File),
ok.
-otp_8903(doc) ->
- ["OTP-8903. bchunk/match/select bug."];
-otp_8903(suite) ->
- [];
+%% OTP-8903. bchunk/match/select bug.
otp_8903(Config) when is_list(Config) ->
Tab = otp_8903,
File = filename(Tab, Config),
@@ -3894,10 +3698,7 @@ otp_8903(Config) when is_list(Config) ->
file:delete(File),
ok.
-otp_8923(doc) ->
- ["OTP-8923. rehash due to lookup after initialization."];
-otp_8923(suite) ->
- [];
+%% OTP-8923. rehash due to lookup after initialization.
otp_8923(Config) when is_list(Config) ->
Tab = otp_8923,
File = filename(Tab, Config),
@@ -3927,10 +3728,7 @@ otp_8923(Config) when is_list(Config) ->
file:delete(File),
ok.
-otp_9282(doc) ->
- ["OTP-9282. The name of a table can be an arbitrary term"];
-otp_9282(suite) ->
- [];
+%% OTP-9282. The name of a table can be an arbitrary term.
otp_9282(Config) when is_list(Config) ->
some_calls(make_ref(), Config),
some_calls({a,typical,name}, Config),
@@ -3950,10 +3748,7 @@ some_calls(Tab, Config) ->
file:delete(File).
-otp_11245(doc) ->
- ["OTP-11245. Tables remained fixed after traversal"];
-otp_11245(suite) ->
- [];
+%% OTP-11245. Tables remained fixed after traversal.
otp_11245(Config) when is_list(Config) ->
Tab = otp_11245,
File = filename(Tab, Config),
@@ -3972,10 +3767,7 @@ otp_11245(Config) when is_list(Config) ->
file:delete(File),
ok.
-otp_11709(doc) ->
- ["OTP-11709. Bugfixes."];
-otp_11709(suite) ->
- [];
+%% OTP-11709. Bugfixes.
otp_11709(Config) when is_list(Config) ->
Short = <<"foo">>,
Long = <<"a sufficiently long text">>,
@@ -4014,8 +3806,7 @@ otp_11709(Config) when is_list(Config) ->
_ = file:delete(File),
ok.
-otp_13229(doc) ->
- ["OTP-13229. open_file() exits with badarg when given binary file name."];
+%% OTP-13229. open_file() exits with badarg when given binary file name.
otp_13229(_Config) ->
F = <<"binfile.tab">>,
try dets:open_file(name, [{file, F}]) of
@@ -4026,8 +3817,7 @@ otp_13229(_Config) ->
ok
end.
-otp_13260(doc) ->
- ["OTP-13260. Race when opening a table."];
+%% OTP-13260. Race when opening a table.
otp_13260(Config) ->
[ok] = lists:usort([otp_13260_1(Config) || _ <- lists:seq(1, 3)]),
ok.
@@ -4490,7 +4280,7 @@ check_pps({Ports0,Procs0} = P0) ->
show("New port", PortsDiff),
show("Old proc", Procs0 -- Procs1),
show("New proc", ProcsDiff),
- ?t:fail()
+ ct:fail(failed)
end
end
end.
diff --git a/lib/stdlib/test/dict_SUITE.erl b/lib/stdlib/test/dict_SUITE.erl
index 92d31bb748..d315e6f673 100644
--- a/lib/stdlib/test/dict_SUITE.erl
+++ b/lib/stdlib/test/dict_SUITE.erl
@@ -32,7 +32,9 @@
-import(lists, [foldl/3]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,5}}].
all() ->
[create, store, iterate].
@@ -54,12 +56,9 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?t:minutes(5)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
create(Config) when is_list(Config) ->
diff --git a/lib/stdlib/test/digraph_SUITE.erl b/lib/stdlib/test/digraph_SUITE.erl
index 97561196d8..8825d3fc15 100644
--- a/lib/stdlib/test/digraph_SUITE.erl
+++ b/lib/stdlib/test/digraph_SUITE.erl
@@ -19,7 +19,7 @@
%%
-module(digraph_SUITE).
-%-define(STANDALONE,1).
+%%-define(STANDALONE,1).
-ifdef(STANDALONE).
-define(line, put(line, ?LINE), ).
@@ -62,108 +62,100 @@ end_per_group(_GroupName, Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-opts(doc) -> [];
-opts(suite) -> [];
opts(Config) when is_list(Config) ->
%% OTP-5985: the 'public' option has been removed
- ?line {'EXIT',{badarg,_}} = (catch digraph:new([public])),
- ?line {P2,G2} = spawn_graph([private]),
- ?line {'EXIT',{badarg,_}} = (catch digraph:add_vertex(G2, x)),
- ?line kill_graph(P2),
- ?line {P3,G3} = spawn_graph([protected]),
- ?line {'EXIT',{badarg,_}} = (catch digraph:add_vertex(G3, x)),
- ?line kill_graph(P3),
- ?line Template = [{v1,[v2]}, {v2,[v3]}, {v3,[v4]}, {v4,[]}],
- ?line G4 = build_graph([], Template),
- ?line e = digraph:add_edge(G4, e, v4, v1, []),
- ?line digraph:delete(G4),
- ?line G5 = build_graph([cyclic], Template),
- ?line e = digraph:add_edge(G5, e, v4, v1, []),
- ?line digraph:delete(G5),
- ?line G6 = build_graph([acyclic], Template),
- ?line acyclic = info(G6, cyclicity),
- ?line {error, {bad_edge,_}} = digraph:add_edge(G6, v4, v1),
- ?line digraph:delete(G6),
+ {'EXIT',{badarg,_}} = (catch digraph:new([public])),
+ {P2,G2} = spawn_graph([private]),
+ {'EXIT',{badarg,_}} = (catch digraph:add_vertex(G2, x)),
+ kill_graph(P2),
+ {P3,G3} = spawn_graph([protected]),
+ {'EXIT',{badarg,_}} = (catch digraph:add_vertex(G3, x)),
+ kill_graph(P3),
+ Template = [{v1,[v2]}, {v2,[v3]}, {v3,[v4]}, {v4,[]}],
+ G4 = build_graph([], Template),
+ e = digraph:add_edge(G4, e, v4, v1, []),
+ digraph:delete(G4),
+ G5 = build_graph([cyclic], Template),
+ e = digraph:add_edge(G5, e, v4, v1, []),
+ digraph:delete(G5),
+ G6 = build_graph([acyclic], Template),
+ acyclic = info(G6, cyclicity),
+ {error, {bad_edge,_}} = digraph:add_edge(G6, v4, v1),
+ digraph:delete(G6),
ok.
-
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-degree(doc) -> [];
-degree(suite) -> [];
degree(Config) when is_list(Config) ->
- ?line G = build_graph([], [{x1,[]}, {x2,[x1]}, {x3,[x1,x2]},
- {x4,[x1,x2,x3]}, {x5,[x1,x2,x3,x4]}]),
+ G = build_graph([], [{x1,[]}, {x2,[x1]}, {x3,[x1,x2]},
+ {x4,[x1,x2,x3]}, {x5,[x1,x2,x3,x4]}]),
%% out degree
- ?line 0 = digraph:out_degree(G, x1),
- ?line 1 = digraph:out_degree(G, x2),
- ?line 2 = digraph:out_degree(G, x3),
- ?line 3 = digraph:out_degree(G, x4),
- ?line 4 = digraph:out_degree(G, x5),
+ 0 = digraph:out_degree(G, x1),
+ 1 = digraph:out_degree(G, x2),
+ 2 = digraph:out_degree(G, x3),
+ 3 = digraph:out_degree(G, x4),
+ 4 = digraph:out_degree(G, x5),
%% out neighbours
- ?line [] = check(digraph:out_neighbours(G, x1), []),
- ?line [] = check(digraph:out_neighbours(G, x2), [x1]),
- ?line [] = check(digraph:out_neighbours(G, x3), [x1,x2]),
- ?line [] = check(digraph:out_neighbours(G, x4), [x1,x2,x3]),
- ?line [] = check(digraph:out_neighbours(G, x5), [x1,x2,x3,x4]),
+ [] = check(digraph:out_neighbours(G, x1), []),
+ [] = check(digraph:out_neighbours(G, x2), [x1]),
+ [] = check(digraph:out_neighbours(G, x3), [x1,x2]),
+ [] = check(digraph:out_neighbours(G, x4), [x1,x2,x3]),
+ [] = check(digraph:out_neighbours(G, x5), [x1,x2,x3,x4]),
%% in degree
- ?line 4 = digraph:in_degree(G, x1),
- ?line 3 = digraph:in_degree(G, x2),
- ?line 2 = digraph:in_degree(G, x3),
- ?line 1 = digraph:in_degree(G, x4),
- ?line 0 = digraph:in_degree(G, x5),
+ 4 = digraph:in_degree(G, x1),
+ 3 = digraph:in_degree(G, x2),
+ 2 = digraph:in_degree(G, x3),
+ 1 = digraph:in_degree(G, x4),
+ 0 = digraph:in_degree(G, x5),
%% in neighbours
- ?line [] = check(digraph:in_neighbours(G, x1), [x2,x3,x4,x5]),
- ?line [] = check(digraph:in_neighbours(G, x2), [x3,x4,x5]),
- ?line [] = check(digraph:in_neighbours(G, x3), [x4,x5]),
- ?line [] = check(digraph:in_neighbours(G, x4), [x5]),
- ?line [] = check(digraph:in_neighbours(G, x5), []),
+ [] = check(digraph:in_neighbours(G, x1), [x2,x3,x4,x5]),
+ [] = check(digraph:in_neighbours(G, x2), [x3,x4,x5]),
+ [] = check(digraph:in_neighbours(G, x3), [x4,x5]),
+ [] = check(digraph:in_neighbours(G, x4), [x5]),
+ [] = check(digraph:in_neighbours(G, x5), []),
digraph:delete(G),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-path(doc) -> [];
-path(suite) -> [];
path(Config) when is_list(Config) ->
- ?line G = build_graph([], [{x1,[x2,x3]}, {x2,[x4]}, {x3,[x4]},
- {x4,[x5,x6]}, {x5,[x7]}, {x6,[x7]}]),
- ?line Vi = case digraph:get_path(G, x1, x7) of
- [x1,x2,x4,x5,x7] -> digraph:del_vertex(G, x5), x6;
- [x1,x2,x4,x6,x7] -> digraph:del_vertex(G, x6), x5;
- [x1,x3,x4,x5,x7] -> digraph:del_vertex(G, x5), x6;
- [x1,x3,x4,x6,x7] -> digraph:del_vertex(G, x6), x5
- end,
- ?line Vj = case digraph:get_path(G, x1, x7) of
- [x1,x2,x4,Vi,x7] -> digraph:del_vertex(G,x2), x3;
- [x1,x3,x4,Vi,x7] -> digraph:del_vertex(G,x3), x2
- end,
- ?line [x1,Vj,x4,Vi,x7] = digraph:get_path(G, x1, x7),
- ?line digraph:del_vertex(G, Vj),
- ?line false = digraph:get_path(G, x1, x7),
- ?line [] = check(digraph:vertices(G), [x1,x4,Vi,x7]),
+ G = build_graph([], [{x1,[x2,x3]}, {x2,[x4]}, {x3,[x4]},
+ {x4,[x5,x6]}, {x5,[x7]}, {x6,[x7]}]),
+ Vi = case digraph:get_path(G, x1, x7) of
+ [x1,x2,x4,x5,x7] -> digraph:del_vertex(G, x5), x6;
+ [x1,x2,x4,x6,x7] -> digraph:del_vertex(G, x6), x5;
+ [x1,x3,x4,x5,x7] -> digraph:del_vertex(G, x5), x6;
+ [x1,x3,x4,x6,x7] -> digraph:del_vertex(G, x6), x5
+ end,
+ Vj = case digraph:get_path(G, x1, x7) of
+ [x1,x2,x4,Vi,x7] -> digraph:del_vertex(G,x2), x3;
+ [x1,x3,x4,Vi,x7] -> digraph:del_vertex(G,x3), x2
+ end,
+ [x1,Vj,x4,Vi,x7] = digraph:get_path(G, x1, x7),
+ digraph:del_vertex(G, Vj),
+ false = digraph:get_path(G, x1, x7),
+ [] = check(digraph:vertices(G), [x1,x4,Vi,x7]),
digraph:delete(G),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-cycle(doc) -> [];
-cycle(suite) -> [];
cycle(Config) when is_list(Config) ->
- ?line G = build_graph([], [{x1,[x2,x3]}, {x2,[x4]}, {x3,[x4]},
- {x4,[x5,x6]}, {x5,[x7]}, {x6,[x7,x8]},
- {x8,[x3,x8]}]),
- ?line false = digraph:get_cycle(G, x1),
- ?line false = digraph:get_cycle(G, x2),
- ?line false = digraph:get_cycle(G, x5),
- ?line false = digraph:get_cycle(G, x7),
- ?line [x3,x4,x6,x8,x3] = digraph:get_cycle(G, x3),
- ?line [x4,x6,x8,x3,x4] = digraph:get_cycle(G, x4),
- ?line [x6,x8,x3,x4,x6] = digraph:get_cycle(G, x6),
- ?line [x8,x3,x4,x6,x8] = digraph:get_cycle(G, x8),
- ?line digraph:del_vertex(G, x4),
- ?line [x8] = digraph:get_cycle(G, x8),
+ G = build_graph([], [{x1,[x2,x3]}, {x2,[x4]}, {x3,[x4]},
+ {x4,[x5,x6]}, {x5,[x7]}, {x6,[x7,x8]},
+ {x8,[x3,x8]}]),
+ false = digraph:get_cycle(G, x1),
+ false = digraph:get_cycle(G, x2),
+ false = digraph:get_cycle(G, x5),
+ false = digraph:get_cycle(G, x7),
+ [x3,x4,x6,x8,x3] = digraph:get_cycle(G, x3),
+ [x4,x6,x8,x3,x4] = digraph:get_cycle(G, x4),
+ [x6,x8,x3,x4,x6] = digraph:get_cycle(G, x6),
+ [x8,x3,x4,x6,x8] = digraph:get_cycle(G, x8),
+ digraph:del_vertex(G, x4),
+ [x8] = digraph:get_cycle(G, x8),
digraph:delete(G),
ok.
@@ -171,61 +163,55 @@ cycle(Config) when is_list(Config) ->
-vertices(doc) -> [];
-vertices(suite) -> [];
vertices(Config) when is_list(Config) ->
- ?line G = build_graph([], [{x,[]}, {y,[]}]),
- ?line [] = check(digraph:vertices(G), [x,y]),
- ?line digraph:del_vertices(G, [x,y]),
- ?line [] = digraph:vertices(G),
- ?line digraph:delete(G),
+ G = build_graph([], [{x,[]}, {y,[]}]),
+ [] = check(digraph:vertices(G), [x,y]),
+ digraph:del_vertices(G, [x,y]),
+ [] = digraph:vertices(G),
+ digraph:delete(G),
ok.
-edges(doc) -> [];
-edges(suite) -> [];
edges(Config) when is_list(Config) ->
- ?line G = build_graph([], [{x, [{exy,y},{exx,x}]},
- {y, [{eyx,x}]}
- ]),
- ?line [] = check(digraph:edges(G), [exy, eyx, exx]),
- ?line [] = check(digraph:out_edges(G, x), [exy,exx]),
- ?line [] = check(digraph:in_edges(G, x), [eyx,exx]),
- ?line [] = check(digraph:out_edges(G, y), [eyx]),
- ?line [] = check(digraph:in_edges(G, y), [exy]),
- ?line true = digraph:del_edges(G, [exy, eyx, does_not_exist]),
- ?line [exx] = digraph:edges(G),
- ?line [] = check(digraph:out_edges(G, x), [exx]),
- ?line [] = check(digraph:in_edges(G, x), [exx]),
- ?line [] = check(digraph:out_edges(G, y), []),
- ?line [] = check(digraph:in_edges(G, y), []),
- ?line digraph:del_vertices(G, [x,y]),
- ?line [] = digraph:edges(G),
- ?line [] = digraph:vertices(G),
- ?line digraph:delete(G),
+ G = build_graph([], [{x, [{exy,y},{exx,x}]},
+ {y, [{eyx,x}]}
+ ]),
+ [] = check(digraph:edges(G), [exy, eyx, exx]),
+ [] = check(digraph:out_edges(G, x), [exy,exx]),
+ [] = check(digraph:in_edges(G, x), [eyx,exx]),
+ [] = check(digraph:out_edges(G, y), [eyx]),
+ [] = check(digraph:in_edges(G, y), [exy]),
+ true = digraph:del_edges(G, [exy, eyx, does_not_exist]),
+ [exx] = digraph:edges(G),
+ [] = check(digraph:out_edges(G, x), [exx]),
+ [] = check(digraph:in_edges(G, x), [exx]),
+ [] = check(digraph:out_edges(G, y), []),
+ [] = check(digraph:in_edges(G, y), []),
+ digraph:del_vertices(G, [x,y]),
+ [] = digraph:edges(G),
+ [] = digraph:vertices(G),
+ digraph:delete(G),
ok.
-data(doc) -> [];
-data(suite) -> [];
data(Config) when is_list(Config) ->
- ?line G = build_graph([], [{x, [{exy, y}]}, {y, []}]),
-
- ?line {x,[]} = digraph:vertex(G, x),
- ?line {y,[]} = digraph:vertex(G, y),
- ?line {exy,x,y,[]} = digraph:edge(G, exy),
-
- ?line digraph:add_edge(G, exy, x, y, {data,x,y}),
- ?line E = digraph:add_edge(G, x, y, {data,y,x}),
- ?line digraph:add_vertex(G, x, {any}),
- ?line digraph:add_vertex(G, y, '_'),
-
- ?line {x,{any}} = digraph:vertex(G, x),
- ?line {y,'_'} = digraph:vertex(G, y),
- ?line {exy,x,y,{data,x,y}} = digraph:edge(G, exy),
- ?line {E,x,y,{data,y,x}} = digraph:edge(G, E),
- ?line true = digraph:del_edge(G, E),
- ?line false = digraph:edge(G, E),
- ?line true = sane(G),
- ?line digraph:delete(G),
+ G = build_graph([], [{x, [{exy, y}]}, {y, []}]),
+
+ {x,[]} = digraph:vertex(G, x),
+ {y,[]} = digraph:vertex(G, y),
+ {exy,x,y,[]} = digraph:edge(G, exy),
+
+ digraph:add_edge(G, exy, x, y, {data,x,y}),
+ E = digraph:add_edge(G, x, y, {data,y,x}),
+ digraph:add_vertex(G, x, {any}),
+ digraph:add_vertex(G, y, '_'),
+
+ {x,{any}} = digraph:vertex(G, x),
+ {y,'_'} = digraph:vertex(G, y),
+ {exy,x,y,{data,x,y}} = digraph:edge(G, exy),
+ {E,x,y,{data,y,x}} = digraph:edge(G, E),
+ true = digraph:del_edge(G, E),
+ false = digraph:edge(G, E),
+ true = sane(G),
+ digraph:delete(G),
ok.
@@ -233,87 +219,81 @@ data(Config) when is_list(Config) ->
-otp_3522(doc) -> [];
-otp_3522(suite) -> [];
otp_3522(Config) when is_list(Config) ->
- ?line G1 = build_graph([acyclic], [{x, []}]),
- ?line {error, {bad_edge,_}} = digraph:add_edge(G1, x, x),
- ?line true = digraph:delete(G1),
-
- ?line G = digraph:new(),
- ?line 0 = digraph:no_vertices(G),
- ?line 0 = digraph:no_edges(G),
- ?line V1 = digraph:add_vertex(G),
- ?line '$vid' = digraph:add_vertex(G, '$vid'),
- ?line V2 = digraph:add_vertex(G),
- ?line '$eid' = digraph:add_edge(G, '$eid', V1, V2, []),
- ?line E = digraph:add_edge(G, V1, V2),
- ?line 3 = digraph:no_vertices(G),
- ?line 2 = digraph:no_edges(G),
- ?line cyclic = info(G, cyclicity),
- ?line protected = info(G, protection),
-
- ?line [] = check(digraph:in_edges(G, V2), ['$eid', E]),
- ?line [] = check(digraph:out_edges(G, V1), ['$eid', E]),
- ?line [] = check(digraph:vertices(G), [V1,V2,'$vid']),
- ?line [] = check(digraph:edges(G), [E, '$eid']),
- ?line true = sane(G),
- ?line true = digraph:delete(G),
+ G1 = build_graph([acyclic], [{x, []}]),
+ {error, {bad_edge,_}} = digraph:add_edge(G1, x, x),
+ true = digraph:delete(G1),
+
+ G = digraph:new(),
+ 0 = digraph:no_vertices(G),
+ 0 = digraph:no_edges(G),
+ V1 = digraph:add_vertex(G),
+ '$vid' = digraph:add_vertex(G, '$vid'),
+ V2 = digraph:add_vertex(G),
+ '$eid' = digraph:add_edge(G, '$eid', V1, V2, []),
+ E = digraph:add_edge(G, V1, V2),
+ 3 = digraph:no_vertices(G),
+ 2 = digraph:no_edges(G),
+ cyclic = info(G, cyclicity),
+ protected = info(G, protection),
+
+ [] = check(digraph:in_edges(G, V2), ['$eid', E]),
+ [] = check(digraph:out_edges(G, V1), ['$eid', E]),
+ [] = check(digraph:vertices(G), [V1,V2,'$vid']),
+ [] = check(digraph:edges(G), [E, '$eid']),
+ true = sane(G),
+ true = digraph:delete(G),
ok.
-otp_3630(doc) -> [];
-otp_3630(suite) -> [];
otp_3630(Config) when is_list(Config) ->
- ?line G = build_graph([], [{x, [{exy,y},{exx,x}]},
- {y, [{eyy,y},{eyx,x}]}
- ]),
- ?line [x,y] = digraph:get_path(G, x, y),
- ?line [y,x] = digraph:get_path(G, y, x),
-
- ?line [x,x] = digraph:get_short_path(G, x, x),
- ?line [y,y] = digraph:get_short_path(G, y, y),
- ?line true = digraph:delete(G),
-
- ?line G1 = build_graph([], [{1, [{12,2},{13,3},{11,1}]},
- {2, [{23,3}]},
- {3, [{34,4},{35,5}]},
- {4, [{45,5}]},
- {5, [{56,6},{57,7}]},
- {6, [{67,7}]},
- {7, [{71,1}]}
- ]),
-
- ?line [1,3,5,7] = digraph:get_short_path(G1, 1, 7),
- ?line [3,5,7,1,3] = digraph:get_short_cycle(G1, 3),
- ?line [1,1] = digraph:get_short_cycle(G1, 1),
- ?line true = digraph:delete(G1),
+ G = build_graph([], [{x, [{exy,y},{exx,x}]},
+ {y, [{eyy,y},{eyx,x}]}
+ ]),
+ [x,y] = digraph:get_path(G, x, y),
+ [y,x] = digraph:get_path(G, y, x),
+
+ [x,x] = digraph:get_short_path(G, x, x),
+ [y,y] = digraph:get_short_path(G, y, y),
+ true = digraph:delete(G),
+
+ G1 = build_graph([], [{1, [{12,2},{13,3},{11,1}]},
+ {2, [{23,3}]},
+ {3, [{34,4},{35,5}]},
+ {4, [{45,5}]},
+ {5, [{56,6},{57,7}]},
+ {6, [{67,7}]},
+ {7, [{71,1}]}
+ ]),
+
+ [1,3,5,7] = digraph:get_short_path(G1, 1, 7),
+ [3,5,7,1,3] = digraph:get_short_cycle(G1, 3),
+ [1,1] = digraph:get_short_cycle(G1, 1),
+ true = digraph:delete(G1),
F = 0.0, I = round(F),
- ?line G2 = digraph:new([acyclic]),
- ?line digraph:add_vertex(G2, F),
- ?line digraph:add_vertex(G2, I),
- ?line E = digraph:add_edge(G2, F, I),
- ?line true = not is_tuple(E),
- ?line true = sane(G2),
- ?line true = digraph:delete(G2),
+ G2 = digraph:new([acyclic]),
+ digraph:add_vertex(G2, F),
+ digraph:add_vertex(G2, I),
+ E = digraph:add_edge(G2, F, I),
+ true = not is_tuple(E),
+ true = sane(G2),
+ true = digraph:delete(G2),
ok.
-otp_8066(doc) -> [];
-otp_8066(suite) -> [];
otp_8066(Config) when is_list(Config) ->
fun() ->
D = digraph:new(),
V1 = digraph:add_vertex(D),
V2 = digraph:add_vertex(D),
_ = digraph:add_edge(D, V1, V2),
- ?line [V1, V2] = digraph:get_path(D, V1, V2),
- ?line true = sane(D),
- ?line true = digraph:del_path(D, V1, V2),
- ?line true = sane(D),
- ?line false = digraph:get_path(D, V1, V2),
- ?line true = digraph:del_path(D, V1, V2),
- ?line true = digraph:delete(D)
+ [V1, V2] = digraph:get_path(D, V1, V2),
+ true = sane(D),
+ true = digraph:del_path(D, V1, V2),
+ true = sane(D),
+ false = digraph:get_path(D, V1, V2),
+ true = digraph:del_path(D, V1, V2),
+ true = digraph:delete(D)
end(),
fun() ->
@@ -324,15 +304,15 @@ otp_8066(Config) when is_list(Config) ->
_ = digraph:add_edge(D, V1, V2),
_ = digraph:add_edge(D, V1, V1),
_ = digraph:add_edge(D, V2, V2),
- ?line [V1, V2] = digraph:get_path(D, V1, V2),
- ?line true = sane(D),
- ?line true = digraph:del_path(D, V1, V2),
- ?line false = digraph:get_short_path(D, V2, V1),
-
- ?line true = sane(D),
- ?line false = digraph:get_path(D, V1, V2),
- ?line true = digraph:del_path(D, V1, V2),
- ?line true = digraph:delete(D)
+ [V1, V2] = digraph:get_path(D, V1, V2),
+ true = sane(D),
+ true = digraph:del_path(D, V1, V2),
+ false = digraph:get_short_path(D, V2, V1),
+
+ true = sane(D),
+ false = digraph:get_path(D, V1, V2),
+ true = digraph:del_path(D, V1, V2),
+ true = digraph:delete(D)
end(),
fun() ->
@@ -342,18 +322,18 @@ otp_8066(Config) when is_list(Config) ->
W3 = digraph:add_vertex(G),
W4 = digraph:add_vertex(G),
_ = digraph:add_edge(G,['$e'|0], W1, W2, {}),
- ?line {error,{bad_vertex, bv}} =
+ {error,{bad_vertex, bv}} =
digraph:add_edge(G, edge, bv, W1, {}),
- ?line {error,{bad_vertex, bv}} =
+ {error,{bad_vertex, bv}} =
digraph:add_edge(G, edge, W1, bv, {}),
- ?line false = digraph:get_short_cycle(G, W1),
- ?line {error, {bad_edge,_}} =
+ false = digraph:get_short_cycle(G, W1),
+ {error, {bad_edge,_}} =
digraph:add_edge(G,['$e'|0], W3, W4, {}),
- ?line true = sane(G),
- ?line true = digraph:delete(G)
+ true = sane(G),
+ true = digraph:delete(G)
end(),
ok.
-
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -422,7 +402,7 @@ sane1(G) ->
end
end, OutEs)
end, Vs),
-
+
InEs = lists:flatmap(fun(V) -> digraph:in_edges(G, V) end, Vs),
OutEs = lists:flatmap(fun(V) -> digraph:out_edges(G, V) end, Vs),
lists:foreach(
@@ -450,7 +430,7 @@ sane1(G) ->
end,
Edges = [digraph:edge(G, E) || E <- Es],
EVs = lists:usort([V || {_, V, _, _} <- Edges] ++
- [V || {_, _, V, _} <- Edges]),
+ [V || {_, _, V, _} <- Edges]),
lists:foreach(
fun(V) ->
case digraph:vertex(G, V) of
diff --git a/lib/stdlib/test/digraph_utils_SUITE.erl b/lib/stdlib/test/digraph_utils_SUITE.erl
index e155857bd4..23520072f8 100644
--- a/lib/stdlib/test/digraph_utils_SUITE.erl
+++ b/lib/stdlib/test/digraph_utils_SUITE.erl
@@ -19,7 +19,7 @@
%%
-module(digraph_utils_SUITE).
-%-define(debug, true).
+%%-define(debug, true).
-ifdef(debug).
-define(line, put(line, ?LINE), ).
-else.
@@ -59,205 +59,192 @@ end_per_group(_GroupName, Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-simple(doc) -> [];
-simple(suite) -> [];
simple(Config) when is_list(Config) ->
- ?line G = digraph:new(),
- ?line add_vertices(G, [a]),
- ?line add_edges(G, [{b,c},{b,d},{e,f},{f,g},{g,e},{h,h},{i,i},{i,j}]),
- ?line 10 = length(digraph_utils:postorder(G)),
- ?line 10 = length(digraph_utils:preorder(G)),
- ?line ok = evall(digraph_utils:components(G),
- [[a],[b,c,d],[e,f,g],[h],[i,j]]),
- ?line ok = evall(digraph_utils:strong_components(G),
+ G = digraph:new(),
+ add_vertices(G, [a]),
+ add_edges(G, [{b,c},{b,d},{e,f},{f,g},{g,e},{h,h},{i,i},{i,j}]),
+ 10 = length(digraph_utils:postorder(G)),
+ 10 = length(digraph_utils:preorder(G)),
+ ok = evall(digraph_utils:components(G),
+ [[a],[b,c,d],[e,f,g],[h],[i,j]]),
+ ok = evall(digraph_utils:strong_components(G),
[[a],[b],[c],[d],[e,f,g],[h],[i],[j]]),
- ?line ok = evall(digraph_utils:cyclic_strong_components(G),
- [[e,f,g],[h],[i]]),
- ?line true = path(G, e, e),
- ?line false = path(G, e, j),
- ?line false = path(G, a, a),
- ?line false = digraph_utils:topsort(G),
- ?line false = digraph_utils:is_acyclic(G),
- ?line ok = eval(digraph_utils:loop_vertices(G), [h,i]),
- ?line ok = eval(digraph_utils:reaching([e], G), [e,f,g]),
- ?line ok = eval(digraph_utils:reaching_neighbours([e], G), [e,f,g]),
- ?line ok = eval(digraph_utils:reachable([e], G), [e,f,g]),
- ?line ok = eval(digraph_utils:reachable_neighbours([e], G), [e,f,g]),
- ?line ok = eval(digraph_utils:reaching([b], G), [b]),
- ?line ok = eval(digraph_utils:reaching_neighbours([b], G), []),
- ?line ok = eval(digraph_utils:reachable([b], G), [b,c,d]),
- ?line ok = eval(digraph_utils:reachable_neighbours([b], G), [c,d]),
- ?line ok = eval(digraph_utils:reaching([h], G), [h]),
- ?line ok = eval(digraph_utils:reaching_neighbours([h], G), [h]),
- ?line ok = eval(digraph_utils:reachable([h], G), [h]),
- ?line ok = eval(digraph_utils:reachable_neighbours([h], G), [h]),
- ?line ok = eval(digraph_utils:reachable([e,f], G), [e,f,g]),
- ?line ok = eval(digraph_utils:reachable_neighbours([e,f], G), [e,f,g]),
- ?line ok = eval(digraph_utils:reachable([h,h,h], G), [h]),
- ?line true = digraph:delete(G),
+ ok = evall(digraph_utils:cyclic_strong_components(G),
+ [[e,f,g],[h],[i]]),
+ true = path(G, e, e),
+ false = path(G, e, j),
+ false = path(G, a, a),
+ false = digraph_utils:topsort(G),
+ false = digraph_utils:is_acyclic(G),
+ ok = eval(digraph_utils:loop_vertices(G), [h,i]),
+ ok = eval(digraph_utils:reaching([e], G), [e,f,g]),
+ ok = eval(digraph_utils:reaching_neighbours([e], G), [e,f,g]),
+ ok = eval(digraph_utils:reachable([e], G), [e,f,g]),
+ ok = eval(digraph_utils:reachable_neighbours([e], G), [e,f,g]),
+ ok = eval(digraph_utils:reaching([b], G), [b]),
+ ok = eval(digraph_utils:reaching_neighbours([b], G), []),
+ ok = eval(digraph_utils:reachable([b], G), [b,c,d]),
+ ok = eval(digraph_utils:reachable_neighbours([b], G), [c,d]),
+ ok = eval(digraph_utils:reaching([h], G), [h]),
+ ok = eval(digraph_utils:reaching_neighbours([h], G), [h]),
+ ok = eval(digraph_utils:reachable([h], G), [h]),
+ ok = eval(digraph_utils:reachable_neighbours([h], G), [h]),
+ ok = eval(digraph_utils:reachable([e,f], G), [e,f,g]),
+ ok = eval(digraph_utils:reachable_neighbours([e,f], G), [e,f,g]),
+ ok = eval(digraph_utils:reachable([h,h,h], G), [h]),
+ true = digraph:delete(G),
ok.
-loop(doc) -> [];
-loop(suite) -> [];
loop(Config) when is_list(Config) ->
- ?line G = digraph:new(),
- ?line add_vertices(G, [a,b]),
- ?line add_edges(G, [{a,a},{b,b}]),
- ?line ok = evall(digraph_utils:components(G), [[a],[b]]),
- ?line ok = evall(digraph_utils:strong_components(G), [[a],[b]]),
- ?line ok = evall(digraph_utils:cyclic_strong_components(G), [[a],[b]]),
- ?line [_,_] = digraph_utils:topsort(G),
- ?line false = digraph_utils:is_acyclic(G),
- ?line ok = eval(digraph_utils:loop_vertices(G), [a,b]),
- ?line [_,_] = digraph_utils:preorder(G),
- ?line [_,_] = digraph_utils:postorder(G),
- ?line ok = eval(digraph_utils:reaching([b], G), [b]),
- ?line ok = eval(digraph_utils:reaching_neighbours([b], G), [b]),
- ?line ok = eval(digraph_utils:reachable([b], G), [b]),
- ?line ok = eval(digraph_utils:reachable_neighbours([b], G), [b]),
- ?line true = path(G, a, a),
- ?line true = digraph:delete(G),
+ G = digraph:new(),
+ add_vertices(G, [a,b]),
+ add_edges(G, [{a,a},{b,b}]),
+ ok = evall(digraph_utils:components(G), [[a],[b]]),
+ ok = evall(digraph_utils:strong_components(G), [[a],[b]]),
+ ok = evall(digraph_utils:cyclic_strong_components(G), [[a],[b]]),
+ [_,_] = digraph_utils:topsort(G),
+ false = digraph_utils:is_acyclic(G),
+ ok = eval(digraph_utils:loop_vertices(G), [a,b]),
+ [_,_] = digraph_utils:preorder(G),
+ [_,_] = digraph_utils:postorder(G),
+ ok = eval(digraph_utils:reaching([b], G), [b]),
+ ok = eval(digraph_utils:reaching_neighbours([b], G), [b]),
+ ok = eval(digraph_utils:reachable([b], G), [b]),
+ ok = eval(digraph_utils:reachable_neighbours([b], G), [b]),
+ true = path(G, a, a),
+ true = digraph:delete(G),
ok.
-isolated(doc) -> [];
-isolated(suite) -> [];
isolated(Config) when is_list(Config) ->
- ?line G = digraph:new(),
- ?line add_vertices(G, [a,b]),
- ?line ok = evall(digraph_utils:components(G), [[a],[b]]),
- ?line ok = evall(digraph_utils:strong_components(G), [[a],[b]]),
- ?line ok = evall(digraph_utils:cyclic_strong_components(G), []),
- ?line [_,_] = digraph_utils:topsort(G),
- ?line true = digraph_utils:is_acyclic(G),
- ?line ok = eval(digraph_utils:loop_vertices(G), []),
- ?line [_,_] = digraph_utils:preorder(G),
- ?line [_,_] = digraph_utils:postorder(G),
- ?line ok = eval(digraph_utils:reaching([b], G), [b]),
- ?line ok = eval(digraph_utils:reaching_neighbours([b], G), []),
- ?line ok = eval(digraph_utils:reachable([b], G), [b]),
- ?line ok = eval(digraph_utils:reachable_neighbours([b], G), []),
- ?line false = path(G, a, a),
- ?line true = digraph:delete(G),
+ G = digraph:new(),
+ add_vertices(G, [a,b]),
+ ok = evall(digraph_utils:components(G), [[a],[b]]),
+ ok = evall(digraph_utils:strong_components(G), [[a],[b]]),
+ ok = evall(digraph_utils:cyclic_strong_components(G), []),
+ [_,_] = digraph_utils:topsort(G),
+ true = digraph_utils:is_acyclic(G),
+ ok = eval(digraph_utils:loop_vertices(G), []),
+ [_,_] = digraph_utils:preorder(G),
+ [_,_] = digraph_utils:postorder(G),
+ ok = eval(digraph_utils:reaching([b], G), [b]),
+ ok = eval(digraph_utils:reaching_neighbours([b], G), []),
+ ok = eval(digraph_utils:reachable([b], G), [b]),
+ ok = eval(digraph_utils:reachable_neighbours([b], G), []),
+ false = path(G, a, a),
+ true = digraph:delete(G),
ok.
-topsort(doc) -> [];
-topsort(suite) -> [];
topsort(Config) when is_list(Config) ->
- ?line G = digraph:new(),
- ?line add_edges(G, [{a,b},{b,c},{c,d},{d,e},{e,f}]),
- ?line ok = eval(digraph_utils:topsort(G), [a,b,c,d,e,f]),
- ?line true = digraph:delete(G),
+ G = digraph:new(),
+ add_edges(G, [{a,b},{b,c},{c,d},{d,e},{e,f}]),
+ ok = eval(digraph_utils:topsort(G), [a,b,c,d,e,f]),
+ true = digraph:delete(G),
ok.
-subgraph(doc) -> [];
-subgraph(suite) -> [];
subgraph(Config) when is_list(Config) ->
- ?line G = digraph:new([acyclic]),
- ?line add_edges(G, [{b,c},{b,d},{e,f},{f,fg,fgl,g},{f,fg2,fgl2,g},{g,e},
- {h,h},{i,i},{i,j}]),
- ?line add_vertices(G, [{b,bl},{f,fl}]),
- ?line SG = digraph_utils:subgraph(G, [u1,b,c,u2,f,g,i,u3]),
- ?line [b,c,f,g,i] = lists:sort(digraph:vertices(SG)),
- ?line {b,bl} = digraph:vertex(SG, b),
- ?line {c,[]} = digraph:vertex(SG, c),
- ?line {fg,f,g,fgl} = digraph:edge(SG, fg),
- ?line {fg2,f,g,fgl2} = digraph:edge(SG, fg2),
- ?line {_, {_, acyclic}} = lists:keysearch(cyclicity, 1, digraph:info(SG)),
- ?line true = digraph:delete(SG),
-
- ?line SG1 = digraph_utils:subgraph(G, [f, g, h],
- [{type, []}, {keep_labels, false}]),
- ?line [f,g,h] = lists:sort(digraph:vertices(SG1)),
- ?line {f,[]} = digraph:vertex(SG1, f),
- ?line {fg,f,g,[]} = digraph:edge(SG1, fg),
- ?line {_, {_, cyclic}} = lists:keysearch(cyclicity, 1, digraph:info(SG1)),
- ?line true = digraph:delete(SG1),
-
- ?line SG2 = digraph_utils:subgraph(G, [f, g, h],
- [{type, [acyclic]},
- {keep_labels, true}]),
- ?line [f,g,h] = lists:sort(digraph:vertices(SG2)),
- ?line {f,fl} = digraph:vertex(SG2, f),
- ?line {fg,f,g,fgl} = digraph:edge(SG2, fg),
- ?line {_, {_, acyclic}} = lists:keysearch(cyclicity, 1, digraph:info(SG2)),
- ?line true = digraph:delete(SG2),
-
- ?line {'EXIT',{badarg,_}} =
+ G = digraph:new([acyclic]),
+ add_edges(G, [{b,c},{b,d},{e,f},{f,fg,fgl,g},{f,fg2,fgl2,g},{g,e},
+ {h,h},{i,i},{i,j}]),
+ add_vertices(G, [{b,bl},{f,fl}]),
+ SG = digraph_utils:subgraph(G, [u1,b,c,u2,f,g,i,u3]),
+ [b,c,f,g,i] = lists:sort(digraph:vertices(SG)),
+ {b,bl} = digraph:vertex(SG, b),
+ {c,[]} = digraph:vertex(SG, c),
+ {fg,f,g,fgl} = digraph:edge(SG, fg),
+ {fg2,f,g,fgl2} = digraph:edge(SG, fg2),
+ {_, {_, acyclic}} = lists:keysearch(cyclicity, 1, digraph:info(SG)),
+ true = digraph:delete(SG),
+
+ SG1 = digraph_utils:subgraph(G, [f, g, h],
+ [{type, []}, {keep_labels, false}]),
+ [f,g,h] = lists:sort(digraph:vertices(SG1)),
+ {f,[]} = digraph:vertex(SG1, f),
+ {fg,f,g,[]} = digraph:edge(SG1, fg),
+ {_, {_, cyclic}} = lists:keysearch(cyclicity, 1, digraph:info(SG1)),
+ true = digraph:delete(SG1),
+
+ SG2 = digraph_utils:subgraph(G, [f, g, h],
+ [{type, [acyclic]},
+ {keep_labels, true}]),
+ [f,g,h] = lists:sort(digraph:vertices(SG2)),
+ {f,fl} = digraph:vertex(SG2, f),
+ {fg,f,g,fgl} = digraph:edge(SG2, fg),
+ {_, {_, acyclic}} = lists:keysearch(cyclicity, 1, digraph:info(SG2)),
+ true = digraph:delete(SG2),
+
+ {'EXIT',{badarg,_}} =
(catch digraph_utils:subgraph(G, [f], [{invalid, opt}])),
- ?line {'EXIT',{badarg,_}} =
+ {'EXIT',{badarg,_}} =
(catch digraph_utils:subgraph(G, [f], [{keep_labels, not_Bool}])),
- ?line {'EXIT',{badarg,_}} =
+ {'EXIT',{badarg,_}} =
(catch digraph_utils:subgraph(G, [f], [{type, not_type}])),
- ?line {'EXIT',{badarg,_}} =
+ {'EXIT',{badarg,_}} =
(catch digraph_utils:subgraph(G, [f], [{type, [not_type]}])),
- ?line {'EXIT',{badarg,_}} =
+ {'EXIT',{badarg,_}} =
(catch digraph_utils:subgraph(G, [f], not_a_list)),
- ?line true = digraph:delete(G),
+ true = digraph:delete(G),
ok.
-condensation(doc) -> [];
-condensation(suite) -> [];
condensation(Config) when is_list(Config) ->
- ?line G = digraph:new([]),
- ?line add_edges(G, [{b,c},{b,d},{e,f},{f,fg,fgl,g},{f,fg2,fgl2,g},{g,e},
- {h,h},{j,i},{i,j}]),
- ?line add_vertices(G, [q]),
- ?line CG = digraph_utils:condensation(G),
- ?line Vs = sort_2(digraph:vertices(CG)),
- ?line [[b],[c],[d],[e,f,g],[h],[i,j],[q]] = Vs,
- ?line Fun = fun(E) ->
- {_E, V1, V2, _L} = digraph:edge(CG, E),
- {lists:sort(V1), lists:sort(V2)}
- end,
- ?line Es = lists:map(Fun, digraph:edges(CG)),
- ?line [{[b],[c]},{[b],[d]}] = lists:sort(Es),
- ?line true = digraph:delete(CG),
- ?line true = digraph:delete(G),
+ G = digraph:new([]),
+ add_edges(G, [{b,c},{b,d},{e,f},{f,fg,fgl,g},{f,fg2,fgl2,g},{g,e},
+ {h,h},{j,i},{i,j}]),
+ add_vertices(G, [q]),
+ CG = digraph_utils:condensation(G),
+ Vs = sort_2(digraph:vertices(CG)),
+ [[b],[c],[d],[e,f,g],[h],[i,j],[q]] = Vs,
+ Fun = fun(E) ->
+ {_E, V1, V2, _L} = digraph:edge(CG, E),
+ {lists:sort(V1), lists:sort(V2)}
+ end,
+ Es = lists:map(Fun, digraph:edges(CG)),
+ [{[b],[c]},{[b],[d]}] = lists:sort(Es),
+ true = digraph:delete(CG),
+ true = digraph:delete(G),
ok.
-tree(doc) -> ["OTP-7081"];
-tree(suite) -> [];
+%% OTP-7081
tree(Config) when is_list(Config) ->
- ?line false = is_tree([], []),
- ?line true = is_tree([a], []),
- ?line false = is_tree([a,b], []),
- ?line true = is_tree([{a,b}]),
- ?line false = is_tree([{a,b},{b,a}]),
- ?line true = is_tree([{a,b},{a,c},{b,d},{b,e}]),
- ?line false = is_tree([{a,b},{a,c},{b,d},{b,e}, {d,e}]),
- ?line false = is_tree([{a,b},{a,c},{b,d},{b,e}, {b,e}]),
- ?line true = is_tree([{a,c},{c,b}]),
- ?line true = is_tree([{b,a},{c,a}]),
+ false = is_tree([], []),
+ true = is_tree([a], []),
+ false = is_tree([a,b], []),
+ true = is_tree([{a,b}]),
+ false = is_tree([{a,b},{b,a}]),
+ true = is_tree([{a,b},{a,c},{b,d},{b,e}]),
+ false = is_tree([{a,b},{a,c},{b,d},{b,e}, {d,e}]),
+ false = is_tree([{a,b},{a,c},{b,d},{b,e}, {b,e}]),
+ true = is_tree([{a,c},{c,b}]),
+ true = is_tree([{b,a},{c,a}]),
%% Parallel edges. Acyclic and with one componets
%% (according to the digraph module).
- ?line false = is_tree([{a,b},{a,b}]),
-
- ?line no = arborescence_root([], []),
- ?line {yes, a} = arborescence_root([a], []),
- ?line no = arborescence_root([a,b], []),
- ?line {yes, a} = arborescence_root([{a,b}]),
- ?line no = arborescence_root([{a,b},{b,a}]),
- ?line {yes, a} = arborescence_root([{a,b},{a,c},{b,d},{b,e}]),
- ?line no = arborescence_root([{a,b},{a,c},{b,d},{b,e}, {d,e}]),
- ?line no = arborescence_root([{a,b},{a,c},{b,d},{b,e}, {b,e}]),
- ?line {yes, a} = arborescence_root([{a,c},{c,b}]),
- ?line no = arborescence_root([{b,a},{c,a}]),
-
- ?line false = is_arborescence([], []),
- ?line true = is_arborescence([a], []),
- ?line false = is_arborescence([a,b], []),
- ?line true = is_arborescence([{a,b}]),
- ?line false = is_arborescence([{a,b},{b,a}]),
- ?line true = is_arborescence([{a,b},{a,c},{b,d},{b,e}]),
- ?line false = is_arborescence([{a,b},{a,c},{b,d},{b,e}, {d,e}]),
- ?line false = is_arborescence([{a,b},{a,c},{b,d},{b,e}, {b,e}]),
- ?line true = is_arborescence([{a,c},{c,b}]),
- ?line false = is_arborescence([{b,a},{c,a}]),
+ false = is_tree([{a,b},{a,b}]),
+
+ no = arborescence_root([], []),
+ {yes, a} = arborescence_root([a], []),
+ no = arborescence_root([a,b], []),
+ {yes, a} = arborescence_root([{a,b}]),
+ no = arborescence_root([{a,b},{b,a}]),
+ {yes, a} = arborescence_root([{a,b},{a,c},{b,d},{b,e}]),
+ no = arborescence_root([{a,b},{a,c},{b,d},{b,e}, {d,e}]),
+ no = arborescence_root([{a,b},{a,c},{b,d},{b,e}, {b,e}]),
+ {yes, a} = arborescence_root([{a,c},{c,b}]),
+ no = arborescence_root([{b,a},{c,a}]),
+
+ false = is_arborescence([], []),
+ true = is_arborescence([a], []),
+ false = is_arborescence([a,b], []),
+ true = is_arborescence([{a,b}]),
+ false = is_arborescence([{a,b},{b,a}]),
+ true = is_arborescence([{a,b},{a,c},{b,d},{b,e}]),
+ false = is_arborescence([{a,b},{a,c},{b,d},{b,e}, {d,e}]),
+ false = is_arborescence([{a,b},{a,c},{b,d},{b,e}, {b,e}]),
+ true = is_arborescence([{a,c},{c,b}]),
+ false = is_arborescence([{b,a},{c,a}]),
%% Parallel edges.
- ?line false = is_arborescence([{a,b},{a,b}]),
+ false = is_arborescence([{a,b},{a,b}]),
ok.
@@ -325,7 +312,7 @@ eval(L, E) ->
evall(L, E) ->
F = fun(L1) -> lists:sort(L1) end,
Fun = fun(LL) -> F(lists:map(F, LL)) end,
-
+
Expected = Fun(E),
Got = Fun(L),
if
diff --git a/lib/stdlib/test/dummy1_h.erl b/lib/stdlib/test/dummy1_h.erl
index 5db23872c4..cdf9a305e1 100644
--- a/lib/stdlib/test/dummy1_h.erl
+++ b/lib/stdlib/test/dummy1_h.erl
@@ -37,7 +37,7 @@ handle_event(delete_event, _Parent) ->
remove_handler;
handle_event(do_crash, _State) ->
erlang:error({badmatch,4});
-%Inverse of dummy_h
+%%Inverse of dummy_h
handle_event(hibernate, Parent) ->
{ok,Parent};
handle_event(wakeup, Parent) ->
diff --git a/lib/stdlib/test/dummy_via.erl b/lib/stdlib/test/dummy_via.erl
index e405811cbe..026b329688 100644
--- a/lib/stdlib/test/dummy_via.erl
+++ b/lib/stdlib/test/dummy_via.erl
@@ -50,8 +50,10 @@ call(Req) ->
{'DOWN', MRef, _, _, _} ->
erlang:error(badarg);
{MRef, badarg} ->
+ erlang:demonitor(MRef),
erlang:error(badarg);
{MRef, Reply} ->
+ erlang:demonitor(MRef),
Reply
after 5000 ->
erlang:error(timeout)
diff --git a/lib/stdlib/test/edlin_expand_SUITE.erl b/lib/stdlib/test/edlin_expand_SUITE.erl
index b0a07a95a3..a53c5333d8 100644
--- a/lib/stdlib/test/edlin_expand_SUITE.erl
+++ b/lib/stdlib/test/edlin_expand_SUITE.erl
@@ -19,26 +19,21 @@
%%
-module(edlin_expand_SUITE).
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
+ init_per_testcase/2, end_per_testcase/2,
init_per_group/2,end_per_group/2]).
-
-export([normal/1, quoted_fun/1, quoted_module/1, quoted_both/1]).
--export([init_per_testcase/2, end_per_testcase/2]).
-
-include_lib("common_test/include/ct.hrl").
-%% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[normal, quoted_fun, quoted_module, quoted_both].
@@ -63,10 +58,6 @@ end_per_group(_GroupName, Config) ->
Config.
-normal(doc) ->
- [""];
-normal(suite) ->
- [];
normal(Config) when is_list(Config) ->
{module,expand_test} = c:l(expand_test),
%% These tests might fail if another module with the prefix
@@ -85,10 +76,7 @@ normal(Config) when is_list(Config) ->
{yes,"arity_entirely()",[]} = do_expand("expand_test:expand0"),
ok.
-quoted_fun(doc) ->
- ["Normal module name, some function names using quoted atoms"];
-quoted_fun(suite) ->
- [];
+%% Normal module name, some function names using quoted atoms.
quoted_fun(Config) when is_list(Config) ->
{module,expand_test} = c:l(expand_test),
{module,expand_test1} = c:l(expand_test1),
@@ -121,10 +109,6 @@ quoted_fun(Config) when is_list(Config) ->
{yes,"(",[]} = do_expand("expand_test:module_info"),
ok.
-quoted_module(doc) ->
- [""];
-quoted_module(suite) ->
- [];
quoted_module(Config) when is_list(Config) ->
{module,'ExpandTestCaps'} = c:l('ExpandTestCaps'),
{yes, "Caps':", []} = do_expand("'ExpandTest"),
@@ -138,8 +122,6 @@ quoted_module(Config) when is_list(Config) ->
{"a_less_fun_name",1}]} = do_expand("'ExpandTestCaps':a_"),
ok.
-quoted_both(suite) ->
- [];
quoted_both(Config) when is_list(Config) ->
{module,'ExpandTestCaps'} = c:l('ExpandTestCaps'),
{module,'ExpandTestCaps1'} = c:l('ExpandTestCaps1'),
diff --git a/lib/stdlib/test/epp_SUITE.erl b/lib/stdlib/test/epp_SUITE.erl
index 0c00e104b7..3e1aaef378 100644
--- a/lib/stdlib/test/epp_SUITE.erl
+++ b/lib/stdlib/test/epp_SUITE.erl
@@ -34,7 +34,7 @@
%%
%% Define to run outside of test server
%%
-%-define(STANDALONE,1).
+%%-define(STANDALONE,1).
-ifdef(STANDALONE).
-compile(export_all).
@@ -50,19 +50,16 @@ config(data_dir, _) ->
-include_lib("common_test/include/ct.hrl").
-export([init_per_testcase/2, end_per_testcase/2]).
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
init_per_testcase(_, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
-end_per_testcase(_, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_, _Config) ->
ok.
-endif.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[rec_1, {group, upcase_mac}, include_local, predef_mac,
@@ -88,33 +85,26 @@ init_per_group(_GroupName, Config) ->
end_per_group(_GroupName, Config) ->
Config.
-rec_1(doc) ->
- ["Recursive macros hang or crash epp (OTP-1398)."];
-rec_1(suite) ->
- [];
+%% Recursive macros hang or crash epp (OTP-1398).
rec_1(Config) when is_list(Config) ->
- ?line File = filename:join(?config(data_dir, Config), "mac.erl"),
- ?line {ok, List} = epp_parse_file(File, [], []),
+ File = filename:join(proplists:get_value(data_dir, Config), "mac.erl"),
+ {ok, List} = epp_parse_file(File, [], []),
%% we should encounter errors
- ?line {value, _} = lists:keysearch(error, 1, List),
- ?line check_errors(List),
+ {value, _} = lists:keysearch(error, 1, List),
+ check_errors(List),
ok.
-include_local(doc) ->
- [];
-include_local(suite) ->
- [];
include_local(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line File = filename:join(DataDir, "include_local.erl"),
+ DataDir = proplists:get_value(data_dir, Config),
+ File = filename:join(DataDir, "include_local.erl"),
FooHrl = filename:join([DataDir,"include","foo.hrl"]),
BarHrl = filename:join([DataDir,"include","bar.hrl"]),
%% include_local.erl includes include/foo.hrl which
%% includes bar.hrl (also in include/) without requiring
%% any additional include path, and overriding any file
%% of the same name that the path points to
- ?line {ok, List} = epp:parse_file(File, [DataDir], []),
- ?line {value, {attribute,_,a,{true,true}}} =
+ {ok, List} = epp:parse_file(File, [DataDir], []),
+ {value, {attribute,_,a,{true,true}}} =
lists:keysearch(a,3,List),
[{File,1},{FooHrl,1},{BarHrl,1},{FooHrl,5},{File,5}] =
[ FileLine || {attribute,_,file,FileLine} <- List ],
@@ -170,108 +160,86 @@ epp_parse_erl_form(Epp, Parent) ->
check_errors([]) ->
ok;
check_errors([{error, Info} | Rest]) ->
- ?line {Line, Mod, Desc} = Info,
- ?line case Line of
- I when is_integer(I) -> ok;
- {L,C} when is_integer(L), is_integer(C), C >= 1 -> ok
- end,
- ?line Str = lists:flatten(Mod:format_error(Desc)),
- ?line [Str] = io_lib:format("~s", [Str]),
+ {Line, Mod, Desc} = Info,
+ case Line of
+ I when is_integer(I) -> ok;
+ {L,C} when is_integer(L), is_integer(C), C >= 1 -> ok
+ end,
+ Str = lists:flatten(Mod:format_error(Desc)),
+ [Str] = io_lib:format("~s", [Str]),
check_errors(Rest);
check_errors([_ | Rest]) ->
check_errors(Rest).
-upcase_mac_1(doc) ->
- [];
-upcase_mac_1(suite) ->
- [];
upcase_mac_1(Config) when is_list(Config) ->
- ?line File = filename:join(?config(data_dir, Config), "mac2.erl"),
- ?line {ok, List} = epp:parse_file(File, [], []),
- ?line [_, {attribute, _, plupp, Tuple} | _] = List,
- ?line Tuple = {1, 1, 3, 3},
+ File = filename:join(proplists:get_value(data_dir, Config), "mac2.erl"),
+ {ok, List} = epp:parse_file(File, [], []),
+ [_, {attribute, _, plupp, Tuple} | _] = List,
+ Tuple = {1, 1, 3, 3},
ok.
-upcase_mac_2(doc) ->
- [];
-upcase_mac_2(suite) ->
- [];
upcase_mac_2(Config) when is_list(Config) ->
- ?line File = filename:join(?config(data_dir, Config), "mac2.erl"),
- ?line {ok, List} = epp:parse_file(File, [], [{p, 5}, {'P', 6}]),
- ?line [_, {attribute, _, plupp, Tuple} | _] = List,
- ?line Tuple = {5, 5, 6, 6},
+ File = filename:join(proplists:get_value(data_dir, Config), "mac2.erl"),
+ {ok, List} = epp:parse_file(File, [], [{p, 5}, {'P', 6}]),
+ [_, {attribute, _, plupp, Tuple} | _] = List,
+ Tuple = {5, 5, 6, 6},
ok.
-predef_mac(doc) ->
- [];
-predef_mac(suite) ->
- [];
predef_mac(Config) when is_list(Config) ->
- ?line File = filename:join(?config(data_dir, Config), "mac3.erl"),
- ?line {ok, List} = epp:parse_file(File, [], []),
- ?line [_,
- {attribute, Anno, l, Line1},
- {attribute, _, f, File},
- {attribute, _, machine1, _},
- {attribute, _, module, mac3},
- {attribute, _, m, mac3},
- {attribute, _, ms, "mac3"},
- {attribute, _, machine2, _}
- | _] = List,
+ File = filename:join(proplists:get_value(data_dir, Config), "mac3.erl"),
+ {ok, List} = epp:parse_file(File, [], []),
+ [_,
+ {attribute, Anno, l, Line1},
+ {attribute, _, f, File},
+ {attribute, _, machine1, _},
+ {attribute, _, module, mac3},
+ {attribute, _, m, mac3},
+ {attribute, _, ms, "mac3"},
+ {attribute, _, machine2, _}
+ | _] = List,
Line1 = erl_anno:line(Anno),
ok.
-variable_1(doc) ->
- [];
-variable_1(suite) ->
- [];
variable_1(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line File = filename:join(DataDir, "variable_1.erl"),
- ?line true = os:putenv("VAR", DataDir),
+ DataDir = proplists:get_value(data_dir, Config),
+ File = filename:join(DataDir, "variable_1.erl"),
+ true = os:putenv("VAR", DataDir),
%% variable_1.erl includes variable_1_include.hrl and
%% variable_1_include_dir.hrl.
- ?line {ok, List} = epp:parse_file(File, [], []),
- ?line {value, {attribute,_,a,{value1,value2}}} =
+ {ok, List} = epp:parse_file(File, [], []),
+ {value, {attribute,_,a,{value1,value2}}} =
lists:keysearch(a,3,List),
ok.
-otp_4870(doc) ->
- ["undef without module declaration"];
-otp_4870(suite) ->
- [];
+%% undef without module declaration.
otp_4870(Config) when is_list(Config) ->
Ts = [{otp_4870,
<<"-undef(foo).
">>,
[]}],
- ?line [] = check(Config, Ts),
+ [] = check(Config, Ts),
ok.
-otp_4871(doc) ->
- ["crashing erl_scan"];
-otp_4871(suite) ->
- [];
+%% crashing erl_scan
otp_4871(Config) when is_list(Config) ->
- ?line Dir = ?config(priv_dir, Config),
- ?line File = filename:join(Dir, "otp_4871.erl"),
- ?line ok = file:write_file(File, "-module(otp_4871)."),
+ Dir = proplists:get_value(priv_dir, Config),
+ File = filename:join(Dir, "otp_4871.erl"),
+ ok = file:write_file(File, "-module(otp_4871)."),
%% Testing crash in erl_scan. Unfortunately there currently is
%% no known way to crash erl_scan so it is emulated by killing the
%% file io server. This assumes lots of things about how
%% the processes are started and how monitors are set up,
%% so there are some sanity checks before killing.
- ?line {ok,Epp} = epp:open(File, []),
+ {ok,Epp} = epp:open(File, []),
timer:sleep(1),
- ?line true = current_module(Epp, epp),
- ?line {monitored_by,[Io]} = process_info(Epp, monitored_by),
- ?line true = current_module(Io, file_io_server),
- ?line exit(Io, emulate_crash),
+ true = current_module(Epp, epp),
+ {monitored_by,[Io]} = process_info(Epp, monitored_by),
+ true = current_module(Io, file_io_server),
+ exit(Io, emulate_crash),
timer:sleep(1),
- ?line {error,{_Line,epp,cannot_parse}} = otp_4871_parse_file(Epp),
- ?line epp:close(Epp),
+ {error,{_Line,epp,cannot_parse}} = otp_4871_parse_file(Epp),
+ epp:close(Epp),
ok.
current_module(Pid, Mod) ->
@@ -288,12 +256,9 @@ otp_4871_parse_file(Epp) ->
Other -> Other
end.
-otp_5362(doc) ->
- ["OTP-5362. The -file attribute is recognized."];
-otp_5362(suite) ->
- [];
+%% OTP-5362. The -file attribute is recognized.
otp_5362(Config) when is_list(Config) ->
- Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
Copts = [return, strong_validation,{i,Dir}],
@@ -317,12 +282,12 @@ otp_5362(Config) when is_list(Config) ->
Incl3 = <<"glurk(Foo) -> % line 1
bar.
">>,
- ?line ok = file:write_file(File_Incl, Incl),
- ?line ok = file:write_file(File_Incl2, Incl2),
- ?line ok = file:write_file(File_Incl3, Incl3),
+ ok = file:write_file(File_Incl, Incl),
+ ok = file:write_file(File_Incl2, Incl2),
+ ok = file:write_file(File_Incl3, Incl3),
- ?line {ok, incl_5362, InclWarnings} = compile:file(File_Incl, Copts),
- ?line true = message_compare(
+ {ok, incl_5362, InclWarnings} = compile:file(File_Incl, Copts),
+ true = message_compare(
[{File_Incl3,[{{1,1},erl_lint,{unused_function,{glurk,1}}},
{{1,7},erl_lint,{unused_var,'Foo'}}]},
{File_Incl,[{{7,15},erl_lint,{unused_function,{hi,1}}},
@@ -352,11 +317,11 @@ otp_5362(Config) when is_list(Config) ->
-file(\"">>,File_Back,<<"\", 2).
">>],
- ?line ok = file:write_file(File_Back, Back),
- ?line ok = file:write_file(File_Back_hrl, list_to_binary(Back_hrl)),
+ ok = file:write_file(File_Back, Back),
+ ok = file:write_file(File_Back_hrl, list_to_binary(Back_hrl)),
- ?line {ok, back_5362, BackWarnings} = compile:file(File_Back, Copts),
- ?line true = message_compare(
+ {ok, back_5362, BackWarnings} = compile:file(File_Back, Copts),
+ true = message_compare(
[{File_Back,[{{4,19},erl_lint,{unused_var,'V'}}]}],
BackWarnings),
file:delete(File_Back),
@@ -380,11 +345,11 @@ otp_5362(Config) when is_list(Config) ->
foo.
">>],
- ?line ok = file:write_file(File_Change, list_to_binary(Change)),
+ ok = file:write_file(File_Change, list_to_binary(Change)),
- ?line {ok, change_5362, ChangeWarnings} =
+ {ok, change_5362, ChangeWarnings} =
compile:file(File_Change, Copts),
- ?line true = message_compare(
+ true = message_compare(
[{File_Change,[{{1002,21},erl_lint,{unused_var,'B'}}]},
{"other.file",[{{105,21},erl_lint,{unused_var,'A'}}]}],
lists:usort(ChangeWarnings)),
@@ -412,9 +377,9 @@ otp_5362(Config) when is_list(Config) ->
-file(?FILE, ?LINE). c(C) -> % line 47
3.
">>,
- ?line ok = file:write_file(File_Blank, Blank),
- ?line {ok, blank_5362, BlankWarnings} = compile:file(File_Blank, Copts),
- ?line true = message_compare(
+ ok = file:write_file(File_Blank, Blank),
+ {ok, blank_5362, BlankWarnings} = compile:file(File_Blank, Copts),
+ true = message_compare(
[{File_Blank,[{{18,3},erl_lint,{unused_var,'Q'}},
{{20,18},erl_lint,{unused_var,'A'}},
{{44,18},erl_lint,{unused_var,'B'}},
@@ -438,16 +403,16 @@ otp_5362(Config) when is_list(Config) ->
FILE1 = <<"ii() -> ?FILE.
">>,
FILE_Mod = file_5362,
- ?line ok = file:write_file(FILE_incl, FILE),
- ?line ok = file:write_file(FILE_incl1, FILE1),
+ ok = file:write_file(FILE_incl, FILE),
+ ok = file:write_file(FILE_incl1, FILE1),
FILE_Copts = [return, {i,Dir},{outdir,Dir}],
- ?line {ok, file_5362, []} = compile:file(FILE_incl, FILE_Copts),
+ {ok, file_5362, []} = compile:file(FILE_incl, FILE_Copts),
AbsFile = filename:rootname(FILE_incl, ".erl"),
- ?line {module, FILE_Mod} = code:load_abs(AbsFile, FILE_Mod),
- ?line II = FILE_Mod:ii(),
- ?line "file_incl_5362.erl" = filename:basename(II),
- ?line FF = FILE_Mod:ff(),
- ?line "other_file" = filename:basename(FF),
+ {module, FILE_Mod} = code:load_abs(AbsFile, FILE_Mod),
+ II = FILE_Mod:ii(),
+ "file_incl_5362.erl" = filename:basename(II),
+ FF = FILE_Mod:ff(),
+ "other_file" = filename:basename(FF),
code:purge(file_5362),
file:delete(FILE_incl),
@@ -456,12 +421,12 @@ otp_5362(Config) when is_list(Config) ->
ok.
pmod(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line Pmod = filename:join(DataDir, "pmod.erl"),
- ?line case epp:parse_file([Pmod], [], []) of
+ DataDir = proplists:get_value(data_dir, Config),
+ Pmod = filename:join(DataDir, "pmod.erl"),
+ case epp:parse_file([Pmod], [], []) of
{ok,Forms} ->
- %% ?line io:format("~p\n", [Forms]),
- ?line [] = [F || {error,_}=F <- Forms],
+ %% io:format("~p\n", [Forms]),
+ [] = [F || {error,_}=F <- Forms],
ok
end,
ok.
@@ -474,17 +439,14 @@ not_circular(Config) when is_list(Config) ->
<<"-define(S(S), ??S).\n"
"t() -> \"string\" = ?S(string), ok.\n">>,
ok}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-skip_header(doc) ->
- ["Skip some bytes in the beginning of the file."];
-skip_header(suite) ->
- [];
+%% Skip some bytes in the beginning of the file.
skip_header(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line File = filename:join([PrivDir, "epp_test_skip_header.erl"]),
- ?line ok = file:write_file(File,
+ PrivDir = proplists:get_value(priv_dir, Config),
+ File = filename:join([PrivDir, "epp_test_skip_header.erl"]),
+ ok = file:write_file(File,
<<"some bytes
in the beginning of the file
that should be skipped
@@ -494,23 +456,20 @@ skip_header(Config) when is_list(Config) ->
main(_) -> ?MODULE.
">>),
- ?line {ok, Fd} = file:open(File, [read]),
- ?line io:get_line(Fd, ''),
- ?line io:get_line(Fd, ''),
- ?line io:get_line(Fd, ''),
- ?line {ok, Epp} = epp:open(list_to_atom(File), Fd, 4, [], []),
-
- ?line Forms = epp:parse_file(Epp),
- ?line [] = [Reason || {error, Reason} <- Forms],
- ?line ok = epp:close(Epp),
- ?line ok = file:close(Fd),
+ {ok, Fd} = file:open(File, [read]),
+ io:get_line(Fd, ''),
+ io:get_line(Fd, ''),
+ io:get_line(Fd, ''),
+ {ok, Epp} = epp:open(list_to_atom(File), Fd, 4, [], []),
+
+ Forms = epp:parse_file(Epp),
+ [] = [Reason || {error, Reason} <- Forms],
+ ok = epp:close(Epp),
+ ok = file:close(Fd),
ok.
-otp_6277(doc) ->
- ["?MODULE before module declaration."];
-otp_6277(suite) ->
- [];
+%% ?MODULE before module declaration.
otp_6277(Config) when is_list(Config) ->
Ts = [{otp_6277,
<<"-undef(ASSERT).
@@ -518,15 +477,12 @@ otp_6277(Config) when is_list(Config) ->
?ASSERT().">>,
[{error,{{4,16},epp,{undefined,'MODULE', none}}}]}],
- ?line [] = check(Config, Ts),
+ [] = check(Config, Ts),
ok.
-otp_7702(doc) ->
- ["OTP-7702. Wrong line number in stringifying macro expansion."];
-otp_7702(suite) ->
- [];
+%% OTP-7702. Wrong line number in stringifying macro expansion.
otp_7702(Config) when is_list(Config) ->
- Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
File = filename:join(Dir, "file_7702.erl"),
Contents = <<"-module(file_7702).
@@ -542,8 +498,8 @@ otp_7702(Config) when is_list(Config) ->
end).
t() ->
?RECEIVE(foo, bar).">>,
- ?line ok = file:write_file(File, Contents),
- ?line {ok, file_7702, []} =
+ ok = file:write_file(File, Contents),
+ {ok, file_7702, []} =
compile:file(File, [debug_info,return,{outdir,Dir}]),
BeamFile = filename:join(Dir, "file_7702.beam"),
@@ -551,8 +507,7 @@ otp_7702(Config) when is_list(Config) ->
{file_7702,[{abstract_code,{_,Forms}}]} = AC,
Forms2 = unopaque_forms(Forms),
- ?line
- [{attribute,1,file,_},
+ [{attribute,1,file,_},
_,
_,
{function,_,t,0,
@@ -586,10 +541,7 @@ otp_7702(Config) when is_list(Config) ->
ok.
-otp_8130(doc) ->
- ["OTP-8130. Misc tests."];
-otp_8130(suite) ->
- [];
+%% OTP-8130. Misc tests.
otp_8130(Config) when is_list(Config) ->
true = os:putenv("epp_inc1", "stdlib"),
Ts = [{otp_8130_1,
@@ -689,7 +641,7 @@ otp_8130(Config) when is_list(Config) ->
{1,1}}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
Cs = [{otp_8130_c1,
<<"-define(M1(A), if\n"
@@ -823,7 +775,7 @@ otp_8130(Config) when is_list(Config) ->
{{3,19},epp,{undefined,'A',none}}],[]}}
],
- ?line [] = compile(Config, Cs),
+ [] = compile(Config, Cs),
Cks = [{otp_check_1,
<<"\n-include_lib(\"epp_test.erl\").\n">>,
@@ -833,25 +785,25 @@ otp_8130(Config) when is_list(Config) ->
<<"\n-include(\"epp_test.erl\").\n">>,
[{error,{{2,2},epp,{depth,"include"}}}]}
],
- ?line [] = check(Config, Cks),
+ [] = check(Config, Cks),
- ?line Dir = ?config(priv_dir, Config),
- ?line File = filename:join(Dir, "otp_8130.erl"),
- ?line ok = file:write_file(File,
+ Dir = proplists:get_value(priv_dir, Config),
+ File = filename:join(Dir, "otp_8130.erl"),
+ ok = file:write_file(File,
"-module(otp_8130).\n"
"-define(a, 3.14).\n"
"t() -> ?a.\n"),
- ?line {ok,Epp} = epp:open(File, []),
+ {ok,Epp} = epp:open(File, []),
PreDefMacs = macs(Epp),
['BASE_MODULE','BASE_MODULE_STRING','BEAM','FILE',
'FUNCTION_ARITY','FUNCTION_NAME',
'LINE','MACHINE','MODULE','MODULE_STRING'] = PreDefMacs,
- ?line {ok,[{'-',_},{atom,_,file}|_]} = epp:scan_erl_form(Epp),
- ?line {ok,[{'-',_},{atom,_,module}|_]} = epp:scan_erl_form(Epp),
- ?line {ok,[{atom,_,t}|_]} = epp:scan_erl_form(Epp),
- ?line {eof,_} = epp:scan_erl_form(Epp),
+ {ok,[{'-',_},{atom,_,file}|_]} = epp:scan_erl_form(Epp),
+ {ok,[{'-',_},{atom,_,module}|_]} = epp:scan_erl_form(Epp),
+ {ok,[{atom,_,t}|_]} = epp:scan_erl_form(Epp),
+ {eof,_} = epp:scan_erl_form(Epp),
[a] = macs(Epp) -- PreDefMacs,
- ?line epp:close(Epp),
+ epp:close(Epp),
%% escript
ModuleStr = "any_name",
@@ -860,27 +812,27 @@ otp_8130(Config) when is_list(Config) ->
PreDefMacros = [{'MODULE', Module, redefine},
{'MODULE_STRING', ModuleStr, redefine},
a, {b,2}],
- ?line {ok,Epp2} = epp:open(File, [], PreDefMacros),
- ?line [{atom,_,true}] = macro(Epp2, a),
- ?line [{integer,_,2}] = macro(Epp2, b),
- ?line false = macro(Epp2, c),
- ?line epp:close(Epp2)
+ {ok,Epp2} = epp:open(File, [], PreDefMacros),
+ [{atom,_,true}] = macro(Epp2, a),
+ [{integer,_,2}] = macro(Epp2, b),
+ false = macro(Epp2, c),
+ epp:close(Epp2)
end(),
fun() ->
PreDefMacros = [{a,b,c}],
- ?line {error,{bad,{a,b,c}}} = epp:open(File, [], PreDefMacros)
+ {error,{bad,{a,b,c}}} = epp:open(File, [], PreDefMacros)
end(),
fun() ->
PreDefMacros = [a, {a,1}],
- ?line {error,{redefine,a}} = epp:open(File, [], PreDefMacros)
+ {error,{redefine,a}} = epp:open(File, [], PreDefMacros)
end(),
fun() ->
PreDefMacros = [{a,1},a],
- ?line {error,{redefine,a}} = epp:open(File, [], PreDefMacros)
+ {error,{redefine,a}} = epp:open(File, [], PreDefMacros)
end(),
- ?line {error,enoent} = epp:open("no such file", []),
- ?line {error,enoent} = epp:parse_file("no such file", [], []),
+ {error,enoent} = epp:open("no such file", []),
+ {error,enoent} = epp:parse_file("no such file", [], []),
_ = ifdef(Config),
@@ -1020,7 +972,7 @@ ifdef(Config) ->
"t() -> a.\n">>,
{errors,[{{2,2},epp,{'NYI','if'}}],[]}}
],
- ?line [] = compile(Config, Cs),
+ [] = compile(Config, Cs),
Ts = [{ifdef_1,
<<"-ifdef(a).\n"
@@ -1101,14 +1053,11 @@ ifdef(Config) ->
ok}
],
- ?line [] = run(Config, Ts).
+ [] = run(Config, Ts).
-overload_mac(doc) ->
- ["Advanced test on overloading macros."];
-overload_mac(suite) ->
- [];
+%% Advanced test on overloading macros.
overload_mac(Config) when is_list(Config) ->
Cs = [
%% '-undef' removes all definitions of a macro
@@ -1139,7 +1088,7 @@ overload_mac(Config) when is_list(Config) ->
"t() -> ?A(1).">>,
{errors,[{{4,9},epp,{mismatch,'A'}}],[]}}
],
- ?line [] = compile(Config, Cs),
+ [] = compile(Config, Cs),
Ts = [
{overload_mac_r1,
@@ -1163,27 +1112,24 @@ overload_mac(Config) when is_list(Config) ->
"t() -> ?A(1).">>,
1}
],
- ?line [] = run(Config, Ts).
+ [] = run(Config, Ts).
-otp_8388(doc) ->
- ["OTP-8388. More tests on overloaded macros."];
-otp_8388(suite) ->
- [];
+%% OTP-8388. More tests on overloaded macros.
otp_8388(Config) when is_list(Config) ->
- Dir = ?config(priv_dir, Config),
- ?line File = filename:join(Dir, "otp_8388.erl"),
- ?line ok = file:write_file(File, <<"-module(otp_8388)."
+ Dir = proplists:get_value(priv_dir, Config),
+ File = filename:join(Dir, "otp_8388.erl"),
+ ok = file:write_file(File, <<"-module(otp_8388)."
"-define(LINE, a).">>),
fun() ->
PreDefMacros = [{'LINE', a}],
- ?line {error,{redefine_predef,'LINE'}} =
+ {error,{redefine_predef,'LINE'}} =
epp:open(File, [], PreDefMacros)
end(),
fun() ->
PreDefMacros = ['LINE'],
- ?line {error,{redefine_predef,'LINE'}} =
+ {error,{redefine_predef,'LINE'}} =
epp:open(File, [], PreDefMacros)
end(),
@@ -1213,28 +1159,22 @@ otp_8388(Config) when is_list(Config) ->
"test() -> ?BAR(1).\n">>,
{errors,[{{4,12},epp,{undefined,'FOO',1}}],[]}}
],
- ?line [] = compile(Config, Ts),
+ [] = compile(Config, Ts),
ok.
-otp_8470(doc) ->
- ["OTP-8470. Bugfix (one request - two replies)."];
-otp_8470(suite) ->
- [];
+%% OTP-8470. Bugfix (one request - two replies).
otp_8470(Config) when is_list(Config) ->
- Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
C = <<"-file(\"erl_parse.yrl\", 486).\n"
"-file(\"erl_parse.yrl\", 488).\n">>,
- ?line File = filename:join(Dir, "otp_8470.erl"),
- ?line ok = file:write_file(File, C),
- ?line {ok, _List} = epp:parse_file(File, [], []),
+ File = filename:join(Dir, "otp_8470.erl"),
+ ok = file:write_file(File, C),
+ {ok, _List} = epp:parse_file(File, [], []),
file:delete(File),
- ?line receive _ -> fail() after 0 -> ok end,
+ receive _ -> fail() after 0 -> ok end,
ok.
-otp_8562(doc) ->
- ["OTP-8562. Record with no fields is considered typed."];
-otp_8562(suite) ->
- [];
+%% OTP-8562. Record with no fields is considered typed.
otp_8562(Config) when is_list(Config) ->
Cs = [{otp_8562,
<<"-define(P(), {a,b}.\n"
@@ -1242,13 +1182,10 @@ otp_8562(Config) when is_list(Config) ->
{errors,[{{1,60},epp,missing_parenthesis},
{{2,13},epp,missing_parenthesis}], []}}
],
- ?line [] = compile(Config, Cs),
+ [] = compile(Config, Cs),
ok.
-otp_8911(doc) ->
- ["OTP-8911. -file and file inclusion bug"];
-otp_8911(suite) ->
- [];
+%% OTP-8911. -file and file inclusion bug.
otp_8911(Config) when is_list(Config) ->
case test_server:is_cover() of
true ->
@@ -1257,8 +1194,8 @@ otp_8911(Config) when is_list(Config) ->
do_otp_8911(Config)
end.
do_otp_8911(Config) ->
- ?line {ok, CWD} = file:get_cwd(),
- ?line ok = file:set_cwd(?config(priv_dir, Config)),
+ {ok, CWD} = file:get_cwd(),
+ ok = file:set_cwd(proplists:get_value(priv_dir, Config)),
File = "i.erl",
Cont = <<"-module(i).
@@ -1268,40 +1205,34 @@ do_otp_8911(Config) ->
t() ->
a.
">>,
- ?line ok = file:write_file(File, Cont),
+ ok = file:write_file(File, Cont),
Incl = <<"-file(\"fil2\", 35).
t1() ->
b.
">>,
File1 = "i1.erl",
- ?line ok = file:write_file(File1, Incl),
+ ok = file:write_file(File1, Incl),
- ?line {ok, i} = cover:compile(File),
- ?line a = i:t(),
- ?line {ok,[{{i,6},1}]} = cover:analyse(i, calls, line),
- ?line cover:stop(),
+ {ok, i} = cover:compile(File),
+ a = i:t(),
+ {ok,[{{i,6},1}]} = cover:analyse(i, calls, line),
+ cover:stop(),
file:delete(File),
file:delete(File1),
- ?line file:set_cwd(CWD),
+ file:set_cwd(CWD),
ok.
-otp_8665(doc) ->
- ["OTP-8665. Bugfix premature end."];
-otp_8665(suite) ->
- [];
+%% OTP-8665. Bugfix premature end.
otp_8665(Config) when is_list(Config) ->
Cs = [{otp_8562,
<<"-define(A, a)\n">>,
{errors,[{{1,54},epp,premature_end}],[]}}
],
- ?line [] = compile(Config, Cs),
+ [] = compile(Config, Cs),
ok.
-otp_10302(doc) ->
- "OTP-10302. Unicode characters scanner/parser.";
-otp_10302(suite) ->
- [];
+%% OTP-10302. Unicode characters scanner/parser.
otp_10302(Config) when is_list(Config) ->
%% Two messages (one too many). Keeps otp_4871 happy.
Cs = [{otp_8562,
@@ -1310,7 +1241,7 @@ otp_10302(Config) when is_list(Config) ->
{3,file_io_server,invalid_unicode}],[]}}
],
[] = compile(Config, Cs),
- Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
File = filename:join(Dir, "otp_10302.erl"),
utf8 = encoding("coding: utf-8", File),
utf8 = encoding("coding: UTF-8", File),
@@ -1372,13 +1303,10 @@ encoding_nocom(Enc, File) ->
ok = file:close(Fd),
E = epp:read_encoding(File, Options).
-otp_10820(doc) ->
- "OTP-10820. Unicode filenames.";
-otp_10820(suite) ->
- [];
+%% OTP-10820. Unicode filenames.
otp_10820(Config) when is_list(Config) ->
L = [915,953,959,973,957,953,954,959,957,964],
- Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
File = filename:join(Dir, L++".erl"),
C1 = <<"%% coding: utf-8\n -module(any).">>,
ok = do_otp_10820(File, C1, "+pc latin1"),
@@ -1397,12 +1325,9 @@ do_otp_10820(File, C, PC) ->
true = test_server:stop_node(Node),
ok.
-otp_11728(doc) ->
- ["OTP-11728. Bugfix circular macro."];
-otp_11728(suite) ->
- [];
+%% OTP-11728. Bugfix circular macro.
otp_11728(Config) when is_list(Config) ->
- Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
H = <<"-define(MACRO,[[]++?MACRO]).">>,
HrlFile = filename:join(Dir, "otp_11728.hrl"),
ok = file:write_file(HrlFile, H),
@@ -1424,7 +1349,7 @@ otp_11728(Config) when is_list(Config) ->
%% Check the new API for setting the default encoding.
encoding(Config) when is_list(Config) ->
- Dir = ?config(priv_dir, Config),
+ Dir = proplists:get_value(priv_dir, Config),
ErlFile = filename:join(Dir, "encoding.erl"),
%% Try a latin-1 file with no encoding given.
@@ -1592,7 +1517,7 @@ eval_tests(Config, Fun, Tests) ->
true ->
BadL;
false ->
- ?t:format("~nTest ~p failed. Expected~n ~p~n"
+ io:format("~nTest ~p failed. Expected~n ~p~n"
"but got~n ~p~n", [N, E, Return]),
fail()
end
@@ -1602,7 +1527,7 @@ eval_tests(Config, Fun, Tests) ->
check_test(Config, Test) ->
Filename = "epp_test.erl",
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
File = filename:join(PrivDir, Filename),
ok = file:write_file(File, Test),
case epp:parse_file(File, [PrivDir], []) of
@@ -1617,9 +1542,9 @@ check_test(Config, Test) ->
compile_test(Config, Test0) ->
Test = [<<"-module(epp_test). -compile(export_all). ">>, Test0],
Filename = "epp_test.erl",
- ?line PrivDir = ?config(priv_dir, Config),
- ?line File = filename:join(PrivDir, Filename),
- ?line ok = file:write_file(File, Test),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ File = filename:join(PrivDir, Filename),
+ ok = file:write_file(File, Test),
Opts = [export_all,return,nowarn_unused_record,{outdir,PrivDir}],
case compile_file(File, Opts) of
{ok, Ws} -> warnings(File, Ws);
@@ -1671,20 +1596,19 @@ unopaque_forms(Forms) ->
run_test(Config, Test0) ->
Test = [<<"-module(epp_test). -compile(export_all). ">>, Test0],
Filename = "epp_test.erl",
- ?line PrivDir = ?config(priv_dir, Config),
- ?line File = filename:join(PrivDir, Filename),
- ?line ok = file:write_file(File, Test),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ File = filename:join(PrivDir, Filename),
+ ok = file:write_file(File, Test),
Opts = [return, {i,PrivDir},{outdir,PrivDir}],
- ?line {ok, epp_test, []} = compile:file(File, Opts),
+ {ok, epp_test, []} = compile:file(File, Opts),
AbsFile = filename:rootname(File, ".erl"),
- ?line {module, epp_test} = code:load_abs(AbsFile, epp_test),
- ?line Reply = epp_test:t(),
+ {module, epp_test} = code:load_abs(AbsFile, epp_test),
+ Reply = epp_test:t(),
code:purge(epp_test),
Reply.
fail() ->
- io:format("failed~n"),
- test_server:fail().
+ ct:fail(failed).
message_compare(T, T) ->
true;
@@ -1718,5 +1642,5 @@ ln2(M) ->
%% +fnu means a peer node has to be started; slave will not do
start_node(Name, Xargs) ->
- ?line PA = filename:dirname(code:which(?MODULE)),
+ PA = filename:dirname(code:which(?MODULE)),
test_server:start_node(Name, peer, [{args, "-pa " ++ PA ++ " " ++ Xargs}]).
diff --git a/lib/stdlib/test/erl_anno_SUITE.erl b/lib/stdlib/test/erl_anno_SUITE.erl
index 79b27c6217..637a390c70 100644
--- a/lib/stdlib/test/erl_anno_SUITE.erl
+++ b/lib/stdlib/test/erl_anno_SUITE.erl
@@ -19,7 +19,7 @@
%%
-module(erl_anno_SUITE).
-%-define(debug, true).
+%%-define(debug, true).
-ifdef(debug).
-include_lib("common_test/include/ct.hrl").
@@ -46,7 +46,9 @@ groups() ->
line, location, record, text, bad]},
{parse, [], [parse_abstract, mapfold_anno]}].
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
init_per_suite(Config) ->
Config.
@@ -61,26 +63,21 @@ end_per_group(_GroupName, Config) ->
Config.
init_per_testcase(_Case, Config) ->
- Dog=?t:timetrap(?t:minutes(1)),
- [{watchdog, Dog}|Config].
+ Config.
end_per_testcase(_Case, _Config) ->
- Dog=?config(watchdog, _Config),
- test_server:timetrap_cancel(Dog),
ok.
-define(INFO(T, V), {T, V}).
-dialyzer({no_fail_call, new/1}).
-new(doc) ->
- ["Test erl_anno:new/1"];
+%% Test erl_anno:new/1.
new(_Config) ->
{'EXIT', {badarg, _}} =
(catch erl_anno:new([{location,1},{text, "text"}])), % badarg
ok.
-is_anno(doc) ->
- ["Test erl_anno:is_anno/1"];
+%% Test erl_anno:is_anno/1.
is_anno(_Config) ->
false = erl_anno:is_anno(a),
false = erl_anno:is_anno({a}),
@@ -106,8 +103,7 @@ is_anno(_Config) ->
true = erl_anno:is_anno(A5),
ok.
-generated(doc) ->
- ["Test 'generated'"];
+%% Test 'generated'.
generated(_Config) ->
test(1, [{generated, true}, {generated, false}]),
test(1, [{generated, false}, {generated, true}, {generated, false}]),
@@ -127,8 +123,7 @@ generated(_Config) ->
{generated, false}]),
ok.
-end_location(doc) ->
- ["Test 'end_location'"];
+%% Test 'end_location'.
end_location(_Config) ->
test({1, 17}, [{text, "TEXT", [{end_location, {1, 21}}, {length, 4}]},
{text, "TEXT\n", [{end_location, {2, 1}}, {length, 5}]},
@@ -138,23 +133,20 @@ end_location(_Config) ->
{text, "TEXT\ntxt", [{end_location, 2}, {length, 8}]}]),
ok.
-file(doc) ->
- ["Test 'file'"];
+%% Test 'file'.
file(_Config) ->
test(1, [{file, "name"}, {file, ""}]),
test({1, 17}, [{file, "name"}, {file, ""}]),
ok.
-line(doc) ->
- ["Test 'line'"];
+%% Test 'line'.
line(_Config) ->
test(1, [{line, 17, [{location, 17}]},
{location, {9, 8}, [{line, 9}, {column, 8}]},
{line, 14, [{location, {14, 8}}]}]),
ok.
-location(doc) ->
- ["Test 'location'"];
+%% Test 'location'.
location(_Config) ->
test(1, [{location, 2, [{line,2}]},
{location, {1, 17}, [{line, 1}, {column, 17}]},
@@ -172,8 +164,7 @@ location(_Config) ->
{location, 9, [{column, undefined}]}]),
ok.
-record(doc) ->
- ["Test 'record'"];
+%% Test 'record'.
record(_Config) ->
test({1, 17}, [{record, true}, {record, false}]),
test(1, [{record, true}, {record, false}]),
@@ -193,8 +184,7 @@ record(_Config) ->
{generated, false}]),
ok.
-text(doc) ->
- ["Test 'text'"];
+%% Test 'text'.
text(_Config) ->
test(1, [{text, "text", [{end_location, 1}, {length, 4}]},
{text, "", [{end_location, 1}, {length, 0}]}]),
@@ -203,8 +193,7 @@ text(_Config) ->
ok.
-dialyzer({[no_opaque, no_fail_call], bad/1}).
-bad(doc) ->
- ["Test bad annotations"];
+%% Test bad annotations.
bad(_Config) ->
Line = erl_anno:new(1),
LineColumn = erl_anno:new({1, 17}),
@@ -229,9 +218,8 @@ bad(_Config) ->
(catch erl_anno:record(bad)), % 1st arg not opaque
ok.
-parse_abstract(doc) ->
- ["Test erl_parse:new_anno/1, erl_parse:anno_to_term/1"
- ", and erl_parse:anno_from_term/1"];
+%% Test erl_parse:new_anno/1, erl_parse:anno_to_term/1,
+%% and erl_parse:anno_from_term/1.
parse_abstract(_Config) ->
T = sample_term(),
A = erl_parse:abstract(T, [{line,17}]),
@@ -242,8 +230,7 @@ parse_abstract(_Config) ->
T = erl_parse:normalise(Abstr2),
ok.
-mapfold_anno(doc) ->
- ["Test erl_parse:{map_anno/2,fold_anno/3, and mapfold_anno/3}"];
+%% Test erl_parse:{map_anno/2,fold_anno/3, and mapfold_anno/3}.
mapfold_anno(_Config) ->
T = sample_term(),
Abstr = erl_parse:abstract(T),
diff --git a/lib/stdlib/test/erl_eval_SUITE.erl b/lib/stdlib/test/erl_eval_SUITE.erl
index 1874ee1a1d..c3ef4eb051 100644
--- a/lib/stdlib/test/erl_eval_SUITE.erl
+++ b/lib/stdlib/test/erl_eval_SUITE.erl
@@ -19,6 +19,7 @@
-module(erl_eval_SUITE).
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
+ init_per_testcase/2, end_per_testcase/2,
init_per_group/2,end_per_group/2]).
-export([guard_1/1, guard_2/1,
@@ -65,19 +66,17 @@ config(priv_dir,_) ->
".".
-else.
-include_lib("common_test/include/ct.hrl").
--export([init_per_testcase/2, end_per_testcase/2]).
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
+-endif.
+
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
--endif.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[guard_1, guard_2, match_pattern, string_plusplus,
@@ -103,125 +102,101 @@ init_per_group(_GroupName, Config) ->
end_per_group(_GroupName, Config) ->
Config.
-guard_1(doc) ->
- ["(OTP-2405)"];
-guard_1(suite) ->
- [];
+%% OTP-2405
guard_1(Config) when is_list(Config) ->
- ?line {ok,Tokens ,_} =
+ {ok,Tokens ,_} =
erl_scan:string("if a+4 == 4 -> yes; true -> no end. "),
- ?line {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
- ?line no = guard_1_compiled(),
- ?line {value, no, []} = erl_eval:expr(Expr, []),
+ {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
+ no = guard_1_compiled(),
+ {value, no, []} = erl_eval:expr(Expr, []),
ok.
guard_1_compiled() ->
if a+4 == 4 -> yes; true -> no end.
-guard_2(doc) ->
- ["Similar to guard_1, but type-correct"];
-guard_2(suite) ->
- [];
+%% Similar to guard_1, but type-correct.
guard_2(Config) when is_list(Config) ->
- ?line {ok,Tokens ,_} =
+ {ok,Tokens ,_} =
erl_scan:string("if 6+4 == 4 -> yes; true -> no end. "),
- ?line {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
- ?line no = guard_2_compiled(),
- ?line {value, no, []} = erl_eval:expr(Expr, []),
+ {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
+ no = guard_2_compiled(),
+ {value, no, []} = erl_eval:expr(Expr, []),
ok.
guard_2_compiled() ->
if 6+4 == 4 -> yes; true -> no end.
-string_plusplus(doc) ->
- ["OTP-3069: syntactic sugar string ++ ..."];
-string_plusplus(suite) ->
- [];
+%% OTP-3069: syntactic sugar string ++ ...
string_plusplus(Config) when is_list(Config) ->
- ?line check(fun() -> case "abc" of "ab" ++ L -> L end end,
- "case \"abc\" of \"ab\" ++ L -> L end. ",
- "c"),
- ?line check(fun() -> case "abcde" of "ab" ++ "cd" ++ L -> L end end,
- "case \"abcde\" of \"ab\" ++ \"cd\" ++ L -> L end. ",
- "e"),
- ?line check(fun() -> case "abc" of [97, 98] ++ L -> L end end,
- "case \"abc\" of [97, 98] ++ L -> L end. ",
- "c"),
+ check(fun() -> case "abc" of "ab" ++ L -> L end end,
+ "case \"abc\" of \"ab\" ++ L -> L end. ",
+ "c"),
+ check(fun() -> case "abcde" of "ab" ++ "cd" ++ L -> L end end,
+ "case \"abcde\" of \"ab\" ++ \"cd\" ++ L -> L end. ",
+ "e"),
+ check(fun() -> case "abc" of [97, 98] ++ L -> L end end,
+ "case \"abc\" of [97, 98] ++ L -> L end. ",
+ "c"),
ok.
-match_pattern(doc) ->
- ["OTP-2983: match operator in pattern"];
-match_pattern(suite) ->
- [];
+%% OTP-2983: match operator in pattern.
match_pattern(Config) when is_list(Config) ->
- ?line check(fun() -> case {a, b} of {a, _X}=Y -> {x,Y} end end,
- "case {a, b} of {a, X}=Y -> {x,Y} end. ",
- {x, {a, b}}),
- ?line check(fun() -> case {a, b} of Y={a, _X} -> {x,Y} end end,
- "case {a, b} of Y={a, X} -> {x,Y} end. ",
- {x, {a, b}}),
- ?line check(fun() -> case {a, b} of Y={a, _X}=Z -> {Z,Y} end end,
- "case {a, b} of Y={a, X}=Z -> {Z,Y} end. ",
- {{a, b}, {a, b}}),
- ?line check(fun() -> A = 4, B = 28, <<13:(A+(X=B))>>, X end,
- "begin A = 4, B = 28, <<13:(A+(X=B))>>, X end.",
- 28),
+ check(fun() -> case {a, b} of {a, _X}=Y -> {x,Y} end end,
+ "case {a, b} of {a, X}=Y -> {x,Y} end. ",
+ {x, {a, b}}),
+ check(fun() -> case {a, b} of Y={a, _X} -> {x,Y} end end,
+ "case {a, b} of Y={a, X} -> {x,Y} end. ",
+ {x, {a, b}}),
+ check(fun() -> case {a, b} of Y={a, _X}=Z -> {Z,Y} end end,
+ "case {a, b} of Y={a, X}=Z -> {Z,Y} end. ",
+ {{a, b}, {a, b}}),
+ check(fun() -> A = 4, B = 28, <<13:(A+(X=B))>>, X end,
+ "begin A = 4, B = 28, <<13:(A+(X=B))>>, X end.",
+ 28),
ok.
-match_bin(doc) ->
- ["binary match problems"];
-match_bin(suite) ->
- [];
+%% Binary match problems.
match_bin(Config) when is_list(Config) ->
- ?line check(fun() -> <<"abc">> = <<"abc">> end,
- "<<\"abc\">> = <<\"abc\">>. ",
- <<"abc">>),
- ?line check(fun() ->
- <<Size,B:Size/binary,Rest/binary>> = <<2,"AB","CD">>,
- {Size,B,Rest}
- end,
- "begin <<Size,B:Size/binary,Rest/binary>> = <<2,\"AB\",\"CD\">>, "
- "{Size,B,Rest} end. ",
- {2,<<"AB">>,<<"CD">>}),
+ check(fun() -> <<"abc">> = <<"abc">> end,
+ "<<\"abc\">> = <<\"abc\">>. ",
+ <<"abc">>),
+ check(fun() ->
+ <<Size,B:Size/binary,Rest/binary>> = <<2,"AB","CD">>,
+ {Size,B,Rest}
+ end,
+ "begin <<Size,B:Size/binary,Rest/binary>> = <<2,\"AB\",\"CD\">>, "
+ "{Size,B,Rest} end. ",
+ {2,<<"AB">>,<<"CD">>}),
ok.
-pattern_expr(doc) ->
- ["OTP-3144: compile-time expressions in pattern"];
-pattern_expr(suite) ->
- [];
+%% OTP-3144: compile-time expressions in pattern.
pattern_expr(Config) when is_list(Config) ->
- ?line check(fun() -> case 4 of 2+2 -> ok end end,
- "case 4 of 2+2 -> ok end. ",
- ok),
- ?line check(fun() -> case 2 of +2 -> ok end end,
- "case 2 of +2 -> ok end. ",
- ok),
+ check(fun() -> case 4 of 2+2 -> ok end end,
+ "case 4 of 2+2 -> ok end. ",
+ ok),
+ check(fun() -> case 2 of +2 -> ok end end,
+ "case 2 of +2 -> ok end. ",
+ ok),
ok.
-guard_3(doc) ->
- ["OTP-4518."];
-guard_3(suite) ->
- [];
+%% OTP-4518.
guard_3(Config) when is_list(Config) ->
- ?line check(fun() -> if false -> false; true -> true end end,
- "if false -> false; true -> true end.",
- true),
- ?line check(fun() -> if <<"hej">> == <<"hopp">> -> true;
- true -> false end end,
- "begin if <<\"hej\">> == <<\"hopp\">> -> true;
+ check(fun() -> if false -> false; true -> true end end,
+ "if false -> false; true -> true end.",
+ true),
+ check(fun() -> if <<"hej">> == <<"hopp">> -> true;
+ true -> false end end,
+ "begin if <<\"hej\">> == <<\"hopp\">> -> true;
true -> false end end.",
false),
- ?line check(fun() -> if <<"hej">> == <<"hej">> -> true;
- true -> false end end,
- "begin if <<\"hej\">> == <<\"hej\">> -> true;
+ check(fun() -> if <<"hej">> == <<"hej">> -> true;
+ true -> false end end,
+ "begin if <<\"hej\">> == <<\"hej\">> -> true;
true -> false end end.",
true),
ok.
-guard_4(doc) ->
- ["OTP-4885."];
-guard_4(suite) ->
- [];
+%% OTP-4885.
guard_4(Config) when is_list(Config) ->
check(fun() -> if erlang:'+'(3,a) -> true ; true -> false end end,
"if erlang:'+'(3,a) -> true ; true -> false end.",
@@ -230,31 +205,28 @@ guard_4(Config) when is_list(Config) ->
end,
"if erlang:is_integer(3) -> true ; true -> false end.",
true),
- ?line check(fun() -> [X || X <- [1,2,3], erlang:is_integer(X)] end,
- "[X || X <- [1,2,3], erlang:is_integer(X)].",
- [1,2,3]),
- ?line check(fun() -> if is_atom(is_integer(a)) -> true ; true -> false end
- end,
- "if is_atom(is_integer(a)) -> true ; true -> false end.",
- true),
+ check(fun() -> [X || X <- [1,2,3], erlang:is_integer(X)] end,
+ "[X || X <- [1,2,3], erlang:is_integer(X)].",
+ [1,2,3]),
+ check(fun() -> if is_atom(is_integer(a)) -> true ; true -> false end
+ end,
+ "if is_atom(is_integer(a)) -> true ; true -> false end.",
+ true),
check(fun() -> if erlang:is_atom(erlang:is_integer(a)) -> true;
true -> false end end,
"if erlang:is_atom(erlang:is_integer(a)) -> true; "
"true -> false end.",
true),
- ?line check(fun() -> if is_atom(3+a) -> true ; true -> false end end,
- "if is_atom(3+a) -> true ; true -> false end.",
- false),
- ?line check(fun() -> if erlang:is_atom(3+a) -> true ; true -> false end
- end,
- "if erlang:is_atom(3+a) -> true ; true -> false end.",
- false),
+ check(fun() -> if is_atom(3+a) -> true ; true -> false end end,
+ "if is_atom(3+a) -> true ; true -> false end.",
+ false),
+ check(fun() -> if erlang:is_atom(3+a) -> true ; true -> false end
+ end,
+ "if erlang:is_atom(3+a) -> true ; true -> false end.",
+ false),
ok.
-guard_5(doc) ->
- ["Guards with erlang:'=='/2"];
-guard_5(suite) ->
- [];
+%% Guards with erlang:'=='/2.
guard_5(Config) when is_list(Config) ->
{ok,Tokens ,_} =
erl_scan:string("case 1 of A when erlang:'=='(A, 1) -> true end."),
@@ -266,293 +238,278 @@ guard_5(Config) when is_list(Config) ->
guard_5_compiled() ->
case 1 of A when erlang:'=='(A, 1) -> true end.
-lc(doc) ->
- ["OTP-4518."];
-lc(suite) ->
- [];
+%% OTP-4518.
lc(Config) when is_list(Config) ->
- ?line check(fun() -> X = 32, [X || X <- [1,2,3]] end,
- "begin X = 32, [X || X <- [1,2,3]] end.",
- [1,2,3]),
- ?line check(fun() -> X = 32,
- [X || <<X:X>> <- [<<1:32>>,<<2:32>>,<<3:8>>]] end,
- %% "binsize variable" ^
- "begin X = 32,
+ check(fun() -> X = 32, [X || X <- [1,2,3]] end,
+ "begin X = 32, [X || X <- [1,2,3]] end.",
+ [1,2,3]),
+ check(fun() -> X = 32,
+ [X || <<X:X>> <- [<<1:32>>,<<2:32>>,<<3:8>>]] end,
+ %% "binsize variable" ^
+ "begin X = 32,
[X || <<X:X>> <- [<<1:32>>,<<2:32>>,<<3:8>>]] end.",
[1,2]),
- ?line check(fun() -> Y = 13,[X || {X,Y} <- [{1,2}]] end,
- "begin Y = 13,[X || {X,Y} <- [{1,2}]] end.",
- [1]),
- ?line error_check("begin [A || X <- [{1,2}], 1 == A] end.",
- {unbound_var,'A'}),
- ?line error_check("begin X = 32,
+ check(fun() -> Y = 13,[X || {X,Y} <- [{1,2}]] end,
+ "begin Y = 13,[X || {X,Y} <- [{1,2}]] end.",
+ [1]),
+ error_check("begin [A || X <- [{1,2}], 1 == A] end.",
+ {unbound_var,'A'}),
+ error_check("begin X = 32,
[{Y,W} || X <- [1,2,32,Y=4], Z <- [1,2,W=3]] end.",
{unbound_var,'Y'}),
- ?line error_check("begin X = 32,<<A:B>> = <<100:X>> end.",
- {unbound_var,'B'}),
- ?line check(fun() -> [X || X <- [1,2,3,4], not (X < 2)] end,
- "begin [X || X <- [1,2,3,4], not (X < 2)] end.",
- [2,3,4]),
- ?line check(fun() -> [X || X <- [true,false], X] end,
- "[X || X <- [true,false], X].", [true]),
+ error_check("begin X = 32,<<A:B>> = <<100:X>> end.",
+ {unbound_var,'B'}),
+ check(fun() -> [X || X <- [1,2,3,4], not (X < 2)] end,
+ "begin [X || X <- [1,2,3,4], not (X < 2)] end.",
+ [2,3,4]),
+ check(fun() -> [X || X <- [true,false], X] end,
+ "[X || X <- [true,false], X].", [true]),
ok.
-simple_cases(doc) ->
- ["Simple cases, just to cover some code."];
-simple_cases(suite) ->
- [];
+%% Simple cases, just to cover some code.
simple_cases(Config) when is_list(Config) ->
- ?line check(fun() -> A = $C end, "A = $C.", $C),
- %% ?line check(fun() -> A = 3.14 end, "A = 3.14.", 3.14),
- ?line check(fun() -> self() ! a, A = receive a -> true end end,
- "begin self() ! a, A = receive a -> true end end.",
- true),
- ?line check(fun() -> c:flush(), self() ! a, self() ! b, self() ! c,
- receive b -> b end,
- {messages, [a,c]} =
- erlang:process_info(self(), messages),
- c:flush() end,
- "begin c:flush(), self() ! a, self() ! b, self() ! c,"
- "receive b -> b end,"
- "{messages, [a,c]} ="
- " erlang:process_info(self(), messages), c:flush() end.",
- ok),
- ?line check(fun() -> self() ! a, A = receive a -> true
- after 0 -> false end end,
- "begin self() ! a, A = receive a -> true"
- " after 0 -> false end end.",
- true),
- ?line check(fun() -> c:flush(), self() ! a, self() ! b, self() ! c,
- receive b -> b after 0 -> true end,
- {messages, [a,c]} =
- erlang:process_info(self(), messages),
- c:flush() end,
- "begin c:flush(), self() ! a, self() ! b, self() ! c,"
- "receive b -> b after 0 -> true end,"
- "{messages, [a,c]} ="
- " erlang:process_info(self(), messages), c:flush() end.",
- ok),
- ?line check(fun() -> receive _ -> true after 10 -> false end end,
- "receive _ -> true after 10 -> false end.",
- false),
- ?line check(fun() -> F = fun(A) -> A end, true = 3 == F(3) end,
- "begin F = fun(A) -> A end, true = 3 == F(3) end.",
- true),
- ?line check(fun() -> F = fun(A) -> A end, true = 3 == apply(F, [3]) end,
- "begin F = fun(A) -> A end, true = 3 == apply(F,[3]) end.",
- true),
- ?line check(fun() -> catch throw(a) end, "catch throw(a).", a),
- ?line check(fun() -> catch a end, "catch a.", a),
- ?line check(fun() -> 4 == 3 end, "4 == 3.", false),
- ?line check(fun() -> not true end, "not true.", false),
- ?line check(fun() -> -3 end, "-3.", -3),
-
- ?line error_check("3.0 = 4.0.", {badmatch,4.0}),
- ?line check(fun() -> <<(3.0+2.0):32/float>> = <<5.0:32/float>> end,
- "<<(3.0+2.0):32/float>> = <<5.0:32/float>>.",
- <<5.0:32/float>>),
-
- ?line check(fun() -> false andalso kludd end, "false andalso kludd.",
- false),
- ?line check(fun() -> true andalso true end, "true andalso true.",
- true),
- ?line check(fun() -> true andalso false end, "true andalso false.",
- false),
- ?line check(fun() -> true andalso kludd end, "true andalso kludd.",
- kludd),
- ?line error_check("kladd andalso kludd.", {badarg,kladd}),
-
- ?line check(fun() -> if false andalso kludd -> a; true -> b end end,
- "if false andalso kludd -> a; true -> b end.",
- b),
- ?line check(fun() -> if true andalso true -> a; true -> b end end,
- "if true andalso true -> a; true -> b end.",
- a),
- ?line check(fun() -> if true andalso false -> a; true -> b end end,
- "if true andalso false -> a; true -> b end.",
- b),
-
- ?line check(fun() -> true orelse kludd end,
- "true orelse kludd.", true),
- ?line check(fun() -> false orelse false end,
- "false orelse false.", false),
- ?line check(fun() -> false orelse true end,
- "false orelse true.", true),
- ?line check(fun() -> false orelse kludd end,
- "false orelse kludd.", kludd),
- ?line error_check("kladd orelse kludd.", {badarg,kladd}),
- ?line error_check("[X || X <- [1,2,3], begin 1 end].",{bad_filter,1}),
- ?line error_check("[X || X <- a].",{bad_generator,a}),
-
- ?line check(fun() -> if true orelse kludd -> a; true -> b end end,
- "if true orelse kludd -> a; true -> b end.", a),
- ?line check(fun() -> if false orelse false -> a; true -> b end end,
- "if false orelse false -> a; true -> b end.", b),
- ?line check(fun() -> if false orelse true -> a; true -> b end end,
- "if false orelse true -> a; true -> b end.", a),
-
- ?line check(fun() -> [X || X <- [1,2,3], X+2] end,
- "[X || X <- [1,2,3], X+2].", []),
-
- ?line check(fun() -> [X || X <- [1,2,3], [X] == [X || X <- [2]]] end,
- "[X || X <- [1,2,3], [X] == [X || X <- [2]]].",
- [2]),
- ?line check(fun() -> F = fun(1) -> ett; (2) -> zwei end,
- ett = F(1), zwei = F(2) end,
- "begin F = fun(1) -> ett; (2) -> zwei end,
+ check(fun() -> A = $C end, "A = $C.", $C),
+ %% check(fun() -> A = 3.14 end, "A = 3.14.", 3.14),
+ check(fun() -> self() ! a, A = receive a -> true end end,
+ "begin self() ! a, A = receive a -> true end end.",
+ true),
+ check(fun() -> c:flush(), self() ! a, self() ! b, self() ! c,
+ receive b -> b end,
+ {messages, [a,c]} =
+ erlang:process_info(self(), messages),
+ c:flush() end,
+ "begin c:flush(), self() ! a, self() ! b, self() ! c,"
+ "receive b -> b end,"
+ "{messages, [a,c]} ="
+ " erlang:process_info(self(), messages), c:flush() end.",
+ ok),
+ check(fun() -> self() ! a, A = receive a -> true
+ after 0 -> false end end,
+ "begin self() ! a, A = receive a -> true"
+ " after 0 -> false end end.",
+ true),
+ check(fun() -> c:flush(), self() ! a, self() ! b, self() ! c,
+ receive b -> b after 0 -> true end,
+ {messages, [a,c]} =
+ erlang:process_info(self(), messages),
+ c:flush() end,
+ "begin c:flush(), self() ! a, self() ! b, self() ! c,"
+ "receive b -> b after 0 -> true end,"
+ "{messages, [a,c]} ="
+ " erlang:process_info(self(), messages), c:flush() end.",
+ ok),
+ check(fun() -> receive _ -> true after 10 -> false end end,
+ "receive _ -> true after 10 -> false end.",
+ false),
+ check(fun() -> F = fun(A) -> A end, true = 3 == F(3) end,
+ "begin F = fun(A) -> A end, true = 3 == F(3) end.",
+ true),
+ check(fun() -> F = fun(A) -> A end, true = 3 == apply(F, [3]) end,
+ "begin F = fun(A) -> A end, true = 3 == apply(F,[3]) end.",
+ true),
+ check(fun() -> catch throw(a) end, "catch throw(a).", a),
+ check(fun() -> catch a end, "catch a.", a),
+ check(fun() -> 4 == 3 end, "4 == 3.", false),
+ check(fun() -> not true end, "not true.", false),
+ check(fun() -> -3 end, "-3.", -3),
+
+ error_check("3.0 = 4.0.", {badmatch,4.0}),
+ check(fun() -> <<(3.0+2.0):32/float>> = <<5.0:32/float>> end,
+ "<<(3.0+2.0):32/float>> = <<5.0:32/float>>.",
+ <<5.0:32/float>>),
+
+ check(fun() -> false andalso kludd end, "false andalso kludd.",
+ false),
+ check(fun() -> true andalso true end, "true andalso true.",
+ true),
+ check(fun() -> true andalso false end, "true andalso false.",
+ false),
+ check(fun() -> true andalso kludd end, "true andalso kludd.",
+ kludd),
+ error_check("kladd andalso kludd.", {badarg,kladd}),
+
+ check(fun() -> if false andalso kludd -> a; true -> b end end,
+ "if false andalso kludd -> a; true -> b end.",
+ b),
+ check(fun() -> if true andalso true -> a; true -> b end end,
+ "if true andalso true -> a; true -> b end.",
+ a),
+ check(fun() -> if true andalso false -> a; true -> b end end,
+ "if true andalso false -> a; true -> b end.",
+ b),
+
+ check(fun() -> true orelse kludd end,
+ "true orelse kludd.", true),
+ check(fun() -> false orelse false end,
+ "false orelse false.", false),
+ check(fun() -> false orelse true end,
+ "false orelse true.", true),
+ check(fun() -> false orelse kludd end,
+ "false orelse kludd.", kludd),
+ error_check("kladd orelse kludd.", {badarg,kladd}),
+ error_check("[X || X <- [1,2,3], begin 1 end].",{bad_filter,1}),
+ error_check("[X || X <- a].",{bad_generator,a}),
+
+ check(fun() -> if true orelse kludd -> a; true -> b end end,
+ "if true orelse kludd -> a; true -> b end.", a),
+ check(fun() -> if false orelse false -> a; true -> b end end,
+ "if false orelse false -> a; true -> b end.", b),
+ check(fun() -> if false orelse true -> a; true -> b end end,
+ "if false orelse true -> a; true -> b end.", a),
+
+ check(fun() -> [X || X <- [1,2,3], X+2] end,
+ "[X || X <- [1,2,3], X+2].", []),
+
+ check(fun() -> [X || X <- [1,2,3], [X] == [X || X <- [2]]] end,
+ "[X || X <- [1,2,3], [X] == [X || X <- [2]]].",
+ [2]),
+ check(fun() -> F = fun(1) -> ett; (2) -> zwei end,
+ ett = F(1), zwei = F(2) end,
+ "begin F = fun(1) -> ett; (2) -> zwei end,
ett = F(1), zwei = F(2) end.",
zwei),
- ?line check(fun() -> F = fun(X) when X == 1 -> ett;
- (X) when X == 2 -> zwei end,
- ett = F(1), zwei = F(2) end,
- "begin F = fun(X) when X == 1 -> ett;
+ check(fun() -> F = fun(X) when X == 1 -> ett;
+ (X) when X == 2 -> zwei end,
+ ett = F(1), zwei = F(2) end,
+ "begin F = fun(X) when X == 1 -> ett;
(X) when X == 2 -> zwei end,
- ett = F(1), zwei = F(2) end.",
+ ett = F(1), zwei = F(2) end.",
zwei),
- ?line error_check("begin F = fun(1) -> ett end, zwei = F(2) end.",
- function_clause),
- ?line check(fun() -> if length([1]) == 1 -> yes;
- true -> no end end,
- "if length([1]) == 1 -> yes;
+ error_check("begin F = fun(1) -> ett end, zwei = F(2) end.",
+ function_clause),
+ check(fun() -> if length([1]) == 1 -> yes;
+ true -> no end end,
+ "if length([1]) == 1 -> yes;
true -> no end.",
yes),
- ?line check(fun() -> if is_integer(3) -> true; true -> false end end,
- "if is_integer(3) -> true; true -> false end.", true),
- ?line check(fun() -> if integer(3) -> true; true -> false end end,
- "if integer(3) -> true; true -> false end.", true),
- ?line check(fun() -> if is_float(3) -> true; true -> false end end,
- "if is_float(3) -> true; true -> false end.", false),
- ?line check(fun() -> if float(3) -> true; true -> false end end,
- "if float(3) -> true; true -> false end.", false),
- ?line check(fun() -> if is_number(3) -> true; true -> false end end,
- "if is_number(3) -> true; true -> false end.", true),
- ?line check(fun() -> if number(3) -> true; true -> false end end,
- "if number(3) -> true; true -> false end.", true),
- ?line check(fun() -> if is_atom(a) -> true; true -> false end end,
- "if is_atom(a) -> true; true -> false end.", true),
- ?line check(fun() -> if atom(a) -> true; true -> false end end,
- "if atom(a) -> true; true -> false end.", true),
- ?line check(fun() -> if is_list([]) -> true; true -> false end end,
- "if is_list([]) -> true; true -> false end.", true),
- ?line check(fun() -> if list([]) -> true; true -> false end end,
- "if list([]) -> true; true -> false end.", true),
- ?line check(fun() -> if is_tuple({}) -> true; true -> false end end,
- "if is_tuple({}) -> true; true -> false end.", true),
- ?line check(fun() -> if tuple({}) -> true; true -> false end end,
- "if tuple({}) -> true; true -> false end.", true),
- ?line check(fun() -> if is_pid(self()) -> true; true -> false end end,
- "if is_pid(self()) -> true; true -> false end.", true),
- ?line check(fun() -> if pid(self()) -> true; true -> false end end,
- "if pid(self()) -> true; true -> false end.", true),
- ?line check(fun() -> R = make_ref(), if is_reference(R) -> true;
- true -> false end end,
- "begin R = make_ref(), if is_reference(R) -> true;"
- "true -> false end end.", true),
- ?line check(fun() -> R = make_ref(), if reference(R) -> true;
- true -> false end end,
- "begin R = make_ref(), if reference(R) -> true;"
- "true -> false end end.", true),
- ?line check(fun() -> if is_port(a) -> true; true -> false end end,
- "if is_port(a) -> true; true -> false end.", false),
- ?line check(fun() -> if port(a) -> true; true -> false end end,
- "if port(a) -> true; true -> false end.", false),
- ?line check(fun() -> if is_function(a) -> true; true -> false end end,
- "if is_function(a) -> true; true -> false end.", false),
- ?line check(fun() -> if function(a) -> true; true -> false end end,
- "if function(a) -> true; true -> false end.", false),
- ?line check(fun() -> if is_binary(<<>>) -> true; true -> false end end,
- "if is_binary(<<>>) -> true; true -> false end.", true),
- ?line check(fun() -> if binary(<<>>) -> true; true -> false end end,
- "if binary(<<>>) -> true; true -> false end.", true),
- ?line check(fun() -> if is_integer(a) == true -> yes;
- true -> no end end,
- "if is_integer(a) == true -> yes;
+ check(fun() -> if is_integer(3) -> true; true -> false end end,
+ "if is_integer(3) -> true; true -> false end.", true),
+ check(fun() -> if integer(3) -> true; true -> false end end,
+ "if integer(3) -> true; true -> false end.", true),
+ check(fun() -> if is_float(3) -> true; true -> false end end,
+ "if is_float(3) -> true; true -> false end.", false),
+ check(fun() -> if float(3) -> true; true -> false end end,
+ "if float(3) -> true; true -> false end.", false),
+ check(fun() -> if is_number(3) -> true; true -> false end end,
+ "if is_number(3) -> true; true -> false end.", true),
+ check(fun() -> if number(3) -> true; true -> false end end,
+ "if number(3) -> true; true -> false end.", true),
+ check(fun() -> if is_atom(a) -> true; true -> false end end,
+ "if is_atom(a) -> true; true -> false end.", true),
+ check(fun() -> if atom(a) -> true; true -> false end end,
+ "if atom(a) -> true; true -> false end.", true),
+ check(fun() -> if is_list([]) -> true; true -> false end end,
+ "if is_list([]) -> true; true -> false end.", true),
+ check(fun() -> if list([]) -> true; true -> false end end,
+ "if list([]) -> true; true -> false end.", true),
+ check(fun() -> if is_tuple({}) -> true; true -> false end end,
+ "if is_tuple({}) -> true; true -> false end.", true),
+ check(fun() -> if tuple({}) -> true; true -> false end end,
+ "if tuple({}) -> true; true -> false end.", true),
+ check(fun() -> if is_pid(self()) -> true; true -> false end end,
+ "if is_pid(self()) -> true; true -> false end.", true),
+ check(fun() -> if pid(self()) -> true; true -> false end end,
+ "if pid(self()) -> true; true -> false end.", true),
+ check(fun() -> R = make_ref(), if is_reference(R) -> true;
+ true -> false end end,
+ "begin R = make_ref(), if is_reference(R) -> true;"
+ "true -> false end end.", true),
+ check(fun() -> R = make_ref(), if reference(R) -> true;
+ true -> false end end,
+ "begin R = make_ref(), if reference(R) -> true;"
+ "true -> false end end.", true),
+ check(fun() -> if is_port(a) -> true; true -> false end end,
+ "if is_port(a) -> true; true -> false end.", false),
+ check(fun() -> if port(a) -> true; true -> false end end,
+ "if port(a) -> true; true -> false end.", false),
+ check(fun() -> if is_function(a) -> true; true -> false end end,
+ "if is_function(a) -> true; true -> false end.", false),
+ check(fun() -> if function(a) -> true; true -> false end end,
+ "if function(a) -> true; true -> false end.", false),
+ check(fun() -> if is_binary(<<>>) -> true; true -> false end end,
+ "if is_binary(<<>>) -> true; true -> false end.", true),
+ check(fun() -> if binary(<<>>) -> true; true -> false end end,
+ "if binary(<<>>) -> true; true -> false end.", true),
+ check(fun() -> if is_integer(a) == true -> yes;
+ true -> no end end,
+ "if is_integer(a) == true -> yes;
true -> no end.",
no),
- ?line check(fun() -> if [] -> true; true -> false end end,
- "if [] -> true; true -> false end.", false),
- ?line error_check("if lists:member(1,[1]) -> true; true -> false end.",
- illegal_guard_expr),
- ?line error_check("if false -> true end.", if_clause),
- ?line check(fun() -> if a+b -> true; true -> false end end,
- "if a + b -> true; true -> false end.", false),
- ?line check(fun() -> if + b -> true; true -> false end end,
- "if + b -> true; true -> false end.", false),
- ?line error_check("case foo of bar -> true end.", {case_clause,foo}),
- ?line error_check("case 4 of 2+a -> true; _ -> false end.",
- illegal_pattern),
- ?line error_check("case 4 of +a -> true; _ -> false end.",
- illegal_pattern),
- ?line check(fun() -> case a of
- X when X == b -> one;
- X when X == a -> two
- end end,
- "begin case a of
+ check(fun() -> if [] -> true; true -> false end end,
+ "if [] -> true; true -> false end.", false),
+ error_check("if lists:member(1,[1]) -> true; true -> false end.",
+ illegal_guard_expr),
+ error_check("if false -> true end.", if_clause),
+ check(fun() -> if a+b -> true; true -> false end end,
+ "if a + b -> true; true -> false end.", false),
+ check(fun() -> if + b -> true; true -> false end end,
+ "if + b -> true; true -> false end.", false),
+ error_check("case foo of bar -> true end.", {case_clause,foo}),
+ error_check("case 4 of 2+a -> true; _ -> false end.",
+ illegal_pattern),
+ error_check("case 4 of +a -> true; _ -> false end.",
+ illegal_pattern),
+ check(fun() -> case a of
+ X when X == b -> one;
+ X when X == a -> two
+ end end,
+ "begin case a of
X when X == b -> one;
- X when X == a -> two
- end end.", two),
- ?line error_check("3 = 4.", {badmatch,4}),
- ?line error_check("a = 3.", {badmatch,3}),
- %% ?line error_check("3.1 = 2.7.",{badmatch,2.7}),
- ?line error_check("$c = 4.", {badmatch,4}),
- ?line check(fun() -> $c = $c end, "$c = $c.", $c),
- ?line check(fun() -> _ = bar end, "_ = bar.", bar),
- ?line check(fun() -> A = 14, A = 14 end,
+ X when X == a -> two
+ end end.", two),
+ error_check("3 = 4.", {badmatch,4}),
+ error_check("a = 3.", {badmatch,3}),
+ %% error_check("3.1 = 2.7.",{badmatch,2.7}),
+ error_check("$c = 4.", {badmatch,4}),
+ check(fun() -> $c = $c end, "$c = $c.", $c),
+ check(fun() -> _ = bar end, "_ = bar.", bar),
+ check(fun() -> A = 14, A = 14 end,
"begin A = 14, A = 14 end.", 14),
- ?line error_check("begin A = 14, A = 16 end.", {badmatch,16}),
- ?line error_check("\"hej\" = \"san\".", {badmatch,"san"}),
- ?line check(fun() -> "hej" = "hej" end,
+ error_check("begin A = 14, A = 16 end.", {badmatch,16}),
+ error_check("\"hej\" = \"san\".", {badmatch,"san"}),
+ check(fun() -> "hej" = "hej" end,
"\"hej\" = \"hej\".", "hej"),
- ?line error_check("[] = [a].", {badmatch,[a]}),
- ?line check(fun() -> [] = [] end, "[] = [].", []),
- ?line error_check("[a] = [].", {badmatch,[]}),
- ?line error_check("{a,b} = 34.", {badmatch,34}),
- ?line check(fun() -> <<X:7>> = <<8:7>>, X end,
+ error_check("[] = [a].", {badmatch,[a]}),
+ check(fun() -> [] = [] end, "[] = [].", []),
+ error_check("[a] = [].", {badmatch,[]}),
+ error_check("{a,b} = 34.", {badmatch,34}),
+ check(fun() -> <<X:7>> = <<8:7>>, X end,
"begin <<X:7>> = <<8:7>>, X end.", 8),
- ?line error_check("<<34:32>> = \"hej\".", {badmatch,"hej"}),
- ?line check(fun() -> trunc((1 * 3 div 3 + 4 - 3) / 1) rem 2 end,
+ error_check("<<34:32>> = \"hej\".", {badmatch,"hej"}),
+ check(fun() -> trunc((1 * 3 div 3 + 4 - 3) / 1) rem 2 end,
"begin trunc((1 * 3 div 3 + 4 - 3) / 1) rem 2 end.", 0),
- ?line check(fun() -> (2#101 band 2#10101) bor (2#110 bxor 2#010) end,
+ check(fun() -> (2#101 band 2#10101) bor (2#110 bxor 2#010) end,
"(2#101 band 2#10101) bor (2#110 bxor 2#010).", 5),
- ?line check(fun() -> (2#1 bsl 4) + (2#10000 bsr 3) end,
+ check(fun() -> (2#1 bsl 4) + (2#10000 bsr 3) end,
"(2#1 bsl 4) + (2#10000 bsr 3).", 18),
- ?line check(fun() -> ((1<3) and ((1 =:= 2) or (1 =/= 2))) xor (1=<2) end,
+ check(fun() -> ((1<3) and ((1 =:= 2) or (1 =/= 2))) xor (1=<2) end,
"((1<3) and ((1 =:= 2) or (1 =/= 2))) xor (1=<2).", false),
- ?line check(fun() -> (a /= b) or (2 > 4) or (3 >= 3) end,
+ check(fun() -> (a /= b) or (2 > 4) or (3 >= 3) end,
"(a /= b) or (2 > 4) or (3 >= 3).", true),
- ?line check(fun() -> "hej" ++ "san" =/= "hejsan" -- "san" end,
+ check(fun() -> "hej" ++ "san" =/= "hejsan" -- "san" end,
"\"hej\" ++ \"san\" =/= \"hejsan\" -- \"san\".", true),
- ?line check(fun() -> (bnot 1) < -0 end, "(bnot (+1)) < -0.", true),
- ok.
+ check(fun() -> (bnot 1) < -0 end, "(bnot (+1)) < -0.", true),
+ ok.
-unary_plus(doc) ->
- ["OTP-4929. Unary plus rejects non-numbers."];
-unary_plus(suite) ->
- [];
+%% OTP-4929. Unary plus rejects non-numbers.
unary_plus(Config) when is_list(Config) ->
- ?line check(fun() -> F = fun(X) -> + X end,
- true = -1 == F(-1) end,
- "begin F = fun(X) -> + X end,"
- " true = -1 == F(-1) end.", true, ['F'], none, none),
- ?line error_check("+a.", badarith),
+ check(fun() -> F = fun(X) -> + X end,
+ true = -1 == F(-1) end,
+ "begin F = fun(X) -> + X end,"
+ " true = -1 == F(-1) end.", true, ['F'], none, none),
+ error_check("+a.", badarith),
ok.
-apply_atom(doc) ->
- ["OTP-5064. Can no longer apply atoms."];
-apply_atom(suite) ->
- [];
+%% OTP-5064. Can no longer apply atoms.
apply_atom(Config) when is_list(Config) ->
- ?line error_check("[X || X <- [[1],[2]],
+ error_check("[X || X <- [[1],[2]],
begin L = length, L(X) =:= 1 end].",
{badfun,length}),
ok.
-otp_5269(doc) ->
- ["OTP-5269. Bugs in the bit syntax."];
-otp_5269(suite) ->
- [];
+%% OTP-5269. Bugs in the bit syntax.
otp_5269(Config) when is_list(Config) ->
- ?line check(fun() -> L = 8,
+ check(fun() -> L = 8,
F = fun(<<A:L,B:A>>) -> B end,
F(<<16:8, 7:16>>)
end,
@@ -560,7 +517,7 @@ otp_5269(Config) when is_list(Config) ->
L = 8, F = fun(<<A:L,B:A>>) -> B end, F(<<16:8, 7:16>>)
end.",
7),
- ?line check(fun() -> L = 8,
+ check(fun() -> L = 8,
F = fun(<<L:L,B:L>>) -> B end,
F(<<16:8, 7:16>>)
end,
@@ -568,31 +525,31 @@ otp_5269(Config) when is_list(Config) ->
L = 8, F = fun(<<L:L,B:L>>) -> B end, F(<<16:8, 7:16>>)
end.",
7),
- ?line check(fun() -> L = 8, <<A:L,B:A>> = <<16:8, 7:16>>, B end,
+ check(fun() -> L = 8, <<A:L,B:A>> = <<16:8, 7:16>>, B end,
"begin L = 8, <<A:L,B:A>> = <<16:8, 7:16>>, B end.",
7),
- ?line error_check("begin L = 8, <<L:L,B:L>> = <<16:8, 7:16>> end.",
+ error_check("begin L = 8, <<L:L,B:L>> = <<16:8, 7:16>> end.",
{badmatch,<<16:8,7:16>>}),
- ?line error_check("begin <<L:16,L:L>> = <<16:16,8:16>>, L end.",
+ error_check("begin <<L:16,L:L>> = <<16:16,8:16>>, L end.",
{badmatch, <<16:16,8:16>>}),
- ?line check(fun() -> U = 8, (fun(<<U:U>>) -> U end)(<<32:8>>) end,
+ check(fun() -> U = 8, (fun(<<U:U>>) -> U end)(<<32:8>>) end,
"begin U = 8, (fun(<<U:U>>) -> U end)(<<32:8>>) end.",
32),
- ?line check(fun() -> U = 8, [U || <<U:U>> <- [<<32:8>>]] end,
+ check(fun() -> U = 8, [U || <<U:U>> <- [<<32:8>>]] end,
"begin U = 8, [U || <<U:U>> <- [<<32:8>>]] end.",
[32]),
- ?line error_check("(fun({3,<<A:32,A:32>>}) -> a end)
+ error_check("(fun({3,<<A:32,A:32>>}) -> a end)
({3,<<17:32,19:32>>}).",
function_clause),
- ?line check(fun() -> [X || <<A:8,
+ check(fun() -> [X || <<A:8,
B:A>> <- [<<16:8,19:16>>],
<<X:8>> <- [<<B:8>>]] end,
"[X || <<A:8,
B:A>> <- [<<16:8,19:16>>],
<<X:8>> <- [<<B:8>>]].",
[19]),
- ?line check(fun() ->
+ check(fun() ->
(fun (<<A:1/binary, B:8/integer, _C:B/binary>>) ->
case A of
B -> wrong;
@@ -605,12 +562,9 @@ otp_5269(Config) when is_list(Config) ->
ok),
ok.
-otp_6539(doc) ->
- ["OTP-6539. try/catch bugs."];
-otp_6539(suite) ->
- [];
+%% OTP-6539. try/catch bugs.
otp_6539(Config) when is_list(Config) ->
- ?line check(fun() ->
+ check(fun() ->
F = fun(A,B) ->
try A+B
catch _:_ -> dontthinkso
@@ -629,152 +583,149 @@ otp_6539(Config) when is_list(Config) ->
[3, 5]),
ok.
-otp_6543(doc) ->
- ["OTP-6543. bitlevel binaries."];
-otp_6543(suite) ->
- [];
+%% OTP-6543. bitlevel binaries.
otp_6543(Config) when is_list(Config) ->
- ?line check(fun() ->
+ check(fun() ->
<< <<X>> || <<X>> <- [1,2,3] >>
end,
"<< <<X>> || <<X>> <- [1,2,3] >>.",
<<>>),
- ?line check(fun() ->
+ check(fun() ->
<< <<X>> || X <- [1,2,3] >>
end,
"<< <<X>> || X <- [1,2,3] >>.",
<<1,2,3>>),
- ?line check(fun() ->
+ check(fun() ->
<< <<X:8>> || <<X:2>> <= <<"hej">> >>
end,
"<< <<X:8>> || <<X:2>> <= <<\"hej\">> >>.",
<<1,2,2,0,1,2,1,1,1,2,2,2>>),
- ?line check(fun() ->
+ check(fun() ->
<< <<X:8>> ||
<<65,X:4>> <= <<65,7:4,65,3:4,66,8:4>> >>
end,
"<< <<X:8>> ||
<<65,X:4>> <= <<65,7:4,65,3:4,66,8:4>> >>.",
<<7,3>>),
- ?line check(fun() -> <<34:18/big>> end,
+ check(fun() -> <<34:18/big>> end,
"<<34:18/big>>.",
<<0,8,2:2>>),
- ?line check(fun() -> <<34:18/big-unit:2>> end,
+ check(fun() -> <<34:18/big-unit:2>> end,
"<<34:18/big-unit:2>>.",
<<0,0,0,2,2:4>>),
- ?line check(fun() -> <<34:18/little>> end,
+ check(fun() -> <<34:18/little>> end,
"<<34:18/little>>.",
<<34,0,0:2>>),
- ?line case eval_string("<<34:18/native>>.") of
+ case eval_string("<<34:18/native>>.") of
<<0,8,2:2>> -> ok;
<<34,0,0:2>> -> ok
end,
- ?line check(fun() -> <<34:18/big-signed>> end,
+ check(fun() -> <<34:18/big-signed>> end,
"<<34:18/big-signed>>.",
<<0,8,2:2>>),
- ?line check(fun() -> <<34:18/little-signed>> end,
+ check(fun() -> <<34:18/little-signed>> end,
"<<34:18/little-signed>>.",
<<34,0,0:2>>),
- ?line case eval_string("<<34:18/native-signed>>.") of
+ case eval_string("<<34:18/native-signed>>.") of
<<0,8,2:2>> -> ok;
<<34,0,0:2>> -> ok
end,
- ?line check(fun() -> <<34:18/big-unsigned>> end,
+ check(fun() -> <<34:18/big-unsigned>> end,
"<<34:18/big-unsigned>>.",
<<0,8,2:2>>),
- ?line check(fun() -> <<34:18/little-unsigned>> end,
+ check(fun() -> <<34:18/little-unsigned>> end,
"<<34:18/little-unsigned>>.",
<<34,0,0:2>>),
- ?line case eval_string("<<34:18/native-unsigned>>.") of
+ case eval_string("<<34:18/native-unsigned>>.") of
<<0,8,2:2>> -> ok;
<<34,0,0:2>> -> ok
end,
- ?line check(fun() -> <<3.14:32/float-big>> end,
+ check(fun() -> <<3.14:32/float-big>> end,
"<<3.14:32/float-big>>.",
<<64,72,245,195>>),
- ?line check(fun() -> <<3.14:32/float-little>> end,
+ check(fun() -> <<3.14:32/float-little>> end,
"<<3.14:32/float-little>>.",
<<195,245,72,64>>),
- ?line case eval_string("<<3.14:32/float-native>>.") of
+ case eval_string("<<3.14:32/float-native>>.") of
<<64,72,245,195>> -> ok;
<<195,245,72,64>> -> ok
end,
- ?line error_check("<<(<<17,3:2>>)/binary>>.", badarg),
- ?line check(fun() -> <<(<<17,3:2>>)/bitstring>> end,
+ error_check("<<(<<17,3:2>>)/binary>>.", badarg),
+ check(fun() -> <<(<<17,3:2>>)/bitstring>> end,
"<<(<<17,3:2>>)/bitstring>>.",
<<17,3:2>>),
- ?line check(fun() -> <<(<<17,3:2>>):10/bitstring>> end,
+ check(fun() -> <<(<<17,3:2>>):10/bitstring>> end,
"<<(<<17,3:2>>):10/bitstring>>.",
<<17,3:2>>),
- ?line check(fun() -> <<<<344:17>>/binary-unit:17>> end,
+ check(fun() -> <<<<344:17>>/binary-unit:17>> end,
"<<<<344:17>>/binary-unit:17>>.",
<<344:17>>),
- ?line check(fun() -> <<X:18/big>> = <<34:18/big>>, X end,
+ check(fun() -> <<X:18/big>> = <<34:18/big>>, X end,
"begin <<X:18/big>> = <<34:18/big>>, X end.",
34),
- ?line check(fun() -> <<X:18/big-unit:2>> = <<34:18/big-unit:2>>, X end,
+ check(fun() -> <<X:18/big-unit:2>> = <<34:18/big-unit:2>>, X end,
"begin <<X:18/big-unit:2>> = <<34:18/big-unit:2>>, X end.",
34),
- ?line check(fun() -> <<X:18/little>> = <<34:18/little>>, X end,
+ check(fun() -> <<X:18/little>> = <<34:18/little>>, X end,
"begin <<X:18/little>> = <<34:18/little>>, X end.",
34),
- ?line check(fun() -> <<X:18/native>> = <<34:18/native>>, X end,
+ check(fun() -> <<X:18/native>> = <<34:18/native>>, X end,
"begin <<X:18/native>> = <<34:18/native>>, X end.",
34),
- ?line check(fun() -> <<X:18/big-signed>> = <<34:18/big-signed>>, X end,
+ check(fun() -> <<X:18/big-signed>> = <<34:18/big-signed>>, X end,
"begin <<X:18/big-signed>> = <<34:18/big-signed>>, X end.",
34),
- ?line check(fun() -> <<X:18/little-signed>> = <<34:18/little-signed>>,
+ check(fun() -> <<X:18/little-signed>> = <<34:18/little-signed>>,
X end,
"begin <<X:18/little-signed>> = <<34:18/little-signed>>,
X end.",
34),
- ?line check(fun() -> <<X:18/native-signed>> = <<34:18/native-signed>>,
+ check(fun() -> <<X:18/native-signed>> = <<34:18/native-signed>>,
X end,
"begin <<X:18/native-signed>> = <<34:18/native-signed>>,
X end.",
34),
- ?line check(fun() -> <<X:18/big-unsigned>> = <<34:18/big-unsigned>>,
+ check(fun() -> <<X:18/big-unsigned>> = <<34:18/big-unsigned>>,
X end,
"begin <<X:18/big-unsigned>> = <<34:18/big-unsigned>>,
X end.",
34),
- ?line check(fun() ->
+ check(fun() ->
<<X:18/little-unsigned>> = <<34:18/little-unsigned>>,
X end,
"begin <<X:18/little-unsigned>> = <<34:18/little-unsigned>>,
X end.",
34),
- ?line check(fun() ->
+ check(fun() ->
<<X:18/native-unsigned>> = <<34:18/native-unsigned>>,
X end,
"begin <<X:18/native-unsigned>> = <<34:18/native-unsigned>>,
X end.",
34),
- ?line check(fun() -> <<X:32/float-big>> = <<2.0:32/float-big>>, X end,
+ check(fun() -> <<X:32/float-big>> = <<2.0:32/float-big>>, X end,
"begin <<X:32/float-big>> = <<2.0:32/float-big>>,
X end.",
2.0),
- ?line check(fun() -> <<X:32/float-little>> = <<2.0:32/float-little>>,
+ check(fun() -> <<X:32/float-little>> = <<2.0:32/float-little>>,
X end,
"begin <<X:32/float-little>> = <<2.0:32/float-little>>,
X end.",
2.0),
- ?line check(fun() -> <<X:32/float-native>> = <<2.0:32/float-native>>,
+ check(fun() -> <<X:32/float-native>> = <<2.0:32/float-native>>,
X end,
"begin <<X:32/float-native>> = <<2.0:32/float-native>>,
X end.",
2.0),
- ?line check(
+ check(
fun() ->
[X || <<"hej",X:8>> <= <<"hej",8,"san",9,"hej",17,"hej">>]
end,
"[X || <<\"hej\",X:8>> <=
<<\"hej\",8,\"san\",9,\"hej\",17,\"hej\">>].",
[8,17]),
- ?line check(
+ check(
fun() ->
L = 8, << <<B:32>> || <<L:L,B:L>> <= <<16:8, 7:16>> >>
end,
@@ -783,41 +734,41 @@ otp_6543(Config) when is_list(Config) ->
<<0,0,0,7>>),
%% Test the Value part of a binary segment.
%% "Old" bugs have been fixed (partial_eval is called on Value).
- ?line check(fun() -> [ 3 || <<17/float>> <= <<17.0/float>>] end,
+ check(fun() -> [ 3 || <<17/float>> <= <<17.0/float>>] end,
"[ 3 || <<17/float>> <= <<17.0/float>>].",
[3]),
- ?line check(fun() -> [ 3 || <<17/float>> <- [<<17.0/float>>]] end,
+ check(fun() -> [ 3 || <<17/float>> <- [<<17.0/float>>]] end,
"[ 3 || <<17/float>> <- [<<17.0/float>>]].",
[3]),
- ?line check(fun() -> [ X || <<17/float,X:3>> <= <<17.0/float,2:3>>] end,
+ check(fun() -> [ X || <<17/float,X:3>> <= <<17.0/float,2:3>>] end,
"[ X || <<17/float,X:3>> <= <<17.0/float,2:3>>].",
[2]),
- ?line check(fun() ->
+ check(fun() ->
[ foo || <<(1 bsl 1023)/float>> <= <<(1 bsl 1023)/float>>]
end,
"[ foo || <<(1 bsl 1023)/float>> <= <<(1 bsl 1023)/float>>].",
[foo]),
- ?line check(fun() ->
+ check(fun() ->
[ foo || <<(1 bsl 1023)/float>> <- [<<(1 bsl 1023)/float>>]]
end,
"[ foo || <<(1 bsl 1023)/float>> <- [<<(1 bsl 1023)/float>>]].",
[foo]),
- ?line error_check("[ foo || <<(1 bsl 1024)/float>> <-
+ error_check("[ foo || <<(1 bsl 1024)/float>> <-
[<<(1 bsl 1024)/float>>]].",
badarg),
- ?line check(fun() ->
+ check(fun() ->
[ foo || <<(1 bsl 1024)/float>> <- [<<(1 bsl 1023)/float>>]]
end,
"[ foo || <<(1 bsl 1024)/float>> <-
[<<(1 bsl 1023)/float>>]].",
[]),
- ?line check(fun() ->
+ check(fun() ->
[ foo || <<(1 bsl 1024)/float>> <= <<(1 bsl 1023)/float>>]
end,
"[ foo || <<(1 bsl 1024)/float>> <=
<<(1 bsl 1023)/float>>].",
[]),
- ?line check(fun() ->
+ check(fun() ->
L = 8,
[{L,B} || <<L:L,B:L/float>> <= <<32:8,7:32/float>>]
end,
@@ -825,7 +776,7 @@ otp_6543(Config) when is_list(Config) ->
[{L,B} || <<L:L,B:L/float>> <= <<32:8,7:32/float>>]
end.",
[{32,7.0}]),
- ?line check(fun() ->
+ check(fun() ->
L = 8,
[{L,B} || <<L:L,B:L/float>> <- [<<32:8,7:32/float>>]]
end,
@@ -833,127 +784,117 @@ otp_6543(Config) when is_list(Config) ->
[{L,B} || <<L:L,B:L/float>> <- [<<32:8,7:32/float>>]]
end.",
[{32,7.0}]),
- ?line check(fun() ->
+ check(fun() ->
[foo || <<"s">> <= <<"st">>]
end,
"[foo || <<\"s\">> <= <<\"st\">>].",
[foo]),
- ?line check(fun() -> <<_:32>> = <<17:32>> end,
+ check(fun() -> <<_:32>> = <<17:32>> end,
"<<_:32>> = <<17:32>>.",
<<17:32>>),
- ?line check(fun() -> [foo || <<_:32>> <= <<17:32,20:32>>] end,
+ check(fun() -> [foo || <<_:32>> <= <<17:32,20:32>>] end,
"[foo || <<_:32>> <= <<17:32,20:32>>].",
[foo,foo]),
- ?line check(fun() -> << <<X:32>> || X <- [1,2,3], X > 1 >> end,
+ check(fun() -> << <<X:32>> || X <- [1,2,3], X > 1 >> end,
"<< <<X:32>> || X <- [1,2,3], X > 1 >>.",
<<0,0,0,2,0,0,0,3>>),
- ?line error_check("[X || <<X>> <= [a,b]].",{bad_generator,[a,b]}),
+ error_check("[X || <<X>> <= [a,b]].",{bad_generator,[a,b]}),
ok.
-otp_6787(doc) ->
- ["OTP-6787. bitlevel binaries."];
-otp_6787(suite) ->
- [];
+%% OTP-6787. bitlevel binaries.
otp_6787(Config) when is_list(Config) ->
- ?line check(
+ check(
fun() -> <<16:(1024*1024)>> = <<16:(1024*1024)>> end,
"<<16:(1024*1024)>> = <<16:(1024*1024)>>.",
<<16:1048576>>),
ok.
-otp_6977(doc) ->
- ["OTP-6977. ++ bug."];
-otp_6977(suite) ->
- [];
+%% OTP-6977. ++ bug.
otp_6977(Config) when is_list(Config) ->
- ?line check(
+ check(
fun() -> (fun([$X] ++ _) -> ok end)("X") end,
"(fun([$X] ++ _) -> ok end)(\"X\").",
ok),
ok.
-otp_7550(doc) ->
- ["OTP-7550. Support for UTF-8, UTF-16, UTF-32."];
+%% OTP-7550. Support for UTF-8, UTF-16, UTF-32.
otp_7550(Config) when is_list(Config) ->
%% UTF-8.
- ?line check(
+ check(
fun() -> <<65>> = <<65/utf8>> end,
"<<65>> = <<65/utf8>>.",
<<65>>),
- ?line check(
+ check(
fun() -> <<350/utf8>> = <<197,158>> end,
"<<350/utf8>> = <<197,158>>.",
<<197,158>>),
- ?line check(
+ check(
fun() -> <<$b,$j,$\303,$\266,$r,$n>> = <<"bj\366rn"/utf8>> end,
"<<$b,$j,$\303,$\266,$r,$n>> = <<\"bj\366rn\"/utf8>>.",
<<$b,$j,$\303,$\266,$r,$n>>),
%% UTF-16.
- ?line check(
+ check(
fun() -> <<0,65>> = <<65/utf16>> end,
"<<0,65>> = <<65/utf16>>.",
<<0,65>>),
- ?line check(
+ check(
fun() -> <<16#D8,16#08,16#DF,16#45>> = <<16#12345/utf16>> end,
"<<16#D8,16#08,16#DF,16#45>> = <<16#12345/utf16>>.",
<<16#D8,16#08,16#DF,16#45>>),
- ?line check(
+ check(
fun() -> <<16#08,16#D8,16#45,16#DF>> = <<16#12345/little-utf16>> end,
"<<16#08,16#D8,16#45,16#DF>> = <<16#12345/little-utf16>>.",
<<16#08,16#D8,16#45,16#DF>>),
- ?line check(
+ check(
fun() -> <<350/utf16>> = <<1,94>> end,
"<<350/utf16>> = <<1,94>>.",
<<1,94>>),
- ?line check(
+ check(
fun() -> <<350/little-utf16>> = <<94,1>> end,
"<<350/little-utf16>> = <<94,1>>.",
<<94,1>>),
- ?line check(
+ check(
fun() -> <<16#12345/utf16>> = <<16#D8,16#08,16#DF,16#45>> end,
"<<16#12345/utf16>> = <<16#D8,16#08,16#DF,16#45>>.",
<<16#D8,16#08,16#DF,16#45>>),
- ?line check(
+ check(
fun() -> <<16#12345/little-utf16>> = <<16#08,16#D8,16#45,16#DF>> end,
"<<16#12345/little-utf16>> = <<16#08,16#D8,16#45,16#DF>>.",
<<16#08,16#D8,16#45,16#DF>>),
%% UTF-32.
- ?line check(
+ check(
fun() -> <<16#12345/utf32>> = <<16#0,16#01,16#23,16#45>> end,
"<<16#12345/utf32>> = <<16#0,16#01,16#23,16#45>>.",
<<16#0,16#01,16#23,16#45>>),
- ?line check(
+ check(
fun() -> <<16#0,16#01,16#23,16#45>> = <<16#12345/utf32>> end,
"<<16#0,16#01,16#23,16#45>> = <<16#12345/utf32>>.",
<<16#0,16#01,16#23,16#45>>),
- ?line check(
+ check(
fun() -> <<16#12345/little-utf32>> = <<16#45,16#23,16#01,16#00>> end,
"<<16#12345/little-utf32>> = <<16#45,16#23,16#01,16#00>>.",
<<16#45,16#23,16#01,16#00>>),
- ?line check(
+ check(
fun() -> <<16#12345/little-utf32>> end,
"<<16#12345/little-utf32>>.",
<<16#45,16#23,16#01,16#00>>),
%% Mixed.
- ?line check(
+ check(
fun() -> <<16#41,16#12345/utf32,16#0391:16,16#2E:8>> end,
"<<16#41,16#12345/utf32,16#0391:16,16#2E:8>>.",
<<16#41,16#00,16#01,16#23,16#45,16#03,16#91,16#2E>>),
ok.
-otp_8133(doc) ->
- ["OTP-8133. Bit comprehension bug."];
-otp_8133(suite) ->
- [];
+%% OTP-8133. Bit comprehension bug.
otp_8133(Config) when is_list(Config) ->
- ?line check(
+ check(
fun() ->
E = fun(N) ->
if
@@ -976,7 +917,7 @@ otp_8133(Config) when is_list(Config) ->
end
end.",
ok),
- ?line check(
+ check(
fun() ->
E = fun(N) ->
if
@@ -1002,10 +943,7 @@ otp_8133(Config) when is_list(Config) ->
ok),
ok.
-otp_10622(doc) ->
- ["OTP-10622. Bugs."];
-otp_10622(suite) ->
- [];
+%% OTP-10622. Bugs.
otp_10622(Config) when is_list(Config) ->
check(fun() -> <<0>> = <<"\x{400}">> end,
"<<0>> = <<\"\\x{400}\">>. ",
@@ -1044,51 +982,47 @@ otp_10622(Config) when is_list(Config) ->
ok.
-otp_13228(doc) ->
- ["OTP-13228. ERL-32: non-local function handler bug."];
+%% OTP-13228. ERL-32: non-local function handler bug.
otp_13228(_Config) ->
LFH = {value, fun(foo, [io_fwrite]) -> worked end},
EFH = {value, fun({io, fwrite}, [atom]) -> io_fwrite end},
{value, worked, []} = parse_and_run("foo(io:fwrite(atom)).", LFH, EFH).
-funs(doc) ->
- ["Simple cases, just to cover some code."];
-funs(suite) ->
- [];
+%% Simple cases, just to cover some code.
funs(Config) when is_list(Config) ->
do_funs(none, none),
do_funs(lfh(), none),
do_funs(lfh(), efh()),
- ?line error_check("nix:foo().", {access_not_allowed,nix}, lfh(), efh()),
- ?line error_check("bar().", undef, none, none),
+ error_check("nix:foo().", {access_not_allowed,nix}, lfh(), efh()),
+ error_check("bar().", undef, none, none),
- ?line check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
+ check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
F1(F1, 1000) end,
"begin F1 = fun(F,N) -> count_down(F, N) end,"
"F1(F1,1000) end.",
0, ['F1'], lfh(), none),
- ?line check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
+ check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
F1(F1, 1000) end,
"begin F1 = fun(F,N) -> count_down(F, N) end,"
"F1(F1,1000) end.",
0, ['F1'], lfh_value(), none),
- ?line check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
+ check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
F1(F1, 1000) end,
"begin F1 = fun(F,N) -> count_down(F, N) end,"
"F1(F1,1000) end.",
0, ['F1'], lfh_value_extra(), none),
- ?line check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
+ check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
F1(F1, 1000) end,
"begin F1 = fun(F,N) -> count_down(F, N) end,"
"F1(F1,1000) end.",
0, ['F1'], {?MODULE,local_func_value}, none),
%% This is not documented, and only for backward compatibility (good!).
B0 = erl_eval:new_bindings(),
- ?line check(fun() -> is_function(?MODULE:count_down_fun()) end,
+ check(fun() -> is_function(?MODULE:count_down_fun()) end,
"begin is_function(count_down_fun()) end.",
true, [], {?MODULE,local_func,[B0]},none),
@@ -1096,19 +1030,19 @@ funs(Config) when is_list(Config) ->
({M,F}, As) -> apply(M, F, As)
end,
EFH = {value, EF},
- ?line error_check("apply(timer, sleep, [1]).", got_it, none, EFH),
- ?line error_check("begin F = fun(T) -> timer:sleep(T) end,F(1) end.",
+ error_check("apply(timer, sleep, [1]).", got_it, none, EFH),
+ error_check("begin F = fun(T) -> timer:sleep(T) end,F(1) end.",
got_it, none, EFH),
- ?line error_check("fun c/1.", undef),
- ?line error_check("fun a:b/0().", undef),
+ error_check("fun c/1.", undef),
+ error_check("fun a:b/0().", undef),
MaxArgs = 20,
- ?line [true] =
+ [true] =
lists:usort([run_many_args(SAs) || SAs <- many_args(MaxArgs)]),
- ?line {'EXIT',{{argument_limit,_},_}} =
+ {'EXIT',{{argument_limit,_},_}} =
(catch run_many_args(many_args1(MaxArgs+1))),
- ?line check(fun() -> M = lists, F = fun M:reverse/1,
+ check(fun() -> M = lists, F = fun M:reverse/1,
[1,2] = F([2,1]), ok end,
"begin M = lists, F = fun M:reverse/1,"
" [1,2] = F([2,1]), ok end.",
@@ -1142,17 +1076,17 @@ do_funs(LFH, EFH) ->
%% manually with 1000 replaced by 1000000.
M = atom_to_list(?MODULE),
- ?line check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
+ check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
F1(F1, 1000) end,
concat(["begin F1 = fun(F,N) -> ", M,
":count_down(F, N) end, F1(F1,1000) end."]),
0, ['F1'], LFH, EFH),
- ?line check(fun() -> F1 = fun(F,N) -> apply(?MODULE,count_down,[F,N])
+ check(fun() -> F1 = fun(F,N) -> apply(?MODULE,count_down,[F,N])
end, F1(F1, 1000) end,
concat(["begin F1 = fun(F,N) -> apply(", M,
",count_down,[F, N]) end, F1(F1,1000) end."]),
0, ['F1'], LFH, EFH),
- ?line check(fun() -> F = fun(F,N) when N > 0 -> apply(F,[F,N-1]);
+ check(fun() -> F = fun(F,N) when N > 0 -> apply(F,[F,N-1]);
(_F,0) -> ok end,
F(F, 1000)
end,
@@ -1160,7 +1094,7 @@ do_funs(LFH, EFH) ->
"(_F,0) -> ok end,"
"F(F, 1000) end.",
ok, ['F'], LFH, EFH),
- ?line check(fun() -> F = fun(F,N) when N > 0 ->
+ check(fun() -> F = fun(F,N) when N > 0 ->
apply(erlang,apply,[F,[F,N-1]]);
(_F,0) -> ok end,
F(F, 1000)
@@ -1170,7 +1104,7 @@ do_funs(LFH, EFH) ->
"(_F,0) -> ok end,"
"F(F, 1000) end.",
ok, ['F'], LFH, EFH),
- ?line check(fun() -> F = count_down_fun(),
+ check(fun() -> F = count_down_fun(),
SF = fun(SF, F1, N) -> F(SF, F1, N) end,
SF(SF, F, 1000) end,
concat(["begin F = ", M, ":count_down_fun(),"
@@ -1179,7 +1113,7 @@ do_funs(LFH, EFH) ->
ok, ['F','SF'], LFH, EFH),
- ?line check(fun() -> F = fun(X) -> A = 1+X, {X,A} end,
+ check(fun() -> F = fun(X) -> A = 1+X, {X,A} end,
true = {2,3} == F(2) end,
"begin F = fun(X) -> A = 1+X, {X,A} end,
true = {2,3} == F(2) end.", true, ['F'], LFH, EFH),
@@ -1188,13 +1122,13 @@ do_funs(LFH, EFH) ->
"begin F = fun(X) -> erlang:'+'(X,2) end,"
" true = 3 == F(1) end.", true, ['F'],
LFH, EFH),
- ?line check(fun() -> F = fun(X) -> byte_size(X) end,
+ check(fun() -> F = fun(X) -> byte_size(X) end,
?MODULE:do_apply(F,<<"hej">>) end,
concat(["begin F = fun(X) -> size(X) end,",
M,":do_apply(F,<<\"hej\">>) end."]),
3, ['F'], LFH, EFH),
- ?line check(fun() -> F1 = fun(X, Z) -> {X,Z} end,
+ check(fun() -> F1 = fun(X, Z) -> {X,Z} end,
Z = 5,
F2 = fun(X, Y) -> F1(Z,{X,Y}) end,
F3 = fun(X, Y) -> {a,F1(Z,{X,Y})} end,
@@ -1211,26 +1145,26 @@ do_funs(LFH, EFH) ->
{5,{5,y}} = F2(Z,y),
true = {5,{x,5}} == F2(x,Z) end.",
true, ['F1','Z','F2','F3'], LFH, EFH),
- ?line check(fun() -> F = fun(X) -> byte_size(X) end,
+ check(fun() -> F = fun(X) -> byte_size(X) end,
F2 = fun(Y) -> F(Y) end,
?MODULE:do_apply(F2,<<"hej">>) end,
concat(["begin F = fun(X) -> size(X) end,",
"F2 = fun(Y) -> F(Y) end,",
M,":do_apply(F2,<<\"hej\">>) end."]),
3, ['F','F2'], LFH, EFH),
- ?line check(fun() -> Z = 5, F = fun(X) -> {Z,X} end,
+ check(fun() -> Z = 5, F = fun(X) -> {Z,X} end,
F2 = fun(Z) -> F(Z) end, F2(3) end,
"begin Z = 5, F = fun(X) -> {Z,X} end,
F2 = fun(Z) -> F(Z) end, F2(3) end.",
{5,3},['F','F2','Z'], LFH, EFH),
- ?line check(fun() -> F = fun(Z) -> Z end,
+ check(fun() -> F = fun(Z) -> Z end,
F2 = fun(X) -> F(X), Z = {X,X}, Z end,
{1,1} = F2(1), Z = 7, Z end,
"begin F = fun(Z) -> Z end,
F2 = fun(X) -> F(X), Z = {X,X}, Z end,
{1,1} = F2(1), Z = 7, Z end.", 7, ['F','F2','Z'],
LFH, EFH),
- ?line check(fun() -> F = fun(F, N) -> [?MODULE:count_down(F,N) || X <-[1]]
+ check(fun() -> F = fun(F, N) -> [?MODULE:count_down(F,N) || X <-[1]]
end, F(F,2) end,
concat(["begin F = fun(F, N) -> [", M,
":count_down(F,N) || X <-[1]] end, F(F,2) end."]),
@@ -1289,45 +1223,42 @@ external_func({M,F}, As) ->
-try_catch(doc) ->
- ["Test try-of-catch-after-end statement"];
-try_catch(suite) ->
- [];
+%% Test try-of-catch-after-end statement.
try_catch(Config) when is_list(Config) ->
%% Match in of with catch
- ?line check(fun() -> try 1 of 1 -> 2 catch _:_ -> 3 end end,
+ check(fun() -> try 1 of 1 -> 2 catch _:_ -> 3 end end,
"try 1 of 1 -> 2 catch _:_ -> 3 end.", 2),
- ?line check(fun() -> try 1 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end end,
+ check(fun() -> try 1 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end end,
"try 1 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end.", 2),
- ?line check(fun() -> try 3 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end end,
+ check(fun() -> try 3 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end end,
"try 3 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end.", 4),
%% Just after
- ?line check(fun () -> X = try 1 after put(try_catch, 2) end,
+ check(fun () -> X = try 1 after put(try_catch, 2) end,
{X,get(try_catch)} end,
"begin X = try 1 after put(try_catch, 2) end, "
"{X,get(try_catch)} end.", {1,2}),
%% Match in of with after
- ?line check(fun() -> X = try 1 of 1 -> 2 after put(try_catch, 3) end,
+ check(fun() -> X = try 1 of 1 -> 2 after put(try_catch, 3) end,
{X,get(try_catch)} end,
"begin X = try 1 of 1 -> 2 after put(try_catch, 3) end, "
"{X,get(try_catch)} end.", {2,3}),
- ?line check(fun() -> X = try 1 of 1 -> 2; 3 -> 4
+ check(fun() -> X = try 1 of 1 -> 2; 3 -> 4
after put(try_catch, 5) end,
{X,get(try_catch)} end,
"begin X = try 1 of 1 -> 2; 3 -> 4 "
" after put(try_catch, 5) end, "
" {X,get(try_catch)} end.", {2,5}),
- ?line check(fun() -> X = try 3 of 1 -> 2; 3 -> 4
+ check(fun() -> X = try 3 of 1 -> 2; 3 -> 4
after put(try_catch, 5) end,
{X,get(try_catch)} end,
"begin X = try 3 of 1 -> 2; 3 -> 4 "
" after put(try_catch, 5) end, "
" {X,get(try_catch)} end.", {4,5}),
%% Nomatch in of
- ?line error_check("try 1 of 2 -> 3 catch _:_ -> 4 end.",
+ error_check("try 1 of 2 -> 3 catch _:_ -> 4 end.",
{try_clause,1}),
%% Nomatch in of with after
- ?line check(fun () -> {'EXIT',{{try_clause,1},_}} =
+ check(fun () -> {'EXIT',{{try_clause,1},_}} =
begin catch try 1 of 2 -> 3
after put(try_catch, 4) end end,
get(try_catch) end,
@@ -1336,14 +1267,14 @@ try_catch(Config) when is_list(Config) ->
" after put(try_catch, 4) end end, "
" get(try_catch) end. ", 4),
%% Exception in try
- ?line check(fun () -> try 1=2 catch error:{badmatch,2} -> 3 end end,
+ check(fun () -> try 1=2 catch error:{badmatch,2} -> 3 end end,
"try 1=2 catch error:{badmatch,2} -> 3 end.", 3),
- ?line check(fun () -> try 1=2 of 3 -> 4
+ check(fun () -> try 1=2 of 3 -> 4
catch error:{badmatch,2} -> 5 end end,
"try 1=2 of 3 -> 4 "
"catch error:{badmatch,2} -> 5 end.", 5),
%% Exception in try with after
- ?line check(fun () -> X = try 1=2
+ check(fun () -> X = try 1=2
catch error:{badmatch,2} -> 3
after put(try_catch, 4) end,
{X,get(try_catch)} end,
@@ -1351,7 +1282,7 @@ try_catch(Config) when is_list(Config) ->
" catch error:{badmatch,2} -> 3 "
" after put(try_catch, 4) end, "
" {X,get(try_catch)} end. ", {3,4}),
- ?line check(fun () -> X = try 1=2 of 3 -> 4
+ check(fun () -> X = try 1=2 of 3 -> 4
catch error:{badmatch,2} -> 5
after put(try_catch, 6) end,
{X,get(try_catch)} end,
@@ -1360,12 +1291,12 @@ try_catch(Config) when is_list(Config) ->
" after put(try_catch, 6) end, "
" {X,get(try_catch)} end. ", {5,6}),
%% Uncaught exception
- ?line error_check("try 1=2 catch error:undefined -> 3 end. ",
+ error_check("try 1=2 catch error:undefined -> 3 end. ",
{badmatch,2}),
- ?line error_check("try 1=2 of 3 -> 4 catch error:undefined -> 5 end. ",
+ error_check("try 1=2 of 3 -> 4 catch error:undefined -> 5 end. ",
{badmatch,2}),
%% Uncaught exception with after
- ?line check(fun () -> {'EXIT',{{badmatch,2},_}} =
+ check(fun () -> {'EXIT',{{badmatch,2},_}} =
begin catch try 1=2
after put(try_catch, 3) end end,
get(try_catch) end,
@@ -1373,7 +1304,7 @@ try_catch(Config) when is_list(Config) ->
" begin catch try 1=2 "
" after put(try_catch, 3) end end, "
" get(try_catch) end. ", 3),
- ?line check(fun () -> {'EXIT',{{badmatch,2},_}} =
+ check(fun () -> {'EXIT',{{badmatch,2},_}} =
begin catch try 1=2 of 3 -> 4
after put(try_catch, 5) end end,
get(try_catch) end,
@@ -1381,7 +1312,7 @@ try_catch(Config) when is_list(Config) ->
" begin catch try 1=2 of 3 -> 4"
" after put(try_catch, 5) end end, "
" get(try_catch) end. ", 5),
- ?line check(fun () -> {'EXIT',{{badmatch,2},_}} =
+ check(fun () -> {'EXIT',{{badmatch,2},_}} =
begin catch try 1=2 catch error:undefined -> 3
after put(try_catch, 4) end end,
get(try_catch) end,
@@ -1389,7 +1320,7 @@ try_catch(Config) when is_list(Config) ->
" begin catch try 1=2 catch error:undefined -> 3 "
" after put(try_catch, 4) end end, "
" get(try_catch) end. ", 4),
- ?line check(fun () -> {'EXIT',{{badmatch,2},_}} =
+ check(fun () -> {'EXIT',{{badmatch,2},_}} =
begin catch try 1=2 of 3 -> 4
catch error:undefined -> 5
after put(try_catch, 6) end end,
@@ -1402,26 +1333,23 @@ try_catch(Config) when is_list(Config) ->
ok.
-eval_expr_5(doc) ->
- ["(OTP-7933)"];
-eval_expr_5(suite) ->
- [];
+%% OTP-7933.
eval_expr_5(Config) when is_list(Config) ->
- ?line {ok,Tokens ,_} =
+ {ok,Tokens ,_} =
erl_scan:string("if a+4 == 4 -> yes; true -> no end. "),
- ?line {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
- ?line {value, no, []} = erl_eval:expr(Expr, [], none, none, none),
- ?line no = erl_eval:expr(Expr, [], none, none, value),
+ {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
+ {value, no, []} = erl_eval:expr(Expr, [], none, none, none),
+ no = erl_eval:expr(Expr, [], none, none, value),
try
erl_eval:expr(Expr, [], none, none, 4711),
- ?line function_clause = should_never_reach_here
+ function_clause = should_never_reach_here
catch
error:function_clause ->
ok
end.
zero_width(Config) when is_list(Config) ->
- ?line check(fun() ->
+ check(fun() ->
{'EXIT',{badarg,_}} = (catch <<not_a_number:0>>),
ok
end, "begin {'EXIT',{badarg,_}} = (catch <<not_a_number:0>>), "
@@ -1524,7 +1452,7 @@ check1(F, String, Result) ->
{value, Result, _} ->
ok;
Other ->
- test_server:fail({eval, Other, Result})
+ ct:fail({eval, Other, Result})
end.
check(F, String, Result, BoundVars, LFH, EFH) ->
@@ -1537,11 +1465,11 @@ check(F, String, Result, BoundVars, LFH, EFH) ->
true ->
ok;
false ->
- test_server:fail({check, BoundVars, Keys})
+ ct:fail({check, BoundVars, Keys})
end,
ok;
Other ->
- test_server:fail({check, Other, Result})
+ ct:fail({check, Other, Result})
end.
error_check(String, Result) ->
@@ -1549,7 +1477,7 @@ error_check(String, Result) ->
{'EXIT', {Result,_}} ->
ok;
Other ->
- test_server:fail({eval, Other, Result})
+ ct:fail({eval, Other, Result})
end.
error_check(String, Result, LFH, EFH) ->
@@ -1557,7 +1485,7 @@ error_check(String, Result, LFH, EFH) ->
{'EXIT', {Result,_}} ->
ok;
Other ->
- test_server:fail({eval, Other, Result})
+ ct:fail({eval, Other, Result})
end.
eval_string(String) ->
diff --git a/lib/stdlib/test/erl_expand_records_SUITE.erl b/lib/stdlib/test/erl_expand_records_SUITE.erl
index 2cc4757c04..7fed7fce56 100644
--- a/lib/stdlib/test/erl_expand_records_SUITE.erl
+++ b/lib/stdlib/test/erl_expand_records_SUITE.erl
@@ -20,7 +20,7 @@
-module(erl_expand_records_SUITE).
-%-define(debug, true).
+%%-define(debug, true).
-ifdef(debug).
-define(line, put(line, ?LINE), ).
@@ -29,7 +29,7 @@
-define(t, test_server).
-else.
-include_lib("common_test/include/ct.hrl").
--define(privdir, ?config(priv_dir, Config)).
+-define(privdir, proplists:get_value(priv_dir, Config)).
-endif.
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
@@ -41,19 +41,15 @@
otp_5915/1, otp_7931/1, otp_5990/1,
otp_7078/1, otp_7101/1, maps/1]).
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
+ Config.
end_per_testcase(_Case, _Config) ->
- Dog = ?config(watchdog, _Config),
- test_server:timetrap_cancel(Dog),
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[attributes, expr, guard, init,
@@ -76,30 +72,26 @@ end_per_group(_GroupName, Config) ->
Config.
-attributes(doc) ->
- "Import module and functions.";
-attributes(suite) -> [];
+%% Import module and functions.
attributes(Config) when is_list(Config) ->
Ts = [
- <<"-import(lists, [append/2, reverse/1]).
+ <<"-import(lists, [append/2, reverse/1]).
-record(r, {a,b}).
- t() ->
- [2,1] = reverse(append([1],[2])),
- 3 = length([1,2,3]),
- 3 = record_info(size, r),
- [a, b] = record_info(fields, r),
- [] = erl_expand_records_SUITE:attributes(suite),
- ok.
- ">>
+t() ->
+ [2,1] = reverse(append([1],[2])),
+ 3 = length([1,2,3]),
+ 3 = record_info(size, r),
+ [a, b] = record_info(fields, r),
+ [_|_] = erl_expand_records_SUITE:all(),
+ ok.
+">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-expr(doc) ->
- "Some expressions.";
-expr(suite) -> [];
+%% Some expressions.
expr(Config) when is_list(Config) ->
Ts = [
<<"
@@ -159,14 +151,12 @@ expr(Config) when is_list(Config) ->
%% The code above should run equally well with and without
%% strict record tests.
- ?line run(Config, Ts, [no_strict_record_tests]),
- ?line run(Config, Ts, [strict_record_tests]),
+ run(Config, Ts, [no_strict_record_tests]),
+ run(Config, Ts, [strict_record_tests]),
ok.
-guard(doc) ->
- "is_record in guards.";
-guard(suite) -> [];
+%% is_record in guards.
guard(Config) when is_list(Config) ->
File = filename("guard.erl", Config),
Beam = filename("guard.beam", Config),
@@ -202,18 +192,16 @@ guard(Config) when is_list(Config) ->
12.
">>,
- ?line ok = file:write_file(File, Test),
- ?line {ok, guard, Ws} = compile:file(File, [return,{outdir,?privdir}]),
- ?line Warnings = [L || {_File,WL} <- Ws, {L,_M,nomatch_guard} <- WL],
- ?line [7,9,11,13,15,17,19,21,23,25,27] = Warnings,
+ ok = file:write_file(File, Test),
+ {ok, guard, Ws} = compile:file(File, [return,{outdir,?privdir}]),
+ Warnings = [L || {_File,WL} <- Ws, {L,_M,nomatch_guard} <- WL],
+ [7,9,11,13,15,17,19,21,23,25,27] = Warnings,
- ?line ok = file:delete(File),
- ?line ok = file:delete(Beam),
+ ok = file:delete(File),
+ ok = file:delete(Beam),
ok.
-init(doc) ->
- "Wildcard initialisation.";
-init(suite) -> [];
+%% Wildcard initialisation.
init(Config) when is_list(Config) ->
Ts = [
<<"
@@ -228,12 +216,10 @@ init(Config) when is_list(Config) ->
end.
">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-pattern(doc) ->
- "Some patterns.";
-pattern(suite) -> [];
+%% Some patterns.
pattern(Config) when is_list(Config) ->
Ts = [
<<"-import(lists, [append/2, reverse/1]).
@@ -317,12 +303,9 @@ pattern(Config) when is_list(Config) ->
16.
">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-strict(doc) ->
- "";
-strict(suite) -> [];
strict(Config) when is_list(Config) ->
Ts1 = [
<<"-record(r1, {a,b}).
@@ -345,7 +328,7 @@ strict(Config) when is_list(Config) ->
error(wrong_element).
">>
],
- ?line run(Config, Ts1, [strict_record_tests]),
+ run(Config, Ts1, [strict_record_tests]),
Ts2 = [
<<"-record(r1, {a,b}).
@@ -361,12 +344,10 @@ strict(Config) when is_list(Config) ->
error(wrong_element).
">>
],
- ?line run(Config, Ts2, [no_strict_record_tests]),
+ run(Config, Ts2, [no_strict_record_tests]),
ok.
-update(doc) ->
- "Record updates.";
-update(suite) -> [];
+%% Record updates.
update(Config) when is_list(Config) ->
Ts = [
<<"-record(r, {a,b,c,d,e,f}).
@@ -401,7 +382,7 @@ update(Config) when is_list(Config) ->
erlang:error(wrong_setelement_called).
">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
maps(Config) when is_list(Config) ->
@@ -420,9 +401,7 @@ maps(Config) when is_list(Config) ->
run(Config, Ts, [strict_record_tests]),
ok.
-otp_5915(doc) ->
- "Strict record tests in guards.";
-otp_5915(suite) -> [];
+%% Strict record tests in guards.
otp_5915(Config) when is_list(Config) ->
%% These tests are also run by the compiler's record_SUITE.
Ts = [
@@ -565,12 +544,10 @@ otp_5915(Config) when is_list(Config) ->
ok.
">>
],
- ?line run(Config, Ts, [strict_record_tests]),
+ run(Config, Ts, [strict_record_tests]),
ok.
-otp_7931(doc) ->
- "Test optimization of record accesses and is_record/3 tests in guards";
-otp_7931(suite) -> [];
+%% Test optimization of record accesses and is_record/3 tests in guards.
otp_7931(Config) when is_list(Config) ->
Ts = [
<<"-record(r, {a = 4,b}).
@@ -654,12 +631,10 @@ otp_7931(Config) when is_list(Config) ->
ok.
">>
],
- ?line run(Config, Ts, [strict_record_tests]),
+ run(Config, Ts, [strict_record_tests]),
ok.
-otp_5990(doc) ->
- "OTP-5990. {erlang,is_record}.";
-otp_5990(suite) -> [];
+%% OTP-5990. {erlang,is_record}.
otp_5990(Config) when is_list(Config) ->
Ts = [
<<"
@@ -690,13 +665,11 @@ otp_5990(Config) when is_list(Config) ->
ok.
">>
],
- ?line run(Config, Ts, [strict_record_tests]),
+ run(Config, Ts, [strict_record_tests]),
ok.
-otp_7078(doc) ->
- "OTP-7078. Record update: missing test.";
-otp_7078(suite) -> [];
+%% OTP-7078. Record update: missing test.
otp_7078(Config) when is_list(Config) ->
Ts = [
<<"
@@ -724,14 +697,12 @@ otp_7078(Config) when is_list(Config) ->
">>
],
- ?line run(Config, Ts, [strict_record_tests]),
+ run(Config, Ts, [strict_record_tests]),
ok.
-record(otp_7101, {a,b,c=[],d=[],e=[]}).
-otp_7101(doc) ->
- "OTP-7101. Record update: more than one call to setelement/3.";
-otp_7101(suite) -> [];
+%% OTP-7101. Record update: more than one call to setelement/3.
otp_7101(Config) when is_list(Config) ->
Rec = #otp_7101{},
@@ -739,28 +710,28 @@ otp_7101(Config) when is_list(Config) ->
%% The tracer will forward all trace messages to us.
Self = self(),
Tracer = spawn_link(fun() -> otp_7101_tracer(Self, 0) end),
- ?line 1 = erlang:trace_pattern({erlang,setelement,3}, true),
- ?line erlang:trace(self(), true, [{tracer,Tracer},call]),
+ 1 = erlang:trace_pattern({erlang,setelement,3}, true),
+ erlang:trace(self(), true, [{tracer,Tracer},call]),
%% Update the record.
- ?line #otp_7101{a=2,b=1,c=[],d=[],e=[]} = otp_7101_update1(Rec),
- ?line #otp_7101{a=1,b=2,c=[],d=[],e=[]} = otp_7101_update2(Rec),
- ?line #otp_7101{a=2,b=1,c=[],d=[],e=[]} = otp_7101_update3(Rec),
- ?line #otp_7101{a=1,b=2,c=[],d=[],e=[]} = otp_7101_update4(Rec),
+ #otp_7101{a=2,b=1,c=[],d=[],e=[]} = otp_7101_update1(Rec),
+ #otp_7101{a=1,b=2,c=[],d=[],e=[]} = otp_7101_update2(Rec),
+ #otp_7101{a=2,b=1,c=[],d=[],e=[]} = otp_7101_update3(Rec),
+ #otp_7101{a=1,b=2,c=[],d=[],e=[]} = otp_7101_update4(Rec),
%% Verify that setelement/3 was called the same number of times as
%% the number of record updates.
- ?line Ref = erlang:trace_delivered(Self),
+ Ref = erlang:trace_delivered(Self),
receive
{trace_delivered, Self, Ref} ->
Tracer ! done
end,
- ?line 1 = erlang:trace_pattern({erlang,setelement,3}, false),
+ 1 = erlang:trace_pattern({erlang,setelement,3}, false),
receive
4 ->
ok;
Other ->
- ?line ?t:fail({unexpected,Other})
+ ct:fail({unexpected,Other})
end.
otp_7101_tracer(Parent, N) ->
@@ -797,10 +768,9 @@ run(Config, Tests, Opts) ->
AbsFile = filename:rootname(SourceFile, ".erl"),
code:purge(Mod),
code:load_abs(AbsFile, Mod),
-%io:format("run~n"),
case catch Mod:t() of
{'EXIT', _Reason} = Error ->
- ?t:format("failed, got ~p~n", [Error]),
+ io:format("failed, got ~p~n", [Error]),
fail();
ok ->
ok
@@ -837,5 +807,4 @@ warnings(File, Ws) ->
end.
fail() ->
- io:format("failed~n"),
- ?t:fail().
+ ct:fail(failed).
diff --git a/lib/stdlib/test/erl_internal_SUITE.erl b/lib/stdlib/test/erl_internal_SUITE.erl
index ad0b37aae3..45e67226b7 100644
--- a/lib/stdlib/test/erl_internal_SUITE.erl
+++ b/lib/stdlib/test/erl_internal_SUITE.erl
@@ -28,7 +28,9 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[behav].
@@ -49,20 +51,13 @@ end_per_group(_GroupName, Config) ->
Config.
--define(default_timeout, ?t:minutes(2)).
-
init_per_testcase(_Case, Config) ->
- Dog = test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-behav(suite) -> [];
-behav(doc) ->
- ["Check that the behaviour callbacks are correctly defined"];
+%% Check that the behaviour callbacks are correctly defined.
behav(_) ->
Modules = [application, gen_server, gen_fsm, gen_event,
supervisor_bridge, supervisor],
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl
index d946469625..29a389d4b8 100644
--- a/lib/stdlib/test/erl_lint_SUITE.erl
+++ b/lib/stdlib/test/erl_lint_SUITE.erl
@@ -19,7 +19,7 @@
%%
-module(erl_lint_SUITE).
-%-define(debug, true).
+%%-define(debug, true).
-ifdef(debug).
-define(line, put(line, ?LINE), ).
@@ -29,8 +29,8 @@
-define(t, test_server).
-else.
-include_lib("common_test/include/ct.hrl").
--define(datadir, ?config(data_dir, Conf)).
--define(privdir, ?config(priv_dir, Conf)).
+-define(datadir, proplists:get_value(data_dir, Conf)).
+-define(privdir, proplists:get_value(priv_dir, Conf)).
-endif.
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
@@ -69,19 +69,15 @@
record_errors/1
]).
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
+ Config.
end_per_testcase(_Case, _Config) ->
- Dog = ?config(watchdog, _Config),
- test_server:timetrap_cancel(Dog),
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[{group, unused_vars_warn}, export_vars_warn,
@@ -119,50 +115,48 @@ end_per_group(_GroupName, Config) ->
-unused_vars_warn_basic(doc) ->
- "Warnings for unused variables in some simple cases.";
-unused_vars_warn_basic(suite) -> [];
+%% Warnings for unused variables in some simple cases.
unused_vars_warn_basic(Config) when is_list(Config) ->
Ts = [{basic1,
<<"f(F) -> % F unused.
ok.
- f(F, F) ->
- ok.
+f(F, F) ->
+ ok.
- g(_X) ->
- y.
+g(_X) ->
+ y.
- h(P) ->
- P.
+h(P) ->
+ P.
- x(N) ->
- case a:b() of
- [N|Y] -> % Y unused.
- ok
- end.
+x(N) ->
+ case a:b() of
+ [N|Y] -> % Y unused.
+ ok
+ end.
- y(N, L) ->
- lists:map(fun(T) -> T*N end, L).
+y(N, L) ->
+ lists:map(fun(T) -> T*N end, L).
- z(N, L) -> % N unused
- lists:map(fun(N, T) -> T*N end, L). % N shadowed.
+z(N, L) -> % N unused
+ lists:map(fun(N, T) -> T*N end, L). % N shadowed.
- c(A) ->
- case A of
- 1 -> B = []; % B unused.
- 2 -> B = []; % B unused.
- 3 -> B = f, B
- end.
- ">>,
+c(A) ->
+ case A of
+ 1 -> B = []; % B unused.
+ 2 -> B = []; % B unused.
+ 3 -> B = f, B
+ end.
+">>,
[warn_unused_vars],
- {warnings,[{1,erl_lint,{unused_var,'F'}},
- {15,erl_lint,{unused_var,'Y'}},
- {22,erl_lint,{unused_var,'N'}},
- {23,erl_lint,{shadowed_var,'N','fun'}},
- {28,erl_lint,{unused_var,'B'}},
- {29,erl_lint,{unused_var,'B'}}]}},
+{warnings,[{1,erl_lint,{unused_var,'F'}},
+ {15,erl_lint,{unused_var,'Y'}},
+ {22,erl_lint,{unused_var,'N'}},
+ {23,erl_lint,{shadowed_var,'N','fun'}},
+ {28,erl_lint,{unused_var,'B'}},
+ {29,erl_lint,{unused_var,'B'}}]}},
{basic2,
<<"-record(r, {x,y}).
f({X,Y}) -> {Z=X,Z=Y};
@@ -172,12 +166,10 @@ unused_vars_warn_basic(Config) when is_list(Config) ->
g({M, F, Arg}) -> (Z=M):F(Z=Arg).
h(X, Y) -> (Z=X) + (Z=Y).">>,
[warn_unused_vars], []}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-unused_vars_warn_lc(doc) ->
- "Warnings for unused variables in list comprehensions.";
-unused_vars_warn_lc(suite) -> [];
+%% Warnings for unused variables in list comprehensions.
unused_vars_warn_lc(Config) when is_list(Config) ->
Ts = [{lc1,
<<"bin([X]) ->
@@ -404,9 +396,7 @@ unused_vars_warn_lc(Config) when is_list(Config) ->
{error,[{22,erl_lint,{unsafe_var,'U',{'case',2}}},
{27,erl_lint,{unsafe_var,'U',{'case',2}}}],
[{16,erl_lint,{unused_var,'Y'}},
- % {24,erl_lint,{exported_var,'X',{'case',8}}},
{24,erl_lint,{unused_var,'U'}},
- % {26,erl_lint,{exported_var,'X',{'case',8}}},
{26,erl_lint,{unused_var,'U'}}]}},
{lc17,
@@ -436,7 +426,6 @@ unused_vars_warn_lc(Config) when is_list(Config) ->
[warn_unused_vars],
{error,[{22,erl_lint,{unsafe_var,'U',{'case',3}}}],
[{17,erl_lint,{unused_var,'Y'}},
- % {21,erl_lint,{exported_var,'X',{'case',9}}},
{21,erl_lint,{unused_var,'U'}}]}},
{lc18,
@@ -461,14 +450,12 @@ unused_vars_warn_lc(Config) when is_list(Config) ->
end,
[B || <<U: % U unused
U>> <- X, <<B:Y>> <- Z]. % U unsafe. Y unsafe.
- % U shadowed. (X exported.)
+ % U shadowed. (X exported.)
">>,
[warn_unused_vars],
{error,[{21,erl_lint,{unsafe_var,'U',{'case',2}}},
{21,erl_lint,{unsafe_var,'Y',{'case',14}}}],
[{20,erl_lint,{unused_var,'U'}}
- % ,{21,erl_lint,{exported_var,'X',{'case',8}}}
- % ,{21,erl_lint,{shadowed_var,'U',generate}}
]}},
{lc19,
@@ -522,13 +509,11 @@ unused_vars_warn_lc(Config) when is_list(Config) ->
[{14,erl_lint,{unused_var,'Q'}}]}}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-unused_vars_warn_rec(doc) ->
- "Warnings for unused variables in records.";
-unused_vars_warn_rec(suite) -> [];
+%% Warnings for unused variables in records.
unused_vars_warn_rec(Config) when is_list(Config) ->
Ts = [{rec1, % An example provided by Bjorn.
<<"-record(edge,
@@ -580,12 +565,10 @@ unused_vars_warn_rec(Config) when is_list(Config) ->
{error,[{2,erl_lint,{redefine_field,r,a}},
{2,erl_lint,{redefine_field,r,a}}],
[{2,erl_lint,{unused_var,'X'}}]}}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-unused_vars_warn_fun(doc) ->
- "Warnings for unused variables in funs.";
-unused_vars_warn_fun(suite) -> [];
+%% Warnings for unused variables in funs.
unused_vars_warn_fun(Config) when is_list(Config) ->
Ts = [{fun1,
<<"a({A,B}) -> % A unused.
@@ -707,12 +690,10 @@ unused_vars_warn_fun(Config) when is_list(Config) ->
{33,erl_lint,{unused_var,'U'}},
{33,erl_lint,{shadowed_var,'U','fun'}}]}}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-unused_vars_OTP_4858(doc) ->
- "Bit syntax, binsize variable used in the same matching.";
-unused_vars_OTP_4858(suite) -> [];
+%% Bit syntax, binsize variable used in the same matching.
unused_vars_OTP_4858(Config) when is_list(Config) ->
Ts = [{otp_4858,
<<"objs(<<Size:4/unit:8, B:Size/binary>>) ->
@@ -731,7 +712,7 @@ unused_vars_OTP_4858(Config) when is_list(Config) ->
{8,erl_lint,{unused_var,'B'}},
{8,erl_lint,{unused_var,'Rest'}}]}}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
unused_unsafe_vars_warn(Config) when is_list(Config) ->
@@ -776,9 +757,7 @@ unused_unsafe_vars_warn(Config) when is_list(Config) ->
run(Config, Ts),
ok.
-export_vars_warn(doc) ->
- "Warnings for exported variables";
-export_vars_warn(suite) -> [];
+%% Warnings for exported variables.
export_vars_warn(Config) when is_list(Config) ->
Ts = [{exp1,
<<"u() ->
@@ -868,13 +847,11 @@ export_vars_warn(Config) when is_list(Config) ->
[],
{warnings,[{7,erl_lint,{exported_var,'Z',{'if',2}}}]}}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-shadow_vars(doc) ->
- "Shadowed variables are tested in other places, but here we test "
- "that the warning can be turned off.";
-shadow_vars(suite) -> [];
+%% Shadowed variables are tested in other places, but here we test
+%% that the warning can be turned off.
shadow_vars(Config) when is_list(Config) ->
Ts = [{shadow1,
<<"bin(A) ->
@@ -899,12 +876,10 @@ shadow_vars(Config) when is_list(Config) ->
">>,
[],
[]}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-unused_import(doc) ->
- "Test that the 'warn_unused_import' option works.";
-unused_import(suite) -> [];
+%% Test that the 'warn_unused_import' option works.
unused_import(Config) when is_list(Config) ->
Ts = [{imp1,
<<"-import(lists, [map/2,foldl/3]).
@@ -913,12 +888,10 @@ unused_import(Config) when is_list(Config) ->
">>,
[warn_unused_import],
{warnings,[{1,erl_lint,{unused_import,{{foldl,3},lists}}}]}}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-unused_function(doc) ->
- "Test warnings for unused functions.";
-unused_function(suite) -> [];
+%% Test warnings for unused functions.
unused_function(Config) when is_list(Config) ->
Ts = [{func1,
<<"-export([t/1]).
@@ -961,12 +934,10 @@ unused_function(Config) when is_list(Config) ->
{[]}, %Tuple indicates no 'export_all'.
[]}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-unsafe_vars(doc) ->
- "OTP-4671. Errors for unsafe variables";
-unsafe_vars(suite) -> [];
+%% OTP-4671. Errors for unsafe variables.
unsafe_vars(Config) when is_list(Config) ->
Ts = [{unsafe1,
<<"t() ->
@@ -1042,7 +1013,7 @@ unsafe_vars(Config) when is_list(Config) ->
D = 1;
2 ->
A = 2,
- % B not bound here
+ %% B not bound here
C = 2,
catch D = 2; % unsafe in two clauses
3 ->
@@ -1064,12 +1035,10 @@ unsafe_vars(Config) when is_list(Config) ->
{24,erl_lint,{unsafe_var,'D',{'case',2}}}],
[]}}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-unsafe_vars2(doc) ->
- "OTP-4831, seq8202. No warn_unused_vars and unsafe variables";
-unsafe_vars2(suite) -> [];
+%% OTP-4831, seq8202. No warn_unused_vars and unsafe variables.
unsafe_vars2(Config) when is_list(Config) ->
Ts = [{unsafe2_1,
<<"foo(State) ->
@@ -1098,12 +1067,10 @@ unsafe_vars2(Config) when is_list(Config) ->
[],
{errors,[{9,erl_lint,{unsafe_var,'State1',{'if',4}}}],[]}}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-unsafe_vars_try(doc) ->
- "Errors for unsafe variables in try/catch constructs.";
-unsafe_vars_try(suite) -> [];
+%% Errors for unsafe variables in try/catch constructs.
unsafe_vars_try(Config) when is_list(Config) ->
Ts = [{unsafe_try1,
<<"foo2() ->
@@ -1288,12 +1255,10 @@ unsafe_vars_try(Config) when is_list(Config) ->
">>,
[],
{errors,[{13,erl_lint,{unsafe_var,'Acc',{'try',6}}}],[]}}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-unsized_binary_in_bin_gen_pattern(doc) ->
- "Unsized binary fields are forbidden in patterns of bit string generators";
-unsized_binary_in_bin_gen_pattern(suite) -> [];
+%% Unsized binary fields are forbidden in patterns of bit string generators.
unsized_binary_in_bin_gen_pattern(Config) when is_list(Config) ->
Ts = [{unsized_binary_in_bin_gen_pattern,
<<"t({bc,binary,Bin}) ->
@@ -1326,9 +1291,7 @@ unsized_binary_in_bin_gen_pattern(Config) when is_list(Config) ->
[] = run(Config, Ts),
ok.
-guard(doc) ->
- "OTP-4670. Guards, is_record in particular.";
-guard(suite) -> [];
+%% OTP-4670. Guards, is_record in particular.
guard(Config) when is_list(Config) ->
%% Well, these could be plain code...
Ts = [{guard1,
@@ -1543,7 +1506,7 @@ guard(Config) when is_list(Config) ->
">>,
[nowarn_obsolete_guard],
[]}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
Ts1 = [{guard5,
<<"-record(apa, {}).
t3(A) when record(A, {apa}) ->
@@ -1614,12 +1577,10 @@ guard(Config) when is_list(Config) ->
{2,erl_lint,illegal_guard_expr}],
[]}}
],
- ?line [] = run(Config, Ts1),
+ [] = run(Config, Ts1),
ok.
-otp_4886(doc) ->
- "OTP-4886. Calling is_record with given record name.";
-otp_4886(suite) -> [];
+%% OTP-4886. Calling is_record with given record name.
otp_4886(Config) when is_list(Config) ->
Ts = [{otp_4886,
<<"t() ->
@@ -1638,12 +1599,10 @@ otp_4886(Config) when is_list(Config) ->
{4,erl_lint,{undefined_record,foo}},
{5,erl_lint,{undefined_record,foo}}],
[]}}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-otp_4988(doc) ->
- "OTP-4988. Error when in-lining non-existent functions.";
-otp_4988(suite) -> [];
+%% OTP-4988. Error when in-lining non-existent functions.
otp_4988(Config) when is_list(Config) ->
Ts = [{otp_4988,
<<"-compile({inline, [{f,3},{f,4},{f,2},{f,a},{1,foo}]}).
@@ -1665,12 +1624,10 @@ otp_4988(Config) when is_list(Config) ->
{1,erl_lint,{bad_inline,{f,a}}},
{3,erl_lint,{bad_inline,{g,12}}}],
[]}}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-otp_5091(doc) ->
- "OTP-5091. Patterns and the bit syntax: invalid warnings.";
-otp_5091(suite) -> [];
+%% OTP-5091. Patterns and the bit syntax: invalid warnings.
otp_5091(Config) when is_list(Config) ->
Ts = [{otp_5091_1,
<<"t() ->
@@ -1883,12 +1840,10 @@ otp_5091(Config) when is_list(Config) ->
<<"-record(r, {f1,f2}).
t(#r{f1 = A, f2 = A}) -> a.">>, [], []}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-otp_5276(doc) ->
- "OTP-5276. Check the 'deprecated' attributed.";
-otp_5276(suite) -> [];
+%% OTP-5276. Check the 'deprecated' attributed.
otp_5276(Config) when is_list(Config) ->
Ts = [{otp_5276_1,
<<"-deprecated([{frutt,0,next_version}]).
@@ -1915,12 +1870,10 @@ otp_5276(Config) when is_list(Config) ->
{9,erl_lint,{invalid_deprecated,{{badly,formed},1}}},
{11,erl_lint,{bad_deprecated,{atom_to_list,1}}}],
[{13,erl_lint,{unused_function,{frutt,0}}}]}}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-otp_5917(doc) ->
- "OTP-5917. Check the 'deprecated' attributed.";
-otp_5917(suite) -> [];
+%% OTP-5917. Check the 'deprecated' attributed.
otp_5917(Config) when is_list(Config) ->
Ts = [{otp_5917_1,
<<"-compile(export_all).
@@ -1932,12 +1885,10 @@ otp_5917(Config) when is_list(Config) ->
">>,
{[]},
[]}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-otp_6585(doc) ->
- "OTP-6585. Check the deprecated guards list/1, pid/1, ....";
-otp_6585(suite) -> [];
+%% OTP-6585. Check the deprecated guards list/1, pid/1, ....
otp_6585(Config) when is_list(Config) ->
Ts = [{otp_6585_1,
<<"-compile(export_all).
@@ -1955,12 +1906,10 @@ otp_6585(Config) when is_list(Config) ->
{warnings,[{5,erl_lint,{obsolete_guard,{list,1}}},
{6,erl_lint,{obsolete_guard,{record,2}}},
{7,erl_lint,{obsolete_guard,{pid,1}}}]}}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-otp_5338(doc) ->
- "OTP-5338. Bad warning in record initialization.";
-otp_5338(suite) -> [];
+%% OTP-5338. Bad warning in record initialization.
otp_5338(Config) when is_list(Config) ->
%% OTP-5878: variables like X are no longer allowed in initialisations
Ts = [{otp_5338,
@@ -1972,13 +1921,11 @@ otp_5338(Config) when is_list(Config) ->
[],
{error,[{1,erl_lint,{unbound_var,'X'}}],
[{3,erl_lint,{unused_var,'X'}}]}}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-otp_5362(doc) ->
- "OTP-5362. deprecated_function, "
- "{nowarn_unused_funtion,FAs}, 'better' line numbers.";
-otp_5362(suite) -> [];
+%% OTP-5362. deprecated_function,
+%% {nowarn_unused_funtion,FAs}, 'better' line numbers.
otp_5362(Config) when is_list(Config) ->
Ts = [{otp_5362_1,
<<"-include_lib(\"stdlib/include/qlc.hrl\").
@@ -2178,12 +2125,10 @@ otp_5362(Config) when is_list(Config) ->
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-otp_5371(doc) ->
- "OTP-5371. Aliases for bit syntax expressions are no longer allowed.";
-otp_5371(suite) -> [];
+%% OTP-5371. Aliases for bit syntax expressions are no longer allowed.
otp_5371(Config) when is_list(Config) ->
Ts = [{otp_5371_1,
<<"t(<<A:8>> = <<B:8>>) ->
@@ -2237,10 +2182,10 @@ otp_5371(Config) when is_list(Config) ->
{6,v3_core,nomatch},
{8,v3_core,nomatch}]}}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-otp_7227(doc) -> "OTP_7227. Some aliases for bit syntax expressions were still allowed.";
+%% OTP_7227. Some aliases for bit syntax expressions were still allowed.
otp_7227(Config) when is_list(Config) ->
Ts = [{otp_7227_1,
<<"t([<<A:8>> = {C,D} = <<B:8>>]) ->
@@ -2307,12 +2252,10 @@ otp_7227(Config) when is_list(Config) ->
[],
{errors,[{2,erl_lint,illegal_bin_pattern}],[]}}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-otp_5494(doc) ->
- "OTP-5494. Warnings for functions exported more than once.";
-otp_5494(suite) -> [];
+%% OTP-5494. Warnings for functions exported more than once.
otp_5494(Config) when is_list(Config) ->
Ts = [{otp_5494_1,
<<"-export([t/0]).
@@ -2321,12 +2264,10 @@ otp_5494(Config) when is_list(Config) ->
">>,
[],
{warnings,[{2,erl_lint,{duplicated_export,{t,0}}}]}}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-otp_5644(doc) ->
- "OTP-5644. M:F/A in record initialization.";
-otp_5644(suite) -> [];
+%% OTP-5644. M:F/A in record initialization.
otp_5644(Config) when is_list(Config) ->
%% This test is a no-op. Although {function,mfa,i,1} was
%% transformed into {function,Line,i,1} by copy_expr, the module
@@ -2342,12 +2283,10 @@ otp_5644(Config) when is_list(Config) ->
">>,
[],
[]}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-otp_5878(doc) ->
- "OTP-5878. Record declaration: forward references, introduced variables.";
-otp_5878(suite) -> [];
+%% OTP-5878. Record declaration: forward references, introduced variables.
otp_5878(Config) when is_list(Config) ->
Ts = [{otp_5878_10,
<<"-record(rec1, {a = #rec2{}}).
@@ -2463,7 +2402,7 @@ otp_5878(Config) when is_list(Config) ->
[{1,erl_lint,{unused_record,r}}]}}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
Abstr = <<"-module(lint_test, [A, B]).
">>,
@@ -2480,7 +2419,7 @@ otp_5878(Config) when is_list(Config) ->
X <- Z ++ [A,Y]])}).
t() -> {#r1{},#r2{},#r3{}}.
">>,
- ?line {error,[{8,qlc,{used_generator_variable,'A'}},
+ {error,[{8,qlc,{used_generator_variable,'A'}},
{8,qlc,{used_generator_variable,'Y'}},
{8,qlc,{used_generator_variable,'Z'}}],
[{6,erl_lint,{unused_var,'V'}}]} =
@@ -2521,7 +2460,7 @@ otp_5878(Config) when is_list(Config) ->
bar.
">>,
- ?line {errors,[{6,erl_lint,{unbound_var,'A'}},
+ {errors,[{6,erl_lint,{unbound_var,'A'}},
{13,erl_lint,illegal_guard_expr},
{15,erl_lint,{undefined_field,r3,q}},
{17,erl_lint,{undefined_field,r,q}},
@@ -2540,14 +2479,14 @@ otp_5878(Config) when is_list(Config) ->
foo
end.
">>,
- ?line {errors,[{4,erl_lint,{undefined_function,{x,0}}},
+ {errors,[{4,erl_lint,{undefined_function,{x,0}}},
{5,erl_lint,illegal_guard_expr},
{7,erl_lint,illegal_guard_expr}],
[]} =
run_test2(Config, Ill2, [warn_unused_record]),
Ill3 = <<"t() -> ok.">>,
- ?line {errors,[{1,erl_lint,undefined_module}],[]} =
+ {errors,[{1,erl_lint,undefined_module}],[]} =
run_test2(Config, Ill3, [warn_unused_record]),
Usage1 = <<"-module(lint_test).
@@ -2560,7 +2499,7 @@ otp_5878(Config) when is_list(Config) ->
t() ->
{#u2{}}.
">>,
- ?line {warnings,[{5,erl_lint,{unused_record,u3}},
+ {warnings,[{5,erl_lint,{unused_record,u3}},
{6,erl_lint,{unused_record,u4}}]} =
run_test2(Config, Usage1, [warn_unused_record]),
@@ -2575,7 +2514,7 @@ otp_5878(Config) when is_list(Config) ->
t() ->
{#u2{}}.
">>,
- ?line [] = run_test2(Config, Usage2, [warn_unused_record]),
+ [] = run_test2(Config, Usage2, [warn_unused_record]),
%% This a completely different story...
%% The linter checks if qlc.hrl hasn't been included
@@ -2589,7 +2528,7 @@ otp_5878(Config) when is_list(Config) ->
H3 = q([X || X <- [1,2]], []),
{H1,H2,H3}.
">>,
- ?line {warnings,[{6,erl_lint,{missing_qlc_hrl,1}},
+ {warnings,[{6,erl_lint,{missing_qlc_hrl,1}},
{7,erl_lint,{missing_qlc_hrl,2}},
{8,erl_lint,{missing_qlc_hrl,2}}]} =
run_test2(Config, QLC2, [warn_unused_record]),
@@ -2605,7 +2544,7 @@ otp_5878(Config) when is_list(Config) ->
foo(#request{}) -> ok.
">>,
- ?line [] = run_test2(Config, UsedByType, [warn_unused_record]),
+ [] = run_test2(Config, UsedByType, [warn_unused_record]),
%% Abstract code generated by OTP 18. Note that the type info for
%% record fields has been put in a separate form.
@@ -2626,9 +2565,8 @@ otp_5878(Config) when is_list(Config) ->
ok.
-otp_6885(doc) ->
- "OTP-6885. Binary fields in bit syntax matching is now only allowed at the end.";
-otp_6885(suite) -> [];
+%% OTP-6885. Binary fields in bit syntax matching is now only
+%% allowed at the end.
otp_6885(Config) when is_list(Config) ->
Ts = <<"-module(otp_6885).
-export([t/1]).
@@ -2655,7 +2593,7 @@ otp_6885(Config) when is_list(Config) ->
ok.
">>,
- ?line {errors,[{3,erl_lint,unsized_binary_not_at_end},
+ {errors,[{3,erl_lint,unsized_binary_not_at_end},
{4,erl_lint,unsized_binary_not_at_end},
{5,erl_lint,unsized_binary_not_at_end},
{10,erl_lint,typed_literal_string},
@@ -2665,9 +2603,7 @@ otp_6885(Config) when is_list(Config) ->
[]} = run_test2(Config, Ts, []),
ok.
-otp_10436(doc) ->
- "OTP-6885. Warnings for opaque types.";
-otp_10436(suite) -> [];
+%% OTP-6885. Warnings for opaque types.
otp_10436(Config) when is_list(Config) ->
Ts = <<"-module(otp_10436).
-export_type([t1/0]).
@@ -2687,9 +2623,7 @@ otp_10436(Config) when is_list(Config) ->
run_test2(Config, Ts2, []),
ok.
-otp_11254(doc) ->
- "OTP-11254. M:F/A could crash the linter.";
-otp_11254(suite) -> [];
+%% OTP-11254. M:F/A could crash the linter.
otp_11254(Config) when is_list(Config) ->
Ts = <<"-module(p2).
-export([manifest/2]).
@@ -2701,9 +2635,7 @@ otp_11254(Config) when is_list(Config) ->
run_test2(Config, Ts, []),
ok.
-otp_11772(doc) ->
- "OTP-11772. Reintroduce errors for redefined builtin types.";
-otp_11772(suite) -> [];
+%% OTP-11772. Reintroduce errors for redefined builtin types.
otp_11772(Config) when is_list(Config) ->
Ts = <<"
-module(newly).
@@ -2728,9 +2660,7 @@ otp_11772(Config) when is_list(Config) ->
[]} = run_test2(Config, Ts, []),
ok.
-otp_11771(doc) ->
- "OTP-11771. Do not allow redefinition of the types arity(_) &c..";
-otp_11771(suite) -> [];
+%% OTP-11771. Do not allow redefinition of the types arity(_) &c..
otp_11771(Config) when is_list(Config) ->
Ts = <<"
-module(newly).
@@ -2757,9 +2687,7 @@ otp_11771(Config) when is_list(Config) ->
[]} = run_test2(Config, Ts, []),
ok.
-otp_11872(doc) ->
- "OTP-11872. The type map() undefined when exported.";
-otp_11872(suite) -> [];
+%% OTP-11872. The type map() undefined when exported.
otp_11872(Config) when is_list(Config) ->
Ts = <<"
-module(map).
@@ -2781,22 +2709,19 @@ otp_11872(Config) when is_list(Config) ->
run_test2(Config, Ts, []),
ok.
-export_all(doc) ->
- "OTP-7392. Warning for export_all.";
+%% OTP-7392. Warning for export_all.
export_all(Config) when is_list(Config) ->
Ts = <<"-module(export_all_module).
-compile([export_all]).
id(I) -> I.
">>,
- ?line [] = run_test2(Config, Ts, []),
- ?line {warnings,[{2,erl_lint,export_all}]} =
+ [] = run_test2(Config, Ts, []),
+ {warnings,[{2,erl_lint,export_all}]} =
run_test2(Config, Ts, [warn_export_all]),
ok.
-bif_clash(doc) ->
- "Test warnings for functions that clash with BIFs.";
-bif_clash(suite) -> [];
+%% Test warnings for functions that clash with BIFs.
bif_clash(Config) when is_list(Config) ->
Ts = [{clash1,
<<"t(X) ->
@@ -3063,12 +2988,10 @@ bif_clash(Config) when is_list(Config) ->
[]}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-behaviour_basic(doc) ->
- "Basic tests with one behaviour.";
-behaviour_basic(suite) -> [];
+%% Basic tests with one behaviour.
behaviour_basic(Config) when is_list(Config) ->
Ts = [{behaviour1,
<<"-behaviour(application).
@@ -3102,12 +3025,10 @@ behaviour_basic(Config) when is_list(Config) ->
[],
{warnings,[{1,erl_lint,{undefined_behaviour_func,{start,2},application}}]}}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-behaviour_multiple(doc) ->
- "Basic tests with multiple behaviours.";
-behaviour_multiple(suite) -> [];
+%% Basic tests with multiple behaviours.
behaviour_multiple(Config) when is_list(Config) ->
Ts = [{behaviour1,
<<"-behaviour(application).
@@ -3205,12 +3126,10 @@ behaviour_multiple(Config) when is_list(Config) ->
erl_lint,
{conflicting_behaviours,{init,1},supervisor,1,gen_server}}]}}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-otp_11861(doc) ->
- "OTP-11861. behaviour_info() and -callback.";
-otp_11861(suite) -> [];
+%% OTP-11861. behaviour_info() and -callback.
otp_11861(Conf) when is_list(Conf) ->
CallbackFiles = [callback1, callback2, callback3,
bad_behaviour1, bad_behaviour2],
@@ -3391,12 +3310,12 @@ otp_11861(Conf) when is_list(Conf) ->
[],
[]}
],
- ?line [] = run(Conf, Ts),
+ [] = run(Conf, Ts),
true = code:set_path(CodePath),
ok.
-otp_7550(doc) ->
- "Test that the new utf8/utf16/utf32 types do not allow size or unit specifiers.";
+%% Test that the new utf8/utf16/utf32 types do not allow size or
+%% unit specifiers.
otp_7550(Config) when is_list(Config) ->
Ts = [{otp_7550,
<<"f8(A) ->
@@ -3432,12 +3351,11 @@ otp_7550(Config) when is_list(Config) ->
{20,erl_lint,utf_bittype_size_or_unit}
],
[]}}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-otp_8051(doc) ->
- "Bugfix: -opaque with invalid type.";
+%% Bugfix: -opaque with invalid type.
otp_8051(Config) when is_list(Config) ->
Ts = [{otp_8051,
<<"-opaque foo() :: bar().
@@ -3445,12 +3363,10 @@ otp_8051(Config) when is_list(Config) ->
">>,
[],
{errors,[{1,erl_lint,{undefined_type,{bar,0}}}],[]}}],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-format_warn(doc) ->
- "Check that format warnings are generated.";
-format_warn(suite) -> [];
+%% Check that format warnings are generated.
format_warn(Config) when is_list(Config) ->
L1 = 14,
L2 = 4,
@@ -3460,18 +3376,18 @@ format_warn(Config) when is_list(Config) ->
ok.
format_level(Level, Count, Config) ->
- ?line W = get_compilation_result(Config, "format",
+ W = get_compilation_result(Config, "format",
[{warn_format, Level}]),
%% Pick out the 'format' warnings.
- ?line FW = lists:filter(fun({_Line, erl_lint, {format_error, _}}) -> true;
+ FW = lists:filter(fun({_Line, erl_lint, {format_error, _}}) -> true;
(_) -> false
end,
W),
- ?line case length(FW) of
+ case length(FW) of
Count ->
ok;
Other ->
- ?t:format("Expected ~w warning(s); got ~w", [Count,Other]),
+ io:format("Expected ~w warning(s); got ~w", [Count,Other]),
fail()
end,
ok.
@@ -3507,7 +3423,7 @@ on_load_successful(Config) when is_list(Config) ->
{[]}, %Tuple indicates no 'export_all'.
[]}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
on_load_failing(Config) when is_list(Config) ->
@@ -3555,12 +3471,10 @@ on_load_failing(Config) when is_list(Config) ->
{errors,
[{1,erl_lint,{undefined_on_load,{non_existing,0}}}],[]}}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
-too_many_arguments(doc) ->
- "Test that too many arguments is not accepted.";
-too_many_arguments(suite) -> [];
+%% Test that too many arguments is not accepted.
too_many_arguments(Config) when is_list(Config) ->
Ts = [{too_many_1,
<<"f(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_) -> ok.">>,
@@ -3569,7 +3483,7 @@ too_many_arguments(Config) when is_list(Config) ->
[{1,erl_lint,{too_many_arguments,256}}],[]}}
],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
ok.
@@ -3652,9 +3566,7 @@ bin_syntax_errors(Config) ->
[] = run(Config, Ts),
ok.
-predef(doc) ->
- "OTP-10342: No longer predefined types: array(), digraph(), and so on";
-predef(suite) -> [];
+%% OTP-10342: No longer predefined types: array(), digraph(), and so on.
predef(Config) when is_list(Config) ->
W = get_compilation_result(Config, "predef", []),
[] = W,
@@ -3781,8 +3693,7 @@ maps_type(Config) when is_list(Config) ->
[] = run(Config, Ts),
ok.
-otp_11851(doc) ->
- "OTP-11851: More atoms can be used as type names + bug fixes.";
+%% OTP-11851: More atoms can be used as type names + bug fixes.
otp_11851(Config) when is_list(Config) ->
Ts = [
{otp_11851_1,
@@ -3868,9 +3779,8 @@ otp_11851(Config) when is_list(Config) ->
[] = run(Config, Ts),
ok.
-otp_11879(doc) ->
- "OTP-11879: The -spec f/a :: (As) -> B; syntax removed, "
- "and is_subtype/2 deprecated";
+%% OTP-11879: The -spec f/a :: (As) -> B; syntax removed,
+%% and is_subtype/2 deprecated.
otp_11879(_Config) ->
Fs = [{attribute,0,file,{"file.erl",0}},
{attribute,0,module,m},
@@ -3891,8 +3801,7 @@ otp_11879(_Config) ->
[]} = compile:forms(Fs, [return,report]),
ok.
-otp_13230(doc) ->
- "OTP-13230: -deprecated without -module";
+%% OTP-13230: -deprecated without -module.
otp_13230(Config) when is_list(Config) ->
Abstr = <<"-deprecated([{frutt,0,next_version}]).">>,
{errors,[{1,erl_lint,undefined_module},
@@ -3917,7 +3826,7 @@ run(Config, Tests) ->
E ->
BadL;
Bad ->
- ?t:format("~nTest ~p failed. Expected~n ~p~n"
+ io:format("~nTest ~p failed. Expected~n ~p~n"
"but got~n ~p~n", [N, E, Bad]),
fail()
end
@@ -3927,8 +3836,8 @@ run(Config, Tests) ->
%% Compiles a test file and returns the list of warnings/errors.
get_compilation_result(Conf, Filename, Warnings) ->
- ?line DataDir = ?datadir,
- ?line File = filename:join(DataDir, Filename),
+ DataDir = ?datadir,
+ File = filename:join(DataDir, Filename),
{ok,Bin} = file:read_file(File++".erl"),
FileS = binary_to_list(Bin),
{match,[{Start,Length}|_]} = re:run(FileS, "-module.*\\n"),
@@ -3992,5 +3901,4 @@ call_format_error(L) ->
L.
fail() ->
- io:format("failed~n"),
- ?t:fail().
+ ct:fail(failed).
diff --git a/lib/stdlib/test/erl_pp_SUITE.erl b/lib/stdlib/test/erl_pp_SUITE.erl
index f7418b1f5f..4d44f7686a 100644
--- a/lib/stdlib/test/erl_pp_SUITE.erl
+++ b/lib/stdlib/test/erl_pp_SUITE.erl
@@ -22,7 +22,7 @@
%%%-----------------------------------------------------------------
-module(erl_pp_SUITE).
-%-define(debug, true).
+%%-define(debug, true).
-ifdef(debug).
-define(line, put(line, ?LINE), ).
@@ -32,8 +32,8 @@
-define(t, test_server).
-else.
-include_lib("common_test/include/ct.hrl").
--define(datadir, ?config(data_dir, Config)).
--define(privdir, ?config(priv_dir, Config)).
+-define(datadir, proplists:get_value(data_dir, Config)).
+-define(privdir, proplists:get_value(priv_dir, Config)).
-endif.
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
@@ -55,19 +55,15 @@
%% Internal export.
-export([ehook/6]).
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(2)).
-
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
+ Config.
end_per_testcase(_Case, _Config) ->
- Dog = ?config(watchdog, _Config),
- test_server:timetrap_cancel(Dog),
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[{group, expr}, {group, attributes}, hook, neg_indent,
@@ -99,8 +95,6 @@ end_per_group(_GroupName, Config) ->
-func(suite) ->
- [];
func(Config) when is_list(Config) ->
Ts = [{func_1,
<<"-record(r1, {a,b}).
@@ -154,11 +148,9 @@ func(Config) when is_list(Config) ->
true
end)().">>}
],
- ?line compile(Config, Ts),
+ compile(Config, Ts),
ok.
-call(suite) ->
- [];
call(Config) when is_list(Config) ->
Ts = [{call_1,
<<"t() ->
@@ -167,11 +159,9 @@ call(Config) when is_list(Config) ->
sfds,sdfsdf,sfds).
">>}
],
- ?line compile(Config, Ts),
+ compile(Config, Ts),
ok.
-recs(suite) ->
- [];
recs(Config) when is_list(Config) ->
%% Evolved while testing strict record tests in guards...
Ts = [{recs_1,
@@ -328,18 +318,16 @@ recs(Config) when is_list(Config) ->
R = #r2{},
R#r2{c = R, d = #r1{}}.">>}
],
- ?line compile(Config, Ts),
+ compile(Config, Ts),
- ?line ok = pp_expr(<<"case #r{a={1,2},b=#r{}} of
+ ok = pp_expr(<<"case #r{a={1,2},b=#r{}} of
X=Y=#r{a=foo,b=bar} ->
{(foooo:baaaar(X))#r{a = rep},Y,#r.b}
end">>),
- ?line ok = pp_expr(<<"R#r{a = {kljasdklf,sdkfjsdl,sdafjkllsdf,sdfkjsd,
+ ok = pp_expr(<<"R#r{a = {kljasdklf,sdkfjsdl,sdafjkllsdf,sdfkjsd,
sdafjsd,sdf,sdafsd,sdfdsf,sdfdsf,dsfds}}">>),
ok.
-try_catch(suite) ->
- [];
try_catch(Config) when is_list(Config) ->
Ts = [{try_1, % copied from erl_eval_SUITE
<<"t() -> try 1 of 1 -> 2 catch _:_ -> 3 end.">>},
@@ -381,8 +369,8 @@ try_catch(Config) when is_list(Config) ->
<<"t() -> catch begin begin foo, bar, foo:bar(kljsldkfjdls,kljsdl),
(catch bar:foo(foo)) end end.">>}
],
- ?line compile(Config, Ts),
- ?line ok = pp_expr(<<"try
+ compile(Config, Ts),
+ ok = pp_expr(<<"try
erl_internal:bif(M,F,length(Args))
of
true ->
@@ -392,8 +380,6 @@ try_catch(Config) when is_list(Config) ->
after foo end">>),
ok.
-if_then(suite) ->
- [];
if_then(Config) when is_list(Config) ->
Ts = [{if_1,
<<"t() -> if 1 > 2 -> 1; true -> b end.">>},
@@ -402,11 +388,9 @@ if_then(Config) when is_list(Config) ->
{if_3,
<<"t() -> if 1 == 2 -> a; 1 > 2 -> b; 1 < 2 -> c end.">>}
],
- ?line compile(Config, Ts),
+ compile(Config, Ts),
ok.
-receive_after(suite) ->
- [];
receive_after(Config) when is_list(Config) ->
Ts = [{rec_1,
<<"t() -> receive foo -> bar; bar -> foo end.">>},
@@ -427,11 +411,9 @@ receive_after(Config) when is_list(Config) ->
{3,4}
end.">>}
],
- ?line compile(Config, Ts),
+ compile(Config, Ts),
ok.
-bits(suite) ->
- [];
bits(Config) when is_list(Config) ->
Ts = [{bit_1, % copied from shell_SUITE
<<"t() -> <<(<<\"abc\">>):3/binary>>.">>},
@@ -452,21 +434,19 @@ bits(Config) when is_list(Config) ->
{bit_9,
<<"">>}
],
- ?line compile(Config, Ts),
- ?line ok = pp_expr(<<"<<(list_to_binary([1,2]))/binary>>">>),
- ?line ok = pp_expr(
+ compile(Config, Ts),
+ ok = pp_expr(<<"<<(list_to_binary([1,2]))/binary>>">>),
+ ok = pp_expr(
<<"<<(list_to_binary([1,2])):all/binary-unit:8-unsigned-big>>">>),
- ?line ok = pp_expr(<<"<<<<\"hej\">>/binary>>">>),
- ?line ok = pp_expr(<<"<<(foo:bar())/binary>>">>),
- ?line ok = pp_expr(<<"<<(a)/binary>>">>),
- ?line ok = pp_expr(<<"<<a/binary>>">>),
- ?line ok = pp_expr(<<"<<{a,b}/binary>>">>),
- ?line ok = pp_expr(<<"<<{foo:bar(),b}/binary>>">>),
- ?line ok = pp_expr(<<"<<(foo:bar()):(foo:bar())/binary>>">>),
+ ok = pp_expr(<<"<<<<\"hej\">>/binary>>">>),
+ ok = pp_expr(<<"<<(foo:bar())/binary>>">>),
+ ok = pp_expr(<<"<<(a)/binary>>">>),
+ ok = pp_expr(<<"<<a/binary>>">>),
+ ok = pp_expr(<<"<<{a,b}/binary>>">>),
+ ok = pp_expr(<<"<<{foo:bar(),b}/binary>>">>),
+ ok = pp_expr(<<"<<(foo:bar()):(foo:bar())/binary>>">>),
ok.
-head_tail(suite) ->
- [];
head_tail(Config) when is_list(Config) ->
Ts = [{list_1,
<<"t() -> [a | b].">>},
@@ -481,43 +461,30 @@ head_tail(Config) when is_list(Config) ->
[foo:bar(lkjljlskdfj, klsdajflds, sdafkljsdlfkjdas, kjlsdadjl),
bar:foo(kljlkjsdf, lkjsdlfj, [kljsfj, sdfdsfsad])].">>}
],
- ?line compile(Config, Ts),
+ compile(Config, Ts),
ok.
-cond1(suite) ->
- [];
cond1(Config) when is_list(Config) ->
C = {'cond',1,[{clause,2,[],[[{tuple,2,[{atom,2,foo},{atom,2,bar}]}]],
[{cons,3,{atom,3,a},{cons,3,{atom,3,b},{nil,3}}}]},
{clause,4,[],[[{atom,4,true}]],
[{tuple,5,[{atom,5,x},{atom,5,y}]}]}]},
CChars = flat_expr1(C),
-% ?line "cond {foo,bar} -> [a,b]; true -> {x,y} end" = CChars,
- ?line "cond\n"
+ "cond\n"
" {foo,bar} ->\n"
" [a,b];\n"
" true ->\n"
" {x,y}\n"
"end" = CChars,
-% ?line ok = pp_expr(<<"cond
-% {foo,bar} ->
-% [a,b];
-% true ->
-% {x,y}
-% end">>),
ok.
-block(suite) ->
- [];
block(Config) when is_list(Config) ->
Ts = [{block_1,
<<"t() -> begin a,{c,d} end.">>}
],
- ?line compile(Config, Ts),
+ compile(Config, Ts),
ok.
-case1(suite) ->
- [];
case1(Config) when is_list(Config) ->
Ts = [{case_1,
<<"t() -> case {foo,bar} of
@@ -527,8 +494,8 @@ case1(Config) when is_list(Config) ->
foo
end.">>}
],
- ?line compile(Config, Ts),
- ?line ok = pp_expr(<<"case
+ compile(Config, Ts),
+ ok = pp_expr(<<"case
erl_internal:bif(M,F,length(Args))
of
true ->
@@ -538,8 +505,6 @@ case1(Config) when is_list(Config) ->
end">>),
ok.
-ops(suite) ->
- [];
ops(Config) when is_list(Config) ->
Ts = [{ops_1,
<<"t() -> {a,b} + (3 - 2) + 4.">>},
@@ -548,21 +513,17 @@ ops(Config) when is_list(Config) ->
{ops_3,
<<"t() -> - (- (- (- (- 3)))).">>}
],
- ?line compile(Config, Ts),
+ compile(Config, Ts),
ok.
-messages(suite) ->
- [];
messages(Config) when is_list(Config) ->
- ?line true = "{error,{some,\"error\"}}\n" =:=
+ true = "{error,{some,\"error\"}}\n" =:=
lists:flatten(erl_pp:form({error,{some,"error"}})),
- ?line true = "{warning,{some,\"warning\"}}\n" =:=
+ true = "{warning,{some,\"warning\"}}\n" =:=
lists:flatten(erl_pp:form({warning,{some,"warning"}})),
"\n" = flat_form({eof,0}),
ok.
-import_export(suite) ->
- [];
import_export(Config) when is_list(Config) ->
Ts = [{import_1,
<<"-import(lists, [max/1, reverse/1]).
@@ -577,11 +538,9 @@ import_export(Config) when is_list(Config) ->
<<"-include_lib(\"stdlib/include/qlc.hrl\").
t() -> qlc:q([X || X <- []]).">>}
],
- ?line compile(Config, Ts),
+ compile(Config, Ts),
ok.
-misc_attrs(suite) ->
- [];
misc_attrs(Config) when is_list(Config) ->
ok = pp_forms(<<"-module(m). ">>),
ok = pp_forms(<<"-module(m, [Aafjlksfjdlsjflsdfjlsdjflkdsfjlk,"
@@ -599,8 +558,6 @@ misc_attrs(Config) when is_list(Config) ->
ok = pp_forms(<<"-custom1(#{test1 => init/2, test2 => [val/1, val/2]}). ">>),
ok.
-dialyzer_attrs(suite) ->
- [];
dialyzer_attrs(Config) when is_list(Config) ->
ok = pp_forms(<<"-type foo() :: #bar{}. ">>),
ok = pp_forms(<<"-opaque foo() :: {bar, fun((X, [42,...]) -> X)}. ">>),
@@ -608,8 +565,6 @@ dialyzer_attrs(Config) when is_list(Config) ->
ok = pp_forms(<<"-callback foo(<<_:32,_:_*4>>, T) -> T. ">>),
ok.
-hook(suite) ->
- [];
hook(Config) when is_list(Config) ->
F = fun(H) -> H end,
do_hook(F).
@@ -623,29 +578,29 @@ do_hook(HookFun) ->
Call = {call,A0,{atom,A0,foo},[Lc]},
Expr2 = {call,A0,{atom,A0,fff},[Call,Call,Call]},
EChars2 = erl_pp:exprs([Expr2]),
- ?line true = EChars =:= lists:flatten(EChars2),
+ true = EChars =:= lists:flatten(EChars2),
EsChars = erl_pp:exprs([Expr], H),
- ?line true = EChars =:= lists:flatten(EsChars),
+ true = EChars =:= lists:flatten(EsChars),
A1 = erl_anno:new(1),
F = {function,A1,ffff,0,[{clause,A1,[],[],[Expr]}]},
FuncChars = lists:flatten(erl_pp:function(F, H)),
F2 = {function,A1,ffff,0,[{clause,A1,[],[],[Expr2]}]},
FuncChars2 = erl_pp:function(F2),
- ?line true = FuncChars =:= lists:flatten(FuncChars2),
+ true = FuncChars =:= lists:flatten(FuncChars2),
FFormChars = erl_pp:form(F, H),
- ?line true = FuncChars =:= lists:flatten(FFormChars),
+ true = FuncChars =:= lists:flatten(FFormChars),
A = {attribute,A1,record,{r,[{record_field,A1,{atom,A1,a},Expr}]}},
AChars = lists:flatten(erl_pp:attribute(A, H)),
A2 = {attribute,A1,record,{r,[{record_field,A1,{atom,A1,a},Expr2}]}},
AChars2 = erl_pp:attribute(A2),
- ?line true = AChars =:= lists:flatten(AChars2),
+ true = AChars =:= lists:flatten(AChars2),
AFormChars = erl_pp:form(A, H),
- ?line true = AChars =:= lists:flatten(AFormChars),
+ true = AChars =:= lists:flatten(AFormChars),
- ?line "INVALID-FORM:{foo,bar}:" = lists:flatten(erl_pp:expr({foo,bar})),
+ "INVALID-FORM:{foo,bar}:" = lists:flatten(erl_pp:expr({foo,bar})),
%% A list (as before R6), not a list of lists.
G = [{op,A1,'>',{atom,A1,a},{foo,{atom,A1,b}}}], % not a proper guard
@@ -653,26 +608,26 @@ do_hook(HookFun) ->
G2 = [{op,A1,'>',{atom,A1,a},
{call,A0,{atom,A0,foo},[{atom,A1,b}]}}], % not a proper guard
GChars2 = erl_pp:guard(G2),
- ?line true = GChars =:= lists:flatten(GChars2),
+ true = GChars =:= lists:flatten(GChars2),
EH = HookFun({?MODULE, ehook, [foo,bar]}),
XEChars = erl_pp:expr(Expr, -1, EH),
- ?line true = remove_indentation(EChars) =:= lists:flatten(XEChars),
+ true = remove_indentation(EChars) =:= lists:flatten(XEChars),
XEChars2 = erl_pp:expr(Expr, EH),
- ?line true = EChars =:= lists:flatten(XEChars2),
+ true = EChars =:= lists:flatten(XEChars2),
%% Note: no leading spaces before "begin".
Block = {block,A0,[{match,A0,{var,A0,'A'},{integer,A0,3}},
{atom,A0,true}]},
- ?line "begin\n A =" ++ _ =
+ "begin\n A =" ++ _ =
lists:flatten(erl_pp:expr(Block, 17, none)),
%% Special...
- ?line true =
+ true =
"{some,value}" =:= lists:flatten(erl_pp:expr({value,A0,{some,value}})),
%% Silly...
- ?line true =
+ true =
"if true -> 0 end" =:=
flat_expr({'if',0,[{clause,0,[],[],[{atom,0,0}]}]}),
@@ -681,7 +636,7 @@ do_hook(HookFun) ->
NewIf = {'if',A0,[{clause,A0,[],[[{atom,A0,true}]],[{atom,A0,b}]}]},
OldIfChars = lists:flatten(erl_pp:expr(OldIf)),
NewIfChars = lists:flatten(erl_pp:expr(NewIf)),
- ?line true = OldIfChars =:= NewIfChars,
+ true = OldIfChars =:= NewIfChars,
ok.
@@ -697,18 +652,16 @@ hook({foo,E}, I, P, H) ->
A = erl_anno:new(0),
erl_pp:expr({call,A,{atom,A,foo},[E]}, I, P, H).
-neg_indent(suite) ->
- [];
neg_indent(Config) when is_list(Config) ->
- ?line ok = pp_expr(<<"begin a end">>),
- ?line ok = pp_expr(<<"begin a,b end">>),
- ?line ok = pp_expr(<<"try a,b,c
+ ok = pp_expr(<<"begin a end">>),
+ ok = pp_expr(<<"begin a,b end">>),
+ ok = pp_expr(<<"try a,b,c
catch exit:_ -> d;
throw:_ -> t;
error:{foo,bar} -> foo,
bar
end">>),
- ?line ok = pp_expr(
+ ok = pp_expr(
<<"fun() ->
F = fun(A, B) when ((A#r1.a) orelse (B#r2.a))
or (B#r2.b) or (A#r1.b) ->
@@ -722,43 +675,41 @@ neg_indent(Config) when is_list(Config) ->
ok
end()">>),
- ?line ok = pp_expr(<<"[X || X <- a, true]">>),
- ?line ok = pp_expr(<<"{[a,b,c],[d,e|f]}">>),
- ?line ok = pp_expr(<<"f(a,b,c)">>),
- ?line ok = pp_expr(<<"fun() when a,b;c,d -> a end">>),
- ?line ok = pp_expr(<<"fun A() when a,b;c,d -> a end">>),
- ?line ok = pp_expr(<<"<<34:32,17:32>>">>),
- ?line ok = pp_expr(<<"if a,b,c -> d; e,f,g -> h,i end">>),
- ?line ok = pp_expr(<<"if a -> d; c -> d end">>),
- ?line ok = pp_expr(<<"receive after 1 -> 2 end">>),
- ?line ok = pp_expr(<<"begin a,b,c end">>),
-
- ?line "\"\"" = flat_expr({string,0,""}),
- ?line ok = pp_expr(<<"\"abc\"">>),
- ?line ok = pp_expr(<<"\"abc\n\n\n\n\nkjsd\n\n\n\n\nkljsddf\n\n\n\n\n"
- "klafd\n\n\n\n\nkljsdf\n\n\n\n\nsdf\n\n\n\n\n\"">>),
- ?line ok = pp_expr(<<"fkjlskljklkkljlkjlkjkljlkjsljklf"
- "lsdjlfdsjlfjsdlfjdslfjdlsjfsdjfklsdkfjsdf("
- "\"abc\n\n\n\n\nkjsd\n\n\n\n\nkljsddf\n\n\n\n\n"
- "kljsafd\n\n\n\n\nkljsdf\n\n\n\n\nkjsdf"
- "\n\n\n\n\n\")">>),
+ ok = pp_expr(<<"[X || X <- a, true]">>),
+ ok = pp_expr(<<"{[a,b,c],[d,e|f]}">>),
+ ok = pp_expr(<<"f(a,b,c)">>),
+ ok = pp_expr(<<"fun() when a,b;c,d -> a end">>),
+ ok = pp_expr(<<"fun A() when a,b;c,d -> a end">>),
+ ok = pp_expr(<<"<<34:32,17:32>>">>),
+ ok = pp_expr(<<"if a,b,c -> d; e,f,g -> h,i end">>),
+ ok = pp_expr(<<"if a -> d; c -> d end">>),
+ ok = pp_expr(<<"receive after 1 -> 2 end">>),
+ ok = pp_expr(<<"begin a,b,c end">>),
+
+ "\"\"" = flat_expr({string,0,""}),
+ ok = pp_expr(<<"\"abc\"">>),
+ ok = pp_expr(<<"\"abc\n\n\n\n\nkjsd\n\n\n\n\nkljsddf\n\n\n\n\n"
+ "klafd\n\n\n\n\nkljsdf\n\n\n\n\nsdf\n\n\n\n\n\"">>),
+ ok = pp_expr(<<"fkjlskljklkkljlkjlkjkljlkjsljklf"
+ "lsdjlfdsjlfjsdlfjdslfjdlsjfsdjfklsdkfjsdf("
+ "\"abc\n\n\n\n\nkjsd\n\n\n\n\nkljsddf\n\n\n\n\n"
+ "kljsafd\n\n\n\n\nkljsdf\n\n\n\n\nkjsdf"
+ "\n\n\n\n\n\")">>),
%% fun-info is skipped when everything is to fit on one single line
Fun1 = {'fun',1,{function,t,0},{0,45353021,'-t/0-fun-0-'}},
- ?line "fun t/0" = flat_expr(Fun1),
+ "fun t/0" = flat_expr(Fun1),
Fun2 = {'fun',2,{clauses,[{clause,2,[],[],[{atom,3,true}]}]},
{0,108059557,'-t/0-fun-0-'}},
- ?line "fun() -> true end" = flat_expr(Fun2),
+ "fun() -> true end" = flat_expr(Fun2),
Fun3 = {named_fun,3,'True',[{clause,3,[],[],[{atom,3,true}]}],
{0,424242424,'-t/0-True-0-'}},
- ?line "fun True() -> true end" = flat_expr(Fun3),
+ "fun True() -> true end" = flat_expr(Fun3),
ok.
-otp_6321(doc) ->
- "OTP_6321. Bug fix of exprs().";
-otp_6321(suite) -> [];
+%% OTP_6321. Bug fix of exprs().
otp_6321(Config) when is_list(Config) ->
Str = "S = hopp, {hej, S}. ",
{done, {ok, Tokens, _EndLine}, ""} = erl_scan:tokens("", Str, _L=1),
@@ -766,9 +717,7 @@ otp_6321(Config) when is_list(Config) ->
"S = hopp, {hej,S}" = lists:flatten(erl_pp:exprs(Exprs)),
ok.
-otp_6911(doc) ->
- "OTP_6911. More newlines.";
-otp_6911(suite) -> [];
+%% OTP_6911. More newlines.
otp_6911(Config) when is_list(Config) ->
F = {function,5,thomas,1,
[{clause,5,
@@ -779,38 +728,32 @@ otp_6911(Config) when is_list(Config) ->
[{clause,7,[{atom,7,true}],[],[{integer,7,12}]},
{clause,8,[{atom,8,false}],[],[{integer,8,14}]}]}]}]},
Chars = flat_form(F),
- ?line "thomas(X) ->\n"
+ "thomas(X) ->\n"
" case X of\n"
" true ->\n"
" 12;\n"
" false ->\n"
" 14\n"
" end.\n" = Chars,
- ?line ok = pp_expr(<<"case X of true -> 12; false -> 14 end">>),
- ?line ok = pp_expr(<<"receive after 1 -> ok end">>),
+ ok = pp_expr(<<"case X of true -> 12; false -> 14 end">>),
+ ok = pp_expr(<<"receive after 1 -> ok end">>),
ok.
-otp_6914(doc) ->
- "OTP_6914. Binary comprehensions.";
-otp_6914(suite) -> [];
+%% OTP_6914. Binary comprehensions.
otp_6914(Config) when is_list(Config) ->
- ?line ok = pp_expr(<<"<< <<B:1>> || B <- [0,1,1] >>">>),
- ?line ok = pp_expr(<<"[ B || <<B:1>> <= <<\"hi\">>]">>),
- ?line ok = pp_expr(<<"<< <<1:1>> || true >>">>),
+ ok = pp_expr(<<"<< <<B:1>> || B <- [0,1,1] >>">>),
+ ok = pp_expr(<<"[ B || <<B:1>> <= <<\"hi\">>]">>),
+ ok = pp_expr(<<"<< <<1:1>> || true >>">>),
ok.
-otp_8150(doc) ->
- "OTP_8150. Types.";
-otp_8150(suite) -> [];
+%% OTP_8150. Types.
otp_8150(Config) when is_list(Config) ->
- ?line _ = [{N,ok} = {N,pp_forms(B)} ||
+ _ = [{N,ok} = {N,pp_forms(B)} ||
{N,B} <- type_examples()
],
ok.
-otp_8238(doc) ->
- "OTP_8238. Bugfix 'E'.";
-otp_8238(suite) -> [];
+%% OTP_8238. Bugfix 'E'.
otp_8238(Config) when is_list(Config) ->
Ex = [<<"-record(rec1, {}).\n"
"-record(rec2, {a, b}).\n"
@@ -825,7 +768,7 @@ otp_8238(Config) when is_list(Config) ->
"t2() ->\n"
" #r{}.\n">>
],
- ?line compile(Config, [{otp_8238,iolist_to_binary(Ex)}]),
+ compile(Config, [{otp_8238,iolist_to_binary(Ex)}]),
ok.
type_examples() ->
@@ -880,13 +823,13 @@ type_examples() ->
%% Erlang/OTP 19.0, but as long as the parser recognizes the
%% is_subtype(V, T) syntax, we need a few examples of the syntax.
{ex31,<<"-spec t1(FooBar :: t99()) -> t99();"
- "(t2()) -> t2();"
- "('\\'t::4'()) -> '\\'t::4'() when is_subtype('\\'t::4'(), t24);"
- "(t23()) -> t23() when is_subtype(t23(), atom()),"
- " is_subtype(t23(), t14());"
- "(t24()) -> t24() when is_subtype(t24(), atom()),"
- " is_subtype(t24(), t14()),"
- " is_subtype(t24(), '\\'t::4'()).">>},
+ "(t2()) -> t2();"
+ "('\\'t::4'()) -> '\\'t::4'() when is_subtype('\\'t::4'(), t24);"
+ "(t23()) -> t23() when is_subtype(t23(), atom()),"
+ " is_subtype(t23(), t14());"
+ "(t24()) -> t24() when is_subtype(t24(), atom()),"
+ " is_subtype(t24(), t14()),"
+ " is_subtype(t24(), '\\'t::4'()).">>},
{ex32,<<"-spec mod:t2() -> any(). ">>},
{ex33,<<"-opaque attributes_data() :: "
"[{'column', column()} | {'line', info_line()} |"
@@ -906,19 +849,15 @@ type_examples() ->
"f19 = 3 :: integer()|undefined,"
"f5 = 3 :: undefined|integer()}). ">>}].
-otp_8473(doc) ->
- "OTP_8473. Bugfix abstract type 'fun'.";
-otp_8473(suite) -> [];
+%% OTP_8473. Bugfix abstract type 'fun'.
otp_8473(Config) when is_list(Config) ->
Ex = [{ex1,<<"-type 'fun'(A) :: A.\n"
"-type funkar() :: 'fun'(fun((integer()) -> atom())).\n">>}],
- ?line _ = [{N,ok} = {N,pp_forms(B)} ||
+ _ = [{N,ok} = {N,pp_forms(B)} ||
{N,B} <- Ex],
ok.
-otp_8522(doc) ->
- "OTP_8522. Avoid duplicated 'undefined' in record field types.";
-otp_8522(suite) -> [];
+%% OTP_8522. Avoid duplicated 'undefined' in record field types.
otp_8522(Config) when is_list(Config) ->
FileName = filename('otp_8522.erl', Config),
C = <<"-module(otp_8522).\n"
@@ -927,13 +866,13 @@ otp_8522(Config) when is_list(Config) ->
" f3 :: (undefined),\n"
" f4 :: x | y | undefined | z,\n"
" f5 :: a}).\n">>,
- ?line ok = file:write_file(FileName, C),
- ?line {ok, _} = compile:file(FileName, [{outdir,?privdir},debug_info]),
+ ok = file:write_file(FileName, C),
+ {ok, _} = compile:file(FileName, [{outdir,?privdir},debug_info]),
BF = filename("otp_8522", Config),
- ?line {ok, A} = beam_lib:chunks(BF, [abstract_code]),
+ {ok, A} = beam_lib:chunks(BF, [abstract_code]),
%% OTP-12719: Since 'undefined' is no longer added by the Erlang
%% Parser, the number of 'undefined' is 4. It used to be 5.
- ?line 4 = count_atom(A, undefined),
+ 4 = count_atom(A, undefined),
ok.
count_atom(A, A) ->
@@ -945,8 +884,6 @@ count_atom(L, A) when is_list(L) ->
count_atom(_, _) ->
0.
-maps_syntax(doc) -> "Maps syntax";
-maps_syntax(suite) -> [];
maps_syntax(Config) when is_list(Config) ->
Ts = [{map_fun_1,
<<"t() ->\n"
@@ -977,9 +914,7 @@ maps_syntax(Config) when is_list(Config) ->
ok.
-otp_8567(doc) ->
- "OTP_8567. Avoid duplicated 'undefined' in record field types.";
-otp_8567(suite) -> [];
+%% OTP_8567. Avoid duplicated 'undefined' in record field types.
otp_8567(Config) when is_list(Config) ->
FileName = filename('otp_8567.erl', Config),
C = <<"-module otp_8567.\n"
@@ -988,8 +923,8 @@ otp_8567(Config) when is_list(Config) ->
"-record r, {a}.\n"
"-record s, {a :: integer()}.\n"
"-type t() :: {#r{},#s{}}.\n">>,
- ?line ok = file:write_file(FileName, C),
- ?line {error,[{_,[{3,erl_parse,["syntax error before: ","')'"]}]}],_} =
+ ok = file:write_file(FileName, C),
+ {error,[{_,[{3,erl_parse,["syntax error before: ","')'"]}]}],_} =
compile:file(FileName, [return]),
F = <<"-module(otp_8567).\n"
@@ -1010,13 +945,11 @@ otp_8567(Config) when is_list(Config) ->
"-spec(otp_8567:t4 (ot()) -> ot1()).\n"
"t4(A) ->\n"
" A.\n">>,
- ?line ok = pp_forms(F),
+ ok = pp_forms(F),
ok.
-otp_8664(doc) ->
- "OTP_8664. Types with integer expressions.";
-otp_8664(suite) -> [];
+%% OTP_8664. Types with integer expressions.
otp_8664(Config) when is_list(Config) ->
FileName = filename('otp_8664.erl', Config),
C1 = <<"-module(otp_8664).\n"
@@ -1033,42 +966,38 @@ otp_8664(Config) when is_list(Config) ->
"-type t() :: t1() | t2() | t3() | b1() | u().\n"
"-spec t() -> t().\n"
"t() -> 3.\n">>,
- ?line ok = file:write_file(FileName, C1),
- ?line {ok, _, []} = compile:file(FileName, [return]),
+ ok = file:write_file(FileName, C1),
+ {ok, _, []} = compile:file(FileName, [return]),
C2 = <<"-module(otp_8664).\n"
"-export([t/0]).\n"
"-spec t() -> 9 and 4.\n"
"t() -> 0.\n">>,
- ?line ok = file:write_file(FileName, C2),
- ?line {error,[{_,[{3,erl_lint,{type_syntax,integer}}]}],_} =
+ ok = file:write_file(FileName, C2),
+ {error,[{_,[{3,erl_lint,{type_syntax,integer}}]}],_} =
compile:file(FileName, [return]),
ok.
-otp_9147(doc) ->
- "OTP_9147. Create well-formed types when adding 'undefined'.";
-otp_9147(suite) -> [];
+%% OTP-9147. Create well-formed types when adding 'undefined'.
otp_9147(Config) when is_list(Config) ->
FileName = filename('otp_9147.erl', Config),
C1 = <<"-module(otp_9147).\n"
"-export_type([undef/0]).\n"
"-record(undef, {f1 :: F1 :: a | b}).\n"
"-type undef() :: #undef{}.\n">>,
- ?line ok = file:write_file(FileName, C1),
- ?line {ok, _, []} =
+ ok = file:write_file(FileName, C1),
+ {ok, _, []} =
compile:file(FileName, [return,'P',{outdir,?privdir}]),
PFileName = filename('otp_9147.P', Config),
- ?line {ok, Bin} = file:read_file(PFileName),
+ {ok, Bin} = file:read_file(PFileName),
%% The parentheses around "F1 :: a | b" are new (bugfix).
- ?line true =
+ true =
lists:member("-record(undef,{f1 :: F1 :: a | b}).",
string:tokens(binary_to_list(Bin), "\n")),
ok.
-otp_10302(doc) ->
- "OTP-10302. Unicode characters scanner/parser.";
-otp_10302(suite) -> [];
+%% OTP-10302. Unicode characters scanner/parser.
otp_10302(Config) when is_list(Config) ->
Ts = [{uni_1,
<<"t() -> <<(<<\"abc\\x{aaa}\">>):3/binary>>.">>}
@@ -1105,9 +1034,7 @@ unicode_hook({foo,E}, I, P, H) ->
A = erl_anno:new(0),
erl_pp:expr({call,A,{atom,A,foo},[E]}, I, P, H).
-otp_10820(doc) ->
- "OTP-10820. Unicode filenames.";
-otp_10820(suite) -> [];
+%% OTP-10820. Unicode filenames.
otp_10820(Config) when is_list(Config) ->
C1 = <<"%% coding: utf-8\n -module(any).">>,
ok = do_otp_10820(Config, C1, "+pc latin1"),
@@ -1133,9 +1060,7 @@ file_attr_is_string("-file(\"" ++ _) -> true;
file_attr_is_string([_ | L]) ->
file_attr_is_string(L).
-otp_11100(doc) ->
- "OTP-11100. Fix printing of invalid forms.";
-otp_11100(suite) -> [];
+%% OTP-11100. Fix printing of invalid forms.
otp_11100(Config) when is_list(Config) ->
%% There are a few places where the added code ("options(none)")
%% doesn't make a difference (pp:bit_elem_type/1 is an example).
@@ -1170,9 +1095,7 @@ otp_11100(Config) when is_list(Config) ->
[]}}),
ok.
-otp_11861(doc) ->
- "OTP-11861. behaviour_info() and -callback.";
-otp_11861(suite) -> [];
+%% OTP-11861. behaviour_info() and -callback.
otp_11861(Config) when is_list(Config) ->
"-optional_callbacks([bar/0]).\n" =
pf({attribute,3,optional_callbacks,[{bar,0}]}),
@@ -1193,11 +1116,11 @@ compile(Config, Tests) ->
ok ->
BadL;
not_ok ->
- ?t:format("~nTest ~p failed.~n", [N]),
+ io:format("~nTest ~p failed.~n", [N]),
fail()
end;
Bad ->
- ?t:format("~nTest ~p failed. got~n ~p~n",
+ io:format("~nTest ~p failed. got~n ~p~n",
[N, Bad]),
fail()
end
@@ -1363,10 +1286,9 @@ filename(Name, Config) ->
filename:join(?privdir, Name).
fail() ->
- io:format("failed~n"),
- ?t:fail().
+ ct:fail(failed).
%% +fnu means a peer node has to be started; slave will not do
start_node(Name, Xargs) ->
- ?line PA = filename:dirname(code:which(?MODULE)),
+ PA = filename:dirname(code:which(?MODULE)),
test_server:start_node(Name, peer, [{args, "-pa " ++ PA ++ " " ++ Xargs}]).
diff --git a/lib/stdlib/test/erl_scan_SUITE.erl b/lib/stdlib/test/erl_scan_SUITE.erl
index 941703b5dd..9432edc00f 100644
--- a/lib/stdlib/test/erl_scan_SUITE.erl
+++ b/lib/stdlib/test/erl_scan_SUITE.erl
@@ -18,11 +18,12 @@
%% %CopyrightEnd%
-module(erl_scan_SUITE).
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
+-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
+ init_per_testcase/2, end_per_testcase/2,
init_per_group/2,end_per_group/2]).
--export([ error_1/1, error_2/1, iso88591/1, otp_7810/1, otp_10302/1,
- otp_10990/1, otp_10992/1, otp_11807/1]).
+-export([error_1/1, error_2/1, iso88591/1, otp_7810/1, otp_10302/1,
+ otp_10990/1, otp_10992/1, otp_11807/1]).
-import(lists, [nth/2,flatten/1]).
-import(io_lib, [print/1]).
@@ -30,7 +31,7 @@
%%
%% Define to run outside of test server
%%
-%-define(STANDALONE,1).
+%%-define(STANDALONE,1).
-ifdef(STANDALONE).
-compile(export_all).
@@ -43,22 +44,17 @@
%% ".".
-else.
-include_lib("common_test/include/ct.hrl").
--export([init_per_testcase/2, end_per_testcase/2]).
+-endif.
-init_per_testcase(_Case, Config) when is_list(Config) ->
- ?line Dog=test_server:timetrap(test_server:seconds(1200)),
- [{watchdog, Dog}|Config].
+init_per_testcase(_Case, Config) ->
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
--endif.
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,20}}].
all() ->
[{group, error}, iso88591, otp_7810, otp_10302, otp_10990, otp_10992,
@@ -81,20 +77,14 @@ end_per_group(_GroupName, Config) ->
-error_1(doc) ->
- ["(OTP-2347)"];
-error_1(suite) ->
- [];
+%% (OTP-2347)
error_1(Config) when is_list(Config) ->
- ?line {error, _, _} = erl_scan:string("'a"),
+ {error, _, _} = erl_scan:string("'a"),
ok.
-error_2(doc) ->
- ["Checks that format_error works on the error cases."];
-error_2(suite) ->
- [];
+%% Checks that format_error works on the error cases.
error_2(Config) when is_list(Config) ->
- ?line lists:foreach(fun check/1, error_cases()),
+ lists:foreach(fun check/1, error_cases()),
ok.
error_cases() ->
@@ -107,7 +97,7 @@ error_cases() ->
"2.3e",
"2.3e-",
"91#9"
-].
+ ].
assert_type(N, integer) when is_integer(N) ->
ok;
@@ -128,70 +118,66 @@ check_error({error, Info, EndLine}, Module0) ->
String = lists:flatten(Module0:format_error(Desc)),
true = io_lib:printable_list(String).
-iso88591(doc) -> ["Tests the support for ISO-8859-1 i.e Latin-1"];
-iso88591(suite) -> [];
+%% Tests the support for ISO-8859-1 i.e Latin-1.
iso88591(Config) when is_list(Config) ->
- ?line ok =
- case catch begin
- %% Some atom and variable names
- V1s = [$Á,$á,$é,$ë],
- V2s = [$N,$ä,$r],
- A1s = [$h,$ä,$r],
- A2s = [$ö,$r,$e],
- %% Test parsing atom and variable characters.
- {ok,Ts1,_} = erl_scan_string(V1s ++ " " ++ V2s ++
- "\327" ++
- A1s ++ " " ++ A2s),
- V1s = atom_to_list(element(3, nth(1, Ts1))),
- V2s = atom_to_list(element(3, nth(2, Ts1))),
- A1s = atom_to_list(element(3, nth(4, Ts1))),
- A2s = atom_to_list(element(3, nth(5, Ts1))),
- %% Test printing atoms
- A1s = flatten(print(element(3, nth(4, Ts1)))),
- A2s = flatten(print(element(3, nth(5, Ts1)))),
- %% Test parsing and printing strings.
- S1 = V1s ++ "\327" ++ A1s ++ "\250" ++ A2s,
- S1s = "\"" ++ S1 ++ "\"",
- {ok,Ts2,_} = erl_scan_string(S1s),
- S1 = element(3, nth(1, Ts2)),
- S1s = flatten(print(element(3, nth(1, Ts2)))),
- ok %It all worked
- end of
- {'EXIT',R} -> %Something went wrong!
- {error,R};
- ok -> ok %Aok
- end.
-
-otp_7810(doc) ->
- ["OTP-7810. White spaces, comments, and more.."];
-otp_7810(suite) ->
- [];
+ ok =
+ case catch begin
+ %% Some atom and variable names
+ V1s = [$Á,$á,$é,$ë],
+ V2s = [$N,$ä,$r],
+ A1s = [$h,$ä,$r],
+ A2s = [$ö,$r,$e],
+ %% Test parsing atom and variable characters.
+ {ok,Ts1,_} = erl_scan_string(V1s ++ " " ++ V2s ++
+ "\327" ++
+ A1s ++ " " ++ A2s),
+ V1s = atom_to_list(element(3, nth(1, Ts1))),
+ V2s = atom_to_list(element(3, nth(2, Ts1))),
+ A1s = atom_to_list(element(3, nth(4, Ts1))),
+ A2s = atom_to_list(element(3, nth(5, Ts1))),
+ %% Test printing atoms
+ A1s = flatten(print(element(3, nth(4, Ts1)))),
+ A2s = flatten(print(element(3, nth(5, Ts1)))),
+ %% Test parsing and printing strings.
+ S1 = V1s ++ "\327" ++ A1s ++ "\250" ++ A2s,
+ S1s = "\"" ++ S1 ++ "\"",
+ {ok,Ts2,_} = erl_scan_string(S1s),
+ S1 = element(3, nth(1, Ts2)),
+ S1s = flatten(print(element(3, nth(1, Ts2)))),
+ ok %It all worked
+ end of
+ {'EXIT',R} -> %Something went wrong!
+ {error,R};
+ ok -> ok %Aok
+ end.
+
+%% OTP-7810. White spaces, comments, and more...
otp_7810(Config) when is_list(Config) ->
- ?line ok = reserved_words(),
- ?line ok = atoms(),
- ?line ok = punctuations(),
- ?line ok = comments(),
- ?line ok = errors(),
- ?line ok = integers(),
- ?line ok = base_integers(),
- ?line ok = floats(),
- ?line ok = dots(),
- ?line ok = chars(),
- ?line ok = variables(),
- ?line ok = eof(),
- ?line ok = illegal(),
- ?line ok = crashes(),
-
- ?line ok = options(),
- ?line ok = token_info(),
- ?line ok = column_errors(),
- ?line ok = white_spaces(),
-
- ?line ok = unicode(),
-
- ?line ok = more_chars(),
- ?line ok = more_options(),
- ?line ok = anno_info(),
+ ok = reserved_words(),
+ ok = atoms(),
+ ok = punctuations(),
+ ok = comments(),
+ ok = errors(),
+ ok = integers(),
+ ok = base_integers(),
+ ok = floats(),
+ ok = dots(),
+ ok = chars(),
+ ok = variables(),
+ ok = eof(),
+ ok = illegal(),
+ ok = crashes(),
+
+ ok = options(),
+ ok = token_info(),
+ ok = column_errors(),
+ ok = white_spaces(),
+
+ ok = unicode(),
+
+ ok = more_chars(),
+ ok = more_options(),
+ ok = anno_info(),
ok.
@@ -202,10 +188,10 @@ reserved_words() ->
'rem', 'band', 'and', 'bor', 'bxor', 'bsl', 'bsr',
'or', 'xor'],
[begin
- ?line {RW, true} = {RW, erl_scan:reserved_word(RW)},
+ {RW, true} = {RW, erl_scan:reserved_word(RW)},
S = atom_to_list(RW),
Ts = [{RW,{1,1}}],
- ?line test_string(S, Ts)
+ test_string(S, Ts)
end || RW <- L],
ok.
@@ -214,14 +200,14 @@ atoms() ->
test_string("a
b", [{atom,{1,1},a},{atom,{2,18},b}]),
test_string("'a b'", [{atom,{1,1},'a b'}]),
- test_string("a", [{atom,{1,1},a}]),
- test_string("a@2", [{atom,{1,1},a@2}]),
- test_string([39,65,200,39], [{atom,{1,1},'AÈ'}]),
- test_string("ärlig östen", [{atom,{1,1},ärlig},{atom,{1,7},östen}]),
- ?line {ok,[{atom,_,'$a'}],{1,6}} =
- erl_scan_string("'$\\a'", {1,1}),
- ?line test("'$\\a'"),
- ok.
+ test_string("a", [{atom,{1,1},a}]),
+ test_string("a@2", [{atom,{1,1},a@2}]),
+ test_string([39,65,200,39], [{atom,{1,1},'AÈ'}]),
+ test_string("ärlig östen", [{atom,{1,1},ärlig},{atom,{1,7},östen}]),
+ {ok,[{atom,_,'$a'}],{1,6}} =
+ erl_scan_string("'$\\a'", {1,1}),
+ test("'$\\a'"),
+ ok.
punctuations() ->
L = ["<<", "<-", "<=", "<", ">>", ">=", ">", "->", "--",
@@ -231,7 +217,7 @@ punctuations() ->
[begin
W = list_to_atom(S),
Ts = [{W,{1,1}}],
- ?line test_string(S, Ts)
+ test_string(S, Ts)
end || S <- L],
Three = ["/=:=", "<=:=", "==:=", ">=:="], % three tokens...
No = Three ++ L,
@@ -247,18 +233,18 @@ punctuations() ->
W1 = list_to_atom(S1),
W2 = list_to_atom(S2),
Ts = [{W1,{1,1}},{W2,{1,-L2+1}}],
- ?line test_string(S, Ts)
+ test_string(S, Ts)
end || {S,[{L2,S1,S2}|_]} <- SL],
PTs1 = [{'!',{1,1}},{'(',{1,2}},{')',{1,3}},{',',{1,4}},{';',{1,5}},
{'=',{1,6}},{'[',{1,7}},{']',{1,8}},{'{',{1,9}},{'|',{1,10}},
{'}',{1,11}}],
- ?line test_string("!(),;=[]{|}", PTs1),
+ test_string("!(),;=[]{|}", PTs1),
PTs2 = [{'#',{1,1}},{'&',{1,2}},{'*',{1,3}},{'+',{1,4}},{'/',{1,5}},
{':',{1,6}},{'<',{1,7}},{'>',{1,8}},{'?',{1,9}},{'@',{1,10}},
{'\\',{1,11}},{'^',{1,12}},{'`',{1,13}},{'~',{1,14}}],
- ?line test_string("#&*+/:<>?@\\^`~", PTs2),
+ test_string("#&*+/:<>?@\\^`~", PTs2),
test_string(".. ", [{'..',{1,1}}]),
test_string("1 .. 2",
@@ -267,9 +253,9 @@ punctuations() ->
ok.
comments() ->
- ?line test("a %%\n b"),
- ?line {ok,[],1} = erl_scan_string("%"),
- ?line test("a %%\n b"),
+ test("a %%\n b"),
+ {ok,[],1} = erl_scan_string("%"),
+ test("a %%\n b"),
{ok,[{atom,{1,1},a},{atom,{2,2},b}],{2,3}} =
erl_scan_string("a %%\n b", {1,1}),
{ok,[{atom,{1,1},a},{comment,{1,3},"%%"},{atom,{2,2},b}],{2,3}} =
@@ -289,30 +275,30 @@ comments() ->
ok.
errors() ->
- ?line {error,{1,erl_scan,{string,$',"qa"}},1} = erl_scan:string("'qa"), %'
+ {error,{1,erl_scan,{string,$',"qa"}},1} = erl_scan:string("'qa"), %'
{error,{{1,1},erl_scan,{string,$',"qa"}},{1,4}} = %'
erl_scan:string("'qa", {1,1}, []), %'
- ?line {error,{1,erl_scan,{string,$","str"}},1} = %"
+ {error,{1,erl_scan,{string,$","str"}},1} = %"
erl_scan:string("\"str"), %"
{error,{{1,1},erl_scan,{string,$","str"}},{1,5}} = %"
erl_scan:string("\"str", {1,1}, []), %"
- ?line {error,{1,erl_scan,char},1} = erl_scan:string("$"),
+ {error,{1,erl_scan,char},1} = erl_scan:string("$"),
{error,{{1,1},erl_scan,char},{1,2}} = erl_scan:string("$", {1,1}, []),
test_string([34,65,200,34], [{string,{1,1},"AÈ"}]),
test_string("\\", [{'\\',{1,1}}]),
- ?line {'EXIT',_} =
+ {'EXIT',_} =
(catch {foo, erl_scan:string('$\\a', {1,1})}), % type error
- ?line {'EXIT',_} =
+ {'EXIT',_} =
(catch {foo, erl_scan:tokens([], '$\\a', {1,1})}), % type error
- ?line "{a,tuple}" = erl_scan:format_error({a,tuple}),
+ "{a,tuple}" = erl_scan:format_error({a,tuple}),
ok.
integers() ->
[begin
I = list_to_integer(S),
Ts = [{integer,{1,1},I}],
- ?line test_string(S, Ts)
+ test_string(S, Ts)
end || S <- [[N] || N <- lists:seq($0, $9)] ++ ["2323","000"] ],
ok.
@@ -321,11 +307,11 @@ base_integers() ->
B = list_to_integer(BS),
I = erlang:list_to_integer(S, B),
Ts = [{integer,{1,1},I}],
- ?line test_string(BS++"#"++S, Ts)
+ test_string(BS++"#"++S, Ts)
end || {BS,S} <- [{"2","11"}, {"5","23234"}, {"12","05a"},
{"16","abcdef"}, {"16","ABCDEF"}] ],
- ?line {error,{1,erl_scan,{base,1}},1} = erl_scan:string("1#000"),
+ {error,{1,erl_scan,{base,1}},1} = erl_scan:string("1#000"),
{error,{{1,1},erl_scan,{base,1}},{1,2}} =
erl_scan:string("1#000", {1,1}, []),
@@ -333,11 +319,11 @@ base_integers() ->
[begin
Str = BS ++ "#" ++ S,
- ?line {error,{1,erl_scan,{illegal,integer}},1} =
+ {error,{1,erl_scan,{illegal,integer}},1} =
erl_scan:string(Str)
end || {BS,S} <- [{"3","3"},{"15","f"}, {"12","c"}] ],
- ?line {ok,[{integer,1,239},{'@',1}],1} = erl_scan_string("16#ef@"),
+ {ok,[{integer,1,239},{'@',1}],1} = erl_scan_string("16#ef@"),
{ok,[{integer,{1,1},239},{'@',{1,6}}],{1,7}} =
erl_scan_string("16#ef@", {1,1}, []),
{ok,[{integer,{1,1},14},{atom,{1,5},g@}],{1,7}} =
@@ -349,12 +335,12 @@ floats() ->
[begin
F = list_to_float(FS),
Ts = [{float,{1,1},F}],
- ?line test_string(FS, Ts)
+ test_string(FS, Ts)
end || FS <- ["1.0","001.17","3.31200","1.0e0","1.0E17",
"34.21E-18", "17.0E+14"]],
test_string("1.e2", [{integer,{1,1},1},{'.',{1,2}},{atom,{1,3},e2}]),
- ?line {error,{1,erl_scan,{illegal,float}},1} =
+ {error,{1,erl_scan,{illegal,float}},1} =
erl_scan:string("1.0e400"),
{error,{{1,1},erl_scan,{illegal,float}},{1,8}} =
erl_scan:string("1.0e400", {1,1}, []),
@@ -375,11 +361,11 @@ dots() ->
{".% öh",{ok,[{dot,1}],1}, {ok,[{dot,{1,1}}],{1,6}}},
{".%\n", {ok,[{dot,1}],2}, {ok,[{dot,{1,1}}],{2,1}}},
{".$", {error,{1,erl_scan,char},1},
- {error,{{1,2},erl_scan,char},{1,3}}},
+ {error,{{1,2},erl_scan,char},{1,3}}},
{".$\\", {error,{1,erl_scan,char},1},
{error,{{1,2},erl_scan,char},{1,4}}},
{".a", {ok,[{'.',1},{atom,1,a}],1},
- {ok,[{'.',{1,1}},{atom,{1,2},a}],{1,3}}}
+ {ok,[{'.',{1,1}},{atom,{1,2},a}],{1,3}}}
],
[begin
R = erl_scan_string(S),
@@ -425,27 +411,27 @@ chars() ->
[begin
L = lists:flatten(io_lib:format("$\\~.8b", [C])),
Ts = [{char,{1,1},C}],
- ?line test_string(L, Ts)
+ test_string(L, Ts)
end || C <- lists:seq(0, 255)],
%% Leading zeroes...
[begin
L = lists:flatten(io_lib:format("$\\~3.8.0b", [C])),
Ts = [{char,{1,1},C}],
- ?line test_string(L, Ts)
+ test_string(L, Ts)
end || C <- lists:seq(0, 255)],
%% $\^\n now increments the line...
[begin
L = "$\\^" ++ [C],
Ts = [{char,{1,1},C band 2#11111}],
- ?line test_string(L, Ts)
+ test_string(L, Ts)
end || C <- lists:seq(0, 255)],
[begin
L = "$\\" ++ [C],
Ts = [{char,{1,1},V}],
- ?line test_string(L, Ts)
+ test_string(L, Ts)
end || {C,V} <- [{$n,$\n}, {$r,$\r}, {$t,$\t}, {$v,$\v},
{$b,$\b}, {$f,$\f}, {$e,$\e}, {$s,$\s},
{$d,$\d}]],
@@ -458,13 +444,13 @@ chars() ->
[begin
L = "$\\" ++ [C],
Ts = [{char,{1,1},C}],
- ?line test_string(L, Ts)
+ test_string(L, Ts)
end || C <- lists:seq(0, 255) -- No],
[begin
L = "'$\\" ++ [C] ++ "'",
Ts = [{atom,{1,1},list_to_atom("$"++[C])}],
- ?line test_string(L, Ts)
+ test_string(L, Ts)
end || C <- lists:seq(0, 255) -- No],
test_string("\"\\013a\\\n\"", [{string,{1,1},"\va\n"}]),
@@ -476,17 +462,17 @@ chars() ->
[begin
L = "$" ++ [C],
Ts = [{char,{1,1},C}],
- ?line test_string(L, Ts)
+ test_string(L, Ts)
end || C <- lists:seq(0, 255) -- (No ++ [$\\])],
test_string("$\n", [{char,{1,1},$\n}]),
- ?line {error,{{1,1},erl_scan,char},{1,4}} =
+ {error,{{1,1},erl_scan,char},{1,4}} =
erl_scan:string("$\\^",{1,1}),
test_string("$\\\n", [{char,{1,1},$\n}]),
%% Robert's scanner returns line 1:
test_string("$\\\n", [{char,{1,1},$\n}]),
test_string("$\n\n", [{char,{1,1},$\n}]),
- ?line test("$\n\n"),
+ test("$\n\n"),
ok.
@@ -499,30 +485,30 @@ variables() ->
ok.
eof() ->
- ?line {done,{eof,1},eof} = erl_scan:tokens([], eof, 1),
+ {done,{eof,1},eof} = erl_scan:tokens([], eof, 1),
{more, C1} = erl_scan:tokens([]," \n", 1),
- ?line {done,{eof,2},eof} = erl_scan:tokens(C1, eof, 1),
+ {done,{eof,2},eof} = erl_scan:tokens(C1, eof, 1),
{more, C2} = erl_scan:tokens([], "abra", 1),
%% An error before R13A.
- %% ?line {done,Err={error,{1,erl_scan,scan},1},eof} =
- ?line {done,{ok,[{atom,1,abra}],1},eof} =
+ %% {done,Err={error,{1,erl_scan,scan},1},eof} =
+ {done,{ok,[{atom,1,abra}],1},eof} =
erl_scan_tokens(C2, eof, 1),
%% With column.
- ?line {more, C3} = erl_scan:tokens([]," \n",{1,1}),
- ?line {done,{eof,{2,1}},eof} = erl_scan:tokens(C3, eof, 1),
+ {more, C3} = erl_scan:tokens([]," \n",{1,1}),
+ {done,{eof,{2,1}},eof} = erl_scan:tokens(C3, eof, 1),
{more, C4} = erl_scan:tokens([], "abra", {1,1}),
%% An error before R13A.
- %% ?line {done,{error,{{1,1},erl_scan,scan},{1,5}},eof} =
- ?line {done,{ok,[{atom,_,abra}],{1,5}},eof} =
+ %% {done,{error,{{1,1},erl_scan,scan},{1,5}},eof} =
+ {done,{ok,[{atom,_,abra}],{1,5}},eof} =
erl_scan_tokens(C4, eof, 1),
%% Robert's scanner returns "" as LeftoverChars;
%% the R12B scanner returns eof as LeftoverChars: (eof is correct)
- ?line {more, C5} = erl_scan:tokens([], "a", 1),
+ {more, C5} = erl_scan:tokens([], "a", 1),
%% An error before R13A.
- %% ?line {done,{error,{1,erl_scan,scan},1},eof} =
- ?line {done,{ok,[{atom,1,a}],1},eof} =
+ %% {done,{error,{1,erl_scan,scan},1},eof} =
+ {done,{ok,[{atom,1,a}],1},eof} =
erl_scan_tokens(C5,eof,1),
%% With column.
@@ -533,9 +519,9 @@ eof() ->
erl_scan_tokens(C6,eof,1),
%% A dot followed by eof is special:
- ?line {more, C} = erl_scan:tokens([], "a.", 1),
- ?line {done,{ok,[{atom,1,a},{dot,1}],1},eof} = erl_scan_tokens(C,eof,1),
- ?line {ok,[{atom,1,foo},{dot,1}],1} = erl_scan_string("foo."),
+ {more, C} = erl_scan:tokens([], "a.", 1),
+ {done,{ok,[{atom,1,a},{dot,1}],1},eof} = erl_scan_tokens(C,eof,1),
+ {ok,[{atom,1,foo},{dot,1}],1} = erl_scan_string("foo."),
%% With column.
{more, CCol} = erl_scan:tokens([], "a.", {1,1}),
@@ -548,100 +534,100 @@ eof() ->
illegal() ->
Atom = lists:duplicate(1000, $a),
- ?line {error,{1,erl_scan,{illegal,atom}},1} = erl_scan:string(Atom),
- ?line {done,{error,{1,erl_scan,{illegal,atom}},1},". "} =
+ {error,{1,erl_scan,{illegal,atom}},1} = erl_scan:string(Atom),
+ {done,{error,{1,erl_scan,{illegal,atom}},1},". "} =
erl_scan:tokens([], Atom++". ", 1),
QAtom = "'" ++ Atom ++ "'",
- ?line {error,{1,erl_scan,{illegal,atom}},1} = erl_scan:string(QAtom),
- ?line {done,{error,{1,erl_scan,{illegal,atom}},1},". "} =
+ {error,{1,erl_scan,{illegal,atom}},1} = erl_scan:string(QAtom),
+ {done,{error,{1,erl_scan,{illegal,atom}},1},". "} =
erl_scan:tokens([], QAtom++". ", 1),
Var = lists:duplicate(1000, $A),
- ?line {error,{1,erl_scan,{illegal,var}},1} = erl_scan:string(Var),
- ?line {done,{error,{1,erl_scan,{illegal,var}},1},". "} =
+ {error,{1,erl_scan,{illegal,var}},1} = erl_scan:string(Var),
+ {done,{error,{1,erl_scan,{illegal,var}},1},". "} =
erl_scan:tokens([], Var++". ", 1),
Float = "1" ++ lists:duplicate(400, $0) ++ ".0",
- ?line {error,{1,erl_scan,{illegal,float}},1} = erl_scan:string(Float),
- ?line {done,{error,{1,erl_scan,{illegal,float}},1},". "} =
+ {error,{1,erl_scan,{illegal,float}},1} = erl_scan:string(Float),
+ {done,{error,{1,erl_scan,{illegal,float}},1},". "} =
erl_scan:tokens([], Float++". ", 1),
String = "\"43\\x{aaaaaa}34\"",
- ?line {error,{1,erl_scan,{illegal,character}},1} = erl_scan:string(String),
- ?line {done,{error,{1,erl_scan,{illegal,character}},1},"34\". "} =
+ {error,{1,erl_scan,{illegal,character}},1} = erl_scan:string(String),
+ {done,{error,{1,erl_scan,{illegal,character}},1},"34\". "} =
%% Would be nice if `34\"' were skipped...
%% Maybe, but then the LeftOverChars would not be the characters
%% immediately following the end location of the error.
erl_scan:tokens([], String++". ", 1),
- ?line {error,{{1,1},erl_scan,{illegal,atom}},{1,1001}} =
+ {error,{{1,1},erl_scan,{illegal,atom}},{1,1001}} =
erl_scan:string(Atom, {1,1}),
- ?line {done,{error,{{1,5},erl_scan,{illegal,atom}},{1,1005}},". "} =
+ {done,{error,{{1,5},erl_scan,{illegal,atom}},{1,1005}},". "} =
erl_scan:tokens([], "foo "++Atom++". ", {1,1}),
- ?line {error,{{1,1},erl_scan,{illegal,atom}},{1,1003}} =
+ {error,{{1,1},erl_scan,{illegal,atom}},{1,1003}} =
erl_scan:string(QAtom, {1,1}),
- ?line {done,{error,{{1,5},erl_scan,{illegal,atom}},{1,1007}},". "} =
+ {done,{error,{{1,5},erl_scan,{illegal,atom}},{1,1007}},". "} =
erl_scan:tokens([], "foo "++QAtom++". ", {1,1}),
- ?line {error,{{1,1},erl_scan,{illegal,var}},{1,1001}} =
+ {error,{{1,1},erl_scan,{illegal,var}},{1,1001}} =
erl_scan:string(Var, {1,1}),
- ?line {done,{error,{{1,5},erl_scan,{illegal,var}},{1,1005}},". "} =
+ {done,{error,{{1,5},erl_scan,{illegal,var}},{1,1005}},". "} =
erl_scan:tokens([], "foo "++Var++". ", {1,1}),
- ?line {error,{{1,1},erl_scan,{illegal,float}},{1,404}} =
+ {error,{{1,1},erl_scan,{illegal,float}},{1,404}} =
erl_scan:string(Float, {1,1}),
- ?line {done,{error,{{1,5},erl_scan,{illegal,float}},{1,408}},". "} =
+ {done,{error,{{1,5},erl_scan,{illegal,float}},{1,408}},". "} =
erl_scan:tokens([], "foo "++Float++". ", {1,1}),
- ?line {error,{{1,4},erl_scan,{illegal,character}},{1,14}} =
+ {error,{{1,4},erl_scan,{illegal,character}},{1,14}} =
erl_scan:string(String, {1,1}),
- ?line {done,{error,{{1,4},erl_scan,{illegal,character}},{1,14}},"34\". "} =
+ {done,{error,{{1,4},erl_scan,{illegal,character}},{1,14}},"34\". "} =
erl_scan:tokens([], String++". ", {1,1}),
ok.
crashes() ->
- ?line {'EXIT',_} = (catch {foo, erl_scan:string([-1])}), % type error
- ?line {'EXIT',_} = (catch {foo, erl_scan:string("$"++[-1])}),
- ?line {'EXIT',_} = (catch {foo, erl_scan:string("$\\"++[-1])}),
- ?line {'EXIT',_} = (catch {foo, erl_scan:string("$\\^"++[-1])}),
- ?line {'EXIT',_} = (catch {foo, erl_scan:string([$",-1,$"],{1,1})}),
- ?line {'EXIT',_} = (catch {foo, erl_scan:string("\"\\v"++[-1,$"])}), %$"
- ?line {'EXIT',_} = (catch {foo, erl_scan:string([$",-1,$"])}),
- ?line {'EXIT',_} = (catch {foo, erl_scan:string("% foo"++[-1])}),
- ?line {'EXIT',_} =
+ {'EXIT',_} = (catch {foo, erl_scan:string([-1])}), % type error
+ {'EXIT',_} = (catch {foo, erl_scan:string("$"++[-1])}),
+ {'EXIT',_} = (catch {foo, erl_scan:string("$\\"++[-1])}),
+ {'EXIT',_} = (catch {foo, erl_scan:string("$\\^"++[-1])}),
+ {'EXIT',_} = (catch {foo, erl_scan:string([$",-1,$"],{1,1})}),
+ {'EXIT',_} = (catch {foo, erl_scan:string("\"\\v"++[-1,$"])}), %$"
+ {'EXIT',_} = (catch {foo, erl_scan:string([$",-1,$"])}),
+ {'EXIT',_} = (catch {foo, erl_scan:string("% foo"++[-1])}),
+ {'EXIT',_} =
(catch {foo, erl_scan:string("% foo"++[-1],{1,1})}),
- ?line {'EXIT',_} = (catch {foo, erl_scan:string([a])}), % type error
- ?line {'EXIT',_} = (catch {foo, erl_scan:string("$"++[a])}),
- ?line {'EXIT',_} = (catch {foo, erl_scan:string("$\\"++[a])}),
- ?line {'EXIT',_} = (catch {foo, erl_scan:string("$\\^"++[a])}),
- ?line {'EXIT',_} = (catch {foo, erl_scan:string([$",a,$"],{1,1})}),
- ?line {'EXIT',_} = (catch {foo, erl_scan:string("\"\\v"++[a,$"])}), %$"
- ?line {'EXIT',_} = (catch {foo, erl_scan:string([$",a,$"])}),
- ?line {'EXIT',_} = (catch {foo, erl_scan:string("% foo"++[a])}),
- ?line {'EXIT',_} =
+ {'EXIT',_} = (catch {foo, erl_scan:string([a])}), % type error
+ {'EXIT',_} = (catch {foo, erl_scan:string("$"++[a])}),
+ {'EXIT',_} = (catch {foo, erl_scan:string("$\\"++[a])}),
+ {'EXIT',_} = (catch {foo, erl_scan:string("$\\^"++[a])}),
+ {'EXIT',_} = (catch {foo, erl_scan:string([$",a,$"],{1,1})}),
+ {'EXIT',_} = (catch {foo, erl_scan:string("\"\\v"++[a,$"])}), %$"
+ {'EXIT',_} = (catch {foo, erl_scan:string([$",a,$"])}),
+ {'EXIT',_} = (catch {foo, erl_scan:string("% foo"++[a])}),
+ {'EXIT',_} =
(catch {foo, erl_scan:string("% foo"++[a],{1,1})}),
- ?line {'EXIT',_} = (catch {foo, erl_scan:string([3.0])}), % type error
+ {'EXIT',_} = (catch {foo, erl_scan:string([3.0])}), % type error
ok.
options() ->
%% line and column are not options, but tested here
- ?line {ok,[{atom,1,foo},{white_space,1," "},{comment,1,"% bar"}], 1} =
+ {ok,[{atom,1,foo},{white_space,1," "},{comment,1,"% bar"}], 1} =
erl_scan_string("foo % bar", 1, return),
- ?line {ok,[{atom,1,foo},{white_space,1," "}],1} =
+ {ok,[{atom,1,foo},{white_space,1," "}],1} =
erl_scan_string("foo % bar", 1, return_white_spaces),
- ?line {ok,[{atom,1,foo},{comment,1,"% bar"}],1} =
+ {ok,[{atom,1,foo},{comment,1,"% bar"}],1} =
erl_scan_string("foo % bar", 1, return_comments),
- ?line {ok,[{atom,17,foo}],17} =
+ {ok,[{atom,17,foo}],17} =
erl_scan_string("foo % bar", 17),
- ?line {'EXIT',{function_clause,_}} =
+ {'EXIT',{function_clause,_}} =
(catch {foo,
erl_scan:string("foo % bar", {a,1}, [])}), % type error
- ?line {ok,[{atom,_,foo}],{17,18}} =
+ {ok,[{atom,_,foo}],{17,18}} =
erl_scan_string("foo % bar", {17,9}, []),
- ?line {'EXIT',{function_clause,_}} =
+ {'EXIT',{function_clause,_}} =
(catch {foo,
erl_scan:string("foo % bar", {1,0}, [])}), % type error
- ?line {ok,[{foo,1}],1} =
+ {ok,[{foo,1}],1} =
erl_scan_string("foo % bar",1, [{reserved_word_fun,
fun(W) -> W =:= foo end}]),
- ?line {'EXIT',{badarg,_}} =
+ {'EXIT',{badarg,_}} =
(catch {foo,
erl_scan:string("foo % bar",1, % type error
[{reserved_word_fun,
@@ -716,40 +702,40 @@ anno_info() ->
ok.
column_errors() ->
- ?line {error,{{1,1},erl_scan,{string,$',""}},{1,3}} = % $'
+ {error,{{1,1},erl_scan,{string,$',""}},{1,3}} = % $'
erl_scan:string("'\\",{1,1}),
- ?line {error,{{1,1},erl_scan,{string,$",""}},{1,3}} = % $"
+ {error,{{1,1},erl_scan,{string,$",""}},{1,3}} = % $"
erl_scan:string("\"\\",{1,1}),
- ?line {error,{{1,1},erl_scan,{string,$',""}},{1,2}} = % $'
+ {error,{{1,1},erl_scan,{string,$',""}},{1,2}} = % $'
erl_scan:string("'",{1,1}),
- ?line {error,{{1,1},erl_scan,{string,$",""}},{1,2}} = % $"
+ {error,{{1,1},erl_scan,{string,$",""}},{1,2}} = % $"
erl_scan:string("\"",{1,1}),
- ?line {error,{{1,1},erl_scan,char},{1,2}} =
+ {error,{{1,1},erl_scan,char},{1,2}} =
erl_scan:string("$",{1,1}),
- ?line {error,{{1,2},erl_scan,{string,$',"1234567890123456"}},{1,20}} = %'
+ {error,{{1,2},erl_scan,{string,$',"1234567890123456"}},{1,20}} = %'
erl_scan:string(" '12345678901234567", {1,1}),
- ?line {error,{{1,2},erl_scan,{string,$',"123456789012345 "}}, {1,20}} = %'
+ {error,{{1,2},erl_scan,{string,$',"123456789012345 "}}, {1,20}} = %'
erl_scan:string(" '123456789012345\\s", {1,1}),
- ?line {error,{{1,2},erl_scan,{string,$","1234567890123456"}},{1,20}} = %"
+ {error,{{1,2},erl_scan,{string,$","1234567890123456"}},{1,20}} = %"
erl_scan:string(" \"12345678901234567", {1,1}),
- ?line {error,{{1,2},erl_scan,{string,$","123456789012345 "}}, {1,20}} = %"
+ {error,{{1,2},erl_scan,{string,$","123456789012345 "}}, {1,20}} = %"
erl_scan:string(" \"123456789012345\\s", {1,1}),
- ?line {error,{{1,2},erl_scan,{string,$',"1234567890123456"}},{2,1}} = %'
+ {error,{{1,2},erl_scan,{string,$',"1234567890123456"}},{2,1}} = %'
erl_scan:string(" '12345678901234567\n", {1,1}),
ok.
white_spaces() ->
- ?line {ok,[{white_space,_,"\r"},
+ {ok,[{white_space,_,"\r"},
{white_space,_," "},
{atom,_,a},
{white_space,_,"\n"}],
_} = erl_scan_string("\r a\n", {1,1}, return),
- ?line test("\r a\n"),
+ test("\r a\n"),
L = "{\"a\nb\", \"a\\nb\",\nabc\r,def}.\n\n",
- ?line {ok,[{'{',_},
+ {ok,[{'{',_},
{string,_,"a\nb"},
{',',_},
{white_space,_," "},
@@ -764,33 +750,33 @@ white_spaces() ->
{dot,_},
{white_space,_,"\n"}],
_} = erl_scan_string(L, {1,1}, return),
- ?line test(L),
- ?line test("\"\n\"\n"),
- ?line test("\n\r\n"),
- ?line test("\n\r"),
- ?line test("\r\n"),
- ?line test("\n\f"),
- ?line [test(lists:duplicate(N, $\t)) || N <- lists:seq(1, 20)],
- ?line [test([$\n|lists:duplicate(N, $\t)]) || N <- lists:seq(1, 20)],
- ?line [test(lists:duplicate(N, $\s)) || N <- lists:seq(1, 20)],
- ?line [test([$\n|lists:duplicate(N, $\s)]) || N <- lists:seq(1, 20)],
- ?line test("\v\f\n\v "),
- ?line test("\n\e\n\b\f\n\da\n"),
+ test(L),
+ test("\"\n\"\n"),
+ test("\n\r\n"),
+ test("\n\r"),
+ test("\r\n"),
+ test("\n\f"),
+ [test(lists:duplicate(N, $\t)) || N <- lists:seq(1, 20)],
+ [test([$\n|lists:duplicate(N, $\t)]) || N <- lists:seq(1, 20)],
+ [test(lists:duplicate(N, $\s)) || N <- lists:seq(1, 20)],
+ [test([$\n|lists:duplicate(N, $\s)]) || N <- lists:seq(1, 20)],
+ test("\v\f\n\v "),
+ test("\n\e\n\b\f\n\da\n"),
ok.
unicode() ->
- ?line {ok,[{char,1,83},{integer,1,45}],1} =
+ {ok,[{char,1,83},{integer,1,45}],1} =
erl_scan_string("$\\12345"), % not unicode
- ?line {error,{1,erl_scan,{illegal,character}},1} =
+ {error,{1,erl_scan,{illegal,character}},1} =
erl_scan:string([1089]),
- ?line {error,{{1,1},erl_scan,{illegal,character}},{1,2}} =
+ {error,{{1,1},erl_scan,{illegal,character}},{1,2}} =
erl_scan:string([1089], {1,1}),
{error,{1,erl_scan,{illegal,atom}},1} =
erl_scan:string("'a"++[1089]++"b'", 1),
{error,{{1,1},erl_scan,{illegal,atom}},{1,6}} =
erl_scan:string("'a"++[1089]++"b'", {1,1}),
- ?line test("\"a"++[1089]++"b\""),
+ test("\"a"++[1089]++"b\""),
{ok,[{char,1,1}],1} =
erl_scan_string([$$,$\\,$^,1089], 1),
@@ -798,7 +784,7 @@ unicode() ->
erl_scan:string("\"qa\x{aaa}", 1),
"unterminated string starting with \"qa"++[2730]++"\"" =
erl_scan:format_error(Error),
- ?line {error,{{1,1},erl_scan,_},{1,11}} =
+ {error,{{1,1},erl_scan,_},{1,11}} =
erl_scan:string("\"qa\\x{aaa}",{1,1}),
{error,{{1,1},erl_scan,{illegal,atom}},{1,12}} =
erl_scan:string("'qa\\x{aaa}'",{1,1}),
@@ -832,17 +818,17 @@ unicode() ->
{ok,[{string,1,[$\n,$\x{aaa},$\n]}],3} = erl_scan_string(U4, 1),
%% Keep these tests:
- ?line test(Qs),
- ?line test(U1),
- ?line test(U2),
- ?line test(U3),
- ?line test(U4),
+ test(Qs),
+ test(U1),
+ test(U2),
+ test(U3),
+ test(U4),
Str1 = "\"ab" ++ [1089] ++ "cd\"",
{ok,[{string,1,[$a,$b,1089,$c,$d]}],1} = erl_scan_string(Str1, 1),
{ok,[{string,{1,1},[$a,$b,1089,$c,$d]}],{1,8}} =
erl_scan_string(Str1, {1,1}),
- ?line test(Str1),
+ test(Str1),
Comment = "%% "++[1089],
{ok,[{comment,1,[$%,$%,$\s,1089]}],1} =
erl_scan_string(Comment, 1, [return]),
@@ -855,70 +841,67 @@ more_chars() ->
%% $\x{...}, $\xHH
%% All kinds of tests...
- ?line {ok,[{char,_,123}],{1,4}} =
+ {ok,[{char,_,123}],{1,4}} =
erl_scan_string("$\\{",{1,1}),
- ?line {more, C1} = erl_scan:tokens([], "$\\{", {1,1}),
- ?line {done,{ok,[{char,_,123}],{1,4}},eof} =
+ {more, C1} = erl_scan:tokens([], "$\\{", {1,1}),
+ {done,{ok,[{char,_,123}],{1,4}},eof} =
erl_scan_tokens(C1, eof, 1),
- ?line {ok,[{char,1,123},{atom,1,a},{'}',1}],1} =
+ {ok,[{char,1,123},{atom,1,a},{'}',1}],1} =
erl_scan_string("$\\{a}"),
- ?line {error,{{1,1},erl_scan,char},{1,4}} =
+ {error,{{1,1},erl_scan,char},{1,4}} =
erl_scan:string("$\\x", {1,1}),
- ?line {error,{{1,1},erl_scan,char},{1,5}} =
+ {error,{{1,1},erl_scan,char},{1,5}} =
erl_scan:string("$\\x{",{1,1}),
- ?line {more, C3} = erl_scan:tokens([], "$\\x", {1,1}),
- ?line {done,{error,{{1,1},erl_scan,char},{1,4}},eof} =
+ {more, C3} = erl_scan:tokens([], "$\\x", {1,1}),
+ {done,{error,{{1,1},erl_scan,char},{1,4}},eof} =
erl_scan:tokens(C3, eof, 1),
- ?line {error,{{1,1},erl_scan,char},{1,5}} =
+ {error,{{1,1},erl_scan,char},{1,5}} =
erl_scan:string("$\\x{",{1,1}),
- ?line {more, C2} = erl_scan:tokens([], "$\\x{", {1,1}),
- ?line {done,{error,{{1,1},erl_scan,char},{1,5}},eof} =
+ {more, C2} = erl_scan:tokens([], "$\\x{", {1,1}),
+ {done,{error,{{1,1},erl_scan,char},{1,5}},eof} =
erl_scan:tokens(C2, eof, 1),
- ?line {error,{1,erl_scan,{illegal,character}},1} =
+ {error,{1,erl_scan,{illegal,character}},1} =
erl_scan:string("$\\x{g}"),
- ?line {error,{{1,1},erl_scan,{illegal,character}},{1,5}} =
+ {error,{{1,1},erl_scan,{illegal,character}},{1,5}} =
erl_scan:string("$\\x{g}", {1,1}),
- ?line {error,{{1,1},erl_scan,{illegal,character}},{1,6}} =
+ {error,{{1,1},erl_scan,{illegal,character}},{1,6}} =
erl_scan:string("$\\x{}",{1,1}),
- ?line test("\"\\{0}\""),
- ?line test("\"\\x{0}\""),
- ?line test("\'\\{0}\'"),
- ?line test("\'\\x{0}\'"),
+ test("\"\\{0}\""),
+ test("\"\\x{0}\""),
+ test("\'\\{0}\'"),
+ test("\'\\x{0}\'"),
- ?line {error,{{2,3},erl_scan,{illegal,character}},{2,6}} =
+ {error,{{2,3},erl_scan,{illegal,character}},{2,6}} =
erl_scan:string("\"ab \n $\\x{g}\"",{1,1}),
- ?line {error,{{2,3},erl_scan,{illegal,character}},{2,6}} =
+ {error,{{2,3},erl_scan,{illegal,character}},{2,6}} =
erl_scan:string("\'ab \n $\\x{g}\'",{1,1}),
- ?line test("$\\{34}"),
- ?line test("$\\x{34}"),
- ?line test("$\\{377}"),
- ?line test("$\\x{FF}"),
- ?line test("$\\{400}"),
- ?line test("$\\x{100}"),
- ?line test("$\\x{10FFFF}"),
- ?line test("$\\x{10ffff}"),
- ?line test("\"$\n \\{1}\""),
- ?line {error,{1,erl_scan,{illegal,character}},1} =
+ test("$\\{34}"),
+ test("$\\x{34}"),
+ test("$\\{377}"),
+ test("$\\x{FF}"),
+ test("$\\{400}"),
+ test("$\\x{100}"),
+ test("$\\x{10FFFF}"),
+ test("$\\x{10ffff}"),
+ test("\"$\n \\{1}\""),
+ {error,{1,erl_scan,{illegal,character}},1} =
erl_scan:string("$\\x{110000}"),
- ?line {error,{{1,1},erl_scan,{illegal,character}},{1,12}} =
+ {error,{{1,1},erl_scan,{illegal,character}},{1,12}} =
erl_scan:string("$\\x{110000}", {1,1}),
- ?line {error,{{1,1},erl_scan,{illegal,character}},{1,4}} =
+ {error,{{1,1},erl_scan,{illegal,character}},{1,4}} =
erl_scan:string("$\\xfg", {1,1}),
- ?line test("$\\xffg"),
+ test("$\\xffg"),
- ?line {error,{{1,1},erl_scan,{illegal,character}},{1,4}} =
+ {error,{{1,1},erl_scan,{illegal,character}},{1,4}} =
erl_scan:string("$\\xg", {1,1}),
ok.
-otp_10302(doc) ->
- "OTP-10302. Unicode characters scanner/parser.";
-otp_10302(suite) ->
- [];
+%% OTP-10302. Unicode characters scanner/parser.
otp_10302(Config) when is_list(Config) ->
%% From unicode():
{error,{1,erl_scan,{illegal,atom}},1} =
@@ -1088,18 +1071,12 @@ otp_10302(Config) when is_list(Config) ->
erl_parse_abstract("a"++[1024]++"c", [{encoding,latin1}]),
ok.
-otp_10990(doc) ->
- "OTP-10990. Floating point number in input string.";
-otp_10990(suite) ->
- [];
+%% OTP-10990. Floating point number in input string.
otp_10990(Config) when is_list(Config) ->
{'EXIT',_} = (catch {foo, erl_scan:string([$",42.0,$"],1)}),
ok.
-otp_10992(doc) ->
- "OTP-10992. List of floats to abstract format.";
-otp_10992(suite) ->
- [];
+%% OTP-10992. List of floats to abstract format.
otp_10992(Config) when is_list(Config) ->
{cons,0,{float,0,42.0},{nil,0}} =
erl_parse_abstract([42.0], [{encoding,unicode}]),
@@ -1111,10 +1088,7 @@ otp_10992(Config) when is_list(Config) ->
erl_parse_abstract([$A,42.0], [{encoding,utf8}]),
ok.
-otp_11807(doc) ->
- "OTP-11807. Generalize erl_parse:abstract/2.";
-otp_11807(suite) ->
- [];
+%% OTP-11807. Generalize erl_parse:abstract/2.
otp_11807(Config) when is_list(Config) ->
{cons,0,{integer,0,97},{cons,0,{integer,0,98},{nil,0}}} =
erl_parse_abstract("ab", [{encoding,none}]),
diff --git a/lib/stdlib/test/error_logger_h_SUITE.erl b/lib/stdlib/test/error_logger_h_SUITE.erl
index b2f1618ff5..30811f3fb4 100644
--- a/lib/stdlib/test/error_logger_h_SUITE.erl
+++ b/lib/stdlib/test/error_logger_h_SUITE.erl
@@ -48,7 +48,7 @@ end_per_group(_GroupName, Config) ->
Config.
logfile(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
LogDir = filename:join(PrivDir, ?MODULE),
Log = filename:join(LogDir, "logfile.log"),
ok = filelib:ensure_dir(Log),
@@ -77,7 +77,7 @@ logfile(Config) ->
ok.
logfile_truncated(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
LogDir = filename:join(PrivDir, ?MODULE),
Log = filename:join(LogDir, "logfile_truncated.log"),
ok = filelib:ensure_dir(Log),
@@ -102,7 +102,7 @@ do_one_logfile(Log, Ev, Depth) ->
analyse_events(Log, Ev, [], Depth).
tty(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
LogDir = filename:join(PrivDir, ?MODULE),
Log = filename:join(LogDir, "tty.log"),
ok = filelib:ensure_dir(Log),
@@ -125,7 +125,7 @@ tty(Config) ->
ok.
tty_truncated(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
LogDir = filename:join(PrivDir, ?MODULE),
Log = filename:join(LogDir, "tty_truncated.log"),
ok = filelib:ensure_dir(Log),
@@ -335,7 +335,7 @@ start_node(Name, Args) ->
{ok,Node} ->
{ok,Node};
Error ->
- test_server:fail(Error)
+ ct:fail(Error)
end.
cleanup(File) ->
diff --git a/lib/stdlib/test/escript_SUITE.erl b/lib/stdlib/test/escript_SUITE.erl
index a8d646c044..30aaac70c2 100644
--- a/lib/stdlib/test/escript_SUITE.erl
+++ b/lib/stdlib/test/escript_SUITE.erl
@@ -19,7 +19,7 @@
-module(escript_SUITE).
-export([
- all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
+ all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
init_per_testcase/2,
end_per_testcase/2,
@@ -43,7 +43,9 @@
-include_lib("common_test/include/ct.hrl").
-include_lib("kernel/include/file.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,5}}].
all() ->
[basic, errors, strange_name, emulator_flags,
@@ -68,103 +70,100 @@ end_per_group(_GroupName, Config) ->
Config.
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?t:minutes(5)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
basic(Config) when is_list(Config) ->
- Data = ?config(data_dir, Config),
+ Data = proplists:get_value(data_dir, Config),
Dir = filename:absname(Data), %Get rid of trailing slash.
- ?line run(Dir, "factorial 5",
- <<"factorial 5 = 120\nExitCode:0">>),
- ?line run(Dir, "factorial_compile 10",
- <<"factorial 10 = 3628800\nExitCode:0">>),
- ?line run(Dir, "factorial_compile_main 7",
- <<"factorial 7 = 5040\nExitCode:0">>),
- ?line run(Dir, "factorial_warning 20",
- [data_dir,<<"factorial_warning:12: Warning: function bar/0 is unused\n"
- "factorial 20 = 2432902008176640000\nExitCode:0">>]),
- ?line run_with_opts(Dir, "-s", "factorial_warning",
- [data_dir,<<"factorial_warning:12: Warning: function bar/0 is unused\nExitCode:0">>]),
- ?line run_with_opts(Dir, "-s -i", "factorial_warning",
- [data_dir,<<"factorial_warning:12: Warning: function bar/0 is unused\nExitCode:0">>]),
- ?line run_with_opts(Dir, "-c -s", "factorial_warning",
- [data_dir,<<"factorial_warning:12: Warning: function bar/0 is unused\nExitCode:0">>]),
- ?line run(Dir, "filesize "++filename:join(?config(data_dir, Config),"filesize"),
- [data_dir,<<"filesize:11: Warning: function id/1 is unused\n324\nExitCode:0">>]),
- ?line run(Dir, "test_script_name",
- [data_dir,<<"test_script_name\nExitCode:0">>]),
- ?line run(Dir, "tail_rec 1000",
- [<<"ok\nExitCode:0">>]),
+ run(Dir, "factorial 5",
+ <<"factorial 5 = 120\nExitCode:0">>),
+ run(Dir, "factorial_compile 10",
+ <<"factorial 10 = 3628800\nExitCode:0">>),
+ run(Dir, "factorial_compile_main 7",
+ <<"factorial 7 = 5040\nExitCode:0">>),
+ run(Dir, "factorial_warning 20",
+ [data_dir,<<"factorial_warning:12: Warning: function bar/0 is unused\n"
+ "factorial 20 = 2432902008176640000\nExitCode:0">>]),
+ run_with_opts(Dir, "-s", "factorial_warning",
+ [data_dir,<<"factorial_warning:12: Warning: function bar/0 is unused\nExitCode:0">>]),
+ run_with_opts(Dir, "-s -i", "factorial_warning",
+ [data_dir,<<"factorial_warning:12: Warning: function bar/0 is unused\nExitCode:0">>]),
+ run_with_opts(Dir, "-c -s", "factorial_warning",
+ [data_dir,<<"factorial_warning:12: Warning: function bar/0 is unused\nExitCode:0">>]),
+ run(Dir, "filesize "++filename:join(proplists:get_value(data_dir, Config),"filesize"),
+ [data_dir,<<"filesize:11: Warning: function id/1 is unused\n324\nExitCode:0">>]),
+ run(Dir, "test_script_name",
+ [data_dir,<<"test_script_name\nExitCode:0">>]),
+ run(Dir, "tail_rec 1000",
+ [<<"ok\nExitCode:0">>]),
%% We expect the trap_exit flag for the process to be false,
%% since that is the default state for newly spawned processes.
- ?line run(Dir, "trap_exit",
- <<"false\nExitCode:0">>),
+ run(Dir, "trap_exit",
+ <<"false\nExitCode:0">>),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
errors(Config) when is_list(Config) ->
- Data = ?config(data_dir, Config),
+ Data = proplists:get_value(data_dir, Config),
Dir = filename:absname(Data), %Get rid of trailing slash.
- ?line run(Dir, "compile_error",
- [data_dir,<<"compile_error:5: syntax error before: '*'\n">>,
- data_dir,<<"compile_error:8: syntax error before: blarf\n">>,
- <<"escript: There were compilation errors.\nExitCode:127">>]),
- ?line run(Dir, "lint_error",
- [data_dir,<<"lint_error:6: function main/1 already defined\n">>,
- data_dir,"lint_error:8: variable 'ExitCode' is unbound\n",
- <<"escript: There were compilation errors.\nExitCode:127">>]),
- ?line run_with_opts(Dir, "-s", "lint_error",
- [data_dir,<<"lint_error:6: function main/1 already defined\n">>,
- data_dir,"lint_error:8: variable 'ExitCode' is unbound\n",
- <<"escript: There were compilation errors.\nExitCode:127">>]),
+ run(Dir, "compile_error",
+ [data_dir,<<"compile_error:5: syntax error before: '*'\n">>,
+ data_dir,<<"compile_error:8: syntax error before: blarf\n">>,
+ <<"escript: There were compilation errors.\nExitCode:127">>]),
+ run(Dir, "lint_error",
+ [data_dir,<<"lint_error:6: function main/1 already defined\n">>,
+ data_dir,"lint_error:8: variable 'ExitCode' is unbound\n",
+ <<"escript: There were compilation errors.\nExitCode:127">>]),
+ run_with_opts(Dir, "-s", "lint_error",
+ [data_dir,<<"lint_error:6: function main/1 already defined\n">>,
+ data_dir,"lint_error:8: variable 'ExitCode' is unbound\n",
+ <<"escript: There were compilation errors.\nExitCode:127">>]),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strange_name(Config) when is_list(Config) ->
- Data = ?config(data_dir, Config),
+ Data = proplists:get_value(data_dir, Config),
Dir = filename:absname(Data), %Get rid of trailing slash.
- ?line run(Dir, "strange.name -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "ExitCode:0">>]),
+ run(Dir, "strange.name -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "ExitCode:0">>]),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
emulator_flags(Config) when is_list(Config) ->
- Data = ?config(data_dir, Config),
+ Data = proplists:get_value(data_dir, Config),
Dir = filename:absname(Data), %Get rid of trailing slash.
- ?line run(Dir, "emulator_flags -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "nostick:[{nostick,[]}]\n"
- "mnesia:[{mnesia,[\"dir\",\"a/directory\"]},{mnesia,[\"debug\",\"verbose\"]}]\n"
- "ERL_FLAGS=false\n"
- "unknown:[]\n"
- "ExitCode:0">>]),
+ run(Dir, "emulator_flags -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "nostick:[{nostick,[]}]\n"
+ "mnesia:[{mnesia,[\"dir\",\"a/directory\"]},{mnesia,[\"debug\",\"verbose\"]}]\n"
+ "ERL_FLAGS=false\n"
+ "unknown:[]\n"
+ "ExitCode:0">>]),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
emulator_flags_no_shebang(Config) when is_list(Config) ->
- Data = ?config(data_dir, Config),
+ Data = proplists:get_value(data_dir, Config),
Dir = filename:absname(Data), %Get rid of trailing slash.
%% Need run_with_opts, to always use "escript" explicitly
- ?line run_with_opts(Dir, "", "emulator_flags_no_shebang -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "nostick:[{nostick,[]}]\n"
- "mnesia:[{mnesia,[\"dir\",\"a/directory\"]},{mnesia,[\"debug\",\"verbose\"]}]\n"
- "ERL_FLAGS=false\n"
- "unknown:[]\n"
- "ExitCode:0">>]),
+ run_with_opts(Dir, "", "emulator_flags_no_shebang -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "nostick:[{nostick,[]}]\n"
+ "mnesia:[{mnesia,[\"dir\",\"a/directory\"]},{mnesia,[\"debug\",\"verbose\"]}]\n"
+ "ERL_FLAGS=false\n"
+ "unknown:[]\n"
+ "ExitCode:0">>]),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -173,14 +172,14 @@ emulator_flags_no_shebang(Config) when is_list(Config) ->
module_script(Config) when is_list(Config) ->
%% Read orig file
- Data = ?config(data_dir, Config),
+ Data = proplists:get_value(data_dir, Config),
OrigFile = filename:join([Data,"emulator_flags"]),
{ok, OrigBin} = file:read_file(OrigFile),
- ?line [Shebang, Mode, Flags | Source] = string:tokens(binary_to_list(OrigBin), "\n"),
- ?line {ok, OrigFI} = file:read_file_info(OrigFile),
+ [Shebang, Mode, Flags | Source] = string:tokens(binary_to_list(OrigBin), "\n"),
+ {ok, OrigFI} = file:read_file_info(OrigFile),
%% Write source file
- Priv = ?config(priv_dir, Config),
+ Priv = proplists:get_value(priv_dir, Config),
Dir = filename:absname(Priv), % Get rid of trailing slash.
Base = "module_script",
ErlFile = filename:join([Priv, Base ++ ".erl"]),
@@ -188,85 +187,85 @@ module_script(Config) when is_list(Config) ->
"-export([main/1]).\n\n",
string:join(Source, "\n"),
"\n"],
- ?line ok = file:write_file(ErlFile, ErlCode),
+ ok = file:write_file(ErlFile, ErlCode),
- %%%%%%%
+%%%%%%%
%% Create and run scripts without emulator flags
%% With shebang
NoArgsBase = Base ++ "_no_args_with_shebang",
NoArgsFile = filename:join([Priv, NoArgsBase]),
- ?line ok = file:write_file(NoArgsFile,
- [Shebang, "\n",
- ErlCode]),
- ?line ok = file:write_file_info(NoArgsFile, OrigFI),
-
- ?line run(Dir, NoArgsBase ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "nostick:[]\n"
- "mnesia:[]\n"
- "ERL_FLAGS=false\n"
- "unknown:[]\n"
- "ExitCode:0">>]),
-
- ?line run_with_opts(Dir, "", NoArgsBase ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "nostick:[]\n"
- "mnesia:[]\n"
- "ERL_FLAGS=false\n"
- "unknown:[]\n"
- "ExitCode:0">>]),
+ ok = file:write_file(NoArgsFile,
+ [Shebang, "\n",
+ ErlCode]),
+ ok = file:write_file_info(NoArgsFile, OrigFI),
+
+ run(Dir, NoArgsBase ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "nostick:[]\n"
+ "mnesia:[]\n"
+ "ERL_FLAGS=false\n"
+ "unknown:[]\n"
+ "ExitCode:0">>]),
+
+ run_with_opts(Dir, "", NoArgsBase ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "nostick:[]\n"
+ "mnesia:[]\n"
+ "ERL_FLAGS=false\n"
+ "unknown:[]\n"
+ "ExitCode:0">>]),
%% Without shebang
NoArgsBase2 = Base ++ "_no_args_without_shebang",
NoArgsFile2 = filename:join([Priv, NoArgsBase2]),
- ?line ok = file:write_file(NoArgsFile2,
- ["Something else than shebang!!!", "\n",
- ErlCode]),
- ?line ok = file:write_file_info(NoArgsFile2, OrigFI),
-
- ?line run_with_opts(Dir, "", NoArgsBase2 ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "nostick:[]\n"
- "mnesia:[]\n"
- "ERL_FLAGS=false\n"
- "unknown:[]\n"
- "ExitCode:0">>]),
+ ok = file:write_file(NoArgsFile2,
+ ["Something else than shebang!!!", "\n",
+ ErlCode]),
+ ok = file:write_file_info(NoArgsFile2, OrigFI),
+
+ run_with_opts(Dir, "", NoArgsBase2 ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "nostick:[]\n"
+ "mnesia:[]\n"
+ "ERL_FLAGS=false\n"
+ "unknown:[]\n"
+ "ExitCode:0">>]),
%% Plain module without header
NoArgsBase3 = Base ++ "_no_args_without_header",
NoArgsFile3 = filename:join([Priv, NoArgsBase3]),
- ?line ok = file:write_file(NoArgsFile3, [ErlCode]),
- ?line ok = file:write_file_info(NoArgsFile3, OrigFI),
-
- ?line run_with_opts(Dir, "", NoArgsBase3 ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "nostick:[]\n"
- "mnesia:[]\n"
- "ERL_FLAGS=false\n"
- "unknown:[]\n"
- "ExitCode:0">>]),
-
- %%%%%%%
+ ok = file:write_file(NoArgsFile3, [ErlCode]),
+ ok = file:write_file_info(NoArgsFile3, OrigFI),
+
+ run_with_opts(Dir, "", NoArgsBase3 ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "nostick:[]\n"
+ "mnesia:[]\n"
+ "ERL_FLAGS=false\n"
+ "unknown:[]\n"
+ "ExitCode:0">>]),
+
+%%%%%%%
%% Create and run scripts with emulator flags
%% With shebang
ArgsBase = Base ++ "_args_with_shebang",
ArgsFile = filename:join([Priv, ArgsBase]),
- ?line ok = file:write_file(ArgsFile,
- [Shebang, "\n",
- Mode, "\n",
- Flags, "\n",
- ErlCode]),
- ?line ok = file:write_file_info(ArgsFile, OrigFI),
-
- ?line run(Dir, ArgsBase ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "nostick:[{nostick,[]}]\n"
- "mnesia:[{mnesia,[\"dir\",\"a/directory\"]},{mnesia,[\"debug\",\"verbose\"]}]\n"
- "ERL_FLAGS=false\n"
- "unknown:[]\n"
- "ExitCode:0">>]),
+ ok = file:write_file(ArgsFile,
+ [Shebang, "\n",
+ Mode, "\n",
+ Flags, "\n",
+ ErlCode]),
+ ok = file:write_file_info(ArgsFile, OrigFI),
+
+ run(Dir, ArgsBase ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "nostick:[{nostick,[]}]\n"
+ "mnesia:[{mnesia,[\"dir\",\"a/directory\"]},{mnesia,[\"debug\",\"verbose\"]}]\n"
+ "ERL_FLAGS=false\n"
+ "unknown:[]\n"
+ "ExitCode:0">>]),
ok.
@@ -275,103 +274,103 @@ module_script(Config) when is_list(Config) ->
%% Generate a new escript containing the beam code and the escript header
beam_script(Config) when is_list(Config) ->
%% Read orig file
- Data = ?config(data_dir, Config),
+ Data = proplists:get_value(data_dir, Config),
OrigFile = filename:join([Data,"emulator_flags"]),
{ok, OrigBin} = file:read_file(OrigFile),
- ?line [Shebang, Mode, Flags | Source] = string:tokens(binary_to_list(OrigBin), "\n"),
- ?line {ok, OrigFI} = file:read_file_info(OrigFile),
+ [Shebang, Mode, Flags | Source] = string:tokens(binary_to_list(OrigBin), "\n"),
+ {ok, OrigFI} = file:read_file_info(OrigFile),
%% Write source file
- Priv = ?config(priv_dir, Config),
+ Priv = proplists:get_value(priv_dir, Config),
Dir = filename:absname(Priv), % Get rid of trailing slash.
Base = "beam_script",
ErlFile = filename:join([Priv, Base ++ ".erl"]),
- ?line ok = file:write_file(ErlFile,
- ["\n-module(", Base, ").\n",
- "-export([main/1]).\n\n",
- string:join(Source, "\n"),
- "\n"]),
+ ok = file:write_file(ErlFile,
+ ["\n-module(", Base, ").\n",
+ "-export([main/1]).\n\n",
+ string:join(Source, "\n"),
+ "\n"]),
%% Compile the code
- ?line {ok, _Mod, BeamCode} = compile:file(ErlFile, [binary]),
+ {ok, _Mod, BeamCode} = compile:file(ErlFile, [binary]),
- %%%%%%%
+%%%%%%%
%% Create and run scripts without emulator flags
%% With shebang
NoArgsBase = Base ++ "_no_args_with_shebang",
NoArgsFile = filename:join([Priv, NoArgsBase]),
- ?line ok = file:write_file(NoArgsFile,
- [Shebang, "\n",
- BeamCode]),
- ?line ok = file:write_file_info(NoArgsFile, OrigFI),
-
- ?line run(Dir, NoArgsBase ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "nostick:[]\n"
- "mnesia:[]\n"
- "ERL_FLAGS=false\n"
- "unknown:[]\n"
- "ExitCode:0">>]),
-
- ?line run_with_opts(Dir, "", NoArgsBase ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "nostick:[]\n"
- "mnesia:[]\n"
- "ERL_FLAGS=false\n"
- "unknown:[]\n"
- "ExitCode:0">>]),
+ ok = file:write_file(NoArgsFile,
+ [Shebang, "\n",
+ BeamCode]),
+ ok = file:write_file_info(NoArgsFile, OrigFI),
+
+ run(Dir, NoArgsBase ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "nostick:[]\n"
+ "mnesia:[]\n"
+ "ERL_FLAGS=false\n"
+ "unknown:[]\n"
+ "ExitCode:0">>]),
+
+ run_with_opts(Dir, "", NoArgsBase ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "nostick:[]\n"
+ "mnesia:[]\n"
+ "ERL_FLAGS=false\n"
+ "unknown:[]\n"
+ "ExitCode:0">>]),
%% Without shebang
NoArgsBase2 = Base ++ "_no_args_without_shebang",
NoArgsFile2 = filename:join([Priv, NoArgsBase2]),
- ?line ok = file:write_file(NoArgsFile2,
- ["Something else than shebang!!!", "\n",
- BeamCode]),
- ?line ok = file:write_file_info(NoArgsFile2, OrigFI),
-
- ?line run_with_opts(Dir, "", NoArgsBase2 ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "nostick:[]\n"
- "mnesia:[]\n"
- "ERL_FLAGS=false\n"
- "unknown:[]\n"
- "ExitCode:0">>]),
+ ok = file:write_file(NoArgsFile2,
+ ["Something else than shebang!!!", "\n",
+ BeamCode]),
+ ok = file:write_file_info(NoArgsFile2, OrigFI),
+
+ run_with_opts(Dir, "", NoArgsBase2 ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "nostick:[]\n"
+ "mnesia:[]\n"
+ "ERL_FLAGS=false\n"
+ "unknown:[]\n"
+ "ExitCode:0">>]),
%% Plain beam file without header
NoArgsBase3 = Base ++ "_no_args_without_header",
NoArgsFile3 = filename:join([Priv, NoArgsBase3]),
- ?line ok = file:write_file(NoArgsFile3, [BeamCode]),
- ?line ok = file:write_file_info(NoArgsFile3, OrigFI),
-
- ?line run_with_opts(Dir, "", NoArgsBase3 ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "nostick:[]\n"
- "mnesia:[]\n"
- "ERL_FLAGS=false\n"
- "unknown:[]\n"
- "ExitCode:0">>]),
-
- %%%%%%%
+ ok = file:write_file(NoArgsFile3, [BeamCode]),
+ ok = file:write_file_info(NoArgsFile3, OrigFI),
+
+ run_with_opts(Dir, "", NoArgsBase3 ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "nostick:[]\n"
+ "mnesia:[]\n"
+ "ERL_FLAGS=false\n"
+ "unknown:[]\n"
+ "ExitCode:0">>]),
+
+%%%%%%%
%% Create and run scripts with emulator flags
%% With shebang
ArgsBase = Base ++ "_args",
ArgsFile = filename:join([Priv, ArgsBase]),
- ?line ok = file:write_file(ArgsFile,
- [Shebang, "\n",
- Mode, "\n",
- Flags, "\n",
- BeamCode]),
- ?line ok = file:write_file_info(ArgsFile, OrigFI),
-
- ?line run(Dir, ArgsBase ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "nostick:[{nostick,[]}]\n"
- "mnesia:[{mnesia,[\"dir\",\"a/directory\"]},{mnesia,[\"debug\",\"verbose\"]}]\n"
- "ERL_FLAGS=false\n"
- "unknown:[]\n"
- "ExitCode:0">>]),
+ ok = file:write_file(ArgsFile,
+ [Shebang, "\n",
+ Mode, "\n",
+ Flags, "\n",
+ BeamCode]),
+ ok = file:write_file_info(ArgsFile, OrigFI),
+
+ run(Dir, ArgsBase ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "nostick:[{nostick,[]}]\n"
+ "mnesia:[{mnesia,[\"dir\",\"a/directory\"]},{mnesia,[\"debug\",\"verbose\"]}]\n"
+ "ERL_FLAGS=false\n"
+ "unknown:[]\n"
+ "ExitCode:0">>]),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -381,107 +380,107 @@ beam_script(Config) when is_list(Config) ->
archive_script(Config) when is_list(Config) ->
%% Copy the orig files to priv_dir
- DataDir = ?config(data_dir, Config),
- PrivDir = ?config(priv_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
Archive = filename:join([PrivDir, "archive_script.zip"]),
- ?line {ok, _} = zip:create(Archive, ["archive_script"],
- [{compress, []}, {cwd, DataDir}]),
- ?line {ok, _} = zip:extract(Archive, [{cwd, PrivDir}]),
+ {ok, _} = zip:create(Archive, ["archive_script"],
+ [{compress, []}, {cwd, DataDir}]),
+ {ok, _} = zip:extract(Archive, [{cwd, PrivDir}]),
TopDir = filename:join([PrivDir, "archive_script"]),
%% Compile the code
- ?line ok = compile_app(TopDir, "archive_script_dict"),
- ?line ok = compile_app(TopDir, "archive_script_dummy"),
- ?line {ok, MainFiles} = file:list_dir(TopDir),
- ?line ok = compile_files(MainFiles, TopDir, TopDir),
+ ok = compile_app(TopDir, "archive_script_dict"),
+ ok = compile_app(TopDir, "archive_script_dummy"),
+ {ok, MainFiles} = file:list_dir(TopDir),
+ ok = compile_files(MainFiles, TopDir, TopDir),
%% Create the archive
{ok, TopFiles} = file:list_dir(TopDir),
- ?line {ok, {_, ArchiveBin}} = zip:create(Archive, TopFiles,
- [memory, {compress, []}, {cwd, TopDir}]),
+ {ok, {_, ArchiveBin}} = zip:create(Archive, TopFiles,
+ [memory, {compress, []}, {cwd, TopDir}]),
%% Read the source script
OrigFile = filename:join([DataDir, "emulator_flags"]),
{ok, OrigBin} = file:read_file(OrigFile),
- ?line [Shebang, Mode, _Flags | _Source] =
+ [Shebang, Mode, _Flags | _Source] =
string:tokens(binary_to_list(OrigBin), "\n"),
Flags = "%%! -archive_script_dict foo bar"
" -archive_script_dict foo"
" -archive_script_dummy bar",
- ?line {ok, OrigFI} = file:read_file_info(OrigFile),
+ {ok, OrigFI} = file:read_file_info(OrigFile),
- %%%%%%%
+%%%%%%%
%% Create and run scripts without emulator flags
MainBase = "archive_script_main",
MainScript = filename:join([PrivDir, MainBase]),
%% With shebang
- ?line ok = file:write_file(MainScript,
- [Shebang, "\n",
- Flags, "\n",
- ArchiveBin]),
- ?line ok = file:write_file_info(MainScript, OrigFI),
-
- ?line run(PrivDir, MainBase ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "dict:[{archive_script_dict,[\"foo\",\"bar\"]},{archive_script_dict,[\"foo\"]}]\n"
- "dummy:[{archive_script_dummy,[\"bar\"]}]\n"
- "priv:{ok,<<\"Some private data...\\n\">>}\n"
- "ExitCode:0">>]),
-
- ?line run_with_opts(PrivDir, "", MainBase ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "dict:[{archive_script_dict,[\"foo\",\"bar\"]},{archive_script_dict,[\"foo\"]}]\n"
- "dummy:[{archive_script_dummy,[\"bar\"]}]\n"
- "priv:{ok,<<\"Some private data...\\n\">>}\n"
- "ExitCode:0">>]),
-
- ?line ok = file:rename(MainScript, MainScript ++ "_with_shebang"),
+ ok = file:write_file(MainScript,
+ [Shebang, "\n",
+ Flags, "\n",
+ ArchiveBin]),
+ ok = file:write_file_info(MainScript, OrigFI),
+
+ run(PrivDir, MainBase ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "dict:[{archive_script_dict,[\"foo\",\"bar\"]},{archive_script_dict,[\"foo\"]}]\n"
+ "dummy:[{archive_script_dummy,[\"bar\"]}]\n"
+ "priv:{ok,<<\"Some private data...\\n\">>}\n"
+ "ExitCode:0">>]),
+
+ run_with_opts(PrivDir, "", MainBase ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "dict:[{archive_script_dict,[\"foo\",\"bar\"]},{archive_script_dict,[\"foo\"]}]\n"
+ "dummy:[{archive_script_dummy,[\"bar\"]}]\n"
+ "priv:{ok,<<\"Some private data...\\n\">>}\n"
+ "ExitCode:0">>]),
+
+ ok = file:rename(MainScript, MainScript ++ "_with_shebang"),
%% Without shebang (no flags)
- ?line ok = file:write_file(MainScript,
- ["Something else than shebang!!!", "\n",
- ArchiveBin]),
- ?line ok = file:write_file_info(MainScript, OrigFI),
-
- ?line run_with_opts(PrivDir, "", MainBase ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "dict:[]\n"
- "dummy:[]\n"
- "priv:{ok,<<\"Some private data...\\n\">>}\n"
- "ExitCode:0">>]),
- ?line ok = file:rename(MainScript, MainScript ++ "_without_shebang"),
+ ok = file:write_file(MainScript,
+ ["Something else than shebang!!!", "\n",
+ ArchiveBin]),
+ ok = file:write_file_info(MainScript, OrigFI),
+
+ run_with_opts(PrivDir, "", MainBase ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "dict:[]\n"
+ "dummy:[]\n"
+ "priv:{ok,<<\"Some private data...\\n\">>}\n"
+ "ExitCode:0">>]),
+ ok = file:rename(MainScript, MainScript ++ "_without_shebang"),
%% Plain archive without header (no flags)
- ?line ok = file:write_file(MainScript, [ArchiveBin]),
- ?line ok = file:write_file_info(MainScript, OrigFI),
+ ok = file:write_file(MainScript, [ArchiveBin]),
+ ok = file:write_file_info(MainScript, OrigFI),
- ?line run_with_opts(PrivDir, "", MainBase ++ " -arg1 arg2 arg3",
- [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "dict:[]\n"
- "dummy:[]\n"
- "priv:{ok,<<\"Some private data...\\n\">>}\n"
- "ExitCode:0">>]),
- ?line ok = file:rename(MainScript, MainScript ++ "_without_header"),
+ run_with_opts(PrivDir, "", MainBase ++ " -arg1 arg2 arg3",
+ [<<"main:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "dict:[]\n"
+ "dummy:[]\n"
+ "priv:{ok,<<\"Some private data...\\n\">>}\n"
+ "ExitCode:0">>]),
+ ok = file:rename(MainScript, MainScript ++ "_without_header"),
- %%%%%%%
+%%%%%%%
%% Create and run scripts with emulator flags
AltBase = "archive_script_alternate_main",
AltScript = filename:join([PrivDir, AltBase]),
- ?line ok = file:write_file(AltScript,
- [Shebang, "\n",
- Mode, "\n",
- Flags, " -escript main archive_script_main2\n",
- ArchiveBin]),
- ?line ok = file:write_file_info(AltScript, OrigFI),
-
- ?line run(PrivDir, AltBase ++ " -arg1 arg2 arg3",
- [<<"main2:[\"-arg1\",\"arg2\",\"arg3\"]\n"
- "dict:[{archive_script_dict,[\"foo\",\"bar\"]},{archive_script_dict,[\"foo\"]}]\n"
- "dummy:[{archive_script_dummy,[\"bar\"]}]\n"
- "priv:{ok,<<\"Some private data...\\n\">>}\n"
- "ExitCode:0">>]),
+ ok = file:write_file(AltScript,
+ [Shebang, "\n",
+ Mode, "\n",
+ Flags, " -escript main archive_script_main2\n",
+ ArchiveBin]),
+ ok = file:write_file_info(AltScript, OrigFI),
+
+ run(PrivDir, AltBase ++ " -arg1 arg2 arg3",
+ [<<"main2:[\"-arg1\",\"arg2\",\"arg3\"]\n"
+ "dict:[{archive_script_dict,[\"foo\",\"bar\"]},{archive_script_dict,[\"foo\"]}]\n"
+ "dummy:[{archive_script_dummy,[\"bar\"]}]\n"
+ "priv:{ok,<<\"Some private data...\\n\">>}\n"
+ "ExitCode:0">>]),
ok.
@@ -508,21 +507,21 @@ archive_script(Config) when is_list(Config) ->
%%
archive_script_file_access(Config) when is_list(Config) ->
%% Copy the orig files to priv_dir
- DataDir = ?config(data_dir, Config),
- PrivDir = ?config(priv_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
MainMod = "archive_script_file_access",
MainSrc = MainMod ++ ".erl",
MainBeam = MainMod ++ ".beam",
Archive = filename:join([PrivDir, "archive_script_file_access.zip"]),
- ?line {ok, _} = zip:create(Archive, ["archive_script_file_access"],
- [{compress, []}, {cwd, DataDir}]),
- ?line {ok, _} = zip:extract(Archive, [{cwd, PrivDir}]),
+ {ok, _} = zip:create(Archive, ["archive_script_file_access"],
+ [{compress, []}, {cwd, DataDir}]),
+ {ok, _} = zip:extract(Archive, [{cwd, PrivDir}]),
TopDir = filename:join([PrivDir, "archive_script_file_access"]),
%% Compile the code
- ?line ok = compile_files([MainSrc], TopDir, TopDir),
+ ok = compile_files([MainSrc], TopDir, TopDir),
%% First, create a file structure which will be included in the archive:
%%
@@ -630,7 +629,7 @@ compile_app(TopDir, AppName) ->
AppDir = filename:join([TopDir, AppName]),
SrcDir = filename:join([AppDir, "src"]),
OutDir = filename:join([AppDir, "ebin"]),
- ?line {ok, Files} = file:list_dir(SrcDir),
+ {ok, Files} = file:list_dir(SrcDir),
compile_files(Files, SrcDir, OutDir).
compile_files([File | Files], SrcDir, OutDir) ->
@@ -652,10 +651,10 @@ compile_files([], _, _) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
epp(Config) when is_list(Config) ->
- Data = ?config(data_dir, Config),
+ Data = proplists:get_value(data_dir, Config),
Dir = filename:absname(Data), %Get rid of trailing slash.
- ?line run(Dir, "factorial_epp 5",
- <<"factorial 5 = 120\nExitCode:0">>),
+ run(Dir, "factorial_epp 5",
+ <<"factorial 5 = 120\nExitCode:0">>),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -695,9 +694,9 @@ create_and_extract(Config) when is_list(Config) ->
%% Verify the compile_source option
file:delete(NewFile),
- ?line ok = escript:create(NewFile, [{source, Source}]),
- ?line {ok, [_, _, _, {source, Source}]} = escript:extract(NewFile, []),
- ?line {ok, [_, _, _, {source, BeamCode2}]} =
+ ok = escript:create(NewFile, [{source, Source}]),
+ {ok, [_, _, _, {source, Source}]} = escript:extract(NewFile, []),
+ {ok, [_, _, _, {source, BeamCode2}]} =
escript:extract(NewFile, [compile_source]),
verify_sections(NewFile, FileInfo,
[{shebang, default},
@@ -709,15 +708,15 @@ create_and_extract(Config) when is_list(Config) ->
prepare_creation(Base, Config) ->
%% Read the source
- PrivDir = ?config(priv_dir, Config),
- DataDir = ?config(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
OrigFile = filename:join([DataDir,"emulator_flags"]),
- ?line {ok, FileInfo} = file:read_file_info(OrigFile),
+ {ok, FileInfo} = file:read_file_info(OrigFile),
NewFile = filename:join([PrivDir, Base]),
- ?line {ok, [{shebang, default},
- {comment, _},
- {emu_args, EmuArg},
- {source, Source}]} =
+ {ok, [{shebang, default},
+ {comment, _},
+ {emu_args, EmuArg},
+ {source, Source}]} =
escript:extract(OrigFile, []),
%% Compile the code
@@ -725,14 +724,14 @@ prepare_creation(Base, Config) ->
ErlCode = list_to_binary(["\n-module(", Base, ").\n",
"-export([main/1]).\n\n",
Source, "\n\n"]),
- ?line ok = file:write_file(ErlFile, ErlCode),
+ ok = file:write_file(ErlFile, ErlCode),
%% Compile the code
- ?line {ok, _Mod, BeamCode} =
+ {ok, _Mod, BeamCode} =
compile:file(ErlFile, [binary, debug_info]),
%% Create an archive
- ?line {ok, {_, ArchiveBin}} =
+ {ok, {_, ArchiveBin}} =
zip:create("dummy_archive_name",
[{Base ++ ".erl", ErlCode},
{Base ++ ".beam", BeamCode}],
@@ -749,8 +748,8 @@ verify_sections(File, FileInfo, Sections) ->
%% Create
file:delete(File),
- ?line ok = escript:create(File, Sections),
- ?line ok = file:write_file_info(File, FileInfo),
+ ok = escript:create(File, Sections),
+ ok = file:write_file_info(File, FileInfo),
%% Run
Dir = filename:absname(filename:dirname(File)),
@@ -780,21 +779,21 @@ verify_sections(File, FileInfo, Sections) ->
Expected = <<ExpectedMain/binary, ExpectedOutput/binary>>,
case HasArg(shebang) of
true ->
- ?line run(Dir, InputArgs, [Expected]);
+ run(Dir, InputArgs, [Expected]);
false ->
- ?line run_with_opts(Dir, [], InputArgs, [Expected])
+ run_with_opts(Dir, [], InputArgs, [Expected])
end,
%% Verify
- ?line {ok, Bin} = escript:create(binary, Sections),
- ?line {ok, Read} = file:read_file(File),
- ?line Bin = Read, % Assert
+ {ok, Bin} = escript:create(binary, Sections),
+ {ok, Read} = file:read_file(File),
+ Bin = Read, % Assert
Normalized = normalize_sections(Sections),
- ?line {ok, Extracted} = escript:extract(File, []),
+ {ok, Extracted} = escript:extract(File, []),
io:format("Normalized; ~p\n", [Normalized]),
io:format("Extracted ; ~p\n", [Extracted]),
- ?line Normalized = Extracted, % Assert
+ Normalized = Extracted, % Assert
ok.
normalize_sections(Sections) ->
@@ -806,27 +805,27 @@ normalize_sections(Sections) ->
end
end,
case lists:map(AtomToTuple, [{K, V} || {K, V} <- Sections, V =/= undefined]) of
- [{shebang, Shebang} | Rest] ->
- [{shebang, Shebang} |
- case Rest of
- [{comment, Comment} | Rest2] ->
- [{comment, Comment} |
- case Rest2 of
- [{emu_args, EmuArgs}, Body] ->
- [{emu_args, EmuArgs}, Body];
- [Body] ->
- [{emu_args, undefined}, Body]
- end
- ];
- [{emu_args, EmuArgs}, Body] ->
- [{comment, undefined}, {emu_args, EmuArgs}, Body];
- [Body] ->
- [{comment, undefined}, {emu_args, undefined}, Body]
- end
- ];
- [Body] ->
- [{shebang, undefined}, {comment, undefined}, {emu_args, undefined}, Body]
- end.
+ [{shebang, Shebang} | Rest] ->
+ [{shebang, Shebang} |
+ case Rest of
+ [{comment, Comment} | Rest2] ->
+ [{comment, Comment} |
+ case Rest2 of
+ [{emu_args, EmuArgs}, Body] ->
+ [{emu_args, EmuArgs}, Body];
+ [Body] ->
+ [{emu_args, undefined}, Body]
+ end
+ ];
+ [{emu_args, EmuArgs}, Body] ->
+ [{comment, undefined}, {emu_args, EmuArgs}, Body];
+ [Body] ->
+ [{comment, undefined}, {emu_args, undefined}, Body]
+ end
+ ];
+ [Body] ->
+ [{shebang, undefined}, {comment, undefined}, {emu_args, undefined}, Body]
+ end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -846,36 +845,36 @@ foldl(Config) when is_list(Config) ->
%% Get line numbers and the file attribute right
SourceFile = NewFile ++ ".erl",
<<_:1/binary, ErlCode2/binary>> = ErlCode,
- ?line ok = file:write_file(SourceFile, ErlCode2),
- ?line {ok, _Mod, BeamCode} =
+ ok = file:write_file(SourceFile, ErlCode2),
+ {ok, _Mod, BeamCode} =
compile:file(SourceFile, [binary, debug_info]),
%% Verify source script
- ?line ok = escript:create(SourceFile, [{source, ErlCode}]),
- ?line {ok, [{".", _, BeamCode2}]}
+ ok = escript:create(SourceFile, [{source, ErlCode}]),
+ {ok, [{".", _, BeamCode2}]}
= escript_foldl(Collect, [], SourceFile),
- ?line {ok, Abstr} = beam_lib:chunks(BeamCode, [abstract_code]),
- ?line {ok, Abstr2} = beam_lib:chunks(BeamCode2, [abstract_code]),
+ {ok, Abstr} = beam_lib:chunks(BeamCode, [abstract_code]),
+ {ok, Abstr2} = beam_lib:chunks(BeamCode2, [abstract_code]),
%% io:format("abstr1=~p\n", [Abstr]),
%% io:format("abstr2=~p\n", [Abstr2]),
- ?line Abstr = Abstr2, % Assert
+ Abstr = Abstr2, % Assert
%% Verify beam script
- ?line ok = escript:create(NewFile, [{beam, BeamCode}]),
- ?line {ok, [{".", _, BeamCode}]}
+ ok = escript:create(NewFile, [{beam, BeamCode}]),
+ {ok, [{".", _, BeamCode}]}
= escript_foldl(Collect, [], NewFile),
%% Verify archive scripts
- ?line ok = escript:create(NewFile, [{archive, ArchiveBin}]),
- ?line {ok, [{BeamBase, #file_info{}, _},
- {ErlBase, #file_info{}, _}]}
+ ok = escript:create(NewFile, [{archive, ArchiveBin}]),
+ {ok, [{BeamBase, #file_info{}, _},
+ {ErlBase, #file_info{}, _}]}
= escript_foldl(Collect, [], NewFile),
ArchiveFiles = [{ErlBase, ErlCode}, {BeamBase, BeamCode}],
- ?line ok = escript:create(NewFile, [{archive, ArchiveFiles, []}]),
- ?line {ok, [{BeamBase, _, _},
- {ErlBase, _, _}]}
+ ok = escript:create(NewFile, [{archive, ArchiveFiles, []}]),
+ {ok, [{BeamBase, _, _},
+ {ErlBase, _, _}]}
= escript_foldl(Collect, [], NewFile),
ok.
@@ -909,7 +908,7 @@ emulate_escript_foldl(Fun, Acc, File) ->
end.
unicode(Config) when is_list(Config) ->
- Data = ?config(data_dir, Config),
+ Data = proplists:get_value(data_dir, Config),
Dir = filename:absname(Data), %Get rid of trailing slash.
run(Dir, "unicode1",
[<<"escript: exception error: an error occurred when evaluating"
@@ -928,12 +927,12 @@ unicode(Config) when is_list(Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
overflow(Config) when is_list(Config) ->
- Data = ?config(data_dir, Config),
+ Data = proplists:get_value(data_dir, Config),
Dir = filename:absname(Data), %Get rid of trailing slash.
- ?line run(Dir, "arg_overflow",
- [<<"ExitCode:0">>]),
- ?line run(Dir, "linebuf_overflow",
- [<<"ExitCode:0">>]),
+ run(Dir, "arg_overflow",
+ [<<"ExitCode:0">>]),
+ run(Dir, "linebuf_overflow",
+ [<<"ExitCode:0">>]),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -968,7 +967,7 @@ do_run(Dir, Cmd, Expected0) ->
Actual ->
io:format("Expected: ~p\n", [Expected]),
io:format("Actual: ~p\n", [Actual]),
- ?t:fail()
+ ct:fail(failed)
end
end.
diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl
index 6f9be9b179..678c225d25 100644
--- a/lib/stdlib/test/ets_SUITE.erl
+++ b/lib/stdlib/test/ets_SUITE.erl
@@ -34,7 +34,7 @@
-export([ match1/1, match2/1, match_object/1, match_object2/1]).
-export([ dups/1, misc1/1, safe_fixtable/1, info/1, tab2list/1]).
-export([ tab2file/1, tab2file2/1, tabfile_ext1/1,
- tabfile_ext2/1, tabfile_ext3/1, tabfile_ext4/1, badfile/1]).
+ tabfile_ext2/1, tabfile_ext3/1, tabfile_ext4/1, badfile/1]).
-export([ heavy_lookup/1, heavy_lookup_element/1, heavy_concurrent/1]).
-export([ lookup_element_mult/1]).
-export([]).
@@ -43,8 +43,6 @@
t_delete_all_objects/1, t_insert_list/1, t_test_ms/1,
t_select_delete/1,t_ets_dets/1]).
--export([do_lookup/2, do_lookup_element/3]).
-
-export([ordered/1, ordered_match/1, interface_equality/1,
fixtable_next/1, fixtable_insert/1, rename/1, rename_unnamed/1, evil_rename/1,
update_element/1, update_counter/1, evil_update_counter/1, partly_bound/1, match_heavy/1]).
@@ -85,7 +83,7 @@
%% Convenience for manual testing
-export([random_test/0]).
-% internal exports
+%% internal exports
-export([dont_make_worse_sub/0, make_better_sub1/0, make_better_sub2/0]).
-export([t_repair_continuation_do/1, t_bucket_disappears_do/1,
select_fail_do/1, whitebox_1/1, whitebox_2/1, t_delete_all_objects_do/1,
@@ -109,26 +107,25 @@
-include_lib("common_test/include/ct.hrl").
--define(m(A,B), ?line assert_eq(A,B)).
+-define(m(A,B), assert_eq(A,B)).
init_per_testcase(Case, Config) ->
rand:seed(exsplus),
io:format("*** SEED: ~p ***\n", [rand:export_seed()]),
start_spawn_logger(),
wait_for_test_procs(), %% Ensure previous case cleaned up
- Dog=test_server:timetrap(test_server:minutes(20)),
put('__ETS_TEST_CASE__', Case),
- [{watchdog, Dog}, {test_case, Case} | Config].
+ [{test_case, Case} | Config].
+
+end_per_testcase(_Func, _Config) ->
+ wait_for_test_procs(true).
-end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- wait_for_test_procs(true),
- test_server:timetrap_cancel(Dog).
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,20}}].
all() ->
[{group, new}, {group, insert}, {group, lookup},
@@ -158,7 +155,7 @@ all() ->
otp_9423,
ets_all,
take,
-
+
memory_check_summary]. % MUST BE LAST
groups() ->
@@ -199,10 +196,10 @@ end_per_suite(_Config) ->
ok.
init_per_group(_GroupName, Config) ->
- Config.
+ Config.
end_per_group(_GroupName, Config) ->
- Config.
+ Config.
%% Test that we did not have "too many" failed verify_etsmem()'s
%% in the test suite.
@@ -212,7 +209,7 @@ end_per_group(_GroupName, Config) ->
memory_check_summary(_Config) ->
case whereis(ets_test_spawn_logger) of
undefined ->
- ?t:fail("No spawn logger exist");
+ ct:fail("No spawn logger exist");
_ ->
ets_test_spawn_logger ! {self(), get_failed_memchecks},
receive {get_failed_memchecks, FailedMemchecks} -> ok end,
@@ -228,45 +225,39 @@ memory_check_summary(_Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-t_bucket_disappears(suite) ->
- [];
-t_bucket_disappears(doc) ->
- ["Test that a disappearing bucket during select of a non-fixed table works."];
+%% Test that a disappearing bucket during select of a non-fixed table works.
t_bucket_disappears(Config) when is_list(Config) ->
repeat_for_opts(t_bucket_disappears_do).
t_bucket_disappears_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line ets_new(abcd, [named_table, public, {keypos, 2} | Opts]),
- ?line ets:insert(abcd, {abcd,1,2}),
- ?line ets:insert(abcd, {abcd,2,2}),
- ?line ets:insert(abcd, {abcd,3,2}),
- ?line {_, Cont} = ets:select(abcd, [{{'_', '$1', '_'},
- [{'<', '$1', {const, 10}}],
- ['$1']}], 1),
- ?line ets:delete(abcd, 2),
- ?line ets:select(Cont),
- ?line true = ets:delete(abcd),
- ?line verify_etsmem(EtsMem).
-
-
-t_match_spec_run(suite) ->
- [];
-t_match_spec_run(doc) ->
- ["Check ets:match_spec_run/2."];
+ EtsMem = etsmem(),
+ ets_new(abcd, [named_table, public, {keypos, 2} | Opts]),
+ ets:insert(abcd, {abcd,1,2}),
+ ets:insert(abcd, {abcd,2,2}),
+ ets:insert(abcd, {abcd,3,2}),
+ {_, Cont} = ets:select(abcd, [{{'_', '$1', '_'},
+ [{'<', '$1', {const, 10}}],
+ ['$1']}], 1),
+ ets:delete(abcd, 2),
+ ets:select(Cont),
+ true = ets:delete(abcd),
+ verify_etsmem(EtsMem).
+
+
+%% Check ets:match_spec_run/2.
t_match_spec_run(Config) when is_list(Config) ->
init_externals(),
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
t_match_spec_run_test([{1},{2},{3}],
[{{'$1'},[{'>','$1',1}],['$1']}],
[2,3]),
- ?line Huge = [{X} || X <- lists:seq(1,2500)],
- ?line L = lists:seq(2476,2500),
+ Huge = [{X} || X <- lists:seq(1,2500)],
+ L = lists:seq(2476,2500),
t_match_spec_run_test(Huge, [{{'$1'},[{'>','$1',2475}],['$1']}], L),
- ?line L2 = [{X*16#FFFFFFF} || X <- L],
+ L2 = [{X*16#FFFFFFF} || X <- L],
t_match_spec_run_test(Huge,
[{{'$1'}, [{'>','$1',2475}], [{{{'*','$1',16#FFFFFFF}}}]}],
L2),
@@ -343,7 +334,7 @@ t_match_spec_run(Config) when is_list(Config) ->
end,
test_terms(Fun, skip_refc_check),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
t_match_spec_run_test(List, MS, Result) ->
@@ -371,14 +362,12 @@ t_match_spec_run_test(List, MS, Result) ->
erlang:trace(Tracee, true, [call]),
Tracee ! start,
TRes = ms_tracer_collect(Tracee, MonRef, []),
- %erlang:trace(Tracee, false, [call]),
- %Tracee ! stop,
case TRes of
SRes -> ok;
_ ->
io:format("TRACE MATCH FAILED\n"),
io:format("Input = ~p\nMST = ~p\nExpected = ~p\nGot = ~p\n", [List, MST, SRes, TRes]),
- ?t:fail("TRACE MATCH FAILED")
+ ct:fail("TRACE MATCH FAILED")
end,
ok.
@@ -387,32 +376,27 @@ t_match_spec_run_test(List, MS, Result) ->
ms_tracer_collect(Tracee, Ref, Acc) ->
receive
{trace, Tracee, call, _Args, [Msg]} ->
- %io:format("trace Args=~p Msg=~p\n", [_Args, Msg]),
ms_tracer_collect(Tracee, Ref, [Msg | Acc]);
{'DOWN', Ref, process, Tracee, _} ->
- %io:format("monitor DOWN for ~p\n", [Tracee]),
TDRef = erlang:trace_delivered(Tracee),
ms_tracer_collect(Tracee, TDRef, Acc);
{trace_delivered, Tracee, Ref} ->
- %%io:format("trace delivered for ~p\n", [Tracee]),
lists:sort(Acc);
Other ->
io:format("Unexpected message = ~p\n", [Other]),
- ?t:fail("Unexpected tracer msg")
+ ct:fail("Unexpected tracer msg")
end.
ms_tracee(Parent, CallArgList) ->
- %io:format("ms_tracee ~p started with ArgList = ~p\n", [self(), CallArgList]),
Parent ! {self(), ready},
receive start -> ok end,
lists:foreach(fun(Args) ->
erlang:apply(?MODULE, ms_tracee_dummy, tuple_to_list(Args))
end, CallArgList).
- %%receive stop -> ok end.
@@ -427,189 +411,181 @@ ms_clause_ets_to_trace({Head, Guard, Body}) ->
assert_eq(A,A) -> ok;
assert_eq(A,B) ->
io:format("FAILED MATCH:\n~p\n =/=\n~p\n",[A,B]),
- ?t:fail("assert_eq failed").
+ ct:fail("assert_eq failed").
-t_repair_continuation(suite) ->
- [];
-t_repair_continuation(doc) ->
- ["Check ets:repair_continuation/2."];
+%% Test ets:repair_continuation/2.
t_repair_continuation(Config) when is_list(Config) ->
repeat_for_opts(t_repair_continuation_do).
t_repair_continuation_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line MS = [{'_',[],[true]}],
- ?line MS2 = [{{{'$1','_'},'_'},[],['$1']}],
+ EtsMem = etsmem(),
+ MS = [{'_',[],[true]}],
+ MS2 = [{{{'$1','_'},'_'},[],['$1']}],
(fun() ->
- ?line T = ets_new(x,[ordered_set|Opts]),
- ?line F = fun(0,_)->ok;(N,F) -> ets:insert(T,{N,N}), F(N-1,F) end,
- ?line F(1000,F),
- ?line {_,C} = ets:select(T,MS,5),
- ?line C2 = erlang:setelement(5,C,<<>>),
- ?line {'EXIT',{badarg,_}} = (catch ets:select(C2)),
- ?line C3 = ets:repair_continuation(C2,MS),
- ?line {[true,true,true,true,true],_} = ets:select(C3),
- ?line {[true,true,true,true,true],_} = ets:select(C),
- ?line true = ets:delete(T)
+ T = ets_new(x,[ordered_set|Opts]),
+ F = fun(0,_)->ok;(N,F) -> ets:insert(T,{N,N}), F(N-1,F) end,
+ F(1000,F),
+ {_,C} = ets:select(T,MS,5),
+ C2 = erlang:setelement(5,C,<<>>),
+ {'EXIT',{badarg,_}} = (catch ets:select(C2)),
+ C3 = ets:repair_continuation(C2,MS),
+ {[true,true,true,true,true],_} = ets:select(C3),
+ {[true,true,true,true,true],_} = ets:select(C),
+ true = ets:delete(T)
end)(),
(fun() ->
- ?line T = ets_new(x,[ordered_set|Opts]),
- ?line F = fun(0,_)->ok;(N,F) -> ets:insert(T,{N,N}), F(N-1,F) end,
- ?line F(1000,F),
- ?line {_,C} = ets:select(T,MS,1001),
- ?line C = '$end_of_table',
- ?line C3 = ets:repair_continuation(C,MS),
- ?line '$end_of_table' = ets:select(C3),
- ?line '$end_of_table' = ets:select(C),
- ?line true = ets:delete(T)
+ T = ets_new(x,[ordered_set|Opts]),
+ F = fun(0,_)->ok;(N,F) -> ets:insert(T,{N,N}), F(N-1,F) end,
+ F(1000,F),
+ {_,C} = ets:select(T,MS,1001),
+ C = '$end_of_table',
+ C3 = ets:repair_continuation(C,MS),
+ '$end_of_table' = ets:select(C3),
+ '$end_of_table' = ets:select(C),
+ true = ets:delete(T)
end)(),
-
+
(fun() ->
- ?line T = ets_new(x,[ordered_set|Opts]),
- ?line F = fun(0,_)->ok;(N,F) ->
- ets:insert(T,{integer_to_list(N),N}),
- F(N-1,F)
- end,
- ?line F(1000,F),
- ?line {_,C} = ets:select(T,MS,5),
- ?line C2 = erlang:setelement(5,C,<<>>),
- ?line {'EXIT',{badarg,_}} = (catch ets:select(C2)),
- ?line C3 = ets:repair_continuation(C2,MS),
- ?line {[true,true,true,true,true],_} = ets:select(C3),
- ?line {[true,true,true,true,true],_} = ets:select(C),
- ?line true = ets:delete(T)
+ T = ets_new(x,[ordered_set|Opts]),
+ F = fun(0,_)->ok;(N,F) ->
+ ets:insert(T,{integer_to_list(N),N}),
+ F(N-1,F)
+ end,
+ F(1000,F),
+ {_,C} = ets:select(T,MS,5),
+ C2 = erlang:setelement(5,C,<<>>),
+ {'EXIT',{badarg,_}} = (catch ets:select(C2)),
+ C3 = ets:repair_continuation(C2,MS),
+ {[true,true,true,true,true],_} = ets:select(C3),
+ {[true,true,true,true,true],_} = ets:select(C),
+ true = ets:delete(T)
end)(),
(fun() ->
- ?line T = ets_new(x,[ordered_set|Opts]),
- ?line F = fun(0,_)->ok;(N,F) ->
- ets:insert(T,{{integer_to_list(N),N},N}),
- F(N-1,F)
- end,
- ?line F(1000,F),
- ?line {_,C} = ets:select(T,MS2,5),
- ?line C2 = erlang:setelement(5,C,<<>>),
- ?line {'EXIT',{badarg,_}} = (catch ets:select(C2)),
- ?line C3 = ets:repair_continuation(C2,MS2),
- ?line {[_,_,_,_,_],_} = ets:select(C3),
- ?line {[_,_,_,_,_],_} = ets:select(C),
- ?line true = ets:delete(T)
+ T = ets_new(x,[ordered_set|Opts]),
+ F = fun(0,_)->ok;(N,F) ->
+ ets:insert(T,{{integer_to_list(N),N},N}),
+ F(N-1,F)
+ end,
+ F(1000,F),
+ {_,C} = ets:select(T,MS2,5),
+ C2 = erlang:setelement(5,C,<<>>),
+ {'EXIT',{badarg,_}} = (catch ets:select(C2)),
+ C3 = ets:repair_continuation(C2,MS2),
+ {[_,_,_,_,_],_} = ets:select(C3),
+ {[_,_,_,_,_],_} = ets:select(C),
+ true = ets:delete(T)
end)(),
-
+
(fun() ->
- ?line T = ets_new(x,[set|Opts]),
- ?line F = fun(0,_)->ok;(N,F) ->
- ets:insert(T,{N,N}),
- F(N-1,F)
- end,
- ?line F(1000,F),
- ?line {_,C} = ets:select(T,MS,5),
- ?line C2 = erlang:setelement(4,C,<<>>),
- ?line {'EXIT',{badarg,_}} = (catch ets:select(C2)),
- ?line C3 = ets:repair_continuation(C2,MS),
- ?line {[true,true,true,true,true],_} = ets:select(C3),
- ?line {[true,true,true,true,true],_} = ets:select(C),
- ?line true = ets:delete(T)
+ T = ets_new(x,[set|Opts]),
+ F = fun(0,_)->ok;(N,F) ->
+ ets:insert(T,{N,N}),
+ F(N-1,F)
+ end,
+ F(1000,F),
+ {_,C} = ets:select(T,MS,5),
+ C2 = erlang:setelement(4,C,<<>>),
+ {'EXIT',{badarg,_}} = (catch ets:select(C2)),
+ C3 = ets:repair_continuation(C2,MS),
+ {[true,true,true,true,true],_} = ets:select(C3),
+ {[true,true,true,true,true],_} = ets:select(C),
+ true = ets:delete(T)
end)(),
(fun() ->
- ?line T = ets_new(x,[set|Opts]),
- ?line F = fun(0,_)->ok;(N,F) ->
- ets:insert(T,{integer_to_list(N),N}),
- F(N-1,F)
- end,
- ?line F(1000,F),
- ?line {_,C} = ets:select(T,MS,5),
- ?line C2 = erlang:setelement(4,C,<<>>),
- ?line {'EXIT',{badarg,_}} = (catch ets:select(C2)),
- ?line C3 = ets:repair_continuation(C2,MS),
- ?line {[true,true,true,true,true],_} = ets:select(C3),
- ?line {[true,true,true,true,true],_} = ets:select(C),
- ?line true = ets:delete(T)
+ T = ets_new(x,[set|Opts]),
+ F = fun(0,_)->ok;(N,F) ->
+ ets:insert(T,{integer_to_list(N),N}),
+ F(N-1,F)
+ end,
+ F(1000,F),
+ {_,C} = ets:select(T,MS,5),
+ C2 = erlang:setelement(4,C,<<>>),
+ {'EXIT',{badarg,_}} = (catch ets:select(C2)),
+ C3 = ets:repair_continuation(C2,MS),
+ {[true,true,true,true,true],_} = ets:select(C3),
+ {[true,true,true,true,true],_} = ets:select(C),
+ true = ets:delete(T)
end)(),
(fun() ->
- ?line T = ets_new(x,[bag|Opts]),
- ?line F = fun(0,_)->ok;(N,F) ->
- ets:insert(T,{integer_to_list(N),N}),
- F(N-1,F)
- end,
- ?line F(1000,F),
- ?line {_,C} = ets:select(T,MS,5),
- ?line C2 = erlang:setelement(4,C,<<>>),
- ?line {'EXIT',{badarg,_}} = (catch ets:select(C2)),
- ?line C3 = ets:repair_continuation(C2,MS),
- ?line {[true,true,true,true,true],_} = ets:select(C3),
- ?line {[true,true,true,true,true],_} = ets:select(C),
- ?line true = ets:delete(T)
+ T = ets_new(x,[bag|Opts]),
+ F = fun(0,_)->ok;(N,F) ->
+ ets:insert(T,{integer_to_list(N),N}),
+ F(N-1,F)
+ end,
+ F(1000,F),
+ {_,C} = ets:select(T,MS,5),
+ C2 = erlang:setelement(4,C,<<>>),
+ {'EXIT',{badarg,_}} = (catch ets:select(C2)),
+ C3 = ets:repair_continuation(C2,MS),
+ {[true,true,true,true,true],_} = ets:select(C3),
+ {[true,true,true,true,true],_} = ets:select(C),
+ true = ets:delete(T)
end)(),
(fun() ->
- ?line T = ets_new(x,[duplicate_bag|Opts]),
- ?line F = fun(0,_)->ok;(N,F) ->
- ets:insert(T,{integer_to_list(N),N}),
- F(N-1,F)
- end,
- ?line F(1000,F),
- ?line {_,C} = ets:select(T,MS,5),
- ?line C2 = erlang:setelement(4,C,<<>>),
- ?line {'EXIT',{badarg,_}} = (catch ets:select(C2)),
- ?line C3 = ets:repair_continuation(C2,MS),
- ?line {[true,true,true,true,true],_} = ets:select(C3),
- ?line {[true,true,true,true,true],_} = ets:select(C),
- ?line true = ets:delete(T)
+ T = ets_new(x,[duplicate_bag|Opts]),
+ F = fun(0,_)->ok;(N,F) ->
+ ets:insert(T,{integer_to_list(N),N}),
+ F(N-1,F)
+ end,
+ F(1000,F),
+ {_,C} = ets:select(T,MS,5),
+ C2 = erlang:setelement(4,C,<<>>),
+ {'EXIT',{badarg,_}} = (catch ets:select(C2)),
+ C3 = ets:repair_continuation(C2,MS),
+ {[true,true,true,true,true],_} = ets:select(C3),
+ {[true,true,true,true,true],_} = ets:select(C),
+ true = ets:delete(T)
end)(),
- ?line false = ets:is_compiled_ms(<<>>),
- ?line true = ets:is_compiled_ms(ets:match_spec_compile(MS)),
- ?line verify_etsmem(EtsMem).
+ false = ets:is_compiled_ms(<<>>),
+ true = ets:is_compiled_ms(ets:match_spec_compile(MS)),
+ verify_etsmem(EtsMem).
-default(doc) ->
- ["Check correct default vaules of a new ets table"];
-default(suite) -> [];
+%% Test correct default vaules of a new ets table.
default(Config) when is_list(Config) ->
%% Default should be set,protected
- ?line EtsMem = etsmem(),
- ?line Def = ets_new(def,[]),
- ?line set = ets:info(Def,type),
- ?line protected = ets:info(Def,protection),
+ EtsMem = etsmem(),
+ Def = ets_new(def,[]),
+ set = ets:info(Def,type),
+ protected = ets:info(Def,protection),
Compressed = erlang:system_info(ets_always_compress),
- ?line Compressed = ets:info(Def,compressed),
+ Compressed = ets:info(Def,compressed),
Self = self(),
- ?line Self = ets:info(Def,owner),
- ?line none = ets:info(Def, heir),
- ?line false = ets:info(Def,named_table),
- ?line ets:delete(Def),
- ?line verify_etsmem(EtsMem).
-
-select_fail(doc) ->
- ["Test that select fails even if nothing can match"];
-select_fail(suite) ->
- [];
+ Self = ets:info(Def,owner),
+ none = ets:info(Def, heir),
+ false = ets:info(Def,named_table),
+ ets:delete(Def),
+ verify_etsmem(EtsMem).
+
+%% Test that select fails even if nothing can match.
select_fail(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
repeat_for_opts(select_fail_do, [all_types,write_concurrency]),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
select_fail_do(Opts) ->
- ?line T = ets_new(x,Opts),
- ?line ets:insert(T,{a,a}),
- ?line case (catch
- ets:select(T,[{{a,'_'},[],[{snuffla}]}])) of
- {'EXIT',{badarg,_}} ->
- ok;
- Else0 ->
- exit({type,ets:info(T,type),
- expected,'EXIT',got,Else0})
- end,
- ?line case (catch
- ets:select(T,[{{b,'_'},[],[{snuffla}]}])) of
- {'EXIT',{badarg,_}} ->
- ok;
- Else1 ->
- exit({type,ets:info(T,type),
- expected,'EXIT',got,Else1})
- end,
- ?line ets:delete(T).
-
+ T = ets_new(x,Opts),
+ ets:insert(T,{a,a}),
+ case (catch
+ ets:select(T,[{{a,'_'},[],[{snuffla}]}])) of
+ {'EXIT',{badarg,_}} ->
+ ok;
+ Else0 ->
+ exit({type,ets:info(T,type),
+ expected,'EXIT',got,Else0})
+ end,
+ case (catch
+ ets:select(T,[{{b,'_'},[],[{snuffla}]}])) of
+ {'EXIT',{badarg,_}} ->
+ ok;
+ Else1 ->
+ exit({type,ets:info(T,type),
+ expected,'EXIT',got,Else1})
+ end,
+ ets:delete(T).
+
-define(S(T),ets:info(T,memory)).
-define(TAB_STRUCT_SZ, erts_debug:get_internal_state('DbTable_words')).
@@ -618,202 +594,180 @@ select_fail_do(Opts) ->
%% The hardcoded expected memory sizes (in words) are the ones we expect on:
%% SunOS5.8, 32-bit, non smp, private heap
%%
-memory(doc) -> ["Whitebox test of ets:info(X,memory)"];
-memory(suite) -> [];
+
+%% Whitebox test of ets:info(X, memory).
memory(Config) when is_list(Config) ->
- ?line ok = chk_normal_tab_struct_size(),
+ ok = chk_normal_tab_struct_size(),
repeat_for_opts(memory_do,[compressed]),
- ?line catch erts_debug:set_internal_state(available_internal_state, false).
+ catch erts_debug:set_internal_state(available_internal_state, false).
memory_do(Opts) ->
- ?line L = [T1,T2,T3,T4] = fill_sets_int(1000,Opts),
+ L = [T1,T2,T3,T4] = fill_sets_int(1000,Opts),
XR1 = case mem_mode(T1) of
- {normal,_} -> {13836,13046,13046,13052}; %{13862,13072,13072,13078};
- {compressed,4} -> {11041,10251,10251,10252}; %{11067,10277,10277,10278};
- {compressed,8} -> {10050,9260,9260,9260} %{10076,9286,9286,9286}
+ {normal,_} -> {13836,13046,13046,13052}; %{13862,13072,13072,13078};
+ {compressed,4} -> {11041,10251,10251,10252}; %{11067,10277,10277,10278};
+ {compressed,8} -> {10050,9260,9260,9260} %{10076,9286,9286,9286}
end,
- ?line XRes1 = adjust_xmem(L, XR1),
- ?line Res1 = {?S(T1),?S(T2),?S(T3),?S(T4)},
- ?line lists:foreach(fun(T) ->
- Before = ets:info(T,size),
- Key = 2, %894, %%ets:first(T),
- Objs = ets:lookup(T,Key),
- ?line ets:delete(T,Key),
- io:format("deleted key ~p from ~p changed size ~p to ~p: ~p\n",
- [Key, ets:info(T,type), Before, ets:info(T,size), Objs])
+ XRes1 = adjust_xmem(L, XR1),
+ Res1 = {?S(T1),?S(T2),?S(T3),?S(T4)},
+ lists:foreach(fun(T) ->
+ Before = ets:info(T,size),
+ Key = 2, %894, %%ets:first(T),
+ Objs = ets:lookup(T,Key),
+ ets:delete(T,Key),
+ io:format("deleted key ~p from ~p changed size ~p to ~p: ~p\n",
+ [Key, ets:info(T,type), Before, ets:info(T,size), Objs])
end,
L),
XR2 = case mem_mode(T1) of
- {normal,_} -> {13826,13037,13028,13034}; %{13852,13063,13054,13060};
- {compressed,4} -> {11031,10242,10233,10234}; %{11057,10268,10259,10260};
- {compressed,8} -> {10040,9251,9242,9242} %10066,9277,9268,9268}
+ {normal,_} -> {13826,13037,13028,13034}; %{13852,13063,13054,13060};
+ {compressed,4} -> {11031,10242,10233,10234}; %{11057,10268,10259,10260};
+ {compressed,8} -> {10040,9251,9242,9242} %10066,9277,9268,9268}
end,
- ?line XRes2 = adjust_xmem(L, XR2),
- ?line Res2 = {?S(T1),?S(T2),?S(T3),?S(T4)},
- ?line lists:foreach(fun(T) ->
- Before = ets:info(T,size),
- Key = 4, %802, %ets:first(T),
- Objs = ets:lookup(T,Key),
- ?line ets:match_delete(T,{Key,'_'}),
- io:format("match_deleted key ~p from ~p changed size ~p to ~p: ~p\n",
- [Key, ets:info(T,type), Before, ets:info(T,size), Objs])
- end,
- L),
+ XRes2 = adjust_xmem(L, XR2),
+ Res2 = {?S(T1),?S(T2),?S(T3),?S(T4)},
+ lists:foreach(fun(T) ->
+ Before = ets:info(T,size),
+ Key = 4, %802, %ets:first(T),
+ Objs = ets:lookup(T,Key),
+ ets:match_delete(T,{Key,'_'}),
+ io:format("match_deleted key ~p from ~p changed size ~p to ~p: ~p\n",
+ [Key, ets:info(T,type), Before, ets:info(T,size), Objs])
+ end,
+ L),
XR3 = case mem_mode(T1) of
- {normal,_} -> {13816,13028,13010,13016}; %{13842,13054,13036,13042};
- {compressed,4} -> {11021,10233,10215,10216}; %{11047,10259,10241,10242};
- {compressed,8} -> {10030,9242,9224,9224} %{10056,9268,9250,9250}
+ {normal,_} -> {13816,13028,13010,13016}; %{13842,13054,13036,13042};
+ {compressed,4} -> {11021,10233,10215,10216}; %{11047,10259,10241,10242};
+ {compressed,8} -> {10030,9242,9224,9224} %{10056,9268,9250,9250}
end,
- ?line XRes3 = adjust_xmem(L, XR3),
- ?line Res3 = {?S(T1),?S(T2),?S(T3),?S(T4)},
- ?line lists:foreach(fun(T) ->
- ?line ets:delete_all_objects(T)
+ XRes3 = adjust_xmem(L, XR3),
+ Res3 = {?S(T1),?S(T2),?S(T3),?S(T4)},
+ lists:foreach(fun(T) ->
+ ets:delete_all_objects(T)
end,
L),
- ?line XRes4 = adjust_xmem(L, {50,260,260,260}), %{76,286,286,286}),
- ?line Res4 = {?S(T1),?S(T2),?S(T3),?S(T4)},
+ XRes4 = adjust_xmem(L, {50,260,260,260}), %{76,286,286,286}),
+ Res4 = {?S(T1),?S(T2),?S(T3),?S(T4)},
lists:foreach(fun(T) ->
- ?line ets:delete(T)
+ ets:delete(T)
end,
L),
- ?line L2 = [T11,T12,T13,T14] = fill_sets_int(1000),
- ?line lists:foreach(fun(T) ->
- ?line ets:select_delete(T,[{'_',[],[true]}])
+ L2 = [T11,T12,T13,T14] = fill_sets_int(1000),
+ lists:foreach(fun(T) ->
+ ets:select_delete(T,[{'_',[],[true]}])
end,
L2),
- ?line XRes5 = adjust_xmem(L2, {50,260,260,260}), %{76,286,286,286}),
- ?line Res5 = {?S(T11),?S(T12),?S(T13),?S(T14)},
- ?line io:format("XRes1 = ~p~n"
- " Res1 = ~p~n~n"
- "XRes2 = ~p~n"
- " Res2 = ~p~n~n"
- "XRes3 = ~p~n"
- " Res3 = ~p~n~n"
- "XRes4 = ~p~n"
- " Res4 = ~p~n~n"
- "XRes5 = ~p~n"
- " Res5 = ~p~n~n",
- [XRes1, Res1,
- XRes2, Res2,
- XRes3, Res3,
- XRes4, Res4,
- XRes5, Res5]),
- ?line XRes1 = Res1,
- ?line XRes2 = Res2,
- ?line XRes3 = Res3,
- ?line XRes4 = Res4,
- ?line XRes5 = Res5,
- ?line ok.
+ XRes5 = adjust_xmem(L2, {50,260,260,260}), %{76,286,286,286}),
+ Res5 = {?S(T11),?S(T12),?S(T13),?S(T14)},
+ io:format("XRes1 = ~p~n"
+ " Res1 = ~p~n~n"
+ "XRes2 = ~p~n"
+ " Res2 = ~p~n~n"
+ "XRes3 = ~p~n"
+ " Res3 = ~p~n~n"
+ "XRes4 = ~p~n"
+ " Res4 = ~p~n~n"
+ "XRes5 = ~p~n"
+ " Res5 = ~p~n~n",
+ [XRes1, Res1,
+ XRes2, Res2,
+ XRes3, Res3,
+ XRes4, Res4,
+ XRes5, Res5]),
+ XRes1 = Res1,
+ XRes2 = Res2,
+ XRes3 = Res3,
+ XRes4 = Res4,
+ XRes5 = Res5,
+ ok.
mem_mode(T) ->
{case ets:info(T,compressed) of
- true -> compressed;
- false -> normal
+ true -> compressed;
+ false -> normal
end,
erlang:system_info(wordsize)}.
chk_normal_tab_struct_size() ->
- ?line System = {os:type(),
- os:version(),
- erlang:system_info(wordsize),
- erlang:system_info(smp_support),
- erlang:system_info(heap_type)},
- ?line ?t:format("System = ~p~n", [System]),
- %%?line ?t:format("?NORMAL_TAB_STRUCT_SZ=~p~n", [?NORMAL_TAB_STRUCT_SZ]),
- ?line ?t:format("?TAB_STRUCT_SZ=~p~n", [?TAB_STRUCT_SZ]),
+ System = {os:type(),
+ os:version(),
+ erlang:system_info(wordsize),
+ erlang:system_info(smp_support),
+ erlang:system_info(heap_type)},
+ io:format("System = ~p~n", [System]),
+ io:format("?TAB_STRUCT_SZ=~p~n", [?TAB_STRUCT_SZ]),
ok.
-% ?line case System of
-% {{unix, sunos}, {5, 8, 0}, 4, false, private} ->
-% ?line ?NORMAL_TAB_STRUCT_SZ = ?TAB_STRUCT_SZ,
-% ?line ok;
-% _ ->
-% ?line ok
-% end.
adjust_xmem([T1,T2,T3,T4], {A0,B0,C0,D0} = _Mem0) ->
%% Adjust for 64-bit, smp, and os:
%% Table struct size may differ.
-% Mem1 = case ?TAB_STRUCT_SZ of
-% ?NORMAL_TAB_STRUCT_SZ ->
-% Mem0;
-% TabStructSz ->
-% TabDiff = TabStructSz - ?NORMAL_TAB_STRUCT_SZ,
-% {A0+TabDiff, B0+TabDiff, C0+TabDiff, D0+TabDiff}
-% end,
-
TabDiff = ?TAB_STRUCT_SZ,
{A0+TabDiff, B0+TabDiff, C0+TabDiff, D0+TabDiff}.
-t_whitebox(doc) ->
- ["Diverse whitebox testes"];
-t_whitebox(suite) ->
- [];
+%% Misc. whitebox tests
t_whitebox(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
repeat_for_opts(whitebox_1),
repeat_for_opts(whitebox_1),
repeat_for_opts(whitebox_1),
repeat_for_opts(whitebox_2),
repeat_for_opts(whitebox_2),
repeat_for_opts(whitebox_2),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
whitebox_1(Opts) ->
- ?line T=ets_new(x,[bag | Opts]),
- ?line ets:insert(T,[{du,glade},{ta,en}]),
- ?line ets:insert(T,[{hej,hopp2},{du,glade2},{ta,en2}]),
- ?line {_,C}=ets:match(T,{ta,'$1'},1),
- ?line ets:select(C),
- ?line ets:match(C),
- ?line ets:delete(T),
+ T=ets_new(x,[bag | Opts]),
+ ets:insert(T,[{du,glade},{ta,en}]),
+ ets:insert(T,[{hej,hopp2},{du,glade2},{ta,en2}]),
+ {_,C}=ets:match(T,{ta,'$1'},1),
+ ets:select(C),
+ ets:match(C),
+ ets:delete(T),
ok.
whitebox_2(Opts) ->
- ?line T=ets_new(x,[ordered_set, {keypos,2} | Opts]),
- ?line T2=ets_new(x,[set, {keypos,2}| Opts]),
- ?line 0 = ets:select_delete(T,[{{hej},[],[true]}]),
- ?line 0 = ets:select_delete(T,[{{hej,hopp},[],[true]}]),
- ?line 0 = ets:select_delete(T2,[{{hej},[],[true]}]),
- ?line 0 = ets:select_delete(T2,[{{hej,hopp},[],[true]}]),
- ?line ets:delete(T),
- ?line ets:delete(T2),
+ T=ets_new(x,[ordered_set, {keypos,2} | Opts]),
+ T2=ets_new(x,[set, {keypos,2}| Opts]),
+ 0 = ets:select_delete(T,[{{hej},[],[true]}]),
+ 0 = ets:select_delete(T,[{{hej,hopp},[],[true]}]),
+ 0 = ets:select_delete(T2,[{{hej},[],[true]}]),
+ 0 = ets:select_delete(T2,[{{hej,hopp},[],[true]}]),
+ ets:delete(T),
+ ets:delete(T2),
ok.
-
-
-t_ets_dets(doc) ->
- ["Test ets:to/from_dets"];
-t_ets_dets(suite) ->
- [];
+
+
+%% Test ets:to/from_dets.
t_ets_dets(Config) when is_list(Config) ->
repeat_for_opts(fun(Opts) -> t_ets_dets(Config,Opts) end).
t_ets_dets(Config, Opts) ->
- ?line Fname = gen_dets_filename(Config,1),
- ?line (catch file:delete(Fname)),
- ?line {ok,DTab} = dets:open_file(testdets_1,
+ Fname = gen_dets_filename(Config,1),
+ (catch file:delete(Fname)),
+ {ok,DTab} = dets:open_file(testdets_1,
[{file, Fname}]),
- ?line ETab = ets_new(x,Opts),
- ?line filltabint(ETab,3000),
- ?line DTab = ets:to_dets(ETab,DTab),
- ?line ets:delete_all_objects(ETab),
- ?line 0 = ets:info(ETab,size),
- ?line true = ets:from_dets(ETab,DTab),
- ?line 3000 = ets:info(ETab,size),
- ?line ets:delete(ETab),
- ?line check_badarg(catch ets:to_dets(ETab,DTab),
- ets, to_dets, [ETab,DTab]),
- ?line check_badarg(catch ets:from_dets(ETab,DTab),
- ets, from_dets, [ETab,DTab]),
- ?line ETab2 = ets_new(x,Opts),
- ?line filltabint(ETab2,3000),
- ?line dets:close(DTab),
- ?line check_badarg(catch ets:to_dets(ETab2,DTab),
- ets, to_dets, [ETab2,DTab]),
- ?line check_badarg(catch ets:from_dets(ETab2,DTab),
- ets, from_dets, [ETab2,DTab]),
- ?line ets:delete(ETab2),
- ?line (catch file:delete(Fname)),
+ ETab = ets_new(x,Opts),
+ filltabint(ETab,3000),
+ DTab = ets:to_dets(ETab,DTab),
+ ets:delete_all_objects(ETab),
+ 0 = ets:info(ETab,size),
+ true = ets:from_dets(ETab,DTab),
+ 3000 = ets:info(ETab,size),
+ ets:delete(ETab),
+ check_badarg(catch ets:to_dets(ETab,DTab),
+ ets, to_dets, [ETab,DTab]),
+ check_badarg(catch ets:from_dets(ETab,DTab),
+ ets, from_dets, [ETab,DTab]),
+ ETab2 = ets_new(x,Opts),
+ filltabint(ETab2,3000),
+ dets:close(DTab),
+ check_badarg(catch ets:to_dets(ETab2,DTab),
+ ets, to_dets, [ETab2,DTab]),
+ check_badarg(catch ets:from_dets(ETab2,DTab),
+ ets, from_dets, [ETab2,DTab]),
+ ets:delete(ETab2),
+ (catch file:delete(Fname)),
ok.
check_badarg({'EXIT', {badarg, [{M,F,Args,_} | _]}}, M, F, Args) ->
@@ -821,14 +775,11 @@ check_badarg({'EXIT', {badarg, [{M,F,Args,_} | _]}}, M, F, Args) ->
check_badarg({'EXIT', {badarg, [{M,F,A,_} | _]}}, M, F, Args) ->
true = test_server:is_native(M) andalso length(Args) =:= A.
-t_delete_all_objects(doc) ->
- ["Test ets:delete_all_objects/1"];
-t_delete_all_objects(suite) ->
- [];
+%% Test ets:delete_all_objects/1.
t_delete_all_objects(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
repeat_for_opts(t_delete_all_objects_do),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
get_kept_objects(T) ->
case ets:info(T,stats) of
@@ -839,80 +790,77 @@ get_kept_objects(T) ->
end.
t_delete_all_objects_do(Opts) ->
- ?line T=ets_new(x,Opts),
- ?line filltabint(T,4000),
- ?line O=ets:first(T),
- ?line ets:next(T,O),
- ?line ets:safe_fixtable(T,true),
- ?line true = ets:delete_all_objects(T),
- ?line '$end_of_table' = ets:next(T,O),
- ?line 0 = ets:info(T,size),
- ?line 4000 = get_kept_objects(T),
- ?line ets:safe_fixtable(T,false),
- ?line 0 = ets:info(T,size),
- ?line 0 = get_kept_objects(T),
- ?line filltabint(T,4000),
- ?line 4000 = ets:info(T,size),
- ?line true = ets:delete_all_objects(T),
- ?line 0 = ets:info(T,size),
- ?line ets:delete(T).
-
-
-t_delete_object(doc) ->
- ["Test ets:delete_object/2"];
-t_delete_object(suite) ->
- [];
+ T=ets_new(x,Opts),
+ filltabint(T,4000),
+ O=ets:first(T),
+ ets:next(T,O),
+ ets:safe_fixtable(T,true),
+ true = ets:delete_all_objects(T),
+ '$end_of_table' = ets:next(T,O),
+ 0 = ets:info(T,size),
+ 4000 = get_kept_objects(T),
+ ets:safe_fixtable(T,false),
+ 0 = ets:info(T,size),
+ 0 = get_kept_objects(T),
+ filltabint(T,4000),
+ 4000 = ets:info(T,size),
+ true = ets:delete_all_objects(T),
+ 0 = ets:info(T,size),
+ ets:delete(T).
+
+
+%% Test ets:delete_object/2.
t_delete_object(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
repeat_for_opts(t_delete_object_do),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
t_delete_object_do(Opts) ->
- ?line T = ets_new(x,Opts),
- ?line filltabint(T,4000),
- ?line del_one_by_one_set(T,1,4001),
- ?line filltabint(T,4000),
- ?line del_one_by_one_set(T,4000,0),
- ?line filltabint(T,4000),
- ?line First = ets:first(T),
- ?line Next = ets:next(T,First),
- ?line ets:safe_fixtable(T,true),
- ?line ets:delete_object(T,{First, integer_to_list(First)}),
- ?line Next = ets:next(T,First),
- ?line 3999 = ets:info(T,size),
- ?line 1 = get_kept_objects(T),
- ?line ets:safe_fixtable(T,false),
- ?line 3999 = ets:info(T,size),
- ?line 0 = get_kept_objects(T),
- ?line ets:delete(T),
- ?line T1 = ets_new(x,[ordered_set | Opts]),
- ?line filltabint(T1,4000),
- ?line del_one_by_one_set(T1,1,4001),
- ?line filltabint(T1,4000),
- ?line del_one_by_one_set(T1,4000,0),
- ?line ets:delete(T1),
- ?line T2 = ets_new(x,[bag | Opts]),
- ?line filltabint2(T2,4000),
- ?line del_one_by_one_bag(T2,1,4001),
- ?line filltabint2(T2,4000),
- ?line del_one_by_one_bag(T2,4000,0),
- ?line ets:delete(T2),
- ?line T3 = ets_new(x,[duplicate_bag | Opts]),
- ?line filltabint3(T3,4000),
- ?line del_one_by_one_dbag_1(T3,1,4001),
- ?line filltabint3(T3,4000),
- ?line del_one_by_one_dbag_1(T3,4000,0),
- ?line filltabint(T3,4000),
- ?line filltabint3(T3,4000),
- ?line del_one_by_one_dbag_2(T3,1,4001),
- ?line filltabint(T3,4000),
- ?line filltabint3(T3,4000),
- ?line del_one_by_one_dbag_2(T3,4000,0),
-
- ?line filltabint2(T3,4000),
- ?line filltabint(T3,4000),
- ?line del_one_by_one_dbag_3(T3,4000,0),
- ?line ets:delete(T3),
+ T = ets_new(x,Opts),
+ filltabint(T,4000),
+ del_one_by_one_set(T,1,4001),
+ filltabint(T,4000),
+ del_one_by_one_set(T,4000,0),
+ filltabint(T,4000),
+ First = ets:first(T),
+ Next = ets:next(T,First),
+ ets:safe_fixtable(T,true),
+ ets:delete_object(T,{First, integer_to_list(First)}),
+ Next = ets:next(T,First),
+ 3999 = ets:info(T,size),
+ 1 = get_kept_objects(T),
+ ets:safe_fixtable(T,false),
+ 3999 = ets:info(T,size),
+ 0 = get_kept_objects(T),
+ ets:delete(T),
+ T1 = ets_new(x,[ordered_set | Opts]),
+ filltabint(T1,4000),
+ del_one_by_one_set(T1,1,4001),
+ filltabint(T1,4000),
+ del_one_by_one_set(T1,4000,0),
+ ets:delete(T1),
+ T2 = ets_new(x,[bag | Opts]),
+ filltabint2(T2,4000),
+ del_one_by_one_bag(T2,1,4001),
+ filltabint2(T2,4000),
+ del_one_by_one_bag(T2,4000,0),
+ ets:delete(T2),
+ T3 = ets_new(x,[duplicate_bag | Opts]),
+ filltabint3(T3,4000),
+ del_one_by_one_dbag_1(T3,1,4001),
+ filltabint3(T3,4000),
+ del_one_by_one_dbag_1(T3,4000,0),
+ filltabint(T3,4000),
+ filltabint3(T3,4000),
+ del_one_by_one_dbag_2(T3,1,4001),
+ filltabint(T3,4000),
+ filltabint3(T3,4000),
+ del_one_by_one_dbag_2(T3,4000,0),
+
+ filltabint2(T3,4000),
+ filltabint(T3,4000),
+ del_one_by_one_dbag_3(T3,4000,0),
+ ets:delete(T3),
ok.
make_init_fun(N) when N > 4000->
@@ -934,21 +882,18 @@ make_init_fun(N) ->
exit(close_not_expected)
end.
-t_init_table(doc) ->
- ["Test ets:init_table/2"];
-t_init_table(suite) ->
- [];
+%% Test ets:init_table/2.
t_init_table(Config) when is_list(Config)->
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
repeat_for_opts(t_init_table_do),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
t_init_table_do(Opts) ->
- ?line T = ets_new(x,[duplicate_bag | Opts]),
- ?line filltabint(T,4000),
- ?line ets:init_table(T, make_init_fun(1)),
- ?line del_one_by_one_dbag_1(T,4000,0),
- ?line ets:delete(T),
+ T = ets_new(x,[duplicate_bag | Opts]),
+ filltabint(T,4000),
+ ets:init_table(T, make_init_fun(1)),
+ del_one_by_one_dbag_1(T,4000,0),
+ ets:delete(T),
ok.
do_fill_dbag_using_lists(T,0) ->
@@ -959,132 +904,120 @@ do_fill_dbag_using_lists(T,N) ->
do_fill_dbag_using_lists(T,N - 1).
-t_insert_new(doc) ->
- ["Test the insert_new function"];
-t_insert_new(suite) ->
- [];
+%% Test the insert_new function.
t_insert_new(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line L = fill_sets_int(1000) ++ fill_sets_int(1000,[{write_concurrency,true}]),
+ EtsMem = etsmem(),
+ L = fill_sets_int(1000) ++ fill_sets_int(1000,[{write_concurrency,true}]),
lists:foreach(fun(Tab) ->
- ?line false = ets:insert_new(Tab,{2,"2"}),
- ?line true = ets:insert_new(Tab,{2002,"2002"}),
- ?line false = ets:insert_new(Tab,{2002,"2002"}),
- ?line true = ets:insert(Tab,{2002,"2002"}),
- ?line false = ets:insert_new(Tab,[{2002,"2002"}]),
- ?line false = ets:insert_new(Tab,[{2002,"2002"},
+ false = ets:insert_new(Tab,{2,"2"}),
+ true = ets:insert_new(Tab,{2002,"2002"}),
+ false = ets:insert_new(Tab,{2002,"2002"}),
+ true = ets:insert(Tab,{2002,"2002"}),
+ false = ets:insert_new(Tab,[{2002,"2002"}]),
+ false = ets:insert_new(Tab,[{2002,"2002"},
{2003,"2003"}]),
- ?line false = ets:insert_new(Tab,[{2001,"2001"},
+ false = ets:insert_new(Tab,[{2001,"2001"},
{2002,"2002"},
{2003,"2003"}]),
- ?line false = ets:insert_new(Tab,[{2001,"2001"},
+ false = ets:insert_new(Tab,[{2001,"2001"},
{2002,"2002"}]),
- ?line true = ets:insert_new(Tab,[{2001,"2001"},
+ true = ets:insert_new(Tab,[{2001,"2001"},
{2003,"2003"}]),
- ?line false = ets:insert_new(Tab,{2001,"2001"}),
- ?line false = ets:insert_new(Tab,{2002,"2002"}),
- ?line false = ets:insert_new(Tab,{2003,"2003"}),
- ?line true = ets:insert_new(Tab,{2004,"2004"}),
- ?line true = ets:insert_new(Tab,{2000,"2000"}),
- ?line true = ets:insert_new(Tab,[{2005,"2005"},
- {2006,"2006"},
- {2007,"2007"}]),
- ?line Num =
+ false = ets:insert_new(Tab,{2001,"2001"}),
+ false = ets:insert_new(Tab,{2002,"2002"}),
+ false = ets:insert_new(Tab,{2003,"2003"}),
+ true = ets:insert_new(Tab,{2004,"2004"}),
+ true = ets:insert_new(Tab,{2000,"2000"}),
+ true = ets:insert_new(Tab,[{2005,"2005"},
+ {2006,"2006"},
+ {2007,"2007"}]),
+ Num =
case ets:info(Tab,type) of
bag ->
- ?line true =
+ true =
ets:insert(Tab,{2004,"2004-2"}),
- ?line false =
+ false =
ets:insert_new(Tab,{2004,"2004-3"}),
1009;
duplicate_bag ->
- ?line true =
+ true =
ets:insert(Tab,{2004,"2004"}),
- ?line false =
+ false =
ets:insert_new(Tab,{2004,"2004"}),
1010;
_ ->
1008
end,
- ?line Num = ets:info(Tab,size),
- ?line List = ets:tab2list(Tab),
- ?line ets:delete_all_objects(Tab),
- ?line true = ets:insert_new(Tab,List),
- ?line false = ets:insert_new(Tab,List),
- ?line ets:delete(Tab)
+ Num = ets:info(Tab,size),
+ List = ets:tab2list(Tab),
+ ets:delete_all_objects(Tab),
+ true = ets:insert_new(Tab,List),
+ false = ets:insert_new(Tab,List),
+ ets:delete(Tab)
end,
L),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
-t_insert_list(doc) ->
- ["Test ets:insert/2 with list of objects."];
-t_insert_list(suite) ->
- [];
+%% Test ets:insert/2 with list of objects.
t_insert_list(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
repeat_for_opts(t_insert_list_do),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
t_insert_list_do(Opts) ->
- ?line T = ets_new(x,[duplicate_bag | Opts]),
- ?line do_fill_dbag_using_lists(T,4000),
- ?line del_one_by_one_dbag_2(T,4000,0),
- ?line ets:delete(T).
+ T = ets_new(x,[duplicate_bag | Opts]),
+ do_fill_dbag_using_lists(T,4000),
+ del_one_by_one_dbag_2(T,4000,0),
+ ets:delete(T).
-t_test_ms(doc) ->
- ["Test interface of ets:test_ms/2"];
-t_test_ms(suite) ->
- [];
+%% Test interface of ets:test_ms/2.
t_test_ms(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line {ok,[a,b]} = ets:test_ms({a,b},
- [{{'$1','$2'},[{'<','$1','$2'}],['$$']}]),
- ?line {ok,false} = ets:test_ms({a,b},
- [{{'$1','$2'},[{'>','$1','$2'}],['$$']}]),
+ EtsMem = etsmem(),
+ {ok,[a,b]} = ets:test_ms({a,b},
+ [{{'$1','$2'},[{'<','$1','$2'}],['$$']}]),
+ {ok,false} = ets:test_ms({a,b},
+ [{{'$1','$2'},[{'>','$1','$2'}],['$$']}]),
Tpl = {a,gb_sets:new()},
- ?line {ok,Tpl} = ets:test_ms(Tpl, [{{'_','_'}, [], ['$_']}]), % OTP-10190
- ?line {error,[{error,String}]} = ets:test_ms({a,b},
- [{{'$1','$2'},
- [{'flurp','$1','$2'}],
- ['$$']}]),
- ?line true = (if is_list(String) -> true; true -> false end),
- ?line verify_etsmem(EtsMem).
-
-t_select_reverse(doc) ->
- ["Test the select reverse BIF's"];
-t_select_reverse(suite) ->
- [];
+ {ok,Tpl} = ets:test_ms(Tpl, [{{'_','_'}, [], ['$_']}]), % OTP-10190
+ {error,[{error,String}]} = ets:test_ms({a,b},
+ [{{'$1','$2'},
+ [{'flurp','$1','$2'}],
+ ['$$']}]),
+ true = (if is_list(String) -> true; true -> false end),
+ verify_etsmem(EtsMem).
+
+%% Test the select reverse BIFs.
t_select_reverse(Config) when is_list(Config) ->
- ?line Table = ets_new(xxx, [ordered_set]),
- ?line filltabint(Table,1000),
- ?line A = lists:reverse(ets:select(Table,[{{'$1', '_'},
+ Table = ets_new(xxx, [ordered_set]),
+ filltabint(Table,1000),
+ A = lists:reverse(ets:select(Table,[{{'$1', '_'},
[{'>',
{'rem',
'$1', 5},
2}],
['$_']}])),
- ?line A = ets:select_reverse(Table,[{{'$1', '_'},
+ A = ets:select_reverse(Table,[{{'$1', '_'},
[{'>',
{'rem',
'$1', 5},
2}],
['$_']}]),
- ?line A = reverse_chunked(Table,[{{'$1', '_'},
- [{'>',
- {'rem',
- '$1', 5},
- 2}],
- ['$_']}],3),
- % A set/bag/duplicate_bag should get the same result regardless
- % of select or select_reverse
- ?line Table2 = ets_new(xxx, [set]),
- ?line filltabint(Table2,1000),
- ?line Table3 = ets_new(xxx, [bag]),
- ?line filltabint(Table3,1000),
- ?line Table4 = ets_new(xxx, [duplicate_bag]),
- ?line filltabint(Table4,1000),
- ?line lists:map(fun(Tab) ->
+ A = reverse_chunked(Table,[{{'$1', '_'},
+ [{'>',
+ {'rem',
+ '$1', 5},
+ 2}],
+ ['$_']}],3),
+ %% A set/bag/duplicate_bag should get the same result regardless
+ %% of select or select_reverse
+ Table2 = ets_new(xxx, [set]),
+ filltabint(Table2,1000),
+ Table3 = ets_new(xxx, [bag]),
+ filltabint(Table3,1000),
+ Table4 = ets_new(xxx, [duplicate_bag]),
+ filltabint(Table4,1000),
+ lists:map(fun(Tab) ->
B = ets:select(Tab,[{{'$1', '_'},
[{'>',
{'rem',
@@ -1112,52 +1045,49 @@ do_reverse_chunked({L,C},Acc) ->
do_reverse_chunked(ets:select_reverse(C), NewAcc).
-t_select_delete(doc) ->
- ["Test the ets:select_delete/2 and ets:select_count/2 BIF's"];
-t_select_delete(suite) ->
- [];
+%% Test the ets:select_delete/2 and ets:select_count/2 BIFs.
t_select_delete(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line Tables = fill_sets_int(10000) ++ fill_sets_int(10000,[{write_concurrency,true}]),
+ EtsMem = etsmem(),
+ Tables = fill_sets_int(10000) ++ fill_sets_int(10000,[{write_concurrency,true}]),
lists:foreach
(fun(Table) ->
- ?line 4000 = ets:select_count(Table,[{{'$1', '_'},
- [{'>',
- {'rem',
- '$1', 5},
- 2}],
- [true]}]),
- ?line 4000 = ets:select_delete(Table,[{{'$1', '_'},
- [{'>',
- {'rem',
- '$1', 5},
- 2}],
- [true]}]),
- ?line check(Table,
- fun({N,_}) when (N rem 5) =< 2 ->
- true;
- (_) ->
- false
- end,
- 6000)
+ 4000 = ets:select_count(Table,[{{'$1', '_'},
+ [{'>',
+ {'rem',
+ '$1', 5},
+ 2}],
+ [true]}]),
+ 4000 = ets:select_delete(Table,[{{'$1', '_'},
+ [{'>',
+ {'rem',
+ '$1', 5},
+ 2}],
+ [true]}]),
+ check(Table,
+ fun({N,_}) when (N rem 5) =< 2 ->
+ true;
+ (_) ->
+ false
+ end,
+ 6000)
end,
Tables),
lists:foreach
(fun(Table) ->
- ?line ets:select_delete(Table,[{'_',[],[true]}]),
- ?line xfilltabint(Table,4000),
- ?line successive_delete(Table,1,4001,bound),
- ?line 0 = ets:info(Table,size),
- ?line xfilltabint(Table,4000),
- ?line successive_delete(Table,4000,0, bound),
- ?line 0 = ets:info(Table,size),
- ?line xfilltabint(Table,4000),
- ?line successive_delete(Table,1,4001,unbound),
- ?line 0 = ets:info(Table,size),
- ?line xfilltabint(Table,4000),
- ?line successive_delete(Table,4000,0, unbound),
- ?line 0 = ets:info(Table,size)
+ ets:select_delete(Table,[{'_',[],[true]}]),
+ xfilltabint(Table,4000),
+ successive_delete(Table,1,4001,bound),
+ 0 = ets:info(Table,size),
+ xfilltabint(Table,4000),
+ successive_delete(Table,4000,0, bound),
+ 0 = ets:info(Table,size),
+ xfilltabint(Table,4000),
+ successive_delete(Table,1,4001,unbound),
+ 0 = ets:info(Table,size),
+ xfilltabint(Table,4000),
+ successive_delete(Table,4000,0, unbound),
+ 0 = ets:info(Table,size)
end,
Tables),
@@ -1169,162 +1099,152 @@ t_select_delete(Config) when is_list(Config) ->
_ ->
1
end,
- ?line xfilltabstr(Table, 4000),
- ?line 1000 = ets:select_count(Table,
- [{{[$3 | '$1'], '_'},
- [{'==',
- {'length', '$1'},
- 3}],[true]}]) div F,
- ?line 1000 = ets:select_delete(Table,
- [{{[$3 | '$1'], '_'},
- [{'==',
- {'length', '$1'},
- 3}],[true]}]) div F,
- ?line check(Table, fun({[3,_,_,_],_}) -> false;
- (_) -> true
- end, 3000*F),
- ?line 8 = ets:select_count(Table,
- [{{"7",'_'},[],[false]},
- {{['_'], '_'},
- [],[true]}]) div F,
- ?line 8 = ets:select_delete(Table,
- [{{"7",'_'},[],[false]},
- {{['_'], '_'},
- [],[true]}]) div F,
- ?line check(Table, fun({"7",_}) -> true;
- ({[_],_}) -> false;
- (_) -> true
- end, 2992*F),
- ?line xfilltabstr(Table, 4000),
+ xfilltabstr(Table, 4000),
+ 1000 = ets:select_count(Table,
+ [{{[$3 | '$1'], '_'},
+ [{'==',
+ {'length', '$1'},
+ 3}],[true]}]) div F,
+ 1000 = ets:select_delete(Table,
+ [{{[$3 | '$1'], '_'},
+ [{'==',
+ {'length', '$1'},
+ 3}],[true]}]) div F,
+ check(Table, fun({[3,_,_,_],_}) -> false;
+ (_) -> true
+ end, 3000*F),
+ 8 = ets:select_count(Table,
+ [{{"7",'_'},[],[false]},
+ {{['_'], '_'},
+ [],[true]}]) div F,
+ 8 = ets:select_delete(Table,
+ [{{"7",'_'},[],[false]},
+ {{['_'], '_'},
+ [],[true]}]) div F,
+ check(Table, fun({"7",_}) -> true;
+ ({[_],_}) -> false;
+ (_) -> true
+ end, 2992*F),
+ xfilltabstr(Table, 4000),
%% This happens to be interesting for other select types too
- ?line 200 = length(ets:select(Table,
- [{{[$3,'_','_'],'_'},
- [],[true]},
- {{[$1,'_','_'],'_'},
- [],[true]}])) div F,
- ?line 200 = ets:select_count(Table,
- [{{[$3,'_','_'],'_'},
- [],[true]},
- {{[$1,'_','_'],'_'},
- [],[true]}]) div F,
- ?line 200 = length(element(1,ets:select(Table,
- [{{[$3,'_','_'],'_'},
- [],[true]},
- {{[$1,'_','_'],'_'},
- [],[true]}],
- 1000))) div F,
- ?line 200 = length(
- ets:select_reverse(Table,
- [{{[$3,'_','_'],'_'},
- [],[true]},
- {{[$1,'_','_'],'_'},
- [],[true]}])) div F,
- ?line 200 = length(
- element(1,
- ets:select_reverse
- (Table,
+ 200 = length(ets:select(Table,
+ [{{[$3,'_','_'],'_'},
+ [],[true]},
+ {{[$1,'_','_'],'_'},
+ [],[true]}])) div F,
+ 200 = ets:select_count(Table,
[{{[$3,'_','_'],'_'},
[],[true]},
{{[$1,'_','_'],'_'},
- [],[true]}],
- 1000))) div F,
- ?line 200 = ets:select_delete(Table,
- [{{[$3,'_','_'],'_'},
- [],[true]},
- {{[$1,'_','_'],'_'},
- [],[true]}]) div F,
- ?line 0 = ets:select_count(Table,
+ [],[true]}]) div F,
+ 200 = length(element(1,ets:select(Table,
+ [{{[$3,'_','_'],'_'},
+ [],[true]},
+ {{[$1,'_','_'],'_'},
+ [],[true]}],
+ 1000))) div F,
+ 200 = length(
+ ets:select_reverse(Table,
[{{[$3,'_','_'],'_'},
[],[true]},
{{[$1,'_','_'],'_'},
- [],[true]}]) div F,
- ?line check(Table, fun({[$3,_,_],_}) -> false;
- ({[$1,_,_],_}) -> false;
- (_) -> true
- end, 3800*F)
+ [],[true]}])) div F,
+ 200 = length(
+ element(1,
+ ets:select_reverse
+ (Table,
+ [{{[$3,'_','_'],'_'},
+ [],[true]},
+ {{[$1,'_','_'],'_'},
+ [],[true]}],
+ 1000))) div F,
+ 200 = ets:select_delete(Table,
+ [{{[$3,'_','_'],'_'},
+ [],[true]},
+ {{[$1,'_','_'],'_'},
+ [],[true]}]) div F,
+ 0 = ets:select_count(Table,
+ [{{[$3,'_','_'],'_'},
+ [],[true]},
+ {{[$1,'_','_'],'_'},
+ [],[true]}]) div F,
+ check(Table, fun({[$3,_,_],_}) -> false;
+ ({[$1,_,_],_}) -> false;
+ (_) -> true
+ end, 3800*F)
end,
Tables),
lists:foreach(fun(Tab) -> ets:delete(Tab) end,Tables),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
-partly_bound(doc) ->
- ["Test that partly bound keys gives faster matches"];
-partly_bound(suite) ->
- [];
+%% Test that partly bound keys gives faster matches.
partly_bound(Config) when is_list(Config) ->
case os:type() of
{win32,_} ->
{skip,"Inaccurate measurements on Windows"};
_ ->
- ?line EtsMem = etsmem(),
- ?line dont_make_worse(),
- ?line make_better(),
- ?line verify_etsmem(EtsMem)
+ EtsMem = etsmem(),
+ dont_make_worse(),
+ make_better(),
+ verify_etsmem(EtsMem)
end.
dont_make_worse() ->
seventyfive_percent_success({?MODULE,dont_make_worse_sub,[]},0,0,10).
dont_make_worse_sub() ->
- ?line T = build_table([a,b],[a,b],15000),
- ?line T1 = time_match_object(T,{'_',a,a,1500}, [{{a,a,1500},a,a,1500}]),
- ?line T2 = time_match_object(T,{{a,a,'_'},a,a,1500},
- [{{a,a,1500},a,a,1500}]),
- ?line ets:delete(T),
- ?line true = (T1 > T2),
+ T = build_table([a,b],[a,b],15000),
+ T1 = time_match_object(T,{'_',a,a,1500}, [{{a,a,1500},a,a,1500}]),
+ T2 = time_match_object(T,{{a,a,'_'},a,a,1500},
+ [{{a,a,1500},a,a,1500}]),
+ ets:delete(T),
+ true = (T1 > T2),
ok.
-
+
make_better() ->
fifty_percent_success({?MODULE,make_better_sub2,[]},0,0,10),
fifty_percent_success({?MODULE,make_better_sub1,[]},0,0,10).
make_better_sub1() ->
- ?line T = build_table2([a,b],[a,b],15000),
- ?line T1 = time_match_object(T,{'_',1500,a,a}, [{{1500,a,a},1500,a,a}]),
- ?line T2 = time_match_object(T,{{1500,a,'_'},1500,a,a},
- [{{1500,a,a},1500,a,a}]),
- ?line ets:delete(T),
- ?line io:format("~p>~p~n",[(T1 / 100),T2]),
- ?line true = ((T1 / 100) > T2), % More marginal than needed.
+ T = build_table2([a,b],[a,b],15000),
+ T1 = time_match_object(T,{'_',1500,a,a}, [{{1500,a,a},1500,a,a}]),
+ T2 = time_match_object(T,{{1500,a,'_'},1500,a,a},
+ [{{1500,a,a},1500,a,a}]),
+ ets:delete(T),
+ io:format("~p>~p~n",[(T1 / 100),T2]),
+ true = ((T1 / 100) > T2), % More marginal than needed.
ok.
make_better_sub2() ->
- ?line T = build_table2([a,b],[a,b],15000),
- ?line T1 = time_match(T,{'$1',1500,a,a}),
- ?line T2 = time_match(T,{{1500,a,'$1'},1500,a,a}),
- ?line ets:delete(T),
- ?line io:format("~p>~p~n",[(T1 / 100),T2]),
- ?line true = ((T1 / 100) > T2), % More marginal than needed.
+ T = build_table2([a,b],[a,b],15000),
+ T1 = time_match(T,{'$1',1500,a,a}),
+ T2 = time_match(T,{{1500,a,'$1'},1500,a,a}),
+ ets:delete(T),
+ io:format("~p>~p~n",[(T1 / 100),T2]),
+ true = ((T1 / 100) > T2), % More marginal than needed.
ok.
-match_heavy(doc) ->
- ["Heavy random matching, comparing set with ordered_set."];
-match_heavy(suite) ->
- [];
+%% Heavy random matching, comparing set with ordered_set.
match_heavy(Config) when is_list(Config) ->
- PrivDir = ?config(priv_dir,Config),
- DataDir = ?config(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir,Config),
+ DataDir = proplists:get_value(data_dir, Config),
%% Easier to have in process dictionary when manually
%% running the test function.
put(where_to_read,DataDir),
put(where_to_write,PrivDir),
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
- NewDog=test_server:timetrap(test_server:seconds(1000)),
- NewConfig = [{watchdog, NewDog} | lists:keydelete(watchdog,1,Config)],
random_test(),
drop_match(),
- NewConfig.
+ ok.
%%% Extra safety for the very low probability that this is not
%%% caught by the random test (Statistically impossible???)
drop_match() ->
- ?line EtsMem = etsmem(),
- ?line T = build_table([a,b],[a],1500),
- ?line [{{a,a,1},a,a,1},{{b,a,1},b,a,1}] =
+ EtsMem = etsmem(),
+ T = build_table([a,b],[a],1500),
+ [{{a,a,1},a,a,1},{{b,a,1},b,a,1}] =
ets:match_object(T, {'_','_','_',1}),
- ?line true = ets:delete(T),
- ?line verify_etsmem(EtsMem).
+ true = ets:delete(T),
+ verify_etsmem(EtsMem).
@@ -1361,11 +1281,11 @@ match_object_chunked_collect({Results, Continuation}) ->
Results ++ match_object_chunked_collect(ets:match_object(Continuation)).
-
+
random_test() ->
- ?line ReadDir = get(where_to_read),
- ?line WriteDir = get(where_to_write),
- ?line (catch file:make_dir(WriteDir)),
+ ReadDir = get(where_to_read),
+ WriteDir = get(where_to_write),
+ (catch file:make_dir(WriteDir)),
case file:consult(filename:join([ReadDir,"preset_random_seed.txt"])) of
{ok,[X]} ->
rand:seed(X);
@@ -1374,152 +1294,152 @@ random_test() ->
end,
Seed = rand:export_seed(),
{ok,F} = file:open(filename:join([WriteDir,"last_random_seed.txt"]),
- [write]),
+ [write]),
io:format(F,"~p. ~n",[Seed]),
file:close(F),
io:format("Random seed ~p written to ~s, copy to ~s to rerun with "
"same seed.",[Seed,
filename:join([WriteDir, "last_random_seed.txt"]),
filename:join([ReadDir,
- "preset_random_seed.txt"])]),
+ "preset_random_seed.txt"])]),
do_random_test().
do_random_test() ->
- ?line EtsMem = etsmem(),
- ?line OrdSet = ets_new(xxx,[ordered_set]),
- ?line Set = ets_new(xxx,[]),
- ?line do_n_times(fun() ->
- ?line Key = create_random_string(25),
- ?line Value = create_random_tuple(25),
- ?line ets:insert(OrdSet,{Key,Value}),
- ?line ets:insert(Set,{Key,Value})
+ EtsMem = etsmem(),
+ OrdSet = ets_new(xxx,[ordered_set]),
+ Set = ets_new(xxx,[]),
+ do_n_times(fun() ->
+ Key = create_random_string(25),
+ Value = create_random_tuple(25),
+ ets:insert(OrdSet,{Key,Value}),
+ ets:insert(Set,{Key,Value})
end, 5000),
- ?line io:format("~nData inserted~n"),
- ?line do_n_times(fun() ->
+ io:format("~nData inserted~n"),
+ do_n_times(fun() ->
I = rand:uniform(25),
- ?line Key = create_random_string(I) ++ '_',
- ?line L1 = ets_match_object(OrdSet,{Key,'_'}),
- ?line L2 = lists:sort(ets_match_object(Set,{Key,'_'})),
+ Key = create_random_string(I) ++ '_',
+ L1 = ets_match_object(OrdSet,{Key,'_'}),
+ L2 = lists:sort(ets_match_object(Set,{Key,'_'})),
case L1 == L2 of
false ->
io:format("~p != ~p~n",
[L1,L2]),
- ?line exit({not_eq, L1, L2});
+ exit({not_eq, L1, L2});
true ->
ok
end
end,
2000),
- ?line io:format("~nData matched~n"),
- ?line ets:match_delete(OrdSet,'_'),
- ?line ets:match_delete(Set,'_'),
- ?line do_n_times(fun() ->
- ?line Value = create_random_string(25),
- ?line Key = create_random_tuple(25),
- ?line ets:insert(OrdSet,{Key,Value}),
- ?line ets:insert(Set,{Key,Value})
+ io:format("~nData matched~n"),
+ ets:match_delete(OrdSet,'_'),
+ ets:match_delete(Set,'_'),
+ do_n_times(fun() ->
+ Value = create_random_string(25),
+ Key = create_random_tuple(25),
+ ets:insert(OrdSet,{Key,Value}),
+ ets:insert(Set,{Key,Value})
end, 2000),
- ?line io:format("~nData inserted~n"),
+ io:format("~nData inserted~n"),
(fun() ->
- ?line Key = list_to_tuple(lists:duplicate(25,'_')),
- ?line L1 = ets_match_object(OrdSet,{Key,'_'}),
- ?line L2 = lists:sort(ets_match_object(Set,{Key,'_'})),
- ?line 2000 = length(L1),
+ Key = list_to_tuple(lists:duplicate(25,'_')),
+ L1 = ets_match_object(OrdSet,{Key,'_'}),
+ L2 = lists:sort(ets_match_object(Set,{Key,'_'})),
+ 2000 = length(L1),
case L1 == L2 of
false ->
io:format("~p != ~p~n",
[L1,L2]),
- ?line exit({not_eq, L1, L2});
+ exit({not_eq, L1, L2});
true ->
ok
end
end)(),
(fun() ->
- ?line Key = {'$1','$2','$3','$4',
- '$5','$6','$7','$8',
- '$9','$10','$11','$12',
- '$13','$14','$15','$16',
- '$17','$18','$19','$20',
- '$21','$22','$23','$24',
- '$25'},
- ?line L1 = ets_match_object(OrdSet,{Key,'_'}),
- ?line L2 = lists:sort(ets_match_object(Set,{Key,'_'})),
- ?line 2000 = length(L1),
+ Key = {'$1','$2','$3','$4',
+ '$5','$6','$7','$8',
+ '$9','$10','$11','$12',
+ '$13','$14','$15','$16',
+ '$17','$18','$19','$20',
+ '$21','$22','$23','$24',
+ '$25'},
+ L1 = ets_match_object(OrdSet,{Key,'_'}),
+ L2 = lists:sort(ets_match_object(Set,{Key,'_'})),
+ 2000 = length(L1),
case L1 == L2 of
false ->
io:format("~p != ~p~n",
[L1,L2]),
- ?line exit({not_eq, L1, L2});
+ exit({not_eq, L1, L2});
true ->
ok
end
end)(),
(fun() ->
- ?line Key = {'$1','$2','$3','$4',
- '$5','$6','$7','$8',
- '$9','$10','$11','$12',
- '$13','$14','$15','$16',
- '$17','$18','$19','$20',
- '$21','$22','$23','$24',
- '$25'},
- ?line L1 = ets_match(OrdSet,{Key,'_'}),
- ?line L2 = lists:sort(ets_match(Set,{Key,'_'})),
- ?line 2000 = length(L1),
+ Key = {'$1','$2','$3','$4',
+ '$5','$6','$7','$8',
+ '$9','$10','$11','$12',
+ '$13','$14','$15','$16',
+ '$17','$18','$19','$20',
+ '$21','$22','$23','$24',
+ '$25'},
+ L1 = ets_match(OrdSet,{Key,'_'}),
+ L2 = lists:sort(ets_match(Set,{Key,'_'})),
+ 2000 = length(L1),
case L1 == L2 of
false ->
io:format("~p != ~p~n",
[L1,L2]),
- ?line exit({not_eq, L1, L2});
+ exit({not_eq, L1, L2});
true ->
ok
end
end)(),
- ?line ets:match_delete(OrdSet,'_'),
- ?line ets:match_delete(Set,'_'),
- ?line do_n_times(fun() ->
- ?line Value = create_random_string(25),
- ?line Key = create_random_tuple(25),
- ?line ets:insert(OrdSet,{Key,Value}),
- ?line ets:insert(Set,{Key,Value})
+ ets:match_delete(OrdSet,'_'),
+ ets:match_delete(Set,'_'),
+ do_n_times(fun() ->
+ Value = create_random_string(25),
+ Key = create_random_tuple(25),
+ ets:insert(OrdSet,{Key,Value}),
+ ets:insert(Set,{Key,Value})
end, 2000),
- ?line io:format("~nData inserted~n"),
+ io:format("~nData inserted~n"),
do_n_times(fun() ->
- ?line Key = create_partly_bound_tuple(25),
- ?line L1 = ets_match_object(OrdSet,{Key,'_'}),
- ?line L2 = lists:sort(ets_match_object(Set,{Key,'_'})),
+ Key = create_partly_bound_tuple(25),
+ L1 = ets_match_object(OrdSet,{Key,'_'}),
+ L2 = lists:sort(ets_match_object(Set,{Key,'_'})),
case L1 == L2 of
false ->
io:format("~p != ~p~n",
[L1,L2]),
- ?line exit({not_eq, L1, L2});
+ exit({not_eq, L1, L2});
true ->
ok
end
end,
2000),
- ?line do_n_times(fun() ->
- ?line Key = create_partly_bound_tuple2(25),
- ?line L1 = ets_match_object(OrdSet,{Key,'_'}),
- ?line L2 = lists:sort(ets_match_object(Set,{Key,'_'})),
+ do_n_times(fun() ->
+ Key = create_partly_bound_tuple2(25),
+ L1 = ets_match_object(OrdSet,{Key,'_'}),
+ L2 = lists:sort(ets_match_object(Set,{Key,'_'})),
case L1 == L2 of
false ->
io:format("~p != ~p~n",
[L1,L2]),
- ?line exit({not_eq, L1, L2});
+ exit({not_eq, L1, L2});
true ->
ok
end
end,
2000),
do_n_times(fun() ->
- ?line Key = create_partly_bound_tuple2(25),
- ?line L1 = ets_match(OrdSet,{Key,'_'}),
- ?line L2 = lists:sort(ets_match(Set,{Key,'_'})),
+ Key = create_partly_bound_tuple2(25),
+ L1 = ets_match(OrdSet,{Key,'_'}),
+ L2 = lists:sort(ets_match(Set,{Key,'_'})),
case L1 == L2 of
false ->
io:format("~p != ~p~n",
[L1,L2]),
- ?line exit({not_eq, L1, L2});
+ exit({not_eq, L1, L2});
true ->
ok
end
@@ -1530,15 +1450,15 @@ do_random_test() ->
ets:match_delete(Set,'_'),
do_n_times(fun() ->
do_n_times(fun() ->
- ?line Value =
+ Value =
create_random_string(25),
- ?line Key = create_random_tuple(25),
- ?line ets:insert(OrdSet,{Key,Value}),
- ?line ets:insert(Set,{Key,Value})
+ Key = create_random_tuple(25),
+ ets:insert(OrdSet,{Key,Value}),
+ ets:insert(Set,{Key,Value})
end, 500),
io:format("~nData inserted~n"),
do_n_times(fun() ->
- ?line Key =
+ Key =
create_partly_bound_tuple(25),
ets:match_delete(OrdSet,{Key,'_'}),
ets:match_delete(Set,{Key,'_'}),
@@ -1563,16 +1483,13 @@ do_random_test() ->
10),
ets:delete(OrdSet),
ets:delete(Set),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
-update_element(doc) ->
- ["test various variants of update_element"];
-update_element(suite) ->
- [];
+%% Ttest various variants of update_element.
update_element(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
repeat_for_opts(update_element_opts),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
update_element_opts(Opts) ->
TupleCases = [{{key,val}, 1 ,2},
@@ -1582,12 +1499,12 @@ update_element_opts(Opts) ->
{{val,key,val,val}, 2, [3,4,1]},
{{val,val,key,val}, 3, [1,4,1,2]}, % update pos1 twice
{{val,val,val,key}, 4, [2,1,2,3]}],% update pos2 twice
-
+
lists:foreach(fun({Tuple,KeyPos,UpdPos}) -> update_element_opts(Tuple,KeyPos,UpdPos,Opts) end,
TupleCases),
-
+
update_element_neg(Opts).
-
+
update_element_opts(Tuple,KeyPos,UpdPos,Opts) ->
@@ -1606,16 +1523,15 @@ update_element(T,Tuple,KeyPos,UpdPos) ->
update_element_do(T,TupleWithKey,Key,UpdPos)
end,
KeyList).
-
+
update_element_do(Tab,Tuple,Key,UpdPos) ->
- % Strategy: Step around in Values array and call ets:update_element for the values.
- % Take Length number of steps of size 1, then of size 2, ..., Length-1.
- % This will try all combinations of {fromValue,toValue}
- %
- % IMPORTANT: size(Values) must be a prime number for this to work!!!
+ %% Strategy: Step around in Values array and call ets:update_element for the values.
+ %% Take Length number of steps of size 1, then of size 2, ..., Length-1.
+ %% This will try all combinations of {fromValue,toValue}
+ %%
+ %% IMPORTANT: size(Values) must be a prime number for this to work!!!
- %io:format("update_element_do for key=~p\n",[Key]),
Big32 = 16#12345678,
Big64 = 16#123456789abcdef0,
Values = { 623, -27, 0, Big32, -Big32, Big64, -Big64, Big32*Big32,
@@ -1625,14 +1541,14 @@ update_element_do(Tab,Tuple,Key,UpdPos) ->
(fun(X) -> X*Big32 end),
make_ref(), make_ref(), self(), ok, update_element, 28, 29 },
Length = size(Values),
-
+
PosValArgF = fun(ToIx, ResList, [Pos | PosTail], Rand, MeF) ->
NextIx = (ToIx+Rand) rem Length,
MeF(NextIx, [{Pos,element(ToIx+1,Values)} | ResList], PosTail, Rand, MeF);
(_ToIx, ResList, [], _Rand, _MeF) ->
ResList;
-
+
(ToIx, [], Pos, _Rand, _MeF) ->
{Pos, element(ToIx+1,Values)} % single {pos,value} arg
end,
@@ -1641,10 +1557,10 @@ update_element_do(Tab,Tuple,Key,UpdPos) ->
PosValArg = PosValArgF(ToIx,[],UpdPos,Rand,PosValArgF),
%%io:format("update_element(~p)~n",[PosValArg]),
ArgHash = erlang:phash2({Tab,Key,PosValArg}),
- ?line true = ets:update_element(Tab, Key, PosValArg),
- ?line ArgHash = erlang:phash2({Tab,Key,PosValArg}),
+ true = ets:update_element(Tab, Key, PosValArg),
+ ArgHash = erlang:phash2({Tab,Key,PosValArg}),
NewTuple = update_tuple(PosValArg,Tuple),
- ?line [NewTuple] = ets:lookup(Tab,Key)
+ [NewTuple] = ets:lookup(Tab,Key)
end,
LoopF = fun(_FromIx, Incr, _Times, Checksum, _MeF) when Incr >= Length ->
@@ -1664,11 +1580,11 @@ update_element_do(Tab,Tuple,Key,UpdPos) ->
end,
FirstTuple = Tuple,
- ?line true = ets:insert(Tab,FirstTuple),
- ?line [FirstTuple] = ets:lookup(Tab,Key),
-
+ true = ets:insert(Tab,FirstTuple),
+ [FirstTuple] = ets:lookup(Tab,Key),
+
Checksum = LoopF(0, 1, Length, 0, LoopF),
- ?line Checksum = (Length-1)*Length*(Length+1) div 2, % if Length is a prime
+ Checksum = (Length-1)*Length*(Length+1) div 2, % if Length is a prime
ok.
update_tuple({Pos,Val}, Tpl) ->
@@ -1686,14 +1602,14 @@ update_element_neg(Opts) ->
update_element_neg_do(Set),
update_element_neg_do(OrdSet),
ets:delete(Set),
- ?line {'EXIT',{badarg,_}} = (catch ets:update_element(Set,key,{2,1})),
+ {'EXIT',{badarg,_}} = (catch ets:update_element(Set,key,{2,1})),
ets:delete(OrdSet),
- ?line {'EXIT',{badarg,_}} = (catch ets:update_element(OrdSet,key,{2,1})),
+ {'EXIT',{badarg,_}} = (catch ets:update_element(OrdSet,key,{2,1})),
- ?line Bag = ets_new(bag,[bag | Opts]),
- ?line DBag = ets_new(duplicate_bag,[duplicate_bag | Opts]),
- ?line {'EXIT',{badarg,_}} = (catch ets:update_element(Bag,key,{2,1})),
- ?line {'EXIT',{badarg,_}} = (catch ets:update_element(DBag,key,{2,1})),
+ Bag = ets_new(bag,[bag | Opts]),
+ DBag = ets_new(duplicate_bag,[duplicate_bag | Opts]),
+ {'EXIT',{badarg,_}} = (catch ets:update_element(Bag,key,{2,1})),
+ {'EXIT',{badarg,_}} = (catch ets:update_element(DBag,key,{2,1})),
true = ets:delete(Bag),
true = ets:delete(DBag),
ok.
@@ -1701,13 +1617,13 @@ update_element_neg(Opts) ->
update_element_neg_do(T) ->
Object = {key, 0, "Hej"},
- ?line true = ets:insert(T,Object),
+ true = ets:insert(T,Object),
UpdateF = fun(Arg3) ->
ArgHash = erlang:phash2({T,key,Arg3}),
- ?line {'EXIT',{badarg,_}} = (catch ets:update_element(T,key,Arg3)),
- ?line ArgHash = erlang:phash2({T,key,Arg3}),
- ?line [Object] = ets:lookup(T,key)
+ {'EXIT',{badarg,_}} = (catch ets:update_element(T,key,Arg3)),
+ ArgHash = erlang:phash2({T,key,Arg3}),
+ [Object] = ets:lookup(T,key)
end,
%% List of invalid {Pos,Value} tuples
@@ -1723,22 +1639,19 @@ update_element_neg_do(T) ->
UpdateF([{2,1} | {3,1}]),
lists:foreach(fun(InvTpl) -> UpdateF([{2,1} | InvTpl]) end, InvList),
- ?line true = ets:update_element(T,key,[]),
- ?line false = ets:update_element(T,false,[]),
- ?line false = ets:update_element(T,false,{2,1}),
- ?line ets:delete(T,key),
- ?line false = ets:update_element(T,key,{2,1}),
+ true = ets:update_element(T,key,[]),
+ false = ets:update_element(T,false,[]),
+ false = ets:update_element(T,false,{2,1}),
+ ets:delete(T,key),
+ false = ets:update_element(T,key,{2,1}),
ok.
-update_counter(doc) ->
- ["test various variants of update_counter"];
-update_counter(suite) ->
- [];
+%% test various variants of update_counter.
update_counter(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
repeat_for_opts(update_counter_do),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
update_counter_do(Opts) ->
Set = ets_new(set,Opts),
@@ -1758,26 +1671,26 @@ update_counter_do(Opts) ->
update_counter_neg(Opts).
update_counter_for(T) ->
- ?line ets:insert(T,{a,1,1}),
- ?line 101 = ets:update_counter(T,a,100),
- ?line [{a,101,1}] = ets:lookup(T,a),
- ?line 101 = ets:update_counter(T,a,{3,100}),
- ?line [{a,101,101}] = ets:lookup(T,a),
+ ets:insert(T,{a,1,1}),
+ 101 = ets:update_counter(T,a,100),
+ [{a,101,1}] = ets:lookup(T,a),
+ 101 = ets:update_counter(T,a,{3,100}),
+ [{a,101,101}] = ets:lookup(T,a),
LooperF = fun(Obj, 0, _, _) ->
Obj;
-
+
(Obj, Times, Arg3, Myself) ->
- ?line {NewObj, Ret} = uc_mimic(Obj,Arg3),
+ {NewObj, Ret} = uc_mimic(Obj,Arg3),
ArgHash = erlang:phash2({T,a,Arg3}),
%%io:format("update_counter(~p, ~p, ~p) expecting ~p\n",[T,a,Arg3,Ret]),
[DefaultObj] = ets:lookup(T, a),
- ?line Ret = ets:update_counter(T,a,Arg3),
+ Ret = ets:update_counter(T,a,Arg3),
Ret = ets:update_counter(T, b, Arg3, DefaultObj), % Use other key
- ?line ArgHash = erlang:phash2({T,a,Arg3}),
+ ArgHash = erlang:phash2({T,a,Arg3}),
%%io:format("NewObj=~p~n ",[NewObj]),
- ?line [NewObj] = ets:lookup(T,a),
+ [NewObj] = ets:lookup(T,a),
true = ets:lookup(T, b) =:= [setelement(1, NewObj, b)],
ets:delete(T, b),
Myself(NewObj,Times-1,Arg3,Myself)
@@ -1795,78 +1708,78 @@ update_counter_for(T) ->
Steps = 100,
Obj0 = {a,0,0,0,0},
- ?line ets:insert(T,Obj0),
- ?line Obj1 = LoopF(Obj0, Steps, {2,(SmallMax32 div Steps)*2}),
- ?line Obj2 = LoopF(Obj1, Steps, {3,(SmallMax64 div Steps)*2}),
- ?line Obj3 = LoopF(Obj2, Steps, {4,(Big1Max32 div Steps)*2}),
- ?line Obj4 = LoopF(Obj3, Steps, {5,(Big1Max64 div Steps)*2}),
-
- ?line Obj5 = LoopF(Obj4, Steps, {2,-(SmallMax32 div Steps)*4}),
- ?line Obj6 = LoopF(Obj5, Steps, {3,-(SmallMax64 div Steps)*4}),
- ?line Obj7 = LoopF(Obj6, Steps, {4,-(Big1Max32 div Steps)*4}),
- ?line Obj8 = LoopF(Obj7, Steps, {5,-(Big1Max64 div Steps)*4}),
-
- ?line Obj9 = LoopF(Obj8, Steps, {2,(SmallMax32 div Steps)*2}),
- ?line ObjA = LoopF(Obj9, Steps, {3,(SmallMax64 div Steps)*2}),
- ?line ObjB = LoopF(ObjA, Steps, {4,(Big1Max32 div Steps)*2}),
- ?line Obj0 = LoopF(ObjB, Steps, {5,(Big1Max64 div Steps)*2}),
+ ets:insert(T,Obj0),
+ Obj1 = LoopF(Obj0, Steps, {2,(SmallMax32 div Steps)*2}),
+ Obj2 = LoopF(Obj1, Steps, {3,(SmallMax64 div Steps)*2}),
+ Obj3 = LoopF(Obj2, Steps, {4,(Big1Max32 div Steps)*2}),
+ Obj4 = LoopF(Obj3, Steps, {5,(Big1Max64 div Steps)*2}),
+
+ Obj5 = LoopF(Obj4, Steps, {2,-(SmallMax32 div Steps)*4}),
+ Obj6 = LoopF(Obj5, Steps, {3,-(SmallMax64 div Steps)*4}),
+ Obj7 = LoopF(Obj6, Steps, {4,-(Big1Max32 div Steps)*4}),
+ Obj8 = LoopF(Obj7, Steps, {5,-(Big1Max64 div Steps)*4}),
+
+ Obj9 = LoopF(Obj8, Steps, {2,(SmallMax32 div Steps)*2}),
+ ObjA = LoopF(Obj9, Steps, {3,(SmallMax64 div Steps)*2}),
+ ObjB = LoopF(ObjA, Steps, {4,(Big1Max32 div Steps)*2}),
+ Obj0 = LoopF(ObjB, Steps, {5,(Big1Max64 div Steps)*2}),
%% back at zero, same trip again with lists
- ?line Obj4 = LoopF(Obj0,Steps,[{2, (SmallMax32 div Steps)*2},
- {3, (SmallMax64 div Steps)*2},
- {4, (Big1Max32 div Steps)*2},
- {5, (Big1Max64 div Steps)*2}]),
+ Obj4 = LoopF(Obj0,Steps,[{2, (SmallMax32 div Steps)*2},
+ {3, (SmallMax64 div Steps)*2},
+ {4, (Big1Max32 div Steps)*2},
+ {5, (Big1Max64 div Steps)*2}]),
- ?line Obj8 = LoopF(Obj4,Steps,[{4, -(Big1Max32 div Steps)*4},
- {2, -(SmallMax32 div Steps)*4},
- {5, -(Big1Max64 div Steps)*4},
- {3, -(SmallMax64 div Steps)*4}]),
+ Obj8 = LoopF(Obj4,Steps,[{4, -(Big1Max32 div Steps)*4},
+ {2, -(SmallMax32 div Steps)*4},
+ {5, -(Big1Max64 div Steps)*4},
+ {3, -(SmallMax64 div Steps)*4}]),
- ?line Obj0 = LoopF(Obj8,Steps,[{5, (Big1Max64 div Steps)*2},
- {2, (SmallMax32 div Steps)*2},
- {4, (Big1Max32 div Steps)*2},
- {3, (SmallMax64 div Steps)*2}]),
+ Obj0 = LoopF(Obj8,Steps,[{5, (Big1Max64 div Steps)*2},
+ {2, (SmallMax32 div Steps)*2},
+ {4, (Big1Max32 div Steps)*2},
+ {3, (SmallMax64 div Steps)*2}]),
%% make them shift size at the same time
- ?line ObjC = LoopF(Obj0,Steps,[{5, (Big1Max64 div Steps)*2},
- {3, (Big1Max64 div Steps)*2 + 1},
- {2, -(Big1Max64 div Steps)*2},
- {4, -(Big1Max64 div Steps)*2 + 1}]),
+ ObjC = LoopF(Obj0,Steps,[{5, (Big1Max64 div Steps)*2},
+ {3, (Big1Max64 div Steps)*2 + 1},
+ {2, -(Big1Max64 div Steps)*2},
+ {4, -(Big1Max64 div Steps)*2 + 1}]),
%% update twice in same list
- ?line ObjD = LoopF(ObjC,Steps,[{5, -(Big1Max64 div Steps) + 1},
- {3, -(Big1Max64 div Steps)*2 - 1},
- {5, -(Big1Max64 div Steps) - 1},
- {4, (Big1Max64 div Steps)*2 - 1}]),
+ ObjD = LoopF(ObjC,Steps,[{5, -(Big1Max64 div Steps) + 1},
+ {3, -(Big1Max64 div Steps)*2 - 1},
+ {5, -(Big1Max64 div Steps) - 1},
+ {4, (Big1Max64 div Steps)*2 - 1}]),
- ?line Obj0 = LoopF(ObjD,Steps,[{2, (Big1Max64 div Steps) - 1},
- {4, Big1Max64*2},
- {2, (Big1Max64 div Steps) + 1},
- {4, -Big1Max64*2}]),
+ Obj0 = LoopF(ObjD,Steps,[{2, (Big1Max64 div Steps) - 1},
+ {4, Big1Max64*2},
+ {2, (Big1Max64 div Steps) + 1},
+ {4, -Big1Max64*2}]),
%% warping with list
- ?line ObjE = LoopF(Obj0,1000,
- [{3,SmallMax32*4 div 5,SmallMax32*2,-SmallMax32*2},
- {5,-SmallMax64*4 div 7,-SmallMax64*2,SmallMax64*2},
- {4,-Big1Max32*4 div 11,-Big1Max32*2,Big1Max32*2},
- {2,Big1Max64*4 div 13,Big1Max64*2,-Big1Max64*2}]),
+ ObjE = LoopF(Obj0,1000,
+ [{3,SmallMax32*4 div 5,SmallMax32*2,-SmallMax32*2},
+ {5,-SmallMax64*4 div 7,-SmallMax64*2,SmallMax64*2},
+ {4,-Big1Max32*4 div 11,-Big1Max32*2,Big1Max32*2},
+ {2,Big1Max64*4 div 13,Big1Max64*2,-Big1Max64*2}]),
%% warping without list
- ?line ObjF = LoopF(ObjE,1000,{3,SmallMax32*4 div 5,SmallMax32*2,-SmallMax32*2}),
- ?line ObjG = LoopF(ObjF,1000,{5,-SmallMax64*4 div 7,-SmallMax64*2,SmallMax64*2}),
- ?line ObjH = LoopF(ObjG,1000,{4,-Big1Max32*4 div 11,-Big1Max32*2,Big1Max32*2}),
- ?line ObjI = LoopF(ObjH,1000,{2,Big1Max64*4 div 13,Big1Max64*2,-Big1Max64*2}),
+ ObjF = LoopF(ObjE,1000,{3,SmallMax32*4 div 5,SmallMax32*2,-SmallMax32*2}),
+ ObjG = LoopF(ObjF,1000,{5,-SmallMax64*4 div 7,-SmallMax64*2,SmallMax64*2}),
+ ObjH = LoopF(ObjG,1000,{4,-Big1Max32*4 div 11,-Big1Max32*2,Big1Max32*2}),
+ ObjI = LoopF(ObjH,1000,{2,Big1Max64*4 div 13,Big1Max64*2,-Big1Max64*2}),
%% mixing it up
- ?line LoopF(ObjI,1000,
- [{3,SmallMax32*4 div 5,SmallMax32*2,-SmallMax32*2},
- {5,-SmallMax64*4 div 3},
- {3,-SmallMax32*4 div 11},
- {5,0},
- {4,1},
- {5,-SmallMax64*4 div 7,-SmallMax64*2,SmallMax64*2},
- {2,Big1Max64*4 div 13,Big1Max64*2,-Big1Max64*2}]),
+ LoopF(ObjI,1000,
+ [{3,SmallMax32*4 div 5,SmallMax32*2,-SmallMax32*2},
+ {5,-SmallMax64*4 div 3},
+ {3,-SmallMax32*4 div 11},
+ {5,0},
+ {4,1},
+ {5,-SmallMax64*4 div 7,-SmallMax64*2,SmallMax64*2},
+ {2,Big1Max64*4 div 13,Big1Max64*2,-Big1Max64*2}]),
ok.
%% uc_mimic works kind of like the real ets:update_counter
@@ -1874,19 +1787,19 @@ update_counter_for(T) ->
%% Pits = {Pos,Incr} | {Pos,Incr,Thres,Warp}
%% Returns {Updated tuple in ets, Return value from update_counter}
uc_mimic(Obj, Pits) when is_tuple(Pits) ->
- ?line Pos = element(1,Pits),
- ?line NewObj = setelement(Pos, Obj, uc_adder(element(Pos,Obj),Pits)),
- ?line {NewObj, element(Pos,NewObj)};
+ Pos = element(1,Pits),
+ NewObj = setelement(Pos, Obj, uc_adder(element(Pos,Obj),Pits)),
+ {NewObj, element(Pos,NewObj)};
uc_mimic(Obj, PitsList) when is_list(PitsList) ->
- ?line {NewObj,ValList} = uc_mimic(Obj,PitsList,[]),
- ?line {NewObj,lists:reverse(ValList)}.
+ {NewObj,ValList} = uc_mimic(Obj,PitsList,[]),
+ {NewObj,lists:reverse(ValList)}.
uc_mimic(Obj, [], Acc) ->
- ?line {Obj,Acc};
+ {Obj,Acc};
uc_mimic(Obj, [Pits|Tail], Acc) ->
- ?line {NewObj,NewVal} = uc_mimic(Obj,Pits),
- ?line uc_mimic(NewObj,Tail,[NewVal|Acc]).
+ {NewObj,NewVal} = uc_mimic(Obj,Pits),
+ uc_mimic(NewObj,Tail,[NewVal|Acc]).
uc_adder(Init, {_Pos, Add}) ->
Init + Add;
@@ -1899,34 +1812,34 @@ uc_adder(Init, {_Pos, Add, Thres, Warp}) ->
Z ->
Z
end.
-
+
update_counter_neg(Opts) ->
Set = ets_new(set,Opts),
OrdSet = ets_new(ordered_set,[ordered_set | Opts]),
update_counter_neg_for(Set),
update_counter_neg_for(OrdSet),
ets:delete(Set),
- ?line {'EXIT',{badarg,_}} = (catch ets:update_counter(Set,key,1)),
+ {'EXIT',{badarg,_}} = (catch ets:update_counter(Set,key,1)),
ets:delete(OrdSet),
- ?line {'EXIT',{badarg,_}} = (catch ets:update_counter(OrdSet,key,1)),
+ {'EXIT',{badarg,_}} = (catch ets:update_counter(OrdSet,key,1)),
- ?line Bag = ets_new(bag,[bag | Opts]),
- ?line DBag = ets_new(duplicate_bag,[duplicate_bag | Opts]),
- ?line {'EXIT',{badarg,_}} = (catch ets:update_counter(Bag,key,1)),
- ?line {'EXIT',{badarg,_}} = (catch ets:update_counter(DBag,key,1)),
+ Bag = ets_new(bag,[bag | Opts]),
+ DBag = ets_new(duplicate_bag,[duplicate_bag | Opts]),
+ {'EXIT',{badarg,_}} = (catch ets:update_counter(Bag,key,1)),
+ {'EXIT',{badarg,_}} = (catch ets:update_counter(DBag,key,1)),
true = ets:delete(Bag),
true = ets:delete(DBag),
ok.
update_counter_neg_for(T) ->
Object = {key,0,false,1},
- ?line true = ets:insert(T,Object),
+ true = ets:insert(T,Object),
UpdateF = fun(Arg3) ->
ArgHash = erlang:phash2({T,key,Arg3}),
- ?line {'EXIT',{badarg,_}} = (catch ets:update_counter(T,key,Arg3)),
- ?line ArgHash = erlang:phash2({T,key,Arg3}),
- ?line [Object] = ets:lookup(T,key)
+ {'EXIT',{badarg,_}} = (catch ets:update_counter(T,key,Arg3)),
+ ArgHash = erlang:phash2({T,key,Arg3}),
+ [Object] = ets:lookup(T,key)
end,
%% List of invalid arg3-tuples
@@ -1944,12 +1857,12 @@ update_counter_neg_for(T) ->
UpdateF([{2,1} | {4,1}]),
lists:foreach(fun(Inv) -> UpdateF([{2,1} | Inv]) end, InvList),
- ?line {'EXIT',{badarg,_}} = (catch ets:update_counter(T,false,1)),
- ?line ets:delete(T,key),
- ?line {'EXIT',{badarg,_}} = (catch ets:update_counter(T,key,1)),
+ {'EXIT',{badarg,_}} = (catch ets:update_counter(T,false,1)),
+ ets:delete(T,key),
+ {'EXIT',{badarg,_}} = (catch ets:update_counter(T,key,1)),
ok.
-
+
evil_update_counter(Config) when is_list(Config) ->
%% The code server uses ets table. Pre-load modules that might not be
%% already loaded.
@@ -1961,11 +1874,11 @@ evil_update_counter(Config) when is_list(Config) ->
repeat_for_opts(evil_update_counter_do).
evil_update_counter_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line process_flag(trap_exit, true),
- ?line Pids = [my_spawn_link(fun() -> evil_counter(I,Opts) end) || I <- lists:seq(1, 40)],
- ?line wait_for_all(gb_sets:from_list(Pids)),
- ?line verify_etsmem(EtsMem),
+ EtsMem = etsmem(),
+ process_flag(trap_exit, true),
+ Pids = [my_spawn_link(fun() -> evil_counter(I,Opts) end) || I <- lists:seq(1, 40)],
+ wait_for_all(gb_sets:from_list(Pids)),
+ verify_etsmem(EtsMem),
ok.
wait_for_all(Pids0) ->
@@ -1975,21 +1888,21 @@ wait_for_all(Pids0) ->
false ->
receive
{'EXIT',Pid,normal} ->
- ?line Pids = gb_sets:delete(Pid, Pids0),
+ Pids = gb_sets:delete(Pid, Pids0),
wait_for_all(Pids);
Other ->
io:format("unexpected: ~p\n", [Other]),
- ?line ?t:fail()
+ ct:fail(failed)
end
end.
evil_counter(I,Opts) ->
T = ets_new(a, Opts),
Start0 = case I rem 3 of
- 0 -> 16#12345678;
- 1 -> 16#12345678FFFFFFFF;
- 2 -> 16#7777777777FFFFFFFF863648726743
- end,
+ 0 -> 16#12345678;
+ 1 -> 16#12345678FFFFFFFF;
+ 2 -> 16#7777777777FFFFFFFF863648726743
+ end,
Start = Start0 + rand:uniform(100000),
ets:insert(T, {dracula,Start}),
Iter = 40000,
@@ -2005,7 +1918,7 @@ evil_counter_1(Iter, T) ->
evil_counter_1(Iter-1, T).
update_counter_with_default(Config) when is_list(Config) ->
- repeat_for_opts(update_counter_with_default_do).
+ repeat_for_opts(update_counter_with_default_do).
update_counter_with_default_do(Opts) ->
T1 = ets_new(a, [set | Opts]),
@@ -2042,20 +1955,17 @@ update_counter_with_default_do(Opts) ->
ok.
-fixtable_next(doc) ->
- ["Check that a first-next sequence always works on a fixed table"];
-fixtable_next(suite) ->
- [];
+%% Check that a first-next sequence always works on a fixed table.
fixtable_next(Config) when is_list(Config) ->
repeat_for_opts(fixtable_next_do, [write_concurrency,all_types]).
fixtable_next_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line do_fixtable_next(ets_new(set,[public | Opts])),
- ?line verify_etsmem(EtsMem).
-
+ EtsMem = etsmem(),
+ do_fixtable_next(ets_new(set,[public | Opts])),
+ verify_etsmem(EtsMem).
+
do_fixtable_next(Tab) ->
- ?line F = fun(X,T,FF) -> case X of
+ F = fun(X,T,FF) -> case X of
0 -> true;
_ ->
ets:insert(T, {X,
@@ -2064,74 +1974,70 @@ do_fixtable_next(Tab) ->
FF(X-1,T,FF)
end
end,
- ?line F(100,Tab,F),
- ?line ets:safe_fixtable(Tab,true),
- ?line First = ets:first(Tab),
- ?line ets:delete(Tab, First),
- ?line ets:next(Tab, First),
- ?line ets:match_delete(Tab,{'_','_','_'}),
- ?line '$end_of_table' = ets:next(Tab, First),
- ?line true = ets:info(Tab, fixed),
- ?line ets:safe_fixtable(Tab, false),
- ?line false = ets:info(Tab, fixed),
- ?line ets:delete(Tab).
-
-fixtable_insert(doc) ->
- ["Check inserts of deleted keys in fixed bags"];
-fixtable_insert(suite) ->
- [];
+ F(100,Tab,F),
+ ets:safe_fixtable(Tab,true),
+ First = ets:first(Tab),
+ ets:delete(Tab, First),
+ ets:next(Tab, First),
+ ets:match_delete(Tab,{'_','_','_'}),
+ '$end_of_table' = ets:next(Tab, First),
+ true = ets:info(Tab, fixed),
+ ets:safe_fixtable(Tab, false),
+ false = ets:info(Tab, fixed),
+ ets:delete(Tab).
+
+%% Check inserts of deleted keys in fixed bags.
fixtable_insert(Config) when is_list(Config) ->
Combos = [[Type,{write_concurrency,WC}] || Type<- [bag,duplicate_bag],
WC <- [false,true]],
lists:foreach(fun(Opts) -> fixtable_insert_do(Opts) end,
Combos),
ok.
-
+
fixtable_insert_do(Opts) ->
io:format("Opts = ~p\n",[Opts]),
Ets = make_table(ets, Opts, [{a,1}, {a,2}, {b,1}, {b,2}]),
ets:safe_fixtable(Ets,true),
ets:match_delete(Ets,{b,1}),
First = ets:first(Ets),
- ?line Next = case First of
- a -> b;
- b -> a
- end,
- ?line Next = ets:next(Ets,First),
+ Next = case First of
+ a -> b;
+ b -> a
+ end,
+ Next = ets:next(Ets,First),
ets:delete(Ets,Next),
- ?line '$end_of_table' = ets:next(Ets,First),
+ '$end_of_table' = ets:next(Ets,First),
ets:insert(Ets, {Next,1}),
- ?line false = ets:insert_new(Ets, {Next,1}),
- ?line Next = ets:next(Ets,First),
- ?line '$end_of_table' = ets:next(Ets,Next),
+ false = ets:insert_new(Ets, {Next,1}),
+ Next = ets:next(Ets,First),
+ '$end_of_table' = ets:next(Ets,Next),
ets:delete(Ets,Next),
'$end_of_table' = ets:next(Ets,First),
ets:insert(Ets, {Next,2}),
- ?line false = ets:insert_new(Ets, {Next,1}),
+ false = ets:insert_new(Ets, {Next,1}),
Next = ets:next(Ets,First),
'$end_of_table' = ets:next(Ets,Next),
ets:delete(Ets,First),
- ?line Next = ets:first(Ets),
- ?line '$end_of_table' = ets:next(Ets,Next),
+ Next = ets:first(Ets),
+ '$end_of_table' = ets:next(Ets,Next),
ets:delete(Ets,Next),
- ?line '$end_of_table' = ets:next(Ets,First),
- ?line true = ets:insert_new(Ets,{Next,1}),
- ?line false = ets:insert_new(Ets,{Next,2}),
- ?line Next = ets:next(Ets,First),
+ '$end_of_table' = ets:next(Ets,First),
+ true = ets:insert_new(Ets,{Next,1}),
+ false = ets:insert_new(Ets,{Next,2}),
+ Next = ets:next(Ets,First),
ets:delete_object(Ets,{Next,1}),
- ?line '$end_of_table' = ets:next(Ets,First),
- ?line true = ets:insert_new(Ets,{Next,2}),
- ?line false = ets:insert_new(Ets,{Next,1}),
- ?line Next = ets:next(Ets,First),
+ '$end_of_table' = ets:next(Ets,First),
+ true = ets:insert_new(Ets,{Next,2}),
+ false = ets:insert_new(Ets,{Next,1}),
+ Next = ets:next(Ets,First),
ets:delete(Ets,First),
ets:safe_fixtable(Ets,false),
{'EXIT',{badarg,_}} = (catch ets:next(Ets,First)),
ok.
-write_concurrency(doc) -> ["The 'write_concurrency' option"];
-write_concurrency(suite) -> [];
+%% Test the 'write_concurrency' option.
write_concurrency(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
Yes1 = ets_new(foo,[public,{write_concurrency,true}]),
Yes2 = ets_new(foo,[protected,{write_concurrency,true}]),
No1 = ets_new(foo,[private,{write_concurrency,true}]),
@@ -2151,50 +2057,49 @@ write_concurrency(Config) when is_list(Config) ->
No7 = ets_new(foo,[public,{write_concurrency,false}]),
No8 = ets_new(foo,[protected,{write_concurrency,false}]),
- ?line YesMem = ets:info(Yes1,memory),
- ?line NoHashMem = ets:info(No1,memory),
- ?line NoTreeMem = ets:info(No4,memory),
+ YesMem = ets:info(Yes1,memory),
+ NoHashMem = ets:info(No1,memory),
+ NoTreeMem = ets:info(No4,memory),
io:format("YesMem=~p NoHashMem=~p NoTreeMem=~p\n",[YesMem,NoHashMem,NoTreeMem]),
- ?line YesMem = ets:info(Yes2,memory),
- ?line YesMem = ets:info(Yes3,memory),
- ?line YesMem = ets:info(Yes4,memory),
- ?line YesMem = ets:info(Yes5,memory),
- ?line YesMem = ets:info(Yes6,memory),
- ?line NoHashMem = ets:info(No2,memory),
- ?line NoHashMem = ets:info(No3,memory),
- ?line NoTreeMem = ets:info(No5,memory),
- ?line NoTreeMem = ets:info(No6,memory),
- ?line NoHashMem = ets:info(No7,memory),
- ?line NoHashMem = ets:info(No8,memory),
-
+ YesMem = ets:info(Yes2,memory),
+ YesMem = ets:info(Yes3,memory),
+ YesMem = ets:info(Yes4,memory),
+ YesMem = ets:info(Yes5,memory),
+ YesMem = ets:info(Yes6,memory),
+ NoHashMem = ets:info(No2,memory),
+ NoHashMem = ets:info(No3,memory),
+ NoTreeMem = ets:info(No5,memory),
+ NoTreeMem = ets:info(No6,memory),
+ NoHashMem = ets:info(No7,memory),
+ NoHashMem = ets:info(No8,memory),
+
case erlang:system_info(smp_support) of
true ->
- ?line true = YesMem > NoHashMem,
- ?line true = YesMem > NoTreeMem;
+ true = YesMem > NoHashMem,
+ true = YesMem > NoTreeMem;
false ->
- ?line true = YesMem =:= NoHashMem
+ true = YesMem =:= NoHashMem
end,
- ?line {'EXIT',{badarg,_}} = (catch ets_new(foo,[public,{write_concurrency,foo}])),
- ?line {'EXIT',{badarg,_}} = (catch ets_new(foo,[public,{write_concurrency}])),
- ?line {'EXIT',{badarg,_}} = (catch ets_new(foo,[public,{write_concurrency,true,foo}])),
- ?line {'EXIT',{badarg,_}} = (catch ets_new(foo,[public,write_concurrency])),
+ {'EXIT',{badarg,_}} = (catch ets_new(foo,[public,{write_concurrency,foo}])),
+ {'EXIT',{badarg,_}} = (catch ets_new(foo,[public,{write_concurrency}])),
+ {'EXIT',{badarg,_}} = (catch ets_new(foo,[public,{write_concurrency,true,foo}])),
+ {'EXIT',{badarg,_}} = (catch ets_new(foo,[public,write_concurrency])),
lists:foreach(fun(T) -> ets:delete(T) end,
[Yes1,Yes2,Yes3,Yes4,Yes5,Yes6,
No1,No2,No3,No4,No5,No6,No7,No8]),
- ?line verify_etsmem(EtsMem),
+ verify_etsmem(EtsMem),
ok.
-
-
-heir(doc) -> ["The 'heir' option"];
-heir(suite) -> [];
+
+
+%% The 'heir' option.
heir(Config) when is_list(Config) ->
repeat_for_opts(heir_do).
heir_do(Opts) ->
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
Master = self(),
%% Different types of heir data and link/monitor relations
@@ -2203,33 +2108,33 @@ heir_do(Opts) ->
lists:seq(1,10), {17,TestFun,self()},
"The busy heir"],
Mode<-[none,link,monitor]],
- ?line lists:foreach(fun({Data,Mode})-> heir_1(Data,Mode,Opts) end,
- Combos),
-
+ lists:foreach(fun({Data,Mode})-> heir_1(Data,Mode,Opts) end,
+ Combos),
+
%% No heir
{Founder1,MrefF1} = my_spawn_monitor(fun()->heir_founder(Master,foo_data,Opts)end),
Founder1 ! {go, none},
- ?line {"No heir",Founder1} = receive_any(),
- ?line {'DOWN', MrefF1, process, Founder1, normal} = receive_any(),
- ?line undefined = ets:info(foo),
+ {"No heir",Founder1} = receive_any(),
+ {'DOWN', MrefF1, process, Founder1, normal} = receive_any(),
+ undefined = ets:info(foo),
%% An already dead heir
{Heir2,MrefH2} = my_spawn_monitor(fun()->die end),
- ?line {'DOWN', MrefH2, process, Heir2, normal} = receive_any(),
+ {'DOWN', MrefH2, process, Heir2, normal} = receive_any(),
{Founder2,MrefF2} = my_spawn_monitor(fun()->heir_founder(Master,foo_data,Opts)end),
Founder2 ! {go, Heir2},
- ?line {"No heir",Founder2} = receive_any(),
- ?line {'DOWN', MrefF2, process, Founder2, normal} = receive_any(),
- ?line undefined = ets:info(foo),
+ {"No heir",Founder2} = receive_any(),
+ {'DOWN', MrefF2, process, Founder2, normal} = receive_any(),
+ undefined = ets:info(foo),
%% When heir dies before founder
{Founder3,MrefF3} = my_spawn_monitor(fun()->heir_founder(Master,"The dying heir",Opts)end),
{Heir3,MrefH3} = my_spawn_monitor(fun()->heir_heir(Founder3)end),
Founder3 ! {go, Heir3},
- ?line {'DOWN', MrefH3, process, Heir3, normal} = receive_any(),
+ {'DOWN', MrefH3, process, Heir3, normal} = receive_any(),
Founder3 ! die_please,
- ?line {'DOWN', MrefF3, process, Founder3, normal} = receive_any(),
- ?line undefined = ets:info(foo),
+ {'DOWN', MrefF3, process, Founder3, normal} = receive_any(),
+ undefined = ets:info(foo),
%% When heir dies and pid reused before founder dies
repeat_while(fun() ->
@@ -2237,238 +2142,235 @@ heir_do(Opts) ->
{Founder4,MrefF4} = my_spawn_monitor(fun()->heir_founder(Master,"The dying heir",Opts)end),
{Heir4,MrefH4} = my_spawn_monitor(fun()->heir_heir(Founder4)end),
Founder4 ! {go, Heir4},
- ?line {'DOWN', MrefH4, process, Heir4, normal} = receive_any(),
+ {'DOWN', MrefH4, process, Heir4, normal} = receive_any(),
erts_debug:set_internal_state(next_pid, NextPidIx),
DoppelGanger = spawn_monitor_with_pid(Heir4,
- fun()-> ?line die_please = receive_any() end),
+ fun()-> die_please = receive_any() end),
Founder4 ! die_please,
- ?line {'DOWN', MrefF4, process, Founder4, normal} = receive_any(),
+ {'DOWN', MrefF4, process, Founder4, normal} = receive_any(),
case DoppelGanger of
{Heir4,MrefH4_B} ->
Heir4 ! die_please,
- ?line {'DOWN', MrefH4_B, process, Heir4, normal} = receive_any(),
- ?line undefined = ets:info(foo),
+ {'DOWN', MrefH4_B, process, Heir4, normal} = receive_any(),
+ undefined = ets:info(foo),
false;
failed ->
io:format("Failed to spawn process with pid ~p\n", [Heir4]),
true % try again
end
end),
-
- ?line verify_etsmem(EtsMem).
+
+ verify_etsmem(EtsMem).
heir_founder(Master, HeirData, Opts) ->
- ?line {go,Heir} = receive_any(),
+ {go,Heir} = receive_any(),
HeirTpl = case Heir of
none -> {heir,none};
_ -> {heir, Heir, HeirData}
end,
- ?line T = ets_new(foo,[named_table, private, HeirTpl | Opts]),
- ?line true = ets:insert(T,{key,1}),
- ?line [{key,1}] = ets:lookup(T,key),
+ T = ets_new(foo,[named_table, private, HeirTpl | Opts]),
+ true = ets:insert(T,{key,1}),
+ [{key,1}] = ets:lookup(T,key),
Self = self(),
- ?line Self = ets:info(T,owner),
- ?line case ets:info(T,heir) of
- none ->
- ?line true = (Heir =:= none) orelse (not is_process_alive(Heir)),
- Master ! {"No heir",self()};
-
- Heir ->
- ?line true = is_process_alive(Heir),
- Heir ! {table,T,HeirData},
- die_please = receive_any()
- end.
+ Self = ets:info(T,owner),
+ case ets:info(T,heir) of
+ none ->
+ true = (Heir =:= none) orelse (not is_process_alive(Heir)),
+ Master ! {"No heir",self()};
+
+ Heir ->
+ true = is_process_alive(Heir),
+ Heir ! {table,T,HeirData},
+ die_please = receive_any()
+ end.
heir_heir(Founder) ->
heir_heir(Founder, none).
heir_heir(Founder, Mode) ->
- ?line {table,T,HeirData} = receive_any(),
- ?line {'EXIT',{badarg,_}} = (catch ets:lookup(T,key)),
- ?line case HeirData of
- "The dying heir" -> exit(normal);
- _ -> ok
- end,
+ {table,T,HeirData} = receive_any(),
+ {'EXIT',{badarg,_}} = (catch ets:lookup(T,key)),
+ case HeirData of
+ "The dying heir" -> exit(normal);
+ _ -> ok
+ end,
- ?line Mref = case Mode of
- link -> process_flag(trap_exit, true),
- link(Founder);
- monitor -> erlang:monitor(process,Founder);
- none -> ok
- end,
- ?line Founder ! die_please,
- ?line Msg = case HeirData of
- "The busy heir" -> receive_any_spinning();
- _ -> receive_any()
- end,
- ?line {'ETS-TRANSFER', T, Founder, HeirData} = Msg,
- ?line foo = T,
- ?line Self = self(),
- ?line Self = ets:info(T,owner),
- ?line Self = ets:info(T,heir),
- ?line [{key,1}] = ets:lookup(T,key),
- ?line true = ets:insert(T,{key,2}),
- ?line [{key,2}] = ets:lookup(T,key),
- ?line case Mode of % Verify that EXIT or DOWN comes after ETS-TRANSFER
- link ->
- {'EXIT',Founder,normal} = receive_any(),
- process_flag(trap_exit, false);
- monitor ->
- {'DOWN', Mref, process, Founder, normal} = receive_any();
- none -> ok
- end.
+ Mref = case Mode of
+ link -> process_flag(trap_exit, true),
+ link(Founder);
+ monitor -> erlang:monitor(process,Founder);
+ none -> ok
+ end,
+ Founder ! die_please,
+ Msg = case HeirData of
+ "The busy heir" -> receive_any_spinning();
+ _ -> receive_any()
+ end,
+ {'ETS-TRANSFER', T, Founder, HeirData} = Msg,
+ foo = T,
+ Self = self(),
+ Self = ets:info(T,owner),
+ Self = ets:info(T,heir),
+ [{key,1}] = ets:lookup(T,key),
+ true = ets:insert(T,{key,2}),
+ [{key,2}] = ets:lookup(T,key),
+ case Mode of % Verify that EXIT or DOWN comes after ETS-TRANSFER
+ link ->
+ {'EXIT',Founder,normal} = receive_any(),
+ process_flag(trap_exit, false);
+ monitor ->
+ {'DOWN', Mref, process, Founder, normal} = receive_any();
+ none -> ok
+ end.
heir_1(HeirData,Mode,Opts) ->
io:format("test with heir_data = ~p\n", [HeirData]),
Master = self(),
- ?line Founder = my_spawn_link(fun() -> heir_founder(Master,HeirData,Opts) end),
+ Founder = my_spawn_link(fun() -> heir_founder(Master,HeirData,Opts) end),
io:format("founder spawned = ~p\n", [Founder]),
- ?line {Heir,Mref} = my_spawn_monitor(fun() -> heir_heir(Founder,Mode) end),
+ {Heir,Mref} = my_spawn_monitor(fun() -> heir_heir(Founder,Mode) end),
io:format("heir spawned = ~p\n", [{Heir,Mref}]),
- ?line Founder ! {go, Heir},
- ?line {'DOWN', Mref, process, Heir, normal} = receive_any().
+ Founder ! {go, Heir},
+ {'DOWN', Mref, process, Heir, normal} = receive_any().
-give_away(doc) -> ["ets:give_way/3"];
-give_away(suite) -> [];
+%% Test ets:give_way/3.
give_away(Config) when is_list(Config) ->
repeat_for_opts(give_away_do).
give_away_do(Opts) ->
- ?line T = ets_new(foo,[named_table, private | Opts]),
- ?line true = ets:insert(T,{key,1}),
- ?line [{key,1}] = ets:lookup(T,key),
+ T = ets_new(foo,[named_table, private | Opts]),
+ true = ets:insert(T,{key,1}),
+ [{key,1}] = ets:lookup(T,key),
Parent = self(),
%% Give and then give back
- ?line {Receiver,Mref} = my_spawn_monitor(fun()-> give_away_receiver(T,Parent) end),
- ?line give_me = receive_any(),
- ?line true = ets:give_away(T,Receiver,here_you_are),
- ?line {'EXIT',{badarg,_}} = (catch ets:lookup(T,key)),
- ?line Receiver ! give_back,
- ?line {'ETS-TRANSFER',T,Receiver,"Tillbakakaka"} = receive_any(),
- ?line [{key,2}] = ets:lookup(T,key),
- ?line {'DOWN', Mref, process, Receiver, normal} = receive_any(),
+ {Receiver,Mref} = my_spawn_monitor(fun()-> give_away_receiver(T,Parent) end),
+ give_me = receive_any(),
+ true = ets:give_away(T,Receiver,here_you_are),
+ {'EXIT',{badarg,_}} = (catch ets:lookup(T,key)),
+ Receiver ! give_back,
+ {'ETS-TRANSFER',T,Receiver,"Tillbakakaka"} = receive_any(),
+ [{key,2}] = ets:lookup(T,key),
+ {'DOWN', Mref, process, Receiver, normal} = receive_any(),
%% Give and then let receiver keep it
- ?line true = ets:insert(T,{key,1}),
- ?line {Receiver3,Mref3} = my_spawn_monitor(fun()-> give_away_receiver(T,Parent) end),
- ?line give_me = receive_any(),
- ?line true = ets:give_away(T,Receiver3,here_you_are),
- ?line {'EXIT',{badarg,_}} = (catch ets:lookup(T,key)),
- ?line Receiver3 ! die_please,
- ?line {'DOWN', Mref3, process, Receiver3, normal} = receive_any(),
- ?line undefined = ets:info(T),
+ true = ets:insert(T,{key,1}),
+ {Receiver3,Mref3} = my_spawn_monitor(fun()-> give_away_receiver(T,Parent) end),
+ give_me = receive_any(),
+ true = ets:give_away(T,Receiver3,here_you_are),
+ {'EXIT',{badarg,_}} = (catch ets:lookup(T,key)),
+ Receiver3 ! die_please,
+ {'DOWN', Mref3, process, Receiver3, normal} = receive_any(),
+ undefined = ets:info(T),
%% Give and then kill receiver to get back
- ?line T2 = ets_new(foo,[private | Opts]),
- ?line true = ets:insert(T2,{key,1}),
- ?line ets:setopts(T2,{heir,self(),"Som en gummiboll..."}),
- ?line {Receiver2,Mref2} = my_spawn_monitor(fun()-> give_away_receiver(T2,Parent) end),
- ?line give_me = receive_any(),
- ?line true = ets:give_away(T2,Receiver2,here_you_are),
- ?line {'EXIT',{badarg,_}} = (catch ets:lookup(T2,key)),
- ?line Receiver2 ! die_please,
- ?line {'ETS-TRANSFER',T2,Receiver2,"Som en gummiboll..."} = receive_any(),
- ?line [{key,2}] = ets:lookup(T2,key),
- ?line {'DOWN', Mref2, process, Receiver2, normal} = receive_any(),
+ T2 = ets_new(foo,[private | Opts]),
+ true = ets:insert(T2,{key,1}),
+ ets:setopts(T2,{heir,self(),"Som en gummiboll..."}),
+ {Receiver2,Mref2} = my_spawn_monitor(fun()-> give_away_receiver(T2,Parent) end),
+ give_me = receive_any(),
+ true = ets:give_away(T2,Receiver2,here_you_are),
+ {'EXIT',{badarg,_}} = (catch ets:lookup(T2,key)),
+ Receiver2 ! die_please,
+ {'ETS-TRANSFER',T2,Receiver2,"Som en gummiboll..."} = receive_any(),
+ [{key,2}] = ets:lookup(T2,key),
+ {'DOWN', Mref2, process, Receiver2, normal} = receive_any(),
%% Some negative testing
- ?line {'EXIT',{badarg,_}} = (catch ets:give_away(T2,Receiver,"To a dead one")),
- ?line {'EXIT',{badarg,_}} = (catch ets:give_away(T2,self(),"To myself")),
- ?line {'EXIT',{badarg,_}} = (catch ets:give_away(T2,"not a pid","To wrong type")),
+ {'EXIT',{badarg,_}} = (catch ets:give_away(T2,Receiver,"To a dead one")),
+ {'EXIT',{badarg,_}} = (catch ets:give_away(T2,self(),"To myself")),
+ {'EXIT',{badarg,_}} = (catch ets:give_away(T2,"not a pid","To wrong type")),
- ?line true = ets:delete(T2),
- ?line {ReceiverNeg,MrefNeg} = my_spawn_monitor(fun()-> give_away_receiver(T2,Parent) end),
- ?line give_me = receive_any(),
- ?line {'EXIT',{badarg,_}} = (catch ets:give_away(T2,ReceiverNeg,"A deleted table")),
+ true = ets:delete(T2),
+ {ReceiverNeg,MrefNeg} = my_spawn_monitor(fun()-> give_away_receiver(T2,Parent) end),
+ give_me = receive_any(),
+ {'EXIT',{badarg,_}} = (catch ets:give_away(T2,ReceiverNeg,"A deleted table")),
- ?line T3 = ets_new(foo,[public | Opts]),
+ T3 = ets_new(foo,[public | Opts]),
my_spawn_link(fun()-> {'EXIT',{badarg,_}} = (catch ets:give_away(T3,ReceiverNeg,"From non owner")),
- Parent ! done
- end),
- ?line done = receive_any(),
- ?line ReceiverNeg ! no_soup_for_you,
- ?line {'DOWN', MrefNeg, process, ReceiverNeg, normal} = receive_any(),
+ Parent ! done
+ end),
+ done = receive_any(),
+ ReceiverNeg ! no_soup_for_you,
+ {'DOWN', MrefNeg, process, ReceiverNeg, normal} = receive_any(),
ok.
give_away_receiver(T, Giver) ->
- ?line {'EXIT',{badarg,_}} = (catch ets:lookup(T,key)),
- ?line Giver ! give_me,
- ?line case receive_any() of
- {'ETS-TRANSFER',T,Giver,here_you_are} ->
- ?line [{key,1}] = ets:lookup(T,key),
- ?line true = ets:insert(T,{key,2}),
- ?line case receive_any() of
- give_back ->
- ?line true = ets:give_away(T,Giver,"Tillbakakaka"),
- ?line {'EXIT',{badarg,_}} = (catch ets:lookup(T,key));
- die_please ->
- ok
- end;
- no_soup_for_you ->
- ok
- end.
-
-
-setopts(doc) -> ["ets:setopts/2"];
-setopts(suite) -> [];
+ {'EXIT',{badarg,_}} = (catch ets:lookup(T,key)),
+ Giver ! give_me,
+ case receive_any() of
+ {'ETS-TRANSFER',T,Giver,here_you_are} ->
+ [{key,1}] = ets:lookup(T,key),
+ true = ets:insert(T,{key,2}),
+ case receive_any() of
+ give_back ->
+ true = ets:give_away(T,Giver,"Tillbakakaka"),
+ {'EXIT',{badarg,_}} = (catch ets:lookup(T,key));
+ die_please ->
+ ok
+ end;
+ no_soup_for_you ->
+ ok
+ end.
+
+
+%% Test ets:setopts/2.
setopts(Config) when is_list(Config) ->
repeat_for_opts(setopts_do,[write_concurrency,all_types]).
setopts_do(Opts) ->
Self = self(),
- ?line T = ets_new(foo,[named_table, private | Opts]),
- ?line none = ets:info(T,heir),
+ T = ets_new(foo,[named_table, private | Opts]),
+ none = ets:info(T,heir),
Heir = my_spawn_link(fun()->heir_heir(Self) end),
- ?line ets:setopts(T,{heir,Heir,"Data"}),
- ?line Heir = ets:info(T,heir),
- ?line ets:setopts(T,{heir,self(),"Data"}),
- ?line Self = ets:info(T,heir),
- ?line ets:setopts(T,[{heir,Heir,"Data"}]),
- ?line Heir = ets:info(T,heir),
- ?line ets:setopts(T,[{heir,none}]),
- ?line none = ets:info(T,heir),
-
- ?line {'EXIT',{badarg,_}} = (catch ets:setopts(T,[{heir,self(),"Data"},false])),
- ?line {'EXIT',{badarg,_}} = (catch ets:setopts(T,{heir,self()})),
- ?line {'EXIT',{badarg,_}} = (catch ets:setopts(T,{heir,false})),
- ?line {'EXIT',{badarg,_}} = (catch ets:setopts(T,heir)),
- ?line {'EXIT',{badarg,_}} = (catch ets:setopts(T,{heir,false,"Data"})),
- ?line {'EXIT',{badarg,_}} = (catch ets:setopts(T,{false,self(),"Data"})),
-
- ?line ets:setopts(T,{protection,protected}),
- ?line ets:setopts(T,{protection,public}),
- ?line ets:setopts(T,{protection,private}),
- ?line ets:setopts(T,[{protection,protected}]),
- ?line ets:setopts(T,[{protection,public}]),
- ?line ets:setopts(T,[{protection,private}]),
-
- ?line {'EXIT',{badarg,_}} = (catch ets:setopts(T,{protection})),
- ?line {'EXIT',{badarg,_}} = (catch ets:setopts(T,{protection,false})),
- ?line {'EXIT',{badarg,_}} = (catch ets:setopts(T,{protection,private,false})),
- ?line {'EXIT',{badarg,_}} = (catch ets:setopts(T,protection)),
- ?line ets:delete(T),
+ ets:setopts(T,{heir,Heir,"Data"}),
+ Heir = ets:info(T,heir),
+ ets:setopts(T,{heir,self(),"Data"}),
+ Self = ets:info(T,heir),
+ ets:setopts(T,[{heir,Heir,"Data"}]),
+ Heir = ets:info(T,heir),
+ ets:setopts(T,[{heir,none}]),
+ none = ets:info(T,heir),
+
+ {'EXIT',{badarg,_}} = (catch ets:setopts(T,[{heir,self(),"Data"},false])),
+ {'EXIT',{badarg,_}} = (catch ets:setopts(T,{heir,self()})),
+ {'EXIT',{badarg,_}} = (catch ets:setopts(T,{heir,false})),
+ {'EXIT',{badarg,_}} = (catch ets:setopts(T,heir)),
+ {'EXIT',{badarg,_}} = (catch ets:setopts(T,{heir,false,"Data"})),
+ {'EXIT',{badarg,_}} = (catch ets:setopts(T,{false,self(),"Data"})),
+
+ ets:setopts(T,{protection,protected}),
+ ets:setopts(T,{protection,public}),
+ ets:setopts(T,{protection,private}),
+ ets:setopts(T,[{protection,protected}]),
+ ets:setopts(T,[{protection,public}]),
+ ets:setopts(T,[{protection,private}]),
+
+ {'EXIT',{badarg,_}} = (catch ets:setopts(T,{protection})),
+ {'EXIT',{badarg,_}} = (catch ets:setopts(T,{protection,false})),
+ {'EXIT',{badarg,_}} = (catch ets:setopts(T,{protection,private,false})),
+ {'EXIT',{badarg,_}} = (catch ets:setopts(T,protection)),
+ ets:delete(T),
unlink(Heir),
exit(Heir, bang),
ok.
-bad_table(doc) -> ["All kinds of operations with bad table argument"];
-bad_table(suite) -> [];
+%% All kinds of operations with bad table argument.
bad_table(Config) when is_list(Config) ->
%% Open and close disk_log to stabilize etsmem.
Name = make_ref(),
- ?line File = filename:join([?config(priv_dir, Config),"bad_table.dummy"]),
- ?line {ok, Name} = disk_log:open([{name, Name}, {file, File}]),
- ?line disk_log:close(Name),
+ File = filename:join([proplists:get_value(priv_dir, Config),"bad_table.dummy"]),
+ {ok, Name} = disk_log:open([{name, Name}, {file, File}]),
+ disk_log:close(Name),
file:delete(File),
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
repeat_for_opts(fun(Opts) -> bad_table_do(Opts,File) end,
[write_concurrency, all_types]),
- ?line verify_etsmem(EtsMem),
+ verify_etsmem(EtsMem),
ok.
bad_table_do(Opts, DummyFile) ->
@@ -2552,26 +2454,23 @@ bad_table_op({Opts,Priv,Prot}, Op) ->
end.
bad_table_call(T,{F,Args,_}) ->
- ?line {'EXIT',{badarg,_}} = (catch apply(ets, F, [T|Args]));
+ {'EXIT',{badarg,_}} = (catch apply(ets, F, [T|Args]));
bad_table_call(T,{F,Args,_,tabarg_last}) ->
- ?line {'EXIT',{badarg,_}} = (catch apply(ets, F, Args++[T]));
+ {'EXIT',{badarg,_}} = (catch apply(ets, F, Args++[T]));
bad_table_call(T,{F,Args,_,{return,Return}}) ->
try
- ?line Return = apply(ets, F, [T|Args])
+ Return = apply(ets, F, [T|Args])
catch
error:badarg -> ok
end.
-rename(doc) ->
- ["Check rename of ets tables"];
-rename(suite) ->
- [];
+%% Check rename of ets tables.
rename(Config) when is_list(Config) ->
repeat_for_opts(rename_do, [write_concurrency, all_types]).
rename_do(Opts) ->
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
ets_new(foobazz,[named_table, public | Opts]),
ets:insert(foobazz,{foo,bazz}),
ungermanbazz = ets:rename(foobazz,ungermanbazz),
@@ -2579,42 +2478,38 @@ rename_do(Opts) ->
[{foo,bazz}] = ets:lookup(ungermanbazz,foo),
{'EXIT',{badarg,_}} = (catch ets:rename(ungermanbazz,"no atom")),
ets:delete(ungermanbazz),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
-rename_unnamed(doc) ->
- ["Check rename of unnamed ets table"];
-rename_unnamed(suite) ->
- [];
+%% Check rename of unnamed ets table.
rename_unnamed(Config) when is_list(Config) ->
repeat_for_opts(rename_unnamed_do,[write_concurrency,all_types]).
rename_unnamed_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line Tab = ets_new(bonkz,[public | Opts]),
- ?line {'EXIT',{badarg, _}} = (catch ets:insert(bonkz,{foo,bazz})),
- ?line bonkz = ets:info(Tab, name),
- ?line Tab = ets:rename(Tab, tjabonkz),
- ?line {'EXIT',{badarg, _}} = (catch ets:insert(tjabonkz,{foo,bazz})),
- ?line tjabonkz = ets:info(Tab, name),
- ?line ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
-
-evil_rename(doc) ->
- "Rename a table with many fixations, and at the same time delete it.";
+ EtsMem = etsmem(),
+ Tab = ets_new(bonkz,[public | Opts]),
+ {'EXIT',{badarg, _}} = (catch ets:insert(bonkz,{foo,bazz})),
+ bonkz = ets:info(Tab, name),
+ Tab = ets:rename(Tab, tjabonkz),
+ {'EXIT',{badarg, _}} = (catch ets:insert(tjabonkz,{foo,bazz})),
+ tjabonkz = ets:info(Tab, name),
+ ets:delete(Tab),
+ verify_etsmem(EtsMem).
+
+%% Rename a table with many fixations, and at the same time delete it.
evil_rename(Config) when is_list(Config) ->
- ?line evil_rename_1(old_hash, new_hash, [public,named_table]),
- ?line EtsMem = etsmem(),
- ?line evil_rename_1(old_tree, new_tree, [public,ordered_set,named_table]),
- ?line verify_etsmem(EtsMem).
+ evil_rename_1(old_hash, new_hash, [public,named_table]),
+ EtsMem = etsmem(),
+ evil_rename_1(old_tree, new_tree, [public,ordered_set,named_table]),
+ verify_etsmem(EtsMem).
evil_rename_1(Old, New, Flags) ->
- ?line process_flag(trap_exit, true),
- ?line Old = ets_new(Old, Flags),
- ?line Fixer = fun() -> ets:safe_fixtable(Old, true) end,
- ?line crazy_fixtable(15000, Fixer),
- ?line erlang:yield(),
- ?line New = ets:rename(Old, New),
- ?line erlang:yield(),
+ process_flag(trap_exit, true),
+ Old = ets_new(Old, Flags),
+ Fixer = fun() -> ets:safe_fixtable(Old, true) end,
+ crazy_fixtable(15000, Fixer),
+ erlang:yield(),
+ New = ets:rename(Old, New),
+ erlang:yield(),
ets:delete(New),
ok.
@@ -2657,19 +2552,16 @@ evil_create_fixed_tab() ->
ets:safe_fixtable(T, true),
T.
-interface_equality(doc) ->
- ["Tests that the return values and errors are equal for set's and"
- " ordered_set's where applicable"];
-interface_equality(suite) ->
- [];
+%% Tests that the return values and errors are equal for set's and
+%% ordered_set's where applicable.
interface_equality(Config) when is_list(Config) ->
repeat_for_opts(interface_equality_do).
interface_equality_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line Set = ets_new(set,[set | Opts]),
- ?line OrderedSet = ets_new(ordered_set,[ordered_set | Opts]),
- ?line F = fun(X,T,FF) -> case X of
+ EtsMem = etsmem(),
+ Set = ets_new(set,[set | Opts]),
+ OrderedSet = ets_new(ordered_set,[ordered_set | Opts]),
+ F = fun(X,T,FF) -> case X of
0 -> true;
_ ->
ets:insert(T, {X,
@@ -2678,38 +2570,38 @@ interface_equality_do(Opts) ->
FF(X-1,T,FF)
end
end,
- ?line F(100,Set,F),
- ?line F(100,OrderedSet,F),
- ?line equal_results(ets, insert, Set, OrderedSet, [{a,"a"}]),
- ?line equal_results(ets, insert, Set, OrderedSet, [{1,1,"1"}]),
- ?line equal_results(ets, lookup, Set, OrderedSet, [10]),
- ?line equal_results(ets, lookup, Set, OrderedSet, [1000]),
- ?line equal_results(ets, delete, Set, OrderedSet, [10]),
- ?line equal_results(ets, delete, Set, OrderedSet, [nott]),
- ?line equal_results(ets, lookup, Set, OrderedSet, [1000]),
- ?line equal_results(ets, insert, Set, OrderedSet, [10]),
- ?line equal_results(ets, next, Set, OrderedSet, ['$end_of_table']),
- ?line equal_results(ets, prev, Set, OrderedSet, ['$end_of_table']),
- ?line equal_results(ets, match, Set, OrderedSet, [{'_','_','_'}]),
- ?line equal_results(ets, match, Set, OrderedSet, [{'_','_','_','_'}]),
- ?line equal_results(ets, match, Set, OrderedSet, [{$3,$2,2}]),
- ?line equal_results(ets, match, Set, OrderedSet, ['_']),
- ?line equal_results(ets, match, Set, OrderedSet, ['$1']),
- ?line equal_results(ets, match, Set, OrderedSet, [{'_','$50',3}]),
- ?line equal_results(ets, match, Set, OrderedSet, [['_','$50',3]]),
- ?line equal_results(ets, match_delete, Set, OrderedSet, [{'_','_',4}]),
- ?line equal_results(ets, match_delete, Set, OrderedSet, [{'_','_',4}]),
- ?line equal_results(ets, match_object, Set, OrderedSet, [{'_','_',4}]),
- ?line equal_results(ets, match_object, Set, OrderedSet, [{'_','_',5}]),
- ?line equal_results(ets, match_object, Set, OrderedSet, [{'_','_',4}]),
- ?line equal_results(ets, match_object, Set, OrderedSet, ['_']),
- ?line equal_results(ets, match_object, Set, OrderedSet, ['$5011']),
- ?line equal_results(ets, match_delete, Set, OrderedSet, ['$20']),
- ?line equal_results(ets, lookup_element, Set, OrderedSet, [13,2]),
- ?line equal_results(ets, lookup_element, Set, OrderedSet, [13,4]),
- ?line equal_results(ets, lookup_element, Set, OrderedSet, [14,2]),
- ?line equal_results(ets, delete, Set, OrderedSet, []),
- ?line verify_etsmem(EtsMem).
+ F(100,Set,F),
+ F(100,OrderedSet,F),
+ equal_results(ets, insert, Set, OrderedSet, [{a,"a"}]),
+ equal_results(ets, insert, Set, OrderedSet, [{1,1,"1"}]),
+ equal_results(ets, lookup, Set, OrderedSet, [10]),
+ equal_results(ets, lookup, Set, OrderedSet, [1000]),
+ equal_results(ets, delete, Set, OrderedSet, [10]),
+ equal_results(ets, delete, Set, OrderedSet, [nott]),
+ equal_results(ets, lookup, Set, OrderedSet, [1000]),
+ equal_results(ets, insert, Set, OrderedSet, [10]),
+ equal_results(ets, next, Set, OrderedSet, ['$end_of_table']),
+ equal_results(ets, prev, Set, OrderedSet, ['$end_of_table']),
+ equal_results(ets, match, Set, OrderedSet, [{'_','_','_'}]),
+ equal_results(ets, match, Set, OrderedSet, [{'_','_','_','_'}]),
+ equal_results(ets, match, Set, OrderedSet, [{$3,$2,2}]),
+ equal_results(ets, match, Set, OrderedSet, ['_']),
+ equal_results(ets, match, Set, OrderedSet, ['$1']),
+ equal_results(ets, match, Set, OrderedSet, [{'_','$50',3}]),
+ equal_results(ets, match, Set, OrderedSet, [['_','$50',3]]),
+ equal_results(ets, match_delete, Set, OrderedSet, [{'_','_',4}]),
+ equal_results(ets, match_delete, Set, OrderedSet, [{'_','_',4}]),
+ equal_results(ets, match_object, Set, OrderedSet, [{'_','_',4}]),
+ equal_results(ets, match_object, Set, OrderedSet, [{'_','_',5}]),
+ equal_results(ets, match_object, Set, OrderedSet, [{'_','_',4}]),
+ equal_results(ets, match_object, Set, OrderedSet, ['_']),
+ equal_results(ets, match_object, Set, OrderedSet, ['$5011']),
+ equal_results(ets, match_delete, Set, OrderedSet, ['$20']),
+ equal_results(ets, lookup_element, Set, OrderedSet, [13,2]),
+ equal_results(ets, lookup_element, Set, OrderedSet, [13,4]),
+ equal_results(ets, lookup_element, Set, OrderedSet, [14,2]),
+ equal_results(ets, delete, Set, OrderedSet, []),
+ verify_etsmem(EtsMem).
equal_results(M, F, FirstArg1, FirstArg2 ,ACommon) ->
Res = maybe_sort((catch apply(M,F, [FirstArg1 | ACommon]))),
@@ -2717,8 +2609,6 @@ equal_results(M, F, FirstArg1, FirstArg2 ,ACommon) ->
maybe_sort(L) when is_list(L) ->
lists:sort(L);
-%maybe_sort({'EXIT',{Reason, [{Module, Function, _}|_]}}) ->
-% {'EXIT',{Reason, [{Module, Function, '_'}]}};
maybe_sort({'EXIT',{Reason, List}}) when is_list(List) ->
{'EXIT',{Reason, lists:map(fun({Module, Function, _, _}) ->
{Module, Function, '_'}
@@ -2727,30 +2617,27 @@ maybe_sort({'EXIT',{Reason, List}}) when is_list(List) ->
maybe_sort(Any) ->
Any.
-ordered_match(doc) ->
- ["Test match, match_object and match_delete in ordered set's"];
-ordered_match(suite) ->
- [];
+%% Test match, match_object and match_delete in ordered set's.
ordered_match(Config) when is_list(Config)->
repeat_for_opts(ordered_match_do).
ordered_match_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line F = fun(X,T,FF) -> case X of
- 0 -> true;
- _ ->
- ets:insert(T, {X,
- integer_to_list(X),
- X rem 10,
- X rem 100,
- X rem 1000}),
- FF(X-1,T,FF)
- end
+ EtsMem = etsmem(),
+ F = fun(X,T,FF) -> case X of
+ 0 -> true;
+ _ ->
+ ets:insert(T, {X,
+ integer_to_list(X),
+ X rem 10,
+ X rem 100,
+ X rem 1000}),
+ FF(X-1,T,FF)
+ end
end,
- ?line T1 = ets_new(xxx,[ordered_set| Opts]),
- ?line F(3000,T1,F),
- ?line [[3,3],[3,3],[3,3]] = ets:match(T1, {'_','_','$1','$2',3}),
- ?line F2 = fun(X,Rem,Res,FF) -> case X of
+ T1 = ets_new(xxx,[ordered_set| Opts]),
+ F(3000,T1,F),
+ [[3,3],[3,3],[3,3]] = ets:match(T1, {'_','_','$1','$2',3}),
+ F2 = fun(X,Rem,Res,FF) -> case X of
0 -> [];
_ ->
case X rem Rem of
@@ -2766,166 +2653,153 @@ ordered_match_do(Opts) ->
end
end
end,
- ?line OL1 = F2(3000,100,2,F2),
- ?line OL1 = ets:match_object(T1, {'_','_','_',2,'_'}),
- ?line true = ets:match_delete(T1,{'_','_','_',2,'_'}),
- ?line [] = ets:match_object(T1, {'_','_','_',2,'_'}),
- ?line OL2 = F2(3000,100,3,F2),
- ?line OL2 = ets:match_object(T1, {'_','_','_',3,'_'}),
- ?line ets:delete(T1),
- ?line verify_etsmem(EtsMem).
-
-
-ordered(doc) ->
- ["Test basic functionality in ordered_set's."];
-ordered(suite) ->
- [];
+ OL1 = F2(3000,100,2,F2),
+ OL1 = ets:match_object(T1, {'_','_','_',2,'_'}),
+ true = ets:match_delete(T1,{'_','_','_',2,'_'}),
+ [] = ets:match_object(T1, {'_','_','_',2,'_'}),
+ OL2 = F2(3000,100,3,F2),
+ OL2 = ets:match_object(T1, {'_','_','_',3,'_'}),
+ ets:delete(T1),
+ verify_etsmem(EtsMem).
+
+
+%% Test basic functionality in ordered_set's.
ordered(Config) when is_list(Config) ->
repeat_for_opts(ordered_do).
ordered_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line T = ets_new(oset, [ordered_set | Opts]),
- ?line InsList = [
- 25,26,27,28,
- 5,6,7,8,
- 21,22,23,24,
- 9,10,11,12,
- 1,2,3,4,
- 17,18,19,20,
- 13,14,15,16,
- 1 bsl 33
- ],
- ?line lists:foreach(fun(X) ->
+ EtsMem = etsmem(),
+ T = ets_new(oset, [ordered_set | Opts]),
+ InsList = [
+ 25,26,27,28,
+ 5,6,7,8,
+ 21,22,23,24,
+ 9,10,11,12,
+ 1,2,3,4,
+ 17,18,19,20,
+ 13,14,15,16,
+ 1 bsl 33
+ ],
+ lists:foreach(fun(X) ->
ets:insert(T,{X,integer_to_list(X)})
end,
InsList),
- ?line IL2 = lists:map(fun(X) -> {X,integer_to_list(X)} end, InsList),
- ?line L1 = pick_all_forward(T),
- ?line L2 = pick_all_backwards(T),
- ?line S1 = lists:sort(IL2),
- ?line S2 = lists:reverse(lists:sort(IL2)),
- ?line S1 = L1,
- ?line S2 = L2,
- ?line [{1,"1"}] = ets:slot(T,0),
- ?line [{28,"28"}] = ets:slot(T,27),
- ?line [{1 bsl 33,_}] = ets:slot(T,28),
- ?line 27 = ets:prev(T,28),
- ?line [{7,"7"}] = ets:slot(T,6),
- ?line '$end_of_table' = ets:next(T,1 bsl 33),
- ?line [{12,"12"}] = ets:slot(T,11),
- ?line '$end_of_table' = ets:slot(T,29),
- ?line [{1,"1"}] = ets:slot(T,0),
- ?line 28 = ets:prev(T,1 bsl 33),
- ?line 1 = ets:next(T,0),
- ?line pick_all_forward(T),
- ?line [{7,"7"}] = ets:slot(T,6),
- ?line L2 = pick_all_backwards(T),
- ?line [{7,"7"}] = ets:slot(T,6),
- ?line ets:delete(T),
- ?line verify_etsmem(EtsMem).
+ IL2 = lists:map(fun(X) -> {X,integer_to_list(X)} end, InsList),
+ L1 = pick_all_forward(T),
+ L2 = pick_all_backwards(T),
+ S1 = lists:sort(IL2),
+ S2 = lists:reverse(lists:sort(IL2)),
+ S1 = L1,
+ S2 = L2,
+ [{1,"1"}] = ets:slot(T,0),
+ [{28,"28"}] = ets:slot(T,27),
+ [{1 bsl 33,_}] = ets:slot(T,28),
+ 27 = ets:prev(T,28),
+ [{7,"7"}] = ets:slot(T,6),
+ '$end_of_table' = ets:next(T,1 bsl 33),
+ [{12,"12"}] = ets:slot(T,11),
+ '$end_of_table' = ets:slot(T,29),
+ [{1,"1"}] = ets:slot(T,0),
+ 28 = ets:prev(T,1 bsl 33),
+ 1 = ets:next(T,0),
+ pick_all_forward(T),
+ [{7,"7"}] = ets:slot(T,6),
+ L2 = pick_all_backwards(T),
+ [{7,"7"}] = ets:slot(T,6),
+ ets:delete(T),
+ verify_etsmem(EtsMem).
pick_all(_T,'$end_of_table',_How) ->
[];
pick_all(T,Last,How) ->
- ?line This = case How of
+ This = case How of
next ->
- ?line ets:next(T,Last);
+ ets:next(T,Last);
prev ->
- ?line ets:prev(T,Last)
+ ets:prev(T,Last)
end,
- ?line [LastObj] = ets:lookup(T,Last),
- ?line [LastObj | pick_all(T,This,How)].
+ [LastObj] = ets:lookup(T,Last),
+ [LastObj | pick_all(T,This,How)].
pick_all_forward(T) ->
- ?line pick_all(T,ets:first(T),next).
+ pick_all(T,ets:first(T),next).
pick_all_backwards(T) ->
- ?line pick_all(T,ets:last(T),prev).
-
-
+ pick_all(T,ets:last(T),prev).
-setbag(doc) -> ["Small test case for both set and bag type ets tables."];
-setbag(suite) -> [];
+
+
+%% Small test case for both set and bag type ets tables.
setbag(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line Set = ets_new(set,[set]),
- ?line Bag = ets_new(bag,[bag]),
- ?line Key = {foo,bar},
-
+ EtsMem = etsmem(),
+ Set = ets_new(set,[set]),
+ Bag = ets_new(bag,[bag]),
+ Key = {foo,bar},
+
%% insert some value
- ?line ets:insert(Set,{Key,val1}),
- ?line ets:insert(Bag,{Key,val1}),
-
+ ets:insert(Set,{Key,val1}),
+ ets:insert(Bag,{Key,val1}),
+
%% insert new value for same key again
- ?line ets:insert(Set,{Key,val2}),
- ?line ets:insert(Bag,{Key,val2}),
-
+ ets:insert(Set,{Key,val2}),
+ ets:insert(Bag,{Key,val2}),
+
%% check
- ?line [{Key,val2}] = ets:lookup(Set,Key),
- ?line [{Key,val1},{Key,val2}] = ets:lookup(Bag,Key),
+ [{Key,val2}] = ets:lookup(Set,Key),
+ [{Key,val1},{Key,val2}] = ets:lookup(Bag,Key),
true = ets:delete(Set),
true = ets:delete(Bag),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
-badnew(doc) ->
- ["Test case to check proper return values for illegal ets_new() calls."];
-badnew(suite) -> [];
+%% Test case to check proper return values for illegal ets_new() calls.
badnew(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line {'EXIT',{badarg,_}} = (catch ets_new(12,[])),
- ?line {'EXIT',{badarg,_}} = (catch ets_new({a,b},[])),
- ?line {'EXIT',{badarg,_}} = (catch ets_new(name,[foo])),
- ?line {'EXIT',{badarg,_}} = (catch ets_new(name,{bag})),
- ?line {'EXIT',{badarg,_}} = (catch ets_new(name,bag)),
- ?line verify_etsmem(EtsMem).
-
-verybadnew(doc) ->
- ["Test case to check that a not well formed list does not crash the "
- "emulator. OTP-2314 "];
-verybadnew(suite) -> [];
+ EtsMem = etsmem(),
+ {'EXIT',{badarg,_}} = (catch ets_new(12,[])),
+ {'EXIT',{badarg,_}} = (catch ets_new({a,b},[])),
+ {'EXIT',{badarg,_}} = (catch ets_new(name,[foo])),
+ {'EXIT',{badarg,_}} = (catch ets_new(name,{bag})),
+ {'EXIT',{badarg,_}} = (catch ets_new(name,bag)),
+ verify_etsmem(EtsMem).
+
+%% OTP-2314. Test case to check that a non-proper list does not
+%% crash the emulator.
verybadnew(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line {'EXIT',{badarg,_}} = (catch ets_new(verybad,[set|protected])),
- ?line verify_etsmem(EtsMem).
+ EtsMem = etsmem(),
+ {'EXIT',{badarg,_}} = (catch ets_new(verybad,[set|protected])),
+ verify_etsmem(EtsMem).
-named(doc) -> ["Small check to see if named tables work."];
-named(suite) -> [];
+%% Small check to see if named tables work.
named(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line Tab = make_table(foo,
- [named_table],
- [{key,val}]),
- ?line [{key,val}] = ets:lookup(foo,key),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
-
-keypos2(doc) -> ["Test case to check if specified keypos works."];
-keypos2(suite) -> [];
+ EtsMem = etsmem(),
+ Tab = make_table(foo,
+ [named_table],
+ [{key,val}]),
+ [{key,val}] = ets:lookup(foo,key),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
+
+%% Test case to check if specified keypos works.
keypos2(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line Tab = make_table(foo,
- [set,{keypos,2}],
- [{val,key}, {val2,key}]),
- ?line [{val2,key}] = ets:lookup(Tab,key),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
-
-privacy(doc) ->
- ["Privacy check. Check that a named(public/private/protected) table "
- "cannot be read by",
- "the wrong process(es)."];
-privacy(suite) -> [];
+ EtsMem = etsmem(),
+ Tab = make_table(foo,
+ [set,{keypos,2}],
+ [{val,key}, {val2,key}]),
+ [{val2,key}] = ets:lookup(Tab,key),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
+
+%% Privacy check. Check that a named(public/private/protected) table
+%% cannot be read by the wrong process(es).
privacy(Config) when is_list(Config) ->
repeat_for_opts(privacy_do).
privacy_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line process_flag(trap_exit,true),
- ?line Owner = my_spawn_link(?MODULE,privacy_owner,[self(),Opts]),
+ EtsMem = etsmem(),
+ process_flag(trap_exit,true),
+ Owner = my_spawn_link(?MODULE,privacy_owner,[self(),Opts]),
receive
{'EXIT',Owner,Reason} ->
- ?line exit({privacy_test,Reason});
+ exit({privacy_test,Reason});
ok ->
ok
end,
@@ -2946,21 +2820,21 @@ privacy_do(Opts) ->
Owner ! die,
receive {'EXIT',Owner,_} -> ok end,
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
privacy_check(Pub,Prot,Priv) ->
%% check read rights
- ?line [] = ets:lookup(Pub, foo),
- ?line [] = ets:lookup(Prot,foo),
- ?line {'EXIT',{badarg,_}} = (catch ets:lookup(Priv,foo)),
+ [] = ets:lookup(Pub, foo),
+ [] = ets:lookup(Prot,foo),
+ {'EXIT',{badarg,_}} = (catch ets:lookup(Priv,foo)),
%% check write rights
- ?line true = ets:insert(Pub, {1,foo}),
- ?line {'EXIT',{badarg,_}} = (catch ets:insert(Prot,{2,foo})),
- ?line {'EXIT',{badarg,_}} = (catch ets:insert(Priv,{3,foo})),
+ true = ets:insert(Pub, {1,foo}),
+ {'EXIT',{badarg,_}} = (catch ets:insert(Prot,{2,foo})),
+ {'EXIT',{badarg,_}} = (catch ets:insert(Priv,{3,foo})),
%% check that it really wasn't written, either
- ?line [] = ets:lookup(Prot,foo).
+ [] = ets:lookup(Prot,foo).
privacy_owner(Boss, Opts) ->
ets_new(pub, [public,named_table | Opts]),
@@ -2973,7 +2847,7 @@ privacy_owner_loop(Boss) ->
receive
{shift,N,Pub_Prot_Priv} ->
{Pub,Prot,Priv} = rotate_tuple(Pub_Prot_Priv, N),
-
+
ets:setopts(Pub,{protection,public}),
ets:setopts(Prot,{protection,protected}),
ets:setopts(Priv,{protection,private}),
@@ -2993,82 +2867,81 @@ rotate_tuple(Tuple, N) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-empty(doc) ->
- ["Check lookup in an empty table and lookup of a non-existing key"];
-empty(suite) -> [];
+%% Check lookup in an empty table and lookup of a non-existing key.
empty(Config) when is_list(Config) ->
repeat_for_opts(empty_do).
empty_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line Tab = ets_new(foo,Opts),
- ?line [] = ets:lookup(Tab,key),
- ?line true = ets:insert(Tab,{key2,val}),
- ?line [] = ets:lookup(Tab,key),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
-
-badinsert(doc) ->
- ["Check proper return values for illegal insert operations."];
-badinsert(suite) -> [];
+ EtsMem = etsmem(),
+ Tab = ets_new(foo,Opts),
+ [] = ets:lookup(Tab,key),
+ true = ets:insert(Tab,{key2,val}),
+ [] = ets:lookup(Tab,key),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
+
+%% Check proper return values for illegal insert operations.
badinsert(Config) when is_list(Config) ->
repeat_for_opts(badinsert_do).
badinsert_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line {'EXIT',{badarg,_}} = (catch ets:insert(foo,{key,val})),
-
- ?line Tab = ets_new(foo,Opts),
- ?line {'EXIT',{badarg,_}} = (catch ets:insert(Tab,{})),
+ EtsMem = etsmem(),
+ {'EXIT',{badarg,_}} = (catch ets:insert(foo,{key,val})),
+
+ Tab = ets_new(foo,Opts),
+ {'EXIT',{badarg,_}} = (catch ets:insert(Tab,{})),
- ?line Tab3 = ets_new(foo,[{keypos,3}| Opts]),
- ?line {'EXIT',{badarg,_}} = (catch ets:insert(Tab3,{a,b})),
+ Tab3 = ets_new(foo,[{keypos,3}| Opts]),
+ {'EXIT',{badarg,_}} = (catch ets:insert(Tab3,{a,b})),
- ?line {'EXIT',{badarg,_}} = (catch ets:insert(Tab,[key,val2])),
- ?line true = ets:delete(Tab),
- ?line true = ets:delete(Tab3),
- ?line verify_etsmem(EtsMem).
+ {'EXIT',{badarg,_}} = (catch ets:insert(Tab,[key,val2])),
+ true = ets:delete(Tab),
+ true = ets:delete(Tab3),
+ verify_etsmem(EtsMem).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-time_lookup(doc) -> ["Lookup timing."];
-time_lookup(suite) -> [];
+%% Test lookup timing.
time_lookup(Config) when is_list(Config) ->
%% just for timing, really
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
Values = repeat_for_opts(time_lookup_do),
- ?line verify_etsmem(EtsMem),
- ?line {comment,lists:flatten(io_lib:format(
- "~p ets lookups/s",[Values]))}.
+ verify_etsmem(EtsMem),
+ {comment,lists:flatten(io_lib:format(
+ "~p ets lookups/s",[Values]))}.
time_lookup_do(Opts) ->
Tab = ets_new(foo,Opts),
fill_tab(Tab,foo),
ets:insert(Tab,{{a,key},foo}),
- {Time,_} = ?t:timecall(test_server,do_times,
- [100000,ets,lookup,[Tab,{a,key}]]),
+ N = 100000,
+ {Time,_} = timer:tc(fun() -> time_lookup_many(N, Tab) end),
+ Seconds = Time / 1000000,
true = ets:delete(Tab),
- round(100000 / Time). % lookups/s
+ round(N / Seconds). % lookups/s
+
+time_lookup_many(0, _Tab) ->
+ ok;
+time_lookup_many(N, Tab) ->
+ ets:lookup(Tab, {a,key}),
+ time_lookup_many(N-1, Tab).
-badlookup(doc) ->
- ["Check proper return values from bad lookups in existing/non existing "
- " ets tables"];
-badlookup(suite) -> [];
+%% Check proper return values from bad lookups in existing/non existing
+%% ets tables.
badlookup(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line {'EXIT',{badarg,_}} = (catch ets:lookup(foo,key)),
- ?line Tab = ets_new(foo,[]),
- ?line ets:delete(Tab),
- ?line {'EXIT',{badarg,_}} = (catch ets:lookup(Tab,key)),
- ?line verify_etsmem(EtsMem).
-
-lookup_order(doc) -> ["Test that lookup returns objects in order of insertion for bag and dbag."];
-lookup_order(suite) -> [];
+ EtsMem = etsmem(),
+ {'EXIT',{badarg,_}} = (catch ets:lookup(foo,key)),
+ Tab = ets_new(foo,[]),
+ ets:delete(Tab),
+ {'EXIT',{badarg,_}} = (catch ets:lookup(Tab,key)),
+ verify_etsmem(EtsMem).
+
+%% Test that lookup returns objects in order of insertion for bag and dbag.
lookup_order(Config) when is_list(Config) ->
EtsMem = etsmem(),
repeat_for_opts(lookup_order_do, [write_concurrency,[bag,duplicate_bag]]),
- ?line verify_etsmem(EtsMem),
+ verify_etsmem(EtsMem),
ok.
lookup_order_do(Opts) ->
@@ -3105,7 +2978,7 @@ lookup_order_2(Opts, Fixed) ->
true = ets:delete(T)
end,
Combos).
-
+
check_insert({T,List0,Key},Val) ->
%%io:format("insert ~p into ~p\n",[Val,List0]),
@@ -3120,7 +2993,7 @@ check_insert({T,List0,Key},Val) ->
check_insert_new({T,List0,Key},Val) ->
%%io:format("insert_new ~p into ~p\n",[Val,List0]),
Ret = ets:insert_new(T,{Key,Val}),
- ?line Ret = (List0 =:= []),
+ Ret = (List0 =:= []),
List1 = case Ret of
true -> [{Key,Val}];
false -> List0
@@ -3139,40 +3012,39 @@ check_check(S={T,List,Key}) ->
case lists:reverse(ets:lookup(T,Key)) of
List -> ok;
ETS -> io:format("check failed:\nETS: ~p\nCHK: ~p\n", [ETS,List]),
- ?t:fail("Invalid return value from ets:lookup")
+ ct:fail("Invalid return value from ets:lookup")
end,
- ?line Items = ets:info(T,size),
- ?line Items = length(List),
+ Items = ets:info(T,size),
+ Items = length(List),
S.
-
+
fill_tab(Tab,Val) ->
- ?line ets:insert(Tab,{key,Val}),
- ?line ets:insert(Tab,{{a,144},Val}),
- ?line ets:insert(Tab,{{a,key2},Val}),
- ?line ets:insert(Tab,{14,Val}),
+ ets:insert(Tab,{key,Val}),
+ ets:insert(Tab,{{a,144},Val}),
+ ets:insert(Tab,{{a,key2},Val}),
+ ets:insert(Tab,{14,Val}),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-lookup_element_mult(doc) -> ["Multiple return elements (OTP-2386)"];
-lookup_element_mult(suite) -> [];
+%% OTP-2386. Multiple return elements.
lookup_element_mult(Config) when is_list(Config) ->
repeat_for_opts(lookup_element_mult_do).
lookup_element_mult_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line T = ets_new(service, [bag, {keypos, 2} | Opts]),
- ?line D = lists:reverse(lem_data()),
- ?line lists:foreach(fun(X) -> ets:insert(T, X) end, D),
- ?line ok = lem_crash_3(T),
- ?line ets:insert(T, {0, "heap_key"}),
- ?line ets:lookup_element(T, "heap_key", 2),
- ?line true = ets:delete(T),
- ?line verify_etsmem(EtsMem).
+ EtsMem = etsmem(),
+ T = ets_new(service, [bag, {keypos, 2} | Opts]),
+ D = lists:reverse(lem_data()),
+ lists:foreach(fun(X) -> ets:insert(T, X) end, D),
+ ok = lem_crash_3(T),
+ ets:insert(T, {0, "heap_key"}),
+ ets:lookup_element(T, "heap_key", 2),
+ true = ets:delete(T),
+ verify_etsmem(EtsMem).
lem_data() ->
[
@@ -3199,69 +3071,64 @@ lem_crash_3(T) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-delete_elem(doc) ->
- ["Check delete of an element inserted in a `filled' table."];
-delete_elem(suite) -> [];
+%% Check delete of an element inserted in a `filled' table.
delete_elem(Config) when is_list(Config) ->
repeat_for_opts(delete_elem_do, [write_concurrency, all_types]).
delete_elem_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line Tab = ets_new(foo,Opts),
- ?line fill_tab(Tab,foo),
- ?line ets:insert(Tab,{{b,key},foo}),
- ?line ets:insert(Tab,{{c,key},foo}),
- ?line true = ets:delete(Tab,{b,key}),
- ?line [] = ets:lookup(Tab,{b,key}),
- ?line [{{c,key},foo}] = ets:lookup(Tab,{c,key}),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
-
-delete_tab(doc) ->
- ["Check that ets:delete() works and releases the name of the deleted "
- "table."];
-delete_tab(suite) -> [];
+ EtsMem = etsmem(),
+ Tab = ets_new(foo,Opts),
+ fill_tab(Tab,foo),
+ ets:insert(Tab,{{b,key},foo}),
+ ets:insert(Tab,{{c,key},foo}),
+ true = ets:delete(Tab,{b,key}),
+ [] = ets:lookup(Tab,{b,key}),
+ [{{c,key},foo}] = ets:lookup(Tab,{c,key}),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
+
+%% Check that ets:delete() works and releases the name of the
+%% deleted table.
delete_tab(Config) when is_list(Config) ->
repeat_for_opts(delete_tab_do,[write_concurrency,all_types]).
delete_tab_do(Opts) ->
Name = foo,
- ?line EtsMem = etsmem(),
- ?line Name = ets_new(Name, [named_table | Opts]),
- ?line true = ets:delete(foo),
+ EtsMem = etsmem(),
+ Name = ets_new(Name, [named_table | Opts]),
+ true = ets:delete(foo),
%% The name should be available again.
- ?line Name = ets_new(Name, [named_table | Opts]),
- ?line true = ets:delete(Name),
- ?line verify_etsmem(EtsMem).
+ Name = ets_new(Name, [named_table | Opts]),
+ true = ets:delete(Name),
+ verify_etsmem(EtsMem).
-delete_large_tab(doc) ->
- "Check that ets:delete/1 works and that other processes can run.";
+%% Check that ets:delete/1 works and that other processes can run.
delete_large_tab(Config) when is_list(Config) ->
- ?line Data = [{erlang:phash2(I, 16#ffffff),I} || I <- lists:seq(1, 200000)],
- ?line EtsMem = etsmem(),
+ Data = [{erlang:phash2(I, 16#ffffff),I} || I <- lists:seq(1, 200000)],
+ EtsMem = etsmem(),
repeat_for_opts(fun(Opts) -> delete_large_tab_do(Opts,Data) end),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
delete_large_tab_do(Opts,Data) ->
- ?line delete_large_tab_1(foo_hash, Opts, Data, false),
- ?line delete_large_tab_1(foo_tree, [ordered_set | Opts], Data, false),
- ?line delete_large_tab_1(foo_hash, Opts, Data, true).
+ delete_large_tab_1(foo_hash, Opts, Data, false),
+ delete_large_tab_1(foo_tree, [ordered_set | Opts], Data, false),
+ delete_large_tab_1(foo_hash, Opts, Data, true).
delete_large_tab_1(Name, Flags, Data, Fix) ->
- ?line Tab = ets_new(Name, Flags),
- ?line ets:insert(Tab, Data),
+ Tab = ets_new(Name, Flags),
+ ets:insert(Tab, Data),
case Fix of
false -> ok;
true ->
- ?line true = ets:safe_fixtable(Tab, true),
- ?line lists:foreach(fun({K,_}) -> ets:delete(Tab, K) end, Data)
+ true = ets:safe_fixtable(Tab, true),
+ lists:foreach(fun({K,_}) -> ets:delete(Tab, K) end, Data)
end,
{priority, Prio} = process_info(self(), priority),
- ?line Deleter = self(),
- ?line [SchedTracer]
+ Deleter = self(),
+ [SchedTracer]
= start_loopers(1,
Prio,
fun (SC) ->
@@ -3281,59 +3148,59 @@ delete_large_tab_1(Name, Flags, Data, Fix) ->
end,
0),
SchedTracerMon = monitor(process, SchedTracer),
- ?line Loopers = start_loopers(erlang:system_info(schedulers),
- Prio,
- fun (_) -> erlang:yield() end,
- ok),
- ?line erlang:yield(),
- ?line 1 = erlang:trace(self(),true,[running,procs,{tracer,SchedTracer}]),
- ?line true = ets:delete(Tab),
+ Loopers = start_loopers(erlang:system_info(schedulers),
+ Prio,
+ fun (_) -> erlang:yield() end,
+ ok),
+ erlang:yield(),
+ 1 = erlang:trace(self(),true,[running,procs,{tracer,SchedTracer}]),
+ true = ets:delete(Tab),
%% The register stuff is just a trace marker
- ?line true = register(delete_large_tab_done_marker, self()),
- ?line true = unregister(delete_large_tab_done_marker),
- ?line undefined = ets:info(Tab),
- ?line ok = stop_loopers(Loopers),
- ?line receive
- {schedule_count, N} ->
- ?line io:format("~s: context switches: ~p", [Name,N]),
- if
- N >= 5 -> ?line ok;
- true -> ?line ?t:fail()
- end
- end,
+ true = register(delete_large_tab_done_marker, self()),
+ true = unregister(delete_large_tab_done_marker),
+ undefined = ets:info(Tab),
+ ok = stop_loopers(Loopers),
+ receive
+ {schedule_count, N} ->
+ io:format("~s: context switches: ~p", [Name,N]),
+ if
+ N >= 5 -> ok;
+ true -> ct:fail(failed)
+ end
+ end,
receive {'DOWN',SchedTracerMon,process,SchedTracer,_} -> ok end,
ok.
-delete_large_named_table(doc) ->
- "Delete a large name table and try to create a new table with the same name in another process.";
+%% Delete a large name table and try to create a new table with
+%% the same name in another process.
delete_large_named_table(Config) when is_list(Config) ->
- ?line Data = [{erlang:phash2(I, 16#ffffff),I} || I <- lists:seq(1, 200000)],
- ?line EtsMem = etsmem(),
+ Data = [{erlang:phash2(I, 16#ffffff),I} || I <- lists:seq(1, 200000)],
+ EtsMem = etsmem(),
repeat_for_opts(fun(Opts) -> delete_large_named_table_do(Opts,Data) end),
- ?line verify_etsmem(EtsMem),
+ verify_etsmem(EtsMem),
ok.
delete_large_named_table_do(Opts,Data) ->
- ?line delete_large_named_table_1(foo_hash, [named_table | Opts], Data, false),
- ?line delete_large_named_table_1(foo_tree, [ordered_set,named_table | Opts], Data, false),
- ?line delete_large_named_table_1(foo_hash, [named_table | Opts], Data, true).
+ delete_large_named_table_1(foo_hash, [named_table | Opts], Data, false),
+ delete_large_named_table_1(foo_tree, [ordered_set,named_table | Opts], Data, false),
+ delete_large_named_table_1(foo_hash, [named_table | Opts], Data, true).
delete_large_named_table_1(Name, Flags, Data, Fix) ->
- ?line Tab = ets_new(Name, Flags),
- ?line ets:insert(Tab, Data),
+ Tab = ets_new(Name, Flags),
+ ets:insert(Tab, Data),
case Fix of
false -> ok;
true ->
- ?line true = ets:safe_fixtable(Tab, true),
- ?line lists:foreach(fun({K,_}) -> ets:delete(Tab, K) end, Data)
+ true = ets:safe_fixtable(Tab, true),
+ lists:foreach(fun({K,_}) -> ets:delete(Tab, K) end, Data)
end,
Parent = self(),
{Pid, MRef} = my_spawn_opt(fun() ->
- receive
- ets_new ->
- ets_new(Name, [named_table])
- end
+ receive
+ ets_new ->
+ ets_new(Name, [named_table])
+ end
end,
[link, monitor]),
true = ets:delete(Tab),
@@ -3341,139 +3208,128 @@ delete_large_named_table_1(Name, Flags, Data, Fix) ->
receive {'DOWN',MRef,process,Pid,_} -> ok end,
ok.
-evil_delete(doc) ->
- "Delete a large table, and kill the process during the delete.";
+%% Delete a large table, and kill the process during the delete.
evil_delete(Config) when is_list(Config) ->
- ?line Data = [{I,I*I} || I <- lists:seq(1, 100000)],
+ Data = [{I,I*I} || I <- lists:seq(1, 100000)],
repeat_for_opts(fun(Opts) -> evil_delete_do(Opts,Data) end).
evil_delete_do(Opts,Data) ->
- ?line EtsMem = etsmem(),
- ?line evil_delete_owner(foo_hash, Opts, Data, false),
- ?line verify_etsmem(EtsMem),
- ?line evil_delete_owner(foo_hash, Opts, Data, true),
- ?line verify_etsmem(EtsMem),
- ?line evil_delete_owner(foo_tree, [ordered_set | Opts], Data, false),
- ?line verify_etsmem(EtsMem),
- ?line TabA = evil_delete_not_owner(foo_hash, Opts, Data, false),
- ?line verify_etsmem(EtsMem),
- ?line TabB = evil_delete_not_owner(foo_hash, Opts, Data, true),
- ?line verify_etsmem(EtsMem),
- ?line TabC = evil_delete_not_owner(foo_tree, [ordered_set | Opts], Data, false),
- ?line verify_etsmem(EtsMem),
- ?line lists:foreach(fun(T) -> undefined = ets:info(T) end,
- [TabA,TabB,TabC]).
+ EtsMem = etsmem(),
+ evil_delete_owner(foo_hash, Opts, Data, false),
+ verify_etsmem(EtsMem),
+ evil_delete_owner(foo_hash, Opts, Data, true),
+ verify_etsmem(EtsMem),
+ evil_delete_owner(foo_tree, [ordered_set | Opts], Data, false),
+ verify_etsmem(EtsMem),
+ TabA = evil_delete_not_owner(foo_hash, Opts, Data, false),
+ verify_etsmem(EtsMem),
+ TabB = evil_delete_not_owner(foo_hash, Opts, Data, true),
+ verify_etsmem(EtsMem),
+ TabC = evil_delete_not_owner(foo_tree, [ordered_set | Opts], Data, false),
+ verify_etsmem(EtsMem),
+ lists:foreach(fun(T) -> undefined = ets:info(T) end,
+ [TabA,TabB,TabC]).
evil_delete_not_owner(Name, Flags, Data, Fix) ->
io:format("Not owner: ~p, fix = ~p", [Name,Fix]),
- ?line Tab = ets_new(Name, [public|Flags]),
- ?line ets:insert(Tab, Data),
+ Tab = ets_new(Name, [public|Flags]),
+ ets:insert(Tab, Data),
case Fix of
false -> ok;
true ->
- ?line true = ets:safe_fixtable(Tab, true),
- ?line lists:foreach(fun({K,_}) -> ets:delete(Tab, K) end, Data)
+ true = ets:safe_fixtable(Tab, true),
+ lists:foreach(fun({K,_}) -> ets:delete(Tab, K) end, Data)
end,
- ?line Pid = my_spawn(fun() ->
- P = my_spawn_link(
- fun() ->
- receive kill -> ok end,
- erlang:yield(),
- exit(kill_linked_processes_now)
- end),
- erlang:yield(),
- P ! kill,
- true = ets:delete(Tab)
- end),
- ?line Ref = erlang:monitor(process, Pid),
- ?line receive {'DOWN',Ref,_,_,_} -> ok end,
+ Pid = my_spawn(fun() ->
+ P = my_spawn_link(
+ fun() ->
+ receive kill -> ok end,
+ erlang:yield(),
+ exit(kill_linked_processes_now)
+ end),
+ erlang:yield(),
+ P ! kill,
+ true = ets:delete(Tab)
+ end),
+ Ref = erlang:monitor(process, Pid),
+ receive {'DOWN',Ref,_,_,_} -> ok end,
Tab.
evil_delete_owner(Name, Flags, Data, Fix) ->
- ?line Fun = fun() ->
- ?line Tab = ets_new(Name, [public|Flags]),
- ?line ets:insert(Tab, Data),
- case Fix of
- false -> ok;
- true ->
- ?line true = ets:safe_fixtable(Tab, true),
- ?line lists:foreach(fun({K,_}) ->
- ets:delete(Tab, K)
- end, Data)
- end,
- erlang:yield(),
- my_spawn_link(fun() ->
- erlang:yield(),
- exit(kill_linked_processes_now)
- end),
- true = ets:delete(Tab)
- end,
- ?line Pid = my_spawn(Fun),
- ?line Ref = erlang:monitor(process, Pid),
- ?line receive {'DOWN',Ref,_,_,_} -> ok end.
-
-
-exit_large_table_owner(doc) ->
- [];
-exit_large_table_owner(suite) ->
- [];
+ Fun = fun() ->
+ Tab = ets_new(Name, [public|Flags]),
+ ets:insert(Tab, Data),
+ case Fix of
+ false -> ok;
+ true ->
+ true = ets:safe_fixtable(Tab, true),
+ lists:foreach(fun({K,_}) ->
+ ets:delete(Tab, K)
+ end, Data)
+ end,
+ erlang:yield(),
+ my_spawn_link(fun() ->
+ erlang:yield(),
+ exit(kill_linked_processes_now)
+ end),
+ true = ets:delete(Tab)
+ end,
+ Pid = my_spawn(Fun),
+ Ref = erlang:monitor(process, Pid),
+ receive {'DOWN',Ref,_,_,_} -> ok end.
+
+
exit_large_table_owner(Config) when is_list(Config) ->
- %%?line Data = [{erlang:phash2(I, 16#ffffff),I} || I <- lists:seq(1, 500000)],
- ?line FEData = fun(Do) -> repeat_while(fun(500000) -> {false,ok};
- (I) -> Do({erlang:phash2(I, 16#ffffff),I}),
- {true, I+1}
- end, 1)
- end,
- ?line EtsMem = etsmem(),
+ %%Data = [{erlang:phash2(I, 16#ffffff),I} || I <- lists:seq(1, 500000)],
+ FEData = fun(Do) -> repeat_while(fun(500000) -> {false,ok};
+ (I) -> Do({erlang:phash2(I, 16#ffffff),I}),
+ {true, I+1}
+ end, 1)
+ end,
+ EtsMem = etsmem(),
repeat_for_opts({exit_large_table_owner_do,{FEData,Config}}),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
exit_large_table_owner_do(Opts,{FEData,Config}) ->
- ?line verify_rescheduling_exit(Config, FEData, [named_table | Opts], true, 1, 1),
- ?line verify_rescheduling_exit(Config, FEData, Opts, false, 1, 1).
+ verify_rescheduling_exit(Config, FEData, [named_table | Opts], true, 1, 1),
+ verify_rescheduling_exit(Config, FEData, Opts, false, 1, 1).
-exit_many_large_table_owner(doc) -> [];
-exit_many_large_table_owner(suite) -> [];
exit_many_large_table_owner(Config) when is_list(Config) ->
- %%?line Data = [{erlang:phash2(I, 16#ffffff),I} || I <- lists:seq(1, 500000)],
- ?line FEData = fun(Do) -> repeat_while(fun(500000) -> {false,ok};
- (I) -> Do({erlang:phash2(I, 16#ffffff),I}),
- {true, I+1}
- end, 1)
- end,
- ?line EtsMem = etsmem(),
+ %%Data = [{erlang:phash2(I, 16#ffffff),I} || I <- lists:seq(1, 500000)],
+ FEData = fun(Do) -> repeat_while(fun(500000) -> {false,ok};
+ (I) -> Do({erlang:phash2(I, 16#ffffff),I}),
+ {true, I+1}
+ end, 1)
+ end,
+ EtsMem = etsmem(),
repeat_for_opts(fun(Opts) -> exit_many_large_table_owner_do(Opts,FEData,Config) end),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
exit_many_large_table_owner_do(Opts,FEData,Config) ->
- ?line verify_rescheduling_exit(Config, FEData, Opts, true, 1, 4),
- ?line verify_rescheduling_exit(Config, FEData, [named_table | Opts], false, 1, 4).
+ verify_rescheduling_exit(Config, FEData, Opts, true, 1, 4),
+ verify_rescheduling_exit(Config, FEData, [named_table | Opts], false, 1, 4).
-exit_many_tables_owner(doc) -> [];
-exit_many_tables_owner(suite) -> [];
exit_many_tables_owner(Config) when is_list(Config) ->
NoData = fun(_Do) -> ok end,
- ?line EtsMem = etsmem(),
- ?line verify_rescheduling_exit(Config, NoData, [named_table], false, 1000, 1),
- ?line verify_rescheduling_exit(Config, NoData, [named_table,{write_concurrency,true}], false, 1000, 1),
- ?line verify_etsmem(EtsMem).
+ EtsMem = etsmem(),
+ verify_rescheduling_exit(Config, NoData, [named_table], false, 1000, 1),
+ verify_rescheduling_exit(Config, NoData, [named_table,{write_concurrency,true}], false, 1000, 1),
+ verify_etsmem(EtsMem).
-exit_many_many_tables_owner(doc) -> [];
-exit_many_many_tables_owner(suite) -> [];
exit_many_many_tables_owner(Config) when is_list(Config) ->
- ?line Data = [{erlang:phash2(I, 16#ffffff),I} || I <- lists:seq(1, 50)],
- ?line FEData = fun(Do) -> lists:foreach(Do, Data) end,
+ Data = [{erlang:phash2(I, 16#ffffff),I} || I <- lists:seq(1, 50)],
+ FEData = fun(Do) -> lists:foreach(Do, Data) end,
repeat_for_opts(fun(Opts) -> exit_many_many_tables_owner_do(Opts,FEData,Config) end).
exit_many_many_tables_owner_do(Opts,FEData,Config) ->
- ?line verify_rescheduling_exit(Config, FEData, [named_table | Opts], true, 200, 5),
- ?line verify_rescheduling_exit(Config, FEData, Opts, false, 200, 5),
- ?line wait_for_test_procs(),
- ?line EtsMem = etsmem(),
- ?line verify_rescheduling_exit(Config, FEData, Opts, true, 200, 5),
- ?line verify_rescheduling_exit(Config, FEData, [named_table | Opts], false, 200, 5),
- ?line verify_etsmem(EtsMem).
-
+ verify_rescheduling_exit(Config, FEData, [named_table | Opts], true, 200, 5),
+ verify_rescheduling_exit(Config, FEData, Opts, false, 200, 5),
+ wait_for_test_procs(),
+ EtsMem = etsmem(),
+ verify_rescheduling_exit(Config, FEData, Opts, true, 200, 5),
+ verify_rescheduling_exit(Config, FEData, [named_table | Opts], false, 200, 5),
+ verify_etsmem(EtsMem).
+
count_exit_sched(TP) ->
receive
@@ -3515,11 +3371,11 @@ vre_fix_tables(Tab) ->
ok.
verify_rescheduling_exit(Config, ForEachData, Flags, Fix, NOTabs, NOProcs) ->
- ?line NoFix = 5,
- ?line TestCase = atom_to_list(?config(test_case, Config)),
- ?line Parent = self(),
- ?line KillMe = make_ref(),
- ?line PFun =
+ NoFix = 5,
+ TestCase = atom_to_list(proplists:get_value(test_case, Config)),
+ Parent = self(),
+ KillMe = make_ref(),
+ PFun =
fun () ->
repeat(
fun () ->
@@ -3537,7 +3393,7 @@ verify_rescheduling_exit(Config, ForEachData, Flags, Fix, NOTabs, NOProcs) ->
lists:seq(1,NoFix)),
KeyPos = ets:info(Tab,keypos),
ForEachData(fun(Data) ->
- ets:delete(Tab, element(KeyPos,Data))
+ ets:delete(Tab, element(KeyPos,Data))
end)
end
end,
@@ -3545,89 +3401,82 @@ verify_rescheduling_exit(Config, ForEachData, Flags, Fix, NOTabs, NOProcs) ->
Parent ! {KillMe, self()},
receive after infinity -> ok end
end,
- ?line TPs = lists:map(fun (_) ->
- ?line TP = my_spawn_link(PFun),
- ?line 1 = erlang:trace(TP, true, [exiting]),
- TP
- end,
- lists:seq(1, NOProcs)),
- ?line lists:foreach(fun (TP) ->
- receive {KillMe, TP} -> ok end
- end,
- TPs),
- ?line LPs = start_loopers(erlang:system_info(schedulers),
- normal,
- fun (_) ->
- erlang:yield()
- end,
- ok),
- ?line lists:foreach(fun (TP) ->
- ?line unlink(TP),
- ?line exit(TP, bang)
- end,
- TPs),
- ?line lists:foreach(fun (TP) ->
- ?line XScheds = count_exit_sched(TP),
- ?line ?t:format("~p XScheds=~p~n",
- [TP, XScheds]),
- ?line true = XScheds >= 5
+ TPs = lists:map(fun (_) ->
+ TP = my_spawn_link(PFun),
+ 1 = erlang:trace(TP, true, [exiting]),
+ TP
+ end,
+ lists:seq(1, NOProcs)),
+ lists:foreach(fun (TP) ->
+ receive {KillMe, TP} -> ok end
+ end,
+ TPs),
+ LPs = start_loopers(erlang:system_info(schedulers),
+ normal,
+ fun (_) ->
+ erlang:yield()
end,
- TPs),
- ?line stop_loopers(LPs),
- ?line ok.
+ ok),
+ lists:foreach(fun (TP) ->
+ unlink(TP),
+ exit(TP, bang)
+ end,
+ TPs),
+ lists:foreach(fun (TP) ->
+ XScheds = count_exit_sched(TP),
+ io:format("~p XScheds=~p~n",
+ [TP, XScheds]),
+ true = XScheds >= 5
+ end,
+ TPs),
+ stop_loopers(LPs),
+ ok.
-
-table_leak(doc) ->
- "Make sure that slots for ets tables are cleared properly.";
+
+%% Make sure that slots for ets tables are cleared properly.
table_leak(Config) when is_list(Config) ->
repeat_for_opts(fun(Opts) -> table_leak_1(Opts,20000) end).
table_leak_1(_,0) -> ok;
table_leak_1(Opts,N) ->
- ?line T = ets_new(fooflarf, Opts),
- ?line true = ets:delete(T),
+ T = ets_new(fooflarf, Opts),
+ true = ets:delete(T),
table_leak_1(Opts,N-1).
-baddelete(doc) ->
- ["Check proper return values for illegal delete operations."];
-baddelete(suite) -> [];
+%% Check proper return values for illegal delete operations.
baddelete(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line {'EXIT',{badarg,_}} = (catch ets:delete(foo)),
- ?line Tab = ets_new(foo,[]),
- ?line true = ets:delete(Tab),
- ?line {'EXIT',{badarg,_}} = (catch ets:delete(Tab)),
- ?line verify_etsmem(EtsMem).
-
-match_delete(doc) ->
- ["Check that match_delete works. Also tests tab2list function."];
-match_delete(suite) -> [];
+ EtsMem = etsmem(),
+ {'EXIT',{badarg,_}} = (catch ets:delete(foo)),
+ Tab = ets_new(foo,[]),
+ true = ets:delete(Tab),
+ {'EXIT',{badarg,_}} = (catch ets:delete(Tab)),
+ verify_etsmem(EtsMem).
+
+%% Check that match_delete works. Also tests tab2list function.
match_delete(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
repeat_for_opts(match_delete_do,[write_concurrency,all_types]),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
match_delete_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line Tab = ets_new(kad,Opts),
- ?line fill_tab(Tab,foo),
- ?line ets:insert(Tab,{{c,key},bar}),
- ?line _ = ets:match_delete(Tab,{'_',foo}),
- ?line [{{c,key},bar}] = ets:tab2list(Tab),
- ?line _ = ets:match_delete(Tab,'_'),
- ?line [] = ets:tab2list(Tab),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
-
-match_delete3(doc) ->
- ["OTP-3005: check match_delete with constant argument."];
-match_delete3(suite) -> [];
+ EtsMem = etsmem(),
+ Tab = ets_new(kad,Opts),
+ fill_tab(Tab,foo),
+ ets:insert(Tab,{{c,key},bar}),
+ _ = ets:match_delete(Tab,{'_',foo}),
+ [{{c,key},bar}] = ets:tab2list(Tab),
+ _ = ets:match_delete(Tab,'_'),
+ [] = ets:tab2list(Tab),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
+
+%% OTP-3005: check match_delete with constant argument.
match_delete3(Config) when is_list(Config) ->
repeat_for_opts(match_delete3_do).
match_delete3_do(Opts) ->
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
T = make_table(test,
[duplicate_bag | Opts],
[{aa,17},
@@ -3642,41 +3491,40 @@ match_delete3_do(Opts) ->
ets:match_delete(T, {cA,1000}),
[] = ets:match_object(T, {'_', 1000}),
ets:delete(T),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-firstnext(doc) -> ["Tests ets:first/1 & ets:next/2."];
-firstnext(suite) -> [];
+%% Test ets:first/1 & ets:next/2.
firstnext(Config) when is_list(Config) ->
repeat_for_opts(firstnext_do).
firstnext_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line Tab = ets_new(foo,Opts),
- ?line [] = firstnext_collect(Tab,ets:first(Tab),[]),
- ?line fill_tab(Tab,foo),
- ?line Len = length(ets:tab2list(Tab)),
- ?line Len = length(firstnext_collect(Tab,ets:first(Tab),[])),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
+ EtsMem = etsmem(),
+ Tab = ets_new(foo,Opts),
+ [] = firstnext_collect(Tab,ets:first(Tab),[]),
+ fill_tab(Tab,foo),
+ Len = length(ets:tab2list(Tab)),
+ Len = length(firstnext_collect(Tab,ets:first(Tab),[])),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
firstnext_collect(_Tab,'$end_of_table',List) ->
- ?line List;
+ List;
firstnext_collect(Tab,Key,List) ->
- ?line firstnext_collect(Tab,ets:next(Tab,Key),[Key|List]).
+ firstnext_collect(Tab,ets:next(Tab,Key),[Key|List]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-firstnext_concurrent(doc) -> "Tests ets:first/1 & ets:next/2.";
+%% Tests ets:first/1 & ets:next/2.
firstnext_concurrent(Config) when is_list(Config) ->
register(master, self()),
ets_init(?MODULE, 20),
[dynamic_go() || _ <- lists:seq(1, 2)],
receive
- after 5000 -> ok
+ after 5000 -> ok
end.
ets_init(Tab, N) ->
@@ -3707,98 +3555,94 @@ dyn_lookup(T, K) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-slot(suite) -> [];
slot(Config) when is_list(Config) ->
repeat_for_opts(slot_do).
slot_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line Tab = ets_new(foo,Opts),
- ?line fill_tab(Tab,foo),
- ?line Elts = ets:info(Tab,size),
- ?line Elts = slot_loop(Tab,0,0),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
+ EtsMem = etsmem(),
+ Tab = ets_new(foo,Opts),
+ fill_tab(Tab,foo),
+ Elts = ets:info(Tab,size),
+ Elts = slot_loop(Tab,0,0),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
slot_loop(Tab,SlotNo,EltsSoFar) ->
- ?line case ets:slot(Tab,SlotNo) of
- '$end_of_table' ->
- ?line {'EXIT',{badarg,_}} =
- (catch ets:slot(Tab,SlotNo+1)),
- ?line EltsSoFar;
- Elts ->
- ?line slot_loop(Tab,SlotNo+1,EltsSoFar+length(Elts))
+ case ets:slot(Tab,SlotNo) of
+ '$end_of_table' ->
+ {'EXIT',{badarg,_}} =
+ (catch ets:slot(Tab,SlotNo+1)),
+ EltsSoFar;
+ Elts ->
+ slot_loop(Tab,SlotNo+1,EltsSoFar+length(Elts))
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-match1(suite) -> [];
match1(Config) when is_list(Config) ->
repeat_for_opts(match1_do).
match1_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line Tab = ets_new(foo,Opts),
- ?line fill_tab(Tab,foo),
- ?line [] = ets:match(Tab,{}),
- ?line ets:insert(Tab,{{one,4},4}),
- ?line ets:insert(Tab,{{one,5},5}),
- ?line ets:insert(Tab,{{two,4},4}),
- ?line ets:insert(Tab,{{two,5},6}),
- ?line case ets:match(Tab,{{one,'_'},'$0'}) of
- [[4],[5]] -> ok;
- [[5],[4]] -> ok
- end,
- ?line case ets:match(Tab,{{two,'$1'},'$0'}) of
- [[4,4],[6,5]] -> ok;
- [[6,5],[4,4]] -> ok
- end,
- ?line case ets:match(Tab,{{two,'$9'},'$4'}) of
- [[4,4],[6,5]] -> ok;
- [[6,5],[4,4]] -> ok
- end,
- ?line case ets:match(Tab,{{two,'$9'},'$22'}) of
- [[4,4],[5,6]] -> ok;
- [[5,6],[4,4]] -> ok
- end,
- ?line [[4]] = ets:match(Tab,{{two,'$0'},'$0'}),
- ?line Len = length(ets:match(Tab,'$0')),
- ?line Len = length(ets:match(Tab,'_')),
- ?line if Len > 4 -> ok end,
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
-
-match2(doc) -> ["Tests match with specified keypos bag table."];
-match2(suite) -> [];
+ EtsMem = etsmem(),
+ Tab = ets_new(foo,Opts),
+ fill_tab(Tab,foo),
+ [] = ets:match(Tab,{}),
+ ets:insert(Tab,{{one,4},4}),
+ ets:insert(Tab,{{one,5},5}),
+ ets:insert(Tab,{{two,4},4}),
+ ets:insert(Tab,{{two,5},6}),
+ case ets:match(Tab,{{one,'_'},'$0'}) of
+ [[4],[5]] -> ok;
+ [[5],[4]] -> ok
+ end,
+ case ets:match(Tab,{{two,'$1'},'$0'}) of
+ [[4,4],[6,5]] -> ok;
+ [[6,5],[4,4]] -> ok
+ end,
+ case ets:match(Tab,{{two,'$9'},'$4'}) of
+ [[4,4],[6,5]] -> ok;
+ [[6,5],[4,4]] -> ok
+ end,
+ case ets:match(Tab,{{two,'$9'},'$22'}) of
+ [[4,4],[5,6]] -> ok;
+ [[5,6],[4,4]] -> ok
+ end,
+ [[4]] = ets:match(Tab,{{two,'$0'},'$0'}),
+ Len = length(ets:match(Tab,'$0')),
+ Len = length(ets:match(Tab,'_')),
+ if Len > 4 -> ok end,
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
+
+%% Test match with specified keypos bag table.
match2(Config) when is_list(Config) ->
repeat_for_opts(match2_do).
match2_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line Tab = make_table(foobar,
- [bag, named_table, {keypos, 2} | Opts],
- [{value1, key1},
- {value2_1, key2},
- {value2_2, key2},
- {value3_1, key3},
- {value3_2, key3},
- {value2_1, key2_wannabe}]),
- ?line case length(ets:match(Tab, '$1')) of
- 6 -> ok;
- _ -> ?t:fail("Length of matched list is wrong.")
- end,
- ?line [[value3_1],[value3_2]] = ets:match(Tab, {'$1', key3}),
- ?line [[key1]] = ets:match(Tab, {value1, '$1'}),
- ?line [[key2_wannabe],[key2]] = ets:match(Tab, {value2_1, '$2'}),
- ?line [] = ets:match(Tab,{'$1',nosuchkey}),
- ?line [] = ets:match(Tab,{'$1',kgY2}), % same hash as key2
- ?line [] = ets:match(Tab,{nosuchvalue,'$1'}),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
-
-match_object(doc) -> ["Some ets:match_object test."];
-match_object(suite) -> [];
+ EtsMem = etsmem(),
+ Tab = make_table(foobar,
+ [bag, named_table, {keypos, 2} | Opts],
+ [{value1, key1},
+ {value2_1, key2},
+ {value2_2, key2},
+ {value3_1, key3},
+ {value3_2, key3},
+ {value2_1, key2_wannabe}]),
+ case length(ets:match(Tab, '$1')) of
+ 6 -> ok;
+ _ -> ct:fail("Length of matched list is wrong.")
+ end,
+ [[value3_1],[value3_2]] = ets:match(Tab, {'$1', key3}),
+ [[key1]] = ets:match(Tab, {value1, '$1'}),
+ [[key2_wannabe],[key2]] = ets:match(Tab, {value2_1, '$2'}),
+ [] = ets:match(Tab,{'$1',nosuchkey}),
+ [] = ets:match(Tab,{'$1',kgY2}), % same hash as key2
+ [] = ets:match(Tab,{nosuchvalue,'$1'}),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
+
+%% Some ets:match_object tests.
match_object(Config) when is_list(Config) ->
repeat_for_opts(match_object_do).
@@ -3823,25 +3667,25 @@ match_object_do(Opts) ->
case ets:match_object(Tab, {{one, '_'}, '$0'}) of
[{{one,5},5},{{one,4},4}] -> ok;
[{{one,4},4},{{one,5},5}] -> ok;
- _ -> ?t:fail("ets:match_object() returned something funny.")
+ _ -> ct:fail("ets:match_object() returned something funny.")
end,
case ets:match_object(Tab, {{two, '$1'}, '$0'}) of
[{{two,5},6},{{two,4},4}] -> ok;
[{{two,4},4},{{two,5},6}] -> ok;
- _ -> ?t:fail("ets:match_object() returned something funny.")
+ _ -> ct:fail("ets:match_object() returned something funny.")
end,
case ets:match_object(Tab, {{two, '$9'}, '$4'}) of
[{{two,5},6},{{two,4},4}] -> ok;
[{{two,4},4},{{two,5},6}] -> ok;
- _ -> ?t:fail("ets:match_object() returned something funny.")
+ _ -> ct:fail("ets:match_object() returned something funny.")
end,
case ets:match_object(Tab, {{two, '$9'}, '$22'}) of
[{{two,5},6},{{two,4},4}] -> ok;
[{{two,4},4},{{two,5},6}] -> ok;
- _ -> ?t:fail("ets:match_object() returned something funny.")
+ _ -> ct:fail("ets:match_object() returned something funny.")
end,
- % Check that maps are inspected for variables.
+ %% Check that maps are inspected for variables.
[{#{camembert:=cabécou},7}] = ets:match_object(Tab, {#{camembert=>'_'},7}),
[{#{"hi":="hello",#{"wazzup"=>3}:="awesome","1337":="42"},9}] =
@@ -3860,13 +3704,13 @@ match_object_do(Opts) ->
{#{"1337" := "42","hi" := "hello","wazzup" := #{"awesome" := 3}},10}] -> ok;
[{#{"1337" := "42","hi" := "hello","wazzup" := #{"awesome" := 3}},10},
{#{"1337" := "42","hi" := "hello","wazzup" := "awesome"},8}] -> ok;
- _ -> ?t:fail("ets:match_object() returned something funny.")
+ _ -> ct:fail("ets:match_object() returned something funny.")
end,
case ets:match_object(Tab, {#{"hi"=>'_'},'_'}) of
[{#{"1337":="42", "hi":="hello"},_},
{#{"1337":="42", "hi":="hello"},_},
{#{"1337":="42", "hi":="hello"},_}] -> ok;
- _ -> ?t:fail("ets:match_object() returned something funny.")
+ _ -> ct:fail("ets:match_object() returned something funny.")
end,
%% match large maps
@@ -3876,98 +3720,93 @@ match_object_do(Opts) ->
%% only match a part of the map
[{#{1:=1,5:=5,99:=99,100:=100},11},{#{1:="hi",6:="hi",99:="hi"},12}] -> ok;
[{#{1:="hi",2:="hi",59:="hi"},12},{#{1:=1,2:=2,39:=39,100:=100},11}] -> ok;
- _ -> ?t:fail("ets:match_object() returned something funny.")
+ _ -> ct:fail("ets:match_object() returned something funny.")
end,
case ets:match_object(Tab, {maps:from_list([{I,'_'}||I<-Is]),'_'}) of
%% only match a part of the map
[{#{1:=1,5:=5,99:=99,100:=100},11},{#{1:="hi",6:="hi",99:="hi"},12}] -> ok;
[{#{1:="hi",2:="hi",59:="hi"},12},{#{1:=1,2:=2,39:=39,100:=100},11}] -> ok;
- _ -> ?t:fail("ets:match_object() returned something funny.")
+ _ -> ct:fail("ets:match_object() returned something funny.")
end,
{'EXIT',{badarg,_}} = (catch ets:match_object(Tab, {#{'$1'=>'_'},7})),
Mve = maps:from_list([{list_to_atom([$$|integer_to_list(I)]),'_'}||I<-Is]),
{'EXIT',{badarg,_}} = (catch ets:match_object(Tab, {Mve,11})),
- % Check that unsuccessful match returns an empty list.
+ %% Check that unsuccessful match returns an empty list.
[] = ets:match_object(Tab, {{three,'$0'}, '$92'}),
- % Check that '$0' equals '_'.
+ %% Check that '$0' equals '_'.
Len = length(ets:match_object(Tab, '$0')),
Len = length(ets:match_object(Tab, '_')),
if Len > 4 -> ok end,
true = ets:delete(Tab),
verify_etsmem(EtsMem).
-match_object2(suite) -> [];
-match_object2(doc) -> ["Tests that db_match_object does not generate "
- "a `badarg' when resuming a search with no "
- "previous matches."];
+%% Tests that db_match_object does not generate a `badarg' when
+%% resuming a search with no previous matches.
match_object2(Config) when is_list(Config) ->
repeat_for_opts(match_object2_do).
match_object2_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line Tab = ets_new(foo, [bag, {keypos, 2} | Opts]),
- ?line fill_tab2(Tab, 0, 13005), % match_db_object does 1000
- % elements per pass, might
- % change in the future.
- ?line case catch ets:match_object(Tab, {hej, '$1'}) of
- {'EXIT', _} ->
- ets:delete(Tab),
- ?t:fail("match_object EXIT:ed");
- [] ->
- io:format("Nothing matched.");
- List ->
- io:format("Matched:~p~n",[List])
- end,
+ EtsMem = etsmem(),
+ Tab = ets_new(foo, [bag, {keypos, 2} | Opts]),
+ fill_tab2(Tab, 0, 13005), % match_db_object does 1000
+ % elements per pass, might
+ % change in the future.
+ case catch ets:match_object(Tab, {hej, '$1'}) of
+ {'EXIT', _} ->
+ ets:delete(Tab),
+ ct:fail("match_object EXIT:ed");
+ [] ->
+ io:format("Nothing matched.");
+ List ->
+ io:format("Matched:~p~n",[List])
+ end,
ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tab2list(doc) -> ["Tests tab2list (OTP-3319)"];
-tab2list(suite) -> [];
+%% OTP-3319. Test tab2list.
tab2list(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line Tab = make_table(foo,
- [ordered_set],
- [{a,b}, {c,b}, {b,b}, {a,c}]),
- ?line [{a,c},{b,b},{c,b}] = ets:tab2list(Tab),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
-
-misc1(doc) -> ["Simple general small test. ",
- "If this fails, ets is in really bad shape."];
-misc1(suite) -> [];
+ EtsMem = etsmem(),
+ Tab = make_table(foo,
+ [ordered_set],
+ [{a,b}, {c,b}, {b,b}, {a,c}]),
+ [{a,c},{b,b},{c,b}] = ets:tab2list(Tab),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
+
+%% Simple general small test. If this fails, ets is in really bad
+%% shape.
misc1(Config) when is_list(Config) ->
repeat_for_opts(misc1_do).
misc1_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line Tab = ets_new(foo,Opts),
- ?line true = lists:member(Tab,ets:all()),
- ?line ets:delete(Tab),
- ?line false = lists:member(Tab,ets:all()),
- ?line case catch ets:delete(Tab) of
- {'EXIT',_Reason} ->
- ?line verify_etsmem(EtsMem);
- true ->
- ?t:fail("Delete of nonexisting table returned `true'.")
- end,
+ EtsMem = etsmem(),
+ Tab = ets_new(foo,Opts),
+ true = lists:member(Tab,ets:all()),
+ ets:delete(Tab),
+ false = lists:member(Tab,ets:all()),
+ case catch ets:delete(Tab) of
+ {'EXIT',_Reason} ->
+ verify_etsmem(EtsMem);
+ true ->
+ ct:fail("Delete of nonexisting table returned `true'.")
+ end,
ok.
-safe_fixtable(doc) -> ["Check the safe_fixtable function."];
-safe_fixtable(suite) -> [];
+%% Check the safe_fixtable function.
safe_fixtable(Config) when is_list(Config) ->
repeat_for_opts(safe_fixtable_do).
safe_fixtable_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line Tab = ets_new(foo, Opts),
- ?line fill_tab(Tab, foobar),
- ?line true = ets:safe_fixtable(Tab, true),
- ?line receive after 1 -> ok end,
- ?line true = ets:safe_fixtable(Tab, false),
+ EtsMem = etsmem(),
+ Tab = ets_new(foo, Opts),
+ fill_tab(Tab, foobar),
+ true = ets:safe_fixtable(Tab, true),
+ receive after 1 -> ok end,
+ true = ets:safe_fixtable(Tab, false),
false = ets:info(Tab,safe_fixed_monotonic_time),
false = ets:info(Tab,safe_fixed),
SysBefore = erlang:timestamp(),
@@ -4000,90 +3839,86 @@ safe_fixtable_do(Opts) ->
{FixMonTime,[{Self,1}]} = ets:info(Tab,safe_fixed_monotonic_time),
{FixSysTime,[{Self,1}]} = ets:info(Tab,safe_fixed),
%% badarg's
- ?line {'EXIT', {badarg, _}} = (catch ets:safe_fixtable(Tab, foobar)),
- ?line true = ets:info(Tab,fixed),
- ?line true = ets:safe_fixtable(Tab, false),
- ?line false = ets:info(Tab,fixed),
- ?line {'EXIT', {badarg, _}} = (catch ets:safe_fixtable(Tab, foobar)),
- ?line false = ets:info(Tab,fixed),
- ?line ets:delete(Tab),
- ?line case catch ets:safe_fixtable(Tab, true) of
- {'EXIT', _Reason} ->
- ?line verify_etsmem(EtsMem);
- _ ->
- ?t:fail("Fixtable on nonexisting table returned `true'")
- end,
+ {'EXIT', {badarg, _}} = (catch ets:safe_fixtable(Tab, foobar)),
+ true = ets:info(Tab,fixed),
+ true = ets:safe_fixtable(Tab, false),
+ false = ets:info(Tab,fixed),
+ {'EXIT', {badarg, _}} = (catch ets:safe_fixtable(Tab, foobar)),
+ false = ets:info(Tab,fixed),
+ ets:delete(Tab),
+ case catch ets:safe_fixtable(Tab, true) of
+ {'EXIT', _Reason} ->
+ verify_etsmem(EtsMem);
+ _ ->
+ ct:fail("Fixtable on nonexisting table returned `true'")
+ end,
ok.
-info(doc) -> ["Tests ets:info result for required tuples."];
-info(suite) -> [];
+%% Tests ets:info result for required tuples.
info(Config) when is_list(Config) ->
repeat_for_opts(info_do).
info_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line MeMyselfI=self(),
- ?line ThisNode=node(),
- ?line Tab = ets_new(foobar, [{keypos, 2} | Opts]),
+ EtsMem = etsmem(),
+ MeMyselfI=self(),
+ ThisNode=node(),
+ Tab = ets_new(foobar, [{keypos, 2} | Opts]),
%% Note: ets:info/1 used to return a tuple, but from R11B onwards it
%% returns a list.
- ?line Res = ets:info(Tab),
- ?line {value, {memory, _Mem}} = lists:keysearch(memory, 1, Res),
- ?line {value, {owner, MeMyselfI}} = lists:keysearch(owner, 1, Res),
- ?line {value, {name, foobar}} = lists:keysearch(name, 1, Res),
- ?line {value, {size, 0}} = lists:keysearch(size, 1, Res),
- ?line {value, {node, ThisNode}} = lists:keysearch(node, 1, Res),
- ?line {value, {named_table, false}} = lists:keysearch(named_table, 1, Res),
- ?line {value, {type, set}} = lists:keysearch(type, 1, Res),
- ?line {value, {keypos, 2}} = lists:keysearch(keypos, 1, Res),
- ?line {value, {protection, protected}} =
+ Res = ets:info(Tab),
+ {value, {memory, _Mem}} = lists:keysearch(memory, 1, Res),
+ {value, {owner, MeMyselfI}} = lists:keysearch(owner, 1, Res),
+ {value, {name, foobar}} = lists:keysearch(name, 1, Res),
+ {value, {size, 0}} = lists:keysearch(size, 1, Res),
+ {value, {node, ThisNode}} = lists:keysearch(node, 1, Res),
+ {value, {named_table, false}} = lists:keysearch(named_table, 1, Res),
+ {value, {type, set}} = lists:keysearch(type, 1, Res),
+ {value, {keypos, 2}} = lists:keysearch(keypos, 1, Res),
+ {value, {protection, protected}} =
lists:keysearch(protection, 1, Res),
- ?line true = ets:delete(Tab),
- ?line undefined = ets:info(non_existing_table_xxyy),
- ?line undefined = ets:info(non_existing_table_xxyy,type),
- ?line undefined = ets:info(non_existing_table_xxyy,node),
- ?line undefined = ets:info(non_existing_table_xxyy,named_table),
- ?line undefined = ets:info(non_existing_table_xxyy,safe_fixed_monotonic_time),
- ?line undefined = ets:info(non_existing_table_xxyy,safe_fixed),
- ?line verify_etsmem(EtsMem).
-
-dups(doc) -> ["Test various duplicate_bags stuff"];
-dups(suite) -> [];
+ true = ets:delete(Tab),
+ undefined = ets:info(non_existing_table_xxyy),
+ undefined = ets:info(non_existing_table_xxyy,type),
+ undefined = ets:info(non_existing_table_xxyy,node),
+ undefined = ets:info(non_existing_table_xxyy,named_table),
+ undefined = ets:info(non_existing_table_xxyy,safe_fixed_monotonic_time),
+ undefined = ets:info(non_existing_table_xxyy,safe_fixed),
+ verify_etsmem(EtsMem).
+
+%% Test various duplicate_bags stuff.
dups(Config) when is_list(Config) ->
repeat_for_opts(dups_do).
dups_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line T = make_table(funky,
- [duplicate_bag | Opts],
- [{1, 2}, {1, 2}]),
- ?line 2 = length(ets:tab2list(T)),
- ?line ets:delete(T, 1),
- ?line [] = ets:lookup(T, 1),
-
- ?line ets:insert(T, {1, 2, 2}),
- ?line ets:insert(T, {1, 2, 4}),
- ?line ets:insert(T, {1, 2, 2}),
- ?line ets:insert(T, {1, 2, 2}),
- ?line ets:insert(T, {1, 2, 4}),
-
- ?line 5 = length(ets:tab2list(T)),
-
- ?line 5 = length(ets:match(T, {'$1', 2, '$2'})),
- ?line 3 = length(ets:match(T, {'_', '$1', '$1'})),
- ?line ets:match_delete(T, {'_', '$1', '$1'}),
- ?line 0 = length(ets:match(T, {'_', '$1', '$1'})),
- ?line ets:delete(T),
- ?line verify_etsmem(EtsMem).
+ EtsMem = etsmem(),
+ T = make_table(funky,
+ [duplicate_bag | Opts],
+ [{1, 2}, {1, 2}]),
+ 2 = length(ets:tab2list(T)),
+ ets:delete(T, 1),
+ [] = ets:lookup(T, 1),
+
+ ets:insert(T, {1, 2, 2}),
+ ets:insert(T, {1, 2, 4}),
+ ets:insert(T, {1, 2, 2}),
+ ets:insert(T, {1, 2, 2}),
+ ets:insert(T, {1, 2, 4}),
+
+ 5 = length(ets:tab2list(T)),
+
+ 5 = length(ets:match(T, {'$1', 2, '$2'})),
+ 3 = length(ets:match(T, {'_', '$1', '$1'})),
+ ets:match_delete(T, {'_', '$1', '$1'}),
+ 0 = length(ets:match(T, {'_', '$1', '$1'})),
+ ets:delete(T),
+ verify_etsmem(EtsMem).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tab2file(doc) -> ["Check the ets:tab2file function on an empty "
- "ets table."];
-tab2file(suite) -> [];
+%% Test the ets:tab2file function on an empty ets table.
tab2file(Config) when is_list(Config) ->
- ?line FName = filename:join([?config(priv_dir, Config),"tab2file_case"]),
+ FName = filename:join([proplists:get_value(priv_dir, Config),"tab2file_case"]),
tab2file_do(FName, []),
tab2file_do(FName, [{sync,true}]),
tab2file_do(FName, [{sync,false}]),
@@ -4093,62 +3928,60 @@ tab2file(Config) when is_list(Config) ->
tab2file_do(FName, Opts) ->
%% Write an empty ets table to a file, read back and check properties.
- ?line Tab = ets_new(ets_SUITE_foo_tab, [named_table, set, public,
- {keypos, 2},
- compressed,
- {write_concurrency,true},
- {read_concurrency,true}]),
+ Tab = ets_new(ets_SUITE_foo_tab, [named_table, set, public,
+ {keypos, 2},
+ compressed,
+ {write_concurrency,true},
+ {read_concurrency,true}]),
catch file:delete(FName),
Res = ets:tab2file(Tab, FName, Opts),
true = ets:delete(Tab),
ok = Res,
- %
- ?line EtsMem = etsmem(),
- ?line {ok, Tab2} = ets:file2tab(FName),
+ %%
+ EtsMem = etsmem(),
+ {ok, Tab2} = ets:file2tab(FName),
public = ets:info(Tab2, protection),
- ?line true = ets:info(Tab2, named_table),
- ?line 2 = ets:info(Tab2, keypos),
- ?line set = ets:info(Tab2, type),
+ true = ets:info(Tab2, named_table),
+ 2 = ets:info(Tab2, keypos),
+ set = ets:info(Tab2, type),
true = ets:info(Tab2, compressed),
Smp = erlang:system_info(smp_support),
Smp = ets:info(Tab2, read_concurrency),
Smp = ets:info(Tab2, write_concurrency),
- ?line true = ets:delete(Tab2),
- ?line verify_etsmem(EtsMem).
+ true = ets:delete(Tab2),
+ verify_etsmem(EtsMem).
+
-
-tab2file2(doc) -> ["Check the ets:tab2file function on a ",
- "filled set/bag type ets table."];
-tab2file2(suite) -> [];
+%% Check the ets:tab2file function on a filled set/bag type ets table.
tab2file2(Config) when is_list(Config) ->
repeat_for_opts({tab2file2_do,Config}, [[set,bag],compressed]).
tab2file2_do(Opts, Config) ->
- ?line EtsMem = etsmem(),
- ?line Tab = ets_new(ets_SUITE_foo_tab, [named_table, private,
- {keypos, 2} | Opts]),
- ?line FName = filename:join([?config(priv_dir, Config),"tab2file2_case"]),
- ?line ok = fill_tab2(Tab, 0, 10000), % Fill up the table (grucho mucho!)
- ?line Len = length(ets:tab2list(Tab)),
- ?line Mem = ets:info(Tab, memory),
- ?line Type = ets:info(Tab, type),
+ EtsMem = etsmem(),
+ Tab = ets_new(ets_SUITE_foo_tab, [named_table, private,
+ {keypos, 2} | Opts]),
+ FName = filename:join([proplists:get_value(priv_dir, Config),"tab2file2_case"]),
+ ok = fill_tab2(Tab, 0, 10000), % Fill up the table (grucho mucho!)
+ Len = length(ets:tab2list(Tab)),
+ Mem = ets:info(Tab, memory),
+ Type = ets:info(Tab, type),
%%io:format("org tab: ~p\n",[ets:info(Tab)]),
- ?line ok = ets:tab2file(Tab, FName),
- ?line true = ets:delete(Tab),
+ ok = ets:tab2file(Tab, FName),
+ true = ets:delete(Tab),
- ?line EtsMem4 = etsmem(),
+ EtsMem4 = etsmem(),
- ?line {ok, Tab2} = ets:file2tab(FName),
+ {ok, Tab2} = ets:file2tab(FName),
%%io:format("loaded tab: ~p\n",[ets:info(Tab2)]),
- ?line private = ets:info(Tab2, protection),
- ?line true = ets:info(Tab2, named_table),
- ?line 2 = ets:info(Tab2, keypos),
- ?line Type = ets:info(Tab2, type),
- ?line Len = length(ets:tab2list(Tab2)),
- ?line Mem = ets:info(Tab2, memory),
- ?line true = ets:delete(Tab2),
+ private = ets:info(Tab2, protection),
+ true = ets:info(Tab2, named_table),
+ 2 = ets:info(Tab2, keypos),
+ Type = ets:info(Tab2, type),
+ Len = length(ets:tab2list(Tab2)),
+ Mem = ets:info(Tab2, memory),
+ true = ets:delete(Tab2),
io:format("Between = ~p\n", [EtsMem4]),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
-define(test_list, [8,5,4,1,58,125,255, 250, 245, 240, 235,
230, Num rem 255, 255, 125, 130, 135, 140, 145,
@@ -4163,33 +3996,30 @@ tab2file2_do(Opts, Config) ->
fill_tab2(_Tab, _Val, 0) ->
ok;
fill_tab2(Tab, Val, Num) ->
- ?line Item =
+ Item =
case Num rem 10 of
0 -> "String";
- 1 -> ?line ?test_atom;
- 2 -> ?line ?test_tuple;
- 3 -> ?line ?test_integer;
- 4 -> ?line ?test_float;
- 5 -> ?line list_to_binary(?test_list); %Heap binary
- 6 -> ?line list_to_binary(?big_test_list); %Refc binary
- 7 -> ?line make_sub_binary(?test_list, Num); %Sub binary
- 8 -> ?line ?test_list;
- 9 -> ?line fun(X) -> {Tab,Val,X*Num} end
+ 1 -> ?test_atom;
+ 2 -> ?test_tuple;
+ 3 -> ?test_integer;
+ 4 -> ?test_float;
+ 5 -> list_to_binary(?test_list); %Heap binary
+ 6 -> list_to_binary(?big_test_list); %Refc binary
+ 7 -> make_sub_binary(?test_list, Num); %Sub binary
+ 8 -> ?test_list;
+ 9 -> fun(X) -> {Tab,Val,X*Num} end
end,
- ?line true=ets:insert(Tab, {Item, Val}),
- ?line fill_tab2(Tab, Val+1, Num-1),
+ true=ets:insert(Tab, {Item, Val}),
+ fill_tab2(Tab, Val+1, Num-1),
ok.
-tabfile_ext1(suite) ->
- [];
-tabfile_ext1(doc) ->
- ["Tests verification of tables with object count extended_info"];
+%% Test verification of tables with object count extended_info.
tabfile_ext1(Config) when is_list(Config) ->
repeat_for_opts(fun(Opts) -> tabfile_ext1_do(Opts, Config) end).
tabfile_ext1_do(Opts,Config) ->
- ?line FName = filename:join([?config(priv_dir, Config),"nisse.dat"]),
- ?line FName2 = filename:join([?config(priv_dir, Config),"countflip.dat"]),
+ FName = filename:join([proplists:get_value(priv_dir, Config),"nisse.dat"]),
+ FName2 = filename:join([proplists:get_value(priv_dir, Config),"countflip.dat"]),
L = lists:seq(1,10),
T = ets_new(x,Opts),
Name = make_ref(),
@@ -4220,16 +4050,14 @@ tabfile_ext1_do(Opts,Config) ->
file:delete(FName2),
ok.
-tabfile_ext2(suite) ->
- [];
-tabfile_ext2(doc) ->
- ["Tests verification of tables with md5sum extended_info"];
+
+%% Test verification of tables with md5sum extended_info.
tabfile_ext2(Config) when is_list(Config) ->
repeat_for_opts(fun(Opts) -> tabfile_ext2_do(Opts,Config) end).
tabfile_ext2_do(Opts,Config) ->
- ?line FName = filename:join([?config(priv_dir, Config),"olle.dat"]),
- ?line FName2 = filename:join([?config(priv_dir, Config),"bitflip.dat"]),
+ FName = filename:join([proplists:get_value(priv_dir, Config),"olle.dat"]),
+ FName2 = filename:join([proplists:get_value(priv_dir, Config),"bitflip.dat"]),
L = lists:seq(1,10),
T = ets_new(x,Opts),
Name = make_ref(),
@@ -4260,13 +4088,10 @@ tabfile_ext2_do(Opts,Config) ->
file:delete(FName2),
ok.
-tabfile_ext3(suite) ->
- [];
-tabfile_ext3(doc) ->
- ["Tests verification of (named) tables without extended info"];
+%% Test verification of (named) tables without extended info.
tabfile_ext3(Config) when is_list(Config) ->
- ?line FName = filename:join([?config(priv_dir, Config),"namn.dat"]),
- ?line FName2 = filename:join([?config(priv_dir, Config),"ncountflip.dat"]),
+ FName = filename:join([proplists:get_value(priv_dir, Config),"namn.dat"]),
+ FName2 = filename:join([proplists:get_value(priv_dir, Config),"ncountflip.dat"]),
L = lists:seq(1,10),
Name = make_ref(),
?MODULE = ets_new(?MODULE,[named_table]),
@@ -4294,12 +4119,9 @@ tabfile_ext3(Config) when is_list(Config) ->
file:delete(FName2),
ok.
-tabfile_ext4(suite) ->
- [];
-tabfile_ext4(doc) ->
- ["Tests verification of large table with md5 sum"];
+%% Tests verification of large table with md5 sum.
tabfile_ext4(Config) when is_list(Config) ->
- ?line FName = filename:join([?config(priv_dir, Config),"bauta.dat"]),
+ FName = filename:join([proplists:get_value(priv_dir, Config),"bauta.dat"]),
LL = lists:seq(1,10000),
TL = ets_new(x,[]),
Name2 = make_ref(),
@@ -4336,12 +4158,9 @@ tabfile_ext4(Config) when is_list(Config) ->
file:delete(FName),
ok.
-badfile(suite) ->
- [];
-badfile(doc) ->
- ["Tests that no disk_log is left open when file has been corrupted"];
+%% Test that no disk_log is left open when file has been corrupted.
badfile(Config) when is_list(Config) ->
- PrivDir = ?config(priv_dir,Config),
+ PrivDir = proplists:get_value(priv_dir,Config),
File = filename:join(PrivDir, "badfile"),
_ = file:delete(File),
T = ets:new(table, []),
@@ -4397,32 +4216,31 @@ make_sub_binary(List, Num) when is_list(List) ->
%% Lookup stuff like crazy...
-heavy_lookup(doc) -> ["Performs multiple lookups for every key ",
- "in a large table."];
-heavy_lookup(suite) -> [];
+
+%% Perform multiple lookups for every key in a large table.
heavy_lookup(Config) when is_list(Config) ->
repeat_for_opts(heavy_lookup_do).
heavy_lookup_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line Tab = ets_new(foobar_table, [set, protected, {keypos, 2} | Opts]),
- ?line ok = fill_tab2(Tab, 0, 7000),
- ?line ?t:do_times(50, ?MODULE, do_lookup, [Tab, 6999]),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
+ EtsMem = etsmem(),
+ Tab = ets_new(foobar_table, [set, protected, {keypos, 2} | Opts]),
+ ok = fill_tab2(Tab, 0, 7000),
+ _ = [do_lookup(Tab, 6999) || _ <- lists:seq(1, 50)],
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
do_lookup(_Tab, 0) -> ok;
do_lookup(Tab, N) ->
case ets:lookup(Tab, N) of
- [] -> ?t:format("Set #~p was reported as empty. Not valid.",
- [N]),
- exit('Invalid lookup');
- _ -> do_lookup(Tab, N-1)
+ [] ->
+ io:format("Set #~p was reported as empty. Not valid.",
+ [N]),
+ exit('Invalid lookup');
+ _ ->
+ do_lookup(Tab, N-1)
end.
-heavy_lookup_element(doc) -> ["Performs multiple lookups for ",
- "every element in a large table."];
-heavy_lookup_element(suite) -> [];
+%% Perform multiple lookups for every element in a large table.
heavy_lookup_element(Config) when is_list(Config) ->
repeat_for_opts(heavy_lookup_element_do).
@@ -4430,22 +4248,22 @@ heavy_lookup_element_do(Opts) ->
EtsMem = etsmem(),
Tab = ets_new(foobar_table, [set, protected, {keypos, 2} | Opts]),
ok = fill_tab2(Tab, 0, 7000),
- % lookup ALL elements 50 times
- ?t:do_times(50, ?MODULE, do_lookup_element, [Tab, 6999, 1]),
+ %% lookup ALL elements 50 times
+ _ = [do_lookup_element(Tab, 6999, 1) || _ <- lists:seq(1, 50)],
true = ets:delete(Tab),
verify_etsmem(EtsMem).
do_lookup_element(_Tab, 0, _) -> ok;
do_lookup_element(Tab, N, M) ->
- ?line case catch ets:lookup_element(Tab, N, M) of
- {'EXIT', {badarg, _}} ->
- case M of
- 1 -> ?t:fail("Set #~p reported as empty. Not valid.",
- [N]),
- exit('Invalid lookup_element');
- _ -> ?line do_lookup_element(Tab, N-1, 1)
- end;
- _ -> ?line do_lookup_element(Tab, N, M+1)
+ case catch ets:lookup_element(Tab, N, M) of
+ {'EXIT', {badarg, _}} ->
+ case M of
+ 1 -> ct:fail("Set #~p reported as empty. Not valid.",
+ [N]),
+ exit('Invalid lookup_element');
+ _ -> do_lookup_element(Tab, N-1, 1)
+ end;
+ _ -> do_lookup_element(Tab, N, M+1)
end.
@@ -4453,28 +4271,28 @@ heavy_concurrent(Config) when is_list(Config) ->
repeat_for_opts(do_heavy_concurrent).
do_heavy_concurrent(Opts) ->
- ?line Size = 10000,
- ?line EtsMem = etsmem(),
- ?line Tab = ets_new(blupp, [set, public, {keypos, 2} | Opts]),
- ?line ok = fill_tab2(Tab, 0, Size),
- ?line Procs = lists:map(
- fun (N) ->
- my_spawn_link(
- fun () ->
- do_heavy_concurrent_proc(Tab, Size, N)
- end)
- end,
- lists:seq(1, 500)),
- ?line lists:foreach(fun (P) ->
- M = erlang:monitor(process, P),
- receive
- {'DOWN', M, process, P, _} ->
- ok
- end
- end,
- Procs),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
+ Size = 10000,
+ EtsMem = etsmem(),
+ Tab = ets_new(blupp, [set, public, {keypos, 2} | Opts]),
+ ok = fill_tab2(Tab, 0, Size),
+ Procs = lists:map(
+ fun (N) ->
+ my_spawn_link(
+ fun () ->
+ do_heavy_concurrent_proc(Tab, Size, N)
+ end)
+ end,
+ lists:seq(1, 500)),
+ lists:foreach(fun (P) ->
+ M = erlang:monitor(process, P),
+ receive
+ {'DOWN', M, process, P, _} ->
+ ok
+ end
+ end,
+ Procs),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
do_heavy_concurrent_proc(_Tab, 0, _Offs) ->
done;
@@ -4488,96 +4306,78 @@ do_heavy_concurrent_proc(Tab, N, Offs) ->
do_heavy_concurrent_proc(Tab, N-1, Offs).
-fold_empty(doc) ->
- [];
-fold_empty(suite) -> [];
fold_empty(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line Tab = make_table(a, [], []),
- ?line [] = ets:foldl(fun(_X) -> exit(hej) end, [], Tab),
- ?line [] = ets:foldr(fun(_X) -> exit(hej) end, [], Tab),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
-
-foldl(doc) ->
- [];
-foldl(suite) -> [];
+ EtsMem = etsmem(),
+ Tab = make_table(a, [], []),
+ [] = ets:foldl(fun(_X) -> exit(hej) end, [], Tab),
+ [] = ets:foldr(fun(_X) -> exit(hej) end, [], Tab),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
+
foldl(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line L = [{a,1}, {c,3}, {b,2}],
- ?line LS = lists:sort(L),
- ?line Tab = make_table(a, [bag], L),
- ?line LS = lists:sort(ets:foldl(fun(E,A) -> [E|A] end, [], Tab)),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
-
-foldr(doc) ->
- [];
-foldr(suite) -> [];
+ EtsMem = etsmem(),
+ L = [{a,1}, {c,3}, {b,2}],
+ LS = lists:sort(L),
+ Tab = make_table(a, [bag], L),
+ LS = lists:sort(ets:foldl(fun(E,A) -> [E|A] end, [], Tab)),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
+
foldr(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line L = [{a,1}, {c,3}, {b,2}],
- ?line LS = lists:sort(L),
- ?line Tab = make_table(a, [bag], L),
- ?line LS = lists:sort(ets:foldr(fun(E,A) -> [E|A] end, [], Tab)),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
-
-foldl_ordered(doc) ->
- [];
-foldl_ordered(suite) -> [];
+ EtsMem = etsmem(),
+ L = [{a,1}, {c,3}, {b,2}],
+ LS = lists:sort(L),
+ Tab = make_table(a, [bag], L),
+ LS = lists:sort(ets:foldr(fun(E,A) -> [E|A] end, [], Tab)),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
+
foldl_ordered(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line L = [{a,1}, {c,3}, {b,2}],
- ?line LS = lists:sort(L),
- ?line Tab = make_table(a, [ordered_set], L),
- ?line LS = lists:reverse(ets:foldl(fun(E,A) -> [E|A] end, [], Tab)),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
-
-foldr_ordered(doc) ->
- [];
-foldr_ordered(suite) -> [];
+ EtsMem = etsmem(),
+ L = [{a,1}, {c,3}, {b,2}],
+ LS = lists:sort(L),
+ Tab = make_table(a, [ordered_set], L),
+ LS = lists:reverse(ets:foldl(fun(E,A) -> [E|A] end, [], Tab)),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
+
foldr_ordered(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
- ?line L = [{a,1}, {c,3}, {b,2}],
- ?line LS = lists:sort(L),
- ?line Tab = make_table(a, [ordered_set], L),
- ?line LS = ets:foldr(fun(E,A) -> [E|A] end, [], Tab),
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
-
-member(suite) ->
- [];
-member(doc) ->
- ["Tests ets:member BIF"];
+ EtsMem = etsmem(),
+ L = [{a,1}, {c,3}, {b,2}],
+ LS = lists:sort(L),
+ Tab = make_table(a, [ordered_set], L),
+ LS = ets:foldr(fun(E,A) -> [E|A] end, [], Tab),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
+
+%% Test ets:member BIF.
member(Config) when is_list(Config) ->
repeat_for_opts(member_do, [write_concurrency, all_types]).
member_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line T = ets_new(xxx, Opts),
- ?line false = ets:member(T,hej),
- ?line E = fun(0,_F)->ok;
- (N,F) ->
- ?line ets:insert(T,{N,N rem 10}),
- F(N-1,F)
- end,
- ?line E(10000,E),
- ?line false = ets:member(T,hej),
- ?line true = ets:member(T,1),
- ?line false = ets:member(T,20000),
- ?line ets:delete(T,5),
- ?line false = ets:member(T,5),
- ?line ets:safe_fixtable(T,true),
- ?line ets:delete(T,6),
- ?line false = ets:member(T,6),
- ?line ets:safe_fixtable(T,false),
- ?line false = ets:member(T,6),
- ?line ets:delete(T),
- ?line {'EXIT',{badarg,_}} = (catch ets:member(finnsinte, 23)),
- ?line {'EXIT',{badarg,_}} = (catch ets:member(T, 23)),
- ?line verify_etsmem(EtsMem).
+ EtsMem = etsmem(),
+ T = ets_new(xxx, Opts),
+ false = ets:member(T,hej),
+ E = fun(0,_F)->ok;
+ (N,F) ->
+ ets:insert(T,{N,N rem 10}),
+ F(N-1,F)
+ end,
+ E(10000,E),
+ false = ets:member(T,hej),
+ true = ets:member(T,1),
+ false = ets:member(T,20000),
+ ets:delete(T,5),
+ false = ets:member(T,5),
+ ets:safe_fixtable(T,true),
+ ets:delete(T,6),
+ false = ets:member(T,6),
+ ets:safe_fixtable(T,false),
+ false = ets:member(T,6),
+ ets:delete(T),
+ {'EXIT',{badarg,_}} = (catch ets:member(finnsinte, 23)),
+ {'EXIT',{badarg,_}} = (catch ets:member(T, 23)),
+ verify_etsmem(EtsMem).
build_table(L1,L2,Num) ->
@@ -4664,10 +4464,10 @@ create_random_string(0) ->
create_random_string(OfLength) ->
C = case rand:uniform(2) of
- 1 ->
- (rand:uniform($Z - $A + 1) - 1) + $A;
- _ ->
- (rand:uniform($z - $a + 1) - 1) + $a
+ 1 ->
+ (rand:uniform($Z - $A + 1) - 1) + $A;
+ _ ->
+ (rand:uniform($z - $a + 1) - 1) + $a
end,
[C | create_random_string(OfLength - 1)].
@@ -4680,9 +4480,9 @@ create_random_tuple(OfLength) ->
create_partly_bound_tuple(OfLength) ->
case rand:uniform(2) of
1 ->
- create_partly_bound_tuple1(OfLength);
+ create_partly_bound_tuple1(OfLength);
_ ->
- create_partly_bound_tuple3(OfLength)
+ create_partly_bound_tuple3(OfLength)
end.
create_partly_bound_tuple1(OfLength) ->
@@ -4757,7 +4557,7 @@ xfilltabint(Tab,N) ->
_ ->
filltabint(Tab,N)
end.
-
+
filltabstr(Tab,N) ->
filltabstr(Tab,0,N).
@@ -4928,7 +4728,7 @@ successive_delete(Table,From,To,Type,TType) ->
end,
case TType of
X when X == bag; X == duplicate_bag ->
- %erlang:display(From),
+ %%erlang:display(From),
case From rem 2 of
0 ->
2 = ets:select_delete(Table,MS);
@@ -4947,19 +4747,19 @@ successive_delete(Table,From,To,Type,TType) ->
successive_delete(Table, Next, To, Type,TType).
gen_dets_filename(Config,N) ->
- filename:join(?config(priv_dir,Config),
+ filename:join(proplists:get_value(priv_dir,Config),
"testdets_" ++ integer_to_list(N) ++ ".dets").
otp_6842_select_1000(Config) when is_list(Config) ->
- ?line Tab = ets_new(xxx,[ordered_set]),
- ?line [ets:insert(Tab,{X,X}) || X <- lists:seq(1,10000)],
- ?line AllTrue = lists:duplicate(10,true),
- ?line AllTrue =
+ Tab = ets_new(xxx,[ordered_set]),
+ [ets:insert(Tab,{X,X}) || X <- lists:seq(1,10000)],
+ AllTrue = lists:duplicate(10,true),
+ AllTrue =
[ length(
element(1,
ets:select(Tab,[{'_',[],['$_']}],X*1000))) =:=
- X*1000 || X <- lists:seq(1,10) ],
- ?line Sequences = [[1000,1000,1000,1000,1000,1000,1000,1000,1000,1000],
+ X*1000 || X <- lists:seq(1,10) ],
+ Sequences = [[1000,1000,1000,1000,1000,1000,1000,1000,1000,1000],
[2000,2000,2000,2000,2000],
[3000,3000,3000,1000],
[4000,4000,2000],
@@ -4969,9 +4769,9 @@ otp_6842_select_1000(Config) when is_list(Config) ->
[8000,2000],
[9000,1000],
[10000]],
- ?line AllTrue = [ check_seq(Tab, ets:select(Tab,[{'_',[],['$_']}],hd(L)),L) ||
+ AllTrue = [ check_seq(Tab, ets:select(Tab,[{'_',[],['$_']}],hd(L)),L) ||
L <- Sequences ],
- ?line ets:delete(Tab),
+ ets:delete(Tab),
ok.
check_seq(_,'$end_of_table',[]) ->
@@ -5005,7 +4805,7 @@ w(_,0, _) -> ok;
w(T,N, Id) ->
ets:insert(T, {N, Id}),
w(T,N-1,Id).
-
+
verify(T, Ids) ->
List = my_tab_to_list(T),
Errors = lists:filter(fun(Bucket) ->
@@ -5016,7 +4816,7 @@ verify(T, Ids) ->
ok;
_ ->
io:format("Failed:\n~p\n", [Errors]),
- ?t:fail()
+ ct:fail(failed)
end.
verify2([{_N,Id}|RL], [Id|R]) ->
@@ -5025,8 +4825,7 @@ verify2([],[]) -> false;
verify2(_Err, _) ->
true.
-otp_7665(doc) -> ["delete_object followed by delete on fixed bag failed to delete objects."];
-otp_7665(suite) -> [];
+%% delete_object followed by delete on fixed bag failed to delete objects.
otp_7665(Config) when is_list(Config) ->
repeat_for_opts(otp_7665_do).
@@ -5036,30 +4835,30 @@ otp_7665_do(Opts) ->
Max = 10,
lists:foreach(fun(N)-> otp_7665_act(Tab,Min,Max,N) end,
lists:seq(Min,Max)),
- ?line true = ets:delete(Tab).
-
+ true = ets:delete(Tab).
+
otp_7665_act(Tab,Min,Max,DelNr) ->
List1 = [{key,N} || N <- lists:seq(Min,Max)],
- ?line true = ets:insert(Tab, List1),
- ?line true = ets:safe_fixtable(Tab, true),
- ?line true = ets:delete_object(Tab, {key,DelNr}),
+ true = ets:insert(Tab, List1),
+ true = ets:safe_fixtable(Tab, true),
+ true = ets:delete_object(Tab, {key,DelNr}),
List2 = lists:delete({key,DelNr}, List1),
%% Now verify that we find all remaining objects
- ?line List2 = ets:lookup(Tab,key),
- ?line EList2 = lists:map(fun({key,N})-> N end,
- List2),
- ?line EList2 = ets:lookup_element(Tab,key,2),
- ?line true = ets:delete(Tab, key),
- ?line [] = ets:lookup(Tab, key),
- ?line true = ets:safe_fixtable(Tab, false),
+ List2 = ets:lookup(Tab,key),
+ EList2 = lists:map(fun({key,N})-> N end,
+ List2),
+ EList2 = ets:lookup_element(Tab,key,2),
+ true = ets:delete(Tab, key),
+ [] = ets:lookup(Tab, key),
+ true = ets:safe_fixtable(Tab, false),
ok.
%% Whitebox testing of meta name table hashing.
meta_wb(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
repeat_for_opts(meta_wb_do),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
meta_wb_do(Opts) ->
@@ -5072,7 +4871,7 @@ meta_wb_do(Opts) ->
Len = length(Names),
OpFuns = {fun meta_wb_new/4, fun meta_wb_delete/4, fun meta_wb_rename/4},
- ?line true = (Len >= 3),
+ true = (Len >= 3),
io:format("Colliding names = ~p\n",[Names]),
F = fun(0,_,_) -> ok;
@@ -5085,41 +4884,41 @@ meta_wb_do(Opts) ->
end,
F(Len*100, [], F),
- % cleanup
+ %% cleanup
lists:foreach(fun(Name)->catch ets:delete(Name) end,
Names).
-
+
meta_wb_new(Name, _, Tabs, Opts) ->
case (catch ets_new(Name,[named_table|Opts])) of
Name ->
- ?line false = lists:member(Name, Tabs),
+ false = lists:member(Name, Tabs),
[Name | Tabs];
{'EXIT',{badarg,_}} ->
- ?line true = lists:member(Name, Tabs),
+ true = lists:member(Name, Tabs),
Tabs
end.
meta_wb_delete(Name, _, Tabs, _) ->
case (catch ets:delete(Name)) of
true ->
- ?line true = lists:member(Name, Tabs),
+ true = lists:member(Name, Tabs),
lists:delete(Name, Tabs);
{'EXIT',{badarg,_}} ->
- ?line false = lists:member(Name, Tabs),
+ false = lists:member(Name, Tabs),
Tabs
end.
meta_wb_rename(Old, New, Tabs, _) ->
case (catch ets:rename(Old,New)) of
New ->
- ?line true = lists:member(Old, Tabs)
+ true = lists:member(Old, Tabs)
andalso not lists:member(New, Tabs),
[New | lists:delete(Old, Tabs)];
{'EXIT',{badarg,_}} ->
- ?line true = not lists:member(Old, Tabs)
+ true = not lists:member(Old, Tabs)
orelse lists:member(New,Tabs),
Tabs
end.
-
-
+
+
colliding_names(Name) ->
erts_debug:set_internal_state(colliding_names, {Name,5}).
@@ -5127,17 +4926,13 @@ colliding_names(Name) ->
%% OTP_6913: Grow and shrink.
grow_shrink(Config) when is_list(Config) ->
- ?line EtsMem = etsmem(),
+ EtsMem = etsmem(),
Set = ets_new(a, [set]),
grow_shrink_0(0, 3071, 3000, 5000, Set),
ets:delete(Set),
- %OrdSet = ets_new(a, [ordered_set]),
- %grow_shrink_0(0, lists:seq(3071, 5000), OrdSet),
- %ets:delete(OrdSet),
-
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
grow_shrink_0(N, _, _, Max, _) when N >= Max ->
ok;
@@ -5150,21 +4945,18 @@ grow_shrink_1(N0, GrowN, ShrinkN, T) ->
grow_shrink_3(N1, N1 - ShrinkN, T).
grow_shrink_2(N, GrowTo, _) when N > GrowTo ->
- %io:format("Grown to ~p\n", [GrowTo]),
GrowTo;
grow_shrink_2(N, GrowTo, T) ->
true = ets:insert(T, {N,a}),
grow_shrink_2(N+1, GrowTo, T).
grow_shrink_3(N, ShrinkTo, _) when N =< ShrinkTo ->
- %io:format("Shrunk to ~p\n", [ShrinkTo]),
ShrinkTo;
grow_shrink_3(N, ShrinkTo, T) ->
true = ets:delete(T, N),
grow_shrink_3(N-1, ShrinkTo, T).
-
-grow_pseudo_deleted(doc) -> ["Grow a table that still contains pseudo-deleted objects"];
-grow_pseudo_deleted(suite) -> [];
+
+%% Grow a table that still contains pseudo-deleted objects.
grow_pseudo_deleted(Config) when is_list(Config) ->
only_if_smp(fun() -> grow_pseudo_deleted_do() end).
@@ -5175,17 +4967,17 @@ grow_pseudo_deleted_do() ->
grow_pseudo_deleted_do(Type) ->
process_flag(scheduler,1),
Self = self(),
- ?line T = ets_new(kalle,[Type,public,{write_concurrency,true}]),
+ T = ets_new(kalle,[Type,public,{write_concurrency,true}]),
Mod = 7, Mult = 10000,
filltabint(T,Mod*Mult),
- ?line true = ets:safe_fixtable(T,true),
- ?line Mult = ets:select_delete(T,
- [{{'$1', '_'},
- [{'=:=', {'rem', '$1', Mod}, 0}],
- [true]}]),
+ true = ets:safe_fixtable(T,true),
+ Mult = ets:select_delete(T,
+ [{{'$1', '_'},
+ [{'=:=', {'rem', '$1', Mod}, 0}],
+ [true]}]),
Left = Mult*(Mod-1),
- ?line Left = ets:info(T,size),
- ?line Mult = get_kept_objects(T),
+ Left = ets:info(T,size),
+ Mult = get_kept_objects(T),
filltabstr(T,Mult),
my_spawn_opt(
fun() ->
@@ -5201,7 +4993,7 @@ grow_pseudo_deleted_do(Type) ->
end),
Self ! done
end, [link, {scheduler,2}]),
- ?line start = receive_any(),
+ start = receive_any(),
io:format("Unfixing table... nitems=~p\n", [ets:info(T, size)]),
do_tc(fun() ->
true = ets:safe_fixtable(T, false)
@@ -5210,15 +5002,14 @@ grow_pseudo_deleted_do(Type) ->
io:format("Unfix table done in ~p ms. nitems=~p\n",
[Elapsed,ets:info(T, size)])
end),
- ?line false = ets:info(T,fixed),
- ?line 0 = get_kept_objects(T),
- ?line done = receive_any(),
+ false = ets:info(T,fixed),
+ 0 = get_kept_objects(T),
+ done = receive_any(),
%%verify_table_load(T), % may fail if concurrency is poor (genny)
ets:delete(T),
process_flag(scheduler,0).
-shrink_pseudo_deleted(doc) -> ["Shrink a table that still contains pseudo-deleted objects"];
-shrink_pseudo_deleted(suite) -> [];
+%% Shrink a table that still contains pseudo-deleted objects.
shrink_pseudo_deleted(Config) when is_list(Config) ->
only_if_smp(fun()->shrink_pseudo_deleted_do() end).
@@ -5229,16 +5020,16 @@ shrink_pseudo_deleted_do() ->
shrink_pseudo_deleted_do(Type) ->
process_flag(scheduler,1),
Self = self(),
- ?line T = ets_new(kalle,[Type,public,{write_concurrency,true}]),
+ T = ets_new(kalle,[Type,public,{write_concurrency,true}]),
Half = 10000,
filltabint(T,Half*2),
- ?line true = ets:safe_fixtable(T,true),
- ?line Half = ets:select_delete(T,
- [{{'$1', '_'},
- [{'>', '$1', Half}],
- [true]}]),
- ?line Half = ets:info(T,size),
- ?line Half = get_kept_objects(T),
+ true = ets:safe_fixtable(T,true),
+ Half = ets:select_delete(T,
+ [{{'$1', '_'},
+ [{'>', '$1', Half}],
+ [true]}]),
+ Half = ets:info(T,size),
+ Half = get_kept_objects(T),
my_spawn_opt(
fun()-> true = ets:info(T,fixed),
Self ! start,
@@ -5249,10 +5040,10 @@ shrink_pseudo_deleted_do(Type) ->
fun(Elapsed) ->
io:format("Done with delete in ~p ms.\n",
[Elapsed])
- end),
+ end),
Self ! done
end, [link, {scheduler,2}]),
- ?line start = receive_any(),
+ start = receive_any(),
io:format("Unfixing table... nitems=~p\n", [ets:info(T, size)]),
do_tc(fun() ->
true = ets:safe_fixtable(T, false)
@@ -5261,20 +5052,19 @@ shrink_pseudo_deleted_do(Type) ->
io:format("Unfix table done in ~p ms. nitems=~p\n",
[Elapsed,ets:info(T, size)])
end),
- ?line false = ets:info(T,fixed),
- ?line 0 = get_kept_objects(T),
- ?line done = receive_any(),
+ false = ets:info(T,fixed),
+ 0 = get_kept_objects(T),
+ done = receive_any(),
%%verify_table_load(T), % may fail if concurrency is poor (genny)
ets:delete(T),
process_flag(scheduler,0).
-
-meta_lookup_unnamed_read(suite) -> [];
+
meta_lookup_unnamed_read(Config) when is_list(Config) ->
InitF = fun(_) -> Tab = ets_new(unnamed,[]),
- true = ets:insert(Tab,{key,data}),
- Tab
+ true = ets:insert(Tab,{key,data}),
+ Tab
end,
ExecF = fun(Tab) -> [{key,data}] = ets:lookup(Tab,key),
Tab
@@ -5283,10 +5073,9 @@ meta_lookup_unnamed_read(Config) when is_list(Config) ->
end,
run_workers(InitF,ExecF,FiniF,10000).
-meta_lookup_unnamed_write(suite) -> [];
meta_lookup_unnamed_write(Config) when is_list(Config) ->
InitF = fun(_) -> Tab = ets_new(unnamed,[]),
- {Tab,0}
+ {Tab,0}
end,
ExecF = fun({Tab,N}) -> true = ets:insert(Tab,{key,N}),
{Tab,N+1}
@@ -5295,7 +5084,6 @@ meta_lookup_unnamed_write(Config) when is_list(Config) ->
end,
run_workers(InitF,ExecF,FiniF,10000).
-meta_lookup_named_read(suite) -> [];
meta_lookup_named_read(Config) when is_list(Config) ->
InitF = fun([ProcN|_]) -> Name = list_to_atom(integer_to_list(ProcN)),
Tab = ets_new(Name,[named_table]),
@@ -5309,11 +5097,10 @@ meta_lookup_named_read(Config) when is_list(Config) ->
end,
run_workers(InitF,ExecF,FiniF,10000).
-meta_lookup_named_write(suite) -> [];
meta_lookup_named_write(Config) when is_list(Config) ->
InitF = fun([ProcN|_]) -> Name = list_to_atom(integer_to_list(ProcN)),
- Tab = ets_new(Name,[named_table]),
- {Tab,0}
+ Tab = ets_new(Name,[named_table]),
+ {Tab,0}
end,
ExecF = fun({Tab,N}) -> true = ets:insert(Tab,{key,N}),
{Tab,N+1}
@@ -5322,7 +5109,6 @@ meta_lookup_named_write(Config) when is_list(Config) ->
end,
run_workers(InitF,ExecF,FiniF,10000).
-meta_newdel_unnamed(suite) -> [];
meta_newdel_unnamed(Config) when is_list(Config) ->
InitF = fun(_) -> ok end,
ExecF = fun(_) -> Tab = ets_new(unnamed,[]),
@@ -5331,7 +5117,6 @@ meta_newdel_unnamed(Config) when is_list(Config) ->
FiniF = fun(_) -> ok end,
run_workers(InitF,ExecF,FiniF,10000).
-meta_newdel_named(suite) -> [];
meta_newdel_named(Config) when is_list(Config) ->
InitF = fun([ProcN|_]) -> list_to_atom(integer_to_list(ProcN))
end,
@@ -5342,8 +5127,7 @@ meta_newdel_named(Config) when is_list(Config) ->
FiniF = fun(_) -> ok end,
run_workers(InitF,ExecF,FiniF,10000).
-smp_insert(doc) -> ["Concurrent insert's on same table"];
-smp_insert(suite) -> [];
+%% Concurrent insert's on same table.
smp_insert(Config) when is_list(Config) ->
ets_new(smp_insert,[named_table,public,{write_concurrency,true}]),
InitF = fun(_) -> ok end,
@@ -5354,8 +5138,7 @@ smp_insert(Config) when is_list(Config) ->
verify_table_load(smp_insert),
ets:delete(smp_insert).
-smp_fixed_delete(doc) -> ["Concurrent delete's on same fixated table"];
-smp_fixed_delete(suite) -> [];
+%% Concurrent deletes on same fixated table.
smp_fixed_delete(Config) when is_list(Config) ->
only_if_smp(fun()->smp_fixed_delete_do() end).
@@ -5375,21 +5158,20 @@ smp_fixed_delete_do() ->
end,
FiniF = fun(_) -> ok end,
run_workers_do(InitF,ExecF,FiniF,NumOfObjs),
- ?line 0 = ets:info(T,size),
- ?line true = ets:info(T,fixed),
- ?line Buckets = num_of_buckets(T),
- ?line NumOfObjs = get_kept_objects(T),
+ 0 = ets:info(T,size),
+ true = ets:info(T,fixed),
+ Buckets = num_of_buckets(T),
+ NumOfObjs = get_kept_objects(T),
ets:safe_fixtable(T,false),
%% Will fail as unfix does not shrink the table:
- %%?line Mem = ets:info(T,memory),
+ %%Mem = ets:info(T,memory),
%%verify_table_load(T),
ets:delete(T).
num_of_buckets(T) ->
- ?line element(1,ets:info(T,stats)).
+ element(1,ets:info(T,stats)).
-smp_unfix_fix(doc) -> ["Fixate hash table while other process is busy doing unfix"];
-smp_unfix_fix(suite) -> [];
+%% Fixate hash table while other process is busy doing unfix.
smp_unfix_fix(Config) when is_list(Config) ->
only_if_smp(fun()-> smp_unfix_fix_do() end).
@@ -5403,15 +5185,15 @@ smp_unfix_fix_do() ->
filltabint(T,NumOfObjs),
ets:safe_fixtable(T,true),
Buckets = num_of_buckets(T),
- ?line Deleted = ets:select_delete(T,[{{'$1', '_'},
- [{'=<','$1', Deleted}],
- [true]}]),
- ?line Buckets = num_of_buckets(T),
+ Deleted = ets:select_delete(T,[{{'$1', '_'},
+ [{'=<','$1', Deleted}],
+ [true]}]),
+ Buckets = num_of_buckets(T),
Left = NumOfObjs - Deleted,
- ?line Left = ets:info(T,size),
- ?line true = ets:info(T,fixed),
- ?line Deleted = get_kept_objects(T),
-
+ Left = ets:info(T,size),
+ true = ets:info(T,fixed),
+ Deleted = get_kept_objects(T),
+
{Child, Mref} =
my_spawn_opt(
fun()->
@@ -5438,9 +5220,9 @@ smp_unfix_fix_do() ->
done = receive_any()
end,
[link, monitor, {scheduler,2}]),
-
- ?line start = receive_any(),
- ?line true = ets:info(T,fixed),
+
+ start = receive_any(),
+ true = ets:info(T,fixed),
io:put_chars("Parent starting to unfix... ~p\n"),
do_tc(fun() ->
ets:safe_fixtable(T, false)
@@ -5451,14 +5233,13 @@ smp_unfix_fix_do() ->
end),
Child ! done,
{'DOWN', Mref, process, Child, normal} = receive_any(),
- ?line false = ets:info(T,fixed),
- ?line 0 = get_kept_objects(T),
+ false = ets:info(T,fixed),
+ 0 = get_kept_objects(T),
%%verify_table_load(T),
ets:delete(T),
process_flag(scheduler,0).
-otp_8166(doc) -> ["Unsafe unfix was done by trapping select/match"];
-otp_8166(suite) -> [];
+%% Unsafe unfix was done by trapping select/match.
otp_8166(Config) when is_list(Config) ->
only_if_smp(3, fun()-> otp_8166_do(false),
otp_8166_do(true)
@@ -5489,8 +5270,8 @@ otp_8166_do(WC) ->
{'DOWN', ReaderMref, process, ReaderPid, normal} = receive_any(),
ZombieCrPid ! quit,
{'DOWN', ZombieCrMref, process, ZombieCrPid, normal} = receive_any(),
- ?line false = ets:info(T,fixed),
- ?line 0 = get_kept_objects(T),
+ false = ets:info(T,fixed),
+ 0 = get_kept_objects(T),
%%verify_table_load(T),
ets:delete(T),
process_flag(scheduler,0).
@@ -5531,9 +5312,9 @@ otp_8166_zombie_creator(T,Deleted) ->
{loop,Pid} ->
filltabint(T,Deleted),
ets:safe_fixtable(T,true),
- ?line Deleted = ets:select_delete(T,[{{'$1', '_'},
- [{'=<','$1', Deleted}],
- [true]}]),
+ Deleted = ets:select_delete(T,[{{'$1', '_'},
+ [{'=<','$1', Deleted}],
+ [true]}]),
Pid ! zombies_created,
repeat_while(fun() -> case ets:info(T,safe_fixed_monotonic_time) of
{_,[_P1,_P2]} ->
@@ -5551,47 +5332,45 @@ otp_8166_zombie_creator(T,Deleted) ->
io:format("ignore unfix in outer loop?\n",[]),
otp_8166_zombie_creator(T,Deleted)
end.
-
-
-
+
+
+
verify_table_load(T) ->
- ?line Stats = ets:info(T,stats),
- ?line {Buckets,AvgLen,StdDev,ExpSD,_MinLen,_MaxLen,_} = Stats,
- ?line ok = if
- AvgLen > 7 ->
- io:format("Table overloaded: Stats=~p\n~p\n",
- [Stats, ets:info(T)]),
- false;
-
- Buckets>256, AvgLen < 6 ->
- io:format("Table underloaded: Stats=~p\n~p\n",
- [Stats, ets:info(T)]),
- false;
-
- StdDev > ExpSD*2 ->
- io:format("Too large standard deviation (poor hashing?),"
- " stats=~p\n~p\n",[Stats, ets:info(T)]),
- false;
-
- true ->
- io:format("Stats = ~p\n",[Stats]),
- ok
- end.
-
-
-otp_8732(doc) -> ["ets:select on a tree with NIL key object"];
+ Stats = ets:info(T,stats),
+ {Buckets,AvgLen,StdDev,ExpSD,_MinLen,_MaxLen,_} = Stats,
+ ok = if
+ AvgLen > 7 ->
+ io:format("Table overloaded: Stats=~p\n~p\n",
+ [Stats, ets:info(T)]),
+ false;
+
+ Buckets>256, AvgLen < 6 ->
+ io:format("Table underloaded: Stats=~p\n~p\n",
+ [Stats, ets:info(T)]),
+ false;
+
+ StdDev > ExpSD*2 ->
+ io:format("Too large standard deviation (poor hashing?),"
+ " stats=~p\n~p\n",[Stats, ets:info(T)]),
+ false;
+
+ true ->
+ io:format("Stats = ~p\n",[Stats]),
+ ok
+ end.
+
+
+%% ets:select on a tree with NIL key object.
otp_8732(Config) when is_list(Config) ->
Tab = ets_new(noname,[ordered_set]),
filltabstr(Tab,999),
ets:insert(Tab,{[],"nasty NIL object"}),
- ?line [] = ets:match(Tab,{'_',nomatch}), %% Will hang if bug not fixed
+ [] = ets:match(Tab,{'_',nomatch}), %% Will hang if bug not fixed
ok.
-smp_select_delete(suite) -> [];
-smp_select_delete(doc) ->
- ["Run concurrent select_delete (and inserts) on same table."];
+%% Run concurrent select_delete (and inserts) on same table.
smp_select_delete(Config) when is_list(Config) ->
T = ets_new(smp_select_delete,[named_table,public,{write_concurrency,true}]),
Mod = 17,
@@ -5612,65 +5391,65 @@ smp_select_delete(Config) when is_list(Config) ->
_ ->
Key = rand:uniform(10000),
Eq = Key rem Mod,
- ?line case ets:insert_new(T,{Key,Key}) of
- true ->
- Diffs1 = setelement(Eq+1, Diffs0,
- element(Eq+1,Diffs0)+1),
- Diffs1;
- false -> Diffs0
- end
+ case ets:insert_new(T,{Key,Key}) of
+ true ->
+ Diffs1 = setelement(Eq+1, Diffs0,
+ element(Eq+1,Diffs0)+1),
+ Diffs1;
+ false -> Diffs0
+ end
end
end,
FiniF = fun(Result) -> Result end,
Results = run_workers_do(InitF,ExecF,FiniF,20000),
- ?line TotCnts = lists:foldl(fun(Diffs, Sum) -> add_lists(Sum,tuple_to_list(Diffs)) end,
- lists:duplicate(Mod, 0), Results),
+ TotCnts = lists:foldl(fun(Diffs, Sum) -> add_lists(Sum,tuple_to_list(Diffs)) end,
+ lists:duplicate(Mod, 0), Results),
io:format("TotCnts = ~p\n",[TotCnts]),
- ?line LeftInTab = lists:foldl(fun(N,Sum) -> Sum+N end,
- 0, TotCnts),
+ LeftInTab = lists:foldl(fun(N,Sum) -> Sum+N end,
+ 0, TotCnts),
io:format("LeftInTab = ~p\n",[LeftInTab]),
- ?line LeftInTab = ets:info(T,size),
+ LeftInTab = ets:info(T,size),
lists:foldl(fun(Cnt,Eq) ->
WasCnt = ets:select_count(T,
[{{'_', '$1'},
[{'=:=', {'rem', '$1', Mod}, Eq}],
[true]}]),
io:format("~p: ~p =?= ~p\n",[Eq,Cnt,WasCnt]),
- ?line Cnt = WasCnt,
+ Cnt = WasCnt,
Eq+1
end,
0, TotCnts),
verify_table_load(T),
- ?line LeftInTab = ets:select_delete(T, [{{'$1','$1'}, [], [true]}]),
- ?line 0 = ets:info(T,size),
- ?line false = ets:info(T,fixed),
+ LeftInTab = ets:select_delete(T, [{{'$1','$1'}, [], [true]}]),
+ 0 = ets:info(T,size),
+ false = ets:info(T,fixed),
ets:delete(T).
-types(doc) -> ["Test different types"];
+%% Test different types.
types(Config) when is_list(Config) ->
init_externals(),
repeat_for_opts(types_do,[[set,ordered_set],compressed]).
types_do(Opts) ->
EtsMem = etsmem(),
- ?line T = ets_new(xxx,Opts),
+ T = ets_new(xxx,Opts),
Fun = fun(Term) ->
- ets:insert(T,{Term}),
- ?line [{Term}] = ets:lookup(T,Term),
- ets:insert(T,{Term,xxx}),
- ?line [{Term,xxx}] = ets:lookup(T,Term),
- ets:insert(T,{Term,"xxx"}),
- ?line [{Term,"xxx"}] = ets:lookup(T,Term),
- ets:insert(T,{xxx,Term}),
- ?line [{xxx,Term}] = ets:lookup(T,xxx),
- ets:insert(T,{"xxx",Term}),
- ?line [{"xxx",Term}] = ets:lookup(T,"xxx"),
- ets:delete_all_objects(T),
- ?line 0 = ets:info(T,size)
+ ets:insert(T,{Term}),
+ [{Term}] = ets:lookup(T,Term),
+ ets:insert(T,{Term,xxx}),
+ [{Term,xxx}] = ets:lookup(T,Term),
+ ets:insert(T,{Term,"xxx"}),
+ [{Term,"xxx"}] = ets:lookup(T,Term),
+ ets:insert(T,{xxx,Term}),
+ [{xxx,Term}] = ets:lookup(T,xxx),
+ ets:insert(T,{"xxx",Term}),
+ [{"xxx",Term}] = ets:lookup(T,"xxx"),
+ ets:delete_all_objects(T),
+ 0 = ets:info(T,size)
end,
test_terms(Fun, strict),
ets:delete(T),
- ?line verify_etsmem(EtsMem).
+ verify_etsmem(EtsMem).
%% OTP-9932: Memory overwrite when inserting large integers in compressed bag.
@@ -5687,9 +5466,10 @@ otp_9932(Config) when is_list(Config) ->
end,
lists:foreach(Fun, lists:seq(0, 16)),
ets:delete(T).
-
-otp_9423(doc) -> ["vm-deadlock caused by race between ets:delete and others on write_concurrency table"];
+
+%% vm-deadlock caused by race between ets:delete and others on
+%% write_concurrency table.
otp_9423(Config) when is_list(Config) ->
InitF = fun(_) -> {0,0} end,
ExecF = fun({S,F}) ->
@@ -5716,10 +5496,10 @@ otp_9423(Config) when is_list(Config) ->
[P ! stop || P <- Pids],
wait_pids(Pids),
ok;
-
+
Skipped -> Skipped
end.
-
+
%% Corrupted binary in compressed table
otp_10182(Config) when is_list(Config) ->
@@ -5747,7 +5527,7 @@ ets_all_run() ->
ets:delete(Table),
false = lists:member(Table, ets:all()),
ets_all_run().
-
+
take(Config) when is_list(Config) ->
%% Simple test for set tables.
@@ -5786,9 +5566,9 @@ take(Config) when is_list(Config) ->
ok.
-%
-% Utility functions:
-%
+%%
+%% Utility functions:
+%%
add_lists(L1,L2) ->
add_lists(L1,L2,[]).
@@ -5810,9 +5590,9 @@ run_workers(InitF,ExecF,FiniF,Laps, Exclude) ->
run_workers_do(InitF,ExecF,FiniF,Laps) ->
run_workers_do(InitF,ExecF,FiniF,Laps, 0).
run_workers_do(InitF,ExecF,FiniF,Laps, Exclude) ->
- ?line NumOfProcs = case erlang:system_info(schedulers) of
- N when (N > Exclude) -> N - Exclude
- end,
+ NumOfProcs = case erlang:system_info(schedulers) of
+ N when (N > Exclude) -> N - Exclude
+ end,
io:format("smp starting ~p workers\n",[NumOfProcs]),
Seeds = [{ProcN,rand:uniform(9999)} || ProcN <- lists:seq(1,NumOfProcs)],
Parent = self(),
@@ -5822,7 +5602,7 @@ run_workers_do(InitF,ExecF,FiniF,Laps, Exclude) ->
infinite -> Pids;
_ -> wait_pids(Pids)
end.
-
+
worker({ProcN,Seed}, InitF, ExecF, FiniF, Laps, Parent, NumOfProcs) ->
io:format("smp worker ~p, seed=~p~n",[self(),Seed]),
rand:seed(exsplus, {Seed,Seed,Seed}),
@@ -5840,7 +5620,7 @@ worker_loop(infinite, ExecF, State) ->
worker_loop(infinite,ExecF,ExecF(State));
worker_loop(N, ExecF, State) ->
worker_loop(N-1,ExecF,ExecF(State)).
-
+
wait_pids(Pids) ->
wait_pids(Pids,[]).
wait_pids([],Acc) ->
@@ -5848,7 +5628,7 @@ wait_pids([],Acc) ->
wait_pids(Pids, Acc) ->
receive
{Pid,Result} ->
- ?line true = lists:member(Pid,Pids),
+ true = lists:member(Pid,Pids),
Others = lists:delete(Pid,Pids),
io:format("wait_pid got ~p from ~p, still waiting for ~p\n",[Result,Pid,Others]),
wait_pids(Others,[Result | Acc])
@@ -5874,7 +5654,7 @@ wait_for_memory_deallocations() ->
erts_debug:set_internal_state(available_internal_state, true),
wait_for_memory_deallocations()
end.
-
+
etsmem() ->
wait_for_memory_deallocations(),
@@ -5887,35 +5667,35 @@ etsmem() ->
ErlangMemoryEts = try erlang:memory(ets) catch error:notsup -> notsup end,
Mem =
- {ErlangMemoryEts,
- case EtsAllocInfo of
- false -> undefined;
- MemInfo ->
- CS = lists:foldl(
- fun ({instance, _, L}, Acc) ->
- {value,{mbcs,MBCS}} = lists:keysearch(mbcs, 1, L),
- {value,{sbcs,SBCS}} = lists:keysearch(sbcs, 1, L),
- NewAcc = [MBCS, SBCS | Acc],
- case lists:keysearch(mbcs_pool, 1, L) of
- {value,{mbcs_pool, MBCS_POOL}} ->
- [MBCS_POOL|NewAcc];
- _ -> NewAcc
- end
- end,
- [],
- MemInfo),
- lists:foldl(
- fun(L, {Bl0,BlSz0}) ->
- {value,BlTup} = lists:keysearch(blocks, 1, L),
- blocks = element(1, BlTup),
- Bl = element(2, BlTup),
- {value,BlSzTup} = lists:keysearch(blocks_size, 1, L),
- blocks_size = element(1, BlSzTup),
- BlSz = element(2, BlSzTup),
- {Bl0+Bl,BlSz0+BlSz}
- end, {0,0}, CS)
- end},
- {Mem,AllTabs}.
+ {ErlangMemoryEts,
+ case EtsAllocInfo of
+ false -> undefined;
+ MemInfo ->
+ CS = lists:foldl(
+ fun ({instance, _, L}, Acc) ->
+ {value,{mbcs,MBCS}} = lists:keysearch(mbcs, 1, L),
+ {value,{sbcs,SBCS}} = lists:keysearch(sbcs, 1, L),
+ NewAcc = [MBCS, SBCS | Acc],
+ case lists:keysearch(mbcs_pool, 1, L) of
+ {value,{mbcs_pool, MBCS_POOL}} ->
+ [MBCS_POOL|NewAcc];
+ _ -> NewAcc
+ end
+ end,
+ [],
+ MemInfo),
+ lists:foldl(
+ fun(L, {Bl0,BlSz0}) ->
+ {value,BlTup} = lists:keysearch(blocks, 1, L),
+ blocks = element(1, BlTup),
+ Bl = element(2, BlTup),
+ {value,BlSzTup} = lists:keysearch(blocks_size, 1, L),
+ blocks_size = element(1, BlSzTup),
+ BlSz = element(2, BlSzTup),
+ {Bl0+Bl,BlSz0+BlSz}
+ end, {0,0}, CS)
+ end},
+ {Mem,AllTabs}.
verify_etsmem({MemInfo,AllTabs}) ->
wait_for_test_procs(),
@@ -6101,7 +5881,7 @@ receive_any_spinning(Loops,0,Tries) ->
end;
receive_any_spinning(Loops, N, Tries) when N>0 ->
receive_any_spinning(Loops, N-1, Tries).
-
+
spawn_monitor_with_pid(Pid, Fun) when is_pid(Pid) ->
@@ -6136,130 +5916,130 @@ only_if_smp(Schedulers, Func) ->
-define(heap_binary_size, 64).
test_terms(Test_Func, Mode) ->
garbage_collect(),
- ?line Pib0 = process_info(self(),binary),
-
- ?line Test_Func(atom),
- ?line Test_Func(''),
- ?line Test_Func('a'),
- ?line Test_Func('ab'),
- ?line Test_Func('abc'),
- ?line Test_Func('abcd'),
- ?line Test_Func('abcde'),
- ?line Test_Func('abcdef'),
- ?line Test_Func('abcdefg'),
- ?line Test_Func('abcdefgh'),
-
- ?line Test_Func(fun() -> ok end),
+ Pib0 = process_info(self(),binary),
+
+ Test_Func(atom),
+ Test_Func(''),
+ Test_Func('a'),
+ Test_Func('ab'),
+ Test_Func('abc'),
+ Test_Func('abcd'),
+ Test_Func('abcde'),
+ Test_Func('abcdef'),
+ Test_Func('abcdefg'),
+ Test_Func('abcdefgh'),
+
+ Test_Func(fun() -> ok end),
X = id([a,{b,c},c]),
Y = id({x,y,z}),
Z = id(1 bsl 8*257),
- ?line Test_Func(fun() -> X end),
- ?line Test_Func(fun() -> {X,Y} end),
- ?line Test_Func([fun() -> {X,Y,Z} end,
- fun() -> {Z,X,Y} end,
- fun() -> {Y,Z,X} end]),
-
- ?line Test_Func({trace_ts,{even_bigger,{some_data,fun() -> ok end}},{1,2,3}}),
- ?line Test_Func({trace_ts,{even_bigger,{some_data,<<1,2,3,4,5,6,7,8,9,10>>}},
- {1,2,3}}),
-
- ?line Test_Func(1),
- ?line Test_Func(42),
- ?line Test_Func(-23),
- ?line Test_Func(256),
- ?line Test_Func(25555),
- ?line Test_Func(-3333),
-
- ?line Test_Func(1.0),
-
- ?line Test_Func(183749783987483978498378478393874),
- ?line Test_Func(-37894183749783987483978498378478393874),
+ Test_Func(fun() -> X end),
+ Test_Func(fun() -> {X,Y} end),
+ Test_Func([fun() -> {X,Y,Z} end,
+ fun() -> {Z,X,Y} end,
+ fun() -> {Y,Z,X} end]),
+
+ Test_Func({trace_ts,{even_bigger,{some_data,fun() -> ok end}},{1,2,3}}),
+ Test_Func({trace_ts,{even_bigger,{some_data,<<1,2,3,4,5,6,7,8,9,10>>}},
+ {1,2,3}}),
+
+ Test_Func(1),
+ Test_Func(42),
+ Test_Func(-23),
+ Test_Func(256),
+ Test_Func(25555),
+ Test_Func(-3333),
+
+ Test_Func(1.0),
+
+ Test_Func(183749783987483978498378478393874),
+ Test_Func(-37894183749783987483978498378478393874),
Very_Big = very_big_num(),
- ?line Test_Func(Very_Big),
- ?line Test_Func(-Very_Big+1),
+ Test_Func(Very_Big),
+ Test_Func(-Very_Big+1),
- ?line Test_Func([]),
- ?line Test_Func("abcdef"),
- ?line Test_Func([a, b, 1, 2]),
- ?line Test_Func([a|b]),
+ Test_Func([]),
+ Test_Func("abcdef"),
+ Test_Func([a, b, 1, 2]),
+ Test_Func([a|b]),
- ?line Test_Func({}),
- ?line Test_Func({1}),
- ?line Test_Func({a, b}),
- ?line Test_Func({a, b, c}),
- ?line Test_Func(list_to_tuple(lists:seq(0, 255))),
- ?line Test_Func(list_to_tuple(lists:seq(0, 256))),
+ Test_Func({}),
+ Test_Func({1}),
+ Test_Func({a, b}),
+ Test_Func({a, b, c}),
+ Test_Func(list_to_tuple(lists:seq(0, 255))),
+ Test_Func(list_to_tuple(lists:seq(0, 256))),
- ?line Test_Func(make_ref()),
- ?line Test_Func([make_ref(), make_ref()]),
+ Test_Func(make_ref()),
+ Test_Func([make_ref(), make_ref()]),
- ?line Test_Func(make_port()),
+ Test_Func(make_port()),
- ?line Test_Func(make_pid()),
- ?line Test_Func(make_ext_pid()),
- ?line Test_Func(make_ext_port()),
- ?line Test_Func(make_ext_ref()),
+ Test_Func(make_pid()),
+ Test_Func(make_ext_pid()),
+ Test_Func(make_ext_port()),
+ Test_Func(make_ext_ref()),
Bin0 = list_to_binary(lists:seq(0, 14)),
- ?line Test_Func(Bin0),
+ Test_Func(Bin0),
Bin1 = list_to_binary(lists:seq(0, ?heap_binary_size)),
- ?line Test_Func(Bin1),
+ Test_Func(Bin1),
Bin2 = list_to_binary(lists:seq(0, ?heap_binary_size+1)),
- ?line Test_Func(Bin2),
+ Test_Func(Bin2),
Bin3 = list_to_binary(lists:seq(0, 255)),
garbage_collect(),
Pib = process_info(self(),binary),
- ?line Test_Func(Bin3),
+ Test_Func(Bin3),
garbage_collect(),
case Mode of
- strict -> ?line Pib = process_info(self(),binary);
+ strict -> Pib = process_info(self(),binary);
skip_refc_check -> ok
end,
- ?line Test_Func(make_unaligned_sub_binary(Bin0)),
- ?line Test_Func(make_unaligned_sub_binary(Bin1)),
- ?line Test_Func(make_unaligned_sub_binary(Bin2)),
- ?line Test_Func(make_unaligned_sub_binary(Bin3)),
-
- ?line Test_Func(make_sub_binary(lists:seq(42, 43))),
- ?line Test_Func(make_sub_binary([42,43,44])),
- ?line Test_Func(make_sub_binary([42,43,44,45])),
- ?line Test_Func(make_sub_binary([42,43,44,45,46])),
- ?line Test_Func(make_sub_binary([42,43,44,45,46,47])),
- ?line Test_Func(make_sub_binary([42,43,44,45,46,47,48])),
- ?line Test_Func(make_sub_binary(lists:seq(42, 49))),
- ?line Test_Func(make_sub_binary(lists:seq(0, 14))),
- ?line Test_Func(make_sub_binary(lists:seq(0, ?heap_binary_size))),
- ?line Test_Func(make_sub_binary(lists:seq(0, ?heap_binary_size+1))),
- ?line Test_Func(make_sub_binary(lists:seq(0, 255))),
-
- ?line Test_Func(make_unaligned_sub_binary(lists:seq(42, 43))),
- ?line Test_Func(make_unaligned_sub_binary([42,43,44])),
- ?line Test_Func(make_unaligned_sub_binary([42,43,44,45])),
- ?line Test_Func(make_unaligned_sub_binary([42,43,44,45,46])),
- ?line Test_Func(make_unaligned_sub_binary([42,43,44,45,46,47])),
- ?line Test_Func(make_unaligned_sub_binary([42,43,44,45,46,47,48])),
- ?line Test_Func(make_unaligned_sub_binary(lists:seq(42, 49))),
- ?line Test_Func(make_unaligned_sub_binary(lists:seq(0, 14))),
- ?line Test_Func(make_unaligned_sub_binary(lists:seq(0, ?heap_binary_size))),
- ?line Test_Func(make_unaligned_sub_binary(lists:seq(0, ?heap_binary_size+1))),
- ?line Test_Func(make_unaligned_sub_binary(lists:seq(0, 255))),
+ Test_Func(make_unaligned_sub_binary(Bin0)),
+ Test_Func(make_unaligned_sub_binary(Bin1)),
+ Test_Func(make_unaligned_sub_binary(Bin2)),
+ Test_Func(make_unaligned_sub_binary(Bin3)),
+
+ Test_Func(make_sub_binary(lists:seq(42, 43))),
+ Test_Func(make_sub_binary([42,43,44])),
+ Test_Func(make_sub_binary([42,43,44,45])),
+ Test_Func(make_sub_binary([42,43,44,45,46])),
+ Test_Func(make_sub_binary([42,43,44,45,46,47])),
+ Test_Func(make_sub_binary([42,43,44,45,46,47,48])),
+ Test_Func(make_sub_binary(lists:seq(42, 49))),
+ Test_Func(make_sub_binary(lists:seq(0, 14))),
+ Test_Func(make_sub_binary(lists:seq(0, ?heap_binary_size))),
+ Test_Func(make_sub_binary(lists:seq(0, ?heap_binary_size+1))),
+ Test_Func(make_sub_binary(lists:seq(0, 255))),
+
+ Test_Func(make_unaligned_sub_binary(lists:seq(42, 43))),
+ Test_Func(make_unaligned_sub_binary([42,43,44])),
+ Test_Func(make_unaligned_sub_binary([42,43,44,45])),
+ Test_Func(make_unaligned_sub_binary([42,43,44,45,46])),
+ Test_Func(make_unaligned_sub_binary([42,43,44,45,46,47])),
+ Test_Func(make_unaligned_sub_binary([42,43,44,45,46,47,48])),
+ Test_Func(make_unaligned_sub_binary(lists:seq(42, 49))),
+ Test_Func(make_unaligned_sub_binary(lists:seq(0, 14))),
+ Test_Func(make_unaligned_sub_binary(lists:seq(0, ?heap_binary_size))),
+ Test_Func(make_unaligned_sub_binary(lists:seq(0, ?heap_binary_size+1))),
+ Test_Func(make_unaligned_sub_binary(lists:seq(0, 255))),
%% Bit level binaries.
- ?line Test_Func(<<1:1>>),
- ?line Test_Func(<<2:2>>),
- ?line Test_Func(<<42:10>>),
- ?line Test_Func(list_to_bitstring([<<5:6>>|lists:seq(0, 255)])),
+ Test_Func(<<1:1>>),
+ Test_Func(<<2:2>>),
+ Test_Func(<<42:10>>),
+ Test_Func(list_to_bitstring([<<5:6>>|lists:seq(0, 255)])),
- ?line Test_Func(F = fun(A) -> 42*A end),
- ?line Test_Func(lists:duplicate(32, F)),
+ Test_Func(F = fun(A) -> 42*A end),
+ Test_Func(lists:duplicate(32, F)),
- ?line Test_Func(FF = fun binary_SUITE:all/1),
- ?line Test_Func(lists:duplicate(32, FF)),
+ Test_Func(FF = fun binary_SUITE:all/1),
+ Test_Func(lists:duplicate(32, FF)),
garbage_collect(),
case Mode of
- strict -> ?line Pib0 = process_info(self(),binary);
+ strict -> Pib0 = process_info(self(),binary);
skip_refc_check -> ok
end,
ok.
@@ -6271,18 +6051,18 @@ very_big_num() ->
very_big_num(33, 1).
very_big_num(Left, Result) when Left > 0 ->
- ?line very_big_num(Left-1, Result*256);
+ very_big_num(Left-1, Result*256);
very_big_num(0, Result) ->
- ?line Result.
+ Result.
make_port() ->
- ?line open_port({spawn, "efile"}, [eof]).
+ open_port({spawn, "efile"}, [eof]).
make_pid() ->
- ?line spawn_link(?MODULE, sleeper, []).
+ spawn_link(?MODULE, sleeper, []).
sleeper() ->
- ?line receive after infinity -> ok end.
+ receive after infinity -> ok end.
make_ext_pid() ->
{Pid, _, _} = get(externals),
@@ -6340,11 +6120,11 @@ mk_pid({NodeName, Creation}, Number, Serial) when is_atom(NodeName) ->
mk_pid({NodeNameExt, Creation}, Number, Serial);
mk_pid({NodeNameExt, Creation}, Number, Serial) ->
case catch binary_to_term(list_to_binary([?VERSION_MAGIC,
- ?PID_EXT,
- NodeNameExt,
- uint32_be(Number),
- uint32_be(Serial),
- uint8(Creation)])) of
+ ?PID_EXT,
+ NodeNameExt,
+ uint32_be(Number),
+ uint32_be(Serial),
+ uint8(Creation)])) of
Pid when is_pid(Pid) ->
Pid;
{'EXIT', {badarg, _}} ->
@@ -6434,7 +6214,7 @@ repeat_for_opts(F, [], Acc) ->
_ -> [RV | RV_Acc]
end
end
- end, [], Acc);
+ end, [], Acc);
repeat_for_opts(F, [OptList | Tail], []) when is_list(OptList) ->
repeat_for_opts(F, Tail, [[Opt] || Opt <- OptList]);
repeat_for_opts(F, [OptList | Tail], AccList) when is_list(OptList) ->
@@ -6446,7 +6226,7 @@ repeat_for_opts_atom2list(all_types) -> [set,ordered_set,bag,duplicate_bag];
repeat_for_opts_atom2list(write_concurrency) -> [{write_concurrency,false},{write_concurrency,true}];
repeat_for_opts_atom2list(read_concurrency) -> [{read_concurrency,false},{read_concurrency,true}];
repeat_for_opts_atom2list(compressed) -> [compressed,void].
-
+
ets_new(Name, Opts) ->
%%ets:new(Name, [compressed | Opts]).
ets:new(Name, Opts).
diff --git a/lib/stdlib/test/ets_tough_SUITE.erl b/lib/stdlib/test/ets_tough_SUITE.erl
index 5c2ab4747c..c83c17217b 100644
--- a/lib/stdlib/test/ets_tough_SUITE.erl
+++ b/lib/stdlib/test/ets_tough_SUITE.erl
@@ -25,7 +25,9 @@
-compile([export_all]).
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,5}}].
all() ->
[ex1].
@@ -52,34 +54,31 @@ end_per_group(_GroupName, Config) ->
-define(GLOBAL_PARAMS,ets_tough_SUITE_global_params).
init_per_testcase(_Func, Config) ->
- Dog=test_server:timetrap(test_server:seconds(300)),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Func, _Config) ->
ets:delete(?GLOBAL_PARAMS).
ex1(Config) when is_list(Config) ->
- ?line ets:new(?GLOBAL_PARAMS,[named_table,public]),
- ?line ets:insert(?GLOBAL_PARAMS,{a,set}),
- ?line ets:insert(?GLOBAL_PARAMS,{b,set}),
- ?line ex1_sub(Config),
- ?line ets:insert(?GLOBAL_PARAMS,{a,ordered_set}),
- ?line ets:insert(?GLOBAL_PARAMS,{b,set}),
- ?line ex1_sub(Config),
- ?line ets:insert(?GLOBAL_PARAMS,{a,ordered_set}),
- ?line ets:insert(?GLOBAL_PARAMS,{b,ordered_set}),
- ?line ex1_sub(Config).
-
-
+ ets:new(?GLOBAL_PARAMS,[named_table,public]),
+ ets:insert(?GLOBAL_PARAMS,{a,set}),
+ ets:insert(?GLOBAL_PARAMS,{b,set}),
+ ex1_sub(Config),
+ ets:insert(?GLOBAL_PARAMS,{a,ordered_set}),
+ ets:insert(?GLOBAL_PARAMS,{b,set}),
+ ex1_sub(Config),
+ ets:insert(?GLOBAL_PARAMS,{a,ordered_set}),
+ ets:insert(?GLOBAL_PARAMS,{b,ordered_set}),
+ ex1_sub(Config).
+
+
ex1_sub(Config) ->
{A,B} = prep(Config),
N =
- case ?config(ets_tough_SUITE_iters,Config) of
+ case proplists:get_value(ets_tough_SUITE_iters,Config) of
undefined ->
5000;
Other ->
@@ -94,7 +93,7 @@ ex1_sub(Config) ->
prep(Config) ->
rand:seed(exsplus),
put(dump_ticket,none),
- DumpDir = filename:join(?config(priv_dir,Config), "ets_tough"),
+ DumpDir = filename:join(proplists:get_value(priv_dir,Config), "ets_tough"),
file:make_dir(DumpDir),
put(dump_dir,DumpDir),
process_flag(trap_exit,true),
@@ -188,9 +187,9 @@ operate(dump,A,_B) ->
NewTicket = ddump_next(A,Units,Ticket),
put(dump_ticket,NewTicket),
_Result = case NewTicket of
- done -> done;
- _ -> dump_more
- end,
+ done -> done;
+ _ -> dump_more
+ end,
?DEBUG(io:format("dump ~w (~w)\n",[Units,_Result]));
_ ->
DumpDir = get(dump_dir),
@@ -211,7 +210,7 @@ operate(dump,A,_B) ->
ok
end
end.
-
+
random_operation() ->
Ops = {get,put,erase,dirty_get,dump},
random_element(Ops).
@@ -246,7 +245,7 @@ show_table(N) ->
_ ->
error
end.
-
+
show_entries(Fd) ->
case phys_read_len(Fd) of
{ok,Len} ->
@@ -370,7 +369,7 @@ derase(ServerPid,Class,Key) ->
dget_class(ServerPid,Class,Condition) ->
gen_server:call(ServerPid,
- {handle_get_class,Class,Condition},infinity).
+ {handle_get_class,Class,Condition},infinity).
%%% derase_class(ServerPid,Class) -> ok
%%%
@@ -828,7 +827,7 @@ table_lookup_batch([],_Class,_Cond) ->
[];
table_lookup_batch([Table|Tables],Class,Cond) ->
table_lookup_batch([],Tables,Table,ets:first(Table),Class,Cond,[]).
-
+
table_lookup_batch(_Passed,[],_,'$end_of_table',_Class,_Cond,Ack) ->
Ack;
table_lookup_batch(Passed,[NewTable|Tables],Table,'$end_of_table',
@@ -838,7 +837,7 @@ table_lookup_batch(Passed,[NewTable|Tables],Table,'$end_of_table',
table_lookup_batch(Passed,Tables,Table,?ERASE_MARK(Key),Class,Cond,Ack) ->
table_lookup_batch(Passed,Tables,Table,?ets_next(Table,?ERASE_MARK(Key)),
Class,Cond,Ack);
-
+
table_lookup_batch(Passed,Tables,Table,Key,Class,Cond,Ack) ->
NewAck =
case table_lookup(Passed,Key) of
@@ -1069,7 +1068,7 @@ phys_load_table(DumpDir,N,Tab) ->
Other ->
{error,{open_error,Other}}
end.
-
+
phys_load_entries(Fd,Tab) ->
case phys_read_len(Fd) of
{ok,Len} ->
diff --git a/lib/stdlib/test/file_sorter_SUITE.erl b/lib/stdlib/test/file_sorter_SUITE.erl
index 947dc2ad8d..379f4d609b 100644
--- a/lib/stdlib/test/file_sorter_SUITE.erl
+++ b/lib/stdlib/test/file_sorter_SUITE.erl
@@ -19,7 +19,7 @@
%%
-module(file_sorter_SUITE).
-%-define(debug, true).
+%%-define(debug, true).
-ifdef(debug).
-define(format(S, A), io:format(S, A)).
@@ -30,7 +30,7 @@
-else.
-include_lib("common_test/include/ct.hrl").
-define(format(S, A), ok).
--define(privdir(Conf), ?config(priv_dir, Conf)).
+-define(privdir(Conf), proplists:get_value(priv_dir, Conf)).
-endif.
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
@@ -49,15 +49,14 @@
-export([init_per_testcase/2, end_per_testcase/2]).
init_per_testcase(_Case, Config) ->
- Dog=?t:timetrap(?t:minutes(2)),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[basic, badarg, term_sort, term_keysort,
@@ -83,377 +82,323 @@ end_per_group(_GroupName, Config) ->
Config.
-basic(doc) ->
- ["Basic test case."];
-basic(suite) ->
- [];
+%% Basic test case.
basic(Config) when is_list(Config) ->
Fmt = binary,
Arg = {format,Fmt},
Foo = outfile("foo", Config),
P0 = pps(),
- ?line F1s = [F1] = to_files([[]], Fmt, Config),
- ?line ok = file_sorter:sort(F1),
- ?line [] = from_files(F1, Fmt),
- ?line ok = file_sorter:keysort(17, F1),
- ?line [] = from_files(F1, Fmt),
- ?line ok = file_sorter:merge(F1s, Foo),
- ?line [] = from_files(Foo, Fmt),
- ?line delete_files(Foo),
- ?line ok = file_sorter:keymerge(17, F1s, Foo),
- ?line [] = from_files(Foo, Fmt),
- ?line delete_files([Foo | F1s]),
-
- ?line [F2] = to_files([[foo,bar]], Fmt, Config),
- ?line ok = file_sorter:sort([F2], F2, Arg),
- ?line [bar,foo] = from_files(F2, Fmt),
- ?line delete_files(F2),
-
- ?line Fs1 = to_files([[foo],[bar]], Fmt, Config),
- ?line ok = file_sorter:sort(Fs1, Foo, Arg),
- ?line [bar,foo] = from_files(Foo, Fmt),
- ?line delete_files(Foo),
- ?line ok = file_sorter:merge(Fs1, Foo, Arg),
- ?line [bar,foo] = from_files(Foo, Fmt),
- ?line delete_files([Foo | Fs1]),
-
- ?line Fmt2 = binary_term,
- ?line Arg2 = {format, Fmt2},
- ?line [F3] = to_files([[{foo,1},{bar,2}]], Fmt2, Config),
- ?line ok = file_sorter:keysort([2], [F3], F3, Arg2),
- ?line [{foo,1},{bar,2}] = from_files(F3, Fmt2),
- ?line delete_files(F3),
-
- ?line Fs2 = to_files([[{foo,1}],[{bar,2}]], Fmt2, Config),
- ?line ok = file_sorter:keysort(1, Fs2, Foo, Arg2),
- ?line [{bar,2},{foo,1}] = from_files(Foo, Fmt2),
- ?line delete_files(Foo),
- ?line ok = file_sorter:keymerge(1, Fs2, Foo, Arg2),
- ?line [{bar,2},{foo,1}] = from_files(Foo, Fmt2),
- ?line delete_files([Foo | Fs2]),
-
- ?line true = P0 =:= pps(),
+ F1s = [F1] = to_files([[]], Fmt, Config),
+ ok = file_sorter:sort(F1),
+ [] = from_files(F1, Fmt),
+ ok = file_sorter:keysort(17, F1),
+ [] = from_files(F1, Fmt),
+ ok = file_sorter:merge(F1s, Foo),
+ [] = from_files(Foo, Fmt),
+ delete_files(Foo),
+ ok = file_sorter:keymerge(17, F1s, Foo),
+ [] = from_files(Foo, Fmt),
+ delete_files([Foo | F1s]),
+
+ [F2] = to_files([[foo,bar]], Fmt, Config),
+ ok = file_sorter:sort([F2], F2, Arg),
+ [bar,foo] = from_files(F2, Fmt),
+ delete_files(F2),
+
+ Fs1 = to_files([[foo],[bar]], Fmt, Config),
+ ok = file_sorter:sort(Fs1, Foo, Arg),
+ [bar,foo] = from_files(Foo, Fmt),
+ delete_files(Foo),
+ ok = file_sorter:merge(Fs1, Foo, Arg),
+ [bar,foo] = from_files(Foo, Fmt),
+ delete_files([Foo | Fs1]),
+
+ Fmt2 = binary_term,
+ Arg2 = {format, Fmt2},
+ [F3] = to_files([[{foo,1},{bar,2}]], Fmt2, Config),
+ ok = file_sorter:keysort([2], [F3], F3, Arg2),
+ [{foo,1},{bar,2}] = from_files(F3, Fmt2),
+ delete_files(F3),
+
+ Fs2 = to_files([[{foo,1}],[{bar,2}]], Fmt2, Config),
+ ok = file_sorter:keysort(1, Fs2, Foo, Arg2),
+ [{bar,2},{foo,1}] = from_files(Foo, Fmt2),
+ delete_files(Foo),
+ ok = file_sorter:keymerge(1, Fs2, Foo, Arg2),
+ [{bar,2},{foo,1}] = from_files(Foo, Fmt2),
+ delete_files([Foo | Fs2]),
+
+ true = P0 =:= pps(),
ok.
-badarg(doc) ->
- ["Call functions with bad arguments."];
-badarg(suite) ->
- [];
+%% Call functions with bad arguments.
badarg(Config) when is_list(Config) ->
PrivDir = ?privdir(Config),
BadFile = filename:join(PrivDir, "not_a_file"),
ABadFile = filename:absname(BadFile),
- ?line file:delete(BadFile),
- ?line {error,{file_error,ABadFile,enoent}} =
+ file:delete(BadFile),
+ {error,{file_error,ABadFile,enoent}} =
file_sorter:sort(BadFile),
- ?line {'EXIT', {{badarg, {flipp}}, _}} =
+ {'EXIT', {{badarg, {flipp}}, _}} =
(catch file_sorter:sort({flipp})),
- ?line {error,{file_error,ABadFile,enoent}} =
+ {error,{file_error,ABadFile,enoent}} =
file_sorter:keysort(1, BadFile),
- ?line {'EXIT', {{badarg, {flipp}}, _}} =
+ {'EXIT', {{badarg, {flipp}}, _}} =
(catch file_sorter:keysort(1, {flipp})),
- ?line {'EXIT', {{badarg, {flipp}}, _}} =
+ {'EXIT', {{badarg, {flipp}}, _}} =
(catch file_sorter:merge([{flipp}],foo)),
- ?line {error,{file_error,ABadFile,enoent}} =
+ {error,{file_error,ABadFile,enoent}} =
file_sorter:keymerge(1,[BadFile],foo),
- ?line {'EXIT', {{badarg, {flipp}}, _}} =
+ {'EXIT', {{badarg, {flipp}}, _}} =
(catch file_sorter:keymerge(1,[{flipp}],foo)),
- ?line {'EXIT', {{badarg, _}, _}} =
+ {'EXIT', {{badarg, _}, _}} =
(catch file_sorter:merge(fun(X) -> X end, foo)),
- ?line {'EXIT', {{badarg, _}, _}} =
+ {'EXIT', {{badarg, _}, _}} =
(catch file_sorter:keymerge(1, fun(X) -> X end, foo)),
- ?line {error,{file_error,ABadFile,enoent}} =
+ {error,{file_error,ABadFile,enoent}} =
file_sorter:check(BadFile),
- ?line {'EXIT', {{badarg, {flipp}}, _}} =
+ {'EXIT', {{badarg, {flipp}}, _}} =
(catch file_sorter:check({flipp})),
- ?line {error,{file_error,ABadFile,enoent}} =
+ {error,{file_error,ABadFile,enoent}} =
file_sorter:keycheck(1, BadFile),
- ?line {'EXIT', {{badarg, {flipp}}, _}} =
+ {'EXIT', {{badarg, {flipp}}, _}} =
(catch file_sorter:keycheck(1, {flipp})),
- ?line {'EXIT', {{badarg, {flipp}}, _}} =
+ {'EXIT', {{badarg, {flipp}}, _}} =
(catch file_sorter:check([{flipp}],foo)),
- ?line {'EXIT', {{badarg, {flipp}}, _}} =
+ {'EXIT', {{badarg, {flipp}}, _}} =
(catch file_sorter:keycheck(1,[{flipp}],foo)),
- ?line {'EXIT', {{badarg, _}, _}} =
+ {'EXIT', {{badarg, _}, _}} =
(catch file_sorter:check(fun(X) -> X end, foo)),
- ?line {'EXIT', {{badarg, _}, _}} =
+ {'EXIT', {{badarg, _}, _}} =
(catch file_sorter:keycheck(1, fun(X) -> X end, foo)),
- ?line Fs1 = to_files([[1,2,3]], binary_term, Config),
- ?line {'EXIT', {{badarg, flipp}, _}} =
+ Fs1 = to_files([[1,2,3]], binary_term, Config),
+ {'EXIT', {{badarg, flipp}, _}} =
(catch file_sorter:check(Fs1 ++ flipp, [])),
[F1] = Fs1,
- ?line {error,{file_error,_,_}} =
+ {error,{file_error,_,_}} =
file_sorter:sort(Fs1, foo, [{tmpdir,F1},{size,0}]),
- ?line delete_files(Fs1),
- ?line Fs2 = to_files([[1,2,3]], binary_term, Config),
+ delete_files(Fs1),
+ Fs2 = to_files([[1,2,3]], binary_term, Config),
{error,{file_error,_,enoent}} =
file_sorter:sort(Fs2, foo, [{tmpdir,filename:absname(BadFile)},
{size,0}]),
- ?line delete_files(Fs2),
+ delete_files(Fs2),
- ?line {'EXIT', {{badarg, bad}, _}} =
+ {'EXIT', {{badarg, bad}, _}} =
(catch file_sorter:check([], [{format,term} | bad])),
- ?line {'EXIT', {{badarg, [{flipp}]}, _}} =
+ {'EXIT', {{badarg, [{flipp}]}, _}} =
(catch file_sorter:check([{flipp}])),
- ?line {'EXIT', {{badarg, {flipp}}, _}} =
+ {'EXIT', {{badarg, {flipp}}, _}} =
(catch file_sorter:keycheck(1, {flipp})),
- ?line {'EXIT', {{badarg, [{flipp}]}, _}} =
+ {'EXIT', {{badarg, [{flipp}]}, _}} =
(catch file_sorter:keycheck(2, [{flipp}])),
- ?line {error,{file_error,_,eisdir}} = file_sorter:keycheck(1, []),
- ?line {'EXIT', {{badarg, kp}, _}} = (catch file_sorter:keycheck(kp, [])),
- ?line {'EXIT', {{badarg, kp}, _}} =
+ {error,{file_error,_,eisdir}} = file_sorter:keycheck(1, []),
+ {'EXIT', {{badarg, kp}, _}} = (catch file_sorter:keycheck(kp, [])),
+ {'EXIT', {{badarg, kp}, _}} =
(catch file_sorter:keycheck([1, kp], [])),
- ?line {'EXIT', {{badarg, kp}, _}} =
+ {'EXIT', {{badarg, kp}, _}} =
(catch file_sorter:keycheck([1 | kp], [])),
- ?line {'EXIT', {{badarg, []}, _}} = (catch file_sorter:keycheck([], [])),
- ?line {'EXIT', {{badarg, {format, foo}}, _}} =
+ {'EXIT', {{badarg, []}, _}} = (catch file_sorter:keycheck([], [])),
+ {'EXIT', {{badarg, {format, foo}}, _}} =
(catch file_sorter:check([], {format,foo})),
- ?line {'EXIT', {{badarg, not_an_option}, _}} =
+ {'EXIT', {{badarg, not_an_option}, _}} =
(catch file_sorter:keycheck(7, [], [not_an_option])),
- ?line {'EXIT', {{badarg, format}, _}} =
+ {'EXIT', {{badarg, format}, _}} =
(catch file_sorter:keycheck(1, [], [{format, binary}])),
- ?line {'EXIT', {{badarg, order}, _}} =
+ {'EXIT', {{badarg, order}, _}} =
(catch file_sorter:keycheck(1, [], [{order, fun compare/2}])),
- ?line do_badarg(fun(I, O) -> file_sorter:sort(I, O) end,
- fun(Kp, I, O) -> file_sorter:keysort(Kp, I, O) end,
- BadFile),
- ?line do_badarg_opt(fun(I, O, X) -> file_sorter:sort(I, O, X) end,
- fun(Kp, I, O, X) -> file_sorter:keysort(Kp, I, O, X)
- end),
- ?line do_badarg(fun(I, O) -> file_sorter:merge(I, O) end,
- fun(Kp, I, O) -> file_sorter:keymerge(Kp, I, O) end,
- BadFile),
- ?line do_badarg_opt(fun(I, O, X) -> file_sorter:merge(I, O, X) end,
- fun(Kp, I, O, X) -> file_sorter:keymerge(Kp, I, O, X)
- end).
+ do_badarg(fun(I, O) -> file_sorter:sort(I, O) end,
+ fun(Kp, I, O) -> file_sorter:keysort(Kp, I, O) end,
+ BadFile),
+ do_badarg_opt(fun(I, O, X) -> file_sorter:sort(I, O, X) end,
+ fun(Kp, I, O, X) -> file_sorter:keysort(Kp, I, O, X)
+ end),
+ do_badarg(fun(I, O) -> file_sorter:merge(I, O) end,
+ fun(Kp, I, O) -> file_sorter:keymerge(Kp, I, O) end,
+ BadFile),
+ do_badarg_opt(fun(I, O, X) -> file_sorter:merge(I, O, X) end,
+ fun(Kp, I, O, X) -> file_sorter:keymerge(Kp, I, O, X)
+ end).
do_badarg(F, KF, BadFile) ->
[Char | _] = BadFile,
AFlipp = filename:absname(flipp),
- ?line {error,{file_error,AFlipp,enoent}} = F([flipp | flopp], foo),
- ?line {'EXIT', {{badarg, {foo,bar}}, _}} = (catch F([], {foo,bar})),
- ?line {'EXIT', {{badarg, Char}, _}} = (catch F(BadFile, [])),
- ?line {'EXIT', {{badarg, {flipp}}, _}} = (catch F({flipp}, [])),
-
- ?line {'EXIT', {{badarg, Char}, _}} = (catch KF(1, BadFile, [])),
- ?line {'EXIT', {{badarg, {flipp}}, _}} = (catch KF(1, {flipp}, [])),
- ?line {error,{file_error,AFlipp,enoent}} =
+ {error,{file_error,AFlipp,enoent}} = F([flipp | flopp], foo),
+ {'EXIT', {{badarg, {foo,bar}}, _}} = (catch F([], {foo,bar})),
+ {'EXIT', {{badarg, Char}, _}} = (catch F(BadFile, [])),
+ {'EXIT', {{badarg, {flipp}}, _}} = (catch F({flipp}, [])),
+
+ {'EXIT', {{badarg, Char}, _}} = (catch KF(1, BadFile, [])),
+ {'EXIT', {{badarg, {flipp}}, _}} = (catch KF(1, {flipp}, [])),
+ {error,{file_error,AFlipp,enoent}} =
KF(2, [flipp | flopp], foo),
- ?line {'EXIT', {{badarg, {foo,bar}}, _}} = (catch KF(1, [], {foo,bar})),
- ?line {'EXIT', {{badarg, kp}, _}} = (catch KF(kp, [], foo)),
- ?line {'EXIT', {{badarg, kp}, _}} = (catch KF([1, kp], [], foo)),
- ?line {'EXIT', {{badarg, kp}, _}} = (catch KF([1 | kp], [], foo)),
- ?line {'EXIT', {{badarg, []}, _}} = (catch KF([], [], foo)),
+ {'EXIT', {{badarg, {foo,bar}}, _}} = (catch KF(1, [], {foo,bar})),
+ {'EXIT', {{badarg, kp}, _}} = (catch KF(kp, [], foo)),
+ {'EXIT', {{badarg, kp}, _}} = (catch KF([1, kp], [], foo)),
+ {'EXIT', {{badarg, kp}, _}} = (catch KF([1 | kp], [], foo)),
+ {'EXIT', {{badarg, []}, _}} = (catch KF([], [], foo)),
ok.
do_badarg_opt(F, KF) ->
AFlipp = filename:absname(flipp),
- ?line {error,{file_error,AFlipp,enoent}} =
- F([flipp | flopp], foo, []),
- ?line {'EXIT', {{badarg, {flipp}}, _}} = (catch F([{flipp}], foo, [])),
- ?line {'EXIT', {{badarg, {out,put}}, _}} = (catch F([], {out,put}, [])),
- ?line {'EXIT', {{badarg, not_an_option}, _}} =
+ {error,{file_error,AFlipp,enoent}} =
+ F([flipp | flopp], foo, []),
+ {'EXIT', {{badarg, {flipp}}, _}} = (catch F([{flipp}], foo, [])),
+ {'EXIT', {{badarg, {out,put}}, _}} = (catch F([], {out,put}, [])),
+ {'EXIT', {{badarg, not_an_option}, _}} =
(catch F([], foo, [not_an_option])),
- ?line {'EXIT', {{badarg, {format, foo}}, _}} =
- (catch F([], foo, {format,foo})),
- ?line {'EXIT', {{badarg, {size,foo}}, _}} = (catch F([], foo, {size,foo})),
+ {'EXIT', {{badarg, {format, foo}}, _}} =
+ (catch F([], foo, {format,foo})),
+ {'EXIT', {{badarg, {size,foo}}, _}} = (catch F([], foo, {size,foo})),
- ?line {'EXIT', {{badarg, {size, -1}}, _}} = (catch F([], foo, {size,-1})),
- ?line {'EXIT', {{badarg, {no_files, foo}}, _}} =
+ {'EXIT', {{badarg, {size, -1}}, _}} = (catch F([], foo, {size,-1})),
+ {'EXIT', {{badarg, {no_files, foo}}, _}} =
(catch F([], foo, {no_files,foo})),
- ?line {'EXIT', {{badarg, {no_files, 1}}, _}} =
+ {'EXIT', {{badarg, {no_files, 1}}, _}} =
(catch F([], foo, {no_files,1})),
- ?line {'EXIT', {{badarg, 1}, _}} = (catch F([], foo, {tmpdir,1})),
- ?line {'EXIT', {{badarg, {order,1}}, _}} = (catch F([], foo, {order,1})),
- ?line {'EXIT', {{badarg, {compressed, flopp}}, _}} =
- (catch F([], foo, {compressed,flopp})),
- ?line {'EXIT', {{badarg, {unique,flopp}}, _}} =
- (catch F([], foo, {unique,flopp})),
- ?line {'EXIT', {{badarg, {header,foo}}, _}} =
+ {'EXIT', {{badarg, 1}, _}} = (catch F([], foo, {tmpdir,1})),
+ {'EXIT', {{badarg, {order,1}}, _}} = (catch F([], foo, {order,1})),
+ {'EXIT', {{badarg, {compressed, flopp}}, _}} =
+ (catch F([], foo, {compressed,flopp})),
+ {'EXIT', {{badarg, {unique,flopp}}, _}} =
+ (catch F([], foo, {unique,flopp})),
+ {'EXIT', {{badarg, {header,foo}}, _}} =
(catch F([], foo, {header,foo})),
- ?line {'EXIT', {{badarg, {header, 0}}, _}} =
+ {'EXIT', {{badarg, {header, 0}}, _}} =
(catch F([], foo, {header,0})),
- ?line {'EXIT', {{badarg, {header, 1 bsl 35}}, _}} =
+ {'EXIT', {{badarg, {header, 1 bsl 35}}, _}} =
(catch F([], foo, {header,1 bsl 35})),
- ?line {'EXIT', {{badarg, header}, _}} =
+ {'EXIT', {{badarg, header}, _}} =
(catch F([], foo, [{header,1},{format,term}])),
- ?line {'EXIT', {{badarg, not_an_option}, _}} =
+ {'EXIT', {{badarg, not_an_option}, _}} =
(catch KF(7, [], foo, [not_an_option])),
- ?line {'EXIT', {{badarg,format}, _}} =
+ {'EXIT', {{badarg,format}, _}} =
(catch KF(1, [], foo, [{format, binary}])),
- ?line {'EXIT', {{badarg, order}, _}} =
+ {'EXIT', {{badarg, order}, _}} =
(catch KF(1, [], foo, [{order, fun compare/2}])),
- ?line {'EXIT', {{badarg, {flipp}}, _}} =
+ {'EXIT', {{badarg, {flipp}}, _}} =
(catch KF(2, [{flipp}], foo,[])),
- ?line {error,{file_error,AFlipp,enoent}} =
+ {error,{file_error,AFlipp,enoent}} =
KF(2, [flipp | flopp], foo,[]),
- ?line {'EXIT', {{badarg, {out, put}}, _}} =
+ {'EXIT', {{badarg, {out, put}}, _}} =
(catch KF(1, [], {out,put}, [])),
- ?line {'EXIT', {{badarg, kp}, _}} = (catch KF(kp, [], foo, [])),
- ?line {'EXIT', {{badarg, kp}, _}} = (catch KF([1, kp], [], foo, [])),
- ?line {'EXIT', {{badarg, kp}, _}} = (catch KF([1 | kp], [], foo, [])),
+ {'EXIT', {{badarg, kp}, _}} = (catch KF(kp, [], foo, [])),
+ {'EXIT', {{badarg, kp}, _}} = (catch KF([1, kp], [], foo, [])),
+ {'EXIT', {{badarg, kp}, _}} = (catch KF([1 | kp], [], foo, [])),
ok.
-term_sort(doc) ->
- ["Sort terms on files."];
-term_sort(suite) ->
- [];
+%% Sort terms on files.
term_sort(Config) when is_list(Config) ->
- ?line sort(term, [{compressed,false}], Config),
- ?line sort(term, [{order, fun compare/2}], Config),
- ?line sort(term, [{order, ascending}, {compressed,true}], Config),
- ?line sort(term, [{order, descending}], Config),
+ sort(term, [{compressed,false}], Config),
+ sort(term, [{order, fun compare/2}], Config),
+ sort(term, [{order, ascending}, {compressed,true}], Config),
+ sort(term, [{order, descending}], Config),
ok.
-term_keysort(doc) ->
- ["Keysort terms on files."];
-term_keysort(suite) ->
- [];
+%% Keysort terms on files.
term_keysort(Config) when is_list(Config) ->
- ?line keysort(term, [{tmpdir, ""}], Config),
- ?line keysort(term, [{order,descending}], Config),
+ keysort(term, [{tmpdir, ""}], Config),
+ keysort(term, [{order,descending}], Config),
ok.
-binary_term_sort(doc) ->
- ["Sort binary terms on files."];
-binary_term_sort(suite) ->
- [];
+%% Sort binary terms on files.
binary_term_sort(Config) when is_list(Config) ->
PrivDir = ?privdir(Config),
- ?line sort({2, binary_term}, [], Config),
- ?line sort(binary_term, [{tmpdir, list_to_atom(PrivDir)}], Config),
- ?line sort(binary_term, [{tmpdir,PrivDir}], Config),
- ?line sort({3,binary_term}, [{order, fun compare/2}], Config),
- ?line sort(binary_term, [{order, fun compare/2}], Config),
- ?line sort(binary_term, [{order,descending}], Config),
+ sort({2, binary_term}, [], Config),
+ sort(binary_term, [{tmpdir, list_to_atom(PrivDir)}], Config),
+ sort(binary_term, [{tmpdir,PrivDir}], Config),
+ sort({3,binary_term}, [{order, fun compare/2}], Config),
+ sort(binary_term, [{order, fun compare/2}], Config),
+ sort(binary_term, [{order,descending}], Config),
ok.
-binary_term_keysort(doc) ->
- ["Keysort binary terms on files."];
-binary_term_keysort(suite) ->
- [];
+%% Keysort binary terms on files.
binary_term_keysort(Config) when is_list(Config) ->
- ?line keysort({3, binary_term}, [], Config),
- ?line keysort(binary_term, [], Config),
- ?line keysort(binary_term, [{order,descending}], Config),
+ keysort({3, binary_term}, [], Config),
+ keysort(binary_term, [], Config),
+ keysort(binary_term, [{order,descending}], Config),
ok.
-binary_sort(doc) ->
- ["Sort binaries on files."];
-binary_sort(suite) ->
- [];
+%% Sort binaries on files.
binary_sort(Config) when is_list(Config) ->
PrivDir = ?privdir(Config),
- ?line sort({2, binary}, [], Config),
- ?line sort(binary, [{tmpdir, list_to_atom(PrivDir)}], Config),
- ?line sort(binary, [{tmpdir,PrivDir}], Config),
- ?line sort({3,binary}, [{order, fun compare/2}], Config),
- ?line sort(binary, [{order, fun compare/2}], Config),
- ?line sort(binary, [{order,descending}], Config),
+ sort({2, binary}, [], Config),
+ sort(binary, [{tmpdir, list_to_atom(PrivDir)}], Config),
+ sort(binary, [{tmpdir,PrivDir}], Config),
+ sort({3,binary}, [{order, fun compare/2}], Config),
+ sort(binary, [{order, fun compare/2}], Config),
+ sort(binary, [{order,descending}], Config),
ok.
-term_merge(doc) ->
- ["Merge terms on files."];
-term_merge(suite) ->
- [];
+%% Merge terms on files.
term_merge(Config) when is_list(Config) ->
- ?line merge(term, [{order, fun compare/2}], Config),
- ?line merge(term, [{order, ascending}, {compressed,true}], Config),
- ?line merge(term, [{order, descending}, {compressed,false}], Config),
+ merge(term, [{order, fun compare/2}], Config),
+ merge(term, [{order, ascending}, {compressed,true}], Config),
+ merge(term, [{order, descending}, {compressed,false}], Config),
ok.
-term_keymerge(doc) ->
- ["Keymerge terms on files."];
-term_keymerge(suite) ->
- [];
+%% Keymerge terms on files.
term_keymerge(Config) when is_list(Config) ->
- ?line keymerge(term, [], Config),
- ?line keymerge(term, [{order, descending}], Config),
- ?line funmerge(term, [], Config),
+ keymerge(term, [], Config),
+ keymerge(term, [{order, descending}], Config),
+ funmerge(term, [], Config),
ok.
-binary_term_merge(doc) ->
- ["Merge binary terms on files."];
-binary_term_merge(suite) ->
- [];
+%% Merge binary terms on files.
binary_term_merge(Config) when is_list(Config) ->
- ?line merge(binary_term, [], Config),
- ?line merge({7, binary_term}, [], Config),
- ?line merge({3, binary_term}, [{order, fun compare/2}], Config),
+ merge(binary_term, [], Config),
+ merge({7, binary_term}, [], Config),
+ merge({3, binary_term}, [{order, fun compare/2}], Config),
ok.
-binary_term_keymerge(doc) ->
- ["Keymerge binary terms on files."];
-binary_term_keymerge(suite) ->
- [];
+%% Keymerge binary terms on files.
binary_term_keymerge(Config) when is_list(Config) ->
- ?line keymerge({3, binary_term}, [], Config),
- ?line keymerge(binary_term, [], Config),
- ?line funmerge({3, binary_term}, [], Config),
- ?line funmerge(binary_term, [], Config),
+ keymerge({3, binary_term}, [], Config),
+ keymerge(binary_term, [], Config),
+ funmerge({3, binary_term}, [], Config),
+ funmerge(binary_term, [], Config),
ok.
-binary_merge(doc) ->
- ["Merge binaries on files."];
-binary_merge(suite) ->
- [];
+%% Merge binaries on files.
binary_merge(Config) when is_list(Config) ->
- ?line merge(binary, [], Config),
- ?line merge({7, binary}, [], Config),
- ?line merge({3, binary}, [{order, fun compare/2}], Config),
+ merge(binary, [], Config),
+ merge({7, binary}, [], Config),
+ merge({3, binary}, [{order, fun compare/2}], Config),
ok.
-term_check(doc) ->
- ["Check terms on files."];
-term_check(suite) ->
- [];
+%% Check terms on files.
term_check(Config) when is_list(Config) ->
- ?line check(term, Config),
+ check(term, Config),
ok.
-binary_term_check(doc) ->
- ["Check binary terms on files."];
-binary_term_check(suite) ->
- [];
+%% Check binary terms on files.
binary_term_check(Config) when is_list(Config) ->
- ?line check(binary_term, Config),
+ check(binary_term, Config),
ok.
-term_keycheck(doc) ->
- ["Keycheck terms on files."];
-term_keycheck(suite) ->
- [];
+%% Keycheck terms on files.
term_keycheck(Config) when is_list(Config) ->
- ?line keycheck(term, Config),
+ keycheck(term, Config),
ok.
-binary_term_keycheck(doc) ->
- ["Keycheck binary terms on files."];
-binary_term_keycheck(suite) ->
- [];
+%% Keycheck binary terms on files.
binary_term_keycheck(Config) when is_list(Config) ->
- ?line keycheck(binary_term, Config),
+ keycheck(binary_term, Config),
ok.
-binary_check(doc) ->
- ["Check binary terms on files."];
-binary_check(suite) ->
- [];
+%% Check binary terms on files.
binary_check(Config) when is_list(Config) ->
- ?line check(binary, Config),
+ check(binary, Config),
ok.
-inout(doc) ->
- ["Funs as input or output."];
-inout(suite) ->
- [];
+%% Funs as input or output.
inout(Config) when is_list(Config) ->
BTF = {format, binary_term},
Foo = outfile("foo", Config),
@@ -462,52 +407,52 @@ inout(Config) when is_list(Config) ->
End = fun(read) -> end_of_input end,
IF1 = fun(read) -> {[1,7,5], End} end,
- ?line ok = file_sorter:sort(IF1, Foo, [{format, term}]),
+ ok = file_sorter:sort(IF1, Foo, [{format, term}]),
%% 'close' is called, but the return value is caught and ignored.
IF2 = fun(read) -> {[1,2,3], fun(close) -> throw(ignored) end} end,
- ?line {error, bad_object} = file_sorter:sort(IF2, Foo, BTF),
+ {error, bad_object} = file_sorter:sort(IF2, Foo, BTF),
IF3 = fun(no_match) -> foo end,
- ?line {'EXIT', {function_clause, _}} =
+ {'EXIT', {function_clause, _}} =
(catch file_sorter:sort(IF3, Foo)),
IF4 = fun(read) -> throw(my_message) end,
- ?line my_message = (catch file_sorter:sort(IF4, Foo)),
+ my_message = (catch file_sorter:sort(IF4, Foo)),
IF5 = fun(read) -> {error, my_error} end,
- ?line {error, my_error} = file_sorter:sort(IF5, Foo),
+ {error, my_error} = file_sorter:sort(IF5, Foo),
%% Output is fun.
- ?line {error, bad_object} =
+ {error, bad_object} =
file_sorter:sort(IF2, fun(close) -> ignored end, BTF),
Args = [{format, term}],
- ?line {error, bad_object} =
- file_sorter:keysort(1, IF2, fun(close) -> ignored end, Args),
+ {error, bad_object} =
+ file_sorter:keysort(1, IF2, fun(close) -> ignored end, Args),
OF1 = fun(close) -> fine; (L) when is_list(L) -> fun(close) -> nice end end,
- ?line nice = file_sorter:sort(IF1, OF1, Args),
+ nice = file_sorter:sort(IF1, OF1, Args),
OF2 = fun(_) -> my_return end,
- ?line my_return = file_sorter:sort(IF1, OF2, Args),
+ my_return = file_sorter:sort(IF1, OF2, Args),
OF3 = fun(_) -> throw(my_message) end,
- ?line my_message = (catch file_sorter:sort(IF1, OF3, Args)),
+ my_message = (catch file_sorter:sort(IF1, OF3, Args)),
OF4 = fun(no_match) -> foo end,
- ?line {'EXIT', {function_clause, _}} =
+ {'EXIT', {function_clause, _}} =
(catch file_sorter:sort(IF1, OF4, Args)),
- ?line P0 = pps(),
- ?line Fs1 = to_files([[3,1,2,5,4], [8,3,10]], term, Config),
- ?line error = file_sorter:sort(Fs1, fun(_) -> error end, Args),
- ?line delete_files(Fs1),
+ P0 = pps(),
+ Fs1 = to_files([[3,1,2,5,4], [8,3,10]], term, Config),
+ error = file_sorter:sort(Fs1, fun(_) -> error end, Args),
+ delete_files(Fs1),
- ?line true = P0 =:= pps(),
+ true = P0 =:= pps(),
%% Passing a value from the input functions to the output functions.
IFV1 = fun(read) -> {end_of_input, 17} end,
OFV1 = fun({value, Value}) -> ofv(Value, []) end,
- ?line {17, []} = file_sorter:sort(IFV1, OFV1, Args),
+ {17, []} = file_sorter:sort(IFV1, OFV1, Args),
%% Output is not a fun. The value returned by input funs is ignored.
%% OTP-5009.
- ?line ok = file_sorter:sort(IFV1, Foo, [{format,term}]),
- ?line [] = from_files(Foo, term),
- ?line delete_files(Foo),
+ ok = file_sorter:sort(IFV1, Foo, [{format,term}]),
+ [] = from_files(Foo, term),
+ delete_files(Foo),
ok.
@@ -518,10 +463,7 @@ ofv(Value, A) ->
ofv(Value, [L | A])
end.
-many(doc) ->
- ["Many temporary files."];
-many(suite) ->
- [];
+%% Many temporary files.
many(Config) when is_list(Config) ->
Foo = outfile("foo", Config),
PrivDir = ?privdir(Config),
@@ -530,171 +472,168 @@ many(Config) when is_list(Config) ->
Args = [{format, term}],
L1 = lists:map(fun(I) -> {one, two, three, I} end, lists:seq(1,1000)),
L2 = lists:map(fun(I) -> {four, five, six, I} end, lists:seq(1,1000)),
- ?line Fs2 = to_files([L1, L2], term, Config),
- ?line ok = file_sorter:sort(Fs2, Foo, [{size,1000} | Args]),
- ?line R = lists:sort(L1++L2),
- ?line R = from_files(Foo, term),
- ?line 2000 = length(R),
- ?line ok = file_sorter:sort(Fs2, Foo, [{no_files,4},{size,1000} | Args]),
- ?line R = from_files(Foo, term),
- ?line ok =
+ Fs2 = to_files([L1, L2], term, Config),
+ ok = file_sorter:sort(Fs2, Foo, [{size,1000} | Args]),
+ R = lists:sort(L1++L2),
+ R = from_files(Foo, term),
+ 2000 = length(R),
+ ok = file_sorter:sort(Fs2, Foo, [{no_files,4},{size,1000} | Args]),
+ R = from_files(Foo, term),
+ ok =
file_sorter:sort(Fs2, Foo,
[{no_files,4},{size,1000},{order,descending} | Args]),
- ?line true = lists:reverse(R) =:= from_files(Foo, term),
- ?line ok =
+ true = lists:reverse(R) =:= from_files(Foo, term),
+ ok =
file_sorter:sort(Fs2, Foo,
[{no_files,4},{size,1000},
{order,fun compare/2} | Args]),
- ?line R = from_files(Foo, term),
- ?line ok = file_sorter:keysort(4, Fs2, Foo,
- [{no_files,4},{size,1000} | Args]),
- ?line RK = lists:keysort(4, L1++L2),
- ?line RK = from_files(Foo, term),
- ?line delete_files(Foo),
- ?line ok =
+ R = from_files(Foo, term),
+ ok = file_sorter:keysort(4, Fs2, Foo,
+ [{no_files,4},{size,1000} | Args]),
+ RK = lists:keysort(4, L1++L2),
+ RK = from_files(Foo, term),
+ delete_files(Foo),
+ ok =
file_sorter:keysort(4, Fs2, Foo,
- [{no_files,4},{size,1000},{order,descending} | Args]),
- ?line true = lists:reverse(RK) =:= from_files(Foo, term),
- ?line delete_files(Foo),
- ?line ok = file_sorter:keysort(4, Fs2, Foo,
- [{size,500},{order,descending} | Args]),
- ?line true = lists:reverse(RK) =:= from_files(Foo, term),
- ?line delete_files(Foo),
- ?line error = file_sorter:sort(Fs2, fun(_) -> error end,
- [{tmpdir, PrivDir}, {no_files,3},
- {size,10000} | Args]),
+ [{no_files,4},{size,1000},{order,descending} | Args]),
+ true = lists:reverse(RK) =:= from_files(Foo, term),
+ delete_files(Foo),
+ ok = file_sorter:keysort(4, Fs2, Foo,
+ [{size,500},{order,descending} | Args]),
+ true = lists:reverse(RK) =:= from_files(Foo, term),
+ delete_files(Foo),
+ error = file_sorter:sort(Fs2, fun(_) -> error end,
+ [{tmpdir, PrivDir}, {no_files,3},
+ {size,10000} | Args]),
TmpDir = filename:join(PrivDir, "tmpdir"),
file:del_dir(TmpDir),
- ?line ok = file:make_dir(TmpDir),
- ?line case os:type() of
- {unix, _} ->
- ?line ok = file:change_mode(TmpDir, 8#0000),
- ?line {error, {file_error, _,_}} =
- file_sorter:sort(Fs2, fun(_M) -> foo end,
- [{no_files,3},{size,10000},
- {tmpdir,TmpDir} | Args]);
- _ ->
- true
- end,
- ?line ok = file:del_dir(TmpDir),
+ ok = file:make_dir(TmpDir),
+ case os:type() of
+ {unix, _} ->
+ ok = file:change_mode(TmpDir, 8#0000),
+ {error, {file_error, _,_}} =
+ file_sorter:sort(Fs2, fun(_M) -> foo end,
+ [{no_files,3},{size,10000},
+ {tmpdir,TmpDir} | Args]);
+ _ ->
+ true
+ end,
+ ok = file:del_dir(TmpDir),
delete_files(Fs2),
- ?line true = P0 =:= pps(),
+ true = P0 =:= pps(),
ok.
-misc(doc) ->
- ["Some other tests."];
-misc(suite) ->
- [];
+%% Some other tests.
misc(Config) when is_list(Config) ->
BTF = {format, binary_term},
Foo = outfile("foo", Config),
FFoo = filename:absname(Foo),
P0 = pps(),
- ?line [File] = Fs1 = to_files([[1,3,2]], term, Config),
- ?line ok = file:write_file(Foo,<<>>),
- ?line case os:type() of
- {unix, _} ->
- ok = file:change_mode(Foo, 8#0000),
- {error,{file_error,FFoo,eacces}} =
- file_sorter:sort(Fs1, Foo, {format,term});
- _ ->
- true
- end,
- ?line file:delete(Foo),
- ?line NoBytes = 16, % RAM memory will never get this big, or?
- ?line ALot = (1 bsl (NoBytes*8)) - 1,
- ?line ok = file:write_file(File, <<ALot:NoBytes/unit:8,"foobar">>),
+ [File] = Fs1 = to_files([[1,3,2]], term, Config),
+ ok = file:write_file(Foo,<<>>),
+ case os:type() of
+ {unix, _} ->
+ ok = file:change_mode(Foo, 8#0000),
+ {error,{file_error,FFoo,eacces}} =
+ file_sorter:sort(Fs1, Foo, {format,term});
+ _ ->
+ true
+ end,
+ file:delete(Foo),
+ NoBytes = 16, % RAM memory will never get this big, or?
+ ALot = (1 bsl (NoBytes*8)) - 1,
+ ok = file:write_file(File, <<ALot:NoBytes/unit:8,"foobar">>),
FFile = filename:absname(File),
- ?line {error, {bad_object,FFile}} =
+ {error, {bad_object,FFile}} =
file_sorter:sort(Fs1, Foo, [BTF, {header, 20}]),
- ?line ok = file:write_file(File, <<30:32,"foobar">>),
- ?line {error, {premature_eof, FFile}} = file_sorter:sort(Fs1, Foo, BTF),
- ?line ok = file:write_file(File, <<6:32,"foobar">>),
- ?line {error, {bad_object,FFile}} = file_sorter:sort(Fs1, Foo, BTF),
- ?line case os:type() of
- {unix, _} ->
- ok = file:change_mode(File, 8#0000),
- {error, {file_error,FFile,eacces}} =
- file_sorter:sort(Fs1, Foo),
- {error, {file_error,FFile,eacces}} =
- file_sorter:sort(Fs1, Foo, {format, binary_term});
- _ ->
- true
- end,
- ?line delete_files(Fs1),
- ?line true = P0 =:= pps(),
+ ok = file:write_file(File, <<30:32,"foobar">>),
+ {error, {premature_eof, FFile}} = file_sorter:sort(Fs1, Foo, BTF),
+ ok = file:write_file(File, <<6:32,"foobar">>),
+ {error, {bad_object,FFile}} = file_sorter:sort(Fs1, Foo, BTF),
+ case os:type() of
+ {unix, _} ->
+ ok = file:change_mode(File, 8#0000),
+ {error, {file_error,FFile,eacces}} =
+ file_sorter:sort(Fs1, Foo),
+ {error, {file_error,FFile,eacces}} =
+ file_sorter:sort(Fs1, Foo, {format, binary_term});
+ _ ->
+ true
+ end,
+ delete_files(Fs1),
+ true = P0 =:= pps(),
%% bigger than chunksize
- ?line E1 = <<32000:32, 10:256000>>,
- ?line E2 = <<32000:32, 5:256000>>,
- ?line E3 = <<32000:32, 8:256000>>,
- ?line ok = file:write_file(Foo, [E1, E2, E3]),
- ?line ok = file_sorter:sort([Foo], Foo, [{format,binary},{size,10000}]),
- ?line ok = file_sorter:sort([Foo], Foo, [{format,fun(X) -> X end},
- {size,10000}]),
- ?line Es = list_to_binary([E2,E3,E1]),
- ?line {ok, Es} = file:read_file(Foo),
- ?line delete_files(Foo),
- ?line true = P0 =:= pps(),
+ E1 = <<32000:32, 10:256000>>,
+ E2 = <<32000:32, 5:256000>>,
+ E3 = <<32000:32, 8:256000>>,
+ ok = file:write_file(Foo, [E1, E2, E3]),
+ ok = file_sorter:sort([Foo], Foo, [{format,binary},{size,10000}]),
+ ok = file_sorter:sort([Foo], Foo, [{format,fun(X) -> X end},
+ {size,10000}]),
+ Es = list_to_binary([E2,E3,E1]),
+ {ok, Es} = file:read_file(Foo),
+ delete_files(Foo),
+ true = P0 =:= pps(),
%% keysort more than one element
L = [{c,1,a},{c,2,b},{c,3,c},{b,1,c},{b,2,b},{b,3,a},{a,1,a},{a,2,b},
{a,3,c}],
- ?line Fs2 = to_files([L], binary_term, Config),
- ?line ok = file_sorter:keysort([2,3], Fs2, Foo, {format, binary_term}),
- ?line KS2_1 = from_files(Foo, binary_term),
- ?line KS2_2 = lists:keysort(2,lists:keysort(3, L)),
- ?line KS2_1 = KS2_2,
- ?line ok = file_sorter:keysort([2,3], Fs2, Foo,
- [{format, binary_term},{size,5}]),
- ?line KS2_3 = from_files(Foo, binary_term),
- ?line KS2_3 = KS2_2,
- ?line ok = file_sorter:keysort([2,3,1], Fs2, Foo, {format, binary_term}),
- ?line KS3_1 = from_files(Foo, binary_term),
- ?line KS3_2 = lists:keysort(2, lists:keysort(3,lists:keysort(1, L))),
- ?line KS3_1 = KS3_2,
- ?line ok = file_sorter:keysort([2,3,1], Fs2, Foo,
- [{format, binary_term},{size,5}]),
- ?line KS3_3 = from_files(Foo, binary_term),
- ?line KS3_3 = KS3_2,
- ?line delete_files([Foo | Fs2]),
- ?line true = P0 =:= pps(),
+ Fs2 = to_files([L], binary_term, Config),
+ ok = file_sorter:keysort([2,3], Fs2, Foo, {format, binary_term}),
+ KS2_1 = from_files(Foo, binary_term),
+ KS2_2 = lists:keysort(2,lists:keysort(3, L)),
+ KS2_1 = KS2_2,
+ ok = file_sorter:keysort([2,3], Fs2, Foo,
+ [{format, binary_term},{size,5}]),
+ KS2_3 = from_files(Foo, binary_term),
+ KS2_3 = KS2_2,
+ ok = file_sorter:keysort([2,3,1], Fs2, Foo, {format, binary_term}),
+ KS3_1 = from_files(Foo, binary_term),
+ KS3_2 = lists:keysort(2, lists:keysort(3,lists:keysort(1, L))),
+ KS3_1 = KS3_2,
+ ok = file_sorter:keysort([2,3,1], Fs2, Foo,
+ [{format, binary_term},{size,5}]),
+ KS3_3 = from_files(Foo, binary_term),
+ KS3_3 = KS3_2,
+ delete_files([Foo | Fs2]),
+ true = P0 =:= pps(),
%% bigger than chunksize
%% Assumes that CHUNKSIZE = 16384. Illustrates that the Last argument
%% of merge_files/5 is necessary.
- ?line EP1 = erlang:make_tuple(2728,foo),
- ?line EP2 = lists:duplicate(2729,qqq),
- ?line LL = [EP1, EP2, EP1, EP2, EP1, EP2],
- ?line Fs3 = to_files([LL], binary, Config),
- ?line ok = file_sorter:sort(Fs3, Foo, [{format,binary}, {unique,true}]),
- ?line [EP1,EP2] = from_files(Foo, binary),
- ?line delete_files(Foo),
- ?line ok = file_sorter:sort(Fs3, Foo,
- [{format,binary_term}, {unique,true},
- {size,30000}]),
- ?line [EP1,EP2] = from_files(Foo, binary_term),
- ?line delete_files([Foo | Fs3]),
-
- ?line true = P0 =:= pps(),
-
- ?line BE1 = <<20000:32, 17:160000>>,
- ?line BE2 = <<20000:32, 1717:160000>>,
- ?line ok = file:write_file(Foo, [BE1,BE2,BE1,BE2]),
- ?line ok = file_sorter:sort([Foo], Foo, [{format,binary},
- {size,10000},
- {unique,true}]),
- ?line BEs = list_to_binary([BE1, BE2]),
- ?line {ok, BEs} = file:read_file(Foo),
- ?line delete_files(Foo),
- ?line true = P0 =:= pps(),
-
- ?line Fs4 = to_files([[7,4,1]], binary_term, Config),
- ?line {error, {bad_term, _}} = file_sorter:sort(Fs4, Foo, {format, term}),
- ?line delete_files([Foo | Fs4]),
- ?line true = P0 =:= pps(),
+ EP1 = erlang:make_tuple(2728,foo),
+ EP2 = lists:duplicate(2729,qqq),
+ LL = [EP1, EP2, EP1, EP2, EP1, EP2],
+ Fs3 = to_files([LL], binary, Config),
+ ok = file_sorter:sort(Fs3, Foo, [{format,binary}, {unique,true}]),
+ [EP1,EP2] = from_files(Foo, binary),
+ delete_files(Foo),
+ ok = file_sorter:sort(Fs3, Foo,
+ [{format,binary_term}, {unique,true},
+ {size,30000}]),
+ [EP1,EP2] = from_files(Foo, binary_term),
+ delete_files([Foo | Fs3]),
+
+ true = P0 =:= pps(),
+
+ BE1 = <<20000:32, 17:160000>>,
+ BE2 = <<20000:32, 1717:160000>>,
+ ok = file:write_file(Foo, [BE1,BE2,BE1,BE2]),
+ ok = file_sorter:sort([Foo], Foo, [{format,binary},
+ {size,10000},
+ {unique,true}]),
+ BEs = list_to_binary([BE1, BE2]),
+ {ok, BEs} = file:read_file(Foo),
+ delete_files(Foo),
+ true = P0 =:= pps(),
+
+ Fs4 = to_files([[7,4,1]], binary_term, Config),
+ {error, {bad_term, _}} = file_sorter:sort(Fs4, Foo, {format, term}),
+ delete_files([Foo | Fs4]),
+ true = P0 =:= pps(),
ok.
@@ -708,71 +647,71 @@ sort(Fmt, XArgs, Config) ->
Foo = outfile("foo", Config),
%% Input is a fun. Output is a fun.
- ?line [] = file_sorter:sort(input([], 2, Fmt), output([], Fmt), Args),
- ?line L1 = [3,1,2,5,4],
- ?line S1 = file_sorter:sort(input(L1, 2, Fmt), output([], Fmt), TmpArgs),
- ?line S1 = rev(lists:sort(L1), TmpArgs),
+ [] = file_sorter:sort(input([], 2, Fmt), output([], Fmt), Args),
+ L1 = [3,1,2,5,4],
+ S1 = file_sorter:sort(input(L1, 2, Fmt), output([], Fmt), TmpArgs),
+ S1 = rev(lists:sort(L1), TmpArgs),
%% Input is a file. Output is a fun.
- ?line [] = file_sorter:sort([], output([], Fmt), Args),
- ?line L2 = [3,1,2,5,4],
- ?line Fs1 = to_files([L2], Fmt, Config),
- ?line S2 = file_sorter:sort(Fs1, output([], Fmt), TmpArgs),
- ?line S2 = rev(lists:sort(L2), TmpArgs),
- ?line delete_files(Fs1),
+ [] = file_sorter:sort([], output([], Fmt), Args),
+ L2 = [3,1,2,5,4],
+ Fs1 = to_files([L2], Fmt, Config),
+ S2 = file_sorter:sort(Fs1, output([], Fmt), TmpArgs),
+ S2 = rev(lists:sort(L2), TmpArgs),
+ delete_files(Fs1),
%% Input is a file. Output is a file
- ?line ok = file_sorter:sort([], Foo, Args),
- ?line [] = from_files(Foo, Fmt),
- ?line delete_files(Foo),
- ?line ok = file_sorter:sort([], Foo, [{unique,true} | Args]),
- ?line [] = from_files(Foo, Fmt),
- ?line delete_files(Foo),
- ?line L3 = [3,1,2,5,4,6],
- ?line Fs2 = to_files([L3], Fmt, Config),
- ?line ok = file_sorter:sort(Fs2, Foo, Args),
- ?line true = rev(lists:sort(L3), Args) =:= from_files(Foo, Fmt),
- ?line delete_files([Foo | Fs2]),
- ?line L4 = [1,3,4,1,2,5,4,5,6],
- ?line Fs3 = to_files([L4], Fmt, Config),
- ?line ok = file_sorter:sort(Fs3, Foo, Args++[{unique,true},
- {size,100000}]),
- ?line true = rev(lists:usort(L4), Args) =:= from_files(Foo, Fmt),
- ?line delete_files(Foo),
- ?line ok = file_sorter:sort(Fs3, Foo, Args++[{unique,true}]),
- ?line true = rev(lists:usort(L4), Args) =:= from_files(Foo, Fmt),
- ?line delete_files([Foo | Fs3]),
+ ok = file_sorter:sort([], Foo, Args),
+ [] = from_files(Foo, Fmt),
+ delete_files(Foo),
+ ok = file_sorter:sort([], Foo, [{unique,true} | Args]),
+ [] = from_files(Foo, Fmt),
+ delete_files(Foo),
+ L3 = [3,1,2,5,4,6],
+ Fs2 = to_files([L3], Fmt, Config),
+ ok = file_sorter:sort(Fs2, Foo, Args),
+ true = rev(lists:sort(L3), Args) =:= from_files(Foo, Fmt),
+ delete_files([Foo | Fs2]),
+ L4 = [1,3,4,1,2,5,4,5,6],
+ Fs3 = to_files([L4], Fmt, Config),
+ ok = file_sorter:sort(Fs3, Foo, Args++[{unique,true},
+ {size,100000}]),
+ true = rev(lists:usort(L4), Args) =:= from_files(Foo, Fmt),
+ delete_files(Foo),
+ ok = file_sorter:sort(Fs3, Foo, Args++[{unique,true}]),
+ true = rev(lists:usort(L4), Args) =:= from_files(Foo, Fmt),
+ delete_files([Foo | Fs3]),
%% Input is a fun. Output is a file.
- ?line ok = file_sorter:sort(input([], 2, Fmt), Foo, Args),
- ?line [] = from_files(Foo, Fmt),
- ?line delete_files(Foo),
- ?line L5 = [3,1,2,5,4,7],
- ?line ok = file_sorter:sort(input(L5, 2, Fmt), Foo, Args),
- ?line true = rev(lists:sort(L5), Args) =:= from_files(Foo, Fmt),
- ?line delete_files(Foo),
+ ok = file_sorter:sort(input([], 2, Fmt), Foo, Args),
+ [] = from_files(Foo, Fmt),
+ delete_files(Foo),
+ L5 = [3,1,2,5,4,7],
+ ok = file_sorter:sort(input(L5, 2, Fmt), Foo, Args),
+ true = rev(lists:sort(L5), Args) =:= from_files(Foo, Fmt),
+ delete_files(Foo),
%% Removing duplicate keys.
KFun = key_compare(2),
L6 = [{5,e},{2,b},{3,c},{1,a},{4,d}] ++ [{2,c},{1,b},{4,a}],
KUArgs = lists:keydelete(order, 1, Args) ++
- [{unique, true}, {order, KFun},{size,100000}],
- ?line ok = file_sorter:sort(input(L6, 2, Fmt), Foo, KUArgs),
- ?line true = rev(lists:ukeysort(2, L6), KUArgs) =:= from_files(Foo, Fmt),
+ [{unique, true}, {order, KFun},{size,100000}],
+ ok = file_sorter:sort(input(L6, 2, Fmt), Foo, KUArgs),
+ true = rev(lists:ukeysort(2, L6), KUArgs) =:= from_files(Foo, Fmt),
KArgs = lists:keydelete(unique, 1, KUArgs),
- ?line ok = file_sorter:sort(input(L6, 2, Fmt), Foo, KArgs),
- ?line true = rev(lists:keysort(2, L6), KArgs) =:= from_files(Foo, Fmt),
+ ok = file_sorter:sort(input(L6, 2, Fmt), Foo, KArgs),
+ true = rev(lists:keysort(2, L6), KArgs) =:= from_files(Foo, Fmt),
%% Removing duplicate keys. Again.
KUArgs2 = lists:keydelete(order, 1, Args) ++
- [{unique, true}, {order, KFun},{size,5}],
- ?line ok = file_sorter:sort(input(L6, 2, Fmt), Foo, KUArgs2),
- ?line true = rev(lists:ukeysort(2, L6), KUArgs2) =:= from_files(Foo, Fmt),
+ [{unique, true}, {order, KFun},{size,5}],
+ ok = file_sorter:sort(input(L6, 2, Fmt), Foo, KUArgs2),
+ true = rev(lists:ukeysort(2, L6), KUArgs2) =:= from_files(Foo, Fmt),
KArgs2 = lists:keydelete(unique, 1, KUArgs2),
- ?line ok = file_sorter:sort(input(L6, 2, Fmt), Foo, KArgs2),
- ?line true = rev(lists:keysort(2, L6), KArgs2) =:= from_files(Foo, Fmt),
- ?line delete_files(Foo),
-
+ ok = file_sorter:sort(input(L6, 2, Fmt), Foo, KArgs2),
+ true = rev(lists:keysort(2, L6), KArgs2) =:= from_files(Foo, Fmt),
+ delete_files(Foo),
+
ok.
keysort(Fmt, XArgs, Config) ->
@@ -781,58 +720,58 @@ keysort(Fmt, XArgs, Config) ->
Foo = outfile("foo", Config),
%% Input is files. Output is a file.
- ?line ok = file_sorter:keysort(2, [], Foo, Args),
- ?line [] = from_files(Foo, Fmt),
- ?line delete_files(Foo),
- ?line ok = file_sorter:keysort(2, [], Foo, [{unique,true} | Args]),
- ?line [] = from_files(Foo, Fmt),
- ?line delete_files(Foo),
- ?line L0 = [{a,2},{a,1},{a,2},{a,2},{a,1},{a,2},{a,2},{a,3}],
- ?line Fs0 = to_files([L0], Fmt, Config),
- ?line S = rev(lists:ukeysort(1, L0), Args),
- ?line ok =
+ ok = file_sorter:keysort(2, [], Foo, Args),
+ [] = from_files(Foo, Fmt),
+ delete_files(Foo),
+ ok = file_sorter:keysort(2, [], Foo, [{unique,true} | Args]),
+ [] = from_files(Foo, Fmt),
+ delete_files(Foo),
+ L0 = [{a,2},{a,1},{a,2},{a,2},{a,1},{a,2},{a,2},{a,3}],
+ Fs0 = to_files([L0], Fmt, Config),
+ S = rev(lists:ukeysort(1, L0), Args),
+ ok =
file_sorter:keysort(1, Fs0, Foo, Args ++ [{unique,true},
{size,100000}]),
- ?line S = from_files(Foo, Fmt),
- ?line ok =
+ S = from_files(Foo, Fmt),
+ ok =
file_sorter:keysort(1, Fs0, Foo, Args ++ [{unique,true},
{size,5}]),
- ?line S = from_files(Foo, Fmt),
- ?line ok = file_sorter:keysort(1, Fs0, Foo, Args ++ [{unique,true}]),
- ?line S = from_files(Foo, Fmt),
- ?line delete_files([Foo | Fs0]),
- ?line L11 = [{a,1,x4},{b,2,x4},{c,3,x4}],
- ?line L21 = [{a,1,x3},{b,2,x3},{c,3,x3}],
- ?line L31 = [{a,1,x2},{b,2,x2},{c,3,x2}],
- ?line L41 = [{a,1,x1},{b,2,x1},{c,3,x1}],
- ?line All = [L11, L21, L31, L41],
- ?line AllFlat = lists:append(All),
- ?line Sorted = rev(lists:keysort(2, AllFlat), Args),
- ?line Fs1 = to_files(All, Fmt, Config),
- ?line ok = file_sorter:keysort(2, Fs1, Foo, Args),
- ?line Sorted = from_files(Foo, Fmt),
- ?line delete_files(Foo),
+ S = from_files(Foo, Fmt),
+ ok = file_sorter:keysort(1, Fs0, Foo, Args ++ [{unique,true}]),
+ S = from_files(Foo, Fmt),
+ delete_files([Foo | Fs0]),
+ L11 = [{a,1,x4},{b,2,x4},{c,3,x4}],
+ L21 = [{a,1,x3},{b,2,x3},{c,3,x3}],
+ L31 = [{a,1,x2},{b,2,x2},{c,3,x2}],
+ L41 = [{a,1,x1},{b,2,x1},{c,3,x1}],
+ All = [L11, L21, L31, L41],
+ AllFlat = lists:append(All),
+ Sorted = rev(lists:keysort(2, AllFlat), Args),
+ Fs1 = to_files(All, Fmt, Config),
+ ok = file_sorter:keysort(2, Fs1, Foo, Args),
+ Sorted = from_files(Foo, Fmt),
+ delete_files(Foo),
%% Input is files. Output is a fun.
- ?line [] = file_sorter:keysort(2, [], output([], Fmt), Args),
- ?line KS1 = file_sorter:keysort(2, Fs1, output([], Fmt), TmpArgs),
- ?line Sorted = KS1,
- ?line delete_files(Fs1),
+ [] = file_sorter:keysort(2, [], output([], Fmt), Args),
+ KS1 = file_sorter:keysort(2, Fs1, output([], Fmt), TmpArgs),
+ Sorted = KS1,
+ delete_files(Fs1),
%% Input is a fun. Output is a file.
- ?line ok = file_sorter:keysort(2, input([], 2, Fmt), Foo, Args),
- ?line [] = from_files(Foo, Fmt),
- ?line delete_files(Foo),
- ?line ok = file_sorter:keysort(2, input(AllFlat, 4, Fmt), Foo, Args),
- ?line Sorted = from_files(Foo, Fmt),
- ?line delete_files(Foo),
+ ok = file_sorter:keysort(2, input([], 2, Fmt), Foo, Args),
+ [] = from_files(Foo, Fmt),
+ delete_files(Foo),
+ ok = file_sorter:keysort(2, input(AllFlat, 4, Fmt), Foo, Args),
+ Sorted = from_files(Foo, Fmt),
+ delete_files(Foo),
%% Input is a fun. Output is a fun.
- ?line [] = file_sorter:keysort(2, input([], 2, Fmt), output([], Fmt),Args),
- ?line KS2 =
+ [] = file_sorter:keysort(2, input([], 2, Fmt), output([], Fmt),Args),
+ KS2 =
file_sorter:keysort(2, input(AllFlat, 4, Fmt), output([], Fmt),
TmpArgs),
- ?line Sorted = KS2,
+ Sorted = KS2,
ok.
merge(Fmt, XArgs, Config) ->
@@ -840,35 +779,35 @@ merge(Fmt, XArgs, Config) ->
Foo = outfile("foo", Config),
%% Input is a file. Output is a fun.
- ?line [] = file_sorter:merge([], output([], Fmt), Args),
- ?line L2 = [[1,3,5],[2,4,5]],
- ?line Fs1 = to_files(L2, Fmt, Config),
- ?line S2 = file_sorter:sort(Fs1, output([], Fmt), Args),
- ?line S2 = rev(lists:sort(lists:append(L2)), Args),
- ?line delete_files(Fs1),
+ [] = file_sorter:merge([], output([], Fmt), Args),
+ L2 = [[1,3,5],[2,4,5]],
+ Fs1 = to_files(L2, Fmt, Config),
+ S2 = file_sorter:sort(Fs1, output([], Fmt), Args),
+ S2 = rev(lists:sort(lists:append(L2)), Args),
+ delete_files(Fs1),
%% Input is a file. Output is a file
- ?line ok = file_sorter:merge([], Foo, Args),
- ?line [] = from_files(Foo, Fmt),
- ?line delete_files(Foo),
- ?line ok = file_sorter:merge([], Foo, [{unique,true} | Args]),
- ?line [] = from_files(Foo, Fmt),
- ?line delete_files(Foo),
- ?line L31 = [1,2,3],
- ?line L32 = [2,3,4],
- ?line L33 = [4,5,6],
- ?line L3r = [L31, L32, L33],
- ?line L3 = [rev(L31,Args), rev(L32,Args), rev(L33,Args)],
- ?line Fs2 = to_files(L3, Fmt, Config),
- ?line ok = file_sorter:merge(Fs2, Foo, Args),
- ?line true = rev(lists:merge(L3r), Args) =:= from_files(Foo, Fmt),
- ?line ok = file_sorter:merge(Fs2, Foo, Args++[{unique,true},
- {size,100000}]),
- ?line true = rev(lists:umerge(L3r), Args) =:= from_files(Foo, Fmt),
- ?line delete_files(Foo),
- ?line ok = file_sorter:merge(Fs2, Foo, Args++[{unique,true}]),
- ?line true = rev(lists:umerge(L3r), Args) =:= from_files(Foo, Fmt),
- ?line delete_files([Foo | Fs2]),
+ ok = file_sorter:merge([], Foo, Args),
+ [] = from_files(Foo, Fmt),
+ delete_files(Foo),
+ ok = file_sorter:merge([], Foo, [{unique,true} | Args]),
+ [] = from_files(Foo, Fmt),
+ delete_files(Foo),
+ L31 = [1,2,3],
+ L32 = [2,3,4],
+ L33 = [4,5,6],
+ L3r = [L31, L32, L33],
+ L3 = [rev(L31,Args), rev(L32,Args), rev(L33,Args)],
+ Fs2 = to_files(L3, Fmt, Config),
+ ok = file_sorter:merge(Fs2, Foo, Args),
+ true = rev(lists:merge(L3r), Args) =:= from_files(Foo, Fmt),
+ ok = file_sorter:merge(Fs2, Foo, Args++[{unique,true},
+ {size,100000}]),
+ true = rev(lists:umerge(L3r), Args) =:= from_files(Foo, Fmt),
+ delete_files(Foo),
+ ok = file_sorter:merge(Fs2, Foo, Args++[{unique,true}]),
+ true = rev(lists:umerge(L3r), Args) =:= from_files(Foo, Fmt),
+ delete_files([Foo | Fs2]),
ok.
@@ -877,83 +816,83 @@ keymerge(Fmt, XArgs, Config) ->
Foo = outfile("foo", Config),
%% Input is files. Output is a file.
- ?line ok = file_sorter:keymerge(2, [], Foo, Args),
- ?line [] = from_files(Foo, Fmt),
- ?line delete_files(Foo),
- ?line ok = file_sorter:keymerge(2, [], Foo, [{unique,true} | Args]),
- ?line [] = from_files(Foo, Fmt),
- ?line delete_files(Foo),
- ?line L0 = [rev([{a,1},{a,2}], Args), rev([{a,2},{a,1},{a,3}], Args)],
- ?line Fs0 = to_files(L0, Fmt, Config),
- ?line delete_files(Foo),
- ?line ok = file_sorter:keymerge(1, Fs0, Foo, Args ++ [{unique,false}]),
- ?line S2 = rev([{a,1},{a,2},{a,2},{a,1},{a,3}], Args),
- ?line S2 = from_files(Foo, Fmt),
- ?line delete_files([Foo | Fs0]),
- ?line L11 = [{a,1,x4},{b,2,x4},{c,3,x4}],
- ?line L21 = [{a,1,x3},{b,2,x3},{c,3,x3}],
- ?line L31 = [{a,1,x2},{b,2,x2},{c,3,x2}],
- ?line L41 = [{a,1,x1},{b,2,x1},{c,3,x1}],
- ?line All =
+ ok = file_sorter:keymerge(2, [], Foo, Args),
+ [] = from_files(Foo, Fmt),
+ delete_files(Foo),
+ ok = file_sorter:keymerge(2, [], Foo, [{unique,true} | Args]),
+ [] = from_files(Foo, Fmt),
+ delete_files(Foo),
+ L0 = [rev([{a,1},{a,2}], Args), rev([{a,2},{a,1},{a,3}], Args)],
+ Fs0 = to_files(L0, Fmt, Config),
+ delete_files(Foo),
+ ok = file_sorter:keymerge(1, Fs0, Foo, Args ++ [{unique,false}]),
+ S2 = rev([{a,1},{a,2},{a,2},{a,1},{a,3}], Args),
+ S2 = from_files(Foo, Fmt),
+ delete_files([Foo | Fs0]),
+ L11 = [{a,1,x4},{b,2,x4},{c,3,x4}],
+ L21 = [{a,1,x3},{b,2,x3},{c,3,x3}],
+ L31 = [{a,1,x2},{b,2,x2},{c,3,x2}],
+ L41 = [{a,1,x1},{b,2,x1},{c,3,x1}],
+ All =
[rev(L11, Args), rev(L21, Args), rev(L31, Args), rev(L41, Args)],
- ?line Merged1 = lists:keymerge(2, L11, L21),
- ?line Merged2 = lists:keymerge(2, L31, L41),
- ?line Merged = rev(lists:keymerge(2, Merged1, Merged2), Args),
- ?line Fs1 = to_files(All, Fmt, Config),
- ?line ok = file_sorter:keymerge(2, Fs1, Foo, Args),
- ?line Merged = from_files(Foo, Fmt),
+ Merged1 = lists:keymerge(2, L11, L21),
+ Merged2 = lists:keymerge(2, L31, L41),
+ Merged = rev(lists:keymerge(2, Merged1, Merged2), Args),
+ Fs1 = to_files(All, Fmt, Config),
+ ok = file_sorter:keymerge(2, Fs1, Foo, Args),
+ Merged = from_files(Foo, Fmt),
fun() ->
- UArgs = [{unique,true} | Args],
- ?line UMerged1 = lists:ukeymerge(2, L11, L21),
- ?line UMerged2 = lists:ukeymerge(2, L31, L41),
- ?line UMerged = rev(lists:ukeymerge(2, UMerged1, UMerged2), Args),
- ?line ok = file_sorter:keymerge(2, Fs1, Foo, UArgs),
- ?line UMerged = from_files(Foo, Fmt),
- UArgs2 = make_args(Fmt, [{unique,true}, {size,50} | XArgs]),
- ?line ok = file_sorter:keymerge(2, Fs1, Foo, UArgs2),
- ?line UMerged = from_files(Foo, Fmt),
- ?line List = rev([{a,1,x4},{b,2,x4},{c,3,x4}], Args),
- ?line FsL = to_files([List], Fmt, Config),
- ?line ok = file_sorter:keymerge(2, FsL, Foo, UArgs),
- ?line List = from_files(Foo, Fmt),
- ?line List1 = [{a,1,x4},{b,2,x4},{c,3,x4}],
- ?line List2 = [{a,3,x4},{b,4,x4},{c,5,x4}],
- ?line FsLL = to_files([rev(List1, Args), rev(List2, Args)], Fmt, Config),
- ?line ok = file_sorter:keymerge(2, FsLL, Foo, UArgs),
- ?line List1_2 = rev(lists:ukeymerge(2, List1, List2), Args),
- ?line List1_2 = from_files(Foo, Fmt),
- ?line delete_files(Foo)
+ UArgs = [{unique,true} | Args],
+ UMerged1 = lists:ukeymerge(2, L11, L21),
+ UMerged2 = lists:ukeymerge(2, L31, L41),
+ UMerged = rev(lists:ukeymerge(2, UMerged1, UMerged2), Args),
+ ok = file_sorter:keymerge(2, Fs1, Foo, UArgs),
+ UMerged = from_files(Foo, Fmt),
+ UArgs2 = make_args(Fmt, [{unique,true}, {size,50} | XArgs]),
+ ok = file_sorter:keymerge(2, Fs1, Foo, UArgs2),
+ UMerged = from_files(Foo, Fmt),
+ List = rev([{a,1,x4},{b,2,x4},{c,3,x4}], Args),
+ FsL = to_files([List], Fmt, Config),
+ ok = file_sorter:keymerge(2, FsL, Foo, UArgs),
+ List = from_files(Foo, Fmt),
+ List1 = [{a,1,x4},{b,2,x4},{c,3,x4}],
+ List2 = [{a,3,x4},{b,4,x4},{c,5,x4}],
+ FsLL = to_files([rev(List1, Args), rev(List2, Args)], Fmt, Config),
+ ok = file_sorter:keymerge(2, FsLL, Foo, UArgs),
+ List1_2 = rev(lists:ukeymerge(2, List1, List2), Args),
+ List1_2 = from_files(Foo, Fmt),
+ delete_files(Foo)
end(),
%% Input is files. Output is a fun.
- ?line Fs3 = to_files(All, Fmt, Config),
- ?line [] = file_sorter:keysort(2, [], output([], Fmt), Args),
- ?line KS1 = file_sorter:keymerge(2, Fs3, output([], Fmt), Args),
- ?line Merged = KS1,
- ?line delete_files([Foo | Fs3]),
-
- ?line L2 = [[{a,1}],[{a,2}],[{a,3}],[{a,4}],[{a,5}],[{a,6}],[{a,7}]],
- ?line Fs2 = to_files(L2, Fmt, Config),
- ?line M = file_sorter:keymerge(1, Fs2, output([], Fmt), Args),
- ?line M = rev(lists:append(L2), Args),
- ?line delete_files(Fs2),
-
- ?line LL1 = [{d,4},{e,5},{f,6}],
- ?line LL2 = [{a,1},{b,2},{c,3}],
- ?line LL3 = [{j,10},{k,11},{l,12}],
- ?line LL4 = [{g,7},{h,8},{i,9}],
- ?line LL5 = [{p,16},{q,17},{r,18}],
- ?line LL6 = [{m,13},{n,14},{o,15}],
- ?line LLAll = [rev(LL1, Args),rev(LL2, Args),rev(LL3, Args),
- rev(LL4, Args),rev(LL5, Args),rev(LL6, Args)],
- ?line FsLL6 = to_files(LLAll, Fmt, Config),
- ?line LL = rev(lists:sort(lists:append(LLAll)), Args),
- ?line ok = file_sorter:keymerge(1, FsLL6, Foo, Args),
- ?line LL = from_files(Foo, Fmt),
- ?line ok = file_sorter:keymerge(1, FsLL6, Foo, [{unique,true} | Args]),
- ?line LL = from_files(Foo, Fmt),
- ?line delete_files([Foo | FsLL6]),
+ Fs3 = to_files(All, Fmt, Config),
+ [] = file_sorter:keysort(2, [], output([], Fmt), Args),
+ KS1 = file_sorter:keymerge(2, Fs3, output([], Fmt), Args),
+ Merged = KS1,
+ delete_files([Foo | Fs3]),
+
+ L2 = [[{a,1}],[{a,2}],[{a,3}],[{a,4}],[{a,5}],[{a,6}],[{a,7}]],
+ Fs2 = to_files(L2, Fmt, Config),
+ M = file_sorter:keymerge(1, Fs2, output([], Fmt), Args),
+ M = rev(lists:append(L2), Args),
+ delete_files(Fs2),
+
+ LL1 = [{d,4},{e,5},{f,6}],
+ LL2 = [{a,1},{b,2},{c,3}],
+ LL3 = [{j,10},{k,11},{l,12}],
+ LL4 = [{g,7},{h,8},{i,9}],
+ LL5 = [{p,16},{q,17},{r,18}],
+ LL6 = [{m,13},{n,14},{o,15}],
+ LLAll = [rev(LL1, Args),rev(LL2, Args),rev(LL3, Args),
+ rev(LL4, Args),rev(LL5, Args),rev(LL6, Args)],
+ FsLL6 = to_files(LLAll, Fmt, Config),
+ LL = rev(lists:sort(lists:append(LLAll)), Args),
+ ok = file_sorter:keymerge(1, FsLL6, Foo, Args),
+ LL = from_files(Foo, Fmt),
+ ok = file_sorter:keymerge(1, FsLL6, Foo, [{unique,true} | Args]),
+ LL = from_files(Foo, Fmt),
+ delete_files([Foo | FsLL6]),
ok.
@@ -963,84 +902,84 @@ funmerge(Fmt, XArgs, Config) ->
UArgs = [{unique,true} | Args],
Foo = outfile(foo, Config),
- ?line EFs = to_files([[]], Fmt, Config),
- ?line ok = file_sorter:merge(EFs, Foo, UArgs),
- ?line [] = from_files(Foo, Fmt),
+ EFs = to_files([[]], Fmt, Config),
+ ok = file_sorter:merge(EFs, Foo, UArgs),
+ [] = from_files(Foo, Fmt),
delete_files([Foo | EFs]),
- ?line L11 = [{a,1,x4},{b,2,x4},{c,3,x4}],
- ?line L21 = [{a,1,x3},{b,2,x3},{c,3,x3}],
- ?line L31 = [{a,1,x2},{b,2,x2},{c,3,x2}],
- ?line L41 = [{a,1,x1},{b,2,x1},{c,3,x1}],
- ?line CAll = [L11, L21, L31, L41],
- ?line CMerged1 = lists:merge(KComp, L11, L21),
- ?line CMerged2 = lists:merge(KComp, L31, L41),
- ?line CMerged = lists:merge(KComp, CMerged1, CMerged2),
- ?line CFs1 = to_files(CAll, Fmt, Config),
- ?line ok = file_sorter:merge(CFs1, Foo, Args),
- ?line CMerged = from_files(Foo, Fmt),
+ L11 = [{a,1,x4},{b,2,x4},{c,3,x4}],
+ L21 = [{a,1,x3},{b,2,x3},{c,3,x3}],
+ L31 = [{a,1,x2},{b,2,x2},{c,3,x2}],
+ L41 = [{a,1,x1},{b,2,x1},{c,3,x1}],
+ CAll = [L11, L21, L31, L41],
+ CMerged1 = lists:merge(KComp, L11, L21),
+ CMerged2 = lists:merge(KComp, L31, L41),
+ CMerged = lists:merge(KComp, CMerged1, CMerged2),
+ CFs1 = to_files(CAll, Fmt, Config),
+ ok = file_sorter:merge(CFs1, Foo, Args),
+ CMerged = from_files(Foo, Fmt),
Args4 = make_args(Fmt, [{size,50} | XArgs]),
- ?line ok = file_sorter:merge(CFs1, Foo, [{order,KComp} | Args4]),
- ?line CMerged = from_files(Foo, Fmt),
-
- ?line UMerged1 = lists:umerge(KComp, L11, L21),
- ?line UMerged2 = lists:umerge(KComp, L31, L41),
- ?line UMerged = lists:umerge(KComp, UMerged1, UMerged2),
- ?line ok = file_sorter:merge(CFs1, Foo, [{order,KComp} | UArgs]),
- ?line UMerged = from_files(Foo, Fmt),
+ ok = file_sorter:merge(CFs1, Foo, [{order,KComp} | Args4]),
+ CMerged = from_files(Foo, Fmt),
+
+ UMerged1 = lists:umerge(KComp, L11, L21),
+ UMerged2 = lists:umerge(KComp, L31, L41),
+ UMerged = lists:umerge(KComp, UMerged1, UMerged2),
+ ok = file_sorter:merge(CFs1, Foo, [{order,KComp} | UArgs]),
+ UMerged = from_files(Foo, Fmt),
UArgs2 =
lists:keydelete(order, 1,
make_args(Fmt, [{unique,true}, {size,50} | XArgs])),
- ?line ok = file_sorter:merge(CFs1, Foo, [{order,KComp} | UArgs2]),
- ?line UMerged = from_files(Foo, Fmt),
- ?line delete_files(Foo),
-
- ?line List1 = [{a,1,x4},{b,2,x4},{c,3,x4}],
- ?line List2 = [{a,3,x4},{b,4,x4},{c,5,x4}],
- ?line List3 = [{a,5,x4},{b,6,x4},{c,7,x4}],
- ?line FsLL = to_files([List1, List2, List3], Fmt, Config),
- ?line ok = file_sorter:merge(FsLL, Foo, Args),
- ?line List1_2 = lists:merge(KComp,lists:merge(KComp,List1,List2),List3),
- ?line List1_2 = from_files(Foo, Fmt),
- ?line ok = file_sorter:merge(FsLL, Foo, [{order,KComp} | UArgs]),
- ?line UList1_2 =
+ ok = file_sorter:merge(CFs1, Foo, [{order,KComp} | UArgs2]),
+ UMerged = from_files(Foo, Fmt),
+ delete_files(Foo),
+
+ List1 = [{a,1,x4},{b,2,x4},{c,3,x4}],
+ List2 = [{a,3,x4},{b,4,x4},{c,5,x4}],
+ List3 = [{a,5,x4},{b,6,x4},{c,7,x4}],
+ FsLL = to_files([List1, List2, List3], Fmt, Config),
+ ok = file_sorter:merge(FsLL, Foo, Args),
+ List1_2 = lists:merge(KComp,lists:merge(KComp,List1,List2),List3),
+ List1_2 = from_files(Foo, Fmt),
+ ok = file_sorter:merge(FsLL, Foo, [{order,KComp} | UArgs]),
+ UList1_2 =
lists:umerge(KComp,lists:umerge(KComp, List1, List2),List3),
- ?line UList1_2 = from_files(Foo, Fmt),
- ?line delete_files([Foo | CFs1]),
+ UList1_2 = from_files(Foo, Fmt),
+ delete_files([Foo | CFs1]),
fun() ->
- ?line LL1 = [{d,4},{e,5},{f,6}],
- ?line LL2 = [{a,1},{b,2},{c,3}],
- ?line LL3 = [{j,10},{k,11},{l,12}],
- ?line LL4 = [{g,7},{h,8},{i,9}],
- ?line LL5 = [{p,16},{q,17},{r,18}],
- ?line LL6 = [{m,13},{n,14},{o,15}],
- ?line LLAll = [LL1,LL2,LL3,LL4,LL5,LL6],
- ?line FsLL6 = to_files(LLAll, Fmt, Config),
- ?line LL = lists:sort(lists:append(LLAll)),
- ?line ok = file_sorter:merge(FsLL6, Foo, Args),
- ?line LL = from_files(Foo, Fmt),
- ?line ok = file_sorter:merge(FsLL6, Foo, UArgs),
- ?line LL = from_files(Foo, Fmt),
- ?line delete_files([Foo | FsLL6])
+ LL1 = [{d,4},{e,5},{f,6}],
+ LL2 = [{a,1},{b,2},{c,3}],
+ LL3 = [{j,10},{k,11},{l,12}],
+ LL4 = [{g,7},{h,8},{i,9}],
+ LL5 = [{p,16},{q,17},{r,18}],
+ LL6 = [{m,13},{n,14},{o,15}],
+ LLAll = [LL1,LL2,LL3,LL4,LL5,LL6],
+ FsLL6 = to_files(LLAll, Fmt, Config),
+ LL = lists:sort(lists:append(LLAll)),
+ ok = file_sorter:merge(FsLL6, Foo, Args),
+ LL = from_files(Foo, Fmt),
+ ok = file_sorter:merge(FsLL6, Foo, UArgs),
+ LL = from_files(Foo, Fmt),
+ delete_files([Foo | FsLL6])
end(),
fun() ->
- ?line RLL1 = [{b,2},{h,8},{n,14}],
- ?line RLL2 = [{a,1},{g,7},{m,13}],
- ?line RLL3 = [{d,4},{j,10},{p,16}],
- ?line RLL4 = [{c,3},{i,9},{o,15}],
- ?line RLL5 = [{f,6},{l,12},{r,18}],
- ?line RLL6 = [{e,5},{k,11},{q,17}],
- ?line RLLAll = [RLL1,RLL2,RLL3,RLL4,RLL5,RLL6],
- ?line RFsLL6 = to_files(RLLAll, Fmt, Config),
- ?line RLL = lists:sort(lists:append(RLLAll)),
- ?line ok = file_sorter:merge(RFsLL6, Foo, Args),
- ?line RLL = from_files(Foo, Fmt),
- ?line ok = file_sorter:merge(RFsLL6, Foo, UArgs),
- ?line RLL = from_files(Foo, Fmt),
- ?line delete_files([Foo | RFsLL6])
+ RLL1 = [{b,2},{h,8},{n,14}],
+ RLL2 = [{a,1},{g,7},{m,13}],
+ RLL3 = [{d,4},{j,10},{p,16}],
+ RLL4 = [{c,3},{i,9},{o,15}],
+ RLL5 = [{f,6},{l,12},{r,18}],
+ RLL6 = [{e,5},{k,11},{q,17}],
+ RLLAll = [RLL1,RLL2,RLL3,RLL4,RLL5,RLL6],
+ RFsLL6 = to_files(RLLAll, Fmt, Config),
+ RLL = lists:sort(lists:append(RLLAll)),
+ ok = file_sorter:merge(RFsLL6, Foo, Args),
+ RLL = from_files(Foo, Fmt),
+ ok = file_sorter:merge(RFsLL6, Foo, UArgs),
+ RLL = from_files(Foo, Fmt),
+ delete_files([Foo | RFsLL6])
end(),
ok.
@@ -1054,57 +993,57 @@ check(Fmt, Config) ->
L1 = [3,1,2,5,4],
[F1_0] = Fs1 = to_files([L1], Fmt, Config),
F1 = filename:absname(F1_0),
- ?line {ok, [{F1,2,1}]} = file_sorter:check(Fs1, Args),
- ?line {ok, [{F1,2,1}]} = file_sorter:check(Fs1, [{order,Fun} | Args]),
- ?line {ok, [{F1,2,1}]} = file_sorter:check(Fs1, [{unique,true} | Args]),
- ?line {ok, [{F1,2,1}]} =
+ {ok, [{F1,2,1}]} = file_sorter:check(Fs1, Args),
+ {ok, [{F1,2,1}]} = file_sorter:check(Fs1, [{order,Fun} | Args]),
+ {ok, [{F1,2,1}]} = file_sorter:check(Fs1, [{unique,true} | Args]),
+ {ok, [{F1,2,1}]} =
file_sorter:check(Fs1, [{order,Fun},{unique,true} | Args]),
- ?line {ok, [{F1,3,2}]} =
+ {ok, [{F1,3,2}]} =
file_sorter:check(Fs1, [{order,descending} | Args]),
- ?line {ok, [{F1,3,2}]} =
+ {ok, [{F1,3,2}]} =
file_sorter:check(Fs1, [{unique,true},{order,descending} | Args]),
- ?line delete_files(Fs1),
-
+ delete_files(Fs1),
+
L2 = [[1,2,2,3,3,4,5,5],[5,5,4,3,3,2,2,1]],
[F2_0,F3_0] = Fs2 = to_files(L2, Fmt, Config),
F2 = filename:absname(F2_0),
F3 = filename:absname(F3_0),
- ?line {ok, [{F3,3,4}]} = file_sorter:check(Fs2, Args),
- ?line {ok, [{F3,3,4}]} = file_sorter:check(Fs2, [{order,Fun} | Args]),
- ?line {ok, [{F2,3,2},{F3,2,5}]} =
+ {ok, [{F3,3,4}]} = file_sorter:check(Fs2, Args),
+ {ok, [{F3,3,4}]} = file_sorter:check(Fs2, [{order,Fun} | Args]),
+ {ok, [{F2,3,2},{F3,2,5}]} =
file_sorter:check(Fs2, [{unique, true} | Args]),
- ?line {ok, [{F2,3,2},{F3,2,5}]} =
+ {ok, [{F2,3,2},{F3,2,5}]} =
file_sorter:check(Fs2, [{order,Fun},{unique, true} | Args]),
- ?line {ok, [{F2,2,2}]} =
+ {ok, [{F2,2,2}]} =
file_sorter:check(Fs2, [{order,descending} | Args]),
- ?line {ok, [{F2,2,2},{F3,2,5}]} =
+ {ok, [{F2,2,2},{F3,2,5}]} =
file_sorter:check(Fs2, [{unique,true},{order,descending} | Args]),
- ?line delete_files(Fs2),
-
+ delete_files(Fs2),
+
L3 = [1,2,3,4],
- ?line Fs3 = to_files([L3], Fmt, Config),
- ?line {ok, []} = file_sorter:check(Fs3, [{unique,true} | Args]),
- ?line {ok, []} =
+ Fs3 = to_files([L3], Fmt, Config),
+ {ok, []} = file_sorter:check(Fs3, [{unique,true} | Args]),
+ {ok, []} =
file_sorter:check(Fs3, [{unique,true},{order,Fun} | Args]),
- ?line delete_files(Fs3),
+ delete_files(Fs3),
%% big objects
- ?line T1 = erlang:make_tuple(10000,foo),
- ?line T2 = erlang:make_tuple(10000,bar),
- ?line L4 = [T1,T2],
- ?line [FF_0] = Fs4 = to_files([L4], Fmt, Config),
+ T1 = erlang:make_tuple(10000,foo),
+ T2 = erlang:make_tuple(10000,bar),
+ L4 = [T1,T2],
+ [FF_0] = Fs4 = to_files([L4], Fmt, Config),
FF = filename:absname(FF_0),
- ?line {ok, [{FF,2,T2}]} = file_sorter:check(Fs4, [{unique,true} | Args]),
- ?line delete_files(Fs4),
+ {ok, [{FF,2,T2}]} = file_sorter:check(Fs4, [{unique,true} | Args]),
+ delete_files(Fs4),
CFun = key_compare(2),
L10 = [[{1,a},{2,b},T10_1={1,b},{3,c}], [{1,b},T10_2={2,a}]],
[F10_0,F11_0] = Fs10 = to_files(L10, Fmt, Config),
F10_1 = filename:absname(F10_0),
F11_1 = filename:absname(F11_0),
- ?line {ok, [{F10_1,3,T10_1},{F11_1,2,T10_2}]} =
+ {ok, [{F10_1,3,T10_1},{F11_1,2,T10_2}]} =
file_sorter:check(Fs10, [{unique,true},{order,CFun} | Args]),
- ?line delete_files(Fs10),
+ delete_files(Fs10),
ok.
@@ -1112,31 +1051,31 @@ keycheck(Fmt, Config) ->
Args0 = make_args(Fmt, [{size,5}]),
Args = Args0 ++ [{tmpdir,?privdir(Config)}],
- ?line L1 = [[{a,1},{b,2}], [{c,2},{b,1},{a,3}]],
- ?line [F1_0,F2_0] = Fs1 = to_files(L1, Fmt, Config),
+ L1 = [[{a,1},{b,2}], [{c,2},{b,1},{a,3}]],
+ [F1_0,F2_0] = Fs1 = to_files(L1, Fmt, Config),
F1 = filename:absname(F1_0),
F2 = filename:absname(F2_0),
- ?line {ok, [{F2,2,{b,1}}]} = file_sorter:keycheck(1, Fs1, Args),
- ?line {ok, [{F2,2,{b,1}}]} =
+ {ok, [{F2,2,{b,1}}]} = file_sorter:keycheck(1, Fs1, Args),
+ {ok, [{F2,2,{b,1}}]} =
file_sorter:keycheck(1, Fs1, [{unique,true} | Args]),
- ?line {ok, [{F1,2,{b,2}}]} =
+ {ok, [{F1,2,{b,2}}]} =
file_sorter:keycheck(1, Fs1, [{order,descending},{unique,true} | Args]),
- ?line delete_files(Fs1),
-
+ delete_files(Fs1),
+
L2 = [[{a,1},{a,2},{a,2},{b,2}], [{c,2},{b,1},{b,2},{b,2},{a,3}]],
- ?line [F3_0,F4_0] = Fs2 = to_files(L2, Fmt, Config),
+ [F3_0,F4_0] = Fs2 = to_files(L2, Fmt, Config),
F3 = filename:absname(F3_0),
F4 = filename:absname(F4_0),
- ?line {ok, [{F4,2,{b,1}}]} = file_sorter:keycheck(1, Fs2, Args),
- ?line {ok, [{F3,2,{a,2}},{F4,2,{b,1}}]} =
+ {ok, [{F4,2,{b,1}}]} = file_sorter:keycheck(1, Fs2, Args),
+ {ok, [{F3,2,{a,2}},{F4,2,{b,1}}]} =
file_sorter:keycheck(1, Fs2, [{unique,true} | Args]),
- ?line {ok, [{F3,4,{b,2}}]} =
+ {ok, [{F3,4,{b,2}}]} =
file_sorter:keycheck(1, Fs2, [{order,descending} | Args]),
- ?line {ok, [{F3,2,{a,2}},{F4,3,{b,2}}]} =
+ {ok, [{F3,2,{a,2}},{F4,3,{b,2}}]} =
file_sorter:keycheck(1, Fs2,
[{order,descending},{unique,true} | Args]),
- ?line delete_files(Fs2),
-
+ delete_files(Fs2),
+
ok.
rev(L, Args) ->
@@ -1330,9 +1269,9 @@ c(Fd, Bin0, Size0, NoBytes, HL, L) ->
eof when Size0 =:= 0 ->
lists:reverse(L);
eof ->
- test_server:fail({error, premature_eof});
+ ct:fail({error, premature_eof});
Error ->
- test_server:fail(Error)
+ ct:fail(Error)
end.
c1(Fd, B, BinSize, HL, L) ->
@@ -1347,7 +1286,7 @@ c1(Fd, B, BinSize, HL, L) ->
<<BinTerm:Size/binary, R/binary>> = Bin,
E = case catch binary_to_term(BinTerm) of
{'EXIT', _} ->
- test_server:fail({error, bad_object});
+ ct:fail({error, bad_object});
Term ->
Term
end,
diff --git a/lib/stdlib/test/filelib_SUITE.erl b/lib/stdlib/test/filelib_SUITE.erl
index 5d5434c7b2..16616a3207 100644
--- a/lib/stdlib/test/filelib_SUITE.erl
+++ b/lib/stdlib/test/filelib_SUITE.erl
@@ -33,15 +33,14 @@
-include_lib("kernel/include/file.hrl").
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?t:minutes(5)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,5}}].
all() ->
[wildcard_one, wildcard_two, wildcard_errors,
@@ -65,14 +64,14 @@ end_per_group(_GroupName, Config) ->
wildcard_one(Config) when is_list(Config) ->
- ?line {ok,OldCwd} = file:get_cwd(),
- ?line Dir = filename:join(?config(priv_dir, Config), "wildcard_one"),
- ?line ok = file:make_dir(Dir),
+ {ok,OldCwd} = file:get_cwd(),
+ Dir = filename:join(proplists:get_value(priv_dir, Config), "wildcard_one"),
+ ok = file:make_dir(Dir),
do_wildcard_1(Dir,
fun(Wc) ->
filelib:wildcard(Wc, Dir, erl_prim_loader)
end),
- ?line file:set_cwd(Dir),
+ file:set_cwd(Dir),
do_wildcard_1(Dir,
fun(Wc) ->
L = filelib:wildcard(Wc),
@@ -81,30 +80,30 @@ wildcard_one(Config) when is_list(Config) ->
L = filelib:wildcard(Wc, Dir),
L = filelib:wildcard(Wc, Dir++"/.")
end),
- ?line file:set_cwd(OldCwd),
- ?line ok = file:del_dir(Dir),
+ file:set_cwd(OldCwd),
+ ok = file:del_dir(Dir),
ok.
wildcard_two(Config) when is_list(Config) ->
- ?line Dir = filename:join(?config(priv_dir, Config), "wildcard_two"),
- ?line ok = file:make_dir(Dir),
- ?line do_wildcard_1(Dir, fun(Wc) -> io:format("~p~n",[{Wc,Dir, X = filelib:wildcard(Wc, Dir)}]),X end),
- ?line do_wildcard_1(Dir, fun(Wc) -> filelib:wildcard(Wc, Dir++"/") end),
- ?line do_wildcard_1(Dir, fun(Wc) -> filelib:wildcard(Wc, Dir++"/.") end),
+ Dir = filename:join(proplists:get_value(priv_dir, Config), "wildcard_two"),
+ ok = file:make_dir(Dir),
+ do_wildcard_1(Dir, fun(Wc) -> io:format("~p~n",[{Wc,Dir, X = filelib:wildcard(Wc, Dir)}]),X end),
+ do_wildcard_1(Dir, fun(Wc) -> filelib:wildcard(Wc, Dir++"/") end),
+ do_wildcard_1(Dir, fun(Wc) -> filelib:wildcard(Wc, Dir++"/.") end),
case os:type() of
{win32,_} ->
ok;
_ ->
- ?line do_wildcard_1(Dir, fun(Wc) -> filelib:wildcard(Wc, "//"++Dir) end)
+ do_wildcard_1(Dir, fun(Wc) -> filelib:wildcard(Wc, "//"++Dir) end)
end,
- ?line ok = file:del_dir(Dir),
+ ok = file:del_dir(Dir),
ok.
wildcard_errors(Config) when is_list(Config) ->
- ?line wcc("{", missing_delimiter),
- ?line wcc("{a", missing_delimiter),
- ?line wcc("{a,", missing_delimiter),
- ?line wcc("{a,b", missing_delimiter),
+ wcc("{", missing_delimiter),
+ wcc("{a", missing_delimiter),
+ wcc("{a,", missing_delimiter),
+ wcc("{a,b", missing_delimiter),
ok.
wcc(Wc, Error) ->
@@ -131,70 +130,70 @@ subtract_dir("/"++Cs, []) -> Cs.
do_wildcard_2(Dir, Wcf) ->
%% Basic wildcards.
All = ["abc","abcdef","glurf"],
- ?line Files = mkfiles(lists:reverse(All), Dir),
- ?line All = Wcf("*"),
- ?line ["abc","abcdef"] = Wcf("a*"),
- ?line ["abc","abcdef"] = Wcf("abc*"),
- ?line ["abcdef"] = Wcf("abc???"),
- ?line ["abcdef"] = Wcf("abcd*"),
- ?line ["abcdef"] = Wcf("*def"),
- ?line ["abcdef","glurf"] = Wcf("{*def,gl*}"),
- ?line ["abc","abcdef"] = Wcf("a*{def,}"),
- ?line ["abc","abcdef"] = Wcf("a*{,def}"),
+ Files = mkfiles(lists:reverse(All), Dir),
+ All = Wcf("*"),
+ ["abc","abcdef"] = Wcf("a*"),
+ ["abc","abcdef"] = Wcf("abc*"),
+ ["abcdef"] = Wcf("abc???"),
+ ["abcdef"] = Wcf("abcd*"),
+ ["abcdef"] = Wcf("*def"),
+ ["abcdef","glurf"] = Wcf("{*def,gl*}"),
+ ["abc","abcdef"] = Wcf("a*{def,}"),
+ ["abc","abcdef"] = Wcf("a*{,def}"),
%% Constant wildcard.
["abcdef"] = Wcf("abcdef"),
%% Negative tests.
- ?line [] = Wcf("b*"),
- ?line [] = Wcf("bufflig"),
+ [] = Wcf("b*"),
+ [] = Wcf("bufflig"),
- ?line del(Files),
+ del(Files),
do_wildcard_3(Dir, Wcf).
-
+
do_wildcard_3(Dir, Wcf) ->
%% Some character sets.
All = ["a01","a02","a03","b00","c02","d19"],
- ?line Files = mkfiles(lists:reverse(All), Dir),
- ?line All = Wcf("[a-z]*"),
- ?line All = Wcf("[a-d]*"),
- ?line All = Wcf("[adbc]*"),
- ?line All = Wcf("?[0-9][0-9]"),
- ?line All = Wcf("?[0-1][0-39]"),
- ?line All = Wcf("[abcdefgh][10][01239]"),
- ?line ["a01","a02","a03","b00","c02"] = Wcf("[a-z]0[0-3]"),
- ?line [] = Wcf("?[a-z][0-39]"),
- ?line del(Files),
+ Files = mkfiles(lists:reverse(All), Dir),
+ All = Wcf("[a-z]*"),
+ All = Wcf("[a-d]*"),
+ All = Wcf("[adbc]*"),
+ All = Wcf("?[0-9][0-9]"),
+ All = Wcf("?[0-1][0-39]"),
+ All = Wcf("[abcdefgh][10][01239]"),
+ ["a01","a02","a03","b00","c02"] = Wcf("[a-z]0[0-3]"),
+ [] = Wcf("?[a-z][0-39]"),
+ del(Files),
do_wildcard_4(Dir, Wcf).
do_wildcard_4(Dir, Wcf) ->
%% More character sets: tricky characters.
All = ["a-","aA","aB","aC","a[","a]"],
- ?line Files = mkfiles(lists:reverse(All), Dir),
- ?line All = Wcf("a[][A-C-]"),
+ Files = mkfiles(lists:reverse(All), Dir),
+ All = Wcf("a[][A-C-]"),
["a-"] = Wcf("a[-]"),
["a["] = Wcf("a["),
- ?line del(Files),
+ del(Files),
do_wildcard_5(Dir, Wcf).
do_wildcard_5(Dir, Wcf) ->
Dirs = ["xa","blurf","yyy"],
- ?line foreach(fun(D) -> ok = file:make_dir(filename:join(Dir, D)) end, Dirs),
+ foreach(fun(D) -> ok = file:make_dir(filename:join(Dir, D)) end, Dirs),
All = ["blurf/nisse","xa/arne","xa/kalle","yyy/arne"],
- ?line Files = mkfiles(lists:reverse(All), Dir),
+ Files = mkfiles(lists:reverse(All), Dir),
%% Test.
- ?line All = Wcf("*/*"),
- ?line ["blurf/nisse","xa/arne","xa/kalle"] = Wcf("{blurf,xa}/*"),
- ?line ["xa/arne","yyy/arne"] = Wcf("*/arne"),
- ?line ["blurf/nisse"] = Wcf("*/nisse"),
- ?line [] = Wcf("mountain/*"),
- ?line [] = Wcf("xa/gurka"),
+ All = Wcf("*/*"),
+ ["blurf/nisse","xa/arne","xa/kalle"] = Wcf("{blurf,xa}/*"),
+ ["xa/arne","yyy/arne"] = Wcf("*/arne"),
+ ["blurf/nisse"] = Wcf("*/nisse"),
+ [] = Wcf("mountain/*"),
+ [] = Wcf("xa/gurka"),
["blurf/nisse"] = Wcf("blurf/nisse"),
%% Cleanup
- ?line del(Files),
- ?line foreach(fun(D) -> ok = file:del_dir(filename:join(Dir, D)) end, Dirs),
+ del(Files),
+ foreach(fun(D) -> ok = file:del_dir(filename:join(Dir, D)) end, Dirs),
do_wildcard_6(Dir, Wcf).
do_wildcard_6(Dir, Wcf) ->
@@ -271,45 +270,45 @@ do_wildcard_9(Dir, Wcf) ->
fold_files(Config) when is_list(Config) ->
- ?line Dir = filename:join(?config(priv_dir, Config), "fold_files"),
- ?line ok = file:make_dir(Dir),
- ?line Dirs = [filename:join(Dir, D) || D <- ["blurf","blurf/blarf"]],
- ?line foreach(fun(D) -> ok = file:make_dir(D) end, Dirs),
+ Dir = filename:join(proplists:get_value(priv_dir, Config), "fold_files"),
+ ok = file:make_dir(Dir),
+ Dirs = [filename:join(Dir, D) || D <- ["blurf","blurf/blarf"]],
+ foreach(fun(D) -> ok = file:make_dir(D) end, Dirs),
All = ["fb.txt","ko.txt",
"blurf/nisse.text","blurf/blarf/aaa.txt","blurf/blarf/urfa.txt"],
- ?line Files = mkfiles(lists:reverse(All), Dir),
+ Files = mkfiles(lists:reverse(All), Dir),
%% Test.
- ?line Files0 = filelib:fold_files(Dir, "^", false,
- fun(H, T) -> [H|T] end, []),
- ?line same_lists(["fb.txt","ko.txt"], Files0, Dir),
+ Files0 = filelib:fold_files(Dir, "^", false,
+ fun(H, T) -> [H|T] end, []),
+ same_lists(["fb.txt","ko.txt"], Files0, Dir),
- ?line Files1 = filelib:fold_files(Dir, "^", true,
- fun(H, T) -> [H|T] end, []),
- ?line same_lists(All, Files1, Dir),
+ Files1 = filelib:fold_files(Dir, "^", true,
+ fun(H, T) -> [H|T] end, []),
+ same_lists(All, Files1, Dir),
- ?line Files2 = filelib:fold_files(Dir, "[.]text$", true,
- fun(H, T) -> [H|T] end, []),
- ?line same_lists(["blurf/nisse.text"], Files2, Dir),
+ Files2 = filelib:fold_files(Dir, "[.]text$", true,
+ fun(H, T) -> [H|T] end, []),
+ same_lists(["blurf/nisse.text"], Files2, Dir),
- ?line Files3 = filelib:fold_files(Dir, "^..[.]", true,
- fun(H, T) -> [H|T] end, []),
- ?line same_lists(["fb.txt","ko.txt"], Files3, Dir),
+ Files3 = filelib:fold_files(Dir, "^..[.]", true,
+ fun(H, T) -> [H|T] end, []),
+ same_lists(["fb.txt","ko.txt"], Files3, Dir),
- ?line Files4 = filelib:fold_files(Dir, "^ko[.]txt$", true,
- fun(H, T) -> [H|T] end, []),
- ?line same_lists(["ko.txt"], Files4, Dir),
- ?line Files4 = filelib:fold_files(Dir, "^ko[.]txt$", false,
- fun(H, T) -> [H|T] end, []),
+ Files4 = filelib:fold_files(Dir, "^ko[.]txt$", true,
+ fun(H, T) -> [H|T] end, []),
+ same_lists(["ko.txt"], Files4, Dir),
+ Files4 = filelib:fold_files(Dir, "^ko[.]txt$", false,
+ fun(H, T) -> [H|T] end, []),
- ?line [] = filelib:fold_files(Dir, "^$", true,
- fun(H, T) -> [H|T] end, []),
+ [] = filelib:fold_files(Dir, "^$", true,
+ fun(H, T) -> [H|T] end, []),
%% Cleanup
- ?line del(Files),
- ?line foreach(fun(D) -> ok = file:del_dir(D) end, lists:reverse(Dirs)),
- ?line ok = file:del_dir(Dir).
+ del(Files),
+ foreach(fun(D) -> ok = file:del_dir(D) end, lists:reverse(Dirs)),
+ ok = file:del_dir(Dir).
same_lists(Expected0, Actual0, BaseDir) ->
Expected = [filename:absname(N, BaseDir) || N <- lists:sort(Expected0)],
@@ -328,52 +327,49 @@ del([H|T]) ->
del(T);
del([]) -> ok.
-otp_5960(suite) ->
- [];
-otp_5960(doc) ->
- ["Test that filelib:ensure_dir/1 returns ok or {error,Reason}"];
+%% Test that filelib:ensure_dir/1 returns ok or {error,Reason}.
otp_5960(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Dir = filename:join(PrivDir, "otp_5960_dir"),
- ?line Name1 = filename:join(Dir, name1),
- ?line Name2 = filename:join(Dir, name2),
- ?line ok = filelib:ensure_dir(Name1), % parent is created
- ?line ok = filelib:ensure_dir(Name1), % repeating it should be OK
- ?line ok = filelib:ensure_dir(Name2), % parent already exists
- ?line ok = filelib:ensure_dir(Name2), % repeating it should be OK
- ?line Name3 = filename:join(Name1, name3),
- ?line {ok, FileInfo} = file:read_file_info(Dir),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Dir = filename:join(PrivDir, "otp_5960_dir"),
+ Name1 = filename:join(Dir, name1),
+ Name2 = filename:join(Dir, name2),
+ ok = filelib:ensure_dir(Name1), % parent is created
+ ok = filelib:ensure_dir(Name1), % repeating it should be OK
+ ok = filelib:ensure_dir(Name2), % parent already exists
+ ok = filelib:ensure_dir(Name2), % repeating it should be OK
+ Name3 = filename:join(Name1, name3),
+ {ok, FileInfo} = file:read_file_info(Dir),
case os:type() of
{win32,_} ->
%% Not possibly to write protect directories on Windows
%% (at least not using file:write_file_info/2).
ok;
_ ->
- ?line Mode = FileInfo#file_info.mode,
- ?line NoWriteMode = Mode - 8#00200 - 8#00020 - 8#00002,
- ?line ok = file:write_file_info(Dir, #file_info{mode=NoWriteMode}),
- ?line {error, _} = filelib:ensure_dir(Name3),
- ?line ok = file:write_file_info(Dir, #file_info{mode=Mode}),
+ Mode = FileInfo#file_info.mode,
+ NoWriteMode = Mode - 8#00200 - 8#00020 - 8#00002,
+ ok = file:write_file_info(Dir, #file_info{mode=NoWriteMode}),
+ {error, _} = filelib:ensure_dir(Name3),
+ ok = file:write_file_info(Dir, #file_info{mode=Mode}),
ok
end.
ensure_dir_eexist(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Dir = filename:join(PrivDir, "ensure_dir_eexist"),
- ?line Name = filename:join(Dir, "same_name_as_file_and_dir"),
- ?line ok = filelib:ensure_dir(Name),
- ?line ok = file:write_file(Name, <<"some string\n">>),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Dir = filename:join(PrivDir, "ensure_dir_eexist"),
+ Name = filename:join(Dir, "same_name_as_file_and_dir"),
+ ok = filelib:ensure_dir(Name),
+ ok = file:write_file(Name, <<"some string\n">>),
%% There already is a file with the name of the directory
%% we want to create.
- ?line NeedFile = filename:join(Name, "file"),
- ?line NeedFileB = filename:join(Name, <<"file">>),
- ?line {error, eexist} = filelib:ensure_dir(NeedFile),
- ?line {error, eexist} = filelib:ensure_dir(NeedFileB),
+ NeedFile = filename:join(Name, "file"),
+ NeedFileB = filename:join(Name, <<"file">>),
+ {error, eexist} = filelib:ensure_dir(NeedFile),
+ {error, eexist} = filelib:ensure_dir(NeedFileB),
ok.
ensure_dir_symlink(Config) when is_list(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
Dir = filename:join(PrivDir, "ensure_dir_symlink"),
Name = filename:join(Dir, "same_name_as_file_and_dir"),
ok = filelib:ensure_dir(Name),
@@ -392,7 +388,7 @@ ensure_dir_symlink(Config) when is_list(Config) ->
end.
wildcard_symlink(Config) when is_list(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
Dir = filename:join(PrivDir, ?MODULE_STRING++"_wildcard_symlink"),
SubDir = filename:join(Dir, "sub"),
AFile = filename:join(SubDir, "a_file"),
@@ -452,7 +448,7 @@ basenames(Dir, Files) ->
end || F <- Files].
is_file_symlink(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
Dir = filename:join(PrivDir, ?MODULE_STRING++"_is_file_symlink"),
SubDir = filename:join(Dir, "sub"),
AFile = filename:join(SubDir, "a_file"),
@@ -485,7 +481,7 @@ is_file_symlink(Config) ->
end.
file_props_symlink(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
Dir = filename:join(PrivDir, ?MODULE_STRING++"_file_props_symlink"),
AFile = filename:join(Dir, "a_file"),
Alias = filename:join(Dir, "symlink"),
diff --git a/lib/stdlib/test/filename_SUITE.erl b/lib/stdlib/test/filename_SUITE.erl
index 8ecbc7eadf..3d6734b790 100644
--- a/lib/stdlib/test/filename_SUITE.erl
+++ b/lib/stdlib/test/filename_SUITE.erl
@@ -28,21 +28,31 @@
basename_bin_1/1, basename_bin_2/1,
dirname_bin/1, extension_bin/1, join_bin/1, t_nativename_bin/1]).
-export([pathtype_bin/1,rootname_bin/1,split_bin/1]).
+-export([t_basedir_api/1, t_basedir_xdg/1, t_basedir_windows/1]).
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
- [absname, absname_2, basename_1, basename_2, dirname,
- extension,
- join, pathtype, rootname, split, t_nativename, find_src,
- absname_bin, absname_bin_2, basename_bin_1, basename_bin_2, dirname_bin,
- extension_bin,
- join_bin, pathtype_bin, rootname_bin, split_bin, t_nativename_bin].
+ [absname, absname_2,
+ find_src,
+ absname_bin, absname_bin_2,
+ {group,p},
+ t_basedir_xdg, t_basedir_windows].
groups() ->
- [].
+ [{p, [parallel],
+ [dirname,
+ extension, extension_bin,
+ join, pathtype, rootname, split, t_nativename,
+ basename_1, basename_2,
+ basename_bin_1, basename_bin_2, dirname_bin,
+ join_bin, pathtype_bin, rootname_bin, split_bin,
+ t_nativename_bin,
+ t_basedir_api]}].
init_per_suite(Config) ->
Config.
@@ -61,58 +71,59 @@ end_per_group(_GroupName, Config) ->
absname(Config) when is_list(Config) ->
case os:type() of
- {win32, _} ->
- ?line [Drive|_] = ?config(priv_dir, Config),
- ?line Temp = filename:join([Drive|":/"], "temp"),
- ?line case file:make_dir(Temp) of
- ok -> ok;
- {error,eexist} -> ok
- end,
- ?line {ok,Cwd} = file:get_cwd(),
- ?line ok = file:set_cwd(Temp),
- ?line [Drive|":/temp/foo"] = filename:absname(foo),
- ?line [Drive|":/temp/foo"] = filename:absname("foo"),
- ?line [Drive|":/temp/../ebin"] = filename:absname("../ebin"),
- ?line [Drive|":/erlang"] = filename:absname("/erlang"),
- ?line [Drive|":/erlang/src"] = filename:absname("/erlang/src"),
- ?line [Drive|":/erlang/src"] = filename:absname("\\erlang\\src"),
- ?line [Drive|":/temp/erlang"] = filename:absname([Drive|":erlang"]),
- ?line [Drive|":/temp/erlang/src"] =
- filename:absname([Drive|":erlang/src"]),
- ?line [Drive|":/temp/erlang/src"] =
- filename:absname([Drive|":erlang\\src\\"]),
- ?line "a:/erlang" = filename:absname("a:erlang"),
-
- ?line file:set_cwd([Drive|":/"]),
- ?line [Drive|":/foo"] = filename:absname(foo),
- ?line [Drive|":/foo"] = filename:absname("foo"),
- ?line [Drive|":/../ebin"] = filename:absname("../ebin"),
- ?line [Drive|":/erlang"] = filename:absname("/erlang"),
- ?line [Drive|":/erlang/src"] = filename:absname("/erlang/src"),
- ?line [Drive|":/erlang/src"] = filename:absname(["/erlang",'/src']),
- ?line [Drive|":/erlang/src"] = filename:absname("\\erlang\\\\src"),
- ?line [Drive|":/erlang"] = filename:absname([Drive|":erlang"]),
- ?line [Drive|":/erlang/src"] = filename:absname([Drive|":erlang/src"]),
- ?line "a:/erlang" = filename:absname("a:erlang"),
-
- ?line file:set_cwd(Cwd),
- ok;
- {unix, _} ->
- ?line ok = file:set_cwd("/usr"),
- ?line "/usr/foo" = filename:absname(foo),
- ?line "/usr/foo" = filename:absname("foo"),
- ?line "/usr/../ebin" = filename:absname("../ebin"),
- ?line file:set_cwd("/"),
- ?line "/foo" = filename:absname(foo),
- ?line "/foo" = filename:absname("foo"),
- ?line "/../ebin" = filename:absname("../ebin"),
- ?line "/erlang" = filename:absname("/erlang"),
- ?line "/erlang/src" = filename:absname("/erlang/src"),
- ?line "/erlang/src" = filename:absname(["/erl",'ang/s',"rc"]),
- ?line "/erlang/src" = filename:absname(["/erl",'a','ng',"/",'s',"rc"]),
- ?line "/erlang/src" = filename:absname("/erlang///src"),
- ?line "/file_sorter.erl" = filename:absname([file_sorter|'.erl']),
- ok
+ {win32, _} ->
+ [Drive|_] = proplists:get_value(priv_dir, Config),
+ Temp = filename:join([Drive|":/"], "temp"),
+ case file:make_dir(Temp) of
+ ok -> ok;
+ {error,eexist} -> ok
+ end,
+ {ok,Cwd} = file:get_cwd(),
+ ok = file:set_cwd(Temp),
+ [Drive|":/temp/foo"] = filename:absname(foo),
+ [Drive|":/temp/foo"] = filename:absname("foo"),
+ [Drive|":/temp/../ebin"] = filename:absname("../ebin"),
+ [Drive|":/erlang"] = filename:absname("/erlang"),
+ [Drive|":/erlang/src"] = filename:absname("/erlang/src"),
+ [Drive|":/erlang/src"] = filename:absname("\\erlang\\src"),
+ [Drive|":/temp/erlang"] = filename:absname([Drive|":erlang"]),
+ [Drive|":/temp/erlang/src"] =
+ filename:absname([Drive|":erlang/src"]),
+ [Drive|":/temp/erlang/src"] =
+ filename:absname([Drive|":erlang\\src\\"]),
+ "a:/erlang" = filename:absname("a:erlang"),
+
+ file:set_cwd([Drive|":/"]),
+ [Drive|":/foo"] = filename:absname(foo),
+ [Drive|":/foo"] = filename:absname("foo"),
+ [Drive|":/../ebin"] = filename:absname("../ebin"),
+ [Drive|":/erlang"] = filename:absname("/erlang"),
+ [Drive|":/erlang/src"] = filename:absname("/erlang/src"),
+ [Drive|":/erlang/src"] = filename:absname(["/erlang",'/src']),
+ [Drive|":/erlang/src"] = filename:absname("\\erlang\\\\src"),
+ [Drive|":/erlang"] = filename:absname([Drive|":erlang"]),
+ [Drive|":/erlang/src"] = filename:absname([Drive|":erlang/src"]),
+ "a:/erlang" = filename:absname("a:erlang"),
+
+ file:set_cwd(Cwd),
+ ok;
+ {unix, _} ->
+ ok = file:set_cwd("/usr"),
+ "/usr/foo" = filename:absname(foo),
+ "/usr/foo" = filename:absname("foo"),
+ "/usr/../ebin" = filename:absname("../ebin"),
+
+ file:set_cwd("/"),
+ "/foo" = filename:absname(foo),
+ "/foo" = filename:absname("foo"),
+ "/../ebin" = filename:absname("../ebin"),
+ "/erlang" = filename:absname("/erlang"),
+ "/erlang/src" = filename:absname("/erlang/src"),
+ "/erlang/src" = filename:absname(["/erl",'ang/s',"rc"]),
+ "/erlang/src" = filename:absname(["/erl",'a','ng',"/",'s',"rc"]),
+ "/erlang/src" = filename:absname("/erlang///src"),
+ "/file_sorter.erl" = filename:absname([file_sorter|'.erl']),
+ ok
end.
@@ -120,125 +131,119 @@ absname(Config) when is_list(Config) ->
absname_2(Config) when is_list(Config) ->
case os:type() of
- {win32, _} ->
- ?line [Drive|_] = ?config(priv_dir, Config),
- ?line [Drive|":/temp/foo"] = filename:absname(foo, [Drive|":/temp"]),
- ?line [Drive|":/temp/foo"] = filename:absname("foo", [Drive|":/temp"]),
- ?line [Drive|":/temp/../ebin"] = filename:absname("../ebin",
- [Drive|":/temp"]),
- ?line [Drive|":/erlang"] = filename:absname("/erlang", [Drive|":/temp"]),
- ?line [Drive|":/erlang/src"] = filename:absname("/erlang/src",
- [Drive|":/temp"]),
- ?line [Drive|":/erlang/src"] = filename:absname("\\erlang\\src",
- [Drive|":/temp"]),
- ?line [Drive|":/temp/erlang"] = filename:absname([Drive|":erlang"],
- [Drive|":/temp"]),
- ?line [Drive|":/temp/erlang/src"] = filename:absname([Drive|":erlang/src"],
- [Drive|":/temp"]),
- ?line [Drive|":/temp/erlang/src"] =
- filename:absname([Drive|":erlang\\src\\"], [Drive|":/temp"]),
- ?line "a:/erlang" = filename:absname("a:erlang", [Drive|":/temp"]),
-
- ?line file:set_cwd([Drive|":/"]),
- ?line [Drive|":/foo"] = filename:absname(foo, [Drive|":/"]),
- ?line [Drive|":/foo"] = filename:absname("foo", [Drive|":/"]),
- ?line [Drive|":/../ebin"] = filename:absname("../ebin", [Drive|":/"]),
- ?line [Drive|":/erlang"] = filename:absname("/erlang", [Drive|":/"]),
- ?line [Drive|":/erlang/src"] = filename:absname("/erlang/src",
- [Drive|":/"]),
- ?line [Drive|":/erlang/src"] = filename:absname("\\erlang\\\\src",
- [Drive|":/"]),
- ?line [Drive|":/erlang"] = filename:absname([Drive|":erlang"],
- [Drive|":/"]),
- ?line [Drive|":/erlang/src"] = filename:absname([Drive|":erlang/src"],
- [Drive|":/"]),
- ?line "a:/erlang" = filename:absname("a:erlang", [Drive|":/"]),
-
- ok;
- _ ->
- ?line "/usr/foo" = filename:absname(foo, "/usr"),
- ?line "/usr/foo" = filename:absname("foo", "/usr"),
- ?line "/usr/../ebin" = filename:absname("../ebin", "/usr"),
-
- ?line "/foo" = filename:absname(foo, "/"),
- ?line "/foo" = filename:absname("foo", "/"),
- ?line "/../ebin" = filename:absname("../ebin", "/"),
- ?line "/erlang" = filename:absname("/erlang", "/"),
- ?line "/erlang/src" = filename:absname("/erlang/src", "/"),
- ?line "/erlang/src" = filename:absname("/erlang///src", "/"),
- ok
+ {win32, _} ->
+ [Drive|_] = proplists:get_value(priv_dir, Config),
+ [Drive|":/temp/foo"] = filename:absname(foo, [Drive|":/temp"]),
+ [Drive|":/temp/foo"] = filename:absname("foo", [Drive|":/temp"]),
+ [Drive|":/temp/../ebin"] = filename:absname("../ebin",
+ [Drive|":/temp"]),
+ [Drive|":/erlang"] = filename:absname("/erlang", [Drive|":/temp"]),
+ [Drive|":/erlang/src"] = filename:absname("/erlang/src",
+ [Drive|":/temp"]),
+ [Drive|":/erlang/src"] = filename:absname("\\erlang\\src",
+ [Drive|":/temp"]),
+ [Drive|":/temp/erlang"] = filename:absname([Drive|":erlang"],
+ [Drive|":/temp"]),
+ [Drive|":/temp/erlang/src"] = filename:absname([Drive|":erlang/src"],
+ [Drive|":/temp"]),
+ [Drive|":/temp/erlang/src"] =
+ filename:absname([Drive|":erlang\\src\\"], [Drive|":/temp"]),
+ "a:/erlang" = filename:absname("a:erlang", [Drive|":/temp"]),
+
+ file:set_cwd([Drive|":/"]),
+ [Drive|":/foo"] = filename:absname(foo, [Drive|":/"]),
+ [Drive|":/foo"] = filename:absname("foo", [Drive|":/"]),
+ [Drive|":/../ebin"] = filename:absname("../ebin", [Drive|":/"]),
+ [Drive|":/erlang"] = filename:absname("/erlang", [Drive|":/"]),
+ [Drive|":/erlang/src"] = filename:absname("/erlang/src",
+ [Drive|":/"]),
+ [Drive|":/erlang/src"] = filename:absname("\\erlang\\\\src",
+ [Drive|":/"]),
+ [Drive|":/erlang"] = filename:absname([Drive|":erlang"],
+ [Drive|":/"]),
+ [Drive|":/erlang/src"] = filename:absname([Drive|":erlang/src"],
+ [Drive|":/"]),
+ "a:/erlang" = filename:absname("a:erlang", [Drive|":/"]),
+
+ ok;
+ _ ->
+ "/usr/foo" = filename:absname(foo, "/usr"),
+ "/usr/foo" = filename:absname("foo", "/usr"),
+ "/usr/../ebin" = filename:absname("../ebin", "/usr"),
+
+ "/foo" = filename:absname(foo, "/"),
+ "/foo" = filename:absname("foo", "/"),
+ "/../ebin" = filename:absname("../ebin", "/"),
+ "/erlang" = filename:absname("/erlang", "/"),
+ "/erlang/src" = filename:absname("/erlang/src", "/"),
+ "/erlang/src" = filename:absname("/erlang///src", "/"),
+ ok
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
basename_1(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line "." = filename:basename("."),
- ?line "foo" = filename:basename("foo"),
- ?line "foo" = filename:basename("/usr/foo"),
- ?line "foo.erl" = filename:basename("A:usr/foo.erl"),
- ?line "foo" = filename:basename('/usr/foo'),
- ?line "foo" = filename:basename(["/usr","/","f","o","o"]),
- ?line "foo" = filename:basename(["/usr/",foo]),
- ?line "foo" = filename:basename(["/usr/f",oo]),
- ?line "foo" = filename:basename(["usr/", "foo"]),
- ?line "foo" = filename:basename(["usr/"|foo]),
- ?line "foo" = filename:basename(["usr/foo/"]),
- ?line case os:type() of
- {win32, _} ->
- ?line "foo" = filename:basename(["usr\\foo\\"]),
- ?line "foo" = filename:basename("A:\\usr\\foo"),
- ?line "foo" = filename:basename("A:foo");
- _ ->
- ?line "strange\\but\\true" =
- filename:basename("strange\\but\\true")
- end,
- ?line test_server:timetrap_cancel(Dog),
+ "." = filename:basename("."),
+ "foo" = filename:basename("foo"),
+ "foo" = filename:basename("/usr/foo"),
+ "foo.erl" = filename:basename("A:usr/foo.erl"),
+ "foo" = filename:basename('/usr/foo'),
+ "foo" = filename:basename(["/usr","/","f","o","o"]),
+ "foo" = filename:basename(["/usr/",foo]),
+ "foo" = filename:basename(["/usr/f",oo]),
+ "foo" = filename:basename(["usr/", "foo"]),
+ "foo" = filename:basename(["usr/"|foo]),
+ "foo" = filename:basename(["usr/foo/"]),
+ case os:type() of
+ {win32, _} ->
+ "foo" = filename:basename(["usr\\foo\\"]),
+ "foo" = filename:basename("A:\\usr\\foo"),
+ "foo" = filename:basename("A:foo");
+ _ ->
+ "strange\\but\\true" =
+ filename:basename("strange\\but\\true")
+ end,
ok.
basename_2(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line "." = filename:basename(".", ".erl"),
- ?line "foo" = filename:basename("foo.erl", ".erl"),
- ?line "foo" = filename:basename('foo.erl', ".erl"),
- ?line "foo" = filename:basename("foo.erl", '.erl'),
- ?line "foo" = filename:basename(["/usr","/","f","oo"], ".erl"),
- ?line "foo.erl" = filename:basename("/usr/foo.erl", ".hrl"),
- ?line "foo.erl" = filename:basename("/usr.hrl/foo.erl", ".hrl"),
- ?line "foo" = filename:basename("/usr.hrl/foo", ".hrl"),
- ?line "foo" = filename:basename("usr/foo/", ".erl"),
- ?line "foo.erl" = filename:basename("usr/foo.erl/", ".erl"),
- ?line "foo.erl" = filename:basename("usr/foo.erl/", '.erl'),
- ?line "foo" = filename:basename(["/usr",'/','f','oo'], ".erl"),
- ?line "foo.erl" = filename:basename(["usr/foo.e",'rl/'], ".erl"),
- ?line case os:type() of
- {win32, _} ->
- ?line "foo" = filename:basename("A:foo", ".erl"),
- ?line "foo.erl" = filename:basename("a:\\usr\\foo.erl",
- ".hrl"),
- ?line "foo.erl" = filename:basename("c:\\usr.hrl\\foo.erl",
- ".hrl"),
- ?line "foo" = filename:basename("A:\\usr\\foo", ".hrl");
- _ ->
- ?line "strange\\but\\true" =
- filename:basename("strange\\but\\true.erl", ".erl"),
- ?line "strange\\but\\true" =
- filename:basename("strange\\but\\true", ".erl")
- end,
- ?line test_server:timetrap_cancel(Dog),
+ "." = filename:basename(".", ".erl"),
+ "foo" = filename:basename("foo.erl", ".erl"),
+ "foo" = filename:basename('foo.erl', ".erl"),
+ "foo" = filename:basename("foo.erl", '.erl'),
+ "foo" = filename:basename(["/usr","/","f","oo"], ".erl"),
+ "foo.erl" = filename:basename("/usr/foo.erl", ".hrl"),
+ "foo.erl" = filename:basename("/usr.hrl/foo.erl", ".hrl"),
+ "foo" = filename:basename("/usr.hrl/foo", ".hrl"),
+ "foo" = filename:basename("usr/foo/", ".erl"),
+ "foo.erl" = filename:basename("usr/foo.erl/", ".erl"),
+ "foo.erl" = filename:basename("usr/foo.erl/", '.erl'),
+ "foo" = filename:basename(["/usr",'/','f','oo'], ".erl"),
+ "foo.erl" = filename:basename(["usr/foo.e",'rl/'], ".erl"),
+ case os:type() of
+ {win32, _} ->
+ "foo" = filename:basename("A:foo", ".erl"),
+ "foo.erl" = filename:basename("a:\\usr\\foo.erl", ".hrl"),
+ "foo.erl" = filename:basename("c:\\usr.hrl\\foo.erl", ".hrl"),
+ "foo" = filename:basename("A:\\usr\\foo", ".hrl");
+ _ ->
+ "strange\\but\\true" =
+ filename:basename("strange\\but\\true.erl", ".erl"),
+ "strange\\but\\true" =
+ filename:basename("strange\\but\\true", ".erl")
+ end,
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dirname(Config) when is_list(Config) ->
case os:type() of
- {win32,_} ->
- "A:/usr" = filename:dirname("A:/usr/foo.erl"),
- "A:usr" = filename:dirname("A:usr/foo.erl"),
- "/usr" = filename:dirname("\\usr\\foo.erl"),
- "/" = filename:dirname("\\usr"),
- "A:" = filename:dirname("A:");
- _ -> true
+ {win32,_} ->
+ "A:/usr" = filename:dirname("A:/usr/foo.erl"),
+ "A:usr" = filename:dirname("A:usr/foo.erl"),
+ "/usr" = filename:dirname("\\usr\\foo.erl"),
+ "/" = filename:dirname("\\usr"),
+ "A:" = filename:dirname("A:");
+ _ -> true
end,
"usr" = filename:dirname("usr///foo.erl"),
"." = filename:dirname("foo.erl"),
@@ -258,23 +263,22 @@ dirname(Config) when is_list(Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
extension(Config) when is_list(Config) ->
- ?line ".erl" = filename:extension("A:/usr/foo.erl"),
- ?line ".erl" = filename:extension("A:/usr/foo.nisse.erl"),
- ?line ".erl" = filename:extension(["A:/usr/", 'foo.ni', "sse.erl"]),
- ?line ".erl" = filename:extension(["A:/usr/", 'foo.ni', "sse.e", 'rl']),
- ?line ".erl" = filename:extension(["A:/usr/", 'foo.ni', "sse.e"|'rl']),
- ?line ".erl" = filename:extension("A:/usr.bar/foo.nisse.erl"),
- ?line "" = filename:extension("A:/usr.bar/foo"),
- ?line "" = filename:extension("A:/usr/foo"),
- ?line case os:type() of
- {win32, _} ->
- ?line "" = filename:extension("A:\\usr\\foo"),
- ?line ".erl" =
- filename:extension("A:/usr.bar/foo.nisse.erl"),
- ?line "" = filename:extension("A:/usr.bar/foo"),
- ok;
- _ -> ok
- end.
+ ".erl" = filename:extension("A:/usr/foo.erl"),
+ ".erl" = filename:extension("A:/usr/foo.nisse.erl"),
+ ".erl" = filename:extension(["A:/usr/", 'foo.ni', "sse.erl"]),
+ ".erl" = filename:extension(["A:/usr/", 'foo.ni', "sse.e", 'rl']),
+ ".erl" = filename:extension(["A:/usr/", 'foo.ni', "sse.e"|'rl']),
+ ".erl" = filename:extension("A:/usr.bar/foo.nisse.erl"),
+ "" = filename:extension("A:/usr.bar/foo"),
+ "" = filename:extension("A:/usr/foo"),
+ case os:type() of
+ {win32, _} ->
+ "" = filename:extension("A:\\usr\\foo"),
+ ".erl" = filename:extension("A:/usr.bar/foo.nisse.erl"),
+ "" = filename:extension("A:/usr.bar/foo"),
+ ok;
+ _ -> ok
+ end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -282,8 +286,8 @@ join(Config) when is_list(Config) ->
%% Whenever joining two elements, test the equivalence between
%% join/1 and join/2 (OTP-12158) by using help function
%% filename_join/2.
- ?line "/" = filename:join(["/"]),
- ?line "/" = filename:join(["//"]),
+ "/" = filename:join(["/"]),
+ "/" = filename:join(["//"]),
"usr/foo.erl" = filename_join("usr","foo.erl"),
"/src/foo.erl" = filename_join(usr, "/src/foo.erl"),
"/src/foo.erl" = filename_join("/src/",'foo.erl'),
@@ -291,7 +295,7 @@ join(Config) when is_list(Config) ->
"/src/foo.erl" = filename_join("usr", "/src/foo.erl"),
%% Make sure that redundant slashes work too.
- ?line "a/b/c/d/e/f/g" = filename:join(["a//b/c/////d//e/f/g"]),
+ "a/b/c/d/e/f/g" = filename:join(["a//b/c/////d//e/f/g"]),
"a/b/c/d/e/f/g" = filename_join("a//b/c/", "d//e/f/g"),
"a/b/c/d/e/f/g" = filename_join("a//b/c", "d//e/f/g"),
"/d/e/f/g" = filename_join("a//b/c", "/d//e/f/g"),
@@ -324,30 +328,25 @@ join(Config) when is_list(Config) ->
"/b" = filename_join("/a/","/b/"),
"/a/b" = filename_join("/a/","b/"),
- ?line case os:type() of
- {win32, _} ->
- ?line "d:/" = filename:join(["D:/"]),
- ?line "d:/" = filename:join(["D:\\"]),
- "d:/abc" = filename_join("D:/", "abc"),
- "d:abc" = filename_join("D:", "abc"),
- ?line "a/b/c/d/e/f/g" =
- filename:join(["a//b\\c//\\/\\d/\\e/f\\g"]),
- ?line "a:usr/foo.erl" =
- filename:join(["A:","usr","foo.erl"]),
- ?line "/usr/foo.erl" =
- filename:join(["A:","/usr","foo.erl"]),
- "c:usr" = filename_join("A:","C:usr"),
- "a:usr" = filename_join("A:","usr"),
- "c:/usr" = filename_join("A:", "C:/usr"),
- ?line "c:/usr/foo.erl" =
- filename:join(["A:","C:/usr","foo.erl"]),
- ?line "c:usr/foo.erl" =
- filename:join(["A:","C:usr","foo.erl"]),
- ?line "d:/foo" = filename:join([$D, $:, $/, []], "foo"),
- ok;
- _ ->
- ok
- end.
+ case os:type() of
+ {win32, _} ->
+ "d:/" = filename:join(["D:/"]),
+ "d:/" = filename:join(["D:\\"]),
+ "d:/abc" = filename_join("D:/", "abc"),
+ "d:abc" = filename_join("D:", "abc"),
+ "a/b/c/d/e/f/g" = filename:join(["a//b\\c//\\/\\d/\\e/f\\g"]),
+ "a:usr/foo.erl" = filename:join(["A:","usr","foo.erl"]),
+ "/usr/foo.erl" = filename:join(["A:","/usr","foo.erl"]),
+ "c:usr" = filename_join("A:","C:usr"),
+ "a:usr" = filename_join("A:","usr"),
+ "c:/usr" = filename_join("A:", "C:/usr"),
+ "c:/usr/foo.erl" = filename:join(["A:","C:/usr","foo.erl"]),
+ "c:usr/foo.erl" = filename:join(["A:","C:usr","foo.erl"]),
+ "d:/foo" = filename:join([$D, $:, $/, []], "foo"),
+ ok;
+ _ ->
+ ok
+ end.
%% Make sure join([A,B]) is equivalent to join(A,B) (OTP-12158)
filename_join(A,B) ->
@@ -355,92 +354,92 @@ filename_join(A,B) ->
Res = filename:join([A,B]).
pathtype(Config) when is_list(Config) ->
- ?line relative = filename:pathtype(".."),
- ?line relative = filename:pathtype("foo"),
- ?line relative = filename:pathtype("foo/bar"),
- ?line relative = filename:pathtype('foo/bar'),
- ?line relative = filename:pathtype(['f','oo',"/bar"]),
+ relative = filename:pathtype(".."),
+ relative = filename:pathtype("foo"),
+ relative = filename:pathtype("foo/bar"),
+ relative = filename:pathtype('foo/bar'),
+ relative = filename:pathtype(['f','oo',"/bar"]),
case os:type() of
- {win32, _} ->
- ?line volumerelative = filename:pathtype("/usr/local/bin"),
- ?line volumerelative = filename:pathtype("A:usr/local/bin"),
- ok;
- _ ->
- ?line absolute = filename:pathtype("/"),
- ?line absolute = filename:pathtype("/usr/local/bin"),
- ok
+ {win32, _} ->
+ volumerelative = filename:pathtype("/usr/local/bin"),
+ volumerelative = filename:pathtype("A:usr/local/bin"),
+ ok;
+ _ ->
+ absolute = filename:pathtype("/"),
+ absolute = filename:pathtype("/usr/local/bin"),
+ ok
end.
rootname(Config) when is_list(Config) ->
- ?line "/jam.src/kalle" = filename:rootname("/jam.src/kalle"),
- ?line "/jam.src/foo" = filename:rootname("/jam.src/foo.erl"),
- ?line "/jam.src/foo" = filename:rootname(["/ja",'m.sr',"c/foo.erl"]),
- ?line "/jam.src/foo" = filename:rootname("/jam.src/foo.erl", ".erl"),
- ?line "/jam.src/foo.jam" = filename:rootname("/jam.src/foo.jam", ".erl"),
- ?line "/jam.src/foo.jam" = filename:rootname(["/jam.sr",'c/foo.j',"am"],".erl"),
- ?line "/jam.src/foo.jam" = filename:rootname(["/jam.sr",'c/foo.j'|am],".erl"),
+ "/jam.src/kalle" = filename:rootname("/jam.src/kalle"),
+ "/jam.src/foo" = filename:rootname("/jam.src/foo.erl"),
+ "/jam.src/foo" = filename:rootname(["/ja",'m.sr',"c/foo.erl"]),
+ "/jam.src/foo" = filename:rootname("/jam.src/foo.erl", ".erl"),
+ "/jam.src/foo.jam" = filename:rootname("/jam.src/foo.jam", ".erl"),
+ "/jam.src/foo.jam" = filename:rootname(["/jam.sr",'c/foo.j',"am"],".erl"),
+ "/jam.src/foo.jam" = filename:rootname(["/jam.sr",'c/foo.j'|am],".erl"),
ok.
split(Config) when is_list(Config) ->
- ?line ["/","usr","local","bin"] = filename:split("/usr/local/bin"),
- ?line ["foo","bar"]= filename:split("foo/bar"),
- ?line ["foo", "bar", "hello"]= filename:split("foo////bar//hello"),
- ?line ["foo", "bar", "hello"]= filename:split(["foo//",'//bar//h',"ello"]),
- ?line ["foo", "bar", "hello"]= filename:split(["foo//",'//bar//h'|ello]),
+ ["/","usr","local","bin"] = filename:split("/usr/local/bin"),
+ ["foo","bar"]= filename:split("foo/bar"),
+ ["foo", "bar", "hello"]= filename:split("foo////bar//hello"),
+ ["foo", "bar", "hello"]= filename:split(["foo//",'//bar//h',"ello"]),
+ ["foo", "bar", "hello"]= filename:split(["foo//",'//bar//h'|ello]),
["/"] = filename:split("/"),
[] = filename:split(""),
case os:type() of
- {win32,_} ->
- ?line ["a:/","msdev","include"] =
- filename:split("a:/msdev/include"),
- ?line ["a:/","msdev","include"] =
- filename:split("A:/msdev/include"),
- ?line ["msdev","include"] =
- filename:split("msdev\\include"),
- ?line ["a:/","msdev","include"] =
- filename:split("a:\\msdev\\include"),
- ?line ["a:","msdev","include"] =
- filename:split("a:msdev\\include"),
- ok;
- _ ->
+ {win32,_} ->
+ ["a:/","msdev","include"] =
+ filename:split("a:/msdev/include"),
+ ["a:/","msdev","include"] =
+ filename:split("A:/msdev/include"),
+ ["msdev","include"] =
+ filename:split("msdev\\include"),
+ ["a:/","msdev","include"] =
+ filename:split("a:\\msdev\\include"),
+ ["a:","msdev","include"] =
+ filename:split("a:msdev\\include"),
+ ok;
+ _ ->
ok
end.
t_nativename(Config) when is_list(Config) ->
- ?line "abcedf" = filename:nativename(abcedf),
- ?line "abcedf" = filename:nativename(["abc", "edf"]),
- ?line "abcgluff" = filename:nativename(["abc", gluff]),
+ "abcedf" = filename:nativename(abcedf),
+ "abcedf" = filename:nativename(["abc", "edf"]),
+ "abcgluff" = filename:nativename(["abc", gluff]),
case os:type() of
- {win32, _} ->
- ?line "a:\\temp\\arne.exe" =
- filename:nativename("A:/temp//arne.exe/");
- _ ->
- ?line "/usr/tmp/arne" =
- filename:nativename("/usr/tmp//arne/")
+ {win32, _} ->
+ "a:\\temp\\arne.exe" =
+ filename:nativename("A:/temp//arne.exe/");
+ _ ->
+ "/usr/tmp/arne" =
+ filename:nativename("/usr/tmp//arne/")
end.
find_src(Config) when is_list(Config) ->
- ?line {Source,_} = filename:find_src(file),
- ?line ["file"|_] = lists:reverse(filename:split(Source)),
- ?line {_,_} = filename:find_src(init, [{".","."}, {"ebin","src"}]),
+ {Source,_} = filename:find_src(file),
+ ["file"|_] = lists:reverse(filename:split(Source)),
+ {_,_} = filename:find_src(init, [{".","."}, {"ebin","src"}]),
%% Try to find the source for a preloaded module.
- ?line {error,{preloaded,init}} = filename:find_src(init),
+ {error,{preloaded,init}} = filename:find_src(init),
%% Make sure that find_src works for a slim BEAM file.
OldPath = code:get_path(),
try
- PrivDir = ?config(priv_dir, Config),
- code:add_patha(PrivDir),
- Src = "simple",
- SrcPath = filename:join(PrivDir, Src) ++ ".erl",
- SrcContents = "-module(simple).\n",
- ok = file:write_file(SrcPath, SrcContents),
- {ok,simple} = compile:file(SrcPath, [slim,{outdir,PrivDir}]),
- BeamPath = filename:join(PrivDir, Src),
- {BeamPath,[]} = filename:find_src(simple)
+ PrivDir = proplists:get_value(priv_dir, Config),
+ code:add_patha(PrivDir),
+ Src = "simple",
+ SrcPath = filename:join(PrivDir, Src) ++ ".erl",
+ SrcContents = "-module(simple).\n",
+ ok = file:write_file(SrcPath, SrcContents),
+ {ok,simple} = compile:file(SrcPath, [slim,{outdir,PrivDir}]),
+ BeamPath = filename:join(PrivDir, Src),
+ {BeamPath,[]} = filename:find_src(simple)
after
- code:set_path(OldPath)
+ code:set_path(OldPath)
end,
ok.
@@ -452,50 +451,51 @@ find_src(Config) when is_list(Config) ->
absname_bin(Config) when is_list(Config) ->
case os:type() of
- {win32, _} ->
- ?line [Drive|_] = ?config(priv_dir, Config),
- ?line Temp = filename:join([Drive|":/"], "temp"),
- ?line case file:make_dir(Temp) of
- ok -> ok;
- {error,eexist} -> ok
- end,
- ?line {ok,Cwd} = file:get_cwd(),
- ?line ok = file:set_cwd(Temp),
- ?line <<Drive:8,":/temp/foo">> = filename:absname(<<"foo">>),
- ?line <<Drive:8,":/temp/../ebin">> = filename:absname(<<"../ebin">>),
- ?line <<Drive:8,":/erlang">> = filename:absname(<<"/erlang">>),
- ?line <<Drive:8,":/erlang/src">> = filename:absname(<<"/erlang/src">>),
- ?line <<Drive:8,":/erlang/src">> = filename:absname(<<"\\erlang\\src">>),
- ?line <<Drive:8,":/temp/erlang">> = filename:absname(<<Drive:8,":erlang">>),
- ?line <<Drive:8,":/temp/erlang/src">> =
- filename:absname(<<Drive:8,":erlang/src">>),
- ?line <<Drive:8,":/temp/erlang/src">> =
- filename:absname(<<Drive:8,":erlang\\src\\">>),
- ?line <<"a:/erlang">> = filename:absname(<<"a:erlang">>),
-
- ?line file:set_cwd(<<Drive:8,":/">>),
- ?line <<Drive:8,":/foo">> = filename:absname(<<"foo">>),
- ?line <<Drive:8,":/../ebin">> = filename:absname(<<"../ebin">>),
- ?line <<Drive:8,":/erlang">> = filename:absname(<<"/erlang">>),
- ?line <<Drive:8,":/erlang/src">> = filename:absname(<<"/erlang/src">>),
- ?line <<Drive:8,":/erlang/src">> = filename:absname(<<"\\erlang\\\\src">>),
- ?line <<Drive:8,":/erlang">> = filename:absname(<<Drive:8,":erlang">>),
- ?line <<Drive:8,":/erlang/src">> = filename:absname(<<Drive:8,":erlang/src">>),
- ?line <<"a:/erlang">> = filename:absname(<<"a:erlang">>),
-
- ?line file:set_cwd(Cwd),
- ok;
- {unix, _} ->
- ?line ok = file:set_cwd(<<"/usr">>),
- ?line <<"/usr/foo">> = filename:absname(<<"foo">>),
- ?line <<"/usr/../ebin">> = filename:absname(<<"../ebin">>),
- ?line file:set_cwd(<<"/">>),
- ?line <<"/foo">> = filename:absname(<<"foo">>),
- ?line <<"/../ebin">> = filename:absname(<<"../ebin">>),
- ?line <<"/erlang">> = filename:absname(<<"/erlang">>),
- ?line <<"/erlang/src">> = filename:absname(<<"/erlang/src">>),
- ?line <<"/erlang/src">> = filename:absname(<<"/erlang///src">>),
- ok
+ {win32, _} ->
+ [Drive|_] = proplists:get_value(priv_dir, Config),
+ Temp = filename:join([Drive|":/"], "temp"),
+ case file:make_dir(Temp) of
+ ok -> ok;
+ {error,eexist} -> ok
+ end,
+ {ok,Cwd} = file:get_cwd(),
+ ok = file:set_cwd(Temp),
+ <<Drive:8,":/temp/foo">> = filename:absname(<<"foo">>),
+ <<Drive:8,":/temp/../ebin">> = filename:absname(<<"../ebin">>),
+ <<Drive:8,":/erlang">> = filename:absname(<<"/erlang">>),
+ <<Drive:8,":/erlang/src">> = filename:absname(<<"/erlang/src">>),
+ <<Drive:8,":/erlang/src">> = filename:absname(<<"\\erlang\\src">>),
+ <<Drive:8,":/temp/erlang">> = filename:absname(<<Drive:8,":erlang">>),
+ <<Drive:8,":/temp/erlang/src">> =
+ filename:absname(<<Drive:8,":erlang/src">>),
+ <<Drive:8,":/temp/erlang/src">> =
+ filename:absname(<<Drive:8,":erlang\\src\\">>),
+ <<"a:/erlang">> = filename:absname(<<"a:erlang">>),
+
+ file:set_cwd(<<Drive:8,":/">>),
+ <<Drive:8,":/foo">> = filename:absname(<<"foo">>),
+ <<Drive:8,":/../ebin">> = filename:absname(<<"../ebin">>),
+ <<Drive:8,":/erlang">> = filename:absname(<<"/erlang">>),
+ <<Drive:8,":/erlang/src">> = filename:absname(<<"/erlang/src">>),
+ <<Drive:8,":/erlang/src">> = filename:absname(<<"\\erlang\\\\src">>),
+ <<Drive:8,":/erlang">> = filename:absname(<<Drive:8,":erlang">>),
+ <<Drive:8,":/erlang/src">> = filename:absname(<<Drive:8,":erlang/src">>),
+ <<"a:/erlang">> = filename:absname(<<"a:erlang">>),
+
+ file:set_cwd(Cwd),
+ ok;
+ {unix,_} ->
+ ok = file:set_cwd(<<"/usr">>),
+ <<"/usr/foo">> = filename:absname(<<"foo">>),
+ <<"/usr/../ebin">> = filename:absname(<<"../ebin">>),
+
+ file:set_cwd(<<"/">>),
+ <<"/foo">> = filename:absname(<<"foo">>),
+ <<"/../ebin">> = filename:absname(<<"../ebin">>),
+ <<"/erlang">> = filename:absname(<<"/erlang">>),
+ <<"/erlang/src">> = filename:absname(<<"/erlang/src">>),
+ <<"/erlang/src">> = filename:absname(<<"/erlang///src">>),
+ ok
end.
@@ -503,108 +503,100 @@ absname_bin(Config) when is_list(Config) ->
absname_bin_2(Config) when is_list(Config) ->
case os:type() of
- {win32, _} ->
- ?line [Drive|_] = ?config(priv_dir, Config),
- ?line <<Drive:8,":/temp/foo">> = filename:absname(<<"foo">>, <<Drive:8,":/temp">>),
- ?line <<Drive:8,":/temp/../ebin">> = filename:absname(<<"../ebin">>,
- <<Drive:8,":/temp">>),
- ?line <<Drive:8,":/erlang">> = filename:absname(<<"/erlang">>, <<Drive:8,":/temp">>),
- ?line <<Drive:8,":/erlang/src">> = filename:absname(<<"/erlang/src">>,
- <<Drive:8,":/temp">>),
- ?line <<Drive:8,":/erlang/src">> = filename:absname(<<"\\erlang\\src">>,
- <<Drive:8,":/temp">>),
- ?line <<Drive:8,":/temp/erlang">> = filename:absname(<<Drive:8,":erlang">>,
- <<Drive:8,":/temp">>),
- ?line <<Drive:8,":/temp/erlang/src">> = filename:absname(<<Drive:8,":erlang/src">>,
- <<Drive:8,":/temp">>),
- ?line <<Drive:8,":/temp/erlang/src">> =
- filename:absname(<<Drive:8,":erlang\\src\\">>, <<Drive:8,":/temp">>),
- ?line <<"a:/erlang">> = filename:absname(<<"a:erlang">>, <<Drive:8,":/temp">>),
-
- ?line file:set_cwd(<<Drive:8,":/">>),
- ?line <<Drive:8,":/foo">> = filename:absname(foo, <<Drive:8,":/">>),
- ?line <<Drive:8,":/foo">> = filename:absname(<<"foo">>, <<Drive:8,":/">>),
- ?line <<Drive:8,":/../ebin">> = filename:absname(<<"../ebin">>, <<Drive:8,":/">>),
- ?line <<Drive:8,":/erlang">> = filename:absname(<<"/erlang">>, <<Drive:8,":/">>),
- ?line <<Drive:8,":/erlang/src">> = filename:absname(<<"/erlang/src">>,
- <<Drive:8,":/">>),
- ?line <<Drive:8,":/erlang/src">> = filename:absname(<<"\\erlang\\\\src">>,
- <<Drive:8,":/">>),
- ?line <<Drive:8,":/erlang">> = filename:absname(<<Drive:8,":erlang">>,
- <<Drive:8,":/">>),
- ?line <<Drive:8,":/erlang/src">> = filename:absname(<<Drive:8,":erlang/src">>,
- <<Drive:8,":/">>),
- ?line <<"a:/erlang">> = filename:absname(<<"a:erlang">>, <<Drive:8,":/">>),
-
- ok;
- _ ->
- ?line <<"/usr/foo">> = filename:absname(<<"foo">>, <<"/usr">>),
- ?line <<"/usr/../ebin">> = filename:absname(<<"../ebin">>, <<"/usr">>),
-
- ?line <<"/foo">> = filename:absname(<<"foo">>, <<"/">>),
- ?line <<"/../ebin">> = filename:absname(<<"../ebin">>, <<"/">>),
- ?line <<"/erlang">> = filename:absname(<<"/erlang">>, <<"/">>),
- ?line <<"/erlang/src">> = filename:absname(<<"/erlang/src">>, <<"/">>),
- ?line <<"/erlang/src">> = filename:absname(<<"/erlang///src">>, <<"/">>),
- ok
+ {win32, _} ->
+ [Drive|_] = proplists:get_value(priv_dir, Config),
+ <<Drive:8,":/temp/foo">> = filename:absname(<<"foo">>, <<Drive:8,":/temp">>),
+ <<Drive:8,":/temp/../ebin">> = filename:absname(<<"../ebin">>,
+ <<Drive:8,":/temp">>),
+ <<Drive:8,":/erlang">> = filename:absname(<<"/erlang">>, <<Drive:8,":/temp">>),
+ <<Drive:8,":/erlang/src">> = filename:absname(<<"/erlang/src">>,
+ <<Drive:8,":/temp">>),
+ <<Drive:8,":/erlang/src">> = filename:absname(<<"\\erlang\\src">>,
+ <<Drive:8,":/temp">>),
+ <<Drive:8,":/temp/erlang">> = filename:absname(<<Drive:8,":erlang">>,
+ <<Drive:8,":/temp">>),
+ <<Drive:8,":/temp/erlang/src">> = filename:absname(<<Drive:8,":erlang/src">>,
+ <<Drive:8,":/temp">>),
+ <<Drive:8,":/temp/erlang/src">> =
+ filename:absname(<<Drive:8,":erlang\\src\\">>, <<Drive:8,":/temp">>),
+ <<"a:/erlang">> = filename:absname(<<"a:erlang">>, <<Drive:8,":/temp">>),
+
+ file:set_cwd(<<Drive:8,":/">>),
+ <<Drive:8,":/foo">> = filename:absname(foo, <<Drive:8,":/">>),
+ <<Drive:8,":/foo">> = filename:absname(<<"foo">>, <<Drive:8,":/">>),
+ <<Drive:8,":/../ebin">> = filename:absname(<<"../ebin">>, <<Drive:8,":/">>),
+ <<Drive:8,":/erlang">> = filename:absname(<<"/erlang">>, <<Drive:8,":/">>),
+ <<Drive:8,":/erlang/src">> = filename:absname(<<"/erlang/src">>,
+ <<Drive:8,":/">>),
+ <<Drive:8,":/erlang/src">> = filename:absname(<<"\\erlang\\\\src">>,
+ <<Drive:8,":/">>),
+ <<Drive:8,":/erlang">> = filename:absname(<<Drive:8,":erlang">>,
+ <<Drive:8,":/">>),
+ <<Drive:8,":/erlang/src">> = filename:absname(<<Drive:8,":erlang/src">>,
+ <<Drive:8,":/">>),
+ <<"a:/erlang">> = filename:absname(<<"a:erlang">>, <<Drive:8,":/">>),
+
+ ok;
+ _ ->
+ <<"/usr/foo">> = filename:absname(<<"foo">>, <<"/usr">>),
+ <<"/usr/../ebin">> = filename:absname(<<"../ebin">>, <<"/usr">>),
+ <<"/foo">> = filename:absname(<<"foo">>, <<"/">>),
+ <<"/../ebin">> = filename:absname(<<"../ebin">>, <<"/">>),
+ <<"/erlang">> = filename:absname(<<"/erlang">>, <<"/">>),
+ <<"/erlang/src">> = filename:absname(<<"/erlang/src">>, <<"/">>),
+ <<"/erlang/src">> = filename:absname(<<"/erlang///src">>, <<"/">>),
+ ok
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
basename_bin_1(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line <<".">> = filename:basename(<<".">>),
- ?line <<"foo">> = filename:basename(<<"foo">>),
- ?line <<"foo">> = filename:basename(<<"/usr/foo">>),
- ?line <<"foo.erl">> = filename:basename(<<"A:usr/foo.erl">>),
- ?line case os:type() of
- {win32, _} ->
- ?line <<"foo">> = filename:basename(<<"A:\\usr\\foo">>),
- ?line <<"foo">> = filename:basename(<<"A:foo">>);
- _ ->
- ?line <<"strange\\but\\true">> =
- filename:basename(<<"strange\\but\\true">>)
- end,
- ?line test_server:timetrap_cancel(Dog),
+ <<".">> = filename:basename(<<".">>),
+ <<"foo">> = filename:basename(<<"foo">>),
+ <<"foo">> = filename:basename(<<"/usr/foo">>),
+ <<"foo.erl">> = filename:basename(<<"A:usr/foo.erl">>),
+ case os:type() of
+ {win32, _} ->
+ <<"foo">> = filename:basename(<<"A:\\usr\\foo">>),
+ <<"foo">> = filename:basename(<<"A:foo">>);
+ _ ->
+ <<"strange\\but\\true">> = filename:basename(<<"strange\\but\\true">>)
+ end,
ok.
basename_bin_2(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line <<".">> = filename:basename(<<".">>, <<".erl">>),
- ?line <<"foo">> = filename:basename(<<"foo.erl">>, <<".erl">>),
- ?line <<"foo.erl">> = filename:basename(<<"/usr/foo.erl">>, <<".hrl">>),
- ?line <<"foo.erl">> = filename:basename(<<"/usr.hrl/foo.erl">>, <<".hrl">>),
- ?line <<"foo">> = filename:basename(<<"/usr.hrl/foo">>, <<".hrl">>),
- ?line <<"foo">> = filename:basename(<<"usr/foo/">>, <<".erl">>),
- ?line <<"foo.erl">> = filename:basename(<<"usr/foo.erl/">>, <<".erl">>),
- ?line case os:type() of
- {win32, _} ->
- ?line <<"foo">> = filename:basename(<<"A:foo">>, <<".erl">>),
- ?line <<"foo.erl">> = filename:basename(<<"a:\\usr\\foo.erl">>,
- <<".hrl">>),
- ?line <<"foo.erl">> = filename:basename(<<"c:\\usr.hrl\\foo.erl">>,
- <<".hrl">>),
- ?line <<"foo">> = filename:basename(<<"A:\\usr\\foo">>, <<".hrl">>);
- _ ->
- ?line <<"strange\\but\\true">> =
- filename:basename(<<"strange\\but\\true.erl">>, <<".erl">>),
- ?line <<"strange\\but\\true">> =
- filename:basename(<<"strange\\but\\true">>, <<".erl">>)
- end,
- ?line test_server:timetrap_cancel(Dog),
+ <<".">> = filename:basename(<<".">>, <<".erl">>),
+ <<"foo">> = filename:basename(<<"foo.erl">>, <<".erl">>),
+ <<"foo.erl">> = filename:basename(<<"/usr/foo.erl">>, <<".hrl">>),
+ <<"foo.erl">> = filename:basename(<<"/usr.hrl/foo.erl">>, <<".hrl">>),
+ <<"foo">> = filename:basename(<<"/usr.hrl/foo">>, <<".hrl">>),
+ <<"foo">> = filename:basename(<<"usr/foo/">>, <<".erl">>),
+ <<"foo.erl">> = filename:basename(<<"usr/foo.erl/">>, <<".erl">>),
+ case os:type() of
+ {win32, _} ->
+ <<"foo">> = filename:basename(<<"A:foo">>, <<".erl">>),
+ <<"foo.erl">> = filename:basename(<<"a:\\usr\\foo.erl">>, <<".hrl">>),
+ <<"foo.erl">> = filename:basename(<<"c:\\usr.hrl\\foo.erl">>, <<".hrl">>),
+ <<"foo">> = filename:basename(<<"A:\\usr\\foo">>, <<".hrl">>);
+ _ ->
+ <<"strange\\but\\true">> =
+ filename:basename(<<"strange\\but\\true.erl">>, <<".erl">>),
+ <<"strange\\but\\true">> =
+ filename:basename(<<"strange\\but\\true">>, <<".erl">>)
+ end,
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dirname_bin(Config) when is_list(Config) ->
case os:type() of
- {win32,_} ->
- <<"A:/usr">> = filename:dirname(<<"A:/usr/foo.erl">>),
- <<"A:usr">> = filename:dirname(<<"A:usr/foo.erl">>),
- <<"/usr">> = filename:dirname(<<"\\usr\\foo.erl">>),
- <<"/">> = filename:dirname(<<"\\usr">>),
- <<"A:">> = filename:dirname(<<"A:">>);
- _ -> true
+ {win32,_} ->
+ <<"A:/usr">> = filename:dirname(<<"A:/usr/foo.erl">>),
+ <<"A:usr">> = filename:dirname(<<"A:usr/foo.erl">>),
+ <<"/usr">> = filename:dirname(<<"\\usr\\foo.erl">>),
+ <<"/">> = filename:dirname(<<"\\usr">>),
+ <<"A:">> = filename:dirname(<<"A:">>);
+ _ -> true
end,
<<"usr">> = filename:dirname(<<"usr///foo.erl">>),
<<".">> = filename:dirname(<<"foo.erl">>),
@@ -612,7 +604,6 @@ dirname_bin(Config) when is_list(Config) ->
<<"/">> = filename:dirname(<<"/">>),
<<"/">> = filename:dirname(<<"/usr">>),
ok.
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -624,10 +615,9 @@ extension_bin(Config) when is_list(Config) ->
<<"">> = filename:extension(<<"A:/usr/foo">>),
case os:type() of
{win32, _} ->
- ?line <<"">> = filename:extension(<<"A:\\usr\\foo">>),
- ?line <<".erl">> =
- filename:extension(<<"A:/usr.bar/foo.nisse.erl">>),
- ?line <<"">> = filename:extension(<<"A:/usr.bar/foo">>),
+ <<"">> = filename:extension(<<"A:\\usr\\foo">>),
+ <<".erl">> = filename:extension(<<"A:/usr.bar/foo.nisse.erl">>),
+ <<"">> = filename:extension(<<"A:/usr.bar/foo">>),
ok;
_ -> ok
end.
@@ -635,22 +625,22 @@ extension_bin(Config) when is_list(Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
join_bin(Config) when is_list(Config) ->
- ?line <<"/">> = filename:join([<<"/">>]),
- ?line <<"/">> = filename:join([<<"//">>]),
- ?line <<"usr/foo.erl">> = filename:join(<<"usr">>,<<"foo.erl">>),
- ?line <<"/src/foo.erl">> = filename:join(usr, <<"/src/foo.erl">>),
- ?line <<"/src/foo.erl">> = filename:join([<<"/src/">>,'foo.erl']),
- ?line <<"/src/foo.erl">> = filename:join(<<"usr">>, ["/sr", 'c/foo.erl']),
- ?line <<"/src/foo.erl">> = filename:join(<<"usr">>, <<"/src/foo.erl">>),
+ <<"/">> = filename:join([<<"/">>]),
+ <<"/">> = filename:join([<<"//">>]),
+ <<"usr/foo.erl">> = filename:join(<<"usr">>,<<"foo.erl">>),
+ <<"/src/foo.erl">> = filename:join(usr, <<"/src/foo.erl">>),
+ <<"/src/foo.erl">> = filename:join([<<"/src/">>,'foo.erl']),
+ <<"/src/foo.erl">> = filename:join(<<"usr">>, ["/sr", 'c/foo.erl']),
+ <<"/src/foo.erl">> = filename:join(<<"usr">>, <<"/src/foo.erl">>),
%% Make sure that redundant slashes work too.
- ?line <<"a/b/c/d/e/f/g">> = filename:join([<<"a//b/c/////d//e/f/g">>]),
- ?line <<"a/b/c/d/e/f/g">> = filename:join([<<"a//b/c/">>, <<"d//e/f/g">>]),
- ?line <<"a/b/c/d/e/f/g">> = filename:join([<<"a//b/c">>, <<"d//e/f/g">>]),
- ?line <<"/d/e/f/g">> = filename:join([<<"a//b/c">>, <<"/d//e/f/g">>]),
- ?line <<"/d/e/f/g">> = filename:join([<<"a//b/c">>, <<"//d//e/f/g">>]),
+ <<"a/b/c/d/e/f/g">> = filename:join([<<"a//b/c/////d//e/f/g">>]),
+ <<"a/b/c/d/e/f/g">> = filename:join([<<"a//b/c/">>, <<"d//e/f/g">>]),
+ <<"a/b/c/d/e/f/g">> = filename:join([<<"a//b/c">>, <<"d//e/f/g">>]),
+ <<"/d/e/f/g">> = filename:join([<<"a//b/c">>, <<"/d//e/f/g">>]),
+ <<"/d/e/f/g">> = filename:join([<<"a//b/c">>, <<"//d//e/f/g">>]),
- ?line <<"foo/bar">> = filename:join([$f,$o,$o,$/,[]], <<"bar">>),
+ <<"foo/bar">> = filename:join([$f,$o,$o,$/,[]], <<"bar">>),
%% Single dots - should be removed if in the middle of the path,
%% but not at the end of the path.
@@ -699,30 +689,25 @@ join_bin(Config) when is_list(Config) ->
<<"/a/b">> = filename:join([<<"/a/">>,<<"b/">>]),
<<"/a/b">> = filename:join(<<"/a/">>,<<"b/">>),
- ?line case os:type() of
- {win32, _} ->
- ?line <<"d:/">> = filename:join([<<"D:/">>]),
- ?line <<"d:/">> = filename:join([<<"D:\\">>]),
- ?line <<"d:/abc">> = filename:join([<<"D:/">>, <<"abc">>]),
- ?line <<"d:abc">> = filename:join([<<"D:">>, <<"abc">>]),
- ?line <<"a/b/c/d/e/f/g">> =
- filename:join([<<"a//b\\c//\\/\\d/\\e/f\\g">>]),
- ?line <<"a:usr/foo.erl">> =
- filename:join([<<"A:">>,<<"usr">>,<<"foo.erl">>]),
- ?line <<"/usr/foo.erl">> =
- filename:join([<<"A:">>,<<"/usr">>,<<"foo.erl">>]),
- ?line <<"c:usr">> = filename:join(<<"A:">>,<<"C:usr">>),
- ?line <<"a:usr">> = filename:join(<<"A:">>,<<"usr">>),
- ?line <<"c:/usr">> = filename:join(<<"A:">>, <<"C:/usr">>),
- ?line <<"c:/usr/foo.erl">> =
- filename:join([<<"A:">>,<<"C:/usr">>,<<"foo.erl">>]),
- ?line <<"c:usr/foo.erl">> =
- filename:join([<<"A:">>,<<"C:usr">>,<<"foo.erl">>]),
- ?line <<"d:/foo">> = filename:join([$D, $:, $/, []], <<"foo">>),
- ok;
- _ ->
- ok
- end.
+ case os:type() of
+ {win32, _} ->
+ <<"d:/">> = filename:join([<<"D:/">>]),
+ <<"d:/">> = filename:join([<<"D:\\">>]),
+ <<"d:/abc">> = filename:join([<<"D:/">>, <<"abc">>]),
+ <<"d:abc">> = filename:join([<<"D:">>, <<"abc">>]),
+ <<"a/b/c/d/e/f/g">> = filename:join([<<"a//b\\c//\\/\\d/\\e/f\\g">>]),
+ <<"a:usr/foo.erl">> = filename:join([<<"A:">>,<<"usr">>,<<"foo.erl">>]),
+ <<"/usr/foo.erl">> = filename:join([<<"A:">>,<<"/usr">>,<<"foo.erl">>]),
+ <<"c:usr">> = filename:join(<<"A:">>,<<"C:usr">>),
+ <<"a:usr">> = filename:join(<<"A:">>,<<"usr">>),
+ <<"c:/usr">> = filename:join(<<"A:">>, <<"C:/usr">>),
+ <<"c:/usr/foo.erl">> = filename:join([<<"A:">>,<<"C:/usr">>,<<"foo.erl">>]),
+ <<"c:usr/foo.erl">> = filename:join([<<"A:">>,<<"C:usr">>,<<"foo.erl">>]),
+ <<"d:/foo">> = filename:join([$D, $:, $/, []], <<"foo">>),
+ ok;
+ _ ->
+ ok
+ end.
pathtype_bin(Config) when is_list(Config) ->
relative = filename:pathtype(<<"..">>),
@@ -730,14 +715,14 @@ pathtype_bin(Config) when is_list(Config) ->
relative = filename:pathtype(<<"foo/bar">>),
relative = filename:pathtype('foo/bar'),
case os:type() of
- {win32, _} ->
- volumerelative = filename:pathtype(<<"/usr/local/bin">>),
- volumerelative = filename:pathtype(<<"A:usr/local/bin">>),
- ok;
- _ ->
- absolute = filename:pathtype(<<"/">>),
- absolute = filename:pathtype(<<"/usr/local/bin">>),
- ok
+ {win32, _} ->
+ volumerelative = filename:pathtype(<<"/usr/local/bin">>),
+ volumerelative = filename:pathtype(<<"A:usr/local/bin">>),
+ ok;
+ _ ->
+ absolute = filename:pathtype(<<"/">>),
+ absolute = filename:pathtype(<<"/usr/local/bin">>),
+ ok
end.
rootname_bin(Config) when is_list(Config) ->
@@ -756,29 +741,204 @@ split_bin(Config) when is_list(Config) ->
[<<"/">>] = filename:split(<<"/">>),
[] = filename:split(<<"">>),
case os:type() of
- {win32,_} ->
- [<<"a:/">>,<<"msdev">>,<<"include">>] =
- filename:split(<<"a:/msdev/include">>),
- [<<"a:/">>,<<"msdev">>,<<"include">>] =
- filename:split(<<"A:/msdev/include">>),
- [<<"msdev">>,<<"include">>] =
- filename:split(<<"msdev\\include">>),
- [<<"a:/">>,<<"msdev">>,<<"include">>] =
- filename:split(<<"a:\\msdev\\include">>),
- [<<"a:">>,<<"msdev">>,<<"include">>] =
- filename:split(<<"a:msdev\\include">>),
- ok;
- _ ->
- ok
+ {win32,_} ->
+ [<<"a:/">>,<<"msdev">>,<<"include">>] =
+ filename:split(<<"a:/msdev/include">>),
+ [<<"a:/">>,<<"msdev">>,<<"include">>] =
+ filename:split(<<"A:/msdev/include">>),
+ [<<"msdev">>,<<"include">>] =
+ filename:split(<<"msdev\\include">>),
+ [<<"a:/">>,<<"msdev">>,<<"include">>] =
+ filename:split(<<"a:\\msdev\\include">>),
+ [<<"a:">>,<<"msdev">>,<<"include">>] =
+ filename:split(<<"a:msdev\\include">>),
+ ok;
+ _ ->
+ ok
end.
t_nativename_bin(Config) when is_list(Config) ->
- ?line <<"abcedf">> = filename:nativename(<<"abcedf">>),
+ <<"abcedf">> = filename:nativename(<<"abcedf">>),
+ case os:type() of
+ {win32, _} ->
+ <<"a:\\temp\\arne.exe">> =
+ filename:nativename(<<"A:/temp//arne.exe/">>);
+ _ ->
+ <<"/usr/tmp/arne">> =
+ filename:nativename(<<"/usr/tmp//arne/">>)
+ end.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% basedirs
+t_basedir_api(Config) when is_list(Config) ->
+ true = is_list(filename:basedir(site_data, "My App")),
+ true = is_list(filename:basedir(site_config, "My App")),
+ true = is_list(filename:basedir(user_data, "My App")),
+ true = is_list(filename:basedir(user_log, "My App")),
+ true = is_list(filename:basedir(user_config, "My App")),
+ true = is_list(filename:basedir(user_cache, "My App")),
+
+ true = is_list(filename:basedir(site_data, <<"My App">>)),
+ true = is_list(filename:basedir(site_config, <<"My App">>)),
+ true = is_binary(filename:basedir(user_data, <<"My App">>)),
+ true = is_binary(filename:basedir(user_log, <<"My App">>)),
+ true = is_binary(filename:basedir(user_config, <<"My App">>)),
+ true = is_binary(filename:basedir(user_cache, <<"My App">>)),
+
+ %% simulate for windows
+ case os:type() of
+ {win32,_} -> ok;
+ _ ->
+ os:putenv("APPDATA", "C:\\Documents and Settings\\otptest\\Application Data")
+ end,
+
+ true = is_list(filename:basedir(site_data, "My App", #{})),
+ true = is_list(filename:basedir(site_config, "My App", #{os=>linux})),
+ true = is_list(filename:basedir(user_data, "My App", #{os=>darwin})),
+ true = is_list(filename:basedir(user_log, "My App", #{os=>windows})),
+ true = is_list(filename:basedir(user_config, "My App",#{author=>"Erl"})),
+ true = is_list(filename:basedir(user_config, "My App",#{os=>darwin,
+ author=>"Erl"})),
+ true = is_list(filename:basedir(user_config, "My App",#{os=>linux,
+ author=>"Erl"})),
+ true = is_list(filename:basedir(user_cache, "My App",#{os=>windows,
+ author=>"Erl"})),
+ true = is_list(filename:basedir(user_config, "My App",#{os=>darwin,
+ author=>"Erla",
+ version=>"1.0"})),
+ true = is_list(filename:basedir(user_config, "My App",#{os=>linux,
+ version=>"2.0.1",
+ author=>"Erl"})),
+ true = is_list(filename:basedir(user_cache, "My App",#{os=>windows,
+ version=>"3.1.2",
+ author=>"Erl"})),
+ true = is_binary(filename:basedir(user_config, "My App",#{os=>darwin,
+ author=>"Erla",
+ version=><<"1.0">>})),
+ true = is_binary(filename:basedir(user_config, "My App",#{os=>windows,
+ version=>"2.0.1",
+ author=><<"Erl">>})),
+ true = is_binary(filename:basedir(user_cache, "My App",#{os=>linux,
+ version=><<"3.1.2">>,
+ author=>"Erl"})),
+ %% simulate for windows
+ case os:type() of
+ {win32,_} -> ok;
+ _ -> os:unsetenv("APPDATA")
+ end,
+
+ {'EXIT', _} = (catch filename:basedir(wrong_config, "My App")),
+ {'EXIT', _} = (catch filename:basedir(user_cache, {bad,name})),
+ {'EXIT', _} = (catch filename:basedir(user_cache, "My App", badopts)),
+ {'EXIT', _} = (catch filename:basedir(user_cache, "My App", [])),
+ ok.
+
+t_basedir_windows(Config) when is_list(Config) ->
+ Types = [user_data,user_log,user_config,user_cache],
case os:type() of
- {win32, _} ->
- ?line <<"a:\\temp\\arne.exe">> =
- filename:nativename(<<"A:/temp//arne.exe/">>);
- _ ->
- ?line <<"/usr/tmp/arne">> =
- filename:nativename(<<"/usr/tmp//arne/">>)
+ {win32,_} ->
+ ok = check_basedir_windows(Types, #{});
+ _ ->
+ %% Windows 7 and beyond
+ os:putenv("APPDATA", "C:\\Users\\otptest\\AppData\\Roaming"),
+ os:putenv("LOCALAPPDATA", "C:\\Users\\otptest\\AppData\\Local"),
+ io:format("APPDATA ~p~n", [os:getenv("APPDATA")]),
+ io:format("LOCALAPPDATA ~p~n", [os:getenv("LOCALAPPDATA")]),
+ ok = check_basedir_windows(Types,#{os=>windows}),
+ %% Windows XP
+ os:unsetenv("LOCALAPPDATA"),
+ os:putenv("APPDATA", "C:\\Documents and Settings\\otptest\\Application Data"),
+ io:format("APPDATA ~p~n", [os:getenv("APPDATA")]),
+ io:format("APPLOCALDATA ~p~n", [os:getenv("APPLOCALDATA")]),
+ ok = check_basedir_windows(Types,#{os=>windows}),
+ os:unsetenv("APPDATA")
+ end,
+ ok.
+
+check_basedir_windows([],_) -> ok;
+check_basedir_windows([Type|Types],Opt) ->
+ Name = "Some Application",
+ io:format("type: ~p~n", [Type]),
+ ok = check_basedir_windows_path(Type,
+ [Name],
+ filename:basedir(Type, Name, Opt)),
+ ok = check_basedir_windows_path(Type,
+ ["Erl",Name],
+ filename:basedir(Type, Name, Opt#{author=>"Erl"})),
+ ok = check_basedir_windows_path(Type,
+ [Name,"1.0"],
+ filename:basedir(Type, Name, Opt#{version=>"1.0"})),
+ ok = check_basedir_windows_path(Type,
+ ["Erl",Name,"1.0"],
+ filename:basedir(Type, Name, Opt#{author=>"Erl",
+ version=>"1.0"})),
+ check_basedir_windows(Types, Opt).
+
+check_basedir_windows_path(Type,Check0,Basedir) ->
+ BDR = lists:reverse(filename:split(Basedir)),
+ Check = lists:reverse(Check0),
+ io:format("~w: ~p ~p~n", [Type,Check,BDR]),
+ case Type of
+ user_log -> check_basedir_windows_path_split(["Logs"|Check],BDR);
+ user_cache -> check_basedir_windows_path_split(["Cache"|Check],BDR);
+ _ -> check_basedir_windows_path_split(Check,BDR)
+ end.
+
+check_basedir_windows_path_split([],_) -> ok;
+check_basedir_windows_path_split([Same|Check],[Same|BDR]) ->
+ check_basedir_windows_path_split(Check,BDR).
+
+
+t_basedir_xdg(Config) when is_list(Config) ->
+ check_basedir_xdg([user_data,user_log,user_config,user_cache,
+ site_data,site_config]),
+ ok.
+
+check_basedir_xdg([]) -> ok;
+check_basedir_xdg([Type|Types]) ->
+ Name = "some_app",
+ Opt = #{os=>linux},
+ Key = basedir_xdg_env(Type),
+ io:format("type: ~p~n", [Type]),
+ Home = os:getenv("HOME"),
+ NDir = "/some/absolute/path",
+ DefPath = basedir_xdg_def(Type,Home,Name),
+ EnvPath = case Type of
+ user_log -> filename:join([NDir,Name,"log"]);
+ site_data -> [filename:join([NDir,Name])];
+ site_config -> [filename:join([NDir,Name])];
+ _ -> filename:join([NDir,Name])
+ end,
+ os:unsetenv(Key),
+ ok = check_basedir(Type, DefPath, filename:basedir(Type, Name, Opt)),
+ os:putenv(Key, NDir),
+ ok = check_basedir(Type, EnvPath, filename:basedir(Type, Name, Opt)),
+ os:unsetenv(Key),
+ ok = check_basedir(Type, DefPath, filename:basedir(Type, Name, Opt)),
+ check_basedir_xdg(Types).
+
+check_basedir(Type, Path, Basedir) ->
+ io:format("~w: ~p = ~p~n", [Type,Path,Basedir]),
+ Path = Basedir,
+ ok.
+
+basedir_xdg_env(Type) ->
+ case Type of
+ user_data -> "XDG_DATA_HOME";
+ user_config -> "XDG_CONFIG_HOME";
+ user_cache -> "XDG_CACHE_HOME";
+ user_log -> "XDG_CACHE_HOME";
+ site_data -> "XDG_DATA_DIRS";
+ site_config -> "XDG_CONFIG_DIRS"
+ end.
+
+basedir_xdg_def(Type,Home,Name) ->
+ case Type of
+ user_data -> filename:join([Home,".local","share",Name]);
+ user_config -> filename:join([Home,".config",Name]);
+ user_cache -> filename:join([Home,".cache",Name]);
+ user_log -> filename:join([Home,".cache",Name,"log"]);
+ site_data -> [filename:join([Dir,Name]) ||
+ Dir <- ["/usr/local/share/","/usr/share/"]];
+ site_config -> [filename:join(["/etc/xdg",Name])]
end.
diff --git a/lib/stdlib/test/fixtable_SUITE.erl b/lib/stdlib/test/fixtable_SUITE.erl
index 66150e60c1..de100a11d6 100644
--- a/lib/stdlib/test/fixtable_SUITE.erl
+++ b/lib/stdlib/test/fixtable_SUITE.erl
@@ -33,7 +33,9 @@
%%% Internal exports
-export([command_loop/0,start_commander/0]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[multiple_fixes, multiple_processes,
@@ -68,14 +70,11 @@ end_per_group(_GroupName, Config) ->
-define(HELPER_NODE, (atom_to_list(?MODULE) ++ "_helper1")).
init_per_testcase(_Func, Config) ->
- PrivDir = ?config(priv_dir,Config),
+ PrivDir = proplists:get_value(priv_dir,Config),
file:make_dir(PrivDir),
- Dog=test_server:timetrap(test_server:seconds(60)),
- [{watchdog, Dog}|Config].
+ Config.
end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
lists:foreach(fun(X) ->
(catch dets:close(X)),
(catch file:delete(dets_filename(X,Config)))
@@ -98,302 +97,280 @@ show(Term, Line) ->
-endif.
-fixbag(doc) ->
- ["Check for bug OTP-5087, safe_fixtable for bags could give "
- "incorrect lookups"];
-fixbag(suite) ->
- [];
+%% Check for bug OTP-5087; safe_fixtable for bags could give incorrect
+%% lookups.
fixbag(Config) when is_list(Config) ->
- ?line T = ets:new(x,[bag]),
- ?line ets:insert(T,{a,1}),
- ?line ets:insert(T,{a,2}),
- ?line ets:safe_fixtable(T,true),
- ?line ets:match_delete(T,{a,2}),
- ?line ets:insert(T,{a,3}),
- ?line Res = ets:lookup(T,a),
- ?line ets:safe_fixtable(T,false),
- ?line Res = ets:lookup(T,a),
+ T = ets:new(x,[bag]),
+ ets:insert(T,{a,1}),
+ ets:insert(T,{a,2}),
+ ets:safe_fixtable(T,true),
+ ets:match_delete(T,{a,2}),
+ ets:insert(T,{a,3}),
+ Res = ets:lookup(T,a),
+ ets:safe_fixtable(T,false),
+ Res = ets:lookup(T,a),
ok.
-insert_same_key(doc) ->
- ["Check correct behaviour if a key is deleted and reinserted during fixation."];
-insert_same_key(suite) ->
- [];
+%% Check correct behaviour if a key is deleted and reinserted during
+%% fixation.
insert_same_key(Config) when is_list(Config) ->
- ?line {ok,Dets1} = dets:open_file(?DETS_TMP1,
- [{file, dets_filename(?DETS_TMP1,Config)}]),
- ?line Ets1 = ets:new(ets,[]),
- ?line insert_same_key(Dets1,dets,Config),
- ?line insert_same_key(Ets1,ets,Config),
- ?line ets:insert(Ets1,{1,2}),
- ?line 1 = ets:info(Ets1,size),
- ?line dets:insert(Dets1,{1,2}),
- ?line 1 = dets:info(Dets1,size),
- ?line dets:close(Dets1),
- ?line (catch file:delete(dets_filename(Dets1,Config))),
- ?line ets:delete(Ets1),
- ?line {ok,Dets2} = dets:open_file(?DETS_TMP1,
- [{type,bag},{file, dets_filename(?DETS_TMP1,Config)}]),
- ?line Ets2 = ets:new(ets,[bag]),
- ?line insert_same_key(Dets2,dets,Config),
- ?line insert_same_key(Ets2,ets,Config),
- ?line ets:insert(Ets2,{1,2}),
- ?line 2 = ets:info(Ets2,size),
- ?line ets:insert(Ets2,{1,2}),
- ?line 2 = ets:info(Ets2,size),
- ?line dets:insert(Dets2,{1,2}),
- ?line 2 = dets:info(Dets2,size),
- ?line dets:insert(Dets2,{1,2}),
- ?line 2 = dets:info(Dets2,size),
- ?line dets:close(Dets2),
- ?line (catch file:delete(dets_filename(Dets2,Config))),
- ?line ets:delete(Ets2),
- ?line {ok,Dets3} = dets:open_file(?DETS_TMP1,
- [{type,duplicate_bag},
- {file, dets_filename(?DETS_TMP1,Config)}]),
- ?line Ets3 = ets:new(ets,[duplicate_bag]),
- ?line insert_same_key(Dets3,dets,Config),
- ?line insert_same_key(Ets3,ets,Config),
- ?line ets:insert(Ets3,{1,2}),
- ?line 2 = ets:info(Ets3,size),
- ?line ets:insert(Ets3,{1,2}),
- ?line 3 = ets:info(Ets3,size),
- ?line dets:insert(Dets3,{1,2}),
- ?line 2 = dets:info(Dets3,size),
- ?line dets:insert(Dets3,{1,2}),
- ?line 3 = dets:info(Dets3,size),
- ?line dets:close(Dets3),
- ?line (catch file:delete(dets_filename(Dets3,Config))),
- ?line ets:delete(Ets3),
+ {ok,Dets1} = dets:open_file(?DETS_TMP1,
+ [{file, dets_filename(?DETS_TMP1,Config)}]),
+ Ets1 = ets:new(ets,[]),
+ insert_same_key(Dets1,dets,Config),
+ insert_same_key(Ets1,ets,Config),
+ ets:insert(Ets1,{1,2}),
+ 1 = ets:info(Ets1,size),
+ dets:insert(Dets1,{1,2}),
+ 1 = dets:info(Dets1,size),
+ dets:close(Dets1),
+ (catch file:delete(dets_filename(Dets1,Config))),
+ ets:delete(Ets1),
+ {ok,Dets2} = dets:open_file(?DETS_TMP1,
+ [{type,bag},{file, dets_filename(?DETS_TMP1,Config)}]),
+ Ets2 = ets:new(ets,[bag]),
+ insert_same_key(Dets2,dets,Config),
+ insert_same_key(Ets2,ets,Config),
+ ets:insert(Ets2,{1,2}),
+ 2 = ets:info(Ets2,size),
+ ets:insert(Ets2,{1,2}),
+ 2 = ets:info(Ets2,size),
+ dets:insert(Dets2,{1,2}),
+ 2 = dets:info(Dets2,size),
+ dets:insert(Dets2,{1,2}),
+ 2 = dets:info(Dets2,size),
+ dets:close(Dets2),
+ (catch file:delete(dets_filename(Dets2,Config))),
+ ets:delete(Ets2),
+ {ok,Dets3} = dets:open_file(?DETS_TMP1,
+ [{type,duplicate_bag},
+ {file, dets_filename(?DETS_TMP1,Config)}]),
+ Ets3 = ets:new(ets,[duplicate_bag]),
+ insert_same_key(Dets3,dets,Config),
+ insert_same_key(Ets3,ets,Config),
+ ets:insert(Ets3,{1,2}),
+ 2 = ets:info(Ets3,size),
+ ets:insert(Ets3,{1,2}),
+ 3 = ets:info(Ets3,size),
+ dets:insert(Dets3,{1,2}),
+ 2 = dets:info(Dets3,size),
+ dets:insert(Dets3,{1,2}),
+ 3 = dets:info(Dets3,size),
+ dets:close(Dets3),
+ (catch file:delete(dets_filename(Dets3,Config))),
+ ets:delete(Ets3),
ok.
insert_same_key(Tab,Mod,_Config) ->
- ?line Mod:insert(Tab,{1,1}),
- ?line Mod:insert(Tab,{1,2}),
- ?line Mod:insert(Tab,{2,2}),
- ?line Mod:insert(Tab,{2,2}),
- ?line Mod:safe_fixtable(Tab,true),
- ?line Mod:delete(Tab,1),
- ?line Mod:insert(Tab,{1,1}),
- ?line Expect = case Mod:info(Tab,type) of
- bag ->
- Mod:insert(Tab,{1,2}),
- 2;
- _ ->
- 1
- end,
- ?line Mod:delete(Tab,2),
- ?line Mod:safe_fixtable(Tab,false),
- ?line case Mod:info(Tab,size) of
- Expect ->
- ok;
- _ ->
- exit({size_field_wrong,{Mod,Mod:info(Tab)}})
- end.
-
-
-
-
-owner_dies(doc) ->
- ["Check correct behaviour if the table owner dies."];
-owner_dies(suite) ->
- [];
+ Mod:insert(Tab,{1,1}),
+ Mod:insert(Tab,{1,2}),
+ Mod:insert(Tab,{2,2}),
+ Mod:insert(Tab,{2,2}),
+ Mod:safe_fixtable(Tab,true),
+ Mod:delete(Tab,1),
+ Mod:insert(Tab,{1,1}),
+ Expect = case Mod:info(Tab,type) of
+ bag ->
+ Mod:insert(Tab,{1,2}),
+ 2;
+ _ ->
+ 1
+ end,
+ Mod:delete(Tab,2),
+ Mod:safe_fixtable(Tab,false),
+ case Mod:info(Tab,size) of
+ Expect ->
+ ok;
+ _ ->
+ exit({size_field_wrong,{Mod,Mod:info(Tab)}})
+ end.
+
+
+
+
+%% Check correct behaviour if the table owner dies.
owner_dies(Config) when is_list(Config) ->
- ?line P1 = start_commander(),
- ?line Ets1 = command(P1,{ets,new,[ets,[]]}),
- ?line command(P1,{ets,safe_fixtable,[Ets1,true]}),
- ?line {_,[{P1,1}]} = ets:info(Ets1, safe_fixed),
- ?line stop_commander(P1),
- ?line undefined = ets:info(Ets1, safe_fixed),
- ?line P2 = start_commander(),
- ?line Ets2 = command(P2,{ets,new,[ets,[public]]}),
- ?line command(P2,{ets,safe_fixtable,[Ets2,true]}),
- ?line ets:safe_fixtable(Ets2,true),
- ?line true = ets:info(Ets2, fixed),
- ?line {_,[{_,1},{_,1}]} = ets:info(Ets2, safe_fixed),
- ?line stop_commander(P2),
- ?line undefined = ets:info(Ets2, safe_fixed),
- ?line undefined = ets:info(Ets2, fixed),
- ?line P3 = start_commander(),
- ?line {ok,Dets} = ?LOG(command(P3, {dets, open_file,
- [?DETS_TMP1,
- [{file,
- dets_filename(?DETS_TMP1,
- Config)}]]})),
- ?line command(P3, {dets, safe_fixtable, [Dets, true]}),
- ?line {_,[{P3,1}]} = dets:info(Dets, safe_fixed),
- ?line true = dets:info(Dets, fixed),
- ?line stop_commander(P3),
- ?line undefined = dets:info(Dets, safe_fixed),
- ?line undefined = dets:info(Dets, fixed),
- ?line P4 = start_commander(),
- ?line {ok,Dets} = command(P4, {dets, open_file,
+ P1 = start_commander(),
+ Ets1 = command(P1,{ets,new,[ets,[]]}),
+ command(P1,{ets,safe_fixtable,[Ets1,true]}),
+ {_,[{P1,1}]} = ets:info(Ets1, safe_fixed),
+ stop_commander(P1),
+ undefined = ets:info(Ets1, safe_fixed),
+ P2 = start_commander(),
+ Ets2 = command(P2,{ets,new,[ets,[public]]}),
+ command(P2,{ets,safe_fixtable,[Ets2,true]}),
+ ets:safe_fixtable(Ets2,true),
+ true = ets:info(Ets2, fixed),
+ {_,[{_,1},{_,1}]} = ets:info(Ets2, safe_fixed),
+ stop_commander(P2),
+ undefined = ets:info(Ets2, safe_fixed),
+ undefined = ets:info(Ets2, fixed),
+ P3 = start_commander(),
+ {ok,Dets} = ?LOG(command(P3, {dets, open_file,
+ [?DETS_TMP1,
+ [{file,
+ dets_filename(?DETS_TMP1,
+ Config)}]]})),
+ command(P3, {dets, safe_fixtable, [Dets, true]}),
+ {_,[{P3,1}]} = dets:info(Dets, safe_fixed),
+ true = dets:info(Dets, fixed),
+ stop_commander(P3),
+ undefined = dets:info(Dets, safe_fixed),
+ undefined = dets:info(Dets, fixed),
+ P4 = start_commander(),
+ {ok,Dets} = command(P4, {dets, open_file,
[?DETS_TMP1,
[{file, dets_filename(?DETS_TMP1,Config)}]]}),
- ?line {ok,Dets} = dets:open_file(?DETS_TMP1,
+ {ok,Dets} = dets:open_file(?DETS_TMP1,
[{file, dets_filename(?DETS_TMP1,Config)}]),
- ?line false = dets:info(Dets, safe_fixed),
- ?line command(P4, {dets, safe_fixtable, [Dets, true]}),
- ?line dets:safe_fixtable(Dets, true),
- ?line {_,[{_,1},{_,1}]} = dets:info(Dets, safe_fixed),
- ?line dets:safe_fixtable(Dets, true),
- ?line stop_commander(P4),
- ?line S = self(),
- ?line {_,[{S,2}]} = dets:info(Dets, safe_fixed),
- ?line true = dets:info(Dets, fixed),
- ?line dets:close(Dets),
- ?line undefined = dets:info(Dets, fixed),
- ?line undefined = dets:info(Dets, safe_fixed),
+ false = dets:info(Dets, safe_fixed),
+ command(P4, {dets, safe_fixtable, [Dets, true]}),
+ dets:safe_fixtable(Dets, true),
+ {_,[{_,1},{_,1}]} = dets:info(Dets, safe_fixed),
+ dets:safe_fixtable(Dets, true),
+ stop_commander(P4),
+ S = self(),
+ {_,[{S,2}]} = dets:info(Dets, safe_fixed),
+ true = dets:info(Dets, fixed),
+ dets:close(Dets),
+ undefined = dets:info(Dets, fixed),
+ undefined = dets:info(Dets, safe_fixed),
ok.
-
-
-other_process_closes(doc) ->
- ["When another process closes an dets table, different "
- "things should happen depending on if it has opened it before."];
-other_process_closes(suite) ->
- [];
+%% When another process closes an dets table, different things should
+%% happen depending on if it has opened it before.
other_process_closes(Config) when is_list(Config) ->
- ?line {ok,Dets} = dets:open_file(?DETS_TMP1,
+ {ok,Dets} = dets:open_file(?DETS_TMP1,
[{file, dets_filename(tmp1,Config)}]),
- ?line P2 = start_commander(),
- ?line dets:safe_fixtable(Dets,true),
- ?line S = self(),
- ?line {_,[{S,1}]} = dets:info(Dets, safe_fixed),
- ?line command(P2,{dets, safe_fixtable, [Dets, true]}),
- ?line {_,[_,_]} = dets:info(Dets, safe_fixed),
- ?line {error, not_owner} = command(P2,{dets, close, [Dets]}),
- ?line {_,[_,_]} = dets:info(Dets, safe_fixed),
- ?line command(P2,{dets, open_file,[?DETS_TMP1,
+ P2 = start_commander(),
+ dets:safe_fixtable(Dets,true),
+ S = self(),
+ {_,[{S,1}]} = dets:info(Dets, safe_fixed),
+ command(P2,{dets, safe_fixtable, [Dets, true]}),
+ {_,[_,_]} = dets:info(Dets, safe_fixed),
+ {error, not_owner} = command(P2,{dets, close, [Dets]}),
+ {_,[_,_]} = dets:info(Dets, safe_fixed),
+ command(P2,{dets, open_file,[?DETS_TMP1,
[{file,
dets_filename(?DETS_TMP1, Config)}]]}),
- ?line {_,[_,_]} = dets:info(Dets, safe_fixed),
- ?line command(P2,{dets, close, [Dets]}),
- ?line stop_commander(P2),
- ?line {_,[{S,1}]} = dets:info(Dets, safe_fixed),
- ?line true = dets:info(Dets,fixed),
- ?line dets:close(Dets),
- ?line undefined = dets:info(Dets,fixed),
- ?line undefined = dets:info(Dets, safe_fixed),
+ {_,[_,_]} = dets:info(Dets, safe_fixed),
+ command(P2,{dets, close, [Dets]}),
+ stop_commander(P2),
+ {_,[{S,1}]} = dets:info(Dets, safe_fixed),
+ true = dets:info(Dets,fixed),
+ dets:close(Dets),
+ undefined = dets:info(Dets,fixed),
+ undefined = dets:info(Dets, safe_fixed),
ok.
-
-other_process_deletes(doc) ->
- ["Check that fixtable structures are cleaned up if another process "
- "deletes an ets table"];
-other_process_deletes(suite) ->
- [];
+
+%% Check that fixtable structures are cleaned up if another process
+%% deletes an ets table.
other_process_deletes(Config) when is_list(Config) ->
- ?line Ets = ets:new(ets,[public]),
- ?line P = start_commander(),
- ?line ets:safe_fixtable(Ets,true),
- ?line ets:safe_fixtable(Ets,true),
- ?line true = ets:info(Ets, fixed),
- ?line {_,_} = ets:info(Ets, safe_fixed),
- ?line command(P,{ets,delete,[Ets]}),
- ?line stop_commander(P),
- ?line undefined = ets:info(Ets, fixed),
- ?line undefined = ets:info(Ets, safe_fixed),
+ Ets = ets:new(ets,[public]),
+ P = start_commander(),
+ ets:safe_fixtable(Ets,true),
+ ets:safe_fixtable(Ets,true),
+ true = ets:info(Ets, fixed),
+ {_,_} = ets:info(Ets, safe_fixed),
+ command(P,{ets,delete,[Ets]}),
+ stop_commander(P),
+ undefined = ets:info(Ets, fixed),
+ undefined = ets:info(Ets, safe_fixed),
ok.
-multiple_fixes(doc) ->
- ["Check that multiple safe_fixtable keeps the reference counter."];
-multiple_fixes(suite) ->
- [];
+%% Check that multiple safe_fixtable keeps the reference counter.
multiple_fixes(Config) when is_list(Config) ->
- ?line {ok,Dets} = dets:open_file(?DETS_TMP1,
+ {ok,Dets} = dets:open_file(?DETS_TMP1,
[{file, dets_filename(?DETS_TMP1,Config)}]),
- ?line Ets = ets:new(ets,[]),
- ?line multiple_fixes(Dets,dets),
- ?line multiple_fixes(Ets,ets),
- ?line dets:close(Dets),
+ Ets = ets:new(ets,[]),
+ multiple_fixes(Dets,dets),
+ multiple_fixes(Ets,ets),
+ dets:close(Dets),
ok.
multiple_fixes(Tab, Mod) ->
- ?line false = Mod:info(Tab,fixed),
- ?line false = Mod:info(Tab, safe_fixed),
- ?line Mod:safe_fixtable(Tab, true),
- ?line true = Mod:info(Tab,fixed),
- ?line S = self(),
- ?line {_,[{S,1}]} = Mod:info(Tab, safe_fixed),
- ?line Mod:safe_fixtable(Tab, true),
- ?line Mod:safe_fixtable(Tab, true),
- ?line {_,[{S,3}]} = Mod:info(Tab, safe_fixed),
- ?line true = Mod:info(Tab,fixed),
- ?line Mod:safe_fixtable(Tab, false),
- ?line {_,[{S,2}]} = Mod:info(Tab, safe_fixed),
- ?line true = Mod:info(Tab,fixed),
- ?line Mod:safe_fixtable(Tab, false),
- ?line {_,[{S,1}]} = Mod:info(Tab, safe_fixed),
- ?line true = Mod:info(Tab,fixed),
- ?line Mod:safe_fixtable(Tab, false),
- ?line false = Mod:info(Tab, safe_fixed),
- ?line false = Mod:info(Tab,fixed).
-
-multiple_processes(doc) ->
- ["Check that multiple safe_fixtable across processes are reference "
- "counted OK"];
-multiple_processes(suite) ->
- [];
+ false = Mod:info(Tab,fixed),
+ false = Mod:info(Tab, safe_fixed),
+ Mod:safe_fixtable(Tab, true),
+ true = Mod:info(Tab,fixed),
+ S = self(),
+ {_,[{S,1}]} = Mod:info(Tab, safe_fixed),
+ Mod:safe_fixtable(Tab, true),
+ Mod:safe_fixtable(Tab, true),
+ {_,[{S,3}]} = Mod:info(Tab, safe_fixed),
+ true = Mod:info(Tab,fixed),
+ Mod:safe_fixtable(Tab, false),
+ {_,[{S,2}]} = Mod:info(Tab, safe_fixed),
+ true = Mod:info(Tab,fixed),
+ Mod:safe_fixtable(Tab, false),
+ {_,[{S,1}]} = Mod:info(Tab, safe_fixed),
+ true = Mod:info(Tab,fixed),
+ Mod:safe_fixtable(Tab, false),
+ false = Mod:info(Tab, safe_fixed),
+ false = Mod:info(Tab,fixed).
+
+%% Check that multiple safe_fixtable across processes are reference
+%% counted OK.
multiple_processes(Config) when is_list(Config) ->
- ?line {ok,Dets} = dets:open_file(?DETS_TMP1,[{file,
+ {ok,Dets} = dets:open_file(?DETS_TMP1,[{file,
dets_filename(?DETS_TMP1,
Config)}]),
- ?line Ets = ets:new(ets,[public]),
- ?line multiple_processes(Dets,dets),
- ?line multiple_processes(Ets,ets),
+ Ets = ets:new(ets,[public]),
+ multiple_processes(Dets,dets),
+ multiple_processes(Ets,ets),
ok.
multiple_processes(Tab, Mod) ->
- ?line io:format("Mod = ~p\n", [Mod]),
- ?line P1 = start_commander(),
- ?line P2 = start_commander(),
- ?line false = Mod:info(Tab,fixed),
- ?line false = Mod:info(Tab, safe_fixed),
- ?line command(P1, {Mod, safe_fixtable, [Tab,true]}),
- ?line true = Mod:info(Tab,fixed),
- ?line {_,[{P1,1}]} = Mod:info(Tab, safe_fixed),
- ?line command(P2, {Mod, safe_fixtable, [Tab,true]}),
- ?line true = Mod:info(Tab,fixed),
- ?line {_,L} = Mod:info(Tab,safe_fixed),
- ?line true = (lists:sort(L) == lists:sort([{P1,1},{P2,1}])),
- ?line command(P2, {Mod, safe_fixtable, [Tab,true]}),
- ?line {_,L2} = Mod:info(Tab,safe_fixed),
- ?line true = (lists:sort(L2) == lists:sort([{P1,1},{P2,2}])),
- ?line command(P2, {Mod, safe_fixtable, [Tab,false]}),
- ?line true = Mod:info(Tab,fixed),
- ?line {_,L3} = Mod:info(Tab,safe_fixed),
- ?line true = (lists:sort(L3) == lists:sort([{P1,1},{P2,1}])),
- ?line command(P2, {Mod, safe_fixtable, [Tab,false]}),
- ?line true = Mod:info(Tab,fixed),
- ?line {_,[{P1,1}]} = Mod:info(Tab, safe_fixed),
- ?line stop_commander(P1),
- ?line receive after 1000 -> ok end,
- ?line false = Mod:info(Tab,fixed),
- ?line false = Mod:info(Tab, safe_fixed),
- ?line command(P2, {Mod, safe_fixtable, [Tab,true]}),
- ?line true = Mod:info(Tab,fixed),
- ?line {_,[{P2,1}]} = Mod:info(Tab, safe_fixed),
+ io:format("Mod = ~p\n", [Mod]),
+ P1 = start_commander(),
+ P2 = start_commander(),
+ false = Mod:info(Tab,fixed),
+ false = Mod:info(Tab, safe_fixed),
+ command(P1, {Mod, safe_fixtable, [Tab,true]}),
+ true = Mod:info(Tab,fixed),
+ {_,[{P1,1}]} = Mod:info(Tab, safe_fixed),
+ command(P2, {Mod, safe_fixtable, [Tab,true]}),
+ true = Mod:info(Tab,fixed),
+ {_,L} = Mod:info(Tab,safe_fixed),
+ true = (lists:sort(L) == lists:sort([{P1,1},{P2,1}])),
+ command(P2, {Mod, safe_fixtable, [Tab,true]}),
+ {_,L2} = Mod:info(Tab,safe_fixed),
+ true = (lists:sort(L2) == lists:sort([{P1,1},{P2,2}])),
+ command(P2, {Mod, safe_fixtable, [Tab,false]}),
+ true = Mod:info(Tab,fixed),
+ {_,L3} = Mod:info(Tab,safe_fixed),
+ true = (lists:sort(L3) == lists:sort([{P1,1},{P2,1}])),
+ command(P2, {Mod, safe_fixtable, [Tab,false]}),
+ true = Mod:info(Tab,fixed),
+ {_,[{P1,1}]} = Mod:info(Tab, safe_fixed),
+ stop_commander(P1),
+ receive after 1000 -> ok end,
+ false = Mod:info(Tab,fixed),
+ false = Mod:info(Tab, safe_fixed),
+ command(P2, {Mod, safe_fixtable, [Tab,true]}),
+ true = Mod:info(Tab,fixed),
+ {_,[{P2,1}]} = Mod:info(Tab, safe_fixed),
case Mod of
dets ->
- ?line dets:close(Tab);
+ dets:close(Tab);
ets ->
- ?line ets:delete(Tab)
+ ets:delete(Tab)
end,
- ?line stop_commander(P2),
- ?line receive after 1000 -> ok end,
- ?line undefined = Mod:info(Tab, safe_fixed),
+ stop_commander(P2),
+ receive after 1000 -> ok end,
+ undefined = Mod:info(Tab, safe_fixed),
ok.
-
-
+
+
%%% Helpers
dets_filename(Base, Config) when is_atom(Base) ->
dets_filename(atom_to_list(Base) ++ ".dat", Config);
dets_filename(Basename, Config) ->
- PrivDir = ?config(priv_dir,Config),
+ PrivDir = proplists:get_value(priv_dir,Config),
filename:join(PrivDir, Basename).
command_loop() ->
diff --git a/lib/stdlib/test/format_SUITE.erl b/lib/stdlib/test/format_SUITE.erl
index da28e085bb..b481d82ea6 100644
--- a/lib/stdlib/test/format_SUITE.erl
+++ b/lib/stdlib/test/format_SUITE.erl
@@ -27,18 +27,15 @@
-include_lib("common_test/include/ct.hrl").
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[hang_1].
@@ -59,11 +56,8 @@ end_per_group(_GroupName, Config) ->
Config.
-hang_1(doc) ->
- ["Bad args can hang (OTP-2400)"];
-hang_1(suite) ->
- [];
+%% OTP-2400. Bad args can hang.
hang_1(Config) when is_list(Config) ->
- ?line _ = (catch io:format(a, "", [])),
- ?line _ = (catch io:format({}, "", [])),
+ _ = (catch io:format(a, "", [])),
+ _ = (catch io:format({}, "", [])),
ok.
diff --git a/lib/stdlib/test/gen_event_SUITE.erl b/lib/stdlib/test/gen_event_SUITE.erl
index e14f057720..4bad7801ff 100644
--- a/lib/stdlib/test/gen_event_SUITE.erl
+++ b/lib/stdlib/test/gen_event_SUITE.erl
@@ -59,75 +59,72 @@ end_per_group(_GroupName, Config) ->
%% Start an event manager.
%% --------------------------------------
-start(doc) -> [];
-start(suite) -> [];
start(Config) when is_list(Config) ->
OldFl = process_flag(trap_exit, true),
- ?line dummy_via:reset(),
+ dummy_via:reset(),
- ?line {ok, Pid0} = gen_event:start(), %anonymous
- ?line [] = gen_event:which_handlers(Pid0),
- ?line ok = gen_event:stop(Pid0),
+ {ok, Pid0} = gen_event:start(), %anonymous
+ [] = gen_event:which_handlers(Pid0),
+ ok = gen_event:stop(Pid0),
- ?line {ok, Pid1} = gen_event:start_link(), %anonymous
- ?line [] = gen_event:which_handlers(Pid1),
- ?line ok = gen_event:stop(Pid1),
+ {ok, Pid1} = gen_event:start_link(), %anonymous
+ [] = gen_event:which_handlers(Pid1),
+ ok = gen_event:stop(Pid1),
- ?line {ok, Pid2} = gen_event:start({local, my_dummy_name}),
- ?line [] = gen_event:which_handlers(my_dummy_name),
- ?line [] = gen_event:which_handlers(Pid2),
- ?line ok = gen_event:stop(my_dummy_name),
+ {ok, Pid2} = gen_event:start({local, my_dummy_name}),
+ [] = gen_event:which_handlers(my_dummy_name),
+ [] = gen_event:which_handlers(Pid2),
+ ok = gen_event:stop(my_dummy_name),
- ?line {ok, Pid3} = gen_event:start_link({local, my_dummy_name}),
- ?line [] = gen_event:which_handlers(my_dummy_name),
- ?line [] = gen_event:which_handlers(Pid3),
- ?line ok = gen_event:stop(my_dummy_name),
+ {ok, Pid3} = gen_event:start_link({local, my_dummy_name}),
+ [] = gen_event:which_handlers(my_dummy_name),
+ [] = gen_event:which_handlers(Pid3),
+ ok = gen_event:stop(my_dummy_name),
- ?line {ok, Pid4} = gen_event:start_link({global, my_dummy_name}),
- ?line [] = gen_event:which_handlers({global, my_dummy_name}),
- ?line [] = gen_event:which_handlers(Pid4),
- ?line ok = gen_event:stop({global, my_dummy_name}),
+ {ok, Pid4} = gen_event:start_link({global, my_dummy_name}),
+ [] = gen_event:which_handlers({global, my_dummy_name}),
+ [] = gen_event:which_handlers(Pid4),
+ ok = gen_event:stop({global, my_dummy_name}),
- ?line {ok, Pid5} = gen_event:start_link({via, dummy_via, my_dummy_name}),
- ?line [] = gen_event:which_handlers({via, dummy_via, my_dummy_name}),
- ?line [] = gen_event:which_handlers(Pid5),
- ?line ok = gen_event:stop({via, dummy_via, my_dummy_name}),
+ {ok, Pid5} = gen_event:start_link({via, dummy_via, my_dummy_name}),
+ [] = gen_event:which_handlers({via, dummy_via, my_dummy_name}),
+ [] = gen_event:which_handlers(Pid5),
+ ok = gen_event:stop({via, dummy_via, my_dummy_name}),
- ?line {ok, _} = gen_event:start_link({local, my_dummy_name}),
- ?line {error, {already_started, _}} =
+ {ok, _} = gen_event:start_link({local, my_dummy_name}),
+ {error, {already_started, _}} =
gen_event:start_link({local, my_dummy_name}),
- ?line {error, {already_started, _}} =
+ {error, {already_started, _}} =
gen_event:start({local, my_dummy_name}),
- ?line ok = gen_event:stop(my_dummy_name),
+ ok = gen_event:stop(my_dummy_name),
- ?line {ok, Pid6} = gen_event:start_link({global, my_dummy_name}),
- ?line {error, {already_started, _}} =
+ {ok, Pid6} = gen_event:start_link({global, my_dummy_name}),
+ {error, {already_started, _}} =
gen_event:start_link({global, my_dummy_name}),
- ?line {error, {already_started, _}} =
+ {error, {already_started, _}} =
gen_event:start({global, my_dummy_name}),
ok = gen_event:stop({global, my_dummy_name}, shutdown, 10000),
receive
{'EXIT', Pid6, shutdown} -> ok
after 10000 ->
- ?t:fail(exit_gen_event)
+ ct:fail(exit_gen_event)
end,
- ?line {ok, Pid7} = gen_event:start_link({via, dummy_via, my_dummy_name}),
- ?line {error, {already_started, _}} =
+ {ok, Pid7} = gen_event:start_link({via, dummy_via, my_dummy_name}),
+ {error, {already_started, _}} =
gen_event:start_link({via, dummy_via, my_dummy_name}),
- ?line {error, {already_started, _}} =
+ {error, {already_started, _}} =
gen_event:start({via, dummy_via, my_dummy_name}),
exit(Pid7, shutdown),
receive
{'EXIT', Pid7, shutdown} -> ok
after 10000 ->
- ?t:fail(exit_gen_event)
+ ct:fail(exit_gen_event)
end,
- ?t:messages_get(),
process_flag(trap_exit, OldFl),
ok.
@@ -184,7 +181,7 @@ hibernate(Config) when is_list(Config) ->
{ok,Pid2} = gen_event:start({local, my_dummy_handler}),
ok = gen_event:add_handler(my_dummy_handler, dummy_h,
- [self(),hibernate]),
+ [self(),hibernate]),
is_in_erlang_hibernate(Pid2),
sys:suspend(my_dummy_handler),
is_in_erlang_hibernate(Pid2),
@@ -193,7 +190,7 @@ hibernate(Config) when is_list(Config) ->
Pid2 ! wake,
is_not_in_erlang_hibernate(Pid2),
-
+
ok = gen_event:stop(my_dummy_handler),
ok.
@@ -204,7 +201,7 @@ is_in_erlang_hibernate(Pid) ->
is_in_erlang_hibernate_1(0, Pid) ->
io:format("~p\n", [erlang:process_info(Pid, current_function)]),
- ?t:fail(not_in_erlang_hibernate_3);
+ ct:fail(not_in_erlang_hibernate_3);
is_in_erlang_hibernate_1(N, Pid) ->
{current_function,MFA} = erlang:process_info(Pid, current_function),
case MFA of
@@ -221,7 +218,7 @@ is_not_in_erlang_hibernate(Pid) ->
is_not_in_erlang_hibernate_1(0, Pid) ->
io:format("~p\n", [erlang:process_info(Pid, current_function)]),
- ?t:fail(not_in_erlang_hibernate_3);
+ ct:fail(not_in_erlang_hibernate_3);
is_not_in_erlang_hibernate_1(N, Pid) ->
{current_function,MFA} = erlang:process_info(Pid, current_function),
case MFA of
@@ -233,720 +230,694 @@ is_not_in_erlang_hibernate_1(N, Pid) ->
end.
-add_handler(doc) -> [];
-add_handler(suite) -> [];
add_handler(Config) when is_list(Config) ->
- ?line {ok,_} = gen_event:start({local, my_dummy_handler}),
- ?line {error, my_error} =
+ {ok,_} = gen_event:start({local, my_dummy_handler}),
+ {error, my_error} =
gen_event:add_handler(my_dummy_handler, dummy_h, make_error),
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
- ?line [dummy_h] = gen_event:which_handlers(my_dummy_handler),
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
+ [dummy_h] = gen_event:which_handlers(my_dummy_handler),
- ?line {error, my_error} =
+ {error, my_error} =
gen_event:add_handler(my_dummy_handler, {dummy_h, self()}, make_error),
- ?line [dummy_h] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_handler(my_dummy_handler, {dummy_h,self()},
- [self()]),
+ [dummy_h] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, {dummy_h,self()},
+ [self()]),
Self = self(),
- ?line [{dummy_h, Self}, dummy_h] =
+ [{dummy_h, Self}, dummy_h] =
gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:stop(my_dummy_handler),
+ ok = gen_event:stop(my_dummy_handler),
ok.
-add_sup_handler(doc) -> [];
-add_sup_handler(suite) -> [];
add_sup_handler(Config) when is_list(Config) ->
- ?line {ok,Pid} = gen_event:start({local, my_dummy_handler}),
- ?line {error, my_error} =
+ {ok,Pid} = gen_event:start({local, my_dummy_handler}),
+ {error, my_error} =
gen_event:add_sup_handler(my_dummy_handler, dummy_h, make_error),
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
- ?line [dummy_h] = gen_event:which_handlers(my_dummy_handler),
- ?line exit(Pid, sup_died),
- ?t:sleep(1000),
- ?line [] = gen_event:which_handlers(my_dummy_handler),
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
+ [dummy_h] = gen_event:which_handlers(my_dummy_handler),
+ exit(Pid, sup_died),
+ ct:sleep(1000),
+ [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
- ?line [dummy_h] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
+ [dummy_h] = gen_event:which_handlers(my_dummy_handler),
- ?line {error, my_error} =
+ {error, my_error} =
gen_event:add_handler(my_dummy_handler, {dummy_h, self()}, make_error),
- ?line [dummy_h] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, {dummy_h,self()},
- [self()]),
+ [dummy_h] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_sup_handler(my_dummy_handler, {dummy_h,self()},
+ [self()]),
Self = self(),
- ?line [{dummy_h, Self}, dummy_h] =
+ [{dummy_h, Self}, dummy_h] =
gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:stop(my_dummy_handler),
-
- ?line receive
- {gen_event_EXIT, dummy_h, shutdown} ->
- ok
- after 1000 ->
- ?t:fail({no,{gen_event_EXIT, dummy_h, shutdown}})
- end,
-
- ?line receive
- {gen_event_EXIT, {dummy_h,Self}, shutdown} ->
- ok
- after 1000 ->
- ?t:fail({no,{gen_event_EXIT, {dummy_h,Self},
- shutdown}})
- end,
+ ok = gen_event:stop(my_dummy_handler),
+
+ receive
+ {gen_event_EXIT, dummy_h, shutdown} ->
+ ok
+ after 1000 ->
+ ct:fail({no,{gen_event_EXIT, dummy_h, shutdown}})
+ end,
+
+ receive
+ {gen_event_EXIT, {dummy_h,Self}, shutdown} ->
+ ok
+ after 1000 ->
+ ct:fail({no,{gen_event_EXIT, {dummy_h,Self},
+ shutdown}})
+ end,
ok.
-delete_handler(doc) -> [];
-delete_handler(suite) -> [];
delete_handler(Config) when is_list(Config) ->
- ?line {ok,_} = gen_event:start({local, my_dummy_handler}),
- ?line ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
- ?line {error, module_not_found} =
+ {ok,_} = gen_event:start({local, my_dummy_handler}),
+ ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
+ {error, module_not_found} =
gen_event:delete_handler(my_dummy_handler, duuuuuuuuumy, []),
- ?line return_hej =
+ return_hej =
gen_event:delete_handler(my_dummy_handler, dummy_h, return_hej),
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
- ?line ok =
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
+ ok =
gen_event:delete_handler(my_dummy_handler, dummy_h, []),
- ?line [] = gen_event:which_handlers(my_dummy_handler),
+ [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_handler(my_dummy_handler, {dummy_h,1}, [self()]),
- ?line ok = gen_event:add_handler(my_dummy_handler, {dummy_h,2}, [self()]),
- ?line {error, module_not_found} =
+ ok = gen_event:add_handler(my_dummy_handler, {dummy_h,1}, [self()]),
+ ok = gen_event:add_handler(my_dummy_handler, {dummy_h,2}, [self()]),
+ {error, module_not_found} =
gen_event:delete_handler(my_dummy_handler, {duuuuuuuuumy,1}, []),
- ?line return_hej =
+ return_hej =
gen_event:delete_handler(my_dummy_handler, {dummy_h,1}, return_hej),
- ?line return_hej =
+ return_hej =
gen_event:delete_handler(my_dummy_handler, {dummy_h,2}, return_hej),
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_handler(my_dummy_handler, {dummy_h,2}, [self()]),
- ?line ok =
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, {dummy_h,2}, [self()]),
+ ok =
gen_event:delete_handler(my_dummy_handler, {dummy_h,2}, []),
- ?line [] = gen_event:which_handlers(my_dummy_handler),
+ [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:stop(my_dummy_handler),
+ ok = gen_event:stop(my_dummy_handler),
ok.
-swap_handler(doc) -> [];
-swap_handler(suite) -> [];
swap_handler(Config) when is_list(Config) ->
- ?line {ok,_} = gen_event:start({local, my_dummy_handler}),
- ?line ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
- ?line {error, non_existing} =
+ {ok,_} = gen_event:start({local, my_dummy_handler}),
+ ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
+ {error, non_existing} =
gen_event:swap_handler(my_dummy_handler, {faulty_h, swap},
{dummy1_h, []}),
- ?line ok =
+ ok =
gen_event:swap_handler(my_dummy_handler, {dummy_h, swap},
{dummy1_h, swap}),
- ?line [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
+ [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:delete_handler(my_dummy_handler, dummy1_h, []),
+ ok = gen_event:delete_handler(my_dummy_handler, dummy1_h, []),
- ?line ok = gen_event:add_handler(my_dummy_handler, {dummy_h,3}, [self()]),
- ?line {error, non_existing} =
+ ok = gen_event:add_handler(my_dummy_handler, {dummy_h,3}, [self()]),
+ {error, non_existing} =
gen_event:swap_handler(my_dummy_handler, {faulty_h, swap},
{dummy1_h, []}),
- ?line ok =
+ ok =
gen_event:swap_handler(my_dummy_handler, {{dummy_h,3}, swap},
{{dummy1_h,4}, swap}),
- ?line [{dummy1_h,4}] = gen_event:which_handlers(my_dummy_handler),
+ [{dummy1_h,4}] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:delete_handler(my_dummy_handler, {dummy1_h,4}, []),
+ ok = gen_event:delete_handler(my_dummy_handler, {dummy1_h,4}, []),
- ?line ok = gen_event:stop(my_dummy_handler),
+ ok = gen_event:stop(my_dummy_handler),
ok.
-
-swap_sup_handler(doc) -> [];
-swap_sup_handler(suite) -> [];
+
swap_sup_handler(Config) when is_list(Config) ->
- ?line {ok,_} = gen_event:start({local, my_dummy_handler}),
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
- ?line {error, non_existing} =
+ {ok,_} = gen_event:start({local, my_dummy_handler}),
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
+ {error, non_existing} =
gen_event:swap_handler(my_dummy_handler, {faulty_h, swap},
{dummy1_h, []}),
- ?line ok =
+ ok =
gen_event:swap_handler(my_dummy_handler, {dummy_h, swap},
{dummy1_h, swap}),
- ?line [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
-
- ?line ok = gen_event:delete_handler(my_dummy_handler, dummy1_h, []),
- ?line receive
- {gen_event_EXIT, dummy1_h, normal} ->
- ok
- after 1000 ->
- ?t:fail({no,{gen_event_EXIT, dummy1_h, normal}})
- end,
-
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, {dummy_h,3},
- [self()]),
- ?line {error, non_existing} =
+ [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
+
+ ok = gen_event:delete_handler(my_dummy_handler, dummy1_h, []),
+ receive
+ {gen_event_EXIT, dummy1_h, normal} ->
+ ok
+ after 1000 ->
+ ct:fail({no,{gen_event_EXIT, dummy1_h, normal}})
+ end,
+
+ ok = gen_event:add_sup_handler(my_dummy_handler, {dummy_h,3},
+ [self()]),
+ {error, non_existing} =
gen_event:swap_sup_handler(my_dummy_handler, {faulty_h, swap},
{dummy1_h, []}),
- ?line ok =
+ ok =
gen_event:swap_sup_handler(my_dummy_handler, {{dummy_h,3}, swap},
{{dummy1_h,4}, swap}),
- ?line [{dummy1_h,4}] = gen_event:which_handlers(my_dummy_handler),
+ [{dummy1_h,4}] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:delete_handler(my_dummy_handler, {dummy1_h,4}, []),
- ?line receive
- {gen_event_EXIT, {dummy1_h,4}, normal} ->
- ok
- after 1000 ->
- ?t:fail({no,{gen_event_EXIT, {dummy1_h,4}, normal}})
- end,
+ ok = gen_event:delete_handler(my_dummy_handler, {dummy1_h,4}, []),
+ receive
+ {gen_event_EXIT, {dummy1_h,4}, normal} ->
+ ok
+ after 1000 ->
+ ct:fail({no,{gen_event_EXIT, {dummy1_h,4}, normal}})
+ end,
- ?line ok = gen_event:stop(my_dummy_handler),
+ ok = gen_event:stop(my_dummy_handler),
ok.
-
-notify(doc) -> [];
-notify(suite) -> [];
+
notify(Config) when is_list(Config) ->
- ?line {ok,_} = gen_event:start({local, my_dummy_handler}),
- ?line ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
+ {ok,_} = gen_event:start({local, my_dummy_handler}),
+ ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
Event = {event, self()},
- ?line [dummy_h] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:notify(my_dummy_handler, Event),
- ?line receive
- {dummy_h, Event} ->
- ok
- end,
- ?line ok = gen_event:notify(my_dummy_handler, {swap_event,dummy1_h,swap}),
- ?line [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:notify(my_dummy_handler, Event),
- ?line receive
- {dummy1_h, Event} ->
- ok
- end,
- ?line ok = gen_event:notify(my_dummy_handler, delete_event),
- ?line receive
- {dummy1_h, removed} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
-
- ?line ok = gen_event:notify(my_dummy_handler, error_event),
- ?line receive
- {dummy_h, returned_error} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
+ [dummy_h] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:notify(my_dummy_handler, Event),
+ receive
+ {dummy_h, Event} ->
+ ok
+ end,
+ ok = gen_event:notify(my_dummy_handler, {swap_event,dummy1_h,swap}),
+ [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:notify(my_dummy_handler, Event),
+ receive
+ {dummy1_h, Event} ->
+ ok
+ end,
+ ok = gen_event:notify(my_dummy_handler, delete_event),
+ receive
+ {dummy1_h, removed} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
+
+ ok = gen_event:notify(my_dummy_handler, error_event),
+ receive
+ {dummy_h, returned_error} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
%% Handler with id, {Mod,Id}
- ?line ok = gen_event:add_handler(my_dummy_handler, {dummy_h,5}, [self()]),
- ?line [{dummy_h,5}] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:notify(my_dummy_handler, Event),
- ?line receive
- {dummy_h, Event} ->
- ok
- end,
- ?line ok = gen_event:notify(my_dummy_handler,
- {swap_event, {dummy1_h, 9}, swap}),
- ?line [{dummy1_h,9}] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:notify(my_dummy_handler, Event),
- ?line receive
- {dummy1_h, Event} ->
- ok
- end,
- ?line ok = gen_event:notify(my_dummy_handler, delete_event),
- ?line receive
- {dummy1_h, removed} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_handler(my_dummy_handler, {dummy_h,a}, [self()]),
-
- ?line ok = gen_event:notify(my_dummy_handler, error_event),
- ?line receive
- {dummy_h, returned_error} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, {dummy_h,5}, [self()]),
+ [{dummy_h,5}] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:notify(my_dummy_handler, Event),
+ receive
+ {dummy_h, Event} ->
+ ok
+ end,
+ ok = gen_event:notify(my_dummy_handler,
+ {swap_event, {dummy1_h, 9}, swap}),
+ [{dummy1_h,9}] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:notify(my_dummy_handler, Event),
+ receive
+ {dummy1_h, Event} ->
+ ok
+ end,
+ ok = gen_event:notify(my_dummy_handler, delete_event),
+ receive
+ {dummy1_h, removed} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, {dummy_h,a}, [self()]),
+
+ ok = gen_event:notify(my_dummy_handler, error_event),
+ receive
+ {dummy_h, returned_error} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
%% Supervised handler.
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
- ?line [dummy_h] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:notify(my_dummy_handler, Event),
- ?line receive
- {dummy_h, Event} ->
- ok
- end,
-
- ?line ok = gen_event:notify(my_dummy_handler, do_crash),
- ?line receive
- {gen_event_EXIT, dummy_h, {'EXIT',_}} ->
- ok
- end,
-
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
- ?line ok = gen_event:notify(my_dummy_handler, {swap_event,dummy1_h,swap}),
- ?line [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
-
- ?line ok = gen_event:notify(my_dummy_handler, do_crash),
- ?line receive
- {gen_event_EXIT, dummy1_h, {'EXIT',_}} ->
- ok
- end,
-
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
- ?line ok = gen_event:notify(my_dummy_handler, {swap_event,dummy1_h,swap}),
- ?line [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
-
- ?line ok = gen_event:notify(my_dummy_handler, delete_event),
- ?line receive
- {dummy1_h, removed} ->
- ok
- end,
-
- ?line receive
- {gen_event_EXIT, dummy1_h, normal} ->
- ok
- end,
-
- ?line [] = gen_event:which_handlers(my_dummy_handler),
-
- ?line ok = gen_event:stop(my_dummy_handler),
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
+ [dummy_h] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:notify(my_dummy_handler, Event),
+ receive
+ {dummy_h, Event} ->
+ ok
+ end,
+
+ ok = gen_event:notify(my_dummy_handler, do_crash),
+ receive
+ {gen_event_EXIT, dummy_h, {'EXIT',_}} ->
+ ok
+ end,
+
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
+ ok = gen_event:notify(my_dummy_handler, {swap_event,dummy1_h,swap}),
+ [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
+
+ ok = gen_event:notify(my_dummy_handler, do_crash),
+ receive
+ {gen_event_EXIT, dummy1_h, {'EXIT',_}} ->
+ ok
+ end,
+
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
+ ok = gen_event:notify(my_dummy_handler, {swap_event,dummy1_h,swap}),
+ [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
+
+ ok = gen_event:notify(my_dummy_handler, delete_event),
+ receive
+ {dummy1_h, removed} ->
+ ok
+ end,
+
+ receive
+ {gen_event_EXIT, dummy1_h, normal} ->
+ ok
+ end,
+
+ [] = gen_event:which_handlers(my_dummy_handler),
+
+ ok = gen_event:stop(my_dummy_handler),
ok.
-sync_notify(doc) -> [];
-sync_notify(suite) -> [];
sync_notify(Config) when is_list(Config) ->
- ?line {ok,_} = gen_event:start({local, my_dummy_handler}),
- ?line ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
+ {ok,_} = gen_event:start({local, my_dummy_handler}),
+ ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
Event = {event, self()},
- ?line [dummy_h] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:sync_notify(my_dummy_handler, Event),
- ?line receive
- {dummy_h, Event} ->
- ok
- end,
- ?line ok = gen_event:sync_notify(my_dummy_handler,
- {swap_event, dummy1_h, swap}),
- ?line [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:sync_notify(my_dummy_handler, Event),
- ?line receive
- {dummy1_h, Event} ->
- ok
- end,
- ?line ok = gen_event:sync_notify(my_dummy_handler, delete_event),
- ?line receive
- {dummy1_h, removed} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
-
- ?line ok = gen_event:sync_notify(my_dummy_handler, error_event),
- ?line receive
- {dummy_h, returned_error} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
+ [dummy_h] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:sync_notify(my_dummy_handler, Event),
+ receive
+ {dummy_h, Event} ->
+ ok
+ end,
+ ok = gen_event:sync_notify(my_dummy_handler,
+ {swap_event, dummy1_h, swap}),
+ [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:sync_notify(my_dummy_handler, Event),
+ receive
+ {dummy1_h, Event} ->
+ ok
+ end,
+ ok = gen_event:sync_notify(my_dummy_handler, delete_event),
+ receive
+ {dummy1_h, removed} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
+
+ ok = gen_event:sync_notify(my_dummy_handler, error_event),
+ receive
+ {dummy_h, returned_error} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
%% Handler with id, {Mod,Id}
- ?line ok = gen_event:add_handler(my_dummy_handler, {dummy_h,5}, [self()]),
- ?line [{dummy_h,5}] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:sync_notify(my_dummy_handler, Event),
- ?line receive
- {dummy_h, Event} ->
- ok
- end,
- ?line ok = gen_event:sync_notify(my_dummy_handler,
- {swap_event, {dummy1_h, 9}, swap}),
- ?line [{dummy1_h,9}] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:sync_notify(my_dummy_handler, Event),
- ?line receive
- {dummy1_h, Event} ->
- ok
- end,
- ?line ok = gen_event:sync_notify(my_dummy_handler, delete_event),
- ?line receive
- {dummy1_h, removed} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_handler(my_dummy_handler, {dummy_h,a}, [self()]),
-
- ?line ok = gen_event:sync_notify(my_dummy_handler, error_event),
- ?line receive
- {dummy_h, returned_error} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, {dummy_h,5}, [self()]),
+ [{dummy_h,5}] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:sync_notify(my_dummy_handler, Event),
+ receive
+ {dummy_h, Event} ->
+ ok
+ end,
+ ok = gen_event:sync_notify(my_dummy_handler,
+ {swap_event, {dummy1_h, 9}, swap}),
+ [{dummy1_h,9}] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:sync_notify(my_dummy_handler, Event),
+ receive
+ {dummy1_h, Event} ->
+ ok
+ end,
+ ok = gen_event:sync_notify(my_dummy_handler, delete_event),
+ receive
+ {dummy1_h, removed} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, {dummy_h,a}, [self()]),
+
+ ok = gen_event:sync_notify(my_dummy_handler, error_event),
+ receive
+ {dummy_h, returned_error} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
%% Supervised handler.
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
- ?line [dummy_h] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:sync_notify(my_dummy_handler, Event),
- ?line receive
- {dummy_h, Event} ->
- ok
- end,
-
- ?line ok = gen_event:sync_notify(my_dummy_handler, do_crash),
- ?line receive
- {gen_event_EXIT, dummy_h, {'EXIT',_}} ->
- ok
- end,
-
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
- ?line ok = gen_event:sync_notify(my_dummy_handler,
- {swap_event,dummy1_h,swap}),
- ?line [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
-
- ?line ok = gen_event:sync_notify(my_dummy_handler, do_crash),
- ?line receive
- {gen_event_EXIT, dummy1_h, {'EXIT',_}} ->
- ok
- end,
-
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
- ?line ok = gen_event:sync_notify(my_dummy_handler,
- {swap_event,dummy1_h,swap}),
- ?line [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
-
- ?line ok = gen_event:sync_notify(my_dummy_handler, delete_event),
- ?line receive
- {dummy1_h, removed} ->
- ok
- end,
-
- ?line receive
- {gen_event_EXIT, dummy1_h, normal} ->
- ok
- end,
-
- ?line [] = gen_event:which_handlers(my_dummy_handler),
-
- ?line ok = gen_event:stop(my_dummy_handler),
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
+ [dummy_h] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:sync_notify(my_dummy_handler, Event),
+ receive
+ {dummy_h, Event} ->
+ ok
+ end,
+
+ ok = gen_event:sync_notify(my_dummy_handler, do_crash),
+ receive
+ {gen_event_EXIT, dummy_h, {'EXIT',_}} ->
+ ok
+ end,
+
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
+ ok = gen_event:sync_notify(my_dummy_handler,
+ {swap_event,dummy1_h,swap}),
+ [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
+
+ ok = gen_event:sync_notify(my_dummy_handler, do_crash),
+ receive
+ {gen_event_EXIT, dummy1_h, {'EXIT',_}} ->
+ ok
+ end,
+
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
+ ok = gen_event:sync_notify(my_dummy_handler,
+ {swap_event,dummy1_h,swap}),
+ [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
+
+ ok = gen_event:sync_notify(my_dummy_handler, delete_event),
+ receive
+ {dummy1_h, removed} ->
+ ok
+ end,
+
+ receive
+ {gen_event_EXIT, dummy1_h, normal} ->
+ ok
+ end,
+
+ [] = gen_event:which_handlers(my_dummy_handler),
+
+ ok = gen_event:stop(my_dummy_handler),
ok.
-call(doc) -> [];
-call(suite) -> [];
call(Config) when is_list(Config) ->
- ?line {ok,_} = gen_event:start({local, my_dummy_handler}),
- ?line ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
- ?line ok = gen_event:add_handler(my_dummy_handler, {dummy_h, 1}, [self()]),
- ?line [{dummy_h, 1}, dummy_h] = gen_event:which_handlers(my_dummy_handler),
- ?line {'EXIT',_} = (catch gen_event:call(non_exist, dummy_h, hejsan)),
- ?line {error, bad_module} =
+ {ok,_} = gen_event:start({local, my_dummy_handler}),
+ ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
+ ok = gen_event:add_handler(my_dummy_handler, {dummy_h, 1}, [self()]),
+ [{dummy_h, 1}, dummy_h] = gen_event:which_handlers(my_dummy_handler),
+ {'EXIT',_} = (catch gen_event:call(non_exist, dummy_h, hejsan)),
+ {error, bad_module} =
gen_event:call(my_dummy_handler, bad_h, hejsan),
- ?line {ok, hejhopp} = gen_event:call(my_dummy_handler, dummy_h, hejsan),
- ?line {ok, hejhopp} = gen_event:call(my_dummy_handler, {dummy_h, 1},
- hejsan),
- ?line {ok, hejhopp} = gen_event:call(my_dummy_handler, dummy_h, hejsan,
- 10000),
- ?line {'EXIT', {timeout, _}} =
+ {ok, hejhopp} = gen_event:call(my_dummy_handler, dummy_h, hejsan),
+ {ok, hejhopp} = gen_event:call(my_dummy_handler, {dummy_h, 1},
+ hejsan),
+ {ok, hejhopp} = gen_event:call(my_dummy_handler, dummy_h, hejsan,
+ 10000),
+ {'EXIT', {timeout, _}} =
(catch gen_event:call(my_dummy_handler, dummy_h, hejsan, 0)),
flush(),
- ?line ok = gen_event:delete_handler(my_dummy_handler, {dummy_h, 1}, []),
- ?line {ok, swapped} = gen_event:call(my_dummy_handler, dummy_h,
- {swap_call,dummy1_h,swap}),
- ?line [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
- ?line {error, bad_module} =
+ ok = gen_event:delete_handler(my_dummy_handler, {dummy_h, 1}, []),
+ {ok, swapped} = gen_event:call(my_dummy_handler, dummy_h,
+ {swap_call,dummy1_h,swap}),
+ [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
+ {error, bad_module} =
gen_event:call(my_dummy_handler, dummy_h, hejsan),
- ?line ok = gen_event:call(my_dummy_handler, dummy1_h, delete_call),
- ?line receive
- {dummy1_h, removed} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
-
- ?line {error, {return, faulty}} =
+ ok = gen_event:call(my_dummy_handler, dummy1_h, delete_call),
+ receive
+ {dummy1_h, removed} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
+
+ {error, {return, faulty}} =
gen_event:call(my_dummy_handler, dummy_h, error_call),
- ?line receive
- {dummy_h, returned_error} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
-
- ?line {error, {'EXIT', _}} =
+ receive
+ {dummy_h, returned_error} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
+
+ {error, {'EXIT', _}} =
gen_event:call(my_dummy_handler, dummy_h, exit_call),
- ?line [] = gen_event:which_handlers(my_dummy_handler),
+ [] = gen_event:which_handlers(my_dummy_handler),
%% Handler with id, {Mod,Id}
- ?line ok = gen_event:add_handler(my_dummy_handler, {dummy_h,1}, [self()]),
- ?line [{dummy_h,1}] = gen_event:which_handlers(my_dummy_handler),
- ?line {error, bad_module} =
+ ok = gen_event:add_handler(my_dummy_handler, {dummy_h,1}, [self()]),
+ [{dummy_h,1}] = gen_event:which_handlers(my_dummy_handler),
+ {error, bad_module} =
gen_event:call(my_dummy_handler, bad_h, hejsan),
- ?line {ok, hejhopp} = gen_event:call(my_dummy_handler, {dummy_h,1},
- hejsan),
- ?line {ok, swapped} = gen_event:call(my_dummy_handler, {dummy_h,1},
- {swap_call,{dummy1_h,2},swap}),
- ?line [{dummy1_h,2}] = gen_event:which_handlers(my_dummy_handler),
- ?line {error, bad_module} =
+ {ok, hejhopp} = gen_event:call(my_dummy_handler, {dummy_h,1},
+ hejsan),
+ {ok, swapped} = gen_event:call(my_dummy_handler, {dummy_h,1},
+ {swap_call,{dummy1_h,2},swap}),
+ [{dummy1_h,2}] = gen_event:which_handlers(my_dummy_handler),
+ {error, bad_module} =
gen_event:call(my_dummy_handler, dummy_h, hejsan),
- ?line ok = gen_event:call(my_dummy_handler, {dummy1_h,2}, delete_call),
- ?line receive
- {dummy1_h, removed} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_handler(my_dummy_handler, {dummy_h,3}, [self()]),
-
- ?line {error, {return, faulty}} =
+ ok = gen_event:call(my_dummy_handler, {dummy1_h,2}, delete_call),
+ receive
+ {dummy1_h, removed} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, {dummy_h,3}, [self()]),
+
+ {error, {return, faulty}} =
gen_event:call(my_dummy_handler, {dummy_h,3}, error_call),
- ?line receive
- {dummy_h, returned_error} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_handler(my_dummy_handler, {dummy_h,4}, [self()]),
-
- ?line {error, {'EXIT', _}} =
+ receive
+ {dummy_h, returned_error} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, {dummy_h,4}, [self()]),
+
+ {error, {'EXIT', _}} =
gen_event:call(my_dummy_handler, {dummy_h,4}, exit_call),
- ?line [] = gen_event:which_handlers(my_dummy_handler),
+ [] = gen_event:which_handlers(my_dummy_handler),
%% Supervised handler.
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
- ?line [dummy_h] = gen_event:which_handlers(my_dummy_handler),
- ?line {error, bad_module} =
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
+ [dummy_h] = gen_event:which_handlers(my_dummy_handler),
+ {error, bad_module} =
gen_event:call(my_dummy_handler, bad_h, hejsan),
- ?line {ok, hejhopp} = gen_event:call(my_dummy_handler, dummy_h, hejsan),
- ?line {ok, swapped} = gen_event:call(my_dummy_handler, dummy_h,
- {swap_call,dummy1_h,swap}),
- ?line [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
- ?line {error, bad_module} =
+ {ok, hejhopp} = gen_event:call(my_dummy_handler, dummy_h, hejsan),
+ {ok, swapped} = gen_event:call(my_dummy_handler, dummy_h,
+ {swap_call,dummy1_h,swap}),
+ [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
+ {error, bad_module} =
gen_event:call(my_dummy_handler, dummy_h, hejsan),
- ?line ok = gen_event:call(my_dummy_handler, dummy1_h, delete_call),
- ?line receive
- {dummy1_h, removed} ->
- ok
- end,
+ ok = gen_event:call(my_dummy_handler, dummy1_h, delete_call),
+ receive
+ {dummy1_h, removed} ->
+ ok
+ end,
- ?line receive
- {gen_event_EXIT, dummy1_h, normal} ->
- ok
- end,
+ receive
+ {gen_event_EXIT, dummy1_h, normal} ->
+ ok
+ end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
- ?line {error, {return, faulty}} =
+ {error, {return, faulty}} =
gen_event:call(my_dummy_handler, dummy_h, error_call),
- ?line receive
- {dummy_h, returned_error} ->
- ok
- end,
-
- ?line receive
- {gen_event_EXIT, dummy_h, {return,faulty}} ->
- ok
- after 1000 ->
- ?t:fail({no, {gen_event_EXIT, dummy_h, {return,faulty}}})
- end,
-
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
-
- ?line {error, {'EXIT', _}} =
+ receive
+ {dummy_h, returned_error} ->
+ ok
+ end,
+
+ receive
+ {gen_event_EXIT, dummy_h, {return,faulty}} ->
+ ok
+ after 1000 ->
+ ct:fail({no, {gen_event_EXIT, dummy_h, {return,faulty}}})
+ end,
+
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
+
+ {error, {'EXIT', _}} =
gen_event:call(my_dummy_handler, dummy_h, exit_call),
- ?line receive
- {gen_event_EXIT, dummy_h, {'EXIT',_}} ->
- ok
- after 1000 ->
- ?t:fail({no, {gen_event_EXIT, dummy_h, {'EXIT','_'}}})
- end,
+ receive
+ {gen_event_EXIT, dummy_h, {'EXIT',_}} ->
+ ok
+ after 1000 ->
+ ct:fail({no, {gen_event_EXIT, dummy_h, {'EXIT','_'}}})
+ end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
+ [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:stop(my_dummy_handler),
+ ok = gen_event:stop(my_dummy_handler),
ok.
flush() ->
receive _ -> flush() after 0 -> ok end.
-info(doc) -> [];
-info(suite) -> [];
info(Config) when is_list(Config) ->
- ?line {ok,_} = gen_event:start({local, my_dummy_handler}),
- ?line ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
+ {ok,_} = gen_event:start({local, my_dummy_handler}),
+ ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
Info = {info, self()},
- ?line [dummy_h] = gen_event:which_handlers(my_dummy_handler),
- ?line my_dummy_handler ! Info,
- ?line receive
- {dummy_h, Info} ->
- ok
- end,
- ?line my_dummy_handler ! {swap_info,dummy1_h,swap},
- ?line [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
- ?line my_dummy_handler ! Info,
- ?line receive
- {dummy1_h, Info} ->
- ok
- end,
- ?line my_dummy_handler ! delete_info,
- ?line receive
- {dummy1_h, removed} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
-
- ?line my_dummy_handler ! error_info,
- ?line receive
- {dummy_h, returned_error} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
+ [dummy_h] = gen_event:which_handlers(my_dummy_handler),
+ my_dummy_handler ! Info,
+ receive
+ {dummy_h, Info} ->
+ ok
+ end,
+ my_dummy_handler ! {swap_info,dummy1_h,swap},
+ [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
+ my_dummy_handler ! Info,
+ receive
+ {dummy1_h, Info} ->
+ ok
+ end,
+ my_dummy_handler ! delete_info,
+ receive
+ {dummy1_h, removed} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, dummy_h, [self()]),
+
+ my_dummy_handler ! error_info,
+ receive
+ {dummy_h, returned_error} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
%% Handler with id, {Mod,Id}
- ?line ok = gen_event:add_handler(my_dummy_handler, {dummy_h,1}, [self()]),
- ?line [{dummy_h,1}] = gen_event:which_handlers(my_dummy_handler),
- ?line my_dummy_handler ! Info,
- ?line receive
- {dummy_h, Info} ->
- ok
- end,
- ?line my_dummy_handler ! {swap_info,{dummy1_h,2},swap},
- ?line [{dummy1_h,2}] = gen_event:which_handlers(my_dummy_handler),
- ?line my_dummy_handler ! Info,
- ?line receive
- {dummy1_h, Info} ->
- ok
- end,
- ?line my_dummy_handler ! delete_info,
- ?line receive
- {dummy1_h, removed} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
- ?line ok = gen_event:add_handler(my_dummy_handler, {dummy_h,3}, [self()]),
-
- ?line my_dummy_handler ! error_info,
- ?line receive
- {dummy_h, returned_error} ->
- ok
- end,
- ?line [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, {dummy_h,1}, [self()]),
+ [{dummy_h,1}] = gen_event:which_handlers(my_dummy_handler),
+ my_dummy_handler ! Info,
+ receive
+ {dummy_h, Info} ->
+ ok
+ end,
+ my_dummy_handler ! {swap_info,{dummy1_h,2},swap},
+ [{dummy1_h,2}] = gen_event:which_handlers(my_dummy_handler),
+ my_dummy_handler ! Info,
+ receive
+ {dummy1_h, Info} ->
+ ok
+ end,
+ my_dummy_handler ! delete_info,
+ receive
+ {dummy1_h, removed} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
+ ok = gen_event:add_handler(my_dummy_handler, {dummy_h,3}, [self()]),
+
+ my_dummy_handler ! error_info,
+ receive
+ {dummy_h, returned_error} ->
+ ok
+ end,
+ [] = gen_event:which_handlers(my_dummy_handler),
%% Supervised handler
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
- ?line [dummy_h] = gen_event:which_handlers(my_dummy_handler),
- ?line my_dummy_handler ! Info,
- ?line receive
- {dummy_h, Info} ->
- ok
- end,
- ?line my_dummy_handler ! {swap_info,dummy1_h,swap},
- ?line [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
- ?line my_dummy_handler ! Info,
- ?line receive
- {dummy1_h, Info} ->
- ok
- end,
- ?line my_dummy_handler ! delete_info,
- ?line receive
- {dummy1_h, removed} ->
- ok
- end,
-
- ?line receive
- {gen_event_EXIT, dummy1_h, normal} ->
- ok
- after 1000 ->
- ?t:fail({no, {gen_event_EXIT, dummy1_h, normal}})
- end,
-
- ?line [] = gen_event:which_handlers(my_dummy_handler),
-
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
-
- ?line my_dummy_handler ! error_info,
- ?line receive
- {dummy_h, returned_error} ->
- ok
- end,
-
- ?line receive
- {gen_event_EXIT, dummy_h, {return,faulty}} ->
- ok
- after 1000 ->
- ?t:fail({no, {gen_event_EXIT, dummy_h, {return,faulty}}})
- end,
-
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
- ?line my_dummy_handler ! do_crash,
-
- ?line receive
- {gen_event_EXIT, dummy_h, {'EXIT',_}} ->
- ok
- after 1000 ->
- ?t:fail({no, {gen_event_EXIT, dummy_h, {'EXIT','_'}}})
- end,
-
- ?line [] = gen_event:which_handlers(my_dummy_handler),
-
- ?line ok = gen_event:stop(my_dummy_handler),
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
+ [dummy_h] = gen_event:which_handlers(my_dummy_handler),
+ my_dummy_handler ! Info,
+ receive
+ {dummy_h, Info} ->
+ ok
+ end,
+ my_dummy_handler ! {swap_info,dummy1_h,swap},
+ [dummy1_h] = gen_event:which_handlers(my_dummy_handler),
+ my_dummy_handler ! Info,
+ receive
+ {dummy1_h, Info} ->
+ ok
+ end,
+ my_dummy_handler ! delete_info,
+ receive
+ {dummy1_h, removed} ->
+ ok
+ end,
+
+ receive
+ {gen_event_EXIT, dummy1_h, normal} ->
+ ok
+ after 1000 ->
+ ct:fail({no, {gen_event_EXIT, dummy1_h, normal}})
+ end,
+
+ [] = gen_event:which_handlers(my_dummy_handler),
+
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
+
+ my_dummy_handler ! error_info,
+ receive
+ {dummy_h, returned_error} ->
+ ok
+ end,
+
+ receive
+ {gen_event_EXIT, dummy_h, {return,faulty}} ->
+ ok
+ after 1000 ->
+ ct:fail({no, {gen_event_EXIT, dummy_h, {return,faulty}}})
+ end,
+
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy_h, [self()]),
+ my_dummy_handler ! do_crash,
+
+ receive
+ {gen_event_EXIT, dummy_h, {'EXIT',_}} ->
+ ok
+ after 1000 ->
+ ct:fail({no, {gen_event_EXIT, dummy_h, {'EXIT','_'}}})
+ end,
+
+ [] = gen_event:which_handlers(my_dummy_handler),
+
+ ok = gen_event:stop(my_dummy_handler),
ok.
-call_format_status(suite) ->
- [];
-call_format_status(doc) ->
- ["Test that sys:get_status/1,2 calls format_status/2"];
+%% Test that sys:get_status/1,2 calls format_status/2.
call_format_status(Config) when is_list(Config) ->
- ?line {ok, Pid} = gen_event:start({local, my_dummy_handler}),
+ {ok, Pid} = gen_event:start({local, my_dummy_handler}),
%% State here intentionally differs from what we expect from format_status
State = self(),
FmtState = "dummy1_h handler state",
- ?line ok = gen_event:add_handler(my_dummy_handler, dummy1_h, [State]),
- ?line Status1 = sys:get_status(Pid),
- ?line Status2 = sys:get_status(Pid, 5000),
- ?line ok = gen_event:stop(Pid),
- ?line {status, Pid, _, [_, _, Pid, [], Data1]} = Status1,
- ?line HandlerInfo1 = proplists:get_value(items, Data1),
- ?line {"Installed handlers", [{_,dummy1_h,_,FmtState,_}]} = HandlerInfo1,
- ?line {status, Pid, _, [_, _, Pid, [], Data2]} = Status2,
- ?line HandlerInfo2 = proplists:get_value(items, Data2),
- ?line {"Installed handlers", [{_,dummy1_h,_,FmtState,_}]} = HandlerInfo2,
+ ok = gen_event:add_handler(my_dummy_handler, dummy1_h, [State]),
+ Status1 = sys:get_status(Pid),
+ Status2 = sys:get_status(Pid, 5000),
+ ok = gen_event:stop(Pid),
+ {status, Pid, _, [_, _, Pid, [], Data1]} = Status1,
+ HandlerInfo1 = proplists:get_value(items, Data1),
+ {"Installed handlers", [{_,dummy1_h,_,FmtState,_}]} = HandlerInfo1,
+ {status, Pid, _, [_, _, Pid, [], Data2]} = Status2,
+ HandlerInfo2 = proplists:get_value(items, Data2),
+ {"Installed handlers", [{_,dummy1_h,_,FmtState,_}]} = HandlerInfo2,
ok.
-call_format_status_anon(suite) ->
- [];
-call_format_status_anon(doc) ->
- ["Test that sys:get_status/1,2 calls format_status/2 for anonymous gen_event processes"];
+%% Test that sys:get_status/1,2 calls format_status/2 for anonymous
+%% gen_event processes.
call_format_status_anon(Config) when is_list(Config) ->
- ?line {ok, Pid} = gen_event:start(),
+ {ok, Pid} = gen_event:start(),
%% The 'Name' of the gen_event process will be a pid() here, so
%% the next line will crash if format_status can't string-ify pids.
- ?line Status1 = sys:get_status(Pid),
- ?line ok = gen_event:stop(Pid),
+ Status1 = sys:get_status(Pid),
+ ok = gen_event:stop(Pid),
Header = "Status for event handler " ++ pid_to_list(Pid),
- ?line {status, Pid, _, [_, _, Pid, [], Data1]} = Status1,
- ?line Header = proplists:get_value(header, Data1),
+ {status, Pid, _, [_, _, Pid, [], Data1]} = Status1,
+ Header = proplists:get_value(header, Data1),
ok.
-error_format_status(suite) ->
- [];
-error_format_status(doc) ->
- ["Test that a handler error calls format_status/2"];
+%% Test that a handler error calls format_status/2.
error_format_status(Config) when is_list(Config) ->
- ?line error_logger_forwarder:register(),
+ error_logger_forwarder:register(),
OldFl = process_flag(trap_exit, true),
State = self(),
- ?line {ok, Pid} = gen_event:start({local, my_dummy_handler}),
- ?line ok = gen_event:add_sup_handler(my_dummy_handler, dummy1_h, [State]),
- ?line ok = gen_event:notify(my_dummy_handler, do_crash),
- ?line receive
- {gen_event_EXIT,dummy1_h,{'EXIT',_}} -> ok
- after 5000 ->
- ?t:fail(exit_gen_event)
- end,
+ {ok, Pid} = gen_event:start({local, my_dummy_handler}),
+ ok = gen_event:add_sup_handler(my_dummy_handler, dummy1_h, [State]),
+ ok = gen_event:notify(my_dummy_handler, do_crash),
+ receive
+ {gen_event_EXIT,dummy1_h,{'EXIT',_}} -> ok
+ after 5000 ->
+ ct:fail(exit_gen_event)
+ end,
FmtState = "dummy1_h handler state",
receive
{error,_GroupLeader, {Pid,
@@ -955,18 +926,14 @@ error_format_status(Config) when is_list(Config) ->
FmtState, _]}} ->
ok;
Other ->
- ?line io:format("Unexpected: ~p", [Other]),
- ?line ?t:fail()
+ io:format("Unexpected: ~p", [Other]),
+ ct:fail(failed)
end,
- ?t:messages_get(),
- ?line ok = gen_event:stop(Pid),
+ ok = gen_event:stop(Pid),
process_flag(trap_exit, OldFl),
ok.
-get_state(suite) ->
- [];
-get_state(doc) ->
- ["Test that sys:get_state/1,2 return the gen_event state"];
+%% Test that sys:get_state/1,2 return the gen_event state.
get_state(Config) when is_list(Config) ->
{ok, Pid} = gen_event:start({local, my_dummy_handler}),
State1 = self(),
@@ -986,10 +953,7 @@ get_state(Config) when is_list(Config) ->
ok = gen_event:stop(Pid),
ok.
-replace_state(suite) ->
- [];
-replace_state(doc) ->
- ["Test that replace_state/2,3 replace the gen_event state"];
+%% Test that replace_state/2,3 replace the gen_event state.
replace_state(Config) when is_list(Config) ->
{ok, Pid} = gen_event:start({local, my_dummy_handler}),
State1 = self(),
diff --git a/lib/stdlib/test/gen_fsm_SUITE.erl b/lib/stdlib/test/gen_fsm_SUITE.erl
index c238232ef0..f79a344c4e 100644
--- a/lib/stdlib/test/gen_fsm_SUITE.erl
+++ b/lib/stdlib/test/gen_fsm_SUITE.erl
@@ -44,10 +44,9 @@
-export([enter_loop/1]).
%% Exports for apply
--export([do_msg/1, do_sync_msg/1]).
-export([enter_loop/2]).
-% The gen_fsm behaviour
+%% The gen_fsm behaviour
-export([init/1, handle_event/3, handle_sync_event/4, terminate/3,
handle_info/3, format_status/2]).
-export([idle/2, idle/3,
@@ -55,7 +54,7 @@
wfor_conf/2, wfor_conf/3,
connected/2, connected/3]).
-export([state0/3]).
-
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -93,97 +92,95 @@ end_per_group(_GroupName, Config) ->
start1(Config) when is_list(Config) ->
%%OldFl = process_flag(trap_exit, true),
- ?line {ok, Pid0} = gen_fsm:start_link(gen_fsm_SUITE, [], []),
- ?line ok = do_func_test(Pid0),
- ?line ok = do_sync_func_test(Pid0),
+ {ok, Pid0} = gen_fsm:start_link(gen_fsm_SUITE, [], []),
+ ok = do_func_test(Pid0),
+ ok = do_sync_func_test(Pid0),
stop_it(Pid0),
-%% ?line stopped = gen_fsm:sync_send_all_state_event(Pid0, stop),
-%% ?line {'EXIT', {timeout,_}} =
-%% (catch gen_fsm:sync_send_event(Pid0, hej)),
+ %% stopped = gen_fsm:sync_send_all_state_event(Pid0, stop),
+ %% {'EXIT', {timeout,_}} =
+ %% (catch gen_fsm:sync_send_event(Pid0, hej)),
- ?line test_server:messages_get(),
+ [] = get_messages(),
%%process_flag(trap_exit, OldFl),
- ok.
+ ok.
%% anonymous w. shutdown
start2(Config) when is_list(Config) ->
%% Dont link when shutdown
- ?line {ok, Pid0} = gen_fsm:start(gen_fsm_SUITE, [], []),
- ?line ok = do_func_test(Pid0),
- ?line ok = do_sync_func_test(Pid0),
- ?line shutdown_stopped =
+ {ok, Pid0} = gen_fsm:start(gen_fsm_SUITE, [], []),
+ ok = do_func_test(Pid0),
+ ok = do_sync_func_test(Pid0),
+ shutdown_stopped =
gen_fsm:sync_send_all_state_event(Pid0, stop_shutdown),
- ?line {'EXIT', {noproc,_}} =
+ {'EXIT', {noproc,_}} =
(catch gen_fsm:sync_send_event(Pid0, hej)),
- ?line test_server:messages_get(),
+ [] = get_messages(),
ok.
%% anonymous with timeout
start3(Config) when is_list(Config) ->
%%OldFl = process_flag(trap_exit, true),
- ?line {ok, Pid0} = gen_fsm:start(gen_fsm_SUITE, [], [{timeout,5}]),
- ?line ok = do_func_test(Pid0),
- ?line ok = do_sync_func_test(Pid0),
- ?line stop_it(Pid0),
-
- ?line {error, timeout} = gen_fsm:start(gen_fsm_SUITE, sleep,
- [{timeout,5}]),
+ {ok, Pid0} = gen_fsm:start(gen_fsm_SUITE, [], [{timeout,5}]),
+ ok = do_func_test(Pid0),
+ ok = do_sync_func_test(Pid0),
+ stop_it(Pid0),
- test_server:messages_get(),
+ {error, timeout} = gen_fsm:start(gen_fsm_SUITE, sleep,
+ [{timeout,5}]),
+
+ [] = get_messages(),
%%process_flag(trap_exit, OldFl),
ok.
%% anonymous with ignore
-start4(suite) -> [];
start4(Config) when is_list(Config) ->
OldFl = process_flag(trap_exit, true),
- ?line ignore = gen_fsm:start(gen_fsm_SUITE, ignore, []),
+ ignore = gen_fsm:start(gen_fsm_SUITE, ignore, []),
- test_server:messages_get(),
+ [] = get_messages(),
process_flag(trap_exit, OldFl),
ok.
%% anonymous with stop
-start5(suite) -> [];
start5(Config) when is_list(Config) ->
OldFl = process_flag(trap_exit, true),
- ?line {error, stopped} = gen_fsm:start(gen_fsm_SUITE, stop, []),
+ {error, stopped} = gen_fsm:start(gen_fsm_SUITE, stop, []),
- test_server:messages_get(),
+ [] = get_messages(),
process_flag(trap_exit, OldFl),
ok.
%% anonymous linked
start6(Config) when is_list(Config) ->
- ?line {ok, Pid} = gen_fsm:start_link(gen_fsm_SUITE, [], []),
- ?line ok = do_func_test(Pid),
- ?line ok = do_sync_func_test(Pid),
- ?line stop_it(Pid),
+ {ok, Pid} = gen_fsm:start_link(gen_fsm_SUITE, [], []),
+ ok = do_func_test(Pid),
+ ok = do_sync_func_test(Pid),
+ stop_it(Pid),
- test_server:messages_get(),
+ [] = get_messages(),
ok.
%% global register linked
start7(Config) when is_list(Config) ->
- ?line {ok, Pid} =
+ {ok, Pid} =
gen_fsm:start_link({global, my_fsm}, gen_fsm_SUITE, [], []),
- ?line {error, {already_started, Pid}} =
+ {error, {already_started, Pid}} =
gen_fsm:start_link({global, my_fsm}, gen_fsm_SUITE, [], []),
- ?line {error, {already_started, Pid}} =
+ {error, {already_started, Pid}} =
gen_fsm:start({global, my_fsm}, gen_fsm_SUITE, [], []),
-
- ?line ok = do_func_test(Pid),
- ?line ok = do_sync_func_test(Pid),
- ?line ok = do_func_test({global, my_fsm}),
- ?line ok = do_sync_func_test({global, my_fsm}),
- ?line stop_it({global, my_fsm}),
-
- test_server:messages_get(),
+
+ ok = do_func_test(Pid),
+ ok = do_sync_func_test(Pid),
+ ok = do_func_test({global, my_fsm}),
+ ok = do_sync_func_test({global, my_fsm}),
+ stop_it({global, my_fsm}),
+
+ [] = get_messages(),
ok.
@@ -191,18 +188,18 @@ start7(Config) when is_list(Config) ->
start8(Config) when is_list(Config) ->
%%OldFl = process_flag(trap_exit, true),
- ?line {ok, Pid} =
+ {ok, Pid} =
gen_fsm:start({local, my_fsm}, gen_fsm_SUITE, [], []),
- ?line {error, {already_started, Pid}} =
+ {error, {already_started, Pid}} =
gen_fsm:start({local, my_fsm}, gen_fsm_SUITE, [], []),
- ?line ok = do_func_test(Pid),
- ?line ok = do_sync_func_test(Pid),
- ?line ok = do_func_test(my_fsm),
- ?line ok = do_sync_func_test(my_fsm),
- ?line stop_it(Pid),
-
- test_server:messages_get(),
+ ok = do_func_test(Pid),
+ ok = do_sync_func_test(Pid),
+ ok = do_func_test(my_fsm),
+ ok = do_sync_func_test(my_fsm),
+ stop_it(Pid),
+
+ [] = get_messages(),
%%process_flag(trap_exit, OldFl),
ok.
@@ -210,80 +207,80 @@ start8(Config) when is_list(Config) ->
start9(Config) when is_list(Config) ->
%%OldFl = process_flag(trap_exit, true),
- ?line {ok, Pid} =
+ {ok, Pid} =
gen_fsm:start_link({local, my_fsm}, gen_fsm_SUITE, [], []),
- ?line {error, {already_started, Pid}} =
+ {error, {already_started, Pid}} =
gen_fsm:start({local, my_fsm}, gen_fsm_SUITE, [], []),
- ?line ok = do_func_test(Pid),
- ?line ok = do_sync_func_test(Pid),
- ?line ok = do_func_test(my_fsm),
- ?line ok = do_sync_func_test(my_fsm),
- ?line stop_it(Pid),
-
- test_server:messages_get(),
+ ok = do_func_test(Pid),
+ ok = do_sync_func_test(Pid),
+ ok = do_func_test(my_fsm),
+ ok = do_sync_func_test(my_fsm),
+ stop_it(Pid),
+
+ [] = get_messages(),
%%process_flag(trap_exit, OldFl),
ok.
%% global register
start10(Config) when is_list(Config) ->
- ?line {ok, Pid} =
+ {ok, Pid} =
gen_fsm:start({global, my_fsm}, gen_fsm_SUITE, [], []),
- ?line {error, {already_started, Pid}} =
+ {error, {already_started, Pid}} =
gen_fsm:start({global, my_fsm}, gen_fsm_SUITE, [], []),
- ?line {error, {already_started, Pid}} =
+ {error, {already_started, Pid}} =
gen_fsm:start_link({global, my_fsm}, gen_fsm_SUITE, [], []),
-
- ?line ok = do_func_test(Pid),
- ?line ok = do_sync_func_test(Pid),
- ?line ok = do_func_test({global, my_fsm}),
- ?line ok = do_sync_func_test({global, my_fsm}),
- ?line stop_it({global, my_fsm}),
-
- test_server:messages_get(),
+
+ ok = do_func_test(Pid),
+ ok = do_sync_func_test(Pid),
+ ok = do_func_test({global, my_fsm}),
+ ok = do_sync_func_test({global, my_fsm}),
+ stop_it({global, my_fsm}),
+
+ [] = get_messages(),
ok.
%% Stop registered processes
start11(Config) when is_list(Config) ->
- ?line {ok, Pid} =
+ {ok, Pid} =
gen_fsm:start_link({local, my_fsm}, gen_fsm_SUITE, [], []),
- ?line stop_it(Pid),
+ stop_it(Pid),
- ?line {ok, _Pid1} =
+ {ok, _Pid1} =
gen_fsm:start_link({local, my_fsm}, gen_fsm_SUITE, [], []),
- ?line stop_it(my_fsm),
-
- ?line {ok, Pid2} =
+ stop_it(my_fsm),
+
+ {ok, Pid2} =
gen_fsm:start({global, my_fsm}, gen_fsm_SUITE, [], []),
- ?line stop_it(Pid2),
+ stop_it(Pid2),
receive after 1 -> true end,
- ?line Result =
+ Result =
gen_fsm:start({global, my_fsm}, gen_fsm_SUITE, [], []),
io:format("Result = ~p~n",[Result]),
- ?line {ok, _Pid3} = Result,
- ?line stop_it({global, my_fsm}),
+ {ok, _Pid3} = Result,
+ stop_it({global, my_fsm}),
- test_server:messages_get(),
+ [] = get_messages(),
ok.
%% Via register linked
start12(Config) when is_list(Config) ->
- ?line dummy_via:reset(),
- ?line {ok, Pid} =
+ dummy_via:reset(),
+ {ok, Pid} =
gen_fsm:start_link({via, dummy_via, my_fsm}, gen_fsm_SUITE, [], []),
- ?line {error, {already_started, Pid}} =
+ {error, {already_started, Pid}} =
gen_fsm:start_link({via, dummy_via, my_fsm}, gen_fsm_SUITE, [], []),
- ?line {error, {already_started, Pid}} =
+ {error, {already_started, Pid}} =
gen_fsm:start({via, dummy_via, my_fsm}, gen_fsm_SUITE, [], []),
- ?line ok = do_func_test(Pid),
- ?line ok = do_sync_func_test(Pid),
- ?line ok = do_func_test({via, dummy_via, my_fsm}),
- ?line ok = do_sync_func_test({via, dummy_via, my_fsm}),
- ?line stop_it({via, dummy_via, my_fsm}),
+ ok = do_func_test(Pid),
+ ok = do_sync_func_test(Pid),
+ ok = do_func_test({via, dummy_via, my_fsm}),
+ ok = do_sync_func_test({via, dummy_via, my_fsm}),
+ stop_it({via, dummy_via, my_fsm}),
- test_server:messages_get(),
+ [] = get_messages(),
ok.
@@ -339,7 +336,7 @@ stop6(_Config) ->
stop7(_Config) ->
dummy_via:reset(),
{ok, Pid} = gen_fsm:start({via, dummy_via, to_stop},
- ?MODULE, [], []),
+ ?MODULE, [], []),
ok = gen_fsm:stop({via, dummy_via, to_stop}),
false = erlang:is_process_alive(Pid),
{'EXIT',noproc} = (catch gen_fsm:stop({via, dummy_via, to_stop})),
@@ -387,53 +384,51 @@ stop10(_Config) ->
ok.
%% Check that time outs in calls work
-abnormal1(suite) -> [];
abnormal1(Config) when is_list(Config) ->
{ok, _Pid} = gen_fsm:start({local, my_fsm}, gen_fsm_SUITE, [], []),
%% timeout call.
delayed = gen_fsm:sync_send_event(my_fsm, {delayed_answer,1}, 100),
{'EXIT',{timeout,_}} =
- (catch gen_fsm:sync_send_event(my_fsm, {delayed_answer,10}, 1)),
- test_server:messages_get(),
+ (catch gen_fsm:sync_send_event(my_fsm, {delayed_answer,10}, 1)),
+ [] = get_messages(),
ok.
%% Check that bad return values makes the fsm crash. Note that we must
%% trap exit since we must link to get the real bad_return_ error
-abnormal2(suite) -> [];
abnormal2(Config) when is_list(Config) ->
OldFl = process_flag(trap_exit, true),
- ?line {ok, Pid} =
+ {ok, Pid} =
gen_fsm:start_link(gen_fsm_SUITE, [], []),
%% bad return value in the gen_fsm loop
- ?line {'EXIT',{{bad_return_value, badreturn},_}} =
+ {'EXIT',{{bad_return_value, badreturn},_}} =
(catch gen_fsm:sync_send_event(Pid, badreturn)),
-
- test_server:messages_get(),
+
+ [{'EXIT',Pid,{bad_return_value,badreturn}}] = get_messages(),
process_flag(trap_exit, OldFl),
ok.
shutdown(Config) when is_list(Config) ->
- ?line error_logger_forwarder:register(),
+ error_logger_forwarder:register(),
process_flag(trap_exit, true),
- ?line {ok,Pid0} = gen_fsm:start_link(gen_fsm_SUITE, [], []),
- ?line ok = do_func_test(Pid0),
- ?line ok = do_sync_func_test(Pid0),
- ?line {shutdown,reason} =
+ {ok,Pid0} = gen_fsm:start_link(gen_fsm_SUITE, [], []),
+ ok = do_func_test(Pid0),
+ ok = do_sync_func_test(Pid0),
+ {shutdown,reason} =
gen_fsm:sync_send_all_state_event(Pid0, stop_shutdown_reason),
receive {'EXIT',Pid0,{shutdown,reason}} -> ok end,
process_flag(trap_exit, false),
- ?line {'EXIT', {noproc,_}} =
+ {'EXIT', {noproc,_}} =
(catch gen_fsm:sync_send_event(Pid0, hej)),
receive
Any ->
- ?line io:format("Unexpected: ~p", [Any]),
- ?line ?t:fail()
+ io:format("Unexpected: ~p", [Any]),
+ ct:fail(failed)
after 500 ->
ok
end,
@@ -443,70 +438,70 @@ shutdown(Config) when is_list(Config) ->
sys1(Config) when is_list(Config) ->
- ?line {ok, Pid} =
+ {ok, Pid} =
gen_fsm:start(gen_fsm_SUITE, [], []),
- ?line {status, Pid, {module,gen_fsm}, _} = sys:get_status(Pid),
- ?line sys:suspend(Pid),
- ?line {'EXIT', {timeout,_}} =
+ {status, Pid, {module,gen_fsm}, _} = sys:get_status(Pid),
+ sys:suspend(Pid),
+ {'EXIT', {timeout,_}} =
(catch gen_fsm:sync_send_event(Pid, hej)),
- ?line sys:resume(Pid),
- ?line stop_it(Pid).
+ sys:resume(Pid),
+ stop_it(Pid).
call_format_status(Config) when is_list(Config) ->
- ?line {ok, Pid} = gen_fsm:start(gen_fsm_SUITE, [], []),
- ?line Status = sys:get_status(Pid),
- ?line {status, Pid, _Mod, [_PDict, running, _, _, Data]} = Status,
- ?line [format_status_called | _] = lists:reverse(Data),
- ?line stop_it(Pid),
+ {ok, Pid} = gen_fsm:start(gen_fsm_SUITE, [], []),
+ Status = sys:get_status(Pid),
+ {status, Pid, _Mod, [_PDict, running, _, _, Data]} = Status,
+ [format_status_called | _] = lists:reverse(Data),
+ stop_it(Pid),
%% check that format_status can handle a name being an atom (pid is
%% already checked by the previous test)
- ?line {ok, Pid2} = gen_fsm:start({local, gfsm}, gen_fsm_SUITE, [], []),
- ?line Status2 = sys:get_status(gfsm),
- ?line {status, Pid2, _Mod, [_PDict2, running, _, _, Data2]} = Status2,
- ?line [format_status_called | _] = lists:reverse(Data2),
- ?line stop_it(Pid2),
+ {ok, Pid2} = gen_fsm:start({local, gfsm}, gen_fsm_SUITE, [], []),
+ Status2 = sys:get_status(gfsm),
+ {status, Pid2, _Mod, [_PDict2, running, _, _, Data2]} = Status2,
+ [format_status_called | _] = lists:reverse(Data2),
+ stop_it(Pid2),
%% check that format_status can handle a name being a term other than a
%% pid or atom
GlobalName1 = {global, "CallFormatStatus"},
- ?line {ok, Pid3} = gen_fsm:start(GlobalName1, gen_fsm_SUITE, [], []),
- ?line Status3 = sys:get_status(GlobalName1),
- ?line {status, Pid3, _Mod, [_PDict3, running, _, _, Data3]} = Status3,
- ?line [format_status_called | _] = lists:reverse(Data3),
- ?line stop_it(Pid3),
+ {ok, Pid3} = gen_fsm:start(GlobalName1, gen_fsm_SUITE, [], []),
+ Status3 = sys:get_status(GlobalName1),
+ {status, Pid3, _Mod, [_PDict3, running, _, _, Data3]} = Status3,
+ [format_status_called | _] = lists:reverse(Data3),
+ stop_it(Pid3),
GlobalName2 = {global, {name, "term"}},
- ?line {ok, Pid4} = gen_fsm:start(GlobalName2, gen_fsm_SUITE, [], []),
- ?line Status4 = sys:get_status(GlobalName2),
- ?line {status, Pid4, _Mod, [_PDict4, running, _, _, Data4]} = Status4,
- ?line [format_status_called | _] = lists:reverse(Data4),
- ?line stop_it(Pid4),
+ {ok, Pid4} = gen_fsm:start(GlobalName2, gen_fsm_SUITE, [], []),
+ Status4 = sys:get_status(GlobalName2),
+ {status, Pid4, _Mod, [_PDict4, running, _, _, Data4]} = Status4,
+ [format_status_called | _] = lists:reverse(Data4),
+ stop_it(Pid4),
%% check that format_status can handle a name being a term other than a
%% pid or atom
- ?line dummy_via:reset(),
+ dummy_via:reset(),
ViaName1 = {via, dummy_via, "CallFormatStatus"},
- ?line {ok, Pid5} = gen_fsm:start(ViaName1, gen_fsm_SUITE, [], []),
- ?line Status5 = sys:get_status(ViaName1),
- ?line {status, Pid5, _Mod, [_PDict5, running, _, _, Data5]} = Status5,
- ?line [format_status_called | _] = lists:reverse(Data5),
- ?line stop_it(Pid5),
+ {ok, Pid5} = gen_fsm:start(ViaName1, gen_fsm_SUITE, [], []),
+ Status5 = sys:get_status(ViaName1),
+ {status, Pid5, _Mod, [_PDict5, running, _, _, Data5]} = Status5,
+ [format_status_called | _] = lists:reverse(Data5),
+ stop_it(Pid5),
ViaName2 = {via, dummy_via, {name, "term"}},
- ?line {ok, Pid6} = gen_fsm:start(ViaName2, gen_fsm_SUITE, [], []),
- ?line Status6 = sys:get_status(ViaName2),
- ?line {status, Pid6, _Mod, [_PDict6, running, _, _, Data6]} = Status6,
- ?line [format_status_called | _] = lists:reverse(Data6),
- ?line stop_it(Pid6).
+ {ok, Pid6} = gen_fsm:start(ViaName2, gen_fsm_SUITE, [], []),
+ Status6 = sys:get_status(ViaName2),
+ {status, Pid6, _Mod, [_PDict6, running, _, _, Data6]} = Status6,
+ [format_status_called | _] = lists:reverse(Data6),
+ stop_it(Pid6).
error_format_status(Config) when is_list(Config) ->
- ?line error_logger_forwarder:register(),
+ error_logger_forwarder:register(),
OldFl = process_flag(trap_exit, true),
StateData = "called format_status",
- ?line {ok, Pid} = gen_fsm:start(gen_fsm_SUITE, {state_data, StateData}, []),
+ {ok, Pid} = gen_fsm:start(gen_fsm_SUITE, {state_data, StateData}, []),
%% bad return value in the gen_fsm loop
- ?line {'EXIT',{{bad_return_value, badreturn},_}} =
+ {'EXIT',{{bad_return_value, badreturn},_}} =
(catch gen_fsm:sync_send_event(Pid, badreturn)),
receive
{error,_GroupLeader,{Pid,
@@ -514,10 +509,9 @@ error_format_status(Config) when is_list(Config) ->
[Pid,{_,_,badreturn},idle,{formatted,StateData},_]}} ->
ok;
Other ->
- ?line io:format("Unexpected: ~p", [Other]),
- ?line ?t:fail()
+ io:format("Unexpected: ~p", [Other]),
+ ct:fail(failed)
end,
- ?t:messages_get(),
process_flag(trap_exit, OldFl),
ok.
@@ -534,12 +528,11 @@ terminate_crash_format(Config) when is_list(Config) ->
ok;
Other ->
io:format("Unexpected: ~p", [Other]),
- ?t:fail()
+ ct:fail(failed)
after 5000 ->
io:format("Timeout: expected error logger msg", []),
- ?t:fail()
+ ct:fail(failed)
end,
- _ = ?t:messages_get(),
process_flag(trap_exit, OldFl),
ok.
@@ -603,7 +596,9 @@ hibernate(Config) when is_list(Config) ->
{ok, Pid0} = gen_fsm:start_link(?MODULE, hiber_now, []),
is_in_erlang_hibernate(Pid0),
stop_it(Pid0),
- test_server:messages_get(),
+ receive
+ {'EXIT',Pid0,normal} -> ok
+ end,
{ok, Pid} = gen_fsm:start_link(?MODULE, hiber, []),
true = ({current_function,{erlang,hibernate,3}} =/=
@@ -677,7 +672,11 @@ hibernate(Config) when is_list(Config) ->
good_morning = gen_fsm:sync_send_all_state_event(Pid, wakeup_sync),
is_not_in_erlang_hibernate(Pid),
stop_it(Pid),
- test_server:messages_get(),
+ receive
+ {'EXIT',Pid,normal} -> ok
+ end,
+
+ [] = get_messages(),
process_flag(trap_exit, OldFl),
ok.
@@ -687,7 +686,7 @@ is_in_erlang_hibernate(Pid) ->
is_in_erlang_hibernate_1(0, Pid) ->
io:format("~p\n", [erlang:process_info(Pid, current_function)]),
- ?t:fail(not_in_erlang_hibernate_3);
+ ct:fail(not_in_erlang_hibernate_3);
is_in_erlang_hibernate_1(N, Pid) ->
{current_function,MFA} = erlang:process_info(Pid, current_function),
case MFA of
@@ -704,7 +703,7 @@ is_not_in_erlang_hibernate(Pid) ->
is_not_in_erlang_hibernate_1(0, Pid) ->
io:format("~p\n", [erlang:process_info(Pid, current_function)]),
- ?t:fail(not_in_erlang_hibernate_3);
+ ct:fail(not_in_erlang_hibernate_3);
is_not_in_erlang_hibernate_1(N, Pid) ->
{current_function,MFA} = erlang:process_info(Pid, current_function),
case MFA of
@@ -715,108 +714,102 @@ is_not_in_erlang_hibernate_1(N, Pid) ->
ok
end.
-%%sys1(suite) -> [];
-%%sys1(_) ->
-
-enter_loop(suite) ->
- [];
-enter_loop(doc) ->
- ["Test gen_fsm:enter_loop/4,5,6"];
+%% Test gen_fsm:enter_loop/4,5,6.
enter_loop(Config) when is_list(Config) ->
OldFlag = process_flag(trap_exit, true),
- ?line dummy_via:reset(),
+ dummy_via:reset(),
%% Locally registered process + {local, Name}
- ?line {ok, Pid1a} =
+ {ok, Pid1a} =
proc_lib:start_link(?MODULE, enter_loop, [local, local]),
- ?line yes = gen_fsm:sync_send_event(Pid1a, 'alive?'),
- ?line stopped = gen_fsm:sync_send_event(Pid1a, stop),
+ yes = gen_fsm:sync_send_event(Pid1a, 'alive?'),
+ stopped = gen_fsm:sync_send_event(Pid1a, stop),
receive
{'EXIT', Pid1a, normal} ->
ok
after 5000 ->
- ?line test_server:fail(gen_fsm_did_not_die)
+ ct:fail(gen_fsm_did_not_die)
end,
%% Unregistered process + {local, Name}
- ?line {ok, Pid1b} =
+ {ok, Pid1b} =
proc_lib:start_link(?MODULE, enter_loop, [anon, local]),
receive
{'EXIT', Pid1b, process_not_registered} ->
ok
after 5000 ->
- ?line test_server:fail(gen_fsm_did_not_die)
+ ct:fail(gen_fsm_did_not_die)
end,
%% Globally registered process + {global, Name}
- ?line {ok, Pid2a} =
+ {ok, Pid2a} =
proc_lib:start_link(?MODULE, enter_loop, [global, global]),
- ?line yes = gen_fsm:sync_send_event(Pid2a, 'alive?'),
- ?line stopped = gen_fsm:sync_send_event(Pid2a, stop),
+ yes = gen_fsm:sync_send_event(Pid2a, 'alive?'),
+ stopped = gen_fsm:sync_send_event(Pid2a, stop),
receive
{'EXIT', Pid2a, normal} ->
ok
after 5000 ->
- ?line test_server:fail(gen_fsm_did_not_die)
+ ct:fail(gen_fsm_did_not_die)
end,
%% Unregistered process + {global, Name}
- ?line {ok, Pid2b} =
+ {ok, Pid2b} =
proc_lib:start_link(?MODULE, enter_loop, [anon, global]),
receive
{'EXIT', Pid2b, process_not_registered_globally} ->
ok
after 5000 ->
- ?line test_server:fail(gen_fsm_did_not_die)
+ ct:fail(gen_fsm_did_not_die)
end,
%% Unregistered process + no name
- ?line {ok, Pid3} =
+ {ok, Pid3} =
proc_lib:start_link(?MODULE, enter_loop, [anon, anon]),
- ?line yes = gen_fsm:sync_send_event(Pid3, 'alive?'),
- ?line stopped = gen_fsm:sync_send_event(Pid3, stop),
+ yes = gen_fsm:sync_send_event(Pid3, 'alive?'),
+ stopped = gen_fsm:sync_send_event(Pid3, stop),
receive
{'EXIT', Pid3, normal} ->
ok
after 5000 ->
- ?line test_server:fail(gen_fsm_did_not_die)
+ ct:fail(gen_fsm_did_not_die)
end,
%% Process not started using proc_lib
- ?line Pid4 =
+ Pid4 =
spawn_link(gen_fsm, enter_loop, [?MODULE, [], state0, []]),
receive
{'EXIT', Pid4, process_was_not_started_by_proc_lib} ->
ok
after 5000 ->
- ?line test_server:fail(gen_fsm_did_not_die)
+ ct:fail(gen_fsm_did_not_die)
end,
%% Make sure I am the parent, ie that ordering a shutdown will
%% result in the process terminating with Reason==shutdown
- ?line {ok, Pid5} =
+ {ok, Pid5} =
proc_lib:start_link(?MODULE, enter_loop, [anon, anon]),
- ?line yes = gen_fsm:sync_send_event(Pid5, 'alive?'),
- ?line exit(Pid5, shutdown),
+ yes = gen_fsm:sync_send_event(Pid5, 'alive?'),
+ exit(Pid5, shutdown),
receive
{'EXIT', Pid5, shutdown} ->
ok
after 5000 ->
- ?line test_server:fail(gen_fsm_did_not_die)
+ ct:fail(gen_fsm_did_not_die)
end,
%% Make sure gen_fsm:enter_loop does not accept {local,Name}
%% when it's another process than the calling one which is
%% registered under that name
register(armitage, self()),
- ?line {ok, Pid6a} =
+ {ok, Pid6a} =
proc_lib:start_link(?MODULE, enter_loop, [anon, local]),
receive
{'EXIT', Pid6a, process_not_registered} ->
ok
after 1000 ->
- ?line test_server:fail(gen_fsm_started)
+ ct:fail(gen_fsm_started)
end,
unregister(armitage),
@@ -824,25 +817,24 @@ enter_loop(Config) when is_list(Config) ->
%% when it's another process than the calling one which is
%% registered under that name
global:register_name(armitage, self()),
- ?line {ok, Pid6b} =
+ {ok, Pid6b} =
proc_lib:start_link(?MODULE, enter_loop, [anon, global]),
receive
{'EXIT', Pid6b, process_not_registered_globally} ->
ok
after 1000 ->
- ?line test_server:fail(gen_fsm_started)
+ ct:fail(gen_fsm_started)
end,
global:unregister_name(armitage),
dummy_via:register_name(armitage, self()),
- ?line {ok, Pid6c} =
+ {ok, Pid6c} =
proc_lib:start_link(?MODULE, enter_loop, [anon, via]),
receive
{'EXIT', Pid6c, {process_not_registered_via, dummy_via}} ->
ok
after 1000 ->
- ?line test_server:fail({gen_fsm_started, process_info(self(),
- messages)})
+ ct:fail({gen_fsm_started, process_info(self(), messages)})
end,
dummy_via:unregister_name(armitage),
@@ -883,8 +875,8 @@ wfor(Msg) ->
stop_it(FSM) ->
- ?line stopped = gen_fsm:sync_send_all_state_event(FSM, stop),
- ?line {'EXIT',_} = (catch gen_fsm:sync_send_event(FSM, hej)),
+ stopped = gen_fsm:sync_send_all_state_event(FSM, stop),
+ {'EXIT',_} = (catch gen_fsm:sync_send_event(FSM, hej)),
ok.
@@ -895,7 +887,7 @@ do_func_test(FSM) ->
ok = do_connect(FSM),
ok = gen_fsm:send_all_state_event(FSM, {'alive?', self()}),
wfor(yes),
- test_server:do_times(3, ?MODULE, do_msg, [FSM]),
+ _ = [do_msg(FSM) || _ <- lists:seq(1, 3)],
ok = gen_fsm:send_all_state_event(FSM, {'alive?', self()}),
wfor(yes),
ok = do_disconnect(FSM),
@@ -933,7 +925,7 @@ do_sync_func_test(FSM) ->
yes = gen_fsm:sync_send_all_state_event(FSM, 'alive?'),
ok = do_sync_connect(FSM),
yes = gen_fsm:sync_send_all_state_event(FSM, 'alive?'),
- test_server:do_times(3, ?MODULE, do_sync_msg, [FSM]),
+ _ = [do_sync_msg(FSM) || _ <- lists:seq(1, 3)],
yes = gen_fsm:sync_send_all_state_event(FSM, 'alive?'),
ok = do_sync_disconnect(FSM),
yes = gen_fsm:sync_send_all_state_event(FSM, 'alive?'),
@@ -964,7 +956,7 @@ do_sync_disconnect(FSM) ->
yes = gen_fsm:sync_send_event(FSM, disconnect),
check_state(FSM, idle).
-
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
@@ -979,7 +971,7 @@ init(stop) ->
init(stop_shutdown) ->
{stop, shutdown};
init(sleep) ->
- test_server:sleep(1000),
+ ct:sleep(1000),
{ok, idle, data};
init({timeout, T}) ->
{ok, idle, state, T};
@@ -1012,7 +1004,7 @@ idle(_, Data) ->
idle({connect, _Pid}, _From, Data) ->
{reply, accept, wfor_conf, Data};
idle({delayed_answer, T}, _From, Data) ->
- test_server:sleep(T),
+ ct:sleep(T),
{reply, delayed, idle, Data};
idle(badreturn, _From, _Data) ->
badreturn;
@@ -1070,8 +1062,8 @@ hiber_idle('alive?', _From, Data) ->
{reply, 'alive!', hiber_idle, Data};
hiber_idle(hibernate_sync, _From, Data) ->
{reply, hibernating, hiber_wakeup, Data,hibernate}.
-hiber_idle(timeout, hibernate_me) -> % Arrive here from
- % handle_info(hibernate_later,...)
+hiber_idle(timeout, hibernate_me) ->
+ %% Arrive here from handle_info(hibernate_later,...)
{next_state, hiber_idle, [], hibernate};
hiber_idle(hibernate_async, Data) ->
{next_state,hiber_wakeup, Data, hibernate}.
@@ -1084,9 +1076,10 @@ hiber_wakeup(wakeup_async,Data) ->
{next_state,hiber_idle,Data};
hiber_wakeup(snooze_async,Data) ->
{next_state,hiber_wakeup,Data,hibernate}.
-
-handle_info(hibernate_now, _SName, _State) -> % Arrive here from by direct ! from testcase
+
+handle_info(hibernate_now, _SName, _State) ->
+ %% Arrive here from by direct ! from testcase
{next_state, hiber_idle, [], hibernate};
handle_info(hibernate_later, _SName, _State) ->
{next_state, hiber_idle, hibernate_me, 1000};
@@ -1134,3 +1127,9 @@ format_status(terminate, [_Pdict, StateData]) ->
{formatted, StateData};
format_status(normal, [_Pdict, _StateData]) ->
[format_status_called].
+
+get_messages() ->
+ receive
+ Msg -> [Msg|get_messages()]
+ after 1 -> []
+ end.
diff --git a/lib/stdlib/test/gen_server_SUITE.erl b/lib/stdlib/test/gen_server_SUITE.erl
index 634d868ad4..916fbc4e84 100644
--- a/lib/stdlib/test/gen_server_SUITE.erl
+++ b/lib/stdlib/test/gen_server_SUITE.erl
@@ -40,7 +40,7 @@
-export([stop1/1, stop2/1, stop3/1, stop4/1, stop5/1, stop6/1, stop7/1,
stop8/1, stop9/1, stop10/1]).
-% spawn export
+%% spawn export
-export([spec_init_local/2, spec_init_global/2, spec_init_via/2,
spec_init_default_timeout/2, spec_init_global_default_timeout/2,
spec_init_anonymous/1,
@@ -48,11 +48,13 @@
spec_init_not_proc_lib/1, cast_fast_messup/0]).
-% The gen_server behaviour
+%% The gen_server behaviour
-export([init/1, handle_call/3, handle_cast/2,
handle_info/2, terminate/2, format_status/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[start, {group,stop}, crash, call, cast, cast_fast, info, abcast,
@@ -83,8 +85,6 @@ end_per_group(_GroupName, Config) ->
Config.
--define(default_timeout, ?t:minutes(1)).
-
init_per_testcase(Case, Config) when Case == call_remote1;
Case == call_remote2;
Case == call_remote3;
@@ -92,11 +92,10 @@ init_per_testcase(Case, Config) when Case == call_remote1;
Case == call_remote_n2;
Case == call_remote_n3 ->
{ok,N} = start_node(hubba),
- ?line Dog = ?t:timetrap(?default_timeout),
- [{node,N},{watchdog, Dog} | Config];
+ [{node,N} | Config];
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
+ Config.
+
end_per_testcase(_Case, Config) ->
case proplists:get_value(node, Config) of
undefined ->
@@ -104,8 +103,6 @@ end_per_testcase(_Case, Config) ->
N ->
test_server:stop_node(N)
end,
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
ok.
@@ -113,131 +110,133 @@ end_per_testcase(_Case, Config) ->
%% Start and stop a gen_server.
%% --------------------------------------
-start(suite) -> [];
start(Config) when is_list(Config) ->
OldFl = process_flag(trap_exit, true),
%% anonymous
- ?line {ok, Pid0} = gen_server:start(gen_server_SUITE, [], []),
- ?line ok = gen_server:call(Pid0, started_p),
- ?line ok = gen_server:call(Pid0, stop),
- ?line busy_wait_for_process(Pid0,600),
- ?line {'EXIT', {noproc,_}} = (catch gen_server:call(Pid0, started_p, 1)),
+ {ok, Pid0} = gen_server:start(gen_server_SUITE, [], []),
+ ok = gen_server:call(Pid0, started_p),
+ ok = gen_server:call(Pid0, stop),
+ busy_wait_for_process(Pid0,600),
+ {'EXIT', {noproc,_}} = (catch gen_server:call(Pid0, started_p, 1)),
%% anonymous with timeout
- ?line {ok, Pid00} = gen_server:start(gen_server_SUITE, [],
- [{timeout,1000}]),
- ?line ok = gen_server:call(Pid00, started_p),
- ?line ok = gen_server:call(Pid00, stop),
- ?line {error, timeout} = gen_server:start(gen_server_SUITE, sleep,
- [{timeout,100}]),
+ {ok, Pid00} = gen_server:start(gen_server_SUITE, [],
+ [{timeout,1000}]),
+ ok = gen_server:call(Pid00, started_p),
+ ok = gen_server:call(Pid00, stop),
+ {error, timeout} = gen_server:start(gen_server_SUITE, sleep,
+ [{timeout,100}]),
%% anonymous with ignore
- ?line ignore = gen_server:start(gen_server_SUITE, ignore, []),
+ ignore = gen_server:start(gen_server_SUITE, ignore, []),
%% anonymous with stop
- ?line {error, stopped} = gen_server:start(gen_server_SUITE, stop, []),
+ {error, stopped} = gen_server:start(gen_server_SUITE, stop, []),
%% anonymous linked
- ?line {ok, Pid1} =
+ {ok, Pid1} =
gen_server:start_link(gen_server_SUITE, [], []),
- ?line ok = gen_server:call(Pid1, started_p),
- ?line ok = gen_server:call(Pid1, stop),
- ?line receive
- {'EXIT', Pid1, stopped} ->
- ok
- after 5000 ->
- test_server:fail(not_stopped)
- end,
+ ok = gen_server:call(Pid1, started_p),
+ ok = gen_server:call(Pid1, stop),
+ receive
+ {'EXIT', Pid1, stopped} ->
+ ok
+ after 5000 ->
+ ct:fail(not_stopped)
+ end,
%% local register
- ?line {ok, Pid2} =
+ {ok, Pid2} =
gen_server:start({local, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call(my_test_name, started_p),
- ?line {error, {already_started, Pid2}} =
+ ok = gen_server:call(my_test_name, started_p),
+ {error, {already_started, Pid2}} =
gen_server:start({local, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call(my_test_name, stop),
+ ok = gen_server:call(my_test_name, stop),
- ?line busy_wait_for_process(Pid2,600),
+ busy_wait_for_process(Pid2,600),
- ?line {'EXIT', {noproc,_}} = (catch gen_server:call(Pid2, started_p, 10)),
+ {'EXIT', {noproc,_}} = (catch gen_server:call(Pid2, started_p, 10)),
%% local register linked
- ?line {ok, Pid3} =
+ {ok, Pid3} =
gen_server:start_link({local, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call(my_test_name, started_p),
- ?line {error, {already_started, Pid3}} =
+ ok = gen_server:call(my_test_name, started_p),
+ {error, {already_started, Pid3}} =
gen_server:start({local, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call(my_test_name, stop),
- ?line receive
- {'EXIT', Pid3, stopped} ->
- ok
- after 5000 ->
- test_server:fail(not_stopped)
- end,
+ ok = gen_server:call(my_test_name, stop),
+ receive
+ {'EXIT', Pid3, stopped} ->
+ ok
+ after 5000 ->
+ ct:fail(not_stopped)
+ end,
%% global register
- ?line {ok, Pid4} =
+ {ok, Pid4} =
gen_server:start({global, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call({global, my_test_name}, started_p),
- ?line {error, {already_started, Pid4}} =
+ ok = gen_server:call({global, my_test_name}, started_p),
+ {error, {already_started, Pid4}} =
gen_server:start({global, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call({global, my_test_name}, stop),
- test_server:sleep(1),
- ?line {'EXIT', {noproc,_}} = (catch gen_server:call(Pid4, started_p, 10)),
+ ok = gen_server:call({global, my_test_name}, stop),
+ ct:sleep(1),
+ {'EXIT', {noproc,_}} = (catch gen_server:call(Pid4, started_p, 10)),
%% global register linked
- ?line {ok, Pid5} =
+ {ok, Pid5} =
gen_server:start_link({global, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call({global, my_test_name}, started_p),
- ?line {error, {already_started, Pid5}} =
+ ok = gen_server:call({global, my_test_name}, started_p),
+ {error, {already_started, Pid5}} =
gen_server:start({global, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call({global, my_test_name}, stop),
- ?line receive
- {'EXIT', Pid5, stopped} ->
- ok
- after 5000 ->
- test_server:fail(not_stopped)
- end,
+ ok = gen_server:call({global, my_test_name}, stop),
+ receive
+ {'EXIT', Pid5, stopped} ->
+ ok
+ after 5000 ->
+ ct:fail(not_stopped)
+ end,
%% via register
- ?line dummy_via:reset(),
- ?line {ok, Pid6} =
+ dummy_via:reset(),
+ {ok, Pid6} =
gen_server:start({via, dummy_via, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call({via, dummy_via, my_test_name}, started_p),
- ?line {error, {already_started, Pid6}} =
+ ok = gen_server:call({via, dummy_via, my_test_name}, started_p),
+ {error, {already_started, Pid6}} =
gen_server:start({via, dummy_via, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call({via, dummy_via, my_test_name}, stop),
- test_server:sleep(1),
- ?line {'EXIT', {noproc,_}} = (catch gen_server:call(Pid6, started_p, 10)),
+ ok = gen_server:call({via, dummy_via, my_test_name}, stop),
+ ct:sleep(1),
+ {'EXIT', {noproc,_}} = (catch gen_server:call(Pid6, started_p, 10)),
%% via register linked
- ?line dummy_via:reset(),
- ?line {ok, Pid7} =
+ dummy_via:reset(),
+ {ok, Pid7} =
gen_server:start_link({via, dummy_via, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call({via, dummy_via, my_test_name}, started_p),
- ?line {error, {already_started, Pid7}} =
+ ok = gen_server:call({via, dummy_via, my_test_name}, started_p),
+ {error, {already_started, Pid7}} =
gen_server:start({via, dummy_via, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call({via, dummy_via, my_test_name}, stop),
- ?line receive
- {'EXIT', Pid7, stopped} ->
- ok
- after 5000 ->
- test_server:fail(not_stopped)
- end,
- test_server:messages_get(),
+ ok = gen_server:call({via, dummy_via, my_test_name}, stop),
+ receive
+ {'EXIT', Pid7, stopped} ->
+ ok
+ after 5000 ->
+ ct:fail(not_stopped)
+ end,
+ receive
+ Msg -> ct:fail({unexpected,Msg})
+ after 1 -> ok
+ end,
process_flag(trap_exit, OldFl),
ok.
@@ -294,7 +293,7 @@ stop6(_Config) ->
stop7(_Config) ->
dummy_via:reset(),
{ok, Pid} = gen_server:start({via, dummy_via, to_stop},
- ?MODULE, [], []),
+ ?MODULE, [], []),
ok = gen_server:stop({via, dummy_via, to_stop}),
false = erlang:is_process_alive(Pid),
{'EXIT',noproc} = (catch gen_server:stop({via, dummy_via, to_stop})),
@@ -342,31 +341,31 @@ stop10(_Config) ->
ok.
crash(Config) when is_list(Config) ->
- ?line error_logger_forwarder:register(),
+ error_logger_forwarder:register(),
process_flag(trap_exit, true),
%% This crash should not generate a crash report.
- ?line {ok,Pid0} = gen_server:start_link(?MODULE, [], []),
- ?line {'EXIT',{{shutdown,reason},_}} =
+ {ok,Pid0} = gen_server:start_link(?MODULE, [], []),
+ {'EXIT',{{shutdown,reason},_}} =
(catch gen_server:call(Pid0, shutdown_reason)),
receive {'EXIT',Pid0,{shutdown,reason}} -> ok end,
%% This crash should not generate a crash report.
- ?line {ok,Pid1} = gen_server:start_link(?MODULE, {state,state1}, []),
- ?line {'EXIT',{{shutdown,stop_reason},_}} =
+ {ok,Pid1} = gen_server:start_link(?MODULE, {state,state1}, []),
+ {'EXIT',{{shutdown,stop_reason},_}} =
(catch gen_server:call(Pid1, stop_shutdown_reason)),
receive {'EXIT',Pid1,{shutdown,stop_reason}} -> ok end,
%% This crash should not generate a crash report.
- ?line {ok,Pid2} = gen_server:start_link(?MODULE, [], []),
- ?line {'EXIT',{shutdown,_}} =
+ {ok,Pid2} = gen_server:start_link(?MODULE, [], []),
+ {'EXIT',{shutdown,_}} =
(catch gen_server:call(Pid2, exit_shutdown)),
receive {'EXIT',Pid2,shutdown} -> ok end,
%% This crash should not generate a crash report.
- ?line {ok,Pid3} = gen_server:start_link(?MODULE, {state,state3}, []),
- ?line {'EXIT',{shutdown,_}} =
+ {ok,Pid3} = gen_server:start_link(?MODULE, {state,state3}, []),
+ {'EXIT',{shutdown,_}} =
(catch gen_server:call(Pid3, stop_shutdown)),
receive {'EXIT',Pid3,shutdown} -> ok end,
@@ -374,8 +373,8 @@ crash(Config) when is_list(Config) ->
%% This crash should generate a crash report and a report
%% from gen_server.
- ?line {ok,Pid4} = gen_server:start(?MODULE, {state,state4}, []),
- ?line {'EXIT',{crashed,_}} = (catch gen_server:call(Pid4, crash)),
+ {ok,Pid4} = gen_server:start(?MODULE, {state,state4}, []),
+ {'EXIT',{crashed,_}} = (catch gen_server:call(Pid4, crash)),
receive
{error,_GroupLeader4,{Pid4,
"** Generic server"++_,
@@ -384,22 +383,22 @@ crash(Config) when is_list(Config) ->
|_Stacktrace]}]}} ->
ok;
Other4a ->
- ?line io:format("Unexpected: ~p", [Other4a]),
- ?line ?t:fail()
+ io:format("Unexpected: ~p", [Other4a]),
+ ct:fail(failed)
end,
receive
{error_report,_,{Pid4,crash_report,[List4|_]}} ->
{exit,crashed,_} = proplists:get_value(error_info, List4),
Pid4 = proplists:get_value(pid, List4);
Other4 ->
- ?line io:format("Unexpected: ~p", [Other4]),
- ?line ?t:fail()
+ io:format("Unexpected: ~p", [Other4]),
+ ct:fail(failed)
end,
receive
Any ->
- ?line io:format("Unexpected: ~p", [Any]),
- ?line ?t:fail()
+ io:format("Unexpected: ~p", [Any]),
+ ct:fail(failed)
after 500 ->
ok
end,
@@ -412,32 +411,31 @@ crash(Config) when is_list(Config) ->
%% handle_call.
%% --------------------------------------
-call(suite) -> [];
call(Config) when is_list(Config) ->
OldFl = process_flag(trap_exit, true),
- ?line {ok, _Pid} =
+ {ok, _Pid} =
gen_server:start_link({local, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call(my_test_name, started_p),
- ?line delayed = gen_server:call(my_test_name, {delayed_answer,1}),
+ ok = gen_server:call(my_test_name, started_p),
+ delayed = gen_server:call(my_test_name, {delayed_answer,1}),
%% two requests within a specified time.
- ?line ok = gen_server:call(my_test_name, {call_within, 1000}),
- test_server:sleep(500),
- ?line ok = gen_server:call(my_test_name, next_call),
- ?line ok = gen_server:call(my_test_name, {call_within, 1000}),
- test_server:sleep(1500),
- ?line false = gen_server:call(my_test_name, next_call),
-
+ ok = gen_server:call(my_test_name, {call_within, 1000}),
+ timer:sleep(500),
+ ok = gen_server:call(my_test_name, next_call),
+ ok = gen_server:call(my_test_name, {call_within, 1000}),
+ timer:sleep(1500),
+ false = gen_server:call(my_test_name, next_call),
+
%% timeout call.
- ?line delayed = gen_server:call(my_test_name, {delayed_answer,1}, 30),
- ?line {'EXIT',{timeout,_}} =
+ delayed = gen_server:call(my_test_name, {delayed_answer,1}, 30),
+ {'EXIT',{timeout,_}} =
(catch gen_server:call(my_test_name, {delayed_answer,30}, 1)),
%% bad return value in the gen_server loop from handle_call.
- ?line {'EXIT',{{bad_return_value, badreturn},_}} =
+ {'EXIT',{{bad_return_value, badreturn},_}} =
(catch gen_server:call(my_test_name, badreturn)),
process_flag(trap_exit, OldFl),
@@ -448,92 +446,86 @@ call(Config) when is_list(Config) ->
%% --------------------------------------
start_node(Name) ->
- ?line Pa = filename:dirname(code:which(?MODULE)),
- ?line N = test_server:start_node(Name, slave, [{args, " -pa " ++ Pa}]),
+ Pa = filename:dirname(code:which(?MODULE)),
+ N = test_server:start_node(Name, slave, [{args, " -pa " ++ Pa}]),
%% After starting a slave, it takes a little while until global knows
%% about it, even if nodes() includes it, so we make sure that global
%% knows about it before registering something on all nodes.
global:sync(),
N.
-call_remote1(suite) -> [];
call_remote1(Config) when is_list(Config) ->
N = hubba,
- ?line Node = proplists:get_value(node,Config),
- ?line {ok, Pid} = rpc:call(Node, gen_server, start,
- [{global, N}, ?MODULE, [], []]),
- ?line ok = (catch gen_server:call({global, N}, started_p, infinity)),
- ?line exit(Pid, boom),
- ?line {'EXIT', {Reason, _}} = (catch gen_server:call({global, N},
- started_p, infinity)),
- ?line true = (Reason == noproc) orelse (Reason == boom),
+ Node = proplists:get_value(node,Config),
+ {ok, Pid} = rpc:call(Node, gen_server, start,
+ [{global, N}, ?MODULE, [], []]),
+ ok = (catch gen_server:call({global, N}, started_p, infinity)),
+ exit(Pid, boom),
+ {'EXIT', {Reason, _}} = (catch gen_server:call({global, N},
+ started_p, infinity)),
+ true = (Reason == noproc) orelse (Reason == boom),
ok.
-call_remote2(suite) -> [];
call_remote2(Config) when is_list(Config) ->
- ?line N = hubba,
- ?line Node = proplists:get_value(node,Config),
-
- ?line {ok, Pid} = rpc:call(Node, gen_server, start,
- [{global, N}, ?MODULE, [], []]),
- ?line ok = (catch gen_server:call(Pid, started_p, infinity)),
- ?line exit(Pid, boom),
- ?line {'EXIT', {Reason, _}} = (catch gen_server:call(Pid,
- started_p, infinity)),
- ?line true = (Reason == noproc) orelse (Reason == boom),
+ N = hubba,
+ Node = proplists:get_value(node,Config),
+
+ {ok, Pid} = rpc:call(Node, gen_server, start,
+ [{global, N}, ?MODULE, [], []]),
+ ok = (catch gen_server:call(Pid, started_p, infinity)),
+ exit(Pid, boom),
+ {'EXIT', {Reason, _}} = (catch gen_server:call(Pid,
+ started_p, infinity)),
+ true = (Reason == noproc) orelse (Reason == boom),
ok.
-call_remote3(suite) -> [];
call_remote3(Config) when is_list(Config) ->
- ?line Node = proplists:get_value(node,Config),
-
- ?line {ok, Pid} = rpc:call(Node, gen_server, start,
- [{local, piller}, ?MODULE, [], []]),
- ?line ok = (catch gen_server:call({piller, Node}, started_p, infinity)),
- ?line exit(Pid, boom),
- ?line {'EXIT', {Reason, _}} = (catch gen_server:call({piller, Node},
- started_p, infinity)),
- ?line true = (Reason == noproc) orelse (Reason == boom),
+ Node = proplists:get_value(node,Config),
+
+ {ok, Pid} = rpc:call(Node, gen_server, start,
+ [{local, piller}, ?MODULE, [], []]),
+ ok = (catch gen_server:call({piller, Node}, started_p, infinity)),
+ exit(Pid, boom),
+ {'EXIT', {Reason, _}} = (catch gen_server:call({piller, Node},
+ started_p, infinity)),
+ true = (Reason == noproc) orelse (Reason == boom),
ok.
%% --------------------------------------
%% Test call to nonexisting node
%% --------------------------------------
-call_remote_n1(suite) -> [];
call_remote_n1(Config) when is_list(Config) ->
- ?line N = hubba,
- ?line Node = proplists:get_value(node,Config),
- ?line {ok, _Pid} = rpc:call(Node, gen_server, start,
- [{global, N}, ?MODULE, [], []]),
- ?line _ = test_server:stop_node(Node),
- ?line {'EXIT', {noproc, _}} =
+ N = hubba,
+ Node = proplists:get_value(node,Config),
+ {ok, _Pid} = rpc:call(Node, gen_server, start,
+ [{global, N}, ?MODULE, [], []]),
+ _ = test_server:stop_node(Node),
+ {'EXIT', {noproc, _}} =
(catch gen_server:call({global, N}, started_p, infinity)),
ok.
-call_remote_n2(suite) -> [];
call_remote_n2(Config) when is_list(Config) ->
- ?line N = hubba,
- ?line Node = proplists:get_value(node,Config),
+ N = hubba,
+ Node = proplists:get_value(node,Config),
- ?line {ok, Pid} = rpc:call(Node, gen_server, start,
- [{global, N}, ?MODULE, [], []]),
- ?line _ = test_server:stop_node(Node),
- ?line {'EXIT', {{nodedown, Node}, _}} = (catch gen_server:call(Pid,
- started_p, infinity)),
+ {ok, Pid} = rpc:call(Node, gen_server, start,
+ [{global, N}, ?MODULE, [], []]),
+ _ = test_server:stop_node(Node),
+ {'EXIT', {{nodedown, Node}, _}} = (catch gen_server:call(Pid,
+ started_p, infinity)),
ok.
-call_remote_n3(suite) -> [];
call_remote_n3(Config) when is_list(Config) ->
- ?line Node = proplists:get_value(node,Config),
+ Node = proplists:get_value(node,Config),
- ?line {ok, _Pid} = rpc:call(Node, gen_server, start,
- [{local, piller}, ?MODULE, [], []]),
- ?line _ = test_server:stop_node(Node),
- ?line {'EXIT', {{nodedown, Node}, _}} = (catch gen_server:call({piller, Node},
- started_p, infinity)),
+ {ok, _Pid} = rpc:call(Node, gen_server, start,
+ [{local, piller}, ?MODULE, [], []]),
+ _ = test_server:stop_node(Node),
+ {'EXIT', {{nodedown, Node}, _}} = (catch gen_server:call({piller, Node},
+ started_p, infinity)),
ok.
@@ -543,58 +535,56 @@ call_remote_n3(Config) when is_list(Config) ->
%% handle_cast.
%% --------------------------------------
-cast(suite) -> [];
cast(Config) when is_list(Config) ->
- ?line {ok, Pid} =
+ {ok, Pid} =
gen_server:start({local, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call(my_test_name, started_p),
-
- ?line ok = gen_server:cast(my_test_name, {self(),handle_cast}),
- ?line receive
- {Pid, handled_cast} ->
- ok
- after 1000 ->
- test_server:fail(handle_cast)
- end,
-
- ?line ok = gen_server:cast(my_test_name, {self(),delayed_cast,1}),
- ?line receive
- {Pid, delayed} ->
- ok
- after 1000 ->
- test_server:fail(delayed_cast)
- end,
-
- ?line ok = gen_server:cast(my_test_name, {self(),stop}),
- ?line receive
- {Pid, stopped} ->
- ok
- after 1000 ->
- test_server:fail(stop)
- end,
+ ok = gen_server:call(my_test_name, started_p),
+
+ ok = gen_server:cast(my_test_name, {self(),handle_cast}),
+ receive
+ {Pid, handled_cast} ->
+ ok
+ after 1000 ->
+ ct:fail(handle_cast)
+ end,
+
+ ok = gen_server:cast(my_test_name, {self(),delayed_cast,1}),
+ receive
+ {Pid, delayed} ->
+ ok
+ after 1000 ->
+ ct:fail(delayed_cast)
+ end,
+
+ ok = gen_server:cast(my_test_name, {self(),stop}),
+ receive
+ {Pid, stopped} ->
+ ok
+ after 1000 ->
+ ct:fail(stop)
+ end,
ok.
-cast_fast(suite) -> [];
-cast_fast(doc) -> ["Test that cast really return immediately"];
+%% Test that cast really return immediately.
cast_fast(Config) when is_list(Config) ->
- ?line {ok,Node} = start_node(hubba),
- ?line {_,"@"++Host} = lists:splitwith(fun ($@) -> false; (_) -> true end,
- atom_to_list(Node)),
- ?line FalseNode = list_to_atom("hopp@"++Host),
- ?line true = rpc:cast(Node, ?MODULE, cast_fast_messup, []),
-% ?line io:format("Nodes ~p~n", [rpc:call(N, ?MODULE, cast_fast_messup, [])]),
- ?line test_server:sleep(1000),
- ?line [Node] = nodes(),
- ?line {Time,ok} = test_server:timecall(gen_server, cast,
- [{hopp,FalseNode},hopp]),
- ?line true = test_server:stop_node(Node),
- ?line if Time > 1.0 -> % Default listen timeout is about 7.0 s
- test_server:fail(hanging_cast);
- true ->
- ok
- end.
+ {ok,Node} = start_node(hubba),
+ {_,"@"++Host} = lists:splitwith(fun ($@) -> false; (_) -> true end,
+ atom_to_list(Node)),
+ FalseNode = list_to_atom("hopp@"++Host),
+ true = rpc:cast(Node, ?MODULE, cast_fast_messup, []),
+ ct:sleep(1000),
+ [Node] = nodes(),
+ {Time,ok} = timer:tc(fun() ->
+ gen_server:cast({hopp,FalseNode}, hopp)
+ end),
+ true = test_server:stop_node(Node),
+ if Time > 1000000 -> % Default listen timeout is about 7.0 s
+ ct:fail(hanging_cast);
+ true ->
+ ok
+ end.
cast_fast_messup() ->
%% Register a false node: hopp@hostname
@@ -609,37 +599,36 @@ cast_fast_messup() ->
%% Test handle_info.
%% --------------------------------------
-info(suite) -> [];
info(Config) when is_list(Config) ->
- ?line {ok, Pid} =
+ {ok, Pid} =
gen_server:start({local, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call(my_test_name, started_p),
-
- ?line Pid ! {self(),handle_info},
- ?line receive
- {Pid, handled_info} ->
- ok
- after 1000 ->
- test_server:fail(handle_info)
- end,
-
- ?line Pid ! {self(),delayed_info,1},
- ?line receive
- {Pid, delayed_info} ->
- ok
- after 1000 ->
- test_server:fail(delayed_info)
- end,
-
- ?line Pid ! {self(),stop},
- ?line receive
- {Pid, stopped_info} ->
- ok
- after 1000 ->
- test_server:fail(stop_info)
- end,
+ ok = gen_server:call(my_test_name, started_p),
+
+ Pid ! {self(),handle_info},
+ receive
+ {Pid, handled_info} ->
+ ok
+ after 1000 ->
+ ct:fail(handle_info)
+ end,
+
+ Pid ! {self(),delayed_info,1},
+ receive
+ {Pid, delayed_info} ->
+ ok
+ after 1000 ->
+ ct:fail(delayed_info)
+ end,
+
+ Pid ! {self(),stop},
+ receive
+ {Pid, stopped_info} ->
+ ok
+ after 1000 ->
+ ct:fail(stop_info)
+ end,
ok.
hibernate(Config) when is_list(Config) ->
@@ -653,7 +642,7 @@ hibernate(Config) when is_list(Config) ->
{'EXIT', Pid0, stopped} ->
ok
after 5000 ->
- test_server:fail(gen_server_did_not_die)
+ ct:fail(gen_server_did_not_die)
end,
{ok, Pid} =
@@ -720,7 +709,7 @@ hibernate(Config) when is_list(Config) ->
{'EXIT', Pid, stopped} ->
ok
after 5000 ->
- test_server:fail(gen_server_did_not_die)
+ ct:fail(gen_server_did_not_die)
end,
process_flag(trap_exit, OldFl),
ok.
@@ -731,7 +720,7 @@ is_in_erlang_hibernate(Pid) ->
is_in_erlang_hibernate_1(0, Pid) ->
io:format("~p\n", [erlang:process_info(Pid, current_function)]),
- ?t:fail(not_in_erlang_hibernate_3);
+ ct:fail(not_in_erlang_hibernate_3);
is_in_erlang_hibernate_1(N, Pid) ->
{current_function,MFA} = erlang:process_info(Pid, current_function),
case MFA of
@@ -748,38 +737,37 @@ is_in_erlang_hibernate_1(N, Pid) ->
%% handle_cast.
%% --------------------------------------
-abcast(suite) -> [];
abcast(Config) when is_list(Config) ->
- ?line {ok, Pid} =
+ {ok, Pid} =
gen_server:start({local, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call(my_test_name, started_p),
-
- ?line abcast = gen_server:abcast(my_test_name, {self(),handle_cast}),
- ?line receive
- {Pid, handled_cast} ->
- ok
- after 1000 ->
- test_server:fail(abcast)
- end,
-
- ?line abcast = gen_server:abcast([node()], my_test_name,
- {self(),delayed_cast,1}),
- ?line receive
- {Pid, delayed} ->
- ok
- after 1000 ->
- test_server:fail(delayed_abcast)
- end,
-
- ?line abcast = gen_server:abcast(my_test_name, {self(),stop}),
- ?line receive
- {Pid, stopped} ->
- ok
- after 1000 ->
- test_server:fail(abcast_stop)
- end,
+ ok = gen_server:call(my_test_name, started_p),
+
+ abcast = gen_server:abcast(my_test_name, {self(),handle_cast}),
+ receive
+ {Pid, handled_cast} ->
+ ok
+ after 1000 ->
+ ct:fail(abcast)
+ end,
+
+ abcast = gen_server:abcast([node()], my_test_name,
+ {self(),delayed_cast,1}),
+ receive
+ {Pid, delayed} ->
+ ok
+ after 1000 ->
+ ct:fail(delayed_abcast)
+ end,
+
+ abcast = gen_server:abcast(my_test_name, {self(),stop}),
+ receive
+ {Pid, stopped} ->
+ ok
+ after 1000 ->
+ ct:fail(abcast_stop)
+ end,
ok.
%% --------------------------------------
@@ -788,58 +776,56 @@ abcast(Config) when is_list(Config) ->
%% handle_call.
%% --------------------------------------
-multicall(suite) -> [];
multicall(Config) when is_list(Config) ->
OldFl = process_flag(trap_exit, true),
- ?line {ok, Pid} =
+ {ok, Pid} =
gen_server:start_link({local, my_test_name},
gen_server_SUITE, [], []),
- ?line ok = gen_server:call(my_test_name, started_p),
+ ok = gen_server:call(my_test_name, started_p),
Nodes = nodes(),
Node = node(),
- ?line {[{Node,delayed}],Nodes} =
- gen_server:multi_call(my_test_name, {delayed_answer,1}),
+ {[{Node,delayed}],Nodes} =
+ gen_server:multi_call(my_test_name, {delayed_answer,1}),
%% two requests within a specified time.
- ?line {[{Node,ok}],[]} =
- gen_server:multi_call([Node], my_test_name, {call_within, 1000}),
- test_server:sleep(500),
- ?line {[{Node,ok}],[]} =
- gen_server:multi_call([Node], my_test_name, next_call),
- ?line {[{Node,ok}],[]} =
- gen_server:multi_call([Node], my_test_name, {call_within, 1000}),
- test_server:sleep(1500),
- ?line {[{Node,false}],[]} =
- gen_server:multi_call([Node],my_test_name, next_call),
+ {[{Node,ok}],[]} =
+ gen_server:multi_call([Node], my_test_name, {call_within, 1000}),
+ timer:sleep(500),
+ {[{Node,ok}],[]} =
+ gen_server:multi_call([Node], my_test_name, next_call),
+ {[{Node,ok}],[]} =
+ gen_server:multi_call([Node], my_test_name, {call_within, 1000}),
+ timer:sleep(1500),
+ {[{Node,false}],[]} =
+ gen_server:multi_call([Node],my_test_name, next_call),
%% Stop the server.
- ?line {[{Node,ok}],[]} =
- gen_server:multi_call([Node],my_test_name, stop),
+ {[{Node,ok}],[]} =
+ gen_server:multi_call([Node],my_test_name, stop),
receive
{'EXIT', Pid, stopped} -> ok
after 1000 ->
- test_server:fail(multicall_stop)
+ ct:fail(multicall_stop)
end,
-
+
process_flag(trap_exit, OldFl),
ok.
%% OTP-3587
-multicall_down(suite) -> [];
multicall_down(Config) when is_list(Config) ->
%% We need a named host which is inaccessible.
- ?line Name = node@test01,
+ Name = node@test01,
%% We use 'global' as a gen_server to call.
- ?line {Good, Bad} = gen_server:multi_call([Name, node()],
- global_name_server,
- info,
- 3000),
+ {Good, Bad} = gen_server:multi_call([Name, node()],
+ global_name_server,
+ info,
+ 3000),
io:format("good = ~p, bad = ~p~n", [Good, Bad]),
- ?line [Name] = Bad,
+ [Name] = Bad,
ok.
busy_wait_for_process(Pid,N) ->
@@ -854,82 +840,79 @@ busy_wait_for_process(Pid,N) ->
ok
end.
%%--------------------------------------------------------------
-spec_init(doc) ->
- ["Test gen_server:enter_loop/[3,4,5]. Used when you want to write "
- "your own special init-phase."];
-spec_init(suite) ->
- [];
+%% Test gen_server:enter_loop/[3,4,5]. Used when you want to write
+%% your own special init-phase.
spec_init(Config) when is_list(Config) ->
-
+
OldFlag = process_flag(trap_exit, true),
- ?line {ok, Pid0} = start_link(spec_init_local, [{ok, my_server}, []]),
- ?line ok = gen_server:call(Pid0, started_p),
- ?line ok = gen_server:call(Pid0, stop),
+ {ok, Pid0} = start_link(spec_init_local, [{ok, my_server}, []]),
+ ok = gen_server:call(Pid0, started_p),
+ ok = gen_server:call(Pid0, stop),
receive
{'EXIT', Pid0, stopped} ->
ok
after 5000 ->
- test_server:fail(gen_server_did_not_die)
+ ct:fail(gen_server_did_not_die)
end,
-
- ?line {ok, Pid01} = start_link(spec_init_local, [{not_ok, my_server}, []]),
+
+ {ok, Pid01} = start_link(spec_init_local, [{not_ok, my_server}, []]),
receive
{'EXIT', Pid01, process_not_registered} ->
ok
after 5000 ->
- test_server:fail(gen_server_did_not_die)
+ ct:fail(gen_server_did_not_die)
end,
-
- ?line {ok, Pid1} = start_link(spec_init_global, [{ok, my_server}, []]),
- ?line ok = gen_server:call(Pid1, started_p),
- ?line ok = gen_server:call(Pid1, stop),
+
+ {ok, Pid1} = start_link(spec_init_global, [{ok, my_server}, []]),
+ ok = gen_server:call(Pid1, started_p),
+ ok = gen_server:call(Pid1, stop),
receive
{'EXIT', Pid1, stopped} ->
ok
after 5000 ->
- test_server:fail(gen_server_did_not_die)
+ ct:fail(gen_server_did_not_die)
end,
-
- ?line {ok, Pid11} =
+
+ {ok, Pid11} =
start_link(spec_init_global, [{not_ok, my_server}, []]),
receive
{'EXIT', Pid11, process_not_registered_globally} ->
ok
after 5000 ->
- test_server:fail(gen_server_did_not_die)
+ ct:fail(gen_server_did_not_die)
end,
-
- ?line {ok, Pid2} = start_link(spec_init_anonymous, [[]]),
- ?line ok = gen_server:call(Pid2, started_p),
- ?line ok = gen_server:call(Pid2, stop),
+
+ {ok, Pid2} = start_link(spec_init_anonymous, [[]]),
+ ok = gen_server:call(Pid2, started_p),
+ ok = gen_server:call(Pid2, stop),
receive
{'EXIT', Pid2, stopped} ->
ok
after 5000 ->
- test_server:fail(gen_server_did_not_die)
+ ct:fail(gen_server_did_not_die)
end,
-
- ?line {ok, Pid3} = start_link(spec_init_anonymous_default_timeout, [[]]),
- ?line ok = gen_server:call(Pid3, started_p),
- ?line ok = gen_server:call(Pid3, stop),
+
+ {ok, Pid3} = start_link(spec_init_anonymous_default_timeout, [[]]),
+ ok = gen_server:call(Pid3, started_p),
+ ok = gen_server:call(Pid3, stop),
receive
{'EXIT', Pid3, stopped} ->
ok
after 5000 ->
- test_server:fail(gen_server_did_not_die)
+ ct:fail(gen_server_did_not_die)
end,
-
- ?line {ok, Pid4} =
+
+ {ok, Pid4} =
start_link(spec_init_default_timeout, [{ok, my_server}, []]),
- ?line ok = gen_server:call(Pid4, started_p),
- ?line ok = gen_server:call(Pid4, stop),
+ ok = gen_server:call(Pid4, started_p),
+ ok = gen_server:call(Pid4, stop),
receive
{'EXIT', Pid4, stopped} ->
ok
after 5000 ->
- test_server:fail(gen_server_did_not_die)
+ ct:fail(gen_server_did_not_die)
end,
%% Before the OTP-10130 fix this failed because a timeout message
@@ -939,83 +922,79 @@ spec_init(Config) when is_list(Config) ->
start_link(spec_init_global_default_timeout, [{ok, hurra}, []]),
timer:sleep(1000),
ok = gen_server:call(_PidHurra, started_p),
-
- ?line Pid5 =
+
+ Pid5 =
erlang:spawn_link(?MODULE, spec_init_not_proc_lib, [[]]),
receive
{'EXIT', Pid5, process_was_not_started_by_proc_lib} ->
ok
after 5000 ->
- test_server:fail(gen_server_did_not_die)
+ ct:fail(gen_server_did_not_die)
end,
process_flag(trap_exit, OldFlag),
ok.
%%--------------------------------------------------------------
-spec_init_local_registered_parent(doc) ->
- ["Test that terminate is run when the parent is a locally registered "
- "process OTP-4820"];
-spec_init_local_registered_parent(suite) -> [];
+%% OTP-4820. Test that terminate is run when the parent is a locally
+%% registered process.
spec_init_local_registered_parent(Config) when is_list(Config) ->
register(foobar, self()),
process_flag(trap_exit, true),
-
- ?line {ok, Pid} = start_link(spec_init_local, [{ok, my_server}, []]),
-
- ?line ok = gen_server:cast(my_server, {self(),stop}),
- ?line receive
- {Pid, stopped} ->
- ok
- after 1000 ->
- test_server:fail(stop)
- end,
+
+ {ok, Pid} = start_link(spec_init_local, [{ok, my_server}, []]),
+
+ ok = gen_server:cast(my_server, {self(),stop}),
+ receive
+ {Pid, stopped} ->
+ ok
+ after 1000 ->
+ ct:fail(stop)
+ end,
unregister(foobar),
ok.
+
%%--------------------------------------------------------------
-spec_init_global_registered_parent(doc) ->
- ["Test that terminate is run when the parent is a global registered "
- "process OTP-4820"];
-spec_init_global_registered_parent(suite) -> [];
+%% OTP-4820. Test that terminate is run when the parent is a global registered
+%% process.
spec_init_global_registered_parent(Config) when is_list(Config) ->
global:register_name(foobar, self()),
process_flag(trap_exit, true),
-
- ?line {ok, Pid} = start_link(spec_init_global, [{ok, my_server}, []]),
-
- ?line ok = gen_server:call(Pid, started_p),
- ?line ok = gen_server:cast(Pid, {self(),stop}),
-
- ?line receive
- {Pid, stopped} ->
- ok
- after 1000 ->
- test_server:fail(stop)
- end,
+
+ {ok, Pid} = start_link(spec_init_global, [{ok, my_server}, []]),
+
+ ok = gen_server:call(Pid, started_p),
+ ok = gen_server:cast(Pid, {self(),stop}),
+
+ receive
+ {Pid, stopped} ->
+ ok
+ after 1000 ->
+ ct:fail(stop)
+ end,
global:unregister_name(foobar),
ok.
+
%%--------------------------------------------------------------
-otp_5854(suite) ->
- [];
-otp_5854(doc) ->
- ["Test check for registered name in enter_loop/3,4,5"];
+
+%% Test check for registered name in enter_loop/3,4,5.
otp_5854(Config) when is_list(Config) ->
OldFlag = process_flag(trap_exit, true),
- ?line dummy_via:reset(),
+ dummy_via:reset(),
%% Make sure gen_server:enter_loop does not accept {local,Name}
%% when it's another process than the calling one which is
%% registered under that name
register(armitage, self()),
- ?line {ok, Pid1} =
+ {ok, Pid1} =
start_link(spec_init_local, [{not_ok, armitage}, []]),
receive
{'EXIT', Pid1, process_not_registered} ->
ok
after 1000 ->
- ?line test_server:fail(gen_server_started)
+ ct:fail(gen_server_started)
end,
unregister(armitage),
@@ -1023,25 +1002,25 @@ otp_5854(Config) when is_list(Config) ->
%% when it's another process than the calling one which is
%% registered under that name
global:register_name(armitage, self()),
- ?line {ok, Pid2} =
+ {ok, Pid2} =
start_link(spec_init_global, [{not_ok, armitage}, []]),
receive
{'EXIT', Pid2, process_not_registered_globally} ->
ok
after 1000 ->
- ?line test_server:fail(gen_server_started)
+ ct:fail(gen_server_started)
end,
global:unregister_name(armitage),
%% (same for {via, Mod, Name})
dummy_via:register_name(armitage, self()),
- ?line {ok, Pid3} =
+ {ok, Pid3} =
start_link(spec_init_via, [{not_ok, armitage}, []]),
receive
{'EXIT', Pid3, {process_not_registered_via, dummy_via}} ->
ok
after 1000 ->
- ?line test_server:fail(gen_server_started)
+ ct:fail(gen_server_started)
end,
dummy_via:unregister_name(armitage),
@@ -1053,89 +1032,85 @@ otp_5854(Config) when is_list(Config) ->
%% returns.
otp_7669(Config) when is_list(Config) ->
- ?line ?t:do_times(100, fun do_otp_7669_local_ignore/0),
- ?line ?t:do_times(100, fun do_otp_7669_global_ignore/0),
- ?line ?t:do_times(10, fun do_otp_7669_stop/0),
+ do_times(100, fun do_otp_7669_local_ignore/0),
+ do_times(100, fun do_otp_7669_global_ignore/0),
+ do_times(10, fun do_otp_7669_stop/0),
ok.
+do_times(0, _) ->
+ ok;
+do_times(N, Fun) ->
+ Fun(),
+ do_times(N-1, Fun).
+
do_otp_7669_local_ignore() ->
%% The name should never be registered after the return
%% from gen_server:start/3.
- ?line ignore = gen_server:start({local,?MODULE}, ?MODULE, ignore, []),
- ?line undefined = whereis(?MODULE),
- ?line ignore = gen_server:start({local,?MODULE}, ?MODULE, ignore, []),
- ?line undefined = whereis(?MODULE),
- ?line ignore = gen_server:start_link({local,?MODULE}, ?MODULE, ignore, []),
- ?line undefined = whereis(?MODULE).
+ ignore = gen_server:start({local,?MODULE}, ?MODULE, ignore, []),
+ undefined = whereis(?MODULE),
+ ignore = gen_server:start({local,?MODULE}, ?MODULE, ignore, []),
+ undefined = whereis(?MODULE),
+ ignore = gen_server:start_link({local,?MODULE}, ?MODULE, ignore, []),
+ undefined = whereis(?MODULE).
do_otp_7669_global_ignore() ->
- ?line ignore = gen_server:start({global,?MODULE}, ?MODULE, ignore, []),
- ?line undefined = global:whereis_name(?MODULE),
- ?line ignore = gen_server:start_link({global,?MODULE}, ?MODULE, ignore, []),
- ?line undefined = global:whereis_name(?MODULE).
+ ignore = gen_server:start({global,?MODULE}, ?MODULE, ignore, []),
+ undefined = global:whereis_name(?MODULE),
+ ignore = gen_server:start_link({global,?MODULE}, ?MODULE, ignore, []),
+ undefined = global:whereis_name(?MODULE).
do_otp_7669_stop() ->
%% The name should never be registered after the return
%% from gen_server:start/3.
- ?line {error,stopped} = gen_server:start({local,?MODULE},
- ?MODULE, stop, []),
- ?line undefined = whereis(?MODULE),
+ {error,stopped} = gen_server:start({local,?MODULE},
+ ?MODULE, stop, []),
+ undefined = whereis(?MODULE),
- ?line {error,stopped} = gen_server:start({global,?MODULE},
- ?MODULE, stop, []),
- ?line undefined = global:whereis_name(?MODULE).
+ {error,stopped} = gen_server:start({global,?MODULE},
+ ?MODULE, stop, []),
+ undefined = global:whereis_name(?MODULE).
-%% Verify that sys:get_status correctly calls our format_status/2 fun
-%%
-call_format_status(suite) ->
- [];
-call_format_status(doc) ->
- ["Test that sys:get_status/1,2 calls format_status/2"];
+%% Verify that sys:get_status correctly calls our format_status/2 fun.
call_format_status(Config) when is_list(Config) ->
- ?line {ok, Pid} = gen_server:start_link({local, call_format_status},
- ?MODULE, [], []),
- ?line Status1 = sys:get_status(call_format_status),
- ?line {status, Pid, _Mod, [_PDict, running, _Parent, _, Data1]} = Status1,
- ?line [format_status_called | _] = lists:reverse(Data1),
- ?line Status2 = sys:get_status(call_format_status, 5000),
- ?line {status, Pid, _Mod, [_PDict, running, _Parent, _, Data2]} = Status2,
- ?line [format_status_called | _] = lists:reverse(Data2),
+ {ok, Pid} = gen_server:start_link({local, call_format_status},
+ ?MODULE, [], []),
+ Status1 = sys:get_status(call_format_status),
+ {status, Pid, _Mod, [_PDict, running, _Parent, _, Data1]} = Status1,
+ [format_status_called | _] = lists:reverse(Data1),
+ Status2 = sys:get_status(call_format_status, 5000),
+ {status, Pid, _Mod, [_PDict, running, _Parent, _, Data2]} = Status2,
+ [format_status_called | _] = lists:reverse(Data2),
%% check that format_status can handle a name being a pid (atom is
%% already checked by the previous test)
- ?line {ok, Pid3} = gen_server:start_link(gen_server_SUITE, [], []),
- ?line Status3 = sys:get_status(Pid3),
- ?line {status, Pid3, _Mod, [_PDict3, running, _Parent, _, Data3]} = Status3,
- ?line [format_status_called | _] = lists:reverse(Data3),
+ {ok, Pid3} = gen_server:start_link(gen_server_SUITE, [], []),
+ Status3 = sys:get_status(Pid3),
+ {status, Pid3, _Mod, [_PDict3, running, _Parent, _, Data3]} = Status3,
+ [format_status_called | _] = lists:reverse(Data3),
%% check that format_status can handle a name being a term other than a
%% pid or atom
GlobalName1 = {global, "CallFormatStatus"},
- ?line {ok, Pid4} = gen_server:start_link(GlobalName1,
- gen_server_SUITE, [], []),
- ?line Status4 = sys:get_status(Pid4),
- ?line {status, Pid4, _Mod, [_PDict4, running, _Parent, _, Data4]} = Status4,
- ?line [format_status_called | _] = lists:reverse(Data4),
+ {ok, Pid4} = gen_server:start_link(GlobalName1,
+ gen_server_SUITE, [], []),
+ Status4 = sys:get_status(Pid4),
+ {status, Pid4, _Mod, [_PDict4, running, _Parent, _, Data4]} = Status4,
+ [format_status_called | _] = lists:reverse(Data4),
GlobalName2 = {global, {name, "term"}},
- ?line {ok, Pid5} = gen_server:start_link(GlobalName2,
- gen_server_SUITE, [], []),
- ?line Status5 = sys:get_status(GlobalName2),
- ?line {status, Pid5, _Mod, [_PDict5, running, _Parent, _, Data5]} = Status5,
- ?line [format_status_called | _] = lists:reverse(Data5),
+ {ok, Pid5} = gen_server:start_link(GlobalName2,
+ gen_server_SUITE, [], []),
+ Status5 = sys:get_status(GlobalName2),
+ {status, Pid5, _Mod, [_PDict5, running, _Parent, _, Data5]} = Status5,
+ [format_status_called | _] = lists:reverse(Data5),
ok.
-%% Verify that error termination correctly calls our format_status/2 fun
-%%
-error_format_status(suite) ->
- [];
-error_format_status(doc) ->
- ["Test that an error termination calls format_status/2"];
+%% Verify that error termination correctly calls our format_status/2 fun.
error_format_status(Config) when is_list(Config) ->
- ?line error_logger_forwarder:register(),
+ error_logger_forwarder:register(),
OldFl = process_flag(trap_exit, true),
State = "called format_status",
- ?line {ok, Pid} = gen_server:start_link(?MODULE, {state, State}, []),
- ?line {'EXIT',{crashed,_}} = (catch gen_server:call(Pid, crash)),
+ {ok, Pid} = gen_server:start_link(?MODULE, {state, State}, []),
+ {'EXIT',{crashed,_}} = (catch gen_server:call(Pid, crash)),
receive
{'EXIT', Pid, crashed} ->
ok
@@ -1148,10 +1123,9 @@ error_format_status(Config) when is_list(Config) ->
|_Stacktrace]}]}} ->
ok;
Other ->
- ?line io:format("Unexpected: ~p", [Other]),
- ?line ?t:fail()
+ io:format("Unexpected: ~p", [Other]),
+ ct:fail(failed)
end,
- ?t:messages_get(),
process_flag(trap_exit, OldFl),
ok.
@@ -1169,29 +1143,23 @@ terminate_crash_format(Config) when is_list(Config) ->
"** Generic server"++_,
[Pid,stop, {formatted, State},
{{crash, terminate},[{?MODULE,terminate,2,_}
- |_Stacktrace]}]}} ->
+ |_Stacktrace]}]}} ->
ok;
Other ->
io:format("Unexpected: ~p", [Other]),
- ?t:fail()
+ ct:fail(failed)
after 5000 ->
io:format("Timeout: expected error logger msg", []),
- ?t:fail()
+ ct:fail(failed)
end,
- ?t:messages_get(),
process_flag(trap_exit, OldFl),
ok.
%% Verify that sys:get_state correctly returns gen_server state
-%%
-get_state(suite) ->
- [];
-get_state(doc) ->
- ["Test that sys:get_state/1,2 return the gen_server state"];
get_state(Config) when is_list(Config) ->
State = self(),
{ok, _Pid} = gen_server:start_link({local, get_state},
- ?MODULE, {state,State}, []),
+ ?MODULE, {state,State}, []),
State = sys:get_state(get_state),
State = sys:get_state(get_state, 5000),
{ok, Pid} = gen_server:start_link(?MODULE, {state,State}, []),
@@ -1203,15 +1171,10 @@ get_state(Config) when is_list(Config) ->
ok.
%% Verify that sys:replace_state correctly replaces gen_server state
-%%
-replace_state(suite) ->
- [];
-replace_state(doc) ->
- ["Test that sys:replace_state/1,2 replace the gen_server state"];
replace_state(Config) when is_list(Config) ->
State = self(),
{ok, _Pid} = gen_server:start_link({local, replace_state},
- ?MODULE, {state,State}, []),
+ ?MODULE, {state,State}, []),
State = sys:get_state(replace_state),
NState1 = "replaced",
Replace1 = fun(_) -> NState1 end,
@@ -1250,16 +1213,16 @@ call_with_huge_message_queue(Config) when is_list(Config) ->
"is not implemented"};
false ->
do_call_with_huge_message_queue()
- end.
+ end.
do_call_with_huge_message_queue() ->
- ?line Pid = spawn_link(fun echo_loop/0),
+ Pid = spawn_link(fun echo_loop/0),
- ?line {Time,ok} = tc(fun() -> calls(10000, Pid) end),
+ {Time,ok} = tc(fun() -> calls(10000, Pid) end),
- ?line [self() ! {msg,N} || N <- lists:seq(1, 500000)],
+ [self() ! {msg,N} || N <- lists:seq(1, 500000)],
erlang:garbage_collect(),
- ?line {NewTime,ok} = tc(fun() -> calls(10000, Pid) end),
+ {NewTime,ok} = tc(fun() -> calls(10000, Pid) end),
io:format("Time for empty message queue: ~p", [Time]),
io:format("Time for huge message queue: ~p", [NewTime]),
@@ -1269,7 +1232,7 @@ do_call_with_huge_message_queue() ->
ok;
Q ->
io:format("Q = ~p", [Q]),
- ?line ?t:fail()
+ ct:fail(failed)
end,
ok.
@@ -1381,7 +1344,7 @@ init(stop) ->
init(hibernate) ->
{ok,[],hibernate};
init(sleep) ->
- test_server:sleep(1000),
+ ct:sleep(1000),
{ok, []};
init({state,State}) ->
{ok, State}.
@@ -1435,11 +1398,11 @@ handle_info(timeout, {reply_to, From}) ->
gen_server:reply(From, delayed),
{noreply, []};
handle_info(timeout, hibernate_me) -> % Arrive here from
- % handle_info(hibernate_later,...)
+ % handle_info(hibernate_later,...)
{noreply, [], hibernate};
handle_info(hibernate_now, _State) -> % Arrive here from
- % handle_cast({_,hibernate_later},...)
- % and by direct ! from testcase
+ % handle_cast({_,hibernate_later},...)
+ % and by direct ! from testcase
{noreply, [], hibernate};
handle_info(hibernate_later, _State) ->
{noreply, hibernate_me, 1000};
diff --git a/lib/stdlib/test/id_transform_SUITE.erl b/lib/stdlib/test/id_transform_SUITE.erl
index a0c3c9317a..aaa6a758d5 100644
--- a/lib/stdlib/test/id_transform_SUITE.erl
+++ b/lib/stdlib/test/id_transform_SUITE.erl
@@ -29,11 +29,12 @@
-export([check/2,check2/1,g/0,f/1,t/1,t1/1,t2/1,t3/1,t4/1,
t5/1,apa/1,new_fun/0]).
- % Serves as test...
+%% Serves as test...
-hej(hopp).
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
all() ->
[id_transform].
@@ -54,7 +55,7 @@ end_per_group(_GroupName, Config) ->
Config.
-id_transform(doc) -> "Test erl_id_trans.";
+%% Test erl_id_trans.
id_transform(Config) when is_list(Config) ->
File = filename:join([code:lib_dir(stdlib),"examples",
"erl_id_trans.erl"]),
@@ -62,10 +63,8 @@ id_transform(Config) when is_list(Config) ->
{module,erl_id_trans} = code:load_binary(erl_id_trans, File, Bin),
case test_server:purify_is_running() of
false ->
- Dog = ct:timetrap(?t:hours(1)),
- Res = run_in_test_suite(),
- ?t:timetrap_cancel(Dog),
- Res;
+ ct:timetrap({hours,1}),
+ run_in_test_suite();
true ->
{skip,"Valgrind (too slow)"}
end.
@@ -139,9 +138,9 @@ do_trans_1(File, Tree0) ->
{failed,{File,{transform,{unknown,Else}}}}
end.
-% From here on there's only fake code to serve as test cases
-% for the id_transform.
-% They need to be exported.
+%% From here on there's only fake code to serve as test cases
+%% for the id_transform.
+%% They need to be exported.
check(X,_Y) when X ->
true;
@@ -192,7 +191,7 @@ f(X) ->
nok
end.
-% Stolen from erl_lint_SUITE.erl
+%% Stolen from erl_lint_SUITE.erl
-record(apa, {}).
t(A) when atom(A) ->
diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl
index 821673559b..ddc55b1466 100644
--- a/lib/stdlib/test/io_SUITE.erl
+++ b/lib/stdlib/test/io_SUITE.erl
@@ -26,7 +26,7 @@
-export([error_1/1, float_g/1, otp_5403/1, otp_5813/1, otp_6230/1,
otp_6282/1, otp_6354/1, otp_6495/1, otp_6517/1, otp_6502/1,
- manpage/1, otp_6708/1, otp_7084/1, otp_7421/1,
+ manpage/1, otp_6708/1, otp_7084/0, otp_7084/1, otp_7421/1,
io_lib_collect_line_3_wb/1, cr_whitespace_in_string/1,
io_fread_newlines/1, otp_8989/1, io_lib_fread_literal/1,
printable_range/1, bad_printable_range/1,
@@ -37,7 +37,7 @@
-export([pretty/2]).
-%-define(debug, true).
+%%-define(debug, true).
-ifdef(debug).
-define(format(S, A), io:format(S, A)).
@@ -48,22 +48,18 @@
-else.
-include_lib("common_test/include/ct.hrl").
-define(format(S, A), ok).
--define(privdir(Conf), ?config(priv_dir, Conf)).
+-define(privdir(Conf), proplists:get_value(priv_dir, Conf)).
-endif.
-
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
+ Config.
+
end_per_testcase(_Case, _Config) ->
- Dog = ?config(watchdog, _Config),
- test_server:timetrap_cancel(Dog),
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[error_1, float_g, otp_5403, otp_5813, otp_6230,
@@ -92,855 +88,588 @@ end_per_group(_GroupName, Config) ->
Config.
-error_1(doc) ->
- ["Error cases for output"];
-error_1(suite) ->
- [];
+%% Error cases for output.
error_1(Config) when is_list(Config) ->
%% We don't do erroneous output on stdout - the test server
%% seems to catch that somehow.
- ?line PrivDir = ?privdir(Config),
- ?line File = filename:join(PrivDir, "slask"),
- ?line {ok, F1} = file:open(File, [write]),
- ?line {'EXIT', _} = (catch io:format(muttru, "hej", [])),
- ?line {'EXIT', _} = (catch io:format(F1, pelle, "hej")),
- ?line {'EXIT', _} = (catch io:format(F1, 1, "hej")),
- ?line {'EXIT', _} = (catch io:format(F1, "~p~", [kaka])),
- ?line {'EXIT', _} = (catch io:format(F1, "~m~n", [kaka])),
+ PrivDir = ?privdir(Config),
+ File = filename:join(PrivDir, "slask"),
+ {ok, F1} = file:open(File, [write]),
+ {'EXIT', _} = (catch io:format(muttru, "hej", [])),
+ {'EXIT', _} = (catch io:format(F1, pelle, "hej")),
+ {'EXIT', _} = (catch io:format(F1, 1, "hej")),
+ {'EXIT', _} = (catch io:format(F1, "~p~", [kaka])),
+ {'EXIT', _} = (catch io:format(F1, "~m~n", [kaka])),
%% This causes the file process to die, and it is linked to us,
%% so we can't catch the error this easily.
-% ?line {'EXIT', _} = (catch io:put_chars(F1, 666)),
+ %% {'EXIT', _} = (catch io:put_chars(F1, 666)),
- ?line file:close(F1),
- ?line {'EXIT', _} = (catch io:format(F1, "~p", ["hej"])),
+ file:close(F1),
+ {'EXIT', _} = (catch io:format(F1, "~p", ["hej"])),
ok.
float_g(Config) when is_list(Config) ->
- ?line ["5.00000e-2",
- "0.500000",
- "5.00000",
- "50.0000",
- "500.000",
- "5000.00",
- "5.00000e+4",
- "5.00000e+5"] = float_g_1("~g", 5.0, -2, 5),
-
- ?line ["-5.0000e-2",
- "-0.50000",
- "-5.0000",
- "-50.000",
- "-500.00",
- "-5000.0",
- "-5.0000e+4",
- "-5.0000e+5"] = float_g_1("~.5g", -5.0, -2, 5),
-
- ?line ["5.000e-2",
- "0.5000",
- "5.000",
- "50.00",
- "500.0",
- "5.000e+3",
- "5.000e+4",
- "5.000e+5"] = float_g_1("~.4g", 5.0, -2, 5),
-
- ?line ["-5.00e-2",
- "-0.500",
- "-5.00",
- "-50.0",
- "-5.00e+2",
- "-5.00e+3",
- "-5.00e+4",
- "-5.00e+5"] = float_g_1("~.3g", -5.0, -2, 5),
-
- ?line ["5.0e-2",
- "0.50",
- "5.0",
- "5.0e+1",
- "5.0e+2",
- "5.0e+3",
- "5.0e+4",
- "5.0e+5"] = float_g_1("~.2g", 5.0, -2, 5),
-
- ?line
- case catch fmt("~.1g", [0.5]) of
- "0.5" ->
- ?line
- ["5.0e-2",
- "0.5",
- "5.0e+0",
- "5.0e+1",
- "5.0e+2",
- "5.0e+3",
- "5.0e+4",
- "5.0e+5"] = float_g_1("~.1g", 5.0, -2, 5);
- {'EXIT',_} -> ok
- end,
-
- ?line ["4.99999e-2",
- "0.499999",
- "4.99999",
- "49.9999",
- "499.999",
- "4999.99",
- "4.99999e+4",
- "4.99999e+5"] = float_g_1("~g", 4.9999949999, -2, 5),
-
- ?line ["-5.00000e-2",
- "-0.500000",
- "-5.00000",
- "-50.0000",
- "-500.000",
- "-5000.00",
- "-5.00000e+4",
- "-5.00000e+5"] = float_g_1("~g", -4.9999950001, -2, 5),
+ ["5.00000e-2",
+ "0.500000",
+ "5.00000",
+ "50.0000",
+ "500.000",
+ "5000.00",
+ "5.00000e+4",
+ "5.00000e+5"] = float_g_1("~g", 5.0, -2, 5),
+
+ ["-5.0000e-2",
+ "-0.50000",
+ "-5.0000",
+ "-50.000",
+ "-500.00",
+ "-5000.0",
+ "-5.0000e+4",
+ "-5.0000e+5"] = float_g_1("~.5g", -5.0, -2, 5),
+
+ ["5.000e-2",
+ "0.5000",
+ "5.000",
+ "50.00",
+ "500.0",
+ "5.000e+3",
+ "5.000e+4",
+ "5.000e+5"] = float_g_1("~.4g", 5.0, -2, 5),
+
+ ["-5.00e-2",
+ "-0.500",
+ "-5.00",
+ "-50.0",
+ "-5.00e+2",
+ "-5.00e+3",
+ "-5.00e+4",
+ "-5.00e+5"] = float_g_1("~.3g", -5.0, -2, 5),
+
+ ["5.0e-2",
+ "0.50",
+ "5.0",
+ "5.0e+1",
+ "5.0e+2",
+ "5.0e+3",
+ "5.0e+4",
+ "5.0e+5"] = float_g_1("~.2g", 5.0, -2, 5),
+
+ case catch fmt("~.1g", [0.5]) of
+ "0.5" ->
+ ["5.0e-2",
+ "0.5",
+ "5.0e+0",
+ "5.0e+1",
+ "5.0e+2",
+ "5.0e+3",
+ "5.0e+4",
+ "5.0e+5"] = float_g_1("~.1g", 5.0, -2, 5);
+ {'EXIT',_} -> ok
+ end,
+
+ ["4.99999e-2",
+ "0.499999",
+ "4.99999",
+ "49.9999",
+ "499.999",
+ "4999.99",
+ "4.99999e+4",
+ "4.99999e+5"] = float_g_1("~g", 4.9999949999, -2, 5),
+
+ ["-5.00000e-2",
+ "-0.500000",
+ "-5.00000",
+ "-50.0000",
+ "-500.000",
+ "-5000.00",
+ "-5.00000e+4",
+ "-5.00000e+5"] = float_g_1("~g", -4.9999950001, -2, 5),
ok.
float_g_1(Fmt, V, Min, Max) ->
[fmt(Fmt, [V*math:pow(10, E)]) || E <- lists:seq(Min, Max)].
-otp_5403(doc) ->
- ["OTP-5403. ~s formats I/O lists and a single binary."];
-otp_5403(suite) ->
- [];
+%% OTP-5403. ~s formats I/O lists and a single binary.
otp_5403(Config) when is_list(Config) ->
- ?line "atom" = fmt("~s", [atom]),
- ?line "binary" = fmt("~s", [<<"binary">>]),
- ?line "atail" = fmt("~s", [["a" | <<"tail">>]]),
- ?line "deepcharlist" = fmt("~s", [["deep",["char",["list"]]]]),
- ?line "somebinaries" = fmt("~s", [[<<"some">>,[<<"binaries">>]]]),
+ "atom" = fmt("~s", [atom]),
+ "binary" = fmt("~s", [<<"binary">>]),
+ "atail" = fmt("~s", [["a" | <<"tail">>]]),
+ "deepcharlist" = fmt("~s", [["deep",["char",["list"]]]]),
+ "somebinaries" = fmt("~s", [[<<"some">>,[<<"binaries">>]]]),
ok.
-otp_5813(doc) ->
- ["OTP-5813. read/3 is new."];
-otp_5813(suite) ->
- [];
+%% OTP-5813. read/3 is new.
otp_5813(Config) when is_list(Config) ->
- ?line PrivDir = ?privdir(Config),
- ?line File = filename:join(PrivDir, "test"),
+ PrivDir = ?privdir(Config),
+ File = filename:join(PrivDir, "test"),
- ?line ok = file:write_file(File, <<"a. ">>),
- ?line {ok, Fd} = file:open(File, [read]),
- ?line {ok, a, 1} = io:read(Fd, '', 1),
- ?line {eof,1} = io:read(Fd, '', 1),
+ ok = file:write_file(File, <<"a. ">>),
+ {ok, Fd} = file:open(File, [read]),
+ {ok, a, 1} = io:read(Fd, '', 1),
+ {eof,1} = io:read(Fd, '', 1),
ok = file:close(Fd),
- ?line ok = file:write_file(File, <<"[}.">>),
- ?line {ok, Fd2} = file:open(File, [read]),
- ?line {error,{1,_,_},1} = io:read(Fd2, '', 1),
- ?line ok = file:close(Fd),
+ ok = file:write_file(File, <<"[}.">>),
+ {ok, Fd2} = file:open(File, [read]),
+ {error,{1,_,_},1} = io:read(Fd2, '', 1),
+ ok = file:close(Fd),
file:delete(File),
ok.
-otp_6230(doc) ->
- ["OTP-6230. ~p and ~P with (huge) binaries."];
-otp_6230(suite) ->
- [];
+%% OTP-6230. ~p and ~P with (huge) binaries.
otp_6230(Config) when is_list(Config) ->
%% The problem is actually huge binaries, but the small tests here
%% just run through most of the modified code.
- ?line "<<>>" = fmt("~P", [<<"">>,-1]),
- ?line "<<\"hej\">>" = fmt("~P", [<<"hej">>,-1]),
- ?line "{hej,...}" = fmt("~P", [{hej,<<"hej">>},2]),
- ?line "{hej,<<...>>}" = fmt("~P", [{hej,<<"hej">>},3]),
- ?line "{hej,<<\"hejs\"...>>}" = fmt("~P", [{hej,<<"hejsan">>},4]),
- ?line "{hej,<<\"hej\">>}" = fmt("~P", [{hej,<<"hej">>},6]),
- ?line "<<...>>" = fmt("~P", [<<"hej">>,1]),
- ?line "<<\"hejs\"...>>" = fmt("~P", [<<"hejsan">>,2]),
- ?line "<<\"hej\">>" = fmt("~P", [<<"hej">>,4]),
- ?line "{hej,<<127,...>>}" =
+ "<<>>" = fmt("~P", [<<"">>,-1]),
+ "<<\"hej\">>" = fmt("~P", [<<"hej">>,-1]),
+ "{hej,...}" = fmt("~P", [{hej,<<"hej">>},2]),
+ "{hej,<<...>>}" = fmt("~P", [{hej,<<"hej">>},3]),
+ "{hej,<<\"hejs\"...>>}" = fmt("~P", [{hej,<<"hejsan">>},4]),
+ "{hej,<<\"hej\">>}" = fmt("~P", [{hej,<<"hej">>},6]),
+ "<<...>>" = fmt("~P", [<<"hej">>,1]),
+ "<<\"hejs\"...>>" = fmt("~P", [<<"hejsan">>,2]),
+ "<<\"hej\">>" = fmt("~P", [<<"hej">>,4]),
+ "{hej,<<127,...>>}" =
fmt("~P", [{hej,<<127:8,<<"hej">>/binary>>},4]),
- ?line "{hej,<<127,104,101,...>>}" =
+ "{hej,<<127,104,101,...>>}" =
fmt("~P", [{hej,<<127:8,<<"hej">>/binary>>},6]),
B = list_to_binary(lists:duplicate(30000, $a)),
- ?line "<<\"aaaa"++_ = fmt("~P", [B, 20000]),
+ "<<\"aaaa"++_ = fmt("~P", [B, 20000]),
ok.
-otp_6282(doc) ->
- ["OTP-6282. ~p truncates strings (like binaries) depending on depth."];
-otp_6282(suite) ->
- [];
+%% OTP-6282. ~p truncates strings (like binaries) depending on depth.
otp_6282(Config) when is_list(Config) ->
- ?line "[]" = p("", 1, 20, 1),
- ?line "[]" = p("", 1, 20, -1),
- ?line "[...]" = p("a", 1, 20, 1),
- ?line "\"a\"" = p("a", 1, 20, 2),
- ?line "\"aa\"" = p("aa", 1, 20, 2),
- ?line "\"aaa\"" = p("aaa", 1, 20, 2),
- ?line "\"aaaa\"" = p("aaaa", 1, 20, 2),
- % ?line "\"aaaa\"..." = p("aaaaaa", 1, 20, 2),
- ?line "\"a\"" = p("a", 1, 20, -1),
- % ?line "\"aa\"..." = p([$a,$a,1000], 1, 20, 2),
- % ?line "\"aa\"..." = p([$a,$a,1000], 1, 20, 3),
- ?line "[97,97,1000]" = p([$a,$a,1000], 1, 20, 4),
+ "[]" = p("", 1, 20, 1),
+ "[]" = p("", 1, 20, -1),
+ "[...]" = p("a", 1, 20, 1),
+ "\"a\"" = p("a", 1, 20, 2),
+ "\"aa\"" = p("aa", 1, 20, 2),
+ "\"aaa\"" = p("aaa", 1, 20, 2),
+ "\"aaaa\"" = p("aaaa", 1, 20, 2),
+ "\"a\"" = p("a", 1, 20, -1),
+ "[97,97,1000]" = p([$a,$a,1000], 1, 20, 4),
S1 = lists:duplicate(200,$a),
- ?line "[...]" = p(S1, 1, 20, 1),
- % ?line "\"aaaaaaaaaaaaaaaa\"\n \"aaaaaaaaaaaaaaaa\"\n \"aaaa\"..." =
- % ?line "\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"..." =
- % p(S1, 1, 20, 10),
- ?line true = "\"" ++ S1 ++ "\"" =:= p(S1, 1, 205, -1),
- ?line "[97,97,1000|...]" = p([$a,$a,1000,1000], 1, 20, 4),
-
- ?line "[[]]" = p([""], 1, 20, 2),
- ?line "[[]]" = p([""], 1, 20, -1),
- ?line "[[...]]" = p(["a"], 1, 20, 2),
- ?line "[\"a\"]" = p(["a"], 1, 20, 3),
- ?line "[\"aa\"]" = p(["aa"], 1, 20, 3),
- ?line "[\"aaa\"]" = p(["aaa"], 1, 20, 3),
- ?line "[\"a\"]" = p(["a"], 1, 20, -1),
- % ?line "[\"aa\"...]" = p([[$a,$a,1000]], 1, 20, 3),
- % ?line "[\"aa\"...]" = p([[$a,$a,1000]], 1, 20, 4),
- ?line "[[97,97,1000]]" = p([[$a,$a,1000]], 1, 20, 5),
- ?line "[[...]]" = p([S1], 1, 20, 2),
- % ?line "[\"aaaaaaaaaaaaaa\"\n \"aaaaaaaaaaaaaa\"\n \"aaaaaaaa\"...]" =
- % ?line "[\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"...]" =
- % p([S1], 1, 20, 11),
- ?line true = "[\"" ++ S1 ++ "\"]" =:= p([S1], 1, 210, -1),
- ?line "[[97,97,1000|...]]" = p([[$a,$a,1000,1000]], 1, 20, 5),
-
- % ?line "[\"aaaa\"...]" = p(["aaaaa"], 1, 10, 3),
- ?line "[\"aaaaa\"]" = p(["aaaaa"], 1, 10, 6),
+ "[...]" = p(S1, 1, 20, 1),
+ true = "\"" ++ S1 ++ "\"" =:= p(S1, 1, 205, -1),
+ "[97,97,1000|...]" = p([$a,$a,1000,1000], 1, 20, 4),
+
+ "[[]]" = p([""], 1, 20, 2),
+ "[[]]" = p([""], 1, 20, -1),
+ "[[...]]" = p(["a"], 1, 20, 2),
+ "[\"a\"]" = p(["a"], 1, 20, 3),
+ "[\"aa\"]" = p(["aa"], 1, 20, 3),
+ "[\"aaa\"]" = p(["aaa"], 1, 20, 3),
+ "[\"a\"]" = p(["a"], 1, 20, -1),
+ "[[97,97,1000]]" = p([[$a,$a,1000]], 1, 20, 5),
+ "[[...]]" = p([S1], 1, 20, 2),
+ true = "[\"" ++ S1 ++ "\"]" =:= p([S1], 1, 210, -1),
+ "[[97,97,1000|...]]" = p([[$a,$a,1000,1000]], 1, 20, 5),
+
+ "[\"aaaaa\"]" = p(["aaaaa"], 1, 10, 6),
ok.
-otp_6354(doc) ->
- ["OTP-6354. io_lib_pretty rewritten."];
-otp_6354(suite) ->
- [];
+%% OTP-6354. io_lib_pretty rewritten.
otp_6354(Config) when is_list(Config) ->
%% A few tuples:
- ?line "{}" = p({}, 1, 20, -1),
- ?line "..." = p({}, 1, 20, 0),
- ?line "{}" = p({}, 1, 20, 1),
- ?line "{}" = p({}, 1, 20, 2),
- ?line "{a}" = p({a}, 1, 20, -1),
- ?line "..." = p({a}, 1, 20, 0),
- ?line "{...}" = p({a}, 1, 20, 1),
- ?line "{a}" = p({a}, 1, 20, 2),
- ?line "{a,b}" = p({a,b}, 1, 20, -1),
- ?line "..." = p({a,b}, 1, 20, 0),
- ?line "{...}" = p({a,b}, 1, 20, 1),
- ?line "{a,...}" = p({a,b}, 1, 20, 2),
- ?line "{a,b}" = p({a,b}, 1, 20, 3),
- ?line "{}" = p({}, 1, 1, -1),
- ?line "..." = p({}, 1, 1, 0),
- ?line "{}" = p({}, 1, 1, 1),
- ?line "{}" = p({}, 1, 1, 2),
- ?line "{a}" = p({a}, 1, 1, -1),
- ?line "..." = p({a}, 1, 1, 0),
- ?line "{...}" = p({a}, 1, 1, 1),
- ?line "{a}" = p({a}, 1, 1, 2),
- ?line "{a,\n b}" = p({a,b}, 1, 1, -1),
- ?line "{1,\n b}" = p({1,b}, 1, 1, -1),
- ?line "..." = p({a,b}, 1, 1, 0),
- ?line "{...}" = p({a,b}, 1, 1, 1),
- ?line "{a,...}" = p({a,b}, 1, 1, 2),
- ?line "{a,\n b}" = p({a,b}, 1, 1, 3),
- ?line "{{}}" = p({{}}, 1, 1, 2),
- ?line "{[]}" = p({[]}, 1, 1, 2),
- ?line bt(<<"{1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]}">>,
- p({1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]}, -1)),
- ?line bt(<<"{abcd,ddddd,\n ddddd}">>,
- p({abcd,ddddd,ddddd}, 1,16, -1)),
- ?line bt(<<"{1,2,a,b,\n {sfdsf,sdfdsfs},\n [sfsdf,sdfsdf]}">>,
- p({1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]}, 1, 35, 100)),
- % With other terms than atomic ones on the same line:
-% ?line bt(<<"{1,2,a,b,{sfdsf,sdfdsfs},\n [sfsdf,sdfsdf]}">>,
-% p({1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]}, 1, 35, 100)),
- % With line breaks:
-% ?line bt(<<"{1,\n"
-% " 2,\n"
-% " a,\n"
-% " b,\n"
-% " {sfdsf,sdfdsfs},\n"
-% " [sfsdf,sdfsdf]}">>,
-% p({1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]}, 1, 35, 100)),
- ?line "{1,{1,{2,3}}}" = p({1,{1,{2,3}}}, 1, 80, 100),
-
- ?line bt(<<"{wwwww,{wwwww,{wwwww,{wwwww,{wwwww,lkjsldfj,klsdjfjklds,\n"
- " sdkfjdsl,sdakfjdsklj,sdkljfsdj}}}}}">>,
- p({wwwww,{wwwww,{wwwww,{wwwww,{wwwww,lkjsldfj,klsdjfjklds,
- sdkfjdsl,sdakfjdsklj,sdkljfsdj}}}}}, -1)),
-
- % With no restriction on number of characters per line:
-% ?line bt(<<"{wwwww,{wwwww,{wwwww,{wwwww,{wwwww,lkjsldfj,klsdjfjklds,"
-% "sdkfjdsl,sdakfjdsklj,\n"
-% " sdkljfsdj}}}}}">>,
-% p({wwwww,{wwwww,{wwwww,{wwwww,{wwwww,lkjsldfj,klsdjfjklds,
-% sdkfjdsl,sdakfjdsklj,sdkljfsdj}}}}}, -1)),
-
- % With line breaks:
-% ?line bt(<<"{wwwww,{wwwww,{wwwww,{wwwww,{wwwww,lkjsldfj,\n"
-% " klsdjfjklds,\n"
-% " sdkfjdsl,\n"
-% " sdakfjdsklj,\n"
-% " sdkljfsdj}}}}}">>,
-% p({wwwww,{wwwww,{wwwww,{wwwww,{wwwww,lkjsldfj,klsdjfjklds,
-% sdkfjdsl,sdakfjdsklj,sdkljfsdj}}}}}, -1)),
- ?line bt(<<"{wwwww,\n"
- " {wwwww,\n"
- " {wwwww,\n"
- " {wwwww,\n"
- " {wwwww,\n"
- " {lkjsldfj,\n"
- " {klsdjfjklds,\n"
- " {klajsljls,\n"
- " #aaaaaaaaaaaaaaaaaaaaa"
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa{}}}}}}}}}">>,
- p({wwwww,{wwwww,{wwwww,{wwwww,{wwwww,{lkjsldfj,
- {klsdjfjklds,{klajsljls,
- {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}}}}}}}}},
- -1)),
- ?line "{{...},...}" = p({{a,b},{a,b,c},{d,e,f}},1,8,2),
+ "{}" = p({}, 1, 20, -1),
+ "..." = p({}, 1, 20, 0),
+ "{}" = p({}, 1, 20, 1),
+ "{}" = p({}, 1, 20, 2),
+ "{a}" = p({a}, 1, 20, -1),
+ "..." = p({a}, 1, 20, 0),
+ "{...}" = p({a}, 1, 20, 1),
+ "{a}" = p({a}, 1, 20, 2),
+ "{a,b}" = p({a,b}, 1, 20, -1),
+ "..." = p({a,b}, 1, 20, 0),
+ "{...}" = p({a,b}, 1, 20, 1),
+ "{a,...}" = p({a,b}, 1, 20, 2),
+ "{a,b}" = p({a,b}, 1, 20, 3),
+ "{}" = p({}, 1, 1, -1),
+ "..." = p({}, 1, 1, 0),
+ "{}" = p({}, 1, 1, 1),
+ "{}" = p({}, 1, 1, 2),
+ "{a}" = p({a}, 1, 1, -1),
+ "..." = p({a}, 1, 1, 0),
+ "{...}" = p({a}, 1, 1, 1),
+ "{a}" = p({a}, 1, 1, 2),
+ "{a,\n b}" = p({a,b}, 1, 1, -1),
+ "{1,\n b}" = p({1,b}, 1, 1, -1),
+ "..." = p({a,b}, 1, 1, 0),
+ "{...}" = p({a,b}, 1, 1, 1),
+ "{a,...}" = p({a,b}, 1, 1, 2),
+ "{a,\n b}" = p({a,b}, 1, 1, 3),
+ "{{}}" = p({{}}, 1, 1, 2),
+ "{[]}" = p({[]}, 1, 1, 2),
+ bt(<<"{1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]}">>,
+ p({1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]}, -1)),
+ bt(<<"{abcd,ddddd,\n ddddd}">>,
+ p({abcd,ddddd,ddddd}, 1,16, -1)),
+ bt(<<"{1,2,a,b,\n {sfdsf,sdfdsfs},\n [sfsdf,sdfsdf]}">>,
+ p({1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]}, 1, 35, 100)),
+ "{1,{1,{2,3}}}" = p({1,{1,{2,3}}}, 1, 80, 100),
+
+ bt(<<"{wwwww,{wwwww,{wwwww,{wwwww,{wwwww,lkjsldfj,klsdjfjklds,\n"
+ " sdkfjdsl,sdakfjdsklj,sdkljfsdj}}}}}">>,
+ p({wwwww,{wwwww,{wwwww,{wwwww,{wwwww,lkjsldfj,klsdjfjklds,
+ sdkfjdsl,sdakfjdsklj,sdkljfsdj}}}}}, -1)),
+
+ bt(<<"{wwwww,\n"
+ " {wwwww,\n"
+ " {wwwww,\n"
+ " {wwwww,\n"
+ " {wwwww,\n"
+ " {lkjsldfj,\n"
+ " {klsdjfjklds,\n"
+ " {klajsljls,\n"
+ " #aaaaaaaaaaaaaaaaaaaaa"
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa{}}}}}}}}}">>,
+ p({wwwww,{wwwww,{wwwww,{wwwww,{wwwww,{lkjsldfj,
+ {klsdjfjklds,{klajsljls,
+ {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}}}}}}}}},
+ -1)),
+ "{{...},...}" = p({{a,b},{a,b,c},{d,e,f}},1,8,2),
%% Closing brackets and parentheses count:
- ?line "{{a,b,c},\n {{1,2,\n 3}}}" = p({{a,b,c},{{1,2,3}}},1,11,-1),
- % With line breaks:
-% ?line "{{a,b,c},\n {{1,\n 2,\n 3}}}" = p({{a,b,c},{{1,2,3}}},1,11,-1),
- ?line "{{a,b,c},\n [1,2,\n 3]}" = p({{a,b,c},[1,2,3]},1,10,-1),
- % With line breaks:
-% ?line "{{a,b,c},\n [1,\n 2,\n 3]}" = p({{a,b,c},[1,2,3]},1,10,-1),
- ?line "[{{a,b,c},\n {1,2,\n 3}}]" = p([{{a,b,c},{1,2,3}}],1,12,-1),
- % With line breaks:
-% ?line "[{{a,b,c},\n {1,\n 2,\n 3}}]" = p([{{a,b,c},{1,2,3}}],1,12,-1),
+ "{{a,b,c},\n {{1,2,\n 3}}}" = p({{a,b,c},{{1,2,3}}},1,11,-1),
+ %% With line breaks:
+ "{{a,b,c},\n [1,2,\n 3]}" = p({{a,b,c},[1,2,3]},1,10,-1),
+ %% With line breaks:
+ "[{{a,b,c},\n {1,2,\n 3}}]" = p([{{a,b,c},{1,2,3}}],1,12,-1),
%% A few lists:
- ?line "[]" = p([], 1, 20, -1),
- ?line "..." = p([], 1, 20, 0),
- ?line "[]" = p([], 1, 20, 1),
- ?line "[]" = p([], 1, 20, 2),
- ?line "[a]" = p([a], 1, 20, -1),
- ?line "..." = p([a], 1, 20, 0),
- ?line "[...]" = p([a], 1, 20, 1),
- ?line "[a]" = p([a], 1, 20, 2),
- ?line "[a,b]" = p([a,b], 1, 20, -1),
- ?line "..." = p([a,b], 1, 20, 0),
- ?line "[...]" = p([a,b], 1, 20, 1),
- ?line "[a|...]" = p([a,b], 1, 20, 2),
- ?line "[a,b]" = p([a,b], 1, 20, 3),
- ?line "[a|b]" = p([a|b], 1, 20, -1),
- ?line "..." = p([a|b], 1, 20, 0),
- ?line "[...]" = p([a|b], 1, 20, 1),
- ?line "[a|...]" = p([a|b], 1, 20, 2),
- ?line "[a|b]" = p([a|b], 1, 20, 3),
- ?line "[]" = p([], 1, 1, -1),
- ?line "..." = p([], 1, 1, 0),
- ?line "[]" = p([], 1, 1, 1),
- ?line "[]" = p([], 1, 1, 2),
- ?line "[a]" = p([a], 1, 1, -1),
- ?line "..." = p([a], 1, 1, 0),
- ?line "[...]" = p([a], 1, 1, 1),
- ?line "[a]" = p([a], 1, 1, 2),
- ?line "[a,\n b]" = p([a,b], 1, 1, -1),
- ?line "..." = p([a,b], 1, 1, 0),
- ?line "[...]" = p([a,b], 1, 1, 1),
- ?line "[a|...]" = p([a,b], 1, 1, 2),
- ?line "[a,\n b]" = p([a,b], 1, 1, 3),
- ?line "[a|\n b]" = p([a|b], 1, 1, -1),
- ?line "..." = p([a|b], 1, 1, 0),
- ?line "[...]" = p([a|b], 1, 1, 1),
- ?line "[a|...]" = p([a|b], 1, 1, 2),
- ?line "[a|\n b]" = p([a|b], 1, 1, 3),
- ?line "[{}]" = p([{}], 1, 1, 2),
- ?line "[[]]" = p([[]], 1, 1, 2),
- ?line bt(<<"[1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]]">>,
- p([1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]], -1)),
- ?line bt(<<"[1,2,a,b,\n {sfdsf,sdfdsfs},\n [sfsdf,sdfsdf]]">>,
- p([1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]], 1, 35, 100)),
- % With other terms than atomic ones on the same line:
-% ?line bt(<<"[1,2,a,b,{sfdsf,sdfdsfs},\n [sfsdf,sdfsdf]]">>,
-% p([1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]], 1, 35, 100)),
- % With line breaks:
-% ?line bt(<<"[1,\n"
-% " 2,\n"
-% " a,\n"
-% " b,\n"
-% " {sfdsf,sdfdsfs},\n"
-% " [sfsdf,sdfsdf]]">>,
-% p([1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]], 1, 35, 100)),
+ "[]" = p([], 1, 20, -1),
+ "..." = p([], 1, 20, 0),
+ "[]" = p([], 1, 20, 1),
+ "[]" = p([], 1, 20, 2),
+ "[a]" = p([a], 1, 20, -1),
+ "..." = p([a], 1, 20, 0),
+ "[...]" = p([a], 1, 20, 1),
+ "[a]" = p([a], 1, 20, 2),
+ "[a,b]" = p([a,b], 1, 20, -1),
+ "..." = p([a,b], 1, 20, 0),
+ "[...]" = p([a,b], 1, 20, 1),
+ "[a|...]" = p([a,b], 1, 20, 2),
+ "[a,b]" = p([a,b], 1, 20, 3),
+ "[a|b]" = p([a|b], 1, 20, -1),
+ "..." = p([a|b], 1, 20, 0),
+ "[...]" = p([a|b], 1, 20, 1),
+ "[a|...]" = p([a|b], 1, 20, 2),
+ "[a|b]" = p([a|b], 1, 20, 3),
+ "[]" = p([], 1, 1, -1),
+ "..." = p([], 1, 1, 0),
+ "[]" = p([], 1, 1, 1),
+ "[]" = p([], 1, 1, 2),
+ "[a]" = p([a], 1, 1, -1),
+ "..." = p([a], 1, 1, 0),
+ "[...]" = p([a], 1, 1, 1),
+ "[a]" = p([a], 1, 1, 2),
+ "[a,\n b]" = p([a,b], 1, 1, -1),
+ "..." = p([a,b], 1, 1, 0),
+ "[...]" = p([a,b], 1, 1, 1),
+ "[a|...]" = p([a,b], 1, 1, 2),
+ "[a,\n b]" = p([a,b], 1, 1, 3),
+ "[a|\n b]" = p([a|b], 1, 1, -1),
+ "..." = p([a|b], 1, 1, 0),
+ "[...]" = p([a|b], 1, 1, 1),
+ "[a|...]" = p([a|b], 1, 1, 2),
+ "[a|\n b]" = p([a|b], 1, 1, 3),
+ "[{}]" = p([{}], 1, 1, 2),
+ "[[]]" = p([[]], 1, 1, 2),
+ bt(<<"[1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]]">>,
+ p([1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]], -1)),
+ bt(<<"[1,2,a,b,\n {sfdsf,sdfdsfs},\n [sfsdf,sdfsdf]]">>,
+ p([1,2,a,b,{sfdsf,sdfdsfs},[sfsdf,sdfsdf]], 1, 35, 100)),
%% Element #8 is not printable:
- ?line "[49," ++ _ = p("1234567"++[3,4,5,6,7], 1, 100, 9),
- % ?line "\"1234567\"..." = p("1234567"++[3,4,5,6,7], 1, 100, 8),
+ "[49," ++ _ = p("1234567"++[3,4,5,6,7], 1, 100, 9),
+ %% "\"1234567\"..." = p("1234567"++[3,4,5,6,7], 1, 100, 8),
%% A few records:
%% -record(a, {}).
%% -record(a, {}).
- ?line "..." = p({a}, 0),
- ?line "{...}" = p({a}, 1),
- ?line "#a{}" = p({a}, 2),
- ?line "#a{}" = p({a}, -1),
+ "..." = p({a}, 0),
+ "{...}" = p({a}, 1),
+ "#a{}" = p({a}, 2),
+ "#a{}" = p({a}, -1),
%% -record(b, {f}).
- ?line "{...}" = p({b}, 1),
- ?line "..." = p({b,c}, 0),
- ?line "{...}" = p({b,c}, 1),
- ?line "#b{...}" = p({b,c}, 2),
- ?line "#b{f = c}" = p({b,c}, 3),
- ?line "#b{f = c}" = p({b,c}, -1),
- ?line "..." = p({b,{c,d}}, 0),
- ?line "{...}" = p({b,{c,d}}, 1),
- ?line "#b{...}" = p({b,{c,d}}, 2),
- ?line "#b{f = {...}}" = p({b,{c,d}}, 3),
- ?line "#b{f = {c,...}}" = p({b,{c,d}}, 4),
- ?line "#b{f = {c,d}}" = p({b,{c,d}}, 5),
- ?line "#b{f = {...}}" = p({b,{b,c}}, 3),
- ?line "#b{f = #b{...}}" = p({b,{b,c}}, 4),
- ?line "#b{f = #b{f = c}}" = p({b,{b,c}}, 5),
+ "{...}" = p({b}, 1),
+ "..." = p({b,c}, 0),
+ "{...}" = p({b,c}, 1),
+ "#b{...}" = p({b,c}, 2),
+ "#b{f = c}" = p({b,c}, 3),
+ "#b{f = c}" = p({b,c}, -1),
+ "..." = p({b,{c,d}}, 0),
+ "{...}" = p({b,{c,d}}, 1),
+ "#b{...}" = p({b,{c,d}}, 2),
+ "#b{f = {...}}" = p({b,{c,d}}, 3),
+ "#b{f = {c,...}}" = p({b,{c,d}}, 4),
+ "#b{f = {c,d}}" = p({b,{c,d}}, 5),
+ "#b{f = {...}}" = p({b,{b,c}}, 3),
+ "#b{f = #b{...}}" = p({b,{b,c}}, 4),
+ "#b{f = #b{f = c}}" = p({b,{b,c}}, 5),
%% -record(c, {f1, f2}).
- ?line "#c{f1 = d,f2 = e}" = p({c,d,e}, -1),
- ?line "..." = p({c,d,e}, 0),
- ?line "{...}" = p({c,d,e}, 1),
- ?line "#c{...}" = p({c,d,e}, 2),
- ?line "#c{f1 = d,...}" = p({c,d,e}, 3),
- ?line "#c{f1 = d,f2 = e}" = p({c,d,e}, 4),
+ "#c{f1 = d,f2 = e}" = p({c,d,e}, -1),
+ "..." = p({c,d,e}, 0),
+ "{...}" = p({c,d,e}, 1),
+ "#c{...}" = p({c,d,e}, 2),
+ "#c{f1 = d,...}" = p({c,d,e}, 3),
+ "#c{f1 = d,f2 = e}" = p({c,d,e}, 4),
%% -record(d, {a..., b..., c.., d...}).
- ?line bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,bbbbbbbbbbbbbbbbbbbb = 2,\n"
- " cccccccccccccccccccc = 3,dddddddddddddddddddd = 4,\n"
- " eeeeeeeeeeeeeeeeeeee = 5}">>,
- p({d,1,2,3,4,5}, -1)),
- % With no restriction on number of characters per line:
-% ?line bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,bbbbbbbbbbbbbbbbbbbb = 2,"
-% "cccccccccccccccccccc = 3,\n dddddddddddddddddddd = 4,"
-% "eeeeeeeeeeeeeeeeeeee = 5}">>,
-% p({d,1,2,3,4,5}, -1)),
- % With line breaks:
-% ?line bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,\n"
-% " bbbbbbbbbbbbbbbbbbbb = 2,\n"
-% " cccccccccccccccccccc = 3,\n"
-% " dddddddddddddddddddd = 4,\n"
-% " eeeeeeeeeeeeeeeeeeee = 5}">>,
-% p({d,1,2,3,4,5}, -1)),
- ?line "..." = p({d,1,2,3,4,5}, 0),
- ?line "{...}" = p({d,1,2,3,4,5}, 1),
- ?line "#d{...}" = p({d,1,2,3,4,5}, 2),
- ?line "#d{aaaaaaaaaaaaaaaaaaaa = 1,...}" = p({d,1,2,3,4,5}, 3),
- ?line bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,bbbbbbbbbbbbbbbbbbbb = 2,...}">>,
- p({d,1,2,3,4,5}, 4)),
- ?line bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,bbbbbbbbbbbbbbbbbbbb = 2,\n"
- " cccccccccccccccccccc = 3,...}">>,
- p({d,1,2,3,4,5}, 5)), % longer than 80 characters...
- % With no restriction on number of characters per line:
-% ?line bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,bbbbbbbbbbbbbbbbbbbb = 2,"
-% "cccccccccccccccccccc = 3,...}">>,
-% p({d,1,2,3,4,5}, 5)), % longer than 80 characters...
- % With line breaks:
-% ?line bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,\n"
-% " bbbbbbbbbbbbbbbbbbbb = 2,\n"
-% " cccccccccccccccccccc = 3,...}">>,
-% p({d,1,2,3,4,5}, 5)),
- ?line bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,bbbbbbbbbbbbbbbbbbbb = 2,\n"
- " cccccccccccccccccccc = 3,dddddddddddddddddddd = 4,...}">>,
- p({d,1,2,3,4,5}, 6)),
- % With no restriction on number of characters per line:
-% ?line bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,bbbbbbbbbbbbbbbbbbbb = 2,"
-% "cccccccccccccccccccc = 3,\n dddddddddddddddddddd = 4,...}">>,
-% p({d,1,2,3,4,5}, 6)),
- % With line breaks:
-% ?line bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,\n"
-% " bbbbbbbbbbbbbbbbbbbb = 2,\n"
-% " cccccccccccccccccccc = 3,\n"
-% " dddddddddddddddddddd = 4,...}">>,
-% p({d,1,2,3,4,5}, 6)),
- ?line bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,bbbbbbbbbbbbbbbbbbbb = 2,\n"
- " cccccccccccccccccccc = 3,dddddddddddddddddddd = 4,\n"
- " eeeeeeeeeeeeeeeeeeee = 5}">>,
- p({d,1,2,3,4,5}, 7)),
- % With no restriction on number of characters per line:
-% ?line bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,bbbbbbbbbbbbbbbbbbbb = 2,"
-% "cccccccccccccccccccc = 3,\n dddddddddddddddddddd = 4,"
-% "eeeeeeeeeeeeeeeeeeee = 5}">>,
-% p({d,1,2,3,4,5}, 7)),
- % With line breaks:
-% ?line bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,\n"
-% " bbbbbbbbbbbbbbbbbbbb = 2,\n"
-% " cccccccccccccccccccc = 3,\n"
-% " dddddddddddddddddddd = 4,\n"
-% " eeeeeeeeeeeeeeeeeeee = 5}">>,
-% p({d,1,2,3,4,5}, 7)),
- ?line bt(<<"#rrrrr{\n"
- " f1 = 1,\n"
- " f2 = #rrrrr{f1 = a,f2 = b,f3 = c},\n"
- " f3 = \n"
- " #rrrrr{\n"
- " f1 = h,f2 = i,\n"
- " f3 = \n"
- " #rrrrr{\n"
- " f1 = aa,\n"
- " f2 = \n"
- " #rrrrr{\n"
- " f1 = #rrrrr{f1 = a,f2 = b,f3 = c},\n"
- " f2 = 2,f3 = 3},\n"
- " f3 = bb}}}">>,
- p({rrrrr,1,{rrrrr,a,b,c},{rrrrr,h,i,
- {rrrrr,aa,{rrrrr,{rrrrr,a,b,c},
- 2,3},bb}}},
- -1)),
- % With other terms than atomic ones on the same line:
-% ?line bt(<<"#rrrrr{\n"
-% " f1 = 1,f2 = #rrrrr{f1 = a,f2 = b,f3 = c},\n"
-% " f3 = \n"
-% " #rrrrr{\n"
-% " f1 = h,f2 = i,\n"
-% " f3 = \n"
-% " #rrrrr{\n"
-% " f1 = aa,\n"
-% " f2 = \n"
-% " #rrrrr{\n"
-% " f1 = #rrrrr{f1 = a,f2 = b,"
-% "f3 = c},f2 = 2,f3 = 3},\n"
-% " f3 = bb}}}">>,
-% p({rrrrr,1,{rrrrr,a,b,c},{rrrrr,h,i,
-% {rrrrr,aa,{rrrrr,{rrrrr,a,b,c},
-% 2,3},bb}}},
-% -1)),
- % With line breaks:
-% ?line bt(<<"#rrrrr{\n"
-% " f1 = 1,\n"
-% " f2 = #rrrrr{f1 = a,f2 = b,f3 = c},\n"
-% " f3 = \n"
-% " #rrrrr{\n"
-% " f1 = h,\n"
-% " f2 = i,\n"
-% " f3 = \n"
-% " #rrrrr{\n"
-% " f1 = aa,\n"
-% " f2 = \n"
-% " #rrrrr{\n"
-% " f1 = #rrrrr{f1 = a,f2 = b,"
-% "f3 = c},\n"
-% " f2 = 2,\n"
-% " f3 = 3},\n"
-% " f3 = bb}}}">>,
-% p({rrrrr,1,{rrrrr,a,b,c},{rrrrr,h,i,
-% {rrrrr,aa,{rrrrr,{rrrrr,a,b,c},
-% 2,3},bb}}},
-% -1)),
- ?line bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,\n"
- " bbbbbbbbbbbbbbbbbbbb = \n"
- " #d{aaaaaaaaaaaaaaaaaaaa = a,bbbbbbbbbbbbbbbbbbbb = b,\n"
- " cccccccccccccccccccc = c,dddddddddddddddddddd = d,\n"
- " eeeeeeeeeeeeeeeeeeee = e},\n"
- " cccccccccccccccccccc = 3,\n"
- " dddddddddddddddddddd = \n"
- " #d{aaaaaaaaaaaaaaaaaaaa = h,bbbbbbbbbbbbbbbbbbbb = i,\n"
- " cccccccccccccccccccc = \n"
- " #d{aaaaaaaaaaaaaaaaaaaa = aa,"
- "bbbbbbbbbbbbbbbbbbbb = bb,\n"
- " cccccccccccccccccccc = \n"
- " #d{aaaaaaaaaaaaaaaaaaaa = 1,"
- "bbbbbbbbbbbbbbbbbbbb = 2,\n"
- " cccccccccccccccccccc = 3,"
- "dddddddddddddddddddd = 4,\n"
- " eeeeeeeeeeeeeeeeeeee = 5},\n"
- " dddddddddddddddddddd = dd,"
- "eeeeeeeeeeeeeeeeeeee = ee},\n"
- " dddddddddddddddddddd = k,"
- "eeeeeeeeeeeeeeeeeeee = l},\n"
- " eeeeeeeeeeeeeeeeeeee = 5}">>,
- p({d,1,{d,a,b,c,d,e},3,{d,h,i,{d,aa,bb,{d,1,2,3,4,5},dd,ee},
- k,l},5}, -1)),
- % With line breaks:
-% ?line bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,\n"
-% " bbbbbbbbbbbbbbbbbbbb = \n"
-% " #d{aaaaaaaaaaaaaaaaaaaa = a,\n"
-% " bbbbbbbbbbbbbbbbbbbb = b,\n"
-% " cccccccccccccccccccc = c,\n"
-% " dddddddddddddddddddd = d,\n"
-% " eeeeeeeeeeeeeeeeeeee = e},\n"
-% " cccccccccccccccccccc = 3,\n"
-% " dddddddddddddddddddd = \n"
-% " #d{aaaaaaaaaaaaaaaaaaaa = h,\n"
-% " bbbbbbbbbbbbbbbbbbbb = i,\n"
-% " cccccccccccccccccccc = \n"
-% " #d{aaaaaaaaaaaaaaaaaaaa = aa,\n"
-% " bbbbbbbbbbbbbbbbbbbb = bb,\n"
-% " cccccccccccccccccccc = \n"
-% " #d{aaaaaaaaaaaaaaaaaaaa = 1,\n"
-% " bbbbbbbbbbbbbbbbbbbb = 2,\n"
-% " cccccccccccccccccccc = 3,\n"
-% " dddddddddddddddddddd = 4,\n"
-% " eeeeeeeeeeeeeeeeeeee = 5},\n"
-% " dddddddddddddddddddd = dd,\n"
-% " eeeeeeeeeeeeeeeeeeee = ee},\n"
-% " dddddddddddddddddddd = k,\n"
-% " eeeeeeeeeeeeeeeeeeee = l},\n"
-% " eeeeeeeeeeeeeeeeeeee = 5}">>,
-% p({d,1,{d,a,b,c,d,e},3,{d,h,i,{d,aa,bb,{d,1,2,3,4,5},dd,ee},
-% k,l},5}, -1)),
+ bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,bbbbbbbbbbbbbbbbbbbb = 2,\n"
+ " cccccccccccccccccccc = 3,dddddddddddddddddddd = 4,\n"
+ " eeeeeeeeeeeeeeeeeeee = 5}">>,
+ p({d,1,2,3,4,5}, -1)),
+ "..." = p({d,1,2,3,4,5}, 0),
+ "{...}" = p({d,1,2,3,4,5}, 1),
+ "#d{...}" = p({d,1,2,3,4,5}, 2),
+ "#d{aaaaaaaaaaaaaaaaaaaa = 1,...}" = p({d,1,2,3,4,5}, 3),
+ bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,bbbbbbbbbbbbbbbbbbbb = 2,...}">>,
+ p({d,1,2,3,4,5}, 4)),
+ bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,bbbbbbbbbbbbbbbbbbbb = 2,\n"
+ " cccccccccccccccccccc = 3,...}">>,
+ p({d,1,2,3,4,5}, 5)), % longer than 80 characters...
+ bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,bbbbbbbbbbbbbbbbbbbb = 2,\n"
+ " cccccccccccccccccccc = 3,dddddddddddddddddddd = 4,...}">>,
+ p({d,1,2,3,4,5}, 6)),
+ bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,bbbbbbbbbbbbbbbbbbbb = 2,\n"
+ " cccccccccccccccccccc = 3,dddddddddddddddddddd = 4,\n"
+ " eeeeeeeeeeeeeeeeeeee = 5}">>,
+ p({d,1,2,3,4,5}, 7)),
+ bt(<<"#rrrrr{\n"
+ " f1 = 1,\n"
+ " f2 = #rrrrr{f1 = a,f2 = b,f3 = c},\n"
+ " f3 = \n"
+ " #rrrrr{\n"
+ " f1 = h,f2 = i,\n"
+ " f3 = \n"
+ " #rrrrr{\n"
+ " f1 = aa,\n"
+ " f2 = \n"
+ " #rrrrr{\n"
+ " f1 = #rrrrr{f1 = a,f2 = b,f3 = c},\n"
+ " f2 = 2,f3 = 3},\n"
+ " f3 = bb}}}">>,
+ p({rrrrr,1,{rrrrr,a,b,c},{rrrrr,h,i,
+ {rrrrr,aa,{rrrrr,{rrrrr,a,b,c},
+ 2,3},bb}}},
+ -1)),
+ bt(<<"#d{aaaaaaaaaaaaaaaaaaaa = 1,\n"
+ " bbbbbbbbbbbbbbbbbbbb = \n"
+ " #d{aaaaaaaaaaaaaaaaaaaa = a,bbbbbbbbbbbbbbbbbbbb = b,\n"
+ " cccccccccccccccccccc = c,dddddddddddddddddddd = d,\n"
+ " eeeeeeeeeeeeeeeeeeee = e},\n"
+ " cccccccccccccccccccc = 3,\n"
+ " dddddddddddddddddddd = \n"
+ " #d{aaaaaaaaaaaaaaaaaaaa = h,bbbbbbbbbbbbbbbbbbbb = i,\n"
+ " cccccccccccccccccccc = \n"
+ " #d{aaaaaaaaaaaaaaaaaaaa = aa,"
+ "bbbbbbbbbbbbbbbbbbbb = bb,\n"
+ " cccccccccccccccccccc = \n"
+ " #d{aaaaaaaaaaaaaaaaaaaa = 1,"
+ "bbbbbbbbbbbbbbbbbbbb = 2,\n"
+ " cccccccccccccccccccc = 3,"
+ "dddddddddddddddddddd = 4,\n"
+ " eeeeeeeeeeeeeeeeeeee = 5},\n"
+ " dddddddddddddddddddd = dd,"
+ "eeeeeeeeeeeeeeeeeeee = ee},\n"
+ " dddddddddddddddddddd = k,"
+ "eeeeeeeeeeeeeeeeeeee = l},\n"
+ " eeeeeeeeeeeeeeeeeeee = 5}">>,
+ p({d,1,{d,a,b,c,d,e},3,{d,h,i,{d,aa,bb,{d,1,2,3,4,5},dd,ee},
+ k,l},5}, -1)),
A = aaaaaaaaaaaaa,
%% Print the record with dots at the end of the line (Ll = 80).
- ?line "{aaaaaaa" ++ _ =
- p({A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,
- {A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,
- {A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,
- {A,{A,{ggg,{hhh,{ii,{jj,{kk,{ll,{mm,{nn,{oo,{d,1,2,3,4,5}
- }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
- }}}}}}}}}}}}}}}}, 146),
- ?line "{aaaaaaa" ++ _ =
- p({A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,
- {A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,
- {A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,
- {A,{A,{A,{A,{A,{ggg,{hhh,{ii,{jj,{kk,{ll,{mm,{nn,{oo,{a}
- }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
- }}}}}}}}}}}}}}}}}}}, 152),
-
- ?line bt(<<"{aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {g,{h,{i,{j,{k,{l,{m,{n,{o,#"
- "d{...}}}}}}}}}}}}}}}}">>,
- p({A,{A,{A,{A,{A,{A,
- {g,{h,{i,{j,{k,{l,{m,{n,{o,{d,1,2,3,4,5}}}}}}}}}}}}}}}}, 32)),
- ?line bt(<<"{a,#b{f = {c,{d,{e,{f,...}}}}}}">>,
- p({a,{b,{c,{d,{e,{f,g}}}}}}, 12)),
- ?line bt(<<"{aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,#c{f1 = ddd,"
- "f2 = eee}}}}}}}}}}">>,
- p({A,{A,{A,{A,{A,{A,{A,{A,{A,{c,ddd,eee}}}}}}}}}}, 100)),
- ?line bt(<<"{aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,{aaaaaaaaaaaaa,{aaaaaaaaaaaaa,...}}}}">>,
- p({A,{A,{A,{A,{b}}}}}, 8)),
- % With no restriction on number of characters per line:
-% ?line bt(<<"{aaaaaaaaaaaaa,{aaaaaaaaaaaaa,{aaaaaaaaaaaaa,"
-% "{aaaaaaaaaaaaa,...}}}}">>,
-% p({A,{A,{A,{A,{b}}}}}, 8)),
- ?line bt(<<"{aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,{aaaaaaaaaaaaa,{aaaaaaaaaaaaa,...}}}}}">>,
- p({A,{A,{A,{A,{A,{b}}}}}}, 10)),
- % With no restriction on number of characters per line:
-% ?line bt(<<"{aaaaaaaaaaaaa,\n"
-% " {aaaaaaaaaaaaa,{aaaaaaaaaaaaa,{aaaaaaaaaaaaa,"
-% "{aaaaaaaaaaaaa,...}}}}}">>,
-% p({A,{A,{A,{A,{A,{b}}}}}}, 10)),
- ?line bt(<<"{aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,"
- "{aaaaaaaaaaaaa,#a{}}}}}}}}}}}">>,
- p({A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{a}}}}}}}}}}}, 23)),
- ?line bt(<<"{aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n",
- " #rrrrr{\n"
- " f1 = kljlkjlksfdgkljlsdkjf,"
- "f2 = kljkljsdaflkjlkjsdf,...}}}}">>,
- p({A,{A,{A,{rrrrr, kljlkjlksfdgkljlsdkjf,
- kljkljsdaflkjlkjsdf,
- asdfkldsjfklkljsdklfds}}}}, 10)),
- % With no restriction on number of characters per line:
-% ?line bt(<<"{aaaaaaaaaaaaa,\n"
-% " {aaaaaaaaaaaaa,\n"
-% " {aaaaaaaaaaaaa,\n",
-% " #rrrrr{f1 = kljlkjlksfdgkljlsdkjf,f2 = "
-% "kljkljsdaflkjlkjsdf,...}}}}">>,
-% p({A,{A,{A,{rrrrr, kljlkjlksfdgkljlsdkjf,
-% kljkljsdaflkjlkjsdf,
-% asdfkldsjfklkljsdklfds}}}}, 10)),
- ?line bt(<<"{aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {aaaaaaaaaaaaa,\n"
- " {g,{h,{i,{j,{k,{l,{m,{n,"
- "{o,#a{}}}}}}}}}}}}}}}}}">>,
- p({A,{A,{A,{A,{A,{A,{A,
- {g,{h,{i,{j,{k,{l,{m,{n,{o,{a}}}}}}}}}}}}}}}}}, 100)),
- ?line bt(<<"#c{\n"
- " f1 = \n"
- " #c{\n"
- " f1 = \n"
- " #c{\n"
- " f1 = \n"
- " #c{\n"
- " f1 = \n"
- " #c{\n"
- " f1 = \n"
- " #c{\n"
- " f1 = \n"
- " #c{\n"
- " f1 = \n"
- " #c{\n"
- " f1 = \n"
- " #c{\n"
- " f1 = #c{f1 = #c{f1 = #c{f1 = a,"
- "f2 = b},f2 = b},f2 = b},\n"
- " f2 = b},\n"
- " f2 = b},\n"
- " f2 = b},\n"
- " f2 = b},\n"
- " f2 = b},\n"
- " f2 = b},\n"
- " f2 = b},\n"
- " f2 = b},\n"
- " f2 = b}">>,
- p({c,{c,{c,{c,{c,{c,{c,{c,{c,{c,{c,{c,a,b},b},b},b},b},b},
- b},b},b},b},b},b}, -1)),
- ?line bt(<<"#rrrrr{\n"
- " f1 = \n"
- " #rrrrr{\n"
- " f1 = \n"
- " #rrrrr{\n"
- " f1 = \n"
- " #rrrrr{\n"
- " f1 = \n"
- " {rrrrr,{rrrrr,a,#rrrrr{f1 = {rrrrr,1,2},f2 = a,"
- "f3 = b}},b},\n"
- " f2 = {rrrrr,c,d},\n"
- " f3 = {rrrrr,1,2}},\n"
- " f2 = 1,f3 = 2},\n"
- " f2 = 3,f3 = 4},\n"
- " f2 = 5,f3 = 6}">>,
- p({rrrrr,{rrrrr,{rrrrr,{rrrrr,{rrrrr,{rrrrr,a,{rrrrr,
- {rrrrr,1,2},a,b}},b},{rrrrr,c,d},{rrrrr,1,2}},
- 1,2},3,4},5,6}, -1)),
- % With other terms than atomic ones on the same line:
-% ?line bt(<<"#rrrrr{\n"
-% " f1 = \n"
-% " #rrrrr{\n"
-% " f1 = \n"
-% " #rrrrr{\n"
-% " f1 = \n"
-% " #rrrrr{\n"
-% " f1 = \n"
-% " {rrrrr,{rrrrr,a,#rrrrr{f1 = {rrrrr,1,2},f2 = a,"
-% "f3 = b}},b},\n"
-% " f2 = {rrrrr,c,d},f3 = {rrrrr,1,2}},\n"
-% " f2 = 1,f3 = 2},\n"
-% " f2 = 3,f3 = 4},\n"
-% " f2 = 5,f3 = 6}">>,
-% p({rrrrr,{rrrrr,{rrrrr,{rrrrr,{rrrrr,{rrrrr,a,{rrrrr,
-% {rrrrr,1,2},a,b}},b},{rrrrr,c,d},{rrrrr,1,2}},
-% 1,2},3,4},5,6}, -1)),
- % With no restriction on number of characters per line:
-% ?line bt(<<"#rrrrr{\n"
-% " f1 = \n"
-% " #rrrrr{\n"
-% " f1 = \n"
-% " #rrrrr{\n"
-% " f1 = \n"
-% " #rrrrr{\n"
-% " f1 = {rrrrr,{rrrrr,a,#rrrrr{f1 = {rrrrr,1,2},f2 = a,"
-% "f3 = b}},b},\n"
-% " f2 = {rrrrr,c,d},f3 = {rrrrr,1,2}},\n"
-% " f2 = 1,f3 = 2},\n"
-% " f2 = 3,f3 = 4},\n"
-% " f2 = 5,f3 = 6}">>,
-% p({rrrrr,{rrrrr,{rrrrr,{rrrrr,{rrrrr,{rrrrr,a,{rrrrr,
-% {rrrrr,1,2},a,b}},b},{rrrrr,c,d},{rrrrr,1,2}},
-% 1,2},3,4},5,6}, -1)),
- % With line breaks:
-% ?line bt(<<"#rrrrr{\n"
-% " f1 = \n"
-% " #rrrrr{\n"
-% " f1 = \n"
-% " #rrrrr{\n"
-% " f1 = \n"
-% " #rrrrr{\n"
-% " f1 = {rrrrr,{rrrrr,a,#rrrrr{f1 = {rrrrr,1,2},f2 = a,"
-% "f3 = b}},b},\n"
-% " f2 = {rrrrr,c,d},\n"
-% " f3 = {rrrrr,1,2}},\n"
-% " f2 = 1,\n"
-% " f3 = 2},\n"
-% " f2 = 3,\n"
-% " f3 = 4},\n"
-% " f2 = 5,\n"
-% " f3 = 6}">>,
-% p({rrrrr,{rrrrr,{rrrrr,{rrrrr,{rrrrr,{rrrrr,a,{rrrrr,
-% {rrrrr,1,2},a,b}},b},{rrrrr,c,d},{rrrrr,1,2}},
-% 1,2},3,4},5,6}, -1)),
- ?line "{aaa,\n {aaa," ++ _ =
+ "{aaaaaaa" ++ _ =
+ p({A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,
+ {A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,
+ {A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,
+ {A,{A,{ggg,{hhh,{ii,{jj,{kk,{ll,{mm,{nn,{oo,{d,1,2,3,4,5}
+ }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+ }}}}}}}}}}}}}}}}, 146),
+ "{aaaaaaa" ++ _ =
+ p({A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,
+ {A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,
+ {A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{A,
+ {A,{A,{A,{A,{A,{ggg,{hhh,{ii,{jj,{kk,{ll,{mm,{nn,{oo,{a}
+ }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+ }}}}}}}}}}}}}}}}}}}, 152),
+
+ bt(<<"{aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {g,{h,{i,{j,{k,{l,{m,{n,{o,#"
+ "d{...}}}}}}}}}}}}}}}}">>,
+ p({A,{A,{A,{A,{A,{A,
+ {g,{h,{i,{j,{k,{l,{m,{n,{o,{d,1,2,3,4,5}}}}}}}}}}}}}}}}, 32)),
+ bt(<<"{a,#b{f = {c,{d,{e,{f,...}}}}}}">>,
+ p({a,{b,{c,{d,{e,{f,g}}}}}}, 12)),
+ bt(<<"{aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,#c{f1 = ddd,"
+ "f2 = eee}}}}}}}}}}">>,
+ p({A,{A,{A,{A,{A,{A,{A,{A,{A,{c,ddd,eee}}}}}}}}}}, 100)),
+ bt(<<"{aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,{aaaaaaaaaaaaa,{aaaaaaaaaaaaa,...}}}}">>,
+ p({A,{A,{A,{A,{b}}}}}, 8)),
+ bt(<<"{aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,{aaaaaaaaaaaaa,{aaaaaaaaaaaaa,...}}}}}">>,
+ p({A,{A,{A,{A,{A,{b}}}}}}, 10)),
+ bt(<<"{aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,"
+ "{aaaaaaaaaaaaa,#a{}}}}}}}}}}}">>,
+ p({A,{A,{A,{A,{A,{A,{A,{A,{A,{A,{a}}}}}}}}}}}, 23)),
+ bt(<<"{aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n",
+ " #rrrrr{\n"
+ " f1 = kljlkjlksfdgkljlsdkjf,"
+ "f2 = kljkljsdaflkjlkjsdf,...}}}}">>,
+ p({A,{A,{A,{rrrrr, kljlkjlksfdgkljlsdkjf,
+ kljkljsdaflkjlkjsdf,
+ asdfkldsjfklkljsdklfds}}}}, 10)),
+ bt(<<"{aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {aaaaaaaaaaaaa,\n"
+ " {g,{h,{i,{j,{k,{l,{m,{n,"
+ "{o,#a{}}}}}}}}}}}}}}}}}">>,
+ p({A,{A,{A,{A,{A,{A,{A,
+ {g,{h,{i,{j,{k,{l,{m,{n,{o,{a}}}}}}}}}}}}}}}}}, 100)),
+ bt(<<"#c{\n"
+ " f1 = \n"
+ " #c{\n"
+ " f1 = \n"
+ " #c{\n"
+ " f1 = \n"
+ " #c{\n"
+ " f1 = \n"
+ " #c{\n"
+ " f1 = \n"
+ " #c{\n"
+ " f1 = \n"
+ " #c{\n"
+ " f1 = \n"
+ " #c{\n"
+ " f1 = \n"
+ " #c{\n"
+ " f1 = #c{f1 = #c{f1 = #c{f1 = a,"
+ "f2 = b},f2 = b},f2 = b},\n"
+ " f2 = b},\n"
+ " f2 = b},\n"
+ " f2 = b},\n"
+ " f2 = b},\n"
+ " f2 = b},\n"
+ " f2 = b},\n"
+ " f2 = b},\n"
+ " f2 = b},\n"
+ " f2 = b}">>,
+ p({c,{c,{c,{c,{c,{c,{c,{c,{c,{c,{c,{c,a,b},b},b},b},b},b},
+ b},b},b},b},b},b}, -1)),
+ bt(<<"#rrrrr{\n"
+ " f1 = \n"
+ " #rrrrr{\n"
+ " f1 = \n"
+ " #rrrrr{\n"
+ " f1 = \n"
+ " #rrrrr{\n"
+ " f1 = \n"
+ " {rrrrr,{rrrrr,a,#rrrrr{f1 = {rrrrr,1,2},f2 = a,"
+ "f3 = b}},b},\n"
+ " f2 = {rrrrr,c,d},\n"
+ " f3 = {rrrrr,1,2}},\n"
+ " f2 = 1,f3 = 2},\n"
+ " f2 = 3,f3 = 4},\n"
+ " f2 = 5,f3 = 6}">>,
+ p({rrrrr,{rrrrr,{rrrrr,{rrrrr,{rrrrr,{rrrrr,a,{rrrrr,
+ {rrrrr,1,2},a,b}},b},{rrrrr,c,d},{rrrrr,1,2}},
+ 1,2},3,4},5,6}, -1)),
+ "{aaa,\n {aaa," ++ _ =
p({aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,
- {aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,
- {aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,
- {aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,
- {aaa,a}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
+ {aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,
+ {aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,
+ {aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,{aaa,
+ {aaa,a}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
1, 80, -1),
%% A few other cases...
- ?line "{a,#Fun<" ++ _ = lists:flatten(io_lib_pretty:print({a,fun fmt/2})),
- ?line "#Fun<" ++ _ = io_lib_pretty:print(fun() -> foo end),
- % ?line "[<<\"foobar\">>|<<\"barf\"...>>]" =
- % p([<<"foobar">>|<<"barfoo">>], 1, 30, 4),
+ "{a,#Fun<" ++ _ = lists:flatten(io_lib_pretty:print({a,fun fmt/2})),
+ "#Fun<" ++ _ = io_lib_pretty:print(fun() -> foo end),
%% No support for negative columns any more:
- ?line "[a,\n [b,\n c,\n d,\n [e,\n f]],\n c]" =
- p([a,[b,c,d,[e,f]],c], -1, 2, 10),
- ?line "[a,\n [b,\n c,\n d,\n [e,\n f]],\n c]" =
- p([a,[b,c,d,[e,f]],c], 0, 2, 10),
+ "[a,\n [b,\n c,\n d,\n [e,\n f]],\n c]" =
+ p([a,[b,c,d,[e,f]],c], -1, 2, 10),
+ "[a,\n [b,\n c,\n d,\n [e,\n f]],\n c]" =
+ p([a,[b,c,d,[e,f]],c], 0, 2, 10),
%% 20 bytes are tried first, then the rest. Try 21 bytes:
L = lists:duplicate(20, $a),
- % ?line bt(<<"<<\"aaaaaa\"\n \"aaaaaa\"\n \"aaaaaa\"\n \"aaa\">>">>,
- ?line bt(<<"<<\"aaaaaaaaaaaaaaaaaaaaa\">>">>,
- p(list_to_binary([$a | L]), 1, 10, -1)),
- ?line "<<97," ++ _ = p(list_to_binary(L ++ [3]), 1, 10, -1),
- % ?line "<<\"aaaa\"...>>" = p(list_to_binary(L ++ [3]), 1, 10, 2),
- % ?line "<<\"aaaaaa\"\n \"aa\"...>>" =
- % ?line "<<\"aaaaaaaa\"...>>" =
- % p(list_to_binary(L ++ [3]), 1, 10, 3),
- % ?line "<<\"aaaaaa\"\n \"aaaaaa\"\n \"aaaaaa\"\n \"aa\"...>>" =
- % ?line "<<\"aaaaaaaaaaaaaaaaaaaa\"...>>" =
- % p(list_to_binary(L ++ [3]), 1, 10, 21),
- ?line "<<97," ++ _ = p(list_to_binary(L ++ [3]), 1, 10, 22),
-
- ?line "\"\\b\\t\\n\\v\\f\\r\\e\250\"" =
- p([8,9,10,11,12,13,27,168], 1, 40, -1),
- % ?line "\"\\b\\t\\n\"\n \"\\v\\f\\r\"\n \"\\e\250\"" =
- ?line "\"\\b\\t\\n\\v\\f\\r\\e¨\"" =
- p([8,9,10,11,12,13,27,168], 1, 10, -1),
- ?line "\"\\b\\t\\n\\v\\f\\r\\e\250\"" =
- p([8,9,10,11,12,13,27,168], 1, 40, 100),
- % ?line "\"\\e\\t\\nab\"\n \"cd\"" =
- ?line "\"\\e\\t\\nabcd\"" =
- p("\e\t\nabcd", 1, 12, -1),
+ %% bt(<<"<<\"aaaaaa\"\n \"aaaaaa\"\n \"aaaaaa\"\n \"aaa\">>">>,
+ bt(<<"<<\"aaaaaaaaaaaaaaaaaaaaa\">>">>,
+ p(list_to_binary([$a | L]), 1, 10, -1)),
+ "<<97," ++ _ = p(list_to_binary(L ++ [3]), 1, 10, -1),
+ "<<97," ++ _ = p(list_to_binary(L ++ [3]), 1, 10, 22),
+
+ "\"\\b\\t\\n\\v\\f\\r\\e\250\"" =
+ p([8,9,10,11,12,13,27,168], 1, 40, -1),
+ %% "\"\\b\\t\\n\"\n \"\\v\\f\\r\"\n \"\\e\250\"" =
+ "\"\\b\\t\\n\\v\\f\\r\\e¨\"" =
+ p([8,9,10,11,12,13,27,168], 1, 10, -1),
+ "\"\\b\\t\\n\\v\\f\\r\\e\250\"" =
+ p([8,9,10,11,12,13,27,168], 1, 40, 100),
+ %% "\"\\e\\t\\nab\"\n \"cd\"" =
+ "\"\\e\\t\\nabcd\"" =
+ p("\e\t\nabcd", 1, 12, -1),
%% DEL (127) is special...
- ?line "[127]" = p("\d", 1, 10, -1),
- ?line "[127]" = p([127], 1, 10, 100),
+ "[127]" = p("\d", 1, 10, -1),
+ "[127]" = p([127], 1, 10, 100),
- ?line "<<\"\\b\\t\\n\\v\\f\\r\\e\250\">>" =
- p(<<8,9,10,11,12,13,27,168>>, 1, 40, -1),
- ?line "<<\"\\b\\t\\n\\v\\f\\r\\e\250\">>" =
- p(<<8,9,10,11,12,13,27,168>>, 1, 10, -1),
- ?line "<<127>>" = p(<<127>>, 1, 10, 100),
+ "<<\"\\b\\t\\n\\v\\f\\r\\e\250\">>" =
+ p(<<8,9,10,11,12,13,27,168>>, 1, 40, -1),
+ "<<\"\\b\\t\\n\\v\\f\\r\\e\250\">>" =
+ p(<<8,9,10,11,12,13,27,168>>, 1, 10, -1),
+ "<<127>>" = p(<<127>>, 1, 10, 100),
%% "Partial" string binaries:
- ?line "<<\"he\"...>>" = p(list_to_binary("he"++[3]), 1, 80, 2),
- ?line "<<\"he\"...>>" = p(list_to_binary("he"++[3]), 1, 80, 3),
- ?line "<<104,101,3>>" = p(list_to_binary("he"++[3]), 1, 80, 4),
- ?line "<<...>>" = p(list_to_binary([3] ++ "he"), 1, 80, 1),
- ?line "<<3,...>>" = p(list_to_binary([3] ++ "he"), 1, 80, 2),
- ?line "<<3,104,...>>" = p(list_to_binary([3] ++ "he"), 1, 80, 3),
-
- ?line "<<\"12345678901234567890\"...>>" =
- p(list_to_binary("12345678901234567890"++[3]), 1, 80, 8),
- ?line "<<\"12345678901234567890\"...>>" =
- p(list_to_binary("12345678901234567890"++[3]), 1, 80, 21),
- ?line "<<49," ++ _ =
- p(list_to_binary("12345678901234567890"++[3]), 1, 80, 22),
-
- ?line "{sdfsdfj,\n 23" ++ _ =
- p({sdfsdfj,23423423342.23432423}, 1, 17, -1),
-
- ?line bt(<<"kljkljlksdjjlf kljalkjlsdajafasjdfj [kjljklasdf,kjlljsfd,sdfsdkjfsd,kjjsdf,jl,
+ "<<\"he\"...>>" = p(list_to_binary("he"++[3]), 1, 80, 2),
+ "<<\"he\"...>>" = p(list_to_binary("he"++[3]), 1, 80, 3),
+ "<<104,101,3>>" = p(list_to_binary("he"++[3]), 1, 80, 4),
+ "<<...>>" = p(list_to_binary([3] ++ "he"), 1, 80, 1),
+ "<<3,...>>" = p(list_to_binary([3] ++ "he"), 1, 80, 2),
+ "<<3,104,...>>" = p(list_to_binary([3] ++ "he"), 1, 80, 3),
+
+ "<<\"12345678901234567890\"...>>" =
+ p(list_to_binary("12345678901234567890"++[3]), 1, 80, 8),
+ "<<\"12345678901234567890\"...>>" =
+ p(list_to_binary("12345678901234567890"++[3]), 1, 80, 21),
+ "<<49," ++ _ =
+ p(list_to_binary("12345678901234567890"++[3]), 1, 80, 22),
+
+ "{sdfsdfj,\n 23" ++ _ =
+ p({sdfsdfj,23423423342.23432423}, 1, 17, -1),
+
+ bt(<<"kljkljlksdjjlf kljalkjlsdajafasjdfj [kjljklasdf,kjlljsfd,sdfsdkjfsd,kjjsdf,jl,
lkjjlajsfd|jsdf]">>,
fmt("~w ~w ~p",
[kljkljlksdjjlf,
@@ -949,45 +678,36 @@ otp_6354(Config) when is_list(Config) ->
jsdf]])),
%% Binaries are split as well:
- ?line bt(<<"<<80,100,0,55,55,55,55,55,55,55,55,55,\n "
+ bt(<<"<<80,100,0,55,55,55,55,55,55,55,55,55,\n "
"55,55,55,55,55,55,55,...>>">>,
p(<<80,100,0,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,
55,55,55,55,55,55,55,55,55,55,55,55>>,1,40,20)),
- ?line bt(<<"<<80,100,0,55,55,55,55,55,55,55,55,55,\n "
+ bt(<<"<<80,100,0,55,55,55,55,55,55,55,55,55,\n "
"55,55,55,55,55,55,55,55,55,55,55,55,\n 55,55,55,55,55,55>>">>,
p(<<80,100,0,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,
55,55,55,55,55,55,55,55,55,55,55,55>>,1,40,-1)),
- ?line "<<0,0,0,\n ...>>" = p(<<0,0,0,0,0>>, 1, 10, 4),
+ "<<0,0,0,\n ...>>" = p(<<0,0,0,0,0>>, 1, 10, 4),
%% ~W now uses ",..." when printing tuples
- ?line "[a,b|...]" = fmt("~W", [[a,b,c,d,e], 3]),
- ?line "{a,b,...}" = fmt("~W", [{a,b,c,d,e}, 3]),
+ "[a,b|...]" = fmt("~W", [[a,b,c,d,e], 3]),
+ "{a,b,...}" = fmt("~W", [{a,b,c,d,e}, 3]),
ok.
-otp_6495(doc) ->
- ["OTP-6495. io_lib_pretty bugfix."];
-otp_6495(suite) ->
- [];
+%% OTP-6495. io_lib_pretty bugfix.
otp_6495(Config) when is_list(Config) ->
- ?line bt(<<"[120,120,120,120,120,120,120,120,120,120,120,120,120,120,"
+ bt(<<"[120,120,120,120,120,120,120,120,120,120,120,120,120,120,"
"120,120,120,120,120]<<1>>">>,
fmt("~w~p", ["xxxxxxxxxxxxxxxxxxx", <<1>>])),
ok.
-otp_6517(doc) ->
- ["OTP-6517. The Format argument of fwrite can be a binary."];
-otp_6517(suite) ->
- [];
+%% OTP-6517. The Format argument of fwrite can be a binary.
otp_6517(Config) when is_list(Config) ->
- ?line "string" = fmt(<<"~s">>, [<<"string">>]),
+ "string" = fmt(<<"~s">>, [<<"string">>]),
ok.
-otp_6502(doc) ->
- ["OTP-6502. Bits."];
-otp_6502(suite) ->
- [];
+%% OTP-6502. Bits.
otp_6502(Config) when is_list(Config) ->
- ?line bt(<<
+ bt(<<
"[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]"
"<<0,0,8,\n"
" "
@@ -995,10 +715,7 @@ otp_6502(Config) when is_list(Config) ->
fmt("~w~p", [lists:seq(0, 25), <<17:25>>])),
ok.
-otp_7421(doc) ->
- ["OTP-7421. Soft limit of 60 chars removed when pretty printing."];
-otp_7421(suite) ->
- [];
+%% OTP-7421. Soft limit of 60 chars removed when pretty printing.
otp_7421(Config) when is_list(Config) ->
bt(<<"{aa,bb,\n"
" c,dd,\n"
@@ -1066,31 +783,28 @@ rfd(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0) ->
rfd(_, _) ->
no.
-manpage(doc) ->
- ["The examples in io(3) and io_lib(3)."];
-manpage(suite) ->
- [];
+%% The examples in io(3) and io_lib(3).
manpage(Config) when is_list(Config) ->
%% The examples that write or print only, not the ones that read...
- ?line bt(<<"Hello world!\n">>,
+ bt(<<"Hello world!\n">>,
fmt("Hello world!~n", [])),
- ?line bt(<<"| aaaaa|bbbbb |ccccc|\n">>, % bugfix
+ bt(<<"| aaaaa|bbbbb |ccccc|\n">>, % bugfix
fmt("|~10.5c|~-10.5c|~5c|~n", [$a, $b, $c])),
- ?line bt(<<"|**********|\n">>,
+ bt(<<"|**********|\n">>,
fmt("|~10w|~n", [{hey, hey, hey}])),
- ?line bt(<<"|{hey,hey,h|\n">>,
+ bt(<<"|{hey,hey,h|\n">>,
fmt("|~10s|~n", [io_lib:write({hey, hey, hey})])),
T = [{attributes,[[{id,age,1.50000},{mode,explicit},
{typename,"INTEGER"}], [{id,cho},{mode,explicit},{typename,'Cho'}]]},
{typename,'Person'},{tag,{'PRIVATE',3}},{mode,implicit}],
- ?line bt(<<"[{attributes,[[{id,age,1.5},{mode,explicit},{typename,"
+ bt(<<"[{attributes,[[{id,age,1.5},{mode,explicit},{typename,"
"[73,78,84,69,71,69,82]}],[{id,cho},{mode,explicit},"
"{typename,'Cho'}]]},{typename,'Person'},{tag,{'PRIVATE',3}},"
"{mode,implicit}]\n">>,
fmt("~w~n", [T])),
- ?line bt(<<"[{attributes,[[{id,age,1.5},\n"
+ bt(<<"[{attributes,[[{id,age,1.5},\n"
" {mode,explicit},\n"
" {typename,\"INTEGER\"}],\n"
" [{id,cho},{mode,explicit},{typename,'Cho'}]]},\n"
@@ -1098,7 +812,7 @@ manpage(Config) when is_list(Config) ->
" {tag,{'PRIVATE',3}},\n"
" {mode,implicit}]\n">>,
fmt("~62p~n", [T])),
- ?line bt(<<"Here T = [{attributes,[[{id,age,1.5},\n"
+ bt(<<"Here T = [{attributes,[[{id,age,1.5},\n"
" {mode,explicit},\n"
" {typename,\"INTEGER\"}],\n"
" [{id,cho},\n"
@@ -1108,67 +822,64 @@ manpage(Config) when is_list(Config) ->
" {tag,{'PRIVATE',3}},\n"
" {mode,implicit}]\n">>,
fmt("Here T = ~62p~n", [T])),
- ?line bt(<<"[{attributes,[[{id,age,1.5},{mode,explicit},"
+ bt(<<"[{attributes,[[{id,age,1.5},{mode,explicit},"
"{typename,...}],[{id,cho},{mode,...},{...}]]},"
"{typename,'Person'},{tag,{'PRIVATE',3}},{mode,implicit}]\n">>,
fmt("~W~n", [T,9])),
- ?line bt(<<"[{attributes,[[{id,age,1.5},{mode,explicit},{typename,...}],"
+ bt(<<"[{attributes,[[{id,age,1.5},{mode,explicit},{typename,...}],"
"\n "
"[{id,cho},{mode,...},{...}]]},\n {typename,'Person'},\n "
"{tag,{'PRIVATE',3}},\n {mode,implicit}]\n">>,
fmt("~62P~n", [T,9])),
- ?line "1F\n" = fmt("~.16B~n", [31]),
- ?line "-10011\n" = fmt("~.2B~n", [-19]),
- ?line "5Z\n" = fmt("~.36B~n", [5*36+35]),
- ?line "10#31\n" = fmt("~X~n", [31,"10#"]),
- ?line "-0x1F\n" = fmt("~.16X~n", [-31,"0x"]),
- ?line "10#31\n" = fmt("~.10#~n", [31]),
- ?line "-16#1F\n" = fmt("~.16#~n", [-31]),
- ?line "abc def 'abc def' {foo,1} A \n" =
+ "1F\n" = fmt("~.16B~n", [31]),
+ "-10011\n" = fmt("~.2B~n", [-19]),
+ "5Z\n" = fmt("~.36B~n", [5*36+35]),
+ "10#31\n" = fmt("~X~n", [31,"10#"]),
+ "-0x1F\n" = fmt("~.16X~n", [-31,"0x"]),
+ "10#31\n" = fmt("~.10#~n", [31]),
+ "-16#1F\n" = fmt("~.16#~n", [-31]),
+ "abc def 'abc def' {foo,1} A \n" =
fmt("~s ~w ~i ~w ~c ~n",
['abc def', 'abc def', {foo, 1},{foo, 1}, 65]),
- % fmt("~s", [65]),
+ %% fmt("~s", [65]),
%% io_lib(3)
- ?line bt(<<"{1,[2],[3],[...],...}">>,
+ bt(<<"{1,[2],[3],[...],...}">>,
lists:flatten(io_lib:write({1,[2],[3],[4,5],6,7,8,9}, 5))),
ok.
-otp_6708(doc) ->
- ["OTP-6708. Fewer newlines when pretty-printing."];
-otp_6708(suite) ->
- [];
+%% OTP-6708. Fewer newlines when pretty-printing.
otp_6708(Config) when is_list(Config) ->
- ?line bt(<<"[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,\n"
+ bt(<<"[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,\n"
" 23,24,25,26,27,28,29|...]">>,
p(lists:seq(1,1000), 30)),
- ?line bt(<<"{lkjasklfjsdak,mlkasjdflksj,klasdjfklasd,jklasdfjkl,\n"
+ bt(<<"{lkjasklfjsdak,mlkasjdflksj,klasdjfklasd,jklasdfjkl,\n"
" jklsdjfklsd,masdfjkkl}">>,
p({lkjasklfjsdak,mlkasjdflksj,klasdjfklasd,jklasdfjkl,
jklsdjfklsd, masdfjkkl}, -1)),
- ?line bt(<<"#b{f = {lkjljalksdf,jklaskfjd,kljasdlf,kljasdf,kljsdlkf,\n"
+ bt(<<"#b{f = {lkjljalksdf,jklaskfjd,kljasdlf,kljasdf,kljsdlkf,\n"
" kjdd}}">>,
p({b, {lkjljalksdf,jklaskfjd,kljasdlf,kljasdf,kljsdlkf,kjdd}},
-1)),
- ?line bt(<<"#b{f = {lkjljalksdf,jklaskfjd,kljasdlf,kljasdf,kljsdlkf,\n"
+ bt(<<"#b{f = {lkjljalksdf,jklaskfjd,kljasdlf,kljasdf,kljsdlkf,\n"
" kdd}}">>,
p({b, {lkjljalksdf,jklaskfjd,kljasdlf,kljasdf,kljsdlkf,kdd}},
-1)),
- ?line bt(<<"#e{f = undefined,g = undefined,\n"
+ bt(<<"#e{f = undefined,g = undefined,\n"
" h = #e{f = 11,g = 22,h = 333}}">>,
p({e,undefined,undefined,{e,11,22,333}}, -1)),
- ?line bt(<<"[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21|\n"
+ bt(<<"[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21|\n"
" apa11]">>,
p(lists:seq(1,21) ++ apa11, -1)),
- ?line bt(<<"[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,\n"
+ bt(<<"[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,\n"
" 23,\n"
" {{abadalkjlasdjflksdajfksdklfsdjlkfdlskjflsdj"
"flsdjfldsdsdddd}}]">>,
p(lists:seq(1,23) ++
[{{abadalkjlasdjflksdajfksdklfsdjlkfdlskjflsdjflsdjfldsdsdddd}}],
-1)),
- ?line bt(<<"{lkjasdf,\n"
+ bt(<<"{lkjasdf,\n"
" {kjkjsd,\n"
" {kjsd,\n"
" {kljsdf,\n"
@@ -1180,7 +891,7 @@ otp_6708(Config) when is_list(Config) ->
{dkjsdf,{kjlds,
{kljsd,{kljs,{kljlkjsd}}}}}}}}}},
-1)),
- ?line bt(<<"{lkjasdf,\n"
+ bt(<<"{lkjasdf,\n"
" {kjkjsd,\n"
" {kjsd,{kljsdf,{kjlsd,{dkjsdf,{kjlds,"
"{kljsd,{kljs}}}}}}}}}">>,
@@ -1188,24 +899,24 @@ otp_6708(Config) when is_list(Config) ->
{kljsdf,{kjlsd,{dkjsdf,
{kjlds,{kljsd,{kljs}}}}}}}}},
-1)),
- ?line bt(<<"<<1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,\n"
+ bt(<<"<<1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,\n"
" 22,23>>">>,
p(list_to_binary(lists:seq(1,23)), -1)),
- ?line bt(<<"<<100,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,\n"
+ bt(<<"<<100,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,\n"
" 27>>">>,
p(list_to_binary([100|lists:seq(10,27)]), -1)),
- ?line bt(<<"<<100,101,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,\n"
+ bt(<<"<<100,101,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,\n"
" 26>>">>,
p(list_to_binary([100,101|lists:seq(10,26)]), -1)),
- ?line bt(<<"{{<<100,101,102,10,11,12,13,14,15,16,17,18,19,20,21,22,\n"
+ bt(<<"{{<<100,101,102,10,11,12,13,14,15,16,17,18,19,20,21,22,\n"
" 23>>}}">>,
p({{list_to_binary([100,101,102|lists:seq(10,23)])}}, -1)),
- ?line bt(<<"[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22|\n"
+ bt(<<"[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22|\n"
" ap]">>,
p(lists:seq(1,22) ++ ap, -1)),
- ?line bt(<<"[1,2,3,4,5,6,7,8,9,10,{},[],\n <<>>,11,12,13,14,15]">>,
+ bt(<<"[1,2,3,4,5,6,7,8,9,10,{},[],\n <<>>,11,12,13,14,15]">>,
p(lists:seq(1,10) ++ [{},[],<<>>] ++ lists:seq(11,15),1,30,-1)),
- ?line bt(<<"[ddd,ddd,\n"
+ bt(<<"[ddd,ddd,\n"
" {1},\n"
" [1,2],\n"
" ddd,kdfd,\n"
@@ -1215,7 +926,7 @@ otp_6708(Config) when is_list(Config) ->
p([ddd,ddd,{1},[1,2],ddd,kdfd,[[1,2],a,b,c],<<"foo">>,<<"bar">>,
1,{2}],1,50,-1)),
- ?line bt(<<"{dskljsadfkjsdlkjflksdjflksdjfklsdjklfjsdklfjlsdjfkl,jksd,\n"
+ bt(<<"{dskljsadfkjsdlkjflksdjflksdjfklsdjklfjsdklfjlsdjfkl,jksd,\n"
" "
"lkjsdf,kljsdf,kljsf,kljsdf,kljsdf,jkldf,jklsdf,kljsdf,\n"
" "
@@ -1226,7 +937,7 @@ otp_6708(Config) when is_list(Config) ->
lkjsdf,kljsdf,kljsf,kljsdf,kljsdf,jkldf,jklsdf,kljsdf,
kljsdf,jklsdf,lkjfd,lkjsdf,kljsdf,kljsdf,lkjsdf,kljsdf,
lkjsdfsd,kljsdf,kjsfj}, 1, 110, -1)),
- ?line bt(<<"{dskljsadfkjsdlkjflksdjflksdjfklsdjklfjsdklfjlsdjfkl,"
+ bt(<<"{dskljsadfkjsdlkjflksdjflksdjfklsdjklfjsdklfjlsdjfkl,"
"#d{aaaaaaaaaaaaaaaaaaaa = 1,\n"
" "
"bbbbbbbbbbbbbbbbbbbb = 2,cccccccccccccccccccc = 3,\n"
@@ -1239,15 +950,12 @@ otp_6708(Config) when is_list(Config) ->
-define(ONE(N), ((1 bsl N) - 1)).
-define(ALL_ONES, ((1 bsl 52) - 1)).
-otp_7084(doc) ->
- ["OTP-7084. Printing floating point numbers nicely."];
-otp_7084(suite) ->
- [];
+
+otp_7084() ->
+ [{timetrap,{minutes,3}}].
+
+%% OTP-7084. Printing floating point numbers nicely.
otp_7084(Config) when is_list(Config) ->
- OldDog=?config(watchdog, Config),
- test_server:timetrap_cancel(OldDog),
- Timeout = 180,
- ?line Dog = test_server:timetrap({seconds,Timeout}),
L = [{g_warm_up, fun g_warm_up/0},
{g_big_pos_float, fun g_big_pos_float/0},
{g_small_neg_float, fun g_small_neg_float/0},
@@ -1263,7 +971,6 @@ otp_7084(Config) when is_list(Config) ->
catch throw:Reason ->
Reason
end,
- ?line test_server:timetrap_cancel(Dog),
R.
g_warm_up() ->
@@ -1295,7 +1002,7 @@ g_close_to_zero() ->
g_denormalized() ->
%% Denormalized floats (mantissa carry):
-% D = 5,
+%% D = 5,
%% Faster:
D = 1,
[ft({{S,0,?ONE(N)},D,D}) || S <- [0,1], N <- lists:seq(0, 52)],
@@ -1303,7 +1010,7 @@ g_denormalized() ->
g_normalized() ->
%% Normalized floats (exponent carry):
-% D = 5,
+%% D = 5,
%% Faster:
D = 1,
[ft({{S,E,?ONE(52)},D,D}) || S <- [0,1], E <- lists:seq(0, 2045)],
@@ -1322,8 +1029,7 @@ g_choice() ->
g_misc() ->
L_0_308 = lists:seq(0, 308),
L_0_307 = lists:seq(0, 307),
-% L_1_9 = lists:seq(1, 9),
-% L_0_9 = lists:seq(0, 9),
+
%% Faster:
L_1_9 = [1,5,9],
L_0_9 = [0,1,5,9],
@@ -1798,10 +1504,10 @@ pack(Sign, Exp, Frac) ->
%% Whitebox test of io_lib:collect_line/3.
io_lib_collect_line_3_wb(Config) when is_list(Config) ->
- ?line do_collect_line(binary, "\n"),
- ?line do_collect_line(binary, "\r\n"),
- ?line do_collect_line(list, "\n"),
- ?line do_collect_line(list, "\r\n"),
+ do_collect_line(binary, "\n"),
+ do_collect_line(binary, "\r\n"),
+ do_collect_line(list, "\n"),
+ do_collect_line(list, "\r\n"),
ok.
do_collect_line(Mode, Eol) ->
@@ -1860,44 +1566,44 @@ do_collect_line_adjust_rest(Rest, [List|T]) when is_list(List) ->
cr_whitespace_in_string(Config) when is_list(Config) ->
- ?line {ok,["abc"],[]} = io_lib:fread("~s", "\rabc").
+ {ok,["abc"],[]} = io_lib:fread("~s", "\rabc").
io_fread_newlines(Config) when is_list(Config) ->
- ?line PrivDir = ?privdir(Config),
- ?line Fname = filename:join(PrivDir, "io_fread_newlines.txt"),
- ?line F0 = [[0,1,2,3,4,5,6,7,8,9]],
- ?line F1 = [[0,1,2,3,4,5,6,7,8],[9]],
- ?line F2 = [[0,1,2,3,4,5,6,7],[8,9]],
- ?line F3 = [[0,1,2,3,4,5,6],[7,8,9]],
- ?line F4 = [[0,1,2,3,4,5],[6,7,8,9]],
- ?line F5 = [[0,1,2,3,4],[5,6,7,8,9]],
- ?line F6 = [[0,1,2,3],[4,5,6,7],[8,9]],
- ?line F7 = [[0,1,2],[3,4,5],[6,7,8],[9]],
- ?line F8 = [[0,1],[2,3],[4,5],[6,7],[8,9]],
- ?line F9 = [[0],[1],[2],[3],[4],[5],[6],[7],[8],[9]],
- ?line Newlines = ["\n", "\r\n", "\r"],
+ PrivDir = ?privdir(Config),
+ Fname = filename:join(PrivDir, "io_fread_newlines.txt"),
+ F0 = [[0,1,2,3,4,5,6,7,8,9]],
+ F1 = [[0,1,2,3,4,5,6,7,8],[9]],
+ F2 = [[0,1,2,3,4,5,6,7],[8,9]],
+ F3 = [[0,1,2,3,4,5,6],[7,8,9]],
+ F4 = [[0,1,2,3,4,5],[6,7,8,9]],
+ F5 = [[0,1,2,3,4],[5,6,7,8,9]],
+ F6 = [[0,1,2,3],[4,5,6,7],[8,9]],
+ F7 = [[0,1,2],[3,4,5],[6,7,8],[9]],
+ F8 = [[0,1],[2,3],[4,5],[6,7],[8,9]],
+ F9 = [[0],[1],[2],[3],[4],[5],[6],[7],[8],[9]],
+ Newlines = ["\n", "\r\n", "\r"],
try
- ?line io_fread_newlines_1([F0,F1,F2,F3,F4,F5,F6,F7,F8,F9],
+ io_fread_newlines_1([F0,F1,F2,F3,F4,F5,F6,F7,F8,F9],
Fname, Newlines)
after
file:delete(Fname)
end.
io_fread_newlines_1(Fs, Fname, [Newline|Newlines]) ->
- ?line ok = io_fread_newlines_2(Fs, Fname, Newline),
- ?line io_fread_newlines_1(Fs, Fname, Newlines);
+ ok = io_fread_newlines_2(Fs, Fname, Newline),
+ io_fread_newlines_1(Fs, Fname, Newlines);
io_fread_newlines_1(_, _, []) -> ok.
io_fread_newlines_2([F|Fs], Fname, Newline) ->
- ?line N1 = write_newlines_file(Fname, F, Newline),
- ?line {F2,N2} = read_newlines_file(Fname),
- ?line io:format("~w ~p ~w~n~n", [N1,F,N2]),
- ?line F2 = lists:flatten(F),
+ N1 = write_newlines_file(Fname, F, Newline),
+ {F2,N2} = read_newlines_file(Fname),
+ io:format("~w ~p ~w~n~n", [N1,F,N2]),
+ F2 = lists:flatten(F),
%% Intermediate newlines are not counted
- ?line N2 = N1 - (length(F) - 1)*length(Newline),
- ?line io_fread_newlines_2(Fs, Fname, Newline);
+ N2 = N1 - (length(F) - 1)*length(Newline),
+ io_fread_newlines_2(Fs, Fname, Newline);
io_fread_newlines_2([], _, _) -> ok.
@@ -1939,111 +1645,108 @@ read_newlines(Fd, Acc, N0) ->
-otp_8989(doc) ->
- "OTP-8989 io:format for ~F.Ps ignores P in some cases";
+%% OTP-8989 io:format for ~F.Ps ignores P in some cases.
otp_8989(Suite) when is_list(Suite) ->
Hello = "Hello",
- ?line " Hello" = fmt("~6.6s", [Hello]),
- ?line " Hello" = fmt("~*.6s", [6,Hello]),
- ?line " Hello" = fmt("~6.*s", [6,Hello]),
- ?line " Hello" = fmt("~*.*s", [6,6,Hello]),
+ " Hello" = fmt("~6.6s", [Hello]),
+ " Hello" = fmt("~*.6s", [6,Hello]),
+ " Hello" = fmt("~6.*s", [6,Hello]),
+ " Hello" = fmt("~*.*s", [6,6,Hello]),
%%
- ?line " Hello" = fmt("~6.5s", [Hello]),
- ?line " Hello" = fmt("~*.5s", [6,Hello]),
- ?line " Hello" = fmt("~6.*s", [5,Hello]),
- ?line " Hello" = fmt("~*.*s", [6,5,Hello]),
+ " Hello" = fmt("~6.5s", [Hello]),
+ " Hello" = fmt("~*.5s", [6,Hello]),
+ " Hello" = fmt("~6.*s", [5,Hello]),
+ " Hello" = fmt("~*.*s", [6,5,Hello]),
%%
- ?line " Hell" = fmt("~6.4s", [Hello]),
- ?line " Hell" = fmt("~*.4s", [6,Hello]),
- ?line " Hell" = fmt("~6.*s", [4,Hello]),
- ?line " Hell" = fmt("~*.*s", [6,4,Hello]),
+ " Hell" = fmt("~6.4s", [Hello]),
+ " Hell" = fmt("~*.4s", [6,Hello]),
+ " Hell" = fmt("~6.*s", [4,Hello]),
+ " Hell" = fmt("~*.*s", [6,4,Hello]),
%%
- ?line "Hello" = fmt("~5.5s", [Hello]),
- ?line "Hello" = fmt("~*.5s", [5,Hello]),
- ?line "Hello" = fmt("~5.*s", [5,Hello]),
- ?line "Hello" = fmt("~*.*s", [5,5,Hello]),
+ "Hello" = fmt("~5.5s", [Hello]),
+ "Hello" = fmt("~*.5s", [5,Hello]),
+ "Hello" = fmt("~5.*s", [5,Hello]),
+ "Hello" = fmt("~*.*s", [5,5,Hello]),
%%
- ?line " Hell" = fmt("~5.4s", [Hello]),
- ?line " Hell" = fmt("~*.4s", [5,Hello]),
- ?line " Hell" = fmt("~5.*s", [4,Hello]),
- ?line " Hell" = fmt("~*.*s", [5,4,Hello]),
+ " Hell" = fmt("~5.4s", [Hello]),
+ " Hell" = fmt("~*.4s", [5,Hello]),
+ " Hell" = fmt("~5.*s", [4,Hello]),
+ " Hell" = fmt("~*.*s", [5,4,Hello]),
%%
- ?line "Hell" = fmt("~4.4s", [Hello]),
- ?line "Hell" = fmt("~*.4s", [4,Hello]),
- ?line "Hell" = fmt("~4.*s", [4,Hello]),
- ?line "Hell" = fmt("~*.*s", [4,4,Hello]),
+ "Hell" = fmt("~4.4s", [Hello]),
+ "Hell" = fmt("~*.4s", [4,Hello]),
+ "Hell" = fmt("~4.*s", [4,Hello]),
+ "Hell" = fmt("~*.*s", [4,4,Hello]),
%%
- ?line " Hel" = fmt("~4.3s", [Hello]),
- ?line " Hel" = fmt("~*.3s", [4,Hello]),
- ?line " Hel" = fmt("~4.*s", [3,Hello]),
- ?line " Hel" = fmt("~*.*s", [4,3,Hello]),
+ " Hel" = fmt("~4.3s", [Hello]),
+ " Hel" = fmt("~*.3s", [4,Hello]),
+ " Hel" = fmt("~4.*s", [3,Hello]),
+ " Hel" = fmt("~*.*s", [4,3,Hello]),
%%
%%
- ?line "Hello " = fmt("~-6.6s", [Hello]),
- ?line "Hello " = fmt("~*.6s", [-6,Hello]),
- ?line "Hello " = fmt("~-6.*s", [6,Hello]),
- ?line "Hello " = fmt("~*.*s", [-6,6,Hello]),
+ "Hello " = fmt("~-6.6s", [Hello]),
+ "Hello " = fmt("~*.6s", [-6,Hello]),
+ "Hello " = fmt("~-6.*s", [6,Hello]),
+ "Hello " = fmt("~*.*s", [-6,6,Hello]),
%%
- ?line "Hello " = fmt("~-6.5s", [Hello]),
- ?line "Hello " = fmt("~*.5s", [-6,Hello]),
- ?line "Hello " = fmt("~-6.*s", [5,Hello]),
- ?line "Hello " = fmt("~*.*s", [-6,5,Hello]),
+ "Hello " = fmt("~-6.5s", [Hello]),
+ "Hello " = fmt("~*.5s", [-6,Hello]),
+ "Hello " = fmt("~-6.*s", [5,Hello]),
+ "Hello " = fmt("~*.*s", [-6,5,Hello]),
%%
- ?line "Hell " = fmt("~-6.4s", [Hello]),
- ?line "Hell " = fmt("~*.4s", [-6,Hello]),
- ?line "Hell " = fmt("~-6.*s", [4,Hello]),
- ?line "Hell " = fmt("~*.*s", [-6,4,Hello]),
+ "Hell " = fmt("~-6.4s", [Hello]),
+ "Hell " = fmt("~*.4s", [-6,Hello]),
+ "Hell " = fmt("~-6.*s", [4,Hello]),
+ "Hell " = fmt("~*.*s", [-6,4,Hello]),
%%
- ?line "Hello" = fmt("~-5.5s", [Hello]),
- ?line "Hello" = fmt("~*.5s", [-5,Hello]),
- ?line "Hello" = fmt("~-5.*s", [5,Hello]),
- ?line "Hello" = fmt("~*.*s", [-5,5,Hello]),
+ "Hello" = fmt("~-5.5s", [Hello]),
+ "Hello" = fmt("~*.5s", [-5,Hello]),
+ "Hello" = fmt("~-5.*s", [5,Hello]),
+ "Hello" = fmt("~*.*s", [-5,5,Hello]),
%%
- ?line "Hell " = fmt("~-5.4s", [Hello]),
- ?line "Hell " = fmt("~*.4s", [-5,Hello]),
- ?line "Hell " = fmt("~-5.*s", [4,Hello]),
- ?line "Hell " = fmt("~*.*s", [-5,4,Hello]),
+ "Hell " = fmt("~-5.4s", [Hello]),
+ "Hell " = fmt("~*.4s", [-5,Hello]),
+ "Hell " = fmt("~-5.*s", [4,Hello]),
+ "Hell " = fmt("~*.*s", [-5,4,Hello]),
%%
- ?line "Hell" = fmt("~-4.4s", [Hello]),
- ?line "Hell" = fmt("~*.4s", [-4,Hello]),
- ?line "Hell" = fmt("~-4.*s", [4,Hello]),
- ?line "Hell" = fmt("~*.*s", [-4,4,Hello]),
+ "Hell" = fmt("~-4.4s", [Hello]),
+ "Hell" = fmt("~*.4s", [-4,Hello]),
+ "Hell" = fmt("~-4.*s", [4,Hello]),
+ "Hell" = fmt("~*.*s", [-4,4,Hello]),
%%
- ?line "Hel " = fmt("~-4.3s", [Hello]),
- ?line "Hel " = fmt("~*.3s", [-4,Hello]),
- ?line "Hel " = fmt("~-4.*s", [3,Hello]),
- ?line "Hel " = fmt("~*.*s", [-4,3,Hello]),
+ "Hel " = fmt("~-4.3s", [Hello]),
+ "Hel " = fmt("~*.3s", [-4,Hello]),
+ "Hel " = fmt("~-4.*s", [3,Hello]),
+ "Hel " = fmt("~*.*s", [-4,3,Hello]),
ok.
-io_lib_fread_literal(doc) ->
- "OTP-9439 io_lib:fread bug for literate at end";
+%% OTP-9439 io_lib:fread bug for literate at end.
io_lib_fread_literal(Suite) when is_list(Suite) ->
- ?line {more,"~d",0,""} = io_lib:fread("~d", ""),
- ?line {error,{fread,integer}} = io_lib:fread("~d", " "),
- ?line {more,"~d",1,""} = io_lib:fread(" ~d", " "),
- ?line {ok,[17],"X"} = io_lib:fread(" ~d", " 17X"),
+ {more,"~d",0,""} = io_lib:fread("~d", ""),
+ {error,{fread,integer}} = io_lib:fread("~d", " "),
+ {more,"~d",1,""} = io_lib:fread(" ~d", " "),
+ {ok,[17],"X"} = io_lib:fread(" ~d", " 17X"),
%%
- ?line {more,"d",0,""} = io_lib:fread("d", ""),
- ?line {error,{fread,input}} = io_lib:fread("d", " "),
- ?line {more,"d",1,""} = io_lib:fread(" d", " "),
- ?line {ok,[],"X"} = io_lib:fread(" d", " dX"),
+ {more,"d",0,""} = io_lib:fread("d", ""),
+ {error,{fread,input}} = io_lib:fread("d", " "),
+ {more,"d",1,""} = io_lib:fread(" d", " "),
+ {ok,[],"X"} = io_lib:fread(" d", " dX"),
%%
- ?line {done,eof,_} = io_lib:fread([], eof, "~d"),
- ?line {done,eof,_} = io_lib:fread([], eof, " ~d"),
- ?line {more,C1} = io_lib:fread([], " \n", " ~d"),
- ?line {done,{error,{fread,input}},_} = io_lib:fread(C1, eof, " ~d"),
- ?line {done,{ok,[18]},""} = io_lib:fread(C1, "18\n", " ~d"),
+ {done,eof,_} = io_lib:fread([], eof, "~d"),
+ {done,eof,_} = io_lib:fread([], eof, " ~d"),
+ {more,C1} = io_lib:fread([], " \n", " ~d"),
+ {done,{error,{fread,input}},_} = io_lib:fread(C1, eof, " ~d"),
+ {done,{ok,[18]},""} = io_lib:fread(C1, "18\n", " ~d"),
%%
- ?line {done,eof,_} = io_lib:fread([], eof, "d"),
- ?line {done,eof,_} = io_lib:fread([], eof, " d"),
- ?line {more,C2} = io_lib:fread([], " \n", " d"),
- ?line {done,{error,{fread,input}},_} = io_lib:fread(C2, eof, " d"),
- ?line {done,{ok,[]},[]} = io_lib:fread(C2, "d\n", " d"),
+ {done,eof,_} = io_lib:fread([], eof, "d"),
+ {done,eof,_} = io_lib:fread([], eof, " d"),
+ {more,C2} = io_lib:fread([], " \n", " d"),
+ {done,{error,{fread,input}},_} = io_lib:fread(C2, eof, " d"),
+ {done,{ok,[]},[]} = io_lib:fread(C2, "d\n", " d"),
ok.
-printable_range(doc) ->
- "Check that the printable range set by the user actually works";
+%% Check that the printable range set by the user actually works.
printable_range(Suite) when is_list(Suite) ->
Pa = filename:dirname(code:which(?MODULE)),
{ok, UNode} = test_server:start_node(printable_range_unicode, slave,
@@ -2125,27 +1828,37 @@ rpc_call_max(Node, M, F, Args) ->
%% Make sure that a bad specification for a printable range is rejected.
bad_printable_range(Config) when is_list(Config) ->
Cmd = lists:concat([lib:progname()," +pcunnnnnicode -run erlang halt"]),
- case os:cmd(Cmd) of
- "bad range of printable characters" ++ _ ->
- ok;
- String ->
- io:format("~s\n", [String]),
- ?t:fail()
+ P = open_port({spawn, Cmd}, [stderr_to_stdout, {line, 200}]),
+ ok = receive
+ {P, {data, {eol , "bad range of printable characters" ++ _}}} ->
+ ok;
+ Other ->
+ Other
+ after 1000 ->
+ timeout
+ end,
+ catch port_close(P),
+ flush_from_port(P),
+ ok.
+
+flush_from_port(P) ->
+ receive {P, _} ->
+ flush_from_port(P)
+ after 0 ->
+ ok
end.
-io_lib_print_binary_depth_one(doc) ->
- "Test binaries printed with a depth of one behave correctly";
+%% Test binaries printed with a depth of one behave correctly.
io_lib_print_binary_depth_one(Suite) when is_list(Suite) ->
- ?line "<<>>" = fmt("~W", [<<>>, 1]),
- ?line "<<>>" = fmt("~P", [<<>>, 1]),
- ?line "<<...>>" = fmt("~W", [<<1>>, 1]),
- ?line "<<...>>" = fmt("~P", [<<1>>, 1]),
- ?line "<<...>>" = fmt("~W", [<<1:7>>, 1]),
- ?line "<<...>>" = fmt("~P", [<<1:7>>, 1]),
+ "<<>>" = fmt("~W", [<<>>, 1]),
+ "<<>>" = fmt("~P", [<<>>, 1]),
+ "<<...>>" = fmt("~W", [<<1>>, 1]),
+ "<<...>>" = fmt("~P", [<<1>>, 1]),
+ "<<...>>" = fmt("~W", [<<1:7>>, 1]),
+ "<<...>>" = fmt("~P", [<<1:7>>, 1]),
ok.
-otp_10302(doc) ->
- "OTP-10302. Unicode";
+%% OTP-10302. Unicode.
otp_10302(Suite) when is_list(Suite) ->
Pa = filename:dirname(code:which(?MODULE)),
{ok, UNode} = test_server:start_node(printable_range_unicode, slave,
@@ -2201,15 +1914,13 @@ pretty(Term, Opts) when is_list(Opts) ->
is_latin1(S) ->
S >= 0 andalso S =< 255.
-otp_10836(doc) ->
- "OTP-10836. ~ts extended to latin1";
+%% OTP-10836. ~ts extended to latin1.
otp_10836(Suite) when is_list(Suite) ->
S = io_lib:format("~ts", [[<<"äpple"/utf8>>, <<"äpple">>]]),
"äppleäpple" = lists:flatten(S),
ok.
-otp_10755(doc) ->
- "OTP-10755. The 'l' modifier";
+%% OTP-10755. The 'l' modifier
otp_10755(Suite) when is_list(Suite) ->
S = "string",
"\"string\"" = fmt("~p", [S]),
@@ -2253,12 +1964,14 @@ io_lib_width_too_small(_Config) ->
%% Test that the time for a huge message queue is not
%% significantly slower than with an empty message queue.
io_with_huge_message_queue(Config) when is_list(Config) ->
- case test_server:is_native(gen) of
- true ->
+ case {test_server:is_native(gen),test_server:is_cover()} of
+ {true,_} ->
{skip,
"gen is native - huge message queue optimization "
"is not implemented"};
- false ->
+ {_,true} ->
+ {skip,"Running under cover"};
+ {false,false} ->
do_io_with_huge_message_queue(Config)
end.
@@ -2266,26 +1979,42 @@ do_io_with_huge_message_queue(Config) ->
PrivDir = ?privdir(Config),
File = filename:join(PrivDir, "slask"),
{ok, F1} = file:open(File, [write]),
-
- {Time,ok} = timer:tc(fun() -> writes(1000, F1) end),
+ Test = fun(Times) ->
+ {Time,ok} = timer:tc(fun() -> writes(Times, F1) end),
+ Time
+ end,
+ {Times,EmptyTime} = calibrate(100, Test),
[self() ! {msg,N} || N <- lists:seq(1, 500000)],
erlang:garbage_collect(),
- {NewTime,ok} = timer:tc(fun() -> writes(1000, F1) end),
+ FullTime = Test(Times),
file:close(F1),
- io:format("Time for empty message queue: ~p", [Time]),
- io:format("Time for huge message queue: ~p", [NewTime]),
+ file:delete(File),
+ io:format("Number of writes: ~p", [Times]),
+ io:format("Time for empty message queue: ~p", [EmptyTime]),
+ io:format("Time for huge message queue: ~p", [FullTime]),
- IsCover = test_server:is_cover(),
- case (NewTime+1) / (Time+1) of
- Q when Q < 10; IsCover ->
+ case (FullTime+1) / (EmptyTime+1) of
+ Q when Q < 10 ->
ok;
Q ->
io:format("Q = ~p", [Q]),
- ?t:fail()
+ ct:fail(failed)
end,
ok.
+%% Make sure that the time is not too short. That could cause the
+%% test case to fail.
+calibrate(N, Test) when N =< 100000 ->
+ case Test(N) of
+ Time when Time < 50000 ->
+ calibrate(10*N, Test);
+ Time ->
+ {N,Time}
+ end;
+calibrate(N, _) ->
+ N.
+
writes(0, _) -> ok;
writes(N, F1) ->
file:write(F1, "hello\n"),
@@ -2343,7 +2072,7 @@ re_fmt(Pattern, Format, Args) ->
nomatch ->
io:format("Pattern: ~s", [Pattern]),
io:format("Result: ~s", [S]),
- ?t:fail();
+ ct:fail(failed);
match ->
ok
end.
diff --git a/lib/stdlib/test/io_proto_SUITE.erl b/lib/stdlib/test/io_proto_SUITE.erl
index 97e6a90b76..ecd0d44db9 100644
--- a/lib/stdlib/test/io_proto_SUITE.erl
+++ b/lib/stdlib/test/io_proto_SUITE.erl
@@ -39,7 +39,7 @@
-export([uprompt/1]).
-%-define(without_test_server, true).
+%%-define(without_test_server, true).
-ifdef(without_test_server).
-define(line, put(line, ?LINE), ).
@@ -48,7 +48,7 @@
-define(privdir(_), "./io_SUITE_priv").
-else.
-include_lib("common_test/include/ct.hrl").
--define(privdir(Conf), ?config(priv_dir, Conf)).
+-define(privdir(Conf), proplists:get_value(priv_dir, Conf)).
-endif.
%%-define(debug, true).
@@ -57,30 +57,25 @@
-define(format(S, A), io:format(S, A)).
-define(dbg(Data),io:format(standard_error, "DBG: ~p\r\n",[Data])).
-define(RM_RF(Dir),begin io:format(standard_error, "Not Removed: ~p\r\n",[Dir]),
- ok end).
+ ok end).
-else.
-define(format(S, A), ok).
-define(dbg(Data),noop).
-define(RM_RF(Dir),rm_rf(Dir)).
-endif.
-
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(20)).
-
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
Term = os:getenv("TERM", "dumb"),
os:putenv("TERM","vt100"),
- [{watchdog, Dog}, {term, Term} | Config].
+ [{term, Term} | Config].
end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- Term = ?config(term,Config),
+ Term = proplists:get_value(term,Config),
os:putenv("TERM",Term),
- test_server:timetrap_cancel(Dog),
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,20}}].
all() ->
[setopts_getopts, unicode_options, unicode_options_gen,
@@ -110,184 +105,175 @@ end_per_group(_GroupName, Config) ->
q = [],
nxt = eof,
mode = list
- }).
+ }).
uprompt(_L) ->
[1050,1072,1082,1074,1086,32,1077,32,85,110,105,99,111,100,101,32,63].
-unicode_prompt(suite) ->
- [];
-unicode_prompt(doc) ->
- ["Test that an Unicode prompt does not crash the shell"];
+%% Test that an Unicode prompt does not crash the shell.
unicode_prompt(Config) when is_list(Config) ->
- ?line PA = filename:dirname(code:which(?MODULE)),
+ PA = filename:dirname(code:which(?MODULE)),
case proplists:get_value(default_shell,Config) of
old ->
ok;
new ->
- ?line rtnode([{putline,""},
- {putline, "2."},
- {getline, "2"},
- {putline, "shell:prompt_func({io_proto_SUITE,uprompt})."},
- {getline, "default"},
- {putline, "io:get_line('')."},
- {putline, "hej"},
- {getline, "\"hej\\n\""},
- {putline, "io:setopts([{binary,true}])."},
- {getline, "ok"},
- {putline, "io:get_line('')."},
- {putline, "hej"},
- {getline, "<<\"hej\\n\">>"}
- ],[],[],"-pa \""++ PA++"\"")
+ rtnode([{putline,""},
+ {putline, "2."},
+ {getline, "2"},
+ {putline, "shell:prompt_func({io_proto_SUITE,uprompt})."},
+ {getline, "default"},
+ {putline, "io:get_line('')."},
+ {putline, "hej"},
+ {getline, "\"hej\\n\""},
+ {putline, "io:setopts([{binary,true}])."},
+ {getline, "ok"},
+ {putline, "io:get_line('')."},
+ {putline, "hej"},
+ {getline, "<<\"hej\\n\">>"}
+ ],[],[],"-pa \""++ PA++"\"")
end,
%% And one with oldshell
- ?line rtnode([{putline,""},
- {putline, "2."},
- {getline_re, ".*2$"},
- {putline, "shell:prompt_func({io_proto_SUITE,uprompt})."},
- {getline_re, ".*default"},
- {putline, "io:get_line('')."},
- {putline, "hej"},
- {getline_re, ".*\"hej\\\\n\""},
- {putline, "io:setopts([{binary,true}])."},
- {getline_re, ".*ok"},
- {putline, "io:get_line('')."},
- {putline, "hej"},
- {getline_re, ".*<<\"hej\\\\n\">>"}
- ],[],[],"-oldshell -pa \""++PA++"\""),
+ rtnode([{putline,""},
+ {putline, "2."},
+ {getline_re, ".*2$"},
+ {putline, "shell:prompt_func({io_proto_SUITE,uprompt})."},
+ {getline_re, ".*default"},
+ {putline, "io:get_line('')."},
+ {putline, "hej"},
+ {getline_re, ".*\"hej\\\\n\""},
+ {putline, "io:setopts([{binary,true}])."},
+ {getline_re, ".*ok"},
+ {putline, "io:get_line('')."},
+ {putline, "hej"},
+ {getline_re, ".*<<\"hej\\\\n\">>"}
+ ],[],[],"-oldshell -pa \""++PA++"\""),
ok.
-
-setopts_getopts(suite) ->
- [];
-setopts_getopts(doc) ->
- ["Check io:setopts and io:getopts functions"];
+
+%% Check io:setopts and io:getopts functions.
setopts_getopts(Config) when is_list(Config) ->
- ?line FileName = filename:join([?config(priv_dir,Config),
- "io_proto_SUITE_setopts_getopts.dat"]),
- ?line {ok,WFile} = file:open(FileName,[write]),
- ?line Server = start_io_server_proxy(),
- ?line [{binary, false}] = io:getopts(Server),
- ?line [getopts] = proxy_getall(Server),
- ?line [{binary,false},{encoding,latin1}] = lists:sort(io:getopts(WFile)),
- ?line proxy_setnext(Server,"Hej"),
- ?line "Hej" = io:get_line(Server,''),
- ?line proxy_setnext(Server,"Hej"++[532]),
- ?line [$H,$e,$j,532] = io:get_line(Server,''),
- ?line ok = io:setopts(Server,[{binary,true}]),
- ?line proxy_setnext(Server,"Hej"),
- ?line <<"Hej">> = io:get_line(Server,''),
- ?line proxy_setnext(Server,"Hej"++[532]),
- ?line <<72,101,106,200,148>> = io:get_line(Server,''),
- ?line [$H,$e,$j,532] = lists:flatten(io_lib:format("~ts",[<<72,101,106,200,148>>])),
- ?line file:write(WFile,<<"HejA">>),
- ?line file:write(WFile,unicode:characters_to_binary("Hej"++[532],unicode,unicode)),
- ?line file:write(WFile,unicode:characters_to_binary("Hej"++[532],unicode,{utf16,big})),
- ?line file:write(WFile,unicode:characters_to_binary("Hej"++[532],unicode,{utf16,little})),
- ?line file:write(WFile,unicode:characters_to_binary("Hej"++[532],unicode,{utf32,big})),
- ?line file:write(WFile,unicode:characters_to_binary("Hej"++[532],unicode,{utf32,little})),
- ?line file:close(WFile),
- ?line {ok,RFile} = file:open(FileName,[read]),
- ?line [{binary,false},{encoding,latin1}] = lists:sort(io:getopts(RFile)),
- ?line [$H,$e,$j,$A] = io:get_chars(RFile,'',4),
- ?line io:setopts(RFile,[{encoding,unicode}]),
- ?line [$H,$e,$j,532] = io:get_chars(RFile,'',4),
- ?line [{binary,false},{encoding,unicode}] = lists:sort(io:getopts(RFile)),
- ?line io:setopts(RFile,[{encoding,{utf16,big}}]),
- ?line [$H,$e,$j,532] = io:get_chars(RFile,'',4),
- ?line [{binary,false},{encoding,{utf16,big}}] =
+ FileName = filename:join([proplists:get_value(priv_dir,Config),
+ "io_proto_SUITE_setopts_getopts.dat"]),
+ {ok,WFile} = file:open(FileName,[write]),
+ Server = start_io_server_proxy(),
+ [{binary, false}] = io:getopts(Server),
+ [getopts] = proxy_getall(Server),
+ [{binary,false},{encoding,latin1}] = lists:sort(io:getopts(WFile)),
+ proxy_setnext(Server,"Hej"),
+ "Hej" = io:get_line(Server,''),
+ proxy_setnext(Server,"Hej"++[532]),
+ [$H,$e,$j,532] = io:get_line(Server,''),
+ ok = io:setopts(Server,[{binary,true}]),
+ proxy_setnext(Server,"Hej"),
+ <<"Hej">> = io:get_line(Server,''),
+ proxy_setnext(Server,"Hej"++[532]),
+ <<72,101,106,200,148>> = io:get_line(Server,''),
+ [$H,$e,$j,532] = lists:flatten(io_lib:format("~ts",[<<72,101,106,200,148>>])),
+ file:write(WFile,<<"HejA">>),
+ file:write(WFile,unicode:characters_to_binary("Hej"++[532],unicode,unicode)),
+ file:write(WFile,unicode:characters_to_binary("Hej"++[532],unicode,{utf16,big})),
+ file:write(WFile,unicode:characters_to_binary("Hej"++[532],unicode,{utf16,little})),
+ file:write(WFile,unicode:characters_to_binary("Hej"++[532],unicode,{utf32,big})),
+ file:write(WFile,unicode:characters_to_binary("Hej"++[532],unicode,{utf32,little})),
+ file:close(WFile),
+ {ok,RFile} = file:open(FileName,[read]),
+ [{binary,false},{encoding,latin1}] = lists:sort(io:getopts(RFile)),
+ [$H,$e,$j,$A] = io:get_chars(RFile,'',4),
+ io:setopts(RFile,[{encoding,unicode}]),
+ [$H,$e,$j,532] = io:get_chars(RFile,'',4),
+ [{binary,false},{encoding,unicode}] = lists:sort(io:getopts(RFile)),
+ io:setopts(RFile,[{encoding,{utf16,big}}]),
+ [$H,$e,$j,532] = io:get_chars(RFile,'',4),
+ [{binary,false},{encoding,{utf16,big}}] =
lists:sort(io:getopts(RFile)),
- ?line io:setopts(RFile,[{encoding,{utf16,little}}]),
- ?line [$H,$e,$j,532] = io:get_chars(RFile,'',4),
- ?line [{binary,false},{encoding,{utf16,little}}] =
+ io:setopts(RFile,[{encoding,{utf16,little}}]),
+ [$H,$e,$j,532] = io:get_chars(RFile,'',4),
+ [{binary,false},{encoding,{utf16,little}}] =
lists:sort(io:getopts(RFile)),
- ?line io:setopts(RFile,[{encoding,{utf32,big}}]),
- ?line [$H,$e,$j,532] = io:get_chars(RFile,'',4),
- ?line [{binary,false},{encoding,{utf32,big}}] =
+ io:setopts(RFile,[{encoding,{utf32,big}}]),
+ [$H,$e,$j,532] = io:get_chars(RFile,'',4),
+ [{binary,false},{encoding,{utf32,big}}] =
lists:sort(io:getopts(RFile)),
- ?line io:setopts(RFile,[{encoding,{utf32,little}}]),
- ?line [$H,$e,$j,532] = io:get_chars(RFile,'',4),
- ?line [{binary,false},{encoding,{utf32,little}}] =
+ io:setopts(RFile,[{encoding,{utf32,little}}]),
+ [$H,$e,$j,532] = io:get_chars(RFile,'',4),
+ [{binary,false},{encoding,{utf32,little}}] =
lists:sort(io:getopts(RFile)),
- ?line eof = io:get_line(RFile,''),
- ?line file:position(RFile,0),
- ?line io:setopts(RFile,[{binary,true},{encoding,latin1}]),
- ?line <<$H,$e,$j,$A>> = io:get_chars(RFile,'',4),
- ?line [{binary,true},{encoding,latin1}] = lists:sort(io:getopts(RFile)),
- ?line io:setopts(RFile,[{encoding,unicode}]),
- ?line <<$H,$e,$j,532/utf8>> = io:get_chars(RFile,'',4),
- ?line [{binary,true},{encoding,unicode}] = lists:sort(io:getopts(RFile)),
- ?line io:setopts(RFile,[{encoding,{utf16,big}}]),
- ?line <<$H,$e,$j,532/utf8>> = io:get_chars(RFile,'',4),
- ?line [{binary,true},{encoding,{utf16,big}}] =
+ eof = io:get_line(RFile,''),
+ file:position(RFile,0),
+ io:setopts(RFile,[{binary,true},{encoding,latin1}]),
+ <<$H,$e,$j,$A>> = io:get_chars(RFile,'',4),
+ [{binary,true},{encoding,latin1}] = lists:sort(io:getopts(RFile)),
+ io:setopts(RFile,[{encoding,unicode}]),
+ <<$H,$e,$j,532/utf8>> = io:get_chars(RFile,'',4),
+ [{binary,true},{encoding,unicode}] = lists:sort(io:getopts(RFile)),
+ io:setopts(RFile,[{encoding,{utf16,big}}]),
+ <<$H,$e,$j,532/utf8>> = io:get_chars(RFile,'',4),
+ [{binary,true},{encoding,{utf16,big}}] =
lists:sort(io:getopts(RFile)),
- ?line io:setopts(RFile,[{encoding,{utf16,little}}]),
- ?line <<$H,$e,$j,532/utf8>> = io:get_chars(RFile,'',4),
- ?line [{binary,true},{encoding,{utf16,little}}] =
+ io:setopts(RFile,[{encoding,{utf16,little}}]),
+ <<$H,$e,$j,532/utf8>> = io:get_chars(RFile,'',4),
+ [{binary,true},{encoding,{utf16,little}}] =
lists:sort(io:getopts(RFile)),
- ?line io:setopts(RFile,[{encoding,{utf32,big}}]),
- ?line <<$H,$e,$j,532/utf8>> = io:get_chars(RFile,'',4),
- ?line [{binary,true},{encoding,{utf32,big}}] =
+ io:setopts(RFile,[{encoding,{utf32,big}}]),
+ <<$H,$e,$j,532/utf8>> = io:get_chars(RFile,'',4),
+ [{binary,true},{encoding,{utf32,big}}] =
lists:sort(io:getopts(RFile)),
- ?line io:setopts(RFile,[{encoding,{utf32,little}}]),
- ?line <<$H,$e,$j,532/utf8>> = io:get_chars(RFile,'',4),
- ?line [{binary,true},{encoding,{utf32,little}}] =
+ io:setopts(RFile,[{encoding,{utf32,little}}]),
+ <<$H,$e,$j,532/utf8>> = io:get_chars(RFile,'',4),
+ [{binary,true},{encoding,{utf32,little}}] =
lists:sort(io:getopts(RFile)),
- ?line eof = io:get_line(RFile,''),
- ?line file:close(RFile),
+ eof = io:get_line(RFile,''),
+ file:close(RFile),
case proplists:get_value(default_shell,Config) of
old ->
ok;
new ->
%% So, lets test another node with new interactive shell
- ?line rtnode([{putline,""},
- {putline, "2."},
- {getline, "2"},
- {putline, "lists:keyfind(binary,1,io:getopts())."},
- {getline, "{binary,false}"},
- {putline, "io:get_line('')."},
- {putline, "hej"},
- {getline, "\"hej\\n\""},
- {putline, "io:setopts([{binary,true}])."},
- {getline, "ok"},
- {putline, "io:get_line('')."},
- {putline, "hej"},
- {getline, "<<\"hej\\n\">>"}
- ],[])
+ rtnode([{putline,""},
+ {putline, "2."},
+ {getline, "2"},
+ {putline, "lists:keyfind(binary,1,io:getopts())."},
+ {getline, "{binary,false}"},
+ {putline, "io:get_line('')."},
+ {putline, "hej"},
+ {getline, "\"hej\\n\""},
+ {putline, "io:setopts([{binary,true}])."},
+ {getline, "ok"},
+ {putline, "io:get_line('')."},
+ {putline, "hej"},
+ {getline, "<<\"hej\\n\">>"}
+ ],[])
end,
%% And one with oldshell
- ?line rtnode([{putline,""},
- {putline, "2."},
- {getline_re, ".*2$"},
- {putline, "lists:keyfind(binary,1,io:getopts())."},
- {getline_re, ".*{binary,false}"},
- {putline, "io:get_line('')."},
- {putline, "hej"},
- {getline_re, ".*\"hej\\\\n\""},
- {putline, "io:setopts([{binary,true}])."},
- {getline_re, ".*ok"},
- {putline, "io:get_line('')."},
- {putline, "hej"},
- {getline_re, ".*<<\"hej\\\\n\">>"}
- ],[],[],"-oldshell"),
+ rtnode([{putline,""},
+ {putline, "2."},
+ {getline_re, ".*2$"},
+ {putline, "lists:keyfind(binary,1,io:getopts())."},
+ {getline_re, ".*{binary,false}"},
+ {putline, "io:get_line('')."},
+ {putline, "hej"},
+ {getline_re, ".*\"hej\\\\n\""},
+ {putline, "io:setopts([{binary,true}])."},
+ {getline_re, ".*ok"},
+ {putline, "io:get_line('')."},
+ {putline, "hej"},
+ {getline_re, ".*<<\"hej\\\\n\">>"}
+ ],[],[],"-oldshell"),
ok.
get_lc_ctype() ->
- case {os:type(),os:version()} of
- {{unix,sunos},{5,N,_}} when N =< 8 ->
- "iso_8859_1";
- _ ->
- "ISO-8859-1"
- end.
-
-unicode_options(suite) ->
- [];
-unicode_options(doc) ->
- ["Tests various unicode options"];
+ case {os:type(),os:version()} of
+ {{unix,sunos},{5,N,_}} when N =< 8 ->
+ "iso_8859_1";
+ _ ->
+ "ISO-8859-1"
+ end.
+
+%% Test various unicode options.
unicode_options(Config) when is_list(Config) ->
- DataDir = ?config(data_dir,Config),
- PrivDir = ?config(priv_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
+ PrivDir = proplists:get_value(priv_dir,Config),
%% A string in both russian and greek characters, which is present
%% in all the internal test files (but in different formats of course)...
TestData = [1090,1093,1077,32,1073,1080,1075,32,
@@ -322,13 +308,10 @@ unicode_options(Config) when is_list(Config) ->
"external_utf16_little_bom.dat",
"external_utf16_big_bom.dat"],
ReadBomFile = fun(File,Dir) ->
- %io:format(standard_error,"~s\r\n",[filename:join([Dir,File])]),
{ok,F} = file:open(filename:join([Dir,File]),
[read,binary]),
{ok,Bin} = file:read(F,4),
{Type,Bytes} = unicode:bom_to_encoding(Bin),
- %io:format(standard_error,"~p\r\n",[{Type,Bytes}]),
-
file:position(F,Bytes),
io:setopts(F,[{encoding,Type}]),
R = unicode:characters_to_list(
@@ -346,26 +329,26 @@ unicode_options(Config) when is_list(Config) ->
R
end,
ReadBomlessFileList = fun({Type,File},DataLen,Dir) ->
- {ok,F} = file:open(filename:join([Dir,File]),
- [read,
- {encoding,Type}]),
- R = io:get_chars(F,'',DataLen),
- file:close(F),
- R
- end,
+ {ok,F} = file:open(filename:join([Dir,File]),
+ [read,
+ {encoding,Type}]),
+ R = io:get_chars(F,'',DataLen),
+ file:close(F),
+ R
+ end,
ReadBomlessFileListLine = fun({Type,File},Dir) ->
- {ok,F} = file:open(filename:join([Dir,File]),
- [read,
- {encoding,Type}]),
- R = io:get_line(F,''),
- file:close(F),
- R
- end,
- ?line [TestData = ReadBomFile(F,DataDir) || F <- InternalBomFiles ],
- ?line [ExternalTestData = ReadBomFile(F,DataDir) || F <- ExternalBomFiles ],
- ?line [TestData = ReadBomlessFile(F,length(TestData),DataDir) || F <- AllNoBom ],
- ?line [TestData = ReadBomlessFileList(F,length(TestData),DataDir) || F <- AllNoBom ],
- ?line [TestData = ReadBomlessFileListLine(F,DataDir) || F <- AllNoBom ],
+ {ok,F} = file:open(filename:join([Dir,File]),
+ [read,
+ {encoding,Type}]),
+ R = io:get_line(F,''),
+ file:close(F),
+ R
+ end,
+ [TestData = ReadBomFile(F,DataDir) || F <- InternalBomFiles ],
+ [ExternalTestData = ReadBomFile(F,DataDir) || F <- ExternalBomFiles ],
+ [TestData = ReadBomlessFile(F,length(TestData),DataDir) || F <- AllNoBom ],
+ [TestData = ReadBomlessFileList(F,length(TestData),DataDir) || F <- AllNoBom ],
+ [TestData = ReadBomlessFileListLine(F,DataDir) || F <- AllNoBom ],
BomDir = filename:join([PrivDir,"BOMDATA"]),
BomlessDir = filename:join([PrivDir,"BOMLESSDATA"]),
@@ -381,8 +364,8 @@ unicode_options(Config) when is_list(Config) ->
file:close(F),
ok
end,
- ?line [ ok = WriteBomFile(F,BomDir) || F <- AllNoBom ],
- ?line [TestData = ReadBomFile(F,BomDir) || {_,F} <- AllNoBom ],
+ [ ok = WriteBomFile(F,BomDir) || F <- AllNoBom ],
+ [TestData = ReadBomFile(F,BomDir) || {_,F} <- AllNoBom ],
WriteBomlessFile = fun({Enc,File},TData,Dir) ->
{ok,F} = file:open(
filename:join([Dir,File]),
@@ -391,13 +374,13 @@ unicode_options(Config) when is_list(Config) ->
file:close(F),
ok
end,
- ?line [ ok = WriteBomlessFile(F,TestData,BomlessDir) || F <- AllNoBom ],
- ?line [TestData = ReadBomlessFile(F,length(TestData),BomlessDir) || F <- AllNoBom ],
- ?line [TestData = ReadBomlessFileList(F,length(TestData),BomlessDir) || F <- AllNoBom ],
- ?line [TestData = ReadBomlessFileListLine(F,BomlessDir) || F <- AllNoBom ],
-
+ [ ok = WriteBomlessFile(F,TestData,BomlessDir) || F <- AllNoBom ],
+ [TestData = ReadBomlessFile(F,length(TestData),BomlessDir) || F <- AllNoBom ],
+ [TestData = ReadBomlessFileList(F,length(TestData),BomlessDir) || F <- AllNoBom ],
+ [TestData = ReadBomlessFileListLine(F,BomlessDir) || F <- AllNoBom ],
+
CannotReadFile = fun({Enc,File},Dir) ->
- %io:format(standard_error,"~s\r\n",[filename:join([Dir,File])]),
+ %%io:format(standard_error,"~s\r\n",[filename:join([Dir,File])]),
{ok,F} = file:open(
filename:join([Dir,File]),
[read,binary,{encoding,Enc}]),
@@ -414,14 +397,14 @@ unicode_options(Config) when is_list(Config) ->
{error,terminated} = io:get_chars(F,'',10),
ok
end,
- ?line [ ok = CannotReadFile(F,DataDir) || F <- AllNoBom ],
- ?line [ ok = CannotReadFile(F,BomlessDir) || F <- AllNoBom ],
- ?line [ ok = CannotReadFile(F,BomDir) || F <- AllNoBom ],
+ [ ok = CannotReadFile(F,DataDir) || F <- AllNoBom ],
+ [ ok = CannotReadFile(F,BomlessDir) || F <- AllNoBom ],
+ [ ok = CannotReadFile(F,BomDir) || F <- AllNoBom ],
- ?line [ ok = WriteBomlessFile(F,TestData2,BomlessDir) || F <- AllNoBom ],
- ?line [TestData2 = ReadBomlessFile(F,length(TestData2),BomlessDir) || F <- AllNoBom ],
- ?line [TestData2 = ReadBomlessFileList(F,length(TestData2),BomlessDir) || F <- AllNoBom ],
- ?line [TestData2 = ReadBomlessFileListLine(F,BomlessDir) || F <- AllNoBom ],
+ [ ok = WriteBomlessFile(F,TestData2,BomlessDir) || F <- AllNoBom ],
+ [TestData2 = ReadBomlessFile(F,length(TestData2),BomlessDir) || F <- AllNoBom ],
+ [TestData2 = ReadBomlessFileList(F,length(TestData2),BomlessDir) || F <- AllNoBom ],
+ [TestData2 = ReadBomlessFileListLine(F,BomlessDir) || F <- AllNoBom ],
FailDir = filename:join([PrivDir,"FAIL"]),
@@ -431,56 +414,56 @@ unicode_options(Config) when is_list(Config) ->
{ok,F} = file:open(
filename:join([Dir,File]),
[write,binary]),
- ?line {'EXIT', {no_translation,_}} =
+ {'EXIT', {no_translation,_}} =
(catch io:put_chars(F,TestData)),
- ?line {'EXIT', {terminated,_}} = (catch io:put_chars(F,TestData)),
+ {'EXIT', {terminated,_}} = (catch io:put_chars(F,TestData)),
ok
end,
- ?line [ ok = CannotWriteFile(F,FailDir) || F <- AllNoBom ],
+ [ ok = CannotWriteFile(F,FailDir) || F <- AllNoBom ],
case proplists:get_value(default_shell,Config) of
old ->
ok;
new ->
%% OK, time for the group_leaders...
- ?line rtnode([{putline,""},
- {putline, "2."},
- {getline, "2"},
- {putline, "lists:keyfind(encoding,1,io:getopts())."},
- {getline, "{encoding,latin1}"},
- {putline, "io:format(\"~ts~n\",[[1024]])."},
- {getline, "\\x{400}"},
- {putline, "io:setopts([unicode])."},
- {getline, "ok"},
- {putline, "io:format(\"~ts~n\",[[1024]])."},
- {getline,
- binary_to_list(unicode:characters_to_binary(
- [1024],unicode,utf8))}
- ],[],"LC_CTYPE=\""++get_lc_ctype()++"\"; "
- "export LC_CTYPE; ")
+ rtnode([{putline,""},
+ {putline, "2."},
+ {getline, "2"},
+ {putline, "lists:keyfind(encoding,1,io:getopts())."},
+ {getline, "{encoding,latin1}"},
+ {putline, "io:format(\"~ts~n\",[[1024]])."},
+ {getline, "\\x{400}"},
+ {putline, "io:setopts([unicode])."},
+ {getline, "ok"},
+ {putline, "io:format(\"~ts~n\",[[1024]])."},
+ {getline,
+ binary_to_list(unicode:characters_to_binary(
+ [1024],unicode,utf8))}
+ ],[],"LC_CTYPE=\""++get_lc_ctype()++"\"; "
+ "export LC_CTYPE; ")
end,
- ?line rtnode([{putline,""},
- {putline, "2."},
- {getline_re, ".*2$"},
- {putline, "lists:keyfind(encoding,1,io:getopts())."},
- {getline_re, ".*{encoding,latin1}"},
- {putline, "io:format(\"~ts~n\",[[1024]])."},
- {getline_re, ".*\\\\x{400\\}"},
- {putline, "io:setopts([{encoding,unicode}])."},
- {getline_re, ".*ok"},
- {putline, "io:format(\"~ts~n\",[[1024]])."},
- {getline_re,
- ".*"++binary_to_list(unicode:characters_to_binary(
- [1024],unicode,utf8))}
- ],[],"LC_CTYPE=\""++get_lc_ctype()++"\"; export LC_CTYPE; ",
- " -oldshell "),
+ rtnode([{putline,""},
+ {putline, "2."},
+ {getline_re, ".*2$"},
+ {putline, "lists:keyfind(encoding,1,io:getopts())."},
+ {getline_re, ".*{encoding,latin1}"},
+ {putline, "io:format(\"~ts~n\",[[1024]])."},
+ {getline_re, ".*\\\\x{400\\}"},
+ {putline, "io:setopts([{encoding,unicode}])."},
+ {getline_re, ".*ok"},
+ {putline, "io:format(\"~ts~n\",[[1024]])."},
+ {getline_re,
+ ".*"++binary_to_list(unicode:characters_to_binary(
+ [1024],unicode,utf8))}
+ ],[],"LC_CTYPE=\""++get_lc_ctype()++"\"; export LC_CTYPE; ",
+ " -oldshell "),
ok.
-
+
%% Tests various unicode options on random generated files.
unicode_options_gen(Config) when is_list(Config) ->
random:seed(1240, 900586, 553728),
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
AllModes = [utf8,utf16,{utf16,big},{utf16,little},
utf32,{utf32,big},{utf32,little}],
FSize = 9*1024,
@@ -621,7 +604,7 @@ do_read_whole_file(Fname, Options, Fun) ->
Res = do_read_whole_file_1(Fun, F),
ok = file:close(F),
unicode:characters_to_list(Res, unicode).
-
+
do_read_whole_file_1(Fun, F) ->
case Fun(F) of
eof ->
@@ -646,7 +629,7 @@ do_write_read_file(Fname, Options, Encoding, Writer) ->
{ok,Bin} = file:read_file(Fname),
ok = file:delete(Fname),
Bin.
-
+
enc2str(Atom) when is_atom(Atom) ->
atom_to_list(Atom);
enc2str({A1,A2}) when is_atom(A1), is_atom(A2) ->
@@ -656,14 +639,14 @@ enc2str({A1,A2}) when is_atom(A1), is_atom(A2) ->
random_unicode(0) ->
[];
random_unicode(N) ->
- % Favour large unicode and make linebreaks
+ %% Favour large unicode and make linebreaks
X = case random:uniform(20) of
- A when A =< 1 -> $\n;
- A0 when A0 =< 3 -> random:uniform(16#10FFFF);
- A1 when A1 =< 6 -> random:uniform(16#10FFFF - 16#7F) + 16#7F;
- A2 when A2 =< 12 -> random:uniform(16#10FFFF - 16#7FF) + 16#7FF;
- _ -> random:uniform(16#10FFFF - 16#FFFF) + 16#FFFF
- end,
+ A when A =< 1 -> $\n;
+ A0 when A0 =< 3 -> random:uniform(16#10FFFF);
+ A1 when A1 =< 6 -> random:uniform(16#10FFFF - 16#7F) + 16#7F;
+ A2 when A2 =< 12 -> random:uniform(16#10FFFF - 16#7FF) + 16#7FF;
+ _ -> random:uniform(16#10FFFF - 16#FFFF) + 16#FFFF
+ end,
case X of
Inv1 when Inv1 >= 16#D800, Inv1 =< 16#DFFF;
Inv1 =:= 16#FFFE;
@@ -672,15 +655,12 @@ random_unicode(N) ->
_ ->
[X | random_unicode(N-1)]
end.
-
-binary_options(suite) ->
- [];
-binary_options(doc) ->
- ["Tests variants with binary option"];
+
+%% Test variants with binary option.
binary_options(Config) when is_list(Config) ->
- DataDir = ?config(data_dir,Config),
- PrivDir = ?config(priv_dir,Config),
+ DataDir = proplists:get_value(data_dir,Config),
+ PrivDir = proplists:get_value(priv_dir,Config),
TestData = unicode:characters_to_binary(
[1090,1093,1077,32,1073,1080,1075,32,
1088,1077,1076,32,1092,1086,1100,32,1093,
@@ -691,84 +671,79 @@ binary_options(Config) when is_list(Config) ->
First10List = binary_to_list(First10),
Second10List = binary_to_list(Second10),
TestFile = filename:join([DataDir, "testdata_utf8.dat"]),
- ?line {ok, F} = file:open(TestFile,[read]),
- ?line {ok, First10List} = file:read(F,10),
- ?line io:setopts(F,[binary]),
- ?line {ok, Second10} = file:read(F,10),
- ?line file:close(F),
- ?line {ok, F2} = file:open(TestFile,[read,binary]),
- ?line {ok, First10} = file:read(F2,10),
- ?line io:setopts(F2,[list]),
- ?line {ok, Second10List} = file:read(F2,10),
- ?line file:position(F2,0),
- %dbg:tracer(),dbg:p(F2,call),dbg:tpl(file_io_server,x),
- ?line First10List = io:get_chars(F2,'',10),
- ?line io:setopts(F2,[binary]),
- ?line Second10 = unicode:characters_to_binary(io:get_chars(F2,'',10),unicode,latin1),
- ?line file:close(F2),
- ?line LineBreakFileName = filename:join([PrivDir, "testdata.dat"]),
- ?line LineBreakTestData = <<TestData/binary,$\n>>,
- ?line LineBreakTestDataList = binary_to_list(LineBreakTestData),
- ?line file:write_file(LineBreakFileName,[LineBreakTestData,LineBreakTestData,LineBreakTestData,TestData]),
- ?line {ok, F3} = file:open(LineBreakFileName,[read]),
- ?line LineBreakTestDataList = io:get_line(F3,''),
- ?line io:setopts(F3,[binary]),
- ?line LineBreakTestData = unicode:characters_to_binary(io:get_line(F3,''),unicode,latin1),
- ?line io:setopts(F3,[list]),
- ?line LineBreakTestDataList = io:get_line(F3,''),
- ?line io:setopts(F3,[binary]),
- %ok = io:format(standard_error,"TestData = ~w~n",[TestData]),
- ?line TestData = unicode:characters_to_binary(io:get_line(F3,''),unicode,latin1),
- ?line eof = io:get_line(F3,''),
- ?line file:close(F3),
+ {ok, F} = file:open(TestFile,[read]),
+ {ok, First10List} = file:read(F,10),
+ io:setopts(F,[binary]),
+ {ok, Second10} = file:read(F,10),
+ file:close(F),
+ {ok, F2} = file:open(TestFile,[read,binary]),
+ {ok, First10} = file:read(F2,10),
+ io:setopts(F2,[list]),
+ {ok, Second10List} = file:read(F2,10),
+ file:position(F2,0),
+ First10List = io:get_chars(F2,'',10),
+ io:setopts(F2,[binary]),
+ Second10 = unicode:characters_to_binary(io:get_chars(F2,'',10),unicode,latin1),
+ file:close(F2),
+ LineBreakFileName = filename:join([PrivDir, "testdata.dat"]),
+ LineBreakTestData = <<TestData/binary,$\n>>,
+ LineBreakTestDataList = binary_to_list(LineBreakTestData),
+ file:write_file(LineBreakFileName,[LineBreakTestData,LineBreakTestData,LineBreakTestData,TestData]),
+ {ok, F3} = file:open(LineBreakFileName,[read]),
+ LineBreakTestDataList = io:get_line(F3,''),
+ io:setopts(F3,[binary]),
+ LineBreakTestData = unicode:characters_to_binary(io:get_line(F3,''),unicode,latin1),
+ io:setopts(F3,[list]),
+ LineBreakTestDataList = io:get_line(F3,''),
+ io:setopts(F3,[binary]),
+ TestData = unicode:characters_to_binary(io:get_line(F3,''),unicode,latin1),
+ eof = io:get_line(F3,''),
+ file:close(F3),
+
%% OK, time for the group_leaders...
- %% io:format(standard_error,"Hmmm:~w~n",["<<\""++binary_to_list(<<"\345\344\366"/utf8>>)++"\\n\">>"]),
case proplists:get_value(default_shell,Config) of
old ->
ok;
new ->
- ?line rtnode([{putline, "2."},
- {getline, "2"},
- {putline, "lists:keyfind(binary,1,io:getopts())."},
- {getline, "{binary,false}"},
- {putline, "io:get_line('')."},
- {putline, "hej"},
- {getline, "\"hej\\n\""},
- {putline, "io:setopts([{binary,true},unicode])."},
- {getline, "ok"},
- {putline, "io:get_line('')."},
- {putline, "hej"},
- {getline, "<<\"hej\\n\">>"},
- {putline, "io:get_line('')."},
- {putline, binary_to_list(<<"\345\344\366"/utf8>>)},
- {getline, "<<\""++binary_to_list(<<"\345\344\366"/utf8>>)++"\\n\"/utf8>>"}
- ],[])
+ rtnode([{putline, "2."},
+ {getline, "2"},
+ {putline, "lists:keyfind(binary,1,io:getopts())."},
+ {getline, "{binary,false}"},
+ {putline, "io:get_line('')."},
+ {putline, "hej"},
+ {getline, "\"hej\\n\""},
+ {putline, "io:setopts([{binary,true},unicode])."},
+ {getline, "ok"},
+ {putline, "io:get_line('')."},
+ {putline, "hej"},
+ {getline, "<<\"hej\\n\">>"},
+ {putline, "io:get_line('')."},
+ {putline, binary_to_list(<<"\345\344\366"/utf8>>)},
+ {getline, "<<\""++binary_to_list(<<"\345\344\366"/utf8>>)++"\\n\"/utf8>>"}
+ ],[])
end,
- %% And one with oldshell
- ?line rtnode([{putline, "2."},
- {getline_re, ".*2$"},
- {putline, "lists:keyfind(binary,1,io:getopts())."},
- {getline_re, ".*{binary,false}"},
- {putline, "io:get_line('')."},
- {putline, "hej"},
- {getline_re, ".*\"hej\\\\n\""},
- {putline, "io:setopts([{binary,true},unicode])."},
- {getline_re, ".*ok"},
- {putline, "io:get_line('')."},
- {putline, "hej"},
- {getline_re, ".*<<\"hej\\\\n\">>"},
- {putline, "io:get_line('')."},
- {putline, binary_to_list(<<"\345\344\366"/utf8>>)},
- {getline_re, ".*<<\""++binary_to_list(<<"\345\344\366"/utf8>>)++"\\\\n\"/utf8>>"}
- ],[],[],"-oldshell"),
+ %% And one with oldshell
+ rtnode([{putline, "2."},
+ {getline_re, ".*2$"},
+ {putline, "lists:keyfind(binary,1,io:getopts())."},
+ {getline_re, ".*{binary,false}"},
+ {putline, "io:get_line('')."},
+ {putline, "hej"},
+ {getline_re, ".*\"hej\\\\n\""},
+ {putline, "io:setopts([{binary,true},unicode])."},
+ {getline_re, ".*ok"},
+ {putline, "io:get_line('')."},
+ {putline, "hej"},
+ {getline_re, ".*<<\"hej\\\\n\">>"},
+ {putline, "io:get_line('')."},
+ {putline, binary_to_list(<<"\345\344\366"/utf8>>)},
+ {getline_re, ".*<<\""++binary_to_list(<<"\345\344\366"/utf8>>)++"\\\\n\"/utf8>>"}
+ ],[],[],"-oldshell"),
ok.
-bc_with_r12(suite) ->
- [];
-bc_with_r12(doc) ->
- ["Test io protocol compatibility with R12 nodes"];
+%% Test io protocol compatibility with R12 nodes.
bc_with_r12(Config) when is_list(Config) ->
- case ?t:is_release_available("r12b") of
+ case test_server:is_release_available("r12b") of
true -> bc_with_r12_1(Config);
false -> {skip,"No R12B found"}
end.
@@ -776,135 +751,134 @@ bc_with_r12(Config) when is_list(Config) ->
bc_with_r12_1(Config) ->
PA = filename:dirname(code:which(?MODULE)),
Name1 = io_proto_r12_1,
- ?line N1 = list_to_atom(atom_to_list(Name1) ++ "@" ++ hostname()),
- ?line ?t:start_node(Name1, peer, [{args, "-pz \""++PA++"\""},{erl,[{release,"r12b"}]}]),
- DataDir = ?config(data_dir,Config),
- %PrivDir = ?config(priv_dir,Config),
+ N1 = list_to_atom(atom_to_list(Name1) ++ "@" ++ hostname()),
+ test_server:start_node(Name1, peer, [{args, "-pz \""++PA++"\""},
+ {erl,[{release,"r12b"}]}]),
+ DataDir = proplists:get_value(data_dir,Config),
FileName1 = filename:join([DataDir,"testdata_latin1.dat"]),
TestDataLine1 = [229,228,246],
TestDataLine2 = [197,196,214],
- ?line SPid1 = rpc:call(N1,erlang,spawn,[?MODULE,hold_the_line,[self(),FileName1,[read]]]),
- ?line {ok,F1} = receive
- {SPid1,Res1} ->
- Res1
- after 5000 ->
- exit(timeout)
- end,
- ?line TestDataLine1 = chomp(io:get_line(F1,'')),
- ?line SPid1 ! die,
+ SPid1 = rpc:call(N1,erlang,spawn,[?MODULE,hold_the_line,[self(),FileName1,[read]]]),
+ {ok,F1} = receive
+ {SPid1,Res1} ->
+ Res1
+ after 5000 ->
+ exit(timeout)
+ end,
+ TestDataLine1 = chomp(io:get_line(F1,'')),
+ SPid1 ! die,
receive after 1000 -> ok end,
- ?line SPid2 = rpc:call(N1,erlang,spawn,[?MODULE,hold_the_line,[self(),FileName1,[read,binary]]]),
- ?line {ok,F2} = receive
- {SPid2,Res2} ->
- Res2
- after 5000 ->
- exit(timeout)
- end,
+ SPid2 = rpc:call(N1,erlang,spawn,[?MODULE,hold_the_line,[self(),FileName1,[read,binary]]]),
+ {ok,F2} = receive
+ {SPid2,Res2} ->
+ Res2
+ after 5000 ->
+ exit(timeout)
+ end,
TestDataLine1BinUtf = unicode:characters_to_binary(TestDataLine1),
TestDataLine1BinLatin = list_to_binary(TestDataLine1),
TestDataLine2BinUtf = unicode:characters_to_binary(TestDataLine2),
TestDataLine2BinLatin = list_to_binary(TestDataLine2),
- ?line TestDataLine1BinUtf = chomp(io:get_line(F2,'')),
- ?line TestDataLine2BinUtf = chomp(io:get_line(F2,'')),
- %io:format(standard_error,"Exec:~s\r\n",[rpc:call(N1,os,find_executable,["erl"])]),
- %io:format(standard_error,"Io:~s\r\n",[rpc:call(N1,code,which,[io])]),
- %io:format(standard_error,"File_io_server:~s\r\n",[rpc:call(N1,code,which,[file_io_server])]),
- ?line file:position(F2,0),
- ?line TestDataLine1BinLatin = chomp(rpc:call(N1,io,get_line,[F2,''])),
- ?line TestDataLine2BinUtf = chomp(io:get_line(F2,'')),
- ?line file:position(F2,0),
- ?line TestDataLine1BinUtf = chomp(io:get_line(F2,'')),
- ?line TestDataLine2BinLatin = chomp(rpc:call(N1,io,get_line,[F2,''])),
- ?line eof = chomp(rpc:call(N1,io,get_line,[F2,''])),
- ?line file:position(F2,0),
- ?line TestDataLine1BinLatin = rpc:call(N1,io,get_chars,[F2,'',3]),
+ TestDataLine1BinUtf = chomp(io:get_line(F2,'')),
+ TestDataLine2BinUtf = chomp(io:get_line(F2,'')),
+ %%io:format(standard_error,"Exec:~s\r\n",[rpc:call(N1,os,find_executable,["erl"])]),
+ %%io:format(standard_error,"Io:~s\r\n",[rpc:call(N1,code,which,[io])]),
+ %%io:format(standard_error,"File_io_server:~s\r\n",[rpc:call(N1,code,which,[file_io_server])]),
+ file:position(F2,0),
+ TestDataLine1BinLatin = chomp(rpc:call(N1,io,get_line,[F2,''])),
+ TestDataLine2BinUtf = chomp(io:get_line(F2,'')),
+ file:position(F2,0),
+ TestDataLine1BinUtf = chomp(io:get_line(F2,'')),
+ TestDataLine2BinLatin = chomp(rpc:call(N1,io,get_line,[F2,''])),
+ eof = chomp(rpc:call(N1,io,get_line,[F2,''])),
+ file:position(F2,0),
+ TestDataLine1BinLatin = rpc:call(N1,io,get_chars,[F2,'',3]),
io:get_chars(F2,'',1),
- ?line TestDataLine2BinLatin = chomp(rpc:call(N1,io,get_line,[F2,''])),
- ?line file:position(F2,0),
- ?line {ok,[TestDataLine1]} = io:fread(F2,'',"~s"),
- ?line {ok,[TestDataLine2]} = rpc:call(N1,io,fread,[F2,'',"~s"]),
-
- ?line DataLen1 = length(TestDataLine1),
- ?line DataLen2 = length(TestDataLine2),
-
- ?line file:position(F2,0),
- ?line {ok,TestDataLine1BinLatin} = file:read(F2,DataLen1),
- ?line {ok,_} = file:read(F2,1),
- ?line {ok,TestDataLine2BinLatin} = rpc:call(N1,file,read,[F2,DataLen2]),
- ?line {ok,_} = file:read(F2,1),
- ?line eof = rpc:call(N1,file,read,[F2,1]),
+ TestDataLine2BinLatin = chomp(rpc:call(N1,io,get_line,[F2,''])),
+ file:position(F2,0),
+ {ok,[TestDataLine1]} = io:fread(F2,'',"~s"),
+ {ok,[TestDataLine2]} = rpc:call(N1,io,fread,[F2,'',"~s"]),
+
+ DataLen1 = length(TestDataLine1),
+ DataLen2 = length(TestDataLine2),
+
+ file:position(F2,0),
+ {ok,TestDataLine1BinLatin} = file:read(F2,DataLen1),
+ {ok,_} = file:read(F2,1),
+ {ok,TestDataLine2BinLatin} = rpc:call(N1,file,read,[F2,DataLen2]),
+ {ok,_} = file:read(F2,1),
+ eof = rpc:call(N1,file,read,[F2,1]),
%% As r12 has a bug when setting options with setopts, we need
%% to reopen the file...
- ?line SPid2 ! die,
+ SPid2 ! die,
receive after 1000 -> ok end,
- ?line SPid3 = rpc:call(N1,erlang,spawn,[?MODULE,hold_the_line,[self(),FileName1,[read]]]),
- ?line {ok,F3} = receive
- {SPid3,Res3} ->
- Res3
- after 5000 ->
- exit(timeout)
- end,
-
- ?line file:position(F3,0),
- ?line {ok,[TestDataLine1]} = io:fread(F3,'',"~s"),
- ?line {ok,[TestDataLine2]} = rpc:call(N1,io,fread,[F3,'',"~s"]),
-
-
- ?line file:position(F3,0),
- ?line {ok,TestDataLine1} = file:read(F3,DataLen1),
- ?line {ok,_} = file:read(F3,1),
- ?line {ok,TestDataLine2} = rpc:call(N1,file,read,[F3,DataLen2]),
- ?line {ok,_} = file:read(F3,1),
- ?line eof = rpc:call(N1,file,read,[F3,1]),
-
+ SPid3 = rpc:call(N1,erlang,spawn,[?MODULE,hold_the_line,[self(),FileName1,[read]]]),
+ {ok,F3} = receive
+ {SPid3,Res3} ->
+ Res3
+ after 5000 ->
+ exit(timeout)
+ end,
+
+ file:position(F3,0),
+ {ok,[TestDataLine1]} = io:fread(F3,'',"~s"),
+ {ok,[TestDataLine2]} = rpc:call(N1,io,fread,[F3,'',"~s"]),
+
+
+ file:position(F3,0),
+ {ok,TestDataLine1} = file:read(F3,DataLen1),
+ {ok,_} = file:read(F3,1),
+ {ok,TestDataLine2} = rpc:call(N1,file,read,[F3,DataLen2]),
+ {ok,_} = file:read(F3,1),
+ eof = rpc:call(N1,file,read,[F3,1]),
+
%% So, lets do it all again, but the other way around
{ok,F4} = file:open(FileName1,[read]),
- ?line TestDataLine1 = chomp(io:get_line(F4,'')),
- ?line file:position(F4,0),
- ?line io:setopts(F4,[binary]),
- ?line TestDataLine1BinUtf = chomp(io:get_line(F4,'')),
- ?line TestDataLine2BinUtf = chomp(io:get_line(F4,'')),
- ?line file:position(F4,0),
- ?line TestDataLine1BinUtf = chomp(io:get_line(F4,'')),
- ?line TestDataLine2BinUtf = chomp(io:get_line(F4,'')),
- ?line file:position(F4,0),
- %dbg:tracer(),dbg:p(F4,[call,m]),dbg:tpl(file_io_server,x),dbg:tpl(io_lib,x),
- ?line TestDataLine1BinUtf = chomp(io:get_line(F4,'')),
- ?line TestDataLine2BinLatin = chomp(rpc:call(N1,io,get_line,[F4,''])),
- ?line file:position(F4,0),
- ?line TestDataLine1BinLatin = chomp(rpc:call(N1,io,get_line,[F4,''])),
- ?line TestDataLine2BinUtf = chomp(io:get_line(F4,'')),
- ?line eof = chomp(rpc:call(N1,io,get_line,[F4,''])),
- ?line file:position(F4,0),
- ?line TestDataLine1BinLatin = rpc:call(N1,io,get_chars,[F4,'',3]),
+ TestDataLine1 = chomp(io:get_line(F4,'')),
+ file:position(F4,0),
+ io:setopts(F4,[binary]),
+ TestDataLine1BinUtf = chomp(io:get_line(F4,'')),
+ TestDataLine2BinUtf = chomp(io:get_line(F4,'')),
+ file:position(F4,0),
+ TestDataLine1BinUtf = chomp(io:get_line(F4,'')),
+ TestDataLine2BinUtf = chomp(io:get_line(F4,'')),
+ file:position(F4,0),
+ TestDataLine1BinUtf = chomp(io:get_line(F4,'')),
+ TestDataLine2BinLatin = chomp(rpc:call(N1,io,get_line,[F4,''])),
+ file:position(F4,0),
+ TestDataLine1BinLatin = chomp(rpc:call(N1,io,get_line,[F4,''])),
+ TestDataLine2BinUtf = chomp(io:get_line(F4,'')),
+ eof = chomp(rpc:call(N1,io,get_line,[F4,''])),
+ file:position(F4,0),
+ TestDataLine1BinLatin = rpc:call(N1,io,get_chars,[F4,'',3]),
io:get_chars(F4,'',1),
- ?line TestDataLine2BinLatin = chomp(rpc:call(N1,io,get_line,[F4,''])),
- ?line file:position(F4,0),
- ?line {ok,[TestDataLine1]} = io:fread(F4,'',"~s"),
- ?line {ok,[TestDataLine2]} = rpc:call(N1,io,fread,[F4,'',"~s"]),
- ?line file:position(F4,0),
- ?line {ok,TestDataLine1BinLatin} = file:read(F4,DataLen1),
- ?line {ok,_} = file:read(F4,1),
- ?line {ok,TestDataLine2BinLatin} = rpc:call(N1,file,read,[F4,DataLen2]),
- ?line {ok,_} = file:read(F4,1),
- ?line eof = rpc:call(N1,file,read,[F4,1]),
- ?line io:setopts(F4,[list]),
-
- ?line file:position(F4,0),
- ?line {ok,[TestDataLine1]} = io:fread(F4,'',"~s"),
- ?line {ok,[TestDataLine2]} = rpc:call(N1,io,fread,[F4,'',"~s"]),
-
-
- ?line file:position(F4,0),
- ?line {ok,TestDataLine1} = file:read(F4,DataLen1),
- ?line {ok,_} = file:read(F4,1),
- ?line {ok,TestDataLine2} = rpc:call(N1,file,read,[F4,DataLen2]),
- ?line {ok,_} = file:read(F4,1),
- ?line eof = rpc:call(N1,file,read,[F4,1]),
-
+ TestDataLine2BinLatin = chomp(rpc:call(N1,io,get_line,[F4,''])),
+ file:position(F4,0),
+ {ok,[TestDataLine1]} = io:fread(F4,'',"~s"),
+ {ok,[TestDataLine2]} = rpc:call(N1,io,fread,[F4,'',"~s"]),
+ file:position(F4,0),
+ {ok,TestDataLine1BinLatin} = file:read(F4,DataLen1),
+ {ok,_} = file:read(F4,1),
+ {ok,TestDataLine2BinLatin} = rpc:call(N1,file,read,[F4,DataLen2]),
+ {ok,_} = file:read(F4,1),
+ eof = rpc:call(N1,file,read,[F4,1]),
+ io:setopts(F4,[list]),
+
+ file:position(F4,0),
+ {ok,[TestDataLine1]} = io:fread(F4,'',"~s"),
+ {ok,[TestDataLine2]} = rpc:call(N1,io,fread,[F4,'',"~s"]),
+
+
+ file:position(F4,0),
+ {ok,TestDataLine1} = file:read(F4,DataLen1),
+ {ok,_} = file:read(F4,1),
+ {ok,TestDataLine2} = rpc:call(N1,file,read,[F4,DataLen2]),
+ {ok,_} = file:read(F4,1),
+ eof = rpc:call(N1,file,read,[F4,1]),
+
file:close(F4),
- ?t:stop_node(N1),
+ test_server:stop_node(N1),
ok.
hold_the_line(Parent,Filename,Options) ->
@@ -913,14 +887,11 @@ hold_the_line(Parent,Filename,Options) ->
die ->
ok
end.
-
-bc_with_r12_gl(suite) ->
- [];
-bc_with_r12_gl(doc) ->
- ["Test io protocol compatibility with R12 nodes (terminals)"];
+
+%% Test io protocol compatibility with R12 nodes (terminals).
bc_with_r12_gl(Config) when is_list(Config) ->
- case ?t:is_release_available("r12b") of
+ case test_server:is_release_available("r12b") of
true ->
case get_progs() of
{error,Reason} ->
@@ -932,12 +903,9 @@ bc_with_r12_gl(Config) when is_list(Config) ->
{skip,"No R12B found"}
end.
-bc_with_r12_ogl(suite) ->
- [];
-bc_with_r12_ogl(doc) ->
- ["Test io protocol compatibility with R12 nodes (oldshell)"];
+%% Test io protocol compatibility with R12 nodes (oldshell).
bc_with_r12_ogl(Config) when is_list(Config) ->
- case ?t:is_release_available("r12b") of
+ case test_server:is_release_available("r12b") of
true ->
case get_progs() of
{error,Reason} ->
@@ -952,8 +920,9 @@ bc_with_r12_ogl(Config) when is_list(Config) ->
bc_with_r12_gl_1(_Config,Machine) ->
PA = filename:dirname(code:which(?MODULE)),
Name1 = io_proto_r12_gl_1,
- ?line N1 = list_to_atom(atom_to_list(Name1) ++ "@" ++ hostname()),
- ?line ?t:start_node(Name1, peer, [{args, "-pz \""++PA++"\""},{erl,[{release,"r12b"}]}]),
+ N1 = list_to_atom(atom_to_list(Name1) ++ "@" ++ hostname()),
+ test_server:start_node(Name1, peer, [{args, "-pz \""++PA++"\""},
+ {erl,[{release,"r12b"}]}]),
TestDataLine1 = [229,228,246],
TestDataLine1BinUtf = unicode:characters_to_binary(TestDataLine1),
TestDataLine1BinLatin = list_to_binary(TestDataLine1),
@@ -963,141 +932,141 @@ bc_with_r12_gl_1(_Config,Machine) ->
register(io_proto_suite,self()),
AM1 = spawn(?MODULE,Machine,
[MyNodeList, "io_proto_suite", N2List]),
-
- ?line GL = receive X when is_pid(X) -> X end,
+
+ GL = receive X when is_pid(X) -> X end,
%% get_line
- ?line "Hej\n" = rpc:call(N1,io,get_line,[GL,"Prompt\n"]),
- ?line io:setopts(GL,[binary]),
- ?line io:format(GL,"Okej~n",[]),
- ?line <<"Hej\n">> = rpc:call(N1,io,get_line,[GL,"Prompt\n"]),
- ?line io:setopts(GL,[{encoding,latin1}]),
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinLatin = chomp(rpc:call(N1,io,get_line,[GL,"Prompt\n"])),
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinUtf = chomp(io:get_line(GL,"Prompt\n")),
- ?line io:setopts(GL,[{encoding,unicode}]),
-
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinLatin = chomp(rpc:call(N1,io,get_line,[GL,"Prompt\n"])),
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinUtf = chomp(io:get_line(GL,"Prompt\n")),
- ?line io:setopts(GL,[list]),
- ?line io:format(GL,"Okej~n",[]),
-
+ "Hej\n" = rpc:call(N1,io,get_line,[GL,"Prompt\n"]),
+ io:setopts(GL,[binary]),
+ io:format(GL,"Okej~n",[]),
+ <<"Hej\n">> = rpc:call(N1,io,get_line,[GL,"Prompt\n"]),
+ io:setopts(GL,[{encoding,latin1}]),
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinLatin = chomp(rpc:call(N1,io,get_line,[GL,"Prompt\n"])),
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinUtf = chomp(io:get_line(GL,"Prompt\n")),
+ io:setopts(GL,[{encoding,unicode}]),
+
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinLatin = chomp(rpc:call(N1,io,get_line,[GL,"Prompt\n"])),
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinUtf = chomp(io:get_line(GL,"Prompt\n")),
+ io:setopts(GL,[list]),
+ io:format(GL,"Okej~n",[]),
+
%%get_chars
- ?line "Hej" = rpc:call(N1,io,get_chars,[GL,"Prompt\n",3]),
- ?line io:setopts(GL,[binary]),
- ?line io:format(GL,"Okej~n",[]),
- ?line <<"Hej">> = rpc:call(N1,io,get_chars,[GL,"Prompt\n",3]),
- ?line io:setopts(GL,[{encoding,latin1}]),
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinLatin = rpc:call(N1,io,get_chars,[GL,"Prompt\n",3]),
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinUtf = io:get_chars(GL,"Prompt\n",3),
- ?line io:setopts(GL,[{encoding,unicode}]),
-
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinLatin = rpc:call(N1,io,get_chars,[GL,"Prompt\n",3]),
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinUtf = io:get_chars(GL,"Prompt\n",3),
- ?line io:setopts(GL,[list]),
- ?line io:format(GL,"Okej~n",[]),
+ "Hej" = rpc:call(N1,io,get_chars,[GL,"Prompt\n",3]),
+ io:setopts(GL,[binary]),
+ io:format(GL,"Okej~n",[]),
+ <<"Hej">> = rpc:call(N1,io,get_chars,[GL,"Prompt\n",3]),
+ io:setopts(GL,[{encoding,latin1}]),
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinLatin = rpc:call(N1,io,get_chars,[GL,"Prompt\n",3]),
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinUtf = io:get_chars(GL,"Prompt\n",3),
+ io:setopts(GL,[{encoding,unicode}]),
+
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinLatin = rpc:call(N1,io,get_chars,[GL,"Prompt\n",3]),
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinUtf = io:get_chars(GL,"Prompt\n",3),
+ io:setopts(GL,[list]),
+ io:format(GL,"Okej~n",[]),
%%fread
- ?line {ok,["Hej"]} = rpc:call(N1,io,fread,[GL,"Prompt\n","~s"]),
- ?line io:setopts(GL,[binary]),
- ?line io:format(GL,"Okej~n",[]),
- ?line {ok,["Hej"]} = rpc:call(N1,io,fread,[GL,"Prompt\n","~s"]),
- ?line io:setopts(GL,[{encoding,latin1}]),
- ?line io:format(GL,"Okej~n",[]),
- ?line {ok,[TestDataLine1]} = rpc:call(N1,io,fread,[GL,"Prompt\n","~s"]),
- ?line io:format(GL,"Okej~n",[]),
- ?line {ok,[TestDataLine1]} = io:fread(GL,"Prompt\n","~s"),
- ?line io:setopts(GL,[{encoding,unicode}]),
- ?line io:format(GL,"Okej~n",[]),
- ?line {ok,[TestDataLine1]} = rpc:call(N1,io,fread,[GL,"Prompt\n","~s"]),
- ?line io:format(GL,"Okej~n",[]),
- ?line {ok,[TestDataLine1]} = io:fread(GL,"Prompt\n","~s"),
- ?line io:setopts(GL,[list]),
- ?line io:format(GL,"Okej~n",[]),
-
-
- ?line receive
- {AM1,done} ->
- ok
- after 5000 ->
- exit(timeout)
- end,
- ?t:stop_node(N1),
+ {ok,["Hej"]} = rpc:call(N1,io,fread,[GL,"Prompt\n","~s"]),
+ io:setopts(GL,[binary]),
+ io:format(GL,"Okej~n",[]),
+ {ok,["Hej"]} = rpc:call(N1,io,fread,[GL,"Prompt\n","~s"]),
+ io:setopts(GL,[{encoding,latin1}]),
+ io:format(GL,"Okej~n",[]),
+ {ok,[TestDataLine1]} = rpc:call(N1,io,fread,[GL,"Prompt\n","~s"]),
+ io:format(GL,"Okej~n",[]),
+ {ok,[TestDataLine1]} = io:fread(GL,"Prompt\n","~s"),
+ io:setopts(GL,[{encoding,unicode}]),
+ io:format(GL,"Okej~n",[]),
+ {ok,[TestDataLine1]} = rpc:call(N1,io,fread,[GL,"Prompt\n","~s"]),
+ io:format(GL,"Okej~n",[]),
+ {ok,[TestDataLine1]} = io:fread(GL,"Prompt\n","~s"),
+ io:setopts(GL,[list]),
+ io:format(GL,"Okej~n",[]),
+
+
+ receive
+ {AM1,done} ->
+ ok
+ after 5000 ->
+ exit(timeout)
+ end,
+ test_server:stop_node(N1),
ok.
-
+
answering_machine1(OthNode,OthReg,Me) ->
TestDataLine1 = [229,228,246],
TestDataUtf = binary_to_list(unicode:characters_to_binary(TestDataLine1)),
- ?line rtnode([{putline,""},
- {putline, "2."},
- {getline, "2"},
- {putline, "{"++OthReg++","++OthNode++"} ! group_leader()."},
- {getline, "<"},
- % get_line
- {getline_re, ".*Prompt"},
- {putline, "Hej"},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, "Hej"},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataLine1},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataLine1},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataUtf},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataUtf},
- {getline_re, ".*Okej"},
- % get_chars
- {getline_re, ".*Prompt"},
- {putline, "Hej"},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, "Hej"},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataLine1},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataLine1},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataUtf},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataUtf},
- {getline_re, ".*Okej"},
- % fread
- {getline_re, ".*Prompt"},
- {putline, "Hej"},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, "Hej"},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataLine1},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataLine1},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataUtf},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataUtf},
- {getline_re, ".*Okej"}
-
- ],Me,"LC_CTYPE=\""++get_lc_ctype()++"\"; export LC_CTYPE; "),
+ rtnode([{putline,""},
+ {putline, "2."},
+ {getline, "2"},
+ {putline, "{"++OthReg++","++OthNode++"} ! group_leader()."},
+ {getline, "<"},
+ %% get_line
+ {getline_re, ".*Prompt"},
+ {putline, "Hej"},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, "Hej"},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataLine1},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataLine1},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataUtf},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataUtf},
+ {getline_re, ".*Okej"},
+ %% get_chars
+ {getline_re, ".*Prompt"},
+ {putline, "Hej"},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, "Hej"},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataLine1},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataLine1},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataUtf},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataUtf},
+ {getline_re, ".*Okej"},
+ %% fread
+ {getline_re, ".*Prompt"},
+ {putline, "Hej"},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, "Hej"},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataLine1},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataLine1},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataUtf},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataUtf},
+ {getline_re, ".*Okej"}
+
+ ],Me,"LC_CTYPE=\""++get_lc_ctype()++"\"; export LC_CTYPE; "),
O = list_to_atom(OthReg),
O ! {self(),done},
ok.
@@ -1105,79 +1074,76 @@ answering_machine1(OthNode,OthReg,Me) ->
answering_machine2(OthNode,OthReg,Me) ->
TestDataLine1 = [229,228,246],
TestDataUtf = binary_to_list(unicode:characters_to_binary(TestDataLine1)),
- ?line rtnode([{putline,""},
- {putline, "2."},
- {getline, "2"},
- {putline, "{"++OthReg++","++OthNode++"} ! group_leader()."},
- {getline_re, ".*<[0-9].*"},
- % get_line
- {getline_re, ".*Prompt"},
- {putline, "Hej"},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, "Hej"},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataLine1},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataLine1},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataUtf},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataUtf},
- {getline_re, ".*Okej"},
- % get_chars
- {getline_re, ".*Prompt"},
- {putline, "Hej"},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, "Hej"},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataLine1},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataLine1},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataUtf},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataUtf},
- {getline_re, ".*Okej"},
- % fread
- {getline_re, ".*Prompt"},
- {putline, "Hej"},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, "Hej"},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataLine1},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataLine1},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataUtf},
- {getline_re, ".*Okej"},
- {getline_re, ".*Prompt"},
- {putline, TestDataUtf},
- {getline_re, ".*Okej"}
-
- ],Me,"LC_CTYPE=\""++get_lc_ctype()++"\"; export LC_CTYPE; "," -oldshell "),
+ rtnode([{putline,""},
+ {putline, "2."},
+ {getline, "2"},
+ {putline, "{"++OthReg++","++OthNode++"} ! group_leader()."},
+ {getline_re, ".*<[0-9].*"},
+ %% get_line
+ {getline_re, ".*Prompt"},
+ {putline, "Hej"},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, "Hej"},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataLine1},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataLine1},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataUtf},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataUtf},
+ {getline_re, ".*Okej"},
+ %% get_chars
+ {getline_re, ".*Prompt"},
+ {putline, "Hej"},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, "Hej"},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataLine1},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataLine1},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataUtf},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataUtf},
+ {getline_re, ".*Okej"},
+ %% fread
+ {getline_re, ".*Prompt"},
+ {putline, "Hej"},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, "Hej"},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataLine1},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataLine1},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataUtf},
+ {getline_re, ".*Okej"},
+ {getline_re, ".*Prompt"},
+ {putline, TestDataUtf},
+ {getline_re, ".*Okej"}
+
+ ],Me,"LC_CTYPE=\""++get_lc_ctype()++"\"; export LC_CTYPE; "," -oldshell "),
O = list_to_atom(OthReg),
O ! {self(),done},
ok.
-
-read_modes_ogl(suite) ->
- [];
-read_modes_ogl(doc) ->
- ["Test various modes when reading from the group leade from another machine"];
+
+%% Test various modes when reading from the group leade from another machine.
read_modes_ogl(Config) when is_list(Config) ->
case get_progs() of
{error,Reason} ->
@@ -1186,10 +1152,7 @@ read_modes_ogl(Config) when is_list(Config) ->
read_modes_gl_1(Config,answering_machine2)
end.
-read_modes_gl(suite) ->
- [];
-read_modes_gl(doc) ->
- ["Test various modes when reading from the group leade from another machine"];
+%% Test various modes when reading from the group leade from another machine.
read_modes_gl(Config) when is_list(Config) ->
case {get_progs(),proplists:get_value(default_shell,Config)} of
{{error,Reason},_} ->
@@ -1210,81 +1173,78 @@ read_modes_gl_1(_Config,Machine) ->
register(io_proto_suite,self()),
AM1 = spawn(?MODULE,Machine,
[MyNodeList, "io_proto_suite", N2List]),
-
- ?line GL = receive X when is_pid(X) -> X end,
+
+ GL = receive X when is_pid(X) -> X end,
?dbg({group_leader,X}),
%% get_line
- ?line receive after 500 -> ok end, % Dont clash with the new shell...
- ?line "Hej\n" = io:get_line(GL,"Prompt\n"),
- ?line io:setopts(GL,[binary]),
- ?line io:format(GL,"Okej~n",[]),
- ?line <<"Hej\n">> = io:get_line(GL,"Prompt\n"),
- ?line io:setopts(GL,[{encoding,latin1}]),
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinLatin = chomp(io:request(GL,{get_line,latin1,"Prompt\n"})),
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinUtf = chomp(io:get_line(GL,"Prompt\n")),
- ?line io:setopts(GL,[{encoding,unicode}]),
-
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinLatin = chomp(io:request(GL,{get_line,latin1,"Prompt\n"})),
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinUtf = chomp(io:get_line(GL,"Prompt\n")),
- ?line io:setopts(GL,[list]),
- ?line io:format(GL,"Okej~n",[]),
-
+ receive after 500 -> ok end, % Dont clash with the new shell...
+ "Hej\n" = io:get_line(GL,"Prompt\n"),
+ io:setopts(GL,[binary]),
+ io:format(GL,"Okej~n",[]),
+ <<"Hej\n">> = io:get_line(GL,"Prompt\n"),
+ io:setopts(GL,[{encoding,latin1}]),
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinLatin = chomp(io:request(GL,{get_line,latin1,"Prompt\n"})),
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinUtf = chomp(io:get_line(GL,"Prompt\n")),
+ io:setopts(GL,[{encoding,unicode}]),
+
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinLatin = chomp(io:request(GL,{get_line,latin1,"Prompt\n"})),
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinUtf = chomp(io:get_line(GL,"Prompt\n")),
+ io:setopts(GL,[list]),
+ io:format(GL,"Okej~n",[]),
+
%%get_chars
- ?line "Hej" = io:get_chars(GL,"Prompt\n",3),
- ?line io:setopts(GL,[binary]),
- ?line io:format(GL,"Okej~n",[]),
- ?line <<"Hej">> = io:get_chars(GL,"Prompt\n",3),
- ?line io:setopts(GL,[{encoding,latin1}]),
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinLatin = io:request(GL,{get_chars,latin1,"Prompt\n",3}),
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinUtf = io:get_chars(GL,"Prompt\n",3),
- ?line io:setopts(GL,[{encoding,unicode}]),
-
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinLatin = io:request(GL,{get_chars,latin1,"Prompt\n",3}),
- ?line io:format(GL,"Okej~n",[]),
- ?line TestDataLine1BinUtf = io:get_chars(GL,"Prompt\n",3),
- ?line io:setopts(GL,[list]),
- ?line io:format(GL,"Okej~n",[]),
+ "Hej" = io:get_chars(GL,"Prompt\n",3),
+ io:setopts(GL,[binary]),
+ io:format(GL,"Okej~n",[]),
+ <<"Hej">> = io:get_chars(GL,"Prompt\n",3),
+ io:setopts(GL,[{encoding,latin1}]),
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinLatin = io:request(GL,{get_chars,latin1,"Prompt\n",3}),
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinUtf = io:get_chars(GL,"Prompt\n",3),
+ io:setopts(GL,[{encoding,unicode}]),
+
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinLatin = io:request(GL,{get_chars,latin1,"Prompt\n",3}),
+ io:format(GL,"Okej~n",[]),
+ TestDataLine1BinUtf = io:get_chars(GL,"Prompt\n",3),
+ io:setopts(GL,[list]),
+ io:format(GL,"Okej~n",[]),
%%fread
- ?line {ok,["Hej"]} = io:fread(GL,"Prompt\n","~s"),
- ?line io:setopts(GL,[binary]),
- ?line io:format(GL,"Okej~n",[]),
- ?line {ok,["Hej"]} = io:fread(GL,"Prompt\n","~s"),
- ?line io:setopts(GL,[{encoding,latin1}]),
- ?line io:format(GL,"Okej~n",[]),
- ?line {ok,[TestDataLine1]} = io:fread(GL,"Prompt\n","~s"),
- ?line io:format(GL,"Okej~n",[]),
- ?line {ok,[TestDataLine1]} = io:fread(GL,"Prompt\n","~s"),
- ?line io:setopts(GL,[{encoding,unicode}]),
- ?line io:format(GL,"Okej~n",[]),
- ?line {ok,[TestDataLine1]} = io:fread(GL,"Prompt\n","~s"),
- ?line io:format(GL,"Okej~n",[]),
- ?line {ok,[TestDataLine1]} = io:fread(GL,"Prompt\n","~s"),
- ?line io:setopts(GL,[list]),
- ?line io:format(GL,"Okej~n",[]),
-
-
- ?line receive
- {AM1,done} ->
- ok
- after 5000 ->
- exit(timeout)
- end,
+ {ok,["Hej"]} = io:fread(GL,"Prompt\n","~s"),
+ io:setopts(GL,[binary]),
+ io:format(GL,"Okej~n",[]),
+ {ok,["Hej"]} = io:fread(GL,"Prompt\n","~s"),
+ io:setopts(GL,[{encoding,latin1}]),
+ io:format(GL,"Okej~n",[]),
+ {ok,[TestDataLine1]} = io:fread(GL,"Prompt\n","~s"),
+ io:format(GL,"Okej~n",[]),
+ {ok,[TestDataLine1]} = io:fread(GL,"Prompt\n","~s"),
+ io:setopts(GL,[{encoding,unicode}]),
+ io:format(GL,"Okej~n",[]),
+ {ok,[TestDataLine1]} = io:fread(GL,"Prompt\n","~s"),
+ io:format(GL,"Okej~n",[]),
+ {ok,[TestDataLine1]} = io:fread(GL,"Prompt\n","~s"),
+ io:setopts(GL,[list]),
+ io:format(GL,"Okej~n",[]),
+
+
+ receive
+ {AM1,done} ->
+ ok
+ after 5000 ->
+ exit(timeout)
+ end,
ok.
-broken_unicode(suite) ->
- [];
-broken_unicode(doc) ->
- ["Test behaviour when reading broken Unicode files"];
+%% Test behaviour when reading broken Unicode files
broken_unicode(Config) when is_list(Config) ->
- Dir = ?config(priv_dir,Config),
+ Dir = proplists:get_value(priv_dir,Config),
Latin1Name = filename:join([Dir,"latin1_data_file.dat"]),
Utf8Name = filename:join([Dir,"utf8_data_file.dat"]),
Latin1Data = iolist_to_binary(lists:duplicate(10,lists:seq(0,255)++[255,255,255])),
@@ -1292,10 +1252,10 @@ broken_unicode(Config) when is_list(Config) ->
lists:duplicate(10,lists:seq(0,255))),
file:write_file(Latin1Name,Latin1Data),
file:write_file(Utf8Name,Utf8Data),
- ?line [ latin1 = heuristic_encoding_file2(Latin1Name,N,utf8) || N <- lists:seq(1,100)++[1024,2048,10000]],
- ?line [ utf8 = heuristic_encoding_file2(Utf8Name,N,utf8) || N <- lists:seq(1,100)++[1024,2048,10000]],
- ?line [ latin1 = heuristic_encoding_file2(Latin1Name,N,utf16) || N <- lists:seq(1,100)++[1024,2048,10000]],
- ?line [ latin1 = heuristic_encoding_file2(Latin1Name,N,utf32) || N <- lists:seq(1,100)++[1024,2048,10000]],
+ [ latin1 = heuristic_encoding_file2(Latin1Name,N,utf8) || N <- lists:seq(1,100)++[1024,2048,10000]],
+ [ utf8 = heuristic_encoding_file2(Utf8Name,N,utf8) || N <- lists:seq(1,100)++[1024,2048,10000]],
+ [ latin1 = heuristic_encoding_file2(Latin1Name,N,utf16) || N <- lists:seq(1,100)++[1024,2048,10000]],
+ [ latin1 = heuristic_encoding_file2(Latin1Name,N,utf32) || N <- lists:seq(1,100)++[1024,2048,10000]],
ok.
@@ -1314,10 +1274,7 @@ loop_through_file2(F,Bin,Chunk,Enc) when is_binary(Bin) ->
-eof_on_pipe(suite) ->
- [];
-eof_on_pipe(doc) ->
- ["tests eof before newline on stdin when erlang is in pipe"];
+%% Test eof before newline on stdin when erlang is in pipe.
eof_on_pipe(Config) when is_list(Config) ->
case {get_progs(),os:type()} of
{{error,Reason},_} ->
@@ -1337,10 +1294,10 @@ eof_on_pipe(Config) when is_list(Config) ->
end
end,
CommandLine1 = EchoLine ++
- "\""++Erl++"\" -noshell -eval "
- "'io:format(\"~p\",[io:get_line(\"\")]),"
- "io:format(\"~p\",[io:get_line(\"\")]),"
- "io:format(\"~p\",[io:get_line(\"\")]).' -run init stop",
+ "\""++Erl++"\" -noshell -eval "
+ "'io:format(\"~p\",[io:get_line(\"\")]),"
+ "io:format(\"~p\",[io:get_line(\"\")]),"
+ "io:format(\"~p\",[io:get_line(\"\")]).' -run init stop",
case os:cmd(CommandLine1) of
"\"a\\n\"\"bu\"eof" ->
ok;
@@ -1348,10 +1305,10 @@ eof_on_pipe(Config) when is_list(Config) ->
exit({unexpected1,Other1})
end,
CommandLine2 = EchoLine ++
- "\""++Erl++"\" -noshell -eval "
- "'io:setopts([binary]),io:format(\"~p\",[io:get_line(\"\")]),"
- "io:format(\"~p\",[io:get_line(\"\")]),"
- "io:format(\"~p\",[io:get_line(\"\")]).' -run init stop",
+ "\""++Erl++"\" -noshell -eval "
+ "'io:setopts([binary]),io:format(\"~p\",[io:get_line(\"\")]),"
+ "io:format(\"~p\",[io:get_line(\"\")]),"
+ "io:format(\"~p\",[io:get_line(\"\")]).' -run init stop",
case os:cmd(CommandLine2) of
"<<\"a\\n\">><<\"bu\">>eof" ->
ok;
@@ -1360,12 +1317,12 @@ eof_on_pipe(Config) when is_list(Config) ->
end
catch
throw:skip ->
- {skipped,"unsupported echo program"}
+ {skipped,"unsupported echo program"}
end;
{_,_} ->
{skipped,"Only on linux"}
end.
-
+
%%
%% Tool for running interactive shell (stolen from the kernel
@@ -1435,16 +1392,16 @@ timeout(normal) ->
-ifndef(debug).
rm_rf(Dir) ->
try
- {ok,List} = file:list_dir(Dir),
- Files = [filename:join([Dir,X]) || X <- List],
- [case file:list_dir(Y) of
- {error, enotdir} ->
- ok = file:delete(Y);
- _ ->
- ok = rm_rf(Y)
- end || Y <- Files],
- ok = file:del_dir(Dir),
- ok
+ {ok,List} = file:list_dir(Dir),
+ Files = [filename:join([Dir,X]) || X <- List],
+ [case file:list_dir(Y) of
+ {error, enotdir} ->
+ ok = file:delete(Y);
+ _ ->
+ ok = rm_rf(Y)
+ end || Y <- Files],
+ ok = file:del_dir(Dir),
+ ok
catch
_:Exception -> {error, {Exception,Dir}}
end.
@@ -1509,7 +1466,7 @@ get_and_put(CPid, [{putline_raw, Line}|T],N) ->
Timeout = timeout(normal),
receive
{send_line, ok} ->
- get_and_put(CPid, T,N+1)
+ get_and_put(CPid, T,N+1)
after Timeout ->
error_logger:error_msg("~p: putline_raw timeout (~p) sending "
"\"~s\" (command number ~p)~n",
@@ -1523,7 +1480,7 @@ get_and_put(CPid, [{putline, Line}|T],N) ->
Timeout = timeout(normal),
receive
{send_line, ok} ->
- get_and_put(CPid, [{getline, []}|T],N)
+ get_and_put(CPid, [{getline, []}|T],N)
after Timeout ->
error_logger:error_msg("~p: putline timeout (~p) sending "
"\"~s\" (command number ~p)~n[~p]~n",
@@ -1540,8 +1497,8 @@ wait_for_runerl_server(SPid) ->
after Timeout ->
{error, timeout}
end.
-
-
+
+
stop_runerl_node(CPid) ->
Ref = erlang:monitor(process, CPid),
@@ -1592,11 +1549,11 @@ create_tempdir(Dir,X) when X > $Z, X < $a ->
create_tempdir(Dir,$a);
create_tempdir(Dir,X) when X > $z ->
Estr = lists:flatten(
- io_lib:format("Unable to create ~s, reason eexist",
- [Dir++[$z]])),
+ io_lib:format("Unable to create ~s, reason eexist",
+ [Dir++[$z]])),
{error, Estr};
create_tempdir(Dir0, Ch) ->
- % Expect fairly standard unix.
+ %% Expect fairly standard unix.
Dir = Dir0++[Ch],
case file:make_dir(Dir) of
{error, eexist} ->
@@ -1634,8 +1591,8 @@ start_runerl_node(RunErl,Erl,Tempdir,Nodename,Extra) ->
[];
_ ->
" -sname "++(if is_atom(Nodename) -> atom_to_list(Nodename);
- true -> Nodename
- end)++
+ true -> Nodename
+ end)++
" -setcookie "++atom_to_list(erlang:get_cookie())
end,
XXArg = case Extra of
@@ -1646,9 +1603,9 @@ start_runerl_node(RunErl,Erl,Tempdir,Nodename,Extra) ->
end,
spawn(fun() ->
?dbg("\""++RunErl++"\" "++Tempdir++"/ "++Tempdir++
- " \""++Erl++XArg++XXArg++"\""),
+ " \""++Erl++XArg++XXArg++"\""),
os:cmd("\""++RunErl++"\" "++Tempdir++"/ "++Tempdir++
- " \""++Erl++XArg++XXArg++"\"")
+ " \""++Erl++XArg++XXArg++"\"")
end).
start_toerl_server(ToErl,Tempdir) ->
@@ -1706,7 +1663,7 @@ toerl_loop(Port,Acc) ->
_ ->
toerl_loop(Port,[{Tag0,Data}|Acc])
end;
- {Pid,{get_line,Timeout}} ->
+ {Pid,{get_line,Timeout}} ->
case Acc of
[] ->
case get_data_within(Port,Timeout,[]) of
@@ -1755,10 +1712,10 @@ toerl_loop(Port,Acc) ->
Other ->
{error, {unexpected, Other}}
end.
-
+
millistamp() ->
erlang:monotonic_time(milli_seconds).
-
+
get_data_within(Port, X, Acc) when X =< 0 ->
?dbg({get_data_within, X, Acc, ?LINE}),
receive
@@ -1877,8 +1834,8 @@ request({get_until, Encoding, Prompt, M, F, As}, State) ->
{ok, convert(State#state.nxt, Encoding, State#state.mode), State#state{nxt = eof, q = [{get_until, Encoding, Prompt, M, F, As} | State#state.q]}};
request({get_chars, Encoding, Prompt, N}, State) ->
{ok, convert(State#state.nxt, Encoding, State#state.mode), State#state{nxt = eof,
- q = [{get_chars, Encoding, Prompt, N} |
- State#state.q]}};
+ q = [{get_chars, Encoding, Prompt, N} |
+ State#state.q]}};
request({get_line, Encoding, Prompt}, State) ->
{ok, convert(State#state.nxt, Encoding, State#state.mode),
State#state{nxt = eof,
@@ -1910,7 +1867,7 @@ request(getopts, State) ->
binary -> [{binary, true}]
end, State#state{q=[getopts | State#state.q ]}};
request({requests, Reqs}, State) ->
- multi_request(Reqs, {ok, ok, State}).
+ multi_request(Reqs, {ok, ok, State}).
multi_request([R|Rs], {ok, _Res, State}) ->
multi_request(Rs, request(R, State));
@@ -1941,7 +1898,7 @@ convert(Data, latin1, binary) ->
_ ->
{error, {cannot_convert, unicode, latin1}}
end.
-
+
hostname() ->
from($@, atom_to_list(node())).
diff --git a/lib/stdlib/test/lists_SUITE.erl b/lib/stdlib/test/lists_SUITE.erl
index 257607f734..b21eb37ee3 100644
--- a/lib/stdlib/test/lists_SUITE.erl
+++ b/lib/stdlib/test/lists_SUITE.erl
@@ -24,24 +24,18 @@
-module(lists_SUITE).
-include_lib("common_test/include/ct.hrl").
-
-% Default timetrap timeout (set in init_per_testcase).
-% This should be set relatively high (10-15 times the expected
-% max testcasetime).
--define(default_timeout, ?t:minutes(4)).
-
-% Test server specific exports
+%% Test server specific exports
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2]).
-export([init_per_testcase/2, end_per_testcase/2]).
-% Test cases must be exported.
+%% Test cases must be exported.
-export([member/1, reverse/1,
keymember/1, keysearch_keyfind/1,
keystore/1, keytake/1, keyreplace/1,
append_1/1, append_2/1,
seq_loop/1, seq_2/1, seq_3/1, seq_2_e/1, seq_3_e/1,
-
+
sublist_2/1, sublist_3/1, sublist_2_e/1, sublist_3_e/1,
flatten_1/1, flatten_2/1, flatten_1_e/1, flatten_2_e/1,
dropwhile/1, takewhile/1,
@@ -78,7 +72,9 @@
%%
%% all/1
%%
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,4}}].
all() ->
[{group, append},
@@ -141,58 +137,48 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- ?line Dog=test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-%
-% Test cases starts here.
-%
+%%
+%% Test cases starts here.
+%%
-append_1(doc) -> [];
-append_1(suite) -> [];
append_1(Config) when is_list(Config) ->
- ?line "abcdef"=lists:append(["abc","def"]),
- ?line [hej, du,[glade, [bagare]]]=
+ "abcdef"=lists:append(["abc","def"]),
+ [hej, du,[glade, [bagare]]]=
lists:append([[hej], [du], [[glade, [bagare]]]]),
- ?line [10, [elem]]=lists:append([[10], [[elem]]]),
+ [10, [elem]]=lists:append([[10], [[elem]]]),
ok.
-append_2(doc) -> [];
-append_2(suite) -> [];
append_2(Config) when is_list(Config) ->
- ?line "abcdef"=lists:append("abc", "def"),
- ?line [hej, du]=lists:append([hej], [du]),
- ?line [10, [elem]]=lists:append([10], [[elem]]),
+ "abcdef"=lists:append("abc", "def"),
+ [hej, du]=lists:append([hej], [du]),
+ [10, [elem]]=lists:append([10], [[elem]]),
ok.
-reverse(suite) ->
- [];
-reverse(doc) ->
- ["Tests the lists:reverse() implementation. The function is "
- "`non-blocking', and only processes a fixed number of elements "
- "at a time."];
+%% Tests the lists:reverse() implementation. The function is
+%% `non-blocking', and only processes a fixed number of elements at a
+%% time.
reverse(Config) when is_list(Config) ->
- ?line reverse_test(0),
- ?line reverse_test(1),
- ?line reverse_test(2),
- ?line reverse_test(128),
- ?line reverse_test(256),
- ?line reverse_test(1000),
- ?line reverse_test(1998),
- ?line reverse_test(1999),
- ?line reverse_test(2000),
- ?line reverse_test(2001),
- ?line reverse_test(3998),
- ?line reverse_test(3999),
- ?line reverse_test(4000),
- ?line reverse_test(4001),
- ?line reverse_test(60001),
- ?line reverse_test(100007),
+ reverse_test(0),
+ reverse_test(1),
+ reverse_test(2),
+ reverse_test(128),
+ reverse_test(256),
+ reverse_test(1000),
+ reverse_test(1998),
+ reverse_test(1999),
+ reverse_test(2000),
+ reverse_test(2001),
+ reverse_test(3998),
+ reverse_test(3999),
+ reverse_test(4000),
+ reverse_test(4001),
+ reverse_test(60001),
+ reverse_test(100007),
ok.
reverse_test(0) ->
@@ -210,27 +196,25 @@ reverse_test(Num) ->
List0 = lists:reverse(List),
ok.
-member(doc) ->
- ["Tests the lists:member() implementation."
- "This test case depends on lists:reverse() to work, "
- "wich is tested in a separate test case."];
+%% Test the lists:member() implementation. This test case depends on
+%% lists:reverse() to work, wich is tested in a separate test case.
member(Config) when is_list(Config) ->
- ?line {'EXIT',{badarg,_}} = (catch lists:member(45, {a,b,c})),
- ?line {'EXIT',{badarg,_}} = (catch lists:member(45, [0|non_list_tail])),
- ?line false = lists:member(4233, []),
- ?line member_test(1),
- ?line member_test(100),
- ?line member_test(256),
- ?line member_test(1000),
- ?line member_test(1998),
- ?line member_test(1999),
- ?line member_test(2000),
- ?line member_test(2001),
- ?line member_test(3998),
- ?line member_test(3999),
- ?line member_test(4000),
- ?line member_test(4001),
- ?line member_test(100008),
+ {'EXIT',{badarg,_}} = (catch lists:member(45, {a,b,c})),
+ {'EXIT',{badarg,_}} = (catch lists:member(45, [0|non_list_tail])),
+ false = lists:member(4233, []),
+ member_test(1),
+ member_test(100),
+ member_test(256),
+ member_test(1000),
+ member_test(1998),
+ member_test(1999),
+ member_test(2000),
+ member_test(2001),
+ member_test(3998),
+ member_test(3999),
+ member_test(4000),
+ member_test(4001),
+ member_test(100008),
ok.
member_test(Num) ->
@@ -246,78 +230,78 @@ member_test(Num) ->
false = lists:member({a,b,c}, List).
keymember(Config) when is_list(Config) ->
- ?line false = lists:keymember(anything_goes, 1, []),
- ?line {'EXIT',{badarg,_}} = (catch lists:keymember(anything_goes, -1, [])),
- ?line {'EXIT',{badarg,_}} = (catch lists:keymember(anything_goes, 0, [])),
- ?line {'EXIT',{badarg,_}} = (catch lists:keymember(anything_goes, 1, {1,2,3})),
+ false = lists:keymember(anything_goes, 1, []),
+ {'EXIT',{badarg,_}} = (catch lists:keymember(anything_goes, -1, [])),
+ {'EXIT',{badarg,_}} = (catch lists:keymember(anything_goes, 0, [])),
+ {'EXIT',{badarg,_}} = (catch lists:keymember(anything_goes, 1, {1,2,3})),
List = [{52.0,a},{-19,b,c},{37.5,d},an_atom,42.0,{39},{45,{x,y,z}}],
- ?line false = lists:keymember(333, 5, List),
- ?line false = lists:keymember(333, 999, List),
- ?line false = lists:keymember(37, 1, List),
-
- ?line true = lists:keymember(52.0, 1, List),
- ?line true = lists:keymember(52, 1, List),
- ?line true = lists:keymember(-19, 1, List),
- ?line true = lists:keymember(-19.0, 1, List),
- ?line true = lists:keymember(37.5, 1, List),
- ?line true = lists:keymember(39, 1, List),
- ?line true = lists:keymember(39.0, 1, List),
- ?line true = lists:keymember(45, 1, List),
- ?line true = lists:keymember(45.0, 1, List),
-
- ?line true = lists:keymember(a, 2, List),
- ?line true = lists:keymember(b, 2, List),
- ?line true = lists:keymember(c, 3, List),
- ?line true = lists:keymember(d, 2, List),
- ?line true = lists:keymember({x,y,z}, 2, List),
-
- ?line Long0 = lists:seq(1, 100007),
- ?line false = lists:keymember(kalle, 1, Long0),
- ?line Long = lists:foldl(fun(E, A) -> [{1/E,E}|A] end, [], Long0),
- ?line true = lists:keymember(1, 2, Long),
- ?line true = lists:keymember(2, 2, Long),
- ?line true = lists:keymember(1.0, 2, Long),
- ?line true = lists:keymember(2.0, 2, Long),
- ?line true = lists:keymember(100006, 2, Long),
+ false = lists:keymember(333, 5, List),
+ false = lists:keymember(333, 999, List),
+ false = lists:keymember(37, 1, List),
+
+ true = lists:keymember(52.0, 1, List),
+ true = lists:keymember(52, 1, List),
+ true = lists:keymember(-19, 1, List),
+ true = lists:keymember(-19.0, 1, List),
+ true = lists:keymember(37.5, 1, List),
+ true = lists:keymember(39, 1, List),
+ true = lists:keymember(39.0, 1, List),
+ true = lists:keymember(45, 1, List),
+ true = lists:keymember(45.0, 1, List),
+
+ true = lists:keymember(a, 2, List),
+ true = lists:keymember(b, 2, List),
+ true = lists:keymember(c, 3, List),
+ true = lists:keymember(d, 2, List),
+ true = lists:keymember({x,y,z}, 2, List),
+
+ Long0 = lists:seq(1, 100007),
+ false = lists:keymember(kalle, 1, Long0),
+ Long = lists:foldl(fun(E, A) -> [{1/E,E}|A] end, [], Long0),
+ true = lists:keymember(1, 2, Long),
+ true = lists:keymember(2, 2, Long),
+ true = lists:keymember(1.0, 2, Long),
+ true = lists:keymember(2.0, 2, Long),
+ true = lists:keymember(100006, 2, Long),
ok.
keysearch_keyfind(Config) when is_list(Config) ->
- ?line false = key_search_find(anything_goes, 1, []),
- ?line {'EXIT',{badarg,_}} = (catch key_search_find(anything_goes, -1, [])),
- ?line {'EXIT',{badarg,_}} = (catch key_search_find(anything_goes, 0, [])),
- ?line {'EXIT',{badarg,_}} = (catch key_search_find(anything_goes, 1, {1,2,3})),
+ false = key_search_find(anything_goes, 1, []),
+ {'EXIT',{badarg,_}} = (catch key_search_find(anything_goes, -1, [])),
+ {'EXIT',{badarg,_}} = (catch key_search_find(anything_goes, 0, [])),
+ {'EXIT',{badarg,_}} = (catch key_search_find(anything_goes, 1, {1,2,3})),
First = {x,42.0},
Second = {y,-77},
Third = {z,[a,b,c],{5.0}},
List = [First,Second,Third],
-
- ?line false = key_search_find(333, 1, []),
- ?line false = key_search_find(333, 5, List),
- ?line false = key_search_find(333, 999, List),
- ?line false = key_search_find(37, 1, List),
-
- ?line {value,First} = key_search_find(42, 2, List),
- ?line {value,First} = key_search_find(42.0, 2, List),
-
- ?line {value,Second} = key_search_find(-77, 2, List),
- ?line {value,Second} = key_search_find(-77.0, 2, List),
-
- ?line {value,Third} = key_search_find(z, 1, List),
- ?line {value,Third} = key_search_find([a,b,c], 2, List),
- ?line {value,Third} = key_search_find({5}, 3, List),
- ?line {value,Third} = key_search_find({5.0}, 3, List),
-
- ?line Long0 = lists:seq(1, 100007),
- ?line false = key_search_find(kalle, 1, Long0),
- ?line Long = lists:foldl(fun(E, A) -> [{1/E,float(E)}|A] end, [], Long0),
- ?line {value,{_,1.0}} = key_search_find(1, 2, Long),
- ?line {value,{_,1.0}} = key_search_find(1.0, 2, Long),
- ?line {value,{_,2.0}} = key_search_find(2, 2, Long),
- ?line {value,{_,2.0}} = key_search_find(2.0, 2, Long),
- ?line {value,{_,33988.0}} = key_search_find(33988, 2, Long),
- ?line {value,{_,33988.0}} = key_search_find(33988.0, 2, Long),
+
+ false = key_search_find(333, 1, []),
+ false = key_search_find(333, 5, List),
+ false = key_search_find(333, 999, List),
+ false = key_search_find(37, 1, List),
+
+ {value,First} = key_search_find(42, 2, List),
+ {value,First} = key_search_find(42.0, 2, List),
+
+ {value,Second} = key_search_find(-77, 2, List),
+ {value,Second} = key_search_find(-77.0, 2, List),
+
+ {value,Third} = key_search_find(z, 1, List),
+ {value,Third} = key_search_find([a,b,c], 2, List),
+ {value,Third} = key_search_find({5}, 3, List),
+ {value,Third} = key_search_find({5.0}, 3, List),
+
+ Long0 = lists:seq(1, 100007),
+ false = key_search_find(kalle, 1, Long0),
+ Long = lists:foldl(fun(E, A) -> [{1/E,float(E)}|A] end, [], Long0),
+ {value,{_,1.0}} = key_search_find(1, 2, Long),
+ {value,{_,1.0}} = key_search_find(1.0, 2, Long),
+ {value,{_,2.0}} = key_search_find(2, 2, Long),
+ {value,{_,2.0}} = key_search_find(2.0, 2, Long),
+ {value,{_,33988.0}} = key_search_find(33988, 2, Long),
+ {value,{_,33988.0}} = key_search_find(33988.0, 2, Long),
ok.
%% Test both lists:keysearch/3 and lists:keyfind/3. The only
@@ -333,29 +317,29 @@ key_search_find(Key, Pos, List) ->
end.
dropwhile(Config) when is_list(Config) ->
- ?line F = fun(C) -> C =:= $@ end,
+ F = fun(C) -> C =:= $@ end,
- ?line [] = lists:dropwhile(F, []),
- ?line [a] = lists:dropwhile(F, [a]),
- ?line [a,b] = lists:dropwhile(F, [a,b]),
- ?line [a,b,c] = lists:dropwhile(F, [a,b,c]),
+ [] = lists:dropwhile(F, []),
+ [a] = lists:dropwhile(F, [a]),
+ [a,b] = lists:dropwhile(F, [a,b]),
+ [a,b,c] = lists:dropwhile(F, [a,b,c]),
- ?line [] = lists:dropwhile(F, [$@]),
- ?line [] = lists:dropwhile(F, [$@,$@]),
- ?line [a,$@] = lists:dropwhile(F, [$@,a,$@]),
+ [] = lists:dropwhile(F, [$@]),
+ [] = lists:dropwhile(F, [$@,$@]),
+ [a,$@] = lists:dropwhile(F, [$@,a,$@]),
- ?line [$k] = lists:dropwhile(F, [$@,$k]),
- ?line [$k,$l] = lists:dropwhile(F, [$@,$@,$k,$l]),
- ?line [a] = lists:dropwhile(F, [$@,$@,$@,a]),
+ [$k] = lists:dropwhile(F, [$@,$k]),
+ [$k,$l] = lists:dropwhile(F, [$@,$@,$k,$l]),
+ [a] = lists:dropwhile(F, [$@,$@,$@,a]),
- ?line [a,$@,b] = lists:dropwhile(F, [$@,a,$@,b]),
- ?line [a,$@,b] = lists:dropwhile(F, [$@,$@,a,$@,b]),
- ?line [a,$@,b] = lists:dropwhile(F, [$@,$@,$@,a,$@,b]),
+ [a,$@,b] = lists:dropwhile(F, [$@,a,$@,b]),
+ [a,$@,b] = lists:dropwhile(F, [$@,$@,a,$@,b]),
+ [a,$@,b] = lists:dropwhile(F, [$@,$@,$@,a,$@,b]),
Long = lists:seq(1, 1024),
Shorter = lists:seq(800, 1024),
- ?line Shorter = lists:dropwhile(fun(E) -> E < 800 end, Long),
+ Shorter = lists:dropwhile(fun(E) -> E < 800 end, Long),
ok.
@@ -386,41 +370,35 @@ takewhile(Config) when is_list(Config) ->
ok.
-keystore(doc) ->
- ["OTP-XXX."];
-keystore(suite) -> [];
keystore(Config) when is_list(Config) ->
- ?line {'EXIT',_} = (catch lists:keystore(key, 0, [], {1})),
- ?line {'EXIT',_} = (catch lists:keystore(key, 1, {}, {})),
- ?line {'EXIT',_} = (catch lists:keystore(key, 1, {a,b}, {})),
- ?line {'EXIT', _} = (catch lists:keystore(a, 2, [{1,a}], b)),
+ {'EXIT',_} = (catch lists:keystore(key, 0, [], {1})),
+ {'EXIT',_} = (catch lists:keystore(key, 1, {}, {})),
+ {'EXIT',_} = (catch lists:keystore(key, 1, {a,b}, {})),
+ {'EXIT', _} = (catch lists:keystore(a, 2, [{1,a}], b)),
T = {k,17},
- ?line [T] = lists:keystore(a, 2, [], T),
- ?line [{1,a},{2,b},{k,17}] = lists:keystore(c, 2, [{1,a},{2,b}],T),
+ [T] = lists:keystore(a, 2, [], T),
+ [{1,a},{2,b},{k,17}] = lists:keystore(c, 2, [{1,a},{2,b}],T),
L = [{1,a},{2,b},{3,c}],
- ?line [{k,17},{2,b},{3,c}] = lists:keystore(a, 2, L, T),
- ?line [{1,a},{k,17},{3,c}] = lists:keystore(b, 2, L, T),
- ?line [{1,a},{2,b},{k,17}] = lists:keystore(c, 2, L, T),
- ?line [{2,b}] = lists:keystore(a, 2, [{1,a}], {2,b}),
- ?line [{1,a}] = lists:keystore(foo, 1, [], {1,a}),
+ [{k,17},{2,b},{3,c}] = lists:keystore(a, 2, L, T),
+ [{1,a},{k,17},{3,c}] = lists:keystore(b, 2, L, T),
+ [{1,a},{2,b},{k,17}] = lists:keystore(c, 2, L, T),
+ [{2,b}] = lists:keystore(a, 2, [{1,a}], {2,b}),
+ [{1,a}] = lists:keystore(foo, 1, [], {1,a}),
ok.
-keytake(doc) ->
- ["OTP-XXX."];
-keytake(suite) -> [];
keytake(Config) when is_list(Config) ->
- ?line {'EXIT',_} = (catch lists:keytake(key, 0, [])),
- ?line {'EXIT',_} = (catch lists:keytake(key, 1, {})),
- ?line {'EXIT',_} = (catch lists:keytake(key, 1, {a,b})),
- ?line false = lists:keytake(key, 2, [{a}]),
- ?line false = lists:keytake(key, 1, [a]),
- ?line false = lists:keytake(k, 1, []),
- ?line false = lists:keytake(k, 1, [{a},{b},{c}]),
+ {'EXIT',_} = (catch lists:keytake(key, 0, [])),
+ {'EXIT',_} = (catch lists:keytake(key, 1, {})),
+ {'EXIT',_} = (catch lists:keytake(key, 1, {a,b})),
+ false = lists:keytake(key, 2, [{a}]),
+ false = lists:keytake(key, 1, [a]),
+ false = lists:keytake(k, 1, []),
+ false = lists:keytake(k, 1, [{a},{b},{c}]),
L = [{a,1},{b,2},{c,3}],
- ?line {value,{a,1},[{b,2},{c,3}]} = lists:keytake(1, 2, L),
- ?line {value,{b,2},[{a,1},{c,3}]} = lists:keytake(2, 2, L),
- ?line {value,{c,3},[{a,1},{b,2}]} = lists:keytake(3, 2, L),
- ?line false = lists:keytake(4, 2, L),
+ {value,{a,1},[{b,2},{c,3}]} = lists:keytake(1, 2, L),
+ {value,{b,2},[{a,1},{c,3}]} = lists:keytake(2, 2, L),
+ {value,{c,3},[{a,1},{b,2}]} = lists:keytake(3, 2, L),
+ false = lists:keytake(4, 2, L),
ok.
%% Test lists:keyreplace/4.
@@ -434,153 +412,147 @@ keyreplace(Config) when is_list(Config) ->
{'EXIT',_} = (catch lists:keyreplace(k, 0, [], {a,b})),
ok.
-merge(doc) -> ["merge functions"];
-merge(suite) -> [];
merge(Config) when is_list(Config) ->
%% merge list of lists
- ?line [] = lists:merge([]),
- ?line [] = lists:merge([[]]),
- ?line [] = lists:merge([[],[]]),
- ?line [] = lists:merge([[],[],[]]),
- ?line [1] = lists:merge([[1]]),
- ?line [1,1,2,2] = lists:merge([[1,2],[1,2]]),
- ?line [1] = lists:merge([[1],[],[]]),
- ?line [1] = lists:merge([[],[1],[]]),
- ?line [1] = lists:merge([[],[],[1]]),
- ?line [1,2] = lists:merge([[1],[2],[]]),
- ?line [1,2] = lists:merge([[1],[],[2]]),
- ?line [1,2] = lists:merge([[],[1],[2]]),
- ?line [1,2,3,4,5,6] = lists:merge([[1,2],[],[5,6],[],[3,4],[]]),
- ?line [1,2,3,4] = lists:merge([[4],[3],[2],[1]]),
- ?line [1,2,3,4,5] = lists:merge([[1],[2],[3],[4],[5]]),
- ?line [1,2,3,4,5,6] = lists:merge([[1],[2],[3],[4],[5],[6]]),
- ?line [1,2,3,4,5,6,7,8,9] =
+ [] = lists:merge([]),
+ [] = lists:merge([[]]),
+ [] = lists:merge([[],[]]),
+ [] = lists:merge([[],[],[]]),
+ [1] = lists:merge([[1]]),
+ [1,1,2,2] = lists:merge([[1,2],[1,2]]),
+ [1] = lists:merge([[1],[],[]]),
+ [1] = lists:merge([[],[1],[]]),
+ [1] = lists:merge([[],[],[1]]),
+ [1,2] = lists:merge([[1],[2],[]]),
+ [1,2] = lists:merge([[1],[],[2]]),
+ [1,2] = lists:merge([[],[1],[2]]),
+ [1,2,3,4,5,6] = lists:merge([[1,2],[],[5,6],[],[3,4],[]]),
+ [1,2,3,4] = lists:merge([[4],[3],[2],[1]]),
+ [1,2,3,4,5] = lists:merge([[1],[2],[3],[4],[5]]),
+ [1,2,3,4,5,6] = lists:merge([[1],[2],[3],[4],[5],[6]]),
+ [1,2,3,4,5,6,7,8,9] =
lists:merge([[1],[2],[3],[4],[5],[6],[7],[8],[9]]),
Seq = lists:seq(1,100),
- ?line true = Seq == lists:merge(lists:map(fun(E) -> [E] end, Seq)),
+ true = Seq == lists:merge(lists:map(fun(E) -> [E] end, Seq)),
Two = [1,2],
Six = [1,2,3,4,5,6],
%% 2-way merge
- ?line [] = lists:merge([], []),
- ?line Two = lists:merge(Two, []),
- ?line Two = lists:merge([], Two),
- ?line Six = lists:merge([1,3,5], [2,4,6]),
- ?line Six = lists:merge([2,4,6], [1,3,5]),
- ?line Six = lists:merge([1,2,3], [4,5,6]),
- ?line Six = lists:merge([4,5,6], [1,2,3]),
- ?line Six = lists:merge([1,2,5],[3,4,6]),
- ?line [1,2,3,5,7] = lists:merge([1,3,5,7], [2]),
- ?line [1,2,3,4,5,7] = lists:merge([1,3,5,7], [2,4]),
- ?line [1,2,3,4,5,6,7] = lists:merge([1,3,5,7], [2,4,6]),
- ?line [1,2,3,5,7] = lists:merge([2], [1,3,5,7]),
- ?line [1,2,3,4,5,7] = lists:merge([2,4], [1,3,5,7]),
- ?line [1,2,3,4,5,6,7] = lists:merge([2,4,6], [1,3,5,7]),
+ [] = lists:merge([], []),
+ Two = lists:merge(Two, []),
+ Two = lists:merge([], Two),
+ Six = lists:merge([1,3,5], [2,4,6]),
+ Six = lists:merge([2,4,6], [1,3,5]),
+ Six = lists:merge([1,2,3], [4,5,6]),
+ Six = lists:merge([4,5,6], [1,2,3]),
+ Six = lists:merge([1,2,5],[3,4,6]),
+ [1,2,3,5,7] = lists:merge([1,3,5,7], [2]),
+ [1,2,3,4,5,7] = lists:merge([1,3,5,7], [2,4]),
+ [1,2,3,4,5,6,7] = lists:merge([1,3,5,7], [2,4,6]),
+ [1,2,3,5,7] = lists:merge([2], [1,3,5,7]),
+ [1,2,3,4,5,7] = lists:merge([2,4], [1,3,5,7]),
+ [1,2,3,4,5,6,7] = lists:merge([2,4,6], [1,3,5,7]),
%% 3-way merge
- ?line [] = lists:merge3([], [], []),
- ?line Two = lists:merge3([], [], Two),
- ?line Two = lists:merge3([], Two, []),
- ?line Two = lists:merge3(Two, [], []),
- ?line Six = lists:merge3([], [1,3,5], [2,4,6]),
- ?line Six = lists:merge3([1,3,5], [], [2,4,6]),
- ?line Six = lists:merge3([1,3,5], [2,4,6], []),
- ?line Nine = lists:merge3([1,4,7],[2,5,8],[3,6,9]),
- ?line Nine = lists:merge3([1,4,7],[3,6,9],[2,5,8]),
- ?line Nine = lists:merge3([3,6,9],[1,4,7],[2,5,8]),
- ?line Nine = lists:merge3([4,5,6],[1,2,3],[7,8,9]),
- ?line Nine = lists:merge3([1,2,3],[4,5,6],[7,8,9]),
- ?line Nine = lists:merge3([7,8,9],[4,5,6],[1,2,3]),
- ?line Nine = lists:merge3([4,5,6],[7,8,9],[1,2,3]),
-
- ok.
-
-rmerge(doc) -> ["reverse merge functions"];
-rmerge(suite) -> [];
+ [] = lists:merge3([], [], []),
+ Two = lists:merge3([], [], Two),
+ Two = lists:merge3([], Two, []),
+ Two = lists:merge3(Two, [], []),
+ Six = lists:merge3([], [1,3,5], [2,4,6]),
+ Six = lists:merge3([1,3,5], [], [2,4,6]),
+ Six = lists:merge3([1,3,5], [2,4,6], []),
+ Nine = lists:merge3([1,4,7],[2,5,8],[3,6,9]),
+ Nine = lists:merge3([1,4,7],[3,6,9],[2,5,8]),
+ Nine = lists:merge3([3,6,9],[1,4,7],[2,5,8]),
+ Nine = lists:merge3([4,5,6],[1,2,3],[7,8,9]),
+ Nine = lists:merge3([1,2,3],[4,5,6],[7,8,9]),
+ Nine = lists:merge3([7,8,9],[4,5,6],[1,2,3]),
+ Nine = lists:merge3([4,5,6],[7,8,9],[1,2,3]),
+
+ ok.
+
+%% reverse merge functions
rmerge(Config) when is_list(Config) ->
Two = [2,1],
Six = [6,5,4,3,2,1],
%% 2-way reversed merge
- ?line [] = lists:rmerge([], []),
- ?line Two = lists:rmerge(Two, []),
- ?line Two = lists:rmerge([], Two),
- ?line Six = lists:rmerge([5,3,1], [6,4,2]),
- ?line Six = lists:rmerge([6,4,2], [5,3,1]),
- ?line Six = lists:rmerge([3,2,1], [6,5,4]),
- ?line Six = lists:rmerge([6,5,4], [3,2,1]),
- ?line Six = lists:rmerge([4,3,2],[6,5,1]),
- ?line [7,6,5,3,1] = lists:rmerge([7,5,3,1], [6]),
- ?line [7,6,5,4,3,1] = lists:rmerge([7,5,3,1], [6,4]),
- ?line [7,6,5,4,3,2,1] = lists:rmerge([7,5,3,1], [6,4,2]),
- ?line [7,5,3,2,1] = lists:rmerge([2], [7,5,3,1]),
- ?line [7,5,4,3,2,1] = lists:rmerge([4,2], [7,5,3,1]),
- ?line [7,6,5,4,3,2,1] = lists:rmerge([6,4,2], [7,5,3,1]),
+ [] = lists:rmerge([], []),
+ Two = lists:rmerge(Two, []),
+ Two = lists:rmerge([], Two),
+ Six = lists:rmerge([5,3,1], [6,4,2]),
+ Six = lists:rmerge([6,4,2], [5,3,1]),
+ Six = lists:rmerge([3,2,1], [6,5,4]),
+ Six = lists:rmerge([6,5,4], [3,2,1]),
+ Six = lists:rmerge([4,3,2],[6,5,1]),
+ [7,6,5,3,1] = lists:rmerge([7,5,3,1], [6]),
+ [7,6,5,4,3,1] = lists:rmerge([7,5,3,1], [6,4]),
+ [7,6,5,4,3,2,1] = lists:rmerge([7,5,3,1], [6,4,2]),
+ [7,5,3,2,1] = lists:rmerge([2], [7,5,3,1]),
+ [7,5,4,3,2,1] = lists:rmerge([4,2], [7,5,3,1]),
+ [7,6,5,4,3,2,1] = lists:rmerge([6,4,2], [7,5,3,1]),
Nine = [9,8,7,6,5,4,3,2,1],
%% 3-way reversed merge
- ?line [] = lists:rmerge3([], [], []),
- ?line Two = lists:rmerge3([], [], Two),
- ?line Two = lists:rmerge3([], Two, []),
- ?line Two = lists:rmerge3(Two, [], []),
- ?line Six = lists:rmerge3([], [5,3,1], [6,4,2]),
- ?line Six = lists:rmerge3([5,3,1], [], [6,4,2]),
- ?line Six = lists:rmerge3([5,3,1], [6,4,2], []),
- ?line Nine = lists:rmerge3([7,4,1],[8,5,2],[9,6,3]),
- ?line Nine = lists:rmerge3([7,4,1],[9,6,3],[8,5,2]),
- ?line Nine = lists:rmerge3([9,6,3],[7,4,1],[8,5,2]),
- ?line Nine = lists:rmerge3([6,5,4],[3,2,1],[9,8,7]),
- ?line Nine = lists:rmerge3([3,2,1],[6,5,4],[9,8,7]),
- ?line Nine = lists:rmerge3([9,8,7],[6,5,4],[3,2,1]),
- ?line Nine = lists:rmerge3([6,5,4],[9,8,7],[3,2,1]),
-
- ok.
-
-sort_1(doc) -> ["sort/1"];
-sort_1(suite) -> [];
+ [] = lists:rmerge3([], [], []),
+ Two = lists:rmerge3([], [], Two),
+ Two = lists:rmerge3([], Two, []),
+ Two = lists:rmerge3(Two, [], []),
+ Six = lists:rmerge3([], [5,3,1], [6,4,2]),
+ Six = lists:rmerge3([5,3,1], [], [6,4,2]),
+ Six = lists:rmerge3([5,3,1], [6,4,2], []),
+ Nine = lists:rmerge3([7,4,1],[8,5,2],[9,6,3]),
+ Nine = lists:rmerge3([7,4,1],[9,6,3],[8,5,2]),
+ Nine = lists:rmerge3([9,6,3],[7,4,1],[8,5,2]),
+ Nine = lists:rmerge3([6,5,4],[3,2,1],[9,8,7]),
+ Nine = lists:rmerge3([3,2,1],[6,5,4],[9,8,7]),
+ Nine = lists:rmerge3([9,8,7],[6,5,4],[3,2,1]),
+ Nine = lists:rmerge3([6,5,4],[9,8,7],[3,2,1]),
+
+ ok.
+
sort_1(Config) when is_list(Config) ->
- ?line [] = lists:sort([]),
- ?line [a] = lists:sort([a]),
- ?line [a,a] = lists:sort([a,a]),
- ?line [a,b] = lists:sort([a,b]),
- ?line [a,b] = lists:sort([b,a]),
- ?line [1,1] = lists:sort([1,1]),
- ?line [1,1,2,3] = lists:sort([1,1,3,2]),
- ?line [1,2,3,3] = lists:sort([3,3,1,2]),
- ?line [1,1,1,1] = lists:sort([1,1,1,1]),
- ?line [1,1,1,2,2,2,3,3,3] = lists:sort([3,3,3,2,2,2,1,1,1]),
- ?line [1,1,1,2,2,2,3,3,3] = lists:sort([1,1,1,2,2,2,3,3,3]),
-
- ?line lists:foreach(fun check/1, perms([1,2,3])),
- ?line lists:foreach(fun check/1, perms([1,2,3,4,5,6,7,8])),
- ok.
-
-sort_rand(doc) -> ["sort/1 on big randomized lists"];
-sort_rand(suite) -> [];
+ [] = lists:sort([]),
+ [a] = lists:sort([a]),
+ [a,a] = lists:sort([a,a]),
+ [a,b] = lists:sort([a,b]),
+ [a,b] = lists:sort([b,a]),
+ [1,1] = lists:sort([1,1]),
+ [1,1,2,3] = lists:sort([1,1,3,2]),
+ [1,2,3,3] = lists:sort([3,3,1,2]),
+ [1,1,1,1] = lists:sort([1,1,1,1]),
+ [1,1,1,2,2,2,3,3,3] = lists:sort([3,3,3,2,2,2,1,1,1]),
+ [1,1,1,2,2,2,3,3,3] = lists:sort([1,1,1,2,2,2,3,3,3]),
+
+ lists:foreach(fun check/1, perms([1,2,3])),
+ lists:foreach(fun check/1, perms([1,2,3,4,5,6,7,8])),
+ ok.
+
+%% sort/1 on big randomized lists
sort_rand(Config) when is_list(Config) ->
- ?line ok = check(biglist(10)),
- ?line ok = check(biglist(100)),
- ?line ok = check(biglist(1000)),
- ?line ok = check(biglist(10000)),
+ ok = check(biglist(10)),
+ ok = check(biglist(100)),
+ ok = check(biglist(1000)),
+ ok = check(biglist(10000)),
ok.
%% sort/1 was really stable for a while - the order of equal elements
%% was kept - but since the performance suffered a bit, this "feature"
%% was removed.
-sort_stable(doc) -> ["sort/1 should be stable for equal terms."];
-sort_stable(suite) -> [];
+
+%% sort/1 should be stable for equal terms.
sort_stable(Config) when is_list(Config) ->
- ?line ok = check_stability(bigfunlist(10)),
- ?line ok = check_stability(bigfunlist(100)),
- ?line ok = check_stability(bigfunlist(1000)),
- ?line case erlang:system_info(modified_timing_level) of
- undefined -> ok = check_stability(bigfunlist(10000));
- _ -> ok
- end,
+ ok = check_stability(bigfunlist(10)),
+ ok = check_stability(bigfunlist(100)),
+ ok = check_stability(bigfunlist(1000)),
+ case erlang:system_info(modified_timing_level) of
+ undefined -> ok = check_stability(bigfunlist(10000));
+ _ -> ok
+ end,
ok.
check([]) ->
@@ -619,188 +591,180 @@ expl_pid([], L) ->
L.
-usort_1(suite) -> [];
-usort_1(doc) -> [""];
usort_1(Conf) when is_list(Conf) ->
- ?line [] = lists:usort([]),
- ?line [1] = lists:usort([1]),
- ?line [1] = lists:usort([1,1]),
- ?line [1] = lists:usort([1,1,1,1,1]),
- ?line [1,2] = lists:usort([1,2]),
- ?line [1,2] = lists:usort([1,2,1]),
- ?line [1,2] = lists:usort([1,2,2]),
- ?line [1,2,3] = lists:usort([1,3,2]),
- ?line [1,3] = lists:usort([3,1,3]),
- ?line [0,1,3] = lists:usort([3,1,0]),
- ?line [1,2,3] = lists:usort([3,1,2]),
- ?line [1,2] = lists:usort([2,1,1]),
- ?line [1,2] = lists:usort([2,1]),
- ?line [0,3,4,8,9] = lists:usort([3,8,9,0,9,4]),
-
- ?line lists:foreach(fun ucheck/1, perms([1,2,3])),
- ?line lists:foreach(fun ucheck/1, perms([1,2,3,4,5,6,2,1])),
-
- ok.
-
-umerge(suite) -> [];
-umerge(doc) -> [""];
+ [] = lists:usort([]),
+ [1] = lists:usort([1]),
+ [1] = lists:usort([1,1]),
+ [1] = lists:usort([1,1,1,1,1]),
+ [1,2] = lists:usort([1,2]),
+ [1,2] = lists:usort([1,2,1]),
+ [1,2] = lists:usort([1,2,2]),
+ [1,2,3] = lists:usort([1,3,2]),
+ [1,3] = lists:usort([3,1,3]),
+ [0,1,3] = lists:usort([3,1,0]),
+ [1,2,3] = lists:usort([3,1,2]),
+ [1,2] = lists:usort([2,1,1]),
+ [1,2] = lists:usort([2,1]),
+ [0,3,4,8,9] = lists:usort([3,8,9,0,9,4]),
+
+ lists:foreach(fun ucheck/1, perms([1,2,3])),
+ lists:foreach(fun ucheck/1, perms([1,2,3,4,5,6,2,1])),
+
+ ok.
+
umerge(Conf) when is_list(Conf) ->
%% merge list of lists
- ?line [] = lists:umerge([]),
- ?line [] = lists:umerge([[]]),
- ?line [] = lists:umerge([[],[]]),
- ?line [] = lists:umerge([[],[],[]]),
- ?line [1] = lists:umerge([[1]]),
- ?line [1,2] = lists:umerge([[1,2],[1,2]]),
- ?line [1] = lists:umerge([[1],[],[]]),
- ?line [1] = lists:umerge([[],[1],[]]),
- ?line [1] = lists:umerge([[],[],[1]]),
- ?line [1,2] = lists:umerge([[1],[2],[]]),
- ?line [1,2] = lists:umerge([[1],[],[2]]),
- ?line [1,2] = lists:umerge([[],[1],[2]]),
- ?line [1,2,3,4,5,6] = lists:umerge([[1,2],[],[5,6],[],[3,4],[]]),
- ?line [1,2,3,4] = lists:umerge([[4],[3],[2],[1]]),
- ?line [1,2,3,4,5] = lists:umerge([[1],[2],[3],[4],[5]]),
- ?line [1,2,3,4,5,6] = lists:umerge([[1],[2],[3],[4],[5],[6]]),
- ?line [1,2,3,4,5,6,7,8,9] =
+ [] = lists:umerge([]),
+ [] = lists:umerge([[]]),
+ [] = lists:umerge([[],[]]),
+ [] = lists:umerge([[],[],[]]),
+ [1] = lists:umerge([[1]]),
+ [1,2] = lists:umerge([[1,2],[1,2]]),
+ [1] = lists:umerge([[1],[],[]]),
+ [1] = lists:umerge([[],[1],[]]),
+ [1] = lists:umerge([[],[],[1]]),
+ [1,2] = lists:umerge([[1],[2],[]]),
+ [1,2] = lists:umerge([[1],[],[2]]),
+ [1,2] = lists:umerge([[],[1],[2]]),
+ [1,2,3,4,5,6] = lists:umerge([[1,2],[],[5,6],[],[3,4],[]]),
+ [1,2,3,4] = lists:umerge([[4],[3],[2],[1]]),
+ [1,2,3,4,5] = lists:umerge([[1],[2],[3],[4],[5]]),
+ [1,2,3,4,5,6] = lists:umerge([[1],[2],[3],[4],[5],[6]]),
+ [1,2,3,4,5,6,7,8,9] =
lists:umerge([[1],[2],[3],[4],[5],[6],[7],[8],[9]]),
- ?line [1,2,4,6,8] = lists:umerge([[1,2],[2,4,6,8]]),
+ [1,2,4,6,8] = lists:umerge([[1,2],[2,4,6,8]]),
Seq = lists:seq(1,100),
- ?line true = Seq == lists:umerge(lists:map(fun(E) -> [E] end, Seq)),
+ true = Seq == lists:umerge(lists:map(fun(E) -> [E] end, Seq)),
Two = [1,2],
Six = [1,2,3,4,5,6],
%% 2-way unique merge
- ?line [] = lists:umerge([], []),
- ?line Two = lists:umerge(Two, []),
- ?line Two = lists:umerge([], Two),
- ?line Six = lists:umerge([1,3,5], [2,4,6]),
- ?line Six = lists:umerge([2,4,6], [1,3,5]),
- ?line Six = lists:umerge([1,2,3], [4,5,6]),
- ?line Six = lists:umerge([4,5,6], [1,2,3]),
- ?line Six = lists:umerge([1,2,5],[3,4,6]),
- ?line [1,2,3,5,7] = lists:umerge([1,3,5,7], [2]),
- ?line [1,2,3,4,5,7] = lists:umerge([1,3,5,7], [2,4]),
- ?line [1,2,3,4,5,6,7] = lists:umerge([1,3,5,7], [2,4,6]),
- ?line [1,2,3,5,7] = lists:umerge([2], [1,3,5,7]),
- ?line [1,2,3,4,5,7] = lists:umerge([2,4], [1,3,5,7]),
- ?line [1,2,3,4,5,6,7] = lists:umerge([2,4,6], [1,3,5,7]),
-
- ?line [1,2,3,5,7] = lists:umerge([1,2,3,5,7], [2]),
- ?line [1,2,3,4,5,7] = lists:umerge([1,2,3,4,5,7], [2,4]),
- ?line [1,2,3,4,5,6,7] = lists:umerge([1,2,3,4,5,6,7], [2,4,6]),
- ?line [1,2,3,5,7] = lists:umerge([2], [1,2,3,5,7]),
- ?line [1,2,3,4,5,7] = lists:umerge([2,4], [1,2,3,4,5,7]),
- ?line [1,2,3,4,5,6,7] = lists:umerge([2,4,6], [1,2,3,4,5,6,7]),
+ [] = lists:umerge([], []),
+ Two = lists:umerge(Two, []),
+ Two = lists:umerge([], Two),
+ Six = lists:umerge([1,3,5], [2,4,6]),
+ Six = lists:umerge([2,4,6], [1,3,5]),
+ Six = lists:umerge([1,2,3], [4,5,6]),
+ Six = lists:umerge([4,5,6], [1,2,3]),
+ Six = lists:umerge([1,2,5],[3,4,6]),
+ [1,2,3,5,7] = lists:umerge([1,3,5,7], [2]),
+ [1,2,3,4,5,7] = lists:umerge([1,3,5,7], [2,4]),
+ [1,2,3,4,5,6,7] = lists:umerge([1,3,5,7], [2,4,6]),
+ [1,2,3,5,7] = lists:umerge([2], [1,3,5,7]),
+ [1,2,3,4,5,7] = lists:umerge([2,4], [1,3,5,7]),
+ [1,2,3,4,5,6,7] = lists:umerge([2,4,6], [1,3,5,7]),
+
+ [1,2,3,5,7] = lists:umerge([1,2,3,5,7], [2]),
+ [1,2,3,4,5,7] = lists:umerge([1,2,3,4,5,7], [2,4]),
+ [1,2,3,4,5,6,7] = lists:umerge([1,2,3,4,5,6,7], [2,4,6]),
+ [1,2,3,5,7] = lists:umerge([2], [1,2,3,5,7]),
+ [1,2,3,4,5,7] = lists:umerge([2,4], [1,2,3,4,5,7]),
+ [1,2,3,4,5,6,7] = lists:umerge([2,4,6], [1,2,3,4,5,6,7]),
%% 3-way unique merge
- ?line [] = lists:umerge3([], [], []),
- ?line Two = lists:umerge3([], [], Two),
- ?line Two = lists:umerge3([], Two, []),
- ?line Two = lists:umerge3(Two, [], []),
- ?line Six = lists:umerge3([], [1,3,5], [2,4,6]),
- ?line Six = lists:umerge3([1,3,5], [], [2,4,6]),
- ?line Six = lists:umerge3([1,3,5], [2,4,6], []),
- ?line Nine = lists:umerge3([1,4,7],[2,5,8],[3,6,9]),
- ?line Nine = lists:umerge3([1,4,7],[3,6,9],[2,5,8]),
- ?line Nine = lists:umerge3([3,6,9],[1,4,7],[2,5,8]),
- ?line Nine = lists:umerge3([4,5,6],[1,2,3],[7,8,9]),
- ?line Nine = lists:umerge3([1,2,3],[4,5,6],[7,8,9]),
- ?line Nine = lists:umerge3([7,8,9],[4,5,6],[1,2,3]),
- ?line Nine = lists:umerge3([4,5,6],[7,8,9],[1,2,3]),
-
- ?line [1,2,3] = lists:umerge3([1,2,3],[1,2,3],[1,2,3]),
- ?line [1,2,3,4] = lists:umerge3([2,3,4],[1,2,3],[2,3,4]),
- ?line [1,2,3] = lists:umerge3([1,2,3],[2,3],[1,2,3]),
- ?line [1,2,3,4] = lists:umerge3([2,3,4],[3,4],[1,2,3]),
-
- ok.
-
-rumerge(suite) -> [];
-rumerge(doc) -> [""];
+ [] = lists:umerge3([], [], []),
+ Two = lists:umerge3([], [], Two),
+ Two = lists:umerge3([], Two, []),
+ Two = lists:umerge3(Two, [], []),
+ Six = lists:umerge3([], [1,3,5], [2,4,6]),
+ Six = lists:umerge3([1,3,5], [], [2,4,6]),
+ Six = lists:umerge3([1,3,5], [2,4,6], []),
+ Nine = lists:umerge3([1,4,7],[2,5,8],[3,6,9]),
+ Nine = lists:umerge3([1,4,7],[3,6,9],[2,5,8]),
+ Nine = lists:umerge3([3,6,9],[1,4,7],[2,5,8]),
+ Nine = lists:umerge3([4,5,6],[1,2,3],[7,8,9]),
+ Nine = lists:umerge3([1,2,3],[4,5,6],[7,8,9]),
+ Nine = lists:umerge3([7,8,9],[4,5,6],[1,2,3]),
+ Nine = lists:umerge3([4,5,6],[7,8,9],[1,2,3]),
+
+ [1,2,3] = lists:umerge3([1,2,3],[1,2,3],[1,2,3]),
+ [1,2,3,4] = lists:umerge3([2,3,4],[1,2,3],[2,3,4]),
+ [1,2,3] = lists:umerge3([1,2,3],[2,3],[1,2,3]),
+ [1,2,3,4] = lists:umerge3([2,3,4],[3,4],[1,2,3]),
+
+ ok.
+
rumerge(Conf) when is_list(Conf) ->
Two = [2,1],
Six = [6,5,4,3,2,1],
%% 2-way reversed unique merge
- ?line [] = lists:rumerge([], []),
- ?line Two = lists:rumerge(Two, []),
- ?line Two = lists:rumerge([], Two),
- ?line Six = lists:rumerge([5,3,1], [6,4,2]),
- ?line Six = lists:rumerge([6,4,2], [5,3,1]),
- ?line Six = lists:rumerge([3,2,1], [6,5,4]),
- ?line Six = lists:rumerge([6,5,4], [3,2,1]),
- ?line Six = lists:rumerge([4,3,2],[6,5,1]),
- ?line [7,6,5,3,1] = lists:rumerge([7,5,3,1], [6]),
- ?line [7,6,5,4,3,1] = lists:rumerge([7,5,3,1], [6,4]),
- ?line [7,6,5,4,3,2,1] = lists:rumerge([7,5,3,1], [6,4,2]),
- ?line [7,5,3,2,1] = lists:rumerge([2], [7,5,3,1]),
- ?line [7,5,4,3,2,1] = lists:rumerge([4,2], [7,5,3,1]),
- ?line [7,6,5,4,3,2,1] = lists:rumerge([6,4,2], [7,5,3,1]),
-
- ?line [7,6,5,3,1] = lists:rumerge([7,6,5,3,1], [6]),
- ?line [7,6,5,4,3,1] = lists:rumerge([7,6,5,4,3,1], [6,4]),
- ?line [7,6,5,4,3,2,1] = lists:rumerge([7,6,5,4,3,2,1], [6,4,2]),
- ?line [7,5,3,2,1] = lists:rumerge([2], [7,5,3,2,1]),
- ?line [7,5,4,3,2,1] = lists:rumerge([4,2], [7,5,4,3,2,1]),
- ?line [7,6,5,4,3,2,1] = lists:rumerge([6,4,2], [7,6,5,4,3,2,1]),
+ [] = lists:rumerge([], []),
+ Two = lists:rumerge(Two, []),
+ Two = lists:rumerge([], Two),
+ Six = lists:rumerge([5,3,1], [6,4,2]),
+ Six = lists:rumerge([6,4,2], [5,3,1]),
+ Six = lists:rumerge([3,2,1], [6,5,4]),
+ Six = lists:rumerge([6,5,4], [3,2,1]),
+ Six = lists:rumerge([4,3,2],[6,5,1]),
+ [7,6,5,3,1] = lists:rumerge([7,5,3,1], [6]),
+ [7,6,5,4,3,1] = lists:rumerge([7,5,3,1], [6,4]),
+ [7,6,5,4,3,2,1] = lists:rumerge([7,5,3,1], [6,4,2]),
+ [7,5,3,2,1] = lists:rumerge([2], [7,5,3,1]),
+ [7,5,4,3,2,1] = lists:rumerge([4,2], [7,5,3,1]),
+ [7,6,5,4,3,2,1] = lists:rumerge([6,4,2], [7,5,3,1]),
+
+ [7,6,5,3,1] = lists:rumerge([7,6,5,3,1], [6]),
+ [7,6,5,4,3,1] = lists:rumerge([7,6,5,4,3,1], [6,4]),
+ [7,6,5,4,3,2,1] = lists:rumerge([7,6,5,4,3,2,1], [6,4,2]),
+ [7,5,3,2,1] = lists:rumerge([2], [7,5,3,2,1]),
+ [7,5,4,3,2,1] = lists:rumerge([4,2], [7,5,4,3,2,1]),
+ [7,6,5,4,3,2,1] = lists:rumerge([6,4,2], [7,6,5,4,3,2,1]),
Nine = [9,8,7,6,5,4,3,2,1],
%% 3-way reversed unique merge
- ?line [] = lists:rumerge3([], [], []),
- ?line Two = lists:rumerge3([], [], Two),
- ?line Two = lists:rumerge3([], Two, []),
- ?line Two = lists:rumerge3(Two, [], []),
- ?line Six = lists:rumerge3([], [5,3,1], [6,4,2]),
- ?line Six = lists:rumerge3([5,3,1], [], [6,4,2]),
- ?line Six = lists:rumerge3([5,3,1], [6,4,2], []),
- ?line Nine = lists:rumerge3([7,4,1],[8,5,2],[9,6,3]),
- ?line Nine = lists:rumerge3([7,4,1],[9,6,3],[8,5,2]),
- ?line Nine = lists:rumerge3([9,6,3],[7,4,1],[8,5,2]),
- ?line Nine = lists:rumerge3([6,5,4],[3,2,1],[9,8,7]),
- ?line Nine = lists:rumerge3([3,2,1],[6,5,4],[9,8,7]),
- ?line Nine = lists:rumerge3([9,8,7],[6,5,4],[3,2,1]),
- ?line Nine = lists:rumerge3([6,5,4],[9,8,7],[3,2,1]),
-
- ?line [3,2,1] = lists:rumerge3([3,2,1],[3,2,1],[3,2,1]),
- ?line [4,3,2,1] = lists:rumerge3([4,3,2],[3,2,1],[3,2,1]),
- ?line [5,4,3,2,1] = lists:rumerge3([4,3,2],[5,4,3,2],[5,4,3,2,1]),
- ?line [6,5,4,3,2] = lists:rumerge3([4,3,2],[5,4,3,2],[6,5,4,3]),
+ [] = lists:rumerge3([], [], []),
+ Two = lists:rumerge3([], [], Two),
+ Two = lists:rumerge3([], Two, []),
+ Two = lists:rumerge3(Two, [], []),
+ Six = lists:rumerge3([], [5,3,1], [6,4,2]),
+ Six = lists:rumerge3([5,3,1], [], [6,4,2]),
+ Six = lists:rumerge3([5,3,1], [6,4,2], []),
+ Nine = lists:rumerge3([7,4,1],[8,5,2],[9,6,3]),
+ Nine = lists:rumerge3([7,4,1],[9,6,3],[8,5,2]),
+ Nine = lists:rumerge3([9,6,3],[7,4,1],[8,5,2]),
+ Nine = lists:rumerge3([6,5,4],[3,2,1],[9,8,7]),
+ Nine = lists:rumerge3([3,2,1],[6,5,4],[9,8,7]),
+ Nine = lists:rumerge3([9,8,7],[6,5,4],[3,2,1]),
+ Nine = lists:rumerge3([6,5,4],[9,8,7],[3,2,1]),
+
+ [3,2,1] = lists:rumerge3([3,2,1],[3,2,1],[3,2,1]),
+ [4,3,2,1] = lists:rumerge3([4,3,2],[3,2,1],[3,2,1]),
+ [5,4,3,2,1] = lists:rumerge3([4,3,2],[5,4,3,2],[5,4,3,2,1]),
+ [6,5,4,3,2] = lists:rumerge3([4,3,2],[5,4,3,2],[6,5,4,3]),
L1 = [c,d,e],
L2 = [b,c,d],
- ?line true =
+ true =
lists:umerge(L1, L2) ==
lists:reverse(lists:rumerge(lists:reverse(L1), lists:reverse(L2))),
ok.
-usort_rand(doc) -> ["usort/1 on big randomized lists"];
-usort_rand(suite) -> [];
+%% usort/1 on big randomized lists.
usort_rand(Config) when is_list(Config) ->
- ?line ok = ucheck(biglist(10)),
- ?line ok = ucheck(biglist(100)),
- ?line ok = ucheck(biglist(1000)),
- ?line ok = ucheck(biglist(10000)),
+ ok = ucheck(biglist(10)),
+ ok = ucheck(biglist(100)),
+ ok = ucheck(biglist(1000)),
+ ok = ucheck(biglist(10000)),
- ?line ok = ucheck(ubiglist(10)),
- ?line ok = ucheck(ubiglist(100)),
- ?line ok = ucheck(ubiglist(1000)),
- ?line ok = ucheck(ubiglist(10000)),
+ ok = ucheck(ubiglist(10)),
+ ok = ucheck(ubiglist(100)),
+ ok = ucheck(ubiglist(1000)),
+ ok = ucheck(ubiglist(10000)),
ok.
-usort_stable(doc) -> ["usort/1 should keep the first duplicate."];
-usort_stable(suite) -> [];
+%% usort/1 should keep the first duplicate.
usort_stable(Config) when is_list(Config) ->
- ?line ok = ucheck_stability(bigfunlist(3)),
- ?line ok = ucheck_stability(bigfunlist(10)),
- ?line ok = ucheck_stability(bigfunlist(100)),
- ?line ok = ucheck_stability(bigfunlist(1000)),
- ?line case erlang:system_info(modified_timing_level) of
- undefined -> ok = ucheck_stability(bigfunlist(10000));
- _ -> ok
- end,
+ ok = ucheck_stability(bigfunlist(3)),
+ ok = ucheck_stability(bigfunlist(10)),
+ ok = ucheck_stability(bigfunlist(100)),
+ ok = ucheck_stability(bigfunlist(1000)),
+ case erlang:system_info(modified_timing_level) of
+ undefined -> ok = ucheck_stability(bigfunlist(10000));
+ _ -> ok
+ end,
ok.
ucheck([]) ->
@@ -829,163 +793,155 @@ ucheck_stability(L) ->
check_stab(L, U, S, "usort/1", "ukeysort/2").
-keymerge(doc) -> ["Key merge two lists."];
-keymerge(suite) -> [];
+%% Key merge two lists.
keymerge(Config) when is_list(Config) ->
Two = [{1,a},{2,b}],
Six = [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f}],
%% 2-way keymerge
- ?line [] = lists:keymerge(1, [], []),
- ?line Two = lists:keymerge(1, Two, []),
- ?line Two = lists:keymerge(1, [], Two),
- ?line Six = lists:keymerge(1, [{1,a},{3,c},{5,e}], [{2,b},{4,d},{6,f}]),
- ?line Six = lists:keymerge(1, [{2,b},{4,d},{6,f}], [{1,a},{3,c},{5,e}]),
- ?line Six = lists:keymerge(1, [{1,a},{2,b},{3,c}], [{4,d},{5,e},{6,f}]),
- ?line Six = lists:keymerge(1, [{4,d},{5,e},{6,f}], [{1,a},{2,b},{3,c}]),
- ?line Six = lists:keymerge(1, [{1,a},{2,b},{5,e}],[{3,c},{4,d},{6,f}]),
- ?line [{1,a},{2,b},{3,c},{5,e},{7,g}] =
+ [] = lists:keymerge(1, [], []),
+ Two = lists:keymerge(1, Two, []),
+ Two = lists:keymerge(1, [], Two),
+ Six = lists:keymerge(1, [{1,a},{3,c},{5,e}], [{2,b},{4,d},{6,f}]),
+ Six = lists:keymerge(1, [{2,b},{4,d},{6,f}], [{1,a},{3,c},{5,e}]),
+ Six = lists:keymerge(1, [{1,a},{2,b},{3,c}], [{4,d},{5,e},{6,f}]),
+ Six = lists:keymerge(1, [{4,d},{5,e},{6,f}], [{1,a},{2,b},{3,c}]),
+ Six = lists:keymerge(1, [{1,a},{2,b},{5,e}],[{3,c},{4,d},{6,f}]),
+ [{1,a},{2,b},{3,c},{5,e},{7,g}] =
lists:keymerge(1, [{1,a},{3,c},{5,e},{7,g}], [{2,b}]),
- ?line [{1,a},{2,b},{3,c},{4,d},{5,e},{7,g}] =
+ [{1,a},{2,b},{3,c},{4,d},{5,e},{7,g}] =
lists:keymerge(1, [{1,a},{3,c},{5,e},{7,g}], [{2,b},{4,d}]),
- ?line [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g}] =
+ [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g}] =
lists:keymerge(1, [{1,a},{3,c},{5,e},{7,g}], [{2,b},{4,d},{6,f}]),
- ?line [{1,a},{2,b},{3,c},{5,e},{7,g}] =
+ [{1,a},{2,b},{3,c},{5,e},{7,g}] =
lists:keymerge(1, [{2,b}], [{1,a},{3,c},{5,e},{7,g}]),
- ?line [{1,a},{2,b},{3,c},{4,d},{5,e},{7,g}] =
+ [{1,a},{2,b},{3,c},{4,d},{5,e},{7,g}] =
lists:keymerge(1, [{2,b},{4,d}], [{1,a},{3,c},{5,e},{7,g}]),
- ?line [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g}] =
+ [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g}] =
lists:keymerge(1, [{2,b},{4,d},{6,f}], [{1,a},{3,c},{5,e},{7,g}]),
- ?line [{b,2},{c,11},{c,12},{c,21},{c,22},{e,5}] =
+ [{b,2},{c,11},{c,12},{c,21},{c,22},{e,5}] =
lists:keymerge(1,[{c,11},{c,12},{e,5}], [{b,2},{c,21},{c,22}]),
ok.
-rkeymerge(doc) -> ["Reverse key merge two lists."];
-rkeymerge(suite) -> [];
+%% Reverse key merge two lists.
rkeymerge(Config) when is_list(Config) ->
Two = [{2,b},{1,a}],
Six = [{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}],
%% 2-way reversed keymerge
- ?line [] = lists:rkeymerge(1, [], []),
- ?line Two = lists:rkeymerge(1, Two, []),
- ?line Two = lists:rkeymerge(1, [], Two),
- ?line Six = lists:rkeymerge(1, [{5,e},{3,c},{1,a}], [{6,f},{4,d},{2,b}]),
- ?line Six = lists:rkeymerge(1, [{6,f},{4,d},{2,b}], [{5,e},{3,c},{1,a}]),
- ?line Six = lists:rkeymerge(1, [{3,c},{2,b},{1,a}], [{6,f},{5,e},{4,d}]),
- ?line Six = lists:rkeymerge(1, [{6,f},{5,e},{4,d}], [{3,c},{2,b},{1,a}]),
- ?line Six = lists:rkeymerge(1, [{4,d},{3,c},{2,b}],[{6,f},{5,e},{1,a}]),
- ?line [{7,g},{6,f},{5,e},{3,c},{1,a}] =
+ [] = lists:rkeymerge(1, [], []),
+ Two = lists:rkeymerge(1, Two, []),
+ Two = lists:rkeymerge(1, [], Two),
+ Six = lists:rkeymerge(1, [{5,e},{3,c},{1,a}], [{6,f},{4,d},{2,b}]),
+ Six = lists:rkeymerge(1, [{6,f},{4,d},{2,b}], [{5,e},{3,c},{1,a}]),
+ Six = lists:rkeymerge(1, [{3,c},{2,b},{1,a}], [{6,f},{5,e},{4,d}]),
+ Six = lists:rkeymerge(1, [{6,f},{5,e},{4,d}], [{3,c},{2,b},{1,a}]),
+ Six = lists:rkeymerge(1, [{4,d},{3,c},{2,b}],[{6,f},{5,e},{1,a}]),
+ [{7,g},{6,f},{5,e},{3,c},{1,a}] =
lists:rkeymerge(1, [{7,g},{5,e},{3,c},{1,a}], [{6,f}]),
- ?line [{7,g},{6,f},{5,e},{4,d},{3,c},{1,a}] =
+ [{7,g},{6,f},{5,e},{4,d},{3,c},{1,a}] =
lists:rkeymerge(1, [{7,g},{5,e},{3,c},{1,a}], [{6,f},{4,d}]),
- ?line [{7,g},{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}] =
+ [{7,g},{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}] =
lists:rkeymerge(1, [{7,g},{5,e},{3,c},{1,a}], [{6,f},{4,d},{2,b}]),
- ?line [{7,g},{5,e},{3,c},{2,b},{1,a}] =
+ [{7,g},{5,e},{3,c},{2,b},{1,a}] =
lists:rkeymerge(1, [{2,b}], [{7,g},{5,e},{3,c},{1,a}]),
- ?line [{7,g},{5,e},{4,d},{3,c},{2,b},{1,a}] =
+ [{7,g},{5,e},{4,d},{3,c},{2,b},{1,a}] =
lists:rkeymerge(1, [{4,d},{2,b}], [{7,g},{5,e},{3,c},{1,a}]),
- ?line [{7,g},{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}] =
+ [{7,g},{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}] =
lists:rkeymerge(1, [{6,f},{4,d},{2,b}], [{7,g},{5,e},{3,c},{1,a}]),
L1 = [{c,11},{c,12},{e,5}],
L2 = [{b,2},{c,21},{c,22}],
- ?line true =
+ true =
lists:keymerge(1, L1, L2) ==
lists:reverse(lists:rkeymerge(1,lists:reverse(L1),
lists:reverse(L2))),
ok.
-keysort_1(doc) -> ["keysort"];
-keysort_1(suite) -> [];
keysort_1(Config) when is_list(Config) ->
- ?line ok = keysort_check(1, [], []),
- ?line ok = keysort_check(1, [{a,b}], [{a,b}]),
- ?line ok = keysort_check(1, [{a,b},{a,b}], [{a,b},{a,b}]),
- ?line ok = keysort_check(1, [{a,b},{b,c}], [{a,b},{b,c}]),
- ?line ok = keysort_check(1, [{b,c},{a,b}], [{a,b},{b,c}]),
- ?line ok = keysort_check(1,
- [{1,e},{3,f},{2,y},{0,z},{x,14}],
- [{0,z},{1,e},{2,y},{3,f},{x,14}]),
- ?line ok = keysort_check(1,
- [{1,a},{1,a},{1,a},{1,a}],
- [{1,a},{1,a},{1,a},{1,a}]),
-
- ?line [{b,1},{c,1}] = lists:keysort(1, [{c,1},{b,1}]),
- ?line [{a,0},{b,2},{c,3},{d,4}] =
- lists:keysort(1, [{d,4},{c,3},{b,2},{a,0}]),
- ?line [{a,0},{b,1},{b,2},{c,1}] =
- lists:keysort(1, [{c,1},{b,1},{b,2},{a,0}]),
- ?line [{a,0},{b,1},{b,2},{c,1},{d,4}] =
- lists:keysort(1, [{c,1},{b,1},{b,2},{a,0},{d,4}]),
+ ok = keysort_check(1, [], []),
+ ok = keysort_check(1, [{a,b}], [{a,b}]),
+ ok = keysort_check(1, [{a,b},{a,b}], [{a,b},{a,b}]),
+ ok = keysort_check(1, [{a,b},{b,c}], [{a,b},{b,c}]),
+ ok = keysort_check(1, [{b,c},{a,b}], [{a,b},{b,c}]),
+ ok = keysort_check(1,
+ [{1,e},{3,f},{2,y},{0,z},{x,14}],
+ [{0,z},{1,e},{2,y},{3,f},{x,14}]),
+ ok = keysort_check(1,
+ [{1,a},{1,a},{1,a},{1,a}],
+ [{1,a},{1,a},{1,a},{1,a}]),
+
+ [{b,1},{c,1}] = lists:keysort(1, [{c,1},{b,1}]),
+ [{a,0},{b,2},{c,3},{d,4}] =
+ lists:keysort(1, [{d,4},{c,3},{b,2},{a,0}]),
+ [{a,0},{b,1},{b,2},{c,1}] =
+ lists:keysort(1, [{c,1},{b,1},{b,2},{a,0}]),
+ [{a,0},{b,1},{b,2},{c,1},{d,4}] =
+ lists:keysort(1, [{c,1},{b,1},{b,2},{a,0},{d,4}]),
SFun = fun(L) -> fun(X) -> keysort_check(1, X, L) end end,
L1 = [{1,a},{2,b},{3,c}],
- ?line lists:foreach(SFun(L1), perms(L1)),
+ lists:foreach(SFun(L1), perms(L1)),
L2 = [{1,a},{1,a},{2,b}],
- ?line lists:foreach(SFun(L2), perms(L2)),
+ lists:foreach(SFun(L2), perms(L2)),
L3 = [{1,a},{1,a},{1,a},{2,b}],
- ?line lists:foreach(SFun(L3), perms(L3)),
+ lists:foreach(SFun(L3), perms(L3)),
L4 = [{a,1},{a,1},{b,2},{b,2},{c,3},{d,4},{e,5},{f,6}],
- ?line lists:foreach(SFun(L4), perms(L4)),
+ lists:foreach(SFun(L4), perms(L4)),
ok.
-keysort_stable(doc) -> ["keysort should be stable"];
-keysort_stable(suite) -> [];
+%% keysort should be stable
keysort_stable(Config) when is_list(Config) ->
- ?line ok = keysort_check(1, [{1,b},{1,c}], [{1,b},{1,c}]),
- ?line ok = keysort_check(1, [{1,c},{1,b}], [{1,c},{1,b}]),
- ?line ok = keysort_check(1,
- [{1,c},{1,b},{2,x},{3,p},{2,a}],
- [{1,c},{1,b},{2,x},{2,a},{3,p}]),
- ?line ok = keysort_check(1,
- [{1,a},{1,b},{1,a},{1,a}],
- [{1,a},{1,b},{1,a},{1,a}]),
- ok.
-
-keysort_error(doc) -> ["keysort should exit when given bad arguments"];
-keysort_error(suite) -> [];
+ ok = keysort_check(1, [{1,b},{1,c}], [{1,b},{1,c}]),
+ ok = keysort_check(1, [{1,c},{1,b}], [{1,c},{1,b}]),
+ ok = keysort_check(1,
+ [{1,c},{1,b},{2,x},{3,p},{2,a}],
+ [{1,c},{1,b},{2,x},{2,a},{3,p}]),
+ ok = keysort_check(1,
+ [{1,a},{1,b},{1,a},{1,a}],
+ [{1,a},{1,b},{1,a},{1,a}]),
+ ok.
+
+%% keysort should exit when given bad arguments
keysort_error(Config) when is_list(Config) ->
- ?line {'EXIT', _} = (catch lists:keysort(0, [{1,b},{1,c}])),
- ?line {'EXIT', _} = (catch lists:keysort(3, [{1,b},{1,c}])),
- ?line {'EXIT', _} = (catch lists:keysort(1.5, [{1,b},{1,c}])),
- ?line {'EXIT', _} = (catch lists:keysort(x, [{1,b},{1,c}])),
- ?line {'EXIT', _} = (catch lists:keysort(x, [])),
- ?line {'EXIT', _} = (catch lists:keysort(x, [{1,b}])),
- ?line {'EXIT', _} = (catch lists:keysort(1, [a,b])),
- ?line {'EXIT', _} = (catch lists:keysort(1, [{1,b} | {1,c}])),
- ok.
-
-keysort_i(doc) -> ["keysort with other key than first element"];
-keysort_i(suite) -> [];
+ {'EXIT', _} = (catch lists:keysort(0, [{1,b},{1,c}])),
+ {'EXIT', _} = (catch lists:keysort(3, [{1,b},{1,c}])),
+ {'EXIT', _} = (catch lists:keysort(1.5, [{1,b},{1,c}])),
+ {'EXIT', _} = (catch lists:keysort(x, [{1,b},{1,c}])),
+ {'EXIT', _} = (catch lists:keysort(x, [])),
+ {'EXIT', _} = (catch lists:keysort(x, [{1,b}])),
+ {'EXIT', _} = (catch lists:keysort(1, [a,b])),
+ {'EXIT', _} = (catch lists:keysort(1, [{1,b} | {1,c}])),
+ ok.
+
+%% keysort with other key than first element
keysort_i(Config) when is_list(Config) ->
- ?line ok = keysort_check(2, [{a,2},{b,1},{c,3}], [{b,1},{a,2},{c,3}]),
+ ok = keysort_check(2, [{a,2},{b,1},{c,3}], [{b,1},{a,2},{c,3}]),
ok.
-keysort_rand(doc) -> ["keysort on big randomized lists"];
-keysort_rand(suite) -> [];
+%% keysort on big randomized lists
keysort_rand(Config) when is_list(Config) ->
- ?line ok = keysort_check3(1, biglist(10)),
- ?line ok = keysort_check3(1, biglist(100)),
- ?line ok = keysort_check3(1, biglist(1000)),
- ?line ok = keysort_check3(1, biglist(10000)),
+ ok = keysort_check3(1, biglist(10)),
+ ok = keysort_check3(1, biglist(100)),
+ ok = keysort_check3(1, biglist(1000)),
+ ok = keysort_check3(1, biglist(10000)),
- ?line ok = keysort_check3(2, biglist(10)),
- ?line ok = keysort_check3(2, biglist(100)),
- ?line ok = keysort_check3(2, biglist(1000)),
- ?line ok = keysort_check3(2, biglist(10000)),
+ ok = keysort_check3(2, biglist(10)),
+ ok = keysort_check3(2, biglist(100)),
+ ok = keysort_check3(2, biglist(1000)),
+ ok = keysort_check3(2, biglist(10000)),
ok.
%%% Keysort a list, check that the returned list is what we expected,
%%% and that it is actually sorted.
keysort_check(I, Input, Expected) ->
- ?line Expected = lists:keysort(I, Input),
+ Expected = lists:keysort(I, Input),
check_sorted(I, Input, Expected).
keysort_check3(I, Input) ->
@@ -1020,232 +976,223 @@ keycompare(I, J, A, B) when element(I, A) == element(I, B),
ok.
-ukeymerge(suite) -> [];
-ukeymerge(doc) -> ["Merge two lists while removing duplicates."];
+%% Merge two lists while removing duplicates.
ukeymerge(Conf) when is_list(Conf) ->
Two = [{1,a},{2,b}],
Six = [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f}],
%% 2-way unique keymerge
- ?line [] = lists:ukeymerge(1, [], []),
- ?line Two = lists:ukeymerge(1, Two, []),
- ?line Two = lists:ukeymerge(1, [], Two),
- ?line [] = lists:ukeymerge(1, [], []),
- ?line Two = lists:ukeymerge(1, Two, []),
- ?line Two = lists:ukeymerge(1, [], Two),
- ?line Six = lists:ukeymerge(1, [{1,a},{3,c},{5,e}], [{2,b},{4,d},{6,f}]),
- ?line Six = lists:ukeymerge(1, [{2,b},{4,d},{6,f}], [{1,a},{3,c},{5,e}]),
- ?line Six = lists:ukeymerge(1, [{1,a},{2,b},{3,c}], [{4,d},{5,e},{6,f}]),
- ?line Six = lists:ukeymerge(1, [{4,d},{5,e},{6,f}], [{1,a},{2,b},{3,c}]),
- ?line Six = lists:ukeymerge(1, [{1,a},{2,b},{5,e}],[{3,c},{4,d},{6,f}]),
- ?line [{1,a},{2,b},{3,c},{5,e},{7,g}] =
+ [] = lists:ukeymerge(1, [], []),
+ Two = lists:ukeymerge(1, Two, []),
+ Two = lists:ukeymerge(1, [], Two),
+ [] = lists:ukeymerge(1, [], []),
+ Two = lists:ukeymerge(1, Two, []),
+ Two = lists:ukeymerge(1, [], Two),
+ Six = lists:ukeymerge(1, [{1,a},{3,c},{5,e}], [{2,b},{4,d},{6,f}]),
+ Six = lists:ukeymerge(1, [{2,b},{4,d},{6,f}], [{1,a},{3,c},{5,e}]),
+ Six = lists:ukeymerge(1, [{1,a},{2,b},{3,c}], [{4,d},{5,e},{6,f}]),
+ Six = lists:ukeymerge(1, [{4,d},{5,e},{6,f}], [{1,a},{2,b},{3,c}]),
+ Six = lists:ukeymerge(1, [{1,a},{2,b},{5,e}],[{3,c},{4,d},{6,f}]),
+ [{1,a},{2,b},{3,c},{5,e},{7,g}] =
lists:ukeymerge(1, [{1,a},{3,c},{5,e},{7,g}], [{2,b}]),
- ?line [{1,a},{2,b},{3,c},{4,d},{5,e},{7,g}] =
+ [{1,a},{2,b},{3,c},{4,d},{5,e},{7,g}] =
lists:ukeymerge(1, [{1,a},{3,c},{5,e},{7,g}], [{2,b},{4,d}]),
- ?line [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g}] =
+ [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g}] =
lists:ukeymerge(1, [{1,a},{3,c},{5,e},{7,g}], [{2,b},{4,d},{6,f}]),
- ?line [{1,a},{2,b},{3,c},{5,e},{7,g}] =
+ [{1,a},{2,b},{3,c},{5,e},{7,g}] =
lists:ukeymerge(1, [{2,b}], [{1,a},{3,c},{5,e},{7,g}]),
- ?line [{1,a},{2,b},{3,c},{4,d},{5,e},{7,g}] =
+ [{1,a},{2,b},{3,c},{4,d},{5,e},{7,g}] =
lists:ukeymerge(1, [{2,b},{4,d}], [{1,a},{3,c},{5,e},{7,g}]),
- ?line [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g}] =
+ [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g}] =
lists:ukeymerge(1, [{2,b},{4,d},{6,f}], [{1,a},{3,c},{5,e},{7,g}]),
- ?line [{1,a},{2,b},{3,c},{5,e},{7,g}] =
+ [{1,a},{2,b},{3,c},{5,e},{7,g}] =
lists:ukeymerge(1, [{1,a},{2,b},{3,c},{5,e},{7,g}], [{2,b}]),
- ?line [{1,a},{2,b},{3,c},{4,d},{5,e},{7,g}] =
+ [{1,a},{2,b},{3,c},{4,d},{5,e},{7,g}] =
lists:ukeymerge(1, [{1,a},{2,b},{3,c},{4,d},{5,e},{7,g}],
[{2,b},{4,d}]),
- ?line [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g}] =
+ [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g}] =
lists:ukeymerge(1, [{1,a},{3,c},{5,e},{6,f},{7,g}],
[{2,b},{4,d},{6,f}]),
- ?line [{1,a},{2,b},{3,c},{5,e},{7,g}] =
+ [{1,a},{2,b},{3,c},{5,e},{7,g}] =
lists:ukeymerge(1, [{2,b}], [{1,a},{2,b},{3,c},{5,e},{7,g}]),
- ?line [{1,a},{2,b},{3,c},{4,d},{5,e},{7,g}] =
+ [{1,a},{2,b},{3,c},{4,d},{5,e},{7,g}] =
lists:ukeymerge(1, [{2,b},{4,d}],
[{1,a},{2,b},{3,c},{4,d},{5,e},{7,g}]),
- ?line [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g}] =
+ [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g}] =
lists:ukeymerge(1, [{2,b},{4,d},{6,f}],
- [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g}]),
+ [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{7,g}]),
L1 = [{a,1},{a,3},{a,5},{a,7}],
L2 = [{b,1},{b,3},{b,5},{b,7}],
- ?line L1 = lists:ukeymerge(2, L1, L2),
+ L1 = lists:ukeymerge(2, L1, L2),
ok.
-rukeymerge(suite) -> [];
-rukeymerge(doc) ->
- ["Reverse merge two lists while removing duplicates."];
+%% Reverse merge two lists while removing duplicates.
rukeymerge(Conf) when is_list(Conf) ->
Two = [{2,b},{1,a}],
Six = [{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}],
%% 2-way reversed unique keymerge
- ?line [] = lists:rukeymerge(1, [], []),
- ?line Two = lists:rukeymerge(1, Two, []),
- ?line Two = lists:rukeymerge(1, [], Two),
- ?line Six = lists:rukeymerge(1, [{5,e},{3,c},{1,a}], [{6,f},{4,d},{2,b}]),
- ?line Six = lists:rukeymerge(1, [{6,f},{4,d},{2,b}], [{5,e},{3,c},{1,a}]),
- ?line Six = lists:rukeymerge(1, [{3,c},{2,b},{1,a}], [{6,f},{5,e},{4,d}]),
- ?line Six = lists:rukeymerge(1, [{6,f},{5,e},{4,d}], [{3,c},{2,b},{1,a}]),
- ?line Six = lists:rukeymerge(1, [{4,d},{3,c},{2,b}],[{6,f},{5,e},{1,a}]),
- ?line [{7,g},{6,f},{5,e},{3,c},{1,a}] =
+ [] = lists:rukeymerge(1, [], []),
+ Two = lists:rukeymerge(1, Two, []),
+ Two = lists:rukeymerge(1, [], Two),
+ Six = lists:rukeymerge(1, [{5,e},{3,c},{1,a}], [{6,f},{4,d},{2,b}]),
+ Six = lists:rukeymerge(1, [{6,f},{4,d},{2,b}], [{5,e},{3,c},{1,a}]),
+ Six = lists:rukeymerge(1, [{3,c},{2,b},{1,a}], [{6,f},{5,e},{4,d}]),
+ Six = lists:rukeymerge(1, [{6,f},{5,e},{4,d}], [{3,c},{2,b},{1,a}]),
+ Six = lists:rukeymerge(1, [{4,d},{3,c},{2,b}],[{6,f},{5,e},{1,a}]),
+ [{7,g},{6,f},{5,e},{3,c},{1,a}] =
lists:rukeymerge(1, [{7,g},{5,e},{3,c},{1,a}], [{6,f}]),
- ?line [{7,g},{6,f},{5,e},{4,d},{3,c},{1,a}] =
+ [{7,g},{6,f},{5,e},{4,d},{3,c},{1,a}] =
lists:rukeymerge(1, [{7,g},{5,e},{3,c},{1,a}], [{6,f},{4,d}]),
- ?line [{7,g},{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}] =
+ [{7,g},{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}] =
lists:rukeymerge(1, [{7,g},{5,e},{3,c},{1,a}], [{6,f},{4,d},{2,b}]),
- ?line [{7,g},{5,e},{3,c},{2,b},{1,a}] =
+ [{7,g},{5,e},{3,c},{2,b},{1,a}] =
lists:rukeymerge(1, [{2,b}], [{7,g},{5,e},{3,c},{1,a}]),
- ?line [{7,g},{5,e},{4,d},{3,c},{2,b},{1,a}] =
+ [{7,g},{5,e},{4,d},{3,c},{2,b},{1,a}] =
lists:rukeymerge(1, [{4,d},{2,b}], [{7,g},{5,e},{3,c},{1,a}]),
- ?line [{7,g},{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}] =
+ [{7,g},{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}] =
lists:rukeymerge(1, [{6,f},{4,d},{2,b}], [{7,g},{5,e},{3,c},{1,a}]),
- ?line [{7,g},{6,f},{5,e},{3,c},{1,a}] =
+ [{7,g},{6,f},{5,e},{3,c},{1,a}] =
lists:rukeymerge(1, [{7,g},{6,f},{5,e},{3,c},{1,a}], [{6,f}]),
- ?line [{7,g},{6,f},{5,e},{4,d},{3,c},{1,a}] =
+ [{7,g},{6,f},{5,e},{4,d},{3,c},{1,a}] =
lists:rukeymerge(1, [{7,g},{6,f},{5,e},{4,d},{3,c},{1,a}],
[{6,f},{4,d}]),
- ?line [{7,g},{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}] =
+ [{7,g},{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}] =
lists:rukeymerge(1, [{7,g},{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}],
- [{6,f},{4,d},{2,b}]),
- ?line [{7,g},{5,e},{3,c},{2,b},{1,a}] =
+ [{6,f},{4,d},{2,b}]),
+ [{7,g},{5,e},{3,c},{2,b},{1,a}] =
lists:rukeymerge(1, [{2,b}], [{7,g},{5,e},{3,c},{2,b},{1,a}]),
- ?line [{7,g},{5,e},{4,d},{3,c},{2,b},{1,a}] =
+ [{7,g},{5,e},{4,d},{3,c},{2,b},{1,a}] =
lists:rukeymerge(1, [{4,d},{2,b}],
[{7,g},{5,e},{4,d},{3,c},{2,b},{1,a}]),
- ?line [{7,g},{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}] =
+ [{7,g},{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}] =
lists:rukeymerge(1, [{6,f},{4,d},{2,b}],
- [{7,g},{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}]),
+ [{7,g},{6,f},{5,e},{4,d},{3,c},{2,b},{1,a}]),
L1 = [{a,1},{a,3},{a,5},{a,7}],
L2 = [{b,1},{b,3},{b,5},{b,7}],
- ?line true =
+ true =
lists:ukeymerge(2, L1, L2) ==
lists:reverse(lists:rukeymerge(2, lists:reverse(L1),
lists:reverse(L2))),
ok.
-ukeysort_1(doc) -> ["ukeysort"];
-ukeysort_1(suite) -> [];
ukeysort_1(Config) when is_list(Config) ->
- ?line ok = ukeysort_check(1, [], []),
- ?line ok = ukeysort_check(1, [{a,b}], [{a,b}]),
- ?line ok = ukeysort_check(1, [{a,b},{a,b}], [{a,b}]),
- ?line ok = ukeysort_check(1, [{a,b},{b,c}], [{a,b},{b,c}]),
- ?line ok = ukeysort_check(1, [{b,c},{a,b}], [{a,b},{b,c}]),
- ?line ok = ukeysort_check(1,
- [{1,e},{3,f},{2,y},{0,z},{x,14}],
- [{0,z},{1,e},{2,y},{3,f},{x,14}]),
- ?line ok = ukeysort_check(1, [{1,a},{1,a},{1,a},{1,a}], [{1,a}]),
+ ok = ukeysort_check(1, [], []),
+ ok = ukeysort_check(1, [{a,b}], [{a,b}]),
+ ok = ukeysort_check(1, [{a,b},{a,b}], [{a,b}]),
+ ok = ukeysort_check(1, [{a,b},{b,c}], [{a,b},{b,c}]),
+ ok = ukeysort_check(1, [{b,c},{a,b}], [{a,b},{b,c}]),
+ ok = ukeysort_check(1,
+ [{1,e},{3,f},{2,y},{0,z},{x,14}],
+ [{0,z},{1,e},{2,y},{3,f},{x,14}]),
+ ok = ukeysort_check(1, [{1,a},{1,a},{1,a},{1,a}], [{1,a}]),
L1 = [{1,a},{1,b},{1,a}],
L1u = lists:ukeysort(1, L1),
L2 = [{1,a},{1,b},{1,a}],
L2u = lists:ukeysort(1, L2),
- ?line ok = ukeysort_check(1, lists:keymerge(1, L1, L2),
- lists:ukeymerge(1, L1u, L2u)),
+ ok = ukeysort_check(1, lists:keymerge(1, L1, L2),
+ lists:ukeymerge(1, L1u, L2u)),
L3 = [{1,a},{1,b},{1,a},{2,a}],
L3u = lists:ukeysort(1, L3),
- ?line ok = ukeysort_check(1, lists:keymerge(1, L3, L2),
- lists:ukeymerge(1, L3u, L2u)),
+ ok = ukeysort_check(1, lists:keymerge(1, L3, L2),
+ lists:ukeymerge(1, L3u, L2u)),
L4 = [{1,b},{1,a}],
L4u = lists:ukeysort(1, L4),
- ?line ok = ukeysort_check(1, lists:keymerge(1, L1, L4),
- lists:ukeymerge(1, L1u, L4u)),
+ ok = ukeysort_check(1, lists:keymerge(1, L1, L4),
+ lists:ukeymerge(1, L1u, L4u)),
L5 = [{1,a},{1,b},{1,a},{2,a}],
L5u = lists:ukeysort(1, L5),
- ?line ok = ukeysort_check(1, lists:keymerge(1, [], L5),
- lists:ukeymerge(1, [], L5u)),
- ?line ok = ukeysort_check(1, lists:keymerge(1, L5, []),
- lists:ukeymerge(1, L5u, [])),
+ ok = ukeysort_check(1, lists:keymerge(1, [], L5),
+ lists:ukeymerge(1, [], L5u)),
+ ok = ukeysort_check(1, lists:keymerge(1, L5, []),
+ lists:ukeymerge(1, L5u, [])),
L6 = [{3,a}],
L6u = lists:ukeysort(1, L6),
- ?line ok = ukeysort_check(1, lists:keymerge(1, L5, L6),
- lists:ukeymerge(1, L5u, L6u)),
+ ok = ukeysort_check(1, lists:keymerge(1, L5, L6),
+ lists:ukeymerge(1, L5u, L6u)),
- ?line [{b,1},{c,1}] = lists:ukeysort(1, [{c,1},{c,1},{c,1},{c,1},{b,1}]),
- ?line [{a,0},{b,2},{c,3},{d,4}] =
- lists:ukeysort(1, [{d,4},{c,3},{b,2},{b,2},{a,0}]),
- ?line [{a,0},{b,1},{c,1}] =
- lists:ukeysort(1, [{c,1},{b,1},{b,1},{b,2},{b,2},{a,0}]),
- ?line [{a,0},{b,1},{c,1},{d,4}] =
- lists:ukeysort(1, [{c,1},{b,1},{b,2},{a,0},{a,0},{d,4},{d,4}]),
+ [{b,1},{c,1}] = lists:ukeysort(1, [{c,1},{c,1},{c,1},{c,1},{b,1}]),
+ [{a,0},{b,2},{c,3},{d,4}] =
+ lists:ukeysort(1, [{d,4},{c,3},{b,2},{b,2},{a,0}]),
+ [{a,0},{b,1},{c,1}] =
+ lists:ukeysort(1, [{c,1},{b,1},{b,1},{b,2},{b,2},{a,0}]),
+ [{a,0},{b,1},{c,1},{d,4}] =
+ lists:ukeysort(1, [{c,1},{b,1},{b,2},{a,0},{a,0},{d,4},{d,4}]),
SFun = fun(L) -> fun(X) -> ukeysort_check(2, X, L) end end,
PL = [{a,1},{b,2},{c,3},{d,4},{e,5},{f,6}],
Ps = perms([{a,1},{b,2},{c,3},{d,4},{e,5},{f,6},{b,2},{a,1}]),
- ?line lists:foreach(SFun(PL), Ps),
+ lists:foreach(SFun(PL), Ps),
M1L = [{1,a},{1,a},{2,b}],
M1s = [{1,a},{2,b}],
- ?line lists:foreach(SFun(M1s), perms(M1L)),
+ lists:foreach(SFun(M1s), perms(M1L)),
M2L = [{1,a},{2,b},{2,b}],
M2s = [{1,a},{2,b}],
- ?line lists:foreach(SFun(M2s), perms(M2L)),
+ lists:foreach(SFun(M2s), perms(M2L)),
M3 = [{1,a},{2,b},{3,c}],
- ?line lists:foreach(SFun(M3), perms(M3)),
+ lists:foreach(SFun(M3), perms(M3)),
ok.
-ukeysort_stable(doc) -> ["ukeysort should keep the first duplicate"];
-ukeysort_stable(suite) -> [];
+%% ukeysort should keep the first duplicate.
ukeysort_stable(Config) when is_list(Config) ->
- ?line ok = ukeysort_check(1, [{1,b},{1,c}], [{1,b}]),
- ?line ok = ukeysort_check(1, [{1,c},{1,b}], [{1,c}]),
- ?line ok = ukeysort_check(1,
- [{1,c},{1,b},{2,x},{3,p},{2,a}],
- [{1,c},{2,x},{3,p}]),
-
- ?line ok = ukeysort_check(1, [{1,a},{1,b},{1,b}], [{1,a}]),
- ?line ok = ukeysort_check(1, [{2,a},{1,b},{2,a}], [{1,b},{2,a}]),
-
- ?line ok = ukeysort_check_stability(bigfunlist(3)),
- ?line ok = ukeysort_check_stability(bigfunlist(10)),
- ?line ok = ukeysort_check_stability(bigfunlist(100)),
- ?line ok = ukeysort_check_stability(bigfunlist(1000)),
- ?line case erlang:system_info(modified_timing_level) of
- undefined -> ok = ukeysort_check_stability(bigfunlist(10000));
- _ -> ok
- end,
- ok.
-
-ukeysort_error(doc) -> ["ukeysort should exit when given bad arguments"];
-ukeysort_error(suite) -> [];
+ ok = ukeysort_check(1, [{1,b},{1,c}], [{1,b}]),
+ ok = ukeysort_check(1, [{1,c},{1,b}], [{1,c}]),
+ ok = ukeysort_check(1,
+ [{1,c},{1,b},{2,x},{3,p},{2,a}],
+ [{1,c},{2,x},{3,p}]),
+
+ ok = ukeysort_check(1, [{1,a},{1,b},{1,b}], [{1,a}]),
+ ok = ukeysort_check(1, [{2,a},{1,b},{2,a}], [{1,b},{2,a}]),
+
+ ok = ukeysort_check_stability(bigfunlist(3)),
+ ok = ukeysort_check_stability(bigfunlist(10)),
+ ok = ukeysort_check_stability(bigfunlist(100)),
+ ok = ukeysort_check_stability(bigfunlist(1000)),
+ case erlang:system_info(modified_timing_level) of
+ undefined -> ok = ukeysort_check_stability(bigfunlist(10000));
+ _ -> ok
+ end,
+ ok.
+
+%% ukeysort should exit when given bad arguments.
ukeysort_error(Config) when is_list(Config) ->
- ?line {'EXIT', _} = (catch lists:ukeysort(0, [{1,b},{1,c}])),
- ?line {'EXIT', _} = (catch lists:ukeysort(3, [{1,b},{1,c}])),
- ?line {'EXIT', _} = (catch lists:ukeysort(1.5, [{1,b},{1,c}])),
- ?line {'EXIT', _} = (catch lists:ukeysort(x, [{1,b},{1,c}])),
- ?line {'EXIT', _} = (catch lists:ukeysort(x, [])),
- ?line {'EXIT', _} = (catch lists:ukeysort(x, [{1,b}])),
- ?line {'EXIT', _} = (catch lists:ukeysort(1, [a,b])),
- ?line {'EXIT', _} = (catch lists:ukeysort(1, [{1,b} | {1,c}])),
- ok.
-
-ukeysort_i(doc) -> ["ukeysort with other key than first element"];
-ukeysort_i(suite) -> [];
+ {'EXIT', _} = (catch lists:ukeysort(0, [{1,b},{1,c}])),
+ {'EXIT', _} = (catch lists:ukeysort(3, [{1,b},{1,c}])),
+ {'EXIT', _} = (catch lists:ukeysort(1.5, [{1,b},{1,c}])),
+ {'EXIT', _} = (catch lists:ukeysort(x, [{1,b},{1,c}])),
+ {'EXIT', _} = (catch lists:ukeysort(x, [])),
+ {'EXIT', _} = (catch lists:ukeysort(x, [{1,b}])),
+ {'EXIT', _} = (catch lists:ukeysort(1, [a,b])),
+ {'EXIT', _} = (catch lists:ukeysort(1, [{1,b} | {1,c}])),
+ ok.
+
+%% ukeysort with other key than first element.
ukeysort_i(Config) when is_list(Config) ->
- ?line ok = ukeysort_check(2, [{a,2},{b,1},{c,3}], [{b,1},{a,2},{c,3}]),
+ ok = ukeysort_check(2, [{a,2},{b,1},{c,3}], [{b,1},{a,2},{c,3}]),
ok.
-ukeysort_rand(doc) -> ["ukeysort on big randomized lists"];
-ukeysort_rand(suite) -> [];
+%% ukeysort on big randomized lists.
ukeysort_rand(Config) when is_list(Config) ->
- ?line ok = ukeysort_check3(2, biglist(10)),
- ?line ok = ukeysort_check3(2, biglist(100)),
- ?line ok = ukeysort_check3(2, biglist(1000)),
- ?line ok = ukeysort_check3(2, biglist(10000)),
+ ok = ukeysort_check3(2, biglist(10)),
+ ok = ukeysort_check3(2, biglist(100)),
+ ok = ukeysort_check3(2, biglist(1000)),
+ ok = ukeysort_check3(2, biglist(10000)),
- ?line ok = gen_ukeysort_check(1, ubiglist(10)),
- ?line ok = gen_ukeysort_check(1, ubiglist(100)),
- ?line ok = gen_ukeysort_check(1, ubiglist(1000)),
- ?line ok = gen_ukeysort_check(1, ubiglist(10000)),
+ ok = gen_ukeysort_check(1, ubiglist(10)),
+ ok = gen_ukeysort_check(1, ubiglist(100)),
+ ok = gen_ukeysort_check(1, ubiglist(1000)),
+ ok = gen_ukeysort_check(1, ubiglist(10000)),
ok.
%% Check that ukeysort/2 is stable and correct relative keysort/2.
@@ -1272,7 +1219,7 @@ ukeysort_check_stability(L) ->
%%% Uniquely keysort a list, check that the returned list is what we
%%% expected, and that it is actually sorted.
ukeysort_check(I, Input, Expected) ->
- ?line Expected = lists:ukeysort(I, Input),
+ Expected = lists:ukeysort(I, Input),
ucheck_sorted(I, Input, Expected).
ukeysort_check3(I, Input) ->
@@ -1309,8 +1256,7 @@ ukeycompare(I, J, A, B) when A =/= B,
-funmerge(doc) -> ["Merge two lists using a fun."];
-funmerge(suite) -> [];
+%% Merge two lists using a fun.
funmerge(Config) when is_list(Config) ->
Two = [1,2],
@@ -1318,29 +1264,28 @@ funmerge(Config) when is_list(Config) ->
F = fun(X, Y) -> X =< Y end,
%% 2-way merge
- ?line [] = lists:merge(F, [], []),
- ?line Two = lists:merge(F, Two, []),
- ?line Two = lists:merge(F, [], Two),
- ?line Six = lists:merge(F, [1,3,5], [2,4,6]),
- ?line Six = lists:merge(F, [2,4,6], [1,3,5]),
- ?line Six = lists:merge(F, [1,2,3], [4,5,6]),
- ?line Six = lists:merge(F, [4,5,6], [1,2,3]),
- ?line Six = lists:merge(F, [1,2,5],[3,4,6]),
- ?line [1,2,3,5,7] = lists:merge(F, [1,3,5,7], [2]),
- ?line [1,2,3,4,5,7] = lists:merge(F, [1,3,5,7], [2,4]),
- ?line [1,2,3,4,5,6,7] = lists:merge(F, [1,3,5,7], [2,4,6]),
- ?line [1,2,3,5,7] = lists:merge(F, [2], [1,3,5,7]),
- ?line [1,2,3,4,5,7] = lists:merge(F, [2,4], [1,3,5,7]),
- ?line [1,2,3,4,5,6,7] = lists:merge(F, [2,4,6], [1,3,5,7]),
+ [] = lists:merge(F, [], []),
+ Two = lists:merge(F, Two, []),
+ Two = lists:merge(F, [], Two),
+ Six = lists:merge(F, [1,3,5], [2,4,6]),
+ Six = lists:merge(F, [2,4,6], [1,3,5]),
+ Six = lists:merge(F, [1,2,3], [4,5,6]),
+ Six = lists:merge(F, [4,5,6], [1,2,3]),
+ Six = lists:merge(F, [1,2,5],[3,4,6]),
+ [1,2,3,5,7] = lists:merge(F, [1,3,5,7], [2]),
+ [1,2,3,4,5,7] = lists:merge(F, [1,3,5,7], [2,4]),
+ [1,2,3,4,5,6,7] = lists:merge(F, [1,3,5,7], [2,4,6]),
+ [1,2,3,5,7] = lists:merge(F, [2], [1,3,5,7]),
+ [1,2,3,4,5,7] = lists:merge(F, [2,4], [1,3,5,7]),
+ [1,2,3,4,5,6,7] = lists:merge(F, [2,4,6], [1,3,5,7]),
F2 = fun(X,Y) -> element(1,X) =< element(1,Y) end,
- ?line [{b,2},{c,11},{c,12},{c,21},{c,22},{e,5}] =
+ [{b,2},{c,11},{c,12},{c,21},{c,22},{e,5}] =
lists:merge(F2,[{c,11},{c,12},{e,5}], [{b,2},{c,21},{c,22}]),
ok.
-rfunmerge(doc) -> ["Reverse merge two lists using a fun."];
-rfunmerge(suite) -> [];
+%% Reverse merge two lists using a fun.
rfunmerge(Config) when is_list(Config) ->
Two = [2,1],
@@ -1348,86 +1293,81 @@ rfunmerge(Config) when is_list(Config) ->
F = fun(X, Y) -> X =< Y end,
%% 2-way reversed merge
- ?line [] = lists:rmerge(F, [], []),
- ?line Two = lists:rmerge(F, Two, []),
- ?line Two = lists:rmerge(F, [], Two),
- ?line Six = lists:rmerge(F, [5,3,1], [6,4,2]),
- ?line Six = lists:rmerge(F, [6,4,2], [5,3,1]),
- ?line Six = lists:rmerge(F, [3,2,1], [6,5,4]),
- ?line Six = lists:rmerge(F, [6,5,4], [3,2,1]),
- ?line Six = lists:rmerge(F, [4,3,2],[6,5,1]),
- ?line [7,6,5,3,1] = lists:rmerge(F, [7,5,3,1], [6]),
- ?line [7,6,5,4,3,1] = lists:rmerge(F, [7,5,3,1], [6,4]),
- ?line [7,6,5,4,3,2,1] = lists:rmerge(F, [7,5,3,1], [6,4,2]),
- ?line [7,5,3,2,1] = lists:rmerge(F, [2], [7,5,3,1]),
- ?line [7,5,4,3,2,1] = lists:rmerge(F, [4,2], [7,5,3,1]),
- ?line [7,6,5,4,3,2,1] = lists:rmerge(F, [6,4,2], [7,5,3,1]),
+ [] = lists:rmerge(F, [], []),
+ Two = lists:rmerge(F, Two, []),
+ Two = lists:rmerge(F, [], Two),
+ Six = lists:rmerge(F, [5,3,1], [6,4,2]),
+ Six = lists:rmerge(F, [6,4,2], [5,3,1]),
+ Six = lists:rmerge(F, [3,2,1], [6,5,4]),
+ Six = lists:rmerge(F, [6,5,4], [3,2,1]),
+ Six = lists:rmerge(F, [4,3,2],[6,5,1]),
+ [7,6,5,3,1] = lists:rmerge(F, [7,5,3,1], [6]),
+ [7,6,5,4,3,1] = lists:rmerge(F, [7,5,3,1], [6,4]),
+ [7,6,5,4,3,2,1] = lists:rmerge(F, [7,5,3,1], [6,4,2]),
+ [7,5,3,2,1] = lists:rmerge(F, [2], [7,5,3,1]),
+ [7,5,4,3,2,1] = lists:rmerge(F, [4,2], [7,5,3,1]),
+ [7,6,5,4,3,2,1] = lists:rmerge(F, [6,4,2], [7,5,3,1]),
F2 = fun(X,Y) -> element(1,X) =< element(1,Y) end,
L1 = [{c,11},{c,12},{e,5}],
L2 = [{b,2},{c,21},{c,22}],
- ?line true =
+ true =
lists:merge(F2, L1, L2) ==
lists:reverse(lists:rmerge(F2,lists:reverse(L1), lists:reverse(L2))),
ok.
-funsort_1(doc) -> ["sort/2"];
-funsort_1(suite) -> [];
funsort_1(Config) when is_list(Config) ->
- ?line ok = funsort_check(1, [], []),
- ?line ok = funsort_check(1, [{a,b}], [{a,b}]),
- ?line ok = funsort_check(1, [{a,b},{a,b}], [{a,b},{a,b}]),
- ?line ok = funsort_check(1, [{a,b},{b,c}], [{a,b},{b,c}]),
- ?line ok = funsort_check(1, [{b,c},{a,b}], [{a,b},{b,c}]),
- ?line ok = funsort_check(1,
- [{1,e},{3,f},{2,y},{0,z},{x,14}],
- [{0,z},{1,e},{2,y},{3,f},{x,14}]),
+ ok = funsort_check(1, [], []),
+ ok = funsort_check(1, [{a,b}], [{a,b}]),
+ ok = funsort_check(1, [{a,b},{a,b}], [{a,b},{a,b}]),
+ ok = funsort_check(1, [{a,b},{b,c}], [{a,b},{b,c}]),
+ ok = funsort_check(1, [{b,c},{a,b}], [{a,b},{b,c}]),
+ ok = funsort_check(1,
+ [{1,e},{3,f},{2,y},{0,z},{x,14}],
+ [{0,z},{1,e},{2,y},{3,f},{x,14}]),
F = funsort_fun(1),
- ?line [{b,1},{c,1}] = lists:sort(F, [{c,1},{b,1}]),
- ?line [{a,0},{b,2},{c,3},{d,4}] =
- lists:sort(F, [{d,4},{c,3},{b,2},{a,0}]),
- ?line [{a,0},{b,1},{b,2},{c,1}] =
- lists:sort(F, [{c,1},{b,1},{b,2},{a,0}]),
- ?line [{a,0},{b,1},{b,2},{c,1},{d,4}] =
- lists:sort(F, [{c,1},{b,1},{b,2},{a,0},{d,4}]),
+ [{b,1},{c,1}] = lists:sort(F, [{c,1},{b,1}]),
+ [{a,0},{b,2},{c,3},{d,4}] =
+ lists:sort(F, [{d,4},{c,3},{b,2},{a,0}]),
+ [{a,0},{b,1},{b,2},{c,1}] =
+ lists:sort(F, [{c,1},{b,1},{b,2},{a,0}]),
+ [{a,0},{b,1},{b,2},{c,1},{d,4}] =
+ lists:sort(F, [{c,1},{b,1},{b,2},{a,0},{d,4}]),
SFun = fun(L) -> fun(X) -> funsort_check(1, X, L) end end,
L1 = [{1,a},{1,a},{2,b},{2,b},{3,c},{4,d},{5,e},{6,f}],
- ?line lists:foreach(SFun(L1), perms(L1)),
+ lists:foreach(SFun(L1), perms(L1)),
ok.
-funsort_stable(doc) -> ["sort/2 should be stable"];
-funsort_stable(suite) -> [];
+%% sort/2 should be stable.
funsort_stable(Config) when is_list(Config) ->
- ?line ok = funsort_check(1, [{1,b},{1,c}], [{1,b},{1,c}]),
- ?line ok = funsort_check(1, [{1,c},{1,b}], [{1,c},{1,b}]),
- ?line ok = funsort_check(1,
- [{1,c},{1,b},{2,x},{3,p},{2,a}],
- [{1,c},{1,b},{2,x},{2,a},{3,p}]),
+ ok = funsort_check(1, [{1,b},{1,c}], [{1,b},{1,c}]),
+ ok = funsort_check(1, [{1,c},{1,b}], [{1,c},{1,b}]),
+ ok = funsort_check(1,
+ [{1,c},{1,b},{2,x},{3,p},{2,a}],
+ [{1,c},{1,b},{2,x},{2,a},{3,p}]),
ok.
-funsort_error(doc) -> ["sort/2 should exit when given bad arguments"];
-funsort_error(suite) -> [];
+%% sort/2 should exit when given bad arguments.
funsort_error(Config) when is_list(Config) ->
- ?line {'EXIT', _} = (catch lists:sort(1, [{1,b} , {1,c}])),
- ?line {'EXIT', _} = (catch lists:sort(fun(X,Y) -> X =< Y end,
- [{1,b} | {1,c}])),
+ {'EXIT', _} = (catch lists:sort(1, [{1,b} , {1,c}])),
+ {'EXIT', _} = (catch lists:sort(fun(X,Y) -> X =< Y end,
+ [{1,b} | {1,c}])),
ok.
-funsort_rand(doc) -> ["sort/2 on big randomized lists"];
-funsort_rand(suite) -> [];
+%% sort/2 on big randomized lists.
funsort_rand(Config) when is_list(Config) ->
- ?line ok = funsort_check3(1, biglist(10)),
- ?line ok = funsort_check3(1, biglist(100)),
- ?line ok = funsort_check3(1, biglist(1000)),
- ?line ok = funsort_check3(1, biglist(10000)),
+ ok = funsort_check3(1, biglist(10)),
+ ok = funsort_check3(1, biglist(100)),
+ ok = funsort_check3(1, biglist(1000)),
+ ok = funsort_check3(1, biglist(10000)),
ok.
-% Do a keysort
+%% Do a keysort
funsort(I, L) ->
lists:sort(funsort_fun(I), L).
@@ -1437,12 +1377,11 @@ funsort_check3(I, Input) ->
%%% Keysort a list, check that the returned list is what we expected,
%%% and that it is actually sorted.
funsort_check(I, Input, Expected) ->
- ?line Expected = funsort(I, Input),
+ Expected = funsort(I, Input),
check_sorted(I, Input, Expected).
-ufunmerge(suite) -> [];
-ufunmerge(doc) -> ["Merge two lists while removing duplicates using a fun."];
+%% Merge two lists while removing duplicates using a fun.
ufunmerge(Conf) when is_list(Conf) ->
Two = [1,2],
@@ -1450,175 +1389,168 @@ ufunmerge(Conf) when is_list(Conf) ->
F = fun(X, Y) -> X =< Y end,
%% 2-way unique merge
- ?line [] = lists:umerge(F, [], []),
- ?line Two = lists:umerge(F, Two, []),
- ?line Two = lists:umerge(F, [], Two),
- ?line Six = lists:umerge(F, [1,3,5], [2,4,6]),
- ?line Six = lists:umerge(F, [2,4,6], [1,3,5]),
- ?line Six = lists:umerge(F, [1,2,3], [4,5,6]),
- ?line Six = lists:umerge(F, [4,5,6], [1,2,3]),
- ?line Six = lists:umerge(F, [1,2,5],[3,4,6]),
- ?line [1,2,3,5,7] = lists:umerge(F, [1,3,5,7], [2]),
- ?line [1,2,3,4,5,7] = lists:umerge(F, [1,3,5,7], [2,4]),
- ?line [1,2,3,4,5,6,7] = lists:umerge(F, [1,3,5,7], [2,4,6]),
- ?line [1,2,3,5,7] = lists:umerge(F, [2], [1,3,5,7]),
- ?line [1,2,3,4,5,7] = lists:umerge(F, [2,4], [1,3,5,7]),
- ?line [1,2,3,4,5,6,7] = lists:umerge(F, [2,4,6], [1,3,5,7]),
-
- ?line [1,2,3,5,7] = lists:umerge(F, [1,2,3,5,7], [2]),
- ?line [1,2,3,4,5,7] = lists:umerge(F, [1,2,3,4,5,7], [2,4]),
- ?line [1,2,3,4,5,6,7] = lists:umerge(F, [1,3,5,6,7], [2,4,6]),
- ?line [1,2,3,5,7] = lists:umerge(F, [2], [1,2,3,5,7]),
- ?line [1,2,3,4,5,7] = lists:umerge(F, [2,4], [1,2,3,4,5,7]),
- ?line [1,2,3,4,5,6,7] = lists:umerge(F, [2,4,6], [1,2,3,4,5,6,7]),
+ [] = lists:umerge(F, [], []),
+ Two = lists:umerge(F, Two, []),
+ Two = lists:umerge(F, [], Two),
+ Six = lists:umerge(F, [1,3,5], [2,4,6]),
+ Six = lists:umerge(F, [2,4,6], [1,3,5]),
+ Six = lists:umerge(F, [1,2,3], [4,5,6]),
+ Six = lists:umerge(F, [4,5,6], [1,2,3]),
+ Six = lists:umerge(F, [1,2,5],[3,4,6]),
+ [1,2,3,5,7] = lists:umerge(F, [1,3,5,7], [2]),
+ [1,2,3,4,5,7] = lists:umerge(F, [1,3,5,7], [2,4]),
+ [1,2,3,4,5,6,7] = lists:umerge(F, [1,3,5,7], [2,4,6]),
+ [1,2,3,5,7] = lists:umerge(F, [2], [1,3,5,7]),
+ [1,2,3,4,5,7] = lists:umerge(F, [2,4], [1,3,5,7]),
+ [1,2,3,4,5,6,7] = lists:umerge(F, [2,4,6], [1,3,5,7]),
+
+ [1,2,3,5,7] = lists:umerge(F, [1,2,3,5,7], [2]),
+ [1,2,3,4,5,7] = lists:umerge(F, [1,2,3,4,5,7], [2,4]),
+ [1,2,3,4,5,6,7] = lists:umerge(F, [1,3,5,6,7], [2,4,6]),
+ [1,2,3,5,7] = lists:umerge(F, [2], [1,2,3,5,7]),
+ [1,2,3,4,5,7] = lists:umerge(F, [2,4], [1,2,3,4,5,7]),
+ [1,2,3,4,5,6,7] = lists:umerge(F, [2,4,6], [1,2,3,4,5,6,7]),
L1 = [{a,1},{a,3},{a,5},{a,7}],
L2 = [{b,1},{b,3},{b,5},{b,7}],
F2 = fun(X,Y) -> element(2,X) =< element(2,Y) end,
- ?line L1 = lists:umerge(F2, L1, L2),
- ?line [{b,2},{e,5},{c,11},{c,12},{c,21},{c,22}] =
+ L1 = lists:umerge(F2, L1, L2),
+ [{b,2},{e,5},{c,11},{c,12},{c,21},{c,22}] =
lists:umerge(F2, [{e,5},{c,11},{c,12}], [{b,2},{c,21},{c,22}]),
ok.
-rufunmerge(suite) -> [];
-rufunmerge(doc) ->
- ["Reverse merge two lists while removing duplicates using a fun."];
+%% Reverse merge two lists while removing duplicates using a fun.
rufunmerge(Conf) when is_list(Conf) ->
Two = [2,1],
Six = [6,5,4,3,2,1],
F = fun(X, Y) -> X =< Y end,
%% 2-way reversed unique merge
- ?line [] = lists:rumerge(F, [], []),
- ?line Two = lists:rumerge(F, Two, []),
- ?line Two = lists:rumerge(F, [], Two),
- ?line Six = lists:rumerge(F, [5,3,1], [6,4,2]),
- ?line Six = lists:rumerge(F, [6,4,2], [5,3,1]),
- ?line Six = lists:rumerge(F, [3,2,1], [6,5,4]),
- ?line Six = lists:rumerge(F, [6,5,4], [3,2,1]),
- ?line Six = lists:rumerge(F, [4,3,2],[6,5,1]),
- ?line [7,6,5,3,1] = lists:rumerge(F, [7,5,3,1], [6]),
- ?line [7,6,5,4,3,1] = lists:rumerge(F, [7,5,3,1], [6,4]),
- ?line [7,6,5,4,3,2,1] = lists:rumerge(F, [7,5,3,1], [6,4,2]),
- ?line [7,5,3,2,1] = lists:rumerge(F, [2], [7,5,3,1]),
- ?line [7,5,4,3,2,1] = lists:rumerge(F, [4,2], [7,5,3,1]),
- ?line [7,6,5,4,3,2,1] = lists:rumerge(F, [6,4,2], [7,5,3,1]),
-
- ?line [7,6,5,3,1] = lists:rumerge(F, [7,6,5,3,1], [6]),
- ?line [7,6,5,4,3,1] = lists:rumerge(F, [7,6,5,4,3,1], [6,4]),
- ?line [7,6,5,4,3,2,1] = lists:rumerge(F, [7,6,5,4,3,2,1], [6,4,2]),
- ?line [7,5,3,2,1] = lists:rumerge(F, [2], [7,5,3,2,1]),
- ?line [7,5,4,3,2,1] = lists:rumerge(F, [4,2], [7,5,4,3,2,1]),
- ?line [7,6,5,4,3,2,1] = lists:rumerge(F, [6,4,2], [7,6,5,4,3,2,1]),
+ [] = lists:rumerge(F, [], []),
+ Two = lists:rumerge(F, Two, []),
+ Two = lists:rumerge(F, [], Two),
+ Six = lists:rumerge(F, [5,3,1], [6,4,2]),
+ Six = lists:rumerge(F, [6,4,2], [5,3,1]),
+ Six = lists:rumerge(F, [3,2,1], [6,5,4]),
+ Six = lists:rumerge(F, [6,5,4], [3,2,1]),
+ Six = lists:rumerge(F, [4,3,2],[6,5,1]),
+ [7,6,5,3,1] = lists:rumerge(F, [7,5,3,1], [6]),
+ [7,6,5,4,3,1] = lists:rumerge(F, [7,5,3,1], [6,4]),
+ [7,6,5,4,3,2,1] = lists:rumerge(F, [7,5,3,1], [6,4,2]),
+ [7,5,3,2,1] = lists:rumerge(F, [2], [7,5,3,1]),
+ [7,5,4,3,2,1] = lists:rumerge(F, [4,2], [7,5,3,1]),
+ [7,6,5,4,3,2,1] = lists:rumerge(F, [6,4,2], [7,5,3,1]),
+
+ [7,6,5,3,1] = lists:rumerge(F, [7,6,5,3,1], [6]),
+ [7,6,5,4,3,1] = lists:rumerge(F, [7,6,5,4,3,1], [6,4]),
+ [7,6,5,4,3,2,1] = lists:rumerge(F, [7,6,5,4,3,2,1], [6,4,2]),
+ [7,5,3,2,1] = lists:rumerge(F, [2], [7,5,3,2,1]),
+ [7,5,4,3,2,1] = lists:rumerge(F, [4,2], [7,5,4,3,2,1]),
+ [7,6,5,4,3,2,1] = lists:rumerge(F, [6,4,2], [7,6,5,4,3,2,1]),
F2 = fun(X,Y) -> element(1,X) =< element(1,Y) end,
L1 = [{1,a},{1,b},{1,a}],
L2 = [{1,a},{1,b},{1,a}],
- ?line true = lists:umerge(F2, L1, L2) ==
+ true = lists:umerge(F2, L1, L2) ==
lists:reverse(lists:rumerge(F, lists:reverse(L2), lists:reverse(L1))),
L3 = [{c,11},{c,12},{e,5}],
L4 = [{b,2},{c,21},{c,22}],
- ?line true =
+ true =
lists:umerge(F2, L3, L4) ==
lists:reverse(lists:rumerge(F2,lists:reverse(L3), lists:reverse(L4))),
ok.
-ufunsort_1(doc) -> ["usort/2"];
-ufunsort_1(suite) -> [];
ufunsort_1(Config) when is_list(Config) ->
- ?line ok = ufunsort_check(1, [], []),
- ?line ok = ufunsort_check(1, [{a,b}], [{a,b}]),
- ?line ok = ufunsort_check(1, [{a,b},{a,b}], [{a,b}]),
- ?line ok = ufunsort_check(1, [{a,b},{b,c}], [{a,b},{b,c}]),
- ?line ok = ufunsort_check(1, [{b,c},{a,b}], [{a,b},{b,c}]),
- ?line ok = ufunsort_check(1,
- [{1,e},{3,f},{2,y},{0,z},{x,14}],
- [{0,z},{1,e},{2,y},{3,f},{x,14}]),
- ?line ok = ufunsort_check(1,
- [{1,a},{2,b},{3,c},{2,b},{1,a},{2,b},{3,c},
- {2,b},{1,a}],
- [{1,a},{2,b},{3,c}]),
- ?line ok = ufunsort_check(1,
- [{1,a},{1,a},{1,b},{1,b},{1,a},{2,a}],
- [{1,a},{2,a}]),
+ ok = ufunsort_check(1, [], []),
+ ok = ufunsort_check(1, [{a,b}], [{a,b}]),
+ ok = ufunsort_check(1, [{a,b},{a,b}], [{a,b}]),
+ ok = ufunsort_check(1, [{a,b},{b,c}], [{a,b},{b,c}]),
+ ok = ufunsort_check(1, [{b,c},{a,b}], [{a,b},{b,c}]),
+ ok = ufunsort_check(1,
+ [{1,e},{3,f},{2,y},{0,z},{x,14}],
+ [{0,z},{1,e},{2,y},{3,f},{x,14}]),
+ ok = ufunsort_check(1,
+ [{1,a},{2,b},{3,c},{2,b},{1,a},{2,b},{3,c},
+ {2,b},{1,a}],
+ [{1,a},{2,b},{3,c}]),
+ ok = ufunsort_check(1,
+ [{1,a},{1,a},{1,b},{1,b},{1,a},{2,a}],
+ [{1,a},{2,a}]),
F = funsort_fun(1),
L1 = [{1,a},{1,b},{1,a}],
L2 = [{1,a},{1,b},{1,a}],
- ?line ok = ufunsort_check(1, lists:keymerge(1, L1, L2),
- lists:umerge(F, lists:usort(F, L1),
- lists:usort(F, L2))),
+ ok = ufunsort_check(1, lists:keymerge(1, L1, L2),
+ lists:umerge(F, lists:usort(F, L1),
+ lists:usort(F, L2))),
L3 = [{1,a},{1,b},{1,a},{2,a}],
- ?line ok = ufunsort_check(1, lists:keymerge(1, L3, L2),
- lists:umerge(F, lists:usort(F, L3),
- lists:usort(F, L2))),
+ ok = ufunsort_check(1, lists:keymerge(1, L3, L2),
+ lists:umerge(F, lists:usort(F, L3),
+ lists:usort(F, L2))),
L4 = [{1,b},{1,a}],
- ?line ok = ufunsort_check(1, lists:keymerge(1, L1, L4),
- lists:umerge(F, lists:usort(F, L1),
- lists:usort(F, L4))),
+ ok = ufunsort_check(1, lists:keymerge(1, L1, L4),
+ lists:umerge(F, lists:usort(F, L1),
+ lists:usort(F, L4))),
L5 = [{1,a},{1,b},{1,a},{2,a}],
- ?line ok = ufunsort_check(1, lists:keymerge(1, L5, []),
- lists:umerge(F, lists:usort(F, L5), [])),
+ ok = ufunsort_check(1, lists:keymerge(1, L5, []),
+ lists:umerge(F, lists:usort(F, L5), [])),
L6 = [{3,a}],
- ?line ok = ufunsort_check(1, lists:keymerge(1, L5, L6),
- lists:umerge(F, lists:usort(F, L5),
- lists:usort(F, L6))),
-
- ?line [{b,1},{c,1}] = lists:usort(F, [{c,1},{c,1},{b,1}]),
- ?line [{a,0},{b,2},{c,3},{d,4}] =
- lists:usort(F, [{d,4},{c,3},{b,2},{b,2},{a,0}]),
- ?line [{a,0},{b,1},{c,1}] =
- lists:usort(F, [{c,1},{b,1},{b,1},{b,2},{b,2},{a,0}]),
- ?line [{a,0},{b,1},{c,1},{d,4}] =
- lists:usort(F, [{c,1},{b,1},{b,2},{a,0},{a,0},{d,4},{d,4}]),
+ ok = ufunsort_check(1, lists:keymerge(1, L5, L6),
+ lists:umerge(F, lists:usort(F, L5),
+ lists:usort(F, L6))),
+
+ [{b,1},{c,1}] = lists:usort(F, [{c,1},{c,1},{b,1}]),
+ [{a,0},{b,2},{c,3},{d,4}] =
+ lists:usort(F, [{d,4},{c,3},{b,2},{b,2},{a,0}]),
+ [{a,0},{b,1},{c,1}] =
+ lists:usort(F, [{c,1},{b,1},{b,1},{b,2},{b,2},{a,0}]),
+ [{a,0},{b,1},{c,1},{d,4}] =
+ lists:usort(F, [{c,1},{b,1},{b,2},{a,0},{a,0},{d,4},{d,4}]),
SFun = fun(L) -> fun(X) -> ufunsort_check(1, X, L) end end,
PL = [{1,a},{2,b},{3,c},{4,d},{5,e},{6,f}],
Ps = perms([{1,a},{2,b},{3,c},{4,d},{5,e},{6,f},{2,b},{1,a}]),
- ?line lists:foreach(SFun(PL), Ps),
+ lists:foreach(SFun(PL), Ps),
ok.
-ufunsort_stable(doc) -> ["usort/2 should be stable"];
-ufunsort_stable(suite) -> [];
+%% usort/2 should be stable.
ufunsort_stable(Config) when is_list(Config) ->
- ?line ok = ufunsort_check(1, [{1,b},{1,c}], [{1,b}]),
- ?line ok = ufunsort_check(1, [{1,c},{1,b}], [{1,c}]),
- ?line ok = ufunsort_check(1,
- [{1,c},{1,b},{2,x},{3,p},{2,a}],
- [{1,c},{2,x},{3,p}]),
-
- ?line ok = ufunsort_check_stability(bigfunlist(10)),
- ?line ok = ufunsort_check_stability(bigfunlist(100)),
- ?line ok = ufunsort_check_stability(bigfunlist(1000)),
- ?line case erlang:system_info(modified_timing_level) of
- undefined -> ok = ufunsort_check_stability(bigfunlist(10000));
- _ -> ok
- end,
- ok.
-
-ufunsort_error(doc) -> ["usort/2 should exit when given bad arguments"];
-ufunsort_error(suite) -> [];
+ ok = ufunsort_check(1, [{1,b},{1,c}], [{1,b}]),
+ ok = ufunsort_check(1, [{1,c},{1,b}], [{1,c}]),
+ ok = ufunsort_check(1,
+ [{1,c},{1,b},{2,x},{3,p},{2,a}],
+ [{1,c},{2,x},{3,p}]),
+
+ ok = ufunsort_check_stability(bigfunlist(10)),
+ ok = ufunsort_check_stability(bigfunlist(100)),
+ ok = ufunsort_check_stability(bigfunlist(1000)),
+ case erlang:system_info(modified_timing_level) of
+ undefined -> ok = ufunsort_check_stability(bigfunlist(10000));
+ _ -> ok
+ end,
+ ok.
+
+%% usort/2 should exit when given bad arguments.
ufunsort_error(Config) when is_list(Config) ->
- ?line {'EXIT', _} = (catch lists:usort(1, [{1,b} , {1,c}])),
- ?line {'EXIT', _} = (catch lists:usort(fun(X,Y) -> X =< Y end,
- [{1,b} | {1,c}])),
+ {'EXIT', _} = (catch lists:usort(1, [{1,b} , {1,c}])),
+ {'EXIT', _} = (catch lists:usort(fun(X,Y) -> X =< Y end,
+ [{1,b} | {1,c}])),
ok.
-ufunsort_rand(doc) -> ["usort/2 on big randomized lists"];
-ufunsort_rand(suite) -> [];
+%% usort/2 on big randomized lists.
ufunsort_rand(Config) when is_list(Config) ->
- ?line ok = ufunsort_check3(1, biglist(10)),
- ?line ok = ufunsort_check3(1, biglist(100)),
- ?line ok = ufunsort_check3(1, biglist(1000)),
- ?line ok = ufunsort_check3(1, biglist(10000)),
+ ok = ufunsort_check3(1, biglist(10)),
+ ok = ufunsort_check3(1, biglist(100)),
+ ok = ufunsort_check3(1, biglist(1000)),
+ ok = ufunsort_check3(1, biglist(10000)),
- ?line ok = gen_ufunsort_check(1, ubiglist(100)),
- ?line ok = gen_ufunsort_check(1, ubiglist(1000)),
- ?line ok = gen_ufunsort_check(1, ubiglist(10000)),
+ ok = gen_ufunsort_check(1, ubiglist(100)),
+ ok = gen_ufunsort_check(1, ubiglist(1000)),
+ ok = gen_ufunsort_check(1, ubiglist(10000)),
ok.
%% Check that usort/2 is stable and correct relative sort/2.
@@ -1646,10 +1578,10 @@ ufunsort_check3(I, Input) ->
%%% Keysort a list, check that the returned list is what we expected,
%%% and that it is actually sorted.
ufunsort_check(I, Input, Expected) ->
- ?line Expected = ufunsort(I, Input),
+ Expected = ufunsort(I, Input),
ucheck_sorted(I, Input, Expected).
-% Do a keysort
+%% Do a keysort
ufunsort(I, L) ->
lists:usort(funsort_fun(I), L).
@@ -1701,7 +1633,7 @@ ubiglist(0, L) ->
ubiglist(N, L) ->
E = urandom_tuple(11, 6),
ubiglist(N-1, [E|L]).
-
+
urandom_tuple(N, I) ->
R1 = randint(N),
R2 = randint(I),
@@ -1733,7 +1665,7 @@ bigfunlist(0, _P, L) ->
bigfunlist(N, P, L) ->
{E, NP} = random_funtuple(P, 11),
bigfunlist(N-1, NP, [E | L]).
-
+
random_funtuple(P, N) ->
R = randint(N),
F = make_fun(),
@@ -1744,7 +1676,7 @@ random_funtuple(P, N) ->
make_fun() ->
Pid = spawn(?MODULE, make_fun, [self()]),
receive {Pid, Fun} -> Fun end.
-
+
make_fun(Pid) ->
Pid ! {self(), fun make_fun/1}.
@@ -1854,7 +1786,7 @@ sloop(N, S) ->
end,
sloop(N, NS)
end.
-
+
display_state(S) ->
io:format("sort: ~p~n", [S#state.sort]),
io:format("usort: ~p~n", [S#state.usort]),
@@ -2123,85 +2055,67 @@ rkeymerge2_2(_I, T1, _E1, [], M, H1) ->
%%%------------------------------------------------------------
-seq_loop(doc) ->
- ["Test for infinite loop (OTP-2404)."];
-seq_loop(suite) ->
- [];
+%% Test for infinite loop (OTP-2404).
seq_loop(Config) when is_list(Config) ->
- ?line _ = (catch lists:seq(1, 5, -1)),
+ _ = (catch lists:seq(1, 5, -1)),
ok.
-seq_2(doc) ->
- ["Non-error cases for seq/2"];
-seq_2(suite) ->
- [];
+%% Non-error cases for seq/2.
seq_2(Config) when is_list(Config) ->
- ?line [1,2,3] = lists:seq(1,3),
- ?line [1] = lists:seq(1,1),
- ?line Big = 748274827583793785928592859,
- ?line Big1 = Big+1,
- ?line Big2 = Big+2,
- ?line [Big, Big1, Big2] = lists:seq(Big, Big+2),
+ [1,2,3] = lists:seq(1,3),
+ [1] = lists:seq(1,1),
+ Big = 748274827583793785928592859,
+ Big1 = Big+1,
+ Big2 = Big+2,
+ [Big, Big1, Big2] = lists:seq(Big, Big+2),
ok.
-seq_2_e(doc) ->
- ["Error cases for seq/2"];
-seq_2_e(suite) ->
- [];
+%% Error cases for seq/2.
seq_2_e(Config) when is_list(Config) ->
- ?line seq_error([4, 2]),
- ?line seq_error([1, a]),
- ?line seq_error([1.0, 2.0]),
+ seq_error([4, 2]),
+ seq_error([1, a]),
+ seq_error([1.0, 2.0]),
ok.
seq_error(Args) ->
{'EXIT', _} = (catch apply(lists, seq, Args)).
-seq_3(doc) ->
- ["Non-error cases for seq/3"];
-seq_3(suite) ->
- [];
+%% Non-error cases for seq/3.
seq_3(Config) when is_list(Config) ->
- ?line [1,2,3] = lists:seq(1,3,1),
- ?line [1] = lists:seq(1,1,1),
- ?line Big = 748274827583793785928592859,
- ?line Big1 = Big+1,
- ?line Big2 = Big+2,
- ?line [Big, Big1, Big2] = lists:seq(Big, Big+2,1),
+ [1,2,3] = lists:seq(1,3,1),
+ [1] = lists:seq(1,1,1),
+ Big = 748274827583793785928592859,
+ Big1 = Big+1,
+ Big2 = Big+2,
+ [Big, Big1, Big2] = lists:seq(Big, Big+2,1),
- ?line [3,2,1] = lists:seq(3,1,-1),
- ?line [1] = lists:seq(1,1,-1),
+ [3,2,1] = lists:seq(3,1,-1),
+ [1] = lists:seq(1,1,-1),
- ?line [3,1] = lists:seq(3,1,-2),
- ?line [1] = lists:seq(1, 10, 10),
- ?line [1, 4, 7, 10, 13, 16, 19] = lists:seq(1, 19, 3),
- ?line [1, 4, 7, 10, 13, 16, 19] = lists:seq(1, 20, 3),
- ?line [1, 4, 7, 10, 13, 16, 19] = lists:seq(1, 21, 3),
+ [3,1] = lists:seq(3,1,-2),
+ [1] = lists:seq(1, 10, 10),
+ [1, 4, 7, 10, 13, 16, 19] = lists:seq(1, 19, 3),
+ [1, 4, 7, 10, 13, 16, 19] = lists:seq(1, 20, 3),
+ [1, 4, 7, 10, 13, 16, 19] = lists:seq(1, 21, 3),
- ?line [1] = lists:seq(1, 1, 0), %OTP-2613
+ [1] = lists:seq(1, 1, 0), %OTP-2613
ok.
-seq_3_e(doc) ->
- ["Error cases for seq/3"];
-seq_3_e(suite) ->
- [];
+%% Error cases for seq/3.
seq_3_e(Config) when is_list(Config) ->
- ?line seq_error([4, 2, 1]),
- ?line seq_error([3, 5, -1]),
- ?line seq_error([1, a, 1]),
- ?line seq_error([1.0, 2.0, 1]),
+ seq_error([4, 2, 1]),
+ seq_error([3, 5, -1]),
+ seq_error([1, a, 1]),
+ seq_error([1.0, 2.0, 1]),
- ?line seq_error([1, 3, 1.0]),
- ?line seq_error([1, 3, a]),
- ?line seq_error([1, 3, 0]),
+ seq_error([1, 3, 1.0]),
+ seq_error([1, 3, a]),
+ seq_error([1, 3, 0]),
- ?line seq_error([a, a, 0]),
+ seq_error([a, a, 0]),
ok.
-otp_7230(doc) ->
- ["OTP-7230. seq/1,2 returns the empty list"];
-otp_7230(suite) ->
- [];
+%% OTP-7230. seq/1,2 returns the empty list.
otp_7230(Config) when is_list(Config) ->
From = -10,
To = 10,
@@ -2210,26 +2124,26 @@ otp_7230(Config) when is_list(Config) ->
L = lists:seq(From, To),
SL = lists:seq(StepFrom, StepTo),
- ?line [] =
- [{F, T, S} ||
- F <- L, T <- L, S <- SL,
- not check_seq(F, T, S, catch lists:seq(F, T, S))
- orelse
- S =:= 1 andalso not check_seq(F, T, S, catch lists:seq(F, T))
+ [] =
+ [{F, T, S} ||
+ F <- L, T <- L, S <- SL,
+ not check_seq(F, T, S, catch lists:seq(F, T, S))
+ orelse
+ S =:= 1 andalso not check_seq(F, T, S, catch lists:seq(F, T))
].
check_seq(From, To, 0, R) ->
- From =:= To andalso R =:= [From]
- orelse
- From =/= To andalso is_tuple(R) andalso element(1, R) =:= 'EXIT';
+ From =:= To andalso R =:= [From]
+ orelse
+ From =/= To andalso is_tuple(R) andalso element(1, R) =:= 'EXIT';
check_seq(From, To, Step, []) when Step =/= 0 ->
- 0 =:= property(From, To, Step)
- andalso
- (
- Step > 0 andalso To < From andalso From-To =< Step
- orelse
- Step < 0 andalso To > From andalso To-From =< -Step
- );
+ 0 =:= property(From, To, Step)
+ andalso
+ (
+ Step > 0 andalso To < From andalso From-To =< Step
+ orelse
+ Step < 0 andalso To > From andalso To-From =< -Step
+ );
check_seq(From, To, Step, R) when R =/= [], To < From, Step > 0 ->
is_tuple(R) andalso element(1, R) =:= 'EXIT';
check_seq(From, To, Step, R) when R =/= [], To > From, Step < 0 ->
@@ -2240,27 +2154,27 @@ check_seq(From, To, Step, L) when is_list(L), L =/= [], Step =/= 0 ->
Min = lists:min(L),
Max = lists:max(L),
- [] =:= [E || E <- L, not is_integer(E)]
- andalso
- %% The difference between two consecutive elements is Step:
- begin
- LS = [First-Step]++L,
- LR = L++[Last+Step],
- [Step] =:= lists:usort([B-A || {A,B} <- lists:zip(LS, LR)])
- end
- andalso
- %% The first element of L is From:
- From =:= First
- andalso
- %% No element outside the given interval:
- Min >= lists:min([From, To])
- andalso
- Max =< lists:max([From, To])
- andalso
- %% All elements are present:
- abs(To-Last) < abs(Step)
- andalso
- length(L) =:= property(From, To, Step);
+ [] =:= [E || E <- L, not is_integer(E)]
+ andalso
+ %% The difference between two consecutive elements is Step:
+ begin
+ LS = [First-Step]++L,
+ LR = L++[Last+Step],
+ [Step] =:= lists:usort([B-A || {A,B} <- lists:zip(LS, LR)])
+ end
+ andalso
+ %% The first element of L is From:
+ From =:= First
+ andalso
+ %% No element outside the given interval:
+ Min >= lists:min([From, To])
+ andalso
+ Max =< lists:max([From, To])
+ andalso
+ %% All elements are present:
+ abs(To-Last) < abs(Step)
+ andalso
+ length(L) =:= property(From, To, Step);
check_seq(_From, _To, _Step, _R) ->
false.
@@ -2270,25 +2184,22 @@ property(From, To, Step) ->
%%%------------------------------------------------------------
--define(sublist_error2(X,Y), ?line {'EXIT', _} = (catch lists:sublist(X,Y))).
--define(sublist_error3(X,Y,Z), ?line {'EXIT', _} = (catch lists:sublist(X,Y,Z))).
+-define(sublist_error2(X,Y), {'EXIT', _} = (catch lists:sublist(X,Y))).
+-define(sublist_error3(X,Y,Z), {'EXIT', _} = (catch lists:sublist(X,Y,Z))).
-sublist_2(doc) -> ["sublist/2"];
-sublist_2(suite) -> [];
sublist_2(Config) when is_list(Config) ->
- ?line [] = lists:sublist([], 0),
- ?line [] = lists:sublist([], 1),
- ?line [] = lists:sublist([a], 0),
- ?line [a] = lists:sublist([a], 1),
- ?line [a] = lists:sublist([a], 2),
- ?line [a] = lists:sublist([a|b], 1),
+ [] = lists:sublist([], 0),
+ [] = lists:sublist([], 1),
+ [] = lists:sublist([a], 0),
+ [a] = lists:sublist([a], 1),
+ [a] = lists:sublist([a], 2),
+ [a] = lists:sublist([a|b], 1),
- ?line [a,b] = lists:sublist([a,b|c], 2),
+ [a,b] = lists:sublist([a,b|c], 2),
ok.
-sublist_2_e(doc) -> ["sublist/2 error cases"];
-sublist_2_e(suite) -> [];
+%% sublist/2 error cases.
sublist_2_e(Config) when is_list(Config) ->
?sublist_error2([], -1),
?sublist_error2(a, -1),
@@ -2300,36 +2211,33 @@ sublist_2_e(Config) when is_list(Config) ->
?sublist_error2([], 1.5),
ok.
-sublist_3(doc) -> ["sublist/3"];
-sublist_3(suite) -> [];
sublist_3(Config) when is_list(Config) ->
- ?line [] = lists:sublist([], 1, 0),
- ?line [] = lists:sublist([], 1, 1),
- ?line [] = lists:sublist([a], 1, 0),
- ?line [a] = lists:sublist([a], 1, 1),
- ?line [a] = lists:sublist([a], 1, 2),
- ?line [a] = lists:sublist([a|b], 1, 1),
-
- ?line [] = lists:sublist([], 1, 0),
- ?line [] = lists:sublist([], 1, 1),
- ?line [] = lists:sublist([a], 1, 0),
- ?line [a] = lists:sublist([a], 1, 1),
- ?line [a] = lists:sublist([a], 1, 2),
- ?line [] = lists:sublist([a], 2, 1),
- ?line [] = lists:sublist([a], 2, 2),
- ?line [] = lists:sublist([a], 2, 79),
- ?line [] = lists:sublist([a,b|c], 1, 0),
- ?line [] = lists:sublist([a,b|c], 2, 0),
- ?line [a] = lists:sublist([a,b|c], 1, 1),
- ?line [b] = lists:sublist([a,b|c], 2, 1),
- ?line [a,b] = lists:sublist([a,b|c], 1, 2),
-
- ?line [] = lists:sublist([a], 2, 0),
-
- ok.
-
-sublist_3_e(doc) -> ["sublist/3 error cases"];
-sublist_3_e(suite) -> [];
+ [] = lists:sublist([], 1, 0),
+ [] = lists:sublist([], 1, 1),
+ [] = lists:sublist([a], 1, 0),
+ [a] = lists:sublist([a], 1, 1),
+ [a] = lists:sublist([a], 1, 2),
+ [a] = lists:sublist([a|b], 1, 1),
+
+ [] = lists:sublist([], 1, 0),
+ [] = lists:sublist([], 1, 1),
+ [] = lists:sublist([a], 1, 0),
+ [a] = lists:sublist([a], 1, 1),
+ [a] = lists:sublist([a], 1, 2),
+ [] = lists:sublist([a], 2, 1),
+ [] = lists:sublist([a], 2, 2),
+ [] = lists:sublist([a], 2, 79),
+ [] = lists:sublist([a,b|c], 1, 0),
+ [] = lists:sublist([a,b|c], 2, 0),
+ [a] = lists:sublist([a,b|c], 1, 1),
+ [b] = lists:sublist([a,b|c], 2, 1),
+ [a,b] = lists:sublist([a,b|c], 1, 2),
+
+ [] = lists:sublist([a], 2, 0),
+
+ ok.
+
+%% sublist/3 error cases
sublist_3_e(Config) when is_list(Config) ->
?sublist_error3([], 1, -1),
?sublist_error3(a, 1, -1),
@@ -2363,8 +2271,8 @@ sublist_3_e(Config) when is_list(Config) ->
%%%------------------------------------------------------------
--define(flatten_error1(X), ?line {'EXIT', _} = (catch lists:flatten(X))).
--define(flatten_error2(X,Y), ?line {'EXIT', _} = (catch lists:flatten(X,Y))).
+-define(flatten_error1(X), {'EXIT', _} = (catch lists:flatten(X))).
+-define(flatten_error2(X,Y), {'EXIT', _} = (catch lists:flatten(X,Y))).
%% Test lists:flatten/1,2 and lists:flatlength/1.
flatten_1(Config) when is_list(Config) ->
@@ -2385,8 +2293,7 @@ lists_flatten(List) ->
Len = length(Flat),
Flat.
-flatten_1_e(doc) -> ["flatten/1 error cases"];
-flatten_1_e(suite) -> [];
+%% flatten/1 error cases
flatten_1_e(Config) when is_list(Config) ->
?flatten_error1(a),
?flatten_error1([a|b]),
@@ -2404,60 +2311,59 @@ flatten_2(Config) when is_list(Config) ->
[a,b,c,[no,flatten]] = lists:flatten([[a,[b,c]]], [[no,flatten]]),
ok.
-flatten_2_e(doc) -> ["flatten/2 error cases"];
-flatten_2_e(suite) -> [];
+%% flatten/2 error cases.
flatten_2_e(Config) when is_list(Config) ->
ok.
%% Test lists:zip/2, lists:unzip/1.
zip_unzip(Config) when is_list(Config) ->
- ?line [] = lists:zip([], []),
- ?line [{a,b}] = lists:zip([a], [b]),
- ?line [{42.0,{kalle,nisse}},{a,b}] = lists:zip([42.0,a], [{kalle,nisse},b]),
+ [] = lists:zip([], []),
+ [{a,b}] = lists:zip([a], [b]),
+ [{42.0,{kalle,nisse}},{a,b}] = lists:zip([42.0,a], [{kalle,nisse},b]),
%% Longer lists.
- ?line SeqA = lists:seq(45, 200),
- ?line SeqB = [A*A || A <- SeqA],
- ?line AB = lists:zip(SeqA, SeqB),
- ?line SeqA = [A || {A,_} <- AB],
- ?line SeqB = [B || {_,B} <- AB],
- ?line {SeqA,SeqB} = lists:unzip(AB),
-
+ SeqA = lists:seq(45, 200),
+ SeqB = [A*A || A <- SeqA],
+ AB = lists:zip(SeqA, SeqB),
+ SeqA = [A || {A,_} <- AB],
+ SeqB = [B || {_,B} <- AB],
+ {SeqA,SeqB} = lists:unzip(AB),
+
%% Some more unzip/1.
- ?line {[],[]} = lists:unzip([]),
- ?line {[a],[b]} = lists:unzip([{a,b}]),
- ?line {[a,c],[b,d]} = lists:unzip([{a,b},{c,d}]),
+ {[],[]} = lists:unzip([]),
+ {[a],[b]} = lists:unzip([{a,b}]),
+ {[a,c],[b,d]} = lists:unzip([{a,b},{c,d}]),
%% Error cases.
- ?line {'EXIT',{function_clause,_}} = (catch lists:zip([], [b])),
- ?line {'EXIT',{function_clause,_}} = (catch lists:zip([a], [])),
- ?line {'EXIT',{function_clause,_}} = (catch lists:zip([a], [b,c])),
- ?line {'EXIT',{function_clause,_}} = (catch lists:zip([a], [b,c])),
+ {'EXIT',{function_clause,_}} = (catch lists:zip([], [b])),
+ {'EXIT',{function_clause,_}} = (catch lists:zip([a], [])),
+ {'EXIT',{function_clause,_}} = (catch lists:zip([a], [b,c])),
+ {'EXIT',{function_clause,_}} = (catch lists:zip([a], [b,c])),
ok.
%% Test lists:zip3/3, lists:unzip3/1.
zip_unzip3(Config) when is_list(Config) ->
- ?line [] = lists:zip3([], [], []),
- ?line [{a,b,c}] = lists:zip3([a], [b], [c]),
+ [] = lists:zip3([], [], []),
+ [{a,b,c}] = lists:zip3([a], [b], [c]),
%% Longer lists.
- ?line SeqA = lists:seq(45, 200),
- ?line SeqB = [2*A || A <- SeqA],
- ?line SeqC = [A*A || A <- SeqA],
- ?line ABC = lists:zip3(SeqA, SeqB, SeqC),
- ?line SeqA = [A || {A,_,_} <- ABC],
- ?line SeqB = [B || {_,B,_} <- ABC],
- ?line SeqC = [C || {_,_,C} <- ABC],
- ?line {SeqA,SeqB,SeqC} = lists:unzip3(ABC),
+ SeqA = lists:seq(45, 200),
+ SeqB = [2*A || A <- SeqA],
+ SeqC = [A*A || A <- SeqA],
+ ABC = lists:zip3(SeqA, SeqB, SeqC),
+ SeqA = [A || {A,_,_} <- ABC],
+ SeqB = [B || {_,B,_} <- ABC],
+ SeqC = [C || {_,_,C} <- ABC],
+ {SeqA,SeqB,SeqC} = lists:unzip3(ABC),
%% Some more unzip3/1.
- ?line {[],[],[]} = lists:unzip3([]),
- ?line {[a],[b],[c]} = lists:unzip3([{a,b,c}]),
+ {[],[],[]} = lists:unzip3([]),
+ {[a],[b],[c]} = lists:unzip3([{a,b,c}]),
%% Error cases.
- ?line {'EXIT',{function_clause,_}} = (catch lists:zip3([], [], [c])),
- ?line {'EXIT',{function_clause,_}} = (catch lists:zip3([], [b], [])),
- ?line {'EXIT',{function_clause,_}} = (catch lists:zip3([a], [], [])),
+ {'EXIT',{function_clause,_}} = (catch lists:zip3([], [], [c])),
+ {'EXIT',{function_clause,_}} = (catch lists:zip3([], [b], [])),
+ {'EXIT',{function_clause,_}} = (catch lists:zip3([a], [], [])),
ok.
@@ -2465,61 +2371,61 @@ zip_unzip3(Config) when is_list(Config) ->
zipwith(Config) when is_list(Config) ->
Zip = fun(A, B) -> [A|B] end,
- ?line [] = lists:zipwith(Zip, [], []),
- ?line [[a|b]] = lists:zipwith(Zip, [a], [b]),
+ [] = lists:zipwith(Zip, [], []),
+ [[a|b]] = lists:zipwith(Zip, [a], [b]),
%% Longer lists.
- ?line SeqA = lists:seq(77, 300),
- ?line SeqB = [A*A || A <- SeqA],
- ?line AB = lists:zipwith(Zip, SeqA, SeqB),
- ?line SeqA = [A || [A|_] <- AB],
- ?line SeqB = [B || [_|B] <- AB],
-
+ SeqA = lists:seq(77, 300),
+ SeqB = [A*A || A <- SeqA],
+ AB = lists:zipwith(Zip, SeqA, SeqB),
+ SeqA = [A || [A|_] <- AB],
+ SeqB = [B || [_|B] <- AB],
+
%% Error cases.
- ?line {'EXIT',{function_clause,_}} = (catch lists:zipwith(badfun, [], [])),
- ?line {'EXIT',{function_clause,_}} = (catch lists:zipwith(Zip, [], [b])),
- ?line {'EXIT',{function_clause,_}} = (catch lists:zipwith(Zip, [a], [])),
- ?line {'EXIT',{function_clause,_}} = (catch lists:zipwith(Zip, [a], [b,c])),
- ?line {'EXIT',{function_clause,_}} = (catch lists:zipwith(Zip, [a], [b,c])),
+ {'EXIT',{function_clause,_}} = (catch lists:zipwith(badfun, [], [])),
+ {'EXIT',{function_clause,_}} = (catch lists:zipwith(Zip, [], [b])),
+ {'EXIT',{function_clause,_}} = (catch lists:zipwith(Zip, [a], [])),
+ {'EXIT',{function_clause,_}} = (catch lists:zipwith(Zip, [a], [b,c])),
+ {'EXIT',{function_clause,_}} = (catch lists:zipwith(Zip, [a], [b,c])),
ok.
%% Test lists:zipwith3/4.
zipwith3(Config) when is_list(Config) ->
Zip = fun(A, B, C) -> [A,B,C] end,
- ?line [] = lists:zipwith3(Zip, [], [], []),
- ?line [[a,b,c]] = lists:zipwith3(Zip, [a], [b], [c]),
+ [] = lists:zipwith3(Zip, [], [], []),
+ [[a,b,c]] = lists:zipwith3(Zip, [a], [b], [c]),
%% Longer lists.
- ?line SeqA = lists:seq(45, 200),
- ?line SeqB = [2*A || A <- SeqA],
- ?line SeqC = [A*A || A <- SeqA],
- ?line ABC = lists:zipwith3(Zip, SeqA, SeqB, SeqC),
- ?line SeqA = [A || [A,_,_] <- ABC],
- ?line SeqB = [B || [_,B,_] <- ABC],
- ?line SeqC = [C || [_,_,C] <- ABC],
+ SeqA = lists:seq(45, 200),
+ SeqB = [2*A || A <- SeqA],
+ SeqC = [A*A || A <- SeqA],
+ ABC = lists:zipwith3(Zip, SeqA, SeqB, SeqC),
+ SeqA = [A || [A,_,_] <- ABC],
+ SeqB = [B || [_,B,_] <- ABC],
+ SeqC = [C || [_,_,C] <- ABC],
%% Error cases.
- ?line {'EXIT',{function_clause,_}} = (catch lists:zipwith3(badfun, [], [], [])),
- ?line {'EXIT',{function_clause,_}} = (catch lists:zipwith3(Zip, [], [], [c])),
- ?line {'EXIT',{function_clause,_}} = (catch lists:zipwith3(Zip, [], [b], [])),
- ?line {'EXIT',{function_clause,_}} = (catch lists:zipwith3(Zip, [a], [], [])),
+ {'EXIT',{function_clause,_}} = (catch lists:zipwith3(badfun, [], [], [])),
+ {'EXIT',{function_clause,_}} = (catch lists:zipwith3(Zip, [], [], [c])),
+ {'EXIT',{function_clause,_}} = (catch lists:zipwith3(Zip, [], [b], [])),
+ {'EXIT',{function_clause,_}} = (catch lists:zipwith3(Zip, [a], [], [])),
ok.
%% Test lists:filter/2, lists:partition/2.
filter_partition(Config) when is_list(Config) ->
F = fun(I) -> I rem 2 =:= 0 end,
- ?line filpart(F, [], []),
- ?line filpart(F, [1], []),
- ?line filpart(F, [1,3,17], []),
- ?line filpart(F, [1,2,3,17], [2]),
- ?line filpart(F, [6,8,1,2,3,17], [6,8,2]),
- ?line filpart(F, [6,8,1,2,42,3,17], [6,8,2,42]),
+ filpart(F, [], []),
+ filpart(F, [1], []),
+ filpart(F, [1,3,17], []),
+ filpart(F, [1,2,3,17], [2]),
+ filpart(F, [6,8,1,2,3,17], [6,8,2]),
+ filpart(F, [6,8,1,2,42,3,17], [6,8,2,42]),
%% Error cases.
- ?line {'EXIT',{function_clause,_}} = (catch lists:filter(badfun, [])),
- ?line {'EXIT',{function_clause,_}} = (catch lists:partition(badfun, [])),
+ {'EXIT',{function_clause,_}} = (catch lists:filter(badfun, [])),
+ {'EXIT',{function_clause,_}} = (catch lists:partition(badfun, [])),
ok.
filpart(F, All, Exp) ->
@@ -2528,8 +2434,7 @@ filpart(F, All, Exp) ->
{Exp,Other} = lists:partition(F, All).
-otp_5939(doc) -> ["OTP-5939. Guard tests added."];
-otp_5939(suite) -> [];
+%% OTP-5939. Guard tests added.
otp_5939(Config) when is_list(Config) ->
Fun1 = fun(A) -> A end,
Fun2 = fun(A, B) -> {A,B} end,
@@ -2538,163 +2443,161 @@ otp_5939(Config) when is_list(Config) ->
Fold = fun(_E, A) -> A end,
MapFold = fun(E, A) -> {E,A} end,
- ?line {'EXIT', _} = (catch lists:usort( [asd], [qwe])),
-
- ?line {'EXIT', _} = (catch lists:zipwith(func, [], [])),
- ?line [] = lists:zipwith(Fun2, [], []),
- ?line {'EXIT', _} = (catch lists:zipwith3(func, [], [], [])),
- ?line [] = lists:zipwith3(Fun3, [], [], []),
- ?line {'EXIT', _} = (catch lists:keymap(func, 1, [])),
- ?line {'EXIT', _} = (catch lists:keymap(Fun1, 0, [])),
- ?line [] = lists:keymap(Fun1, 1, []),
- ?line {'EXIT', _} = (catch lists:merge(func, [], [1])),
- ?line {'EXIT', _} = (catch lists:merge(func, [1], [])),
- ?line [] = lists:merge(Fun2, [], []),
- ?line {'EXIT', _} = (catch lists:rmerge(func, [], [1])),
- ?line {'EXIT', _} = (catch lists:rmerge(func, [1], [])),
- ?line [] = lists:rmerge(Fun2, [], []),
- ?line {'EXIT', _} = (catch lists:usort(func, [])),
- ?line {'EXIT', _} = (catch lists:usort(func, [a])),
- ?line {'EXIT', _} = (catch lists:usort(func, [a, b])),
- ?line [] = lists:usort(Fun2, []),
- ?line {'EXIT', _} = (catch lists:umerge(func, [], [1])),
- ?line {'EXIT', _} = (catch lists:merge(func, [1], [])),
- ?line [] = lists:umerge(Fun2, [], []),
- ?line {'EXIT', _} = (catch lists:rumerge(func, [], [1])),
- ?line {'EXIT', _} = (catch lists:rumerge(func, [1], [])),
- ?line [] = lists:rumerge(Fun2, [], []),
- ?line {'EXIT', _} = (catch lists:all(func, [])),
- ?line true = lists:all(Pred, []),
- ?line {'EXIT', _} = (catch lists:any(func, [])),
- ?line false = lists:any(Pred, []),
- ?line {'EXIT', _} = (catch lists:map(func, [])),
- ?line [] = lists:map(Fun1, []),
- ?line {'EXIT', _} = (catch lists:flatmap(func, [])),
- ?line [] = lists:flatmap(Fun1, []),
- ?line {'EXIT', _} = (catch lists:foldl(func, [], [])),
- ?line [] = lists:foldl(Fold, [], []),
- ?line {'EXIT', _} = (catch lists:foldr(func, [], [])),
- ?line [] = lists:foldr(Fold, [], []),
- ?line {'EXIT', _} = (catch lists:filter(func, [])),
- ?line [] = lists:filter(Pred, []),
- ?line {'EXIT', _} = (catch lists:partition(func, [])),
- ?line {[],[]} = lists:partition(Pred, []),
- ?line {'EXIT', _} = (catch lists:filtermap(func, [])),
- ?line [] = lists:filtermap(Fun1, []),
- ?line {'EXIT', _} = (catch lists:foreach(func, [])),
- ?line ok = lists:foreach(Fun1, []),
- ?line {'EXIT', _} = (catch lists:mapfoldl(func, [], [])),
- ?line {[],[]} = lists:mapfoldl(MapFold, [], []),
- ?line {'EXIT', _} = (catch lists:mapfoldr(func, [], [])),
- ?line {[],[]} = lists:mapfoldr(MapFold, [], []),
- ?line {'EXIT', _} = (catch lists:takewhile(func, [])),
- ?line [] = lists:takewhile(Pred, []),
- ?line {'EXIT', _} = (catch lists:dropwhile(func, [])),
- ?line [] = lists:dropwhile(Pred, []),
- ?line {'EXIT', _} = (catch lists:splitwith(func, [])),
- ?line {[],[]} = lists:splitwith(Pred, []),
-
- ok.
-
-otp_6023(doc) -> ["OTP-6023. lists:keyreplace/4, a typecheck."];
-otp_6023(suite) -> [];
+ {'EXIT', _} = (catch lists:usort( [asd], [qwe])),
+
+ {'EXIT', _} = (catch lists:zipwith(func, [], [])),
+ [] = lists:zipwith(Fun2, [], []),
+ {'EXIT', _} = (catch lists:zipwith3(func, [], [], [])),
+ [] = lists:zipwith3(Fun3, [], [], []),
+ {'EXIT', _} = (catch lists:keymap(func, 1, [])),
+ {'EXIT', _} = (catch lists:keymap(Fun1, 0, [])),
+ [] = lists:keymap(Fun1, 1, []),
+ {'EXIT', _} = (catch lists:merge(func, [], [1])),
+ {'EXIT', _} = (catch lists:merge(func, [1], [])),
+ [] = lists:merge(Fun2, [], []),
+ {'EXIT', _} = (catch lists:rmerge(func, [], [1])),
+ {'EXIT', _} = (catch lists:rmerge(func, [1], [])),
+ [] = lists:rmerge(Fun2, [], []),
+ {'EXIT', _} = (catch lists:usort(func, [])),
+ {'EXIT', _} = (catch lists:usort(func, [a])),
+ {'EXIT', _} = (catch lists:usort(func, [a, b])),
+ [] = lists:usort(Fun2, []),
+ {'EXIT', _} = (catch lists:umerge(func, [], [1])),
+ {'EXIT', _} = (catch lists:merge(func, [1], [])),
+ [] = lists:umerge(Fun2, [], []),
+ {'EXIT', _} = (catch lists:rumerge(func, [], [1])),
+ {'EXIT', _} = (catch lists:rumerge(func, [1], [])),
+ [] = lists:rumerge(Fun2, [], []),
+ {'EXIT', _} = (catch lists:all(func, [])),
+ true = lists:all(Pred, []),
+ {'EXIT', _} = (catch lists:any(func, [])),
+ false = lists:any(Pred, []),
+ {'EXIT', _} = (catch lists:map(func, [])),
+ [] = lists:map(Fun1, []),
+ {'EXIT', _} = (catch lists:flatmap(func, [])),
+ [] = lists:flatmap(Fun1, []),
+ {'EXIT', _} = (catch lists:foldl(func, [], [])),
+ [] = lists:foldl(Fold, [], []),
+ {'EXIT', _} = (catch lists:foldr(func, [], [])),
+ [] = lists:foldr(Fold, [], []),
+ {'EXIT', _} = (catch lists:filter(func, [])),
+ [] = lists:filter(Pred, []),
+ {'EXIT', _} = (catch lists:partition(func, [])),
+ {[],[]} = lists:partition(Pred, []),
+ {'EXIT', _} = (catch lists:filtermap(func, [])),
+ [] = lists:filtermap(Fun1, []),
+ {'EXIT', _} = (catch lists:foreach(func, [])),
+ ok = lists:foreach(Fun1, []),
+ {'EXIT', _} = (catch lists:mapfoldl(func, [], [])),
+ {[],[]} = lists:mapfoldl(MapFold, [], []),
+ {'EXIT', _} = (catch lists:mapfoldr(func, [], [])),
+ {[],[]} = lists:mapfoldr(MapFold, [], []),
+ {'EXIT', _} = (catch lists:takewhile(func, [])),
+ [] = lists:takewhile(Pred, []),
+ {'EXIT', _} = (catch lists:dropwhile(func, [])),
+ [] = lists:dropwhile(Pred, []),
+ {'EXIT', _} = (catch lists:splitwith(func, [])),
+ {[],[]} = lists:splitwith(Pred, []),
+
+ ok.
+
+%% OTP-6023. lists:keyreplace/4, a typecheck.
otp_6023(Config) when is_list(Config) ->
- ?line {'EXIT', _} = (catch lists:keyreplace(a, 2, [{1,a}], b)),
- ?line [{2,b}] = lists:keyreplace(a, 2, [{1,a}], {2,b}),
+ {'EXIT', _} = (catch lists:keyreplace(a, 2, [{1,a}], b)),
+ [{2,b}] = lists:keyreplace(a, 2, [{1,a}], {2,b}),
ok.
-otp_6606(doc) -> ["OTP-6606. sort and keysort bug"];
-otp_6606(suite) -> [];
+%% OTP-6606. sort and keysort bug.
otp_6606(Config) when is_list(Config) ->
I = 1,
F = float(1),
L1 = [{F,I},{F,F},{I,I},{I,F}],
- ?line L1 = lists:keysort(1, L1),
- ?line L1 = lists:sort(L1),
+ L1 = lists:keysort(1, L1),
+ L1 = lists:sort(L1),
L2 = [{I,I},{I,F},{F,I},{F,F}],
- ?line L2 = lists:keysort(1, L2),
- ?line L2 = lists:sort(L2),
+ L2 = lists:keysort(1, L2),
+ L2 = lists:sort(L2),
ok.
%% Test lists:suffix/2.
suffix(Config) when is_list(Config) ->
- ?line true = lists:suffix([], []),
- ?line true = lists:suffix([], [a]),
- ?line true = lists:suffix([], [a,b]),
- ?line true = lists:suffix([], [a,b,c]),
- ?line true = lists:suffix([a], lists:duplicate(200000, a)),
- ?line true = lists:suffix(lists:seq(1, 1024),
- lists:seq(2, 64000) ++ lists:seq(1, 1024)),
- ?line true = lists:suffix(lists:duplicate(20000, a),
- lists:duplicate(200000, a)),
- ?line true = lists:suffix([2.0,3.0], [1.0,2.0,3.0]),
+ true = lists:suffix([], []),
+ true = lists:suffix([], [a]),
+ true = lists:suffix([], [a,b]),
+ true = lists:suffix([], [a,b,c]),
+ true = lists:suffix([a], lists:duplicate(200000, a)),
+ true = lists:suffix(lists:seq(1, 1024),
+ lists:seq(2, 64000) ++ lists:seq(1, 1024)),
+ true = lists:suffix(lists:duplicate(20000, a),
+ lists:duplicate(200000, a)),
+ true = lists:suffix([2.0,3.0], [1.0,2.0,3.0]),
%% False cases.
- ?line false = lists:suffix([a], []),
- ?line false = lists:suffix([a,b,c], []),
- ?line false = lists:suffix([a,b,c], [b,c]),
- ?line false = lists:suffix([a,b,c], [a,b,c,a,b]),
- ?line false = lists:suffix(lists:duplicate(199999, a)++[b],
- lists:duplicate(200000, a)),
- ?line false = lists:suffix([2.0,3.0], [1,2,3]),
+ false = lists:suffix([a], []),
+ false = lists:suffix([a,b,c], []),
+ false = lists:suffix([a,b,c], [b,c]),
+ false = lists:suffix([a,b,c], [a,b,c,a,b]),
+ false = lists:suffix(lists:duplicate(199999, a)++[b],
+ lists:duplicate(200000, a)),
+ false = lists:suffix([2.0,3.0], [1,2,3]),
%% Error cases.
- ?line {'EXIT',_} = (catch lists:suffix({a,b,c}, [])),
- ?line {'EXIT',_} = (catch lists:suffix([], {a,b})),
- ?line {'EXIT',_} = (catch lists:suffix([a|b], [])),
- ?line {'EXIT',_} = (catch lists:suffix([a,b|c], [a|b])),
- ?line {'EXIT',_} = (catch lists:suffix([a|b], [a,b|c])),
- ?line {'EXIT',_} = (catch lists:suffix([a|b], [a|b])),
-
+ {'EXIT',_} = (catch lists:suffix({a,b,c}, [])),
+ {'EXIT',_} = (catch lists:suffix([], {a,b})),
+ {'EXIT',_} = (catch lists:suffix([a|b], [])),
+ {'EXIT',_} = (catch lists:suffix([a,b|c], [a|b])),
+ {'EXIT',_} = (catch lists:suffix([a|b], [a,b|c])),
+ {'EXIT',_} = (catch lists:suffix([a|b], [a|b])),
+
ok.
%% Test lists:subtract/2 and the '--' operator.
subtract(Config) when is_list(Config) ->
- ?line [] = sub([], []),
- ?line [] = sub([], [a]),
- ?line [] = sub([], lists:seq(1, 1024)),
- ?line sub_non_matching([a], []),
- ?line sub_non_matching([1,2], [make_ref()]),
- ?line sub_non_matching(lists:seq(1, 1024), [make_ref(),make_ref()]),
-
+ [] = sub([], []),
+ [] = sub([], [a]),
+ [] = sub([], lists:seq(1, 1024)),
+ sub_non_matching([a], []),
+ sub_non_matching([1,2], [make_ref()]),
+ sub_non_matching(lists:seq(1, 1024), [make_ref(),make_ref()]),
+
%% Matching subtracts.
- ?line [] = sub([a], [a]),
- ?line [a] = sub([a,b], [b]),
- ?line [a] = sub([a,b], [b,c]),
- ?line [a] = sub([a,b,c], [b,c]),
- ?line [a] = sub([a,b,c], [b,c]),
- ?line [d,a,a] = sub([a,b,c,d,a,a], [a,b,c]),
- ?line [d,x,a] = sub([a,b,c,d,a,x,a], [a,b,c,a]),
- ?line [1,2,3,4,5,6,7,8,9,9999,10000,20,21,22] =
+ [] = sub([a], [a]),
+ [a] = sub([a,b], [b]),
+ [a] = sub([a,b], [b,c]),
+ [a] = sub([a,b,c], [b,c]),
+ [a] = sub([a,b,c], [b,c]),
+ [d,a,a] = sub([a,b,c,d,a,a], [a,b,c]),
+ [d,x,a] = sub([a,b,c,d,a,x,a], [a,b,c,a]),
+ [1,2,3,4,5,6,7,8,9,9999,10000,20,21,22] =
sub(lists:seq(1, 10000)++[20,21,22], lists:seq(10, 9998)),
%% Floats/integers.
- ?line [42.0,42.0] = sub([42.0,42,42.0], [42,42,42]),
- ?line [1,2,3,4,43.0] = sub([1,2,3,4,5,42.0,43.0], [42.0,5]),
+ [42.0,42.0] = sub([42.0,42,42.0], [42,42,42]),
+ [1,2,3,4,43.0] = sub([1,2,3,4,5,42.0,43.0], [42.0,5]),
%% Crashing subtracts.
- ?line {'EXIT',_} = (catch sub([], [a|b])),
- ?line {'EXIT',_} = (catch sub([a], [a|b])),
- ?line {'EXIT',_} = (catch sub([a|b], [])),
- ?line {'EXIT',_} = (catch sub([a|b], [])),
- ?line {'EXIT',_} = (catch sub([a|b], [a])),
+ {'EXIT',_} = (catch sub([], [a|b])),
+ {'EXIT',_} = (catch sub([a], [a|b])),
+ {'EXIT',_} = (catch sub([a|b], [])),
+ {'EXIT',_} = (catch sub([a|b], [])),
+ {'EXIT',_} = (catch sub([a|b], [a])),
ok.
sub_non_matching(A, B) ->
A = sub(A, B).
-
+
sub(A, B) ->
Res = A -- B,
Res = lists:subtract(A, B).
%% Test lists:droplast/1
droplast(Config) when is_list(Config) ->
- ?line [] = lists:droplast([x]),
- ?line [x] = lists:droplast([x, y]),
- ?line {'EXIT', {function_clause, _}} = (catch lists:droplast([])),
- ?line {'EXIT', {function_clause, _}} = (catch lists:droplast(x)),
+ [] = lists:droplast([x]),
+ [x] = lists:droplast([x, y]),
+ {'EXIT', {function_clause, _}} = (catch lists:droplast([])),
+ {'EXIT', {function_clause, _}} = (catch lists:droplast(x)),
ok.
diff --git a/lib/stdlib/test/log_mf_h_SUITE.erl b/lib/stdlib/test/log_mf_h_SUITE.erl
index 70d03dd46f..9b543aa37c 100644
--- a/lib/stdlib/test/log_mf_h_SUITE.erl
+++ b/lib/stdlib/test/log_mf_h_SUITE.erl
@@ -53,17 +53,17 @@ end_per_group(_GroupName, Config) ->
%%-----------------------------------------------------------------
test(Config) when is_list(Config) ->
- ?line {ok, Pid} = gen_event:start_link(),
- ?line PrivDir = ?config(priv_dir, Config),
+ {ok, Pid} = gen_event:start_link(),
+ PrivDir = proplists:get_value(priv_dir, Config),
Log1 = PrivDir ++ "/log1",
- ?line ok = file:make_dir(Log1),
+ ok = file:make_dir(Log1),
Args1 = log_mf_h:init(Log1, 500, 3),
gen_event:add_handler(Pid, log_mf_h, Args1),
generate(Pid, 200),
{ok, Files} = file:list_dir(Log1),
- ?line true = lists:member("1", Files),
- ?line true = lists:member("index", Files),
- ?line false = lists:member("2", Files),
+ true = lists:member("1", Files),
+ true = lists:member("index", Files),
+ false = lists:member("2", Files),
generate(Pid, 2500),
%% The documentation doesn't guarantee that syncing one request
%% causes all previous ones to be finished too, but that seems to
@@ -71,26 +71,26 @@ test(Config) when is_list(Config) ->
%% look for them with 'list_dir'.
gen_event:sync_notify(Pid, "end"),
{ok, Files2} = file:list_dir(Log1),
- ?line true = lists:member("1", Files2),
- ?line true = lists:member("2", Files2),
- ?line true = lists:member("3", Files2),
- ?line false = lists:member("4", Files2),
- ?line true = lists:member("index", Files2),
- ?line {ok, #file_info{size=Size1,type=regular}} = file:read_file_info(Log1 ++ "/1"),
- ?line if Size1 > 500 -> test_server:fail({too_big, Size1});
- true -> ok end,
- ?line {ok, #file_info{size=Size2,type=regular}} = file:read_file_info(Log1 ++ "/2"),
- ?line if Size2 > 500 -> test_server:fail({too_big, Size2});
- true -> ok end,
- ?line {ok, #file_info{size=Size3,type=regular}} = file:read_file_info(Log1 ++ "/3"),
- ?line if Size3 > 500 -> test_server:fail({too_big, Size3});
- true -> ok end,
+ true = lists:member("1", Files2),
+ true = lists:member("2", Files2),
+ true = lists:member("3", Files2),
+ false = lists:member("4", Files2),
+ true = lists:member("index", Files2),
+ {ok, #file_info{size=Size1,type=regular}} = file:read_file_info(Log1 ++ "/1"),
+ if Size1 > 500 -> ct:fail({too_big, Size1});
+ true -> ok end,
+ {ok, #file_info{size=Size2,type=regular}} = file:read_file_info(Log1 ++ "/2"),
+ if Size2 > 500 -> ct:fail({too_big, Size2});
+ true -> ok end,
+ {ok, #file_info{size=Size3,type=regular}} = file:read_file_info(Log1 ++ "/3"),
+ if Size3 > 500 -> ct:fail({too_big, Size3});
+ true -> ok end,
gen_event:delete_handler(Pid, log_mf_h, []),
- ?line {ok, Index} = read_index_file(Log1),
+ {ok, Index} = read_index_file(Log1),
gen_event:add_handler(Pid, log_mf_h, Args1),
X = if Index == 3 -> 1; true -> Index + 1 end,
- ?line {ok, X} = read_index_file(Log1).
-
+ {ok, X} = read_index_file(Log1).
+
generate(Pid, Bytes) when Bytes > 32 ->
gen_event:notify(Pid, make_list(32, [])),
@@ -110,4 +110,3 @@ read_index_file(Dir) ->
end;
_ -> error
end.
-
diff --git a/lib/stdlib/test/maps_SUITE.erl b/lib/stdlib/test/maps_SUITE.erl
index f1f476433b..7f94b7bcb1 100644
--- a/lib/stdlib/test/maps_SUITE.erl
+++ b/lib/stdlib/test/maps_SUITE.erl
@@ -25,9 +25,7 @@
-include_lib("common_test/include/ct.hrl").
--define(default_timeout, ?t:minutes(1)).
-
-% Test server specific exports
+%% Test server specific exports
-export([all/0]).
-export([suite/0]).
-export([init_per_suite/1]).
@@ -39,14 +37,15 @@
t_fold_3/1,t_map_2/1,t_size_1/1,
t_with_2/1,t_without_2/1]).
-%-define(badmap(V,F,Args), {'EXIT', {{badmap,V}, [{maps,F,Args,_}|_]}}).
-%-define(badarg(F,Args), {'EXIT', {badarg, [{maps,F,Args,_}|_]}}).
-% silly broken hipe
+%%-define(badmap(V,F,Args), {'EXIT', {{badmap,V}, [{maps,F,Args,_}|_]}}).
+%%-define(badarg(F,Args), {'EXIT', {badarg, [{maps,F,Args,_}|_]}}).
+%% silly broken hipe
-define(badmap(V,F,_Args), {'EXIT', {{badmap,V}, [{maps,F,_,_}|_]}}).
-define(badarg(F,_Args), {'EXIT', {badarg, [{maps,F,_,_}|_]}}).
suite() ->
- [{ct_hooks, [ts_install_cth]}].
+ [{ct_hooks, [ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[t_get_3,t_filter_2,
@@ -60,12 +59,9 @@ end_per_suite(_Config) ->
ok.
init_per_testcase(_Case, Config) ->
- Dog=test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
t_get_3(Config) when is_list(Config) ->
diff --git a/lib/stdlib/test/ms_transform_SUITE.erl b/lib/stdlib/test/ms_transform_SUITE.erl
index 6a9478d0d2..a8bd90de84 100644
--- a/lib/stdlib/test/ms_transform_SUITE.erl
+++ b/lib/stdlib/test/ms_transform_SUITE.erl
@@ -23,6 +23,7 @@
-include_lib("common_test/include/ct.hrl").
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
+ init_per_testcase/2, end_per_testcase/2,
init_per_group/2,end_per_group/2]).
-export([basic_ets/1]).
-export([basic_dbg/1]).
@@ -42,17 +43,16 @@
-export([warnings/1]).
-export([no_warnings/1]).
-export([eep37/1]).
--export([init_per_testcase/2, end_per_testcase/2]).
init_per_testcase(_Func, Config) ->
- Dog=test_server:timetrap(test_server:seconds(360)),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+end_per_testcase(_Func, _Config) ->
+ ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,6}}].
all() ->
[from_shell, basic_ets, basic_dbg, records,
@@ -79,94 +79,89 @@ end_per_group(_GroupName, Config) ->
%% This may be subject to change
-define(WARN_NUMBER_SHADOW,50).
-warnings(suite) ->
- [];
-warnings(doc) ->
- ["Check that shadowed variables in fun head generate warning"];
+
+%% Check that shadowed variables in fun head generate warning.
warnings(Config) when is_list(Config) ->
- ?line setup(Config),
+ setup(Config),
Prog = <<"A=5, "
- "ets:fun2ms(fun({A,B}) "
- " when is_integer(A) and (A+5 > B) -> "
- " A andalso B "
- " end)">>,
- ?line [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'A'}}]}] =
+ "ets:fun2ms(fun({A,B}) "
+ " when is_integer(A) and (A+5 > B) -> "
+ " A andalso B "
+ " end)">>,
+ [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'A'}}]}] =
compile_ww(Prog),
Prog2 = <<"C = 5,
ets:fun2ms(fun ({A,B} =
- C) when is_integer(A) and (A+5 > B) ->
+ C) when is_integer(A) and (A+5 > B) ->
{A andalso B,C}
end)">>,
[{_,[{3,ms_transform,{?WARN_NUMBER_SHADOW,'C'}}]}] =
- compile_ww(Prog2),
- Rec3 = <<"-record(a,{a,b,c,d=foppa}).">>,
- Prog3 = <<"A = 3,
+ compile_ww(Prog2),
+ Rec3 = <<"-record(a,{a,b,c,d=foppa}).">>,
+ Prog3 = <<"A = 3,
C = 5,
- ets:fun2ms(fun (C
- = #a{a = A, b = B})
- when is_integer(A) and (A+5 > B) ->
- {A andalso B,C}
- end)">>,
+ ets:fun2ms(fun (C
+ = #a{a = A, b = B})
+ when is_integer(A) and (A+5 > B) ->
+ {A andalso B,C}
+ end)">>,
[{_,[{3,ms_transform,{?WARN_NUMBER_SHADOW,'C'}},
{4,ms_transform,{?WARN_NUMBER_SHADOW,'A'}}]}] =
- compile_ww(Rec3,Prog3),
- Rec4 = <<"-record(a,{a,b,c,d=foppa}).">>,
- Prog4 = <<"A=3,C=5, "
- "F = fun(B) -> B*3 end,"
- "erlang:display(F(A)),"
- "ets:fun2ms(fun(#a{a = A, b = B} = C) "
- " when is_integer(A) and (A+5 > B) -> "
- " {A andalso B,C} "
- " end)">>,
- ?line [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'A'}},
- {_,ms_transform,{?WARN_NUMBER_SHADOW,'C'}}]}] =
- compile_ww(Rec4,Prog4),
- Rec5 = <<"-record(a,{a,b,c,d=foppa}).">>,
- Prog5 = <<"A=3,C=5, "
- "F = fun(B) -> B*3 end,"
- "erlang:display(F(A)),"
- "B = ets:fun2ms(fun(#a{a = A, b = B} = C) "
- " when is_integer(A) and (A+5 > B) -> "
- " {A andalso B,C} "
- " end)">>,
- ?line [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'A'}},
- {_,ms_transform,{?WARN_NUMBER_SHADOW,'C'}}]}] =
- compile_ww(Rec5,Prog5),
- Prog6 = <<" X=bar, "
- " A = case X of"
- " foo ->"
- " foo;"
- " Y ->"
- " ets:fun2ms(fun(Y) ->" % This is a warning
- " 3*Y"
- " end)"
- " end,"
- " ets:fun2ms(fun(Y) ->" % Y out of "scope" here, so no warning
- " {3*Y,A}"
- " end)">>,
- ?line [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'Y'}}]}] =
- compile_ww(Prog6),
- Prog7 = <<" X=bar, "
- " A = case X of"
- " foo ->"
- " Y = foo;"
- " Y ->"
- " bar"
- " end,"
- " ets:fun2ms(fun(Y) ->" % Y exported from case and safe, so warn
- " {3*Y,A}"
- " end)">>,
- ?line [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'Y'}}]}] =
- compile_ww(Prog7),
- ok.
-
-no_warnings(suite) ->
- [];
-no_warnings(doc) ->
- ["Check that variables bound in other function clauses don't generate "
- "warning"];
+ compile_ww(Rec3,Prog3),
+ Rec4 = <<"-record(a,{a,b,c,d=foppa}).">>,
+ Prog4 = <<"A=3,C=5, "
+ "F = fun(B) -> B*3 end,"
+ "erlang:display(F(A)),"
+ "ets:fun2ms(fun(#a{a = A, b = B} = C) "
+ " when is_integer(A) and (A+5 > B) -> "
+ " {A andalso B,C} "
+ " end)">>,
+ [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'A'}},
+ {_,ms_transform,{?WARN_NUMBER_SHADOW,'C'}}]}] =
+ compile_ww(Rec4,Prog4),
+ Rec5 = <<"-record(a,{a,b,c,d=foppa}).">>,
+ Prog5 = <<"A=3,C=5, "
+ "F = fun(B) -> B*3 end,"
+ "erlang:display(F(A)),"
+ "B = ets:fun2ms(fun(#a{a = A, b = B} = C) "
+ " when is_integer(A) and (A+5 > B) -> "
+ " {A andalso B,C} "
+ " end)">>,
+ [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'A'}},
+ {_,ms_transform,{?WARN_NUMBER_SHADOW,'C'}}]}] =
+ compile_ww(Rec5,Prog5),
+ Prog6 = <<" X=bar, "
+ " A = case X of"
+ " foo ->"
+ " foo;"
+ " Y ->"
+ " ets:fun2ms(fun(Y) ->" % This is a warning
+ " 3*Y"
+ " end)"
+ " end,"
+ " ets:fun2ms(fun(Y) ->" % Y out of "scope" here, so no warning
+ " {3*Y,A}"
+ " end)">>,
+ [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'Y'}}]}] =
+ compile_ww(Prog6),
+ Prog7 = <<" X=bar, "
+ " A = case X of"
+ " foo ->"
+ " Y = foo;"
+ " Y ->"
+ " bar"
+ " end,"
+ " ets:fun2ms(fun(Y) ->" % Y exported from case and safe, so warn
+ " {3*Y,A}"
+ " end)">>,
+ [{_,[{_,ms_transform,{?WARN_NUMBER_SHADOW,'Y'}}]}] =
+ compile_ww(Prog7),
+ ok.
+
+%% Check that variables bound in other function clauses don't generate
+%% warning.
no_warnings(Config) when is_list(Config) ->
- ?line setup(Config),
+ setup(Config),
Prog = <<"tmp(X) when X > 100 ->\n",
" Y=X,\n"
" Y;\n"
@@ -174,188 +169,167 @@ no_warnings(Config) when is_list(Config) ->
" ets:fun2ms(fun(Y) ->\n"
" {X, 3*Y}\n"
" end)">>,
- ?line [] = compile_no_ww(Prog),
+ [] = compile_no_ww(Prog),
Prog2 = <<"tmp(X) when X > 100 ->\n",
- " Y=X,\n"
- " Y;\n"
- "tmp(X) when X < 200 ->\n"
- " ok;\n"
- "tmp(X) ->\n"
- " ets:fun2ms(fun(Y) ->\n"
- " {X, 3*Y}\n"
- " end)">>,
- ?line [] = compile_no_ww(Prog2),
+ " Y=X,\n"
+ " Y;\n"
+ "tmp(X) when X < 200 ->\n"
+ " ok;\n"
+ "tmp(X) ->\n"
+ " ets:fun2ms(fun(Y) ->\n"
+ " {X, 3*Y}\n"
+ " end)">>,
+ [] = compile_no_ww(Prog2),
ok.
-andalso_orelse(suite) ->
- [];
-andalso_orelse(doc) ->
- ["Tests that andalso and orelse are allowed in guards."];
+%% Test that andalso and orelse are allowed in guards.
andalso_orelse(Config) when is_list(Config) ->
- ?line setup(Config),
- ?line [{{'$1','$2'},
- [{'and',{is_integer,'$1'},{'>',{'+','$1',5},'$2'}}],
- [{'andalso','$1','$2'}]}] =
+ setup(Config),
+ [{{'$1','$2'},
+ [{'and',{is_integer,'$1'},{'>',{'+','$1',5},'$2'}}],
+ [{'andalso','$1','$2'}]}] =
compile_and_run(<<"ets:fun2ms(fun({A,B}) "
- " when is_integer(A) and (A+5 > B) -> "
- " A andalso B "
- " end)">>),
- ?line [{{'$1','$2'},
- [{'or',{is_atom,'$1'},{'>',{'+','$1',5},'$2'}}],
- [{'orelse','$1','$2'}]}] =
+ " when is_integer(A) and (A+5 > B) -> "
+ " A andalso B "
+ " end)">>),
+ [{{'$1','$2'},
+ [{'or',{is_atom,'$1'},{'>',{'+','$1',5},'$2'}}],
+ [{'orelse','$1','$2'}]}] =
compile_and_run(<<"ets:fun2ms(fun({A,B}) "
- " when is_atom(A) or (A+5 > B) -> "
- " A orelse B "
- " end)">>),
- ?line [{{'$1','$2'},
- [{'andalso',{is_integer,'$1'},{'>',{'+','$1',5},'$2'}}],
- ['$1']}] =
+ " when is_atom(A) or (A+5 > B) -> "
+ " A orelse B "
+ " end)">>),
+ [{{'$1','$2'},
+ [{'andalso',{is_integer,'$1'},{'>',{'+','$1',5},'$2'}}],
+ ['$1']}] =
compile_and_run(
- <<"ets:fun2ms(fun({A,B}) when is_integer(A) andalso (A+5 > B) ->"
- " A "
- " end)">>),
- ?line [{{'$1','$2'},
- [{'orelse',{is_atom,'$1'},{'>',{'+','$1',5},'$2'}}],
- ['$1']}] =
+ <<"ets:fun2ms(fun({A,B}) when is_integer(A) andalso (A+5 > B) ->"
+ " A "
+ " end)">>),
+ [{{'$1','$2'},
+ [{'orelse',{is_atom,'$1'},{'>',{'+','$1',5},'$2'}}],
+ ['$1']}] =
compile_and_run(
- <<"ets:fun2ms(fun({A,B}) when is_atom(A) orelse (A+5 > B) -> "
- " A "
- " end)">>),
+ <<"ets:fun2ms(fun({A,B}) when is_atom(A) orelse (A+5 > B) -> "
+ " A "
+ " end)">>),
ok.
-
-
-bitsyntax(suite) ->
- [];
-bitsyntax(doc) ->
- ["Tests that bitsyntax works and does not work where appropriate"];
+
+
+%% Test that bitsyntax works and does not work where appropriate.
bitsyntax(Config) when is_list(Config) ->
- ?line setup(Config),
- ?line [{'_',[],
- [<<0,27,0,27>>]}] =
+ setup(Config),
+ [{'_',[],
+ [<<0,27,0,27>>]}] =
compile_and_run(<<"A = 27, "
"ets:fun2ms(fun(_) -> <<A:16,27:16>> end)">>),
- ?line [{{<<15,47>>,
- '$1',
- '$2'},
- [{'=:=','$1',
- <<0,27>>},
- {'=:=','$2',
- <<27,28,19>>}],
- [<<188,0,13>>]}] =
+ [{{<<15,47>>,
+ '$1',
+ '$2'},
+ [{'=:=','$1',
+ <<0,27>>},
+ {'=:=','$2',
+ <<27,28,19>>}],
+ [<<188,0,13>>]}] =
compile_and_run(<<"A = 27, "
"ets:fun2ms("
" fun({<<15,47>>,B,C}) "
" when B =:= <<A:16>>, C =:= <<27,28,19>> -> "
" <<A:4,12:4,13:16>> "
" end)">>),
- ?line expect_failure(
- <<>>,
- <<"ets:fun2ms(fun({<<15,47>>,B,C}) "
- " when B =:= <<16>>, C =:= <<27,28,19>> -> "
- " <<B:4,12:4,13:16>> "
- " end)">>),
- ?line expect_failure(
- <<>>,
- <<"ets:fun2ms(fun({<<A:15,47>>,B,C}) "
- " when B =:= <<16>>, C =:= <<27,28,19>> -> "
- " <<B:4,12:4,13:16>> "
- " end)">>),
+ expect_failure(
+ <<>>,
+ <<"ets:fun2ms(fun({<<15,47>>,B,C}) "
+ " when B =:= <<16>>, C =:= <<27,28,19>> -> "
+ " <<B:4,12:4,13:16>> "
+ " end)">>),
+ expect_failure(
+ <<>>,
+ <<"ets:fun2ms(fun({<<A:15,47>>,B,C}) "
+ " when B =:= <<16>>, C =:= <<27,28,19>> -> "
+ " <<B:4,12:4,13:16>> "
+ " end)">>),
ok.
-record_defaults(suite) ->
- [];
-record_defaults(doc) ->
- ["Tests that record defaults works"];
+%% Test that record defaults works.
record_defaults(Config) when is_list(Config) ->
- ?line setup(Config),
- ?line [{{<<27>>,{a,5,'$1',hej,hej}},
- [],
- [{{a,hej,{'*','$1',2},flurp,flurp}}]}] =
+ setup(Config),
+ [{{<<27>>,{a,5,'$1',hej,hej}},
+ [],
+ [{{a,hej,{'*','$1',2},flurp,flurp}}]}] =
compile_and_run(<<"-record(a,{a,b,c,d=foppa}).">>,
<<"ets:fun2ms(fun({<<27>>,#a{a=5, b=B,_=hej}}) -> "
- "#a{a=hej,b=B*2,_=flurp} "
- "end)">>),
+ "#a{a=hej,b=B*2,_=flurp} "
+ "end)">>),
ok.
-basic_ets(suite) ->
- [];
-basic_ets(doc) ->
- ["Tests basic ets:fun2ms"];
+%% Test basic ets:fun2ms.
basic_ets(Config) when is_list(Config) ->
- ?line setup(Config),
- ?line [{{a,b},[],[true]}] = compile_and_run(
- <<"ets:fun2ms(fun({a,b}) -> true end)">>),
- ?line [{{'$1',foo},[{is_list,'$1'}],[{{{hd,'$1'},'$_'}}]},
+ setup(Config),
+ [{{a,b},[],[true]}] = compile_and_run(
+ <<"ets:fun2ms(fun({a,b}) -> true end)">>),
+ [{{'$1',foo},[{is_list,'$1'}],[{{{hd,'$1'},'$_'}}]},
{{'$1','$1'},[{is_tuple,'$1'}],[{{{element,1,'$1'},'$*'}}]}] =
compile_and_run(<<"ets:fun2ms(fun({X,foo}) when is_list(X) -> ",
- "{hd(X),object()};",
- "({X,X}) when is_tuple(X) ->",
- "{element(1,X),bindings()}",
- "end)">>),
- ?line [{{'$1','$2'},[],[{{'$2','$1'}}]}] =
+ "{hd(X),object()};",
+ "({X,X}) when is_tuple(X) ->",
+ "{element(1,X),bindings()}",
+ "end)">>),
+ [{{'$1','$2'},[],[{{'$2','$1'}}]}] =
compile_and_run(<<"ets:fun2ms(fun({A,B}) -> {B,A} end)">>),
- ?line [{{'$1','$2'},[],[['$2','$1']]}] =
+ [{{'$1','$2'},[],[['$2','$1']]}] =
compile_and_run(<<"ets:fun2ms(fun({A,B}) -> [B,A] end)">>),
ok.
-basic_dbg(suite) ->
- [];
-basic_dbg(doc) ->
- ["Tests basic ets:fun2ms"];
+%% Tests basic ets:fun2ms.
basic_dbg(Config) when is_list(Config) ->
- ?line setup(Config),
- ?line [{[a,b],[],[{message,banan},{return_trace}]}] =
+ setup(Config),
+ [{[a,b],[],[{message,banan},{return_trace}]}] =
compile_and_run(<<"dbg:fun2ms(fun([a,b]) -> message(banan), ",
- "return_trace() end)">>),
- ?line [{['$1','$2'],[],[{{'$2','$1'}}]}] =
+ "return_trace() end)">>),
+ [{['$1','$2'],[],[{{'$2','$1'}}]}] =
compile_and_run(<<"dbg:fun2ms(fun([A,B]) -> {B,A} end)">>),
- ?line [{['$1','$2'],[],[['$2','$1']]}] =
+ [{['$1','$2'],[],[['$2','$1']]}] =
compile_and_run(<<"dbg:fun2ms(fun([A,B]) -> [B,A] end)">>),
- ?line [{['$1','$2'],[],['$*']}] =
+ [{['$1','$2'],[],['$*']}] =
compile_and_run(<<"dbg:fun2ms(fun([A,B]) -> bindings() end)">>),
- ?line [{['$1','$2'],[],['$_']}] =
+ [{['$1','$2'],[],['$_']}] =
compile_and_run(<<"dbg:fun2ms(fun([A,B]) -> object() end)">>),
ok.
-from_shell(suite) ->
- [];
-from_shell(doc) ->
- ["Test calling of ets/dbg:fun2ms from the shell"];
+%% Test calling of ets/dbg:fun2ms from the shell.
from_shell(Config) when is_list(Config) ->
- ?line setup(Config),
- ?line Fun = do_eval("fun({a,b}) -> true end"),
- ?line [{{a,b},[],[true]}] = apply(ets,fun2ms,[Fun]),
- ?line [{{a,b},[],[true]}] = do_eval("ets:fun2ms(fun({a,b}) -> true end)"),
- ?line Fun2 = do_eval("fun([a,b]) -> message(banan), return_trace() end"),
- ?line [{[a,b],[],[{message,banan},{return_trace}]}]
+ setup(Config),
+ Fun = do_eval("fun({a,b}) -> true end"),
+ [{{a,b},[],[true]}] = apply(ets,fun2ms,[Fun]),
+ [{{a,b},[],[true]}] = do_eval("ets:fun2ms(fun({a,b}) -> true end)"),
+ Fun2 = do_eval("fun([a,b]) -> message(banan), return_trace() end"),
+ [{[a,b],[],[{message,banan},{return_trace}]}]
= apply(dbg,fun2ms,[Fun2]),
- ?line [{[a,b],[],[{message,banan},{return_trace}]}] =
+ [{[a,b],[],[{message,banan},{return_trace}]}] =
do_eval(
"dbg:fun2ms(fun([a,b]) -> message(banan), return_trace() end)"),
ok.
-records(suite) ->
- [];
-records(doc) ->
- ["Tests expansion of records in fun2ms"];
+%% Tests expansion of records in fun2ms.
records(Config) when is_list(Config) ->
- ?line setup(Config),
- ?line RD = <<"-record(t, {"
- "t1 = [] :: list(),"
- "t2 = foo :: atom(),"
- "t3,"
- "t4"
- "}).">>,
- ?line [{{t,'$1','$2',foo,'_'},[{is_list,'$1'}],[{{{hd,'$1'},'$_'}}]},
+ setup(Config),
+ RD = <<"-record(t, {"
+ "t1 = [] :: list(),"
+ "t2 = foo :: atom(),"
+ "t3,"
+ "t4"
+ "}).">>,
+ [{{t,'$1','$2',foo,'_'},[{is_list,'$1'}],[{{{hd,'$1'},'$_'}}]},
{{t,'_','_','_','_'},[{'==',{element,2,'$_'},nisse}],[{{'$*'}}]}] =
compile_and_run(RD,<<
- "ets:fun2ms(fun(#t{t1 = X, t2 = Y, t3 = foo}) when is_list(X) ->
+ "ets:fun2ms(fun(#t{t1 = X, t2 = Y, t3 = foo}) when is_list(X) ->
{hd(X),object()};
- (#t{}) when (object())#t.t1 == nisse ->
- {bindings()}
- end)">>),
- ?line [{{t,'$1','$2','_',foo},
+ (#t{}) when (object())#t.t1 == nisse ->
+ {bindings()}
+ end)">>),
+ [{{t,'$1','$2','_',foo},
[{'==',{element,4,'$_'},7},{is_list,'$1'}],
[{{{hd,'$1'},'$_'}}]},
{'$1',[{is_record,'$1',t,5}],
@@ -373,7 +347,7 @@ records(Config) when is_list(Config) ->
}
end)"
>>),
- ?line [{[{t,'$1','$2',foo,'_'}],[{is_list,'$1'}],[{{{hd,'$1'},'$_'}}]},
+ [{[{t,'$1','$2',foo,'_'}],[{is_list,'$1'}],[{{{hd,'$1'},'$_'}}]},
{[{t,'_','_','_','_'}],[{'==',{element,2,{hd,'$_'}},nisse}],[{{'$*'}}]}]=
compile_and_run(RD,<<
"dbg:fun2ms(fun([#t{t1 = X, t2 = Y, t3 = foo}]) when is_list(X) ->
@@ -385,78 +359,66 @@ records(Config) when is_list(Config) ->
ok.
-record_index(suite) ->
- [];
-record_index(doc) ->
- ["Tests expansion of records in fun2ms, part 2"];
+%% Test expansion of records in fun2ms, part 2.
record_index(Config) when is_list(Config) ->
- ?line setup(Config),
- ?line RD = <<"-record(a,{a,b}).">>,
- ?line [{{2},[],[true]}] = compile_and_run(RD,
+ setup(Config),
+ RD = <<"-record(a,{a,b}).">>,
+ [{{2},[],[true]}] = compile_and_run(RD,
<<"ets:fun2ms(fun({#a.a}) -> true end)">>),
- ?line [{{2},[],[2]}] = compile_and_run(RD,
+ [{{2},[],[2]}] = compile_and_run(RD,
<<"ets:fun2ms(fun({#a.a}) -> #a.a end)">>),
- ?line [{{2,'$1'},[{'>','$1',2}],[2]}] = compile_and_run(RD,
+ [{{2,'$1'},[{'>','$1',2}],[2]}] = compile_and_run(RD,
<<"ets:fun2ms(fun({#a.a,A}) when A > #a.a -> #a.a end)">>),
ok.
-top_match(suite) ->
- [];
-top_match(doc) ->
- ["Tests matching on top level in head to give alias for object()"];
+%% Tests matching on top level in head to give alias for object().
top_match(Config) when is_list(Config) ->
- ?line setup(Config),
- ?line RD = <<"-record(a,{a,b}).">>,
- ?line [{{a,3,'_'},[],['$_']}] =
+ setup(Config),
+ RD = <<"-record(a,{a,b}).">>,
+ [{{a,3,'_'},[],['$_']}] =
compile_and_run(RD,
<<"ets:fun2ms(fun(A = #a{a=3}) -> A end)">>),
- ?line [{{a,3,'_'},[],['$_']}] =
+ [{{a,3,'_'},[],['$_']}] =
compile_and_run(RD,
<<"ets:fun2ms(fun(#a{a=3} = A) -> A end)">>),
- ?line [{[a,b],[],['$_']}] =
+ [{[a,b],[],['$_']}] =
compile_and_run(RD,
<<"dbg:fun2ms(fun(A = [a,b]) -> A end)">>),
- ?line [{[a,b],[],['$_']}] =
+ [{[a,b],[],['$_']}] =
compile_and_run(RD,
<<"dbg:fun2ms(fun([a,b] = A) -> A end)">>),
- ?line expect_failure(RD,
+ expect_failure(RD,
<<"ets:fun2ms(fun({a,A = {_,b}}) -> A end)">>),
- ?line expect_failure(RD,
+ expect_failure(RD,
<<"dbg:fun2ms(fun([a,A = {_,b}]) -> A end)">>),
- ?line expect_failure(RD,
+ expect_failure(RD,
<<"ets:fun2ms(fun(A#a{a = 2}) -> A end)">>),
ok.
-multipass(suite) ->
- [];
-multipass(doc) ->
- ["Tests that multi-defined fields in records give errors."];
+%% Tests that multi-defined fields in records give errors.
multipass(Config) when is_list(Config) ->
- ?line setup(Config),
- ?line RD = <<"-record(a,{a,b}).">>,
- ?line expect_failure(RD,<<"ets:fun2ms(fun(A) -> #a{a=2,a=3} end)">>),
- ?line expect_failure(RD,<<"ets:fun2ms(fun(A) -> A#a{a=2,a=3} end)">>),
- ?line expect_failure(RD,<<"ets:fun2ms(fun(A) when A =:= #a{a=2,a=3} ->",
+ setup(Config),
+ RD = <<"-record(a,{a,b}).">>,
+ expect_failure(RD,<<"ets:fun2ms(fun(A) -> #a{a=2,a=3} end)">>),
+ expect_failure(RD,<<"ets:fun2ms(fun(A) -> A#a{a=2,a=3} end)">>),
+ expect_failure(RD,<<"ets:fun2ms(fun(A) when A =:= #a{a=2,a=3} ->",
" true end)">>),
- ?line expect_failure(RD,<<"ets:fun2ms(fun({A,B})when A =:= B#a{a=2,a=3}->",
+ expect_failure(RD,<<"ets:fun2ms(fun({A,B})when A =:= B#a{a=2,a=3}->",
"true end)">>),
- ?line expect_failure(RD,<<"ets:fun2ms(fun(#a{a=3,a=3}) -> true end)">>),
- ?line compile_and_run(RD,<<"ets:fun2ms(fun(A) -> #a{a=2,b=3} end)">>),
- ?line compile_and_run(RD,<<"ets:fun2ms(fun(A) -> A#a{a=2,b=3} end)">>),
- ?line compile_and_run(RD,<<"ets:fun2ms(fun(A) when A =:= #a{a=2,b=3} ->",
+ expect_failure(RD,<<"ets:fun2ms(fun(#a{a=3,a=3}) -> true end)">>),
+ compile_and_run(RD,<<"ets:fun2ms(fun(A) -> #a{a=2,b=3} end)">>),
+ compile_and_run(RD,<<"ets:fun2ms(fun(A) -> A#a{a=2,b=3} end)">>),
+ compile_and_run(RD,<<"ets:fun2ms(fun(A) when A =:= #a{a=2,b=3} ->",
" true end)">>),
- ?line compile_and_run(RD,<<"ets:fun2ms(fun({A,B})when A=:= B#a{a=2,b=3}->",
+ compile_and_run(RD,<<"ets:fun2ms(fun({A,B})when A=:= B#a{a=2,b=3}->",
"true end)">>),
- ?line compile_and_run(RD,<<"ets:fun2ms(fun(#a{a=3,b=3}) -> true end)">>),
+ compile_and_run(RD,<<"ets:fun2ms(fun(#a{a=3,b=3}) -> true end)">>),
ok.
-old_guards(suite) ->
- [];
-old_guards(doc) ->
- ["Tests that old type tests in guards are translated"];
+%% Test that old type tests in guards are translated.
old_guards(Config) when is_list(Config) ->
- ?line setup(Config),
+ setup(Config),
Tests = [
{atom,is_atom},
{float,is_float},
@@ -469,7 +431,7 @@ old_guards(Config) when is_list(Config) ->
{tuple,is_tuple},
{binary,is_binary},
{function,is_function}],
- ?line lists:foreach(
+ lists:foreach(
fun({Old,New}) ->
Bin = list_to_binary([<<"ets:fun2ms(fun(X) when ">>,
atom_to_list(Old),
@@ -482,15 +444,15 @@ old_guards(Config) when is_list(Config) ->
end
end,
Tests),
- ?line RD = <<"-record(a,{a,b}).">>,
- ?line [{'$1',[{is_record,'$1',a,3}],[true]}] =
+ RD = <<"-record(a,{a,b}).">>,
+ [{'$1',[{is_record,'$1',a,3}],[true]}] =
compile_and_run(RD,
<<"ets:fun2ms(fun(X) when record(X,a) -> true end)">>),
- ?line expect_failure
+ expect_failure
(RD,
<<"ets:fun2ms(fun(X) when integer(X) and constant(X) -> "
"true end)">>),
- ?line [{'$1',[{is_integer,'$1'},
+ [{'$1',[{is_integer,'$1'},
{is_float,'$1'},
{is_atom,'$1'},
{is_list,'$1'},
@@ -511,13 +473,10 @@ old_guards(Config) when is_list(Config) ->
>>),
ok.
-autoimported(suite) ->
- [];
-autoimported(doc) ->
- ["Tests use of autoimported bif's used like erlang:'+'(A,B) in guards"
- " and body."];
+%% Test use of autoimported BIFs used like erlang:'+'(A,B) in guards
+%% and body.
autoimported(Config) when is_list(Config) ->
- ?line setup(Config),
+ setup(Config),
Allowed = [
{abs,1},
{element,2},
@@ -530,7 +489,7 @@ autoimported(Config) when is_list(Config) ->
{tl,1},
{trunc,1},
{self,0},
- %{float,1}, see float_1_function/1
+ %%{float,1}, see float_1_function/1
{is_atom,1},
{is_float,1},
{is_integer,1},
@@ -547,8 +506,8 @@ autoimported(Config) when is_list(Config) ->
{'or',2,infix},
{'xor',2,infix},
{'not',1},
- %{'andalso',2,infix},
- %{'orelse',2,infix},
+ %%{'andalso',2,infix},
+ %%{'orelse',2,infix},
{'+',1},
{'+',2,infix},
{'-',1},
@@ -571,8 +530,8 @@ autoimported(Config) when is_list(Config) ->
{'=:=',2,infix},
{'/=',2,infix},
{'=/=',2,infix}],
- ?line RD = <<"-record(a,{a,b}).">>,
- ?line lists:foreach(
+ RD = <<"-record(a,{a,b}).">>,
+ lists:foreach(
fun({A,0}) ->
L = atom_to_list(A),
Bin1 = list_to_binary(
@@ -687,85 +646,76 @@ autoimported(Config) when is_list(Config) ->
Allowed),
ok.
-semicolon(suite) ->
- [];
-semicolon(doc) ->
- ["Tests semicolon in guards of match_specs."];
+%% Test semicolon in guards of match_specs.
semicolon(Config) when is_list(Config) ->
- ?line setup(Config),
- ?line Res01 = compile_and_run
+ setup(Config),
+ Res01 = compile_and_run
(<<"ets:fun2ms(fun(X) when is_integer(X); "
"is_float(X) -> true end)">>),
- ?line Res02 = compile_and_run
+ Res02 = compile_and_run
(<<"ets:fun2ms(fun(X) when is_integer(X) -> true; "
"(X) when is_float(X) -> true end)">>),
- ?line Res01 = Res02,
- ?line Res11 = compile_and_run
+ Res01 = Res02,
+ Res11 = compile_and_run
(<<"ets:fun2ms(fun(X) when is_integer(X); "
"is_float(X); atom(X) -> true end)">>),
- ?line Res12 = compile_and_run
+ Res12 = compile_and_run
(<<"ets:fun2ms(fun(X) when is_integer(X) -> true; "
"(X) when is_float(X) -> true; "
"(X) when is_atom(X) -> true end)">>),
- ?line Res11 = Res12,
+ Res11 = Res12,
ok.
-float_1_function(suite) ->
- [];
-float_1_function(doc) ->
- ["OTP-5297. The function float/1."];
+%% OTP-5297. The function float/1.
float_1_function(Config) when is_list(Config) ->
- ?line setup(Config),
+ setup(Config),
RunMS = fun(L, MS) ->
ets:match_spec_run(L, ets:match_spec_compile(MS))
end,
- ?line MS1 = compile_and_run
+ MS1 = compile_and_run
(<<"ets:fun2ms(fun(X) -> float(X) end)">>),
- ?line [F1] = RunMS([3], MS1),
- ?line true = is_float(F1) and (F1 == 3),
+ [F1] = RunMS([3], MS1),
+ true = is_float(F1) and (F1 == 3),
- ?line MS1b = compile_and_run
+ MS1b = compile_and_run
(<<"dbg:fun2ms(fun(X) -> float(X) end)">>),
- ?line [F2] = RunMS([3], MS1b),
- ?line true = is_float(F2) and (F2 == 3),
+ [F2] = RunMS([3], MS1b),
+ true = is_float(F2) and (F2 == 3),
- ?line MS2 = compile_and_run
+ MS2 = compile_and_run
(<<"ets:fun2ms(fun(X) when is_pid(X) or float(X) -> true end)">>),
- ?line [] = RunMS([3.0], MS2),
+ [] = RunMS([3.0], MS2),
- ?line MS3 = compile_and_run
+ MS3 = compile_and_run
(<<"dbg:fun2ms(fun(X) when is_pid(X); float(X) -> true end)">>),
- ?line [true] = RunMS([3.0], MS3),
+ [true] = RunMS([3.0], MS3),
- ?line MS4 = compile_and_run
+ MS4 = compile_and_run
(<<"ets:fun2ms(fun(X) when erlang:float(X) > 1 -> big;"
" (_) -> small end)">>),
- ?line [small,big] = RunMS([1.0, 3.0], MS4),
+ [small,big] = RunMS([1.0, 3.0], MS4),
- ?line MS5 = compile_and_run
+ MS5 = compile_and_run
(<<"ets:fun2ms(fun(X) when float(X) > 1 -> big;"
" (_) -> small end)">>),
- ?line [small,big] = RunMS([1.0, 3.0], MS5),
+ [small,big] = RunMS([1.0, 3.0], MS5),
%% This is the test from autoimported/1.
- ?line [{'$1',[{is_float,'$1'}],[{float,'$1'}]}] =
+ [{'$1',[{is_float,'$1'}],[{float,'$1'}]}] =
compile_and_run
(<<"ets:fun2ms(fun(X) when float(X) -> float(X) end)">>),
- ?line [{'$1',[{float,'$1'}],[{float,'$1'}]}] =
+ [{'$1',[{float,'$1'}],[{float,'$1'}]}] =
compile_and_run
(<<"ets:fun2ms(fun(X) when erlang:'float'(X) -> "
"erlang:'float'(X) end)">>),
ok.
-action_function(suite) ->
- [];
-action_function(doc) ->
- ["Test all 'action functions'."];
+%% Test all 'action functions'.
action_function(Config) when is_list(Config) ->
- ?line setup(Config),
- ?line [{['$1','$2'],[],
+ setup(Config),
+ [{['$1','$2'],[],
[{set_seq_token,label,0},
{get_seq_token},
{message,'$1'},
@@ -778,7 +728,7 @@ action_function(Config) when is_list(Config) ->
"message(X), "
"return_trace(), "
"exception_trace() end)">>),
- ?line [{['$1','$2'],[],
+ [{['$1','$2'],[],
[{process_dump},
{enable_trace,send},
{enable_trace,'$2',send},
@@ -791,7 +741,7 @@ action_function(Config) when is_list(Config) ->
"enable_trace(Y, send), "
"disable_trace(procs), "
"disable_trace(Y, procs) end)">>),
- ?line [{['$1','$2'],
+ [{['$1','$2'],
[],
[{display,'$1'},
{caller},
@@ -821,7 +771,7 @@ eep37(Config) when is_list(Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Helpers
+%% Helpers
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
setup(Config) ->
@@ -832,14 +782,13 @@ temp_name() ->
Conf = get(mts_config),
C = get(mts_tf_counter),
put(mts_tf_counter,C+1),
- filename:join([?config(priv_dir,Conf),
+ filename:join([proplists:get_value(priv_dir,Conf),
"tempfile"++integer_to_list(C)++".tmp"]).
expect_failure(Recs,Code) ->
case (catch compile_and_run(Recs,Code)) of
{'EXIT',_Foo} ->
- %erlang:display(_Foo),
ok;
Other ->
exit({expected,failure,got,Other})
diff --git a/lib/stdlib/test/proc_lib_SUITE.erl b/lib/stdlib/test/proc_lib_SUITE.erl
index a39a82b0df..ebce74545a 100644
--- a/lib/stdlib/test/proc_lib_SUITE.erl
+++ b/lib/stdlib/test/proc_lib_SUITE.erl
@@ -115,7 +115,7 @@ crash(Config) when is_list(Config) ->
%% Spawn function with neighbour.
Pid4 = proc_lib:spawn(?MODULE, sp2, []),
- test_server:sleep(100),
+ ct:sleep(100),
{?MODULE,sp2,[]} = proc_lib:initial_call(Pid4),
{?MODULE,sp2,0} = proc_lib:translate_initial_call(Pid4),
Pid4 ! die,
@@ -152,9 +152,9 @@ analyse_crash(Pid, Expected0, ExpLinks) ->
analyse_links(ExpLinks, Links);
Unexpected ->
io:format("~p\n", [Unexpected]),
- test_server:fail(unexpected_message)
+ ct:fail(unexpected_message)
after 5000 ->
- test_server:fail(no_crash_report)
+ ct:fail(no_crash_report)
end.
analyse_links([H|Es], [{neighbour,N}|Links]) ->
@@ -170,7 +170,7 @@ analyse_crash_1([{Key,Pattern}|T], Report) ->
case lists:keyfind(Key, 1, Report) of
false ->
io:format("~p", [Report]),
- test_server:fail({missing_key,Key});
+ ct:fail({missing_key,Key});
{Key,Info} ->
try
match_info(Pattern, Info)
@@ -179,7 +179,7 @@ analyse_crash_1([{Key,Pattern}|T], Report) ->
io:format("key: ~p", [Key]),
io:format("pattern: ~p", [Pattern]),
io:format("actual: ~p", [Report]),
- test_server:fail(no_match)
+ ct:fail(no_match)
end,
analyse_crash_1(T, Report)
end;
@@ -203,7 +203,7 @@ sync_start_nolink(Config) when is_list(Config) ->
receive
{sync_started, F} ->
exit(F, kill),
- test_server:fail(async_start)
+ ct:fail(async_start)
after 1000 -> ok
end,
receive
@@ -214,14 +214,14 @@ sync_start_nolink(Config) when is_list(Config) ->
{sync_started, _} -> ok
after 1000 ->
exit(Pid2, kill),
- test_server:fail(no_sync_start)
+ ct:fail(no_sync_start)
end,
ok.
-
+
sync_start_link(Config) when is_list(Config) ->
_Pid = spawn_link(?MODULE, sp3, [self()]),
receive
- {sync_started, _} -> test_server:fail(async_start)
+ {sync_started, _} -> ct:fail(async_start)
after 1000 -> ok
end,
receive
@@ -230,24 +230,24 @@ sync_start_link(Config) when is_list(Config) ->
end,
receive
{sync_started, _} -> ok
- after 1000 -> test_server:fail(no_sync_start)
+ after 1000 -> ct:fail(no_sync_start)
end,
ok.
-
+
spawn_opt(Config) when is_list(Config) ->
F = fun sp1/0,
{name,Fname} = erlang:fun_info(F, name),
FunMFArgs = {?MODULE,Fname,[]},
FunMFArity = {?MODULE,Fname,0},
- ?line Pid1 = proc_lib:spawn_opt(node(), F, [{priority,low}]),
- ?line Pid = proc_lib:spawn_opt(F, [{priority,low}]),
- ?line test_server:sleep(100),
- ?line FunMFArgs = proc_lib:initial_call(Pid),
- ?line FunMFArity = proc_lib:translate_initial_call(Pid),
- ?line Pid ! die,
- ?line FunMFArgs = proc_lib:initial_call(Pid1),
- ?line FunMFArity = proc_lib:translate_initial_call(Pid1),
- ?line Pid1 ! die,
+ Pid1 = proc_lib:spawn_opt(node(), F, [{priority,low}]),
+ Pid = proc_lib:spawn_opt(F, [{priority,low}]),
+ ct:sleep(100),
+ FunMFArgs = proc_lib:initial_call(Pid),
+ FunMFArity = proc_lib:translate_initial_call(Pid),
+ Pid ! die,
+ FunMFArgs = proc_lib:initial_call(Pid1),
+ FunMFArity = proc_lib:translate_initial_call(Pid1),
+ Pid1 ! die,
ok.
@@ -283,57 +283,57 @@ hibernate(Config) when is_list(Config) ->
Ref = make_ref(),
Self = self(),
LoopData = {Ref,Self},
- ?line Pid = proc_lib:spawn_link(?MODULE, hib_loop, [LoopData]),
+ Pid = proc_lib:spawn_link(?MODULE, hib_loop, [LoopData]),
%% Just check that the child process can process and answer messages.
- ?line Pid ! {Self,loop_data},
+ Pid ! {Self,loop_data},
receive
{loop_data,LoopData} -> ok;
Unexpected0 ->
- ?line io:format("Unexpected: ~p\n", [Unexpected0]),
- ?line ?t:fail()
+ io:format("Unexpected: ~p\n", [Unexpected0]),
+ ct:fail(failed)
after 1000 ->
- ?line io:format("Timeout"),
- ?line ?t:fail()
+ io:format("Timeout"),
+ ct:fail(failed)
end,
%% Hibernate the process.
- ?line Pid ! hibernate,
+ Pid ! hibernate,
erlang:yield(),
io:format("~p\n", [process_info(Pid, heap_size)]),
%% Send a message to the process...
- ?line Pid ! {Self,loop_data},
+ Pid ! {Self,loop_data},
%% ... expect first a wake up message from the process...
receive
{awaken,LoopData} -> ok;
Unexpected1 ->
- ?line io:format("Unexpected: ~p\n", [Unexpected1]),
- ?line ?t:fail()
+ io:format("Unexpected: ~p\n", [Unexpected1]),
+ ct:fail(failed)
after 1000 ->
- ?line io:format("Timeout"),
- ?line ?t:fail()
+ io:format("Timeout"),
+ ct:fail(failed)
end,
%% ... followed by the answer to the actual request.
receive
{loop_data,LoopData} -> ok;
Unexpected2 ->
- ?line io:format("Unexpected: ~p\n", [Unexpected2]),
- ?line ?t:fail()
+ io:format("Unexpected: ~p\n", [Unexpected2]),
+ ct:fail(failed)
after 1000 ->
- ?line io:format("Timeout"),
- ?line ?t:fail()
+ io:format("Timeout"),
+ ct:fail(failed)
end,
%% Test that errors are handled correctly after wake up from hibernation...
- ?line process_flag(trap_exit, true),
- ?line error_logger:add_report_handler(?MODULE, self()),
- ?line Pid ! crash,
+ process_flag(trap_exit, true),
+ error_logger:add_report_handler(?MODULE, self()),
+ Pid ! crash,
%% We should receive two messages. Especially in the SMP emulator,
%% we can't be sure of the message order, so sort the messages before
@@ -341,10 +341,10 @@ hibernate(Config) when is_list(Config) ->
Messages = lists:sort(hib_receive_messages(2)),
io:format("~p", [Messages]),
- ?line [{'EXIT',Pid,i_crashed},{crash_report,Pid,[Report,[]]}] = Messages,
+ [{'EXIT',Pid,i_crashed},{crash_report,Pid,[Report,[]]}] = Messages,
%% Check that the initial_call has the expected format.
- ?line {value,{initial_call,{?MODULE,hib_loop,[_]}}} =
+ {value,{initial_call,{?MODULE,hib_loop,[_]}}} =
lists:keysearch(initial_call, 1, Report),
error_logger:delete_report_handler(?MODULE),
@@ -371,10 +371,7 @@ hib_receive_messages(N) ->
Any -> [Any|hib_receive_messages(N-1)]
end.
-otp_6345(suite) ->
- [];
-otp_6345(doc) ->
- ["'monitor' spawn_opt option"];
+%% 'monitor' spawn_opt option.
otp_6345(Config) when is_list(Config) ->
Opts = [link,monitor],
{'EXIT', {badarg,[{proc_lib,check_for_monitor,_,_}|_Stack]}} =
@@ -392,11 +389,8 @@ otp_6345_loop() ->
otp_6345_loop()
end.
-%% OTP-9803
-init_dont_hang(suite) ->
- [];
-init_dont_hang(doc) ->
- ["Check that proc_lib:start don't hang if spawned process crashes before proc_lib:init_ack/2"];
+%% OTP-9803. Check that proc_lib:start() doesn't hang if spawned process
+%% crashes before proc_lib:init_ack/2.
init_dont_hang(Config) when is_list(Config) ->
%% Start should behave as start_link
process_flag(trap_exit, true),
@@ -489,7 +483,7 @@ stop(_Config) ->
{'EXIT',noproc} = (catch proc_lib:stop({to_stop,Node})),
true = test_server:stop_node(Node),
-
+
%% Remote registered name, but non-existing node
{'EXIT',{{nodedown,Node},_}} = (catch proc_lib:stop({to_stop,Node})),
ok.
@@ -522,7 +516,7 @@ t_format() ->
if
Tsz >= Usz ->
- ?t:fail();
+ ct:fail(failed);
true ->
ok
end,
@@ -549,7 +543,7 @@ t_format_looper() ->
%%-----------------------------------------------------------------
init(Tester) ->
{ok, Tester}.
-
+
handle_event({error_report, _GL, {Pid, crash_report, Report}}, Tester) ->
io:format("~s\n", [proc_lib:format(Report)]),
Tester ! {crash_report, Pid, Report},
diff --git a/lib/stdlib/test/qlc_SUITE.erl b/lib/stdlib/test/qlc_SUITE.erl
index 6f94e740eb..75971bcf11 100644
--- a/lib/stdlib/test/qlc_SUITE.erl
+++ b/lib/stdlib/test/qlc_SUITE.erl
@@ -25,7 +25,7 @@
-define(QLC, qlc).
-define(QLCs, "qlc").
-%-define(debug, true).
+%%-define(debug, true).
%% There are often many tests per testcase. Most tests are copied to a
%% module, a file. The file is compiled and the test run. Should the
@@ -44,9 +44,9 @@
-define(t, test_server).
-else.
-include_lib("common_test/include/ct.hrl").
--define(datadir, ?config(data_dir, Config)).
--define(privdir, ?config(priv_dir, Config)).
--define(testcase, ?config(?TESTCASE, Config)).
+-define(datadir, proplists:get_value(data_dir, Config)).
+-define(privdir, proplists:get_value(priv_dir, Config)).
+-define(testcase, proplists:get_value(?TESTCASE, Config)).
-endif.
-include_lib("stdlib/include/ms_transform.hrl").
@@ -80,7 +80,7 @@
backward/1, forward/1,
- eep37/1]).
+ eep37/1]).
%% Internal exports.
-export([bad_table_throw/1, bad_table_exit/1, default_table/1, bad_table/1,
@@ -107,19 +107,15 @@
handle_event/2, handle_call/2, handle_info/2,
terminate/2]).
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(5)).
-
init_per_testcase(Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{?TESTCASE, Case}, {watchdog, Dog} | Config].
+ [{?TESTCASE, Case} | Config].
end_per_testcase(_Case, _Config) ->
- Dog = ?config(watchdog, _Config),
- test_server:timetrap_cancel(Dog),
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,5}}].
all() ->
[{group, parse_transform}, {group, evaluation},
@@ -159,35 +155,30 @@ init_per_group(_GroupName, Config) ->
end_per_group(_GroupName, Config) ->
Config.
-badarg(doc) ->
- "Badarg.";
-badarg(suite) -> [];
badarg(Config) when is_list(Config) ->
Ts =
- [{badarg,
- <<"-import(qlc, [q/1, q/2]).
+ [{badarg,
+ <<"-import(qlc, [q/1, q/2]).
q(_, _, _) -> ok.
- badarg() ->
- qlc:q(foo),
- qlc:q(foo, cache_all),
- qlc:q(foo, cache_all, extra),
- q(bar),
- q(bar, cache_all),
- q(bar, cache_all, extra).
- ">>,
+badarg() ->
+ qlc:q(foo),
+ qlc:q(foo, cache_all),
+ qlc:q(foo, cache_all, extra),
+ q(bar),
+ q(bar, cache_all),
+ q(bar, cache_all, extra).
+">>,
[],
- {errors,[{5,?QLC,not_a_query_list_comprehension},
- {6,?QLC,not_a_query_list_comprehension},
- {8,?QLC,not_a_query_list_comprehension},
- {9,?QLC,not_a_query_list_comprehension}],
- []}}],
- ?line [] = compile(Config, Ts),
+{errors,[{5,?QLC,not_a_query_list_comprehension},
+ {6,?QLC,not_a_query_list_comprehension},
+ {8,?QLC,not_a_query_list_comprehension},
+ {9,?QLC,not_a_query_list_comprehension}],
+ []}}],
+ [] = compile(Config, Ts),
ok.
-nested_qlc(doc) ->
- "Nested qlc expressions.";
-nested_qlc(suite) -> [];
+%% Nested qlc expressions.
nested_qlc(Config) when is_list(Config) ->
%% Nested QLC expressions. X is bound before the first one; Z and X
%% before the second one.
@@ -227,12 +218,10 @@ nested_qlc(Config) when is_list(Config) ->
[warn_unused_vars],
{warnings,[{{6,39},erl_lint,{shadowed_var,'X',generate}}]}}
],
- ?line [] = compile(Config, Ts),
+ [] = compile(Config, Ts),
ok.
-unused_var(doc) ->
- "Unused variable with a name that should not be introduced.";
-unused_var(suite) -> [];
+%% Unused variable with a name that should not be introduced.
unused_var(Config) when is_list(Config) ->
Ts =
[{unused_var,
@@ -244,12 +233,10 @@ unused_var(Config) when is_list(Config) ->
">>,
[warn_unused_vars],
{warnings,[{{2,33},erl_lint,{unused_var,'Y1'}}]}}],
- ?line [] = compile(Config, Ts),
+ [] = compile(Config, Ts),
ok.
-lc(doc) ->
- "Ordinary LC expression.";
-lc(suite) -> [];
+%% Ordinary LC expression.
lc(Config) when is_list(Config) ->
Ts =
[{lc,
@@ -258,12 +245,10 @@ lc(Config) when is_list(Config) ->
">>,
[],
{warnings,[{{2,30},erl_lint,{shadowed_var,'X',generate}}]}}],
- ?line [] = compile(Config, Ts),
+ [] = compile(Config, Ts),
ok.
-fun_clauses(doc) ->
- "Fun with several clauses.";
-fun_clauses(suite) -> [];
+%% Fun with several clauses.
fun_clauses(Config) when is_list(Config) ->
Ts =
[{fun_clauses,
@@ -279,12 +264,10 @@ fun_clauses(Config) when is_list(Config) ->
{{3,41},erl_lint,{shadowed_var,'X',generate}},
{{4,22},erl_lint,{shadowed_var,'X','fun'}},
{{4,41},erl_lint,{shadowed_var,'X',generate}}]}}],
- ?line [] = compile(Config, Ts),
+ [] = compile(Config, Ts),
ok.
-filter_var(doc) ->
- "Variable introduced in filter.";
-filter_var(suite) -> [];
+%% Variable introduced in filter.
filter_var(Config) when is_list(Config) ->
Ts =
[{filter_var,
@@ -309,13 +292,11 @@ filter_var(Config) when is_list(Config) ->
">>,
[],
{errors,[{{2,25},erl_lint,{unsafe_var,'V',{'case',{3,19}}}}],[]}}],
- ?line [] = compile(Config, Ts),
+ [] = compile(Config, Ts),
ok.
-single(doc) ->
- "Unused pattern variable.";
-single(suite) -> [];
+%% Unused pattern variable.
single(Config) when is_list(Config) ->
Ts =
[{single,
@@ -325,12 +306,10 @@ single(Config) when is_list(Config) ->
">>,
[warn_unused_vars],
{warnings,[{{2,30},erl_lint,{unused_var,'Y'}}]}}],
- ?line [] = compile(Config, Ts),
+ [] = compile(Config, Ts),
ok.
-exported_var(doc) ->
- "Exported variable in list expression (rhs of generator).";
-exported_var(suite) -> [];
+%% Exported variable in list expression (rhs of generator).
exported_var(Config) when is_list(Config) ->
Ts =
[{exported_var,
@@ -347,12 +326,10 @@ exported_var(Config) when is_list(Config) ->
[warn_export_vars],
{warnings,[{{7,37},erl_lint,{exported_var,'Z',{'case',{3,36}}}},
{{7,44},erl_lint,{exported_var,'Z',{'case',{3,36}}}}]}}],
- ?line [] = compile(Config, Ts),
+ [] = compile(Config, Ts),
ok.
-generator_vars(doc) ->
- "Errors for generator variable used in list expression.";
-generator_vars(suite) -> [];
+%% Errors for generator variable used in list expression.
generator_vars(Config) when is_list(Config) ->
Ts =
[{generator_vars,
@@ -374,12 +351,10 @@ generator_vars(Config) when is_list(Config) ->
{{9,33},?QLC,{used_generator_variable,'Z'}},
{{9,40},?QLC,{used_generator_variable,'Z'}}],
[]}}],
- ?line [] = compile(Config, Ts),
+ [] = compile(Config, Ts),
ok.
-nomatch(doc) ->
- "Unreachable clauses also found when compiling.";
-nomatch(suite) -> [];
+%% Unreachable clauses also found when compiling.
nomatch(Config) when is_list(Config) ->
Ts =
[{unreachable1,
@@ -451,13 +426,11 @@ nomatch(Config) when is_list(Config) ->
{warnings,[{3,v3_core,nomatch}]}}
],
- ?line [] = compile(Config, Ts),
+ [] = compile(Config, Ts),
ok.
-errors(doc) ->
- "Errors within qlc expressions also found when compiling.";
-errors(suite) -> [];
+%% Errors within qlc expressions also found when compiling.
errors(Config) when is_list(Config) ->
Ts =
[{errors1,
@@ -466,12 +439,10 @@ errors(Config) when is_list(Config) ->
">>,
[],
{errors,[{{2,33},erl_lint,{unbound_var,'A'}}],[]}}],
- ?line [] = compile(Config, Ts),
+ [] = compile(Config, Ts),
ok.
-pattern(doc) ->
- "Patterns.";
-pattern(suite) -> [];
+%% Patterns.
pattern(Config) when is_list(Config) ->
Ts = [
<<"%% Records in patterns. No lookup.
@@ -493,14 +464,12 @@ pattern(Config) when is_list(Config) ->
end, [{<<\"hej\">>}])">>
],
- ?line run(Config, <<"-record(a, {k,v}).
+ run(Config, <<"-record(a, {k,v}).
-record(k, {t,v}).\n">>, Ts),
ok.
-eval(doc) ->
- "eval/2";
-eval(suite) -> [];
+%% eval/2
eval(Config) when is_list(Config) ->
ScratchDir = filename:join([?privdir, "scratch","."]),
@@ -616,12 +585,10 @@ eval(Config) when is_list(Config) ->
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-cursor(doc) ->
- "cursor/2";
-cursor(suite) -> [];
+%% cursor/2
cursor(Config) when is_list(Config) ->
ScratchDir = filename:join([?privdir, "scratch","."]),
Ts = [<<"{'EXIT',{badarg,_}} =
@@ -730,12 +697,10 @@ cursor(Config) when is_list(Config) ->
ok = qlc:delete_cursor(C2)">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-fold(doc) ->
- "fold/4";
-fold(suite) -> [];
+%% fold/4
fold(Config) when is_list(Config) ->
ScratchDir = filename:join([?privdir, "scratch","."]),
Ts = [<<"Q = qlc:q([X || X <- [1,2,1,2,1]]),
@@ -825,12 +790,10 @@ fold(Config) when is_list(Config) ->
(catch qlc:fold(F, [], Q, [{unique_all,false}]))
">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-eval_unique(doc) ->
- "Test the unique_all option of eval.";
-eval_unique(suite) -> [];
+%% Test the unique_all option of eval.
eval_unique(Config) when is_list(Config) ->
Ts = [<<"QLC1 = qlc:q([X || X <- qlc:append([[1,1,2], [1,2,3,2,3]])]),
[1,2,3] = qlc:eval(QLC1, {unique_all,true}),
@@ -922,12 +885,10 @@ eval_unique(Config) when is_list(Config) ->
{sort,{sort,{list,_},[{unique,true}]},[]} = i(Q)">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-eval_cache(doc) ->
- "Test the cache_all and unique_all options of eval.";
-eval_cache(suite) -> [];
+%% Test the cache_all and unique_all options of eval.
eval_cache(Config) when is_list(Config) ->
Ts = [
<<"E = ets:new(apa, [ordered_set]),
@@ -1056,12 +1017,10 @@ eval_cache(Config) when is_list(Config) ->
[1] = qlc:e(H, unique_all)">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-append(doc) ->
- "Test the append function.";
-append(suite) -> [];
+%% Test the append function.
append(Config) when is_list(Config) ->
Ts = [<<"C = qlc:cursor(qlc:q([X || X <- [0,1,2,3], begin 10/X > 0.0 end])),
R = (catch qlc:next_answers(C)),
@@ -1121,12 +1080,12 @@ append(Config) when is_list(Config) ->
foo() -> bar">>,
%% Used to work up to R11B.
- % <<"apa = qlc:e(qlc:q([X || X <- qlc:append([[1,2,3], ugly()])])),
- % ok.
- %
- % ugly() ->
- % [a | apa].
- % foo() -> bar">>,
+ %% <<"apa = qlc:e(qlc:q([X || X <- qlc:append([[1,2,3], ugly()])])),
+ %% ok.
+ %%
+ %% ugly() ->
+ %% [a | apa].
+ %% foo() -> bar">>,
%% Maybe this one should fail.
@@ -1179,99 +1138,93 @@ append(Config) when is_list(Config) ->
[a,b,1,2,1,2] = qlc:e(Q)">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-evaluator(doc) ->
- "Simple call from evaluator.";
-evaluator(suite) -> [];
+%% Simple call from evaluator.
evaluator(Config) when is_list(Config) ->
- ?line true = is_alive(),
+ true = is_alive(),
evaluator_2(Config, []),
- ?line {ok, Node} = start_node(qlc_SUITE_evaluator),
- ?line ok = rpc:call(Node, ?MODULE, evaluator_2, [Config, [compiler]]),
- ?line ?t:stop_node(Node),
+ {ok, Node} = start_node(qlc_SUITE_evaluator),
+ ok = rpc:call(Node, ?MODULE, evaluator_2, [Config, [compiler]]),
+ test_server:stop_node(Node),
ok.
evaluator_2(Config, Apps) ->
- ?line lists:foreach(fun(App) -> true = code:del_path(App) end, Apps),
+ lists:foreach(fun(App) -> true = code:del_path(App) end, Apps),
FileName = filename:join(?privdir, "eval"),
- ?line ok = file:write_file(FileName,
+ ok = file:write_file(FileName,
<<"H = qlc:q([X || X <- L]),
[1,2,3] = qlc:e(H).">>),
- ?line Bs = erl_eval:add_binding('L', [1,2,3], erl_eval:new_bindings()),
- ?line ok = file:eval(FileName, Bs),
+ Bs = erl_eval:add_binding('L', [1,2,3], erl_eval:new_bindings()),
+ ok = file:eval(FileName, Bs),
%% The error message is "handled" a bit too much...
%% (no trace of erl_lint left)
- ?line ok = file:write_file(FileName,
+ ok = file:write_file(FileName,
<<"H = qlc:q([X || X <- L]), qlc:e(H).">>),
- ?line {error,_} = file:eval(FileName),
+ {error,_} = file:eval(FileName),
%% Ugly error message; badarg is caught by file.erl.
- ?line ok = file:write_file(FileName,
+ ok = file:write_file(FileName,
<<"H = qlc:q([Z || {X,Y} <- [{a,2}], Z <- [Y]]), qlc:e(H).">>),
- ?line {error,_} = file:eval(FileName),
+ {error,_} = file:eval(FileName),
_ = file:delete(FileName),
ok.
start_node(Name) ->
- ?line PA = filename:dirname(code:which(?MODULE)),
- ?t:start_node(Name, slave, [{args, "-pa " ++ PA}]).
+ PA = filename:dirname(code:which(?MODULE)),
+ test_server:start_node(Name, slave, [{args, "-pa " ++ PA}]).
-string_to_handle(doc) ->
- "string_to_handle/1,2.";
-string_to_handle(suite) -> [];
+%% string_to_handle/1,2.
string_to_handle(Config) when is_list(Config) ->
- ?line {'EXIT',{badarg,_}} = (catch qlc:string_to_handle(14)),
- ?line {'EXIT',{badarg,_}} =
+ {'EXIT',{badarg,_}} = (catch qlc:string_to_handle(14)),
+ {'EXIT',{badarg,_}} =
(catch qlc:string_to_handle("[X || X <- [a].", unique_all)),
- ?line R1 = {error, _, {_,erl_scan,_}} = qlc:string_to_handle("'"),
- ?line "1: unterminated " ++ _ = lists:flatten(qlc:format_error(R1)),
- ?line {error, _, {_,erl_parse,_}} = qlc:string_to_handle("foo"),
- ?line {'EXIT',{badarg,_}} = (catch qlc:string_to_handle("foo, bar.")),
- ?line R3 = {error, _, {_,?QLC,not_a_query_list_comprehension}} =
+ R1 = {error, _, {_,erl_scan,_}} = qlc:string_to_handle("'"),
+ "1: unterminated " ++ _ = lists:flatten(qlc:format_error(R1)),
+ {error, _, {_,erl_parse,_}} = qlc:string_to_handle("foo"),
+ {'EXIT',{badarg,_}} = (catch qlc:string_to_handle("foo, bar.")),
+ R3 = {error, _, {_,?QLC,not_a_query_list_comprehension}} =
qlc:string_to_handle("bad."),
- ?line "1: argument is not" ++ _ = lists:flatten(qlc:format_error(R3)),
- ?line R4 = {error, _, {_,?QLC,{used_generator_variable,'Y'}}} =
+ "1: argument is not" ++ _ = lists:flatten(qlc:format_error(R3)),
+ R4 = {error, _, {_,?QLC,{used_generator_variable,'Y'}}} =
qlc:string_to_handle("[X || begin Y = [1,2], true end, X <- Y]."),
- ?line "1: generated variable 'Y'" ++ _ =
+ "1: generated variable 'Y'" ++ _ =
lists:flatten(qlc:format_error(R4)),
- ?line {error, _, {_,erl_lint,_}} = qlc:string_to_handle("[X || X <- A]."),
- ?line H1 = qlc:string_to_handle("[X || X <- [1,2]]."),
- ?line [1,2] = qlc:e(H1),
- ?line H2 = qlc:string_to_handle("[X || X <- qlc:append([a,b],"
+ {error, _, {_,erl_lint,_}} = qlc:string_to_handle("[X || X <- A]."),
+ H1 = qlc:string_to_handle("[X || X <- [1,2]]."),
+ [1,2] = qlc:e(H1),
+ H2 = qlc:string_to_handle("[X || X <- qlc:append([a,b],"
"qlc:e(qlc:q([X || X <- [c,d,e]])))]."),
- ?line [a,b,c,d,e] = qlc:e(H2),
+ [a,b,c,d,e] = qlc:e(H2),
%% The generated fun has many arguments (erl_eval has a maximum of 20).
- ?line H3 = qlc:string_to_handle(
+ H3 = qlc:string_to_handle(
"[{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W} ||"
" {A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W} <- []]."),
- ?line [] = qlc:e(H3),
- ?line Bs1 = erl_eval:add_binding('L', [1,2,3], erl_eval:new_bindings()),
- ?line H4 = qlc:string_to_handle("[X || X <- L].", [], Bs1),
- ?line [1,2,3] = qlc:e(H4),
- ?line H5 = qlc:string_to_handle("[X || X <- [1,2,1,2]].", [unique, cache]),
- ?line [1,2] = qlc:e(H5),
-
- ?line Ets = ets:new(test, []),
- ?line true = ets:insert(Ets, [{1}]),
- ?line Bs2 = erl_eval:add_binding('E', Ets, erl_eval:new_bindings()),
- ?line Q = "[X || {X} <- ets:table(E)].",
- ?line [1] = qlc:e(qlc:string_to_handle(Q, [], Bs2)),
- ?line [1] = qlc:e(qlc:string_to_handle(Q, {max_lookup,1000}, Bs2)),
- ?line [1] = qlc:e(qlc:string_to_handle(Q, {max_lookup,infinity}, Bs2)),
- ?line {'EXIT',{badarg,_}} =
+ [] = qlc:e(H3),
+ Bs1 = erl_eval:add_binding('L', [1,2,3], erl_eval:new_bindings()),
+ H4 = qlc:string_to_handle("[X || X <- L].", [], Bs1),
+ [1,2,3] = qlc:e(H4),
+ H5 = qlc:string_to_handle("[X || X <- [1,2,1,2]].", [unique, cache]),
+ [1,2] = qlc:e(H5),
+
+ Ets = ets:new(test, []),
+ true = ets:insert(Ets, [{1}]),
+ Bs2 = erl_eval:add_binding('E', Ets, erl_eval:new_bindings()),
+ Q = "[X || {X} <- ets:table(E)].",
+ [1] = qlc:e(qlc:string_to_handle(Q, [], Bs2)),
+ [1] = qlc:e(qlc:string_to_handle(Q, {max_lookup,1000}, Bs2)),
+ [1] = qlc:e(qlc:string_to_handle(Q, {max_lookup,infinity}, Bs2)),
+ {'EXIT',{badarg,_}} =
(catch qlc:string_to_handle(Q, {max_lookup,-1}, Bs2)),
- ?line {'EXIT', {no_lookup_to_carry_out, _}} =
+ {'EXIT', {no_lookup_to_carry_out, _}} =
(catch qlc:e(qlc:string_to_handle(Q, {lookup,true}, Bs2))),
- ?line ets:delete(Ets),
+ ets:delete(Ets),
ok.
-table(doc) ->
- "table";
-table(suite) -> [];
+%% table
table(Config) when is_list(Config) ->
dets:start(),
Ts = [
@@ -1353,11 +1306,11 @@ table(Config) when is_list(Config) ->
ets:delete(E)">>,
%% The info tag num_of_objects is currently not used.
-% <<"E = ets:new(test, [ordered_set]),
-% true = ets:insert(E, [{1,a},{2,b},{3,c}]),
-% H = qlc:q([X || X <- qlc_SUITE:bad_table_info_fun_n_objects(E)]),
-% {'EXIT', finito} = (catch {any_term,qlc:e(H)}),
-% ets:delete(E)">>,
+%% <<"E = ets:new(test, [ordered_set]),
+%% true = ets:insert(E, [{1,a},{2,b},{3,c}]),
+%% H = qlc:q([X || X <- qlc_SUITE:bad_table_info_fun_n_objects(E)]),
+%% {'EXIT', finito} = (catch {any_term,qlc:e(H)}),
+%% ets:delete(E)">>,
<<"E = ets:new(test, [ordered_set]),
true = ets:insert(E, [{1,a},{2,b},{3,c}]),
@@ -1473,7 +1426,7 @@ table(Config) when is_list(Config) ->
[1,2] = lookup_keys(Q)
end, [{1,1},{2,2}])">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
Ts2 = [
%% [T || P <- Table, F] turned into a match spec. Records needed.
@@ -1484,13 +1437,11 @@ table(Config) when is_list(Config) ->
[{a,1,2},{a,3,4}] = lists:sort(qlc:eval(QH)),
ets:delete(E)">>
],
- ?line run(Config, <<"-record(a, {b,c}).\n">>, Ts2),
+ run(Config, <<"-record(a, {b,c}).\n">>, Ts2),
ok.
-process_dies(doc) ->
- "Caller or cursor process dies.";
-process_dies(suite) -> [];
+%% Caller or cursor process dies.
process_dies(Config) when is_list(Config) ->
Ts = [
<<"E = ets:new(test, []),
@@ -1629,12 +1580,10 @@ process_dies(Config) when is_list(Config) ->
true = ets:delete(E), ok">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-sort(doc) ->
- "The sort option.";
-sort(suite) -> [];
+%% The sort option.
sort(Config) when is_list(Config) ->
Ts = [
<<"H = qlc:q([X || X <- qlc:sort([1,2,3,2], {unique,true})]),
@@ -1741,12 +1690,10 @@ sort(Config) when is_list(Config) ->
end
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-keysort(doc) ->
- "The sort option.";
-keysort(suite) -> [];
+%% The sort option.
keysort(Config) when is_list(Config) ->
Ts = [
@@ -1865,13 +1812,11 @@ keysort(Config) when is_list(Config) ->
100003 = length(R)">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-filesort(doc) ->
- "keysort/1,2, using a file.";
-filesort(suite) -> [];
+%% keysort/1,2, using a file.
filesort(Config) when is_list(Config) ->
Ts = [
<<"Q = qlc:q([X || X <- [{3},{1},{2}]]),
@@ -1879,13 +1824,11 @@ filesort(Config) when is_list(Config) ->
Q2 = qlc:q([{X,Y} || Y <- [1,2], X <- qlc:keysort([1],Q,Opts)]),
[{{1},1},{{2},1},{{3},1},{{1},2},{{2},2},{{3},2}] = qlc:e(Q2)">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-cache(doc) ->
- "The cache option.";
-cache(suite) -> [];
+%% The cache option.
cache(Config) when is_list(Config) ->
Ts = [
<<"{'EXIT', {badarg, _}} = (catch qlc:q([X || X <- [1,2]], badarg))">>,
@@ -2043,12 +1986,10 @@ cache(Config) when is_list(Config) ->
[]} = i(H, cache_all)">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-cache_list(doc) ->
- "OTP-6038. The {cache,list} option.";
-cache_list(suite) -> [];
+%% OTP-6038. The {cache,list} option.
cache_list(Config) when is_list(Config) ->
Ts = [
begin
@@ -2334,12 +2275,10 @@ cache_list(Config) when is_list(Config) ->
{'EXIT', {badarg, _}} = (catch qlc:e(Q, {max_list_size, foo}))">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-filter(doc) ->
- "Filters and match specs.";
-filter(suite) -> [];
+%% Filters and match specs.
filter(Config) when is_list(Config) ->
Ts = [
<<"L = [1,2,3,4,5],
@@ -2461,12 +2400,10 @@ filter(Config) when is_list(Config) ->
[{2,b},{2,c},{3,b},{3,c}] = qlc:e(H)">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-info(doc) ->
- "info/2.";
-info(suite) -> [];
+%% info/2.
info(Config) when is_list(Config) ->
Ts = [
<<"{list, [1,2]} = i(qlc:q([X || X <- [1,2]])),
@@ -2686,12 +2623,10 @@ info(Config) when is_list(Config) ->
[{4},{5},{6}] = qlc:e(F(3))">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-nested_info(doc) ->
- "Nested QLC expressions. QLC expressions in filter and template.";
-nested_info(suite) -> [];
+%% Nested QLC expressions. QLC expressions in filter and template.
nested_info(Config) when is_list(Config) ->
Ts = [
<<"L = [{1,a},{2,b},{3,c}],
@@ -2792,13 +2727,11 @@ nested_info(Config) when is_list(Config) ->
[{1,1},{1,1},{1,2},{1,2},{2,1},{2,1},{2,2},{2,2}] = qlc:e(Q)">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-lookup1(doc) ->
- "Lookup keys. Mostly test of patterns.";
-lookup1(suite) -> [];
+%% Lookup keys. Mostly test of patterns.
lookup1(Config) when is_list(Config) ->
Ts = [
<<"etsc(fun(E) ->
@@ -3003,12 +2936,10 @@ lookup1(Config) when is_list(Config) ->
[]}
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-lookup2(doc) ->
- "Lookup keys. Mostly test of filters.";
-lookup2(suite) -> [];
+%% Lookup keys. Mostly test of filters.
lookup2(Config) when is_list(Config) ->
Ts = [
<<"%% Only guards are inspected. No lookup.
@@ -3708,9 +3639,7 @@ lookup2(Config) when is_list(Config) ->
ok.
-lookup_rec(doc) ->
- "Lookup keys. With records.";
-lookup_rec(suite) -> [];
+%% Lookup keys. With records.
lookup_rec(Config) when is_list(Config) ->
Ts = [
<<"etsc(fun(E) ->
@@ -3778,12 +3707,10 @@ lookup_rec(Config) when is_list(Config) ->
[_] = lookup_keys(Q)
end, [{keypos,2}], [#r{a=foo}])">>
],
- ?line run(Config, <<"-record(r, {a}).\n">>, Ts),
+ run(Config, <<"-record(r, {a}).\n">>, Ts),
ok.
-indices(doc) ->
- "Using indices for lookup.";
-indices(suite) -> [];
+%% Using indices for lookup.
indices(Config) when is_list(Config) ->
Ts = [
<<"L = [{1,a},{2,b},{3,c}],
@@ -3845,12 +3772,10 @@ indices(Config) when is_list(Config) ->
[{c,3,z,w}] = qlc:eval(QH)">>
],
- ?line run(Config, <<"-record(r, {a}).\n">>, Ts),
+ run(Config, <<"-record(r, {a}).\n">>, Ts),
ok.
-pre_fun(doc) ->
- "Test the table/2 callback functions parent_fun and stop_fun.";
-pre_fun(suite) -> [];
+%% Test the table/2 callback functions parent_fun and stop_fun.
pre_fun(Config) when is_list(Config) ->
Ts = [
<<"PF = process_flag(trap_exit, true),
@@ -3926,12 +3851,10 @@ pre_fun(Config) when is_list(Config) ->
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-skip_filters(doc) ->
- "Lookup keys. With records.";
-skip_filters(suite) -> [];
+%% Lookup keys. With records.
skip_filters(Config) when is_list(Config) ->
%% Skipped filters
TsS = [
@@ -4051,7 +3974,7 @@ skip_filters(Config) when is_list(Config) ->
end, [{0},{1},{2},{3},{4}])">>
],
- ?line run(Config, TsS),
+ run(Config, TsS),
Ts = [
<<"etsc(fun(E) ->
@@ -4329,14 +4252,12 @@ skip_filters(Config) when is_list(Config) ->
end, [{1},{2},{3}])">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-ets(doc) ->
- "ets:table/1,2.";
-ets(suite) -> [];
+%% ets:table/1,2.
ets(Config) when is_list(Config) ->
Ts = [
<<"E = ets:new(t, [ordered_set]),
@@ -4377,12 +4298,10 @@ ets(Config) when is_list(Config) ->
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-dets(doc) ->
- "dets:table/1,2.";
-dets(suite) -> [];
+%% dets:table/1,2.
dets(Config) when is_list(Config) ->
dets:start(),
T = t,
@@ -4475,14 +4394,12 @@ dets(Config) when is_list(Config) ->
],
- ?line run(Config, Ts),
+ run(Config, Ts),
_ = file:delete(Fname),
ok.
-join_option(doc) ->
- "The 'join' option (any, lookup, merge, nested_loop). Also cache/unique.";
-join_option(suite) -> [];
+%% The 'join' option (any, lookup, merge, nested_loop). Also cache/unique.
join_option(Config) when is_list(Config) ->
Ts = [
<<"Q1 = qlc:q([X || X <- [1,2,3]],{join,merge}),
@@ -4607,7 +4524,7 @@ join_option(Config) when is_list(Config) ->
ets:delete(E1)">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
%% The 'cache' and 'unique' options of qlc/2 affects join.
CUTs = [
@@ -4655,13 +4572,11 @@ join_option(Config) when is_list(Config) ->
_],[{unique,true}]} = i(Q, Options),
[{1,1,1},{2,2,1},{1,1,2},{2,2,2}] = qlc:e(Q, Options)">>
],
- ?line run(Config, CUTs),
+ run(Config, CUTs),
ok.
-join_filter(doc) ->
- "Various aspects of filters and join.";
-join_filter(suite) -> [];
+%% Various aspects of filters and join.
join_filter(Config) when is_list(Config) ->
Ts = [
<<"E1 = create_ets(1, 10),
@@ -4698,12 +4613,10 @@ join_filter(Config) when is_list(Config) ->
end, [{a},{b},{c}])">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-join_lookup(doc) ->
- "Lookup join.";
-join_lookup(suite) -> [];
+%% Lookup join.
join_lookup(Config) when is_list(Config) ->
Ts = [
<<"E1 = create_ets(1, 10),
@@ -4793,12 +4706,10 @@ join_lookup(Config) when is_list(Config) ->
ets:delete(E)">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-join_merge(doc) ->
- "Merge join.";
-join_merge(suite) -> [];
+%% Merge join.
join_merge(Config) when is_list(Config) ->
Ts = [
<<"Q = qlc:q([{X,Y} || {X} <- [], {Y} <- [{1}], X =:= Y],
@@ -5070,7 +4981,7 @@ join_merge(Config) when is_list(Config) ->
[{2,a}] = qlc:e(Q)">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
%% Small examples. Returning an error term.
ETs = [
@@ -5249,7 +5160,7 @@ join_merge(Config) when is_list(Config) ->
err = qlc:e(Q)">>
],
- ?line run(Config, ETs),
+ run(Config, ETs),
%% Mostly examples where temporary files are needed while merging.
FTs = [
@@ -5408,13 +5319,11 @@ join_merge(Config) when is_list(Config) ->
],
- ?line run(Config, FTs),
+ run(Config, FTs),
ok.
-join_sort(doc) ->
- "Merge join optimizations (avoid unnecessary sorting).";
-join_sort(suite) -> [];
+%% Merge join optimizations (avoid unnecessary sorting).
join_sort(Config) when is_list(Config) ->
Ts = [
<<"H1_1 = qlc:keysort(1, [{1,2,3},{4,5,6}]),
@@ -5694,12 +5603,10 @@ join_sort(Config) when is_list(Config) ->
end, [{1,2},{3,4}])">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-join_complex(doc) ->
- "Join of more than two columns.";
-join_complex(suite) -> [];
+%% Join of more than two columns.
join_complex(Config) when is_list(Config) ->
Ts = [{three,
<<"three() ->
@@ -5727,7 +5634,7 @@ join_complex(Config) when is_list(Config) ->
{warnings,[{2,qlc,too_many_joins}]}}
],
- ?line compile(Config, Ts),
+ compile(Config, Ts),
Ts2 = [{three,
<<"three() ->
@@ -5756,14 +5663,12 @@ join_complex(Config) when is_list(Config) ->
{[],["cannot handle more than one join efficiently"]}}
],
- ?line compile_format(Config, Ts2),
+ compile_format(Config, Ts2),
ok.
-otp_5644(doc) ->
- "OTP-5644. Handle the new language element M:F/A.";
-otp_5644(suite) -> [];
+%% OTP-5644. Handle the new language element M:F/A.
otp_5644(Config) when is_list(Config) ->
Ts = [
<<"Q = qlc:q([fun modul:mfa/0 || _ <- [1,2],
@@ -5771,12 +5676,10 @@ otp_5644(Config) when is_list(Config) ->
[_,_] = qlc:eval(Q)">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-otp_5195(doc) ->
- "OTP-5195. Allow traverse functions returning terms.";
-otp_5195(suite) -> [];
+%% OTP-5195. Allow traverse functions returning terms.
otp_5195(Config) when is_list(Config) ->
%% Several minor improvements have been implemented in OTP-5195.
%% The test cases are spread all over... except these.
@@ -5854,7 +5757,7 @@ otp_5195(Config) when is_list(Config) ->
],
- ?line run(Config, Ts),
+ run(Config, Ts),
Ts2 = [<<"Q = qlc:q([{X,Y} || {X} <- [{1},{2},{3}],
begin
@@ -5863,13 +5766,11 @@ otp_5195(Config) when is_list(Config) ->
end,
X =:= Y]),
[{3,3}] = qlc:e(Q)">>],
- ?line run(Config, Ts2),
+ run(Config, Ts2),
ok.
-otp_6038_bug(doc) ->
- "OTP-6038. Bug fixes: unique and keysort; cache.";
-otp_6038_bug(suite) -> [];
+%% OTP-6038. Bug fixes: unique and keysort; cache.
otp_6038_bug(Config) when is_list(Config) ->
%% The 'unique' option can no longer be merged with the keysort options.
%% This used to return [{1,a},{1,c},{2,b},{2,d}], but since
@@ -5879,7 +5780,7 @@ otp_6038_bug(Config) when is_list(Config) ->
H2 = qlc:keysort(1, H1, [{unique,true}]),
[{1,a},{2,b}] = qlc:e(H2)">>],
- ?line run(Config, Ts),
+ run(Config, Ts),
%% Sometimes the cache options did not empty the correct tables.
CTs = [
@@ -5908,13 +5809,11 @@ otp_6038_bug(Config) when is_list(Config) ->
L = [{X,Y} || X <- [1,2], Y <- L4],
true = R =:= L">>
],
- ?line run(Config, CTs),
+ run(Config, CTs),
ok.
-otp_6359(doc) ->
- "OTP-6359. dets:select() never returns the empty list.";
-otp_6359(suite) -> [];
+%% OTP-6359. dets:select() never returns the empty list.
otp_6359(Config) when is_list(Config) ->
dets:start(),
T = luna,
@@ -5933,12 +5832,10 @@ otp_6359(Config) when is_list(Config) ->
ok">>]
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
-otp_6562(doc) ->
- "OTP-6562. compressed = false (should be []) when sorting before join.";
-otp_6562(suite) -> [];
+%% OTP-6562. compressed = false (should be []) when sorting before join.
otp_6562(Config) when is_list(Config) ->
Bug = [
%% This example uses a file to sort E2 on the second column. It is
@@ -5957,7 +5854,7 @@ otp_6562(Config) when is_list(Config) ->
ets:delete(E1),
ets:delete(E2)">>
],
- ?line run(Config, Bug),
+ run(Config, Bug),
Bits = [
{otp_6562_1,
@@ -5969,18 +5866,16 @@ otp_6562(Config) when is_list(Config) ->
{errors,[{2,qlc,binary_generator}],
[]}}
],
- ?line [] = compile(Config, Bits),
+ [] = compile(Config, Bits),
- ?line R1 = {error,qlc,{1,qlc,binary_generator}}
+ R1 = {error,qlc,{1,qlc,binary_generator}}
= qlc:string_to_handle("[X || <<X:8>> <= <<\"hej\">>]."),
- ?line "1: cannot handle binary generators\n" =
+ "1: cannot handle binary generators\n" =
lists:flatten(qlc:format_error(R1)),
ok.
-otp_6590(doc) ->
- "OTP-6590. Bug fix (join info).";
-otp_6590(suite) -> [];
+%% OTP-6590. Bug fix (join info).
otp_6590(Config) when is_list(Config) ->
Ts = [<<"fun(Tab1Value) ->
Q = qlc:q([T1#tab1.id || T1 <- [#tab1{id = id1,
@@ -5992,13 +5887,11 @@ otp_6590(Config) when is_list(Config) ->
[id1] = qlc:e(Q)
end(v)">>],
- ?line run(Config, <<"-record(tab1, {id, tab2_id, value}).
+ run(Config, <<"-record(tab1, {id, tab2_id, value}).
-record(tab2, {id, value}).\n">>, Ts),
ok.
-otp_6673(doc) ->
- "OTP-6673. Optimizations and fixes.";
-otp_6673(suite) -> [];
+%% OTP-6673. Optimizations and fixes.
otp_6673(Config) when is_list(Config) ->
Ts_PT =
[<<"etsc(fun(E1) ->
@@ -6054,7 +5947,7 @@ otp_6673(Config) when is_list(Config) ->
end,
[{1,x},{2,y},{3,z}])">>],
- ?line run(Config, Ts_PT),
+ run(Config, Ts_PT),
MS = ets:fun2ms(fun({X,_Y}=T) when X > 1 -> T end),
Ts_RT = [
@@ -6091,13 +5984,11 @@ otp_6673(Config) when is_list(Config) ->
end, [{x,1},{y,2},{z,3}])">>
],
- ?line run(Config, Ts_RT),
+ run(Config, Ts_RT),
ok.
-otp_6964(doc) ->
- "OTP-6964. New option 'tmpdir_usage'.";
-otp_6964(suite) -> [];
+%% OTP-6964. New option 'tmpdir_usage'.
otp_6964(Config) when is_list(Config) ->
T1 = [
<<"Q1 = qlc:q([{X} || X <- [1,2]]),
@@ -6131,7 +6022,7 @@ otp_6964(Config) when is_list(Config) ->
_ = erlang:system_flag(backtrace_depth, D)
end,
qlc_SUITE:uninstall_error_logger()">>],
- ?line run(Config, T1),
+ run(Config, T1),
T2 = [
<<"%% File sorter.
@@ -6164,7 +6055,7 @@ otp_6964(Config) when is_list(Config) ->
{info, caching} = qlc_SUITE:read_error_logger(),
qlc_SUITE:uninstall_error_logger()">>],
- ?line run(Config, T2),
+ run(Config, T2),
T3 = [
<<"%% sort/keysort
@@ -6194,7 +6085,7 @@ otp_6964(Config) when is_list(Config) ->
qlc_SUITE:uninstall_error_logger(),
ets:delete(E1),
ets:delete(E2)">>],
- ?line run(Config, T3),
+ run(Config, T3),
T4 = [
<<"%% cache list
@@ -6225,18 +6116,16 @@ otp_6964(Config) when is_list(Config) ->
lists:flatten(qlc:format_error(ErrReply))
end, [{keypos,1}], [{I,a,lists:duplicate(100000,1)} ||
I <- lists:seq(1, 10)])">>],
- ?line run(Config, T4),
+ run(Config, T4),
ok.
-otp_7238(doc) ->
- "OTP-7238. info-option 'depth', &c.";
-otp_7238(suite) -> [];
+%% OTP-7238. info-option 'depth', &c.
otp_7238(Config) when is_list(Config) ->
dets:start(),
T = otp_7238,
Fname = filename(T, Config),
- ?line ok = compile_gb_table(Config),
+ ok = compile_gb_table(Config),
%% A few more warnings.
T1 = [
@@ -6365,7 +6254,7 @@ otp_7238(Config) when is_list(Config) ->
[],
{warnings,[{2,sys_core_fold,no_clause_match}]}}
],
- ?line [] = compile(Config, T1),
+ [] = compile(Config, T1),
%% 'depth' is a new option used by info()
T2 = [
@@ -6591,7 +6480,7 @@ otp_7238(Config) when is_list(Config) ->
qlc:info(Q, [{format,abstract_code},{depth, 2}])">>
],
- ?line run(Config, T2),
+ run(Config, T2),
T3 = [
%% {nomatch_6,
@@ -6607,7 +6496,7 @@ otp_7238(Config) when is_list(Config) ->
%% [],
%% {[],["pattern cannot possibly match"]}}
],
- ?line compile_format(Config, T3),
+ compile_format(Config, T3),
%% *Very* simple test - just check that it doesn't crash.
Type = [{cres,
@@ -6615,13 +6504,11 @@ otp_7238(Config) when is_list(Config) ->
{'EXIT',{{badfun,_},_}} = (catch qlc:e(Q))">>,
[type_checker],
[]}],
- ?line run(Config, Type),
+ run(Config, Type),
ok.
-otp_7114(doc) ->
- "OTP-7114. Match spec, table and duplicated objects..";
-otp_7114(suite) -> [];
+%% OTP-7114. Match spec, table and duplicated objects...
otp_7114(Config) when is_list(Config) ->
Ts = [<<"T = ets:new(t, [bag]),
[ets:insert(T, {t, I, I div 2}) || I <- lists:seq(1,10)],
@@ -6632,11 +6519,9 @@ otp_7114(Config) when is_list(Config) ->
[0,1,2,3,4,5] = qlc:e(qlc:sort(qlc:e(Q1)), unique_all),
ets:delete(T),
ok">>],
- ?line run(Config, Ts).
+ run(Config, Ts).
-otp_7232(doc) ->
- "OTP-7232. qlc:info() bug (pids, ports, refs, funs).";
-otp_7232(suite) -> [];
+%% OTP-7232. qlc:info() bug (pids, ports, refs, funs).
otp_7232(Config) when is_list(Config) ->
Ts = [<<"L = [fun math:sqrt/1, list_to_pid(\"<0.4.1>\"),
erlang:make_ref()],
@@ -6664,11 +6549,9 @@ otp_7232(Config) when is_list(Config) ->
\"[<<8,1:1>>]\" = qlc:info(Q)">>
],
- ?line run(Config, Ts).
+ run(Config, Ts).
-otp_7552(doc) ->
- "OTP-7552. Merge join bug.";
-otp_7552(suite) -> [];
+%% OTP-7552. Merge join bug.
otp_7552(Config) when is_list(Config) ->
%% The poor performance cannot be observed unless the
%% (redundant) join filter is skipped.
@@ -6691,11 +6574,9 @@ otp_7552(Config) when is_list(Config) ->
Qn = F(nested_loop),
true = lists:sort(qlc:e(Qm, {max_list_size,20})) =:=
lists:sort(qlc:e(Qn))">>],
- ?line run(Config, Ts).
+ run(Config, Ts).
-otp_7714(doc) ->
- "OTP-7714. Merge join bug.";
-otp_7714(suite) -> [];
+%% OTP-7714. Merge join bug.
otp_7714(Config) when is_list(Config) ->
%% The original example uses Mnesia. This one does not.
Ts = [<<"E1 = ets:new(set,[]),
@@ -6710,11 +6591,9 @@ otp_7714(Config) when is_list(Config) ->
[{a,1},{a,2},{a,3}] = lists:sort(qlc:e(Q)),
ets:delete(E1),
ets:delete(E2)">>],
- ?line run(Config, Ts).
+ run(Config, Ts).
-otp_11758(doc) ->
- "OTP-11758. Bug.";
-otp_11758(suite) -> [];
+%% OTP-11758. Bug.
otp_11758(Config) when is_list(Config) ->
Ts = [<<"T = ets:new(r, [{keypos, 2}]),
L = [{rrr, xxx, aaa}, {rrr, yyy, bbb}],
@@ -6725,12 +6604,10 @@ otp_11758(Config) when is_list(Config) ->
ets:delete(T)">>],
run(Config, Ts).
-otp_6674(doc) ->
- "OTP-6674. match/comparison.";
-otp_6674(suite) -> [];
+%% OTP-6674. match/comparison.
otp_6674(Config) when is_list(Config) ->
- ?line ok = compile_gb_table(Config),
+ ok = compile_gb_table(Config),
Ts = [%% lookup join
<<"E = ets:new(join, [ordered_set]),
@@ -7153,11 +7030,9 @@ otp_6674(Config) when is_list(Config) ->
],
- ?line run(Config, Ts).
+ run(Config, Ts).
-otp_12946(doc) ->
- ["Syntax error."];
-otp_12946(suite) -> [];
+%% Syntax error.
otp_12946(Config) when is_list(Config) ->
Text =
<<"-export([init/0]).
@@ -7167,12 +7042,10 @@ otp_12946(Config) when is_list(Config) ->
{errors,[{4,erl_parse,_}],[]} = compile_file(Config, Text, []),
ok.
-manpage(doc) ->
- "Examples from qlc(3).";
-manpage(suite) -> [];
+%% Examples from qlc(3).
manpage(Config) when is_list(Config) ->
- ?line ok = compile_gb_table(Config),
+ ok = compile_gb_table(Config),
Ts = [
<<"QH = qlc:q([{X,Y} || X <- [a,b], Y <- [1,2]]),
@@ -7327,7 +7200,7 @@ manpage(Config) when is_list(Config) ->
ets:match_spec_compile([{{{'$1','$2'},'_'},[],['$1']}]))\",
L = qlc:info(QH)">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
L = [1,2,3],
Bs = erl_eval:add_binding('L', L, erl_eval:new_bindings()),
@@ -7345,7 +7218,7 @@ manpage(Config) when is_list(Config) ->
true = qlc:info(QH1) =:= qlc:info(QH2),
true = ets:delete(Tab)">>]],
- ?line run(Config, ETs),
+ run(Config, ETs),
%% dets(3)
DTs = [
@@ -7358,16 +7231,16 @@ manpage(Config) when is_list(Config) ->
true = qlc:info(QH1) =:= qlc:info(QH2),
ok = dets:close(T)">>]],
- ?line run(Config, DTs),
+ run(Config, DTs),
ok.
compile_gb_table(Config) ->
GB_table_file = filename("gb_table.erl", Config),
- ?line ok = file:write_file(GB_table_file, gb_table()),
- ?line {ok, gb_table} = compile:file(GB_table_file, [{outdir,?privdir}]),
- ?line code:purge(gb_table),
- ?line {module, gb_table} =
+ ok = file:write_file(GB_table_file, gb_table()),
+ {ok, gb_table} = compile:file(GB_table_file, [{outdir,?privdir}]),
+ code:purge(gb_table),
+ {module, gb_table} =
code:load_abs(filename:rootname(GB_table_file)),
ok.
@@ -7433,9 +7306,7 @@ gb_iter(I0, N, EFun) ->
">>.
-backward(doc) ->
- "OTP-6674. Join info and extra constants.";
-backward(suite) -> [];
+%% OTP-6674. Join info and extra constants.
backward(Config) when is_list(Config) ->
try_old_join_info(Config),
ok.
@@ -7470,9 +7341,6 @@ try_old_join_info(Config) ->
qlc:info(H2, {format,debug}),
[{1,1},{2,2}] = qlc:e(H2).
-forward(doc) ->
- "";
-forward(suite) -> [];
forward(Config) when is_list(Config) ->
Ts = [
%% LC_fun() returns something unknown.
@@ -7481,12 +7349,12 @@ forward(Config) when is_list(Config) ->
{'EXIT', {{unsupported_qlc_handle,_},_}} = (catch qlc:e(FakeH))">>,
%% 'f1' should be used for new stuff that does not interfer with old behavior
-% %% The unused element 'f1' of #qlc_table seems to be used.
-% <<"DF = fun() -> foo end,
-% FakeH = {qlc_handle,{qlc_table,DF,
-% true,DF,DF,DF,DF,DF,
-% undefined,not_undefined,undefined,no_match_spec}},
-% {'EXIT', {{unsupported_qlc_handle,_},_}} = (catch qlc:e(FakeH))">>,
+%% %% The unused element 'f1' of #qlc_table seems to be used.
+%% <<"DF = fun() -> foo end,
+%% FakeH = {qlc_handle,{qlc_table,DF,
+%% true,DF,DF,DF,DF,DF,
+%% undefined,not_undefined,undefined,no_match_spec}},
+%% {'EXIT', {{unsupported_qlc_handle,_},_}} = (catch qlc:e(FakeH))">>,
%% #qlc_opt has changed.
<<"H = qlc:q([X || X <- []]),
@@ -7495,7 +7363,7 @@ forward(Config) when is_list(Config) ->
{'EXIT', {{unsupported_qlc_handle,_},_}} = (catch qlc:e(FakeH))">>
],
- ?line run(Config, Ts),
+ run(Config, Ts),
ok.
eep37(Config) when is_list(Config) ->
@@ -7955,7 +7823,7 @@ run_test(Config, Extra, {cres, Body, Opts, ExpectedCompileReturn}) ->
R = case catch Mod:function() of
{'EXIT', _Reason} = Error ->
- ?t:format("failed, got ~p~n", [Error]),
+ io:format("failed, got ~p~n", [Error]),
fail(SourceFile);
Reply ->
Reply
@@ -7966,7 +7834,7 @@ run_test(Config, Extra, {cres, Body, Opts, ExpectedCompileReturn}) ->
{file, cover_compiled} ->
ok;
{file, _} ->
- ?t:format("qlc_pt was loaded in runtime~n", []),
+ io:format("qlc_pt was loaded in runtime~n", []),
fail(SourceFile);
false ->
ok
@@ -8167,16 +8035,15 @@ warnings(File, Ws) ->
end.
expected(Test, Expected, Got, File) ->
- ?t:format("~nTest ~p failed. ", [Test]),
+ io:format("~nTest ~p failed. ", [Test]),
expected(Expected, Got, File).
expected(Expected, Got, File) ->
- ?t:format("Expected~n ~p~n, but got~n ~p~n", [Expected, Got]),
+ io:format("Expected~n ~p~n, but got~n ~p~n", [Expected, Got]),
fail(File).
fail(Source) ->
- io:format("failed~n"),
- ?t:fail({failed,testcase,on,Source}).
+ ct:fail({failed,testcase,on,Source}).
%% Copied from global_SUITE.erl.
@@ -8197,8 +8064,8 @@ read_error_logger() ->
{error, Pid, Tuple} ->
{error, Pid, Tuple}
after 1000 ->
- ?line io:format("No reply after 1 s\n", []),
- ?line ?t:fail()
+ io:format("No reply after 1 s\n", []),
+ ct:fail(failed)
end.
%%-----------------------------------------------------------------
diff --git a/lib/stdlib/test/queue_SUITE.erl b/lib/stdlib/test/queue_SUITE.erl
index 77fe6adb7c..cd3f8e6e2f 100644
--- a/lib/stdlib/test/queue_SUITE.erl
+++ b/lib/stdlib/test/queue_SUITE.erl
@@ -19,26 +19,23 @@
%%
-module(queue_SUITE).
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
+ init_per_testcase/2, end_per_testcase/2,
init_per_group/2,end_per_group/2]).
-export([do/1, to_list/1, io_test/1, op_test/1, error/1, oops/1]).
--export([init_per_testcase/2, end_per_testcase/2]).
-include_lib("common_test/include/ct.hrl").
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[do, to_list, io_test, op_test, error, oops].
@@ -59,47 +56,40 @@ end_per_group(_GroupName, Config) ->
Config.
-do(doc) ->
- [""];
-do(suite) ->
- [];
do(Config) when is_list(Config) ->
- ?line L = [{in, 1},
- {in, 2},
- {out, {value, 1}},
- {in, 3},
- {out, {value, 2}},
- {out, {value, 3}},
- {out, empty}
- ],
-
- ?line E = queue:new(),
- ?line [] = queue:to_list(E),
- ?line Q = do_queue(E, L),
- ?line true = queue:is_empty(Q),
- ?line 0 = queue:len(Q),
+ L = [{in, 1},
+ {in, 2},
+ {out, {value, 1}},
+ {in, 3},
+ {out, {value, 2}},
+ {out, {value, 3}},
+ {out, empty}
+ ],
+
+ E = queue:new(),
+ [] = queue:to_list(E),
+ Q = do_queue(E, L),
+ true = queue:is_empty(Q),
+ 0 = queue:len(Q),
ok.
-to_list(doc) ->
- ["OTP-2701"];
-to_list(suite) ->
- [];
+%% OTP-2701
to_list(Config) when is_list(Config) ->
- ?line E = queue:new(),
- ?line Q = do_queue(E, [{in, 1},
- {in, 2},
- {in, 3},
- {out, {value, 1}},
- {in, 4},
- {in, 5}]),
- ?line true = queue:is_queue(Q),
- ?line 4 = queue:len(Q),
- ?line case queue:to_list(Q) of
- [2,3,4,5] ->
- ok;
- Other1 ->
- test_server:fail(Other1)
- end,
+ E = queue:new(),
+ Q = do_queue(E, [{in, 1},
+ {in, 2},
+ {in, 3},
+ {out, {value, 1}},
+ {in, 4},
+ {in, 5}]),
+ true = queue:is_queue(Q),
+ 4 = queue:len(Q),
+ case queue:to_list(Q) of
+ [2,3,4,5] ->
+ ok;
+ Other1 ->
+ ct:fail(Other1)
+ end,
ok.
do_queue(Q, []) ->
@@ -114,93 +104,86 @@ do_queue_1({out, E}, Q) ->
{E, Q1} ->
Q1;
Other ->
- test_server:fail({"out failed", E, Q, Other})
+ ct:fail({"out failed", E, Q, Other})
end.
-io_test(doc) ->
- "Test input and output";
-io_test(suite) ->
- [];
+%% Test input and output.
io_test(Config) when is_list(Config) ->
E = queue:new(),
do_io_test(E),
ok.
do_io_test(E) ->
- ?line [4,3,5] =
+ [4,3,5] =
io([snoc,snoc,head,head,head,cons,cons,snoc], E, 1),
- ?line [5,3,4] =
+ [5,3,4] =
io([cons,cons,daeh,daeh,daeh,snoc,snoc,cons], E, 1),
- ?line [4,3,5] =
+ [4,3,5] =
io([in,in,out,out,out,in_r,in_r,in], E, 1),
- ?line [5,3,4] =
+ [5,3,4] =
io([in_r,in_r,out_r,out_r,out_r,in,in,in_r], E, 1),
%%
- ?line [] =
+ [] =
io([snoc,snoc,head,snoc,snoc,head,head,snoc,head,head], E, 1),
- ?line [] =
+ [] =
io([cons,cons,daeh,cons,cons,daeh,daeh,cons,daeh,daeh], E, 1),
- ?line [] =
+ [] =
io([in,in,out,in,in,out,out,in,out,out], E, 1),
- ?line [] =
+ [] =
io([in_r,in_r,out_r,in_r,in_r,out_r,out_r,in_r,out_r,out_r],
E, 1),
%%
- ?line [5,6] =
+ [5,6] =
io([snoc,snoc,snoc,head,head,snoc,snoc,snoc,head,head], E, 1),
- ?line [6,5] =
+ [6,5] =
io([cons,cons,cons,daeh,daeh,cons,cons,cons,daeh,daeh], E, 1),
- ?line [5,6] =
+ [5,6] =
io([in,in,in,out,out,in,in,in,out,out], E, 1),
- ?line [6,5] =
+ [6,5] =
io([in_r,in_r,in_r,out_r,out_r,in_r,in_r,in_r,out_r,out_r],
E, 1),
%%
- ?line [5] =
+ [5] =
io([snoc,head,head,snoc,head,snoc,head,snoc,head,snoc], E, 1),
- ?line [5] =
+ [5] =
io([cons,daeh,daeh,cons,daeh,cons,daeh,cons,daeh,cons], E, 1),
- ?line [5] =
+ [5] =
io([in,out,out,in,out,in,out,in,out,in], E, 1),
- ?line [5] =
+ [5] =
io([in_r,out_r,out_r,in_r,out_r,in_r,out_r,in_r,out_r,in_r],
E, 1),
%%
- ?line [] =
+ [] =
io([snoc,head,snoc,snoc,head,head,snoc,snoc,snoc,head,head,head],
E, 1),
- ?line [] =
+ [] =
io([cons,daeh,cons,cons,daeh,daeh,cons,cons,cons,daeh,daeh,daeh],
- E, 1),
- ?line [] =
+ E, 1),
+ [] =
io([in,out,in,in,out,out,in,in,in,out,out,out],
E, 1),
- ?line [] =
+ [] =
io([in_r,out_r,in_r,in_r,out_r,out_r,in_r,in_r,in_r,out_r,out_r,out_r],
- E, 1),
+ E, 1),
%%
- ?line [3] = io([cons,cons,cons,snoc,daeh,daeh,daeh], E, 1),
- ?line [3] = io([snoc,snoc,snoc,cons,head,head,head], E, 1),
- ?line [3] = io([in,in,in,in_r,out,out,out], E, 1),
- ?line [3] = io([in_r,in_r,in_r,in,out_r,out_r,out_r], E, 1),
+ [3] = io([cons,cons,cons,snoc,daeh,daeh,daeh], E, 1),
+ [3] = io([snoc,snoc,snoc,cons,head,head,head], E, 1),
+ [3] = io([in,in,in,in_r,out,out,out], E, 1),
+ [3] = io([in_r,in_r,in_r,in,out_r,out_r,out_r], E, 1),
%%
- ?line Q2 = queue:join(queue:cons(1, E),queue:cons(2, E)),
- ?line Q1 = queue:reverse(Q2),
- ?line [1] = io([head], Q1, 3),
- ?line [1] = io([out], Q1, 3),
- ?line [1] = io([daeh], Q2, 3),
- ?line [1] = io([out_r], Q2, 3),
-% ?line [2] = io([cons,cons,snoc,daeh,daeh], [], 1),
-% ?line [2] = io([snoc,snoc,cons,head,head], [], 1),
-% ?line [2] = io([in,in,in_r,out,out], [], 1),
-% ?line [2] = io([in_r,in_r,in,out_r,out_r], [], 1),
+ Q2 = queue:join(queue:cons(1, E),queue:cons(2, E)),
+ Q1 = queue:reverse(Q2),
+ [1] = io([head], Q1, 3),
+ [1] = io([out], Q1, 3),
+ [1] = io([daeh], Q2, 3),
+ [1] = io([out_r], Q2, 3),
%%
- ?line [2] =
+ [2] =
io([in,peek,peek_r,drop,in_r,peek,peek_r,in,peek,peek_r,drop_r], E, 1),
%% Malformed queues UGLY-GUTS-ALL-OVER-THE-PLACE
- ?line [2,1] = io([peek], {[1,2],[]}, 1),
- ?line [1,2] = io([peek_r], {[],[1,2]}, 1),
+ [2,1] = io([peek], {[1,2],[]}, 1),
+ [1,2] = io([peek_r], {[],[1,2]}, 1),
%%
ok.
@@ -269,7 +252,7 @@ io([peek_r | Tail], Q, Q0, X) ->
io([drop | Tail], Q, [], X) ->
try queue:drop(Q) of
V ->
- test_server:fail({?MODULE,?LINE,V})
+ ct:fail({?MODULE,?LINE,V})
catch
error:empty ->
io(Tail, Q, [], X)
@@ -280,7 +263,7 @@ io([drop | Tail], Q, [_ | T], X) ->
io([drop_r | Tail], Q, [], X) ->
try queue:drop_r(Q) of
V ->
- test_server:fail({?MODULE,?LINE,V})
+ ct:fail({?MODULE,?LINE,V})
catch
error:empty ->
io(Tail, Q, [], X)
@@ -298,108 +281,102 @@ io([], Q, QQ, _X) ->
QQ.
-op_test(doc) ->
- "Test operations on whole queues";
-op_test(suite) ->
- [];
+%% Test operations on whole queues.
op_test(Config) when is_list(Config) ->
do_op_test(fun id/1),
ok.
do_op_test(F) ->
- ?line Len = 50,
- ?line Len2 = 2*Len,
- ?line L1 = lists:seq(1, Len),
- ?line L1r = lists:reverse(L1),
- ?line L2 = lists:seq(Len+1, Len2),
- ?line L2r = lists:reverse(L2),
- ?line L3 = L1++L2,
- ?line L3r = L2r++L1r,
- ?line Q0 = F(queue:new()),
- ?line [] = queue:to_list(Q0),
- ?line Q0 = F(queue:from_list([])),
- ?line Q1 = F(queue:from_list(L1)),
- ?line Q2 = F(queue:from_list(L2)),
- ?line Q3 = F(queue:from_list(L3)),
- ?line Len = queue:len(Q1),
- ?line Len = queue:len(Q2),
- ?line Len2 = queue:len(Q3),
- ?line L1 = queue:to_list(Q1),
- ?line L2 = queue:to_list(Q2),
- ?line L3 = queue:to_list(Q3),
- ?line Q3b = queue:join(Q0, queue:join(queue:join(Q1, Q2), Q0)),
- ?line L3 = queue:to_list(Q3b),
- ?line {Q0, Q3New1} = queue:split(0, Q3),
- ?line L3 = queue:to_list(Q3New1),
- ?line {Q3New2, Q0} = queue:split(Len2, Q3),
- ?line L3 = queue:to_list(Q3New2),
- ?line {Q1a, Q2a} = queue:split(Len, Q3),
- ?line L1 = queue:to_list(Q1a),
- ?line L2 = queue:to_list(Q2a),
- ?line {Q3c, Q3d} = queue:split(2, Q3),
- ?line L3 = queue:to_list(Q3c) ++ queue:to_list(Q3d),
- ?line {Q1b, Q2b} = queue:split(Len, Q3b),
- ?line L1 = queue:to_list(Q1b),
- ?line L2 = queue:to_list(Q2b),
- ?line Len = queue:len(Q1b),
- ?line Len = queue:len(Q2b),
- ?line Len2 = queue:len(Q3b),
- ?line Q1r = queue:reverse(Q1),
- ?line Q2r = queue:reverse(Q2),
- ?line Q1ar = queue:reverse(Q1a),
- ?line Q2ar = queue:reverse(Q2a),
- ?line Q1br = queue:reverse(Q1b),
- ?line Q2br = queue:reverse(Q2b),
- ?line Q3br = queue:reverse(Q3b),
- ?line L1r = queue:to_list(Q1r),
- ?line L1r = queue:to_list(Q1ar),
- ?line L1r = queue:to_list(Q1br),
- ?line L2r = queue:to_list(Q2r),
- ?line L2r = queue:to_list(Q2ar),
- ?line L2r = queue:to_list(Q2br),
- ?line L3r = queue:to_list(Q3br),
- ?line Len = queue:len(Q1br),
- ?line Len = queue:len(Q2br),
- ?line Len2 = queue:len(Q3br),
- ?line false = queue:member([], Q0),
- ?line false = queue:member(0, Q0),
- ?line false = queue:member(0, Q1),
- ?line false = queue:member([], Q1),
- ?line true = queue:member(1, Q1),
- ?line false = queue:member(1.0, Q1),
- ?line true = queue:member(Len, Q1),
+ Len = 50,
+ Len2 = 2*Len,
+ L1 = lists:seq(1, Len),
+ L1r = lists:reverse(L1),
+ L2 = lists:seq(Len+1, Len2),
+ L2r = lists:reverse(L2),
+ L3 = L1++L2,
+ L3r = L2r++L1r,
+ Q0 = F(queue:new()),
+ [] = queue:to_list(Q0),
+ Q0 = F(queue:from_list([])),
+ Q1 = F(queue:from_list(L1)),
+ Q2 = F(queue:from_list(L2)),
+ Q3 = F(queue:from_list(L3)),
+ Len = queue:len(Q1),
+ Len = queue:len(Q2),
+ Len2 = queue:len(Q3),
+ L1 = queue:to_list(Q1),
+ L2 = queue:to_list(Q2),
+ L3 = queue:to_list(Q3),
+ Q3b = queue:join(Q0, queue:join(queue:join(Q1, Q2), Q0)),
+ L3 = queue:to_list(Q3b),
+ {Q0, Q3New1} = queue:split(0, Q3),
+ L3 = queue:to_list(Q3New1),
+ {Q3New2, Q0} = queue:split(Len2, Q3),
+ L3 = queue:to_list(Q3New2),
+ {Q1a, Q2a} = queue:split(Len, Q3),
+ L1 = queue:to_list(Q1a),
+ L2 = queue:to_list(Q2a),
+ {Q3c, Q3d} = queue:split(2, Q3),
+ L3 = queue:to_list(Q3c) ++ queue:to_list(Q3d),
+ {Q1b, Q2b} = queue:split(Len, Q3b),
+ L1 = queue:to_list(Q1b),
+ L2 = queue:to_list(Q2b),
+ Len = queue:len(Q1b),
+ Len = queue:len(Q2b),
+ Len2 = queue:len(Q3b),
+ Q1r = queue:reverse(Q1),
+ Q2r = queue:reverse(Q2),
+ Q1ar = queue:reverse(Q1a),
+ Q2ar = queue:reverse(Q2a),
+ Q1br = queue:reverse(Q1b),
+ Q2br = queue:reverse(Q2b),
+ Q3br = queue:reverse(Q3b),
+ L1r = queue:to_list(Q1r),
+ L1r = queue:to_list(Q1ar),
+ L1r = queue:to_list(Q1br),
+ L2r = queue:to_list(Q2r),
+ L2r = queue:to_list(Q2ar),
+ L2r = queue:to_list(Q2br),
+ L3r = queue:to_list(Q3br),
+ Len = queue:len(Q1br),
+ Len = queue:len(Q2br),
+ Len2 = queue:len(Q3br),
+ false = queue:member([], Q0),
+ false = queue:member(0, Q0),
+ false = queue:member(0, Q1),
+ false = queue:member([], Q1),
+ true = queue:member(1, Q1),
+ false = queue:member(1.0, Q1),
+ true = queue:member(Len, Q1),
%%
%% Additional coverage.
- ?line {MyL1r,MyL2r} = lists:split(Len-2, L1r),
- ?line MyQ0r = queue:reverse(F(queue:from_list(L1))),
- ?line {MyQ1r,MyQ2r} = queue:split(Len-2, MyQ0r),
- ?line MyL1r = queue:to_list(MyQ1r),
- ?line MyL2r = queue:to_list(MyQ2r),
- ?line MyQ3r = queue:filter(
- fun (X) when X rem 4 >= 2 -> false;
- (X) when X rem 8 == 0 -> [float(X),{X}];
- (X) when X rem 2 >= 1 -> [{X}];
- (_) -> true
- end, MyQ1r),
- ?line MyL3r = lists:flatten(
- [if X rem 8 == 0 -> [float(X),{X}];
- X rem 2 >= 1 -> {X};
- true -> X
- end || X <- MyL1r,
- X rem 4 < 2]),
- ?line MyL3r = queue:to_list(MyQ3r),
- ?line MyQ4 = F(queue:from_list([11,22,33,44])),
- ?line [11,22] = queue:to_list(queue:filter(fun(X) when X < 27 -> true;
- (_) -> [] end, MyQ4)),
- ?line [33,44] = queue:to_list(queue:filter(fun(X) when X < 27 -> false;
- (X) -> [X] end, MyQ4)),
+ {MyL1r,MyL2r} = lists:split(Len-2, L1r),
+ MyQ0r = queue:reverse(F(queue:from_list(L1))),
+ {MyQ1r,MyQ2r} = queue:split(Len-2, MyQ0r),
+ MyL1r = queue:to_list(MyQ1r),
+ MyL2r = queue:to_list(MyQ2r),
+ MyQ3r = queue:filter(
+ fun (X) when X rem 4 >= 2 -> false;
+ (X) when X rem 8 == 0 -> [float(X),{X}];
+ (X) when X rem 2 >= 1 -> [{X}];
+ (_) -> true
+ end, MyQ1r),
+ MyL3r = lists:flatten(
+ [if X rem 8 == 0 -> [float(X),{X}];
+ X rem 2 >= 1 -> {X};
+ true -> X
+ end || X <- MyL1r,
+ X rem 4 < 2]),
+ MyL3r = queue:to_list(MyQ3r),
+ MyQ4 = F(queue:from_list([11,22,33,44])),
+ [11,22] = queue:to_list(queue:filter(fun(X) when X < 27 -> true;
+ (_) -> [] end, MyQ4)),
+ [33,44] = queue:to_list(queue:filter(fun(X) when X < 27 -> false;
+ (X) -> [X] end, MyQ4)),
%%
ok.
-error(doc) ->
- "Test queue errors";
-error(suite) ->
- [];
+%% Test queue errors.
error(Config) when is_list(Config) ->
do_error(fun id/1, illegal_queue),
do_error(fun id/1, {[],illegal_queue}),
@@ -417,65 +394,62 @@ trycatch(M, F, Args) ->
end.
do_error(F, IQ) ->
- ?line io:format("Illegal Queue: ~p~n", [IQ]),
+ io:format("Illegal Queue: ~p~n", [IQ]),
%%
- ?line {error,badarg} = trycatch(in, [1, IQ]),
- ?line {error,badarg} = trycatch(out, [IQ]),
- ?line {error,badarg} = trycatch(in_r ,[1, IQ]),
- ?line {error,badarg} = trycatch(out_r ,[IQ]),
- ?line {error,badarg} = trycatch(to_list ,[IQ]),
+ {error,badarg} = trycatch(in, [1, IQ]),
+ {error,badarg} = trycatch(out, [IQ]),
+ {error,badarg} = trycatch(in_r ,[1, IQ]),
+ {error,badarg} = trycatch(out_r ,[IQ]),
+ {error,badarg} = trycatch(to_list ,[IQ]),
%%
- ?line {error,badarg} = trycatch(from_list, [no_list]),
- ?line {error,badarg} = trycatch(is_empty, [IQ]),
- ?line {error,badarg} = trycatch(len, [IQ]),
+ {error,badarg} = trycatch(from_list, [no_list]),
+ {error,badarg} = trycatch(is_empty, [IQ]),
+ {error,badarg} = trycatch(len, [IQ]),
%%
- ?line {error,badarg} = trycatch(cons, [1, IQ]),
- ?line {error,badarg} = trycatch(head, [IQ]),
- ?line {error,badarg} = trycatch(tail, [IQ]),
+ {error,badarg} = trycatch(cons, [1, IQ]),
+ {error,badarg} = trycatch(head, [IQ]),
+ {error,badarg} = trycatch(tail, [IQ]),
%%
- ?line {error,badarg} = trycatch(snoc, [IQ, 1]),
- ?line {error,badarg} = trycatch(last, [IQ]),
- ?line {error,badarg} = trycatch(daeh, [IQ]),
- ?line {error,badarg} = trycatch(liat, [IQ]),
- ?line {error,badarg} = trycatch(lait, [IQ]),
- ?line {error,badarg} = trycatch(init, [IQ]),
+ {error,badarg} = trycatch(snoc, [IQ, 1]),
+ {error,badarg} = trycatch(last, [IQ]),
+ {error,badarg} = trycatch(daeh, [IQ]),
+ {error,badarg} = trycatch(liat, [IQ]),
+ {error,badarg} = trycatch(lait, [IQ]),
+ {error,badarg} = trycatch(init, [IQ]),
%%
- ?line {error,badarg} = trycatch(reverse, [IQ]),
- ?line {error,badarg} = trycatch(join, [F(queue:new()), IQ]),
- ?line {error,badarg} = trycatch(join, [IQ, F(queue:new())]),
- ?line {error,badarg} = trycatch(split, [17, IQ]),
- ?line {error,badarg} = trycatch(head, [IQ]),
+ {error,badarg} = trycatch(reverse, [IQ]),
+ {error,badarg} = trycatch(join, [F(queue:new()), IQ]),
+ {error,badarg} = trycatch(join, [IQ, F(queue:new())]),
+ {error,badarg} = trycatch(split, [17, IQ]),
+ {error,badarg} = trycatch(head, [IQ]),
%%
- ?line Q0 = F(queue:new()),
- ?line {error,badarg} = trycatch(split, [1, Q0]),
- ?line {error,badarg} = trycatch(split, [2, queue:snoc(Q0, 1)]),
+ Q0 = F(queue:new()),
+ {error,badarg} = trycatch(split, [1, Q0]),
+ {error,badarg} = trycatch(split, [2, queue:snoc(Q0, 1)]),
%%
- ?line {value,false} = trycatch(is_queue, [IQ]),
- ?line {error,badarg} = trycatch(get, [IQ]),
- ?line {error,badarg} = trycatch(peek, [IQ]),
- ?line {error,badarg} = trycatch(peek_r, [IQ]),
- ?line {error,badarg} = trycatch(filter, [fun id/1, IQ]),
- ?line {error,badarg} = trycatch(filter, [no_fun, Q0]),
+ {value,false} = trycatch(is_queue, [IQ]),
+ {error,badarg} = trycatch(get, [IQ]),
+ {error,badarg} = trycatch(peek, [IQ]),
+ {error,badarg} = trycatch(peek_r, [IQ]),
+ {error,badarg} = trycatch(filter, [fun id/1, IQ]),
+ {error,badarg} = trycatch(filter, [no_fun, Q0]),
%%
- ?line {error,badarg} = trycatch(member, [1, IQ]),
+ {error,badarg} = trycatch(member, [1, IQ]),
ok.
id(X) ->
X.
-oops(doc) ->
- "Test queue errors";
-oops(suite) ->
- [];
+%% Test queue errors.
oops(Config) when is_list(Config) ->
- ?line N = 3142,
- ?line Optab = optab(),
- ?line Seed0 = rand:seed(exsplus, {1,2,4}),
- ?line {Is,Seed} = random_list(N, tuple_size(Optab), Seed0, []),
- ?line io:format("~p ", [Is]),
- ?line QA = queue:new(),
- ?line QB = {[]},
- ?line emul([QA], [QB], Seed, [element(I, Optab) || I <- Is]).
+ N = 3142,
+ Optab = optab(),
+ Seed0 = rand:seed(exsplus, {1,2,4}),
+ {Is,Seed} = random_list(N, tuple_size(Optab), Seed0, []),
+ io:format("~p ", [Is]),
+ QA = queue:new(),
+ QB = {[]},
+ emul([QA], [QB], Seed, [element(I, Optab) || I <- Is]).
optab() ->
{{new,[], q, fun () -> {[]} end},
diff --git a/lib/stdlib/test/rand_SUITE.erl b/lib/stdlib/test/rand_SUITE.erl
index ab260da950..6830101e96 100644
--- a/lib/stdlib/test/rand_SUITE.erl
+++ b/lib/stdlib/test/rand_SUITE.erl
@@ -35,19 +35,17 @@
-include_lib("common_test/include/ct.hrl").
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(3)).
-define(LOOP, 1000000).
init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,3}}].
all() ->
[seed, interval_int, interval_float,
@@ -85,16 +83,13 @@ algs() ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-seed(doc) ->
- ["Test that seed and seed_s and export_seed/0 is working."];
-seed(suite) ->
- [];
+%% Test that seed and seed_s and export_seed/0 is working.
seed(Config) when is_list(Config) ->
Algs = algs(),
Test = fun(Alg) ->
try seed_1(Alg)
catch _:Reason ->
- test_server:fail({Alg, Reason, erlang:get_stacktrace()})
+ ct:fail({Alg, Reason, erlang:get_stacktrace()})
end
end,
[Test(Alg) || Alg <- Algs],
@@ -139,10 +134,7 @@ seed_1(Alg) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-api_eq(doc) ->
- ["Check that both api's are consistent with each other."];
-api_eq(suite) ->
- [];
+%% Check that both APIs are consistent with each other.
api_eq(_Config) ->
Algs = algs(),
Small = fun(Alg) ->
@@ -188,10 +180,7 @@ api_eq_1(S00) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-interval_int(doc) ->
- ["Check that uniform/1 returns values within the proper interval."];
-interval_int(suite) ->
- [];
+%% Check that uniform/1 returns values within the proper interval.
interval_int(Config) when is_list(Config) ->
Algs = algs(),
Small = fun(Alg) ->
@@ -225,10 +214,7 @@ interval_int_1(N, Top, Max) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-interval_float(doc) ->
- ["Check that uniform/0 returns values within the proper interval."];
-interval_float(suite) ->
- [];
+%% Check that uniform/0 returns values within the proper interval.
interval_float(Config) when is_list(Config) ->
Algs = algs(),
Test = fun(Alg) ->
@@ -252,8 +238,7 @@ interval_float_1(N) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-reference(doc) -> ["Check if exs64 algorithm generates the proper sequence."];
-reference(suite) -> [];
+%% Check if exs64 algorithm generates the proper sequence.
reference(Config) when is_list(Config) ->
[reference_1(Alg) || Alg <- algs()],
ok.
@@ -267,7 +252,6 @@ reference_1(Alg) ->
io:format("Failed: ~p~n",[Alg]),
io:format("Length ~p ~p~n",[length(Refval), length(Testval)]),
io:format("Head ~p ~p~n",[hd(Refval), hd(Testval)]),
- %% test_server:fail({Alg, Refval -- Testval}),
ok
end.
@@ -330,9 +314,9 @@ basic_uniform_1(0, {#{type:=Alg}, _}, Sum, A) ->
%% Verify that the basic statistics are ok
%% be gentle we don't want to see to many failing tests
- abs(0.5 - AverN) < 0.005 orelse test_server:fail({average, Alg, AverN}),
- abs(?LOOP div 100 - Min) < 1000 orelse test_server:fail({min, Alg, Min}),
- abs(?LOOP div 100 - Max) < 1000 orelse test_server:fail({max, Alg, Max}),
+ abs(0.5 - AverN) < 0.005 orelse ct:fail({average, Alg, AverN}),
+ abs(?LOOP div 100 - Min) < 1000 orelse ct:fail({min, Alg, Min}),
+ abs(?LOOP div 100 - Max) < 1000 orelse ct:fail({max, Alg, Max}),
ok.
basic_uniform_2(N, S0, Sum, A0) when N > 0 ->
@@ -349,9 +333,9 @@ basic_uniform_2(0, {#{type:=Alg}, _}, Sum, A) ->
%% Verify that the basic statistics are ok
%% be gentle we don't want to see to many failing tests
- abs(50.5 - AverN) < 0.5 orelse test_server:fail({average, Alg, AverN}),
- abs(?LOOP div 100 - Min) < 1000 orelse test_server:fail({min, Alg, Min}),
- abs(?LOOP div 100 - Max) < 1000 orelse test_server:fail({max, Alg, Max}),
+ abs(50.5 - AverN) < 0.5 orelse ct:fail({average, Alg, AverN}),
+ abs(?LOOP div 100 - Min) < 1000 orelse ct:fail({min, Alg, Min}),
+ abs(?LOOP div 100 - Max) < 1000 orelse ct:fail({max, Alg, Max}),
ok.
basic_normal_1(N, S0, Sum, Sq) when N > 0 ->
@@ -363,14 +347,13 @@ basic_normal_1(0, {#{type:=Alg}, _}, Sum, SumSq) ->
io:format("~.10w: Average: ~7.4f StdDev ~6.4f~n", [Alg, Mean, StdDev]),
%% Verify that the basic statistics are ok
%% be gentle we don't want to see to many failing tests
- abs(Mean) < 0.005 orelse test_server:fail({average, Alg, Mean}),
- abs(StdDev - 1.0) < 0.005 orelse test_server:fail({stddev, Alg, StdDev}),
+ abs(Mean) < 0.005 orelse ct:fail({average, Alg, Mean}),
+ abs(StdDev - 1.0) < 0.005 orelse ct:fail({stddev, Alg, StdDev}),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-plugin(doc) -> ["Test that the user can write algorithms"];
-plugin(suite) -> [];
+%% Test that the user can write algorithms.
plugin(Config) when is_list(Config) ->
_ = lists:foldl(fun(_, S0) ->
{V1, S1} = rand:uniform_s(10000, S0),
diff --git a/lib/stdlib/test/random_SUITE.erl b/lib/stdlib/test/random_SUITE.erl
index 701a3e3f33..34b350e132 100644
--- a/lib/stdlib/test/random_SUITE.erl
+++ b/lib/stdlib/test/random_SUITE.erl
@@ -19,26 +19,23 @@
-module(random_SUITE).
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
+ init_per_testcase/2, end_per_testcase/2,
init_per_group/2,end_per_group/2]).
-export([interval_1/1, seed0/1, seed/1]).
--export([init_per_testcase/2, end_per_testcase/2]).
-include_lib("common_test/include/ct.hrl").
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[interval_1, seed0, seed].
@@ -59,59 +56,50 @@ end_per_group(_GroupName, Config) ->
Config.
-seed0(doc) ->
- ["Test that seed is set implicitly, and always the same."];
-seed0(suite) ->
- [];
+%% Test that seed is set implicitly, and always the same.
seed0(Config) when is_list(Config) ->
- ?line Self = self(),
- ?line _ = spawn(fun() -> Self ! random:uniform() end),
- ?line F1 = receive
- Fa -> Fa
- end,
- ?line _ = spawn(fun() -> random:seed(),
- Self ! random:uniform() end),
- ?line F2 = receive
- Fb -> Fb
- end,
- ?line F1 = F2,
+ Self = self(),
+ _ = spawn(fun() -> Self ! random:uniform() end),
+ F1 = receive
+ Fa -> Fa
+ end,
+ _ = spawn(fun() -> random:seed(),
+ Self ! random:uniform() end),
+ F2 = receive
+ Fb -> Fb
+ end,
+ F1 = F2,
ok.
-seed(doc) ->
- ["Test that seed/1 and seed/3 is equivalent."];
-seed(suite) ->
- [];
+%% Test that seed/1 and seed/3 are equivalent.
seed(Config) when is_list(Config) ->
- ?line Self = self(),
+ Self = self(),
Seed = {S1, S2, S3} = erlang:timestamp(),
- ?line _ = spawn(fun() ->
- random:seed(S1,S2,S3),
- Rands = lists:foldl(fun
- (_, Out) -> [random:uniform(10000)|Out]
- end, [], lists:seq(1,100)),
- Self ! {seed_test, Rands}
- end),
- ?line Rands1 = receive {seed_test, R1s} -> R1s end,
- ?line _ = spawn(fun() ->
- random:seed(Seed),
- Rands = lists:foldl(fun
- (_, Out) -> [random:uniform(10000)|Out]
- end, [], lists:seq(1,100)),
- Self ! {seed_test, Rands}
- end),
- ?line Rands2 = receive {seed_test, R2s} -> R2s end,
- ?line Rands1 = Rands2,
+ _ = spawn(fun() ->
+ random:seed(S1,S2,S3),
+ Rands = lists:foldl(fun
+ (_, Out) -> [random:uniform(10000)|Out]
+ end, [], lists:seq(1,100)),
+ Self ! {seed_test, Rands}
+ end),
+ Rands1 = receive {seed_test, R1s} -> R1s end,
+ _ = spawn(fun() ->
+ random:seed(Seed),
+ Rands = lists:foldl(fun
+ (_, Out) -> [random:uniform(10000)|Out]
+ end, [], lists:seq(1,100)),
+ Self ! {seed_test, Rands}
+ end),
+ Rands2 = receive {seed_test, R2s} -> R2s end,
+ Rands1 = Rands2,
ok.
-interval_1(doc) ->
- ["Check that uniform/1 returns values within the proper interval."];
-interval_1(suite) ->
- [];
+%% Check that uniform/1 returns values within the proper interval.
interval_1(Config) when is_list(Config) ->
- ?line Top = 7,
- ?line N = 10,
- ?line check_interval(N, Top),
+ Top = 7,
+ N = 10,
+ check_interval(N, Top),
ok.
check_interval(0, _) -> ok;
@@ -119,9 +107,9 @@ check_interval(N, Top) ->
X = random:uniform(Top),
if
X < 1 ->
- test_server:fail(too_small);
+ ct:fail(too_small);
X > Top ->
- test_server:fail(too_large);
+ ct:fail(too_large);
true ->
ok
end,
diff --git a/lib/stdlib/test/re_SUITE.erl b/lib/stdlib/test/re_SUITE.erl
index bd495ce587..a937e7b1cf 100644
--- a/lib/stdlib/test/re_SUITE.erl
+++ b/lib/stdlib/test/re_SUITE.erl
@@ -33,7 +33,9 @@
-include_lib("common_test/include/ct.hrl").
-include_lib("kernel/include/file.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,3}}].
all() ->
[pcre, compile_options, run_options, combined_options,
@@ -61,264 +63,247 @@ end_per_group(_GroupName, Config) ->
Config.
-pcre(doc) ->
- ["Run all applicable tests from the PCRE testsuites."];
+%% Run all applicable tests from the PCRE testsuites.
pcre(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:minutes(3)),
- RootDir = ?config(data_dir, Config),
+ RootDir = proplists:get_value(data_dir, Config),
Res = run_pcre_tests:test(RootDir),
0 = lists:sum([ X || {X,_,_} <- Res ]),
- ?t:timetrap_cancel(Dog),
{comment,Res}.
-compile_options(doc) ->
- ["Test all documented compile options"];
+%% Test all documented compile options.
compile_options(Config) when is_list(Config) ->
- ?line ok = ctest("ABDabcdABCD","abcd",[],true,{match,[{3,4}]}),
- ?line ok = ctest("ABDabcdABCD","abcd",[anchored],true,nomatch),
- ?line ok = ctest("ABDabcdABCD",".*abcd",[anchored],true,{match,[{0,7}]}),
- ?line ok = ctest("ABCabcdABC","ABCD",[],true,nomatch),
- ?line ok = ctest("ABCabcdABC","ABCD",[caseless],true,{match,[{3,4}]}),
- ?line ok = ctest("abcdABC\n","ABC$",[],true,{match,[{4,3}]}),
- ?line ok = ctest("abcdABC\n","ABC$",[dollar_endonly],true,nomatch),
- ?line ok = ctest("abcdABC\n","ABC.",[],true,nomatch),
- ?line ok = ctest("abcdABC\n","ABC.",[dotall],true,{match,[{4,4}]}),
- ?line ok = ctest("abcdABCD","ABC .",[],true,nomatch),
- ?line ok = ctest("abcdABCD","ABC .",[extended],true,{match,[{4,4}]}),
- ?line ok = ctest("abcd\nABCD","ABC",[],true,{match,[{5,3}]}),
- ?line ok = ctest("abcd\nABCD","ABC",[firstline],true,nomatch),
- ?line ok = ctest("abcd\nABCD","^ABC",[],true,nomatch),
- ?line ok = ctest("abcd\nABCD","^ABC",[multiline],true,{match,[{5,3}]}),
- ?line ok = ctest("abcdABCD","(ABC)",[],true,{match,[{4,3},{4,3}]}),
- ?line ok = ctest("abcdABCD","(ABC)",[no_auto_capture],true,{match,[{4,3}]}),
- ?line ok = ctest(notused,"(?<FOO>ABC)|(?<FOO>DEF)",[],false,notused),
- ?line ok = ctest("abcdABCD","(?<FOO>ABC)|(?<FOO>DEF)",[dupnames],true,{match,[{4,3},{4,3}]}),
- ?line ok = ctest("abcdABCDabcABCD","abcd.*D",[],true,{match,[{0,15}]}),
- ?line ok = ctest("abcdABCDabcABCD","abcd.*D",[ungreedy],true,{match,[{0,8}]}),
- ?line ok = ctest("abcdABCabcABC\nD","abcd.*D",[],true,nomatch),
- ?line ok = ctest("abcdABCabcABC\nD","abcd.*D",[{newline,cr}],true,{match,[{0,15}]}),
- ?line ok = ctest("abcdABCabcABC\rD","abcd.*D",[],true,{match,[{0,15}]}),
- ?line ok = ctest("abcdABCabcABC\rD","abcd.*D",[{newline,lf}],true,{match,[{0,15}]}),
- ?line ok = ctest("abcdABCabcd\r\n","abcd$",[{newline,lf}],true,nomatch),
- ?line ok = ctest("abcdABCabcd\r\n","abcd$",[{newline,cr}],true,nomatch),
- ?line ok = ctest("abcdABCabcd\r\n","abcd$",[{newline,crlf}],true,{match,[{7,4}]}),
-
- ?line ok = ctest("abcdABCabcd\r","abcd$",[{newline,crlf}],true,nomatch),
- ?line ok = ctest("abcdABCabcd\n","abcd$",[{newline,crlf}],true,nomatch),
- ?line ok = ctest("abcdABCabcd\r\n","abcd$",[{newline,anycrlf}],true,{match,[{7,4}]}),
-
- ?line ok = ctest("abcdABCabcd\r","abcd$",[{newline,anycrlf}],true,{match,[{7,4}]}),
- ?line ok = ctest("abcdABCabcd\n","abcd$",[{newline,anycrlf}],true,{match,[{7,4}]}),
+ ok = ctest("ABDabcdABCD","abcd",[],true,{match,[{3,4}]}),
+ ok = ctest("ABDabcdABCD","abcd",[anchored],true,nomatch),
+ ok = ctest("ABDabcdABCD",".*abcd",[anchored],true,{match,[{0,7}]}),
+ ok = ctest("ABCabcdABC","ABCD",[],true,nomatch),
+ ok = ctest("ABCabcdABC","ABCD",[caseless],true,{match,[{3,4}]}),
+ ok = ctest("abcdABC\n","ABC$",[],true,{match,[{4,3}]}),
+ ok = ctest("abcdABC\n","ABC$",[dollar_endonly],true,nomatch),
+ ok = ctest("abcdABC\n","ABC.",[],true,nomatch),
+ ok = ctest("abcdABC\n","ABC.",[dotall],true,{match,[{4,4}]}),
+ ok = ctest("abcdABCD","ABC .",[],true,nomatch),
+ ok = ctest("abcdABCD","ABC .",[extended],true,{match,[{4,4}]}),
+ ok = ctest("abcd\nABCD","ABC",[],true,{match,[{5,3}]}),
+ ok = ctest("abcd\nABCD","ABC",[firstline],true,nomatch),
+ ok = ctest("abcd\nABCD","^ABC",[],true,nomatch),
+ ok = ctest("abcd\nABCD","^ABC",[multiline],true,{match,[{5,3}]}),
+ ok = ctest("abcdABCD","(ABC)",[],true,{match,[{4,3},{4,3}]}),
+ ok = ctest("abcdABCD","(ABC)",[no_auto_capture],true,{match,[{4,3}]}),
+ ok = ctest(notused,"(?<FOO>ABC)|(?<FOO>DEF)",[],false,notused),
+ ok = ctest("abcdABCD","(?<FOO>ABC)|(?<FOO>DEF)",[dupnames],true,{match,[{4,3},{4,3}]}),
+ ok = ctest("abcdABCDabcABCD","abcd.*D",[],true,{match,[{0,15}]}),
+ ok = ctest("abcdABCDabcABCD","abcd.*D",[ungreedy],true,{match,[{0,8}]}),
+ ok = ctest("abcdABCabcABC\nD","abcd.*D",[],true,nomatch),
+ ok = ctest("abcdABCabcABC\nD","abcd.*D",[{newline,cr}],true,{match,[{0,15}]}),
+ ok = ctest("abcdABCabcABC\rD","abcd.*D",[],true,{match,[{0,15}]}),
+ ok = ctest("abcdABCabcABC\rD","abcd.*D",[{newline,lf}],true,{match,[{0,15}]}),
+ ok = ctest("abcdABCabcd\r\n","abcd$",[{newline,lf}],true,nomatch),
+ ok = ctest("abcdABCabcd\r\n","abcd$",[{newline,cr}],true,nomatch),
+ ok = ctest("abcdABCabcd\r\n","abcd$",[{newline,crlf}],true,{match,[{7,4}]}),
+
+ ok = ctest("abcdABCabcd\r","abcd$",[{newline,crlf}],true,nomatch),
+ ok = ctest("abcdABCabcd\n","abcd$",[{newline,crlf}],true,nomatch),
+ ok = ctest("abcdABCabcd\r\n","abcd$",[{newline,anycrlf}],true,{match,[{7,4}]}),
+
+ ok = ctest("abcdABCabcd\r","abcd$",[{newline,anycrlf}],true,{match,[{7,4}]}),
+ ok = ctest("abcdABCabcd\n","abcd$",[{newline,anycrlf}],true,{match,[{7,4}]}),
ok.
-run_options(doc) ->
- ["Test all documented run specific options"];
+%% Test all documented run specific options.
run_options(Config) when is_list(Config) ->
- ?line rtest("ABCabcdABC","abc",[],[],true),
- ?line rtest("ABCabcdABC","abc",[anchored],[],false),
- % Anchored in run overrides unanchored in compilation
- ?line rtest("ABCabcdABC","abc",[],[anchored],false),
-
- ?line rtest("","a?b?",[],[],true),
- ?line rtest("","a?b?",[],[notempty],false),
-
- ?line rtest("abc","^a",[],[],true),
- ?line rtest("abc","^a",[],[notbol],false),
- ?line rtest("ab\nc","^a",[multiline],[],true),
- ?line rtest("ab\nc","^a",[multiline],[notbol],false),
- ?line rtest("ab\nc","^c",[multiline],[notbol],true),
-
- ?line rtest("abc","c$",[],[],true),
- ?line rtest("abc","c$",[],[noteol],false),
-
- ?line rtest("ab\nc","b$",[multiline],[],true),
- ?line rtest("ab\nc","c$",[multiline],[],true),
- ?line rtest("ab\nc","b$",[multiline],[noteol],true),
- ?line rtest("ab\nc","c$",[multiline],[noteol],false),
-
- ?line rtest("abc","ab",[],[{offset,0}],true),
- ?line rtest("abc","ab",[],[{offset,1}],false),
-
- ?line rtest("abcdABCabcABC\nD","abcd.*D",[],[],false),
- ?line rtest("abcdABCabcABC\nD","abcd.*D",[],[{newline,cr}],true),
- ?line rtest("abcdABCabcABC\rD","abcd.*D",[],[],true),
- ?line rtest("abcdABCabcABC\rD","abcd.*D",[{newline,cr}],[{newline,lf}],true),
- ?line rtest("abcdABCabcd\r\n","abcd$",[],[{newline,lf}],false),
- ?line rtest("abcdABCabcd\r\n","abcd$",[],[{newline,cr}],false),
- ?line rtest("abcdABCabcd\r\n","abcd$",[],[{newline,crlf}],true),
-
- ?line rtest("abcdABCabcd\r","abcd$",[],[{newline,crlf}],false),
- ?line rtest("abcdABCabcd\n","abcd$",[],[{newline,crlf}],false),
- ?line rtest("abcdABCabcd\r\n","abcd$",[],[{newline,anycrlf}],true),
-
- ?line rtest("abcdABCabcd\r","abcd$",[],[{newline,anycrlf}],true),
- ?line rtest("abcdABCabcd\n","abcd$",[],[{newline,anycrlf}],true),
-
- ?line {ok,MP} = re:compile(".*(abcd).*"),
- ?line {match,[{0,10},{3,4}]} = re:run("ABCabcdABC",MP,[]),
- ?line {match,[{0,10},{3,4}]} = re:run("ABCabcdABC",MP,[{capture,all}]),
- ?line {match,[{0,10},{3,4}]} = re:run("ABCabcdABC",MP,[{capture,all,index}]),
- ?line {match,["ABCabcdABC","abcd"]} = re:run("ABCabcdABC",MP,[{capture,all,list}]),
- ?line {match,[<<"ABCabcdABC">>,<<"abcd">>]} = re:run("ABCabcdABC",MP,[{capture,all,binary}]),
- ?line {match,[{0,10}]} = re:run("ABCabcdABC",MP,[{capture,first}]),
- ?line {match,[{0,10}]} = re:run("ABCabcdABC",MP,[{capture,first,index}]), ?line {match,["ABCabcdABC"]} = re:run("ABCabcdABC",MP,[{capture,first,list}]),
- ?line {match,[<<"ABCabcdABC">>]} = re:run("ABCabcdABC",MP,[{capture,first,binary}]),
-
- ?line {match,[{3,4}]} = re:run("ABCabcdABC",MP,[{capture,all_but_first}]),
- ?line {match,[{3,4}]} = re:run("ABCabcdABC",MP,[{capture,all_but_first,index}]),
- ?line {match,["abcd"]} = re:run("ABCabcdABC",MP,[{capture,all_but_first,list}]),
- ?line {match,[<<"abcd">>]} = re:run("ABCabcdABC",MP,[{capture,all_but_first,binary}]),
-
- ?line match = re:run("ABCabcdABC",MP,[{capture,none}]),
- ?line match = re:run("ABCabcdABC",MP,[{capture,none,index}]),
- ?line match = re:run("ABCabcdABC",MP,[{capture,none,list}]),
- ?line match = re:run("ABCabcdABC",MP,[{capture,none,binary}]),
-
- ?line {ok,MP2} = re:compile(".*(?<FOO>abcd).*"),
- ?line {match,[{3,4}]} = re:run("ABCabcdABC",MP2,[{capture,[1]}]),
- ?line {match,[{3,4}]} = re:run("ABCabcdABC",MP2,[{capture,['FOO']}]),
- ?line {match,[{3,4}]} = re:run("ABCabcdABC",MP2,[{capture,["FOO"]}]),
- ?line {match,["abcd"]} = re:run("ABCabcdABC",MP2,[{capture,["FOO"],list}]),
- ?line {match,[<<"abcd">>]} = re:run("ABCabcdABC",MP2,[{capture,["FOO"],binary}]),
-
- ?line {match,[{-1,0}]} = re:run("ABCabcdABC",MP2,[{capture,[200]}]),
- ?line {match,[{-1,0}]} = re:run("ABCabcdABC",MP2,[{capture,['BAR']}]),
- ?line {match,[""]} = re:run("ABCabcdABC",MP2,[{capture,[200],list}]),
- ?line {match,[""]} = re:run("ABCabcdABC",MP2,[{capture,['BAR'],list}]),
- ?line {match,[<<>>]} = re:run("ABCabcdABC",MP2,[{capture,[200],binary}]),
- ?line {match,[<<>>]} = re:run("ABCabcdABC",MP2,[{capture,['BAR'],binary}]),
-
- ?line {ok, MP3} = re:compile(".*((?<FOO>abdd)|a(..d)).*"),
- ?line {match,[{0,10},{3,4},{-1,0},{4,3}]} = re:run("ABCabcdABC",MP3,[]),
- ?line {match,[{0,10},{3,4},{-1,0},{4,3}]} = re:run("ABCabcdABC",MP3,[{capture,all,index}]),
- ?line {match,[<<"ABCabcdABC">>,<<"abcd">>,<<>>,<<"bcd">>]} = re:run("ABCabcdABC",MP3,[{capture,all,binary}]),
- ?line {match,["ABCabcdABC","abcd",[],"bcd"]} = re:run("ABCabcdABC",MP3,[{capture,all,list}]),
+ rtest("ABCabcdABC","abc",[],[],true),
+ rtest("ABCabcdABC","abc",[anchored],[],false),
+ %% Anchored in run overrides unanchored in compilation
+ rtest("ABCabcdABC","abc",[],[anchored],false),
+
+ rtest("","a?b?",[],[],true),
+ rtest("","a?b?",[],[notempty],false),
+
+ rtest("abc","^a",[],[],true),
+ rtest("abc","^a",[],[notbol],false),
+ rtest("ab\nc","^a",[multiline],[],true),
+ rtest("ab\nc","^a",[multiline],[notbol],false),
+ rtest("ab\nc","^c",[multiline],[notbol],true),
+
+ rtest("abc","c$",[],[],true),
+ rtest("abc","c$",[],[noteol],false),
+
+ rtest("ab\nc","b$",[multiline],[],true),
+ rtest("ab\nc","c$",[multiline],[],true),
+ rtest("ab\nc","b$",[multiline],[noteol],true),
+ rtest("ab\nc","c$",[multiline],[noteol],false),
+
+ rtest("abc","ab",[],[{offset,0}],true),
+ rtest("abc","ab",[],[{offset,1}],false),
+
+ rtest("abcdABCabcABC\nD","abcd.*D",[],[],false),
+ rtest("abcdABCabcABC\nD","abcd.*D",[],[{newline,cr}],true),
+ rtest("abcdABCabcABC\rD","abcd.*D",[],[],true),
+ rtest("abcdABCabcABC\rD","abcd.*D",[{newline,cr}],[{newline,lf}],true),
+ rtest("abcdABCabcd\r\n","abcd$",[],[{newline,lf}],false),
+ rtest("abcdABCabcd\r\n","abcd$",[],[{newline,cr}],false),
+ rtest("abcdABCabcd\r\n","abcd$",[],[{newline,crlf}],true),
+
+ rtest("abcdABCabcd\r","abcd$",[],[{newline,crlf}],false),
+ rtest("abcdABCabcd\n","abcd$",[],[{newline,crlf}],false),
+ rtest("abcdABCabcd\r\n","abcd$",[],[{newline,anycrlf}],true),
+
+ rtest("abcdABCabcd\r","abcd$",[],[{newline,anycrlf}],true),
+ rtest("abcdABCabcd\n","abcd$",[],[{newline,anycrlf}],true),
+
+ {ok,MP} = re:compile(".*(abcd).*"),
+ {match,[{0,10},{3,4}]} = re:run("ABCabcdABC",MP,[]),
+ {match,[{0,10},{3,4}]} = re:run("ABCabcdABC",MP,[{capture,all}]),
+ {match,[{0,10},{3,4}]} = re:run("ABCabcdABC",MP,[{capture,all,index}]),
+ {match,["ABCabcdABC","abcd"]} = re:run("ABCabcdABC",MP,[{capture,all,list}]),
+ {match,[<<"ABCabcdABC">>,<<"abcd">>]} = re:run("ABCabcdABC",MP,[{capture,all,binary}]),
+ {match,[{0,10}]} = re:run("ABCabcdABC",MP,[{capture,first}]),
+ {match,[{0,10}]} = re:run("ABCabcdABC",MP,[{capture,first,index}]), ?line {match,["ABCabcdABC"]} = re:run("ABCabcdABC",MP,[{capture,first,list}]),
+ {match,[<<"ABCabcdABC">>]} = re:run("ABCabcdABC",MP,[{capture,first,binary}]),
+
+ {match,[{3,4}]} = re:run("ABCabcdABC",MP,[{capture,all_but_first}]),
+ {match,[{3,4}]} = re:run("ABCabcdABC",MP,[{capture,all_but_first,index}]),
+ {match,["abcd"]} = re:run("ABCabcdABC",MP,[{capture,all_but_first,list}]),
+ {match,[<<"abcd">>]} = re:run("ABCabcdABC",MP,[{capture,all_but_first,binary}]),
+
+ match = re:run("ABCabcdABC",MP,[{capture,none}]),
+ match = re:run("ABCabcdABC",MP,[{capture,none,index}]),
+ match = re:run("ABCabcdABC",MP,[{capture,none,list}]),
+ match = re:run("ABCabcdABC",MP,[{capture,none,binary}]),
+
+ {ok,MP2} = re:compile(".*(?<FOO>abcd).*"),
+ {match,[{3,4}]} = re:run("ABCabcdABC",MP2,[{capture,[1]}]),
+ {match,[{3,4}]} = re:run("ABCabcdABC",MP2,[{capture,['FOO']}]),
+ {match,[{3,4}]} = re:run("ABCabcdABC",MP2,[{capture,["FOO"]}]),
+ {match,["abcd"]} = re:run("ABCabcdABC",MP2,[{capture,["FOO"],list}]),
+ {match,[<<"abcd">>]} = re:run("ABCabcdABC",MP2,[{capture,["FOO"],binary}]),
+
+ {match,[{-1,0}]} = re:run("ABCabcdABC",MP2,[{capture,[200]}]),
+ {match,[{-1,0}]} = re:run("ABCabcdABC",MP2,[{capture,['BAR']}]),
+ {match,[""]} = re:run("ABCabcdABC",MP2,[{capture,[200],list}]),
+ {match,[""]} = re:run("ABCabcdABC",MP2,[{capture,['BAR'],list}]),
+ {match,[<<>>]} = re:run("ABCabcdABC",MP2,[{capture,[200],binary}]),
+ {match,[<<>>]} = re:run("ABCabcdABC",MP2,[{capture,['BAR'],binary}]),
+
+ {ok, MP3} = re:compile(".*((?<FOO>abdd)|a(..d)).*"),
+ {match,[{0,10},{3,4},{-1,0},{4,3}]} = re:run("ABCabcdABC",MP3,[]),
+ {match,[{0,10},{3,4},{-1,0},{4,3}]} = re:run("ABCabcdABC",MP3,[{capture,all,index}]),
+ {match,[<<"ABCabcdABC">>,<<"abcd">>,<<>>,<<"bcd">>]} = re:run("ABCabcdABC",MP3,[{capture,all,binary}]),
+ {match,["ABCabcdABC","abcd",[],"bcd"]} = re:run("ABCabcdABC",MP3,[{capture,all,list}]),
ok.
-
-
-combined_options(doc) ->
- ["Test compile options given directly to run"];
+
+
+%% Test compile options given directly to run.
combined_options(Config) when is_list(Config) ->
- ?line ok = crtest("ABDabcdABCD","abcd",[],true,{match,[{3,4}]}),
- ?line ok = crtest("ABDabcdABCD","abcd",[anchored],true,nomatch),
- ?line ok = crtest("ABDabcdABCD",".*abcd",[anchored],true,{match,[{0,7}]}),
- ?line ok = crtest("ABCabcdABC","ABCD",[],true,nomatch),
- ?line ok = crtest("ABCabcdABC","ABCD",[caseless],true,{match,[{3,4}]}),
- ?line ok = crtest("abcdABC\n","ABC$",[],true,{match,[{4,3}]}),
- ?line ok = crtest("abcdABC\n","ABC$",[dollar_endonly],true,nomatch),
- ?line ok = crtest("abcdABC\n","ABC.",[],true,nomatch),
- ?line ok = crtest("abcdABC\n","ABC.",[dotall],true,{match,[{4,4}]}),
- ?line ok = crtest("abcdABCD","ABC .",[],true,nomatch),
- ?line ok = crtest("abcdABCD","ABC .",[extended],true,{match,[{4,4}]}),
- ?line ok = crtest("abcd\nABCD","ABC",[],true,{match,[{5,3}]}),
- ?line ok = crtest("abcd\nABCD","ABC",[firstline],true,nomatch),
- ?line ok = crtest("abcd\nABCD","^ABC",[],true,nomatch),
- ?line ok = crtest("abcd\nABCD","^ABC",[multiline],true,{match,[{5,3}]}),
- ?line ok = crtest("abcdABCD","(ABC)",[],true,{match,[{4,3},{4,3}]}),
- ?line ok = crtest("abcdABCD","(ABC)",[no_auto_capture],true,{match,[{4,3}]}),
- ?line ok = crtest(notused,"(?<FOO>ABC)|(?<FOO>DEF)",[],false,notused),
- ?line ok = crtest("abcdABCD","(?<FOO>ABC)|(?<FOO>DEF)",[dupnames],true,{match,[{4,3},{4,3}]}),
- ?line ok = crtest("abcdABCDabcABCD","abcd.*D",[],true,{match,[{0,15}]}),
- ?line ok = crtest("abcdABCDabcABCD","abcd.*D",[ungreedy],true,{match,[{0,8}]}),
- ?line ok = ctest("abcdABCabcABC\nD","abcd.*D",[],true,nomatch),
- ?line ok = crtest("abcdABCabcABC\nD","abcd.*D",[{newline,cr}],true,{match,[{0,15}]}),
- ?line ok = crtest("abcdABCabcABC\rD","abcd.*D",[],true,{match,[{0,15}]}),
- ?line ok = crtest("abcdABCabcABC\rD","abcd.*D",[{newline,lf}],true,{match,[{0,15}]}),
- ?line ok = crtest("abcdABCabcd\r\n","abcd$",[{newline,lf}],true,nomatch),
- ?line ok = crtest("abcdABCabcd\r\n","abcd$",[{newline,cr}],true,nomatch),
- ?line ok = crtest("abcdABCabcd\r\n","abcd$",[{newline,crlf}],true,{match,[{7,4}]}),
-
- ?line ok = crtest("abcdABCabcd\r","abcd$",[{newline,crlf}],true,nomatch),
- ?line ok = crtest("abcdABCabcd\n","abcd$",[{newline,crlf}],true,nomatch),
- ?line ok = crtest("abcdABCabcd\r\n","abcd$",[{newline,anycrlf}],true,{match,[{7,4}]}),
-
- ?line ok = crtest("abcdABCabcd\r","abcd$",[{newline,anycrlf}],true,{match,[{7,4}]}),
- ?line ok = crtest("abcdABCabcd\n","abcd$",[{newline,anycrlf}],true,{match,[{7,4}]}),
-
- ?line ok = crtest("abcdABCabcd\r\n","abcd$",[{newline,anycrlf},{capture,all,list}],true,{match,["abcd"]}),
-
- ?line ok = crtest("abcdABCabcd\r","abcd$",[{newline,anycrlf},{capture,all,list}],true,{match,["abcd"]}),
-
- ?line ok = crtest("abcdABCabcd\n","abcd$",[{newline,anycrlf},{capture,all,list}],true,{match,["abcd"]}),
-
- ?line ok = crtest("abcdABCabcd\r\n","abcd$",[{newline,anycrlf},{capture,all,binary}],true,{match,[<<"abcd">>]}),
-
- ?line ok = crtest("abcdABCabcd\r","abcd$",[{newline,anycrlf},{capture,all,binary}],true,{match,[<<"abcd">>]}),
- ?line ok = crtest("abcdABCabcd\n","abcd$",[{newline,anycrlf},{capture,all,binary}],true,{match,[<<"abcd">>]}),
-
- % Check that unique run-options fail in compile only case:
- ?line {'EXIT',{badarg,_}} = (catch re:compile("abcd$",[{newline,anycrlf},{capture,all,binary}])),
- ?line {'EXIT',{badarg,_}} = (catch re:compile("abcd$",[{newline,anycrlf},{offset,3}])),
- ?line {'EXIT',{badarg,_}} = (catch re:compile("abcd$",[{newline,anycrlf},notempty])),
- ?line {'EXIT',{badarg,_}} = (catch re:compile("abcd$",[{newline,anycrlf},notbol])),
- ?line {'EXIT',{badarg,_}} = (catch re:compile("abcd$",[{newline,anycrlf},noteol])),
-
-
- ?line {match,_} = re:run("abcdABCabcd\r\n","abcd$",[{newline,crlf}]),
- ?line nomatch = re:run("abcdABCabcd\r\nefgh","abcd$",[{newline,crlf}]),
- ?line {match,_} = re:run("abcdABCabcd\r\nefgh","abcd$",[{newline,crlf},multiline]),
- ?line nomatch = re:run("abcdABCabcd\r\nefgh","efgh$",[{newline,crlf},multiline,noteol]),
- ?line {match,_} = re:run("abcdABCabcd\r\nefgh","abcd$",[{newline,crlf},multiline,noteol]),
- ?line {match,_} = re:run("abcdABCabcd\r\nefgh","^abcd",[{newline,crlf},multiline,noteol]),
- ?line nomatch = re:run("abcdABCabcd\r\nefgh","^abcd",[{newline,crlf},multiline,notbol]),
- ?line {match,_} = re:run("abcdABCabcd\r\nefgh","^efgh",[{newline,crlf},multiline,notbol]),
- ?line {match,_} = re:run("ABC\nD","[a-z]*",[{newline,crlf}]),
- ?line nomatch = re:run("ABC\nD","[a-z]*",[{newline,crlf},notempty]),
+ ok = crtest("ABDabcdABCD","abcd",[],true,{match,[{3,4}]}),
+ ok = crtest("ABDabcdABCD","abcd",[anchored],true,nomatch),
+ ok = crtest("ABDabcdABCD",".*abcd",[anchored],true,{match,[{0,7}]}),
+ ok = crtest("ABCabcdABC","ABCD",[],true,nomatch),
+ ok = crtest("ABCabcdABC","ABCD",[caseless],true,{match,[{3,4}]}),
+ ok = crtest("abcdABC\n","ABC$",[],true,{match,[{4,3}]}),
+ ok = crtest("abcdABC\n","ABC$",[dollar_endonly],true,nomatch),
+ ok = crtest("abcdABC\n","ABC.",[],true,nomatch),
+ ok = crtest("abcdABC\n","ABC.",[dotall],true,{match,[{4,4}]}),
+ ok = crtest("abcdABCD","ABC .",[],true,nomatch),
+ ok = crtest("abcdABCD","ABC .",[extended],true,{match,[{4,4}]}),
+ ok = crtest("abcd\nABCD","ABC",[],true,{match,[{5,3}]}),
+ ok = crtest("abcd\nABCD","ABC",[firstline],true,nomatch),
+ ok = crtest("abcd\nABCD","^ABC",[],true,nomatch),
+ ok = crtest("abcd\nABCD","^ABC",[multiline],true,{match,[{5,3}]}),
+ ok = crtest("abcdABCD","(ABC)",[],true,{match,[{4,3},{4,3}]}),
+ ok = crtest("abcdABCD","(ABC)",[no_auto_capture],true,{match,[{4,3}]}),
+ ok = crtest(notused,"(?<FOO>ABC)|(?<FOO>DEF)",[],false,notused),
+ ok = crtest("abcdABCD","(?<FOO>ABC)|(?<FOO>DEF)",[dupnames],true,{match,[{4,3},{4,3}]}),
+ ok = crtest("abcdABCDabcABCD","abcd.*D",[],true,{match,[{0,15}]}),
+ ok = crtest("abcdABCDabcABCD","abcd.*D",[ungreedy],true,{match,[{0,8}]}),
+ ok = ctest("abcdABCabcABC\nD","abcd.*D",[],true,nomatch),
+ ok = crtest("abcdABCabcABC\nD","abcd.*D",[{newline,cr}],true,{match,[{0,15}]}),
+ ok = crtest("abcdABCabcABC\rD","abcd.*D",[],true,{match,[{0,15}]}),
+ ok = crtest("abcdABCabcABC\rD","abcd.*D",[{newline,lf}],true,{match,[{0,15}]}),
+ ok = crtest("abcdABCabcd\r\n","abcd$",[{newline,lf}],true,nomatch),
+ ok = crtest("abcdABCabcd\r\n","abcd$",[{newline,cr}],true,nomatch),
+ ok = crtest("abcdABCabcd\r\n","abcd$",[{newline,crlf}],true,{match,[{7,4}]}),
+
+ ok = crtest("abcdABCabcd\r","abcd$",[{newline,crlf}],true,nomatch),
+ ok = crtest("abcdABCabcd\n","abcd$",[{newline,crlf}],true,nomatch),
+ ok = crtest("abcdABCabcd\r\n","abcd$",[{newline,anycrlf}],true,{match,[{7,4}]}),
+
+ ok = crtest("abcdABCabcd\r","abcd$",[{newline,anycrlf}],true,{match,[{7,4}]}),
+ ok = crtest("abcdABCabcd\n","abcd$",[{newline,anycrlf}],true,{match,[{7,4}]}),
+
+ ok = crtest("abcdABCabcd\r\n","abcd$",[{newline,anycrlf},{capture,all,list}],true,{match,["abcd"]}),
+
+ ok = crtest("abcdABCabcd\r","abcd$",[{newline,anycrlf},{capture,all,list}],true,{match,["abcd"]}),
+
+ ok = crtest("abcdABCabcd\n","abcd$",[{newline,anycrlf},{capture,all,list}],true,{match,["abcd"]}),
+
+ ok = crtest("abcdABCabcd\r\n","abcd$",[{newline,anycrlf},{capture,all,binary}],true,{match,[<<"abcd">>]}),
+
+ ok = crtest("abcdABCabcd\r","abcd$",[{newline,anycrlf},{capture,all,binary}],true,{match,[<<"abcd">>]}),
+ ok = crtest("abcdABCabcd\n","abcd$",[{newline,anycrlf},{capture,all,binary}],true,{match,[<<"abcd">>]}),
+
+ %% Check that unique run-options fail in compile only case:
+ {'EXIT',{badarg,_}} = (catch re:compile("abcd$",[{newline,anycrlf},{capture,all,binary}])),
+ {'EXIT',{badarg,_}} = (catch re:compile("abcd$",[{newline,anycrlf},{offset,3}])),
+ {'EXIT',{badarg,_}} = (catch re:compile("abcd$",[{newline,anycrlf},notempty])),
+ {'EXIT',{badarg,_}} = (catch re:compile("abcd$",[{newline,anycrlf},notbol])),
+ {'EXIT',{badarg,_}} = (catch re:compile("abcd$",[{newline,anycrlf},noteol])),
+
+
+ {match,_} = re:run("abcdABCabcd\r\n","abcd$",[{newline,crlf}]),
+ nomatch = re:run("abcdABCabcd\r\nefgh","abcd$",[{newline,crlf}]),
+ {match,_} = re:run("abcdABCabcd\r\nefgh","abcd$",[{newline,crlf},multiline]),
+ nomatch = re:run("abcdABCabcd\r\nefgh","efgh$",[{newline,crlf},multiline,noteol]),
+ {match,_} = re:run("abcdABCabcd\r\nefgh","abcd$",[{newline,crlf},multiline,noteol]),
+ {match,_} = re:run("abcdABCabcd\r\nefgh","^abcd",[{newline,crlf},multiline,noteol]),
+ nomatch = re:run("abcdABCabcd\r\nefgh","^abcd",[{newline,crlf},multiline,notbol]),
+ {match,_} = re:run("abcdABCabcd\r\nefgh","^efgh",[{newline,crlf},multiline,notbol]),
+ {match,_} = re:run("ABC\nD","[a-z]*",[{newline,crlf}]),
+ nomatch = re:run("ABC\nD","[a-z]*",[{newline,crlf},notempty]),
ok.
-replace_autogen(doc) ->
- ["Test replace with autogenerated erlang module"];
+%% Test replace with autogenerated erlang module.
replace_autogen(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:minutes(3)),
re_testoutput1_replacement_test:run(),
- ?t:timetrap_cancel(Dog),
ok.
-global_capture(doc) ->
- ["Tests capture options together with global searching"];
+%% Test capture options together with global searching.
global_capture(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:minutes(3)),
- ?line {match,[{3,4}]} = re:run("ABCabcdABC",".*(?<FOO>abcd).*",[{capture,[1]}]),
- ?line {match,[{10,4}]} = re:run("ABCabcdABCabcdA",".*(?<FOO>abcd).*",[{capture,[1]}]),
- ?line {match,[[{10,4}]]} = re:run("ABCabcdABCabcdA",".*(?<FOO>abcd).*",[global,{capture,[1]}]),
- ?line {match,[{3,4}]} = re:run("ABCabcdABC",".*(?<FOO>abcd).*",[{capture,['FOO']}]),
- ?line {match,[{10,4}]} = re:run("ABCabcdABCabcdA",".*(?<FOO>abcd).*",[{capture,['FOO']}]),
- ?line {match,[[{10,4}]]} = re:run("ABCabcdABCabcdA",".*(?<FOO>abcd).*",[global,{capture,['FOO']}]),
- ?line {match,[[{3,4},{3,4}],[{10,4},{10,4}]]} = re:run("ABCabcdABCabcdA","(?<FOO>abcd)",[global]),
- ?line {match,[[{3,4},{3,4}],[{10,4},{10,4}]]} = re:run("ABCabcdABCabcdA","(?<FOO>abcd)",[global,{capture,all}]),
- ?line {match,[[{3,4},{3,4}],[{10,4},{10,4}]]} = re:run("ABCabcdABCabcdA","(?<FOO>abcd)",[global,{capture,all,index}]),
- ?line {match,[[{3,4}],[{10,4}]]} = re:run("ABCabcdABCabcdA","(?<FOO>abcd)",[global,{capture,first}]),
- ?line {match,[[{3,4}],[{10,4}]]} = re:run("ABCabcdABCabcdA","(?<FOO>abcd)",[global,{capture,all_but_first}]),
- ?line {match,[[<<"bcd">>],[<<"bcd">>]]} = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,all_but_first,binary}]),
- ?line {match,[["bcd"],["bcd"]]} = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,all_but_first,list}]),
- ?line {match,[["abcd","bcd"],["abcd","bcd"]]} = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,all,list}]),
- ?line {match,[[<<"abcd">>,<<"bcd">>],[<<"abcd">>,<<"bcd">>]]} = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,all,binary}]),
- ?line {match,[[{3,4},{4,3}],[{10,4},{11,3}]]} = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,all,index}]),
- ?line match = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,none,index}]),
- ?line match = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,none,binary}]),
- ?line match = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,none,list}]),
- ?line {match,[[<<195,133,98,99,100>>,<<"bcd">>],[<<"abcd">>,<<"bcd">>]]} = re:run("ABCÅbcdABCabcdA",".(?<FOO>bcd)",[global,{capture,all,binary},unicode]),
- ?line {match,[["Åbcd","bcd"],["abcd","bcd"]]} = re:run(<<"ABC",8#303,8#205,"bcdABCabcdA">>,".(?<FOO>bcd)",[global,{capture,all,list},unicode]),
- ?line {match,[["Åbcd","bcd"],["abcd","bcd"]]} = re:run("ABCÅbcdABCabcdA",".(?<FOO>bcd)",[global,{capture,all,list},unicode]),
- ?line {match,[[{3,5},{5,3}],[{11,4},{12,3}]]} = re:run("ABCÅbcdABCabcdA",".(?<FOO>bcd)",[global,{capture,all,index},unicode]),
- ?t:timetrap_cancel(Dog),
+ {match,[{3,4}]} = re:run("ABCabcdABC",".*(?<FOO>abcd).*",[{capture,[1]}]),
+ {match,[{10,4}]} = re:run("ABCabcdABCabcdA",".*(?<FOO>abcd).*",[{capture,[1]}]),
+ {match,[[{10,4}]]} = re:run("ABCabcdABCabcdA",".*(?<FOO>abcd).*",[global,{capture,[1]}]),
+ {match,[{3,4}]} = re:run("ABCabcdABC",".*(?<FOO>abcd).*",[{capture,['FOO']}]),
+ {match,[{10,4}]} = re:run("ABCabcdABCabcdA",".*(?<FOO>abcd).*",[{capture,['FOO']}]),
+ {match,[[{10,4}]]} = re:run("ABCabcdABCabcdA",".*(?<FOO>abcd).*",[global,{capture,['FOO']}]),
+ {match,[[{3,4},{3,4}],[{10,4},{10,4}]]} = re:run("ABCabcdABCabcdA","(?<FOO>abcd)",[global]),
+ {match,[[{3,4},{3,4}],[{10,4},{10,4}]]} = re:run("ABCabcdABCabcdA","(?<FOO>abcd)",[global,{capture,all}]),
+ {match,[[{3,4},{3,4}],[{10,4},{10,4}]]} = re:run("ABCabcdABCabcdA","(?<FOO>abcd)",[global,{capture,all,index}]),
+ {match,[[{3,4}],[{10,4}]]} = re:run("ABCabcdABCabcdA","(?<FOO>abcd)",[global,{capture,first}]),
+ {match,[[{3,4}],[{10,4}]]} = re:run("ABCabcdABCabcdA","(?<FOO>abcd)",[global,{capture,all_but_first}]),
+ {match,[[<<"bcd">>],[<<"bcd">>]]} = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,all_but_first,binary}]),
+ {match,[["bcd"],["bcd"]]} = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,all_but_first,list}]),
+ {match,[["abcd","bcd"],["abcd","bcd"]]} = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,all,list}]),
+ {match,[[<<"abcd">>,<<"bcd">>],[<<"abcd">>,<<"bcd">>]]} = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,all,binary}]),
+ {match,[[{3,4},{4,3}],[{10,4},{11,3}]]} = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,all,index}]),
+ match = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,none,index}]),
+ match = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,none,binary}]),
+ match = re:run("ABCabcdABCabcdA","a(?<FOO>bcd)",[global,{capture,none,list}]),
+ {match,[[<<195,133,98,99,100>>,<<"bcd">>],[<<"abcd">>,<<"bcd">>]]} = re:run("ABCÅbcdABCabcdA",".(?<FOO>bcd)",[global,{capture,all,binary},unicode]),
+ {match,[["Åbcd","bcd"],["abcd","bcd"]]} = re:run(<<"ABC",8#303,8#205,"bcdABCabcdA">>,".(?<FOO>bcd)",[global,{capture,all,list},unicode]),
+ {match,[["Åbcd","bcd"],["abcd","bcd"]]} = re:run("ABCÅbcdABCabcdA",".(?<FOO>bcd)",[global,{capture,all,list},unicode]),
+ {match,[[{3,5},{5,3}],[{11,4},{12,3}]]} = re:run("ABCÅbcdABCabcdA",".(?<FOO>bcd)",[global,{capture,all,index},unicode]),
ok.
-replace_input_types(doc) ->
- ["Tests replace with different input types"];
+%% Test replace with different input types.
replace_input_types(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:minutes(3)),
- ?line <<"abcd">> = re:replace("abcd","Z","X",[{return,binary},unicode]),
- ?line <<"abcd">> = re:replace("abcd","\x{400}","X",[{return,binary},unicode]),
- ?line <<"a",208,128,"cd">> = re:replace(<<"abcd">>,"b","\x{400}",[{return,binary},unicode]),
- ?t:timetrap_cancel(Dog),
+ <<"abcd">> = re:replace("abcd","Z","X",[{return,binary},unicode]),
+ <<"abcd">> = re:replace("abcd","\x{400}","X",[{return,binary},unicode]),
+ <<"a",208,128,"cd">> = re:replace(<<"abcd">>,"b","\x{400}",[{return,binary},unicode]),
ok.
-replace_return(doc) ->
- ["Tests return options of replace together with global searching"];
+%% Test return options of replace together with global searching.
replace_return(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:minutes(3)),
{'EXIT',{badarg,_}} = (catch re:replace("na","(a","")),
ok = replacetest(<<"nisse">>,"i","a",[{return,binary}],<<"nasse">>),
ok = replacetest("ABC\305abcdABCabcdA","a(?<FOO>bcd)","X",[global,{return,binary}],<<"ABCÅXABCXA">>),
@@ -339,7 +324,6 @@ replace_return(Config) when is_list(Config) ->
ok = replacetest("a\x{400}bcd","d","X",[global,{return,binary},unicode],<<"a",208,128,"bcX">>),
ok = replacetest("a\x{400}bcd","Z","X",[global,{return,list},unicode],"a\x{400}bcd"),
ok = replacetest("a\x{400}bcd","Z","X",[global,{return,binary},unicode],<<"a",208,128,"bcd">>),
- ?t:timetrap_cancel(Dog),
ok.
rtest(Subj, RE, Copt, Ropt, true) ->
@@ -412,18 +396,13 @@ copt(ungreedy) -> true;
copt(unicode) -> true;
copt(_) -> false.
-split_autogen(doc) ->
- ["Test split with autogenerated erlang module"];
+%% Test split with autogenerated erlang module.
split_autogen(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:minutes(3)),
re_testoutput1_split_test:run(),
- ?t:timetrap_cancel(Dog),
ok.
-split_options(doc) ->
- ["Test special options to split."];
+%% Test special options to split.
split_options(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:minutes(1)),
ok = splittest("a b c ","( )",[group,trim],[[<<"a">>,<<" ">>],[<<"b">>,<<" ">>],[<<"c">>,<<" ">>]]),
ok = splittest("a b c ","( )",[group,{parts,0}],[[<<"a">>,<<" ">>],[<<"b">>,<<" ">>],[<<"c">>,<<" ">>]]),
ok = splittest("a b c ","( )",[{parts,infinity},group],[[<<"a">>,<<" ">>],[<<"b">>,<<" ">>],[<<"c">>,<<" ">>],[<<>>]]),
@@ -439,27 +418,23 @@ split_options(Config) when is_list(Config) ->
{'EXIT',{badarg,_}} = (catch re:split("a b c d","( +)",[{parts,banan}])),
{'EXIT',{badarg,_}} = (catch re:split("a b c d","( +)",[{capture,all}])),
{'EXIT',{badarg,_}} = (catch re:split("a b c d","( +)",[{capture,[],binary}])),
- % Parts 0 is equal to no parts specification (implicit strip)
+ %% Parts 0 is equal to no parts specification (implicit strip)
ok = splittest("a b c d","( *)",[{parts,0},{return,list}],["a"," ","b"," ","c"," ","d"]),
- ?t:timetrap_cancel(Dog),
ok.
-
+
join([]) -> [];
join([A]) -> [A];
join([H|T]) -> [H,<<":">>|join(T)].
-split_specials(doc) ->
- ["Some special cases of split that are easy to get wrong."];
+%% Some special cases of split that are easy to get wrong.
split_specials(Config) when is_list(Config) ->
%% More or less just to remember these icky cases
- Dog = ?t:timetrap(?t:minutes(1)),
- ?line <<"::abd:f">> =
+ <<"::abd:f">> =
iolist_to_binary(join(re:split("abdf","^(?!(ab)de|x)(abd)(f)",[trim]))),
- ?line <<":abc2xyzabc3">> =
+ <<":abc2xyzabc3">> =
iolist_to_binary(join(re:split("abc1abc2xyzabc3","\\Aabc.",[trim]))),
- ?t:timetrap_cancel(Dog),
ok.
-
+
%% Test that errors are handled correctly by the erlang code.
error_handling(_Config) ->
@@ -470,26 +445,26 @@ error_handling(_Config) ->
false ->
error_handling()
end.
-
+
error_handling() ->
- % This test checks the exception tuples manufactured in the erlang
- % code to hide the trapping from the user at least when it comes to errors
- Dog = ?t:timetrap(?t:minutes(1)),
- % The malformed precomiled RE is detected after
- % the trap to re:grun from grun, in the grun function clause
- % that handles precompiled expressions
+ %% This test checks the exception tuples manufactured in the erlang
+ %% code to hide the trapping from the user at least when it comes to errors
+
+ %% The malformed precomiled RE is detected after
+ %% the trap to re:grun from grun, in the grun function clause
+ %% that handles precompiled expressions
{'EXIT',{badarg,[{re,run,["apa",{1,2,3,4},[global]],_},
{?MODULE,error_handling,0,_} | _]}} =
(catch re:run("apa",{1,2,3,4},[global])),
- % An invalid capture list will also cause a badarg late,
- % but with a non pre compiled RE, the exception should be thrown by the
- % grun function clause that handles RE's compiled implicitly by
- % the run/3 BIF before trapping.
+ %% An invalid capture list will also cause a badarg late,
+ %% but with a non pre compiled RE, the exception should be thrown by the
+ %% grun function clause that handles RE's compiled implicitly by
+ %% the run/3 BIF before trapping.
{'EXIT',{badarg,[{re,run,["apa","p",[{capture,[1,{a}]},global]],_},
{?MODULE,error_handling,0,_} | _]}} =
(catch re:run("apa","p",[{capture,[1,{a}]},global])),
- % And so the case of a precompiled expression together with
- % a compile-option (binary and list subject):
+ %% And so the case of a precompiled expression together with
+ %% a compile-option (binary and list subject):
{ok,RE} = re:compile("(p)"),
{match,[[{1,1},{1,1}]]} = re:run(<<"apa">>,RE,[global]),
{match,[[{1,1},{1,1}]]} = re:run("apa",RE,[global]),
@@ -509,7 +484,7 @@ error_handling() ->
{error, {compile, {_,_}}} = re:run("apa","(p",[report_errors]),
{'EXIT',{badarg,_}} = (catch re:run("apa","(p",[global])),
{error, {compile, {_,_}}} = re:run("apa","(p",[report_errors,global]),
- % Badly formed options
+ %% Badly formed options
{'EXIT',{badarg,_}} = (catch re:run(<<"apa">>,RE,["global"])),
{'EXIT',{badarg,_}} = (catch re:run(<<"apa">>,RE,[{offset,-1}])),
{'EXIT',{badarg,_}} = (catch re:run(<<"apa">>,RE,[{offset,ett}])),
@@ -536,7 +511,7 @@ error_handling() ->
{'EXIT',{badarg,_}} = (catch re:run(<<"apa",2:2>>,<<"(p)">>,[{capture,[0,1],binary}])),
<<_:4,Temp:3/binary,_:4>> = <<38,23,6,18>>,
{match,[{1,1},{1,1}]} = re:run(Temp,<<"(p)">>,[]), % Unaligned works
- % The replace errors:
+ %% The replace errors:
{'EXIT',{badarg,[{re,replace,["apa",{1,2,3,4},"X",[]],_},
{?MODULE,error_handling,0,_} | _]}} =
(catch re:replace("apa",{1,2,3,4},"X",[])),
@@ -572,13 +547,13 @@ error_handling() ->
(catch iolist_to_binary(re:replace("apa","p","X",
[{return,banana}]))),
{'EXIT',{badarg,_}} = (catch re:replace("apa","(p","X",[])),
- % Badarg, not compile error.
+ %% Badarg, not compile error.
{'EXIT',{badarg,[{re,replace,
["apa","(p","X",[{return,banana}]],_},
{?MODULE,error_handling,0,_} | _]}} =
(catch iolist_to_binary(re:replace("apa","(p","X",
[{return,banana}]))),
- % And the split errors:
+ %% And the split errors:
[<<"a">>,<<"a">>] = (catch re:split("apa","p",[])),
[<<"a">>,<<"p">>,<<"a">>] = (catch re:split("apa",RE,[])),
{'EXIT',{badarg,[{re,split,["apa","p",[report_errors]],_},
@@ -618,34 +593,31 @@ error_handling() ->
{?MODULE,error_handling,0,_} | _]}} =
(catch re:split("apa",RE,[banana])),
{'EXIT',{badarg,_}} = (catch re:split("apa","(p")),
- %Exception on bad argument, not compilation error
+ %%Exception on bad argument, not compilation error
{'EXIT',{badarg,[{re,split,
["apa",
"(p",
[banana]],_},
{?MODULE,error_handling,0,_} | _]}} =
(catch re:split("apa","(p",[banana])),
- ?t:timetrap_cancel(Dog),
ok.
-
-pcre_cve_2008_2371(doc) ->
- "Fix as in http://vcs.pcre.org/viewvc?revision=360&view=revision";
+
+%% Fix as in http://vcs.pcre.org/viewvc?revision=360&view=revision
pcre_cve_2008_2371(Config) when is_list(Config) ->
%% Make sure it doesn't crash the emulator.
re:compile(<<"(?i)[\xc3\xa9\xc3\xbd]|[\xc3\xa9\xc3\xbdA]">>, [unicode]),
ok.
-pcre_compile_workspace_overflow(doc) ->
- "Patch from http://vcs.pcre.org/viewvc/code/trunk/pcre_compile.c?r1=504&r2=505&view=patch";
+%% Patch from
+%% http://vcs.pcre.org/viewvc/code/trunk/pcre_compile.c?r1=504&r2=505&view=patch
pcre_compile_workspace_overflow(Config) when is_list(Config) ->
N = 819,
- ?line {error,{"internal error: overran compiling workspace",799}} =
+ {error,{"internal error: overran compiling workspace",799}} =
re:compile([lists:duplicate(N, $(), lists:duplicate(N, $))]),
ok.
-re_infinite_loop(doc) ->
- "Make sure matches that really loop infinitely actually fail";
+
+%% Make sure matches that really loop infinitely actually fail.
re_infinite_loop(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:minutes(1)),
Str =
"http:/www.flickr.com/slideShow/index.gne?group_id=&user_id=69845378@N0",
EMail_regex = "[a-z0-9!#$%&'*+/=?^_`{|}~-]+"
@@ -657,20 +629,17 @@ re_infinite_loop(Config) when is_list(Config) ->
nomatch = re:run(Str, EMail_regex, [global]),
{error,match_limit} = re:run(Str, EMail_regex,[report_errors]),
{error,match_limit} = re:run(Str, EMail_regex,[report_errors,global]),
- ?t:timetrap_cancel(Dog),
ok.
-re_backwards_accented(doc) ->
- "Check for nasty bug where accented graphemes can make PCRE back past "
- "beginning of subject";
+
+%% Check for nasty bug where accented graphemes can make PCRE back
+%% past beginning of subject.
re_backwards_accented(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:minutes(1)),
- ?line match = re:run(<<65,204,128,65,204,128,97,98,99>>,
- <<"\\X?abc">>,
- [unicode,{capture,none}]),
- ?t:timetrap_cancel(Dog),
+ match = re:run(<<65,204,128,65,204,128,97,98,99>>,
+ <<"\\X?abc">>,
+ [unicode,{capture,none}]),
ok.
-opt_dupnames(doc) ->
- "Check correct handling of dupnames option to re";
+
+%% Check correct handling of dupnames option to re.
opt_dupnames(Config) when is_list(Config) ->
Days = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],
_ = [ begin
@@ -704,9 +673,9 @@ opt_dupnames(Config) when is_list(Config) ->
"(?<DN>Sat)(?:urday)?",
[dupnames, {capture, ['Skrap','DN','Skrap2'],index}]),
{match,[{-1,0},{0,3},{-1,0}]} = re:run("Wednesday","(?<Skrap>.)(?<DN>Mon|Fri|Sun)(?:day)?(?<Skrap2>.)|"
- "(?<DN>Tue)(?:sday)?|(?<DN>Wed)nesday|(?<DN>Thu)(?:rsday)?|"
- "(?<DN>Sat)(?:urday)?",
- [dupnames, {capture, ['Skrap','DN','Skrap2'],index}]),
+ "(?<DN>Tue)(?:sday)?|(?<DN>Wed)nesday|(?<DN>Thu)(?:rsday)?|"
+ "(?<DN>Sat)(?:urday)?",
+ [dupnames, {capture, ['Skrap','DN','Skrap2'],index}]),
nomatch = re:run("Wednsday","(?<Skrap>.)(?<DN>Mon|Fri|Sun)(?:day)?(?<Skrap2>.)|"
"(?<DN>Tue)(?:sday)?|(?<DN>Wed)nesday|(?<DN>Thu)(?:rsday)?|"
"(?<DN>Sat)(?:urday)?",
@@ -758,8 +727,7 @@ opt_dupnames(Config) when is_list(Config) ->
"h","a","n","T","e","then"],binary}]),
ok.
-opt_all_names(doc) ->
- "Test capturing of all_names";
+%% Test capturing of all_names.
opt_all_names(Config) when is_list(Config) ->
Days = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],
{match,[{1,3},{0,1},{7,1}]} = re:run("SMondayX","(?<Skrap>.)(?<DN>Mon|Fri|Sun)(?:day)?(?<Skrap2>.)|"
@@ -767,10 +735,10 @@ opt_all_names(Config) when is_list(Config) ->
"(?<DN>Sat)(?:urday)?",
[dupnames, {capture, all_names,index}]),
{match,[{0,3},{-1,0},{-1,0}]} = re:run("Wednesday","(?<Skrap>.)(?<DN>Mon|Fri|Sun)(?:day)?(?<Skrap2>.)|"
- "(?<DN>Tue)(?:sday)?|(?<DN>Wed)nesday|(?<DN>Thu)(?:rsday)?|"
- "(?<DN>Sat)(?:urday)?",
- [dupnames, {capture, all_names,index}]),
-
+ "(?<DN>Tue)(?:sday)?|(?<DN>Wed)nesday|(?<DN>Thu)(?:rsday)?|"
+ "(?<DN>Sat)(?:urday)?",
+ [dupnames, {capture, all_names,index}]),
+
_ = [ begin
{match,[{0,3}]} =
re:run(Day,
@@ -809,7 +777,7 @@ opt_all_names(Config) when is_list(Config) ->
{match,[[<<>>,<<>>,<<"C">>],
[<<>>,<<>>,<<"C">>],
[<<>>,<<>>,<<"C">>]]} = re:run("CCC","(?<A>A)|(?<B>B)|(?<C>C)",
- [global,{capture, all_names, binary}]),
+ [global,{capture, all_names, binary}]),
{match,[[<<"C">>,<<>>],
[<<>>,<<"B">>],
[<<"C">>,<<>>]]} = re:run("CBC","(?<A>A)|(?<B>B)|(?<A>C)",
@@ -831,8 +799,7 @@ opt_all_names(Config) when is_list(Config) ->
[dupnames,{capture,all_names,binary}]),
ok.
-inspect(doc) ->
- "Test the minimal inspect function";
+%% Test the minimal inspect function.
inspect(Config) when is_list(Config)->
{ok,MP} = re:compile("(?<A>A)|(?<B>B)|(?<C>C)."),
{namelist,[<<"A">>,<<"B">>,<<"C">>]} = re:inspect(MP,namelist),
@@ -845,15 +812,13 @@ inspect(Config) when is_list(Config)->
{'EXIT',{badarg,_}} = (catch re:inspect({re_pattern,3,0,0,<<"kalle",2:2>>},namelist)),
ok.
-opt_no_start_optimize(doc) ->
- "Test that the no_start_optimize compilation flag works";
+%% Test that the no_start_optimize compilation flag works.
opt_no_start_optimize(Config) when is_list(Config) ->
{match, [{3,3}]} = re:run("DEFABC","(*COMMIT)ABC",[]), % Start optimization makes this result wrong!
nomatch = re:run("DEFABC","(*COMMIT)ABC",[no_start_optimize]), % This is the correct result...
ok.
-opt_never_utf(doc) ->
- "Check that the never_utf option works";
+%% Check that the never_utf option works.
opt_never_utf(Config) when is_list(Config) ->
{match,[{0,3}]} = re:run("ABC","ABC",[never_utf]),
{match,[{0,3}]} = re:run("ABC","(*UTF)ABC",[]),
@@ -867,29 +832,29 @@ opt_never_utf(Config) when is_list(Config) ->
{error,_} = (catch re:compile("(*UTF)ABC",[never_utf])),
{error,_} = (catch re:compile("(*UTF8)ABC",[never_utf])),
ok.
-opt_ucp(doc) ->
- "Check that the ucp option is passed to PCRE";
+
+%% Check that the ucp option is passed to PCRE.
opt_ucp(Config) when is_list(Config) ->
{match,[{0,1}]} = re:run([$a],"\\w",[unicode]),
{match,[{0,2}]} = re:run([229],"\\w",[unicode]), % Latin1 works without UCP, as we have a default
- % Latin1 table
+ %% Latin1 table
nomatch = re:run([1024],"\\w",[unicode]), % Latin1 word characters only, 1024 is not latin1
{match,[{0,2}]} = re:run([1024],"\\w",[unicode,ucp]), % Any Unicode word character works with 'ucp'
ok.
-match_limit(doc) ->
- "Check that the match_limit and match_limit_recursion options work";
+
+%% Check that the match_limit and match_limit_recursion options work.
match_limit(Config) when is_list(Config) ->
nomatch = re:run("aaaaaaaaaaaaaz","(a+)*zz",[]),
nomatch = re:run("aaaaaaaaaaaaaz","(a+)*zz",[{match_limit,3000}]),
nomatch = re:run("aaaaaaaaaaaaaz","(a+)*zz",[{match_limit_recursion,10}]),
nomatch = re:run("aaaaaaaaaaaaaz","(a+)*zz",[report_errors]),
{error,match_limit} = re:run("aaaaaaaaaaaaaz","(a+)*zz",[{match_limit,3000},
- report_errors]),
+ report_errors]),
{error,match_limit_recursion} =
re:run("aaaaaaaaaaaaaz","(a+)*zz",[{match_limit_recursion,10},
report_errors]),
{error,match_limit} = re:run("aaaaaaaaaaaaaz","(a+)*zz",[{match_limit,3000},
- report_errors,global]),
+ report_errors,global]),
{error,match_limit_recursion} =
re:run("aaaaaaaaaaaaaz","(a+)*zz",[{match_limit_recursion,10},
report_errors,global]),
@@ -902,9 +867,9 @@ match_limit(Config) when is_list(Config) ->
"aaaaaaaaaaaaaz" = re:replace("aaaaaaaaaaaaaz","(a+)*zz","!",
[{match_limit,3000},{return,list}]),
{'EXIT', {badarg,_}} = (catch re:replace("aaaaaaaaaaaaaz","(a+)*zz","!",
- [{match_limit_recursion,-1},{return,list}])),
+ [{match_limit_recursion,-1},{return,list}])),
{'EXIT', {badarg,_}} = (catch re:replace("aaaaaaaaaaaaaz","(a+)*zz","!",
- [{match_limit,-1},{return,list}])),
+ [{match_limit,-1},{return,list}])),
{'EXIT', {badarg,_}} = (catch re:run("aaaaaaaaaaaaaz","(a+)*zz",
[{match_limit_recursion,-1},
report_errors,global])),
@@ -912,9 +877,8 @@ match_limit(Config) when is_list(Config) ->
[{match_limit,-1},
report_errors,global])),
ok.
-sub_binaries(doc) ->
- "test that we get sub-binaries if subject is a binary and we "
- "capture binaries";
+%% Test that we get sub-binaries if subject is a binary and we capture
+%% binaries.
sub_binaries(Config) when is_list(Config) ->
Bin = list_to_binary(lists:seq(1,255)),
{match,[B,C]}=re:run(Bin,"(a)",[{capture,all,binary}]),
diff --git a/lib/stdlib/test/run_pcre_tests.erl b/lib/stdlib/test/run_pcre_tests.erl
index b7d1df39b8..8b0373d062 100644
--- a/lib/stdlib/test/run_pcre_tests.erl
+++ b/lib/stdlib/test/run_pcre_tests.erl
@@ -69,8 +69,6 @@ pick_exec_options([]) ->
test([],_,_,_) ->
0;
test([{RE0,Line,Options0,Tests}|T],PreCompile,XMode,REAsList) ->
- %io:format("."),
- %case RE of <<>> -> io:format("Empty re:~w~n",[Line]); _ -> ok end,
Unicode = lists:member(unicode,Options0),
RE = case REAsList of
true ->
@@ -90,7 +88,6 @@ test([{RE0,Line,Options0,Tests}|T],PreCompile,XMode,REAsList) ->
end,
case Cres of
{ok,P} ->
- %erlang:display({testrun,RE,P,Tests,ExecOptions,Xopt,XMode}),
case (catch testrun(RE,P,Tests,ExecOptions,Xopt,XMode)) of
N when is_integer(N) ->
N + test(T,PreCompile,XMode,REAsList);
@@ -125,16 +122,10 @@ test([{RE0,Line,Options0,Tests}|T],PreCompile,XMode,REAsList) ->
loopexec(_,_,X,Y,_,_) when X > Y ->
{match,[]};
loopexec(P,Chal,X,Y,Unicode,Xopt) ->
- %io:format("~p~n",[X]),
case re:run(Chal,P,[{offset,X}]++Xopt) of
nomatch ->
- %io:format(" re:exec(~p,~p,[{offset,~p}]) -> ~p~n",
- % [P,Chal,X,no]),
{match,[]};
- %loopexec(P,Chal,X+1,Y);
{match,[{A,B}|More]} ->
- %io:format(" re:exec(~p,~p,[{offset,~p}]) -> ~p~n",
- % [P,Chal,X,{match,[{A,B}|More]}]),
{match,Rest} =
case B>0 of
true ->
@@ -169,7 +160,6 @@ forward(Chal,A,N,true) ->
_ ->
1
end,
- %io:format("Forward ~p~n",[Forw]),
forward(Chal,A+Forw,N-1,true).
contains_eightbit(<<>>) ->
@@ -334,8 +324,6 @@ testrun(RE,P,[{Chal,Line,ExecOpt,Responses}|T],EO,Xopt0,XMode) ->
nomatch ->
nomatch;
{match, Reslist} ->
- %io:format("re:run(~w,~w,~w) -> ~w~n",[Chal,P,ExecOpt++Xopt++
- % [{capture,all,list}],Reslist]),
UFix = lists:member(unicode,EO),
{match,bfix([if
UFix =:= true -> list_to_utf8(L);
@@ -425,7 +413,6 @@ pickline(Start,Stop,Bin) when Stop >= size(Bin) ->
{Res,Stop};
pickline(Start,Stop,Bin) ->
- %erlang:display({Start,Stop,size(Bin)}),
<<_:Stop/binary,Ch,_/binary>> = Bin,
case Ch of
$\n ->
@@ -465,15 +452,13 @@ stru([{_,<<>>}|T]) ->
stru(T);
stru([{Line,<<Ch,Re0/binary>>}|T0]) ->
{T,Re} = find_rest_re(Ch,[{Line,Re0}|T0]),
- %io:format("DBG: ~p~n",[Re]),
{NewRe,<< Ch, Options/binary >>} = end_of_re(Ch,Re),
case interpret_options_x(backstrip(frontstrip(Options)),NewRe) of
{Olist,<<>>} ->
U = lists:member(unicode,Olist),
case T of
[{_,<<$-,_/binary>>}|Con] ->
- %Debug output, we skip those
- %io:format("Skipping debug (~w)~n",[Line]),
+ %%Debug output, we skip those
TmpT = skip_debug(Con),
{NewT,Matches} = stru2(TmpT,U),
[{NewRe,Line,Olist,Matches}|stru(NewT)];
@@ -482,12 +467,10 @@ stru([{Line,<<Ch,Re0/binary>>}|T0]) ->
{NewT,Matches} = stru2(NewT0,U),
[{NewRe,Line,Olist,Matches}|stru(NewT)];
[{_,<<Bla,_/binary>>}|_] when Bla =/= $ ->
- %io:format("Skipping blabla (~w)~n",[Line]),
NewT = skip_until_empty(T),
stru(NewT);
_ ->
{NewT,Matches} = stru2(T,U),
- %erlang:display({NewRe,Line,Olist,Matches}),
Matches1 = case U of
true ->
Matches ++
@@ -496,7 +479,6 @@ stru([{Line,<<Ch,Re0/binary>>}|T0]) ->
false ->
Matches
end,
- %erlang:display({NewRe,Line,Olist,Matches1}),
[{NewRe,Line,Olist,Matches1}|stru(NewT)]
end;
{_,Rest} ->
@@ -605,7 +587,7 @@ backslash_end(<<_,R/binary>>) ->
backslash_end(R).
stru2([{Line,<<$ ,Rest/binary>>} | T],U) ->
- % A challenge
+ %% A challenge
case (catch responses(T,U)) of
{NewT,Rlist} ->
{NewNewT,StrList} = stru2(NewT,U),
@@ -765,17 +747,17 @@ pick_offset(Rest) ->
escape(<<>>,_) ->
{[],<<>>};
escape(<<$\\, Ch, Rest/binary>>,U) when Ch >= $A, Ch =< $Z; Ch =:= $? ->
- %Options in the string...
+ %%Options in the string...
NewOpts = eopt(Ch),
{MoreOpts,Tail} = escape(Rest,U),
{NewOpts ++ MoreOpts,Tail};
escape(<<$\\, $>, Rest/binary>>,U) ->
- %Offset Options in the string...
+ %%Offset Options in the string...
{NewOpt,NewRest} = pick_offset(Rest),
{MoreOpts,Tail} = escape(NewRest,U),
{[NewOpt|MoreOpts],Tail};
escape(<<$\\, $<, Rest/binary>>,U) ->
- %CR Options in the string...
+ %%CR Options in the string...
{NewOpt,NewRest} = pinch_cr(Rest),
{MoreOpts,Tail} = escape(NewRest,U),
{[NewOpt|MoreOpts],Tail};
@@ -789,7 +771,6 @@ escape(<<$\\, Ch, Rest/binary>>,U) ->
{<<$\\>>,<<Ch,Rest/binary>>}
end;
CCC ->
- %erlang:display({escape,CCC}),
{<<CCC>>,Rest}
end,
{MoreOpts,Tail} = escape(NR,U),
@@ -877,7 +858,6 @@ multi_esc(<<$x,${,N,O,$},Rest/binary>>,Unicode)
((N >= $a) and (N =< $f))) and
(((O >= $0) and (O =< $9)) or ((O >= $A) and (O =< $F)) or
((O >= $a) and (O =< $f)))) ->
- %io:format("~p(~p)~n",[<<$x,${,N,O,$}>>,get(unicode)]),
Cha = (trx(N) bsl 4) bor trx(O),
case Unicode of
false ->
@@ -974,8 +954,8 @@ single_esc($\\) ->
$\\;
single_esc($a) ->
7;
-%single_esc(Ch) when Ch >= $A, Ch =< $Z -> % eh?
-% Ch;
+%%single_esc(Ch) when Ch >= $A, Ch =< $Z -> % eh?
+%% Ch;
single_esc(_) ->
no.
@@ -1003,8 +983,6 @@ gen_split_test(OneFile) ->
io:format(F,"-module(~s).~n",[ErlModule]),
io:format(F,"-compile(export_all).~n",[]),
io:format(F,"-compile(no_native).~n",[]),
- %io:format(F,"-include(\"test_server.hrl\").~n",[]),
- %io:format(F,"-define(line,erlang:display(?LINE),).~n",[]),
io:format(F,"%% This file is generated by running ~w:gen_split_test(~p)~n",
[?MODULE,OneFile]),
io:format(F,"join([]) -> [];~n",[]),
@@ -1095,7 +1073,6 @@ gen_repl_test(OneFile) ->
io:format(F,"-module(~s).~n",[ErlModule]),
io:format(F,"-compile(export_all).~n",[]),
io:format(F,"-compile(no_native).~n",[]),
- %io:format(F,"-include(\"test_server.hrl\").~n",[]),
io:format(F,"%% This file is generated by running ~w:gen_repl_test(~p)~n",
[?MODULE,OneFile]),
io:format(F,"run() ->~n",[]),
diff --git a/lib/stdlib/test/select_SUITE.erl b/lib/stdlib/test/select_SUITE.erl
index f92971583a..b7e86377c4 100644
--- a/lib/stdlib/test/select_SUITE.erl
+++ b/lib/stdlib/test/select_SUITE.erl
@@ -27,21 +27,21 @@
%% Define to run outside of test server
%%
%%-define(STANDALONE,1).
-
+
%%
%% Define for debug output
%%
%%-define(debug,1).
-
+
-ifdef(STANDALONE).
-define(config(A,B),config(A,B)).
-export([config/2]).
--define(fmt(A,B),io:format(A,B)).
-else.
-include_lib("common_test/include/ct.hrl").
--define(fmt(A,B),test_server:format(A,B)).
-endif.
-
+
+-define(fmt(A,B), io:format(A, B)).
+
-ifdef(debug).
-ifdef(STANDALONE).
-define(line, erlang:display({?MODULE,?LINE}), ).
@@ -53,7 +53,7 @@
-endif.
-define(dbgformat(A,B),noop).
-endif.
-
+
-ifdef(STANDALONE).
config(priv_dir,_) ->
".".
@@ -64,16 +64,15 @@ config(priv_dir,_) ->
init_per_testcase/2, end_per_testcase/2,
return_values/1]).
-init_per_testcase(_Case, Config) when is_list(Config) ->
- ?line Dog=test_server:timetrap(test_server:seconds(1200)),
- [{watchdog, Dog}|Config].
+init_per_testcase(_Case, Config) ->
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,20}}].
all() ->
[return_values, select_test].
@@ -94,17 +93,11 @@ end_per_group(_GroupName, Config) ->
Config.
-select_test(suite) ->
- [];
-select_test(doc) ->
- ["Tests select in numerous ways"];
+%% Test select in numerous ways.
select_test(Config) when is_list(Config) ->
do_test(Config).
-return_values(suite) ->
- [];
-return_values(doc) ->
- ["Tests return values in specific situations for select/3 and select/1"];
+%% Test return values in specific situations for select/3 and select/1.
return_values(Config) when is_list(Config) ->
do_return_values().
@@ -117,7 +110,7 @@ table_factor({ets,_}) ->
100.
gen_dets_filename(Config,N) ->
- filename:join(?config(priv_dir,Config),
+ filename:join(proplists:get_value(priv_dir,Config),
"testdets_" ++ integer_to_list(N) ++ ".dets").
create_tables(Config) ->
@@ -128,15 +121,15 @@ create_tables(Config) ->
F1 = gen_dets_filename(Config,1),
(catch file:delete(F1)),
{ok,DetsPlain} = dets:open_file(testdets_1,
- [{file, F1}]),
+ [{file, F1}]),
F3 = gen_dets_filename(Config,3),
(catch file:delete(F3)),
{ok,DetsBag} = dets:open_file(testdets_3,
- [{file, F3},{type, bag}]),
+ [{file, F3},{type, bag}]),
F4 = gen_dets_filename(Config,4),
(catch file:delete(F4)),
{ok,DetsDBag} = dets:open_file(testdets_4,
- [{file, F4},{type, duplicate_bag}]),
+ [{file, F4},{type, duplicate_bag}]),
[{ets,Hash}, {ets,Tree}, {ets,Bag}, {ets,DBag},
{dets, DetsPlain}, {dets, DetsBag}, {dets, DetsDBag}].
@@ -189,7 +182,7 @@ build_tables(Config,Type) ->
L = create_tables(Config),
?dbgformat("Tables: ~p~n",[L]),
lists:foreach(fun(TD) ->
- fill_table(TD,table_size(TD),Type)
+ fill_table(TD,table_size(TD),Type)
end,
L),
L.
@@ -202,10 +195,10 @@ destroy_tables([{ets,Tab}|T]) ->
destroy_tables([{dets,Tab}|T]) ->
dets:close(Tab),
destroy_tables(T).
-
+
init_random(Config) ->
- WriteDir = ReadDir = ?config(priv_dir,Config),
+ WriteDir = ReadDir = proplists:get_value(priv_dir,Config),
(catch file:make_dir(WriteDir)),
Seed = case file:consult(filename:join([ReadDir,
"preset_random_seed2.txt"])) of
@@ -229,7 +222,7 @@ create_pb_key(N,list) ->
X = rand:uniform(N),
case rand:uniform(4) of
3 -> {[X, X+1, '_'], fun([Z,Z1,P1]) ->
- [Z,Z1,P1] =:= [X,X+1,P1] end};
+ [Z,Z1,P1] =:= [X,X+1,P1] end};
2 -> {[X, '_', '_'], fun([Z,P1,P2]) -> [Z,P1,P2] =:= [X,P1,P2] end};
1 -> {[X, X+1, '$1'], fun([Z,Z1,P1]) ->
[Z,Z1,P1] =:= [X,X+1,P1] end};
@@ -309,7 +302,7 @@ cmp_ms_to_fun({Mod,Tab}, MS, Fun1, Fun2, ChunkSize) ->
false ->
?fmt("Match_spec result differs from fun result:~n",[]),
?fmt("Parameters: ~p,~p,~p,~p~n",
- [{Mod,Tab}, MS, Fun1, Fun2]),
+ [{Mod,Tab}, MS, Fun1, Fun2]),
?fmt("Match_spec Result: ~p~n", [MSRes]),
?fmt("Fun Result: ~p~n", [FunRes]),
Info = (catch Mod:info(Tab)),
@@ -351,18 +344,18 @@ do_test(Config) ->
?fmt("multi_key done for type ~w~n",[Type]),
multi_mixed_key(Tabs,Type),
?fmt("multi_mixed_key done for type ~w~n",
- [Type]),
+ [Type]),
destroy_tables(Tabs)
end,
[tuple, list, complex]),
ok.
-
+
basic_key(Tabs,Type) ->
Fun = fun() ->
lists:map(fun(Tab) ->
- ?line Key =
+ Key =
create_random_key(num_els(Tab),Type),
- ?line MS =
+ MS =
[{{Key,'_','_','_','_'},[],['$_']}],
MF = fun({Key0,A,B,F,Bi},Acc) ->
case Key =:= Key0 of
@@ -373,18 +366,18 @@ basic_key(Tabs,Type) ->
Acc
end
end,
- ?line cmp_ms_to_fun(Tab,MS,MF,[])
+ cmp_ms_to_fun(Tab,MS,MF,[])
end,
Tabs)
end,
- ?line do_n(50,Fun),
+ do_n(50,Fun),
ok.
-
+
basic_pb_key(Tabs,Type) ->
InnerFun = fun(Tab) ->
- ?line {Key,KeyFun} =
+ {Key,KeyFun} =
create_pb_key(num_els(Tab),Type),
- ?line MS = [{{Key,'_','_','_','_'},[],['$_']}],
+ MS = [{{Key,'_','_','_','_'},[],['$_']}],
MF = fun({Key0,A,B,F,Bi},Acc) ->
case KeyFun(Key0) of
true ->
@@ -394,27 +387,27 @@ basic_pb_key(Tabs,Type) ->
Acc
end
end,
- ?line cmp_ms_to_fun(Tab,MS,MF,[])
+ cmp_ms_to_fun(Tab,MS,MF,[])
end,
- ?line {Etses, Detses} = split_by_type(Tabs),
-
- ?line FunEts = fun() ->
- ?line lists:foreach(InnerFun,
- Etses)
- end,
- ?line FunDets = fun() ->
- ?line lists:foreach(InnerFun,
- Detses)
- end,
- ?line do_n(table_factor(hd(Etses)) div 2,FunEts),
- ?line do_n(10,FunDets),
+ {Etses, Detses} = split_by_type(Tabs),
+
+ FunEts = fun() ->
+ lists:foreach(InnerFun,
+ Etses)
+ end,
+ FunDets = fun() ->
+ lists:foreach(InnerFun,
+ Detses)
+ end,
+ do_n(table_factor(hd(Etses)) div 2,FunEts),
+ do_n(10,FunDets),
ok.
-
+
double_pb_key(Tabs,Type) ->
InnerFun = fun(Tab) ->
- ?line {KeyA,KeyFunA} =
+ {KeyA,KeyFunA} =
create_pb_key(num_els(Tab),Type),
- ?line {KeyB,KeyFunB} =
+ {KeyB,KeyFunB} =
create_pb_key(num_els(Tab),Type),
MS = [{{KeyA,'_','_','_','_'},[],['$_']},
{{KeyB,'_','_','_','_'},[],['$_']}],
@@ -448,51 +441,51 @@ double_pb_key(Tabs,Type) ->
end
end
end,
- ?line cmp_ms_to_fun(Tab,MS,MF,[])
+ cmp_ms_to_fun(Tab,MS,MF,[])
end,
- ?line {Etses, Detses} = split_by_type(Tabs),
-
- ?line FunEts = fun() ->
- ?line lists:foreach(InnerFun,
- Etses)
- end,
- ?line FunDets = fun() ->
- ?line lists:foreach(InnerFun,
- Detses)
- end,
- ?line do_n(table_factor(hd(Etses)) div 2,FunEts),
- ?line do_n(10,FunDets),
+ {Etses, Detses} = split_by_type(Tabs),
+
+ FunEts = fun() ->
+ lists:foreach(InnerFun,
+ Etses)
+ end,
+ FunDets = fun() ->
+ lists:foreach(InnerFun,
+ Detses)
+ end,
+ do_n(table_factor(hd(Etses)) div 2,FunEts),
+ do_n(10,FunDets),
ok.
-
-
+
+
multi_key(Tabs,Type) ->
Fun = fun() ->
lists:map(fun(Tab) ->
- ?line KeyA =
+ KeyA =
create_random_key(num_els(Tab),Type),
- ?line KeyB =
+ KeyB =
create_random_key(num_els(Tab),Type),
- ?line KeyC =
+ KeyC =
create_random_key(num_els(Tab),Type),
- ?line KeyD =
+ KeyD =
create_random_key(num_els(Tab),Type),
- ?line KeyE =
+ KeyE =
create_random_key(num_els(Tab),Type),
- ?line KeyF =
+ KeyF =
create_random_key(num_els(Tab),Type),
- ?line KeyG =
+ KeyG =
create_random_key(num_els(Tab),Type),
- ?line KeyH =
+ KeyH =
create_random_key(num_els(Tab),Type),
- ?line KeyI =
+ KeyI =
create_random_key(num_els(Tab),Type),
- ?line KeyJ =
+ KeyJ =
create_random_key(num_els(Tab),Type),
- ?line KeyK =
+ KeyK =
create_random_key(num_els(Tab),Type),
- ?line KeyL =
+ KeyL =
create_random_key(num_els(Tab),Type),
-
+
MS = [{{KeyA,'$1','_','$2','_'},[],
[{{'$1','$2'}}]},
{{KeyB,'$1','_','$2','_'},[],
@@ -519,7 +512,7 @@ multi_key(Tabs,Type) ->
[{{'$1','$2'}}]}
],
?dbgformat("Tab: ~p, MS: ~p~n",
- [Tab,MS]),
+ [Tab,MS]),
MF = fun({Key0,A,_B,F,_Bi},Acc) ->
case Key0 of
KeyA ->
@@ -562,40 +555,40 @@ multi_key(Tabs,Type) ->
Acc
end
end,
- ?line cmp_ms_to_fun(Tab,MS,MF,[])
+ cmp_ms_to_fun(Tab,MS,MF,[])
end,
Tabs)
end,
- ?line do_n(33,Fun),
+ do_n(33,Fun),
ok.
-
+
multi_mixed_key(Tabs,Type) ->
InnerFun = fun(Tab) ->
- ?line KeyA =
+ KeyA =
create_random_key(num_els(Tab),Type),
- ?line KeyB =
+ KeyB =
create_random_key(num_els(Tab),Type),
- ?line KeyC =
+ KeyC =
create_random_key(num_els(Tab),Type),
- ?line KeyD =
+ KeyD =
create_random_key(num_els(Tab),Type),
- ?line {KeyE, FunE} =
+ {KeyE, FunE} =
create_pb_key(num_els(Tab),Type),
- ?line KeyF =
+ KeyF =
create_random_key(num_els(Tab),Type),
- ?line {KeyG, FunG} =
+ {KeyG, FunG} =
create_pb_key(num_els(Tab),Type),
- ?line KeyH =
+ KeyH =
create_random_key(num_els(Tab),Type),
- ?line KeyI =
+ KeyI =
create_random_key(num_els(Tab),Type),
- ?line {KeyJ, FunJ} =
+ {KeyJ, FunJ} =
create_pb_key(num_els(Tab),Type),
- ?line KeyK =
+ KeyK =
create_random_key(num_els(Tab),Type),
- ?line KeyL =
+ KeyL =
create_random_key(num_els(Tab),Type),
-
+
MS = [{{KeyA,'$1','_','$2','_'},[],
[{{'$1','$2'}}]},
{{KeyB,'$1','_','$2','_'},[],
@@ -664,34 +657,34 @@ multi_mixed_key(Tabs,Type) ->
end
end
end,
- ?line cmp_ms_to_fun(Tab,MS,MF,[]),
- ?line case Tab of
- {ets,_} ->
- ?line cmp_ms_to_fun(Tab,MS,MF,[],1),
- ?line cmp_ms_to_fun(Tab,MS,MF,[],10),
- ?line cmp_ms_to_fun(Tab,MS,MF,[],1000000),
- ?line cmp_ms_to_fun(Tab,MS,MF,[],-1),
- ?line cmp_ms_to_fun(Tab,MS,MF,[],-10),
- ?line cmp_ms_to_fun(Tab,MS,MF,[],-1000000);
- _ ->
- ok
- end
+ cmp_ms_to_fun(Tab,MS,MF,[]),
+ case Tab of
+ {ets,_} ->
+ cmp_ms_to_fun(Tab,MS,MF,[],1),
+ cmp_ms_to_fun(Tab,MS,MF,[],10),
+ cmp_ms_to_fun(Tab,MS,MF,[],1000000),
+ cmp_ms_to_fun(Tab,MS,MF,[],-1),
+ cmp_ms_to_fun(Tab,MS,MF,[],-10),
+ cmp_ms_to_fun(Tab,MS,MF,[],-1000000);
+ _ ->
+ ok
+ end
end,
- ?line {Etses, Detses} = split_by_type(Tabs),
-
- ?line FunEts = fun() ->
- ?line lists:foreach(InnerFun,
- Etses)
- end,
- ?line FunDets = fun() ->
- ?line lists:foreach(InnerFun,
- Detses)
- end,
- ?line do_n(table_factor(hd(Etses)) div 2,FunEts),
- ?line do_n(table_factor(hd(Detses)) div 2,FunDets),
+ {Etses, Detses} = split_by_type(Tabs),
+
+ FunEts = fun() ->
+ lists:foreach(InnerFun,
+ Etses)
+ end,
+ FunDets = fun() ->
+ lists:foreach(InnerFun,
+ Detses)
+ end,
+ do_n(table_factor(hd(Etses)) div 2,FunEts),
+ do_n(table_factor(hd(Detses)) div 2,FunDets),
ok.
-
-
+
+
split_by_type(List) ->
split_by_type(List,[],[]).
split_by_type([],AccEts,AccDets) ->
@@ -702,121 +695,119 @@ split_by_type([{ets,Tab}|T],AccEts,AccDets) ->
split_by_type(T,[{ets,Tab}|AccEts],AccDets).
whitebox() ->
- ?line ets:new(xxx,[named_table, ordered_set]),
- ?line ets:new(yyy,[named_table]),
- ?line E = fun(0,_)->ok;
- (N,F) ->
- ?line ets:insert(xxx,{N,N rem 10}),
- ?line ets:insert(yyy,{N,N rem 10}),
- F(N-1,F)
- end,
- ?line E(10000,E),
-
- ?line G = fun(F,C,A) ->
- ?line case ets:select(C) of
- {L,C2} ->
- ?line F(F,C2,A+length(L));
- '$end_of_table' ->
- ?line A
- end
- end,
- ?line H=fun({L,C}) ->
- ?line G(G,C,length(L))
- end,
-
- ?line 1 = H(ets:select(xxx,[{{'$1','$2'},[{'<','$1',2}],['$_']}],7)),
- ?line 10000 = H(ets:select(xxx,[{{'$1','$2'},[],['$_']}],1)),
- ?line 1 = H(ets:select(yyy,[{{'$1','$2'},[{'<','$1',2}],['$_']}],7)),
- ?line 10000 = H(ets:select(yyy,[{{'$1','$2'},[],['$_']}],1)),
-
- ?line {[{5,5}],_} = ets:select(xxx,[{{5,'$2'},[],['$_']}],1),
- ?line {[{5,5}],_} = ets:select(yyy,[{{5,'$2'},[],['$_']}],1),
-
- ?line I = fun(_,0) ->
- ok;
- (I,N) ->
- ?line 10000 =
- H(ets:select(xxx,[{{'$1','$2'},[],['$_']}],N)),
- I(I,N-1)
- end,
- ?line I(I,2000),
- ?line J = fun(F,C,A) ->
- ?line case ets:select(C) of
- {L,C2} ->
- ?line F(F,C2,lists:reverse(L)++A);
- '$end_of_table' ->
- ?line lists:reverse(A)
- end
- end,
- ?line K = fun({L,C}) ->
- ?line J(J,C,lists:reverse(L))
- end,
- ?line M = fun(_, _, 0) ->
- ok;
- (F, What, N) ->
- ?line What =
- K(ets:select(xxx,[{{'$1','$2'},[],['$_']}],N)),
- F(F, What, N-1)
- end,
- ?line N = fun(HM) ->
- ?line What = ets:select(xxx,[{{'$1','$2'},[],['$_']}]),
- ?line What = lists:sort(What),
- M(M, What, HM)
- end,
- ?line N(2000),
- ?line ets:delete(xxx),
- ?line ets:delete(yyy).
+ ets:new(xxx,[named_table, ordered_set]),
+ ets:new(yyy,[named_table]),
+ E = fun(0,_)->ok;
+ (N,F) ->
+ ets:insert(xxx,{N,N rem 10}),
+ ets:insert(yyy,{N,N rem 10}),
+ F(N-1,F)
+ end,
+ E(10000,E),
+
+ G = fun(F,C,A) ->
+ case ets:select(C) of
+ {L,C2} ->
+ F(F,C2,A+length(L));
+ '$end_of_table' ->
+ A
+ end
+ end,
+ H=fun({L,C}) ->
+ G(G,C,length(L))
+ end,
+
+ 1 = H(ets:select(xxx,[{{'$1','$2'},[{'<','$1',2}],['$_']}],7)),
+ 10000 = H(ets:select(xxx,[{{'$1','$2'},[],['$_']}],1)),
+ 1 = H(ets:select(yyy,[{{'$1','$2'},[{'<','$1',2}],['$_']}],7)),
+ 10000 = H(ets:select(yyy,[{{'$1','$2'},[],['$_']}],1)),
+
+ {[{5,5}],_} = ets:select(xxx,[{{5,'$2'},[],['$_']}],1),
+ {[{5,5}],_} = ets:select(yyy,[{{5,'$2'},[],['$_']}],1),
+
+ I = fun(_,0) ->
+ ok;
+ (I,N) ->
+ 10000 =
+ H(ets:select(xxx,[{{'$1','$2'},[],['$_']}],N)),
+ I(I,N-1)
+ end,
+ I(I,2000),
+ J = fun(F,C,A) ->
+ case ets:select(C) of
+ {L,C2} ->
+ F(F,C2,lists:reverse(L)++A);
+ '$end_of_table' ->
+ lists:reverse(A)
+ end
+ end,
+ K = fun({L,C}) ->
+ J(J,C,lists:reverse(L))
+ end,
+ M = fun(_, _, 0) ->
+ ok;
+ (F, What, N) ->
+ What =
+ K(ets:select(xxx,[{{'$1','$2'},[],['$_']}],N)),
+ F(F, What, N-1)
+ end,
+ N = fun(HM) ->
+ What = ets:select(xxx,[{{'$1','$2'},[],['$_']}]),
+ What = lists:sort(What),
+ M(M, What, HM)
+ end,
+ N(2000),
+ ets:delete(xxx),
+ ets:delete(yyy).
do_return_values() ->
- ?line T = ets:new(xxx,[ordered_set]),
- ?line U = ets:new(xxx,[]),
- ?line '$end_of_table' = ets:select(T,[{'_',[],['$_']}],1),
- ?line '$end_of_table' = ets:select(U,[{'_',[],['$_']}],1),
- ?line ets:insert(T,{ett,1}),
- ?line ets:insert(U,{ett,1}),
- ?line {[{ett,1}],C1} = ets:select(T,[{'_',[],['$_']}],1),
- ?line '$end_of_table' = ets:select(C1),
- ?line {[{ett,1}],C2} = ets:select(U,[{'_',[],['$_']}],1),
- ?line '$end_of_table' = ets:select(C2),
- ?line {[{ett,1}],C3} = ets:select(T,[{'_',[],['$_']}],2),
- ?line '$end_of_table' = ets:select(C3),
- ?line {[{ett,1}],C4} = ets:select(U,[{'_',[],['$_']}],2),
- ?line '$end_of_table' = ets:select(C4),
- ?line E = fun(0,_)->ok;
- (N,F) ->
- ?line ets:insert(T,{N,N rem 10}),
- ?line ets:insert(U,{N,N rem 10}),
- F(N-1,F)
- end,
- ?line E(10000,E),
- ?line '$end_of_table' = ets:select(T,[{{hej, hopp},[],['$_']}],1),
- ?line '$end_of_table' = ets:select(U,[{{hej,hopp},[],['$_']}],1),
- ?line {[{ett,1}],CC1} = ets:select(T,[{{'$1','_'},[{is_atom, '$1'}],
- ['$_']}],1),
- ?line '$end_of_table' = ets:select(CC1),
- ?line {[{ett,1}],CC2} = ets:select(U,[{{'$1','_'},[{is_atom, '$1'}],
- ['$_']}],1),
- ?line '$end_of_table' = ets:select(CC2),
- ?line {[{ett,1}],CC3} = ets:select(T,[{{'$1','_'},[{is_atom, '$1'}],
- ['$_']}],2),
- ?line '$end_of_table' = ets:select(CC3),
- ?line {[{ett,1}],CC4} = ets:select(U,[{{'$1','_'},[{is_atom, '$1'}],
- ['$_']}],2),
- ?line '$end_of_table' = ets:select(CC4),
- ?line ets:delete(T),
- ?line ets:delete(U),
- ?line V = ets:new(xxx,[{keypos, 4}]),
- ?line X = ets:new(xxx,[ordered_set, {keypos, 4}]),
- ?line ets:insert(V,{1,1,1,ett}),
- ?line ets:insert(X,{1,1,1,ett}),
- ?line '$end_of_table' = ets:select(V,[{{1,1,1},[],['$_']}],1),
- ?line '$end_of_table' = ets:select(X,[{{1,1,1},[],['$_']}],1),
- ?line ets:delete(V),
- ?line ets:delete(X),
+ T = ets:new(xxx,[ordered_set]),
+ U = ets:new(xxx,[]),
+ '$end_of_table' = ets:select(T,[{'_',[],['$_']}],1),
+ '$end_of_table' = ets:select(U,[{'_',[],['$_']}],1),
+ ets:insert(T,{ett,1}),
+ ets:insert(U,{ett,1}),
+ {[{ett,1}],C1} = ets:select(T,[{'_',[],['$_']}],1),
+ '$end_of_table' = ets:select(C1),
+ {[{ett,1}],C2} = ets:select(U,[{'_',[],['$_']}],1),
+ '$end_of_table' = ets:select(C2),
+ {[{ett,1}],C3} = ets:select(T,[{'_',[],['$_']}],2),
+ '$end_of_table' = ets:select(C3),
+ {[{ett,1}],C4} = ets:select(U,[{'_',[],['$_']}],2),
+ '$end_of_table' = ets:select(C4),
+ E = fun(0,_)->ok;
+ (N,F) ->
+ ets:insert(T,{N,N rem 10}),
+ ets:insert(U,{N,N rem 10}),
+ F(N-1,F)
+ end,
+ E(10000,E),
+ '$end_of_table' = ets:select(T,[{{hej, hopp},[],['$_']}],1),
+ '$end_of_table' = ets:select(U,[{{hej,hopp},[],['$_']}],1),
+ {[{ett,1}],CC1} = ets:select(T,[{{'$1','_'},[{is_atom, '$1'}],
+ ['$_']}],1),
+ '$end_of_table' = ets:select(CC1),
+ {[{ett,1}],CC2} = ets:select(U,[{{'$1','_'},[{is_atom, '$1'}],
+ ['$_']}],1),
+ '$end_of_table' = ets:select(CC2),
+ {[{ett,1}],CC3} = ets:select(T,[{{'$1','_'},[{is_atom, '$1'}],
+ ['$_']}],2),
+ '$end_of_table' = ets:select(CC3),
+ {[{ett,1}],CC4} = ets:select(U,[{{'$1','_'},[{is_atom, '$1'}],
+ ['$_']}],2),
+ '$end_of_table' = ets:select(CC4),
+ ets:delete(T),
+ ets:delete(U),
+ V = ets:new(xxx,[{keypos, 4}]),
+ X = ets:new(xxx,[ordered_set, {keypos, 4}]),
+ ets:insert(V,{1,1,1,ett}),
+ ets:insert(X,{1,1,1,ett}),
+ '$end_of_table' = ets:select(V,[{{1,1,1},[],['$_']}],1),
+ '$end_of_table' = ets:select(X,[{{1,1,1},[],['$_']}],1),
+ ets:delete(V),
+ ets:delete(X),
ok.
-
-
diff --git a/lib/stdlib/test/sets_SUITE.erl b/lib/stdlib/test/sets_SUITE.erl
index 06da696700..b866cb62e0 100644
--- a/lib/stdlib/test/sets_SUITE.erl
+++ b/lib/stdlib/test/sets_SUITE.erl
@@ -36,15 +36,14 @@
-import(lists, [foldl/3,reverse/1]).
init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?t:minutes(5)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,5}}].
all() ->
[create, add_element, del_element, subtract,
diff --git a/lib/stdlib/test/shell_SUITE.erl b/lib/stdlib/test/shell_SUITE.erl
index 747b76abb6..af735218b9 100644
--- a/lib/stdlib/test/shell_SUITE.erl
+++ b/lib/stdlib/test/shell_SUITE.erl
@@ -54,26 +54,23 @@ config(priv_dir,_) ->
-else.
-include_lib("common_test/include/ct.hrl").
-export([init_per_testcase/2, end_per_testcase/2]).
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(10)).
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- ?line OrigPath = code:get_path(),
- ?line code:add_patha(?config(priv_dir,Config)),
- [{orig_path,OrigPath}, {watchdog, Dog} | Config].
+ OrigPath = code:get_path(),
+ code:add_patha(proplists:get_value(priv_dir,Config)),
+ [{orig_path,OrigPath} | Config].
end_per_testcase(_Case, Config) ->
- ?line Dog = ?config(watchdog, Config),
- ?line test_server:timetrap_cancel(Dog),
- ?line OrigPath = ?config(orig_path,Config),
- ?line code:set_path(OrigPath),
- ?line application:unset_env(stdlib, restricted_shell),
- ?line (catch code:purge(user_default)),
- ?line (catch code:delete(user_default)),
+ OrigPath = proplists:get_value(orig_path,Config),
+ code:set_path(OrigPath),
+ application:unset_env(stdlib, restricted_shell),
+ (catch code:purge(user_default)),
+ (catch code:delete(user_default)),
ok.
-endif.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,10}}].
all() ->
[forget, records, known_bugs, otp_5226, otp_5327,
@@ -112,101 +109,95 @@ end_per_group(_GroupName, Config) ->
-record(state, {bin, reply, leader, unic = latin1}).
-start_restricted_from_shell(doc) ->
- ["Test that a restricted shell can be started from the normal shell"];
-start_restricted_from_shell(suite) ->
- [];
+%% Test that a restricted shell can be started from the normal shell.
start_restricted_from_shell(Config) when is_list(Config) ->
- ?line [{error,nofile}] = scan(<<"begin shell:start_restricted("
- "nonexisting_module) end.">>),
- ?line Test = filename:join(?config(priv_dir, Config),
- "test_restricted.erl"),
+ [{error,nofile}] = scan(<<"begin shell:start_restricted("
+ "nonexisting_module) end.">>),
+ Test = filename:join(proplists:get_value(priv_dir, Config),
+ "test_restricted.erl"),
Contents = <<"-module(test_restricted).
-export([local_allowed/3, non_local_allowed/3]).
- local_allowed(m,[],State) ->
- {true,State};
- local_allowed(ugly,[],_State) ->
- non_conforming_reply;
- local_allowed(_,_,State) ->
- {false,State}.
-
- non_local_allowed({shell,stop_restricted},[],State) ->
- {true,State};
- non_local_allowed({erlang,'+'},[_],State) ->
- {true,State};
- non_local_allowed({erlang,'-'},[_,_],_State) ->
- non_conforming_reply;
- non_local_allowed({h, d}, [Arg], S) ->
- {{redirect, {erlang,hd}, [Arg]}, S};
- non_local_allowed(_,_,State) ->
- {false,State}.
- ">>,
- ?line ok = compile_file(Config, Test, Contents, []),
- ?line "exception exit: restricted shell starts now" =
- comm_err(<<"begin shell:start_restricted("
- "test_restricted) end.">>),
- ?line {ok, test_restricted} =
- application:get_env(stdlib, restricted_shell),
- ?line "Module" ++ _ = t({<<"begin m() end.">>, utf8}),
- ?line "exception exit: restricted shell does not allow c(foo)" =
- comm_err(<<"begin c(foo) end.">>),
- ?line "exception exit: restricted shell does not allow init:stop()" =
- comm_err(<<"begin init:stop() end.">>),
- ?line "exception exit: restricted shell does not allow init:stop()" =
- comm_err(<<"begin F = fun() -> init:stop() end, F() end.">>),
- ?line "exception error: an error occurred when evaluating an arithmetic expression" =
- comm_err(<<"begin +a end.">>),
- ?line "exception exit: restricted shell does not allow a + b" =
- comm_err(<<"begin a+b end.">>),
- ?line "exception exit: restricted shell does not allow - b" =
- comm_err(<<"begin -b end.">>),
- ?line "exception exit: restricted shell does not allow 1 + 2" =
- comm_err(<<"begin if atom(1 + 2> 0) -> 1; true -> 2 end end.">>),
- ?line "exception exit: restricted shell does not allow 1 + 2" =
- comm_err(<<"begin if is_atom(1 + 2> 0) -> 1; true -> 2 end end.">>),
- ?line "exception exit: restricted shell does not allow - 2" =
- comm_err(<<"begin if - 2 -> 1; true -> 2 end end.">>),
- ?line "exception exit: restricted shell does not allow - 2" =
- comm_err(<<"begin if (- 2 > 0) andalso true -> 1; true -> 2 end end.">>),
- ?line "exception exit: restricted shell does not allow - 2" =
- comm_err(<<"begin if (- 2 > 0) orelse true -> 1; true -> 2 end end.">>),
- ?line "exception exit: restricted shell does not allow 1 + 2" =
- comm_err(<<"begin if 1 + 2 > 0 -> 1; true -> 2 end end.">>),
- ?line "exception exit: restricted shell does not allow 1 + 2" =
- comm_err(<<"begin if erlang:is_atom(1 + 2> 0) -> 1; true -> 2 end end.">>),
- ?line "exception exit: restricted shell does not allow is_integer(1)" =
- comm_err(<<"begin if is_integer(1) -> 1; true -> 2 end end.">>),
- ?line "exception exit: restricted shell does not allow is_integer(1)" =
- comm_err(<<"begin if integer(1) -> 1; true -> 2 end end.">>),
- ?line "exception exit: "
- "restricted shell module returned bad value non_conforming_reply" =
- comm_err(<<"ugly().">>),
- ?line [one] = scan(<<"h:d([one,two]).">>),
- ?line "exception exit: "
- "restricted shell module returned bad value non_conforming_reply" =
- comm_err(<<"1 - 2.">>),
- ?line "exception exit: restricted shell stopped"=
- comm_err(<<"begin shell:stop_restricted() end.">>),
- ?line undefined =
- application:get_env(stdlib, restricted_shell),
- ok.
-
-start_restricted_on_command_line(doc) ->
- ["Check restricted shell when started from the command line"];
-start_restricted_on_command_line(suite) ->
- [];
+local_allowed(m,[],State) ->
+ {true,State};
+local_allowed(ugly,[],_State) ->
+ non_conforming_reply;
+local_allowed(_,_,State) ->
+ {false,State}.
+
+non_local_allowed({shell,stop_restricted},[],State) ->
+ {true,State};
+non_local_allowed({erlang,'+'},[_],State) ->
+ {true,State};
+non_local_allowed({erlang,'-'},[_,_],_State) ->
+ non_conforming_reply;
+non_local_allowed({h, d}, [Arg], S) ->
+ {{redirect, {erlang,hd}, [Arg]}, S};
+non_local_allowed(_,_,State) ->
+ {false,State}.
+">>,
+ ok = compile_file(Config, Test, Contents, []),
+"exception exit: restricted shell starts now" =
+comm_err(<<"begin shell:start_restricted("
+ "test_restricted) end.">>),
+{ok, test_restricted} =
+application:get_env(stdlib, restricted_shell),
+"Module" ++ _ = t({<<"begin m() end.">>, utf8}),
+"exception exit: restricted shell does not allow c(foo)" =
+comm_err(<<"begin c(foo) end.">>),
+"exception exit: restricted shell does not allow init:stop()" =
+comm_err(<<"begin init:stop() end.">>),
+"exception exit: restricted shell does not allow init:stop()" =
+comm_err(<<"begin F = fun() -> init:stop() end, F() end.">>),
+"exception error: an error occurred when evaluating an arithmetic expression" =
+comm_err(<<"begin +a end.">>),
+"exception exit: restricted shell does not allow a + b" =
+comm_err(<<"begin a+b end.">>),
+"exception exit: restricted shell does not allow - b" =
+comm_err(<<"begin -b end.">>),
+"exception exit: restricted shell does not allow 1 + 2" =
+comm_err(<<"begin if atom(1 + 2> 0) -> 1; true -> 2 end end.">>),
+"exception exit: restricted shell does not allow 1 + 2" =
+comm_err(<<"begin if is_atom(1 + 2> 0) -> 1; true -> 2 end end.">>),
+"exception exit: restricted shell does not allow - 2" =
+comm_err(<<"begin if - 2 -> 1; true -> 2 end end.">>),
+"exception exit: restricted shell does not allow - 2" =
+comm_err(<<"begin if (- 2 > 0) andalso true -> 1; true -> 2 end end.">>),
+"exception exit: restricted shell does not allow - 2" =
+comm_err(<<"begin if (- 2 > 0) orelse true -> 1; true -> 2 end end.">>),
+"exception exit: restricted shell does not allow 1 + 2" =
+comm_err(<<"begin if 1 + 2 > 0 -> 1; true -> 2 end end.">>),
+"exception exit: restricted shell does not allow 1 + 2" =
+comm_err(<<"begin if erlang:is_atom(1 + 2> 0) -> 1; true -> 2 end end.">>),
+"exception exit: restricted shell does not allow is_integer(1)" =
+comm_err(<<"begin if is_integer(1) -> 1; true -> 2 end end.">>),
+"exception exit: restricted shell does not allow is_integer(1)" =
+comm_err(<<"begin if integer(1) -> 1; true -> 2 end end.">>),
+"exception exit: "
+"restricted shell module returned bad value non_conforming_reply" =
+comm_err(<<"ugly().">>),
+[one] = scan(<<"h:d([one,two]).">>),
+"exception exit: "
+"restricted shell module returned bad value non_conforming_reply" =
+comm_err(<<"1 - 2.">>),
+"exception exit: restricted shell stopped"=
+comm_err(<<"begin shell:stop_restricted() end.">>),
+undefined =
+application:get_env(stdlib, restricted_shell),
+ok.
+
+%% Check restricted shell when started from the command line.
start_restricted_on_command_line(Config) when is_list(Config) ->
- ?line {ok,Node} = start_node(shell_suite_helper_1,
- "-pa "++?config(priv_dir,Config)++
- " -stdlib restricted_shell foo"),
- ?line "Warning! Restricted shell module foo not found: nofile"++_ =
+ {ok,Node} = start_node(shell_suite_helper_1,
+ "-pa "++proplists:get_value(priv_dir,Config)++
+ " -stdlib restricted_shell foo"),
+ "Warning! Restricted shell module foo not found: nofile"++_ =
t({Node, <<"begin m() end.">>}),
- ?line "exception exit: restricted shell does not allow m()" =
+ "exception exit: restricted shell does not allow m()" =
comm_err({Node, <<"begin m() end.">>}),
- ?line [ok] =
+ [ok] =
(catch scan({Node, <<"begin q() end.">>})),
- ?line test_server:stop_node(Node),
- ?line Test = filename:join(?config(priv_dir, Config),
+ test_server:stop_node(Node),
+ Test = filename:join(proplists:get_value(priv_dir, Config),
"test_restricted2.erl"),
Contents = <<"-module(test_restricted2).
-export([local_allowed/3, non_local_allowed/3]).
@@ -222,36 +213,34 @@ start_restricted_on_command_line(Config) when is_list(Config) ->
non_local_allowed(_,_,State) ->
{false,State}.
">>,
- ?line ok = compile_file(Config, Test, Contents, []),
- ?line {ok,Node2} = start_node(shell_suite_helper_2,
- "-pa "++?config(priv_dir,Config)++
+ ok = compile_file(Config, Test, Contents, []),
+ {ok,Node2} = start_node(shell_suite_helper_2,
+ "-pa "++proplists:get_value(priv_dir,Config)++
" -stdlib restricted_shell test_restricted2"),
- ?line "Module" ++ _ = t({Node2,<<"begin m() end.">>, utf8}),
- ?line "exception exit: restricted shell does not allow c(foo)" =
+ "Module" ++ _ = t({Node2,<<"begin m() end.">>, utf8}),
+ "exception exit: restricted shell does not allow c(foo)" =
comm_err({Node2,<<"begin c(foo) end.">>}),
- ?line "exception exit: restricted shell does not allow init:stop()" =
+ "exception exit: restricted shell does not allow init:stop()" =
comm_err({Node2,<<"begin init:stop() end.">>}),
- ?line "exception exit: restricted shell does not allow init:stop()" =
+ "exception exit: restricted shell does not allow init:stop()" =
comm_err({Node2,<<"begin F = fun() -> init:stop() end, F() end.">>}),
- ?line [Node2] =
+ [Node2] =
scan({Node2, <<"begin erlang:node() end.">>}),
- ?line [Node2] =
+ [Node2] =
scan({Node2, <<"begin node() end.">>}),
- ?line "exception exit: restricted shell stopped"=
+ "exception exit: restricted shell stopped"=
comm_err({Node2,<<"begin shell:stop_restricted() end.">>}),
- ?line [ok] =
+ [ok] =
scan({Node2, <<"begin q() end.">>}),
- ?line test_server:stop_node(Node2),
+ test_server:stop_node(Node2),
ok.
-restricted_local(suite) ->
- [];
-restricted_local(doc) ->
- ["Tests calling local shell functions with spectacular arguments in restricted shell"];
+%% Tests calling local shell functions with spectacular arguments in
+%% restricted shell.
restricted_local(Config) when is_list(Config) ->
- ?line [{error,nofile}] = scan(<<"begin shell:start_restricted("
+ [{error,nofile}] = scan(<<"begin shell:start_restricted("
"nonexisting_module) end.">>),
- ?line Test = filename:join(?config(priv_dir, Config),
+ Test = filename:join(proplists:get_value(priv_dir, Config),
"test_restricted_local.erl"),
Contents = <<"-module(test_restricted_local).
-export([local_allowed/3, non_local_allowed/3]).
@@ -271,8 +260,8 @@ restricted_local(Config) when is_list(Config) ->
non_local_allowed(_,_,State) ->
{false,State}.
">>,
- ?line ok = compile_file(Config, Test, Contents, []),
- ?line Test2 = filename:join(?config(priv_dir, Config),
+ ok = compile_file(Config, Test, Contents, []),
+ Test2 = filename:join(proplists:get_value(priv_dir, Config),
"user_default.erl"),
Contents2 = <<"-module(user_default).
-export([funkis/1,apple/1]).
@@ -283,115 +272,109 @@ restricted_local(Config) when is_list(Config) ->
apple(_) ->
apple.
">>,
- ?line ok = compile_file(Config, Test2, Contents2, []),
- ?line "exception exit: restricted shell starts now" =
+ ok = compile_file(Config, Test2, Contents2, []),
+ "exception exit: restricted shell starts now" =
comm_err(<<"begin shell:start_restricted("
"test_restricted_local) end.">>),
- ?line {ok, test_restricted_local} =
+ {ok, test_restricted_local} =
application:get_env(stdlib, restricted_shell),
- ?line "exception exit: restricted shell does not allow foo(" ++ _ =
+ "exception exit: restricted shell does not allow foo(" ++ _ =
comm_err(<<"begin F=fun() -> hello end, foo(F) end.">>),
- ?line "exception error: undefined shell command banan/1" =
+ "exception error: undefined shell command banan/1" =
comm_err(<<"begin F=fun() -> hello end, banan(F) end.">>),
- ?line "{error,"++_ = t(<<"begin F=fun() -> hello end, c(F) end.">>),
- ?line "exception exit: restricted shell does not allow l(" ++ _ =
+ "{error,"++_ = t(<<"begin F=fun() -> hello end, c(F) end.">>),
+ "exception exit: restricted shell does not allow l(" ++ _ =
comm_err(<<"begin F=fun() -> hello end, l(F) end.">>),
- ?line "exception error: variable 'F' is unbound" =
+ "exception error: variable 'F' is unbound" =
comm_err(<<"begin F=fun() -> hello end, f(F), F end.">>),
- ?line [funkis] =
+ [funkis] =
scan(<<"begin F=fun() -> hello end, funkis(F) end.">>),
- ?line "exception exit: restricted shell does not allow apple(" ++ _ =
+ "exception exit: restricted shell does not allow apple(" ++ _ =
comm_err(<<"begin F=fun() -> hello end, apple(F) end.">>),
- ?line "exception exit: restricted shell stopped"=
+ "exception exit: restricted shell stopped"=
comm_err(<<"begin shell:stop_restricted() end.">>),
- ?line undefined =
+ undefined =
application:get_env(stdlib, restricted_shell),
- ?line (catch code:purge(user_default)),
- ?line true = (catch code:delete(user_default)),
+ (catch code:purge(user_default)),
+ true = (catch code:delete(user_default)),
ok.
-forget(doc) ->
- ["f/0 and f/1"];
-forget(suite) ->
- [];
+%% f/0 and f/1.
forget(Config) when is_list(Config) ->
%% f/0
- ?line [ok] = scan(<<"begin f() end.">>),
- ?line "1: variable 'A' is unbound" =
+ [ok] = scan(<<"begin f() end.">>),
+ "1: variable 'A' is unbound" =
comm_err(<<"A = 3, f(), A.">>),
- ?line [ok] = scan(<<"A = 3, A = f(), A.">>),
+ [ok] = scan(<<"A = 3, A = f(), A.">>),
%% f/1
- ?line [ok] = scan(<<"begin f(A) end.">>),
- ?line "1: variable 'A' is unbound" =
+ [ok] = scan(<<"begin f(A) end.">>),
+ "1: variable 'A' is unbound" =
comm_err(<<"A = 3, f(A), A.">>),
- ?line [ok] = scan(<<"A = 3, A = f(A), A.">>),
- ?line "exception error: no function clause matching call to f/1" =
+ [ok] = scan(<<"A = 3, A = f(A), A.">>),
+ "exception error: no function clause matching call to f/1" =
comm_err(<<"f(a).">>),
ok.
-records(doc) ->
- ["Test of the record support. OTP-5063."];
-records(suite) ->
- [];
+%% Test of the record support. OTP-5063.
records(Config) when is_list(Config) ->
%% rd/2
- ?line [{attribute,_,record,{bar,_}},ok] =
+ [{attribute,_,record,{bar,_}},ok] =
scan(<<"rd(foo,{bar}),
rd(bar,{foo = (#foo{})#foo.bar}),
rl(bar).">>),
- ?line "variable 'R' is unbound" = % used to work (before OTP-5878, R11B)
+ "variable 'R' is unbound" = % used to work (before OTP-5878, R11B)
exit_string(<<"rd(foo,{bar}),
R = #foo{},
rd(bar,{foo = R#foo.bar}).">>),
- ?line "exception error: no function clause matching call to rd/2" =
+ "exception error: no function clause matching call to rd/2" =
comm_err(<<"rd({foo},{bar}).">>),
- ?line "bad record declaration" = exit_string(<<"A = bar, rd(foo,A).">>),
- ?line [foo] = scan(<<"begin rd(foo,{bar}) end.">>),
- ?line "1: record foo undefined" =
+ "bad record declaration" = exit_string(<<"A = bar, rd(foo,A).">>),
+ [foo] = scan(<<"begin rd(foo,{bar}) end.">>),
+ "1: record foo undefined" =
comm_err(<<"begin rd(foo,{bar}), #foo{} end.">>),
- ?line ['f o o'] = scan(<<"rd('f o o', {bar}).">>),
- ?line [foo] = scan(<<"rd(foo,{bar}), rd(foo,{foo = #foo{}}).">>),
+ ['f o o'] = scan(<<"rd('f o o', {bar}).">>),
+ [foo] = scan(<<"rd(foo,{bar}), rd(foo,{foo = #foo{}}).">>),
%% rf/0,1
- ?line [_, {attribute,_,record,{foo,_}},ok] =
+ [_, {attribute,_,record,{foo,_}},ok] =
scan(<<"rf('_'). rd(foo,{bar}),rl().">>),
- ?line "1: record foo undefined" =
+ "1: record foo undefined" =
comm_err(<<"rd(foo,{bar}), #foo{}, rf(foo), #foo{}.">>),
- ?line [ok,{foo,undefined}] =
+ [ok,{foo,undefined}] =
scan(<<"rd(foo,{bar}), A = #foo{}, rf(foo). A.">>),
- ?line [_] = scan(<<"begin rf() end.">>),
- ?line [ok] = scan(<<"begin rf(foo) end.">>),
+ [_] = scan(<<"begin rf() end.">>),
+ [ok] = scan(<<"begin rf(foo) end.">>),
%% rp/1
- ?line "#foo{bar = undefined}.\nok.\n" =
+ "#foo{bar = undefined}.\nok.\n" =
t(<<"rd(foo,{bar}), rp(#foo{}).">>),
- ?line [{foo,3,4,3},ok] = scan(<<"rd(foo,{a = 3, b}), rp({foo,3,4,3}).">>),
- ?line "#foo{a = 12}.\nok.\n" = t(<<"rd(foo,{a = 3}), rp({foo,12}).">>),
- ?line [{[{foo}],12},ok] = scan(<<"rd(foo,{a = 3}), rp({[{foo}],12}).">>),
+ [{foo,3,4,3},ok] = scan(<<"rd(foo,{a = 3, b}), rp({foo,3,4,3}).">>),
+ "#foo{a = 12}.\nok.\n" = t(<<"rd(foo,{a = 3}), rp({foo,12}).">>),
+ [{[{foo}],12},ok] = scan(<<"rd(foo,{a = 3}), rp({[{foo}],12}).">>),
%% rr/1,2,3
MS = ?MODULE_STRING,
RR1 = "rr(" ++ MS ++ "). #state{}.",
- ?line "[state]\n"
+ "[state]\n"
"#state{bin = undefined,reply = undefined,leader = undefined,\n"
" unic = latin1}.\n" =
t(RR1),
RR2 = "rr(" ++ MS ++ ",[state]). #state{}.",
- ?line "[state]\n"
+ "[state]\n"
"#state{bin = undefined,reply = undefined,leader = undefined,\n"
" unic = latin1}.\n" =
t(RR2),
RR3 = "rr(" ++ MS ++ ",'_'). #state{}.",
- ?line "[state]\n"
+ "[state]\n"
"#state{bin = undefined,reply = undefined,leader = undefined,\n"
" unic = latin1}.\n" =
t(RR3),
RR4 = "rr(" ++ MS ++ ", '_', {d,test1}).",
- ?line [[state]] = scan(RR4),
+ [[state]] = scan(RR4),
- Test = filename:join(?config(priv_dir, Config), "test.erl"),
+ Test = filename:join(proplists:get_value(priv_dir, Config), "test.erl"),
Contents = <<"-module(test).
-record(state, {bin :: binary(),
reply = no,
@@ -404,7 +387,7 @@ records(Config) when is_list(Config) ->
-ifdef(test2).
-record(test2, {g}).
-endif.">>,
- ?line ok = file:write_file(Test, Contents),
+ ok = file:write_file(Test, Contents),
RR5 = "rr(\"" ++ Test ++ "\", '_', {d,test1}), rl([test1,test2]).",
A1 = erl_anno:new(1),
@@ -415,164 +398,155 @@ records(Config) when is_list(Config) ->
"\", '_', [{d,test1},{d,test2,17}]), rl([test1,test2]).",
[{attribute,A1,record,{test1,_}},{attribute,A1,record,{test2,_}},ok] =
scan(RR7),
- ?line PreReply = scan(<<"rr(prim_file).">>), % preloaded...
- ?line true = is_list(PreReply),
- ?line Dir = filename:join(?config(priv_dir, Config), "*.erl"),
- ?line RR8 = "rp(rr(\"" ++ Dir ++ "\")).",
- ?line [_,ok] = scan(RR8),
+ PreReply = scan(<<"rr(prim_file).">>), % preloaded...
+ true = is_list(PreReply),
+ Dir = filename:join(proplists:get_value(priv_dir, Config), "*.erl"),
+ RR8 = "rp(rr(\"" ++ Dir ++ "\")).",
+ [_,ok] = scan(RR8),
file:delete(Test),
RR1000 = "begin rr(" ++ MS ++ ") end.",
- ?line [_] = scan(RR1000),
+ [_] = scan(RR1000),
RR1001 = "begin rr(" ++ MS ++ ", state) end.",
- ?line [_] = scan(RR1001),
+ [_] = scan(RR1001),
RR1002 = "begin rr(" ++ MS ++ ", state,{i,'.'}) end.",
- ?line [_] = scan(RR1002),
+ [_] = scan(RR1002),
- ?line [{error,nofile}] = scan(<<"rr(not_a_module).">>),
- ?line [{error,invalid_filename}] = scan(<<"rr({foo}).">>),
- ?line [[]] = scan(<<"rr(\"not_a_file\").">>),
+ [{error,nofile}] = scan(<<"rr(not_a_module).">>),
+ [{error,invalid_filename}] = scan(<<"rr({foo}).">>),
+ [[]] = scan(<<"rr(\"not_a_file\").">>),
%% using records
- ?line [2] = scan(<<"rd(foo,{bar}), record_info(size, foo).">>),
- ?line [true] = scan(<<"rd(foo,{bar}), is_record(#foo{}, foo).">>),
- ?line [true] = scan(<<"rd(foo,{bar}), erlang:is_record(#foo{}, foo).">>),
- ?line [true] = scan(<<"rd(foo,{bar}),
+ [2] = scan(<<"rd(foo,{bar}), record_info(size, foo).">>),
+ [true] = scan(<<"rd(foo,{bar}), is_record(#foo{}, foo).">>),
+ [true] = scan(<<"rd(foo,{bar}), erlang:is_record(#foo{}, foo).">>),
+ [true] = scan(<<"rd(foo,{bar}),
fun() when record(#foo{},foo) -> true end().">>),
- ?line [2] = scan(<<"rd(foo,{bar}), #foo.bar.">>),
- ?line "#foo{bar = 17}.\n" =
+ [2] = scan(<<"rd(foo,{bar}), #foo.bar.">>),
+ "#foo{bar = 17}.\n" =
t(<<"rd(foo,{bar}), A = #foo{}, A#foo{bar = 17}.">>),
%% test of is_record/2 in lc
- ?line "[#foo{bar = 3}].\n" =
+ "[#foo{bar = 3}].\n" =
t(<<"rd(foo,{bar}), [X || X <- [#foo{bar=3},x,[],{a,b}],"
"is_record(X, foo)].">>),
- ?line "[x,[],{a,b}].\n" =
+ "[x,[],{a,b}].\n" =
t(<<"rd(foo,{bar}), [X || X <- [#foo{bar=3},x,[],{a,b}],"
"not is_record(X, foo)].">>),
- ?line "[#foo{bar = 3}].\n" =
+ "[#foo{bar = 3}].\n" =
t(<<"rd(foo,{bar}), [X || X <- [#foo{bar=3},x,[],{a,b}],"
"begin is_record(X, foo) end].">>),
- ?line "[x,[],{a,b}].\n" =
+ "[x,[],{a,b}].\n" =
t(<<"rd(foo,{bar}), [X || X <- [#foo{bar=3},x,[],{a,b}],"
"begin not is_record(X, foo) end].">>),
- ?line "[#foo{bar = 3},x,[],{a,b}].\n" =
+ "[#foo{bar = 3},x,[],{a,b}].\n" =
t(<<"rd(foo,{bar}), [X || X <- [#foo{bar=3},x,[],{a,b}],"
"is_record(X, foo) or not is_binary(X)].">>),
- ?line "[#foo{bar = 3},x,[],{a,b}].\n" =
+ "[#foo{bar = 3},x,[],{a,b}].\n" =
t(<<"rd(foo,{bar}), [X || X <- [#foo{bar=3},x,[],{a,b}],"
"not is_record(X, foo) or not is_binary(X)].">>),
- ?line "[#foo{bar = 3}].\n" =
+ "[#foo{bar = 3}].\n" =
t(<<"rd(foo,{bar}), [X || X <- [#foo{bar=3},x,[],{a,b}],"
"is_record(X, foo) or is_reference(X)].">>),
- ?line "[x,[],{a,b}].\n" =
+ "[x,[],{a,b}].\n" =
t(<<"rd(foo,{bar}), [X || X <- [#foo{bar=3},x,[],{a,b}],"
"not is_record(X, foo) or is_reference(X)].">>),
- ?line "[#foo{bar = 3},x,[],{a,b}].\n" =
+ "[#foo{bar = 3},x,[],{a,b}].\n" =
t(<<"rd(foo,{bar}), [X || X <- [#foo{bar=3},x,[],{a,b}],"
"begin is_record(X, foo) or not is_binary(X) end].">>),
- ?line "[#foo{bar = 3},x,[],{a,b}].\n" =
+ "[#foo{bar = 3},x,[],{a,b}].\n" =
t(<<"rd(foo,{bar}), [X || X <- [#foo{bar=3},x,[],{a,b}],"
"begin not is_record(X, foo) or not is_binary(X) end].">>),
- ?line "[#foo{bar = 3}].\n" =
+ "[#foo{bar = 3}].\n" =
t(<<"rd(foo,{bar}), [X || X <- [#foo{bar=3},x,[],{a,b}],"
"begin is_record(X, foo) or is_reference(X) end].">>),
- ?line "[x,[],{a,b}].\n" =
+ "[x,[],{a,b}].\n" =
t(<<"rd(foo,{bar}), [X || X <- [#foo{bar=3},x,[],{a,b}],"
"begin not is_record(X, foo) or is_reference(X) end].">>),
- ?line [ok] =
+ [ok] =
scan(<<"rd(a,{}), is_record({a},a) andalso true, b().">>),
%% nested record defs
- ?line "#b{a = #a{}}.\n" = t(<<"rd(a,{}), rd(b, {a = #a{}}), #b{}.">>),
+ "#b{a = #a{}}.\n" = t(<<"rd(a,{}), rd(b, {a = #a{}}), #b{}.">>),
- ?line [ok,ok,ok] = scan(<<"rf('_'), rp(rp(rl(rf(rf(rf(rl())))))).">>),
+ [ok,ok,ok] = scan(<<"rf('_'), rp(rp(rl(rf(rf(rf(rl())))))).">>),
ok.
-known_bugs(doc) ->
- ["Known bugs."];
-known_bugs(suite) ->
- [];
+%% Known bugs.
known_bugs(Config) when is_list(Config) ->
%% erl_eval:merge_bindings/2 cannot handle _removal_ of bindings.
- ?line [3] = scan(<<"A = 3, length(begin f(A), [3] end), A.">>),
+ [3] = scan(<<"A = 3, length(begin f(A), [3] end), A.">>),
ok.
-otp_5226(doc) ->
- ["OTP-5226. Wildcards accepted when reading BEAM files using rr/1,2,3."];
-otp_5226(suite) ->
- [];
+%% OTP-5226. Wildcards accepted when reading BEAM files using rr/1,2,3.
otp_5226(Config) when is_list(Config) ->
Test1 = <<"-module(test1).
-record('_test1', {a,b}).">>,
Test2 = <<"-module(test2).
-record('_test2', {c,d}).">>,
- ?line File1 = filename("test1.erl", Config),
- ?line File2 = filename("test2.erl", Config),
- ?line Beam = filename("*.beam", Config),
- ?line ok = compile_file(Config, File1, Test1, [no_debug_info]),
- ?line ok = compile_file(Config, File2, Test2, [no_debug_info]),
- RR = "rr(\"" ++ Beam ++ "\").",
- ?line [Recs] = scan(RR),
- ?line true = lists:member('_test1', Recs),
- ?line true = lists:member('_test2', Recs),
- file:delete(filename("test1.beam", Config)),
- file:delete(filename("test2.beam", Config)),
- file:delete(File1),
- file:delete(File2),
- ok.
-
-otp_5327(doc) ->
- ["OTP-5226. Test of eval_bits, mostly."];
-otp_5327(suite) ->
- [];
+ File1 = filename("test1.erl", Config),
+ File2 = filename("test2.erl", Config),
+ Beam = filename("*.beam", Config),
+ ok = compile_file(Config, File1, Test1, [no_debug_info]),
+ ok = compile_file(Config, File2, Test2, [no_debug_info]),
+ RR = "rr(\"" ++ Beam ++ "\").",
+ [Recs] = scan(RR),
+ true = lists:member('_test1', Recs),
+ true = lists:member('_test2', Recs),
+ file:delete(filename("test1.beam", Config)),
+ file:delete(filename("test2.beam", Config)),
+ file:delete(File1),
+ file:delete(File2),
+ ok.
+
+%% OTP-5226. Test of eval_bits, mostly.
otp_5327(Config) when is_list(Config) ->
- ?line "exception error: bad argument" =
+ "exception error: bad argument" =
comm_err(<<"<<\"hej\":default>>.">>),
- ?line <<"abc">> =
+ <<"abc">> =
erl_parse:normalise({bin,1,[{bin_element,1,{string,1,"abc"},
- default,default}]}),
- ?line [<<"abc">>] = scan(<<"<<(<<\"abc\">>):3/binary>>.">>),
- ?line [<<"abc">>] = scan(<<"<<(<<\"abc\">>)/binary>>.">>),
- ?line "exception error: bad argument" =
+ default,default}]}),
+ [<<"abc">>] = scan(<<"<<(<<\"abc\">>):3/binary>>.">>),
+ [<<"abc">>] = scan(<<"<<(<<\"abc\">>)/binary>>.">>),
+ "exception error: bad argument" =
comm_err(<<"<<(<<\"abc\">>):4/binary>>.">>),
- ?line true = byte_size(hd(scan("<<3.14:64/float>>."))) =:= 8,
- ?line true = byte_size(hd(scan("<<3.14:32/float>>."))) =:= 4,
- ?line "exception error: bad argument" =
+ true = byte_size(hd(scan("<<3.14:64/float>>."))) =:= 8,
+ true = byte_size(hd(scan("<<3.14:32/float>>."))) =:= 4,
+ "exception error: bad argument" =
comm_err(<<"<<3.14:128/float>>.">>),
- ?line "exception error: bad argument" =
+ "exception error: bad argument" =
comm_err(<<"<<10:default>>.">>),
- ?line [<<98,1:1>>] = scan(<<"<<3:3,5:6>>.">>),
- ?line {'EXIT',{badarg,_}} =
+ [<<98,1:1>>] = scan(<<"<<3:3,5:6>>.">>),
+ {'EXIT',{badarg,_}} =
(catch erl_parse:normalise({bin,1,[{bin_element,1,{integer,1,17},
{atom,1,all},
default}]})),
- ?line [<<-20/signed>>] = scan(<<"<<-20/signed>> = <<-20>>.">>),
- ?line [<<-300:16/signed>>] =
- scan(<<"<<-300:16/signed>> = <<-300:16>>.">>),
- ?line [<<-1000:24/signed>>] =
- scan(<<"<<-1000:24/signed>> = <<-1000:24>>.">>),
- ?line [<<-(1 bsl 29):32/signed>>] =
+ [<<-20/signed>>] = scan(<<"<<-20/signed>> = <<-20>>.">>),
+ [<<-300:16/signed>>] =
+ scan(<<"<<-300:16/signed>> = <<-300:16>>.">>),
+ [<<-1000:24/signed>>] =
+ scan(<<"<<-1000:24/signed>> = <<-1000:24>>.">>),
+ [<<-(1 bsl 29):32/signed>>] =
scan(<<"<<-(1 bsl 29):32/signed>> = <<-(1 bsl 29):32>>.">>),
- ?line "exception error: no match of right hand side value <<0,0,0>>" =
+ "exception error: no match of right hand side value <<0,0,0>>" =
comm_err(<<"<<B:3/unit:7-binary,_/binary>> = <<0:24>>.">>),
- ?line true = [<<103133:64/float>>] =:=
+ true = [<<103133:64/float>>] =:=
scan(<<"<<103133:64/float>> = <<103133:64/float>>.">>),
- ?line true = [<<103133.0:64/float>>] =:=
+ true = [<<103133.0:64/float>>] =:=
scan(<<"<<103133.0:64/float>> = <<103133:64/float>>.">>),
- ?line true = [<<103133:64/float>>] =:= scan(<<"<<103133:64/float>>.">>),
+ true = [<<103133:64/float>>] =:= scan(<<"<<103133:64/float>>.">>),
Int = 17,
- ?line true = [<<Int:64/float>>] =:= scan(<<"Int = 17, <<Int:64/float>>.">>),
- ?line "exception error: no match of right hand side value" ++ _ =
+ true = [<<Int:64/float>>] =:= scan(<<"Int = 17, <<Int:64/float>>.">>),
+ "exception error: no match of right hand side value" ++ _ =
comm_err(<<"<<103133:64/binary>> = <<103133:64/float>>.">>),
- ?line "exception error: interpreted function with arity 1 called with two arguments" =
+ "exception error: interpreted function with arity 1 called with two arguments" =
comm_err(<<"(fun(X) -> X end)(a,b).">>),
- ?line {'EXIT', {{illegal_pattern,_}, _}} =
+ {'EXIT', {{illegal_pattern,_}, _}} =
(catch evaluate("<<A:a>> = <<17:32>>.", [])),
C = <<"
<<A:4,B:4,C:4,D:4,E:4,F:4>> = <<\"hej\">>,
@@ -581,60 +555,54 @@ otp_5327(Config) when is_list(Config) ->
_ -> 2
end.
">>,
- ?line 1 = evaluate(C, []),
+ 1 = evaluate(C, []),
%% unbound_var would be nicer...
- ?line {'EXIT',{{illegal_pattern,_},_}} =
+ {'EXIT',{{illegal_pattern,_},_}} =
(catch evaluate(<<"<<A:B>> = <<17:32>>.">>, [])),
%% undefined_bittype is turned into badmatch:
- ?line {'EXIT',{{badmatch,<<17:32>>},_}} =
+ {'EXIT',{{badmatch,<<17:32>>},_}} =
(catch evaluate(<<"<<A/apa>> = <<17:32>>.">>, [])),
- ?line {'EXIT',_} =
+ {'EXIT',_} =
(catch evaluate(<<"<<17/binary-unit:8-unit:16>>.">>, [])),
- ?line {'EXIT',_} =
+ {'EXIT',_} =
(catch evaluate(<<"<<17:32/unsigned-signed>> = <<17:32>>.">>, [])),
- ?line {'EXIT',_} =
+ {'EXIT',_} =
(catch evaluate(<<"<<17:32/unsigned-signed>>.">>, [])),
- ?line <<17:32>> = evaluate(<<"<<17:32/signed-signed>>.">>, []),
- ?line {'EXIT',_} =
+ <<17:32>> = evaluate(<<"<<17:32/signed-signed>>.">>, []),
+ {'EXIT',_} =
(catch evaluate(<<"<<32/unit:8>>.">>, [])),
ok.
-otp_5435(doc) ->
- ["OTP-5435. sys_pre_expand not in the path."];
-otp_5435(suite) ->
- [];
+%% OTP-5435. sys_pre_expand not in the path.
otp_5435(Config) when is_list(Config) ->
- ?line true = <<103133:64/float>> =:=
+ true = <<103133:64/float>> =:=
evaluate(<<"<<103133:64/float>> = <<103133:64/float>>.">>, []),
- ?line true = <<103133.0:64/float>> =:=
+ true = <<103133.0:64/float>> =:=
evaluate(<<"<<103133.0:64/float>> = <<103133:64/float>>.">>, []),
- ?line true = is_alive(),
- ?line {ok, Node} = start_node(shell_SUITE_otp_5435),
- ?line ok = rpc:call(Node, ?MODULE, otp_5435_2, []),
- ?line ?t:stop_node(Node),
+ true = is_alive(),
+ {ok, Node} = start_node(shell_SUITE_otp_5435),
+ ok = rpc:call(Node, ?MODULE, otp_5435_2, []),
+ test_server:stop_node(Node),
ok.
-
+
start_node(Name) ->
- ?line PA = filename:dirname(code:which(?MODULE)),
- ?t:start_node(Name, slave, [{args, "-pa " ++ PA}]).
+ PA = filename:dirname(code:which(?MODULE)),
+ test_server:start_node(Name, slave, [{args, "-pa " ++ PA}]).
otp_5435_2() ->
- ?line true = code:del_path(compiler),
+ true = code:del_path(compiler),
%% sys_pre_expand can no longer be found
%% OTP-5876. But erl_expand_records can!
- ?line [{attribute,_,record,{bar,_}},ok] =
+ [{attribute,_,record,{bar,_}},ok] =
scan(<<"rd(foo,{bar}),
rd(bar,{foo = (#foo{})#foo.bar}),
- rl(bar).">>),
+ rl(bar).">>),
ok.
-otp_5195(doc) ->
- ["OTP-5195. QLC, mostly."];
-otp_5195(suite) ->
- [];
+%% OTP-5195. QLC, mostly.
otp_5195(Config) when is_list(Config) ->
%% QLC. It was easier to put these cases here than in qlc_SUITE.
- ?line "[#a{b = undefined}].\n" =
+ "[#a{b = undefined}].\n" =
t(<<"rd(a,{b}), qlc:e(qlc:q([X || X <- [#a{}],is_record(X, a)])).">>),
%% An experimental shell used to translate error tuples:
@@ -642,570 +610,556 @@ otp_5195(Config) when is_list(Config) ->
%% "list expression\".\n" =
%% t(<<"qlc:q([X || X <- [{a}], Y <- [X]]).">>),
%% Same as last one (if the shell does not translate error tuples):
- ?line [{error,qlc,{1,qlc,{used_generator_variable,'X'}}}] =
+ [{error,qlc,{1,qlc,{used_generator_variable,'X'}}}] =
scan(<<"qlc:q([X || X <- [{a}], Y <- [X]]).">>),
- ?line {error,qlc,{1,qlc,{used_generator_variable,'X'}}} =
+ {error,qlc,{1,qlc,{used_generator_variable,'X'}}} =
evaluate(<<"qlc:q([X || X <- [{a}], Y <- [X]]).">>, []),
Ugly = <<"qlc:e(qlc:q([X || X <- qlc:append([[1,2,3],ugly()])])).">>,
- ?line "undefined shell command ugly/0" = error_string(Ugly),
- ?line {'EXIT',{undef,_}} = (catch evaluate(Ugly, [])),
+ "undefined shell command ugly/0" = error_string(Ugly),
+ {'EXIT',{undef,_}} = (catch evaluate(Ugly, [])),
V_1 = <<"qlc:e(qlc:q([X || X <- qlc:append([[1,2,3],v(-1)])])).">>,
- ?line "- 1: command not found" = comm_err(V_1),
- ?line {'EXIT', {undef,_}} = (catch evaluate(V_1, [])),
+ "- 1: command not found" = comm_err(V_1),
+ {'EXIT', {undef,_}} = (catch evaluate(V_1, [])),
- ?line "1\n2\n3\n3.\n" =
+ "1\n2\n3\n3.\n" =
t(<<"1. 2. 3. 3 = fun(A) when A =:= 2 -> v(3) end(v(2)).">>),
- ?line List4 = t(<<"[a,list]. A = [1,2]. "
- "qlc:q([X || X <- qlc:append(A, v(1))]). "
- "[1,2,a,list] = qlc:e(v(-1)).">>),
- ?line "[1,2,a,list].\n" = string:substr(List4, string:len(List4)-13),
+ List4 = t(<<"[a,list]. A = [1,2]. "
+ "qlc:q([X || X <- qlc:append(A, v(1))]). "
+ "[1,2,a,list] = qlc:e(v(-1)).">>),
+ "[1,2,a,list].\n" = string:substr(List4, string:len(List4)-13),
ok.
-otp_5915(doc) ->
- ["OTP-5915. Strict record tests in guards."];
-otp_5915(suite) ->
- [];
+%% OTP-5915. Strict record tests in guards.
otp_5915(Config) when is_list(Config) ->
C = <<"
rd(r, {a = 4,b}),
- rd(r1, {a,b}),
- rd(r2, {a = #r1{},b,c=length([1,2,3])}),
- rd(r3, {a = fun(_) -> #r1{} end(1), b}),
-
- foo = fun(A) when A#r1.a > A#r1.b -> foo end(#r1{b = 2}),
- 0 = fun(A) when A#r2.a -> 0 end(#r2{a = true}),
- 1 = fun(A) when (#r1{a = A})#r1.a > 2 -> 1 end(3),
- 2 = fun(N) when ((#r2{a = #r{a = 4}, b = length([a,b,c])})#r2.a)#r.a > N ->
- 2 end(2),
- 3 = fun(A) when (A#r2.a)#r1.a =:= 3 -> 3 end(#r2{a = #r1{a = 3}}),
- ok = fun() ->
- F = fun(A) when record(A#r.a, r1) -> 4;
- (A) when record(A#r1.a, r1) -> 5
- end,
- 5 = F(#r1{a = #r1{}}),
- 4 = F(#r{a = #r1{}}),
- ok
- end(),
- 3 = fun(A) when record(A#r1.a, r),
- (A#r1.a)#r.a > 3 -> 3
- end(#r1{a = #r{a = 4}}),
- 7 = fun(A) when record(A#r3.a, r1) -> 7 end(#r3{}),
- [#r1{a = 2,b = 1}] =
- fun() ->
- [A || A <- [#r1{a = 1, b = 3},
- #r2{a = 2,b = 1},
- #r1{a = 2, b = 1}],
- A#r1.a >
- A#r1.b]
- end(),
- {[_],b} =
- fun(L) ->
+ rd(r1, {a,b}),
+ rd(r2, {a = #r1{},b,c=length([1,2,3])}),
+ rd(r3, {a = fun(_) -> #r1{} end(1), b}),
+
+ foo = fun(A) when A#r1.a > A#r1.b -> foo end(#r1{b = 2}),
+ 0 = fun(A) when A#r2.a -> 0 end(#r2{a = true}),
+ 1 = fun(A) when (#r1{a = A})#r1.a > 2 -> 1 end(3),
+ 2 = fun(N) when ((#r2{a = #r{a = 4}, b = length([a,b,c])})#r2.a)#r.a > N ->
+ 2 end(2),
+ 3 = fun(A) when (A#r2.a)#r1.a =:= 3 -> 3 end(#r2{a = #r1{a = 3}}),
+ ok = fun() ->
+ F = fun(A) when record(A#r.a, r1) -> 4;
+ (A) when record(A#r1.a, r1) -> 5
+ end,
+ 5 = F(#r1{a = #r1{}}),
+ 4 = F(#r{a = #r1{}}),
+ ok
+ end(),
+ 3 = fun(A) when record(A#r1.a, r),
+ (A#r1.a)#r.a > 3 -> 3
+ end(#r1{a = #r{a = 4}}),
+ 7 = fun(A) when record(A#r3.a, r1) -> 7 end(#r3{}),
+ [#r1{a = 2,b = 1}] =
+ fun() ->
+ [A || A <- [#r1{a = 1, b = 3},
+ #r2{a = 2,b = 1},
+ #r1{a = 2, b = 1}],
+ A#r1.a >
+ A#r1.b]
+ end(),
+ {[_],b} =
+ fun(L) ->
%% A is checked only once:
- R1 = [{A,B} || A <- L, A#r1.a, B <- L, A#r1.b],
- A = #r2{a = true},
+ R1 = [{A,B} || A <- L, A#r1.a, B <- L, A#r1.b],
+ A = #r2{a = true},
%% A is checked again:
- B = if A#r1.a -> a; true -> b end,
- {R1,B}
- end([#r1{a = true, b = true}]),
-
- p = fun(A) when (A#r1.a =:= 2) or (A#r2.a =:= 1) -> o;
- (_) -> p
- end(#r1{a = 2}),
-
- o = fun(A) when (A#r1.a =:= 2) orelse (A#r2.a =:= 1) -> o;
- (_) -> p
- end(#r1{a = 2}),
-
- 3 = fun(A) when A#r1.a > 3,
- record(A, r1) -> 3
- end(#r1{a = 5}),
-
- ok = fun() ->
- F = fun(A) when (A#r2.a =:= 1) orelse (A#r2.a) -> 2;
- (A) when (A#r1.a =:= 1) orelse (A#r1.a) -> 1;
- (A) when (A#r2.a =:= 2) andalso (A#r2.b) -> 3
- end,
- 1 = F(#r1{a = 1}),
- 2 = F(#r2{a = true}),
- 3 = F(#r2{a = 2, b = true}),
- ok
- end(),
-
- b = fun(A) when false or not (A#r.a =:= 1) -> a;
- (_) -> b
- end(#r1{a = 1}),
- b = fun(A) when not (A#r.a =:= 1) or false -> a;
- (_) -> b
- end(#r1{a = 1}),
-
- ok = fun() ->
- F = fun(A) when not (A#r.a =:= 1) -> yes;
- (_) -> no
- end,
- no = F(#r1{a = 2}),
- yes = F(#r{a = 2}),
- no = F(#r{a = 1}),
- ok
- end(),
-
- a = fun(A) when record(A, r),
- A#r.a =:= 1,
- A#r.b =:= 2 ->a
- end(#r{a = 1, b = 2}),
- a = fun(A) when erlang:is_record(A, r),
- A#r.a =:= 1,
- A#r.b =:= 2 -> a
- end(#r{a = 1, b = 2}),
- a = fun(A) when is_record(A, r),
- A#r.a =:= 1,
- A#r.b =:= 2 -> a
- end(#r{a = 1, b = 2}),
-
- nop = fun(A) when (is_record(A, r1) and (A#r1.a > 3)) or (A#r2.a < 1) ->
- japp;
- (_) ->
- nop
- end(#r2{a = 0}),
- nop = fun(A) when (A#r1.a > 3) or (A#r2.a < 1) -> japp;
- (_) ->
- nop
- end(#r2{a = 0}),
-
- ok = fun() ->
- F = fun(A) when (A#r1.a =:= 2) or (A#r2.a =:= 1) -> o;
- (_) -> p
- end,
- p = F(#r2{a = 1}),
- p = F(#r1{a = 2}),
- ok
- end(),
-
- ok = fun() ->
- F = fun(A) when fail, A#r1.a; A#r1.a -> ab;
- (_) -> bu
- end,
- ab = F(#r1{a = true}),
- bu = F(#r2{a = true}),
- ok
- end(),
-
- both = fun(A) when A#r.a, A#r.b -> both
- end(#r{a = true, b = true}),
-
- ok = fun() ->
- F = fun(A, B) when ((A#r1.a) orelse (B#r2.a))
- or (B#r2.b) or (A#r1.b) -> true;
- (_, _) -> false
- end,
- true = F(#r1{a = false, b = false}, #r2{a = false, b = true}),
- false = F(#r1{a = true, b = true}, #r1{a = false, b = true}),
- ok
- end(),
-
- ok.">>,
+ B = if A#r1.a -> a; true -> b end,
+ {R1,B}
+ end([#r1{a = true, b = true}]),
+
+ p = fun(A) when (A#r1.a =:= 2) or (A#r2.a =:= 1) -> o;
+ (_) -> p
+ end(#r1{a = 2}),
+
+ o = fun(A) when (A#r1.a =:= 2) orelse (A#r2.a =:= 1) -> o;
+ (_) -> p
+ end(#r1{a = 2}),
+
+ 3 = fun(A) when A#r1.a > 3,
+ record(A, r1) -> 3
+ end(#r1{a = 5}),
+
+ ok = fun() ->
+ F = fun(A) when (A#r2.a =:= 1) orelse (A#r2.a) -> 2;
+ (A) when (A#r1.a =:= 1) orelse (A#r1.a) -> 1;
+ (A) when (A#r2.a =:= 2) andalso (A#r2.b) -> 3
+ end,
+ 1 = F(#r1{a = 1}),
+ 2 = F(#r2{a = true}),
+ 3 = F(#r2{a = 2, b = true}),
+ ok
+ end(),
+
+ b = fun(A) when false or not (A#r.a =:= 1) -> a;
+ (_) -> b
+ end(#r1{a = 1}),
+ b = fun(A) when not (A#r.a =:= 1) or false -> a;
+ (_) -> b
+ end(#r1{a = 1}),
+
+ ok = fun() ->
+ F = fun(A) when not (A#r.a =:= 1) -> yes;
+ (_) -> no
+ end,
+ no = F(#r1{a = 2}),
+ yes = F(#r{a = 2}),
+ no = F(#r{a = 1}),
+ ok
+ end(),
+
+ a = fun(A) when record(A, r),
+ A#r.a =:= 1,
+ A#r.b =:= 2 ->a
+ end(#r{a = 1, b = 2}),
+ a = fun(A) when erlang:is_record(A, r),
+ A#r.a =:= 1,
+ A#r.b =:= 2 -> a
+ end(#r{a = 1, b = 2}),
+ a = fun(A) when is_record(A, r),
+ A#r.a =:= 1,
+ A#r.b =:= 2 -> a
+ end(#r{a = 1, b = 2}),
+
+ nop = fun(A) when (is_record(A, r1) and (A#r1.a > 3)) or (A#r2.a < 1) ->
+ japp;
+ (_) ->
+ nop
+ end(#r2{a = 0}),
+ nop = fun(A) when (A#r1.a > 3) or (A#r2.a < 1) -> japp;
+ (_) ->
+ nop
+ end(#r2{a = 0}),
+
+ ok = fun() ->
+ F = fun(A) when (A#r1.a =:= 2) or (A#r2.a =:= 1) -> o;
+ (_) -> p
+ end,
+ p = F(#r2{a = 1}),
+ p = F(#r1{a = 2}),
+ ok
+ end(),
+
+ ok = fun() ->
+ F = fun(A) when fail, A#r1.a; A#r1.a -> ab;
+ (_) -> bu
+ end,
+ ab = F(#r1{a = true}),
+ bu = F(#r2{a = true}),
+ ok
+ end(),
+
+ both = fun(A) when A#r.a, A#r.b -> both
+ end(#r{a = true, b = true}),
+
+ ok = fun() ->
+ F = fun(A, B) when ((A#r1.a) orelse (B#r2.a))
+ or (B#r2.b) or (A#r1.b) -> true;
+ (_, _) -> false
+ end,
+ true = F(#r1{a = false, b = false}, #r2{a = false, b = true}),
+ false = F(#r1{a = true, b = true}, #r1{a = false, b = true}),
+ ok
+ end(),
+
+ ok.">>,
[ok] = scan(C),
- ok.
+ ok.
-otp_5916(doc) ->
- ["OTP-5916. erlang:is_record/3 allowed in guards."];
-otp_5916(suite) ->
- [];
+%% OTP-5916. erlang:is_record/3 allowed in guards.
otp_5916(Config) when is_list(Config) ->
C = <<"
rd(r1, {a,b}),
- rd(r2, {a,b}),
+ rd(r2, {a,b}),
- true = if erlang:is_record(#r1{},r1,3) -> true; true -> false end,
- false = if erlang:is_record(#r2{},r1,3) -> true; true -> false end,
+ true = if erlang:is_record(#r1{},r1,3) -> true; true -> false end,
+ false = if erlang:is_record(#r2{},r1,3) -> true; true -> false end,
- true = if is_record(#r1{},r1,3) -> true; true -> false end,
- false = if is_record(#r2{},r1,3) -> true; true -> false end,
+ true = if is_record(#r1{},r1,3) -> true; true -> false end,
+ false = if is_record(#r2{},r1,3) -> true; true -> false end,
- ok.">>,
+ ok.">>,
[ok] = scan(C),
- ok.
+ ok.
-bs_match_misc_SUITE(doc) ->
- ["OTP-5327. Adopted from parts of emulator/test/bs_match_misc_SUITE.erl."];
-bs_match_misc_SUITE(suite) ->
- [];
+%% OTP-5327. Adopted from parts of emulator/test/bs_match_misc_SUITE.erl.
bs_match_misc_SUITE(Config) when is_list(Config) ->
C = <<"
F1 = fun() -> 3.1415 end,
- FOne = fun() -> 1.0 end,
-
- Fcmp = fun(F1, F2) when (F1 - F2) / F2 < 0.0000001 -> ok end,
-
- MakeSubBin = fun(Bin0) ->
- Sz = size(Bin0),
- Bin1 = <<37,Bin0/binary,38,39>>,
- <<_:8,Bin:Sz/binary,_:8,_:8>> = Bin1,
- Bin
- end,
-
- MatchFloat =
- fun(Bin0, Fsz, I) ->
- Bin = MakeSubBin(Bin0),
- Bsz = size(Bin) * 8,
- Tsz = Bsz - Fsz - I,
- <<_:I,F:Fsz/float,_:Tsz>> = Bin,
- F
- end,
-
- TFloat = fun() ->
- F = F1(),
- G = FOne(),
-
- G = MatchFloat(<<63,128,0,0>>, 32, 0),
- G = MatchFloat(<<63,240,0,0,0,0,0,0>>, 64, 0),
-
- Fcmp(F, MatchFloat(<<F:32/float>>, 32, 0)),
- Fcmp(F, MatchFloat(<<F:64/float>>, 64, 0)),
- Fcmp(F, MatchFloat(<<1:1,F:32/float,127:7>>, 32, 1)),
- Fcmp(F, MatchFloat(<<1:1,F:64/float,127:7>>, 64, 1)),
- Fcmp(F, MatchFloat(<<1:13,F:32/float,127:3>>, 32, 13)),
- Fcmp(F, MatchFloat(<<1:13,F:64/float,127:3>>, 64, 13))
- end,
- TFloat(),
-
- F2 = fun() -> 2.7133 end,
-
- MatchFloatLittle = fun(Bin0, Fsz, I) ->
- Bin = MakeSubBin(Bin0),
- Bsz = size(Bin) * 8,
- Tsz = Bsz - Fsz - I,
- <<_:I,F:Fsz/float-little,_:Tsz>> = Bin,
- F
- end,
-
- LittleFloat = fun() ->
- F = F2(),
- G = FOne(),
-
- G = MatchFloatLittle(<<0,0,0,0,0,0,240,63>>, 64, 0),
- G = MatchFloatLittle(<<0,0,128,63>>, 32, 0),
-
- Fcmp(F, MatchFloatLittle(<<F:32/float-little>>, 32, 0)),
- Fcmp(F, MatchFloatLittle(<<F:64/float-little>>, 64, 0)),
- Fcmp(F, MatchFloatLittle(<<1:1,F:32/float-little,127:7>>, 32, 1)),
- Fcmp(F, MatchFloatLittle(<<1:1,F:64/float-little,127:7>>, 64, 1)),
- Fcmp(F, MatchFloatLittle(<<1:13,F:32/float-little,127:3>>, 32, 13)),
- Fcmp(F, MatchFloatLittle(<<1:13,F:64/float-little,127:3>>, 64, 13))
- end,
- LittleFloat(),
-
- Sean1 = fun(<<B/binary>>) when size(B) < 4 -> small;
- (<<1, _B/binary>>) -> large
- end,
-
- Sean = fun() ->
- small = Sean1(<<>>),
- small = Sean1(<<1>>),
- small = Sean1(<<1,2>>),
- small = Sean1(<<1,2,3>>),
- large = Sean1(<<1,2,3,4>>),
-
- small = Sean1(<<4>>),
- small = Sean1(<<4,5>>),
- small = Sean1(<<4,5,6>>),
- {'EXIT',{function_clause,_}} = (catch Sean1(<<4,5,6,7>>))
- end,
- Sean(),
-
- NativeBig = fun() ->
- <<37.33:64/native-float>> = <<37.33:64/big-float>>,
- <<3974:16/native-integer>> = <<3974:16/big-integer>>
- end,
-
- NativeLittle = fun() ->
- <<37869.32343:64/native-float>> = <<37869.32343:64/little-float>>,
- <<7974:16/native-integer>> = <<7974:16/little-integer>>
- end,
-
- Native = fun() ->
- <<3.14:64/native-float>> = <<3.14:64/native-float>>,
- <<333:16/native>> = <<333:16/native>>,
- <<38658345:32/native>> = <<38658345:32/native>>,
- case <<1:16/native>> of
- <<0,1>> -> NativeBig();
- <<1,0>> -> NativeLittle()
- end
- end,
- Native(),
-
- Split = fun(<<N:16,B:N/binary,T/binary>>) -> {B,T} end,
-
- Split2 = fun(N, <<N:16,B:N/binary,T/binary>>) -> {B,T} end,
-
- Split_2 = fun(<<N0:8,N:N0,B:N/binary,T/binary>>) -> {B,T} end,
-
- Skip = fun(<<N:8,_:N/binary,T/binary>>) -> T end,
-
- SizeVar = fun() ->
- {<<45>>,<<>>} = Split(<<1:16,45>>),
- {<<45>>,<<46,47>>} = Split(<<1:16,45,46,47>>),
- {<<45,46>>,<<47>>} = Split(<<2:16,45,46,47>>),
-
- {<<45,46,47>>,<<48>>} = Split_2(<<16:8,3:16,45,46,47,48>>),
-
- {<<45,46>>,<<47>>} = Split2(2, <<2:16,45,46,47>>),
- {'EXIT',{function_clause,_}} =
- (catch Split2(42, <<2:16,45,46,47>>)),
-
- <<\"cdef\">> = Skip(<<2:8,\"abcdef\">>)
+ FOne = fun() -> 1.0 end,
+
+ Fcmp = fun(F1, F2) when (F1 - F2) / F2 < 0.0000001 -> ok end,
+
+ MakeSubBin = fun(Bin0) ->
+ Sz = size(Bin0),
+ Bin1 = <<37,Bin0/binary,38,39>>,
+ <<_:8,Bin:Sz/binary,_:8,_:8>> = Bin1,
+ Bin
+ end,
+
+ MatchFloat =
+ fun(Bin0, Fsz, I) ->
+ Bin = MakeSubBin(Bin0),
+ Bsz = size(Bin) * 8,
+ Tsz = Bsz - Fsz - I,
+ <<_:I,F:Fsz/float,_:Tsz>> = Bin,
+ F
+ end,
+
+ TFloat = fun() ->
+ F = F1(),
+ G = FOne(),
+
+ G = MatchFloat(<<63,128,0,0>>, 32, 0),
+ G = MatchFloat(<<63,240,0,0,0,0,0,0>>, 64, 0),
+
+ Fcmp(F, MatchFloat(<<F:32/float>>, 32, 0)),
+ Fcmp(F, MatchFloat(<<F:64/float>>, 64, 0)),
+ Fcmp(F, MatchFloat(<<1:1,F:32/float,127:7>>, 32, 1)),
+ Fcmp(F, MatchFloat(<<1:1,F:64/float,127:7>>, 64, 1)),
+ Fcmp(F, MatchFloat(<<1:13,F:32/float,127:3>>, 32, 13)),
+ Fcmp(F, MatchFloat(<<1:13,F:64/float,127:3>>, 64, 13))
+ end,
+ TFloat(),
+
+ F2 = fun() -> 2.7133 end,
+
+ MatchFloatLittle = fun(Bin0, Fsz, I) ->
+ Bin = MakeSubBin(Bin0),
+ Bsz = size(Bin) * 8,
+ Tsz = Bsz - Fsz - I,
+ <<_:I,F:Fsz/float-little,_:Tsz>> = Bin,
+ F
+ end,
+
+ LittleFloat = fun() ->
+ F = F2(),
+ G = FOne(),
+
+ G = MatchFloatLittle(<<0,0,0,0,0,0,240,63>>, 64, 0),
+ G = MatchFloatLittle(<<0,0,128,63>>, 32, 0),
+
+ Fcmp(F, MatchFloatLittle(<<F:32/float-little>>, 32, 0)),
+ Fcmp(F, MatchFloatLittle(<<F:64/float-little>>, 64, 0)),
+ Fcmp(F, MatchFloatLittle(<<1:1,F:32/float-little,127:7>>, 32, 1)),
+ Fcmp(F, MatchFloatLittle(<<1:1,F:64/float-little,127:7>>, 64, 1)),
+ Fcmp(F, MatchFloatLittle(<<1:13,F:32/float-little,127:3>>, 32, 13)),
+ Fcmp(F, MatchFloatLittle(<<1:13,F:64/float-little,127:3>>, 64, 13))
+ end,
+ LittleFloat(),
+
+ Sean1 = fun(<<B/binary>>) when size(B) < 4 -> small;
+ (<<1, _B/binary>>) -> large
+ end,
+
+ Sean = fun() ->
+ small = Sean1(<<>>),
+ small = Sean1(<<1>>),
+ small = Sean1(<<1,2>>),
+ small = Sean1(<<1,2,3>>),
+ large = Sean1(<<1,2,3,4>>),
+
+ small = Sean1(<<4>>),
+ small = Sean1(<<4,5>>),
+ small = Sean1(<<4,5,6>>),
+ {'EXIT',{function_clause,_}} = (catch Sean1(<<4,5,6,7>>))
+ end,
+ Sean(),
+
+ NativeBig = fun() ->
+ <<37.33:64/native-float>> = <<37.33:64/big-float>>,
+ <<3974:16/native-integer>> = <<3974:16/big-integer>>
+ end,
+
+ NativeLittle = fun() ->
+ <<37869.32343:64/native-float>> = <<37869.32343:64/little-float>>,
+ <<7974:16/native-integer>> = <<7974:16/little-integer>>
+ end,
+
+ Native = fun() ->
+ <<3.14:64/native-float>> = <<3.14:64/native-float>>,
+ <<333:16/native>> = <<333:16/native>>,
+ <<38658345:32/native>> = <<38658345:32/native>>,
+ case <<1:16/native>> of
+ <<0,1>> -> NativeBig();
+ <<1,0>> -> NativeLittle()
+ end
+ end,
+ Native(),
+
+ Split = fun(<<N:16,B:N/binary,T/binary>>) -> {B,T} end,
+
+ Split2 = fun(N, <<N:16,B:N/binary,T/binary>>) -> {B,T} end,
+
+ Split_2 = fun(<<N0:8,N:N0,B:N/binary,T/binary>>) -> {B,T} end,
+
+ Skip = fun(<<N:8,_:N/binary,T/binary>>) -> T end,
+
+ SizeVar = fun() ->
+ {<<45>>,<<>>} = Split(<<1:16,45>>),
+ {<<45>>,<<46,47>>} = Split(<<1:16,45,46,47>>),
+ {<<45,46>>,<<47>>} = Split(<<2:16,45,46,47>>),
+
+ {<<45,46,47>>,<<48>>} = Split_2(<<16:8,3:16,45,46,47,48>>),
+
+ {<<45,46>>,<<47>>} = Split2(2, <<2:16,45,46,47>>),
+ {'EXIT',{function_clause,_}} =
+ (catch Split2(42, <<2:16,45,46,47>>)),
+
+ <<\"cdef\">> = Skip(<<2:8,\"abcdef\">>)
end,
- SizeVar(),
-
- Wcheck = fun(<<A>>) when A==3-> ok1;
- (<<_,_:2/binary>>) -> ok2;
- (<<_>>) -> ok3;
- (Other) -> {error,Other}
- end,
-
- Wiger = fun() ->
- ok1 = Wcheck(<<3>>),
- ok2 = Wcheck(<<1,2,3>>),
- ok3 = Wcheck(<<4>>),
- {error,<<1,2,3,4>>} = Wcheck(<<1,2,3,4>>),
- {error,<<>>} = Wcheck(<<>>)
- end,
- Wiger(),
-
- ok.
- ">>,
+ SizeVar(),
+
+ Wcheck = fun(<<A>>) when A==3-> ok1;
+ (<<_,_:2/binary>>) -> ok2;
+ (<<_>>) -> ok3;
+ (Other) -> {error,Other}
+ end,
+
+ Wiger = fun() ->
+ ok1 = Wcheck(<<3>>),
+ ok2 = Wcheck(<<1,2,3>>),
+ ok3 = Wcheck(<<4>>),
+ {error,<<1,2,3,4>>} = Wcheck(<<1,2,3,4>>),
+ {error,<<>>} = Wcheck(<<>>)
+ end,
+ Wiger(),
+
+ ok.
+">>,
[ok] = scan(C),
- ok = evaluate(C, []).
+ok = evaluate(C, []).
%% This one is not run during night builds since it takes several minutes.
-bs_match_int_SUITE(doc) ->
- ["OTP-5327. Adopted from emulator/test/bs_match_int_SUITE.erl."];
-bs_match_int_SUITE(suite) ->
- [];
+
+%% OTP-5327. Adopted from emulator/test/bs_match_int_SUITE.erl.
bs_match_int_SUITE(Config) when is_list(Config) ->
C = <<"
FunClause = fun({'EXIT',{function_clause,_}}) -> ok end,
- Mkbin = fun(L) when list(L) -> list_to_binary(L) end,
-
- GetInt1 = fun(<<I:0>>) -> I;
- (<<I:8>>) -> I;
- (<<I:16>>) -> I;
- (<<I:24>>) -> I;
- (<<I:32>>) -> I
- end,
-
- GetInt2 = fun(Bin0, I, F) when size(Bin0) < 4 ->
- Bin = <<0,Bin0/binary>>,
- I = GetInt1(Bin),
- F(Bin, I, F);
- (_, I, _F) -> I
- end,
-
- GetInt = fun(Bin) ->
- I = GetInt1(Bin),
- GetInt2(Bin, I, GetInt2)
- end,
-
-
- Cmp128 = fun(<<I:128>>, I) -> equal;
- (_, _) -> not_equal
- end,
-
- Uint2 = fun([H|T], Acc, F) -> F(T, Acc bsl 8 bor H, F);
- ([], Acc, _F) -> Acc
- end,
-
- Uint = fun(L) -> Uint2(L, 0, Uint2) end,
-
- Integer = fun() ->
- 0 = GetInt(Mkbin([])),
- 0 = GetInt(Mkbin([0])),
- 42 = GetInt(Mkbin([42])),
- 255 = GetInt(Mkbin([255])),
- 256 = GetInt(Mkbin([1,0])),
- 257 = GetInt(Mkbin([1,1])),
- 258 = GetInt(Mkbin([1,2])),
- 258 = GetInt(Mkbin([1,2])),
- 65534 = GetInt(Mkbin([255,254])),
- 16776455 = GetInt(Mkbin([255,253,7])),
- 4245492555 = GetInt(Mkbin([253,13,19,75])),
- 4294967294 = GetInt(Mkbin([255,255,255,254])),
- 4294967295 = GetInt(Mkbin([255,255,255,255])),
- Eight = [200,1,19,128,222,42,97,111],
- Cmp128(Eight, Uint(Eight)),
- FunClause(catch GetInt(Mkbin(lists:seq(1,5))))
- end,
- Integer(),
-
- Sint = fun(Bin) ->
- case Bin of
- <<I:8/signed>> -> I;
- <<I:8/signed,_:3,_:5>> -> I;
- Other -> {no_match,Other}
- end
- end,
-
- SignedInteger = fun() ->
- {no_match,_} = Sint(Mkbin([])),
- {no_match,_} = Sint(Mkbin([1,2,3])),
- 127 = Sint(Mkbin([127])),
- -1 = Sint(Mkbin([255])),
- -128 = Sint(Mkbin([128])),
- 42 = Sint(Mkbin([42,255])),
- 127 = Sint(Mkbin([127,255]))
- end,
- SignedInteger(),
-
- Dynamic5 = fun(Bin, S1, S2, A, B) ->
- case Bin of
- <<A:S1,B:S2>> ->
- % io:format(\"~p ~p ~p ~p~n\", [S1,S2,A,B]),
- ok;
- _Other -> erlang:error(badmatch, [Bin,S1,S2,A,B])
- end
- end,
-
- Dynamic2 = fun(Bin, S1, F) when S1 >= 0 ->
- S2 = size(Bin) * 8 - S1,
- Dynamic5(Bin, S1, S2, (1 bsl S1) - 1, (1 bsl S2) - 1),
- F(Bin, S1-1, F);
- (_, _, _) -> ok
- end,
-
- Dynamic = fun(Bin, S1) ->
- Dynamic2(Bin, S1, Dynamic2)
- end,
-
- Dynamic(Mkbin([255]), 8),
- Dynamic(Mkbin([255,255]), 16),
- Dynamic(Mkbin([255,255,255]), 24),
- Dynamic(Mkbin([255,255,255,255]), 32),
-
- BigToLittle4 =
- fun([B0,B1,B2,B3,B4,B5,B6,B7|T], N, Acc, F) when N >= 8 ->
- F(T, N-8, [B0,B1,B2,B3,B4,B5,B6,B7|Acc], F);
- (List, N, Acc, _F) -> lists:sublist(List, 1, N) ++ Acc
- end,
-
- BigToLittle =
- fun(List, N) -> BigToLittle4(List, N, [], BigToLittle4) end,
-
- ReversedSublist =
- fun(_List, 0, Acc, _F) -> Acc;
- ([H|T], N, Acc, F) -> F(T, N-1, [H|Acc], F)
- end,
-
- TwoComplementAndReverse =
- fun([H|T], Carry, Acc, F) ->
- Sum = 1-H+Carry,
- F(T, Sum div 2, [Sum rem 2|Acc], F);
- ([], Carry, Acc, _F) -> [Carry|Acc]
- end,
-
- MakeInt = fun(_List, 0, Acc, _F) -> Acc;
- ([H|T], N, Acc, F) -> F(T, N-1, Acc bsl 1 bor H, F)
- end,
-
- MakeSignedInt =
- fun(_List, 0) -> 0;
- ([0|_]=List, N) -> MakeInt(List, N, 0, MakeInt);
- ([1|_]=List0, N) ->
- List1 = ReversedSublist(List0, N, [], ReversedSublist),
- List2 = TwoComplementAndReverse(List1, 1, [],
- TwoComplementAndReverse),
- -MakeInt(List2, length(List2), 0, MakeInt)
- end,
-
- BitsToList =
- fun([H|T], 0, F) -> F(T, 16#80, F);
- ([H|_]=List, Mask, F) ->
- [case H band Mask of
+ Mkbin = fun(L) when list(L) -> list_to_binary(L) end,
+
+ GetInt1 = fun(<<I:0>>) -> I;
+ (<<I:8>>) -> I;
+ (<<I:16>>) -> I;
+ (<<I:24>>) -> I;
+ (<<I:32>>) -> I
+ end,
+
+ GetInt2 = fun(Bin0, I, F) when size(Bin0) < 4 ->
+ Bin = <<0,Bin0/binary>>,
+ I = GetInt1(Bin),
+ F(Bin, I, F);
+ (_, I, _F) -> I
+ end,
+
+ GetInt = fun(Bin) ->
+ I = GetInt1(Bin),
+ GetInt2(Bin, I, GetInt2)
+ end,
+
+
+ Cmp128 = fun(<<I:128>>, I) -> equal;
+ (_, _) -> not_equal
+ end,
+
+ Uint2 = fun([H|T], Acc, F) -> F(T, Acc bsl 8 bor H, F);
+ ([], Acc, _F) -> Acc
+ end,
+
+ Uint = fun(L) -> Uint2(L, 0, Uint2) end,
+
+ Integer = fun() ->
+ 0 = GetInt(Mkbin([])),
+ 0 = GetInt(Mkbin([0])),
+ 42 = GetInt(Mkbin([42])),
+ 255 = GetInt(Mkbin([255])),
+ 256 = GetInt(Mkbin([1,0])),
+ 257 = GetInt(Mkbin([1,1])),
+ 258 = GetInt(Mkbin([1,2])),
+ 258 = GetInt(Mkbin([1,2])),
+ 65534 = GetInt(Mkbin([255,254])),
+ 16776455 = GetInt(Mkbin([255,253,7])),
+ 4245492555 = GetInt(Mkbin([253,13,19,75])),
+ 4294967294 = GetInt(Mkbin([255,255,255,254])),
+ 4294967295 = GetInt(Mkbin([255,255,255,255])),
+ Eight = [200,1,19,128,222,42,97,111],
+ Cmp128(Eight, Uint(Eight)),
+ FunClause(catch GetInt(Mkbin(lists:seq(1,5))))
+ end,
+ Integer(),
+
+ Sint = fun(Bin) ->
+ case Bin of
+ <<I:8/signed>> -> I;
+ <<I:8/signed,_:3,_:5>> -> I;
+ Other -> {no_match,Other}
+ end
+ end,
+
+ SignedInteger = fun() ->
+ {no_match,_} = Sint(Mkbin([])),
+ {no_match,_} = Sint(Mkbin([1,2,3])),
+ 127 = Sint(Mkbin([127])),
+ -1 = Sint(Mkbin([255])),
+ -128 = Sint(Mkbin([128])),
+ 42 = Sint(Mkbin([42,255])),
+ 127 = Sint(Mkbin([127,255]))
+ end,
+ SignedInteger(),
+
+ Dynamic5 = fun(Bin, S1, S2, A, B) ->
+ case Bin of
+ <<A:S1,B:S2>> ->
+ %% io:format(\"~p ~p ~p ~p~n\", [S1,S2,A,B]),
+ ok;
+ _Other -> erlang:error(badmatch, [Bin,S1,S2,A,B])
+ end
+ end,
+
+ Dynamic2 = fun(Bin, S1, F) when S1 >= 0 ->
+ S2 = size(Bin) * 8 - S1,
+ Dynamic5(Bin, S1, S2, (1 bsl S1) - 1, (1 bsl S2) - 1),
+ F(Bin, S1-1, F);
+ (_, _, _) -> ok
+ end,
+
+ Dynamic = fun(Bin, S1) ->
+ Dynamic2(Bin, S1, Dynamic2)
+ end,
+
+ Dynamic(Mkbin([255]), 8),
+ Dynamic(Mkbin([255,255]), 16),
+ Dynamic(Mkbin([255,255,255]), 24),
+ Dynamic(Mkbin([255,255,255,255]), 32),
+
+ BigToLittle4 =
+ fun([B0,B1,B2,B3,B4,B5,B6,B7|T], N, Acc, F) when N >= 8 ->
+ F(T, N-8, [B0,B1,B2,B3,B4,B5,B6,B7|Acc], F);
+ (List, N, Acc, _F) -> lists:sublist(List, 1, N) ++ Acc
+ end,
+
+ BigToLittle =
+ fun(List, N) -> BigToLittle4(List, N, [], BigToLittle4) end,
+
+ ReversedSublist =
+ fun(_List, 0, Acc, _F) -> Acc;
+ ([H|T], N, Acc, F) -> F(T, N-1, [H|Acc], F)
+ end,
+
+ TwoComplementAndReverse =
+ fun([H|T], Carry, Acc, F) ->
+ Sum = 1-H+Carry,
+ F(T, Sum div 2, [Sum rem 2|Acc], F);
+ ([], Carry, Acc, _F) -> [Carry|Acc]
+ end,
+
+ MakeInt = fun(_List, 0, Acc, _F) -> Acc;
+ ([H|T], N, Acc, F) -> F(T, N-1, Acc bsl 1 bor H, F)
+ end,
+
+ MakeSignedInt =
+ fun(_List, 0) -> 0;
+ ([0|_]=List, N) -> MakeInt(List, N, 0, MakeInt);
+ ([1|_]=List0, N) ->
+ List1 = ReversedSublist(List0, N, [], ReversedSublist),
+ List2 = TwoComplementAndReverse(List1, 1, [],
+ TwoComplementAndReverse),
+ -MakeInt(List2, length(List2), 0, MakeInt)
+ end,
+
+ BitsToList =
+ fun([H|T], 0, F) -> F(T, 16#80, F);
+ ([H|_]=List, Mask, F) ->
+ [case H band Mask of
0 -> 0;
_ -> 1
- end | F(List, Mask bsr 1, F)];
- ([], _, _F) -> []
- end,
-
- MoreDynamic3 =
- fun(Action, Bin, List, Bef, Aft, F) when Bef =< Aft ->
- Action(Bin, List, Bef, Aft-Bef),
- F(Action, Bin, List, Bef, Aft-1, F);
- (_, _, _, _, _, _) -> ok
- end,
-
- MoreDynamic2 =
- fun(Action, Bin, [_|T]=List, Bef, F) ->
- MoreDynamic3(Action, Bin, List, Bef, size(Bin)*8,
- MoreDynamic3),
- F(Action, Bin, T, Bef+1, F);
- (_, _, [], _, _F) -> ok
- end,
-
- MoreDynamic1 =
- fun(Action, Bin) ->
- BitList = BitsToList(binary_to_list(Bin),16#80,BitsToList),
- MoreDynamic2(Action, Bin, BitList, 0, MoreDynamic2)
- end,
-
- MoreDynamic = fun() ->
- % Unsigned big-endian numbers.
- Unsigned = fun(Bin, List, SkipBef, N) ->
- SkipAft = 8*size(Bin) - N - SkipBef,
- <<_:SkipBef,Int:N,_:SkipAft>> = Bin,
- Int = MakeInt(List, N, 0, MakeInt)
- end,
- MoreDynamic1(Unsigned, erlang:md5(Mkbin([42]))),
+ end | F(List, Mask bsr 1, F)];
+ ([], _, _F) -> []
+ end,
+
+ MoreDynamic3 =
+ fun(Action, Bin, List, Bef, Aft, F) when Bef =< Aft ->
+ Action(Bin, List, Bef, Aft-Bef),
+ F(Action, Bin, List, Bef, Aft-1, F);
+ (_, _, _, _, _, _) -> ok
+ end,
+
+ MoreDynamic2 =
+ fun(Action, Bin, [_|T]=List, Bef, F) ->
+ MoreDynamic3(Action, Bin, List, Bef, size(Bin)*8,
+ MoreDynamic3),
+ F(Action, Bin, T, Bef+1, F);
+ (_, _, [], _, _F) -> ok
+ end,
+
+ MoreDynamic1 =
+ fun(Action, Bin) ->
+ BitList = BitsToList(binary_to_list(Bin),16#80,BitsToList),
+ MoreDynamic2(Action, Bin, BitList, 0, MoreDynamic2)
+ end,
+
+ MoreDynamic = fun() ->
+ %% Unsigned big-endian numbers.
+ Unsigned = fun(Bin, List, SkipBef, N) ->
+ SkipAft = 8*size(Bin) - N - SkipBef,
+ <<_:SkipBef,Int:N,_:SkipAft>> = Bin,
+ Int = MakeInt(List, N, 0, MakeInt)
+ end,
+ MoreDynamic1(Unsigned, erlang:md5(Mkbin([42]))),
%% Signed big-endian numbers.
- Signed = fun(Bin, List, SkipBef, N) ->
- SkipAft = 8*size(Bin) - N - SkipBef,
- <<_:SkipBef,Int:N/signed,_:SkipAft>> = Bin,
- case MakeSignedInt(List, N) of
- Int -> ok;
- Other ->
- io:format(\"Bin = ~p,\", [Bin]),
+ Signed = fun(Bin, List, SkipBef, N) ->
+ SkipAft = 8*size(Bin) - N - SkipBef,
+ <<_:SkipBef,Int:N/signed,_:SkipAft>> = Bin,
+ case MakeSignedInt(List, N) of
+ Int -> ok;
+ Other ->
+ io:format(\"Bin = ~p,\", [Bin]),
io:format(\"SkipBef = ~p, N = ~p\",
[SkipBef,N]),
- io:format(\"Expected ~p, got ~p\",
+ io:format(\"Expected ~p, got ~p\",
[Int,Other])
- end
- end,
- MoreDynamic1(Signed, erlang:md5(Mkbin([43]))),
+ end
+ end,
+ MoreDynamic1(Signed, erlang:md5(Mkbin([43]))),
%% Unsigned little-endian numbers.
- UnsLittle = fun(Bin, List, SkipBef, N) ->
- SkipAft = 8*size(Bin) - N - SkipBef,
- <<_:SkipBef,Int:N/little,_:SkipAft>> = Bin,
- Int = MakeInt(BigToLittle(List, N), N, 0,
- MakeInt)
- end,
- MoreDynamic1(UnsLittle, erlang:md5(Mkbin([44]))),
+ UnsLittle = fun(Bin, List, SkipBef, N) ->
+ SkipAft = 8*size(Bin) - N - SkipBef,
+ <<_:SkipBef,Int:N/little,_:SkipAft>> = Bin,
+ Int = MakeInt(BigToLittle(List, N), N, 0,
+ MakeInt)
+ end,
+ MoreDynamic1(UnsLittle, erlang:md5(Mkbin([44]))),
%% Signed little-endian numbers.
- SignLittle = fun(Bin, List, SkipBef, N) ->
- SkipAft = 8*size(Bin) - N - SkipBef,
- <<_:SkipBef,Int:N/signed-little,_:SkipAft>> = Bin,
- Little = BigToLittle(List, N),
- Int = MakeSignedInt(Little, N)
- end,
- MoreDynamic1(SignLittle, erlang:md5(Mkbin([45])))
- end,
- MoreDynamic(),
-
- ok.
- ">>,
+ SignLittle = fun(Bin, List, SkipBef, N) ->
+ SkipAft = 8*size(Bin) - N - SkipBef,
+ <<_:SkipBef,Int:N/signed-little,_:SkipAft>> = Bin,
+ Little = BigToLittle(List, N),
+ Int = MakeSignedInt(Little, N)
+ end,
+ MoreDynamic1(SignLittle, erlang:md5(Mkbin([45])))
+ end,
+ MoreDynamic(),
+
+ ok.
+">>,
[ok] = scan(C),
- ok = evaluate(C, []).
+ok = evaluate(C, []).
-bs_match_tail_SUITE(doc) ->
- ["OTP-5327. Adopted from emulator/test/bs_match_tail_SUITE.erl."];
-bs_match_tail_SUITE(suite) ->
- [];
+%% OTP-5327. Adopted from emulator/test/bs_match_tail_SUITE.erl.
bs_match_tail_SUITE(Config) when is_list(Config) ->
C = <<"
GetTailUsed = fun(<<A:1,T/binary>>) -> {A,T} end,
@@ -1213,13 +1167,13 @@ bs_match_tail_SUITE(Config) when is_list(Config) ->
GetTailUnused = fun(<<A:15,_/binary>>) -> A end,
GetDynTailUsed = fun(Bin, Sz) ->
- <<A:Sz,T/binary>> = Bin,
- {A,T}
+ <<A:Sz,T/binary>> = Bin,
+ {A,T}
end,
GetDynTailUnused = fun(Bin, Sz) ->
- <<A:Sz,_/binary>> = Bin,
- A
+ <<A:Sz,_/binary>> = Bin,
+ A
end,
Mkbin = fun(L) when list(L) -> list_to_binary(L) end,
@@ -1229,12 +1183,12 @@ bs_match_tail_SUITE(Config) when is_list(Config) ->
TestZeroTail2 = fun(<<_A:4,_B:4>>) -> ok end,
ZeroTail = fun() ->
- 7 = (catch TestZeroTail(Mkbin([7]))),
- {'EXIT',{function_clause,_}} =
- (catch TestZeroTail(Mkbin([1,2]))),
- {'EXIT',{function_clause,_}} =
- (catch TestZeroTail2(Mkbin([1,2,3])))
- end,
+ 7 = (catch TestZeroTail(Mkbin([7]))),
+ {'EXIT',{function_clause,_}} =
+ (catch TestZeroTail(Mkbin([1,2]))),
+ {'EXIT',{function_clause,_}} =
+ (catch TestZeroTail2(Mkbin([1,2,3])))
+ end,
ZeroTail(),
AlGetTailUsed = fun(<<A:16,T/binary>>) -> {A,T} end,
@@ -1242,45 +1196,42 @@ bs_match_tail_SUITE(Config) when is_list(Config) ->
AlGetTailUnused = fun(<<A:16,_/binary>>) -> A end,
Aligned = fun() ->
- Tail1 = Mkbin([]),
- {258,Tail1} = AlGetTailUsed(Mkbin([1,2])),
- Tail2 = Mkbin(lists:seq(1, 127)),
- {35091,Tail2} = AlGetTailUsed(Mkbin([137,19|Tail2])),
-
- 64896 = AlGetTailUnused(Mkbin([253,128])),
- 64895 = AlGetTailUnused(Mkbin([253,127|lists:seq(42, 255)])),
-
- Tail3 = Mkbin(lists:seq(0, 19)),
- {0,Tail1} = GetDynTailUsed(Tail1, 0),
- {0,Tail3} = GetDynTailUsed(Mkbin([Tail3]), 0),
- {73,Tail3} = GetDynTailUsed(Mkbin([73|Tail3]), 8),
-
- 0 = GetDynTailUnused(Mkbin([]), 0),
- 233 = GetDynTailUnused(Mkbin([233]), 8),
- 23 = GetDynTailUnused(Mkbin([23,22,2]), 8)
- end,
+ Tail1 = Mkbin([]),
+ {258,Tail1} = AlGetTailUsed(Mkbin([1,2])),
+ Tail2 = Mkbin(lists:seq(1, 127)),
+ {35091,Tail2} = AlGetTailUsed(Mkbin([137,19|Tail2])),
+
+ 64896 = AlGetTailUnused(Mkbin([253,128])),
+ 64895 = AlGetTailUnused(Mkbin([253,127|lists:seq(42, 255)])),
+
+ Tail3 = Mkbin(lists:seq(0, 19)),
+ {0,Tail1} = GetDynTailUsed(Tail1, 0),
+ {0,Tail3} = GetDynTailUsed(Mkbin([Tail3]), 0),
+ {73,Tail3} = GetDynTailUsed(Mkbin([73|Tail3]), 8),
+
+ 0 = GetDynTailUnused(Mkbin([]), 0),
+ 233 = GetDynTailUnused(Mkbin([233]), 8),
+ 23 = GetDynTailUnused(Mkbin([23,22,2]), 8)
+ end,
Aligned(),
-
+
UnAligned = fun() ->
- {'EXIT',{function_clause,_}} =
- (catch GetTailUsed(Mkbin([42]))),
- {'EXIT',{{badmatch,_},_}} =
- (catch GetDynTailUsed(Mkbin([137]), 3)),
- {'EXIT',{function_clause,_}} =
- (catch GetTailUnused(Mkbin([42,33]))),
- {'EXIT',{{badmatch,_},_}} =
- (catch GetDynTailUnused(Mkbin([44]), 7))
- end,
+ {'EXIT',{function_clause,_}} =
+ (catch GetTailUsed(Mkbin([42]))),
+ {'EXIT',{{badmatch,_},_}} =
+ (catch GetDynTailUsed(Mkbin([137]), 3)),
+ {'EXIT',{function_clause,_}} =
+ (catch GetTailUnused(Mkbin([42,33]))),
+ {'EXIT',{{badmatch,_},_}} =
+ (catch GetDynTailUnused(Mkbin([44]), 7))
+ end,
UnAligned(),
ok.
- ">>,
+">>,
[ok] = scan(C),
- ok = evaluate(C, []).
+ok = evaluate(C, []).
-bs_match_bin_SUITE(doc) ->
- ["OTP-5327. Adopted from emulator/test/bs_match_bin_SUITE.erl."];
-bs_match_bin_SUITE(suite) ->
- [];
+%% OTP-5327. Adopted from emulator/test/bs_match_bin_SUITE.erl.
bs_match_bin_SUITE(Config) when is_list(Config) ->
ByteSplitBinary =
<<"ByteSplit =
@@ -1290,252 +1241,249 @@ bs_match_bin_SUITE(Config) when is_list(Config) ->
<<B1:Sz1/binary,B2:Sz2/binary>> = B,
B1 = list_to_binary(lists:sublist(L, 1, Pos)),
B2 = list_to_binary(lists:nthtail(Pos, L)),
- Fun(L, B, Pos-1, Fun);
- (L, B, _, _Fun) -> ok
- end,
- Mkbin = fun(L) when list(L) -> list_to_binary(L) end,
- L = lists:seq(0, 57),
- B = Mkbin(L),
- ByteSplit(L, B, size(B), ByteSplit),
- Id = fun(I) -> I end,
- MakeUnalignedSubBinary =
- fun(Bin0) ->
- Bin1 = <<0:3,Bin0/binary,31:5>>,
- Sz = size(Bin0),
- <<0:3,Bin:Sz/binary,31:5>> = Id(Bin1),
- Bin
+ Fun(L, B, Pos-1, Fun);
+ (L, B, _, _Fun) -> ok
end,
- Unaligned = MakeUnalignedSubBinary(B),
- ByteSplit(L, Unaligned, size(Unaligned), ByteSplit),
- ok.
- ">>,
+ Mkbin = fun(L) when list(L) -> list_to_binary(L) end,
+ L = lists:seq(0, 57),
+ B = Mkbin(L),
+ ByteSplit(L, B, size(B), ByteSplit),
+ Id = fun(I) -> I end,
+ MakeUnalignedSubBinary =
+ fun(Bin0) ->
+ Bin1 = <<0:3,Bin0/binary,31:5>>,
+ Sz = size(Bin0),
+ <<0:3,Bin:Sz/binary,31:5>> = Id(Bin1),
+ Bin
+ end,
+ Unaligned = MakeUnalignedSubBinary(B),
+ ByteSplit(L, Unaligned, size(Unaligned), ByteSplit),
+ ok.
+">>,
[ok] = scan(ByteSplitBinary),
- ok = evaluate(ByteSplitBinary, []),
- BitSplitBinary =
- <<"Mkbin = fun(L) when list(L) -> list_to_binary(L) end,
+ok = evaluate(ByteSplitBinary, []),
+BitSplitBinary =
+<<"Mkbin = fun(L) when list(L) -> list_to_binary(L) end,
MakeInt =
- fun(List, 0, Acc, _F) -> Acc;
- ([H|T], N, Acc, F) -> F(T, N-1, Acc bsl 1 bor H, F)
- end,
-
- MakeBinFromList =
- fun(List, 0, _F) -> Mkbin([]);
- (List, N, F) ->
- list_to_binary([MakeInt(List, 8, 0, MakeInt),
- F(lists:nthtail(8, List), N-8, F)])
- end,
-
- BitSplitBinary3 =
- fun(Action, Bin, List, Bef, Aft, F) when Bef =< Aft ->
- Action(Bin, List, Bef, (Aft-Bef) div 8 * 8),
- F(Action, Bin, List, Bef, Aft-8, F);
- (_, _, _, _, _, _) -> ok
- end,
-
- BitSplitBinary2 =
- fun(Action, Bin, [_|T]=List, Bef, F) ->
- BitSplitBinary3(Action, Bin, List, Bef, size(Bin)*8,
- BitSplitBinary3),
- F(Action, Bin, T, Bef+1, F);
- (Action, Bin, [], Bef, F) -> ok
- end,
-
- BitsToList =
- fun([H|T], 0, F) -> F(T, 16#80, F);
- ([H|_]=List, Mask, F) ->
- [case H band Mask of
- 0 -> 0;
- _ -> 1
- end | F(List, Mask bsr 1, F)];
- ([], _, _F) -> []
- end,
-
- BitSplitBinary1 =
- fun(Action, Bin) ->
- BitList = BitsToList(binary_to_list(Bin), 16#80,
- BitsToList),
- BitSplitBinary2(Action, Bin, BitList, 0, BitSplitBinary2)
- end,
-
- Fun = fun(Bin, List, SkipBef, N) ->
- SkipAft = 8*size(Bin) - N - SkipBef,
- <<I1:SkipBef,OutBin:N/binary-unit:1,I2:SkipAft>> = Bin,
- OutBin = MakeBinFromList(List, N, MakeBinFromList)
- end,
-
- BitSplitBinary1(Fun, erlang:md5(<<1,2,3>>)),
- Id = fun(I) -> I end,
- MakeUnalignedSubBinary =
- fun(Bin0) ->
- Bin1 = <<0:3,Bin0/binary,31:5>>,
- Sz = size(Bin0),
- <<0:3,Bin:Sz/binary,31:5>> = Id(Bin1),
- Bin
- end,
- BitSplitBinary1(Fun, MakeUnalignedSubBinary(erlang:md5(<<1,2,3>>))),
- ok.
- ">>,
+ fun(List, 0, Acc, _F) -> Acc;
+ ([H|T], N, Acc, F) -> F(T, N-1, Acc bsl 1 bor H, F)
+ end,
+
+ MakeBinFromList =
+ fun(List, 0, _F) -> Mkbin([]);
+ (List, N, F) ->
+ list_to_binary([MakeInt(List, 8, 0, MakeInt),
+ F(lists:nthtail(8, List), N-8, F)])
+ end,
+
+ BitSplitBinary3 =
+ fun(Action, Bin, List, Bef, Aft, F) when Bef =< Aft ->
+ Action(Bin, List, Bef, (Aft-Bef) div 8 * 8),
+ F(Action, Bin, List, Bef, Aft-8, F);
+ (_, _, _, _, _, _) -> ok
+ end,
+
+ BitSplitBinary2 =
+ fun(Action, Bin, [_|T]=List, Bef, F) ->
+ BitSplitBinary3(Action, Bin, List, Bef, size(Bin)*8,
+ BitSplitBinary3),
+ F(Action, Bin, T, Bef+1, F);
+ (Action, Bin, [], Bef, F) -> ok
+ end,
+
+ BitsToList =
+ fun([H|T], 0, F) -> F(T, 16#80, F);
+ ([H|_]=List, Mask, F) ->
+ [case H band Mask of
+ 0 -> 0;
+ _ -> 1
+ end | F(List, Mask bsr 1, F)];
+ ([], _, _F) -> []
+ end,
+
+ BitSplitBinary1 =
+ fun(Action, Bin) ->
+ BitList = BitsToList(binary_to_list(Bin), 16#80,
+ BitsToList),
+ BitSplitBinary2(Action, Bin, BitList, 0, BitSplitBinary2)
+ end,
+
+ Fun = fun(Bin, List, SkipBef, N) ->
+ SkipAft = 8*size(Bin) - N - SkipBef,
+ <<I1:SkipBef,OutBin:N/binary-unit:1,I2:SkipAft>> = Bin,
+ OutBin = MakeBinFromList(List, N, MakeBinFromList)
+ end,
+
+ BitSplitBinary1(Fun, erlang:md5(<<1,2,3>>)),
+ Id = fun(I) -> I end,
+ MakeUnalignedSubBinary =
+ fun(Bin0) ->
+ Bin1 = <<0:3,Bin0/binary,31:5>>,
+ Sz = size(Bin0),
+ <<0:3,Bin:Sz/binary,31:5>> = Id(Bin1),
+ Bin
+ end,
+ BitSplitBinary1(Fun, MakeUnalignedSubBinary(erlang:md5(<<1,2,3>>))),
+ ok.
+">>,
[ok] = scan(BitSplitBinary),
- ok = evaluate(BitSplitBinary, []).
+ok = evaluate(BitSplitBinary, []).
-define(FAIL(Expr), "{'EXIT',{badarg,_}} = (catch " ??Expr ")").
-define(COF(Int0),
"(fun(Int) ->
true = <<Int:32/float>> =:= <<(float(Int)):32/float>>,
- true = <<Int:64/float>> =:= <<(float(Int)):64/float>>
- end)(Nonliteral(" ??Int0 ")),
- true = <<" ??Int0 ":32/float>> =:= <<(float("??Int0")):32/float>>,
- true = <<" ??Int0 ":64/float>> =:= <<(float("??Int0")):64/float>>").
+ true = <<Int:64/float>> =:= <<(float(Int)):64/float>>
+ end)(Nonliteral(" ??Int0 ")),
+true = <<" ??Int0 ":32/float>> =:= <<(float("??Int0")):32/float>>,
+true = <<" ??Int0 ":64/float>> =:= <<(float("??Int0")):64/float>>").
-define(COF64(Int0),
"(fun(Int) ->
true = <<Int:64/float>> =:= <<(float(Int)):64/float>>
- end)(Nonliteral(" ??Int0 ")),
- true = <<" ??Int0 ":64/float>> =:= <<(float("??Int0")):64/float>>").
+ end)(Nonliteral(" ??Int0 ")),
+true = <<" ??Int0 ":64/float>> =:= <<(float("??Int0")):64/float>>").
-bs_construct_SUITE(doc) ->
- ["OTP-5327. Adopted from parts of emulator/test/bs_construct_SUITE.erl."];
-bs_construct_SUITE(suite) ->
- [];
+%% OTP-5327. Adopted from parts of emulator/test/bs_construct_SUITE.erl.
bs_construct_SUITE(Config) when is_list(Config) ->
C1 = <<"
Testf_1 = fun(W, B) -> "
?FAIL(<<42:W>>) ","
- ?FAIL(<<3.14:W/float>>) ","
- ?FAIL(<<B:W/binary>>) "
+ ?FAIL(<<3.14:W/float>>) ","
+ ?FAIL(<<B:W/binary>>) "
end,
- TestF = fun() -> "
+ TestF = fun() -> "
?FAIL(<<3.14>>) ","
- ?FAIL(<<<<1,2>>>>) ","
+ ?FAIL(<<<<1,2>>>>) ","
- ?FAIL(<<2.71/binary>>) ","
- ?FAIL(<<24334/binary>>) ","
- ?FAIL(<<24334344294788947129487129487219847/binary>>) ","
+ ?FAIL(<<2.71/binary>>) ","
+ ?FAIL(<<24334/binary>>) ","
+ ?FAIL(<<24334344294788947129487129487219847/binary>>) ","
- ?FAIL(<<<<1,2,3>>/float>>) ",
+ ?FAIL(<<<<1,2,3>>/float>>) ",
%% Negative field widths.
Testf_1(-8, <<1,2,3,4,5>>),"
?FAIL(<<42:(-16)>>) ","
- ?FAIL(<<3.14:(-8)/float>>) ","
- ?FAIL(<<<<23,56,0,2>>:(-16)/binary>>) ","
- ?FAIL(<<<<23,56,0,2>>:(2.5)/binary>>) ","
- ?FAIL(<<<<23,56,0,2>>:(anka)>>) "
+ ?FAIL(<<3.14:(-8)/float>>) ","
+ ?FAIL(<<<<23,56,0,2>>:(-16)/binary>>) ","
+ ?FAIL(<<<<23,56,0,2>>:(2.5)/binary>>) ","
+ ?FAIL(<<<<23,56,0,2>>:(anka)>>) "
end,
- TestF(),
+ TestF(),
- NotUsed1 = fun(I, BinString) -> <<I:32,BinString/binary>>, ok end,
+ NotUsed1 = fun(I, BinString) -> <<I:32,BinString/binary>>, ok end,
- NotUsed2 = fun(I, Sz) -> <<I:Sz>>, ok end,
+ NotUsed2 = fun(I, Sz) -> <<I:Sz>>, ok end,
- NotUsed3 = fun(I) -><<I:(-8)>>, ok end,
+ NotUsed3 = fun(I) -><<I:(-8)>>, ok end,
- NotUsed = fun() ->
- ok = NotUsed1(3, <<\"dum\">>),
+ NotUsed = fun() ->
+ ok = NotUsed1(3, <<\"dum\">>),
{'EXIT',{badarg,_}} = (catch NotUsed1(3, \"dum\")), "
- ?FAIL(NotUsed2(444, -2)) ","
- ?FAIL(NotUsed2(444, anka)) ","
- ?FAIL(NotUsed3(444)) "
+ ?FAIL(NotUsed2(444, -2)) ","
+ ?FAIL(NotUsed2(444, anka)) ","
+ ?FAIL(NotUsed3(444)) "
end,
- NotUsed(),
-
- InGuard3 = fun(Bin, A, B) when <<A:13,B:3>> == Bin -> 1;
- (Bin, A, B) when <<A:16,B/binary>> == Bin -> 2;
- (Bin, A, B) when <<A:14,B/float,3:2>> == Bin -> 3;
- (Bin, A, B) when {a,b,<<A:14,B/float,3:2>>} == Bin ->
- cant_happen;
- (_, _, _) -> nope
- end,
-
- InGuard = fun() ->
- 1 = InGuard3(<<16#74ad:16>>, 16#e95, 5),
- 2 = InGuard3(<<16#3A,16#F7,\"hello\">>, 16#3AF7, <<\"hello\">>),
+ NotUsed(),
+
+ InGuard3 = fun(Bin, A, B) when <<A:13,B:3>> == Bin -> 1;
+ (Bin, A, B) when <<A:16,B/binary>> == Bin -> 2;
+ (Bin, A, B) when <<A:14,B/float,3:2>> == Bin -> 3;
+ (Bin, A, B) when {a,b,<<A:14,B/float,3:2>>} == Bin ->
+ cant_happen;
+ (_, _, _) -> nope
+ end,
+
+ InGuard = fun() ->
+ 1 = InGuard3(<<16#74ad:16>>, 16#e95, 5),
+ 2 = InGuard3(<<16#3A,16#F7,\"hello\">>, 16#3AF7, <<\"hello\">>),
3 = InGuard3(<<16#FBCD:14,3.1415/float,3:2>>, 16#FBCD, 3.1415),
- nope = InGuard3(<<1>>, 42, b),
- nope = InGuard3(<<1>>, a, b),
- nope = InGuard3(<<1,2>>, 1, 1),
- nope = InGuard3(<<4,5>>, 1, 2.71),
- nope = InGuard3(<<4,5>>, 1, <<12,13>>)
- end,
- InGuard(),
+ nope = InGuard3(<<1>>, 42, b),
+ nope = InGuard3(<<1>>, a, b),
+ nope = InGuard3(<<1,2>>, 1, 1),
+ nope = InGuard3(<<4,5>>, 1, 2.71),
+ nope = InGuard3(<<4,5>>, 1, <<12,13>>)
+ end,
+ InGuard(),
- Nonliteral = fun(X) -> X end,
+ Nonliteral = fun(X) -> X end,
- CoerceToFloat = fun() -> "
+ CoerceToFloat = fun() -> "
?COF(0) ","
- ?COF(-1) ","
- ?COF(1) ","
- ?COF(42) ","
- ?COF(255) ","
- ?COF(-255) ","
- ?COF64(298748888888888888888888888883478264866528467367364766666666666666663) ","
- ?COF64(-367546729879999999999947826486652846736736476555566666663) "
+ ?COF(-1) ","
+ ?COF(1) ","
+ ?COF(42) ","
+ ?COF(255) ","
+ ?COF(-255) ","
+ ?COF64(298748888888888888888888888883478264866528467367364766666666666666663) ","
+ ?COF64(-367546729879999999999947826486652846736736476555566666663) "
end,
- CoerceToFloat(),
- ok.
- ">>,
+ CoerceToFloat(),
+ ok.
+">>,
[ok] = scan(C1),
- ok = evaluate(C1, []),
+ok = evaluate(C1, []),
- %% There is another one, lib/compiler/test/bs_construct_SUITE.erl...
- C2 = <<"
+%% There is another one, lib/compiler/test/bs_construct_SUITE.erl...
+C2 = <<"
I = fun(X) -> X end,
Fail = fun() ->
- I_minus_777 = I(-777),
- I_minus_2047 = I(-2047),
+ I_minus_777 = I(-777),
+ I_minus_2047 = I(-2047),
%% One negative field size, but the sum of field sizes will be 1 byte.
%% Make sure that we reject that properly.
- {'EXIT',{badarg,_}} = (catch <<I_minus_777:2048/unit:8,
- 57:I_minus_2047/unit:8>>),
+ {'EXIT',{badarg,_}} = (catch <<I_minus_777:2048/unit:8,
+ 57:I_minus_2047/unit:8>>),
%% Same thing, but use literals.
- {'EXIT',{badarg,_}} = (catch <<I_minus_777:2048/unit:8,
- 57:(-2047)/unit:8>>),
+ {'EXIT',{badarg,_}} = (catch <<I_minus_777:2048/unit:8,
+ 57:(-2047)/unit:8>>),
%% Bad alignment.
- I_one = I(1),
- <<1:1>> = <<2375:I_one>>,
- <<3:2>> = <<45:1,2375:I_one>>,
- <<14:4>> = <<45:1,2375:I_one,918:2>>,
- <<118:7>> = <<45:1,2375:I_one,918:5>>,
+ I_one = I(1),
+ <<1:1>> = <<2375:I_one>>,
+ <<3:2>> = <<45:1,2375:I_one>>,
+ <<14:4>> = <<45:1,2375:I_one,918:2>>,
+ <<118:7>> = <<45:1,2375:I_one,918:5>>,
%% Not numbers.
- {'EXIT',{badarg,_}} = (catch <<45:(I(not_a_number))>>),
- {'EXIT',{badarg,_}} = (catch <<13:8,45:(I(not_a_number))>>),
+ {'EXIT',{badarg,_}} = (catch <<45:(I(not_a_number))>>),
+ {'EXIT',{badarg,_}} = (catch <<13:8,45:(I(not_a_number))>>),
%% Unaligned sizes.
- BadSz = I(7),
- <<2:4>> = <<34:4>>,
- <<34:7>> = <<34:BadSz>>,
+ BadSz = I(7),
+ <<2:4>> = <<34:4>>,
+ <<34:7>> = <<34:BadSz>>,
- [] = [X || {X} <- [], X == <<3:BadSz>>],
- [] = [X || {X} <- [], X == <<3:4>>]
- end,
+ [] = [X || {X} <- [], X == <<3:BadSz>>],
+ [] = [X || {X} <- [], X == <<3:4>>]
+ end,
Fail(),
FloatBin1 = fun(F) ->
- {<<1,2,3>>,F+3.0}
- end,
+ {<<1,2,3>>,F+3.0}
+ end,
FloatBin = fun() ->
%% Some more coverage.
- {<<1,2,3>>,7.0} = FloatBin1(4)
- end,
+ {<<1,2,3>>,7.0} = FloatBin1(4)
+ end,
FloatBin(),
ok.
- ">>,
+">>,
[ok] = scan(C2),
- ok = evaluate(C2, []).
+ok = evaluate(C2, []).
evaluate(B, Vars) when is_binary(B) ->
evaluate(binary_to_list(B), Vars);
@@ -1549,60 +1497,55 @@ evaluate(Str, Vars) ->
end.
-refman_bit_syntax(doc) ->
- ["Bit syntax examples from the Reference Manual. OTP-5237."];
-refman_bit_syntax(suite) ->
- [];
+%% Bit syntax examples from the Reference Manual. OTP-5237.
refman_bit_syntax(Config) when is_list(Config) ->
%% Reference Manual "Bit Syntax Expressions"
- ?line Bin1 = <<1,17,42>>,
- ?line true = [1,17,42] =:= binary_to_list(Bin1),
- ?line Bin2 = <<"abc">>,
- ?line true = "abc" =:= binary_to_list(Bin2),
- ?line Bin3 = <<1,17,42:16>>,
- ?line true = [1,17,0,42] =:= binary_to_list(Bin3),
- ?line <<_A,_B,C:16>> = <<1,17,42:16>>,
- ?line true = C =:= 42,
- ?line <<D:16,_E,F>> = <<1,17,42:16>>,
- ?line true = D =:= 273,
- ?line true = F =:= 42,
+ Bin1 = <<1,17,42>>,
+ true = [1,17,42] =:= binary_to_list(Bin1),
+ Bin2 = <<"abc">>,
+ true = "abc" =:= binary_to_list(Bin2),
+ Bin3 = <<1,17,42:16>>,
+ true = [1,17,0,42] =:= binary_to_list(Bin3),
+ <<_A,_B,C:16>> = <<1,17,42:16>>,
+ true = C =:= 42,
+ <<D:16,_E,F>> = <<1,17,42:16>>,
+ true = D =:= 273,
+ true = F =:= 42,
<<_G,H/binary>> = <<1,17,42:16>>,
- ?line true = H =:= <<17,0,42>>,
+ true = H =:= <<17,0,42>>,
- ?line [ok] =
+ [ok] =
scan(<<"Bin1 = <<1,17,42>>,
true = [1,17,42] =:= binary_to_list(Bin1),
- Bin2 = <<\"abc\">>,
+ Bin2 = <<\"abc\">>,
true = \"abc\" =:= binary_to_list(Bin2),
Bin3 = <<1,17,42:16>>,
- true =
- [1,17,0,42] =:= binary_to_list(Bin3),
- <<A,B,C:16>> = <<1,17,42:16>>,
- true = C =:= 42,
- <<D:16,E,F>> = <<1,17,42:16>>,
- true = D =:= 273,
- true = F =:= 42,
- <<G,H/binary>> = <<1,17,42:16>>,
- true = H =:= <<17,0,42>>,
- ok.">>),
+ true =
+ [1,17,0,42] =:= binary_to_list(Bin3),
+ <<A,B,C:16>> = <<1,17,42:16>>,
+ true = C =:= 42,
+ <<D:16,E,F>> = <<1,17,42:16>>,
+ true = D =:= 273,
+ true = F =:= 42,
+ <<G,H/binary>> = <<1,17,42:16>>,
+ true = H =:= <<17,0,42>>,
+ ok.">>),
%% Binary comprehensions.
- ?line <<2,4,6>> = << << (X*2) >> || <<X>> <= << 1,2,3 >> >>,
- ok.
+ <<2,4,6>> = << << (X*2) >> || <<X>> <= << 1,2,3 >> >>,
+ ok.
-define(IP_VERSION, 4).
-define(IP_MIN_HDR_LEN, 5).
-progex_bit_syntax(doc) ->
- ["Bit syntax examples from Programming Examples. OTP-5237."];
-progex_bit_syntax(suite) ->
- [];
+
+%% Bit syntax examples from Programming Examples. OTP-5237.
progex_bit_syntax(Config) when is_list(Config) ->
Bin11 = <<1, 17, 42>>,
true = [1, 17, 42] =:= binary_to_list(Bin11),
Bin12 = <<"abc">>,
true = [97, 98, 99] =:= binary_to_list(Bin12),
-
+
A = 1, B = 17, C = 42,
Bin2 = <<A, B, C:16>>,
true = [1, 17, 00, 42] =:= binary_to_list(Bin2),
@@ -1615,10 +1558,10 @@ progex_bit_syntax(Config) when is_list(Config) ->
DgramSize = byte_size(Dgram),
case Dgram of
<<?IP_VERSION:4, HLen:4, SrvcType:8, TotLen:16,
- ID:16, Flgs:3, FragOff:13,
- TTL:8, Proto:8, HdrChkSum:16,
- SrcIP:32, DestIP:32,
- RestDgram/binary>> when HLen>=5, 4*HLen=<DgramSize ->
+ ID:16, Flgs:3, FragOff:13,
+ TTL:8, Proto:8, HdrChkSum:16,
+ SrcIP:32, DestIP:32,
+ RestDgram/binary>> when HLen>=5, 4*HLen=<DgramSize ->
OptsLen = 4*(HLen - ?IP_MIN_HDR_LEN),
<<Opts:OptsLen/binary,Data/binary>> = RestDgram,
{SrvcType, TotLen, Flgs, FragOff, ID, HdrChkSum,
@@ -1655,57 +1598,57 @@ progex_bit_syntax(Config) when is_list(Config) ->
B2 = triples_to_bin2(BL),
true = Lst =:= binary_to_list(B2),
- ?line [ok] = scan(
- <<"Bin11 = <<1, 17, 42>>,
+ [ok] = scan(
+ <<"Bin11 = <<1, 17, 42>>,
true = [1, 17, 42] =:= binary_to_list(Bin11),
- Bin12 = <<\"abc\">>,
+ Bin12 = <<\"abc\">>,
true = [97, 98, 99] =:= binary_to_list(Bin12),
- A = 1, B = 17, C = 42,
- Bin2 = <<A, B, C:16>>,
- true = [1, 17, 00, 42] =:= binary_to_list(Bin2),
- <<D:16, E, F/binary>> = Bin2,
- true = D =:= 273,
- true = E =:= 00,
- true = [42] =:= binary_to_list(F),
-
- Fun4 = fun(Dgram) ->
- DgramSize = byte_size(Dgram),
- case Dgram of
- <<4:4, HLen:4, SrvcType:8, TotLen:16,
- ID:16, Flgs:3, FragOff:13,
- TTL:8, Proto:8, HdrChkSum:16,
- SrcIP:32, DestIP:32,
- RestDgram/binary>> when HLen>=5,
- 4*HLen=<DgramSize ->
- OptsLen = 4*(HLen - 5),
- <<Opts:OptsLen/binary,Data/binary>> = RestDgram,
- {SrvcType, TotLen, Flgs, FragOff, ID, HdrChkSum,
- Proto, TTL, SrcIP, DestIP, Data, Opts};
- _ ->
- not_ok
- end
- end,
- true = Fun4(<<>>) =:= not_ok,
- true = is_tuple(Fun4(list_to_binary
- ([<<4:4,5:4>>,list_to_binary(lists:seq(1,255))]))),
-
- X = 23432324, Y = 24324234,
- <<10:7>> = <<X:1, Y:6>>,
- Z = 234324324,
- XYZ = <<X:1, Y:6, Z:1>>,
- true = [20] =:= binary_to_list(XYZ),
- Hello1 = <<\"hello\">>,
+ A = 1, B = 17, C = 42,
+ Bin2 = <<A, B, C:16>>,
+ true = [1, 17, 00, 42] =:= binary_to_list(Bin2),
+ <<D:16, E, F/binary>> = Bin2,
+ true = D =:= 273,
+ true = E =:= 00,
+ true = [42] =:= binary_to_list(F),
+
+ Fun4 = fun(Dgram) ->
+ DgramSize = byte_size(Dgram),
+ case Dgram of
+ <<4:4, HLen:4, SrvcType:8, TotLen:16,
+ ID:16, Flgs:3, FragOff:13,
+ TTL:8, Proto:8, HdrChkSum:16,
+ SrcIP:32, DestIP:32,
+ RestDgram/binary>> when HLen>=5,
+ 4*HLen=<DgramSize ->
+ OptsLen = 4*(HLen - 5),
+ <<Opts:OptsLen/binary,Data/binary>> = RestDgram,
+ {SrvcType, TotLen, Flgs, FragOff, ID, HdrChkSum,
+ Proto, TTL, SrcIP, DestIP, Data, Opts};
+ _ ->
+ not_ok
+ end
+ end,
+ true = Fun4(<<>>) =:= not_ok,
+ true = is_tuple(Fun4(list_to_binary
+ ([<<4:4,5:4>>,list_to_binary(lists:seq(1,255))]))),
+
+ X = 23432324, Y = 24324234,
+ <<10:7>> = <<X:1, Y:6>>,
+ Z = 234324324,
+ XYZ = <<X:1, Y:6, Z:1>>,
+ true = [20] =:= binary_to_list(XYZ),
+ Hello1 = <<\"hello\">>,
Hello2 = <<$h,$e,$l,$l,$o>>,
- true = \"hello\" =:= binary_to_list(Hello1),
+ true = \"hello\" =:= binary_to_list(Hello1),
true = \"hello\" =:= binary_to_list(Hello2),
FunM1 = fun(<<X1:7/binary, Y1:1/binary>>) -> {X1,Y1} end,
- true = {<<\"1234567\">>,<<\"8\">>} =:= FunM1(<<\"12345678\">>),
+ true = {<<\"1234567\">>,<<\"8\">>} =:= FunM1(<<\"12345678\">>),
FunM2 = fun(<<_X1:7/binary-unit:7, _Y1:1/binary-unit:1>>) -> ok;
(_) -> not_ok end,
- true = not_ok =:= FunM2(<<\"1\">>),
+ true = not_ok =:= FunM2(<<\"1\">>),
ok.">>),
ok.
@@ -1726,590 +1669,577 @@ triples_to_bin2([{X,Y,Z} | T], Acc) ->
triples_to_bin2([], Acc) ->
list_to_binary(lists:reverse(Acc)).
-progex_records(doc) ->
- ["Record examples from Programming Examples. OTP-5237."];
-progex_records(suite) ->
- [];
+%% Record examples from Programming Examples. OTP-5237.
progex_records(Config) when is_list(Config) ->
Test1 =
- <<"-module(recs).
+ <<"-module(recs).
-record(person, {name = \"\", phone = [], address}).
-record(name, {first = \"Robert\", last = \"Ericsson\"}).
-record(person2, {name = #name{}, phone}).
- -export([t/0]).
+-export([t/0]).
- t() ->
- _P1 = #person{phone=[0,8,2,3,4,3,1,2], name=\"Robert\"},
+t() ->
+ _P1 = #person{phone=[0,8,2,3,4,3,1,2], name=\"Robert\"},
\"Robert\" = _P1#person.name,
[0,8,2,3,4,3,1,2] = _P1#person.phone,
- undefined = _P1#person.address,
+ undefined = _P1#person.address,
- _P2 = #person{name = \"Jakob\", _ = '_'},
+ _P2 = #person{name = \"Jakob\", _ = '_'},
\"Jakob\" = _P2#person.name,
'_' = _P2#person.phone,
- '_' = _P2#person.address,
-
- P = #person{name = \"Joe\", phone = [0,8,2,3,4,3,1,2]},
+ '_' = _P2#person.address,
+
+ P = #person{name = \"Joe\", phone = [0,8,2,3,4,3,1,2]},
\"Joe\" = P#person.name,
[0,8,2,3,4,3,1,2] = P#person.phone,
- undefined = P#person.address,
+ undefined = P#person.address,
- P1 = #person{name=\"Joe\", phone=[1,2,3], address=\"A street\"},
+ P1 = #person{name=\"Joe\", phone=[1,2,3], address=\"A street\"},
P2 = P1#person{name=\"Robert\"},
\"Robert\" = P2#person.name,
[1,2,3] = P2#person.phone,
- \"A street\" = P2#person.address,
+ \"A street\" = P2#person.address,
a_person = foo(P1),
- {found, [1,2,3]} =
- find_phone([#person{name = a},
- #person{name = b, phone = [3,2,1]},
- #person{name = c, phone = [1,2,3]}],
- c),
+ {found, [1,2,3]} =
+ find_phone([#person{name = a},
+ #person{name = b, phone = [3,2,1]},
+ #person{name = c, phone = [1,2,3]}],
+ c),
- P3 = #person{name=\"Joe\", phone=[0,0,7], address=\"A street\"},
+ P3 = #person{name=\"Joe\", phone=[0,0,7], address=\"A street\"},
#person{name = Name} = P3,
- \"Joe\" = Name,
+ \"Joe\" = Name,
\"Robert\" = demo(),
ok.
- foo(P) when is_record(P, person) -> a_person;
- foo(_) -> not_a_person.
+foo(P) when is_record(P, person) -> a_person;
+foo(_) -> not_a_person.
- find_phone([#person{name=Name, phone=Phone} | _], Name) ->
- {found, Phone};
- find_phone([_| T], Name) ->
- find_phone(T, Name);
- find_phone([], _Name) ->
- not_found.
+find_phone([#person{name=Name, phone=Phone} | _], Name) ->
+ {found, Phone};
+find_phone([_| T], Name) ->
+ find_phone(T, Name);
+find_phone([], _Name) ->
+ not_found.
- demo() ->
- P = #person2{name= #name{first=\"Robert\",last=\"Virding\"},
+demo() ->
+ P = #person2{name= #name{first=\"Robert\",last=\"Virding\"},
phone=123},
- _First = (P#person2.name)#name.first.
- ">>,
- ?line ok = run_file(Config, recs, Test1),
+ _First = (P#person2.name)#name.first.
+">>,
+ ok = run_file(Config, recs, Test1),
- Test1_shell =
- <<"rd(person, {name = \"\", phone = [], address}),
+Test1_shell =
+<<"rd(person, {name = \"\", phone = [], address}),
rd(name, {first = \"Robert\", last = \"Ericsson\"}),
rd(person2, {name = #name{}, phone}),
- _P1 = #person{phone=[0,8,2,3,4,3,1,2], name=\"Robert\"},
+ _P1 = #person{phone=[0,8,2,3,4,3,1,2], name=\"Robert\"},
\"Robert\" = _P1#person.name,
[0,8,2,3,4,3,1,2] = _P1#person.phone,
- undefined = _P1#person.address,
+ undefined = _P1#person.address,
- _P2 = #person{name = \"Jakob\", _ = '_'},
+ _P2 = #person{name = \"Jakob\", _ = '_'},
\"Jakob\" = _P2#person.name,
'_' = _P2#person.phone,
- '_' = _P2#person.address,
+ '_' = _P2#person.address,
- P = #person{name = \"Joe\", phone = [0,8,2,3,4,3,1,2]},
+ P = #person{name = \"Joe\", phone = [0,8,2,3,4,3,1,2]},
\"Joe\" = P#person.name,
[0,8,2,3,4,3,1,2] = P#person.phone,
- undefined = P#person.address,
+ undefined = P#person.address,
- P1 = #person{name=\"Joe\", phone=[1,2,3], address=\"A street\"},
+ P1 = #person{name=\"Joe\", phone=[1,2,3], address=\"A street\"},
P2 = P1#person{name=\"Robert\"},
\"Robert\" = P2#person.name,
[1,2,3] = P2#person.phone,
- \"A street\" = P2#person.address,
+ \"A street\" = P2#person.address,
Foo = fun(P) when is_record(P, person) -> a_person;
(_) -> not_a_person
end,
- a_person = Foo(P1),
-
- Find = fun([#person{name=Name, phone=Phone} | _], Name, Fn) ->
- {found, Phone};
- ([_| T], Name, Fn) ->
- Fn(T, Name, Fn);
- ([], _Name, _Fn) ->
- not_found
- end,
-
- {found, [1,2,3]} = Find([#person{name = a},
- #person{name = b, phone = [3,2,1]},
- #person{name = c, phone = [1,2,3]}],
- c,
- Find),
-
- P3 = #person{name=\"Joe\", phone=[0,0,7], address=\"A street\"},
+ a_person = Foo(P1),
+
+ Find = fun([#person{name=Name, phone=Phone} | _], Name, Fn) ->
+ {found, Phone};
+ ([_| T], Name, Fn) ->
+ Fn(T, Name, Fn);
+ ([], _Name, _Fn) ->
+ not_found
+ end,
+
+ {found, [1,2,3]} = Find([#person{name = a},
+ #person{name = b, phone = [3,2,1]},
+ #person{name = c, phone = [1,2,3]}],
+ c,
+ Find),
+
+ P3 = #person{name=\"Joe\", phone=[0,0,7], address=\"A street\"},
#person{name = Name} = P3,
- \"Joe\" = Name,
+ \"Joe\" = Name,
Demo = fun() ->
- P17 = #person2{name= #name{first=\"Robert\",last=\"Virding\"},
+ P17 = #person2{name= #name{first=\"Robert\",last=\"Virding\"},
phone=123},
- _First = (P17#person2.name)#name.first
- end,
+ _First = (P17#person2.name)#name.first
+ end,
- \"Robert\" = Demo(),
+ \"Robert\" = Demo(),
ok.
- ">>,
- ?line [ok] = scan(Test1_shell),
+">>,
+ [ok] = scan(Test1_shell),
- Test2 =
- <<"-module(recs).
+Test2 =
+<<"-module(recs).
-record(person, {name, age, phone = [], dict = []}).
- -compile(export_all).
+-compile(export_all).
- t() -> ok.
+t() -> ok.
- make_hacker_without_phone(Name, Age) ->
- #person{name = Name, age = Age,
- dict = [{computer_knowledge, excellent},
- {drinks, coke}]}.
- print(#person{name = Name, age = Age,
- phone = Phone, dict = Dict}) ->
- io:format(\"Name: ~s, Age: ~w, Phone: ~w ~n\"
+make_hacker_without_phone(Name, Age) ->
+ #person{name = Name, age = Age,
+ dict = [{computer_knowledge, excellent},
+ {drinks, coke}]}.
+print(#person{name = Name, age = Age,
+ phone = Phone, dict = Dict}) ->
+ io:format(\"Name: ~s, Age: ~w, Phone: ~w ~n\"
\"Dictionary: ~w.~n\", [Name, Age, Phone, Dict]).
birthday(P) when record(P, person) ->
- P#person{age = P#person.age + 1}.
+ P#person{age = P#person.age + 1}.
- register_two_hackers() ->
- Hacker1 = make_hacker_without_phone(\"Joe\", 29),
+register_two_hackers() ->
+ Hacker1 = make_hacker_without_phone(\"Joe\", 29),
OldHacker = birthday(Hacker1),
- % The central_register_server should have
- % an interface function for this.
- central_register_server ! {register_person, Hacker1},
- central_register_server ! {register_person,
- OldHacker#person{name = \"Robert\",
+ %% The central_register_server should have
+ %% an interface function for this.
+ central_register_server ! {register_person, Hacker1},
+ central_register_server ! {register_person,
+ OldHacker#person{name = \"Robert\",
phone = [0,8,3,2,4,5,3,1]}}.
- ">>,
- ?line ok = run_file(Config, recs, Test2),
- ok.
+">>,
+ ok = run_file(Config, recs, Test2),
+ok.
-progex_lc(doc) ->
- ["List comprehension examples from Programming Examples. OTP-5237."];
-progex_lc(suite) ->
- [];
+%% List comprehension examples from Programming Examples. OTP-5237.
progex_lc(Config) when is_list(Config) ->
Test1 =
- <<"-module(lc).
+ <<"-module(lc).
-export([t/0]).
- t() ->
- [a,4,b,5,6] = [X || X <- [1,2,a,3,4,b,5,6], X > 3],
- [4,5,6] = [X || X <- [1,2,a,3,4,b,5,6], integer(X), X > 3],
- [{1,a},{1,b},{2,a},{2,b},{3,a},{3,b}] =
- [{X, Y} || X <- [1,2,3], Y <- [a,b]],
-
- [1,2,3,4,5,6,7,8] = sort([4,5,1,8,3,6,7,2]),
- [[b,u,g],[b,g,u],[u,b,g],[u,g,b],[g,b,u],[g,u,b]] =
- perms([b,u,g]),
- [] = pyth(11),
- [{3,4,5},{4,3,5}] = pyth(12),
- [{3,4,5},{4,3,5},{5,12,13},{6,8,10},{8,6,10},{8,15,17},
- {9,12,15},{12,5,13},{12,9,15},{12,16,20},{15,8,17},
- {16,12,20}] = pyth(50),
- [] = pyth1(11),
- [{3,4,5},{4,3,5}] = pyth1(12),
- [{3,4,5},{4,3,5},{5,12,13},{6,8,10},{8,6,10},{8,15,17},
- {9,12,15},{12,5,13},{12,9,15},{12,16,20},{15,8,17},
- {16,12,20}] = pyth1(50),
- [1,2,3,4,5] = append([[1,2,3],[4,5]]),
- [2,3,4] = map(fun(X) -> X + 1 end, [1,2,3]),
- [2,4] = filter(fun(X) -> X > 1 end, [0,2,4]),
- [1,2,3,7] = select(b,[{a,1},{b,2},{c,3},{b,7}]),
- [2,7] = select2(b,[{a,1},{b,2},{c,3},{b,7}]),
- ok.
-
- sort([Pivot|T]) ->
- sort([ X || X <- T, X < Pivot]) ++
- [Pivot] ++
- sort([ X || X <- T, X >= Pivot]);
- sort([]) -> [].
-
- perms([]) -> [[]];
- perms(L) -> [[H|T] || H <- L, T <- perms(L--[H])].
-
- pyth(N) ->
- [ {A,B,C} ||
- A <- lists:seq(1,N),
- B <- lists:seq(1,N),
- C <- lists:seq(1,N),
- A+B+C =< N,
- A*A+B*B == C*C
- ].
-
- pyth1(N) ->
- [{A,B,C} ||
- A <- lists:seq(1,N),
- B <- lists:seq(1,N-A+1),
- C <- lists:seq(1,N-A-B+2),
- A+B+C =< N,
- A*A+B*B == C*C ].
-
- append(L) -> [X || L1 <- L, X <- L1].
- map(Fun, L) -> [Fun(X) || X <- L].
- filter(Pred, L) -> [X || X <- L, Pred(X)].
-
- select(X, L) -> [Y || {X, Y} <- L].
- select2(X, L) -> [Y || {X1, Y} <- L, X == X1].
- ">>,
- ?line ok = run_file(Config, lc, Test1),
-
- Test1_shell =
- <<"[a,4,b,5,6] = [X || X <- [1,2,a,3,4,b,5,6], X > 3],
- [4,5,6] = [X || X <- [1,2,a,3,4,b,5,6], integer(X), X > 3],
- [{1,a},{1,b},{2,a},{2,b},{3,a},{3,b}] =
- [{X, Y} || X <- [1,2,3], Y <- [a,b]],
-
- Sort = fun([Pivot|T], Fn) ->
- Fn([ X || X <- T, X < Pivot], Fn) ++
- [Pivot] ++
- Fn([ X || X <- T, X >= Pivot], Fn);
- ([], _Fn) -> []
- end,
-
- [1,2,3,4,5,6,7,8] = Sort([4,5,1,8,3,6,7,2], Sort),
- Perms = fun([], _Fn) -> [[]];
- (L, Fn) -> [[H|T] || H <- L, T <- Fn(L--[H], Fn)]
- end,
- [[b,u,g],[b,g,u],[u,b,g],[u,g,b],[g,b,u],[g,u,b]] =
- Perms([b,u,g], Perms),
-
- Pyth = fun(N) ->
- [ {A,B,C} ||
- A <- lists:seq(1,N),
- B <- lists:seq(1,N),
- C <- lists:seq(1,N),
- A+B+C =< N,
- A*A+B*B == C*C
- ]
- end,
-
- [] = Pyth(11),
- [{3,4,5},{4,3,5}] = Pyth(12),
- %[{3,4,5},{4,3,5},{5,12,13},{6,8,10},{8,6,10},{8,15,17},
- % {9,12,15},{12,5,13},{12,9,15},{12,16,20},{15,8,17},
- % {16,12,20}] = Pyth(50),
-
- Pyth1 = fun(N) ->
- [{A,B,C} ||
- A <- lists:seq(1,N),
- B <- lists:seq(1,N-A+1),
- C <- lists:seq(1,N-A-B+2),
- A+B+C =< N,
- A*A+B*B == C*C ]
- end,
-
- [] = Pyth1(11),
- [{3,4,5},{4,3,5}] = Pyth1(12),
- [{3,4,5},{4,3,5},{5,12,13},{6,8,10},{8,6,10},{8,15,17},
- {9,12,15},{12,5,13},{12,9,15},{12,16,20},{15,8,17},
- {16,12,20}] = Pyth1(50),
-
- Append = fun(L) -> [X || L1 <- L, X <- L1] end,
- [1,2,3,4,5] = Append([[1,2,3],[4,5]]),
- Map = fun(Fun, L) -> [Fun(X) || X <- L] end,
- [2,3,4] = Map(fun(X) -> X + 1 end, [1,2,3]),
- Filter = fun(Pred, L) -> [X || X <- L, Pred(X)] end,
- [2,4] = Filter(fun(X) -> X > 1 end, [0,2,4]),
-
- Select = fun(X, L) -> [Y || {X, Y} <- L] end,
- [1,2,3,7] = Select(b,[{a,1},{b,2},{c,3},{b,7}]),
- Select2 = fun(X, L) -> [Y || {X1, Y} <- L, X == X1] end,
- [2,7] = Select2(b,[{a,1},{b,2},{c,3},{b,7}]),
- ok.
- ">>,
- ?line [ok] = scan(Test1_shell),
+t() ->
+ [a,4,b,5,6] = [X || X <- [1,2,a,3,4,b,5,6], X > 3],
+ [4,5,6] = [X || X <- [1,2,a,3,4,b,5,6], integer(X), X > 3],
+ [{1,a},{1,b},{2,a},{2,b},{3,a},{3,b}] =
+ [{X, Y} || X <- [1,2,3], Y <- [a,b]],
+
+ [1,2,3,4,5,6,7,8] = sort([4,5,1,8,3,6,7,2]),
+ [[b,u,g],[b,g,u],[u,b,g],[u,g,b],[g,b,u],[g,u,b]] =
+ perms([b,u,g]),
+ [] = pyth(11),
+ [{3,4,5},{4,3,5}] = pyth(12),
+ [{3,4,5},{4,3,5},{5,12,13},{6,8,10},{8,6,10},{8,15,17},
+ {9,12,15},{12,5,13},{12,9,15},{12,16,20},{15,8,17},
+ {16,12,20}] = pyth(50),
+ [] = pyth1(11),
+ [{3,4,5},{4,3,5}] = pyth1(12),
+ [{3,4,5},{4,3,5},{5,12,13},{6,8,10},{8,6,10},{8,15,17},
+ {9,12,15},{12,5,13},{12,9,15},{12,16,20},{15,8,17},
+ {16,12,20}] = pyth1(50),
+ [1,2,3,4,5] = append([[1,2,3],[4,5]]),
+ [2,3,4] = map(fun(X) -> X + 1 end, [1,2,3]),
+ [2,4] = filter(fun(X) -> X > 1 end, [0,2,4]),
+ [1,2,3,7] = select(b,[{a,1},{b,2},{c,3},{b,7}]),
+ [2,7] = select2(b,[{a,1},{b,2},{c,3},{b,7}]),
ok.
-progex_funs(doc) ->
- ["Funs examples from Programming Examples. OTP-5237."];
-progex_funs(suite) ->
- [];
+sort([Pivot|T]) ->
+ sort([ X || X <- T, X < Pivot]) ++
+ [Pivot] ++
+ sort([ X || X <- T, X >= Pivot]);
+sort([]) -> [].
+
+perms([]) -> [[]];
+perms(L) -> [[H|T] || H <- L, T <- perms(L--[H])].
+
+pyth(N) ->
+ [ {A,B,C} ||
+ A <- lists:seq(1,N),
+ B <- lists:seq(1,N),
+ C <- lists:seq(1,N),
+ A+B+C =< N,
+ A*A+B*B == C*C
+ ].
+
+pyth1(N) ->
+ [{A,B,C} ||
+ A <- lists:seq(1,N),
+ B <- lists:seq(1,N-A+1),
+ C <- lists:seq(1,N-A-B+2),
+ A+B+C =< N,
+ A*A+B*B == C*C ].
+
+append(L) -> [X || L1 <- L, X <- L1].
+map(Fun, L) -> [Fun(X) || X <- L].
+filter(Pred, L) -> [X || X <- L, Pred(X)].
+
+select(X, L) -> [Y || {X, Y} <- L].
+select2(X, L) -> [Y || {X1, Y} <- L, X == X1].
+">>,
+ ok = run_file(Config, lc, Test1),
+
+Test1_shell =
+<<"[a,4,b,5,6] = [X || X <- [1,2,a,3,4,b,5,6], X > 3],
+ [4,5,6] = [X || X <- [1,2,a,3,4,b,5,6], integer(X), X > 3],
+ [{1,a},{1,b},{2,a},{2,b},{3,a},{3,b}] =
+ [{X, Y} || X <- [1,2,3], Y <- [a,b]],
+
+ Sort = fun([Pivot|T], Fn) ->
+ Fn([ X || X <- T, X < Pivot], Fn) ++
+ [Pivot] ++
+ Fn([ X || X <- T, X >= Pivot], Fn);
+ ([], _Fn) -> []
+ end,
+
+ [1,2,3,4,5,6,7,8] = Sort([4,5,1,8,3,6,7,2], Sort),
+ Perms = fun([], _Fn) -> [[]];
+ (L, Fn) -> [[H|T] || H <- L, T <- Fn(L--[H], Fn)]
+ end,
+ [[b,u,g],[b,g,u],[u,b,g],[u,g,b],[g,b,u],[g,u,b]] =
+ Perms([b,u,g], Perms),
+
+ Pyth = fun(N) ->
+ [ {A,B,C} ||
+ A <- lists:seq(1,N),
+ B <- lists:seq(1,N),
+ C <- lists:seq(1,N),
+ A+B+C =< N,
+ A*A+B*B == C*C
+ ]
+ end,
+
+ [] = Pyth(11),
+ [{3,4,5},{4,3,5}] = Pyth(12),
+%%[{3,4,5},{4,3,5},{5,12,13},{6,8,10},{8,6,10},{8,15,17},
+%% {9,12,15},{12,5,13},{12,9,15},{12,16,20},{15,8,17},
+%% {16,12,20}] = Pyth(50),
+
+ Pyth1 = fun(N) ->
+ [{A,B,C} ||
+ A <- lists:seq(1,N),
+ B <- lists:seq(1,N-A+1),
+ C <- lists:seq(1,N-A-B+2),
+ A+B+C =< N,
+ A*A+B*B == C*C ]
+ end,
+
+ [] = Pyth1(11),
+ [{3,4,5},{4,3,5}] = Pyth1(12),
+ [{3,4,5},{4,3,5},{5,12,13},{6,8,10},{8,6,10},{8,15,17},
+ {9,12,15},{12,5,13},{12,9,15},{12,16,20},{15,8,17},
+ {16,12,20}] = Pyth1(50),
+
+ Append = fun(L) -> [X || L1 <- L, X <- L1] end,
+ [1,2,3,4,5] = Append([[1,2,3],[4,5]]),
+ Map = fun(Fun, L) -> [Fun(X) || X <- L] end,
+ [2,3,4] = Map(fun(X) -> X + 1 end, [1,2,3]),
+ Filter = fun(Pred, L) -> [X || X <- L, Pred(X)] end,
+ [2,4] = Filter(fun(X) -> X > 1 end, [0,2,4]),
+
+ Select = fun(X, L) -> [Y || {X, Y} <- L] end,
+ [1,2,3,7] = Select(b,[{a,1},{b,2},{c,3},{b,7}]),
+ Select2 = fun(X, L) -> [Y || {X1, Y} <- L, X == X1] end,
+ [2,7] = Select2(b,[{a,1},{b,2},{c,3},{b,7}]),
+ ok.
+">>,
+ [ok] = scan(Test1_shell),
+ok.
+
+%% Funs examples from Programming Examples. OTP-5237.
progex_funs(Config) when is_list(Config) ->
Test1 =
- <<"-module(funs).
+ <<"-module(funs).
-compile(export_all).
- double([H|T]) -> [2*H|double(T)];
- double([]) -> [].
+double([H|T]) -> [2*H|double(T)];
+double([]) -> [].
- add_one([H|T]) -> [H+1|add_one(T)];
- add_one([]) -> [].
+add_one([H|T]) -> [H+1|add_one(T)];
+add_one([]) -> [].
- map(F, [H|T]) -> [F(H)|map(F, T)];
- map(F, []) -> [].
+map(F, [H|T]) -> [F(H)|map(F, T)];
+map(F, []) -> [].
- double2(L) -> map(fun(X) -> 2*X end, L).
- add_one2(L) -> map(fun(X) -> 1 + X end, L).
+double2(L) -> map(fun(X) -> 2*X end, L).
+add_one2(L) -> map(fun(X) -> 1 + X end, L).
- print_list(Stream, [H|T]) ->
- io:format(Stream, \"~p~n\", [H]),
+print_list(Stream, [H|T]) ->
+ io:format(Stream, \"~p~n\", [H]),
print_list(Stream, T);
- print_list(Stream, []) ->
- true.
-
- broadcast(Msg, [Pid|Pids]) ->
- Pid ! Msg,
- broadcast(Msg, Pids);
- broadcast(_, []) ->
- true.
-
- foreach(F, [H|T]) ->
- F(H),
- foreach(F, T);
- foreach(F, []) ->
- ok.
+ print_list(Stream, []) ->
+ true.
+
+broadcast(Msg, [Pid|Pids]) ->
+ Pid ! Msg,
+ broadcast(Msg, Pids);
+broadcast(_, []) ->
+ true.
+
+foreach(F, [H|T]) ->
+ F(H),
+ foreach(F, T);
+foreach(F, []) ->
+ ok.
- print_list2(S, L) ->
- foreach(fun(H) -> io:format(S, \"~p~n\",[H]) end, L).
+print_list2(S, L) ->
+ foreach(fun(H) -> io:format(S, \"~p~n\",[H]) end, L).
broadcast2(M, L) -> foreach(fun(Pid) -> Pid ! M end, L).
- t1() -> map(fun(X) -> 2 * X end, [1,2,3,4,5]).
+t1() -> map(fun(X) -> 2 * X end, [1,2,3,4,5]).
- t2() -> map(fun double/1, [1,2,3,4,5]).
+t2() -> map(fun double/1, [1,2,3,4,5]).
- t3() -> map({?MODULE, double3}, [1,2,3,4,5]).
+t3() -> map({?MODULE, double3}, [1,2,3,4,5]).
- double3(X) -> X * 2.
+double3(X) -> X * 2.
- f(F, Args) when function(F) ->
- apply(F, Args);
- f(N, _) when integer(N) ->
- N.
+f(F, Args) when function(F) ->
+ apply(F, Args);
+f(N, _) when integer(N) ->
+ N.
- print_list3(File, List) ->
- {ok, Stream} = file:open(File, write),
- foreach(fun(X) -> io:format(Stream,\"~p~n\",[X]) end, List),
+print_list3(File, List) ->
+ {ok, Stream} = file:open(File, write),
+ foreach(fun(X) -> io:format(Stream,\"~p~n\",[X]) end, List),
file:close(Stream).
- print_list4(File, List) ->
- {ok, Stream} = file:open(File, write),
- foreach(fun(File) ->
- io:format(Stream,\"~p~n\",[File])
+print_list4(File, List) ->
+ {ok, Stream} = file:open(File, write),
+ foreach(fun(File) ->
+ io:format(Stream,\"~p~n\",[File])
end, List),
- file:close(Stream).
+ file:close(Stream).
+
+any(Pred, [H|T]) ->
+ case Pred(H) of
+ true -> true;
+ false -> any(Pred, T)
+ end;
+any(Pred, []) ->
+ false.
- any(Pred, [H|T]) ->
- case Pred(H) of
- true -> true;
- false -> any(Pred, T)
- end;
- any(Pred, []) ->
- false.
-
- all(Pred, [H|T]) ->
- case Pred(H) of
- true -> all(Pred, T);
- false -> false
- end;
- all(Pred, []) ->
- true.
-
- foldl(F, Accu, [Hd|Tail]) ->
- foldl(F, F(Hd, Accu), Tail);
- foldl(F, Accu, []) -> Accu.
-
- mapfoldl(F, Accu0, [Hd|Tail]) ->
- {R,Accu1} = F(Hd, Accu0),
- {Rs,Accu2} = mapfoldl(F, Accu1, Tail),
- {[R|Rs], Accu2};
- mapfoldl(F, Accu, []) -> {[], Accu}.
-
- filter(F, [H|T]) ->
- case F(H) of
- true -> [H|filter(F, T)];
- false -> filter(F, T)
- end;
- filter(F, []) -> [].
-
- diff(L1, L2) ->
- filter(fun(X) -> not lists:member(X, L2) end, L1).
-
- intersection(L1,L2) -> filter(fun(X) -> lists:member(X,L1) end, L2).
-
- takewhile(Pred, [H|T]) ->
- case Pred(H) of
- true -> [H|takewhile(Pred, T)];
- false -> []
- end;
- takewhile(Pred, []) ->
- [].
-
- dropwhile(Pred, [H|T]) ->
- case Pred(H) of
- true -> dropwhile(Pred, T);
- false -> [H|T]
- end;
- dropwhile(Pred, []) ->
- [].
-
- splitlist(Pred, L) ->
- splitlist(Pred, L, []).
-
- splitlist(Pred, [H|T], L) ->
- case Pred(H) of
- true -> splitlist(Pred, T, [H|L]);
- false -> {lists:reverse(L), [H|T]}
- end;
- splitlist(Pred, [], L) ->
- {lists:reverse(L), []}.
-
- first(Pred, [H|T]) ->
- case Pred(H) of
- true ->
- {true, H};
- false ->
- first(Pred, T)
- end;
- first(Pred, []) ->
- false.
-
- ints_from(N) ->
- fun() ->
- [N|ints_from(N+1)]
- end.
-
- pconst(X) ->
- fun (T) ->
- case T of
- [X|T1] -> {ok, {const, X}, T1};
- _ -> fail
- end
- end.
-
- pand(P1, P2) ->
- fun (T) ->
- case P1(T) of
- {ok, R1, T1} ->
- case P2(T1) of
- {ok, R2, T2} ->
- {ok, {'and', R1, R2}};
- fail ->
- fail
- end;
- fail ->
- fail
- end
- end.
-
- por(P1, P2) ->
- fun (T) ->
- case P1(T) of
- {ok, R, T1} ->
- {ok, {'or',1,R}, T1};
- fail ->
- case P2(T) of
- {ok, R1, T1} ->
- {ok, {'or',2,R1}, T1};
- fail ->
- fail
- end
- end
- end.
-
- grammar() ->
- pand(
- por(pconst(a), pconst(b)),
- por(pconst(c), pconst(d))).
-
- parse(List) ->
- (grammar())(List).
-
-
- t() ->
- [2,4,6,8] = double([1,2,3,4]),
- [2,3,4,5] = add_one([1,2,3,4]),
- [2,4,6,8] = double2([1,2,3,4]),
- [2,3,4,5] = add_one2([1,2,3,4]),
- XX = ints_from(1),
- [1 | _] = XX(),
- 1 = hd(XX()),
- Y = tl(XX()),
- 2 = hd(Y()),
-
- P1 = pconst(a),
- {ok,{const,a},[b,c]} = P1([a,b,c]),
- fail = P1([x,y,z]),
-
- {ok,{'and',{'or',1,{const,a}},{'or',1,{const,c}}}} =
- parse([a,c]),
- {ok,{'and',{'or',1,{const,a}},{'or',2,{const,d}}}} =
- parse([a,d]),
- {ok,{'and',{'or',2,{const,b}},{'or',1,{const,c}}}} =
- parse([b,c]),
- {ok,{'and',{'or',2,{const,b}},{'or',2,{const,d}}}} =
- parse([b,d]),
- fail = parse([a,b]),
- ok.
- ">>,
- ?line ok = run_file(Config, funs, Test1),
-
- Test2_shell =
- <<"Double = fun(X) -> 2 * X end,
+all(Pred, [H|T]) ->
+ case Pred(H) of
+ true -> all(Pred, T);
+ false -> false
+ end;
+all(Pred, []) ->
+ true.
+
+foldl(F, Accu, [Hd|Tail]) ->
+ foldl(F, F(Hd, Accu), Tail);
+foldl(F, Accu, []) -> Accu.
+
+mapfoldl(F, Accu0, [Hd|Tail]) ->
+ {R,Accu1} = F(Hd, Accu0),
+ {Rs,Accu2} = mapfoldl(F, Accu1, Tail),
+ {[R|Rs], Accu2};
+mapfoldl(F, Accu, []) -> {[], Accu}.
+
+filter(F, [H|T]) ->
+ case F(H) of
+ true -> [H|filter(F, T)];
+ false -> filter(F, T)
+ end;
+filter(F, []) -> [].
+
+diff(L1, L2) ->
+ filter(fun(X) -> not lists:member(X, L2) end, L1).
+
+intersection(L1,L2) -> filter(fun(X) -> lists:member(X,L1) end, L2).
+
+takewhile(Pred, [H|T]) ->
+ case Pred(H) of
+ true -> [H|takewhile(Pred, T)];
+ false -> []
+ end;
+takewhile(Pred, []) ->
+ [].
+
+dropwhile(Pred, [H|T]) ->
+ case Pred(H) of
+ true -> dropwhile(Pred, T);
+ false -> [H|T]
+ end;
+dropwhile(Pred, []) ->
+ [].
+
+splitlist(Pred, L) ->
+ splitlist(Pred, L, []).
+
+splitlist(Pred, [H|T], L) ->
+ case Pred(H) of
+ true -> splitlist(Pred, T, [H|L]);
+ false -> {lists:reverse(L), [H|T]}
+ end;
+splitlist(Pred, [], L) ->
+ {lists:reverse(L), []}.
+
+first(Pred, [H|T]) ->
+ case Pred(H) of
+ true ->
+ {true, H};
+ false ->
+ first(Pred, T)
+ end;
+first(Pred, []) ->
+ false.
+
+ints_from(N) ->
+ fun() ->
+ [N|ints_from(N+1)]
+ end.
+
+pconst(X) ->
+ fun (T) ->
+ case T of
+ [X|T1] -> {ok, {const, X}, T1};
+ _ -> fail
+ end
+ end.
+
+pand(P1, P2) ->
+ fun (T) ->
+ case P1(T) of
+ {ok, R1, T1} ->
+ case P2(T1) of
+ {ok, R2, T2} ->
+ {ok, {'and', R1, R2}};
+ fail ->
+ fail
+ end;
+ fail ->
+ fail
+ end
+ end.
+
+por(P1, P2) ->
+ fun (T) ->
+ case P1(T) of
+ {ok, R, T1} ->
+ {ok, {'or',1,R}, T1};
+ fail ->
+ case P2(T) of
+ {ok, R1, T1} ->
+ {ok, {'or',2,R1}, T1};
+ fail ->
+ fail
+ end
+ end
+ end.
+
+grammar() ->
+ pand(
+ por(pconst(a), pconst(b)),
+ por(pconst(c), pconst(d))).
+
+parse(List) ->
+ (grammar())(List).
+
+
+t() ->
+ [2,4,6,8] = double([1,2,3,4]),
+ [2,3,4,5] = add_one([1,2,3,4]),
+ [2,4,6,8] = double2([1,2,3,4]),
+ [2,3,4,5] = add_one2([1,2,3,4]),
+ XX = ints_from(1),
+ [1 | _] = XX(),
+ 1 = hd(XX()),
+ Y = tl(XX()),
+ 2 = hd(Y()),
+
+ P1 = pconst(a),
+ {ok,{const,a},[b,c]} = P1([a,b,c]),
+ fail = P1([x,y,z]),
+
+ {ok,{'and',{'or',1,{const,a}},{'or',1,{const,c}}}} =
+ parse([a,c]),
+ {ok,{'and',{'or',1,{const,a}},{'or',2,{const,d}}}} =
+ parse([a,d]),
+ {ok,{'and',{'or',2,{const,b}},{'or',1,{const,c}}}} =
+ parse([b,c]),
+ {ok,{'and',{'or',2,{const,b}},{'or',2,{const,d}}}} =
+ parse([b,d]),
+ fail = parse([a,b]),
+ ok.
+">>,
+ ok = run_file(Config, funs, Test1),
+
+Test2_shell =
+<<"Double = fun(X) -> 2 * X end,
[2,4,6,8,10] = lists:map(Double, [1,2,3,4,5]),
-
- Big = fun(X) -> if X > 10 -> true; true -> false end end,
- false = lists:any(Big, [1,2,3,4]),
- true = lists:any(Big, [1,2,3,12,5]),
- false = lists:all(Big, [1,2,3,4,12,6]),
- true = lists:all(Big, [12,13,14,15]),
- L = [\"I\",\"like\",\"Erlang\"],
+
+ Big = fun(X) -> if X > 10 -> true; true -> false end end,
+ false = lists:any(Big, [1,2,3,4]),
+ true = lists:any(Big, [1,2,3,12,5]),
+ false = lists:all(Big, [1,2,3,4,12,6]),
+ true = lists:all(Big, [12,13,14,15]),
+ L = [\"I\",\"like\",\"Erlang\"],
11 = lists:foldl(fun(X, Sum) -> length(X) + Sum end, 0, L),
- Upcase = fun(X) when $a =< X, X =< $z -> X + $A - $a;
- (X) -> X
- end,
- Upcase_word = fun(X) -> lists:map(Upcase, X) end,
- \"ERLANG\" = Upcase_word(\"Erlang\"),
+ Upcase = fun(X) when $a =< X, X =< $z -> X + $A - $a;
+ (X) -> X
+ end,
+ Upcase_word = fun(X) -> lists:map(Upcase, X) end,
+ \"ERLANG\" = Upcase_word(\"Erlang\"),
[\"I\",\"LIKE\",\"ERLANG\"] = lists:map(Upcase_word, L),
{[\"I\",\"LIKE\",\"ERLANG\"],11} =
lists:mapfoldl(fun(Word, Sum) ->
- {Upcase_word(Word), Sum + length(Word)}
+ {Upcase_word(Word), Sum + length(Word)}
end, 0, L),
- [500,12,45] = lists:filter(Big, [500,12,2,45,6,7]),
- [200,500,45] = lists:takewhile(Big, [200,500,45,5,3,45,6]),
- [5,3,45,6] = lists:dropwhile(Big, [200,500,45,5,3,45,6]),
- {[200,500,45],[5,3,45,6]} =
- lists:splitwith(Big, [200,500,45,5,3,45,6]),
+ [500,12,45] = lists:filter(Big, [500,12,2,45,6,7]),
+ [200,500,45] = lists:takewhile(Big, [200,500,45,5,3,45,6]),
+ [5,3,45,6] = lists:dropwhile(Big, [200,500,45,5,3,45,6]),
+ {[200,500,45],[5,3,45,6]} =
+ lists:splitwith(Big, [200,500,45,5,3,45,6]),
%% {true,45} = lists:first(Big, [1,2,45,6,123]),
%% false = lists:first(Big, [1,2,4,5]),
-
- Adder = fun(X) -> fun(Y) -> X + Y end end,
- Add6 = Adder(6),
- 16 = Add6(10),
- ok.
- ">>,
- ?line [ok] = scan(Test2_shell),
- ok.
+
+ Adder = fun(X) -> fun(Y) -> X + Y end end,
+ Add6 = Adder(6),
+ 16 = Add6(10),
+ ok.
+">>,
+ [ok] = scan(Test2_shell),
+ok.
-otp_5990(doc) ->
- "OTP-5990. {erlang,is_record}.";
-otp_5990(suite) -> [];
+%% OTP-5990. {erlang,is_record}.
otp_5990(Config) when is_list(Config) ->
- ?line [true] =
+ [true] =
scan(<<"rd('OrdSet', {orddata = {},ordtype = type}), "
"S = #'OrdSet'{ordtype = {}}, "
"if tuple(S#'OrdSet'.ordtype) -> true; true -> false end.">>),
ok.
-otp_6166(doc) ->
- "OTP-6166. Order of record definitions.";
-otp_6166(suite) -> [];
+%% OTP-6166. Order of record definitions.
otp_6166(Config) when is_list(Config) ->
- Test1 = filename:join(?config(priv_dir, Config), "test1.hrl"),
+ Test1 = filename:join(proplists:get_value(priv_dir, Config), "test1.hrl"),
Contents1 = <<"-module(test1).
-record(r5, {f}). -record(r3, {f = #r5{}}). "
"-record(r1, {f = #r3{}}). -record(r4, {f = #r1{}}). "
- "-record(r2, {f = #r4{}}).">>,
- ?line ok = file:write_file(Test1, Contents1),
+"-record(r2, {f = #r4{}}).">>,
+ ok = file:write_file(Test1, Contents1),
- Test2 = filename:join(?config(priv_dir, Config), "test2.hrl"),
+ Test2 = filename:join(proplists:get_value(priv_dir, Config), "test2.hrl"),
Contents2 = <<"-module(test2).
-record(r5, {f}). -record(r3, {f = #r5{}}). "
"-record(r1, {f = #r3{}}). -record(r4, {f = #r1{}}). "
"-record(r2, {f = #r4{}}).
-record(r6, {f = #r5{}}). % r6 > r0
-record(r0, {f = #r5{}, g = #r5{}}). % r0 < r5">>,
- ?line ok = file:write_file(Test2, Contents2),
+ ok = file:write_file(Test2, Contents2),
RR12 = "[r1,r2,r3,r4,r5] = rr(\"" ++ Test1 ++ "\"),
[r0,r1,r2,r3,r4,r5,r6] = rr(\"" ++ Test2 ++ "\"),
@@ -2317,74 +2247,72 @@ otp_6166(Config) when is_list(Config) ->
true = is_record(R0, r0),
true = is_record(R6, r6),
ok. ",
- ?line [ok] = scan(RR12),
+ [ok] = scan(RR12),
file:delete(Test1),
file:delete(Test2),
ok.
-otp_6554(doc) ->
- "OTP-6554. Formatted exits and error messages.";
-otp_6554(suite) -> [];
+%% OTP-6554. Formatted exits and error messages.
otp_6554(Config) when is_list(Config) ->
%% Should check the stacktrace as well...
- ?line "exception error: bad argument" =
+ "exception error: bad argument" =
comm_err(<<"math:sqrt(a).">>),
- ?line "exception error: bad argument" =
+ "exception error: bad argument" =
comm_err(<<"fun(X, Y) -> X ++ Y end(a, b).">>),
- ?line "exception error: bad argument" =
+ "exception error: bad argument" =
comm_err(<<"math:sqrt(lists:seq(1,40)).">>),
- ?line "exception error: bad argument" =
+ "exception error: bad argument" =
comm_err(<<"math:sqrt(lists:seq(1,10)).">>),
- ?line "exception error: bad argument" =
+ "exception error: bad argument" =
comm_err(<<"a ++ b.">>),
- ?line "exception error: bad argument" =
+ "exception error: bad argument" =
comm_err(<<"I = {file_info,undefined,undefined,undefined,undefined,
undefined,undefined,undefined,undefined,undefined,
undefined,undefined,undefined,undefined},
aa ++ I.">>),
- ?line "exception error: bad argument" =
+ "exception error: bad argument" =
comm_err(<<"I = {file_info,undefined,undefined,undefined,undefined,
undefined,undefined,undefined,undefined,undefined,
undefined,undefined,undefined,undefined},
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ++ I.">>),
- ?line "exception error: bad argument" =
+ "exception error: bad argument" =
comm_err(<<"I = {file_info,undefined,undefined,undefined,undefined,
undefined,undefined,undefined,undefined,undefined,
undefined,undefined,undefined,undefined},
I ++ I.">>),
- ?line "exception error: bad argument" =
+ "exception error: bad argument" =
comm_err(<<"fun(X) -> not X end(a).">>),
- ?line "exception error: bad argument: a" =
+ "exception error: bad argument: a" =
comm_err(<<"fun(A, B) -> A orelse B end(a, b).">>),
- ?line "exception error: an error occurred when evaluating an arithmetic expression" =
+ "exception error: an error occurred when evaluating an arithmetic expression" =
comm_err(<<"math:sqrt(2)/round(math:sqrt(0)).">>),
- ?line "exception error: interpreted function with arity 1 called with no arguments" =
+ "exception error: interpreted function with arity 1 called with no arguments" =
comm_err(<<"fun(V) -> V end().">>),
- ?line "exception error: interpreted function with arity 1 called with two arguments" =
+ "exception error: interpreted function with arity 1 called with two arguments" =
comm_err(<<"fun(V) -> V end(1,2).">>),
- ?line "exception error: interpreted function with arity 0 called with one argument" =
+ "exception error: interpreted function with arity 0 called with one argument" =
comm_err(<<"fun() -> v end(1).">>),
- ?line "exception error: interpreted function with arity 0 called with 4 arguments" =
+ "exception error: interpreted function with arity 0 called with 4 arguments" =
comm_err(<<"fun() -> v end(1,2,3,4).">>),
- ?line "exception error: math:sqrt/1 called with two arguments" =
+ "exception error: math:sqrt/1 called with two arguments" =
comm_err(<<"fun math:sqrt/1(1,2).">>),
- ?line "exception error: bad function 1." ++ _ =
+ "exception error: bad function 1." ++ _ =
comm_err(<<"(math:sqrt(2))().">>),
- ?line "exception error: bad function [1," ++ _ =
+ "exception error: bad function [1," ++ _ =
comm_err(<<"(lists:seq(1, 100))().">>),
- ?line "exception error: no match of right hand side value 1" ++ _ =
+ "exception error: no match of right hand side value 1" ++ _ =
comm_err(<<"a = math:sqrt(2).">>),
- ?line "exception error: no match of right hand side value" ++ _ =
+ "exception error: no match of right hand side value" ++ _ =
comm_err(<<"I = {file_info,undefined,undefined,undefined,undefined,
undefined,undefined,undefined,undefined,undefined,
undefined,undefined,undefined,undefined},
a = I.">>),
- ?line "exception error: no case clause matching 1" ++ _ =
+ "exception error: no case clause matching 1" ++ _ =
comm_err(<<"case math:sqrt(2) of a -> ok end.">>),
- ?line "exception error: no case clause matching [1," ++ _ =
+ "exception error: no case clause matching [1," ++ _ =
comm_err(<<"V = lists:seq(1, 20), case V of a -> ok end.">>),
- ?line "exception error: no function clause matching" =
+ "exception error: no function clause matching" =
comm_err(<<"fun(P) when is_pid(P) -> true end(a).">>),
case test_server:is_native(erl_eval) of
true ->
@@ -2406,68 +2334,68 @@ otp_6554(Config) when is_list(Config) ->
"lists:reverse(34) (lists.erl, line " ++ _ =
comm_err(<<"lists:reverse(34).">>)
end,
- ?line "exception error: function_clause" =
+ "exception error: function_clause" =
comm_err(<<"erlang:error(function_clause, 4).">>),
- ?line "exception error: no function clause matching" ++ _ =
+ "exception error: no function clause matching" ++ _ =
comm_err(<<"fun(a, b, c, d) -> foo end"
" (lists:seq(1,17),"
" lists:seq(1, 18),"
" lists:seq(1, 40),"
" lists:seq(1, 5)).">>),
- ?line "exception error: no function clause matching" =
+ "exception error: no function clause matching" =
comm_err(<<"fun(P, q) when is_pid(P) -> true end(a, b).">>),
- ?line "exception error: no true branch found when evaluating an if expression" =
+ "exception error: no true branch found when evaluating an if expression" =
comm_err(<<"if length([a,b]) > 17 -> a end.">>),
- ?line "exception error: no such process or port" =
+ "exception error: no such process or port" =
comm_err(<<"Pid = spawn(fun() -> a end),"
"timer:sleep(1),"
"link(Pid).">>),
- ?line "exception error: a system limit has been reached" =
+ "exception error: a system limit has been reached" =
comm_err(<<"list_to_atom(lists:duplicate(300,$a)).">>),
- ?line "exception error: bad receive timeout value" =
+ "exception error: bad receive timeout value" =
comm_err(<<"receive after a -> foo end.">>),
- ?line "exception error: no try clause matching 1" ++ _ =
+ "exception error: no try clause matching 1" ++ _ =
comm_err(<<"try math:sqrt(2) of bar -> yes after 3 end.">>),
- ?line "exception error: no try clause matching [1" ++ _ =
+ "exception error: no try clause matching [1" ++ _ =
comm_err(<<"V = lists:seq(1, 20),"
"try V of bar -> yes after 3 end.">>),
- ?line "exception error: undefined function math:sqrt/2" =
+ "exception error: undefined function math:sqrt/2" =
comm_err(<<"math:sqrt(2, 2).">>),
- ?line "exception error: limit of number of arguments to interpreted function "
+ "exception error: limit of number of arguments to interpreted function "
"exceeded" =
comm_err(<<"fun(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U) ->"
" a end().">>),
- ?line "exception error: bad filter a" =
+ "exception error: bad filter a" =
comm_err(<<"[b || begin a end].">>),
- ?line "exception error: bad generator a" =
+ "exception error: bad generator a" =
comm_err(<<"[X || X <- a].">>),
- ?line "exception throw: undef" = comm_err(<<"throw(undef).">>),
- ?line "exception exit: undef" = comm_err(<<"exit(undef).">>),
+ "exception throw: undef" = comm_err(<<"throw(undef).">>),
+ "exception exit: undef" = comm_err(<<"exit(undef).">>),
- ?line "exception exit: foo" =
+ "exception exit: foo" =
comm_err(<<"catch spawn_link(fun() ->"
" timer:sleep(300), exit(foo) "
" end),"
"timer:sleep(500).">>),
- ?line [ok] = scan(
+ [ok] = scan(
<<"begin process_flag(trap_exit, true),"
" Pid = spawn_link(fun() ->"
" timer:sleep(300), exit(foo) "
" end),"
" timer:sleep(500),"
" receive {'EXIT', Pid, foo} -> ok end end.">>),
- ?line "exception exit: badarith" =
+ "exception exit: badarith" =
comm_err(<<"catch spawn_link(fun() ->"
" timer:sleep(300), 1/0 "
" end),"
"timer:sleep(500).">>),
- ?line "exception exit: {nocatch,foo}" =
+ "exception exit: {nocatch,foo}" =
comm_err(<<"catch spawn_link(fun() ->"
" timer:sleep(300), throw(foo) "
" end),"
"timer:sleep(500).">>),
- ?line [ok] = scan(
+ [ok] = scan(
<<"begin process_flag(trap_exit, true),"
" Pid = spawn_link(fun() ->"
" timer:sleep(300), throw(foo) "
@@ -2476,37 +2404,37 @@ otp_6554(Config) when is_list(Config) ->
" receive {'EXIT', Pid, {{nocatch,foo},_}} -> ok end "
"end.">>),
- ?line "exception error: an error occurred when evaluating an arithmetic expression" =
+ "exception error: an error occurred when evaluating an arithmetic expression" =
comm_err(<<"begin catch_exception(true), 1/0 end.">>),
- ?line "exception error: an error occurred when evaluating an arithmetic expression" =
+ "exception error: an error occurred when evaluating an arithmetic expression" =
comm_err(<<"begin catch_exception(false), 1/0 end.">>),
- ?line "exception error: no function clause matching call to catch_exception/1" =
+ "exception error: no function clause matching call to catch_exception/1" =
comm_err(<<"catch_exception(1).">>),
%% A bug was corrected (expansion of 'try'):
- ?line "2: command not found" =
+ "2: command not found" =
comm_err(<<"try 1 of 1 -> v(2) after 3 end.">>),
%% Cover a few lines:
- ?line "3: command not found" =
+ "3: command not found" =
comm_err(<<"receive foo -> foo after 0 -> v(3) end.">>),
- ?line "3: command not found" =
+ "3: command not found" =
comm_err(<<"receive foo -> foo after 0 -> e(3) end.">>),
- ?line "1 / 0: command not found" = comm_err(<<"v(1/0).">>),
- ?line "1\n1.\n" = t(<<"1. e(1).">>),
- ?line [ok] = scan(<<"h().">>),
- ?line "exception exit: normal" = comm_err(<<"exit(normal).">>),
- ?line [foo] = scan(<<"begin history(0), foo end.">>),
- ?line application:unset_env(stdlib, shell_history_length),
- ?line [true] = scan(<<"begin <<10:(1024*1024*10)>>,"
+ "1 / 0: command not found" = comm_err(<<"v(1/0).">>),
+ "1\n1.\n" = t(<<"1. e(1).">>),
+ [ok] = scan(<<"h().">>),
+ "exception exit: normal" = comm_err(<<"exit(normal).">>),
+ [foo] = scan(<<"begin history(0), foo end.">>),
+ application:unset_env(stdlib, shell_history_length),
+ [true] = scan(<<"begin <<10:(1024*1024*10)>>,"
"<<10:(1024*1024*10)>>, garbage_collect() end.">>),
- ?line "1: syntax error before: '.'" = comm_err("1-."),
- %% ?line comm_err(<<"exit().">>), % would hang
- ?line "exception error: no function clause matching call to history/1" =
+ "1: syntax error before: '.'" = comm_err("1-."),
+ %% comm_err(<<"exit().">>), % would hang
+ "exception error: no function clause matching call to history/1" =
comm_err(<<"history(foo).">>),
- ?line "exception error: no function clause matching call to results/1" =
+ "exception error: no function clause matching call to results/1" =
comm_err(<<"results(foo).">>),
- ?line Test = filename:join(?config(priv_dir, Config),
+ Test = filename:join(proplists:get_value(priv_dir, Config),
"otp_6554.erl"),
Contents = <<"-module(otp_6554).
-export([local_allowed/3, non_local_allowed/3]).
@@ -2516,31 +2444,31 @@ otp_6554(Config) when is_list(Config) ->
non_local_allowed(_,_,State) ->
{true,State}.
">>,
- ?line ok = compile_file(Config, Test, Contents, []),
- ?line "exception exit: restricted shell starts now" =
+ ok = compile_file(Config, Test, Contents, []),
+ "exception exit: restricted shell starts now" =
comm_err(<<"begin shell:start_restricted(otp_6554) end.">>),
- ?line "-record(r,{}).\n1.\nok.\n" =
+ "-record(r,{}).\n1.\nok.\n" =
t(<<"f(), f(B), h(), b(), history(20), results(20),"
"rd(r, {}), rl(r), rf('_'), rl(), rf(),"
"rp(1), _ = rr({foo}), _ = rr({foo}, []),"
"rr({foo}, [], []), ok.">>),
- ?line "false.\n" = t(<<"catch_exception(true).">>),
- ?line "exception exit: restricted shell stopped"=
+ "false.\n" = t(<<"catch_exception(true).">>),
+ "exception exit: restricted shell stopped"=
comm_err(<<"begin shell:stop_restricted() end.">>),
- ?line "true.\n" = t(<<"catch_exception(false).">>),
+ "true.\n" = t(<<"catch_exception(false).">>),
- ?line "20\n1\n1\n1: results(2)\n2: 1\n-> 1\n3: v(2)\n-> 1.\nok.\n" =
+ "20\n1\n1\n1: results(2)\n2: 1\n-> 1\n3: v(2)\n-> 1.\nok.\n" =
t(<<"results(2). 1. v(2). h().">>),
- ?line application:unset_env(stdlib, shell_saved_results),
- ?line "1\nfoo\n17\nB = foo\nC = 17\nF = fun() ->\n foo"
+ application:unset_env(stdlib, shell_saved_results),
+ "1\nfoo\n17\nB = foo\nC = 17\nF = fun() ->\n foo"
"\n end.\nok.\n" =
t(<<"begin F = fun() -> foo end, 1 end. B = F(). C = 17. b().">>),
- ?line "3: command not found" = comm_err(<<"#{v(3) => v}.">>),
- ?line "3: command not found" = comm_err(<<"#{k => v(3)}.">>),
- ?line "3: command not found" = comm_err(<<"#{v(3) := v}.">>),
- ?line "3: command not found" = comm_err(<<"#{k := v(3)}.">>),
- ?line "3: command not found" = comm_err(<<"(v(3))#{}.">>),
+ "3: command not found" = comm_err(<<"#{v(3) => v}.">>),
+ "3: command not found" = comm_err(<<"#{k => v(3)}.">>),
+ "3: command not found" = comm_err(<<"#{v(3) := v}.">>),
+ "3: command not found" = comm_err(<<"#{k := v(3)}.">>),
+ "3: command not found" = comm_err(<<"(v(3))#{}.">>),
%% Tests I'd like to do: (you should try them manually)
%% "catch spawn_link(fun() -> timer:sleep(1000), exit(foo) end)."
%% "** exception error: foo" should be output after 1 second
@@ -2552,12 +2480,10 @@ otp_6554(Config) when is_list(Config) ->
ok.
-otp_7184(doc) ->
- "OTP-7184. Propagate exit signals from dying evaluator process.";
-otp_7184(suite) -> [];
+%% OTP-7184. Propagate exit signals from dying evaluator process.
otp_7184(Config) when is_list(Config) ->
register(otp_7184, self()),
- ?line catch
+ catch
t(<<"P = self(),
spawn_link(fun() -> process_flag(trap_exit,true),
P ! up,
@@ -2569,7 +2495,7 @@ otp_7184(Config) when is_list(Config) ->
erlang:raise(throw, thrown, []).">>),
receive {otp_7184,{'EXIT',_,{{nocatch,thrown},[]}}} -> ok end,
- ?line catch
+ catch
t(<<"P = self(),
spawn_link(fun() -> process_flag(trap_exit,true),
P ! up,
@@ -2581,7 +2507,7 @@ otp_7184(Config) when is_list(Config) ->
erlang:raise(exit, fini, []).">>),
receive {otp_7184,{'EXIT',_,{fini,[]}}} -> ok end,
- ?line catch
+ catch
t(<<"P = self(),
spawn_link(fun() -> process_flag(trap_exit,true),
P ! up,
@@ -2596,18 +2522,16 @@ otp_7184(Config) when is_list(Config) ->
unregister(otp_7184),
%% v/1, a few missed cases
- ?line "17\n<<0,0,0,64>>.\nok.\n" =
+ "17\n<<0,0,0,64>>.\nok.\n" =
t(<<"17. "
"<<64:32>>. "
"<<64>> = << << X >> || << X >> <= v(2), X > v(1) >>, ok.">>),
- ?line "17\n<<0,17>>.\n" =t(<<"17. <<(v(1)):16>>.">>),
+ "17\n<<0,17>>.\n" =t(<<"17. <<(v(1)):16>>.">>),
ok.
-otp_7232(doc) ->
- "OTP-7232. qlc:info() bug.";
-otp_7232(suite) -> [];
+%% OTP-7232. qlc:info() bug.
otp_7232(Config) when is_list(Config) ->
Info = <<"qlc:info(qlc:sort(qlc:q([X || X <- [55296,56296]]), "
"{order, fun(A,B)-> A>B end})).">>,
@@ -2618,24 +2542,22 @@ otp_7232(Config) when is_list(Config) ->
" end}])" = evaluate(Info, []),
ok.
-otp_8393(doc) ->
- "OTP-8393. Prompt string.";
-otp_8393(suite) -> [];
+%% OTP-8393. Prompt string.
otp_8393(Config) when is_list(Config) ->
- ?line _ = shell:prompt_func(default),
- ?line "Bad prompt function: '> '" =
+ _ = shell:prompt_func(default),
+ "Bad prompt function: '> '" =
prompt_err(<<"shell:prompt_func('> ').">>),
- ?line _ = shell:prompt_func(default),
- ?line "exception error: an error occurred when evaluating an arithmetic expression"++_ =
+ _ = shell:prompt_func(default),
+ "exception error: an error occurred when evaluating an arithmetic expression"++_ =
prompt_err(<<"shell:prompt_func({shell_SUITE,prompt4}).">>),
- ?line _ = shell:prompt_func(default),
- ?line "default.\n" =
+ _ = shell:prompt_func(default),
+ "default.\n" =
t(<<"shell:prompt_func({shell_SUITE,prompt2}).">>),
- ?line _ = shell:prompt_func(default),
- ?line "default\nl.\n" =
+ _ = shell:prompt_func(default),
+ "default\nl.\n" =
t(<<"shell:prompt_func({shell_SUITE,prompt3}). l.">>),
%%
@@ -2644,8 +2566,8 @@ otp_8393(Config) when is_list(Config) ->
%% That is instead tested in the io_proto_SUITE, which has
%% the right infrastructure in place for such tests. /PaN
%%
- ?line _ = shell:prompt_func(default),
- ?line "default\nl.\n" =
+ _ = shell:prompt_func(default),
+ "default\nl.\n" =
t(<<"shell:prompt_func({shell_SUITE,prompt5}). l.">>),
%% Restricted shell.
@@ -2663,30 +2585,30 @@ otp_8393(Config) when is_list(Config) ->
non_local_allowed(_,_,State) ->
{false,State}.
">>,
- ?line Test = filename:join(?config(priv_dir, Config),
+ Test = filename:join(proplists:get_value(priv_dir, Config),
"test_restricted_shell.erl"),
- ?line ok = compile_file(Config, Test, Contents, []),
- ?line _ = shell:prompt_func(default),
- ?line "exception exit: restricted shell starts now" =
+ ok = compile_file(Config, Test, Contents, []),
+ _ = shell:prompt_func(default),
+ "exception exit: restricted shell starts now" =
comm_err(<<"begin shell:start_restricted("
"test_restricted_shell) end.">>),
- ?line "default.\n"++_ =
+ "default.\n"++_ =
t(<<"shell:prompt_func({shell_SUITE,prompt1}).">>),
- ?line "exception exit: restricted shell does not allow apple(" ++ _ =
+ "exception exit: restricted shell does not allow apple(" ++ _ =
comm_err(<<"apple(1).">>),
- ?line "{shell_SUITE,prompt1}.\n" =
+ "{shell_SUITE,prompt1}.\n" =
t(<<"shell:prompt_func(default).">>),
- ?line "exception exit: restricted shell stopped"=
+ "exception exit: restricted shell stopped"=
comm_err(<<"begin shell:stop_restricted() end.">>),
- ?line undefined =
+ undefined =
application:get_env(stdlib, restricted_shell),
- ?line NR = shell:results(20),
- ?line "default\n20.\n" =
+ NR = shell:results(20),
+ "default\n20.\n" =
t(<<"shell:prompt_func({shell_SUITE,prompt3}). results(0).">>),
- ?line _ = shell:prompt_func(default),
- ?line 0 = shell:results(NR),
+ _ = shell:prompt_func(default),
+ 0 = shell:results(NR),
ok.
prompt1(_L) ->
@@ -2747,12 +2669,10 @@ prompt_err(B) ->
S = string:strip(S2, both, $"),
string:strip(S, right, $.).
-otp_10302(doc) ->
- "OTP-10302. Unicode.";
-otp_10302(suite) -> [];
+%% OTP-10302. Unicode.
otp_10302(Config) when is_list(Config) ->
{ok,Node} = start_node(shell_suite_helper_2,
- "-pa "++?config(priv_dir,Config)++
+ "-pa "++proplists:get_value(priv_dir,Config)++
" +pc unicode"),
Test1 =
<<"begin
@@ -3097,9 +3017,9 @@ run_file(Config, Module, Test) ->
ok.
compile_file(Config, File, Test, Opts0) ->
- ?line Opts = [export_all,return,{outdir,?config(priv_dir, Config)}|Opts0],
- ?line ok = file:write_file(File, Test),
- ?line case compile:file(File, Opts) of
+ Opts = [export_all,return,{outdir,proplists:get_value(priv_dir, Config)}|Opts0],
+ ok = file:write_file(File, Test),
+ case compile:file(File, Opts) of
{ok, _M, _Ws} -> ok;
_ -> error
end.
@@ -3107,10 +3027,10 @@ compile_file(Config, File, Test, Opts0) ->
filename(Name, Config) when is_atom(Name) ->
filename(atom_to_list(Name), Config);
filename(Name, Config) ->
- filename:join(?config(priv_dir, Config), Name).
+ filename:join(proplists:get_value(priv_dir, Config), Name).
start_node(Name, Xargs) ->
- ?line N = test_server:start_node(Name, slave, [{args, " " ++ Xargs}]),
+ N = test_server:start_node(Name, slave, [{args, " " ++ Xargs}]),
global:sync(),
N.
diff --git a/lib/stdlib/test/slave_SUITE.erl b/lib/stdlib/test/slave_SUITE.erl
index f01bf77550..dc14e4735a 100644
--- a/lib/stdlib/test/slave_SUITE.erl
+++ b/lib/stdlib/test/slave_SUITE.erl
@@ -29,7 +29,9 @@
-export([fun_init/1, test_errors/1]).
-export([timeout_test/1, auth_test/1, rsh_test/1, start_a_slave/3]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[t_start_link, start_link_nodedown, t_start, errors].
@@ -50,30 +52,27 @@ end_per_group(_GroupName, Config) ->
Config.
-t_start_link(suite) -> [];
t_start_link(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(20)),
-
%% Define useful variables.
- ?line Host = host(),
- ?line Slave1 = node_name(Host, slave1),
- ?line Slave2 = node_name(Host, slave2),
+ Host = host(),
+ Slave1 = node_name(Host, slave1),
+ Slave2 = node_name(Host, slave2),
%% Test slave:start_link() with one, two, and three arguments.
- ?line ThisNode = node(),
- ?line {error, {already_running, ThisNode}} = slave:start_link(Host),
- ?line {ok, Slave1} = slave:start_link(Host, slave1),
- ?line {ok, Slave2} = slave:start_link(Host, slave2, "-my_option 42"),
- ?line {ok, [["42"]]} = rpc:call(Slave2, init, get_argument, [my_option]),
+ ThisNode = node(),
+ {error, {already_running, ThisNode}} = slave:start_link(Host),
+ {ok, Slave1} = slave:start_link(Host, slave1),
+ {ok, Slave2} = slave:start_link(Host, slave2, "-my_option 42"),
+ {ok, [["42"]]} = rpc:call(Slave2, init, get_argument, [my_option]),
%% Kill the two slave nodes and verify that they are dead.
- ?line rpc:cast(Slave1, erlang, halt, []),
- ?line rpc:cast(Slave2, erlang, halt, []),
- ?line is_dead(Slave1),
- ?line is_dead(Slave2),
+ rpc:cast(Slave1, erlang, halt, []),
+ rpc:cast(Slave2, erlang, halt, []),
+ is_dead(Slave1),
+ is_dead(Slave2),
%% Start two slave nodes from another process and verify that
%% the slaves die when that process terminates.
@@ -85,41 +84,36 @@ t_start_link(Config) when is_list(Config) ->
Parent ! slaves_started,
receive never -> ok end
end),
- ?line receive slaves_started -> ok end,
- ?line process_flag(trap_exit, true),
- ?line wait_alive(Slave1),
- ?line wait_alive(Slave2),
- ?line exit(Pid, kill),
- ?line receive {'EXIT', Pid, killed} -> ok end,
- ?line test_server:sleep(250),
- ?line is_dead(Slave1),
- ?line is_dead(Slave2),
-
- ?line test_server:timetrap_cancel(Dog),
+ receive slaves_started -> ok end,
+ process_flag(trap_exit, true),
+ wait_alive(Slave1),
+ wait_alive(Slave2),
+ exit(Pid, kill),
+ receive {'EXIT', Pid, killed} -> ok end,
+ ct:sleep(250),
+ is_dead(Slave1),
+ is_dead(Slave2),
+
ok.
%% Test that slave:start_link() works when the master exits.
-start_link_nodedown(suite) -> [];
start_link_nodedown(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(20)),
-
%% Define useful variables.
- ?line Host = host(),
- ?line Master = node_name(Host, my_master),
- ?line Slave = node_name(Host, my_slave),
+ Host = host(),
+ Master = node_name(Host, my_master),
+ Slave = node_name(Host, my_slave),
+
+ Pa = "-pa " ++ filename:dirname(code:which(?MODULE)),
+ {ok, Master} = slave:start_link(Host, my_master, Pa),
+ spawn(Master, ?MODULE, start_a_slave, [self(), Host, my_slave]),
+ {reply, {ok, _Node}} = receive Any -> Any end,
- ?line Pa = "-pa " ++ filename:dirname(code:which(?MODULE)),
- ?line {ok, Master} = slave:start_link(Host, my_master, Pa),
- ?line spawn(Master, ?MODULE, start_a_slave, [self(), Host, my_slave]),
- ?line {reply, {ok, _Node}} = receive Any -> Any end,
-
- ?line rpc:call(Master, erlang, halt, []),
- ?line receive after 200 -> ok end,
- ?line pang = net_adm:ping(Slave),
+ rpc:call(Master, erlang, halt, []),
+ receive after 200 -> ok end,
+ pang = net_adm:ping(Slave),
- ?line test_server:timetrap_cancel(Dog),
ok.
start_a_slave(ReplyTo, Host, Name) ->
@@ -128,82 +122,74 @@ start_a_slave(ReplyTo, Host, Name) ->
%% Test slave:start().
-t_start(suite) -> [];
t_start(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(20)),
-
%% Define useful variables.
- ?line Host = host(),
- ?line Slave1 = node_name(Host, slave1),
- ?line Slave2 = node_name(Host, slave2),
+ Host = host(),
+ Slave1 = node_name(Host, slave1),
+ Slave2 = node_name(Host, slave2),
%% By running all tests from this master node which is linked
%% to this test case, we ensure that all slaves are killed
%% if this test case fails. (If they are not, and therefore further
%% test cases fail, there is a bug in slave.)
- ?line {ok, Master} = slave:start_link(Host, master),
-
+ {ok, Master} = slave:start_link(Host, master),
+
%% Test slave:start() with one, two, and three arguments.
- ?line ThisNode = node(),
- ?line {error, {already_running, ThisNode}} = slave:start(Host),
- ?line {ok, Slave1} = rpc:call(Master, slave, start, [Host, slave1]),
- ?line {ok, Slave2} = rpc:call(Master, slave, start,
- [Host, slave2, "-my_option 42"]),
- ?line {ok, [["42"]]} = rpc:call(Slave2, init, get_argument, [my_option]),
+ ThisNode = node(),
+ {error, {already_running, ThisNode}} = slave:start(Host),
+ {ok, Slave1} = rpc:call(Master, slave, start, [Host, slave1]),
+ {ok, Slave2} = rpc:call(Master, slave, start,
+ [Host, slave2, "-my_option 42"]),
+ {ok, [["42"]]} = rpc:call(Slave2, init, get_argument, [my_option]),
%% Test that a slave terminates when its master node terminates.
- ?line ok = slave:stop(Slave2),
- ?line is_dead(Slave2),
- ?line {ok, Slave2} = rpc:call(Slave1, slave, start, [Host, slave2]),
- ?line is_alive(Slave2),
- ?line rpc:call(Slave1, erlang, halt, []), % Kill master.
+ ok = slave:stop(Slave2),
+ is_dead(Slave2),
+ {ok, Slave2} = rpc:call(Slave1, slave, start, [Host, slave2]),
+ is_alive(Slave2),
+ rpc:call(Slave1, erlang, halt, []), % Kill master.
receive after 1000 -> ok end, % Make sure slaves have noticed
% their dead master.
- ?line is_dead(Slave1),
- ?line is_dead(Slave2), % Slave should be dead, too.
+ is_dead(Slave1),
+ is_dead(Slave2), % Slave should be dead, too.
%% Kill all slaves and verify that they are dead.
- ?line ok = slave:stop(Slave1),
- ?line ok = slave:stop(Slave2),
- ?line is_dead(Slave1),
- ?line is_dead(Slave2),
+ ok = slave:stop(Slave1),
+ ok = slave:stop(Slave2),
+ is_dead(Slave1),
+ is_dead(Slave2),
- ?line test_server:timetrap_cancel(Dog),
ok.
%% Test the various error conditions in parallell (since the timeout
%% in slave is 32 seconds).
-errors(suite) -> [];
errors(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(50)),
-
- ?line process_flag(trap_exit, true),
- ?line Pa = filename:dirname(code:which(?MODULE)),
- ?line {ok, Master} = slave_start_link(host(), master,
- "-rsh no_rsh_program -pa "++Pa++
- " -env ERL_CRASH_DUMP erl_crash_dump.master"),
- ?line Pids = rpc:call(Master, ?MODULE, test_errors, [self()]),
- ?line wait_for_result(Pids),
+ process_flag(trap_exit, true),
+ Pa = filename:dirname(code:which(?MODULE)),
+ {ok, Master} = slave_start_link(host(), master,
+ "-rsh no_rsh_program -pa "++Pa++
+ " -env ERL_CRASH_DUMP erl_crash_dump.master"),
+ Pids = rpc:call(Master, ?MODULE, test_errors, [self()]),
+ wait_for_result(Pids),
- ?line test_server:timetrap_cancel(Dog),
ok.
wait_for_result([]) ->
ok;
wait_for_result(Pids) ->
- ?line receive
- {'EXIT', Pid, normal} ->
- io:format("Process ~p terminated", [Pid]),
- wait_for_result(lists:delete(Pid, Pids));
- {'EXIT', _, Reason} ->
- exit(Reason)
- end.
+ receive
+ {'EXIT', Pid, normal} ->
+ io:format("Process ~p terminated", [Pid]),
+ wait_for_result(lists:delete(Pid, Pids));
+ {'EXIT', _, Reason} ->
+ exit(Reason)
+ end.
show_process_info(Pid) ->
io:format("~p: ~p", [Pid, catch process_info(Pid, initial_call)]).
@@ -211,25 +197,25 @@ show_process_info(Pid) ->
test_errors(ResultTo) ->
%% Sigh! We use ordinary spawn instead of fun_spawn/1 to be able
%% identify the processes by their initial call.
- ?line P1 = spawn(?MODULE, timeout_test, [ResultTo]),
- ?line P2 = spawn(?MODULE, auth_test, [ResultTo]),
- ?line P3 = spawn(?MODULE, rsh_test, [ResultTo]),
+ P1 = spawn(?MODULE, timeout_test, [ResultTo]),
+ P2 = spawn(?MODULE, auth_test, [ResultTo]),
+ P3 = spawn(?MODULE, rsh_test, [ResultTo]),
Pids =[P1, P2, P3],
- ?line lists:foreach(fun show_process_info/1, Pids),
+ lists:foreach(fun show_process_info/1, Pids),
Pids.
timeout_test(ResultTo) ->
link(ResultTo),
- ?line {error, timeout} = slave:start(host(), slave1, "-boot no_boot_script").
+ {error, timeout} = slave:start(host(), slave1, "-boot no_boot_script").
auth_test(ResultTo) ->
link(ResultTo),
- ?line {error, timeout} = slave:start(host(), slave2,
- "-setcookie definitely_not_a_cookie").
+ {error, timeout} = slave:start(host(), slave2,
+ "-setcookie definitely_not_a_cookie").
rsh_test(ResultTo) ->
link(ResultTo),
- ?line {error, no_rsh} = slave:start(super, slave3).
+ {error, no_rsh} = slave:start(super, slave3).
%%% Utilities.
@@ -239,7 +225,7 @@ wait_alive(Node) ->
wait_alive_1(10, Node).
wait_alive_1(0, Node) ->
- ?t:fail({still_not_alive,Node});
+ ct:fail({still_not_alive,Node});
wait_alive_1(N, Node) ->
case rpc:call(Node, init, get_status, []) of
{started,_} ->
diff --git a/lib/stdlib/test/sofs_SUITE.erl b/lib/stdlib/test/sofs_SUITE.erl
index 9eed2893d4..2277b2d6fb 100644
--- a/lib/stdlib/test/sofs_SUITE.erl
+++ b/lib/stdlib/test/sofs_SUITE.erl
@@ -19,7 +19,7 @@
%%
-module(sofs_SUITE).
-%-define(debug, true).
+%%-define(debug, true).
-ifdef(debug).
-define(format(S, A), io:format(S, A)).
@@ -35,28 +35,28 @@
init_per_group/2,end_per_group/2]).
-export([ from_term_1/1, set_1/1, from_sets_1/1, relation_1/1,
- a_function_1/1, family_1/1, projection/1,
- relation_to_family_1/1, domain_1/1, range_1/1, image/1,
- inverse_image/1, inverse_1/1, converse_1/1, no_elements_1/1,
- substitution/1, restriction/1, drestriction/1,
- strict_relation_1/1, extension/1, weak_relation_1/1,
- to_sets_1/1, specification/1, union_1/1, intersection_1/1,
- difference/1, symdiff/1, symmetric_partition/1,
- is_sofs_set_1/1, is_set_1/1, is_equal/1, is_subset/1,
- is_a_function_1/1, is_disjoint/1, join/1, canonical/1,
- composite_1/1, relative_product_1/1, relative_product_2/1,
- product_1/1, partition_1/1, partition_3/1,
- multiple_relative_product/1, digraph/1, constant_function/1,
- misc/1]).
+ a_function_1/1, family_1/1, projection/1,
+ relation_to_family_1/1, domain_1/1, range_1/1, image/1,
+ inverse_image/1, inverse_1/1, converse_1/1, no_elements_1/1,
+ substitution/1, restriction/1, drestriction/1,
+ strict_relation_1/1, extension/1, weak_relation_1/1,
+ to_sets_1/1, specification/1, union_1/1, intersection_1/1,
+ difference/1, symdiff/1, symmetric_partition/1,
+ is_sofs_set_1/1, is_set_1/1, is_equal/1, is_subset/1,
+ is_a_function_1/1, is_disjoint/1, join/1, canonical/1,
+ composite_1/1, relative_product_1/1, relative_product_2/1,
+ product_1/1, partition_1/1, partition_3/1,
+ multiple_relative_product/1, digraph/1, constant_function/1,
+ misc/1]).
-export([ family_specification/1,
- family_domain_1/1, family_range_1/1,
- family_to_relation_1/1,
- union_of_family_1/1, intersection_of_family_1/1,
- family_projection/1, family_difference/1,
- family_intersection_1/1, family_union_1/1,
- family_intersection_2/1, family_union_2/1,
- partition_family/1]).
+ family_domain_1/1, family_range_1/1,
+ family_to_relation_1/1,
+ union_of_family_1/1, intersection_of_family_1/1,
+ family_projection/1, family_difference/1,
+ family_intersection_1/1, family_union_1/1,
+ family_intersection_2/1, family_union_2/1,
+ partition_family/1]).
-import(sofs,
[a_function/1, a_function/2, constant_function/2,
@@ -87,7 +87,9 @@
-compile({inline,[{eval,2}]}).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[{group, sofs}, {group, sofs_family}].
@@ -129,401 +131,384 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- Dog=?t:timetrap(?t:minutes(2)),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
%% [{2,b},{1,a,b}] == lists:sort([{2,b},{1,a,b}])
%% [{1,a,b},{2,b}] == lists:keysort(1,[{2,b},{1,a,b}])
-from_term_1(suite) -> [];
-from_term_1(doc) -> [""];
from_term_1(Conf) when is_list(Conf) ->
%% would go wrong: projection(1,from_term([{2,b},{1,a,b}])),
- ?line {'EXIT', {badarg, _}} = (catch from_term([], {atom,'_',atom})),
- ?line {'EXIT', {badarg, _}} = (catch from_term([], [])),
- ?line {'EXIT', {badarg, _}} = (catch from_term([], [atom,atom])),
-
- ?line [] = to_external(from_term([])),
- ?line eval(from_term([]), empty_set()),
- ?line [] = to_external(from_term([], ['_'])),
- ?line eval(from_term([], ['_']), empty_set()),
- ?line [[]] = to_external(from_term([[]])),
- ?line [[['_']]] = type(from_term([[],[[]]])),
- ?line [[],[[]]] = to_external(from_term([[],[[]]])),
- ?line [[['_']]] = type(from_term([[],[[]]])),
- ?line eval(from_term([a],['_']), set([a])),
- ?line [[],[a]] = to_external(from_term([[],[a]])),
- ?line [[],[{a}]] = to_external(from_term([[{a}],[]])),
- ?line [{[],[{a,b,[d]}]},{[{a,b}],[]}] =
+ {'EXIT', {badarg, _}} = (catch from_term([], {atom,'_',atom})),
+ {'EXIT', {badarg, _}} = (catch from_term([], [])),
+ {'EXIT', {badarg, _}} = (catch from_term([], [atom,atom])),
+
+ [] = to_external(from_term([])),
+ eval(from_term([]), empty_set()),
+ [] = to_external(from_term([], ['_'])),
+ eval(from_term([], ['_']), empty_set()),
+ [[]] = to_external(from_term([[]])),
+ [[['_']]] = type(from_term([[],[[]]])),
+ [[],[[]]] = to_external(from_term([[],[[]]])),
+ [[['_']]] = type(from_term([[],[[]]])),
+ eval(from_term([a],['_']), set([a])),
+ [[],[a]] = to_external(from_term([[],[a]])),
+ [[],[{a}]] = to_external(from_term([[{a}],[]])),
+ [{[],[{a,b,[d]}]},{[{a,b}],[]}] =
to_external(from_term([{[],[{a,b,[d]}]},{[{a,b}],[]}])),
- ?line [{[a,b],[c,d]}] = to_external(from_term([{[a,b],[c,d]}])),
- ?line [{{a,b},[a,b],{{a},{b}}}] =
+ [{[a,b],[c,d]}] = to_external(from_term([{[a,b],[c,d]}])),
+ [{{a,b},[a,b],{{a},{b}}}] =
to_external(from_term([{{a,b},[a,b],{{a},{b}}}])),
- ?line [{{a,{[a,b]},a}},{{z,{[y,z]},z}}] =
+ [{{a,{[a,b]},a}},{{z,{[y,z]},z}}] =
to_external(from_term([{{a,{[a,b,a]},a}},{{z,{[y,y,z]},z}}])),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch from_term([{m1,[{m1,f1,1},{m1,f2,2}]},{m2,[]},{m3,[a]}])),
- ?line MS1 = [{m1,[{m1,f1,1},{m1,f2,2}]},{m2,[]},{m3,[{m3,f3,3}]}],
- ?line eval(to_external(from_term(MS1)), MS1),
-
- ?line eval(to_external(from_term(a)), a),
- ?line eval(to_external(from_term({a})), {a}),
-
- ?line eval(to_external(from_term([[a],[{b,c}]],[[atomic]])),
- [[a],[{b,c}]]),
- ?line eval(type(from_term([[a],[{b,c}]],[[atomic]])),
- [[atomic]]),
-
- ?line {'EXIT', {badarg, _}} = (catch from_term([[],[],a])),
- ?line {'EXIT', {badarg, _}} = (catch from_term([{[a,b],[c,{d}]}])),
- ?line {'EXIT', {badarg, _}} = (catch from_term([[],[a],[{a}]])),
- ?line {'EXIT', {badarg, _}} = (catch from_term([a,{a,b}])),
- ?line {'EXIT', {badarg, _}} = (catch from_term([[a],[{b,c}]],[['_']])),
- ?line {'EXIT', {badarg, _}} = (catch from_term([a | {a,b}])),
- ?line {'EXIT', {badarg, _}} =
+ MS1 = [{m1,[{m1,f1,1},{m1,f2,2}]},{m2,[]},{m3,[{m3,f3,3}]}],
+ eval(to_external(from_term(MS1)), MS1),
+
+ eval(to_external(from_term(a)), a),
+ eval(to_external(from_term({a})), {a}),
+
+ eval(to_external(from_term([[a],[{b,c}]],[[atomic]])),
+ [[a],[{b,c}]]),
+ eval(type(from_term([[a],[{b,c}]],[[atomic]])),
+ [[atomic]]),
+
+ {'EXIT', {badarg, _}} = (catch from_term([[],[],a])),
+ {'EXIT', {badarg, _}} = (catch from_term([{[a,b],[c,{d}]}])),
+ {'EXIT', {badarg, _}} = (catch from_term([[],[a],[{a}]])),
+ {'EXIT', {badarg, _}} = (catch from_term([a,{a,b}])),
+ {'EXIT', {badarg, _}} = (catch from_term([[a],[{b,c}]],[['_']])),
+ {'EXIT', {badarg, _}} = (catch from_term([a | {a,b}])),
+ {'EXIT', {badarg, _}} =
(catch from_term([{{a},b,c},{d,e,f}],[{{atom},atom,atom}])),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch from_term([{a,{b,c}} | tail], [{atom,{atom,atom}}])),
- ?line {'EXIT', {badarg, _}} = (catch from_term({})),
- ?line {'EXIT', {badarg, _}} = (catch from_term([{}])),
+ {'EXIT', {badarg, _}} = (catch from_term({})),
+ {'EXIT', {badarg, _}} = (catch from_term([{}])),
- ?line [{foo,bar},[b,a]] =
+ [{foo,bar},[b,a]] =
to_external(from_term([[b,a],{foo,bar},[b,a]], [atom])),
- ?line [{[atom],{atom,atom}}] =
+ [{[atom],{atom,atom}}] =
type(from_term([{[], {a,b}},{[a,b],{e,f}}])),
- ?line [{[atom],{atom,atom}}] =
+ [{[atom],{atom,atom}}] =
type(from_term([{[], {a,b}},{[a,b],{e,f}}], [{[atom],{atom,atom}}])),
- ?line [[atom]] = type(from_term([[a],[{b,c}]],[[atom]])),
+ [[atom]] = type(from_term([[a],[{b,c}]],[[atom]])),
- ?line {atom, atom} = type(from_term({a,b}, {atom, atom})),
- ?line atom = type(from_term(a, atom)),
- ?line {'EXIT', {badarg, _}} = (catch from_term({a,b},{atom})),
- ?line [{{a},b,c},{{d},e,f}] =
+ {atom, atom} = type(from_term({a,b}, {atom, atom})),
+ atom = type(from_term(a, atom)),
+ {'EXIT', {badarg, _}} = (catch from_term({a,b},{atom})),
+ [{{a},b,c},{{d},e,f}] =
to_external(from_term([{{a},b,c},{{a},b,c},{{d},e,f}],
[{{atom},atom,atom}])),
%% from_external too...
- ?line e = to_external(from_external(e, atom)),
- ?line {e} = to_external(from_external({e}, {atom})),
- ?line [e] = to_external(from_external([e], [atom])),
+ e = to_external(from_external(e, atom)),
+ {e} = to_external(from_external({e}, {atom})),
+ [e] = to_external(from_external([e], [atom])),
%% and is_type...
- ?line true = is_type(['_']),
- ?line false = is_type('_'),
- ?line true = is_type([['_']]),
- ?line false = is_type({atom,[],atom}),
- ?line false = is_type({atom,'_',atom}),
- ?line true = is_type({atom,atomic,atom}),
- ?line true = is_type({atom,atom}),
- ?line true = is_type(atom),
- ?line true = is_type([atom]),
- ?line true = is_type(type),
+ true = is_type(['_']),
+ false = is_type('_'),
+ true = is_type([['_']]),
+ false = is_type({atom,[],atom}),
+ false = is_type({atom,'_',atom}),
+ true = is_type({atom,atomic,atom}),
+ true = is_type({atom,atom}),
+ true = is_type(atom),
+ true = is_type([atom]),
+ true = is_type(type),
ok.
-set_1(suite) -> [];
-set_1(doc) -> [""];
set_1(Conf) when is_list(Conf) ->
%% set/1
- ?line {'EXIT', {badarg, _}} = (catch set(a)),
- ?line {'EXIT', {badarg, _}} = (catch set({a})),
- ?line eval(set([]), from_term([],[atom])),
- ?line eval(set([a,b,c]), from_term([a,b,c])),
- ?line eval(set([a,b,a,a,b]), from_term([a,b])),
- ?line eval(set([a,b,c,a,d,d,c,1]), from_term([1,a,b,c,d])),
- ?line eval(set([a,b,d,a,c]), from_term([a,b,c,d])),
- ?line eval(set([f,e,d,c,d]), from_term([c,d,e,f])),
- ?line eval(set([h,f,d,g,g,d,c]), from_term([c,d,f,g,h])),
- ?line eval(set([h,e,d,k,l]), from_term([d,e,h,k,l])),
- ?line eval(set([h,e,c,k,d]), from_term([c,d,e,h,k])),
+ {'EXIT', {badarg, _}} = (catch set(a)),
+ {'EXIT', {badarg, _}} = (catch set({a})),
+ eval(set([]), from_term([],[atom])),
+ eval(set([a,b,c]), from_term([a,b,c])),
+ eval(set([a,b,a,a,b]), from_term([a,b])),
+ eval(set([a,b,c,a,d,d,c,1]), from_term([1,a,b,c,d])),
+ eval(set([a,b,d,a,c]), from_term([a,b,c,d])),
+ eval(set([f,e,d,c,d]), from_term([c,d,e,f])),
+ eval(set([h,f,d,g,g,d,c]), from_term([c,d,f,g,h])),
+ eval(set([h,e,d,k,l]), from_term([d,e,h,k,l])),
+ eval(set([h,e,c,k,d]), from_term([c,d,e,h,k])),
%% set/2
- ?line {'EXIT', {badarg, _}} = (catch set(a, [a])),
- ?line {'EXIT', {badarg, _}} = (catch set({a}, [a])),
- ?line {'EXIT', {badarg, _}} = (catch set([a], {a})),
- ?line {'EXIT', {badarg, _}} = (catch set([a], a)),
- ?line {'EXIT', {badarg, _}} = (catch set([a], [a,b])),
- ?line {'EXIT', {badarg, _}} = (catch set([a | b],[foo])),
- ?line {'EXIT', {badarg, _}} = (catch set([a | b],['_'])),
- ?line {'EXIT', {badarg, _}} = (catch set([a | b],[[atom]])),
- ?line {'EXIT', {badarg, _}} = (catch set([{}],[{}])),
- ?line eval(set([a],['_']), from_term([a],['_'])),
- ?line eval(set([], ['_']), empty_set()),
- ?line eval(set([a,b,a,b],[foo]), from_term([a,b],[foo])),
+ {'EXIT', {badarg, _}} = (catch set(a, [a])),
+ {'EXIT', {badarg, _}} = (catch set({a}, [a])),
+ {'EXIT', {badarg, _}} = (catch set([a], {a})),
+ {'EXIT', {badarg, _}} = (catch set([a], a)),
+ {'EXIT', {badarg, _}} = (catch set([a], [a,b])),
+ {'EXIT', {badarg, _}} = (catch set([a | b],[foo])),
+ {'EXIT', {badarg, _}} = (catch set([a | b],['_'])),
+ {'EXIT', {badarg, _}} = (catch set([a | b],[[atom]])),
+ {'EXIT', {badarg, _}} = (catch set([{}],[{}])),
+ eval(set([a],['_']), from_term([a],['_'])),
+ eval(set([], ['_']), empty_set()),
+ eval(set([a,b,a,b],[foo]), from_term([a,b],[foo])),
ok.
-from_sets_1(suite) -> [];
-from_sets_1(doc) -> [""];
from_sets_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
+ E = empty_set(),
%% unordered
- ?line eval(from_sets([]), E),
- ?line {'EXIT', {type_mismatch, _}} =
+ eval(from_sets([]), E),
+ {'EXIT', {type_mismatch, _}} =
(catch from_sets([from_term([{a,b}]),
E,
from_term([{a,b,c}])])),
- ?line eval(from_sets([from_term([{a,b}]), E]),
- from_term([[],[{a,b}]])),
+ eval(from_sets([from_term([{a,b}]), E]),
+ from_term([[],[{a,b}]])),
- ?line eval(from_sets([from_term({a,b},{atom,atom}),
- from_term({b,c},{atom,atom})]),
- relation([{a,b}, {b,c}])),
- ?line {'EXIT', {type_mismatch, _}} =
+ eval(from_sets([from_term({a,b},{atom,atom}),
+ from_term({b,c},{atom,atom})]),
+ relation([{a,b}, {b,c}])),
+ {'EXIT', {type_mismatch, _}} =
(catch from_sets([from_term({a,b},{atom,atom}),
from_term({a,b,c},{atom,atom,atom})])),
- ?line {'EXIT', {badarg, _}} = (catch from_sets(foo)),
- ?line eval(from_sets([E]), from_term([[]])),
- ?line eval(from_sets([E,E]), from_term([[]])),
- ?line eval(from_sets([E,set([a])]), from_term([[],[a]])),
- ?line {'EXIT', {badarg, _}} = (catch from_sets([E,{a}])),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {badarg, _}} = (catch from_sets(foo)),
+ eval(from_sets([E]), from_term([[]])),
+ eval(from_sets([E,E]), from_term([[]])),
+ eval(from_sets([E,set([a])]), from_term([[],[a]])),
+ {'EXIT', {badarg, _}} = (catch from_sets([E,{a}])),
+ {'EXIT', {type_mismatch, _}} =
(catch from_sets([E,from_term({a}),E])),
- ?line {'EXIT', {type_mismatch, _}} = (catch from_sets([from_term({a}),E])),
+ {'EXIT', {type_mismatch, _}} = (catch from_sets([from_term({a}),E])),
%% ordered
- ?line O = {from_term(a,atom), from_term({b}, {atom}), set([c,d])},
- ?line eval(from_sets(O), from_term({a,{b},[c,d]}, {atom,{atom},[atom]})),
- ?line {'EXIT', {badarg, _}} = (catch from_sets([a,b])),
- ?line {'EXIT', {badarg, _}} = (catch from_sets({a,b})),
- ?line eval(from_sets({from_term({a}),E}), from_term({{a},[]})),
+ O = {from_term(a,atom), from_term({b}, {atom}), set([c,d])},
+ eval(from_sets(O), from_term({a,{b},[c,d]}, {atom,{atom},[atom]})),
+ {'EXIT', {badarg, _}} = (catch from_sets([a,b])),
+ {'EXIT', {badarg, _}} = (catch from_sets({a,b})),
+ eval(from_sets({from_term({a}),E}), from_term({{a},[]})),
ok.
-relation_1(suite) -> [];
-relation_1(doc) -> [""];
relation_1(Conf) when is_list(Conf) ->
%% relation/1
- ?line eval(relation([]), from_term([], [{atom,atom}])),
- ?line eval(from_term([{a}]), relation([{a}])),
- ?line {'EXIT', {badarg, _}} = (catch relation(a)),
- ?line {'EXIT', {badarg, _}} = (catch relation([{a} | a])),
- ?line {'EXIT', {badarg, _}} = (catch relation([{}])),
- ?line {'EXIT', {badarg, _}} = (catch relation([],0)),
- ?line {'EXIT', {badarg, _}} = (catch relation([{a}],a)),
+ eval(relation([]), from_term([], [{atom,atom}])),
+ eval(from_term([{a}]), relation([{a}])),
+ {'EXIT', {badarg, _}} = (catch relation(a)),
+ {'EXIT', {badarg, _}} = (catch relation([{a} | a])),
+ {'EXIT', {badarg, _}} = (catch relation([{}])),
+ {'EXIT', {badarg, _}} = (catch relation([],0)),
+ {'EXIT', {badarg, _}} = (catch relation([{a}],a)),
%% relation/2
- ?line eval(relation([{a},{b}], 1), from_term([{a},{b}])),
- ?line eval(relation([{1,a},{2,b},{1,a}], [{x,y}]),
- from_term([{1,a},{2,b}], [{x,y}])),
- ?line eval(relation([{[1,2],a},{[2,1],b},{[2,1],a}], [{[x],y}]),
- from_term([{[1,2],a},{[1,2],b}], [{[x],y}])),
- ?line {'EXIT', {badarg, _}} = (catch relation([{1,a},{2,b}], [{[x],y}])),
- ?line {'EXIT', {badarg, _}} = (catch relation([{1,a},{1,a,b}], [{x,y}])),
- ?line {'EXIT', {badarg, _}} = (catch relation([{a}], 2)),
- ?line {'EXIT', {badarg, _}} = (catch relation([{a},{b},{c,d}], 1)),
- ?line eval(relation([{{a},[{foo,bar}]}], ['_']),
- from_term([{{a},[{foo,bar}]}], ['_'])),
- ?line eval(relation([], ['_']), from_term([], ['_'])),
- ?line {'EXIT', {badarg, _}} = (catch relation([[a]],['_'])),
- ?line eval(relation([{[a,b,a]}], [{[atom]}]), from_term([{[a,b,a]}])),
- ?line eval(relation([{[a,b,a],[[d,e,d]]}], [{[atom],[[atom]]}]),
- from_term([{[a,b,a],[[d,e,d]]}])),
- ?line eval(relation([{[a,b,a],[[d,e,d]]}], [{atom,[[atom]]}]),
- from_term([{[a,b,a],[[d,e,d]]}], [{atom,[[atom]]}])),
+ eval(relation([{a},{b}], 1), from_term([{a},{b}])),
+ eval(relation([{1,a},{2,b},{1,a}], [{x,y}]),
+ from_term([{1,a},{2,b}], [{x,y}])),
+ eval(relation([{[1,2],a},{[2,1],b},{[2,1],a}], [{[x],y}]),
+ from_term([{[1,2],a},{[1,2],b}], [{[x],y}])),
+ {'EXIT', {badarg, _}} = (catch relation([{1,a},{2,b}], [{[x],y}])),
+ {'EXIT', {badarg, _}} = (catch relation([{1,a},{1,a,b}], [{x,y}])),
+ {'EXIT', {badarg, _}} = (catch relation([{a}], 2)),
+ {'EXIT', {badarg, _}} = (catch relation([{a},{b},{c,d}], 1)),
+ eval(relation([{{a},[{foo,bar}]}], ['_']),
+ from_term([{{a},[{foo,bar}]}], ['_'])),
+ eval(relation([], ['_']), from_term([], ['_'])),
+ {'EXIT', {badarg, _}} = (catch relation([[a]],['_'])),
+ eval(relation([{[a,b,a]}], [{[atom]}]), from_term([{[a,b,a]}])),
+ eval(relation([{[a,b,a],[[d,e,d]]}], [{[atom],[[atom]]}]),
+ from_term([{[a,b,a],[[d,e,d]]}])),
+ eval(relation([{[a,b,a],[[d,e,d]]}], [{atom,[[atom]]}]),
+ from_term([{[a,b,a],[[d,e,d]]}], [{atom,[[atom]]}])),
ok.
-a_function_1(suite) -> [];
-a_function_1(doc) -> [""];
a_function_1(Conf) when is_list(Conf) ->
%% a_function/1
- ?line eval(a_function([]), from_term([], [{atom,atom}])),
- ?line eval(a_function([{a,b},{a,b},{b,c}]), from_term([{a,b},{b,c}])),
- ?line {'EXIT', {badarg, _}} = (catch a_function([{a}])),
- ?line {'EXIT', {badarg, _}} = (catch a_function([{a},{b},{c,d}])),
- ?line {'EXIT', {badarg, _}} = (catch a_function(a)),
- ?line {'EXIT', {badarg, _}} = (catch a_function([{a,b} | a])),
- ?line {'EXIT', {bad_function, _}} =
+ eval(a_function([]), from_term([], [{atom,atom}])),
+ eval(a_function([{a,b},{a,b},{b,c}]), from_term([{a,b},{b,c}])),
+ {'EXIT', {badarg, _}} = (catch a_function([{a}])),
+ {'EXIT', {badarg, _}} = (catch a_function([{a},{b},{c,d}])),
+ {'EXIT', {badarg, _}} = (catch a_function(a)),
+ {'EXIT', {badarg, _}} = (catch a_function([{a,b} | a])),
+ {'EXIT', {bad_function, _}} =
(catch a_function([{a,b},{b,c},{a,c}])),
F = 0.0, I = round(F),
if
F == I -> % term ordering
- ?line {'EXIT', {bad_function, _}} =
+ {'EXIT', {bad_function, _}} =
(catch a_function([{I,a},{F,b}])),
- ?line {'EXIT', {bad_function, _}} =
- (catch a_function([{[I],a},{[F],b}],[{[a],b}]));
+ {'EXIT', {bad_function, _}} =
+ (catch a_function([{[I],a},{[F],b}],[{[a],b}]));
true ->
- ?line 2 = no_elements(a_function([{I,a},{F,b}])),
- ?line 2 = no_elements(a_function([{[I],a},{[F],b}],[{[a],b}]))
+ 2 = no_elements(a_function([{I,a},{F,b}])),
+ 2 = no_elements(a_function([{[I],a},{[F],b}],[{[a],b}]))
end,
%% a_function/2
FT = [{atom,atom}],
- ?line eval(a_function([], FT), from_term([], FT)),
- ?line eval(a_function([{a,b},{b,c},{b,c}], FT),
- from_term([{a,b},{b,c}], FT)),
- ?line {'EXIT', {badarg, _}} = (catch a_function([{a,b}], [{a}])),
- ?line {'EXIT', {badarg, _}} = (catch a_function([{a,b}], [{a,[b,c]}])),
- ?line {'EXIT', {badarg, _}} = (catch a_function([{a}], FT)),
- ?line {'EXIT', {badarg, _}} = (catch a_function([{a},{b},{c,d}], FT)),
- ?line {'EXIT', {badarg, _}} = (catch a_function(a, FT)),
- ?line {'EXIT', {badarg, _}} = (catch a_function([{a,b} | a], FT)),
- ?line eval(a_function([{{a},[{foo,bar}]}], ['_']),
- from_term([{{a},[{foo,bar}]}], ['_'])),
- ?line eval(a_function([], ['_']), from_term([], ['_'])),
- ?line {'EXIT', {badarg, _}} = (catch a_function([[a]],['_'])),
- ?line {'EXIT', {bad_function, _}} =
+ eval(a_function([], FT), from_term([], FT)),
+ eval(a_function([{a,b},{b,c},{b,c}], FT),
+ from_term([{a,b},{b,c}], FT)),
+ {'EXIT', {badarg, _}} = (catch a_function([{a,b}], [{a}])),
+ {'EXIT', {badarg, _}} = (catch a_function([{a,b}], [{a,[b,c]}])),
+ {'EXIT', {badarg, _}} = (catch a_function([{a}], FT)),
+ {'EXIT', {badarg, _}} = (catch a_function([{a},{b},{c,d}], FT)),
+ {'EXIT', {badarg, _}} = (catch a_function(a, FT)),
+ {'EXIT', {badarg, _}} = (catch a_function([{a,b} | a], FT)),
+ eval(a_function([{{a},[{foo,bar}]}], ['_']),
+ from_term([{{a},[{foo,bar}]}], ['_'])),
+ eval(a_function([], ['_']), from_term([], ['_'])),
+ {'EXIT', {badarg, _}} = (catch a_function([[a]],['_'])),
+ {'EXIT', {bad_function, _}} =
(catch a_function([{a,b},{b,c},{a,c}], FT)),
- ?line eval(a_function([{a,[a]},{a,[a,a]}], [{atom,[atom]}]),
- from_term([{a,[a]}])),
- ?line eval(a_function([{[b,a],c},{[a,b],c}], [{[atom],atom}]),
- from_term([{[a,b],c}])),
+ eval(a_function([{a,[a]},{a,[a,a]}], [{atom,[atom]}]),
+ from_term([{a,[a]}])),
+ eval(a_function([{[b,a],c},{[a,b],c}], [{[atom],atom}]),
+ from_term([{[a,b],c}])),
ok.
-family_1(suite) -> [];
-family_1(doc) -> [""];
family_1(Conf) when is_list(Conf) ->
%% family/1
- ?line eval(family([]), from_term([],[{atom,[atom]}])),
- ?line {'EXIT', {badarg, _}} = (catch family(a)),
- ?line {'EXIT', {badarg, _}} = (catch family([a])),
- ?line {'EXIT', {badarg, _}} = (catch family([{a,b}])),
- ?line {'EXIT', {badarg, _}} = (catch family([{a,[]} | a])),
- ?line {'EXIT', {badarg, _}} = (catch family([{a,[a|b]}])),
- ?line {'EXIT', {bad_function, _}} =
+ eval(family([]), from_term([],[{atom,[atom]}])),
+ {'EXIT', {badarg, _}} = (catch family(a)),
+ {'EXIT', {badarg, _}} = (catch family([a])),
+ {'EXIT', {badarg, _}} = (catch family([{a,b}])),
+ {'EXIT', {badarg, _}} = (catch family([{a,[]} | a])),
+ {'EXIT', {badarg, _}} = (catch family([{a,[a|b]}])),
+ {'EXIT', {bad_function, _}} =
(catch family([{a,[a]},{a,[]}])),
- ?line {'EXIT', {bad_function, _}} =
+ {'EXIT', {bad_function, _}} =
(catch family([{a,[]},{b,[]},{a,[a]}])),
F = 0.0, I = round(F),
if
F == I -> % term ordering
- ?line {'EXIT', {bad_function, _}} =
+ {'EXIT', {bad_function, _}} =
(catch family([{I,[a]},{F,[b]}])),
- ?line true = (1 =:= no_elements(family([{a,[I]},{a,[F]}])));
+ true = (1 =:= no_elements(family([{a,[I]},{a,[F]}])));
true ->
- ?line {'EXIT', {bad_function, _}} =
+ {'EXIT', {bad_function, _}} =
(catch family([{a,[I]},{a,[F]}]))
end,
- ?line eval(family([{a,[]},{b,[b]},{a,[]}]), from_term([{a,[]},{b,[b]}])),
- ?line eval(to_external(family([{b,[{hej,san},tjo]},{a,[]}])),
- [{a,[]},{b,[tjo,{hej,san}]}]),
- ?line eval(family([{a,[a]},{a,[a,a]}]), family([{a,[a]}])),
+ eval(family([{a,[]},{b,[b]},{a,[]}]), from_term([{a,[]},{b,[b]}])),
+ eval(to_external(family([{b,[{hej,san},tjo]},{a,[]}])),
+ [{a,[]},{b,[tjo,{hej,san}]}]),
+ eval(family([{a,[a]},{a,[a,a]}]), family([{a,[a]}])),
%% family/2
FT = [{a,[a]}],
- ?line eval(family([], FT), from_term([],FT)),
- ?line {'EXIT', {badarg, _}} = (catch family(a,FT)),
- ?line {'EXIT', {badarg, _}} = (catch family([a],FT)),
- ?line {'EXIT', {badarg, _}} = (catch family([{a,b}],FT)),
- ?line {'EXIT', {badarg, _}} = (catch family([{a,[]} | a],FT)),
- ?line {'EXIT', {badarg, _}} = (catch family([{a,[a|b]}], FT)),
- ?line {'EXIT', {bad_function, _}} =
+ eval(family([], FT), from_term([],FT)),
+ {'EXIT', {badarg, _}} = (catch family(a,FT)),
+ {'EXIT', {badarg, _}} = (catch family([a],FT)),
+ {'EXIT', {badarg, _}} = (catch family([{a,b}],FT)),
+ {'EXIT', {badarg, _}} = (catch family([{a,[]} | a],FT)),
+ {'EXIT', {badarg, _}} = (catch family([{a,[a|b]}], FT)),
+ {'EXIT', {bad_function, _}} =
(catch family([{a,[a]},{a,[]}], FT)),
- ?line {'EXIT', {bad_function, _}} =
+ {'EXIT', {bad_function, _}} =
(catch family([{a,[]},{b,[]},{a,[a]}], FT)),
- ?line eval(family([{a,[]},{b,[b,b]},{a,[]}], FT),
- from_term([{a,[]},{b,[b]}], FT)),
- ?line eval(to_external(family([{b,[{hej,san},tjo]},{a,[]}], FT)),
- [{a,[]},{b,[tjo,{hej,san}]}]),
-
- ?line eval(family([{{a},[{foo,bar}]}], ['_']),
- from_term([{{a},[{foo,bar}]}], ['_'])),
- ?line eval(family([], ['_']), from_term([], ['_'])),
- ?line {'EXIT', {badarg, _}} = (catch family([[a]],['_'])),
- ?line {'EXIT', {badarg, _}} = (catch family([{a,b}],['_'])),
- ?line {'EXIT', {badarg, _}} =
+ eval(family([{a,[]},{b,[b,b]},{a,[]}], FT),
+ from_term([{a,[]},{b,[b]}], FT)),
+ eval(to_external(family([{b,[{hej,san},tjo]},{a,[]}], FT)),
+ [{a,[]},{b,[tjo,{hej,san}]}]),
+
+ eval(family([{{a},[{foo,bar}]}], ['_']),
+ from_term([{{a},[{foo,bar}]}], ['_'])),
+ eval(family([], ['_']), from_term([], ['_'])),
+ {'EXIT', {badarg, _}} = (catch family([[a]],['_'])),
+ {'EXIT', {badarg, _}} = (catch family([{a,b}],['_'])),
+ {'EXIT', {badarg, _}} =
(catch family([{a,[foo]}], [{atom,atom}])),
- ?line eval(family([{{a},[{foo,bar}]}], [{{dt},[{r1,t2}]}]),
- from_term([{{a},[{foo,bar}]}], [{{dt},[{r1,t2}]}])),
- ?line eval(family([{a,[a]},{a,[a,a]}],[{atom,[atom]}]),
- family([{a,[a]}])),
- ?line eval(family([{[a,b],[a]},{[b,a],[a,a]}],[{[atom],[atom]}]),
- from_term([{[a,b],[a]},{[b,a],[a,a]}])),
+ eval(family([{{a},[{foo,bar}]}], [{{dt},[{r1,t2}]}]),
+ from_term([{{a},[{foo,bar}]}], [{{dt},[{r1,t2}]}])),
+ eval(family([{a,[a]},{a,[a,a]}],[{atom,[atom]}]),
+ family([{a,[a]}])),
+ eval(family([{[a,b],[a]},{[b,a],[a,a]}],[{[atom],[atom]}]),
+ from_term([{[a,b],[a]},{[b,a],[a,a]}])),
ok.
-projection(suite) -> [];
-projection(doc) -> [""];
projection(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([]),
+ E = empty_set(),
+ ER = relation([]),
%% set of ordered sets
- ?line S1 = relation([{a,1},{b,2},{b,22},{c,0}]),
- ?line S2 = relation([{a,1},{a,2},{a,3},{b,4},{b,5},{b,6}]),
-
- ?line eval(projection(1, E), E),
- ?line eval(projection(1, ER), set([])),
- ?line eval(projection(1, relation([{a,1}])), set([a])),
- ?line eval(projection(1, S1), set([a,b,c])),
- ?line eval(projection(1, S2), set([a,b])),
- ?line eval(projection(2, S1), set([0,1,2,22])),
- ?line eval(projection(2, relation([{1,a},{2,a},{3,b}])), set([a,b])),
- ?line eval(projection(1, relation([{a},{b},{c}])), set([a,b,c])),
+ S1 = relation([{a,1},{b,2},{b,22},{c,0}]),
+ S2 = relation([{a,1},{a,2},{a,3},{b,4},{b,5},{b,6}]),
+
+ eval(projection(1, E), E),
+ eval(projection(1, ER), set([])),
+ eval(projection(1, relation([{a,1}])), set([a])),
+ eval(projection(1, S1), set([a,b,c])),
+ eval(projection(1, S2), set([a,b])),
+ eval(projection(2, S1), set([0,1,2,22])),
+ eval(projection(2, relation([{1,a},{2,a},{3,b}])), set([a,b])),
+ eval(projection(1, relation([{a},{b},{c}])), set([a,b,c])),
Fun1 = {external, fun({A,B,C}) -> {A,{B,C}} end},
- ?line eval(projection(Fun1, E), E),
+ eval(projection(Fun1, E), E),
%% No check here:
- ?line eval(projection(3, projection(Fun1, empty_set())), E),
- ?line E2 = relation([], 3),
- ?line eval(projection(Fun1, E2), from_term([], [{atom,{atom,atom}}])),
+ eval(projection(3, projection(Fun1, empty_set())), E),
+ E2 = relation([], 3),
+ eval(projection(Fun1, E2), from_term([], [{atom,{atom,atom}}])),
Fun2 = {external, fun({A,_B}) -> {A} end},
- ?line eval(projection(Fun2, ER), from_term([], [{atom}])),
- ?line eval(projection(Fun2, relation([{a,1}])), relation([{a}])),
- ?line eval(projection(Fun2, relation([{a,1},{b,3},{a,2}])),
- relation([{a},{b}])),
+ eval(projection(Fun2, ER), from_term([], [{atom}])),
+ eval(projection(Fun2, relation([{a,1}])), relation([{a}])),
+ eval(projection(Fun2, relation([{a,1},{b,3},{a,2}])),
+ relation([{a},{b}])),
Fun3 = {external, fun({A,_B,C}) -> {C,{A},C} end},
- ?line eval(projection(Fun3, relation([{a,1,x},{b,3,y},{a,2,z}])),
- from_term([{x,{a},x},{y,{b},y},{z,{a},z}])),
+ eval(projection(Fun3, relation([{a,1,x},{b,3,y},{a,2,z}])),
+ from_term([{x,{a},x},{y,{b},y},{z,{a},z}])),
Fun4 = {external, fun(A={B,_C,_D}) -> {B, A} end},
- ?line eval(projection(Fun4, relation([{a,1,x},{b,3,y},{a,2,z}])),
- from_term([{a,{a,1,x}},{b,{b,3,y}},{a,{a,2,z}}])),
+ eval(projection(Fun4, relation([{a,1,x},{b,3,y},{a,2,z}])),
+ from_term([{a,{a,1,x}},{b,{b,3,y}},{a,{a,2,z}}])),
- ?line eval(projection({external, fun({A,B,_C,D}) -> {A,B,A,D} end},
- relation([{1,1,1,2}, {1,1,3,1}])),
- relation([{1,1,1,1}, {1,1,1,2}])),
+ eval(projection({external, fun({A,B,_C,D}) -> {A,B,A,D} end},
+ relation([{1,1,1,2}, {1,1,3,1}])),
+ relation([{1,1,1,1}, {1,1,1,2}])),
- ?line {'EXIT', {badarg, _}} = (catch projection(1, set([]))),
- ?line {'EXIT', {function_clause, _}} =
+ {'EXIT', {badarg, _}} = (catch projection(1, set([]))),
+ {'EXIT', {function_clause, _}} =
(catch projection({external, fun({A}) -> A end}, S1)),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch projection({external, fun({A,_}) -> {A,0} end},
from_term([{1,a}]))),
%% {} is not an ordered set
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch projection({external, fun(_) -> {} end}, ER)),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch projection({external, fun(_) -> {{}} end}, ER)),
- ?line eval(projection({external, fun({T,_}) -> T end},
- relation([{{},a},{{},b}])),
- set([{}])),
- ?line eval(projection({external, fun({T}) -> T end}, relation([{{}}])),
- set([{}])),
-
- ?line eval(projection({external, fun(A) -> {A} end},
- relation([{1,a},{2,b}])),
- from_term([{{1,a}},{{2,b}}])),
- ?line eval(projection({external, fun({A,B}) -> {B,A} end},
- relation([{1,a},{2,b}])),
- relation([{a,1},{b,2}])),
- ?line eval(projection({external, fun(X=Y=A) -> {X,Y,A} end}, set([a,b,c])),
- relation([{a,a,a},{b,b,b},{c,c,c}])),
-
- ?line eval(projection({external, fun({A,{_},B}) -> {A,B} end},
- from_term([{a,{a},b},{a,{b},c}])),
- relation([{a,b},{a,c}])),
- ?line eval(projection({external, fun({A,_,B}) -> {A,B} end},
- relation([{a,{},b},{a,{},c}])),
- relation([{a,b},{a,c}])),
+ eval(projection({external, fun({T,_}) -> T end},
+ relation([{{},a},{{},b}])),
+ set([{}])),
+ eval(projection({external, fun({T}) -> T end}, relation([{{}}])),
+ set([{}])),
+
+ eval(projection({external, fun(A) -> {A} end},
+ relation([{1,a},{2,b}])),
+ from_term([{{1,a}},{{2,b}}])),
+ eval(projection({external, fun({A,B}) -> {B,A} end},
+ relation([{1,a},{2,b}])),
+ relation([{a,1},{b,2}])),
+ eval(projection({external, fun(X=Y=A) -> {X,Y,A} end}, set([a,b,c])),
+ relation([{a,a,a},{b,b,b},{c,c,c}])),
+
+ eval(projection({external, fun({A,{_},B}) -> {A,B} end},
+ from_term([{a,{a},b},{a,{b},c}])),
+ relation([{a,b},{a,c}])),
+ eval(projection({external, fun({A,_,B}) -> {A,B} end},
+ relation([{a,{},b},{a,{},c}])),
+ relation([{a,b},{a,c}])),
Fun5 = fun(S) -> from_term({to_external(S),0}, {type(S),atom}) end,
- ?line eval(projection(Fun5, E), E),
- ?line eval(projection(Fun5, set([a,b])), from_term([{a,0},{b,0}])),
- ?line eval(projection(Fun5, relation([{a,1},{b,2}])),
- from_term([{{a,1},0},{{b,2},0}])),
- ?line eval(projection(Fun5, from_term([[a],[b]])),
- from_term([{[a],0},{[b],0}])),
+ eval(projection(Fun5, E), E),
+ eval(projection(Fun5, set([a,b])), from_term([{a,0},{b,0}])),
+ eval(projection(Fun5, relation([{a,1},{b,2}])),
+ from_term([{{a,1},0},{{b,2},0}])),
+ eval(projection(Fun5, from_term([[a],[b]])),
+ from_term([{[a],0},{[b],0}])),
F = 0.0, I = round(F),
- ?line FR = relation([{I},{F}]),
+ FR = relation([{I},{F}]),
if
F == I -> % term ordering
true = (no_elements(projection(1, FR)) =:= 1);
@@ -532,382 +517,374 @@ projection(Conf) when is_list(Conf) ->
end,
%% set of sets
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch projection({external, fun(X) -> X end},
from_term([], [[atom]]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch projection({external, fun(X) -> X end}, from_term([[a]]))),
- ?line eval(projection(fun sofs:union/1,
- from_term([[[1,2],[2,3]], [[a,b],[b,c]]])),
- from_term([[1,2,3], [a,b,c]])),
- ?line eval(projection(fun(_) -> from_term([a]) end,
- from_term([[b]], [[a]])),
- from_term([[a]])),
- ?line eval(projection(fun(_) -> from_term([a]) end,
- from_term([[1,2],[3,4]])),
- from_term([[a]])),
+ eval(projection(fun sofs:union/1,
+ from_term([[[1,2],[2,3]], [[a,b],[b,c]]])),
+ from_term([[1,2,3], [a,b,c]])),
+ eval(projection(fun(_) -> from_term([a]) end,
+ from_term([[b]], [[a]])),
+ from_term([[a]])),
+ eval(projection(fun(_) -> from_term([a]) end,
+ from_term([[1,2],[3,4]])),
+ from_term([[a]])),
Fun10 = fun(S) ->
- %% Cheating a lot...
- case to_external(S) of
- [1] -> from_term({1,1});
- _ -> S
- end
- end,
- ?line eval(projection(Fun10, from_term([[1]])), from_term([{1,1}])),
- ?line eval(projection(fun(_) -> from_term({a}) end, from_term([[a]])),
- from_term([{a}])),
- ?line {'EXIT', {badarg, _}} =
+ %% Cheating a lot...
+ case to_external(S) of
+ [1] -> from_term({1,1});
+ _ -> S
+ end
+ end,
+ eval(projection(Fun10, from_term([[1]])), from_term([{1,1}])),
+ eval(projection(fun(_) -> from_term({a}) end, from_term([[a]])),
+ from_term([{a}])),
+ {'EXIT', {badarg, _}} =
(catch projection(fun(_) -> {a} end, from_term([[a]]))),
ok.
-substitution(suite) -> [];
-substitution(doc) -> [""];
substitution(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([]),
+ E = empty_set(),
+ ER = relation([]),
%% set of ordered sets
- ?line S1 = relation([{a,1},{b,2},{b,22},{c,0}]),
- ?line S2 = relation([{a,1},{a,2},{a,3},{b,4},{b,5},{b,6}]),
+ S1 = relation([{a,1},{b,2},{b,22},{c,0}]),
+ S2 = relation([{a,1},{a,2},{a,3},{b,4},{b,5},{b,6}]),
- ?line eval(substitution(1, E), E),
+ eval(substitution(1, E), E),
%% No check here:
Fun0 = {external, fun({A,B,C}) -> {A,{B,C}} end},
- ?line eval(substitution(3, substitution(Fun0, empty_set())), E),
- ?line eval(substitution(1, ER), from_term([],[{{atom,atom},atom}])),
- ?line eval(substitution(1, relation([{a,1}])), from_term([{{a,1},a}])),
- ?line eval(substitution(1, S1),
- from_term([{{a,1},a},{{b,2},b},{{b,22},b},{{c,0},c}])),
- ?line eval(substitution(1, S2),
- from_term([{{a,1},a},{{a,2},a},{{a,3},a},{{b,4},b},
- {{b,5},b},{{b,6},b}])),
- ?line eval(substitution(2, S1),
- from_term([{{a,1},1},{{b,2},2},{{b,22},22},{{c,0},0}])),
-
+ eval(substitution(3, substitution(Fun0, empty_set())), E),
+ eval(substitution(1, ER), from_term([],[{{atom,atom},atom}])),
+ eval(substitution(1, relation([{a,1}])), from_term([{{a,1},a}])),
+ eval(substitution(1, S1),
+ from_term([{{a,1},a},{{b,2},b},{{b,22},b},{{c,0},c}])),
+ eval(substitution(1, S2),
+ from_term([{{a,1},a},{{a,2},a},{{a,3},a},{{b,4},b},
+ {{b,5},b},{{b,6},b}])),
+ eval(substitution(2, S1),
+ from_term([{{a,1},1},{{b,2},2},{{b,22},22},{{c,0},0}])),
+
Fun1 = fun({A,_B}) -> {A} end,
XFun1 = {external, Fun1},
- ?line eval(substitution(XFun1, E), E),
- ?line eval(substitution(Fun1, E), E),
- ?line eval(substitution(XFun1, ER), from_term([], [{{atom,atom},{atom}}])),
- ?line eval(substitution(XFun1, relation([{a,1}])),
- from_term([{{a,1},{a}}])),
- ?line eval(substitution(XFun1, relation([{a,1},{b,3},{a,2}])),
- from_term([{{a,1},{a}},{{a,2},{a}},{{b,3},{b}}])),
- ?line eval(substitution({external, fun({A,_B,C}) -> {C,A,C} end},
- relation([{a,1,x},{b,3,y},{a,2,z}])),
- from_term([{{a,1,x},{x,a,x}},{{a,2,z},{z,a,z}},
- {{b,3,y},{y,b,y}}])),
+ eval(substitution(XFun1, E), E),
+ eval(substitution(Fun1, E), E),
+ eval(substitution(XFun1, ER), from_term([], [{{atom,atom},{atom}}])),
+ eval(substitution(XFun1, relation([{a,1}])),
+ from_term([{{a,1},{a}}])),
+ eval(substitution(XFun1, relation([{a,1},{b,3},{a,2}])),
+ from_term([{{a,1},{a}},{{a,2},{a}},{{b,3},{b}}])),
+ eval(substitution({external, fun({A,_B,C}) -> {C,A,C} end},
+ relation([{a,1,x},{b,3,y},{a,2,z}])),
+ from_term([{{a,1,x},{x,a,x}},{{a,2,z},{z,a,z}},
+ {{b,3,y},{y,b,y}}])),
Fun2 = fun(S) -> {A,_B} = to_external(S), from_term({A}) end,
- ?line eval(substitution(Fun2, ER), E),
- ?line eval(substitution(Fun2, relation([{a,1}])),
- from_term([{{a,1},{a}}])),
+ eval(substitution(Fun2, ER), E),
+ eval(substitution(Fun2, relation([{a,1}])),
+ from_term([{{a,1},{a}}])),
Fun3 = fun(S) -> from_term({to_external(S),0}, {type(S),atom}) end,
- ?line eval(substitution(Fun3, E), E),
- ?line eval(substitution(Fun3, set([a,b])),
- from_term([{a,{a,0}},{b,{b,0}}])),
- ?line eval(substitution(Fun3, relation([{a,1},{b,2}])),
- from_term([{{a,1},{{a,1},0}},{{b,2},{{b,2},0}}])),
- ?line eval(substitution(Fun3, from_term([[a],[b]])),
- from_term([{[a],{[a],0}},{[b],{[b],0}}])),
-
- ?line eval(substitution(fun(_) -> E end, from_term([[a],[b]])),
- from_term([{[a],[]},{[b],[]}])),
-
- ?line {'EXIT', {badarg, _}} = (catch substitution(1, set([]))),
- ?line eval(substitution(1, ER), from_term([], [{{atom,atom},atom}])),
- ?line {'EXIT', {function_clause, _}} =
+ eval(substitution(Fun3, E), E),
+ eval(substitution(Fun3, set([a,b])),
+ from_term([{a,{a,0}},{b,{b,0}}])),
+ eval(substitution(Fun3, relation([{a,1},{b,2}])),
+ from_term([{{a,1},{{a,1},0}},{{b,2},{{b,2},0}}])),
+ eval(substitution(Fun3, from_term([[a],[b]])),
+ from_term([{[a],{[a],0}},{[b],{[b],0}}])),
+
+ eval(substitution(fun(_) -> E end, from_term([[a],[b]])),
+ from_term([{[a],[]},{[b],[]}])),
+
+ {'EXIT', {badarg, _}} = (catch substitution(1, set([]))),
+ eval(substitution(1, ER), from_term([], [{{atom,atom},atom}])),
+ {'EXIT', {function_clause, _}} =
(catch substitution({external, fun({A,_}) -> A end}, set([]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch substitution({external, fun({A,_}) -> {A,0} end},
from_term([{1,a}]))),
%% set of sets
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch substitution({external, fun(X) -> X end},
from_term([], [[atom]]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch substitution({external, fun(X) -> X end}, from_term([[a]]))),
- ?line eval(substitution(fun(X) -> X end, from_term([], [[atom]])), E),
- ?line eval(substitution(fun sofs:union/1,
- from_term([[[1,2],[2,3]], [[a,b],[b,c]]])),
- from_term([{[[1,2],[2,3]],[1,2,3]}, {[[a,b],[b,c]],[a,b,c]}])),
- ?line eval(substitution(fun(_) -> from_term([a]) end,
- from_term([[b]], [[a]])),
- from_term([{[b],[a]}], [{[a],[atom]}])),
- ?line eval(substitution(fun(_) -> from_term([a]) end,
- from_term([[1,2],[3,4]])),
- from_term([{[1,2],[a]},{[3,4],[a]}])),
+ eval(substitution(fun(X) -> X end, from_term([], [[atom]])), E),
+ eval(substitution(fun sofs:union/1,
+ from_term([[[1,2],[2,3]], [[a,b],[b,c]]])),
+ from_term([{[[1,2],[2,3]],[1,2,3]}, {[[a,b],[b,c]],[a,b,c]}])),
+ eval(substitution(fun(_) -> from_term([a]) end,
+ from_term([[b]], [[a]])),
+ from_term([{[b],[a]}], [{[a],[atom]}])),
+ eval(substitution(fun(_) -> from_term([a]) end,
+ from_term([[1,2],[3,4]])),
+ from_term([{[1,2],[a]},{[3,4],[a]}])),
Fun10 = fun(S) ->
- %% Cheating a lot...
- case to_external(S) of
- [1] -> from_term({1,1});
- _ -> S
- end
- end,
- ?line eval(substitution(Fun10, from_term([[1]])),
- from_term([{[1],{1,1}}])),
- ?line {'EXIT', {type_mismatch, _}} =
+ %% Cheating a lot...
+ case to_external(S) of
+ [1] -> from_term({1,1});
+ _ -> S
+ end
+ end,
+ eval(substitution(Fun10, from_term([[1]])),
+ from_term([{[1],{1,1}}])),
+ {'EXIT', {type_mismatch, _}} =
(catch substitution(Fun10, from_term([[1],[2]]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch substitution(Fun10, from_term([[1],[0]]))),
- ?line eval(substitution(fun(_) -> from_term({a}) end, from_term([[a]])),
- from_term([{[a],{a}}])),
- ?line {'EXIT', {badarg, _}} =
+ eval(substitution(fun(_) -> from_term({a}) end, from_term([[a]])),
+ from_term([{[a],{a}}])),
+ {'EXIT', {badarg, _}} =
(catch substitution(fun(_) -> {a} end, from_term([[a]]))),
ok.
-restriction(suite) -> [];
-restriction(doc) -> [""];
restriction(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([], 2),
+ E = empty_set(),
+ ER = relation([], 2),
%% set of ordered sets
- ?line S1 = relation([{a,1},{b,2},{b,22},{c,0}]),
- ?line eval(restriction(S1, set([a,b])),
- relation([{a,1},{b,2},{b,22}])),
- ?line eval(restriction(2, S1, set([1,2])),
- relation([{a,1},{b,2}])),
- ?line eval(restriction(S1, set([a,b,c])), S1),
- ?line eval(restriction(1, S1, set([0,1,d,e])), ER),
- ?line eval(restriction(1, S1, E), ER),
- ?line eval(restriction({external, fun({_A,B,C}) -> {B,C} end},
- relation([{a,aa,1},{b,bb,2},{c,cc,3}]),
- relation([{bb,2},{cc,3}])),
- relation([{b,bb,2},{c,cc,3}])),
+ S1 = relation([{a,1},{b,2},{b,22},{c,0}]),
+ eval(restriction(S1, set([a,b])),
+ relation([{a,1},{b,2},{b,22}])),
+ eval(restriction(2, S1, set([1,2])),
+ relation([{a,1},{b,2}])),
+ eval(restriction(S1, set([a,b,c])), S1),
+ eval(restriction(1, S1, set([0,1,d,e])), ER),
+ eval(restriction(1, S1, E), ER),
+ eval(restriction({external, fun({_A,B,C}) -> {B,C} end},
+ relation([{a,aa,1},{b,bb,2},{c,cc,3}]),
+ relation([{bb,2},{cc,3}])),
+ relation([{b,bb,2},{c,cc,3}])),
R1 = relation([],[{a,b}]),
- ?line eval(restriction(2, R1,sofs:set([],[b])), R1),
+ eval(restriction(2, R1,sofs:set([],[b])), R1),
Id = fun(X) -> X end,
XId = {external, Id},
- ?line eval(restriction(XId, relation([{a,b}]), E), ER),
- ?line eval(restriction(XId, E, relation([{b,d}])), E),
+ eval(restriction(XId, relation([{a,b}]), E), ER),
+ eval(restriction(XId, E, relation([{b,d}])), E),
Fun1 = fun(S) -> {_A,B,C} = to_external(S), from_term({B,C}) end,
- ?line eval(restriction(Fun1,
- relation([{a,aa,1},{b,bb,2},{c,cc,3}]),
- relation([{bb,2},{cc,3}])),
- relation([{b,bb,2},{c,cc,3}])),
- ?line eval(restriction({external, fun({_,{A},B}) -> {A,B} end},
- from_term([{a,{aa},1},{b,{bb},2},{c,{cc},3}]),
- from_term([{bb,2},{cc,3}])),
- from_term([{b,{bb},2},{c,{cc},3}])),
+ eval(restriction(Fun1,
+ relation([{a,aa,1},{b,bb,2},{c,cc,3}]),
+ relation([{bb,2},{cc,3}])),
+ relation([{b,bb,2},{c,cc,3}])),
+ eval(restriction({external, fun({_,{A},B}) -> {A,B} end},
+ from_term([{a,{aa},1},{b,{bb},2},{c,{cc},3}]),
+ from_term([{bb,2},{cc,3}])),
+ from_term([{b,{bb},2},{c,{cc},3}])),
S5 = relation([{1,a},{2,b},{3,c}]),
- ?line eval(restriction(2, S5, set([b,c])), relation([{2,b},{3,c}])),
+ eval(restriction(2, S5, set([b,c])), relation([{2,b},{3,c}])),
S4 = relation([{a,1},{b,2},{b,27},{c,0}]),
- ?line eval(restriction(2, S4, E), ER),
+ eval(restriction(2, S4, E), ER),
S6 = relation([{1,a},{2,c},{3,b}]),
- ?line eval(restriction(2, S6, set([d,e])), ER),
- ?line eval(restriction(2,
- relation([{1,d},{2,c},{3,b},{4,a},{5,e}]),
- set([c])),
- relation([{2,c}])),
- ?line eval(restriction(XId,
- relation([{1,a},{3,b},{4,c},{4,d}]),
- relation([{2,a},{2,c},{4,c}])),
- relation([{4,c}])),
- ?line eval(restriction(2, relation([{a,b}]), E), ER),
- ?line eval(restriction(2, E, relation([{b,d}])), E),
- ?line eval(restriction(2, relation([{b,d}]), E), ER),
- ?line eval(restriction(XId, E, set([a])), E),
- ?line eval(restriction(1, S1, E), ER),
- ?line {'EXIT', {badarg, _}} =
+ eval(restriction(2, S6, set([d,e])), ER),
+ eval(restriction(2,
+ relation([{1,d},{2,c},{3,b},{4,a},{5,e}]),
+ set([c])),
+ relation([{2,c}])),
+ eval(restriction(XId,
+ relation([{1,a},{3,b},{4,c},{4,d}]),
+ relation([{2,a},{2,c},{4,c}])),
+ relation([{4,c}])),
+ eval(restriction(2, relation([{a,b}]), E), ER),
+ eval(restriction(2, E, relation([{b,d}])), E),
+ eval(restriction(2, relation([{b,d}]), E), ER),
+ eval(restriction(XId, E, set([a])), E),
+ eval(restriction(1, S1, E), ER),
+ {'EXIT', {badarg, _}} =
(catch restriction(3, relation([{a,b}]), E)),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch restriction(3, relation([{a,b}]), relation([{b,d}]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch restriction(3, relation([{a,b}]), set([{b,d}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch restriction(2, relation([{a,b}]), relation([{b,d}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch restriction({external, fun({A,_B}) -> A end},
relation([{a,b}]), relation([{b,d}]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch restriction({external, fun({A,_}) -> {A,0} end},
from_term([{1,a}]),
from_term([{1,0}]))),
- ?line eval(restriction(2, relation([{a,d},{b,e},{c,b},{d,c}]), set([b,d])),
- relation([{a,d},{c,b}])),
- ?line {'EXIT', {function_clause, _}} =
+ eval(restriction(2, relation([{a,d},{b,e},{c,b},{d,c}]), set([b,d])),
+ relation([{a,d},{c,b}])),
+ {'EXIT', {function_clause, _}} =
(catch restriction({external, fun({A,_B}) -> A end}, set([]), E)),
Fun3 = fun(S) -> from_term({to_external(S),0}, {type(S),atom}) end,
- ?line eval(restriction(Fun3, set([1,2]), from_term([{1,0}])),
- from_term([1])),
+ eval(restriction(Fun3, set([1,2]), from_term([{1,0}])),
+ from_term([1])),
%% set of sets
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch restriction({external, fun(X) -> X end},
from_term([], [[atom]]), set([a]))),
S2 = from_term([], [[atom]]),
- ?line eval(restriction(Id, S2, E), E),
+ eval(restriction(Id, S2, E), E),
S3 = from_term([[a],[b]], [[atom]]),
- ?line eval(restriction(Id, S3, E), E),
- ?line eval(restriction(Id, from_term([], [[atom]]), set([a])),
- from_term([], [[atom]])),
- ?line eval(restriction(fun sofs:union/1,
- from_term([[[a],[b]], [[b],[c]],
- [[], [a,b]], [[1],[2]]]),
- from_term([[a,b],[1,2,3],[b,c]])),
- from_term([[[],[a,b]], [[a],[b]],[[b],[c]]])),
- ?line eval(restriction(fun(_) -> from_term([a]) end,
- from_term([], [[atom]]),
- from_term([], [[a]])),
- from_term([], [[atom]])),
- ?line {'EXIT', {type_mismatch, _}} =
+ eval(restriction(Id, S3, E), E),
+ eval(restriction(Id, from_term([], [[atom]]), set([a])),
+ from_term([], [[atom]])),
+ eval(restriction(fun sofs:union/1,
+ from_term([[[a],[b]], [[b],[c]],
+ [[], [a,b]], [[1],[2]]]),
+ from_term([[a,b],[1,2,3],[b,c]])),
+ from_term([[[],[a,b]], [[a],[b]],[[b],[c]]])),
+ eval(restriction(fun(_) -> from_term([a]) end,
+ from_term([], [[atom]]),
+ from_term([], [[a]])),
+ from_term([], [[atom]])),
+ {'EXIT', {type_mismatch, _}} =
(catch restriction(fun(_) -> from_term([a]) end,
from_term([[1,2],[3,4]]),
from_term([], [atom]))),
Fun10 = fun(S) ->
- %% Cheating a lot...
- case to_external(S) of
- [1] -> from_term({1,1});
- _ -> S
- end
- end,
- ?line {'EXIT', {type_mismatch, _}} =
+ %% Cheating a lot...
+ case to_external(S) of
+ [1] -> from_term({1,1});
+ _ -> S
+ end
+ end,
+ {'EXIT', {type_mismatch, _}} =
(catch restriction(Fun10, from_term([[1]]), from_term([], [[atom]]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch restriction(fun(_) -> from_term({a}) end,
from_term([[a]]),
from_term([], [atom]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch restriction(fun(_) -> {a} end,
from_term([[a]]),
from_term([], [atom]))),
ok.
-drestriction(suite) -> [];
-drestriction(doc) -> [""];
drestriction(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([], 2),
+ E = empty_set(),
+ ER = relation([], 2),
%% set of ordered sets
- ?line S1 = relation([{a,1},{b,2},{b,22},{c,0}]),
- ?line eval(drestriction(S1, set([a,b])), relation([{c,0}])),
- ?line eval(drestriction(2, S1, set([1,2])),
- relation([{b,22},{c,0}])),
- ?line eval(drestriction(S1, set([a,b,c])), ER),
- ?line eval(drestriction(2, ER, set([a,b])), ER),
- ?line eval(drestriction(1, S1, set([0,1,d,e])), S1),
- ?line eval(drestriction(1, S1, E), S1),
- ?line eval(drestriction({external, fun({_A,B,C}) -> {B,C} end},
- relation([{a,aa,1},{b,bb,2},{c,cc,3}]),
- relation([{bb,2},{cc,3}])),
- relation([{a,aa,1}])),
+ S1 = relation([{a,1},{b,2},{b,22},{c,0}]),
+ eval(drestriction(S1, set([a,b])), relation([{c,0}])),
+ eval(drestriction(2, S1, set([1,2])),
+ relation([{b,22},{c,0}])),
+ eval(drestriction(S1, set([a,b,c])), ER),
+ eval(drestriction(2, ER, set([a,b])), ER),
+ eval(drestriction(1, S1, set([0,1,d,e])), S1),
+ eval(drestriction(1, S1, E), S1),
+ eval(drestriction({external, fun({_A,B,C}) -> {B,C} end},
+ relation([{a,aa,1},{b,bb,2},{c,cc,3}]),
+ relation([{bb,2},{cc,3}])),
+ relation([{a,aa,1}])),
Id = fun(X) -> X end,
XId = {external, Id},
- ?line eval(drestriction(XId, relation([{a,b}]), E), relation([{a,b}])),
- ?line eval(drestriction(XId, E, relation([{b,d}])), E),
+ eval(drestriction(XId, relation([{a,b}]), E), relation([{a,b}])),
+ eval(drestriction(XId, E, relation([{b,d}])), E),
Fun1 = fun(S) -> {_A,B,C} = to_external(S), from_term({B,C}) end,
- ?line eval(drestriction(Fun1,
- relation([{a,aa,1},{b,bb,2},{c,cc,3}]),
- relation([{bb,2},{cc,3}])),
- relation([{a,aa,1}])),
- ?line eval(drestriction({external, fun({_,{A},B}) -> {A,B} end},
- from_term([{a,{aa},1},{b,{bb},2},{c,{cc},3}]),
- from_term([{bb,2},{cc,3}])),
- from_term([{a,{aa},1}])),
+ eval(drestriction(Fun1,
+ relation([{a,aa,1},{b,bb,2},{c,cc,3}]),
+ relation([{bb,2},{cc,3}])),
+ relation([{a,aa,1}])),
+ eval(drestriction({external, fun({_,{A},B}) -> {A,B} end},
+ from_term([{a,{aa},1},{b,{bb},2},{c,{cc},3}]),
+ from_term([{bb,2},{cc,3}])),
+ from_term([{a,{aa},1}])),
S5 = relation([{1,a},{2,b},{3,c}]),
- ?line eval(drestriction(2, S5, set([b,c])), relation([{1,a}])),
+ eval(drestriction(2, S5, set([b,c])), relation([{1,a}])),
S4 = relation([{a,1},{b,2},{b,27},{c,0}]),
- ?line eval(drestriction(2, S4, set([])), S4),
+ eval(drestriction(2, S4, set([])), S4),
S6 = relation([{1,a},{2,c},{3,b}]),
- ?line eval(drestriction(2, S6, set([d,e])), S6),
- ?line eval(drestriction(2,
- relation([{1,d},{2,c},{3,b},{4,a},{5,e}]),
- set([c])),
- relation([{1,d},{3,b},{4,a},{5,e}])),
- ?line eval(drestriction(XId,
- relation([{1,a},{3,b},{4,c},{4,d}]),
- relation([{2,a},{2,c},{4,c}])),
- relation([{1,a},{3,b},{4,d}])),
- ?line eval(drestriction(2, relation([{a,b}]), E), relation([{a,b}])),
- ?line eval(drestriction(2, E, relation([{b,d}])), E),
- ?line eval(drestriction(2, relation([{b,d}]), E), relation([{b,d}])),
- ?line eval(drestriction(XId, E, set([a])), E),
- ?line eval(drestriction(1, S1, E), S1),
- ?line {'EXIT', {badarg, _}} =
+ eval(drestriction(2, S6, set([d,e])), S6),
+ eval(drestriction(2,
+ relation([{1,d},{2,c},{3,b},{4,a},{5,e}]),
+ set([c])),
+ relation([{1,d},{3,b},{4,a},{5,e}])),
+ eval(drestriction(XId,
+ relation([{1,a},{3,b},{4,c},{4,d}]),
+ relation([{2,a},{2,c},{4,c}])),
+ relation([{1,a},{3,b},{4,d}])),
+ eval(drestriction(2, relation([{a,b}]), E), relation([{a,b}])),
+ eval(drestriction(2, E, relation([{b,d}])), E),
+ eval(drestriction(2, relation([{b,d}]), E), relation([{b,d}])),
+ eval(drestriction(XId, E, set([a])), E),
+ eval(drestriction(1, S1, E), S1),
+ {'EXIT', {badarg, _}} =
(catch drestriction(3, relation([{a,b}]), E)),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch drestriction(3, relation([{a,b}]), relation([{b,d}]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch drestriction(3, relation([{a,b}]), set([{b,d}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch drestriction(2, relation([{a,b}]), relation([{b,d}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch drestriction({external, fun({A,_B}) -> A end},
relation([{a,b}]), relation([{b,d}]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch drestriction({external, fun({A,_}) -> {A,0} end},
from_term([{1,a}]),
from_term([{1,0}]))),
- ?line eval(drestriction(2, relation([{a,d},{b,e},{c,b},{d,c}]), set([b,d])),
- relation([{b,e},{d,c}])),
- ?line {'EXIT', {function_clause, _}} =
+ eval(drestriction(2, relation([{a,d},{b,e},{c,b},{d,c}]), set([b,d])),
+ relation([{b,e},{d,c}])),
+ {'EXIT', {function_clause, _}} =
(catch drestriction({external, fun({A,_B}) -> A end}, set([]), E)),
Fun3 = fun(S) -> from_term({to_external(S),0}, {type(S),atom}) end,
- ?line eval(drestriction(Fun3, set([1,2]), from_term([{1,0}])),
- from_term([2])),
+ eval(drestriction(Fun3, set([1,2]), from_term([{1,0}])),
+ from_term([2])),
%% set of sets
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch drestriction({external, fun(X) -> X end},
from_term([], [[atom]]), set([a]))),
S2 = from_term([], [[atom]]),
- ?line eval(drestriction(Id, S2, E), S2),
+ eval(drestriction(Id, S2, E), S2),
S3 = from_term([[a],[b]], [[atom]]),
- ?line eval(drestriction(Id, S3, E), S3),
- ?line eval(drestriction(Id, from_term([], [[atom]]), set([a])),
- from_term([], [[atom]])),
- ?line eval(drestriction(fun sofs:union/1,
- from_term([[[a],[b]], [[b],[c]],
- [[], [a,b]], [[1],[2]]]),
- from_term([[a,b],[1,2,3],[b,c]])),
- from_term([[[1],[2]]])),
- ?line eval(drestriction(fun(_) -> from_term([a]) end,
- from_term([], [[atom]]),
- from_term([], [[a]])),
- from_term([], [[atom]])),
- ?line {'EXIT', {type_mismatch, _}} =
+ eval(drestriction(Id, S3, E), S3),
+ eval(drestriction(Id, from_term([], [[atom]]), set([a])),
+ from_term([], [[atom]])),
+ eval(drestriction(fun sofs:union/1,
+ from_term([[[a],[b]], [[b],[c]],
+ [[], [a,b]], [[1],[2]]]),
+ from_term([[a,b],[1,2,3],[b,c]])),
+ from_term([[[1],[2]]])),
+ eval(drestriction(fun(_) -> from_term([a]) end,
+ from_term([], [[atom]]),
+ from_term([], [[a]])),
+ from_term([], [[atom]])),
+ {'EXIT', {type_mismatch, _}} =
(catch drestriction(fun(_) -> from_term([a]) end,
from_term([[1,2],[3,4]]),
from_term([], [atom]))),
Fun10 = fun(S) ->
- %% Cheating a lot...
- case to_external(S) of
- [1] -> from_term({1,1});
- _ -> S
- end
- end,
- ?line {'EXIT', {type_mismatch, _}} =
+ %% Cheating a lot...
+ case to_external(S) of
+ [1] -> from_term({1,1});
+ _ -> S
+ end
+ end,
+ {'EXIT', {type_mismatch, _}} =
(catch drestriction(Fun10, from_term([[1]]), from_term([], [[atom]]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch drestriction(fun(_) -> from_term({a}) end,
from_term([[a]]),
from_term([], [atom]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch drestriction(fun(_) -> {a} end,
from_term([[a]]),
from_term([], [atom]))),
ok.
-strict_relation_1(suite) -> [];
-strict_relation_1(doc) -> [""];
strict_relation_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([], 2),
- ?line eval(strict_relation(E), E),
- ?line eval(strict_relation(ER), ER),
- ?line eval(strict_relation(relation([{1,a},{a,a},{2,b}])),
- relation([{1,a},{2,b}])),
- ?line {'EXIT', {badarg, _}} =
+ E = empty_set(),
+ ER = relation([], 2),
+ eval(strict_relation(E), E),
+ eval(strict_relation(ER), ER),
+ eval(strict_relation(relation([{1,a},{a,a},{2,b}])),
+ relation([{1,a},{2,b}])),
+ {'EXIT', {badarg, _}} =
(catch strict_relation(relation([{1,2,3}]))),
F = 0.0, I = round(F),
- ?line FR = relation([{F,I}]),
+ FR = relation([{F,I}]),
if
F == I -> % term ordering
eval(strict_relation(FR), ER);
@@ -916,362 +893,334 @@ strict_relation_1(Conf) when is_list(Conf) ->
end,
ok.
-extension(suite) -> [];
-extension(doc) -> [""];
extension(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([], 2),
- ?line EF = family([]),
- ?line C1 = from_term(3),
- ?line C2 = from_term([3]),
- ?line {'EXIT', {function_clause, _}} = (catch extension(foo, E, C1)),
- ?line {'EXIT', {function_clause, _}} = (catch extension(ER, foo, C1)),
- ?line {'EXIT', {{case_clause, _},_}} = (catch extension(ER, E, foo)),
- ?line {'EXIT', {type_mismatch, _}} = (catch extension(ER, E, E)),
- ?line {'EXIT', {badarg, _}} = (catch extension(C2, E, E)),
- ?line eval(E, extension(E, E, E)),
- ?line eval(EF, extension(EF, E, E)),
- ?line eval(family([{3,[]}]), extension(EF, set([3]), E)),
- ?line eval(ER, extension(ER, E, C1)),
- ?line eval(E, extension(E, ER, E)),
- ?line eval(from_term([],[{{atom,atom},type(ER)}]), extension(E, ER, ER)),
-
- ?line R1 = relation([{c,7},{c,9},{c,11},{d,17},{f,20}]),
- ?line S1 = set([a,c,d,e]),
- ?line eval(extension(R1, S1, C1), lextension(R1, S1, C1)),
-
- ?line S2 = set([1,2,3]),
- ?line eval(extension(ER, S2, C1), lextension(ER, S2, C1)),
-
- ?line R3 = relation([{4,a},{8,b}]),
- ?line S3 = set([1,2,3,4,5,6,7,8,9,10,11]),
- ?line eval(extension(R3, S3, C1), lextension(R3, S3, C1)),
-
- ?line R4 = relation([{2,b},{4,d},{6,f}]),
- ?line S4 = set([1,3,5,7]),
- ?line eval(extension(R4, S4, C1), lextension(R4, S4, C1)),
-
- ?line F1 = family([{a,[1]},{c,[2]}]),
- ?line S5 = set([a,b,c,d]),
- ?line eval(extension(F1, S5, C2), lextension(F1, S5, C2)),
+ E = empty_set(),
+ ER = relation([], 2),
+ EF = family([]),
+ C1 = from_term(3),
+ C2 = from_term([3]),
+ {'EXIT', {function_clause, _}} = (catch extension(foo, E, C1)),
+ {'EXIT', {function_clause, _}} = (catch extension(ER, foo, C1)),
+ {'EXIT', {{case_clause, _},_}} = (catch extension(ER, E, foo)),
+ {'EXIT', {type_mismatch, _}} = (catch extension(ER, E, E)),
+ {'EXIT', {badarg, _}} = (catch extension(C2, E, E)),
+ eval(E, extension(E, E, E)),
+ eval(EF, extension(EF, E, E)),
+ eval(family([{3,[]}]), extension(EF, set([3]), E)),
+ eval(ER, extension(ER, E, C1)),
+ eval(E, extension(E, ER, E)),
+ eval(from_term([],[{{atom,atom},type(ER)}]), extension(E, ER, ER)),
+
+ R1 = relation([{c,7},{c,9},{c,11},{d,17},{f,20}]),
+ S1 = set([a,c,d,e]),
+ eval(extension(R1, S1, C1), lextension(R1, S1, C1)),
+
+ S2 = set([1,2,3]),
+ eval(extension(ER, S2, C1), lextension(ER, S2, C1)),
+
+ R3 = relation([{4,a},{8,b}]),
+ S3 = set([1,2,3,4,5,6,7,8,9,10,11]),
+ eval(extension(R3, S3, C1), lextension(R3, S3, C1)),
+
+ R4 = relation([{2,b},{4,d},{6,f}]),
+ S4 = set([1,3,5,7]),
+ eval(extension(R4, S4, C1), lextension(R4, S4, C1)),
+
+ F1 = family([{a,[1]},{c,[2]}]),
+ S5 = set([a,b,c,d]),
+ eval(extension(F1, S5, C2), lextension(F1, S5, C2)),
ok.
lextension(R, S, C) ->
union(R, drestriction(1, constant_function(S, C), domain(R))).
-weak_relation_1(suite) -> [];
-weak_relation_1(doc) -> [""];
weak_relation_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([], 2),
- ?line eval(weak_relation(E), E),
- ?line eval(weak_relation(ER), ER),
- ?line eval(weak_relation(relation([{a,1},{a,2},{b,2},{c,c}])),
- relation([{1,1},{2,2},{a,1},{a,2},{a,a},{b,2},{b,b},{c,c}])),
- ?line eval(weak_relation(relation([{a,1},{a,a},{a,b}])),
- relation([{1,1},{a,1},{a,a},{a,b},{b,b}])),
- ?line eval(weak_relation(relation([{a,1},{a,b},{7,w}])),
- relation([{1,1},{7,7},{7,w},{a,1},{a,a},{a,b},{b,b},{w,w}])),
- ?line {'EXIT', {badarg, _}} =
+ E = empty_set(),
+ ER = relation([], 2),
+ eval(weak_relation(E), E),
+ eval(weak_relation(ER), ER),
+ eval(weak_relation(relation([{a,1},{a,2},{b,2},{c,c}])),
+ relation([{1,1},{2,2},{a,1},{a,2},{a,a},{b,2},{b,b},{c,c}])),
+ eval(weak_relation(relation([{a,1},{a,a},{a,b}])),
+ relation([{1,1},{a,1},{a,a},{a,b},{b,b}])),
+ eval(weak_relation(relation([{a,1},{a,b},{7,w}])),
+ relation([{1,1},{7,7},{7,w},{a,1},{a,a},{a,b},{b,b},{w,w}])),
+ {'EXIT', {badarg, _}} =
(catch weak_relation(from_term([{{a},a}]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch weak_relation(from_term([{a,a}],[{d,r}]))),
- ?line {'EXIT', {badarg, _}} = (catch weak_relation(relation([{1,2,3}]))),
+ {'EXIT', {badarg, _}} = (catch weak_relation(relation([{1,2,3}]))),
F = 0.0, I = round(F),
if
F == I -> % term ordering
- ?line FR1 = relation([{F,I}]),
+ FR1 = relation([{F,I}]),
eval(weak_relation(FR1), FR1),
- ?line FR2 = relation([{F,2},{I,1}]),
+ FR2 = relation([{F,2},{I,1}]),
true = no_elements(weak_relation(FR2)) =:= 5,
- ?line FR3 = relation([{1,0},{1.0,1}]),
+ FR3 = relation([{1,0},{1.0,1}]),
true = no_elements(weak_relation(FR3)) =:= 3;
true ->
ok
end,
ok.
-to_sets_1(suite) -> [];
-to_sets_1(doc) -> [""];
to_sets_1(Conf) when is_list(Conf) ->
- ?line {'EXIT', {badarg, _}} = (catch to_sets(from_term(a))),
- ?line {'EXIT', {function_clause, _}} = (catch to_sets(a)),
+ {'EXIT', {badarg, _}} = (catch to_sets(from_term(a))),
+ {'EXIT', {function_clause, _}} = (catch to_sets(a)),
%% unordered
- ?line [] = to_sets(empty_set()),
- ?line eval(to_sets(from_term([a])), [from_term(a)]),
- ?line eval(to_sets(from_term([[]],[[atom]])), [set([])]),
+ [] = to_sets(empty_set()),
+ eval(to_sets(from_term([a])), [from_term(a)]),
+ eval(to_sets(from_term([[]],[[atom]])), [set([])]),
- ?line L = [from_term([a,b]),from_term([c,d])],
- ?line eval(to_sets(from_sets(L)), L),
+ L = [from_term([a,b]),from_term([c,d])],
+ eval(to_sets(from_sets(L)), L),
- ?line eval(to_sets(relation([{a,1},{b,2}])),
- [from_term({a,1},{atom,atom}), from_term({b,2},{atom,atom})]),
+ eval(to_sets(relation([{a,1},{b,2}])),
+ [from_term({a,1},{atom,atom}), from_term({b,2},{atom,atom})]),
%% ordered
- ?line O = {from_term(a,atom), from_term({b}, {atom}), set([c,d])},
- ?line eval(to_sets(from_sets(O)), O),
+ O = {from_term(a,atom), from_term({b}, {atom}), set([c,d])},
+ eval(to_sets(from_sets(O)), O),
ok.
-specification(suite) -> [];
-specification(doc) -> [""];
specification(Conf) when is_list(Conf) ->
Fun = {external, fun(I) when is_integer(I) -> true; (_) -> false end},
- ?line [1,2,3] = to_external(specification(Fun, set([a,1,b,2,c,3]))),
+ [1,2,3] = to_external(specification(Fun, set([a,1,b,2,c,3]))),
Fun2 = fun(S) -> is_subset(S, set([1,3,5,7,9])) end,
S2 = from_term([[1],[2],[3],[4],[5],[6],[7]]),
- ?line eval(specification(Fun2, S2), from_term([[1],[3],[5],[7]])),
+ eval(specification(Fun2, S2), from_term([[1],[3],[5],[7]])),
Fun2x = fun([1]) -> true;
([3]) -> true;
(_) -> false
end,
- ?line eval(specification({external,Fun2x}, S2), from_term([[1],[3]])),
+ eval(specification({external,Fun2x}, S2), from_term([[1],[3]])),
Fun3 = fun(_) -> neither_true_nor_false end,
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch specification(Fun3, set([a]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch specification({external, Fun3}, set([a]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch specification(Fun3, from_term([[a]]))),
- ?line {'EXIT', {function_clause, _}} =
+ {'EXIT', {function_clause, _}} =
(catch specification(Fun, a)),
ok.
-union_1(suite) -> [];
-union_1(doc) -> [""];
union_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([], 2),
- ?line {'EXIT', {badarg, _}} = (catch union(ER)),
- ?line {'EXIT', {type_mismatch, _}} =
+ E = empty_set(),
+ ER = relation([], 2),
+ {'EXIT', {badarg, _}} = (catch union(ER)),
+ {'EXIT', {type_mismatch, _}} =
(catch union(relation([{a,b}]), relation([{a,b,c}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch union(from_term([{a,b}]), from_term([{c,[x]}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch union(from_term([{a,b}]), from_term([{c,d}], [{d,r}]))),
- ?line {'EXIT', {badarg, _}} = (catch union(set([a,b,c]))),
- ?line eval(union(E), E),
- ?line eval(union(from_term([[]],[[atom]])), set([])),
- ?line eval(union(from_term([[{a,b},{b,c}],[{b,c}]])),
- relation([{a,b},{b,c}])),
- ?line eval(union(from_term([[1,2,3],[2,3,4],[3,4,5]])),
- set([1,2,3,4,5])),
-
- ?line eval(union(from_term([{[a],[],c}]), from_term([{[],[],q}])),
- from_term([{[a],[],c},{[],[],q}])),
-
- ?line eval(union(E, E), E),
- ?line eval(union(set([a,b]), E), set([a,b])),
- ?line eval(union(E, set([a,b])), set([a,b])),
-
- ?line eval(union(from_term([[a,b]])), from_term([a,b])),
+ {'EXIT', {badarg, _}} = (catch union(set([a,b,c]))),
+ eval(union(E), E),
+ eval(union(from_term([[]],[[atom]])), set([])),
+ eval(union(from_term([[{a,b},{b,c}],[{b,c}]])),
+ relation([{a,b},{b,c}])),
+ eval(union(from_term([[1,2,3],[2,3,4],[3,4,5]])),
+ set([1,2,3,4,5])),
+
+ eval(union(from_term([{[a],[],c}]), from_term([{[],[],q}])),
+ from_term([{[a],[],c},{[],[],q}])),
+
+ eval(union(E, E), E),
+ eval(union(set([a,b]), E), set([a,b])),
+ eval(union(E, set([a,b])), set([a,b])),
+
+ eval(union(from_term([[a,b]])), from_term([a,b])),
ok.
-intersection_1(suite) -> [];
-intersection_1(doc) -> [""];
intersection_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line {'EXIT', {badarg, _}} = (catch intersection(from_term([a,b]))),
- ?line {'EXIT', {badarg, _}} = (catch intersection(E)),
- ?line {'EXIT', {type_mismatch, _}} =
+ E = empty_set(),
+ {'EXIT', {badarg, _}} = (catch intersection(from_term([a,b]))),
+ {'EXIT', {badarg, _}} = (catch intersection(E)),
+ {'EXIT', {type_mismatch, _}} =
(catch intersection(relation([{a,b}]), relation([{a,b,c}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch intersection(relation([{a,b}]), from_term([{a,b}],[{d,r}]))),
- ?line eval(intersection(from_term([[a,b,c],[d,e,f],[g,h,i]])), set([])),
-
- ?line eval(intersection(E, E), E),
- ?line eval(intersection(set([a,b,c]),set([0,b,q])),
- set([b])),
- ?line eval(intersection(set([0,b,q]),set([a,b,c])),
- set([b])),
- ?line eval(intersection(set([a,b,c]),set([a,b,c])),
- set([a,b,c])),
- ?line eval(intersection(set([a,b,d]),set([c,d])),
- set([d])),
+ eval(intersection(from_term([[a,b,c],[d,e,f],[g,h,i]])), set([])),
+
+ eval(intersection(E, E), E),
+ eval(intersection(set([a,b,c]),set([0,b,q])),
+ set([b])),
+ eval(intersection(set([0,b,q]),set([a,b,c])),
+ set([b])),
+ eval(intersection(set([a,b,c]),set([a,b,c])),
+ set([a,b,c])),
+ eval(intersection(set([a,b,d]),set([c,d])),
+ set([d])),
ok.
-difference(suite) -> [];
-difference(doc) -> [""];
difference(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line {'EXIT', {type_mismatch, _}} =
+ E = empty_set(),
+ {'EXIT', {type_mismatch, _}} =
(catch difference(relation([{a,b}]), relation([{a,b,c}]))),
- ?line eval(difference(E, E), E),
- ?line {'EXIT', {type_mismatch, _}} =
+ eval(difference(E, E), E),
+ {'EXIT', {type_mismatch, _}} =
(catch difference(relation([{a,b}]), from_term([{a,c}],[{d,r}]))),
- ?line eval(difference(set([a,b,c,d,f]), set([a,d,e,g])),
- set([b,c,f])),
- ?line eval(difference(set([a,b,c]), set([d,e,f])),
- set([a,b,c])),
- ?line eval(difference(set([a,b,c]), set([a,b,c,d,e,f])),
- set([])),
- ?line eval(difference(set([e,f,g]), set([a,b,c,e])),
- set([f,g])),
- ?line eval(difference(set([a,b,d,e,f]), set([c])),
- set([a,b,d,e,f])),
+ eval(difference(set([a,b,c,d,f]), set([a,d,e,g])),
+ set([b,c,f])),
+ eval(difference(set([a,b,c]), set([d,e,f])),
+ set([a,b,c])),
+ eval(difference(set([a,b,c]), set([a,b,c,d,e,f])),
+ set([])),
+ eval(difference(set([e,f,g]), set([a,b,c,e])),
+ set([f,g])),
+ eval(difference(set([a,b,d,e,f]), set([c])),
+ set([a,b,d,e,f])),
ok.
-symdiff(suite) -> [];
-symdiff(doc) -> [""];
symdiff(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line {'EXIT', {type_mismatch, _}} =
+ E = empty_set(),
+ {'EXIT', {type_mismatch, _}} =
(catch symdiff(relation([{a,b}]), relation([{a,b,c}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch symdiff(relation([{a,b}]), from_term([{a,b}], [{d,r}]))),
- ?line eval(symdiff(E, E), E),
- ?line eval(symdiff(set([a,b,c,d,e,f]), set([0,1,a,c])),
- union(set([b,d,e,f]), set([0,1]))),
- ?line eval(symdiff(set([a,b,c]), set([q,v,w,x,y])),
- union(set([a,b,c]), set([q,v,w,x,y]))),
- ?line eval(symdiff(set([a,b,c,d,e,f]), set([a,b,c])),
- set([d,e,f])),
- ?line eval(symdiff(set([c,e,g,h,i]), set([b,d,f])),
- union(set([c,e,g,h,i]), set([b,d,f]))),
- ?line eval(symdiff(set([c,d,g,h,k,l]),
- set([a,b,e,f,i,j,m,n])),
- union(set([c,d,g,h,k,l]), set([a,b,e,f,i,j,m,n]))),
- ?line eval(symdiff(set([c,d,g,h,k,l]),
- set([d,e,h,i,l,m,n,o,p])),
- union(set([c,g,k]), set([e,i,m,n,o,p]))),
+ eval(symdiff(E, E), E),
+ eval(symdiff(set([a,b,c,d,e,f]), set([0,1,a,c])),
+ union(set([b,d,e,f]), set([0,1]))),
+ eval(symdiff(set([a,b,c]), set([q,v,w,x,y])),
+ union(set([a,b,c]), set([q,v,w,x,y]))),
+ eval(symdiff(set([a,b,c,d,e,f]), set([a,b,c])),
+ set([d,e,f])),
+ eval(symdiff(set([c,e,g,h,i]), set([b,d,f])),
+ union(set([c,e,g,h,i]), set([b,d,f]))),
+ eval(symdiff(set([c,d,g,h,k,l]),
+ set([a,b,e,f,i,j,m,n])),
+ union(set([c,d,g,h,k,l]), set([a,b,e,f,i,j,m,n]))),
+ eval(symdiff(set([c,d,g,h,k,l]),
+ set([d,e,h,i,l,m,n,o,p])),
+ union(set([c,g,k]), set([e,i,m,n,o,p]))),
ok.
-symmetric_partition(suite) -> [];
-symmetric_partition(doc) -> [""];
symmetric_partition(Conf) when is_list(Conf) ->
- ?line E = set([]),
- ?line S1 = set([1,2,3,4]),
- ?line S2 = set([3,4,5,6]),
- ?line S3 = set([3,4]),
- ?line S4 = set([1,2,3,4,5,6]),
- ?line T1 = set([1,2]),
- ?line T2 = set([3,4]),
- ?line T3 = set([5,6]),
- ?line T4 = set([1,2,5,6]),
- ?line {'EXIT', {type_mismatch, _}} =
+ E = set([]),
+ S1 = set([1,2,3,4]),
+ S2 = set([3,4,5,6]),
+ S3 = set([3,4]),
+ S4 = set([1,2,3,4,5,6]),
+ T1 = set([1,2]),
+ T2 = set([3,4]),
+ T3 = set([5,6]),
+ T4 = set([1,2,5,6]),
+ {'EXIT', {type_mismatch, _}} =
(catch symmetric_partition(relation([{a,b}]), relation([{a,b,c}]))),
- ?line {E, E, E} = symmetric_partition(E, E),
- ?line {'EXIT', {type_mismatch, _}} =
+ {E, E, E} = symmetric_partition(E, E),
+ {'EXIT', {type_mismatch, _}} =
(catch symmetric_partition(relation([{a,b}]),
from_term([{a,c}],[{d,r}]))),
- ?line {E, E, S1} = symmetric_partition(E, S1),
- ?line {S1, E, E} = symmetric_partition(S1, E),
- ?line {T1, T2, T3} = symmetric_partition(S1, S2),
- ?line {T3, T2, T1} = symmetric_partition(S2, S1),
- ?line {E, T2, T4} = symmetric_partition(S3, S4),
- ?line {T4, T2, E} = symmetric_partition(S4, S3),
-
- ?line S5 = set([1,3,5]),
- ?line S6 = set([2,4,6,7,8]),
- ?line {S5, E, S6} = symmetric_partition(S5, S6),
- ?line {S6, E, S5} = symmetric_partition(S6, S5),
- ?line EE = empty_set(),
- ?line {EE, EE, EE} = symmetric_partition(EE, EE),
+ {E, E, S1} = symmetric_partition(E, S1),
+ {S1, E, E} = symmetric_partition(S1, E),
+ {T1, T2, T3} = symmetric_partition(S1, S2),
+ {T3, T2, T1} = symmetric_partition(S2, S1),
+ {E, T2, T4} = symmetric_partition(S3, S4),
+ {T4, T2, E} = symmetric_partition(S4, S3),
+
+ S5 = set([1,3,5]),
+ S6 = set([2,4,6,7,8]),
+ {S5, E, S6} = symmetric_partition(S5, S6),
+ {S6, E, S5} = symmetric_partition(S6, S5),
+ EE = empty_set(),
+ {EE, EE, EE} = symmetric_partition(EE, EE),
ok.
-is_sofs_set_1(suite) -> [];
-is_sofs_set_1(doc) -> [""];
is_sofs_set_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line true = is_sofs_set(E),
- ?line true = is_sofs_set(from_term([a])),
- ?line true = is_sofs_set(from_term({a})),
- ?line true = is_sofs_set(from_term(a)),
- ?line false = is_sofs_set(a),
+ E = empty_set(),
+ true = is_sofs_set(E),
+ true = is_sofs_set(from_term([a])),
+ true = is_sofs_set(from_term({a})),
+ true = is_sofs_set(from_term(a)),
+ false = is_sofs_set(a),
ok.
-is_set_1(suite) -> [];
-is_set_1(doc) -> [""];
is_set_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line true = is_set(E),
- ?line true = is_set(from_term([a])),
- ?line false = is_set(from_term({a})),
- ?line false = is_set(from_term(a)),
- ?line {'EXIT', _} = (catch is_set(a)),
-
- ?line true = is_empty_set(E),
- ?line false = is_empty_set(from_term([a])),
- ?line false = is_empty_set(from_term({a})),
- ?line false = is_empty_set(from_term(a)),
- ?line {'EXIT', _} = (catch is_empty_set(a)),
+ E = empty_set(),
+ true = is_set(E),
+ true = is_set(from_term([a])),
+ false = is_set(from_term({a})),
+ false = is_set(from_term(a)),
+ {'EXIT', _} = (catch is_set(a)),
+
+ true = is_empty_set(E),
+ false = is_empty_set(from_term([a])),
+ false = is_empty_set(from_term({a})),
+ false = is_empty_set(from_term(a)),
+ {'EXIT', _} = (catch is_empty_set(a)),
ok.
-is_equal(suite) -> [];
-is_equal(doc) -> [""];
is_equal(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line true = is_equal(E, E),
- ?line false = is_equal(from_term([a]), E),
- ?line {'EXIT', {type_mismatch, _}} =
+ E = empty_set(),
+ true = is_equal(E, E),
+ false = is_equal(from_term([a]), E),
+ {'EXIT', {type_mismatch, _}} =
(catch is_equal(intersection(set([a]), set([b])),
intersection(from_term([{a}]), from_term([{b}])))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch is_equal(from_term([],[{[atom],atom,[atom]}]),
from_term([],[{[atom],{atom},[atom]}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch is_equal(set([a]), from_term([a],[type]))),
- ?line E2 = from_sets({from_term(a,atom)}),
- ?line true = is_equal(E2, E2),
- ?line true = is_equal(from_term({a}, {atom}), E2),
- ?line false = is_equal(from_term([{[a],[],c}]),
- from_term([{[],[],q}])),
+ E2 = from_sets({from_term(a,atom)}),
+ true = is_equal(E2, E2),
+ true = is_equal(from_term({a}, {atom}), E2),
+ false = is_equal(from_term([{[a],[],c}]),
+ from_term([{[],[],q}])),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch is_equal(E, E2)),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch is_equal(E2, E)),
- ?line true = is_equal(from_term({[],a,[]},{[atom],atom,[atom]}),
- from_term({[],a,[]},{[atom],atom,[atom]})),
- ?line {'EXIT', {type_mismatch, _}} =
+ true = is_equal(from_term({[],a,[]},{[atom],atom,[atom]}),
+ from_term({[],a,[]},{[atom],atom,[atom]})),
+ {'EXIT', {type_mismatch, _}} =
(catch is_equal(from_term({[],a,[]},{[atom],atom,[atom]}),
from_term({[],{a},[]},{[atom],{atom},[atom]}))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch is_equal(from_term({a}), from_term({a},{type}))),
ok.
-is_subset(suite) -> [];
-is_subset(doc) -> [""];
is_subset(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line true = is_subset(E, E),
- ?line true = is_subset(set([a,c,e]), set([a,b,c,d,e])),
- ?line false = is_subset(set([a,b]), E),
- ?line false = is_subset(set([d,e,f]), set([b,c,d,e])),
- ?line false = is_subset(set([a,b,c]), set([b,c])),
- ?line false = is_subset(set([b,c]), set([a,c])),
- ?line false = is_subset(set([d,e]), set([a,b])),
- ?line {'EXIT', {type_mismatch, _}} =
+ E = empty_set(),
+ true = is_subset(E, E),
+ true = is_subset(set([a,c,e]), set([a,b,c,d,e])),
+ false = is_subset(set([a,b]), E),
+ false = is_subset(set([d,e,f]), set([b,c,d,e])),
+ false = is_subset(set([a,b,c]), set([b,c])),
+ false = is_subset(set([b,c]), set([a,c])),
+ false = is_subset(set([d,e]), set([a,b])),
+ {'EXIT', {type_mismatch, _}} =
(catch is_subset(intersection(set([a]), set([b])),
intersection(from_term([{a}]), from_term([{b}])))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch is_subset(set([a]), from_term([a,b], [at]))),
ok.
-is_a_function_1(suite) -> [];
-is_a_function_1(doc) -> [""];
is_a_function_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([], 2),
- ?line {'EXIT', {badarg, _}} = (catch is_a_function(set([a,b]))),
- ?line true = is_a_function(E),
- ?line true = is_a_function(ER),
- ?line true = is_a_function(relation([])),
- ?line true = is_a_function(relation([],2)),
- ?line true = is_a_function(relation([{a,b},{b,c}])),
- ?line false = is_a_function(relation([{a,b},{b,c},{b,d},{e,f}])),
- ?line IS = relation([{{a,b},c},{{a,b},d}]),
- ?line false = is_a_function(IS),
+ E = empty_set(),
+ ER = relation([], 2),
+ {'EXIT', {badarg, _}} = (catch is_a_function(set([a,b]))),
+ true = is_a_function(E),
+ true = is_a_function(ER),
+ true = is_a_function(relation([])),
+ true = is_a_function(relation([],2)),
+ true = is_a_function(relation([{a,b},{b,c}])),
+ false = is_a_function(relation([{a,b},{b,c},{b,d},{e,f}])),
+ IS = relation([{{a,b},c},{{a,b},d}]),
+ false = is_a_function(IS),
F = 0.0, I = round(F),
- ?line FR = relation([{I,F},{F,1}]),
+ FR = relation([{I,F},{F,1}]),
if
F == I -> % term ordering
false = is_a_function(FR);
@@ -1280,343 +1229,315 @@ is_a_function_1(Conf) when is_list(Conf) ->
end,
ok.
-is_disjoint(suite) -> [];
-is_disjoint(doc) -> [""];
is_disjoint(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line {'EXIT', {type_mismatch, _}} =
+ E = empty_set(),
+ {'EXIT', {type_mismatch, _}} =
(catch is_disjoint(relation([{a,1}]), set([a,b]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch is_disjoint(set([a]), from_term([a],[mota]))),
- ?line true = is_disjoint(E, E),
- ?line false = is_disjoint(set([a,b,c]),set([b,c,d])),
- ?line false = is_disjoint(set([b,c,d]),set([a,b,c])),
- ?line true = is_disjoint(set([a,c,e]),set([b,d,f])),
+ true = is_disjoint(E, E),
+ false = is_disjoint(set([a,b,c]),set([b,c,d])),
+ false = is_disjoint(set([b,c,d]),set([a,b,c])),
+ true = is_disjoint(set([a,c,e]),set([b,d,f])),
ok.
-join(suite) -> [];
-join(doc) -> [""];
join(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
-
- ?line {'EXIT', {badarg, _}} = (catch join(relation([{a,1}]), 3, E, 5)),
- ?line {'EXIT', {badarg, _}} = (catch join(E, 1, relation([{a,1}]), 3)),
- ?line {'EXIT', {badarg, _}} = (catch join(E, 1, from_term([a]), 1)),
-
- ?line eval(join(E, 1, E, 2), E),
- ?line eval(join(E, 1, from_term([{{a},b}]), 2), E),
- ?line eval(join(from_term([{{a},b}]), 2, E, 1), E),
- ?line eval(join(from_term([{{a},b,e}]), 2, from_term([{c,{d}}]), 1),
- from_term([], [{{atom},atom,atom,{atom}}])),
- ?line eval(join(relation([{a}]), 1, relation([{1,a},{2,a}]), 2),
- relation([{a,1},{a,2}])),
- ?line eval(join(relation([{a,b,c},{b,c,d}]), 2,
- relation([{1,b},{2,a},{3,c}]), 2),
- relation([{a,b,c,1},{b,c,d,3}])),
- ?line eval(join(relation([{1,a,aa},{1,b,bb},{1,c,cc},{2,a,aa},{2,b,bb}]),
- 1,
- relation([{1,c,cc},{1,d,dd},{1,e,ee},{2,c,cc},{2,d,dd}]),
- 1),
- relation([{1,a,aa,c,cc},{1,a,aa,d,dd},{1,a,aa,e,ee},{1,b,bb,c,cc},
- {1,b,bb,d,dd},{1,b,bb,e,ee},{1,c,cc,c,cc},{1,c,cc,d,dd},
- {1,c,cc,e,ee},{2,a,aa,c,cc},{2,a,aa,d,dd},{2,b,bb,c,cc},
- {2,b,bb,d,dd}])),
+ E = empty_set(),
+
+ {'EXIT', {badarg, _}} = (catch join(relation([{a,1}]), 3, E, 5)),
+ {'EXIT', {badarg, _}} = (catch join(E, 1, relation([{a,1}]), 3)),
+ {'EXIT', {badarg, _}} = (catch join(E, 1, from_term([a]), 1)),
+
+ eval(join(E, 1, E, 2), E),
+ eval(join(E, 1, from_term([{{a},b}]), 2), E),
+ eval(join(from_term([{{a},b}]), 2, E, 1), E),
+ eval(join(from_term([{{a},b,e}]), 2, from_term([{c,{d}}]), 1),
+ from_term([], [{{atom},atom,atom,{atom}}])),
+ eval(join(relation([{a}]), 1, relation([{1,a},{2,a}]), 2),
+ relation([{a,1},{a,2}])),
+ eval(join(relation([{a,b,c},{b,c,d}]), 2,
+ relation([{1,b},{2,a},{3,c}]), 2),
+ relation([{a,b,c,1},{b,c,d,3}])),
+ eval(join(relation([{1,a,aa},{1,b,bb},{1,c,cc},{2,a,aa},{2,b,bb}]),
+ 1,
+ relation([{1,c,cc},{1,d,dd},{1,e,ee},{2,c,cc},{2,d,dd}]),
+ 1),
+ relation([{1,a,aa,c,cc},{1,a,aa,d,dd},{1,a,aa,e,ee},{1,b,bb,c,cc},
+ {1,b,bb,d,dd},{1,b,bb,e,ee},{1,c,cc,c,cc},{1,c,cc,d,dd},
+ {1,c,cc,e,ee},{2,a,aa,c,cc},{2,a,aa,d,dd},{2,b,bb,c,cc},
+ {2,b,bb,d,dd}])),
R1 = relation([{a,b},{b,c}]),
R2 = relation([{b,1},{a,2},{c,3},{c,4}]),
- ?line eval(join(R1, 1, R2, 1), from_term([{a,b,2},{b,c,1}])),
- ?line eval(join(R1, 2, R2, 1), from_term([{a,b,1},{b,c,3},{b,c,4}])),
- ?line eval(join(R1, 1, converse(R2), 2),
- from_term([{a,b,2},{b,c,1}])),
- ?line eval(join(R1, 2, converse(R2), 2),
- from_term([{a,b,1},{b,c,3},{b,c,4}])),
+ eval(join(R1, 1, R2, 1), from_term([{a,b,2},{b,c,1}])),
+ eval(join(R1, 2, R2, 1), from_term([{a,b,1},{b,c,3},{b,c,4}])),
+ eval(join(R1, 1, converse(R2), 2),
+ from_term([{a,b,2},{b,c,1}])),
+ eval(join(R1, 2, converse(R2), 2),
+ from_term([{a,b,1},{b,c,3},{b,c,4}])),
ok.
-canonical(suite) -> [];
-canonical(doc) -> [""];
canonical(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line {'EXIT', {badarg, _}} =
+ E = empty_set(),
+ {'EXIT', {badarg, _}} =
(catch canonical_relation(set([a,b]))),
- ?line eval(canonical_relation(E), E),
- ?line eval(canonical_relation(from_term([[]])), E),
- ?line eval(canonical_relation(from_term([[a,b,c]])),
- from_term([{a,[a,b,c]},{b,[a,b,c]},{c,[a,b,c]}])),
+ eval(canonical_relation(E), E),
+ eval(canonical_relation(from_term([[]])), E),
+ eval(canonical_relation(from_term([[a,b,c]])),
+ from_term([{a,[a,b,c]},{b,[a,b,c]},{c,[a,b,c]}])),
ok.
-relation_to_family_1(suite) -> [];
-relation_to_family_1(doc) -> [""];
relation_to_family_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line EF = family([]),
- ?line eval(relation_to_family(E), E),
- ?line eval(relation_to_family(relation([])), EF),
- ?line eval(relation_to_family(relation([], 2)), EF),
- ?line R = relation([{b,1},{c,7},{c,9},{c,11}]),
- ?line F = family([{b,[1]},{c,[7,9,11]}]),
- ?line eval(relation_to_family(R), F),
- ?line eval(sofs:rel2fam(R), F),
- ?line {'EXIT', {badarg, _}} = (catch relation_to_family(set([a]))),
+ E = empty_set(),
+ EF = family([]),
+ eval(relation_to_family(E), E),
+ eval(relation_to_family(relation([])), EF),
+ eval(relation_to_family(relation([], 2)), EF),
+ R = relation([{b,1},{c,7},{c,9},{c,11}]),
+ F = family([{b,[1]},{c,[7,9,11]}]),
+ eval(relation_to_family(R), F),
+ eval(sofs:rel2fam(R), F),
+ {'EXIT', {badarg, _}} = (catch relation_to_family(set([a]))),
ok.
-domain_1(suite) -> [];
-domain_1(doc) -> [""];
domain_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([]),
- ?line {'EXIT', {badarg, _}} = (catch domain(relation([],3))),
- ?line eval(domain(E), E),
- ?line eval(domain(ER), set([])),
- ?line eval(domain(relation([{1,a},{1,b},{2,a},{2,b}])), set([1,2])),
- ?line eval(domain(relation([{a,1},{b,2},{c,3}])), set([a,b,c])),
- ?line eval(field(relation([{a,1},{b,2},{c,3}])),
- set([a,b,c,1,2,3])),
+ E = empty_set(),
+ ER = relation([]),
+ {'EXIT', {badarg, _}} = (catch domain(relation([],3))),
+ eval(domain(E), E),
+ eval(domain(ER), set([])),
+ eval(domain(relation([{1,a},{1,b},{2,a},{2,b}])), set([1,2])),
+ eval(domain(relation([{a,1},{b,2},{c,3}])), set([a,b,c])),
+ eval(field(relation([{a,1},{b,2},{c,3}])),
+ set([a,b,c,1,2,3])),
F = 0.0, I = round(F),
- ?line FR = relation([{I,a},{F,b}]),
+ FR = relation([{I,a},{F,b}]),
if
F == I -> % term ordering
- ?line true = (1 =:= no_elements(domain(FR)));
+ true = (1 =:= no_elements(domain(FR)));
true ->
- ?line true = (2 =:= no_elements(domain(FR)))
+ true = (2 =:= no_elements(domain(FR)))
end,
ok.
-range_1(suite) -> [];
-range_1(doc) -> [""];
range_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([]),
- ?line {'EXIT', {badarg, _}} = (catch range(relation([],3))),
- ?line eval(range(E), E),
- ?line eval(range(ER), set([])),
- ?line eval(range(relation([{1,a},{1,b},{2,a},{2,b}])), set([a,b])),
- ?line eval(range(relation([{a,1},{b,2},{c,3}])), set([1,2,3])),
+ E = empty_set(),
+ ER = relation([]),
+ {'EXIT', {badarg, _}} = (catch range(relation([],3))),
+ eval(range(E), E),
+ eval(range(ER), set([])),
+ eval(range(relation([{1,a},{1,b},{2,a},{2,b}])), set([a,b])),
+ eval(range(relation([{a,1},{b,2},{c,3}])), set([1,2,3])),
ok.
-
-inverse_1(suite) -> [];
-inverse_1(doc) -> [""];
+
inverse_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([]),
- ?line {'EXIT', {badarg, _}} = (catch inverse(relation([],3))),
- ?line {'EXIT', {bad_function, _}} =
+ E = empty_set(),
+ ER = relation([]),
+ {'EXIT', {badarg, _}} = (catch inverse(relation([],3))),
+ {'EXIT', {bad_function, _}} =
(catch inverse(relation([{1,a},{1,b}]))),
- ?line {'EXIT', {bad_function, _}} =
+ {'EXIT', {bad_function, _}} =
(catch inverse(relation([{1,a},{2,a}]))),
- ?line eval(inverse(E), E),
- ?line eval(inverse(ER), ER),
- ?line eval(inverse(relation([{a,1},{b,2},{c,3}])),
- relation([{1,a},{2,b},{3,c}])),
+ eval(inverse(E), E),
+ eval(inverse(ER), ER),
+ eval(inverse(relation([{a,1},{b,2},{c,3}])),
+ relation([{1,a},{2,b},{3,c}])),
F = 0.0, I = round(F),
- ?line FR = relation([{I,a},{F,b}]),
+ FR = relation([{I,a},{F,b}]),
if
F == I -> % term ordering
- ?line {'EXIT', {bad_function, _}} = (catch inverse(FR));
+ {'EXIT', {bad_function, _}} = (catch inverse(FR));
true ->
- ?line eval(inverse(FR), relation([{a,I},{b,F}]))
+ eval(inverse(FR), relation([{a,I},{b,F}]))
end,
ok.
-
-converse_1(suite) -> [];
-converse_1(doc) -> [""];
+
converse_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([]),
- ?line {'EXIT', {badarg, _}} = (catch converse(relation([],3))),
- ?line eval(converse(ER), ER),
- ?line eval(converse(E), E),
- ?line eval(converse(relation([{a,1},{b,2},{c,3}])),
- relation([{1,a},{2,b},{3,c}])),
- ?line eval(converse(relation([{1,a},{1,b}])),
- relation([{a,1},{b,1}])),
- ?line eval(converse(relation([{1,a},{2,a}])),
- relation([{a,1},{a,2}])),
+ E = empty_set(),
+ ER = relation([]),
+ {'EXIT', {badarg, _}} = (catch converse(relation([],3))),
+ eval(converse(ER), ER),
+ eval(converse(E), E),
+ eval(converse(relation([{a,1},{b,2},{c,3}])),
+ relation([{1,a},{2,b},{3,c}])),
+ eval(converse(relation([{1,a},{1,b}])),
+ relation([{a,1},{b,1}])),
+ eval(converse(relation([{1,a},{2,a}])),
+ relation([{a,1},{a,2}])),
ok.
-
-no_elements_1(suite) -> [];
-no_elements_1(doc) -> [""];
+
no_elements_1(Conf) when is_list(Conf) ->
- ?line 0 = no_elements(empty_set()),
- ?line 0 = no_elements(set([])),
- ?line 1 = no_elements(from_term([a])),
- ?line 10 = no_elements(from_term(lists:seq(1,10))),
- ?line 3 = no_elements(from_term({a,b,c},{atom,atom,atom})),
- ?line {'EXIT', {badarg, _}} = (catch no_elements(from_term(a))),
- ?line {'EXIT', {function_clause, _}} = (catch no_elements(a)),
+ 0 = no_elements(empty_set()),
+ 0 = no_elements(set([])),
+ 1 = no_elements(from_term([a])),
+ 10 = no_elements(from_term(lists:seq(1,10))),
+ 3 = no_elements(from_term({a,b,c},{atom,atom,atom})),
+ {'EXIT', {badarg, _}} = (catch no_elements(from_term(a))),
+ {'EXIT', {function_clause, _}} = (catch no_elements(a)),
ok.
-image(suite) -> [];
-image(doc) -> [""];
image(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([]),
- ?line eval(image(E, E), E),
- ?line eval(image(ER, E), set([])),
- ?line eval(image(relation([{a,1},{b,2},{c,3},{f,6}]), set([a,b,c,d,f])),
- set([1,2,3,6])),
- ?line eval(image(relation([{a,1},{b,2},{c,3},{d,4},{r,17}]),
- set([b,c,q,r])),
- set([2,3,17])),
- ?line eval(image(from_term([{[a],{1}},{[b],{2}}]), from_term([[a]])),
- from_term([{1}])),
- ?line eval(image(relation([{1,a},{2,a},{3,a},{4,b},{2,b}]), set([1,2,4])),
- set([a,b])),
- ?line {'EXIT', {badarg, _}} =
+ E = empty_set(),
+ ER = relation([]),
+ eval(image(E, E), E),
+ eval(image(ER, E), set([])),
+ eval(image(relation([{a,1},{b,2},{c,3},{f,6}]), set([a,b,c,d,f])),
+ set([1,2,3,6])),
+ eval(image(relation([{a,1},{b,2},{c,3},{d,4},{r,17}]),
+ set([b,c,q,r])),
+ set([2,3,17])),
+ eval(image(from_term([{[a],{1}},{[b],{2}}]), from_term([[a]])),
+ from_term([{1}])),
+ eval(image(relation([{1,a},{2,a},{3,a},{4,b},{2,b}]), set([1,2,4])),
+ set([a,b])),
+ {'EXIT', {badarg, _}} =
(catch image(from_term([a,b]), E)),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch image(from_term([{[a],1}]), set([[a]]))),
ok.
-inverse_image(suite) -> [];
-inverse_image(doc) -> [""];
inverse_image(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([]),
- ?line eval(inverse_image(E, E), E),
- ?line eval(inverse_image(ER, E), set([])),
- ?line eval(inverse_image(converse(relation([{a,1},{b,2},{c,3},{f,6}])),
- set([a,b,c,d,f])),
- set([1,2,3,6])),
- ?line eval(inverse_image(converse(relation([{a,1},{b,2},{c,3},
- {d,4},{r,17}])),
- set([b,c,q,r])),
- set([2,3,17])),
- ?line eval(inverse_image(converse(from_term([{[a],{1}},{[b],{2}}])),
- from_term([[a]])),
- from_term([{1}])),
- ?line eval(inverse_image(converse(relation([{1,a},{2,a},
- {3,a},{4,b},{2,b}])),
- set([1,2,4])),
- set([a,b])),
- ?line {'EXIT', {badarg, _}} =
+ E = empty_set(),
+ ER = relation([]),
+ eval(inverse_image(E, E), E),
+ eval(inverse_image(ER, E), set([])),
+ eval(inverse_image(converse(relation([{a,1},{b,2},{c,3},{f,6}])),
+ set([a,b,c,d,f])),
+ set([1,2,3,6])),
+ eval(inverse_image(converse(relation([{a,1},{b,2},{c,3},
+ {d,4},{r,17}])),
+ set([b,c,q,r])),
+ set([2,3,17])),
+ eval(inverse_image(converse(from_term([{[a],{1}},{[b],{2}}])),
+ from_term([[a]])),
+ from_term([{1}])),
+ eval(inverse_image(converse(relation([{1,a},{2,a},
+ {3,a},{4,b},{2,b}])),
+ set([1,2,4])),
+ set([a,b])),
+ {'EXIT', {badarg, _}} =
(catch inverse_image(from_term([a,b]), E)),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch inverse_image(converse(from_term([{[a],1}])), set([[a]]))),
ok.
-composite_1(suite) -> [];
-composite_1(doc) -> [""];
composite_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line EF = a_function([]),
- ?line eval(composite(E, E), E),
- ?line eval(composite(E, a_function([{a,b}])), E),
- ?line eval(composite(relation([{a,b}]), E), E),
- ?line {'EXIT', {bad_function, _}} =
+ E = empty_set(),
+ EF = a_function([]),
+ eval(composite(E, E), E),
+ eval(composite(E, a_function([{a,b}])), E),
+ eval(composite(relation([{a,b}]), E), E),
+ {'EXIT', {bad_function, _}} =
(catch composite(EF, relation([{a,b},{a,c}]))),
- ?line {'EXIT', {bad_function, _}} =
+ {'EXIT', {bad_function, _}} =
(catch composite(a_function([{b,a}]), EF)),
- ?line {'EXIT', {bad_function, _}} =
+ {'EXIT', {bad_function, _}} =
(catch composite(relation([{1,a},{2,b},{2,a}]),
a_function([{a,1},{b,3}]))),
- ?line {'EXIT', {bad_function, _}} =
- (catch composite(a_function([{1,a},{2,b}]), a_function([{b,3}]))),
- ?line eval(composite(EF, EF), EF),
- ?line eval(composite(a_function([{b,a}]), from_term([{a,{b,c}}])),
- from_term([{b,{b,c}}])),
- ?line eval(composite(a_function([{q,1},{z,2}]),
- a_function([{1,a},{2,a}])),
- a_function([{q,a},{z,a}])),
- ?line eval(composite(a_function([{a,0},{b,0},{c,1},{d,1},{e,2},{f,3}]),
- a_function([{0,p},{1,q},{2,r},{3,w},{4,aa}])),
- a_function([{c,q},{d,q},{f,w},{e,r},{a,p},{b,p}])),
- ?line eval(composite(a_function([{1,c}]),
- a_function([{a,1},{b,3},{c,4}])),
- a_function([{1,4}])),
- ?line {'EXIT', {bad_function, _}} =
+ {'EXIT', {bad_function, _}} =
+ (catch composite(a_function([{1,a},{2,b}]), a_function([{b,3}]))),
+ eval(composite(EF, EF), EF),
+ eval(composite(a_function([{b,a}]), from_term([{a,{b,c}}])),
+ from_term([{b,{b,c}}])),
+ eval(composite(a_function([{q,1},{z,2}]),
+ a_function([{1,a},{2,a}])),
+ a_function([{q,a},{z,a}])),
+ eval(composite(a_function([{a,0},{b,0},{c,1},{d,1},{e,2},{f,3}]),
+ a_function([{0,p},{1,q},{2,r},{3,w},{4,aa}])),
+ a_function([{c,q},{d,q},{f,w},{e,r},{a,p},{b,p}])),
+ eval(composite(a_function([{1,c}]),
+ a_function([{a,1},{b,3},{c,4}])),
+ a_function([{1,4}])),
+ {'EXIT', {bad_function, _}} =
(catch composite(a_function([{1,a},{2,b}]),
a_function([{a,1},{c,3}]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch composite(from_term([a,b]), E)),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch composite(E, from_term([a,b]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch composite(from_term([{a,b}]), from_term([{{a},b}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch composite(from_term([{a,b}]),
from_term([{b,c}], [{d,r}]))),
F = 0.0, I = round(F),
- ?line FR1 = relation([{1,c}]),
- ?line FR2 = relation([{I,1},{F,3},{c,4}]),
+ FR1 = relation([{1,c}]),
+ FR2 = relation([{I,1},{F,3},{c,4}]),
if
F == I -> % term ordering
- ?line {'EXIT', {bad_function, _}} = (catch composite(FR1, FR2));
+ {'EXIT', {bad_function, _}} = (catch composite(FR1, FR2));
true ->
- ?line eval(composite(FR1, FR2), a_function([{1,4}]))
+ eval(composite(FR1, FR2), a_function([{1,4}]))
end,
ok.
-relative_product_1(suite) -> [];
-relative_product_1(doc) -> [""];
relative_product_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([]),
- ?line eval(relative_product1(E, E), E),
- ?line eval(relative_product1(E, relation([{a,b}])), E),
- ?line eval(relative_product1(relation([{a,b}]), E), E),
- ?line eval(relative_product1(relation([{a,b}]), from_term([{a,{b,c}}])),
- from_term([{b,{b,c}}])),
- ?line eval(relative_product1(relation([{1,z},{1,q},{2,z}]),
- relation([{1,a},{1,b},{2,a}])),
- relation([{q,a},{q,b},{z,a},{z,b}])),
- ?line eval(relative_product1(relation([{0,a},{0,b},{1,c},
- {1,d},{2,e},{3,f}]),
- relation([{1,q},{3,w}])),
- relation([{c,q},{d,q},{f,w}])),
- ?line {'EXIT', {badarg, _}} =
+ E = empty_set(),
+ ER = relation([]),
+ eval(relative_product1(E, E), E),
+ eval(relative_product1(E, relation([{a,b}])), E),
+ eval(relative_product1(relation([{a,b}]), E), E),
+ eval(relative_product1(relation([{a,b}]), from_term([{a,{b,c}}])),
+ from_term([{b,{b,c}}])),
+ eval(relative_product1(relation([{1,z},{1,q},{2,z}]),
+ relation([{1,a},{1,b},{2,a}])),
+ relation([{q,a},{q,b},{z,a},{z,b}])),
+ eval(relative_product1(relation([{0,a},{0,b},{1,c},
+ {1,d},{2,e},{3,f}]),
+ relation([{1,q},{3,w}])),
+ relation([{c,q},{d,q},{f,w}])),
+ {'EXIT', {badarg, _}} =
(catch relative_product1(from_term([a,b]), ER)),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch relative_product1(ER, from_term([a,b]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch relative_product1(from_term([{a,b}]), from_term([{{a},b}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch relative_product1(from_term([{a,b}]),
from_term([{b,c}], [{d,r}]))),
ok.
-relative_product_2(suite) -> [];
-relative_product_2(doc) -> [""];
relative_product_2(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([]),
+ E = empty_set(),
+ ER = relation([]),
- ?line {'EXIT', {badarg, _}} = (catch relative_product({from_term([a,b])})),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {badarg, _}} = (catch relative_product({from_term([a,b])})),
+ {'EXIT', {type_mismatch, _}} =
(catch relative_product({from_term([{a,b}]), from_term([{{a},b}])})),
- ?line {'EXIT', {badarg, _}} = (catch relative_product({})),
- ?line true = is_equal(relative_product({ER}),
- from_term([], [{atom,{atom}}])),
- ?line eval(relative_product({relation([{a,b},{c,a}]),
- relation([{a,1},{a,2}]),
- relation([{a,aa},{c,1}])}),
- from_term([{a,{b,1,aa}},{a,{b,2,aa}}])),
- ?line eval(relative_product({relation([{a,b}])}, E), E),
- ?line eval(relative_product({E}, relation([{a,b}])), E),
- ?line eval(relative_product({E,from_term([], [{{atom,atom,atom},atom}])}),
- E),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} = (catch relative_product({})),
+ true = is_equal(relative_product({ER}),
+ from_term([], [{atom,{atom}}])),
+ eval(relative_product({relation([{a,b},{c,a}]),
+ relation([{a,1},{a,2}]),
+ relation([{a,aa},{c,1}])}),
+ from_term([{a,{b,1,aa}},{a,{b,2,aa}}])),
+ eval(relative_product({relation([{a,b}])}, E), E),
+ eval(relative_product({E}, relation([{a,b}])), E),
+ eval(relative_product({E,from_term([], [{{atom,atom,atom},atom}])}),
+ E),
+ {'EXIT', {badarg, _}} =
(catch relative_product({from_term([a,b])}, E)),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch relative_product({relation([])}, set([]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch relative_product({from_term([{a,b}]),
from_term([{{a},b}])}, ER)),
- ?line {'EXIT', {badarg, _}} = (catch relative_product({}, ER)),
- ?line relprod2({relation([{a,b}])}, from_term([],[{{atom},atom}]), ER),
- ?line relprod2({relation([{a,b}]),relation([{a,1}])},
- from_term([{{b,1},{tjo,hej,sa}}]),
- from_term([{a,{tjo,hej,sa}}])),
- ?line relprod2({relation([{a,b}]), ER}, from_term([{{a,b},b}]), ER),
- ?line relprod2({relation([{a,b},{c,a}]),
- relation([{a,1},{a,2}])},
- from_term([{{b,1},b1},{{b,2},b2}]),
- relation([{a,b1},{a,b2}])),
- ?line eval(relative_product({relation([{a,b}]), ER}),
- from_term([],[{atom,{atom,atom}}])),
- ?line eval(relative_product({from_term([{{a,[a,b]},[a]}]),
- from_term([{{a,[a,b]},[[a,b]]}])}),
- from_term([{{a,[a,b]},{[a],[[a,b]]}}])),
+ {'EXIT', {badarg, _}} = (catch relative_product({}, ER)),
+ relprod2({relation([{a,b}])}, from_term([],[{{atom},atom}]), ER),
+ relprod2({relation([{a,b}]),relation([{a,1}])},
+ from_term([{{b,1},{tjo,hej,sa}}]),
+ from_term([{a,{tjo,hej,sa}}])),
+ relprod2({relation([{a,b}]), ER}, from_term([{{a,b},b}]), ER),
+ relprod2({relation([{a,b},{c,a}]),
+ relation([{a,1},{a,2}])},
+ from_term([{{b,1},b1},{{b,2},b2}]),
+ relation([{a,b1},{a,b2}])),
+ eval(relative_product({relation([{a,b}]), ER}),
+ from_term([],[{atom,{atom,atom}}])),
+ eval(relative_product({from_term([{{a,[a,b]},[a]}]),
+ from_term([{{a,[a,b]},[[a,b]]}])}),
+ from_term([{{a,[a,b]},{[a],[[a,b]]}}])),
ok.
relprod2(A1T, A2, R) ->
@@ -1624,219 +1545,213 @@ relprod2(A1T, A2, R) ->
eval(relative_product(A1T, A2), R),
eval(relative_product(tuple_to_list(A1T), A2), R).
-product_1(suite) -> [];
-product_1(doc) -> [""];
product_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line eval(product(E, E), E),
- ?line eval(product(relation([]), E), E),
- ?line eval(product(E, relation([])), E),
- ?line eval(product(relation([{a,b}]),relation([{c,d}])),
- from_term([{{a,b},{c,d}}],[{{atom,atom},{atom,atom}}])),
-
- ?line eval(product({E, set([a,b,c])}), E),
- ?line eval(product({set([a,b,c]), E}), E),
- ?line eval(product({set([a,b,c]), E, E}), E),
- ?line eval(product({E,E}), E),
- ?line eval(product({set([a,b]),set([1,2])}),
- relation([{a,1},{a,2},{b,1},{b,2}])),
- ?line eval(product({from_term([a,b]), from_term([{a,b},{c,d}]),
- from_term([1])}),
- from_term([{a,{a,b},1},{a,{c,d},1},{b,{a,b},1},{b,{c,d},1}])),
- ?line {'EXIT', {badarg, _}} = (catch product({})),
- ?line {'EXIT', {badarg, _}} = (catch product({foo})),
- ?line eval(product({E}), E),
- ?line eval(product({E, E}), E),
- ?line eval(product(set([a,b]), set([1,2])),
- relation([{a,1},{a,2},{b,1},{b,2}])),
- ?line eval(product({relation([]), E}), E),
+ E = empty_set(),
+ eval(product(E, E), E),
+ eval(product(relation([]), E), E),
+ eval(product(E, relation([])), E),
+ eval(product(relation([{a,b}]),relation([{c,d}])),
+ from_term([{{a,b},{c,d}}],[{{atom,atom},{atom,atom}}])),
+
+ eval(product({E, set([a,b,c])}), E),
+ eval(product({set([a,b,c]), E}), E),
+ eval(product({set([a,b,c]), E, E}), E),
+ eval(product({E,E}), E),
+ eval(product({set([a,b]),set([1,2])}),
+ relation([{a,1},{a,2},{b,1},{b,2}])),
+ eval(product({from_term([a,b]), from_term([{a,b},{c,d}]),
+ from_term([1])}),
+ from_term([{a,{a,b},1},{a,{c,d},1},{b,{a,b},1},{b,{c,d},1}])),
+ {'EXIT', {badarg, _}} = (catch product({})),
+ {'EXIT', {badarg, _}} = (catch product({foo})),
+ eval(product({E}), E),
+ eval(product({E, E}), E),
+ eval(product(set([a,b]), set([1,2])),
+ relation([{a,1},{a,2},{b,1},{b,2}])),
+ eval(product({relation([]), E}), E),
ok.
-partition_1(suite) -> [];
-partition_1(doc) -> [""];
partition_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([]),
- ?line Id = fun(A) -> A end,
- ?line S1 = relation([{a,1},{b,2},{b,22},{c,0}]),
- ?line eval(partition(1, E), E),
- ?line eval(partition(2, E), E),
- ?line eval(partition(1, ER), from_term([], [type(ER)])),
- ?line eval(partition(2, ER), from_term([], [type(ER)])),
- ?line eval(partition(1, relation([{1,a},{1,b},{2,c},{2,d}])),
- from_term([[{1,a},{1,b}],[{2,c},{2,d}]])),
- ?line eval(partition(2, relation([{1,a},{1,b},{2,a},{2,b},{3,c}])),
- from_term([[{1,a},{2,a}],[{1,b},{2,b}],[{3,c}]])),
- ?line eval(partition(2, relation([{1,a}])), from_term([[{1,a}]])),
- ?line eval(partition(2, relation([{1,a},{2,b}])),
- from_term([[{1,a}],[{2,b}]])),
- ?line eval(partition(2, relation([{1,a},{2,a},{3,a}])),
- from_term([[{1,a},{2,a},{3,a}]])),
- ?line eval(partition(2, relation([{1,b},{2,a}])), % OTP-4516
- from_term([[{1,b}],[{2,a}]])),
- ?line eval(union(partition(Id, S1)), S1),
- ?line eval(partition({external, fun({A,{B,_}}) -> {A,B} end},
- from_term([{a,{b,c}},{b,{c,d}},{a,{b,f}}])),
- from_term([[{a,{b,c}},{a,{b,f}}],[{b,{c,d}}]])),
+ E = empty_set(),
+ ER = relation([]),
+ Id = fun(A) -> A end,
+ S1 = relation([{a,1},{b,2},{b,22},{c,0}]),
+ eval(partition(1, E), E),
+ eval(partition(2, E), E),
+ eval(partition(1, ER), from_term([], [type(ER)])),
+ eval(partition(2, ER), from_term([], [type(ER)])),
+ eval(partition(1, relation([{1,a},{1,b},{2,c},{2,d}])),
+ from_term([[{1,a},{1,b}],[{2,c},{2,d}]])),
+ eval(partition(2, relation([{1,a},{1,b},{2,a},{2,b},{3,c}])),
+ from_term([[{1,a},{2,a}],[{1,b},{2,b}],[{3,c}]])),
+ eval(partition(2, relation([{1,a}])), from_term([[{1,a}]])),
+ eval(partition(2, relation([{1,a},{2,b}])),
+ from_term([[{1,a}],[{2,b}]])),
+ eval(partition(2, relation([{1,a},{2,a},{3,a}])),
+ from_term([[{1,a},{2,a},{3,a}]])),
+ eval(partition(2, relation([{1,b},{2,a}])), % OTP-4516
+ from_term([[{1,b}],[{2,a}]])),
+ eval(union(partition(Id, S1)), S1),
+ eval(partition({external, fun({A,{B,_}}) -> {A,B} end},
+ from_term([{a,{b,c}},{b,{c,d}},{a,{b,f}}])),
+ from_term([[{a,{b,c}},{a,{b,f}}],[{b,{c,d}}]])),
F = 0.0, I = round(F),
- ?line FR = relation([{I,a},{F,b}]),
+ FR = relation([{I,a},{F,b}]),
if
F == I -> % term ordering
- ?line eval(partition(1, FR), from_term([[{I,a},{F,b}]]));
+ eval(partition(1, FR), from_term([[{I,a},{F,b}]]));
true ->
- ?line eval(partition(1, FR), from_term([[{I,a}],[{F,b}]]))
+ eval(partition(1, FR), from_term([[{I,a}],[{F,b}]]))
end,
- ?line {'EXIT', {badarg, _}} = (catch partition(2, set([a]))),
- ?line {'EXIT', {badarg, _}} = (catch partition(1, set([a]))),
- ?line eval(partition(Id, set([a])), from_term([[a]])),
-
- ?line eval(partition(E), E),
- ?line P1 = from_term([[a,b,c],[d,e,f],[g,h]]),
- ?line P2 = from_term([[a,d],[b,c,e,f,q,v]]),
- ?line eval(partition(union(P1, P2)),
- from_term([[a],[b,c],[d],[e,f],[g,h],[q,v]])),
- ?line {'EXIT', {badarg, _}} = (catch partition(from_term([a]))),
+ {'EXIT', {badarg, _}} = (catch partition(2, set([a]))),
+ {'EXIT', {badarg, _}} = (catch partition(1, set([a]))),
+ eval(partition(Id, set([a])), from_term([[a]])),
+
+ eval(partition(E), E),
+ P1 = from_term([[a,b,c],[d,e,f],[g,h]]),
+ P2 = from_term([[a,d],[b,c,e,f,q,v]]),
+ eval(partition(union(P1, P2)),
+ from_term([[a],[b,c],[d],[e,f],[g,h],[q,v]])),
+ {'EXIT', {badarg, _}} = (catch partition(from_term([a]))),
ok.
-partition_3(suite) -> [];
-partition_3(doc) -> [""];
partition_3(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([]),
+ E = empty_set(),
+ ER = relation([]),
%% set of ordered sets
- ?line S1 = relation([{a,1},{b,2},{b,22},{c,0}]),
- ?line eval(partition(1, S1, set([0,1,d,e])),
- lpartition(1, S1, set([0,1,d,e]))),
- ?line eval(partition(1, S1, E), lpartition(1, S1, E)),
- ?line eval(partition(2, ER, set([a,b])), lpartition(2, ER, set([a,b]))),
+ S1 = relation([{a,1},{b,2},{b,22},{c,0}]),
+ eval(partition(1, S1, set([0,1,d,e])),
+ lpartition(1, S1, set([0,1,d,e]))),
+ eval(partition(1, S1, E), lpartition(1, S1, E)),
+ eval(partition(2, ER, set([a,b])), lpartition(2, ER, set([a,b]))),
XFun1 = {external, fun({_A,B,C}) -> {B,C} end},
R1a = relation([{a,aa,1},{b,bb,2},{c,cc,3}]),
R1b = relation([{bb,2},{cc,3}]),
- ?line eval(partition(XFun1, R1a, R1b), lpartition(XFun1, R1a, R1b)),
+ eval(partition(XFun1, R1a, R1b), lpartition(XFun1, R1a, R1b)),
Id = fun(X) -> X end,
XId = {external, Id},
R2 = relation([{a,b}]),
- ?line eval(partition(XId, R2, E), lpartition(XId, R2, E)),
+ eval(partition(XId, R2, E), lpartition(XId, R2, E)),
R3 = relation([{b,d}]),
- ?line eval(partition(XId, E, R3), lpartition(XId, E, R3)),
+ eval(partition(XId, E, R3), lpartition(XId, E, R3)),
Fun1 = fun(S) -> {_A,B,C} = to_external(S), from_term({B,C}) end,
R4a = relation([{a,aa,1},{b,bb,2},{c,cc,3}]),
R4b = relation([{bb,2},{cc,3}]),
- ?line eval(partition(Fun1,R4a,R4b), lpartition(Fun1,R4a,R4b)),
+ eval(partition(Fun1,R4a,R4b), lpartition(Fun1,R4a,R4b)),
XFun2 = {external, fun({_,{A},B}) -> {A,B} end},
R5a = from_term([{a,{aa},1},{b,{bb},2},{c,{cc},3}]),
R5b = from_term([{bb,2},{cc,3}]),
- ?line eval(partition(XFun2,R5a, R5b), lpartition(XFun2,R5a, R5b)),
+ eval(partition(XFun2,R5a, R5b), lpartition(XFun2,R5a, R5b)),
R6 = relation([{a,b}]),
- ?line eval(partition(2, R6, E), lpartition(2, R6, E)),
+ eval(partition(2, R6, E), lpartition(2, R6, E)),
R7 = relation([{b,d}]),
- ?line eval(partition(2, E, R7), lpartition(2, E, R7)),
+ eval(partition(2, E, R7), lpartition(2, E, R7)),
S2 = set([a]),
- ?line eval(partition(XId, E, S2), lpartition(XId, E, S2)),
- ?line eval(partition(XId, S1, E), lpartition(XId, S1, E)),
- ?line {'EXIT', {badarg, _}} =
+ eval(partition(XId, E, S2), lpartition(XId, E, S2)),
+ eval(partition(XId, S1, E), lpartition(XId, S1, E)),
+ {'EXIT', {badarg, _}} =
(catch partition(3, relation([{a,b}]), E)),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch partition(3, relation([{a,b}]), relation([{b,d}]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch partition(3, relation([{a,b}]), set([{b,d}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch partition(2, relation([{a,b}]), relation([{b,d}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch partition({external, fun({A,_B}) -> A end},
relation([{a,b}]), relation([{b,d}]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch partition({external, fun({A,_}) -> {A,0} end},
from_term([{1,a}]),
from_term([{1,0}]))),
S18a = relation([{1,e},{2,b},{3,c},{4,b},{5,a},{6,0}]),
S18b = set([b,d,f]),
- ?line eval(partition({external,fun({_,X}) -> X end}, S18a, S18b),
- lpartition({external,fun({_,X}) -> X end}, S18a, S18b)),
+ eval(partition({external,fun({_,X}) -> X end}, S18a, S18b),
+ lpartition({external,fun({_,X}) -> X end}, S18a, S18b)),
S19a = sofs:relation([{3,a},{8,b}]),
S19b = set([2,6,7]),
- ?line eval(partition({external,fun({X,_}) -> X end}, S19a, S19b),
- lpartition({external,fun({X,_}) -> X end}, S19a, S19b)),
+ eval(partition({external,fun({X,_}) -> X end}, S19a, S19b),
+ lpartition({external,fun({X,_}) -> X end}, S19a, S19b)),
R8a = relation([{a,d},{b,e},{c,b},{d,c}]),
S8 = set([b,d]),
- ?line eval(partition(2, R8a, S8), lpartition(2, R8a, S8)),
+ eval(partition(2, R8a, S8), lpartition(2, R8a, S8)),
S16a = relation([{1,e},{2,b},{3,c},{4,b},{5,a},{6,0}]),
S16b = set([b,c,d]),
- ?line eval(partition(2, S16a, S16b), lpartition(2, S16a, S16b)),
+ eval(partition(2, S16a, S16b), lpartition(2, S16a, S16b)),
S17a = relation([{e,1},{b,2},{c,3},{b,4},{a,5},{0,6}]),
S17b = set([b,c,d]),
- ?line eval(partition(1, S17a, S17b), lpartition(1, S17a, S17b)),
+ eval(partition(1, S17a, S17b), lpartition(1, S17a, S17b)),
- ?line {'EXIT', {function_clause, _}} =
+ {'EXIT', {function_clause, _}} =
(catch partition({external, fun({A,_B}) -> A end}, set([]), E)),
Fun3 = fun(S) -> from_term({to_external(S),0}, {type(S),atom}) end,
S9a = set([1,2]),
S9b = from_term([{1,0}]),
- ?line eval(partition(Fun3, S9a, S9b), lpartition(Fun3, S9a, S9b)),
+ eval(partition(Fun3, S9a, S9b), lpartition(Fun3, S9a, S9b)),
S14a = relation([{1,a},{2,b},{3,c},{0,0}]),
S14b = set([b,c]),
- ?line eval(partition(2, S14a, S14b), lpartition(2, S14a, S14b)),
+ eval(partition(2, S14a, S14b), lpartition(2, S14a, S14b)),
S15a = relation([{a,1},{b,2},{c,3},{0,0}]),
S15b = set([b,c]),
- ?line eval(partition(1, S15a, S15b), lpartition(1, S15a, S15b)),
+ eval(partition(1, S15a, S15b), lpartition(1, S15a, S15b)),
%% set of sets
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch partition({external, fun(X) -> X end},
from_term([], [[atom]]), set([a]))),
S10 = from_term([], [[atom]]),
- ?line eval(partition(Id, S10, E), lpartition(Id, S10, E)),
+ eval(partition(Id, S10, E), lpartition(Id, S10, E)),
S10e = from_term([[a],[b]], [[atom]]),
- ?line eval(partition(Id, S10e, E), lpartition(Id, S10e, E)),
+ eval(partition(Id, S10e, E), lpartition(Id, S10e, E)),
S11a = from_term([], [[atom]]),
S11b = set([a]),
- ?line eval(partition(Id, S11a, S11b), lpartition(Id, S11a, S11b)),
+ eval(partition(Id, S11a, S11b), lpartition(Id, S11a, S11b)),
S12a = from_term([[[a],[b]], [[b],[c]], [[], [a,b]], [[1],[2]]]),
S12b = from_term([[a,b],[1,2,3],[b,c]]),
- ?line eval(partition(fun sofs:union/1, S12a, S12b),
- lpartition(fun sofs:union/1, S12a, S12b)),
+ eval(partition(fun sofs:union/1, S12a, S12b),
+ lpartition(fun sofs:union/1, S12a, S12b)),
Fun13 = fun(_) -> from_term([a]) end,
S13a = from_term([], [[atom]]),
S13b = from_term([], [[a]]),
- ?line eval(partition(Fun13, S13a, S13b), lpartition(Fun13, S13a, S13b)),
+ eval(partition(Fun13, S13a, S13b), lpartition(Fun13, S13a, S13b)),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch partition(fun(_) -> from_term([a]) end,
from_term([[1,2],[3,4]]),
from_term([], [atom]))),
Fun10 = fun(S) ->
- %% Cheating a lot...
- case to_external(S) of
- [1] -> from_term({1,1});
- _ -> S
- end
- end,
- ?line {'EXIT', {type_mismatch, _}} =
+ %% Cheating a lot...
+ case to_external(S) of
+ [1] -> from_term({1,1});
+ _ -> S
+ end
+ end,
+ {'EXIT', {type_mismatch, _}} =
(catch partition(Fun10, from_term([[1]]), from_term([], [[atom]]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch partition(fun(_) -> from_term({a}) end,
from_term([[a]]),
from_term([], [atom]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch partition(fun(_) -> {a} end,
from_term([[a]]),
from_term([], [atom]))),
@@ -1845,84 +1760,80 @@ partition_3(Conf) when is_list(Conf) ->
lpartition(F, S1, S2) ->
{restriction(F, S1, S2), drestriction(F, S1, S2)}.
-multiple_relative_product(suite) -> [];
-multiple_relative_product(doc) -> [""];
multiple_relative_product(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([]),
- ?line T = relation([{a,1},{a,11},{b,2},{c,3},{c,33},{d,4}]),
- ?line {'EXIT', {badarg, _}} =
+ E = empty_set(),
+ ER = relation([]),
+ T = relation([{a,1},{a,11},{b,2},{c,3},{c,33},{d,4}]),
+ {'EXIT', {badarg, _}} =
(catch multiple_relative_product({}, ER)),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch multiple_relative_product({}, relation([{a,b}]))),
- ?line eval(multiple_relative_product({E,T,T}, relation([], 3)), E),
- ?line eval(multiple_relative_product({T,T,T}, E), E),
- ?line eval(multiple_relative_product({T,T,T}, relation([],3)),
- from_term([],[{{atom,atom,atom},{atom,atom,atom}}])),
- ?line eval(multiple_relative_product({T,T,T},
+ eval(multiple_relative_product({E,T,T}, relation([], 3)), E),
+ eval(multiple_relative_product({T,T,T}, E), E),
+ eval(multiple_relative_product({T,T,T}, relation([],3)),
+ from_term([],[{{atom,atom,atom},{atom,atom,atom}}])),
+ eval(multiple_relative_product({T,T,T},
relation([{a,b,c},{c,d,a}])),
- from_term([{{a,b,c},{1,2,3}}, {{a,b,c},{1,2,33}},
- {{a,b,c},{11,2,3}}, {{a,b,c},{11,2,33}},
- {{c,d,a},{3,4,1}}, {{c,d,a},{3,4,11}},
- {{c,d,a},{33,4,1}}, {{c,d,a},{33,4,11}}])),
- ?line {'EXIT', {type_mismatch, _}} =
+ from_term([{{a,b,c},{1,2,3}}, {{a,b,c},{1,2,33}},
+ {{a,b,c},{11,2,3}}, {{a,b,c},{11,2,33}},
+ {{c,d,a},{3,4,1}}, {{c,d,a},{3,4,11}},
+ {{c,d,a},{33,4,1}}, {{c,d,a},{33,4,11}}])),
+ {'EXIT', {type_mismatch, _}} =
(catch multiple_relative_product({T}, from_term([{{a}}]))),
ok.
-digraph(suite) -> [];
-digraph(doc) -> [""];
digraph(Conf) when is_list(Conf) ->
- ?line T0 = ets:all(),
- ?line E = empty_set(),
- ?line R = relation([{a,b},{b,c},{c,d},{d,a}]),
- ?line F = relation_to_family(R),
+ T0 = ets:all(),
+ E = empty_set(),
+ R = relation([{a,b},{b,c},{c,d},{d,a}]),
+ F = relation_to_family(R),
Type = type(F),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch family_to_digraph(set([a]))),
digraph_fail(badarg, catch family_to_digraph(set([a]), [foo])),
digraph_fail(badarg, catch family_to_digraph(F, [foo])),
digraph_fail(cyclic, catch family_to_digraph(family([{a,[a]}]),[acyclic])),
- ?line G1 = family_to_digraph(E),
- ?line {'EXIT', {badarg, _}} = (catch digraph_to_family(G1, foo)),
- ?line {'EXIT', {badarg, _}} = (catch digraph_to_family(G1, atom)),
- ?line true = [] == to_external(digraph_to_family(G1)),
- ?line true = [] == to_external(digraph_to_family(G1, Type)),
- ?line true = digraph:delete(G1),
-
- ?line G1a = family_to_digraph(E, [protected]),
- ?line true = [] == to_external(digraph_to_family(G1a)),
- ?line true = [] == to_external(digraph_to_family(G1a, Type)),
- ?line true = digraph:delete(G1a),
-
- ?line G2 = family_to_digraph(F),
- ?line true = F == digraph_to_family(G2),
- ?line true = F == digraph_to_family(G2, type(F)),
- ?line true = digraph:delete(G2),
-
- ?line R2 = from_term([{{a},b},{{c},d}]),
- ?line F2 = relation_to_family(R2),
- ?line Type2 = type(F2),
- ?line G3 = family_to_digraph(F2, [protected]),
- ?line true = is_subset(F2, digraph_to_family(G3, Type2)),
- ?line true = digraph:delete(G3),
+ G1 = family_to_digraph(E),
+ {'EXIT', {badarg, _}} = (catch digraph_to_family(G1, foo)),
+ {'EXIT', {badarg, _}} = (catch digraph_to_family(G1, atom)),
+ true = [] == to_external(digraph_to_family(G1)),
+ true = [] == to_external(digraph_to_family(G1, Type)),
+ true = digraph:delete(G1),
+
+ G1a = family_to_digraph(E, [protected]),
+ true = [] == to_external(digraph_to_family(G1a)),
+ true = [] == to_external(digraph_to_family(G1a, Type)),
+ true = digraph:delete(G1a),
+
+ G2 = family_to_digraph(F),
+ true = F == digraph_to_family(G2),
+ true = F == digraph_to_family(G2, type(F)),
+ true = digraph:delete(G2),
+
+ R2 = from_term([{{a},b},{{c},d}]),
+ F2 = relation_to_family(R2),
+ Type2 = type(F2),
+ G3 = family_to_digraph(F2, [protected]),
+ true = is_subset(F2, digraph_to_family(G3, Type2)),
+ true = digraph:delete(G3),
Fl = 0.0, I = round(Fl),
if
Fl == I -> % term ordering
- ?line G4 = digraph:new(),
+ G4 = digraph:new(),
digraph:add_vertex(G4, Fl),
digraph:add_vertex(G4, I),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch digraph_to_family(G4, Type)),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch digraph_to_family(G4)),
- ?line true = digraph:delete(G4);
+ true = digraph:delete(G4);
true -> ok
end,
-
- ?line true = T0 == ets:all(),
+
+ true = T0 == ets:all(),
ok.
digraph_fail(ExitReason, Fail) ->
@@ -1932,32 +1843,28 @@ digraph_fail(ExitReason, Fail) ->
{true,2} -> ok
end.
-constant_function(suite) -> [];
-constant_function(doc) -> [""];
constant_function(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line C = from_term(3),
- ?line eval(constant_function(E, C), E),
- ?line eval(constant_function(set([a,b]), E), from_term([{a,[]},{b,[]}])),
- ?line eval(constant_function(set([a,b]), C), from_term([{a,3},{b,3}])),
- ?line {'EXIT', {badarg, _}} = (catch constant_function(C, C)),
- ?line {'EXIT', {badarg, _}} = (catch constant_function(set([]), foo)),
+ E = empty_set(),
+ C = from_term(3),
+ eval(constant_function(E, C), E),
+ eval(constant_function(set([a,b]), E), from_term([{a,[]},{b,[]}])),
+ eval(constant_function(set([a,b]), C), from_term([{a,3},{b,3}])),
+ {'EXIT', {badarg, _}} = (catch constant_function(C, C)),
+ {'EXIT', {badarg, _}} = (catch constant_function(set([]), foo)),
ok.
-misc(suite) -> [];
-misc(doc) -> [""];
misc(Conf) when is_list(Conf) ->
- % find "relational" part of relation:
- ?line S = relation([{a,b},{b,c},{b,d},{c,d}]),
+ %% find "relational" part of relation:
+ S = relation([{a,b},{b,c},{b,d},{c,d}]),
Id = fun(A) -> A end,
- ?line RR = relational_restriction(S),
- ?line eval(union(difference(partition(Id,S), partition(1,S))), RR),
- ?line eval(union(difference(partition(1,S), partition(Id,S))), RR),
-
- % the "functional" part:
- ?line eval(union(intersection(partition(1,S), partition(Id,S))),
- difference(S, RR)),
- ?line {'EXIT', {undef, _}} =
+ RR = relational_restriction(S),
+ eval(union(difference(partition(Id,S), partition(1,S))), RR),
+ eval(union(difference(partition(1,S), partition(Id,S))), RR),
+
+ %% the "functional" part:
+ eval(union(intersection(partition(1,S), partition(Id,S))),
+ difference(S, RR)),
+ {'EXIT', {undef, _}} =
(catch projection(fun external:foo/1, set([a,b,c]))),
ok.
@@ -1966,157 +1873,143 @@ relational_restriction(R) ->
family_to_relation(family_specification(Fun, relation_to_family(R))).
-family_specification(suite) -> [];
-family_specification(doc) -> [""];
family_specification(Conf) when is_list(Conf) ->
E = empty_set(),
%% internal
- ?line eval(family_specification(fun sofs:is_set/1, E), E),
- ?line {'EXIT', {badarg, _}} =
- (catch family_specification(fun sofs:is_set/1, set([]))),
- ?line F1 = from_term([{1,[1]}]),
- ?line eval(family_specification(fun sofs:is_set/1, F1), F1),
+ eval(family_specification(fun sofs:is_set/1, E), E),
+ {'EXIT', {badarg, _}} =
+ (catch family_specification(fun sofs:is_set/1, set([]))),
+ F1 = from_term([{1,[1]}]),
+ eval(family_specification(fun sofs:is_set/1, F1), F1),
Fun = fun(S) -> is_subset(S, set([0,1,2,3,4])) end,
- ?line F2 = family([{a,[1,2]},{b,[3,4,5]}]),
- ?line eval(family_specification(Fun, F2), family([{a,[1,2]}])),
- ?line F3 = from_term([{a,[]},{b,[]}]),
- ?line eval(family_specification(fun sofs:is_set/1, F3), F3),
+ F2 = family([{a,[1,2]},{b,[3,4,5]}]),
+ eval(family_specification(Fun, F2), family([{a,[1,2]}])),
+ F3 = from_term([{a,[]},{b,[]}]),
+ eval(family_specification(fun sofs:is_set/1, F3), F3),
Fun2 = fun(_) -> throw(fippla) end,
- ?line fippla = (catch family_specification(Fun2, family([{a,[1]}]))),
+ fippla = (catch family_specification(Fun2, family([{a,[1]}]))),
Fun3 = fun(_) -> neither_true_nor_false end,
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch family_specification(Fun3, F3)),
%% external
IsList = {external, fun(L) when is_list(L) -> true; (_) -> false end},
- ?line eval(family_specification(IsList, E), E),
- ?line eval(family_specification(IsList, F1), F1),
+ eval(family_specification(IsList, E), E),
+ eval(family_specification(IsList, F1), F1),
MF = {external, fun(L) -> lists:member(3, L) end},
- ?line eval(family_specification(MF, F2), family([{b,[3,4,5]}])),
- ?line fippla = (catch family_specification(Fun2, family([{a,[1]}]))),
- ?line {'EXIT', {badarg, _}} =
+ eval(family_specification(MF, F2), family([{b,[3,4,5]}])),
+ fippla = (catch family_specification(Fun2, family([{a,[1]}]))),
+ {'EXIT', {badarg, _}} =
(catch family_specification({external, Fun3}, F3)),
ok.
-family_domain_1(suite) -> [];
-family_domain_1(doc) -> [""];
family_domain_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = from_term([{a,[]},{b,[]}],[{atom,[{atom,atom}]}]),
- ?line EF = from_term([{a,[]},{b,[]}],[{atom,[atom]}]),
- ?line eval(family_domain(E), E),
- ?line eval(family_domain(ER), EF),
- ?line FR = from_term([{a,[{1,a},{2,b},{3,c}]},{b,[]},{c,[{4,d},{5,e}]}]),
- ?line eval(family_domain(FR), from_term([{a,[1,2,3]},{b,[]},{c,[4,5]}])),
- ?line eval(family_field(E), E),
- ?line eval(family_field(FR),
- from_term([{a,[a,b,c,1,2,3]},{b,[]},{c,[d,e,4,5]}])),
- ?line eval(family_domain(from_term([{{a},[{{1,[]},c}]}])),
- from_term([{{a},[{1,[]}]}])),
- ?line eval(family_domain(from_term([{{a},[{{1,[a]},c}]}])),
- from_term([{{a},[{1,[a]}]}])),
- ?line eval(family_domain(from_term([{{a},[]}])),
- from_term([{{a},[]}])),
- ?line eval(family_domain(from_term([], type(FR))),
- from_term([], [{atom,[atom]}])),
- ?line {'EXIT', {badarg, _}} = (catch family_domain(set([a]))),
- ?line {'EXIT', {badarg, _}} = (catch family_field(set([a]))),
- ?line {'EXIT', {badarg, _}} = (catch family_domain(set([{a,[b]}]))),
+ E = empty_set(),
+ ER = from_term([{a,[]},{b,[]}],[{atom,[{atom,atom}]}]),
+ EF = from_term([{a,[]},{b,[]}],[{atom,[atom]}]),
+ eval(family_domain(E), E),
+ eval(family_domain(ER), EF),
+ FR = from_term([{a,[{1,a},{2,b},{3,c}]},{b,[]},{c,[{4,d},{5,e}]}]),
+ eval(family_domain(FR), from_term([{a,[1,2,3]},{b,[]},{c,[4,5]}])),
+ eval(family_field(E), E),
+ eval(family_field(FR),
+ from_term([{a,[a,b,c,1,2,3]},{b,[]},{c,[d,e,4,5]}])),
+ eval(family_domain(from_term([{{a},[{{1,[]},c}]}])),
+ from_term([{{a},[{1,[]}]}])),
+ eval(family_domain(from_term([{{a},[{{1,[a]},c}]}])),
+ from_term([{{a},[{1,[a]}]}])),
+ eval(family_domain(from_term([{{a},[]}])),
+ from_term([{{a},[]}])),
+ eval(family_domain(from_term([], type(FR))),
+ from_term([], [{atom,[atom]}])),
+ {'EXIT', {badarg, _}} = (catch family_domain(set([a]))),
+ {'EXIT', {badarg, _}} = (catch family_field(set([a]))),
+ {'EXIT', {badarg, _}} = (catch family_domain(set([{a,[b]}]))),
ok.
-family_range_1(suite) -> [];
-family_range_1(doc) -> [""];
family_range_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = from_term([{a,[]},{b,[]}],[{atom,[{atom,atom}]}]),
- ?line EF = from_term([{a,[]},{b,[]}],[{atom,[atom]}]),
- ?line eval(family_range(E), E),
- ?line eval(family_range(ER), EF),
- ?line FR = from_term([{a,[{1,a},{2,b},{3,c}]},{b,[]},{c,[{4,d},{5,e}]}]),
- ?line eval(family_range(FR), from_term([{a,[a,b,c]},{b,[]},{c,[d,e]}])),
- ?line eval(family_range(from_term([{{a},[{c,{1,[a]}}]}])),
- from_term([{{a},[{1,[a]}]}])),
- ?line eval(family_range(from_term([{{a},[{c,{1,[]}}]}])),
- from_term([{{a},[{1,[]}]}])),
- ?line eval(family_range(from_term([{{a},[]}])),
- from_term([{{a},[]}])),
- ?line eval(family_range(from_term([], type(FR))),
- from_term([], [{atom,[atom]}])),
- ?line {'EXIT', {badarg, _}} = (catch family_range(set([a]))),
- ?line {'EXIT', {badarg, _}} = (catch family_range(set([{a,[b]}]))),
+ E = empty_set(),
+ ER = from_term([{a,[]},{b,[]}],[{atom,[{atom,atom}]}]),
+ EF = from_term([{a,[]},{b,[]}],[{atom,[atom]}]),
+ eval(family_range(E), E),
+ eval(family_range(ER), EF),
+ FR = from_term([{a,[{1,a},{2,b},{3,c}]},{b,[]},{c,[{4,d},{5,e}]}]),
+ eval(family_range(FR), from_term([{a,[a,b,c]},{b,[]},{c,[d,e]}])),
+ eval(family_range(from_term([{{a},[{c,{1,[a]}}]}])),
+ from_term([{{a},[{1,[a]}]}])),
+ eval(family_range(from_term([{{a},[{c,{1,[]}}]}])),
+ from_term([{{a},[{1,[]}]}])),
+ eval(family_range(from_term([{{a},[]}])),
+ from_term([{{a},[]}])),
+ eval(family_range(from_term([], type(FR))),
+ from_term([], [{atom,[atom]}])),
+ {'EXIT', {badarg, _}} = (catch family_range(set([a]))),
+ {'EXIT', {badarg, _}} = (catch family_range(set([{a,[b]}]))),
ok.
-family_to_relation_1(suite) -> [];
-family_to_relation_1(doc) -> [""];
family_to_relation_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line ER = relation([]),
- ?line EF = family([]),
- ?line eval(family_to_relation(E), E),
- ?line eval(family_to_relation(EF), ER),
- ?line eval(sofs:fam2rel(EF), ER),
- ?line F = family([{a,[]},{b,[1]},{c,[7,9,11]}]),
- ?line eval(family_to_relation(F), relation([{b,1},{c,7},{c,9},{c,11}])),
- ?line {'EXIT', {badarg, _}} = (catch family_to_relation(set([a]))),
+ E = empty_set(),
+ ER = relation([]),
+ EF = family([]),
+ eval(family_to_relation(E), E),
+ eval(family_to_relation(EF), ER),
+ eval(sofs:fam2rel(EF), ER),
+ F = family([{a,[]},{b,[1]},{c,[7,9,11]}]),
+ eval(family_to_relation(F), relation([{b,1},{c,7},{c,9},{c,11}])),
+ {'EXIT', {badarg, _}} = (catch family_to_relation(set([a]))),
ok.
-union_of_family_1(suite) -> [];
-union_of_family_1(doc) -> [""];
union_of_family_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line EF = from_term([{a,[]},{b,[]}],[{atom,[atom]}]),
- ?line eval(union_of_family(E), E),
- ?line eval(union_of_family(EF), set([])),
- ?line eval(union_of_family(family([])), set([])),
- ?line FR = from_term([{a,[1,2,3]},{b,[]},{c,[4,5]}]),
- ?line eval(union_of_family(FR), set([1,2,3,4,5])),
- ?line eval(union_of_family(sofs:family([{a,[1,2]},{b,[1,2]}])),
- set([1,2])),
- ?line {'EXIT', {badarg, _}} = (catch union_of_family(set([a]))),
+ E = empty_set(),
+ EF = from_term([{a,[]},{b,[]}],[{atom,[atom]}]),
+ eval(union_of_family(E), E),
+ eval(union_of_family(EF), set([])),
+ eval(union_of_family(family([])), set([])),
+ FR = from_term([{a,[1,2,3]},{b,[]},{c,[4,5]}]),
+ eval(union_of_family(FR), set([1,2,3,4,5])),
+ eval(union_of_family(sofs:family([{a,[1,2]},{b,[1,2]}])),
+ set([1,2])),
+ {'EXIT', {badarg, _}} = (catch union_of_family(set([a]))),
ok.
-intersection_of_family_1(suite) -> [];
-intersection_of_family_1(doc) -> [""];
intersection_of_family_1(Conf) when is_list(Conf) ->
- ?line EF = from_term([{a,[]},{b,[]}],[{atom,[atom]}]),
- ?line eval(intersection_of_family(EF), set([])),
- ?line FR = from_term([{a,[1,2,3]},{b,[2,3]},{c,[3,4,5]}]),
- ?line eval(intersection_of_family(FR), set([3])),
- ?line {'EXIT', {badarg, _}} =
+ EF = from_term([{a,[]},{b,[]}],[{atom,[atom]}]),
+ eval(intersection_of_family(EF), set([])),
+ FR = from_term([{a,[1,2,3]},{b,[2,3]},{c,[3,4,5]}]),
+ eval(intersection_of_family(FR), set([3])),
+ {'EXIT', {badarg, _}} =
(catch intersection_of_family(family([]))),
- ?line EE = from_term([], [[atom]]),
- ?line {'EXIT', {badarg, _}} = (catch intersection_of_family(EE)),
- ?line {'EXIT', {badarg, _}} = (catch intersection_of_family(set([a]))),
+ EE = from_term([], [[atom]]),
+ {'EXIT', {badarg, _}} = (catch intersection_of_family(EE)),
+ {'EXIT', {badarg, _}} = (catch intersection_of_family(set([a]))),
ok.
-family_projection(suite) -> [];
-family_projection(doc) -> [""];
family_projection(Conf) when is_list(Conf) ->
SSType = [{atom,[[atom]]}],
SRType = [{atom,[{atom,atom}]}],
- ?line E = empty_set(),
-
- ?line eval(family_projection(fun(X) -> X end, family([])), E),
- ?line L1 = [{a,[]}],
- ?line eval(family_projection(fun sofs:union/1, E), E),
- ?line eval(family_projection(fun sofs:union/1, from_term(L1, SSType)),
- family(L1)),
- ?line {'EXIT', {badarg, _}} =
+ E = empty_set(),
+
+ eval(family_projection(fun(X) -> X end, family([])), E),
+ L1 = [{a,[]}],
+ eval(family_projection(fun sofs:union/1, E), E),
+ eval(family_projection(fun sofs:union/1, from_term(L1, SSType)),
+ family(L1)),
+ {'EXIT', {badarg, _}} =
(catch family_projection(fun sofs:union/1, set([]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch family_projection(fun sofs:union/1, from_term([{1,[1]}]))),
- ?line F2 = from_term([{a,[[1],[2]]},{b,[[3,4],[5]]}], SSType),
- ?line eval(family_projection(fun sofs:union/1, F2),
- family_union(F2)),
+ F2 = from_term([{a,[[1],[2]]},{b,[[3,4],[5]]}], SSType),
+ eval(family_projection(fun sofs:union/1, F2),
+ family_union(F2)),
- ?line F3 = from_term([{1,[{a,b},{b,c},{c,d}]},{3,[]},{5,[{3,5}]}],
- SRType),
- ?line eval(family_projection(fun sofs:domain/1, F3), family_domain(F3)),
- ?line eval(family_projection(fun sofs:range/1, F3), family_range(F3)),
+ F3 = from_term([{1,[{a,b},{b,c},{c,d}]},{3,[]},{5,[{3,5}]}],
+ SRType),
+ eval(family_projection(fun sofs:domain/1, F3), family_domain(F3)),
+ eval(family_projection(fun sofs:range/1, F3), family_range(F3)),
- ?line eval(family_projection(fun(_) -> E end, family([{a,[b,c]}])),
- from_term([{a,[]}])),
+ eval(family_projection(fun(_) -> E end, family([{a,[b,c]}])),
+ from_term([{a,[]}])),
Fun1 = fun(S) ->
case to_external(S) of
@@ -2124,264 +2017,252 @@ family_projection(Conf) when is_list(Conf) ->
_ -> S
end
end,
- ?line eval(family_projection(Fun1, family([{a,[1]}])),
- from_term([{a,{1,1}}])),
+ eval(family_projection(Fun1, family([{a,[1]}])),
+ from_term([{a,{1,1}}])),
Fun2 = fun(_) -> throw(fippla) end,
- ?line fippla =
+ fippla =
(catch family_projection(Fun2, family([{a,[1]}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch family_projection(Fun1, from_term([{1,[1]},{2,[2]}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch family_projection(Fun1, from_term([{1,[1]},{0,[0]}]))),
- ?line eval(family_projection(fun(_) -> E end, from_term([{a,[]}])),
- from_term([{a,[]}])),
+ eval(family_projection(fun(_) -> E end, from_term([{a,[]}])),
+ from_term([{a,[]}])),
F4 = from_term([{a,[{1,2,3}]},{b,[{4,5,6}]},{c,[]},{m3,[]}]),
Z = from_term(0),
- ?line eval(family_projection(fun(S) -> local_adjoin(S, Z) end, F4),
- from_term([{a,[{{1,2,3},0}]},{b,[{{4,5,6},0}]},{c,[]},{m3,[]}])),
- ?line {'EXIT', {badarg, _}} =
+ eval(family_projection(fun(S) -> local_adjoin(S, Z) end, F4),
+ from_term([{a,[{{1,2,3},0}]},{b,[{{4,5,6},0}]},{c,[]},{m3,[]}])),
+ {'EXIT', {badarg, _}} =
(catch family_projection({external, fun(X) -> X end},
from_term([{1,[1]}]))),
%% ordered set element
- ?line eval(family_projection(fun(_) -> from_term(a, atom) end,
- from_term([{1,[a]}])),
- from_term([{1,a}])),
+ eval(family_projection(fun(_) -> from_term(a, atom) end,
+ from_term([{1,[a]}])),
+ from_term([{1,a}])),
ok.
-family_difference(suite) -> [];
-family_difference(doc) -> [""];
family_difference(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line EF = family([]),
- ?line F9 = from_term([{b,[b,c]}]),
- ?line F10 = from_term([{a,[b,c]}]),
- ?line eval(family_difference(E, E), E),
- ?line eval(family_difference(E, F10), from_term([], type(F10))),
- ?line eval(family_difference(F10, E), F10),
- ?line eval(family_difference(F9, F10), F9),
- ?line eval(family_difference(F10, F10), family([{a,[]}])),
- ?line F20 = from_term([{a,[1,2,3]},{b,[1,2,3]},{c,[1,2,3]}]),
- ?line F21 = from_term([{b,[1,2,3]},{c,[1,2,3]}]),
- ?line eval(family_difference(F20, from_term([{a,[2]}])),
- from_term([{a,[1,3]},{b,[1,2,3]},{c,[1,2,3]}])),
- ?line eval(family_difference(F20, from_term([{0,[2]},{q,[1,2]}])), F20),
- ?line eval(family_difference(F20, F21),
- from_term([{a,[1,2,3]},{b,[]},{c,[]}])),
-
- ?line eval(family_difference(from_term([{e,[f,g]}]), family([])),
- from_term([{e,[f,g]}])),
- ?line eval(family_difference(from_term([{e,[f,g]}]), EF),
- from_term([{e,[f,g]}])),
- ?line eval(family_difference(from_term([{a,[a,b,c,d]},{c,[b,c]}]),
- from_term([{a,[b,c]},{b,[d]},{d,[e,f]}])),
- from_term([{a,[a,d]},{c,[b,c]}])),
- ?line {'EXIT', {badarg, _}} =
+ E = empty_set(),
+ EF = family([]),
+ F9 = from_term([{b,[b,c]}]),
+ F10 = from_term([{a,[b,c]}]),
+ eval(family_difference(E, E), E),
+ eval(family_difference(E, F10), from_term([], type(F10))),
+ eval(family_difference(F10, E), F10),
+ eval(family_difference(F9, F10), F9),
+ eval(family_difference(F10, F10), family([{a,[]}])),
+ F20 = from_term([{a,[1,2,3]},{b,[1,2,3]},{c,[1,2,3]}]),
+ F21 = from_term([{b,[1,2,3]},{c,[1,2,3]}]),
+ eval(family_difference(F20, from_term([{a,[2]}])),
+ from_term([{a,[1,3]},{b,[1,2,3]},{c,[1,2,3]}])),
+ eval(family_difference(F20, from_term([{0,[2]},{q,[1,2]}])), F20),
+ eval(family_difference(F20, F21),
+ from_term([{a,[1,2,3]},{b,[]},{c,[]}])),
+
+ eval(family_difference(from_term([{e,[f,g]}]), family([])),
+ from_term([{e,[f,g]}])),
+ eval(family_difference(from_term([{e,[f,g]}]), EF),
+ from_term([{e,[f,g]}])),
+ eval(family_difference(from_term([{a,[a,b,c,d]},{c,[b,c]}]),
+ from_term([{a,[b,c]},{b,[d]},{d,[e,f]}])),
+ from_term([{a,[a,d]},{c,[b,c]}])),
+ {'EXIT', {badarg, _}} =
(catch family_difference(set([]), set([]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch family_difference(from_term([{a,[b,c]}]),
from_term([{e,[{f}]}]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch family_difference(from_term([{a,[b]}]),
from_term([{c,[d]}], [{i,[s]}]))),
ok.
-family_intersection_1(suite) -> [];
-family_intersection_1(doc) -> [""];
family_intersection_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line EF = family([]),
- ?line ES = from_term([], [{atom,[[atom]]}]),
- ?line eval(family_intersection(E), E),
- ?line {'EXIT', {badarg, _}} = (catch family_intersection(EF)),
- ?line eval(family_intersection(ES), EF),
- ?line {'EXIT', {badarg, _}} = (catch family_intersection(set([]))),
- ?line {'EXIT', {badarg, _}} =
+ E = empty_set(),
+ EF = family([]),
+ ES = from_term([], [{atom,[[atom]]}]),
+ eval(family_intersection(E), E),
+ {'EXIT', {badarg, _}} = (catch family_intersection(EF)),
+ eval(family_intersection(ES), EF),
+ {'EXIT', {badarg, _}} = (catch family_intersection(set([]))),
+ {'EXIT', {badarg, _}} =
(catch family_intersection(from_term([{a,[1,2]}]))),
- ?line F1 = from_term([{a,[[1],[2],[2,3]]},{b,[]},{c,[[4]]}]),
- ?line {'EXIT', {badarg, _}} = (catch family_intersection(F1)),
- ?line F2 = from_term([{b,[[1],[2],[2,3]]},{a,[]},{c,[[4]]}]),
- ?line {'EXIT', {badarg, _}} = (catch family_intersection(F2)),
- ?line F3 = from_term([{a,[[1,2,3],[2],[2,3]]},{c,[[4,5,6],[5,6,7]]}]),
- ?line eval(family_intersection(F3), family([{a,[2]},{c,[5,6]}])),
+ F1 = from_term([{a,[[1],[2],[2,3]]},{b,[]},{c,[[4]]}]),
+ {'EXIT', {badarg, _}} = (catch family_intersection(F1)),
+ F2 = from_term([{b,[[1],[2],[2,3]]},{a,[]},{c,[[4]]}]),
+ {'EXIT', {badarg, _}} = (catch family_intersection(F2)),
+ F3 = from_term([{a,[[1,2,3],[2],[2,3]]},{c,[[4,5,6],[5,6,7]]}]),
+ eval(family_intersection(F3), family([{a,[2]},{c,[5,6]}])),
ok.
-family_intersection_2(suite) -> [];
-family_intersection_2(doc) -> [""];
family_intersection_2(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line EF = family([]),
- ?line F1 = from_term([{a,[1,2]},{b,[4,5]},{c,[7,8]},{d,[10,11]}]),
- ?line F2 = from_term([{c,[6,7]},{d,[9,10,11]},{q,[1]}]),
- ?line F3 = from_term([{a,[1,2]},{b,[4,5]},{c,[6,7,8]},{d,[9,10,11]},
- {q,[1]}]),
-
- ?line eval(family_intersection(E, E), E),
- ?line eval(family_intersection(EF, EF), EF),
- ?line eval(family_intersection(F1, F2),
- from_term([{c,[7]},{d,[10,11]}])),
- ?line eval(family_intersection(F1, F3), F1),
- ?line eval(family_intersection(F2, F3), F2),
-
- ?line eval(family_intersection(EF, from_term([{e,[f,g]}])), EF),
- ?line eval(family_intersection(E, from_term([{e,[f,g]}])), EF),
- ?line eval(family_intersection(from_term([{e,[f,g]}]), EF), EF),
- ?line eval(family_intersection(from_term([{e,[f,g]}]), E), EF),
- ?line {'EXIT', {type_mismatch, _}} =
+ E = empty_set(),
+ EF = family([]),
+ F1 = from_term([{a,[1,2]},{b,[4,5]},{c,[7,8]},{d,[10,11]}]),
+ F2 = from_term([{c,[6,7]},{d,[9,10,11]},{q,[1]}]),
+ F3 = from_term([{a,[1,2]},{b,[4,5]},{c,[6,7,8]},{d,[9,10,11]},
+ {q,[1]}]),
+
+ eval(family_intersection(E, E), E),
+ eval(family_intersection(EF, EF), EF),
+ eval(family_intersection(F1, F2),
+ from_term([{c,[7]},{d,[10,11]}])),
+ eval(family_intersection(F1, F3), F1),
+ eval(family_intersection(F2, F3), F2),
+
+ eval(family_intersection(EF, from_term([{e,[f,g]}])), EF),
+ eval(family_intersection(E, from_term([{e,[f,g]}])), EF),
+ eval(family_intersection(from_term([{e,[f,g]}]), EF), EF),
+ eval(family_intersection(from_term([{e,[f,g]}]), E), EF),
+ {'EXIT', {type_mismatch, _}} =
(catch family_intersection(from_term([{a,[b,c]}]),
from_term([{e,[{f}]}]))),
- ?line F11 = family([{a,[1,2,3]},{b,[0,2,4]},{c,[0,3,6,9]}]),
- ?line eval(union_of_family(F11), set([0,1,2,3,4,6,9])),
- ?line F12 = from_term([{a,[1,2,3,4]},{b,[0,2,4]},{c,[2,3,4,5]}]),
- ?line eval(intersection_of_family(F12), set([2,4])),
+ F11 = family([{a,[1,2,3]},{b,[0,2,4]},{c,[0,3,6,9]}]),
+ eval(union_of_family(F11), set([0,1,2,3,4,6,9])),
+ F12 = from_term([{a,[1,2,3,4]},{b,[0,2,4]},{c,[2,3,4,5]}]),
+ eval(intersection_of_family(F12), set([2,4])),
ok.
-family_union_1(suite) -> [];
-family_union_1(doc) -> [""];
family_union_1(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line EF = family([]),
- ?line ES = from_term([], [{atom,[[atom]]}]),
- ?line eval(family_union(E), E),
- ?line eval(family_union(ES), EF),
- ?line {'EXIT', {badarg, _}} = (catch family_union(set([]))),
- ?line {'EXIT', {badarg, _}} =
+ E = empty_set(),
+ EF = family([]),
+ ES = from_term([], [{atom,[[atom]]}]),
+ eval(family_union(E), E),
+ eval(family_union(ES), EF),
+ {'EXIT', {badarg, _}} = (catch family_union(set([]))),
+ {'EXIT', {badarg, _}} =
(catch family_union(from_term([{a,[1,2]}]))),
- ?line eval(family_union(from_term([{a,[[1],[2],[2,3]]},{b,[]},{c,[[4]]}])),
- family([{a,[1,2,3]},{b,[]},{c,[4]}])),
+ eval(family_union(from_term([{a,[[1],[2],[2,3]]},{b,[]},{c,[[4]]}])),
+ family([{a,[1,2,3]},{b,[]},{c,[4]}])),
ok.
-family_union_2(suite) -> [];
-family_union_2(doc) -> [""];
family_union_2(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
- ?line EF = family([]),
- ?line F1 = from_term([{a,[1,2]},{b,[4,5]},{c,[7,8]},{d,[10,11]}]),
- ?line F2 = from_term([{c,[6,7]},{d,[9,10,11]},{q,[1]}]),
- ?line F3 = from_term([{a,[1,2]},{b,[4,5]},{c,[6,7,8]},{d,[9,10,11]},
- {q,[1]}]),
-
- ?line eval(family_union(E, E), E),
- ?line eval(family_union(F1, E), F1),
- ?line eval(family_union(E, F2), F2),
- ?line eval(family_union(F1, F2), F3),
- ?line eval(family_union(F2, F1), F3),
-
- ?line eval(family_union(E, from_term([{e,[f,g]}])),
- from_term([{e,[f,g]}])),
- ?line eval(family_union(EF, from_term([{e,[f,g]}])),
- from_term([{e,[f,g]}])),
- ?line eval(family_union(from_term([{e,[f,g]}]), E),
- from_term([{e,[f,g]}])),
- ?line {'EXIT', {badarg, _}} =
+ E = empty_set(),
+ EF = family([]),
+ F1 = from_term([{a,[1,2]},{b,[4,5]},{c,[7,8]},{d,[10,11]}]),
+ F2 = from_term([{c,[6,7]},{d,[9,10,11]},{q,[1]}]),
+ F3 = from_term([{a,[1,2]},{b,[4,5]},{c,[6,7,8]},{d,[9,10,11]},
+ {q,[1]}]),
+
+ eval(family_union(E, E), E),
+ eval(family_union(F1, E), F1),
+ eval(family_union(E, F2), F2),
+ eval(family_union(F1, F2), F3),
+ eval(family_union(F2, F1), F3),
+
+ eval(family_union(E, from_term([{e,[f,g]}])),
+ from_term([{e,[f,g]}])),
+ eval(family_union(EF, from_term([{e,[f,g]}])),
+ from_term([{e,[f,g]}])),
+ eval(family_union(from_term([{e,[f,g]}]), E),
+ from_term([{e,[f,g]}])),
+ {'EXIT', {badarg, _}} =
(catch family_union(set([]),set([]))),
- ?line {'EXIT', {type_mismatch, _}} =
+ {'EXIT', {type_mismatch, _}} =
(catch family_union(from_term([{a,[b,c]}]),
from_term([{e,[{f}]}]))),
ok.
-partition_family(suite) -> [];
-partition_family(doc) -> [""];
partition_family(Conf) when is_list(Conf) ->
- ?line E = empty_set(),
+ E = empty_set(),
%% set of ordered sets
- ?line ER = relation([]),
- ?line EF = from_term([], [{atom,[{atom,atom}]}]),
-
- ?line eval(partition_family(1, E), E),
- ?line eval(partition_family(2, E), E),
- ?line eval(partition_family(fun sofs:union/1, E), E),
- ?line eval(partition_family(1, ER), EF),
- ?line eval(partition_family(2, ER), EF),
- ?line {'EXIT', {badarg, _}} = (catch partition_family(1, set([]))),
- ?line {'EXIT', {badarg, _}} = (catch partition_family(2, set([]))),
- ?line {'EXIT', {function_clause, _}} =
+ ER = relation([]),
+ EF = from_term([], [{atom,[{atom,atom}]}]),
+
+ eval(partition_family(1, E), E),
+ eval(partition_family(2, E), E),
+ eval(partition_family(fun sofs:union/1, E), E),
+ eval(partition_family(1, ER), EF),
+ eval(partition_family(2, ER), EF),
+ {'EXIT', {badarg, _}} = (catch partition_family(1, set([]))),
+ {'EXIT', {badarg, _}} = (catch partition_family(2, set([]))),
+ {'EXIT', {function_clause, _}} =
(catch partition_family(fun({_A,B}) -> {B} end, from_term([{1}]))),
- ?line eval(partition_family(1, relation([{1,a},{1,b},{2,c},{2,d}])),
- from_term([{1,[{1,a},{1,b}]},{2,[{2,c},{2,d}]}])),
- ?line eval(partition_family(1, relation([{1,a},{2,b}])),
- from_term([{1,[{1,a}]},{2,[{2,b}]}])),
- ?line eval(partition_family(2, relation([{1,a},{1,b},{2,a},{2,b},{3,c}])),
- from_term([{a,[{1,a},{2,a}]},{b,[{1,b},{2,b}]},{c,[{3,c}]}])),
- ?line eval(partition_family(2, relation([{1,a}])),
- from_term([{a,[{1,a}]}])),
- ?line eval(partition_family(2, relation([{1,a},{2,a},{3,a}])),
- from_term([{a,[{1,a},{2,a},{3,a}]}])),
- ?line eval(partition_family(2, relation([{1,a},{2,b}])),
- from_term([{a,[{1,a}]},{b,[{2,b}]}])),
- ?line F13 = from_term([{a,b,c},{a,b,d},{b,b,c},{a,c,c},{a,c,d},{b,c,c}]),
- ?line eval(partition_family(2, F13),
- from_term([{b,[{a,b,c},{a,b,d},{b,b,c}]},
- {c,[{a,c,c},{a,c,d},{b,c,c}]}])),
+ eval(partition_family(1, relation([{1,a},{1,b},{2,c},{2,d}])),
+ from_term([{1,[{1,a},{1,b}]},{2,[{2,c},{2,d}]}])),
+ eval(partition_family(1, relation([{1,a},{2,b}])),
+ from_term([{1,[{1,a}]},{2,[{2,b}]}])),
+ eval(partition_family(2, relation([{1,a},{1,b},{2,a},{2,b},{3,c}])),
+ from_term([{a,[{1,a},{2,a}]},{b,[{1,b},{2,b}]},{c,[{3,c}]}])),
+ eval(partition_family(2, relation([{1,a}])),
+ from_term([{a,[{1,a}]}])),
+ eval(partition_family(2, relation([{1,a},{2,a},{3,a}])),
+ from_term([{a,[{1,a},{2,a},{3,a}]}])),
+ eval(partition_family(2, relation([{1,a},{2,b}])),
+ from_term([{a,[{1,a}]},{b,[{2,b}]}])),
+ F13 = from_term([{a,b,c},{a,b,d},{b,b,c},{a,c,c},{a,c,d},{b,c,c}]),
+ eval(partition_family(2, F13),
+ from_term([{b,[{a,b,c},{a,b,d},{b,b,c}]},
+ {c,[{a,c,c},{a,c,d},{b,c,c}]}])),
Fun1 = {external, fun({A,_B}) -> {A} end},
- ?line eval(partition_family(Fun1, relation([{a,1},{a,2},{b,3}])),
- from_term([{{a},[{a,1},{a,2}]},{{b},[{b,3}]}])),
+ eval(partition_family(Fun1, relation([{a,1},{a,2},{b,3}])),
+ from_term([{{a},[{a,1},{a,2}]},{{b},[{b,3}]}])),
Fun2 = fun(S) -> {A,_B} = to_external(S), from_term({A}) end,
- ?line eval(partition_family(Fun2, relation([{a,1},{a,2},{b,3}])),
- from_term([{{a},[{a,1},{a,2}]},{{b},[{b,3}]}])),
+ eval(partition_family(Fun2, relation([{a,1},{a,2},{b,3}])),
+ from_term([{{a},[{a,1},{a,2}]},{{b},[{b,3}]}])),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch partition_family({external, fun({A,_}) -> {A,0} end},
from_term([{1,a}]))),
- ?line [{{atom,atom},[{atom,atom,atom,atom}]}] =
+ [{{atom,atom},[{atom,atom,atom,atom}]}] =
type(partition_family({external, fun({A,_B,C,_D}) -> {C,A} end},
relation([],4))),
Fun3 = fun(S) -> from_term({to_external(S),0}, {type(S),atom}) end,
- ?line eval(partition_family(Fun3, E), E),
- ?line eval(partition_family(Fun3, set([a,b])),
- from_term([{{a,0},[a]}, {{b,0},[b]}])),
- ?line eval(partition_family(Fun3, relation([{a,1},{b,2}])),
- from_term([{{{a,1},0},[{a,1}]},{{{b,2},0},[{b,2}]}])),
- ?line eval(partition_family(Fun3, from_term([[a],[b]])),
- from_term([{{[a],0},[[a]]}, {{[b],0},[[b]]}])),
- ?line partition_family({external, fun(X) -> X end}, E),
+ eval(partition_family(Fun3, E), E),
+ eval(partition_family(Fun3, set([a,b])),
+ from_term([{{a,0},[a]}, {{b,0},[b]}])),
+ eval(partition_family(Fun3, relation([{a,1},{b,2}])),
+ from_term([{{{a,1},0},[{a,1}]},{{{b,2},0},[{b,2}]}])),
+ eval(partition_family(Fun3, from_term([[a],[b]])),
+ from_term([{{[a],0},[[a]]}, {{[b],0},[[b]]}])),
+ partition_family({external, fun(X) -> X end}, E),
F = 0.0, I = round(F),
- ?line FR = relation([{I,a},{F,b}]),
+ FR = relation([{I,a},{F,b}]),
if
F == I -> % term ordering
- ?line true = (1 =:= no_elements(partition_family(1, FR)));
+ true = (1 =:= no_elements(partition_family(1, FR)));
true ->
- ?line eval(partition_family(1, FR),
- from_term([{I,[{I,a}]},{F,[{F,b}]}]))
+ eval(partition_family(1, FR),
+ from_term([{I,[{I,a}]},{F,[{F,b}]}]))
end,
%% set of sets
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch partition_family({external, fun(X) -> X end},
from_term([], [[atom]]))),
- ?line {'EXIT', {badarg, _}} =
+ {'EXIT', {badarg, _}} =
(catch partition_family({external, fun(X) -> X end},
from_term([[a]]))),
- ?line eval(partition_family(fun sofs:union/1,
- from_term([[[1],[1,2]], [[1,2]]])),
- from_term([{[1,2], [[[1],[1,2]],[[1,2]]]}])),
- ?line eval(partition_family(fun(X) -> X end,
- from_term([[1],[1,2],[1,2,3]])),
- from_term([{[1],[[1]]},{[1,2],[[1,2]]},{[1,2,3],[[1,2,3]]}])),
-
- ?line eval(partition_family(fun(_) -> from_term([a]) end,
- from_term([], [[atom]])),
- E),
+ eval(partition_family(fun sofs:union/1,
+ from_term([[[1],[1,2]], [[1,2]]])),
+ from_term([{[1,2], [[[1],[1,2]],[[1,2]]]}])),
+ eval(partition_family(fun(X) -> X end,
+ from_term([[1],[1,2],[1,2,3]])),
+ from_term([{[1],[[1]]},{[1,2],[[1,2]]},{[1,2,3],[[1,2,3]]}])),
+
+ eval(partition_family(fun(_) -> from_term([a]) end,
+ from_term([], [[atom]])),
+ E),
Fun10 = fun(S) ->
- %% Cheating a lot...
- case to_external(S) of
- [1] -> from_term({1,1});
- _ -> S
- end
- end,
+ %% Cheating a lot...
+ case to_external(S) of
+ [1] -> from_term({1,1});
+ _ -> S
+ end
+ end,
- ?line eval(partition_family(Fun10, from_term([[1]])),
- from_term([{{1,1},[[1]]}])),
- ?line eval(partition_family(fun(_) -> from_term({a}) end,
- from_term([[a]])),
- from_term([{{a},[[a]]}])),
- ?line {'EXIT', {badarg, _}} =
- (catch partition_family(fun(_) -> {a} end, from_term([[a]]))),
+ eval(partition_family(Fun10, from_term([[1]])),
+ from_term([{{1,1},[[1]]}])),
+ eval(partition_family(fun(_) -> from_term({a}) end,
+ from_term([[a]])),
+ from_term([{{a},[[a]]}])),
+ {'EXIT', {badarg, _}} =
+ (catch partition_family(fun(_) -> {a} end, from_term([[a]]))),
ok.
%% Not meant to be efficient...
diff --git a/lib/stdlib/test/stdlib_SUITE.erl b/lib/stdlib/test/stdlib_SUITE.erl
index 687e2fb6e8..f7064c4169 100644
--- a/lib/stdlib/test/stdlib_SUITE.erl
+++ b/lib/stdlib/test/stdlib_SUITE.erl
@@ -31,10 +31,7 @@
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [app_test, appup_test, assert_test, {group,upgrade}].
-
-groups() ->
- [{upgrade,[minor_upgrade,major_upgrade]}].
+ [app_test, appup_test, assert_test].
init_per_suite(Config) ->
Config.
@@ -42,13 +39,9 @@ init_per_suite(Config) ->
end_per_suite(_Config) ->
ok.
-init_per_group(upgrade, Config) ->
- ct_release_test:init(Config);
init_per_group(_GroupName, Config) ->
Config.
-end_per_group(upgrade, Config) ->
- ct_release_test:cleanup(Config);
end_per_group(_GroupName, Config) ->
Config.
@@ -58,15 +51,12 @@ init_per_testcase(_Case, Config) ->
end_per_testcase(_Case, _Config) ->
ok.
-%
-% Test cases starts here.
-%
-app_test(suite) ->
- [];
-app_test(doc) ->
- ["Application consistency test."];
+%%
+%% Test cases starts here.
+%%
+%% Application consistency test.
app_test(Config) when is_list(Config) ->
- ?t:app_test(stdlib),
+ test_server:app_test(stdlib),
ok.
%% Test that appup allows upgrade from/downgrade to a maximum of one
@@ -165,35 +155,10 @@ check_appup([],_,_) ->
ok.
-minor_upgrade(Config) ->
- ct_release_test:upgrade(stdlib,minor,{?MODULE,[]},Config).
-
-major_upgrade(Config) ->
- ct_release_test:upgrade(stdlib,major,{?MODULE,[]},Config).
-
-%% Version numbers are checked by ct_release_test, so there is nothing
-%% more to check here...
-upgrade_init(CtData,State) ->
- {ok,{FromVsn,ToVsn}} = ct_release_test:get_app_vsns(CtData,stdlib),
- case ct_release_test:get_appup(CtData,stdlib) of
- {ok,{FromVsn,ToVsn,[restart_new_emulator],[restart_new_emulator]}} ->
- io:format("Upgrade/downgrade ~p <--> ~p",[FromVsn,ToVsn]);
- {error,{vsn_not_found,_}} when FromVsn==ToVsn ->
- io:format("No upgrade test for stdlib, same version")
- end,
- State.
-upgrade_upgraded(_CtData,State) ->
- State.
-upgrade_downgraded(_CtData,State) ->
- State.
-
-
-include_lib("stdlib/include/assert.hrl").
-include_lib("stdlib/include/assert.hrl"). % test repeated inclusion
-assert_test(suite) ->
- [];
-assert_test(doc) ->
- ["Assert macros test."];
+
+%% Assert macros test.
assert_test(_Config) ->
ok = ?assert(true),
{'EXIT',{{assert, _},_}} = (catch ?assert(false)),
diff --git a/lib/stdlib/test/string_SUITE.erl b/lib/stdlib/test/string_SUITE.erl
index 6ac3950f44..b5d221732e 100644
--- a/lib/stdlib/test/string_SUITE.erl
+++ b/lib/stdlib/test/string_SUITE.erl
@@ -23,26 +23,22 @@
-module(string_SUITE).
-include_lib("common_test/include/ct.hrl").
-
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
-% Test server specific exports
+%% Test server specific exports
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2]).
-export([init_per_testcase/2, end_per_testcase/2]).
-% Test cases must be exported.
+%% Test cases must be exported.
-export([len/1,equal/1,concat/1,chr_rchr/1,str_rstr/1]).
-export([span_cspan/1,substr/1,tokens/1,chars/1]).
-export([copies/1,words/1,strip/1,sub_word/1,left_right/1]).
-export([sub_string/1,centre/1, join/1]).
-export([to_integer/1,to_float/1]).
-export([to_upper_to_lower/1]).
-%%
-%% all/1
-%%
-suite() -> [{ct_hooks,[ts_install_cth]}].
+
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[len, equal, concat, chr_rchr, str_rstr, span_cspan,
@@ -67,155 +63,125 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- ?line Dog=test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
-%
-% Test cases starts here.
-%
+%%
+%% Test cases starts here.
+%%
-len(suite) ->
- [];
-len(doc) ->
- [];
len(Config) when is_list(Config) ->
- ?line 0 = string:len(""),
- ?line L = tuple_size(list_to_tuple(atom_to_list(?MODULE))),
- ?line L = string:len(atom_to_list(?MODULE)),
+ 0 = string:len(""),
+ L = tuple_size(list_to_tuple(atom_to_list(?MODULE))),
+ L = string:len(atom_to_list(?MODULE)),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:len({})),
+ {'EXIT',_} = (catch string:len({})),
ok.
-equal(suite) ->
- [];
-equal(doc) ->
- [];
equal(Config) when is_list(Config) ->
- ?line true = string:equal("", ""),
- ?line false = string:equal("", " "),
- ?line true = string:equal("laban", "laban"),
- ?line false = string:equal("skvimp", "skvump"),
+ true = string:equal("", ""),
+ false = string:equal("", " "),
+ true = string:equal("laban", "laban"),
+ false = string:equal("skvimp", "skvump"),
%% invalid arg type
- ?line true = string:equal(2, 2), % not good, should crash
+ true = string:equal(2, 2), % not good, should crash
ok.
-concat(suite) ->
- [];
-concat(doc) ->
- [];
concat(Config) when is_list(Config) ->
- ?line "erlang rules" = string:concat("erlang ", "rules"),
- ?line "" = string:concat("", ""),
- ?line "x" = string:concat("x", ""),
- ?line "y" = string:concat("", "y"),
+ "erlang rules" = string:concat("erlang ", "rules"),
+ "" = string:concat("", ""),
+ "x" = string:concat("x", ""),
+ "y" = string:concat("", "y"),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:concat(hello, please)),
+ {'EXIT',_} = (catch string:concat(hello, please)),
ok.
-chr_rchr(suite) ->
- [];
-chr_rchr(doc) ->
- [];
chr_rchr(Config) when is_list(Config) ->
{_,_,X} = erlang:timestamp(),
- ?line 0 = string:chr("", (X rem (255-32)) + 32),
- ?line 0 = string:rchr("", (X rem (255-32)) + 32),
- ?line 1 = string:chr("x", $x),
- ?line 1 = string:rchr("x", $x),
- ?line 1 = string:chr("xx", $x),
- ?line 2 = string:rchr("xx", $x),
- ?line 3 = string:chr("xyzyx", $z),
- ?line 3 = string:rchr("xyzyx", $z),
+ 0 = string:chr("", (X rem (255-32)) + 32),
+ 0 = string:rchr("", (X rem (255-32)) + 32),
+ 1 = string:chr("x", $x),
+ 1 = string:rchr("x", $x),
+ 1 = string:chr("xx", $x),
+ 2 = string:rchr("xx", $x),
+ 3 = string:chr("xyzyx", $z),
+ 3 = string:rchr("xyzyx", $z),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:chr(hello, $h)),
+ {'EXIT',_} = (catch string:chr(hello, $h)),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:chr("hello", h)),
+ {'EXIT',_} = (catch string:chr("hello", h)),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:rchr(hello, $h)),
+ {'EXIT',_} = (catch string:rchr(hello, $h)),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:rchr("hello", h)),
+ {'EXIT',_} = (catch string:rchr("hello", h)),
ok.
-str_rstr(suite) ->
- [];
-str_rstr(doc) ->
- [];
str_rstr(Config) when is_list(Config) ->
{_,_,X} = erlang:timestamp(),
- ?line 0 = string:str("", [(X rem (255-32)) + 32]),
- ?line 0 = string:rstr("", [(X rem (255-32)) + 32]),
- ?line 1 = string:str("x", "x"),
- ?line 1 = string:rstr("x", "x"),
- ?line 0 = string:str("hello", ""),
- ?line 0 = string:rstr("hello", ""),
- ?line 1 = string:str("xxxx", "xx"),
- ?line 3 = string:rstr("xxxx", "xx"),
- ?line 3 = string:str("xy z yx", " z"),
- ?line 3 = string:rstr("xy z yx", " z"),
+ 0 = string:str("", [(X rem (255-32)) + 32]),
+ 0 = string:rstr("", [(X rem (255-32)) + 32]),
+ 1 = string:str("x", "x"),
+ 1 = string:rstr("x", "x"),
+ 0 = string:str("hello", ""),
+ 0 = string:rstr("hello", ""),
+ 1 = string:str("xxxx", "xx"),
+ 3 = string:rstr("xxxx", "xx"),
+ 3 = string:str("xy z yx", " z"),
+ 3 = string:rstr("xy z yx", " z"),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:str(hello, "he")),
+ {'EXIT',_} = (catch string:str(hello, "he")),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:str("hello", he)),
+ {'EXIT',_} = (catch string:str("hello", he)),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:rstr(hello, "he")),
+ {'EXIT',_} = (catch string:rstr(hello, "he")),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:rstr("hello", he)),
+ {'EXIT',_} = (catch string:rstr("hello", he)),
ok.
-span_cspan(suite) ->
- [];
-span_cspan(doc) ->
- [];
span_cspan(Config) when is_list(Config) ->
- ?line 0 = string:span("", "1"),
- ?line 0 = string:span("1", ""),
- ?line 0 = string:cspan("", "1"),
- ?line 1 = string:cspan("1", ""),
- ?line 1 = string:span("1 ", "1"),
- ?line 5 = string:span(" 1 ", "12 "),
- ?line 6 = string:span("1231234", "123"),
- ?line 0 = string:cspan("1 ", "1"),
- ?line 1 = string:cspan("3 ", "12 "),
- ?line 6 = string:cspan("1231234", "4"),
+ 0 = string:span("", "1"),
+ 0 = string:span("1", ""),
+ 0 = string:cspan("", "1"),
+ 1 = string:cspan("1", ""),
+ 1 = string:span("1 ", "1"),
+ 5 = string:span(" 1 ", "12 "),
+ 6 = string:span("1231234", "123"),
+ 0 = string:cspan("1 ", "1"),
+ 1 = string:cspan("3 ", "12 "),
+ 6 = string:cspan("1231234", "4"),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:span(1234, "1")),
+ {'EXIT',_} = (catch string:span(1234, "1")),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:span(1234, "1")),
+ {'EXIT',_} = (catch string:span(1234, "1")),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:cspan("1234", 1)),
+ {'EXIT',_} = (catch string:cspan("1234", 1)),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:cspan("1234", 4)),
+ {'EXIT',_} = (catch string:cspan("1234", 4)),
ok.
-substr(suite) ->
- [];
-substr(doc) ->
- [];
substr(Config) when is_list(Config) ->
- ?line {'EXIT',_} = (catch string:substr("", 0)),
- ?line [] = string:substr("", 1),
- ?line {'EXIT',_} = (catch string:substr("", 2)),
- ?line [] = string:substr("1", 2),
- ?line {'EXIT',_} = (catch string:substr("", 0, 1)),
- ?line [] = string:substr("", 1, 1),
- ?line [] = string:substr("", 1, 2),
- ?line {'EXIT',_} = (catch string:substr("", 2, 2)),
- ?line "1234" = string:substr("1234", 1),
- ?line "1234" = string:substr("1234", 1, 4),
- ?line "1234" = string:substr("1234", 1, 5),
- ?line "23" = string:substr("1234", 2, 2),
- ?line "4" = string:substr("1234", 4),
- ?line "" = string:substr("1234", 4, 0),
- ?line "4" = string:substr("1234", 4, 1),
- %% invalid arg type
- ?line {'EXIT',_} = (catch string:substr(1234, 1)),
- %% invalid arg type
- ?line {'EXIT',_} = (catch string:substr("1234", "1")),
+ {'EXIT',_} = (catch string:substr("", 0)),
+ [] = string:substr("", 1),
+ {'EXIT',_} = (catch string:substr("", 2)),
+ [] = string:substr("1", 2),
+ {'EXIT',_} = (catch string:substr("", 0, 1)),
+ [] = string:substr("", 1, 1),
+ [] = string:substr("", 1, 2),
+ {'EXIT',_} = (catch string:substr("", 2, 2)),
+ "1234" = string:substr("1234", 1),
+ "1234" = string:substr("1234", 1, 4),
+ "1234" = string:substr("1234", 1, 5),
+ "23" = string:substr("1234", 2, 2),
+ "4" = string:substr("1234", 4),
+ "" = string:substr("1234", 4, 0),
+ "4" = string:substr("1234", 4, 1),
+ %% invalid arg type
+ {'EXIT',_} = (catch string:substr(1234, 1)),
+ %% invalid arg type
+ {'EXIT',_} = (catch string:substr("1234", "1")),
ok.
tokens(Config) when is_list(Config) ->
@@ -252,261 +218,217 @@ replace_sep(C, Seps, New) ->
false -> C
end.
-chars(suite) ->
- [];
-chars(doc) ->
- [];
chars(Config) when is_list(Config) ->
- ?line [] = string:chars($., 0),
- ?line [] = string:chars($., 0, []),
- ?line 10 = length(string:chars(32, 10, [])),
- ?line "aaargh" = string:chars($a, 3, "rgh"),
+ [] = string:chars($., 0),
+ [] = string:chars($., 0, []),
+ 10 = length(string:chars(32, 10, [])),
+ "aaargh" = string:chars($a, 3, "rgh"),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:chars($x, [])),
+ {'EXIT',_} = (catch string:chars($x, [])),
ok.
-copies(suite) ->
- [];
-copies(doc) ->
- [];
copies(Config) when is_list(Config) ->
- ?line "" = string:copies("", 10),
- ?line "" = string:copies(".", 0),
- ?line "." = string:copies(".", 1),
- ?line 30 = length(string:copies("123", 10)),
+ "" = string:copies("", 10),
+ "" = string:copies(".", 0),
+ "." = string:copies(".", 1),
+ 30 = length(string:copies("123", 10)),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:copies("hej", -1)),
- ?line {'EXIT',_} = (catch string:copies("hej", 2.0)),
+ {'EXIT',_} = (catch string:copies("hej", -1)),
+ {'EXIT',_} = (catch string:copies("hej", 2.0)),
ok.
-words(suite) ->
- [];
-words(doc) ->
- [];
words(Config) when is_list(Config) ->
- ?line 1 = string:words(""),
- ?line 1 = string:words("", $,),
- ?line 1 = string:words("hello"),
- ?line 1 = string:words("hello", $,),
- ?line 1 = string:words("...", $.),
- ?line 2 = string:words("2.35", $.),
- ?line 100 = string:words(string:copies(". ", 100)),
+ 1 = string:words(""),
+ 1 = string:words("", $,),
+ 1 = string:words("hello"),
+ 1 = string:words("hello", $,),
+ 1 = string:words("...", $.),
+ 2 = string:words("2.35", $.),
+ 100 = string:words(string:copies(". ", 100)),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:chars(hej, 1)),
+ {'EXIT',_} = (catch string:chars(hej, 1)),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:chars("hej", 1, " ")),
+ {'EXIT',_} = (catch string:chars("hej", 1, " ")),
ok.
-strip(suite) ->
- [];
-strip(doc) ->
- [];
strip(Config) when is_list(Config) ->
- ?line "" = string:strip(""),
- ?line "" = string:strip("", both),
- ?line "" = string:strip("", both, $.),
- ?line "hej" = string:strip(" hej "),
- ?line "hej " = string:strip(" hej ", left),
- ?line " hej" = string:strip(" hej ", right),
- ?line " hej " = string:strip(" hej ", right, $.),
- ?line "hej hopp" = string:strip(" hej hopp ", both),
+ "" = string:strip(""),
+ "" = string:strip("", both),
+ "" = string:strip("", both, $.),
+ "hej" = string:strip(" hej "),
+ "hej " = string:strip(" hej ", left),
+ " hej" = string:strip(" hej ", right),
+ " hej " = string:strip(" hej ", right, $.),
+ "hej hopp" = string:strip(" hej hopp ", both),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:strip(hej)),
+ {'EXIT',_} = (catch string:strip(hej)),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:strip(" hej", up)),
+ {'EXIT',_} = (catch string:strip(" hej", up)),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:strip(" hej", left, " ")), % not good
+ {'EXIT',_} = (catch string:strip(" hej", left, " ")), % not good
ok.
-sub_word(suite) ->
- [];
-sub_word(doc) ->
- [];
sub_word(Config) when is_list(Config) ->
- ?line "" = string:sub_word("", 1),
- ?line "" = string:sub_word("", 1, $,),
- ?line {'EXIT',_} = (catch string:sub_word("1 2 3", 0)),
- ?line "" = string:sub_word("1 2 3", 4),
- ?line "llo th" = string:sub_word("but hello there", 2, $e),
+ "" = string:sub_word("", 1),
+ "" = string:sub_word("", 1, $,),
+ {'EXIT',_} = (catch string:sub_word("1 2 3", 0)),
+ "" = string:sub_word("1 2 3", 4),
+ "llo th" = string:sub_word("but hello there", 2, $e),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:sub_word('hello there', 1)),
+ {'EXIT',_} = (catch string:sub_word('hello there', 1)),
%% invalid arg type
- ?line {'EXIT',_} = (catch string:sub_word("hello there", 1, "e")),
+ {'EXIT',_} = (catch string:sub_word("hello there", 1, "e")),
ok.
-left_right(suite) ->
- [];
-left_right(doc) ->
- [];
left_right(Config) when is_list(Config) ->
- ?line "" = string:left("", 0),
- ?line "" = string:left("hej", 0),
- ?line "" = string:left("hej", 0, $.),
- ?line "" = string:right("", 0),
- ?line "" = string:right("hej", 0),
- ?line "" = string:right("hej", 0, $.),
- ?line "123 " = string:left("123 ", 5),
- ?line " 123" = string:right(" 123", 5),
- ?line "123!!" = string:left("123!", 5, $!),
- ?line "==123" = string:right("=123", 5, $=),
- ?line "1" = string:left("123", 1, $.),
- ?line "3" = string:right("123", 1, $.),
- %% invalid arg type
- ?line {'EXIT',_} = (catch string:left(hello, 5)),
- %% invalid arg type
- ?line {'EXIT',_} = (catch string:right(hello, 5)),
- %% invalid arg type
- ?line {'EXIT',_} = (catch string:left("hello", 5, ".")),
- %% invalid arg type
- ?line {'EXIT',_} = (catch string:right("hello", 5, ".")),
+ "" = string:left("", 0),
+ "" = string:left("hej", 0),
+ "" = string:left("hej", 0, $.),
+ "" = string:right("", 0),
+ "" = string:right("hej", 0),
+ "" = string:right("hej", 0, $.),
+ "123 " = string:left("123 ", 5),
+ " 123" = string:right(" 123", 5),
+ "123!!" = string:left("123!", 5, $!),
+ "==123" = string:right("=123", 5, $=),
+ "1" = string:left("123", 1, $.),
+ "3" = string:right("123", 1, $.),
+ %% invalid arg type
+ {'EXIT',_} = (catch string:left(hello, 5)),
+ %% invalid arg type
+ {'EXIT',_} = (catch string:right(hello, 5)),
+ %% invalid arg type
+ {'EXIT',_} = (catch string:left("hello", 5, ".")),
+ %% invalid arg type
+ {'EXIT',_} = (catch string:right("hello", 5, ".")),
ok.
-sub_string(suite) ->
- [];
-sub_string(doc) ->
- [];
sub_string(Config) when is_list(Config) ->
- ?line {'EXIT',_} = (catch string:sub_string("", 0)),
- ?line [] = string:sub_string("", 1),
- ?line {'EXIT',_} = (catch string:sub_string("", 2)),
- ?line [] = string:sub_string("1", 2),
- ?line {'EXIT',_} = (catch string:sub_string("", 0, 1)),
- ?line [] = string:sub_string("", 1, 1),
- ?line [] = string:sub_string("", 1, 2),
- ?line {'EXIT',_} = (catch string:sub_string("", 2, 2)),
- ?line "1234" = string:sub_string("1234", 1),
- ?line "1234" = string:sub_string("1234", 1, 4),
- ?line "1234" = string:sub_string("1234", 1, 5),
- ?line "23" = string:sub_string("1234", 2, 3),
- ?line "4" = string:sub_string("1234", 4),
- ?line "4" = string:sub_string("1234", 4, 4),
- ?line "4" = string:sub_string("1234", 4, 5),
- %% invalid arg type
- ?line {'EXIT',_} = (catch string:sub_string(1234, 1)),
- %% invalid arg type
- ?line {'EXIT',_} = (catch string:sub_string("1234", "1")),
+ {'EXIT',_} = (catch string:sub_string("", 0)),
+ [] = string:sub_string("", 1),
+ {'EXIT',_} = (catch string:sub_string("", 2)),
+ [] = string:sub_string("1", 2),
+ {'EXIT',_} = (catch string:sub_string("", 0, 1)),
+ [] = string:sub_string("", 1, 1),
+ [] = string:sub_string("", 1, 2),
+ {'EXIT',_} = (catch string:sub_string("", 2, 2)),
+ "1234" = string:sub_string("1234", 1),
+ "1234" = string:sub_string("1234", 1, 4),
+ "1234" = string:sub_string("1234", 1, 5),
+ "23" = string:sub_string("1234", 2, 3),
+ "4" = string:sub_string("1234", 4),
+ "4" = string:sub_string("1234", 4, 4),
+ "4" = string:sub_string("1234", 4, 5),
+ %% invalid arg type
+ {'EXIT',_} = (catch string:sub_string(1234, 1)),
+ %% invalid arg type
+ {'EXIT',_} = (catch string:sub_string("1234", "1")),
ok.
-centre(suite) ->
- [];
-centre(doc) ->
- [];
centre(Config) when is_list(Config) ->
- ?line "" = string:centre("", 0),
- ?line "" = string:centre("1", 0),
- ?line "" = string:centre("", 0, $-),
- ?line "" = string:centre("1", 0, $-),
- ?line "gd" = string:centre("agda", 2),
- ?line "agda " = string:centre("agda", 5),
- ?line " agda " = string:centre("agda", 6),
- ?line "agda." = string:centre("agda", 5, $.),
- ?line "--agda--" = string:centre("agda", 8, $-),
- ?line "agda" = string:centre("agda", 4),
- %% invalid arg type
- ?line {'EXIT',_} = (catch string:centre(hello, 10)),
+ "" = string:centre("", 0),
+ "" = string:centre("1", 0),
+ "" = string:centre("", 0, $-),
+ "" = string:centre("1", 0, $-),
+ "gd" = string:centre("agda", 2),
+ "agda " = string:centre("agda", 5),
+ " agda " = string:centre("agda", 6),
+ "agda." = string:centre("agda", 5, $.),
+ "--agda--" = string:centre("agda", 8, $-),
+ "agda" = string:centre("agda", 4),
+ %% invalid arg type
+ {'EXIT',_} = (catch string:centre(hello, 10)),
ok.
-to_integer(suite) ->
- [];
-to_integer(doc) ->
- [];
to_integer(Config) when is_list(Config) ->
- ?line {1,""} = test_to_integer("1"),
- ?line {1,""} = test_to_integer("+1"),
- ?line {-1,""} = test_to_integer("-1"),
- ?line {1,"="} = test_to_integer("1="),
- ?line {7,"F"} = test_to_integer("7F"),
- ?line {709,""} = test_to_integer("709"),
- ?line {709,"*2"} = test_to_integer("709*2"),
- ?line {0,"xAB"} = test_to_integer("0xAB"),
- ?line {16,"#FF"} = test_to_integer("16#FF"),
- ?line {error,no_integer} = test_to_integer(""),
- ?line {error,no_integer} = test_to_integer("!1"),
- ?line {error,no_integer} = test_to_integer("F1"),
- ?line {error,not_a_list} = test_to_integer('23'),
- ?line {3,[[]]} = test_to_integer([$3,[]]),
- ?line {3,[hello]} = test_to_integer([$3,hello]),
+ {1,""} = test_to_integer("1"),
+ {1,""} = test_to_integer("+1"),
+ {-1,""} = test_to_integer("-1"),
+ {1,"="} = test_to_integer("1="),
+ {7,"F"} = test_to_integer("7F"),
+ {709,""} = test_to_integer("709"),
+ {709,"*2"} = test_to_integer("709*2"),
+ {0,"xAB"} = test_to_integer("0xAB"),
+ {16,"#FF"} = test_to_integer("16#FF"),
+ {error,no_integer} = test_to_integer(""),
+ {error,no_integer} = test_to_integer("!1"),
+ {error,no_integer} = test_to_integer("F1"),
+ {error,not_a_list} = test_to_integer('23'),
+ {3,[[]]} = test_to_integer([$3,[]]),
+ {3,[hello]} = test_to_integer([$3,hello]),
ok.
test_to_integer(Str) ->
io:format("Checking ~p~n", [Str]),
case string:to_integer(Str) of
{error,_Reason} = Bad ->
- ?line {'EXIT',_} = (catch list_to_integer(Str)),
+ {'EXIT',_} = (catch list_to_integer(Str)),
Bad;
{F,_Rest} = Res ->
- ?line _ = integer_to_list(F),
+ _ = integer_to_list(F),
Res
end.
-to_float(suite) ->
- [];
-to_float(doc) ->
- [];
to_float(Config) when is_list(Config) ->
- ?line {1.2,""} = test_to_float("1.2"),
- ?line {1.2,""} = test_to_float("1,2"),
- ?line {120.0,""} = test_to_float("1.2e2"),
- ?line {120.0,""} = test_to_float("+1,2e2"),
- ?line {-120.0,""} = test_to_float("-1.2e2"),
- ?line {-120.0,""} = test_to_float("-1,2e+2"),
- ?line {-1.2e-2,""} = test_to_float("-1.2e-2"),
- ?line {1.2,"="} = test_to_float("1.2="),
- ?line {7.9,"e"} = test_to_float("7.9e"),
- ?line {7.9,"ee"} = test_to_float("7.9ee"),
- ?line {7.9,"e+"} = test_to_float("7.9e+"),
- ?line {7.9,"e-"} = test_to_float("7.9e-"),
- ?line {7.9,"e++"} = test_to_float("7.9e++"),
- ?line {7.9,"e--"} = test_to_float("7.9e--"),
- ?line {7.9,"e+e"} = test_to_float("7.9e+e"),
- ?line {7.9,"e-e"} = test_to_float("7.9e-e"),
- ?line {7.9,"e+."} = test_to_float("7.9e+."),
- ?line {7.9,"e-."} = test_to_float("7.9e-."),
- ?line {7.9,"e+,"} = test_to_float("7.9e+,"),
- ?line {7.9,"e-,"} = test_to_float("7.9e-,"),
- ?line {error,no_float} = test_to_float(""),
- ?line {error,no_float} = test_to_float("e1,0"),
- ?line {error,no_float} = test_to_float("1;0"),
- ?line {error,no_float} = test_to_float("1"),
- ?line {error,no_float} = test_to_float("1e"),
- ?line {error,no_float} = test_to_float("2."),
- ?line {error,not_a_list} = test_to_float('2.3'),
- ?line {2.3,[[]]} = test_to_float([$2,$.,$3,[]]),
- ?line {2.3,[hello]} = test_to_float([$2,$.,$3,hello]),
+ {1.2,""} = test_to_float("1.2"),
+ {1.2,""} = test_to_float("1,2"),
+ {120.0,""} = test_to_float("1.2e2"),
+ {120.0,""} = test_to_float("+1,2e2"),
+ {-120.0,""} = test_to_float("-1.2e2"),
+ {-120.0,""} = test_to_float("-1,2e+2"),
+ {-1.2e-2,""} = test_to_float("-1.2e-2"),
+ {1.2,"="} = test_to_float("1.2="),
+ {7.9,"e"} = test_to_float("7.9e"),
+ {7.9,"ee"} = test_to_float("7.9ee"),
+ {7.9,"e+"} = test_to_float("7.9e+"),
+ {7.9,"e-"} = test_to_float("7.9e-"),
+ {7.9,"e++"} = test_to_float("7.9e++"),
+ {7.9,"e--"} = test_to_float("7.9e--"),
+ {7.9,"e+e"} = test_to_float("7.9e+e"),
+ {7.9,"e-e"} = test_to_float("7.9e-e"),
+ {7.9,"e+."} = test_to_float("7.9e+."),
+ {7.9,"e-."} = test_to_float("7.9e-."),
+ {7.9,"e+,"} = test_to_float("7.9e+,"),
+ {7.9,"e-,"} = test_to_float("7.9e-,"),
+ {error,no_float} = test_to_float(""),
+ {error,no_float} = test_to_float("e1,0"),
+ {error,no_float} = test_to_float("1;0"),
+ {error,no_float} = test_to_float("1"),
+ {error,no_float} = test_to_float("1e"),
+ {error,no_float} = test_to_float("2."),
+ {error,not_a_list} = test_to_float('2.3'),
+ {2.3,[[]]} = test_to_float([$2,$.,$3,[]]),
+ {2.3,[hello]} = test_to_float([$2,$.,$3,hello]),
ok.
test_to_float(Str) ->
io:format("Checking ~p~n", [Str]),
case string:to_float(Str) of
{error,_Reason} = Bad ->
- ?line {'EXIT',_} = (catch list_to_float(Str)),
+ {'EXIT',_} = (catch list_to_float(Str)),
Bad;
{F,_Rest} = Res ->
- ?line _ = float_to_list(F),
+ _ = float_to_list(F),
Res
end.
-
-to_upper_to_lower(suite) ->
- [];
-to_upper_to_lower(doc) ->
- [];
+
to_upper_to_lower(Config) when is_list(Config) ->
- ?line "1234ABCDEFÅÄÖ=" = string:to_upper("1234abcdefåäö="),
- ?line "éèíúùòóåäöabc()" = string:to_lower("ÉÈÍÚÙÒÓÅÄÖabc()"),
- ?line All = lists:seq(0, 255),
+ "1234ABCDEFÅÄÖ=" = string:to_upper("1234abcdefåäö="),
+ "éèíúùòóåäöabc()" = string:to_lower("ÉÈÍÚÙÒÓÅÄÖabc()"),
+ All = lists:seq(0, 255),
- ?line UC = string:to_upper(All),
- ?line 256 = length(UC),
- ?line all_upper_latin1(UC, 0),
+ UC = string:to_upper(All),
+ 256 = length(UC),
+ all_upper_latin1(UC, 0),
- ?line LC = string:to_lower(All),
- ?line all_lower_latin1(LC, 0),
+ LC = string:to_lower(All),
+ all_lower_latin1(LC, 0),
- ?line LC = string:to_lower(string:to_upper(LC)),
- ?line LC = string:to_lower(string:to_upper(UC)),
- ?line UC = string:to_upper(string:to_lower(LC)),
- ?line UC = string:to_upper(string:to_lower(UC)),
+ LC = string:to_lower(string:to_upper(LC)),
+ LC = string:to_lower(string:to_upper(UC)),
+ UC = string:to_upper(string:to_lower(LC)),
+ UC = string:to_upper(string:to_lower(UC)),
ok.
all_upper_latin1([C|T], C) when 0 =< C, C < $a;
@@ -533,15 +455,11 @@ all_lower_latin1([H|T], C) when $A =< C, C =< $Z;
all_lower_latin1(T, C+1);
all_lower_latin1([], 256) -> ok.
-join(suite) ->
- [];
-join(doc) ->
- [];
join(Config) when is_list(Config) ->
- ?line "erlang rules" = string:join(["erlang", "rules"], " "),
- ?line "a,-,b,-,c" = string:join(["a", "b", "c"], ",-,"),
- ?line "1234" = string:join(["1", "2", "3", "4"], ""),
- ?line [] = string:join([], ""), % OTP-7231
+ "erlang rules" = string:join(["erlang", "rules"], " "),
+ "a,-,b,-,c" = string:join(["a", "b", "c"], ",-,"),
+ "1234" = string:join(["1", "2", "3", "4"], ""),
+ [] = string:join([], ""), % OTP-7231
%% invalid arg type
- ?line {'EXIT',_} = (catch string:join([apa], "")),
+ {'EXIT',_} = (catch string:join([apa], "")),
ok.
diff --git a/lib/stdlib/test/supervisor_SUITE.erl b/lib/stdlib/test/supervisor_SUITE.erl
index 903ca76575..9de5a57e7f 100644
--- a/lib/stdlib/test/supervisor_SUITE.erl
+++ b/lib/stdlib/test/supervisor_SUITE.erl
@@ -22,7 +22,6 @@
-module(supervisor_SUITE).
-include_lib("common_test/include/ct.hrl").
--define(TIMEOUT, ?t:minutes(1)).
%% Testserver specific export
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
@@ -78,7 +77,8 @@
%%-------------------------------------------------------------------------
suite() ->
- [{ct_hooks,[ts_install_cth]}].
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[{group, sup_start}, {group, sup_start_map}, {group, sup_stop}, child_adm,
@@ -144,11 +144,9 @@ end_per_group(_GroupName, Config) ->
Config.
init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?TIMEOUT),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- ?t:timetrap_cancel(?config(watchdog,Config)),
+end_per_testcase(_Case, _Config) ->
ok.
start_link(InitResult) ->
@@ -704,7 +702,7 @@ permanent_normal(Config) when is_list(Config) ->
true ->
ok;
false ->
- test_server:fail({permanent_child_not_restarted, Child1})
+ ct:fail({permanent_child_not_restarted, Child1})
end,
[1,1,0,1] = get_child_counts(sup_test).
@@ -753,7 +751,7 @@ permanent_shutdown(Config) when is_list(Config) ->
true ->
ok;
false ->
- test_server:fail({permanent_child_not_restarted, Child1})
+ ct:fail({permanent_child_not_restarted, Child1})
end,
[1,1,0,1] = get_child_counts(sup_test),
@@ -764,7 +762,7 @@ permanent_shutdown(Config) when is_list(Config) ->
true ->
ok;
false ->
- test_server:fail({permanent_child_not_restarted, Child1})
+ ct:fail({permanent_child_not_restarted, Child1})
end,
[1,1,0,1] = get_child_counts(sup_test).
@@ -817,7 +815,7 @@ temporary_shutdown(Config) when is_list(Config) ->
faulty_application_shutdown(Config) when is_list(Config) ->
%% Set some paths
- AppDir = filename:join(?config(data_dir, Config), "app_faulty"),
+ AppDir = filename:join(proplists:get_value(data_dir, Config), "app_faulty"),
EbinDir = filename:join(AppDir, "ebin"),
%% Start faulty app
@@ -860,7 +858,7 @@ permanent_abnormal(Config) when is_list(Config) ->
true ->
ok;
false ->
- test_server:fail({permanent_child_not_restarted, Child1})
+ ct:fail({permanent_child_not_restarted, Child1})
end,
[1,1,0,1] = get_child_counts(sup_test).
@@ -879,7 +877,7 @@ transient_abnormal(Config) when is_list(Config) ->
true ->
ok;
false ->
- test_server:fail({transient_child_not_restarted, Child1})
+ ct:fail({transient_child_not_restarted, Child1})
end,
[1,1,0,1] = get_child_counts(sup_test).
@@ -975,9 +973,9 @@ one_for_one(Config) when is_list(Config) ->
if length(Children) == 2 ->
case lists:keysearch(CPid2, 2, Children) of
{value, _} -> ok;
- _ -> test_server:fail(bad_child)
+ _ -> ct:fail(bad_child)
end;
- true -> test_server:fail({bad_child_list, Children})
+ true -> ct:fail({bad_child_list, Children})
end,
[2,2,0,2] = get_child_counts(sup_test),
@@ -1028,7 +1026,7 @@ one_for_all(Config) when is_list(Config) ->
Children = supervisor:which_children(sup_test),
if length(Children) == 2 -> ok;
true ->
- test_server:fail({bad_child_list, Children})
+ ct:fail({bad_child_list, Children})
end,
%% Test that no old children is still alive
@@ -1103,7 +1101,7 @@ one_for_all_other_child_fails_restart(Config) when is_list(Config) ->
{_childName, _Pid} ->
exit(SupPid, kill),
check_exit([StarterPid, SupPid]),
- test_server:fail({restarting_child_not_terminated, Child1Pid2})
+ ct:fail({restarting_child_not_terminated, Child1Pid2})
end,
%% Let the restart complete.
Child1Pid3 = receive {child1, Pid5} -> Pid5 end,
@@ -1130,9 +1128,9 @@ simple_one_for_one(Config) when is_list(Config) ->
if length(Children) == 2 ->
case lists:keysearch(CPid2, 2, Children) of
{value, _} -> ok;
- _ -> test_server:fail(bad_child)
+ _ -> ct:fail(bad_child)
end;
- true -> test_server:fail({bad_child_list, Children})
+ true -> ct:fail({bad_child_list, Children})
end,
[1,2,0,2] = get_child_counts(sup_test),
@@ -1166,9 +1164,9 @@ simple_one_for_one_shutdown(Config) when is_list(Config) ->
if T < 1000*ShutdownTime ->
%% Because supervisor's children wait before exiting, it can't
%% terminate quickly
- test_server:fail({shutdown_too_short, T});
+ ct:fail({shutdown_too_short, T});
T >= 1000*5*ShutdownTime ->
- test_server:fail({shutdown_too_long, T});
+ ct:fail({shutdown_too_long, T});
true ->
check_exit([SupPid])
end.
@@ -1190,9 +1188,9 @@ simple_one_for_one_extra(Config) when is_list(Config) ->
if length(Children) == 2 ->
case lists:keysearch(CPid2, 2, Children) of
{value, _} -> ok;
- _ -> test_server:fail(bad_child)
+ _ -> ct:fail(bad_child)
end;
- true -> test_server:fail({bad_child_list, Children})
+ true -> ct:fail({bad_child_list, Children})
end,
[1,2,0,2] = get_child_counts(sup_test),
terminate(SupPid, CPid2, child2, abnormal),
@@ -1244,7 +1242,7 @@ rest_for_one(Config) when is_list(Config) ->
if length(Children) == 3 ->
ok;
true ->
- test_server:fail({bad_child_list, Children})
+ ct:fail({bad_child_list, Children})
end,
[3,3,0,3] = get_child_counts(sup_test),
@@ -1320,7 +1318,7 @@ rest_for_one_other_child_fails_restart(Config) when is_list(Config) ->
{child1, _Child1Pid3} ->
exit(SupPid, kill),
check_exit([StarterPid, SupPid]),
- test_server:fail({restarting_started_child, Child1Pid2})
+ ct:fail({restarting_started_child, Child1Pid2})
end,
StarterPid ! {stop, Self},
check_exit([StarterPid, SupPid]).
@@ -1350,7 +1348,7 @@ child_unlink(Config) when is_list(Config) ->
ok;
_ ->
exit(Pid, kill),
- test_server:fail(supervisor_hangs)
+ ct:fail(supervisor_hangs)
end.
%%-------------------------------------------------------------------------
%% Test a basic supervison tree.
@@ -1486,18 +1484,18 @@ count_restarting_children(Config) when is_list(Config) ->
supervisor_deadlock:restart_child(Ch1_1),
supervisor_deadlock:restart_child(Ch1_2),
supervisor_deadlock:restart_child(Ch1_3),
- test_server:sleep(400),
+ ct:sleep(400),
[1,3,0,3] = get_child_counts(SupPid),
[Ch2_1, Ch2_2, Ch2_3] = [C || {_,C,_,_} <- supervisor:which_children(SupPid)],
ets:insert(supervisor_deadlock,{fail_start,true}),
supervisor_deadlock:restart_child(Ch2_1),
supervisor_deadlock:restart_child(Ch2_2),
- test_server:sleep(4000), % allow restart to happen before proceeding
+ ct:sleep(4000), % allow restart to happen before proceeding
[1,1,0,3] = get_child_counts(SupPid),
ets:insert(supervisor_deadlock,{fail_start,false}),
- test_server:sleep(4000), % allow restart to happen before proceeding
+ ct:sleep(4000), % allow restart to happen before proceeding
[1,3,0,3] = get_child_counts(SupPid),
ok = supervisor:terminate_child(SupPid, Ch2_3),
@@ -1689,7 +1687,7 @@ simple_one_for_one_scale_many_temporary_children(_Config) ->
%% The scaling shoul be linear (i.e.10, really), but we
%% give some extra here to avoid failing the test
%% unecessarily.
- ?t:fail({bad_scaling,Scaling});
+ ct:fail({bad_scaling,Scaling});
true ->
ok
end;
@@ -2118,14 +2116,14 @@ in_child_list([Pid | Rest], Pids) ->
true ->
in_child_list(Rest, Pids);
false ->
- test_server:fail(child_should_be_alive)
+ ct:fail(child_should_be_alive)
end.
not_in_child_list([], _) ->
true;
not_in_child_list([Pid | Rest], Pids) ->
case is_in_child_list(Pid, Pids) of
true ->
- test_server:fail(child_should_not_be_alive);
+ ct:fail(child_should_not_be_alive);
false ->
not_in_child_list(Rest, Pids)
end.
@@ -2146,7 +2144,7 @@ check_exit_reason(Reason) ->
{'EXIT', _, Reason} ->
ok;
{'EXIT', _, Else} ->
- test_server:fail({bad_exit_reason, Else})
+ ct:fail({bad_exit_reason, Else})
end.
check_exit_reason(Pid, Reason) ->
@@ -2154,5 +2152,5 @@ check_exit_reason(Pid, Reason) ->
{'EXIT', Pid, Reason} ->
ok;
{'EXIT', Pid, Else} ->
- test_server:fail({bad_exit_reason, Else})
+ ct:fail({bad_exit_reason, Else})
end.
diff --git a/lib/stdlib/test/supervisor_bridge_SUITE.erl b/lib/stdlib/test/supervisor_bridge_SUITE.erl
index 94e719bea1..029cb3fd7f 100644
--- a/lib/stdlib/test/supervisor_bridge_SUITE.erl
+++ b/lib/stdlib/test/supervisor_bridge_SUITE.erl
@@ -30,7 +30,9 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[starting, mini_terminate, mini_die, badstart, simple_global_supervisor].
@@ -53,33 +55,30 @@ end_per_group(_GroupName, Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-starting(suite) -> [];
starting(Config) when is_list(Config) ->
process_flag(trap_exit,true),
- ?line ignore = start(1),
- ?line {error,testing} = start(2),
+ ignore = start(1),
+ {error,testing} = start(2),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-mini_terminate(suite) -> [];
mini_terminate(Config) when is_list(Config) ->
miniappl(1),
ok.
-mini_die(suite) -> [];
mini_die(Config) when is_list(Config) ->
miniappl(2),
ok.
miniappl(N) ->
process_flag(trap_exit,true),
- ?line {ok,Server} = start(3),
- ?line Client = spawn_link(?MODULE,client,[N]),
- ?line Handle = test_server:timetrap(2000),
- ?line miniappl_loop(Client,Server),
- ?line test_server:timetrap_cancel(Handle).
+ {ok,Server} = start(3),
+ Client = spawn_link(?MODULE,client,[N]),
+ ct:timetrap({seconds,2}),
+ miniappl_loop(Client, Server).
+
miniappl_loop([],[]) ->
ok;
@@ -87,19 +86,19 @@ miniappl_loop(Client,Server) ->
io:format("Client ~p, Server ~p\n",[Client,Server]),
receive
{'EXIT',Client,_} ->
- ?line miniappl_loop([],Server);
+ miniappl_loop([],Server);
{'EXIT',Server,killed} -> %% terminate
- ?line miniappl_loop(Client,[]);
+ miniappl_loop(Client,[]);
{'EXIT',Server,died} -> %% die
- ?line miniappl_loop(Client,[]);
+ miniappl_loop(Client,[]);
{dying,_Reason} ->
- ?line miniappl_loop(Client, Server);
+ miniappl_loop(Client, Server);
Other ->
- ?line exit({failed,Other})
+ exit({failed,Other})
end.
%%%%%%%%%%%%%%%%%%%%
-% Client
+%% Client
client(N) ->
io:format("Client starting...\n"),
@@ -112,7 +111,7 @@ client(N) ->
exit(fine).
%%%%%%%%%%%%%%%%%%%%
-% Non compliant server
+%% Non compliant server
start(N) ->
supervisor_bridge:start_link({local,?bridge_name},?MODULE,N).
@@ -170,45 +169,44 @@ terminate(_Reason, _State) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-badstart(suite) -> [];
-badstart(doc) -> "Test various bad ways of starting a supervisor bridge.";
+%% Test various bad ways of starting a supervisor bridge.
badstart(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:minutes(1)),
-
%% Various bad arguments.
- ?line {'EXIT',_} =
+ {'EXIT',_} =
(catch supervisor_bridge:start_link({xxx,?bridge_name},?MODULE,1)),
- ?line {'EXIT',_} =
+ {'EXIT',_} =
(catch supervisor_bridge:start_link({local,"foo"},?MODULE,1)),
- ?line {'EXIT',_} =
+ {'EXIT',_} =
(catch supervisor_bridge:start_link(?bridge_name,?MODULE,1)),
- ?line [] = test_server:messages_get(), % No messages waiting
+ receive
+ Msg ->
+ ct:fail({unexpected,Msg})
+ after 1 ->
+ ok
+ end,
%% Already started.
- ?line process_flag(trap_exit, true),
- ?line {ok,Pid} =
+ process_flag(trap_exit, true),
+ {ok,Pid} =
supervisor_bridge:start_link({local,?bridge_name},?MODULE,3),
- ?line {error,{already_started,Pid}} =
+ {error,{already_started,Pid}} =
supervisor_bridge:start_link({local,?bridge_name},?MODULE,3),
- ?line public_kill(),
+ public_kill(),
%% We used to wait 1 ms before retrieving the message queue,
%% but that might not always be enough if the machine is overloaded.
- ?line receive
- {'EXIT', Pid, killed} -> ok
- end,
- ?line test_server:timetrap_cancel(Dog),
+ receive
+ {'EXIT', Pid, killed} -> ok
+ end,
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% OTP-9212. Restart of global supervisor.
-simple_global_supervisor(suite) -> [];
-simple_global_supervisor(doc) -> "Globally registered supervisor.";
+%% Globally registered supervisor.
simple_global_supervisor(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap({seconds,10}),
Child = {child, {?MODULE,server9212,[]}, permanent, 2000, worker, []},
InitResult = {ok, {{one_for_all,3,60}, [Child]}},
@@ -216,16 +214,15 @@ simple_global_supervisor(Config) when is_list(Config) ->
supervisor:start_link({local,bridge9212}, ?MODULE, {4,InitResult}),
BN_1 = global:whereis_name(?bridge_name),
- ?line exit(BN_1, kill),
+ exit(BN_1, kill),
timer:sleep(200),
BN_2 = global:whereis_name(?bridge_name),
- ?line true = is_pid(BN_2),
- ?line true = BN_1 =/= BN_2,
+ true = is_pid(BN_2),
+ true = BN_1 =/= BN_2,
- ?line process_flag(trap_exit, true),
+ process_flag(trap_exit, true),
exit(Sup, kill),
- ?line receive {'EXIT', Sup, killed} -> ok end,
- ?line test_server:timetrap_cancel(Dog),
+ receive {'EXIT', Sup, killed} -> ok end,
ok.
server9212() ->
diff --git a/lib/stdlib/test/sys_SUITE.erl b/lib/stdlib/test/sys_SUITE.erl
index 102a147fcd..39bc835824 100644
--- a/lib/stdlib/test/sys_SUITE.erl
+++ b/lib/stdlib/test/sys_SUITE.erl
@@ -53,7 +53,6 @@ end_per_group(_GroupName, Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-log(suite) -> [];
log(Config) when is_list(Config) ->
{ok,_Server} = start(),
ok = sys:log(?server,true),
@@ -63,9 +62,8 @@ log(Config) when is_list(Config) ->
stop(),
ok.
-log_to_file(suite) -> [];
log_to_file(Config) when is_list(Config) ->
- TempName = test_server:temp_name(?config(priv_dir,Config) ++ "sys."),
+ TempName = test_server:temp_name(proplists:get_value(priv_dir,Config) ++ "sys."),
{ok,_Server} = start(),
ok = sys:log_to_file(?server,TempName),
{ok,-44} = public_call(44),
@@ -74,20 +72,19 @@ log_to_file(Config) when is_list(Config) ->
Msg1 = io:get_line(Fd,''),
Msg2 = io:get_line(Fd,''),
file:close(Fd),
- lists:prefix("*DBG* sys_SUITE_server got call {req,44} from ",Msg1),
- lists:prefix("*DBG* sys_SUITE_server sent {ok,-44} to ",Msg2),
+ "*DBG* sys_SUITE_server got call {req,44} from " ++ _ = Msg1,
+ "*DBG* sys_SUITE_server sent {ok,-44} to " ++ _ = Msg2,
stop(),
ok.
-stats(suite) -> [];
stats(Config) when is_list(Config) ->
Self = self(),
{ok,_Server} = start(),
ok = sys:statistics(?server,true),
{ok,-44} = public_call(44),
{ok,Stats} = sys:statistics(?server,get),
- lists:member({messages_in,1},Stats),
- lists:member({messages_out,1},Stats),
+ true = lists:member({messages_in,1}, Stats),
+ true = lists:member({messages_out,0}, Stats),
ok = sys:statistics(?server,false),
{status,_Pid,{module,_Mod},[_PDict,running,Self,_,_]} =
sys:get_status(?server),
@@ -95,43 +92,40 @@ stats(Config) when is_list(Config) ->
stop(),
ok.
-trace(suite) -> [];
trace(Config) when is_list(Config) ->
{ok,_Server} = start(),
- test_server:sleep(2000),
- test_server:capture_start(),
+ ct:sleep(2000),
+ ct:capture_start(),
sys:trace(?server,true),
{ok,-44} = public_call(44),
%% ho, hum, allow for the io to reach us..
- test_server:sleep(1000),
- test_server:capture_stop(),
- [Msg1,Msg2] = test_server:capture_get(),
- lists:prefix("*DBG* sys_SUITE_server got call {req,44} from ",Msg1),
- lists:prefix("*DBG* sys_SUITE_server sent {ok,-44} to ",Msg2),
+ ct:sleep(1000),
+ ct:capture_stop(),
+ [Msg1,Msg2] = ct:capture_get(),
+ "*DBG* sys_SUITE_server got call {req,44} from " ++ _ = Msg1,
+ "*DBG* sys_SUITE_server sent {ok,-44} to " ++ _ = Msg2,
stop(),
ok.
-suspend(suite) -> [];
suspend(Config) when is_list(Config) ->
- ?line {ok,_Server} = start(),
- ?line sys:suspend(?server,1000),
- ?line {'EXIT',_} = (catch public_call(48)),
- ?line {status,_,_,[_,suspended,_,_,_]} = sys:get_status(?server),
- ?line sys:suspend(?server,1000), %% doing it twice is no error
- ?line {'EXIT',_} = (catch public_call(48)),
- ?line sys:resume(?server),
- ?line {status,_,_,[_,running,_,_,_]} = sys:get_status(?server),
- ?line {ok,-48} = (catch public_call(48)),
- ?line sys:resume(?server), %% doing it twice is no error
- ?line {ok,-48} = (catch public_call(48)),
- ?line stop(),
+ {ok,_Server} = start(),
+ sys:suspend(?server,1000),
+ {'EXIT',_} = (catch public_call(48)),
+ {status,_,_,[_,suspended,_,_,_]} = sys:get_status(?server),
+ sys:suspend(?server,1000), %% doing it twice is no error
+ {'EXIT',_} = (catch public_call(48)),
+ sys:resume(?server),
+ {status,_,_,[_,running,_,_,_]} = sys:get_status(?server),
+ {ok,-48} = (catch public_call(48)),
+ sys:resume(?server), %% doing it twice is no error
+ {ok,-48} = (catch public_call(48)),
+ stop(),
ok.
-install(suite) -> [];
install(Config) when is_list(Config) ->
- ?line {ok,_Server} = start(),
- ?line Master = self(),
- ?line SpyFun =
+ {ok,_Server} = start(),
+ Master = self(),
+ SpyFun =
fun(func_state,Event,ProcState) ->
case Event of
{in,{'$gen_call',_From,{req,Arg}}} ->
@@ -141,22 +135,26 @@ install(Config) when is_list(Config) ->
io:format("Trigged other=~p\n",[Other])
end
end,
- ?line sys:install(?server,{SpyFun,func_state}),
- ?line {ok,-1} = (catch public_call(1)),
- ?line sys:no_debug(?server),
- ?line {ok,-2} = (catch public_call(2)),
- ?line sys:install(?server,{SpyFun,func_state}),
- ?line sys:install(?server,{SpyFun,func_state}),
- ?line {ok,-3} = (catch public_call(3)),
- ?line sys:remove(?server,SpyFun),
- ?line {ok,-4} = (catch public_call(4)),
- ?line Msgs = test_server:messages_get(),
- ?line [{spy_got,{request,1},sys_SUITE_server},
- {spy_got,{request,3},sys_SUITE_server}] = Msgs,
- ?line stop(),
+ sys:install(?server,{SpyFun,func_state}),
+ {ok,-1} = (catch public_call(1)),
+ sys:no_debug(?server),
+ {ok,-2} = (catch public_call(2)),
+ sys:install(?server,{SpyFun,func_state}),
+ sys:install(?server,{SpyFun,func_state}),
+ {ok,-3} = (catch public_call(3)),
+ sys:remove(?server,SpyFun),
+ {ok,-4} = (catch public_call(4)),
+ [{spy_got,{request,1},sys_SUITE_server},
+ {spy_got,{request,3},sys_SUITE_server}] = get_messages(),
+ stop(),
ok.
-special_process(suite) -> [];
+get_messages() ->
+ receive
+ Msg -> [Msg|get_messages()]
+ after 1 -> []
+ end.
+
special_process(Config) when is_list(Config) ->
ok = spec_proc(sys_sp1),
ok = spec_proc(sys_sp2).
diff --git a/lib/stdlib/test/tar_SUITE.erl b/lib/stdlib/test/tar_SUITE.erl
index a22eaa1d3a..7f20851445 100644
--- a/lib/stdlib/test/tar_SUITE.erl
+++ b/lib/stdlib/test/tar_SUITE.erl
@@ -53,10 +53,9 @@ end_per_group(_GroupName, Config) ->
Config.
-borderline(doc) ->
- ["Test creating, listing and extracting one file from an archive",
- "multiple times with different file sizes. ",
- "Also check that the file attributes of the extracted file has survived."];
+%% Test creating, listing and extracting one file from an archive,
+%% multiple times with different file sizes. Also check that the file
+%% attributes of the extracted file has survived.
borderline(Config) when is_list(Config) ->
%% Note: We cannot use absolute paths, because the pathnames will be
@@ -64,47 +63,47 @@ borderline(Config) when is_list(Config) ->
%% Therefore, strip off the current working directory from the front
%% of the private directory path.
- ?line {ok, Cwd} = file:get_cwd(),
- ?line RootDir = ?config(priv_dir, Config),
- ?line TempDir = remove_prefix(Cwd++"/", filename:join(RootDir, "borderline")),
- ?line ok = file:make_dir(TempDir),
+ {ok, Cwd} = file:get_cwd(),
+ RootDir = proplists:get_value(priv_dir, Config),
+ TempDir = remove_prefix(Cwd++"/", filename:join(RootDir, "borderline")),
+ ok = file:make_dir(TempDir),
- ?line Record = 512,
- ?line Block = 20 * Record,
+ Record = 512,
+ Block = 20 * Record,
- ?line lists:foreach(fun(Size) -> borderline_test(Size, TempDir) end,
- [0, 1, 10, 13, 127, 333, Record-1, Record, Record+1,
- Block-2*Record-1, Block-2*Record, Block-2*Record+1,
- Block-Record-1, Block-Record, Block-Record+1,
- Block-1, Block, Block+1,
- Block+Record-1, Block+Record, Block+Record+1]),
+ lists:foreach(fun(Size) -> borderline_test(Size, TempDir) end,
+ [0, 1, 10, 13, 127, 333, Record-1, Record, Record+1,
+ Block-2*Record-1, Block-2*Record, Block-2*Record+1,
+ Block-Record-1, Block-Record, Block-Record+1,
+ Block-1, Block, Block+1,
+ Block+Record-1, Block+Record, Block+Record+1]),
%% Clean up.
- ?line delete_files([TempDir]),
+ delete_files([TempDir]),
ok.
borderline_test(Size, TempDir) ->
- ?line Archive = filename:join(TempDir, "ar_"++integer_to_list(Size)++".tar"),
- ?line Name = filename:join(TempDir, "file_"++integer_to_list(Size)),
- ?line io:format("Testing size ~p", [Size]),
+ Archive = filename:join(TempDir, "ar_"++integer_to_list(Size)++".tar"),
+ Name = filename:join(TempDir, "file_"++integer_to_list(Size)),
+ io:format("Testing size ~p", [Size]),
%% Create a file and archive it.
X0 = erlang:monotonic_time(),
- ?line file:write_file(Name, random_byte_list(X0, Size)),
- ?line ok = erl_tar:create(Archive, [Name]),
- ?line ok = file:delete(Name),
+ file:write_file(Name, random_byte_list(X0, Size)),
+ ok = erl_tar:create(Archive, [Name]),
+ ok = file:delete(Name),
%% Verify listing and extracting.
- ?line {ok, [Name]} = erl_tar:table(Archive),
- ?line ok = erl_tar:extract(Archive, [verbose]),
+ {ok, [Name]} = erl_tar:table(Archive),
+ ok = erl_tar:extract(Archive, [verbose]),
%% Verify contents of extracted file.
- ?line {ok, Bin} = file:read_file(Name),
- ?line true = match_byte_list(X0, binary_to_list(Bin)),
+ {ok, Bin} = file:read_file(Name),
+ true = match_byte_list(X0, binary_to_list(Bin)),
%% Verify that Unix tar can read it.
- ?line tar_tf(Archive, Name),
+ tar_tf(Archive, Name),
ok.
@@ -117,20 +116,20 @@ tar_tf(Archive, Name) ->
end.
tar_tf1(Archive, Name) ->
- ?line Expect = Name ++ "\n",
- ?line cmd_expect("tar tf " ++ Archive, Expect).
+ Expect = Name ++ "\n",
+ cmd_expect("tar tf " ++ Archive, Expect).
%% We can't use os:cmd/1, because Unix 'tar tf Name' on Solaris never
%% terminates when given an archive of a size it doesn't like.
cmd_expect(Cmd, Expect) ->
- ?line Port = open_port({spawn, make_cmd(Cmd)}, [stream, in, eof]),
- ?line get_data(Port, Expect).
+ Port = open_port({spawn, make_cmd(Cmd)}, [stream, in, eof]),
+ get_data(Port, Expect).
get_data(Port, Expect) ->
receive
{Port, {data, Bytes}} ->
- ?line get_data(Port, match_output(Bytes, Expect, Port));
+ get_data(Port, match_output(Bytes, Expect, Port));
{Port, eof} ->
Port ! {self(), close},
receive
@@ -143,26 +142,26 @@ get_data(Port, Expect) ->
after 1 -> % force context switch
ok
end,
- ?line match_output(eof, Expect, Port)
+ match_output(eof, Expect, Port)
end.
match_output([C|Output], [C|Expect], Port) ->
- ?line match_output(Output, Expect, Port);
+ match_output(Output, Expect, Port);
match_output([_|_], [_|_], Port) ->
- ?line kill_port_and_fail(Port, badmatch);
+ kill_port_and_fail(Port, badmatch);
match_output([X|Output], [], Port) ->
- ?line kill_port_and_fail(Port, {too_much_data, [X|Output]});
+ kill_port_and_fail(Port, {too_much_data, [X|Output]});
match_output([], Expect, _Port) ->
Expect;
match_output(eof, [], _Port) ->
[];
match_output(eof, _Expect, Port) ->
- ?line kill_port_and_fail(Port, unexpected_end_of_input).
+ kill_port_and_fail(Port, unexpected_end_of_input).
kill_port_and_fail(Port, Reason) ->
unlink(Port),
exit(Port, die),
- test_server:fail(Reason).
+ ct:fail(Reason).
make_cmd(Cmd) ->
case os:type() of
@@ -198,58 +197,56 @@ random_byte_list(_X, 0, Result) ->
next_random(X) ->
(X*17059465+1) band 16#fffffffff.
-atomic(doc) ->
- ["Test the 'atomic' operations: create/extract/table, on compressed "
- "and uncompressed archives."
- "Also test the 'cooked' option."];
-atomic(suite) -> [];
+%% Test the 'atomic' operations: create/extract/table, on compressed
+%% and uncompressed archives.
+%% Also test the 'cooked' option.
atomic(Config) when is_list(Config) ->
- ?line ok = file:set_cwd(?config(priv_dir, Config)),
- ?line DataFiles = data_files(),
- ?line Names = [Name || {Name,_,_} <- DataFiles],
+ ok = file:set_cwd(proplists:get_value(priv_dir, Config)),
+ DataFiles = data_files(),
+ Names = [Name || {Name,_,_} <- DataFiles],
io:format("Names: ~p", [Names]),
%% Create an uncompressed archive. The compressed flag should still be
%% allowed when listing contents or extracting.
- ?line Tar1 = "uncompressed.tar",
- ?line erl_tar:create(Tar1, Names, []),
- ?line {ok, Names} = erl_tar:table(Tar1, []),
- ?line {ok, Names} = erl_tar:table(Tar1, [compressed]),
- ?line {ok, Names} = erl_tar:table(Tar1, [cooked]),
- ?line {ok, Names} = erl_tar:table(Tar1, [compressed,cooked]),
-
+ Tar1 = "uncompressed.tar",
+ erl_tar:create(Tar1, Names, []),
+ {ok, Names} = erl_tar:table(Tar1, []),
+ {ok, Names} = erl_tar:table(Tar1, [compressed]),
+ {ok, Names} = erl_tar:table(Tar1, [cooked]),
+ {ok, Names} = erl_tar:table(Tar1, [compressed,cooked]),
+
%% Create a compressed archive.
- ?line Tar2 = "compressed.tar",
- ?line erl_tar:create(Tar2, Names, [compressed]),
- ?line {ok, Names} = erl_tar:table(Tar2, [compressed]),
- ?line {error, Reason} = erl_tar:table(Tar2, []),
- ?line {ok, Names} = erl_tar:table(Tar2, [compressed,cooked]),
- ?line {error, Reason} = erl_tar:table(Tar2, [cooked]),
- ?line ok = io:format("No compressed option: ~p, ~s",
- [Reason, erl_tar:format_error(Reason)]),
+ Tar2 = "compressed.tar",
+ erl_tar:create(Tar2, Names, [compressed]),
+ {ok, Names} = erl_tar:table(Tar2, [compressed]),
+ {error, Reason} = erl_tar:table(Tar2, []),
+ {ok, Names} = erl_tar:table(Tar2, [compressed,cooked]),
+ {error, Reason} = erl_tar:table(Tar2, [cooked]),
+ ok = io:format("No compressed option: ~p, ~s",
+ [Reason, erl_tar:format_error(Reason)]),
%% Same test again, but this time created with 'cooked'
- ?line Tar3 = "uncompressed_cooked.tar",
- ?line erl_tar:create(Tar3, Names, [cooked]),
- ?line {ok, Names} = erl_tar:table(Tar3, []),
- ?line {ok, Names} = erl_tar:table(Tar3, [compressed]),
- ?line {ok, Names} = erl_tar:table(Tar3, [cooked]),
- ?line {ok, Names} = erl_tar:table(Tar3, [compressed,cooked]),
-
- ?line Tar4 = "compressed_cooked.tar",
- ?line erl_tar:create(Tar4, Names, [compressed,cooked]),
- ?line {ok, Names} = erl_tar:table(Tar4, [compressed]),
- ?line {error, Reason} = erl_tar:table(Tar4, []),
- ?line {ok, Names} = erl_tar:table(Tar4, [compressed,cooked]),
- ?line {error, Reason} = erl_tar:table(Tar4, [cooked]),
- ?line ok = io:format("No compressed option: ~p, ~s",
- [Reason, erl_tar:format_error(Reason)]),
+ Tar3 = "uncompressed_cooked.tar",
+ erl_tar:create(Tar3, Names, [cooked]),
+ {ok, Names} = erl_tar:table(Tar3, []),
+ {ok, Names} = erl_tar:table(Tar3, [compressed]),
+ {ok, Names} = erl_tar:table(Tar3, [cooked]),
+ {ok, Names} = erl_tar:table(Tar3, [compressed,cooked]),
+
+ Tar4 = "compressed_cooked.tar",
+ erl_tar:create(Tar4, Names, [compressed,cooked]),
+ {ok, Names} = erl_tar:table(Tar4, [compressed]),
+ {error, Reason} = erl_tar:table(Tar4, []),
+ {ok, Names} = erl_tar:table(Tar4, [compressed,cooked]),
+ {error, Reason} = erl_tar:table(Tar4, [cooked]),
+ ok = io:format("No compressed option: ~p, ~s",
+ [Reason, erl_tar:format_error(Reason)]),
%% Clean up.
- ?line delete_files([Tar1,Tar2,Tar3,Tar4|Names]),
+ delete_files([Tar1,Tar2,Tar3,Tar4|Names]),
ok.
@@ -279,50 +276,48 @@ create_files([{Name, Size, First}|Rest]) ->
create_files([]) ->
ok.
-long_names(doc) ->
- ["Test to extract an Unix tar file containing filenames longer than 100 ",
- "characters and empty directories."];
+%% Test to extract an Unix tar file containing filenames longer than
+%% 100 characters and empty directories.
long_names(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line Long = filename:join(DataDir, "long_names.tar"),
+ DataDir = proplists:get_value(data_dir, Config),
+ Long = filename:join(DataDir, "long_names.tar"),
run_in_short_tempdir(Config,
fun() -> do_long_names(Long) end).
do_long_names(Long) ->
%% Try table/2 and extract/2.
- ?line case erl_tar:table(Long, [verbose]) of
- {ok,List} when is_list(List) ->
- ?line io:format("~p\n", [List])
- end,
+ case erl_tar:table(Long, [verbose]) of
+ {ok,List} when is_list(List) ->
+ io:format("~p\n", [List])
+ end,
- ?line {ok,Cwd} = file:get_cwd(),
- ?line ok = erl_tar:extract(Long),
- ?line Base = filename:join([Cwd, "original_software", "written_by",
- "a_bunch_of_hackers",
- "spending_all_their_nights",
- "still", "not_long_enough",
- "but_soon_it_will_be"]),
+ {ok,Cwd} = file:get_cwd(),
+ ok = erl_tar:extract(Long),
+ Base = filename:join([Cwd, "original_software", "written_by",
+ "a_bunch_of_hackers",
+ "spending_all_their_nights",
+ "still", "not_long_enough",
+ "but_soon_it_will_be"]),
%% Verify that the empty directory was created.
- ?line EmptyDir = filename:join(Base, "empty_directory"),
- ?line {ok, #file_info{type=directory}} = file:read_file_info(EmptyDir),
+ EmptyDir = filename:join(Base, "empty_directory"),
+ {ok, #file_info{type=directory}} = file:read_file_info(EmptyDir),
%% Verify that the files were created.
- ?line {ok,First} = file:read_file(filename:join(Base, "first_file")),
- ?line {ok,Second} = file:read_file(filename:join(Base, "second_file")),
- ?line "Here"++_ = binary_to_list(First),
- ?line "And"++_ = binary_to_list(Second),
+ {ok,First} = file:read_file(filename:join(Base, "first_file")),
+ {ok,Second} = file:read_file(filename:join(Base, "second_file")),
+ "Here"++_ = binary_to_list(First),
+ "And"++_ = binary_to_list(Second),
ok.
-create_long_names(doc) ->
- ["Creates a tar file from a deep directory structure (filenames are ",
- "longer than 100 characters)."];
+%% Creates a tar file from a deep directory structure (filenames are
+%% longer than 100 characters).
create_long_names(Config) when is_list(Config) ->
run_in_short_tempdir(Config, fun create_long_names/0).
-
+
create_long_names() ->
- ?line {ok,Dir} = file:get_cwd(),
+ {ok,Dir} = file:get_cwd(),
Dirs = ["aslfjkshjkhliuf",
"asdhjfehnbfsky",
"sahajfskdfhsz",
@@ -330,49 +325,48 @@ create_long_names() ->
"f7nafhjgffagkhsfkhsjk",
"dfjasldkfjsdkfjashbv"],
- ?line DeepDir = make_dirs(Dirs, []),
- ?line AFile = filename:join(DeepDir, "a_file"),
- ?line Hello = "hello, world\n",
- ?line ok = file:write_file(AFile, Hello),
- ?line TarName = filename:join(Dir, "my_tar_with_long_names.tar"),
- ?line ok = erl_tar:create(TarName, [AFile]),
+ DeepDir = make_dirs(Dirs, []),
+ AFile = filename:join(DeepDir, "a_file"),
+ Hello = "hello, world\n",
+ ok = file:write_file(AFile, Hello),
+ TarName = filename:join(Dir, "my_tar_with_long_names.tar"),
+ ok = erl_tar:create(TarName, [AFile]),
%% Print contents.
- ?line ok = erl_tar:tt(TarName),
+ ok = erl_tar:tt(TarName),
%% Extract and verify.
- ?line ExtractDir = "extract_dir",
- ?line ok = file:make_dir(ExtractDir),
- ?line ok = erl_tar:extract(TarName, [{cwd,ExtractDir}]),
- ?line {ok, Bin} = file:read_file(filename:join(ExtractDir, AFile)),
- ?line Hello = binary_to_list(Bin),
+ ExtractDir = "extract_dir",
+ ok = file:make_dir(ExtractDir),
+ ok = erl_tar:extract(TarName, [{cwd,ExtractDir}]),
+ {ok, Bin} = file:read_file(filename:join(ExtractDir, AFile)),
+ Hello = binary_to_list(Bin),
ok.
make_dirs([Dir|Rest], []) ->
- ?line ok = file:make_dir(Dir),
- ?line make_dirs(Rest, Dir);
+ ok = file:make_dir(Dir),
+ make_dirs(Rest, Dir);
make_dirs([Dir|Rest], Parent) ->
- ?line Name = filename:join(Parent, Dir),
- ?line ok = file:make_dir(Name),
- ?line make_dirs(Rest, Name);
+ Name = filename:join(Parent, Dir),
+ ok = file:make_dir(Name),
+ make_dirs(Rest, Name);
make_dirs([], Dir) ->
Dir.
-bad_tar(doc) ->
- ["Try erl_tar:table/2 and erl_tar:extract/2 on some corrupted tar files."];
+%% Try erl_tar:table/2 and erl_tar:extract/2 on some corrupted tar files.
bad_tar(Config) when is_list(Config) ->
- ?line try_bad("bad_checksum", bad_header, Config),
- ?line try_bad("bad_octal", bad_header, Config),
- ?line try_bad("bad_too_short", eof, Config),
- ?line try_bad("bad_even_shorter", eof, Config),
+ try_bad("bad_checksum", bad_header, Config),
+ try_bad("bad_octal", bad_header, Config),
+ try_bad("bad_too_short", eof, Config),
+ try_bad("bad_even_shorter", eof, Config),
ok.
try_bad(Name0, Reason, Config) ->
- %% Intentionally no ?line macros here.
+ %% Intentionally no macros here.
- DataDir = ?config(data_dir, Config),
- PrivDir = ?config(priv_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
Name = Name0 ++ ".tar",
io:format("~nTrying ~s", [Name]),
Full = filename:join(DataDir, Name),
@@ -383,38 +377,37 @@ try_bad(Name0, Reason, Config) ->
io:format("Result: ~p", [Expected]),
case catch erl_tar:format_error(Reason) of
{'EXIT', CrashReason} ->
- test_server:fail({format_error, crashed, CrashReason});
+ ct:fail({format_error, crashed, CrashReason});
String when is_list(String) ->
io:format("format_error(~p) -> ~s", [Reason, String]);
Other ->
- test_server:fail({format_error, returned, Other})
+ ct:fail({format_error, returned, Other})
end;
{Other1, Other2} ->
io:format("table/2 returned ~p", [Other1]),
io:format("extract/2 returned ~p", [Other2]),
- test_server:fail({bad_return_value, Other1, Other2})
+ ct:fail({bad_return_value, Other1, Other2})
end.
-errors(doc) ->
- ["Tests that some common errors return correct error codes ",
- "and that format_error/1 handles them correctly."];
+%% Tests that some common errors return correct error codes
+%% and that format_error/1 handles them correctly.
errors(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
%% Give the tar file the same name as a directory.
- ?line BadTar = filename:join(PrivDir, "bad_tarfile.tar"),
- ?line ok = file:make_dir(BadTar),
- ?line try_error(erl_tar, create, [BadTar, []], {BadTar, eisdir}),
+ BadTar = filename:join(PrivDir, "bad_tarfile.tar"),
+ ok = file:make_dir(BadTar),
+ try_error(erl_tar, create, [BadTar, []], {BadTar, eisdir}),
%% Try including non-existent files in the tar file.
- ?line NonExistent = "non_existent_file",
- ?line GoodTar = filename:join(PrivDir, "a_good_tarfile.tar"),
- ?line try_error(erl_tar, create, [GoodTar, [NonExistent]],
- {NonExistent, enoent}),
+ NonExistent = "non_existent_file",
+ GoodTar = filename:join(PrivDir, "a_good_tarfile.tar"),
+ try_error(erl_tar, create, [GoodTar, [NonExistent]],
+ {NonExistent, enoent}),
%% Clean up.
- ?line delete_files([GoodTar,BadTar]),
-
+ delete_files([GoodTar,BadTar]),
+
ok.
try_error(M, F, A, Error) ->
@@ -423,18 +416,18 @@ try_error(M, F, A, Error) ->
{'EXIT', Reason} ->
exit(Reason);
ok ->
- test_server:fail(unexpected_success);
+ ct:fail(unexpected_success);
{error, Error} ->
case catch erl_tar:format_error(Error) of
{'EXIT', FReason} ->
- test_server:fail({format_error, crashed, FReason});
+ ct:fail({format_error, crashed, FReason});
String when is_list(String) ->
io:format("format_error(~p) -> ~s", [Error, String]);
Other ->
- test_server:fail({format_error, returned, Other})
+ ct:fail({format_error, returned, Other})
end;
Other ->
- test_server:fail({expected, {error, Error}, actual, Other})
+ ct:fail({expected, {error, Error}, actual, Other})
end.
%% remove_prefix(Prefix, List) -> ListWithoutPrefix.
@@ -444,107 +437,104 @@ remove_prefix([C|Rest1], [C|Rest2]) ->
remove_prefix(_, Result) ->
Result.
-extract_from_binary(doc) ->
- "Test extracting a tar archive from a binary.";
+%% Test extracting a tar archive from a binary.
extract_from_binary(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Long = filename:join(DataDir, "no_fancy_stuff.tar"),
- ?line ExtractDir = filename:join(PrivDir, "extract_from_binary"),
- ?line ok = file:make_dir(ExtractDir),
-
+ DataDir = proplists:get_value(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Long = filename:join(DataDir, "no_fancy_stuff.tar"),
+ ExtractDir = filename:join(PrivDir, "extract_from_binary"),
+ ok = file:make_dir(ExtractDir),
+
%% Read a tar file into a binary and extract from the binary.
- ?line {ok, Bin} = file:read_file(Long),
- ?line ok = erl_tar:extract({binary, Bin}, [{cwd,ExtractDir}]),
+ {ok, Bin} = file:read_file(Long),
+ ok = erl_tar:extract({binary, Bin}, [{cwd,ExtractDir}]),
%% Verify.
Dir = filename:join(ExtractDir, "no_fancy_stuff"),
- ?line true = filelib:is_dir(Dir),
- ?line true = filelib:is_file(filename:join(Dir, "a_dir_list")),
- ?line true = filelib:is_file(filename:join(Dir, "EPLICENCE")),
+ true = filelib:is_dir(Dir),
+ true = filelib:is_file(filename:join(Dir, "a_dir_list")),
+ true = filelib:is_file(filename:join(Dir, "EPLICENCE")),
%% Clean up.
- ?line delete_files([ExtractDir]),
+ delete_files([ExtractDir]),
ok.
extract_from_binary_compressed(Config) when is_list(Config) ->
%% Test extracting a compressed tar archive from a binary.
- ?line DataDir = ?config(data_dir, Config),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Name = filename:join(DataDir, "cooked_tar_problem.tar.gz"),
- ?line ExtractDir = filename:join(PrivDir, "extract_from_binary_compressed"),
- ?line ok = file:make_dir(ExtractDir),
- ?line {ok,Bin} = file:read_file(Name),
+ DataDir = proplists:get_value(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Name = filename:join(DataDir, "cooked_tar_problem.tar.gz"),
+ ExtractDir = filename:join(PrivDir, "extract_from_binary_compressed"),
+ ok = file:make_dir(ExtractDir),
+ {ok,Bin} = file:read_file(Name),
%% Try taking contents.
- ?line {ok,Files} = erl_tar:table({binary,Bin}, [compressed]),
- ?line io:format("~p\n", [Files]),
- ?line 19 = length(Files),
-
+ {ok,Files} = erl_tar:table({binary,Bin}, [compressed]),
+ io:format("~p\n", [Files]),
+ 19 = length(Files),
+
%% Trying extracting from a binary.
- ?line ok = erl_tar:extract({binary,Bin}, [compressed,{cwd,ExtractDir}]),
- ?line {ok,List} = file:list_dir(filename:join(ExtractDir, "ddll_SUITE_data")),
- ?line io:format("~p\n", [List]),
- ?line 19 = length(List),
+ ok = erl_tar:extract({binary,Bin}, [compressed,{cwd,ExtractDir}]),
+ {ok,List} = file:list_dir(filename:join(ExtractDir, "ddll_SUITE_data")),
+ io:format("~p\n", [List]),
+ 19 = length(List),
%% Clean up while at the same time testing that all file
%% were extracted as expected.
lists:foreach(fun(N) ->
File = filename:join(ExtractDir, N),
io:format("Deleting: ~p\n", [File]),
- ?line ok = file:delete(File)
+ ok = file:delete(File)
end, Files),
%% Clean up the rest.
- ?line delete_files([ExtractDir]),
+ delete_files([ExtractDir]),
ok.
-extract_from_open_file(doc) ->
- "Test extracting a tar archive from an open file.";
+%% Test extracting a tar archive from an open file.
extract_from_open_file(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Long = filename:join(DataDir, "no_fancy_stuff.tar"),
- ?line ExtractDir = filename:join(PrivDir, "extract_from_open_file"),
- ?line ok = file:make_dir(ExtractDir),
+ DataDir = proplists:get_value(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Long = filename:join(DataDir, "no_fancy_stuff.tar"),
+ ExtractDir = filename:join(PrivDir, "extract_from_open_file"),
+ ok = file:make_dir(ExtractDir),
- ?line {ok, File} = file:open(Long, [read]),
- ?line ok = erl_tar:extract({file, File}, [{cwd,ExtractDir}]),
+ {ok, File} = file:open(Long, [read]),
+ ok = erl_tar:extract({file, File}, [{cwd,ExtractDir}]),
%% Verify.
Dir = filename:join(ExtractDir, "no_fancy_stuff"),
- ?line true = filelib:is_dir(Dir),
- ?line true = filelib:is_file(filename:join(Dir, "a_dir_list")),
- ?line true = filelib:is_file(filename:join(Dir, "EPLICENCE")),
+ true = filelib:is_dir(Dir),
+ true = filelib:is_file(filename:join(Dir, "a_dir_list")),
+ true = filelib:is_file(filename:join(Dir, "EPLICENCE")),
%% Close open file.
- ?line ok = file:close(File),
+ ok = file:close(File),
%% Clean up.
- ?line delete_files([ExtractDir]),
+ delete_files([ExtractDir]),
ok.
-symlinks(doc) ->
- "Test that archives containing symlinks can be created and extracted.";
+%% Test that archives containing symlinks can be created and extracted.
symlinks(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Dir = filename:join(PrivDir, "symlinks"),
- ?line ok = file:make_dir(Dir),
- ?line ABadSymlink = filename:join(Dir, "bad_symlink"),
- ?line PointsTo = "/a/definitely/non_existing/path",
- ?line Res = case make_symlink("/a/definitely/non_existing/path", ABadSymlink) of
- {error, enotsup} ->
- {skip, "Symbolic links not supported on this platform"};
- ok ->
- symlinks(Dir, "bad_symlink", PointsTo),
- long_symlink(Dir)
- end,
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Dir = filename:join(PrivDir, "symlinks"),
+ ok = file:make_dir(Dir),
+ ABadSymlink = filename:join(Dir, "bad_symlink"),
+ PointsTo = "/a/definitely/non_existing/path",
+ Res = case make_symlink("/a/definitely/non_existing/path", ABadSymlink) of
+ {error, enotsup} ->
+ {skip, "Symbolic links not supported on this platform"};
+ ok ->
+ symlinks(Dir, "bad_symlink", PointsTo),
+ long_symlink(Dir)
+ end,
%% Clean up.
- ?line delete_files([Dir]),
+ delete_files([Dir]),
Res.
make_symlink(Path, Link) ->
@@ -569,103 +559,103 @@ make_symlink(Path, Link) ->
_ ->
file:make_symlink(Path, Link)
end.
-
+
symlinks(Dir, BadSymlink, PointsTo) ->
- ?line Tar = filename:join(Dir, "symlink.tar"),
- ?line DerefTar = filename:join(Dir, "dereference.tar"),
+ Tar = filename:join(Dir, "symlink.tar"),
+ DerefTar = filename:join(Dir, "dereference.tar"),
%% Create the archive.
- ?line ok = file:set_cwd(Dir),
- ?line GoodSymlink = "good_symlink",
- ?line AFile = "a_good_file",
- ?line ALine = "A line of text for a file.",
- ?line ok = file:write_file(AFile, ALine),
- ?line ok = file:make_symlink(AFile, GoodSymlink),
- ?line ok = erl_tar:create(Tar, [BadSymlink, GoodSymlink, AFile], [verbose]),
+ ok = file:set_cwd(Dir),
+ GoodSymlink = "good_symlink",
+ AFile = "a_good_file",
+ ALine = "A line of text for a file.",
+ ok = file:write_file(AFile, ALine),
+ ok = file:make_symlink(AFile, GoodSymlink),
+ ok = erl_tar:create(Tar, [BadSymlink, GoodSymlink, AFile], [verbose]),
%% List contents of tar file.
- ?line ok = erl_tar:tt(Tar),
+ ok = erl_tar:tt(Tar),
%% Also create another archive with the dereference flag.
- ?line ok = erl_tar:create(DerefTar, [AFile, GoodSymlink], [dereference, verbose]),
+ ok = erl_tar:create(DerefTar, [AFile, GoodSymlink], [dereference, verbose]),
%% Extract files to a new directory.
- ?line NewDir = filename:join(Dir, "extracted"),
- ?line ok = file:make_dir(NewDir),
- ?line ok = erl_tar:extract(Tar, [{cwd, NewDir}, verbose]),
+ NewDir = filename:join(Dir, "extracted"),
+ ok = file:make_dir(NewDir),
+ ok = erl_tar:extract(Tar, [{cwd, NewDir}, verbose]),
%% Verify that the files are there.
- ?line ok = file:set_cwd(NewDir),
- ?line {ok, #file_info{type=symlink}} = file:read_link_info(BadSymlink),
- ?line {ok, PointsTo} = file:read_link(BadSymlink),
- ?line {ok, #file_info{type=symlink}} = file:read_link_info(GoodSymlink),
- ?line {ok, AFile} = file:read_link(GoodSymlink),
- ?line Expected = list_to_binary(ALine),
- ?line {ok, Expected} = file:read_file(GoodSymlink),
+ ok = file:set_cwd(NewDir),
+ {ok, #file_info{type=symlink}} = file:read_link_info(BadSymlink),
+ {ok, PointsTo} = file:read_link(BadSymlink),
+ {ok, #file_info{type=symlink}} = file:read_link_info(GoodSymlink),
+ {ok, AFile} = file:read_link(GoodSymlink),
+ Expected = list_to_binary(ALine),
+ {ok, Expected} = file:read_file(GoodSymlink),
%% Extract the "dereferenced archive" to a new directory.
- ?line NewDirDeref = filename:join(Dir, "extracted_deref"),
- ?line ok = file:make_dir(NewDirDeref),
- ?line ok = erl_tar:extract(DerefTar, [{cwd, NewDirDeref}, verbose]),
+ NewDirDeref = filename:join(Dir, "extracted_deref"),
+ ok = file:make_dir(NewDirDeref),
+ ok = erl_tar:extract(DerefTar, [{cwd, NewDirDeref}, verbose]),
%% Verify that the files are there.
- ?line ok = file:set_cwd(NewDirDeref),
- ?line {ok, #file_info{type=regular}} = file:read_link_info(GoodSymlink),
- ?line {ok, #file_info{type=regular}} = file:read_link_info(AFile),
- ?line {ok, Expected} = file:read_file(GoodSymlink),
- ?line {ok, Expected} = file:read_file(AFile),
+ ok = file:set_cwd(NewDirDeref),
+ {ok, #file_info{type=regular}} = file:read_link_info(GoodSymlink),
+ {ok, #file_info{type=regular}} = file:read_link_info(AFile),
+ {ok, Expected} = file:read_file(GoodSymlink),
+ {ok, Expected} = file:read_file(AFile),
ok.
long_symlink(Dir) ->
- ?line Tar = filename:join(Dir, "long_symlink.tar"),
- ?line ok = file:set_cwd(Dir),
-
- ?line AFile = "long_symlink",
- ?line FarTooLong = "/tmp/aarrghh/this/path/is/far/longer/than/one/hundred/characters/which/is/the/maximum/number/of/characters/allowed",
- ?line ok = file:make_symlink(FarTooLong, AFile),
- ?line {error,Error} = erl_tar:create(Tar, [AFile], [verbose]),
- ?line io:format("Error: ~s\n", [erl_tar:format_error(Error)]),
- ?line {FarTooLong,symbolic_link_too_long} = Error,
+ Tar = filename:join(Dir, "long_symlink.tar"),
+ ok = file:set_cwd(Dir),
+
+ AFile = "long_symlink",
+ FarTooLong = "/tmp/aarrghh/this/path/is/far/longer/than/one/hundred/characters/which/is/the/maximum/number/of/characters/allowed",
+ ok = file:make_symlink(FarTooLong, AFile),
+ {error,Error} = erl_tar:create(Tar, [AFile], [verbose]),
+ io:format("Error: ~s\n", [erl_tar:format_error(Error)]),
+ {FarTooLong,symbolic_link_too_long} = Error,
ok.
open_add_close(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line ok = file:set_cwd(PrivDir),
- ?line Dir = filename:join(PrivDir, "open_add_close"),
- ?line ok = file:make_dir(Dir),
-
- ?line [{FileOne,_,_},{FileTwo,_,_},{FileThree,_,_}] = oac_files(),
- ?line ADir = "empty_dir",
- ?line AnotherDir = "another_dir",
- ?line SomeContent = filename:join(AnotherDir, "some_content"),
- ?line ok = file:make_dir(ADir),
- ?line ok = file:make_dir(AnotherDir),
- ?line ok = file:make_dir(SomeContent),
-
- ?line TarOne = filename:join(Dir, "archive1.tar"),
- ?line {ok,AD} = erl_tar:open(TarOne, [write]),
- ?line ok = erl_tar:add(AD, FileOne, []),
- ?line ok = erl_tar:add(AD, FileTwo, "second file", []),
- ?line ok = erl_tar:add(AD, FileThree, [verbose]),
- ?line ok = erl_tar:add(AD, FileThree, "chunked", [{chunks,11411},verbose]),
- ?line ok = erl_tar:add(AD, ADir, [verbose]),
- ?line ok = erl_tar:add(AD, AnotherDir, [verbose]),
- ?line ok = erl_tar:close(AD),
-
- ?line ok = erl_tar:t(TarOne),
- ?line ok = erl_tar:tt(TarOne),
-
- ?line {ok,[FileOne,"second file",FileThree,"chunked",ADir,SomeContent]} = erl_tar:table(TarOne),
-
- ?line delete_files(["oac_file","oac_small","oac_big",Dir,AnotherDir,ADir]),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ ok = file:set_cwd(PrivDir),
+ Dir = filename:join(PrivDir, "open_add_close"),
+ ok = file:make_dir(Dir),
+
+ [{FileOne,_,_},{FileTwo,_,_},{FileThree,_,_}] = oac_files(),
+ ADir = "empty_dir",
+ AnotherDir = "another_dir",
+ SomeContent = filename:join(AnotherDir, "some_content"),
+ ok = file:make_dir(ADir),
+ ok = file:make_dir(AnotherDir),
+ ok = file:make_dir(SomeContent),
+
+ TarOne = filename:join(Dir, "archive1.tar"),
+ {ok,AD} = erl_tar:open(TarOne, [write]),
+ ok = erl_tar:add(AD, FileOne, []),
+ ok = erl_tar:add(AD, FileTwo, "second file", []),
+ ok = erl_tar:add(AD, FileThree, [verbose]),
+ ok = erl_tar:add(AD, FileThree, "chunked", [{chunks,11411},verbose]),
+ ok = erl_tar:add(AD, ADir, [verbose]),
+ ok = erl_tar:add(AD, AnotherDir, [verbose]),
+ ok = erl_tar:close(AD),
+
+ ok = erl_tar:t(TarOne),
+ ok = erl_tar:tt(TarOne),
+
+ {ok,[FileOne,"second file",FileThree,"chunked",ADir,SomeContent]} = erl_tar:table(TarOne),
+
+ delete_files(["oac_file","oac_small","oac_big",Dir,AnotherDir,ADir]),
ok.
@@ -678,60 +668,59 @@ oac_files() ->
cooked_compressed(Config) when is_list(Config) ->
%% Test that a compressed archive can be read in cooked mode.
- ?line DataDir = ?config(data_dir, Config),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Name = filename:join(DataDir, "cooked_tar_problem.tar.gz"),
+ DataDir = proplists:get_value(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Name = filename:join(DataDir, "cooked_tar_problem.tar.gz"),
%% Try table/2 and extract/2.
- ?line {ok,List} = erl_tar:table(Name, [cooked,compressed]),
- ?line io:format("~p\n", [List]),
- ?line 19 = length(List),
- ?line ok = erl_tar:extract(Name, [cooked,compressed,{cwd,PrivDir}]),
+ {ok,List} = erl_tar:table(Name, [cooked,compressed]),
+ io:format("~p\n", [List]),
+ 19 = length(List),
+ ok = erl_tar:extract(Name, [cooked,compressed,{cwd,PrivDir}]),
%% Clean up while at the same time testing that all file
%% were extracted as expected.
lists:foreach(fun(N) ->
File = filename:join(PrivDir, N),
io:format("Deleting: ~p\n", [File]),
- ?line ok = file:delete(File)
+ ok = file:delete(File)
end, List),
%% Clean up.
- ?line delete_files([filename:join(PrivDir, "ddll_SUITE_data")]),
+ delete_files([filename:join(PrivDir, "ddll_SUITE_data")]),
ok.
-memory(doc) ->
- ["Test that an archive can be created directly from binaries and "
- "that an archive can be extracted into binaries."];
+%% Test that an archive can be created directly from binaries and
+%% that an archive can be extracted into binaries.
memory(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
-
- ?line FileBins = [{"bar/fum", <<"BARFUM">>},{"foo", <<"FOO">>}],
- ?line Name1 = filename:join(DataDir, "memory.tar"),
- ?line ok = erl_tar:create(Name1, FileBins, [write,verbose]),
- ?line {ok,Extracted1} = erl_tar:extract(Name1, [memory,verbose]),
- ?line FileBins1 = lists:sort(Extracted1),
-
- ?line io:format("FileBins: ~p\n", [FileBins]),
- ?line io:format("FileBins1: ~p\n", [FileBins1]),
- ?line FileBins = FileBins1,
-
- ?line Name2 = filename:join(DataDir, "memory2.tar"),
- ?line {ok,Fd} = erl_tar:open(Name2, [write]),
- ?line [ok,ok] = [erl_tar:add(Fd, B, N, [write,verbose]) || {N,B} <- FileBins],
- ?line ok = erl_tar:close(Fd),
- ?line {ok,Extracted2} = erl_tar:extract(Name2, [memory,verbose]),
- ?line FileBins2 = lists:sort(Extracted2),
- ?line io:format("FileBins2: ~p\n", [FileBins2]),
- ?line FileBins = FileBins2,
+ DataDir = proplists:get_value(data_dir, Config),
+
+ FileBins = [{"bar/fum", <<"BARFUM">>},{"foo", <<"FOO">>}],
+ Name1 = filename:join(DataDir, "memory.tar"),
+ ok = erl_tar:create(Name1, FileBins, [write,verbose]),
+ {ok,Extracted1} = erl_tar:extract(Name1, [memory,verbose]),
+ FileBins1 = lists:sort(Extracted1),
+
+ io:format("FileBins: ~p\n", [FileBins]),
+ io:format("FileBins1: ~p\n", [FileBins1]),
+ FileBins = FileBins1,
+
+ Name2 = filename:join(DataDir, "memory2.tar"),
+ {ok,Fd} = erl_tar:open(Name2, [write]),
+ [ok,ok] = [erl_tar:add(Fd, B, N, [write,verbose]) || {N,B} <- FileBins],
+ ok = erl_tar:close(Fd),
+ {ok,Extracted2} = erl_tar:extract(Name2, [memory,verbose]),
+ FileBins2 = lists:sort(Extracted2),
+ io:format("FileBins2: ~p\n", [FileBins2]),
+ FileBins = FileBins2,
%% Clean up.
- ?line ok = delete_files([Name1,Name2]),
+ ok = delete_files([Name1,Name2]),
ok.
%% Test filenames with characters outside the US ASCII range.
unicode(Config) when is_list(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
do_unicode(PrivDir),
case has_transparent_naming() of
true ->
@@ -811,7 +800,7 @@ delete_files([Item|Rest]) ->
%% 260 characters.
run_in_short_tempdir(Config, Fun) ->
{ok,Cwd} = file:get_cwd(),
- PrivDir0 = ?config(priv_dir, Config),
+ PrivDir0 = proplists:get_value(priv_dir, Config),
%% Normalize name to make sure that there is no slash at the end.
PrivDir = filename:absname(PrivDir0),
@@ -850,7 +839,7 @@ start_node(Name, Args) ->
ct:log("Trying to start ~w@~s~n", [Name,Host]),
case test_server:start_node(Name, peer, [{args,Args}]) of
{error,Reason} ->
- test_server:fail(Reason);
+ ct:fail(Reason);
{ok,Node} ->
ct:log("Node ~p started~n", [Node]),
Node
diff --git a/lib/stdlib/test/timer_SUITE.erl b/lib/stdlib/test/timer_SUITE.erl
index e4d656c9bf..d4bbd39d50 100644
--- a/lib/stdlib/test/timer_SUITE.erl
+++ b/lib/stdlib/test/timer_SUITE.erl
@@ -41,7 +41,9 @@
%% reasonable on different machines; therefore the test can sometimes
%% fail, even though the timer module is ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,20}}].
all() ->
[do_big_test].
@@ -65,15 +67,13 @@ end_per_group(_GroupName, Config) ->
%% ------------------------------------------------------- %%
do_big_test(TConfig) when is_list(TConfig) ->
- Dog = ?t:timetrap(?t:minutes(20)),
Save = process_flag(trap_exit, true),
Result = big_test(200),
process_flag(trap_exit, Save),
- ?t:timetrap_cancel(Dog),
report_result(Result).
report_result(ok) -> ok;
-report_result(Error) -> ?line test_server:fail(Error).
+report_result(Error) -> ct:fail(Error).
%% ------------------------------------------------------- %%
@@ -98,7 +98,7 @@ big_test(N) ->
Result = analyze_report(Report),
%%io:format("big_test is done: ~w~n", [Result]),
Result.
-
+
big_loop(_C, 0, []) ->
%%io:format("All processes are done!~n", []),
ok;
@@ -109,8 +109,8 @@ big_loop(C, 0, Pids) ->
{'EXIT', Pid, done} ->
big_loop(C, 0, lists:delete(Pid, Pids));
{'EXIT', Pid, Error} ->
- ?line ok = io:format("XXX Pid ~w died with reason ~p~n",
- [Pid, Error]),
+ ok = io:format("XXX Pid ~w died with reason ~p~n",
+ [Pid, Error]),
big_loop(C, 0, lists:delete(Pid, Pids))
end;
big_loop(C, N, Pids) ->
@@ -119,14 +119,14 @@ big_loop(C, N, Pids) ->
{'EXIT', Pid, done} ->
big_loop(C, N, lists:delete(Pid, Pids));
{'EXIT', Pid, Error} ->
- ?line ok =io:format("XXX Internal error: Pid ~w died, reason ~p~n",
- [Pid, Error]),
+ ok =io:format("XXX Internal error: Pid ~w died, reason ~p~n",
+ [Pid, Error]),
big_loop(C, N, lists:delete(Pid, Pids))
after 0 ->
%% maybe start an interval timer test
Pids1 = maybe_start_i_test(Pids, C, rand:uniform(4)),
-
+
%% start 1-4 "after" tests
Pids2 = start_after_test(Pids1, C, rand:uniform(4)),
%%Pids2=Pids1,
@@ -136,7 +136,7 @@ big_loop(C, N, Pids) ->
%% spawn zero, one or two nrev to get some load ;-/
Pids3 = start_nrev(Pids2, rand:uniform(100)),
-
+
big_loop(C, N-1, Pids3)
end.
@@ -149,7 +149,7 @@ start_nrev(Pids, _N) ->
NrevPid1 = spawn_link(timer_SUITE, do_nrev, [rand:uniform(1000)*10]),
NrevPid2 = spawn_link(timer_SUITE, do_nrev, [1]),
[NrevPid1,NrevPid2|Pids].
-
+
start_after_test(Pids, C, 1) ->
TO1 = rand:uniform(100)*47,
@@ -177,8 +177,8 @@ a_t(C, TimeOut) ->
watchdog ->
Stop = system_time(),
report(C, Start,Stop,TimeOut),
- ?line ok = io:format("Internal watchdog timeout (a), not good!!~n",
- []),
+ ok = io:format("Internal watchdog timeout (a), not good!!~n",
+ []),
exit(done)
end.
@@ -208,8 +208,8 @@ i_wait(Start, Prev, Times, TimeOut, Times, Ref, C) ->
Now = system_time(),
report_interval(C, {final,Times}, Start, Prev, Now, TimeOut),
timer:cancel(Ref),
- ?line ok = io:format("Internal watchdog timeout (i), not good!!~n",
- []),
+ ok = io:format("Internal watchdog timeout (i), not good!!~n",
+ []),
exit(done)
end;
i_wait(Start, Prev, Count, TimeOut, Times, Ref, C) ->
@@ -221,8 +221,8 @@ i_wait(Start, Prev, Count, TimeOut, Times, Ref, C) ->
watchdog ->
Now = system_time(),
report_interval(C, {final,Count}, Start, Prev, Now, TimeOut),
- ?line ok = io:format("Internal watchdog timeout (j), not good!!~n",
- []),
+ ok = io:format("Internal watchdog timeout (j), not good!!~n",
+ []),
exit(done)
end.
@@ -289,13 +289,6 @@ update(New, Stat) when New < Stat#stat.min ->
update(New, Stat) ->
Stat#stat{n=Stat#stat.n + 1, avg=(New+Stat#stat.avg) div 2}.
-%update(New, {N,Max,Min,Avg}) when New>Max ->
-% {N+1,New,Min,(New+Avg) div 2};
-%update(New, {N,Max,Min,Avg}) when New<Min ->
-% {N+1,Max,New,(New+Avg) div 2};
-%update(New, {N,Max,Min,Avg}) ->
-% {N+1,Max,Min,(New+Avg) div 2}.
-
print_report({E,LateS,EarlyS,I}) ->
Early = EarlyS#stat.n, Late = LateS#stat.n,
Total = E + Early + Late,
@@ -379,10 +372,10 @@ nrev([]) ->
[];
nrev([H|T]) ->
append(nrev(T), [H]).
-
+
append([H|T],Z) ->
- [H|append(T,Z)];
+ [H|append(T,Z)];
append([],X) ->
- X.
+ X.
%% ------------------------------------------------------- %%
diff --git a/lib/stdlib/test/timer_simple_SUITE.erl b/lib/stdlib/test/timer_simple_SUITE.erl
index 42b96c4b1c..64fce2a4b2 100644
--- a/lib/stdlib/test/timer_simple_SUITE.erl
+++ b/lib/stdlib/test/timer_simple_SUITE.erl
@@ -56,7 +56,9 @@
-define(MAXREF, (1 bsl 18)).
-define(REFMARG, 30).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,10}}].
all() ->
[apply_after, send_after1, send_after2, send_after3,
@@ -87,222 +89,198 @@ init_per_testcase(_, Config) when is_list(Config) ->
%% Testing timer interface!!
-apply_after(doc) -> "Test of apply_after, with sending of message.";
-apply_after(suite) -> [];
+%% Test of apply_after, with sending of message.
apply_after(Config) when is_list(Config) ->
- ?line timer:apply_after(500, ?MODULE, send, [self(), ok_apply]),
- ?line ok = get_mess(1000, ok_apply).
+ timer:apply_after(500, ?MODULE, send, [self(), ok_apply]),
+ ok = get_mess(1000, ok_apply).
-send_after1(doc) -> "Test of send_after with time = 0.";
-send_after1(suite) -> [];
+%% Test of send_after with time = 0.
send_after1(Config) when is_list(Config) ->
- ?line timer:send_after(0, ok_send1),
- ?line ok = get_mess(1000, ok_send1).
+ timer:send_after(0, ok_send1),
+ ok = get_mess(1000, ok_send1).
-send_after2(doc) -> "Test of send_after with time = 500.";
-send_after2(suite) -> [];
+%% Test of send_after with time = 500.
send_after2(Config) when is_list(Config) ->
- ?line timer:send_after(500, self(), ok_send2),
- ?line ok = get_mess(2000, ok_send2).
+ timer:send_after(500, self(), ok_send2),
+ ok = get_mess(2000, ok_send2).
-send_after3(doc) -> "Test of send_after with time = 500, with receiver "
- "a registered process. [OTP-2735]";
-send_after3(suite) -> [];
+%% Test of send_after with time = 500, with receiver a registered
+%% process. [OTP-2735]
send_after3(Config) when is_list(Config) ->
- ?line Name = list_to_atom(pid_to_list(self())),
- ?line register(Name, self()),
- ?line timer:send_after(500, Name, ok_send3),
- ?line ok = get_mess(2000, ok_send3),
- ?line unregister(Name).
-
-exit_after1(doc) -> "Test of exit_after with time = 1000.";
-exit_after1(suite) -> [];
+ Name = list_to_atom(pid_to_list(self())),
+ register(Name, self()),
+ timer:send_after(500, Name, ok_send3),
+ ok = get_mess(2000, ok_send3),
+ unregister(Name).
+
+%% Test of exit_after with time = 1000.
exit_after1(Config) when is_list(Config) ->
- ?line process_flag(trap_exit, true),
- ?line Pid = spawn_link(?MODULE, forever, []),
- ?line timer:exit_after(1000, Pid, exit_test1),
- ?line ok = get_mess(5000, {'EXIT', Pid, exit_test1}).
-
-exit_after2(doc) -> "Test of exit_after with time = 1000. The process to "
- "exit is the name of a registered process. "
- "[OTP-2735]";
-exit_after2(suite) -> [];
+ process_flag(trap_exit, true),
+ Pid = spawn_link(?MODULE, forever, []),
+ timer:exit_after(1000, Pid, exit_test1),
+ ok = get_mess(5000, {'EXIT', Pid, exit_test1}).
+
+%% Test of exit_after with time = 1000. The process to exit is the
+%% name of a registered process. [OTP-2735]
exit_after2(Config) when is_list(Config) ->
- ?line process_flag(trap_exit, true),
- ?line Pid = spawn_link(?MODULE, forever, []),
- ?line Name = list_to_atom(pid_to_list(Pid)),
- ?line register(Name, Pid),
- ?line timer:exit_after(1000, Name, exit_test2),
- ?line ok = get_mess(2000, {'EXIT', Pid, exit_test2}).
-
-kill_after1(doc) -> "Test of kill_after with time = 1000.";
-kill_after1(suite) -> [];
+ process_flag(trap_exit, true),
+ Pid = spawn_link(?MODULE, forever, []),
+ Name = list_to_atom(pid_to_list(Pid)),
+ register(Name, Pid),
+ timer:exit_after(1000, Name, exit_test2),
+ ok = get_mess(2000, {'EXIT', Pid, exit_test2}).
+
+%% Test of kill_after with time = 1000.
kill_after1(Config) when is_list(Config) ->
- ?line process_flag(trap_exit, true),
- ?line Pid = spawn_link(?MODULE, forever, []),
- ?line timer:kill_after(1000, Pid),
- ?line ok = get_mess(2000, {'EXIT', Pid, killed}).
-
-kill_after2(doc) -> "Test of kill_after with time = 1000. The process to "
- "exit is the name of a registered process. "
- "[OTP-2735]";
-kill_after2(suite) -> [];
+ process_flag(trap_exit, true),
+ Pid = spawn_link(?MODULE, forever, []),
+ timer:kill_after(1000, Pid),
+ ok = get_mess(2000, {'EXIT', Pid, killed}).
+
+%% Test of kill_after with time = 1000. The process to exit is the
+%% name of a registered process. [OTP-2735]
kill_after2(Config) when is_list(Config) ->
- ?line process_flag(trap_exit, true),
- ?line Pid = spawn_link(?MODULE, forever, []),
- ?line Name = list_to_atom(pid_to_list(Pid)),
- ?line register(Name, Pid),
- ?line timer:kill_after(1000, Name),
- ?line ok = get_mess(2000, {'EXIT', Pid, killed}).
-
-apply_interval(doc) -> "Test of apply_interval by sending messages. Receive "
- "3 messages, cancel the timer, and check that we do "
- "not get any more messages.";
-apply_interval(suite) -> [];
+ process_flag(trap_exit, true),
+ Pid = spawn_link(?MODULE, forever, []),
+ Name = list_to_atom(pid_to_list(Pid)),
+ register(Name, Pid),
+ timer:kill_after(1000, Name),
+ ok = get_mess(2000, {'EXIT', Pid, killed}).
+
+%% Test of apply_interval by sending messages. Receive
+%% 3 messages, cancel the timer, and check that we do
+%% not get any more messages.
apply_interval(Config) when is_list(Config) ->
- ?line {ok, Ref} = timer:apply_interval(1000, ?MODULE, send,
+ {ok, Ref} = timer:apply_interval(1000, ?MODULE, send,
[self(), apply_int]),
- ?line ok = get_mess(1500, apply_int, 3),
- ?line timer:cancel(Ref),
- ?line nor = get_mess(1000, apply_int).
-
-send_interval1(doc) -> "Test of send_interval/2. Receive 5 messages, cancel "
- "the timer, and check that we do not get any more "
- "messages.";
-send_interval1(suite) -> [];
+ ok = get_mess(1500, apply_int, 3),
+ timer:cancel(Ref),
+ nor = get_mess(1000, apply_int).
+
+%% Test of send_interval/2. Receive 5 messages, cancel the timer, and
+%% check that we do not get any more messages.
send_interval1(Config) when is_list(Config) ->
{ok, Ref} = timer:send_interval(1000, send_int),
- ?line ok = get_mess(1500, send_int, 5),
+ ok = get_mess(1500, send_int, 5),
timer:cancel(Ref),
- ?line nor = get_mess(1000, send_int). % We should receive only five
+ nor = get_mess(1000, send_int). % We should receive only five
-send_interval2(doc) -> "Test of send_interval/3. Receive 2 messages, cancel "
- "the timer, and check that we do not get any more "
- "messages.";
-send_interval2(suite) -> [];
+%% Test of send_interval/3. Receive 2 messages, cancel the timer, and
+%% check that we do not get any more messages.
send_interval2(Config) when is_list(Config) ->
{ok, Ref} = timer:send_interval(1000, self(), send_int2),
- ?line ok = get_mess(1500, send_int2, 2),
+ ok = get_mess(1500, send_int2, 2),
timer:cancel(Ref),
- ?line nor = get_mess(1000, send_int2). % We should receive only two
+ nor = get_mess(1000, send_int2). % We should receive only two
-send_interval3(doc) -> "Test of send_interval/3. Receive 2 messages, cancel "
- "the timer, and check that we do not get any more "
- "messages. The receiver is the name of a registered "
- "process. [OTP-2735]";
-send_interval3(suite) -> [];
+%% Test of send_interval/3. Receive 2 messages, cancel the timer, and
+%% check that we do not get any more messages. The receiver is the
+%% name of a registered process. [OTP-2735]
send_interval3(Config) when is_list(Config) ->
- ?line process_flag(trap_exit, true),
- ?line Name = list_to_atom(pid_to_list(self())),
- ?line register(Name, self()),
- ?line {ok, Ref} = timer:send_interval(1000, Name, send_int3),
- ?line ok = get_mess(1500, send_int3, 2),
+ process_flag(trap_exit, true),
+ Name = list_to_atom(pid_to_list(self())),
+ register(Name, self()),
+ {ok, Ref} = timer:send_interval(1000, Name, send_int3),
+ ok = get_mess(1500, send_int3, 2),
timer:cancel(Ref),
- ?line nor = get_mess(1000, send_int3), % We should receive only two
- ?line unregister(Name).
+ nor = get_mess(1000, send_int3), % We should receive only two
+ unregister(Name).
-send_interval4(doc) -> "Test that send interval stops sending msg when the "
- "receiving process terminates.";
-send_interval4(suite) -> [];
+%% Test that send interval stops sending msg when the receiving
+%% process terminates.
send_interval4(Config) when is_list(Config) ->
- ?line timer:send_interval(500, one_time_only),
+ timer:send_interval(500, one_time_only),
receive
one_time_only -> ok
end,
- ?line timer_server ! {'EXIT', self(), normal}, % Should remove the timer
- ?line timer:send_after(600, send_intv_ok),
- ?line send_intv_ok = receive
- Msg -> Msg
- end.
-
-cancel1(doc) -> "Test that we can cancel a timer.";
-cancel1(suite) -> [];
+ timer_server ! {'EXIT', self(), normal}, % Should remove the timer
+ timer:send_after(600, send_intv_ok),
+ send_intv_ok = receive
+ Msg -> Msg
+ end.
+
+%% Test that we can cancel a timer.
cancel1(Config) when is_list(Config) ->
- ?line {ok, Ref} = timer:send_after(1000, this_should_be_canceled),
- ?line timer:cancel(Ref),
- ?line nor = get_mess(2000, this_should_be_canceled). % We should rec 0 msgs
+ {ok, Ref} = timer:send_after(1000, this_should_be_canceled),
+ timer:cancel(Ref),
+ nor = get_mess(2000, this_should_be_canceled). % We should rec 0 msgs
-cancel2(doc) -> "Test cancel/1 with bad argument.";
-cancel2(suite) -> [];
+%% Test cancel/1 with bad argument.
cancel2(Config) when is_list(Config) ->
- ?line {error, badarg} = timer:cancel(no_reference).
+ {error, badarg} = timer:cancel(no_reference).
-tc(doc) -> "Test sleep/1 and tc/3.";
-tc(suite) -> [];
+%% Test sleep/1 and tc/3.
tc(Config) when is_list(Config) ->
%% This should test both sleep and tc/3
- ?line {Res1, ok} = timer:tc(timer, sleep, [500]),
- ?line ok = if
+ {Res1, ok} = timer:tc(timer, sleep, [500]),
+ ok = if
Res1 < 500*1000 -> {too_early, Res1}; % Too early
Res1 > 800*1000 -> {too_late, Res1}; % Too much time
true -> ok
end,
%% tc/2
- ?line {Res2, ok} = timer:tc(fun(T) -> timer:sleep(T) end, [500]),
- ?line ok = if
+ {Res2, ok} = timer:tc(fun(T) -> timer:sleep(T) end, [500]),
+ ok = if
Res2 < 500*1000 -> {too_early, Res2}; % Too early
Res2 > 800*1000 -> {too_late, Res2}; % Too much time
true -> ok
end,
-
+
%% tc/1
- ?line {Res3, ok} = timer:tc(fun() -> timer:sleep(500) end),
- ?line ok = if
+ {Res3, ok} = timer:tc(fun() -> timer:sleep(500) end),
+ ok = if
Res3 < 500*1000 -> {too_early, Res3}; % Too early
Res3 > 800*1000 -> {too_late, Res3}; % Too much time
true -> ok
end,
%% Check that timer:tc don't catch errors
- ?line ok = try timer:tc(erlang, exit, [foo])
- catch exit:foo -> ok
- end,
-
- ?line ok = try timer:tc(fun(Reason) -> 1 = Reason end, [foo])
- catch error:{badmatch,_} -> ok
- end,
-
- ?line ok = try timer:tc(fun() -> throw(foo) end)
- catch foo -> ok
- end,
-
+ ok = try timer:tc(erlang, exit, [foo])
+ catch exit:foo -> ok
+ end,
+
+ ok = try timer:tc(fun(Reason) -> 1 = Reason end, [foo])
+ catch error:{badmatch,_} -> ok
+ end,
+
+ ok = try timer:tc(fun() -> throw(foo) end)
+ catch foo -> ok
+ end,
+
%% Check that return values are propageted
Self = self(),
- ?line {_, Self} = timer:tc(erlang, self, []),
- ?line {_, Self} = timer:tc(fun(P) -> P end, [self()]),
- ?line {_, Self} = timer:tc(fun() -> self() end),
-
- ?line Sec = timer:seconds(4),
- ?line Min = timer:minutes(4),
- ?line Hour = timer:hours(4),
- ?line MyRes = 4*1000 + 4*60*1000 + 4*60*60*1000,
- ?line if MyRes == Sec + Min + Hour -> ok end,
- ?line TimerRes = timer:hms(4,4,4),
- ?line if MyRes == TimerRes -> ok end,
+ {_, Self} = timer:tc(erlang, self, []),
+ {_, Self} = timer:tc(fun(P) -> P end, [self()]),
+ {_, Self} = timer:tc(fun() -> self() end),
+
+ Sec = timer:seconds(4),
+ Min = timer:minutes(4),
+ Hour = timer:hours(4),
+ MyRes = 4*1000 + 4*60*1000 + 4*60*60*1000,
+ if MyRes == Sec + Min + Hour -> ok end,
+ TimerRes = timer:hms(4,4,4),
+ if MyRes == TimerRes -> ok end,
ok.
-unique_refs(doc) ->
- "Tests that cancellations of one-shot timers do not accidentally "
- "cancel interval timers [OTP-2771].";
-unique_refs(suite) ->
- [];
+%% Test that cancellations of one-shot timers do not accidentally
+%% cancel interval timers. [OTP-2771].
unique_refs(Config) when is_list(Config) ->
- ?line ITimers = repeat_send_interval(10), % 10 interval timers
- ?line eat_refs(?MAXREF - ?REFMARG),
- ?line set_and_cancel_one_shots(?REFMARG),
- ?line NumLeft = num_timers(),
- ?line io:format("~w timers left, should be 10\n", [NumLeft]),
- ?line cancel(ITimers),
- ?line receive_nisse(),
- ?line 10 = NumLeft.
+ ITimers = repeat_send_interval(10), % 10 interval timers
+ eat_refs(?MAXREF - ?REFMARG),
+ set_and_cancel_one_shots(?REFMARG),
+ NumLeft = num_timers(),
+ io:format("~w timers left, should be 10\n", [NumLeft]),
+ cancel(ITimers),
+ receive_nisse(),
+ 10 = NumLeft.
repeat_send_interval(0) ->
[];
repeat_send_interval(M) ->
- ?line {ok, Ref} = timer:send_interval(6000,self(), nisse),
- ?line [Ref| repeat_send_interval(M - 1)].
+ {ok, Ref} = timer:send_interval(6000,self(), nisse),
+ [Ref| repeat_send_interval(M - 1)].
eat_refs(0) ->
0;
@@ -320,8 +298,8 @@ set_and_cancel_one_shots(N) ->
set_and_cancel_one_shots(N-1).
cancel([T| Ts]) ->
- ?line timer:cancel(T),
- ?line cancel(Ts);
+ timer:cancel(T),
+ cancel(Ts);
cancel([]) ->
ok.
@@ -344,7 +322,7 @@ get_mess(Time, Mess, N) ->
receive
Mess -> get_mess(Time, Mess, N-1)
after Time
- -> nor % Not Received
+ -> nor % Not Received
end.
forever() ->
@@ -352,16 +330,13 @@ forever() ->
forever().
-%
-% Testing for performance (on different implementations) of timers
-%
+%%
+%% Testing for performance (on different implementations) of timers
+%%
+
-timer_perf(suite) -> [];
timer_perf(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:minutes(10)),
- Res = performance(timer),
- ?t:timetrap_cancel(Dog),
- Res.
+ performance(timer).
performance(Mod) ->
process_flag(trap_exit, true),
@@ -374,7 +349,7 @@ performance(Mod) ->
big_test(M) ->
Load_Pids = start_nrev(20, M), % Increase if more load wanted :)
-
+
LPids = spawn_timers(5, M, 10000, 5),
apply(M, sleep, [4000]),
@@ -384,7 +359,7 @@ big_test(M) ->
SPids = spawn_timers(15, M, 100, 3),
Res = wait(SPids ++ MPids ++ LPids, [], 0, M),
-
+
lists:foreach(fun(Pid) -> exit(Pid, kill) end, Load_Pids),
Res.
@@ -395,12 +370,12 @@ wait(Pids, ResList, N, M) ->
{Pid, ok, Res, T} ->
wait(lists:delete(Pid, Pids), [{T, Res} | ResList], N, M);
{Pid, Error}->
- ?line test_server:fail(Error),
+ ct:fail(Error),
wait(lists:delete(Pid, Pids), ResList, N+1, M);
{'EXIT', Pid, normal} ->
wait(lists:delete(Pid, Pids), ResList, N, M);
{'EXIT', Pid, Reason} ->
- ?line test_server:fail({Pid,Reason})
+ ct:fail({Pid,Reason})
end.
spawn_timers(0, _, _, _) ->
@@ -440,7 +415,6 @@ timer_irec(Start, T, {N, Max}, Res, {Pid, Mod, Ref}) ->
done ->
Now = system_time(),
Elapsed = (Now - (Start + (N*T*1000))) div 1000,
-% io:format("~w Now ~w Started ~w Elap ~w~n", [T,Now,Start,Elapsed]),
timer_irec(Start, T,
{N+1, Max},
[Elapsed | Res],
@@ -476,11 +450,11 @@ nrev([]) ->
[];
nrev([H|T]) ->
append(nrev(T), [H]).
-
+
append([H|T],Z) ->
- [H|append(T,Z)];
+ [H|append(T,Z)];
append([],X) ->
- X.
+ X.
system_time() ->
erlang:monotonic_time(micro_seconds).
@@ -488,7 +462,6 @@ system_time() ->
%% ------------------------------------------------------- %%
report_result({Res, 0}) ->
-% io:format("DEBUG0 all ~p ~n", [Res]),
{A_List, I_List} = split_list(Res, [], []),
A_val = calc_a_val(A_List),
I_val = calc_i_val(I_List),
@@ -497,7 +470,7 @@ report_result({Res, 0}) ->
report_result({Head, N}) ->
io:format("Test Failed: Number of internal tmo ~w~n", [N]),
- ?line test_server:fail({Head, N}).
+ ct:fail({Head, N}).
split_list([], AL, IL) ->
{AL, IL};
@@ -547,11 +520,11 @@ get_ivals(List) ->
LTot = lists:map(fun(X) -> element(2, X) end, List),
LMin = lists:map(fun(X) -> element(4, X) end, List),
LMax = lists:map(fun(X) -> element(5, X) end, List),
-
+
MaxTot = lists:max(LTot),
MinTot = lists:min(LTot),
AverTot = lists:sum(LTot) div Len,
-
+
IterMax = lists:max(LMax),
IterMin = lists:min(LMin),
IterAver= AverTot div Num,
diff --git a/lib/stdlib/test/unicode_SUITE.erl b/lib/stdlib/test/unicode_SUITE.erl
index f45e00928e..d2ee5d19a4 100644
--- a/lib/stdlib/test/unicode_SUITE.erl
+++ b/lib/stdlib/test/unicode_SUITE.erl
@@ -37,16 +37,16 @@
ex_binaries_errors_utf16_big/1,
ex_binaries_errors_utf32_little/1,
ex_binaries_errors_utf32_big/1]).
-
-init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) ->
- Dog=?t:timetrap(?t:minutes(20)),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog).
+init_per_testcase(_Case, Config) ->
+ Config.
+
+end_per_testcase(_Case, _Config) ->
+ ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,20}}].
all() ->
[utf8_illegal_sequences_bif,
@@ -80,7 +80,7 @@ binaries_errors_limit(Config) when is_list(Config) ->
ex_binaries_errors_utf8(Config),
setlimit(default),
ok.
-
+
ex_binaries_errors_utf8(Config) when is_list(Config) ->
%% Original smoke test, we should not forget the original offset...
<<_:8,_:8,RR2/binary>> = <<$a,$b,164,165,$c>>,
@@ -151,10 +151,10 @@ utf16_inner_loop([_|List], BrokenPart, BrokenSz, PartlyBroken, PBSz, Endian) ->
utf16_inner_loop(List, BrokenPart, BrokenSz, PartlyBroken, PBSz, Endian);
utf16_inner_loop([], _, _, _, _, _) ->
ok.
-
+
ex_binaries_errors_utf32_big(Config) when is_list(Config) ->
ex_binaries_errors_utf32(big).
-
+
ex_binaries_errors_utf32_little(Config) when is_list(Config) ->
ex_binaries_errors_utf32(little).
@@ -180,7 +180,7 @@ ex_binaries_errors_utf32(Endian) ->
PartlyBroken, PBSz, Endian)
end || N <- lists:seq(1, 16, 3) ],
ok.
-
+
utf32_inner_loop([_|List], BrokenPart, BrokenSz, PartlyBroken, PBSz, Endian) ->
Sz = length(List)*4 + BrokenSz,
Chomped = binary:part(PartlyBroken, PBSz - Sz, Sz),
@@ -199,115 +199,115 @@ exceptions(Config) when is_list(Config) ->
ex_exceptions(Config).
ex_exceptions(Config) when is_list(Config) ->
- ?line L = lists:seq(0,255),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L++255,unicode)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary({1,2,3},unicode)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1,unicode)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1.0,unicode)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary('1',unicode)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,apa],unicode)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,4.0],unicode)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L++255,latin1)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary({1,2,3},latin1)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1,latin1)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1.0,latin1)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary('1',latin1)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,apa],latin1)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,4.0],latin1)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,gnarfl)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,L)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,{latin1})),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,[latin1])),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,1)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,1.0)),
+ L = lists:seq(0,255),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L++255,unicode)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary({1,2,3},unicode)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1,unicode)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1.0,unicode)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary('1',unicode)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,apa],unicode)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,4.0],unicode)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L++255,latin1)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary({1,2,3},latin1)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1,latin1)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1.0,latin1)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary('1',latin1)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,apa],latin1)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,4.0],latin1)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,gnarfl)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,L)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,{latin1})),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,[latin1])),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,1)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,1.0)),
Encodings = [unicode, utf8,utf16,utf32,{utf16,big},
{utf16,little},{utf32,big},{utf32,little}],
[ begin
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L++255,unicode,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary({1,2,3},unicode,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1,unicode,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1.0,unicode,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary('1',unicode,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,apa],unicode,
- Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,4.0],unicode,
- Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L++255,latin1,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary({1,2,3},latin1,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1,latin1,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1.0,latin1,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary('1',latin1,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,apa],latin1,
- Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,4.0],latin1,
- Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,gnarfl,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,L,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,{latin1},Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,[latin1],Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,1,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,1.0,Enc))
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L++255,unicode,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary({1,2,3},unicode,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1,unicode,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1.0,unicode,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary('1',unicode,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,apa],unicode,
+ Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,4.0],unicode,
+ Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L++255,latin1,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary({1,2,3},latin1,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1,latin1,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(1.0,latin1,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary('1',latin1,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,apa],latin1,
+ Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary([1,2,3,4.0],latin1,
+ Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,gnarfl,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,L,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,{latin1},Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,[latin1],Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,1,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_binary(L,1.0,Enc))
end || Enc <- Encodings ],
Encodings2 = [latin1, unicode, utf8,utf16,utf32,{utf16,big},
- {utf16,little},{utf32,big},{utf32,little}],
+ {utf16,little},{utf32,big},{utf32,little}],
[ begin
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(L++255,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_list({1,2,3},Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(1,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(1.0,Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_list('1',Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_list([1,2,3,apa],Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_list([1,2,3,4.0],Enc)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(L,{Enc})),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(L,[Enc]))
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(L++255,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_list({1,2,3},Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(1,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(1.0,Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_list('1',Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_list([1,2,3,apa],Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_list([1,2,3,4.0],Enc)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(L,{Enc})),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(L,[Enc]))
end || Enc <- Encodings2 ],
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(L,gnarfl)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(L,L)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(L,1)),
- ?line {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(L,1.0)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(L,gnarfl)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(L,L)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(L,1)),
+ {'EXIT',{badarg,_}} = (catch unicode:characters_to_list(L,1.0)),
[ begin
- ?line Bx = unicode:characters_to_binary(L,latin1, Enc),
- ?line L = unicode:characters_to_list(Bx,Enc)
+ Bx = unicode:characters_to_binary(L,latin1, Enc),
+ L = unicode:characters_to_list(Bx,Enc)
end || Enc <- Encodings ],
- ?line B = unicode:characters_to_binary(L,latin1),
- ?line L = unicode:characters_to_list(B,unicode),
- ?line L = unicode:characters_to_list(list_to_binary(L),latin1),
- ?line More = <<B/binary,0,1,2>>,
- ?line B2 = list_to_binary([254,255]),
- ?line B3 = list_to_binary([0,1,2,254,255]),
- ?line {error,B,Rest1} = unicode:characters_to_binary([L,B2],unicode),
- ?line B2 = iolist_to_binary(Rest1),
- ?line {error,More,Rest2} = unicode:characters_to_binary([L,B3],unicode),
- [ begin ?line {error,_,_} = unicode:characters_to_binary([L,B2],unicode,Enc) end
+ B = unicode:characters_to_binary(L,latin1),
+ L = unicode:characters_to_list(B,unicode),
+ L = unicode:characters_to_list(list_to_binary(L),latin1),
+ More = <<B/binary,0,1,2>>,
+ B2 = list_to_binary([254,255]),
+ B3 = list_to_binary([0,1,2,254,255]),
+ {error,B,Rest1} = unicode:characters_to_binary([L,B2],unicode),
+ B2 = iolist_to_binary(Rest1),
+ {error,More,Rest2} = unicode:characters_to_binary([L,B3],unicode),
+ [ begin {error,_,_} = unicode:characters_to_binary([L,B2],unicode,Enc) end
|| Enc <- Encodings ],
- ?line Valid0 = unicode:characters_to_binary([L,254,255],unicode),
- ?line Valid1 = unicode:characters_to_binary([L,254,255],latin1),
- ?line Valid2 = unicode:characters_to_binary([L,254,255,256,257],unicode),
- ?line Valid3 = unicode:characters_to_binary([L,B2],latin1),
- ?line true = is_binary(Valid0),
- ?line true = is_binary(Valid1),
- ?line true = is_binary(Valid2),
- ?line true = is_binary(Valid3),
- ?line Valid4 = unicode:characters_to_binary([L,B3],latin1),
- ?line true = is_binary(Valid4),
- ?line B2 = iolist_to_binary(Rest2),
- ?line true = (L ++ [254,255] =:= unicode:characters_to_list(Valid0,unicode)),
- ?line true = (L ++ [254,255,256,257] =:= unicode:characters_to_list(Valid2,unicode)),
+ Valid0 = unicode:characters_to_binary([L,254,255],unicode),
+ Valid1 = unicode:characters_to_binary([L,254,255],latin1),
+ Valid2 = unicode:characters_to_binary([L,254,255,256,257],unicode),
+ Valid3 = unicode:characters_to_binary([L,B2],latin1),
+ true = is_binary(Valid0),
+ true = is_binary(Valid1),
+ true = is_binary(Valid2),
+ true = is_binary(Valid3),
+ Valid4 = unicode:characters_to_binary([L,B3],latin1),
+ true = is_binary(Valid4),
+ B2 = iolist_to_binary(Rest2),
+ true = (L ++ [254,255] =:= unicode:characters_to_list(Valid0,unicode)),
+ true = (L ++ [254,255,256,257] =:= unicode:characters_to_list(Valid2,unicode)),
lists:foreach(fun(Enco) ->
- ?line Valid0x = unicode:characters_to_binary([L,254,255],unicode,Enco),
- ?line Valid1x = unicode:characters_to_binary([L,254,255],latin1,Enco),
- ?line Valid2x = unicode:characters_to_binary([L,254,255,256,257],unicode,Enco),
- ?line Valid3x = unicode:characters_to_binary([L,B2],latin1,Enco),
- ?line true = is_binary(Valid0x),
- ?line true = is_binary(Valid1x),
- ?line true = is_binary(Valid2x),
- ?line true = is_binary(Valid3x)
+ Valid0x = unicode:characters_to_binary([L,254,255],unicode,Enco),
+ Valid1x = unicode:characters_to_binary([L,254,255],latin1,Enco),
+ Valid2x = unicode:characters_to_binary([L,254,255,256,257],unicode,Enco),
+ Valid3x = unicode:characters_to_binary([L,B2],latin1,Enco),
+ true = is_binary(Valid0x),
+ true = is_binary(Valid1x),
+ true = is_binary(Valid2x),
+ true = is_binary(Valid3x)
end, Encodings),
ok.
-
+
latin1(Config) when is_list(Config) ->
setlimit(10),
@@ -316,132 +316,132 @@ latin1(Config) when is_list(Config) ->
ex_latin1(Config).
ex_latin1(Config) when is_list(Config) ->
- ?line All = lists:seq(0,255),
- ?line AllBin = list_to_binary(All),
- ?line AllUtf8 = unicode:characters_to_binary(All,latin1),
- ?line AllUtf8 = unicode:characters_to_binary(AllBin,latin1),
- ?line AllUtf8 = unicode:characters_to_binary([AllBin],latin1),
- ?line AllUtf8 = unicode:characters_to_binary(make_unaligned(AllBin),latin1),
- ?line AllUtf8 = unicode:characters_to_binary([make_unaligned(AllBin)],latin1),
- ?line AllUtf8 = list_to_utf8_bsyntax([AllBin],latin1),
- ?line AllUtf8 = list_to_utf8_bsyntax([make_unaligned(AllBin)],latin1),
- ?line AllUtf8 = unicode_mixed_to_utf8_1(All),
-
- ?line AllUtf16_Big = unicode:characters_to_binary(All,latin1,utf16),
- ?line AllUtf16_Big = unicode:characters_to_binary(AllBin,latin1,utf16),
- ?line AllUtf16_Big = unicode:characters_to_binary([AllBin],latin1,utf16),
- ?line AllUtf16_Big = unicode:characters_to_binary(make_unaligned(AllBin),latin1,utf16),
- ?line AllUtf16_Big = unicode:characters_to_binary([make_unaligned(AllBin)],latin1,utf16),
- ?line AllUtf16_Big = list_to_utf16_big_bsyntax([AllBin],latin1),
- ?line AllUtf16_Big = list_to_utf16_big_bsyntax([make_unaligned(AllBin)],latin1),
-
- ?line AllUtf16_Little = unicode:characters_to_binary(All,latin1,{utf16,little}),
- ?line AllUtf16_Little = unicode:characters_to_binary(AllBin,latin1,{utf16,little}),
- ?line AllUtf16_Little = unicode:characters_to_binary([AllBin],latin1,{utf16,little}),
- ?line AllUtf16_Little = unicode:characters_to_binary(make_unaligned(AllBin),latin1,
- {utf16,little}),
- ?line AllUtf16_Little = unicode:characters_to_binary([make_unaligned(AllBin)],latin1,
- {utf16,little}),
- ?line AllUtf16_Little = list_to_utf16_little_bsyntax([AllBin],latin1),
- ?line AllUtf16_Little = list_to_utf16_little_bsyntax([make_unaligned(AllBin)],latin1),
-
- ?line AllUtf32_Big = unicode:characters_to_binary(All,latin1,utf32),
- ?line AllUtf32_Big = unicode:characters_to_binary(AllBin,latin1,utf32),
- ?line AllUtf32_Big = unicode:characters_to_binary([AllBin],latin1,utf32),
- ?line AllUtf32_Big = unicode:characters_to_binary(make_unaligned(AllBin),latin1,utf32),
- ?line AllUtf32_Big = unicode:characters_to_binary([make_unaligned(AllBin)],latin1,utf32),
- ?line AllUtf32_Big = list_to_utf32_big_bsyntax([AllBin],latin1),
- ?line AllUtf32_Big = list_to_utf32_big_bsyntax([make_unaligned(AllBin)],latin1),
-
- ?line AllUtf32_Little = unicode:characters_to_binary(All,latin1,{utf32,little}),
- ?line AllUtf32_Little = unicode:characters_to_binary(AllBin,latin1,{utf32,little}),
- ?line AllUtf32_Little = unicode:characters_to_binary([AllBin],latin1,{utf32,little}),
- ?line AllUtf32_Little = unicode:characters_to_binary(make_unaligned(AllBin),latin1,
- {utf32,little}),
- ?line AllUtf32_Little = unicode:characters_to_binary([make_unaligned(AllBin)],latin1,
- {utf32,little}),
- ?line AllUtf32_Little = list_to_utf32_little_bsyntax([AllBin],latin1),
- ?line AllUtf32_Little = list_to_utf32_little_bsyntax([make_unaligned(AllBin)],latin1),
-
- ?line DoubleUtf8 = <<AllUtf8/binary,AllUtf8/binary>>,
- ?line DoubleUtf8 = unicode:characters_to_binary([All,AllBin],latin1),
- ?line DoubleUtf8 =
+ All = lists:seq(0,255),
+ AllBin = list_to_binary(All),
+ AllUtf8 = unicode:characters_to_binary(All,latin1),
+ AllUtf8 = unicode:characters_to_binary(AllBin,latin1),
+ AllUtf8 = unicode:characters_to_binary([AllBin],latin1),
+ AllUtf8 = unicode:characters_to_binary(make_unaligned(AllBin),latin1),
+ AllUtf8 = unicode:characters_to_binary([make_unaligned(AllBin)],latin1),
+ AllUtf8 = list_to_utf8_bsyntax([AllBin],latin1),
+ AllUtf8 = list_to_utf8_bsyntax([make_unaligned(AllBin)],latin1),
+ AllUtf8 = unicode_mixed_to_utf8_1(All),
+
+ AllUtf16_Big = unicode:characters_to_binary(All,latin1,utf16),
+ AllUtf16_Big = unicode:characters_to_binary(AllBin,latin1,utf16),
+ AllUtf16_Big = unicode:characters_to_binary([AllBin],latin1,utf16),
+ AllUtf16_Big = unicode:characters_to_binary(make_unaligned(AllBin),latin1,utf16),
+ AllUtf16_Big = unicode:characters_to_binary([make_unaligned(AllBin)],latin1,utf16),
+ AllUtf16_Big = list_to_utf16_big_bsyntax([AllBin],latin1),
+ AllUtf16_Big = list_to_utf16_big_bsyntax([make_unaligned(AllBin)],latin1),
+
+ AllUtf16_Little = unicode:characters_to_binary(All,latin1,{utf16,little}),
+ AllUtf16_Little = unicode:characters_to_binary(AllBin,latin1,{utf16,little}),
+ AllUtf16_Little = unicode:characters_to_binary([AllBin],latin1,{utf16,little}),
+ AllUtf16_Little = unicode:characters_to_binary(make_unaligned(AllBin),latin1,
+ {utf16,little}),
+ AllUtf16_Little = unicode:characters_to_binary([make_unaligned(AllBin)],latin1,
+ {utf16,little}),
+ AllUtf16_Little = list_to_utf16_little_bsyntax([AllBin],latin1),
+ AllUtf16_Little = list_to_utf16_little_bsyntax([make_unaligned(AllBin)],latin1),
+
+ AllUtf32_Big = unicode:characters_to_binary(All,latin1,utf32),
+ AllUtf32_Big = unicode:characters_to_binary(AllBin,latin1,utf32),
+ AllUtf32_Big = unicode:characters_to_binary([AllBin],latin1,utf32),
+ AllUtf32_Big = unicode:characters_to_binary(make_unaligned(AllBin),latin1,utf32),
+ AllUtf32_Big = unicode:characters_to_binary([make_unaligned(AllBin)],latin1,utf32),
+ AllUtf32_Big = list_to_utf32_big_bsyntax([AllBin],latin1),
+ AllUtf32_Big = list_to_utf32_big_bsyntax([make_unaligned(AllBin)],latin1),
+
+ AllUtf32_Little = unicode:characters_to_binary(All,latin1,{utf32,little}),
+ AllUtf32_Little = unicode:characters_to_binary(AllBin,latin1,{utf32,little}),
+ AllUtf32_Little = unicode:characters_to_binary([AllBin],latin1,{utf32,little}),
+ AllUtf32_Little = unicode:characters_to_binary(make_unaligned(AllBin),latin1,
+ {utf32,little}),
+ AllUtf32_Little = unicode:characters_to_binary([make_unaligned(AllBin)],latin1,
+ {utf32,little}),
+ AllUtf32_Little = list_to_utf32_little_bsyntax([AllBin],latin1),
+ AllUtf32_Little = list_to_utf32_little_bsyntax([make_unaligned(AllBin)],latin1),
+
+ DoubleUtf8 = <<AllUtf8/binary,AllUtf8/binary>>,
+ DoubleUtf8 = unicode:characters_to_binary([All,AllBin],latin1),
+ DoubleUtf8 =
unicode:characters_to_binary([All,make_unaligned(AllBin)],latin1),
- ?line DoubleUtf8 = unicode:characters_to_binary([All|AllBin],latin1),
- ?line DoubleUtf8 =
+ DoubleUtf8 = unicode:characters_to_binary([All|AllBin],latin1),
+ DoubleUtf8 =
unicode:characters_to_binary([All|make_unaligned(AllBin)],latin1),
- ?line DoubleUtf8 = unicode:characters_to_binary([AllBin,All],latin1),
- ?line DoubleUtf8 = unicode:characters_to_binary([AllBin|All],latin1),
- ?line DoubleUtf8 = list_to_utf8_bsyntax([AllBin|All],latin1),
+ DoubleUtf8 = unicode:characters_to_binary([AllBin,All],latin1),
+ DoubleUtf8 = unicode:characters_to_binary([AllBin|All],latin1),
+ DoubleUtf8 = list_to_utf8_bsyntax([AllBin|All],latin1),
- ?line DoubleUtf16 = <<AllUtf16_Big/binary,AllUtf16_Big/binary>>,
- ?line DoubleUtf16 = unicode:characters_to_binary([All,AllBin],latin1,{utf16,big}),
- ?line DoubleUtf16 =
+ DoubleUtf16 = <<AllUtf16_Big/binary,AllUtf16_Big/binary>>,
+ DoubleUtf16 = unicode:characters_to_binary([All,AllBin],latin1,{utf16,big}),
+ DoubleUtf16 =
unicode:characters_to_binary([All,make_unaligned(AllBin)],latin1,{utf16,big}),
- ?line DoubleUtf16 = unicode:characters_to_binary([All|AllBin],latin1,{utf16,big}),
- ?line DoubleUtf16 =
+ DoubleUtf16 = unicode:characters_to_binary([All|AllBin],latin1,{utf16,big}),
+ DoubleUtf16 =
unicode:characters_to_binary([All|make_unaligned(AllBin)],latin1,{utf16,big}),
- ?line DoubleUtf16 = unicode:characters_to_binary([AllBin,All],latin1,{utf16,big}),
- ?line DoubleUtf16 = unicode:characters_to_binary([AllBin|All],latin1,{utf16,big}),
- ?line DoubleUtf16 = list_to_utf16_big_bsyntax([AllBin|All],latin1),
-
- ?line All = unicode:characters_to_list(AllUtf8,unicode),
- ?line All = unicode:characters_to_list(make_unaligned(AllUtf8),unicode),
- ?line All = utf8_to_list_bsyntax(AllUtf8),
- ?line AllAll = All ++ All,
- ?line AllAll = unicode:characters_to_list(DoubleUtf8,unicode),
- ?line AllAll = unicode:characters_to_list(make_unaligned(DoubleUtf8),unicode),
- ?line AllAll = utf8_to_list_bsyntax(DoubleUtf8),
- ?line {error,AllUtf8,Rest1} = unicode:characters_to_binary(All++[16#FFF],latin1),
- ?line [16#FFF] = lists:flatten(Rest1),
- ?line {error,DoubleUtf8,Rest2} =
+ DoubleUtf16 = unicode:characters_to_binary([AllBin,All],latin1,{utf16,big}),
+ DoubleUtf16 = unicode:characters_to_binary([AllBin|All],latin1,{utf16,big}),
+ DoubleUtf16 = list_to_utf16_big_bsyntax([AllBin|All],latin1),
+
+ All = unicode:characters_to_list(AllUtf8,unicode),
+ All = unicode:characters_to_list(make_unaligned(AllUtf8),unicode),
+ All = utf8_to_list_bsyntax(AllUtf8),
+ AllAll = All ++ All,
+ AllAll = unicode:characters_to_list(DoubleUtf8,unicode),
+ AllAll = unicode:characters_to_list(make_unaligned(DoubleUtf8),unicode),
+ AllAll = utf8_to_list_bsyntax(DoubleUtf8),
+ {error,AllUtf8,Rest1} = unicode:characters_to_binary(All++[16#FFF],latin1),
+ [16#FFF] = lists:flatten(Rest1),
+ {error,DoubleUtf8,Rest2} =
unicode:characters_to_binary([All,AllBin,16#FFF],latin1),
- ?line {error,DoubleUtf16,Rest2x} =
+ {error,DoubleUtf16,Rest2x} =
unicode:characters_to_binary([All,AllBin,16#FFF],latin1,utf16),
- ?line [16#FFF] = lists:flatten(Rest2),
- ?line [16#FFF] = lists:flatten(Rest2x),
- ?line {error,AllUtf8,Rest3} =
+ [16#FFF] = lists:flatten(Rest2),
+ [16#FFF] = lists:flatten(Rest2x),
+ {error,AllUtf8,Rest3} =
unicode:characters_to_binary([All,16#FFF,AllBin,16#FFF],
- latin1),
- ?line {error,AllUtf8,Rest3} =
+ latin1),
+ {error,AllUtf8,Rest3} =
unicode:characters_to_binary([All,16#FFF,make_unaligned(AllBin),16#FFF],
- latin1),
- ?line {error,AllUtf16_Big,Rest3x} =
+ latin1),
+ {error,AllUtf16_Big,Rest3x} =
unicode:characters_to_binary([All,16#FFF,AllBin,16#FFF],
- latin1,{utf16,big}),
- ?line {error,AllUtf16_Big,Rest3x} =
+ latin1,{utf16,big}),
+ {error,AllUtf16_Big,Rest3x} =
unicode:characters_to_binary([All,16#FFF,make_unaligned(AllBin),16#FFF],
- latin1,{utf16,big}),
- ?line [16#FFF,AllBin,16#FFF] = lists:flatten(Rest3),
- ?line [16#FFF,AllBin,16#FFF] = lists:flatten(Rest3x),
- ?line DoubleSize = byte_size(DoubleUtf8),
- ?line AllBut1 = DoubleSize - 1,
- ?line AllBut2 = DoubleSize - 2,
- ?line <<MissingLastByte:AllBut1/binary,_>> = DoubleUtf8,
- ?line <<_:AllBut2/binary,MissingStart:1/binary,_>> = DoubleUtf8,
- ?line {ChompedList,_} = lists:split(length(AllAll) - 1,AllAll),
- ?line {incomplete,ChompedList,MissingStart} =
+ latin1,{utf16,big}),
+ [16#FFF,AllBin,16#FFF] = lists:flatten(Rest3),
+ [16#FFF,AllBin,16#FFF] = lists:flatten(Rest3x),
+ DoubleSize = byte_size(DoubleUtf8),
+ AllBut1 = DoubleSize - 1,
+ AllBut2 = DoubleSize - 2,
+ <<MissingLastByte:AllBut1/binary,_>> = DoubleUtf8,
+ <<_:AllBut2/binary,MissingStart:1/binary,_>> = DoubleUtf8,
+ {ChompedList,_} = lists:split(length(AllAll) - 1,AllAll),
+ {incomplete,ChompedList,MissingStart} =
unicode:characters_to_list(MissingLastByte,unicode),
- ?line {incomplete,ChompedList,MissingStart} =
+ {incomplete,ChompedList,MissingStart} =
unicode:characters_to_list(make_unaligned(MissingLastByte),unicode),
- ?line DoubleSize16 = byte_size(DoubleUtf16),
- ?line DoubleUtf16_2 = list_to_binary([DoubleUtf16,<<16#FFFFF/utf16-big>>]),
- ?line DoubleSize16_2 = byte_size(DoubleUtf16_2),
- ?line AllBut1_16 = DoubleSize16 - 1,
- ?line AllBut2_16_2 = DoubleSize16_2 - 2,
- ?line <<MissingLastBytes16:AllBut2_16_2/binary,_,_>> = DoubleUtf16_2,
- ?line <<MissingLastByte16:AllBut1_16/binary,_>> = DoubleUtf16,
- ?line {incomplete,AllAll,_} =
+ DoubleSize16 = byte_size(DoubleUtf16),
+ DoubleUtf16_2 = list_to_binary([DoubleUtf16,<<16#FFFFF/utf16-big>>]),
+ DoubleSize16_2 = byte_size(DoubleUtf16_2),
+ AllBut1_16 = DoubleSize16 - 1,
+ AllBut2_16_2 = DoubleSize16_2 - 2,
+ <<MissingLastBytes16:AllBut2_16_2/binary,_,_>> = DoubleUtf16_2,
+ <<MissingLastByte16:AllBut1_16/binary,_>> = DoubleUtf16,
+ {incomplete,AllAll,_} =
unicode:characters_to_list(MissingLastBytes16,utf16),
- ?line {incomplete,AllAll,_} =
+ {incomplete,AllAll,_} =
unicode:characters_to_list(make_unaligned(MissingLastBytes16),utf16),
- ?line {incomplete,ChompedList,_} =
+ {incomplete,ChompedList,_} =
unicode:characters_to_list(MissingLastByte16,utf16),
- ?line {incomplete,ChompedList,_} =
+ {incomplete,ChompedList,_} =
unicode:characters_to_list(make_unaligned(MissingLastByte16),utf16),
ok.
-
+
roundtrips(Config) when is_list(Config) ->
setlimit(10),
ex_roundtrips(Config),
@@ -449,23 +449,21 @@ roundtrips(Config) when is_list(Config) ->
ex_roundtrips(Config).
ex_roundtrips(Config) when is_list(Config) ->
- ?line L1 = ranges(0, 16#D800 - 1,
- erlang:system_info(context_reductions) * 11),
- ?line L2 = ranges(16#DFFF + 1, 16#10000 - 1,
- erlang:system_info(context_reductions) * 11),
- %?line L3 = ranges(16#FFFF + 1, 16#10FFFF,
- % erlang:system_info(context_reductions) * 11),
- ?line L3 = ranges(16#FFFFF, 16#10FFFF,
- erlang:system_info(context_reductions) * 11),
- ?line L = L1 ++ L2 ++ L3,
- ?line LLen = length(L),
- ?line Parts = erlang:system_info(schedulers),
- ?line Lists = splitup(L,LLen,Parts),
- ?line PidRefs = [spawn_monitor(fun() ->
- do_roundtrips(MyPart)
- end) || MyPart <- Lists],
- ?line [receive {'DOWN',Ref,process,Pid,Reason} -> normal=Reason end ||
- {Pid,Ref} <- PidRefs],
+ L1 = ranges(0, 16#D800 - 1,
+ erlang:system_info(context_reductions) * 11),
+ L2 = ranges(16#DFFF + 1, 16#10000 - 1,
+ erlang:system_info(context_reductions) * 11),
+ L3 = ranges(16#FFFFF, 16#10FFFF,
+ erlang:system_info(context_reductions) * 11),
+ L = L1 ++ L2 ++ L3,
+ LLen = length(L),
+ Parts = erlang:system_info(schedulers),
+ Lists = splitup(L,LLen,Parts),
+ PidRefs = [spawn_monitor(fun() ->
+ do_roundtrips(MyPart)
+ end) || MyPart <- Lists],
+ [receive {'DOWN',Ref,process,Pid,Reason} -> normal=Reason end ||
+ {Pid,Ref} <- PidRefs],
ok.
do_roundtrips([]) ->
@@ -529,10 +527,10 @@ ex_random_lists(Config) when is_list(Config) ->
PlainFlatten4 = fun(L) ->
iolist_to_binary([int_to_utf8(X) || X <- unicode:characters_to_list(flatb(L),latin1)])
end,
- ?line random_iolist:run(150, PlainFlatten1, PlainFlatten3),
- ?line random_iolist:run(150, PlainFlatten2, PlainFlatten3),
- ?line random_iolist:run(150, PlainFlatten1, PlainFlatten2),
- ?line random_iolist:run(150, PlainFlatten1, PlainFlatten4),
+ random_iolist:run(150, PlainFlatten1, PlainFlatten3),
+ random_iolist:run(150, PlainFlatten2, PlainFlatten3),
+ random_iolist:run(150, PlainFlatten1, PlainFlatten2),
+ random_iolist:run(150, PlainFlatten1, PlainFlatten4),
SelfMade = fun(L) ->
iolist_to_binary(lists:map(fun(X) ->
int_to_utf8(X)
@@ -548,52 +546,52 @@ ex_random_lists(Config) when is_list(Config) ->
Other
end
end,
- ?line random_iolist:run(150, PlainFlatten1, SelfMade),
- ?line random_iolist:run(150, PlainFlatten2, SelfMadeA),
+ random_iolist:run(150, PlainFlatten1, SelfMade),
+ random_iolist:run(150, PlainFlatten2, SelfMadeA),
RoundTrip11 = fun(L) ->
- unicode:characters_to_list(unicode:characters_to_binary(L,latin1),unicode)
- end,
+ unicode:characters_to_list(unicode:characters_to_binary(L,latin1),unicode)
+ end,
RoundTrip21 = fun(L) ->
- utf8_to_list_bsyntax(unicode:characters_to_binary(L,latin1))
- end,
+ utf8_to_list_bsyntax(unicode:characters_to_binary(L,latin1))
+ end,
RoundTrip31 = fun(L) ->
- unicode:characters_to_list(list_to_utf8_bsyntax(L,latin1),unicode)
- end,
+ unicode:characters_to_list(list_to_utf8_bsyntax(L,latin1),unicode)
+ end,
RoundTrip41 = fun(L) ->
- utf8_to_list_bsyntax(list_to_utf8_bsyntax(L,latin1))
- end,
+ utf8_to_list_bsyntax(list_to_utf8_bsyntax(L,latin1))
+ end,
RoundTrip51 = fun(L) ->
- unicode:characters_to_list(L,latin1)
- end,
- ?line random_iolist:run(150, RoundTrip11,RoundTrip21),
- ?line random_iolist:run(150, RoundTrip21,RoundTrip31),
- ?line random_iolist:run(150, RoundTrip31,RoundTrip41),
- ?line random_iolist:run(150, RoundTrip11,RoundTrip41),
- ?line random_iolist:run(150, RoundTrip21,RoundTrip41),
- ?line random_iolist:run(150, RoundTrip11,RoundTrip31),
- ?line random_iolist:run(150, RoundTrip11,RoundTrip51),
+ unicode:characters_to_list(L,latin1)
+ end,
+ random_iolist:run(150, RoundTrip11,RoundTrip21),
+ random_iolist:run(150, RoundTrip21,RoundTrip31),
+ random_iolist:run(150, RoundTrip31,RoundTrip41),
+ random_iolist:run(150, RoundTrip11,RoundTrip41),
+ random_iolist:run(150, RoundTrip21,RoundTrip41),
+ random_iolist:run(150, RoundTrip11,RoundTrip31),
+ random_iolist:run(150, RoundTrip11,RoundTrip51),
UniFlatten1 = fun(L) ->
unicode:characters_to_binary(flat(L),unicode)
end,
UniFlatten2 = fun(L) ->
- unicode:characters_to_binary(L,unicode)
+ unicode:characters_to_binary(L,unicode)
end,
UniFlatten3 = fun(L) ->
- unicode:characters_to_binary(flatx(L),unicode)
+ unicode:characters_to_binary(flatx(L),unicode)
end,
UniFlatten4 = fun(L) ->
- unicode:characters_to_binary(unicode:characters_to_list(L,unicode),unicode)
+ unicode:characters_to_binary(unicode:characters_to_list(L,unicode),unicode)
end,
- ?line random_unicode_list:run(150, UniFlatten1,UniFlatten2),
- ?line random_unicode_list:run(150, UniFlatten1,UniFlatten3),
- ?line random_unicode_list:run(150, UniFlatten2,UniFlatten4),
- ?line random_unicode_list:run(150, UniFlatten2,UniFlatten3),
+ random_unicode_list:run(150, UniFlatten1,UniFlatten2),
+ random_unicode_list:run(150, UniFlatten1,UniFlatten3),
+ random_unicode_list:run(150, UniFlatten2,UniFlatten4),
+ random_unicode_list:run(150, UniFlatten2,UniFlatten3),
- ?line Encodings = [utf8,{utf16,big},
- {utf16,little},{utf32,big},{utf32,little}],
+ Encodings = [utf8,{utf16,big},
+ {utf16,little},{utf32,big},{utf32,little}],
lists:foreach(fun(OutEnc1) ->
lists:foreach(fun(InEnc1) ->
Uni16BigFlatten1 = fun(L) ->
@@ -608,11 +606,10 @@ ex_random_lists(Config) when is_list(Config) ->
Uni16BigFlatten4 = fun(L) ->
unicode:characters_to_binary(unicode:characters_to_list(L,InEnc1),InEnc1,OutEnc1)
end,
- %erlang:display({InEnc1,OutEnc1}),
- ?line random_unicode_list:run(150, Uni16BigFlatten1,Uni16BigFlatten2,InEnc1),
- ?line random_unicode_list:run(150, Uni16BigFlatten1,Uni16BigFlatten3,InEnc1),
- ?line random_unicode_list:run(150, Uni16BigFlatten2,Uni16BigFlatten4,InEnc1),
- ?line random_unicode_list:run(150, Uni16BigFlatten2,Uni16BigFlatten3,InEnc1)
+ random_unicode_list:run(150, Uni16BigFlatten1,Uni16BigFlatten2,InEnc1),
+ random_unicode_list:run(150, Uni16BigFlatten1,Uni16BigFlatten3,InEnc1),
+ random_unicode_list:run(150, Uni16BigFlatten2,Uni16BigFlatten4,InEnc1),
+ random_unicode_list:run(150, Uni16BigFlatten2,Uni16BigFlatten3,InEnc1)
end, Encodings)
end, Encodings),
SelfMade1 = fun(L) ->
@@ -624,10 +621,10 @@ ex_random_lists(Config) when is_list(Config) ->
SelfMade3 = fun(L) ->
list_to_utf8_bsyntax(L,unicode)
end,
- ?line random_unicode_list:run(150, SelfMade1,SelfMade2),
- ?line random_unicode_list:run(150, UniFlatten2, SelfMade1),
- ?line random_unicode_list:run(150, UniFlatten2, SelfMade2),
- ?line random_unicode_list:run(150, UniFlatten2, SelfMade3),
+ random_unicode_list:run(150, SelfMade1,SelfMade2),
+ random_unicode_list:run(150, UniFlatten2, SelfMade1),
+ random_unicode_list:run(150, UniFlatten2, SelfMade2),
+ random_unicode_list:run(150, UniFlatten2, SelfMade3),
RoundTrip1 = fun(L) ->
unicode:characters_to_list(unicode:characters_to_binary(L,unicode),unicode)
end,
@@ -640,12 +637,12 @@ ex_random_lists(Config) when is_list(Config) ->
RoundTrip4 = fun(L) ->
utf8_to_list_bsyntax(list_to_utf8_bsyntax(L,unicode))
end,
- ?line random_unicode_list:run(150, RoundTrip1,RoundTrip2),
- ?line random_unicode_list:run(150, RoundTrip2,RoundTrip3),
- ?line random_unicode_list:run(150, RoundTrip3,RoundTrip4),
- ?line random_unicode_list:run(150, RoundTrip1,RoundTrip4),
- ?line random_unicode_list:run(150, RoundTrip2,RoundTrip4),
- ?line random_unicode_list:run(150, RoundTrip1,RoundTrip3),
+ random_unicode_list:run(150, RoundTrip1,RoundTrip2),
+ random_unicode_list:run(150, RoundTrip2,RoundTrip3),
+ random_unicode_list:run(150, RoundTrip3,RoundTrip4),
+ random_unicode_list:run(150, RoundTrip1,RoundTrip4),
+ random_unicode_list:run(150, RoundTrip2,RoundTrip4),
+ random_unicode_list:run(150, RoundTrip1,RoundTrip3),
lists:foreach(fun(OutEnc2) ->
lists:foreach(fun(InEnc2) ->
RoundTripUtf16_Big_1 = fun(L) ->
@@ -660,12 +657,12 @@ ex_random_lists(Config) when is_list(Config) ->
RoundTripUtf16_Big_4 = fun(L) ->
x_to_list_bsyntax(InEnc2,list_to_x_bsyntax(InEnc2,L,InEnc2))
end,
- ?line random_unicode_list:run(150, RoundTripUtf16_Big_1,RoundTripUtf16_Big_2,InEnc2),
- ?line random_unicode_list:run(150, RoundTripUtf16_Big_2,RoundTripUtf16_Big_3,InEnc2),
- ?line random_unicode_list:run(150, RoundTripUtf16_Big_3,RoundTripUtf16_Big_4,InEnc2),
- ?line random_unicode_list:run(150, RoundTripUtf16_Big_1,RoundTripUtf16_Big_4,InEnc2),
- ?line random_unicode_list:run(150, RoundTripUtf16_Big_2,RoundTripUtf16_Big_4,InEnc2),
- ?line random_unicode_list:run(150, RoundTripUtf16_Big_1,RoundTripUtf16_Big_3,InEnc2)
+ random_unicode_list:run(150, RoundTripUtf16_Big_1,RoundTripUtf16_Big_2,InEnc2),
+ random_unicode_list:run(150, RoundTripUtf16_Big_2,RoundTripUtf16_Big_3,InEnc2),
+ random_unicode_list:run(150, RoundTripUtf16_Big_3,RoundTripUtf16_Big_4,InEnc2),
+ random_unicode_list:run(150, RoundTripUtf16_Big_1,RoundTripUtf16_Big_4,InEnc2),
+ random_unicode_list:run(150, RoundTripUtf16_Big_2,RoundTripUtf16_Big_4,InEnc2),
+ random_unicode_list:run(150, RoundTripUtf16_Big_1,RoundTripUtf16_Big_3,InEnc2)
end, Encodings)
end, Encodings),
ToList1 = fun(L) ->
@@ -680,12 +677,12 @@ ex_random_lists(Config) when is_list(Config) ->
ToList4 = fun(L) ->
utf8_to_list(unicode_mixed_to_utf8_2(L))
end,
- ?line random_unicode_list:run(150, ToList1,ToList2),
- ?line random_unicode_list:run(150, ToList2,ToList3),
- ?line random_unicode_list:run(150, ToList3,ToList4),
- ?line random_unicode_list:run(150, ToList1,ToList4),
- ?line random_unicode_list:run(150, ToList2,ToList4),
- ?line random_unicode_list:run(150, ToList1,ToList3),
+ random_unicode_list:run(150, ToList1,ToList2),
+ random_unicode_list:run(150, ToList2,ToList3),
+ random_unicode_list:run(150, ToList3,ToList4),
+ random_unicode_list:run(150, ToList1,ToList4),
+ random_unicode_list:run(150, ToList2,ToList4),
+ random_unicode_list:run(150, ToList1,ToList3),
ok.
@@ -696,13 +693,13 @@ utf16_illegal_sequences_bif(Config) when is_list(Config) ->
ex_utf16_illegal_sequences_bif(Config).
ex_utf16_illegal_sequences_bif(Config) when is_list(Config) ->
- ?line utf16_fail_range_bif_simple(16#10FFFF+1, 16#10FFFF+512), %Too large.
- ?line utf16_fail_range_bif(16#D800, 16#DFFF), %Reserved for UTF-16.
+ utf16_fail_range_bif_simple(16#10FFFF+1, 16#10FFFF+512), %Too large.
+ utf16_fail_range_bif(16#D800, 16#DFFF), %Reserved for UTF-16.
+
+ lonely_hi_surrogate_bif(16#D800, 16#DBFF,incomplete),
+ lonely_hi_surrogate_bif(16#DC00, 16#DFFF,error),
+ leading_lo_surrogate_bif(16#DC00, 16#DFFF),
- ?line lonely_hi_surrogate_bif(16#D800, 16#DBFF,incomplete),
- ?line lonely_hi_surrogate_bif(16#DC00, 16#DFFF,error),
- ?line leading_lo_surrogate_bif(16#DC00, 16#DFFF),
-
ok.
utf16_fail_range_bif(Char, End) when Char =< End ->
@@ -770,20 +767,20 @@ utf8_illegal_sequences_bif(Config) when is_list(Config) ->
ex_utf8_illegal_sequences_bif(Config).
ex_utf8_illegal_sequences_bif(Config) when is_list(Config) ->
- ?line fail_range_bif(16#10FFFF+1, 16#10FFFF+512), %Too large.
- ?line fail_range_bif(16#D800, 16#DFFF), %Reserved for UTF-16.
+ fail_range_bif(16#10FFFF+1, 16#10FFFF+512), %Too large.
+ fail_range_bif(16#D800, 16#DFFF), %Reserved for UTF-16.
%% Illegal first character.
- ?line [fail_bif(<<I,16#8F,16#8F,16#8F>>,unicode) || I <- lists:seq(16#80, 16#BF)],
+ [fail_bif(<<I,16#8F,16#8F,16#8F>>,unicode) || I <- lists:seq(16#80, 16#BF)],
%% Short sequences.
- ?line short_sequences_bif(16#80, 16#10FFFF),
+ short_sequences_bif(16#80, 16#10FFFF),
%% Overlong sequences. (Using more bytes than necessary
%% is not allowed.)
- ?line overlong_bif(0, 127, 2),
- ?line overlong_bif(128, 16#7FF, 3),
- ?line overlong_bif(16#800, 16#FFFF, 4),
+ overlong_bif(0, 127, 2),
+ overlong_bif(128, 16#7FF, 3),
+ overlong_bif(16#800, 16#FFFF, 4),
ok.
fail_range_bif(Char, End) when Char =< End ->
@@ -797,7 +794,6 @@ fail_range_bif(_, _) -> ok.
short_sequences_bif(Char, End) ->
Step = (End - Char) div erlang:system_info(schedulers) + 1,
-% Step = (End - Char) + 1,
PidRefs = short_sequences_bif_1(Char, Step, End),
[receive {'DOWN',Ref,process,Pid,Reason} -> normal=Reason end ||
{Pid,Ref} <- PidRefs],
@@ -918,8 +914,8 @@ only_fail_bif_1(Bin,Coding) ->
Other ->
exit({faulty_encoding_accepted,[Bin],Coding,Other})
end.
-
-
+
+
fail_bif(Bin,Coding) ->
@@ -1021,9 +1017,9 @@ unicode_mixed_to_utf8_2(L) ->
int_to_utf8(E)
end || E <- Flist ],
iolist_to_binary([ExpList]).
-
-
-
+
+
+
utf8_to_list_bsyntax(<<>>) ->
[];
@@ -1042,8 +1038,8 @@ list_to_utf8_bsyntax(List,latin1) ->
FList = flatb(List),
list_to_binary([ <<E/utf8>> || E <- FList ]).
-
-
+
+
%%
@@ -1066,7 +1062,7 @@ int_to_utf16_little(U) when U >= 16#10000, U =< 16#10FFFF ->
LO = (16#DC00 bor (UPrim band 16#3FF)),
<<HI:16/little,LO:16/little>>.
-
+
%% This function intentionally allows construction of
%% UTF-8 sequence in illegal ranges.
int_to_utf8(I) when I =< 16#7F ->
@@ -1093,7 +1089,7 @@ int_to_utf8(I) when I =< 16#3FFFFFF ->
B2 = (I bsr 18),
B1 = (I bsr 24),
<<1:1,1:1,1:1,1:1,1:1,0:1,B1:2,1:1,0:1,B2:6,1:1,0:1,B3:6,1:1,0:1,B4:6,
- 1:1,0:1,B5:6>>.
+ 1:1,0:1,B5:6>>.
utf16_big_to_list_bsyntax(<<>>) ->
[];
@@ -1131,7 +1127,7 @@ list_to_utf16_little_bsyntax(List,latin1) ->
list_to_binary([ <<E/utf16-little>> || E <- FList ]).
-
+
utf32_big_to_list_bsyntax(<<>>) ->
[];
utf32_big_to_list_bsyntax(<<C/utf32-big,R/binary>>) ->
@@ -1162,12 +1158,12 @@ list_to_utf32_little_bsyntax(List,{utf32,little}) ->
E;
true ->
<<E/utf32-little>>
- end || E <- FList ]);
+ end || E <- FList ]);
list_to_utf32_little_bsyntax(List,latin1) ->
FList = flatb(List),
list_to_binary([ <<E/utf32-little>> || E <- FList ]).
-
+
%% int_to_utf8(I, NumberOfBytes) -> Binary.
%% This function can be used to construct overlong sequences.
@@ -1211,7 +1207,7 @@ utf8_to_int(<<1:1,1:1,0:1,B1:5,1:1,0:1,B2:6>>) ->
utf8_to_int(<<1:1,1:1,1:1,0:1,B1:4,1:1,0:1,B2:6,1:1,0:1,B3:6>>) ->
(B1 bsl 12) bor (B2 bsl 6) bor B3;
utf8_to_int(<<1:1,1:1,1:1,1:1,0:1,B1:3,1:1,0:1,
- B2:6,1:1,0:1,B3:6,1:1,0:1,B4:6>>) ->
+ B2:6,1:1,0:1,B3:6,1:1,0:1,B4:6>>) ->
Res = (B1 bsl 18) bor (B2 bsl 12) bor (B3 bsl 6) bor B4,
case Res of
X when X > 16#10FFFF ->
@@ -1295,10 +1291,9 @@ list_to_x_bsyntax({utf32,big},L,Enc) ->
list_to_utf32_big_bsyntax(L,Enc);
list_to_x_bsyntax({utf32,little},L,Enc) ->
list_to_utf32_little_bsyntax(L,Enc).
-
+
make_unaligned(Bin0) when is_binary(Bin0) ->
-% put(c_count,get(c_count)+1),
Bin1 = <<0:3,Bin0/binary,31:5>>,
Sz = byte_size(Bin0),
<<0:3,Bin:Sz/binary,31:5>> = id(Bin1),
@@ -1310,80 +1305,3 @@ setlimit(X) ->
erts_debug:set_internal_state(available_internal_state,true),
io:format("Setting loop limit, old: ~p, now set to ~p~n",
[erts_debug:set_internal_state(unicode_loop_limit,X),X]).
-
-
-%%
-%% Tracing utility
-%%
-
-%% tr_dump() ->
-%% erlang:display(lists:sort(ets:tab2list(values))).
-
-%% tr_off(Pid) ->
-%% receive after 10000 -> ok end,
-%% tr_dump(),
-%% Ref = erlang:monitor(process,Pid),
-%% exit(Pid,kill),
-%% receive
-%% {'DOWN',Ref,_,_,_} -> ok
-%% end,
-%% ok.
-
-%% tr_on() ->
-%% catch ets:delete(values),
-%% ets:new(values,[named_table,public]),
-%% ets:insert(values,{traps,0}),
-%% catch ets:delete(state),
-%% ets:new(state,[named_table,public]),
-%% Pid = spawn(?MODULE,trace_recv,[values,state]),
-%% erlang:trace(new,true,[garbage_collection,{tracer,Pid},timestamp,call]),
-%% erlang:trace_pattern({erlang,list_to_utf8,2},[{'_',[],[{return_trace}]}],[global]),
-%% Pid.
-
-%% ts_to_int({Mega,Sec,Micro}) ->
-%% ((Mega * 1000000) + Sec) * 1000000 + Micro.
-
-%% trace_recv(Values,State) ->
-%% receive
-%% {trace_ts,Pid,call,_,TS} ->
-%% case ets:lookup(State,{call,Pid}) of
-%% [{{call,Pid},_}] ->
-%% ets:update_counter(values,traps,1);
-%% _ ->
-%% ok
-%% end,
-%% ets:insert(State,{{call,Pid},ts_to_int(TS)});
-%% {trace_ts,Pid,return_from,_,_,TS} ->
-%% case ets:lookup(State,{call,Pid}) of
-%% [{{call,Pid},TS2}] ->
-%% ets:delete(State,{call,Pid}),
-%% Elapsed = ts_to_int(TS) - TS2,
-%% case ets:lookup(Values,Pid) of
-%% [{Pid,GCNum,CallNum,GCTime,CallTime}] ->
-%% ets:insert(Values,{Pid,GCNum,CallNum+1,GCTime,CallTime+Elapsed});
-%% [] ->
-%% ets:insert(Values,{Pid,0,1,0,Elapsed})
-%% end;
-%% _Other ->
-%% erlang:display({what2,Pid})
-%% end;
-%% {trace_ts,Pid,gc_start,_,TS} ->
-%% ets:insert(State,{{gc,Pid},ts_to_int(TS)});
-%% {trace_ts,Pid,gc_end,_,TS} ->
-%% case ets:lookup(State,{gc,Pid}) of
-%% [{{gc,Pid},TS2}] ->
-%% ets:delete(State,{gc,Pid}),
-%% Elapsed = ts_to_int(TS) - TS2,
-%% case ets:lookup(Values,Pid) of
-%% [{Pid,Num,CNum,Time,CTime}] ->
-%% ets:insert(Values,{Pid,Num+1,CNum,Time+Elapsed,CTime});
-%% [] ->
-%% ets:insert(Values,{Pid,1,0,Elapsed,0})
-%% end;
-%% _Other ->
-%% erlang:display({what,Pid})
-%% end;
-%% X ->
-%% erlang:display({trace_recv,X})
-%% end,
-%% trace_recv(Values,State).
diff --git a/lib/stdlib/test/win32reg_SUITE.erl b/lib/stdlib/test/win32reg_SUITE.erl
index 982cc86979..62619dff47 100644
--- a/lib/stdlib/test/win32reg_SUITE.erl
+++ b/lib/stdlib/test/win32reg_SUITE.erl
@@ -24,7 +24,9 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{seconds,10}}].
all() ->
[long, evil_write].
@@ -49,54 +51,52 @@ init_per_suite(Config) when is_list(Config) ->
end_per_suite(Config) when is_list(Config) ->
Config.
-long(doc) -> "Test long keys and entries (OTP-3446).";
+%% Test long keys and entries (OTP-3446).
long(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
-
- ?line LongKey = "software\\" ++
+ LongKey = "software\\" ++
lists:flatten(lists:duplicate(10, "..\\software\\")) ++
"Ericsson\\Erlang",
- ?line {ok,Reg} = win32reg:open([read,write]),
- ?line ok = win32reg:change_key(Reg, "\\hklm"),
- ?line ok = win32reg:change_key(Reg, LongKey),
- ?line {ok,ErlangKey} = win32reg:current_key(Reg),
- io:format("Erlang key: ~s", [ErlangKey]),
+ {ok,Read} = win32reg:open([read]),
+ ok = win32reg:change_key(Read, "\\hklm"),
+ ok = win32reg:change_key(Read, LongKey),
+ {ok,ErlangKey} = win32reg:current_key(Read),
+ io:format("Erlang key: ~s~n", [ErlangKey]),
+ ok = win32reg:close(Read),
+
+ {ok,Reg} = win32reg:open([read, write]),
%% Write a long value and read it back.
- ?line TestKey = "test_key",
- ?line LongValue = lists:concat(["This is a long value generated by the test case ",?MODULE,":long/1. "|lists:duplicate(128, "a")]),
- ?line ok = win32reg:set_value(Reg, TestKey, LongValue),
- ?line {ok,LongValue} = win32reg:value(Reg, TestKey),
+ TestKey = "test_key",
+ LongValue = lists:concat(["This is a long value generated by the test case ",?MODULE,":long/1. "|lists:duplicate(128, "a")]),
+ ok = win32reg:set_value(Reg, TestKey, LongValue),
+ {ok,LongValue} = win32reg:value(Reg, TestKey),
+ io:format("Where ~p Key ~s Value ~s ~n", [win32reg:current_key(Reg), TestKey, LongValue]),
%% Done.
- ?line ok = win32reg:close(Reg),
- ?line test_server:timetrap_cancel(Dog),
+ ok = win32reg:close(Reg),
ok.
evil_write(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
-
- ?line Key = "Software\\Ericsson\\Erlang",
- ?line {ok,Reg} = win32reg:open([read,write]),
- ?line ok = win32reg:change_key(Reg, "\\hklm"),
- ?line ok = win32reg:change_key(Reg, Key),
- ?line {ok,ErlangKey} = win32reg:current_key(Reg),
+ Key = "Software\\Ericsson\\Erlang",
+ {ok,Reg} = win32reg:open([read,write]),
+ ok = win32reg:change_key(Reg, "\\hkcu"),
+ ok = win32reg:change_key_create(Reg, Key),
+ {ok,ErlangKey} = win32reg:current_key(Reg),
io:format("Erlang key: ~s", [ErlangKey]),
%% Write keys with different length and read it back.
- ?line TestKey = "test_key " ++ lists:duplicate(128, $a),
+ TestKey = "test_key " ++ lists:duplicate(128, $a),
evil_write_1(Reg, TestKey),
%% Done.
- ?line ok = win32reg:close(Reg),
- ?line test_server:timetrap_cancel(Dog),
+ ok = win32reg:close(Reg),
ok.
evil_write_1(Reg, [_|[_|_]=Key]=Key0) ->
- ?line io:format("Key = ~p\n", [Key0]),
- ?line ok = win32reg:set_value(Reg, Key0, "A good value for me"),
- ?line {ok,_Val} = win32reg:value(Reg, Key0),
- ?line ok = win32reg:delete_value(Reg, Key0),
+ io:format("Key = ~p\n", [Key0]),
+ ok = win32reg:set_value(Reg, Key0, "A good value for me"),
+ {ok,_Val} = win32reg:value(Reg, Key0),
+ ok = win32reg:delete_value(Reg, Key0),
evil_write_1(Reg, Key);
evil_write_1(_, [_]) -> ok.
diff --git a/lib/stdlib/test/y2k_SUITE.erl b/lib/stdlib/test/y2k_SUITE.erl
index d80dd10631..7828eb26ed 100644
--- a/lib/stdlib/test/y2k_SUITE.erl
+++ b/lib/stdlib/test/y2k_SUITE.erl
@@ -55,104 +55,80 @@ end_per_group(_GroupName, Config) ->
Config.
-date_1999_01_01(doc) ->
- "#1 : 1999-01-01: test roll-over from 1998-12-31 to 1999-01-01.";
-date_1999_01_01(suite) ->
- [];
+%% #1 : 1999-01-01: test roll-over from 1998-12-31 to 1999-01-01.
date_1999_01_01(Config) when is_list(Config) ->
- ?line Date = {1998, 12, 31}, NextDate = {1999, 1, 1},
- ?line match(next_date(Date), NextDate),
+ Date = {1998, 12, 31}, NextDate = {1999, 1, 1},
+ match(next_date(Date), NextDate),
TZD = tzd(Date),
if
TZD > 0 ->
- ?line Time = {24 - TZD, 0, 0},
- ?line {NDate, _NTime} =
+ Time = {24 - TZD, 0, 0},
+ {NDate, _NTime} =
erlang:localtime_to_universaltime({Date, Time}),
- ?line match(NDate, NextDate);
+ match(NDate, NextDate);
TZD < 0 ->
- ?line Time = {24 + TZD, 0, 0},
- ?line {NDate, _NTime} =
+ Time = {24 + TZD, 0, 0},
+ {NDate, _NTime} =
erlang:universaltime_to_localtime({Date, Time}),
- ?line match(NDate, NextDate);
+ match(NDate, NextDate);
true ->
ok
end.
-
-date_1999_02_28(doc) ->
- "#2 : 1999-02-28: test roll-over from 1999-02-28 to 1999-03-01.";
-date_1999_02_28(suite) ->
- [];
+
+%% #2 : 1999-02-28: test roll-over from 1999-02-28 to 1999-03-01.
date_1999_02_28(Config) when is_list(Config) ->
- ?line Date = {1999, 2, 28}, NextDate = {1999, 3, 1},
- ?line match(next_date(Date), NextDate),
- ?line match(tz_next_date(Date), NextDate).
-
-date_1999_09_09(doc) ->
- "#3 : 1999-09-09: test roll-over from 1999-09-08 to 1999-09-09.";
-date_1999_09_09(suite) ->
- [];
+ Date = {1999, 2, 28}, NextDate = {1999, 3, 1},
+ match(next_date(Date), NextDate),
+ match(tz_next_date(Date), NextDate).
+
+%% #3 : 1999-09-09: test roll-over from 1999-09-08 to 1999-09-09.
date_1999_09_09(Config) when is_list(Config) ->
- ?line Date = {1999, 9, 8}, NextDate = {1999, 9, 9},
- ?line match(next_date(Date), NextDate),
- ?line match(tz_next_date(Date), NextDate).
-
-date_2000_01_01(doc) ->
- "#4 : 2000-01-01: test roll-over from 1999-12-31 to 2000-01-01 to "
- "2000-01-02.";
-date_2000_01_01(suite) ->
- [];
+ Date = {1999, 9, 8}, NextDate = {1999, 9, 9},
+ match(next_date(Date), NextDate),
+ match(tz_next_date(Date), NextDate).
+
+%% #4 : 2000-01-01: test roll-over from 1999-12-31 to 2000-01-01 to
+%% 2000-01-02.;
date_2000_01_01(Config) when is_list(Config) ->
- ?line Date = {1999, 12, 31}, NextDate = {2000, 1, 1},
- ?line match(next_date(Date), NextDate),
- ?line match(tz_next_date(Date), NextDate),
- ?line NextDate1 = {2000, 1, 2},
- ?line match(next_date(NextDate), NextDate1),
- ?line match(tz_next_date(NextDate), NextDate1).
-
-date_2000_02_29(doc) ->
- "#5 : 2000-02-29: test roll-over from 2000-02-28 to 2000-02-29 to "
- "2000-03-01.";
-date_2000_02_29(suite) ->
- [];
+ Date = {1999, 12, 31}, NextDate = {2000, 1, 1},
+ match(next_date(Date), NextDate),
+ match(tz_next_date(Date), NextDate),
+ NextDate1 = {2000, 1, 2},
+ match(next_date(NextDate), NextDate1),
+ match(tz_next_date(NextDate), NextDate1).
+
+%% #5 : 2000-02-29: test roll-over from 2000-02-28 to 2000-02-29 to
+%% 2000-03-01.
date_2000_02_29(Config) when is_list(Config) ->
- ?line Date = {2000, 2, 28}, NextDate = {2000, 2, 29},
- ?line match(next_date(Date), NextDate),
- ?line match(tz_next_date(Date), NextDate),
- ?line NextDate1 = {2000, 3, 1},
- ?line match(next_date(NextDate), NextDate1),
- ?line match(tz_next_date(NextDate), NextDate1).
-
-date_2001_01_01(doc) ->
- "#6 : 2001-01-01: test roll-over from 2000-12-31 to 2001-01-01.";
-date_2001_01_01(suite) ->
- [];
+ Date = {2000, 2, 28}, NextDate = {2000, 2, 29},
+ match(next_date(Date), NextDate),
+ match(tz_next_date(Date), NextDate),
+ NextDate1 = {2000, 3, 1},
+ match(next_date(NextDate), NextDate1),
+ match(tz_next_date(NextDate), NextDate1).
+
+%% #6 : 2001-01-01: test roll-over from 2000-12-31 to 2001-01-01.
date_2001_01_01(Config) when is_list(Config) ->
- ?line Date = {2000, 12, 31}, NextDate = {2001, 1, 1},
- ?line match(next_date(Date), NextDate),
- ?line match(tz_next_date(Date), NextDate).
-
-date_2001_02_29(doc) ->
- "#7 : 2001-02-29: test roll-over from 2001-02-28 to 2001-03-01.";
-date_2001_02_29(suite) ->
- [];
+ Date = {2000, 12, 31}, NextDate = {2001, 1, 1},
+ match(next_date(Date), NextDate),
+ match(tz_next_date(Date), NextDate).
+
+%% #7 : 2001-02-29: test roll-over from 2001-02-28 to 2001-03-01.
date_2001_02_29(Config) when is_list(Config) ->
- ?line Date = {2001, 2, 28}, NextDate = {2001, 3, 1},
- ?line match(next_date(Date), NextDate),
- ?line match(tz_next_date(Date), NextDate).
-
-date_2004_02_29(doc) ->
- "#8 : 2004-02-29: test roll-over from 2004-02-28 to 2004-02-29 to "
- "2004-03-01.";
-date_2004_02_29(suite) ->
- [];
+ Date = {2001, 2, 28}, NextDate = {2001, 3, 1},
+ match(next_date(Date), NextDate),
+ match(tz_next_date(Date), NextDate).
+
+%% #8 : 2004-02-29: test roll-over from 2004-02-28 to 2004-02-29 to
+%% 2004-03-01.
date_2004_02_29(Config) when is_list(Config) ->
- ?line Date = {2004, 2, 28}, NextDate = {2004, 2, 29},
- ?line match(next_date(Date), NextDate),
- ?line match(tz_next_date(Date), NextDate),
- ?line NextDate1 = {2004, 3, 1},
- ?line match(next_date(NextDate), NextDate1),
- ?line match(tz_next_date(NextDate), NextDate1).
-
+ Date = {2004, 2, 28}, NextDate = {2004, 2, 29},
+ match(next_date(Date), NextDate),
+ match(tz_next_date(Date), NextDate),
+ NextDate1 = {2004, 3, 1},
+ match(next_date(NextDate), NextDate1),
+ match(tz_next_date(NextDate), NextDate1).
+
%%
%% Local functions
%%
@@ -162,7 +138,7 @@ next_date(Date) ->
%% timezonediff
%%
tzd(Date) ->
- ?line {_LDate, {LH, _LM, _LS}} =
+ {_LDate, {LH, _LM, _LS}} =
erlang:universaltime_to_localtime({Date, {12, 0, 0}}),
12 - LH.
@@ -170,15 +146,15 @@ tz_next_date(Date) ->
TZD = tzd(Date),
if
TZD > 0 ->
- ?line Time = {24 - TZD, 0, 0},
- ?line {NDate, _NTime} =
+ Time = {24 - TZD, 0, 0},
+ {NDate, _NTime} =
erlang:localtime_to_universaltime({Date, Time}),
- ?line NDate;
+ NDate;
TZD < 0 ->
- ?line Time = {24 + TZD, 0, 0},
- ?line {NDate, _NTime} =
+ Time = {24 + TZD, 0, 0},
+ {NDate, _NTime} =
erlang:universaltime_to_localtime({Date, Time}),
- ?line NDate;
+ NDate;
true ->
Date
end.
@@ -189,6 +165,3 @@ tz_next_date(Date) ->
match(X, X) ->
ok.
-
-
-
diff --git a/lib/stdlib/test/zip_SUITE.erl b/lib/stdlib/test/zip_SUITE.erl
index 135bfd5867..57ad869f24 100644
--- a/lib/stdlib/test/zip_SUITE.erl
+++ b/lib/stdlib/test/zip_SUITE.erl
@@ -56,12 +56,11 @@ end_per_group(_GroupName, Config) ->
Config.
-borderline(doc) ->
- ["Test creating, listing and extracting one file from an archive "
- "multiple times with different file sizes. Also check that the "
- "modification date of the extracted file has survived."];
+%% Test creating, listing and extracting one file from an archive
+%% multiple times with different file sizes. Also check that the
+%% modification date of the extracted file has survived.
borderline(Config) when is_list(Config) ->
- RootDir = ?config(priv_dir, Config),
+ RootDir = proplists:get_value(priv_dir, Config),
TempDir = filename:join(RootDir, "borderline"),
ok = file:make_dir(TempDir),
@@ -178,7 +177,7 @@ match_output(eof, Expect, Port) ->
kill_port_and_fail(Port, Reason) ->
unlink(Port),
exit(Port, die),
- test_server:fail(Reason).
+ ct:fail(Reason).
make_cmd(Cmd) ->
Cmd.
@@ -215,12 +214,10 @@ random_byte_list(_X, 0, Result) ->
next_random(X) ->
(X*17059465+1) band 16#fffffffff.
-atomic(doc) ->
- ["Test the 'atomic' operations: zip/unzip/list_dir, on archives."
- "Also test the 'cooked' option."];
-atomic(suite) -> [];
+%% Test the 'atomic' operations: zip/unzip/list_dir, on archives.
+%% Also test the 'cooked' option.
atomic(Config) when is_list(Config) ->
- ok = file:set_cwd(?config(priv_dir, Config)),
+ ok = file:set_cwd(proplists:get_value(priv_dir, Config)),
DataFiles = data_files(),
Names = [Name || {Name,_,_} <- DataFiles],
io:format("Names: ~p", [Names]),
@@ -243,12 +240,10 @@ atomic(Config) when is_list(Config) ->
ok.
-openzip_api(doc) ->
- ["Test the openzip_open/2, openzip_get/1, openzip_get/2, openzip_close/1 "
- "and openzip_list_dir/1 functions."];
-openzip_api(suite) -> [];
+%% Test the openzip_open/2, openzip_get/1, openzip_get/2, openzip_close/1
+%% and openzip_list_dir/1 functions.
openzip_api(Config) when is_list(Config) ->
- ok = file:set_cwd(?config(priv_dir, Config)),
+ ok = file:set_cwd(proplists:get_value(priv_dir, Config)),
DataFiles = data_files(),
Names = [Name || {Name, _, _} <- DataFiles],
io:format("Names: ~p", [Names]),
@@ -282,12 +277,10 @@ openzip_api(Config) when is_list(Config) ->
ok.
-zip_api(doc) ->
- ["Test the zip_open/2, zip_get/1, zip_get/2, zip_close/1 "
- "and zip_list_dir/1 functions."];
-zip_api(suite) -> [];
+%% Test the zip_open/2, zip_get/1, zip_get/2, zip_close/1,
+%% and zip_list_dir/1 functions.
zip_api(Config) when is_list(Config) ->
- ok = file:set_cwd(?config(priv_dir, Config)),
+ ok = file:set_cwd(proplists:get_value(priv_dir, Config)),
DataFiles = data_files(),
Names = [Name || {Name, _, _} <- DataFiles],
io:format("Names: ~p", [Names]),
@@ -318,13 +311,11 @@ zip_api(Config) when is_list(Config) ->
%% Clean up.
delete_files([Names]),
- ok.
+ ok.
-open_leak(doc) ->
- ["Test that zip doesn't leak processes and ports where the "
- "controlling process dies without closing an zip opened with "
- "zip:zip_open/1."];
-open_leak(suite) -> [];
+%% Test that zip doesn't leak processes and ports where the
+%% controlling process dies without closing an zip opened with
+%% zip:zip_open/1.
open_leak(Config) when is_list(Config) ->
%% Create a zip archive
Zip = "zip.zip",
@@ -358,13 +349,10 @@ spawned_zip_dead(ZipSrv) ->
false
end.
-unzip_options(doc) ->
- ["Test options for unzip, only cwd and file_list currently"];
-unzip_options(suite) ->
- [];
+%% Test options for unzip, only cwd and file_list currently.
unzip_options(Config) when is_list(Config) ->
- DataDir = ?config(data_dir, Config),
- PrivDir = ?config(priv_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
Long = filename:join(DataDir, "abc.zip"),
%% create a temp directory
@@ -374,28 +362,25 @@ unzip_options(Config) when is_list(Config) ->
FList = ["quotes/rain.txt","wikipedia.txt"],
%% Unzip a zip file in Subdir
- ?line {ok, RetList} = zip:unzip(Long, [{cwd, Subdir},
- {file_list, FList}]),
+ {ok, RetList} = zip:unzip(Long, [{cwd, Subdir},
+ {file_list, FList}]),
%% Verify.
- ?line true = (length(FList) =:= length(RetList)),
- ?line lists:foreach(fun(F)-> {ok,B} = file:read_file(filename:join(DataDir, F)),
- {ok,B} = file:read_file(filename:join(Subdir, F)) end,
- FList),
- ?line lists:foreach(fun(F)-> ok = file:delete(F) end,
- RetList),
+ true = (length(FList) =:= length(RetList)),
+ lists:foreach(fun(F)-> {ok,B} = file:read_file(filename:join(DataDir, F)),
+ {ok,B} = file:read_file(filename:join(Subdir, F)) end,
+ FList),
+ lists:foreach(fun(F)-> ok = file:delete(F) end,
+ RetList),
%% Clean up and verify no more files.
- ?line 0 = delete_files([Subdir]),
+ 0 = delete_files([Subdir]),
ok.
-unzip_jar(doc) ->
- ["Test unzip a jar file (OTP-7382)"];
-unzip_jar(suite) ->
- [];
+%% Test unzip a jar file (OTP-7382).
unzip_jar(Config) when is_list(Config) ->
- DataDir = ?config(data_dir, Config),
- PrivDir = ?config(priv_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
JarFile = filename:join(DataDir, "test.jar"),
%% create a temp directory
@@ -408,28 +393,25 @@ unzip_jar(Config) when is_list(Config) ->
{ok, RetList} = zip:unzip(JarFile),
%% Verify.
- ?line lists:foreach(fun(F)-> {ok,B} = file:read_file(filename:join(DataDir, F)),
- {ok,B} = file:read_file(filename:join(Subdir, F)) end,
- FList),
- ?line lists:foreach(fun(F)-> ok = file:delete(F) end,
- RetList),
+ lists:foreach(fun(F)-> {ok,B} = file:read_file(filename:join(DataDir, F)),
+ {ok,B} = file:read_file(filename:join(Subdir, F)) end,
+ FList),
+ lists:foreach(fun(F)-> ok = file:delete(F) end,
+ RetList),
%% Clean up and verify no more files.
- ?line 0 = delete_files([Subdir]),
+ 0 = delete_files([Subdir]),
ok.
-zip_options(doc) ->
- ["Test the options for unzip, only cwd currently"];
-zip_options(suite) ->
- [];
+%% Test the options for unzip, only cwd currently.
zip_options(Config) when is_list(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
ok = file:set_cwd(PrivDir),
DataFiles = data_files(),
Names = [Name || {Name, _, _} <- DataFiles],
%% Make sure cwd is not where we get the files
- ok = file:set_cwd(?config(data_dir, Config)),
+ ok = file:set_cwd(proplists:get_value(data_dir, Config)),
%% Create a zip archive
{ok, {_,Zip}} =
@@ -459,10 +441,7 @@ zip_options(Config) when is_list(Config) ->
ok.
-list_dir_options(doc) ->
- ["Test the options for list_dir... one day"];
-list_dir_options(suite) ->
- [];
+%% Test the options for list_dir... one day.
list_dir_options(Config) when is_list(Config) ->
ok.
@@ -514,10 +493,9 @@ create_files([]) ->
%% make_dirs([], Dir) ->
%% Dir.
-bad_zip(doc) ->
- ["Try zip:unzip/1 on some corrupted zip files."];
+%% Try zip:unzip/1 on some corrupted zip files.
bad_zip(Config) when is_list(Config) ->
- ok = file:set_cwd(?config(priv_dir, Config)),
+ ok = file:set_cwd(proplists:get_value(priv_dir, Config)),
try_bad("bad_crc", {bad_crc, "abc.txt"}, Config),
try_bad("bad_central_directory", bad_central_directory, Config),
try_bad("bad_file_header", bad_file_header, Config),
@@ -537,7 +515,7 @@ try_bad(N, R, Config) ->
try_bad(Name0, Reason, What, Config) ->
%% Intentionally no macros here.
- DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
Name = Name0 ++ ".zip",
io:format("~nTrying ~s", [Name]),
Full = filename:join(DataDir, Name),
@@ -547,14 +525,13 @@ try_bad(Name0, Reason, What, Config) ->
io:format("Result: ~p\n", [Expected]);
Other ->
io:format("unzip/2 returned ~p (expected ~p)\n", [Other, Expected]),
- test_server:fail({bad_return_value, Other})
+ ct:fail({bad_return_value, Other})
end.
-unzip_to_binary(doc) ->
- ["Test extracting to binary with memory option."];
+%% Test extracting to binary with memory option.
unzip_to_binary(Config) when is_list(Config) ->
- DataDir = ?config(data_dir, Config),
- PrivDir = ?config(priv_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
WorkDir = filename:join(PrivDir, "unzip_to_binary"),
_ = file:make_dir(WorkDir),
@@ -573,11 +550,10 @@ unzip_to_binary(Config) when is_list(Config) ->
ok.
-zip_to_binary(doc) ->
- ["Test compressing to binary with memory option."];
+%% Test compressing to binary with memory option.
zip_to_binary(Config) when is_list(Config) ->
- DataDir = ?config(data_dir, Config),
- PrivDir = ?config(priv_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
WorkDir = filename:join(PrivDir, "zip_to_binary"),
_ = file:make_dir(WorkDir),
@@ -606,8 +582,7 @@ zip_to_binary(Config) when is_list(Config) ->
ok.
-aliases(doc) ->
- ["Test using the aliases, extract/2, table/2 and create/3"];
+%% Test using the aliases, extract/2, table/2 and create/3.
aliases(Config) when is_list(Config) ->
{_, _, X0} = erlang:timestamp(),
Size = 100,
@@ -628,11 +603,10 @@ aliases(Config) when is_list(Config) ->
-unzip_from_binary(doc) ->
- ["Test extracting a zip archive from a binary."];
+%% Test extracting a zip archive from a binary.
unzip_from_binary(Config) when is_list(Config) ->
- DataDir = ?config(data_dir, Config),
- PrivDir = ?config(priv_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
ExtractDir = filename:join(PrivDir, "extract_from_binary"),
ok = file:make_dir(ExtractDir),
Archive = filename:join(ExtractDir, "abc.zip"),
@@ -698,11 +672,9 @@ do_delete_files([Item|Rest], Cnt) ->
end,
do_delete_files(Rest, Cnt + DelCnt).
-compress_control(doc) ->
- ["Test control of which files that should be compressed"];
-compress_control(suite) -> [];
+%% Test control of which files that should be compressed.
compress_control(Config) when is_list(Config) ->
- ok = file:set_cwd(?config(priv_dir, Config)),
+ ok = file:set_cwd(proplists:get_value(priv_dir, Config)),
Dir = "compress_control",
Files = [
{Dir, dir, $d},
@@ -833,32 +805,32 @@ extensions([], Old) ->
Old.
foldl(Config) ->
- PrivDir = ?config(priv_dir, Config),
+ PrivDir = proplists:get_value(priv_dir, Config),
File = filename:join([PrivDir, "foldl.zip"]),
FooBin = <<"FOO">>,
BarBin = <<"BAR">>,
Files = [{"foo", FooBin}, {"bar", BarBin}],
- ?line {ok, {File, Bin}} = zip:create(File, Files, [memory]),
+ {ok, {File, Bin}} = zip:create(File, Files, [memory]),
ZipFun = fun(N, I, B, Acc) -> [{N, B(), I()} | Acc] end,
- ?line {ok, FileSpec} = zip:foldl(ZipFun, [], {File, Bin}),
- ?line [{"bar", BarBin, #file_info{}}, {"foo", FooBin, #file_info{}}] = FileSpec,
- ?line {ok, {File, Bin}} = zip:create(File, lists:reverse(FileSpec), [memory]),
- ?line {foo_bin, FooBin} =
+ {ok, FileSpec} = zip:foldl(ZipFun, [], {File, Bin}),
+ [{"bar", BarBin, #file_info{}}, {"foo", FooBin, #file_info{}}] = FileSpec,
+ {ok, {File, Bin}} = zip:create(File, lists:reverse(FileSpec), [memory]),
+ {foo_bin, FooBin} =
try
zip:foldl(fun("foo", _, B, _) -> throw(B()); (_, _, _, Acc) -> Acc end, [], {File, Bin})
catch
throw:FooBin ->
{foo_bin, FooBin}
end,
- ?line ok = file:write_file(File, Bin),
- ?line {ok, FileSpec} = zip:foldl(ZipFun, [], File),
+ ok = file:write_file(File, Bin),
+ {ok, FileSpec} = zip:foldl(ZipFun, [], File),
- ?line {error, einval} = zip:foldl(fun() -> ok end, [], File),
- ?line {error, einval} = zip:foldl(ZipFun, [], 42),
- ?line {error, einval} = zip:foldl(ZipFun, [], {File, 42}),
+ {error, einval} = zip:foldl(fun() -> ok end, [], File),
+ {error, einval} = zip:foldl(ZipFun, [], 42),
+ {error, einval} = zip:foldl(ZipFun, [], {File, 42}),
- ?line ok = file:delete(File),
- ?line {error, enoent} = zip:foldl(ZipFun, [], File),
+ ok = file:delete(File),
+ {error, enoent} = zip:foldl(ZipFun, [], File),
ok.
diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl
index 3732b0fc85..87de31919f 100644
--- a/lib/tools/src/cover.erl
+++ b/lib/tools/src/cover.erl
@@ -2002,9 +2002,7 @@ munge_expr({lc,Line,Expr,Qs}, Vars) ->
{MungedQs, Vars3} = munge_qualifiers(Qs, Vars2),
{{lc,Line,MungedExpr,MungedQs}, Vars3};
munge_expr({bc,Line,Expr,Qs}, Vars) ->
- {bin,BLine,[{bin_element,EL,Val,Sz,TSL}|Es]} = Expr,
- Expr2 = {bin,BLine,[{bin_element,EL,Val,Sz,TSL}|Es]},
- {MungedExpr,Vars2} = munge_expr(Expr2, Vars),
+ {MungedExpr,Vars2} = munge_expr(?BLOCK1(Expr), Vars),
{MungedQs, Vars3} = munge_qualifiers(Qs, Vars2),
{{bc,Line,MungedExpr,MungedQs}, Vars3};
munge_expr({block,Line,Body}, Vars) ->
diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl
index b9a9cd5be4..d4b346c407 100644
--- a/lib/tools/test/cover_SUITE.erl
+++ b/lib/tools/test/cover_SUITE.erl
@@ -29,7 +29,7 @@ all() ->
NoStartStop = [eif,otp_5305,otp_5418,otp_7095,otp_8273,
otp_8340,otp_8188,compile_beam_opts,eep37,
analyse_no_beam, line_0, compile_beam_no_file,
- otp_13277],
+ otp_13277, otp_13289],
StartStop = [start, compile, analyse, misc, stop,
distribution, reconnect, die_and_reconnect,
dont_reconnect_after_stop, stop_node_after_disconnect,
@@ -1253,7 +1253,7 @@ otp_8340(doc) ->
["OTP-8340. Bug."];
otp_8340(suite) -> [];
otp_8340(Config) when is_list(Config) ->
- ?line [{{t,1},1},{{t,4},1}] =
+ [{{t,1},1},{{t,2},1},{{t,4},1}] =
analyse_expr(<<"<< \n"
" <<3:2, \n"
" SeqId:62>> \n"
@@ -1547,10 +1547,8 @@ comprehension_8188(Cf) ->
" true]. \n" % 2
" two() -> 2">>, Cf), % 1
- %% The template cannot have a counter since it is not allowed to
- %% be a block.
?line [{{t,1},1},
- %% {{t,2},2},
+ {{t,2},2},
{{t,3},1},
{{t,4},1},
{{t,5},0},
@@ -1560,7 +1558,7 @@ comprehension_8188(Cf) ->
{{t,13},2},
{{t,14},2}] =
analyse_expr(<<"<< \n" % 1
- " << (X*2) >> || \n" % 2 (now: 0)
+ " << (X*2) >> || \n" % 2
" <<X>> <= << (case two() of\n"
" 2 -> 1;\n" % 1
" _ -> 2\n" % 0
@@ -1575,7 +1573,7 @@ comprehension_8188(Cf) ->
"two() -> 2">>, Cf),
?line [{{t,1},1},
- %% {{t,2},4},
+ {{t,2},4},
{{t,4},1},
{{t,6},1},
{{t,7},0},
@@ -1584,7 +1582,7 @@ comprehension_8188(Cf) ->
{{t,12},4},
{{t,13},1}] =
analyse_expr(<<"<< \n" % 1
- " << (2)\n" % 4 (now: 0)
+ " << (2)\n" % 4
" :(8) >> || \n"
" <<X>> <= << 1,\n" % 1
" (case two() of \n"
@@ -1766,6 +1764,21 @@ otp_13277(Config) ->
?line ok = file:delete(File),
ok.
+%% Test general expressions in a binary comprehension.
+otp_13289(Config) ->
+ Test = <<"-module(t).
+ -export([t/0]).
+
+ t() ->
+ << (id(<<I>>)) || I <- [1,2,3] >>.
+
+ id(I) -> I.
+ ">>,
+ File = cc_mod(t, Test, Config),
+ <<1,2,3>> = t:t(),
+ ok = file:delete(File),
+ ok.
+
%%--Auxiliary------------------------------------------------------------
analyse_expr(Expr, Config) ->
diff --git a/lib/wx/api_gen/gl_gen.erl b/lib/wx/api_gen/gl_gen.erl
index 8b24e38cc0..ab8f842d31 100644
--- a/lib/wx/api_gen/gl_gen.erl
+++ b/lib/wx/api_gen/gl_gen.erl
@@ -191,7 +191,7 @@ parse_define([#xmlElement{name=initializer,content=Contents}|_R],Def,_Os) ->
try
case Val0 of
"0x" ++ Val1 ->
- _ = http_util:hexlist_to_integer(Val1),
+ _ = list_to_integer(Val1, 16),
Def#def{val=Val1, type=hex};
_ ->
Val = list_to_integer(Val0),
diff --git a/lib/wx/api_gen/wx_extra/added_func.h b/lib/wx/api_gen/wx_extra/added_func.h
index 0698621c5f..417188cc8a 100644
--- a/lib/wx/api_gen/wx_extra/added_func.h
+++ b/lib/wx/api_gen/wx_extra/added_func.h
@@ -32,3 +32,10 @@ class wxToolBar {
wxToolBarToolBase * AddStretchableSpace();
wxToolBarToolBase * InsertStretchableSpace(size_t pos);
};
+
+
+class wxWindow {
+ public:
+ bool IsDoubleBuffered();
+ void SetDoubleBuffered(bool on);
+};
diff --git a/lib/wx/api_gen/wx_gen.erl b/lib/wx/api_gen/wx_gen.erl
index 5cf09e5eee..ec2c35cc0e 100644
--- a/lib/wx/api_gen/wx_gen.erl
+++ b/lib/wx/api_gen/wx_gen.erl
@@ -705,6 +705,8 @@ parse_type2(["unsigned"|R],Info,Opts,T=#type{mod=Mod}) ->
parse_type2(R,Info,Opts,T#type{mod=[unsigned|Mod]});
parse_type2(["int"|R],Info,Opts, T) ->
parse_type2(R,Info,Opts,T#type{name=int,base=int});
+parse_type2(["wxByte"|R],Info,Opts, T) ->
+ parse_type2(R,Info,Opts,T#type{name=int,base=int});
parse_type2(["char"|R],Info,Opts, T) ->
parse_type2(R,Info,Opts,T#type{name="char",base=int});
parse_type2([N="size_t"|R], Info, Opts, T) ->
@@ -1373,7 +1375,7 @@ extract_enum3([#xmlElement{name=initializer,content=Cs}|_],_Id,[{Name,_}|Acc]) -
try
case Val0 of
["0x" ++ Val1] ->
- Val = http_util:hexlist_to_integer(Val1),
+ Val = list_to_integer(Val1, 16),
{[{Name, Val}|Acc], Val+1};
["1", "<<", Shift] ->
Val = 1 bsl list_to_integer(Shift),
@@ -1429,7 +1431,7 @@ extract_def([#xmlElement{name=param}|_],Name,_) ->
extract_def([#xmlElement{name=initializer,content=Cs}|_R],N,Skip) ->
Val0 = extract_def2(Cs),
case Val0 of
- "0x" ++ Val1 -> {N, http_util:hexlist_to_integer(Val1)};
+ "0x" ++ Val1 -> {N, list_to_integer(Val1, 16)};
_ ->
try
Val = list_to_integer(Val0),
@@ -1451,7 +1453,7 @@ extract_def(_,N,_) ->
throw(N).
extract_def2([#xmlText{value=Val}|R]) ->
- strip_comment(string:strip(Val)) ++ extract_def2(R);
+ string:strip(strip_comment(Val)) ++ extract_def2(R);
extract_def2([#xmlElement{content=Cs}|R]) ->
extract_def2(Cs) ++ extract_def2(R);
extract_def2([]) -> [].
diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl
index ed7b27f3bf..71b2038c56 100644
--- a/lib/wx/api_gen/wx_gen_cpp.erl
+++ b/lib/wx/api_gen/wx_gen_cpp.erl
@@ -116,8 +116,13 @@ taylormade_class(#class{name=CName, methods=Ms}) ->
gen_constructors(#class{name=Class, methods=Ms0}) ->
Ms = lists:append(Ms0),
Cs = lists:filter(fun(#method{method_type=MT}) -> MT =:= constructor end, Ms),
- [gen_constructor(Class, Const) || Const <- Cs].
-
+ [gen_constructor(Class, Const) || Const <- Cs],
+ case need_copy_constr(Class) of
+ true ->
+ w(" E~s(~s copy) : ~s(copy) {};~n", [Class, Class, Class]);
+ false ->
+ ignore
+ end.
gen_constructor(_Class, #method{where=merged_c}) -> ok;
gen_constructor(_Class, #method{where=erl_no_opt}) -> ok;
gen_constructor(Class, _M=#method{params=Ps, opts=FOpts}) ->
@@ -145,6 +150,14 @@ gen_constructor(Class, _M=#method{params=Ps, opts=FOpts}) ->
Endif andalso w("#endif~n", []),
ok.
+
+need_copy_constr("wxFont") -> true;
+need_copy_constr("wxIcon") -> true;
+need_copy_constr("wxImage") -> true;
+need_copy_constr("wxBitmap") -> true;
+%%need_copy_constr("wxGraphics" ++ _) -> true;
+need_copy_constr(_) -> false.
+
gen_type(#type{name=Type, ref={pointer,1}, mod=Mod},_) ->
mods(Mod) ++ to_string(Type) ++ " * ";
gen_type(#type{name=Type, ref={pointer,2}, mod=Mod},_) ->
@@ -805,18 +818,21 @@ return_res1(#type{name=Type,base={comp,_,_},single=array,by_val=true}) ->
{Type ++ " Result = ", ""};
return_res1(#type{name=Type,single=true,by_val=true, base={class, _}}) ->
%% Temporary memory leak !!!!!!
- case Type of
- "wxImage" -> ok;
- "wxFont" -> ok;
- "wxBitmap" -> ok;
- "wxIcon" -> ok;
- "wxGraphics" ++ _ -> ok;
+ case {need_copy_constr(Type),Type} of
+ {true, _} -> ok;
+ {_, "wxGraphics" ++ _} -> ok;
_ ->
io:format("~s::~s Building return value of temp ~s~n",
[get(current_class),get(current_func),Type])
end,
- {Type ++ " * Result = new " ++ Type ++ "(", "); newPtr((void *) Result,"
- ++ "3, memenv);"};
+ case need_copy_constr(Type) of
+ true ->
+ {Type ++ " * Result = new E" ++ Type ++ "(", "); newPtr((void *) Result,"
+ ++ "3, memenv);"};
+ false ->
+ {Type ++ " * Result = new " ++ Type ++ "(", "); newPtr((void *) Result,"
+ ++ "3, memenv);"}
+ end;
return_res1(#type{base={enum,_Type},single=true,by_val=true}) ->
{"int Result = " , ""};
return_res1(#type{name="wxCharBuffer", base={binary,_},single=true,by_val=true}) ->
diff --git a/lib/wx/api_gen/wx_gen_erl.erl b/lib/wx/api_gen/wx_gen_erl.erl
index 9df5cb853e..c28b9238dc 100644
--- a/lib/wx/api_gen/wx_gen_erl.erl
+++ b/lib/wx/api_gen/wx_gen_erl.erl
@@ -1169,7 +1169,7 @@ build_enum_ints(#enum{from=From, vals=Vals},Done) ->
const_value(V,_,_) when is_integer(V) -> integer_to_list(V);
const_value(V = "16#" ++ IntList,_,_) ->
- _ = http_util:hexlist_to_integer(IntList), %% ASSERT
+ _ = list_to_integer(IntList, 16), %% ASSERT
V;
const_value(V0, EnumClass, Ignore) ->
try
diff --git a/lib/wx/api_gen/wxapi.conf b/lib/wx/api_gen/wxapi.conf
index f5a6751696..b8458e901b 100644
--- a/lib/wx/api_gen/wxapi.conf
+++ b/lib/wx/api_gen/wxapi.conf
@@ -150,7 +150,12 @@
'ShouldInheritColours','Show','Thaw','TransferDataFromWindow',
'TransferDataToWindow',%'UnregisterHotKey',
'Update','UpdateWindowUI','Validate',
- 'WarpPointer']}.
+ 'WarpPointer',
+ {'SetTransparent', [{test_if, "wxCHECK_VERSION(2,8,12)"}]},
+ {'CanSetTransparent', [{test_if, "wxCHECK_VERSION(2,8,12)"}]},
+ {'IsDoubleBuffered', [{test_if, "wxCHECK_VERSION(3,0,0)"}]},
+ {'SetDoubleBuffered', [{test_if, "wxCHECK_VERSION(3,0,0) && !defined(__WXMAC__)"}]}
+]}.
{class, wxTopLevelWindowGTK, wxWindow,
[{alias, [{wxTopLevelWindowGTK, wxTopLevelWindow}]}],
diff --git a/lib/wx/c_src/gen/wxe_derived_dest.h b/lib/wx/c_src/gen/wxe_derived_dest.h
index 1dcf029244..fc0ae0d9fc 100644
--- a/lib/wx/c_src/gen/wxe_derived_dest.h
+++ b/lib/wx/c_src/gen/wxe_derived_dest.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2015. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -180,6 +180,7 @@ class EwxBitmap : public wxBitmap {
EwxBitmap(const wxString& filename,wxBitmapType type) : wxBitmap(filename,type) {};
EwxBitmap(const wxImage& image,int depth) : wxBitmap(image,depth) {};
EwxBitmap() : wxBitmap() {};
+ EwxBitmap(wxBitmap copy) : wxBitmap(copy) {};
};
class EwxIcon : public wxIcon {
@@ -187,6 +188,7 @@ class EwxIcon : public wxIcon {
EwxIcon(const wxString& filename,wxBitmapType type,int desiredWidth,int desiredHeight) : wxIcon(filename,type,desiredWidth,desiredHeight) {};
EwxIcon(const wxIconLocation& loc) : wxIcon(loc) {};
EwxIcon() : wxIcon() {};
+ EwxIcon(wxIcon copy) : wxIcon(copy) {};
};
class EwxCursor : public wxCursor {
@@ -215,6 +217,7 @@ class EwxImage : public wxImage {
EwxImage(const wxString& name,const wxString& mimetype,int index) : wxImage(name,mimetype,index) {};
EwxImage(const wxString& name,long type,int index) : wxImage(name,type,index) {};
EwxImage() : wxImage() {};
+ EwxImage(wxImage copy) : wxImage(copy) {};
};
class EwxBrush : public wxBrush {
@@ -300,6 +303,7 @@ class EwxFont : public wxFont {
EwxFont(int size,wxFontFamily family,wxFontStyle style,int weight,bool underlined,const wxString& face,wxFontEncoding encoding) : wxFont(size,family,style,weight,underlined,face,encoding) {};
EwxFont(const wxString& fontname) : wxFont(fontname) {};
EwxFont() : wxFont() {};
+ EwxFont(wxFont copy) : wxFont(copy) {};
};
class EwxToolTip : public wxToolTip {
diff --git a/lib/wx/c_src/gen/wxe_funcs.cpp b/lib/wx/c_src/gen/wxe_funcs.cpp
index b2830dbc63..03b0baf875 100644
--- a/lib/wx/c_src/gen/wxe_funcs.cpp
+++ b/lib/wx/c_src/gen/wxe_funcs.cpp
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2015. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -519,7 +519,7 @@ case wxWindow_GetExtraStyle: { // wxWindow::GetExtraStyle
case wxWindow_GetFont: { // wxWindow::GetFont
wxWindow *This = (wxWindow *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- wxFont * Result = new wxFont(This->GetFont()); newPtr((void *) Result,3, memenv);;
+ wxFont * Result = new EwxFont(This->GetFont()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxFont");
break;
}
@@ -1668,10 +1668,47 @@ case wxWindow_WarpPointer: { // wxWindow::WarpPointer
This->WarpPointer(*x,*y);
break;
}
+#if wxCHECK_VERSION(2,8,12)
+case wxWindow_SetTransparent: { // wxWindow::SetTransparent
+ wxWindow *This = (wxWindow *) getPtr(bp,memenv); bp += 4;
+ int * alpha = (int *) bp; bp += 4;
+ if(!This) throw wxe_badarg(0);
+ bool Result = This->SetTransparent(*alpha);
+ rt.addBool(Result);
+ break;
+}
+#endif
+#if wxCHECK_VERSION(2,8,12)
+case wxWindow_CanSetTransparent: { // wxWindow::CanSetTransparent
+ wxWindow *This = (wxWindow *) getPtr(bp,memenv); bp += 4;
+ if(!This) throw wxe_badarg(0);
+ bool Result = This->CanSetTransparent();
+ rt.addBool(Result);
+ break;
+}
+#endif
+#if wxCHECK_VERSION(3,0,0)
+case wxWindow_IsDoubleBuffered: { // wxWindow::IsDoubleBuffered
+ wxWindow *This = (wxWindow *) getPtr(bp,memenv); bp += 4;
+ if(!This) throw wxe_badarg(0);
+ bool Result = This->IsDoubleBuffered();
+ rt.addBool(Result);
+ break;
+}
+#endif
+#if wxCHECK_VERSION(3,0,0) && !defined(__WXMAC__)
+case wxWindow_SetDoubleBuffered: { // wxWindow::SetDoubleBuffered
+ wxWindow *This = (wxWindow *) getPtr(bp,memenv); bp += 4;
+ bool * on = (bool *) bp; bp += 4;
+ if(!This) throw wxe_badarg(0);
+ This->SetDoubleBuffered(*on);
+ break;
+}
+#endif
case wxTopLevelWindow_GetIcon: { // wxTopLevelWindow::GetIcon
wxTopLevelWindow *This = (wxTopLevelWindow *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- const wxIcon * Result = new wxIcon(This->GetIcon()); newPtr((void *) Result,3, memenv);;
+ const wxIcon * Result = new EwxIcon(This->GetIcon()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxIcon");
break;
}
@@ -3065,7 +3102,7 @@ case wxGrid_GetCellFont: { // wxGrid::GetCellFont
int * row = (int *) bp; bp += 4;
int * col = (int *) bp; bp += 4;
if(!This) throw wxe_badarg(0);
- wxFont * Result = new wxFont(This->GetCellFont(*row,*col)); newPtr((void *) Result,3, memenv);;
+ wxFont * Result = new EwxFont(This->GetCellFont(*row,*col)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxFont");
break;
}
@@ -3160,7 +3197,7 @@ case wxGrid_GetDefaultCellBackgroundColour: { // wxGrid::GetDefaultCellBackgroun
case wxGrid_GetDefaultCellFont: { // wxGrid::GetDefaultCellFont
wxGrid *This = (wxGrid *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- wxFont * Result = new wxFont(This->GetDefaultCellFont()); newPtr((void *) Result,3, memenv);;
+ wxFont * Result = new EwxFont(This->GetDefaultCellFont()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxFont");
break;
}
@@ -3299,7 +3336,7 @@ case wxGrid_GetLabelBackgroundColour: { // wxGrid::GetLabelBackgroundColour
case wxGrid_GetLabelFont: { // wxGrid::GetLabelFont
wxGrid *This = (wxGrid *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- wxFont * Result = new wxFont(This->GetLabelFont()); newPtr((void *) Result,3, memenv);;
+ wxFont * Result = new EwxFont(This->GetLabelFont()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxFont");
break;
}
@@ -9061,7 +9098,7 @@ case wxBitmap_new_2_1: { // wxBitmap::wxBitmap
case wxBitmap_ConvertToImage: { // wxBitmap::ConvertToImage
wxBitmap *This = (wxBitmap *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- wxImage * Result = new wxImage(This->ConvertToImage()); newPtr((void *) Result,3, memenv);;
+ wxImage * Result = new EwxImage(This->ConvertToImage()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxImage");
break;
}
@@ -9132,7 +9169,7 @@ case wxBitmap_GetSubBitmap: { // wxBitmap::GetSubBitmap
int * rectH = (int *) bp; bp += 4;
wxRect rect = wxRect(*rectX,*rectY,*rectW,*rectH);
if(!This) throw wxe_badarg(0);
- wxBitmap * Result = new wxBitmap(This->GetSubBitmap(rect)); newPtr((void *) Result,3, memenv);;
+ wxBitmap * Result = new EwxBitmap(This->GetSubBitmap(rect)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxBitmap");
break;
}
@@ -9314,7 +9351,7 @@ case wxIconBundle_GetIcon_1_1: { // wxIconBundle::GetIcon
int * sizeH = (int *) bp; bp += 4;
wxSize size = wxSize(*sizeW,*sizeH);
if(!This) throw wxe_badarg(0);
- const wxIcon * Result = new wxIcon(This->GetIcon(size)); newPtr((void *) Result,3, memenv);;
+ const wxIcon * Result = new EwxIcon(This->GetIcon(size)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxIcon");
break;
}
@@ -9328,7 +9365,7 @@ case wxIconBundle_GetIcon_1_0: { // wxIconBundle::GetIcon
} break;
}};
if(!This) throw wxe_badarg(0);
- const wxIcon * Result = new wxIcon(This->GetIcon(size)); newPtr((void *) Result,3, memenv);;
+ const wxIcon * Result = new EwxIcon(This->GetIcon(size)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxIcon");
break;
}
@@ -9537,7 +9574,7 @@ case wxImage_Blur: { // wxImage::Blur
wxImage *This = (wxImage *) getPtr(bp,memenv); bp += 4;
int * radius = (int *) bp; bp += 4;
if(!This) throw wxe_badarg(0);
- wxImage * Result = new wxImage(This->Blur(*radius)); newPtr((void *) Result,3, memenv);;
+ wxImage * Result = new EwxImage(This->Blur(*radius)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxImage");
break;
}
@@ -9545,7 +9582,7 @@ case wxImage_BlurHorizontal: { // wxImage::BlurHorizontal
wxImage *This = (wxImage *) getPtr(bp,memenv); bp += 4;
int * radius = (int *) bp; bp += 4;
if(!This) throw wxe_badarg(0);
- wxImage * Result = new wxImage(This->BlurHorizontal(*radius)); newPtr((void *) Result,3, memenv);;
+ wxImage * Result = new EwxImage(This->BlurHorizontal(*radius)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxImage");
break;
}
@@ -9553,7 +9590,7 @@ case wxImage_BlurVertical: { // wxImage::BlurVertical
wxImage *This = (wxImage *) getPtr(bp,memenv); bp += 4;
int * radius = (int *) bp; bp += 4;
if(!This) throw wxe_badarg(0);
- wxImage * Result = new wxImage(This->BlurVertical(*radius)); newPtr((void *) Result,3, memenv);;
+ wxImage * Result = new EwxImage(This->BlurVertical(*radius)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxImage");
break;
}
@@ -9592,7 +9629,7 @@ case wxImage_ConvertToGreyscale: { // wxImage::ConvertToGreyscale
} break;
}};
if(!This) throw wxe_badarg(0);
- wxImage * Result = new wxImage(This->ConvertToGreyscale(lr,lg,lb)); newPtr((void *) Result,3, memenv);;
+ wxImage * Result = new EwxImage(This->ConvertToGreyscale(lr,lg,lb)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxImage");
break;
}
@@ -9602,14 +9639,14 @@ case wxImage_ConvertToMono: { // wxImage::ConvertToMono
unsigned int * g = (unsigned int *) bp; bp += 4;
unsigned int * b = (unsigned int *) bp; bp += 4;
if(!This) throw wxe_badarg(0);
- wxImage * Result = new wxImage(This->ConvertToMono(*r,*g,*b)); newPtr((void *) Result,3, memenv);;
+ wxImage * Result = new EwxImage(This->ConvertToMono(*r,*g,*b)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxImage");
break;
}
case wxImage_Copy: { // wxImage::Copy
wxImage *This = (wxImage *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- wxImage * Result = new wxImage(This->Copy()); newPtr((void *) Result,3, memenv);;
+ wxImage * Result = new EwxImage(This->Copy()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxImage");
break;
}
@@ -9831,7 +9868,7 @@ case wxImage_GetSubImage: { // wxImage::GetSubImage
int * rectH = (int *) bp; bp += 4;
wxRect rect = wxRect(*rectX,*rectY,*rectW,*rectH);
if(!This) throw wxe_badarg(0);
- wxImage * Result = new wxImage(This->GetSubImage(rect)); newPtr((void *) Result,3, memenv);;
+ wxImage * Result = new EwxImage(This->GetSubImage(rect)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxImage");
break;
}
@@ -9976,7 +10013,7 @@ case wxImage_Mirror: { // wxImage::Mirror
} break;
}};
if(!This) throw wxe_badarg(0);
- wxImage * Result = new wxImage(This->Mirror(horizontally)); newPtr((void *) Result,3, memenv);;
+ wxImage * Result = new EwxImage(This->Mirror(horizontally)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxImage");
break;
}
@@ -10057,7 +10094,7 @@ case wxImage_Rotate: { // wxImage::Rotate
} break;
}};
if(!This) throw wxe_badarg(0);
- wxImage * Result = new wxImage(This->Rotate(*angle,centre_of_rotation,interpolating,offset_after_rotation)); newPtr((void *) Result,3, memenv);;
+ wxImage * Result = new EwxImage(This->Rotate(*angle,centre_of_rotation,interpolating,offset_after_rotation)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxImage");
break;
}
@@ -10079,7 +10116,7 @@ case wxImage_Rotate90: { // wxImage::Rotate90
} break;
}};
if(!This) throw wxe_badarg(0);
- wxImage * Result = new wxImage(This->Rotate90(clockwise)); newPtr((void *) Result,3, memenv);;
+ wxImage * Result = new EwxImage(This->Rotate90(clockwise)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxImage");
break;
}
@@ -10129,7 +10166,7 @@ quality = *(wxImageResizeQuality *) bp; bp += 4;;
} break;
}};
if(!This) throw wxe_badarg(0);
- wxImage * Result = new wxImage(This->Scale(*width,*height,quality)); newPtr((void *) Result,3, memenv);;
+ wxImage * Result = new EwxImage(This->Scale(*width,*height,quality)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxImage");
break;
}
@@ -10157,7 +10194,7 @@ case wxImage_Size: { // wxImage::Size
} break;
}};
if(!This) throw wxe_badarg(0);
- wxImage * Result = new wxImage(This->Size(size,pos,r,g,b)); newPtr((void *) Result,3, memenv);;
+ wxImage * Result = new EwxImage(This->Size(size,pos,r,g,b)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxImage");
break;
}
@@ -10617,7 +10654,7 @@ case wxRegion_Contains_1_1: { // wxRegion::Contains
case wxRegion_ConvertToBitmap: { // wxRegion::ConvertToBitmap
wxRegion *This = (wxRegion *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- wxBitmap * Result = new wxBitmap(This->ConvertToBitmap()); newPtr((void *) Result,3, memenv);;
+ wxBitmap * Result = new EwxBitmap(This->ConvertToBitmap()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxBitmap");
break;
}
@@ -13344,28 +13381,28 @@ validator = (wxValidator *) getPtr(bp,memenv); bp += 4;
case wxBitmapButton_GetBitmapDisabled: { // wxBitmapButton::GetBitmapDisabled
wxBitmapButton *This = (wxBitmapButton *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- const wxBitmap * Result = new wxBitmap(This->GetBitmapDisabled()); newPtr((void *) Result,3, memenv);;
+ const wxBitmap * Result = new EwxBitmap(This->GetBitmapDisabled()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxBitmap");
break;
}
case wxBitmapButton_GetBitmapFocus: { // wxBitmapButton::GetBitmapFocus
wxBitmapButton *This = (wxBitmapButton *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- const wxBitmap * Result = new wxBitmap(This->GetBitmapFocus()); newPtr((void *) Result,3, memenv);;
+ const wxBitmap * Result = new EwxBitmap(This->GetBitmapFocus()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxBitmap");
break;
}
case wxBitmapButton_GetBitmapLabel: { // wxBitmapButton::GetBitmapLabel
wxBitmapButton *This = (wxBitmapButton *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- const wxBitmap * Result = new wxBitmap(This->GetBitmapLabel()); newPtr((void *) Result,3, memenv);;
+ const wxBitmap * Result = new EwxBitmap(This->GetBitmapLabel()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxBitmap");
break;
}
case wxBitmapButton_GetBitmapSelected: { // wxBitmapButton::GetBitmapSelected
wxBitmapButton *This = (wxBitmapButton *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- const wxBitmap * Result = new wxBitmap(This->GetBitmapSelected()); newPtr((void *) Result,3, memenv);;
+ const wxBitmap * Result = new EwxBitmap(This->GetBitmapSelected()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxBitmap");
break;
}
@@ -15483,7 +15520,7 @@ case wxListCtrl_GetItemFont: { // wxListCtrl::GetItemFont
wxListCtrl *This = (wxListCtrl *) getPtr(bp,memenv); bp += 4;
int * item = (int *) bp; bp += 4;
if(!This) throw wxe_badarg(0);
- wxFont * Result = new wxFont(This->GetItemFont(*item)); newPtr((void *) Result,3, memenv);;
+ wxFont * Result = new EwxFont(This->GetItemFont(*item)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxFont");
break;
}
@@ -16029,7 +16066,7 @@ case wxListItem_GetColumn: { // wxListItem::GetColumn
case wxListItem_GetFont: { // wxListItem::GetFont
wxListItem *This = (wxListItem *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- wxFont * Result = new wxFont(This->GetFont()); newPtr((void *) Result,3, memenv);;
+ wxFont * Result = new EwxFont(This->GetFont()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxFont");
break;
}
@@ -16376,7 +16413,7 @@ case wxImageList_GetBitmap: { // wxImageList::GetBitmap
wxImageList *This = (wxImageList *) getPtr(bp,memenv); bp += 4;
int * index = (int *) bp; bp += 4;
if(!This) throw wxe_badarg(0);
- wxBitmap * Result = new wxBitmap(This->GetBitmap(*index)); newPtr((void *) Result,3, memenv);;
+ wxBitmap * Result = new EwxBitmap(This->GetBitmap(*index)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxBitmap");
break;
}
@@ -16384,7 +16421,7 @@ case wxImageList_GetIcon: { // wxImageList::GetIcon
wxImageList *This = (wxImageList *) getPtr(bp,memenv); bp += 4;
int * index = (int *) bp; bp += 4;
if(!This) throw wxe_badarg(0);
- wxIcon * Result = new wxIcon(This->GetIcon(*index)); newPtr((void *) Result,3, memenv);;
+ wxIcon * Result = new EwxIcon(This->GetIcon(*index)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxIcon");
break;
}
@@ -16495,7 +16532,7 @@ case wxTextAttr_GetBackgroundColour: { // wxTextAttr::GetBackgroundColour
case wxTextAttr_GetFont: { // wxTextAttr::GetFont
wxTextAttr *This = (wxTextAttr *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- const wxFont * Result = new wxFont(This->GetFont()); newPtr((void *) Result,3, memenv);;
+ const wxFont * Result = new EwxFont(This->GetFont()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxFont");
break;
}
@@ -18841,7 +18878,7 @@ case wxTreeCtrl_GetItemFont: { // wxTreeCtrl::GetItemFont
bp += 4; /* Align */
wxTreeItemId item = wxTreeItemId((void *) *(wxUint64 *) bp); bp += 8;
if(!This) throw wxe_badarg(0);
- wxFont * Result = new wxFont(This->GetItemFont(item)); newPtr((void *) Result,3, memenv);;
+ wxFont * Result = new EwxFont(This->GetItemFont(item)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxFont");
break;
}
@@ -19868,7 +19905,7 @@ case wxStaticBitmap_Create: { // wxStaticBitmap::Create
case wxStaticBitmap_GetBitmap: { // wxStaticBitmap::GetBitmap
wxStaticBitmap *This = (wxStaticBitmap *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- wxBitmap * Result = new wxBitmap(This->GetBitmap()); newPtr((void *) Result,3, memenv);;
+ wxBitmap * Result = new EwxBitmap(This->GetBitmap()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxBitmap");
break;
}
@@ -21558,7 +21595,7 @@ validator = (wxValidator *) getPtr(bp,memenv); bp += 4;
case wxFontPickerCtrl_GetSelectedFont: { // wxFontPickerCtrl::GetSelectedFont
wxFontPickerCtrl *This = (wxFontPickerCtrl *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- wxFont * Result = new wxFont(This->GetSelectedFont()); newPtr((void *) Result,3, memenv);;
+ wxFont * Result = new EwxFont(This->GetSelectedFont()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxFont");
break;
}
@@ -21936,7 +21973,7 @@ case wxFontData_GetColour: { // wxFontData::GetColour
case wxFontData_GetChosenFont: { // wxFontData::GetChosenFont
wxFontData *This = (wxFontData *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- wxFont * Result = new wxFont(This->GetChosenFont()); newPtr((void *) Result,3, memenv);;
+ wxFont * Result = new EwxFont(This->GetChosenFont()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxFont");
break;
}
@@ -21950,7 +21987,7 @@ case wxFontData_GetEnableEffects: { // wxFontData::GetEnableEffects
case wxFontData_GetInitialFont: { // wxFontData::GetInitialFont
wxFontData *This = (wxFontData *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- wxFont * Result = new wxFont(This->GetInitialFont()); newPtr((void *) Result,3, memenv);;
+ wxFont * Result = new EwxFont(This->GetInitialFont()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxFont");
break;
}
@@ -23233,7 +23270,7 @@ case wxXmlResource_LoadBitmap: { // wxXmlResource::LoadBitmap
wxString name = wxString(bp, wxConvUTF8);
bp += *nameLen+((8-((0+ *nameLen) & 7)) & 7);
if(!This) throw wxe_badarg(0);
- wxBitmap * Result = new wxBitmap(This->LoadBitmap(name)); newPtr((void *) Result,3, memenv);;
+ wxBitmap * Result = new EwxBitmap(This->LoadBitmap(name)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxBitmap");
break;
}
@@ -23289,7 +23326,7 @@ case wxXmlResource_LoadIcon: { // wxXmlResource::LoadIcon
wxString name = wxString(bp, wxConvUTF8);
bp += *nameLen+((8-((0+ *nameLen) & 7)) & 7);
if(!This) throw wxe_badarg(0);
- wxIcon * Result = new wxIcon(This->LoadIcon(name)); newPtr((void *) Result,3, memenv);;
+ wxIcon * Result = new EwxIcon(This->LoadIcon(name)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxIcon");
break;
}
@@ -24839,7 +24876,7 @@ case wxAuiNotebook_GetPageBitmap: { // wxAuiNotebook::GetPageBitmap
wxAuiNotebook *This = (wxAuiNotebook *) getPtr(bp,memenv); bp += 4;
int * page_idx = (int *) bp; bp += 4;
if(!This) throw wxe_badarg(0);
- wxBitmap * Result = new wxBitmap(This->GetPageBitmap(*page_idx)); newPtr((void *) Result,3, memenv);;
+ wxBitmap * Result = new EwxBitmap(This->GetPageBitmap(*page_idx)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxBitmap");
break;
}
@@ -25032,7 +25069,7 @@ case wxAuiDockArt_GetFont: { // wxAuiDockArt::GetFont
wxAuiDockArt *This = (wxAuiDockArt *) getPtr(bp,memenv); bp += 4;
int * id = (int *) bp; bp += 4;
if(!This) throw wxe_badarg(0);
- wxFont * Result = new wxFont(This->GetFont(*id)); newPtr((void *) Result,3, memenv);;
+ wxFont * Result = new EwxFont(This->GetFont(*id)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxFont");
break;
}
@@ -26671,7 +26708,7 @@ case wxColourPickerEvent_GetColour: { // wxColourPickerEvent::GetColour
case wxFontPickerEvent_GetFont: { // wxFontPickerEvent::GetFont
wxFontPickerEvent *This = (wxFontPickerEvent *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- wxFont * Result = new wxFont(This->GetFont()); newPtr((void *) Result,3, memenv);;
+ wxFont * Result = new EwxFont(This->GetFont()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxFont");
break;
}
@@ -30602,7 +30639,7 @@ case wxArtProvider_GetBitmap: { // wxArtProvider::GetBitmap
bp += 4; /* Align */
} break;
}};
- wxBitmap * Result = new wxBitmap(wxArtProvider::GetBitmap(id,client,size)); newPtr((void *) Result,3, memenv);;
+ wxBitmap * Result = new EwxBitmap(wxArtProvider::GetBitmap(id,client,size)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxBitmap");
break;
}
@@ -30625,7 +30662,7 @@ case wxArtProvider_GetIcon: { // wxArtProvider::GetIcon
bp += 4; /* Align */
} break;
}};
- wxIcon * Result = new wxIcon(wxArtProvider::GetIcon(id,client,size)); newPtr((void *) Result,3, memenv);;
+ wxIcon * Result = new EwxIcon(wxArtProvider::GetIcon(id,client,size)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxIcon");
break;
}
@@ -30808,7 +30845,7 @@ bitmap = (wxBitmap *) getPtr(bp,memenv); bp += 4;
case wxBitmapDataObject_GetBitmap: { // wxBitmapDataObject::GetBitmap
wxBitmapDataObject *This = (wxBitmapDataObject *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
- wxBitmap * Result = new wxBitmap(This->GetBitmap()); newPtr((void *) Result,3, memenv);;
+ wxBitmap * Result = new EwxBitmap(This->GetBitmap()); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxBitmap");
break;
}
@@ -31428,7 +31465,7 @@ case wxSystemSettings_GetColour: { // wxSystemSettings::GetColour
}
case wxSystemSettings_GetFont: { // wxSystemSettings::GetFont
wxSystemFont index = *(wxSystemFont *) bp; bp += 4;;
- wxFont * Result = new wxFont(wxSystemSettings::GetFont(index)); newPtr((void *) Result,3, memenv);;
+ wxFont * Result = new EwxFont(wxSystemSettings::GetFont(index)); newPtr((void *) Result,3, memenv);;
rt.addRef(getRef((void *)Result,memenv), "wxFont");
break;
}
diff --git a/lib/wx/c_src/gen/wxe_macros.h b/lib/wx/c_src/gen/wxe_macros.h
index 1d50278360..0d3b79b7f9 100644
--- a/lib/wx/c_src/gen/wxe_macros.h
+++ b/lib/wx/c_src/gen/wxe_macros.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2015. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -241,3185 +241,3189 @@
#define wxWindow_UpdateWindowUI 281
#define wxWindow_Validate 282
#define wxWindow_WarpPointer 283
-#define wxTopLevelWindow_GetIcon 284
-#define wxTopLevelWindow_GetIcons 285
-#define wxTopLevelWindow_GetTitle 286
-#define wxTopLevelWindow_IsActive 287
-#define wxTopLevelWindow_Iconize 288
-#define wxTopLevelWindow_IsFullScreen 289
-#define wxTopLevelWindow_IsIconized 290
-#define wxTopLevelWindow_IsMaximized 291
-#define wxTopLevelWindow_Maximize 292
-#define wxTopLevelWindow_RequestUserAttention 293
-#define wxTopLevelWindow_SetIcon 294
-#define wxTopLevelWindow_SetIcons 295
-#define wxTopLevelWindow_CenterOnScreen 296
-#define wxTopLevelWindow_CentreOnScreen 297
-#define wxTopLevelWindow_SetShape 299
-#define wxTopLevelWindow_SetTitle 300
-#define wxTopLevelWindow_ShowFullScreen 301
-#define wxFrame_new_4 303
-#define wxFrame_new_0 304
-#define wxFrame_destruct 306
-#define wxFrame_Create 307
-#define wxFrame_CreateStatusBar 308
-#define wxFrame_CreateToolBar 309
-#define wxFrame_GetClientAreaOrigin 310
-#define wxFrame_GetMenuBar 311
-#define wxFrame_GetStatusBar 312
-#define wxFrame_GetStatusBarPane 313
-#define wxFrame_GetToolBar 314
-#define wxFrame_ProcessCommand 315
-#define wxFrame_SendSizeEvent 316
-#define wxFrame_SetMenuBar 317
-#define wxFrame_SetStatusBar 318
-#define wxFrame_SetStatusBarPane 319
-#define wxFrame_SetStatusText 320
-#define wxFrame_SetStatusWidths 321
-#define wxFrame_SetToolBar 322
-#define wxMiniFrame_new_0 323
-#define wxMiniFrame_new_4 324
-#define wxMiniFrame_Create 325
-#define wxMiniFrame_destroy 326
-#define wxSplashScreen_new_0 327
-#define wxSplashScreen_new_6 328
-#define wxSplashScreen_destruct 329
-#define wxSplashScreen_GetSplashStyle 330
-#define wxSplashScreen_GetTimeout 331
-#define wxPanel_new_0 332
-#define wxPanel_new_6 333
-#define wxPanel_new_2 334
-#define wxPanel_destruct 335
-#define wxPanel_InitDialog 336
-#define wxPanel_SetFocusIgnoringChildren 337
-#define wxScrolledWindow_new_0 338
-#define wxScrolledWindow_new_2 339
-#define wxScrolledWindow_destruct 340
-#define wxScrolledWindow_CalcScrolledPosition_4 341
-#define wxScrolledWindow_CalcScrolledPosition_1 342
-#define wxScrolledWindow_CalcUnscrolledPosition_4 343
-#define wxScrolledWindow_CalcUnscrolledPosition_1 344
-#define wxScrolledWindow_EnableScrolling 345
-#define wxScrolledWindow_GetScrollPixelsPerUnit 346
-#define wxScrolledWindow_GetViewStart 347
-#define wxScrolledWindow_DoPrepareDC 348
-#define wxScrolledWindow_PrepareDC 349
-#define wxScrolledWindow_Scroll 350
-#define wxScrolledWindow_SetScrollbars 351
-#define wxScrolledWindow_SetScrollRate 352
-#define wxScrolledWindow_SetTargetWindow 353
-#define wxSashWindow_new_0 354
-#define wxSashWindow_new_2 355
-#define wxSashWindow_destruct 356
-#define wxSashWindow_GetSashVisible 357
-#define wxSashWindow_GetMaximumSizeX 358
-#define wxSashWindow_GetMaximumSizeY 359
-#define wxSashWindow_GetMinimumSizeX 360
-#define wxSashWindow_GetMinimumSizeY 361
-#define wxSashWindow_SetMaximumSizeX 362
-#define wxSashWindow_SetMaximumSizeY 363
-#define wxSashWindow_SetMinimumSizeX 364
-#define wxSashWindow_SetMinimumSizeY 365
-#define wxSashWindow_SetSashVisible 366
-#define wxSashLayoutWindow_new_0 367
-#define wxSashLayoutWindow_new_2 368
-#define wxSashLayoutWindow_Create 369
-#define wxSashLayoutWindow_GetAlignment 370
-#define wxSashLayoutWindow_GetOrientation 371
-#define wxSashLayoutWindow_SetAlignment 372
-#define wxSashLayoutWindow_SetDefaultSize 373
-#define wxSashLayoutWindow_SetOrientation 374
-#define wxSashLayoutWindow_destroy 375
-#define wxGrid_new_0 376
-#define wxGrid_new_3 377
-#define wxGrid_new_4 378
-#define wxGrid_destruct 379
-#define wxGrid_AppendCols 380
-#define wxGrid_AppendRows 381
-#define wxGrid_AutoSize 382
-#define wxGrid_AutoSizeColumn 383
-#define wxGrid_AutoSizeColumns 384
-#define wxGrid_AutoSizeRow 385
-#define wxGrid_AutoSizeRows 386
-#define wxGrid_BeginBatch 387
-#define wxGrid_BlockToDeviceRect 388
-#define wxGrid_CanDragColSize 389
-#define wxGrid_CanDragRowSize 390
-#define wxGrid_CanDragGridSize 391
-#define wxGrid_CanEnableCellControl 392
-#define wxGrid_CellToRect_2 393
-#define wxGrid_CellToRect_1 394
-#define wxGrid_ClearGrid 395
-#define wxGrid_ClearSelection 396
-#define wxGrid_CreateGrid 397
-#define wxGrid_DeleteCols 398
-#define wxGrid_DeleteRows 399
-#define wxGrid_DisableCellEditControl 400
-#define wxGrid_DisableDragColSize 401
-#define wxGrid_DisableDragGridSize 402
-#define wxGrid_DisableDragRowSize 403
-#define wxGrid_EnableCellEditControl 404
-#define wxGrid_EnableDragColSize 405
-#define wxGrid_EnableDragGridSize 406
-#define wxGrid_EnableDragRowSize 407
-#define wxGrid_EnableEditing 408
-#define wxGrid_EnableGridLines 409
-#define wxGrid_EndBatch 410
-#define wxGrid_Fit 411
-#define wxGrid_ForceRefresh 412
-#define wxGrid_GetBatchCount 413
-#define wxGrid_GetCellAlignment 414
-#define wxGrid_GetCellBackgroundColour 415
-#define wxGrid_GetCellEditor 416
-#define wxGrid_GetCellFont 417
-#define wxGrid_GetCellRenderer 418
-#define wxGrid_GetCellTextColour 419
-#define wxGrid_GetCellValue_2 420
-#define wxGrid_GetCellValue_1 421
-#define wxGrid_GetColLabelAlignment 422
-#define wxGrid_GetColLabelSize 423
-#define wxGrid_GetColLabelValue 424
-#define wxGrid_GetColMinimalAcceptableWidth 425
-#define wxGrid_GetDefaultCellAlignment 426
-#define wxGrid_GetDefaultCellBackgroundColour 427
-#define wxGrid_GetDefaultCellFont 428
-#define wxGrid_GetDefaultCellTextColour 429
-#define wxGrid_GetDefaultColLabelSize 430
-#define wxGrid_GetDefaultColSize 431
-#define wxGrid_GetDefaultEditor 432
-#define wxGrid_GetDefaultEditorForCell_2 433
-#define wxGrid_GetDefaultEditorForCell_1 434
-#define wxGrid_GetDefaultEditorForType 435
-#define wxGrid_GetDefaultRenderer 436
-#define wxGrid_GetDefaultRendererForCell 437
-#define wxGrid_GetDefaultRendererForType 438
-#define wxGrid_GetDefaultRowLabelSize 439
-#define wxGrid_GetDefaultRowSize 440
-#define wxGrid_GetGridCursorCol 441
-#define wxGrid_GetGridCursorRow 442
-#define wxGrid_GetGridLineColour 443
-#define wxGrid_GridLinesEnabled 444
-#define wxGrid_GetLabelBackgroundColour 445
-#define wxGrid_GetLabelFont 446
-#define wxGrid_GetLabelTextColour 447
-#define wxGrid_GetNumberCols 448
-#define wxGrid_GetNumberRows 449
-#define wxGrid_GetOrCreateCellAttr 450
-#define wxGrid_GetRowMinimalAcceptableHeight 451
-#define wxGrid_GetRowLabelAlignment 452
-#define wxGrid_GetRowLabelSize 453
-#define wxGrid_GetRowLabelValue 454
-#define wxGrid_GetRowSize 455
-#define wxGrid_GetScrollLineX 456
-#define wxGrid_GetScrollLineY 457
-#define wxGrid_GetSelectedCells 458
-#define wxGrid_GetSelectedCols 459
-#define wxGrid_GetSelectedRows 460
-#define wxGrid_GetSelectionBackground 461
-#define wxGrid_GetSelectionBlockTopLeft 462
-#define wxGrid_GetSelectionBlockBottomRight 463
-#define wxGrid_GetSelectionForeground 464
-#define wxGrid_GetViewWidth 465
-#define wxGrid_GetGridWindow 466
-#define wxGrid_GetGridRowLabelWindow 467
-#define wxGrid_GetGridColLabelWindow 468
-#define wxGrid_GetGridCornerLabelWindow 469
-#define wxGrid_HideCellEditControl 470
-#define wxGrid_InsertCols 471
-#define wxGrid_InsertRows 472
-#define wxGrid_IsCellEditControlEnabled 473
-#define wxGrid_IsCurrentCellReadOnly 474
-#define wxGrid_IsEditable 475
-#define wxGrid_IsInSelection_2 476
-#define wxGrid_IsInSelection_1 477
-#define wxGrid_IsReadOnly 478
-#define wxGrid_IsSelection 479
-#define wxGrid_IsVisible_3 480
-#define wxGrid_IsVisible_2 481
-#define wxGrid_MakeCellVisible_2 482
-#define wxGrid_MakeCellVisible_1 483
-#define wxGrid_MoveCursorDown 484
-#define wxGrid_MoveCursorLeft 485
-#define wxGrid_MoveCursorRight 486
-#define wxGrid_MoveCursorUp 487
-#define wxGrid_MoveCursorDownBlock 488
-#define wxGrid_MoveCursorLeftBlock 489
-#define wxGrid_MoveCursorRightBlock 490
-#define wxGrid_MoveCursorUpBlock 491
-#define wxGrid_MovePageDown 492
-#define wxGrid_MovePageUp 493
-#define wxGrid_RegisterDataType 494
-#define wxGrid_SaveEditControlValue 495
-#define wxGrid_SelectAll 496
-#define wxGrid_SelectBlock_5 497
-#define wxGrid_SelectBlock_3 498
-#define wxGrid_SelectCol 499
-#define wxGrid_SelectRow 500
-#define wxGrid_SetCellAlignment_4 501
-#define wxGrid_SetCellAlignment_3 502
-#define wxGrid_SetCellAlignment_1 503
-#define wxGrid_SetCellBackgroundColour_3_0 504
-#define wxGrid_SetCellBackgroundColour_1 505
-#define wxGrid_SetCellBackgroundColour_3_1 506
-#define wxGrid_SetCellEditor 507
-#define wxGrid_SetCellFont 508
-#define wxGrid_SetCellRenderer 509
-#define wxGrid_SetCellTextColour_3_0 510
-#define wxGrid_SetCellTextColour_3_1 511
-#define wxGrid_SetCellTextColour_1 512
-#define wxGrid_SetCellValue_3_0 513
-#define wxGrid_SetCellValue_2 514
-#define wxGrid_SetCellValue_3_1 515
-#define wxGrid_SetColAttr 516
-#define wxGrid_SetColFormatBool 517
-#define wxGrid_SetColFormatNumber 518
-#define wxGrid_SetColFormatFloat 519
-#define wxGrid_SetColFormatCustom 520
-#define wxGrid_SetColLabelAlignment 521
-#define wxGrid_SetColLabelSize 522
-#define wxGrid_SetColLabelValue 523
-#define wxGrid_SetColMinimalWidth 524
-#define wxGrid_SetColMinimalAcceptableWidth 525
-#define wxGrid_SetColSize 526
-#define wxGrid_SetDefaultCellAlignment 527
-#define wxGrid_SetDefaultCellBackgroundColour 528
-#define wxGrid_SetDefaultCellFont 529
-#define wxGrid_SetDefaultCellTextColour 530
-#define wxGrid_SetDefaultEditor 531
-#define wxGrid_SetDefaultRenderer 532
-#define wxGrid_SetDefaultColSize 533
-#define wxGrid_SetDefaultRowSize 534
-#define wxGrid_SetGridCursor 535
-#define wxGrid_SetGridLineColour 536
-#define wxGrid_SetLabelBackgroundColour 537
-#define wxGrid_SetLabelFont 538
-#define wxGrid_SetLabelTextColour 539
-#define wxGrid_SetMargins 540
-#define wxGrid_SetReadOnly 541
-#define wxGrid_SetRowAttr 542
-#define wxGrid_SetRowLabelAlignment 543
-#define wxGrid_SetRowLabelSize 544
-#define wxGrid_SetRowLabelValue 545
-#define wxGrid_SetRowMinimalHeight 546
-#define wxGrid_SetRowMinimalAcceptableHeight 547
-#define wxGrid_SetRowSize 548
-#define wxGrid_SetScrollLineX 549
-#define wxGrid_SetScrollLineY 550
-#define wxGrid_SetSelectionBackground 551
-#define wxGrid_SetSelectionForeground 552
-#define wxGrid_SetSelectionMode 553
-#define wxGrid_ShowCellEditControl 554
-#define wxGrid_XToCol 555
-#define wxGrid_XToEdgeOfCol 556
-#define wxGrid_YToEdgeOfRow 557
-#define wxGrid_YToRow 558
-#define wxGridCellRenderer_Draw 559
-#define wxGridCellRenderer_GetBestSize 560
-#define wxGridCellEditor_Create 561
-#define wxGridCellEditor_IsCreated 562
-#define wxGridCellEditor_SetSize 563
-#define wxGridCellEditor_Show 564
-#define wxGridCellEditor_PaintBackground 565
-#define wxGridCellEditor_BeginEdit 566
-#define wxGridCellEditor_EndEdit 567
-#define wxGridCellEditor_Reset 568
-#define wxGridCellEditor_StartingKey 569
-#define wxGridCellEditor_StartingClick 570
-#define wxGridCellEditor_HandleReturn 571
-#define wxGridCellBoolRenderer_new 572
-#define wxGridCellBoolRenderer_destroy 573
-#define wxGridCellBoolEditor_new 574
-#define wxGridCellBoolEditor_IsTrueValue 575
-#define wxGridCellBoolEditor_UseStringValues 576
-#define wxGridCellBoolEditor_destroy 577
-#define wxGridCellFloatRenderer_new 578
-#define wxGridCellFloatRenderer_GetPrecision 579
-#define wxGridCellFloatRenderer_GetWidth 580
-#define wxGridCellFloatRenderer_SetParameters 581
-#define wxGridCellFloatRenderer_SetPrecision 582
-#define wxGridCellFloatRenderer_SetWidth 583
-#define wxGridCellFloatRenderer_destroy 584
-#define wxGridCellFloatEditor_new 585
-#define wxGridCellFloatEditor_SetParameters 586
-#define wxGridCellFloatEditor_destroy 587
-#define wxGridCellStringRenderer_new 588
-#define wxGridCellStringRenderer_destroy 589
-#define wxGridCellTextEditor_new 590
-#define wxGridCellTextEditor_SetParameters 591
-#define wxGridCellTextEditor_destroy 592
-#define wxGridCellChoiceEditor_new 594
-#define wxGridCellChoiceEditor_SetParameters 595
-#define wxGridCellChoiceEditor_destroy 596
-#define wxGridCellNumberRenderer_new 597
-#define wxGridCellNumberRenderer_destroy 598
-#define wxGridCellNumberEditor_new 599
-#define wxGridCellNumberEditor_GetValue 600
-#define wxGridCellNumberEditor_SetParameters 601
-#define wxGridCellNumberEditor_destroy 602
-#define wxGridCellAttr_SetTextColour 603
-#define wxGridCellAttr_SetBackgroundColour 604
-#define wxGridCellAttr_SetFont 605
-#define wxGridCellAttr_SetAlignment 606
-#define wxGridCellAttr_SetReadOnly 607
-#define wxGridCellAttr_SetRenderer 608
-#define wxGridCellAttr_SetEditor 609
-#define wxGridCellAttr_HasTextColour 610
-#define wxGridCellAttr_HasBackgroundColour 611
-#define wxGridCellAttr_HasFont 612
-#define wxGridCellAttr_HasAlignment 613
-#define wxGridCellAttr_HasRenderer 614
-#define wxGridCellAttr_HasEditor 615
-#define wxGridCellAttr_GetTextColour 616
-#define wxGridCellAttr_GetBackgroundColour 617
-#define wxGridCellAttr_GetFont 618
-#define wxGridCellAttr_GetAlignment 619
-#define wxGridCellAttr_GetRenderer 620
-#define wxGridCellAttr_GetEditor 621
-#define wxGridCellAttr_IsReadOnly 622
-#define wxGridCellAttr_SetDefAttr 623
-#define wxDC_Blit 624
-#define wxDC_CalcBoundingBox 625
-#define wxDC_Clear 626
-#define wxDC_ComputeScaleAndOrigin 627
-#define wxDC_CrossHair 628
-#define wxDC_DestroyClippingRegion 629
-#define wxDC_DeviceToLogicalX 630
-#define wxDC_DeviceToLogicalXRel 631
-#define wxDC_DeviceToLogicalY 632
-#define wxDC_DeviceToLogicalYRel 633
-#define wxDC_DrawArc 634
-#define wxDC_DrawBitmap 635
-#define wxDC_DrawCheckMark 636
-#define wxDC_DrawCircle 637
-#define wxDC_DrawEllipse_2 639
-#define wxDC_DrawEllipse_1 640
-#define wxDC_DrawEllipticArc 641
-#define wxDC_DrawIcon 642
-#define wxDC_DrawLabel 643
-#define wxDC_DrawLine 644
-#define wxDC_DrawLines 645
-#define wxDC_DrawPolygon 647
-#define wxDC_DrawPoint 649
-#define wxDC_DrawRectangle_2 651
-#define wxDC_DrawRectangle_1 652
-#define wxDC_DrawRotatedText 653
-#define wxDC_DrawRoundedRectangle_3 655
-#define wxDC_DrawRoundedRectangle_2 656
-#define wxDC_DrawText 657
-#define wxDC_EndDoc 658
-#define wxDC_EndPage 659
-#define wxDC_FloodFill 660
-#define wxDC_GetBackground 661
-#define wxDC_GetBackgroundMode 662
-#define wxDC_GetBrush 663
-#define wxDC_GetCharHeight 664
-#define wxDC_GetCharWidth 665
-#define wxDC_GetClippingBox 666
-#define wxDC_GetFont 668
-#define wxDC_GetLayoutDirection 669
-#define wxDC_GetLogicalFunction 670
-#define wxDC_GetMapMode 671
-#define wxDC_GetMultiLineTextExtent_4 672
-#define wxDC_GetMultiLineTextExtent_1 673
-#define wxDC_GetPartialTextExtents 674
-#define wxDC_GetPen 675
-#define wxDC_GetPixel 676
-#define wxDC_GetPPI 677
-#define wxDC_GetSize 679
-#define wxDC_GetSizeMM 681
-#define wxDC_GetTextBackground 682
-#define wxDC_GetTextExtent_4 683
-#define wxDC_GetTextExtent_1 684
-#define wxDC_GetTextForeground 686
-#define wxDC_GetUserScale 687
-#define wxDC_GradientFillConcentric_3 688
-#define wxDC_GradientFillConcentric_4 689
-#define wxDC_GradientFillLinear 690
-#define wxDC_LogicalToDeviceX 691
-#define wxDC_LogicalToDeviceXRel 692
-#define wxDC_LogicalToDeviceY 693
-#define wxDC_LogicalToDeviceYRel 694
-#define wxDC_MaxX 695
-#define wxDC_MaxY 696
-#define wxDC_MinX 697
-#define wxDC_MinY 698
-#define wxDC_IsOk 699
-#define wxDC_ResetBoundingBox 700
-#define wxDC_SetAxisOrientation 701
-#define wxDC_SetBackground 702
-#define wxDC_SetBackgroundMode 703
-#define wxDC_SetBrush 704
-#define wxDC_SetClippingRegion_2 706
-#define wxDC_SetClippingRegion_1_1 707
-#define wxDC_SetClippingRegion_1_0 708
-#define wxDC_SetDeviceOrigin 709
-#define wxDC_SetFont 710
-#define wxDC_SetLayoutDirection 711
-#define wxDC_SetLogicalFunction 712
-#define wxDC_SetMapMode 713
-#define wxDC_SetPalette 714
-#define wxDC_SetPen 715
-#define wxDC_SetTextBackground 716
-#define wxDC_SetTextForeground 717
-#define wxDC_SetUserScale 718
-#define wxDC_StartDoc 719
-#define wxDC_StartPage 720
-#define wxMirrorDC_new 721
-#define wxMirrorDC_destroy 722
-#define wxScreenDC_new 723
-#define wxScreenDC_destruct 724
-#define wxPostScriptDC_new_0 725
-#define wxPostScriptDC_new_1 726
-#define wxPostScriptDC_destruct 727
-#define wxPostScriptDC_SetResolution 728
-#define wxPostScriptDC_GetResolution 729
-#define wxWindowDC_new_0 730
-#define wxWindowDC_new_1 731
-#define wxWindowDC_destruct 732
-#define wxClientDC_new_0 733
-#define wxClientDC_new_1 734
-#define wxClientDC_destroy 735
-#define wxPaintDC_new_0 736
-#define wxPaintDC_new_1 737
-#define wxPaintDC_destroy 738
-#define wxMemoryDC_new_1_0 740
-#define wxMemoryDC_new_1_1 741
-#define wxMemoryDC_new_0 742
-#define wxMemoryDC_destruct 744
-#define wxMemoryDC_SelectObject 745
-#define wxMemoryDC_SelectObjectAsSource 746
-#define wxBufferedDC_new_0 747
-#define wxBufferedDC_new_2 748
-#define wxBufferedDC_new_3 749
-#define wxBufferedDC_destruct 750
-#define wxBufferedDC_Init_2 751
-#define wxBufferedDC_Init_3 752
-#define wxBufferedPaintDC_new_3 753
-#define wxBufferedPaintDC_new_2 754
-#define wxBufferedPaintDC_destruct 755
-#define wxGraphicsObject_destruct 756
-#define wxGraphicsObject_GetRenderer 757
-#define wxGraphicsObject_IsNull 758
-#define wxGraphicsContext_destruct 759
-#define wxGraphicsContext_Create_1_1 760
-#define wxGraphicsContext_Create_1_0 761
-#define wxGraphicsContext_Create_0 762
-#define wxGraphicsContext_CreatePen 763
-#define wxGraphicsContext_CreateBrush 764
-#define wxGraphicsContext_CreateRadialGradientBrush 765
-#define wxGraphicsContext_CreateLinearGradientBrush 766
-#define wxGraphicsContext_CreateFont 767
-#define wxGraphicsContext_CreateMatrix 768
-#define wxGraphicsContext_CreatePath 769
-#define wxGraphicsContext_Clip_1 770
-#define wxGraphicsContext_Clip_4 771
-#define wxGraphicsContext_ResetClip 772
-#define wxGraphicsContext_DrawBitmap 773
-#define wxGraphicsContext_DrawEllipse 774
-#define wxGraphicsContext_DrawIcon 775
-#define wxGraphicsContext_DrawLines 776
-#define wxGraphicsContext_DrawPath 777
-#define wxGraphicsContext_DrawRectangle 778
-#define wxGraphicsContext_DrawRoundedRectangle 779
-#define wxGraphicsContext_DrawText_3 780
-#define wxGraphicsContext_DrawText_4_0 781
-#define wxGraphicsContext_DrawText_4_1 782
-#define wxGraphicsContext_DrawText_5 783
-#define wxGraphicsContext_FillPath 784
-#define wxGraphicsContext_StrokePath 785
-#define wxGraphicsContext_GetPartialTextExtents 786
-#define wxGraphicsContext_GetTextExtent 787
-#define wxGraphicsContext_Rotate 788
-#define wxGraphicsContext_Scale 789
-#define wxGraphicsContext_Translate 790
-#define wxGraphicsContext_GetTransform 791
-#define wxGraphicsContext_SetTransform 792
-#define wxGraphicsContext_ConcatTransform 793
-#define wxGraphicsContext_SetBrush_1_1 794
-#define wxGraphicsContext_SetBrush_1_0 795
-#define wxGraphicsContext_SetFont_1 796
-#define wxGraphicsContext_SetFont_2 797
-#define wxGraphicsContext_SetPen_1_0 798
-#define wxGraphicsContext_SetPen_1_1 799
-#define wxGraphicsContext_StrokeLine 800
-#define wxGraphicsContext_StrokeLines 801
-#define wxGraphicsMatrix_Concat 803
-#define wxGraphicsMatrix_Get 805
-#define wxGraphicsMatrix_Invert 806
-#define wxGraphicsMatrix_IsEqual 807
-#define wxGraphicsMatrix_IsIdentity 809
-#define wxGraphicsMatrix_Rotate 810
-#define wxGraphicsMatrix_Scale 811
-#define wxGraphicsMatrix_Translate 812
-#define wxGraphicsMatrix_Set 813
-#define wxGraphicsMatrix_TransformPoint 814
-#define wxGraphicsMatrix_TransformDistance 815
-#define wxGraphicsPath_MoveToPoint_2 816
-#define wxGraphicsPath_MoveToPoint_1 817
-#define wxGraphicsPath_AddArc_6 818
-#define wxGraphicsPath_AddArc_5 819
-#define wxGraphicsPath_AddArcToPoint 820
-#define wxGraphicsPath_AddCircle 821
-#define wxGraphicsPath_AddCurveToPoint_6 822
-#define wxGraphicsPath_AddCurveToPoint_3 823
-#define wxGraphicsPath_AddEllipse 824
-#define wxGraphicsPath_AddLineToPoint_2 825
-#define wxGraphicsPath_AddLineToPoint_1 826
-#define wxGraphicsPath_AddPath 827
-#define wxGraphicsPath_AddQuadCurveToPoint 828
-#define wxGraphicsPath_AddRectangle 829
-#define wxGraphicsPath_AddRoundedRectangle 830
-#define wxGraphicsPath_CloseSubpath 831
-#define wxGraphicsPath_Contains_3 832
-#define wxGraphicsPath_Contains_2 833
-#define wxGraphicsPath_GetBox 835
-#define wxGraphicsPath_GetCurrentPoint 837
-#define wxGraphicsPath_Transform 838
-#define wxGraphicsRenderer_GetDefaultRenderer 839
-#define wxGraphicsRenderer_CreateContext_1_1 840
-#define wxGraphicsRenderer_CreateContext_1_0 841
-#define wxGraphicsRenderer_CreatePen 842
-#define wxGraphicsRenderer_CreateBrush 843
-#define wxGraphicsRenderer_CreateLinearGradientBrush 844
-#define wxGraphicsRenderer_CreateRadialGradientBrush 845
-#define wxGraphicsRenderer_CreateFont 846
-#define wxGraphicsRenderer_CreateMatrix 847
-#define wxGraphicsRenderer_CreatePath 848
-#define wxMenuBar_new_1 850
-#define wxMenuBar_new_0 852
-#define wxMenuBar_destruct 854
-#define wxMenuBar_Append 855
-#define wxMenuBar_Check 856
-#define wxMenuBar_Enable_2 857
-#define wxMenuBar_Enable_1 858
-#define wxMenuBar_EnableTop 859
-#define wxMenuBar_FindMenu 860
-#define wxMenuBar_FindMenuItem 861
-#define wxMenuBar_FindItem 862
-#define wxMenuBar_GetHelpString 863
-#define wxMenuBar_GetLabel_1 864
-#define wxMenuBar_GetLabel_0 865
-#define wxMenuBar_GetLabelTop 866
-#define wxMenuBar_GetMenu 867
-#define wxMenuBar_GetMenuCount 868
-#define wxMenuBar_Insert 869
-#define wxMenuBar_IsChecked 870
-#define wxMenuBar_IsEnabled_1 871
-#define wxMenuBar_IsEnabled_0 872
-#define wxMenuBar_Remove 873
-#define wxMenuBar_Replace 874
-#define wxMenuBar_SetHelpString 875
-#define wxMenuBar_SetLabel_2 876
-#define wxMenuBar_SetLabel_1 877
-#define wxMenuBar_SetLabelTop 878
-#define wxControl_GetLabel 879
-#define wxControl_SetLabel 880
-#define wxControlWithItems_Append_1 881
-#define wxControlWithItems_Append_2 882
-#define wxControlWithItems_appendStrings_1 883
-#define wxControlWithItems_Clear 884
-#define wxControlWithItems_Delete 885
-#define wxControlWithItems_FindString 886
-#define wxControlWithItems_getClientData 887
-#define wxControlWithItems_setClientData 888
-#define wxControlWithItems_GetCount 889
-#define wxControlWithItems_GetSelection 890
-#define wxControlWithItems_GetString 891
-#define wxControlWithItems_GetStringSelection 892
-#define wxControlWithItems_Insert_2 893
-#define wxControlWithItems_Insert_3 894
-#define wxControlWithItems_IsEmpty 895
-#define wxControlWithItems_Select 896
-#define wxControlWithItems_SetSelection 897
-#define wxControlWithItems_SetString 898
-#define wxControlWithItems_SetStringSelection 899
-#define wxMenu_new_2 902
-#define wxMenu_new_1 903
-#define wxMenu_destruct 905
-#define wxMenu_Append_3 906
-#define wxMenu_Append_1 907
-#define wxMenu_Append_4_0 908
-#define wxMenu_Append_4_1 909
-#define wxMenu_AppendCheckItem 910
-#define wxMenu_AppendRadioItem 911
-#define wxMenu_AppendSeparator 912
-#define wxMenu_Break 913
-#define wxMenu_Check 914
-#define wxMenu_Delete_1_0 915
-#define wxMenu_Delete_1_1 916
-#define wxMenu_Destroy_1_0 917
-#define wxMenu_Destroy_1_1 918
-#define wxMenu_Enable 919
-#define wxMenu_FindItem_1 920
-#define wxMenu_FindItem_2 921
-#define wxMenu_FindItemByPosition 922
-#define wxMenu_GetHelpString 923
-#define wxMenu_GetLabel 924
-#define wxMenu_GetMenuItemCount 925
-#define wxMenu_GetMenuItems 926
-#define wxMenu_GetTitle 928
-#define wxMenu_Insert_2 929
-#define wxMenu_Insert_3 930
-#define wxMenu_Insert_5_1 931
-#define wxMenu_Insert_5_0 932
-#define wxMenu_InsertCheckItem 933
-#define wxMenu_InsertRadioItem 934
-#define wxMenu_InsertSeparator 935
-#define wxMenu_IsChecked 936
-#define wxMenu_IsEnabled 937
-#define wxMenu_Prepend_1 938
-#define wxMenu_Prepend_2 939
-#define wxMenu_Prepend_4_1 940
-#define wxMenu_Prepend_4_0 941
-#define wxMenu_PrependCheckItem 942
-#define wxMenu_PrependRadioItem 943
-#define wxMenu_PrependSeparator 944
-#define wxMenu_Remove_1_0 945
-#define wxMenu_Remove_1_1 946
-#define wxMenu_SetHelpString 947
-#define wxMenu_SetLabel 948
-#define wxMenu_SetTitle 949
-#define wxMenuItem_new 950
-#define wxMenuItem_destruct 952
-#define wxMenuItem_Check 953
-#define wxMenuItem_Enable 954
-#define wxMenuItem_GetBitmap 955
-#define wxMenuItem_GetHelp 956
-#define wxMenuItem_GetId 957
-#define wxMenuItem_GetKind 958
-#define wxMenuItem_GetLabel 959
-#define wxMenuItem_GetLabelFromText 960
-#define wxMenuItem_GetMenu 961
-#define wxMenuItem_GetText 962
-#define wxMenuItem_GetSubMenu 963
-#define wxMenuItem_IsCheckable 964
-#define wxMenuItem_IsChecked 965
-#define wxMenuItem_IsEnabled 966
-#define wxMenuItem_IsSeparator 967
-#define wxMenuItem_IsSubMenu 968
-#define wxMenuItem_SetBitmap 969
-#define wxMenuItem_SetHelp 970
-#define wxMenuItem_SetMenu 971
-#define wxMenuItem_SetSubMenu 972
-#define wxMenuItem_SetText 973
-#define wxToolBar_AddControl 974
-#define wxToolBar_AddSeparator 975
-#define wxToolBar_AddTool_5 976
-#define wxToolBar_AddTool_4_0 977
-#define wxToolBar_AddTool_1 978
-#define wxToolBar_AddTool_4_1 979
-#define wxToolBar_AddTool_3 980
-#define wxToolBar_AddTool_6 981
-#define wxToolBar_AddCheckTool 982
-#define wxToolBar_AddRadioTool 983
-#define wxToolBar_AddStretchableSpace 984
-#define wxToolBar_InsertStretchableSpace 985
-#define wxToolBar_DeleteTool 986
-#define wxToolBar_DeleteToolByPos 987
-#define wxToolBar_EnableTool 988
-#define wxToolBar_FindById 989
-#define wxToolBar_FindControl 990
-#define wxToolBar_FindToolForPosition 991
-#define wxToolBar_GetToolSize 992
-#define wxToolBar_GetToolBitmapSize 993
-#define wxToolBar_GetMargins 994
-#define wxToolBar_GetToolEnabled 995
-#define wxToolBar_GetToolLongHelp 996
-#define wxToolBar_GetToolPacking 997
-#define wxToolBar_GetToolPos 998
-#define wxToolBar_GetToolSeparation 999
-#define wxToolBar_GetToolShortHelp 1000
-#define wxToolBar_GetToolState 1001
-#define wxToolBar_InsertControl 1002
-#define wxToolBar_InsertSeparator 1003
-#define wxToolBar_InsertTool_5 1004
-#define wxToolBar_InsertTool_2 1005
-#define wxToolBar_InsertTool_4 1006
-#define wxToolBar_Realize 1007
-#define wxToolBar_RemoveTool 1008
-#define wxToolBar_SetMargins 1009
-#define wxToolBar_SetToolBitmapSize 1010
-#define wxToolBar_SetToolLongHelp 1011
-#define wxToolBar_SetToolPacking 1012
-#define wxToolBar_SetToolShortHelp 1013
-#define wxToolBar_SetToolSeparation 1014
-#define wxToolBar_ToggleTool 1015
-#define wxStatusBar_new_0 1017
-#define wxStatusBar_new_2 1018
-#define wxStatusBar_destruct 1020
-#define wxStatusBar_Create 1021
-#define wxStatusBar_GetFieldRect 1022
-#define wxStatusBar_GetFieldsCount 1023
-#define wxStatusBar_GetStatusText 1024
-#define wxStatusBar_PopStatusText 1025
-#define wxStatusBar_PushStatusText 1026
-#define wxStatusBar_SetFieldsCount 1027
-#define wxStatusBar_SetMinHeight 1028
-#define wxStatusBar_SetStatusText 1029
-#define wxStatusBar_SetStatusWidths 1030
-#define wxStatusBar_SetStatusStyles 1031
-#define wxBitmap_new_0 1032
-#define wxBitmap_new_3 1033
-#define wxBitmap_new_4 1034
-#define wxBitmap_new_2_0 1035
-#define wxBitmap_new_2_1 1036
-#define wxBitmap_destruct 1037
-#define wxBitmap_ConvertToImage 1038
-#define wxBitmap_CopyFromIcon 1039
-#define wxBitmap_Create 1040
-#define wxBitmap_GetDepth 1041
-#define wxBitmap_GetHeight 1042
-#define wxBitmap_GetPalette 1043
-#define wxBitmap_GetMask 1044
-#define wxBitmap_GetWidth 1045
-#define wxBitmap_GetSubBitmap 1046
-#define wxBitmap_LoadFile 1047
-#define wxBitmap_Ok 1048
-#define wxBitmap_SaveFile 1049
-#define wxBitmap_SetDepth 1050
-#define wxBitmap_SetHeight 1051
-#define wxBitmap_SetMask 1052
-#define wxBitmap_SetPalette 1053
-#define wxBitmap_SetWidth 1054
-#define wxIcon_new_0 1055
-#define wxIcon_new_2 1056
-#define wxIcon_new_1 1057
-#define wxIcon_CopyFromBitmap 1058
-#define wxIcon_destroy 1059
-#define wxIconBundle_new_0 1060
-#define wxIconBundle_new_2 1061
-#define wxIconBundle_new_1_0 1062
-#define wxIconBundle_new_1_1 1063
-#define wxIconBundle_destruct 1064
-#define wxIconBundle_AddIcon_2 1065
-#define wxIconBundle_AddIcon_1 1066
-#define wxIconBundle_GetIcon_1_1 1067
-#define wxIconBundle_GetIcon_1_0 1068
-#define wxCursor_new_0 1069
-#define wxCursor_new_1_0 1070
-#define wxCursor_new_1_1 1071
-#define wxCursor_new_4 1072
-#define wxCursor_destruct 1073
-#define wxCursor_Ok 1074
-#define wxMask_new_0 1075
-#define wxMask_new_2_1 1076
-#define wxMask_new_2_0 1077
-#define wxMask_new_1 1078
-#define wxMask_destruct 1079
-#define wxMask_Create_2_1 1080
-#define wxMask_Create_2_0 1081
-#define wxMask_Create_1 1082
-#define wxImage_new_0 1083
-#define wxImage_new_3_0 1084
-#define wxImage_new_4 1085
-#define wxImage_new_5 1086
-#define wxImage_new_2 1087
-#define wxImage_new_3_1 1088
-#define wxImage_Blur 1089
-#define wxImage_BlurHorizontal 1090
-#define wxImage_BlurVertical 1091
-#define wxImage_ConvertAlphaToMask 1092
-#define wxImage_ConvertToGreyscale 1093
-#define wxImage_ConvertToMono 1094
-#define wxImage_Copy 1095
-#define wxImage_Create_3 1096
-#define wxImage_Create_4 1097
-#define wxImage_Create_5 1098
-#define wxImage_Destroy 1099
-#define wxImage_FindFirstUnusedColour 1100
-#define wxImage_GetImageExtWildcard 1101
-#define wxImage_GetAlpha_2 1102
-#define wxImage_GetAlpha_0 1103
-#define wxImage_GetBlue 1104
-#define wxImage_GetData 1105
-#define wxImage_GetGreen 1106
-#define wxImage_GetImageCount 1107
-#define wxImage_GetHeight 1108
-#define wxImage_GetMaskBlue 1109
-#define wxImage_GetMaskGreen 1110
-#define wxImage_GetMaskRed 1111
-#define wxImage_GetOrFindMaskColour 1112
-#define wxImage_GetPalette 1113
-#define wxImage_GetRed 1114
-#define wxImage_GetSubImage 1115
-#define wxImage_GetWidth 1116
-#define wxImage_HasAlpha 1117
-#define wxImage_HasMask 1118
-#define wxImage_GetOption 1119
-#define wxImage_GetOptionInt 1120
-#define wxImage_HasOption 1121
-#define wxImage_InitAlpha 1122
-#define wxImage_InitStandardHandlers 1123
-#define wxImage_IsTransparent 1124
-#define wxImage_LoadFile_2 1125
-#define wxImage_LoadFile_3 1126
-#define wxImage_Ok 1127
-#define wxImage_RemoveHandler 1128
-#define wxImage_Mirror 1129
-#define wxImage_Replace 1130
-#define wxImage_Rescale 1131
-#define wxImage_Resize 1132
-#define wxImage_Rotate 1133
-#define wxImage_RotateHue 1134
-#define wxImage_Rotate90 1135
-#define wxImage_SaveFile_1 1136
-#define wxImage_SaveFile_2_0 1137
-#define wxImage_SaveFile_2_1 1138
-#define wxImage_Scale 1139
-#define wxImage_Size 1140
-#define wxImage_SetAlpha_3 1141
-#define wxImage_SetAlpha_2 1142
-#define wxImage_SetData_2 1143
-#define wxImage_SetData_4 1144
-#define wxImage_SetMask 1145
-#define wxImage_SetMaskColour 1146
-#define wxImage_SetMaskFromImage 1147
-#define wxImage_SetOption_2_1 1148
-#define wxImage_SetOption_2_0 1149
-#define wxImage_SetPalette 1150
-#define wxImage_SetRGB_5 1151
-#define wxImage_SetRGB_4 1152
-#define wxImage_destroy 1153
-#define wxBrush_new_0 1154
-#define wxBrush_new_2 1155
-#define wxBrush_new_1 1156
-#define wxBrush_destruct 1158
-#define wxBrush_GetColour 1159
-#define wxBrush_GetStipple 1160
-#define wxBrush_GetStyle 1161
-#define wxBrush_IsHatch 1162
-#define wxBrush_IsOk 1163
-#define wxBrush_SetColour_1 1164
-#define wxBrush_SetColour_3 1165
-#define wxBrush_SetStipple 1166
-#define wxBrush_SetStyle 1167
-#define wxPen_new_0 1168
-#define wxPen_new_2 1169
-#define wxPen_destruct 1170
-#define wxPen_GetCap 1171
-#define wxPen_GetColour 1172
-#define wxPen_GetJoin 1173
-#define wxPen_GetStyle 1174
-#define wxPen_GetWidth 1175
-#define wxPen_IsOk 1176
-#define wxPen_SetCap 1177
-#define wxPen_SetColour_1 1178
-#define wxPen_SetColour_3 1179
-#define wxPen_SetJoin 1180
-#define wxPen_SetStyle 1181
-#define wxPen_SetWidth 1182
-#define wxRegion_new_0 1183
-#define wxRegion_new_4 1184
-#define wxRegion_new_2 1185
-#define wxRegion_new_1_1 1186
-#define wxRegion_new_1_0 1188
-#define wxRegion_destruct 1190
-#define wxRegion_Clear 1191
-#define wxRegion_Contains_2 1192
-#define wxRegion_Contains_1_0 1193
-#define wxRegion_Contains_4 1194
-#define wxRegion_Contains_1_1 1195
-#define wxRegion_ConvertToBitmap 1196
-#define wxRegion_GetBox 1197
-#define wxRegion_Intersect_4 1198
-#define wxRegion_Intersect_1_1 1199
-#define wxRegion_Intersect_1_0 1200
-#define wxRegion_IsEmpty 1201
-#define wxRegion_Subtract_4 1202
-#define wxRegion_Subtract_1_1 1203
-#define wxRegion_Subtract_1_0 1204
-#define wxRegion_Offset_2 1205
-#define wxRegion_Offset_1 1206
-#define wxRegion_Union_4 1207
-#define wxRegion_Union_1_2 1208
-#define wxRegion_Union_1_1 1209
-#define wxRegion_Union_1_0 1210
-#define wxRegion_Union_3 1211
-#define wxRegion_Xor_4 1212
-#define wxRegion_Xor_1_1 1213
-#define wxRegion_Xor_1_0 1214
-#define wxAcceleratorTable_new_0 1215
-#define wxAcceleratorTable_new_2 1216
-#define wxAcceleratorTable_destruct 1217
-#define wxAcceleratorTable_Ok 1218
-#define wxAcceleratorEntry_new_1_0 1219
-#define wxAcceleratorEntry_new_1_1 1220
-#define wxAcceleratorEntry_GetCommand 1221
-#define wxAcceleratorEntry_GetFlags 1222
-#define wxAcceleratorEntry_GetKeyCode 1223
-#define wxAcceleratorEntry_Set 1224
-#define wxAcceleratorEntry_destroy 1225
-#define wxCaret_new_3 1230
-#define wxCaret_new_2 1231
-#define wxCaret_destruct 1233
-#define wxCaret_Create_3 1234
-#define wxCaret_Create_2 1235
-#define wxCaret_GetBlinkTime 1236
-#define wxCaret_GetPosition 1238
-#define wxCaret_GetSize 1240
-#define wxCaret_GetWindow 1241
-#define wxCaret_Hide 1242
-#define wxCaret_IsOk 1243
-#define wxCaret_IsVisible 1244
-#define wxCaret_Move_2 1245
-#define wxCaret_Move_1 1246
-#define wxCaret_SetBlinkTime 1247
-#define wxCaret_SetSize_2 1248
-#define wxCaret_SetSize_1 1249
-#define wxCaret_Show 1250
-#define wxSizer_Add_2_1 1251
-#define wxSizer_Add_2_0 1252
-#define wxSizer_Add_3 1253
-#define wxSizer_Add_2_3 1254
-#define wxSizer_Add_2_2 1255
-#define wxSizer_AddSpacer 1256
-#define wxSizer_AddStretchSpacer 1257
-#define wxSizer_CalcMin 1258
-#define wxSizer_Clear 1259
-#define wxSizer_Detach_1_2 1260
-#define wxSizer_Detach_1_1 1261
-#define wxSizer_Detach_1_0 1262
-#define wxSizer_Fit 1263
-#define wxSizer_FitInside 1264
-#define wxSizer_GetChildren 1265
-#define wxSizer_GetItem_2_1 1266
-#define wxSizer_GetItem_2_0 1267
-#define wxSizer_GetItem_1 1268
-#define wxSizer_GetSize 1269
-#define wxSizer_GetPosition 1270
-#define wxSizer_GetMinSize 1271
-#define wxSizer_Hide_2_0 1272
-#define wxSizer_Hide_2_1 1273
-#define wxSizer_Hide_1 1274
-#define wxSizer_Insert_3_1 1275
-#define wxSizer_Insert_3_0 1276
-#define wxSizer_Insert_4 1277
-#define wxSizer_Insert_3_3 1278
-#define wxSizer_Insert_3_2 1279
-#define wxSizer_Insert_2 1280
-#define wxSizer_InsertSpacer 1281
-#define wxSizer_InsertStretchSpacer 1282
-#define wxSizer_IsShown_1_2 1283
-#define wxSizer_IsShown_1_1 1284
-#define wxSizer_IsShown_1_0 1285
-#define wxSizer_Layout 1286
-#define wxSizer_Prepend_2_1 1287
-#define wxSizer_Prepend_2_0 1288
-#define wxSizer_Prepend_3 1289
-#define wxSizer_Prepend_2_3 1290
-#define wxSizer_Prepend_2_2 1291
-#define wxSizer_Prepend_1 1292
-#define wxSizer_PrependSpacer 1293
-#define wxSizer_PrependStretchSpacer 1294
-#define wxSizer_RecalcSizes 1295
-#define wxSizer_Remove_1_1 1296
-#define wxSizer_Remove_1_0 1297
-#define wxSizer_Replace_3_1 1298
-#define wxSizer_Replace_3_0 1299
-#define wxSizer_Replace_2 1300
-#define wxSizer_SetDimension 1301
-#define wxSizer_SetMinSize_2 1302
-#define wxSizer_SetMinSize_1 1303
-#define wxSizer_SetItemMinSize_3_2 1304
-#define wxSizer_SetItemMinSize_2_2 1305
-#define wxSizer_SetItemMinSize_3_1 1306
-#define wxSizer_SetItemMinSize_2_1 1307
-#define wxSizer_SetItemMinSize_3_0 1308
-#define wxSizer_SetItemMinSize_2_0 1309
-#define wxSizer_SetSizeHints 1310
-#define wxSizer_SetVirtualSizeHints 1311
-#define wxSizer_Show_2_2 1312
-#define wxSizer_Show_2_1 1313
-#define wxSizer_Show_2_0 1314
-#define wxSizer_Show_1 1315
-#define wxSizerFlags_new 1316
-#define wxSizerFlags_Align 1317
-#define wxSizerFlags_Border_2 1318
-#define wxSizerFlags_Border_1 1319
-#define wxSizerFlags_Center 1320
-#define wxSizerFlags_Centre 1321
-#define wxSizerFlags_Expand 1322
-#define wxSizerFlags_Left 1323
-#define wxSizerFlags_Proportion 1324
-#define wxSizerFlags_Right 1325
-#define wxSizerFlags_destroy 1326
-#define wxSizerItem_new_5_1 1327
-#define wxSizerItem_new_2_1 1328
-#define wxSizerItem_new_5_0 1329
-#define wxSizerItem_new_2_0 1330
-#define wxSizerItem_new_6 1331
-#define wxSizerItem_new_3 1332
-#define wxSizerItem_new_0 1333
-#define wxSizerItem_destruct 1334
-#define wxSizerItem_CalcMin 1335
-#define wxSizerItem_DeleteWindows 1336
-#define wxSizerItem_DetachSizer 1337
-#define wxSizerItem_GetBorder 1338
-#define wxSizerItem_GetFlag 1339
-#define wxSizerItem_GetMinSize 1340
-#define wxSizerItem_GetPosition 1341
-#define wxSizerItem_GetProportion 1342
-#define wxSizerItem_GetRatio 1343
-#define wxSizerItem_GetRect 1344
-#define wxSizerItem_GetSize 1345
-#define wxSizerItem_GetSizer 1346
-#define wxSizerItem_GetSpacer 1347
-#define wxSizerItem_GetUserData 1348
-#define wxSizerItem_GetWindow 1349
-#define wxSizerItem_IsSizer 1350
-#define wxSizerItem_IsShown 1351
-#define wxSizerItem_IsSpacer 1352
-#define wxSizerItem_IsWindow 1353
-#define wxSizerItem_SetBorder 1354
-#define wxSizerItem_SetDimension 1355
-#define wxSizerItem_SetFlag 1356
-#define wxSizerItem_SetInitSize 1357
-#define wxSizerItem_SetMinSize_1 1358
-#define wxSizerItem_SetMinSize_2 1359
-#define wxSizerItem_SetProportion 1360
-#define wxSizerItem_SetRatio_2 1361
-#define wxSizerItem_SetRatio_1_1 1362
-#define wxSizerItem_SetRatio_1_0 1363
-#define wxSizerItem_SetSizer 1364
-#define wxSizerItem_SetSpacer_1 1365
-#define wxSizerItem_SetSpacer_2 1366
-#define wxSizerItem_SetWindow 1367
-#define wxSizerItem_Show 1368
-#define wxBoxSizer_new 1369
-#define wxBoxSizer_GetOrientation 1370
-#define wxBoxSizer_destroy 1371
-#define wxStaticBoxSizer_new_2 1372
-#define wxStaticBoxSizer_new_3 1373
-#define wxStaticBoxSizer_GetStaticBox 1374
-#define wxStaticBoxSizer_destroy 1375
-#define wxGridSizer_new_4 1376
-#define wxGridSizer_new_2 1377
-#define wxGridSizer_GetCols 1378
-#define wxGridSizer_GetHGap 1379
-#define wxGridSizer_GetRows 1380
-#define wxGridSizer_GetVGap 1381
-#define wxGridSizer_SetCols 1382
-#define wxGridSizer_SetHGap 1383
-#define wxGridSizer_SetRows 1384
-#define wxGridSizer_SetVGap 1385
-#define wxGridSizer_destroy 1386
-#define wxFlexGridSizer_new_4 1387
-#define wxFlexGridSizer_new_2 1388
-#define wxFlexGridSizer_AddGrowableCol 1389
-#define wxFlexGridSizer_AddGrowableRow 1390
-#define wxFlexGridSizer_GetFlexibleDirection 1391
-#define wxFlexGridSizer_GetNonFlexibleGrowMode 1392
-#define wxFlexGridSizer_RemoveGrowableCol 1393
-#define wxFlexGridSizer_RemoveGrowableRow 1394
-#define wxFlexGridSizer_SetFlexibleDirection 1395
-#define wxFlexGridSizer_SetNonFlexibleGrowMode 1396
-#define wxFlexGridSizer_destroy 1397
-#define wxGridBagSizer_new 1398
-#define wxGridBagSizer_Add_3_2 1399
-#define wxGridBagSizer_Add_3_1 1400
-#define wxGridBagSizer_Add_4 1401
-#define wxGridBagSizer_Add_1_0 1402
-#define wxGridBagSizer_Add_2_1 1403
-#define wxGridBagSizer_Add_2_0 1404
-#define wxGridBagSizer_Add_3_0 1405
-#define wxGridBagSizer_Add_1_1 1406
-#define wxGridBagSizer_CalcMin 1407
-#define wxGridBagSizer_CheckForIntersection_2 1408
-#define wxGridBagSizer_CheckForIntersection_3 1409
-#define wxGridBagSizer_FindItem_1_1 1410
-#define wxGridBagSizer_FindItem_1_0 1411
-#define wxGridBagSizer_FindItemAtPoint 1412
-#define wxGridBagSizer_FindItemAtPosition 1413
-#define wxGridBagSizer_FindItemWithData 1414
-#define wxGridBagSizer_GetCellSize 1415
-#define wxGridBagSizer_GetEmptyCellSize 1416
-#define wxGridBagSizer_GetItemPosition_1_2 1417
-#define wxGridBagSizer_GetItemPosition_1_1 1418
-#define wxGridBagSizer_GetItemPosition_1_0 1419
-#define wxGridBagSizer_GetItemSpan_1_2 1420
-#define wxGridBagSizer_GetItemSpan_1_1 1421
-#define wxGridBagSizer_GetItemSpan_1_0 1422
-#define wxGridBagSizer_SetEmptyCellSize 1423
-#define wxGridBagSizer_SetItemPosition_2_2 1424
-#define wxGridBagSizer_SetItemPosition_2_1 1425
-#define wxGridBagSizer_SetItemPosition_2_0 1426
-#define wxGridBagSizer_SetItemSpan_2_2 1427
-#define wxGridBagSizer_SetItemSpan_2_1 1428
-#define wxGridBagSizer_SetItemSpan_2_0 1429
-#define wxGridBagSizer_destroy 1430
-#define wxStdDialogButtonSizer_new 1431
-#define wxStdDialogButtonSizer_AddButton 1432
-#define wxStdDialogButtonSizer_Realize 1433
-#define wxStdDialogButtonSizer_SetAffirmativeButton 1434
-#define wxStdDialogButtonSizer_SetCancelButton 1435
-#define wxStdDialogButtonSizer_SetNegativeButton 1436
-#define wxStdDialogButtonSizer_destroy 1437
-#define wxFont_new_0 1438
-#define wxFont_new_1 1439
-#define wxFont_new_5 1440
-#define wxFont_destruct 1442
-#define wxFont_IsFixedWidth 1443
-#define wxFont_GetDefaultEncoding 1444
-#define wxFont_GetFaceName 1445
-#define wxFont_GetFamily 1446
-#define wxFont_GetNativeFontInfoDesc 1447
-#define wxFont_GetNativeFontInfoUserDesc 1448
-#define wxFont_GetPointSize 1449
-#define wxFont_GetStyle 1450
-#define wxFont_GetUnderlined 1451
-#define wxFont_GetWeight 1452
-#define wxFont_Ok 1453
-#define wxFont_SetDefaultEncoding 1454
-#define wxFont_SetFaceName 1455
-#define wxFont_SetFamily 1456
-#define wxFont_SetPointSize 1457
-#define wxFont_SetStyle 1458
-#define wxFont_SetUnderlined 1459
-#define wxFont_SetWeight 1460
-#define wxToolTip_Enable 1461
-#define wxToolTip_SetDelay 1462
-#define wxToolTip_new 1463
-#define wxToolTip_SetTip 1464
-#define wxToolTip_GetTip 1465
-#define wxToolTip_GetWindow 1466
-#define wxToolTip_destroy 1467
-#define wxButton_new_3 1469
-#define wxButton_new_0 1470
-#define wxButton_destruct 1471
-#define wxButton_Create 1472
-#define wxButton_GetDefaultSize 1473
-#define wxButton_SetDefault 1474
-#define wxButton_SetLabel 1475
-#define wxBitmapButton_new_4 1477
-#define wxBitmapButton_new_0 1478
-#define wxBitmapButton_Create 1479
-#define wxBitmapButton_GetBitmapDisabled 1480
-#define wxBitmapButton_GetBitmapFocus 1482
-#define wxBitmapButton_GetBitmapLabel 1484
-#define wxBitmapButton_GetBitmapSelected 1486
-#define wxBitmapButton_SetBitmapDisabled 1488
-#define wxBitmapButton_SetBitmapFocus 1489
-#define wxBitmapButton_SetBitmapLabel 1490
-#define wxBitmapButton_SetBitmapSelected 1491
-#define wxBitmapButton_destroy 1492
-#define wxToggleButton_new_0 1493
-#define wxToggleButton_new_4 1494
-#define wxToggleButton_Create 1495
-#define wxToggleButton_GetValue 1496
-#define wxToggleButton_SetValue 1497
-#define wxToggleButton_destroy 1498
-#define wxCalendarCtrl_new_0 1499
-#define wxCalendarCtrl_new_3 1500
-#define wxCalendarCtrl_Create 1501
-#define wxCalendarCtrl_destruct 1502
-#define wxCalendarCtrl_SetDate 1503
-#define wxCalendarCtrl_GetDate 1504
-#define wxCalendarCtrl_EnableYearChange 1505
-#define wxCalendarCtrl_EnableMonthChange 1506
-#define wxCalendarCtrl_EnableHolidayDisplay 1507
-#define wxCalendarCtrl_SetHeaderColours 1508
-#define wxCalendarCtrl_GetHeaderColourFg 1509
-#define wxCalendarCtrl_GetHeaderColourBg 1510
-#define wxCalendarCtrl_SetHighlightColours 1511
-#define wxCalendarCtrl_GetHighlightColourFg 1512
-#define wxCalendarCtrl_GetHighlightColourBg 1513
-#define wxCalendarCtrl_SetHolidayColours 1514
-#define wxCalendarCtrl_GetHolidayColourFg 1515
-#define wxCalendarCtrl_GetHolidayColourBg 1516
-#define wxCalendarCtrl_GetAttr 1517
-#define wxCalendarCtrl_SetAttr 1518
-#define wxCalendarCtrl_SetHoliday 1519
-#define wxCalendarCtrl_ResetAttr 1520
-#define wxCalendarCtrl_HitTest 1521
-#define wxCalendarDateAttr_new_0 1522
-#define wxCalendarDateAttr_new_2_1 1523
-#define wxCalendarDateAttr_new_2_0 1524
-#define wxCalendarDateAttr_SetTextColour 1525
-#define wxCalendarDateAttr_SetBackgroundColour 1526
-#define wxCalendarDateAttr_SetBorderColour 1527
-#define wxCalendarDateAttr_SetFont 1528
-#define wxCalendarDateAttr_SetBorder 1529
-#define wxCalendarDateAttr_SetHoliday 1530
-#define wxCalendarDateAttr_HasTextColour 1531
-#define wxCalendarDateAttr_HasBackgroundColour 1532
-#define wxCalendarDateAttr_HasBorderColour 1533
-#define wxCalendarDateAttr_HasFont 1534
-#define wxCalendarDateAttr_HasBorder 1535
-#define wxCalendarDateAttr_IsHoliday 1536
-#define wxCalendarDateAttr_GetTextColour 1537
-#define wxCalendarDateAttr_GetBackgroundColour 1538
-#define wxCalendarDateAttr_GetBorderColour 1539
-#define wxCalendarDateAttr_GetFont 1540
-#define wxCalendarDateAttr_GetBorder 1541
-#define wxCalendarDateAttr_destroy 1542
-#define wxCheckBox_new_4 1544
-#define wxCheckBox_new_0 1545
-#define wxCheckBox_Create 1546
-#define wxCheckBox_GetValue 1547
-#define wxCheckBox_Get3StateValue 1548
-#define wxCheckBox_Is3rdStateAllowedForUser 1549
-#define wxCheckBox_Is3State 1550
-#define wxCheckBox_IsChecked 1551
-#define wxCheckBox_SetValue 1552
-#define wxCheckBox_Set3StateValue 1553
-#define wxCheckBox_destroy 1554
-#define wxCheckListBox_new_0 1555
-#define wxCheckListBox_new_3 1557
-#define wxCheckListBox_Check 1558
-#define wxCheckListBox_IsChecked 1559
-#define wxCheckListBox_destroy 1560
-#define wxChoice_new_3 1563
-#define wxChoice_new_0 1564
-#define wxChoice_destruct 1566
-#define wxChoice_Create 1568
-#define wxChoice_Delete 1569
-#define wxChoice_GetColumns 1570
-#define wxChoice_SetColumns 1571
-#define wxComboBox_new_0 1572
-#define wxComboBox_new_3 1574
-#define wxComboBox_destruct 1575
-#define wxComboBox_Create 1577
-#define wxComboBox_CanCopy 1578
-#define wxComboBox_CanCut 1579
-#define wxComboBox_CanPaste 1580
-#define wxComboBox_CanRedo 1581
-#define wxComboBox_CanUndo 1582
-#define wxComboBox_Copy 1583
-#define wxComboBox_Cut 1584
-#define wxComboBox_GetInsertionPoint 1585
-#define wxComboBox_GetLastPosition 1586
-#define wxComboBox_GetValue 1587
-#define wxComboBox_Paste 1588
-#define wxComboBox_Redo 1589
-#define wxComboBox_Replace 1590
-#define wxComboBox_Remove 1591
-#define wxComboBox_SetInsertionPoint 1592
-#define wxComboBox_SetInsertionPointEnd 1593
-#define wxComboBox_SetSelection_1 1594
-#define wxComboBox_SetSelection_2 1595
-#define wxComboBox_SetValue 1596
-#define wxComboBox_Undo 1597
-#define wxGauge_new_0 1598
-#define wxGauge_new_4 1599
-#define wxGauge_Create 1600
-#define wxGauge_GetBezelFace 1601
-#define wxGauge_GetRange 1602
-#define wxGauge_GetShadowWidth 1603
-#define wxGauge_GetValue 1604
-#define wxGauge_IsVertical 1605
-#define wxGauge_SetBezelFace 1606
-#define wxGauge_SetRange 1607
-#define wxGauge_SetShadowWidth 1608
-#define wxGauge_SetValue 1609
-#define wxGauge_Pulse 1610
-#define wxGauge_destroy 1611
-#define wxGenericDirCtrl_new_0 1612
-#define wxGenericDirCtrl_new_2 1613
-#define wxGenericDirCtrl_destruct 1614
-#define wxGenericDirCtrl_Create 1615
-#define wxGenericDirCtrl_Init 1616
-#define wxGenericDirCtrl_CollapseTree 1617
-#define wxGenericDirCtrl_ExpandPath 1618
-#define wxGenericDirCtrl_GetDefaultPath 1619
-#define wxGenericDirCtrl_GetPath 1620
-#define wxGenericDirCtrl_GetFilePath 1621
-#define wxGenericDirCtrl_GetFilter 1622
-#define wxGenericDirCtrl_GetFilterIndex 1623
-#define wxGenericDirCtrl_GetRootId 1624
-#define wxGenericDirCtrl_GetTreeCtrl 1625
-#define wxGenericDirCtrl_ReCreateTree 1626
-#define wxGenericDirCtrl_SetDefaultPath 1627
-#define wxGenericDirCtrl_SetFilter 1628
-#define wxGenericDirCtrl_SetFilterIndex 1629
-#define wxGenericDirCtrl_SetPath 1630
-#define wxStaticBox_new_4 1632
-#define wxStaticBox_new_0 1633
-#define wxStaticBox_Create 1634
-#define wxStaticBox_destroy 1635
-#define wxStaticLine_new_2 1637
-#define wxStaticLine_new_0 1638
-#define wxStaticLine_Create 1639
-#define wxStaticLine_IsVertical 1640
-#define wxStaticLine_GetDefaultSize 1641
-#define wxStaticLine_destroy 1642
-#define wxListBox_new_3 1645
-#define wxListBox_new_0 1646
-#define wxListBox_destruct 1648
-#define wxListBox_Create 1650
-#define wxListBox_Deselect 1651
-#define wxListBox_GetSelections 1652
-#define wxListBox_InsertItems 1653
-#define wxListBox_IsSelected 1654
-#define wxListBox_Set 1655
-#define wxListBox_HitTest 1656
-#define wxListBox_SetFirstItem_1_0 1657
-#define wxListBox_SetFirstItem_1_1 1658
-#define wxListCtrl_new_0 1659
-#define wxListCtrl_new_2 1660
-#define wxListCtrl_Arrange 1661
-#define wxListCtrl_AssignImageList 1662
-#define wxListCtrl_ClearAll 1663
-#define wxListCtrl_Create 1664
-#define wxListCtrl_DeleteAllItems 1665
-#define wxListCtrl_DeleteColumn 1666
-#define wxListCtrl_DeleteItem 1667
-#define wxListCtrl_EditLabel 1668
-#define wxListCtrl_EnsureVisible 1669
-#define wxListCtrl_FindItem_3_0 1670
-#define wxListCtrl_FindItem_3_1 1671
-#define wxListCtrl_GetColumn 1672
-#define wxListCtrl_GetColumnCount 1673
-#define wxListCtrl_GetColumnWidth 1674
-#define wxListCtrl_GetCountPerPage 1675
-#define wxListCtrl_GetEditControl 1676
-#define wxListCtrl_GetImageList 1677
-#define wxListCtrl_GetItem 1678
-#define wxListCtrl_GetItemBackgroundColour 1679
-#define wxListCtrl_GetItemCount 1680
-#define wxListCtrl_GetItemData 1681
-#define wxListCtrl_GetItemFont 1682
-#define wxListCtrl_GetItemPosition 1683
-#define wxListCtrl_GetItemRect 1684
-#define wxListCtrl_GetItemSpacing 1685
-#define wxListCtrl_GetItemState 1686
-#define wxListCtrl_GetItemText 1687
-#define wxListCtrl_GetItemTextColour 1688
-#define wxListCtrl_GetNextItem 1689
-#define wxListCtrl_GetSelectedItemCount 1690
-#define wxListCtrl_GetTextColour 1691
-#define wxListCtrl_GetTopItem 1692
-#define wxListCtrl_GetViewRect 1693
-#define wxListCtrl_HitTest 1694
-#define wxListCtrl_InsertColumn_2 1695
-#define wxListCtrl_InsertColumn_3 1696
-#define wxListCtrl_InsertItem_1 1697
-#define wxListCtrl_InsertItem_2_1 1698
-#define wxListCtrl_InsertItem_2_0 1699
-#define wxListCtrl_InsertItem_3 1700
-#define wxListCtrl_RefreshItem 1701
-#define wxListCtrl_RefreshItems 1702
-#define wxListCtrl_ScrollList 1703
-#define wxListCtrl_SetBackgroundColour 1704
-#define wxListCtrl_SetColumn 1705
-#define wxListCtrl_SetColumnWidth 1706
-#define wxListCtrl_SetImageList 1707
-#define wxListCtrl_SetItem_1 1708
-#define wxListCtrl_SetItem_4 1709
-#define wxListCtrl_SetItemBackgroundColour 1710
-#define wxListCtrl_SetItemCount 1711
-#define wxListCtrl_SetItemData 1712
-#define wxListCtrl_SetItemFont 1713
-#define wxListCtrl_SetItemImage 1714
-#define wxListCtrl_SetItemColumnImage 1715
-#define wxListCtrl_SetItemPosition 1716
-#define wxListCtrl_SetItemState 1717
-#define wxListCtrl_SetItemText 1718
-#define wxListCtrl_SetItemTextColour 1719
-#define wxListCtrl_SetSingleStyle 1720
-#define wxListCtrl_SetTextColour 1721
-#define wxListCtrl_SetWindowStyleFlag 1722
-#define wxListCtrl_SortItems 1723
-#define wxListCtrl_destroy 1724
-#define wxListView_ClearColumnImage 1725
-#define wxListView_Focus 1726
-#define wxListView_GetFirstSelected 1727
-#define wxListView_GetFocusedItem 1728
-#define wxListView_GetNextSelected 1729
-#define wxListView_IsSelected 1730
-#define wxListView_Select 1731
-#define wxListView_SetColumnImage 1732
-#define wxListItem_new_0 1733
-#define wxListItem_new_1 1734
-#define wxListItem_destruct 1735
-#define wxListItem_Clear 1736
-#define wxListItem_GetAlign 1737
-#define wxListItem_GetBackgroundColour 1738
-#define wxListItem_GetColumn 1739
-#define wxListItem_GetFont 1740
-#define wxListItem_GetId 1741
-#define wxListItem_GetImage 1742
-#define wxListItem_GetMask 1743
-#define wxListItem_GetState 1744
-#define wxListItem_GetText 1745
-#define wxListItem_GetTextColour 1746
-#define wxListItem_GetWidth 1747
-#define wxListItem_SetAlign 1748
-#define wxListItem_SetBackgroundColour 1749
-#define wxListItem_SetColumn 1750
-#define wxListItem_SetFont 1751
-#define wxListItem_SetId 1752
-#define wxListItem_SetImage 1753
-#define wxListItem_SetMask 1754
-#define wxListItem_SetState 1755
-#define wxListItem_SetStateMask 1756
-#define wxListItem_SetText 1757
-#define wxListItem_SetTextColour 1758
-#define wxListItem_SetWidth 1759
-#define wxListItemAttr_new_0 1760
-#define wxListItemAttr_new_3 1761
-#define wxListItemAttr_GetBackgroundColour 1762
-#define wxListItemAttr_GetFont 1763
-#define wxListItemAttr_GetTextColour 1764
-#define wxListItemAttr_HasBackgroundColour 1765
-#define wxListItemAttr_HasFont 1766
-#define wxListItemAttr_HasTextColour 1767
-#define wxListItemAttr_SetBackgroundColour 1768
-#define wxListItemAttr_SetFont 1769
-#define wxListItemAttr_SetTextColour 1770
-#define wxListItemAttr_destroy 1771
-#define wxImageList_new_0 1772
-#define wxImageList_new_3 1773
-#define wxImageList_Add_1 1774
-#define wxImageList_Add_2_0 1775
-#define wxImageList_Add_2_1 1776
-#define wxImageList_Create 1777
-#define wxImageList_Draw 1779
-#define wxImageList_GetBitmap 1780
-#define wxImageList_GetIcon 1781
-#define wxImageList_GetImageCount 1782
-#define wxImageList_GetSize 1783
-#define wxImageList_Remove 1784
-#define wxImageList_RemoveAll 1785
-#define wxImageList_Replace_2 1786
-#define wxImageList_Replace_3 1787
-#define wxImageList_destroy 1788
-#define wxTextAttr_new_0 1789
-#define wxTextAttr_new_2 1790
-#define wxTextAttr_GetAlignment 1791
-#define wxTextAttr_GetBackgroundColour 1792
-#define wxTextAttr_GetFont 1793
-#define wxTextAttr_GetLeftIndent 1794
-#define wxTextAttr_GetLeftSubIndent 1795
-#define wxTextAttr_GetRightIndent 1796
-#define wxTextAttr_GetTabs 1797
-#define wxTextAttr_GetTextColour 1798
-#define wxTextAttr_HasBackgroundColour 1799
-#define wxTextAttr_HasFont 1800
-#define wxTextAttr_HasTextColour 1801
-#define wxTextAttr_GetFlags 1802
-#define wxTextAttr_IsDefault 1803
-#define wxTextAttr_SetAlignment 1804
-#define wxTextAttr_SetBackgroundColour 1805
-#define wxTextAttr_SetFlags 1806
-#define wxTextAttr_SetFont 1807
-#define wxTextAttr_SetLeftIndent 1808
-#define wxTextAttr_SetRightIndent 1809
-#define wxTextAttr_SetTabs 1810
-#define wxTextAttr_SetTextColour 1811
-#define wxTextAttr_destroy 1812
-#define wxTextCtrl_new_3 1814
-#define wxTextCtrl_new_0 1815
-#define wxTextCtrl_destruct 1817
-#define wxTextCtrl_AppendText 1818
-#define wxTextCtrl_CanCopy 1819
-#define wxTextCtrl_CanCut 1820
-#define wxTextCtrl_CanPaste 1821
-#define wxTextCtrl_CanRedo 1822
-#define wxTextCtrl_CanUndo 1823
-#define wxTextCtrl_Clear 1824
-#define wxTextCtrl_Copy 1825
-#define wxTextCtrl_Create 1826
-#define wxTextCtrl_Cut 1827
-#define wxTextCtrl_DiscardEdits 1828
-#define wxTextCtrl_ChangeValue 1829
-#define wxTextCtrl_EmulateKeyPress 1830
-#define wxTextCtrl_GetDefaultStyle 1831
-#define wxTextCtrl_GetInsertionPoint 1832
-#define wxTextCtrl_GetLastPosition 1833
-#define wxTextCtrl_GetLineLength 1834
-#define wxTextCtrl_GetLineText 1835
-#define wxTextCtrl_GetNumberOfLines 1836
-#define wxTextCtrl_GetRange 1837
-#define wxTextCtrl_GetSelection 1838
-#define wxTextCtrl_GetStringSelection 1839
-#define wxTextCtrl_GetStyle 1840
-#define wxTextCtrl_GetValue 1841
-#define wxTextCtrl_IsEditable 1842
-#define wxTextCtrl_IsModified 1843
-#define wxTextCtrl_IsMultiLine 1844
-#define wxTextCtrl_IsSingleLine 1845
-#define wxTextCtrl_LoadFile 1846
-#define wxTextCtrl_MarkDirty 1847
-#define wxTextCtrl_Paste 1848
-#define wxTextCtrl_PositionToXY 1849
-#define wxTextCtrl_Redo 1850
-#define wxTextCtrl_Remove 1851
-#define wxTextCtrl_Replace 1852
-#define wxTextCtrl_SaveFile 1853
-#define wxTextCtrl_SetDefaultStyle 1854
-#define wxTextCtrl_SetEditable 1855
-#define wxTextCtrl_SetInsertionPoint 1856
-#define wxTextCtrl_SetInsertionPointEnd 1857
-#define wxTextCtrl_SetMaxLength 1859
-#define wxTextCtrl_SetSelection 1860
-#define wxTextCtrl_SetStyle 1861
-#define wxTextCtrl_SetValue 1862
-#define wxTextCtrl_ShowPosition 1863
-#define wxTextCtrl_Undo 1864
-#define wxTextCtrl_WriteText 1865
-#define wxTextCtrl_XYToPosition 1866
-#define wxNotebook_new_0 1869
-#define wxNotebook_new_3 1870
-#define wxNotebook_destruct 1871
-#define wxNotebook_AddPage 1872
-#define wxNotebook_AdvanceSelection 1873
-#define wxNotebook_AssignImageList 1874
-#define wxNotebook_Create 1875
-#define wxNotebook_DeleteAllPages 1876
-#define wxNotebook_DeletePage 1877
-#define wxNotebook_RemovePage 1878
-#define wxNotebook_GetCurrentPage 1879
-#define wxNotebook_GetImageList 1880
-#define wxNotebook_GetPage 1882
-#define wxNotebook_GetPageCount 1883
-#define wxNotebook_GetPageImage 1884
-#define wxNotebook_GetPageText 1885
-#define wxNotebook_GetRowCount 1886
-#define wxNotebook_GetSelection 1887
-#define wxNotebook_GetThemeBackgroundColour 1888
-#define wxNotebook_HitTest 1890
-#define wxNotebook_InsertPage 1892
-#define wxNotebook_SetImageList 1893
-#define wxNotebook_SetPadding 1894
-#define wxNotebook_SetPageSize 1895
-#define wxNotebook_SetPageImage 1896
-#define wxNotebook_SetPageText 1897
-#define wxNotebook_SetSelection 1898
-#define wxNotebook_ChangeSelection 1899
-#define wxChoicebook_new_0 1900
-#define wxChoicebook_new_3 1901
-#define wxChoicebook_AddPage 1902
-#define wxChoicebook_AdvanceSelection 1903
-#define wxChoicebook_AssignImageList 1904
-#define wxChoicebook_Create 1905
-#define wxChoicebook_DeleteAllPages 1906
-#define wxChoicebook_DeletePage 1907
-#define wxChoicebook_RemovePage 1908
-#define wxChoicebook_GetCurrentPage 1909
-#define wxChoicebook_GetImageList 1910
-#define wxChoicebook_GetPage 1912
-#define wxChoicebook_GetPageCount 1913
-#define wxChoicebook_GetPageImage 1914
-#define wxChoicebook_GetPageText 1915
-#define wxChoicebook_GetSelection 1916
-#define wxChoicebook_HitTest 1917
-#define wxChoicebook_InsertPage 1918
-#define wxChoicebook_SetImageList 1919
-#define wxChoicebook_SetPageSize 1920
-#define wxChoicebook_SetPageImage 1921
-#define wxChoicebook_SetPageText 1922
-#define wxChoicebook_SetSelection 1923
-#define wxChoicebook_ChangeSelection 1924
-#define wxChoicebook_destroy 1925
-#define wxToolbook_new_0 1926
-#define wxToolbook_new_3 1927
-#define wxToolbook_AddPage 1928
-#define wxToolbook_AdvanceSelection 1929
-#define wxToolbook_AssignImageList 1930
-#define wxToolbook_Create 1931
-#define wxToolbook_DeleteAllPages 1932
-#define wxToolbook_DeletePage 1933
-#define wxToolbook_RemovePage 1934
-#define wxToolbook_GetCurrentPage 1935
-#define wxToolbook_GetImageList 1936
-#define wxToolbook_GetPage 1938
-#define wxToolbook_GetPageCount 1939
-#define wxToolbook_GetPageImage 1940
-#define wxToolbook_GetPageText 1941
-#define wxToolbook_GetSelection 1942
-#define wxToolbook_HitTest 1944
-#define wxToolbook_InsertPage 1945
-#define wxToolbook_SetImageList 1946
-#define wxToolbook_SetPageSize 1947
-#define wxToolbook_SetPageImage 1948
-#define wxToolbook_SetPageText 1949
-#define wxToolbook_SetSelection 1950
-#define wxToolbook_ChangeSelection 1951
-#define wxToolbook_destroy 1952
-#define wxListbook_new_0 1953
-#define wxListbook_new_3 1954
-#define wxListbook_AddPage 1955
-#define wxListbook_AdvanceSelection 1956
-#define wxListbook_AssignImageList 1957
-#define wxListbook_Create 1958
-#define wxListbook_DeleteAllPages 1959
-#define wxListbook_DeletePage 1960
-#define wxListbook_RemovePage 1961
-#define wxListbook_GetCurrentPage 1962
-#define wxListbook_GetImageList 1963
-#define wxListbook_GetPage 1965
-#define wxListbook_GetPageCount 1966
-#define wxListbook_GetPageImage 1967
-#define wxListbook_GetPageText 1968
-#define wxListbook_GetSelection 1969
-#define wxListbook_HitTest 1971
-#define wxListbook_InsertPage 1972
-#define wxListbook_SetImageList 1973
-#define wxListbook_SetPageSize 1974
-#define wxListbook_SetPageImage 1975
-#define wxListbook_SetPageText 1976
-#define wxListbook_SetSelection 1977
-#define wxListbook_ChangeSelection 1978
-#define wxListbook_destroy 1979
-#define wxTreebook_new_0 1980
-#define wxTreebook_new_3 1981
-#define wxTreebook_AddPage 1982
-#define wxTreebook_AdvanceSelection 1983
-#define wxTreebook_AssignImageList 1984
-#define wxTreebook_Create 1985
-#define wxTreebook_DeleteAllPages 1986
-#define wxTreebook_DeletePage 1987
-#define wxTreebook_RemovePage 1988
-#define wxTreebook_GetCurrentPage 1989
-#define wxTreebook_GetImageList 1990
-#define wxTreebook_GetPage 1992
-#define wxTreebook_GetPageCount 1993
-#define wxTreebook_GetPageImage 1994
-#define wxTreebook_GetPageText 1995
-#define wxTreebook_GetSelection 1996
-#define wxTreebook_ExpandNode 1997
-#define wxTreebook_IsNodeExpanded 1998
-#define wxTreebook_HitTest 2000
-#define wxTreebook_InsertPage 2001
-#define wxTreebook_InsertSubPage 2002
-#define wxTreebook_SetImageList 2003
-#define wxTreebook_SetPageSize 2004
-#define wxTreebook_SetPageImage 2005
-#define wxTreebook_SetPageText 2006
-#define wxTreebook_SetSelection 2007
-#define wxTreebook_ChangeSelection 2008
-#define wxTreebook_destroy 2009
-#define wxTreeCtrl_new_2 2012
-#define wxTreeCtrl_new_0 2013
-#define wxTreeCtrl_destruct 2015
-#define wxTreeCtrl_AddRoot 2016
-#define wxTreeCtrl_AppendItem 2017
-#define wxTreeCtrl_AssignImageList 2018
-#define wxTreeCtrl_AssignStateImageList 2019
-#define wxTreeCtrl_Collapse 2020
-#define wxTreeCtrl_CollapseAndReset 2021
-#define wxTreeCtrl_Create 2022
-#define wxTreeCtrl_Delete 2023
-#define wxTreeCtrl_DeleteAllItems 2024
-#define wxTreeCtrl_DeleteChildren 2025
-#define wxTreeCtrl_EditLabel 2026
-#define wxTreeCtrl_EnsureVisible 2027
-#define wxTreeCtrl_Expand 2028
-#define wxTreeCtrl_GetBoundingRect 2029
-#define wxTreeCtrl_GetChildrenCount 2031
-#define wxTreeCtrl_GetCount 2032
-#define wxTreeCtrl_GetEditControl 2033
-#define wxTreeCtrl_GetFirstChild 2034
-#define wxTreeCtrl_GetNextChild 2035
-#define wxTreeCtrl_GetFirstVisibleItem 2036
-#define wxTreeCtrl_GetImageList 2037
-#define wxTreeCtrl_GetIndent 2038
-#define wxTreeCtrl_GetItemBackgroundColour 2039
-#define wxTreeCtrl_GetItemData 2040
-#define wxTreeCtrl_GetItemFont 2041
-#define wxTreeCtrl_GetItemImage_1 2042
-#define wxTreeCtrl_GetItemImage_2 2043
-#define wxTreeCtrl_GetItemText 2044
-#define wxTreeCtrl_GetItemTextColour 2045
-#define wxTreeCtrl_GetLastChild 2046
-#define wxTreeCtrl_GetNextSibling 2047
-#define wxTreeCtrl_GetNextVisible 2048
-#define wxTreeCtrl_GetItemParent 2049
-#define wxTreeCtrl_GetPrevSibling 2050
-#define wxTreeCtrl_GetPrevVisible 2051
-#define wxTreeCtrl_GetRootItem 2052
-#define wxTreeCtrl_GetSelection 2053
-#define wxTreeCtrl_GetSelections 2054
-#define wxTreeCtrl_GetStateImageList 2055
-#define wxTreeCtrl_HitTest 2056
-#define wxTreeCtrl_InsertItem 2058
-#define wxTreeCtrl_IsBold 2059
-#define wxTreeCtrl_IsExpanded 2060
-#define wxTreeCtrl_IsSelected 2061
-#define wxTreeCtrl_IsVisible 2062
-#define wxTreeCtrl_ItemHasChildren 2063
-#define wxTreeCtrl_IsTreeItemIdOk 2064
-#define wxTreeCtrl_PrependItem 2065
-#define wxTreeCtrl_ScrollTo 2066
-#define wxTreeCtrl_SelectItem_1 2067
-#define wxTreeCtrl_SelectItem_2 2068
-#define wxTreeCtrl_SetIndent 2069
-#define wxTreeCtrl_SetImageList 2070
-#define wxTreeCtrl_SetItemBackgroundColour 2071
-#define wxTreeCtrl_SetItemBold 2072
-#define wxTreeCtrl_SetItemData 2073
-#define wxTreeCtrl_SetItemDropHighlight 2074
-#define wxTreeCtrl_SetItemFont 2075
-#define wxTreeCtrl_SetItemHasChildren 2076
-#define wxTreeCtrl_SetItemImage_2 2077
-#define wxTreeCtrl_SetItemImage_3 2078
-#define wxTreeCtrl_SetItemText 2079
-#define wxTreeCtrl_SetItemTextColour 2080
-#define wxTreeCtrl_SetStateImageList 2081
-#define wxTreeCtrl_SetWindowStyle 2082
-#define wxTreeCtrl_SortChildren 2083
-#define wxTreeCtrl_Toggle 2084
-#define wxTreeCtrl_ToggleItemSelection 2085
-#define wxTreeCtrl_Unselect 2086
-#define wxTreeCtrl_UnselectAll 2087
-#define wxTreeCtrl_UnselectItem 2088
-#define wxScrollBar_new_0 2089
-#define wxScrollBar_new_3 2090
-#define wxScrollBar_destruct 2091
-#define wxScrollBar_Create 2092
-#define wxScrollBar_GetRange 2093
-#define wxScrollBar_GetPageSize 2094
-#define wxScrollBar_GetThumbPosition 2095
-#define wxScrollBar_GetThumbSize 2096
-#define wxScrollBar_SetThumbPosition 2097
-#define wxScrollBar_SetScrollbar 2098
-#define wxSpinButton_new_2 2100
-#define wxSpinButton_new_0 2101
-#define wxSpinButton_Create 2102
-#define wxSpinButton_GetMax 2103
-#define wxSpinButton_GetMin 2104
-#define wxSpinButton_GetValue 2105
-#define wxSpinButton_SetRange 2106
-#define wxSpinButton_SetValue 2107
-#define wxSpinButton_destroy 2108
-#define wxSpinCtrl_new_0 2109
-#define wxSpinCtrl_new_2 2110
-#define wxSpinCtrl_Create 2112
-#define wxSpinCtrl_SetValue_1_1 2115
-#define wxSpinCtrl_SetValue_1_0 2116
-#define wxSpinCtrl_GetValue 2118
-#define wxSpinCtrl_SetRange 2120
-#define wxSpinCtrl_SetSelection 2121
-#define wxSpinCtrl_GetMin 2123
-#define wxSpinCtrl_GetMax 2125
-#define wxSpinCtrl_destroy 2126
-#define wxStaticText_new_0 2127
-#define wxStaticText_new_4 2128
-#define wxStaticText_Create 2129
-#define wxStaticText_GetLabel 2130
-#define wxStaticText_SetLabel 2131
-#define wxStaticText_Wrap 2132
-#define wxStaticText_destroy 2133
-#define wxStaticBitmap_new_0 2134
-#define wxStaticBitmap_new_4 2135
-#define wxStaticBitmap_Create 2136
-#define wxStaticBitmap_GetBitmap 2137
-#define wxStaticBitmap_SetBitmap 2138
-#define wxStaticBitmap_destroy 2139
-#define wxRadioBox_new 2140
-#define wxRadioBox_destruct 2142
-#define wxRadioBox_Create 2143
-#define wxRadioBox_Enable_2 2144
-#define wxRadioBox_Enable_1 2145
-#define wxRadioBox_GetSelection 2146
-#define wxRadioBox_GetString 2147
-#define wxRadioBox_SetSelection 2148
-#define wxRadioBox_Show_2 2149
-#define wxRadioBox_Show_1 2150
-#define wxRadioBox_GetColumnCount 2151
-#define wxRadioBox_GetItemHelpText 2152
-#define wxRadioBox_GetItemToolTip 2153
-#define wxRadioBox_GetItemFromPoint 2155
-#define wxRadioBox_GetRowCount 2156
-#define wxRadioBox_IsItemEnabled 2157
-#define wxRadioBox_IsItemShown 2158
-#define wxRadioBox_SetItemHelpText 2159
-#define wxRadioBox_SetItemToolTip 2160
-#define wxRadioButton_new_0 2161
-#define wxRadioButton_new_4 2162
-#define wxRadioButton_Create 2163
-#define wxRadioButton_GetValue 2164
-#define wxRadioButton_SetValue 2165
-#define wxRadioButton_destroy 2166
-#define wxSlider_new_6 2168
-#define wxSlider_new_0 2169
-#define wxSlider_Create 2170
-#define wxSlider_GetLineSize 2171
-#define wxSlider_GetMax 2172
-#define wxSlider_GetMin 2173
-#define wxSlider_GetPageSize 2174
-#define wxSlider_GetThumbLength 2175
-#define wxSlider_GetValue 2176
-#define wxSlider_SetLineSize 2177
-#define wxSlider_SetPageSize 2178
-#define wxSlider_SetRange 2179
-#define wxSlider_SetThumbLength 2180
-#define wxSlider_SetValue 2181
-#define wxSlider_destroy 2182
-#define wxDialog_new_4 2184
-#define wxDialog_new_0 2185
-#define wxDialog_destruct 2187
-#define wxDialog_Create 2188
-#define wxDialog_CreateButtonSizer 2189
-#define wxDialog_CreateStdDialogButtonSizer 2190
-#define wxDialog_EndModal 2191
-#define wxDialog_GetAffirmativeId 2192
-#define wxDialog_GetReturnCode 2193
-#define wxDialog_IsModal 2194
-#define wxDialog_SetAffirmativeId 2195
-#define wxDialog_SetReturnCode 2196
-#define wxDialog_Show 2197
-#define wxDialog_ShowModal 2198
-#define wxColourDialog_new_0 2199
-#define wxColourDialog_new_2 2200
-#define wxColourDialog_destruct 2201
-#define wxColourDialog_Create 2202
-#define wxColourDialog_GetColourData 2203
-#define wxColourData_new_0 2204
-#define wxColourData_new_1 2205
-#define wxColourData_destruct 2206
-#define wxColourData_GetChooseFull 2207
-#define wxColourData_GetColour 2208
-#define wxColourData_GetCustomColour 2210
-#define wxColourData_SetChooseFull 2211
-#define wxColourData_SetColour 2212
-#define wxColourData_SetCustomColour 2213
-#define wxPalette_new_0 2214
-#define wxPalette_new_4 2215
-#define wxPalette_destruct 2217
-#define wxPalette_Create 2218
-#define wxPalette_GetColoursCount 2219
-#define wxPalette_GetPixel 2220
-#define wxPalette_GetRGB 2221
-#define wxPalette_IsOk 2222
-#define wxDirDialog_new 2226
-#define wxDirDialog_destruct 2227
-#define wxDirDialog_GetPath 2228
-#define wxDirDialog_GetMessage 2229
-#define wxDirDialog_SetMessage 2230
-#define wxDirDialog_SetPath 2231
-#define wxFileDialog_new 2235
-#define wxFileDialog_destruct 2236
-#define wxFileDialog_GetDirectory 2237
-#define wxFileDialog_GetFilename 2238
-#define wxFileDialog_GetFilenames 2239
-#define wxFileDialog_GetFilterIndex 2240
-#define wxFileDialog_GetMessage 2241
-#define wxFileDialog_GetPath 2242
-#define wxFileDialog_GetPaths 2243
-#define wxFileDialog_GetWildcard 2244
-#define wxFileDialog_SetDirectory 2245
-#define wxFileDialog_SetFilename 2246
-#define wxFileDialog_SetFilterIndex 2247
-#define wxFileDialog_SetMessage 2248
-#define wxFileDialog_SetPath 2249
-#define wxFileDialog_SetWildcard 2250
-#define wxPickerBase_SetInternalMargin 2251
-#define wxPickerBase_GetInternalMargin 2252
-#define wxPickerBase_SetTextCtrlProportion 2253
-#define wxPickerBase_SetPickerCtrlProportion 2254
-#define wxPickerBase_GetTextCtrlProportion 2255
-#define wxPickerBase_GetPickerCtrlProportion 2256
-#define wxPickerBase_HasTextCtrl 2257
-#define wxPickerBase_GetTextCtrl 2258
-#define wxPickerBase_IsTextCtrlGrowable 2259
-#define wxPickerBase_SetPickerCtrlGrowable 2260
-#define wxPickerBase_SetTextCtrlGrowable 2261
-#define wxPickerBase_IsPickerCtrlGrowable 2262
-#define wxFilePickerCtrl_new_0 2263
-#define wxFilePickerCtrl_new_3 2264
-#define wxFilePickerCtrl_Create 2265
-#define wxFilePickerCtrl_GetPath 2266
-#define wxFilePickerCtrl_SetPath 2267
-#define wxFilePickerCtrl_destroy 2268
-#define wxDirPickerCtrl_new_0 2269
-#define wxDirPickerCtrl_new_3 2270
-#define wxDirPickerCtrl_Create 2271
-#define wxDirPickerCtrl_GetPath 2272
-#define wxDirPickerCtrl_SetPath 2273
-#define wxDirPickerCtrl_destroy 2274
-#define wxColourPickerCtrl_new_0 2275
-#define wxColourPickerCtrl_new_3 2276
-#define wxColourPickerCtrl_Create 2277
-#define wxColourPickerCtrl_GetColour 2278
-#define wxColourPickerCtrl_SetColour_1_1 2279
-#define wxColourPickerCtrl_SetColour_1_0 2280
-#define wxColourPickerCtrl_destroy 2281
-#define wxDatePickerCtrl_new_0 2282
-#define wxDatePickerCtrl_new_3 2283
-#define wxDatePickerCtrl_GetRange 2284
-#define wxDatePickerCtrl_GetValue 2285
-#define wxDatePickerCtrl_SetRange 2286
-#define wxDatePickerCtrl_SetValue 2287
-#define wxDatePickerCtrl_destroy 2288
-#define wxFontPickerCtrl_new_0 2289
-#define wxFontPickerCtrl_new_3 2290
-#define wxFontPickerCtrl_Create 2291
-#define wxFontPickerCtrl_GetSelectedFont 2292
-#define wxFontPickerCtrl_SetSelectedFont 2293
-#define wxFontPickerCtrl_GetMaxPointSize 2294
-#define wxFontPickerCtrl_SetMaxPointSize 2295
-#define wxFontPickerCtrl_destroy 2296
-#define wxFindReplaceDialog_new_0 2299
-#define wxFindReplaceDialog_new_4 2300
-#define wxFindReplaceDialog_destruct 2301
-#define wxFindReplaceDialog_Create 2302
-#define wxFindReplaceDialog_GetData 2303
-#define wxFindReplaceData_new_0 2304
-#define wxFindReplaceData_new_1 2305
-#define wxFindReplaceData_GetFindString 2306
-#define wxFindReplaceData_GetReplaceString 2307
-#define wxFindReplaceData_GetFlags 2308
-#define wxFindReplaceData_SetFlags 2309
-#define wxFindReplaceData_SetFindString 2310
-#define wxFindReplaceData_SetReplaceString 2311
-#define wxFindReplaceData_destroy 2312
-#define wxMultiChoiceDialog_new_0 2313
-#define wxMultiChoiceDialog_new_5 2315
-#define wxMultiChoiceDialog_GetSelections 2316
-#define wxMultiChoiceDialog_SetSelections 2317
-#define wxMultiChoiceDialog_destroy 2318
-#define wxSingleChoiceDialog_new_0 2319
-#define wxSingleChoiceDialog_new_5 2321
-#define wxSingleChoiceDialog_GetSelection 2322
-#define wxSingleChoiceDialog_GetStringSelection 2323
-#define wxSingleChoiceDialog_SetSelection 2324
-#define wxSingleChoiceDialog_destroy 2325
-#define wxTextEntryDialog_new 2326
-#define wxTextEntryDialog_GetValue 2327
-#define wxTextEntryDialog_SetValue 2328
-#define wxTextEntryDialog_destroy 2329
-#define wxPasswordEntryDialog_new 2330
-#define wxPasswordEntryDialog_destroy 2331
-#define wxFontData_new_0 2332
-#define wxFontData_new_1 2333
-#define wxFontData_destruct 2334
-#define wxFontData_EnableEffects 2335
-#define wxFontData_GetAllowSymbols 2336
-#define wxFontData_GetColour 2337
-#define wxFontData_GetChosenFont 2338
-#define wxFontData_GetEnableEffects 2339
-#define wxFontData_GetInitialFont 2340
-#define wxFontData_GetShowHelp 2341
-#define wxFontData_SetAllowSymbols 2342
-#define wxFontData_SetChosenFont 2343
-#define wxFontData_SetColour 2344
-#define wxFontData_SetInitialFont 2345
-#define wxFontData_SetRange 2346
-#define wxFontData_SetShowHelp 2347
-#define wxFontDialog_new_0 2351
-#define wxFontDialog_new_2 2353
-#define wxFontDialog_Create 2355
-#define wxFontDialog_GetFontData 2356
-#define wxFontDialog_destroy 2358
-#define wxProgressDialog_new 2359
-#define wxProgressDialog_destruct 2360
-#define wxProgressDialog_Resume 2361
-#define wxProgressDialog_Update_2 2362
-#define wxProgressDialog_Update_0 2363
-#define wxMessageDialog_new 2364
-#define wxMessageDialog_destruct 2365
-#define wxPageSetupDialog_new 2366
-#define wxPageSetupDialog_destruct 2367
-#define wxPageSetupDialog_GetPageSetupData 2368
-#define wxPageSetupDialog_ShowModal 2369
-#define wxPageSetupDialogData_new_0 2370
-#define wxPageSetupDialogData_new_1_0 2371
-#define wxPageSetupDialogData_new_1_1 2372
-#define wxPageSetupDialogData_destruct 2373
-#define wxPageSetupDialogData_EnableHelp 2374
-#define wxPageSetupDialogData_EnableMargins 2375
-#define wxPageSetupDialogData_EnableOrientation 2376
-#define wxPageSetupDialogData_EnablePaper 2377
-#define wxPageSetupDialogData_EnablePrinter 2378
-#define wxPageSetupDialogData_GetDefaultMinMargins 2379
-#define wxPageSetupDialogData_GetEnableMargins 2380
-#define wxPageSetupDialogData_GetEnableOrientation 2381
-#define wxPageSetupDialogData_GetEnablePaper 2382
-#define wxPageSetupDialogData_GetEnablePrinter 2383
-#define wxPageSetupDialogData_GetEnableHelp 2384
-#define wxPageSetupDialogData_GetDefaultInfo 2385
-#define wxPageSetupDialogData_GetMarginTopLeft 2386
-#define wxPageSetupDialogData_GetMarginBottomRight 2387
-#define wxPageSetupDialogData_GetMinMarginTopLeft 2388
-#define wxPageSetupDialogData_GetMinMarginBottomRight 2389
-#define wxPageSetupDialogData_GetPaperId 2390
-#define wxPageSetupDialogData_GetPaperSize 2391
-#define wxPageSetupDialogData_GetPrintData 2393
-#define wxPageSetupDialogData_IsOk 2394
-#define wxPageSetupDialogData_SetDefaultInfo 2395
-#define wxPageSetupDialogData_SetDefaultMinMargins 2396
-#define wxPageSetupDialogData_SetMarginTopLeft 2397
-#define wxPageSetupDialogData_SetMarginBottomRight 2398
-#define wxPageSetupDialogData_SetMinMarginTopLeft 2399
-#define wxPageSetupDialogData_SetMinMarginBottomRight 2400
-#define wxPageSetupDialogData_SetPaperId 2401
-#define wxPageSetupDialogData_SetPaperSize_1_1 2402
-#define wxPageSetupDialogData_SetPaperSize_1_0 2403
-#define wxPageSetupDialogData_SetPrintData 2404
-#define wxPrintDialog_new_2_0 2405
-#define wxPrintDialog_new_2_1 2406
-#define wxPrintDialog_destruct 2407
-#define wxPrintDialog_GetPrintDialogData 2408
-#define wxPrintDialog_GetPrintDC 2409
-#define wxPrintDialogData_new_0 2410
-#define wxPrintDialogData_new_1_1 2411
-#define wxPrintDialogData_new_1_0 2412
-#define wxPrintDialogData_destruct 2413
-#define wxPrintDialogData_EnableHelp 2414
-#define wxPrintDialogData_EnablePageNumbers 2415
-#define wxPrintDialogData_EnablePrintToFile 2416
-#define wxPrintDialogData_EnableSelection 2417
-#define wxPrintDialogData_GetAllPages 2418
-#define wxPrintDialogData_GetCollate 2419
-#define wxPrintDialogData_GetFromPage 2420
-#define wxPrintDialogData_GetMaxPage 2421
-#define wxPrintDialogData_GetMinPage 2422
-#define wxPrintDialogData_GetNoCopies 2423
-#define wxPrintDialogData_GetPrintData 2424
-#define wxPrintDialogData_GetPrintToFile 2425
-#define wxPrintDialogData_GetSelection 2426
-#define wxPrintDialogData_GetToPage 2427
-#define wxPrintDialogData_IsOk 2428
-#define wxPrintDialogData_SetCollate 2429
-#define wxPrintDialogData_SetFromPage 2430
-#define wxPrintDialogData_SetMaxPage 2431
-#define wxPrintDialogData_SetMinPage 2432
-#define wxPrintDialogData_SetNoCopies 2433
-#define wxPrintDialogData_SetPrintData 2434
-#define wxPrintDialogData_SetPrintToFile 2435
-#define wxPrintDialogData_SetSelection 2436
-#define wxPrintDialogData_SetToPage 2437
-#define wxPrintData_new_0 2438
-#define wxPrintData_new_1 2439
-#define wxPrintData_destruct 2440
-#define wxPrintData_GetCollate 2441
-#define wxPrintData_GetBin 2442
-#define wxPrintData_GetColour 2443
-#define wxPrintData_GetDuplex 2444
-#define wxPrintData_GetNoCopies 2445
-#define wxPrintData_GetOrientation 2446
-#define wxPrintData_GetPaperId 2447
-#define wxPrintData_GetPrinterName 2448
-#define wxPrintData_GetQuality 2449
-#define wxPrintData_IsOk 2450
-#define wxPrintData_SetBin 2451
-#define wxPrintData_SetCollate 2452
-#define wxPrintData_SetColour 2453
-#define wxPrintData_SetDuplex 2454
-#define wxPrintData_SetNoCopies 2455
-#define wxPrintData_SetOrientation 2456
-#define wxPrintData_SetPaperId 2457
-#define wxPrintData_SetPrinterName 2458
-#define wxPrintData_SetQuality 2459
-#define wxPrintPreview_new_2 2462
-#define wxPrintPreview_new_3 2463
-#define wxPrintPreview_destruct 2465
-#define wxPrintPreview_GetCanvas 2466
-#define wxPrintPreview_GetCurrentPage 2467
-#define wxPrintPreview_GetFrame 2468
-#define wxPrintPreview_GetMaxPage 2469
-#define wxPrintPreview_GetMinPage 2470
-#define wxPrintPreview_GetPrintout 2471
-#define wxPrintPreview_GetPrintoutForPrinting 2472
-#define wxPrintPreview_IsOk 2473
-#define wxPrintPreview_PaintPage 2474
-#define wxPrintPreview_Print 2475
-#define wxPrintPreview_RenderPage 2476
-#define wxPrintPreview_SetCanvas 2477
-#define wxPrintPreview_SetCurrentPage 2478
-#define wxPrintPreview_SetFrame 2479
-#define wxPrintPreview_SetPrintout 2480
-#define wxPrintPreview_SetZoom 2481
-#define wxPreviewFrame_new 2482
-#define wxPreviewFrame_destruct 2483
-#define wxPreviewFrame_CreateControlBar 2484
-#define wxPreviewFrame_CreateCanvas 2485
-#define wxPreviewFrame_Initialize 2486
-#define wxPreviewFrame_OnCloseWindow 2487
-#define wxPreviewControlBar_new 2488
-#define wxPreviewControlBar_destruct 2489
-#define wxPreviewControlBar_CreateButtons 2490
-#define wxPreviewControlBar_GetPrintPreview 2491
-#define wxPreviewControlBar_GetZoomControl 2492
-#define wxPreviewControlBar_SetZoomControl 2493
-#define wxPrinter_new 2495
-#define wxPrinter_CreateAbortWindow 2496
-#define wxPrinter_GetAbort 2497
-#define wxPrinter_GetLastError 2498
-#define wxPrinter_GetPrintDialogData 2499
-#define wxPrinter_Print 2500
-#define wxPrinter_PrintDialog 2501
-#define wxPrinter_ReportError 2502
-#define wxPrinter_Setup 2503
-#define wxPrinter_destroy 2504
-#define wxXmlResource_new_1 2505
-#define wxXmlResource_new_2 2506
-#define wxXmlResource_destruct 2507
-#define wxXmlResource_AttachUnknownControl 2508
-#define wxXmlResource_ClearHandlers 2509
-#define wxXmlResource_CompareVersion 2510
-#define wxXmlResource_Get 2511
-#define wxXmlResource_GetFlags 2512
-#define wxXmlResource_GetVersion 2513
-#define wxXmlResource_GetXRCID 2514
-#define wxXmlResource_InitAllHandlers 2515
-#define wxXmlResource_Load 2516
-#define wxXmlResource_LoadBitmap 2517
-#define wxXmlResource_LoadDialog_2 2518
-#define wxXmlResource_LoadDialog_3 2519
-#define wxXmlResource_LoadFrame_2 2520
-#define wxXmlResource_LoadFrame_3 2521
-#define wxXmlResource_LoadIcon 2522
-#define wxXmlResource_LoadMenu 2523
-#define wxXmlResource_LoadMenuBar_2 2524
-#define wxXmlResource_LoadMenuBar_1 2525
-#define wxXmlResource_LoadPanel_2 2526
-#define wxXmlResource_LoadPanel_3 2527
-#define wxXmlResource_LoadToolBar 2528
-#define wxXmlResource_Set 2529
-#define wxXmlResource_SetFlags 2530
-#define wxXmlResource_Unload 2531
-#define wxXmlResource_xrcctrl 2532
-#define wxHtmlEasyPrinting_new 2533
-#define wxHtmlEasyPrinting_destruct 2534
-#define wxHtmlEasyPrinting_GetPrintData 2535
-#define wxHtmlEasyPrinting_GetPageSetupData 2536
-#define wxHtmlEasyPrinting_PreviewFile 2537
-#define wxHtmlEasyPrinting_PreviewText 2538
-#define wxHtmlEasyPrinting_PrintFile 2539
-#define wxHtmlEasyPrinting_PrintText 2540
-#define wxHtmlEasyPrinting_PageSetup 2541
-#define wxHtmlEasyPrinting_SetFonts 2542
-#define wxHtmlEasyPrinting_SetHeader 2543
-#define wxHtmlEasyPrinting_SetFooter 2544
-#define wxGLCanvas_new_2 2546
-#define wxGLCanvas_new_3_1 2547
-#define wxGLCanvas_new_3_0 2548
-#define wxGLCanvas_GetContext 2549
-#define wxGLCanvas_SetCurrent 2551
-#define wxGLCanvas_SwapBuffers 2552
-#define wxGLCanvas_destroy 2553
-#define wxAuiManager_new 2554
-#define wxAuiManager_destruct 2555
-#define wxAuiManager_AddPane_2_1 2556
-#define wxAuiManager_AddPane_3 2557
-#define wxAuiManager_AddPane_2_0 2558
-#define wxAuiManager_DetachPane 2559
-#define wxAuiManager_GetAllPanes 2560
-#define wxAuiManager_GetArtProvider 2561
-#define wxAuiManager_GetDockSizeConstraint 2562
-#define wxAuiManager_GetFlags 2563
-#define wxAuiManager_GetManagedWindow 2564
-#define wxAuiManager_GetManager 2565
-#define wxAuiManager_GetPane_1_1 2566
-#define wxAuiManager_GetPane_1_0 2567
-#define wxAuiManager_HideHint 2568
-#define wxAuiManager_InsertPane 2569
-#define wxAuiManager_LoadPaneInfo 2570
-#define wxAuiManager_LoadPerspective 2571
-#define wxAuiManager_SavePaneInfo 2572
-#define wxAuiManager_SavePerspective 2573
-#define wxAuiManager_SetArtProvider 2574
-#define wxAuiManager_SetDockSizeConstraint 2575
-#define wxAuiManager_SetFlags 2576
-#define wxAuiManager_SetManagedWindow 2577
-#define wxAuiManager_ShowHint 2578
-#define wxAuiManager_UnInit 2579
-#define wxAuiManager_Update 2580
-#define wxAuiPaneInfo_new_0 2581
-#define wxAuiPaneInfo_new_1 2582
-#define wxAuiPaneInfo_destruct 2583
-#define wxAuiPaneInfo_BestSize_1 2584
-#define wxAuiPaneInfo_BestSize_2 2585
-#define wxAuiPaneInfo_Bottom 2586
-#define wxAuiPaneInfo_BottomDockable 2587
-#define wxAuiPaneInfo_Caption 2588
-#define wxAuiPaneInfo_CaptionVisible 2589
-#define wxAuiPaneInfo_Centre 2590
-#define wxAuiPaneInfo_CentrePane 2591
-#define wxAuiPaneInfo_CloseButton 2592
-#define wxAuiPaneInfo_DefaultPane 2593
-#define wxAuiPaneInfo_DestroyOnClose 2594
-#define wxAuiPaneInfo_Direction 2595
-#define wxAuiPaneInfo_Dock 2596
-#define wxAuiPaneInfo_Dockable 2597
-#define wxAuiPaneInfo_Fixed 2598
-#define wxAuiPaneInfo_Float 2599
-#define wxAuiPaneInfo_Floatable 2600
-#define wxAuiPaneInfo_FloatingPosition_1 2601
-#define wxAuiPaneInfo_FloatingPosition_2 2602
-#define wxAuiPaneInfo_FloatingSize_1 2603
-#define wxAuiPaneInfo_FloatingSize_2 2604
-#define wxAuiPaneInfo_Gripper 2605
-#define wxAuiPaneInfo_GripperTop 2606
-#define wxAuiPaneInfo_HasBorder 2607
-#define wxAuiPaneInfo_HasCaption 2608
-#define wxAuiPaneInfo_HasCloseButton 2609
-#define wxAuiPaneInfo_HasFlag 2610
-#define wxAuiPaneInfo_HasGripper 2611
-#define wxAuiPaneInfo_HasGripperTop 2612
-#define wxAuiPaneInfo_HasMaximizeButton 2613
-#define wxAuiPaneInfo_HasMinimizeButton 2614
-#define wxAuiPaneInfo_HasPinButton 2615
-#define wxAuiPaneInfo_Hide 2616
-#define wxAuiPaneInfo_IsBottomDockable 2617
-#define wxAuiPaneInfo_IsDocked 2618
-#define wxAuiPaneInfo_IsFixed 2619
-#define wxAuiPaneInfo_IsFloatable 2620
-#define wxAuiPaneInfo_IsFloating 2621
-#define wxAuiPaneInfo_IsLeftDockable 2622
-#define wxAuiPaneInfo_IsMovable 2623
-#define wxAuiPaneInfo_IsOk 2624
-#define wxAuiPaneInfo_IsResizable 2625
-#define wxAuiPaneInfo_IsRightDockable 2626
-#define wxAuiPaneInfo_IsShown 2627
-#define wxAuiPaneInfo_IsToolbar 2628
-#define wxAuiPaneInfo_IsTopDockable 2629
-#define wxAuiPaneInfo_Layer 2630
-#define wxAuiPaneInfo_Left 2631
-#define wxAuiPaneInfo_LeftDockable 2632
-#define wxAuiPaneInfo_MaxSize_1 2633
-#define wxAuiPaneInfo_MaxSize_2 2634
-#define wxAuiPaneInfo_MaximizeButton 2635
-#define wxAuiPaneInfo_MinSize_1 2636
-#define wxAuiPaneInfo_MinSize_2 2637
-#define wxAuiPaneInfo_MinimizeButton 2638
-#define wxAuiPaneInfo_Movable 2639
-#define wxAuiPaneInfo_Name 2640
-#define wxAuiPaneInfo_PaneBorder 2641
-#define wxAuiPaneInfo_PinButton 2642
-#define wxAuiPaneInfo_Position 2643
-#define wxAuiPaneInfo_Resizable 2644
-#define wxAuiPaneInfo_Right 2645
-#define wxAuiPaneInfo_RightDockable 2646
-#define wxAuiPaneInfo_Row 2647
-#define wxAuiPaneInfo_SafeSet 2648
-#define wxAuiPaneInfo_SetFlag 2649
-#define wxAuiPaneInfo_Show 2650
-#define wxAuiPaneInfo_ToolbarPane 2651
-#define wxAuiPaneInfo_Top 2652
-#define wxAuiPaneInfo_TopDockable 2653
-#define wxAuiPaneInfo_Window 2654
-#define wxAuiPaneInfo_GetWindow 2655
-#define wxAuiPaneInfo_GetFrame 2656
-#define wxAuiPaneInfo_GetDirection 2657
-#define wxAuiPaneInfo_GetLayer 2658
-#define wxAuiPaneInfo_GetRow 2659
-#define wxAuiPaneInfo_GetPosition 2660
-#define wxAuiPaneInfo_GetFloatingPosition 2661
-#define wxAuiPaneInfo_GetFloatingSize 2662
-#define wxAuiNotebook_new_0 2663
-#define wxAuiNotebook_new_2 2664
-#define wxAuiNotebook_AddPage 2665
-#define wxAuiNotebook_Create 2666
-#define wxAuiNotebook_DeletePage 2667
-#define wxAuiNotebook_GetArtProvider 2668
-#define wxAuiNotebook_GetPage 2669
-#define wxAuiNotebook_GetPageBitmap 2670
-#define wxAuiNotebook_GetPageCount 2671
-#define wxAuiNotebook_GetPageIndex 2672
-#define wxAuiNotebook_GetPageText 2673
-#define wxAuiNotebook_GetSelection 2674
-#define wxAuiNotebook_InsertPage 2675
-#define wxAuiNotebook_RemovePage 2676
-#define wxAuiNotebook_SetArtProvider 2677
-#define wxAuiNotebook_SetFont 2678
-#define wxAuiNotebook_SetPageBitmap 2679
-#define wxAuiNotebook_SetPageText 2680
-#define wxAuiNotebook_SetSelection 2681
-#define wxAuiNotebook_SetTabCtrlHeight 2682
-#define wxAuiNotebook_SetUniformBitmapSize 2683
-#define wxAuiNotebook_destroy 2684
-#define wxAuiTabArt_SetFlags 2685
-#define wxAuiTabArt_SetMeasuringFont 2686
-#define wxAuiTabArt_SetNormalFont 2687
-#define wxAuiTabArt_SetSelectedFont 2688
-#define wxAuiTabArt_SetColour 2689
-#define wxAuiTabArt_SetActiveColour 2690
-#define wxAuiDockArt_GetColour 2691
-#define wxAuiDockArt_GetFont 2692
-#define wxAuiDockArt_GetMetric 2693
-#define wxAuiDockArt_SetColour 2694
-#define wxAuiDockArt_SetFont 2695
-#define wxAuiDockArt_SetMetric 2696
-#define wxAuiSimpleTabArt_new 2697
-#define wxAuiSimpleTabArt_destroy 2698
-#define wxMDIParentFrame_new_0 2699
-#define wxMDIParentFrame_new_4 2700
-#define wxMDIParentFrame_destruct 2701
-#define wxMDIParentFrame_ActivateNext 2702
-#define wxMDIParentFrame_ActivatePrevious 2703
-#define wxMDIParentFrame_ArrangeIcons 2704
-#define wxMDIParentFrame_Cascade 2705
-#define wxMDIParentFrame_Create 2706
-#define wxMDIParentFrame_GetActiveChild 2707
-#define wxMDIParentFrame_GetClientWindow 2708
-#define wxMDIParentFrame_Tile 2709
-#define wxMDIChildFrame_new_0 2710
-#define wxMDIChildFrame_new_4 2711
-#define wxMDIChildFrame_destruct 2712
-#define wxMDIChildFrame_Activate 2713
-#define wxMDIChildFrame_Create 2714
-#define wxMDIChildFrame_Maximize 2715
-#define wxMDIChildFrame_Restore 2716
-#define wxMDIClientWindow_new_0 2717
-#define wxMDIClientWindow_new_2 2718
-#define wxMDIClientWindow_destruct 2719
-#define wxMDIClientWindow_CreateClient 2720
-#define wxLayoutAlgorithm_new 2721
-#define wxLayoutAlgorithm_LayoutFrame 2722
-#define wxLayoutAlgorithm_LayoutMDIFrame 2723
-#define wxLayoutAlgorithm_LayoutWindow 2724
-#define wxLayoutAlgorithm_destroy 2725
-#define wxEvent_GetId 2726
-#define wxEvent_GetSkipped 2727
-#define wxEvent_GetTimestamp 2728
-#define wxEvent_IsCommandEvent 2729
-#define wxEvent_ResumePropagation 2730
-#define wxEvent_ShouldPropagate 2731
-#define wxEvent_Skip 2732
-#define wxEvent_StopPropagation 2733
-#define wxCommandEvent_getClientData 2734
-#define wxCommandEvent_GetExtraLong 2735
-#define wxCommandEvent_GetInt 2736
-#define wxCommandEvent_GetSelection 2737
-#define wxCommandEvent_GetString 2738
-#define wxCommandEvent_IsChecked 2739
-#define wxCommandEvent_IsSelection 2740
-#define wxCommandEvent_SetInt 2741
-#define wxCommandEvent_SetString 2742
-#define wxScrollEvent_GetOrientation 2743
-#define wxScrollEvent_GetPosition 2744
-#define wxScrollWinEvent_GetOrientation 2745
-#define wxScrollWinEvent_GetPosition 2746
-#define wxMouseEvent_AltDown 2747
-#define wxMouseEvent_Button 2748
-#define wxMouseEvent_ButtonDClick 2749
-#define wxMouseEvent_ButtonDown 2750
-#define wxMouseEvent_ButtonUp 2751
-#define wxMouseEvent_CmdDown 2752
-#define wxMouseEvent_ControlDown 2753
-#define wxMouseEvent_Dragging 2754
-#define wxMouseEvent_Entering 2755
-#define wxMouseEvent_GetButton 2756
-#define wxMouseEvent_GetPosition 2759
-#define wxMouseEvent_GetLogicalPosition 2760
-#define wxMouseEvent_GetLinesPerAction 2761
-#define wxMouseEvent_GetWheelRotation 2762
-#define wxMouseEvent_GetWheelDelta 2763
-#define wxMouseEvent_GetX 2764
-#define wxMouseEvent_GetY 2765
-#define wxMouseEvent_IsButton 2766
-#define wxMouseEvent_IsPageScroll 2767
-#define wxMouseEvent_Leaving 2768
-#define wxMouseEvent_LeftDClick 2769
-#define wxMouseEvent_LeftDown 2770
-#define wxMouseEvent_LeftIsDown 2771
-#define wxMouseEvent_LeftUp 2772
-#define wxMouseEvent_MetaDown 2773
-#define wxMouseEvent_MiddleDClick 2774
-#define wxMouseEvent_MiddleDown 2775
-#define wxMouseEvent_MiddleIsDown 2776
-#define wxMouseEvent_MiddleUp 2777
-#define wxMouseEvent_Moving 2778
-#define wxMouseEvent_RightDClick 2779
-#define wxMouseEvent_RightDown 2780
-#define wxMouseEvent_RightIsDown 2781
-#define wxMouseEvent_RightUp 2782
-#define wxMouseEvent_ShiftDown 2783
-#define wxSetCursorEvent_GetCursor 2784
-#define wxSetCursorEvent_GetX 2785
-#define wxSetCursorEvent_GetY 2786
-#define wxSetCursorEvent_HasCursor 2787
-#define wxSetCursorEvent_SetCursor 2788
-#define wxKeyEvent_AltDown 2789
-#define wxKeyEvent_CmdDown 2790
-#define wxKeyEvent_ControlDown 2791
-#define wxKeyEvent_GetKeyCode 2792
-#define wxKeyEvent_GetModifiers 2793
-#define wxKeyEvent_GetPosition 2796
-#define wxKeyEvent_GetRawKeyCode 2797
-#define wxKeyEvent_GetRawKeyFlags 2798
-#define wxKeyEvent_GetUnicodeKey 2799
-#define wxKeyEvent_GetX 2800
-#define wxKeyEvent_GetY 2801
-#define wxKeyEvent_HasModifiers 2802
-#define wxKeyEvent_MetaDown 2803
-#define wxKeyEvent_ShiftDown 2804
-#define wxSizeEvent_GetSize 2805
-#define wxMoveEvent_GetPosition 2806
-#define wxEraseEvent_GetDC 2807
-#define wxFocusEvent_GetWindow 2808
-#define wxChildFocusEvent_GetWindow 2809
-#define wxMenuEvent_GetMenu 2810
-#define wxMenuEvent_GetMenuId 2811
-#define wxMenuEvent_IsPopup 2812
-#define wxCloseEvent_CanVeto 2813
-#define wxCloseEvent_GetLoggingOff 2814
-#define wxCloseEvent_SetCanVeto 2815
-#define wxCloseEvent_SetLoggingOff 2816
-#define wxCloseEvent_Veto 2817
-#define wxShowEvent_SetShow 2818
-#define wxShowEvent_GetShow 2819
-#define wxIconizeEvent_Iconized 2820
-#define wxJoystickEvent_ButtonDown 2821
-#define wxJoystickEvent_ButtonIsDown 2822
-#define wxJoystickEvent_ButtonUp 2823
-#define wxJoystickEvent_GetButtonChange 2824
-#define wxJoystickEvent_GetButtonState 2825
-#define wxJoystickEvent_GetJoystick 2826
-#define wxJoystickEvent_GetPosition 2827
-#define wxJoystickEvent_GetZPosition 2828
-#define wxJoystickEvent_IsButton 2829
-#define wxJoystickEvent_IsMove 2830
-#define wxJoystickEvent_IsZMove 2831
-#define wxUpdateUIEvent_CanUpdate 2832
-#define wxUpdateUIEvent_Check 2833
-#define wxUpdateUIEvent_Enable 2834
-#define wxUpdateUIEvent_Show 2835
-#define wxUpdateUIEvent_GetChecked 2836
-#define wxUpdateUIEvent_GetEnabled 2837
-#define wxUpdateUIEvent_GetShown 2838
-#define wxUpdateUIEvent_GetSetChecked 2839
-#define wxUpdateUIEvent_GetSetEnabled 2840
-#define wxUpdateUIEvent_GetSetShown 2841
-#define wxUpdateUIEvent_GetSetText 2842
-#define wxUpdateUIEvent_GetText 2843
-#define wxUpdateUIEvent_GetMode 2844
-#define wxUpdateUIEvent_GetUpdateInterval 2845
-#define wxUpdateUIEvent_ResetUpdateTime 2846
-#define wxUpdateUIEvent_SetMode 2847
-#define wxUpdateUIEvent_SetText 2848
-#define wxUpdateUIEvent_SetUpdateInterval 2849
-#define wxMouseCaptureChangedEvent_GetCapturedWindow 2850
-#define wxPaletteChangedEvent_SetChangedWindow 2851
-#define wxPaletteChangedEvent_GetChangedWindow 2852
-#define wxQueryNewPaletteEvent_SetPaletteRealized 2853
-#define wxQueryNewPaletteEvent_GetPaletteRealized 2854
-#define wxNavigationKeyEvent_GetDirection 2855
-#define wxNavigationKeyEvent_SetDirection 2856
-#define wxNavigationKeyEvent_IsWindowChange 2857
-#define wxNavigationKeyEvent_SetWindowChange 2858
-#define wxNavigationKeyEvent_IsFromTab 2859
-#define wxNavigationKeyEvent_SetFromTab 2860
-#define wxNavigationKeyEvent_GetCurrentFocus 2861
-#define wxNavigationKeyEvent_SetCurrentFocus 2862
-#define wxHelpEvent_GetOrigin 2863
-#define wxHelpEvent_GetPosition 2864
-#define wxHelpEvent_SetOrigin 2865
-#define wxHelpEvent_SetPosition 2866
-#define wxContextMenuEvent_GetPosition 2867
-#define wxContextMenuEvent_SetPosition 2868
-#define wxIdleEvent_CanSend 2869
-#define wxIdleEvent_GetMode 2870
-#define wxIdleEvent_RequestMore 2871
-#define wxIdleEvent_MoreRequested 2872
-#define wxIdleEvent_SetMode 2873
-#define wxGridEvent_AltDown 2874
-#define wxGridEvent_ControlDown 2875
-#define wxGridEvent_GetCol 2876
-#define wxGridEvent_GetPosition 2877
-#define wxGridEvent_GetRow 2878
-#define wxGridEvent_MetaDown 2879
-#define wxGridEvent_Selecting 2880
-#define wxGridEvent_ShiftDown 2881
-#define wxNotifyEvent_Allow 2882
-#define wxNotifyEvent_IsAllowed 2883
-#define wxNotifyEvent_Veto 2884
-#define wxSashEvent_GetEdge 2885
-#define wxSashEvent_GetDragRect 2886
-#define wxSashEvent_GetDragStatus 2887
-#define wxListEvent_GetCacheFrom 2888
-#define wxListEvent_GetCacheTo 2889
-#define wxListEvent_GetKeyCode 2890
-#define wxListEvent_GetIndex 2891
-#define wxListEvent_GetColumn 2892
-#define wxListEvent_GetPoint 2893
-#define wxListEvent_GetLabel 2894
-#define wxListEvent_GetText 2895
-#define wxListEvent_GetImage 2896
-#define wxListEvent_GetData 2897
-#define wxListEvent_GetMask 2898
-#define wxListEvent_GetItem 2899
-#define wxListEvent_IsEditCancelled 2900
-#define wxDateEvent_GetDate 2901
-#define wxCalendarEvent_GetWeekDay 2902
-#define wxFileDirPickerEvent_GetPath 2903
-#define wxColourPickerEvent_GetColour 2904
-#define wxFontPickerEvent_GetFont 2905
-#define wxStyledTextEvent_GetPosition 2906
-#define wxStyledTextEvent_GetKey 2907
-#define wxStyledTextEvent_GetModifiers 2908
-#define wxStyledTextEvent_GetModificationType 2909
-#define wxStyledTextEvent_GetText 2910
-#define wxStyledTextEvent_GetLength 2911
-#define wxStyledTextEvent_GetLinesAdded 2912
-#define wxStyledTextEvent_GetLine 2913
-#define wxStyledTextEvent_GetFoldLevelNow 2914
-#define wxStyledTextEvent_GetFoldLevelPrev 2915
-#define wxStyledTextEvent_GetMargin 2916
-#define wxStyledTextEvent_GetMessage 2917
-#define wxStyledTextEvent_GetWParam 2918
-#define wxStyledTextEvent_GetLParam 2919
-#define wxStyledTextEvent_GetListType 2920
-#define wxStyledTextEvent_GetX 2921
-#define wxStyledTextEvent_GetY 2922
-#define wxStyledTextEvent_GetDragText 2923
-#define wxStyledTextEvent_GetDragAllowMove 2924
-#define wxStyledTextEvent_GetDragResult 2925
-#define wxStyledTextEvent_GetShift 2926
-#define wxStyledTextEvent_GetControl 2927
-#define wxStyledTextEvent_GetAlt 2928
-#define utils_wxGetKeyState 2929
-#define utils_wxGetMousePosition 2930
-#define utils_wxGetMouseState 2931
-#define utils_wxSetDetectableAutoRepeat 2932
-#define utils_wxBell 2933
-#define utils_wxFindMenuItemId 2934
-#define utils_wxGenericFindWindowAtPoint 2935
-#define utils_wxFindWindowAtPoint 2936
-#define utils_wxBeginBusyCursor 2937
-#define utils_wxEndBusyCursor 2938
-#define utils_wxIsBusy 2939
-#define utils_wxShutdown 2940
-#define utils_wxShell 2941
-#define utils_wxLaunchDefaultBrowser 2942
-#define utils_wxGetEmailAddress 2943
-#define utils_wxGetUserId 2944
-#define utils_wxGetHomeDir 2945
-#define utils_wxNewId 2946
-#define utils_wxRegisterId 2947
-#define utils_wxGetCurrentId 2948
-#define utils_wxGetOsDescription 2949
-#define utils_wxIsPlatformLittleEndian 2950
-#define utils_wxIsPlatform64Bit 2951
-#define gdicmn_wxDisplaySize 2952
-#define gdicmn_wxSetCursor 2953
-#define wxPrintout_new 2954
-#define wxPrintout_destruct 2955
-#define wxPrintout_GetDC 2956
-#define wxPrintout_GetPageSizeMM 2957
-#define wxPrintout_GetPageSizePixels 2958
-#define wxPrintout_GetPaperRectPixels 2959
-#define wxPrintout_GetPPIPrinter 2960
-#define wxPrintout_GetPPIScreen 2961
-#define wxPrintout_GetTitle 2962
-#define wxPrintout_IsPreview 2963
-#define wxPrintout_FitThisSizeToPaper 2964
-#define wxPrintout_FitThisSizeToPage 2965
-#define wxPrintout_FitThisSizeToPageMargins 2966
-#define wxPrintout_MapScreenSizeToPaper 2967
-#define wxPrintout_MapScreenSizeToPage 2968
-#define wxPrintout_MapScreenSizeToPageMargins 2969
-#define wxPrintout_MapScreenSizeToDevice 2970
-#define wxPrintout_GetLogicalPaperRect 2971
-#define wxPrintout_GetLogicalPageRect 2972
-#define wxPrintout_GetLogicalPageMarginsRect 2973
-#define wxPrintout_SetLogicalOrigin 2974
-#define wxPrintout_OffsetLogicalOrigin 2975
-#define wxStyledTextCtrl_new_2 2976
-#define wxStyledTextCtrl_new_0 2977
-#define wxStyledTextCtrl_destruct 2978
-#define wxStyledTextCtrl_Create 2979
-#define wxStyledTextCtrl_AddText 2980
-#define wxStyledTextCtrl_AddStyledText 2981
-#define wxStyledTextCtrl_InsertText 2982
-#define wxStyledTextCtrl_ClearAll 2983
-#define wxStyledTextCtrl_ClearDocumentStyle 2984
-#define wxStyledTextCtrl_GetLength 2985
-#define wxStyledTextCtrl_GetCharAt 2986
-#define wxStyledTextCtrl_GetCurrentPos 2987
-#define wxStyledTextCtrl_GetAnchor 2988
-#define wxStyledTextCtrl_GetStyleAt 2989
-#define wxStyledTextCtrl_Redo 2990
-#define wxStyledTextCtrl_SetUndoCollection 2991
-#define wxStyledTextCtrl_SelectAll 2992
-#define wxStyledTextCtrl_SetSavePoint 2993
-#define wxStyledTextCtrl_GetStyledText 2994
-#define wxStyledTextCtrl_CanRedo 2995
-#define wxStyledTextCtrl_MarkerLineFromHandle 2996
-#define wxStyledTextCtrl_MarkerDeleteHandle 2997
-#define wxStyledTextCtrl_GetUndoCollection 2998
-#define wxStyledTextCtrl_GetViewWhiteSpace 2999
-#define wxStyledTextCtrl_SetViewWhiteSpace 3000
-#define wxStyledTextCtrl_PositionFromPoint 3001
-#define wxStyledTextCtrl_PositionFromPointClose 3002
-#define wxStyledTextCtrl_GotoLine 3003
-#define wxStyledTextCtrl_GotoPos 3004
-#define wxStyledTextCtrl_SetAnchor 3005
-#define wxStyledTextCtrl_GetCurLine 3006
-#define wxStyledTextCtrl_GetEndStyled 3007
-#define wxStyledTextCtrl_ConvertEOLs 3008
-#define wxStyledTextCtrl_GetEOLMode 3009
-#define wxStyledTextCtrl_SetEOLMode 3010
-#define wxStyledTextCtrl_StartStyling 3011
-#define wxStyledTextCtrl_SetStyling 3012
-#define wxStyledTextCtrl_GetBufferedDraw 3013
-#define wxStyledTextCtrl_SetBufferedDraw 3014
-#define wxStyledTextCtrl_SetTabWidth 3015
-#define wxStyledTextCtrl_GetTabWidth 3016
-#define wxStyledTextCtrl_SetCodePage 3017
-#define wxStyledTextCtrl_MarkerDefine 3018
-#define wxStyledTextCtrl_MarkerSetForeground 3019
-#define wxStyledTextCtrl_MarkerSetBackground 3020
-#define wxStyledTextCtrl_MarkerAdd 3021
-#define wxStyledTextCtrl_MarkerDelete 3022
-#define wxStyledTextCtrl_MarkerDeleteAll 3023
-#define wxStyledTextCtrl_MarkerGet 3024
-#define wxStyledTextCtrl_MarkerNext 3025
-#define wxStyledTextCtrl_MarkerPrevious 3026
-#define wxStyledTextCtrl_MarkerDefineBitmap 3027
-#define wxStyledTextCtrl_MarkerAddSet 3028
-#define wxStyledTextCtrl_MarkerSetAlpha 3029
-#define wxStyledTextCtrl_SetMarginType 3030
-#define wxStyledTextCtrl_GetMarginType 3031
-#define wxStyledTextCtrl_SetMarginWidth 3032
-#define wxStyledTextCtrl_GetMarginWidth 3033
-#define wxStyledTextCtrl_SetMarginMask 3034
-#define wxStyledTextCtrl_GetMarginMask 3035
-#define wxStyledTextCtrl_SetMarginSensitive 3036
-#define wxStyledTextCtrl_GetMarginSensitive 3037
-#define wxStyledTextCtrl_StyleClearAll 3038
-#define wxStyledTextCtrl_StyleSetForeground 3039
-#define wxStyledTextCtrl_StyleSetBackground 3040
-#define wxStyledTextCtrl_StyleSetBold 3041
-#define wxStyledTextCtrl_StyleSetItalic 3042
-#define wxStyledTextCtrl_StyleSetSize 3043
-#define wxStyledTextCtrl_StyleSetFaceName 3044
-#define wxStyledTextCtrl_StyleSetEOLFilled 3045
-#define wxStyledTextCtrl_StyleResetDefault 3046
-#define wxStyledTextCtrl_StyleSetUnderline 3047
-#define wxStyledTextCtrl_StyleSetCase 3048
-#define wxStyledTextCtrl_StyleSetHotSpot 3049
-#define wxStyledTextCtrl_SetSelForeground 3050
-#define wxStyledTextCtrl_SetSelBackground 3051
-#define wxStyledTextCtrl_GetSelAlpha 3052
-#define wxStyledTextCtrl_SetSelAlpha 3053
-#define wxStyledTextCtrl_SetCaretForeground 3054
-#define wxStyledTextCtrl_CmdKeyAssign 3055
-#define wxStyledTextCtrl_CmdKeyClear 3056
-#define wxStyledTextCtrl_CmdKeyClearAll 3057
-#define wxStyledTextCtrl_SetStyleBytes 3058
-#define wxStyledTextCtrl_StyleSetVisible 3059
-#define wxStyledTextCtrl_GetCaretPeriod 3060
-#define wxStyledTextCtrl_SetCaretPeriod 3061
-#define wxStyledTextCtrl_SetWordChars 3062
-#define wxStyledTextCtrl_BeginUndoAction 3063
-#define wxStyledTextCtrl_EndUndoAction 3064
-#define wxStyledTextCtrl_IndicatorSetStyle 3065
-#define wxStyledTextCtrl_IndicatorGetStyle 3066
-#define wxStyledTextCtrl_IndicatorSetForeground 3067
-#define wxStyledTextCtrl_IndicatorGetForeground 3068
-#define wxStyledTextCtrl_SetWhitespaceForeground 3069
-#define wxStyledTextCtrl_SetWhitespaceBackground 3070
-#define wxStyledTextCtrl_GetStyleBits 3071
-#define wxStyledTextCtrl_SetLineState 3072
-#define wxStyledTextCtrl_GetLineState 3073
-#define wxStyledTextCtrl_GetMaxLineState 3074
-#define wxStyledTextCtrl_GetCaretLineVisible 3075
-#define wxStyledTextCtrl_SetCaretLineVisible 3076
-#define wxStyledTextCtrl_GetCaretLineBackground 3077
-#define wxStyledTextCtrl_SetCaretLineBackground 3078
-#define wxStyledTextCtrl_AutoCompShow 3079
-#define wxStyledTextCtrl_AutoCompCancel 3080
-#define wxStyledTextCtrl_AutoCompActive 3081
-#define wxStyledTextCtrl_AutoCompPosStart 3082
-#define wxStyledTextCtrl_AutoCompComplete 3083
-#define wxStyledTextCtrl_AutoCompStops 3084
-#define wxStyledTextCtrl_AutoCompSetSeparator 3085
-#define wxStyledTextCtrl_AutoCompGetSeparator 3086
-#define wxStyledTextCtrl_AutoCompSelect 3087
-#define wxStyledTextCtrl_AutoCompSetCancelAtStart 3088
-#define wxStyledTextCtrl_AutoCompGetCancelAtStart 3089
-#define wxStyledTextCtrl_AutoCompSetFillUps 3090
-#define wxStyledTextCtrl_AutoCompSetChooseSingle 3091
-#define wxStyledTextCtrl_AutoCompGetChooseSingle 3092
-#define wxStyledTextCtrl_AutoCompSetIgnoreCase 3093
-#define wxStyledTextCtrl_AutoCompGetIgnoreCase 3094
-#define wxStyledTextCtrl_UserListShow 3095
-#define wxStyledTextCtrl_AutoCompSetAutoHide 3096
-#define wxStyledTextCtrl_AutoCompGetAutoHide 3097
-#define wxStyledTextCtrl_AutoCompSetDropRestOfWord 3098
-#define wxStyledTextCtrl_AutoCompGetDropRestOfWord 3099
-#define wxStyledTextCtrl_RegisterImage 3100
-#define wxStyledTextCtrl_ClearRegisteredImages 3101
-#define wxStyledTextCtrl_AutoCompGetTypeSeparator 3102
-#define wxStyledTextCtrl_AutoCompSetTypeSeparator 3103
-#define wxStyledTextCtrl_AutoCompSetMaxWidth 3104
-#define wxStyledTextCtrl_AutoCompGetMaxWidth 3105
-#define wxStyledTextCtrl_AutoCompSetMaxHeight 3106
-#define wxStyledTextCtrl_AutoCompGetMaxHeight 3107
-#define wxStyledTextCtrl_SetIndent 3108
-#define wxStyledTextCtrl_GetIndent 3109
-#define wxStyledTextCtrl_SetUseTabs 3110
-#define wxStyledTextCtrl_GetUseTabs 3111
-#define wxStyledTextCtrl_SetLineIndentation 3112
-#define wxStyledTextCtrl_GetLineIndentation 3113
-#define wxStyledTextCtrl_GetLineIndentPosition 3114
-#define wxStyledTextCtrl_GetColumn 3115
-#define wxStyledTextCtrl_SetUseHorizontalScrollBar 3116
-#define wxStyledTextCtrl_GetUseHorizontalScrollBar 3117
-#define wxStyledTextCtrl_SetIndentationGuides 3118
-#define wxStyledTextCtrl_GetIndentationGuides 3119
-#define wxStyledTextCtrl_SetHighlightGuide 3120
-#define wxStyledTextCtrl_GetHighlightGuide 3121
-#define wxStyledTextCtrl_GetLineEndPosition 3122
-#define wxStyledTextCtrl_GetCodePage 3123
-#define wxStyledTextCtrl_GetCaretForeground 3124
-#define wxStyledTextCtrl_GetReadOnly 3125
-#define wxStyledTextCtrl_SetCurrentPos 3126
-#define wxStyledTextCtrl_SetSelectionStart 3127
-#define wxStyledTextCtrl_GetSelectionStart 3128
-#define wxStyledTextCtrl_SetSelectionEnd 3129
-#define wxStyledTextCtrl_GetSelectionEnd 3130
-#define wxStyledTextCtrl_SetPrintMagnification 3131
-#define wxStyledTextCtrl_GetPrintMagnification 3132
-#define wxStyledTextCtrl_SetPrintColourMode 3133
-#define wxStyledTextCtrl_GetPrintColourMode 3134
-#define wxStyledTextCtrl_FindText 3135
-#define wxStyledTextCtrl_FormatRange 3136
-#define wxStyledTextCtrl_GetFirstVisibleLine 3137
-#define wxStyledTextCtrl_GetLine 3138
-#define wxStyledTextCtrl_GetLineCount 3139
-#define wxStyledTextCtrl_SetMarginLeft 3140
-#define wxStyledTextCtrl_GetMarginLeft 3141
-#define wxStyledTextCtrl_SetMarginRight 3142
-#define wxStyledTextCtrl_GetMarginRight 3143
-#define wxStyledTextCtrl_GetModify 3144
-#define wxStyledTextCtrl_SetSelection 3145
-#define wxStyledTextCtrl_GetSelectedText 3146
-#define wxStyledTextCtrl_GetTextRange 3147
-#define wxStyledTextCtrl_HideSelection 3148
-#define wxStyledTextCtrl_LineFromPosition 3149
-#define wxStyledTextCtrl_PositionFromLine 3150
-#define wxStyledTextCtrl_LineScroll 3151
-#define wxStyledTextCtrl_EnsureCaretVisible 3152
-#define wxStyledTextCtrl_ReplaceSelection 3153
-#define wxStyledTextCtrl_SetReadOnly 3154
-#define wxStyledTextCtrl_CanPaste 3155
-#define wxStyledTextCtrl_CanUndo 3156
-#define wxStyledTextCtrl_EmptyUndoBuffer 3157
-#define wxStyledTextCtrl_Undo 3158
-#define wxStyledTextCtrl_Cut 3159
-#define wxStyledTextCtrl_Copy 3160
-#define wxStyledTextCtrl_Paste 3161
-#define wxStyledTextCtrl_Clear 3162
-#define wxStyledTextCtrl_SetText 3163
-#define wxStyledTextCtrl_GetText 3164
-#define wxStyledTextCtrl_GetTextLength 3165
-#define wxStyledTextCtrl_GetOvertype 3166
-#define wxStyledTextCtrl_SetCaretWidth 3167
-#define wxStyledTextCtrl_GetCaretWidth 3168
-#define wxStyledTextCtrl_SetTargetStart 3169
-#define wxStyledTextCtrl_GetTargetStart 3170
-#define wxStyledTextCtrl_SetTargetEnd 3171
-#define wxStyledTextCtrl_GetTargetEnd 3172
-#define wxStyledTextCtrl_ReplaceTarget 3173
-#define wxStyledTextCtrl_SearchInTarget 3174
-#define wxStyledTextCtrl_SetSearchFlags 3175
-#define wxStyledTextCtrl_GetSearchFlags 3176
-#define wxStyledTextCtrl_CallTipShow 3177
-#define wxStyledTextCtrl_CallTipCancel 3178
-#define wxStyledTextCtrl_CallTipActive 3179
-#define wxStyledTextCtrl_CallTipPosAtStart 3180
-#define wxStyledTextCtrl_CallTipSetHighlight 3181
-#define wxStyledTextCtrl_CallTipSetBackground 3182
-#define wxStyledTextCtrl_CallTipSetForeground 3183
-#define wxStyledTextCtrl_CallTipSetForegroundHighlight 3184
-#define wxStyledTextCtrl_CallTipUseStyle 3185
-#define wxStyledTextCtrl_VisibleFromDocLine 3186
-#define wxStyledTextCtrl_DocLineFromVisible 3187
-#define wxStyledTextCtrl_WrapCount 3188
-#define wxStyledTextCtrl_SetFoldLevel 3189
-#define wxStyledTextCtrl_GetFoldLevel 3190
-#define wxStyledTextCtrl_GetLastChild 3191
-#define wxStyledTextCtrl_GetFoldParent 3192
-#define wxStyledTextCtrl_ShowLines 3193
-#define wxStyledTextCtrl_HideLines 3194
-#define wxStyledTextCtrl_GetLineVisible 3195
-#define wxStyledTextCtrl_SetFoldExpanded 3196
-#define wxStyledTextCtrl_GetFoldExpanded 3197
-#define wxStyledTextCtrl_ToggleFold 3198
-#define wxStyledTextCtrl_EnsureVisible 3199
-#define wxStyledTextCtrl_SetFoldFlags 3200
-#define wxStyledTextCtrl_EnsureVisibleEnforcePolicy 3201
-#define wxStyledTextCtrl_SetTabIndents 3202
-#define wxStyledTextCtrl_GetTabIndents 3203
-#define wxStyledTextCtrl_SetBackSpaceUnIndents 3204
-#define wxStyledTextCtrl_GetBackSpaceUnIndents 3205
-#define wxStyledTextCtrl_SetMouseDwellTime 3206
-#define wxStyledTextCtrl_GetMouseDwellTime 3207
-#define wxStyledTextCtrl_WordStartPosition 3208
-#define wxStyledTextCtrl_WordEndPosition 3209
-#define wxStyledTextCtrl_SetWrapMode 3210
-#define wxStyledTextCtrl_GetWrapMode 3211
-#define wxStyledTextCtrl_SetWrapVisualFlags 3212
-#define wxStyledTextCtrl_GetWrapVisualFlags 3213
-#define wxStyledTextCtrl_SetWrapVisualFlagsLocation 3214
-#define wxStyledTextCtrl_GetWrapVisualFlagsLocation 3215
-#define wxStyledTextCtrl_SetWrapStartIndent 3216
-#define wxStyledTextCtrl_GetWrapStartIndent 3217
-#define wxStyledTextCtrl_SetLayoutCache 3218
-#define wxStyledTextCtrl_GetLayoutCache 3219
-#define wxStyledTextCtrl_SetScrollWidth 3220
-#define wxStyledTextCtrl_GetScrollWidth 3221
-#define wxStyledTextCtrl_TextWidth 3222
-#define wxStyledTextCtrl_GetEndAtLastLine 3223
-#define wxStyledTextCtrl_TextHeight 3224
-#define wxStyledTextCtrl_SetUseVerticalScrollBar 3225
-#define wxStyledTextCtrl_GetUseVerticalScrollBar 3226
-#define wxStyledTextCtrl_AppendText 3227
-#define wxStyledTextCtrl_GetTwoPhaseDraw 3228
-#define wxStyledTextCtrl_SetTwoPhaseDraw 3229
-#define wxStyledTextCtrl_TargetFromSelection 3230
-#define wxStyledTextCtrl_LinesJoin 3231
-#define wxStyledTextCtrl_LinesSplit 3232
-#define wxStyledTextCtrl_SetFoldMarginColour 3233
-#define wxStyledTextCtrl_SetFoldMarginHiColour 3234
-#define wxStyledTextCtrl_LineDown 3235
-#define wxStyledTextCtrl_LineDownExtend 3236
-#define wxStyledTextCtrl_LineUp 3237
-#define wxStyledTextCtrl_LineUpExtend 3238
-#define wxStyledTextCtrl_CharLeft 3239
-#define wxStyledTextCtrl_CharLeftExtend 3240
-#define wxStyledTextCtrl_CharRight 3241
-#define wxStyledTextCtrl_CharRightExtend 3242
-#define wxStyledTextCtrl_WordLeft 3243
-#define wxStyledTextCtrl_WordLeftExtend 3244
-#define wxStyledTextCtrl_WordRight 3245
-#define wxStyledTextCtrl_WordRightExtend 3246
-#define wxStyledTextCtrl_Home 3247
-#define wxStyledTextCtrl_HomeExtend 3248
-#define wxStyledTextCtrl_LineEnd 3249
-#define wxStyledTextCtrl_LineEndExtend 3250
-#define wxStyledTextCtrl_DocumentStart 3251
-#define wxStyledTextCtrl_DocumentStartExtend 3252
-#define wxStyledTextCtrl_DocumentEnd 3253
-#define wxStyledTextCtrl_DocumentEndExtend 3254
-#define wxStyledTextCtrl_PageUp 3255
-#define wxStyledTextCtrl_PageUpExtend 3256
-#define wxStyledTextCtrl_PageDown 3257
-#define wxStyledTextCtrl_PageDownExtend 3258
-#define wxStyledTextCtrl_EditToggleOvertype 3259
-#define wxStyledTextCtrl_Cancel 3260
-#define wxStyledTextCtrl_DeleteBack 3261
-#define wxStyledTextCtrl_Tab 3262
-#define wxStyledTextCtrl_BackTab 3263
-#define wxStyledTextCtrl_NewLine 3264
-#define wxStyledTextCtrl_FormFeed 3265
-#define wxStyledTextCtrl_VCHome 3266
-#define wxStyledTextCtrl_VCHomeExtend 3267
-#define wxStyledTextCtrl_ZoomIn 3268
-#define wxStyledTextCtrl_ZoomOut 3269
-#define wxStyledTextCtrl_DelWordLeft 3270
-#define wxStyledTextCtrl_DelWordRight 3271
-#define wxStyledTextCtrl_LineCut 3272
-#define wxStyledTextCtrl_LineDelete 3273
-#define wxStyledTextCtrl_LineTranspose 3274
-#define wxStyledTextCtrl_LineDuplicate 3275
-#define wxStyledTextCtrl_LowerCase 3276
-#define wxStyledTextCtrl_UpperCase 3277
-#define wxStyledTextCtrl_LineScrollDown 3278
-#define wxStyledTextCtrl_LineScrollUp 3279
-#define wxStyledTextCtrl_DeleteBackNotLine 3280
-#define wxStyledTextCtrl_HomeDisplay 3281
-#define wxStyledTextCtrl_HomeDisplayExtend 3282
-#define wxStyledTextCtrl_LineEndDisplay 3283
-#define wxStyledTextCtrl_LineEndDisplayExtend 3284
-#define wxStyledTextCtrl_HomeWrapExtend 3285
-#define wxStyledTextCtrl_LineEndWrap 3286
-#define wxStyledTextCtrl_LineEndWrapExtend 3287
-#define wxStyledTextCtrl_VCHomeWrap 3288
-#define wxStyledTextCtrl_VCHomeWrapExtend 3289
-#define wxStyledTextCtrl_LineCopy 3290
-#define wxStyledTextCtrl_MoveCaretInsideView 3291
-#define wxStyledTextCtrl_LineLength 3292
-#define wxStyledTextCtrl_BraceHighlight 3293
-#define wxStyledTextCtrl_BraceBadLight 3294
-#define wxStyledTextCtrl_BraceMatch 3295
-#define wxStyledTextCtrl_GetViewEOL 3296
-#define wxStyledTextCtrl_SetViewEOL 3297
-#define wxStyledTextCtrl_SetModEventMask 3298
-#define wxStyledTextCtrl_GetEdgeColumn 3299
-#define wxStyledTextCtrl_SetEdgeColumn 3300
-#define wxStyledTextCtrl_SetEdgeMode 3301
-#define wxStyledTextCtrl_GetEdgeMode 3302
-#define wxStyledTextCtrl_GetEdgeColour 3303
-#define wxStyledTextCtrl_SetEdgeColour 3304
-#define wxStyledTextCtrl_SearchAnchor 3305
-#define wxStyledTextCtrl_SearchNext 3306
-#define wxStyledTextCtrl_SearchPrev 3307
-#define wxStyledTextCtrl_LinesOnScreen 3308
-#define wxStyledTextCtrl_UsePopUp 3309
-#define wxStyledTextCtrl_SelectionIsRectangle 3310
-#define wxStyledTextCtrl_SetZoom 3311
-#define wxStyledTextCtrl_GetZoom 3312
-#define wxStyledTextCtrl_GetModEventMask 3313
-#define wxStyledTextCtrl_SetSTCFocus 3314
-#define wxStyledTextCtrl_GetSTCFocus 3315
-#define wxStyledTextCtrl_SetStatus 3316
-#define wxStyledTextCtrl_GetStatus 3317
-#define wxStyledTextCtrl_SetMouseDownCaptures 3318
-#define wxStyledTextCtrl_GetMouseDownCaptures 3319
-#define wxStyledTextCtrl_SetSTCCursor 3320
-#define wxStyledTextCtrl_GetSTCCursor 3321
-#define wxStyledTextCtrl_SetControlCharSymbol 3322
-#define wxStyledTextCtrl_GetControlCharSymbol 3323
-#define wxStyledTextCtrl_WordPartLeft 3324
-#define wxStyledTextCtrl_WordPartLeftExtend 3325
-#define wxStyledTextCtrl_WordPartRight 3326
-#define wxStyledTextCtrl_WordPartRightExtend 3327
-#define wxStyledTextCtrl_SetVisiblePolicy 3328
-#define wxStyledTextCtrl_DelLineLeft 3329
-#define wxStyledTextCtrl_DelLineRight 3330
-#define wxStyledTextCtrl_GetXOffset 3331
-#define wxStyledTextCtrl_ChooseCaretX 3332
-#define wxStyledTextCtrl_SetXCaretPolicy 3333
-#define wxStyledTextCtrl_SetYCaretPolicy 3334
-#define wxStyledTextCtrl_GetPrintWrapMode 3335
-#define wxStyledTextCtrl_SetHotspotActiveForeground 3336
-#define wxStyledTextCtrl_SetHotspotActiveBackground 3337
-#define wxStyledTextCtrl_SetHotspotActiveUnderline 3338
-#define wxStyledTextCtrl_SetHotspotSingleLine 3339
-#define wxStyledTextCtrl_ParaDownExtend 3340
-#define wxStyledTextCtrl_ParaUp 3341
-#define wxStyledTextCtrl_ParaUpExtend 3342
-#define wxStyledTextCtrl_PositionBefore 3343
-#define wxStyledTextCtrl_PositionAfter 3344
-#define wxStyledTextCtrl_CopyRange 3345
-#define wxStyledTextCtrl_CopyText 3346
-#define wxStyledTextCtrl_SetSelectionMode 3347
-#define wxStyledTextCtrl_GetSelectionMode 3348
-#define wxStyledTextCtrl_LineDownRectExtend 3349
-#define wxStyledTextCtrl_LineUpRectExtend 3350
-#define wxStyledTextCtrl_CharLeftRectExtend 3351
-#define wxStyledTextCtrl_CharRightRectExtend 3352
-#define wxStyledTextCtrl_HomeRectExtend 3353
-#define wxStyledTextCtrl_VCHomeRectExtend 3354
-#define wxStyledTextCtrl_LineEndRectExtend 3355
-#define wxStyledTextCtrl_PageUpRectExtend 3356
-#define wxStyledTextCtrl_PageDownRectExtend 3357
-#define wxStyledTextCtrl_StutteredPageUp 3358
-#define wxStyledTextCtrl_StutteredPageUpExtend 3359
-#define wxStyledTextCtrl_StutteredPageDown 3360
-#define wxStyledTextCtrl_StutteredPageDownExtend 3361
-#define wxStyledTextCtrl_WordLeftEnd 3362
-#define wxStyledTextCtrl_WordLeftEndExtend 3363
-#define wxStyledTextCtrl_WordRightEnd 3364
-#define wxStyledTextCtrl_WordRightEndExtend 3365
-#define wxStyledTextCtrl_SetWhitespaceChars 3366
-#define wxStyledTextCtrl_SetCharsDefault 3367
-#define wxStyledTextCtrl_AutoCompGetCurrent 3368
-#define wxStyledTextCtrl_Allocate 3369
-#define wxStyledTextCtrl_FindColumn 3370
-#define wxStyledTextCtrl_GetCaretSticky 3371
-#define wxStyledTextCtrl_SetCaretSticky 3372
-#define wxStyledTextCtrl_ToggleCaretSticky 3373
-#define wxStyledTextCtrl_SetPasteConvertEndings 3374
-#define wxStyledTextCtrl_GetPasteConvertEndings 3375
-#define wxStyledTextCtrl_SelectionDuplicate 3376
-#define wxStyledTextCtrl_SetCaretLineBackAlpha 3377
-#define wxStyledTextCtrl_GetCaretLineBackAlpha 3378
-#define wxStyledTextCtrl_StartRecord 3379
-#define wxStyledTextCtrl_StopRecord 3380
-#define wxStyledTextCtrl_SetLexer 3381
-#define wxStyledTextCtrl_GetLexer 3382
-#define wxStyledTextCtrl_Colourise 3383
-#define wxStyledTextCtrl_SetProperty 3384
-#define wxStyledTextCtrl_SetKeyWords 3385
-#define wxStyledTextCtrl_SetLexerLanguage 3386
-#define wxStyledTextCtrl_GetProperty 3387
-#define wxStyledTextCtrl_GetStyleBitsNeeded 3388
-#define wxStyledTextCtrl_GetCurrentLine 3389
-#define wxStyledTextCtrl_StyleSetSpec 3390
-#define wxStyledTextCtrl_StyleSetFont 3391
-#define wxStyledTextCtrl_StyleSetFontAttr 3392
-#define wxStyledTextCtrl_StyleSetCharacterSet 3393
-#define wxStyledTextCtrl_StyleSetFontEncoding 3394
-#define wxStyledTextCtrl_CmdKeyExecute 3395
-#define wxStyledTextCtrl_SetMargins 3396
-#define wxStyledTextCtrl_GetSelection 3397
-#define wxStyledTextCtrl_PointFromPosition 3398
-#define wxStyledTextCtrl_ScrollToLine 3399
-#define wxStyledTextCtrl_ScrollToColumn 3400
-#define wxStyledTextCtrl_SetVScrollBar 3401
-#define wxStyledTextCtrl_SetHScrollBar 3402
-#define wxStyledTextCtrl_GetLastKeydownProcessed 3403
-#define wxStyledTextCtrl_SetLastKeydownProcessed 3404
-#define wxStyledTextCtrl_SaveFile 3405
-#define wxStyledTextCtrl_LoadFile 3406
-#define wxStyledTextCtrl_DoDragOver 3407
-#define wxStyledTextCtrl_DoDropText 3408
-#define wxStyledTextCtrl_GetUseAntiAliasing 3409
-#define wxStyledTextCtrl_AddTextRaw 3410
-#define wxStyledTextCtrl_InsertTextRaw 3411
-#define wxStyledTextCtrl_GetCurLineRaw 3412
-#define wxStyledTextCtrl_GetLineRaw 3413
-#define wxStyledTextCtrl_GetSelectedTextRaw 3414
-#define wxStyledTextCtrl_GetTextRangeRaw 3415
-#define wxStyledTextCtrl_SetTextRaw 3416
-#define wxStyledTextCtrl_GetTextRaw 3417
-#define wxStyledTextCtrl_AppendTextRaw 3418
-#define wxArtProvider_GetBitmap 3419
-#define wxArtProvider_GetIcon 3420
-#define wxTreeEvent_GetKeyCode 3421
-#define wxTreeEvent_GetItem 3422
-#define wxTreeEvent_GetKeyEvent 3423
-#define wxTreeEvent_GetLabel 3424
-#define wxTreeEvent_GetOldItem 3425
-#define wxTreeEvent_GetPoint 3426
-#define wxTreeEvent_IsEditCancelled 3427
-#define wxTreeEvent_SetToolTip 3428
-#define wxNotebookEvent_GetOldSelection 3429
-#define wxNotebookEvent_GetSelection 3430
-#define wxNotebookEvent_SetOldSelection 3431
-#define wxNotebookEvent_SetSelection 3432
-#define wxFileDataObject_new 3433
-#define wxFileDataObject_AddFile 3434
-#define wxFileDataObject_GetFilenames 3435
-#define wxFileDataObject_destroy 3436
-#define wxTextDataObject_new 3437
-#define wxTextDataObject_GetTextLength 3438
-#define wxTextDataObject_GetText 3439
-#define wxTextDataObject_SetText 3440
-#define wxTextDataObject_destroy 3441
-#define wxBitmapDataObject_new_1_1 3442
-#define wxBitmapDataObject_new_1_0 3443
-#define wxBitmapDataObject_GetBitmap 3444
-#define wxBitmapDataObject_SetBitmap 3445
-#define wxBitmapDataObject_destroy 3446
-#define wxClipboard_new 3448
-#define wxClipboard_destruct 3449
-#define wxClipboard_AddData 3450
-#define wxClipboard_Clear 3451
-#define wxClipboard_Close 3452
-#define wxClipboard_Flush 3453
-#define wxClipboard_GetData 3454
-#define wxClipboard_IsOpened 3455
-#define wxClipboard_Open 3456
-#define wxClipboard_SetData 3457
-#define wxClipboard_UsePrimarySelection 3459
-#define wxClipboard_IsSupported 3460
-#define wxClipboard_Get 3461
-#define wxSpinEvent_GetPosition 3462
-#define wxSpinEvent_SetPosition 3463
-#define wxSplitterWindow_new_0 3464
-#define wxSplitterWindow_new_2 3465
-#define wxSplitterWindow_destruct 3466
-#define wxSplitterWindow_Create 3467
-#define wxSplitterWindow_GetMinimumPaneSize 3468
-#define wxSplitterWindow_GetSashGravity 3469
-#define wxSplitterWindow_GetSashPosition 3470
-#define wxSplitterWindow_GetSplitMode 3471
-#define wxSplitterWindow_GetWindow1 3472
-#define wxSplitterWindow_GetWindow2 3473
-#define wxSplitterWindow_Initialize 3474
-#define wxSplitterWindow_IsSplit 3475
-#define wxSplitterWindow_ReplaceWindow 3476
-#define wxSplitterWindow_SetSashGravity 3477
-#define wxSplitterWindow_SetSashPosition 3478
-#define wxSplitterWindow_SetSashSize 3479
-#define wxSplitterWindow_SetMinimumPaneSize 3480
-#define wxSplitterWindow_SetSplitMode 3481
-#define wxSplitterWindow_SplitHorizontally 3482
-#define wxSplitterWindow_SplitVertically 3483
-#define wxSplitterWindow_Unsplit 3484
-#define wxSplitterWindow_UpdateSize 3485
-#define wxSplitterEvent_GetSashPosition 3486
-#define wxSplitterEvent_GetX 3487
-#define wxSplitterEvent_GetY 3488
-#define wxSplitterEvent_GetWindowBeingRemoved 3489
-#define wxSplitterEvent_SetSashPosition 3490
-#define wxHtmlWindow_new_0 3491
-#define wxHtmlWindow_new_2 3492
-#define wxHtmlWindow_AppendToPage 3493
-#define wxHtmlWindow_GetOpenedAnchor 3494
-#define wxHtmlWindow_GetOpenedPage 3495
-#define wxHtmlWindow_GetOpenedPageTitle 3496
-#define wxHtmlWindow_GetRelatedFrame 3497
-#define wxHtmlWindow_HistoryBack 3498
-#define wxHtmlWindow_HistoryCanBack 3499
-#define wxHtmlWindow_HistoryCanForward 3500
-#define wxHtmlWindow_HistoryClear 3501
-#define wxHtmlWindow_HistoryForward 3502
-#define wxHtmlWindow_LoadFile 3503
-#define wxHtmlWindow_LoadPage 3504
-#define wxHtmlWindow_SelectAll 3505
-#define wxHtmlWindow_SelectionToText 3506
-#define wxHtmlWindow_SelectLine 3507
-#define wxHtmlWindow_SelectWord 3508
-#define wxHtmlWindow_SetBorders 3509
-#define wxHtmlWindow_SetFonts 3510
-#define wxHtmlWindow_SetPage 3511
-#define wxHtmlWindow_SetRelatedFrame 3512
-#define wxHtmlWindow_SetRelatedStatusBar 3513
-#define wxHtmlWindow_ToText 3514
-#define wxHtmlWindow_destroy 3515
-#define wxHtmlLinkEvent_GetLinkInfo 3516
-#define wxSystemSettings_GetColour 3517
-#define wxSystemSettings_GetFont 3518
-#define wxSystemSettings_GetMetric 3519
-#define wxSystemSettings_GetScreenType 3520
-#define wxSystemOptions_GetOption 3521
-#define wxSystemOptions_GetOptionInt 3522
-#define wxSystemOptions_HasOption 3523
-#define wxSystemOptions_IsFalse 3524
-#define wxSystemOptions_SetOption_2_1 3525
-#define wxSystemOptions_SetOption_2_0 3526
-#define wxAuiNotebookEvent_SetSelection 3527
-#define wxAuiNotebookEvent_GetSelection 3528
-#define wxAuiNotebookEvent_SetOldSelection 3529
-#define wxAuiNotebookEvent_GetOldSelection 3530
-#define wxAuiNotebookEvent_SetDragSource 3531
-#define wxAuiNotebookEvent_GetDragSource 3532
-#define wxAuiManagerEvent_SetManager 3533
-#define wxAuiManagerEvent_GetManager 3534
-#define wxAuiManagerEvent_SetPane 3535
-#define wxAuiManagerEvent_GetPane 3536
-#define wxAuiManagerEvent_SetButton 3537
-#define wxAuiManagerEvent_GetButton 3538
-#define wxAuiManagerEvent_SetDC 3539
-#define wxAuiManagerEvent_GetDC 3540
-#define wxAuiManagerEvent_Veto 3541
-#define wxAuiManagerEvent_GetVeto 3542
-#define wxAuiManagerEvent_SetCanVeto 3543
-#define wxAuiManagerEvent_CanVeto 3544
-#define wxLogNull_new 3545
-#define wxLogNull_destroy 3546
-#define wxTaskBarIcon_new 3547
-#define wxTaskBarIcon_destruct 3548
-#define wxTaskBarIcon_PopupMenu 3549
-#define wxTaskBarIcon_RemoveIcon 3550
-#define wxTaskBarIcon_SetIcon 3551
-#define wxLocale_new_0 3552
-#define wxLocale_new_2 3554
-#define wxLocale_destruct 3555
-#define wxLocale_Init 3557
-#define wxLocale_AddCatalog_1 3558
-#define wxLocale_AddCatalog_3 3559
-#define wxLocale_AddCatalogLookupPathPrefix 3560
-#define wxLocale_GetCanonicalName 3561
-#define wxLocale_GetLanguage 3562
-#define wxLocale_GetLanguageName 3563
-#define wxLocale_GetLocale 3564
-#define wxLocale_GetName 3565
-#define wxLocale_GetString_2 3566
-#define wxLocale_GetString_4 3567
-#define wxLocale_GetHeaderValue 3568
-#define wxLocale_GetSysName 3569
-#define wxLocale_GetSystemEncoding 3570
-#define wxLocale_GetSystemEncodingName 3571
-#define wxLocale_GetSystemLanguage 3572
-#define wxLocale_IsLoaded 3573
-#define wxLocale_IsOk 3574
-#define wxActivateEvent_GetActive 3575
-#define wxPopupWindow_new_2 3577
-#define wxPopupWindow_new_0 3578
-#define wxPopupWindow_destruct 3580
-#define wxPopupWindow_Create 3581
-#define wxPopupWindow_Position 3582
-#define wxPopupTransientWindow_new_0 3583
-#define wxPopupTransientWindow_new_2 3584
-#define wxPopupTransientWindow_destruct 3585
-#define wxPopupTransientWindow_Popup 3586
-#define wxPopupTransientWindow_Dismiss 3587
-#define wxOverlay_new 3588
-#define wxOverlay_destruct 3589
-#define wxOverlay_Reset 3590
-#define wxDCOverlay_new_6 3591
-#define wxDCOverlay_new_2 3592
-#define wxDCOverlay_destruct 3593
-#define wxDCOverlay_Clear 3594
+#define wxWindow_SetTransparent 284
+#define wxWindow_CanSetTransparent 285
+#define wxWindow_IsDoubleBuffered 286
+#define wxWindow_SetDoubleBuffered 287
+#define wxTopLevelWindow_GetIcon 288
+#define wxTopLevelWindow_GetIcons 289
+#define wxTopLevelWindow_GetTitle 290
+#define wxTopLevelWindow_IsActive 291
+#define wxTopLevelWindow_Iconize 292
+#define wxTopLevelWindow_IsFullScreen 293
+#define wxTopLevelWindow_IsIconized 294
+#define wxTopLevelWindow_IsMaximized 295
+#define wxTopLevelWindow_Maximize 296
+#define wxTopLevelWindow_RequestUserAttention 297
+#define wxTopLevelWindow_SetIcon 298
+#define wxTopLevelWindow_SetIcons 299
+#define wxTopLevelWindow_CenterOnScreen 300
+#define wxTopLevelWindow_CentreOnScreen 301
+#define wxTopLevelWindow_SetShape 303
+#define wxTopLevelWindow_SetTitle 304
+#define wxTopLevelWindow_ShowFullScreen 305
+#define wxFrame_new_4 307
+#define wxFrame_new_0 308
+#define wxFrame_destruct 310
+#define wxFrame_Create 311
+#define wxFrame_CreateStatusBar 312
+#define wxFrame_CreateToolBar 313
+#define wxFrame_GetClientAreaOrigin 314
+#define wxFrame_GetMenuBar 315
+#define wxFrame_GetStatusBar 316
+#define wxFrame_GetStatusBarPane 317
+#define wxFrame_GetToolBar 318
+#define wxFrame_ProcessCommand 319
+#define wxFrame_SendSizeEvent 320
+#define wxFrame_SetMenuBar 321
+#define wxFrame_SetStatusBar 322
+#define wxFrame_SetStatusBarPane 323
+#define wxFrame_SetStatusText 324
+#define wxFrame_SetStatusWidths 325
+#define wxFrame_SetToolBar 326
+#define wxMiniFrame_new_0 327
+#define wxMiniFrame_new_4 328
+#define wxMiniFrame_Create 329
+#define wxMiniFrame_destroy 330
+#define wxSplashScreen_new_0 331
+#define wxSplashScreen_new_6 332
+#define wxSplashScreen_destruct 333
+#define wxSplashScreen_GetSplashStyle 334
+#define wxSplashScreen_GetTimeout 335
+#define wxPanel_new_0 336
+#define wxPanel_new_6 337
+#define wxPanel_new_2 338
+#define wxPanel_destruct 339
+#define wxPanel_InitDialog 340
+#define wxPanel_SetFocusIgnoringChildren 341
+#define wxScrolledWindow_new_0 342
+#define wxScrolledWindow_new_2 343
+#define wxScrolledWindow_destruct 344
+#define wxScrolledWindow_CalcScrolledPosition_4 345
+#define wxScrolledWindow_CalcScrolledPosition_1 346
+#define wxScrolledWindow_CalcUnscrolledPosition_4 347
+#define wxScrolledWindow_CalcUnscrolledPosition_1 348
+#define wxScrolledWindow_EnableScrolling 349
+#define wxScrolledWindow_GetScrollPixelsPerUnit 350
+#define wxScrolledWindow_GetViewStart 351
+#define wxScrolledWindow_DoPrepareDC 352
+#define wxScrolledWindow_PrepareDC 353
+#define wxScrolledWindow_Scroll 354
+#define wxScrolledWindow_SetScrollbars 355
+#define wxScrolledWindow_SetScrollRate 356
+#define wxScrolledWindow_SetTargetWindow 357
+#define wxSashWindow_new_0 358
+#define wxSashWindow_new_2 359
+#define wxSashWindow_destruct 360
+#define wxSashWindow_GetSashVisible 361
+#define wxSashWindow_GetMaximumSizeX 362
+#define wxSashWindow_GetMaximumSizeY 363
+#define wxSashWindow_GetMinimumSizeX 364
+#define wxSashWindow_GetMinimumSizeY 365
+#define wxSashWindow_SetMaximumSizeX 366
+#define wxSashWindow_SetMaximumSizeY 367
+#define wxSashWindow_SetMinimumSizeX 368
+#define wxSashWindow_SetMinimumSizeY 369
+#define wxSashWindow_SetSashVisible 370
+#define wxSashLayoutWindow_new_0 371
+#define wxSashLayoutWindow_new_2 372
+#define wxSashLayoutWindow_Create 373
+#define wxSashLayoutWindow_GetAlignment 374
+#define wxSashLayoutWindow_GetOrientation 375
+#define wxSashLayoutWindow_SetAlignment 376
+#define wxSashLayoutWindow_SetDefaultSize 377
+#define wxSashLayoutWindow_SetOrientation 378
+#define wxSashLayoutWindow_destroy 379
+#define wxGrid_new_0 380
+#define wxGrid_new_3 381
+#define wxGrid_new_4 382
+#define wxGrid_destruct 383
+#define wxGrid_AppendCols 384
+#define wxGrid_AppendRows 385
+#define wxGrid_AutoSize 386
+#define wxGrid_AutoSizeColumn 387
+#define wxGrid_AutoSizeColumns 388
+#define wxGrid_AutoSizeRow 389
+#define wxGrid_AutoSizeRows 390
+#define wxGrid_BeginBatch 391
+#define wxGrid_BlockToDeviceRect 392
+#define wxGrid_CanDragColSize 393
+#define wxGrid_CanDragRowSize 394
+#define wxGrid_CanDragGridSize 395
+#define wxGrid_CanEnableCellControl 396
+#define wxGrid_CellToRect_2 397
+#define wxGrid_CellToRect_1 398
+#define wxGrid_ClearGrid 399
+#define wxGrid_ClearSelection 400
+#define wxGrid_CreateGrid 401
+#define wxGrid_DeleteCols 402
+#define wxGrid_DeleteRows 403
+#define wxGrid_DisableCellEditControl 404
+#define wxGrid_DisableDragColSize 405
+#define wxGrid_DisableDragGridSize 406
+#define wxGrid_DisableDragRowSize 407
+#define wxGrid_EnableCellEditControl 408
+#define wxGrid_EnableDragColSize 409
+#define wxGrid_EnableDragGridSize 410
+#define wxGrid_EnableDragRowSize 411
+#define wxGrid_EnableEditing 412
+#define wxGrid_EnableGridLines 413
+#define wxGrid_EndBatch 414
+#define wxGrid_Fit 415
+#define wxGrid_ForceRefresh 416
+#define wxGrid_GetBatchCount 417
+#define wxGrid_GetCellAlignment 418
+#define wxGrid_GetCellBackgroundColour 419
+#define wxGrid_GetCellEditor 420
+#define wxGrid_GetCellFont 421
+#define wxGrid_GetCellRenderer 422
+#define wxGrid_GetCellTextColour 423
+#define wxGrid_GetCellValue_2 424
+#define wxGrid_GetCellValue_1 425
+#define wxGrid_GetColLabelAlignment 426
+#define wxGrid_GetColLabelSize 427
+#define wxGrid_GetColLabelValue 428
+#define wxGrid_GetColMinimalAcceptableWidth 429
+#define wxGrid_GetDefaultCellAlignment 430
+#define wxGrid_GetDefaultCellBackgroundColour 431
+#define wxGrid_GetDefaultCellFont 432
+#define wxGrid_GetDefaultCellTextColour 433
+#define wxGrid_GetDefaultColLabelSize 434
+#define wxGrid_GetDefaultColSize 435
+#define wxGrid_GetDefaultEditor 436
+#define wxGrid_GetDefaultEditorForCell_2 437
+#define wxGrid_GetDefaultEditorForCell_1 438
+#define wxGrid_GetDefaultEditorForType 439
+#define wxGrid_GetDefaultRenderer 440
+#define wxGrid_GetDefaultRendererForCell 441
+#define wxGrid_GetDefaultRendererForType 442
+#define wxGrid_GetDefaultRowLabelSize 443
+#define wxGrid_GetDefaultRowSize 444
+#define wxGrid_GetGridCursorCol 445
+#define wxGrid_GetGridCursorRow 446
+#define wxGrid_GetGridLineColour 447
+#define wxGrid_GridLinesEnabled 448
+#define wxGrid_GetLabelBackgroundColour 449
+#define wxGrid_GetLabelFont 450
+#define wxGrid_GetLabelTextColour 451
+#define wxGrid_GetNumberCols 452
+#define wxGrid_GetNumberRows 453
+#define wxGrid_GetOrCreateCellAttr 454
+#define wxGrid_GetRowMinimalAcceptableHeight 455
+#define wxGrid_GetRowLabelAlignment 456
+#define wxGrid_GetRowLabelSize 457
+#define wxGrid_GetRowLabelValue 458
+#define wxGrid_GetRowSize 459
+#define wxGrid_GetScrollLineX 460
+#define wxGrid_GetScrollLineY 461
+#define wxGrid_GetSelectedCells 462
+#define wxGrid_GetSelectedCols 463
+#define wxGrid_GetSelectedRows 464
+#define wxGrid_GetSelectionBackground 465
+#define wxGrid_GetSelectionBlockTopLeft 466
+#define wxGrid_GetSelectionBlockBottomRight 467
+#define wxGrid_GetSelectionForeground 468
+#define wxGrid_GetViewWidth 469
+#define wxGrid_GetGridWindow 470
+#define wxGrid_GetGridRowLabelWindow 471
+#define wxGrid_GetGridColLabelWindow 472
+#define wxGrid_GetGridCornerLabelWindow 473
+#define wxGrid_HideCellEditControl 474
+#define wxGrid_InsertCols 475
+#define wxGrid_InsertRows 476
+#define wxGrid_IsCellEditControlEnabled 477
+#define wxGrid_IsCurrentCellReadOnly 478
+#define wxGrid_IsEditable 479
+#define wxGrid_IsInSelection_2 480
+#define wxGrid_IsInSelection_1 481
+#define wxGrid_IsReadOnly 482
+#define wxGrid_IsSelection 483
+#define wxGrid_IsVisible_3 484
+#define wxGrid_IsVisible_2 485
+#define wxGrid_MakeCellVisible_2 486
+#define wxGrid_MakeCellVisible_1 487
+#define wxGrid_MoveCursorDown 488
+#define wxGrid_MoveCursorLeft 489
+#define wxGrid_MoveCursorRight 490
+#define wxGrid_MoveCursorUp 491
+#define wxGrid_MoveCursorDownBlock 492
+#define wxGrid_MoveCursorLeftBlock 493
+#define wxGrid_MoveCursorRightBlock 494
+#define wxGrid_MoveCursorUpBlock 495
+#define wxGrid_MovePageDown 496
+#define wxGrid_MovePageUp 497
+#define wxGrid_RegisterDataType 498
+#define wxGrid_SaveEditControlValue 499
+#define wxGrid_SelectAll 500
+#define wxGrid_SelectBlock_5 501
+#define wxGrid_SelectBlock_3 502
+#define wxGrid_SelectCol 503
+#define wxGrid_SelectRow 504
+#define wxGrid_SetCellAlignment_4 505
+#define wxGrid_SetCellAlignment_3 506
+#define wxGrid_SetCellAlignment_1 507
+#define wxGrid_SetCellBackgroundColour_3_0 508
+#define wxGrid_SetCellBackgroundColour_1 509
+#define wxGrid_SetCellBackgroundColour_3_1 510
+#define wxGrid_SetCellEditor 511
+#define wxGrid_SetCellFont 512
+#define wxGrid_SetCellRenderer 513
+#define wxGrid_SetCellTextColour_3_0 514
+#define wxGrid_SetCellTextColour_3_1 515
+#define wxGrid_SetCellTextColour_1 516
+#define wxGrid_SetCellValue_3_0 517
+#define wxGrid_SetCellValue_2 518
+#define wxGrid_SetCellValue_3_1 519
+#define wxGrid_SetColAttr 520
+#define wxGrid_SetColFormatBool 521
+#define wxGrid_SetColFormatNumber 522
+#define wxGrid_SetColFormatFloat 523
+#define wxGrid_SetColFormatCustom 524
+#define wxGrid_SetColLabelAlignment 525
+#define wxGrid_SetColLabelSize 526
+#define wxGrid_SetColLabelValue 527
+#define wxGrid_SetColMinimalWidth 528
+#define wxGrid_SetColMinimalAcceptableWidth 529
+#define wxGrid_SetColSize 530
+#define wxGrid_SetDefaultCellAlignment 531
+#define wxGrid_SetDefaultCellBackgroundColour 532
+#define wxGrid_SetDefaultCellFont 533
+#define wxGrid_SetDefaultCellTextColour 534
+#define wxGrid_SetDefaultEditor 535
+#define wxGrid_SetDefaultRenderer 536
+#define wxGrid_SetDefaultColSize 537
+#define wxGrid_SetDefaultRowSize 538
+#define wxGrid_SetGridCursor 539
+#define wxGrid_SetGridLineColour 540
+#define wxGrid_SetLabelBackgroundColour 541
+#define wxGrid_SetLabelFont 542
+#define wxGrid_SetLabelTextColour 543
+#define wxGrid_SetMargins 544
+#define wxGrid_SetReadOnly 545
+#define wxGrid_SetRowAttr 546
+#define wxGrid_SetRowLabelAlignment 547
+#define wxGrid_SetRowLabelSize 548
+#define wxGrid_SetRowLabelValue 549
+#define wxGrid_SetRowMinimalHeight 550
+#define wxGrid_SetRowMinimalAcceptableHeight 551
+#define wxGrid_SetRowSize 552
+#define wxGrid_SetScrollLineX 553
+#define wxGrid_SetScrollLineY 554
+#define wxGrid_SetSelectionBackground 555
+#define wxGrid_SetSelectionForeground 556
+#define wxGrid_SetSelectionMode 557
+#define wxGrid_ShowCellEditControl 558
+#define wxGrid_XToCol 559
+#define wxGrid_XToEdgeOfCol 560
+#define wxGrid_YToEdgeOfRow 561
+#define wxGrid_YToRow 562
+#define wxGridCellRenderer_Draw 563
+#define wxGridCellRenderer_GetBestSize 564
+#define wxGridCellEditor_Create 565
+#define wxGridCellEditor_IsCreated 566
+#define wxGridCellEditor_SetSize 567
+#define wxGridCellEditor_Show 568
+#define wxGridCellEditor_PaintBackground 569
+#define wxGridCellEditor_BeginEdit 570
+#define wxGridCellEditor_EndEdit 571
+#define wxGridCellEditor_Reset 572
+#define wxGridCellEditor_StartingKey 573
+#define wxGridCellEditor_StartingClick 574
+#define wxGridCellEditor_HandleReturn 575
+#define wxGridCellBoolRenderer_new 576
+#define wxGridCellBoolRenderer_destroy 577
+#define wxGridCellBoolEditor_new 578
+#define wxGridCellBoolEditor_IsTrueValue 579
+#define wxGridCellBoolEditor_UseStringValues 580
+#define wxGridCellBoolEditor_destroy 581
+#define wxGridCellFloatRenderer_new 582
+#define wxGridCellFloatRenderer_GetPrecision 583
+#define wxGridCellFloatRenderer_GetWidth 584
+#define wxGridCellFloatRenderer_SetParameters 585
+#define wxGridCellFloatRenderer_SetPrecision 586
+#define wxGridCellFloatRenderer_SetWidth 587
+#define wxGridCellFloatRenderer_destroy 588
+#define wxGridCellFloatEditor_new 589
+#define wxGridCellFloatEditor_SetParameters 590
+#define wxGridCellFloatEditor_destroy 591
+#define wxGridCellStringRenderer_new 592
+#define wxGridCellStringRenderer_destroy 593
+#define wxGridCellTextEditor_new 594
+#define wxGridCellTextEditor_SetParameters 595
+#define wxGridCellTextEditor_destroy 596
+#define wxGridCellChoiceEditor_new 598
+#define wxGridCellChoiceEditor_SetParameters 599
+#define wxGridCellChoiceEditor_destroy 600
+#define wxGridCellNumberRenderer_new 601
+#define wxGridCellNumberRenderer_destroy 602
+#define wxGridCellNumberEditor_new 603
+#define wxGridCellNumberEditor_GetValue 604
+#define wxGridCellNumberEditor_SetParameters 605
+#define wxGridCellNumberEditor_destroy 606
+#define wxGridCellAttr_SetTextColour 607
+#define wxGridCellAttr_SetBackgroundColour 608
+#define wxGridCellAttr_SetFont 609
+#define wxGridCellAttr_SetAlignment 610
+#define wxGridCellAttr_SetReadOnly 611
+#define wxGridCellAttr_SetRenderer 612
+#define wxGridCellAttr_SetEditor 613
+#define wxGridCellAttr_HasTextColour 614
+#define wxGridCellAttr_HasBackgroundColour 615
+#define wxGridCellAttr_HasFont 616
+#define wxGridCellAttr_HasAlignment 617
+#define wxGridCellAttr_HasRenderer 618
+#define wxGridCellAttr_HasEditor 619
+#define wxGridCellAttr_GetTextColour 620
+#define wxGridCellAttr_GetBackgroundColour 621
+#define wxGridCellAttr_GetFont 622
+#define wxGridCellAttr_GetAlignment 623
+#define wxGridCellAttr_GetRenderer 624
+#define wxGridCellAttr_GetEditor 625
+#define wxGridCellAttr_IsReadOnly 626
+#define wxGridCellAttr_SetDefAttr 627
+#define wxDC_Blit 628
+#define wxDC_CalcBoundingBox 629
+#define wxDC_Clear 630
+#define wxDC_ComputeScaleAndOrigin 631
+#define wxDC_CrossHair 632
+#define wxDC_DestroyClippingRegion 633
+#define wxDC_DeviceToLogicalX 634
+#define wxDC_DeviceToLogicalXRel 635
+#define wxDC_DeviceToLogicalY 636
+#define wxDC_DeviceToLogicalYRel 637
+#define wxDC_DrawArc 638
+#define wxDC_DrawBitmap 639
+#define wxDC_DrawCheckMark 640
+#define wxDC_DrawCircle 641
+#define wxDC_DrawEllipse_2 643
+#define wxDC_DrawEllipse_1 644
+#define wxDC_DrawEllipticArc 645
+#define wxDC_DrawIcon 646
+#define wxDC_DrawLabel 647
+#define wxDC_DrawLine 648
+#define wxDC_DrawLines 649
+#define wxDC_DrawPolygon 651
+#define wxDC_DrawPoint 653
+#define wxDC_DrawRectangle_2 655
+#define wxDC_DrawRectangle_1 656
+#define wxDC_DrawRotatedText 657
+#define wxDC_DrawRoundedRectangle_3 659
+#define wxDC_DrawRoundedRectangle_2 660
+#define wxDC_DrawText 661
+#define wxDC_EndDoc 662
+#define wxDC_EndPage 663
+#define wxDC_FloodFill 664
+#define wxDC_GetBackground 665
+#define wxDC_GetBackgroundMode 666
+#define wxDC_GetBrush 667
+#define wxDC_GetCharHeight 668
+#define wxDC_GetCharWidth 669
+#define wxDC_GetClippingBox 670
+#define wxDC_GetFont 672
+#define wxDC_GetLayoutDirection 673
+#define wxDC_GetLogicalFunction 674
+#define wxDC_GetMapMode 675
+#define wxDC_GetMultiLineTextExtent_4 676
+#define wxDC_GetMultiLineTextExtent_1 677
+#define wxDC_GetPartialTextExtents 678
+#define wxDC_GetPen 679
+#define wxDC_GetPixel 680
+#define wxDC_GetPPI 681
+#define wxDC_GetSize 683
+#define wxDC_GetSizeMM 685
+#define wxDC_GetTextBackground 686
+#define wxDC_GetTextExtent_4 687
+#define wxDC_GetTextExtent_1 688
+#define wxDC_GetTextForeground 690
+#define wxDC_GetUserScale 691
+#define wxDC_GradientFillConcentric_3 692
+#define wxDC_GradientFillConcentric_4 693
+#define wxDC_GradientFillLinear 694
+#define wxDC_LogicalToDeviceX 695
+#define wxDC_LogicalToDeviceXRel 696
+#define wxDC_LogicalToDeviceY 697
+#define wxDC_LogicalToDeviceYRel 698
+#define wxDC_MaxX 699
+#define wxDC_MaxY 700
+#define wxDC_MinX 701
+#define wxDC_MinY 702
+#define wxDC_IsOk 703
+#define wxDC_ResetBoundingBox 704
+#define wxDC_SetAxisOrientation 705
+#define wxDC_SetBackground 706
+#define wxDC_SetBackgroundMode 707
+#define wxDC_SetBrush 708
+#define wxDC_SetClippingRegion_2 710
+#define wxDC_SetClippingRegion_1_1 711
+#define wxDC_SetClippingRegion_1_0 712
+#define wxDC_SetDeviceOrigin 713
+#define wxDC_SetFont 714
+#define wxDC_SetLayoutDirection 715
+#define wxDC_SetLogicalFunction 716
+#define wxDC_SetMapMode 717
+#define wxDC_SetPalette 718
+#define wxDC_SetPen 719
+#define wxDC_SetTextBackground 720
+#define wxDC_SetTextForeground 721
+#define wxDC_SetUserScale 722
+#define wxDC_StartDoc 723
+#define wxDC_StartPage 724
+#define wxMirrorDC_new 725
+#define wxMirrorDC_destroy 726
+#define wxScreenDC_new 727
+#define wxScreenDC_destruct 728
+#define wxPostScriptDC_new_0 729
+#define wxPostScriptDC_new_1 730
+#define wxPostScriptDC_destruct 731
+#define wxPostScriptDC_SetResolution 732
+#define wxPostScriptDC_GetResolution 733
+#define wxWindowDC_new_0 734
+#define wxWindowDC_new_1 735
+#define wxWindowDC_destruct 736
+#define wxClientDC_new_0 737
+#define wxClientDC_new_1 738
+#define wxClientDC_destroy 739
+#define wxPaintDC_new_0 740
+#define wxPaintDC_new_1 741
+#define wxPaintDC_destroy 742
+#define wxMemoryDC_new_1_0 744
+#define wxMemoryDC_new_1_1 745
+#define wxMemoryDC_new_0 746
+#define wxMemoryDC_destruct 748
+#define wxMemoryDC_SelectObject 749
+#define wxMemoryDC_SelectObjectAsSource 750
+#define wxBufferedDC_new_0 751
+#define wxBufferedDC_new_2 752
+#define wxBufferedDC_new_3 753
+#define wxBufferedDC_destruct 754
+#define wxBufferedDC_Init_2 755
+#define wxBufferedDC_Init_3 756
+#define wxBufferedPaintDC_new_3 757
+#define wxBufferedPaintDC_new_2 758
+#define wxBufferedPaintDC_destruct 759
+#define wxGraphicsObject_destruct 760
+#define wxGraphicsObject_GetRenderer 761
+#define wxGraphicsObject_IsNull 762
+#define wxGraphicsContext_destruct 763
+#define wxGraphicsContext_Create_1_1 764
+#define wxGraphicsContext_Create_1_0 765
+#define wxGraphicsContext_Create_0 766
+#define wxGraphicsContext_CreatePen 767
+#define wxGraphicsContext_CreateBrush 768
+#define wxGraphicsContext_CreateRadialGradientBrush 769
+#define wxGraphicsContext_CreateLinearGradientBrush 770
+#define wxGraphicsContext_CreateFont 771
+#define wxGraphicsContext_CreateMatrix 772
+#define wxGraphicsContext_CreatePath 773
+#define wxGraphicsContext_Clip_1 774
+#define wxGraphicsContext_Clip_4 775
+#define wxGraphicsContext_ResetClip 776
+#define wxGraphicsContext_DrawBitmap 777
+#define wxGraphicsContext_DrawEllipse 778
+#define wxGraphicsContext_DrawIcon 779
+#define wxGraphicsContext_DrawLines 780
+#define wxGraphicsContext_DrawPath 781
+#define wxGraphicsContext_DrawRectangle 782
+#define wxGraphicsContext_DrawRoundedRectangle 783
+#define wxGraphicsContext_DrawText_3 784
+#define wxGraphicsContext_DrawText_4_0 785
+#define wxGraphicsContext_DrawText_4_1 786
+#define wxGraphicsContext_DrawText_5 787
+#define wxGraphicsContext_FillPath 788
+#define wxGraphicsContext_StrokePath 789
+#define wxGraphicsContext_GetPartialTextExtents 790
+#define wxGraphicsContext_GetTextExtent 791
+#define wxGraphicsContext_Rotate 792
+#define wxGraphicsContext_Scale 793
+#define wxGraphicsContext_Translate 794
+#define wxGraphicsContext_GetTransform 795
+#define wxGraphicsContext_SetTransform 796
+#define wxGraphicsContext_ConcatTransform 797
+#define wxGraphicsContext_SetBrush_1_1 798
+#define wxGraphicsContext_SetBrush_1_0 799
+#define wxGraphicsContext_SetFont_1 800
+#define wxGraphicsContext_SetFont_2 801
+#define wxGraphicsContext_SetPen_1_0 802
+#define wxGraphicsContext_SetPen_1_1 803
+#define wxGraphicsContext_StrokeLine 804
+#define wxGraphicsContext_StrokeLines 805
+#define wxGraphicsMatrix_Concat 807
+#define wxGraphicsMatrix_Get 809
+#define wxGraphicsMatrix_Invert 810
+#define wxGraphicsMatrix_IsEqual 811
+#define wxGraphicsMatrix_IsIdentity 813
+#define wxGraphicsMatrix_Rotate 814
+#define wxGraphicsMatrix_Scale 815
+#define wxGraphicsMatrix_Translate 816
+#define wxGraphicsMatrix_Set 817
+#define wxGraphicsMatrix_TransformPoint 818
+#define wxGraphicsMatrix_TransformDistance 819
+#define wxGraphicsPath_MoveToPoint_2 820
+#define wxGraphicsPath_MoveToPoint_1 821
+#define wxGraphicsPath_AddArc_6 822
+#define wxGraphicsPath_AddArc_5 823
+#define wxGraphicsPath_AddArcToPoint 824
+#define wxGraphicsPath_AddCircle 825
+#define wxGraphicsPath_AddCurveToPoint_6 826
+#define wxGraphicsPath_AddCurveToPoint_3 827
+#define wxGraphicsPath_AddEllipse 828
+#define wxGraphicsPath_AddLineToPoint_2 829
+#define wxGraphicsPath_AddLineToPoint_1 830
+#define wxGraphicsPath_AddPath 831
+#define wxGraphicsPath_AddQuadCurveToPoint 832
+#define wxGraphicsPath_AddRectangle 833
+#define wxGraphicsPath_AddRoundedRectangle 834
+#define wxGraphicsPath_CloseSubpath 835
+#define wxGraphicsPath_Contains_3 836
+#define wxGraphicsPath_Contains_2 837
+#define wxGraphicsPath_GetBox 839
+#define wxGraphicsPath_GetCurrentPoint 841
+#define wxGraphicsPath_Transform 842
+#define wxGraphicsRenderer_GetDefaultRenderer 843
+#define wxGraphicsRenderer_CreateContext_1_1 844
+#define wxGraphicsRenderer_CreateContext_1_0 845
+#define wxGraphicsRenderer_CreatePen 846
+#define wxGraphicsRenderer_CreateBrush 847
+#define wxGraphicsRenderer_CreateLinearGradientBrush 848
+#define wxGraphicsRenderer_CreateRadialGradientBrush 849
+#define wxGraphicsRenderer_CreateFont 850
+#define wxGraphicsRenderer_CreateMatrix 851
+#define wxGraphicsRenderer_CreatePath 852
+#define wxMenuBar_new_1 854
+#define wxMenuBar_new_0 856
+#define wxMenuBar_destruct 858
+#define wxMenuBar_Append 859
+#define wxMenuBar_Check 860
+#define wxMenuBar_Enable_2 861
+#define wxMenuBar_Enable_1 862
+#define wxMenuBar_EnableTop 863
+#define wxMenuBar_FindMenu 864
+#define wxMenuBar_FindMenuItem 865
+#define wxMenuBar_FindItem 866
+#define wxMenuBar_GetHelpString 867
+#define wxMenuBar_GetLabel_1 868
+#define wxMenuBar_GetLabel_0 869
+#define wxMenuBar_GetLabelTop 870
+#define wxMenuBar_GetMenu 871
+#define wxMenuBar_GetMenuCount 872
+#define wxMenuBar_Insert 873
+#define wxMenuBar_IsChecked 874
+#define wxMenuBar_IsEnabled_1 875
+#define wxMenuBar_IsEnabled_0 876
+#define wxMenuBar_Remove 877
+#define wxMenuBar_Replace 878
+#define wxMenuBar_SetHelpString 879
+#define wxMenuBar_SetLabel_2 880
+#define wxMenuBar_SetLabel_1 881
+#define wxMenuBar_SetLabelTop 882
+#define wxControl_GetLabel 883
+#define wxControl_SetLabel 884
+#define wxControlWithItems_Append_1 885
+#define wxControlWithItems_Append_2 886
+#define wxControlWithItems_appendStrings_1 887
+#define wxControlWithItems_Clear 888
+#define wxControlWithItems_Delete 889
+#define wxControlWithItems_FindString 890
+#define wxControlWithItems_getClientData 891
+#define wxControlWithItems_setClientData 892
+#define wxControlWithItems_GetCount 893
+#define wxControlWithItems_GetSelection 894
+#define wxControlWithItems_GetString 895
+#define wxControlWithItems_GetStringSelection 896
+#define wxControlWithItems_Insert_2 897
+#define wxControlWithItems_Insert_3 898
+#define wxControlWithItems_IsEmpty 899
+#define wxControlWithItems_Select 900
+#define wxControlWithItems_SetSelection 901
+#define wxControlWithItems_SetString 902
+#define wxControlWithItems_SetStringSelection 903
+#define wxMenu_new_2 906
+#define wxMenu_new_1 907
+#define wxMenu_destruct 909
+#define wxMenu_Append_3 910
+#define wxMenu_Append_1 911
+#define wxMenu_Append_4_0 912
+#define wxMenu_Append_4_1 913
+#define wxMenu_AppendCheckItem 914
+#define wxMenu_AppendRadioItem 915
+#define wxMenu_AppendSeparator 916
+#define wxMenu_Break 917
+#define wxMenu_Check 918
+#define wxMenu_Delete_1_0 919
+#define wxMenu_Delete_1_1 920
+#define wxMenu_Destroy_1_0 921
+#define wxMenu_Destroy_1_1 922
+#define wxMenu_Enable 923
+#define wxMenu_FindItem_1 924
+#define wxMenu_FindItem_2 925
+#define wxMenu_FindItemByPosition 926
+#define wxMenu_GetHelpString 927
+#define wxMenu_GetLabel 928
+#define wxMenu_GetMenuItemCount 929
+#define wxMenu_GetMenuItems 930
+#define wxMenu_GetTitle 932
+#define wxMenu_Insert_2 933
+#define wxMenu_Insert_3 934
+#define wxMenu_Insert_5_1 935
+#define wxMenu_Insert_5_0 936
+#define wxMenu_InsertCheckItem 937
+#define wxMenu_InsertRadioItem 938
+#define wxMenu_InsertSeparator 939
+#define wxMenu_IsChecked 940
+#define wxMenu_IsEnabled 941
+#define wxMenu_Prepend_1 942
+#define wxMenu_Prepend_2 943
+#define wxMenu_Prepend_4_1 944
+#define wxMenu_Prepend_4_0 945
+#define wxMenu_PrependCheckItem 946
+#define wxMenu_PrependRadioItem 947
+#define wxMenu_PrependSeparator 948
+#define wxMenu_Remove_1_0 949
+#define wxMenu_Remove_1_1 950
+#define wxMenu_SetHelpString 951
+#define wxMenu_SetLabel 952
+#define wxMenu_SetTitle 953
+#define wxMenuItem_new 954
+#define wxMenuItem_destruct 956
+#define wxMenuItem_Check 957
+#define wxMenuItem_Enable 958
+#define wxMenuItem_GetBitmap 959
+#define wxMenuItem_GetHelp 960
+#define wxMenuItem_GetId 961
+#define wxMenuItem_GetKind 962
+#define wxMenuItem_GetLabel 963
+#define wxMenuItem_GetLabelFromText 964
+#define wxMenuItem_GetMenu 965
+#define wxMenuItem_GetText 966
+#define wxMenuItem_GetSubMenu 967
+#define wxMenuItem_IsCheckable 968
+#define wxMenuItem_IsChecked 969
+#define wxMenuItem_IsEnabled 970
+#define wxMenuItem_IsSeparator 971
+#define wxMenuItem_IsSubMenu 972
+#define wxMenuItem_SetBitmap 973
+#define wxMenuItem_SetHelp 974
+#define wxMenuItem_SetMenu 975
+#define wxMenuItem_SetSubMenu 976
+#define wxMenuItem_SetText 977
+#define wxToolBar_AddControl 978
+#define wxToolBar_AddSeparator 979
+#define wxToolBar_AddTool_5 980
+#define wxToolBar_AddTool_4_0 981
+#define wxToolBar_AddTool_1 982
+#define wxToolBar_AddTool_4_1 983
+#define wxToolBar_AddTool_3 984
+#define wxToolBar_AddTool_6 985
+#define wxToolBar_AddCheckTool 986
+#define wxToolBar_AddRadioTool 987
+#define wxToolBar_AddStretchableSpace 988
+#define wxToolBar_InsertStretchableSpace 989
+#define wxToolBar_DeleteTool 990
+#define wxToolBar_DeleteToolByPos 991
+#define wxToolBar_EnableTool 992
+#define wxToolBar_FindById 993
+#define wxToolBar_FindControl 994
+#define wxToolBar_FindToolForPosition 995
+#define wxToolBar_GetToolSize 996
+#define wxToolBar_GetToolBitmapSize 997
+#define wxToolBar_GetMargins 998
+#define wxToolBar_GetToolEnabled 999
+#define wxToolBar_GetToolLongHelp 1000
+#define wxToolBar_GetToolPacking 1001
+#define wxToolBar_GetToolPos 1002
+#define wxToolBar_GetToolSeparation 1003
+#define wxToolBar_GetToolShortHelp 1004
+#define wxToolBar_GetToolState 1005
+#define wxToolBar_InsertControl 1006
+#define wxToolBar_InsertSeparator 1007
+#define wxToolBar_InsertTool_5 1008
+#define wxToolBar_InsertTool_2 1009
+#define wxToolBar_InsertTool_4 1010
+#define wxToolBar_Realize 1011
+#define wxToolBar_RemoveTool 1012
+#define wxToolBar_SetMargins 1013
+#define wxToolBar_SetToolBitmapSize 1014
+#define wxToolBar_SetToolLongHelp 1015
+#define wxToolBar_SetToolPacking 1016
+#define wxToolBar_SetToolShortHelp 1017
+#define wxToolBar_SetToolSeparation 1018
+#define wxToolBar_ToggleTool 1019
+#define wxStatusBar_new_0 1021
+#define wxStatusBar_new_2 1022
+#define wxStatusBar_destruct 1024
+#define wxStatusBar_Create 1025
+#define wxStatusBar_GetFieldRect 1026
+#define wxStatusBar_GetFieldsCount 1027
+#define wxStatusBar_GetStatusText 1028
+#define wxStatusBar_PopStatusText 1029
+#define wxStatusBar_PushStatusText 1030
+#define wxStatusBar_SetFieldsCount 1031
+#define wxStatusBar_SetMinHeight 1032
+#define wxStatusBar_SetStatusText 1033
+#define wxStatusBar_SetStatusWidths 1034
+#define wxStatusBar_SetStatusStyles 1035
+#define wxBitmap_new_0 1036
+#define wxBitmap_new_3 1037
+#define wxBitmap_new_4 1038
+#define wxBitmap_new_2_0 1039
+#define wxBitmap_new_2_1 1040
+#define wxBitmap_destruct 1041
+#define wxBitmap_ConvertToImage 1042
+#define wxBitmap_CopyFromIcon 1043
+#define wxBitmap_Create 1044
+#define wxBitmap_GetDepth 1045
+#define wxBitmap_GetHeight 1046
+#define wxBitmap_GetPalette 1047
+#define wxBitmap_GetMask 1048
+#define wxBitmap_GetWidth 1049
+#define wxBitmap_GetSubBitmap 1050
+#define wxBitmap_LoadFile 1051
+#define wxBitmap_Ok 1052
+#define wxBitmap_SaveFile 1053
+#define wxBitmap_SetDepth 1054
+#define wxBitmap_SetHeight 1055
+#define wxBitmap_SetMask 1056
+#define wxBitmap_SetPalette 1057
+#define wxBitmap_SetWidth 1058
+#define wxIcon_new_0 1059
+#define wxIcon_new_2 1060
+#define wxIcon_new_1 1061
+#define wxIcon_CopyFromBitmap 1062
+#define wxIcon_destroy 1063
+#define wxIconBundle_new_0 1064
+#define wxIconBundle_new_2 1065
+#define wxIconBundle_new_1_0 1066
+#define wxIconBundle_new_1_1 1067
+#define wxIconBundle_destruct 1068
+#define wxIconBundle_AddIcon_2 1069
+#define wxIconBundle_AddIcon_1 1070
+#define wxIconBundle_GetIcon_1_1 1071
+#define wxIconBundle_GetIcon_1_0 1072
+#define wxCursor_new_0 1073
+#define wxCursor_new_1_0 1074
+#define wxCursor_new_1_1 1075
+#define wxCursor_new_4 1076
+#define wxCursor_destruct 1077
+#define wxCursor_Ok 1078
+#define wxMask_new_0 1079
+#define wxMask_new_2_1 1080
+#define wxMask_new_2_0 1081
+#define wxMask_new_1 1082
+#define wxMask_destruct 1083
+#define wxMask_Create_2_1 1084
+#define wxMask_Create_2_0 1085
+#define wxMask_Create_1 1086
+#define wxImage_new_0 1087
+#define wxImage_new_3_0 1088
+#define wxImage_new_4 1089
+#define wxImage_new_5 1090
+#define wxImage_new_2 1091
+#define wxImage_new_3_1 1092
+#define wxImage_Blur 1093
+#define wxImage_BlurHorizontal 1094
+#define wxImage_BlurVertical 1095
+#define wxImage_ConvertAlphaToMask 1096
+#define wxImage_ConvertToGreyscale 1097
+#define wxImage_ConvertToMono 1098
+#define wxImage_Copy 1099
+#define wxImage_Create_3 1100
+#define wxImage_Create_4 1101
+#define wxImage_Create_5 1102
+#define wxImage_Destroy 1103
+#define wxImage_FindFirstUnusedColour 1104
+#define wxImage_GetImageExtWildcard 1105
+#define wxImage_GetAlpha_2 1106
+#define wxImage_GetAlpha_0 1107
+#define wxImage_GetBlue 1108
+#define wxImage_GetData 1109
+#define wxImage_GetGreen 1110
+#define wxImage_GetImageCount 1111
+#define wxImage_GetHeight 1112
+#define wxImage_GetMaskBlue 1113
+#define wxImage_GetMaskGreen 1114
+#define wxImage_GetMaskRed 1115
+#define wxImage_GetOrFindMaskColour 1116
+#define wxImage_GetPalette 1117
+#define wxImage_GetRed 1118
+#define wxImage_GetSubImage 1119
+#define wxImage_GetWidth 1120
+#define wxImage_HasAlpha 1121
+#define wxImage_HasMask 1122
+#define wxImage_GetOption 1123
+#define wxImage_GetOptionInt 1124
+#define wxImage_HasOption 1125
+#define wxImage_InitAlpha 1126
+#define wxImage_InitStandardHandlers 1127
+#define wxImage_IsTransparent 1128
+#define wxImage_LoadFile_2 1129
+#define wxImage_LoadFile_3 1130
+#define wxImage_Ok 1131
+#define wxImage_RemoveHandler 1132
+#define wxImage_Mirror 1133
+#define wxImage_Replace 1134
+#define wxImage_Rescale 1135
+#define wxImage_Resize 1136
+#define wxImage_Rotate 1137
+#define wxImage_RotateHue 1138
+#define wxImage_Rotate90 1139
+#define wxImage_SaveFile_1 1140
+#define wxImage_SaveFile_2_0 1141
+#define wxImage_SaveFile_2_1 1142
+#define wxImage_Scale 1143
+#define wxImage_Size 1144
+#define wxImage_SetAlpha_3 1145
+#define wxImage_SetAlpha_2 1146
+#define wxImage_SetData_2 1147
+#define wxImage_SetData_4 1148
+#define wxImage_SetMask 1149
+#define wxImage_SetMaskColour 1150
+#define wxImage_SetMaskFromImage 1151
+#define wxImage_SetOption_2_1 1152
+#define wxImage_SetOption_2_0 1153
+#define wxImage_SetPalette 1154
+#define wxImage_SetRGB_5 1155
+#define wxImage_SetRGB_4 1156
+#define wxImage_destroy 1157
+#define wxBrush_new_0 1158
+#define wxBrush_new_2 1159
+#define wxBrush_new_1 1160
+#define wxBrush_destruct 1162
+#define wxBrush_GetColour 1163
+#define wxBrush_GetStipple 1164
+#define wxBrush_GetStyle 1165
+#define wxBrush_IsHatch 1166
+#define wxBrush_IsOk 1167
+#define wxBrush_SetColour_1 1168
+#define wxBrush_SetColour_3 1169
+#define wxBrush_SetStipple 1170
+#define wxBrush_SetStyle 1171
+#define wxPen_new_0 1172
+#define wxPen_new_2 1173
+#define wxPen_destruct 1174
+#define wxPen_GetCap 1175
+#define wxPen_GetColour 1176
+#define wxPen_GetJoin 1177
+#define wxPen_GetStyle 1178
+#define wxPen_GetWidth 1179
+#define wxPen_IsOk 1180
+#define wxPen_SetCap 1181
+#define wxPen_SetColour_1 1182
+#define wxPen_SetColour_3 1183
+#define wxPen_SetJoin 1184
+#define wxPen_SetStyle 1185
+#define wxPen_SetWidth 1186
+#define wxRegion_new_0 1187
+#define wxRegion_new_4 1188
+#define wxRegion_new_2 1189
+#define wxRegion_new_1_1 1190
+#define wxRegion_new_1_0 1192
+#define wxRegion_destruct 1194
+#define wxRegion_Clear 1195
+#define wxRegion_Contains_2 1196
+#define wxRegion_Contains_1_0 1197
+#define wxRegion_Contains_4 1198
+#define wxRegion_Contains_1_1 1199
+#define wxRegion_ConvertToBitmap 1200
+#define wxRegion_GetBox 1201
+#define wxRegion_Intersect_4 1202
+#define wxRegion_Intersect_1_1 1203
+#define wxRegion_Intersect_1_0 1204
+#define wxRegion_IsEmpty 1205
+#define wxRegion_Subtract_4 1206
+#define wxRegion_Subtract_1_1 1207
+#define wxRegion_Subtract_1_0 1208
+#define wxRegion_Offset_2 1209
+#define wxRegion_Offset_1 1210
+#define wxRegion_Union_4 1211
+#define wxRegion_Union_1_2 1212
+#define wxRegion_Union_1_1 1213
+#define wxRegion_Union_1_0 1214
+#define wxRegion_Union_3 1215
+#define wxRegion_Xor_4 1216
+#define wxRegion_Xor_1_1 1217
+#define wxRegion_Xor_1_0 1218
+#define wxAcceleratorTable_new_0 1219
+#define wxAcceleratorTable_new_2 1220
+#define wxAcceleratorTable_destruct 1221
+#define wxAcceleratorTable_Ok 1222
+#define wxAcceleratorEntry_new_1_0 1223
+#define wxAcceleratorEntry_new_1_1 1224
+#define wxAcceleratorEntry_GetCommand 1225
+#define wxAcceleratorEntry_GetFlags 1226
+#define wxAcceleratorEntry_GetKeyCode 1227
+#define wxAcceleratorEntry_Set 1228
+#define wxAcceleratorEntry_destroy 1229
+#define wxCaret_new_3 1234
+#define wxCaret_new_2 1235
+#define wxCaret_destruct 1237
+#define wxCaret_Create_3 1238
+#define wxCaret_Create_2 1239
+#define wxCaret_GetBlinkTime 1240
+#define wxCaret_GetPosition 1242
+#define wxCaret_GetSize 1244
+#define wxCaret_GetWindow 1245
+#define wxCaret_Hide 1246
+#define wxCaret_IsOk 1247
+#define wxCaret_IsVisible 1248
+#define wxCaret_Move_2 1249
+#define wxCaret_Move_1 1250
+#define wxCaret_SetBlinkTime 1251
+#define wxCaret_SetSize_2 1252
+#define wxCaret_SetSize_1 1253
+#define wxCaret_Show 1254
+#define wxSizer_Add_2_1 1255
+#define wxSizer_Add_2_0 1256
+#define wxSizer_Add_3 1257
+#define wxSizer_Add_2_3 1258
+#define wxSizer_Add_2_2 1259
+#define wxSizer_AddSpacer 1260
+#define wxSizer_AddStretchSpacer 1261
+#define wxSizer_CalcMin 1262
+#define wxSizer_Clear 1263
+#define wxSizer_Detach_1_2 1264
+#define wxSizer_Detach_1_1 1265
+#define wxSizer_Detach_1_0 1266
+#define wxSizer_Fit 1267
+#define wxSizer_FitInside 1268
+#define wxSizer_GetChildren 1269
+#define wxSizer_GetItem_2_1 1270
+#define wxSizer_GetItem_2_0 1271
+#define wxSizer_GetItem_1 1272
+#define wxSizer_GetSize 1273
+#define wxSizer_GetPosition 1274
+#define wxSizer_GetMinSize 1275
+#define wxSizer_Hide_2_0 1276
+#define wxSizer_Hide_2_1 1277
+#define wxSizer_Hide_1 1278
+#define wxSizer_Insert_3_1 1279
+#define wxSizer_Insert_3_0 1280
+#define wxSizer_Insert_4 1281
+#define wxSizer_Insert_3_3 1282
+#define wxSizer_Insert_3_2 1283
+#define wxSizer_Insert_2 1284
+#define wxSizer_InsertSpacer 1285
+#define wxSizer_InsertStretchSpacer 1286
+#define wxSizer_IsShown_1_2 1287
+#define wxSizer_IsShown_1_1 1288
+#define wxSizer_IsShown_1_0 1289
+#define wxSizer_Layout 1290
+#define wxSizer_Prepend_2_1 1291
+#define wxSizer_Prepend_2_0 1292
+#define wxSizer_Prepend_3 1293
+#define wxSizer_Prepend_2_3 1294
+#define wxSizer_Prepend_2_2 1295
+#define wxSizer_Prepend_1 1296
+#define wxSizer_PrependSpacer 1297
+#define wxSizer_PrependStretchSpacer 1298
+#define wxSizer_RecalcSizes 1299
+#define wxSizer_Remove_1_1 1300
+#define wxSizer_Remove_1_0 1301
+#define wxSizer_Replace_3_1 1302
+#define wxSizer_Replace_3_0 1303
+#define wxSizer_Replace_2 1304
+#define wxSizer_SetDimension 1305
+#define wxSizer_SetMinSize_2 1306
+#define wxSizer_SetMinSize_1 1307
+#define wxSizer_SetItemMinSize_3_2 1308
+#define wxSizer_SetItemMinSize_2_2 1309
+#define wxSizer_SetItemMinSize_3_1 1310
+#define wxSizer_SetItemMinSize_2_1 1311
+#define wxSizer_SetItemMinSize_3_0 1312
+#define wxSizer_SetItemMinSize_2_0 1313
+#define wxSizer_SetSizeHints 1314
+#define wxSizer_SetVirtualSizeHints 1315
+#define wxSizer_Show_2_2 1316
+#define wxSizer_Show_2_1 1317
+#define wxSizer_Show_2_0 1318
+#define wxSizer_Show_1 1319
+#define wxSizerFlags_new 1320
+#define wxSizerFlags_Align 1321
+#define wxSizerFlags_Border_2 1322
+#define wxSizerFlags_Border_1 1323
+#define wxSizerFlags_Center 1324
+#define wxSizerFlags_Centre 1325
+#define wxSizerFlags_Expand 1326
+#define wxSizerFlags_Left 1327
+#define wxSizerFlags_Proportion 1328
+#define wxSizerFlags_Right 1329
+#define wxSizerFlags_destroy 1330
+#define wxSizerItem_new_5_1 1331
+#define wxSizerItem_new_2_1 1332
+#define wxSizerItem_new_5_0 1333
+#define wxSizerItem_new_2_0 1334
+#define wxSizerItem_new_6 1335
+#define wxSizerItem_new_3 1336
+#define wxSizerItem_new_0 1337
+#define wxSizerItem_destruct 1338
+#define wxSizerItem_CalcMin 1339
+#define wxSizerItem_DeleteWindows 1340
+#define wxSizerItem_DetachSizer 1341
+#define wxSizerItem_GetBorder 1342
+#define wxSizerItem_GetFlag 1343
+#define wxSizerItem_GetMinSize 1344
+#define wxSizerItem_GetPosition 1345
+#define wxSizerItem_GetProportion 1346
+#define wxSizerItem_GetRatio 1347
+#define wxSizerItem_GetRect 1348
+#define wxSizerItem_GetSize 1349
+#define wxSizerItem_GetSizer 1350
+#define wxSizerItem_GetSpacer 1351
+#define wxSizerItem_GetUserData 1352
+#define wxSizerItem_GetWindow 1353
+#define wxSizerItem_IsSizer 1354
+#define wxSizerItem_IsShown 1355
+#define wxSizerItem_IsSpacer 1356
+#define wxSizerItem_IsWindow 1357
+#define wxSizerItem_SetBorder 1358
+#define wxSizerItem_SetDimension 1359
+#define wxSizerItem_SetFlag 1360
+#define wxSizerItem_SetInitSize 1361
+#define wxSizerItem_SetMinSize_1 1362
+#define wxSizerItem_SetMinSize_2 1363
+#define wxSizerItem_SetProportion 1364
+#define wxSizerItem_SetRatio_2 1365
+#define wxSizerItem_SetRatio_1_1 1366
+#define wxSizerItem_SetRatio_1_0 1367
+#define wxSizerItem_SetSizer 1368
+#define wxSizerItem_SetSpacer_1 1369
+#define wxSizerItem_SetSpacer_2 1370
+#define wxSizerItem_SetWindow 1371
+#define wxSizerItem_Show 1372
+#define wxBoxSizer_new 1373
+#define wxBoxSizer_GetOrientation 1374
+#define wxBoxSizer_destroy 1375
+#define wxStaticBoxSizer_new_2 1376
+#define wxStaticBoxSizer_new_3 1377
+#define wxStaticBoxSizer_GetStaticBox 1378
+#define wxStaticBoxSizer_destroy 1379
+#define wxGridSizer_new_4 1380
+#define wxGridSizer_new_2 1381
+#define wxGridSizer_GetCols 1382
+#define wxGridSizer_GetHGap 1383
+#define wxGridSizer_GetRows 1384
+#define wxGridSizer_GetVGap 1385
+#define wxGridSizer_SetCols 1386
+#define wxGridSizer_SetHGap 1387
+#define wxGridSizer_SetRows 1388
+#define wxGridSizer_SetVGap 1389
+#define wxGridSizer_destroy 1390
+#define wxFlexGridSizer_new_4 1391
+#define wxFlexGridSizer_new_2 1392
+#define wxFlexGridSizer_AddGrowableCol 1393
+#define wxFlexGridSizer_AddGrowableRow 1394
+#define wxFlexGridSizer_GetFlexibleDirection 1395
+#define wxFlexGridSizer_GetNonFlexibleGrowMode 1396
+#define wxFlexGridSizer_RemoveGrowableCol 1397
+#define wxFlexGridSizer_RemoveGrowableRow 1398
+#define wxFlexGridSizer_SetFlexibleDirection 1399
+#define wxFlexGridSizer_SetNonFlexibleGrowMode 1400
+#define wxFlexGridSizer_destroy 1401
+#define wxGridBagSizer_new 1402
+#define wxGridBagSizer_Add_3_2 1403
+#define wxGridBagSizer_Add_3_1 1404
+#define wxGridBagSizer_Add_4 1405
+#define wxGridBagSizer_Add_1_0 1406
+#define wxGridBagSizer_Add_2_1 1407
+#define wxGridBagSizer_Add_2_0 1408
+#define wxGridBagSizer_Add_3_0 1409
+#define wxGridBagSizer_Add_1_1 1410
+#define wxGridBagSizer_CalcMin 1411
+#define wxGridBagSizer_CheckForIntersection_2 1412
+#define wxGridBagSizer_CheckForIntersection_3 1413
+#define wxGridBagSizer_FindItem_1_1 1414
+#define wxGridBagSizer_FindItem_1_0 1415
+#define wxGridBagSizer_FindItemAtPoint 1416
+#define wxGridBagSizer_FindItemAtPosition 1417
+#define wxGridBagSizer_FindItemWithData 1418
+#define wxGridBagSizer_GetCellSize 1419
+#define wxGridBagSizer_GetEmptyCellSize 1420
+#define wxGridBagSizer_GetItemPosition_1_2 1421
+#define wxGridBagSizer_GetItemPosition_1_1 1422
+#define wxGridBagSizer_GetItemPosition_1_0 1423
+#define wxGridBagSizer_GetItemSpan_1_2 1424
+#define wxGridBagSizer_GetItemSpan_1_1 1425
+#define wxGridBagSizer_GetItemSpan_1_0 1426
+#define wxGridBagSizer_SetEmptyCellSize 1427
+#define wxGridBagSizer_SetItemPosition_2_2 1428
+#define wxGridBagSizer_SetItemPosition_2_1 1429
+#define wxGridBagSizer_SetItemPosition_2_0 1430
+#define wxGridBagSizer_SetItemSpan_2_2 1431
+#define wxGridBagSizer_SetItemSpan_2_1 1432
+#define wxGridBagSizer_SetItemSpan_2_0 1433
+#define wxGridBagSizer_destroy 1434
+#define wxStdDialogButtonSizer_new 1435
+#define wxStdDialogButtonSizer_AddButton 1436
+#define wxStdDialogButtonSizer_Realize 1437
+#define wxStdDialogButtonSizer_SetAffirmativeButton 1438
+#define wxStdDialogButtonSizer_SetCancelButton 1439
+#define wxStdDialogButtonSizer_SetNegativeButton 1440
+#define wxStdDialogButtonSizer_destroy 1441
+#define wxFont_new_0 1442
+#define wxFont_new_1 1443
+#define wxFont_new_5 1444
+#define wxFont_destruct 1446
+#define wxFont_IsFixedWidth 1447
+#define wxFont_GetDefaultEncoding 1448
+#define wxFont_GetFaceName 1449
+#define wxFont_GetFamily 1450
+#define wxFont_GetNativeFontInfoDesc 1451
+#define wxFont_GetNativeFontInfoUserDesc 1452
+#define wxFont_GetPointSize 1453
+#define wxFont_GetStyle 1454
+#define wxFont_GetUnderlined 1455
+#define wxFont_GetWeight 1456
+#define wxFont_Ok 1457
+#define wxFont_SetDefaultEncoding 1458
+#define wxFont_SetFaceName 1459
+#define wxFont_SetFamily 1460
+#define wxFont_SetPointSize 1461
+#define wxFont_SetStyle 1462
+#define wxFont_SetUnderlined 1463
+#define wxFont_SetWeight 1464
+#define wxToolTip_Enable 1465
+#define wxToolTip_SetDelay 1466
+#define wxToolTip_new 1467
+#define wxToolTip_SetTip 1468
+#define wxToolTip_GetTip 1469
+#define wxToolTip_GetWindow 1470
+#define wxToolTip_destroy 1471
+#define wxButton_new_3 1473
+#define wxButton_new_0 1474
+#define wxButton_destruct 1475
+#define wxButton_Create 1476
+#define wxButton_GetDefaultSize 1477
+#define wxButton_SetDefault 1478
+#define wxButton_SetLabel 1479
+#define wxBitmapButton_new_4 1481
+#define wxBitmapButton_new_0 1482
+#define wxBitmapButton_Create 1483
+#define wxBitmapButton_GetBitmapDisabled 1484
+#define wxBitmapButton_GetBitmapFocus 1486
+#define wxBitmapButton_GetBitmapLabel 1488
+#define wxBitmapButton_GetBitmapSelected 1490
+#define wxBitmapButton_SetBitmapDisabled 1492
+#define wxBitmapButton_SetBitmapFocus 1493
+#define wxBitmapButton_SetBitmapLabel 1494
+#define wxBitmapButton_SetBitmapSelected 1495
+#define wxBitmapButton_destroy 1496
+#define wxToggleButton_new_0 1497
+#define wxToggleButton_new_4 1498
+#define wxToggleButton_Create 1499
+#define wxToggleButton_GetValue 1500
+#define wxToggleButton_SetValue 1501
+#define wxToggleButton_destroy 1502
+#define wxCalendarCtrl_new_0 1503
+#define wxCalendarCtrl_new_3 1504
+#define wxCalendarCtrl_Create 1505
+#define wxCalendarCtrl_destruct 1506
+#define wxCalendarCtrl_SetDate 1507
+#define wxCalendarCtrl_GetDate 1508
+#define wxCalendarCtrl_EnableYearChange 1509
+#define wxCalendarCtrl_EnableMonthChange 1510
+#define wxCalendarCtrl_EnableHolidayDisplay 1511
+#define wxCalendarCtrl_SetHeaderColours 1512
+#define wxCalendarCtrl_GetHeaderColourFg 1513
+#define wxCalendarCtrl_GetHeaderColourBg 1514
+#define wxCalendarCtrl_SetHighlightColours 1515
+#define wxCalendarCtrl_GetHighlightColourFg 1516
+#define wxCalendarCtrl_GetHighlightColourBg 1517
+#define wxCalendarCtrl_SetHolidayColours 1518
+#define wxCalendarCtrl_GetHolidayColourFg 1519
+#define wxCalendarCtrl_GetHolidayColourBg 1520
+#define wxCalendarCtrl_GetAttr 1521
+#define wxCalendarCtrl_SetAttr 1522
+#define wxCalendarCtrl_SetHoliday 1523
+#define wxCalendarCtrl_ResetAttr 1524
+#define wxCalendarCtrl_HitTest 1525
+#define wxCalendarDateAttr_new_0 1526
+#define wxCalendarDateAttr_new_2_1 1527
+#define wxCalendarDateAttr_new_2_0 1528
+#define wxCalendarDateAttr_SetTextColour 1529
+#define wxCalendarDateAttr_SetBackgroundColour 1530
+#define wxCalendarDateAttr_SetBorderColour 1531
+#define wxCalendarDateAttr_SetFont 1532
+#define wxCalendarDateAttr_SetBorder 1533
+#define wxCalendarDateAttr_SetHoliday 1534
+#define wxCalendarDateAttr_HasTextColour 1535
+#define wxCalendarDateAttr_HasBackgroundColour 1536
+#define wxCalendarDateAttr_HasBorderColour 1537
+#define wxCalendarDateAttr_HasFont 1538
+#define wxCalendarDateAttr_HasBorder 1539
+#define wxCalendarDateAttr_IsHoliday 1540
+#define wxCalendarDateAttr_GetTextColour 1541
+#define wxCalendarDateAttr_GetBackgroundColour 1542
+#define wxCalendarDateAttr_GetBorderColour 1543
+#define wxCalendarDateAttr_GetFont 1544
+#define wxCalendarDateAttr_GetBorder 1545
+#define wxCalendarDateAttr_destroy 1546
+#define wxCheckBox_new_4 1548
+#define wxCheckBox_new_0 1549
+#define wxCheckBox_Create 1550
+#define wxCheckBox_GetValue 1551
+#define wxCheckBox_Get3StateValue 1552
+#define wxCheckBox_Is3rdStateAllowedForUser 1553
+#define wxCheckBox_Is3State 1554
+#define wxCheckBox_IsChecked 1555
+#define wxCheckBox_SetValue 1556
+#define wxCheckBox_Set3StateValue 1557
+#define wxCheckBox_destroy 1558
+#define wxCheckListBox_new_0 1559
+#define wxCheckListBox_new_3 1561
+#define wxCheckListBox_Check 1562
+#define wxCheckListBox_IsChecked 1563
+#define wxCheckListBox_destroy 1564
+#define wxChoice_new_3 1567
+#define wxChoice_new_0 1568
+#define wxChoice_destruct 1570
+#define wxChoice_Create 1572
+#define wxChoice_Delete 1573
+#define wxChoice_GetColumns 1574
+#define wxChoice_SetColumns 1575
+#define wxComboBox_new_0 1576
+#define wxComboBox_new_3 1578
+#define wxComboBox_destruct 1579
+#define wxComboBox_Create 1581
+#define wxComboBox_CanCopy 1582
+#define wxComboBox_CanCut 1583
+#define wxComboBox_CanPaste 1584
+#define wxComboBox_CanRedo 1585
+#define wxComboBox_CanUndo 1586
+#define wxComboBox_Copy 1587
+#define wxComboBox_Cut 1588
+#define wxComboBox_GetInsertionPoint 1589
+#define wxComboBox_GetLastPosition 1590
+#define wxComboBox_GetValue 1591
+#define wxComboBox_Paste 1592
+#define wxComboBox_Redo 1593
+#define wxComboBox_Replace 1594
+#define wxComboBox_Remove 1595
+#define wxComboBox_SetInsertionPoint 1596
+#define wxComboBox_SetInsertionPointEnd 1597
+#define wxComboBox_SetSelection_1 1598
+#define wxComboBox_SetSelection_2 1599
+#define wxComboBox_SetValue 1600
+#define wxComboBox_Undo 1601
+#define wxGauge_new_0 1602
+#define wxGauge_new_4 1603
+#define wxGauge_Create 1604
+#define wxGauge_GetBezelFace 1605
+#define wxGauge_GetRange 1606
+#define wxGauge_GetShadowWidth 1607
+#define wxGauge_GetValue 1608
+#define wxGauge_IsVertical 1609
+#define wxGauge_SetBezelFace 1610
+#define wxGauge_SetRange 1611
+#define wxGauge_SetShadowWidth 1612
+#define wxGauge_SetValue 1613
+#define wxGauge_Pulse 1614
+#define wxGauge_destroy 1615
+#define wxGenericDirCtrl_new_0 1616
+#define wxGenericDirCtrl_new_2 1617
+#define wxGenericDirCtrl_destruct 1618
+#define wxGenericDirCtrl_Create 1619
+#define wxGenericDirCtrl_Init 1620
+#define wxGenericDirCtrl_CollapseTree 1621
+#define wxGenericDirCtrl_ExpandPath 1622
+#define wxGenericDirCtrl_GetDefaultPath 1623
+#define wxGenericDirCtrl_GetPath 1624
+#define wxGenericDirCtrl_GetFilePath 1625
+#define wxGenericDirCtrl_GetFilter 1626
+#define wxGenericDirCtrl_GetFilterIndex 1627
+#define wxGenericDirCtrl_GetRootId 1628
+#define wxGenericDirCtrl_GetTreeCtrl 1629
+#define wxGenericDirCtrl_ReCreateTree 1630
+#define wxGenericDirCtrl_SetDefaultPath 1631
+#define wxGenericDirCtrl_SetFilter 1632
+#define wxGenericDirCtrl_SetFilterIndex 1633
+#define wxGenericDirCtrl_SetPath 1634
+#define wxStaticBox_new_4 1636
+#define wxStaticBox_new_0 1637
+#define wxStaticBox_Create 1638
+#define wxStaticBox_destroy 1639
+#define wxStaticLine_new_2 1641
+#define wxStaticLine_new_0 1642
+#define wxStaticLine_Create 1643
+#define wxStaticLine_IsVertical 1644
+#define wxStaticLine_GetDefaultSize 1645
+#define wxStaticLine_destroy 1646
+#define wxListBox_new_3 1649
+#define wxListBox_new_0 1650
+#define wxListBox_destruct 1652
+#define wxListBox_Create 1654
+#define wxListBox_Deselect 1655
+#define wxListBox_GetSelections 1656
+#define wxListBox_InsertItems 1657
+#define wxListBox_IsSelected 1658
+#define wxListBox_Set 1659
+#define wxListBox_HitTest 1660
+#define wxListBox_SetFirstItem_1_0 1661
+#define wxListBox_SetFirstItem_1_1 1662
+#define wxListCtrl_new_0 1663
+#define wxListCtrl_new_2 1664
+#define wxListCtrl_Arrange 1665
+#define wxListCtrl_AssignImageList 1666
+#define wxListCtrl_ClearAll 1667
+#define wxListCtrl_Create 1668
+#define wxListCtrl_DeleteAllItems 1669
+#define wxListCtrl_DeleteColumn 1670
+#define wxListCtrl_DeleteItem 1671
+#define wxListCtrl_EditLabel 1672
+#define wxListCtrl_EnsureVisible 1673
+#define wxListCtrl_FindItem_3_0 1674
+#define wxListCtrl_FindItem_3_1 1675
+#define wxListCtrl_GetColumn 1676
+#define wxListCtrl_GetColumnCount 1677
+#define wxListCtrl_GetColumnWidth 1678
+#define wxListCtrl_GetCountPerPage 1679
+#define wxListCtrl_GetEditControl 1680
+#define wxListCtrl_GetImageList 1681
+#define wxListCtrl_GetItem 1682
+#define wxListCtrl_GetItemBackgroundColour 1683
+#define wxListCtrl_GetItemCount 1684
+#define wxListCtrl_GetItemData 1685
+#define wxListCtrl_GetItemFont 1686
+#define wxListCtrl_GetItemPosition 1687
+#define wxListCtrl_GetItemRect 1688
+#define wxListCtrl_GetItemSpacing 1689
+#define wxListCtrl_GetItemState 1690
+#define wxListCtrl_GetItemText 1691
+#define wxListCtrl_GetItemTextColour 1692
+#define wxListCtrl_GetNextItem 1693
+#define wxListCtrl_GetSelectedItemCount 1694
+#define wxListCtrl_GetTextColour 1695
+#define wxListCtrl_GetTopItem 1696
+#define wxListCtrl_GetViewRect 1697
+#define wxListCtrl_HitTest 1698
+#define wxListCtrl_InsertColumn_2 1699
+#define wxListCtrl_InsertColumn_3 1700
+#define wxListCtrl_InsertItem_1 1701
+#define wxListCtrl_InsertItem_2_1 1702
+#define wxListCtrl_InsertItem_2_0 1703
+#define wxListCtrl_InsertItem_3 1704
+#define wxListCtrl_RefreshItem 1705
+#define wxListCtrl_RefreshItems 1706
+#define wxListCtrl_ScrollList 1707
+#define wxListCtrl_SetBackgroundColour 1708
+#define wxListCtrl_SetColumn 1709
+#define wxListCtrl_SetColumnWidth 1710
+#define wxListCtrl_SetImageList 1711
+#define wxListCtrl_SetItem_1 1712
+#define wxListCtrl_SetItem_4 1713
+#define wxListCtrl_SetItemBackgroundColour 1714
+#define wxListCtrl_SetItemCount 1715
+#define wxListCtrl_SetItemData 1716
+#define wxListCtrl_SetItemFont 1717
+#define wxListCtrl_SetItemImage 1718
+#define wxListCtrl_SetItemColumnImage 1719
+#define wxListCtrl_SetItemPosition 1720
+#define wxListCtrl_SetItemState 1721
+#define wxListCtrl_SetItemText 1722
+#define wxListCtrl_SetItemTextColour 1723
+#define wxListCtrl_SetSingleStyle 1724
+#define wxListCtrl_SetTextColour 1725
+#define wxListCtrl_SetWindowStyleFlag 1726
+#define wxListCtrl_SortItems 1727
+#define wxListCtrl_destroy 1728
+#define wxListView_ClearColumnImage 1729
+#define wxListView_Focus 1730
+#define wxListView_GetFirstSelected 1731
+#define wxListView_GetFocusedItem 1732
+#define wxListView_GetNextSelected 1733
+#define wxListView_IsSelected 1734
+#define wxListView_Select 1735
+#define wxListView_SetColumnImage 1736
+#define wxListItem_new_0 1737
+#define wxListItem_new_1 1738
+#define wxListItem_destruct 1739
+#define wxListItem_Clear 1740
+#define wxListItem_GetAlign 1741
+#define wxListItem_GetBackgroundColour 1742
+#define wxListItem_GetColumn 1743
+#define wxListItem_GetFont 1744
+#define wxListItem_GetId 1745
+#define wxListItem_GetImage 1746
+#define wxListItem_GetMask 1747
+#define wxListItem_GetState 1748
+#define wxListItem_GetText 1749
+#define wxListItem_GetTextColour 1750
+#define wxListItem_GetWidth 1751
+#define wxListItem_SetAlign 1752
+#define wxListItem_SetBackgroundColour 1753
+#define wxListItem_SetColumn 1754
+#define wxListItem_SetFont 1755
+#define wxListItem_SetId 1756
+#define wxListItem_SetImage 1757
+#define wxListItem_SetMask 1758
+#define wxListItem_SetState 1759
+#define wxListItem_SetStateMask 1760
+#define wxListItem_SetText 1761
+#define wxListItem_SetTextColour 1762
+#define wxListItem_SetWidth 1763
+#define wxListItemAttr_new_0 1764
+#define wxListItemAttr_new_3 1765
+#define wxListItemAttr_GetBackgroundColour 1766
+#define wxListItemAttr_GetFont 1767
+#define wxListItemAttr_GetTextColour 1768
+#define wxListItemAttr_HasBackgroundColour 1769
+#define wxListItemAttr_HasFont 1770
+#define wxListItemAttr_HasTextColour 1771
+#define wxListItemAttr_SetBackgroundColour 1772
+#define wxListItemAttr_SetFont 1773
+#define wxListItemAttr_SetTextColour 1774
+#define wxListItemAttr_destroy 1775
+#define wxImageList_new_0 1776
+#define wxImageList_new_3 1777
+#define wxImageList_Add_1 1778
+#define wxImageList_Add_2_0 1779
+#define wxImageList_Add_2_1 1780
+#define wxImageList_Create 1781
+#define wxImageList_Draw 1783
+#define wxImageList_GetBitmap 1784
+#define wxImageList_GetIcon 1785
+#define wxImageList_GetImageCount 1786
+#define wxImageList_GetSize 1787
+#define wxImageList_Remove 1788
+#define wxImageList_RemoveAll 1789
+#define wxImageList_Replace_2 1790
+#define wxImageList_Replace_3 1791
+#define wxImageList_destroy 1792
+#define wxTextAttr_new_0 1793
+#define wxTextAttr_new_2 1794
+#define wxTextAttr_GetAlignment 1795
+#define wxTextAttr_GetBackgroundColour 1796
+#define wxTextAttr_GetFont 1797
+#define wxTextAttr_GetLeftIndent 1798
+#define wxTextAttr_GetLeftSubIndent 1799
+#define wxTextAttr_GetRightIndent 1800
+#define wxTextAttr_GetTabs 1801
+#define wxTextAttr_GetTextColour 1802
+#define wxTextAttr_HasBackgroundColour 1803
+#define wxTextAttr_HasFont 1804
+#define wxTextAttr_HasTextColour 1805
+#define wxTextAttr_GetFlags 1806
+#define wxTextAttr_IsDefault 1807
+#define wxTextAttr_SetAlignment 1808
+#define wxTextAttr_SetBackgroundColour 1809
+#define wxTextAttr_SetFlags 1810
+#define wxTextAttr_SetFont 1811
+#define wxTextAttr_SetLeftIndent 1812
+#define wxTextAttr_SetRightIndent 1813
+#define wxTextAttr_SetTabs 1814
+#define wxTextAttr_SetTextColour 1815
+#define wxTextAttr_destroy 1816
+#define wxTextCtrl_new_3 1818
+#define wxTextCtrl_new_0 1819
+#define wxTextCtrl_destruct 1821
+#define wxTextCtrl_AppendText 1822
+#define wxTextCtrl_CanCopy 1823
+#define wxTextCtrl_CanCut 1824
+#define wxTextCtrl_CanPaste 1825
+#define wxTextCtrl_CanRedo 1826
+#define wxTextCtrl_CanUndo 1827
+#define wxTextCtrl_Clear 1828
+#define wxTextCtrl_Copy 1829
+#define wxTextCtrl_Create 1830
+#define wxTextCtrl_Cut 1831
+#define wxTextCtrl_DiscardEdits 1832
+#define wxTextCtrl_ChangeValue 1833
+#define wxTextCtrl_EmulateKeyPress 1834
+#define wxTextCtrl_GetDefaultStyle 1835
+#define wxTextCtrl_GetInsertionPoint 1836
+#define wxTextCtrl_GetLastPosition 1837
+#define wxTextCtrl_GetLineLength 1838
+#define wxTextCtrl_GetLineText 1839
+#define wxTextCtrl_GetNumberOfLines 1840
+#define wxTextCtrl_GetRange 1841
+#define wxTextCtrl_GetSelection 1842
+#define wxTextCtrl_GetStringSelection 1843
+#define wxTextCtrl_GetStyle 1844
+#define wxTextCtrl_GetValue 1845
+#define wxTextCtrl_IsEditable 1846
+#define wxTextCtrl_IsModified 1847
+#define wxTextCtrl_IsMultiLine 1848
+#define wxTextCtrl_IsSingleLine 1849
+#define wxTextCtrl_LoadFile 1850
+#define wxTextCtrl_MarkDirty 1851
+#define wxTextCtrl_Paste 1852
+#define wxTextCtrl_PositionToXY 1853
+#define wxTextCtrl_Redo 1854
+#define wxTextCtrl_Remove 1855
+#define wxTextCtrl_Replace 1856
+#define wxTextCtrl_SaveFile 1857
+#define wxTextCtrl_SetDefaultStyle 1858
+#define wxTextCtrl_SetEditable 1859
+#define wxTextCtrl_SetInsertionPoint 1860
+#define wxTextCtrl_SetInsertionPointEnd 1861
+#define wxTextCtrl_SetMaxLength 1863
+#define wxTextCtrl_SetSelection 1864
+#define wxTextCtrl_SetStyle 1865
+#define wxTextCtrl_SetValue 1866
+#define wxTextCtrl_ShowPosition 1867
+#define wxTextCtrl_Undo 1868
+#define wxTextCtrl_WriteText 1869
+#define wxTextCtrl_XYToPosition 1870
+#define wxNotebook_new_0 1873
+#define wxNotebook_new_3 1874
+#define wxNotebook_destruct 1875
+#define wxNotebook_AddPage 1876
+#define wxNotebook_AdvanceSelection 1877
+#define wxNotebook_AssignImageList 1878
+#define wxNotebook_Create 1879
+#define wxNotebook_DeleteAllPages 1880
+#define wxNotebook_DeletePage 1881
+#define wxNotebook_RemovePage 1882
+#define wxNotebook_GetCurrentPage 1883
+#define wxNotebook_GetImageList 1884
+#define wxNotebook_GetPage 1886
+#define wxNotebook_GetPageCount 1887
+#define wxNotebook_GetPageImage 1888
+#define wxNotebook_GetPageText 1889
+#define wxNotebook_GetRowCount 1890
+#define wxNotebook_GetSelection 1891
+#define wxNotebook_GetThemeBackgroundColour 1892
+#define wxNotebook_HitTest 1894
+#define wxNotebook_InsertPage 1896
+#define wxNotebook_SetImageList 1897
+#define wxNotebook_SetPadding 1898
+#define wxNotebook_SetPageSize 1899
+#define wxNotebook_SetPageImage 1900
+#define wxNotebook_SetPageText 1901
+#define wxNotebook_SetSelection 1902
+#define wxNotebook_ChangeSelection 1903
+#define wxChoicebook_new_0 1904
+#define wxChoicebook_new_3 1905
+#define wxChoicebook_AddPage 1906
+#define wxChoicebook_AdvanceSelection 1907
+#define wxChoicebook_AssignImageList 1908
+#define wxChoicebook_Create 1909
+#define wxChoicebook_DeleteAllPages 1910
+#define wxChoicebook_DeletePage 1911
+#define wxChoicebook_RemovePage 1912
+#define wxChoicebook_GetCurrentPage 1913
+#define wxChoicebook_GetImageList 1914
+#define wxChoicebook_GetPage 1916
+#define wxChoicebook_GetPageCount 1917
+#define wxChoicebook_GetPageImage 1918
+#define wxChoicebook_GetPageText 1919
+#define wxChoicebook_GetSelection 1920
+#define wxChoicebook_HitTest 1921
+#define wxChoicebook_InsertPage 1922
+#define wxChoicebook_SetImageList 1923
+#define wxChoicebook_SetPageSize 1924
+#define wxChoicebook_SetPageImage 1925
+#define wxChoicebook_SetPageText 1926
+#define wxChoicebook_SetSelection 1927
+#define wxChoicebook_ChangeSelection 1928
+#define wxChoicebook_destroy 1929
+#define wxToolbook_new_0 1930
+#define wxToolbook_new_3 1931
+#define wxToolbook_AddPage 1932
+#define wxToolbook_AdvanceSelection 1933
+#define wxToolbook_AssignImageList 1934
+#define wxToolbook_Create 1935
+#define wxToolbook_DeleteAllPages 1936
+#define wxToolbook_DeletePage 1937
+#define wxToolbook_RemovePage 1938
+#define wxToolbook_GetCurrentPage 1939
+#define wxToolbook_GetImageList 1940
+#define wxToolbook_GetPage 1942
+#define wxToolbook_GetPageCount 1943
+#define wxToolbook_GetPageImage 1944
+#define wxToolbook_GetPageText 1945
+#define wxToolbook_GetSelection 1946
+#define wxToolbook_HitTest 1948
+#define wxToolbook_InsertPage 1949
+#define wxToolbook_SetImageList 1950
+#define wxToolbook_SetPageSize 1951
+#define wxToolbook_SetPageImage 1952
+#define wxToolbook_SetPageText 1953
+#define wxToolbook_SetSelection 1954
+#define wxToolbook_ChangeSelection 1955
+#define wxToolbook_destroy 1956
+#define wxListbook_new_0 1957
+#define wxListbook_new_3 1958
+#define wxListbook_AddPage 1959
+#define wxListbook_AdvanceSelection 1960
+#define wxListbook_AssignImageList 1961
+#define wxListbook_Create 1962
+#define wxListbook_DeleteAllPages 1963
+#define wxListbook_DeletePage 1964
+#define wxListbook_RemovePage 1965
+#define wxListbook_GetCurrentPage 1966
+#define wxListbook_GetImageList 1967
+#define wxListbook_GetPage 1969
+#define wxListbook_GetPageCount 1970
+#define wxListbook_GetPageImage 1971
+#define wxListbook_GetPageText 1972
+#define wxListbook_GetSelection 1973
+#define wxListbook_HitTest 1975
+#define wxListbook_InsertPage 1976
+#define wxListbook_SetImageList 1977
+#define wxListbook_SetPageSize 1978
+#define wxListbook_SetPageImage 1979
+#define wxListbook_SetPageText 1980
+#define wxListbook_SetSelection 1981
+#define wxListbook_ChangeSelection 1982
+#define wxListbook_destroy 1983
+#define wxTreebook_new_0 1984
+#define wxTreebook_new_3 1985
+#define wxTreebook_AddPage 1986
+#define wxTreebook_AdvanceSelection 1987
+#define wxTreebook_AssignImageList 1988
+#define wxTreebook_Create 1989
+#define wxTreebook_DeleteAllPages 1990
+#define wxTreebook_DeletePage 1991
+#define wxTreebook_RemovePage 1992
+#define wxTreebook_GetCurrentPage 1993
+#define wxTreebook_GetImageList 1994
+#define wxTreebook_GetPage 1996
+#define wxTreebook_GetPageCount 1997
+#define wxTreebook_GetPageImage 1998
+#define wxTreebook_GetPageText 1999
+#define wxTreebook_GetSelection 2000
+#define wxTreebook_ExpandNode 2001
+#define wxTreebook_IsNodeExpanded 2002
+#define wxTreebook_HitTest 2004
+#define wxTreebook_InsertPage 2005
+#define wxTreebook_InsertSubPage 2006
+#define wxTreebook_SetImageList 2007
+#define wxTreebook_SetPageSize 2008
+#define wxTreebook_SetPageImage 2009
+#define wxTreebook_SetPageText 2010
+#define wxTreebook_SetSelection 2011
+#define wxTreebook_ChangeSelection 2012
+#define wxTreebook_destroy 2013
+#define wxTreeCtrl_new_2 2016
+#define wxTreeCtrl_new_0 2017
+#define wxTreeCtrl_destruct 2019
+#define wxTreeCtrl_AddRoot 2020
+#define wxTreeCtrl_AppendItem 2021
+#define wxTreeCtrl_AssignImageList 2022
+#define wxTreeCtrl_AssignStateImageList 2023
+#define wxTreeCtrl_Collapse 2024
+#define wxTreeCtrl_CollapseAndReset 2025
+#define wxTreeCtrl_Create 2026
+#define wxTreeCtrl_Delete 2027
+#define wxTreeCtrl_DeleteAllItems 2028
+#define wxTreeCtrl_DeleteChildren 2029
+#define wxTreeCtrl_EditLabel 2030
+#define wxTreeCtrl_EnsureVisible 2031
+#define wxTreeCtrl_Expand 2032
+#define wxTreeCtrl_GetBoundingRect 2033
+#define wxTreeCtrl_GetChildrenCount 2035
+#define wxTreeCtrl_GetCount 2036
+#define wxTreeCtrl_GetEditControl 2037
+#define wxTreeCtrl_GetFirstChild 2038
+#define wxTreeCtrl_GetNextChild 2039
+#define wxTreeCtrl_GetFirstVisibleItem 2040
+#define wxTreeCtrl_GetImageList 2041
+#define wxTreeCtrl_GetIndent 2042
+#define wxTreeCtrl_GetItemBackgroundColour 2043
+#define wxTreeCtrl_GetItemData 2044
+#define wxTreeCtrl_GetItemFont 2045
+#define wxTreeCtrl_GetItemImage_1 2046
+#define wxTreeCtrl_GetItemImage_2 2047
+#define wxTreeCtrl_GetItemText 2048
+#define wxTreeCtrl_GetItemTextColour 2049
+#define wxTreeCtrl_GetLastChild 2050
+#define wxTreeCtrl_GetNextSibling 2051
+#define wxTreeCtrl_GetNextVisible 2052
+#define wxTreeCtrl_GetItemParent 2053
+#define wxTreeCtrl_GetPrevSibling 2054
+#define wxTreeCtrl_GetPrevVisible 2055
+#define wxTreeCtrl_GetRootItem 2056
+#define wxTreeCtrl_GetSelection 2057
+#define wxTreeCtrl_GetSelections 2058
+#define wxTreeCtrl_GetStateImageList 2059
+#define wxTreeCtrl_HitTest 2060
+#define wxTreeCtrl_InsertItem 2062
+#define wxTreeCtrl_IsBold 2063
+#define wxTreeCtrl_IsExpanded 2064
+#define wxTreeCtrl_IsSelected 2065
+#define wxTreeCtrl_IsVisible 2066
+#define wxTreeCtrl_ItemHasChildren 2067
+#define wxTreeCtrl_IsTreeItemIdOk 2068
+#define wxTreeCtrl_PrependItem 2069
+#define wxTreeCtrl_ScrollTo 2070
+#define wxTreeCtrl_SelectItem_1 2071
+#define wxTreeCtrl_SelectItem_2 2072
+#define wxTreeCtrl_SetIndent 2073
+#define wxTreeCtrl_SetImageList 2074
+#define wxTreeCtrl_SetItemBackgroundColour 2075
+#define wxTreeCtrl_SetItemBold 2076
+#define wxTreeCtrl_SetItemData 2077
+#define wxTreeCtrl_SetItemDropHighlight 2078
+#define wxTreeCtrl_SetItemFont 2079
+#define wxTreeCtrl_SetItemHasChildren 2080
+#define wxTreeCtrl_SetItemImage_2 2081
+#define wxTreeCtrl_SetItemImage_3 2082
+#define wxTreeCtrl_SetItemText 2083
+#define wxTreeCtrl_SetItemTextColour 2084
+#define wxTreeCtrl_SetStateImageList 2085
+#define wxTreeCtrl_SetWindowStyle 2086
+#define wxTreeCtrl_SortChildren 2087
+#define wxTreeCtrl_Toggle 2088
+#define wxTreeCtrl_ToggleItemSelection 2089
+#define wxTreeCtrl_Unselect 2090
+#define wxTreeCtrl_UnselectAll 2091
+#define wxTreeCtrl_UnselectItem 2092
+#define wxScrollBar_new_0 2093
+#define wxScrollBar_new_3 2094
+#define wxScrollBar_destruct 2095
+#define wxScrollBar_Create 2096
+#define wxScrollBar_GetRange 2097
+#define wxScrollBar_GetPageSize 2098
+#define wxScrollBar_GetThumbPosition 2099
+#define wxScrollBar_GetThumbSize 2100
+#define wxScrollBar_SetThumbPosition 2101
+#define wxScrollBar_SetScrollbar 2102
+#define wxSpinButton_new_2 2104
+#define wxSpinButton_new_0 2105
+#define wxSpinButton_Create 2106
+#define wxSpinButton_GetMax 2107
+#define wxSpinButton_GetMin 2108
+#define wxSpinButton_GetValue 2109
+#define wxSpinButton_SetRange 2110
+#define wxSpinButton_SetValue 2111
+#define wxSpinButton_destroy 2112
+#define wxSpinCtrl_new_0 2113
+#define wxSpinCtrl_new_2 2114
+#define wxSpinCtrl_Create 2116
+#define wxSpinCtrl_SetValue_1_1 2119
+#define wxSpinCtrl_SetValue_1_0 2120
+#define wxSpinCtrl_GetValue 2122
+#define wxSpinCtrl_SetRange 2124
+#define wxSpinCtrl_SetSelection 2125
+#define wxSpinCtrl_GetMin 2127
+#define wxSpinCtrl_GetMax 2129
+#define wxSpinCtrl_destroy 2130
+#define wxStaticText_new_0 2131
+#define wxStaticText_new_4 2132
+#define wxStaticText_Create 2133
+#define wxStaticText_GetLabel 2134
+#define wxStaticText_SetLabel 2135
+#define wxStaticText_Wrap 2136
+#define wxStaticText_destroy 2137
+#define wxStaticBitmap_new_0 2138
+#define wxStaticBitmap_new_4 2139
+#define wxStaticBitmap_Create 2140
+#define wxStaticBitmap_GetBitmap 2141
+#define wxStaticBitmap_SetBitmap 2142
+#define wxStaticBitmap_destroy 2143
+#define wxRadioBox_new 2144
+#define wxRadioBox_destruct 2146
+#define wxRadioBox_Create 2147
+#define wxRadioBox_Enable_2 2148
+#define wxRadioBox_Enable_1 2149
+#define wxRadioBox_GetSelection 2150
+#define wxRadioBox_GetString 2151
+#define wxRadioBox_SetSelection 2152
+#define wxRadioBox_Show_2 2153
+#define wxRadioBox_Show_1 2154
+#define wxRadioBox_GetColumnCount 2155
+#define wxRadioBox_GetItemHelpText 2156
+#define wxRadioBox_GetItemToolTip 2157
+#define wxRadioBox_GetItemFromPoint 2159
+#define wxRadioBox_GetRowCount 2160
+#define wxRadioBox_IsItemEnabled 2161
+#define wxRadioBox_IsItemShown 2162
+#define wxRadioBox_SetItemHelpText 2163
+#define wxRadioBox_SetItemToolTip 2164
+#define wxRadioButton_new_0 2165
+#define wxRadioButton_new_4 2166
+#define wxRadioButton_Create 2167
+#define wxRadioButton_GetValue 2168
+#define wxRadioButton_SetValue 2169
+#define wxRadioButton_destroy 2170
+#define wxSlider_new_6 2172
+#define wxSlider_new_0 2173
+#define wxSlider_Create 2174
+#define wxSlider_GetLineSize 2175
+#define wxSlider_GetMax 2176
+#define wxSlider_GetMin 2177
+#define wxSlider_GetPageSize 2178
+#define wxSlider_GetThumbLength 2179
+#define wxSlider_GetValue 2180
+#define wxSlider_SetLineSize 2181
+#define wxSlider_SetPageSize 2182
+#define wxSlider_SetRange 2183
+#define wxSlider_SetThumbLength 2184
+#define wxSlider_SetValue 2185
+#define wxSlider_destroy 2186
+#define wxDialog_new_4 2188
+#define wxDialog_new_0 2189
+#define wxDialog_destruct 2191
+#define wxDialog_Create 2192
+#define wxDialog_CreateButtonSizer 2193
+#define wxDialog_CreateStdDialogButtonSizer 2194
+#define wxDialog_EndModal 2195
+#define wxDialog_GetAffirmativeId 2196
+#define wxDialog_GetReturnCode 2197
+#define wxDialog_IsModal 2198
+#define wxDialog_SetAffirmativeId 2199
+#define wxDialog_SetReturnCode 2200
+#define wxDialog_Show 2201
+#define wxDialog_ShowModal 2202
+#define wxColourDialog_new_0 2203
+#define wxColourDialog_new_2 2204
+#define wxColourDialog_destruct 2205
+#define wxColourDialog_Create 2206
+#define wxColourDialog_GetColourData 2207
+#define wxColourData_new_0 2208
+#define wxColourData_new_1 2209
+#define wxColourData_destruct 2210
+#define wxColourData_GetChooseFull 2211
+#define wxColourData_GetColour 2212
+#define wxColourData_GetCustomColour 2214
+#define wxColourData_SetChooseFull 2215
+#define wxColourData_SetColour 2216
+#define wxColourData_SetCustomColour 2217
+#define wxPalette_new_0 2218
+#define wxPalette_new_4 2219
+#define wxPalette_destruct 2221
+#define wxPalette_Create 2222
+#define wxPalette_GetColoursCount 2223
+#define wxPalette_GetPixel 2224
+#define wxPalette_GetRGB 2225
+#define wxPalette_IsOk 2226
+#define wxDirDialog_new 2230
+#define wxDirDialog_destruct 2231
+#define wxDirDialog_GetPath 2232
+#define wxDirDialog_GetMessage 2233
+#define wxDirDialog_SetMessage 2234
+#define wxDirDialog_SetPath 2235
+#define wxFileDialog_new 2239
+#define wxFileDialog_destruct 2240
+#define wxFileDialog_GetDirectory 2241
+#define wxFileDialog_GetFilename 2242
+#define wxFileDialog_GetFilenames 2243
+#define wxFileDialog_GetFilterIndex 2244
+#define wxFileDialog_GetMessage 2245
+#define wxFileDialog_GetPath 2246
+#define wxFileDialog_GetPaths 2247
+#define wxFileDialog_GetWildcard 2248
+#define wxFileDialog_SetDirectory 2249
+#define wxFileDialog_SetFilename 2250
+#define wxFileDialog_SetFilterIndex 2251
+#define wxFileDialog_SetMessage 2252
+#define wxFileDialog_SetPath 2253
+#define wxFileDialog_SetWildcard 2254
+#define wxPickerBase_SetInternalMargin 2255
+#define wxPickerBase_GetInternalMargin 2256
+#define wxPickerBase_SetTextCtrlProportion 2257
+#define wxPickerBase_SetPickerCtrlProportion 2258
+#define wxPickerBase_GetTextCtrlProportion 2259
+#define wxPickerBase_GetPickerCtrlProportion 2260
+#define wxPickerBase_HasTextCtrl 2261
+#define wxPickerBase_GetTextCtrl 2262
+#define wxPickerBase_IsTextCtrlGrowable 2263
+#define wxPickerBase_SetPickerCtrlGrowable 2264
+#define wxPickerBase_SetTextCtrlGrowable 2265
+#define wxPickerBase_IsPickerCtrlGrowable 2266
+#define wxFilePickerCtrl_new_0 2267
+#define wxFilePickerCtrl_new_3 2268
+#define wxFilePickerCtrl_Create 2269
+#define wxFilePickerCtrl_GetPath 2270
+#define wxFilePickerCtrl_SetPath 2271
+#define wxFilePickerCtrl_destroy 2272
+#define wxDirPickerCtrl_new_0 2273
+#define wxDirPickerCtrl_new_3 2274
+#define wxDirPickerCtrl_Create 2275
+#define wxDirPickerCtrl_GetPath 2276
+#define wxDirPickerCtrl_SetPath 2277
+#define wxDirPickerCtrl_destroy 2278
+#define wxColourPickerCtrl_new_0 2279
+#define wxColourPickerCtrl_new_3 2280
+#define wxColourPickerCtrl_Create 2281
+#define wxColourPickerCtrl_GetColour 2282
+#define wxColourPickerCtrl_SetColour_1_1 2283
+#define wxColourPickerCtrl_SetColour_1_0 2284
+#define wxColourPickerCtrl_destroy 2285
+#define wxDatePickerCtrl_new_0 2286
+#define wxDatePickerCtrl_new_3 2287
+#define wxDatePickerCtrl_GetRange 2288
+#define wxDatePickerCtrl_GetValue 2289
+#define wxDatePickerCtrl_SetRange 2290
+#define wxDatePickerCtrl_SetValue 2291
+#define wxDatePickerCtrl_destroy 2292
+#define wxFontPickerCtrl_new_0 2293
+#define wxFontPickerCtrl_new_3 2294
+#define wxFontPickerCtrl_Create 2295
+#define wxFontPickerCtrl_GetSelectedFont 2296
+#define wxFontPickerCtrl_SetSelectedFont 2297
+#define wxFontPickerCtrl_GetMaxPointSize 2298
+#define wxFontPickerCtrl_SetMaxPointSize 2299
+#define wxFontPickerCtrl_destroy 2300
+#define wxFindReplaceDialog_new_0 2303
+#define wxFindReplaceDialog_new_4 2304
+#define wxFindReplaceDialog_destruct 2305
+#define wxFindReplaceDialog_Create 2306
+#define wxFindReplaceDialog_GetData 2307
+#define wxFindReplaceData_new_0 2308
+#define wxFindReplaceData_new_1 2309
+#define wxFindReplaceData_GetFindString 2310
+#define wxFindReplaceData_GetReplaceString 2311
+#define wxFindReplaceData_GetFlags 2312
+#define wxFindReplaceData_SetFlags 2313
+#define wxFindReplaceData_SetFindString 2314
+#define wxFindReplaceData_SetReplaceString 2315
+#define wxFindReplaceData_destroy 2316
+#define wxMultiChoiceDialog_new_0 2317
+#define wxMultiChoiceDialog_new_5 2319
+#define wxMultiChoiceDialog_GetSelections 2320
+#define wxMultiChoiceDialog_SetSelections 2321
+#define wxMultiChoiceDialog_destroy 2322
+#define wxSingleChoiceDialog_new_0 2323
+#define wxSingleChoiceDialog_new_5 2325
+#define wxSingleChoiceDialog_GetSelection 2326
+#define wxSingleChoiceDialog_GetStringSelection 2327
+#define wxSingleChoiceDialog_SetSelection 2328
+#define wxSingleChoiceDialog_destroy 2329
+#define wxTextEntryDialog_new 2330
+#define wxTextEntryDialog_GetValue 2331
+#define wxTextEntryDialog_SetValue 2332
+#define wxTextEntryDialog_destroy 2333
+#define wxPasswordEntryDialog_new 2334
+#define wxPasswordEntryDialog_destroy 2335
+#define wxFontData_new_0 2336
+#define wxFontData_new_1 2337
+#define wxFontData_destruct 2338
+#define wxFontData_EnableEffects 2339
+#define wxFontData_GetAllowSymbols 2340
+#define wxFontData_GetColour 2341
+#define wxFontData_GetChosenFont 2342
+#define wxFontData_GetEnableEffects 2343
+#define wxFontData_GetInitialFont 2344
+#define wxFontData_GetShowHelp 2345
+#define wxFontData_SetAllowSymbols 2346
+#define wxFontData_SetChosenFont 2347
+#define wxFontData_SetColour 2348
+#define wxFontData_SetInitialFont 2349
+#define wxFontData_SetRange 2350
+#define wxFontData_SetShowHelp 2351
+#define wxFontDialog_new_0 2355
+#define wxFontDialog_new_2 2357
+#define wxFontDialog_Create 2359
+#define wxFontDialog_GetFontData 2360
+#define wxFontDialog_destroy 2362
+#define wxProgressDialog_new 2363
+#define wxProgressDialog_destruct 2364
+#define wxProgressDialog_Resume 2365
+#define wxProgressDialog_Update_2 2366
+#define wxProgressDialog_Update_0 2367
+#define wxMessageDialog_new 2368
+#define wxMessageDialog_destruct 2369
+#define wxPageSetupDialog_new 2370
+#define wxPageSetupDialog_destruct 2371
+#define wxPageSetupDialog_GetPageSetupData 2372
+#define wxPageSetupDialog_ShowModal 2373
+#define wxPageSetupDialogData_new_0 2374
+#define wxPageSetupDialogData_new_1_0 2375
+#define wxPageSetupDialogData_new_1_1 2376
+#define wxPageSetupDialogData_destruct 2377
+#define wxPageSetupDialogData_EnableHelp 2378
+#define wxPageSetupDialogData_EnableMargins 2379
+#define wxPageSetupDialogData_EnableOrientation 2380
+#define wxPageSetupDialogData_EnablePaper 2381
+#define wxPageSetupDialogData_EnablePrinter 2382
+#define wxPageSetupDialogData_GetDefaultMinMargins 2383
+#define wxPageSetupDialogData_GetEnableMargins 2384
+#define wxPageSetupDialogData_GetEnableOrientation 2385
+#define wxPageSetupDialogData_GetEnablePaper 2386
+#define wxPageSetupDialogData_GetEnablePrinter 2387
+#define wxPageSetupDialogData_GetEnableHelp 2388
+#define wxPageSetupDialogData_GetDefaultInfo 2389
+#define wxPageSetupDialogData_GetMarginTopLeft 2390
+#define wxPageSetupDialogData_GetMarginBottomRight 2391
+#define wxPageSetupDialogData_GetMinMarginTopLeft 2392
+#define wxPageSetupDialogData_GetMinMarginBottomRight 2393
+#define wxPageSetupDialogData_GetPaperId 2394
+#define wxPageSetupDialogData_GetPaperSize 2395
+#define wxPageSetupDialogData_GetPrintData 2397
+#define wxPageSetupDialogData_IsOk 2398
+#define wxPageSetupDialogData_SetDefaultInfo 2399
+#define wxPageSetupDialogData_SetDefaultMinMargins 2400
+#define wxPageSetupDialogData_SetMarginTopLeft 2401
+#define wxPageSetupDialogData_SetMarginBottomRight 2402
+#define wxPageSetupDialogData_SetMinMarginTopLeft 2403
+#define wxPageSetupDialogData_SetMinMarginBottomRight 2404
+#define wxPageSetupDialogData_SetPaperId 2405
+#define wxPageSetupDialogData_SetPaperSize_1_1 2406
+#define wxPageSetupDialogData_SetPaperSize_1_0 2407
+#define wxPageSetupDialogData_SetPrintData 2408
+#define wxPrintDialog_new_2_0 2409
+#define wxPrintDialog_new_2_1 2410
+#define wxPrintDialog_destruct 2411
+#define wxPrintDialog_GetPrintDialogData 2412
+#define wxPrintDialog_GetPrintDC 2413
+#define wxPrintDialogData_new_0 2414
+#define wxPrintDialogData_new_1_1 2415
+#define wxPrintDialogData_new_1_0 2416
+#define wxPrintDialogData_destruct 2417
+#define wxPrintDialogData_EnableHelp 2418
+#define wxPrintDialogData_EnablePageNumbers 2419
+#define wxPrintDialogData_EnablePrintToFile 2420
+#define wxPrintDialogData_EnableSelection 2421
+#define wxPrintDialogData_GetAllPages 2422
+#define wxPrintDialogData_GetCollate 2423
+#define wxPrintDialogData_GetFromPage 2424
+#define wxPrintDialogData_GetMaxPage 2425
+#define wxPrintDialogData_GetMinPage 2426
+#define wxPrintDialogData_GetNoCopies 2427
+#define wxPrintDialogData_GetPrintData 2428
+#define wxPrintDialogData_GetPrintToFile 2429
+#define wxPrintDialogData_GetSelection 2430
+#define wxPrintDialogData_GetToPage 2431
+#define wxPrintDialogData_IsOk 2432
+#define wxPrintDialogData_SetCollate 2433
+#define wxPrintDialogData_SetFromPage 2434
+#define wxPrintDialogData_SetMaxPage 2435
+#define wxPrintDialogData_SetMinPage 2436
+#define wxPrintDialogData_SetNoCopies 2437
+#define wxPrintDialogData_SetPrintData 2438
+#define wxPrintDialogData_SetPrintToFile 2439
+#define wxPrintDialogData_SetSelection 2440
+#define wxPrintDialogData_SetToPage 2441
+#define wxPrintData_new_0 2442
+#define wxPrintData_new_1 2443
+#define wxPrintData_destruct 2444
+#define wxPrintData_GetCollate 2445
+#define wxPrintData_GetBin 2446
+#define wxPrintData_GetColour 2447
+#define wxPrintData_GetDuplex 2448
+#define wxPrintData_GetNoCopies 2449
+#define wxPrintData_GetOrientation 2450
+#define wxPrintData_GetPaperId 2451
+#define wxPrintData_GetPrinterName 2452
+#define wxPrintData_GetQuality 2453
+#define wxPrintData_IsOk 2454
+#define wxPrintData_SetBin 2455
+#define wxPrintData_SetCollate 2456
+#define wxPrintData_SetColour 2457
+#define wxPrintData_SetDuplex 2458
+#define wxPrintData_SetNoCopies 2459
+#define wxPrintData_SetOrientation 2460
+#define wxPrintData_SetPaperId 2461
+#define wxPrintData_SetPrinterName 2462
+#define wxPrintData_SetQuality 2463
+#define wxPrintPreview_new_2 2466
+#define wxPrintPreview_new_3 2467
+#define wxPrintPreview_destruct 2469
+#define wxPrintPreview_GetCanvas 2470
+#define wxPrintPreview_GetCurrentPage 2471
+#define wxPrintPreview_GetFrame 2472
+#define wxPrintPreview_GetMaxPage 2473
+#define wxPrintPreview_GetMinPage 2474
+#define wxPrintPreview_GetPrintout 2475
+#define wxPrintPreview_GetPrintoutForPrinting 2476
+#define wxPrintPreview_IsOk 2477
+#define wxPrintPreview_PaintPage 2478
+#define wxPrintPreview_Print 2479
+#define wxPrintPreview_RenderPage 2480
+#define wxPrintPreview_SetCanvas 2481
+#define wxPrintPreview_SetCurrentPage 2482
+#define wxPrintPreview_SetFrame 2483
+#define wxPrintPreview_SetPrintout 2484
+#define wxPrintPreview_SetZoom 2485
+#define wxPreviewFrame_new 2486
+#define wxPreviewFrame_destruct 2487
+#define wxPreviewFrame_CreateControlBar 2488
+#define wxPreviewFrame_CreateCanvas 2489
+#define wxPreviewFrame_Initialize 2490
+#define wxPreviewFrame_OnCloseWindow 2491
+#define wxPreviewControlBar_new 2492
+#define wxPreviewControlBar_destruct 2493
+#define wxPreviewControlBar_CreateButtons 2494
+#define wxPreviewControlBar_GetPrintPreview 2495
+#define wxPreviewControlBar_GetZoomControl 2496
+#define wxPreviewControlBar_SetZoomControl 2497
+#define wxPrinter_new 2499
+#define wxPrinter_CreateAbortWindow 2500
+#define wxPrinter_GetAbort 2501
+#define wxPrinter_GetLastError 2502
+#define wxPrinter_GetPrintDialogData 2503
+#define wxPrinter_Print 2504
+#define wxPrinter_PrintDialog 2505
+#define wxPrinter_ReportError 2506
+#define wxPrinter_Setup 2507
+#define wxPrinter_destroy 2508
+#define wxXmlResource_new_1 2509
+#define wxXmlResource_new_2 2510
+#define wxXmlResource_destruct 2511
+#define wxXmlResource_AttachUnknownControl 2512
+#define wxXmlResource_ClearHandlers 2513
+#define wxXmlResource_CompareVersion 2514
+#define wxXmlResource_Get 2515
+#define wxXmlResource_GetFlags 2516
+#define wxXmlResource_GetVersion 2517
+#define wxXmlResource_GetXRCID 2518
+#define wxXmlResource_InitAllHandlers 2519
+#define wxXmlResource_Load 2520
+#define wxXmlResource_LoadBitmap 2521
+#define wxXmlResource_LoadDialog_2 2522
+#define wxXmlResource_LoadDialog_3 2523
+#define wxXmlResource_LoadFrame_2 2524
+#define wxXmlResource_LoadFrame_3 2525
+#define wxXmlResource_LoadIcon 2526
+#define wxXmlResource_LoadMenu 2527
+#define wxXmlResource_LoadMenuBar_2 2528
+#define wxXmlResource_LoadMenuBar_1 2529
+#define wxXmlResource_LoadPanel_2 2530
+#define wxXmlResource_LoadPanel_3 2531
+#define wxXmlResource_LoadToolBar 2532
+#define wxXmlResource_Set 2533
+#define wxXmlResource_SetFlags 2534
+#define wxXmlResource_Unload 2535
+#define wxXmlResource_xrcctrl 2536
+#define wxHtmlEasyPrinting_new 2537
+#define wxHtmlEasyPrinting_destruct 2538
+#define wxHtmlEasyPrinting_GetPrintData 2539
+#define wxHtmlEasyPrinting_GetPageSetupData 2540
+#define wxHtmlEasyPrinting_PreviewFile 2541
+#define wxHtmlEasyPrinting_PreviewText 2542
+#define wxHtmlEasyPrinting_PrintFile 2543
+#define wxHtmlEasyPrinting_PrintText 2544
+#define wxHtmlEasyPrinting_PageSetup 2545
+#define wxHtmlEasyPrinting_SetFonts 2546
+#define wxHtmlEasyPrinting_SetHeader 2547
+#define wxHtmlEasyPrinting_SetFooter 2548
+#define wxGLCanvas_new_2 2550
+#define wxGLCanvas_new_3_1 2551
+#define wxGLCanvas_new_3_0 2552
+#define wxGLCanvas_GetContext 2553
+#define wxGLCanvas_SetCurrent 2555
+#define wxGLCanvas_SwapBuffers 2556
+#define wxGLCanvas_destroy 2557
+#define wxAuiManager_new 2558
+#define wxAuiManager_destruct 2559
+#define wxAuiManager_AddPane_2_1 2560
+#define wxAuiManager_AddPane_3 2561
+#define wxAuiManager_AddPane_2_0 2562
+#define wxAuiManager_DetachPane 2563
+#define wxAuiManager_GetAllPanes 2564
+#define wxAuiManager_GetArtProvider 2565
+#define wxAuiManager_GetDockSizeConstraint 2566
+#define wxAuiManager_GetFlags 2567
+#define wxAuiManager_GetManagedWindow 2568
+#define wxAuiManager_GetManager 2569
+#define wxAuiManager_GetPane_1_1 2570
+#define wxAuiManager_GetPane_1_0 2571
+#define wxAuiManager_HideHint 2572
+#define wxAuiManager_InsertPane 2573
+#define wxAuiManager_LoadPaneInfo 2574
+#define wxAuiManager_LoadPerspective 2575
+#define wxAuiManager_SavePaneInfo 2576
+#define wxAuiManager_SavePerspective 2577
+#define wxAuiManager_SetArtProvider 2578
+#define wxAuiManager_SetDockSizeConstraint 2579
+#define wxAuiManager_SetFlags 2580
+#define wxAuiManager_SetManagedWindow 2581
+#define wxAuiManager_ShowHint 2582
+#define wxAuiManager_UnInit 2583
+#define wxAuiManager_Update 2584
+#define wxAuiPaneInfo_new_0 2585
+#define wxAuiPaneInfo_new_1 2586
+#define wxAuiPaneInfo_destruct 2587
+#define wxAuiPaneInfo_BestSize_1 2588
+#define wxAuiPaneInfo_BestSize_2 2589
+#define wxAuiPaneInfo_Bottom 2590
+#define wxAuiPaneInfo_BottomDockable 2591
+#define wxAuiPaneInfo_Caption 2592
+#define wxAuiPaneInfo_CaptionVisible 2593
+#define wxAuiPaneInfo_Centre 2594
+#define wxAuiPaneInfo_CentrePane 2595
+#define wxAuiPaneInfo_CloseButton 2596
+#define wxAuiPaneInfo_DefaultPane 2597
+#define wxAuiPaneInfo_DestroyOnClose 2598
+#define wxAuiPaneInfo_Direction 2599
+#define wxAuiPaneInfo_Dock 2600
+#define wxAuiPaneInfo_Dockable 2601
+#define wxAuiPaneInfo_Fixed 2602
+#define wxAuiPaneInfo_Float 2603
+#define wxAuiPaneInfo_Floatable 2604
+#define wxAuiPaneInfo_FloatingPosition_1 2605
+#define wxAuiPaneInfo_FloatingPosition_2 2606
+#define wxAuiPaneInfo_FloatingSize_1 2607
+#define wxAuiPaneInfo_FloatingSize_2 2608
+#define wxAuiPaneInfo_Gripper 2609
+#define wxAuiPaneInfo_GripperTop 2610
+#define wxAuiPaneInfo_HasBorder 2611
+#define wxAuiPaneInfo_HasCaption 2612
+#define wxAuiPaneInfo_HasCloseButton 2613
+#define wxAuiPaneInfo_HasFlag 2614
+#define wxAuiPaneInfo_HasGripper 2615
+#define wxAuiPaneInfo_HasGripperTop 2616
+#define wxAuiPaneInfo_HasMaximizeButton 2617
+#define wxAuiPaneInfo_HasMinimizeButton 2618
+#define wxAuiPaneInfo_HasPinButton 2619
+#define wxAuiPaneInfo_Hide 2620
+#define wxAuiPaneInfo_IsBottomDockable 2621
+#define wxAuiPaneInfo_IsDocked 2622
+#define wxAuiPaneInfo_IsFixed 2623
+#define wxAuiPaneInfo_IsFloatable 2624
+#define wxAuiPaneInfo_IsFloating 2625
+#define wxAuiPaneInfo_IsLeftDockable 2626
+#define wxAuiPaneInfo_IsMovable 2627
+#define wxAuiPaneInfo_IsOk 2628
+#define wxAuiPaneInfo_IsResizable 2629
+#define wxAuiPaneInfo_IsRightDockable 2630
+#define wxAuiPaneInfo_IsShown 2631
+#define wxAuiPaneInfo_IsToolbar 2632
+#define wxAuiPaneInfo_IsTopDockable 2633
+#define wxAuiPaneInfo_Layer 2634
+#define wxAuiPaneInfo_Left 2635
+#define wxAuiPaneInfo_LeftDockable 2636
+#define wxAuiPaneInfo_MaxSize_1 2637
+#define wxAuiPaneInfo_MaxSize_2 2638
+#define wxAuiPaneInfo_MaximizeButton 2639
+#define wxAuiPaneInfo_MinSize_1 2640
+#define wxAuiPaneInfo_MinSize_2 2641
+#define wxAuiPaneInfo_MinimizeButton 2642
+#define wxAuiPaneInfo_Movable 2643
+#define wxAuiPaneInfo_Name 2644
+#define wxAuiPaneInfo_PaneBorder 2645
+#define wxAuiPaneInfo_PinButton 2646
+#define wxAuiPaneInfo_Position 2647
+#define wxAuiPaneInfo_Resizable 2648
+#define wxAuiPaneInfo_Right 2649
+#define wxAuiPaneInfo_RightDockable 2650
+#define wxAuiPaneInfo_Row 2651
+#define wxAuiPaneInfo_SafeSet 2652
+#define wxAuiPaneInfo_SetFlag 2653
+#define wxAuiPaneInfo_Show 2654
+#define wxAuiPaneInfo_ToolbarPane 2655
+#define wxAuiPaneInfo_Top 2656
+#define wxAuiPaneInfo_TopDockable 2657
+#define wxAuiPaneInfo_Window 2658
+#define wxAuiPaneInfo_GetWindow 2659
+#define wxAuiPaneInfo_GetFrame 2660
+#define wxAuiPaneInfo_GetDirection 2661
+#define wxAuiPaneInfo_GetLayer 2662
+#define wxAuiPaneInfo_GetRow 2663
+#define wxAuiPaneInfo_GetPosition 2664
+#define wxAuiPaneInfo_GetFloatingPosition 2665
+#define wxAuiPaneInfo_GetFloatingSize 2666
+#define wxAuiNotebook_new_0 2667
+#define wxAuiNotebook_new_2 2668
+#define wxAuiNotebook_AddPage 2669
+#define wxAuiNotebook_Create 2670
+#define wxAuiNotebook_DeletePage 2671
+#define wxAuiNotebook_GetArtProvider 2672
+#define wxAuiNotebook_GetPage 2673
+#define wxAuiNotebook_GetPageBitmap 2674
+#define wxAuiNotebook_GetPageCount 2675
+#define wxAuiNotebook_GetPageIndex 2676
+#define wxAuiNotebook_GetPageText 2677
+#define wxAuiNotebook_GetSelection 2678
+#define wxAuiNotebook_InsertPage 2679
+#define wxAuiNotebook_RemovePage 2680
+#define wxAuiNotebook_SetArtProvider 2681
+#define wxAuiNotebook_SetFont 2682
+#define wxAuiNotebook_SetPageBitmap 2683
+#define wxAuiNotebook_SetPageText 2684
+#define wxAuiNotebook_SetSelection 2685
+#define wxAuiNotebook_SetTabCtrlHeight 2686
+#define wxAuiNotebook_SetUniformBitmapSize 2687
+#define wxAuiNotebook_destroy 2688
+#define wxAuiTabArt_SetFlags 2689
+#define wxAuiTabArt_SetMeasuringFont 2690
+#define wxAuiTabArt_SetNormalFont 2691
+#define wxAuiTabArt_SetSelectedFont 2692
+#define wxAuiTabArt_SetColour 2693
+#define wxAuiTabArt_SetActiveColour 2694
+#define wxAuiDockArt_GetColour 2695
+#define wxAuiDockArt_GetFont 2696
+#define wxAuiDockArt_GetMetric 2697
+#define wxAuiDockArt_SetColour 2698
+#define wxAuiDockArt_SetFont 2699
+#define wxAuiDockArt_SetMetric 2700
+#define wxAuiSimpleTabArt_new 2701
+#define wxAuiSimpleTabArt_destroy 2702
+#define wxMDIParentFrame_new_0 2703
+#define wxMDIParentFrame_new_4 2704
+#define wxMDIParentFrame_destruct 2705
+#define wxMDIParentFrame_ActivateNext 2706
+#define wxMDIParentFrame_ActivatePrevious 2707
+#define wxMDIParentFrame_ArrangeIcons 2708
+#define wxMDIParentFrame_Cascade 2709
+#define wxMDIParentFrame_Create 2710
+#define wxMDIParentFrame_GetActiveChild 2711
+#define wxMDIParentFrame_GetClientWindow 2712
+#define wxMDIParentFrame_Tile 2713
+#define wxMDIChildFrame_new_0 2714
+#define wxMDIChildFrame_new_4 2715
+#define wxMDIChildFrame_destruct 2716
+#define wxMDIChildFrame_Activate 2717
+#define wxMDIChildFrame_Create 2718
+#define wxMDIChildFrame_Maximize 2719
+#define wxMDIChildFrame_Restore 2720
+#define wxMDIClientWindow_new_0 2721
+#define wxMDIClientWindow_new_2 2722
+#define wxMDIClientWindow_destruct 2723
+#define wxMDIClientWindow_CreateClient 2724
+#define wxLayoutAlgorithm_new 2725
+#define wxLayoutAlgorithm_LayoutFrame 2726
+#define wxLayoutAlgorithm_LayoutMDIFrame 2727
+#define wxLayoutAlgorithm_LayoutWindow 2728
+#define wxLayoutAlgorithm_destroy 2729
+#define wxEvent_GetId 2730
+#define wxEvent_GetSkipped 2731
+#define wxEvent_GetTimestamp 2732
+#define wxEvent_IsCommandEvent 2733
+#define wxEvent_ResumePropagation 2734
+#define wxEvent_ShouldPropagate 2735
+#define wxEvent_Skip 2736
+#define wxEvent_StopPropagation 2737
+#define wxCommandEvent_getClientData 2738
+#define wxCommandEvent_GetExtraLong 2739
+#define wxCommandEvent_GetInt 2740
+#define wxCommandEvent_GetSelection 2741
+#define wxCommandEvent_GetString 2742
+#define wxCommandEvent_IsChecked 2743
+#define wxCommandEvent_IsSelection 2744
+#define wxCommandEvent_SetInt 2745
+#define wxCommandEvent_SetString 2746
+#define wxScrollEvent_GetOrientation 2747
+#define wxScrollEvent_GetPosition 2748
+#define wxScrollWinEvent_GetOrientation 2749
+#define wxScrollWinEvent_GetPosition 2750
+#define wxMouseEvent_AltDown 2751
+#define wxMouseEvent_Button 2752
+#define wxMouseEvent_ButtonDClick 2753
+#define wxMouseEvent_ButtonDown 2754
+#define wxMouseEvent_ButtonUp 2755
+#define wxMouseEvent_CmdDown 2756
+#define wxMouseEvent_ControlDown 2757
+#define wxMouseEvent_Dragging 2758
+#define wxMouseEvent_Entering 2759
+#define wxMouseEvent_GetButton 2760
+#define wxMouseEvent_GetPosition 2763
+#define wxMouseEvent_GetLogicalPosition 2764
+#define wxMouseEvent_GetLinesPerAction 2765
+#define wxMouseEvent_GetWheelRotation 2766
+#define wxMouseEvent_GetWheelDelta 2767
+#define wxMouseEvent_GetX 2768
+#define wxMouseEvent_GetY 2769
+#define wxMouseEvent_IsButton 2770
+#define wxMouseEvent_IsPageScroll 2771
+#define wxMouseEvent_Leaving 2772
+#define wxMouseEvent_LeftDClick 2773
+#define wxMouseEvent_LeftDown 2774
+#define wxMouseEvent_LeftIsDown 2775
+#define wxMouseEvent_LeftUp 2776
+#define wxMouseEvent_MetaDown 2777
+#define wxMouseEvent_MiddleDClick 2778
+#define wxMouseEvent_MiddleDown 2779
+#define wxMouseEvent_MiddleIsDown 2780
+#define wxMouseEvent_MiddleUp 2781
+#define wxMouseEvent_Moving 2782
+#define wxMouseEvent_RightDClick 2783
+#define wxMouseEvent_RightDown 2784
+#define wxMouseEvent_RightIsDown 2785
+#define wxMouseEvent_RightUp 2786
+#define wxMouseEvent_ShiftDown 2787
+#define wxSetCursorEvent_GetCursor 2788
+#define wxSetCursorEvent_GetX 2789
+#define wxSetCursorEvent_GetY 2790
+#define wxSetCursorEvent_HasCursor 2791
+#define wxSetCursorEvent_SetCursor 2792
+#define wxKeyEvent_AltDown 2793
+#define wxKeyEvent_CmdDown 2794
+#define wxKeyEvent_ControlDown 2795
+#define wxKeyEvent_GetKeyCode 2796
+#define wxKeyEvent_GetModifiers 2797
+#define wxKeyEvent_GetPosition 2800
+#define wxKeyEvent_GetRawKeyCode 2801
+#define wxKeyEvent_GetRawKeyFlags 2802
+#define wxKeyEvent_GetUnicodeKey 2803
+#define wxKeyEvent_GetX 2804
+#define wxKeyEvent_GetY 2805
+#define wxKeyEvent_HasModifiers 2806
+#define wxKeyEvent_MetaDown 2807
+#define wxKeyEvent_ShiftDown 2808
+#define wxSizeEvent_GetSize 2809
+#define wxMoveEvent_GetPosition 2810
+#define wxEraseEvent_GetDC 2811
+#define wxFocusEvent_GetWindow 2812
+#define wxChildFocusEvent_GetWindow 2813
+#define wxMenuEvent_GetMenu 2814
+#define wxMenuEvent_GetMenuId 2815
+#define wxMenuEvent_IsPopup 2816
+#define wxCloseEvent_CanVeto 2817
+#define wxCloseEvent_GetLoggingOff 2818
+#define wxCloseEvent_SetCanVeto 2819
+#define wxCloseEvent_SetLoggingOff 2820
+#define wxCloseEvent_Veto 2821
+#define wxShowEvent_SetShow 2822
+#define wxShowEvent_GetShow 2823
+#define wxIconizeEvent_Iconized 2824
+#define wxJoystickEvent_ButtonDown 2825
+#define wxJoystickEvent_ButtonIsDown 2826
+#define wxJoystickEvent_ButtonUp 2827
+#define wxJoystickEvent_GetButtonChange 2828
+#define wxJoystickEvent_GetButtonState 2829
+#define wxJoystickEvent_GetJoystick 2830
+#define wxJoystickEvent_GetPosition 2831
+#define wxJoystickEvent_GetZPosition 2832
+#define wxJoystickEvent_IsButton 2833
+#define wxJoystickEvent_IsMove 2834
+#define wxJoystickEvent_IsZMove 2835
+#define wxUpdateUIEvent_CanUpdate 2836
+#define wxUpdateUIEvent_Check 2837
+#define wxUpdateUIEvent_Enable 2838
+#define wxUpdateUIEvent_Show 2839
+#define wxUpdateUIEvent_GetChecked 2840
+#define wxUpdateUIEvent_GetEnabled 2841
+#define wxUpdateUIEvent_GetShown 2842
+#define wxUpdateUIEvent_GetSetChecked 2843
+#define wxUpdateUIEvent_GetSetEnabled 2844
+#define wxUpdateUIEvent_GetSetShown 2845
+#define wxUpdateUIEvent_GetSetText 2846
+#define wxUpdateUIEvent_GetText 2847
+#define wxUpdateUIEvent_GetMode 2848
+#define wxUpdateUIEvent_GetUpdateInterval 2849
+#define wxUpdateUIEvent_ResetUpdateTime 2850
+#define wxUpdateUIEvent_SetMode 2851
+#define wxUpdateUIEvent_SetText 2852
+#define wxUpdateUIEvent_SetUpdateInterval 2853
+#define wxMouseCaptureChangedEvent_GetCapturedWindow 2854
+#define wxPaletteChangedEvent_SetChangedWindow 2855
+#define wxPaletteChangedEvent_GetChangedWindow 2856
+#define wxQueryNewPaletteEvent_SetPaletteRealized 2857
+#define wxQueryNewPaletteEvent_GetPaletteRealized 2858
+#define wxNavigationKeyEvent_GetDirection 2859
+#define wxNavigationKeyEvent_SetDirection 2860
+#define wxNavigationKeyEvent_IsWindowChange 2861
+#define wxNavigationKeyEvent_SetWindowChange 2862
+#define wxNavigationKeyEvent_IsFromTab 2863
+#define wxNavigationKeyEvent_SetFromTab 2864
+#define wxNavigationKeyEvent_GetCurrentFocus 2865
+#define wxNavigationKeyEvent_SetCurrentFocus 2866
+#define wxHelpEvent_GetOrigin 2867
+#define wxHelpEvent_GetPosition 2868
+#define wxHelpEvent_SetOrigin 2869
+#define wxHelpEvent_SetPosition 2870
+#define wxContextMenuEvent_GetPosition 2871
+#define wxContextMenuEvent_SetPosition 2872
+#define wxIdleEvent_CanSend 2873
+#define wxIdleEvent_GetMode 2874
+#define wxIdleEvent_RequestMore 2875
+#define wxIdleEvent_MoreRequested 2876
+#define wxIdleEvent_SetMode 2877
+#define wxGridEvent_AltDown 2878
+#define wxGridEvent_ControlDown 2879
+#define wxGridEvent_GetCol 2880
+#define wxGridEvent_GetPosition 2881
+#define wxGridEvent_GetRow 2882
+#define wxGridEvent_MetaDown 2883
+#define wxGridEvent_Selecting 2884
+#define wxGridEvent_ShiftDown 2885
+#define wxNotifyEvent_Allow 2886
+#define wxNotifyEvent_IsAllowed 2887
+#define wxNotifyEvent_Veto 2888
+#define wxSashEvent_GetEdge 2889
+#define wxSashEvent_GetDragRect 2890
+#define wxSashEvent_GetDragStatus 2891
+#define wxListEvent_GetCacheFrom 2892
+#define wxListEvent_GetCacheTo 2893
+#define wxListEvent_GetKeyCode 2894
+#define wxListEvent_GetIndex 2895
+#define wxListEvent_GetColumn 2896
+#define wxListEvent_GetPoint 2897
+#define wxListEvent_GetLabel 2898
+#define wxListEvent_GetText 2899
+#define wxListEvent_GetImage 2900
+#define wxListEvent_GetData 2901
+#define wxListEvent_GetMask 2902
+#define wxListEvent_GetItem 2903
+#define wxListEvent_IsEditCancelled 2904
+#define wxDateEvent_GetDate 2905
+#define wxCalendarEvent_GetWeekDay 2906
+#define wxFileDirPickerEvent_GetPath 2907
+#define wxColourPickerEvent_GetColour 2908
+#define wxFontPickerEvent_GetFont 2909
+#define wxStyledTextEvent_GetPosition 2910
+#define wxStyledTextEvent_GetKey 2911
+#define wxStyledTextEvent_GetModifiers 2912
+#define wxStyledTextEvent_GetModificationType 2913
+#define wxStyledTextEvent_GetText 2914
+#define wxStyledTextEvent_GetLength 2915
+#define wxStyledTextEvent_GetLinesAdded 2916
+#define wxStyledTextEvent_GetLine 2917
+#define wxStyledTextEvent_GetFoldLevelNow 2918
+#define wxStyledTextEvent_GetFoldLevelPrev 2919
+#define wxStyledTextEvent_GetMargin 2920
+#define wxStyledTextEvent_GetMessage 2921
+#define wxStyledTextEvent_GetWParam 2922
+#define wxStyledTextEvent_GetLParam 2923
+#define wxStyledTextEvent_GetListType 2924
+#define wxStyledTextEvent_GetX 2925
+#define wxStyledTextEvent_GetY 2926
+#define wxStyledTextEvent_GetDragText 2927
+#define wxStyledTextEvent_GetDragAllowMove 2928
+#define wxStyledTextEvent_GetDragResult 2929
+#define wxStyledTextEvent_GetShift 2930
+#define wxStyledTextEvent_GetControl 2931
+#define wxStyledTextEvent_GetAlt 2932
+#define utils_wxGetKeyState 2933
+#define utils_wxGetMousePosition 2934
+#define utils_wxGetMouseState 2935
+#define utils_wxSetDetectableAutoRepeat 2936
+#define utils_wxBell 2937
+#define utils_wxFindMenuItemId 2938
+#define utils_wxGenericFindWindowAtPoint 2939
+#define utils_wxFindWindowAtPoint 2940
+#define utils_wxBeginBusyCursor 2941
+#define utils_wxEndBusyCursor 2942
+#define utils_wxIsBusy 2943
+#define utils_wxShutdown 2944
+#define utils_wxShell 2945
+#define utils_wxLaunchDefaultBrowser 2946
+#define utils_wxGetEmailAddress 2947
+#define utils_wxGetUserId 2948
+#define utils_wxGetHomeDir 2949
+#define utils_wxNewId 2950
+#define utils_wxRegisterId 2951
+#define utils_wxGetCurrentId 2952
+#define utils_wxGetOsDescription 2953
+#define utils_wxIsPlatformLittleEndian 2954
+#define utils_wxIsPlatform64Bit 2955
+#define gdicmn_wxDisplaySize 2956
+#define gdicmn_wxSetCursor 2957
+#define wxPrintout_new 2958
+#define wxPrintout_destruct 2959
+#define wxPrintout_GetDC 2960
+#define wxPrintout_GetPageSizeMM 2961
+#define wxPrintout_GetPageSizePixels 2962
+#define wxPrintout_GetPaperRectPixels 2963
+#define wxPrintout_GetPPIPrinter 2964
+#define wxPrintout_GetPPIScreen 2965
+#define wxPrintout_GetTitle 2966
+#define wxPrintout_IsPreview 2967
+#define wxPrintout_FitThisSizeToPaper 2968
+#define wxPrintout_FitThisSizeToPage 2969
+#define wxPrintout_FitThisSizeToPageMargins 2970
+#define wxPrintout_MapScreenSizeToPaper 2971
+#define wxPrintout_MapScreenSizeToPage 2972
+#define wxPrintout_MapScreenSizeToPageMargins 2973
+#define wxPrintout_MapScreenSizeToDevice 2974
+#define wxPrintout_GetLogicalPaperRect 2975
+#define wxPrintout_GetLogicalPageRect 2976
+#define wxPrintout_GetLogicalPageMarginsRect 2977
+#define wxPrintout_SetLogicalOrigin 2978
+#define wxPrintout_OffsetLogicalOrigin 2979
+#define wxStyledTextCtrl_new_2 2980
+#define wxStyledTextCtrl_new_0 2981
+#define wxStyledTextCtrl_destruct 2982
+#define wxStyledTextCtrl_Create 2983
+#define wxStyledTextCtrl_AddText 2984
+#define wxStyledTextCtrl_AddStyledText 2985
+#define wxStyledTextCtrl_InsertText 2986
+#define wxStyledTextCtrl_ClearAll 2987
+#define wxStyledTextCtrl_ClearDocumentStyle 2988
+#define wxStyledTextCtrl_GetLength 2989
+#define wxStyledTextCtrl_GetCharAt 2990
+#define wxStyledTextCtrl_GetCurrentPos 2991
+#define wxStyledTextCtrl_GetAnchor 2992
+#define wxStyledTextCtrl_GetStyleAt 2993
+#define wxStyledTextCtrl_Redo 2994
+#define wxStyledTextCtrl_SetUndoCollection 2995
+#define wxStyledTextCtrl_SelectAll 2996
+#define wxStyledTextCtrl_SetSavePoint 2997
+#define wxStyledTextCtrl_GetStyledText 2998
+#define wxStyledTextCtrl_CanRedo 2999
+#define wxStyledTextCtrl_MarkerLineFromHandle 3000
+#define wxStyledTextCtrl_MarkerDeleteHandle 3001
+#define wxStyledTextCtrl_GetUndoCollection 3002
+#define wxStyledTextCtrl_GetViewWhiteSpace 3003
+#define wxStyledTextCtrl_SetViewWhiteSpace 3004
+#define wxStyledTextCtrl_PositionFromPoint 3005
+#define wxStyledTextCtrl_PositionFromPointClose 3006
+#define wxStyledTextCtrl_GotoLine 3007
+#define wxStyledTextCtrl_GotoPos 3008
+#define wxStyledTextCtrl_SetAnchor 3009
+#define wxStyledTextCtrl_GetCurLine 3010
+#define wxStyledTextCtrl_GetEndStyled 3011
+#define wxStyledTextCtrl_ConvertEOLs 3012
+#define wxStyledTextCtrl_GetEOLMode 3013
+#define wxStyledTextCtrl_SetEOLMode 3014
+#define wxStyledTextCtrl_StartStyling 3015
+#define wxStyledTextCtrl_SetStyling 3016
+#define wxStyledTextCtrl_GetBufferedDraw 3017
+#define wxStyledTextCtrl_SetBufferedDraw 3018
+#define wxStyledTextCtrl_SetTabWidth 3019
+#define wxStyledTextCtrl_GetTabWidth 3020
+#define wxStyledTextCtrl_SetCodePage 3021
+#define wxStyledTextCtrl_MarkerDefine 3022
+#define wxStyledTextCtrl_MarkerSetForeground 3023
+#define wxStyledTextCtrl_MarkerSetBackground 3024
+#define wxStyledTextCtrl_MarkerAdd 3025
+#define wxStyledTextCtrl_MarkerDelete 3026
+#define wxStyledTextCtrl_MarkerDeleteAll 3027
+#define wxStyledTextCtrl_MarkerGet 3028
+#define wxStyledTextCtrl_MarkerNext 3029
+#define wxStyledTextCtrl_MarkerPrevious 3030
+#define wxStyledTextCtrl_MarkerDefineBitmap 3031
+#define wxStyledTextCtrl_MarkerAddSet 3032
+#define wxStyledTextCtrl_MarkerSetAlpha 3033
+#define wxStyledTextCtrl_SetMarginType 3034
+#define wxStyledTextCtrl_GetMarginType 3035
+#define wxStyledTextCtrl_SetMarginWidth 3036
+#define wxStyledTextCtrl_GetMarginWidth 3037
+#define wxStyledTextCtrl_SetMarginMask 3038
+#define wxStyledTextCtrl_GetMarginMask 3039
+#define wxStyledTextCtrl_SetMarginSensitive 3040
+#define wxStyledTextCtrl_GetMarginSensitive 3041
+#define wxStyledTextCtrl_StyleClearAll 3042
+#define wxStyledTextCtrl_StyleSetForeground 3043
+#define wxStyledTextCtrl_StyleSetBackground 3044
+#define wxStyledTextCtrl_StyleSetBold 3045
+#define wxStyledTextCtrl_StyleSetItalic 3046
+#define wxStyledTextCtrl_StyleSetSize 3047
+#define wxStyledTextCtrl_StyleSetFaceName 3048
+#define wxStyledTextCtrl_StyleSetEOLFilled 3049
+#define wxStyledTextCtrl_StyleResetDefault 3050
+#define wxStyledTextCtrl_StyleSetUnderline 3051
+#define wxStyledTextCtrl_StyleSetCase 3052
+#define wxStyledTextCtrl_StyleSetHotSpot 3053
+#define wxStyledTextCtrl_SetSelForeground 3054
+#define wxStyledTextCtrl_SetSelBackground 3055
+#define wxStyledTextCtrl_GetSelAlpha 3056
+#define wxStyledTextCtrl_SetSelAlpha 3057
+#define wxStyledTextCtrl_SetCaretForeground 3058
+#define wxStyledTextCtrl_CmdKeyAssign 3059
+#define wxStyledTextCtrl_CmdKeyClear 3060
+#define wxStyledTextCtrl_CmdKeyClearAll 3061
+#define wxStyledTextCtrl_SetStyleBytes 3062
+#define wxStyledTextCtrl_StyleSetVisible 3063
+#define wxStyledTextCtrl_GetCaretPeriod 3064
+#define wxStyledTextCtrl_SetCaretPeriod 3065
+#define wxStyledTextCtrl_SetWordChars 3066
+#define wxStyledTextCtrl_BeginUndoAction 3067
+#define wxStyledTextCtrl_EndUndoAction 3068
+#define wxStyledTextCtrl_IndicatorSetStyle 3069
+#define wxStyledTextCtrl_IndicatorGetStyle 3070
+#define wxStyledTextCtrl_IndicatorSetForeground 3071
+#define wxStyledTextCtrl_IndicatorGetForeground 3072
+#define wxStyledTextCtrl_SetWhitespaceForeground 3073
+#define wxStyledTextCtrl_SetWhitespaceBackground 3074
+#define wxStyledTextCtrl_GetStyleBits 3075
+#define wxStyledTextCtrl_SetLineState 3076
+#define wxStyledTextCtrl_GetLineState 3077
+#define wxStyledTextCtrl_GetMaxLineState 3078
+#define wxStyledTextCtrl_GetCaretLineVisible 3079
+#define wxStyledTextCtrl_SetCaretLineVisible 3080
+#define wxStyledTextCtrl_GetCaretLineBackground 3081
+#define wxStyledTextCtrl_SetCaretLineBackground 3082
+#define wxStyledTextCtrl_AutoCompShow 3083
+#define wxStyledTextCtrl_AutoCompCancel 3084
+#define wxStyledTextCtrl_AutoCompActive 3085
+#define wxStyledTextCtrl_AutoCompPosStart 3086
+#define wxStyledTextCtrl_AutoCompComplete 3087
+#define wxStyledTextCtrl_AutoCompStops 3088
+#define wxStyledTextCtrl_AutoCompSetSeparator 3089
+#define wxStyledTextCtrl_AutoCompGetSeparator 3090
+#define wxStyledTextCtrl_AutoCompSelect 3091
+#define wxStyledTextCtrl_AutoCompSetCancelAtStart 3092
+#define wxStyledTextCtrl_AutoCompGetCancelAtStart 3093
+#define wxStyledTextCtrl_AutoCompSetFillUps 3094
+#define wxStyledTextCtrl_AutoCompSetChooseSingle 3095
+#define wxStyledTextCtrl_AutoCompGetChooseSingle 3096
+#define wxStyledTextCtrl_AutoCompSetIgnoreCase 3097
+#define wxStyledTextCtrl_AutoCompGetIgnoreCase 3098
+#define wxStyledTextCtrl_UserListShow 3099
+#define wxStyledTextCtrl_AutoCompSetAutoHide 3100
+#define wxStyledTextCtrl_AutoCompGetAutoHide 3101
+#define wxStyledTextCtrl_AutoCompSetDropRestOfWord 3102
+#define wxStyledTextCtrl_AutoCompGetDropRestOfWord 3103
+#define wxStyledTextCtrl_RegisterImage 3104
+#define wxStyledTextCtrl_ClearRegisteredImages 3105
+#define wxStyledTextCtrl_AutoCompGetTypeSeparator 3106
+#define wxStyledTextCtrl_AutoCompSetTypeSeparator 3107
+#define wxStyledTextCtrl_AutoCompSetMaxWidth 3108
+#define wxStyledTextCtrl_AutoCompGetMaxWidth 3109
+#define wxStyledTextCtrl_AutoCompSetMaxHeight 3110
+#define wxStyledTextCtrl_AutoCompGetMaxHeight 3111
+#define wxStyledTextCtrl_SetIndent 3112
+#define wxStyledTextCtrl_GetIndent 3113
+#define wxStyledTextCtrl_SetUseTabs 3114
+#define wxStyledTextCtrl_GetUseTabs 3115
+#define wxStyledTextCtrl_SetLineIndentation 3116
+#define wxStyledTextCtrl_GetLineIndentation 3117
+#define wxStyledTextCtrl_GetLineIndentPosition 3118
+#define wxStyledTextCtrl_GetColumn 3119
+#define wxStyledTextCtrl_SetUseHorizontalScrollBar 3120
+#define wxStyledTextCtrl_GetUseHorizontalScrollBar 3121
+#define wxStyledTextCtrl_SetIndentationGuides 3122
+#define wxStyledTextCtrl_GetIndentationGuides 3123
+#define wxStyledTextCtrl_SetHighlightGuide 3124
+#define wxStyledTextCtrl_GetHighlightGuide 3125
+#define wxStyledTextCtrl_GetLineEndPosition 3126
+#define wxStyledTextCtrl_GetCodePage 3127
+#define wxStyledTextCtrl_GetCaretForeground 3128
+#define wxStyledTextCtrl_GetReadOnly 3129
+#define wxStyledTextCtrl_SetCurrentPos 3130
+#define wxStyledTextCtrl_SetSelectionStart 3131
+#define wxStyledTextCtrl_GetSelectionStart 3132
+#define wxStyledTextCtrl_SetSelectionEnd 3133
+#define wxStyledTextCtrl_GetSelectionEnd 3134
+#define wxStyledTextCtrl_SetPrintMagnification 3135
+#define wxStyledTextCtrl_GetPrintMagnification 3136
+#define wxStyledTextCtrl_SetPrintColourMode 3137
+#define wxStyledTextCtrl_GetPrintColourMode 3138
+#define wxStyledTextCtrl_FindText 3139
+#define wxStyledTextCtrl_FormatRange 3140
+#define wxStyledTextCtrl_GetFirstVisibleLine 3141
+#define wxStyledTextCtrl_GetLine 3142
+#define wxStyledTextCtrl_GetLineCount 3143
+#define wxStyledTextCtrl_SetMarginLeft 3144
+#define wxStyledTextCtrl_GetMarginLeft 3145
+#define wxStyledTextCtrl_SetMarginRight 3146
+#define wxStyledTextCtrl_GetMarginRight 3147
+#define wxStyledTextCtrl_GetModify 3148
+#define wxStyledTextCtrl_SetSelection 3149
+#define wxStyledTextCtrl_GetSelectedText 3150
+#define wxStyledTextCtrl_GetTextRange 3151
+#define wxStyledTextCtrl_HideSelection 3152
+#define wxStyledTextCtrl_LineFromPosition 3153
+#define wxStyledTextCtrl_PositionFromLine 3154
+#define wxStyledTextCtrl_LineScroll 3155
+#define wxStyledTextCtrl_EnsureCaretVisible 3156
+#define wxStyledTextCtrl_ReplaceSelection 3157
+#define wxStyledTextCtrl_SetReadOnly 3158
+#define wxStyledTextCtrl_CanPaste 3159
+#define wxStyledTextCtrl_CanUndo 3160
+#define wxStyledTextCtrl_EmptyUndoBuffer 3161
+#define wxStyledTextCtrl_Undo 3162
+#define wxStyledTextCtrl_Cut 3163
+#define wxStyledTextCtrl_Copy 3164
+#define wxStyledTextCtrl_Paste 3165
+#define wxStyledTextCtrl_Clear 3166
+#define wxStyledTextCtrl_SetText 3167
+#define wxStyledTextCtrl_GetText 3168
+#define wxStyledTextCtrl_GetTextLength 3169
+#define wxStyledTextCtrl_GetOvertype 3170
+#define wxStyledTextCtrl_SetCaretWidth 3171
+#define wxStyledTextCtrl_GetCaretWidth 3172
+#define wxStyledTextCtrl_SetTargetStart 3173
+#define wxStyledTextCtrl_GetTargetStart 3174
+#define wxStyledTextCtrl_SetTargetEnd 3175
+#define wxStyledTextCtrl_GetTargetEnd 3176
+#define wxStyledTextCtrl_ReplaceTarget 3177
+#define wxStyledTextCtrl_SearchInTarget 3178
+#define wxStyledTextCtrl_SetSearchFlags 3179
+#define wxStyledTextCtrl_GetSearchFlags 3180
+#define wxStyledTextCtrl_CallTipShow 3181
+#define wxStyledTextCtrl_CallTipCancel 3182
+#define wxStyledTextCtrl_CallTipActive 3183
+#define wxStyledTextCtrl_CallTipPosAtStart 3184
+#define wxStyledTextCtrl_CallTipSetHighlight 3185
+#define wxStyledTextCtrl_CallTipSetBackground 3186
+#define wxStyledTextCtrl_CallTipSetForeground 3187
+#define wxStyledTextCtrl_CallTipSetForegroundHighlight 3188
+#define wxStyledTextCtrl_CallTipUseStyle 3189
+#define wxStyledTextCtrl_VisibleFromDocLine 3190
+#define wxStyledTextCtrl_DocLineFromVisible 3191
+#define wxStyledTextCtrl_WrapCount 3192
+#define wxStyledTextCtrl_SetFoldLevel 3193
+#define wxStyledTextCtrl_GetFoldLevel 3194
+#define wxStyledTextCtrl_GetLastChild 3195
+#define wxStyledTextCtrl_GetFoldParent 3196
+#define wxStyledTextCtrl_ShowLines 3197
+#define wxStyledTextCtrl_HideLines 3198
+#define wxStyledTextCtrl_GetLineVisible 3199
+#define wxStyledTextCtrl_SetFoldExpanded 3200
+#define wxStyledTextCtrl_GetFoldExpanded 3201
+#define wxStyledTextCtrl_ToggleFold 3202
+#define wxStyledTextCtrl_EnsureVisible 3203
+#define wxStyledTextCtrl_SetFoldFlags 3204
+#define wxStyledTextCtrl_EnsureVisibleEnforcePolicy 3205
+#define wxStyledTextCtrl_SetTabIndents 3206
+#define wxStyledTextCtrl_GetTabIndents 3207
+#define wxStyledTextCtrl_SetBackSpaceUnIndents 3208
+#define wxStyledTextCtrl_GetBackSpaceUnIndents 3209
+#define wxStyledTextCtrl_SetMouseDwellTime 3210
+#define wxStyledTextCtrl_GetMouseDwellTime 3211
+#define wxStyledTextCtrl_WordStartPosition 3212
+#define wxStyledTextCtrl_WordEndPosition 3213
+#define wxStyledTextCtrl_SetWrapMode 3214
+#define wxStyledTextCtrl_GetWrapMode 3215
+#define wxStyledTextCtrl_SetWrapVisualFlags 3216
+#define wxStyledTextCtrl_GetWrapVisualFlags 3217
+#define wxStyledTextCtrl_SetWrapVisualFlagsLocation 3218
+#define wxStyledTextCtrl_GetWrapVisualFlagsLocation 3219
+#define wxStyledTextCtrl_SetWrapStartIndent 3220
+#define wxStyledTextCtrl_GetWrapStartIndent 3221
+#define wxStyledTextCtrl_SetLayoutCache 3222
+#define wxStyledTextCtrl_GetLayoutCache 3223
+#define wxStyledTextCtrl_SetScrollWidth 3224
+#define wxStyledTextCtrl_GetScrollWidth 3225
+#define wxStyledTextCtrl_TextWidth 3226
+#define wxStyledTextCtrl_GetEndAtLastLine 3227
+#define wxStyledTextCtrl_TextHeight 3228
+#define wxStyledTextCtrl_SetUseVerticalScrollBar 3229
+#define wxStyledTextCtrl_GetUseVerticalScrollBar 3230
+#define wxStyledTextCtrl_AppendText 3231
+#define wxStyledTextCtrl_GetTwoPhaseDraw 3232
+#define wxStyledTextCtrl_SetTwoPhaseDraw 3233
+#define wxStyledTextCtrl_TargetFromSelection 3234
+#define wxStyledTextCtrl_LinesJoin 3235
+#define wxStyledTextCtrl_LinesSplit 3236
+#define wxStyledTextCtrl_SetFoldMarginColour 3237
+#define wxStyledTextCtrl_SetFoldMarginHiColour 3238
+#define wxStyledTextCtrl_LineDown 3239
+#define wxStyledTextCtrl_LineDownExtend 3240
+#define wxStyledTextCtrl_LineUp 3241
+#define wxStyledTextCtrl_LineUpExtend 3242
+#define wxStyledTextCtrl_CharLeft 3243
+#define wxStyledTextCtrl_CharLeftExtend 3244
+#define wxStyledTextCtrl_CharRight 3245
+#define wxStyledTextCtrl_CharRightExtend 3246
+#define wxStyledTextCtrl_WordLeft 3247
+#define wxStyledTextCtrl_WordLeftExtend 3248
+#define wxStyledTextCtrl_WordRight 3249
+#define wxStyledTextCtrl_WordRightExtend 3250
+#define wxStyledTextCtrl_Home 3251
+#define wxStyledTextCtrl_HomeExtend 3252
+#define wxStyledTextCtrl_LineEnd 3253
+#define wxStyledTextCtrl_LineEndExtend 3254
+#define wxStyledTextCtrl_DocumentStart 3255
+#define wxStyledTextCtrl_DocumentStartExtend 3256
+#define wxStyledTextCtrl_DocumentEnd 3257
+#define wxStyledTextCtrl_DocumentEndExtend 3258
+#define wxStyledTextCtrl_PageUp 3259
+#define wxStyledTextCtrl_PageUpExtend 3260
+#define wxStyledTextCtrl_PageDown 3261
+#define wxStyledTextCtrl_PageDownExtend 3262
+#define wxStyledTextCtrl_EditToggleOvertype 3263
+#define wxStyledTextCtrl_Cancel 3264
+#define wxStyledTextCtrl_DeleteBack 3265
+#define wxStyledTextCtrl_Tab 3266
+#define wxStyledTextCtrl_BackTab 3267
+#define wxStyledTextCtrl_NewLine 3268
+#define wxStyledTextCtrl_FormFeed 3269
+#define wxStyledTextCtrl_VCHome 3270
+#define wxStyledTextCtrl_VCHomeExtend 3271
+#define wxStyledTextCtrl_ZoomIn 3272
+#define wxStyledTextCtrl_ZoomOut 3273
+#define wxStyledTextCtrl_DelWordLeft 3274
+#define wxStyledTextCtrl_DelWordRight 3275
+#define wxStyledTextCtrl_LineCut 3276
+#define wxStyledTextCtrl_LineDelete 3277
+#define wxStyledTextCtrl_LineTranspose 3278
+#define wxStyledTextCtrl_LineDuplicate 3279
+#define wxStyledTextCtrl_LowerCase 3280
+#define wxStyledTextCtrl_UpperCase 3281
+#define wxStyledTextCtrl_LineScrollDown 3282
+#define wxStyledTextCtrl_LineScrollUp 3283
+#define wxStyledTextCtrl_DeleteBackNotLine 3284
+#define wxStyledTextCtrl_HomeDisplay 3285
+#define wxStyledTextCtrl_HomeDisplayExtend 3286
+#define wxStyledTextCtrl_LineEndDisplay 3287
+#define wxStyledTextCtrl_LineEndDisplayExtend 3288
+#define wxStyledTextCtrl_HomeWrapExtend 3289
+#define wxStyledTextCtrl_LineEndWrap 3290
+#define wxStyledTextCtrl_LineEndWrapExtend 3291
+#define wxStyledTextCtrl_VCHomeWrap 3292
+#define wxStyledTextCtrl_VCHomeWrapExtend 3293
+#define wxStyledTextCtrl_LineCopy 3294
+#define wxStyledTextCtrl_MoveCaretInsideView 3295
+#define wxStyledTextCtrl_LineLength 3296
+#define wxStyledTextCtrl_BraceHighlight 3297
+#define wxStyledTextCtrl_BraceBadLight 3298
+#define wxStyledTextCtrl_BraceMatch 3299
+#define wxStyledTextCtrl_GetViewEOL 3300
+#define wxStyledTextCtrl_SetViewEOL 3301
+#define wxStyledTextCtrl_SetModEventMask 3302
+#define wxStyledTextCtrl_GetEdgeColumn 3303
+#define wxStyledTextCtrl_SetEdgeColumn 3304
+#define wxStyledTextCtrl_SetEdgeMode 3305
+#define wxStyledTextCtrl_GetEdgeMode 3306
+#define wxStyledTextCtrl_GetEdgeColour 3307
+#define wxStyledTextCtrl_SetEdgeColour 3308
+#define wxStyledTextCtrl_SearchAnchor 3309
+#define wxStyledTextCtrl_SearchNext 3310
+#define wxStyledTextCtrl_SearchPrev 3311
+#define wxStyledTextCtrl_LinesOnScreen 3312
+#define wxStyledTextCtrl_UsePopUp 3313
+#define wxStyledTextCtrl_SelectionIsRectangle 3314
+#define wxStyledTextCtrl_SetZoom 3315
+#define wxStyledTextCtrl_GetZoom 3316
+#define wxStyledTextCtrl_GetModEventMask 3317
+#define wxStyledTextCtrl_SetSTCFocus 3318
+#define wxStyledTextCtrl_GetSTCFocus 3319
+#define wxStyledTextCtrl_SetStatus 3320
+#define wxStyledTextCtrl_GetStatus 3321
+#define wxStyledTextCtrl_SetMouseDownCaptures 3322
+#define wxStyledTextCtrl_GetMouseDownCaptures 3323
+#define wxStyledTextCtrl_SetSTCCursor 3324
+#define wxStyledTextCtrl_GetSTCCursor 3325
+#define wxStyledTextCtrl_SetControlCharSymbol 3326
+#define wxStyledTextCtrl_GetControlCharSymbol 3327
+#define wxStyledTextCtrl_WordPartLeft 3328
+#define wxStyledTextCtrl_WordPartLeftExtend 3329
+#define wxStyledTextCtrl_WordPartRight 3330
+#define wxStyledTextCtrl_WordPartRightExtend 3331
+#define wxStyledTextCtrl_SetVisiblePolicy 3332
+#define wxStyledTextCtrl_DelLineLeft 3333
+#define wxStyledTextCtrl_DelLineRight 3334
+#define wxStyledTextCtrl_GetXOffset 3335
+#define wxStyledTextCtrl_ChooseCaretX 3336
+#define wxStyledTextCtrl_SetXCaretPolicy 3337
+#define wxStyledTextCtrl_SetYCaretPolicy 3338
+#define wxStyledTextCtrl_GetPrintWrapMode 3339
+#define wxStyledTextCtrl_SetHotspotActiveForeground 3340
+#define wxStyledTextCtrl_SetHotspotActiveBackground 3341
+#define wxStyledTextCtrl_SetHotspotActiveUnderline 3342
+#define wxStyledTextCtrl_SetHotspotSingleLine 3343
+#define wxStyledTextCtrl_ParaDownExtend 3344
+#define wxStyledTextCtrl_ParaUp 3345
+#define wxStyledTextCtrl_ParaUpExtend 3346
+#define wxStyledTextCtrl_PositionBefore 3347
+#define wxStyledTextCtrl_PositionAfter 3348
+#define wxStyledTextCtrl_CopyRange 3349
+#define wxStyledTextCtrl_CopyText 3350
+#define wxStyledTextCtrl_SetSelectionMode 3351
+#define wxStyledTextCtrl_GetSelectionMode 3352
+#define wxStyledTextCtrl_LineDownRectExtend 3353
+#define wxStyledTextCtrl_LineUpRectExtend 3354
+#define wxStyledTextCtrl_CharLeftRectExtend 3355
+#define wxStyledTextCtrl_CharRightRectExtend 3356
+#define wxStyledTextCtrl_HomeRectExtend 3357
+#define wxStyledTextCtrl_VCHomeRectExtend 3358
+#define wxStyledTextCtrl_LineEndRectExtend 3359
+#define wxStyledTextCtrl_PageUpRectExtend 3360
+#define wxStyledTextCtrl_PageDownRectExtend 3361
+#define wxStyledTextCtrl_StutteredPageUp 3362
+#define wxStyledTextCtrl_StutteredPageUpExtend 3363
+#define wxStyledTextCtrl_StutteredPageDown 3364
+#define wxStyledTextCtrl_StutteredPageDownExtend 3365
+#define wxStyledTextCtrl_WordLeftEnd 3366
+#define wxStyledTextCtrl_WordLeftEndExtend 3367
+#define wxStyledTextCtrl_WordRightEnd 3368
+#define wxStyledTextCtrl_WordRightEndExtend 3369
+#define wxStyledTextCtrl_SetWhitespaceChars 3370
+#define wxStyledTextCtrl_SetCharsDefault 3371
+#define wxStyledTextCtrl_AutoCompGetCurrent 3372
+#define wxStyledTextCtrl_Allocate 3373
+#define wxStyledTextCtrl_FindColumn 3374
+#define wxStyledTextCtrl_GetCaretSticky 3375
+#define wxStyledTextCtrl_SetCaretSticky 3376
+#define wxStyledTextCtrl_ToggleCaretSticky 3377
+#define wxStyledTextCtrl_SetPasteConvertEndings 3378
+#define wxStyledTextCtrl_GetPasteConvertEndings 3379
+#define wxStyledTextCtrl_SelectionDuplicate 3380
+#define wxStyledTextCtrl_SetCaretLineBackAlpha 3381
+#define wxStyledTextCtrl_GetCaretLineBackAlpha 3382
+#define wxStyledTextCtrl_StartRecord 3383
+#define wxStyledTextCtrl_StopRecord 3384
+#define wxStyledTextCtrl_SetLexer 3385
+#define wxStyledTextCtrl_GetLexer 3386
+#define wxStyledTextCtrl_Colourise 3387
+#define wxStyledTextCtrl_SetProperty 3388
+#define wxStyledTextCtrl_SetKeyWords 3389
+#define wxStyledTextCtrl_SetLexerLanguage 3390
+#define wxStyledTextCtrl_GetProperty 3391
+#define wxStyledTextCtrl_GetStyleBitsNeeded 3392
+#define wxStyledTextCtrl_GetCurrentLine 3393
+#define wxStyledTextCtrl_StyleSetSpec 3394
+#define wxStyledTextCtrl_StyleSetFont 3395
+#define wxStyledTextCtrl_StyleSetFontAttr 3396
+#define wxStyledTextCtrl_StyleSetCharacterSet 3397
+#define wxStyledTextCtrl_StyleSetFontEncoding 3398
+#define wxStyledTextCtrl_CmdKeyExecute 3399
+#define wxStyledTextCtrl_SetMargins 3400
+#define wxStyledTextCtrl_GetSelection 3401
+#define wxStyledTextCtrl_PointFromPosition 3402
+#define wxStyledTextCtrl_ScrollToLine 3403
+#define wxStyledTextCtrl_ScrollToColumn 3404
+#define wxStyledTextCtrl_SetVScrollBar 3405
+#define wxStyledTextCtrl_SetHScrollBar 3406
+#define wxStyledTextCtrl_GetLastKeydownProcessed 3407
+#define wxStyledTextCtrl_SetLastKeydownProcessed 3408
+#define wxStyledTextCtrl_SaveFile 3409
+#define wxStyledTextCtrl_LoadFile 3410
+#define wxStyledTextCtrl_DoDragOver 3411
+#define wxStyledTextCtrl_DoDropText 3412
+#define wxStyledTextCtrl_GetUseAntiAliasing 3413
+#define wxStyledTextCtrl_AddTextRaw 3414
+#define wxStyledTextCtrl_InsertTextRaw 3415
+#define wxStyledTextCtrl_GetCurLineRaw 3416
+#define wxStyledTextCtrl_GetLineRaw 3417
+#define wxStyledTextCtrl_GetSelectedTextRaw 3418
+#define wxStyledTextCtrl_GetTextRangeRaw 3419
+#define wxStyledTextCtrl_SetTextRaw 3420
+#define wxStyledTextCtrl_GetTextRaw 3421
+#define wxStyledTextCtrl_AppendTextRaw 3422
+#define wxArtProvider_GetBitmap 3423
+#define wxArtProvider_GetIcon 3424
+#define wxTreeEvent_GetKeyCode 3425
+#define wxTreeEvent_GetItem 3426
+#define wxTreeEvent_GetKeyEvent 3427
+#define wxTreeEvent_GetLabel 3428
+#define wxTreeEvent_GetOldItem 3429
+#define wxTreeEvent_GetPoint 3430
+#define wxTreeEvent_IsEditCancelled 3431
+#define wxTreeEvent_SetToolTip 3432
+#define wxNotebookEvent_GetOldSelection 3433
+#define wxNotebookEvent_GetSelection 3434
+#define wxNotebookEvent_SetOldSelection 3435
+#define wxNotebookEvent_SetSelection 3436
+#define wxFileDataObject_new 3437
+#define wxFileDataObject_AddFile 3438
+#define wxFileDataObject_GetFilenames 3439
+#define wxFileDataObject_destroy 3440
+#define wxTextDataObject_new 3441
+#define wxTextDataObject_GetTextLength 3442
+#define wxTextDataObject_GetText 3443
+#define wxTextDataObject_SetText 3444
+#define wxTextDataObject_destroy 3445
+#define wxBitmapDataObject_new_1_1 3446
+#define wxBitmapDataObject_new_1_0 3447
+#define wxBitmapDataObject_GetBitmap 3448
+#define wxBitmapDataObject_SetBitmap 3449
+#define wxBitmapDataObject_destroy 3450
+#define wxClipboard_new 3452
+#define wxClipboard_destruct 3453
+#define wxClipboard_AddData 3454
+#define wxClipboard_Clear 3455
+#define wxClipboard_Close 3456
+#define wxClipboard_Flush 3457
+#define wxClipboard_GetData 3458
+#define wxClipboard_IsOpened 3459
+#define wxClipboard_Open 3460
+#define wxClipboard_SetData 3461
+#define wxClipboard_UsePrimarySelection 3463
+#define wxClipboard_IsSupported 3464
+#define wxClipboard_Get 3465
+#define wxSpinEvent_GetPosition 3466
+#define wxSpinEvent_SetPosition 3467
+#define wxSplitterWindow_new_0 3468
+#define wxSplitterWindow_new_2 3469
+#define wxSplitterWindow_destruct 3470
+#define wxSplitterWindow_Create 3471
+#define wxSplitterWindow_GetMinimumPaneSize 3472
+#define wxSplitterWindow_GetSashGravity 3473
+#define wxSplitterWindow_GetSashPosition 3474
+#define wxSplitterWindow_GetSplitMode 3475
+#define wxSplitterWindow_GetWindow1 3476
+#define wxSplitterWindow_GetWindow2 3477
+#define wxSplitterWindow_Initialize 3478
+#define wxSplitterWindow_IsSplit 3479
+#define wxSplitterWindow_ReplaceWindow 3480
+#define wxSplitterWindow_SetSashGravity 3481
+#define wxSplitterWindow_SetSashPosition 3482
+#define wxSplitterWindow_SetSashSize 3483
+#define wxSplitterWindow_SetMinimumPaneSize 3484
+#define wxSplitterWindow_SetSplitMode 3485
+#define wxSplitterWindow_SplitHorizontally 3486
+#define wxSplitterWindow_SplitVertically 3487
+#define wxSplitterWindow_Unsplit 3488
+#define wxSplitterWindow_UpdateSize 3489
+#define wxSplitterEvent_GetSashPosition 3490
+#define wxSplitterEvent_GetX 3491
+#define wxSplitterEvent_GetY 3492
+#define wxSplitterEvent_GetWindowBeingRemoved 3493
+#define wxSplitterEvent_SetSashPosition 3494
+#define wxHtmlWindow_new_0 3495
+#define wxHtmlWindow_new_2 3496
+#define wxHtmlWindow_AppendToPage 3497
+#define wxHtmlWindow_GetOpenedAnchor 3498
+#define wxHtmlWindow_GetOpenedPage 3499
+#define wxHtmlWindow_GetOpenedPageTitle 3500
+#define wxHtmlWindow_GetRelatedFrame 3501
+#define wxHtmlWindow_HistoryBack 3502
+#define wxHtmlWindow_HistoryCanBack 3503
+#define wxHtmlWindow_HistoryCanForward 3504
+#define wxHtmlWindow_HistoryClear 3505
+#define wxHtmlWindow_HistoryForward 3506
+#define wxHtmlWindow_LoadFile 3507
+#define wxHtmlWindow_LoadPage 3508
+#define wxHtmlWindow_SelectAll 3509
+#define wxHtmlWindow_SelectionToText 3510
+#define wxHtmlWindow_SelectLine 3511
+#define wxHtmlWindow_SelectWord 3512
+#define wxHtmlWindow_SetBorders 3513
+#define wxHtmlWindow_SetFonts 3514
+#define wxHtmlWindow_SetPage 3515
+#define wxHtmlWindow_SetRelatedFrame 3516
+#define wxHtmlWindow_SetRelatedStatusBar 3517
+#define wxHtmlWindow_ToText 3518
+#define wxHtmlWindow_destroy 3519
+#define wxHtmlLinkEvent_GetLinkInfo 3520
+#define wxSystemSettings_GetColour 3521
+#define wxSystemSettings_GetFont 3522
+#define wxSystemSettings_GetMetric 3523
+#define wxSystemSettings_GetScreenType 3524
+#define wxSystemOptions_GetOption 3525
+#define wxSystemOptions_GetOptionInt 3526
+#define wxSystemOptions_HasOption 3527
+#define wxSystemOptions_IsFalse 3528
+#define wxSystemOptions_SetOption_2_1 3529
+#define wxSystemOptions_SetOption_2_0 3530
+#define wxAuiNotebookEvent_SetSelection 3531
+#define wxAuiNotebookEvent_GetSelection 3532
+#define wxAuiNotebookEvent_SetOldSelection 3533
+#define wxAuiNotebookEvent_GetOldSelection 3534
+#define wxAuiNotebookEvent_SetDragSource 3535
+#define wxAuiNotebookEvent_GetDragSource 3536
+#define wxAuiManagerEvent_SetManager 3537
+#define wxAuiManagerEvent_GetManager 3538
+#define wxAuiManagerEvent_SetPane 3539
+#define wxAuiManagerEvent_GetPane 3540
+#define wxAuiManagerEvent_SetButton 3541
+#define wxAuiManagerEvent_GetButton 3542
+#define wxAuiManagerEvent_SetDC 3543
+#define wxAuiManagerEvent_GetDC 3544
+#define wxAuiManagerEvent_Veto 3545
+#define wxAuiManagerEvent_GetVeto 3546
+#define wxAuiManagerEvent_SetCanVeto 3547
+#define wxAuiManagerEvent_CanVeto 3548
+#define wxLogNull_new 3549
+#define wxLogNull_destroy 3550
+#define wxTaskBarIcon_new 3551
+#define wxTaskBarIcon_destruct 3552
+#define wxTaskBarIcon_PopupMenu 3553
+#define wxTaskBarIcon_RemoveIcon 3554
+#define wxTaskBarIcon_SetIcon 3555
+#define wxLocale_new_0 3556
+#define wxLocale_new_2 3558
+#define wxLocale_destruct 3559
+#define wxLocale_Init 3561
+#define wxLocale_AddCatalog_1 3562
+#define wxLocale_AddCatalog_3 3563
+#define wxLocale_AddCatalogLookupPathPrefix 3564
+#define wxLocale_GetCanonicalName 3565
+#define wxLocale_GetLanguage 3566
+#define wxLocale_GetLanguageName 3567
+#define wxLocale_GetLocale 3568
+#define wxLocale_GetName 3569
+#define wxLocale_GetString_2 3570
+#define wxLocale_GetString_4 3571
+#define wxLocale_GetHeaderValue 3572
+#define wxLocale_GetSysName 3573
+#define wxLocale_GetSystemEncoding 3574
+#define wxLocale_GetSystemEncodingName 3575
+#define wxLocale_GetSystemLanguage 3576
+#define wxLocale_IsLoaded 3577
+#define wxLocale_IsOk 3578
+#define wxActivateEvent_GetActive 3579
+#define wxPopupWindow_new_2 3581
+#define wxPopupWindow_new_0 3582
+#define wxPopupWindow_destruct 3584
+#define wxPopupWindow_Create 3585
+#define wxPopupWindow_Position 3586
+#define wxPopupTransientWindow_new_0 3587
+#define wxPopupTransientWindow_new_2 3588
+#define wxPopupTransientWindow_destruct 3589
+#define wxPopupTransientWindow_Popup 3590
+#define wxPopupTransientWindow_Dismiss 3591
+#define wxOverlay_new 3592
+#define wxOverlay_destruct 3593
+#define wxOverlay_Reset 3594
+#define wxDCOverlay_new_6 3595
+#define wxDCOverlay_new_2 3596
+#define wxDCOverlay_destruct 3597
+#define wxDCOverlay_Clear 3598
diff --git a/lib/wx/c_src/wxe_driver.c b/lib/wx/c_src/wxe_driver.c
index eb7d7dcaeb..6f027ea25b 100644
--- a/lib/wx/c_src/wxe_driver.c
+++ b/lib/wx/c_src/wxe_driver.c
@@ -241,12 +241,10 @@ standard_outputv(ErlDrvData drv_data, ErlIOVec* ev)
bin = ev->binv[1];
driver_binary_inc_refc(bin); /* Otherwise it could get deallocated */
binref->bin = bin;
- sd->bin = binref;
} else { /* Empty binary (becomes NULL) */
binref->base = NULL;
binref->size = 0;
binref->from = driver_caller(sd->port_handle);
binref->bin = NULL;
- sd->bin = binref;
}
}
diff --git a/lib/wx/c_src/wxe_gl.cpp b/lib/wx/c_src/wxe_gl.cpp
index 5126804b9f..7f2e767a6b 100644
--- a/lib/wx/c_src/wxe_gl.cpp
+++ b/lib/wx/c_src/wxe_gl.cpp
@@ -138,9 +138,9 @@ void gl_dispatch(int op, char *bp,ErlDrvTermData caller,WXEBinRef *bins){
wxGLCanvas * current = glc[caller];
if(current) {
if(current != glc[gl_active]) {
- gl_active = caller;
current->SetCurrent();
}
+ gl_active = caller;
} else {
ErlDrvTermData rt[] = // Error msg
{ERL_DRV_ATOM, driver_mk_atom((char *) "_egl_error_"),
diff --git a/lib/wx/configure.in b/lib/wx/configure.in
index 48fcca640c..bf27b72aa7 100644
--- a/lib/wx/configure.in
+++ b/lib/wx/configure.in
@@ -164,14 +164,14 @@ case $host_os in
CPPFLAGS="$CPPFLAGS -D_MACOSX $PTHR_CFLAGS"
;;
mingw32)
- CFLAGS="$CFLAGS -DWIN32 -DWINVER=0x0500 -D_WINDOWS -D_UNICODE -DUNICODE"
- CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0500"
+ CFLAGS="$CFLAGS -DWIN32 -DWINVER=0x0600 -D_WINDOWS -D_UNICODE -DUNICODE"
+ CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0600"
AC_MSG_WARN([Reverting to 32-bit time_t])
CPPFLAGS="$CPPFLAGS -D_USE_32BIT_TIME_T"
;;
win32)
- CFLAGS="$CFLAGS -DWIN32 -DWINVER=0x0500 -D_WINDOWS -D_UNICODE -DUNICODE"
- CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0500"
+ CFLAGS="$CFLAGS -DWIN32 -DWINVER=0x0600 -D_WINDOWS -D_UNICODE -DUNICODE"
+ CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0600"
;;
*)
CFLAGS="$CFLAGS -Wno-deprecated-declarations"
diff --git a/lib/wx/include/wx.hrl b/lib/wx/include/wx.hrl
index 1bc00ca235..333ceca50c 100644
--- a/lib/wx/include/wx.hrl
+++ b/lib/wx/include/wx.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -4085,7 +4085,3 @@
-define(wxWINDOW_VARIANT_MINI, 2).
-define(wxWINDOW_VARIANT_LARGE, 3).
-define(wxWINDOW_VARIANT_MAX, 4).
-% From "xmlres.h": wxXmlResourceFlags
--define(wxXRC_USE_LOCALE, 1).
--define(wxXRC_NO_SUBCLASSING, 2).
--define(wxXRC_NO_RELOADING, 4).
diff --git a/lib/wx/src/gen/wxAuiNotebook.erl b/lib/wx/src/gen/wxAuiNotebook.erl
index f66048f0d3..7ec1acb26d 100644
--- a/lib/wx/src/gen/wxAuiNotebook.erl
+++ b/lib/wx/src/gen/wxAuiNotebook.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -37,10 +37,10 @@
setTabCtrlHeight/2,setUniformBitmapSize/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -52,23 +52,24 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setForegroundColour/2,
setHelpText/2,setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,
setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,setPalette/2,
setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setSize/2,
setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
- setToolTip/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
+ setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
setWindowVariant/2,shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
@@ -349,6 +350,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxBitmapButton.erl b/lib/wx/src/gen/wxBitmapButton.erl
index e0fb4bc78a..642828b0b0 100644
--- a/lib/wx/src/gen/wxBitmapButton.erl
+++ b/lib/wx/src/gen/wxBitmapButton.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -36,10 +36,10 @@
setBitmapLabel/2,setBitmapSelected/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -51,24 +51,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
- setDefault/1,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDefault/1,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -229,6 +230,14 @@ setDefault(This) -> wxButton:setDefault(This).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxButton.erl b/lib/wx/src/gen/wxButton.erl
index 06e6e53976..c94303bbea 100644
--- a/lib/wx/src/gen/wxButton.erl
+++ b/lib/wx/src/gen/wxButton.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,10 +34,10 @@
setLabel/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -49,24 +49,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setMaxSize/2,setMinSize/2,
setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -179,6 +180,14 @@ destroy(Obj=#wx_ref{type=Type}) ->
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxCalendarCtrl.erl b/lib/wx/src/gen/wxCalendarCtrl.erl
index 2c24063372..1d4baeed08 100644
--- a/lib/wx/src/gen/wxCalendarCtrl.erl
+++ b/lib/wx/src/gen/wxCalendarCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -38,10 +38,10 @@
setHighlightColours/3,setHoliday/2,setHolidayColours/3]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -53,24 +53,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -363,6 +364,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxCheckBox.erl b/lib/wx/src/gen/wxCheckBox.erl
index c190ebcf27..2cea4d04b4 100644
--- a/lib/wx/src/gen/wxCheckBox.erl
+++ b/lib/wx/src/gen/wxCheckBox.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,10 +35,10 @@
setValue/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -50,24 +50,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -216,6 +217,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxCheckListBox.erl b/lib/wx/src/gen/wxCheckListBox.erl
index 94656daac8..f6013e4863 100644
--- a/lib/wx/src/gen/wxCheckListBox.erl
+++ b/lib/wx/src/gen/wxCheckListBox.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,46 +35,48 @@
-export([check/2,check/3,destroy/1,isChecked/2,new/0,new/2,new/3]).
%% inherited exports
--export([append/2,append/3,appendStrings/2,cacheBestSize/2,captureMouse/1,center/1,
- center/2,centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
- centreOnParent/2,clear/1,clearBackground/1,clientToScreen/2,clientToScreen/3,
- close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
- delete/2,deselect/2,destroyChildren/1,disable/1,disconnect/1,disconnect/2,
- disconnect/3,enable/1,enable/2,findString/2,findString/3,findWindow/2,
- fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,getBackgroundColour/1,
- getBackgroundStyle/1,getBestSize/1,getCaret/1,getCharHeight/1,getCharWidth/1,
- getChildren/1,getClientData/2,getClientSize/1,getContainingSizer/1,
- getCount/1,getCursor/1,getDropTarget/1,getEventHandler/1,getExtraStyle/1,
- getFont/1,getForegroundColour/1,getGrandParent/1,getHandle/1,getHelpText/1,
- getId/1,getLabel/1,getMaxSize/1,getMinSize/1,getName/1,getParent/1,
- getPosition/1,getRect/1,getScreenPosition/1,getScreenRect/1,getScrollPos/2,
- getScrollRange/2,getScrollThumb/2,getSelection/1,getSelections/1,
- getSize/1,getSizer/1,getString/2,getStringSelection/1,getTextExtent/2,
- getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
- getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,hitTest/2,inheritAttributes/1,initDialog/1,insert/3,insert/4,
- insertItems/3,invalidateBestSize/1,isEmpty/1,isEnabled/1,isExposed/2,
- isExposed/3,isExposed/5,isRetained/1,isSelected/2,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- select/2,set/2,setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientData/3,setClientSize/2,setClientSize/3,
- setContainingSizer/2,setCursor/2,setDropTarget/2,setExtraStyle/2,
- setFirstItem/2,setFocus/1,setFocusFromKbd/1,setFont/2,setForegroundColour/2,
- setHelpText/2,setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,
- setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,setPalette/2,
- setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setSelection/2,
- setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
- setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setString/3,setStringSelection/2,setThemeEnabled/2,setToolTip/2,setVirtualSize/2,
- setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
- setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
- show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
- update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export([append/2,append/3,appendStrings/2,cacheBestSize/2,canSetTransparent/1,
+ captureMouse/1,center/1,center/2,centerOnParent/1,centerOnParent/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,clear/1,clearBackground/1,
+ clientToScreen/2,clientToScreen/3,close/1,close/2,connect/2,connect/3,
+ convertDialogToPixels/2,convertPixelsToDialog/2,delete/2,deselect/2,
+ destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
+ enable/1,enable/2,findString/2,findString/3,findWindow/2,fit/1,fitInside/1,
+ freeze/1,getAcceleratorTable/1,getBackgroundColour/1,getBackgroundStyle/1,
+ getBestSize/1,getCaret/1,getCharHeight/1,getCharWidth/1,getChildren/1,
+ getClientData/2,getClientSize/1,getContainingSizer/1,getCount/1,getCursor/1,
+ getDropTarget/1,getEventHandler/1,getExtraStyle/1,getFont/1,getForegroundColour/1,
+ getGrandParent/1,getHandle/1,getHelpText/1,getId/1,getLabel/1,getMaxSize/1,
+ getMinSize/1,getName/1,getParent/1,getPosition/1,getRect/1,getScreenPosition/1,
+ getScreenRect/1,getScrollPos/2,getScrollRange/2,getScrollThumb/2,
+ getSelection/1,getSelections/1,getSize/1,getSizer/1,getString/2,getStringSelection/1,
+ getTextExtent/2,getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,
+ getWindowStyleFlag/1,getWindowVariant/1,hasCapture/1,hasScrollbar/2,
+ hasTransparentBackground/1,hide/1,hitTest/2,inheritAttributes/1,initDialog/1,
+ insert/3,insert/4,insertItems/3,invalidateBestSize/1,isDoubleBuffered/1,
+ isEmpty/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,
+ isSelected/2,isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,
+ makeModal/1,makeModal/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,
+ scrollPages/2,scrollWindow/3,scrollWindow/4,select/2,set/2,setAcceleratorTable/2,
+ setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
+ setClientData/3,setClientSize/2,setClientSize/3,setContainingSizer/2,
+ setCursor/2,setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFirstItem/2,
+ setFocus/1,setFocusFromKbd/1,setFont/2,setForegroundColour/2,setHelpText/2,
+ setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setSelection/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setString/3,
+ setStringSelection/2,setThemeEnabled/2,setToolTip/2,setTransparent/2,
+ setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,
+ setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,
+ shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
+ transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
+ validate/1,warpPointer/3]).
-export_type([wxCheckListBox/0]).
%% @hidden
@@ -220,6 +222,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxChoice.erl b/lib/wx/src/gen/wxChoice.erl
index ddeb00beca..73867d6597 100644
--- a/lib/wx/src/gen/wxChoice.erl
+++ b/lib/wx/src/gen/wxChoice.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,45 +35,47 @@
setColumns/2]).
%% inherited exports
--export([append/2,append/3,appendStrings/2,cacheBestSize/2,captureMouse/1,center/1,
- center/2,centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
- centreOnParent/2,clear/1,clearBackground/1,clientToScreen/2,clientToScreen/3,
- close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
- destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
- enable/1,enable/2,findString/2,findString/3,findWindow/2,fit/1,fitInside/1,
- freeze/1,getAcceleratorTable/1,getBackgroundColour/1,getBackgroundStyle/1,
- getBestSize/1,getCaret/1,getCharHeight/1,getCharWidth/1,getChildren/1,
- getClientData/2,getClientSize/1,getContainingSizer/1,getCount/1,getCursor/1,
- getDropTarget/1,getEventHandler/1,getExtraStyle/1,getFont/1,getForegroundColour/1,
- getGrandParent/1,getHandle/1,getHelpText/1,getId/1,getLabel/1,getMaxSize/1,
- getMinSize/1,getName/1,getParent/1,getPosition/1,getRect/1,getScreenPosition/1,
+-export([append/2,append/3,appendStrings/2,cacheBestSize/2,canSetTransparent/1,
+ captureMouse/1,center/1,center/2,centerOnParent/1,centerOnParent/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,clear/1,clearBackground/1,
+ clientToScreen/2,clientToScreen/3,close/1,close/2,connect/2,connect/3,
+ convertDialogToPixels/2,convertPixelsToDialog/2,destroyChildren/1,
+ disable/1,disconnect/1,disconnect/2,disconnect/3,enable/1,enable/2,
+ findString/2,findString/3,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
+ getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
+ getCharHeight/1,getCharWidth/1,getChildren/1,getClientData/2,getClientSize/1,
+ getContainingSizer/1,getCount/1,getCursor/1,getDropTarget/1,getEventHandler/1,
+ getExtraStyle/1,getFont/1,getForegroundColour/1,getGrandParent/1,
+ getHandle/1,getHelpText/1,getId/1,getLabel/1,getMaxSize/1,getMinSize/1,
+ getName/1,getParent/1,getPosition/1,getRect/1,getScreenPosition/1,
getScreenRect/1,getScrollPos/2,getScrollRange/2,getScrollThumb/2,
getSelection/1,getSize/1,getSizer/1,getString/2,getStringSelection/1,
getTextExtent/2,getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,
getWindowStyleFlag/1,getWindowVariant/1,hasCapture/1,hasScrollbar/2,
hasTransparentBackground/1,hide/1,inheritAttributes/1,initDialog/1,
- insert/3,insert/4,invalidateBestSize/1,isEmpty/1,isEnabled/1,isExposed/2,
- isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,layout/1,
- lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,
- moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,navigate/2,
- pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- select/2,setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientData/3,setClientSize/2,setClientSize/3,
- setContainingSizer/2,setCursor/2,setDropTarget/2,setExtraStyle/2,
- setFocus/1,setFocusFromKbd/1,setFont/2,setForegroundColour/2,setHelpText/2,
- setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
- setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setScrollPos/3,
- setScrollPos/4,setScrollbar/5,setScrollbar/6,setSelection/2,setSize/2,
- setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
- setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setString/3,
- setStringSelection/2,setThemeEnabled/2,setToolTip/2,setVirtualSize/2,
- setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
- setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
- show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
- update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+ insert/3,insert/4,invalidateBestSize/1,isDoubleBuffered/1,isEmpty/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,select/2,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientData/3,
+ setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
+ setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
+ setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
+ setSelection/2,setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,
+ setSizeHints/3,setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,
+ setSizerAndFit/3,setString/3,setStringSelection/2,setThemeEnabled/2,
+ setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
+ setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
+ setWindowVariant/2,shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
+ transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
+ validate/1,warpPointer/3]).
-export_type([wxChoice/0]).
%% @hidden
@@ -235,6 +237,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxChoicebook.erl b/lib/wx/src/gen/wxChoicebook.erl
index 7627662437..37a44a813a 100644
--- a/lib/wx/src/gen/wxChoicebook.erl
+++ b/lib/wx/src/gen/wxChoicebook.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -38,10 +38,10 @@
setPageSize/2,setPageText/3,setSelection/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -53,24 +53,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -383,6 +384,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxColourDialog.erl b/lib/wx/src/gen/wxColourDialog.erl
index 66cde944c5..15eee30727 100644
--- a/lib/wx/src/gen/wxColourDialog.erl
+++ b/lib/wx/src/gen/wxColourDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,11 +34,11 @@
-export([create/2,create/3,destroy/1,getColourData/1,new/0,new/1,new/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createButtonSizer/2,createStdDialogButtonSizer/2,destroyChildren/1,
disable/1,disconnect/1,disconnect/2,disconnect/3,enable/1,enable/2,
endModal/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -53,25 +53,26 @@
getTitle/1,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isModal/1,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,
- maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
- navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
- refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
- reparent/2,requestUserAttention/1,requestUserAttention/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,
- setCursor/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,
- setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
- setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setReturnCode/2,
- setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,
- setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
- setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setTitle/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isModal/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,maximize/1,maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
+ scrollWindow/4,setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
+ setOwnForegroundColour/2,setPalette/2,setReturnCode/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
+ setTitle/2,setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,
setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,showFullScreen/2,showFullScreen/3,showModal/1,thaw/1,
@@ -222,6 +223,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxColourPickerCtrl.erl b/lib/wx/src/gen/wxColourPickerCtrl.erl
index a6ca31c06d..486441c005 100644
--- a/lib/wx/src/gen/wxColourPickerCtrl.erl
+++ b/lib/wx/src/gen/wxColourPickerCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,10 +34,10 @@
-export([create/3,create/4,destroy/1,getColour/1,new/0,new/2,new/3,setColour/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -50,30 +50,31 @@
getSize/1,getSizer/1,getTextCtrl/1,getTextCtrlProportion/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTextCtrl/1,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isPickerCtrlGrowable/1,isRetained/1,
- isShown/1,isTextCtrlGrowable/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,
- lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
- moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
- popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
- raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
- removeChild/2,reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,
- scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
- setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
- setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
- setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
- setForegroundColour/2,setHelpText/2,setId/2,setInternalMargin/2,setLabel/2,
- setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
- setOwnForegroundColour/2,setPalette/2,setPickerCtrlGrowable/1,setPickerCtrlGrowable/2,
- setPickerCtrlProportion/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,
- setScrollbar/6,setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,
- setSizeHints/3,setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,
- setSizerAndFit/3,setTextCtrlGrowable/1,setTextCtrlGrowable/2,setTextCtrlProportion/2,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
- setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
- show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
- update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isPickerCtrlGrowable/1,
+ isRetained/1,isShown/1,isTextCtrlGrowable/1,isTopLevel/1,layout/1,
+ lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,
+ moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,navigate/2,
+ pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
+ popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
+ refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
+ screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
+ setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
+ setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setInternalMargin/2,
+ setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setPickerCtrlGrowable/1,
+ setPickerCtrlGrowable/2,setPickerCtrlProportion/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setSize/2,setSize/3,setSize/5,
+ setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
+ setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setTextCtrlGrowable/1,
+ setTextCtrlGrowable/2,setTextCtrlProportion/2,setThemeEnabled/2,
+ setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
+ setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
+ setWindowVariant/2,shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
+ transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
+ validate/1,warpPointer/3]).
-export_type([wxColourPickerCtrl/0]).
%% @hidden
@@ -220,6 +221,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxComboBox.erl b/lib/wx/src/gen/wxComboBox.erl
index 0e34c72934..37d6e71605 100644
--- a/lib/wx/src/gen/wxComboBox.erl
+++ b/lib/wx/src/gen/wxComboBox.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -37,45 +37,47 @@
setSelection/2,setSelection/3,setValue/2,undo/1]).
%% inherited exports
--export([append/2,append/3,appendStrings/2,cacheBestSize/2,captureMouse/1,center/1,
- center/2,centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
- centreOnParent/2,clear/1,clearBackground/1,clientToScreen/2,clientToScreen/3,
- close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
- delete/2,destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
- enable/1,enable/2,findString/2,findString/3,findWindow/2,fit/1,fitInside/1,
- freeze/1,getAcceleratorTable/1,getBackgroundColour/1,getBackgroundStyle/1,
- getBestSize/1,getCaret/1,getCharHeight/1,getCharWidth/1,getChildren/1,
- getClientData/2,getClientSize/1,getContainingSizer/1,getCount/1,getCursor/1,
- getDropTarget/1,getEventHandler/1,getExtraStyle/1,getFont/1,getForegroundColour/1,
- getGrandParent/1,getHandle/1,getHelpText/1,getId/1,getLabel/1,getMaxSize/1,
- getMinSize/1,getName/1,getParent/1,getPosition/1,getRect/1,getScreenPosition/1,
+-export([append/2,append/3,appendStrings/2,cacheBestSize/2,canSetTransparent/1,
+ captureMouse/1,center/1,center/2,centerOnParent/1,centerOnParent/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,clear/1,clearBackground/1,
+ clientToScreen/2,clientToScreen/3,close/1,close/2,connect/2,connect/3,
+ convertDialogToPixels/2,convertPixelsToDialog/2,delete/2,destroyChildren/1,
+ disable/1,disconnect/1,disconnect/2,disconnect/3,enable/1,enable/2,
+ findString/2,findString/3,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
+ getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
+ getCharHeight/1,getCharWidth/1,getChildren/1,getClientData/2,getClientSize/1,
+ getContainingSizer/1,getCount/1,getCursor/1,getDropTarget/1,getEventHandler/1,
+ getExtraStyle/1,getFont/1,getForegroundColour/1,getGrandParent/1,
+ getHandle/1,getHelpText/1,getId/1,getLabel/1,getMaxSize/1,getMinSize/1,
+ getName/1,getParent/1,getPosition/1,getRect/1,getScreenPosition/1,
getScreenRect/1,getScrollPos/2,getScrollRange/2,getScrollThumb/2,
getSelection/1,getSize/1,getSizer/1,getString/2,getStringSelection/1,
getTextExtent/2,getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,
getWindowStyleFlag/1,getWindowVariant/1,hasCapture/1,hasScrollbar/2,
hasTransparentBackground/1,hide/1,inheritAttributes/1,initDialog/1,
- insert/3,insert/4,invalidateBestSize/1,isEmpty/1,isEnabled/1,isExposed/2,
- isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,layout/1,
- lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,
- moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,navigate/2,
- pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- select/2,setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientData/3,setClientSize/2,setClientSize/3,
- setContainingSizer/2,setCursor/2,setDropTarget/2,setExtraStyle/2,
- setFocus/1,setFocusFromKbd/1,setFont/2,setForegroundColour/2,setHelpText/2,
- setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
- setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setScrollPos/3,
- setScrollPos/4,setScrollbar/5,setScrollbar/6,setSize/2,setSize/3,setSize/5,
- setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
- setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setString/3,setStringSelection/2,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
- setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
- show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
- update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+ insert/3,insert/4,invalidateBestSize/1,isDoubleBuffered/1,isEmpty/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,select/2,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientData/3,
+ setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
+ setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
+ setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
+ setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
+ setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
+ setString/3,setStringSelection/2,setThemeEnabled/2,setToolTip/2,setTransparent/2,
+ setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,
+ setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,
+ shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
+ transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
+ validate/1,warpPointer/3]).
-export_type([wxComboBox/0]).
%% @hidden
@@ -370,6 +372,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxControl.erl b/lib/wx/src/gen/wxControl.erl
index f0fb88e3eb..f84ec34b02 100644
--- a/lib/wx/src/gen/wxControl.erl
+++ b/lib/wx/src/gen/wxControl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -32,10 +32,10 @@
-export([getLabel/1,setLabel/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -47,24 +47,25 @@
getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,getTextExtent/3,
getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setMaxSize/2,setMinSize/2,
setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -96,6 +97,14 @@ setLabel(#wx_ref{type=ThisT,ref=ThisRef},Label)
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxControlWithItems.erl b/lib/wx/src/gen/wxControlWithItems.erl
index 5f4ed9701b..d52c7917a2 100644
--- a/lib/wx/src/gen/wxControlWithItems.erl
+++ b/lib/wx/src/gen/wxControlWithItems.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -36,10 +36,10 @@
setString/3,setStringSelection/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -51,24 +51,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -278,6 +279,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxDatePickerCtrl.erl b/lib/wx/src/gen/wxDatePickerCtrl.erl
index 73df9c1395..057f91d4e8 100644
--- a/lib/wx/src/gen/wxDatePickerCtrl.erl
+++ b/lib/wx/src/gen/wxDatePickerCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,10 +34,10 @@
-export([destroy/1,getRange/3,getValue/1,new/0,new/2,new/3,setRange/3,setValue/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -50,30 +50,31 @@
getSize/1,getSizer/1,getTextCtrl/1,getTextCtrlProportion/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTextCtrl/1,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isPickerCtrlGrowable/1,isRetained/1,
- isShown/1,isTextCtrlGrowable/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,
- lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
- moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
- popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
- raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
- removeChild/2,reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,
- scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
- setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
- setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
- setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
- setForegroundColour/2,setHelpText/2,setId/2,setInternalMargin/2,setLabel/2,
- setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
- setOwnForegroundColour/2,setPalette/2,setPickerCtrlGrowable/1,setPickerCtrlGrowable/2,
- setPickerCtrlProportion/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,
- setScrollbar/6,setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,
- setSizeHints/3,setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,
- setSizerAndFit/3,setTextCtrlGrowable/1,setTextCtrlGrowable/2,setTextCtrlProportion/2,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
- setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
- show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
- update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isPickerCtrlGrowable/1,
+ isRetained/1,isShown/1,isTextCtrlGrowable/1,isTopLevel/1,layout/1,
+ lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,
+ moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,navigate/2,
+ pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
+ popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
+ refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
+ screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
+ setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
+ setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setInternalMargin/2,
+ setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setPickerCtrlGrowable/1,
+ setPickerCtrlGrowable/2,setPickerCtrlProportion/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setSize/2,setSize/3,setSize/5,
+ setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
+ setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setTextCtrlGrowable/1,
+ setTextCtrlGrowable/2,setTextCtrlProportion/2,setThemeEnabled/2,
+ setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
+ setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
+ setWindowVariant/2,shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
+ transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
+ validate/1,warpPointer/3]).
-export_type([wxDatePickerCtrl/0]).
%% @hidden
@@ -196,6 +197,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxDialog.erl b/lib/wx/src/gen/wxDialog.erl
index aa4df5888c..c3f4828c68 100644
--- a/lib/wx/src/gen/wxDialog.erl
+++ b/lib/wx/src/gen/wxDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,11 +35,11 @@
new/0,new/3,new/4,setAffirmativeId/2,setReturnCode/2,show/1,show/2,showModal/1]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -53,29 +53,30 @@
getVirtualSize/1,getWindowStyleFlag/1,getWindowVariant/1,hasCapture/1,
hasScrollbar/2,hasTransparentBackground/1,hide/1,iconize/1,iconize/2,
inheritAttributes/1,initDialog/1,invalidateBestSize/1,isActive/1,
- isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,isIconized/1,
- isMaximized/1,isRetained/1,isShown/1,isTopLevel/1,layout/1,lineDown/1,
- lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,maximize/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,requestUserAttention/1,
- requestUserAttention/2,screenToClient/1,screenToClient/2,scrollLines/2,
- scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
- setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
- setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
- setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
- setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
- setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
- setOwnForegroundColour/2,setPalette/2,setScrollPos/3,setScrollPos/4,
- setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,setSize/3,setSize/5,
- setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
- setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,setTitle/2,
- setToolTip/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
- setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
- setWindowVariant/2,shouldInheritColours/1,showFullScreen/2,showFullScreen/3,
- thaw/1,transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
- updateWindowUI/2,validate/1,warpPointer/3]).
+ isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,
+ isFullScreen/1,isIconized/1,isMaximized/1,isRetained/1,isShown/1,isTopLevel/1,
+ layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,
+ maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,requestUserAttention/1,requestUserAttention/2,screenToClient/1,
+ screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
+ setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
+ setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,
+ setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
+ setTitle/2,setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,
+ setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
+ showFullScreen/2,showFullScreen/3,thaw/1,transferDataFromWindow/1,
+ transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
+ validate/1,warpPointer/3]).
-export_type([wxDialog/0]).
%% @hidden
@@ -297,6 +298,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxDirDialog.erl b/lib/wx/src/gen/wxDirDialog.erl
index cf1d558b00..aa7a419bcd 100644
--- a/lib/wx/src/gen/wxDirDialog.erl
+++ b/lib/wx/src/gen/wxDirDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,11 +34,11 @@
-export([destroy/1,getMessage/1,getPath/1,new/1,new/2,setMessage/2,setPath/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createButtonSizer/2,createStdDialogButtonSizer/2,destroyChildren/1,
disable/1,disconnect/1,disconnect/2,disconnect/3,enable/1,enable/2,
endModal/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -53,25 +53,26 @@
getTitle/1,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isModal/1,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,
- maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
- navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
- refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
- reparent/2,requestUserAttention/1,requestUserAttention/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,
- setCursor/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,
- setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
- setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setReturnCode/2,
- setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,
- setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
- setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setTitle/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isModal/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,maximize/1,maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
+ scrollWindow/4,setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
+ setOwnForegroundColour/2,setPalette/2,setReturnCode/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
+ setTitle/2,setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,
setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,showFullScreen/2,showFullScreen/3,showModal/1,thaw/1,
@@ -230,6 +231,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxDirPickerCtrl.erl b/lib/wx/src/gen/wxDirPickerCtrl.erl
index 1db48b467c..fea7ee71a1 100644
--- a/lib/wx/src/gen/wxDirPickerCtrl.erl
+++ b/lib/wx/src/gen/wxDirPickerCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,10 +34,10 @@
-export([create/3,create/4,destroy/1,getPath/1,new/0,new/2,new/3,setPath/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -50,30 +50,31 @@
getSize/1,getSizer/1,getTextCtrl/1,getTextCtrlProportion/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTextCtrl/1,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isPickerCtrlGrowable/1,isRetained/1,
- isShown/1,isTextCtrlGrowable/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,
- lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
- moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
- popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
- raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
- removeChild/2,reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,
- scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
- setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
- setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
- setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
- setForegroundColour/2,setHelpText/2,setId/2,setInternalMargin/2,setLabel/2,
- setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
- setOwnForegroundColour/2,setPalette/2,setPickerCtrlGrowable/1,setPickerCtrlGrowable/2,
- setPickerCtrlProportion/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,
- setScrollbar/6,setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,
- setSizeHints/3,setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,
- setSizerAndFit/3,setTextCtrlGrowable/1,setTextCtrlGrowable/2,setTextCtrlProportion/2,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
- setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
- show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
- update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isPickerCtrlGrowable/1,
+ isRetained/1,isShown/1,isTextCtrlGrowable/1,isTopLevel/1,layout/1,
+ lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,
+ moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,navigate/2,
+ pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
+ popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
+ refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
+ screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
+ setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
+ setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setInternalMargin/2,
+ setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setPickerCtrlGrowable/1,
+ setPickerCtrlGrowable/2,setPickerCtrlProportion/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setSize/2,setSize/3,setSize/5,
+ setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
+ setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setTextCtrlGrowable/1,
+ setTextCtrlGrowable/2,setTextCtrlProportion/2,setThemeEnabled/2,
+ setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
+ setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
+ setWindowVariant/2,shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
+ transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
+ validate/1,warpPointer/3]).
-export_type([wxDirPickerCtrl/0]).
%% @hidden
@@ -213,6 +214,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxFileDialog.erl b/lib/wx/src/gen/wxFileDialog.erl
index d3dac3ba2d..36ee6463ae 100644
--- a/lib/wx/src/gen/wxFileDialog.erl
+++ b/lib/wx/src/gen/wxFileDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -36,11 +36,11 @@
setFilename/2,setFilterIndex/2,setMessage/2,setPath/2,setWildcard/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createButtonSizer/2,createStdDialogButtonSizer/2,destroyChildren/1,
disable/1,disconnect/1,disconnect/2,disconnect/3,enable/1,enable/2,
endModal/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -55,25 +55,26 @@
getTitle/1,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isModal/1,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,
- maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
- navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
- refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
- reparent/2,requestUserAttention/1,requestUserAttention/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,
- setCursor/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,
- setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
- setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setReturnCode/2,
- setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,
- setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
- setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setTitle/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isModal/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,maximize/1,maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
+ scrollWindow/4,setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
+ setOwnForegroundColour/2,setPalette/2,setReturnCode/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
+ setTitle/2,setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,
setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,showFullScreen/2,showFullScreen/3,showModal/1,thaw/1,
@@ -323,6 +324,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxFilePickerCtrl.erl b/lib/wx/src/gen/wxFilePickerCtrl.erl
index d781bdf000..2b57a5927b 100644
--- a/lib/wx/src/gen/wxFilePickerCtrl.erl
+++ b/lib/wx/src/gen/wxFilePickerCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,10 +34,10 @@
-export([create/3,create/4,destroy/1,getPath/1,new/0,new/2,new/3,setPath/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -50,30 +50,31 @@
getSize/1,getSizer/1,getTextCtrl/1,getTextCtrlProportion/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTextCtrl/1,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isPickerCtrlGrowable/1,isRetained/1,
- isShown/1,isTextCtrlGrowable/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,
- lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
- moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
- popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
- raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
- removeChild/2,reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,
- scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
- setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
- setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
- setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
- setForegroundColour/2,setHelpText/2,setId/2,setInternalMargin/2,setLabel/2,
- setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
- setOwnForegroundColour/2,setPalette/2,setPickerCtrlGrowable/1,setPickerCtrlGrowable/2,
- setPickerCtrlProportion/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,
- setScrollbar/6,setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,
- setSizeHints/3,setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,
- setSizerAndFit/3,setTextCtrlGrowable/1,setTextCtrlGrowable/2,setTextCtrlProportion/2,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
- setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
- show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
- update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isPickerCtrlGrowable/1,
+ isRetained/1,isShown/1,isTextCtrlGrowable/1,isTopLevel/1,layout/1,
+ lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,
+ moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,navigate/2,
+ pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
+ popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
+ refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
+ screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
+ setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
+ setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setInternalMargin/2,
+ setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setPickerCtrlGrowable/1,
+ setPickerCtrlGrowable/2,setPickerCtrlProportion/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setSize/2,setSize/3,setSize/5,
+ setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
+ setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setTextCtrlGrowable/1,
+ setTextCtrlGrowable/2,setTextCtrlProportion/2,setThemeEnabled/2,
+ setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
+ setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
+ setWindowVariant/2,shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
+ transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
+ validate/1,warpPointer/3]).
-export_type([wxFilePickerCtrl/0]).
%% @hidden
@@ -217,6 +218,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxFindReplaceDialog.erl b/lib/wx/src/gen/wxFindReplaceDialog.erl
index a14a05fb8e..d265e232b3 100644
--- a/lib/wx/src/gen/wxFindReplaceDialog.erl
+++ b/lib/wx/src/gen/wxFindReplaceDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,11 +34,11 @@
-export([create/4,create/5,destroy/1,getData/1,new/0,new/3,new/4]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createButtonSizer/2,createStdDialogButtonSizer/2,destroyChildren/1,
disable/1,disconnect/1,disconnect/2,disconnect/3,enable/1,enable/2,
endModal/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -53,25 +53,26 @@
getTitle/1,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isModal/1,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,
- maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
- navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
- refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
- reparent/2,requestUserAttention/1,requestUserAttention/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,
- setCursor/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,
- setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
- setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setReturnCode/2,
- setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,
- setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
- setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setTitle/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isModal/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,maximize/1,maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
+ scrollWindow/4,setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
+ setOwnForegroundColour/2,setPalette/2,setReturnCode/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
+ setTitle/2,setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,
setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,showFullScreen/2,showFullScreen/3,showModal/1,thaw/1,
@@ -226,6 +227,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxFontDialog.erl b/lib/wx/src/gen/wxFontDialog.erl
index cf0938a57d..de199cfcce 100644
--- a/lib/wx/src/gen/wxFontDialog.erl
+++ b/lib/wx/src/gen/wxFontDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,11 +34,11 @@
-export([create/3,destroy/1,getFontData/1,new/0,new/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createButtonSizer/2,createStdDialogButtonSizer/2,destroyChildren/1,
disable/1,disconnect/1,disconnect/2,disconnect/3,enable/1,enable/2,
endModal/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -53,25 +53,26 @@
getTitle/1,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isModal/1,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,
- maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
- navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
- refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
- reparent/2,requestUserAttention/1,requestUserAttention/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,
- setCursor/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,
- setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
- setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setReturnCode/2,
- setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,
- setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
- setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setTitle/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isModal/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,maximize/1,maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
+ scrollWindow/4,setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
+ setOwnForegroundColour/2,setPalette/2,setReturnCode/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
+ setTitle/2,setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,
setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,showFullScreen/2,showFullScreen/3,showModal/1,thaw/1,
@@ -198,6 +199,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxFontPickerCtrl.erl b/lib/wx/src/gen/wxFontPickerCtrl.erl
index b5c3b641ee..c21061e0fe 100644
--- a/lib/wx/src/gen/wxFontPickerCtrl.erl
+++ b/lib/wx/src/gen/wxFontPickerCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,10 +35,10 @@
new/2,new/3,setMaxPointSize/2,setSelectedFont/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -51,30 +51,31 @@
getSize/1,getSizer/1,getTextCtrl/1,getTextCtrlProportion/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTextCtrl/1,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isPickerCtrlGrowable/1,isRetained/1,
- isShown/1,isTextCtrlGrowable/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,
- lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
- moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
- popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
- raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
- removeChild/2,reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,
- scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
- setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
- setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
- setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
- setForegroundColour/2,setHelpText/2,setId/2,setInternalMargin/2,setLabel/2,
- setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
- setOwnForegroundColour/2,setPalette/2,setPickerCtrlGrowable/1,setPickerCtrlGrowable/2,
- setPickerCtrlProportion/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,
- setScrollbar/6,setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,
- setSizeHints/3,setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,
- setSizerAndFit/3,setTextCtrlGrowable/1,setTextCtrlGrowable/2,setTextCtrlProportion/2,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
- setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
- show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
- update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isPickerCtrlGrowable/1,
+ isRetained/1,isShown/1,isTextCtrlGrowable/1,isTopLevel/1,layout/1,
+ lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,
+ moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,navigate/2,
+ pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
+ popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
+ refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
+ screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
+ setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
+ setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setInternalMargin/2,
+ setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setPickerCtrlGrowable/1,
+ setPickerCtrlGrowable/2,setPickerCtrlProportion/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setSize/2,setSize/3,setSize/5,
+ setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
+ setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setTextCtrlGrowable/1,
+ setTextCtrlGrowable/2,setTextCtrlProportion/2,setThemeEnabled/2,
+ setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
+ setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
+ setWindowVariant/2,shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
+ transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
+ validate/1,warpPointer/3]).
-export_type([wxFontPickerCtrl/0]).
%% @hidden
@@ -226,6 +227,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxFrame.erl b/lib/wx/src/gen/wxFrame.erl
index 6fa1a2b958..75860cd9b7 100644
--- a/lib/wx/src/gen/wxFrame.erl
+++ b/lib/wx/src/gen/wxFrame.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -37,11 +37,11 @@
setStatusText/3,setStatusWidths/2,setToolBar/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -55,29 +55,30 @@
getVirtualSize/1,getWindowStyleFlag/1,getWindowVariant/1,hasCapture/1,
hasScrollbar/2,hasTransparentBackground/1,hide/1,iconize/1,iconize/2,
inheritAttributes/1,initDialog/1,invalidateBestSize/1,isActive/1,
- isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,isIconized/1,
- isMaximized/1,isRetained/1,isShown/1,isTopLevel/1,layout/1,lineDown/1,
- lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,maximize/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,requestUserAttention/1,
- requestUserAttention/2,screenToClient/1,screenToClient/2,scrollLines/2,
- scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
- setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
- setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
- setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
- setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
- setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
- setOwnForegroundColour/2,setPalette/2,setScrollPos/3,setScrollPos/4,
- setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,setSize/3,setSize/5,
- setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
- setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,setTitle/2,
- setToolTip/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
- setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
- setWindowVariant/2,shouldInheritColours/1,show/1,show/2,showFullScreen/2,
- showFullScreen/3,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
- update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+ isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,
+ isFullScreen/1,isIconized/1,isMaximized/1,isRetained/1,isShown/1,isTopLevel/1,
+ layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,
+ maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,requestUserAttention/1,requestUserAttention/2,screenToClient/1,
+ screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
+ setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
+ setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,
+ setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
+ setTitle/2,setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,
+ setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
+ show/1,show/2,showFullScreen/2,showFullScreen/3,thaw/1,transferDataFromWindow/1,
+ transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
+ validate/1,warpPointer/3]).
-export_type([wxFrame/0]).
%% @hidden
@@ -374,6 +375,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxGLCanvas.erl b/lib/wx/src/gen/wxGLCanvas.erl
index b00b45ad24..9d3d13740d 100644
--- a/lib/wx/src/gen/wxGLCanvas.erl
+++ b/lib/wx/src/gen/wxGLCanvas.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -32,10 +32,10 @@
-export([destroy/1,getContext/1,new/1,new/2,new/3,setCurrent/1,swapBuffers/1]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -47,24 +47,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -193,6 +194,14 @@ destroy(Obj=#wx_ref{type=Type}) ->
ok.
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxGauge.erl b/lib/wx/src/gen/wxGauge.erl
index 0b64f097ad..51c35145c4 100644
--- a/lib/wx/src/gen/wxGauge.erl
+++ b/lib/wx/src/gen/wxGauge.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,10 +35,10 @@
setShadowWidth/2,setValue/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -50,24 +50,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -238,6 +239,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxGenericDirCtrl.erl b/lib/wx/src/gen/wxGenericDirCtrl.erl
index 014111144f..bc26a1645e 100644
--- a/lib/wx/src/gen/wxGenericDirCtrl.erl
+++ b/lib/wx/src/gen/wxGenericDirCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -36,10 +36,10 @@
setFilterIndex/2,setPath/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -51,24 +51,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -296,6 +297,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxGrid.erl b/lib/wx/src/gen/wxGrid.erl
index 0d35804529..49bd89f188 100644
--- a/lib/wx/src/gen/wxGrid.erl
+++ b/lib/wx/src/gen/wxGrid.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -86,10 +86,10 @@
%% inherited exports
-export([cacheBestSize/2,calcScrolledPosition/2,calcScrolledPosition/3,calcUnscrolledPosition/2,
- calcUnscrolledPosition/3,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+ calcUnscrolledPosition/3,canSetTransparent/1,captureMouse/1,center/1,
+ center/2,centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
doPrepareDC/2,enable/1,enable/2,enableScrolling/3,findWindow/2,fitInside/1,
freeze/1,getAcceleratorTable/1,getBackgroundColour/1,getBackgroundStyle/1,
@@ -102,25 +102,26 @@
getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,getTextExtent/3,
getToolTip/1,getUpdateRegion/1,getViewStart/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,prepareDC/2,raise/1,refresh/1,refresh/2,
- refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,
- screenToClient/1,screenToClient/2,scroll/3,scrollLines/2,scrollPages/2,
- scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
- setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
- setClientSize/3,setContainingSizer/2,setCursor/2,setDropTarget/2,
- setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFocusIgnoringChildren/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
- setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
- setPalette/2,setScrollPos/3,setScrollPos/4,setScrollRate/3,setScrollbar/5,
- setScrollbar/6,setScrollbars/5,setScrollbars/6,setSize/2,setSize/3,
- setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
- setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setTargetWindow/2,setThemeEnabled/2,
- setToolTip/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,prepareDC/2,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,screenToClient/1,screenToClient/2,scroll/3,
+ scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
+ setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
+ setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFocusIgnoringChildren/1,setFont/2,setForegroundColour/2,setHelpText/2,
+ setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setScrollPos/3,
+ setScrollPos/4,setScrollRate/3,setScrollbar/5,setScrollbar/6,setScrollbars/5,
+ setScrollbars/6,setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,
+ setSizeHints/3,setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,
+ setSizerAndFit/3,setTargetWindow/2,setThemeEnabled/2,setToolTip/2,
+ setTransparent/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
setWindowVariant/2,shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
@@ -2157,6 +2158,14 @@ setFocusIgnoringChildren(This) -> wxPanel:setFocusIgnoringChildren(This).
initDialog(This) -> wxPanel:initDialog(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxHtmlWindow.erl b/lib/wx/src/gen/wxHtmlWindow.erl
index 6b0b172b24..759b8ba0fd 100644
--- a/lib/wx/src/gen/wxHtmlWindow.erl
+++ b/lib/wx/src/gen/wxHtmlWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -40,10 +40,10 @@
%% inherited exports
-export([cacheBestSize/2,calcScrolledPosition/2,calcScrolledPosition/3,calcUnscrolledPosition/2,
- calcUnscrolledPosition/3,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+ calcUnscrolledPosition/3,canSetTransparent/1,captureMouse/1,center/1,
+ center/2,centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
doPrepareDC/2,enable/1,enable/2,enableScrolling/3,findWindow/2,fit/1,
fitInside/1,freeze/1,getAcceleratorTable/1,getBackgroundColour/1,
@@ -56,25 +56,26 @@
getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,getTextExtent/3,
getToolTip/1,getUpdateRegion/1,getViewStart/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,prepareDC/2,raise/1,refresh/1,refresh/2,
- refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,
- screenToClient/1,screenToClient/2,scroll/3,scrollLines/2,scrollPages/2,
- scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
- setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
- setClientSize/3,setContainingSizer/2,setCursor/2,setDropTarget/2,
- setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFocusIgnoringChildren/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
- setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
- setPalette/2,setScrollPos/3,setScrollPos/4,setScrollRate/3,setScrollbar/5,
- setScrollbar/6,setScrollbars/5,setScrollbars/6,setSize/2,setSize/3,
- setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
- setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setTargetWindow/2,setThemeEnabled/2,
- setToolTip/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,prepareDC/2,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,screenToClient/1,screenToClient/2,scroll/3,
+ scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
+ setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
+ setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFocusIgnoringChildren/1,setFont/2,setForegroundColour/2,setHelpText/2,
+ setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setScrollPos/3,
+ setScrollPos/4,setScrollRate/3,setScrollbar/5,setScrollbar/6,setScrollbars/5,
+ setScrollbars/6,setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,
+ setSizeHints/3,setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,
+ setSizerAndFit/3,setTargetWindow/2,setThemeEnabled/2,setToolTip/2,
+ setTransparent/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
setWindowVariant/2,shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
@@ -370,6 +371,14 @@ setFocusIgnoringChildren(This) -> wxPanel:setFocusIgnoringChildren(This).
initDialog(This) -> wxPanel:initDialog(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxListBox.erl b/lib/wx/src/gen/wxListBox.erl
index 14cc553935..eaa026839e 100644
--- a/lib/wx/src/gen/wxListBox.erl
+++ b/lib/wx/src/gen/wxListBox.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,45 +35,47 @@
isSelected/2,new/0,new/2,new/3,set/2,setFirstItem/2]).
%% inherited exports
--export([append/2,append/3,appendStrings/2,cacheBestSize/2,captureMouse/1,center/1,
- center/2,centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
- centreOnParent/2,clear/1,clearBackground/1,clientToScreen/2,clientToScreen/3,
- close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
- delete/2,destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
- enable/1,enable/2,findString/2,findString/3,findWindow/2,fit/1,fitInside/1,
- freeze/1,getAcceleratorTable/1,getBackgroundColour/1,getBackgroundStyle/1,
- getBestSize/1,getCaret/1,getCharHeight/1,getCharWidth/1,getChildren/1,
- getClientData/2,getClientSize/1,getContainingSizer/1,getCount/1,getCursor/1,
- getDropTarget/1,getEventHandler/1,getExtraStyle/1,getFont/1,getForegroundColour/1,
- getGrandParent/1,getHandle/1,getHelpText/1,getId/1,getLabel/1,getMaxSize/1,
- getMinSize/1,getName/1,getParent/1,getPosition/1,getRect/1,getScreenPosition/1,
+-export([append/2,append/3,appendStrings/2,cacheBestSize/2,canSetTransparent/1,
+ captureMouse/1,center/1,center/2,centerOnParent/1,centerOnParent/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,clear/1,clearBackground/1,
+ clientToScreen/2,clientToScreen/3,close/1,close/2,connect/2,connect/3,
+ convertDialogToPixels/2,convertPixelsToDialog/2,delete/2,destroyChildren/1,
+ disable/1,disconnect/1,disconnect/2,disconnect/3,enable/1,enable/2,
+ findString/2,findString/3,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
+ getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
+ getCharHeight/1,getCharWidth/1,getChildren/1,getClientData/2,getClientSize/1,
+ getContainingSizer/1,getCount/1,getCursor/1,getDropTarget/1,getEventHandler/1,
+ getExtraStyle/1,getFont/1,getForegroundColour/1,getGrandParent/1,
+ getHandle/1,getHelpText/1,getId/1,getLabel/1,getMaxSize/1,getMinSize/1,
+ getName/1,getParent/1,getPosition/1,getRect/1,getScreenPosition/1,
getScreenRect/1,getScrollPos/2,getScrollRange/2,getScrollThumb/2,
getSelection/1,getSize/1,getSizer/1,getString/2,getStringSelection/1,
getTextExtent/2,getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,
getWindowStyleFlag/1,getWindowVariant/1,hasCapture/1,hasScrollbar/2,
hasTransparentBackground/1,hide/1,inheritAttributes/1,initDialog/1,
- insert/3,insert/4,invalidateBestSize/1,isEmpty/1,isEnabled/1,isExposed/2,
- isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,layout/1,
- lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,
- moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,navigate/2,
- pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- select/2,setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientData/3,setClientSize/2,setClientSize/3,
- setContainingSizer/2,setCursor/2,setDropTarget/2,setExtraStyle/2,
- setFocus/1,setFocusFromKbd/1,setFont/2,setForegroundColour/2,setHelpText/2,
- setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
- setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setScrollPos/3,
- setScrollPos/4,setScrollbar/5,setScrollbar/6,setSelection/2,setSize/2,
- setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
- setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setString/3,
- setStringSelection/2,setThemeEnabled/2,setToolTip/2,setVirtualSize/2,
- setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
- setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
- show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
- update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+ insert/3,insert/4,invalidateBestSize/1,isDoubleBuffered/1,isEmpty/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,select/2,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientData/3,
+ setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
+ setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
+ setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
+ setSelection/2,setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,
+ setSizeHints/3,setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,
+ setSizerAndFit/3,setString/3,setStringSelection/2,setThemeEnabled/2,
+ setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
+ setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
+ setWindowVariant/2,shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
+ transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
+ validate/1,warpPointer/3]).
-export_type([wxListBox/0]).
%% @hidden
@@ -278,6 +280,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxListCtrl.erl b/lib/wx/src/gen/wxListCtrl.erl
index 491511b729..6750931fdb 100644
--- a/lib/wx/src/gen/wxListCtrl.erl
+++ b/lib/wx/src/gen/wxListCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -47,10 +47,10 @@
setSingleStyle/2,setSingleStyle/3,setTextColour/2,setWindowStyleFlag/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -62,27 +62,28 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundStyle/2,setCaret/2,
- setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
- setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
- setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
- setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
- setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
- setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
- setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
- setWindowStyle/2,setWindowVariant/2,shouldInheritColours/1,show/1,
- show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,update/1,
- updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundStyle/2,setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,
+ setCursor/2,setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,
+ setFocusFromKbd/1,setFont/2,setForegroundColour/2,setHelpText/2,setId/2,
+ setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setSize/2,setSize/3,setSize/5,
+ setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
+ setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,setToolTip/2,
+ setTransparent/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
+ setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowVariant/2,
+ shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
+ transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
+ validate/1,warpPointer/3]).
-export_type([wxListCtrl/0]).
%% @hidden
@@ -869,6 +870,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxListView.erl b/lib/wx/src/gen/wxListView.erl
index 3720fe86c1..288afcee82 100644
--- a/lib/wx/src/gen/wxListView.erl
+++ b/lib/wx/src/gen/wxListView.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,10 +34,10 @@
isSelected/2,select/2,select/3,setColumnImage/3]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -49,24 +49,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -168,6 +169,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxListbook.erl b/lib/wx/src/gen/wxListbook.erl
index b5083c5746..6ea34e8eb1 100644
--- a/lib/wx/src/gen/wxListbook.erl
+++ b/lib/wx/src/gen/wxListbook.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -38,10 +38,10 @@
setPageSize/2,setPageText/3,setSelection/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -53,24 +53,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -383,6 +384,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxMDIChildFrame.erl b/lib/wx/src/gen/wxMDIChildFrame.erl
index 05f07f1066..ed29e5431f 100644
--- a/lib/wx/src/gen/wxMDIChildFrame.erl
+++ b/lib/wx/src/gen/wxMDIChildFrame.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,11 +35,11 @@
new/4,restore/1]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createStatusBar/1,createStatusBar/2,createToolBar/1,createToolBar/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -55,26 +55,27 @@
getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isRetained/1,isShown/1,isTopLevel/1,layout/1,
- lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,
- moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,navigate/2,
- pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,processCommand/2,raise/1,refresh/1,
- refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
- reparent/2,requestUserAttention/1,requestUserAttention/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- sendSizeEvent/1,setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,
- setCursor/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,
- setId/2,setLabel/2,setMaxSize/2,setMenuBar/2,setMinSize/2,setName/2,
- setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,setPalette/2,
- setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,
- setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
- setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setStatusBar/2,setStatusBarPane/2,setStatusText/2,setStatusText/3,
- setStatusWidths/2,setThemeEnabled/2,setTitle/2,setToolBar/2,setToolTip/2,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,processCommand/2,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
+ scrollWindow/4,sendSizeEvent/1,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMenuBar/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setStatusBar/2,
+ setStatusBarPane/2,setStatusText/2,setStatusText/3,setStatusWidths/2,
+ setThemeEnabled/2,setTitle/2,setToolBar/2,setToolTip/2,setTransparent/2,
setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,
setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,
shouldInheritColours/1,show/1,show/2,showFullScreen/2,showFullScreen/3,
@@ -274,6 +275,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxMDIClientWindow.erl b/lib/wx/src/gen/wxMDIClientWindow.erl
index 20569718f7..6f10627086 100644
--- a/lib/wx/src/gen/wxMDIClientWindow.erl
+++ b/lib/wx/src/gen/wxMDIClientWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -32,10 +32,10 @@
-export([createClient/2,createClient/3,destroy/1,new/0,new/1,new/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -47,24 +47,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -135,6 +136,14 @@ destroy(Obj=#wx_ref{type=Type}) ->
ok.
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxMDIParentFrame.erl b/lib/wx/src/gen/wxMDIParentFrame.erl
index 9aeba68ea3..47d9182d60 100644
--- a/lib/wx/src/gen/wxMDIParentFrame.erl
+++ b/lib/wx/src/gen/wxMDIParentFrame.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -36,11 +36,11 @@
tile/1,tile/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createStatusBar/1,createStatusBar/2,createToolBar/1,createToolBar/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -56,32 +56,32 @@
getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isRetained/1,isShown/1,isTopLevel/1,layout/1,
- lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,maximize/2,
- move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
- navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,processCommand/2,
- raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
- removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,maximize/1,maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ processCommand/2,raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,
+ releaseMouse/1,removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
scrollWindow/4,sendSizeEvent/1,setAcceleratorTable/2,setAutoLayout/2,
setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
- setClientSize/3,setContainingSizer/2,setCursor/2,setDropTarget/2,
- setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,setForegroundColour/2,
- setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,setMaxSize/2,
- setMenuBar/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
- setOwnForegroundColour/2,setPalette/2,setScrollPos/3,setScrollPos/4,
- setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,setSize/3,setSize/5,
- setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
- setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setStatusBar/2,setStatusBarPane/2,
- setStatusText/2,setStatusText/3,setStatusWidths/2,setThemeEnabled/2,
- setTitle/2,setToolBar/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
- setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
- show/1,show/2,showFullScreen/2,showFullScreen/3,thaw/1,transferDataFromWindow/1,
- transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
- validate/1,warpPointer/3]).
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMenuBar/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setStatusBar/2,
+ setStatusBarPane/2,setStatusText/2,setStatusText/3,setStatusWidths/2,
+ setThemeEnabled/2,setTitle/2,setToolBar/2,setToolTip/2,setTransparent/2,
+ setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,
+ setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,
+ shouldInheritColours/1,show/1,show/2,showFullScreen/2,showFullScreen/3,
+ thaw/1,transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
+ updateWindowUI/2,validate/1,warpPointer/3]).
-export_type([wxMDIParentFrame/0]).
%% @hidden
@@ -313,6 +313,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxMenuBar.erl b/lib/wx/src/gen/wxMenuBar.erl
index cb35015c08..5e879da5ed 100644
--- a/lib/wx/src/gen/wxMenuBar.erl
+++ b/lib/wx/src/gen/wxMenuBar.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -36,10 +36,10 @@
setLabelTop/3]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,getBackgroundColour/1,
getBackgroundStyle/1,getBestSize/1,getCaret/1,getCharHeight/1,getCharWidth/1,
@@ -51,24 +51,24 @@
getSize/1,getSizer/1,getTextExtent/2,getTextExtent/3,getToolTip/1,
getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,getWindowVariant/1,
hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,hide/1,inheritAttributes/1,
- initDialog/1,invalidateBestSize/1,isExposed/2,isExposed/3,isExposed/5,
- isRetained/1,isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,
- makeModal/1,makeModal/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
- moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
- popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
- raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
- removeChild/2,reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,
- scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
- setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
- setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
- setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
- setForegroundColour/2,setHelpText/2,setId/2,setMaxSize/2,setMinSize/2,
- setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
+ initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,isExposed/2,
+ isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,layout/1,
+ lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,
+ moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,navigate/2,
+ pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
+ popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
+ refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
+ screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
+ setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
+ setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setMaxSize/2,
+ setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -340,6 +340,14 @@ destroy(Obj=#wx_ref{type=Type}) ->
ok.
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxMessageDialog.erl b/lib/wx/src/gen/wxMessageDialog.erl
index f024145ed6..1fe99b2b88 100644
--- a/lib/wx/src/gen/wxMessageDialog.erl
+++ b/lib/wx/src/gen/wxMessageDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,11 +34,11 @@
-export([destroy/1,new/2,new/3]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createButtonSizer/2,createStdDialogButtonSizer/2,destroyChildren/1,
disable/1,disconnect/1,disconnect/2,disconnect/3,enable/1,enable/2,
endModal/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -53,25 +53,26 @@
getTitle/1,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isModal/1,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,
- maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
- navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
- refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
- reparent/2,requestUserAttention/1,requestUserAttention/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,
- setCursor/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,
- setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
- setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setReturnCode/2,
- setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,
- setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
- setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setTitle/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isModal/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,maximize/1,maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
+ scrollWindow/4,setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
+ setOwnForegroundColour/2,setPalette/2,setReturnCode/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
+ setTitle/2,setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,
setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,showFullScreen/2,showFullScreen/3,showModal/1,thaw/1,
@@ -191,6 +192,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxMiniFrame.erl b/lib/wx/src/gen/wxMiniFrame.erl
index 7622ddf0d2..f731cc5416 100644
--- a/lib/wx/src/gen/wxMiniFrame.erl
+++ b/lib/wx/src/gen/wxMiniFrame.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,11 +34,11 @@
-export([create/4,create/5,destroy/1,new/0,new/3,new/4]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createStatusBar/1,createStatusBar/2,createToolBar/1,createToolBar/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -54,32 +54,32 @@
getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isRetained/1,isShown/1,isTopLevel/1,layout/1,
- lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,maximize/2,
- move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
- navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,processCommand/2,
- raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
- removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,maximize/1,maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ processCommand/2,raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,
+ releaseMouse/1,removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
scrollWindow/4,sendSizeEvent/1,setAcceleratorTable/2,setAutoLayout/2,
setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
- setClientSize/3,setContainingSizer/2,setCursor/2,setDropTarget/2,
- setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,setForegroundColour/2,
- setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,setMaxSize/2,
- setMenuBar/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
- setOwnForegroundColour/2,setPalette/2,setScrollPos/3,setScrollPos/4,
- setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,setSize/3,setSize/5,
- setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
- setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setStatusBar/2,setStatusBarPane/2,
- setStatusText/2,setStatusText/3,setStatusWidths/2,setThemeEnabled/2,
- setTitle/2,setToolBar/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
- setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
- show/1,show/2,showFullScreen/2,showFullScreen/3,thaw/1,transferDataFromWindow/1,
- transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
- validate/1,warpPointer/3]).
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMenuBar/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setStatusBar/2,
+ setStatusBarPane/2,setStatusText/2,setStatusText/3,setStatusWidths/2,
+ setThemeEnabled/2,setTitle/2,setToolBar/2,setToolTip/2,setTransparent/2,
+ setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,
+ setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,
+ shouldInheritColours/1,show/1,show/2,showFullScreen/2,showFullScreen/3,
+ thaw/1,transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
+ updateWindowUI/2,validate/1,warpPointer/3]).
-export_type([wxMiniFrame/0]).
%% @hidden
@@ -241,6 +241,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxMultiChoiceDialog.erl b/lib/wx/src/gen/wxMultiChoiceDialog.erl
index e79f11ef7d..96e9c070a3 100644
--- a/lib/wx/src/gen/wxMultiChoiceDialog.erl
+++ b/lib/wx/src/gen/wxMultiChoiceDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,11 +34,11 @@
-export([destroy/1,getSelections/1,new/0,new/4,new/5,setSelections/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createButtonSizer/2,createStdDialogButtonSizer/2,destroyChildren/1,
disable/1,disconnect/1,disconnect/2,disconnect/3,enable/1,enable/2,
endModal/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -53,25 +53,26 @@
getTitle/1,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isModal/1,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,
- maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
- navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
- refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
- reparent/2,requestUserAttention/1,requestUserAttention/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,
- setCursor/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,
- setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
- setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setReturnCode/2,
- setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,
- setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
- setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setTitle/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isModal/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,maximize/1,maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
+ scrollWindow/4,setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
+ setOwnForegroundColour/2,setPalette/2,setReturnCode/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
+ setTitle/2,setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,
setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,showFullScreen/2,showFullScreen/3,showModal/1,thaw/1,
@@ -216,6 +217,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxNotebook.erl b/lib/wx/src/gen/wxNotebook.erl
index 16c2d4fc6f..5011375aad 100644
--- a/lib/wx/src/gen/wxNotebook.erl
+++ b/lib/wx/src/gen/wxNotebook.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -38,10 +38,10 @@
setPadding/2,setPageImage/3,setPageSize/2,setPageText/3,setSelection/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -53,24 +53,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -408,6 +409,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxPanel.erl b/lib/wx/src/gen/wxPanel.erl
index 5b6d4a2974..ceb894fe31 100644
--- a/lib/wx/src/gen/wxPanel.erl
+++ b/lib/wx/src/gen/wxPanel.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -32,10 +32,10 @@
-export([destroy/1,initDialog/1,new/0,new/1,new/2,new/5,new/6,setFocusIgnoringChildren/1]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -47,24 +47,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,invalidateBestSize/1,isEnabled/1,isExposed/2,
- isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,layout/1,
- lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,
- moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,navigate/2,
- pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -154,6 +155,14 @@ destroy(Obj=#wx_ref{type=Type}) ->
ok.
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxPasswordEntryDialog.erl b/lib/wx/src/gen/wxPasswordEntryDialog.erl
index da9a711405..ac3f1c9d8c 100644
--- a/lib/wx/src/gen/wxPasswordEntryDialog.erl
+++ b/lib/wx/src/gen/wxPasswordEntryDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,11 +35,11 @@
-export([destroy/1,new/2,new/3]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createButtonSizer/2,createStdDialogButtonSizer/2,destroyChildren/1,
disable/1,disconnect/1,disconnect/2,disconnect/3,enable/1,enable/2,
endModal/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -54,8 +54,8 @@
getTitle/1,getToolTip/1,getUpdateRegion/1,getValue/1,getVirtualSize/1,
getWindowStyleFlag/1,getWindowVariant/1,hasCapture/1,hasScrollbar/2,
hasTransparentBackground/1,hide/1,iconize/1,iconize/2,inheritAttributes/1,
- initDialog/1,invalidateBestSize/1,isActive/1,isEnabled/1,isExposed/2,
- isExposed/3,isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,
+ initDialog/1,invalidateBestSize/1,isActive/1,isDoubleBuffered/1,isEnabled/1,
+ isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,
isModal/1,isRetained/1,isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,
lower/1,makeModal/1,makeModal/2,maximize/1,maximize/2,move/2,move/3,
move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,navigate/2,
@@ -66,19 +66,19 @@
scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
setAffirmativeId/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
- setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
- setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
- setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
- setOwnForegroundColour/2,setPalette/2,setReturnCode/2,setScrollPos/3,
- setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
- setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
- setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
- setTitle/2,setToolTip/2,setValue/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
- setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
- show/1,show/2,showFullScreen/2,showFullScreen/3,showModal/1,thaw/1,
- transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
- updateWindowUI/2,validate/1,warpPointer/3]).
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,
+ setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setReturnCode/2,
+ setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,
+ setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
+ setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
+ setThemeEnabled/2,setTitle/2,setToolTip/2,setTransparent/2,setValue/2,
+ setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,
+ setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,
+ shouldInheritColours/1,show/1,show/2,showFullScreen/2,showFullScreen/3,
+ showModal/1,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
+ update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
-export_type([wxPasswordEntryDialog/0]).
%% @hidden
@@ -201,6 +201,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxPickerBase.erl b/lib/wx/src/gen/wxPickerBase.erl
index 74de8bf7f1..bbdeaf6af8 100644
--- a/lib/wx/src/gen/wxPickerBase.erl
+++ b/lib/wx/src/gen/wxPickerBase.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -36,10 +36,10 @@
setTextCtrlGrowable/1,setTextCtrlGrowable/2,setTextCtrlProportion/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -51,24 +51,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -213,6 +214,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxPopupTransientWindow.erl b/lib/wx/src/gen/wxPopupTransientWindow.erl
index 40a63b09ec..c07c6e239e 100644
--- a/lib/wx/src/gen/wxPopupTransientWindow.erl
+++ b/lib/wx/src/gen/wxPopupTransientWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -33,10 +33,10 @@
-export([destroy/1,dismiss/1,new/0,new/1,new/2,popup/1,popup/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -48,24 +48,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,position/3,raise/1,refresh/1,refresh/2,
- refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,
- screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
- scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,
- setCursor/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,position/3,raise/1,
+ refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -145,6 +146,14 @@ destroy(Obj=#wx_ref{type=Type}) ->
position(This,PtOrigin,Size) -> wxPopupWindow:position(This,PtOrigin,Size).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxPopupWindow.erl b/lib/wx/src/gen/wxPopupWindow.erl
index 41390e08e7..439f5fac54 100644
--- a/lib/wx/src/gen/wxPopupWindow.erl
+++ b/lib/wx/src/gen/wxPopupWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -32,10 +32,10 @@
-export([create/2,create/3,destroy/1,new/0,new/1,new/2,position/3]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -47,24 +47,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -142,6 +143,14 @@ destroy(Obj=#wx_ref{type=Type}) ->
ok.
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxPreviewCanvas.erl b/lib/wx/src/gen/wxPreviewCanvas.erl
index 91d0672def..67357dbd65 100644
--- a/lib/wx/src/gen/wxPreviewCanvas.erl
+++ b/lib/wx/src/gen/wxPreviewCanvas.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,10 +35,10 @@
%% inherited exports
-export([cacheBestSize/2,calcScrolledPosition/2,calcScrolledPosition/3,calcUnscrolledPosition/2,
- calcUnscrolledPosition/3,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+ calcUnscrolledPosition/3,canSetTransparent/1,captureMouse/1,center/1,
+ center/2,centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
doPrepareDC/2,enable/1,enable/2,enableScrolling/3,findWindow/2,fit/1,
fitInside/1,freeze/1,getAcceleratorTable/1,getBackgroundColour/1,
@@ -51,25 +51,26 @@
getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,getTextExtent/3,
getToolTip/1,getUpdateRegion/1,getViewStart/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,prepareDC/2,raise/1,refresh/1,refresh/2,
- refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,
- screenToClient/1,screenToClient/2,scroll/3,scrollLines/2,scrollPages/2,
- scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
- setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
- setClientSize/3,setContainingSizer/2,setCursor/2,setDropTarget/2,
- setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFocusIgnoringChildren/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
- setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
- setPalette/2,setScrollPos/3,setScrollPos/4,setScrollRate/3,setScrollbar/5,
- setScrollbar/6,setScrollbars/5,setScrollbars/6,setSize/2,setSize/3,
- setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
- setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setTargetWindow/2,setThemeEnabled/2,
- setToolTip/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,prepareDC/2,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,screenToClient/1,screenToClient/2,scroll/3,
+ scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
+ setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
+ setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFocusIgnoringChildren/1,setFont/2,setForegroundColour/2,setHelpText/2,
+ setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setScrollPos/3,
+ setScrollPos/4,setScrollRate/3,setScrollbar/5,setScrollbar/6,setScrollbars/5,
+ setScrollbars/6,setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,
+ setSizeHints/3,setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,
+ setSizerAndFit/3,setTargetWindow/2,setThemeEnabled/2,setToolTip/2,
+ setTransparent/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
setWindowVariant/2,shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
@@ -120,6 +121,14 @@ setFocusIgnoringChildren(This) -> wxPanel:setFocusIgnoringChildren(This).
initDialog(This) -> wxPanel:initDialog(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxPreviewControlBar.erl b/lib/wx/src/gen/wxPreviewControlBar.erl
index 9bc290aef8..0e1828e87b 100644
--- a/lib/wx/src/gen/wxPreviewControlBar.erl
+++ b/lib/wx/src/gen/wxPreviewControlBar.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,10 +34,10 @@
new/4,setZoomControl/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -49,24 +49,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFocusIgnoringChildren/1,
setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -151,6 +152,14 @@ setFocusIgnoringChildren(This) -> wxPanel:setFocusIgnoringChildren(This).
initDialog(This) -> wxPanel:initDialog(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxPreviewFrame.erl b/lib/wx/src/gen/wxPreviewFrame.erl
index 9423fc2333..fe684478a5 100644
--- a/lib/wx/src/gen/wxPreviewFrame.erl
+++ b/lib/wx/src/gen/wxPreviewFrame.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,11 +35,11 @@
onCloseWindow/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createStatusBar/1,createStatusBar/2,createToolBar/1,createToolBar/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -55,32 +55,32 @@
getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isRetained/1,isShown/1,isTopLevel/1,layout/1,
- lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,maximize/2,
- move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
- navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,processCommand/2,
- raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
- removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,maximize/1,maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ processCommand/2,raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,
+ releaseMouse/1,removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
scrollWindow/4,sendSizeEvent/1,setAcceleratorTable/2,setAutoLayout/2,
setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
- setClientSize/3,setContainingSizer/2,setCursor/2,setDropTarget/2,
- setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,setForegroundColour/2,
- setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,setMaxSize/2,
- setMenuBar/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
- setOwnForegroundColour/2,setPalette/2,setScrollPos/3,setScrollPos/4,
- setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,setSize/3,setSize/5,
- setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
- setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setStatusBar/2,setStatusBarPane/2,
- setStatusText/2,setStatusText/3,setStatusWidths/2,setThemeEnabled/2,
- setTitle/2,setToolBar/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
- setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
- show/1,show/2,showFullScreen/2,showFullScreen/3,thaw/1,transferDataFromWindow/1,
- transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
- validate/1,warpPointer/3]).
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMenuBar/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setStatusBar/2,
+ setStatusBarPane/2,setStatusText/2,setStatusText/3,setStatusWidths/2,
+ setThemeEnabled/2,setTitle/2,setToolBar/2,setToolTip/2,setTransparent/2,
+ setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,
+ setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,
+ shouldInheritColours/1,show/1,show/2,showFullScreen/2,showFullScreen/3,
+ thaw/1,transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
+ updateWindowUI/2,validate/1,warpPointer/3]).
-export_type([wxPreviewFrame/0]).
%% @hidden
@@ -244,6 +244,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxPrintDialog.erl b/lib/wx/src/gen/wxPrintDialog.erl
index 4f253b4988..a337089d5a 100644
--- a/lib/wx/src/gen/wxPrintDialog.erl
+++ b/lib/wx/src/gen/wxPrintDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,11 +34,11 @@
-export([destroy/1,getPrintDC/1,getPrintDialogData/1,new/1,new/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createButtonSizer/2,createStdDialogButtonSizer/2,destroyChildren/1,
disable/1,disconnect/1,disconnect/2,disconnect/3,enable/1,enable/2,
endModal/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -53,25 +53,26 @@
getTitle/1,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isModal/1,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,
- maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
- navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
- refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
- reparent/2,requestUserAttention/1,requestUserAttention/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,
- setCursor/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,
- setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
- setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setReturnCode/2,
- setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,
- setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
- setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setTitle/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isModal/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,maximize/1,maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
+ scrollWindow/4,setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
+ setOwnForegroundColour/2,setPalette/2,setReturnCode/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
+ setTitle/2,setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,
setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,showFullScreen/2,showFullScreen/3,showModal/1,thaw/1,
@@ -213,6 +214,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxProgressDialog.erl b/lib/wx/src/gen/wxProgressDialog.erl
index 544d67a7d8..665b900729 100644
--- a/lib/wx/src/gen/wxProgressDialog.erl
+++ b/lib/wx/src/gen/wxProgressDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,11 +34,11 @@
-export([destroy/1,new/2,new/3,resume/1,update/1,update/2,update/3]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createButtonSizer/2,createStdDialogButtonSizer/2,destroyChildren/1,
disable/1,disconnect/1,disconnect/2,disconnect/3,enable/1,enable/2,
endModal/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -53,25 +53,26 @@
getTitle/1,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isModal/1,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,
- maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
- navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
- refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
- reparent/2,requestUserAttention/1,requestUserAttention/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,
- setCursor/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,
- setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
- setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setReturnCode/2,
- setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,
- setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
- setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setTitle/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isModal/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,maximize/1,maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
+ scrollWindow/4,setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
+ setOwnForegroundColour/2,setPalette/2,setReturnCode/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
+ setTitle/2,setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,
setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,showFullScreen/2,showFullScreen/3,showModal/1,thaw/1,
@@ -228,6 +229,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxRadioBox.erl b/lib/wx/src/gen/wxRadioBox.erl
index 331c83d695..5ef1deff66 100644
--- a/lib/wx/src/gen/wxRadioBox.erl
+++ b/lib/wx/src/gen/wxRadioBox.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -36,10 +36,10 @@
setItemHelpText/3,setItemToolTip/3,setSelection/2,show/1,show/2,show/3]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,getBackgroundColour/1,
getBackgroundStyle/1,getBestSize/1,getCaret/1,getCharHeight/1,getCharWidth/1,
@@ -51,24 +51,24 @@
getSize/1,getSizer/1,getTextExtent/2,getTextExtent/3,getToolTip/1,
getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,getWindowVariant/1,
hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,hide/1,inheritAttributes/1,
- initDialog/1,invalidateBestSize/1,isEnabled/1,isExposed/2,isExposed/3,
- isExposed/5,isRetained/1,isShown/1,isTopLevel/1,layout/1,lineDown/1,
- lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
- moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
- popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
- raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
- removeChild/2,reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,
- scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
- setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
- setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
- setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
- setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
+ initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,isEnabled/1,
+ isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
+ layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
+ move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
+ navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
+ popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
+ refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
+ screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
+ setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
+ setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
thaw/1,transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
@@ -348,6 +348,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxRadioButton.erl b/lib/wx/src/gen/wxRadioButton.erl
index ab08c5807e..3b4689a27b 100644
--- a/lib/wx/src/gen/wxRadioButton.erl
+++ b/lib/wx/src/gen/wxRadioButton.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -33,10 +33,10 @@
-export([create/4,create/5,destroy/1,getValue/1,new/0,new/3,new/4,setValue/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -48,24 +48,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -171,6 +172,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxSashLayoutWindow.erl b/lib/wx/src/gen/wxSashLayoutWindow.erl
index c64ed77f31..223c07419d 100644
--- a/lib/wx/src/gen/wxSashLayoutWindow.erl
+++ b/lib/wx/src/gen/wxSashLayoutWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,10 +34,10 @@
new/2,setAlignment/2,setDefaultSize/2,setOrientation/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -51,9 +51,9 @@
getTextExtent/2,getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,
getWindowStyleFlag/1,getWindowVariant/1,hasCapture/1,hasScrollbar/2,
hasTransparentBackground/1,hide/1,inheritAttributes/1,initDialog/1,
- invalidateBestSize/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,
- isRetained/1,isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,
- makeModal/1,makeModal/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ invalidateBestSize/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isRetained/1,isShown/1,isTopLevel/1,layout/1,lineDown/1,
+ lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
@@ -61,17 +61,17 @@
scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
- setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
- setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMaximumSizeX/2,setMaximumSizeY/2,setMinSize/2,setMinimumSizeX/2,
setMinimumSizeY/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
setOwnForegroundColour/2,setPalette/2,setSashVisible/3,setScrollPos/3,
setScrollPos/4,setScrollbar/5,setScrollbar/6,setSize/2,setSize/3,setSize/5,
setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,setToolTip/2,
- setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,
- setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,
- shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
+ setTransparent/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
+ setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
+ setWindowVariant/2,shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
validate/1,warpPointer/3]).
@@ -220,6 +220,14 @@ getMaximumSizeX(This) -> wxSashWindow:getMaximumSizeX(This).
getSashVisible(This,Edge) -> wxSashWindow:getSashVisible(This,Edge).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxSashWindow.erl b/lib/wx/src/gen/wxSashWindow.erl
index 7f9f15aa58..4a39726ffd 100644
--- a/lib/wx/src/gen/wxSashWindow.erl
+++ b/lib/wx/src/gen/wxSashWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,10 +34,10 @@
setMinimumSizeX/2,setMinimumSizeY/2,setSashVisible/3]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -49,24 +49,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -207,6 +208,14 @@ destroy(Obj=#wx_ref{type=Type}) ->
ok.
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxScrollBar.erl b/lib/wx/src/gen/wxScrollBar.erl
index 97c30f2972..ccddf84835 100644
--- a/lib/wx/src/gen/wxScrollBar.erl
+++ b/lib/wx/src/gen/wxScrollBar.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,10 +34,10 @@
getThumbSize/1,new/0,new/2,new/3,setScrollbar/5,setScrollbar/6,setThumbPosition/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -49,25 +49,26 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setSize/2,setSize/3,setSize/5,
setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,setToolTip/2,
- setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,
- setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,
- shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
+ setTransparent/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
+ setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
+ setWindowVariant/2,shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
validate/1,warpPointer/3]).
@@ -215,6 +216,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxScrolledWindow.erl b/lib/wx/src/gen/wxScrolledWindow.erl
index 5513014c31..7c807980b4 100644
--- a/lib/wx/src/gen/wxScrolledWindow.erl
+++ b/lib/wx/src/gen/wxScrolledWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -36,10 +36,10 @@
scroll/3,setScrollRate/3,setScrollbars/5,setScrollbars/6,setTargetWindow/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -51,24 +51,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFocusIgnoringChildren/1,
setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -258,6 +259,14 @@ setFocusIgnoringChildren(This) -> wxPanel:setFocusIgnoringChildren(This).
initDialog(This) -> wxPanel:initDialog(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxSingleChoiceDialog.erl b/lib/wx/src/gen/wxSingleChoiceDialog.erl
index c5743c4ea1..641cb2836f 100644
--- a/lib/wx/src/gen/wxSingleChoiceDialog.erl
+++ b/lib/wx/src/gen/wxSingleChoiceDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,11 +34,11 @@
-export([destroy/1,getSelection/1,getStringSelection/1,new/0,new/4,new/5,setSelection/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createButtonSizer/2,createStdDialogButtonSizer/2,destroyChildren/1,
disable/1,disconnect/1,disconnect/2,disconnect/3,enable/1,enable/2,
endModal/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -53,25 +53,26 @@
getTitle/1,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isModal/1,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,
- maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
- navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
- refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
- reparent/2,requestUserAttention/1,requestUserAttention/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,
- setCursor/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,
- setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
- setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setReturnCode/2,
- setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,
- setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
- setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setTitle/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isModal/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,maximize/1,maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
+ scrollWindow/4,setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
+ setOwnForegroundColour/2,setPalette/2,setReturnCode/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
+ setTitle/2,setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,
setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,showFullScreen/2,showFullScreen/3,showModal/1,thaw/1,
@@ -223,6 +224,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxSlider.erl b/lib/wx/src/gen/wxSlider.erl
index 93ec783e48..02103aed01 100644
--- a/lib/wx/src/gen/wxSlider.erl
+++ b/lib/wx/src/gen/wxSlider.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,10 +35,10 @@
setRange/3,setThumbLength/2,setValue/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -50,24 +50,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -247,6 +248,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxSpinButton.erl b/lib/wx/src/gen/wxSpinButton.erl
index 52d71dd9c2..82b48f87da 100644
--- a/lib/wx/src/gen/wxSpinButton.erl
+++ b/lib/wx/src/gen/wxSpinButton.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,10 +34,10 @@
new/2,setRange/3,setValue/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -49,24 +49,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -195,6 +196,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxSpinCtrl.erl b/lib/wx/src/gen/wxSpinCtrl.erl
index 6fe5197359..89fa971543 100644
--- a/lib/wx/src/gen/wxSpinCtrl.erl
+++ b/lib/wx/src/gen/wxSpinCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,10 +34,10 @@
new/2,setRange/3,setSelection/3,setValue/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -49,24 +49,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -232,6 +233,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxSplashScreen.erl b/lib/wx/src/gen/wxSplashScreen.erl
index 6c12907d38..fad8cfcd8e 100644
--- a/lib/wx/src/gen/wxSplashScreen.erl
+++ b/lib/wx/src/gen/wxSplashScreen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,11 +34,11 @@
-export([destroy/1,getSplashStyle/1,getTimeout/1,new/0,new/5,new/6]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createStatusBar/1,createStatusBar/2,createToolBar/1,createToolBar/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -54,32 +54,32 @@
getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isRetained/1,isShown/1,isTopLevel/1,layout/1,
- lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,maximize/2,
- move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
- navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,processCommand/2,
- raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
- removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,maximize/1,maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ processCommand/2,raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,
+ releaseMouse/1,removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
scrollWindow/4,sendSizeEvent/1,setAcceleratorTable/2,setAutoLayout/2,
setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
- setClientSize/3,setContainingSizer/2,setCursor/2,setDropTarget/2,
- setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,setForegroundColour/2,
- setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,setMaxSize/2,
- setMenuBar/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
- setOwnForegroundColour/2,setPalette/2,setScrollPos/3,setScrollPos/4,
- setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,setSize/3,setSize/5,
- setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,setSizer/2,
- setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setStatusBar/2,setStatusBarPane/2,
- setStatusText/2,setStatusText/3,setStatusWidths/2,setThemeEnabled/2,
- setTitle/2,setToolBar/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
- setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
- show/1,show/2,showFullScreen/2,showFullScreen/3,thaw/1,transferDataFromWindow/1,
- transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
- validate/1,warpPointer/3]).
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMenuBar/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
+ setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setStatusBar/2,
+ setStatusBarPane/2,setStatusText/2,setStatusText/3,setStatusWidths/2,
+ setThemeEnabled/2,setTitle/2,setToolBar/2,setToolTip/2,setTransparent/2,
+ setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,
+ setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,
+ shouldInheritColours/1,show/1,show/2,showFullScreen/2,showFullScreen/3,
+ thaw/1,transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
+ updateWindowUI/2,validate/1,warpPointer/3]).
-export_type([wxSplashScreen/0]).
%% @hidden
@@ -230,6 +230,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxSplitterWindow.erl b/lib/wx/src/gen/wxSplitterWindow.erl
index b6b7a328ad..7db8dc60c4 100644
--- a/lib/wx/src/gen/wxSplitterWindow.erl
+++ b/lib/wx/src/gen/wxSplitterWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -37,10 +37,10 @@
unsplit/1,unsplit/2,updateSize/1]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -52,24 +52,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -358,6 +359,14 @@ destroy(Obj=#wx_ref{type=Type}) ->
ok.
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxStaticBitmap.erl b/lib/wx/src/gen/wxStaticBitmap.erl
index 1673e3b62d..4da50262b9 100644
--- a/lib/wx/src/gen/wxStaticBitmap.erl
+++ b/lib/wx/src/gen/wxStaticBitmap.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -33,10 +33,10 @@
-export([create/4,create/5,destroy/1,getBitmap/1,new/0,new/3,new/4,setBitmap/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -48,24 +48,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -167,6 +168,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxStaticBox.erl b/lib/wx/src/gen/wxStaticBox.erl
index f6a715f051..04584f23b2 100644
--- a/lib/wx/src/gen/wxStaticBox.erl
+++ b/lib/wx/src/gen/wxStaticBox.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -33,10 +33,10 @@
-export([create/4,create/5,destroy/1,new/0,new/3,new/4]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -48,24 +48,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -150,6 +151,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxStaticLine.erl b/lib/wx/src/gen/wxStaticLine.erl
index 6306a01c62..6d23c5ac3d 100644
--- a/lib/wx/src/gen/wxStaticLine.erl
+++ b/lib/wx/src/gen/wxStaticLine.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,10 +34,10 @@
new/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -49,24 +49,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -167,6 +168,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxStaticText.erl b/lib/wx/src/gen/wxStaticText.erl
index 4c5d72d5e7..635f29a1e8 100644
--- a/lib/wx/src/gen/wxStaticText.erl
+++ b/lib/wx/src/gen/wxStaticText.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -33,10 +33,10 @@
-export([create/4,create/5,destroy/1,getLabel/1,new/0,new/3,new/4,setLabel/2,wrap/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -48,24 +48,25 @@
getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,getTextExtent/3,
getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setMaxSize/2,setMinSize/2,
setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -173,6 +174,14 @@ destroy(Obj=#wx_ref{type=Type}) ->
%% From wxControl
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxStatusBar.erl b/lib/wx/src/gen/wxStatusBar.erl
index 254b9b0236..2cd0d4a43e 100644
--- a/lib/wx/src/gen/wxStatusBar.erl
+++ b/lib/wx/src/gen/wxStatusBar.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,10 +35,10 @@
setStatusStyles/2,setStatusText/2,setStatusText/3,setStatusWidths/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -50,24 +50,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -295,6 +296,14 @@ destroy(Obj=#wx_ref{type=Type}) ->
ok.
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxStyledTextCtrl.erl b/lib/wx/src/gen/wxStyledTextCtrl.erl
index 4598cc7609..8e629db9ff 100644
--- a/lib/wx/src/gen/wxStyledTextCtrl.erl
+++ b/lib/wx/src/gen/wxStyledTextCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -135,10 +135,10 @@
wordRightExtend/1,wordStartPosition/3,wrapCount/2,zoomIn/1,zoomOut/1]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -150,27 +150,27 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
- moveBeforeInTabOrder/2,navigate/1,navigate/2,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
- refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
- reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
- scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
- setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
- setClientSize/3,setContainingSizer/2,setCursor/2,setDropTarget/2,
- setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,setForegroundColour/2,
- setHelpText/2,setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,
- setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,setPalette/2,
- setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setSize/2,
- setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
- setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
- setToolTip/2,setVirtualSize/2,setVirtualSize/3,setVirtualSizeHints/2,
- setVirtualSizeHints/3,setVirtualSizeHints/4,setWindowStyle/2,setWindowStyleFlag/2,
- setWindowVariant/2,shouldInheritColours/1,show/1,show/2,thaw/1,transferDataFromWindow/1,
- transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
- validate/1,warpPointer/3]).
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,
+ move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,navigate/2,
+ parent_class/1,popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,
+ popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,
+ releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,screenToClient/2,
+ scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
+ setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
+ setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
+ setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
+ setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
+ setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
+ setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
+ show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
+ update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
-export_type([wxStyledTextCtrl/0]).
%% @hidden
@@ -4078,6 +4078,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxTextCtrl.erl b/lib/wx/src/gen/wxTextCtrl.erl
index de9e1c307a..5840812579 100644
--- a/lib/wx/src/gen/wxTextCtrl.erl
+++ b/lib/wx/src/gen/wxTextCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -41,10 +41,10 @@
setStyle/4,setValue/2,showPosition/2,undo/1,writeText/2,xYToPosition/3]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -56,24 +56,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -597,6 +598,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxTextEntryDialog.erl b/lib/wx/src/gen/wxTextEntryDialog.erl
index b18ba27607..a93c3857a8 100644
--- a/lib/wx/src/gen/wxTextEntryDialog.erl
+++ b/lib/wx/src/gen/wxTextEntryDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,11 +34,11 @@
-export([destroy/1,getValue/1,new/2,new/3,setValue/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centerOnScreen/1,centerOnScreen/2,centre/1,centre/2,
- centreOnParent/1,centreOnParent/2,centreOnScreen/1,centreOnScreen/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centerOnScreen/1,centerOnScreen/2,
+ centre/1,centre/2,centreOnParent/1,centreOnParent/2,centreOnScreen/1,
+ centreOnScreen/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
createButtonSizer/2,createStdDialogButtonSizer/2,destroyChildren/1,
disable/1,disconnect/1,disconnect/2,disconnect/3,enable/1,enable/2,
endModal/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
@@ -53,25 +53,26 @@
getTitle/1,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
hide/1,iconize/1,iconize/2,inheritAttributes/1,initDialog/1,invalidateBestSize/1,
- isActive/1,isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isFullScreen/1,
- isIconized/1,isMaximized/1,isModal/1,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,maximize/1,
- maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
- navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
- popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
- refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
- reparent/2,requestUserAttention/1,requestUserAttention/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,setBackgroundColour/2,
- setBackgroundStyle/2,setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,
- setCursor/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
- setFont/2,setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,
- setId/2,setLabel/2,setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,
- setOwnFont/2,setOwnForegroundColour/2,setPalette/2,setReturnCode/2,
- setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,
- setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
- setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setTitle/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
+ isActive/1,isDoubleBuffered/1,isEnabled/1,isExposed/2,isExposed/3,
+ isExposed/5,isFullScreen/1,isIconized/1,isMaximized/1,isModal/1,isRetained/1,
+ isShown/1,isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,
+ makeModal/2,maximize/1,maximize/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
+ moveBeforeInTabOrder/2,navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,
+ popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,
+ raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,
+ removeChild/2,reparent/2,requestUserAttention/1,requestUserAttention/2,
+ screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,
+ scrollWindow/4,setAcceleratorTable/2,setAffirmativeId/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
+ setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
+ setForegroundColour/2,setHelpText/2,setIcon/2,setIcons/2,setId/2,setLabel/2,
+ setMaxSize/2,setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,
+ setOwnForegroundColour/2,setPalette/2,setReturnCode/2,setScrollPos/3,
+ setScrollPos/4,setScrollbar/5,setScrollbar/6,setShape/2,setSize/2,
+ setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,setSizeHints/4,
+ setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,setThemeEnabled/2,
+ setTitle/2,setToolTip/2,setTransparent/2,setVirtualSize/2,setVirtualSize/3,
setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,showFullScreen/2,showFullScreen/3,showModal/1,thaw/1,
@@ -211,6 +212,14 @@ getIcons(This) -> wxTopLevelWindow:getIcons(This).
getIcon(This) -> wxTopLevelWindow:getIcon(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxToggleButton.erl b/lib/wx/src/gen/wxToggleButton.erl
index 45795318c6..dffb4b159d 100644
--- a/lib/wx/src/gen/wxToggleButton.erl
+++ b/lib/wx/src/gen/wxToggleButton.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -33,10 +33,10 @@
-export([create/4,create/5,destroy/1,getValue/1,new/0,new/3,new/4,setValue/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -48,24 +48,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -171,6 +172,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxToolBar.erl b/lib/wx/src/gen/wxToolBar.erl
index bee20b97f4..b3cce2b6e9 100644
--- a/lib/wx/src/gen/wxToolBar.erl
+++ b/lib/wx/src/gen/wxToolBar.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -42,10 +42,10 @@
setToolShortHelp/3,toggleTool/3]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -57,24 +57,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -673,6 +674,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxToolbook.erl b/lib/wx/src/gen/wxToolbook.erl
index f959a73004..cf77aefd8a 100644
--- a/lib/wx/src/gen/wxToolbook.erl
+++ b/lib/wx/src/gen/wxToolbook.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -38,10 +38,10 @@
setPageSize/2,setPageText/3,setSelection/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -53,24 +53,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -383,6 +384,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxTopLevelWindow.erl b/lib/wx/src/gen/wxTopLevelWindow.erl
index e11a72fab9..72813b0073 100644
--- a/lib/wx/src/gen/wxTopLevelWindow.erl
+++ b/lib/wx/src/gen/wxTopLevelWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -36,10 +36,10 @@
showFullScreen/2,showFullScreen/3]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -51,24 +51,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -301,6 +302,14 @@ showFullScreen(#wx_ref{type=ThisT,ref=ThisRef},Show, Options)
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxTreeCtrl.erl b/lib/wx/src/gen/wxTreeCtrl.erl
index ef6e2b6fea..43dee9107d 100644
--- a/lib/wx/src/gen/wxTreeCtrl.erl
+++ b/lib/wx/src/gen/wxTreeCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -54,10 +54,10 @@
unselectItem/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -69,24 +69,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,show/1,
show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,update/1,
updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -945,6 +946,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxTreebook.erl b/lib/wx/src/gen/wxTreebook.erl
index 19f1d7cfe4..1900f47289 100644
--- a/lib/wx/src/gen/wxTreebook.erl
+++ b/lib/wx/src/gen/wxTreebook.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -39,10 +39,10 @@
setPageSize/2,setPageText/3,setSelection/2]).
%% inherited exports
--export([cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
+-export([cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,center/2,
+ centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,connect/2,connect/3,convertDialogToPixels/2,convertPixelsToDialog/2,
destroyChildren/1,disable/1,disconnect/1,disconnect/2,disconnect/3,
enable/1,enable/2,findWindow/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCaret/1,
@@ -54,24 +54,25 @@
getScrollRange/2,getScrollThumb/2,getSize/1,getSizer/1,getTextExtent/2,
getTextExtent/3,getToolTip/1,getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,
getWindowVariant/1,hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,
- hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isEnabled/1,
- isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
- layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
- move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
- navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,popEventHandler/2,
- popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
- refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
- screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
- setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
- setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ hide/1,inheritAttributes/1,initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,
+ isEnabled/1,isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,
+ isTopLevel/1,layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,
+ move/2,move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,
+ navigate/1,navigate/2,pageDown/1,pageUp/1,parent_class/1,popEventHandler/1,
+ popEventHandler/2,popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,
+ refresh/2,refreshRect/2,refreshRect/3,releaseMouse/1,removeChild/2,
+ reparent/2,screenToClient/1,screenToClient/2,scrollLines/2,scrollPages/2,
+ scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,setAutoLayout/2,
+ setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,setClientSize/2,
+ setClientSize/3,setContainingSizer/2,setCursor/2,setDoubleBuffered/2,
setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -439,6 +440,14 @@ setLabel(This,Label) -> wxControl:setLabel(This,Label).
getLabel(This) -> wxControl:getLabel(This).
%% From wxWindow
%% @hidden
+setDoubleBuffered(This,On) -> wxWindow:setDoubleBuffered(This,On).
+%% @hidden
+isDoubleBuffered(This) -> wxWindow:isDoubleBuffered(This).
+%% @hidden
+canSetTransparent(This) -> wxWindow:canSetTransparent(This).
+%% @hidden
+setTransparent(This,Alpha) -> wxWindow:setTransparent(This,Alpha).
+%% @hidden
warpPointer(This,X,Y) -> wxWindow:warpPointer(This,X,Y).
%% @hidden
validate(This) -> wxWindow:validate(This).
diff --git a/lib/wx/src/gen/wxWindow.erl b/lib/wx/src/gen/wxWindow.erl
index 09928de09a..a8a61d547b 100644
--- a/lib/wx/src/gen/wxWindow.erl
+++ b/lib/wx/src/gen/wxWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,13 +28,13 @@
-module(wxWindow).
-include("wxe.hrl").
--export(['Destroy'/1,cacheBestSize/2,captureMouse/1,center/1,center/2,centerOnParent/1,
- centerOnParent/2,centre/1,centre/2,centreOnParent/1,centreOnParent/2,
- clearBackground/1,clientToScreen/2,clientToScreen/3,close/1,close/2,
- convertDialogToPixels/2,convertPixelsToDialog/2,destroy/1,destroyChildren/1,
- disable/1,enable/1,enable/2,findFocus/0,findWindow/2,findWindowById/1,
- findWindowById/2,findWindowByLabel/1,findWindowByLabel/2,findWindowByName/1,
- findWindowByName/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
+-export(['Destroy'/1,cacheBestSize/2,canSetTransparent/1,captureMouse/1,center/1,
+ center/2,centerOnParent/1,centerOnParent/2,centre/1,centre/2,centreOnParent/1,
+ centreOnParent/2,clearBackground/1,clientToScreen/2,clientToScreen/3,
+ close/1,close/2,convertDialogToPixels/2,convertPixelsToDialog/2,destroy/1,
+ destroyChildren/1,disable/1,enable/1,enable/2,findFocus/0,findWindow/2,
+ findWindowById/1,findWindowById/2,findWindowByLabel/1,findWindowByLabel/2,
+ findWindowByName/1,findWindowByName/2,fit/1,fitInside/1,freeze/1,getAcceleratorTable/1,
getBackgroundColour/1,getBackgroundStyle/1,getBestSize/1,getCapture/0,
getCaret/1,getCharHeight/1,getCharWidth/1,getChildren/1,getClientSize/1,
getContainingSizer/1,getCursor/1,getDropTarget/1,getEventHandler/1,
@@ -45,24 +45,24 @@
getSize/1,getSizer/1,getTextExtent/2,getTextExtent/3,getToolTip/1,
getUpdateRegion/1,getVirtualSize/1,getWindowStyleFlag/1,getWindowVariant/1,
hasCapture/1,hasScrollbar/2,hasTransparentBackground/1,hide/1,inheritAttributes/1,
- initDialog/1,invalidateBestSize/1,isEnabled/1,isExposed/2,isExposed/3,
- isExposed/5,isRetained/1,isShown/1,isTopLevel/1,layout/1,lineDown/1,
- lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,move/3,move/4,moveAfterInTabOrder/2,
- moveBeforeInTabOrder/2,navigate/1,navigate/2,new/0,new/2,new/3,pageDown/1,
- pageUp/1,popEventHandler/1,popEventHandler/2,popupMenu/2,popupMenu/3,
- popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,refreshRect/3,
- releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,screenToClient/2,
- scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,setAcceleratorTable/2,
- setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,setCaret/2,
- setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
- setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,setFont/2,
- setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
+ initDialog/1,invalidateBestSize/1,isDoubleBuffered/1,isEnabled/1,
+ isExposed/2,isExposed/3,isExposed/5,isRetained/1,isShown/1,isTopLevel/1,
+ layout/1,lineDown/1,lineUp/1,lower/1,makeModal/1,makeModal/2,move/2,
+ move/3,move/4,moveAfterInTabOrder/2,moveBeforeInTabOrder/2,navigate/1,
+ navigate/2,new/0,new/2,new/3,pageDown/1,pageUp/1,popEventHandler/1,popEventHandler/2,
+ popupMenu/2,popupMenu/3,popupMenu/4,raise/1,refresh/1,refresh/2,refreshRect/2,
+ refreshRect/3,releaseMouse/1,removeChild/2,reparent/2,screenToClient/1,
+ screenToClient/2,scrollLines/2,scrollPages/2,scrollWindow/3,scrollWindow/4,
+ setAcceleratorTable/2,setAutoLayout/2,setBackgroundColour/2,setBackgroundStyle/2,
+ setCaret/2,setClientSize/2,setClientSize/3,setContainingSizer/2,setCursor/2,
+ setDoubleBuffered/2,setDropTarget/2,setExtraStyle/2,setFocus/1,setFocusFromKbd/1,
+ setFont/2,setForegroundColour/2,setHelpText/2,setId/2,setLabel/2,setMaxSize/2,
setMinSize/2,setName/2,setOwnBackgroundColour/2,setOwnFont/2,setOwnForegroundColour/2,
setPalette/2,setScrollPos/3,setScrollPos/4,setScrollbar/5,setScrollbar/6,
setSize/2,setSize/3,setSize/5,setSize/6,setSizeHints/2,setSizeHints/3,
setSizeHints/4,setSizer/2,setSizer/3,setSizerAndFit/2,setSizerAndFit/3,
- setThemeEnabled/2,setToolTip/2,setVirtualSize/2,setVirtualSize/3,
- setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
+ setThemeEnabled/2,setToolTip/2,setTransparent/2,setVirtualSize/2,
+ setVirtualSize/3,setVirtualSizeHints/2,setVirtualSizeHints/3,setVirtualSizeHints/4,
setWindowStyle/2,setWindowStyleFlag/2,setWindowVariant/2,shouldInheritColours/1,
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
@@ -1910,6 +1910,40 @@ warpPointer(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
wxe_util:cast(?wxWindow_WarpPointer,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
+%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxwindow.html#wxwindowsettransparent">external documentation</a>.
+-spec setTransparent(This, Alpha) -> boolean() when
+ This::wxWindow(), Alpha::integer().
+setTransparent(#wx_ref{type=ThisT,ref=ThisRef},Alpha)
+ when is_integer(Alpha) ->
+ ?CLASS(ThisT,wxWindow),
+ wxe_util:call(?wxWindow_SetTransparent,
+ <<ThisRef:32/?UI,Alpha:32/?UI>>).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxwindow.html#wxwindowcansettransparent">external documentation</a>.
+-spec canSetTransparent(This) -> boolean() when
+ This::wxWindow().
+canSetTransparent(#wx_ref{type=ThisT,ref=ThisRef}) ->
+ ?CLASS(ThisT,wxWindow),
+ wxe_util:call(?wxWindow_CanSetTransparent,
+ <<ThisRef:32/?UI>>).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxwindow.html#wxwindowisdoublebuffered">external documentation</a>.
+-spec isDoubleBuffered(This) -> boolean() when
+ This::wxWindow().
+isDoubleBuffered(#wx_ref{type=ThisT,ref=ThisRef}) ->
+ ?CLASS(ThisT,wxWindow),
+ wxe_util:call(?wxWindow_IsDoubleBuffered,
+ <<ThisRef:32/?UI>>).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxwindow.html#wxwindowsetdoublebuffered">external documentation</a>.
+-spec setDoubleBuffered(This, On) -> ok when
+ This::wxWindow(), On::boolean().
+setDoubleBuffered(#wx_ref{type=ThisT,ref=ThisRef},On)
+ when is_boolean(On) ->
+ ?CLASS(ThisT,wxWindow),
+ wxe_util:cast(?wxWindow_SetDoubleBuffered,
+ <<ThisRef:32/?UI,(wxe_util:from_bool(On)):32/?UI>>).
+
%% @doc Destroys this object, do not use object again
-spec destroy(This::wxWindow()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
diff --git a/lib/wx/src/gen/wxe_debug.hrl b/lib/wx/src/gen/wxe_debug.hrl
index 375adde47d..a2462a6fb2 100644
--- a/lib/wx/src/gen/wxe_debug.hrl
+++ b/lib/wx/src/gen/wxe_debug.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -192,3186 +192,3190 @@ wxdebug_table() ->
{281, {wxWindow, updateWindowUI, 1}},
{282, {wxWindow, validate, 0}},
{283, {wxWindow, warpPointer, 2}},
- {284, {wxTopLevelWindow, getIcon, 0}},
- {285, {wxTopLevelWindow, getIcons, 0}},
- {286, {wxTopLevelWindow, getTitle, 0}},
- {287, {wxTopLevelWindow, isActive, 0}},
- {288, {wxTopLevelWindow, iconize, 1}},
- {289, {wxTopLevelWindow, isFullScreen, 0}},
- {290, {wxTopLevelWindow, isIconized, 0}},
- {291, {wxTopLevelWindow, isMaximized, 0}},
- {292, {wxTopLevelWindow, maximize, 1}},
- {293, {wxTopLevelWindow, requestUserAttention, 1}},
- {294, {wxTopLevelWindow, setIcon, 1}},
- {295, {wxTopLevelWindow, setIcons, 1}},
- {296, {wxTopLevelWindow, centerOnScreen, 1}},
- {297, {wxTopLevelWindow, centreOnScreen, 1}},
- {299, {wxTopLevelWindow, setShape, 1}},
- {300, {wxTopLevelWindow, setTitle, 1}},
- {301, {wxTopLevelWindow, showFullScreen, 2}},
- {303, {wxFrame, new_4, 4}},
- {304, {wxFrame, new_0, 0}},
- {306, {wxFrame, destruct, 0}},
- {307, {wxFrame, create, 4}},
- {308, {wxFrame, createStatusBar, 1}},
- {309, {wxFrame, createToolBar, 1}},
- {310, {wxFrame, getClientAreaOrigin, 0}},
- {311, {wxFrame, getMenuBar, 0}},
- {312, {wxFrame, getStatusBar, 0}},
- {313, {wxFrame, getStatusBarPane, 0}},
- {314, {wxFrame, getToolBar, 0}},
- {315, {wxFrame, processCommand, 1}},
- {316, {wxFrame, sendSizeEvent, 0}},
- {317, {wxFrame, setMenuBar, 1}},
- {318, {wxFrame, setStatusBar, 1}},
- {319, {wxFrame, setStatusBarPane, 1}},
- {320, {wxFrame, setStatusText, 2}},
- {321, {wxFrame, setStatusWidths, 2}},
- {322, {wxFrame, setToolBar, 1}},
- {323, {wxMiniFrame, new_0, 0}},
- {324, {wxMiniFrame, new_4, 4}},
- {325, {wxMiniFrame, create, 4}},
- {326, {wxMiniFrame, 'Destroy', undefined}},
- {327, {wxSplashScreen, new_0, 0}},
- {328, {wxSplashScreen, new_6, 6}},
- {329, {wxSplashScreen, destruct, 0}},
- {330, {wxSplashScreen, getSplashStyle, 0}},
- {331, {wxSplashScreen, getTimeout, 0}},
- {332, {wxPanel, new_0, 0}},
- {333, {wxPanel, new_6, 6}},
- {334, {wxPanel, new_2, 2}},
- {335, {wxPanel, destruct, 0}},
- {336, {wxPanel, initDialog, 0}},
- {337, {wxPanel, setFocusIgnoringChildren, 0}},
- {338, {wxScrolledWindow, new_0, 0}},
- {339, {wxScrolledWindow, new_2, 2}},
- {340, {wxScrolledWindow, destruct, 0}},
- {341, {wxScrolledWindow, calcScrolledPosition_4, 4}},
- {342, {wxScrolledWindow, calcScrolledPosition_1, 1}},
- {343, {wxScrolledWindow, calcUnscrolledPosition_4, 4}},
- {344, {wxScrolledWindow, calcUnscrolledPosition_1, 1}},
- {345, {wxScrolledWindow, enableScrolling, 2}},
- {346, {wxScrolledWindow, getScrollPixelsPerUnit, 2}},
- {347, {wxScrolledWindow, getViewStart, 2}},
- {348, {wxScrolledWindow, doPrepareDC, 1}},
- {349, {wxScrolledWindow, prepareDC, 1}},
- {350, {wxScrolledWindow, scroll, 2}},
- {351, {wxScrolledWindow, setScrollbars, 5}},
- {352, {wxScrolledWindow, setScrollRate, 2}},
- {353, {wxScrolledWindow, setTargetWindow, 1}},
- {354, {wxSashWindow, new_0, 0}},
- {355, {wxSashWindow, new_2, 2}},
- {356, {wxSashWindow, destruct, 0}},
- {357, {wxSashWindow, getSashVisible, 1}},
- {358, {wxSashWindow, getMaximumSizeX, 0}},
- {359, {wxSashWindow, getMaximumSizeY, 0}},
- {360, {wxSashWindow, getMinimumSizeX, 0}},
- {361, {wxSashWindow, getMinimumSizeY, 0}},
- {362, {wxSashWindow, setMaximumSizeX, 1}},
- {363, {wxSashWindow, setMaximumSizeY, 1}},
- {364, {wxSashWindow, setMinimumSizeX, 1}},
- {365, {wxSashWindow, setMinimumSizeY, 1}},
- {366, {wxSashWindow, setSashVisible, 2}},
- {367, {wxSashLayoutWindow, new_0, 0}},
- {368, {wxSashLayoutWindow, new_2, 2}},
- {369, {wxSashLayoutWindow, create, 2}},
- {370, {wxSashLayoutWindow, getAlignment, 0}},
- {371, {wxSashLayoutWindow, getOrientation, 0}},
- {372, {wxSashLayoutWindow, setAlignment, 1}},
- {373, {wxSashLayoutWindow, setDefaultSize, 1}},
- {374, {wxSashLayoutWindow, setOrientation, 1}},
- {375, {wxSashLayoutWindow, 'Destroy', undefined}},
- {376, {wxGrid, new_0, 0}},
- {377, {wxGrid, new_3, 3}},
- {378, {wxGrid, new_4, 4}},
- {379, {wxGrid, destruct, 0}},
- {380, {wxGrid, appendCols, 1}},
- {381, {wxGrid, appendRows, 1}},
- {382, {wxGrid, autoSize, 0}},
- {383, {wxGrid, autoSizeColumn, 2}},
- {384, {wxGrid, autoSizeColumns, 1}},
- {385, {wxGrid, autoSizeRow, 2}},
- {386, {wxGrid, autoSizeRows, 1}},
- {387, {wxGrid, beginBatch, 0}},
- {388, {wxGrid, blockToDeviceRect, 2}},
- {389, {wxGrid, canDragColSize, 0}},
- {390, {wxGrid, canDragRowSize, 0}},
- {391, {wxGrid, canDragGridSize, 0}},
- {392, {wxGrid, canEnableCellControl, 0}},
- {393, {wxGrid, cellToRect_2, 2}},
- {394, {wxGrid, cellToRect_1, 1}},
- {395, {wxGrid, clearGrid, 0}},
- {396, {wxGrid, clearSelection, 0}},
- {397, {wxGrid, createGrid, 3}},
- {398, {wxGrid, deleteCols, 1}},
- {399, {wxGrid, deleteRows, 1}},
- {400, {wxGrid, disableCellEditControl, 0}},
- {401, {wxGrid, disableDragColSize, 0}},
- {402, {wxGrid, disableDragGridSize, 0}},
- {403, {wxGrid, disableDragRowSize, 0}},
- {404, {wxGrid, enableCellEditControl, 1}},
- {405, {wxGrid, enableDragColSize, 1}},
- {406, {wxGrid, enableDragGridSize, 1}},
- {407, {wxGrid, enableDragRowSize, 1}},
- {408, {wxGrid, enableEditing, 1}},
- {409, {wxGrid, enableGridLines, 1}},
- {410, {wxGrid, endBatch, 0}},
- {411, {wxGrid, fit, 0}},
- {412, {wxGrid, forceRefresh, 0}},
- {413, {wxGrid, getBatchCount, 0}},
- {414, {wxGrid, getCellAlignment, 4}},
- {415, {wxGrid, getCellBackgroundColour, 2}},
- {416, {wxGrid, getCellEditor, 2}},
- {417, {wxGrid, getCellFont, 2}},
- {418, {wxGrid, getCellRenderer, 2}},
- {419, {wxGrid, getCellTextColour, 2}},
- {420, {wxGrid, getCellValue_2, 2}},
- {421, {wxGrid, getCellValue_1, 1}},
- {422, {wxGrid, getColLabelAlignment, 2}},
- {423, {wxGrid, getColLabelSize, 0}},
- {424, {wxGrid, getColLabelValue, 1}},
- {425, {wxGrid, getColMinimalAcceptableWidth, 0}},
- {426, {wxGrid, getDefaultCellAlignment, 2}},
- {427, {wxGrid, getDefaultCellBackgroundColour, 0}},
- {428, {wxGrid, getDefaultCellFont, 0}},
- {429, {wxGrid, getDefaultCellTextColour, 0}},
- {430, {wxGrid, getDefaultColLabelSize, 0}},
- {431, {wxGrid, getDefaultColSize, 0}},
- {432, {wxGrid, getDefaultEditor, 0}},
- {433, {wxGrid, getDefaultEditorForCell_2, 2}},
- {434, {wxGrid, getDefaultEditorForCell_1, 1}},
- {435, {wxGrid, getDefaultEditorForType, 1}},
- {436, {wxGrid, getDefaultRenderer, 0}},
- {437, {wxGrid, getDefaultRendererForCell, 2}},
- {438, {wxGrid, getDefaultRendererForType, 1}},
- {439, {wxGrid, getDefaultRowLabelSize, 0}},
- {440, {wxGrid, getDefaultRowSize, 0}},
- {441, {wxGrid, getGridCursorCol, 0}},
- {442, {wxGrid, getGridCursorRow, 0}},
- {443, {wxGrid, getGridLineColour, 0}},
- {444, {wxGrid, gridLinesEnabled, 0}},
- {445, {wxGrid, getLabelBackgroundColour, 0}},
- {446, {wxGrid, getLabelFont, 0}},
- {447, {wxGrid, getLabelTextColour, 0}},
- {448, {wxGrid, getNumberCols, 0}},
- {449, {wxGrid, getNumberRows, 0}},
- {450, {wxGrid, getOrCreateCellAttr, 2}},
- {451, {wxGrid, getRowMinimalAcceptableHeight, 0}},
- {452, {wxGrid, getRowLabelAlignment, 2}},
- {453, {wxGrid, getRowLabelSize, 0}},
- {454, {wxGrid, getRowLabelValue, 1}},
- {455, {wxGrid, getRowSize, 1}},
- {456, {wxGrid, getScrollLineX, 0}},
- {457, {wxGrid, getScrollLineY, 0}},
- {458, {wxGrid, getSelectedCells, 0}},
- {459, {wxGrid, getSelectedCols, 0}},
- {460, {wxGrid, getSelectedRows, 0}},
- {461, {wxGrid, getSelectionBackground, 0}},
- {462, {wxGrid, getSelectionBlockTopLeft, 0}},
- {463, {wxGrid, getSelectionBlockBottomRight, 0}},
- {464, {wxGrid, getSelectionForeground, 0}},
- {465, {wxGrid, getViewWidth, 0}},
- {466, {wxGrid, getGridWindow, 0}},
- {467, {wxGrid, getGridRowLabelWindow, 0}},
- {468, {wxGrid, getGridColLabelWindow, 0}},
- {469, {wxGrid, getGridCornerLabelWindow, 0}},
- {470, {wxGrid, hideCellEditControl, 0}},
- {471, {wxGrid, insertCols, 1}},
- {472, {wxGrid, insertRows, 1}},
- {473, {wxGrid, isCellEditControlEnabled, 0}},
- {474, {wxGrid, isCurrentCellReadOnly, 0}},
- {475, {wxGrid, isEditable, 0}},
- {476, {wxGrid, isInSelection_2, 2}},
- {477, {wxGrid, isInSelection_1, 1}},
- {478, {wxGrid, isReadOnly, 2}},
- {479, {wxGrid, isSelection, 0}},
- {480, {wxGrid, isVisible_3, 3}},
- {481, {wxGrid, isVisible_2, 2}},
- {482, {wxGrid, makeCellVisible_2, 2}},
- {483, {wxGrid, makeCellVisible_1, 1}},
- {484, {wxGrid, moveCursorDown, 1}},
- {485, {wxGrid, moveCursorLeft, 1}},
- {486, {wxGrid, moveCursorRight, 1}},
- {487, {wxGrid, moveCursorUp, 1}},
- {488, {wxGrid, moveCursorDownBlock, 1}},
- {489, {wxGrid, moveCursorLeftBlock, 1}},
- {490, {wxGrid, moveCursorRightBlock, 1}},
- {491, {wxGrid, moveCursorUpBlock, 1}},
- {492, {wxGrid, movePageDown, 0}},
- {493, {wxGrid, movePageUp, 0}},
- {494, {wxGrid, registerDataType, 3}},
- {495, {wxGrid, saveEditControlValue, 0}},
- {496, {wxGrid, selectAll, 0}},
- {497, {wxGrid, selectBlock_5, 5}},
- {498, {wxGrid, selectBlock_3, 3}},
- {499, {wxGrid, selectCol, 2}},
- {500, {wxGrid, selectRow, 2}},
- {501, {wxGrid, setCellAlignment_4, 4}},
- {502, {wxGrid, setCellAlignment_3, 3}},
- {503, {wxGrid, setCellAlignment_1, 1}},
- {504, {wxGrid, setCellBackgroundColour_3_0, 3}},
- {505, {wxGrid, setCellBackgroundColour_1, 1}},
- {506, {wxGrid, setCellBackgroundColour_3_1, 3}},
- {507, {wxGrid, setCellEditor, 3}},
- {508, {wxGrid, setCellFont, 3}},
- {509, {wxGrid, setCellRenderer, 3}},
- {510, {wxGrid, setCellTextColour_3_0, 3}},
- {511, {wxGrid, setCellTextColour_3_1, 3}},
- {512, {wxGrid, setCellTextColour_1, 1}},
- {513, {wxGrid, setCellValue_3_0, 3}},
- {514, {wxGrid, setCellValue_2, 2}},
- {515, {wxGrid, setCellValue_3_1, 3}},
- {516, {wxGrid, setColAttr, 2}},
- {517, {wxGrid, setColFormatBool, 1}},
- {518, {wxGrid, setColFormatNumber, 1}},
- {519, {wxGrid, setColFormatFloat, 2}},
- {520, {wxGrid, setColFormatCustom, 2}},
- {521, {wxGrid, setColLabelAlignment, 2}},
- {522, {wxGrid, setColLabelSize, 1}},
- {523, {wxGrid, setColLabelValue, 2}},
- {524, {wxGrid, setColMinimalWidth, 2}},
- {525, {wxGrid, setColMinimalAcceptableWidth, 1}},
- {526, {wxGrid, setColSize, 2}},
- {527, {wxGrid, setDefaultCellAlignment, 2}},
- {528, {wxGrid, setDefaultCellBackgroundColour, 1}},
- {529, {wxGrid, setDefaultCellFont, 1}},
- {530, {wxGrid, setDefaultCellTextColour, 1}},
- {531, {wxGrid, setDefaultEditor, 1}},
- {532, {wxGrid, setDefaultRenderer, 1}},
- {533, {wxGrid, setDefaultColSize, 2}},
- {534, {wxGrid, setDefaultRowSize, 2}},
- {535, {wxGrid, setGridCursor, 2}},
- {536, {wxGrid, setGridLineColour, 1}},
- {537, {wxGrid, setLabelBackgroundColour, 1}},
- {538, {wxGrid, setLabelFont, 1}},
- {539, {wxGrid, setLabelTextColour, 1}},
- {540, {wxGrid, setMargins, 2}},
- {541, {wxGrid, setReadOnly, 3}},
- {542, {wxGrid, setRowAttr, 2}},
- {543, {wxGrid, setRowLabelAlignment, 2}},
- {544, {wxGrid, setRowLabelSize, 1}},
- {545, {wxGrid, setRowLabelValue, 2}},
- {546, {wxGrid, setRowMinimalHeight, 2}},
- {547, {wxGrid, setRowMinimalAcceptableHeight, 1}},
- {548, {wxGrid, setRowSize, 2}},
- {549, {wxGrid, setScrollLineX, 1}},
- {550, {wxGrid, setScrollLineY, 1}},
- {551, {wxGrid, setSelectionBackground, 1}},
- {552, {wxGrid, setSelectionForeground, 1}},
- {553, {wxGrid, setSelectionMode, 1}},
- {554, {wxGrid, showCellEditControl, 0}},
- {555, {wxGrid, xToCol, 2}},
- {556, {wxGrid, xToEdgeOfCol, 1}},
- {557, {wxGrid, yToEdgeOfRow, 1}},
- {558, {wxGrid, yToRow, 1}},
- {559, {wxGridCellRenderer, draw, 7}},
- {560, {wxGridCellRenderer, getBestSize, 5}},
- {561, {wxGridCellEditor, create, 3}},
- {562, {wxGridCellEditor, isCreated, 0}},
- {563, {wxGridCellEditor, setSize, 1}},
- {564, {wxGridCellEditor, show, 2}},
- {565, {wxGridCellEditor, paintBackground, 2}},
- {566, {wxGridCellEditor, beginEdit, 3}},
- {567, {wxGridCellEditor, endEdit, 3}},
- {568, {wxGridCellEditor, reset, 0}},
- {569, {wxGridCellEditor, startingKey, 1}},
- {570, {wxGridCellEditor, startingClick, 0}},
- {571, {wxGridCellEditor, handleReturn, 1}},
- {572, {wxGridCellBoolRenderer, new, 0}},
- {573, {wxGridCellBoolRenderer, 'Destroy', undefined}},
- {574, {wxGridCellBoolEditor, new, 0}},
- {575, {wxGridCellBoolEditor, isTrueValue, 1}},
- {576, {wxGridCellBoolEditor, useStringValues, 1}},
- {577, {wxGridCellBoolEditor, 'Destroy', undefined}},
- {578, {wxGridCellFloatRenderer, new, 1}},
- {579, {wxGridCellFloatRenderer, getPrecision, 0}},
- {580, {wxGridCellFloatRenderer, getWidth, 0}},
- {581, {wxGridCellFloatRenderer, setParameters, 1}},
- {582, {wxGridCellFloatRenderer, setPrecision, 1}},
- {583, {wxGridCellFloatRenderer, setWidth, 1}},
- {584, {wxGridCellFloatRenderer, 'Destroy', undefined}},
- {585, {wxGridCellFloatEditor, new, 1}},
- {586, {wxGridCellFloatEditor, setParameters, 1}},
- {587, {wxGridCellFloatEditor, 'Destroy', undefined}},
- {588, {wxGridCellStringRenderer, new, 0}},
- {589, {wxGridCellStringRenderer, 'Destroy', undefined}},
- {590, {wxGridCellTextEditor, new, 0}},
- {591, {wxGridCellTextEditor, setParameters, 1}},
- {592, {wxGridCellTextEditor, 'Destroy', undefined}},
- {594, {wxGridCellChoiceEditor, new, 2}},
- {595, {wxGridCellChoiceEditor, setParameters, 1}},
- {596, {wxGridCellChoiceEditor, 'Destroy', undefined}},
- {597, {wxGridCellNumberRenderer, new, 0}},
- {598, {wxGridCellNumberRenderer, 'Destroy', undefined}},
- {599, {wxGridCellNumberEditor, new, 1}},
- {600, {wxGridCellNumberEditor, getValue, 0}},
- {601, {wxGridCellNumberEditor, setParameters, 1}},
- {602, {wxGridCellNumberEditor, 'Destroy', undefined}},
- {603, {wxGridCellAttr, setTextColour, 1}},
- {604, {wxGridCellAttr, setBackgroundColour, 1}},
- {605, {wxGridCellAttr, setFont, 1}},
- {606, {wxGridCellAttr, setAlignment, 2}},
- {607, {wxGridCellAttr, setReadOnly, 1}},
- {608, {wxGridCellAttr, setRenderer, 1}},
- {609, {wxGridCellAttr, setEditor, 1}},
- {610, {wxGridCellAttr, hasTextColour, 0}},
- {611, {wxGridCellAttr, hasBackgroundColour, 0}},
- {612, {wxGridCellAttr, hasFont, 0}},
- {613, {wxGridCellAttr, hasAlignment, 0}},
- {614, {wxGridCellAttr, hasRenderer, 0}},
- {615, {wxGridCellAttr, hasEditor, 0}},
- {616, {wxGridCellAttr, getTextColour, 0}},
- {617, {wxGridCellAttr, getBackgroundColour, 0}},
- {618, {wxGridCellAttr, getFont, 0}},
- {619, {wxGridCellAttr, getAlignment, 2}},
- {620, {wxGridCellAttr, getRenderer, 3}},
- {621, {wxGridCellAttr, getEditor, 3}},
- {622, {wxGridCellAttr, isReadOnly, 0}},
- {623, {wxGridCellAttr, setDefAttr, 1}},
- {624, {wxDC, blit, 5}},
- {625, {wxDC, calcBoundingBox, 2}},
- {626, {wxDC, clear, 0}},
- {627, {wxDC, computeScaleAndOrigin, 0}},
- {628, {wxDC, crossHair, 1}},
- {629, {wxDC, destroyClippingRegion, 0}},
- {630, {wxDC, deviceToLogicalX, 1}},
- {631, {wxDC, deviceToLogicalXRel, 1}},
- {632, {wxDC, deviceToLogicalY, 1}},
- {633, {wxDC, deviceToLogicalYRel, 1}},
- {634, {wxDC, drawArc, 3}},
- {635, {wxDC, drawBitmap, 3}},
- {636, {wxDC, drawCheckMark, 1}},
- {637, {wxDC, drawCircle, 2}},
- {639, {wxDC, drawEllipse_2, 2}},
- {640, {wxDC, drawEllipse_1, 1}},
- {641, {wxDC, drawEllipticArc, 4}},
- {642, {wxDC, drawIcon, 2}},
- {643, {wxDC, drawLabel, 3}},
- {644, {wxDC, drawLine, 2}},
- {645, {wxDC, drawLines, 3}},
- {647, {wxDC, drawPolygon, 3}},
- {649, {wxDC, drawPoint, 1}},
- {651, {wxDC, drawRectangle_2, 2}},
- {652, {wxDC, drawRectangle_1, 1}},
- {653, {wxDC, drawRotatedText, 3}},
- {655, {wxDC, drawRoundedRectangle_3, 3}},
- {656, {wxDC, drawRoundedRectangle_2, 2}},
- {657, {wxDC, drawText, 2}},
- {658, {wxDC, endDoc, 0}},
- {659, {wxDC, endPage, 0}},
- {660, {wxDC, floodFill, 3}},
- {661, {wxDC, getBackground, 0}},
- {662, {wxDC, getBackgroundMode, 0}},
- {663, {wxDC, getBrush, 0}},
- {664, {wxDC, getCharHeight, 0}},
- {665, {wxDC, getCharWidth, 0}},
- {666, {wxDC, getClippingBox, 4}},
- {668, {wxDC, getFont, 0}},
- {669, {wxDC, getLayoutDirection, 0}},
- {670, {wxDC, getLogicalFunction, 0}},
- {671, {wxDC, getMapMode, 0}},
- {672, {wxDC, getMultiLineTextExtent_4, 4}},
- {673, {wxDC, getMultiLineTextExtent_1, 1}},
- {674, {wxDC, getPartialTextExtents, 2}},
- {675, {wxDC, getPen, 0}},
- {676, {wxDC, getPixel, 2}},
- {677, {wxDC, getPPI, 0}},
- {679, {wxDC, getSize, 0}},
- {681, {wxDC, getSizeMM, 0}},
- {682, {wxDC, getTextBackground, 0}},
- {683, {wxDC, getTextExtent_4, 4}},
- {684, {wxDC, getTextExtent_1, 1}},
- {686, {wxDC, getTextForeground, 0}},
- {687, {wxDC, getUserScale, 2}},
- {688, {wxDC, gradientFillConcentric_3, 3}},
- {689, {wxDC, gradientFillConcentric_4, 4}},
- {690, {wxDC, gradientFillLinear, 4}},
- {691, {wxDC, logicalToDeviceX, 1}},
- {692, {wxDC, logicalToDeviceXRel, 1}},
- {693, {wxDC, logicalToDeviceY, 1}},
- {694, {wxDC, logicalToDeviceYRel, 1}},
- {695, {wxDC, maxX, 0}},
- {696, {wxDC, maxY, 0}},
- {697, {wxDC, minX, 0}},
- {698, {wxDC, minY, 0}},
- {699, {wxDC, isOk, 0}},
- {700, {wxDC, resetBoundingBox, 0}},
- {701, {wxDC, setAxisOrientation, 2}},
- {702, {wxDC, setBackground, 1}},
- {703, {wxDC, setBackgroundMode, 1}},
- {704, {wxDC, setBrush, 1}},
- {706, {wxDC, setClippingRegion_2, 2}},
- {707, {wxDC, setClippingRegion_1_1, 1}},
- {708, {wxDC, setClippingRegion_1_0, 1}},
- {709, {wxDC, setDeviceOrigin, 2}},
- {710, {wxDC, setFont, 1}},
- {711, {wxDC, setLayoutDirection, 1}},
- {712, {wxDC, setLogicalFunction, 1}},
- {713, {wxDC, setMapMode, 1}},
- {714, {wxDC, setPalette, 1}},
- {715, {wxDC, setPen, 1}},
- {716, {wxDC, setTextBackground, 1}},
- {717, {wxDC, setTextForeground, 1}},
- {718, {wxDC, setUserScale, 2}},
- {719, {wxDC, startDoc, 1}},
- {720, {wxDC, startPage, 0}},
- {721, {wxMirrorDC, new, 2}},
- {722, {wxMirrorDC, 'Destroy', undefined}},
- {723, {wxScreenDC, new, 0}},
- {724, {wxScreenDC, destruct, 0}},
- {725, {wxPostScriptDC, new_0, 0}},
- {726, {wxPostScriptDC, new_1, 1}},
- {727, {wxPostScriptDC, destruct, 0}},
- {728, {wxPostScriptDC, setResolution, 1}},
- {729, {wxPostScriptDC, getResolution, 0}},
- {730, {wxWindowDC, new_0, 0}},
- {731, {wxWindowDC, new_1, 1}},
- {732, {wxWindowDC, destruct, 0}},
- {733, {wxClientDC, new_0, 0}},
- {734, {wxClientDC, new_1, 1}},
- {735, {wxClientDC, 'Destroy', undefined}},
- {736, {wxPaintDC, new_0, 0}},
- {737, {wxPaintDC, new_1, 1}},
- {738, {wxPaintDC, 'Destroy', undefined}},
- {740, {wxMemoryDC, new_1_0, 1}},
- {741, {wxMemoryDC, new_1_1, 1}},
- {742, {wxMemoryDC, new_0, 0}},
- {744, {wxMemoryDC, destruct, 0}},
- {745, {wxMemoryDC, selectObject, 1}},
- {746, {wxMemoryDC, selectObjectAsSource, 1}},
- {747, {wxBufferedDC, new_0, 0}},
- {748, {wxBufferedDC, new_2, 2}},
- {749, {wxBufferedDC, new_3, 3}},
- {750, {wxBufferedDC, destruct, 0}},
- {751, {wxBufferedDC, init_2, 2}},
- {752, {wxBufferedDC, init_3, 3}},
- {753, {wxBufferedPaintDC, new_3, 3}},
- {754, {wxBufferedPaintDC, new_2, 2}},
- {755, {wxBufferedPaintDC, destruct, 0}},
- {756, {wxGraphicsObject, destruct, 0}},
- {757, {wxGraphicsObject, getRenderer, 0}},
- {758, {wxGraphicsObject, isNull, 0}},
- {759, {wxGraphicsContext, destruct, 0}},
- {760, {wxGraphicsContext, create_1_1, 1}},
- {761, {wxGraphicsContext, create_1_0, 1}},
- {762, {wxGraphicsContext, create_0, 0}},
- {763, {wxGraphicsContext, createPen, 1}},
- {764, {wxGraphicsContext, createBrush, 1}},
- {765, {wxGraphicsContext, createRadialGradientBrush, 7}},
- {766, {wxGraphicsContext, createLinearGradientBrush, 6}},
- {767, {wxGraphicsContext, createFont, 2}},
- {768, {wxGraphicsContext, createMatrix, 1}},
- {769, {wxGraphicsContext, createPath, 0}},
- {770, {wxGraphicsContext, clip_1, 1}},
- {771, {wxGraphicsContext, clip_4, 4}},
- {772, {wxGraphicsContext, resetClip, 0}},
- {773, {wxGraphicsContext, drawBitmap, 5}},
- {774, {wxGraphicsContext, drawEllipse, 4}},
- {775, {wxGraphicsContext, drawIcon, 5}},
- {776, {wxGraphicsContext, drawLines, 3}},
- {777, {wxGraphicsContext, drawPath, 2}},
- {778, {wxGraphicsContext, drawRectangle, 4}},
- {779, {wxGraphicsContext, drawRoundedRectangle, 5}},
- {780, {wxGraphicsContext, drawText_3, 3}},
- {781, {wxGraphicsContext, drawText_4_0, 4}},
- {782, {wxGraphicsContext, drawText_4_1, 4}},
- {783, {wxGraphicsContext, drawText_5, 5}},
- {784, {wxGraphicsContext, fillPath, 2}},
- {785, {wxGraphicsContext, strokePath, 1}},
- {786, {wxGraphicsContext, getPartialTextExtents, 2}},
- {787, {wxGraphicsContext, getTextExtent, 5}},
- {788, {wxGraphicsContext, rotate, 1}},
- {789, {wxGraphicsContext, scale, 2}},
- {790, {wxGraphicsContext, translate, 2}},
- {791, {wxGraphicsContext, getTransform, 0}},
- {792, {wxGraphicsContext, setTransform, 1}},
- {793, {wxGraphicsContext, concatTransform, 1}},
- {794, {wxGraphicsContext, setBrush_1_1, 1}},
- {795, {wxGraphicsContext, setBrush_1_0, 1}},
- {796, {wxGraphicsContext, setFont_1, 1}},
- {797, {wxGraphicsContext, setFont_2, 2}},
- {798, {wxGraphicsContext, setPen_1_0, 1}},
- {799, {wxGraphicsContext, setPen_1_1, 1}},
- {800, {wxGraphicsContext, strokeLine, 4}},
- {801, {wxGraphicsContext, strokeLines, 2}},
- {803, {wxGraphicsMatrix, concat, 1}},
- {805, {wxGraphicsMatrix, get, 1}},
- {806, {wxGraphicsMatrix, invert, 0}},
- {807, {wxGraphicsMatrix, isEqual, 1}},
- {809, {wxGraphicsMatrix, isIdentity, 0}},
- {810, {wxGraphicsMatrix, rotate, 1}},
- {811, {wxGraphicsMatrix, scale, 2}},
- {812, {wxGraphicsMatrix, translate, 2}},
- {813, {wxGraphicsMatrix, set, 1}},
- {814, {wxGraphicsMatrix, transformPoint, 2}},
- {815, {wxGraphicsMatrix, transformDistance, 2}},
- {816, {wxGraphicsPath, moveToPoint_2, 2}},
- {817, {wxGraphicsPath, moveToPoint_1, 1}},
- {818, {wxGraphicsPath, addArc_6, 6}},
- {819, {wxGraphicsPath, addArc_5, 5}},
- {820, {wxGraphicsPath, addArcToPoint, 5}},
- {821, {wxGraphicsPath, addCircle, 3}},
- {822, {wxGraphicsPath, addCurveToPoint_6, 6}},
- {823, {wxGraphicsPath, addCurveToPoint_3, 3}},
- {824, {wxGraphicsPath, addEllipse, 4}},
- {825, {wxGraphicsPath, addLineToPoint_2, 2}},
- {826, {wxGraphicsPath, addLineToPoint_1, 1}},
- {827, {wxGraphicsPath, addPath, 1}},
- {828, {wxGraphicsPath, addQuadCurveToPoint, 4}},
- {829, {wxGraphicsPath, addRectangle, 4}},
- {830, {wxGraphicsPath, addRoundedRectangle, 5}},
- {831, {wxGraphicsPath, closeSubpath, 0}},
- {832, {wxGraphicsPath, contains_3, 3}},
- {833, {wxGraphicsPath, contains_2, 2}},
- {835, {wxGraphicsPath, getBox, 0}},
- {837, {wxGraphicsPath, getCurrentPoint, 0}},
- {838, {wxGraphicsPath, transform, 1}},
- {839, {wxGraphicsRenderer, getDefaultRenderer, 0}},
- {840, {wxGraphicsRenderer, createContext_1_1, 1}},
- {841, {wxGraphicsRenderer, createContext_1_0, 1}},
- {842, {wxGraphicsRenderer, createPen, 1}},
- {843, {wxGraphicsRenderer, createBrush, 1}},
- {844, {wxGraphicsRenderer, createLinearGradientBrush, 6}},
- {845, {wxGraphicsRenderer, createRadialGradientBrush, 7}},
- {846, {wxGraphicsRenderer, createFont, 2}},
- {847, {wxGraphicsRenderer, createMatrix, 1}},
- {848, {wxGraphicsRenderer, createPath, 0}},
- {850, {wxMenuBar, new_1, 1}},
- {852, {wxMenuBar, new_0, 0}},
- {854, {wxMenuBar, destruct, 0}},
- {855, {wxMenuBar, append, 2}},
- {856, {wxMenuBar, check, 2}},
- {857, {wxMenuBar, enable_2, 2}},
- {858, {wxMenuBar, enable_1, 1}},
- {859, {wxMenuBar, enableTop, 2}},
- {860, {wxMenuBar, findMenu, 1}},
- {861, {wxMenuBar, findMenuItem, 2}},
- {862, {wxMenuBar, findItem, 2}},
- {863, {wxMenuBar, getHelpString, 1}},
- {864, {wxMenuBar, getLabel_1, 1}},
- {865, {wxMenuBar, getLabel_0, 0}},
- {866, {wxMenuBar, getLabelTop, 1}},
- {867, {wxMenuBar, getMenu, 1}},
- {868, {wxMenuBar, getMenuCount, 0}},
- {869, {wxMenuBar, insert, 3}},
- {870, {wxMenuBar, isChecked, 1}},
- {871, {wxMenuBar, isEnabled_1, 1}},
- {872, {wxMenuBar, isEnabled_0, 0}},
- {873, {wxMenuBar, remove, 1}},
- {874, {wxMenuBar, replace, 3}},
- {875, {wxMenuBar, setHelpString, 2}},
- {876, {wxMenuBar, setLabel_2, 2}},
- {877, {wxMenuBar, setLabel_1, 1}},
- {878, {wxMenuBar, setLabelTop, 2}},
- {879, {wxControl, getLabel, 0}},
- {880, {wxControl, setLabel, 1}},
- {881, {wxControlWithItems, append_1, 1}},
- {882, {wxControlWithItems, append_2, 2}},
- {883, {wxControlWithItems, appendStrings_1, 1}},
- {884, {wxControlWithItems, clear, 0}},
- {885, {wxControlWithItems, delete, 1}},
- {886, {wxControlWithItems, findString, 2}},
- {887, {wxControlWithItems, getClientData, 1}},
- {888, {wxControlWithItems, setClientData, 2}},
- {889, {wxControlWithItems, getCount, 0}},
- {890, {wxControlWithItems, getSelection, 0}},
- {891, {wxControlWithItems, getString, 1}},
- {892, {wxControlWithItems, getStringSelection, 0}},
- {893, {wxControlWithItems, insert_2, 2}},
- {894, {wxControlWithItems, insert_3, 3}},
- {895, {wxControlWithItems, isEmpty, 0}},
- {896, {wxControlWithItems, select, 1}},
- {897, {wxControlWithItems, setSelection, 1}},
- {898, {wxControlWithItems, setString, 2}},
- {899, {wxControlWithItems, setStringSelection, 1}},
- {902, {wxMenu, new_2, 2}},
- {903, {wxMenu, new_1, 1}},
- {905, {wxMenu, destruct, 0}},
- {906, {wxMenu, append_3, 3}},
- {907, {wxMenu, append_1, 1}},
- {908, {wxMenu, append_4_0, 4}},
- {909, {wxMenu, append_4_1, 4}},
- {910, {wxMenu, appendCheckItem, 3}},
- {911, {wxMenu, appendRadioItem, 3}},
- {912, {wxMenu, appendSeparator, 0}},
- {913, {wxMenu, break, 0}},
- {914, {wxMenu, check, 2}},
- {915, {wxMenu, delete_1_0, 1}},
- {916, {wxMenu, delete_1_1, 1}},
- {917, {wxMenu, destroy_1_0, 1}},
- {918, {wxMenu, destroy_1_1, 1}},
- {919, {wxMenu, enable, 2}},
- {920, {wxMenu, findItem_1, 1}},
- {921, {wxMenu, findItem_2, 2}},
- {922, {wxMenu, findItemByPosition, 1}},
- {923, {wxMenu, getHelpString, 1}},
- {924, {wxMenu, getLabel, 1}},
- {925, {wxMenu, getMenuItemCount, 0}},
- {926, {wxMenu, getMenuItems, 0}},
- {928, {wxMenu, getTitle, 0}},
- {929, {wxMenu, insert_2, 2}},
- {930, {wxMenu, insert_3, 3}},
- {931, {wxMenu, insert_5_1, 5}},
- {932, {wxMenu, insert_5_0, 5}},
- {933, {wxMenu, insertCheckItem, 4}},
- {934, {wxMenu, insertRadioItem, 4}},
- {935, {wxMenu, insertSeparator, 1}},
- {936, {wxMenu, isChecked, 1}},
- {937, {wxMenu, isEnabled, 1}},
- {938, {wxMenu, prepend_1, 1}},
- {939, {wxMenu, prepend_2, 2}},
- {940, {wxMenu, prepend_4_1, 4}},
- {941, {wxMenu, prepend_4_0, 4}},
- {942, {wxMenu, prependCheckItem, 3}},
- {943, {wxMenu, prependRadioItem, 3}},
- {944, {wxMenu, prependSeparator, 0}},
- {945, {wxMenu, remove_1_0, 1}},
- {946, {wxMenu, remove_1_1, 1}},
- {947, {wxMenu, setHelpString, 2}},
- {948, {wxMenu, setLabel, 2}},
- {949, {wxMenu, setTitle, 1}},
- {950, {wxMenuItem, new, 1}},
- {952, {wxMenuItem, destruct, 0}},
- {953, {wxMenuItem, check, 1}},
- {954, {wxMenuItem, enable, 1}},
- {955, {wxMenuItem, getBitmap, 0}},
- {956, {wxMenuItem, getHelp, 0}},
- {957, {wxMenuItem, getId, 0}},
- {958, {wxMenuItem, getKind, 0}},
- {959, {wxMenuItem, getLabel, 0}},
- {960, {wxMenuItem, getLabelFromText, 1}},
- {961, {wxMenuItem, getMenu, 0}},
- {962, {wxMenuItem, getText, 0}},
- {963, {wxMenuItem, getSubMenu, 0}},
- {964, {wxMenuItem, isCheckable, 0}},
- {965, {wxMenuItem, isChecked, 0}},
- {966, {wxMenuItem, isEnabled, 0}},
- {967, {wxMenuItem, isSeparator, 0}},
- {968, {wxMenuItem, isSubMenu, 0}},
- {969, {wxMenuItem, setBitmap, 1}},
- {970, {wxMenuItem, setHelp, 1}},
- {971, {wxMenuItem, setMenu, 1}},
- {972, {wxMenuItem, setSubMenu, 1}},
- {973, {wxMenuItem, setText, 1}},
- {974, {wxToolBar, addControl, 1}},
- {975, {wxToolBar, addSeparator, 0}},
- {976, {wxToolBar, addTool_5, 5}},
- {977, {wxToolBar, addTool_4_0, 4}},
- {978, {wxToolBar, addTool_1, 1}},
- {979, {wxToolBar, addTool_4_1, 4}},
- {980, {wxToolBar, addTool_3, 3}},
- {981, {wxToolBar, addTool_6, 6}},
- {982, {wxToolBar, addCheckTool, 4}},
- {983, {wxToolBar, addRadioTool, 4}},
- {984, {wxToolBar, addStretchableSpace, 0}},
- {985, {wxToolBar, insertStretchableSpace, 1}},
- {986, {wxToolBar, deleteTool, 1}},
- {987, {wxToolBar, deleteToolByPos, 1}},
- {988, {wxToolBar, enableTool, 2}},
- {989, {wxToolBar, findById, 1}},
- {990, {wxToolBar, findControl, 1}},
- {991, {wxToolBar, findToolForPosition, 2}},
- {992, {wxToolBar, getToolSize, 0}},
- {993, {wxToolBar, getToolBitmapSize, 0}},
- {994, {wxToolBar, getMargins, 0}},
- {995, {wxToolBar, getToolEnabled, 1}},
- {996, {wxToolBar, getToolLongHelp, 1}},
- {997, {wxToolBar, getToolPacking, 0}},
- {998, {wxToolBar, getToolPos, 1}},
- {999, {wxToolBar, getToolSeparation, 0}},
- {1000, {wxToolBar, getToolShortHelp, 1}},
- {1001, {wxToolBar, getToolState, 1}},
- {1002, {wxToolBar, insertControl, 2}},
- {1003, {wxToolBar, insertSeparator, 1}},
- {1004, {wxToolBar, insertTool_5, 5}},
- {1005, {wxToolBar, insertTool_2, 2}},
- {1006, {wxToolBar, insertTool_4, 4}},
- {1007, {wxToolBar, realize, 0}},
- {1008, {wxToolBar, removeTool, 1}},
- {1009, {wxToolBar, setMargins, 2}},
- {1010, {wxToolBar, setToolBitmapSize, 1}},
- {1011, {wxToolBar, setToolLongHelp, 2}},
- {1012, {wxToolBar, setToolPacking, 1}},
- {1013, {wxToolBar, setToolShortHelp, 2}},
- {1014, {wxToolBar, setToolSeparation, 1}},
- {1015, {wxToolBar, toggleTool, 2}},
- {1017, {wxStatusBar, new_0, 0}},
- {1018, {wxStatusBar, new_2, 2}},
- {1020, {wxStatusBar, destruct, 0}},
- {1021, {wxStatusBar, create, 2}},
- {1022, {wxStatusBar, getFieldRect, 2}},
- {1023, {wxStatusBar, getFieldsCount, 0}},
- {1024, {wxStatusBar, getStatusText, 1}},
- {1025, {wxStatusBar, popStatusText, 1}},
- {1026, {wxStatusBar, pushStatusText, 2}},
- {1027, {wxStatusBar, setFieldsCount, 2}},
- {1028, {wxStatusBar, setMinHeight, 1}},
- {1029, {wxStatusBar, setStatusText, 2}},
- {1030, {wxStatusBar, setStatusWidths, 2}},
- {1031, {wxStatusBar, setStatusStyles, 2}},
- {1032, {wxBitmap, new_0, 0}},
- {1033, {wxBitmap, new_3, 3}},
- {1034, {wxBitmap, new_4, 4}},
- {1035, {wxBitmap, new_2_0, 2}},
- {1036, {wxBitmap, new_2_1, 2}},
- {1037, {wxBitmap, destruct, 0}},
- {1038, {wxBitmap, convertToImage, 0}},
- {1039, {wxBitmap, copyFromIcon, 1}},
- {1040, {wxBitmap, create, 3}},
- {1041, {wxBitmap, getDepth, 0}},
- {1042, {wxBitmap, getHeight, 0}},
- {1043, {wxBitmap, getPalette, 0}},
- {1044, {wxBitmap, getMask, 0}},
- {1045, {wxBitmap, getWidth, 0}},
- {1046, {wxBitmap, getSubBitmap, 1}},
- {1047, {wxBitmap, loadFile, 2}},
- {1048, {wxBitmap, ok, 0}},
- {1049, {wxBitmap, saveFile, 3}},
- {1050, {wxBitmap, setDepth, 1}},
- {1051, {wxBitmap, setHeight, 1}},
- {1052, {wxBitmap, setMask, 1}},
- {1053, {wxBitmap, setPalette, 1}},
- {1054, {wxBitmap, setWidth, 1}},
- {1055, {wxIcon, new_0, 0}},
- {1056, {wxIcon, new_2, 2}},
- {1057, {wxIcon, new_1, 1}},
- {1058, {wxIcon, copyFromBitmap, 1}},
- {1059, {wxIcon, 'Destroy', undefined}},
- {1060, {wxIconBundle, new_0, 0}},
- {1061, {wxIconBundle, new_2, 2}},
- {1062, {wxIconBundle, new_1_0, 1}},
- {1063, {wxIconBundle, new_1_1, 1}},
- {1064, {wxIconBundle, destruct, 0}},
- {1065, {wxIconBundle, addIcon_2, 2}},
- {1066, {wxIconBundle, addIcon_1, 1}},
- {1067, {wxIconBundle, getIcon_1_1, 1}},
- {1068, {wxIconBundle, getIcon_1_0, 1}},
- {1069, {wxCursor, new_0, 0}},
- {1070, {wxCursor, new_1_0, 1}},
- {1071, {wxCursor, new_1_1, 1}},
- {1072, {wxCursor, new_4, 4}},
- {1073, {wxCursor, destruct, 0}},
- {1074, {wxCursor, ok, 0}},
- {1075, {wxMask, new_0, 0}},
- {1076, {wxMask, new_2_1, 2}},
- {1077, {wxMask, new_2_0, 2}},
- {1078, {wxMask, new_1, 1}},
- {1079, {wxMask, destruct, 0}},
- {1080, {wxMask, create_2_1, 2}},
- {1081, {wxMask, create_2_0, 2}},
- {1082, {wxMask, create_1, 1}},
- {1083, {wxImage, new_0, 0}},
- {1084, {wxImage, new_3_0, 3}},
- {1085, {wxImage, new_4, 4}},
- {1086, {wxImage, new_5, 5}},
- {1087, {wxImage, new_2, 2}},
- {1088, {wxImage, new_3_1, 3}},
- {1089, {wxImage, blur, 1}},
- {1090, {wxImage, blurHorizontal, 1}},
- {1091, {wxImage, blurVertical, 1}},
- {1092, {wxImage, convertAlphaToMask, 1}},
- {1093, {wxImage, convertToGreyscale, 1}},
- {1094, {wxImage, convertToMono, 3}},
- {1095, {wxImage, copy, 0}},
- {1096, {wxImage, create_3, 3}},
- {1097, {wxImage, create_4, 4}},
- {1098, {wxImage, create_5, 5}},
- {1099, {wxImage, 'Destroy', 0}},
- {1100, {wxImage, findFirstUnusedColour, 4}},
- {1101, {wxImage, getImageExtWildcard, 0}},
- {1102, {wxImage, getAlpha_2, 2}},
- {1103, {wxImage, getAlpha_0, 0}},
- {1104, {wxImage, getBlue, 2}},
- {1105, {wxImage, getData, 0}},
- {1106, {wxImage, getGreen, 2}},
- {1107, {wxImage, getImageCount, 2}},
- {1108, {wxImage, getHeight, 0}},
- {1109, {wxImage, getMaskBlue, 0}},
- {1110, {wxImage, getMaskGreen, 0}},
- {1111, {wxImage, getMaskRed, 0}},
- {1112, {wxImage, getOrFindMaskColour, 3}},
- {1113, {wxImage, getPalette, 0}},
- {1114, {wxImage, getRed, 2}},
- {1115, {wxImage, getSubImage, 1}},
- {1116, {wxImage, getWidth, 0}},
- {1117, {wxImage, hasAlpha, 0}},
- {1118, {wxImage, hasMask, 0}},
- {1119, {wxImage, getOption, 1}},
- {1120, {wxImage, getOptionInt, 1}},
- {1121, {wxImage, hasOption, 1}},
- {1122, {wxImage, initAlpha, 0}},
- {1123, {wxImage, initStandardHandlers, 0}},
- {1124, {wxImage, isTransparent, 3}},
- {1125, {wxImage, loadFile_2, 2}},
- {1126, {wxImage, loadFile_3, 3}},
- {1127, {wxImage, ok, 0}},
- {1128, {wxImage, removeHandler, 1}},
- {1129, {wxImage, mirror, 1}},
- {1130, {wxImage, replace, 6}},
- {1131, {wxImage, rescale, 3}},
- {1132, {wxImage, resize, 3}},
- {1133, {wxImage, rotate, 3}},
- {1134, {wxImage, rotateHue, 1}},
- {1135, {wxImage, rotate90, 1}},
- {1136, {wxImage, saveFile_1, 1}},
- {1137, {wxImage, saveFile_2_0, 2}},
- {1138, {wxImage, saveFile_2_1, 2}},
- {1139, {wxImage, scale, 3}},
- {1140, {wxImage, size, 3}},
- {1141, {wxImage, setAlpha_3, 3}},
- {1142, {wxImage, setAlpha_2, 2}},
- {1143, {wxImage, setData_2, 2}},
- {1144, {wxImage, setData_4, 4}},
- {1145, {wxImage, setMask, 1}},
- {1146, {wxImage, setMaskColour, 3}},
- {1147, {wxImage, setMaskFromImage, 4}},
- {1148, {wxImage, setOption_2_1, 2}},
- {1149, {wxImage, setOption_2_0, 2}},
- {1150, {wxImage, setPalette, 1}},
- {1151, {wxImage, setRGB_5, 5}},
- {1152, {wxImage, setRGB_4, 4}},
- {1153, {wxImage, 'Destroy', undefined}},
- {1154, {wxBrush, new_0, 0}},
- {1155, {wxBrush, new_2, 2}},
- {1156, {wxBrush, new_1, 1}},
- {1158, {wxBrush, destruct, 0}},
- {1159, {wxBrush, getColour, 0}},
- {1160, {wxBrush, getStipple, 0}},
- {1161, {wxBrush, getStyle, 0}},
- {1162, {wxBrush, isHatch, 0}},
- {1163, {wxBrush, isOk, 0}},
- {1164, {wxBrush, setColour_1, 1}},
- {1165, {wxBrush, setColour_3, 3}},
- {1166, {wxBrush, setStipple, 1}},
- {1167, {wxBrush, setStyle, 1}},
- {1168, {wxPen, new_0, 0}},
- {1169, {wxPen, new_2, 2}},
- {1170, {wxPen, destruct, 0}},
- {1171, {wxPen, getCap, 0}},
- {1172, {wxPen, getColour, 0}},
- {1173, {wxPen, getJoin, 0}},
- {1174, {wxPen, getStyle, 0}},
- {1175, {wxPen, getWidth, 0}},
- {1176, {wxPen, isOk, 0}},
- {1177, {wxPen, setCap, 1}},
- {1178, {wxPen, setColour_1, 1}},
- {1179, {wxPen, setColour_3, 3}},
- {1180, {wxPen, setJoin, 1}},
- {1181, {wxPen, setStyle, 1}},
- {1182, {wxPen, setWidth, 1}},
- {1183, {wxRegion, new_0, 0}},
- {1184, {wxRegion, new_4, 4}},
- {1185, {wxRegion, new_2, 2}},
- {1186, {wxRegion, new_1_1, 1}},
- {1188, {wxRegion, new_1_0, 1}},
- {1190, {wxRegion, destruct, 0}},
- {1191, {wxRegion, clear, 0}},
- {1192, {wxRegion, contains_2, 2}},
- {1193, {wxRegion, contains_1_0, 1}},
- {1194, {wxRegion, contains_4, 4}},
- {1195, {wxRegion, contains_1_1, 1}},
- {1196, {wxRegion, convertToBitmap, 0}},
- {1197, {wxRegion, getBox, 0}},
- {1198, {wxRegion, intersect_4, 4}},
- {1199, {wxRegion, intersect_1_1, 1}},
- {1200, {wxRegion, intersect_1_0, 1}},
- {1201, {wxRegion, isEmpty, 0}},
- {1202, {wxRegion, subtract_4, 4}},
- {1203, {wxRegion, subtract_1_1, 1}},
- {1204, {wxRegion, subtract_1_0, 1}},
- {1205, {wxRegion, offset_2, 2}},
- {1206, {wxRegion, offset_1, 1}},
- {1207, {wxRegion, union_4, 4}},
- {1208, {wxRegion, union_1_2, 1}},
- {1209, {wxRegion, union_1_1, 1}},
- {1210, {wxRegion, union_1_0, 1}},
- {1211, {wxRegion, union_3, 3}},
- {1212, {wxRegion, xor_4, 4}},
- {1213, {wxRegion, xor_1_1, 1}},
- {1214, {wxRegion, xor_1_0, 1}},
- {1215, {wxAcceleratorTable, new_0, 0}},
- {1216, {wxAcceleratorTable, new_2, 2}},
- {1217, {wxAcceleratorTable, destruct, 0}},
- {1218, {wxAcceleratorTable, ok, 0}},
- {1219, {wxAcceleratorEntry, new_1_0, 1}},
- {1220, {wxAcceleratorEntry, new_1_1, 1}},
- {1221, {wxAcceleratorEntry, getCommand, 0}},
- {1222, {wxAcceleratorEntry, getFlags, 0}},
- {1223, {wxAcceleratorEntry, getKeyCode, 0}},
- {1224, {wxAcceleratorEntry, set, 4}},
- {1225, {wxAcceleratorEntry, 'Destroy', undefined}},
- {1230, {wxCaret, new_3, 3}},
- {1231, {wxCaret, new_2, 2}},
- {1233, {wxCaret, destruct, 0}},
- {1234, {wxCaret, create_3, 3}},
- {1235, {wxCaret, create_2, 2}},
- {1236, {wxCaret, getBlinkTime, 0}},
- {1238, {wxCaret, getPosition, 0}},
- {1240, {wxCaret, getSize, 0}},
- {1241, {wxCaret, getWindow, 0}},
- {1242, {wxCaret, hide, 0}},
- {1243, {wxCaret, isOk, 0}},
- {1244, {wxCaret, isVisible, 0}},
- {1245, {wxCaret, move_2, 2}},
- {1246, {wxCaret, move_1, 1}},
- {1247, {wxCaret, setBlinkTime, 1}},
- {1248, {wxCaret, setSize_2, 2}},
- {1249, {wxCaret, setSize_1, 1}},
- {1250, {wxCaret, show, 1}},
- {1251, {wxSizer, add_2_1, 2}},
- {1252, {wxSizer, add_2_0, 2}},
- {1253, {wxSizer, add_3, 3}},
- {1254, {wxSizer, add_2_3, 2}},
- {1255, {wxSizer, add_2_2, 2}},
- {1256, {wxSizer, addSpacer, 1}},
- {1257, {wxSizer, addStretchSpacer, 1}},
- {1258, {wxSizer, calcMin, 0}},
- {1259, {wxSizer, clear, 1}},
- {1260, {wxSizer, detach_1_2, 1}},
- {1261, {wxSizer, detach_1_1, 1}},
- {1262, {wxSizer, detach_1_0, 1}},
- {1263, {wxSizer, fit, 1}},
- {1264, {wxSizer, fitInside, 1}},
- {1265, {wxSizer, getChildren, 0}},
- {1266, {wxSizer, getItem_2_1, 2}},
- {1267, {wxSizer, getItem_2_0, 2}},
- {1268, {wxSizer, getItem_1, 1}},
- {1269, {wxSizer, getSize, 0}},
- {1270, {wxSizer, getPosition, 0}},
- {1271, {wxSizer, getMinSize, 0}},
- {1272, {wxSizer, hide_2_0, 2}},
- {1273, {wxSizer, hide_2_1, 2}},
- {1274, {wxSizer, hide_1, 1}},
- {1275, {wxSizer, insert_3_1, 3}},
- {1276, {wxSizer, insert_3_0, 3}},
- {1277, {wxSizer, insert_4, 4}},
- {1278, {wxSizer, insert_3_3, 3}},
- {1279, {wxSizer, insert_3_2, 3}},
- {1280, {wxSizer, insert_2, 2}},
- {1281, {wxSizer, insertSpacer, 2}},
- {1282, {wxSizer, insertStretchSpacer, 2}},
- {1283, {wxSizer, isShown_1_2, 1}},
- {1284, {wxSizer, isShown_1_1, 1}},
- {1285, {wxSizer, isShown_1_0, 1}},
- {1286, {wxSizer, layout, 0}},
- {1287, {wxSizer, prepend_2_1, 2}},
- {1288, {wxSizer, prepend_2_0, 2}},
- {1289, {wxSizer, prepend_3, 3}},
- {1290, {wxSizer, prepend_2_3, 2}},
- {1291, {wxSizer, prepend_2_2, 2}},
- {1292, {wxSizer, prepend_1, 1}},
- {1293, {wxSizer, prependSpacer, 1}},
- {1294, {wxSizer, prependStretchSpacer, 1}},
- {1295, {wxSizer, recalcSizes, 0}},
- {1296, {wxSizer, remove_1_1, 1}},
- {1297, {wxSizer, remove_1_0, 1}},
- {1298, {wxSizer, replace_3_1, 3}},
- {1299, {wxSizer, replace_3_0, 3}},
- {1300, {wxSizer, replace_2, 2}},
- {1301, {wxSizer, setDimension, 4}},
- {1302, {wxSizer, setMinSize_2, 2}},
- {1303, {wxSizer, setMinSize_1, 1}},
- {1304, {wxSizer, setItemMinSize_3_2, 3}},
- {1305, {wxSizer, setItemMinSize_2_2, 2}},
- {1306, {wxSizer, setItemMinSize_3_1, 3}},
- {1307, {wxSizer, setItemMinSize_2_1, 2}},
- {1308, {wxSizer, setItemMinSize_3_0, 3}},
- {1309, {wxSizer, setItemMinSize_2_0, 2}},
- {1310, {wxSizer, setSizeHints, 1}},
- {1311, {wxSizer, setVirtualSizeHints, 1}},
- {1312, {wxSizer, show_2_2, 2}},
- {1313, {wxSizer, show_2_1, 2}},
- {1314, {wxSizer, show_2_0, 2}},
- {1315, {wxSizer, show_1, 1}},
- {1316, {wxSizerFlags, new, 1}},
- {1317, {wxSizerFlags, align, 1}},
- {1318, {wxSizerFlags, border_2, 2}},
- {1319, {wxSizerFlags, border_1, 1}},
- {1320, {wxSizerFlags, center, 0}},
- {1321, {wxSizerFlags, centre, 0}},
- {1322, {wxSizerFlags, expand, 0}},
- {1323, {wxSizerFlags, left, 0}},
- {1324, {wxSizerFlags, proportion, 1}},
- {1325, {wxSizerFlags, right, 0}},
- {1326, {wxSizerFlags, 'Destroy', undefined}},
- {1327, {wxSizerItem, new_5_1, 5}},
- {1328, {wxSizerItem, new_2_1, 2}},
- {1329, {wxSizerItem, new_5_0, 5}},
- {1330, {wxSizerItem, new_2_0, 2}},
- {1331, {wxSizerItem, new_6, 6}},
- {1332, {wxSizerItem, new_3, 3}},
- {1333, {wxSizerItem, new_0, 0}},
- {1334, {wxSizerItem, destruct, 0}},
- {1335, {wxSizerItem, calcMin, 0}},
- {1336, {wxSizerItem, deleteWindows, 0}},
- {1337, {wxSizerItem, detachSizer, 0}},
- {1338, {wxSizerItem, getBorder, 0}},
- {1339, {wxSizerItem, getFlag, 0}},
- {1340, {wxSizerItem, getMinSize, 0}},
- {1341, {wxSizerItem, getPosition, 0}},
- {1342, {wxSizerItem, getProportion, 0}},
- {1343, {wxSizerItem, getRatio, 0}},
- {1344, {wxSizerItem, getRect, 0}},
- {1345, {wxSizerItem, getSize, 0}},
- {1346, {wxSizerItem, getSizer, 0}},
- {1347, {wxSizerItem, getSpacer, 0}},
- {1348, {wxSizerItem, getUserData, 0}},
- {1349, {wxSizerItem, getWindow, 0}},
- {1350, {wxSizerItem, isSizer, 0}},
- {1351, {wxSizerItem, isShown, 0}},
- {1352, {wxSizerItem, isSpacer, 0}},
- {1353, {wxSizerItem, isWindow, 0}},
- {1354, {wxSizerItem, setBorder, 1}},
- {1355, {wxSizerItem, setDimension, 2}},
- {1356, {wxSizerItem, setFlag, 1}},
- {1357, {wxSizerItem, setInitSize, 2}},
- {1358, {wxSizerItem, setMinSize_1, 1}},
- {1359, {wxSizerItem, setMinSize_2, 2}},
- {1360, {wxSizerItem, setProportion, 1}},
- {1361, {wxSizerItem, setRatio_2, 2}},
- {1362, {wxSizerItem, setRatio_1_1, 1}},
- {1363, {wxSizerItem, setRatio_1_0, 1}},
- {1364, {wxSizerItem, setSizer, 1}},
- {1365, {wxSizerItem, setSpacer_1, 1}},
- {1366, {wxSizerItem, setSpacer_2, 2}},
- {1367, {wxSizerItem, setWindow, 1}},
- {1368, {wxSizerItem, show, 1}},
- {1369, {wxBoxSizer, new, 1}},
- {1370, {wxBoxSizer, getOrientation, 0}},
- {1371, {wxBoxSizer, 'Destroy', undefined}},
- {1372, {wxStaticBoxSizer, new_2, 2}},
- {1373, {wxStaticBoxSizer, new_3, 3}},
- {1374, {wxStaticBoxSizer, getStaticBox, 0}},
- {1375, {wxStaticBoxSizer, 'Destroy', undefined}},
- {1376, {wxGridSizer, new_4, 4}},
- {1377, {wxGridSizer, new_2, 2}},
- {1378, {wxGridSizer, getCols, 0}},
- {1379, {wxGridSizer, getHGap, 0}},
- {1380, {wxGridSizer, getRows, 0}},
- {1381, {wxGridSizer, getVGap, 0}},
- {1382, {wxGridSizer, setCols, 1}},
- {1383, {wxGridSizer, setHGap, 1}},
- {1384, {wxGridSizer, setRows, 1}},
- {1385, {wxGridSizer, setVGap, 1}},
- {1386, {wxGridSizer, 'Destroy', undefined}},
- {1387, {wxFlexGridSizer, new_4, 4}},
- {1388, {wxFlexGridSizer, new_2, 2}},
- {1389, {wxFlexGridSizer, addGrowableCol, 2}},
- {1390, {wxFlexGridSizer, addGrowableRow, 2}},
- {1391, {wxFlexGridSizer, getFlexibleDirection, 0}},
- {1392, {wxFlexGridSizer, getNonFlexibleGrowMode, 0}},
- {1393, {wxFlexGridSizer, removeGrowableCol, 1}},
- {1394, {wxFlexGridSizer, removeGrowableRow, 1}},
- {1395, {wxFlexGridSizer, setFlexibleDirection, 1}},
- {1396, {wxFlexGridSizer, setNonFlexibleGrowMode, 1}},
- {1397, {wxFlexGridSizer, 'Destroy', undefined}},
- {1398, {wxGridBagSizer, new, 1}},
- {1399, {wxGridBagSizer, add_3_2, 3}},
- {1400, {wxGridBagSizer, add_3_1, 3}},
- {1401, {wxGridBagSizer, add_4, 4}},
- {1402, {wxGridBagSizer, add_1_0, 1}},
- {1403, {wxGridBagSizer, add_2_1, 2}},
- {1404, {wxGridBagSizer, add_2_0, 2}},
- {1405, {wxGridBagSizer, add_3_0, 3}},
- {1406, {wxGridBagSizer, add_1_1, 1}},
- {1407, {wxGridBagSizer, calcMin, 0}},
- {1408, {wxGridBagSizer, checkForIntersection_2, 2}},
- {1409, {wxGridBagSizer, checkForIntersection_3, 3}},
- {1410, {wxGridBagSizer, findItem_1_1, 1}},
- {1411, {wxGridBagSizer, findItem_1_0, 1}},
- {1412, {wxGridBagSizer, findItemAtPoint, 1}},
- {1413, {wxGridBagSizer, findItemAtPosition, 1}},
- {1414, {wxGridBagSizer, findItemWithData, 1}},
- {1415, {wxGridBagSizer, getCellSize, 2}},
- {1416, {wxGridBagSizer, getEmptyCellSize, 0}},
- {1417, {wxGridBagSizer, getItemPosition_1_2, 1}},
- {1418, {wxGridBagSizer, getItemPosition_1_1, 1}},
- {1419, {wxGridBagSizer, getItemPosition_1_0, 1}},
- {1420, {wxGridBagSizer, getItemSpan_1_2, 1}},
- {1421, {wxGridBagSizer, getItemSpan_1_1, 1}},
- {1422, {wxGridBagSizer, getItemSpan_1_0, 1}},
- {1423, {wxGridBagSizer, setEmptyCellSize, 1}},
- {1424, {wxGridBagSizer, setItemPosition_2_2, 2}},
- {1425, {wxGridBagSizer, setItemPosition_2_1, 2}},
- {1426, {wxGridBagSizer, setItemPosition_2_0, 2}},
- {1427, {wxGridBagSizer, setItemSpan_2_2, 2}},
- {1428, {wxGridBagSizer, setItemSpan_2_1, 2}},
- {1429, {wxGridBagSizer, setItemSpan_2_0, 2}},
- {1430, {wxGridBagSizer, 'Destroy', undefined}},
- {1431, {wxStdDialogButtonSizer, new, 0}},
- {1432, {wxStdDialogButtonSizer, addButton, 1}},
- {1433, {wxStdDialogButtonSizer, realize, 0}},
- {1434, {wxStdDialogButtonSizer, setAffirmativeButton, 1}},
- {1435, {wxStdDialogButtonSizer, setCancelButton, 1}},
- {1436, {wxStdDialogButtonSizer, setNegativeButton, 1}},
- {1437, {wxStdDialogButtonSizer, 'Destroy', undefined}},
- {1438, {wxFont, new_0, 0}},
- {1439, {wxFont, new_1, 1}},
- {1440, {wxFont, new_5, 5}},
- {1442, {wxFont, destruct, 0}},
- {1443, {wxFont, isFixedWidth, 0}},
- {1444, {wxFont, getDefaultEncoding, 0}},
- {1445, {wxFont, getFaceName, 0}},
- {1446, {wxFont, getFamily, 0}},
- {1447, {wxFont, getNativeFontInfoDesc, 0}},
- {1448, {wxFont, getNativeFontInfoUserDesc, 0}},
- {1449, {wxFont, getPointSize, 0}},
- {1450, {wxFont, getStyle, 0}},
- {1451, {wxFont, getUnderlined, 0}},
- {1452, {wxFont, getWeight, 0}},
- {1453, {wxFont, ok, 0}},
- {1454, {wxFont, setDefaultEncoding, 1}},
- {1455, {wxFont, setFaceName, 1}},
- {1456, {wxFont, setFamily, 1}},
- {1457, {wxFont, setPointSize, 1}},
- {1458, {wxFont, setStyle, 1}},
- {1459, {wxFont, setUnderlined, 1}},
- {1460, {wxFont, setWeight, 1}},
- {1461, {wxToolTip, enable, 1}},
- {1462, {wxToolTip, setDelay, 1}},
- {1463, {wxToolTip, new, 1}},
- {1464, {wxToolTip, setTip, 1}},
- {1465, {wxToolTip, getTip, 0}},
- {1466, {wxToolTip, getWindow, 0}},
- {1467, {wxToolTip, 'Destroy', undefined}},
- {1469, {wxButton, new_3, 3}},
- {1470, {wxButton, new_0, 0}},
- {1471, {wxButton, destruct, 0}},
- {1472, {wxButton, create, 3}},
- {1473, {wxButton, getDefaultSize, 0}},
- {1474, {wxButton, setDefault, 0}},
- {1475, {wxButton, setLabel, 1}},
- {1477, {wxBitmapButton, new_4, 4}},
- {1478, {wxBitmapButton, new_0, 0}},
- {1479, {wxBitmapButton, create, 4}},
- {1480, {wxBitmapButton, getBitmapDisabled, 0}},
- {1482, {wxBitmapButton, getBitmapFocus, 0}},
- {1484, {wxBitmapButton, getBitmapLabel, 0}},
- {1486, {wxBitmapButton, getBitmapSelected, 0}},
- {1488, {wxBitmapButton, setBitmapDisabled, 1}},
- {1489, {wxBitmapButton, setBitmapFocus, 1}},
- {1490, {wxBitmapButton, setBitmapLabel, 1}},
- {1491, {wxBitmapButton, setBitmapSelected, 1}},
- {1492, {wxBitmapButton, 'Destroy', undefined}},
- {1493, {wxToggleButton, new_0, 0}},
- {1494, {wxToggleButton, new_4, 4}},
- {1495, {wxToggleButton, create, 4}},
- {1496, {wxToggleButton, getValue, 0}},
- {1497, {wxToggleButton, setValue, 1}},
- {1498, {wxToggleButton, 'Destroy', undefined}},
- {1499, {wxCalendarCtrl, new_0, 0}},
- {1500, {wxCalendarCtrl, new_3, 3}},
- {1501, {wxCalendarCtrl, create, 3}},
- {1502, {wxCalendarCtrl, destruct, 0}},
- {1503, {wxCalendarCtrl, setDate, 1}},
- {1504, {wxCalendarCtrl, getDate, 0}},
- {1505, {wxCalendarCtrl, enableYearChange, 1}},
- {1506, {wxCalendarCtrl, enableMonthChange, 1}},
- {1507, {wxCalendarCtrl, enableHolidayDisplay, 1}},
- {1508, {wxCalendarCtrl, setHeaderColours, 2}},
- {1509, {wxCalendarCtrl, getHeaderColourFg, 0}},
- {1510, {wxCalendarCtrl, getHeaderColourBg, 0}},
- {1511, {wxCalendarCtrl, setHighlightColours, 2}},
- {1512, {wxCalendarCtrl, getHighlightColourFg, 0}},
- {1513, {wxCalendarCtrl, getHighlightColourBg, 0}},
- {1514, {wxCalendarCtrl, setHolidayColours, 2}},
- {1515, {wxCalendarCtrl, getHolidayColourFg, 0}},
- {1516, {wxCalendarCtrl, getHolidayColourBg, 0}},
- {1517, {wxCalendarCtrl, getAttr, 1}},
- {1518, {wxCalendarCtrl, setAttr, 2}},
- {1519, {wxCalendarCtrl, setHoliday, 1}},
- {1520, {wxCalendarCtrl, resetAttr, 1}},
- {1521, {wxCalendarCtrl, hitTest, 2}},
- {1522, {wxCalendarDateAttr, new_0, 0}},
- {1523, {wxCalendarDateAttr, new_2_1, 2}},
- {1524, {wxCalendarDateAttr, new_2_0, 2}},
- {1525, {wxCalendarDateAttr, setTextColour, 1}},
- {1526, {wxCalendarDateAttr, setBackgroundColour, 1}},
- {1527, {wxCalendarDateAttr, setBorderColour, 1}},
- {1528, {wxCalendarDateAttr, setFont, 1}},
- {1529, {wxCalendarDateAttr, setBorder, 1}},
- {1530, {wxCalendarDateAttr, setHoliday, 1}},
- {1531, {wxCalendarDateAttr, hasTextColour, 0}},
- {1532, {wxCalendarDateAttr, hasBackgroundColour, 0}},
- {1533, {wxCalendarDateAttr, hasBorderColour, 0}},
- {1534, {wxCalendarDateAttr, hasFont, 0}},
- {1535, {wxCalendarDateAttr, hasBorder, 0}},
- {1536, {wxCalendarDateAttr, isHoliday, 0}},
- {1537, {wxCalendarDateAttr, getTextColour, 0}},
- {1538, {wxCalendarDateAttr, getBackgroundColour, 0}},
- {1539, {wxCalendarDateAttr, getBorderColour, 0}},
- {1540, {wxCalendarDateAttr, getFont, 0}},
- {1541, {wxCalendarDateAttr, getBorder, 0}},
- {1542, {wxCalendarDateAttr, 'Destroy', undefined}},
- {1544, {wxCheckBox, new_4, 4}},
- {1545, {wxCheckBox, new_0, 0}},
- {1546, {wxCheckBox, create, 4}},
- {1547, {wxCheckBox, getValue, 0}},
- {1548, {wxCheckBox, get3StateValue, 0}},
- {1549, {wxCheckBox, is3rdStateAllowedForUser, 0}},
- {1550, {wxCheckBox, is3State, 0}},
- {1551, {wxCheckBox, isChecked, 0}},
- {1552, {wxCheckBox, setValue, 1}},
- {1553, {wxCheckBox, set3StateValue, 1}},
- {1554, {wxCheckBox, 'Destroy', undefined}},
- {1555, {wxCheckListBox, new_0, 0}},
- {1557, {wxCheckListBox, new_3, 3}},
- {1558, {wxCheckListBox, check, 2}},
- {1559, {wxCheckListBox, isChecked, 1}},
- {1560, {wxCheckListBox, 'Destroy', undefined}},
- {1563, {wxChoice, new_3, 3}},
- {1564, {wxChoice, new_0, 0}},
- {1566, {wxChoice, destruct, 0}},
- {1568, {wxChoice, create, 6}},
- {1569, {wxChoice, delete, 1}},
- {1570, {wxChoice, getColumns, 0}},
- {1571, {wxChoice, setColumns, 1}},
- {1572, {wxComboBox, new_0, 0}},
- {1574, {wxComboBox, new_3, 3}},
- {1575, {wxComboBox, destruct, 0}},
- {1577, {wxComboBox, create, 7}},
- {1578, {wxComboBox, canCopy, 0}},
- {1579, {wxComboBox, canCut, 0}},
- {1580, {wxComboBox, canPaste, 0}},
- {1581, {wxComboBox, canRedo, 0}},
- {1582, {wxComboBox, canUndo, 0}},
- {1583, {wxComboBox, copy, 0}},
- {1584, {wxComboBox, cut, 0}},
- {1585, {wxComboBox, getInsertionPoint, 0}},
- {1586, {wxComboBox, getLastPosition, 0}},
- {1587, {wxComboBox, getValue, 0}},
- {1588, {wxComboBox, paste, 0}},
- {1589, {wxComboBox, redo, 0}},
- {1590, {wxComboBox, replace, 3}},
- {1591, {wxComboBox, remove, 2}},
- {1592, {wxComboBox, setInsertionPoint, 1}},
- {1593, {wxComboBox, setInsertionPointEnd, 0}},
- {1594, {wxComboBox, setSelection_1, 1}},
- {1595, {wxComboBox, setSelection_2, 2}},
- {1596, {wxComboBox, setValue, 1}},
- {1597, {wxComboBox, undo, 0}},
- {1598, {wxGauge, new_0, 0}},
- {1599, {wxGauge, new_4, 4}},
- {1600, {wxGauge, create, 4}},
- {1601, {wxGauge, getBezelFace, 0}},
- {1602, {wxGauge, getRange, 0}},
- {1603, {wxGauge, getShadowWidth, 0}},
- {1604, {wxGauge, getValue, 0}},
- {1605, {wxGauge, isVertical, 0}},
- {1606, {wxGauge, setBezelFace, 1}},
- {1607, {wxGauge, setRange, 1}},
- {1608, {wxGauge, setShadowWidth, 1}},
- {1609, {wxGauge, setValue, 1}},
- {1610, {wxGauge, pulse, 0}},
- {1611, {wxGauge, 'Destroy', undefined}},
- {1612, {wxGenericDirCtrl, new_0, 0}},
- {1613, {wxGenericDirCtrl, new_2, 2}},
- {1614, {wxGenericDirCtrl, destruct, 0}},
- {1615, {wxGenericDirCtrl, create, 2}},
- {1616, {wxGenericDirCtrl, init, 0}},
- {1617, {wxGenericDirCtrl, collapseTree, 0}},
- {1618, {wxGenericDirCtrl, expandPath, 1}},
- {1619, {wxGenericDirCtrl, getDefaultPath, 0}},
- {1620, {wxGenericDirCtrl, getPath, 0}},
- {1621, {wxGenericDirCtrl, getFilePath, 0}},
- {1622, {wxGenericDirCtrl, getFilter, 0}},
- {1623, {wxGenericDirCtrl, getFilterIndex, 0}},
- {1624, {wxGenericDirCtrl, getRootId, 0}},
- {1625, {wxGenericDirCtrl, getTreeCtrl, 0}},
- {1626, {wxGenericDirCtrl, reCreateTree, 0}},
- {1627, {wxGenericDirCtrl, setDefaultPath, 1}},
- {1628, {wxGenericDirCtrl, setFilter, 1}},
- {1629, {wxGenericDirCtrl, setFilterIndex, 1}},
- {1630, {wxGenericDirCtrl, setPath, 1}},
- {1632, {wxStaticBox, new_4, 4}},
- {1633, {wxStaticBox, new_0, 0}},
- {1634, {wxStaticBox, create, 4}},
- {1635, {wxStaticBox, 'Destroy', undefined}},
- {1637, {wxStaticLine, new_2, 2}},
- {1638, {wxStaticLine, new_0, 0}},
- {1639, {wxStaticLine, create, 2}},
- {1640, {wxStaticLine, isVertical, 0}},
- {1641, {wxStaticLine, getDefaultSize, 0}},
- {1642, {wxStaticLine, 'Destroy', undefined}},
- {1645, {wxListBox, new_3, 3}},
- {1646, {wxListBox, new_0, 0}},
- {1648, {wxListBox, destruct, 0}},
- {1650, {wxListBox, create, 6}},
- {1651, {wxListBox, deselect, 1}},
- {1652, {wxListBox, getSelections, 1}},
- {1653, {wxListBox, insertItems, 2}},
- {1654, {wxListBox, isSelected, 1}},
- {1655, {wxListBox, set, 1}},
- {1656, {wxListBox, hitTest, 1}},
- {1657, {wxListBox, setFirstItem_1_0, 1}},
- {1658, {wxListBox, setFirstItem_1_1, 1}},
- {1659, {wxListCtrl, new_0, 0}},
- {1660, {wxListCtrl, new_2, 2}},
- {1661, {wxListCtrl, arrange, 1}},
- {1662, {wxListCtrl, assignImageList, 2}},
- {1663, {wxListCtrl, clearAll, 0}},
- {1664, {wxListCtrl, create, 2}},
- {1665, {wxListCtrl, deleteAllItems, 0}},
- {1666, {wxListCtrl, deleteColumn, 1}},
- {1667, {wxListCtrl, deleteItem, 1}},
- {1668, {wxListCtrl, editLabel, 1}},
- {1669, {wxListCtrl, ensureVisible, 1}},
- {1670, {wxListCtrl, findItem_3_0, 3}},
- {1671, {wxListCtrl, findItem_3_1, 3}},
- {1672, {wxListCtrl, getColumn, 2}},
- {1673, {wxListCtrl, getColumnCount, 0}},
- {1674, {wxListCtrl, getColumnWidth, 1}},
- {1675, {wxListCtrl, getCountPerPage, 0}},
- {1676, {wxListCtrl, getEditControl, 0}},
- {1677, {wxListCtrl, getImageList, 1}},
- {1678, {wxListCtrl, getItem, 1}},
- {1679, {wxListCtrl, getItemBackgroundColour, 1}},
- {1680, {wxListCtrl, getItemCount, 0}},
- {1681, {wxListCtrl, getItemData, 1}},
- {1682, {wxListCtrl, getItemFont, 1}},
- {1683, {wxListCtrl, getItemPosition, 2}},
- {1684, {wxListCtrl, getItemRect, 3}},
- {1685, {wxListCtrl, getItemSpacing, 0}},
- {1686, {wxListCtrl, getItemState, 2}},
- {1687, {wxListCtrl, getItemText, 1}},
- {1688, {wxListCtrl, getItemTextColour, 1}},
- {1689, {wxListCtrl, getNextItem, 2}},
- {1690, {wxListCtrl, getSelectedItemCount, 0}},
- {1691, {wxListCtrl, getTextColour, 0}},
- {1692, {wxListCtrl, getTopItem, 0}},
- {1693, {wxListCtrl, getViewRect, 0}},
- {1694, {wxListCtrl, hitTest, 2}},
- {1695, {wxListCtrl, insertColumn_2, 2}},
- {1696, {wxListCtrl, insertColumn_3, 3}},
- {1697, {wxListCtrl, insertItem_1, 1}},
- {1698, {wxListCtrl, insertItem_2_1, 2}},
- {1699, {wxListCtrl, insertItem_2_0, 2}},
- {1700, {wxListCtrl, insertItem_3, 3}},
- {1701, {wxListCtrl, refreshItem, 1}},
- {1702, {wxListCtrl, refreshItems, 2}},
- {1703, {wxListCtrl, scrollList, 2}},
- {1704, {wxListCtrl, setBackgroundColour, 1}},
- {1705, {wxListCtrl, setColumn, 2}},
- {1706, {wxListCtrl, setColumnWidth, 2}},
- {1707, {wxListCtrl, setImageList, 2}},
- {1708, {wxListCtrl, setItem_1, 1}},
- {1709, {wxListCtrl, setItem_4, 4}},
- {1710, {wxListCtrl, setItemBackgroundColour, 2}},
- {1711, {wxListCtrl, setItemCount, 1}},
- {1712, {wxListCtrl, setItemData, 2}},
- {1713, {wxListCtrl, setItemFont, 2}},
- {1714, {wxListCtrl, setItemImage, 3}},
- {1715, {wxListCtrl, setItemColumnImage, 3}},
- {1716, {wxListCtrl, setItemPosition, 2}},
- {1717, {wxListCtrl, setItemState, 3}},
- {1718, {wxListCtrl, setItemText, 2}},
- {1719, {wxListCtrl, setItemTextColour, 2}},
- {1720, {wxListCtrl, setSingleStyle, 2}},
- {1721, {wxListCtrl, setTextColour, 1}},
- {1722, {wxListCtrl, setWindowStyleFlag, 1}},
- {1723, {wxListCtrl, sortItems, 2}},
- {1724, {wxListCtrl, 'Destroy', undefined}},
- {1725, {wxListView, clearColumnImage, 1}},
- {1726, {wxListView, focus, 1}},
- {1727, {wxListView, getFirstSelected, 0}},
- {1728, {wxListView, getFocusedItem, 0}},
- {1729, {wxListView, getNextSelected, 1}},
- {1730, {wxListView, isSelected, 1}},
- {1731, {wxListView, select, 2}},
- {1732, {wxListView, setColumnImage, 2}},
- {1733, {wxListItem, new_0, 0}},
- {1734, {wxListItem, new_1, 1}},
- {1735, {wxListItem, destruct, 0}},
- {1736, {wxListItem, clear, 0}},
- {1737, {wxListItem, getAlign, 0}},
- {1738, {wxListItem, getBackgroundColour, 0}},
- {1739, {wxListItem, getColumn, 0}},
- {1740, {wxListItem, getFont, 0}},
- {1741, {wxListItem, getId, 0}},
- {1742, {wxListItem, getImage, 0}},
- {1743, {wxListItem, getMask, 0}},
- {1744, {wxListItem, getState, 0}},
- {1745, {wxListItem, getText, 0}},
- {1746, {wxListItem, getTextColour, 0}},
- {1747, {wxListItem, getWidth, 0}},
- {1748, {wxListItem, setAlign, 1}},
- {1749, {wxListItem, setBackgroundColour, 1}},
- {1750, {wxListItem, setColumn, 1}},
- {1751, {wxListItem, setFont, 1}},
- {1752, {wxListItem, setId, 1}},
- {1753, {wxListItem, setImage, 1}},
- {1754, {wxListItem, setMask, 1}},
- {1755, {wxListItem, setState, 1}},
- {1756, {wxListItem, setStateMask, 1}},
- {1757, {wxListItem, setText, 1}},
- {1758, {wxListItem, setTextColour, 1}},
- {1759, {wxListItem, setWidth, 1}},
- {1760, {wxListItemAttr, new_0, 0}},
- {1761, {wxListItemAttr, new_3, 3}},
- {1762, {wxListItemAttr, getBackgroundColour, 0}},
- {1763, {wxListItemAttr, getFont, 0}},
- {1764, {wxListItemAttr, getTextColour, 0}},
- {1765, {wxListItemAttr, hasBackgroundColour, 0}},
- {1766, {wxListItemAttr, hasFont, 0}},
- {1767, {wxListItemAttr, hasTextColour, 0}},
- {1768, {wxListItemAttr, setBackgroundColour, 1}},
- {1769, {wxListItemAttr, setFont, 1}},
- {1770, {wxListItemAttr, setTextColour, 1}},
- {1771, {wxListItemAttr, 'Destroy', undefined}},
- {1772, {wxImageList, new_0, 0}},
- {1773, {wxImageList, new_3, 3}},
- {1774, {wxImageList, add_1, 1}},
- {1775, {wxImageList, add_2_0, 2}},
- {1776, {wxImageList, add_2_1, 2}},
- {1777, {wxImageList, create, 3}},
- {1779, {wxImageList, draw, 5}},
- {1780, {wxImageList, getBitmap, 1}},
- {1781, {wxImageList, getIcon, 1}},
- {1782, {wxImageList, getImageCount, 0}},
- {1783, {wxImageList, getSize, 3}},
- {1784, {wxImageList, remove, 1}},
- {1785, {wxImageList, removeAll, 0}},
- {1786, {wxImageList, replace_2, 2}},
- {1787, {wxImageList, replace_3, 3}},
- {1788, {wxImageList, 'Destroy', undefined}},
- {1789, {wxTextAttr, new_0, 0}},
- {1790, {wxTextAttr, new_2, 2}},
- {1791, {wxTextAttr, getAlignment, 0}},
- {1792, {wxTextAttr, getBackgroundColour, 0}},
- {1793, {wxTextAttr, getFont, 0}},
- {1794, {wxTextAttr, getLeftIndent, 0}},
- {1795, {wxTextAttr, getLeftSubIndent, 0}},
- {1796, {wxTextAttr, getRightIndent, 0}},
- {1797, {wxTextAttr, getTabs, 0}},
- {1798, {wxTextAttr, getTextColour, 0}},
- {1799, {wxTextAttr, hasBackgroundColour, 0}},
- {1800, {wxTextAttr, hasFont, 0}},
- {1801, {wxTextAttr, hasTextColour, 0}},
- {1802, {wxTextAttr, getFlags, 0}},
- {1803, {wxTextAttr, isDefault, 0}},
- {1804, {wxTextAttr, setAlignment, 1}},
- {1805, {wxTextAttr, setBackgroundColour, 1}},
- {1806, {wxTextAttr, setFlags, 1}},
- {1807, {wxTextAttr, setFont, 2}},
- {1808, {wxTextAttr, setLeftIndent, 2}},
- {1809, {wxTextAttr, setRightIndent, 1}},
- {1810, {wxTextAttr, setTabs, 1}},
- {1811, {wxTextAttr, setTextColour, 1}},
- {1812, {wxTextAttr, 'Destroy', undefined}},
- {1814, {wxTextCtrl, new_3, 3}},
- {1815, {wxTextCtrl, new_0, 0}},
- {1817, {wxTextCtrl, destruct, 0}},
- {1818, {wxTextCtrl, appendText, 1}},
- {1819, {wxTextCtrl, canCopy, 0}},
- {1820, {wxTextCtrl, canCut, 0}},
- {1821, {wxTextCtrl, canPaste, 0}},
- {1822, {wxTextCtrl, canRedo, 0}},
- {1823, {wxTextCtrl, canUndo, 0}},
- {1824, {wxTextCtrl, clear, 0}},
- {1825, {wxTextCtrl, copy, 0}},
- {1826, {wxTextCtrl, create, 3}},
- {1827, {wxTextCtrl, cut, 0}},
- {1828, {wxTextCtrl, discardEdits, 0}},
- {1829, {wxTextCtrl, changeValue, 1}},
- {1830, {wxTextCtrl, emulateKeyPress, 1}},
- {1831, {wxTextCtrl, getDefaultStyle, 0}},
- {1832, {wxTextCtrl, getInsertionPoint, 0}},
- {1833, {wxTextCtrl, getLastPosition, 0}},
- {1834, {wxTextCtrl, getLineLength, 1}},
- {1835, {wxTextCtrl, getLineText, 1}},
- {1836, {wxTextCtrl, getNumberOfLines, 0}},
- {1837, {wxTextCtrl, getRange, 2}},
- {1838, {wxTextCtrl, getSelection, 2}},
- {1839, {wxTextCtrl, getStringSelection, 0}},
- {1840, {wxTextCtrl, getStyle, 2}},
- {1841, {wxTextCtrl, getValue, 0}},
- {1842, {wxTextCtrl, isEditable, 0}},
- {1843, {wxTextCtrl, isModified, 0}},
- {1844, {wxTextCtrl, isMultiLine, 0}},
- {1845, {wxTextCtrl, isSingleLine, 0}},
- {1846, {wxTextCtrl, loadFile, 2}},
- {1847, {wxTextCtrl, markDirty, 0}},
- {1848, {wxTextCtrl, paste, 0}},
- {1849, {wxTextCtrl, positionToXY, 3}},
- {1850, {wxTextCtrl, redo, 0}},
- {1851, {wxTextCtrl, remove, 2}},
- {1852, {wxTextCtrl, replace, 3}},
- {1853, {wxTextCtrl, saveFile, 1}},
- {1854, {wxTextCtrl, setDefaultStyle, 1}},
- {1855, {wxTextCtrl, setEditable, 1}},
- {1856, {wxTextCtrl, setInsertionPoint, 1}},
- {1857, {wxTextCtrl, setInsertionPointEnd, 0}},
- {1859, {wxTextCtrl, setMaxLength, 1}},
- {1860, {wxTextCtrl, setSelection, 2}},
- {1861, {wxTextCtrl, setStyle, 3}},
- {1862, {wxTextCtrl, setValue, 1}},
- {1863, {wxTextCtrl, showPosition, 1}},
- {1864, {wxTextCtrl, undo, 0}},
- {1865, {wxTextCtrl, writeText, 1}},
- {1866, {wxTextCtrl, xYToPosition, 2}},
- {1869, {wxNotebook, new_0, 0}},
- {1870, {wxNotebook, new_3, 3}},
- {1871, {wxNotebook, destruct, 0}},
- {1872, {wxNotebook, addPage, 3}},
- {1873, {wxNotebook, advanceSelection, 1}},
- {1874, {wxNotebook, assignImageList, 1}},
- {1875, {wxNotebook, create, 3}},
- {1876, {wxNotebook, deleteAllPages, 0}},
- {1877, {wxNotebook, deletePage, 1}},
- {1878, {wxNotebook, removePage, 1}},
- {1879, {wxNotebook, getCurrentPage, 0}},
- {1880, {wxNotebook, getImageList, 0}},
- {1882, {wxNotebook, getPage, 1}},
- {1883, {wxNotebook, getPageCount, 0}},
- {1884, {wxNotebook, getPageImage, 1}},
- {1885, {wxNotebook, getPageText, 1}},
- {1886, {wxNotebook, getRowCount, 0}},
- {1887, {wxNotebook, getSelection, 0}},
- {1888, {wxNotebook, getThemeBackgroundColour, 0}},
- {1890, {wxNotebook, hitTest, 2}},
- {1892, {wxNotebook, insertPage, 4}},
- {1893, {wxNotebook, setImageList, 1}},
- {1894, {wxNotebook, setPadding, 1}},
- {1895, {wxNotebook, setPageSize, 1}},
- {1896, {wxNotebook, setPageImage, 2}},
- {1897, {wxNotebook, setPageText, 2}},
- {1898, {wxNotebook, setSelection, 1}},
- {1899, {wxNotebook, changeSelection, 1}},
- {1900, {wxChoicebook, new_0, 0}},
- {1901, {wxChoicebook, new_3, 3}},
- {1902, {wxChoicebook, addPage, 3}},
- {1903, {wxChoicebook, advanceSelection, 1}},
- {1904, {wxChoicebook, assignImageList, 1}},
- {1905, {wxChoicebook, create, 3}},
- {1906, {wxChoicebook, deleteAllPages, 0}},
- {1907, {wxChoicebook, deletePage, 1}},
- {1908, {wxChoicebook, removePage, 1}},
- {1909, {wxChoicebook, getCurrentPage, 0}},
- {1910, {wxChoicebook, getImageList, 0}},
- {1912, {wxChoicebook, getPage, 1}},
- {1913, {wxChoicebook, getPageCount, 0}},
- {1914, {wxChoicebook, getPageImage, 1}},
- {1915, {wxChoicebook, getPageText, 1}},
- {1916, {wxChoicebook, getSelection, 0}},
- {1917, {wxChoicebook, hitTest, 2}},
- {1918, {wxChoicebook, insertPage, 4}},
- {1919, {wxChoicebook, setImageList, 1}},
- {1920, {wxChoicebook, setPageSize, 1}},
- {1921, {wxChoicebook, setPageImage, 2}},
- {1922, {wxChoicebook, setPageText, 2}},
- {1923, {wxChoicebook, setSelection, 1}},
- {1924, {wxChoicebook, changeSelection, 1}},
- {1925, {wxChoicebook, 'Destroy', undefined}},
- {1926, {wxToolbook, new_0, 0}},
- {1927, {wxToolbook, new_3, 3}},
- {1928, {wxToolbook, addPage, 3}},
- {1929, {wxToolbook, advanceSelection, 1}},
- {1930, {wxToolbook, assignImageList, 1}},
- {1931, {wxToolbook, create, 3}},
- {1932, {wxToolbook, deleteAllPages, 0}},
- {1933, {wxToolbook, deletePage, 1}},
- {1934, {wxToolbook, removePage, 1}},
- {1935, {wxToolbook, getCurrentPage, 0}},
- {1936, {wxToolbook, getImageList, 0}},
- {1938, {wxToolbook, getPage, 1}},
- {1939, {wxToolbook, getPageCount, 0}},
- {1940, {wxToolbook, getPageImage, 1}},
- {1941, {wxToolbook, getPageText, 1}},
- {1942, {wxToolbook, getSelection, 0}},
- {1944, {wxToolbook, hitTest, 2}},
- {1945, {wxToolbook, insertPage, 4}},
- {1946, {wxToolbook, setImageList, 1}},
- {1947, {wxToolbook, setPageSize, 1}},
- {1948, {wxToolbook, setPageImage, 2}},
- {1949, {wxToolbook, setPageText, 2}},
- {1950, {wxToolbook, setSelection, 1}},
- {1951, {wxToolbook, changeSelection, 1}},
- {1952, {wxToolbook, 'Destroy', undefined}},
- {1953, {wxListbook, new_0, 0}},
- {1954, {wxListbook, new_3, 3}},
- {1955, {wxListbook, addPage, 3}},
- {1956, {wxListbook, advanceSelection, 1}},
- {1957, {wxListbook, assignImageList, 1}},
- {1958, {wxListbook, create, 3}},
- {1959, {wxListbook, deleteAllPages, 0}},
- {1960, {wxListbook, deletePage, 1}},
- {1961, {wxListbook, removePage, 1}},
- {1962, {wxListbook, getCurrentPage, 0}},
- {1963, {wxListbook, getImageList, 0}},
- {1965, {wxListbook, getPage, 1}},
- {1966, {wxListbook, getPageCount, 0}},
- {1967, {wxListbook, getPageImage, 1}},
- {1968, {wxListbook, getPageText, 1}},
- {1969, {wxListbook, getSelection, 0}},
- {1971, {wxListbook, hitTest, 2}},
- {1972, {wxListbook, insertPage, 4}},
- {1973, {wxListbook, setImageList, 1}},
- {1974, {wxListbook, setPageSize, 1}},
- {1975, {wxListbook, setPageImage, 2}},
- {1976, {wxListbook, setPageText, 2}},
- {1977, {wxListbook, setSelection, 1}},
- {1978, {wxListbook, changeSelection, 1}},
- {1979, {wxListbook, 'Destroy', undefined}},
- {1980, {wxTreebook, new_0, 0}},
- {1981, {wxTreebook, new_3, 3}},
- {1982, {wxTreebook, addPage, 3}},
- {1983, {wxTreebook, advanceSelection, 1}},
- {1984, {wxTreebook, assignImageList, 1}},
- {1985, {wxTreebook, create, 3}},
- {1986, {wxTreebook, deleteAllPages, 0}},
- {1987, {wxTreebook, deletePage, 1}},
- {1988, {wxTreebook, removePage, 1}},
- {1989, {wxTreebook, getCurrentPage, 0}},
- {1990, {wxTreebook, getImageList, 0}},
- {1992, {wxTreebook, getPage, 1}},
- {1993, {wxTreebook, getPageCount, 0}},
- {1994, {wxTreebook, getPageImage, 1}},
- {1995, {wxTreebook, getPageText, 1}},
- {1996, {wxTreebook, getSelection, 0}},
- {1997, {wxTreebook, expandNode, 2}},
- {1998, {wxTreebook, isNodeExpanded, 1}},
- {2000, {wxTreebook, hitTest, 2}},
- {2001, {wxTreebook, insertPage, 4}},
- {2002, {wxTreebook, insertSubPage, 4}},
- {2003, {wxTreebook, setImageList, 1}},
- {2004, {wxTreebook, setPageSize, 1}},
- {2005, {wxTreebook, setPageImage, 2}},
- {2006, {wxTreebook, setPageText, 2}},
- {2007, {wxTreebook, setSelection, 1}},
- {2008, {wxTreebook, changeSelection, 1}},
- {2009, {wxTreebook, 'Destroy', undefined}},
- {2012, {wxTreeCtrl, new_2, 2}},
- {2013, {wxTreeCtrl, new_0, 0}},
- {2015, {wxTreeCtrl, destruct, 0}},
- {2016, {wxTreeCtrl, addRoot, 2}},
- {2017, {wxTreeCtrl, appendItem, 3}},
- {2018, {wxTreeCtrl, assignImageList, 1}},
- {2019, {wxTreeCtrl, assignStateImageList, 1}},
- {2020, {wxTreeCtrl, collapse, 1}},
- {2021, {wxTreeCtrl, collapseAndReset, 1}},
- {2022, {wxTreeCtrl, create, 2}},
- {2023, {wxTreeCtrl, delete, 1}},
- {2024, {wxTreeCtrl, deleteAllItems, 0}},
- {2025, {wxTreeCtrl, deleteChildren, 1}},
- {2026, {wxTreeCtrl, editLabel, 1}},
- {2027, {wxTreeCtrl, ensureVisible, 1}},
- {2028, {wxTreeCtrl, expand, 1}},
- {2029, {wxTreeCtrl, getBoundingRect, 3}},
- {2031, {wxTreeCtrl, getChildrenCount, 2}},
- {2032, {wxTreeCtrl, getCount, 0}},
- {2033, {wxTreeCtrl, getEditControl, 0}},
- {2034, {wxTreeCtrl, getFirstChild, 2}},
- {2035, {wxTreeCtrl, getNextChild, 2}},
- {2036, {wxTreeCtrl, getFirstVisibleItem, 0}},
- {2037, {wxTreeCtrl, getImageList, 0}},
- {2038, {wxTreeCtrl, getIndent, 0}},
- {2039, {wxTreeCtrl, getItemBackgroundColour, 1}},
- {2040, {wxTreeCtrl, getItemData, 1}},
- {2041, {wxTreeCtrl, getItemFont, 1}},
- {2042, {wxTreeCtrl, getItemImage_1, 1}},
- {2043, {wxTreeCtrl, getItemImage_2, 2}},
- {2044, {wxTreeCtrl, getItemText, 1}},
- {2045, {wxTreeCtrl, getItemTextColour, 1}},
- {2046, {wxTreeCtrl, getLastChild, 1}},
- {2047, {wxTreeCtrl, getNextSibling, 1}},
- {2048, {wxTreeCtrl, getNextVisible, 1}},
- {2049, {wxTreeCtrl, getItemParent, 1}},
- {2050, {wxTreeCtrl, getPrevSibling, 1}},
- {2051, {wxTreeCtrl, getPrevVisible, 1}},
- {2052, {wxTreeCtrl, getRootItem, 0}},
- {2053, {wxTreeCtrl, getSelection, 0}},
- {2054, {wxTreeCtrl, getSelections, 1}},
- {2055, {wxTreeCtrl, getStateImageList, 0}},
- {2056, {wxTreeCtrl, hitTest, 2}},
- {2058, {wxTreeCtrl, insertItem, 4}},
- {2059, {wxTreeCtrl, isBold, 1}},
- {2060, {wxTreeCtrl, isExpanded, 1}},
- {2061, {wxTreeCtrl, isSelected, 1}},
- {2062, {wxTreeCtrl, isVisible, 1}},
- {2063, {wxTreeCtrl, itemHasChildren, 1}},
- {2064, {wxTreeCtrl, isTreeItemIdOk, 1}},
- {2065, {wxTreeCtrl, prependItem, 3}},
- {2066, {wxTreeCtrl, scrollTo, 1}},
- {2067, {wxTreeCtrl, selectItem_1, 1}},
- {2068, {wxTreeCtrl, selectItem_2, 2}},
- {2069, {wxTreeCtrl, setIndent, 1}},
- {2070, {wxTreeCtrl, setImageList, 1}},
- {2071, {wxTreeCtrl, setItemBackgroundColour, 2}},
- {2072, {wxTreeCtrl, setItemBold, 2}},
- {2073, {wxTreeCtrl, setItemData, 2}},
- {2074, {wxTreeCtrl, setItemDropHighlight, 2}},
- {2075, {wxTreeCtrl, setItemFont, 2}},
- {2076, {wxTreeCtrl, setItemHasChildren, 2}},
- {2077, {wxTreeCtrl, setItemImage_2, 2}},
- {2078, {wxTreeCtrl, setItemImage_3, 3}},
- {2079, {wxTreeCtrl, setItemText, 2}},
- {2080, {wxTreeCtrl, setItemTextColour, 2}},
- {2081, {wxTreeCtrl, setStateImageList, 1}},
- {2082, {wxTreeCtrl, setWindowStyle, 1}},
- {2083, {wxTreeCtrl, sortChildren, 1}},
- {2084, {wxTreeCtrl, toggle, 1}},
- {2085, {wxTreeCtrl, toggleItemSelection, 1}},
- {2086, {wxTreeCtrl, unselect, 0}},
- {2087, {wxTreeCtrl, unselectAll, 0}},
- {2088, {wxTreeCtrl, unselectItem, 1}},
- {2089, {wxScrollBar, new_0, 0}},
- {2090, {wxScrollBar, new_3, 3}},
- {2091, {wxScrollBar, destruct, 0}},
- {2092, {wxScrollBar, create, 3}},
- {2093, {wxScrollBar, getRange, 0}},
- {2094, {wxScrollBar, getPageSize, 0}},
- {2095, {wxScrollBar, getThumbPosition, 0}},
- {2096, {wxScrollBar, getThumbSize, 0}},
- {2097, {wxScrollBar, setThumbPosition, 1}},
- {2098, {wxScrollBar, setScrollbar, 5}},
- {2100, {wxSpinButton, new_2, 2}},
- {2101, {wxSpinButton, new_0, 0}},
- {2102, {wxSpinButton, create, 2}},
- {2103, {wxSpinButton, getMax, 0}},
- {2104, {wxSpinButton, getMin, 0}},
- {2105, {wxSpinButton, getValue, 0}},
- {2106, {wxSpinButton, setRange, 2}},
- {2107, {wxSpinButton, setValue, 1}},
- {2108, {wxSpinButton, 'Destroy', undefined}},
- {2109, {wxSpinCtrl, new_0, 0}},
- {2110, {wxSpinCtrl, new_2, 2}},
- {2112, {wxSpinCtrl, create, 2}},
- {2115, {wxSpinCtrl, setValue_1_1, 1}},
- {2116, {wxSpinCtrl, setValue_1_0, 1}},
- {2118, {wxSpinCtrl, getValue, 0}},
- {2120, {wxSpinCtrl, setRange, 2}},
- {2121, {wxSpinCtrl, setSelection, 2}},
- {2123, {wxSpinCtrl, getMin, 0}},
- {2125, {wxSpinCtrl, getMax, 0}},
- {2126, {wxSpinCtrl, 'Destroy', undefined}},
- {2127, {wxStaticText, new_0, 0}},
- {2128, {wxStaticText, new_4, 4}},
- {2129, {wxStaticText, create, 4}},
- {2130, {wxStaticText, getLabel, 0}},
- {2131, {wxStaticText, setLabel, 1}},
- {2132, {wxStaticText, wrap, 1}},
- {2133, {wxStaticText, 'Destroy', undefined}},
- {2134, {wxStaticBitmap, new_0, 0}},
- {2135, {wxStaticBitmap, new_4, 4}},
- {2136, {wxStaticBitmap, create, 4}},
- {2137, {wxStaticBitmap, getBitmap, 0}},
- {2138, {wxStaticBitmap, setBitmap, 1}},
- {2139, {wxStaticBitmap, 'Destroy', undefined}},
- {2140, {wxRadioBox, new, 7}},
- {2142, {wxRadioBox, destruct, 0}},
- {2143, {wxRadioBox, create, 7}},
- {2144, {wxRadioBox, enable_2, 2}},
- {2145, {wxRadioBox, enable_1, 1}},
- {2146, {wxRadioBox, getSelection, 0}},
- {2147, {wxRadioBox, getString, 1}},
- {2148, {wxRadioBox, setSelection, 1}},
- {2149, {wxRadioBox, show_2, 2}},
- {2150, {wxRadioBox, show_1, 1}},
- {2151, {wxRadioBox, getColumnCount, 0}},
- {2152, {wxRadioBox, getItemHelpText, 1}},
- {2153, {wxRadioBox, getItemToolTip, 1}},
- {2155, {wxRadioBox, getItemFromPoint, 1}},
- {2156, {wxRadioBox, getRowCount, 0}},
- {2157, {wxRadioBox, isItemEnabled, 1}},
- {2158, {wxRadioBox, isItemShown, 1}},
- {2159, {wxRadioBox, setItemHelpText, 2}},
- {2160, {wxRadioBox, setItemToolTip, 2}},
- {2161, {wxRadioButton, new_0, 0}},
- {2162, {wxRadioButton, new_4, 4}},
- {2163, {wxRadioButton, create, 4}},
- {2164, {wxRadioButton, getValue, 0}},
- {2165, {wxRadioButton, setValue, 1}},
- {2166, {wxRadioButton, 'Destroy', undefined}},
- {2168, {wxSlider, new_6, 6}},
- {2169, {wxSlider, new_0, 0}},
- {2170, {wxSlider, create, 6}},
- {2171, {wxSlider, getLineSize, 0}},
- {2172, {wxSlider, getMax, 0}},
- {2173, {wxSlider, getMin, 0}},
- {2174, {wxSlider, getPageSize, 0}},
- {2175, {wxSlider, getThumbLength, 0}},
- {2176, {wxSlider, getValue, 0}},
- {2177, {wxSlider, setLineSize, 1}},
- {2178, {wxSlider, setPageSize, 1}},
- {2179, {wxSlider, setRange, 2}},
- {2180, {wxSlider, setThumbLength, 1}},
- {2181, {wxSlider, setValue, 1}},
- {2182, {wxSlider, 'Destroy', undefined}},
- {2184, {wxDialog, new_4, 4}},
- {2185, {wxDialog, new_0, 0}},
- {2187, {wxDialog, destruct, 0}},
- {2188, {wxDialog, create, 4}},
- {2189, {wxDialog, createButtonSizer, 1}},
- {2190, {wxDialog, createStdDialogButtonSizer, 1}},
- {2191, {wxDialog, endModal, 1}},
- {2192, {wxDialog, getAffirmativeId, 0}},
- {2193, {wxDialog, getReturnCode, 0}},
- {2194, {wxDialog, isModal, 0}},
- {2195, {wxDialog, setAffirmativeId, 1}},
- {2196, {wxDialog, setReturnCode, 1}},
- {2197, {wxDialog, show, 1}},
- {2198, {wxDialog, showModal, 0}},
- {2199, {wxColourDialog, new_0, 0}},
- {2200, {wxColourDialog, new_2, 2}},
- {2201, {wxColourDialog, destruct, 0}},
- {2202, {wxColourDialog, create, 2}},
- {2203, {wxColourDialog, getColourData, 0}},
- {2204, {wxColourData, new_0, 0}},
- {2205, {wxColourData, new_1, 1}},
- {2206, {wxColourData, destruct, 0}},
- {2207, {wxColourData, getChooseFull, 0}},
- {2208, {wxColourData, getColour, 0}},
- {2210, {wxColourData, getCustomColour, 1}},
- {2211, {wxColourData, setChooseFull, 1}},
- {2212, {wxColourData, setColour, 1}},
- {2213, {wxColourData, setCustomColour, 2}},
- {2214, {wxPalette, new_0, 0}},
- {2215, {wxPalette, new_4, 4}},
- {2217, {wxPalette, destruct, 0}},
- {2218, {wxPalette, create, 4}},
- {2219, {wxPalette, getColoursCount, 0}},
- {2220, {wxPalette, getPixel, 3}},
- {2221, {wxPalette, getRGB, 4}},
- {2222, {wxPalette, isOk, 0}},
- {2226, {wxDirDialog, new, 2}},
- {2227, {wxDirDialog, destruct, 0}},
- {2228, {wxDirDialog, getPath, 0}},
- {2229, {wxDirDialog, getMessage, 0}},
- {2230, {wxDirDialog, setMessage, 1}},
- {2231, {wxDirDialog, setPath, 1}},
- {2235, {wxFileDialog, new, 2}},
- {2236, {wxFileDialog, destruct, 0}},
- {2237, {wxFileDialog, getDirectory, 0}},
- {2238, {wxFileDialog, getFilename, 0}},
- {2239, {wxFileDialog, getFilenames, 1}},
- {2240, {wxFileDialog, getFilterIndex, 0}},
- {2241, {wxFileDialog, getMessage, 0}},
- {2242, {wxFileDialog, getPath, 0}},
- {2243, {wxFileDialog, getPaths, 1}},
- {2244, {wxFileDialog, getWildcard, 0}},
- {2245, {wxFileDialog, setDirectory, 1}},
- {2246, {wxFileDialog, setFilename, 1}},
- {2247, {wxFileDialog, setFilterIndex, 1}},
- {2248, {wxFileDialog, setMessage, 1}},
- {2249, {wxFileDialog, setPath, 1}},
- {2250, {wxFileDialog, setWildcard, 1}},
- {2251, {wxPickerBase, setInternalMargin, 1}},
- {2252, {wxPickerBase, getInternalMargin, 0}},
- {2253, {wxPickerBase, setTextCtrlProportion, 1}},
- {2254, {wxPickerBase, setPickerCtrlProportion, 1}},
- {2255, {wxPickerBase, getTextCtrlProportion, 0}},
- {2256, {wxPickerBase, getPickerCtrlProportion, 0}},
- {2257, {wxPickerBase, hasTextCtrl, 0}},
- {2258, {wxPickerBase, getTextCtrl, 0}},
- {2259, {wxPickerBase, isTextCtrlGrowable, 0}},
- {2260, {wxPickerBase, setPickerCtrlGrowable, 1}},
- {2261, {wxPickerBase, setTextCtrlGrowable, 1}},
- {2262, {wxPickerBase, isPickerCtrlGrowable, 0}},
- {2263, {wxFilePickerCtrl, new_0, 0}},
- {2264, {wxFilePickerCtrl, new_3, 3}},
- {2265, {wxFilePickerCtrl, create, 3}},
- {2266, {wxFilePickerCtrl, getPath, 0}},
- {2267, {wxFilePickerCtrl, setPath, 1}},
- {2268, {wxFilePickerCtrl, 'Destroy', undefined}},
- {2269, {wxDirPickerCtrl, new_0, 0}},
- {2270, {wxDirPickerCtrl, new_3, 3}},
- {2271, {wxDirPickerCtrl, create, 3}},
- {2272, {wxDirPickerCtrl, getPath, 0}},
- {2273, {wxDirPickerCtrl, setPath, 1}},
- {2274, {wxDirPickerCtrl, 'Destroy', undefined}},
- {2275, {wxColourPickerCtrl, new_0, 0}},
- {2276, {wxColourPickerCtrl, new_3, 3}},
- {2277, {wxColourPickerCtrl, create, 3}},
- {2278, {wxColourPickerCtrl, getColour, 0}},
- {2279, {wxColourPickerCtrl, setColour_1_1, 1}},
- {2280, {wxColourPickerCtrl, setColour_1_0, 1}},
- {2281, {wxColourPickerCtrl, 'Destroy', undefined}},
- {2282, {wxDatePickerCtrl, new_0, 0}},
- {2283, {wxDatePickerCtrl, new_3, 3}},
- {2284, {wxDatePickerCtrl, getRange, 2}},
- {2285, {wxDatePickerCtrl, getValue, 0}},
- {2286, {wxDatePickerCtrl, setRange, 2}},
- {2287, {wxDatePickerCtrl, setValue, 1}},
- {2288, {wxDatePickerCtrl, 'Destroy', undefined}},
- {2289, {wxFontPickerCtrl, new_0, 0}},
- {2290, {wxFontPickerCtrl, new_3, 3}},
- {2291, {wxFontPickerCtrl, create, 3}},
- {2292, {wxFontPickerCtrl, getSelectedFont, 0}},
- {2293, {wxFontPickerCtrl, setSelectedFont, 1}},
- {2294, {wxFontPickerCtrl, getMaxPointSize, 0}},
- {2295, {wxFontPickerCtrl, setMaxPointSize, 1}},
- {2296, {wxFontPickerCtrl, 'Destroy', undefined}},
- {2299, {wxFindReplaceDialog, new_0, 0}},
- {2300, {wxFindReplaceDialog, new_4, 4}},
- {2301, {wxFindReplaceDialog, destruct, 0}},
- {2302, {wxFindReplaceDialog, create, 4}},
- {2303, {wxFindReplaceDialog, getData, 0}},
- {2304, {wxFindReplaceData, new_0, 0}},
- {2305, {wxFindReplaceData, new_1, 1}},
- {2306, {wxFindReplaceData, getFindString, 0}},
- {2307, {wxFindReplaceData, getReplaceString, 0}},
- {2308, {wxFindReplaceData, getFlags, 0}},
- {2309, {wxFindReplaceData, setFlags, 1}},
- {2310, {wxFindReplaceData, setFindString, 1}},
- {2311, {wxFindReplaceData, setReplaceString, 1}},
- {2312, {wxFindReplaceData, 'Destroy', undefined}},
- {2313, {wxMultiChoiceDialog, new_0, 0}},
- {2315, {wxMultiChoiceDialog, new_5, 5}},
- {2316, {wxMultiChoiceDialog, getSelections, 0}},
- {2317, {wxMultiChoiceDialog, setSelections, 1}},
- {2318, {wxMultiChoiceDialog, 'Destroy', undefined}},
- {2319, {wxSingleChoiceDialog, new_0, 0}},
- {2321, {wxSingleChoiceDialog, new_5, 5}},
- {2322, {wxSingleChoiceDialog, getSelection, 0}},
- {2323, {wxSingleChoiceDialog, getStringSelection, 0}},
- {2324, {wxSingleChoiceDialog, setSelection, 1}},
- {2325, {wxSingleChoiceDialog, 'Destroy', undefined}},
- {2326, {wxTextEntryDialog, new, 3}},
- {2327, {wxTextEntryDialog, getValue, 0}},
- {2328, {wxTextEntryDialog, setValue, 1}},
- {2329, {wxTextEntryDialog, 'Destroy', undefined}},
- {2330, {wxPasswordEntryDialog, new, 3}},
- {2331, {wxPasswordEntryDialog, 'Destroy', undefined}},
- {2332, {wxFontData, new_0, 0}},
- {2333, {wxFontData, new_1, 1}},
- {2334, {wxFontData, destruct, 0}},
- {2335, {wxFontData, enableEffects, 1}},
- {2336, {wxFontData, getAllowSymbols, 0}},
- {2337, {wxFontData, getColour, 0}},
- {2338, {wxFontData, getChosenFont, 0}},
- {2339, {wxFontData, getEnableEffects, 0}},
- {2340, {wxFontData, getInitialFont, 0}},
- {2341, {wxFontData, getShowHelp, 0}},
- {2342, {wxFontData, setAllowSymbols, 1}},
- {2343, {wxFontData, setChosenFont, 1}},
- {2344, {wxFontData, setColour, 1}},
- {2345, {wxFontData, setInitialFont, 1}},
- {2346, {wxFontData, setRange, 2}},
- {2347, {wxFontData, setShowHelp, 1}},
- {2351, {wxFontDialog, new_0, 0}},
- {2353, {wxFontDialog, new_2, 2}},
- {2355, {wxFontDialog, create, 2}},
- {2356, {wxFontDialog, getFontData, 0}},
- {2358, {wxFontDialog, 'Destroy', undefined}},
- {2359, {wxProgressDialog, new, 3}},
- {2360, {wxProgressDialog, destruct, 0}},
- {2361, {wxProgressDialog, resume, 0}},
- {2362, {wxProgressDialog, update_2, 2}},
- {2363, {wxProgressDialog, update_0, 0}},
- {2364, {wxMessageDialog, new, 3}},
- {2365, {wxMessageDialog, destruct, 0}},
- {2366, {wxPageSetupDialog, new, 2}},
- {2367, {wxPageSetupDialog, destruct, 0}},
- {2368, {wxPageSetupDialog, getPageSetupData, 0}},
- {2369, {wxPageSetupDialog, showModal, 0}},
- {2370, {wxPageSetupDialogData, new_0, 0}},
- {2371, {wxPageSetupDialogData, new_1_0, 1}},
- {2372, {wxPageSetupDialogData, new_1_1, 1}},
- {2373, {wxPageSetupDialogData, destruct, 0}},
- {2374, {wxPageSetupDialogData, enableHelp, 1}},
- {2375, {wxPageSetupDialogData, enableMargins, 1}},
- {2376, {wxPageSetupDialogData, enableOrientation, 1}},
- {2377, {wxPageSetupDialogData, enablePaper, 1}},
- {2378, {wxPageSetupDialogData, enablePrinter, 1}},
- {2379, {wxPageSetupDialogData, getDefaultMinMargins, 0}},
- {2380, {wxPageSetupDialogData, getEnableMargins, 0}},
- {2381, {wxPageSetupDialogData, getEnableOrientation, 0}},
- {2382, {wxPageSetupDialogData, getEnablePaper, 0}},
- {2383, {wxPageSetupDialogData, getEnablePrinter, 0}},
- {2384, {wxPageSetupDialogData, getEnableHelp, 0}},
- {2385, {wxPageSetupDialogData, getDefaultInfo, 0}},
- {2386, {wxPageSetupDialogData, getMarginTopLeft, 0}},
- {2387, {wxPageSetupDialogData, getMarginBottomRight, 0}},
- {2388, {wxPageSetupDialogData, getMinMarginTopLeft, 0}},
- {2389, {wxPageSetupDialogData, getMinMarginBottomRight, 0}},
- {2390, {wxPageSetupDialogData, getPaperId, 0}},
- {2391, {wxPageSetupDialogData, getPaperSize, 0}},
- {2393, {wxPageSetupDialogData, getPrintData, 0}},
- {2394, {wxPageSetupDialogData, isOk, 0}},
- {2395, {wxPageSetupDialogData, setDefaultInfo, 1}},
- {2396, {wxPageSetupDialogData, setDefaultMinMargins, 1}},
- {2397, {wxPageSetupDialogData, setMarginTopLeft, 1}},
- {2398, {wxPageSetupDialogData, setMarginBottomRight, 1}},
- {2399, {wxPageSetupDialogData, setMinMarginTopLeft, 1}},
- {2400, {wxPageSetupDialogData, setMinMarginBottomRight, 1}},
- {2401, {wxPageSetupDialogData, setPaperId, 1}},
- {2402, {wxPageSetupDialogData, setPaperSize_1_1, 1}},
- {2403, {wxPageSetupDialogData, setPaperSize_1_0, 1}},
- {2404, {wxPageSetupDialogData, setPrintData, 1}},
- {2405, {wxPrintDialog, new_2_0, 2}},
- {2406, {wxPrintDialog, new_2_1, 2}},
- {2407, {wxPrintDialog, destruct, 0}},
- {2408, {wxPrintDialog, getPrintDialogData, 0}},
- {2409, {wxPrintDialog, getPrintDC, 0}},
- {2410, {wxPrintDialogData, new_0, 0}},
- {2411, {wxPrintDialogData, new_1_1, 1}},
- {2412, {wxPrintDialogData, new_1_0, 1}},
- {2413, {wxPrintDialogData, destruct, 0}},
- {2414, {wxPrintDialogData, enableHelp, 1}},
- {2415, {wxPrintDialogData, enablePageNumbers, 1}},
- {2416, {wxPrintDialogData, enablePrintToFile, 1}},
- {2417, {wxPrintDialogData, enableSelection, 1}},
- {2418, {wxPrintDialogData, getAllPages, 0}},
- {2419, {wxPrintDialogData, getCollate, 0}},
- {2420, {wxPrintDialogData, getFromPage, 0}},
- {2421, {wxPrintDialogData, getMaxPage, 0}},
- {2422, {wxPrintDialogData, getMinPage, 0}},
- {2423, {wxPrintDialogData, getNoCopies, 0}},
- {2424, {wxPrintDialogData, getPrintData, 0}},
- {2425, {wxPrintDialogData, getPrintToFile, 0}},
- {2426, {wxPrintDialogData, getSelection, 0}},
- {2427, {wxPrintDialogData, getToPage, 0}},
- {2428, {wxPrintDialogData, isOk, 0}},
- {2429, {wxPrintDialogData, setCollate, 1}},
- {2430, {wxPrintDialogData, setFromPage, 1}},
- {2431, {wxPrintDialogData, setMaxPage, 1}},
- {2432, {wxPrintDialogData, setMinPage, 1}},
- {2433, {wxPrintDialogData, setNoCopies, 1}},
- {2434, {wxPrintDialogData, setPrintData, 1}},
- {2435, {wxPrintDialogData, setPrintToFile, 1}},
- {2436, {wxPrintDialogData, setSelection, 1}},
- {2437, {wxPrintDialogData, setToPage, 1}},
- {2438, {wxPrintData, new_0, 0}},
- {2439, {wxPrintData, new_1, 1}},
- {2440, {wxPrintData, destruct, 0}},
- {2441, {wxPrintData, getCollate, 0}},
- {2442, {wxPrintData, getBin, 0}},
- {2443, {wxPrintData, getColour, 0}},
- {2444, {wxPrintData, getDuplex, 0}},
- {2445, {wxPrintData, getNoCopies, 0}},
- {2446, {wxPrintData, getOrientation, 0}},
- {2447, {wxPrintData, getPaperId, 0}},
- {2448, {wxPrintData, getPrinterName, 0}},
- {2449, {wxPrintData, getQuality, 0}},
- {2450, {wxPrintData, isOk, 0}},
- {2451, {wxPrintData, setBin, 1}},
- {2452, {wxPrintData, setCollate, 1}},
- {2453, {wxPrintData, setColour, 1}},
- {2454, {wxPrintData, setDuplex, 1}},
- {2455, {wxPrintData, setNoCopies, 1}},
- {2456, {wxPrintData, setOrientation, 1}},
- {2457, {wxPrintData, setPaperId, 1}},
- {2458, {wxPrintData, setPrinterName, 1}},
- {2459, {wxPrintData, setQuality, 1}},
- {2462, {wxPrintPreview, new_2, 2}},
- {2463, {wxPrintPreview, new_3, 3}},
- {2465, {wxPrintPreview, destruct, 0}},
- {2466, {wxPrintPreview, getCanvas, 0}},
- {2467, {wxPrintPreview, getCurrentPage, 0}},
- {2468, {wxPrintPreview, getFrame, 0}},
- {2469, {wxPrintPreview, getMaxPage, 0}},
- {2470, {wxPrintPreview, getMinPage, 0}},
- {2471, {wxPrintPreview, getPrintout, 0}},
- {2472, {wxPrintPreview, getPrintoutForPrinting, 0}},
- {2473, {wxPrintPreview, isOk, 0}},
- {2474, {wxPrintPreview, paintPage, 2}},
- {2475, {wxPrintPreview, print, 1}},
- {2476, {wxPrintPreview, renderPage, 1}},
- {2477, {wxPrintPreview, setCanvas, 1}},
- {2478, {wxPrintPreview, setCurrentPage, 1}},
- {2479, {wxPrintPreview, setFrame, 1}},
- {2480, {wxPrintPreview, setPrintout, 1}},
- {2481, {wxPrintPreview, setZoom, 1}},
- {2482, {wxPreviewFrame, new, 3}},
- {2483, {wxPreviewFrame, destruct, 0}},
- {2484, {wxPreviewFrame, createControlBar, 0}},
- {2485, {wxPreviewFrame, createCanvas, 0}},
- {2486, {wxPreviewFrame, initialize, 0}},
- {2487, {wxPreviewFrame, onCloseWindow, 1}},
- {2488, {wxPreviewControlBar, new, 4}},
- {2489, {wxPreviewControlBar, destruct, 0}},
- {2490, {wxPreviewControlBar, createButtons, 0}},
- {2491, {wxPreviewControlBar, getPrintPreview, 0}},
- {2492, {wxPreviewControlBar, getZoomControl, 0}},
- {2493, {wxPreviewControlBar, setZoomControl, 1}},
- {2495, {wxPrinter, new, 1}},
- {2496, {wxPrinter, createAbortWindow, 2}},
- {2497, {wxPrinter, getAbort, 0}},
- {2498, {wxPrinter, getLastError, 0}},
- {2499, {wxPrinter, getPrintDialogData, 0}},
- {2500, {wxPrinter, print, 3}},
- {2501, {wxPrinter, printDialog, 1}},
- {2502, {wxPrinter, reportError, 3}},
- {2503, {wxPrinter, setup, 1}},
- {2504, {wxPrinter, 'Destroy', undefined}},
- {2505, {wxXmlResource, new_1, 1}},
- {2506, {wxXmlResource, new_2, 2}},
- {2507, {wxXmlResource, destruct, 0}},
- {2508, {wxXmlResource, attachUnknownControl, 3}},
- {2509, {wxXmlResource, clearHandlers, 0}},
- {2510, {wxXmlResource, compareVersion, 4}},
- {2511, {wxXmlResource, get, 0}},
- {2512, {wxXmlResource, getFlags, 0}},
- {2513, {wxXmlResource, getVersion, 0}},
- {2514, {wxXmlResource, getXRCID, 2}},
- {2515, {wxXmlResource, initAllHandlers, 0}},
- {2516, {wxXmlResource, load, 1}},
- {2517, {wxXmlResource, loadBitmap, 1}},
- {2518, {wxXmlResource, loadDialog_2, 2}},
- {2519, {wxXmlResource, loadDialog_3, 3}},
- {2520, {wxXmlResource, loadFrame_2, 2}},
- {2521, {wxXmlResource, loadFrame_3, 3}},
- {2522, {wxXmlResource, loadIcon, 1}},
- {2523, {wxXmlResource, loadMenu, 1}},
- {2524, {wxXmlResource, loadMenuBar_2, 2}},
- {2525, {wxXmlResource, loadMenuBar_1, 1}},
- {2526, {wxXmlResource, loadPanel_2, 2}},
- {2527, {wxXmlResource, loadPanel_3, 3}},
- {2528, {wxXmlResource, loadToolBar, 2}},
- {2529, {wxXmlResource, set, 1}},
- {2530, {wxXmlResource, setFlags, 1}},
- {2531, {wxXmlResource, unload, 1}},
- {2532, {wxXmlResource, xrcctrl, 3}},
- {2533, {wxHtmlEasyPrinting, new, 1}},
- {2534, {wxHtmlEasyPrinting, destruct, 0}},
- {2535, {wxHtmlEasyPrinting, getPrintData, 0}},
- {2536, {wxHtmlEasyPrinting, getPageSetupData, 0}},
- {2537, {wxHtmlEasyPrinting, previewFile, 1}},
- {2538, {wxHtmlEasyPrinting, previewText, 2}},
- {2539, {wxHtmlEasyPrinting, printFile, 1}},
- {2540, {wxHtmlEasyPrinting, printText, 2}},
- {2541, {wxHtmlEasyPrinting, pageSetup, 0}},
- {2542, {wxHtmlEasyPrinting, setFonts, 3}},
- {2543, {wxHtmlEasyPrinting, setHeader, 2}},
- {2544, {wxHtmlEasyPrinting, setFooter, 2}},
- {2546, {wxGLCanvas, new_2, 2}},
- {2547, {wxGLCanvas, new_3_1, 3}},
- {2548, {wxGLCanvas, new_3_0, 3}},
- {2549, {wxGLCanvas, getContext, 0}},
- {2551, {wxGLCanvas, setCurrent, 0}},
- {2552, {wxGLCanvas, swapBuffers, 0}},
- {2553, {wxGLCanvas, 'Destroy', undefined}},
- {2554, {wxAuiManager, new, 1}},
- {2555, {wxAuiManager, destruct, 0}},
- {2556, {wxAuiManager, addPane_2_1, 2}},
- {2557, {wxAuiManager, addPane_3, 3}},
- {2558, {wxAuiManager, addPane_2_0, 2}},
- {2559, {wxAuiManager, detachPane, 1}},
- {2560, {wxAuiManager, getAllPanes, 0}},
- {2561, {wxAuiManager, getArtProvider, 0}},
- {2562, {wxAuiManager, getDockSizeConstraint, 2}},
- {2563, {wxAuiManager, getFlags, 0}},
- {2564, {wxAuiManager, getManagedWindow, 0}},
- {2565, {wxAuiManager, getManager, 1}},
- {2566, {wxAuiManager, getPane_1_1, 1}},
- {2567, {wxAuiManager, getPane_1_0, 1}},
- {2568, {wxAuiManager, hideHint, 0}},
- {2569, {wxAuiManager, insertPane, 3}},
- {2570, {wxAuiManager, loadPaneInfo, 2}},
- {2571, {wxAuiManager, loadPerspective, 2}},
- {2572, {wxAuiManager, savePaneInfo, 1}},
- {2573, {wxAuiManager, savePerspective, 0}},
- {2574, {wxAuiManager, setArtProvider, 1}},
- {2575, {wxAuiManager, setDockSizeConstraint, 2}},
- {2576, {wxAuiManager, setFlags, 1}},
- {2577, {wxAuiManager, setManagedWindow, 1}},
- {2578, {wxAuiManager, showHint, 1}},
- {2579, {wxAuiManager, unInit, 0}},
- {2580, {wxAuiManager, update, 0}},
- {2581, {wxAuiPaneInfo, new_0, 0}},
- {2582, {wxAuiPaneInfo, new_1, 1}},
- {2583, {wxAuiPaneInfo, destruct, 0}},
- {2584, {wxAuiPaneInfo, bestSize_1, 1}},
- {2585, {wxAuiPaneInfo, bestSize_2, 2}},
- {2586, {wxAuiPaneInfo, bottom, 0}},
- {2587, {wxAuiPaneInfo, bottomDockable, 1}},
- {2588, {wxAuiPaneInfo, caption, 1}},
- {2589, {wxAuiPaneInfo, captionVisible, 1}},
- {2590, {wxAuiPaneInfo, centre, 0}},
- {2591, {wxAuiPaneInfo, centrePane, 0}},
- {2592, {wxAuiPaneInfo, closeButton, 1}},
- {2593, {wxAuiPaneInfo, defaultPane, 0}},
- {2594, {wxAuiPaneInfo, destroyOnClose, 1}},
- {2595, {wxAuiPaneInfo, direction, 1}},
- {2596, {wxAuiPaneInfo, dock, 0}},
- {2597, {wxAuiPaneInfo, dockable, 1}},
- {2598, {wxAuiPaneInfo, fixed, 0}},
- {2599, {wxAuiPaneInfo, float, 0}},
- {2600, {wxAuiPaneInfo, floatable, 1}},
- {2601, {wxAuiPaneInfo, floatingPosition_1, 1}},
- {2602, {wxAuiPaneInfo, floatingPosition_2, 2}},
- {2603, {wxAuiPaneInfo, floatingSize_1, 1}},
- {2604, {wxAuiPaneInfo, floatingSize_2, 2}},
- {2605, {wxAuiPaneInfo, gripper, 1}},
- {2606, {wxAuiPaneInfo, gripperTop, 1}},
- {2607, {wxAuiPaneInfo, hasBorder, 0}},
- {2608, {wxAuiPaneInfo, hasCaption, 0}},
- {2609, {wxAuiPaneInfo, hasCloseButton, 0}},
- {2610, {wxAuiPaneInfo, hasFlag, 1}},
- {2611, {wxAuiPaneInfo, hasGripper, 0}},
- {2612, {wxAuiPaneInfo, hasGripperTop, 0}},
- {2613, {wxAuiPaneInfo, hasMaximizeButton, 0}},
- {2614, {wxAuiPaneInfo, hasMinimizeButton, 0}},
- {2615, {wxAuiPaneInfo, hasPinButton, 0}},
- {2616, {wxAuiPaneInfo, hide, 0}},
- {2617, {wxAuiPaneInfo, isBottomDockable, 0}},
- {2618, {wxAuiPaneInfo, isDocked, 0}},
- {2619, {wxAuiPaneInfo, isFixed, 0}},
- {2620, {wxAuiPaneInfo, isFloatable, 0}},
- {2621, {wxAuiPaneInfo, isFloating, 0}},
- {2622, {wxAuiPaneInfo, isLeftDockable, 0}},
- {2623, {wxAuiPaneInfo, isMovable, 0}},
- {2624, {wxAuiPaneInfo, isOk, 0}},
- {2625, {wxAuiPaneInfo, isResizable, 0}},
- {2626, {wxAuiPaneInfo, isRightDockable, 0}},
- {2627, {wxAuiPaneInfo, isShown, 0}},
- {2628, {wxAuiPaneInfo, isToolbar, 0}},
- {2629, {wxAuiPaneInfo, isTopDockable, 0}},
- {2630, {wxAuiPaneInfo, layer, 1}},
- {2631, {wxAuiPaneInfo, left, 0}},
- {2632, {wxAuiPaneInfo, leftDockable, 1}},
- {2633, {wxAuiPaneInfo, maxSize_1, 1}},
- {2634, {wxAuiPaneInfo, maxSize_2, 2}},
- {2635, {wxAuiPaneInfo, maximizeButton, 1}},
- {2636, {wxAuiPaneInfo, minSize_1, 1}},
- {2637, {wxAuiPaneInfo, minSize_2, 2}},
- {2638, {wxAuiPaneInfo, minimizeButton, 1}},
- {2639, {wxAuiPaneInfo, movable, 1}},
- {2640, {wxAuiPaneInfo, name, 1}},
- {2641, {wxAuiPaneInfo, paneBorder, 1}},
- {2642, {wxAuiPaneInfo, pinButton, 1}},
- {2643, {wxAuiPaneInfo, position, 1}},
- {2644, {wxAuiPaneInfo, resizable, 1}},
- {2645, {wxAuiPaneInfo, right, 0}},
- {2646, {wxAuiPaneInfo, rightDockable, 1}},
- {2647, {wxAuiPaneInfo, row, 1}},
- {2648, {wxAuiPaneInfo, safeSet, 1}},
- {2649, {wxAuiPaneInfo, setFlag, 2}},
- {2650, {wxAuiPaneInfo, show, 1}},
- {2651, {wxAuiPaneInfo, toolbarPane, 0}},
- {2652, {wxAuiPaneInfo, top, 0}},
- {2653, {wxAuiPaneInfo, topDockable, 1}},
- {2654, {wxAuiPaneInfo, window, 1}},
- {2655, {wxAuiPaneInfo, getWindow, 0}},
- {2656, {wxAuiPaneInfo, getFrame, 0}},
- {2657, {wxAuiPaneInfo, getDirection, 0}},
- {2658, {wxAuiPaneInfo, getLayer, 0}},
- {2659, {wxAuiPaneInfo, getRow, 0}},
- {2660, {wxAuiPaneInfo, getPosition, 0}},
- {2661, {wxAuiPaneInfo, getFloatingPosition, 0}},
- {2662, {wxAuiPaneInfo, getFloatingSize, 0}},
- {2663, {wxAuiNotebook, new_0, 0}},
- {2664, {wxAuiNotebook, new_2, 2}},
- {2665, {wxAuiNotebook, addPage, 3}},
- {2666, {wxAuiNotebook, create, 2}},
- {2667, {wxAuiNotebook, deletePage, 1}},
- {2668, {wxAuiNotebook, getArtProvider, 0}},
- {2669, {wxAuiNotebook, getPage, 1}},
- {2670, {wxAuiNotebook, getPageBitmap, 1}},
- {2671, {wxAuiNotebook, getPageCount, 0}},
- {2672, {wxAuiNotebook, getPageIndex, 1}},
- {2673, {wxAuiNotebook, getPageText, 1}},
- {2674, {wxAuiNotebook, getSelection, 0}},
- {2675, {wxAuiNotebook, insertPage, 4}},
- {2676, {wxAuiNotebook, removePage, 1}},
- {2677, {wxAuiNotebook, setArtProvider, 1}},
- {2678, {wxAuiNotebook, setFont, 1}},
- {2679, {wxAuiNotebook, setPageBitmap, 2}},
- {2680, {wxAuiNotebook, setPageText, 2}},
- {2681, {wxAuiNotebook, setSelection, 1}},
- {2682, {wxAuiNotebook, setTabCtrlHeight, 1}},
- {2683, {wxAuiNotebook, setUniformBitmapSize, 1}},
- {2684, {wxAuiNotebook, 'Destroy', undefined}},
- {2685, {wxAuiTabArt, setFlags, 1}},
- {2686, {wxAuiTabArt, setMeasuringFont, 1}},
- {2687, {wxAuiTabArt, setNormalFont, 1}},
- {2688, {wxAuiTabArt, setSelectedFont, 1}},
- {2689, {wxAuiTabArt, setColour, 1}},
- {2690, {wxAuiTabArt, setActiveColour, 1}},
- {2691, {wxAuiDockArt, getColour, 1}},
- {2692, {wxAuiDockArt, getFont, 1}},
- {2693, {wxAuiDockArt, getMetric, 1}},
- {2694, {wxAuiDockArt, setColour, 2}},
- {2695, {wxAuiDockArt, setFont, 2}},
- {2696, {wxAuiDockArt, setMetric, 2}},
- {2697, {wxAuiSimpleTabArt, new, 0}},
- {2698, {wxAuiSimpleTabArt, 'Destroy', undefined}},
- {2699, {wxMDIParentFrame, new_0, 0}},
- {2700, {wxMDIParentFrame, new_4, 4}},
- {2701, {wxMDIParentFrame, destruct, 0}},
- {2702, {wxMDIParentFrame, activateNext, 0}},
- {2703, {wxMDIParentFrame, activatePrevious, 0}},
- {2704, {wxMDIParentFrame, arrangeIcons, 0}},
- {2705, {wxMDIParentFrame, cascade, 0}},
- {2706, {wxMDIParentFrame, create, 4}},
- {2707, {wxMDIParentFrame, getActiveChild, 0}},
- {2708, {wxMDIParentFrame, getClientWindow, 0}},
- {2709, {wxMDIParentFrame, tile, 1}},
- {2710, {wxMDIChildFrame, new_0, 0}},
- {2711, {wxMDIChildFrame, new_4, 4}},
- {2712, {wxMDIChildFrame, destruct, 0}},
- {2713, {wxMDIChildFrame, activate, 0}},
- {2714, {wxMDIChildFrame, create, 4}},
- {2715, {wxMDIChildFrame, maximize, 1}},
- {2716, {wxMDIChildFrame, restore, 0}},
- {2717, {wxMDIClientWindow, new_0, 0}},
- {2718, {wxMDIClientWindow, new_2, 2}},
- {2719, {wxMDIClientWindow, destruct, 0}},
- {2720, {wxMDIClientWindow, createClient, 2}},
- {2721, {wxLayoutAlgorithm, new, 0}},
- {2722, {wxLayoutAlgorithm, layoutFrame, 2}},
- {2723, {wxLayoutAlgorithm, layoutMDIFrame, 2}},
- {2724, {wxLayoutAlgorithm, layoutWindow, 2}},
- {2725, {wxLayoutAlgorithm, 'Destroy', undefined}},
- {2726, {wxEvent, getId, 0}},
- {2727, {wxEvent, getSkipped, 0}},
- {2728, {wxEvent, getTimestamp, 0}},
- {2729, {wxEvent, isCommandEvent, 0}},
- {2730, {wxEvent, resumePropagation, 1}},
- {2731, {wxEvent, shouldPropagate, 0}},
- {2732, {wxEvent, skip, 1}},
- {2733, {wxEvent, stopPropagation, 0}},
- {2734, {wxCommandEvent, getClientData, 0}},
- {2735, {wxCommandEvent, getExtraLong, 0}},
- {2736, {wxCommandEvent, getInt, 0}},
- {2737, {wxCommandEvent, getSelection, 0}},
- {2738, {wxCommandEvent, getString, 0}},
- {2739, {wxCommandEvent, isChecked, 0}},
- {2740, {wxCommandEvent, isSelection, 0}},
- {2741, {wxCommandEvent, setInt, 1}},
- {2742, {wxCommandEvent, setString, 1}},
- {2743, {wxScrollEvent, getOrientation, 0}},
- {2744, {wxScrollEvent, getPosition, 0}},
- {2745, {wxScrollWinEvent, getOrientation, 0}},
- {2746, {wxScrollWinEvent, getPosition, 0}},
- {2747, {wxMouseEvent, altDown, 0}},
- {2748, {wxMouseEvent, button, 1}},
- {2749, {wxMouseEvent, buttonDClick, 1}},
- {2750, {wxMouseEvent, buttonDown, 1}},
- {2751, {wxMouseEvent, buttonUp, 1}},
- {2752, {wxMouseEvent, cmdDown, 0}},
- {2753, {wxMouseEvent, controlDown, 0}},
- {2754, {wxMouseEvent, dragging, 0}},
- {2755, {wxMouseEvent, entering, 0}},
- {2756, {wxMouseEvent, getButton, 0}},
- {2759, {wxMouseEvent, getPosition, 0}},
- {2760, {wxMouseEvent, getLogicalPosition, 1}},
- {2761, {wxMouseEvent, getLinesPerAction, 0}},
- {2762, {wxMouseEvent, getWheelRotation, 0}},
- {2763, {wxMouseEvent, getWheelDelta, 0}},
- {2764, {wxMouseEvent, getX, 0}},
- {2765, {wxMouseEvent, getY, 0}},
- {2766, {wxMouseEvent, isButton, 0}},
- {2767, {wxMouseEvent, isPageScroll, 0}},
- {2768, {wxMouseEvent, leaving, 0}},
- {2769, {wxMouseEvent, leftDClick, 0}},
- {2770, {wxMouseEvent, leftDown, 0}},
- {2771, {wxMouseEvent, leftIsDown, 0}},
- {2772, {wxMouseEvent, leftUp, 0}},
- {2773, {wxMouseEvent, metaDown, 0}},
- {2774, {wxMouseEvent, middleDClick, 0}},
- {2775, {wxMouseEvent, middleDown, 0}},
- {2776, {wxMouseEvent, middleIsDown, 0}},
- {2777, {wxMouseEvent, middleUp, 0}},
- {2778, {wxMouseEvent, moving, 0}},
- {2779, {wxMouseEvent, rightDClick, 0}},
- {2780, {wxMouseEvent, rightDown, 0}},
- {2781, {wxMouseEvent, rightIsDown, 0}},
- {2782, {wxMouseEvent, rightUp, 0}},
- {2783, {wxMouseEvent, shiftDown, 0}},
- {2784, {wxSetCursorEvent, getCursor, 0}},
- {2785, {wxSetCursorEvent, getX, 0}},
- {2786, {wxSetCursorEvent, getY, 0}},
- {2787, {wxSetCursorEvent, hasCursor, 0}},
- {2788, {wxSetCursorEvent, setCursor, 1}},
- {2789, {wxKeyEvent, altDown, 0}},
- {2790, {wxKeyEvent, cmdDown, 0}},
- {2791, {wxKeyEvent, controlDown, 0}},
- {2792, {wxKeyEvent, getKeyCode, 0}},
- {2793, {wxKeyEvent, getModifiers, 0}},
- {2796, {wxKeyEvent, getPosition, 0}},
- {2797, {wxKeyEvent, getRawKeyCode, 0}},
- {2798, {wxKeyEvent, getRawKeyFlags, 0}},
- {2799, {wxKeyEvent, getUnicodeKey, 0}},
- {2800, {wxKeyEvent, getX, 0}},
- {2801, {wxKeyEvent, getY, 0}},
- {2802, {wxKeyEvent, hasModifiers, 0}},
- {2803, {wxKeyEvent, metaDown, 0}},
- {2804, {wxKeyEvent, shiftDown, 0}},
- {2805, {wxSizeEvent, getSize, 0}},
- {2806, {wxMoveEvent, getPosition, 0}},
- {2807, {wxEraseEvent, getDC, 0}},
- {2808, {wxFocusEvent, getWindow, 0}},
- {2809, {wxChildFocusEvent, getWindow, 0}},
- {2810, {wxMenuEvent, getMenu, 0}},
- {2811, {wxMenuEvent, getMenuId, 0}},
- {2812, {wxMenuEvent, isPopup, 0}},
- {2813, {wxCloseEvent, canVeto, 0}},
- {2814, {wxCloseEvent, getLoggingOff, 0}},
- {2815, {wxCloseEvent, setCanVeto, 1}},
- {2816, {wxCloseEvent, setLoggingOff, 1}},
- {2817, {wxCloseEvent, veto, 1}},
- {2818, {wxShowEvent, setShow, 1}},
- {2819, {wxShowEvent, getShow, 0}},
- {2820, {wxIconizeEvent, iconized, 0}},
- {2821, {wxJoystickEvent, buttonDown, 1}},
- {2822, {wxJoystickEvent, buttonIsDown, 1}},
- {2823, {wxJoystickEvent, buttonUp, 1}},
- {2824, {wxJoystickEvent, getButtonChange, 0}},
- {2825, {wxJoystickEvent, getButtonState, 0}},
- {2826, {wxJoystickEvent, getJoystick, 0}},
- {2827, {wxJoystickEvent, getPosition, 0}},
- {2828, {wxJoystickEvent, getZPosition, 0}},
- {2829, {wxJoystickEvent, isButton, 0}},
- {2830, {wxJoystickEvent, isMove, 0}},
- {2831, {wxJoystickEvent, isZMove, 0}},
- {2832, {wxUpdateUIEvent, canUpdate, 1}},
- {2833, {wxUpdateUIEvent, check, 1}},
- {2834, {wxUpdateUIEvent, enable, 1}},
- {2835, {wxUpdateUIEvent, show, 1}},
- {2836, {wxUpdateUIEvent, getChecked, 0}},
- {2837, {wxUpdateUIEvent, getEnabled, 0}},
- {2838, {wxUpdateUIEvent, getShown, 0}},
- {2839, {wxUpdateUIEvent, getSetChecked, 0}},
- {2840, {wxUpdateUIEvent, getSetEnabled, 0}},
- {2841, {wxUpdateUIEvent, getSetShown, 0}},
- {2842, {wxUpdateUIEvent, getSetText, 0}},
- {2843, {wxUpdateUIEvent, getText, 0}},
- {2844, {wxUpdateUIEvent, getMode, 0}},
- {2845, {wxUpdateUIEvent, getUpdateInterval, 0}},
- {2846, {wxUpdateUIEvent, resetUpdateTime, 0}},
- {2847, {wxUpdateUIEvent, setMode, 1}},
- {2848, {wxUpdateUIEvent, setText, 1}},
- {2849, {wxUpdateUIEvent, setUpdateInterval, 1}},
- {2850, {wxMouseCaptureChangedEvent, getCapturedWindow, 0}},
- {2851, {wxPaletteChangedEvent, setChangedWindow, 1}},
- {2852, {wxPaletteChangedEvent, getChangedWindow, 0}},
- {2853, {wxQueryNewPaletteEvent, setPaletteRealized, 1}},
- {2854, {wxQueryNewPaletteEvent, getPaletteRealized, 0}},
- {2855, {wxNavigationKeyEvent, getDirection, 0}},
- {2856, {wxNavigationKeyEvent, setDirection, 1}},
- {2857, {wxNavigationKeyEvent, isWindowChange, 0}},
- {2858, {wxNavigationKeyEvent, setWindowChange, 1}},
- {2859, {wxNavigationKeyEvent, isFromTab, 0}},
- {2860, {wxNavigationKeyEvent, setFromTab, 1}},
- {2861, {wxNavigationKeyEvent, getCurrentFocus, 0}},
- {2862, {wxNavigationKeyEvent, setCurrentFocus, 1}},
- {2863, {wxHelpEvent, getOrigin, 0}},
- {2864, {wxHelpEvent, getPosition, 0}},
- {2865, {wxHelpEvent, setOrigin, 1}},
- {2866, {wxHelpEvent, setPosition, 1}},
- {2867, {wxContextMenuEvent, getPosition, 0}},
- {2868, {wxContextMenuEvent, setPosition, 1}},
- {2869, {wxIdleEvent, canSend, 1}},
- {2870, {wxIdleEvent, getMode, 0}},
- {2871, {wxIdleEvent, requestMore, 1}},
- {2872, {wxIdleEvent, moreRequested, 0}},
- {2873, {wxIdleEvent, setMode, 1}},
- {2874, {wxGridEvent, altDown, 0}},
- {2875, {wxGridEvent, controlDown, 0}},
- {2876, {wxGridEvent, getCol, 0}},
- {2877, {wxGridEvent, getPosition, 0}},
- {2878, {wxGridEvent, getRow, 0}},
- {2879, {wxGridEvent, metaDown, 0}},
- {2880, {wxGridEvent, selecting, 0}},
- {2881, {wxGridEvent, shiftDown, 0}},
- {2882, {wxNotifyEvent, allow, 0}},
- {2883, {wxNotifyEvent, isAllowed, 0}},
- {2884, {wxNotifyEvent, veto, 0}},
- {2885, {wxSashEvent, getEdge, 0}},
- {2886, {wxSashEvent, getDragRect, 0}},
- {2887, {wxSashEvent, getDragStatus, 0}},
- {2888, {wxListEvent, getCacheFrom, 0}},
- {2889, {wxListEvent, getCacheTo, 0}},
- {2890, {wxListEvent, getKeyCode, 0}},
- {2891, {wxListEvent, getIndex, 0}},
- {2892, {wxListEvent, getColumn, 0}},
- {2893, {wxListEvent, getPoint, 0}},
- {2894, {wxListEvent, getLabel, 0}},
- {2895, {wxListEvent, getText, 0}},
- {2896, {wxListEvent, getImage, 0}},
- {2897, {wxListEvent, getData, 0}},
- {2898, {wxListEvent, getMask, 0}},
- {2899, {wxListEvent, getItem, 0}},
- {2900, {wxListEvent, isEditCancelled, 0}},
- {2901, {wxDateEvent, getDate, 0}},
- {2902, {wxCalendarEvent, getWeekDay, 0}},
- {2903, {wxFileDirPickerEvent, getPath, 0}},
- {2904, {wxColourPickerEvent, getColour, 0}},
- {2905, {wxFontPickerEvent, getFont, 0}},
- {2906, {wxStyledTextEvent, getPosition, 0}},
- {2907, {wxStyledTextEvent, getKey, 0}},
- {2908, {wxStyledTextEvent, getModifiers, 0}},
- {2909, {wxStyledTextEvent, getModificationType, 0}},
- {2910, {wxStyledTextEvent, getText, 0}},
- {2911, {wxStyledTextEvent, getLength, 0}},
- {2912, {wxStyledTextEvent, getLinesAdded, 0}},
- {2913, {wxStyledTextEvent, getLine, 0}},
- {2914, {wxStyledTextEvent, getFoldLevelNow, 0}},
- {2915, {wxStyledTextEvent, getFoldLevelPrev, 0}},
- {2916, {wxStyledTextEvent, getMargin, 0}},
- {2917, {wxStyledTextEvent, getMessage, 0}},
- {2918, {wxStyledTextEvent, getWParam, 0}},
- {2919, {wxStyledTextEvent, getLParam, 0}},
- {2920, {wxStyledTextEvent, getListType, 0}},
- {2921, {wxStyledTextEvent, getX, 0}},
- {2922, {wxStyledTextEvent, getY, 0}},
- {2923, {wxStyledTextEvent, getDragText, 0}},
- {2924, {wxStyledTextEvent, getDragAllowMove, 0}},
- {2925, {wxStyledTextEvent, getDragResult, 0}},
- {2926, {wxStyledTextEvent, getShift, 0}},
- {2927, {wxStyledTextEvent, getControl, 0}},
- {2928, {wxStyledTextEvent, getAlt, 0}},
- {2929, {utils, getKeyState, 1}},
- {2930, {utils, getMousePosition, 2}},
- {2931, {utils, getMouseState, 0}},
- {2932, {utils, setDetectableAutoRepeat, 1}},
- {2933, {utils, bell, 0}},
- {2934, {utils, findMenuItemId, 3}},
- {2935, {utils, genericFindWindowAtPoint, 1}},
- {2936, {utils, findWindowAtPoint, 1}},
- {2937, {utils, beginBusyCursor, 1}},
- {2938, {utils, endBusyCursor, 0}},
- {2939, {utils, isBusy, 0}},
- {2940, {utils, shutdown, 1}},
- {2941, {utils, shell, 1}},
- {2942, {utils, launchDefaultBrowser, 2}},
- {2943, {utils, getEmailAddress, 0}},
- {2944, {utils, getUserId, 0}},
- {2945, {utils, getHomeDir, 0}},
- {2946, {utils, newId, 0}},
- {2947, {utils, registerId, 1}},
- {2948, {utils, getCurrentId, 0}},
- {2949, {utils, getOsDescription, 0}},
- {2950, {utils, isPlatformLittleEndian, 0}},
- {2951, {utils, isPlatform64Bit, 0}},
- {2952, {gdicmn, displaySize, 2}},
- {2953, {gdicmn, setCursor, 1}},
- {2954, {wxPrintout, new, 1}},
- {2955, {wxPrintout, destruct, 0}},
- {2956, {wxPrintout, getDC, 0}},
- {2957, {wxPrintout, getPageSizeMM, 2}},
- {2958, {wxPrintout, getPageSizePixels, 2}},
- {2959, {wxPrintout, getPaperRectPixels, 0}},
- {2960, {wxPrintout, getPPIPrinter, 2}},
- {2961, {wxPrintout, getPPIScreen, 2}},
- {2962, {wxPrintout, getTitle, 0}},
- {2963, {wxPrintout, isPreview, 0}},
- {2964, {wxPrintout, fitThisSizeToPaper, 1}},
- {2965, {wxPrintout, fitThisSizeToPage, 1}},
- {2966, {wxPrintout, fitThisSizeToPageMargins, 2}},
- {2967, {wxPrintout, mapScreenSizeToPaper, 0}},
- {2968, {wxPrintout, mapScreenSizeToPage, 0}},
- {2969, {wxPrintout, mapScreenSizeToPageMargins, 1}},
- {2970, {wxPrintout, mapScreenSizeToDevice, 0}},
- {2971, {wxPrintout, getLogicalPaperRect, 0}},
- {2972, {wxPrintout, getLogicalPageRect, 0}},
- {2973, {wxPrintout, getLogicalPageMarginsRect, 1}},
- {2974, {wxPrintout, setLogicalOrigin, 2}},
- {2975, {wxPrintout, offsetLogicalOrigin, 2}},
- {2976, {wxStyledTextCtrl, new_2, 2}},
- {2977, {wxStyledTextCtrl, new_0, 0}},
- {2978, {wxStyledTextCtrl, destruct, 0}},
- {2979, {wxStyledTextCtrl, create, 2}},
- {2980, {wxStyledTextCtrl, addText, 1}},
- {2981, {wxStyledTextCtrl, addStyledText, 1}},
- {2982, {wxStyledTextCtrl, insertText, 2}},
- {2983, {wxStyledTextCtrl, clearAll, 0}},
- {2984, {wxStyledTextCtrl, clearDocumentStyle, 0}},
- {2985, {wxStyledTextCtrl, getLength, 0}},
- {2986, {wxStyledTextCtrl, getCharAt, 1}},
- {2987, {wxStyledTextCtrl, getCurrentPos, 0}},
- {2988, {wxStyledTextCtrl, getAnchor, 0}},
- {2989, {wxStyledTextCtrl, getStyleAt, 1}},
- {2990, {wxStyledTextCtrl, redo, 0}},
- {2991, {wxStyledTextCtrl, setUndoCollection, 1}},
- {2992, {wxStyledTextCtrl, selectAll, 0}},
- {2993, {wxStyledTextCtrl, setSavePoint, 0}},
- {2994, {wxStyledTextCtrl, getStyledText, 2}},
- {2995, {wxStyledTextCtrl, canRedo, 0}},
- {2996, {wxStyledTextCtrl, markerLineFromHandle, 1}},
- {2997, {wxStyledTextCtrl, markerDeleteHandle, 1}},
- {2998, {wxStyledTextCtrl, getUndoCollection, 0}},
- {2999, {wxStyledTextCtrl, getViewWhiteSpace, 0}},
- {3000, {wxStyledTextCtrl, setViewWhiteSpace, 1}},
- {3001, {wxStyledTextCtrl, positionFromPoint, 1}},
- {3002, {wxStyledTextCtrl, positionFromPointClose, 2}},
- {3003, {wxStyledTextCtrl, gotoLine, 1}},
- {3004, {wxStyledTextCtrl, gotoPos, 1}},
- {3005, {wxStyledTextCtrl, setAnchor, 1}},
- {3006, {wxStyledTextCtrl, getCurLine, 1}},
- {3007, {wxStyledTextCtrl, getEndStyled, 0}},
- {3008, {wxStyledTextCtrl, convertEOLs, 1}},
- {3009, {wxStyledTextCtrl, getEOLMode, 0}},
- {3010, {wxStyledTextCtrl, setEOLMode, 1}},
- {3011, {wxStyledTextCtrl, startStyling, 2}},
- {3012, {wxStyledTextCtrl, setStyling, 2}},
- {3013, {wxStyledTextCtrl, getBufferedDraw, 0}},
- {3014, {wxStyledTextCtrl, setBufferedDraw, 1}},
- {3015, {wxStyledTextCtrl, setTabWidth, 1}},
- {3016, {wxStyledTextCtrl, getTabWidth, 0}},
- {3017, {wxStyledTextCtrl, setCodePage, 1}},
- {3018, {wxStyledTextCtrl, markerDefine, 3}},
- {3019, {wxStyledTextCtrl, markerSetForeground, 2}},
- {3020, {wxStyledTextCtrl, markerSetBackground, 2}},
- {3021, {wxStyledTextCtrl, markerAdd, 2}},
- {3022, {wxStyledTextCtrl, markerDelete, 2}},
- {3023, {wxStyledTextCtrl, markerDeleteAll, 1}},
- {3024, {wxStyledTextCtrl, markerGet, 1}},
- {3025, {wxStyledTextCtrl, markerNext, 2}},
- {3026, {wxStyledTextCtrl, markerPrevious, 2}},
- {3027, {wxStyledTextCtrl, markerDefineBitmap, 2}},
- {3028, {wxStyledTextCtrl, markerAddSet, 2}},
- {3029, {wxStyledTextCtrl, markerSetAlpha, 2}},
- {3030, {wxStyledTextCtrl, setMarginType, 2}},
- {3031, {wxStyledTextCtrl, getMarginType, 1}},
- {3032, {wxStyledTextCtrl, setMarginWidth, 2}},
- {3033, {wxStyledTextCtrl, getMarginWidth, 1}},
- {3034, {wxStyledTextCtrl, setMarginMask, 2}},
- {3035, {wxStyledTextCtrl, getMarginMask, 1}},
- {3036, {wxStyledTextCtrl, setMarginSensitive, 2}},
- {3037, {wxStyledTextCtrl, getMarginSensitive, 1}},
- {3038, {wxStyledTextCtrl, styleClearAll, 0}},
- {3039, {wxStyledTextCtrl, styleSetForeground, 2}},
- {3040, {wxStyledTextCtrl, styleSetBackground, 2}},
- {3041, {wxStyledTextCtrl, styleSetBold, 2}},
- {3042, {wxStyledTextCtrl, styleSetItalic, 2}},
- {3043, {wxStyledTextCtrl, styleSetSize, 2}},
- {3044, {wxStyledTextCtrl, styleSetFaceName, 2}},
- {3045, {wxStyledTextCtrl, styleSetEOLFilled, 2}},
- {3046, {wxStyledTextCtrl, styleResetDefault, 0}},
- {3047, {wxStyledTextCtrl, styleSetUnderline, 2}},
- {3048, {wxStyledTextCtrl, styleSetCase, 2}},
- {3049, {wxStyledTextCtrl, styleSetHotSpot, 2}},
- {3050, {wxStyledTextCtrl, setSelForeground, 2}},
- {3051, {wxStyledTextCtrl, setSelBackground, 2}},
- {3052, {wxStyledTextCtrl, getSelAlpha, 0}},
- {3053, {wxStyledTextCtrl, setSelAlpha, 1}},
- {3054, {wxStyledTextCtrl, setCaretForeground, 1}},
- {3055, {wxStyledTextCtrl, cmdKeyAssign, 3}},
- {3056, {wxStyledTextCtrl, cmdKeyClear, 2}},
- {3057, {wxStyledTextCtrl, cmdKeyClearAll, 0}},
- {3058, {wxStyledTextCtrl, setStyleBytes, 2}},
- {3059, {wxStyledTextCtrl, styleSetVisible, 2}},
- {3060, {wxStyledTextCtrl, getCaretPeriod, 0}},
- {3061, {wxStyledTextCtrl, setCaretPeriod, 1}},
- {3062, {wxStyledTextCtrl, setWordChars, 1}},
- {3063, {wxStyledTextCtrl, beginUndoAction, 0}},
- {3064, {wxStyledTextCtrl, endUndoAction, 0}},
- {3065, {wxStyledTextCtrl, indicatorSetStyle, 2}},
- {3066, {wxStyledTextCtrl, indicatorGetStyle, 1}},
- {3067, {wxStyledTextCtrl, indicatorSetForeground, 2}},
- {3068, {wxStyledTextCtrl, indicatorGetForeground, 1}},
- {3069, {wxStyledTextCtrl, setWhitespaceForeground, 2}},
- {3070, {wxStyledTextCtrl, setWhitespaceBackground, 2}},
- {3071, {wxStyledTextCtrl, getStyleBits, 0}},
- {3072, {wxStyledTextCtrl, setLineState, 2}},
- {3073, {wxStyledTextCtrl, getLineState, 1}},
- {3074, {wxStyledTextCtrl, getMaxLineState, 0}},
- {3075, {wxStyledTextCtrl, getCaretLineVisible, 0}},
- {3076, {wxStyledTextCtrl, setCaretLineVisible, 1}},
- {3077, {wxStyledTextCtrl, getCaretLineBackground, 0}},
- {3078, {wxStyledTextCtrl, setCaretLineBackground, 1}},
- {3079, {wxStyledTextCtrl, autoCompShow, 2}},
- {3080, {wxStyledTextCtrl, autoCompCancel, 0}},
- {3081, {wxStyledTextCtrl, autoCompActive, 0}},
- {3082, {wxStyledTextCtrl, autoCompPosStart, 0}},
- {3083, {wxStyledTextCtrl, autoCompComplete, 0}},
- {3084, {wxStyledTextCtrl, autoCompStops, 1}},
- {3085, {wxStyledTextCtrl, autoCompSetSeparator, 1}},
- {3086, {wxStyledTextCtrl, autoCompGetSeparator, 0}},
- {3087, {wxStyledTextCtrl, autoCompSelect, 1}},
- {3088, {wxStyledTextCtrl, autoCompSetCancelAtStart, 1}},
- {3089, {wxStyledTextCtrl, autoCompGetCancelAtStart, 0}},
- {3090, {wxStyledTextCtrl, autoCompSetFillUps, 1}},
- {3091, {wxStyledTextCtrl, autoCompSetChooseSingle, 1}},
- {3092, {wxStyledTextCtrl, autoCompGetChooseSingle, 0}},
- {3093, {wxStyledTextCtrl, autoCompSetIgnoreCase, 1}},
- {3094, {wxStyledTextCtrl, autoCompGetIgnoreCase, 0}},
- {3095, {wxStyledTextCtrl, userListShow, 2}},
- {3096, {wxStyledTextCtrl, autoCompSetAutoHide, 1}},
- {3097, {wxStyledTextCtrl, autoCompGetAutoHide, 0}},
- {3098, {wxStyledTextCtrl, autoCompSetDropRestOfWord, 1}},
- {3099, {wxStyledTextCtrl, autoCompGetDropRestOfWord, 0}},
- {3100, {wxStyledTextCtrl, registerImage, 2}},
- {3101, {wxStyledTextCtrl, clearRegisteredImages, 0}},
- {3102, {wxStyledTextCtrl, autoCompGetTypeSeparator, 0}},
- {3103, {wxStyledTextCtrl, autoCompSetTypeSeparator, 1}},
- {3104, {wxStyledTextCtrl, autoCompSetMaxWidth, 1}},
- {3105, {wxStyledTextCtrl, autoCompGetMaxWidth, 0}},
- {3106, {wxStyledTextCtrl, autoCompSetMaxHeight, 1}},
- {3107, {wxStyledTextCtrl, autoCompGetMaxHeight, 0}},
- {3108, {wxStyledTextCtrl, setIndent, 1}},
- {3109, {wxStyledTextCtrl, getIndent, 0}},
- {3110, {wxStyledTextCtrl, setUseTabs, 1}},
- {3111, {wxStyledTextCtrl, getUseTabs, 0}},
- {3112, {wxStyledTextCtrl, setLineIndentation, 2}},
- {3113, {wxStyledTextCtrl, getLineIndentation, 1}},
- {3114, {wxStyledTextCtrl, getLineIndentPosition, 1}},
- {3115, {wxStyledTextCtrl, getColumn, 1}},
- {3116, {wxStyledTextCtrl, setUseHorizontalScrollBar, 1}},
- {3117, {wxStyledTextCtrl, getUseHorizontalScrollBar, 0}},
- {3118, {wxStyledTextCtrl, setIndentationGuides, 1}},
- {3119, {wxStyledTextCtrl, getIndentationGuides, 0}},
- {3120, {wxStyledTextCtrl, setHighlightGuide, 1}},
- {3121, {wxStyledTextCtrl, getHighlightGuide, 0}},
- {3122, {wxStyledTextCtrl, getLineEndPosition, 1}},
- {3123, {wxStyledTextCtrl, getCodePage, 0}},
- {3124, {wxStyledTextCtrl, getCaretForeground, 0}},
- {3125, {wxStyledTextCtrl, getReadOnly, 0}},
- {3126, {wxStyledTextCtrl, setCurrentPos, 1}},
- {3127, {wxStyledTextCtrl, setSelectionStart, 1}},
- {3128, {wxStyledTextCtrl, getSelectionStart, 0}},
- {3129, {wxStyledTextCtrl, setSelectionEnd, 1}},
- {3130, {wxStyledTextCtrl, getSelectionEnd, 0}},
- {3131, {wxStyledTextCtrl, setPrintMagnification, 1}},
- {3132, {wxStyledTextCtrl, getPrintMagnification, 0}},
- {3133, {wxStyledTextCtrl, setPrintColourMode, 1}},
- {3134, {wxStyledTextCtrl, getPrintColourMode, 0}},
- {3135, {wxStyledTextCtrl, findText, 4}},
- {3136, {wxStyledTextCtrl, formatRange, 7}},
- {3137, {wxStyledTextCtrl, getFirstVisibleLine, 0}},
- {3138, {wxStyledTextCtrl, getLine, 1}},
- {3139, {wxStyledTextCtrl, getLineCount, 0}},
- {3140, {wxStyledTextCtrl, setMarginLeft, 1}},
- {3141, {wxStyledTextCtrl, getMarginLeft, 0}},
- {3142, {wxStyledTextCtrl, setMarginRight, 1}},
- {3143, {wxStyledTextCtrl, getMarginRight, 0}},
- {3144, {wxStyledTextCtrl, getModify, 0}},
- {3145, {wxStyledTextCtrl, setSelection, 2}},
- {3146, {wxStyledTextCtrl, getSelectedText, 0}},
- {3147, {wxStyledTextCtrl, getTextRange, 2}},
- {3148, {wxStyledTextCtrl, hideSelection, 1}},
- {3149, {wxStyledTextCtrl, lineFromPosition, 1}},
- {3150, {wxStyledTextCtrl, positionFromLine, 1}},
- {3151, {wxStyledTextCtrl, lineScroll, 2}},
- {3152, {wxStyledTextCtrl, ensureCaretVisible, 0}},
- {3153, {wxStyledTextCtrl, replaceSelection, 1}},
- {3154, {wxStyledTextCtrl, setReadOnly, 1}},
- {3155, {wxStyledTextCtrl, canPaste, 0}},
- {3156, {wxStyledTextCtrl, canUndo, 0}},
- {3157, {wxStyledTextCtrl, emptyUndoBuffer, 0}},
- {3158, {wxStyledTextCtrl, undo, 0}},
- {3159, {wxStyledTextCtrl, cut, 0}},
- {3160, {wxStyledTextCtrl, copy, 0}},
- {3161, {wxStyledTextCtrl, paste, 0}},
- {3162, {wxStyledTextCtrl, clear, 0}},
- {3163, {wxStyledTextCtrl, setText, 1}},
- {3164, {wxStyledTextCtrl, getText, 0}},
- {3165, {wxStyledTextCtrl, getTextLength, 0}},
- {3166, {wxStyledTextCtrl, getOvertype, 0}},
- {3167, {wxStyledTextCtrl, setCaretWidth, 1}},
- {3168, {wxStyledTextCtrl, getCaretWidth, 0}},
- {3169, {wxStyledTextCtrl, setTargetStart, 1}},
- {3170, {wxStyledTextCtrl, getTargetStart, 0}},
- {3171, {wxStyledTextCtrl, setTargetEnd, 1}},
- {3172, {wxStyledTextCtrl, getTargetEnd, 0}},
- {3173, {wxStyledTextCtrl, replaceTarget, 1}},
- {3174, {wxStyledTextCtrl, searchInTarget, 1}},
- {3175, {wxStyledTextCtrl, setSearchFlags, 1}},
- {3176, {wxStyledTextCtrl, getSearchFlags, 0}},
- {3177, {wxStyledTextCtrl, callTipShow, 2}},
- {3178, {wxStyledTextCtrl, callTipCancel, 0}},
- {3179, {wxStyledTextCtrl, callTipActive, 0}},
- {3180, {wxStyledTextCtrl, callTipPosAtStart, 0}},
- {3181, {wxStyledTextCtrl, callTipSetHighlight, 2}},
- {3182, {wxStyledTextCtrl, callTipSetBackground, 1}},
- {3183, {wxStyledTextCtrl, callTipSetForeground, 1}},
- {3184, {wxStyledTextCtrl, callTipSetForegroundHighlight, 1}},
- {3185, {wxStyledTextCtrl, callTipUseStyle, 1}},
- {3186, {wxStyledTextCtrl, visibleFromDocLine, 1}},
- {3187, {wxStyledTextCtrl, docLineFromVisible, 1}},
- {3188, {wxStyledTextCtrl, wrapCount, 1}},
- {3189, {wxStyledTextCtrl, setFoldLevel, 2}},
- {3190, {wxStyledTextCtrl, getFoldLevel, 1}},
- {3191, {wxStyledTextCtrl, getLastChild, 2}},
- {3192, {wxStyledTextCtrl, getFoldParent, 1}},
- {3193, {wxStyledTextCtrl, showLines, 2}},
- {3194, {wxStyledTextCtrl, hideLines, 2}},
- {3195, {wxStyledTextCtrl, getLineVisible, 1}},
- {3196, {wxStyledTextCtrl, setFoldExpanded, 2}},
- {3197, {wxStyledTextCtrl, getFoldExpanded, 1}},
- {3198, {wxStyledTextCtrl, toggleFold, 1}},
- {3199, {wxStyledTextCtrl, ensureVisible, 1}},
- {3200, {wxStyledTextCtrl, setFoldFlags, 1}},
- {3201, {wxStyledTextCtrl, ensureVisibleEnforcePolicy, 1}},
- {3202, {wxStyledTextCtrl, setTabIndents, 1}},
- {3203, {wxStyledTextCtrl, getTabIndents, 0}},
- {3204, {wxStyledTextCtrl, setBackSpaceUnIndents, 1}},
- {3205, {wxStyledTextCtrl, getBackSpaceUnIndents, 0}},
- {3206, {wxStyledTextCtrl, setMouseDwellTime, 1}},
- {3207, {wxStyledTextCtrl, getMouseDwellTime, 0}},
- {3208, {wxStyledTextCtrl, wordStartPosition, 2}},
- {3209, {wxStyledTextCtrl, wordEndPosition, 2}},
- {3210, {wxStyledTextCtrl, setWrapMode, 1}},
- {3211, {wxStyledTextCtrl, getWrapMode, 0}},
- {3212, {wxStyledTextCtrl, setWrapVisualFlags, 1}},
- {3213, {wxStyledTextCtrl, getWrapVisualFlags, 0}},
- {3214, {wxStyledTextCtrl, setWrapVisualFlagsLocation, 1}},
- {3215, {wxStyledTextCtrl, getWrapVisualFlagsLocation, 0}},
- {3216, {wxStyledTextCtrl, setWrapStartIndent, 1}},
- {3217, {wxStyledTextCtrl, getWrapStartIndent, 0}},
- {3218, {wxStyledTextCtrl, setLayoutCache, 1}},
- {3219, {wxStyledTextCtrl, getLayoutCache, 0}},
- {3220, {wxStyledTextCtrl, setScrollWidth, 1}},
- {3221, {wxStyledTextCtrl, getScrollWidth, 0}},
- {3222, {wxStyledTextCtrl, textWidth, 2}},
- {3223, {wxStyledTextCtrl, getEndAtLastLine, 0}},
- {3224, {wxStyledTextCtrl, textHeight, 1}},
- {3225, {wxStyledTextCtrl, setUseVerticalScrollBar, 1}},
- {3226, {wxStyledTextCtrl, getUseVerticalScrollBar, 0}},
- {3227, {wxStyledTextCtrl, appendText, 1}},
- {3228, {wxStyledTextCtrl, getTwoPhaseDraw, 0}},
- {3229, {wxStyledTextCtrl, setTwoPhaseDraw, 1}},
- {3230, {wxStyledTextCtrl, targetFromSelection, 0}},
- {3231, {wxStyledTextCtrl, linesJoin, 0}},
- {3232, {wxStyledTextCtrl, linesSplit, 1}},
- {3233, {wxStyledTextCtrl, setFoldMarginColour, 2}},
- {3234, {wxStyledTextCtrl, setFoldMarginHiColour, 2}},
- {3235, {wxStyledTextCtrl, lineDown, 0}},
- {3236, {wxStyledTextCtrl, lineDownExtend, 0}},
- {3237, {wxStyledTextCtrl, lineUp, 0}},
- {3238, {wxStyledTextCtrl, lineUpExtend, 0}},
- {3239, {wxStyledTextCtrl, charLeft, 0}},
- {3240, {wxStyledTextCtrl, charLeftExtend, 0}},
- {3241, {wxStyledTextCtrl, charRight, 0}},
- {3242, {wxStyledTextCtrl, charRightExtend, 0}},
- {3243, {wxStyledTextCtrl, wordLeft, 0}},
- {3244, {wxStyledTextCtrl, wordLeftExtend, 0}},
- {3245, {wxStyledTextCtrl, wordRight, 0}},
- {3246, {wxStyledTextCtrl, wordRightExtend, 0}},
- {3247, {wxStyledTextCtrl, home, 0}},
- {3248, {wxStyledTextCtrl, homeExtend, 0}},
- {3249, {wxStyledTextCtrl, lineEnd, 0}},
- {3250, {wxStyledTextCtrl, lineEndExtend, 0}},
- {3251, {wxStyledTextCtrl, documentStart, 0}},
- {3252, {wxStyledTextCtrl, documentStartExtend, 0}},
- {3253, {wxStyledTextCtrl, documentEnd, 0}},
- {3254, {wxStyledTextCtrl, documentEndExtend, 0}},
- {3255, {wxStyledTextCtrl, pageUp, 0}},
- {3256, {wxStyledTextCtrl, pageUpExtend, 0}},
- {3257, {wxStyledTextCtrl, pageDown, 0}},
- {3258, {wxStyledTextCtrl, pageDownExtend, 0}},
- {3259, {wxStyledTextCtrl, editToggleOvertype, 0}},
- {3260, {wxStyledTextCtrl, cancel, 0}},
- {3261, {wxStyledTextCtrl, deleteBack, 0}},
- {3262, {wxStyledTextCtrl, tab, 0}},
- {3263, {wxStyledTextCtrl, backTab, 0}},
- {3264, {wxStyledTextCtrl, newLine, 0}},
- {3265, {wxStyledTextCtrl, formFeed, 0}},
- {3266, {wxStyledTextCtrl, vCHome, 0}},
- {3267, {wxStyledTextCtrl, vCHomeExtend, 0}},
- {3268, {wxStyledTextCtrl, zoomIn, 0}},
- {3269, {wxStyledTextCtrl, zoomOut, 0}},
- {3270, {wxStyledTextCtrl, delWordLeft, 0}},
- {3271, {wxStyledTextCtrl, delWordRight, 0}},
- {3272, {wxStyledTextCtrl, lineCut, 0}},
- {3273, {wxStyledTextCtrl, lineDelete, 0}},
- {3274, {wxStyledTextCtrl, lineTranspose, 0}},
- {3275, {wxStyledTextCtrl, lineDuplicate, 0}},
- {3276, {wxStyledTextCtrl, lowerCase, 0}},
- {3277, {wxStyledTextCtrl, upperCase, 0}},
- {3278, {wxStyledTextCtrl, lineScrollDown, 0}},
- {3279, {wxStyledTextCtrl, lineScrollUp, 0}},
- {3280, {wxStyledTextCtrl, deleteBackNotLine, 0}},
- {3281, {wxStyledTextCtrl, homeDisplay, 0}},
- {3282, {wxStyledTextCtrl, homeDisplayExtend, 0}},
- {3283, {wxStyledTextCtrl, lineEndDisplay, 0}},
- {3284, {wxStyledTextCtrl, lineEndDisplayExtend, 0}},
- {3285, {wxStyledTextCtrl, homeWrapExtend, 0}},
- {3286, {wxStyledTextCtrl, lineEndWrap, 0}},
- {3287, {wxStyledTextCtrl, lineEndWrapExtend, 0}},
- {3288, {wxStyledTextCtrl, vCHomeWrap, 0}},
- {3289, {wxStyledTextCtrl, vCHomeWrapExtend, 0}},
- {3290, {wxStyledTextCtrl, lineCopy, 0}},
- {3291, {wxStyledTextCtrl, moveCaretInsideView, 0}},
- {3292, {wxStyledTextCtrl, lineLength, 1}},
- {3293, {wxStyledTextCtrl, braceHighlight, 2}},
- {3294, {wxStyledTextCtrl, braceBadLight, 1}},
- {3295, {wxStyledTextCtrl, braceMatch, 1}},
- {3296, {wxStyledTextCtrl, getViewEOL, 0}},
- {3297, {wxStyledTextCtrl, setViewEOL, 1}},
- {3298, {wxStyledTextCtrl, setModEventMask, 1}},
- {3299, {wxStyledTextCtrl, getEdgeColumn, 0}},
- {3300, {wxStyledTextCtrl, setEdgeColumn, 1}},
- {3301, {wxStyledTextCtrl, setEdgeMode, 1}},
- {3302, {wxStyledTextCtrl, getEdgeMode, 0}},
- {3303, {wxStyledTextCtrl, getEdgeColour, 0}},
- {3304, {wxStyledTextCtrl, setEdgeColour, 1}},
- {3305, {wxStyledTextCtrl, searchAnchor, 0}},
- {3306, {wxStyledTextCtrl, searchNext, 2}},
- {3307, {wxStyledTextCtrl, searchPrev, 2}},
- {3308, {wxStyledTextCtrl, linesOnScreen, 0}},
- {3309, {wxStyledTextCtrl, usePopUp, 1}},
- {3310, {wxStyledTextCtrl, selectionIsRectangle, 0}},
- {3311, {wxStyledTextCtrl, setZoom, 1}},
- {3312, {wxStyledTextCtrl, getZoom, 0}},
- {3313, {wxStyledTextCtrl, getModEventMask, 0}},
- {3314, {wxStyledTextCtrl, setSTCFocus, 1}},
- {3315, {wxStyledTextCtrl, getSTCFocus, 0}},
- {3316, {wxStyledTextCtrl, setStatus, 1}},
- {3317, {wxStyledTextCtrl, getStatus, 0}},
- {3318, {wxStyledTextCtrl, setMouseDownCaptures, 1}},
- {3319, {wxStyledTextCtrl, getMouseDownCaptures, 0}},
- {3320, {wxStyledTextCtrl, setSTCCursor, 1}},
- {3321, {wxStyledTextCtrl, getSTCCursor, 0}},
- {3322, {wxStyledTextCtrl, setControlCharSymbol, 1}},
- {3323, {wxStyledTextCtrl, getControlCharSymbol, 0}},
- {3324, {wxStyledTextCtrl, wordPartLeft, 0}},
- {3325, {wxStyledTextCtrl, wordPartLeftExtend, 0}},
- {3326, {wxStyledTextCtrl, wordPartRight, 0}},
- {3327, {wxStyledTextCtrl, wordPartRightExtend, 0}},
- {3328, {wxStyledTextCtrl, setVisiblePolicy, 2}},
- {3329, {wxStyledTextCtrl, delLineLeft, 0}},
- {3330, {wxStyledTextCtrl, delLineRight, 0}},
- {3331, {wxStyledTextCtrl, getXOffset, 0}},
- {3332, {wxStyledTextCtrl, chooseCaretX, 0}},
- {3333, {wxStyledTextCtrl, setXCaretPolicy, 2}},
- {3334, {wxStyledTextCtrl, setYCaretPolicy, 2}},
- {3335, {wxStyledTextCtrl, getPrintWrapMode, 0}},
- {3336, {wxStyledTextCtrl, setHotspotActiveForeground, 2}},
- {3337, {wxStyledTextCtrl, setHotspotActiveBackground, 2}},
- {3338, {wxStyledTextCtrl, setHotspotActiveUnderline, 1}},
- {3339, {wxStyledTextCtrl, setHotspotSingleLine, 1}},
- {3340, {wxStyledTextCtrl, paraDownExtend, 0}},
- {3341, {wxStyledTextCtrl, paraUp, 0}},
- {3342, {wxStyledTextCtrl, paraUpExtend, 0}},
- {3343, {wxStyledTextCtrl, positionBefore, 1}},
- {3344, {wxStyledTextCtrl, positionAfter, 1}},
- {3345, {wxStyledTextCtrl, copyRange, 2}},
- {3346, {wxStyledTextCtrl, copyText, 2}},
- {3347, {wxStyledTextCtrl, setSelectionMode, 1}},
- {3348, {wxStyledTextCtrl, getSelectionMode, 0}},
- {3349, {wxStyledTextCtrl, lineDownRectExtend, 0}},
- {3350, {wxStyledTextCtrl, lineUpRectExtend, 0}},
- {3351, {wxStyledTextCtrl, charLeftRectExtend, 0}},
- {3352, {wxStyledTextCtrl, charRightRectExtend, 0}},
- {3353, {wxStyledTextCtrl, homeRectExtend, 0}},
- {3354, {wxStyledTextCtrl, vCHomeRectExtend, 0}},
- {3355, {wxStyledTextCtrl, lineEndRectExtend, 0}},
- {3356, {wxStyledTextCtrl, pageUpRectExtend, 0}},
- {3357, {wxStyledTextCtrl, pageDownRectExtend, 0}},
- {3358, {wxStyledTextCtrl, stutteredPageUp, 0}},
- {3359, {wxStyledTextCtrl, stutteredPageUpExtend, 0}},
- {3360, {wxStyledTextCtrl, stutteredPageDown, 0}},
- {3361, {wxStyledTextCtrl, stutteredPageDownExtend, 0}},
- {3362, {wxStyledTextCtrl, wordLeftEnd, 0}},
- {3363, {wxStyledTextCtrl, wordLeftEndExtend, 0}},
- {3364, {wxStyledTextCtrl, wordRightEnd, 0}},
- {3365, {wxStyledTextCtrl, wordRightEndExtend, 0}},
- {3366, {wxStyledTextCtrl, setWhitespaceChars, 1}},
- {3367, {wxStyledTextCtrl, setCharsDefault, 0}},
- {3368, {wxStyledTextCtrl, autoCompGetCurrent, 0}},
- {3369, {wxStyledTextCtrl, allocate, 1}},
- {3370, {wxStyledTextCtrl, findColumn, 2}},
- {3371, {wxStyledTextCtrl, getCaretSticky, 0}},
- {3372, {wxStyledTextCtrl, setCaretSticky, 1}},
- {3373, {wxStyledTextCtrl, toggleCaretSticky, 0}},
- {3374, {wxStyledTextCtrl, setPasteConvertEndings, 1}},
- {3375, {wxStyledTextCtrl, getPasteConvertEndings, 0}},
- {3376, {wxStyledTextCtrl, selectionDuplicate, 0}},
- {3377, {wxStyledTextCtrl, setCaretLineBackAlpha, 1}},
- {3378, {wxStyledTextCtrl, getCaretLineBackAlpha, 0}},
- {3379, {wxStyledTextCtrl, startRecord, 0}},
- {3380, {wxStyledTextCtrl, stopRecord, 0}},
- {3381, {wxStyledTextCtrl, setLexer, 1}},
- {3382, {wxStyledTextCtrl, getLexer, 0}},
- {3383, {wxStyledTextCtrl, colourise, 2}},
- {3384, {wxStyledTextCtrl, setProperty, 2}},
- {3385, {wxStyledTextCtrl, setKeyWords, 2}},
- {3386, {wxStyledTextCtrl, setLexerLanguage, 1}},
- {3387, {wxStyledTextCtrl, getProperty, 1}},
- {3388, {wxStyledTextCtrl, getStyleBitsNeeded, 0}},
- {3389, {wxStyledTextCtrl, getCurrentLine, 0}},
- {3390, {wxStyledTextCtrl, styleSetSpec, 2}},
- {3391, {wxStyledTextCtrl, styleSetFont, 2}},
- {3392, {wxStyledTextCtrl, styleSetFontAttr, 7}},
- {3393, {wxStyledTextCtrl, styleSetCharacterSet, 2}},
- {3394, {wxStyledTextCtrl, styleSetFontEncoding, 2}},
- {3395, {wxStyledTextCtrl, cmdKeyExecute, 1}},
- {3396, {wxStyledTextCtrl, setMargins, 2}},
- {3397, {wxStyledTextCtrl, getSelection, 2}},
- {3398, {wxStyledTextCtrl, pointFromPosition, 1}},
- {3399, {wxStyledTextCtrl, scrollToLine, 1}},
- {3400, {wxStyledTextCtrl, scrollToColumn, 1}},
- {3401, {wxStyledTextCtrl, setVScrollBar, 1}},
- {3402, {wxStyledTextCtrl, setHScrollBar, 1}},
- {3403, {wxStyledTextCtrl, getLastKeydownProcessed, 0}},
- {3404, {wxStyledTextCtrl, setLastKeydownProcessed, 1}},
- {3405, {wxStyledTextCtrl, saveFile, 1}},
- {3406, {wxStyledTextCtrl, loadFile, 1}},
- {3407, {wxStyledTextCtrl, doDragOver, 3}},
- {3408, {wxStyledTextCtrl, doDropText, 3}},
- {3409, {wxStyledTextCtrl, getUseAntiAliasing, 0}},
- {3410, {wxStyledTextCtrl, addTextRaw, 1}},
- {3411, {wxStyledTextCtrl, insertTextRaw, 2}},
- {3412, {wxStyledTextCtrl, getCurLineRaw, 1}},
- {3413, {wxStyledTextCtrl, getLineRaw, 1}},
- {3414, {wxStyledTextCtrl, getSelectedTextRaw, 0}},
- {3415, {wxStyledTextCtrl, getTextRangeRaw, 2}},
- {3416, {wxStyledTextCtrl, setTextRaw, 1}},
- {3417, {wxStyledTextCtrl, getTextRaw, 0}},
- {3418, {wxStyledTextCtrl, appendTextRaw, 1}},
- {3419, {wxArtProvider, getBitmap, 2}},
- {3420, {wxArtProvider, getIcon, 2}},
- {3421, {wxTreeEvent, getKeyCode, 0}},
- {3422, {wxTreeEvent, getItem, 0}},
- {3423, {wxTreeEvent, getKeyEvent, 0}},
- {3424, {wxTreeEvent, getLabel, 0}},
- {3425, {wxTreeEvent, getOldItem, 0}},
- {3426, {wxTreeEvent, getPoint, 0}},
- {3427, {wxTreeEvent, isEditCancelled, 0}},
- {3428, {wxTreeEvent, setToolTip, 1}},
- {3429, {wxNotebookEvent, getOldSelection, 0}},
- {3430, {wxNotebookEvent, getSelection, 0}},
- {3431, {wxNotebookEvent, setOldSelection, 1}},
- {3432, {wxNotebookEvent, setSelection, 1}},
- {3433, {wxFileDataObject, new, 0}},
- {3434, {wxFileDataObject, addFile, 1}},
- {3435, {wxFileDataObject, getFilenames, 0}},
- {3436, {wxFileDataObject, 'Destroy', undefined}},
- {3437, {wxTextDataObject, new, 1}},
- {3438, {wxTextDataObject, getTextLength, 0}},
- {3439, {wxTextDataObject, getText, 0}},
- {3440, {wxTextDataObject, setText, 1}},
- {3441, {wxTextDataObject, 'Destroy', undefined}},
- {3442, {wxBitmapDataObject, new_1_1, 1}},
- {3443, {wxBitmapDataObject, new_1_0, 1}},
- {3444, {wxBitmapDataObject, getBitmap, 0}},
- {3445, {wxBitmapDataObject, setBitmap, 1}},
- {3446, {wxBitmapDataObject, 'Destroy', undefined}},
- {3448, {wxClipboard, new, 0}},
- {3449, {wxClipboard, destruct, 0}},
- {3450, {wxClipboard, addData, 1}},
- {3451, {wxClipboard, clear, 0}},
- {3452, {wxClipboard, close, 0}},
- {3453, {wxClipboard, flush, 0}},
- {3454, {wxClipboard, getData, 1}},
- {3455, {wxClipboard, isOpened, 0}},
- {3456, {wxClipboard, open, 0}},
- {3457, {wxClipboard, setData, 1}},
- {3459, {wxClipboard, usePrimarySelection, 1}},
- {3460, {wxClipboard, isSupported, 1}},
- {3461, {wxClipboard, get, 0}},
- {3462, {wxSpinEvent, getPosition, 0}},
- {3463, {wxSpinEvent, setPosition, 1}},
- {3464, {wxSplitterWindow, new_0, 0}},
- {3465, {wxSplitterWindow, new_2, 2}},
- {3466, {wxSplitterWindow, destruct, 0}},
- {3467, {wxSplitterWindow, create, 2}},
- {3468, {wxSplitterWindow, getMinimumPaneSize, 0}},
- {3469, {wxSplitterWindow, getSashGravity, 0}},
- {3470, {wxSplitterWindow, getSashPosition, 0}},
- {3471, {wxSplitterWindow, getSplitMode, 0}},
- {3472, {wxSplitterWindow, getWindow1, 0}},
- {3473, {wxSplitterWindow, getWindow2, 0}},
- {3474, {wxSplitterWindow, initialize, 1}},
- {3475, {wxSplitterWindow, isSplit, 0}},
- {3476, {wxSplitterWindow, replaceWindow, 2}},
- {3477, {wxSplitterWindow, setSashGravity, 1}},
- {3478, {wxSplitterWindow, setSashPosition, 2}},
- {3479, {wxSplitterWindow, setSashSize, 1}},
- {3480, {wxSplitterWindow, setMinimumPaneSize, 1}},
- {3481, {wxSplitterWindow, setSplitMode, 1}},
- {3482, {wxSplitterWindow, splitHorizontally, 3}},
- {3483, {wxSplitterWindow, splitVertically, 3}},
- {3484, {wxSplitterWindow, unsplit, 1}},
- {3485, {wxSplitterWindow, updateSize, 0}},
- {3486, {wxSplitterEvent, getSashPosition, 0}},
- {3487, {wxSplitterEvent, getX, 0}},
- {3488, {wxSplitterEvent, getY, 0}},
- {3489, {wxSplitterEvent, getWindowBeingRemoved, 0}},
- {3490, {wxSplitterEvent, setSashPosition, 1}},
- {3491, {wxHtmlWindow, new_0, 0}},
- {3492, {wxHtmlWindow, new_2, 2}},
- {3493, {wxHtmlWindow, appendToPage, 1}},
- {3494, {wxHtmlWindow, getOpenedAnchor, 0}},
- {3495, {wxHtmlWindow, getOpenedPage, 0}},
- {3496, {wxHtmlWindow, getOpenedPageTitle, 0}},
- {3497, {wxHtmlWindow, getRelatedFrame, 0}},
- {3498, {wxHtmlWindow, historyBack, 0}},
- {3499, {wxHtmlWindow, historyCanBack, 0}},
- {3500, {wxHtmlWindow, historyCanForward, 0}},
- {3501, {wxHtmlWindow, historyClear, 0}},
- {3502, {wxHtmlWindow, historyForward, 0}},
- {3503, {wxHtmlWindow, loadFile, 1}},
- {3504, {wxHtmlWindow, loadPage, 1}},
- {3505, {wxHtmlWindow, selectAll, 0}},
- {3506, {wxHtmlWindow, selectionToText, 0}},
- {3507, {wxHtmlWindow, selectLine, 1}},
- {3508, {wxHtmlWindow, selectWord, 1}},
- {3509, {wxHtmlWindow, setBorders, 1}},
- {3510, {wxHtmlWindow, setFonts, 3}},
- {3511, {wxHtmlWindow, setPage, 1}},
- {3512, {wxHtmlWindow, setRelatedFrame, 2}},
- {3513, {wxHtmlWindow, setRelatedStatusBar, 1}},
- {3514, {wxHtmlWindow, toText, 0}},
- {3515, {wxHtmlWindow, 'Destroy', undefined}},
- {3516, {wxHtmlLinkEvent, getLinkInfo, 0}},
- {3517, {wxSystemSettings, getColour, 1}},
- {3518, {wxSystemSettings, getFont, 1}},
- {3519, {wxSystemSettings, getMetric, 2}},
- {3520, {wxSystemSettings, getScreenType, 0}},
- {3521, {wxSystemOptions, getOption, 1}},
- {3522, {wxSystemOptions, getOptionInt, 1}},
- {3523, {wxSystemOptions, hasOption, 1}},
- {3524, {wxSystemOptions, isFalse, 1}},
- {3525, {wxSystemOptions, setOption_2_1, 2}},
- {3526, {wxSystemOptions, setOption_2_0, 2}},
- {3527, {wxAuiNotebookEvent, setSelection, 1}},
- {3528, {wxAuiNotebookEvent, getSelection, 0}},
- {3529, {wxAuiNotebookEvent, setOldSelection, 1}},
- {3530, {wxAuiNotebookEvent, getOldSelection, 0}},
- {3531, {wxAuiNotebookEvent, setDragSource, 1}},
- {3532, {wxAuiNotebookEvent, getDragSource, 0}},
- {3533, {wxAuiManagerEvent, setManager, 1}},
- {3534, {wxAuiManagerEvent, getManager, 0}},
- {3535, {wxAuiManagerEvent, setPane, 1}},
- {3536, {wxAuiManagerEvent, getPane, 0}},
- {3537, {wxAuiManagerEvent, setButton, 1}},
- {3538, {wxAuiManagerEvent, getButton, 0}},
- {3539, {wxAuiManagerEvent, setDC, 1}},
- {3540, {wxAuiManagerEvent, getDC, 0}},
- {3541, {wxAuiManagerEvent, veto, 1}},
- {3542, {wxAuiManagerEvent, getVeto, 0}},
- {3543, {wxAuiManagerEvent, setCanVeto, 1}},
- {3544, {wxAuiManagerEvent, canVeto, 0}},
- {3545, {wxLogNull, new, 0}},
- {3546, {wxLogNull, 'Destroy', undefined}},
- {3547, {wxTaskBarIcon, new, 0}},
- {3548, {wxTaskBarIcon, destruct, 0}},
- {3549, {wxTaskBarIcon, popupMenu, 1}},
- {3550, {wxTaskBarIcon, removeIcon, 0}},
- {3551, {wxTaskBarIcon, setIcon, 2}},
- {3552, {wxLocale, new_0, 0}},
- {3554, {wxLocale, new_2, 2}},
- {3555, {wxLocale, destruct, 0}},
- {3557, {wxLocale, init, 1}},
- {3558, {wxLocale, addCatalog_1, 1}},
- {3559, {wxLocale, addCatalog_3, 3}},
- {3560, {wxLocale, addCatalogLookupPathPrefix, 1}},
- {3561, {wxLocale, getCanonicalName, 0}},
- {3562, {wxLocale, getLanguage, 0}},
- {3563, {wxLocale, getLanguageName, 1}},
- {3564, {wxLocale, getLocale, 0}},
- {3565, {wxLocale, getName, 0}},
- {3566, {wxLocale, getString_2, 2}},
- {3567, {wxLocale, getString_4, 4}},
- {3568, {wxLocale, getHeaderValue, 2}},
- {3569, {wxLocale, getSysName, 0}},
- {3570, {wxLocale, getSystemEncoding, 0}},
- {3571, {wxLocale, getSystemEncodingName, 0}},
- {3572, {wxLocale, getSystemLanguage, 0}},
- {3573, {wxLocale, isLoaded, 1}},
- {3574, {wxLocale, isOk, 0}},
- {3575, {wxActivateEvent, getActive, 0}},
- {3577, {wxPopupWindow, new_2, 2}},
- {3578, {wxPopupWindow, new_0, 0}},
- {3580, {wxPopupWindow, destruct, 0}},
- {3581, {wxPopupWindow, create, 2}},
- {3582, {wxPopupWindow, position, 2}},
- {3583, {wxPopupTransientWindow, new_0, 0}},
- {3584, {wxPopupTransientWindow, new_2, 2}},
- {3585, {wxPopupTransientWindow, destruct, 0}},
- {3586, {wxPopupTransientWindow, popup, 1}},
- {3587, {wxPopupTransientWindow, dismiss, 0}},
- {3588, {wxOverlay, new, 0}},
- {3589, {wxOverlay, destruct, 0}},
- {3590, {wxOverlay, reset, 0}},
- {3591, {wxDCOverlay, new_6, 6}},
- {3592, {wxDCOverlay, new_2, 2}},
- {3593, {wxDCOverlay, destruct, 0}},
- {3594, {wxDCOverlay, clear, 0}},
+ {284, {wxWindow, setTransparent, 1}},
+ {285, {wxWindow, canSetTransparent, 0}},
+ {286, {wxWindow, isDoubleBuffered, 0}},
+ {287, {wxWindow, setDoubleBuffered, 1}},
+ {288, {wxTopLevelWindow, getIcon, 0}},
+ {289, {wxTopLevelWindow, getIcons, 0}},
+ {290, {wxTopLevelWindow, getTitle, 0}},
+ {291, {wxTopLevelWindow, isActive, 0}},
+ {292, {wxTopLevelWindow, iconize, 1}},
+ {293, {wxTopLevelWindow, isFullScreen, 0}},
+ {294, {wxTopLevelWindow, isIconized, 0}},
+ {295, {wxTopLevelWindow, isMaximized, 0}},
+ {296, {wxTopLevelWindow, maximize, 1}},
+ {297, {wxTopLevelWindow, requestUserAttention, 1}},
+ {298, {wxTopLevelWindow, setIcon, 1}},
+ {299, {wxTopLevelWindow, setIcons, 1}},
+ {300, {wxTopLevelWindow, centerOnScreen, 1}},
+ {301, {wxTopLevelWindow, centreOnScreen, 1}},
+ {303, {wxTopLevelWindow, setShape, 1}},
+ {304, {wxTopLevelWindow, setTitle, 1}},
+ {305, {wxTopLevelWindow, showFullScreen, 2}},
+ {307, {wxFrame, new_4, 4}},
+ {308, {wxFrame, new_0, 0}},
+ {310, {wxFrame, destruct, 0}},
+ {311, {wxFrame, create, 4}},
+ {312, {wxFrame, createStatusBar, 1}},
+ {313, {wxFrame, createToolBar, 1}},
+ {314, {wxFrame, getClientAreaOrigin, 0}},
+ {315, {wxFrame, getMenuBar, 0}},
+ {316, {wxFrame, getStatusBar, 0}},
+ {317, {wxFrame, getStatusBarPane, 0}},
+ {318, {wxFrame, getToolBar, 0}},
+ {319, {wxFrame, processCommand, 1}},
+ {320, {wxFrame, sendSizeEvent, 0}},
+ {321, {wxFrame, setMenuBar, 1}},
+ {322, {wxFrame, setStatusBar, 1}},
+ {323, {wxFrame, setStatusBarPane, 1}},
+ {324, {wxFrame, setStatusText, 2}},
+ {325, {wxFrame, setStatusWidths, 2}},
+ {326, {wxFrame, setToolBar, 1}},
+ {327, {wxMiniFrame, new_0, 0}},
+ {328, {wxMiniFrame, new_4, 4}},
+ {329, {wxMiniFrame, create, 4}},
+ {330, {wxMiniFrame, 'Destroy', undefined}},
+ {331, {wxSplashScreen, new_0, 0}},
+ {332, {wxSplashScreen, new_6, 6}},
+ {333, {wxSplashScreen, destruct, 0}},
+ {334, {wxSplashScreen, getSplashStyle, 0}},
+ {335, {wxSplashScreen, getTimeout, 0}},
+ {336, {wxPanel, new_0, 0}},
+ {337, {wxPanel, new_6, 6}},
+ {338, {wxPanel, new_2, 2}},
+ {339, {wxPanel, destruct, 0}},
+ {340, {wxPanel, initDialog, 0}},
+ {341, {wxPanel, setFocusIgnoringChildren, 0}},
+ {342, {wxScrolledWindow, new_0, 0}},
+ {343, {wxScrolledWindow, new_2, 2}},
+ {344, {wxScrolledWindow, destruct, 0}},
+ {345, {wxScrolledWindow, calcScrolledPosition_4, 4}},
+ {346, {wxScrolledWindow, calcScrolledPosition_1, 1}},
+ {347, {wxScrolledWindow, calcUnscrolledPosition_4, 4}},
+ {348, {wxScrolledWindow, calcUnscrolledPosition_1, 1}},
+ {349, {wxScrolledWindow, enableScrolling, 2}},
+ {350, {wxScrolledWindow, getScrollPixelsPerUnit, 2}},
+ {351, {wxScrolledWindow, getViewStart, 2}},
+ {352, {wxScrolledWindow, doPrepareDC, 1}},
+ {353, {wxScrolledWindow, prepareDC, 1}},
+ {354, {wxScrolledWindow, scroll, 2}},
+ {355, {wxScrolledWindow, setScrollbars, 5}},
+ {356, {wxScrolledWindow, setScrollRate, 2}},
+ {357, {wxScrolledWindow, setTargetWindow, 1}},
+ {358, {wxSashWindow, new_0, 0}},
+ {359, {wxSashWindow, new_2, 2}},
+ {360, {wxSashWindow, destruct, 0}},
+ {361, {wxSashWindow, getSashVisible, 1}},
+ {362, {wxSashWindow, getMaximumSizeX, 0}},
+ {363, {wxSashWindow, getMaximumSizeY, 0}},
+ {364, {wxSashWindow, getMinimumSizeX, 0}},
+ {365, {wxSashWindow, getMinimumSizeY, 0}},
+ {366, {wxSashWindow, setMaximumSizeX, 1}},
+ {367, {wxSashWindow, setMaximumSizeY, 1}},
+ {368, {wxSashWindow, setMinimumSizeX, 1}},
+ {369, {wxSashWindow, setMinimumSizeY, 1}},
+ {370, {wxSashWindow, setSashVisible, 2}},
+ {371, {wxSashLayoutWindow, new_0, 0}},
+ {372, {wxSashLayoutWindow, new_2, 2}},
+ {373, {wxSashLayoutWindow, create, 2}},
+ {374, {wxSashLayoutWindow, getAlignment, 0}},
+ {375, {wxSashLayoutWindow, getOrientation, 0}},
+ {376, {wxSashLayoutWindow, setAlignment, 1}},
+ {377, {wxSashLayoutWindow, setDefaultSize, 1}},
+ {378, {wxSashLayoutWindow, setOrientation, 1}},
+ {379, {wxSashLayoutWindow, 'Destroy', undefined}},
+ {380, {wxGrid, new_0, 0}},
+ {381, {wxGrid, new_3, 3}},
+ {382, {wxGrid, new_4, 4}},
+ {383, {wxGrid, destruct, 0}},
+ {384, {wxGrid, appendCols, 1}},
+ {385, {wxGrid, appendRows, 1}},
+ {386, {wxGrid, autoSize, 0}},
+ {387, {wxGrid, autoSizeColumn, 2}},
+ {388, {wxGrid, autoSizeColumns, 1}},
+ {389, {wxGrid, autoSizeRow, 2}},
+ {390, {wxGrid, autoSizeRows, 1}},
+ {391, {wxGrid, beginBatch, 0}},
+ {392, {wxGrid, blockToDeviceRect, 2}},
+ {393, {wxGrid, canDragColSize, 0}},
+ {394, {wxGrid, canDragRowSize, 0}},
+ {395, {wxGrid, canDragGridSize, 0}},
+ {396, {wxGrid, canEnableCellControl, 0}},
+ {397, {wxGrid, cellToRect_2, 2}},
+ {398, {wxGrid, cellToRect_1, 1}},
+ {399, {wxGrid, clearGrid, 0}},
+ {400, {wxGrid, clearSelection, 0}},
+ {401, {wxGrid, createGrid, 3}},
+ {402, {wxGrid, deleteCols, 1}},
+ {403, {wxGrid, deleteRows, 1}},
+ {404, {wxGrid, disableCellEditControl, 0}},
+ {405, {wxGrid, disableDragColSize, 0}},
+ {406, {wxGrid, disableDragGridSize, 0}},
+ {407, {wxGrid, disableDragRowSize, 0}},
+ {408, {wxGrid, enableCellEditControl, 1}},
+ {409, {wxGrid, enableDragColSize, 1}},
+ {410, {wxGrid, enableDragGridSize, 1}},
+ {411, {wxGrid, enableDragRowSize, 1}},
+ {412, {wxGrid, enableEditing, 1}},
+ {413, {wxGrid, enableGridLines, 1}},
+ {414, {wxGrid, endBatch, 0}},
+ {415, {wxGrid, fit, 0}},
+ {416, {wxGrid, forceRefresh, 0}},
+ {417, {wxGrid, getBatchCount, 0}},
+ {418, {wxGrid, getCellAlignment, 4}},
+ {419, {wxGrid, getCellBackgroundColour, 2}},
+ {420, {wxGrid, getCellEditor, 2}},
+ {421, {wxGrid, getCellFont, 2}},
+ {422, {wxGrid, getCellRenderer, 2}},
+ {423, {wxGrid, getCellTextColour, 2}},
+ {424, {wxGrid, getCellValue_2, 2}},
+ {425, {wxGrid, getCellValue_1, 1}},
+ {426, {wxGrid, getColLabelAlignment, 2}},
+ {427, {wxGrid, getColLabelSize, 0}},
+ {428, {wxGrid, getColLabelValue, 1}},
+ {429, {wxGrid, getColMinimalAcceptableWidth, 0}},
+ {430, {wxGrid, getDefaultCellAlignment, 2}},
+ {431, {wxGrid, getDefaultCellBackgroundColour, 0}},
+ {432, {wxGrid, getDefaultCellFont, 0}},
+ {433, {wxGrid, getDefaultCellTextColour, 0}},
+ {434, {wxGrid, getDefaultColLabelSize, 0}},
+ {435, {wxGrid, getDefaultColSize, 0}},
+ {436, {wxGrid, getDefaultEditor, 0}},
+ {437, {wxGrid, getDefaultEditorForCell_2, 2}},
+ {438, {wxGrid, getDefaultEditorForCell_1, 1}},
+ {439, {wxGrid, getDefaultEditorForType, 1}},
+ {440, {wxGrid, getDefaultRenderer, 0}},
+ {441, {wxGrid, getDefaultRendererForCell, 2}},
+ {442, {wxGrid, getDefaultRendererForType, 1}},
+ {443, {wxGrid, getDefaultRowLabelSize, 0}},
+ {444, {wxGrid, getDefaultRowSize, 0}},
+ {445, {wxGrid, getGridCursorCol, 0}},
+ {446, {wxGrid, getGridCursorRow, 0}},
+ {447, {wxGrid, getGridLineColour, 0}},
+ {448, {wxGrid, gridLinesEnabled, 0}},
+ {449, {wxGrid, getLabelBackgroundColour, 0}},
+ {450, {wxGrid, getLabelFont, 0}},
+ {451, {wxGrid, getLabelTextColour, 0}},
+ {452, {wxGrid, getNumberCols, 0}},
+ {453, {wxGrid, getNumberRows, 0}},
+ {454, {wxGrid, getOrCreateCellAttr, 2}},
+ {455, {wxGrid, getRowMinimalAcceptableHeight, 0}},
+ {456, {wxGrid, getRowLabelAlignment, 2}},
+ {457, {wxGrid, getRowLabelSize, 0}},
+ {458, {wxGrid, getRowLabelValue, 1}},
+ {459, {wxGrid, getRowSize, 1}},
+ {460, {wxGrid, getScrollLineX, 0}},
+ {461, {wxGrid, getScrollLineY, 0}},
+ {462, {wxGrid, getSelectedCells, 0}},
+ {463, {wxGrid, getSelectedCols, 0}},
+ {464, {wxGrid, getSelectedRows, 0}},
+ {465, {wxGrid, getSelectionBackground, 0}},
+ {466, {wxGrid, getSelectionBlockTopLeft, 0}},
+ {467, {wxGrid, getSelectionBlockBottomRight, 0}},
+ {468, {wxGrid, getSelectionForeground, 0}},
+ {469, {wxGrid, getViewWidth, 0}},
+ {470, {wxGrid, getGridWindow, 0}},
+ {471, {wxGrid, getGridRowLabelWindow, 0}},
+ {472, {wxGrid, getGridColLabelWindow, 0}},
+ {473, {wxGrid, getGridCornerLabelWindow, 0}},
+ {474, {wxGrid, hideCellEditControl, 0}},
+ {475, {wxGrid, insertCols, 1}},
+ {476, {wxGrid, insertRows, 1}},
+ {477, {wxGrid, isCellEditControlEnabled, 0}},
+ {478, {wxGrid, isCurrentCellReadOnly, 0}},
+ {479, {wxGrid, isEditable, 0}},
+ {480, {wxGrid, isInSelection_2, 2}},
+ {481, {wxGrid, isInSelection_1, 1}},
+ {482, {wxGrid, isReadOnly, 2}},
+ {483, {wxGrid, isSelection, 0}},
+ {484, {wxGrid, isVisible_3, 3}},
+ {485, {wxGrid, isVisible_2, 2}},
+ {486, {wxGrid, makeCellVisible_2, 2}},
+ {487, {wxGrid, makeCellVisible_1, 1}},
+ {488, {wxGrid, moveCursorDown, 1}},
+ {489, {wxGrid, moveCursorLeft, 1}},
+ {490, {wxGrid, moveCursorRight, 1}},
+ {491, {wxGrid, moveCursorUp, 1}},
+ {492, {wxGrid, moveCursorDownBlock, 1}},
+ {493, {wxGrid, moveCursorLeftBlock, 1}},
+ {494, {wxGrid, moveCursorRightBlock, 1}},
+ {495, {wxGrid, moveCursorUpBlock, 1}},
+ {496, {wxGrid, movePageDown, 0}},
+ {497, {wxGrid, movePageUp, 0}},
+ {498, {wxGrid, registerDataType, 3}},
+ {499, {wxGrid, saveEditControlValue, 0}},
+ {500, {wxGrid, selectAll, 0}},
+ {501, {wxGrid, selectBlock_5, 5}},
+ {502, {wxGrid, selectBlock_3, 3}},
+ {503, {wxGrid, selectCol, 2}},
+ {504, {wxGrid, selectRow, 2}},
+ {505, {wxGrid, setCellAlignment_4, 4}},
+ {506, {wxGrid, setCellAlignment_3, 3}},
+ {507, {wxGrid, setCellAlignment_1, 1}},
+ {508, {wxGrid, setCellBackgroundColour_3_0, 3}},
+ {509, {wxGrid, setCellBackgroundColour_1, 1}},
+ {510, {wxGrid, setCellBackgroundColour_3_1, 3}},
+ {511, {wxGrid, setCellEditor, 3}},
+ {512, {wxGrid, setCellFont, 3}},
+ {513, {wxGrid, setCellRenderer, 3}},
+ {514, {wxGrid, setCellTextColour_3_0, 3}},
+ {515, {wxGrid, setCellTextColour_3_1, 3}},
+ {516, {wxGrid, setCellTextColour_1, 1}},
+ {517, {wxGrid, setCellValue_3_0, 3}},
+ {518, {wxGrid, setCellValue_2, 2}},
+ {519, {wxGrid, setCellValue_3_1, 3}},
+ {520, {wxGrid, setColAttr, 2}},
+ {521, {wxGrid, setColFormatBool, 1}},
+ {522, {wxGrid, setColFormatNumber, 1}},
+ {523, {wxGrid, setColFormatFloat, 2}},
+ {524, {wxGrid, setColFormatCustom, 2}},
+ {525, {wxGrid, setColLabelAlignment, 2}},
+ {526, {wxGrid, setColLabelSize, 1}},
+ {527, {wxGrid, setColLabelValue, 2}},
+ {528, {wxGrid, setColMinimalWidth, 2}},
+ {529, {wxGrid, setColMinimalAcceptableWidth, 1}},
+ {530, {wxGrid, setColSize, 2}},
+ {531, {wxGrid, setDefaultCellAlignment, 2}},
+ {532, {wxGrid, setDefaultCellBackgroundColour, 1}},
+ {533, {wxGrid, setDefaultCellFont, 1}},
+ {534, {wxGrid, setDefaultCellTextColour, 1}},
+ {535, {wxGrid, setDefaultEditor, 1}},
+ {536, {wxGrid, setDefaultRenderer, 1}},
+ {537, {wxGrid, setDefaultColSize, 2}},
+ {538, {wxGrid, setDefaultRowSize, 2}},
+ {539, {wxGrid, setGridCursor, 2}},
+ {540, {wxGrid, setGridLineColour, 1}},
+ {541, {wxGrid, setLabelBackgroundColour, 1}},
+ {542, {wxGrid, setLabelFont, 1}},
+ {543, {wxGrid, setLabelTextColour, 1}},
+ {544, {wxGrid, setMargins, 2}},
+ {545, {wxGrid, setReadOnly, 3}},
+ {546, {wxGrid, setRowAttr, 2}},
+ {547, {wxGrid, setRowLabelAlignment, 2}},
+ {548, {wxGrid, setRowLabelSize, 1}},
+ {549, {wxGrid, setRowLabelValue, 2}},
+ {550, {wxGrid, setRowMinimalHeight, 2}},
+ {551, {wxGrid, setRowMinimalAcceptableHeight, 1}},
+ {552, {wxGrid, setRowSize, 2}},
+ {553, {wxGrid, setScrollLineX, 1}},
+ {554, {wxGrid, setScrollLineY, 1}},
+ {555, {wxGrid, setSelectionBackground, 1}},
+ {556, {wxGrid, setSelectionForeground, 1}},
+ {557, {wxGrid, setSelectionMode, 1}},
+ {558, {wxGrid, showCellEditControl, 0}},
+ {559, {wxGrid, xToCol, 2}},
+ {560, {wxGrid, xToEdgeOfCol, 1}},
+ {561, {wxGrid, yToEdgeOfRow, 1}},
+ {562, {wxGrid, yToRow, 1}},
+ {563, {wxGridCellRenderer, draw, 7}},
+ {564, {wxGridCellRenderer, getBestSize, 5}},
+ {565, {wxGridCellEditor, create, 3}},
+ {566, {wxGridCellEditor, isCreated, 0}},
+ {567, {wxGridCellEditor, setSize, 1}},
+ {568, {wxGridCellEditor, show, 2}},
+ {569, {wxGridCellEditor, paintBackground, 2}},
+ {570, {wxGridCellEditor, beginEdit, 3}},
+ {571, {wxGridCellEditor, endEdit, 3}},
+ {572, {wxGridCellEditor, reset, 0}},
+ {573, {wxGridCellEditor, startingKey, 1}},
+ {574, {wxGridCellEditor, startingClick, 0}},
+ {575, {wxGridCellEditor, handleReturn, 1}},
+ {576, {wxGridCellBoolRenderer, new, 0}},
+ {577, {wxGridCellBoolRenderer, 'Destroy', undefined}},
+ {578, {wxGridCellBoolEditor, new, 0}},
+ {579, {wxGridCellBoolEditor, isTrueValue, 1}},
+ {580, {wxGridCellBoolEditor, useStringValues, 1}},
+ {581, {wxGridCellBoolEditor, 'Destroy', undefined}},
+ {582, {wxGridCellFloatRenderer, new, 1}},
+ {583, {wxGridCellFloatRenderer, getPrecision, 0}},
+ {584, {wxGridCellFloatRenderer, getWidth, 0}},
+ {585, {wxGridCellFloatRenderer, setParameters, 1}},
+ {586, {wxGridCellFloatRenderer, setPrecision, 1}},
+ {587, {wxGridCellFloatRenderer, setWidth, 1}},
+ {588, {wxGridCellFloatRenderer, 'Destroy', undefined}},
+ {589, {wxGridCellFloatEditor, new, 1}},
+ {590, {wxGridCellFloatEditor, setParameters, 1}},
+ {591, {wxGridCellFloatEditor, 'Destroy', undefined}},
+ {592, {wxGridCellStringRenderer, new, 0}},
+ {593, {wxGridCellStringRenderer, 'Destroy', undefined}},
+ {594, {wxGridCellTextEditor, new, 0}},
+ {595, {wxGridCellTextEditor, setParameters, 1}},
+ {596, {wxGridCellTextEditor, 'Destroy', undefined}},
+ {598, {wxGridCellChoiceEditor, new, 2}},
+ {599, {wxGridCellChoiceEditor, setParameters, 1}},
+ {600, {wxGridCellChoiceEditor, 'Destroy', undefined}},
+ {601, {wxGridCellNumberRenderer, new, 0}},
+ {602, {wxGridCellNumberRenderer, 'Destroy', undefined}},
+ {603, {wxGridCellNumberEditor, new, 1}},
+ {604, {wxGridCellNumberEditor, getValue, 0}},
+ {605, {wxGridCellNumberEditor, setParameters, 1}},
+ {606, {wxGridCellNumberEditor, 'Destroy', undefined}},
+ {607, {wxGridCellAttr, setTextColour, 1}},
+ {608, {wxGridCellAttr, setBackgroundColour, 1}},
+ {609, {wxGridCellAttr, setFont, 1}},
+ {610, {wxGridCellAttr, setAlignment, 2}},
+ {611, {wxGridCellAttr, setReadOnly, 1}},
+ {612, {wxGridCellAttr, setRenderer, 1}},
+ {613, {wxGridCellAttr, setEditor, 1}},
+ {614, {wxGridCellAttr, hasTextColour, 0}},
+ {615, {wxGridCellAttr, hasBackgroundColour, 0}},
+ {616, {wxGridCellAttr, hasFont, 0}},
+ {617, {wxGridCellAttr, hasAlignment, 0}},
+ {618, {wxGridCellAttr, hasRenderer, 0}},
+ {619, {wxGridCellAttr, hasEditor, 0}},
+ {620, {wxGridCellAttr, getTextColour, 0}},
+ {621, {wxGridCellAttr, getBackgroundColour, 0}},
+ {622, {wxGridCellAttr, getFont, 0}},
+ {623, {wxGridCellAttr, getAlignment, 2}},
+ {624, {wxGridCellAttr, getRenderer, 3}},
+ {625, {wxGridCellAttr, getEditor, 3}},
+ {626, {wxGridCellAttr, isReadOnly, 0}},
+ {627, {wxGridCellAttr, setDefAttr, 1}},
+ {628, {wxDC, blit, 5}},
+ {629, {wxDC, calcBoundingBox, 2}},
+ {630, {wxDC, clear, 0}},
+ {631, {wxDC, computeScaleAndOrigin, 0}},
+ {632, {wxDC, crossHair, 1}},
+ {633, {wxDC, destroyClippingRegion, 0}},
+ {634, {wxDC, deviceToLogicalX, 1}},
+ {635, {wxDC, deviceToLogicalXRel, 1}},
+ {636, {wxDC, deviceToLogicalY, 1}},
+ {637, {wxDC, deviceToLogicalYRel, 1}},
+ {638, {wxDC, drawArc, 3}},
+ {639, {wxDC, drawBitmap, 3}},
+ {640, {wxDC, drawCheckMark, 1}},
+ {641, {wxDC, drawCircle, 2}},
+ {643, {wxDC, drawEllipse_2, 2}},
+ {644, {wxDC, drawEllipse_1, 1}},
+ {645, {wxDC, drawEllipticArc, 4}},
+ {646, {wxDC, drawIcon, 2}},
+ {647, {wxDC, drawLabel, 3}},
+ {648, {wxDC, drawLine, 2}},
+ {649, {wxDC, drawLines, 3}},
+ {651, {wxDC, drawPolygon, 3}},
+ {653, {wxDC, drawPoint, 1}},
+ {655, {wxDC, drawRectangle_2, 2}},
+ {656, {wxDC, drawRectangle_1, 1}},
+ {657, {wxDC, drawRotatedText, 3}},
+ {659, {wxDC, drawRoundedRectangle_3, 3}},
+ {660, {wxDC, drawRoundedRectangle_2, 2}},
+ {661, {wxDC, drawText, 2}},
+ {662, {wxDC, endDoc, 0}},
+ {663, {wxDC, endPage, 0}},
+ {664, {wxDC, floodFill, 3}},
+ {665, {wxDC, getBackground, 0}},
+ {666, {wxDC, getBackgroundMode, 0}},
+ {667, {wxDC, getBrush, 0}},
+ {668, {wxDC, getCharHeight, 0}},
+ {669, {wxDC, getCharWidth, 0}},
+ {670, {wxDC, getClippingBox, 4}},
+ {672, {wxDC, getFont, 0}},
+ {673, {wxDC, getLayoutDirection, 0}},
+ {674, {wxDC, getLogicalFunction, 0}},
+ {675, {wxDC, getMapMode, 0}},
+ {676, {wxDC, getMultiLineTextExtent_4, 4}},
+ {677, {wxDC, getMultiLineTextExtent_1, 1}},
+ {678, {wxDC, getPartialTextExtents, 2}},
+ {679, {wxDC, getPen, 0}},
+ {680, {wxDC, getPixel, 2}},
+ {681, {wxDC, getPPI, 0}},
+ {683, {wxDC, getSize, 0}},
+ {685, {wxDC, getSizeMM, 0}},
+ {686, {wxDC, getTextBackground, 0}},
+ {687, {wxDC, getTextExtent_4, 4}},
+ {688, {wxDC, getTextExtent_1, 1}},
+ {690, {wxDC, getTextForeground, 0}},
+ {691, {wxDC, getUserScale, 2}},
+ {692, {wxDC, gradientFillConcentric_3, 3}},
+ {693, {wxDC, gradientFillConcentric_4, 4}},
+ {694, {wxDC, gradientFillLinear, 4}},
+ {695, {wxDC, logicalToDeviceX, 1}},
+ {696, {wxDC, logicalToDeviceXRel, 1}},
+ {697, {wxDC, logicalToDeviceY, 1}},
+ {698, {wxDC, logicalToDeviceYRel, 1}},
+ {699, {wxDC, maxX, 0}},
+ {700, {wxDC, maxY, 0}},
+ {701, {wxDC, minX, 0}},
+ {702, {wxDC, minY, 0}},
+ {703, {wxDC, isOk, 0}},
+ {704, {wxDC, resetBoundingBox, 0}},
+ {705, {wxDC, setAxisOrientation, 2}},
+ {706, {wxDC, setBackground, 1}},
+ {707, {wxDC, setBackgroundMode, 1}},
+ {708, {wxDC, setBrush, 1}},
+ {710, {wxDC, setClippingRegion_2, 2}},
+ {711, {wxDC, setClippingRegion_1_1, 1}},
+ {712, {wxDC, setClippingRegion_1_0, 1}},
+ {713, {wxDC, setDeviceOrigin, 2}},
+ {714, {wxDC, setFont, 1}},
+ {715, {wxDC, setLayoutDirection, 1}},
+ {716, {wxDC, setLogicalFunction, 1}},
+ {717, {wxDC, setMapMode, 1}},
+ {718, {wxDC, setPalette, 1}},
+ {719, {wxDC, setPen, 1}},
+ {720, {wxDC, setTextBackground, 1}},
+ {721, {wxDC, setTextForeground, 1}},
+ {722, {wxDC, setUserScale, 2}},
+ {723, {wxDC, startDoc, 1}},
+ {724, {wxDC, startPage, 0}},
+ {725, {wxMirrorDC, new, 2}},
+ {726, {wxMirrorDC, 'Destroy', undefined}},
+ {727, {wxScreenDC, new, 0}},
+ {728, {wxScreenDC, destruct, 0}},
+ {729, {wxPostScriptDC, new_0, 0}},
+ {730, {wxPostScriptDC, new_1, 1}},
+ {731, {wxPostScriptDC, destruct, 0}},
+ {732, {wxPostScriptDC, setResolution, 1}},
+ {733, {wxPostScriptDC, getResolution, 0}},
+ {734, {wxWindowDC, new_0, 0}},
+ {735, {wxWindowDC, new_1, 1}},
+ {736, {wxWindowDC, destruct, 0}},
+ {737, {wxClientDC, new_0, 0}},
+ {738, {wxClientDC, new_1, 1}},
+ {739, {wxClientDC, 'Destroy', undefined}},
+ {740, {wxPaintDC, new_0, 0}},
+ {741, {wxPaintDC, new_1, 1}},
+ {742, {wxPaintDC, 'Destroy', undefined}},
+ {744, {wxMemoryDC, new_1_0, 1}},
+ {745, {wxMemoryDC, new_1_1, 1}},
+ {746, {wxMemoryDC, new_0, 0}},
+ {748, {wxMemoryDC, destruct, 0}},
+ {749, {wxMemoryDC, selectObject, 1}},
+ {750, {wxMemoryDC, selectObjectAsSource, 1}},
+ {751, {wxBufferedDC, new_0, 0}},
+ {752, {wxBufferedDC, new_2, 2}},
+ {753, {wxBufferedDC, new_3, 3}},
+ {754, {wxBufferedDC, destruct, 0}},
+ {755, {wxBufferedDC, init_2, 2}},
+ {756, {wxBufferedDC, init_3, 3}},
+ {757, {wxBufferedPaintDC, new_3, 3}},
+ {758, {wxBufferedPaintDC, new_2, 2}},
+ {759, {wxBufferedPaintDC, destruct, 0}},
+ {760, {wxGraphicsObject, destruct, 0}},
+ {761, {wxGraphicsObject, getRenderer, 0}},
+ {762, {wxGraphicsObject, isNull, 0}},
+ {763, {wxGraphicsContext, destruct, 0}},
+ {764, {wxGraphicsContext, create_1_1, 1}},
+ {765, {wxGraphicsContext, create_1_0, 1}},
+ {766, {wxGraphicsContext, create_0, 0}},
+ {767, {wxGraphicsContext, createPen, 1}},
+ {768, {wxGraphicsContext, createBrush, 1}},
+ {769, {wxGraphicsContext, createRadialGradientBrush, 7}},
+ {770, {wxGraphicsContext, createLinearGradientBrush, 6}},
+ {771, {wxGraphicsContext, createFont, 2}},
+ {772, {wxGraphicsContext, createMatrix, 1}},
+ {773, {wxGraphicsContext, createPath, 0}},
+ {774, {wxGraphicsContext, clip_1, 1}},
+ {775, {wxGraphicsContext, clip_4, 4}},
+ {776, {wxGraphicsContext, resetClip, 0}},
+ {777, {wxGraphicsContext, drawBitmap, 5}},
+ {778, {wxGraphicsContext, drawEllipse, 4}},
+ {779, {wxGraphicsContext, drawIcon, 5}},
+ {780, {wxGraphicsContext, drawLines, 3}},
+ {781, {wxGraphicsContext, drawPath, 2}},
+ {782, {wxGraphicsContext, drawRectangle, 4}},
+ {783, {wxGraphicsContext, drawRoundedRectangle, 5}},
+ {784, {wxGraphicsContext, drawText_3, 3}},
+ {785, {wxGraphicsContext, drawText_4_0, 4}},
+ {786, {wxGraphicsContext, drawText_4_1, 4}},
+ {787, {wxGraphicsContext, drawText_5, 5}},
+ {788, {wxGraphicsContext, fillPath, 2}},
+ {789, {wxGraphicsContext, strokePath, 1}},
+ {790, {wxGraphicsContext, getPartialTextExtents, 2}},
+ {791, {wxGraphicsContext, getTextExtent, 5}},
+ {792, {wxGraphicsContext, rotate, 1}},
+ {793, {wxGraphicsContext, scale, 2}},
+ {794, {wxGraphicsContext, translate, 2}},
+ {795, {wxGraphicsContext, getTransform, 0}},
+ {796, {wxGraphicsContext, setTransform, 1}},
+ {797, {wxGraphicsContext, concatTransform, 1}},
+ {798, {wxGraphicsContext, setBrush_1_1, 1}},
+ {799, {wxGraphicsContext, setBrush_1_0, 1}},
+ {800, {wxGraphicsContext, setFont_1, 1}},
+ {801, {wxGraphicsContext, setFont_2, 2}},
+ {802, {wxGraphicsContext, setPen_1_0, 1}},
+ {803, {wxGraphicsContext, setPen_1_1, 1}},
+ {804, {wxGraphicsContext, strokeLine, 4}},
+ {805, {wxGraphicsContext, strokeLines, 2}},
+ {807, {wxGraphicsMatrix, concat, 1}},
+ {809, {wxGraphicsMatrix, get, 1}},
+ {810, {wxGraphicsMatrix, invert, 0}},
+ {811, {wxGraphicsMatrix, isEqual, 1}},
+ {813, {wxGraphicsMatrix, isIdentity, 0}},
+ {814, {wxGraphicsMatrix, rotate, 1}},
+ {815, {wxGraphicsMatrix, scale, 2}},
+ {816, {wxGraphicsMatrix, translate, 2}},
+ {817, {wxGraphicsMatrix, set, 1}},
+ {818, {wxGraphicsMatrix, transformPoint, 2}},
+ {819, {wxGraphicsMatrix, transformDistance, 2}},
+ {820, {wxGraphicsPath, moveToPoint_2, 2}},
+ {821, {wxGraphicsPath, moveToPoint_1, 1}},
+ {822, {wxGraphicsPath, addArc_6, 6}},
+ {823, {wxGraphicsPath, addArc_5, 5}},
+ {824, {wxGraphicsPath, addArcToPoint, 5}},
+ {825, {wxGraphicsPath, addCircle, 3}},
+ {826, {wxGraphicsPath, addCurveToPoint_6, 6}},
+ {827, {wxGraphicsPath, addCurveToPoint_3, 3}},
+ {828, {wxGraphicsPath, addEllipse, 4}},
+ {829, {wxGraphicsPath, addLineToPoint_2, 2}},
+ {830, {wxGraphicsPath, addLineToPoint_1, 1}},
+ {831, {wxGraphicsPath, addPath, 1}},
+ {832, {wxGraphicsPath, addQuadCurveToPoint, 4}},
+ {833, {wxGraphicsPath, addRectangle, 4}},
+ {834, {wxGraphicsPath, addRoundedRectangle, 5}},
+ {835, {wxGraphicsPath, closeSubpath, 0}},
+ {836, {wxGraphicsPath, contains_3, 3}},
+ {837, {wxGraphicsPath, contains_2, 2}},
+ {839, {wxGraphicsPath, getBox, 0}},
+ {841, {wxGraphicsPath, getCurrentPoint, 0}},
+ {842, {wxGraphicsPath, transform, 1}},
+ {843, {wxGraphicsRenderer, getDefaultRenderer, 0}},
+ {844, {wxGraphicsRenderer, createContext_1_1, 1}},
+ {845, {wxGraphicsRenderer, createContext_1_0, 1}},
+ {846, {wxGraphicsRenderer, createPen, 1}},
+ {847, {wxGraphicsRenderer, createBrush, 1}},
+ {848, {wxGraphicsRenderer, createLinearGradientBrush, 6}},
+ {849, {wxGraphicsRenderer, createRadialGradientBrush, 7}},
+ {850, {wxGraphicsRenderer, createFont, 2}},
+ {851, {wxGraphicsRenderer, createMatrix, 1}},
+ {852, {wxGraphicsRenderer, createPath, 0}},
+ {854, {wxMenuBar, new_1, 1}},
+ {856, {wxMenuBar, new_0, 0}},
+ {858, {wxMenuBar, destruct, 0}},
+ {859, {wxMenuBar, append, 2}},
+ {860, {wxMenuBar, check, 2}},
+ {861, {wxMenuBar, enable_2, 2}},
+ {862, {wxMenuBar, enable_1, 1}},
+ {863, {wxMenuBar, enableTop, 2}},
+ {864, {wxMenuBar, findMenu, 1}},
+ {865, {wxMenuBar, findMenuItem, 2}},
+ {866, {wxMenuBar, findItem, 2}},
+ {867, {wxMenuBar, getHelpString, 1}},
+ {868, {wxMenuBar, getLabel_1, 1}},
+ {869, {wxMenuBar, getLabel_0, 0}},
+ {870, {wxMenuBar, getLabelTop, 1}},
+ {871, {wxMenuBar, getMenu, 1}},
+ {872, {wxMenuBar, getMenuCount, 0}},
+ {873, {wxMenuBar, insert, 3}},
+ {874, {wxMenuBar, isChecked, 1}},
+ {875, {wxMenuBar, isEnabled_1, 1}},
+ {876, {wxMenuBar, isEnabled_0, 0}},
+ {877, {wxMenuBar, remove, 1}},
+ {878, {wxMenuBar, replace, 3}},
+ {879, {wxMenuBar, setHelpString, 2}},
+ {880, {wxMenuBar, setLabel_2, 2}},
+ {881, {wxMenuBar, setLabel_1, 1}},
+ {882, {wxMenuBar, setLabelTop, 2}},
+ {883, {wxControl, getLabel, 0}},
+ {884, {wxControl, setLabel, 1}},
+ {885, {wxControlWithItems, append_1, 1}},
+ {886, {wxControlWithItems, append_2, 2}},
+ {887, {wxControlWithItems, appendStrings_1, 1}},
+ {888, {wxControlWithItems, clear, 0}},
+ {889, {wxControlWithItems, delete, 1}},
+ {890, {wxControlWithItems, findString, 2}},
+ {891, {wxControlWithItems, getClientData, 1}},
+ {892, {wxControlWithItems, setClientData, 2}},
+ {893, {wxControlWithItems, getCount, 0}},
+ {894, {wxControlWithItems, getSelection, 0}},
+ {895, {wxControlWithItems, getString, 1}},
+ {896, {wxControlWithItems, getStringSelection, 0}},
+ {897, {wxControlWithItems, insert_2, 2}},
+ {898, {wxControlWithItems, insert_3, 3}},
+ {899, {wxControlWithItems, isEmpty, 0}},
+ {900, {wxControlWithItems, select, 1}},
+ {901, {wxControlWithItems, setSelection, 1}},
+ {902, {wxControlWithItems, setString, 2}},
+ {903, {wxControlWithItems, setStringSelection, 1}},
+ {906, {wxMenu, new_2, 2}},
+ {907, {wxMenu, new_1, 1}},
+ {909, {wxMenu, destruct, 0}},
+ {910, {wxMenu, append_3, 3}},
+ {911, {wxMenu, append_1, 1}},
+ {912, {wxMenu, append_4_0, 4}},
+ {913, {wxMenu, append_4_1, 4}},
+ {914, {wxMenu, appendCheckItem, 3}},
+ {915, {wxMenu, appendRadioItem, 3}},
+ {916, {wxMenu, appendSeparator, 0}},
+ {917, {wxMenu, break, 0}},
+ {918, {wxMenu, check, 2}},
+ {919, {wxMenu, delete_1_0, 1}},
+ {920, {wxMenu, delete_1_1, 1}},
+ {921, {wxMenu, destroy_1_0, 1}},
+ {922, {wxMenu, destroy_1_1, 1}},
+ {923, {wxMenu, enable, 2}},
+ {924, {wxMenu, findItem_1, 1}},
+ {925, {wxMenu, findItem_2, 2}},
+ {926, {wxMenu, findItemByPosition, 1}},
+ {927, {wxMenu, getHelpString, 1}},
+ {928, {wxMenu, getLabel, 1}},
+ {929, {wxMenu, getMenuItemCount, 0}},
+ {930, {wxMenu, getMenuItems, 0}},
+ {932, {wxMenu, getTitle, 0}},
+ {933, {wxMenu, insert_2, 2}},
+ {934, {wxMenu, insert_3, 3}},
+ {935, {wxMenu, insert_5_1, 5}},
+ {936, {wxMenu, insert_5_0, 5}},
+ {937, {wxMenu, insertCheckItem, 4}},
+ {938, {wxMenu, insertRadioItem, 4}},
+ {939, {wxMenu, insertSeparator, 1}},
+ {940, {wxMenu, isChecked, 1}},
+ {941, {wxMenu, isEnabled, 1}},
+ {942, {wxMenu, prepend_1, 1}},
+ {943, {wxMenu, prepend_2, 2}},
+ {944, {wxMenu, prepend_4_1, 4}},
+ {945, {wxMenu, prepend_4_0, 4}},
+ {946, {wxMenu, prependCheckItem, 3}},
+ {947, {wxMenu, prependRadioItem, 3}},
+ {948, {wxMenu, prependSeparator, 0}},
+ {949, {wxMenu, remove_1_0, 1}},
+ {950, {wxMenu, remove_1_1, 1}},
+ {951, {wxMenu, setHelpString, 2}},
+ {952, {wxMenu, setLabel, 2}},
+ {953, {wxMenu, setTitle, 1}},
+ {954, {wxMenuItem, new, 1}},
+ {956, {wxMenuItem, destruct, 0}},
+ {957, {wxMenuItem, check, 1}},
+ {958, {wxMenuItem, enable, 1}},
+ {959, {wxMenuItem, getBitmap, 0}},
+ {960, {wxMenuItem, getHelp, 0}},
+ {961, {wxMenuItem, getId, 0}},
+ {962, {wxMenuItem, getKind, 0}},
+ {963, {wxMenuItem, getLabel, 0}},
+ {964, {wxMenuItem, getLabelFromText, 1}},
+ {965, {wxMenuItem, getMenu, 0}},
+ {966, {wxMenuItem, getText, 0}},
+ {967, {wxMenuItem, getSubMenu, 0}},
+ {968, {wxMenuItem, isCheckable, 0}},
+ {969, {wxMenuItem, isChecked, 0}},
+ {970, {wxMenuItem, isEnabled, 0}},
+ {971, {wxMenuItem, isSeparator, 0}},
+ {972, {wxMenuItem, isSubMenu, 0}},
+ {973, {wxMenuItem, setBitmap, 1}},
+ {974, {wxMenuItem, setHelp, 1}},
+ {975, {wxMenuItem, setMenu, 1}},
+ {976, {wxMenuItem, setSubMenu, 1}},
+ {977, {wxMenuItem, setText, 1}},
+ {978, {wxToolBar, addControl, 1}},
+ {979, {wxToolBar, addSeparator, 0}},
+ {980, {wxToolBar, addTool_5, 5}},
+ {981, {wxToolBar, addTool_4_0, 4}},
+ {982, {wxToolBar, addTool_1, 1}},
+ {983, {wxToolBar, addTool_4_1, 4}},
+ {984, {wxToolBar, addTool_3, 3}},
+ {985, {wxToolBar, addTool_6, 6}},
+ {986, {wxToolBar, addCheckTool, 4}},
+ {987, {wxToolBar, addRadioTool, 4}},
+ {988, {wxToolBar, addStretchableSpace, 0}},
+ {989, {wxToolBar, insertStretchableSpace, 1}},
+ {990, {wxToolBar, deleteTool, 1}},
+ {991, {wxToolBar, deleteToolByPos, 1}},
+ {992, {wxToolBar, enableTool, 2}},
+ {993, {wxToolBar, findById, 1}},
+ {994, {wxToolBar, findControl, 1}},
+ {995, {wxToolBar, findToolForPosition, 2}},
+ {996, {wxToolBar, getToolSize, 0}},
+ {997, {wxToolBar, getToolBitmapSize, 0}},
+ {998, {wxToolBar, getMargins, 0}},
+ {999, {wxToolBar, getToolEnabled, 1}},
+ {1000, {wxToolBar, getToolLongHelp, 1}},
+ {1001, {wxToolBar, getToolPacking, 0}},
+ {1002, {wxToolBar, getToolPos, 1}},
+ {1003, {wxToolBar, getToolSeparation, 0}},
+ {1004, {wxToolBar, getToolShortHelp, 1}},
+ {1005, {wxToolBar, getToolState, 1}},
+ {1006, {wxToolBar, insertControl, 2}},
+ {1007, {wxToolBar, insertSeparator, 1}},
+ {1008, {wxToolBar, insertTool_5, 5}},
+ {1009, {wxToolBar, insertTool_2, 2}},
+ {1010, {wxToolBar, insertTool_4, 4}},
+ {1011, {wxToolBar, realize, 0}},
+ {1012, {wxToolBar, removeTool, 1}},
+ {1013, {wxToolBar, setMargins, 2}},
+ {1014, {wxToolBar, setToolBitmapSize, 1}},
+ {1015, {wxToolBar, setToolLongHelp, 2}},
+ {1016, {wxToolBar, setToolPacking, 1}},
+ {1017, {wxToolBar, setToolShortHelp, 2}},
+ {1018, {wxToolBar, setToolSeparation, 1}},
+ {1019, {wxToolBar, toggleTool, 2}},
+ {1021, {wxStatusBar, new_0, 0}},
+ {1022, {wxStatusBar, new_2, 2}},
+ {1024, {wxStatusBar, destruct, 0}},
+ {1025, {wxStatusBar, create, 2}},
+ {1026, {wxStatusBar, getFieldRect, 2}},
+ {1027, {wxStatusBar, getFieldsCount, 0}},
+ {1028, {wxStatusBar, getStatusText, 1}},
+ {1029, {wxStatusBar, popStatusText, 1}},
+ {1030, {wxStatusBar, pushStatusText, 2}},
+ {1031, {wxStatusBar, setFieldsCount, 2}},
+ {1032, {wxStatusBar, setMinHeight, 1}},
+ {1033, {wxStatusBar, setStatusText, 2}},
+ {1034, {wxStatusBar, setStatusWidths, 2}},
+ {1035, {wxStatusBar, setStatusStyles, 2}},
+ {1036, {wxBitmap, new_0, 0}},
+ {1037, {wxBitmap, new_3, 3}},
+ {1038, {wxBitmap, new_4, 4}},
+ {1039, {wxBitmap, new_2_0, 2}},
+ {1040, {wxBitmap, new_2_1, 2}},
+ {1041, {wxBitmap, destruct, 0}},
+ {1042, {wxBitmap, convertToImage, 0}},
+ {1043, {wxBitmap, copyFromIcon, 1}},
+ {1044, {wxBitmap, create, 3}},
+ {1045, {wxBitmap, getDepth, 0}},
+ {1046, {wxBitmap, getHeight, 0}},
+ {1047, {wxBitmap, getPalette, 0}},
+ {1048, {wxBitmap, getMask, 0}},
+ {1049, {wxBitmap, getWidth, 0}},
+ {1050, {wxBitmap, getSubBitmap, 1}},
+ {1051, {wxBitmap, loadFile, 2}},
+ {1052, {wxBitmap, ok, 0}},
+ {1053, {wxBitmap, saveFile, 3}},
+ {1054, {wxBitmap, setDepth, 1}},
+ {1055, {wxBitmap, setHeight, 1}},
+ {1056, {wxBitmap, setMask, 1}},
+ {1057, {wxBitmap, setPalette, 1}},
+ {1058, {wxBitmap, setWidth, 1}},
+ {1059, {wxIcon, new_0, 0}},
+ {1060, {wxIcon, new_2, 2}},
+ {1061, {wxIcon, new_1, 1}},
+ {1062, {wxIcon, copyFromBitmap, 1}},
+ {1063, {wxIcon, 'Destroy', undefined}},
+ {1064, {wxIconBundle, new_0, 0}},
+ {1065, {wxIconBundle, new_2, 2}},
+ {1066, {wxIconBundle, new_1_0, 1}},
+ {1067, {wxIconBundle, new_1_1, 1}},
+ {1068, {wxIconBundle, destruct, 0}},
+ {1069, {wxIconBundle, addIcon_2, 2}},
+ {1070, {wxIconBundle, addIcon_1, 1}},
+ {1071, {wxIconBundle, getIcon_1_1, 1}},
+ {1072, {wxIconBundle, getIcon_1_0, 1}},
+ {1073, {wxCursor, new_0, 0}},
+ {1074, {wxCursor, new_1_0, 1}},
+ {1075, {wxCursor, new_1_1, 1}},
+ {1076, {wxCursor, new_4, 4}},
+ {1077, {wxCursor, destruct, 0}},
+ {1078, {wxCursor, ok, 0}},
+ {1079, {wxMask, new_0, 0}},
+ {1080, {wxMask, new_2_1, 2}},
+ {1081, {wxMask, new_2_0, 2}},
+ {1082, {wxMask, new_1, 1}},
+ {1083, {wxMask, destruct, 0}},
+ {1084, {wxMask, create_2_1, 2}},
+ {1085, {wxMask, create_2_0, 2}},
+ {1086, {wxMask, create_1, 1}},
+ {1087, {wxImage, new_0, 0}},
+ {1088, {wxImage, new_3_0, 3}},
+ {1089, {wxImage, new_4, 4}},
+ {1090, {wxImage, new_5, 5}},
+ {1091, {wxImage, new_2, 2}},
+ {1092, {wxImage, new_3_1, 3}},
+ {1093, {wxImage, blur, 1}},
+ {1094, {wxImage, blurHorizontal, 1}},
+ {1095, {wxImage, blurVertical, 1}},
+ {1096, {wxImage, convertAlphaToMask, 1}},
+ {1097, {wxImage, convertToGreyscale, 1}},
+ {1098, {wxImage, convertToMono, 3}},
+ {1099, {wxImage, copy, 0}},
+ {1100, {wxImage, create_3, 3}},
+ {1101, {wxImage, create_4, 4}},
+ {1102, {wxImage, create_5, 5}},
+ {1103, {wxImage, 'Destroy', 0}},
+ {1104, {wxImage, findFirstUnusedColour, 4}},
+ {1105, {wxImage, getImageExtWildcard, 0}},
+ {1106, {wxImage, getAlpha_2, 2}},
+ {1107, {wxImage, getAlpha_0, 0}},
+ {1108, {wxImage, getBlue, 2}},
+ {1109, {wxImage, getData, 0}},
+ {1110, {wxImage, getGreen, 2}},
+ {1111, {wxImage, getImageCount, 2}},
+ {1112, {wxImage, getHeight, 0}},
+ {1113, {wxImage, getMaskBlue, 0}},
+ {1114, {wxImage, getMaskGreen, 0}},
+ {1115, {wxImage, getMaskRed, 0}},
+ {1116, {wxImage, getOrFindMaskColour, 3}},
+ {1117, {wxImage, getPalette, 0}},
+ {1118, {wxImage, getRed, 2}},
+ {1119, {wxImage, getSubImage, 1}},
+ {1120, {wxImage, getWidth, 0}},
+ {1121, {wxImage, hasAlpha, 0}},
+ {1122, {wxImage, hasMask, 0}},
+ {1123, {wxImage, getOption, 1}},
+ {1124, {wxImage, getOptionInt, 1}},
+ {1125, {wxImage, hasOption, 1}},
+ {1126, {wxImage, initAlpha, 0}},
+ {1127, {wxImage, initStandardHandlers, 0}},
+ {1128, {wxImage, isTransparent, 3}},
+ {1129, {wxImage, loadFile_2, 2}},
+ {1130, {wxImage, loadFile_3, 3}},
+ {1131, {wxImage, ok, 0}},
+ {1132, {wxImage, removeHandler, 1}},
+ {1133, {wxImage, mirror, 1}},
+ {1134, {wxImage, replace, 6}},
+ {1135, {wxImage, rescale, 3}},
+ {1136, {wxImage, resize, 3}},
+ {1137, {wxImage, rotate, 3}},
+ {1138, {wxImage, rotateHue, 1}},
+ {1139, {wxImage, rotate90, 1}},
+ {1140, {wxImage, saveFile_1, 1}},
+ {1141, {wxImage, saveFile_2_0, 2}},
+ {1142, {wxImage, saveFile_2_1, 2}},
+ {1143, {wxImage, scale, 3}},
+ {1144, {wxImage, size, 3}},
+ {1145, {wxImage, setAlpha_3, 3}},
+ {1146, {wxImage, setAlpha_2, 2}},
+ {1147, {wxImage, setData_2, 2}},
+ {1148, {wxImage, setData_4, 4}},
+ {1149, {wxImage, setMask, 1}},
+ {1150, {wxImage, setMaskColour, 3}},
+ {1151, {wxImage, setMaskFromImage, 4}},
+ {1152, {wxImage, setOption_2_1, 2}},
+ {1153, {wxImage, setOption_2_0, 2}},
+ {1154, {wxImage, setPalette, 1}},
+ {1155, {wxImage, setRGB_5, 5}},
+ {1156, {wxImage, setRGB_4, 4}},
+ {1157, {wxImage, 'Destroy', undefined}},
+ {1158, {wxBrush, new_0, 0}},
+ {1159, {wxBrush, new_2, 2}},
+ {1160, {wxBrush, new_1, 1}},
+ {1162, {wxBrush, destruct, 0}},
+ {1163, {wxBrush, getColour, 0}},
+ {1164, {wxBrush, getStipple, 0}},
+ {1165, {wxBrush, getStyle, 0}},
+ {1166, {wxBrush, isHatch, 0}},
+ {1167, {wxBrush, isOk, 0}},
+ {1168, {wxBrush, setColour_1, 1}},
+ {1169, {wxBrush, setColour_3, 3}},
+ {1170, {wxBrush, setStipple, 1}},
+ {1171, {wxBrush, setStyle, 1}},
+ {1172, {wxPen, new_0, 0}},
+ {1173, {wxPen, new_2, 2}},
+ {1174, {wxPen, destruct, 0}},
+ {1175, {wxPen, getCap, 0}},
+ {1176, {wxPen, getColour, 0}},
+ {1177, {wxPen, getJoin, 0}},
+ {1178, {wxPen, getStyle, 0}},
+ {1179, {wxPen, getWidth, 0}},
+ {1180, {wxPen, isOk, 0}},
+ {1181, {wxPen, setCap, 1}},
+ {1182, {wxPen, setColour_1, 1}},
+ {1183, {wxPen, setColour_3, 3}},
+ {1184, {wxPen, setJoin, 1}},
+ {1185, {wxPen, setStyle, 1}},
+ {1186, {wxPen, setWidth, 1}},
+ {1187, {wxRegion, new_0, 0}},
+ {1188, {wxRegion, new_4, 4}},
+ {1189, {wxRegion, new_2, 2}},
+ {1190, {wxRegion, new_1_1, 1}},
+ {1192, {wxRegion, new_1_0, 1}},
+ {1194, {wxRegion, destruct, 0}},
+ {1195, {wxRegion, clear, 0}},
+ {1196, {wxRegion, contains_2, 2}},
+ {1197, {wxRegion, contains_1_0, 1}},
+ {1198, {wxRegion, contains_4, 4}},
+ {1199, {wxRegion, contains_1_1, 1}},
+ {1200, {wxRegion, convertToBitmap, 0}},
+ {1201, {wxRegion, getBox, 0}},
+ {1202, {wxRegion, intersect_4, 4}},
+ {1203, {wxRegion, intersect_1_1, 1}},
+ {1204, {wxRegion, intersect_1_0, 1}},
+ {1205, {wxRegion, isEmpty, 0}},
+ {1206, {wxRegion, subtract_4, 4}},
+ {1207, {wxRegion, subtract_1_1, 1}},
+ {1208, {wxRegion, subtract_1_0, 1}},
+ {1209, {wxRegion, offset_2, 2}},
+ {1210, {wxRegion, offset_1, 1}},
+ {1211, {wxRegion, union_4, 4}},
+ {1212, {wxRegion, union_1_2, 1}},
+ {1213, {wxRegion, union_1_1, 1}},
+ {1214, {wxRegion, union_1_0, 1}},
+ {1215, {wxRegion, union_3, 3}},
+ {1216, {wxRegion, xor_4, 4}},
+ {1217, {wxRegion, xor_1_1, 1}},
+ {1218, {wxRegion, xor_1_0, 1}},
+ {1219, {wxAcceleratorTable, new_0, 0}},
+ {1220, {wxAcceleratorTable, new_2, 2}},
+ {1221, {wxAcceleratorTable, destruct, 0}},
+ {1222, {wxAcceleratorTable, ok, 0}},
+ {1223, {wxAcceleratorEntry, new_1_0, 1}},
+ {1224, {wxAcceleratorEntry, new_1_1, 1}},
+ {1225, {wxAcceleratorEntry, getCommand, 0}},
+ {1226, {wxAcceleratorEntry, getFlags, 0}},
+ {1227, {wxAcceleratorEntry, getKeyCode, 0}},
+ {1228, {wxAcceleratorEntry, set, 4}},
+ {1229, {wxAcceleratorEntry, 'Destroy', undefined}},
+ {1234, {wxCaret, new_3, 3}},
+ {1235, {wxCaret, new_2, 2}},
+ {1237, {wxCaret, destruct, 0}},
+ {1238, {wxCaret, create_3, 3}},
+ {1239, {wxCaret, create_2, 2}},
+ {1240, {wxCaret, getBlinkTime, 0}},
+ {1242, {wxCaret, getPosition, 0}},
+ {1244, {wxCaret, getSize, 0}},
+ {1245, {wxCaret, getWindow, 0}},
+ {1246, {wxCaret, hide, 0}},
+ {1247, {wxCaret, isOk, 0}},
+ {1248, {wxCaret, isVisible, 0}},
+ {1249, {wxCaret, move_2, 2}},
+ {1250, {wxCaret, move_1, 1}},
+ {1251, {wxCaret, setBlinkTime, 1}},
+ {1252, {wxCaret, setSize_2, 2}},
+ {1253, {wxCaret, setSize_1, 1}},
+ {1254, {wxCaret, show, 1}},
+ {1255, {wxSizer, add_2_1, 2}},
+ {1256, {wxSizer, add_2_0, 2}},
+ {1257, {wxSizer, add_3, 3}},
+ {1258, {wxSizer, add_2_3, 2}},
+ {1259, {wxSizer, add_2_2, 2}},
+ {1260, {wxSizer, addSpacer, 1}},
+ {1261, {wxSizer, addStretchSpacer, 1}},
+ {1262, {wxSizer, calcMin, 0}},
+ {1263, {wxSizer, clear, 1}},
+ {1264, {wxSizer, detach_1_2, 1}},
+ {1265, {wxSizer, detach_1_1, 1}},
+ {1266, {wxSizer, detach_1_0, 1}},
+ {1267, {wxSizer, fit, 1}},
+ {1268, {wxSizer, fitInside, 1}},
+ {1269, {wxSizer, getChildren, 0}},
+ {1270, {wxSizer, getItem_2_1, 2}},
+ {1271, {wxSizer, getItem_2_0, 2}},
+ {1272, {wxSizer, getItem_1, 1}},
+ {1273, {wxSizer, getSize, 0}},
+ {1274, {wxSizer, getPosition, 0}},
+ {1275, {wxSizer, getMinSize, 0}},
+ {1276, {wxSizer, hide_2_0, 2}},
+ {1277, {wxSizer, hide_2_1, 2}},
+ {1278, {wxSizer, hide_1, 1}},
+ {1279, {wxSizer, insert_3_1, 3}},
+ {1280, {wxSizer, insert_3_0, 3}},
+ {1281, {wxSizer, insert_4, 4}},
+ {1282, {wxSizer, insert_3_3, 3}},
+ {1283, {wxSizer, insert_3_2, 3}},
+ {1284, {wxSizer, insert_2, 2}},
+ {1285, {wxSizer, insertSpacer, 2}},
+ {1286, {wxSizer, insertStretchSpacer, 2}},
+ {1287, {wxSizer, isShown_1_2, 1}},
+ {1288, {wxSizer, isShown_1_1, 1}},
+ {1289, {wxSizer, isShown_1_0, 1}},
+ {1290, {wxSizer, layout, 0}},
+ {1291, {wxSizer, prepend_2_1, 2}},
+ {1292, {wxSizer, prepend_2_0, 2}},
+ {1293, {wxSizer, prepend_3, 3}},
+ {1294, {wxSizer, prepend_2_3, 2}},
+ {1295, {wxSizer, prepend_2_2, 2}},
+ {1296, {wxSizer, prepend_1, 1}},
+ {1297, {wxSizer, prependSpacer, 1}},
+ {1298, {wxSizer, prependStretchSpacer, 1}},
+ {1299, {wxSizer, recalcSizes, 0}},
+ {1300, {wxSizer, remove_1_1, 1}},
+ {1301, {wxSizer, remove_1_0, 1}},
+ {1302, {wxSizer, replace_3_1, 3}},
+ {1303, {wxSizer, replace_3_0, 3}},
+ {1304, {wxSizer, replace_2, 2}},
+ {1305, {wxSizer, setDimension, 4}},
+ {1306, {wxSizer, setMinSize_2, 2}},
+ {1307, {wxSizer, setMinSize_1, 1}},
+ {1308, {wxSizer, setItemMinSize_3_2, 3}},
+ {1309, {wxSizer, setItemMinSize_2_2, 2}},
+ {1310, {wxSizer, setItemMinSize_3_1, 3}},
+ {1311, {wxSizer, setItemMinSize_2_1, 2}},
+ {1312, {wxSizer, setItemMinSize_3_0, 3}},
+ {1313, {wxSizer, setItemMinSize_2_0, 2}},
+ {1314, {wxSizer, setSizeHints, 1}},
+ {1315, {wxSizer, setVirtualSizeHints, 1}},
+ {1316, {wxSizer, show_2_2, 2}},
+ {1317, {wxSizer, show_2_1, 2}},
+ {1318, {wxSizer, show_2_0, 2}},
+ {1319, {wxSizer, show_1, 1}},
+ {1320, {wxSizerFlags, new, 1}},
+ {1321, {wxSizerFlags, align, 1}},
+ {1322, {wxSizerFlags, border_2, 2}},
+ {1323, {wxSizerFlags, border_1, 1}},
+ {1324, {wxSizerFlags, center, 0}},
+ {1325, {wxSizerFlags, centre, 0}},
+ {1326, {wxSizerFlags, expand, 0}},
+ {1327, {wxSizerFlags, left, 0}},
+ {1328, {wxSizerFlags, proportion, 1}},
+ {1329, {wxSizerFlags, right, 0}},
+ {1330, {wxSizerFlags, 'Destroy', undefined}},
+ {1331, {wxSizerItem, new_5_1, 5}},
+ {1332, {wxSizerItem, new_2_1, 2}},
+ {1333, {wxSizerItem, new_5_0, 5}},
+ {1334, {wxSizerItem, new_2_0, 2}},
+ {1335, {wxSizerItem, new_6, 6}},
+ {1336, {wxSizerItem, new_3, 3}},
+ {1337, {wxSizerItem, new_0, 0}},
+ {1338, {wxSizerItem, destruct, 0}},
+ {1339, {wxSizerItem, calcMin, 0}},
+ {1340, {wxSizerItem, deleteWindows, 0}},
+ {1341, {wxSizerItem, detachSizer, 0}},
+ {1342, {wxSizerItem, getBorder, 0}},
+ {1343, {wxSizerItem, getFlag, 0}},
+ {1344, {wxSizerItem, getMinSize, 0}},
+ {1345, {wxSizerItem, getPosition, 0}},
+ {1346, {wxSizerItem, getProportion, 0}},
+ {1347, {wxSizerItem, getRatio, 0}},
+ {1348, {wxSizerItem, getRect, 0}},
+ {1349, {wxSizerItem, getSize, 0}},
+ {1350, {wxSizerItem, getSizer, 0}},
+ {1351, {wxSizerItem, getSpacer, 0}},
+ {1352, {wxSizerItem, getUserData, 0}},
+ {1353, {wxSizerItem, getWindow, 0}},
+ {1354, {wxSizerItem, isSizer, 0}},
+ {1355, {wxSizerItem, isShown, 0}},
+ {1356, {wxSizerItem, isSpacer, 0}},
+ {1357, {wxSizerItem, isWindow, 0}},
+ {1358, {wxSizerItem, setBorder, 1}},
+ {1359, {wxSizerItem, setDimension, 2}},
+ {1360, {wxSizerItem, setFlag, 1}},
+ {1361, {wxSizerItem, setInitSize, 2}},
+ {1362, {wxSizerItem, setMinSize_1, 1}},
+ {1363, {wxSizerItem, setMinSize_2, 2}},
+ {1364, {wxSizerItem, setProportion, 1}},
+ {1365, {wxSizerItem, setRatio_2, 2}},
+ {1366, {wxSizerItem, setRatio_1_1, 1}},
+ {1367, {wxSizerItem, setRatio_1_0, 1}},
+ {1368, {wxSizerItem, setSizer, 1}},
+ {1369, {wxSizerItem, setSpacer_1, 1}},
+ {1370, {wxSizerItem, setSpacer_2, 2}},
+ {1371, {wxSizerItem, setWindow, 1}},
+ {1372, {wxSizerItem, show, 1}},
+ {1373, {wxBoxSizer, new, 1}},
+ {1374, {wxBoxSizer, getOrientation, 0}},
+ {1375, {wxBoxSizer, 'Destroy', undefined}},
+ {1376, {wxStaticBoxSizer, new_2, 2}},
+ {1377, {wxStaticBoxSizer, new_3, 3}},
+ {1378, {wxStaticBoxSizer, getStaticBox, 0}},
+ {1379, {wxStaticBoxSizer, 'Destroy', undefined}},
+ {1380, {wxGridSizer, new_4, 4}},
+ {1381, {wxGridSizer, new_2, 2}},
+ {1382, {wxGridSizer, getCols, 0}},
+ {1383, {wxGridSizer, getHGap, 0}},
+ {1384, {wxGridSizer, getRows, 0}},
+ {1385, {wxGridSizer, getVGap, 0}},
+ {1386, {wxGridSizer, setCols, 1}},
+ {1387, {wxGridSizer, setHGap, 1}},
+ {1388, {wxGridSizer, setRows, 1}},
+ {1389, {wxGridSizer, setVGap, 1}},
+ {1390, {wxGridSizer, 'Destroy', undefined}},
+ {1391, {wxFlexGridSizer, new_4, 4}},
+ {1392, {wxFlexGridSizer, new_2, 2}},
+ {1393, {wxFlexGridSizer, addGrowableCol, 2}},
+ {1394, {wxFlexGridSizer, addGrowableRow, 2}},
+ {1395, {wxFlexGridSizer, getFlexibleDirection, 0}},
+ {1396, {wxFlexGridSizer, getNonFlexibleGrowMode, 0}},
+ {1397, {wxFlexGridSizer, removeGrowableCol, 1}},
+ {1398, {wxFlexGridSizer, removeGrowableRow, 1}},
+ {1399, {wxFlexGridSizer, setFlexibleDirection, 1}},
+ {1400, {wxFlexGridSizer, setNonFlexibleGrowMode, 1}},
+ {1401, {wxFlexGridSizer, 'Destroy', undefined}},
+ {1402, {wxGridBagSizer, new, 1}},
+ {1403, {wxGridBagSizer, add_3_2, 3}},
+ {1404, {wxGridBagSizer, add_3_1, 3}},
+ {1405, {wxGridBagSizer, add_4, 4}},
+ {1406, {wxGridBagSizer, add_1_0, 1}},
+ {1407, {wxGridBagSizer, add_2_1, 2}},
+ {1408, {wxGridBagSizer, add_2_0, 2}},
+ {1409, {wxGridBagSizer, add_3_0, 3}},
+ {1410, {wxGridBagSizer, add_1_1, 1}},
+ {1411, {wxGridBagSizer, calcMin, 0}},
+ {1412, {wxGridBagSizer, checkForIntersection_2, 2}},
+ {1413, {wxGridBagSizer, checkForIntersection_3, 3}},
+ {1414, {wxGridBagSizer, findItem_1_1, 1}},
+ {1415, {wxGridBagSizer, findItem_1_0, 1}},
+ {1416, {wxGridBagSizer, findItemAtPoint, 1}},
+ {1417, {wxGridBagSizer, findItemAtPosition, 1}},
+ {1418, {wxGridBagSizer, findItemWithData, 1}},
+ {1419, {wxGridBagSizer, getCellSize, 2}},
+ {1420, {wxGridBagSizer, getEmptyCellSize, 0}},
+ {1421, {wxGridBagSizer, getItemPosition_1_2, 1}},
+ {1422, {wxGridBagSizer, getItemPosition_1_1, 1}},
+ {1423, {wxGridBagSizer, getItemPosition_1_0, 1}},
+ {1424, {wxGridBagSizer, getItemSpan_1_2, 1}},
+ {1425, {wxGridBagSizer, getItemSpan_1_1, 1}},
+ {1426, {wxGridBagSizer, getItemSpan_1_0, 1}},
+ {1427, {wxGridBagSizer, setEmptyCellSize, 1}},
+ {1428, {wxGridBagSizer, setItemPosition_2_2, 2}},
+ {1429, {wxGridBagSizer, setItemPosition_2_1, 2}},
+ {1430, {wxGridBagSizer, setItemPosition_2_0, 2}},
+ {1431, {wxGridBagSizer, setItemSpan_2_2, 2}},
+ {1432, {wxGridBagSizer, setItemSpan_2_1, 2}},
+ {1433, {wxGridBagSizer, setItemSpan_2_0, 2}},
+ {1434, {wxGridBagSizer, 'Destroy', undefined}},
+ {1435, {wxStdDialogButtonSizer, new, 0}},
+ {1436, {wxStdDialogButtonSizer, addButton, 1}},
+ {1437, {wxStdDialogButtonSizer, realize, 0}},
+ {1438, {wxStdDialogButtonSizer, setAffirmativeButton, 1}},
+ {1439, {wxStdDialogButtonSizer, setCancelButton, 1}},
+ {1440, {wxStdDialogButtonSizer, setNegativeButton, 1}},
+ {1441, {wxStdDialogButtonSizer, 'Destroy', undefined}},
+ {1442, {wxFont, new_0, 0}},
+ {1443, {wxFont, new_1, 1}},
+ {1444, {wxFont, new_5, 5}},
+ {1446, {wxFont, destruct, 0}},
+ {1447, {wxFont, isFixedWidth, 0}},
+ {1448, {wxFont, getDefaultEncoding, 0}},
+ {1449, {wxFont, getFaceName, 0}},
+ {1450, {wxFont, getFamily, 0}},
+ {1451, {wxFont, getNativeFontInfoDesc, 0}},
+ {1452, {wxFont, getNativeFontInfoUserDesc, 0}},
+ {1453, {wxFont, getPointSize, 0}},
+ {1454, {wxFont, getStyle, 0}},
+ {1455, {wxFont, getUnderlined, 0}},
+ {1456, {wxFont, getWeight, 0}},
+ {1457, {wxFont, ok, 0}},
+ {1458, {wxFont, setDefaultEncoding, 1}},
+ {1459, {wxFont, setFaceName, 1}},
+ {1460, {wxFont, setFamily, 1}},
+ {1461, {wxFont, setPointSize, 1}},
+ {1462, {wxFont, setStyle, 1}},
+ {1463, {wxFont, setUnderlined, 1}},
+ {1464, {wxFont, setWeight, 1}},
+ {1465, {wxToolTip, enable, 1}},
+ {1466, {wxToolTip, setDelay, 1}},
+ {1467, {wxToolTip, new, 1}},
+ {1468, {wxToolTip, setTip, 1}},
+ {1469, {wxToolTip, getTip, 0}},
+ {1470, {wxToolTip, getWindow, 0}},
+ {1471, {wxToolTip, 'Destroy', undefined}},
+ {1473, {wxButton, new_3, 3}},
+ {1474, {wxButton, new_0, 0}},
+ {1475, {wxButton, destruct, 0}},
+ {1476, {wxButton, create, 3}},
+ {1477, {wxButton, getDefaultSize, 0}},
+ {1478, {wxButton, setDefault, 0}},
+ {1479, {wxButton, setLabel, 1}},
+ {1481, {wxBitmapButton, new_4, 4}},
+ {1482, {wxBitmapButton, new_0, 0}},
+ {1483, {wxBitmapButton, create, 4}},
+ {1484, {wxBitmapButton, getBitmapDisabled, 0}},
+ {1486, {wxBitmapButton, getBitmapFocus, 0}},
+ {1488, {wxBitmapButton, getBitmapLabel, 0}},
+ {1490, {wxBitmapButton, getBitmapSelected, 0}},
+ {1492, {wxBitmapButton, setBitmapDisabled, 1}},
+ {1493, {wxBitmapButton, setBitmapFocus, 1}},
+ {1494, {wxBitmapButton, setBitmapLabel, 1}},
+ {1495, {wxBitmapButton, setBitmapSelected, 1}},
+ {1496, {wxBitmapButton, 'Destroy', undefined}},
+ {1497, {wxToggleButton, new_0, 0}},
+ {1498, {wxToggleButton, new_4, 4}},
+ {1499, {wxToggleButton, create, 4}},
+ {1500, {wxToggleButton, getValue, 0}},
+ {1501, {wxToggleButton, setValue, 1}},
+ {1502, {wxToggleButton, 'Destroy', undefined}},
+ {1503, {wxCalendarCtrl, new_0, 0}},
+ {1504, {wxCalendarCtrl, new_3, 3}},
+ {1505, {wxCalendarCtrl, create, 3}},
+ {1506, {wxCalendarCtrl, destruct, 0}},
+ {1507, {wxCalendarCtrl, setDate, 1}},
+ {1508, {wxCalendarCtrl, getDate, 0}},
+ {1509, {wxCalendarCtrl, enableYearChange, 1}},
+ {1510, {wxCalendarCtrl, enableMonthChange, 1}},
+ {1511, {wxCalendarCtrl, enableHolidayDisplay, 1}},
+ {1512, {wxCalendarCtrl, setHeaderColours, 2}},
+ {1513, {wxCalendarCtrl, getHeaderColourFg, 0}},
+ {1514, {wxCalendarCtrl, getHeaderColourBg, 0}},
+ {1515, {wxCalendarCtrl, setHighlightColours, 2}},
+ {1516, {wxCalendarCtrl, getHighlightColourFg, 0}},
+ {1517, {wxCalendarCtrl, getHighlightColourBg, 0}},
+ {1518, {wxCalendarCtrl, setHolidayColours, 2}},
+ {1519, {wxCalendarCtrl, getHolidayColourFg, 0}},
+ {1520, {wxCalendarCtrl, getHolidayColourBg, 0}},
+ {1521, {wxCalendarCtrl, getAttr, 1}},
+ {1522, {wxCalendarCtrl, setAttr, 2}},
+ {1523, {wxCalendarCtrl, setHoliday, 1}},
+ {1524, {wxCalendarCtrl, resetAttr, 1}},
+ {1525, {wxCalendarCtrl, hitTest, 2}},
+ {1526, {wxCalendarDateAttr, new_0, 0}},
+ {1527, {wxCalendarDateAttr, new_2_1, 2}},
+ {1528, {wxCalendarDateAttr, new_2_0, 2}},
+ {1529, {wxCalendarDateAttr, setTextColour, 1}},
+ {1530, {wxCalendarDateAttr, setBackgroundColour, 1}},
+ {1531, {wxCalendarDateAttr, setBorderColour, 1}},
+ {1532, {wxCalendarDateAttr, setFont, 1}},
+ {1533, {wxCalendarDateAttr, setBorder, 1}},
+ {1534, {wxCalendarDateAttr, setHoliday, 1}},
+ {1535, {wxCalendarDateAttr, hasTextColour, 0}},
+ {1536, {wxCalendarDateAttr, hasBackgroundColour, 0}},
+ {1537, {wxCalendarDateAttr, hasBorderColour, 0}},
+ {1538, {wxCalendarDateAttr, hasFont, 0}},
+ {1539, {wxCalendarDateAttr, hasBorder, 0}},
+ {1540, {wxCalendarDateAttr, isHoliday, 0}},
+ {1541, {wxCalendarDateAttr, getTextColour, 0}},
+ {1542, {wxCalendarDateAttr, getBackgroundColour, 0}},
+ {1543, {wxCalendarDateAttr, getBorderColour, 0}},
+ {1544, {wxCalendarDateAttr, getFont, 0}},
+ {1545, {wxCalendarDateAttr, getBorder, 0}},
+ {1546, {wxCalendarDateAttr, 'Destroy', undefined}},
+ {1548, {wxCheckBox, new_4, 4}},
+ {1549, {wxCheckBox, new_0, 0}},
+ {1550, {wxCheckBox, create, 4}},
+ {1551, {wxCheckBox, getValue, 0}},
+ {1552, {wxCheckBox, get3StateValue, 0}},
+ {1553, {wxCheckBox, is3rdStateAllowedForUser, 0}},
+ {1554, {wxCheckBox, is3State, 0}},
+ {1555, {wxCheckBox, isChecked, 0}},
+ {1556, {wxCheckBox, setValue, 1}},
+ {1557, {wxCheckBox, set3StateValue, 1}},
+ {1558, {wxCheckBox, 'Destroy', undefined}},
+ {1559, {wxCheckListBox, new_0, 0}},
+ {1561, {wxCheckListBox, new_3, 3}},
+ {1562, {wxCheckListBox, check, 2}},
+ {1563, {wxCheckListBox, isChecked, 1}},
+ {1564, {wxCheckListBox, 'Destroy', undefined}},
+ {1567, {wxChoice, new_3, 3}},
+ {1568, {wxChoice, new_0, 0}},
+ {1570, {wxChoice, destruct, 0}},
+ {1572, {wxChoice, create, 6}},
+ {1573, {wxChoice, delete, 1}},
+ {1574, {wxChoice, getColumns, 0}},
+ {1575, {wxChoice, setColumns, 1}},
+ {1576, {wxComboBox, new_0, 0}},
+ {1578, {wxComboBox, new_3, 3}},
+ {1579, {wxComboBox, destruct, 0}},
+ {1581, {wxComboBox, create, 7}},
+ {1582, {wxComboBox, canCopy, 0}},
+ {1583, {wxComboBox, canCut, 0}},
+ {1584, {wxComboBox, canPaste, 0}},
+ {1585, {wxComboBox, canRedo, 0}},
+ {1586, {wxComboBox, canUndo, 0}},
+ {1587, {wxComboBox, copy, 0}},
+ {1588, {wxComboBox, cut, 0}},
+ {1589, {wxComboBox, getInsertionPoint, 0}},
+ {1590, {wxComboBox, getLastPosition, 0}},
+ {1591, {wxComboBox, getValue, 0}},
+ {1592, {wxComboBox, paste, 0}},
+ {1593, {wxComboBox, redo, 0}},
+ {1594, {wxComboBox, replace, 3}},
+ {1595, {wxComboBox, remove, 2}},
+ {1596, {wxComboBox, setInsertionPoint, 1}},
+ {1597, {wxComboBox, setInsertionPointEnd, 0}},
+ {1598, {wxComboBox, setSelection_1, 1}},
+ {1599, {wxComboBox, setSelection_2, 2}},
+ {1600, {wxComboBox, setValue, 1}},
+ {1601, {wxComboBox, undo, 0}},
+ {1602, {wxGauge, new_0, 0}},
+ {1603, {wxGauge, new_4, 4}},
+ {1604, {wxGauge, create, 4}},
+ {1605, {wxGauge, getBezelFace, 0}},
+ {1606, {wxGauge, getRange, 0}},
+ {1607, {wxGauge, getShadowWidth, 0}},
+ {1608, {wxGauge, getValue, 0}},
+ {1609, {wxGauge, isVertical, 0}},
+ {1610, {wxGauge, setBezelFace, 1}},
+ {1611, {wxGauge, setRange, 1}},
+ {1612, {wxGauge, setShadowWidth, 1}},
+ {1613, {wxGauge, setValue, 1}},
+ {1614, {wxGauge, pulse, 0}},
+ {1615, {wxGauge, 'Destroy', undefined}},
+ {1616, {wxGenericDirCtrl, new_0, 0}},
+ {1617, {wxGenericDirCtrl, new_2, 2}},
+ {1618, {wxGenericDirCtrl, destruct, 0}},
+ {1619, {wxGenericDirCtrl, create, 2}},
+ {1620, {wxGenericDirCtrl, init, 0}},
+ {1621, {wxGenericDirCtrl, collapseTree, 0}},
+ {1622, {wxGenericDirCtrl, expandPath, 1}},
+ {1623, {wxGenericDirCtrl, getDefaultPath, 0}},
+ {1624, {wxGenericDirCtrl, getPath, 0}},
+ {1625, {wxGenericDirCtrl, getFilePath, 0}},
+ {1626, {wxGenericDirCtrl, getFilter, 0}},
+ {1627, {wxGenericDirCtrl, getFilterIndex, 0}},
+ {1628, {wxGenericDirCtrl, getRootId, 0}},
+ {1629, {wxGenericDirCtrl, getTreeCtrl, 0}},
+ {1630, {wxGenericDirCtrl, reCreateTree, 0}},
+ {1631, {wxGenericDirCtrl, setDefaultPath, 1}},
+ {1632, {wxGenericDirCtrl, setFilter, 1}},
+ {1633, {wxGenericDirCtrl, setFilterIndex, 1}},
+ {1634, {wxGenericDirCtrl, setPath, 1}},
+ {1636, {wxStaticBox, new_4, 4}},
+ {1637, {wxStaticBox, new_0, 0}},
+ {1638, {wxStaticBox, create, 4}},
+ {1639, {wxStaticBox, 'Destroy', undefined}},
+ {1641, {wxStaticLine, new_2, 2}},
+ {1642, {wxStaticLine, new_0, 0}},
+ {1643, {wxStaticLine, create, 2}},
+ {1644, {wxStaticLine, isVertical, 0}},
+ {1645, {wxStaticLine, getDefaultSize, 0}},
+ {1646, {wxStaticLine, 'Destroy', undefined}},
+ {1649, {wxListBox, new_3, 3}},
+ {1650, {wxListBox, new_0, 0}},
+ {1652, {wxListBox, destruct, 0}},
+ {1654, {wxListBox, create, 6}},
+ {1655, {wxListBox, deselect, 1}},
+ {1656, {wxListBox, getSelections, 1}},
+ {1657, {wxListBox, insertItems, 2}},
+ {1658, {wxListBox, isSelected, 1}},
+ {1659, {wxListBox, set, 1}},
+ {1660, {wxListBox, hitTest, 1}},
+ {1661, {wxListBox, setFirstItem_1_0, 1}},
+ {1662, {wxListBox, setFirstItem_1_1, 1}},
+ {1663, {wxListCtrl, new_0, 0}},
+ {1664, {wxListCtrl, new_2, 2}},
+ {1665, {wxListCtrl, arrange, 1}},
+ {1666, {wxListCtrl, assignImageList, 2}},
+ {1667, {wxListCtrl, clearAll, 0}},
+ {1668, {wxListCtrl, create, 2}},
+ {1669, {wxListCtrl, deleteAllItems, 0}},
+ {1670, {wxListCtrl, deleteColumn, 1}},
+ {1671, {wxListCtrl, deleteItem, 1}},
+ {1672, {wxListCtrl, editLabel, 1}},
+ {1673, {wxListCtrl, ensureVisible, 1}},
+ {1674, {wxListCtrl, findItem_3_0, 3}},
+ {1675, {wxListCtrl, findItem_3_1, 3}},
+ {1676, {wxListCtrl, getColumn, 2}},
+ {1677, {wxListCtrl, getColumnCount, 0}},
+ {1678, {wxListCtrl, getColumnWidth, 1}},
+ {1679, {wxListCtrl, getCountPerPage, 0}},
+ {1680, {wxListCtrl, getEditControl, 0}},
+ {1681, {wxListCtrl, getImageList, 1}},
+ {1682, {wxListCtrl, getItem, 1}},
+ {1683, {wxListCtrl, getItemBackgroundColour, 1}},
+ {1684, {wxListCtrl, getItemCount, 0}},
+ {1685, {wxListCtrl, getItemData, 1}},
+ {1686, {wxListCtrl, getItemFont, 1}},
+ {1687, {wxListCtrl, getItemPosition, 2}},
+ {1688, {wxListCtrl, getItemRect, 3}},
+ {1689, {wxListCtrl, getItemSpacing, 0}},
+ {1690, {wxListCtrl, getItemState, 2}},
+ {1691, {wxListCtrl, getItemText, 1}},
+ {1692, {wxListCtrl, getItemTextColour, 1}},
+ {1693, {wxListCtrl, getNextItem, 2}},
+ {1694, {wxListCtrl, getSelectedItemCount, 0}},
+ {1695, {wxListCtrl, getTextColour, 0}},
+ {1696, {wxListCtrl, getTopItem, 0}},
+ {1697, {wxListCtrl, getViewRect, 0}},
+ {1698, {wxListCtrl, hitTest, 2}},
+ {1699, {wxListCtrl, insertColumn_2, 2}},
+ {1700, {wxListCtrl, insertColumn_3, 3}},
+ {1701, {wxListCtrl, insertItem_1, 1}},
+ {1702, {wxListCtrl, insertItem_2_1, 2}},
+ {1703, {wxListCtrl, insertItem_2_0, 2}},
+ {1704, {wxListCtrl, insertItem_3, 3}},
+ {1705, {wxListCtrl, refreshItem, 1}},
+ {1706, {wxListCtrl, refreshItems, 2}},
+ {1707, {wxListCtrl, scrollList, 2}},
+ {1708, {wxListCtrl, setBackgroundColour, 1}},
+ {1709, {wxListCtrl, setColumn, 2}},
+ {1710, {wxListCtrl, setColumnWidth, 2}},
+ {1711, {wxListCtrl, setImageList, 2}},
+ {1712, {wxListCtrl, setItem_1, 1}},
+ {1713, {wxListCtrl, setItem_4, 4}},
+ {1714, {wxListCtrl, setItemBackgroundColour, 2}},
+ {1715, {wxListCtrl, setItemCount, 1}},
+ {1716, {wxListCtrl, setItemData, 2}},
+ {1717, {wxListCtrl, setItemFont, 2}},
+ {1718, {wxListCtrl, setItemImage, 3}},
+ {1719, {wxListCtrl, setItemColumnImage, 3}},
+ {1720, {wxListCtrl, setItemPosition, 2}},
+ {1721, {wxListCtrl, setItemState, 3}},
+ {1722, {wxListCtrl, setItemText, 2}},
+ {1723, {wxListCtrl, setItemTextColour, 2}},
+ {1724, {wxListCtrl, setSingleStyle, 2}},
+ {1725, {wxListCtrl, setTextColour, 1}},
+ {1726, {wxListCtrl, setWindowStyleFlag, 1}},
+ {1727, {wxListCtrl, sortItems, 2}},
+ {1728, {wxListCtrl, 'Destroy', undefined}},
+ {1729, {wxListView, clearColumnImage, 1}},
+ {1730, {wxListView, focus, 1}},
+ {1731, {wxListView, getFirstSelected, 0}},
+ {1732, {wxListView, getFocusedItem, 0}},
+ {1733, {wxListView, getNextSelected, 1}},
+ {1734, {wxListView, isSelected, 1}},
+ {1735, {wxListView, select, 2}},
+ {1736, {wxListView, setColumnImage, 2}},
+ {1737, {wxListItem, new_0, 0}},
+ {1738, {wxListItem, new_1, 1}},
+ {1739, {wxListItem, destruct, 0}},
+ {1740, {wxListItem, clear, 0}},
+ {1741, {wxListItem, getAlign, 0}},
+ {1742, {wxListItem, getBackgroundColour, 0}},
+ {1743, {wxListItem, getColumn, 0}},
+ {1744, {wxListItem, getFont, 0}},
+ {1745, {wxListItem, getId, 0}},
+ {1746, {wxListItem, getImage, 0}},
+ {1747, {wxListItem, getMask, 0}},
+ {1748, {wxListItem, getState, 0}},
+ {1749, {wxListItem, getText, 0}},
+ {1750, {wxListItem, getTextColour, 0}},
+ {1751, {wxListItem, getWidth, 0}},
+ {1752, {wxListItem, setAlign, 1}},
+ {1753, {wxListItem, setBackgroundColour, 1}},
+ {1754, {wxListItem, setColumn, 1}},
+ {1755, {wxListItem, setFont, 1}},
+ {1756, {wxListItem, setId, 1}},
+ {1757, {wxListItem, setImage, 1}},
+ {1758, {wxListItem, setMask, 1}},
+ {1759, {wxListItem, setState, 1}},
+ {1760, {wxListItem, setStateMask, 1}},
+ {1761, {wxListItem, setText, 1}},
+ {1762, {wxListItem, setTextColour, 1}},
+ {1763, {wxListItem, setWidth, 1}},
+ {1764, {wxListItemAttr, new_0, 0}},
+ {1765, {wxListItemAttr, new_3, 3}},
+ {1766, {wxListItemAttr, getBackgroundColour, 0}},
+ {1767, {wxListItemAttr, getFont, 0}},
+ {1768, {wxListItemAttr, getTextColour, 0}},
+ {1769, {wxListItemAttr, hasBackgroundColour, 0}},
+ {1770, {wxListItemAttr, hasFont, 0}},
+ {1771, {wxListItemAttr, hasTextColour, 0}},
+ {1772, {wxListItemAttr, setBackgroundColour, 1}},
+ {1773, {wxListItemAttr, setFont, 1}},
+ {1774, {wxListItemAttr, setTextColour, 1}},
+ {1775, {wxListItemAttr, 'Destroy', undefined}},
+ {1776, {wxImageList, new_0, 0}},
+ {1777, {wxImageList, new_3, 3}},
+ {1778, {wxImageList, add_1, 1}},
+ {1779, {wxImageList, add_2_0, 2}},
+ {1780, {wxImageList, add_2_1, 2}},
+ {1781, {wxImageList, create, 3}},
+ {1783, {wxImageList, draw, 5}},
+ {1784, {wxImageList, getBitmap, 1}},
+ {1785, {wxImageList, getIcon, 1}},
+ {1786, {wxImageList, getImageCount, 0}},
+ {1787, {wxImageList, getSize, 3}},
+ {1788, {wxImageList, remove, 1}},
+ {1789, {wxImageList, removeAll, 0}},
+ {1790, {wxImageList, replace_2, 2}},
+ {1791, {wxImageList, replace_3, 3}},
+ {1792, {wxImageList, 'Destroy', undefined}},
+ {1793, {wxTextAttr, new_0, 0}},
+ {1794, {wxTextAttr, new_2, 2}},
+ {1795, {wxTextAttr, getAlignment, 0}},
+ {1796, {wxTextAttr, getBackgroundColour, 0}},
+ {1797, {wxTextAttr, getFont, 0}},
+ {1798, {wxTextAttr, getLeftIndent, 0}},
+ {1799, {wxTextAttr, getLeftSubIndent, 0}},
+ {1800, {wxTextAttr, getRightIndent, 0}},
+ {1801, {wxTextAttr, getTabs, 0}},
+ {1802, {wxTextAttr, getTextColour, 0}},
+ {1803, {wxTextAttr, hasBackgroundColour, 0}},
+ {1804, {wxTextAttr, hasFont, 0}},
+ {1805, {wxTextAttr, hasTextColour, 0}},
+ {1806, {wxTextAttr, getFlags, 0}},
+ {1807, {wxTextAttr, isDefault, 0}},
+ {1808, {wxTextAttr, setAlignment, 1}},
+ {1809, {wxTextAttr, setBackgroundColour, 1}},
+ {1810, {wxTextAttr, setFlags, 1}},
+ {1811, {wxTextAttr, setFont, 2}},
+ {1812, {wxTextAttr, setLeftIndent, 2}},
+ {1813, {wxTextAttr, setRightIndent, 1}},
+ {1814, {wxTextAttr, setTabs, 1}},
+ {1815, {wxTextAttr, setTextColour, 1}},
+ {1816, {wxTextAttr, 'Destroy', undefined}},
+ {1818, {wxTextCtrl, new_3, 3}},
+ {1819, {wxTextCtrl, new_0, 0}},
+ {1821, {wxTextCtrl, destruct, 0}},
+ {1822, {wxTextCtrl, appendText, 1}},
+ {1823, {wxTextCtrl, canCopy, 0}},
+ {1824, {wxTextCtrl, canCut, 0}},
+ {1825, {wxTextCtrl, canPaste, 0}},
+ {1826, {wxTextCtrl, canRedo, 0}},
+ {1827, {wxTextCtrl, canUndo, 0}},
+ {1828, {wxTextCtrl, clear, 0}},
+ {1829, {wxTextCtrl, copy, 0}},
+ {1830, {wxTextCtrl, create, 3}},
+ {1831, {wxTextCtrl, cut, 0}},
+ {1832, {wxTextCtrl, discardEdits, 0}},
+ {1833, {wxTextCtrl, changeValue, 1}},
+ {1834, {wxTextCtrl, emulateKeyPress, 1}},
+ {1835, {wxTextCtrl, getDefaultStyle, 0}},
+ {1836, {wxTextCtrl, getInsertionPoint, 0}},
+ {1837, {wxTextCtrl, getLastPosition, 0}},
+ {1838, {wxTextCtrl, getLineLength, 1}},
+ {1839, {wxTextCtrl, getLineText, 1}},
+ {1840, {wxTextCtrl, getNumberOfLines, 0}},
+ {1841, {wxTextCtrl, getRange, 2}},
+ {1842, {wxTextCtrl, getSelection, 2}},
+ {1843, {wxTextCtrl, getStringSelection, 0}},
+ {1844, {wxTextCtrl, getStyle, 2}},
+ {1845, {wxTextCtrl, getValue, 0}},
+ {1846, {wxTextCtrl, isEditable, 0}},
+ {1847, {wxTextCtrl, isModified, 0}},
+ {1848, {wxTextCtrl, isMultiLine, 0}},
+ {1849, {wxTextCtrl, isSingleLine, 0}},
+ {1850, {wxTextCtrl, loadFile, 2}},
+ {1851, {wxTextCtrl, markDirty, 0}},
+ {1852, {wxTextCtrl, paste, 0}},
+ {1853, {wxTextCtrl, positionToXY, 3}},
+ {1854, {wxTextCtrl, redo, 0}},
+ {1855, {wxTextCtrl, remove, 2}},
+ {1856, {wxTextCtrl, replace, 3}},
+ {1857, {wxTextCtrl, saveFile, 1}},
+ {1858, {wxTextCtrl, setDefaultStyle, 1}},
+ {1859, {wxTextCtrl, setEditable, 1}},
+ {1860, {wxTextCtrl, setInsertionPoint, 1}},
+ {1861, {wxTextCtrl, setInsertionPointEnd, 0}},
+ {1863, {wxTextCtrl, setMaxLength, 1}},
+ {1864, {wxTextCtrl, setSelection, 2}},
+ {1865, {wxTextCtrl, setStyle, 3}},
+ {1866, {wxTextCtrl, setValue, 1}},
+ {1867, {wxTextCtrl, showPosition, 1}},
+ {1868, {wxTextCtrl, undo, 0}},
+ {1869, {wxTextCtrl, writeText, 1}},
+ {1870, {wxTextCtrl, xYToPosition, 2}},
+ {1873, {wxNotebook, new_0, 0}},
+ {1874, {wxNotebook, new_3, 3}},
+ {1875, {wxNotebook, destruct, 0}},
+ {1876, {wxNotebook, addPage, 3}},
+ {1877, {wxNotebook, advanceSelection, 1}},
+ {1878, {wxNotebook, assignImageList, 1}},
+ {1879, {wxNotebook, create, 3}},
+ {1880, {wxNotebook, deleteAllPages, 0}},
+ {1881, {wxNotebook, deletePage, 1}},
+ {1882, {wxNotebook, removePage, 1}},
+ {1883, {wxNotebook, getCurrentPage, 0}},
+ {1884, {wxNotebook, getImageList, 0}},
+ {1886, {wxNotebook, getPage, 1}},
+ {1887, {wxNotebook, getPageCount, 0}},
+ {1888, {wxNotebook, getPageImage, 1}},
+ {1889, {wxNotebook, getPageText, 1}},
+ {1890, {wxNotebook, getRowCount, 0}},
+ {1891, {wxNotebook, getSelection, 0}},
+ {1892, {wxNotebook, getThemeBackgroundColour, 0}},
+ {1894, {wxNotebook, hitTest, 2}},
+ {1896, {wxNotebook, insertPage, 4}},
+ {1897, {wxNotebook, setImageList, 1}},
+ {1898, {wxNotebook, setPadding, 1}},
+ {1899, {wxNotebook, setPageSize, 1}},
+ {1900, {wxNotebook, setPageImage, 2}},
+ {1901, {wxNotebook, setPageText, 2}},
+ {1902, {wxNotebook, setSelection, 1}},
+ {1903, {wxNotebook, changeSelection, 1}},
+ {1904, {wxChoicebook, new_0, 0}},
+ {1905, {wxChoicebook, new_3, 3}},
+ {1906, {wxChoicebook, addPage, 3}},
+ {1907, {wxChoicebook, advanceSelection, 1}},
+ {1908, {wxChoicebook, assignImageList, 1}},
+ {1909, {wxChoicebook, create, 3}},
+ {1910, {wxChoicebook, deleteAllPages, 0}},
+ {1911, {wxChoicebook, deletePage, 1}},
+ {1912, {wxChoicebook, removePage, 1}},
+ {1913, {wxChoicebook, getCurrentPage, 0}},
+ {1914, {wxChoicebook, getImageList, 0}},
+ {1916, {wxChoicebook, getPage, 1}},
+ {1917, {wxChoicebook, getPageCount, 0}},
+ {1918, {wxChoicebook, getPageImage, 1}},
+ {1919, {wxChoicebook, getPageText, 1}},
+ {1920, {wxChoicebook, getSelection, 0}},
+ {1921, {wxChoicebook, hitTest, 2}},
+ {1922, {wxChoicebook, insertPage, 4}},
+ {1923, {wxChoicebook, setImageList, 1}},
+ {1924, {wxChoicebook, setPageSize, 1}},
+ {1925, {wxChoicebook, setPageImage, 2}},
+ {1926, {wxChoicebook, setPageText, 2}},
+ {1927, {wxChoicebook, setSelection, 1}},
+ {1928, {wxChoicebook, changeSelection, 1}},
+ {1929, {wxChoicebook, 'Destroy', undefined}},
+ {1930, {wxToolbook, new_0, 0}},
+ {1931, {wxToolbook, new_3, 3}},
+ {1932, {wxToolbook, addPage, 3}},
+ {1933, {wxToolbook, advanceSelection, 1}},
+ {1934, {wxToolbook, assignImageList, 1}},
+ {1935, {wxToolbook, create, 3}},
+ {1936, {wxToolbook, deleteAllPages, 0}},
+ {1937, {wxToolbook, deletePage, 1}},
+ {1938, {wxToolbook, removePage, 1}},
+ {1939, {wxToolbook, getCurrentPage, 0}},
+ {1940, {wxToolbook, getImageList, 0}},
+ {1942, {wxToolbook, getPage, 1}},
+ {1943, {wxToolbook, getPageCount, 0}},
+ {1944, {wxToolbook, getPageImage, 1}},
+ {1945, {wxToolbook, getPageText, 1}},
+ {1946, {wxToolbook, getSelection, 0}},
+ {1948, {wxToolbook, hitTest, 2}},
+ {1949, {wxToolbook, insertPage, 4}},
+ {1950, {wxToolbook, setImageList, 1}},
+ {1951, {wxToolbook, setPageSize, 1}},
+ {1952, {wxToolbook, setPageImage, 2}},
+ {1953, {wxToolbook, setPageText, 2}},
+ {1954, {wxToolbook, setSelection, 1}},
+ {1955, {wxToolbook, changeSelection, 1}},
+ {1956, {wxToolbook, 'Destroy', undefined}},
+ {1957, {wxListbook, new_0, 0}},
+ {1958, {wxListbook, new_3, 3}},
+ {1959, {wxListbook, addPage, 3}},
+ {1960, {wxListbook, advanceSelection, 1}},
+ {1961, {wxListbook, assignImageList, 1}},
+ {1962, {wxListbook, create, 3}},
+ {1963, {wxListbook, deleteAllPages, 0}},
+ {1964, {wxListbook, deletePage, 1}},
+ {1965, {wxListbook, removePage, 1}},
+ {1966, {wxListbook, getCurrentPage, 0}},
+ {1967, {wxListbook, getImageList, 0}},
+ {1969, {wxListbook, getPage, 1}},
+ {1970, {wxListbook, getPageCount, 0}},
+ {1971, {wxListbook, getPageImage, 1}},
+ {1972, {wxListbook, getPageText, 1}},
+ {1973, {wxListbook, getSelection, 0}},
+ {1975, {wxListbook, hitTest, 2}},
+ {1976, {wxListbook, insertPage, 4}},
+ {1977, {wxListbook, setImageList, 1}},
+ {1978, {wxListbook, setPageSize, 1}},
+ {1979, {wxListbook, setPageImage, 2}},
+ {1980, {wxListbook, setPageText, 2}},
+ {1981, {wxListbook, setSelection, 1}},
+ {1982, {wxListbook, changeSelection, 1}},
+ {1983, {wxListbook, 'Destroy', undefined}},
+ {1984, {wxTreebook, new_0, 0}},
+ {1985, {wxTreebook, new_3, 3}},
+ {1986, {wxTreebook, addPage, 3}},
+ {1987, {wxTreebook, advanceSelection, 1}},
+ {1988, {wxTreebook, assignImageList, 1}},
+ {1989, {wxTreebook, create, 3}},
+ {1990, {wxTreebook, deleteAllPages, 0}},
+ {1991, {wxTreebook, deletePage, 1}},
+ {1992, {wxTreebook, removePage, 1}},
+ {1993, {wxTreebook, getCurrentPage, 0}},
+ {1994, {wxTreebook, getImageList, 0}},
+ {1996, {wxTreebook, getPage, 1}},
+ {1997, {wxTreebook, getPageCount, 0}},
+ {1998, {wxTreebook, getPageImage, 1}},
+ {1999, {wxTreebook, getPageText, 1}},
+ {2000, {wxTreebook, getSelection, 0}},
+ {2001, {wxTreebook, expandNode, 2}},
+ {2002, {wxTreebook, isNodeExpanded, 1}},
+ {2004, {wxTreebook, hitTest, 2}},
+ {2005, {wxTreebook, insertPage, 4}},
+ {2006, {wxTreebook, insertSubPage, 4}},
+ {2007, {wxTreebook, setImageList, 1}},
+ {2008, {wxTreebook, setPageSize, 1}},
+ {2009, {wxTreebook, setPageImage, 2}},
+ {2010, {wxTreebook, setPageText, 2}},
+ {2011, {wxTreebook, setSelection, 1}},
+ {2012, {wxTreebook, changeSelection, 1}},
+ {2013, {wxTreebook, 'Destroy', undefined}},
+ {2016, {wxTreeCtrl, new_2, 2}},
+ {2017, {wxTreeCtrl, new_0, 0}},
+ {2019, {wxTreeCtrl, destruct, 0}},
+ {2020, {wxTreeCtrl, addRoot, 2}},
+ {2021, {wxTreeCtrl, appendItem, 3}},
+ {2022, {wxTreeCtrl, assignImageList, 1}},
+ {2023, {wxTreeCtrl, assignStateImageList, 1}},
+ {2024, {wxTreeCtrl, collapse, 1}},
+ {2025, {wxTreeCtrl, collapseAndReset, 1}},
+ {2026, {wxTreeCtrl, create, 2}},
+ {2027, {wxTreeCtrl, delete, 1}},
+ {2028, {wxTreeCtrl, deleteAllItems, 0}},
+ {2029, {wxTreeCtrl, deleteChildren, 1}},
+ {2030, {wxTreeCtrl, editLabel, 1}},
+ {2031, {wxTreeCtrl, ensureVisible, 1}},
+ {2032, {wxTreeCtrl, expand, 1}},
+ {2033, {wxTreeCtrl, getBoundingRect, 3}},
+ {2035, {wxTreeCtrl, getChildrenCount, 2}},
+ {2036, {wxTreeCtrl, getCount, 0}},
+ {2037, {wxTreeCtrl, getEditControl, 0}},
+ {2038, {wxTreeCtrl, getFirstChild, 2}},
+ {2039, {wxTreeCtrl, getNextChild, 2}},
+ {2040, {wxTreeCtrl, getFirstVisibleItem, 0}},
+ {2041, {wxTreeCtrl, getImageList, 0}},
+ {2042, {wxTreeCtrl, getIndent, 0}},
+ {2043, {wxTreeCtrl, getItemBackgroundColour, 1}},
+ {2044, {wxTreeCtrl, getItemData, 1}},
+ {2045, {wxTreeCtrl, getItemFont, 1}},
+ {2046, {wxTreeCtrl, getItemImage_1, 1}},
+ {2047, {wxTreeCtrl, getItemImage_2, 2}},
+ {2048, {wxTreeCtrl, getItemText, 1}},
+ {2049, {wxTreeCtrl, getItemTextColour, 1}},
+ {2050, {wxTreeCtrl, getLastChild, 1}},
+ {2051, {wxTreeCtrl, getNextSibling, 1}},
+ {2052, {wxTreeCtrl, getNextVisible, 1}},
+ {2053, {wxTreeCtrl, getItemParent, 1}},
+ {2054, {wxTreeCtrl, getPrevSibling, 1}},
+ {2055, {wxTreeCtrl, getPrevVisible, 1}},
+ {2056, {wxTreeCtrl, getRootItem, 0}},
+ {2057, {wxTreeCtrl, getSelection, 0}},
+ {2058, {wxTreeCtrl, getSelections, 1}},
+ {2059, {wxTreeCtrl, getStateImageList, 0}},
+ {2060, {wxTreeCtrl, hitTest, 2}},
+ {2062, {wxTreeCtrl, insertItem, 4}},
+ {2063, {wxTreeCtrl, isBold, 1}},
+ {2064, {wxTreeCtrl, isExpanded, 1}},
+ {2065, {wxTreeCtrl, isSelected, 1}},
+ {2066, {wxTreeCtrl, isVisible, 1}},
+ {2067, {wxTreeCtrl, itemHasChildren, 1}},
+ {2068, {wxTreeCtrl, isTreeItemIdOk, 1}},
+ {2069, {wxTreeCtrl, prependItem, 3}},
+ {2070, {wxTreeCtrl, scrollTo, 1}},
+ {2071, {wxTreeCtrl, selectItem_1, 1}},
+ {2072, {wxTreeCtrl, selectItem_2, 2}},
+ {2073, {wxTreeCtrl, setIndent, 1}},
+ {2074, {wxTreeCtrl, setImageList, 1}},
+ {2075, {wxTreeCtrl, setItemBackgroundColour, 2}},
+ {2076, {wxTreeCtrl, setItemBold, 2}},
+ {2077, {wxTreeCtrl, setItemData, 2}},
+ {2078, {wxTreeCtrl, setItemDropHighlight, 2}},
+ {2079, {wxTreeCtrl, setItemFont, 2}},
+ {2080, {wxTreeCtrl, setItemHasChildren, 2}},
+ {2081, {wxTreeCtrl, setItemImage_2, 2}},
+ {2082, {wxTreeCtrl, setItemImage_3, 3}},
+ {2083, {wxTreeCtrl, setItemText, 2}},
+ {2084, {wxTreeCtrl, setItemTextColour, 2}},
+ {2085, {wxTreeCtrl, setStateImageList, 1}},
+ {2086, {wxTreeCtrl, setWindowStyle, 1}},
+ {2087, {wxTreeCtrl, sortChildren, 1}},
+ {2088, {wxTreeCtrl, toggle, 1}},
+ {2089, {wxTreeCtrl, toggleItemSelection, 1}},
+ {2090, {wxTreeCtrl, unselect, 0}},
+ {2091, {wxTreeCtrl, unselectAll, 0}},
+ {2092, {wxTreeCtrl, unselectItem, 1}},
+ {2093, {wxScrollBar, new_0, 0}},
+ {2094, {wxScrollBar, new_3, 3}},
+ {2095, {wxScrollBar, destruct, 0}},
+ {2096, {wxScrollBar, create, 3}},
+ {2097, {wxScrollBar, getRange, 0}},
+ {2098, {wxScrollBar, getPageSize, 0}},
+ {2099, {wxScrollBar, getThumbPosition, 0}},
+ {2100, {wxScrollBar, getThumbSize, 0}},
+ {2101, {wxScrollBar, setThumbPosition, 1}},
+ {2102, {wxScrollBar, setScrollbar, 5}},
+ {2104, {wxSpinButton, new_2, 2}},
+ {2105, {wxSpinButton, new_0, 0}},
+ {2106, {wxSpinButton, create, 2}},
+ {2107, {wxSpinButton, getMax, 0}},
+ {2108, {wxSpinButton, getMin, 0}},
+ {2109, {wxSpinButton, getValue, 0}},
+ {2110, {wxSpinButton, setRange, 2}},
+ {2111, {wxSpinButton, setValue, 1}},
+ {2112, {wxSpinButton, 'Destroy', undefined}},
+ {2113, {wxSpinCtrl, new_0, 0}},
+ {2114, {wxSpinCtrl, new_2, 2}},
+ {2116, {wxSpinCtrl, create, 2}},
+ {2119, {wxSpinCtrl, setValue_1_1, 1}},
+ {2120, {wxSpinCtrl, setValue_1_0, 1}},
+ {2122, {wxSpinCtrl, getValue, 0}},
+ {2124, {wxSpinCtrl, setRange, 2}},
+ {2125, {wxSpinCtrl, setSelection, 2}},
+ {2127, {wxSpinCtrl, getMin, 0}},
+ {2129, {wxSpinCtrl, getMax, 0}},
+ {2130, {wxSpinCtrl, 'Destroy', undefined}},
+ {2131, {wxStaticText, new_0, 0}},
+ {2132, {wxStaticText, new_4, 4}},
+ {2133, {wxStaticText, create, 4}},
+ {2134, {wxStaticText, getLabel, 0}},
+ {2135, {wxStaticText, setLabel, 1}},
+ {2136, {wxStaticText, wrap, 1}},
+ {2137, {wxStaticText, 'Destroy', undefined}},
+ {2138, {wxStaticBitmap, new_0, 0}},
+ {2139, {wxStaticBitmap, new_4, 4}},
+ {2140, {wxStaticBitmap, create, 4}},
+ {2141, {wxStaticBitmap, getBitmap, 0}},
+ {2142, {wxStaticBitmap, setBitmap, 1}},
+ {2143, {wxStaticBitmap, 'Destroy', undefined}},
+ {2144, {wxRadioBox, new, 7}},
+ {2146, {wxRadioBox, destruct, 0}},
+ {2147, {wxRadioBox, create, 7}},
+ {2148, {wxRadioBox, enable_2, 2}},
+ {2149, {wxRadioBox, enable_1, 1}},
+ {2150, {wxRadioBox, getSelection, 0}},
+ {2151, {wxRadioBox, getString, 1}},
+ {2152, {wxRadioBox, setSelection, 1}},
+ {2153, {wxRadioBox, show_2, 2}},
+ {2154, {wxRadioBox, show_1, 1}},
+ {2155, {wxRadioBox, getColumnCount, 0}},
+ {2156, {wxRadioBox, getItemHelpText, 1}},
+ {2157, {wxRadioBox, getItemToolTip, 1}},
+ {2159, {wxRadioBox, getItemFromPoint, 1}},
+ {2160, {wxRadioBox, getRowCount, 0}},
+ {2161, {wxRadioBox, isItemEnabled, 1}},
+ {2162, {wxRadioBox, isItemShown, 1}},
+ {2163, {wxRadioBox, setItemHelpText, 2}},
+ {2164, {wxRadioBox, setItemToolTip, 2}},
+ {2165, {wxRadioButton, new_0, 0}},
+ {2166, {wxRadioButton, new_4, 4}},
+ {2167, {wxRadioButton, create, 4}},
+ {2168, {wxRadioButton, getValue, 0}},
+ {2169, {wxRadioButton, setValue, 1}},
+ {2170, {wxRadioButton, 'Destroy', undefined}},
+ {2172, {wxSlider, new_6, 6}},
+ {2173, {wxSlider, new_0, 0}},
+ {2174, {wxSlider, create, 6}},
+ {2175, {wxSlider, getLineSize, 0}},
+ {2176, {wxSlider, getMax, 0}},
+ {2177, {wxSlider, getMin, 0}},
+ {2178, {wxSlider, getPageSize, 0}},
+ {2179, {wxSlider, getThumbLength, 0}},
+ {2180, {wxSlider, getValue, 0}},
+ {2181, {wxSlider, setLineSize, 1}},
+ {2182, {wxSlider, setPageSize, 1}},
+ {2183, {wxSlider, setRange, 2}},
+ {2184, {wxSlider, setThumbLength, 1}},
+ {2185, {wxSlider, setValue, 1}},
+ {2186, {wxSlider, 'Destroy', undefined}},
+ {2188, {wxDialog, new_4, 4}},
+ {2189, {wxDialog, new_0, 0}},
+ {2191, {wxDialog, destruct, 0}},
+ {2192, {wxDialog, create, 4}},
+ {2193, {wxDialog, createButtonSizer, 1}},
+ {2194, {wxDialog, createStdDialogButtonSizer, 1}},
+ {2195, {wxDialog, endModal, 1}},
+ {2196, {wxDialog, getAffirmativeId, 0}},
+ {2197, {wxDialog, getReturnCode, 0}},
+ {2198, {wxDialog, isModal, 0}},
+ {2199, {wxDialog, setAffirmativeId, 1}},
+ {2200, {wxDialog, setReturnCode, 1}},
+ {2201, {wxDialog, show, 1}},
+ {2202, {wxDialog, showModal, 0}},
+ {2203, {wxColourDialog, new_0, 0}},
+ {2204, {wxColourDialog, new_2, 2}},
+ {2205, {wxColourDialog, destruct, 0}},
+ {2206, {wxColourDialog, create, 2}},
+ {2207, {wxColourDialog, getColourData, 0}},
+ {2208, {wxColourData, new_0, 0}},
+ {2209, {wxColourData, new_1, 1}},
+ {2210, {wxColourData, destruct, 0}},
+ {2211, {wxColourData, getChooseFull, 0}},
+ {2212, {wxColourData, getColour, 0}},
+ {2214, {wxColourData, getCustomColour, 1}},
+ {2215, {wxColourData, setChooseFull, 1}},
+ {2216, {wxColourData, setColour, 1}},
+ {2217, {wxColourData, setCustomColour, 2}},
+ {2218, {wxPalette, new_0, 0}},
+ {2219, {wxPalette, new_4, 4}},
+ {2221, {wxPalette, destruct, 0}},
+ {2222, {wxPalette, create, 4}},
+ {2223, {wxPalette, getColoursCount, 0}},
+ {2224, {wxPalette, getPixel, 3}},
+ {2225, {wxPalette, getRGB, 4}},
+ {2226, {wxPalette, isOk, 0}},
+ {2230, {wxDirDialog, new, 2}},
+ {2231, {wxDirDialog, destruct, 0}},
+ {2232, {wxDirDialog, getPath, 0}},
+ {2233, {wxDirDialog, getMessage, 0}},
+ {2234, {wxDirDialog, setMessage, 1}},
+ {2235, {wxDirDialog, setPath, 1}},
+ {2239, {wxFileDialog, new, 2}},
+ {2240, {wxFileDialog, destruct, 0}},
+ {2241, {wxFileDialog, getDirectory, 0}},
+ {2242, {wxFileDialog, getFilename, 0}},
+ {2243, {wxFileDialog, getFilenames, 1}},
+ {2244, {wxFileDialog, getFilterIndex, 0}},
+ {2245, {wxFileDialog, getMessage, 0}},
+ {2246, {wxFileDialog, getPath, 0}},
+ {2247, {wxFileDialog, getPaths, 1}},
+ {2248, {wxFileDialog, getWildcard, 0}},
+ {2249, {wxFileDialog, setDirectory, 1}},
+ {2250, {wxFileDialog, setFilename, 1}},
+ {2251, {wxFileDialog, setFilterIndex, 1}},
+ {2252, {wxFileDialog, setMessage, 1}},
+ {2253, {wxFileDialog, setPath, 1}},
+ {2254, {wxFileDialog, setWildcard, 1}},
+ {2255, {wxPickerBase, setInternalMargin, 1}},
+ {2256, {wxPickerBase, getInternalMargin, 0}},
+ {2257, {wxPickerBase, setTextCtrlProportion, 1}},
+ {2258, {wxPickerBase, setPickerCtrlProportion, 1}},
+ {2259, {wxPickerBase, getTextCtrlProportion, 0}},
+ {2260, {wxPickerBase, getPickerCtrlProportion, 0}},
+ {2261, {wxPickerBase, hasTextCtrl, 0}},
+ {2262, {wxPickerBase, getTextCtrl, 0}},
+ {2263, {wxPickerBase, isTextCtrlGrowable, 0}},
+ {2264, {wxPickerBase, setPickerCtrlGrowable, 1}},
+ {2265, {wxPickerBase, setTextCtrlGrowable, 1}},
+ {2266, {wxPickerBase, isPickerCtrlGrowable, 0}},
+ {2267, {wxFilePickerCtrl, new_0, 0}},
+ {2268, {wxFilePickerCtrl, new_3, 3}},
+ {2269, {wxFilePickerCtrl, create, 3}},
+ {2270, {wxFilePickerCtrl, getPath, 0}},
+ {2271, {wxFilePickerCtrl, setPath, 1}},
+ {2272, {wxFilePickerCtrl, 'Destroy', undefined}},
+ {2273, {wxDirPickerCtrl, new_0, 0}},
+ {2274, {wxDirPickerCtrl, new_3, 3}},
+ {2275, {wxDirPickerCtrl, create, 3}},
+ {2276, {wxDirPickerCtrl, getPath, 0}},
+ {2277, {wxDirPickerCtrl, setPath, 1}},
+ {2278, {wxDirPickerCtrl, 'Destroy', undefined}},
+ {2279, {wxColourPickerCtrl, new_0, 0}},
+ {2280, {wxColourPickerCtrl, new_3, 3}},
+ {2281, {wxColourPickerCtrl, create, 3}},
+ {2282, {wxColourPickerCtrl, getColour, 0}},
+ {2283, {wxColourPickerCtrl, setColour_1_1, 1}},
+ {2284, {wxColourPickerCtrl, setColour_1_0, 1}},
+ {2285, {wxColourPickerCtrl, 'Destroy', undefined}},
+ {2286, {wxDatePickerCtrl, new_0, 0}},
+ {2287, {wxDatePickerCtrl, new_3, 3}},
+ {2288, {wxDatePickerCtrl, getRange, 2}},
+ {2289, {wxDatePickerCtrl, getValue, 0}},
+ {2290, {wxDatePickerCtrl, setRange, 2}},
+ {2291, {wxDatePickerCtrl, setValue, 1}},
+ {2292, {wxDatePickerCtrl, 'Destroy', undefined}},
+ {2293, {wxFontPickerCtrl, new_0, 0}},
+ {2294, {wxFontPickerCtrl, new_3, 3}},
+ {2295, {wxFontPickerCtrl, create, 3}},
+ {2296, {wxFontPickerCtrl, getSelectedFont, 0}},
+ {2297, {wxFontPickerCtrl, setSelectedFont, 1}},
+ {2298, {wxFontPickerCtrl, getMaxPointSize, 0}},
+ {2299, {wxFontPickerCtrl, setMaxPointSize, 1}},
+ {2300, {wxFontPickerCtrl, 'Destroy', undefined}},
+ {2303, {wxFindReplaceDialog, new_0, 0}},
+ {2304, {wxFindReplaceDialog, new_4, 4}},
+ {2305, {wxFindReplaceDialog, destruct, 0}},
+ {2306, {wxFindReplaceDialog, create, 4}},
+ {2307, {wxFindReplaceDialog, getData, 0}},
+ {2308, {wxFindReplaceData, new_0, 0}},
+ {2309, {wxFindReplaceData, new_1, 1}},
+ {2310, {wxFindReplaceData, getFindString, 0}},
+ {2311, {wxFindReplaceData, getReplaceString, 0}},
+ {2312, {wxFindReplaceData, getFlags, 0}},
+ {2313, {wxFindReplaceData, setFlags, 1}},
+ {2314, {wxFindReplaceData, setFindString, 1}},
+ {2315, {wxFindReplaceData, setReplaceString, 1}},
+ {2316, {wxFindReplaceData, 'Destroy', undefined}},
+ {2317, {wxMultiChoiceDialog, new_0, 0}},
+ {2319, {wxMultiChoiceDialog, new_5, 5}},
+ {2320, {wxMultiChoiceDialog, getSelections, 0}},
+ {2321, {wxMultiChoiceDialog, setSelections, 1}},
+ {2322, {wxMultiChoiceDialog, 'Destroy', undefined}},
+ {2323, {wxSingleChoiceDialog, new_0, 0}},
+ {2325, {wxSingleChoiceDialog, new_5, 5}},
+ {2326, {wxSingleChoiceDialog, getSelection, 0}},
+ {2327, {wxSingleChoiceDialog, getStringSelection, 0}},
+ {2328, {wxSingleChoiceDialog, setSelection, 1}},
+ {2329, {wxSingleChoiceDialog, 'Destroy', undefined}},
+ {2330, {wxTextEntryDialog, new, 3}},
+ {2331, {wxTextEntryDialog, getValue, 0}},
+ {2332, {wxTextEntryDialog, setValue, 1}},
+ {2333, {wxTextEntryDialog, 'Destroy', undefined}},
+ {2334, {wxPasswordEntryDialog, new, 3}},
+ {2335, {wxPasswordEntryDialog, 'Destroy', undefined}},
+ {2336, {wxFontData, new_0, 0}},
+ {2337, {wxFontData, new_1, 1}},
+ {2338, {wxFontData, destruct, 0}},
+ {2339, {wxFontData, enableEffects, 1}},
+ {2340, {wxFontData, getAllowSymbols, 0}},
+ {2341, {wxFontData, getColour, 0}},
+ {2342, {wxFontData, getChosenFont, 0}},
+ {2343, {wxFontData, getEnableEffects, 0}},
+ {2344, {wxFontData, getInitialFont, 0}},
+ {2345, {wxFontData, getShowHelp, 0}},
+ {2346, {wxFontData, setAllowSymbols, 1}},
+ {2347, {wxFontData, setChosenFont, 1}},
+ {2348, {wxFontData, setColour, 1}},
+ {2349, {wxFontData, setInitialFont, 1}},
+ {2350, {wxFontData, setRange, 2}},
+ {2351, {wxFontData, setShowHelp, 1}},
+ {2355, {wxFontDialog, new_0, 0}},
+ {2357, {wxFontDialog, new_2, 2}},
+ {2359, {wxFontDialog, create, 2}},
+ {2360, {wxFontDialog, getFontData, 0}},
+ {2362, {wxFontDialog, 'Destroy', undefined}},
+ {2363, {wxProgressDialog, new, 3}},
+ {2364, {wxProgressDialog, destruct, 0}},
+ {2365, {wxProgressDialog, resume, 0}},
+ {2366, {wxProgressDialog, update_2, 2}},
+ {2367, {wxProgressDialog, update_0, 0}},
+ {2368, {wxMessageDialog, new, 3}},
+ {2369, {wxMessageDialog, destruct, 0}},
+ {2370, {wxPageSetupDialog, new, 2}},
+ {2371, {wxPageSetupDialog, destruct, 0}},
+ {2372, {wxPageSetupDialog, getPageSetupData, 0}},
+ {2373, {wxPageSetupDialog, showModal, 0}},
+ {2374, {wxPageSetupDialogData, new_0, 0}},
+ {2375, {wxPageSetupDialogData, new_1_0, 1}},
+ {2376, {wxPageSetupDialogData, new_1_1, 1}},
+ {2377, {wxPageSetupDialogData, destruct, 0}},
+ {2378, {wxPageSetupDialogData, enableHelp, 1}},
+ {2379, {wxPageSetupDialogData, enableMargins, 1}},
+ {2380, {wxPageSetupDialogData, enableOrientation, 1}},
+ {2381, {wxPageSetupDialogData, enablePaper, 1}},
+ {2382, {wxPageSetupDialogData, enablePrinter, 1}},
+ {2383, {wxPageSetupDialogData, getDefaultMinMargins, 0}},
+ {2384, {wxPageSetupDialogData, getEnableMargins, 0}},
+ {2385, {wxPageSetupDialogData, getEnableOrientation, 0}},
+ {2386, {wxPageSetupDialogData, getEnablePaper, 0}},
+ {2387, {wxPageSetupDialogData, getEnablePrinter, 0}},
+ {2388, {wxPageSetupDialogData, getEnableHelp, 0}},
+ {2389, {wxPageSetupDialogData, getDefaultInfo, 0}},
+ {2390, {wxPageSetupDialogData, getMarginTopLeft, 0}},
+ {2391, {wxPageSetupDialogData, getMarginBottomRight, 0}},
+ {2392, {wxPageSetupDialogData, getMinMarginTopLeft, 0}},
+ {2393, {wxPageSetupDialogData, getMinMarginBottomRight, 0}},
+ {2394, {wxPageSetupDialogData, getPaperId, 0}},
+ {2395, {wxPageSetupDialogData, getPaperSize, 0}},
+ {2397, {wxPageSetupDialogData, getPrintData, 0}},
+ {2398, {wxPageSetupDialogData, isOk, 0}},
+ {2399, {wxPageSetupDialogData, setDefaultInfo, 1}},
+ {2400, {wxPageSetupDialogData, setDefaultMinMargins, 1}},
+ {2401, {wxPageSetupDialogData, setMarginTopLeft, 1}},
+ {2402, {wxPageSetupDialogData, setMarginBottomRight, 1}},
+ {2403, {wxPageSetupDialogData, setMinMarginTopLeft, 1}},
+ {2404, {wxPageSetupDialogData, setMinMarginBottomRight, 1}},
+ {2405, {wxPageSetupDialogData, setPaperId, 1}},
+ {2406, {wxPageSetupDialogData, setPaperSize_1_1, 1}},
+ {2407, {wxPageSetupDialogData, setPaperSize_1_0, 1}},
+ {2408, {wxPageSetupDialogData, setPrintData, 1}},
+ {2409, {wxPrintDialog, new_2_0, 2}},
+ {2410, {wxPrintDialog, new_2_1, 2}},
+ {2411, {wxPrintDialog, destruct, 0}},
+ {2412, {wxPrintDialog, getPrintDialogData, 0}},
+ {2413, {wxPrintDialog, getPrintDC, 0}},
+ {2414, {wxPrintDialogData, new_0, 0}},
+ {2415, {wxPrintDialogData, new_1_1, 1}},
+ {2416, {wxPrintDialogData, new_1_0, 1}},
+ {2417, {wxPrintDialogData, destruct, 0}},
+ {2418, {wxPrintDialogData, enableHelp, 1}},
+ {2419, {wxPrintDialogData, enablePageNumbers, 1}},
+ {2420, {wxPrintDialogData, enablePrintToFile, 1}},
+ {2421, {wxPrintDialogData, enableSelection, 1}},
+ {2422, {wxPrintDialogData, getAllPages, 0}},
+ {2423, {wxPrintDialogData, getCollate, 0}},
+ {2424, {wxPrintDialogData, getFromPage, 0}},
+ {2425, {wxPrintDialogData, getMaxPage, 0}},
+ {2426, {wxPrintDialogData, getMinPage, 0}},
+ {2427, {wxPrintDialogData, getNoCopies, 0}},
+ {2428, {wxPrintDialogData, getPrintData, 0}},
+ {2429, {wxPrintDialogData, getPrintToFile, 0}},
+ {2430, {wxPrintDialogData, getSelection, 0}},
+ {2431, {wxPrintDialogData, getToPage, 0}},
+ {2432, {wxPrintDialogData, isOk, 0}},
+ {2433, {wxPrintDialogData, setCollate, 1}},
+ {2434, {wxPrintDialogData, setFromPage, 1}},
+ {2435, {wxPrintDialogData, setMaxPage, 1}},
+ {2436, {wxPrintDialogData, setMinPage, 1}},
+ {2437, {wxPrintDialogData, setNoCopies, 1}},
+ {2438, {wxPrintDialogData, setPrintData, 1}},
+ {2439, {wxPrintDialogData, setPrintToFile, 1}},
+ {2440, {wxPrintDialogData, setSelection, 1}},
+ {2441, {wxPrintDialogData, setToPage, 1}},
+ {2442, {wxPrintData, new_0, 0}},
+ {2443, {wxPrintData, new_1, 1}},
+ {2444, {wxPrintData, destruct, 0}},
+ {2445, {wxPrintData, getCollate, 0}},
+ {2446, {wxPrintData, getBin, 0}},
+ {2447, {wxPrintData, getColour, 0}},
+ {2448, {wxPrintData, getDuplex, 0}},
+ {2449, {wxPrintData, getNoCopies, 0}},
+ {2450, {wxPrintData, getOrientation, 0}},
+ {2451, {wxPrintData, getPaperId, 0}},
+ {2452, {wxPrintData, getPrinterName, 0}},
+ {2453, {wxPrintData, getQuality, 0}},
+ {2454, {wxPrintData, isOk, 0}},
+ {2455, {wxPrintData, setBin, 1}},
+ {2456, {wxPrintData, setCollate, 1}},
+ {2457, {wxPrintData, setColour, 1}},
+ {2458, {wxPrintData, setDuplex, 1}},
+ {2459, {wxPrintData, setNoCopies, 1}},
+ {2460, {wxPrintData, setOrientation, 1}},
+ {2461, {wxPrintData, setPaperId, 1}},
+ {2462, {wxPrintData, setPrinterName, 1}},
+ {2463, {wxPrintData, setQuality, 1}},
+ {2466, {wxPrintPreview, new_2, 2}},
+ {2467, {wxPrintPreview, new_3, 3}},
+ {2469, {wxPrintPreview, destruct, 0}},
+ {2470, {wxPrintPreview, getCanvas, 0}},
+ {2471, {wxPrintPreview, getCurrentPage, 0}},
+ {2472, {wxPrintPreview, getFrame, 0}},
+ {2473, {wxPrintPreview, getMaxPage, 0}},
+ {2474, {wxPrintPreview, getMinPage, 0}},
+ {2475, {wxPrintPreview, getPrintout, 0}},
+ {2476, {wxPrintPreview, getPrintoutForPrinting, 0}},
+ {2477, {wxPrintPreview, isOk, 0}},
+ {2478, {wxPrintPreview, paintPage, 2}},
+ {2479, {wxPrintPreview, print, 1}},
+ {2480, {wxPrintPreview, renderPage, 1}},
+ {2481, {wxPrintPreview, setCanvas, 1}},
+ {2482, {wxPrintPreview, setCurrentPage, 1}},
+ {2483, {wxPrintPreview, setFrame, 1}},
+ {2484, {wxPrintPreview, setPrintout, 1}},
+ {2485, {wxPrintPreview, setZoom, 1}},
+ {2486, {wxPreviewFrame, new, 3}},
+ {2487, {wxPreviewFrame, destruct, 0}},
+ {2488, {wxPreviewFrame, createControlBar, 0}},
+ {2489, {wxPreviewFrame, createCanvas, 0}},
+ {2490, {wxPreviewFrame, initialize, 0}},
+ {2491, {wxPreviewFrame, onCloseWindow, 1}},
+ {2492, {wxPreviewControlBar, new, 4}},
+ {2493, {wxPreviewControlBar, destruct, 0}},
+ {2494, {wxPreviewControlBar, createButtons, 0}},
+ {2495, {wxPreviewControlBar, getPrintPreview, 0}},
+ {2496, {wxPreviewControlBar, getZoomControl, 0}},
+ {2497, {wxPreviewControlBar, setZoomControl, 1}},
+ {2499, {wxPrinter, new, 1}},
+ {2500, {wxPrinter, createAbortWindow, 2}},
+ {2501, {wxPrinter, getAbort, 0}},
+ {2502, {wxPrinter, getLastError, 0}},
+ {2503, {wxPrinter, getPrintDialogData, 0}},
+ {2504, {wxPrinter, print, 3}},
+ {2505, {wxPrinter, printDialog, 1}},
+ {2506, {wxPrinter, reportError, 3}},
+ {2507, {wxPrinter, setup, 1}},
+ {2508, {wxPrinter, 'Destroy', undefined}},
+ {2509, {wxXmlResource, new_1, 1}},
+ {2510, {wxXmlResource, new_2, 2}},
+ {2511, {wxXmlResource, destruct, 0}},
+ {2512, {wxXmlResource, attachUnknownControl, 3}},
+ {2513, {wxXmlResource, clearHandlers, 0}},
+ {2514, {wxXmlResource, compareVersion, 4}},
+ {2515, {wxXmlResource, get, 0}},
+ {2516, {wxXmlResource, getFlags, 0}},
+ {2517, {wxXmlResource, getVersion, 0}},
+ {2518, {wxXmlResource, getXRCID, 2}},
+ {2519, {wxXmlResource, initAllHandlers, 0}},
+ {2520, {wxXmlResource, load, 1}},
+ {2521, {wxXmlResource, loadBitmap, 1}},
+ {2522, {wxXmlResource, loadDialog_2, 2}},
+ {2523, {wxXmlResource, loadDialog_3, 3}},
+ {2524, {wxXmlResource, loadFrame_2, 2}},
+ {2525, {wxXmlResource, loadFrame_3, 3}},
+ {2526, {wxXmlResource, loadIcon, 1}},
+ {2527, {wxXmlResource, loadMenu, 1}},
+ {2528, {wxXmlResource, loadMenuBar_2, 2}},
+ {2529, {wxXmlResource, loadMenuBar_1, 1}},
+ {2530, {wxXmlResource, loadPanel_2, 2}},
+ {2531, {wxXmlResource, loadPanel_3, 3}},
+ {2532, {wxXmlResource, loadToolBar, 2}},
+ {2533, {wxXmlResource, set, 1}},
+ {2534, {wxXmlResource, setFlags, 1}},
+ {2535, {wxXmlResource, unload, 1}},
+ {2536, {wxXmlResource, xrcctrl, 3}},
+ {2537, {wxHtmlEasyPrinting, new, 1}},
+ {2538, {wxHtmlEasyPrinting, destruct, 0}},
+ {2539, {wxHtmlEasyPrinting, getPrintData, 0}},
+ {2540, {wxHtmlEasyPrinting, getPageSetupData, 0}},
+ {2541, {wxHtmlEasyPrinting, previewFile, 1}},
+ {2542, {wxHtmlEasyPrinting, previewText, 2}},
+ {2543, {wxHtmlEasyPrinting, printFile, 1}},
+ {2544, {wxHtmlEasyPrinting, printText, 2}},
+ {2545, {wxHtmlEasyPrinting, pageSetup, 0}},
+ {2546, {wxHtmlEasyPrinting, setFonts, 3}},
+ {2547, {wxHtmlEasyPrinting, setHeader, 2}},
+ {2548, {wxHtmlEasyPrinting, setFooter, 2}},
+ {2550, {wxGLCanvas, new_2, 2}},
+ {2551, {wxGLCanvas, new_3_1, 3}},
+ {2552, {wxGLCanvas, new_3_0, 3}},
+ {2553, {wxGLCanvas, getContext, 0}},
+ {2555, {wxGLCanvas, setCurrent, 0}},
+ {2556, {wxGLCanvas, swapBuffers, 0}},
+ {2557, {wxGLCanvas, 'Destroy', undefined}},
+ {2558, {wxAuiManager, new, 1}},
+ {2559, {wxAuiManager, destruct, 0}},
+ {2560, {wxAuiManager, addPane_2_1, 2}},
+ {2561, {wxAuiManager, addPane_3, 3}},
+ {2562, {wxAuiManager, addPane_2_0, 2}},
+ {2563, {wxAuiManager, detachPane, 1}},
+ {2564, {wxAuiManager, getAllPanes, 0}},
+ {2565, {wxAuiManager, getArtProvider, 0}},
+ {2566, {wxAuiManager, getDockSizeConstraint, 2}},
+ {2567, {wxAuiManager, getFlags, 0}},
+ {2568, {wxAuiManager, getManagedWindow, 0}},
+ {2569, {wxAuiManager, getManager, 1}},
+ {2570, {wxAuiManager, getPane_1_1, 1}},
+ {2571, {wxAuiManager, getPane_1_0, 1}},
+ {2572, {wxAuiManager, hideHint, 0}},
+ {2573, {wxAuiManager, insertPane, 3}},
+ {2574, {wxAuiManager, loadPaneInfo, 2}},
+ {2575, {wxAuiManager, loadPerspective, 2}},
+ {2576, {wxAuiManager, savePaneInfo, 1}},
+ {2577, {wxAuiManager, savePerspective, 0}},
+ {2578, {wxAuiManager, setArtProvider, 1}},
+ {2579, {wxAuiManager, setDockSizeConstraint, 2}},
+ {2580, {wxAuiManager, setFlags, 1}},
+ {2581, {wxAuiManager, setManagedWindow, 1}},
+ {2582, {wxAuiManager, showHint, 1}},
+ {2583, {wxAuiManager, unInit, 0}},
+ {2584, {wxAuiManager, update, 0}},
+ {2585, {wxAuiPaneInfo, new_0, 0}},
+ {2586, {wxAuiPaneInfo, new_1, 1}},
+ {2587, {wxAuiPaneInfo, destruct, 0}},
+ {2588, {wxAuiPaneInfo, bestSize_1, 1}},
+ {2589, {wxAuiPaneInfo, bestSize_2, 2}},
+ {2590, {wxAuiPaneInfo, bottom, 0}},
+ {2591, {wxAuiPaneInfo, bottomDockable, 1}},
+ {2592, {wxAuiPaneInfo, caption, 1}},
+ {2593, {wxAuiPaneInfo, captionVisible, 1}},
+ {2594, {wxAuiPaneInfo, centre, 0}},
+ {2595, {wxAuiPaneInfo, centrePane, 0}},
+ {2596, {wxAuiPaneInfo, closeButton, 1}},
+ {2597, {wxAuiPaneInfo, defaultPane, 0}},
+ {2598, {wxAuiPaneInfo, destroyOnClose, 1}},
+ {2599, {wxAuiPaneInfo, direction, 1}},
+ {2600, {wxAuiPaneInfo, dock, 0}},
+ {2601, {wxAuiPaneInfo, dockable, 1}},
+ {2602, {wxAuiPaneInfo, fixed, 0}},
+ {2603, {wxAuiPaneInfo, float, 0}},
+ {2604, {wxAuiPaneInfo, floatable, 1}},
+ {2605, {wxAuiPaneInfo, floatingPosition_1, 1}},
+ {2606, {wxAuiPaneInfo, floatingPosition_2, 2}},
+ {2607, {wxAuiPaneInfo, floatingSize_1, 1}},
+ {2608, {wxAuiPaneInfo, floatingSize_2, 2}},
+ {2609, {wxAuiPaneInfo, gripper, 1}},
+ {2610, {wxAuiPaneInfo, gripperTop, 1}},
+ {2611, {wxAuiPaneInfo, hasBorder, 0}},
+ {2612, {wxAuiPaneInfo, hasCaption, 0}},
+ {2613, {wxAuiPaneInfo, hasCloseButton, 0}},
+ {2614, {wxAuiPaneInfo, hasFlag, 1}},
+ {2615, {wxAuiPaneInfo, hasGripper, 0}},
+ {2616, {wxAuiPaneInfo, hasGripperTop, 0}},
+ {2617, {wxAuiPaneInfo, hasMaximizeButton, 0}},
+ {2618, {wxAuiPaneInfo, hasMinimizeButton, 0}},
+ {2619, {wxAuiPaneInfo, hasPinButton, 0}},
+ {2620, {wxAuiPaneInfo, hide, 0}},
+ {2621, {wxAuiPaneInfo, isBottomDockable, 0}},
+ {2622, {wxAuiPaneInfo, isDocked, 0}},
+ {2623, {wxAuiPaneInfo, isFixed, 0}},
+ {2624, {wxAuiPaneInfo, isFloatable, 0}},
+ {2625, {wxAuiPaneInfo, isFloating, 0}},
+ {2626, {wxAuiPaneInfo, isLeftDockable, 0}},
+ {2627, {wxAuiPaneInfo, isMovable, 0}},
+ {2628, {wxAuiPaneInfo, isOk, 0}},
+ {2629, {wxAuiPaneInfo, isResizable, 0}},
+ {2630, {wxAuiPaneInfo, isRightDockable, 0}},
+ {2631, {wxAuiPaneInfo, isShown, 0}},
+ {2632, {wxAuiPaneInfo, isToolbar, 0}},
+ {2633, {wxAuiPaneInfo, isTopDockable, 0}},
+ {2634, {wxAuiPaneInfo, layer, 1}},
+ {2635, {wxAuiPaneInfo, left, 0}},
+ {2636, {wxAuiPaneInfo, leftDockable, 1}},
+ {2637, {wxAuiPaneInfo, maxSize_1, 1}},
+ {2638, {wxAuiPaneInfo, maxSize_2, 2}},
+ {2639, {wxAuiPaneInfo, maximizeButton, 1}},
+ {2640, {wxAuiPaneInfo, minSize_1, 1}},
+ {2641, {wxAuiPaneInfo, minSize_2, 2}},
+ {2642, {wxAuiPaneInfo, minimizeButton, 1}},
+ {2643, {wxAuiPaneInfo, movable, 1}},
+ {2644, {wxAuiPaneInfo, name, 1}},
+ {2645, {wxAuiPaneInfo, paneBorder, 1}},
+ {2646, {wxAuiPaneInfo, pinButton, 1}},
+ {2647, {wxAuiPaneInfo, position, 1}},
+ {2648, {wxAuiPaneInfo, resizable, 1}},
+ {2649, {wxAuiPaneInfo, right, 0}},
+ {2650, {wxAuiPaneInfo, rightDockable, 1}},
+ {2651, {wxAuiPaneInfo, row, 1}},
+ {2652, {wxAuiPaneInfo, safeSet, 1}},
+ {2653, {wxAuiPaneInfo, setFlag, 2}},
+ {2654, {wxAuiPaneInfo, show, 1}},
+ {2655, {wxAuiPaneInfo, toolbarPane, 0}},
+ {2656, {wxAuiPaneInfo, top, 0}},
+ {2657, {wxAuiPaneInfo, topDockable, 1}},
+ {2658, {wxAuiPaneInfo, window, 1}},
+ {2659, {wxAuiPaneInfo, getWindow, 0}},
+ {2660, {wxAuiPaneInfo, getFrame, 0}},
+ {2661, {wxAuiPaneInfo, getDirection, 0}},
+ {2662, {wxAuiPaneInfo, getLayer, 0}},
+ {2663, {wxAuiPaneInfo, getRow, 0}},
+ {2664, {wxAuiPaneInfo, getPosition, 0}},
+ {2665, {wxAuiPaneInfo, getFloatingPosition, 0}},
+ {2666, {wxAuiPaneInfo, getFloatingSize, 0}},
+ {2667, {wxAuiNotebook, new_0, 0}},
+ {2668, {wxAuiNotebook, new_2, 2}},
+ {2669, {wxAuiNotebook, addPage, 3}},
+ {2670, {wxAuiNotebook, create, 2}},
+ {2671, {wxAuiNotebook, deletePage, 1}},
+ {2672, {wxAuiNotebook, getArtProvider, 0}},
+ {2673, {wxAuiNotebook, getPage, 1}},
+ {2674, {wxAuiNotebook, getPageBitmap, 1}},
+ {2675, {wxAuiNotebook, getPageCount, 0}},
+ {2676, {wxAuiNotebook, getPageIndex, 1}},
+ {2677, {wxAuiNotebook, getPageText, 1}},
+ {2678, {wxAuiNotebook, getSelection, 0}},
+ {2679, {wxAuiNotebook, insertPage, 4}},
+ {2680, {wxAuiNotebook, removePage, 1}},
+ {2681, {wxAuiNotebook, setArtProvider, 1}},
+ {2682, {wxAuiNotebook, setFont, 1}},
+ {2683, {wxAuiNotebook, setPageBitmap, 2}},
+ {2684, {wxAuiNotebook, setPageText, 2}},
+ {2685, {wxAuiNotebook, setSelection, 1}},
+ {2686, {wxAuiNotebook, setTabCtrlHeight, 1}},
+ {2687, {wxAuiNotebook, setUniformBitmapSize, 1}},
+ {2688, {wxAuiNotebook, 'Destroy', undefined}},
+ {2689, {wxAuiTabArt, setFlags, 1}},
+ {2690, {wxAuiTabArt, setMeasuringFont, 1}},
+ {2691, {wxAuiTabArt, setNormalFont, 1}},
+ {2692, {wxAuiTabArt, setSelectedFont, 1}},
+ {2693, {wxAuiTabArt, setColour, 1}},
+ {2694, {wxAuiTabArt, setActiveColour, 1}},
+ {2695, {wxAuiDockArt, getColour, 1}},
+ {2696, {wxAuiDockArt, getFont, 1}},
+ {2697, {wxAuiDockArt, getMetric, 1}},
+ {2698, {wxAuiDockArt, setColour, 2}},
+ {2699, {wxAuiDockArt, setFont, 2}},
+ {2700, {wxAuiDockArt, setMetric, 2}},
+ {2701, {wxAuiSimpleTabArt, new, 0}},
+ {2702, {wxAuiSimpleTabArt, 'Destroy', undefined}},
+ {2703, {wxMDIParentFrame, new_0, 0}},
+ {2704, {wxMDIParentFrame, new_4, 4}},
+ {2705, {wxMDIParentFrame, destruct, 0}},
+ {2706, {wxMDIParentFrame, activateNext, 0}},
+ {2707, {wxMDIParentFrame, activatePrevious, 0}},
+ {2708, {wxMDIParentFrame, arrangeIcons, 0}},
+ {2709, {wxMDIParentFrame, cascade, 0}},
+ {2710, {wxMDIParentFrame, create, 4}},
+ {2711, {wxMDIParentFrame, getActiveChild, 0}},
+ {2712, {wxMDIParentFrame, getClientWindow, 0}},
+ {2713, {wxMDIParentFrame, tile, 1}},
+ {2714, {wxMDIChildFrame, new_0, 0}},
+ {2715, {wxMDIChildFrame, new_4, 4}},
+ {2716, {wxMDIChildFrame, destruct, 0}},
+ {2717, {wxMDIChildFrame, activate, 0}},
+ {2718, {wxMDIChildFrame, create, 4}},
+ {2719, {wxMDIChildFrame, maximize, 1}},
+ {2720, {wxMDIChildFrame, restore, 0}},
+ {2721, {wxMDIClientWindow, new_0, 0}},
+ {2722, {wxMDIClientWindow, new_2, 2}},
+ {2723, {wxMDIClientWindow, destruct, 0}},
+ {2724, {wxMDIClientWindow, createClient, 2}},
+ {2725, {wxLayoutAlgorithm, new, 0}},
+ {2726, {wxLayoutAlgorithm, layoutFrame, 2}},
+ {2727, {wxLayoutAlgorithm, layoutMDIFrame, 2}},
+ {2728, {wxLayoutAlgorithm, layoutWindow, 2}},
+ {2729, {wxLayoutAlgorithm, 'Destroy', undefined}},
+ {2730, {wxEvent, getId, 0}},
+ {2731, {wxEvent, getSkipped, 0}},
+ {2732, {wxEvent, getTimestamp, 0}},
+ {2733, {wxEvent, isCommandEvent, 0}},
+ {2734, {wxEvent, resumePropagation, 1}},
+ {2735, {wxEvent, shouldPropagate, 0}},
+ {2736, {wxEvent, skip, 1}},
+ {2737, {wxEvent, stopPropagation, 0}},
+ {2738, {wxCommandEvent, getClientData, 0}},
+ {2739, {wxCommandEvent, getExtraLong, 0}},
+ {2740, {wxCommandEvent, getInt, 0}},
+ {2741, {wxCommandEvent, getSelection, 0}},
+ {2742, {wxCommandEvent, getString, 0}},
+ {2743, {wxCommandEvent, isChecked, 0}},
+ {2744, {wxCommandEvent, isSelection, 0}},
+ {2745, {wxCommandEvent, setInt, 1}},
+ {2746, {wxCommandEvent, setString, 1}},
+ {2747, {wxScrollEvent, getOrientation, 0}},
+ {2748, {wxScrollEvent, getPosition, 0}},
+ {2749, {wxScrollWinEvent, getOrientation, 0}},
+ {2750, {wxScrollWinEvent, getPosition, 0}},
+ {2751, {wxMouseEvent, altDown, 0}},
+ {2752, {wxMouseEvent, button, 1}},
+ {2753, {wxMouseEvent, buttonDClick, 1}},
+ {2754, {wxMouseEvent, buttonDown, 1}},
+ {2755, {wxMouseEvent, buttonUp, 1}},
+ {2756, {wxMouseEvent, cmdDown, 0}},
+ {2757, {wxMouseEvent, controlDown, 0}},
+ {2758, {wxMouseEvent, dragging, 0}},
+ {2759, {wxMouseEvent, entering, 0}},
+ {2760, {wxMouseEvent, getButton, 0}},
+ {2763, {wxMouseEvent, getPosition, 0}},
+ {2764, {wxMouseEvent, getLogicalPosition, 1}},
+ {2765, {wxMouseEvent, getLinesPerAction, 0}},
+ {2766, {wxMouseEvent, getWheelRotation, 0}},
+ {2767, {wxMouseEvent, getWheelDelta, 0}},
+ {2768, {wxMouseEvent, getX, 0}},
+ {2769, {wxMouseEvent, getY, 0}},
+ {2770, {wxMouseEvent, isButton, 0}},
+ {2771, {wxMouseEvent, isPageScroll, 0}},
+ {2772, {wxMouseEvent, leaving, 0}},
+ {2773, {wxMouseEvent, leftDClick, 0}},
+ {2774, {wxMouseEvent, leftDown, 0}},
+ {2775, {wxMouseEvent, leftIsDown, 0}},
+ {2776, {wxMouseEvent, leftUp, 0}},
+ {2777, {wxMouseEvent, metaDown, 0}},
+ {2778, {wxMouseEvent, middleDClick, 0}},
+ {2779, {wxMouseEvent, middleDown, 0}},
+ {2780, {wxMouseEvent, middleIsDown, 0}},
+ {2781, {wxMouseEvent, middleUp, 0}},
+ {2782, {wxMouseEvent, moving, 0}},
+ {2783, {wxMouseEvent, rightDClick, 0}},
+ {2784, {wxMouseEvent, rightDown, 0}},
+ {2785, {wxMouseEvent, rightIsDown, 0}},
+ {2786, {wxMouseEvent, rightUp, 0}},
+ {2787, {wxMouseEvent, shiftDown, 0}},
+ {2788, {wxSetCursorEvent, getCursor, 0}},
+ {2789, {wxSetCursorEvent, getX, 0}},
+ {2790, {wxSetCursorEvent, getY, 0}},
+ {2791, {wxSetCursorEvent, hasCursor, 0}},
+ {2792, {wxSetCursorEvent, setCursor, 1}},
+ {2793, {wxKeyEvent, altDown, 0}},
+ {2794, {wxKeyEvent, cmdDown, 0}},
+ {2795, {wxKeyEvent, controlDown, 0}},
+ {2796, {wxKeyEvent, getKeyCode, 0}},
+ {2797, {wxKeyEvent, getModifiers, 0}},
+ {2800, {wxKeyEvent, getPosition, 0}},
+ {2801, {wxKeyEvent, getRawKeyCode, 0}},
+ {2802, {wxKeyEvent, getRawKeyFlags, 0}},
+ {2803, {wxKeyEvent, getUnicodeKey, 0}},
+ {2804, {wxKeyEvent, getX, 0}},
+ {2805, {wxKeyEvent, getY, 0}},
+ {2806, {wxKeyEvent, hasModifiers, 0}},
+ {2807, {wxKeyEvent, metaDown, 0}},
+ {2808, {wxKeyEvent, shiftDown, 0}},
+ {2809, {wxSizeEvent, getSize, 0}},
+ {2810, {wxMoveEvent, getPosition, 0}},
+ {2811, {wxEraseEvent, getDC, 0}},
+ {2812, {wxFocusEvent, getWindow, 0}},
+ {2813, {wxChildFocusEvent, getWindow, 0}},
+ {2814, {wxMenuEvent, getMenu, 0}},
+ {2815, {wxMenuEvent, getMenuId, 0}},
+ {2816, {wxMenuEvent, isPopup, 0}},
+ {2817, {wxCloseEvent, canVeto, 0}},
+ {2818, {wxCloseEvent, getLoggingOff, 0}},
+ {2819, {wxCloseEvent, setCanVeto, 1}},
+ {2820, {wxCloseEvent, setLoggingOff, 1}},
+ {2821, {wxCloseEvent, veto, 1}},
+ {2822, {wxShowEvent, setShow, 1}},
+ {2823, {wxShowEvent, getShow, 0}},
+ {2824, {wxIconizeEvent, iconized, 0}},
+ {2825, {wxJoystickEvent, buttonDown, 1}},
+ {2826, {wxJoystickEvent, buttonIsDown, 1}},
+ {2827, {wxJoystickEvent, buttonUp, 1}},
+ {2828, {wxJoystickEvent, getButtonChange, 0}},
+ {2829, {wxJoystickEvent, getButtonState, 0}},
+ {2830, {wxJoystickEvent, getJoystick, 0}},
+ {2831, {wxJoystickEvent, getPosition, 0}},
+ {2832, {wxJoystickEvent, getZPosition, 0}},
+ {2833, {wxJoystickEvent, isButton, 0}},
+ {2834, {wxJoystickEvent, isMove, 0}},
+ {2835, {wxJoystickEvent, isZMove, 0}},
+ {2836, {wxUpdateUIEvent, canUpdate, 1}},
+ {2837, {wxUpdateUIEvent, check, 1}},
+ {2838, {wxUpdateUIEvent, enable, 1}},
+ {2839, {wxUpdateUIEvent, show, 1}},
+ {2840, {wxUpdateUIEvent, getChecked, 0}},
+ {2841, {wxUpdateUIEvent, getEnabled, 0}},
+ {2842, {wxUpdateUIEvent, getShown, 0}},
+ {2843, {wxUpdateUIEvent, getSetChecked, 0}},
+ {2844, {wxUpdateUIEvent, getSetEnabled, 0}},
+ {2845, {wxUpdateUIEvent, getSetShown, 0}},
+ {2846, {wxUpdateUIEvent, getSetText, 0}},
+ {2847, {wxUpdateUIEvent, getText, 0}},
+ {2848, {wxUpdateUIEvent, getMode, 0}},
+ {2849, {wxUpdateUIEvent, getUpdateInterval, 0}},
+ {2850, {wxUpdateUIEvent, resetUpdateTime, 0}},
+ {2851, {wxUpdateUIEvent, setMode, 1}},
+ {2852, {wxUpdateUIEvent, setText, 1}},
+ {2853, {wxUpdateUIEvent, setUpdateInterval, 1}},
+ {2854, {wxMouseCaptureChangedEvent, getCapturedWindow, 0}},
+ {2855, {wxPaletteChangedEvent, setChangedWindow, 1}},
+ {2856, {wxPaletteChangedEvent, getChangedWindow, 0}},
+ {2857, {wxQueryNewPaletteEvent, setPaletteRealized, 1}},
+ {2858, {wxQueryNewPaletteEvent, getPaletteRealized, 0}},
+ {2859, {wxNavigationKeyEvent, getDirection, 0}},
+ {2860, {wxNavigationKeyEvent, setDirection, 1}},
+ {2861, {wxNavigationKeyEvent, isWindowChange, 0}},
+ {2862, {wxNavigationKeyEvent, setWindowChange, 1}},
+ {2863, {wxNavigationKeyEvent, isFromTab, 0}},
+ {2864, {wxNavigationKeyEvent, setFromTab, 1}},
+ {2865, {wxNavigationKeyEvent, getCurrentFocus, 0}},
+ {2866, {wxNavigationKeyEvent, setCurrentFocus, 1}},
+ {2867, {wxHelpEvent, getOrigin, 0}},
+ {2868, {wxHelpEvent, getPosition, 0}},
+ {2869, {wxHelpEvent, setOrigin, 1}},
+ {2870, {wxHelpEvent, setPosition, 1}},
+ {2871, {wxContextMenuEvent, getPosition, 0}},
+ {2872, {wxContextMenuEvent, setPosition, 1}},
+ {2873, {wxIdleEvent, canSend, 1}},
+ {2874, {wxIdleEvent, getMode, 0}},
+ {2875, {wxIdleEvent, requestMore, 1}},
+ {2876, {wxIdleEvent, moreRequested, 0}},
+ {2877, {wxIdleEvent, setMode, 1}},
+ {2878, {wxGridEvent, altDown, 0}},
+ {2879, {wxGridEvent, controlDown, 0}},
+ {2880, {wxGridEvent, getCol, 0}},
+ {2881, {wxGridEvent, getPosition, 0}},
+ {2882, {wxGridEvent, getRow, 0}},
+ {2883, {wxGridEvent, metaDown, 0}},
+ {2884, {wxGridEvent, selecting, 0}},
+ {2885, {wxGridEvent, shiftDown, 0}},
+ {2886, {wxNotifyEvent, allow, 0}},
+ {2887, {wxNotifyEvent, isAllowed, 0}},
+ {2888, {wxNotifyEvent, veto, 0}},
+ {2889, {wxSashEvent, getEdge, 0}},
+ {2890, {wxSashEvent, getDragRect, 0}},
+ {2891, {wxSashEvent, getDragStatus, 0}},
+ {2892, {wxListEvent, getCacheFrom, 0}},
+ {2893, {wxListEvent, getCacheTo, 0}},
+ {2894, {wxListEvent, getKeyCode, 0}},
+ {2895, {wxListEvent, getIndex, 0}},
+ {2896, {wxListEvent, getColumn, 0}},
+ {2897, {wxListEvent, getPoint, 0}},
+ {2898, {wxListEvent, getLabel, 0}},
+ {2899, {wxListEvent, getText, 0}},
+ {2900, {wxListEvent, getImage, 0}},
+ {2901, {wxListEvent, getData, 0}},
+ {2902, {wxListEvent, getMask, 0}},
+ {2903, {wxListEvent, getItem, 0}},
+ {2904, {wxListEvent, isEditCancelled, 0}},
+ {2905, {wxDateEvent, getDate, 0}},
+ {2906, {wxCalendarEvent, getWeekDay, 0}},
+ {2907, {wxFileDirPickerEvent, getPath, 0}},
+ {2908, {wxColourPickerEvent, getColour, 0}},
+ {2909, {wxFontPickerEvent, getFont, 0}},
+ {2910, {wxStyledTextEvent, getPosition, 0}},
+ {2911, {wxStyledTextEvent, getKey, 0}},
+ {2912, {wxStyledTextEvent, getModifiers, 0}},
+ {2913, {wxStyledTextEvent, getModificationType, 0}},
+ {2914, {wxStyledTextEvent, getText, 0}},
+ {2915, {wxStyledTextEvent, getLength, 0}},
+ {2916, {wxStyledTextEvent, getLinesAdded, 0}},
+ {2917, {wxStyledTextEvent, getLine, 0}},
+ {2918, {wxStyledTextEvent, getFoldLevelNow, 0}},
+ {2919, {wxStyledTextEvent, getFoldLevelPrev, 0}},
+ {2920, {wxStyledTextEvent, getMargin, 0}},
+ {2921, {wxStyledTextEvent, getMessage, 0}},
+ {2922, {wxStyledTextEvent, getWParam, 0}},
+ {2923, {wxStyledTextEvent, getLParam, 0}},
+ {2924, {wxStyledTextEvent, getListType, 0}},
+ {2925, {wxStyledTextEvent, getX, 0}},
+ {2926, {wxStyledTextEvent, getY, 0}},
+ {2927, {wxStyledTextEvent, getDragText, 0}},
+ {2928, {wxStyledTextEvent, getDragAllowMove, 0}},
+ {2929, {wxStyledTextEvent, getDragResult, 0}},
+ {2930, {wxStyledTextEvent, getShift, 0}},
+ {2931, {wxStyledTextEvent, getControl, 0}},
+ {2932, {wxStyledTextEvent, getAlt, 0}},
+ {2933, {utils, getKeyState, 1}},
+ {2934, {utils, getMousePosition, 2}},
+ {2935, {utils, getMouseState, 0}},
+ {2936, {utils, setDetectableAutoRepeat, 1}},
+ {2937, {utils, bell, 0}},
+ {2938, {utils, findMenuItemId, 3}},
+ {2939, {utils, genericFindWindowAtPoint, 1}},
+ {2940, {utils, findWindowAtPoint, 1}},
+ {2941, {utils, beginBusyCursor, 1}},
+ {2942, {utils, endBusyCursor, 0}},
+ {2943, {utils, isBusy, 0}},
+ {2944, {utils, shutdown, 1}},
+ {2945, {utils, shell, 1}},
+ {2946, {utils, launchDefaultBrowser, 2}},
+ {2947, {utils, getEmailAddress, 0}},
+ {2948, {utils, getUserId, 0}},
+ {2949, {utils, getHomeDir, 0}},
+ {2950, {utils, newId, 0}},
+ {2951, {utils, registerId, 1}},
+ {2952, {utils, getCurrentId, 0}},
+ {2953, {utils, getOsDescription, 0}},
+ {2954, {utils, isPlatformLittleEndian, 0}},
+ {2955, {utils, isPlatform64Bit, 0}},
+ {2956, {gdicmn, displaySize, 2}},
+ {2957, {gdicmn, setCursor, 1}},
+ {2958, {wxPrintout, new, 1}},
+ {2959, {wxPrintout, destruct, 0}},
+ {2960, {wxPrintout, getDC, 0}},
+ {2961, {wxPrintout, getPageSizeMM, 2}},
+ {2962, {wxPrintout, getPageSizePixels, 2}},
+ {2963, {wxPrintout, getPaperRectPixels, 0}},
+ {2964, {wxPrintout, getPPIPrinter, 2}},
+ {2965, {wxPrintout, getPPIScreen, 2}},
+ {2966, {wxPrintout, getTitle, 0}},
+ {2967, {wxPrintout, isPreview, 0}},
+ {2968, {wxPrintout, fitThisSizeToPaper, 1}},
+ {2969, {wxPrintout, fitThisSizeToPage, 1}},
+ {2970, {wxPrintout, fitThisSizeToPageMargins, 2}},
+ {2971, {wxPrintout, mapScreenSizeToPaper, 0}},
+ {2972, {wxPrintout, mapScreenSizeToPage, 0}},
+ {2973, {wxPrintout, mapScreenSizeToPageMargins, 1}},
+ {2974, {wxPrintout, mapScreenSizeToDevice, 0}},
+ {2975, {wxPrintout, getLogicalPaperRect, 0}},
+ {2976, {wxPrintout, getLogicalPageRect, 0}},
+ {2977, {wxPrintout, getLogicalPageMarginsRect, 1}},
+ {2978, {wxPrintout, setLogicalOrigin, 2}},
+ {2979, {wxPrintout, offsetLogicalOrigin, 2}},
+ {2980, {wxStyledTextCtrl, new_2, 2}},
+ {2981, {wxStyledTextCtrl, new_0, 0}},
+ {2982, {wxStyledTextCtrl, destruct, 0}},
+ {2983, {wxStyledTextCtrl, create, 2}},
+ {2984, {wxStyledTextCtrl, addText, 1}},
+ {2985, {wxStyledTextCtrl, addStyledText, 1}},
+ {2986, {wxStyledTextCtrl, insertText, 2}},
+ {2987, {wxStyledTextCtrl, clearAll, 0}},
+ {2988, {wxStyledTextCtrl, clearDocumentStyle, 0}},
+ {2989, {wxStyledTextCtrl, getLength, 0}},
+ {2990, {wxStyledTextCtrl, getCharAt, 1}},
+ {2991, {wxStyledTextCtrl, getCurrentPos, 0}},
+ {2992, {wxStyledTextCtrl, getAnchor, 0}},
+ {2993, {wxStyledTextCtrl, getStyleAt, 1}},
+ {2994, {wxStyledTextCtrl, redo, 0}},
+ {2995, {wxStyledTextCtrl, setUndoCollection, 1}},
+ {2996, {wxStyledTextCtrl, selectAll, 0}},
+ {2997, {wxStyledTextCtrl, setSavePoint, 0}},
+ {2998, {wxStyledTextCtrl, getStyledText, 2}},
+ {2999, {wxStyledTextCtrl, canRedo, 0}},
+ {3000, {wxStyledTextCtrl, markerLineFromHandle, 1}},
+ {3001, {wxStyledTextCtrl, markerDeleteHandle, 1}},
+ {3002, {wxStyledTextCtrl, getUndoCollection, 0}},
+ {3003, {wxStyledTextCtrl, getViewWhiteSpace, 0}},
+ {3004, {wxStyledTextCtrl, setViewWhiteSpace, 1}},
+ {3005, {wxStyledTextCtrl, positionFromPoint, 1}},
+ {3006, {wxStyledTextCtrl, positionFromPointClose, 2}},
+ {3007, {wxStyledTextCtrl, gotoLine, 1}},
+ {3008, {wxStyledTextCtrl, gotoPos, 1}},
+ {3009, {wxStyledTextCtrl, setAnchor, 1}},
+ {3010, {wxStyledTextCtrl, getCurLine, 1}},
+ {3011, {wxStyledTextCtrl, getEndStyled, 0}},
+ {3012, {wxStyledTextCtrl, convertEOLs, 1}},
+ {3013, {wxStyledTextCtrl, getEOLMode, 0}},
+ {3014, {wxStyledTextCtrl, setEOLMode, 1}},
+ {3015, {wxStyledTextCtrl, startStyling, 2}},
+ {3016, {wxStyledTextCtrl, setStyling, 2}},
+ {3017, {wxStyledTextCtrl, getBufferedDraw, 0}},
+ {3018, {wxStyledTextCtrl, setBufferedDraw, 1}},
+ {3019, {wxStyledTextCtrl, setTabWidth, 1}},
+ {3020, {wxStyledTextCtrl, getTabWidth, 0}},
+ {3021, {wxStyledTextCtrl, setCodePage, 1}},
+ {3022, {wxStyledTextCtrl, markerDefine, 3}},
+ {3023, {wxStyledTextCtrl, markerSetForeground, 2}},
+ {3024, {wxStyledTextCtrl, markerSetBackground, 2}},
+ {3025, {wxStyledTextCtrl, markerAdd, 2}},
+ {3026, {wxStyledTextCtrl, markerDelete, 2}},
+ {3027, {wxStyledTextCtrl, markerDeleteAll, 1}},
+ {3028, {wxStyledTextCtrl, markerGet, 1}},
+ {3029, {wxStyledTextCtrl, markerNext, 2}},
+ {3030, {wxStyledTextCtrl, markerPrevious, 2}},
+ {3031, {wxStyledTextCtrl, markerDefineBitmap, 2}},
+ {3032, {wxStyledTextCtrl, markerAddSet, 2}},
+ {3033, {wxStyledTextCtrl, markerSetAlpha, 2}},
+ {3034, {wxStyledTextCtrl, setMarginType, 2}},
+ {3035, {wxStyledTextCtrl, getMarginType, 1}},
+ {3036, {wxStyledTextCtrl, setMarginWidth, 2}},
+ {3037, {wxStyledTextCtrl, getMarginWidth, 1}},
+ {3038, {wxStyledTextCtrl, setMarginMask, 2}},
+ {3039, {wxStyledTextCtrl, getMarginMask, 1}},
+ {3040, {wxStyledTextCtrl, setMarginSensitive, 2}},
+ {3041, {wxStyledTextCtrl, getMarginSensitive, 1}},
+ {3042, {wxStyledTextCtrl, styleClearAll, 0}},
+ {3043, {wxStyledTextCtrl, styleSetForeground, 2}},
+ {3044, {wxStyledTextCtrl, styleSetBackground, 2}},
+ {3045, {wxStyledTextCtrl, styleSetBold, 2}},
+ {3046, {wxStyledTextCtrl, styleSetItalic, 2}},
+ {3047, {wxStyledTextCtrl, styleSetSize, 2}},
+ {3048, {wxStyledTextCtrl, styleSetFaceName, 2}},
+ {3049, {wxStyledTextCtrl, styleSetEOLFilled, 2}},
+ {3050, {wxStyledTextCtrl, styleResetDefault, 0}},
+ {3051, {wxStyledTextCtrl, styleSetUnderline, 2}},
+ {3052, {wxStyledTextCtrl, styleSetCase, 2}},
+ {3053, {wxStyledTextCtrl, styleSetHotSpot, 2}},
+ {3054, {wxStyledTextCtrl, setSelForeground, 2}},
+ {3055, {wxStyledTextCtrl, setSelBackground, 2}},
+ {3056, {wxStyledTextCtrl, getSelAlpha, 0}},
+ {3057, {wxStyledTextCtrl, setSelAlpha, 1}},
+ {3058, {wxStyledTextCtrl, setCaretForeground, 1}},
+ {3059, {wxStyledTextCtrl, cmdKeyAssign, 3}},
+ {3060, {wxStyledTextCtrl, cmdKeyClear, 2}},
+ {3061, {wxStyledTextCtrl, cmdKeyClearAll, 0}},
+ {3062, {wxStyledTextCtrl, setStyleBytes, 2}},
+ {3063, {wxStyledTextCtrl, styleSetVisible, 2}},
+ {3064, {wxStyledTextCtrl, getCaretPeriod, 0}},
+ {3065, {wxStyledTextCtrl, setCaretPeriod, 1}},
+ {3066, {wxStyledTextCtrl, setWordChars, 1}},
+ {3067, {wxStyledTextCtrl, beginUndoAction, 0}},
+ {3068, {wxStyledTextCtrl, endUndoAction, 0}},
+ {3069, {wxStyledTextCtrl, indicatorSetStyle, 2}},
+ {3070, {wxStyledTextCtrl, indicatorGetStyle, 1}},
+ {3071, {wxStyledTextCtrl, indicatorSetForeground, 2}},
+ {3072, {wxStyledTextCtrl, indicatorGetForeground, 1}},
+ {3073, {wxStyledTextCtrl, setWhitespaceForeground, 2}},
+ {3074, {wxStyledTextCtrl, setWhitespaceBackground, 2}},
+ {3075, {wxStyledTextCtrl, getStyleBits, 0}},
+ {3076, {wxStyledTextCtrl, setLineState, 2}},
+ {3077, {wxStyledTextCtrl, getLineState, 1}},
+ {3078, {wxStyledTextCtrl, getMaxLineState, 0}},
+ {3079, {wxStyledTextCtrl, getCaretLineVisible, 0}},
+ {3080, {wxStyledTextCtrl, setCaretLineVisible, 1}},
+ {3081, {wxStyledTextCtrl, getCaretLineBackground, 0}},
+ {3082, {wxStyledTextCtrl, setCaretLineBackground, 1}},
+ {3083, {wxStyledTextCtrl, autoCompShow, 2}},
+ {3084, {wxStyledTextCtrl, autoCompCancel, 0}},
+ {3085, {wxStyledTextCtrl, autoCompActive, 0}},
+ {3086, {wxStyledTextCtrl, autoCompPosStart, 0}},
+ {3087, {wxStyledTextCtrl, autoCompComplete, 0}},
+ {3088, {wxStyledTextCtrl, autoCompStops, 1}},
+ {3089, {wxStyledTextCtrl, autoCompSetSeparator, 1}},
+ {3090, {wxStyledTextCtrl, autoCompGetSeparator, 0}},
+ {3091, {wxStyledTextCtrl, autoCompSelect, 1}},
+ {3092, {wxStyledTextCtrl, autoCompSetCancelAtStart, 1}},
+ {3093, {wxStyledTextCtrl, autoCompGetCancelAtStart, 0}},
+ {3094, {wxStyledTextCtrl, autoCompSetFillUps, 1}},
+ {3095, {wxStyledTextCtrl, autoCompSetChooseSingle, 1}},
+ {3096, {wxStyledTextCtrl, autoCompGetChooseSingle, 0}},
+ {3097, {wxStyledTextCtrl, autoCompSetIgnoreCase, 1}},
+ {3098, {wxStyledTextCtrl, autoCompGetIgnoreCase, 0}},
+ {3099, {wxStyledTextCtrl, userListShow, 2}},
+ {3100, {wxStyledTextCtrl, autoCompSetAutoHide, 1}},
+ {3101, {wxStyledTextCtrl, autoCompGetAutoHide, 0}},
+ {3102, {wxStyledTextCtrl, autoCompSetDropRestOfWord, 1}},
+ {3103, {wxStyledTextCtrl, autoCompGetDropRestOfWord, 0}},
+ {3104, {wxStyledTextCtrl, registerImage, 2}},
+ {3105, {wxStyledTextCtrl, clearRegisteredImages, 0}},
+ {3106, {wxStyledTextCtrl, autoCompGetTypeSeparator, 0}},
+ {3107, {wxStyledTextCtrl, autoCompSetTypeSeparator, 1}},
+ {3108, {wxStyledTextCtrl, autoCompSetMaxWidth, 1}},
+ {3109, {wxStyledTextCtrl, autoCompGetMaxWidth, 0}},
+ {3110, {wxStyledTextCtrl, autoCompSetMaxHeight, 1}},
+ {3111, {wxStyledTextCtrl, autoCompGetMaxHeight, 0}},
+ {3112, {wxStyledTextCtrl, setIndent, 1}},
+ {3113, {wxStyledTextCtrl, getIndent, 0}},
+ {3114, {wxStyledTextCtrl, setUseTabs, 1}},
+ {3115, {wxStyledTextCtrl, getUseTabs, 0}},
+ {3116, {wxStyledTextCtrl, setLineIndentation, 2}},
+ {3117, {wxStyledTextCtrl, getLineIndentation, 1}},
+ {3118, {wxStyledTextCtrl, getLineIndentPosition, 1}},
+ {3119, {wxStyledTextCtrl, getColumn, 1}},
+ {3120, {wxStyledTextCtrl, setUseHorizontalScrollBar, 1}},
+ {3121, {wxStyledTextCtrl, getUseHorizontalScrollBar, 0}},
+ {3122, {wxStyledTextCtrl, setIndentationGuides, 1}},
+ {3123, {wxStyledTextCtrl, getIndentationGuides, 0}},
+ {3124, {wxStyledTextCtrl, setHighlightGuide, 1}},
+ {3125, {wxStyledTextCtrl, getHighlightGuide, 0}},
+ {3126, {wxStyledTextCtrl, getLineEndPosition, 1}},
+ {3127, {wxStyledTextCtrl, getCodePage, 0}},
+ {3128, {wxStyledTextCtrl, getCaretForeground, 0}},
+ {3129, {wxStyledTextCtrl, getReadOnly, 0}},
+ {3130, {wxStyledTextCtrl, setCurrentPos, 1}},
+ {3131, {wxStyledTextCtrl, setSelectionStart, 1}},
+ {3132, {wxStyledTextCtrl, getSelectionStart, 0}},
+ {3133, {wxStyledTextCtrl, setSelectionEnd, 1}},
+ {3134, {wxStyledTextCtrl, getSelectionEnd, 0}},
+ {3135, {wxStyledTextCtrl, setPrintMagnification, 1}},
+ {3136, {wxStyledTextCtrl, getPrintMagnification, 0}},
+ {3137, {wxStyledTextCtrl, setPrintColourMode, 1}},
+ {3138, {wxStyledTextCtrl, getPrintColourMode, 0}},
+ {3139, {wxStyledTextCtrl, findText, 4}},
+ {3140, {wxStyledTextCtrl, formatRange, 7}},
+ {3141, {wxStyledTextCtrl, getFirstVisibleLine, 0}},
+ {3142, {wxStyledTextCtrl, getLine, 1}},
+ {3143, {wxStyledTextCtrl, getLineCount, 0}},
+ {3144, {wxStyledTextCtrl, setMarginLeft, 1}},
+ {3145, {wxStyledTextCtrl, getMarginLeft, 0}},
+ {3146, {wxStyledTextCtrl, setMarginRight, 1}},
+ {3147, {wxStyledTextCtrl, getMarginRight, 0}},
+ {3148, {wxStyledTextCtrl, getModify, 0}},
+ {3149, {wxStyledTextCtrl, setSelection, 2}},
+ {3150, {wxStyledTextCtrl, getSelectedText, 0}},
+ {3151, {wxStyledTextCtrl, getTextRange, 2}},
+ {3152, {wxStyledTextCtrl, hideSelection, 1}},
+ {3153, {wxStyledTextCtrl, lineFromPosition, 1}},
+ {3154, {wxStyledTextCtrl, positionFromLine, 1}},
+ {3155, {wxStyledTextCtrl, lineScroll, 2}},
+ {3156, {wxStyledTextCtrl, ensureCaretVisible, 0}},
+ {3157, {wxStyledTextCtrl, replaceSelection, 1}},
+ {3158, {wxStyledTextCtrl, setReadOnly, 1}},
+ {3159, {wxStyledTextCtrl, canPaste, 0}},
+ {3160, {wxStyledTextCtrl, canUndo, 0}},
+ {3161, {wxStyledTextCtrl, emptyUndoBuffer, 0}},
+ {3162, {wxStyledTextCtrl, undo, 0}},
+ {3163, {wxStyledTextCtrl, cut, 0}},
+ {3164, {wxStyledTextCtrl, copy, 0}},
+ {3165, {wxStyledTextCtrl, paste, 0}},
+ {3166, {wxStyledTextCtrl, clear, 0}},
+ {3167, {wxStyledTextCtrl, setText, 1}},
+ {3168, {wxStyledTextCtrl, getText, 0}},
+ {3169, {wxStyledTextCtrl, getTextLength, 0}},
+ {3170, {wxStyledTextCtrl, getOvertype, 0}},
+ {3171, {wxStyledTextCtrl, setCaretWidth, 1}},
+ {3172, {wxStyledTextCtrl, getCaretWidth, 0}},
+ {3173, {wxStyledTextCtrl, setTargetStart, 1}},
+ {3174, {wxStyledTextCtrl, getTargetStart, 0}},
+ {3175, {wxStyledTextCtrl, setTargetEnd, 1}},
+ {3176, {wxStyledTextCtrl, getTargetEnd, 0}},
+ {3177, {wxStyledTextCtrl, replaceTarget, 1}},
+ {3178, {wxStyledTextCtrl, searchInTarget, 1}},
+ {3179, {wxStyledTextCtrl, setSearchFlags, 1}},
+ {3180, {wxStyledTextCtrl, getSearchFlags, 0}},
+ {3181, {wxStyledTextCtrl, callTipShow, 2}},
+ {3182, {wxStyledTextCtrl, callTipCancel, 0}},
+ {3183, {wxStyledTextCtrl, callTipActive, 0}},
+ {3184, {wxStyledTextCtrl, callTipPosAtStart, 0}},
+ {3185, {wxStyledTextCtrl, callTipSetHighlight, 2}},
+ {3186, {wxStyledTextCtrl, callTipSetBackground, 1}},
+ {3187, {wxStyledTextCtrl, callTipSetForeground, 1}},
+ {3188, {wxStyledTextCtrl, callTipSetForegroundHighlight, 1}},
+ {3189, {wxStyledTextCtrl, callTipUseStyle, 1}},
+ {3190, {wxStyledTextCtrl, visibleFromDocLine, 1}},
+ {3191, {wxStyledTextCtrl, docLineFromVisible, 1}},
+ {3192, {wxStyledTextCtrl, wrapCount, 1}},
+ {3193, {wxStyledTextCtrl, setFoldLevel, 2}},
+ {3194, {wxStyledTextCtrl, getFoldLevel, 1}},
+ {3195, {wxStyledTextCtrl, getLastChild, 2}},
+ {3196, {wxStyledTextCtrl, getFoldParent, 1}},
+ {3197, {wxStyledTextCtrl, showLines, 2}},
+ {3198, {wxStyledTextCtrl, hideLines, 2}},
+ {3199, {wxStyledTextCtrl, getLineVisible, 1}},
+ {3200, {wxStyledTextCtrl, setFoldExpanded, 2}},
+ {3201, {wxStyledTextCtrl, getFoldExpanded, 1}},
+ {3202, {wxStyledTextCtrl, toggleFold, 1}},
+ {3203, {wxStyledTextCtrl, ensureVisible, 1}},
+ {3204, {wxStyledTextCtrl, setFoldFlags, 1}},
+ {3205, {wxStyledTextCtrl, ensureVisibleEnforcePolicy, 1}},
+ {3206, {wxStyledTextCtrl, setTabIndents, 1}},
+ {3207, {wxStyledTextCtrl, getTabIndents, 0}},
+ {3208, {wxStyledTextCtrl, setBackSpaceUnIndents, 1}},
+ {3209, {wxStyledTextCtrl, getBackSpaceUnIndents, 0}},
+ {3210, {wxStyledTextCtrl, setMouseDwellTime, 1}},
+ {3211, {wxStyledTextCtrl, getMouseDwellTime, 0}},
+ {3212, {wxStyledTextCtrl, wordStartPosition, 2}},
+ {3213, {wxStyledTextCtrl, wordEndPosition, 2}},
+ {3214, {wxStyledTextCtrl, setWrapMode, 1}},
+ {3215, {wxStyledTextCtrl, getWrapMode, 0}},
+ {3216, {wxStyledTextCtrl, setWrapVisualFlags, 1}},
+ {3217, {wxStyledTextCtrl, getWrapVisualFlags, 0}},
+ {3218, {wxStyledTextCtrl, setWrapVisualFlagsLocation, 1}},
+ {3219, {wxStyledTextCtrl, getWrapVisualFlagsLocation, 0}},
+ {3220, {wxStyledTextCtrl, setWrapStartIndent, 1}},
+ {3221, {wxStyledTextCtrl, getWrapStartIndent, 0}},
+ {3222, {wxStyledTextCtrl, setLayoutCache, 1}},
+ {3223, {wxStyledTextCtrl, getLayoutCache, 0}},
+ {3224, {wxStyledTextCtrl, setScrollWidth, 1}},
+ {3225, {wxStyledTextCtrl, getScrollWidth, 0}},
+ {3226, {wxStyledTextCtrl, textWidth, 2}},
+ {3227, {wxStyledTextCtrl, getEndAtLastLine, 0}},
+ {3228, {wxStyledTextCtrl, textHeight, 1}},
+ {3229, {wxStyledTextCtrl, setUseVerticalScrollBar, 1}},
+ {3230, {wxStyledTextCtrl, getUseVerticalScrollBar, 0}},
+ {3231, {wxStyledTextCtrl, appendText, 1}},
+ {3232, {wxStyledTextCtrl, getTwoPhaseDraw, 0}},
+ {3233, {wxStyledTextCtrl, setTwoPhaseDraw, 1}},
+ {3234, {wxStyledTextCtrl, targetFromSelection, 0}},
+ {3235, {wxStyledTextCtrl, linesJoin, 0}},
+ {3236, {wxStyledTextCtrl, linesSplit, 1}},
+ {3237, {wxStyledTextCtrl, setFoldMarginColour, 2}},
+ {3238, {wxStyledTextCtrl, setFoldMarginHiColour, 2}},
+ {3239, {wxStyledTextCtrl, lineDown, 0}},
+ {3240, {wxStyledTextCtrl, lineDownExtend, 0}},
+ {3241, {wxStyledTextCtrl, lineUp, 0}},
+ {3242, {wxStyledTextCtrl, lineUpExtend, 0}},
+ {3243, {wxStyledTextCtrl, charLeft, 0}},
+ {3244, {wxStyledTextCtrl, charLeftExtend, 0}},
+ {3245, {wxStyledTextCtrl, charRight, 0}},
+ {3246, {wxStyledTextCtrl, charRightExtend, 0}},
+ {3247, {wxStyledTextCtrl, wordLeft, 0}},
+ {3248, {wxStyledTextCtrl, wordLeftExtend, 0}},
+ {3249, {wxStyledTextCtrl, wordRight, 0}},
+ {3250, {wxStyledTextCtrl, wordRightExtend, 0}},
+ {3251, {wxStyledTextCtrl, home, 0}},
+ {3252, {wxStyledTextCtrl, homeExtend, 0}},
+ {3253, {wxStyledTextCtrl, lineEnd, 0}},
+ {3254, {wxStyledTextCtrl, lineEndExtend, 0}},
+ {3255, {wxStyledTextCtrl, documentStart, 0}},
+ {3256, {wxStyledTextCtrl, documentStartExtend, 0}},
+ {3257, {wxStyledTextCtrl, documentEnd, 0}},
+ {3258, {wxStyledTextCtrl, documentEndExtend, 0}},
+ {3259, {wxStyledTextCtrl, pageUp, 0}},
+ {3260, {wxStyledTextCtrl, pageUpExtend, 0}},
+ {3261, {wxStyledTextCtrl, pageDown, 0}},
+ {3262, {wxStyledTextCtrl, pageDownExtend, 0}},
+ {3263, {wxStyledTextCtrl, editToggleOvertype, 0}},
+ {3264, {wxStyledTextCtrl, cancel, 0}},
+ {3265, {wxStyledTextCtrl, deleteBack, 0}},
+ {3266, {wxStyledTextCtrl, tab, 0}},
+ {3267, {wxStyledTextCtrl, backTab, 0}},
+ {3268, {wxStyledTextCtrl, newLine, 0}},
+ {3269, {wxStyledTextCtrl, formFeed, 0}},
+ {3270, {wxStyledTextCtrl, vCHome, 0}},
+ {3271, {wxStyledTextCtrl, vCHomeExtend, 0}},
+ {3272, {wxStyledTextCtrl, zoomIn, 0}},
+ {3273, {wxStyledTextCtrl, zoomOut, 0}},
+ {3274, {wxStyledTextCtrl, delWordLeft, 0}},
+ {3275, {wxStyledTextCtrl, delWordRight, 0}},
+ {3276, {wxStyledTextCtrl, lineCut, 0}},
+ {3277, {wxStyledTextCtrl, lineDelete, 0}},
+ {3278, {wxStyledTextCtrl, lineTranspose, 0}},
+ {3279, {wxStyledTextCtrl, lineDuplicate, 0}},
+ {3280, {wxStyledTextCtrl, lowerCase, 0}},
+ {3281, {wxStyledTextCtrl, upperCase, 0}},
+ {3282, {wxStyledTextCtrl, lineScrollDown, 0}},
+ {3283, {wxStyledTextCtrl, lineScrollUp, 0}},
+ {3284, {wxStyledTextCtrl, deleteBackNotLine, 0}},
+ {3285, {wxStyledTextCtrl, homeDisplay, 0}},
+ {3286, {wxStyledTextCtrl, homeDisplayExtend, 0}},
+ {3287, {wxStyledTextCtrl, lineEndDisplay, 0}},
+ {3288, {wxStyledTextCtrl, lineEndDisplayExtend, 0}},
+ {3289, {wxStyledTextCtrl, homeWrapExtend, 0}},
+ {3290, {wxStyledTextCtrl, lineEndWrap, 0}},
+ {3291, {wxStyledTextCtrl, lineEndWrapExtend, 0}},
+ {3292, {wxStyledTextCtrl, vCHomeWrap, 0}},
+ {3293, {wxStyledTextCtrl, vCHomeWrapExtend, 0}},
+ {3294, {wxStyledTextCtrl, lineCopy, 0}},
+ {3295, {wxStyledTextCtrl, moveCaretInsideView, 0}},
+ {3296, {wxStyledTextCtrl, lineLength, 1}},
+ {3297, {wxStyledTextCtrl, braceHighlight, 2}},
+ {3298, {wxStyledTextCtrl, braceBadLight, 1}},
+ {3299, {wxStyledTextCtrl, braceMatch, 1}},
+ {3300, {wxStyledTextCtrl, getViewEOL, 0}},
+ {3301, {wxStyledTextCtrl, setViewEOL, 1}},
+ {3302, {wxStyledTextCtrl, setModEventMask, 1}},
+ {3303, {wxStyledTextCtrl, getEdgeColumn, 0}},
+ {3304, {wxStyledTextCtrl, setEdgeColumn, 1}},
+ {3305, {wxStyledTextCtrl, setEdgeMode, 1}},
+ {3306, {wxStyledTextCtrl, getEdgeMode, 0}},
+ {3307, {wxStyledTextCtrl, getEdgeColour, 0}},
+ {3308, {wxStyledTextCtrl, setEdgeColour, 1}},
+ {3309, {wxStyledTextCtrl, searchAnchor, 0}},
+ {3310, {wxStyledTextCtrl, searchNext, 2}},
+ {3311, {wxStyledTextCtrl, searchPrev, 2}},
+ {3312, {wxStyledTextCtrl, linesOnScreen, 0}},
+ {3313, {wxStyledTextCtrl, usePopUp, 1}},
+ {3314, {wxStyledTextCtrl, selectionIsRectangle, 0}},
+ {3315, {wxStyledTextCtrl, setZoom, 1}},
+ {3316, {wxStyledTextCtrl, getZoom, 0}},
+ {3317, {wxStyledTextCtrl, getModEventMask, 0}},
+ {3318, {wxStyledTextCtrl, setSTCFocus, 1}},
+ {3319, {wxStyledTextCtrl, getSTCFocus, 0}},
+ {3320, {wxStyledTextCtrl, setStatus, 1}},
+ {3321, {wxStyledTextCtrl, getStatus, 0}},
+ {3322, {wxStyledTextCtrl, setMouseDownCaptures, 1}},
+ {3323, {wxStyledTextCtrl, getMouseDownCaptures, 0}},
+ {3324, {wxStyledTextCtrl, setSTCCursor, 1}},
+ {3325, {wxStyledTextCtrl, getSTCCursor, 0}},
+ {3326, {wxStyledTextCtrl, setControlCharSymbol, 1}},
+ {3327, {wxStyledTextCtrl, getControlCharSymbol, 0}},
+ {3328, {wxStyledTextCtrl, wordPartLeft, 0}},
+ {3329, {wxStyledTextCtrl, wordPartLeftExtend, 0}},
+ {3330, {wxStyledTextCtrl, wordPartRight, 0}},
+ {3331, {wxStyledTextCtrl, wordPartRightExtend, 0}},
+ {3332, {wxStyledTextCtrl, setVisiblePolicy, 2}},
+ {3333, {wxStyledTextCtrl, delLineLeft, 0}},
+ {3334, {wxStyledTextCtrl, delLineRight, 0}},
+ {3335, {wxStyledTextCtrl, getXOffset, 0}},
+ {3336, {wxStyledTextCtrl, chooseCaretX, 0}},
+ {3337, {wxStyledTextCtrl, setXCaretPolicy, 2}},
+ {3338, {wxStyledTextCtrl, setYCaretPolicy, 2}},
+ {3339, {wxStyledTextCtrl, getPrintWrapMode, 0}},
+ {3340, {wxStyledTextCtrl, setHotspotActiveForeground, 2}},
+ {3341, {wxStyledTextCtrl, setHotspotActiveBackground, 2}},
+ {3342, {wxStyledTextCtrl, setHotspotActiveUnderline, 1}},
+ {3343, {wxStyledTextCtrl, setHotspotSingleLine, 1}},
+ {3344, {wxStyledTextCtrl, paraDownExtend, 0}},
+ {3345, {wxStyledTextCtrl, paraUp, 0}},
+ {3346, {wxStyledTextCtrl, paraUpExtend, 0}},
+ {3347, {wxStyledTextCtrl, positionBefore, 1}},
+ {3348, {wxStyledTextCtrl, positionAfter, 1}},
+ {3349, {wxStyledTextCtrl, copyRange, 2}},
+ {3350, {wxStyledTextCtrl, copyText, 2}},
+ {3351, {wxStyledTextCtrl, setSelectionMode, 1}},
+ {3352, {wxStyledTextCtrl, getSelectionMode, 0}},
+ {3353, {wxStyledTextCtrl, lineDownRectExtend, 0}},
+ {3354, {wxStyledTextCtrl, lineUpRectExtend, 0}},
+ {3355, {wxStyledTextCtrl, charLeftRectExtend, 0}},
+ {3356, {wxStyledTextCtrl, charRightRectExtend, 0}},
+ {3357, {wxStyledTextCtrl, homeRectExtend, 0}},
+ {3358, {wxStyledTextCtrl, vCHomeRectExtend, 0}},
+ {3359, {wxStyledTextCtrl, lineEndRectExtend, 0}},
+ {3360, {wxStyledTextCtrl, pageUpRectExtend, 0}},
+ {3361, {wxStyledTextCtrl, pageDownRectExtend, 0}},
+ {3362, {wxStyledTextCtrl, stutteredPageUp, 0}},
+ {3363, {wxStyledTextCtrl, stutteredPageUpExtend, 0}},
+ {3364, {wxStyledTextCtrl, stutteredPageDown, 0}},
+ {3365, {wxStyledTextCtrl, stutteredPageDownExtend, 0}},
+ {3366, {wxStyledTextCtrl, wordLeftEnd, 0}},
+ {3367, {wxStyledTextCtrl, wordLeftEndExtend, 0}},
+ {3368, {wxStyledTextCtrl, wordRightEnd, 0}},
+ {3369, {wxStyledTextCtrl, wordRightEndExtend, 0}},
+ {3370, {wxStyledTextCtrl, setWhitespaceChars, 1}},
+ {3371, {wxStyledTextCtrl, setCharsDefault, 0}},
+ {3372, {wxStyledTextCtrl, autoCompGetCurrent, 0}},
+ {3373, {wxStyledTextCtrl, allocate, 1}},
+ {3374, {wxStyledTextCtrl, findColumn, 2}},
+ {3375, {wxStyledTextCtrl, getCaretSticky, 0}},
+ {3376, {wxStyledTextCtrl, setCaretSticky, 1}},
+ {3377, {wxStyledTextCtrl, toggleCaretSticky, 0}},
+ {3378, {wxStyledTextCtrl, setPasteConvertEndings, 1}},
+ {3379, {wxStyledTextCtrl, getPasteConvertEndings, 0}},
+ {3380, {wxStyledTextCtrl, selectionDuplicate, 0}},
+ {3381, {wxStyledTextCtrl, setCaretLineBackAlpha, 1}},
+ {3382, {wxStyledTextCtrl, getCaretLineBackAlpha, 0}},
+ {3383, {wxStyledTextCtrl, startRecord, 0}},
+ {3384, {wxStyledTextCtrl, stopRecord, 0}},
+ {3385, {wxStyledTextCtrl, setLexer, 1}},
+ {3386, {wxStyledTextCtrl, getLexer, 0}},
+ {3387, {wxStyledTextCtrl, colourise, 2}},
+ {3388, {wxStyledTextCtrl, setProperty, 2}},
+ {3389, {wxStyledTextCtrl, setKeyWords, 2}},
+ {3390, {wxStyledTextCtrl, setLexerLanguage, 1}},
+ {3391, {wxStyledTextCtrl, getProperty, 1}},
+ {3392, {wxStyledTextCtrl, getStyleBitsNeeded, 0}},
+ {3393, {wxStyledTextCtrl, getCurrentLine, 0}},
+ {3394, {wxStyledTextCtrl, styleSetSpec, 2}},
+ {3395, {wxStyledTextCtrl, styleSetFont, 2}},
+ {3396, {wxStyledTextCtrl, styleSetFontAttr, 7}},
+ {3397, {wxStyledTextCtrl, styleSetCharacterSet, 2}},
+ {3398, {wxStyledTextCtrl, styleSetFontEncoding, 2}},
+ {3399, {wxStyledTextCtrl, cmdKeyExecute, 1}},
+ {3400, {wxStyledTextCtrl, setMargins, 2}},
+ {3401, {wxStyledTextCtrl, getSelection, 2}},
+ {3402, {wxStyledTextCtrl, pointFromPosition, 1}},
+ {3403, {wxStyledTextCtrl, scrollToLine, 1}},
+ {3404, {wxStyledTextCtrl, scrollToColumn, 1}},
+ {3405, {wxStyledTextCtrl, setVScrollBar, 1}},
+ {3406, {wxStyledTextCtrl, setHScrollBar, 1}},
+ {3407, {wxStyledTextCtrl, getLastKeydownProcessed, 0}},
+ {3408, {wxStyledTextCtrl, setLastKeydownProcessed, 1}},
+ {3409, {wxStyledTextCtrl, saveFile, 1}},
+ {3410, {wxStyledTextCtrl, loadFile, 1}},
+ {3411, {wxStyledTextCtrl, doDragOver, 3}},
+ {3412, {wxStyledTextCtrl, doDropText, 3}},
+ {3413, {wxStyledTextCtrl, getUseAntiAliasing, 0}},
+ {3414, {wxStyledTextCtrl, addTextRaw, 1}},
+ {3415, {wxStyledTextCtrl, insertTextRaw, 2}},
+ {3416, {wxStyledTextCtrl, getCurLineRaw, 1}},
+ {3417, {wxStyledTextCtrl, getLineRaw, 1}},
+ {3418, {wxStyledTextCtrl, getSelectedTextRaw, 0}},
+ {3419, {wxStyledTextCtrl, getTextRangeRaw, 2}},
+ {3420, {wxStyledTextCtrl, setTextRaw, 1}},
+ {3421, {wxStyledTextCtrl, getTextRaw, 0}},
+ {3422, {wxStyledTextCtrl, appendTextRaw, 1}},
+ {3423, {wxArtProvider, getBitmap, 2}},
+ {3424, {wxArtProvider, getIcon, 2}},
+ {3425, {wxTreeEvent, getKeyCode, 0}},
+ {3426, {wxTreeEvent, getItem, 0}},
+ {3427, {wxTreeEvent, getKeyEvent, 0}},
+ {3428, {wxTreeEvent, getLabel, 0}},
+ {3429, {wxTreeEvent, getOldItem, 0}},
+ {3430, {wxTreeEvent, getPoint, 0}},
+ {3431, {wxTreeEvent, isEditCancelled, 0}},
+ {3432, {wxTreeEvent, setToolTip, 1}},
+ {3433, {wxNotebookEvent, getOldSelection, 0}},
+ {3434, {wxNotebookEvent, getSelection, 0}},
+ {3435, {wxNotebookEvent, setOldSelection, 1}},
+ {3436, {wxNotebookEvent, setSelection, 1}},
+ {3437, {wxFileDataObject, new, 0}},
+ {3438, {wxFileDataObject, addFile, 1}},
+ {3439, {wxFileDataObject, getFilenames, 0}},
+ {3440, {wxFileDataObject, 'Destroy', undefined}},
+ {3441, {wxTextDataObject, new, 1}},
+ {3442, {wxTextDataObject, getTextLength, 0}},
+ {3443, {wxTextDataObject, getText, 0}},
+ {3444, {wxTextDataObject, setText, 1}},
+ {3445, {wxTextDataObject, 'Destroy', undefined}},
+ {3446, {wxBitmapDataObject, new_1_1, 1}},
+ {3447, {wxBitmapDataObject, new_1_0, 1}},
+ {3448, {wxBitmapDataObject, getBitmap, 0}},
+ {3449, {wxBitmapDataObject, setBitmap, 1}},
+ {3450, {wxBitmapDataObject, 'Destroy', undefined}},
+ {3452, {wxClipboard, new, 0}},
+ {3453, {wxClipboard, destruct, 0}},
+ {3454, {wxClipboard, addData, 1}},
+ {3455, {wxClipboard, clear, 0}},
+ {3456, {wxClipboard, close, 0}},
+ {3457, {wxClipboard, flush, 0}},
+ {3458, {wxClipboard, getData, 1}},
+ {3459, {wxClipboard, isOpened, 0}},
+ {3460, {wxClipboard, open, 0}},
+ {3461, {wxClipboard, setData, 1}},
+ {3463, {wxClipboard, usePrimarySelection, 1}},
+ {3464, {wxClipboard, isSupported, 1}},
+ {3465, {wxClipboard, get, 0}},
+ {3466, {wxSpinEvent, getPosition, 0}},
+ {3467, {wxSpinEvent, setPosition, 1}},
+ {3468, {wxSplitterWindow, new_0, 0}},
+ {3469, {wxSplitterWindow, new_2, 2}},
+ {3470, {wxSplitterWindow, destruct, 0}},
+ {3471, {wxSplitterWindow, create, 2}},
+ {3472, {wxSplitterWindow, getMinimumPaneSize, 0}},
+ {3473, {wxSplitterWindow, getSashGravity, 0}},
+ {3474, {wxSplitterWindow, getSashPosition, 0}},
+ {3475, {wxSplitterWindow, getSplitMode, 0}},
+ {3476, {wxSplitterWindow, getWindow1, 0}},
+ {3477, {wxSplitterWindow, getWindow2, 0}},
+ {3478, {wxSplitterWindow, initialize, 1}},
+ {3479, {wxSplitterWindow, isSplit, 0}},
+ {3480, {wxSplitterWindow, replaceWindow, 2}},
+ {3481, {wxSplitterWindow, setSashGravity, 1}},
+ {3482, {wxSplitterWindow, setSashPosition, 2}},
+ {3483, {wxSplitterWindow, setSashSize, 1}},
+ {3484, {wxSplitterWindow, setMinimumPaneSize, 1}},
+ {3485, {wxSplitterWindow, setSplitMode, 1}},
+ {3486, {wxSplitterWindow, splitHorizontally, 3}},
+ {3487, {wxSplitterWindow, splitVertically, 3}},
+ {3488, {wxSplitterWindow, unsplit, 1}},
+ {3489, {wxSplitterWindow, updateSize, 0}},
+ {3490, {wxSplitterEvent, getSashPosition, 0}},
+ {3491, {wxSplitterEvent, getX, 0}},
+ {3492, {wxSplitterEvent, getY, 0}},
+ {3493, {wxSplitterEvent, getWindowBeingRemoved, 0}},
+ {3494, {wxSplitterEvent, setSashPosition, 1}},
+ {3495, {wxHtmlWindow, new_0, 0}},
+ {3496, {wxHtmlWindow, new_2, 2}},
+ {3497, {wxHtmlWindow, appendToPage, 1}},
+ {3498, {wxHtmlWindow, getOpenedAnchor, 0}},
+ {3499, {wxHtmlWindow, getOpenedPage, 0}},
+ {3500, {wxHtmlWindow, getOpenedPageTitle, 0}},
+ {3501, {wxHtmlWindow, getRelatedFrame, 0}},
+ {3502, {wxHtmlWindow, historyBack, 0}},
+ {3503, {wxHtmlWindow, historyCanBack, 0}},
+ {3504, {wxHtmlWindow, historyCanForward, 0}},
+ {3505, {wxHtmlWindow, historyClear, 0}},
+ {3506, {wxHtmlWindow, historyForward, 0}},
+ {3507, {wxHtmlWindow, loadFile, 1}},
+ {3508, {wxHtmlWindow, loadPage, 1}},
+ {3509, {wxHtmlWindow, selectAll, 0}},
+ {3510, {wxHtmlWindow, selectionToText, 0}},
+ {3511, {wxHtmlWindow, selectLine, 1}},
+ {3512, {wxHtmlWindow, selectWord, 1}},
+ {3513, {wxHtmlWindow, setBorders, 1}},
+ {3514, {wxHtmlWindow, setFonts, 3}},
+ {3515, {wxHtmlWindow, setPage, 1}},
+ {3516, {wxHtmlWindow, setRelatedFrame, 2}},
+ {3517, {wxHtmlWindow, setRelatedStatusBar, 1}},
+ {3518, {wxHtmlWindow, toText, 0}},
+ {3519, {wxHtmlWindow, 'Destroy', undefined}},
+ {3520, {wxHtmlLinkEvent, getLinkInfo, 0}},
+ {3521, {wxSystemSettings, getColour, 1}},
+ {3522, {wxSystemSettings, getFont, 1}},
+ {3523, {wxSystemSettings, getMetric, 2}},
+ {3524, {wxSystemSettings, getScreenType, 0}},
+ {3525, {wxSystemOptions, getOption, 1}},
+ {3526, {wxSystemOptions, getOptionInt, 1}},
+ {3527, {wxSystemOptions, hasOption, 1}},
+ {3528, {wxSystemOptions, isFalse, 1}},
+ {3529, {wxSystemOptions, setOption_2_1, 2}},
+ {3530, {wxSystemOptions, setOption_2_0, 2}},
+ {3531, {wxAuiNotebookEvent, setSelection, 1}},
+ {3532, {wxAuiNotebookEvent, getSelection, 0}},
+ {3533, {wxAuiNotebookEvent, setOldSelection, 1}},
+ {3534, {wxAuiNotebookEvent, getOldSelection, 0}},
+ {3535, {wxAuiNotebookEvent, setDragSource, 1}},
+ {3536, {wxAuiNotebookEvent, getDragSource, 0}},
+ {3537, {wxAuiManagerEvent, setManager, 1}},
+ {3538, {wxAuiManagerEvent, getManager, 0}},
+ {3539, {wxAuiManagerEvent, setPane, 1}},
+ {3540, {wxAuiManagerEvent, getPane, 0}},
+ {3541, {wxAuiManagerEvent, setButton, 1}},
+ {3542, {wxAuiManagerEvent, getButton, 0}},
+ {3543, {wxAuiManagerEvent, setDC, 1}},
+ {3544, {wxAuiManagerEvent, getDC, 0}},
+ {3545, {wxAuiManagerEvent, veto, 1}},
+ {3546, {wxAuiManagerEvent, getVeto, 0}},
+ {3547, {wxAuiManagerEvent, setCanVeto, 1}},
+ {3548, {wxAuiManagerEvent, canVeto, 0}},
+ {3549, {wxLogNull, new, 0}},
+ {3550, {wxLogNull, 'Destroy', undefined}},
+ {3551, {wxTaskBarIcon, new, 0}},
+ {3552, {wxTaskBarIcon, destruct, 0}},
+ {3553, {wxTaskBarIcon, popupMenu, 1}},
+ {3554, {wxTaskBarIcon, removeIcon, 0}},
+ {3555, {wxTaskBarIcon, setIcon, 2}},
+ {3556, {wxLocale, new_0, 0}},
+ {3558, {wxLocale, new_2, 2}},
+ {3559, {wxLocale, destruct, 0}},
+ {3561, {wxLocale, init, 1}},
+ {3562, {wxLocale, addCatalog_1, 1}},
+ {3563, {wxLocale, addCatalog_3, 3}},
+ {3564, {wxLocale, addCatalogLookupPathPrefix, 1}},
+ {3565, {wxLocale, getCanonicalName, 0}},
+ {3566, {wxLocale, getLanguage, 0}},
+ {3567, {wxLocale, getLanguageName, 1}},
+ {3568, {wxLocale, getLocale, 0}},
+ {3569, {wxLocale, getName, 0}},
+ {3570, {wxLocale, getString_2, 2}},
+ {3571, {wxLocale, getString_4, 4}},
+ {3572, {wxLocale, getHeaderValue, 2}},
+ {3573, {wxLocale, getSysName, 0}},
+ {3574, {wxLocale, getSystemEncoding, 0}},
+ {3575, {wxLocale, getSystemEncodingName, 0}},
+ {3576, {wxLocale, getSystemLanguage, 0}},
+ {3577, {wxLocale, isLoaded, 1}},
+ {3578, {wxLocale, isOk, 0}},
+ {3579, {wxActivateEvent, getActive, 0}},
+ {3581, {wxPopupWindow, new_2, 2}},
+ {3582, {wxPopupWindow, new_0, 0}},
+ {3584, {wxPopupWindow, destruct, 0}},
+ {3585, {wxPopupWindow, create, 2}},
+ {3586, {wxPopupWindow, position, 2}},
+ {3587, {wxPopupTransientWindow, new_0, 0}},
+ {3588, {wxPopupTransientWindow, new_2, 2}},
+ {3589, {wxPopupTransientWindow, destruct, 0}},
+ {3590, {wxPopupTransientWindow, popup, 1}},
+ {3591, {wxPopupTransientWindow, dismiss, 0}},
+ {3592, {wxOverlay, new, 0}},
+ {3593, {wxOverlay, destruct, 0}},
+ {3594, {wxOverlay, reset, 0}},
+ {3595, {wxDCOverlay, new_6, 6}},
+ {3596, {wxDCOverlay, new_2, 2}},
+ {3597, {wxDCOverlay, destruct, 0}},
+ {3598, {wxDCOverlay, clear, 0}},
{-1, {mod, func, -1}}
].
diff --git a/lib/wx/src/gen/wxe_funcs.hrl b/lib/wx/src/gen/wxe_funcs.hrl
index 35688f3869..f5f839ac67 100644
--- a/lib/wx/src/gen/wxe_funcs.hrl
+++ b/lib/wx/src/gen/wxe_funcs.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -189,3183 +189,3187 @@
-define(wxWindow_UpdateWindowUI, 281).
-define(wxWindow_Validate, 282).
-define(wxWindow_WarpPointer, 283).
--define(wxTopLevelWindow_GetIcon, 284).
--define(wxTopLevelWindow_GetIcons, 285).
--define(wxTopLevelWindow_GetTitle, 286).
--define(wxTopLevelWindow_IsActive, 287).
--define(wxTopLevelWindow_Iconize, 288).
--define(wxTopLevelWindow_IsFullScreen, 289).
--define(wxTopLevelWindow_IsIconized, 290).
--define(wxTopLevelWindow_IsMaximized, 291).
--define(wxTopLevelWindow_Maximize, 292).
--define(wxTopLevelWindow_RequestUserAttention, 293).
--define(wxTopLevelWindow_SetIcon, 294).
--define(wxTopLevelWindow_SetIcons, 295).
--define(wxTopLevelWindow_CenterOnScreen, 296).
--define(wxTopLevelWindow_CentreOnScreen, 297).
--define(wxTopLevelWindow_SetShape, 299).
--define(wxTopLevelWindow_SetTitle, 300).
--define(wxTopLevelWindow_ShowFullScreen, 301).
--define(wxFrame_new_4, 303).
--define(wxFrame_new_0, 304).
--define(wxFrame_destruct, 306).
--define(wxFrame_Create, 307).
--define(wxFrame_CreateStatusBar, 308).
--define(wxFrame_CreateToolBar, 309).
--define(wxFrame_GetClientAreaOrigin, 310).
--define(wxFrame_GetMenuBar, 311).
--define(wxFrame_GetStatusBar, 312).
--define(wxFrame_GetStatusBarPane, 313).
--define(wxFrame_GetToolBar, 314).
--define(wxFrame_ProcessCommand, 315).
--define(wxFrame_SendSizeEvent, 316).
--define(wxFrame_SetMenuBar, 317).
--define(wxFrame_SetStatusBar, 318).
--define(wxFrame_SetStatusBarPane, 319).
--define(wxFrame_SetStatusText, 320).
--define(wxFrame_SetStatusWidths, 321).
--define(wxFrame_SetToolBar, 322).
--define(wxMiniFrame_new_0, 323).
--define(wxMiniFrame_new_4, 324).
--define(wxMiniFrame_Create, 325).
--define(wxMiniFrame_destroy, 326).
--define(wxSplashScreen_new_0, 327).
--define(wxSplashScreen_new_6, 328).
--define(wxSplashScreen_destruct, 329).
--define(wxSplashScreen_GetSplashStyle, 330).
--define(wxSplashScreen_GetTimeout, 331).
--define(wxPanel_new_0, 332).
--define(wxPanel_new_6, 333).
--define(wxPanel_new_2, 334).
--define(wxPanel_destruct, 335).
--define(wxPanel_InitDialog, 336).
--define(wxPanel_SetFocusIgnoringChildren, 337).
--define(wxScrolledWindow_new_0, 338).
--define(wxScrolledWindow_new_2, 339).
--define(wxScrolledWindow_destruct, 340).
--define(wxScrolledWindow_CalcScrolledPosition_4, 341).
--define(wxScrolledWindow_CalcScrolledPosition_1, 342).
--define(wxScrolledWindow_CalcUnscrolledPosition_4, 343).
--define(wxScrolledWindow_CalcUnscrolledPosition_1, 344).
--define(wxScrolledWindow_EnableScrolling, 345).
--define(wxScrolledWindow_GetScrollPixelsPerUnit, 346).
--define(wxScrolledWindow_GetViewStart, 347).
--define(wxScrolledWindow_DoPrepareDC, 348).
--define(wxScrolledWindow_PrepareDC, 349).
--define(wxScrolledWindow_Scroll, 350).
--define(wxScrolledWindow_SetScrollbars, 351).
--define(wxScrolledWindow_SetScrollRate, 352).
--define(wxScrolledWindow_SetTargetWindow, 353).
--define(wxSashWindow_new_0, 354).
--define(wxSashWindow_new_2, 355).
--define(wxSashWindow_destruct, 356).
--define(wxSashWindow_GetSashVisible, 357).
--define(wxSashWindow_GetMaximumSizeX, 358).
--define(wxSashWindow_GetMaximumSizeY, 359).
--define(wxSashWindow_GetMinimumSizeX, 360).
--define(wxSashWindow_GetMinimumSizeY, 361).
--define(wxSashWindow_SetMaximumSizeX, 362).
--define(wxSashWindow_SetMaximumSizeY, 363).
--define(wxSashWindow_SetMinimumSizeX, 364).
--define(wxSashWindow_SetMinimumSizeY, 365).
--define(wxSashWindow_SetSashVisible, 366).
--define(wxSashLayoutWindow_new_0, 367).
--define(wxSashLayoutWindow_new_2, 368).
--define(wxSashLayoutWindow_Create, 369).
--define(wxSashLayoutWindow_GetAlignment, 370).
--define(wxSashLayoutWindow_GetOrientation, 371).
--define(wxSashLayoutWindow_SetAlignment, 372).
--define(wxSashLayoutWindow_SetDefaultSize, 373).
--define(wxSashLayoutWindow_SetOrientation, 374).
--define(wxSashLayoutWindow_destroy, 375).
--define(wxGrid_new_0, 376).
--define(wxGrid_new_3, 377).
--define(wxGrid_new_4, 378).
--define(wxGrid_destruct, 379).
--define(wxGrid_AppendCols, 380).
--define(wxGrid_AppendRows, 381).
--define(wxGrid_AutoSize, 382).
--define(wxGrid_AutoSizeColumn, 383).
--define(wxGrid_AutoSizeColumns, 384).
--define(wxGrid_AutoSizeRow, 385).
--define(wxGrid_AutoSizeRows, 386).
--define(wxGrid_BeginBatch, 387).
--define(wxGrid_BlockToDeviceRect, 388).
--define(wxGrid_CanDragColSize, 389).
--define(wxGrid_CanDragRowSize, 390).
--define(wxGrid_CanDragGridSize, 391).
--define(wxGrid_CanEnableCellControl, 392).
--define(wxGrid_CellToRect_2, 393).
--define(wxGrid_CellToRect_1, 394).
--define(wxGrid_ClearGrid, 395).
--define(wxGrid_ClearSelection, 396).
--define(wxGrid_CreateGrid, 397).
--define(wxGrid_DeleteCols, 398).
--define(wxGrid_DeleteRows, 399).
--define(wxGrid_DisableCellEditControl, 400).
--define(wxGrid_DisableDragColSize, 401).
--define(wxGrid_DisableDragGridSize, 402).
--define(wxGrid_DisableDragRowSize, 403).
--define(wxGrid_EnableCellEditControl, 404).
--define(wxGrid_EnableDragColSize, 405).
--define(wxGrid_EnableDragGridSize, 406).
--define(wxGrid_EnableDragRowSize, 407).
--define(wxGrid_EnableEditing, 408).
--define(wxGrid_EnableGridLines, 409).
--define(wxGrid_EndBatch, 410).
--define(wxGrid_Fit, 411).
--define(wxGrid_ForceRefresh, 412).
--define(wxGrid_GetBatchCount, 413).
--define(wxGrid_GetCellAlignment, 414).
--define(wxGrid_GetCellBackgroundColour, 415).
--define(wxGrid_GetCellEditor, 416).
--define(wxGrid_GetCellFont, 417).
--define(wxGrid_GetCellRenderer, 418).
--define(wxGrid_GetCellTextColour, 419).
--define(wxGrid_GetCellValue_2, 420).
--define(wxGrid_GetCellValue_1, 421).
--define(wxGrid_GetColLabelAlignment, 422).
--define(wxGrid_GetColLabelSize, 423).
--define(wxGrid_GetColLabelValue, 424).
--define(wxGrid_GetColMinimalAcceptableWidth, 425).
--define(wxGrid_GetDefaultCellAlignment, 426).
--define(wxGrid_GetDefaultCellBackgroundColour, 427).
--define(wxGrid_GetDefaultCellFont, 428).
--define(wxGrid_GetDefaultCellTextColour, 429).
--define(wxGrid_GetDefaultColLabelSize, 430).
--define(wxGrid_GetDefaultColSize, 431).
--define(wxGrid_GetDefaultEditor, 432).
--define(wxGrid_GetDefaultEditorForCell_2, 433).
--define(wxGrid_GetDefaultEditorForCell_1, 434).
--define(wxGrid_GetDefaultEditorForType, 435).
--define(wxGrid_GetDefaultRenderer, 436).
--define(wxGrid_GetDefaultRendererForCell, 437).
--define(wxGrid_GetDefaultRendererForType, 438).
--define(wxGrid_GetDefaultRowLabelSize, 439).
--define(wxGrid_GetDefaultRowSize, 440).
--define(wxGrid_GetGridCursorCol, 441).
--define(wxGrid_GetGridCursorRow, 442).
--define(wxGrid_GetGridLineColour, 443).
--define(wxGrid_GridLinesEnabled, 444).
--define(wxGrid_GetLabelBackgroundColour, 445).
--define(wxGrid_GetLabelFont, 446).
--define(wxGrid_GetLabelTextColour, 447).
--define(wxGrid_GetNumberCols, 448).
--define(wxGrid_GetNumberRows, 449).
--define(wxGrid_GetOrCreateCellAttr, 450).
--define(wxGrid_GetRowMinimalAcceptableHeight, 451).
--define(wxGrid_GetRowLabelAlignment, 452).
--define(wxGrid_GetRowLabelSize, 453).
--define(wxGrid_GetRowLabelValue, 454).
--define(wxGrid_GetRowSize, 455).
--define(wxGrid_GetScrollLineX, 456).
--define(wxGrid_GetScrollLineY, 457).
--define(wxGrid_GetSelectedCells, 458).
--define(wxGrid_GetSelectedCols, 459).
--define(wxGrid_GetSelectedRows, 460).
--define(wxGrid_GetSelectionBackground, 461).
--define(wxGrid_GetSelectionBlockTopLeft, 462).
--define(wxGrid_GetSelectionBlockBottomRight, 463).
--define(wxGrid_GetSelectionForeground, 464).
--define(wxGrid_GetViewWidth, 465).
--define(wxGrid_GetGridWindow, 466).
--define(wxGrid_GetGridRowLabelWindow, 467).
--define(wxGrid_GetGridColLabelWindow, 468).
--define(wxGrid_GetGridCornerLabelWindow, 469).
--define(wxGrid_HideCellEditControl, 470).
--define(wxGrid_InsertCols, 471).
--define(wxGrid_InsertRows, 472).
--define(wxGrid_IsCellEditControlEnabled, 473).
--define(wxGrid_IsCurrentCellReadOnly, 474).
--define(wxGrid_IsEditable, 475).
--define(wxGrid_IsInSelection_2, 476).
--define(wxGrid_IsInSelection_1, 477).
--define(wxGrid_IsReadOnly, 478).
--define(wxGrid_IsSelection, 479).
--define(wxGrid_IsVisible_3, 480).
--define(wxGrid_IsVisible_2, 481).
--define(wxGrid_MakeCellVisible_2, 482).
--define(wxGrid_MakeCellVisible_1, 483).
--define(wxGrid_MoveCursorDown, 484).
--define(wxGrid_MoveCursorLeft, 485).
--define(wxGrid_MoveCursorRight, 486).
--define(wxGrid_MoveCursorUp, 487).
--define(wxGrid_MoveCursorDownBlock, 488).
--define(wxGrid_MoveCursorLeftBlock, 489).
--define(wxGrid_MoveCursorRightBlock, 490).
--define(wxGrid_MoveCursorUpBlock, 491).
--define(wxGrid_MovePageDown, 492).
--define(wxGrid_MovePageUp, 493).
--define(wxGrid_RegisterDataType, 494).
--define(wxGrid_SaveEditControlValue, 495).
--define(wxGrid_SelectAll, 496).
--define(wxGrid_SelectBlock_5, 497).
--define(wxGrid_SelectBlock_3, 498).
--define(wxGrid_SelectCol, 499).
--define(wxGrid_SelectRow, 500).
--define(wxGrid_SetCellAlignment_4, 501).
--define(wxGrid_SetCellAlignment_3, 502).
--define(wxGrid_SetCellAlignment_1, 503).
--define(wxGrid_SetCellBackgroundColour_3_0, 504).
--define(wxGrid_SetCellBackgroundColour_1, 505).
--define(wxGrid_SetCellBackgroundColour_3_1, 506).
--define(wxGrid_SetCellEditor, 507).
--define(wxGrid_SetCellFont, 508).
--define(wxGrid_SetCellRenderer, 509).
--define(wxGrid_SetCellTextColour_3_0, 510).
--define(wxGrid_SetCellTextColour_3_1, 511).
--define(wxGrid_SetCellTextColour_1, 512).
--define(wxGrid_SetCellValue_3_0, 513).
--define(wxGrid_SetCellValue_2, 514).
--define(wxGrid_SetCellValue_3_1, 515).
--define(wxGrid_SetColAttr, 516).
--define(wxGrid_SetColFormatBool, 517).
--define(wxGrid_SetColFormatNumber, 518).
--define(wxGrid_SetColFormatFloat, 519).
--define(wxGrid_SetColFormatCustom, 520).
--define(wxGrid_SetColLabelAlignment, 521).
--define(wxGrid_SetColLabelSize, 522).
--define(wxGrid_SetColLabelValue, 523).
--define(wxGrid_SetColMinimalWidth, 524).
--define(wxGrid_SetColMinimalAcceptableWidth, 525).
--define(wxGrid_SetColSize, 526).
--define(wxGrid_SetDefaultCellAlignment, 527).
--define(wxGrid_SetDefaultCellBackgroundColour, 528).
--define(wxGrid_SetDefaultCellFont, 529).
--define(wxGrid_SetDefaultCellTextColour, 530).
--define(wxGrid_SetDefaultEditor, 531).
--define(wxGrid_SetDefaultRenderer, 532).
--define(wxGrid_SetDefaultColSize, 533).
--define(wxGrid_SetDefaultRowSize, 534).
--define(wxGrid_SetGridCursor, 535).
--define(wxGrid_SetGridLineColour, 536).
--define(wxGrid_SetLabelBackgroundColour, 537).
--define(wxGrid_SetLabelFont, 538).
--define(wxGrid_SetLabelTextColour, 539).
--define(wxGrid_SetMargins, 540).
--define(wxGrid_SetReadOnly, 541).
--define(wxGrid_SetRowAttr, 542).
--define(wxGrid_SetRowLabelAlignment, 543).
--define(wxGrid_SetRowLabelSize, 544).
--define(wxGrid_SetRowLabelValue, 545).
--define(wxGrid_SetRowMinimalHeight, 546).
--define(wxGrid_SetRowMinimalAcceptableHeight, 547).
--define(wxGrid_SetRowSize, 548).
--define(wxGrid_SetScrollLineX, 549).
--define(wxGrid_SetScrollLineY, 550).
--define(wxGrid_SetSelectionBackground, 551).
--define(wxGrid_SetSelectionForeground, 552).
--define(wxGrid_SetSelectionMode, 553).
--define(wxGrid_ShowCellEditControl, 554).
--define(wxGrid_XToCol, 555).
--define(wxGrid_XToEdgeOfCol, 556).
--define(wxGrid_YToEdgeOfRow, 557).
--define(wxGrid_YToRow, 558).
--define(wxGridCellRenderer_Draw, 559).
--define(wxGridCellRenderer_GetBestSize, 560).
--define(wxGridCellEditor_Create, 561).
--define(wxGridCellEditor_IsCreated, 562).
--define(wxGridCellEditor_SetSize, 563).
--define(wxGridCellEditor_Show, 564).
--define(wxGridCellEditor_PaintBackground, 565).
--define(wxGridCellEditor_BeginEdit, 566).
--define(wxGridCellEditor_EndEdit, 567).
--define(wxGridCellEditor_Reset, 568).
--define(wxGridCellEditor_StartingKey, 569).
--define(wxGridCellEditor_StartingClick, 570).
--define(wxGridCellEditor_HandleReturn, 571).
--define(wxGridCellBoolRenderer_new, 572).
--define(wxGridCellBoolRenderer_destroy, 573).
--define(wxGridCellBoolEditor_new, 574).
--define(wxGridCellBoolEditor_IsTrueValue, 575).
--define(wxGridCellBoolEditor_UseStringValues, 576).
--define(wxGridCellBoolEditor_destroy, 577).
--define(wxGridCellFloatRenderer_new, 578).
--define(wxGridCellFloatRenderer_GetPrecision, 579).
--define(wxGridCellFloatRenderer_GetWidth, 580).
--define(wxGridCellFloatRenderer_SetParameters, 581).
--define(wxGridCellFloatRenderer_SetPrecision, 582).
--define(wxGridCellFloatRenderer_SetWidth, 583).
--define(wxGridCellFloatRenderer_destroy, 584).
--define(wxGridCellFloatEditor_new, 585).
--define(wxGridCellFloatEditor_SetParameters, 586).
--define(wxGridCellFloatEditor_destroy, 587).
--define(wxGridCellStringRenderer_new, 588).
--define(wxGridCellStringRenderer_destroy, 589).
--define(wxGridCellTextEditor_new, 590).
--define(wxGridCellTextEditor_SetParameters, 591).
--define(wxGridCellTextEditor_destroy, 592).
--define(wxGridCellChoiceEditor_new, 594).
--define(wxGridCellChoiceEditor_SetParameters, 595).
--define(wxGridCellChoiceEditor_destroy, 596).
--define(wxGridCellNumberRenderer_new, 597).
--define(wxGridCellNumberRenderer_destroy, 598).
--define(wxGridCellNumberEditor_new, 599).
--define(wxGridCellNumberEditor_GetValue, 600).
--define(wxGridCellNumberEditor_SetParameters, 601).
--define(wxGridCellNumberEditor_destroy, 602).
--define(wxGridCellAttr_SetTextColour, 603).
--define(wxGridCellAttr_SetBackgroundColour, 604).
--define(wxGridCellAttr_SetFont, 605).
--define(wxGridCellAttr_SetAlignment, 606).
--define(wxGridCellAttr_SetReadOnly, 607).
--define(wxGridCellAttr_SetRenderer, 608).
--define(wxGridCellAttr_SetEditor, 609).
--define(wxGridCellAttr_HasTextColour, 610).
--define(wxGridCellAttr_HasBackgroundColour, 611).
--define(wxGridCellAttr_HasFont, 612).
--define(wxGridCellAttr_HasAlignment, 613).
--define(wxGridCellAttr_HasRenderer, 614).
--define(wxGridCellAttr_HasEditor, 615).
--define(wxGridCellAttr_GetTextColour, 616).
--define(wxGridCellAttr_GetBackgroundColour, 617).
--define(wxGridCellAttr_GetFont, 618).
--define(wxGridCellAttr_GetAlignment, 619).
--define(wxGridCellAttr_GetRenderer, 620).
--define(wxGridCellAttr_GetEditor, 621).
--define(wxGridCellAttr_IsReadOnly, 622).
--define(wxGridCellAttr_SetDefAttr, 623).
--define(wxDC_Blit, 624).
--define(wxDC_CalcBoundingBox, 625).
--define(wxDC_Clear, 626).
--define(wxDC_ComputeScaleAndOrigin, 627).
--define(wxDC_CrossHair, 628).
--define(wxDC_DestroyClippingRegion, 629).
--define(wxDC_DeviceToLogicalX, 630).
--define(wxDC_DeviceToLogicalXRel, 631).
--define(wxDC_DeviceToLogicalY, 632).
--define(wxDC_DeviceToLogicalYRel, 633).
--define(wxDC_DrawArc, 634).
--define(wxDC_DrawBitmap, 635).
--define(wxDC_DrawCheckMark, 636).
--define(wxDC_DrawCircle, 637).
--define(wxDC_DrawEllipse_2, 639).
--define(wxDC_DrawEllipse_1, 640).
--define(wxDC_DrawEllipticArc, 641).
--define(wxDC_DrawIcon, 642).
--define(wxDC_DrawLabel, 643).
--define(wxDC_DrawLine, 644).
--define(wxDC_DrawLines, 645).
--define(wxDC_DrawPolygon, 647).
--define(wxDC_DrawPoint, 649).
--define(wxDC_DrawRectangle_2, 651).
--define(wxDC_DrawRectangle_1, 652).
--define(wxDC_DrawRotatedText, 653).
--define(wxDC_DrawRoundedRectangle_3, 655).
--define(wxDC_DrawRoundedRectangle_2, 656).
--define(wxDC_DrawText, 657).
--define(wxDC_EndDoc, 658).
--define(wxDC_EndPage, 659).
--define(wxDC_FloodFill, 660).
--define(wxDC_GetBackground, 661).
--define(wxDC_GetBackgroundMode, 662).
--define(wxDC_GetBrush, 663).
--define(wxDC_GetCharHeight, 664).
--define(wxDC_GetCharWidth, 665).
--define(wxDC_GetClippingBox, 666).
--define(wxDC_GetFont, 668).
--define(wxDC_GetLayoutDirection, 669).
--define(wxDC_GetLogicalFunction, 670).
--define(wxDC_GetMapMode, 671).
--define(wxDC_GetMultiLineTextExtent_4, 672).
--define(wxDC_GetMultiLineTextExtent_1, 673).
--define(wxDC_GetPartialTextExtents, 674).
--define(wxDC_GetPen, 675).
--define(wxDC_GetPixel, 676).
--define(wxDC_GetPPI, 677).
--define(wxDC_GetSize, 679).
--define(wxDC_GetSizeMM, 681).
--define(wxDC_GetTextBackground, 682).
--define(wxDC_GetTextExtent_4, 683).
--define(wxDC_GetTextExtent_1, 684).
--define(wxDC_GetTextForeground, 686).
--define(wxDC_GetUserScale, 687).
--define(wxDC_GradientFillConcentric_3, 688).
--define(wxDC_GradientFillConcentric_4, 689).
--define(wxDC_GradientFillLinear, 690).
--define(wxDC_LogicalToDeviceX, 691).
--define(wxDC_LogicalToDeviceXRel, 692).
--define(wxDC_LogicalToDeviceY, 693).
--define(wxDC_LogicalToDeviceYRel, 694).
--define(wxDC_MaxX, 695).
--define(wxDC_MaxY, 696).
--define(wxDC_MinX, 697).
--define(wxDC_MinY, 698).
--define(wxDC_IsOk, 699).
--define(wxDC_ResetBoundingBox, 700).
--define(wxDC_SetAxisOrientation, 701).
--define(wxDC_SetBackground, 702).
--define(wxDC_SetBackgroundMode, 703).
--define(wxDC_SetBrush, 704).
--define(wxDC_SetClippingRegion_2, 706).
--define(wxDC_SetClippingRegion_1_1, 707).
--define(wxDC_SetClippingRegion_1_0, 708).
--define(wxDC_SetDeviceOrigin, 709).
--define(wxDC_SetFont, 710).
--define(wxDC_SetLayoutDirection, 711).
--define(wxDC_SetLogicalFunction, 712).
--define(wxDC_SetMapMode, 713).
--define(wxDC_SetPalette, 714).
--define(wxDC_SetPen, 715).
--define(wxDC_SetTextBackground, 716).
--define(wxDC_SetTextForeground, 717).
--define(wxDC_SetUserScale, 718).
--define(wxDC_StartDoc, 719).
--define(wxDC_StartPage, 720).
--define(wxMirrorDC_new, 721).
--define(wxMirrorDC_destroy, 722).
--define(wxScreenDC_new, 723).
--define(wxScreenDC_destruct, 724).
--define(wxPostScriptDC_new_0, 725).
--define(wxPostScriptDC_new_1, 726).
--define(wxPostScriptDC_destruct, 727).
--define(wxPostScriptDC_SetResolution, 728).
--define(wxPostScriptDC_GetResolution, 729).
--define(wxWindowDC_new_0, 730).
--define(wxWindowDC_new_1, 731).
--define(wxWindowDC_destruct, 732).
--define(wxClientDC_new_0, 733).
--define(wxClientDC_new_1, 734).
--define(wxClientDC_destroy, 735).
--define(wxPaintDC_new_0, 736).
--define(wxPaintDC_new_1, 737).
--define(wxPaintDC_destroy, 738).
--define(wxMemoryDC_new_1_0, 740).
--define(wxMemoryDC_new_1_1, 741).
--define(wxMemoryDC_new_0, 742).
--define(wxMemoryDC_destruct, 744).
--define(wxMemoryDC_SelectObject, 745).
--define(wxMemoryDC_SelectObjectAsSource, 746).
--define(wxBufferedDC_new_0, 747).
--define(wxBufferedDC_new_2, 748).
--define(wxBufferedDC_new_3, 749).
--define(wxBufferedDC_destruct, 750).
--define(wxBufferedDC_Init_2, 751).
--define(wxBufferedDC_Init_3, 752).
--define(wxBufferedPaintDC_new_3, 753).
--define(wxBufferedPaintDC_new_2, 754).
--define(wxBufferedPaintDC_destruct, 755).
--define(wxGraphicsObject_destruct, 756).
--define(wxGraphicsObject_GetRenderer, 757).
--define(wxGraphicsObject_IsNull, 758).
--define(wxGraphicsContext_destruct, 759).
--define(wxGraphicsContext_Create_1_1, 760).
--define(wxGraphicsContext_Create_1_0, 761).
--define(wxGraphicsContext_Create_0, 762).
--define(wxGraphicsContext_CreatePen, 763).
--define(wxGraphicsContext_CreateBrush, 764).
--define(wxGraphicsContext_CreateRadialGradientBrush, 765).
--define(wxGraphicsContext_CreateLinearGradientBrush, 766).
--define(wxGraphicsContext_CreateFont, 767).
--define(wxGraphicsContext_CreateMatrix, 768).
--define(wxGraphicsContext_CreatePath, 769).
--define(wxGraphicsContext_Clip_1, 770).
--define(wxGraphicsContext_Clip_4, 771).
--define(wxGraphicsContext_ResetClip, 772).
--define(wxGraphicsContext_DrawBitmap, 773).
--define(wxGraphicsContext_DrawEllipse, 774).
--define(wxGraphicsContext_DrawIcon, 775).
--define(wxGraphicsContext_DrawLines, 776).
--define(wxGraphicsContext_DrawPath, 777).
--define(wxGraphicsContext_DrawRectangle, 778).
--define(wxGraphicsContext_DrawRoundedRectangle, 779).
--define(wxGraphicsContext_DrawText_3, 780).
--define(wxGraphicsContext_DrawText_4_0, 781).
--define(wxGraphicsContext_DrawText_4_1, 782).
--define(wxGraphicsContext_DrawText_5, 783).
--define(wxGraphicsContext_FillPath, 784).
--define(wxGraphicsContext_StrokePath, 785).
--define(wxGraphicsContext_GetPartialTextExtents, 786).
--define(wxGraphicsContext_GetTextExtent, 787).
--define(wxGraphicsContext_Rotate, 788).
--define(wxGraphicsContext_Scale, 789).
--define(wxGraphicsContext_Translate, 790).
--define(wxGraphicsContext_GetTransform, 791).
--define(wxGraphicsContext_SetTransform, 792).
--define(wxGraphicsContext_ConcatTransform, 793).
--define(wxGraphicsContext_SetBrush_1_1, 794).
--define(wxGraphicsContext_SetBrush_1_0, 795).
--define(wxGraphicsContext_SetFont_1, 796).
--define(wxGraphicsContext_SetFont_2, 797).
--define(wxGraphicsContext_SetPen_1_0, 798).
--define(wxGraphicsContext_SetPen_1_1, 799).
--define(wxGraphicsContext_StrokeLine, 800).
--define(wxGraphicsContext_StrokeLines, 801).
--define(wxGraphicsMatrix_Concat, 803).
--define(wxGraphicsMatrix_Get, 805).
--define(wxGraphicsMatrix_Invert, 806).
--define(wxGraphicsMatrix_IsEqual, 807).
--define(wxGraphicsMatrix_IsIdentity, 809).
--define(wxGraphicsMatrix_Rotate, 810).
--define(wxGraphicsMatrix_Scale, 811).
--define(wxGraphicsMatrix_Translate, 812).
--define(wxGraphicsMatrix_Set, 813).
--define(wxGraphicsMatrix_TransformPoint, 814).
--define(wxGraphicsMatrix_TransformDistance, 815).
--define(wxGraphicsPath_MoveToPoint_2, 816).
--define(wxGraphicsPath_MoveToPoint_1, 817).
--define(wxGraphicsPath_AddArc_6, 818).
--define(wxGraphicsPath_AddArc_5, 819).
--define(wxGraphicsPath_AddArcToPoint, 820).
--define(wxGraphicsPath_AddCircle, 821).
--define(wxGraphicsPath_AddCurveToPoint_6, 822).
--define(wxGraphicsPath_AddCurveToPoint_3, 823).
--define(wxGraphicsPath_AddEllipse, 824).
--define(wxGraphicsPath_AddLineToPoint_2, 825).
--define(wxGraphicsPath_AddLineToPoint_1, 826).
--define(wxGraphicsPath_AddPath, 827).
--define(wxGraphicsPath_AddQuadCurveToPoint, 828).
--define(wxGraphicsPath_AddRectangle, 829).
--define(wxGraphicsPath_AddRoundedRectangle, 830).
--define(wxGraphicsPath_CloseSubpath, 831).
--define(wxGraphicsPath_Contains_3, 832).
--define(wxGraphicsPath_Contains_2, 833).
--define(wxGraphicsPath_GetBox, 835).
--define(wxGraphicsPath_GetCurrentPoint, 837).
--define(wxGraphicsPath_Transform, 838).
--define(wxGraphicsRenderer_GetDefaultRenderer, 839).
--define(wxGraphicsRenderer_CreateContext_1_1, 840).
--define(wxGraphicsRenderer_CreateContext_1_0, 841).
--define(wxGraphicsRenderer_CreatePen, 842).
--define(wxGraphicsRenderer_CreateBrush, 843).
--define(wxGraphicsRenderer_CreateLinearGradientBrush, 844).
--define(wxGraphicsRenderer_CreateRadialGradientBrush, 845).
--define(wxGraphicsRenderer_CreateFont, 846).
--define(wxGraphicsRenderer_CreateMatrix, 847).
--define(wxGraphicsRenderer_CreatePath, 848).
--define(wxMenuBar_new_1, 850).
--define(wxMenuBar_new_0, 852).
--define(wxMenuBar_destruct, 854).
--define(wxMenuBar_Append, 855).
--define(wxMenuBar_Check, 856).
--define(wxMenuBar_Enable_2, 857).
--define(wxMenuBar_Enable_1, 858).
--define(wxMenuBar_EnableTop, 859).
--define(wxMenuBar_FindMenu, 860).
--define(wxMenuBar_FindMenuItem, 861).
--define(wxMenuBar_FindItem, 862).
--define(wxMenuBar_GetHelpString, 863).
--define(wxMenuBar_GetLabel_1, 864).
--define(wxMenuBar_GetLabel_0, 865).
--define(wxMenuBar_GetLabelTop, 866).
--define(wxMenuBar_GetMenu, 867).
--define(wxMenuBar_GetMenuCount, 868).
--define(wxMenuBar_Insert, 869).
--define(wxMenuBar_IsChecked, 870).
--define(wxMenuBar_IsEnabled_1, 871).
--define(wxMenuBar_IsEnabled_0, 872).
--define(wxMenuBar_Remove, 873).
--define(wxMenuBar_Replace, 874).
--define(wxMenuBar_SetHelpString, 875).
--define(wxMenuBar_SetLabel_2, 876).
--define(wxMenuBar_SetLabel_1, 877).
--define(wxMenuBar_SetLabelTop, 878).
--define(wxControl_GetLabel, 879).
--define(wxControl_SetLabel, 880).
--define(wxControlWithItems_Append_1, 881).
--define(wxControlWithItems_Append_2, 882).
--define(wxControlWithItems_appendStrings_1, 883).
--define(wxControlWithItems_Clear, 884).
--define(wxControlWithItems_Delete, 885).
--define(wxControlWithItems_FindString, 886).
--define(wxControlWithItems_getClientData, 887).
--define(wxControlWithItems_setClientData, 888).
--define(wxControlWithItems_GetCount, 889).
--define(wxControlWithItems_GetSelection, 890).
--define(wxControlWithItems_GetString, 891).
--define(wxControlWithItems_GetStringSelection, 892).
--define(wxControlWithItems_Insert_2, 893).
--define(wxControlWithItems_Insert_3, 894).
--define(wxControlWithItems_IsEmpty, 895).
--define(wxControlWithItems_Select, 896).
--define(wxControlWithItems_SetSelection, 897).
--define(wxControlWithItems_SetString, 898).
--define(wxControlWithItems_SetStringSelection, 899).
--define(wxMenu_new_2, 902).
--define(wxMenu_new_1, 903).
--define(wxMenu_destruct, 905).
--define(wxMenu_Append_3, 906).
--define(wxMenu_Append_1, 907).
--define(wxMenu_Append_4_0, 908).
--define(wxMenu_Append_4_1, 909).
--define(wxMenu_AppendCheckItem, 910).
--define(wxMenu_AppendRadioItem, 911).
--define(wxMenu_AppendSeparator, 912).
--define(wxMenu_Break, 913).
--define(wxMenu_Check, 914).
--define(wxMenu_Delete_1_0, 915).
--define(wxMenu_Delete_1_1, 916).
--define(wxMenu_Destroy_1_0, 917).
--define(wxMenu_Destroy_1_1, 918).
--define(wxMenu_Enable, 919).
--define(wxMenu_FindItem_1, 920).
--define(wxMenu_FindItem_2, 921).
--define(wxMenu_FindItemByPosition, 922).
--define(wxMenu_GetHelpString, 923).
--define(wxMenu_GetLabel, 924).
--define(wxMenu_GetMenuItemCount, 925).
--define(wxMenu_GetMenuItems, 926).
--define(wxMenu_GetTitle, 928).
--define(wxMenu_Insert_2, 929).
--define(wxMenu_Insert_3, 930).
--define(wxMenu_Insert_5_1, 931).
--define(wxMenu_Insert_5_0, 932).
--define(wxMenu_InsertCheckItem, 933).
--define(wxMenu_InsertRadioItem, 934).
--define(wxMenu_InsertSeparator, 935).
--define(wxMenu_IsChecked, 936).
--define(wxMenu_IsEnabled, 937).
--define(wxMenu_Prepend_1, 938).
--define(wxMenu_Prepend_2, 939).
--define(wxMenu_Prepend_4_1, 940).
--define(wxMenu_Prepend_4_0, 941).
--define(wxMenu_PrependCheckItem, 942).
--define(wxMenu_PrependRadioItem, 943).
--define(wxMenu_PrependSeparator, 944).
--define(wxMenu_Remove_1_0, 945).
--define(wxMenu_Remove_1_1, 946).
--define(wxMenu_SetHelpString, 947).
--define(wxMenu_SetLabel, 948).
--define(wxMenu_SetTitle, 949).
--define(wxMenuItem_new, 950).
--define(wxMenuItem_destruct, 952).
--define(wxMenuItem_Check, 953).
--define(wxMenuItem_Enable, 954).
--define(wxMenuItem_GetBitmap, 955).
--define(wxMenuItem_GetHelp, 956).
--define(wxMenuItem_GetId, 957).
--define(wxMenuItem_GetKind, 958).
--define(wxMenuItem_GetLabel, 959).
--define(wxMenuItem_GetLabelFromText, 960).
--define(wxMenuItem_GetMenu, 961).
--define(wxMenuItem_GetText, 962).
--define(wxMenuItem_GetSubMenu, 963).
--define(wxMenuItem_IsCheckable, 964).
--define(wxMenuItem_IsChecked, 965).
--define(wxMenuItem_IsEnabled, 966).
--define(wxMenuItem_IsSeparator, 967).
--define(wxMenuItem_IsSubMenu, 968).
--define(wxMenuItem_SetBitmap, 969).
--define(wxMenuItem_SetHelp, 970).
--define(wxMenuItem_SetMenu, 971).
--define(wxMenuItem_SetSubMenu, 972).
--define(wxMenuItem_SetText, 973).
--define(wxToolBar_AddControl, 974).
--define(wxToolBar_AddSeparator, 975).
--define(wxToolBar_AddTool_5, 976).
--define(wxToolBar_AddTool_4_0, 977).
--define(wxToolBar_AddTool_1, 978).
--define(wxToolBar_AddTool_4_1, 979).
--define(wxToolBar_AddTool_3, 980).
--define(wxToolBar_AddTool_6, 981).
--define(wxToolBar_AddCheckTool, 982).
--define(wxToolBar_AddRadioTool, 983).
--define(wxToolBar_AddStretchableSpace, 984).
--define(wxToolBar_InsertStretchableSpace, 985).
--define(wxToolBar_DeleteTool, 986).
--define(wxToolBar_DeleteToolByPos, 987).
--define(wxToolBar_EnableTool, 988).
--define(wxToolBar_FindById, 989).
--define(wxToolBar_FindControl, 990).
--define(wxToolBar_FindToolForPosition, 991).
--define(wxToolBar_GetToolSize, 992).
--define(wxToolBar_GetToolBitmapSize, 993).
--define(wxToolBar_GetMargins, 994).
--define(wxToolBar_GetToolEnabled, 995).
--define(wxToolBar_GetToolLongHelp, 996).
--define(wxToolBar_GetToolPacking, 997).
--define(wxToolBar_GetToolPos, 998).
--define(wxToolBar_GetToolSeparation, 999).
--define(wxToolBar_GetToolShortHelp, 1000).
--define(wxToolBar_GetToolState, 1001).
--define(wxToolBar_InsertControl, 1002).
--define(wxToolBar_InsertSeparator, 1003).
--define(wxToolBar_InsertTool_5, 1004).
--define(wxToolBar_InsertTool_2, 1005).
--define(wxToolBar_InsertTool_4, 1006).
--define(wxToolBar_Realize, 1007).
--define(wxToolBar_RemoveTool, 1008).
--define(wxToolBar_SetMargins, 1009).
--define(wxToolBar_SetToolBitmapSize, 1010).
--define(wxToolBar_SetToolLongHelp, 1011).
--define(wxToolBar_SetToolPacking, 1012).
--define(wxToolBar_SetToolShortHelp, 1013).
--define(wxToolBar_SetToolSeparation, 1014).
--define(wxToolBar_ToggleTool, 1015).
--define(wxStatusBar_new_0, 1017).
--define(wxStatusBar_new_2, 1018).
--define(wxStatusBar_destruct, 1020).
--define(wxStatusBar_Create, 1021).
--define(wxStatusBar_GetFieldRect, 1022).
--define(wxStatusBar_GetFieldsCount, 1023).
--define(wxStatusBar_GetStatusText, 1024).
--define(wxStatusBar_PopStatusText, 1025).
--define(wxStatusBar_PushStatusText, 1026).
--define(wxStatusBar_SetFieldsCount, 1027).
--define(wxStatusBar_SetMinHeight, 1028).
--define(wxStatusBar_SetStatusText, 1029).
--define(wxStatusBar_SetStatusWidths, 1030).
--define(wxStatusBar_SetStatusStyles, 1031).
--define(wxBitmap_new_0, 1032).
--define(wxBitmap_new_3, 1033).
--define(wxBitmap_new_4, 1034).
--define(wxBitmap_new_2_0, 1035).
--define(wxBitmap_new_2_1, 1036).
--define(wxBitmap_destruct, 1037).
--define(wxBitmap_ConvertToImage, 1038).
--define(wxBitmap_CopyFromIcon, 1039).
--define(wxBitmap_Create, 1040).
--define(wxBitmap_GetDepth, 1041).
--define(wxBitmap_GetHeight, 1042).
--define(wxBitmap_GetPalette, 1043).
--define(wxBitmap_GetMask, 1044).
--define(wxBitmap_GetWidth, 1045).
--define(wxBitmap_GetSubBitmap, 1046).
--define(wxBitmap_LoadFile, 1047).
--define(wxBitmap_Ok, 1048).
--define(wxBitmap_SaveFile, 1049).
--define(wxBitmap_SetDepth, 1050).
--define(wxBitmap_SetHeight, 1051).
--define(wxBitmap_SetMask, 1052).
--define(wxBitmap_SetPalette, 1053).
--define(wxBitmap_SetWidth, 1054).
--define(wxIcon_new_0, 1055).
--define(wxIcon_new_2, 1056).
--define(wxIcon_new_1, 1057).
--define(wxIcon_CopyFromBitmap, 1058).
--define(wxIcon_destroy, 1059).
--define(wxIconBundle_new_0, 1060).
--define(wxIconBundle_new_2, 1061).
--define(wxIconBundle_new_1_0, 1062).
--define(wxIconBundle_new_1_1, 1063).
--define(wxIconBundle_destruct, 1064).
--define(wxIconBundle_AddIcon_2, 1065).
--define(wxIconBundle_AddIcon_1, 1066).
--define(wxIconBundle_GetIcon_1_1, 1067).
--define(wxIconBundle_GetIcon_1_0, 1068).
--define(wxCursor_new_0, 1069).
--define(wxCursor_new_1_0, 1070).
--define(wxCursor_new_1_1, 1071).
--define(wxCursor_new_4, 1072).
--define(wxCursor_destruct, 1073).
--define(wxCursor_Ok, 1074).
--define(wxMask_new_0, 1075).
--define(wxMask_new_2_1, 1076).
--define(wxMask_new_2_0, 1077).
--define(wxMask_new_1, 1078).
--define(wxMask_destruct, 1079).
--define(wxMask_Create_2_1, 1080).
--define(wxMask_Create_2_0, 1081).
--define(wxMask_Create_1, 1082).
--define(wxImage_new_0, 1083).
--define(wxImage_new_3_0, 1084).
--define(wxImage_new_4, 1085).
--define(wxImage_new_5, 1086).
--define(wxImage_new_2, 1087).
--define(wxImage_new_3_1, 1088).
--define(wxImage_Blur, 1089).
--define(wxImage_BlurHorizontal, 1090).
--define(wxImage_BlurVertical, 1091).
--define(wxImage_ConvertAlphaToMask, 1092).
--define(wxImage_ConvertToGreyscale, 1093).
--define(wxImage_ConvertToMono, 1094).
--define(wxImage_Copy, 1095).
--define(wxImage_Create_3, 1096).
--define(wxImage_Create_4, 1097).
--define(wxImage_Create_5, 1098).
--define(wxImage_Destroy, 1099).
--define(wxImage_FindFirstUnusedColour, 1100).
--define(wxImage_GetImageExtWildcard, 1101).
--define(wxImage_GetAlpha_2, 1102).
--define(wxImage_GetAlpha_0, 1103).
--define(wxImage_GetBlue, 1104).
--define(wxImage_GetData, 1105).
--define(wxImage_GetGreen, 1106).
--define(wxImage_GetImageCount, 1107).
--define(wxImage_GetHeight, 1108).
--define(wxImage_GetMaskBlue, 1109).
--define(wxImage_GetMaskGreen, 1110).
--define(wxImage_GetMaskRed, 1111).
--define(wxImage_GetOrFindMaskColour, 1112).
--define(wxImage_GetPalette, 1113).
--define(wxImage_GetRed, 1114).
--define(wxImage_GetSubImage, 1115).
--define(wxImage_GetWidth, 1116).
--define(wxImage_HasAlpha, 1117).
--define(wxImage_HasMask, 1118).
--define(wxImage_GetOption, 1119).
--define(wxImage_GetOptionInt, 1120).
--define(wxImage_HasOption, 1121).
--define(wxImage_InitAlpha, 1122).
--define(wxImage_InitStandardHandlers, 1123).
--define(wxImage_IsTransparent, 1124).
--define(wxImage_LoadFile_2, 1125).
--define(wxImage_LoadFile_3, 1126).
--define(wxImage_Ok, 1127).
--define(wxImage_RemoveHandler, 1128).
--define(wxImage_Mirror, 1129).
--define(wxImage_Replace, 1130).
--define(wxImage_Rescale, 1131).
--define(wxImage_Resize, 1132).
--define(wxImage_Rotate, 1133).
--define(wxImage_RotateHue, 1134).
--define(wxImage_Rotate90, 1135).
--define(wxImage_SaveFile_1, 1136).
--define(wxImage_SaveFile_2_0, 1137).
--define(wxImage_SaveFile_2_1, 1138).
--define(wxImage_Scale, 1139).
--define(wxImage_Size, 1140).
--define(wxImage_SetAlpha_3, 1141).
--define(wxImage_SetAlpha_2, 1142).
--define(wxImage_SetData_2, 1143).
--define(wxImage_SetData_4, 1144).
--define(wxImage_SetMask, 1145).
--define(wxImage_SetMaskColour, 1146).
--define(wxImage_SetMaskFromImage, 1147).
--define(wxImage_SetOption_2_1, 1148).
--define(wxImage_SetOption_2_0, 1149).
--define(wxImage_SetPalette, 1150).
--define(wxImage_SetRGB_5, 1151).
--define(wxImage_SetRGB_4, 1152).
--define(wxImage_destroy, 1153).
--define(wxBrush_new_0, 1154).
--define(wxBrush_new_2, 1155).
--define(wxBrush_new_1, 1156).
--define(wxBrush_destruct, 1158).
--define(wxBrush_GetColour, 1159).
--define(wxBrush_GetStipple, 1160).
--define(wxBrush_GetStyle, 1161).
--define(wxBrush_IsHatch, 1162).
--define(wxBrush_IsOk, 1163).
--define(wxBrush_SetColour_1, 1164).
--define(wxBrush_SetColour_3, 1165).
--define(wxBrush_SetStipple, 1166).
--define(wxBrush_SetStyle, 1167).
--define(wxPen_new_0, 1168).
--define(wxPen_new_2, 1169).
--define(wxPen_destruct, 1170).
--define(wxPen_GetCap, 1171).
--define(wxPen_GetColour, 1172).
--define(wxPen_GetJoin, 1173).
--define(wxPen_GetStyle, 1174).
--define(wxPen_GetWidth, 1175).
--define(wxPen_IsOk, 1176).
--define(wxPen_SetCap, 1177).
--define(wxPen_SetColour_1, 1178).
--define(wxPen_SetColour_3, 1179).
--define(wxPen_SetJoin, 1180).
--define(wxPen_SetStyle, 1181).
--define(wxPen_SetWidth, 1182).
--define(wxRegion_new_0, 1183).
--define(wxRegion_new_4, 1184).
--define(wxRegion_new_2, 1185).
--define(wxRegion_new_1_1, 1186).
--define(wxRegion_new_1_0, 1188).
--define(wxRegion_destruct, 1190).
--define(wxRegion_Clear, 1191).
--define(wxRegion_Contains_2, 1192).
--define(wxRegion_Contains_1_0, 1193).
--define(wxRegion_Contains_4, 1194).
--define(wxRegion_Contains_1_1, 1195).
--define(wxRegion_ConvertToBitmap, 1196).
--define(wxRegion_GetBox, 1197).
--define(wxRegion_Intersect_4, 1198).
--define(wxRegion_Intersect_1_1, 1199).
--define(wxRegion_Intersect_1_0, 1200).
--define(wxRegion_IsEmpty, 1201).
--define(wxRegion_Subtract_4, 1202).
--define(wxRegion_Subtract_1_1, 1203).
--define(wxRegion_Subtract_1_0, 1204).
--define(wxRegion_Offset_2, 1205).
--define(wxRegion_Offset_1, 1206).
--define(wxRegion_Union_4, 1207).
--define(wxRegion_Union_1_2, 1208).
--define(wxRegion_Union_1_1, 1209).
--define(wxRegion_Union_1_0, 1210).
--define(wxRegion_Union_3, 1211).
--define(wxRegion_Xor_4, 1212).
--define(wxRegion_Xor_1_1, 1213).
--define(wxRegion_Xor_1_0, 1214).
--define(wxAcceleratorTable_new_0, 1215).
--define(wxAcceleratorTable_new_2, 1216).
--define(wxAcceleratorTable_destruct, 1217).
--define(wxAcceleratorTable_Ok, 1218).
--define(wxAcceleratorEntry_new_1_0, 1219).
--define(wxAcceleratorEntry_new_1_1, 1220).
--define(wxAcceleratorEntry_GetCommand, 1221).
--define(wxAcceleratorEntry_GetFlags, 1222).
--define(wxAcceleratorEntry_GetKeyCode, 1223).
--define(wxAcceleratorEntry_Set, 1224).
--define(wxAcceleratorEntry_destroy, 1225).
--define(wxCaret_new_3, 1230).
--define(wxCaret_new_2, 1231).
--define(wxCaret_destruct, 1233).
--define(wxCaret_Create_3, 1234).
--define(wxCaret_Create_2, 1235).
--define(wxCaret_GetBlinkTime, 1236).
--define(wxCaret_GetPosition, 1238).
--define(wxCaret_GetSize, 1240).
--define(wxCaret_GetWindow, 1241).
--define(wxCaret_Hide, 1242).
--define(wxCaret_IsOk, 1243).
--define(wxCaret_IsVisible, 1244).
--define(wxCaret_Move_2, 1245).
--define(wxCaret_Move_1, 1246).
--define(wxCaret_SetBlinkTime, 1247).
--define(wxCaret_SetSize_2, 1248).
--define(wxCaret_SetSize_1, 1249).
--define(wxCaret_Show, 1250).
--define(wxSizer_Add_2_1, 1251).
--define(wxSizer_Add_2_0, 1252).
--define(wxSizer_Add_3, 1253).
--define(wxSizer_Add_2_3, 1254).
--define(wxSizer_Add_2_2, 1255).
--define(wxSizer_AddSpacer, 1256).
--define(wxSizer_AddStretchSpacer, 1257).
--define(wxSizer_CalcMin, 1258).
--define(wxSizer_Clear, 1259).
--define(wxSizer_Detach_1_2, 1260).
--define(wxSizer_Detach_1_1, 1261).
--define(wxSizer_Detach_1_0, 1262).
--define(wxSizer_Fit, 1263).
--define(wxSizer_FitInside, 1264).
--define(wxSizer_GetChildren, 1265).
--define(wxSizer_GetItem_2_1, 1266).
--define(wxSizer_GetItem_2_0, 1267).
--define(wxSizer_GetItem_1, 1268).
--define(wxSizer_GetSize, 1269).
--define(wxSizer_GetPosition, 1270).
--define(wxSizer_GetMinSize, 1271).
--define(wxSizer_Hide_2_0, 1272).
--define(wxSizer_Hide_2_1, 1273).
--define(wxSizer_Hide_1, 1274).
--define(wxSizer_Insert_3_1, 1275).
--define(wxSizer_Insert_3_0, 1276).
--define(wxSizer_Insert_4, 1277).
--define(wxSizer_Insert_3_3, 1278).
--define(wxSizer_Insert_3_2, 1279).
--define(wxSizer_Insert_2, 1280).
--define(wxSizer_InsertSpacer, 1281).
--define(wxSizer_InsertStretchSpacer, 1282).
--define(wxSizer_IsShown_1_2, 1283).
--define(wxSizer_IsShown_1_1, 1284).
--define(wxSizer_IsShown_1_0, 1285).
--define(wxSizer_Layout, 1286).
--define(wxSizer_Prepend_2_1, 1287).
--define(wxSizer_Prepend_2_0, 1288).
--define(wxSizer_Prepend_3, 1289).
--define(wxSizer_Prepend_2_3, 1290).
--define(wxSizer_Prepend_2_2, 1291).
--define(wxSizer_Prepend_1, 1292).
--define(wxSizer_PrependSpacer, 1293).
--define(wxSizer_PrependStretchSpacer, 1294).
--define(wxSizer_RecalcSizes, 1295).
--define(wxSizer_Remove_1_1, 1296).
--define(wxSizer_Remove_1_0, 1297).
--define(wxSizer_Replace_3_1, 1298).
--define(wxSizer_Replace_3_0, 1299).
--define(wxSizer_Replace_2, 1300).
--define(wxSizer_SetDimension, 1301).
--define(wxSizer_SetMinSize_2, 1302).
--define(wxSizer_SetMinSize_1, 1303).
--define(wxSizer_SetItemMinSize_3_2, 1304).
--define(wxSizer_SetItemMinSize_2_2, 1305).
--define(wxSizer_SetItemMinSize_3_1, 1306).
--define(wxSizer_SetItemMinSize_2_1, 1307).
--define(wxSizer_SetItemMinSize_3_0, 1308).
--define(wxSizer_SetItemMinSize_2_0, 1309).
--define(wxSizer_SetSizeHints, 1310).
--define(wxSizer_SetVirtualSizeHints, 1311).
--define(wxSizer_Show_2_2, 1312).
--define(wxSizer_Show_2_1, 1313).
--define(wxSizer_Show_2_0, 1314).
--define(wxSizer_Show_1, 1315).
--define(wxSizerFlags_new, 1316).
--define(wxSizerFlags_Align, 1317).
--define(wxSizerFlags_Border_2, 1318).
--define(wxSizerFlags_Border_1, 1319).
--define(wxSizerFlags_Center, 1320).
--define(wxSizerFlags_Centre, 1321).
--define(wxSizerFlags_Expand, 1322).
--define(wxSizerFlags_Left, 1323).
--define(wxSizerFlags_Proportion, 1324).
--define(wxSizerFlags_Right, 1325).
--define(wxSizerFlags_destroy, 1326).
--define(wxSizerItem_new_5_1, 1327).
--define(wxSizerItem_new_2_1, 1328).
--define(wxSizerItem_new_5_0, 1329).
--define(wxSizerItem_new_2_0, 1330).
--define(wxSizerItem_new_6, 1331).
--define(wxSizerItem_new_3, 1332).
--define(wxSizerItem_new_0, 1333).
--define(wxSizerItem_destruct, 1334).
--define(wxSizerItem_CalcMin, 1335).
--define(wxSizerItem_DeleteWindows, 1336).
--define(wxSizerItem_DetachSizer, 1337).
--define(wxSizerItem_GetBorder, 1338).
--define(wxSizerItem_GetFlag, 1339).
--define(wxSizerItem_GetMinSize, 1340).
--define(wxSizerItem_GetPosition, 1341).
--define(wxSizerItem_GetProportion, 1342).
--define(wxSizerItem_GetRatio, 1343).
--define(wxSizerItem_GetRect, 1344).
--define(wxSizerItem_GetSize, 1345).
--define(wxSizerItem_GetSizer, 1346).
--define(wxSizerItem_GetSpacer, 1347).
--define(wxSizerItem_GetUserData, 1348).
--define(wxSizerItem_GetWindow, 1349).
--define(wxSizerItem_IsSizer, 1350).
--define(wxSizerItem_IsShown, 1351).
--define(wxSizerItem_IsSpacer, 1352).
--define(wxSizerItem_IsWindow, 1353).
--define(wxSizerItem_SetBorder, 1354).
--define(wxSizerItem_SetDimension, 1355).
--define(wxSizerItem_SetFlag, 1356).
--define(wxSizerItem_SetInitSize, 1357).
--define(wxSizerItem_SetMinSize_1, 1358).
--define(wxSizerItem_SetMinSize_2, 1359).
--define(wxSizerItem_SetProportion, 1360).
--define(wxSizerItem_SetRatio_2, 1361).
--define(wxSizerItem_SetRatio_1_1, 1362).
--define(wxSizerItem_SetRatio_1_0, 1363).
--define(wxSizerItem_SetSizer, 1364).
--define(wxSizerItem_SetSpacer_1, 1365).
--define(wxSizerItem_SetSpacer_2, 1366).
--define(wxSizerItem_SetWindow, 1367).
--define(wxSizerItem_Show, 1368).
--define(wxBoxSizer_new, 1369).
--define(wxBoxSizer_GetOrientation, 1370).
--define(wxBoxSizer_destroy, 1371).
--define(wxStaticBoxSizer_new_2, 1372).
--define(wxStaticBoxSizer_new_3, 1373).
--define(wxStaticBoxSizer_GetStaticBox, 1374).
--define(wxStaticBoxSizer_destroy, 1375).
--define(wxGridSizer_new_4, 1376).
--define(wxGridSizer_new_2, 1377).
--define(wxGridSizer_GetCols, 1378).
--define(wxGridSizer_GetHGap, 1379).
--define(wxGridSizer_GetRows, 1380).
--define(wxGridSizer_GetVGap, 1381).
--define(wxGridSizer_SetCols, 1382).
--define(wxGridSizer_SetHGap, 1383).
--define(wxGridSizer_SetRows, 1384).
--define(wxGridSizer_SetVGap, 1385).
--define(wxGridSizer_destroy, 1386).
--define(wxFlexGridSizer_new_4, 1387).
--define(wxFlexGridSizer_new_2, 1388).
--define(wxFlexGridSizer_AddGrowableCol, 1389).
--define(wxFlexGridSizer_AddGrowableRow, 1390).
--define(wxFlexGridSizer_GetFlexibleDirection, 1391).
--define(wxFlexGridSizer_GetNonFlexibleGrowMode, 1392).
--define(wxFlexGridSizer_RemoveGrowableCol, 1393).
--define(wxFlexGridSizer_RemoveGrowableRow, 1394).
--define(wxFlexGridSizer_SetFlexibleDirection, 1395).
--define(wxFlexGridSizer_SetNonFlexibleGrowMode, 1396).
--define(wxFlexGridSizer_destroy, 1397).
--define(wxGridBagSizer_new, 1398).
--define(wxGridBagSizer_Add_3_2, 1399).
--define(wxGridBagSizer_Add_3_1, 1400).
--define(wxGridBagSizer_Add_4, 1401).
--define(wxGridBagSizer_Add_1_0, 1402).
--define(wxGridBagSizer_Add_2_1, 1403).
--define(wxGridBagSizer_Add_2_0, 1404).
--define(wxGridBagSizer_Add_3_0, 1405).
--define(wxGridBagSizer_Add_1_1, 1406).
--define(wxGridBagSizer_CalcMin, 1407).
--define(wxGridBagSizer_CheckForIntersection_2, 1408).
--define(wxGridBagSizer_CheckForIntersection_3, 1409).
--define(wxGridBagSizer_FindItem_1_1, 1410).
--define(wxGridBagSizer_FindItem_1_0, 1411).
--define(wxGridBagSizer_FindItemAtPoint, 1412).
--define(wxGridBagSizer_FindItemAtPosition, 1413).
--define(wxGridBagSizer_FindItemWithData, 1414).
--define(wxGridBagSizer_GetCellSize, 1415).
--define(wxGridBagSizer_GetEmptyCellSize, 1416).
--define(wxGridBagSizer_GetItemPosition_1_2, 1417).
--define(wxGridBagSizer_GetItemPosition_1_1, 1418).
--define(wxGridBagSizer_GetItemPosition_1_0, 1419).
--define(wxGridBagSizer_GetItemSpan_1_2, 1420).
--define(wxGridBagSizer_GetItemSpan_1_1, 1421).
--define(wxGridBagSizer_GetItemSpan_1_0, 1422).
--define(wxGridBagSizer_SetEmptyCellSize, 1423).
--define(wxGridBagSizer_SetItemPosition_2_2, 1424).
--define(wxGridBagSizer_SetItemPosition_2_1, 1425).
--define(wxGridBagSizer_SetItemPosition_2_0, 1426).
--define(wxGridBagSizer_SetItemSpan_2_2, 1427).
--define(wxGridBagSizer_SetItemSpan_2_1, 1428).
--define(wxGridBagSizer_SetItemSpan_2_0, 1429).
--define(wxGridBagSizer_destroy, 1430).
--define(wxStdDialogButtonSizer_new, 1431).
--define(wxStdDialogButtonSizer_AddButton, 1432).
--define(wxStdDialogButtonSizer_Realize, 1433).
--define(wxStdDialogButtonSizer_SetAffirmativeButton, 1434).
--define(wxStdDialogButtonSizer_SetCancelButton, 1435).
--define(wxStdDialogButtonSizer_SetNegativeButton, 1436).
--define(wxStdDialogButtonSizer_destroy, 1437).
--define(wxFont_new_0, 1438).
--define(wxFont_new_1, 1439).
--define(wxFont_new_5, 1440).
--define(wxFont_destruct, 1442).
--define(wxFont_IsFixedWidth, 1443).
--define(wxFont_GetDefaultEncoding, 1444).
--define(wxFont_GetFaceName, 1445).
--define(wxFont_GetFamily, 1446).
--define(wxFont_GetNativeFontInfoDesc, 1447).
--define(wxFont_GetNativeFontInfoUserDesc, 1448).
--define(wxFont_GetPointSize, 1449).
--define(wxFont_GetStyle, 1450).
--define(wxFont_GetUnderlined, 1451).
--define(wxFont_GetWeight, 1452).
--define(wxFont_Ok, 1453).
--define(wxFont_SetDefaultEncoding, 1454).
--define(wxFont_SetFaceName, 1455).
--define(wxFont_SetFamily, 1456).
--define(wxFont_SetPointSize, 1457).
--define(wxFont_SetStyle, 1458).
--define(wxFont_SetUnderlined, 1459).
--define(wxFont_SetWeight, 1460).
--define(wxToolTip_Enable, 1461).
--define(wxToolTip_SetDelay, 1462).
--define(wxToolTip_new, 1463).
--define(wxToolTip_SetTip, 1464).
--define(wxToolTip_GetTip, 1465).
--define(wxToolTip_GetWindow, 1466).
--define(wxToolTip_destroy, 1467).
--define(wxButton_new_3, 1469).
--define(wxButton_new_0, 1470).
--define(wxButton_destruct, 1471).
--define(wxButton_Create, 1472).
--define(wxButton_GetDefaultSize, 1473).
--define(wxButton_SetDefault, 1474).
--define(wxButton_SetLabel, 1475).
--define(wxBitmapButton_new_4, 1477).
--define(wxBitmapButton_new_0, 1478).
--define(wxBitmapButton_Create, 1479).
--define(wxBitmapButton_GetBitmapDisabled, 1480).
--define(wxBitmapButton_GetBitmapFocus, 1482).
--define(wxBitmapButton_GetBitmapLabel, 1484).
--define(wxBitmapButton_GetBitmapSelected, 1486).
--define(wxBitmapButton_SetBitmapDisabled, 1488).
--define(wxBitmapButton_SetBitmapFocus, 1489).
--define(wxBitmapButton_SetBitmapLabel, 1490).
--define(wxBitmapButton_SetBitmapSelected, 1491).
--define(wxBitmapButton_destroy, 1492).
--define(wxToggleButton_new_0, 1493).
--define(wxToggleButton_new_4, 1494).
--define(wxToggleButton_Create, 1495).
--define(wxToggleButton_GetValue, 1496).
--define(wxToggleButton_SetValue, 1497).
--define(wxToggleButton_destroy, 1498).
--define(wxCalendarCtrl_new_0, 1499).
--define(wxCalendarCtrl_new_3, 1500).
--define(wxCalendarCtrl_Create, 1501).
--define(wxCalendarCtrl_destruct, 1502).
--define(wxCalendarCtrl_SetDate, 1503).
--define(wxCalendarCtrl_GetDate, 1504).
--define(wxCalendarCtrl_EnableYearChange, 1505).
--define(wxCalendarCtrl_EnableMonthChange, 1506).
--define(wxCalendarCtrl_EnableHolidayDisplay, 1507).
--define(wxCalendarCtrl_SetHeaderColours, 1508).
--define(wxCalendarCtrl_GetHeaderColourFg, 1509).
--define(wxCalendarCtrl_GetHeaderColourBg, 1510).
--define(wxCalendarCtrl_SetHighlightColours, 1511).
--define(wxCalendarCtrl_GetHighlightColourFg, 1512).
--define(wxCalendarCtrl_GetHighlightColourBg, 1513).
--define(wxCalendarCtrl_SetHolidayColours, 1514).
--define(wxCalendarCtrl_GetHolidayColourFg, 1515).
--define(wxCalendarCtrl_GetHolidayColourBg, 1516).
--define(wxCalendarCtrl_GetAttr, 1517).
--define(wxCalendarCtrl_SetAttr, 1518).
--define(wxCalendarCtrl_SetHoliday, 1519).
--define(wxCalendarCtrl_ResetAttr, 1520).
--define(wxCalendarCtrl_HitTest, 1521).
--define(wxCalendarDateAttr_new_0, 1522).
--define(wxCalendarDateAttr_new_2_1, 1523).
--define(wxCalendarDateAttr_new_2_0, 1524).
--define(wxCalendarDateAttr_SetTextColour, 1525).
--define(wxCalendarDateAttr_SetBackgroundColour, 1526).
--define(wxCalendarDateAttr_SetBorderColour, 1527).
--define(wxCalendarDateAttr_SetFont, 1528).
--define(wxCalendarDateAttr_SetBorder, 1529).
--define(wxCalendarDateAttr_SetHoliday, 1530).
--define(wxCalendarDateAttr_HasTextColour, 1531).
--define(wxCalendarDateAttr_HasBackgroundColour, 1532).
--define(wxCalendarDateAttr_HasBorderColour, 1533).
--define(wxCalendarDateAttr_HasFont, 1534).
--define(wxCalendarDateAttr_HasBorder, 1535).
--define(wxCalendarDateAttr_IsHoliday, 1536).
--define(wxCalendarDateAttr_GetTextColour, 1537).
--define(wxCalendarDateAttr_GetBackgroundColour, 1538).
--define(wxCalendarDateAttr_GetBorderColour, 1539).
--define(wxCalendarDateAttr_GetFont, 1540).
--define(wxCalendarDateAttr_GetBorder, 1541).
--define(wxCalendarDateAttr_destroy, 1542).
--define(wxCheckBox_new_4, 1544).
--define(wxCheckBox_new_0, 1545).
--define(wxCheckBox_Create, 1546).
--define(wxCheckBox_GetValue, 1547).
--define(wxCheckBox_Get3StateValue, 1548).
--define(wxCheckBox_Is3rdStateAllowedForUser, 1549).
--define(wxCheckBox_Is3State, 1550).
--define(wxCheckBox_IsChecked, 1551).
--define(wxCheckBox_SetValue, 1552).
--define(wxCheckBox_Set3StateValue, 1553).
--define(wxCheckBox_destroy, 1554).
--define(wxCheckListBox_new_0, 1555).
--define(wxCheckListBox_new_3, 1557).
--define(wxCheckListBox_Check, 1558).
--define(wxCheckListBox_IsChecked, 1559).
--define(wxCheckListBox_destroy, 1560).
--define(wxChoice_new_3, 1563).
--define(wxChoice_new_0, 1564).
--define(wxChoice_destruct, 1566).
--define(wxChoice_Create, 1568).
--define(wxChoice_Delete, 1569).
--define(wxChoice_GetColumns, 1570).
--define(wxChoice_SetColumns, 1571).
--define(wxComboBox_new_0, 1572).
--define(wxComboBox_new_3, 1574).
--define(wxComboBox_destruct, 1575).
--define(wxComboBox_Create, 1577).
--define(wxComboBox_CanCopy, 1578).
--define(wxComboBox_CanCut, 1579).
--define(wxComboBox_CanPaste, 1580).
--define(wxComboBox_CanRedo, 1581).
--define(wxComboBox_CanUndo, 1582).
--define(wxComboBox_Copy, 1583).
--define(wxComboBox_Cut, 1584).
--define(wxComboBox_GetInsertionPoint, 1585).
--define(wxComboBox_GetLastPosition, 1586).
--define(wxComboBox_GetValue, 1587).
--define(wxComboBox_Paste, 1588).
--define(wxComboBox_Redo, 1589).
--define(wxComboBox_Replace, 1590).
--define(wxComboBox_Remove, 1591).
--define(wxComboBox_SetInsertionPoint, 1592).
--define(wxComboBox_SetInsertionPointEnd, 1593).
--define(wxComboBox_SetSelection_1, 1594).
--define(wxComboBox_SetSelection_2, 1595).
--define(wxComboBox_SetValue, 1596).
--define(wxComboBox_Undo, 1597).
--define(wxGauge_new_0, 1598).
--define(wxGauge_new_4, 1599).
--define(wxGauge_Create, 1600).
--define(wxGauge_GetBezelFace, 1601).
--define(wxGauge_GetRange, 1602).
--define(wxGauge_GetShadowWidth, 1603).
--define(wxGauge_GetValue, 1604).
--define(wxGauge_IsVertical, 1605).
--define(wxGauge_SetBezelFace, 1606).
--define(wxGauge_SetRange, 1607).
--define(wxGauge_SetShadowWidth, 1608).
--define(wxGauge_SetValue, 1609).
--define(wxGauge_Pulse, 1610).
--define(wxGauge_destroy, 1611).
--define(wxGenericDirCtrl_new_0, 1612).
--define(wxGenericDirCtrl_new_2, 1613).
--define(wxGenericDirCtrl_destruct, 1614).
--define(wxGenericDirCtrl_Create, 1615).
--define(wxGenericDirCtrl_Init, 1616).
--define(wxGenericDirCtrl_CollapseTree, 1617).
--define(wxGenericDirCtrl_ExpandPath, 1618).
--define(wxGenericDirCtrl_GetDefaultPath, 1619).
--define(wxGenericDirCtrl_GetPath, 1620).
--define(wxGenericDirCtrl_GetFilePath, 1621).
--define(wxGenericDirCtrl_GetFilter, 1622).
--define(wxGenericDirCtrl_GetFilterIndex, 1623).
--define(wxGenericDirCtrl_GetRootId, 1624).
--define(wxGenericDirCtrl_GetTreeCtrl, 1625).
--define(wxGenericDirCtrl_ReCreateTree, 1626).
--define(wxGenericDirCtrl_SetDefaultPath, 1627).
--define(wxGenericDirCtrl_SetFilter, 1628).
--define(wxGenericDirCtrl_SetFilterIndex, 1629).
--define(wxGenericDirCtrl_SetPath, 1630).
--define(wxStaticBox_new_4, 1632).
--define(wxStaticBox_new_0, 1633).
--define(wxStaticBox_Create, 1634).
--define(wxStaticBox_destroy, 1635).
--define(wxStaticLine_new_2, 1637).
--define(wxStaticLine_new_0, 1638).
--define(wxStaticLine_Create, 1639).
--define(wxStaticLine_IsVertical, 1640).
--define(wxStaticLine_GetDefaultSize, 1641).
--define(wxStaticLine_destroy, 1642).
--define(wxListBox_new_3, 1645).
--define(wxListBox_new_0, 1646).
--define(wxListBox_destruct, 1648).
--define(wxListBox_Create, 1650).
--define(wxListBox_Deselect, 1651).
--define(wxListBox_GetSelections, 1652).
--define(wxListBox_InsertItems, 1653).
--define(wxListBox_IsSelected, 1654).
--define(wxListBox_Set, 1655).
--define(wxListBox_HitTest, 1656).
--define(wxListBox_SetFirstItem_1_0, 1657).
--define(wxListBox_SetFirstItem_1_1, 1658).
--define(wxListCtrl_new_0, 1659).
--define(wxListCtrl_new_2, 1660).
--define(wxListCtrl_Arrange, 1661).
--define(wxListCtrl_AssignImageList, 1662).
--define(wxListCtrl_ClearAll, 1663).
--define(wxListCtrl_Create, 1664).
--define(wxListCtrl_DeleteAllItems, 1665).
--define(wxListCtrl_DeleteColumn, 1666).
--define(wxListCtrl_DeleteItem, 1667).
--define(wxListCtrl_EditLabel, 1668).
--define(wxListCtrl_EnsureVisible, 1669).
--define(wxListCtrl_FindItem_3_0, 1670).
--define(wxListCtrl_FindItem_3_1, 1671).
--define(wxListCtrl_GetColumn, 1672).
--define(wxListCtrl_GetColumnCount, 1673).
--define(wxListCtrl_GetColumnWidth, 1674).
--define(wxListCtrl_GetCountPerPage, 1675).
--define(wxListCtrl_GetEditControl, 1676).
--define(wxListCtrl_GetImageList, 1677).
--define(wxListCtrl_GetItem, 1678).
--define(wxListCtrl_GetItemBackgroundColour, 1679).
--define(wxListCtrl_GetItemCount, 1680).
--define(wxListCtrl_GetItemData, 1681).
--define(wxListCtrl_GetItemFont, 1682).
--define(wxListCtrl_GetItemPosition, 1683).
--define(wxListCtrl_GetItemRect, 1684).
--define(wxListCtrl_GetItemSpacing, 1685).
--define(wxListCtrl_GetItemState, 1686).
--define(wxListCtrl_GetItemText, 1687).
--define(wxListCtrl_GetItemTextColour, 1688).
--define(wxListCtrl_GetNextItem, 1689).
--define(wxListCtrl_GetSelectedItemCount, 1690).
--define(wxListCtrl_GetTextColour, 1691).
--define(wxListCtrl_GetTopItem, 1692).
--define(wxListCtrl_GetViewRect, 1693).
--define(wxListCtrl_HitTest, 1694).
--define(wxListCtrl_InsertColumn_2, 1695).
--define(wxListCtrl_InsertColumn_3, 1696).
--define(wxListCtrl_InsertItem_1, 1697).
--define(wxListCtrl_InsertItem_2_1, 1698).
--define(wxListCtrl_InsertItem_2_0, 1699).
--define(wxListCtrl_InsertItem_3, 1700).
--define(wxListCtrl_RefreshItem, 1701).
--define(wxListCtrl_RefreshItems, 1702).
--define(wxListCtrl_ScrollList, 1703).
--define(wxListCtrl_SetBackgroundColour, 1704).
--define(wxListCtrl_SetColumn, 1705).
--define(wxListCtrl_SetColumnWidth, 1706).
--define(wxListCtrl_SetImageList, 1707).
--define(wxListCtrl_SetItem_1, 1708).
--define(wxListCtrl_SetItem_4, 1709).
--define(wxListCtrl_SetItemBackgroundColour, 1710).
--define(wxListCtrl_SetItemCount, 1711).
--define(wxListCtrl_SetItemData, 1712).
--define(wxListCtrl_SetItemFont, 1713).
--define(wxListCtrl_SetItemImage, 1714).
--define(wxListCtrl_SetItemColumnImage, 1715).
--define(wxListCtrl_SetItemPosition, 1716).
--define(wxListCtrl_SetItemState, 1717).
--define(wxListCtrl_SetItemText, 1718).
--define(wxListCtrl_SetItemTextColour, 1719).
--define(wxListCtrl_SetSingleStyle, 1720).
--define(wxListCtrl_SetTextColour, 1721).
--define(wxListCtrl_SetWindowStyleFlag, 1722).
--define(wxListCtrl_SortItems, 1723).
--define(wxListCtrl_destroy, 1724).
--define(wxListView_ClearColumnImage, 1725).
--define(wxListView_Focus, 1726).
--define(wxListView_GetFirstSelected, 1727).
--define(wxListView_GetFocusedItem, 1728).
--define(wxListView_GetNextSelected, 1729).
--define(wxListView_IsSelected, 1730).
--define(wxListView_Select, 1731).
--define(wxListView_SetColumnImage, 1732).
--define(wxListItem_new_0, 1733).
--define(wxListItem_new_1, 1734).
--define(wxListItem_destruct, 1735).
--define(wxListItem_Clear, 1736).
--define(wxListItem_GetAlign, 1737).
--define(wxListItem_GetBackgroundColour, 1738).
--define(wxListItem_GetColumn, 1739).
--define(wxListItem_GetFont, 1740).
--define(wxListItem_GetId, 1741).
--define(wxListItem_GetImage, 1742).
--define(wxListItem_GetMask, 1743).
--define(wxListItem_GetState, 1744).
--define(wxListItem_GetText, 1745).
--define(wxListItem_GetTextColour, 1746).
--define(wxListItem_GetWidth, 1747).
--define(wxListItem_SetAlign, 1748).
--define(wxListItem_SetBackgroundColour, 1749).
--define(wxListItem_SetColumn, 1750).
--define(wxListItem_SetFont, 1751).
--define(wxListItem_SetId, 1752).
--define(wxListItem_SetImage, 1753).
--define(wxListItem_SetMask, 1754).
--define(wxListItem_SetState, 1755).
--define(wxListItem_SetStateMask, 1756).
--define(wxListItem_SetText, 1757).
--define(wxListItem_SetTextColour, 1758).
--define(wxListItem_SetWidth, 1759).
--define(wxListItemAttr_new_0, 1760).
--define(wxListItemAttr_new_3, 1761).
--define(wxListItemAttr_GetBackgroundColour, 1762).
--define(wxListItemAttr_GetFont, 1763).
--define(wxListItemAttr_GetTextColour, 1764).
--define(wxListItemAttr_HasBackgroundColour, 1765).
--define(wxListItemAttr_HasFont, 1766).
--define(wxListItemAttr_HasTextColour, 1767).
--define(wxListItemAttr_SetBackgroundColour, 1768).
--define(wxListItemAttr_SetFont, 1769).
--define(wxListItemAttr_SetTextColour, 1770).
--define(wxListItemAttr_destroy, 1771).
--define(wxImageList_new_0, 1772).
--define(wxImageList_new_3, 1773).
--define(wxImageList_Add_1, 1774).
--define(wxImageList_Add_2_0, 1775).
--define(wxImageList_Add_2_1, 1776).
--define(wxImageList_Create, 1777).
--define(wxImageList_Draw, 1779).
--define(wxImageList_GetBitmap, 1780).
--define(wxImageList_GetIcon, 1781).
--define(wxImageList_GetImageCount, 1782).
--define(wxImageList_GetSize, 1783).
--define(wxImageList_Remove, 1784).
--define(wxImageList_RemoveAll, 1785).
--define(wxImageList_Replace_2, 1786).
--define(wxImageList_Replace_3, 1787).
--define(wxImageList_destroy, 1788).
--define(wxTextAttr_new_0, 1789).
--define(wxTextAttr_new_2, 1790).
--define(wxTextAttr_GetAlignment, 1791).
--define(wxTextAttr_GetBackgroundColour, 1792).
--define(wxTextAttr_GetFont, 1793).
--define(wxTextAttr_GetLeftIndent, 1794).
--define(wxTextAttr_GetLeftSubIndent, 1795).
--define(wxTextAttr_GetRightIndent, 1796).
--define(wxTextAttr_GetTabs, 1797).
--define(wxTextAttr_GetTextColour, 1798).
--define(wxTextAttr_HasBackgroundColour, 1799).
--define(wxTextAttr_HasFont, 1800).
--define(wxTextAttr_HasTextColour, 1801).
--define(wxTextAttr_GetFlags, 1802).
--define(wxTextAttr_IsDefault, 1803).
--define(wxTextAttr_SetAlignment, 1804).
--define(wxTextAttr_SetBackgroundColour, 1805).
--define(wxTextAttr_SetFlags, 1806).
--define(wxTextAttr_SetFont, 1807).
--define(wxTextAttr_SetLeftIndent, 1808).
--define(wxTextAttr_SetRightIndent, 1809).
--define(wxTextAttr_SetTabs, 1810).
--define(wxTextAttr_SetTextColour, 1811).
--define(wxTextAttr_destroy, 1812).
--define(wxTextCtrl_new_3, 1814).
--define(wxTextCtrl_new_0, 1815).
--define(wxTextCtrl_destruct, 1817).
--define(wxTextCtrl_AppendText, 1818).
--define(wxTextCtrl_CanCopy, 1819).
--define(wxTextCtrl_CanCut, 1820).
--define(wxTextCtrl_CanPaste, 1821).
--define(wxTextCtrl_CanRedo, 1822).
--define(wxTextCtrl_CanUndo, 1823).
--define(wxTextCtrl_Clear, 1824).
--define(wxTextCtrl_Copy, 1825).
--define(wxTextCtrl_Create, 1826).
--define(wxTextCtrl_Cut, 1827).
--define(wxTextCtrl_DiscardEdits, 1828).
--define(wxTextCtrl_ChangeValue, 1829).
--define(wxTextCtrl_EmulateKeyPress, 1830).
--define(wxTextCtrl_GetDefaultStyle, 1831).
--define(wxTextCtrl_GetInsertionPoint, 1832).
--define(wxTextCtrl_GetLastPosition, 1833).
--define(wxTextCtrl_GetLineLength, 1834).
--define(wxTextCtrl_GetLineText, 1835).
--define(wxTextCtrl_GetNumberOfLines, 1836).
--define(wxTextCtrl_GetRange, 1837).
--define(wxTextCtrl_GetSelection, 1838).
--define(wxTextCtrl_GetStringSelection, 1839).
--define(wxTextCtrl_GetStyle, 1840).
--define(wxTextCtrl_GetValue, 1841).
--define(wxTextCtrl_IsEditable, 1842).
--define(wxTextCtrl_IsModified, 1843).
--define(wxTextCtrl_IsMultiLine, 1844).
--define(wxTextCtrl_IsSingleLine, 1845).
--define(wxTextCtrl_LoadFile, 1846).
--define(wxTextCtrl_MarkDirty, 1847).
--define(wxTextCtrl_Paste, 1848).
--define(wxTextCtrl_PositionToXY, 1849).
--define(wxTextCtrl_Redo, 1850).
--define(wxTextCtrl_Remove, 1851).
--define(wxTextCtrl_Replace, 1852).
--define(wxTextCtrl_SaveFile, 1853).
--define(wxTextCtrl_SetDefaultStyle, 1854).
--define(wxTextCtrl_SetEditable, 1855).
--define(wxTextCtrl_SetInsertionPoint, 1856).
--define(wxTextCtrl_SetInsertionPointEnd, 1857).
--define(wxTextCtrl_SetMaxLength, 1859).
--define(wxTextCtrl_SetSelection, 1860).
--define(wxTextCtrl_SetStyle, 1861).
--define(wxTextCtrl_SetValue, 1862).
--define(wxTextCtrl_ShowPosition, 1863).
--define(wxTextCtrl_Undo, 1864).
--define(wxTextCtrl_WriteText, 1865).
--define(wxTextCtrl_XYToPosition, 1866).
--define(wxNotebook_new_0, 1869).
--define(wxNotebook_new_3, 1870).
--define(wxNotebook_destruct, 1871).
--define(wxNotebook_AddPage, 1872).
--define(wxNotebook_AdvanceSelection, 1873).
--define(wxNotebook_AssignImageList, 1874).
--define(wxNotebook_Create, 1875).
--define(wxNotebook_DeleteAllPages, 1876).
--define(wxNotebook_DeletePage, 1877).
--define(wxNotebook_RemovePage, 1878).
--define(wxNotebook_GetCurrentPage, 1879).
--define(wxNotebook_GetImageList, 1880).
--define(wxNotebook_GetPage, 1882).
--define(wxNotebook_GetPageCount, 1883).
--define(wxNotebook_GetPageImage, 1884).
--define(wxNotebook_GetPageText, 1885).
--define(wxNotebook_GetRowCount, 1886).
--define(wxNotebook_GetSelection, 1887).
--define(wxNotebook_GetThemeBackgroundColour, 1888).
--define(wxNotebook_HitTest, 1890).
--define(wxNotebook_InsertPage, 1892).
--define(wxNotebook_SetImageList, 1893).
--define(wxNotebook_SetPadding, 1894).
--define(wxNotebook_SetPageSize, 1895).
--define(wxNotebook_SetPageImage, 1896).
--define(wxNotebook_SetPageText, 1897).
--define(wxNotebook_SetSelection, 1898).
--define(wxNotebook_ChangeSelection, 1899).
--define(wxChoicebook_new_0, 1900).
--define(wxChoicebook_new_3, 1901).
--define(wxChoicebook_AddPage, 1902).
--define(wxChoicebook_AdvanceSelection, 1903).
--define(wxChoicebook_AssignImageList, 1904).
--define(wxChoicebook_Create, 1905).
--define(wxChoicebook_DeleteAllPages, 1906).
--define(wxChoicebook_DeletePage, 1907).
--define(wxChoicebook_RemovePage, 1908).
--define(wxChoicebook_GetCurrentPage, 1909).
--define(wxChoicebook_GetImageList, 1910).
--define(wxChoicebook_GetPage, 1912).
--define(wxChoicebook_GetPageCount, 1913).
--define(wxChoicebook_GetPageImage, 1914).
--define(wxChoicebook_GetPageText, 1915).
--define(wxChoicebook_GetSelection, 1916).
--define(wxChoicebook_HitTest, 1917).
--define(wxChoicebook_InsertPage, 1918).
--define(wxChoicebook_SetImageList, 1919).
--define(wxChoicebook_SetPageSize, 1920).
--define(wxChoicebook_SetPageImage, 1921).
--define(wxChoicebook_SetPageText, 1922).
--define(wxChoicebook_SetSelection, 1923).
--define(wxChoicebook_ChangeSelection, 1924).
--define(wxChoicebook_destroy, 1925).
--define(wxToolbook_new_0, 1926).
--define(wxToolbook_new_3, 1927).
--define(wxToolbook_AddPage, 1928).
--define(wxToolbook_AdvanceSelection, 1929).
--define(wxToolbook_AssignImageList, 1930).
--define(wxToolbook_Create, 1931).
--define(wxToolbook_DeleteAllPages, 1932).
--define(wxToolbook_DeletePage, 1933).
--define(wxToolbook_RemovePage, 1934).
--define(wxToolbook_GetCurrentPage, 1935).
--define(wxToolbook_GetImageList, 1936).
--define(wxToolbook_GetPage, 1938).
--define(wxToolbook_GetPageCount, 1939).
--define(wxToolbook_GetPageImage, 1940).
--define(wxToolbook_GetPageText, 1941).
--define(wxToolbook_GetSelection, 1942).
--define(wxToolbook_HitTest, 1944).
--define(wxToolbook_InsertPage, 1945).
--define(wxToolbook_SetImageList, 1946).
--define(wxToolbook_SetPageSize, 1947).
--define(wxToolbook_SetPageImage, 1948).
--define(wxToolbook_SetPageText, 1949).
--define(wxToolbook_SetSelection, 1950).
--define(wxToolbook_ChangeSelection, 1951).
--define(wxToolbook_destroy, 1952).
--define(wxListbook_new_0, 1953).
--define(wxListbook_new_3, 1954).
--define(wxListbook_AddPage, 1955).
--define(wxListbook_AdvanceSelection, 1956).
--define(wxListbook_AssignImageList, 1957).
--define(wxListbook_Create, 1958).
--define(wxListbook_DeleteAllPages, 1959).
--define(wxListbook_DeletePage, 1960).
--define(wxListbook_RemovePage, 1961).
--define(wxListbook_GetCurrentPage, 1962).
--define(wxListbook_GetImageList, 1963).
--define(wxListbook_GetPage, 1965).
--define(wxListbook_GetPageCount, 1966).
--define(wxListbook_GetPageImage, 1967).
--define(wxListbook_GetPageText, 1968).
--define(wxListbook_GetSelection, 1969).
--define(wxListbook_HitTest, 1971).
--define(wxListbook_InsertPage, 1972).
--define(wxListbook_SetImageList, 1973).
--define(wxListbook_SetPageSize, 1974).
--define(wxListbook_SetPageImage, 1975).
--define(wxListbook_SetPageText, 1976).
--define(wxListbook_SetSelection, 1977).
--define(wxListbook_ChangeSelection, 1978).
--define(wxListbook_destroy, 1979).
--define(wxTreebook_new_0, 1980).
--define(wxTreebook_new_3, 1981).
--define(wxTreebook_AddPage, 1982).
--define(wxTreebook_AdvanceSelection, 1983).
--define(wxTreebook_AssignImageList, 1984).
--define(wxTreebook_Create, 1985).
--define(wxTreebook_DeleteAllPages, 1986).
--define(wxTreebook_DeletePage, 1987).
--define(wxTreebook_RemovePage, 1988).
--define(wxTreebook_GetCurrentPage, 1989).
--define(wxTreebook_GetImageList, 1990).
--define(wxTreebook_GetPage, 1992).
--define(wxTreebook_GetPageCount, 1993).
--define(wxTreebook_GetPageImage, 1994).
--define(wxTreebook_GetPageText, 1995).
--define(wxTreebook_GetSelection, 1996).
--define(wxTreebook_ExpandNode, 1997).
--define(wxTreebook_IsNodeExpanded, 1998).
--define(wxTreebook_HitTest, 2000).
--define(wxTreebook_InsertPage, 2001).
--define(wxTreebook_InsertSubPage, 2002).
--define(wxTreebook_SetImageList, 2003).
--define(wxTreebook_SetPageSize, 2004).
--define(wxTreebook_SetPageImage, 2005).
--define(wxTreebook_SetPageText, 2006).
--define(wxTreebook_SetSelection, 2007).
--define(wxTreebook_ChangeSelection, 2008).
--define(wxTreebook_destroy, 2009).
--define(wxTreeCtrl_new_2, 2012).
--define(wxTreeCtrl_new_0, 2013).
--define(wxTreeCtrl_destruct, 2015).
--define(wxTreeCtrl_AddRoot, 2016).
--define(wxTreeCtrl_AppendItem, 2017).
--define(wxTreeCtrl_AssignImageList, 2018).
--define(wxTreeCtrl_AssignStateImageList, 2019).
--define(wxTreeCtrl_Collapse, 2020).
--define(wxTreeCtrl_CollapseAndReset, 2021).
--define(wxTreeCtrl_Create, 2022).
--define(wxTreeCtrl_Delete, 2023).
--define(wxTreeCtrl_DeleteAllItems, 2024).
--define(wxTreeCtrl_DeleteChildren, 2025).
--define(wxTreeCtrl_EditLabel, 2026).
--define(wxTreeCtrl_EnsureVisible, 2027).
--define(wxTreeCtrl_Expand, 2028).
--define(wxTreeCtrl_GetBoundingRect, 2029).
--define(wxTreeCtrl_GetChildrenCount, 2031).
--define(wxTreeCtrl_GetCount, 2032).
--define(wxTreeCtrl_GetEditControl, 2033).
--define(wxTreeCtrl_GetFirstChild, 2034).
--define(wxTreeCtrl_GetNextChild, 2035).
--define(wxTreeCtrl_GetFirstVisibleItem, 2036).
--define(wxTreeCtrl_GetImageList, 2037).
--define(wxTreeCtrl_GetIndent, 2038).
--define(wxTreeCtrl_GetItemBackgroundColour, 2039).
--define(wxTreeCtrl_GetItemData, 2040).
--define(wxTreeCtrl_GetItemFont, 2041).
--define(wxTreeCtrl_GetItemImage_1, 2042).
--define(wxTreeCtrl_GetItemImage_2, 2043).
--define(wxTreeCtrl_GetItemText, 2044).
--define(wxTreeCtrl_GetItemTextColour, 2045).
--define(wxTreeCtrl_GetLastChild, 2046).
--define(wxTreeCtrl_GetNextSibling, 2047).
--define(wxTreeCtrl_GetNextVisible, 2048).
--define(wxTreeCtrl_GetItemParent, 2049).
--define(wxTreeCtrl_GetPrevSibling, 2050).
--define(wxTreeCtrl_GetPrevVisible, 2051).
--define(wxTreeCtrl_GetRootItem, 2052).
--define(wxTreeCtrl_GetSelection, 2053).
--define(wxTreeCtrl_GetSelections, 2054).
--define(wxTreeCtrl_GetStateImageList, 2055).
--define(wxTreeCtrl_HitTest, 2056).
--define(wxTreeCtrl_InsertItem, 2058).
--define(wxTreeCtrl_IsBold, 2059).
--define(wxTreeCtrl_IsExpanded, 2060).
--define(wxTreeCtrl_IsSelected, 2061).
--define(wxTreeCtrl_IsVisible, 2062).
--define(wxTreeCtrl_ItemHasChildren, 2063).
--define(wxTreeCtrl_IsTreeItemIdOk, 2064).
--define(wxTreeCtrl_PrependItem, 2065).
--define(wxTreeCtrl_ScrollTo, 2066).
--define(wxTreeCtrl_SelectItem_1, 2067).
--define(wxTreeCtrl_SelectItem_2, 2068).
--define(wxTreeCtrl_SetIndent, 2069).
--define(wxTreeCtrl_SetImageList, 2070).
--define(wxTreeCtrl_SetItemBackgroundColour, 2071).
--define(wxTreeCtrl_SetItemBold, 2072).
--define(wxTreeCtrl_SetItemData, 2073).
--define(wxTreeCtrl_SetItemDropHighlight, 2074).
--define(wxTreeCtrl_SetItemFont, 2075).
--define(wxTreeCtrl_SetItemHasChildren, 2076).
--define(wxTreeCtrl_SetItemImage_2, 2077).
--define(wxTreeCtrl_SetItemImage_3, 2078).
--define(wxTreeCtrl_SetItemText, 2079).
--define(wxTreeCtrl_SetItemTextColour, 2080).
--define(wxTreeCtrl_SetStateImageList, 2081).
--define(wxTreeCtrl_SetWindowStyle, 2082).
--define(wxTreeCtrl_SortChildren, 2083).
--define(wxTreeCtrl_Toggle, 2084).
--define(wxTreeCtrl_ToggleItemSelection, 2085).
--define(wxTreeCtrl_Unselect, 2086).
--define(wxTreeCtrl_UnselectAll, 2087).
--define(wxTreeCtrl_UnselectItem, 2088).
--define(wxScrollBar_new_0, 2089).
--define(wxScrollBar_new_3, 2090).
--define(wxScrollBar_destruct, 2091).
--define(wxScrollBar_Create, 2092).
--define(wxScrollBar_GetRange, 2093).
--define(wxScrollBar_GetPageSize, 2094).
--define(wxScrollBar_GetThumbPosition, 2095).
--define(wxScrollBar_GetThumbSize, 2096).
--define(wxScrollBar_SetThumbPosition, 2097).
--define(wxScrollBar_SetScrollbar, 2098).
--define(wxSpinButton_new_2, 2100).
--define(wxSpinButton_new_0, 2101).
--define(wxSpinButton_Create, 2102).
--define(wxSpinButton_GetMax, 2103).
--define(wxSpinButton_GetMin, 2104).
--define(wxSpinButton_GetValue, 2105).
--define(wxSpinButton_SetRange, 2106).
--define(wxSpinButton_SetValue, 2107).
--define(wxSpinButton_destroy, 2108).
--define(wxSpinCtrl_new_0, 2109).
--define(wxSpinCtrl_new_2, 2110).
--define(wxSpinCtrl_Create, 2112).
--define(wxSpinCtrl_SetValue_1_1, 2115).
--define(wxSpinCtrl_SetValue_1_0, 2116).
--define(wxSpinCtrl_GetValue, 2118).
--define(wxSpinCtrl_SetRange, 2120).
--define(wxSpinCtrl_SetSelection, 2121).
--define(wxSpinCtrl_GetMin, 2123).
--define(wxSpinCtrl_GetMax, 2125).
--define(wxSpinCtrl_destroy, 2126).
--define(wxStaticText_new_0, 2127).
--define(wxStaticText_new_4, 2128).
--define(wxStaticText_Create, 2129).
--define(wxStaticText_GetLabel, 2130).
--define(wxStaticText_SetLabel, 2131).
--define(wxStaticText_Wrap, 2132).
--define(wxStaticText_destroy, 2133).
--define(wxStaticBitmap_new_0, 2134).
--define(wxStaticBitmap_new_4, 2135).
--define(wxStaticBitmap_Create, 2136).
--define(wxStaticBitmap_GetBitmap, 2137).
--define(wxStaticBitmap_SetBitmap, 2138).
--define(wxStaticBitmap_destroy, 2139).
--define(wxRadioBox_new, 2140).
--define(wxRadioBox_destruct, 2142).
--define(wxRadioBox_Create, 2143).
--define(wxRadioBox_Enable_2, 2144).
--define(wxRadioBox_Enable_1, 2145).
--define(wxRadioBox_GetSelection, 2146).
--define(wxRadioBox_GetString, 2147).
--define(wxRadioBox_SetSelection, 2148).
--define(wxRadioBox_Show_2, 2149).
--define(wxRadioBox_Show_1, 2150).
--define(wxRadioBox_GetColumnCount, 2151).
--define(wxRadioBox_GetItemHelpText, 2152).
--define(wxRadioBox_GetItemToolTip, 2153).
--define(wxRadioBox_GetItemFromPoint, 2155).
--define(wxRadioBox_GetRowCount, 2156).
--define(wxRadioBox_IsItemEnabled, 2157).
--define(wxRadioBox_IsItemShown, 2158).
--define(wxRadioBox_SetItemHelpText, 2159).
--define(wxRadioBox_SetItemToolTip, 2160).
--define(wxRadioButton_new_0, 2161).
--define(wxRadioButton_new_4, 2162).
--define(wxRadioButton_Create, 2163).
--define(wxRadioButton_GetValue, 2164).
--define(wxRadioButton_SetValue, 2165).
--define(wxRadioButton_destroy, 2166).
--define(wxSlider_new_6, 2168).
--define(wxSlider_new_0, 2169).
--define(wxSlider_Create, 2170).
--define(wxSlider_GetLineSize, 2171).
--define(wxSlider_GetMax, 2172).
--define(wxSlider_GetMin, 2173).
--define(wxSlider_GetPageSize, 2174).
--define(wxSlider_GetThumbLength, 2175).
--define(wxSlider_GetValue, 2176).
--define(wxSlider_SetLineSize, 2177).
--define(wxSlider_SetPageSize, 2178).
--define(wxSlider_SetRange, 2179).
--define(wxSlider_SetThumbLength, 2180).
--define(wxSlider_SetValue, 2181).
--define(wxSlider_destroy, 2182).
--define(wxDialog_new_4, 2184).
--define(wxDialog_new_0, 2185).
--define(wxDialog_destruct, 2187).
--define(wxDialog_Create, 2188).
--define(wxDialog_CreateButtonSizer, 2189).
--define(wxDialog_CreateStdDialogButtonSizer, 2190).
--define(wxDialog_EndModal, 2191).
--define(wxDialog_GetAffirmativeId, 2192).
--define(wxDialog_GetReturnCode, 2193).
--define(wxDialog_IsModal, 2194).
--define(wxDialog_SetAffirmativeId, 2195).
--define(wxDialog_SetReturnCode, 2196).
--define(wxDialog_Show, 2197).
--define(wxDialog_ShowModal, 2198).
--define(wxColourDialog_new_0, 2199).
--define(wxColourDialog_new_2, 2200).
--define(wxColourDialog_destruct, 2201).
--define(wxColourDialog_Create, 2202).
--define(wxColourDialog_GetColourData, 2203).
--define(wxColourData_new_0, 2204).
--define(wxColourData_new_1, 2205).
--define(wxColourData_destruct, 2206).
--define(wxColourData_GetChooseFull, 2207).
--define(wxColourData_GetColour, 2208).
--define(wxColourData_GetCustomColour, 2210).
--define(wxColourData_SetChooseFull, 2211).
--define(wxColourData_SetColour, 2212).
--define(wxColourData_SetCustomColour, 2213).
--define(wxPalette_new_0, 2214).
--define(wxPalette_new_4, 2215).
--define(wxPalette_destruct, 2217).
--define(wxPalette_Create, 2218).
--define(wxPalette_GetColoursCount, 2219).
--define(wxPalette_GetPixel, 2220).
--define(wxPalette_GetRGB, 2221).
--define(wxPalette_IsOk, 2222).
--define(wxDirDialog_new, 2226).
--define(wxDirDialog_destruct, 2227).
--define(wxDirDialog_GetPath, 2228).
--define(wxDirDialog_GetMessage, 2229).
--define(wxDirDialog_SetMessage, 2230).
--define(wxDirDialog_SetPath, 2231).
--define(wxFileDialog_new, 2235).
--define(wxFileDialog_destruct, 2236).
--define(wxFileDialog_GetDirectory, 2237).
--define(wxFileDialog_GetFilename, 2238).
--define(wxFileDialog_GetFilenames, 2239).
--define(wxFileDialog_GetFilterIndex, 2240).
--define(wxFileDialog_GetMessage, 2241).
--define(wxFileDialog_GetPath, 2242).
--define(wxFileDialog_GetPaths, 2243).
--define(wxFileDialog_GetWildcard, 2244).
--define(wxFileDialog_SetDirectory, 2245).
--define(wxFileDialog_SetFilename, 2246).
--define(wxFileDialog_SetFilterIndex, 2247).
--define(wxFileDialog_SetMessage, 2248).
--define(wxFileDialog_SetPath, 2249).
--define(wxFileDialog_SetWildcard, 2250).
--define(wxPickerBase_SetInternalMargin, 2251).
--define(wxPickerBase_GetInternalMargin, 2252).
--define(wxPickerBase_SetTextCtrlProportion, 2253).
--define(wxPickerBase_SetPickerCtrlProportion, 2254).
--define(wxPickerBase_GetTextCtrlProportion, 2255).
--define(wxPickerBase_GetPickerCtrlProportion, 2256).
--define(wxPickerBase_HasTextCtrl, 2257).
--define(wxPickerBase_GetTextCtrl, 2258).
--define(wxPickerBase_IsTextCtrlGrowable, 2259).
--define(wxPickerBase_SetPickerCtrlGrowable, 2260).
--define(wxPickerBase_SetTextCtrlGrowable, 2261).
--define(wxPickerBase_IsPickerCtrlGrowable, 2262).
--define(wxFilePickerCtrl_new_0, 2263).
--define(wxFilePickerCtrl_new_3, 2264).
--define(wxFilePickerCtrl_Create, 2265).
--define(wxFilePickerCtrl_GetPath, 2266).
--define(wxFilePickerCtrl_SetPath, 2267).
--define(wxFilePickerCtrl_destroy, 2268).
--define(wxDirPickerCtrl_new_0, 2269).
--define(wxDirPickerCtrl_new_3, 2270).
--define(wxDirPickerCtrl_Create, 2271).
--define(wxDirPickerCtrl_GetPath, 2272).
--define(wxDirPickerCtrl_SetPath, 2273).
--define(wxDirPickerCtrl_destroy, 2274).
--define(wxColourPickerCtrl_new_0, 2275).
--define(wxColourPickerCtrl_new_3, 2276).
--define(wxColourPickerCtrl_Create, 2277).
--define(wxColourPickerCtrl_GetColour, 2278).
--define(wxColourPickerCtrl_SetColour_1_1, 2279).
--define(wxColourPickerCtrl_SetColour_1_0, 2280).
--define(wxColourPickerCtrl_destroy, 2281).
--define(wxDatePickerCtrl_new_0, 2282).
--define(wxDatePickerCtrl_new_3, 2283).
--define(wxDatePickerCtrl_GetRange, 2284).
--define(wxDatePickerCtrl_GetValue, 2285).
--define(wxDatePickerCtrl_SetRange, 2286).
--define(wxDatePickerCtrl_SetValue, 2287).
--define(wxDatePickerCtrl_destroy, 2288).
--define(wxFontPickerCtrl_new_0, 2289).
--define(wxFontPickerCtrl_new_3, 2290).
--define(wxFontPickerCtrl_Create, 2291).
--define(wxFontPickerCtrl_GetSelectedFont, 2292).
--define(wxFontPickerCtrl_SetSelectedFont, 2293).
--define(wxFontPickerCtrl_GetMaxPointSize, 2294).
--define(wxFontPickerCtrl_SetMaxPointSize, 2295).
--define(wxFontPickerCtrl_destroy, 2296).
--define(wxFindReplaceDialog_new_0, 2299).
--define(wxFindReplaceDialog_new_4, 2300).
--define(wxFindReplaceDialog_destruct, 2301).
--define(wxFindReplaceDialog_Create, 2302).
--define(wxFindReplaceDialog_GetData, 2303).
--define(wxFindReplaceData_new_0, 2304).
--define(wxFindReplaceData_new_1, 2305).
--define(wxFindReplaceData_GetFindString, 2306).
--define(wxFindReplaceData_GetReplaceString, 2307).
--define(wxFindReplaceData_GetFlags, 2308).
--define(wxFindReplaceData_SetFlags, 2309).
--define(wxFindReplaceData_SetFindString, 2310).
--define(wxFindReplaceData_SetReplaceString, 2311).
--define(wxFindReplaceData_destroy, 2312).
--define(wxMultiChoiceDialog_new_0, 2313).
--define(wxMultiChoiceDialog_new_5, 2315).
--define(wxMultiChoiceDialog_GetSelections, 2316).
--define(wxMultiChoiceDialog_SetSelections, 2317).
--define(wxMultiChoiceDialog_destroy, 2318).
--define(wxSingleChoiceDialog_new_0, 2319).
--define(wxSingleChoiceDialog_new_5, 2321).
--define(wxSingleChoiceDialog_GetSelection, 2322).
--define(wxSingleChoiceDialog_GetStringSelection, 2323).
--define(wxSingleChoiceDialog_SetSelection, 2324).
--define(wxSingleChoiceDialog_destroy, 2325).
--define(wxTextEntryDialog_new, 2326).
--define(wxTextEntryDialog_GetValue, 2327).
--define(wxTextEntryDialog_SetValue, 2328).
--define(wxTextEntryDialog_destroy, 2329).
--define(wxPasswordEntryDialog_new, 2330).
--define(wxPasswordEntryDialog_destroy, 2331).
--define(wxFontData_new_0, 2332).
--define(wxFontData_new_1, 2333).
--define(wxFontData_destruct, 2334).
--define(wxFontData_EnableEffects, 2335).
--define(wxFontData_GetAllowSymbols, 2336).
--define(wxFontData_GetColour, 2337).
--define(wxFontData_GetChosenFont, 2338).
--define(wxFontData_GetEnableEffects, 2339).
--define(wxFontData_GetInitialFont, 2340).
--define(wxFontData_GetShowHelp, 2341).
--define(wxFontData_SetAllowSymbols, 2342).
--define(wxFontData_SetChosenFont, 2343).
--define(wxFontData_SetColour, 2344).
--define(wxFontData_SetInitialFont, 2345).
--define(wxFontData_SetRange, 2346).
--define(wxFontData_SetShowHelp, 2347).
--define(wxFontDialog_new_0, 2351).
--define(wxFontDialog_new_2, 2353).
--define(wxFontDialog_Create, 2355).
--define(wxFontDialog_GetFontData, 2356).
--define(wxFontDialog_destroy, 2358).
--define(wxProgressDialog_new, 2359).
--define(wxProgressDialog_destruct, 2360).
--define(wxProgressDialog_Resume, 2361).
--define(wxProgressDialog_Update_2, 2362).
--define(wxProgressDialog_Update_0, 2363).
--define(wxMessageDialog_new, 2364).
--define(wxMessageDialog_destruct, 2365).
--define(wxPageSetupDialog_new, 2366).
--define(wxPageSetupDialog_destruct, 2367).
--define(wxPageSetupDialog_GetPageSetupData, 2368).
--define(wxPageSetupDialog_ShowModal, 2369).
--define(wxPageSetupDialogData_new_0, 2370).
--define(wxPageSetupDialogData_new_1_0, 2371).
--define(wxPageSetupDialogData_new_1_1, 2372).
--define(wxPageSetupDialogData_destruct, 2373).
--define(wxPageSetupDialogData_EnableHelp, 2374).
--define(wxPageSetupDialogData_EnableMargins, 2375).
--define(wxPageSetupDialogData_EnableOrientation, 2376).
--define(wxPageSetupDialogData_EnablePaper, 2377).
--define(wxPageSetupDialogData_EnablePrinter, 2378).
--define(wxPageSetupDialogData_GetDefaultMinMargins, 2379).
--define(wxPageSetupDialogData_GetEnableMargins, 2380).
--define(wxPageSetupDialogData_GetEnableOrientation, 2381).
--define(wxPageSetupDialogData_GetEnablePaper, 2382).
--define(wxPageSetupDialogData_GetEnablePrinter, 2383).
--define(wxPageSetupDialogData_GetEnableHelp, 2384).
--define(wxPageSetupDialogData_GetDefaultInfo, 2385).
--define(wxPageSetupDialogData_GetMarginTopLeft, 2386).
--define(wxPageSetupDialogData_GetMarginBottomRight, 2387).
--define(wxPageSetupDialogData_GetMinMarginTopLeft, 2388).
--define(wxPageSetupDialogData_GetMinMarginBottomRight, 2389).
--define(wxPageSetupDialogData_GetPaperId, 2390).
--define(wxPageSetupDialogData_GetPaperSize, 2391).
--define(wxPageSetupDialogData_GetPrintData, 2393).
--define(wxPageSetupDialogData_IsOk, 2394).
--define(wxPageSetupDialogData_SetDefaultInfo, 2395).
--define(wxPageSetupDialogData_SetDefaultMinMargins, 2396).
--define(wxPageSetupDialogData_SetMarginTopLeft, 2397).
--define(wxPageSetupDialogData_SetMarginBottomRight, 2398).
--define(wxPageSetupDialogData_SetMinMarginTopLeft, 2399).
--define(wxPageSetupDialogData_SetMinMarginBottomRight, 2400).
--define(wxPageSetupDialogData_SetPaperId, 2401).
--define(wxPageSetupDialogData_SetPaperSize_1_1, 2402).
--define(wxPageSetupDialogData_SetPaperSize_1_0, 2403).
--define(wxPageSetupDialogData_SetPrintData, 2404).
--define(wxPrintDialog_new_2_0, 2405).
--define(wxPrintDialog_new_2_1, 2406).
--define(wxPrintDialog_destruct, 2407).
--define(wxPrintDialog_GetPrintDialogData, 2408).
--define(wxPrintDialog_GetPrintDC, 2409).
--define(wxPrintDialogData_new_0, 2410).
--define(wxPrintDialogData_new_1_1, 2411).
--define(wxPrintDialogData_new_1_0, 2412).
--define(wxPrintDialogData_destruct, 2413).
--define(wxPrintDialogData_EnableHelp, 2414).
--define(wxPrintDialogData_EnablePageNumbers, 2415).
--define(wxPrintDialogData_EnablePrintToFile, 2416).
--define(wxPrintDialogData_EnableSelection, 2417).
--define(wxPrintDialogData_GetAllPages, 2418).
--define(wxPrintDialogData_GetCollate, 2419).
--define(wxPrintDialogData_GetFromPage, 2420).
--define(wxPrintDialogData_GetMaxPage, 2421).
--define(wxPrintDialogData_GetMinPage, 2422).
--define(wxPrintDialogData_GetNoCopies, 2423).
--define(wxPrintDialogData_GetPrintData, 2424).
--define(wxPrintDialogData_GetPrintToFile, 2425).
--define(wxPrintDialogData_GetSelection, 2426).
--define(wxPrintDialogData_GetToPage, 2427).
--define(wxPrintDialogData_IsOk, 2428).
--define(wxPrintDialogData_SetCollate, 2429).
--define(wxPrintDialogData_SetFromPage, 2430).
--define(wxPrintDialogData_SetMaxPage, 2431).
--define(wxPrintDialogData_SetMinPage, 2432).
--define(wxPrintDialogData_SetNoCopies, 2433).
--define(wxPrintDialogData_SetPrintData, 2434).
--define(wxPrintDialogData_SetPrintToFile, 2435).
--define(wxPrintDialogData_SetSelection, 2436).
--define(wxPrintDialogData_SetToPage, 2437).
--define(wxPrintData_new_0, 2438).
--define(wxPrintData_new_1, 2439).
--define(wxPrintData_destruct, 2440).
--define(wxPrintData_GetCollate, 2441).
--define(wxPrintData_GetBin, 2442).
--define(wxPrintData_GetColour, 2443).
--define(wxPrintData_GetDuplex, 2444).
--define(wxPrintData_GetNoCopies, 2445).
--define(wxPrintData_GetOrientation, 2446).
--define(wxPrintData_GetPaperId, 2447).
--define(wxPrintData_GetPrinterName, 2448).
--define(wxPrintData_GetQuality, 2449).
--define(wxPrintData_IsOk, 2450).
--define(wxPrintData_SetBin, 2451).
--define(wxPrintData_SetCollate, 2452).
--define(wxPrintData_SetColour, 2453).
--define(wxPrintData_SetDuplex, 2454).
--define(wxPrintData_SetNoCopies, 2455).
--define(wxPrintData_SetOrientation, 2456).
--define(wxPrintData_SetPaperId, 2457).
--define(wxPrintData_SetPrinterName, 2458).
--define(wxPrintData_SetQuality, 2459).
--define(wxPrintPreview_new_2, 2462).
--define(wxPrintPreview_new_3, 2463).
--define(wxPrintPreview_destruct, 2465).
--define(wxPrintPreview_GetCanvas, 2466).
--define(wxPrintPreview_GetCurrentPage, 2467).
--define(wxPrintPreview_GetFrame, 2468).
--define(wxPrintPreview_GetMaxPage, 2469).
--define(wxPrintPreview_GetMinPage, 2470).
--define(wxPrintPreview_GetPrintout, 2471).
--define(wxPrintPreview_GetPrintoutForPrinting, 2472).
--define(wxPrintPreview_IsOk, 2473).
--define(wxPrintPreview_PaintPage, 2474).
--define(wxPrintPreview_Print, 2475).
--define(wxPrintPreview_RenderPage, 2476).
--define(wxPrintPreview_SetCanvas, 2477).
--define(wxPrintPreview_SetCurrentPage, 2478).
--define(wxPrintPreview_SetFrame, 2479).
--define(wxPrintPreview_SetPrintout, 2480).
--define(wxPrintPreview_SetZoom, 2481).
--define(wxPreviewFrame_new, 2482).
--define(wxPreviewFrame_destruct, 2483).
--define(wxPreviewFrame_CreateControlBar, 2484).
--define(wxPreviewFrame_CreateCanvas, 2485).
--define(wxPreviewFrame_Initialize, 2486).
--define(wxPreviewFrame_OnCloseWindow, 2487).
--define(wxPreviewControlBar_new, 2488).
--define(wxPreviewControlBar_destruct, 2489).
--define(wxPreviewControlBar_CreateButtons, 2490).
--define(wxPreviewControlBar_GetPrintPreview, 2491).
--define(wxPreviewControlBar_GetZoomControl, 2492).
--define(wxPreviewControlBar_SetZoomControl, 2493).
--define(wxPrinter_new, 2495).
--define(wxPrinter_CreateAbortWindow, 2496).
--define(wxPrinter_GetAbort, 2497).
--define(wxPrinter_GetLastError, 2498).
--define(wxPrinter_GetPrintDialogData, 2499).
--define(wxPrinter_Print, 2500).
--define(wxPrinter_PrintDialog, 2501).
--define(wxPrinter_ReportError, 2502).
--define(wxPrinter_Setup, 2503).
--define(wxPrinter_destroy, 2504).
--define(wxXmlResource_new_1, 2505).
--define(wxXmlResource_new_2, 2506).
--define(wxXmlResource_destruct, 2507).
--define(wxXmlResource_AttachUnknownControl, 2508).
--define(wxXmlResource_ClearHandlers, 2509).
--define(wxXmlResource_CompareVersion, 2510).
--define(wxXmlResource_Get, 2511).
--define(wxXmlResource_GetFlags, 2512).
--define(wxXmlResource_GetVersion, 2513).
--define(wxXmlResource_GetXRCID, 2514).
--define(wxXmlResource_InitAllHandlers, 2515).
--define(wxXmlResource_Load, 2516).
--define(wxXmlResource_LoadBitmap, 2517).
--define(wxXmlResource_LoadDialog_2, 2518).
--define(wxXmlResource_LoadDialog_3, 2519).
--define(wxXmlResource_LoadFrame_2, 2520).
--define(wxXmlResource_LoadFrame_3, 2521).
--define(wxXmlResource_LoadIcon, 2522).
--define(wxXmlResource_LoadMenu, 2523).
--define(wxXmlResource_LoadMenuBar_2, 2524).
--define(wxXmlResource_LoadMenuBar_1, 2525).
--define(wxXmlResource_LoadPanel_2, 2526).
--define(wxXmlResource_LoadPanel_3, 2527).
--define(wxXmlResource_LoadToolBar, 2528).
--define(wxXmlResource_Set, 2529).
--define(wxXmlResource_SetFlags, 2530).
--define(wxXmlResource_Unload, 2531).
--define(wxXmlResource_xrcctrl, 2532).
--define(wxHtmlEasyPrinting_new, 2533).
--define(wxHtmlEasyPrinting_destruct, 2534).
--define(wxHtmlEasyPrinting_GetPrintData, 2535).
--define(wxHtmlEasyPrinting_GetPageSetupData, 2536).
--define(wxHtmlEasyPrinting_PreviewFile, 2537).
--define(wxHtmlEasyPrinting_PreviewText, 2538).
--define(wxHtmlEasyPrinting_PrintFile, 2539).
--define(wxHtmlEasyPrinting_PrintText, 2540).
--define(wxHtmlEasyPrinting_PageSetup, 2541).
--define(wxHtmlEasyPrinting_SetFonts, 2542).
--define(wxHtmlEasyPrinting_SetHeader, 2543).
--define(wxHtmlEasyPrinting_SetFooter, 2544).
--define(wxGLCanvas_new_2, 2546).
--define(wxGLCanvas_new_3_1, 2547).
--define(wxGLCanvas_new_3_0, 2548).
--define(wxGLCanvas_GetContext, 2549).
--define(wxGLCanvas_SetCurrent, 2551).
--define(wxGLCanvas_SwapBuffers, 2552).
--define(wxGLCanvas_destroy, 2553).
--define(wxAuiManager_new, 2554).
--define(wxAuiManager_destruct, 2555).
--define(wxAuiManager_AddPane_2_1, 2556).
--define(wxAuiManager_AddPane_3, 2557).
--define(wxAuiManager_AddPane_2_0, 2558).
--define(wxAuiManager_DetachPane, 2559).
--define(wxAuiManager_GetAllPanes, 2560).
--define(wxAuiManager_GetArtProvider, 2561).
--define(wxAuiManager_GetDockSizeConstraint, 2562).
--define(wxAuiManager_GetFlags, 2563).
--define(wxAuiManager_GetManagedWindow, 2564).
--define(wxAuiManager_GetManager, 2565).
--define(wxAuiManager_GetPane_1_1, 2566).
--define(wxAuiManager_GetPane_1_0, 2567).
--define(wxAuiManager_HideHint, 2568).
--define(wxAuiManager_InsertPane, 2569).
--define(wxAuiManager_LoadPaneInfo, 2570).
--define(wxAuiManager_LoadPerspective, 2571).
--define(wxAuiManager_SavePaneInfo, 2572).
--define(wxAuiManager_SavePerspective, 2573).
--define(wxAuiManager_SetArtProvider, 2574).
--define(wxAuiManager_SetDockSizeConstraint, 2575).
--define(wxAuiManager_SetFlags, 2576).
--define(wxAuiManager_SetManagedWindow, 2577).
--define(wxAuiManager_ShowHint, 2578).
--define(wxAuiManager_UnInit, 2579).
--define(wxAuiManager_Update, 2580).
--define(wxAuiPaneInfo_new_0, 2581).
--define(wxAuiPaneInfo_new_1, 2582).
--define(wxAuiPaneInfo_destruct, 2583).
--define(wxAuiPaneInfo_BestSize_1, 2584).
--define(wxAuiPaneInfo_BestSize_2, 2585).
--define(wxAuiPaneInfo_Bottom, 2586).
--define(wxAuiPaneInfo_BottomDockable, 2587).
--define(wxAuiPaneInfo_Caption, 2588).
--define(wxAuiPaneInfo_CaptionVisible, 2589).
--define(wxAuiPaneInfo_Centre, 2590).
--define(wxAuiPaneInfo_CentrePane, 2591).
--define(wxAuiPaneInfo_CloseButton, 2592).
--define(wxAuiPaneInfo_DefaultPane, 2593).
--define(wxAuiPaneInfo_DestroyOnClose, 2594).
--define(wxAuiPaneInfo_Direction, 2595).
--define(wxAuiPaneInfo_Dock, 2596).
--define(wxAuiPaneInfo_Dockable, 2597).
--define(wxAuiPaneInfo_Fixed, 2598).
--define(wxAuiPaneInfo_Float, 2599).
--define(wxAuiPaneInfo_Floatable, 2600).
--define(wxAuiPaneInfo_FloatingPosition_1, 2601).
--define(wxAuiPaneInfo_FloatingPosition_2, 2602).
--define(wxAuiPaneInfo_FloatingSize_1, 2603).
--define(wxAuiPaneInfo_FloatingSize_2, 2604).
--define(wxAuiPaneInfo_Gripper, 2605).
--define(wxAuiPaneInfo_GripperTop, 2606).
--define(wxAuiPaneInfo_HasBorder, 2607).
--define(wxAuiPaneInfo_HasCaption, 2608).
--define(wxAuiPaneInfo_HasCloseButton, 2609).
--define(wxAuiPaneInfo_HasFlag, 2610).
--define(wxAuiPaneInfo_HasGripper, 2611).
--define(wxAuiPaneInfo_HasGripperTop, 2612).
--define(wxAuiPaneInfo_HasMaximizeButton, 2613).
--define(wxAuiPaneInfo_HasMinimizeButton, 2614).
--define(wxAuiPaneInfo_HasPinButton, 2615).
--define(wxAuiPaneInfo_Hide, 2616).
--define(wxAuiPaneInfo_IsBottomDockable, 2617).
--define(wxAuiPaneInfo_IsDocked, 2618).
--define(wxAuiPaneInfo_IsFixed, 2619).
--define(wxAuiPaneInfo_IsFloatable, 2620).
--define(wxAuiPaneInfo_IsFloating, 2621).
--define(wxAuiPaneInfo_IsLeftDockable, 2622).
--define(wxAuiPaneInfo_IsMovable, 2623).
--define(wxAuiPaneInfo_IsOk, 2624).
--define(wxAuiPaneInfo_IsResizable, 2625).
--define(wxAuiPaneInfo_IsRightDockable, 2626).
--define(wxAuiPaneInfo_IsShown, 2627).
--define(wxAuiPaneInfo_IsToolbar, 2628).
--define(wxAuiPaneInfo_IsTopDockable, 2629).
--define(wxAuiPaneInfo_Layer, 2630).
--define(wxAuiPaneInfo_Left, 2631).
--define(wxAuiPaneInfo_LeftDockable, 2632).
--define(wxAuiPaneInfo_MaxSize_1, 2633).
--define(wxAuiPaneInfo_MaxSize_2, 2634).
--define(wxAuiPaneInfo_MaximizeButton, 2635).
--define(wxAuiPaneInfo_MinSize_1, 2636).
--define(wxAuiPaneInfo_MinSize_2, 2637).
--define(wxAuiPaneInfo_MinimizeButton, 2638).
--define(wxAuiPaneInfo_Movable, 2639).
--define(wxAuiPaneInfo_Name, 2640).
--define(wxAuiPaneInfo_PaneBorder, 2641).
--define(wxAuiPaneInfo_PinButton, 2642).
--define(wxAuiPaneInfo_Position, 2643).
--define(wxAuiPaneInfo_Resizable, 2644).
--define(wxAuiPaneInfo_Right, 2645).
--define(wxAuiPaneInfo_RightDockable, 2646).
--define(wxAuiPaneInfo_Row, 2647).
--define(wxAuiPaneInfo_SafeSet, 2648).
--define(wxAuiPaneInfo_SetFlag, 2649).
--define(wxAuiPaneInfo_Show, 2650).
--define(wxAuiPaneInfo_ToolbarPane, 2651).
--define(wxAuiPaneInfo_Top, 2652).
--define(wxAuiPaneInfo_TopDockable, 2653).
--define(wxAuiPaneInfo_Window, 2654).
--define(wxAuiPaneInfo_GetWindow, 2655).
--define(wxAuiPaneInfo_GetFrame, 2656).
--define(wxAuiPaneInfo_GetDirection, 2657).
--define(wxAuiPaneInfo_GetLayer, 2658).
--define(wxAuiPaneInfo_GetRow, 2659).
--define(wxAuiPaneInfo_GetPosition, 2660).
--define(wxAuiPaneInfo_GetFloatingPosition, 2661).
--define(wxAuiPaneInfo_GetFloatingSize, 2662).
--define(wxAuiNotebook_new_0, 2663).
--define(wxAuiNotebook_new_2, 2664).
--define(wxAuiNotebook_AddPage, 2665).
--define(wxAuiNotebook_Create, 2666).
--define(wxAuiNotebook_DeletePage, 2667).
--define(wxAuiNotebook_GetArtProvider, 2668).
--define(wxAuiNotebook_GetPage, 2669).
--define(wxAuiNotebook_GetPageBitmap, 2670).
--define(wxAuiNotebook_GetPageCount, 2671).
--define(wxAuiNotebook_GetPageIndex, 2672).
--define(wxAuiNotebook_GetPageText, 2673).
--define(wxAuiNotebook_GetSelection, 2674).
--define(wxAuiNotebook_InsertPage, 2675).
--define(wxAuiNotebook_RemovePage, 2676).
--define(wxAuiNotebook_SetArtProvider, 2677).
--define(wxAuiNotebook_SetFont, 2678).
--define(wxAuiNotebook_SetPageBitmap, 2679).
--define(wxAuiNotebook_SetPageText, 2680).
--define(wxAuiNotebook_SetSelection, 2681).
--define(wxAuiNotebook_SetTabCtrlHeight, 2682).
--define(wxAuiNotebook_SetUniformBitmapSize, 2683).
--define(wxAuiNotebook_destroy, 2684).
--define(wxAuiTabArt_SetFlags, 2685).
--define(wxAuiTabArt_SetMeasuringFont, 2686).
--define(wxAuiTabArt_SetNormalFont, 2687).
--define(wxAuiTabArt_SetSelectedFont, 2688).
--define(wxAuiTabArt_SetColour, 2689).
--define(wxAuiTabArt_SetActiveColour, 2690).
--define(wxAuiDockArt_GetColour, 2691).
--define(wxAuiDockArt_GetFont, 2692).
--define(wxAuiDockArt_GetMetric, 2693).
--define(wxAuiDockArt_SetColour, 2694).
--define(wxAuiDockArt_SetFont, 2695).
--define(wxAuiDockArt_SetMetric, 2696).
--define(wxAuiSimpleTabArt_new, 2697).
--define(wxAuiSimpleTabArt_destroy, 2698).
--define(wxMDIParentFrame_new_0, 2699).
--define(wxMDIParentFrame_new_4, 2700).
--define(wxMDIParentFrame_destruct, 2701).
--define(wxMDIParentFrame_ActivateNext, 2702).
--define(wxMDIParentFrame_ActivatePrevious, 2703).
--define(wxMDIParentFrame_ArrangeIcons, 2704).
--define(wxMDIParentFrame_Cascade, 2705).
--define(wxMDIParentFrame_Create, 2706).
--define(wxMDIParentFrame_GetActiveChild, 2707).
--define(wxMDIParentFrame_GetClientWindow, 2708).
--define(wxMDIParentFrame_Tile, 2709).
--define(wxMDIChildFrame_new_0, 2710).
--define(wxMDIChildFrame_new_4, 2711).
--define(wxMDIChildFrame_destruct, 2712).
--define(wxMDIChildFrame_Activate, 2713).
--define(wxMDIChildFrame_Create, 2714).
--define(wxMDIChildFrame_Maximize, 2715).
--define(wxMDIChildFrame_Restore, 2716).
--define(wxMDIClientWindow_new_0, 2717).
--define(wxMDIClientWindow_new_2, 2718).
--define(wxMDIClientWindow_destruct, 2719).
--define(wxMDIClientWindow_CreateClient, 2720).
--define(wxLayoutAlgorithm_new, 2721).
--define(wxLayoutAlgorithm_LayoutFrame, 2722).
--define(wxLayoutAlgorithm_LayoutMDIFrame, 2723).
--define(wxLayoutAlgorithm_LayoutWindow, 2724).
--define(wxLayoutAlgorithm_destroy, 2725).
--define(wxEvent_GetId, 2726).
--define(wxEvent_GetSkipped, 2727).
--define(wxEvent_GetTimestamp, 2728).
--define(wxEvent_IsCommandEvent, 2729).
--define(wxEvent_ResumePropagation, 2730).
--define(wxEvent_ShouldPropagate, 2731).
--define(wxEvent_Skip, 2732).
--define(wxEvent_StopPropagation, 2733).
--define(wxCommandEvent_getClientData, 2734).
--define(wxCommandEvent_GetExtraLong, 2735).
--define(wxCommandEvent_GetInt, 2736).
--define(wxCommandEvent_GetSelection, 2737).
--define(wxCommandEvent_GetString, 2738).
--define(wxCommandEvent_IsChecked, 2739).
--define(wxCommandEvent_IsSelection, 2740).
--define(wxCommandEvent_SetInt, 2741).
--define(wxCommandEvent_SetString, 2742).
--define(wxScrollEvent_GetOrientation, 2743).
--define(wxScrollEvent_GetPosition, 2744).
--define(wxScrollWinEvent_GetOrientation, 2745).
--define(wxScrollWinEvent_GetPosition, 2746).
--define(wxMouseEvent_AltDown, 2747).
--define(wxMouseEvent_Button, 2748).
--define(wxMouseEvent_ButtonDClick, 2749).
--define(wxMouseEvent_ButtonDown, 2750).
--define(wxMouseEvent_ButtonUp, 2751).
--define(wxMouseEvent_CmdDown, 2752).
--define(wxMouseEvent_ControlDown, 2753).
--define(wxMouseEvent_Dragging, 2754).
--define(wxMouseEvent_Entering, 2755).
--define(wxMouseEvent_GetButton, 2756).
--define(wxMouseEvent_GetPosition, 2759).
--define(wxMouseEvent_GetLogicalPosition, 2760).
--define(wxMouseEvent_GetLinesPerAction, 2761).
--define(wxMouseEvent_GetWheelRotation, 2762).
--define(wxMouseEvent_GetWheelDelta, 2763).
--define(wxMouseEvent_GetX, 2764).
--define(wxMouseEvent_GetY, 2765).
--define(wxMouseEvent_IsButton, 2766).
--define(wxMouseEvent_IsPageScroll, 2767).
--define(wxMouseEvent_Leaving, 2768).
--define(wxMouseEvent_LeftDClick, 2769).
--define(wxMouseEvent_LeftDown, 2770).
--define(wxMouseEvent_LeftIsDown, 2771).
--define(wxMouseEvent_LeftUp, 2772).
--define(wxMouseEvent_MetaDown, 2773).
--define(wxMouseEvent_MiddleDClick, 2774).
--define(wxMouseEvent_MiddleDown, 2775).
--define(wxMouseEvent_MiddleIsDown, 2776).
--define(wxMouseEvent_MiddleUp, 2777).
--define(wxMouseEvent_Moving, 2778).
--define(wxMouseEvent_RightDClick, 2779).
--define(wxMouseEvent_RightDown, 2780).
--define(wxMouseEvent_RightIsDown, 2781).
--define(wxMouseEvent_RightUp, 2782).
--define(wxMouseEvent_ShiftDown, 2783).
--define(wxSetCursorEvent_GetCursor, 2784).
--define(wxSetCursorEvent_GetX, 2785).
--define(wxSetCursorEvent_GetY, 2786).
--define(wxSetCursorEvent_HasCursor, 2787).
--define(wxSetCursorEvent_SetCursor, 2788).
--define(wxKeyEvent_AltDown, 2789).
--define(wxKeyEvent_CmdDown, 2790).
--define(wxKeyEvent_ControlDown, 2791).
--define(wxKeyEvent_GetKeyCode, 2792).
--define(wxKeyEvent_GetModifiers, 2793).
--define(wxKeyEvent_GetPosition, 2796).
--define(wxKeyEvent_GetRawKeyCode, 2797).
--define(wxKeyEvent_GetRawKeyFlags, 2798).
--define(wxKeyEvent_GetUnicodeKey, 2799).
--define(wxKeyEvent_GetX, 2800).
--define(wxKeyEvent_GetY, 2801).
--define(wxKeyEvent_HasModifiers, 2802).
--define(wxKeyEvent_MetaDown, 2803).
--define(wxKeyEvent_ShiftDown, 2804).
--define(wxSizeEvent_GetSize, 2805).
--define(wxMoveEvent_GetPosition, 2806).
--define(wxEraseEvent_GetDC, 2807).
--define(wxFocusEvent_GetWindow, 2808).
--define(wxChildFocusEvent_GetWindow, 2809).
--define(wxMenuEvent_GetMenu, 2810).
--define(wxMenuEvent_GetMenuId, 2811).
--define(wxMenuEvent_IsPopup, 2812).
--define(wxCloseEvent_CanVeto, 2813).
--define(wxCloseEvent_GetLoggingOff, 2814).
--define(wxCloseEvent_SetCanVeto, 2815).
--define(wxCloseEvent_SetLoggingOff, 2816).
--define(wxCloseEvent_Veto, 2817).
--define(wxShowEvent_SetShow, 2818).
--define(wxShowEvent_GetShow, 2819).
--define(wxIconizeEvent_Iconized, 2820).
--define(wxJoystickEvent_ButtonDown, 2821).
--define(wxJoystickEvent_ButtonIsDown, 2822).
--define(wxJoystickEvent_ButtonUp, 2823).
--define(wxJoystickEvent_GetButtonChange, 2824).
--define(wxJoystickEvent_GetButtonState, 2825).
--define(wxJoystickEvent_GetJoystick, 2826).
--define(wxJoystickEvent_GetPosition, 2827).
--define(wxJoystickEvent_GetZPosition, 2828).
--define(wxJoystickEvent_IsButton, 2829).
--define(wxJoystickEvent_IsMove, 2830).
--define(wxJoystickEvent_IsZMove, 2831).
--define(wxUpdateUIEvent_CanUpdate, 2832).
--define(wxUpdateUIEvent_Check, 2833).
--define(wxUpdateUIEvent_Enable, 2834).
--define(wxUpdateUIEvent_Show, 2835).
--define(wxUpdateUIEvent_GetChecked, 2836).
--define(wxUpdateUIEvent_GetEnabled, 2837).
--define(wxUpdateUIEvent_GetShown, 2838).
--define(wxUpdateUIEvent_GetSetChecked, 2839).
--define(wxUpdateUIEvent_GetSetEnabled, 2840).
--define(wxUpdateUIEvent_GetSetShown, 2841).
--define(wxUpdateUIEvent_GetSetText, 2842).
--define(wxUpdateUIEvent_GetText, 2843).
--define(wxUpdateUIEvent_GetMode, 2844).
--define(wxUpdateUIEvent_GetUpdateInterval, 2845).
--define(wxUpdateUIEvent_ResetUpdateTime, 2846).
--define(wxUpdateUIEvent_SetMode, 2847).
--define(wxUpdateUIEvent_SetText, 2848).
--define(wxUpdateUIEvent_SetUpdateInterval, 2849).
--define(wxMouseCaptureChangedEvent_GetCapturedWindow, 2850).
--define(wxPaletteChangedEvent_SetChangedWindow, 2851).
--define(wxPaletteChangedEvent_GetChangedWindow, 2852).
--define(wxQueryNewPaletteEvent_SetPaletteRealized, 2853).
--define(wxQueryNewPaletteEvent_GetPaletteRealized, 2854).
--define(wxNavigationKeyEvent_GetDirection, 2855).
--define(wxNavigationKeyEvent_SetDirection, 2856).
--define(wxNavigationKeyEvent_IsWindowChange, 2857).
--define(wxNavigationKeyEvent_SetWindowChange, 2858).
--define(wxNavigationKeyEvent_IsFromTab, 2859).
--define(wxNavigationKeyEvent_SetFromTab, 2860).
--define(wxNavigationKeyEvent_GetCurrentFocus, 2861).
--define(wxNavigationKeyEvent_SetCurrentFocus, 2862).
--define(wxHelpEvent_GetOrigin, 2863).
--define(wxHelpEvent_GetPosition, 2864).
--define(wxHelpEvent_SetOrigin, 2865).
--define(wxHelpEvent_SetPosition, 2866).
--define(wxContextMenuEvent_GetPosition, 2867).
--define(wxContextMenuEvent_SetPosition, 2868).
--define(wxIdleEvent_CanSend, 2869).
--define(wxIdleEvent_GetMode, 2870).
--define(wxIdleEvent_RequestMore, 2871).
--define(wxIdleEvent_MoreRequested, 2872).
--define(wxIdleEvent_SetMode, 2873).
--define(wxGridEvent_AltDown, 2874).
--define(wxGridEvent_ControlDown, 2875).
--define(wxGridEvent_GetCol, 2876).
--define(wxGridEvent_GetPosition, 2877).
--define(wxGridEvent_GetRow, 2878).
--define(wxGridEvent_MetaDown, 2879).
--define(wxGridEvent_Selecting, 2880).
--define(wxGridEvent_ShiftDown, 2881).
--define(wxNotifyEvent_Allow, 2882).
--define(wxNotifyEvent_IsAllowed, 2883).
--define(wxNotifyEvent_Veto, 2884).
--define(wxSashEvent_GetEdge, 2885).
--define(wxSashEvent_GetDragRect, 2886).
--define(wxSashEvent_GetDragStatus, 2887).
--define(wxListEvent_GetCacheFrom, 2888).
--define(wxListEvent_GetCacheTo, 2889).
--define(wxListEvent_GetKeyCode, 2890).
--define(wxListEvent_GetIndex, 2891).
--define(wxListEvent_GetColumn, 2892).
--define(wxListEvent_GetPoint, 2893).
--define(wxListEvent_GetLabel, 2894).
--define(wxListEvent_GetText, 2895).
--define(wxListEvent_GetImage, 2896).
--define(wxListEvent_GetData, 2897).
--define(wxListEvent_GetMask, 2898).
--define(wxListEvent_GetItem, 2899).
--define(wxListEvent_IsEditCancelled, 2900).
--define(wxDateEvent_GetDate, 2901).
--define(wxCalendarEvent_GetWeekDay, 2902).
--define(wxFileDirPickerEvent_GetPath, 2903).
--define(wxColourPickerEvent_GetColour, 2904).
--define(wxFontPickerEvent_GetFont, 2905).
--define(wxStyledTextEvent_GetPosition, 2906).
--define(wxStyledTextEvent_GetKey, 2907).
--define(wxStyledTextEvent_GetModifiers, 2908).
--define(wxStyledTextEvent_GetModificationType, 2909).
--define(wxStyledTextEvent_GetText, 2910).
--define(wxStyledTextEvent_GetLength, 2911).
--define(wxStyledTextEvent_GetLinesAdded, 2912).
--define(wxStyledTextEvent_GetLine, 2913).
--define(wxStyledTextEvent_GetFoldLevelNow, 2914).
--define(wxStyledTextEvent_GetFoldLevelPrev, 2915).
--define(wxStyledTextEvent_GetMargin, 2916).
--define(wxStyledTextEvent_GetMessage, 2917).
--define(wxStyledTextEvent_GetWParam, 2918).
--define(wxStyledTextEvent_GetLParam, 2919).
--define(wxStyledTextEvent_GetListType, 2920).
--define(wxStyledTextEvent_GetX, 2921).
--define(wxStyledTextEvent_GetY, 2922).
--define(wxStyledTextEvent_GetDragText, 2923).
--define(wxStyledTextEvent_GetDragAllowMove, 2924).
--define(wxStyledTextEvent_GetDragResult, 2925).
--define(wxStyledTextEvent_GetShift, 2926).
--define(wxStyledTextEvent_GetControl, 2927).
--define(wxStyledTextEvent_GetAlt, 2928).
--define(utils_wxGetKeyState, 2929).
--define(utils_wxGetMousePosition, 2930).
--define(utils_wxGetMouseState, 2931).
--define(utils_wxSetDetectableAutoRepeat, 2932).
--define(utils_wxBell, 2933).
--define(utils_wxFindMenuItemId, 2934).
--define(utils_wxGenericFindWindowAtPoint, 2935).
--define(utils_wxFindWindowAtPoint, 2936).
--define(utils_wxBeginBusyCursor, 2937).
--define(utils_wxEndBusyCursor, 2938).
--define(utils_wxIsBusy, 2939).
--define(utils_wxShutdown, 2940).
--define(utils_wxShell, 2941).
--define(utils_wxLaunchDefaultBrowser, 2942).
--define(utils_wxGetEmailAddress, 2943).
--define(utils_wxGetUserId, 2944).
--define(utils_wxGetHomeDir, 2945).
--define(utils_wxNewId, 2946).
--define(utils_wxRegisterId, 2947).
--define(utils_wxGetCurrentId, 2948).
--define(utils_wxGetOsDescription, 2949).
--define(utils_wxIsPlatformLittleEndian, 2950).
--define(utils_wxIsPlatform64Bit, 2951).
--define(gdicmn_wxDisplaySize, 2952).
--define(gdicmn_wxSetCursor, 2953).
--define(wxPrintout_new, 2954).
--define(wxPrintout_destruct, 2955).
--define(wxPrintout_GetDC, 2956).
--define(wxPrintout_GetPageSizeMM, 2957).
--define(wxPrintout_GetPageSizePixels, 2958).
--define(wxPrintout_GetPaperRectPixels, 2959).
--define(wxPrintout_GetPPIPrinter, 2960).
--define(wxPrintout_GetPPIScreen, 2961).
--define(wxPrintout_GetTitle, 2962).
--define(wxPrintout_IsPreview, 2963).
--define(wxPrintout_FitThisSizeToPaper, 2964).
--define(wxPrintout_FitThisSizeToPage, 2965).
--define(wxPrintout_FitThisSizeToPageMargins, 2966).
--define(wxPrintout_MapScreenSizeToPaper, 2967).
--define(wxPrintout_MapScreenSizeToPage, 2968).
--define(wxPrintout_MapScreenSizeToPageMargins, 2969).
--define(wxPrintout_MapScreenSizeToDevice, 2970).
--define(wxPrintout_GetLogicalPaperRect, 2971).
--define(wxPrintout_GetLogicalPageRect, 2972).
--define(wxPrintout_GetLogicalPageMarginsRect, 2973).
--define(wxPrintout_SetLogicalOrigin, 2974).
--define(wxPrintout_OffsetLogicalOrigin, 2975).
--define(wxStyledTextCtrl_new_2, 2976).
--define(wxStyledTextCtrl_new_0, 2977).
--define(wxStyledTextCtrl_destruct, 2978).
--define(wxStyledTextCtrl_Create, 2979).
--define(wxStyledTextCtrl_AddText, 2980).
--define(wxStyledTextCtrl_AddStyledText, 2981).
--define(wxStyledTextCtrl_InsertText, 2982).
--define(wxStyledTextCtrl_ClearAll, 2983).
--define(wxStyledTextCtrl_ClearDocumentStyle, 2984).
--define(wxStyledTextCtrl_GetLength, 2985).
--define(wxStyledTextCtrl_GetCharAt, 2986).
--define(wxStyledTextCtrl_GetCurrentPos, 2987).
--define(wxStyledTextCtrl_GetAnchor, 2988).
--define(wxStyledTextCtrl_GetStyleAt, 2989).
--define(wxStyledTextCtrl_Redo, 2990).
--define(wxStyledTextCtrl_SetUndoCollection, 2991).
--define(wxStyledTextCtrl_SelectAll, 2992).
--define(wxStyledTextCtrl_SetSavePoint, 2993).
--define(wxStyledTextCtrl_GetStyledText, 2994).
--define(wxStyledTextCtrl_CanRedo, 2995).
--define(wxStyledTextCtrl_MarkerLineFromHandle, 2996).
--define(wxStyledTextCtrl_MarkerDeleteHandle, 2997).
--define(wxStyledTextCtrl_GetUndoCollection, 2998).
--define(wxStyledTextCtrl_GetViewWhiteSpace, 2999).
--define(wxStyledTextCtrl_SetViewWhiteSpace, 3000).
--define(wxStyledTextCtrl_PositionFromPoint, 3001).
--define(wxStyledTextCtrl_PositionFromPointClose, 3002).
--define(wxStyledTextCtrl_GotoLine, 3003).
--define(wxStyledTextCtrl_GotoPos, 3004).
--define(wxStyledTextCtrl_SetAnchor, 3005).
--define(wxStyledTextCtrl_GetCurLine, 3006).
--define(wxStyledTextCtrl_GetEndStyled, 3007).
--define(wxStyledTextCtrl_ConvertEOLs, 3008).
--define(wxStyledTextCtrl_GetEOLMode, 3009).
--define(wxStyledTextCtrl_SetEOLMode, 3010).
--define(wxStyledTextCtrl_StartStyling, 3011).
--define(wxStyledTextCtrl_SetStyling, 3012).
--define(wxStyledTextCtrl_GetBufferedDraw, 3013).
--define(wxStyledTextCtrl_SetBufferedDraw, 3014).
--define(wxStyledTextCtrl_SetTabWidth, 3015).
--define(wxStyledTextCtrl_GetTabWidth, 3016).
--define(wxStyledTextCtrl_SetCodePage, 3017).
--define(wxStyledTextCtrl_MarkerDefine, 3018).
--define(wxStyledTextCtrl_MarkerSetForeground, 3019).
--define(wxStyledTextCtrl_MarkerSetBackground, 3020).
--define(wxStyledTextCtrl_MarkerAdd, 3021).
--define(wxStyledTextCtrl_MarkerDelete, 3022).
--define(wxStyledTextCtrl_MarkerDeleteAll, 3023).
--define(wxStyledTextCtrl_MarkerGet, 3024).
--define(wxStyledTextCtrl_MarkerNext, 3025).
--define(wxStyledTextCtrl_MarkerPrevious, 3026).
--define(wxStyledTextCtrl_MarkerDefineBitmap, 3027).
--define(wxStyledTextCtrl_MarkerAddSet, 3028).
--define(wxStyledTextCtrl_MarkerSetAlpha, 3029).
--define(wxStyledTextCtrl_SetMarginType, 3030).
--define(wxStyledTextCtrl_GetMarginType, 3031).
--define(wxStyledTextCtrl_SetMarginWidth, 3032).
--define(wxStyledTextCtrl_GetMarginWidth, 3033).
--define(wxStyledTextCtrl_SetMarginMask, 3034).
--define(wxStyledTextCtrl_GetMarginMask, 3035).
--define(wxStyledTextCtrl_SetMarginSensitive, 3036).
--define(wxStyledTextCtrl_GetMarginSensitive, 3037).
--define(wxStyledTextCtrl_StyleClearAll, 3038).
--define(wxStyledTextCtrl_StyleSetForeground, 3039).
--define(wxStyledTextCtrl_StyleSetBackground, 3040).
--define(wxStyledTextCtrl_StyleSetBold, 3041).
--define(wxStyledTextCtrl_StyleSetItalic, 3042).
--define(wxStyledTextCtrl_StyleSetSize, 3043).
--define(wxStyledTextCtrl_StyleSetFaceName, 3044).
--define(wxStyledTextCtrl_StyleSetEOLFilled, 3045).
--define(wxStyledTextCtrl_StyleResetDefault, 3046).
--define(wxStyledTextCtrl_StyleSetUnderline, 3047).
--define(wxStyledTextCtrl_StyleSetCase, 3048).
--define(wxStyledTextCtrl_StyleSetHotSpot, 3049).
--define(wxStyledTextCtrl_SetSelForeground, 3050).
--define(wxStyledTextCtrl_SetSelBackground, 3051).
--define(wxStyledTextCtrl_GetSelAlpha, 3052).
--define(wxStyledTextCtrl_SetSelAlpha, 3053).
--define(wxStyledTextCtrl_SetCaretForeground, 3054).
--define(wxStyledTextCtrl_CmdKeyAssign, 3055).
--define(wxStyledTextCtrl_CmdKeyClear, 3056).
--define(wxStyledTextCtrl_CmdKeyClearAll, 3057).
--define(wxStyledTextCtrl_SetStyleBytes, 3058).
--define(wxStyledTextCtrl_StyleSetVisible, 3059).
--define(wxStyledTextCtrl_GetCaretPeriod, 3060).
--define(wxStyledTextCtrl_SetCaretPeriod, 3061).
--define(wxStyledTextCtrl_SetWordChars, 3062).
--define(wxStyledTextCtrl_BeginUndoAction, 3063).
--define(wxStyledTextCtrl_EndUndoAction, 3064).
--define(wxStyledTextCtrl_IndicatorSetStyle, 3065).
--define(wxStyledTextCtrl_IndicatorGetStyle, 3066).
--define(wxStyledTextCtrl_IndicatorSetForeground, 3067).
--define(wxStyledTextCtrl_IndicatorGetForeground, 3068).
--define(wxStyledTextCtrl_SetWhitespaceForeground, 3069).
--define(wxStyledTextCtrl_SetWhitespaceBackground, 3070).
--define(wxStyledTextCtrl_GetStyleBits, 3071).
--define(wxStyledTextCtrl_SetLineState, 3072).
--define(wxStyledTextCtrl_GetLineState, 3073).
--define(wxStyledTextCtrl_GetMaxLineState, 3074).
--define(wxStyledTextCtrl_GetCaretLineVisible, 3075).
--define(wxStyledTextCtrl_SetCaretLineVisible, 3076).
--define(wxStyledTextCtrl_GetCaretLineBackground, 3077).
--define(wxStyledTextCtrl_SetCaretLineBackground, 3078).
--define(wxStyledTextCtrl_AutoCompShow, 3079).
--define(wxStyledTextCtrl_AutoCompCancel, 3080).
--define(wxStyledTextCtrl_AutoCompActive, 3081).
--define(wxStyledTextCtrl_AutoCompPosStart, 3082).
--define(wxStyledTextCtrl_AutoCompComplete, 3083).
--define(wxStyledTextCtrl_AutoCompStops, 3084).
--define(wxStyledTextCtrl_AutoCompSetSeparator, 3085).
--define(wxStyledTextCtrl_AutoCompGetSeparator, 3086).
--define(wxStyledTextCtrl_AutoCompSelect, 3087).
--define(wxStyledTextCtrl_AutoCompSetCancelAtStart, 3088).
--define(wxStyledTextCtrl_AutoCompGetCancelAtStart, 3089).
--define(wxStyledTextCtrl_AutoCompSetFillUps, 3090).
--define(wxStyledTextCtrl_AutoCompSetChooseSingle, 3091).
--define(wxStyledTextCtrl_AutoCompGetChooseSingle, 3092).
--define(wxStyledTextCtrl_AutoCompSetIgnoreCase, 3093).
--define(wxStyledTextCtrl_AutoCompGetIgnoreCase, 3094).
--define(wxStyledTextCtrl_UserListShow, 3095).
--define(wxStyledTextCtrl_AutoCompSetAutoHide, 3096).
--define(wxStyledTextCtrl_AutoCompGetAutoHide, 3097).
--define(wxStyledTextCtrl_AutoCompSetDropRestOfWord, 3098).
--define(wxStyledTextCtrl_AutoCompGetDropRestOfWord, 3099).
--define(wxStyledTextCtrl_RegisterImage, 3100).
--define(wxStyledTextCtrl_ClearRegisteredImages, 3101).
--define(wxStyledTextCtrl_AutoCompGetTypeSeparator, 3102).
--define(wxStyledTextCtrl_AutoCompSetTypeSeparator, 3103).
--define(wxStyledTextCtrl_AutoCompSetMaxWidth, 3104).
--define(wxStyledTextCtrl_AutoCompGetMaxWidth, 3105).
--define(wxStyledTextCtrl_AutoCompSetMaxHeight, 3106).
--define(wxStyledTextCtrl_AutoCompGetMaxHeight, 3107).
--define(wxStyledTextCtrl_SetIndent, 3108).
--define(wxStyledTextCtrl_GetIndent, 3109).
--define(wxStyledTextCtrl_SetUseTabs, 3110).
--define(wxStyledTextCtrl_GetUseTabs, 3111).
--define(wxStyledTextCtrl_SetLineIndentation, 3112).
--define(wxStyledTextCtrl_GetLineIndentation, 3113).
--define(wxStyledTextCtrl_GetLineIndentPosition, 3114).
--define(wxStyledTextCtrl_GetColumn, 3115).
--define(wxStyledTextCtrl_SetUseHorizontalScrollBar, 3116).
--define(wxStyledTextCtrl_GetUseHorizontalScrollBar, 3117).
--define(wxStyledTextCtrl_SetIndentationGuides, 3118).
--define(wxStyledTextCtrl_GetIndentationGuides, 3119).
--define(wxStyledTextCtrl_SetHighlightGuide, 3120).
--define(wxStyledTextCtrl_GetHighlightGuide, 3121).
--define(wxStyledTextCtrl_GetLineEndPosition, 3122).
--define(wxStyledTextCtrl_GetCodePage, 3123).
--define(wxStyledTextCtrl_GetCaretForeground, 3124).
--define(wxStyledTextCtrl_GetReadOnly, 3125).
--define(wxStyledTextCtrl_SetCurrentPos, 3126).
--define(wxStyledTextCtrl_SetSelectionStart, 3127).
--define(wxStyledTextCtrl_GetSelectionStart, 3128).
--define(wxStyledTextCtrl_SetSelectionEnd, 3129).
--define(wxStyledTextCtrl_GetSelectionEnd, 3130).
--define(wxStyledTextCtrl_SetPrintMagnification, 3131).
--define(wxStyledTextCtrl_GetPrintMagnification, 3132).
--define(wxStyledTextCtrl_SetPrintColourMode, 3133).
--define(wxStyledTextCtrl_GetPrintColourMode, 3134).
--define(wxStyledTextCtrl_FindText, 3135).
--define(wxStyledTextCtrl_FormatRange, 3136).
--define(wxStyledTextCtrl_GetFirstVisibleLine, 3137).
--define(wxStyledTextCtrl_GetLine, 3138).
--define(wxStyledTextCtrl_GetLineCount, 3139).
--define(wxStyledTextCtrl_SetMarginLeft, 3140).
--define(wxStyledTextCtrl_GetMarginLeft, 3141).
--define(wxStyledTextCtrl_SetMarginRight, 3142).
--define(wxStyledTextCtrl_GetMarginRight, 3143).
--define(wxStyledTextCtrl_GetModify, 3144).
--define(wxStyledTextCtrl_SetSelection, 3145).
--define(wxStyledTextCtrl_GetSelectedText, 3146).
--define(wxStyledTextCtrl_GetTextRange, 3147).
--define(wxStyledTextCtrl_HideSelection, 3148).
--define(wxStyledTextCtrl_LineFromPosition, 3149).
--define(wxStyledTextCtrl_PositionFromLine, 3150).
--define(wxStyledTextCtrl_LineScroll, 3151).
--define(wxStyledTextCtrl_EnsureCaretVisible, 3152).
--define(wxStyledTextCtrl_ReplaceSelection, 3153).
--define(wxStyledTextCtrl_SetReadOnly, 3154).
--define(wxStyledTextCtrl_CanPaste, 3155).
--define(wxStyledTextCtrl_CanUndo, 3156).
--define(wxStyledTextCtrl_EmptyUndoBuffer, 3157).
--define(wxStyledTextCtrl_Undo, 3158).
--define(wxStyledTextCtrl_Cut, 3159).
--define(wxStyledTextCtrl_Copy, 3160).
--define(wxStyledTextCtrl_Paste, 3161).
--define(wxStyledTextCtrl_Clear, 3162).
--define(wxStyledTextCtrl_SetText, 3163).
--define(wxStyledTextCtrl_GetText, 3164).
--define(wxStyledTextCtrl_GetTextLength, 3165).
--define(wxStyledTextCtrl_GetOvertype, 3166).
--define(wxStyledTextCtrl_SetCaretWidth, 3167).
--define(wxStyledTextCtrl_GetCaretWidth, 3168).
--define(wxStyledTextCtrl_SetTargetStart, 3169).
--define(wxStyledTextCtrl_GetTargetStart, 3170).
--define(wxStyledTextCtrl_SetTargetEnd, 3171).
--define(wxStyledTextCtrl_GetTargetEnd, 3172).
--define(wxStyledTextCtrl_ReplaceTarget, 3173).
--define(wxStyledTextCtrl_SearchInTarget, 3174).
--define(wxStyledTextCtrl_SetSearchFlags, 3175).
--define(wxStyledTextCtrl_GetSearchFlags, 3176).
--define(wxStyledTextCtrl_CallTipShow, 3177).
--define(wxStyledTextCtrl_CallTipCancel, 3178).
--define(wxStyledTextCtrl_CallTipActive, 3179).
--define(wxStyledTextCtrl_CallTipPosAtStart, 3180).
--define(wxStyledTextCtrl_CallTipSetHighlight, 3181).
--define(wxStyledTextCtrl_CallTipSetBackground, 3182).
--define(wxStyledTextCtrl_CallTipSetForeground, 3183).
--define(wxStyledTextCtrl_CallTipSetForegroundHighlight, 3184).
--define(wxStyledTextCtrl_CallTipUseStyle, 3185).
--define(wxStyledTextCtrl_VisibleFromDocLine, 3186).
--define(wxStyledTextCtrl_DocLineFromVisible, 3187).
--define(wxStyledTextCtrl_WrapCount, 3188).
--define(wxStyledTextCtrl_SetFoldLevel, 3189).
--define(wxStyledTextCtrl_GetFoldLevel, 3190).
--define(wxStyledTextCtrl_GetLastChild, 3191).
--define(wxStyledTextCtrl_GetFoldParent, 3192).
--define(wxStyledTextCtrl_ShowLines, 3193).
--define(wxStyledTextCtrl_HideLines, 3194).
--define(wxStyledTextCtrl_GetLineVisible, 3195).
--define(wxStyledTextCtrl_SetFoldExpanded, 3196).
--define(wxStyledTextCtrl_GetFoldExpanded, 3197).
--define(wxStyledTextCtrl_ToggleFold, 3198).
--define(wxStyledTextCtrl_EnsureVisible, 3199).
--define(wxStyledTextCtrl_SetFoldFlags, 3200).
--define(wxStyledTextCtrl_EnsureVisibleEnforcePolicy, 3201).
--define(wxStyledTextCtrl_SetTabIndents, 3202).
--define(wxStyledTextCtrl_GetTabIndents, 3203).
--define(wxStyledTextCtrl_SetBackSpaceUnIndents, 3204).
--define(wxStyledTextCtrl_GetBackSpaceUnIndents, 3205).
--define(wxStyledTextCtrl_SetMouseDwellTime, 3206).
--define(wxStyledTextCtrl_GetMouseDwellTime, 3207).
--define(wxStyledTextCtrl_WordStartPosition, 3208).
--define(wxStyledTextCtrl_WordEndPosition, 3209).
--define(wxStyledTextCtrl_SetWrapMode, 3210).
--define(wxStyledTextCtrl_GetWrapMode, 3211).
--define(wxStyledTextCtrl_SetWrapVisualFlags, 3212).
--define(wxStyledTextCtrl_GetWrapVisualFlags, 3213).
--define(wxStyledTextCtrl_SetWrapVisualFlagsLocation, 3214).
--define(wxStyledTextCtrl_GetWrapVisualFlagsLocation, 3215).
--define(wxStyledTextCtrl_SetWrapStartIndent, 3216).
--define(wxStyledTextCtrl_GetWrapStartIndent, 3217).
--define(wxStyledTextCtrl_SetLayoutCache, 3218).
--define(wxStyledTextCtrl_GetLayoutCache, 3219).
--define(wxStyledTextCtrl_SetScrollWidth, 3220).
--define(wxStyledTextCtrl_GetScrollWidth, 3221).
--define(wxStyledTextCtrl_TextWidth, 3222).
--define(wxStyledTextCtrl_GetEndAtLastLine, 3223).
--define(wxStyledTextCtrl_TextHeight, 3224).
--define(wxStyledTextCtrl_SetUseVerticalScrollBar, 3225).
--define(wxStyledTextCtrl_GetUseVerticalScrollBar, 3226).
--define(wxStyledTextCtrl_AppendText, 3227).
--define(wxStyledTextCtrl_GetTwoPhaseDraw, 3228).
--define(wxStyledTextCtrl_SetTwoPhaseDraw, 3229).
--define(wxStyledTextCtrl_TargetFromSelection, 3230).
--define(wxStyledTextCtrl_LinesJoin, 3231).
--define(wxStyledTextCtrl_LinesSplit, 3232).
--define(wxStyledTextCtrl_SetFoldMarginColour, 3233).
--define(wxStyledTextCtrl_SetFoldMarginHiColour, 3234).
--define(wxStyledTextCtrl_LineDown, 3235).
--define(wxStyledTextCtrl_LineDownExtend, 3236).
--define(wxStyledTextCtrl_LineUp, 3237).
--define(wxStyledTextCtrl_LineUpExtend, 3238).
--define(wxStyledTextCtrl_CharLeft, 3239).
--define(wxStyledTextCtrl_CharLeftExtend, 3240).
--define(wxStyledTextCtrl_CharRight, 3241).
--define(wxStyledTextCtrl_CharRightExtend, 3242).
--define(wxStyledTextCtrl_WordLeft, 3243).
--define(wxStyledTextCtrl_WordLeftExtend, 3244).
--define(wxStyledTextCtrl_WordRight, 3245).
--define(wxStyledTextCtrl_WordRightExtend, 3246).
--define(wxStyledTextCtrl_Home, 3247).
--define(wxStyledTextCtrl_HomeExtend, 3248).
--define(wxStyledTextCtrl_LineEnd, 3249).
--define(wxStyledTextCtrl_LineEndExtend, 3250).
--define(wxStyledTextCtrl_DocumentStart, 3251).
--define(wxStyledTextCtrl_DocumentStartExtend, 3252).
--define(wxStyledTextCtrl_DocumentEnd, 3253).
--define(wxStyledTextCtrl_DocumentEndExtend, 3254).
--define(wxStyledTextCtrl_PageUp, 3255).
--define(wxStyledTextCtrl_PageUpExtend, 3256).
--define(wxStyledTextCtrl_PageDown, 3257).
--define(wxStyledTextCtrl_PageDownExtend, 3258).
--define(wxStyledTextCtrl_EditToggleOvertype, 3259).
--define(wxStyledTextCtrl_Cancel, 3260).
--define(wxStyledTextCtrl_DeleteBack, 3261).
--define(wxStyledTextCtrl_Tab, 3262).
--define(wxStyledTextCtrl_BackTab, 3263).
--define(wxStyledTextCtrl_NewLine, 3264).
--define(wxStyledTextCtrl_FormFeed, 3265).
--define(wxStyledTextCtrl_VCHome, 3266).
--define(wxStyledTextCtrl_VCHomeExtend, 3267).
--define(wxStyledTextCtrl_ZoomIn, 3268).
--define(wxStyledTextCtrl_ZoomOut, 3269).
--define(wxStyledTextCtrl_DelWordLeft, 3270).
--define(wxStyledTextCtrl_DelWordRight, 3271).
--define(wxStyledTextCtrl_LineCut, 3272).
--define(wxStyledTextCtrl_LineDelete, 3273).
--define(wxStyledTextCtrl_LineTranspose, 3274).
--define(wxStyledTextCtrl_LineDuplicate, 3275).
--define(wxStyledTextCtrl_LowerCase, 3276).
--define(wxStyledTextCtrl_UpperCase, 3277).
--define(wxStyledTextCtrl_LineScrollDown, 3278).
--define(wxStyledTextCtrl_LineScrollUp, 3279).
--define(wxStyledTextCtrl_DeleteBackNotLine, 3280).
--define(wxStyledTextCtrl_HomeDisplay, 3281).
--define(wxStyledTextCtrl_HomeDisplayExtend, 3282).
--define(wxStyledTextCtrl_LineEndDisplay, 3283).
--define(wxStyledTextCtrl_LineEndDisplayExtend, 3284).
--define(wxStyledTextCtrl_HomeWrapExtend, 3285).
--define(wxStyledTextCtrl_LineEndWrap, 3286).
--define(wxStyledTextCtrl_LineEndWrapExtend, 3287).
--define(wxStyledTextCtrl_VCHomeWrap, 3288).
--define(wxStyledTextCtrl_VCHomeWrapExtend, 3289).
--define(wxStyledTextCtrl_LineCopy, 3290).
--define(wxStyledTextCtrl_MoveCaretInsideView, 3291).
--define(wxStyledTextCtrl_LineLength, 3292).
--define(wxStyledTextCtrl_BraceHighlight, 3293).
--define(wxStyledTextCtrl_BraceBadLight, 3294).
--define(wxStyledTextCtrl_BraceMatch, 3295).
--define(wxStyledTextCtrl_GetViewEOL, 3296).
--define(wxStyledTextCtrl_SetViewEOL, 3297).
--define(wxStyledTextCtrl_SetModEventMask, 3298).
--define(wxStyledTextCtrl_GetEdgeColumn, 3299).
--define(wxStyledTextCtrl_SetEdgeColumn, 3300).
--define(wxStyledTextCtrl_SetEdgeMode, 3301).
--define(wxStyledTextCtrl_GetEdgeMode, 3302).
--define(wxStyledTextCtrl_GetEdgeColour, 3303).
--define(wxStyledTextCtrl_SetEdgeColour, 3304).
--define(wxStyledTextCtrl_SearchAnchor, 3305).
--define(wxStyledTextCtrl_SearchNext, 3306).
--define(wxStyledTextCtrl_SearchPrev, 3307).
--define(wxStyledTextCtrl_LinesOnScreen, 3308).
--define(wxStyledTextCtrl_UsePopUp, 3309).
--define(wxStyledTextCtrl_SelectionIsRectangle, 3310).
--define(wxStyledTextCtrl_SetZoom, 3311).
--define(wxStyledTextCtrl_GetZoom, 3312).
--define(wxStyledTextCtrl_GetModEventMask, 3313).
--define(wxStyledTextCtrl_SetSTCFocus, 3314).
--define(wxStyledTextCtrl_GetSTCFocus, 3315).
--define(wxStyledTextCtrl_SetStatus, 3316).
--define(wxStyledTextCtrl_GetStatus, 3317).
--define(wxStyledTextCtrl_SetMouseDownCaptures, 3318).
--define(wxStyledTextCtrl_GetMouseDownCaptures, 3319).
--define(wxStyledTextCtrl_SetSTCCursor, 3320).
--define(wxStyledTextCtrl_GetSTCCursor, 3321).
--define(wxStyledTextCtrl_SetControlCharSymbol, 3322).
--define(wxStyledTextCtrl_GetControlCharSymbol, 3323).
--define(wxStyledTextCtrl_WordPartLeft, 3324).
--define(wxStyledTextCtrl_WordPartLeftExtend, 3325).
--define(wxStyledTextCtrl_WordPartRight, 3326).
--define(wxStyledTextCtrl_WordPartRightExtend, 3327).
--define(wxStyledTextCtrl_SetVisiblePolicy, 3328).
--define(wxStyledTextCtrl_DelLineLeft, 3329).
--define(wxStyledTextCtrl_DelLineRight, 3330).
--define(wxStyledTextCtrl_GetXOffset, 3331).
--define(wxStyledTextCtrl_ChooseCaretX, 3332).
--define(wxStyledTextCtrl_SetXCaretPolicy, 3333).
--define(wxStyledTextCtrl_SetYCaretPolicy, 3334).
--define(wxStyledTextCtrl_GetPrintWrapMode, 3335).
--define(wxStyledTextCtrl_SetHotspotActiveForeground, 3336).
--define(wxStyledTextCtrl_SetHotspotActiveBackground, 3337).
--define(wxStyledTextCtrl_SetHotspotActiveUnderline, 3338).
--define(wxStyledTextCtrl_SetHotspotSingleLine, 3339).
--define(wxStyledTextCtrl_ParaDownExtend, 3340).
--define(wxStyledTextCtrl_ParaUp, 3341).
--define(wxStyledTextCtrl_ParaUpExtend, 3342).
--define(wxStyledTextCtrl_PositionBefore, 3343).
--define(wxStyledTextCtrl_PositionAfter, 3344).
--define(wxStyledTextCtrl_CopyRange, 3345).
--define(wxStyledTextCtrl_CopyText, 3346).
--define(wxStyledTextCtrl_SetSelectionMode, 3347).
--define(wxStyledTextCtrl_GetSelectionMode, 3348).
--define(wxStyledTextCtrl_LineDownRectExtend, 3349).
--define(wxStyledTextCtrl_LineUpRectExtend, 3350).
--define(wxStyledTextCtrl_CharLeftRectExtend, 3351).
--define(wxStyledTextCtrl_CharRightRectExtend, 3352).
--define(wxStyledTextCtrl_HomeRectExtend, 3353).
--define(wxStyledTextCtrl_VCHomeRectExtend, 3354).
--define(wxStyledTextCtrl_LineEndRectExtend, 3355).
--define(wxStyledTextCtrl_PageUpRectExtend, 3356).
--define(wxStyledTextCtrl_PageDownRectExtend, 3357).
--define(wxStyledTextCtrl_StutteredPageUp, 3358).
--define(wxStyledTextCtrl_StutteredPageUpExtend, 3359).
--define(wxStyledTextCtrl_StutteredPageDown, 3360).
--define(wxStyledTextCtrl_StutteredPageDownExtend, 3361).
--define(wxStyledTextCtrl_WordLeftEnd, 3362).
--define(wxStyledTextCtrl_WordLeftEndExtend, 3363).
--define(wxStyledTextCtrl_WordRightEnd, 3364).
--define(wxStyledTextCtrl_WordRightEndExtend, 3365).
--define(wxStyledTextCtrl_SetWhitespaceChars, 3366).
--define(wxStyledTextCtrl_SetCharsDefault, 3367).
--define(wxStyledTextCtrl_AutoCompGetCurrent, 3368).
--define(wxStyledTextCtrl_Allocate, 3369).
--define(wxStyledTextCtrl_FindColumn, 3370).
--define(wxStyledTextCtrl_GetCaretSticky, 3371).
--define(wxStyledTextCtrl_SetCaretSticky, 3372).
--define(wxStyledTextCtrl_ToggleCaretSticky, 3373).
--define(wxStyledTextCtrl_SetPasteConvertEndings, 3374).
--define(wxStyledTextCtrl_GetPasteConvertEndings, 3375).
--define(wxStyledTextCtrl_SelectionDuplicate, 3376).
--define(wxStyledTextCtrl_SetCaretLineBackAlpha, 3377).
--define(wxStyledTextCtrl_GetCaretLineBackAlpha, 3378).
--define(wxStyledTextCtrl_StartRecord, 3379).
--define(wxStyledTextCtrl_StopRecord, 3380).
--define(wxStyledTextCtrl_SetLexer, 3381).
--define(wxStyledTextCtrl_GetLexer, 3382).
--define(wxStyledTextCtrl_Colourise, 3383).
--define(wxStyledTextCtrl_SetProperty, 3384).
--define(wxStyledTextCtrl_SetKeyWords, 3385).
--define(wxStyledTextCtrl_SetLexerLanguage, 3386).
--define(wxStyledTextCtrl_GetProperty, 3387).
--define(wxStyledTextCtrl_GetStyleBitsNeeded, 3388).
--define(wxStyledTextCtrl_GetCurrentLine, 3389).
--define(wxStyledTextCtrl_StyleSetSpec, 3390).
--define(wxStyledTextCtrl_StyleSetFont, 3391).
--define(wxStyledTextCtrl_StyleSetFontAttr, 3392).
--define(wxStyledTextCtrl_StyleSetCharacterSet, 3393).
--define(wxStyledTextCtrl_StyleSetFontEncoding, 3394).
--define(wxStyledTextCtrl_CmdKeyExecute, 3395).
--define(wxStyledTextCtrl_SetMargins, 3396).
--define(wxStyledTextCtrl_GetSelection, 3397).
--define(wxStyledTextCtrl_PointFromPosition, 3398).
--define(wxStyledTextCtrl_ScrollToLine, 3399).
--define(wxStyledTextCtrl_ScrollToColumn, 3400).
--define(wxStyledTextCtrl_SetVScrollBar, 3401).
--define(wxStyledTextCtrl_SetHScrollBar, 3402).
--define(wxStyledTextCtrl_GetLastKeydownProcessed, 3403).
--define(wxStyledTextCtrl_SetLastKeydownProcessed, 3404).
--define(wxStyledTextCtrl_SaveFile, 3405).
--define(wxStyledTextCtrl_LoadFile, 3406).
--define(wxStyledTextCtrl_DoDragOver, 3407).
--define(wxStyledTextCtrl_DoDropText, 3408).
--define(wxStyledTextCtrl_GetUseAntiAliasing, 3409).
--define(wxStyledTextCtrl_AddTextRaw, 3410).
--define(wxStyledTextCtrl_InsertTextRaw, 3411).
--define(wxStyledTextCtrl_GetCurLineRaw, 3412).
--define(wxStyledTextCtrl_GetLineRaw, 3413).
--define(wxStyledTextCtrl_GetSelectedTextRaw, 3414).
--define(wxStyledTextCtrl_GetTextRangeRaw, 3415).
--define(wxStyledTextCtrl_SetTextRaw, 3416).
--define(wxStyledTextCtrl_GetTextRaw, 3417).
--define(wxStyledTextCtrl_AppendTextRaw, 3418).
--define(wxArtProvider_GetBitmap, 3419).
--define(wxArtProvider_GetIcon, 3420).
--define(wxTreeEvent_GetKeyCode, 3421).
--define(wxTreeEvent_GetItem, 3422).
--define(wxTreeEvent_GetKeyEvent, 3423).
--define(wxTreeEvent_GetLabel, 3424).
--define(wxTreeEvent_GetOldItem, 3425).
--define(wxTreeEvent_GetPoint, 3426).
--define(wxTreeEvent_IsEditCancelled, 3427).
--define(wxTreeEvent_SetToolTip, 3428).
--define(wxNotebookEvent_GetOldSelection, 3429).
--define(wxNotebookEvent_GetSelection, 3430).
--define(wxNotebookEvent_SetOldSelection, 3431).
--define(wxNotebookEvent_SetSelection, 3432).
--define(wxFileDataObject_new, 3433).
--define(wxFileDataObject_AddFile, 3434).
--define(wxFileDataObject_GetFilenames, 3435).
--define(wxFileDataObject_destroy, 3436).
--define(wxTextDataObject_new, 3437).
--define(wxTextDataObject_GetTextLength, 3438).
--define(wxTextDataObject_GetText, 3439).
--define(wxTextDataObject_SetText, 3440).
--define(wxTextDataObject_destroy, 3441).
--define(wxBitmapDataObject_new_1_1, 3442).
--define(wxBitmapDataObject_new_1_0, 3443).
--define(wxBitmapDataObject_GetBitmap, 3444).
--define(wxBitmapDataObject_SetBitmap, 3445).
--define(wxBitmapDataObject_destroy, 3446).
--define(wxClipboard_new, 3448).
--define(wxClipboard_destruct, 3449).
--define(wxClipboard_AddData, 3450).
--define(wxClipboard_Clear, 3451).
--define(wxClipboard_Close, 3452).
--define(wxClipboard_Flush, 3453).
--define(wxClipboard_GetData, 3454).
--define(wxClipboard_IsOpened, 3455).
--define(wxClipboard_Open, 3456).
--define(wxClipboard_SetData, 3457).
--define(wxClipboard_UsePrimarySelection, 3459).
--define(wxClipboard_IsSupported, 3460).
--define(wxClipboard_Get, 3461).
--define(wxSpinEvent_GetPosition, 3462).
--define(wxSpinEvent_SetPosition, 3463).
--define(wxSplitterWindow_new_0, 3464).
--define(wxSplitterWindow_new_2, 3465).
--define(wxSplitterWindow_destruct, 3466).
--define(wxSplitterWindow_Create, 3467).
--define(wxSplitterWindow_GetMinimumPaneSize, 3468).
--define(wxSplitterWindow_GetSashGravity, 3469).
--define(wxSplitterWindow_GetSashPosition, 3470).
--define(wxSplitterWindow_GetSplitMode, 3471).
--define(wxSplitterWindow_GetWindow1, 3472).
--define(wxSplitterWindow_GetWindow2, 3473).
--define(wxSplitterWindow_Initialize, 3474).
--define(wxSplitterWindow_IsSplit, 3475).
--define(wxSplitterWindow_ReplaceWindow, 3476).
--define(wxSplitterWindow_SetSashGravity, 3477).
--define(wxSplitterWindow_SetSashPosition, 3478).
--define(wxSplitterWindow_SetSashSize, 3479).
--define(wxSplitterWindow_SetMinimumPaneSize, 3480).
--define(wxSplitterWindow_SetSplitMode, 3481).
--define(wxSplitterWindow_SplitHorizontally, 3482).
--define(wxSplitterWindow_SplitVertically, 3483).
--define(wxSplitterWindow_Unsplit, 3484).
--define(wxSplitterWindow_UpdateSize, 3485).
--define(wxSplitterEvent_GetSashPosition, 3486).
--define(wxSplitterEvent_GetX, 3487).
--define(wxSplitterEvent_GetY, 3488).
--define(wxSplitterEvent_GetWindowBeingRemoved, 3489).
--define(wxSplitterEvent_SetSashPosition, 3490).
--define(wxHtmlWindow_new_0, 3491).
--define(wxHtmlWindow_new_2, 3492).
--define(wxHtmlWindow_AppendToPage, 3493).
--define(wxHtmlWindow_GetOpenedAnchor, 3494).
--define(wxHtmlWindow_GetOpenedPage, 3495).
--define(wxHtmlWindow_GetOpenedPageTitle, 3496).
--define(wxHtmlWindow_GetRelatedFrame, 3497).
--define(wxHtmlWindow_HistoryBack, 3498).
--define(wxHtmlWindow_HistoryCanBack, 3499).
--define(wxHtmlWindow_HistoryCanForward, 3500).
--define(wxHtmlWindow_HistoryClear, 3501).
--define(wxHtmlWindow_HistoryForward, 3502).
--define(wxHtmlWindow_LoadFile, 3503).
--define(wxHtmlWindow_LoadPage, 3504).
--define(wxHtmlWindow_SelectAll, 3505).
--define(wxHtmlWindow_SelectionToText, 3506).
--define(wxHtmlWindow_SelectLine, 3507).
--define(wxHtmlWindow_SelectWord, 3508).
--define(wxHtmlWindow_SetBorders, 3509).
--define(wxHtmlWindow_SetFonts, 3510).
--define(wxHtmlWindow_SetPage, 3511).
--define(wxHtmlWindow_SetRelatedFrame, 3512).
--define(wxHtmlWindow_SetRelatedStatusBar, 3513).
--define(wxHtmlWindow_ToText, 3514).
--define(wxHtmlWindow_destroy, 3515).
--define(wxHtmlLinkEvent_GetLinkInfo, 3516).
--define(wxSystemSettings_GetColour, 3517).
--define(wxSystemSettings_GetFont, 3518).
--define(wxSystemSettings_GetMetric, 3519).
--define(wxSystemSettings_GetScreenType, 3520).
--define(wxSystemOptions_GetOption, 3521).
--define(wxSystemOptions_GetOptionInt, 3522).
--define(wxSystemOptions_HasOption, 3523).
--define(wxSystemOptions_IsFalse, 3524).
--define(wxSystemOptions_SetOption_2_1, 3525).
--define(wxSystemOptions_SetOption_2_0, 3526).
--define(wxAuiNotebookEvent_SetSelection, 3527).
--define(wxAuiNotebookEvent_GetSelection, 3528).
--define(wxAuiNotebookEvent_SetOldSelection, 3529).
--define(wxAuiNotebookEvent_GetOldSelection, 3530).
--define(wxAuiNotebookEvent_SetDragSource, 3531).
--define(wxAuiNotebookEvent_GetDragSource, 3532).
--define(wxAuiManagerEvent_SetManager, 3533).
--define(wxAuiManagerEvent_GetManager, 3534).
--define(wxAuiManagerEvent_SetPane, 3535).
--define(wxAuiManagerEvent_GetPane, 3536).
--define(wxAuiManagerEvent_SetButton, 3537).
--define(wxAuiManagerEvent_GetButton, 3538).
--define(wxAuiManagerEvent_SetDC, 3539).
--define(wxAuiManagerEvent_GetDC, 3540).
--define(wxAuiManagerEvent_Veto, 3541).
--define(wxAuiManagerEvent_GetVeto, 3542).
--define(wxAuiManagerEvent_SetCanVeto, 3543).
--define(wxAuiManagerEvent_CanVeto, 3544).
--define(wxLogNull_new, 3545).
--define(wxLogNull_destroy, 3546).
--define(wxTaskBarIcon_new, 3547).
--define(wxTaskBarIcon_destruct, 3548).
--define(wxTaskBarIcon_PopupMenu, 3549).
--define(wxTaskBarIcon_RemoveIcon, 3550).
--define(wxTaskBarIcon_SetIcon, 3551).
--define(wxLocale_new_0, 3552).
--define(wxLocale_new_2, 3554).
--define(wxLocale_destruct, 3555).
--define(wxLocale_Init, 3557).
--define(wxLocale_AddCatalog_1, 3558).
--define(wxLocale_AddCatalog_3, 3559).
--define(wxLocale_AddCatalogLookupPathPrefix, 3560).
--define(wxLocale_GetCanonicalName, 3561).
--define(wxLocale_GetLanguage, 3562).
--define(wxLocale_GetLanguageName, 3563).
--define(wxLocale_GetLocale, 3564).
--define(wxLocale_GetName, 3565).
--define(wxLocale_GetString_2, 3566).
--define(wxLocale_GetString_4, 3567).
--define(wxLocale_GetHeaderValue, 3568).
--define(wxLocale_GetSysName, 3569).
--define(wxLocale_GetSystemEncoding, 3570).
--define(wxLocale_GetSystemEncodingName, 3571).
--define(wxLocale_GetSystemLanguage, 3572).
--define(wxLocale_IsLoaded, 3573).
--define(wxLocale_IsOk, 3574).
--define(wxActivateEvent_GetActive, 3575).
--define(wxPopupWindow_new_2, 3577).
--define(wxPopupWindow_new_0, 3578).
--define(wxPopupWindow_destruct, 3580).
--define(wxPopupWindow_Create, 3581).
--define(wxPopupWindow_Position, 3582).
--define(wxPopupTransientWindow_new_0, 3583).
--define(wxPopupTransientWindow_new_2, 3584).
--define(wxPopupTransientWindow_destruct, 3585).
--define(wxPopupTransientWindow_Popup, 3586).
--define(wxPopupTransientWindow_Dismiss, 3587).
--define(wxOverlay_new, 3588).
--define(wxOverlay_destruct, 3589).
--define(wxOverlay_Reset, 3590).
--define(wxDCOverlay_new_6, 3591).
--define(wxDCOverlay_new_2, 3592).
--define(wxDCOverlay_destruct, 3593).
--define(wxDCOverlay_Clear, 3594).
+-define(wxWindow_SetTransparent, 284).
+-define(wxWindow_CanSetTransparent, 285).
+-define(wxWindow_IsDoubleBuffered, 286).
+-define(wxWindow_SetDoubleBuffered, 287).
+-define(wxTopLevelWindow_GetIcon, 288).
+-define(wxTopLevelWindow_GetIcons, 289).
+-define(wxTopLevelWindow_GetTitle, 290).
+-define(wxTopLevelWindow_IsActive, 291).
+-define(wxTopLevelWindow_Iconize, 292).
+-define(wxTopLevelWindow_IsFullScreen, 293).
+-define(wxTopLevelWindow_IsIconized, 294).
+-define(wxTopLevelWindow_IsMaximized, 295).
+-define(wxTopLevelWindow_Maximize, 296).
+-define(wxTopLevelWindow_RequestUserAttention, 297).
+-define(wxTopLevelWindow_SetIcon, 298).
+-define(wxTopLevelWindow_SetIcons, 299).
+-define(wxTopLevelWindow_CenterOnScreen, 300).
+-define(wxTopLevelWindow_CentreOnScreen, 301).
+-define(wxTopLevelWindow_SetShape, 303).
+-define(wxTopLevelWindow_SetTitle, 304).
+-define(wxTopLevelWindow_ShowFullScreen, 305).
+-define(wxFrame_new_4, 307).
+-define(wxFrame_new_0, 308).
+-define(wxFrame_destruct, 310).
+-define(wxFrame_Create, 311).
+-define(wxFrame_CreateStatusBar, 312).
+-define(wxFrame_CreateToolBar, 313).
+-define(wxFrame_GetClientAreaOrigin, 314).
+-define(wxFrame_GetMenuBar, 315).
+-define(wxFrame_GetStatusBar, 316).
+-define(wxFrame_GetStatusBarPane, 317).
+-define(wxFrame_GetToolBar, 318).
+-define(wxFrame_ProcessCommand, 319).
+-define(wxFrame_SendSizeEvent, 320).
+-define(wxFrame_SetMenuBar, 321).
+-define(wxFrame_SetStatusBar, 322).
+-define(wxFrame_SetStatusBarPane, 323).
+-define(wxFrame_SetStatusText, 324).
+-define(wxFrame_SetStatusWidths, 325).
+-define(wxFrame_SetToolBar, 326).
+-define(wxMiniFrame_new_0, 327).
+-define(wxMiniFrame_new_4, 328).
+-define(wxMiniFrame_Create, 329).
+-define(wxMiniFrame_destroy, 330).
+-define(wxSplashScreen_new_0, 331).
+-define(wxSplashScreen_new_6, 332).
+-define(wxSplashScreen_destruct, 333).
+-define(wxSplashScreen_GetSplashStyle, 334).
+-define(wxSplashScreen_GetTimeout, 335).
+-define(wxPanel_new_0, 336).
+-define(wxPanel_new_6, 337).
+-define(wxPanel_new_2, 338).
+-define(wxPanel_destruct, 339).
+-define(wxPanel_InitDialog, 340).
+-define(wxPanel_SetFocusIgnoringChildren, 341).
+-define(wxScrolledWindow_new_0, 342).
+-define(wxScrolledWindow_new_2, 343).
+-define(wxScrolledWindow_destruct, 344).
+-define(wxScrolledWindow_CalcScrolledPosition_4, 345).
+-define(wxScrolledWindow_CalcScrolledPosition_1, 346).
+-define(wxScrolledWindow_CalcUnscrolledPosition_4, 347).
+-define(wxScrolledWindow_CalcUnscrolledPosition_1, 348).
+-define(wxScrolledWindow_EnableScrolling, 349).
+-define(wxScrolledWindow_GetScrollPixelsPerUnit, 350).
+-define(wxScrolledWindow_GetViewStart, 351).
+-define(wxScrolledWindow_DoPrepareDC, 352).
+-define(wxScrolledWindow_PrepareDC, 353).
+-define(wxScrolledWindow_Scroll, 354).
+-define(wxScrolledWindow_SetScrollbars, 355).
+-define(wxScrolledWindow_SetScrollRate, 356).
+-define(wxScrolledWindow_SetTargetWindow, 357).
+-define(wxSashWindow_new_0, 358).
+-define(wxSashWindow_new_2, 359).
+-define(wxSashWindow_destruct, 360).
+-define(wxSashWindow_GetSashVisible, 361).
+-define(wxSashWindow_GetMaximumSizeX, 362).
+-define(wxSashWindow_GetMaximumSizeY, 363).
+-define(wxSashWindow_GetMinimumSizeX, 364).
+-define(wxSashWindow_GetMinimumSizeY, 365).
+-define(wxSashWindow_SetMaximumSizeX, 366).
+-define(wxSashWindow_SetMaximumSizeY, 367).
+-define(wxSashWindow_SetMinimumSizeX, 368).
+-define(wxSashWindow_SetMinimumSizeY, 369).
+-define(wxSashWindow_SetSashVisible, 370).
+-define(wxSashLayoutWindow_new_0, 371).
+-define(wxSashLayoutWindow_new_2, 372).
+-define(wxSashLayoutWindow_Create, 373).
+-define(wxSashLayoutWindow_GetAlignment, 374).
+-define(wxSashLayoutWindow_GetOrientation, 375).
+-define(wxSashLayoutWindow_SetAlignment, 376).
+-define(wxSashLayoutWindow_SetDefaultSize, 377).
+-define(wxSashLayoutWindow_SetOrientation, 378).
+-define(wxSashLayoutWindow_destroy, 379).
+-define(wxGrid_new_0, 380).
+-define(wxGrid_new_3, 381).
+-define(wxGrid_new_4, 382).
+-define(wxGrid_destruct, 383).
+-define(wxGrid_AppendCols, 384).
+-define(wxGrid_AppendRows, 385).
+-define(wxGrid_AutoSize, 386).
+-define(wxGrid_AutoSizeColumn, 387).
+-define(wxGrid_AutoSizeColumns, 388).
+-define(wxGrid_AutoSizeRow, 389).
+-define(wxGrid_AutoSizeRows, 390).
+-define(wxGrid_BeginBatch, 391).
+-define(wxGrid_BlockToDeviceRect, 392).
+-define(wxGrid_CanDragColSize, 393).
+-define(wxGrid_CanDragRowSize, 394).
+-define(wxGrid_CanDragGridSize, 395).
+-define(wxGrid_CanEnableCellControl, 396).
+-define(wxGrid_CellToRect_2, 397).
+-define(wxGrid_CellToRect_1, 398).
+-define(wxGrid_ClearGrid, 399).
+-define(wxGrid_ClearSelection, 400).
+-define(wxGrid_CreateGrid, 401).
+-define(wxGrid_DeleteCols, 402).
+-define(wxGrid_DeleteRows, 403).
+-define(wxGrid_DisableCellEditControl, 404).
+-define(wxGrid_DisableDragColSize, 405).
+-define(wxGrid_DisableDragGridSize, 406).
+-define(wxGrid_DisableDragRowSize, 407).
+-define(wxGrid_EnableCellEditControl, 408).
+-define(wxGrid_EnableDragColSize, 409).
+-define(wxGrid_EnableDragGridSize, 410).
+-define(wxGrid_EnableDragRowSize, 411).
+-define(wxGrid_EnableEditing, 412).
+-define(wxGrid_EnableGridLines, 413).
+-define(wxGrid_EndBatch, 414).
+-define(wxGrid_Fit, 415).
+-define(wxGrid_ForceRefresh, 416).
+-define(wxGrid_GetBatchCount, 417).
+-define(wxGrid_GetCellAlignment, 418).
+-define(wxGrid_GetCellBackgroundColour, 419).
+-define(wxGrid_GetCellEditor, 420).
+-define(wxGrid_GetCellFont, 421).
+-define(wxGrid_GetCellRenderer, 422).
+-define(wxGrid_GetCellTextColour, 423).
+-define(wxGrid_GetCellValue_2, 424).
+-define(wxGrid_GetCellValue_1, 425).
+-define(wxGrid_GetColLabelAlignment, 426).
+-define(wxGrid_GetColLabelSize, 427).
+-define(wxGrid_GetColLabelValue, 428).
+-define(wxGrid_GetColMinimalAcceptableWidth, 429).
+-define(wxGrid_GetDefaultCellAlignment, 430).
+-define(wxGrid_GetDefaultCellBackgroundColour, 431).
+-define(wxGrid_GetDefaultCellFont, 432).
+-define(wxGrid_GetDefaultCellTextColour, 433).
+-define(wxGrid_GetDefaultColLabelSize, 434).
+-define(wxGrid_GetDefaultColSize, 435).
+-define(wxGrid_GetDefaultEditor, 436).
+-define(wxGrid_GetDefaultEditorForCell_2, 437).
+-define(wxGrid_GetDefaultEditorForCell_1, 438).
+-define(wxGrid_GetDefaultEditorForType, 439).
+-define(wxGrid_GetDefaultRenderer, 440).
+-define(wxGrid_GetDefaultRendererForCell, 441).
+-define(wxGrid_GetDefaultRendererForType, 442).
+-define(wxGrid_GetDefaultRowLabelSize, 443).
+-define(wxGrid_GetDefaultRowSize, 444).
+-define(wxGrid_GetGridCursorCol, 445).
+-define(wxGrid_GetGridCursorRow, 446).
+-define(wxGrid_GetGridLineColour, 447).
+-define(wxGrid_GridLinesEnabled, 448).
+-define(wxGrid_GetLabelBackgroundColour, 449).
+-define(wxGrid_GetLabelFont, 450).
+-define(wxGrid_GetLabelTextColour, 451).
+-define(wxGrid_GetNumberCols, 452).
+-define(wxGrid_GetNumberRows, 453).
+-define(wxGrid_GetOrCreateCellAttr, 454).
+-define(wxGrid_GetRowMinimalAcceptableHeight, 455).
+-define(wxGrid_GetRowLabelAlignment, 456).
+-define(wxGrid_GetRowLabelSize, 457).
+-define(wxGrid_GetRowLabelValue, 458).
+-define(wxGrid_GetRowSize, 459).
+-define(wxGrid_GetScrollLineX, 460).
+-define(wxGrid_GetScrollLineY, 461).
+-define(wxGrid_GetSelectedCells, 462).
+-define(wxGrid_GetSelectedCols, 463).
+-define(wxGrid_GetSelectedRows, 464).
+-define(wxGrid_GetSelectionBackground, 465).
+-define(wxGrid_GetSelectionBlockTopLeft, 466).
+-define(wxGrid_GetSelectionBlockBottomRight, 467).
+-define(wxGrid_GetSelectionForeground, 468).
+-define(wxGrid_GetViewWidth, 469).
+-define(wxGrid_GetGridWindow, 470).
+-define(wxGrid_GetGridRowLabelWindow, 471).
+-define(wxGrid_GetGridColLabelWindow, 472).
+-define(wxGrid_GetGridCornerLabelWindow, 473).
+-define(wxGrid_HideCellEditControl, 474).
+-define(wxGrid_InsertCols, 475).
+-define(wxGrid_InsertRows, 476).
+-define(wxGrid_IsCellEditControlEnabled, 477).
+-define(wxGrid_IsCurrentCellReadOnly, 478).
+-define(wxGrid_IsEditable, 479).
+-define(wxGrid_IsInSelection_2, 480).
+-define(wxGrid_IsInSelection_1, 481).
+-define(wxGrid_IsReadOnly, 482).
+-define(wxGrid_IsSelection, 483).
+-define(wxGrid_IsVisible_3, 484).
+-define(wxGrid_IsVisible_2, 485).
+-define(wxGrid_MakeCellVisible_2, 486).
+-define(wxGrid_MakeCellVisible_1, 487).
+-define(wxGrid_MoveCursorDown, 488).
+-define(wxGrid_MoveCursorLeft, 489).
+-define(wxGrid_MoveCursorRight, 490).
+-define(wxGrid_MoveCursorUp, 491).
+-define(wxGrid_MoveCursorDownBlock, 492).
+-define(wxGrid_MoveCursorLeftBlock, 493).
+-define(wxGrid_MoveCursorRightBlock, 494).
+-define(wxGrid_MoveCursorUpBlock, 495).
+-define(wxGrid_MovePageDown, 496).
+-define(wxGrid_MovePageUp, 497).
+-define(wxGrid_RegisterDataType, 498).
+-define(wxGrid_SaveEditControlValue, 499).
+-define(wxGrid_SelectAll, 500).
+-define(wxGrid_SelectBlock_5, 501).
+-define(wxGrid_SelectBlock_3, 502).
+-define(wxGrid_SelectCol, 503).
+-define(wxGrid_SelectRow, 504).
+-define(wxGrid_SetCellAlignment_4, 505).
+-define(wxGrid_SetCellAlignment_3, 506).
+-define(wxGrid_SetCellAlignment_1, 507).
+-define(wxGrid_SetCellBackgroundColour_3_0, 508).
+-define(wxGrid_SetCellBackgroundColour_1, 509).
+-define(wxGrid_SetCellBackgroundColour_3_1, 510).
+-define(wxGrid_SetCellEditor, 511).
+-define(wxGrid_SetCellFont, 512).
+-define(wxGrid_SetCellRenderer, 513).
+-define(wxGrid_SetCellTextColour_3_0, 514).
+-define(wxGrid_SetCellTextColour_3_1, 515).
+-define(wxGrid_SetCellTextColour_1, 516).
+-define(wxGrid_SetCellValue_3_0, 517).
+-define(wxGrid_SetCellValue_2, 518).
+-define(wxGrid_SetCellValue_3_1, 519).
+-define(wxGrid_SetColAttr, 520).
+-define(wxGrid_SetColFormatBool, 521).
+-define(wxGrid_SetColFormatNumber, 522).
+-define(wxGrid_SetColFormatFloat, 523).
+-define(wxGrid_SetColFormatCustom, 524).
+-define(wxGrid_SetColLabelAlignment, 525).
+-define(wxGrid_SetColLabelSize, 526).
+-define(wxGrid_SetColLabelValue, 527).
+-define(wxGrid_SetColMinimalWidth, 528).
+-define(wxGrid_SetColMinimalAcceptableWidth, 529).
+-define(wxGrid_SetColSize, 530).
+-define(wxGrid_SetDefaultCellAlignment, 531).
+-define(wxGrid_SetDefaultCellBackgroundColour, 532).
+-define(wxGrid_SetDefaultCellFont, 533).
+-define(wxGrid_SetDefaultCellTextColour, 534).
+-define(wxGrid_SetDefaultEditor, 535).
+-define(wxGrid_SetDefaultRenderer, 536).
+-define(wxGrid_SetDefaultColSize, 537).
+-define(wxGrid_SetDefaultRowSize, 538).
+-define(wxGrid_SetGridCursor, 539).
+-define(wxGrid_SetGridLineColour, 540).
+-define(wxGrid_SetLabelBackgroundColour, 541).
+-define(wxGrid_SetLabelFont, 542).
+-define(wxGrid_SetLabelTextColour, 543).
+-define(wxGrid_SetMargins, 544).
+-define(wxGrid_SetReadOnly, 545).
+-define(wxGrid_SetRowAttr, 546).
+-define(wxGrid_SetRowLabelAlignment, 547).
+-define(wxGrid_SetRowLabelSize, 548).
+-define(wxGrid_SetRowLabelValue, 549).
+-define(wxGrid_SetRowMinimalHeight, 550).
+-define(wxGrid_SetRowMinimalAcceptableHeight, 551).
+-define(wxGrid_SetRowSize, 552).
+-define(wxGrid_SetScrollLineX, 553).
+-define(wxGrid_SetScrollLineY, 554).
+-define(wxGrid_SetSelectionBackground, 555).
+-define(wxGrid_SetSelectionForeground, 556).
+-define(wxGrid_SetSelectionMode, 557).
+-define(wxGrid_ShowCellEditControl, 558).
+-define(wxGrid_XToCol, 559).
+-define(wxGrid_XToEdgeOfCol, 560).
+-define(wxGrid_YToEdgeOfRow, 561).
+-define(wxGrid_YToRow, 562).
+-define(wxGridCellRenderer_Draw, 563).
+-define(wxGridCellRenderer_GetBestSize, 564).
+-define(wxGridCellEditor_Create, 565).
+-define(wxGridCellEditor_IsCreated, 566).
+-define(wxGridCellEditor_SetSize, 567).
+-define(wxGridCellEditor_Show, 568).
+-define(wxGridCellEditor_PaintBackground, 569).
+-define(wxGridCellEditor_BeginEdit, 570).
+-define(wxGridCellEditor_EndEdit, 571).
+-define(wxGridCellEditor_Reset, 572).
+-define(wxGridCellEditor_StartingKey, 573).
+-define(wxGridCellEditor_StartingClick, 574).
+-define(wxGridCellEditor_HandleReturn, 575).
+-define(wxGridCellBoolRenderer_new, 576).
+-define(wxGridCellBoolRenderer_destroy, 577).
+-define(wxGridCellBoolEditor_new, 578).
+-define(wxGridCellBoolEditor_IsTrueValue, 579).
+-define(wxGridCellBoolEditor_UseStringValues, 580).
+-define(wxGridCellBoolEditor_destroy, 581).
+-define(wxGridCellFloatRenderer_new, 582).
+-define(wxGridCellFloatRenderer_GetPrecision, 583).
+-define(wxGridCellFloatRenderer_GetWidth, 584).
+-define(wxGridCellFloatRenderer_SetParameters, 585).
+-define(wxGridCellFloatRenderer_SetPrecision, 586).
+-define(wxGridCellFloatRenderer_SetWidth, 587).
+-define(wxGridCellFloatRenderer_destroy, 588).
+-define(wxGridCellFloatEditor_new, 589).
+-define(wxGridCellFloatEditor_SetParameters, 590).
+-define(wxGridCellFloatEditor_destroy, 591).
+-define(wxGridCellStringRenderer_new, 592).
+-define(wxGridCellStringRenderer_destroy, 593).
+-define(wxGridCellTextEditor_new, 594).
+-define(wxGridCellTextEditor_SetParameters, 595).
+-define(wxGridCellTextEditor_destroy, 596).
+-define(wxGridCellChoiceEditor_new, 598).
+-define(wxGridCellChoiceEditor_SetParameters, 599).
+-define(wxGridCellChoiceEditor_destroy, 600).
+-define(wxGridCellNumberRenderer_new, 601).
+-define(wxGridCellNumberRenderer_destroy, 602).
+-define(wxGridCellNumberEditor_new, 603).
+-define(wxGridCellNumberEditor_GetValue, 604).
+-define(wxGridCellNumberEditor_SetParameters, 605).
+-define(wxGridCellNumberEditor_destroy, 606).
+-define(wxGridCellAttr_SetTextColour, 607).
+-define(wxGridCellAttr_SetBackgroundColour, 608).
+-define(wxGridCellAttr_SetFont, 609).
+-define(wxGridCellAttr_SetAlignment, 610).
+-define(wxGridCellAttr_SetReadOnly, 611).
+-define(wxGridCellAttr_SetRenderer, 612).
+-define(wxGridCellAttr_SetEditor, 613).
+-define(wxGridCellAttr_HasTextColour, 614).
+-define(wxGridCellAttr_HasBackgroundColour, 615).
+-define(wxGridCellAttr_HasFont, 616).
+-define(wxGridCellAttr_HasAlignment, 617).
+-define(wxGridCellAttr_HasRenderer, 618).
+-define(wxGridCellAttr_HasEditor, 619).
+-define(wxGridCellAttr_GetTextColour, 620).
+-define(wxGridCellAttr_GetBackgroundColour, 621).
+-define(wxGridCellAttr_GetFont, 622).
+-define(wxGridCellAttr_GetAlignment, 623).
+-define(wxGridCellAttr_GetRenderer, 624).
+-define(wxGridCellAttr_GetEditor, 625).
+-define(wxGridCellAttr_IsReadOnly, 626).
+-define(wxGridCellAttr_SetDefAttr, 627).
+-define(wxDC_Blit, 628).
+-define(wxDC_CalcBoundingBox, 629).
+-define(wxDC_Clear, 630).
+-define(wxDC_ComputeScaleAndOrigin, 631).
+-define(wxDC_CrossHair, 632).
+-define(wxDC_DestroyClippingRegion, 633).
+-define(wxDC_DeviceToLogicalX, 634).
+-define(wxDC_DeviceToLogicalXRel, 635).
+-define(wxDC_DeviceToLogicalY, 636).
+-define(wxDC_DeviceToLogicalYRel, 637).
+-define(wxDC_DrawArc, 638).
+-define(wxDC_DrawBitmap, 639).
+-define(wxDC_DrawCheckMark, 640).
+-define(wxDC_DrawCircle, 641).
+-define(wxDC_DrawEllipse_2, 643).
+-define(wxDC_DrawEllipse_1, 644).
+-define(wxDC_DrawEllipticArc, 645).
+-define(wxDC_DrawIcon, 646).
+-define(wxDC_DrawLabel, 647).
+-define(wxDC_DrawLine, 648).
+-define(wxDC_DrawLines, 649).
+-define(wxDC_DrawPolygon, 651).
+-define(wxDC_DrawPoint, 653).
+-define(wxDC_DrawRectangle_2, 655).
+-define(wxDC_DrawRectangle_1, 656).
+-define(wxDC_DrawRotatedText, 657).
+-define(wxDC_DrawRoundedRectangle_3, 659).
+-define(wxDC_DrawRoundedRectangle_2, 660).
+-define(wxDC_DrawText, 661).
+-define(wxDC_EndDoc, 662).
+-define(wxDC_EndPage, 663).
+-define(wxDC_FloodFill, 664).
+-define(wxDC_GetBackground, 665).
+-define(wxDC_GetBackgroundMode, 666).
+-define(wxDC_GetBrush, 667).
+-define(wxDC_GetCharHeight, 668).
+-define(wxDC_GetCharWidth, 669).
+-define(wxDC_GetClippingBox, 670).
+-define(wxDC_GetFont, 672).
+-define(wxDC_GetLayoutDirection, 673).
+-define(wxDC_GetLogicalFunction, 674).
+-define(wxDC_GetMapMode, 675).
+-define(wxDC_GetMultiLineTextExtent_4, 676).
+-define(wxDC_GetMultiLineTextExtent_1, 677).
+-define(wxDC_GetPartialTextExtents, 678).
+-define(wxDC_GetPen, 679).
+-define(wxDC_GetPixel, 680).
+-define(wxDC_GetPPI, 681).
+-define(wxDC_GetSize, 683).
+-define(wxDC_GetSizeMM, 685).
+-define(wxDC_GetTextBackground, 686).
+-define(wxDC_GetTextExtent_4, 687).
+-define(wxDC_GetTextExtent_1, 688).
+-define(wxDC_GetTextForeground, 690).
+-define(wxDC_GetUserScale, 691).
+-define(wxDC_GradientFillConcentric_3, 692).
+-define(wxDC_GradientFillConcentric_4, 693).
+-define(wxDC_GradientFillLinear, 694).
+-define(wxDC_LogicalToDeviceX, 695).
+-define(wxDC_LogicalToDeviceXRel, 696).
+-define(wxDC_LogicalToDeviceY, 697).
+-define(wxDC_LogicalToDeviceYRel, 698).
+-define(wxDC_MaxX, 699).
+-define(wxDC_MaxY, 700).
+-define(wxDC_MinX, 701).
+-define(wxDC_MinY, 702).
+-define(wxDC_IsOk, 703).
+-define(wxDC_ResetBoundingBox, 704).
+-define(wxDC_SetAxisOrientation, 705).
+-define(wxDC_SetBackground, 706).
+-define(wxDC_SetBackgroundMode, 707).
+-define(wxDC_SetBrush, 708).
+-define(wxDC_SetClippingRegion_2, 710).
+-define(wxDC_SetClippingRegion_1_1, 711).
+-define(wxDC_SetClippingRegion_1_0, 712).
+-define(wxDC_SetDeviceOrigin, 713).
+-define(wxDC_SetFont, 714).
+-define(wxDC_SetLayoutDirection, 715).
+-define(wxDC_SetLogicalFunction, 716).
+-define(wxDC_SetMapMode, 717).
+-define(wxDC_SetPalette, 718).
+-define(wxDC_SetPen, 719).
+-define(wxDC_SetTextBackground, 720).
+-define(wxDC_SetTextForeground, 721).
+-define(wxDC_SetUserScale, 722).
+-define(wxDC_StartDoc, 723).
+-define(wxDC_StartPage, 724).
+-define(wxMirrorDC_new, 725).
+-define(wxMirrorDC_destroy, 726).
+-define(wxScreenDC_new, 727).
+-define(wxScreenDC_destruct, 728).
+-define(wxPostScriptDC_new_0, 729).
+-define(wxPostScriptDC_new_1, 730).
+-define(wxPostScriptDC_destruct, 731).
+-define(wxPostScriptDC_SetResolution, 732).
+-define(wxPostScriptDC_GetResolution, 733).
+-define(wxWindowDC_new_0, 734).
+-define(wxWindowDC_new_1, 735).
+-define(wxWindowDC_destruct, 736).
+-define(wxClientDC_new_0, 737).
+-define(wxClientDC_new_1, 738).
+-define(wxClientDC_destroy, 739).
+-define(wxPaintDC_new_0, 740).
+-define(wxPaintDC_new_1, 741).
+-define(wxPaintDC_destroy, 742).
+-define(wxMemoryDC_new_1_0, 744).
+-define(wxMemoryDC_new_1_1, 745).
+-define(wxMemoryDC_new_0, 746).
+-define(wxMemoryDC_destruct, 748).
+-define(wxMemoryDC_SelectObject, 749).
+-define(wxMemoryDC_SelectObjectAsSource, 750).
+-define(wxBufferedDC_new_0, 751).
+-define(wxBufferedDC_new_2, 752).
+-define(wxBufferedDC_new_3, 753).
+-define(wxBufferedDC_destruct, 754).
+-define(wxBufferedDC_Init_2, 755).
+-define(wxBufferedDC_Init_3, 756).
+-define(wxBufferedPaintDC_new_3, 757).
+-define(wxBufferedPaintDC_new_2, 758).
+-define(wxBufferedPaintDC_destruct, 759).
+-define(wxGraphicsObject_destruct, 760).
+-define(wxGraphicsObject_GetRenderer, 761).
+-define(wxGraphicsObject_IsNull, 762).
+-define(wxGraphicsContext_destruct, 763).
+-define(wxGraphicsContext_Create_1_1, 764).
+-define(wxGraphicsContext_Create_1_0, 765).
+-define(wxGraphicsContext_Create_0, 766).
+-define(wxGraphicsContext_CreatePen, 767).
+-define(wxGraphicsContext_CreateBrush, 768).
+-define(wxGraphicsContext_CreateRadialGradientBrush, 769).
+-define(wxGraphicsContext_CreateLinearGradientBrush, 770).
+-define(wxGraphicsContext_CreateFont, 771).
+-define(wxGraphicsContext_CreateMatrix, 772).
+-define(wxGraphicsContext_CreatePath, 773).
+-define(wxGraphicsContext_Clip_1, 774).
+-define(wxGraphicsContext_Clip_4, 775).
+-define(wxGraphicsContext_ResetClip, 776).
+-define(wxGraphicsContext_DrawBitmap, 777).
+-define(wxGraphicsContext_DrawEllipse, 778).
+-define(wxGraphicsContext_DrawIcon, 779).
+-define(wxGraphicsContext_DrawLines, 780).
+-define(wxGraphicsContext_DrawPath, 781).
+-define(wxGraphicsContext_DrawRectangle, 782).
+-define(wxGraphicsContext_DrawRoundedRectangle, 783).
+-define(wxGraphicsContext_DrawText_3, 784).
+-define(wxGraphicsContext_DrawText_4_0, 785).
+-define(wxGraphicsContext_DrawText_4_1, 786).
+-define(wxGraphicsContext_DrawText_5, 787).
+-define(wxGraphicsContext_FillPath, 788).
+-define(wxGraphicsContext_StrokePath, 789).
+-define(wxGraphicsContext_GetPartialTextExtents, 790).
+-define(wxGraphicsContext_GetTextExtent, 791).
+-define(wxGraphicsContext_Rotate, 792).
+-define(wxGraphicsContext_Scale, 793).
+-define(wxGraphicsContext_Translate, 794).
+-define(wxGraphicsContext_GetTransform, 795).
+-define(wxGraphicsContext_SetTransform, 796).
+-define(wxGraphicsContext_ConcatTransform, 797).
+-define(wxGraphicsContext_SetBrush_1_1, 798).
+-define(wxGraphicsContext_SetBrush_1_0, 799).
+-define(wxGraphicsContext_SetFont_1, 800).
+-define(wxGraphicsContext_SetFont_2, 801).
+-define(wxGraphicsContext_SetPen_1_0, 802).
+-define(wxGraphicsContext_SetPen_1_1, 803).
+-define(wxGraphicsContext_StrokeLine, 804).
+-define(wxGraphicsContext_StrokeLines, 805).
+-define(wxGraphicsMatrix_Concat, 807).
+-define(wxGraphicsMatrix_Get, 809).
+-define(wxGraphicsMatrix_Invert, 810).
+-define(wxGraphicsMatrix_IsEqual, 811).
+-define(wxGraphicsMatrix_IsIdentity, 813).
+-define(wxGraphicsMatrix_Rotate, 814).
+-define(wxGraphicsMatrix_Scale, 815).
+-define(wxGraphicsMatrix_Translate, 816).
+-define(wxGraphicsMatrix_Set, 817).
+-define(wxGraphicsMatrix_TransformPoint, 818).
+-define(wxGraphicsMatrix_TransformDistance, 819).
+-define(wxGraphicsPath_MoveToPoint_2, 820).
+-define(wxGraphicsPath_MoveToPoint_1, 821).
+-define(wxGraphicsPath_AddArc_6, 822).
+-define(wxGraphicsPath_AddArc_5, 823).
+-define(wxGraphicsPath_AddArcToPoint, 824).
+-define(wxGraphicsPath_AddCircle, 825).
+-define(wxGraphicsPath_AddCurveToPoint_6, 826).
+-define(wxGraphicsPath_AddCurveToPoint_3, 827).
+-define(wxGraphicsPath_AddEllipse, 828).
+-define(wxGraphicsPath_AddLineToPoint_2, 829).
+-define(wxGraphicsPath_AddLineToPoint_1, 830).
+-define(wxGraphicsPath_AddPath, 831).
+-define(wxGraphicsPath_AddQuadCurveToPoint, 832).
+-define(wxGraphicsPath_AddRectangle, 833).
+-define(wxGraphicsPath_AddRoundedRectangle, 834).
+-define(wxGraphicsPath_CloseSubpath, 835).
+-define(wxGraphicsPath_Contains_3, 836).
+-define(wxGraphicsPath_Contains_2, 837).
+-define(wxGraphicsPath_GetBox, 839).
+-define(wxGraphicsPath_GetCurrentPoint, 841).
+-define(wxGraphicsPath_Transform, 842).
+-define(wxGraphicsRenderer_GetDefaultRenderer, 843).
+-define(wxGraphicsRenderer_CreateContext_1_1, 844).
+-define(wxGraphicsRenderer_CreateContext_1_0, 845).
+-define(wxGraphicsRenderer_CreatePen, 846).
+-define(wxGraphicsRenderer_CreateBrush, 847).
+-define(wxGraphicsRenderer_CreateLinearGradientBrush, 848).
+-define(wxGraphicsRenderer_CreateRadialGradientBrush, 849).
+-define(wxGraphicsRenderer_CreateFont, 850).
+-define(wxGraphicsRenderer_CreateMatrix, 851).
+-define(wxGraphicsRenderer_CreatePath, 852).
+-define(wxMenuBar_new_1, 854).
+-define(wxMenuBar_new_0, 856).
+-define(wxMenuBar_destruct, 858).
+-define(wxMenuBar_Append, 859).
+-define(wxMenuBar_Check, 860).
+-define(wxMenuBar_Enable_2, 861).
+-define(wxMenuBar_Enable_1, 862).
+-define(wxMenuBar_EnableTop, 863).
+-define(wxMenuBar_FindMenu, 864).
+-define(wxMenuBar_FindMenuItem, 865).
+-define(wxMenuBar_FindItem, 866).
+-define(wxMenuBar_GetHelpString, 867).
+-define(wxMenuBar_GetLabel_1, 868).
+-define(wxMenuBar_GetLabel_0, 869).
+-define(wxMenuBar_GetLabelTop, 870).
+-define(wxMenuBar_GetMenu, 871).
+-define(wxMenuBar_GetMenuCount, 872).
+-define(wxMenuBar_Insert, 873).
+-define(wxMenuBar_IsChecked, 874).
+-define(wxMenuBar_IsEnabled_1, 875).
+-define(wxMenuBar_IsEnabled_0, 876).
+-define(wxMenuBar_Remove, 877).
+-define(wxMenuBar_Replace, 878).
+-define(wxMenuBar_SetHelpString, 879).
+-define(wxMenuBar_SetLabel_2, 880).
+-define(wxMenuBar_SetLabel_1, 881).
+-define(wxMenuBar_SetLabelTop, 882).
+-define(wxControl_GetLabel, 883).
+-define(wxControl_SetLabel, 884).
+-define(wxControlWithItems_Append_1, 885).
+-define(wxControlWithItems_Append_2, 886).
+-define(wxControlWithItems_appendStrings_1, 887).
+-define(wxControlWithItems_Clear, 888).
+-define(wxControlWithItems_Delete, 889).
+-define(wxControlWithItems_FindString, 890).
+-define(wxControlWithItems_getClientData, 891).
+-define(wxControlWithItems_setClientData, 892).
+-define(wxControlWithItems_GetCount, 893).
+-define(wxControlWithItems_GetSelection, 894).
+-define(wxControlWithItems_GetString, 895).
+-define(wxControlWithItems_GetStringSelection, 896).
+-define(wxControlWithItems_Insert_2, 897).
+-define(wxControlWithItems_Insert_3, 898).
+-define(wxControlWithItems_IsEmpty, 899).
+-define(wxControlWithItems_Select, 900).
+-define(wxControlWithItems_SetSelection, 901).
+-define(wxControlWithItems_SetString, 902).
+-define(wxControlWithItems_SetStringSelection, 903).
+-define(wxMenu_new_2, 906).
+-define(wxMenu_new_1, 907).
+-define(wxMenu_destruct, 909).
+-define(wxMenu_Append_3, 910).
+-define(wxMenu_Append_1, 911).
+-define(wxMenu_Append_4_0, 912).
+-define(wxMenu_Append_4_1, 913).
+-define(wxMenu_AppendCheckItem, 914).
+-define(wxMenu_AppendRadioItem, 915).
+-define(wxMenu_AppendSeparator, 916).
+-define(wxMenu_Break, 917).
+-define(wxMenu_Check, 918).
+-define(wxMenu_Delete_1_0, 919).
+-define(wxMenu_Delete_1_1, 920).
+-define(wxMenu_Destroy_1_0, 921).
+-define(wxMenu_Destroy_1_1, 922).
+-define(wxMenu_Enable, 923).
+-define(wxMenu_FindItem_1, 924).
+-define(wxMenu_FindItem_2, 925).
+-define(wxMenu_FindItemByPosition, 926).
+-define(wxMenu_GetHelpString, 927).
+-define(wxMenu_GetLabel, 928).
+-define(wxMenu_GetMenuItemCount, 929).
+-define(wxMenu_GetMenuItems, 930).
+-define(wxMenu_GetTitle, 932).
+-define(wxMenu_Insert_2, 933).
+-define(wxMenu_Insert_3, 934).
+-define(wxMenu_Insert_5_1, 935).
+-define(wxMenu_Insert_5_0, 936).
+-define(wxMenu_InsertCheckItem, 937).
+-define(wxMenu_InsertRadioItem, 938).
+-define(wxMenu_InsertSeparator, 939).
+-define(wxMenu_IsChecked, 940).
+-define(wxMenu_IsEnabled, 941).
+-define(wxMenu_Prepend_1, 942).
+-define(wxMenu_Prepend_2, 943).
+-define(wxMenu_Prepend_4_1, 944).
+-define(wxMenu_Prepend_4_0, 945).
+-define(wxMenu_PrependCheckItem, 946).
+-define(wxMenu_PrependRadioItem, 947).
+-define(wxMenu_PrependSeparator, 948).
+-define(wxMenu_Remove_1_0, 949).
+-define(wxMenu_Remove_1_1, 950).
+-define(wxMenu_SetHelpString, 951).
+-define(wxMenu_SetLabel, 952).
+-define(wxMenu_SetTitle, 953).
+-define(wxMenuItem_new, 954).
+-define(wxMenuItem_destruct, 956).
+-define(wxMenuItem_Check, 957).
+-define(wxMenuItem_Enable, 958).
+-define(wxMenuItem_GetBitmap, 959).
+-define(wxMenuItem_GetHelp, 960).
+-define(wxMenuItem_GetId, 961).
+-define(wxMenuItem_GetKind, 962).
+-define(wxMenuItem_GetLabel, 963).
+-define(wxMenuItem_GetLabelFromText, 964).
+-define(wxMenuItem_GetMenu, 965).
+-define(wxMenuItem_GetText, 966).
+-define(wxMenuItem_GetSubMenu, 967).
+-define(wxMenuItem_IsCheckable, 968).
+-define(wxMenuItem_IsChecked, 969).
+-define(wxMenuItem_IsEnabled, 970).
+-define(wxMenuItem_IsSeparator, 971).
+-define(wxMenuItem_IsSubMenu, 972).
+-define(wxMenuItem_SetBitmap, 973).
+-define(wxMenuItem_SetHelp, 974).
+-define(wxMenuItem_SetMenu, 975).
+-define(wxMenuItem_SetSubMenu, 976).
+-define(wxMenuItem_SetText, 977).
+-define(wxToolBar_AddControl, 978).
+-define(wxToolBar_AddSeparator, 979).
+-define(wxToolBar_AddTool_5, 980).
+-define(wxToolBar_AddTool_4_0, 981).
+-define(wxToolBar_AddTool_1, 982).
+-define(wxToolBar_AddTool_4_1, 983).
+-define(wxToolBar_AddTool_3, 984).
+-define(wxToolBar_AddTool_6, 985).
+-define(wxToolBar_AddCheckTool, 986).
+-define(wxToolBar_AddRadioTool, 987).
+-define(wxToolBar_AddStretchableSpace, 988).
+-define(wxToolBar_InsertStretchableSpace, 989).
+-define(wxToolBar_DeleteTool, 990).
+-define(wxToolBar_DeleteToolByPos, 991).
+-define(wxToolBar_EnableTool, 992).
+-define(wxToolBar_FindById, 993).
+-define(wxToolBar_FindControl, 994).
+-define(wxToolBar_FindToolForPosition, 995).
+-define(wxToolBar_GetToolSize, 996).
+-define(wxToolBar_GetToolBitmapSize, 997).
+-define(wxToolBar_GetMargins, 998).
+-define(wxToolBar_GetToolEnabled, 999).
+-define(wxToolBar_GetToolLongHelp, 1000).
+-define(wxToolBar_GetToolPacking, 1001).
+-define(wxToolBar_GetToolPos, 1002).
+-define(wxToolBar_GetToolSeparation, 1003).
+-define(wxToolBar_GetToolShortHelp, 1004).
+-define(wxToolBar_GetToolState, 1005).
+-define(wxToolBar_InsertControl, 1006).
+-define(wxToolBar_InsertSeparator, 1007).
+-define(wxToolBar_InsertTool_5, 1008).
+-define(wxToolBar_InsertTool_2, 1009).
+-define(wxToolBar_InsertTool_4, 1010).
+-define(wxToolBar_Realize, 1011).
+-define(wxToolBar_RemoveTool, 1012).
+-define(wxToolBar_SetMargins, 1013).
+-define(wxToolBar_SetToolBitmapSize, 1014).
+-define(wxToolBar_SetToolLongHelp, 1015).
+-define(wxToolBar_SetToolPacking, 1016).
+-define(wxToolBar_SetToolShortHelp, 1017).
+-define(wxToolBar_SetToolSeparation, 1018).
+-define(wxToolBar_ToggleTool, 1019).
+-define(wxStatusBar_new_0, 1021).
+-define(wxStatusBar_new_2, 1022).
+-define(wxStatusBar_destruct, 1024).
+-define(wxStatusBar_Create, 1025).
+-define(wxStatusBar_GetFieldRect, 1026).
+-define(wxStatusBar_GetFieldsCount, 1027).
+-define(wxStatusBar_GetStatusText, 1028).
+-define(wxStatusBar_PopStatusText, 1029).
+-define(wxStatusBar_PushStatusText, 1030).
+-define(wxStatusBar_SetFieldsCount, 1031).
+-define(wxStatusBar_SetMinHeight, 1032).
+-define(wxStatusBar_SetStatusText, 1033).
+-define(wxStatusBar_SetStatusWidths, 1034).
+-define(wxStatusBar_SetStatusStyles, 1035).
+-define(wxBitmap_new_0, 1036).
+-define(wxBitmap_new_3, 1037).
+-define(wxBitmap_new_4, 1038).
+-define(wxBitmap_new_2_0, 1039).
+-define(wxBitmap_new_2_1, 1040).
+-define(wxBitmap_destruct, 1041).
+-define(wxBitmap_ConvertToImage, 1042).
+-define(wxBitmap_CopyFromIcon, 1043).
+-define(wxBitmap_Create, 1044).
+-define(wxBitmap_GetDepth, 1045).
+-define(wxBitmap_GetHeight, 1046).
+-define(wxBitmap_GetPalette, 1047).
+-define(wxBitmap_GetMask, 1048).
+-define(wxBitmap_GetWidth, 1049).
+-define(wxBitmap_GetSubBitmap, 1050).
+-define(wxBitmap_LoadFile, 1051).
+-define(wxBitmap_Ok, 1052).
+-define(wxBitmap_SaveFile, 1053).
+-define(wxBitmap_SetDepth, 1054).
+-define(wxBitmap_SetHeight, 1055).
+-define(wxBitmap_SetMask, 1056).
+-define(wxBitmap_SetPalette, 1057).
+-define(wxBitmap_SetWidth, 1058).
+-define(wxIcon_new_0, 1059).
+-define(wxIcon_new_2, 1060).
+-define(wxIcon_new_1, 1061).
+-define(wxIcon_CopyFromBitmap, 1062).
+-define(wxIcon_destroy, 1063).
+-define(wxIconBundle_new_0, 1064).
+-define(wxIconBundle_new_2, 1065).
+-define(wxIconBundle_new_1_0, 1066).
+-define(wxIconBundle_new_1_1, 1067).
+-define(wxIconBundle_destruct, 1068).
+-define(wxIconBundle_AddIcon_2, 1069).
+-define(wxIconBundle_AddIcon_1, 1070).
+-define(wxIconBundle_GetIcon_1_1, 1071).
+-define(wxIconBundle_GetIcon_1_0, 1072).
+-define(wxCursor_new_0, 1073).
+-define(wxCursor_new_1_0, 1074).
+-define(wxCursor_new_1_1, 1075).
+-define(wxCursor_new_4, 1076).
+-define(wxCursor_destruct, 1077).
+-define(wxCursor_Ok, 1078).
+-define(wxMask_new_0, 1079).
+-define(wxMask_new_2_1, 1080).
+-define(wxMask_new_2_0, 1081).
+-define(wxMask_new_1, 1082).
+-define(wxMask_destruct, 1083).
+-define(wxMask_Create_2_1, 1084).
+-define(wxMask_Create_2_0, 1085).
+-define(wxMask_Create_1, 1086).
+-define(wxImage_new_0, 1087).
+-define(wxImage_new_3_0, 1088).
+-define(wxImage_new_4, 1089).
+-define(wxImage_new_5, 1090).
+-define(wxImage_new_2, 1091).
+-define(wxImage_new_3_1, 1092).
+-define(wxImage_Blur, 1093).
+-define(wxImage_BlurHorizontal, 1094).
+-define(wxImage_BlurVertical, 1095).
+-define(wxImage_ConvertAlphaToMask, 1096).
+-define(wxImage_ConvertToGreyscale, 1097).
+-define(wxImage_ConvertToMono, 1098).
+-define(wxImage_Copy, 1099).
+-define(wxImage_Create_3, 1100).
+-define(wxImage_Create_4, 1101).
+-define(wxImage_Create_5, 1102).
+-define(wxImage_Destroy, 1103).
+-define(wxImage_FindFirstUnusedColour, 1104).
+-define(wxImage_GetImageExtWildcard, 1105).
+-define(wxImage_GetAlpha_2, 1106).
+-define(wxImage_GetAlpha_0, 1107).
+-define(wxImage_GetBlue, 1108).
+-define(wxImage_GetData, 1109).
+-define(wxImage_GetGreen, 1110).
+-define(wxImage_GetImageCount, 1111).
+-define(wxImage_GetHeight, 1112).
+-define(wxImage_GetMaskBlue, 1113).
+-define(wxImage_GetMaskGreen, 1114).
+-define(wxImage_GetMaskRed, 1115).
+-define(wxImage_GetOrFindMaskColour, 1116).
+-define(wxImage_GetPalette, 1117).
+-define(wxImage_GetRed, 1118).
+-define(wxImage_GetSubImage, 1119).
+-define(wxImage_GetWidth, 1120).
+-define(wxImage_HasAlpha, 1121).
+-define(wxImage_HasMask, 1122).
+-define(wxImage_GetOption, 1123).
+-define(wxImage_GetOptionInt, 1124).
+-define(wxImage_HasOption, 1125).
+-define(wxImage_InitAlpha, 1126).
+-define(wxImage_InitStandardHandlers, 1127).
+-define(wxImage_IsTransparent, 1128).
+-define(wxImage_LoadFile_2, 1129).
+-define(wxImage_LoadFile_3, 1130).
+-define(wxImage_Ok, 1131).
+-define(wxImage_RemoveHandler, 1132).
+-define(wxImage_Mirror, 1133).
+-define(wxImage_Replace, 1134).
+-define(wxImage_Rescale, 1135).
+-define(wxImage_Resize, 1136).
+-define(wxImage_Rotate, 1137).
+-define(wxImage_RotateHue, 1138).
+-define(wxImage_Rotate90, 1139).
+-define(wxImage_SaveFile_1, 1140).
+-define(wxImage_SaveFile_2_0, 1141).
+-define(wxImage_SaveFile_2_1, 1142).
+-define(wxImage_Scale, 1143).
+-define(wxImage_Size, 1144).
+-define(wxImage_SetAlpha_3, 1145).
+-define(wxImage_SetAlpha_2, 1146).
+-define(wxImage_SetData_2, 1147).
+-define(wxImage_SetData_4, 1148).
+-define(wxImage_SetMask, 1149).
+-define(wxImage_SetMaskColour, 1150).
+-define(wxImage_SetMaskFromImage, 1151).
+-define(wxImage_SetOption_2_1, 1152).
+-define(wxImage_SetOption_2_0, 1153).
+-define(wxImage_SetPalette, 1154).
+-define(wxImage_SetRGB_5, 1155).
+-define(wxImage_SetRGB_4, 1156).
+-define(wxImage_destroy, 1157).
+-define(wxBrush_new_0, 1158).
+-define(wxBrush_new_2, 1159).
+-define(wxBrush_new_1, 1160).
+-define(wxBrush_destruct, 1162).
+-define(wxBrush_GetColour, 1163).
+-define(wxBrush_GetStipple, 1164).
+-define(wxBrush_GetStyle, 1165).
+-define(wxBrush_IsHatch, 1166).
+-define(wxBrush_IsOk, 1167).
+-define(wxBrush_SetColour_1, 1168).
+-define(wxBrush_SetColour_3, 1169).
+-define(wxBrush_SetStipple, 1170).
+-define(wxBrush_SetStyle, 1171).
+-define(wxPen_new_0, 1172).
+-define(wxPen_new_2, 1173).
+-define(wxPen_destruct, 1174).
+-define(wxPen_GetCap, 1175).
+-define(wxPen_GetColour, 1176).
+-define(wxPen_GetJoin, 1177).
+-define(wxPen_GetStyle, 1178).
+-define(wxPen_GetWidth, 1179).
+-define(wxPen_IsOk, 1180).
+-define(wxPen_SetCap, 1181).
+-define(wxPen_SetColour_1, 1182).
+-define(wxPen_SetColour_3, 1183).
+-define(wxPen_SetJoin, 1184).
+-define(wxPen_SetStyle, 1185).
+-define(wxPen_SetWidth, 1186).
+-define(wxRegion_new_0, 1187).
+-define(wxRegion_new_4, 1188).
+-define(wxRegion_new_2, 1189).
+-define(wxRegion_new_1_1, 1190).
+-define(wxRegion_new_1_0, 1192).
+-define(wxRegion_destruct, 1194).
+-define(wxRegion_Clear, 1195).
+-define(wxRegion_Contains_2, 1196).
+-define(wxRegion_Contains_1_0, 1197).
+-define(wxRegion_Contains_4, 1198).
+-define(wxRegion_Contains_1_1, 1199).
+-define(wxRegion_ConvertToBitmap, 1200).
+-define(wxRegion_GetBox, 1201).
+-define(wxRegion_Intersect_4, 1202).
+-define(wxRegion_Intersect_1_1, 1203).
+-define(wxRegion_Intersect_1_0, 1204).
+-define(wxRegion_IsEmpty, 1205).
+-define(wxRegion_Subtract_4, 1206).
+-define(wxRegion_Subtract_1_1, 1207).
+-define(wxRegion_Subtract_1_0, 1208).
+-define(wxRegion_Offset_2, 1209).
+-define(wxRegion_Offset_1, 1210).
+-define(wxRegion_Union_4, 1211).
+-define(wxRegion_Union_1_2, 1212).
+-define(wxRegion_Union_1_1, 1213).
+-define(wxRegion_Union_1_0, 1214).
+-define(wxRegion_Union_3, 1215).
+-define(wxRegion_Xor_4, 1216).
+-define(wxRegion_Xor_1_1, 1217).
+-define(wxRegion_Xor_1_0, 1218).
+-define(wxAcceleratorTable_new_0, 1219).
+-define(wxAcceleratorTable_new_2, 1220).
+-define(wxAcceleratorTable_destruct, 1221).
+-define(wxAcceleratorTable_Ok, 1222).
+-define(wxAcceleratorEntry_new_1_0, 1223).
+-define(wxAcceleratorEntry_new_1_1, 1224).
+-define(wxAcceleratorEntry_GetCommand, 1225).
+-define(wxAcceleratorEntry_GetFlags, 1226).
+-define(wxAcceleratorEntry_GetKeyCode, 1227).
+-define(wxAcceleratorEntry_Set, 1228).
+-define(wxAcceleratorEntry_destroy, 1229).
+-define(wxCaret_new_3, 1234).
+-define(wxCaret_new_2, 1235).
+-define(wxCaret_destruct, 1237).
+-define(wxCaret_Create_3, 1238).
+-define(wxCaret_Create_2, 1239).
+-define(wxCaret_GetBlinkTime, 1240).
+-define(wxCaret_GetPosition, 1242).
+-define(wxCaret_GetSize, 1244).
+-define(wxCaret_GetWindow, 1245).
+-define(wxCaret_Hide, 1246).
+-define(wxCaret_IsOk, 1247).
+-define(wxCaret_IsVisible, 1248).
+-define(wxCaret_Move_2, 1249).
+-define(wxCaret_Move_1, 1250).
+-define(wxCaret_SetBlinkTime, 1251).
+-define(wxCaret_SetSize_2, 1252).
+-define(wxCaret_SetSize_1, 1253).
+-define(wxCaret_Show, 1254).
+-define(wxSizer_Add_2_1, 1255).
+-define(wxSizer_Add_2_0, 1256).
+-define(wxSizer_Add_3, 1257).
+-define(wxSizer_Add_2_3, 1258).
+-define(wxSizer_Add_2_2, 1259).
+-define(wxSizer_AddSpacer, 1260).
+-define(wxSizer_AddStretchSpacer, 1261).
+-define(wxSizer_CalcMin, 1262).
+-define(wxSizer_Clear, 1263).
+-define(wxSizer_Detach_1_2, 1264).
+-define(wxSizer_Detach_1_1, 1265).
+-define(wxSizer_Detach_1_0, 1266).
+-define(wxSizer_Fit, 1267).
+-define(wxSizer_FitInside, 1268).
+-define(wxSizer_GetChildren, 1269).
+-define(wxSizer_GetItem_2_1, 1270).
+-define(wxSizer_GetItem_2_0, 1271).
+-define(wxSizer_GetItem_1, 1272).
+-define(wxSizer_GetSize, 1273).
+-define(wxSizer_GetPosition, 1274).
+-define(wxSizer_GetMinSize, 1275).
+-define(wxSizer_Hide_2_0, 1276).
+-define(wxSizer_Hide_2_1, 1277).
+-define(wxSizer_Hide_1, 1278).
+-define(wxSizer_Insert_3_1, 1279).
+-define(wxSizer_Insert_3_0, 1280).
+-define(wxSizer_Insert_4, 1281).
+-define(wxSizer_Insert_3_3, 1282).
+-define(wxSizer_Insert_3_2, 1283).
+-define(wxSizer_Insert_2, 1284).
+-define(wxSizer_InsertSpacer, 1285).
+-define(wxSizer_InsertStretchSpacer, 1286).
+-define(wxSizer_IsShown_1_2, 1287).
+-define(wxSizer_IsShown_1_1, 1288).
+-define(wxSizer_IsShown_1_0, 1289).
+-define(wxSizer_Layout, 1290).
+-define(wxSizer_Prepend_2_1, 1291).
+-define(wxSizer_Prepend_2_0, 1292).
+-define(wxSizer_Prepend_3, 1293).
+-define(wxSizer_Prepend_2_3, 1294).
+-define(wxSizer_Prepend_2_2, 1295).
+-define(wxSizer_Prepend_1, 1296).
+-define(wxSizer_PrependSpacer, 1297).
+-define(wxSizer_PrependStretchSpacer, 1298).
+-define(wxSizer_RecalcSizes, 1299).
+-define(wxSizer_Remove_1_1, 1300).
+-define(wxSizer_Remove_1_0, 1301).
+-define(wxSizer_Replace_3_1, 1302).
+-define(wxSizer_Replace_3_0, 1303).
+-define(wxSizer_Replace_2, 1304).
+-define(wxSizer_SetDimension, 1305).
+-define(wxSizer_SetMinSize_2, 1306).
+-define(wxSizer_SetMinSize_1, 1307).
+-define(wxSizer_SetItemMinSize_3_2, 1308).
+-define(wxSizer_SetItemMinSize_2_2, 1309).
+-define(wxSizer_SetItemMinSize_3_1, 1310).
+-define(wxSizer_SetItemMinSize_2_1, 1311).
+-define(wxSizer_SetItemMinSize_3_0, 1312).
+-define(wxSizer_SetItemMinSize_2_0, 1313).
+-define(wxSizer_SetSizeHints, 1314).
+-define(wxSizer_SetVirtualSizeHints, 1315).
+-define(wxSizer_Show_2_2, 1316).
+-define(wxSizer_Show_2_1, 1317).
+-define(wxSizer_Show_2_0, 1318).
+-define(wxSizer_Show_1, 1319).
+-define(wxSizerFlags_new, 1320).
+-define(wxSizerFlags_Align, 1321).
+-define(wxSizerFlags_Border_2, 1322).
+-define(wxSizerFlags_Border_1, 1323).
+-define(wxSizerFlags_Center, 1324).
+-define(wxSizerFlags_Centre, 1325).
+-define(wxSizerFlags_Expand, 1326).
+-define(wxSizerFlags_Left, 1327).
+-define(wxSizerFlags_Proportion, 1328).
+-define(wxSizerFlags_Right, 1329).
+-define(wxSizerFlags_destroy, 1330).
+-define(wxSizerItem_new_5_1, 1331).
+-define(wxSizerItem_new_2_1, 1332).
+-define(wxSizerItem_new_5_0, 1333).
+-define(wxSizerItem_new_2_0, 1334).
+-define(wxSizerItem_new_6, 1335).
+-define(wxSizerItem_new_3, 1336).
+-define(wxSizerItem_new_0, 1337).
+-define(wxSizerItem_destruct, 1338).
+-define(wxSizerItem_CalcMin, 1339).
+-define(wxSizerItem_DeleteWindows, 1340).
+-define(wxSizerItem_DetachSizer, 1341).
+-define(wxSizerItem_GetBorder, 1342).
+-define(wxSizerItem_GetFlag, 1343).
+-define(wxSizerItem_GetMinSize, 1344).
+-define(wxSizerItem_GetPosition, 1345).
+-define(wxSizerItem_GetProportion, 1346).
+-define(wxSizerItem_GetRatio, 1347).
+-define(wxSizerItem_GetRect, 1348).
+-define(wxSizerItem_GetSize, 1349).
+-define(wxSizerItem_GetSizer, 1350).
+-define(wxSizerItem_GetSpacer, 1351).
+-define(wxSizerItem_GetUserData, 1352).
+-define(wxSizerItem_GetWindow, 1353).
+-define(wxSizerItem_IsSizer, 1354).
+-define(wxSizerItem_IsShown, 1355).
+-define(wxSizerItem_IsSpacer, 1356).
+-define(wxSizerItem_IsWindow, 1357).
+-define(wxSizerItem_SetBorder, 1358).
+-define(wxSizerItem_SetDimension, 1359).
+-define(wxSizerItem_SetFlag, 1360).
+-define(wxSizerItem_SetInitSize, 1361).
+-define(wxSizerItem_SetMinSize_1, 1362).
+-define(wxSizerItem_SetMinSize_2, 1363).
+-define(wxSizerItem_SetProportion, 1364).
+-define(wxSizerItem_SetRatio_2, 1365).
+-define(wxSizerItem_SetRatio_1_1, 1366).
+-define(wxSizerItem_SetRatio_1_0, 1367).
+-define(wxSizerItem_SetSizer, 1368).
+-define(wxSizerItem_SetSpacer_1, 1369).
+-define(wxSizerItem_SetSpacer_2, 1370).
+-define(wxSizerItem_SetWindow, 1371).
+-define(wxSizerItem_Show, 1372).
+-define(wxBoxSizer_new, 1373).
+-define(wxBoxSizer_GetOrientation, 1374).
+-define(wxBoxSizer_destroy, 1375).
+-define(wxStaticBoxSizer_new_2, 1376).
+-define(wxStaticBoxSizer_new_3, 1377).
+-define(wxStaticBoxSizer_GetStaticBox, 1378).
+-define(wxStaticBoxSizer_destroy, 1379).
+-define(wxGridSizer_new_4, 1380).
+-define(wxGridSizer_new_2, 1381).
+-define(wxGridSizer_GetCols, 1382).
+-define(wxGridSizer_GetHGap, 1383).
+-define(wxGridSizer_GetRows, 1384).
+-define(wxGridSizer_GetVGap, 1385).
+-define(wxGridSizer_SetCols, 1386).
+-define(wxGridSizer_SetHGap, 1387).
+-define(wxGridSizer_SetRows, 1388).
+-define(wxGridSizer_SetVGap, 1389).
+-define(wxGridSizer_destroy, 1390).
+-define(wxFlexGridSizer_new_4, 1391).
+-define(wxFlexGridSizer_new_2, 1392).
+-define(wxFlexGridSizer_AddGrowableCol, 1393).
+-define(wxFlexGridSizer_AddGrowableRow, 1394).
+-define(wxFlexGridSizer_GetFlexibleDirection, 1395).
+-define(wxFlexGridSizer_GetNonFlexibleGrowMode, 1396).
+-define(wxFlexGridSizer_RemoveGrowableCol, 1397).
+-define(wxFlexGridSizer_RemoveGrowableRow, 1398).
+-define(wxFlexGridSizer_SetFlexibleDirection, 1399).
+-define(wxFlexGridSizer_SetNonFlexibleGrowMode, 1400).
+-define(wxFlexGridSizer_destroy, 1401).
+-define(wxGridBagSizer_new, 1402).
+-define(wxGridBagSizer_Add_3_2, 1403).
+-define(wxGridBagSizer_Add_3_1, 1404).
+-define(wxGridBagSizer_Add_4, 1405).
+-define(wxGridBagSizer_Add_1_0, 1406).
+-define(wxGridBagSizer_Add_2_1, 1407).
+-define(wxGridBagSizer_Add_2_0, 1408).
+-define(wxGridBagSizer_Add_3_0, 1409).
+-define(wxGridBagSizer_Add_1_1, 1410).
+-define(wxGridBagSizer_CalcMin, 1411).
+-define(wxGridBagSizer_CheckForIntersection_2, 1412).
+-define(wxGridBagSizer_CheckForIntersection_3, 1413).
+-define(wxGridBagSizer_FindItem_1_1, 1414).
+-define(wxGridBagSizer_FindItem_1_0, 1415).
+-define(wxGridBagSizer_FindItemAtPoint, 1416).
+-define(wxGridBagSizer_FindItemAtPosition, 1417).
+-define(wxGridBagSizer_FindItemWithData, 1418).
+-define(wxGridBagSizer_GetCellSize, 1419).
+-define(wxGridBagSizer_GetEmptyCellSize, 1420).
+-define(wxGridBagSizer_GetItemPosition_1_2, 1421).
+-define(wxGridBagSizer_GetItemPosition_1_1, 1422).
+-define(wxGridBagSizer_GetItemPosition_1_0, 1423).
+-define(wxGridBagSizer_GetItemSpan_1_2, 1424).
+-define(wxGridBagSizer_GetItemSpan_1_1, 1425).
+-define(wxGridBagSizer_GetItemSpan_1_0, 1426).
+-define(wxGridBagSizer_SetEmptyCellSize, 1427).
+-define(wxGridBagSizer_SetItemPosition_2_2, 1428).
+-define(wxGridBagSizer_SetItemPosition_2_1, 1429).
+-define(wxGridBagSizer_SetItemPosition_2_0, 1430).
+-define(wxGridBagSizer_SetItemSpan_2_2, 1431).
+-define(wxGridBagSizer_SetItemSpan_2_1, 1432).
+-define(wxGridBagSizer_SetItemSpan_2_0, 1433).
+-define(wxGridBagSizer_destroy, 1434).
+-define(wxStdDialogButtonSizer_new, 1435).
+-define(wxStdDialogButtonSizer_AddButton, 1436).
+-define(wxStdDialogButtonSizer_Realize, 1437).
+-define(wxStdDialogButtonSizer_SetAffirmativeButton, 1438).
+-define(wxStdDialogButtonSizer_SetCancelButton, 1439).
+-define(wxStdDialogButtonSizer_SetNegativeButton, 1440).
+-define(wxStdDialogButtonSizer_destroy, 1441).
+-define(wxFont_new_0, 1442).
+-define(wxFont_new_1, 1443).
+-define(wxFont_new_5, 1444).
+-define(wxFont_destruct, 1446).
+-define(wxFont_IsFixedWidth, 1447).
+-define(wxFont_GetDefaultEncoding, 1448).
+-define(wxFont_GetFaceName, 1449).
+-define(wxFont_GetFamily, 1450).
+-define(wxFont_GetNativeFontInfoDesc, 1451).
+-define(wxFont_GetNativeFontInfoUserDesc, 1452).
+-define(wxFont_GetPointSize, 1453).
+-define(wxFont_GetStyle, 1454).
+-define(wxFont_GetUnderlined, 1455).
+-define(wxFont_GetWeight, 1456).
+-define(wxFont_Ok, 1457).
+-define(wxFont_SetDefaultEncoding, 1458).
+-define(wxFont_SetFaceName, 1459).
+-define(wxFont_SetFamily, 1460).
+-define(wxFont_SetPointSize, 1461).
+-define(wxFont_SetStyle, 1462).
+-define(wxFont_SetUnderlined, 1463).
+-define(wxFont_SetWeight, 1464).
+-define(wxToolTip_Enable, 1465).
+-define(wxToolTip_SetDelay, 1466).
+-define(wxToolTip_new, 1467).
+-define(wxToolTip_SetTip, 1468).
+-define(wxToolTip_GetTip, 1469).
+-define(wxToolTip_GetWindow, 1470).
+-define(wxToolTip_destroy, 1471).
+-define(wxButton_new_3, 1473).
+-define(wxButton_new_0, 1474).
+-define(wxButton_destruct, 1475).
+-define(wxButton_Create, 1476).
+-define(wxButton_GetDefaultSize, 1477).
+-define(wxButton_SetDefault, 1478).
+-define(wxButton_SetLabel, 1479).
+-define(wxBitmapButton_new_4, 1481).
+-define(wxBitmapButton_new_0, 1482).
+-define(wxBitmapButton_Create, 1483).
+-define(wxBitmapButton_GetBitmapDisabled, 1484).
+-define(wxBitmapButton_GetBitmapFocus, 1486).
+-define(wxBitmapButton_GetBitmapLabel, 1488).
+-define(wxBitmapButton_GetBitmapSelected, 1490).
+-define(wxBitmapButton_SetBitmapDisabled, 1492).
+-define(wxBitmapButton_SetBitmapFocus, 1493).
+-define(wxBitmapButton_SetBitmapLabel, 1494).
+-define(wxBitmapButton_SetBitmapSelected, 1495).
+-define(wxBitmapButton_destroy, 1496).
+-define(wxToggleButton_new_0, 1497).
+-define(wxToggleButton_new_4, 1498).
+-define(wxToggleButton_Create, 1499).
+-define(wxToggleButton_GetValue, 1500).
+-define(wxToggleButton_SetValue, 1501).
+-define(wxToggleButton_destroy, 1502).
+-define(wxCalendarCtrl_new_0, 1503).
+-define(wxCalendarCtrl_new_3, 1504).
+-define(wxCalendarCtrl_Create, 1505).
+-define(wxCalendarCtrl_destruct, 1506).
+-define(wxCalendarCtrl_SetDate, 1507).
+-define(wxCalendarCtrl_GetDate, 1508).
+-define(wxCalendarCtrl_EnableYearChange, 1509).
+-define(wxCalendarCtrl_EnableMonthChange, 1510).
+-define(wxCalendarCtrl_EnableHolidayDisplay, 1511).
+-define(wxCalendarCtrl_SetHeaderColours, 1512).
+-define(wxCalendarCtrl_GetHeaderColourFg, 1513).
+-define(wxCalendarCtrl_GetHeaderColourBg, 1514).
+-define(wxCalendarCtrl_SetHighlightColours, 1515).
+-define(wxCalendarCtrl_GetHighlightColourFg, 1516).
+-define(wxCalendarCtrl_GetHighlightColourBg, 1517).
+-define(wxCalendarCtrl_SetHolidayColours, 1518).
+-define(wxCalendarCtrl_GetHolidayColourFg, 1519).
+-define(wxCalendarCtrl_GetHolidayColourBg, 1520).
+-define(wxCalendarCtrl_GetAttr, 1521).
+-define(wxCalendarCtrl_SetAttr, 1522).
+-define(wxCalendarCtrl_SetHoliday, 1523).
+-define(wxCalendarCtrl_ResetAttr, 1524).
+-define(wxCalendarCtrl_HitTest, 1525).
+-define(wxCalendarDateAttr_new_0, 1526).
+-define(wxCalendarDateAttr_new_2_1, 1527).
+-define(wxCalendarDateAttr_new_2_0, 1528).
+-define(wxCalendarDateAttr_SetTextColour, 1529).
+-define(wxCalendarDateAttr_SetBackgroundColour, 1530).
+-define(wxCalendarDateAttr_SetBorderColour, 1531).
+-define(wxCalendarDateAttr_SetFont, 1532).
+-define(wxCalendarDateAttr_SetBorder, 1533).
+-define(wxCalendarDateAttr_SetHoliday, 1534).
+-define(wxCalendarDateAttr_HasTextColour, 1535).
+-define(wxCalendarDateAttr_HasBackgroundColour, 1536).
+-define(wxCalendarDateAttr_HasBorderColour, 1537).
+-define(wxCalendarDateAttr_HasFont, 1538).
+-define(wxCalendarDateAttr_HasBorder, 1539).
+-define(wxCalendarDateAttr_IsHoliday, 1540).
+-define(wxCalendarDateAttr_GetTextColour, 1541).
+-define(wxCalendarDateAttr_GetBackgroundColour, 1542).
+-define(wxCalendarDateAttr_GetBorderColour, 1543).
+-define(wxCalendarDateAttr_GetFont, 1544).
+-define(wxCalendarDateAttr_GetBorder, 1545).
+-define(wxCalendarDateAttr_destroy, 1546).
+-define(wxCheckBox_new_4, 1548).
+-define(wxCheckBox_new_0, 1549).
+-define(wxCheckBox_Create, 1550).
+-define(wxCheckBox_GetValue, 1551).
+-define(wxCheckBox_Get3StateValue, 1552).
+-define(wxCheckBox_Is3rdStateAllowedForUser, 1553).
+-define(wxCheckBox_Is3State, 1554).
+-define(wxCheckBox_IsChecked, 1555).
+-define(wxCheckBox_SetValue, 1556).
+-define(wxCheckBox_Set3StateValue, 1557).
+-define(wxCheckBox_destroy, 1558).
+-define(wxCheckListBox_new_0, 1559).
+-define(wxCheckListBox_new_3, 1561).
+-define(wxCheckListBox_Check, 1562).
+-define(wxCheckListBox_IsChecked, 1563).
+-define(wxCheckListBox_destroy, 1564).
+-define(wxChoice_new_3, 1567).
+-define(wxChoice_new_0, 1568).
+-define(wxChoice_destruct, 1570).
+-define(wxChoice_Create, 1572).
+-define(wxChoice_Delete, 1573).
+-define(wxChoice_GetColumns, 1574).
+-define(wxChoice_SetColumns, 1575).
+-define(wxComboBox_new_0, 1576).
+-define(wxComboBox_new_3, 1578).
+-define(wxComboBox_destruct, 1579).
+-define(wxComboBox_Create, 1581).
+-define(wxComboBox_CanCopy, 1582).
+-define(wxComboBox_CanCut, 1583).
+-define(wxComboBox_CanPaste, 1584).
+-define(wxComboBox_CanRedo, 1585).
+-define(wxComboBox_CanUndo, 1586).
+-define(wxComboBox_Copy, 1587).
+-define(wxComboBox_Cut, 1588).
+-define(wxComboBox_GetInsertionPoint, 1589).
+-define(wxComboBox_GetLastPosition, 1590).
+-define(wxComboBox_GetValue, 1591).
+-define(wxComboBox_Paste, 1592).
+-define(wxComboBox_Redo, 1593).
+-define(wxComboBox_Replace, 1594).
+-define(wxComboBox_Remove, 1595).
+-define(wxComboBox_SetInsertionPoint, 1596).
+-define(wxComboBox_SetInsertionPointEnd, 1597).
+-define(wxComboBox_SetSelection_1, 1598).
+-define(wxComboBox_SetSelection_2, 1599).
+-define(wxComboBox_SetValue, 1600).
+-define(wxComboBox_Undo, 1601).
+-define(wxGauge_new_0, 1602).
+-define(wxGauge_new_4, 1603).
+-define(wxGauge_Create, 1604).
+-define(wxGauge_GetBezelFace, 1605).
+-define(wxGauge_GetRange, 1606).
+-define(wxGauge_GetShadowWidth, 1607).
+-define(wxGauge_GetValue, 1608).
+-define(wxGauge_IsVertical, 1609).
+-define(wxGauge_SetBezelFace, 1610).
+-define(wxGauge_SetRange, 1611).
+-define(wxGauge_SetShadowWidth, 1612).
+-define(wxGauge_SetValue, 1613).
+-define(wxGauge_Pulse, 1614).
+-define(wxGauge_destroy, 1615).
+-define(wxGenericDirCtrl_new_0, 1616).
+-define(wxGenericDirCtrl_new_2, 1617).
+-define(wxGenericDirCtrl_destruct, 1618).
+-define(wxGenericDirCtrl_Create, 1619).
+-define(wxGenericDirCtrl_Init, 1620).
+-define(wxGenericDirCtrl_CollapseTree, 1621).
+-define(wxGenericDirCtrl_ExpandPath, 1622).
+-define(wxGenericDirCtrl_GetDefaultPath, 1623).
+-define(wxGenericDirCtrl_GetPath, 1624).
+-define(wxGenericDirCtrl_GetFilePath, 1625).
+-define(wxGenericDirCtrl_GetFilter, 1626).
+-define(wxGenericDirCtrl_GetFilterIndex, 1627).
+-define(wxGenericDirCtrl_GetRootId, 1628).
+-define(wxGenericDirCtrl_GetTreeCtrl, 1629).
+-define(wxGenericDirCtrl_ReCreateTree, 1630).
+-define(wxGenericDirCtrl_SetDefaultPath, 1631).
+-define(wxGenericDirCtrl_SetFilter, 1632).
+-define(wxGenericDirCtrl_SetFilterIndex, 1633).
+-define(wxGenericDirCtrl_SetPath, 1634).
+-define(wxStaticBox_new_4, 1636).
+-define(wxStaticBox_new_0, 1637).
+-define(wxStaticBox_Create, 1638).
+-define(wxStaticBox_destroy, 1639).
+-define(wxStaticLine_new_2, 1641).
+-define(wxStaticLine_new_0, 1642).
+-define(wxStaticLine_Create, 1643).
+-define(wxStaticLine_IsVertical, 1644).
+-define(wxStaticLine_GetDefaultSize, 1645).
+-define(wxStaticLine_destroy, 1646).
+-define(wxListBox_new_3, 1649).
+-define(wxListBox_new_0, 1650).
+-define(wxListBox_destruct, 1652).
+-define(wxListBox_Create, 1654).
+-define(wxListBox_Deselect, 1655).
+-define(wxListBox_GetSelections, 1656).
+-define(wxListBox_InsertItems, 1657).
+-define(wxListBox_IsSelected, 1658).
+-define(wxListBox_Set, 1659).
+-define(wxListBox_HitTest, 1660).
+-define(wxListBox_SetFirstItem_1_0, 1661).
+-define(wxListBox_SetFirstItem_1_1, 1662).
+-define(wxListCtrl_new_0, 1663).
+-define(wxListCtrl_new_2, 1664).
+-define(wxListCtrl_Arrange, 1665).
+-define(wxListCtrl_AssignImageList, 1666).
+-define(wxListCtrl_ClearAll, 1667).
+-define(wxListCtrl_Create, 1668).
+-define(wxListCtrl_DeleteAllItems, 1669).
+-define(wxListCtrl_DeleteColumn, 1670).
+-define(wxListCtrl_DeleteItem, 1671).
+-define(wxListCtrl_EditLabel, 1672).
+-define(wxListCtrl_EnsureVisible, 1673).
+-define(wxListCtrl_FindItem_3_0, 1674).
+-define(wxListCtrl_FindItem_3_1, 1675).
+-define(wxListCtrl_GetColumn, 1676).
+-define(wxListCtrl_GetColumnCount, 1677).
+-define(wxListCtrl_GetColumnWidth, 1678).
+-define(wxListCtrl_GetCountPerPage, 1679).
+-define(wxListCtrl_GetEditControl, 1680).
+-define(wxListCtrl_GetImageList, 1681).
+-define(wxListCtrl_GetItem, 1682).
+-define(wxListCtrl_GetItemBackgroundColour, 1683).
+-define(wxListCtrl_GetItemCount, 1684).
+-define(wxListCtrl_GetItemData, 1685).
+-define(wxListCtrl_GetItemFont, 1686).
+-define(wxListCtrl_GetItemPosition, 1687).
+-define(wxListCtrl_GetItemRect, 1688).
+-define(wxListCtrl_GetItemSpacing, 1689).
+-define(wxListCtrl_GetItemState, 1690).
+-define(wxListCtrl_GetItemText, 1691).
+-define(wxListCtrl_GetItemTextColour, 1692).
+-define(wxListCtrl_GetNextItem, 1693).
+-define(wxListCtrl_GetSelectedItemCount, 1694).
+-define(wxListCtrl_GetTextColour, 1695).
+-define(wxListCtrl_GetTopItem, 1696).
+-define(wxListCtrl_GetViewRect, 1697).
+-define(wxListCtrl_HitTest, 1698).
+-define(wxListCtrl_InsertColumn_2, 1699).
+-define(wxListCtrl_InsertColumn_3, 1700).
+-define(wxListCtrl_InsertItem_1, 1701).
+-define(wxListCtrl_InsertItem_2_1, 1702).
+-define(wxListCtrl_InsertItem_2_0, 1703).
+-define(wxListCtrl_InsertItem_3, 1704).
+-define(wxListCtrl_RefreshItem, 1705).
+-define(wxListCtrl_RefreshItems, 1706).
+-define(wxListCtrl_ScrollList, 1707).
+-define(wxListCtrl_SetBackgroundColour, 1708).
+-define(wxListCtrl_SetColumn, 1709).
+-define(wxListCtrl_SetColumnWidth, 1710).
+-define(wxListCtrl_SetImageList, 1711).
+-define(wxListCtrl_SetItem_1, 1712).
+-define(wxListCtrl_SetItem_4, 1713).
+-define(wxListCtrl_SetItemBackgroundColour, 1714).
+-define(wxListCtrl_SetItemCount, 1715).
+-define(wxListCtrl_SetItemData, 1716).
+-define(wxListCtrl_SetItemFont, 1717).
+-define(wxListCtrl_SetItemImage, 1718).
+-define(wxListCtrl_SetItemColumnImage, 1719).
+-define(wxListCtrl_SetItemPosition, 1720).
+-define(wxListCtrl_SetItemState, 1721).
+-define(wxListCtrl_SetItemText, 1722).
+-define(wxListCtrl_SetItemTextColour, 1723).
+-define(wxListCtrl_SetSingleStyle, 1724).
+-define(wxListCtrl_SetTextColour, 1725).
+-define(wxListCtrl_SetWindowStyleFlag, 1726).
+-define(wxListCtrl_SortItems, 1727).
+-define(wxListCtrl_destroy, 1728).
+-define(wxListView_ClearColumnImage, 1729).
+-define(wxListView_Focus, 1730).
+-define(wxListView_GetFirstSelected, 1731).
+-define(wxListView_GetFocusedItem, 1732).
+-define(wxListView_GetNextSelected, 1733).
+-define(wxListView_IsSelected, 1734).
+-define(wxListView_Select, 1735).
+-define(wxListView_SetColumnImage, 1736).
+-define(wxListItem_new_0, 1737).
+-define(wxListItem_new_1, 1738).
+-define(wxListItem_destruct, 1739).
+-define(wxListItem_Clear, 1740).
+-define(wxListItem_GetAlign, 1741).
+-define(wxListItem_GetBackgroundColour, 1742).
+-define(wxListItem_GetColumn, 1743).
+-define(wxListItem_GetFont, 1744).
+-define(wxListItem_GetId, 1745).
+-define(wxListItem_GetImage, 1746).
+-define(wxListItem_GetMask, 1747).
+-define(wxListItem_GetState, 1748).
+-define(wxListItem_GetText, 1749).
+-define(wxListItem_GetTextColour, 1750).
+-define(wxListItem_GetWidth, 1751).
+-define(wxListItem_SetAlign, 1752).
+-define(wxListItem_SetBackgroundColour, 1753).
+-define(wxListItem_SetColumn, 1754).
+-define(wxListItem_SetFont, 1755).
+-define(wxListItem_SetId, 1756).
+-define(wxListItem_SetImage, 1757).
+-define(wxListItem_SetMask, 1758).
+-define(wxListItem_SetState, 1759).
+-define(wxListItem_SetStateMask, 1760).
+-define(wxListItem_SetText, 1761).
+-define(wxListItem_SetTextColour, 1762).
+-define(wxListItem_SetWidth, 1763).
+-define(wxListItemAttr_new_0, 1764).
+-define(wxListItemAttr_new_3, 1765).
+-define(wxListItemAttr_GetBackgroundColour, 1766).
+-define(wxListItemAttr_GetFont, 1767).
+-define(wxListItemAttr_GetTextColour, 1768).
+-define(wxListItemAttr_HasBackgroundColour, 1769).
+-define(wxListItemAttr_HasFont, 1770).
+-define(wxListItemAttr_HasTextColour, 1771).
+-define(wxListItemAttr_SetBackgroundColour, 1772).
+-define(wxListItemAttr_SetFont, 1773).
+-define(wxListItemAttr_SetTextColour, 1774).
+-define(wxListItemAttr_destroy, 1775).
+-define(wxImageList_new_0, 1776).
+-define(wxImageList_new_3, 1777).
+-define(wxImageList_Add_1, 1778).
+-define(wxImageList_Add_2_0, 1779).
+-define(wxImageList_Add_2_1, 1780).
+-define(wxImageList_Create, 1781).
+-define(wxImageList_Draw, 1783).
+-define(wxImageList_GetBitmap, 1784).
+-define(wxImageList_GetIcon, 1785).
+-define(wxImageList_GetImageCount, 1786).
+-define(wxImageList_GetSize, 1787).
+-define(wxImageList_Remove, 1788).
+-define(wxImageList_RemoveAll, 1789).
+-define(wxImageList_Replace_2, 1790).
+-define(wxImageList_Replace_3, 1791).
+-define(wxImageList_destroy, 1792).
+-define(wxTextAttr_new_0, 1793).
+-define(wxTextAttr_new_2, 1794).
+-define(wxTextAttr_GetAlignment, 1795).
+-define(wxTextAttr_GetBackgroundColour, 1796).
+-define(wxTextAttr_GetFont, 1797).
+-define(wxTextAttr_GetLeftIndent, 1798).
+-define(wxTextAttr_GetLeftSubIndent, 1799).
+-define(wxTextAttr_GetRightIndent, 1800).
+-define(wxTextAttr_GetTabs, 1801).
+-define(wxTextAttr_GetTextColour, 1802).
+-define(wxTextAttr_HasBackgroundColour, 1803).
+-define(wxTextAttr_HasFont, 1804).
+-define(wxTextAttr_HasTextColour, 1805).
+-define(wxTextAttr_GetFlags, 1806).
+-define(wxTextAttr_IsDefault, 1807).
+-define(wxTextAttr_SetAlignment, 1808).
+-define(wxTextAttr_SetBackgroundColour, 1809).
+-define(wxTextAttr_SetFlags, 1810).
+-define(wxTextAttr_SetFont, 1811).
+-define(wxTextAttr_SetLeftIndent, 1812).
+-define(wxTextAttr_SetRightIndent, 1813).
+-define(wxTextAttr_SetTabs, 1814).
+-define(wxTextAttr_SetTextColour, 1815).
+-define(wxTextAttr_destroy, 1816).
+-define(wxTextCtrl_new_3, 1818).
+-define(wxTextCtrl_new_0, 1819).
+-define(wxTextCtrl_destruct, 1821).
+-define(wxTextCtrl_AppendText, 1822).
+-define(wxTextCtrl_CanCopy, 1823).
+-define(wxTextCtrl_CanCut, 1824).
+-define(wxTextCtrl_CanPaste, 1825).
+-define(wxTextCtrl_CanRedo, 1826).
+-define(wxTextCtrl_CanUndo, 1827).
+-define(wxTextCtrl_Clear, 1828).
+-define(wxTextCtrl_Copy, 1829).
+-define(wxTextCtrl_Create, 1830).
+-define(wxTextCtrl_Cut, 1831).
+-define(wxTextCtrl_DiscardEdits, 1832).
+-define(wxTextCtrl_ChangeValue, 1833).
+-define(wxTextCtrl_EmulateKeyPress, 1834).
+-define(wxTextCtrl_GetDefaultStyle, 1835).
+-define(wxTextCtrl_GetInsertionPoint, 1836).
+-define(wxTextCtrl_GetLastPosition, 1837).
+-define(wxTextCtrl_GetLineLength, 1838).
+-define(wxTextCtrl_GetLineText, 1839).
+-define(wxTextCtrl_GetNumberOfLines, 1840).
+-define(wxTextCtrl_GetRange, 1841).
+-define(wxTextCtrl_GetSelection, 1842).
+-define(wxTextCtrl_GetStringSelection, 1843).
+-define(wxTextCtrl_GetStyle, 1844).
+-define(wxTextCtrl_GetValue, 1845).
+-define(wxTextCtrl_IsEditable, 1846).
+-define(wxTextCtrl_IsModified, 1847).
+-define(wxTextCtrl_IsMultiLine, 1848).
+-define(wxTextCtrl_IsSingleLine, 1849).
+-define(wxTextCtrl_LoadFile, 1850).
+-define(wxTextCtrl_MarkDirty, 1851).
+-define(wxTextCtrl_Paste, 1852).
+-define(wxTextCtrl_PositionToXY, 1853).
+-define(wxTextCtrl_Redo, 1854).
+-define(wxTextCtrl_Remove, 1855).
+-define(wxTextCtrl_Replace, 1856).
+-define(wxTextCtrl_SaveFile, 1857).
+-define(wxTextCtrl_SetDefaultStyle, 1858).
+-define(wxTextCtrl_SetEditable, 1859).
+-define(wxTextCtrl_SetInsertionPoint, 1860).
+-define(wxTextCtrl_SetInsertionPointEnd, 1861).
+-define(wxTextCtrl_SetMaxLength, 1863).
+-define(wxTextCtrl_SetSelection, 1864).
+-define(wxTextCtrl_SetStyle, 1865).
+-define(wxTextCtrl_SetValue, 1866).
+-define(wxTextCtrl_ShowPosition, 1867).
+-define(wxTextCtrl_Undo, 1868).
+-define(wxTextCtrl_WriteText, 1869).
+-define(wxTextCtrl_XYToPosition, 1870).
+-define(wxNotebook_new_0, 1873).
+-define(wxNotebook_new_3, 1874).
+-define(wxNotebook_destruct, 1875).
+-define(wxNotebook_AddPage, 1876).
+-define(wxNotebook_AdvanceSelection, 1877).
+-define(wxNotebook_AssignImageList, 1878).
+-define(wxNotebook_Create, 1879).
+-define(wxNotebook_DeleteAllPages, 1880).
+-define(wxNotebook_DeletePage, 1881).
+-define(wxNotebook_RemovePage, 1882).
+-define(wxNotebook_GetCurrentPage, 1883).
+-define(wxNotebook_GetImageList, 1884).
+-define(wxNotebook_GetPage, 1886).
+-define(wxNotebook_GetPageCount, 1887).
+-define(wxNotebook_GetPageImage, 1888).
+-define(wxNotebook_GetPageText, 1889).
+-define(wxNotebook_GetRowCount, 1890).
+-define(wxNotebook_GetSelection, 1891).
+-define(wxNotebook_GetThemeBackgroundColour, 1892).
+-define(wxNotebook_HitTest, 1894).
+-define(wxNotebook_InsertPage, 1896).
+-define(wxNotebook_SetImageList, 1897).
+-define(wxNotebook_SetPadding, 1898).
+-define(wxNotebook_SetPageSize, 1899).
+-define(wxNotebook_SetPageImage, 1900).
+-define(wxNotebook_SetPageText, 1901).
+-define(wxNotebook_SetSelection, 1902).
+-define(wxNotebook_ChangeSelection, 1903).
+-define(wxChoicebook_new_0, 1904).
+-define(wxChoicebook_new_3, 1905).
+-define(wxChoicebook_AddPage, 1906).
+-define(wxChoicebook_AdvanceSelection, 1907).
+-define(wxChoicebook_AssignImageList, 1908).
+-define(wxChoicebook_Create, 1909).
+-define(wxChoicebook_DeleteAllPages, 1910).
+-define(wxChoicebook_DeletePage, 1911).
+-define(wxChoicebook_RemovePage, 1912).
+-define(wxChoicebook_GetCurrentPage, 1913).
+-define(wxChoicebook_GetImageList, 1914).
+-define(wxChoicebook_GetPage, 1916).
+-define(wxChoicebook_GetPageCount, 1917).
+-define(wxChoicebook_GetPageImage, 1918).
+-define(wxChoicebook_GetPageText, 1919).
+-define(wxChoicebook_GetSelection, 1920).
+-define(wxChoicebook_HitTest, 1921).
+-define(wxChoicebook_InsertPage, 1922).
+-define(wxChoicebook_SetImageList, 1923).
+-define(wxChoicebook_SetPageSize, 1924).
+-define(wxChoicebook_SetPageImage, 1925).
+-define(wxChoicebook_SetPageText, 1926).
+-define(wxChoicebook_SetSelection, 1927).
+-define(wxChoicebook_ChangeSelection, 1928).
+-define(wxChoicebook_destroy, 1929).
+-define(wxToolbook_new_0, 1930).
+-define(wxToolbook_new_3, 1931).
+-define(wxToolbook_AddPage, 1932).
+-define(wxToolbook_AdvanceSelection, 1933).
+-define(wxToolbook_AssignImageList, 1934).
+-define(wxToolbook_Create, 1935).
+-define(wxToolbook_DeleteAllPages, 1936).
+-define(wxToolbook_DeletePage, 1937).
+-define(wxToolbook_RemovePage, 1938).
+-define(wxToolbook_GetCurrentPage, 1939).
+-define(wxToolbook_GetImageList, 1940).
+-define(wxToolbook_GetPage, 1942).
+-define(wxToolbook_GetPageCount, 1943).
+-define(wxToolbook_GetPageImage, 1944).
+-define(wxToolbook_GetPageText, 1945).
+-define(wxToolbook_GetSelection, 1946).
+-define(wxToolbook_HitTest, 1948).
+-define(wxToolbook_InsertPage, 1949).
+-define(wxToolbook_SetImageList, 1950).
+-define(wxToolbook_SetPageSize, 1951).
+-define(wxToolbook_SetPageImage, 1952).
+-define(wxToolbook_SetPageText, 1953).
+-define(wxToolbook_SetSelection, 1954).
+-define(wxToolbook_ChangeSelection, 1955).
+-define(wxToolbook_destroy, 1956).
+-define(wxListbook_new_0, 1957).
+-define(wxListbook_new_3, 1958).
+-define(wxListbook_AddPage, 1959).
+-define(wxListbook_AdvanceSelection, 1960).
+-define(wxListbook_AssignImageList, 1961).
+-define(wxListbook_Create, 1962).
+-define(wxListbook_DeleteAllPages, 1963).
+-define(wxListbook_DeletePage, 1964).
+-define(wxListbook_RemovePage, 1965).
+-define(wxListbook_GetCurrentPage, 1966).
+-define(wxListbook_GetImageList, 1967).
+-define(wxListbook_GetPage, 1969).
+-define(wxListbook_GetPageCount, 1970).
+-define(wxListbook_GetPageImage, 1971).
+-define(wxListbook_GetPageText, 1972).
+-define(wxListbook_GetSelection, 1973).
+-define(wxListbook_HitTest, 1975).
+-define(wxListbook_InsertPage, 1976).
+-define(wxListbook_SetImageList, 1977).
+-define(wxListbook_SetPageSize, 1978).
+-define(wxListbook_SetPageImage, 1979).
+-define(wxListbook_SetPageText, 1980).
+-define(wxListbook_SetSelection, 1981).
+-define(wxListbook_ChangeSelection, 1982).
+-define(wxListbook_destroy, 1983).
+-define(wxTreebook_new_0, 1984).
+-define(wxTreebook_new_3, 1985).
+-define(wxTreebook_AddPage, 1986).
+-define(wxTreebook_AdvanceSelection, 1987).
+-define(wxTreebook_AssignImageList, 1988).
+-define(wxTreebook_Create, 1989).
+-define(wxTreebook_DeleteAllPages, 1990).
+-define(wxTreebook_DeletePage, 1991).
+-define(wxTreebook_RemovePage, 1992).
+-define(wxTreebook_GetCurrentPage, 1993).
+-define(wxTreebook_GetImageList, 1994).
+-define(wxTreebook_GetPage, 1996).
+-define(wxTreebook_GetPageCount, 1997).
+-define(wxTreebook_GetPageImage, 1998).
+-define(wxTreebook_GetPageText, 1999).
+-define(wxTreebook_GetSelection, 2000).
+-define(wxTreebook_ExpandNode, 2001).
+-define(wxTreebook_IsNodeExpanded, 2002).
+-define(wxTreebook_HitTest, 2004).
+-define(wxTreebook_InsertPage, 2005).
+-define(wxTreebook_InsertSubPage, 2006).
+-define(wxTreebook_SetImageList, 2007).
+-define(wxTreebook_SetPageSize, 2008).
+-define(wxTreebook_SetPageImage, 2009).
+-define(wxTreebook_SetPageText, 2010).
+-define(wxTreebook_SetSelection, 2011).
+-define(wxTreebook_ChangeSelection, 2012).
+-define(wxTreebook_destroy, 2013).
+-define(wxTreeCtrl_new_2, 2016).
+-define(wxTreeCtrl_new_0, 2017).
+-define(wxTreeCtrl_destruct, 2019).
+-define(wxTreeCtrl_AddRoot, 2020).
+-define(wxTreeCtrl_AppendItem, 2021).
+-define(wxTreeCtrl_AssignImageList, 2022).
+-define(wxTreeCtrl_AssignStateImageList, 2023).
+-define(wxTreeCtrl_Collapse, 2024).
+-define(wxTreeCtrl_CollapseAndReset, 2025).
+-define(wxTreeCtrl_Create, 2026).
+-define(wxTreeCtrl_Delete, 2027).
+-define(wxTreeCtrl_DeleteAllItems, 2028).
+-define(wxTreeCtrl_DeleteChildren, 2029).
+-define(wxTreeCtrl_EditLabel, 2030).
+-define(wxTreeCtrl_EnsureVisible, 2031).
+-define(wxTreeCtrl_Expand, 2032).
+-define(wxTreeCtrl_GetBoundingRect, 2033).
+-define(wxTreeCtrl_GetChildrenCount, 2035).
+-define(wxTreeCtrl_GetCount, 2036).
+-define(wxTreeCtrl_GetEditControl, 2037).
+-define(wxTreeCtrl_GetFirstChild, 2038).
+-define(wxTreeCtrl_GetNextChild, 2039).
+-define(wxTreeCtrl_GetFirstVisibleItem, 2040).
+-define(wxTreeCtrl_GetImageList, 2041).
+-define(wxTreeCtrl_GetIndent, 2042).
+-define(wxTreeCtrl_GetItemBackgroundColour, 2043).
+-define(wxTreeCtrl_GetItemData, 2044).
+-define(wxTreeCtrl_GetItemFont, 2045).
+-define(wxTreeCtrl_GetItemImage_1, 2046).
+-define(wxTreeCtrl_GetItemImage_2, 2047).
+-define(wxTreeCtrl_GetItemText, 2048).
+-define(wxTreeCtrl_GetItemTextColour, 2049).
+-define(wxTreeCtrl_GetLastChild, 2050).
+-define(wxTreeCtrl_GetNextSibling, 2051).
+-define(wxTreeCtrl_GetNextVisible, 2052).
+-define(wxTreeCtrl_GetItemParent, 2053).
+-define(wxTreeCtrl_GetPrevSibling, 2054).
+-define(wxTreeCtrl_GetPrevVisible, 2055).
+-define(wxTreeCtrl_GetRootItem, 2056).
+-define(wxTreeCtrl_GetSelection, 2057).
+-define(wxTreeCtrl_GetSelections, 2058).
+-define(wxTreeCtrl_GetStateImageList, 2059).
+-define(wxTreeCtrl_HitTest, 2060).
+-define(wxTreeCtrl_InsertItem, 2062).
+-define(wxTreeCtrl_IsBold, 2063).
+-define(wxTreeCtrl_IsExpanded, 2064).
+-define(wxTreeCtrl_IsSelected, 2065).
+-define(wxTreeCtrl_IsVisible, 2066).
+-define(wxTreeCtrl_ItemHasChildren, 2067).
+-define(wxTreeCtrl_IsTreeItemIdOk, 2068).
+-define(wxTreeCtrl_PrependItem, 2069).
+-define(wxTreeCtrl_ScrollTo, 2070).
+-define(wxTreeCtrl_SelectItem_1, 2071).
+-define(wxTreeCtrl_SelectItem_2, 2072).
+-define(wxTreeCtrl_SetIndent, 2073).
+-define(wxTreeCtrl_SetImageList, 2074).
+-define(wxTreeCtrl_SetItemBackgroundColour, 2075).
+-define(wxTreeCtrl_SetItemBold, 2076).
+-define(wxTreeCtrl_SetItemData, 2077).
+-define(wxTreeCtrl_SetItemDropHighlight, 2078).
+-define(wxTreeCtrl_SetItemFont, 2079).
+-define(wxTreeCtrl_SetItemHasChildren, 2080).
+-define(wxTreeCtrl_SetItemImage_2, 2081).
+-define(wxTreeCtrl_SetItemImage_3, 2082).
+-define(wxTreeCtrl_SetItemText, 2083).
+-define(wxTreeCtrl_SetItemTextColour, 2084).
+-define(wxTreeCtrl_SetStateImageList, 2085).
+-define(wxTreeCtrl_SetWindowStyle, 2086).
+-define(wxTreeCtrl_SortChildren, 2087).
+-define(wxTreeCtrl_Toggle, 2088).
+-define(wxTreeCtrl_ToggleItemSelection, 2089).
+-define(wxTreeCtrl_Unselect, 2090).
+-define(wxTreeCtrl_UnselectAll, 2091).
+-define(wxTreeCtrl_UnselectItem, 2092).
+-define(wxScrollBar_new_0, 2093).
+-define(wxScrollBar_new_3, 2094).
+-define(wxScrollBar_destruct, 2095).
+-define(wxScrollBar_Create, 2096).
+-define(wxScrollBar_GetRange, 2097).
+-define(wxScrollBar_GetPageSize, 2098).
+-define(wxScrollBar_GetThumbPosition, 2099).
+-define(wxScrollBar_GetThumbSize, 2100).
+-define(wxScrollBar_SetThumbPosition, 2101).
+-define(wxScrollBar_SetScrollbar, 2102).
+-define(wxSpinButton_new_2, 2104).
+-define(wxSpinButton_new_0, 2105).
+-define(wxSpinButton_Create, 2106).
+-define(wxSpinButton_GetMax, 2107).
+-define(wxSpinButton_GetMin, 2108).
+-define(wxSpinButton_GetValue, 2109).
+-define(wxSpinButton_SetRange, 2110).
+-define(wxSpinButton_SetValue, 2111).
+-define(wxSpinButton_destroy, 2112).
+-define(wxSpinCtrl_new_0, 2113).
+-define(wxSpinCtrl_new_2, 2114).
+-define(wxSpinCtrl_Create, 2116).
+-define(wxSpinCtrl_SetValue_1_1, 2119).
+-define(wxSpinCtrl_SetValue_1_0, 2120).
+-define(wxSpinCtrl_GetValue, 2122).
+-define(wxSpinCtrl_SetRange, 2124).
+-define(wxSpinCtrl_SetSelection, 2125).
+-define(wxSpinCtrl_GetMin, 2127).
+-define(wxSpinCtrl_GetMax, 2129).
+-define(wxSpinCtrl_destroy, 2130).
+-define(wxStaticText_new_0, 2131).
+-define(wxStaticText_new_4, 2132).
+-define(wxStaticText_Create, 2133).
+-define(wxStaticText_GetLabel, 2134).
+-define(wxStaticText_SetLabel, 2135).
+-define(wxStaticText_Wrap, 2136).
+-define(wxStaticText_destroy, 2137).
+-define(wxStaticBitmap_new_0, 2138).
+-define(wxStaticBitmap_new_4, 2139).
+-define(wxStaticBitmap_Create, 2140).
+-define(wxStaticBitmap_GetBitmap, 2141).
+-define(wxStaticBitmap_SetBitmap, 2142).
+-define(wxStaticBitmap_destroy, 2143).
+-define(wxRadioBox_new, 2144).
+-define(wxRadioBox_destruct, 2146).
+-define(wxRadioBox_Create, 2147).
+-define(wxRadioBox_Enable_2, 2148).
+-define(wxRadioBox_Enable_1, 2149).
+-define(wxRadioBox_GetSelection, 2150).
+-define(wxRadioBox_GetString, 2151).
+-define(wxRadioBox_SetSelection, 2152).
+-define(wxRadioBox_Show_2, 2153).
+-define(wxRadioBox_Show_1, 2154).
+-define(wxRadioBox_GetColumnCount, 2155).
+-define(wxRadioBox_GetItemHelpText, 2156).
+-define(wxRadioBox_GetItemToolTip, 2157).
+-define(wxRadioBox_GetItemFromPoint, 2159).
+-define(wxRadioBox_GetRowCount, 2160).
+-define(wxRadioBox_IsItemEnabled, 2161).
+-define(wxRadioBox_IsItemShown, 2162).
+-define(wxRadioBox_SetItemHelpText, 2163).
+-define(wxRadioBox_SetItemToolTip, 2164).
+-define(wxRadioButton_new_0, 2165).
+-define(wxRadioButton_new_4, 2166).
+-define(wxRadioButton_Create, 2167).
+-define(wxRadioButton_GetValue, 2168).
+-define(wxRadioButton_SetValue, 2169).
+-define(wxRadioButton_destroy, 2170).
+-define(wxSlider_new_6, 2172).
+-define(wxSlider_new_0, 2173).
+-define(wxSlider_Create, 2174).
+-define(wxSlider_GetLineSize, 2175).
+-define(wxSlider_GetMax, 2176).
+-define(wxSlider_GetMin, 2177).
+-define(wxSlider_GetPageSize, 2178).
+-define(wxSlider_GetThumbLength, 2179).
+-define(wxSlider_GetValue, 2180).
+-define(wxSlider_SetLineSize, 2181).
+-define(wxSlider_SetPageSize, 2182).
+-define(wxSlider_SetRange, 2183).
+-define(wxSlider_SetThumbLength, 2184).
+-define(wxSlider_SetValue, 2185).
+-define(wxSlider_destroy, 2186).
+-define(wxDialog_new_4, 2188).
+-define(wxDialog_new_0, 2189).
+-define(wxDialog_destruct, 2191).
+-define(wxDialog_Create, 2192).
+-define(wxDialog_CreateButtonSizer, 2193).
+-define(wxDialog_CreateStdDialogButtonSizer, 2194).
+-define(wxDialog_EndModal, 2195).
+-define(wxDialog_GetAffirmativeId, 2196).
+-define(wxDialog_GetReturnCode, 2197).
+-define(wxDialog_IsModal, 2198).
+-define(wxDialog_SetAffirmativeId, 2199).
+-define(wxDialog_SetReturnCode, 2200).
+-define(wxDialog_Show, 2201).
+-define(wxDialog_ShowModal, 2202).
+-define(wxColourDialog_new_0, 2203).
+-define(wxColourDialog_new_2, 2204).
+-define(wxColourDialog_destruct, 2205).
+-define(wxColourDialog_Create, 2206).
+-define(wxColourDialog_GetColourData, 2207).
+-define(wxColourData_new_0, 2208).
+-define(wxColourData_new_1, 2209).
+-define(wxColourData_destruct, 2210).
+-define(wxColourData_GetChooseFull, 2211).
+-define(wxColourData_GetColour, 2212).
+-define(wxColourData_GetCustomColour, 2214).
+-define(wxColourData_SetChooseFull, 2215).
+-define(wxColourData_SetColour, 2216).
+-define(wxColourData_SetCustomColour, 2217).
+-define(wxPalette_new_0, 2218).
+-define(wxPalette_new_4, 2219).
+-define(wxPalette_destruct, 2221).
+-define(wxPalette_Create, 2222).
+-define(wxPalette_GetColoursCount, 2223).
+-define(wxPalette_GetPixel, 2224).
+-define(wxPalette_GetRGB, 2225).
+-define(wxPalette_IsOk, 2226).
+-define(wxDirDialog_new, 2230).
+-define(wxDirDialog_destruct, 2231).
+-define(wxDirDialog_GetPath, 2232).
+-define(wxDirDialog_GetMessage, 2233).
+-define(wxDirDialog_SetMessage, 2234).
+-define(wxDirDialog_SetPath, 2235).
+-define(wxFileDialog_new, 2239).
+-define(wxFileDialog_destruct, 2240).
+-define(wxFileDialog_GetDirectory, 2241).
+-define(wxFileDialog_GetFilename, 2242).
+-define(wxFileDialog_GetFilenames, 2243).
+-define(wxFileDialog_GetFilterIndex, 2244).
+-define(wxFileDialog_GetMessage, 2245).
+-define(wxFileDialog_GetPath, 2246).
+-define(wxFileDialog_GetPaths, 2247).
+-define(wxFileDialog_GetWildcard, 2248).
+-define(wxFileDialog_SetDirectory, 2249).
+-define(wxFileDialog_SetFilename, 2250).
+-define(wxFileDialog_SetFilterIndex, 2251).
+-define(wxFileDialog_SetMessage, 2252).
+-define(wxFileDialog_SetPath, 2253).
+-define(wxFileDialog_SetWildcard, 2254).
+-define(wxPickerBase_SetInternalMargin, 2255).
+-define(wxPickerBase_GetInternalMargin, 2256).
+-define(wxPickerBase_SetTextCtrlProportion, 2257).
+-define(wxPickerBase_SetPickerCtrlProportion, 2258).
+-define(wxPickerBase_GetTextCtrlProportion, 2259).
+-define(wxPickerBase_GetPickerCtrlProportion, 2260).
+-define(wxPickerBase_HasTextCtrl, 2261).
+-define(wxPickerBase_GetTextCtrl, 2262).
+-define(wxPickerBase_IsTextCtrlGrowable, 2263).
+-define(wxPickerBase_SetPickerCtrlGrowable, 2264).
+-define(wxPickerBase_SetTextCtrlGrowable, 2265).
+-define(wxPickerBase_IsPickerCtrlGrowable, 2266).
+-define(wxFilePickerCtrl_new_0, 2267).
+-define(wxFilePickerCtrl_new_3, 2268).
+-define(wxFilePickerCtrl_Create, 2269).
+-define(wxFilePickerCtrl_GetPath, 2270).
+-define(wxFilePickerCtrl_SetPath, 2271).
+-define(wxFilePickerCtrl_destroy, 2272).
+-define(wxDirPickerCtrl_new_0, 2273).
+-define(wxDirPickerCtrl_new_3, 2274).
+-define(wxDirPickerCtrl_Create, 2275).
+-define(wxDirPickerCtrl_GetPath, 2276).
+-define(wxDirPickerCtrl_SetPath, 2277).
+-define(wxDirPickerCtrl_destroy, 2278).
+-define(wxColourPickerCtrl_new_0, 2279).
+-define(wxColourPickerCtrl_new_3, 2280).
+-define(wxColourPickerCtrl_Create, 2281).
+-define(wxColourPickerCtrl_GetColour, 2282).
+-define(wxColourPickerCtrl_SetColour_1_1, 2283).
+-define(wxColourPickerCtrl_SetColour_1_0, 2284).
+-define(wxColourPickerCtrl_destroy, 2285).
+-define(wxDatePickerCtrl_new_0, 2286).
+-define(wxDatePickerCtrl_new_3, 2287).
+-define(wxDatePickerCtrl_GetRange, 2288).
+-define(wxDatePickerCtrl_GetValue, 2289).
+-define(wxDatePickerCtrl_SetRange, 2290).
+-define(wxDatePickerCtrl_SetValue, 2291).
+-define(wxDatePickerCtrl_destroy, 2292).
+-define(wxFontPickerCtrl_new_0, 2293).
+-define(wxFontPickerCtrl_new_3, 2294).
+-define(wxFontPickerCtrl_Create, 2295).
+-define(wxFontPickerCtrl_GetSelectedFont, 2296).
+-define(wxFontPickerCtrl_SetSelectedFont, 2297).
+-define(wxFontPickerCtrl_GetMaxPointSize, 2298).
+-define(wxFontPickerCtrl_SetMaxPointSize, 2299).
+-define(wxFontPickerCtrl_destroy, 2300).
+-define(wxFindReplaceDialog_new_0, 2303).
+-define(wxFindReplaceDialog_new_4, 2304).
+-define(wxFindReplaceDialog_destruct, 2305).
+-define(wxFindReplaceDialog_Create, 2306).
+-define(wxFindReplaceDialog_GetData, 2307).
+-define(wxFindReplaceData_new_0, 2308).
+-define(wxFindReplaceData_new_1, 2309).
+-define(wxFindReplaceData_GetFindString, 2310).
+-define(wxFindReplaceData_GetReplaceString, 2311).
+-define(wxFindReplaceData_GetFlags, 2312).
+-define(wxFindReplaceData_SetFlags, 2313).
+-define(wxFindReplaceData_SetFindString, 2314).
+-define(wxFindReplaceData_SetReplaceString, 2315).
+-define(wxFindReplaceData_destroy, 2316).
+-define(wxMultiChoiceDialog_new_0, 2317).
+-define(wxMultiChoiceDialog_new_5, 2319).
+-define(wxMultiChoiceDialog_GetSelections, 2320).
+-define(wxMultiChoiceDialog_SetSelections, 2321).
+-define(wxMultiChoiceDialog_destroy, 2322).
+-define(wxSingleChoiceDialog_new_0, 2323).
+-define(wxSingleChoiceDialog_new_5, 2325).
+-define(wxSingleChoiceDialog_GetSelection, 2326).
+-define(wxSingleChoiceDialog_GetStringSelection, 2327).
+-define(wxSingleChoiceDialog_SetSelection, 2328).
+-define(wxSingleChoiceDialog_destroy, 2329).
+-define(wxTextEntryDialog_new, 2330).
+-define(wxTextEntryDialog_GetValue, 2331).
+-define(wxTextEntryDialog_SetValue, 2332).
+-define(wxTextEntryDialog_destroy, 2333).
+-define(wxPasswordEntryDialog_new, 2334).
+-define(wxPasswordEntryDialog_destroy, 2335).
+-define(wxFontData_new_0, 2336).
+-define(wxFontData_new_1, 2337).
+-define(wxFontData_destruct, 2338).
+-define(wxFontData_EnableEffects, 2339).
+-define(wxFontData_GetAllowSymbols, 2340).
+-define(wxFontData_GetColour, 2341).
+-define(wxFontData_GetChosenFont, 2342).
+-define(wxFontData_GetEnableEffects, 2343).
+-define(wxFontData_GetInitialFont, 2344).
+-define(wxFontData_GetShowHelp, 2345).
+-define(wxFontData_SetAllowSymbols, 2346).
+-define(wxFontData_SetChosenFont, 2347).
+-define(wxFontData_SetColour, 2348).
+-define(wxFontData_SetInitialFont, 2349).
+-define(wxFontData_SetRange, 2350).
+-define(wxFontData_SetShowHelp, 2351).
+-define(wxFontDialog_new_0, 2355).
+-define(wxFontDialog_new_2, 2357).
+-define(wxFontDialog_Create, 2359).
+-define(wxFontDialog_GetFontData, 2360).
+-define(wxFontDialog_destroy, 2362).
+-define(wxProgressDialog_new, 2363).
+-define(wxProgressDialog_destruct, 2364).
+-define(wxProgressDialog_Resume, 2365).
+-define(wxProgressDialog_Update_2, 2366).
+-define(wxProgressDialog_Update_0, 2367).
+-define(wxMessageDialog_new, 2368).
+-define(wxMessageDialog_destruct, 2369).
+-define(wxPageSetupDialog_new, 2370).
+-define(wxPageSetupDialog_destruct, 2371).
+-define(wxPageSetupDialog_GetPageSetupData, 2372).
+-define(wxPageSetupDialog_ShowModal, 2373).
+-define(wxPageSetupDialogData_new_0, 2374).
+-define(wxPageSetupDialogData_new_1_0, 2375).
+-define(wxPageSetupDialogData_new_1_1, 2376).
+-define(wxPageSetupDialogData_destruct, 2377).
+-define(wxPageSetupDialogData_EnableHelp, 2378).
+-define(wxPageSetupDialogData_EnableMargins, 2379).
+-define(wxPageSetupDialogData_EnableOrientation, 2380).
+-define(wxPageSetupDialogData_EnablePaper, 2381).
+-define(wxPageSetupDialogData_EnablePrinter, 2382).
+-define(wxPageSetupDialogData_GetDefaultMinMargins, 2383).
+-define(wxPageSetupDialogData_GetEnableMargins, 2384).
+-define(wxPageSetupDialogData_GetEnableOrientation, 2385).
+-define(wxPageSetupDialogData_GetEnablePaper, 2386).
+-define(wxPageSetupDialogData_GetEnablePrinter, 2387).
+-define(wxPageSetupDialogData_GetEnableHelp, 2388).
+-define(wxPageSetupDialogData_GetDefaultInfo, 2389).
+-define(wxPageSetupDialogData_GetMarginTopLeft, 2390).
+-define(wxPageSetupDialogData_GetMarginBottomRight, 2391).
+-define(wxPageSetupDialogData_GetMinMarginTopLeft, 2392).
+-define(wxPageSetupDialogData_GetMinMarginBottomRight, 2393).
+-define(wxPageSetupDialogData_GetPaperId, 2394).
+-define(wxPageSetupDialogData_GetPaperSize, 2395).
+-define(wxPageSetupDialogData_GetPrintData, 2397).
+-define(wxPageSetupDialogData_IsOk, 2398).
+-define(wxPageSetupDialogData_SetDefaultInfo, 2399).
+-define(wxPageSetupDialogData_SetDefaultMinMargins, 2400).
+-define(wxPageSetupDialogData_SetMarginTopLeft, 2401).
+-define(wxPageSetupDialogData_SetMarginBottomRight, 2402).
+-define(wxPageSetupDialogData_SetMinMarginTopLeft, 2403).
+-define(wxPageSetupDialogData_SetMinMarginBottomRight, 2404).
+-define(wxPageSetupDialogData_SetPaperId, 2405).
+-define(wxPageSetupDialogData_SetPaperSize_1_1, 2406).
+-define(wxPageSetupDialogData_SetPaperSize_1_0, 2407).
+-define(wxPageSetupDialogData_SetPrintData, 2408).
+-define(wxPrintDialog_new_2_0, 2409).
+-define(wxPrintDialog_new_2_1, 2410).
+-define(wxPrintDialog_destruct, 2411).
+-define(wxPrintDialog_GetPrintDialogData, 2412).
+-define(wxPrintDialog_GetPrintDC, 2413).
+-define(wxPrintDialogData_new_0, 2414).
+-define(wxPrintDialogData_new_1_1, 2415).
+-define(wxPrintDialogData_new_1_0, 2416).
+-define(wxPrintDialogData_destruct, 2417).
+-define(wxPrintDialogData_EnableHelp, 2418).
+-define(wxPrintDialogData_EnablePageNumbers, 2419).
+-define(wxPrintDialogData_EnablePrintToFile, 2420).
+-define(wxPrintDialogData_EnableSelection, 2421).
+-define(wxPrintDialogData_GetAllPages, 2422).
+-define(wxPrintDialogData_GetCollate, 2423).
+-define(wxPrintDialogData_GetFromPage, 2424).
+-define(wxPrintDialogData_GetMaxPage, 2425).
+-define(wxPrintDialogData_GetMinPage, 2426).
+-define(wxPrintDialogData_GetNoCopies, 2427).
+-define(wxPrintDialogData_GetPrintData, 2428).
+-define(wxPrintDialogData_GetPrintToFile, 2429).
+-define(wxPrintDialogData_GetSelection, 2430).
+-define(wxPrintDialogData_GetToPage, 2431).
+-define(wxPrintDialogData_IsOk, 2432).
+-define(wxPrintDialogData_SetCollate, 2433).
+-define(wxPrintDialogData_SetFromPage, 2434).
+-define(wxPrintDialogData_SetMaxPage, 2435).
+-define(wxPrintDialogData_SetMinPage, 2436).
+-define(wxPrintDialogData_SetNoCopies, 2437).
+-define(wxPrintDialogData_SetPrintData, 2438).
+-define(wxPrintDialogData_SetPrintToFile, 2439).
+-define(wxPrintDialogData_SetSelection, 2440).
+-define(wxPrintDialogData_SetToPage, 2441).
+-define(wxPrintData_new_0, 2442).
+-define(wxPrintData_new_1, 2443).
+-define(wxPrintData_destruct, 2444).
+-define(wxPrintData_GetCollate, 2445).
+-define(wxPrintData_GetBin, 2446).
+-define(wxPrintData_GetColour, 2447).
+-define(wxPrintData_GetDuplex, 2448).
+-define(wxPrintData_GetNoCopies, 2449).
+-define(wxPrintData_GetOrientation, 2450).
+-define(wxPrintData_GetPaperId, 2451).
+-define(wxPrintData_GetPrinterName, 2452).
+-define(wxPrintData_GetQuality, 2453).
+-define(wxPrintData_IsOk, 2454).
+-define(wxPrintData_SetBin, 2455).
+-define(wxPrintData_SetCollate, 2456).
+-define(wxPrintData_SetColour, 2457).
+-define(wxPrintData_SetDuplex, 2458).
+-define(wxPrintData_SetNoCopies, 2459).
+-define(wxPrintData_SetOrientation, 2460).
+-define(wxPrintData_SetPaperId, 2461).
+-define(wxPrintData_SetPrinterName, 2462).
+-define(wxPrintData_SetQuality, 2463).
+-define(wxPrintPreview_new_2, 2466).
+-define(wxPrintPreview_new_3, 2467).
+-define(wxPrintPreview_destruct, 2469).
+-define(wxPrintPreview_GetCanvas, 2470).
+-define(wxPrintPreview_GetCurrentPage, 2471).
+-define(wxPrintPreview_GetFrame, 2472).
+-define(wxPrintPreview_GetMaxPage, 2473).
+-define(wxPrintPreview_GetMinPage, 2474).
+-define(wxPrintPreview_GetPrintout, 2475).
+-define(wxPrintPreview_GetPrintoutForPrinting, 2476).
+-define(wxPrintPreview_IsOk, 2477).
+-define(wxPrintPreview_PaintPage, 2478).
+-define(wxPrintPreview_Print, 2479).
+-define(wxPrintPreview_RenderPage, 2480).
+-define(wxPrintPreview_SetCanvas, 2481).
+-define(wxPrintPreview_SetCurrentPage, 2482).
+-define(wxPrintPreview_SetFrame, 2483).
+-define(wxPrintPreview_SetPrintout, 2484).
+-define(wxPrintPreview_SetZoom, 2485).
+-define(wxPreviewFrame_new, 2486).
+-define(wxPreviewFrame_destruct, 2487).
+-define(wxPreviewFrame_CreateControlBar, 2488).
+-define(wxPreviewFrame_CreateCanvas, 2489).
+-define(wxPreviewFrame_Initialize, 2490).
+-define(wxPreviewFrame_OnCloseWindow, 2491).
+-define(wxPreviewControlBar_new, 2492).
+-define(wxPreviewControlBar_destruct, 2493).
+-define(wxPreviewControlBar_CreateButtons, 2494).
+-define(wxPreviewControlBar_GetPrintPreview, 2495).
+-define(wxPreviewControlBar_GetZoomControl, 2496).
+-define(wxPreviewControlBar_SetZoomControl, 2497).
+-define(wxPrinter_new, 2499).
+-define(wxPrinter_CreateAbortWindow, 2500).
+-define(wxPrinter_GetAbort, 2501).
+-define(wxPrinter_GetLastError, 2502).
+-define(wxPrinter_GetPrintDialogData, 2503).
+-define(wxPrinter_Print, 2504).
+-define(wxPrinter_PrintDialog, 2505).
+-define(wxPrinter_ReportError, 2506).
+-define(wxPrinter_Setup, 2507).
+-define(wxPrinter_destroy, 2508).
+-define(wxXmlResource_new_1, 2509).
+-define(wxXmlResource_new_2, 2510).
+-define(wxXmlResource_destruct, 2511).
+-define(wxXmlResource_AttachUnknownControl, 2512).
+-define(wxXmlResource_ClearHandlers, 2513).
+-define(wxXmlResource_CompareVersion, 2514).
+-define(wxXmlResource_Get, 2515).
+-define(wxXmlResource_GetFlags, 2516).
+-define(wxXmlResource_GetVersion, 2517).
+-define(wxXmlResource_GetXRCID, 2518).
+-define(wxXmlResource_InitAllHandlers, 2519).
+-define(wxXmlResource_Load, 2520).
+-define(wxXmlResource_LoadBitmap, 2521).
+-define(wxXmlResource_LoadDialog_2, 2522).
+-define(wxXmlResource_LoadDialog_3, 2523).
+-define(wxXmlResource_LoadFrame_2, 2524).
+-define(wxXmlResource_LoadFrame_3, 2525).
+-define(wxXmlResource_LoadIcon, 2526).
+-define(wxXmlResource_LoadMenu, 2527).
+-define(wxXmlResource_LoadMenuBar_2, 2528).
+-define(wxXmlResource_LoadMenuBar_1, 2529).
+-define(wxXmlResource_LoadPanel_2, 2530).
+-define(wxXmlResource_LoadPanel_3, 2531).
+-define(wxXmlResource_LoadToolBar, 2532).
+-define(wxXmlResource_Set, 2533).
+-define(wxXmlResource_SetFlags, 2534).
+-define(wxXmlResource_Unload, 2535).
+-define(wxXmlResource_xrcctrl, 2536).
+-define(wxHtmlEasyPrinting_new, 2537).
+-define(wxHtmlEasyPrinting_destruct, 2538).
+-define(wxHtmlEasyPrinting_GetPrintData, 2539).
+-define(wxHtmlEasyPrinting_GetPageSetupData, 2540).
+-define(wxHtmlEasyPrinting_PreviewFile, 2541).
+-define(wxHtmlEasyPrinting_PreviewText, 2542).
+-define(wxHtmlEasyPrinting_PrintFile, 2543).
+-define(wxHtmlEasyPrinting_PrintText, 2544).
+-define(wxHtmlEasyPrinting_PageSetup, 2545).
+-define(wxHtmlEasyPrinting_SetFonts, 2546).
+-define(wxHtmlEasyPrinting_SetHeader, 2547).
+-define(wxHtmlEasyPrinting_SetFooter, 2548).
+-define(wxGLCanvas_new_2, 2550).
+-define(wxGLCanvas_new_3_1, 2551).
+-define(wxGLCanvas_new_3_0, 2552).
+-define(wxGLCanvas_GetContext, 2553).
+-define(wxGLCanvas_SetCurrent, 2555).
+-define(wxGLCanvas_SwapBuffers, 2556).
+-define(wxGLCanvas_destroy, 2557).
+-define(wxAuiManager_new, 2558).
+-define(wxAuiManager_destruct, 2559).
+-define(wxAuiManager_AddPane_2_1, 2560).
+-define(wxAuiManager_AddPane_3, 2561).
+-define(wxAuiManager_AddPane_2_0, 2562).
+-define(wxAuiManager_DetachPane, 2563).
+-define(wxAuiManager_GetAllPanes, 2564).
+-define(wxAuiManager_GetArtProvider, 2565).
+-define(wxAuiManager_GetDockSizeConstraint, 2566).
+-define(wxAuiManager_GetFlags, 2567).
+-define(wxAuiManager_GetManagedWindow, 2568).
+-define(wxAuiManager_GetManager, 2569).
+-define(wxAuiManager_GetPane_1_1, 2570).
+-define(wxAuiManager_GetPane_1_0, 2571).
+-define(wxAuiManager_HideHint, 2572).
+-define(wxAuiManager_InsertPane, 2573).
+-define(wxAuiManager_LoadPaneInfo, 2574).
+-define(wxAuiManager_LoadPerspective, 2575).
+-define(wxAuiManager_SavePaneInfo, 2576).
+-define(wxAuiManager_SavePerspective, 2577).
+-define(wxAuiManager_SetArtProvider, 2578).
+-define(wxAuiManager_SetDockSizeConstraint, 2579).
+-define(wxAuiManager_SetFlags, 2580).
+-define(wxAuiManager_SetManagedWindow, 2581).
+-define(wxAuiManager_ShowHint, 2582).
+-define(wxAuiManager_UnInit, 2583).
+-define(wxAuiManager_Update, 2584).
+-define(wxAuiPaneInfo_new_0, 2585).
+-define(wxAuiPaneInfo_new_1, 2586).
+-define(wxAuiPaneInfo_destruct, 2587).
+-define(wxAuiPaneInfo_BestSize_1, 2588).
+-define(wxAuiPaneInfo_BestSize_2, 2589).
+-define(wxAuiPaneInfo_Bottom, 2590).
+-define(wxAuiPaneInfo_BottomDockable, 2591).
+-define(wxAuiPaneInfo_Caption, 2592).
+-define(wxAuiPaneInfo_CaptionVisible, 2593).
+-define(wxAuiPaneInfo_Centre, 2594).
+-define(wxAuiPaneInfo_CentrePane, 2595).
+-define(wxAuiPaneInfo_CloseButton, 2596).
+-define(wxAuiPaneInfo_DefaultPane, 2597).
+-define(wxAuiPaneInfo_DestroyOnClose, 2598).
+-define(wxAuiPaneInfo_Direction, 2599).
+-define(wxAuiPaneInfo_Dock, 2600).
+-define(wxAuiPaneInfo_Dockable, 2601).
+-define(wxAuiPaneInfo_Fixed, 2602).
+-define(wxAuiPaneInfo_Float, 2603).
+-define(wxAuiPaneInfo_Floatable, 2604).
+-define(wxAuiPaneInfo_FloatingPosition_1, 2605).
+-define(wxAuiPaneInfo_FloatingPosition_2, 2606).
+-define(wxAuiPaneInfo_FloatingSize_1, 2607).
+-define(wxAuiPaneInfo_FloatingSize_2, 2608).
+-define(wxAuiPaneInfo_Gripper, 2609).
+-define(wxAuiPaneInfo_GripperTop, 2610).
+-define(wxAuiPaneInfo_HasBorder, 2611).
+-define(wxAuiPaneInfo_HasCaption, 2612).
+-define(wxAuiPaneInfo_HasCloseButton, 2613).
+-define(wxAuiPaneInfo_HasFlag, 2614).
+-define(wxAuiPaneInfo_HasGripper, 2615).
+-define(wxAuiPaneInfo_HasGripperTop, 2616).
+-define(wxAuiPaneInfo_HasMaximizeButton, 2617).
+-define(wxAuiPaneInfo_HasMinimizeButton, 2618).
+-define(wxAuiPaneInfo_HasPinButton, 2619).
+-define(wxAuiPaneInfo_Hide, 2620).
+-define(wxAuiPaneInfo_IsBottomDockable, 2621).
+-define(wxAuiPaneInfo_IsDocked, 2622).
+-define(wxAuiPaneInfo_IsFixed, 2623).
+-define(wxAuiPaneInfo_IsFloatable, 2624).
+-define(wxAuiPaneInfo_IsFloating, 2625).
+-define(wxAuiPaneInfo_IsLeftDockable, 2626).
+-define(wxAuiPaneInfo_IsMovable, 2627).
+-define(wxAuiPaneInfo_IsOk, 2628).
+-define(wxAuiPaneInfo_IsResizable, 2629).
+-define(wxAuiPaneInfo_IsRightDockable, 2630).
+-define(wxAuiPaneInfo_IsShown, 2631).
+-define(wxAuiPaneInfo_IsToolbar, 2632).
+-define(wxAuiPaneInfo_IsTopDockable, 2633).
+-define(wxAuiPaneInfo_Layer, 2634).
+-define(wxAuiPaneInfo_Left, 2635).
+-define(wxAuiPaneInfo_LeftDockable, 2636).
+-define(wxAuiPaneInfo_MaxSize_1, 2637).
+-define(wxAuiPaneInfo_MaxSize_2, 2638).
+-define(wxAuiPaneInfo_MaximizeButton, 2639).
+-define(wxAuiPaneInfo_MinSize_1, 2640).
+-define(wxAuiPaneInfo_MinSize_2, 2641).
+-define(wxAuiPaneInfo_MinimizeButton, 2642).
+-define(wxAuiPaneInfo_Movable, 2643).
+-define(wxAuiPaneInfo_Name, 2644).
+-define(wxAuiPaneInfo_PaneBorder, 2645).
+-define(wxAuiPaneInfo_PinButton, 2646).
+-define(wxAuiPaneInfo_Position, 2647).
+-define(wxAuiPaneInfo_Resizable, 2648).
+-define(wxAuiPaneInfo_Right, 2649).
+-define(wxAuiPaneInfo_RightDockable, 2650).
+-define(wxAuiPaneInfo_Row, 2651).
+-define(wxAuiPaneInfo_SafeSet, 2652).
+-define(wxAuiPaneInfo_SetFlag, 2653).
+-define(wxAuiPaneInfo_Show, 2654).
+-define(wxAuiPaneInfo_ToolbarPane, 2655).
+-define(wxAuiPaneInfo_Top, 2656).
+-define(wxAuiPaneInfo_TopDockable, 2657).
+-define(wxAuiPaneInfo_Window, 2658).
+-define(wxAuiPaneInfo_GetWindow, 2659).
+-define(wxAuiPaneInfo_GetFrame, 2660).
+-define(wxAuiPaneInfo_GetDirection, 2661).
+-define(wxAuiPaneInfo_GetLayer, 2662).
+-define(wxAuiPaneInfo_GetRow, 2663).
+-define(wxAuiPaneInfo_GetPosition, 2664).
+-define(wxAuiPaneInfo_GetFloatingPosition, 2665).
+-define(wxAuiPaneInfo_GetFloatingSize, 2666).
+-define(wxAuiNotebook_new_0, 2667).
+-define(wxAuiNotebook_new_2, 2668).
+-define(wxAuiNotebook_AddPage, 2669).
+-define(wxAuiNotebook_Create, 2670).
+-define(wxAuiNotebook_DeletePage, 2671).
+-define(wxAuiNotebook_GetArtProvider, 2672).
+-define(wxAuiNotebook_GetPage, 2673).
+-define(wxAuiNotebook_GetPageBitmap, 2674).
+-define(wxAuiNotebook_GetPageCount, 2675).
+-define(wxAuiNotebook_GetPageIndex, 2676).
+-define(wxAuiNotebook_GetPageText, 2677).
+-define(wxAuiNotebook_GetSelection, 2678).
+-define(wxAuiNotebook_InsertPage, 2679).
+-define(wxAuiNotebook_RemovePage, 2680).
+-define(wxAuiNotebook_SetArtProvider, 2681).
+-define(wxAuiNotebook_SetFont, 2682).
+-define(wxAuiNotebook_SetPageBitmap, 2683).
+-define(wxAuiNotebook_SetPageText, 2684).
+-define(wxAuiNotebook_SetSelection, 2685).
+-define(wxAuiNotebook_SetTabCtrlHeight, 2686).
+-define(wxAuiNotebook_SetUniformBitmapSize, 2687).
+-define(wxAuiNotebook_destroy, 2688).
+-define(wxAuiTabArt_SetFlags, 2689).
+-define(wxAuiTabArt_SetMeasuringFont, 2690).
+-define(wxAuiTabArt_SetNormalFont, 2691).
+-define(wxAuiTabArt_SetSelectedFont, 2692).
+-define(wxAuiTabArt_SetColour, 2693).
+-define(wxAuiTabArt_SetActiveColour, 2694).
+-define(wxAuiDockArt_GetColour, 2695).
+-define(wxAuiDockArt_GetFont, 2696).
+-define(wxAuiDockArt_GetMetric, 2697).
+-define(wxAuiDockArt_SetColour, 2698).
+-define(wxAuiDockArt_SetFont, 2699).
+-define(wxAuiDockArt_SetMetric, 2700).
+-define(wxAuiSimpleTabArt_new, 2701).
+-define(wxAuiSimpleTabArt_destroy, 2702).
+-define(wxMDIParentFrame_new_0, 2703).
+-define(wxMDIParentFrame_new_4, 2704).
+-define(wxMDIParentFrame_destruct, 2705).
+-define(wxMDIParentFrame_ActivateNext, 2706).
+-define(wxMDIParentFrame_ActivatePrevious, 2707).
+-define(wxMDIParentFrame_ArrangeIcons, 2708).
+-define(wxMDIParentFrame_Cascade, 2709).
+-define(wxMDIParentFrame_Create, 2710).
+-define(wxMDIParentFrame_GetActiveChild, 2711).
+-define(wxMDIParentFrame_GetClientWindow, 2712).
+-define(wxMDIParentFrame_Tile, 2713).
+-define(wxMDIChildFrame_new_0, 2714).
+-define(wxMDIChildFrame_new_4, 2715).
+-define(wxMDIChildFrame_destruct, 2716).
+-define(wxMDIChildFrame_Activate, 2717).
+-define(wxMDIChildFrame_Create, 2718).
+-define(wxMDIChildFrame_Maximize, 2719).
+-define(wxMDIChildFrame_Restore, 2720).
+-define(wxMDIClientWindow_new_0, 2721).
+-define(wxMDIClientWindow_new_2, 2722).
+-define(wxMDIClientWindow_destruct, 2723).
+-define(wxMDIClientWindow_CreateClient, 2724).
+-define(wxLayoutAlgorithm_new, 2725).
+-define(wxLayoutAlgorithm_LayoutFrame, 2726).
+-define(wxLayoutAlgorithm_LayoutMDIFrame, 2727).
+-define(wxLayoutAlgorithm_LayoutWindow, 2728).
+-define(wxLayoutAlgorithm_destroy, 2729).
+-define(wxEvent_GetId, 2730).
+-define(wxEvent_GetSkipped, 2731).
+-define(wxEvent_GetTimestamp, 2732).
+-define(wxEvent_IsCommandEvent, 2733).
+-define(wxEvent_ResumePropagation, 2734).
+-define(wxEvent_ShouldPropagate, 2735).
+-define(wxEvent_Skip, 2736).
+-define(wxEvent_StopPropagation, 2737).
+-define(wxCommandEvent_getClientData, 2738).
+-define(wxCommandEvent_GetExtraLong, 2739).
+-define(wxCommandEvent_GetInt, 2740).
+-define(wxCommandEvent_GetSelection, 2741).
+-define(wxCommandEvent_GetString, 2742).
+-define(wxCommandEvent_IsChecked, 2743).
+-define(wxCommandEvent_IsSelection, 2744).
+-define(wxCommandEvent_SetInt, 2745).
+-define(wxCommandEvent_SetString, 2746).
+-define(wxScrollEvent_GetOrientation, 2747).
+-define(wxScrollEvent_GetPosition, 2748).
+-define(wxScrollWinEvent_GetOrientation, 2749).
+-define(wxScrollWinEvent_GetPosition, 2750).
+-define(wxMouseEvent_AltDown, 2751).
+-define(wxMouseEvent_Button, 2752).
+-define(wxMouseEvent_ButtonDClick, 2753).
+-define(wxMouseEvent_ButtonDown, 2754).
+-define(wxMouseEvent_ButtonUp, 2755).
+-define(wxMouseEvent_CmdDown, 2756).
+-define(wxMouseEvent_ControlDown, 2757).
+-define(wxMouseEvent_Dragging, 2758).
+-define(wxMouseEvent_Entering, 2759).
+-define(wxMouseEvent_GetButton, 2760).
+-define(wxMouseEvent_GetPosition, 2763).
+-define(wxMouseEvent_GetLogicalPosition, 2764).
+-define(wxMouseEvent_GetLinesPerAction, 2765).
+-define(wxMouseEvent_GetWheelRotation, 2766).
+-define(wxMouseEvent_GetWheelDelta, 2767).
+-define(wxMouseEvent_GetX, 2768).
+-define(wxMouseEvent_GetY, 2769).
+-define(wxMouseEvent_IsButton, 2770).
+-define(wxMouseEvent_IsPageScroll, 2771).
+-define(wxMouseEvent_Leaving, 2772).
+-define(wxMouseEvent_LeftDClick, 2773).
+-define(wxMouseEvent_LeftDown, 2774).
+-define(wxMouseEvent_LeftIsDown, 2775).
+-define(wxMouseEvent_LeftUp, 2776).
+-define(wxMouseEvent_MetaDown, 2777).
+-define(wxMouseEvent_MiddleDClick, 2778).
+-define(wxMouseEvent_MiddleDown, 2779).
+-define(wxMouseEvent_MiddleIsDown, 2780).
+-define(wxMouseEvent_MiddleUp, 2781).
+-define(wxMouseEvent_Moving, 2782).
+-define(wxMouseEvent_RightDClick, 2783).
+-define(wxMouseEvent_RightDown, 2784).
+-define(wxMouseEvent_RightIsDown, 2785).
+-define(wxMouseEvent_RightUp, 2786).
+-define(wxMouseEvent_ShiftDown, 2787).
+-define(wxSetCursorEvent_GetCursor, 2788).
+-define(wxSetCursorEvent_GetX, 2789).
+-define(wxSetCursorEvent_GetY, 2790).
+-define(wxSetCursorEvent_HasCursor, 2791).
+-define(wxSetCursorEvent_SetCursor, 2792).
+-define(wxKeyEvent_AltDown, 2793).
+-define(wxKeyEvent_CmdDown, 2794).
+-define(wxKeyEvent_ControlDown, 2795).
+-define(wxKeyEvent_GetKeyCode, 2796).
+-define(wxKeyEvent_GetModifiers, 2797).
+-define(wxKeyEvent_GetPosition, 2800).
+-define(wxKeyEvent_GetRawKeyCode, 2801).
+-define(wxKeyEvent_GetRawKeyFlags, 2802).
+-define(wxKeyEvent_GetUnicodeKey, 2803).
+-define(wxKeyEvent_GetX, 2804).
+-define(wxKeyEvent_GetY, 2805).
+-define(wxKeyEvent_HasModifiers, 2806).
+-define(wxKeyEvent_MetaDown, 2807).
+-define(wxKeyEvent_ShiftDown, 2808).
+-define(wxSizeEvent_GetSize, 2809).
+-define(wxMoveEvent_GetPosition, 2810).
+-define(wxEraseEvent_GetDC, 2811).
+-define(wxFocusEvent_GetWindow, 2812).
+-define(wxChildFocusEvent_GetWindow, 2813).
+-define(wxMenuEvent_GetMenu, 2814).
+-define(wxMenuEvent_GetMenuId, 2815).
+-define(wxMenuEvent_IsPopup, 2816).
+-define(wxCloseEvent_CanVeto, 2817).
+-define(wxCloseEvent_GetLoggingOff, 2818).
+-define(wxCloseEvent_SetCanVeto, 2819).
+-define(wxCloseEvent_SetLoggingOff, 2820).
+-define(wxCloseEvent_Veto, 2821).
+-define(wxShowEvent_SetShow, 2822).
+-define(wxShowEvent_GetShow, 2823).
+-define(wxIconizeEvent_Iconized, 2824).
+-define(wxJoystickEvent_ButtonDown, 2825).
+-define(wxJoystickEvent_ButtonIsDown, 2826).
+-define(wxJoystickEvent_ButtonUp, 2827).
+-define(wxJoystickEvent_GetButtonChange, 2828).
+-define(wxJoystickEvent_GetButtonState, 2829).
+-define(wxJoystickEvent_GetJoystick, 2830).
+-define(wxJoystickEvent_GetPosition, 2831).
+-define(wxJoystickEvent_GetZPosition, 2832).
+-define(wxJoystickEvent_IsButton, 2833).
+-define(wxJoystickEvent_IsMove, 2834).
+-define(wxJoystickEvent_IsZMove, 2835).
+-define(wxUpdateUIEvent_CanUpdate, 2836).
+-define(wxUpdateUIEvent_Check, 2837).
+-define(wxUpdateUIEvent_Enable, 2838).
+-define(wxUpdateUIEvent_Show, 2839).
+-define(wxUpdateUIEvent_GetChecked, 2840).
+-define(wxUpdateUIEvent_GetEnabled, 2841).
+-define(wxUpdateUIEvent_GetShown, 2842).
+-define(wxUpdateUIEvent_GetSetChecked, 2843).
+-define(wxUpdateUIEvent_GetSetEnabled, 2844).
+-define(wxUpdateUIEvent_GetSetShown, 2845).
+-define(wxUpdateUIEvent_GetSetText, 2846).
+-define(wxUpdateUIEvent_GetText, 2847).
+-define(wxUpdateUIEvent_GetMode, 2848).
+-define(wxUpdateUIEvent_GetUpdateInterval, 2849).
+-define(wxUpdateUIEvent_ResetUpdateTime, 2850).
+-define(wxUpdateUIEvent_SetMode, 2851).
+-define(wxUpdateUIEvent_SetText, 2852).
+-define(wxUpdateUIEvent_SetUpdateInterval, 2853).
+-define(wxMouseCaptureChangedEvent_GetCapturedWindow, 2854).
+-define(wxPaletteChangedEvent_SetChangedWindow, 2855).
+-define(wxPaletteChangedEvent_GetChangedWindow, 2856).
+-define(wxQueryNewPaletteEvent_SetPaletteRealized, 2857).
+-define(wxQueryNewPaletteEvent_GetPaletteRealized, 2858).
+-define(wxNavigationKeyEvent_GetDirection, 2859).
+-define(wxNavigationKeyEvent_SetDirection, 2860).
+-define(wxNavigationKeyEvent_IsWindowChange, 2861).
+-define(wxNavigationKeyEvent_SetWindowChange, 2862).
+-define(wxNavigationKeyEvent_IsFromTab, 2863).
+-define(wxNavigationKeyEvent_SetFromTab, 2864).
+-define(wxNavigationKeyEvent_GetCurrentFocus, 2865).
+-define(wxNavigationKeyEvent_SetCurrentFocus, 2866).
+-define(wxHelpEvent_GetOrigin, 2867).
+-define(wxHelpEvent_GetPosition, 2868).
+-define(wxHelpEvent_SetOrigin, 2869).
+-define(wxHelpEvent_SetPosition, 2870).
+-define(wxContextMenuEvent_GetPosition, 2871).
+-define(wxContextMenuEvent_SetPosition, 2872).
+-define(wxIdleEvent_CanSend, 2873).
+-define(wxIdleEvent_GetMode, 2874).
+-define(wxIdleEvent_RequestMore, 2875).
+-define(wxIdleEvent_MoreRequested, 2876).
+-define(wxIdleEvent_SetMode, 2877).
+-define(wxGridEvent_AltDown, 2878).
+-define(wxGridEvent_ControlDown, 2879).
+-define(wxGridEvent_GetCol, 2880).
+-define(wxGridEvent_GetPosition, 2881).
+-define(wxGridEvent_GetRow, 2882).
+-define(wxGridEvent_MetaDown, 2883).
+-define(wxGridEvent_Selecting, 2884).
+-define(wxGridEvent_ShiftDown, 2885).
+-define(wxNotifyEvent_Allow, 2886).
+-define(wxNotifyEvent_IsAllowed, 2887).
+-define(wxNotifyEvent_Veto, 2888).
+-define(wxSashEvent_GetEdge, 2889).
+-define(wxSashEvent_GetDragRect, 2890).
+-define(wxSashEvent_GetDragStatus, 2891).
+-define(wxListEvent_GetCacheFrom, 2892).
+-define(wxListEvent_GetCacheTo, 2893).
+-define(wxListEvent_GetKeyCode, 2894).
+-define(wxListEvent_GetIndex, 2895).
+-define(wxListEvent_GetColumn, 2896).
+-define(wxListEvent_GetPoint, 2897).
+-define(wxListEvent_GetLabel, 2898).
+-define(wxListEvent_GetText, 2899).
+-define(wxListEvent_GetImage, 2900).
+-define(wxListEvent_GetData, 2901).
+-define(wxListEvent_GetMask, 2902).
+-define(wxListEvent_GetItem, 2903).
+-define(wxListEvent_IsEditCancelled, 2904).
+-define(wxDateEvent_GetDate, 2905).
+-define(wxCalendarEvent_GetWeekDay, 2906).
+-define(wxFileDirPickerEvent_GetPath, 2907).
+-define(wxColourPickerEvent_GetColour, 2908).
+-define(wxFontPickerEvent_GetFont, 2909).
+-define(wxStyledTextEvent_GetPosition, 2910).
+-define(wxStyledTextEvent_GetKey, 2911).
+-define(wxStyledTextEvent_GetModifiers, 2912).
+-define(wxStyledTextEvent_GetModificationType, 2913).
+-define(wxStyledTextEvent_GetText, 2914).
+-define(wxStyledTextEvent_GetLength, 2915).
+-define(wxStyledTextEvent_GetLinesAdded, 2916).
+-define(wxStyledTextEvent_GetLine, 2917).
+-define(wxStyledTextEvent_GetFoldLevelNow, 2918).
+-define(wxStyledTextEvent_GetFoldLevelPrev, 2919).
+-define(wxStyledTextEvent_GetMargin, 2920).
+-define(wxStyledTextEvent_GetMessage, 2921).
+-define(wxStyledTextEvent_GetWParam, 2922).
+-define(wxStyledTextEvent_GetLParam, 2923).
+-define(wxStyledTextEvent_GetListType, 2924).
+-define(wxStyledTextEvent_GetX, 2925).
+-define(wxStyledTextEvent_GetY, 2926).
+-define(wxStyledTextEvent_GetDragText, 2927).
+-define(wxStyledTextEvent_GetDragAllowMove, 2928).
+-define(wxStyledTextEvent_GetDragResult, 2929).
+-define(wxStyledTextEvent_GetShift, 2930).
+-define(wxStyledTextEvent_GetControl, 2931).
+-define(wxStyledTextEvent_GetAlt, 2932).
+-define(utils_wxGetKeyState, 2933).
+-define(utils_wxGetMousePosition, 2934).
+-define(utils_wxGetMouseState, 2935).
+-define(utils_wxSetDetectableAutoRepeat, 2936).
+-define(utils_wxBell, 2937).
+-define(utils_wxFindMenuItemId, 2938).
+-define(utils_wxGenericFindWindowAtPoint, 2939).
+-define(utils_wxFindWindowAtPoint, 2940).
+-define(utils_wxBeginBusyCursor, 2941).
+-define(utils_wxEndBusyCursor, 2942).
+-define(utils_wxIsBusy, 2943).
+-define(utils_wxShutdown, 2944).
+-define(utils_wxShell, 2945).
+-define(utils_wxLaunchDefaultBrowser, 2946).
+-define(utils_wxGetEmailAddress, 2947).
+-define(utils_wxGetUserId, 2948).
+-define(utils_wxGetHomeDir, 2949).
+-define(utils_wxNewId, 2950).
+-define(utils_wxRegisterId, 2951).
+-define(utils_wxGetCurrentId, 2952).
+-define(utils_wxGetOsDescription, 2953).
+-define(utils_wxIsPlatformLittleEndian, 2954).
+-define(utils_wxIsPlatform64Bit, 2955).
+-define(gdicmn_wxDisplaySize, 2956).
+-define(gdicmn_wxSetCursor, 2957).
+-define(wxPrintout_new, 2958).
+-define(wxPrintout_destruct, 2959).
+-define(wxPrintout_GetDC, 2960).
+-define(wxPrintout_GetPageSizeMM, 2961).
+-define(wxPrintout_GetPageSizePixels, 2962).
+-define(wxPrintout_GetPaperRectPixels, 2963).
+-define(wxPrintout_GetPPIPrinter, 2964).
+-define(wxPrintout_GetPPIScreen, 2965).
+-define(wxPrintout_GetTitle, 2966).
+-define(wxPrintout_IsPreview, 2967).
+-define(wxPrintout_FitThisSizeToPaper, 2968).
+-define(wxPrintout_FitThisSizeToPage, 2969).
+-define(wxPrintout_FitThisSizeToPageMargins, 2970).
+-define(wxPrintout_MapScreenSizeToPaper, 2971).
+-define(wxPrintout_MapScreenSizeToPage, 2972).
+-define(wxPrintout_MapScreenSizeToPageMargins, 2973).
+-define(wxPrintout_MapScreenSizeToDevice, 2974).
+-define(wxPrintout_GetLogicalPaperRect, 2975).
+-define(wxPrintout_GetLogicalPageRect, 2976).
+-define(wxPrintout_GetLogicalPageMarginsRect, 2977).
+-define(wxPrintout_SetLogicalOrigin, 2978).
+-define(wxPrintout_OffsetLogicalOrigin, 2979).
+-define(wxStyledTextCtrl_new_2, 2980).
+-define(wxStyledTextCtrl_new_0, 2981).
+-define(wxStyledTextCtrl_destruct, 2982).
+-define(wxStyledTextCtrl_Create, 2983).
+-define(wxStyledTextCtrl_AddText, 2984).
+-define(wxStyledTextCtrl_AddStyledText, 2985).
+-define(wxStyledTextCtrl_InsertText, 2986).
+-define(wxStyledTextCtrl_ClearAll, 2987).
+-define(wxStyledTextCtrl_ClearDocumentStyle, 2988).
+-define(wxStyledTextCtrl_GetLength, 2989).
+-define(wxStyledTextCtrl_GetCharAt, 2990).
+-define(wxStyledTextCtrl_GetCurrentPos, 2991).
+-define(wxStyledTextCtrl_GetAnchor, 2992).
+-define(wxStyledTextCtrl_GetStyleAt, 2993).
+-define(wxStyledTextCtrl_Redo, 2994).
+-define(wxStyledTextCtrl_SetUndoCollection, 2995).
+-define(wxStyledTextCtrl_SelectAll, 2996).
+-define(wxStyledTextCtrl_SetSavePoint, 2997).
+-define(wxStyledTextCtrl_GetStyledText, 2998).
+-define(wxStyledTextCtrl_CanRedo, 2999).
+-define(wxStyledTextCtrl_MarkerLineFromHandle, 3000).
+-define(wxStyledTextCtrl_MarkerDeleteHandle, 3001).
+-define(wxStyledTextCtrl_GetUndoCollection, 3002).
+-define(wxStyledTextCtrl_GetViewWhiteSpace, 3003).
+-define(wxStyledTextCtrl_SetViewWhiteSpace, 3004).
+-define(wxStyledTextCtrl_PositionFromPoint, 3005).
+-define(wxStyledTextCtrl_PositionFromPointClose, 3006).
+-define(wxStyledTextCtrl_GotoLine, 3007).
+-define(wxStyledTextCtrl_GotoPos, 3008).
+-define(wxStyledTextCtrl_SetAnchor, 3009).
+-define(wxStyledTextCtrl_GetCurLine, 3010).
+-define(wxStyledTextCtrl_GetEndStyled, 3011).
+-define(wxStyledTextCtrl_ConvertEOLs, 3012).
+-define(wxStyledTextCtrl_GetEOLMode, 3013).
+-define(wxStyledTextCtrl_SetEOLMode, 3014).
+-define(wxStyledTextCtrl_StartStyling, 3015).
+-define(wxStyledTextCtrl_SetStyling, 3016).
+-define(wxStyledTextCtrl_GetBufferedDraw, 3017).
+-define(wxStyledTextCtrl_SetBufferedDraw, 3018).
+-define(wxStyledTextCtrl_SetTabWidth, 3019).
+-define(wxStyledTextCtrl_GetTabWidth, 3020).
+-define(wxStyledTextCtrl_SetCodePage, 3021).
+-define(wxStyledTextCtrl_MarkerDefine, 3022).
+-define(wxStyledTextCtrl_MarkerSetForeground, 3023).
+-define(wxStyledTextCtrl_MarkerSetBackground, 3024).
+-define(wxStyledTextCtrl_MarkerAdd, 3025).
+-define(wxStyledTextCtrl_MarkerDelete, 3026).
+-define(wxStyledTextCtrl_MarkerDeleteAll, 3027).
+-define(wxStyledTextCtrl_MarkerGet, 3028).
+-define(wxStyledTextCtrl_MarkerNext, 3029).
+-define(wxStyledTextCtrl_MarkerPrevious, 3030).
+-define(wxStyledTextCtrl_MarkerDefineBitmap, 3031).
+-define(wxStyledTextCtrl_MarkerAddSet, 3032).
+-define(wxStyledTextCtrl_MarkerSetAlpha, 3033).
+-define(wxStyledTextCtrl_SetMarginType, 3034).
+-define(wxStyledTextCtrl_GetMarginType, 3035).
+-define(wxStyledTextCtrl_SetMarginWidth, 3036).
+-define(wxStyledTextCtrl_GetMarginWidth, 3037).
+-define(wxStyledTextCtrl_SetMarginMask, 3038).
+-define(wxStyledTextCtrl_GetMarginMask, 3039).
+-define(wxStyledTextCtrl_SetMarginSensitive, 3040).
+-define(wxStyledTextCtrl_GetMarginSensitive, 3041).
+-define(wxStyledTextCtrl_StyleClearAll, 3042).
+-define(wxStyledTextCtrl_StyleSetForeground, 3043).
+-define(wxStyledTextCtrl_StyleSetBackground, 3044).
+-define(wxStyledTextCtrl_StyleSetBold, 3045).
+-define(wxStyledTextCtrl_StyleSetItalic, 3046).
+-define(wxStyledTextCtrl_StyleSetSize, 3047).
+-define(wxStyledTextCtrl_StyleSetFaceName, 3048).
+-define(wxStyledTextCtrl_StyleSetEOLFilled, 3049).
+-define(wxStyledTextCtrl_StyleResetDefault, 3050).
+-define(wxStyledTextCtrl_StyleSetUnderline, 3051).
+-define(wxStyledTextCtrl_StyleSetCase, 3052).
+-define(wxStyledTextCtrl_StyleSetHotSpot, 3053).
+-define(wxStyledTextCtrl_SetSelForeground, 3054).
+-define(wxStyledTextCtrl_SetSelBackground, 3055).
+-define(wxStyledTextCtrl_GetSelAlpha, 3056).
+-define(wxStyledTextCtrl_SetSelAlpha, 3057).
+-define(wxStyledTextCtrl_SetCaretForeground, 3058).
+-define(wxStyledTextCtrl_CmdKeyAssign, 3059).
+-define(wxStyledTextCtrl_CmdKeyClear, 3060).
+-define(wxStyledTextCtrl_CmdKeyClearAll, 3061).
+-define(wxStyledTextCtrl_SetStyleBytes, 3062).
+-define(wxStyledTextCtrl_StyleSetVisible, 3063).
+-define(wxStyledTextCtrl_GetCaretPeriod, 3064).
+-define(wxStyledTextCtrl_SetCaretPeriod, 3065).
+-define(wxStyledTextCtrl_SetWordChars, 3066).
+-define(wxStyledTextCtrl_BeginUndoAction, 3067).
+-define(wxStyledTextCtrl_EndUndoAction, 3068).
+-define(wxStyledTextCtrl_IndicatorSetStyle, 3069).
+-define(wxStyledTextCtrl_IndicatorGetStyle, 3070).
+-define(wxStyledTextCtrl_IndicatorSetForeground, 3071).
+-define(wxStyledTextCtrl_IndicatorGetForeground, 3072).
+-define(wxStyledTextCtrl_SetWhitespaceForeground, 3073).
+-define(wxStyledTextCtrl_SetWhitespaceBackground, 3074).
+-define(wxStyledTextCtrl_GetStyleBits, 3075).
+-define(wxStyledTextCtrl_SetLineState, 3076).
+-define(wxStyledTextCtrl_GetLineState, 3077).
+-define(wxStyledTextCtrl_GetMaxLineState, 3078).
+-define(wxStyledTextCtrl_GetCaretLineVisible, 3079).
+-define(wxStyledTextCtrl_SetCaretLineVisible, 3080).
+-define(wxStyledTextCtrl_GetCaretLineBackground, 3081).
+-define(wxStyledTextCtrl_SetCaretLineBackground, 3082).
+-define(wxStyledTextCtrl_AutoCompShow, 3083).
+-define(wxStyledTextCtrl_AutoCompCancel, 3084).
+-define(wxStyledTextCtrl_AutoCompActive, 3085).
+-define(wxStyledTextCtrl_AutoCompPosStart, 3086).
+-define(wxStyledTextCtrl_AutoCompComplete, 3087).
+-define(wxStyledTextCtrl_AutoCompStops, 3088).
+-define(wxStyledTextCtrl_AutoCompSetSeparator, 3089).
+-define(wxStyledTextCtrl_AutoCompGetSeparator, 3090).
+-define(wxStyledTextCtrl_AutoCompSelect, 3091).
+-define(wxStyledTextCtrl_AutoCompSetCancelAtStart, 3092).
+-define(wxStyledTextCtrl_AutoCompGetCancelAtStart, 3093).
+-define(wxStyledTextCtrl_AutoCompSetFillUps, 3094).
+-define(wxStyledTextCtrl_AutoCompSetChooseSingle, 3095).
+-define(wxStyledTextCtrl_AutoCompGetChooseSingle, 3096).
+-define(wxStyledTextCtrl_AutoCompSetIgnoreCase, 3097).
+-define(wxStyledTextCtrl_AutoCompGetIgnoreCase, 3098).
+-define(wxStyledTextCtrl_UserListShow, 3099).
+-define(wxStyledTextCtrl_AutoCompSetAutoHide, 3100).
+-define(wxStyledTextCtrl_AutoCompGetAutoHide, 3101).
+-define(wxStyledTextCtrl_AutoCompSetDropRestOfWord, 3102).
+-define(wxStyledTextCtrl_AutoCompGetDropRestOfWord, 3103).
+-define(wxStyledTextCtrl_RegisterImage, 3104).
+-define(wxStyledTextCtrl_ClearRegisteredImages, 3105).
+-define(wxStyledTextCtrl_AutoCompGetTypeSeparator, 3106).
+-define(wxStyledTextCtrl_AutoCompSetTypeSeparator, 3107).
+-define(wxStyledTextCtrl_AutoCompSetMaxWidth, 3108).
+-define(wxStyledTextCtrl_AutoCompGetMaxWidth, 3109).
+-define(wxStyledTextCtrl_AutoCompSetMaxHeight, 3110).
+-define(wxStyledTextCtrl_AutoCompGetMaxHeight, 3111).
+-define(wxStyledTextCtrl_SetIndent, 3112).
+-define(wxStyledTextCtrl_GetIndent, 3113).
+-define(wxStyledTextCtrl_SetUseTabs, 3114).
+-define(wxStyledTextCtrl_GetUseTabs, 3115).
+-define(wxStyledTextCtrl_SetLineIndentation, 3116).
+-define(wxStyledTextCtrl_GetLineIndentation, 3117).
+-define(wxStyledTextCtrl_GetLineIndentPosition, 3118).
+-define(wxStyledTextCtrl_GetColumn, 3119).
+-define(wxStyledTextCtrl_SetUseHorizontalScrollBar, 3120).
+-define(wxStyledTextCtrl_GetUseHorizontalScrollBar, 3121).
+-define(wxStyledTextCtrl_SetIndentationGuides, 3122).
+-define(wxStyledTextCtrl_GetIndentationGuides, 3123).
+-define(wxStyledTextCtrl_SetHighlightGuide, 3124).
+-define(wxStyledTextCtrl_GetHighlightGuide, 3125).
+-define(wxStyledTextCtrl_GetLineEndPosition, 3126).
+-define(wxStyledTextCtrl_GetCodePage, 3127).
+-define(wxStyledTextCtrl_GetCaretForeground, 3128).
+-define(wxStyledTextCtrl_GetReadOnly, 3129).
+-define(wxStyledTextCtrl_SetCurrentPos, 3130).
+-define(wxStyledTextCtrl_SetSelectionStart, 3131).
+-define(wxStyledTextCtrl_GetSelectionStart, 3132).
+-define(wxStyledTextCtrl_SetSelectionEnd, 3133).
+-define(wxStyledTextCtrl_GetSelectionEnd, 3134).
+-define(wxStyledTextCtrl_SetPrintMagnification, 3135).
+-define(wxStyledTextCtrl_GetPrintMagnification, 3136).
+-define(wxStyledTextCtrl_SetPrintColourMode, 3137).
+-define(wxStyledTextCtrl_GetPrintColourMode, 3138).
+-define(wxStyledTextCtrl_FindText, 3139).
+-define(wxStyledTextCtrl_FormatRange, 3140).
+-define(wxStyledTextCtrl_GetFirstVisibleLine, 3141).
+-define(wxStyledTextCtrl_GetLine, 3142).
+-define(wxStyledTextCtrl_GetLineCount, 3143).
+-define(wxStyledTextCtrl_SetMarginLeft, 3144).
+-define(wxStyledTextCtrl_GetMarginLeft, 3145).
+-define(wxStyledTextCtrl_SetMarginRight, 3146).
+-define(wxStyledTextCtrl_GetMarginRight, 3147).
+-define(wxStyledTextCtrl_GetModify, 3148).
+-define(wxStyledTextCtrl_SetSelection, 3149).
+-define(wxStyledTextCtrl_GetSelectedText, 3150).
+-define(wxStyledTextCtrl_GetTextRange, 3151).
+-define(wxStyledTextCtrl_HideSelection, 3152).
+-define(wxStyledTextCtrl_LineFromPosition, 3153).
+-define(wxStyledTextCtrl_PositionFromLine, 3154).
+-define(wxStyledTextCtrl_LineScroll, 3155).
+-define(wxStyledTextCtrl_EnsureCaretVisible, 3156).
+-define(wxStyledTextCtrl_ReplaceSelection, 3157).
+-define(wxStyledTextCtrl_SetReadOnly, 3158).
+-define(wxStyledTextCtrl_CanPaste, 3159).
+-define(wxStyledTextCtrl_CanUndo, 3160).
+-define(wxStyledTextCtrl_EmptyUndoBuffer, 3161).
+-define(wxStyledTextCtrl_Undo, 3162).
+-define(wxStyledTextCtrl_Cut, 3163).
+-define(wxStyledTextCtrl_Copy, 3164).
+-define(wxStyledTextCtrl_Paste, 3165).
+-define(wxStyledTextCtrl_Clear, 3166).
+-define(wxStyledTextCtrl_SetText, 3167).
+-define(wxStyledTextCtrl_GetText, 3168).
+-define(wxStyledTextCtrl_GetTextLength, 3169).
+-define(wxStyledTextCtrl_GetOvertype, 3170).
+-define(wxStyledTextCtrl_SetCaretWidth, 3171).
+-define(wxStyledTextCtrl_GetCaretWidth, 3172).
+-define(wxStyledTextCtrl_SetTargetStart, 3173).
+-define(wxStyledTextCtrl_GetTargetStart, 3174).
+-define(wxStyledTextCtrl_SetTargetEnd, 3175).
+-define(wxStyledTextCtrl_GetTargetEnd, 3176).
+-define(wxStyledTextCtrl_ReplaceTarget, 3177).
+-define(wxStyledTextCtrl_SearchInTarget, 3178).
+-define(wxStyledTextCtrl_SetSearchFlags, 3179).
+-define(wxStyledTextCtrl_GetSearchFlags, 3180).
+-define(wxStyledTextCtrl_CallTipShow, 3181).
+-define(wxStyledTextCtrl_CallTipCancel, 3182).
+-define(wxStyledTextCtrl_CallTipActive, 3183).
+-define(wxStyledTextCtrl_CallTipPosAtStart, 3184).
+-define(wxStyledTextCtrl_CallTipSetHighlight, 3185).
+-define(wxStyledTextCtrl_CallTipSetBackground, 3186).
+-define(wxStyledTextCtrl_CallTipSetForeground, 3187).
+-define(wxStyledTextCtrl_CallTipSetForegroundHighlight, 3188).
+-define(wxStyledTextCtrl_CallTipUseStyle, 3189).
+-define(wxStyledTextCtrl_VisibleFromDocLine, 3190).
+-define(wxStyledTextCtrl_DocLineFromVisible, 3191).
+-define(wxStyledTextCtrl_WrapCount, 3192).
+-define(wxStyledTextCtrl_SetFoldLevel, 3193).
+-define(wxStyledTextCtrl_GetFoldLevel, 3194).
+-define(wxStyledTextCtrl_GetLastChild, 3195).
+-define(wxStyledTextCtrl_GetFoldParent, 3196).
+-define(wxStyledTextCtrl_ShowLines, 3197).
+-define(wxStyledTextCtrl_HideLines, 3198).
+-define(wxStyledTextCtrl_GetLineVisible, 3199).
+-define(wxStyledTextCtrl_SetFoldExpanded, 3200).
+-define(wxStyledTextCtrl_GetFoldExpanded, 3201).
+-define(wxStyledTextCtrl_ToggleFold, 3202).
+-define(wxStyledTextCtrl_EnsureVisible, 3203).
+-define(wxStyledTextCtrl_SetFoldFlags, 3204).
+-define(wxStyledTextCtrl_EnsureVisibleEnforcePolicy, 3205).
+-define(wxStyledTextCtrl_SetTabIndents, 3206).
+-define(wxStyledTextCtrl_GetTabIndents, 3207).
+-define(wxStyledTextCtrl_SetBackSpaceUnIndents, 3208).
+-define(wxStyledTextCtrl_GetBackSpaceUnIndents, 3209).
+-define(wxStyledTextCtrl_SetMouseDwellTime, 3210).
+-define(wxStyledTextCtrl_GetMouseDwellTime, 3211).
+-define(wxStyledTextCtrl_WordStartPosition, 3212).
+-define(wxStyledTextCtrl_WordEndPosition, 3213).
+-define(wxStyledTextCtrl_SetWrapMode, 3214).
+-define(wxStyledTextCtrl_GetWrapMode, 3215).
+-define(wxStyledTextCtrl_SetWrapVisualFlags, 3216).
+-define(wxStyledTextCtrl_GetWrapVisualFlags, 3217).
+-define(wxStyledTextCtrl_SetWrapVisualFlagsLocation, 3218).
+-define(wxStyledTextCtrl_GetWrapVisualFlagsLocation, 3219).
+-define(wxStyledTextCtrl_SetWrapStartIndent, 3220).
+-define(wxStyledTextCtrl_GetWrapStartIndent, 3221).
+-define(wxStyledTextCtrl_SetLayoutCache, 3222).
+-define(wxStyledTextCtrl_GetLayoutCache, 3223).
+-define(wxStyledTextCtrl_SetScrollWidth, 3224).
+-define(wxStyledTextCtrl_GetScrollWidth, 3225).
+-define(wxStyledTextCtrl_TextWidth, 3226).
+-define(wxStyledTextCtrl_GetEndAtLastLine, 3227).
+-define(wxStyledTextCtrl_TextHeight, 3228).
+-define(wxStyledTextCtrl_SetUseVerticalScrollBar, 3229).
+-define(wxStyledTextCtrl_GetUseVerticalScrollBar, 3230).
+-define(wxStyledTextCtrl_AppendText, 3231).
+-define(wxStyledTextCtrl_GetTwoPhaseDraw, 3232).
+-define(wxStyledTextCtrl_SetTwoPhaseDraw, 3233).
+-define(wxStyledTextCtrl_TargetFromSelection, 3234).
+-define(wxStyledTextCtrl_LinesJoin, 3235).
+-define(wxStyledTextCtrl_LinesSplit, 3236).
+-define(wxStyledTextCtrl_SetFoldMarginColour, 3237).
+-define(wxStyledTextCtrl_SetFoldMarginHiColour, 3238).
+-define(wxStyledTextCtrl_LineDown, 3239).
+-define(wxStyledTextCtrl_LineDownExtend, 3240).
+-define(wxStyledTextCtrl_LineUp, 3241).
+-define(wxStyledTextCtrl_LineUpExtend, 3242).
+-define(wxStyledTextCtrl_CharLeft, 3243).
+-define(wxStyledTextCtrl_CharLeftExtend, 3244).
+-define(wxStyledTextCtrl_CharRight, 3245).
+-define(wxStyledTextCtrl_CharRightExtend, 3246).
+-define(wxStyledTextCtrl_WordLeft, 3247).
+-define(wxStyledTextCtrl_WordLeftExtend, 3248).
+-define(wxStyledTextCtrl_WordRight, 3249).
+-define(wxStyledTextCtrl_WordRightExtend, 3250).
+-define(wxStyledTextCtrl_Home, 3251).
+-define(wxStyledTextCtrl_HomeExtend, 3252).
+-define(wxStyledTextCtrl_LineEnd, 3253).
+-define(wxStyledTextCtrl_LineEndExtend, 3254).
+-define(wxStyledTextCtrl_DocumentStart, 3255).
+-define(wxStyledTextCtrl_DocumentStartExtend, 3256).
+-define(wxStyledTextCtrl_DocumentEnd, 3257).
+-define(wxStyledTextCtrl_DocumentEndExtend, 3258).
+-define(wxStyledTextCtrl_PageUp, 3259).
+-define(wxStyledTextCtrl_PageUpExtend, 3260).
+-define(wxStyledTextCtrl_PageDown, 3261).
+-define(wxStyledTextCtrl_PageDownExtend, 3262).
+-define(wxStyledTextCtrl_EditToggleOvertype, 3263).
+-define(wxStyledTextCtrl_Cancel, 3264).
+-define(wxStyledTextCtrl_DeleteBack, 3265).
+-define(wxStyledTextCtrl_Tab, 3266).
+-define(wxStyledTextCtrl_BackTab, 3267).
+-define(wxStyledTextCtrl_NewLine, 3268).
+-define(wxStyledTextCtrl_FormFeed, 3269).
+-define(wxStyledTextCtrl_VCHome, 3270).
+-define(wxStyledTextCtrl_VCHomeExtend, 3271).
+-define(wxStyledTextCtrl_ZoomIn, 3272).
+-define(wxStyledTextCtrl_ZoomOut, 3273).
+-define(wxStyledTextCtrl_DelWordLeft, 3274).
+-define(wxStyledTextCtrl_DelWordRight, 3275).
+-define(wxStyledTextCtrl_LineCut, 3276).
+-define(wxStyledTextCtrl_LineDelete, 3277).
+-define(wxStyledTextCtrl_LineTranspose, 3278).
+-define(wxStyledTextCtrl_LineDuplicate, 3279).
+-define(wxStyledTextCtrl_LowerCase, 3280).
+-define(wxStyledTextCtrl_UpperCase, 3281).
+-define(wxStyledTextCtrl_LineScrollDown, 3282).
+-define(wxStyledTextCtrl_LineScrollUp, 3283).
+-define(wxStyledTextCtrl_DeleteBackNotLine, 3284).
+-define(wxStyledTextCtrl_HomeDisplay, 3285).
+-define(wxStyledTextCtrl_HomeDisplayExtend, 3286).
+-define(wxStyledTextCtrl_LineEndDisplay, 3287).
+-define(wxStyledTextCtrl_LineEndDisplayExtend, 3288).
+-define(wxStyledTextCtrl_HomeWrapExtend, 3289).
+-define(wxStyledTextCtrl_LineEndWrap, 3290).
+-define(wxStyledTextCtrl_LineEndWrapExtend, 3291).
+-define(wxStyledTextCtrl_VCHomeWrap, 3292).
+-define(wxStyledTextCtrl_VCHomeWrapExtend, 3293).
+-define(wxStyledTextCtrl_LineCopy, 3294).
+-define(wxStyledTextCtrl_MoveCaretInsideView, 3295).
+-define(wxStyledTextCtrl_LineLength, 3296).
+-define(wxStyledTextCtrl_BraceHighlight, 3297).
+-define(wxStyledTextCtrl_BraceBadLight, 3298).
+-define(wxStyledTextCtrl_BraceMatch, 3299).
+-define(wxStyledTextCtrl_GetViewEOL, 3300).
+-define(wxStyledTextCtrl_SetViewEOL, 3301).
+-define(wxStyledTextCtrl_SetModEventMask, 3302).
+-define(wxStyledTextCtrl_GetEdgeColumn, 3303).
+-define(wxStyledTextCtrl_SetEdgeColumn, 3304).
+-define(wxStyledTextCtrl_SetEdgeMode, 3305).
+-define(wxStyledTextCtrl_GetEdgeMode, 3306).
+-define(wxStyledTextCtrl_GetEdgeColour, 3307).
+-define(wxStyledTextCtrl_SetEdgeColour, 3308).
+-define(wxStyledTextCtrl_SearchAnchor, 3309).
+-define(wxStyledTextCtrl_SearchNext, 3310).
+-define(wxStyledTextCtrl_SearchPrev, 3311).
+-define(wxStyledTextCtrl_LinesOnScreen, 3312).
+-define(wxStyledTextCtrl_UsePopUp, 3313).
+-define(wxStyledTextCtrl_SelectionIsRectangle, 3314).
+-define(wxStyledTextCtrl_SetZoom, 3315).
+-define(wxStyledTextCtrl_GetZoom, 3316).
+-define(wxStyledTextCtrl_GetModEventMask, 3317).
+-define(wxStyledTextCtrl_SetSTCFocus, 3318).
+-define(wxStyledTextCtrl_GetSTCFocus, 3319).
+-define(wxStyledTextCtrl_SetStatus, 3320).
+-define(wxStyledTextCtrl_GetStatus, 3321).
+-define(wxStyledTextCtrl_SetMouseDownCaptures, 3322).
+-define(wxStyledTextCtrl_GetMouseDownCaptures, 3323).
+-define(wxStyledTextCtrl_SetSTCCursor, 3324).
+-define(wxStyledTextCtrl_GetSTCCursor, 3325).
+-define(wxStyledTextCtrl_SetControlCharSymbol, 3326).
+-define(wxStyledTextCtrl_GetControlCharSymbol, 3327).
+-define(wxStyledTextCtrl_WordPartLeft, 3328).
+-define(wxStyledTextCtrl_WordPartLeftExtend, 3329).
+-define(wxStyledTextCtrl_WordPartRight, 3330).
+-define(wxStyledTextCtrl_WordPartRightExtend, 3331).
+-define(wxStyledTextCtrl_SetVisiblePolicy, 3332).
+-define(wxStyledTextCtrl_DelLineLeft, 3333).
+-define(wxStyledTextCtrl_DelLineRight, 3334).
+-define(wxStyledTextCtrl_GetXOffset, 3335).
+-define(wxStyledTextCtrl_ChooseCaretX, 3336).
+-define(wxStyledTextCtrl_SetXCaretPolicy, 3337).
+-define(wxStyledTextCtrl_SetYCaretPolicy, 3338).
+-define(wxStyledTextCtrl_GetPrintWrapMode, 3339).
+-define(wxStyledTextCtrl_SetHotspotActiveForeground, 3340).
+-define(wxStyledTextCtrl_SetHotspotActiveBackground, 3341).
+-define(wxStyledTextCtrl_SetHotspotActiveUnderline, 3342).
+-define(wxStyledTextCtrl_SetHotspotSingleLine, 3343).
+-define(wxStyledTextCtrl_ParaDownExtend, 3344).
+-define(wxStyledTextCtrl_ParaUp, 3345).
+-define(wxStyledTextCtrl_ParaUpExtend, 3346).
+-define(wxStyledTextCtrl_PositionBefore, 3347).
+-define(wxStyledTextCtrl_PositionAfter, 3348).
+-define(wxStyledTextCtrl_CopyRange, 3349).
+-define(wxStyledTextCtrl_CopyText, 3350).
+-define(wxStyledTextCtrl_SetSelectionMode, 3351).
+-define(wxStyledTextCtrl_GetSelectionMode, 3352).
+-define(wxStyledTextCtrl_LineDownRectExtend, 3353).
+-define(wxStyledTextCtrl_LineUpRectExtend, 3354).
+-define(wxStyledTextCtrl_CharLeftRectExtend, 3355).
+-define(wxStyledTextCtrl_CharRightRectExtend, 3356).
+-define(wxStyledTextCtrl_HomeRectExtend, 3357).
+-define(wxStyledTextCtrl_VCHomeRectExtend, 3358).
+-define(wxStyledTextCtrl_LineEndRectExtend, 3359).
+-define(wxStyledTextCtrl_PageUpRectExtend, 3360).
+-define(wxStyledTextCtrl_PageDownRectExtend, 3361).
+-define(wxStyledTextCtrl_StutteredPageUp, 3362).
+-define(wxStyledTextCtrl_StutteredPageUpExtend, 3363).
+-define(wxStyledTextCtrl_StutteredPageDown, 3364).
+-define(wxStyledTextCtrl_StutteredPageDownExtend, 3365).
+-define(wxStyledTextCtrl_WordLeftEnd, 3366).
+-define(wxStyledTextCtrl_WordLeftEndExtend, 3367).
+-define(wxStyledTextCtrl_WordRightEnd, 3368).
+-define(wxStyledTextCtrl_WordRightEndExtend, 3369).
+-define(wxStyledTextCtrl_SetWhitespaceChars, 3370).
+-define(wxStyledTextCtrl_SetCharsDefault, 3371).
+-define(wxStyledTextCtrl_AutoCompGetCurrent, 3372).
+-define(wxStyledTextCtrl_Allocate, 3373).
+-define(wxStyledTextCtrl_FindColumn, 3374).
+-define(wxStyledTextCtrl_GetCaretSticky, 3375).
+-define(wxStyledTextCtrl_SetCaretSticky, 3376).
+-define(wxStyledTextCtrl_ToggleCaretSticky, 3377).
+-define(wxStyledTextCtrl_SetPasteConvertEndings, 3378).
+-define(wxStyledTextCtrl_GetPasteConvertEndings, 3379).
+-define(wxStyledTextCtrl_SelectionDuplicate, 3380).
+-define(wxStyledTextCtrl_SetCaretLineBackAlpha, 3381).
+-define(wxStyledTextCtrl_GetCaretLineBackAlpha, 3382).
+-define(wxStyledTextCtrl_StartRecord, 3383).
+-define(wxStyledTextCtrl_StopRecord, 3384).
+-define(wxStyledTextCtrl_SetLexer, 3385).
+-define(wxStyledTextCtrl_GetLexer, 3386).
+-define(wxStyledTextCtrl_Colourise, 3387).
+-define(wxStyledTextCtrl_SetProperty, 3388).
+-define(wxStyledTextCtrl_SetKeyWords, 3389).
+-define(wxStyledTextCtrl_SetLexerLanguage, 3390).
+-define(wxStyledTextCtrl_GetProperty, 3391).
+-define(wxStyledTextCtrl_GetStyleBitsNeeded, 3392).
+-define(wxStyledTextCtrl_GetCurrentLine, 3393).
+-define(wxStyledTextCtrl_StyleSetSpec, 3394).
+-define(wxStyledTextCtrl_StyleSetFont, 3395).
+-define(wxStyledTextCtrl_StyleSetFontAttr, 3396).
+-define(wxStyledTextCtrl_StyleSetCharacterSet, 3397).
+-define(wxStyledTextCtrl_StyleSetFontEncoding, 3398).
+-define(wxStyledTextCtrl_CmdKeyExecute, 3399).
+-define(wxStyledTextCtrl_SetMargins, 3400).
+-define(wxStyledTextCtrl_GetSelection, 3401).
+-define(wxStyledTextCtrl_PointFromPosition, 3402).
+-define(wxStyledTextCtrl_ScrollToLine, 3403).
+-define(wxStyledTextCtrl_ScrollToColumn, 3404).
+-define(wxStyledTextCtrl_SetVScrollBar, 3405).
+-define(wxStyledTextCtrl_SetHScrollBar, 3406).
+-define(wxStyledTextCtrl_GetLastKeydownProcessed, 3407).
+-define(wxStyledTextCtrl_SetLastKeydownProcessed, 3408).
+-define(wxStyledTextCtrl_SaveFile, 3409).
+-define(wxStyledTextCtrl_LoadFile, 3410).
+-define(wxStyledTextCtrl_DoDragOver, 3411).
+-define(wxStyledTextCtrl_DoDropText, 3412).
+-define(wxStyledTextCtrl_GetUseAntiAliasing, 3413).
+-define(wxStyledTextCtrl_AddTextRaw, 3414).
+-define(wxStyledTextCtrl_InsertTextRaw, 3415).
+-define(wxStyledTextCtrl_GetCurLineRaw, 3416).
+-define(wxStyledTextCtrl_GetLineRaw, 3417).
+-define(wxStyledTextCtrl_GetSelectedTextRaw, 3418).
+-define(wxStyledTextCtrl_GetTextRangeRaw, 3419).
+-define(wxStyledTextCtrl_SetTextRaw, 3420).
+-define(wxStyledTextCtrl_GetTextRaw, 3421).
+-define(wxStyledTextCtrl_AppendTextRaw, 3422).
+-define(wxArtProvider_GetBitmap, 3423).
+-define(wxArtProvider_GetIcon, 3424).
+-define(wxTreeEvent_GetKeyCode, 3425).
+-define(wxTreeEvent_GetItem, 3426).
+-define(wxTreeEvent_GetKeyEvent, 3427).
+-define(wxTreeEvent_GetLabel, 3428).
+-define(wxTreeEvent_GetOldItem, 3429).
+-define(wxTreeEvent_GetPoint, 3430).
+-define(wxTreeEvent_IsEditCancelled, 3431).
+-define(wxTreeEvent_SetToolTip, 3432).
+-define(wxNotebookEvent_GetOldSelection, 3433).
+-define(wxNotebookEvent_GetSelection, 3434).
+-define(wxNotebookEvent_SetOldSelection, 3435).
+-define(wxNotebookEvent_SetSelection, 3436).
+-define(wxFileDataObject_new, 3437).
+-define(wxFileDataObject_AddFile, 3438).
+-define(wxFileDataObject_GetFilenames, 3439).
+-define(wxFileDataObject_destroy, 3440).
+-define(wxTextDataObject_new, 3441).
+-define(wxTextDataObject_GetTextLength, 3442).
+-define(wxTextDataObject_GetText, 3443).
+-define(wxTextDataObject_SetText, 3444).
+-define(wxTextDataObject_destroy, 3445).
+-define(wxBitmapDataObject_new_1_1, 3446).
+-define(wxBitmapDataObject_new_1_0, 3447).
+-define(wxBitmapDataObject_GetBitmap, 3448).
+-define(wxBitmapDataObject_SetBitmap, 3449).
+-define(wxBitmapDataObject_destroy, 3450).
+-define(wxClipboard_new, 3452).
+-define(wxClipboard_destruct, 3453).
+-define(wxClipboard_AddData, 3454).
+-define(wxClipboard_Clear, 3455).
+-define(wxClipboard_Close, 3456).
+-define(wxClipboard_Flush, 3457).
+-define(wxClipboard_GetData, 3458).
+-define(wxClipboard_IsOpened, 3459).
+-define(wxClipboard_Open, 3460).
+-define(wxClipboard_SetData, 3461).
+-define(wxClipboard_UsePrimarySelection, 3463).
+-define(wxClipboard_IsSupported, 3464).
+-define(wxClipboard_Get, 3465).
+-define(wxSpinEvent_GetPosition, 3466).
+-define(wxSpinEvent_SetPosition, 3467).
+-define(wxSplitterWindow_new_0, 3468).
+-define(wxSplitterWindow_new_2, 3469).
+-define(wxSplitterWindow_destruct, 3470).
+-define(wxSplitterWindow_Create, 3471).
+-define(wxSplitterWindow_GetMinimumPaneSize, 3472).
+-define(wxSplitterWindow_GetSashGravity, 3473).
+-define(wxSplitterWindow_GetSashPosition, 3474).
+-define(wxSplitterWindow_GetSplitMode, 3475).
+-define(wxSplitterWindow_GetWindow1, 3476).
+-define(wxSplitterWindow_GetWindow2, 3477).
+-define(wxSplitterWindow_Initialize, 3478).
+-define(wxSplitterWindow_IsSplit, 3479).
+-define(wxSplitterWindow_ReplaceWindow, 3480).
+-define(wxSplitterWindow_SetSashGravity, 3481).
+-define(wxSplitterWindow_SetSashPosition, 3482).
+-define(wxSplitterWindow_SetSashSize, 3483).
+-define(wxSplitterWindow_SetMinimumPaneSize, 3484).
+-define(wxSplitterWindow_SetSplitMode, 3485).
+-define(wxSplitterWindow_SplitHorizontally, 3486).
+-define(wxSplitterWindow_SplitVertically, 3487).
+-define(wxSplitterWindow_Unsplit, 3488).
+-define(wxSplitterWindow_UpdateSize, 3489).
+-define(wxSplitterEvent_GetSashPosition, 3490).
+-define(wxSplitterEvent_GetX, 3491).
+-define(wxSplitterEvent_GetY, 3492).
+-define(wxSplitterEvent_GetWindowBeingRemoved, 3493).
+-define(wxSplitterEvent_SetSashPosition, 3494).
+-define(wxHtmlWindow_new_0, 3495).
+-define(wxHtmlWindow_new_2, 3496).
+-define(wxHtmlWindow_AppendToPage, 3497).
+-define(wxHtmlWindow_GetOpenedAnchor, 3498).
+-define(wxHtmlWindow_GetOpenedPage, 3499).
+-define(wxHtmlWindow_GetOpenedPageTitle, 3500).
+-define(wxHtmlWindow_GetRelatedFrame, 3501).
+-define(wxHtmlWindow_HistoryBack, 3502).
+-define(wxHtmlWindow_HistoryCanBack, 3503).
+-define(wxHtmlWindow_HistoryCanForward, 3504).
+-define(wxHtmlWindow_HistoryClear, 3505).
+-define(wxHtmlWindow_HistoryForward, 3506).
+-define(wxHtmlWindow_LoadFile, 3507).
+-define(wxHtmlWindow_LoadPage, 3508).
+-define(wxHtmlWindow_SelectAll, 3509).
+-define(wxHtmlWindow_SelectionToText, 3510).
+-define(wxHtmlWindow_SelectLine, 3511).
+-define(wxHtmlWindow_SelectWord, 3512).
+-define(wxHtmlWindow_SetBorders, 3513).
+-define(wxHtmlWindow_SetFonts, 3514).
+-define(wxHtmlWindow_SetPage, 3515).
+-define(wxHtmlWindow_SetRelatedFrame, 3516).
+-define(wxHtmlWindow_SetRelatedStatusBar, 3517).
+-define(wxHtmlWindow_ToText, 3518).
+-define(wxHtmlWindow_destroy, 3519).
+-define(wxHtmlLinkEvent_GetLinkInfo, 3520).
+-define(wxSystemSettings_GetColour, 3521).
+-define(wxSystemSettings_GetFont, 3522).
+-define(wxSystemSettings_GetMetric, 3523).
+-define(wxSystemSettings_GetScreenType, 3524).
+-define(wxSystemOptions_GetOption, 3525).
+-define(wxSystemOptions_GetOptionInt, 3526).
+-define(wxSystemOptions_HasOption, 3527).
+-define(wxSystemOptions_IsFalse, 3528).
+-define(wxSystemOptions_SetOption_2_1, 3529).
+-define(wxSystemOptions_SetOption_2_0, 3530).
+-define(wxAuiNotebookEvent_SetSelection, 3531).
+-define(wxAuiNotebookEvent_GetSelection, 3532).
+-define(wxAuiNotebookEvent_SetOldSelection, 3533).
+-define(wxAuiNotebookEvent_GetOldSelection, 3534).
+-define(wxAuiNotebookEvent_SetDragSource, 3535).
+-define(wxAuiNotebookEvent_GetDragSource, 3536).
+-define(wxAuiManagerEvent_SetManager, 3537).
+-define(wxAuiManagerEvent_GetManager, 3538).
+-define(wxAuiManagerEvent_SetPane, 3539).
+-define(wxAuiManagerEvent_GetPane, 3540).
+-define(wxAuiManagerEvent_SetButton, 3541).
+-define(wxAuiManagerEvent_GetButton, 3542).
+-define(wxAuiManagerEvent_SetDC, 3543).
+-define(wxAuiManagerEvent_GetDC, 3544).
+-define(wxAuiManagerEvent_Veto, 3545).
+-define(wxAuiManagerEvent_GetVeto, 3546).
+-define(wxAuiManagerEvent_SetCanVeto, 3547).
+-define(wxAuiManagerEvent_CanVeto, 3548).
+-define(wxLogNull_new, 3549).
+-define(wxLogNull_destroy, 3550).
+-define(wxTaskBarIcon_new, 3551).
+-define(wxTaskBarIcon_destruct, 3552).
+-define(wxTaskBarIcon_PopupMenu, 3553).
+-define(wxTaskBarIcon_RemoveIcon, 3554).
+-define(wxTaskBarIcon_SetIcon, 3555).
+-define(wxLocale_new_0, 3556).
+-define(wxLocale_new_2, 3558).
+-define(wxLocale_destruct, 3559).
+-define(wxLocale_Init, 3561).
+-define(wxLocale_AddCatalog_1, 3562).
+-define(wxLocale_AddCatalog_3, 3563).
+-define(wxLocale_AddCatalogLookupPathPrefix, 3564).
+-define(wxLocale_GetCanonicalName, 3565).
+-define(wxLocale_GetLanguage, 3566).
+-define(wxLocale_GetLanguageName, 3567).
+-define(wxLocale_GetLocale, 3568).
+-define(wxLocale_GetName, 3569).
+-define(wxLocale_GetString_2, 3570).
+-define(wxLocale_GetString_4, 3571).
+-define(wxLocale_GetHeaderValue, 3572).
+-define(wxLocale_GetSysName, 3573).
+-define(wxLocale_GetSystemEncoding, 3574).
+-define(wxLocale_GetSystemEncodingName, 3575).
+-define(wxLocale_GetSystemLanguage, 3576).
+-define(wxLocale_IsLoaded, 3577).
+-define(wxLocale_IsOk, 3578).
+-define(wxActivateEvent_GetActive, 3579).
+-define(wxPopupWindow_new_2, 3581).
+-define(wxPopupWindow_new_0, 3582).
+-define(wxPopupWindow_destruct, 3584).
+-define(wxPopupWindow_Create, 3585).
+-define(wxPopupWindow_Position, 3586).
+-define(wxPopupTransientWindow_new_0, 3587).
+-define(wxPopupTransientWindow_new_2, 3588).
+-define(wxPopupTransientWindow_destruct, 3589).
+-define(wxPopupTransientWindow_Popup, 3590).
+-define(wxPopupTransientWindow_Dismiss, 3591).
+-define(wxOverlay_new, 3592).
+-define(wxOverlay_destruct, 3593).
+-define(wxOverlay_Reset, 3594).
+-define(wxDCOverlay_new_6, 3595).
+-define(wxDCOverlay_new_2, 3596).
+-define(wxDCOverlay_destruct, 3597).
+-define(wxDCOverlay_Clear, 3598).
diff --git a/lib/wx/src/wxe_server.erl b/lib/wx/src/wxe_server.erl
index ae9440f890..693a008e3d 100644
--- a/lib/wx/src/wxe_server.erl
+++ b/lib/wx/src/wxe_server.erl
@@ -272,7 +272,7 @@ invoke_callback(Pid, Ev, Ref) ->
wx:set_env(Env),
wxe_util:cast(?WXE_CB_START, <<>>),
try
- case get_wx_object_state(Pid) of
+ case get_wx_object_state(Pid, 5) of
ignore ->
%% Ignore early events
wxEvent:skip(Ref);
@@ -307,16 +307,24 @@ invoke_callback_fun(Fun) ->
wxe_util:cast(?WXE_CB_RETURN, Res).
-get_wx_object_state(Pid) ->
+get_wx_object_state(Pid, N) when N > 0 ->
case process_info(Pid, dictionary) of
{dictionary, Dict} ->
case lists:keysearch('_wx_object_',1,Dict) of
- {value, {'_wx_object_', {_Mod, '_wx_init_'}}} -> ignore;
- {value, {'_wx_object_', Value}} -> Value;
- _ -> ignore
+ {value, {'_wx_object_', {_Mod, '_wx_init_'}}} ->
+ timer:sleep(50),
+ get_wx_object_state(Pid, N-1);
+ {value, {'_wx_object_', Value}} ->
+ Value;
+ _ ->
+ ignore
end;
- _ -> ignore
- end.
+ _ ->
+ ignore
+ end;
+get_wx_object_state(_, _) ->
+ ignore.
+
attach_fun(Fun, S = #state{cb=CB,cb_cnt=Next}) ->
case gb_trees:lookup(Fun,CB) of
diff --git a/lib/wx/test/wx_basic_SUITE.erl b/lib/wx/test/wx_basic_SUITE.erl
index 2c746158e5..0b919f6254 100644
--- a/lib/wx/test/wx_basic_SUITE.erl
+++ b/lib/wx/test/wx_basic_SUITE.erl
@@ -338,6 +338,20 @@ data_types(_Config) ->
?m(true, is_boolean(wxCalendarCtrl:setDate(Cal,DateTime))),
?m({Date,_}, wxCalendarCtrl:getDate(Cal)),
+ %% Images, test sending and reading binaries
+ Colors = << <<200:8, 199:8, 198:8 >> || _ <- lists:seq(1, 128*64) >>,
+ Alpha = << <<255:8>> || _ <- lists:seq(1, 128*64) >>,
+ ImgRGB = ?mt(wxImage, wxImage:new(128, 64, Colors)),
+ ?m(true, wxImage:ok(ImgRGB)),
+ ?m(false, wxImage:hasAlpha(ImgRGB)),
+ ?m(Colors, wxImage:getData(ImgRGB)),
+
+ ImgRGBA = ?mt(wxImage, wxImage:new(128, 64, Colors, Alpha)),
+ ?m(true, wxImage:ok(ImgRGBA)),
+ ?m(true, wxImage:hasAlpha(ImgRGBA)),
+ ?m(Colors, wxImage:getData(ImgRGBA)),
+ ?m(Alpha, wxImage:getAlpha(ImgRGBA)),
+
wxClientDC:destroy(CDC),
%%wx_test_lib:wx_destroy(Frame,Config).
wx:destroy().
diff --git a/lib/wx/test/wx_event_SUITE.erl b/lib/wx/test/wx_event_SUITE.erl
index 7e71d6ca69..516133e3e2 100644
--- a/lib/wx/test/wx_event_SUITE.erl
+++ b/lib/wx/test/wx_event_SUITE.erl
@@ -46,8 +46,8 @@ end_per_testcase(Func,Config) ->
%% SUITE specification
suite() -> [{ct_hooks,[ts_install_cth]}].
-all() ->
- [connect, disconnect, connect_msg_20, connect_cb_20,
+all() ->
+ [connect, disconnect, disconnect_cb, connect_msg_20, connect_cb_20,
mouse_on_grid, spin_event, connect_in_callback, recursive,
dialog, char_events, callback_clean
].
@@ -162,9 +162,33 @@ disconnect(Config) ->
?m([], wx_test_lib:flush()),
wx_test_lib:wx_destroy(Frame, Config).
-
+
+disconnect_cb(TestInfo) when is_atom(TestInfo) -> wx_test_lib:tc_info(TestInfo);
+disconnect_cb(Config) ->
+ ?mr(wx_ref, wx:new()),
+ Frame = ?mt(wxFrame, wxFrame:new(wx:null(), 1, "Event Testing")),
+ Panel = ?mt(wxPanel, wxPanel:new(Frame)),
+
+ Tester = self(),
+ CB = fun(#wx{event=#wxSize{},userData=UserD}, SizeEvent) ->
+ ?mt(wxSizeEvent, SizeEvent),
+ wxEvtHandler:disconnect(Frame, close_window),
+ Tester ! {got_size, UserD}
+ end,
+ ?m(ok, wxFrame:connect(Frame, close_window)),
+ ?m(ok, wxFrame:connect(Frame, size)),
+ ?m(ok, wxEvtHandler:connect(Panel, size, [{callback,CB},{userData, panel}])),
+
+ ?m(true, wxFrame:show(Frame)),
+
+ wxWindow:setSize(Panel, {200,100}),
+ get_size_messages(Frame, [frame, panel_cb]),
+ wx_test_lib:flush(),
+
+ wx_test_lib:wx_destroy(Frame, Config).
+
%% Test that the msg events are forwarded as supposed to
connect_msg_20(TestInfo)
when is_atom(TestInfo) -> wx_test_lib:tc_info(TestInfo);