aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
AgeCommit message (Collapse)Author
2016-09-19erts: Reduce ets hash load factorSverker Eriksson
for faster lookup/insert/delete at the expense of about one word per object.
2016-09-16Implement state entry eventsRaimo Niskanen
2016-09-16Implement call/3 dirty_timeoutRaimo Niskanen
2016-09-07Merge branch 'maint'Peter Andersson
2016-09-05Add test case in zip_SUITEPeter Andersson
2016-09-05Merge branch 'bjorn/floor-ceiling/OTP-13692'Björn Gustavsson
* bjorn/floor-ceiling/OTP-13692: Add math:floor/1 and math:ceil/1 Implement the new ceil/1 and floor/1 guard BIFs
2016-09-05Add math:floor/1 and math:ceil/1Björn Gustavsson
Add math:floor/1 and math:ceil/1 to avoid unnecessary conversions in floating point expressions. That is, instead of having to write float(floor(X)) as part of a floating point expressions, we can write simply math:floor(X).
2016-09-02Fix overridden BIFsBjörn Gustavsson
The filters in a list comprehension can be guard expressions or an ordinary expressions. If a guard expression is used as a filter, an exception will basically mean the same as 'false': t() -> L = [{some_tag,42},an_atom], [X || X <- L, element(1, X) =:= some_tag] %% Returns [{some_tag,42}] On the other hand, if an ordinary expression is used as a filter, there will be an exception: my_element(N, T) -> element(N, T). t() -> L = [{some_tag,42},an_atom], [X || X <- L, my_element(1, X) =:= some_tag] %% Causes a 'badarg' exception when element(1, an_atom) is evaluated It has been allowed for several releases to override a BIF with a local function. Thus, if we define a function called element/2, it will be called instead of the BIF element/2 within the module. We must use the "erlang:" prefix to call the BIF. Therefore, the following code is expected to work the same way as in our second example above: -compile({no_auto_import,[element/2]}). element(N, T) -> erlang:element(N, T). t() -> L = [{some_tag,42},an_atom], [X || X <- L, element(1, X) =:= some_tag]. %% Causes a 'badarg' exception when element(1, an_atom) is evaluated But the compiler refuses to compile the code with the following diagnostic: call to local/imported function element/2 is illegal in guard
2016-09-02Don't crash when obsolete guard overrides local functionBjörn Gustavsson
The compiler would crash in v3_codegen when trying to compile the following code: is_port(_) -> false. foo(P) when port(P) -> ok. We *could* have the compiler interpret the code as: is_port(_) -> false. foo(P) when erlang:is_port(P) -> ok. But that would encourage using the obsolete form of the guard tests. Note that the following code is illegal: is_port(_) -> false. foo(P) when is_port(P) -> ok. It produces the following diagnostic: call to local/imported function is_port/1 is illegal in guard Therefore, we should refuse to compile the code.
2016-09-01compiler: Eliminate use of sys_pre_expandBjörn Gustavsson
sys_pre_expand previously did a lot more work, for example, translating records and funs, but now is merely a grab bag of small transformations. Move those transformations to v3_core.
2016-09-01shell_SUITE: Eliminate references to sys_pre_expand in commentsBjörn Gustavsson
Make it clear that we test that the shell is not dependent on the compiler application being in the path.
2016-08-25Replace usage of deprecated time unitsRickard Green
2016-08-17Clarify error valuesRaimo Niskanen
2016-07-27Rewrite gen_statem TCs for M:callback_mode/0Raimo Niskanen
2016-07-14Merge branch 'sverker/update_counter-deadlock/ERL-188/OTP-13731' into maint-19Erlang/OTP
* sverker/update_counter-deadlock/ERL-188/OTP-13731: erts: Add test ets_SUITE:update_counter_table_growth erts: Fix deadlock in ets:update_counter/4 erts: Optimize db_finalize_dbterm_hash
2016-07-11erts: Add test ets_SUITE:update_counter_table_growthSverker Eriksson
2016-07-04stdlib: Correct a bug regarding records in the shellHans Bolinder
See also ERL-182.
2016-06-15Merge branch 'sverker/revert-ets-load-factor'Sverker Eriksson
2016-06-15Merge branch 'siri/cuddle-master'Siri Hansen
* siri/cuddle-master: Add short sleep when killing slave nodes [ct test] Do reload_config instead of get_config
2016-06-15Add short sleep when killing slave nodesSiri Hansen
slave_SUITE:t_start_link somtimes fails when checking that a slave is dead. This commit add a short sleep before the check to allow the node to terminate.
2016-06-13stdlib: Let epp handle long file namesHans Bolinder
2016-06-09Remove support for '...' in Maps typesHans Bolinder
It is possible that '...' is added later (OTP 20.0), but for now we are not sure of all details.
2016-06-08Revert "erts: Change ETS hash load factor"Sverker Eriksson
This reverts commit 7c133fb1094ad1cabbb5cfc157483a43c816c6a9.
2016-06-08Revert "Temporally disable of failing ets_SUITE:memory_check_summary"Sverker Eriksson
This reverts commit f1987d5299ce67b0eb4c4a83d8ee9bcf7426c307.
2016-06-08Merge branch 'zandra/test_server/unmatched_returns/OTP-13345'Zandra Hird
* zandra/test_server/unmatched_returns/OTP-13345: vts - Fix unmatched_return warnings test_server_sup - Fix unmatched_return warnings test_server_node - Fix unmatched_return warnings test_server_io - Fix unmtached_return warnings test_server_gl - Fix unmatched_return warnings test_server_ctrl - Fix unmatched_return warnings test_server - fix unmatched_return warnings remove unused purify functions
2016-06-08Merge branch 'josevalim/supervisor-get-callback-module/PR-1000/OTP-13619'Siri Hansen
* josevalim/supervisor-get-callback-module/PR-1000/OTP-13619: Return callback module in supervisor format_status
2016-06-07remove unused purify functionsZandra
2016-06-04Return callback module in supervisor format_statusJosé Valim
The previous implementation of supervisor:get_callback_module/1 used sys:get_status/1 to get the supervisor inner state and retrieve the callback module. Such implementation forbids any other supervisor implementation that has an internal state different than the #state{} record in supervisor.erl. This patch allows supervisors to return the callback module as part of the sys:get_status/1 data, no longer coupling the callback module implementation with the inner #state{} record. Notice we have kept the clause matching the previous sys:get_status/1 reply for backwards compatibility purposes.
2016-06-01Merge branch 'sverker/ets-load-factor/OTP-13642'Sverker Eriksson
2016-06-01Temporally disable of failing ets_SUITE:memory_check_summarySverker Eriksson
Seems to be the growing meta tables that is causing increasing failed memchecks after load factor was lowered.
2016-06-01erts: Change ETS hash load factorSverker Eriksson
from 700% to 200%
2016-06-01Merge branch 'siri/cuddle-master'Siri Hansen
* siri/cuddle-master: Change ct:sleep to timer:sleep where scaling is not wanted Don't generate ssh key files in netconf client test Ignore data received in break mode in test telnet_server Wait for process to die before next call Retry ct_telnet:get_data if no data is received after short wait Don't throw rest of line when NOP is received in test telnet_server Change ct:sleep to timer:sleep in telnet_server
2016-05-27stdlib: Fix small inconsistencies in ets_SUITEBjörn-Egil Dahlberg
2016-05-27stdlib: Strengthen or relax test casesBjörn-Egil Dahlberg
In particular, valgrind needs a lot of time for certain tests.
2016-05-26Wait for process to die before next callSiri Hansen
gen_server_SUITE:start often fails since a call which is expected to give 'noproc' error instead gives 'stopped' error. This happens when the call is done before the process is really dead. To overcome this problem, we now wait for the process exit before doing the call.
2016-05-13Merge branch 'mururu/stdlib/fix-deprecated-warnings/PR-1050/OTP-13594'Björn Gustavsson
* mururu/stdlib/fix-deprecated-warnings/PR-1050/OTP-13594: Fix deprecated warnings
2016-05-09Merge branch 'bjorn/stdlib/warning-and-error/OTP-13476'Björn Gustavsson
* bjorn/stdlib/warning-and-error/OTP-13476: Add documentation epp: Add the -error and -warning directives epp: Refactor expansion of header path
2016-05-07Fix deprecated warningsYuki Ito
In current deprecated warnings such as `crypto:rand_bytes/1 is deprecated and will be removed in in a future release; use crypto:strong_rand_bytes/1`, the word "in" is duplicated.
2016-05-04Merge branch 'raimo/polish-gen_statem/OTP-13065'Raimo Niskanen
* raimo/polish-gen_statem/OTP-13065: Fix documentation Clean up terminate functions Fix callback mode after code change not used Restructure loop_* to clarify S handling
2016-05-04epp: Add the -error and -warning directivesBjörn Gustavsson
If one of several alternatives configurations are required for an Erlang module to compile, but none are available, it would be useful to give a nice error message. For example: -ifdef(CONFIG_A). %% Some code if A is true. -else. -ifdef(CONFIG_B). %% Some code if B is true. -else. -error("Neither CONFIG_A nor CONFIG_B are available"). -endif. -endif. If neither CONFIG_A nor CONFIG_B are defined, the error message will be: module.erl:10: -error("Neither CONFIG_A nor CONFIG_B are available"). That is basically the same behavior as for the #error directive in GCC. For symmetry with the -error directive, add the -warning directive to generate a compiler warning. For example: -ifdef(HAVE_COOL_FEATURE). %% Code if we have Cool Feature. -else. %% Inefficient fallback code. -warning("Using inefficient fallback"). -endif. If HAVE_COOL_FEATURE is not defined, the warning message will be: module.erl:8: Warning: -warning("Using inefficient fallback"). That is basically the same behavior as for the #warning directive in GCC. Conflicts: lib/stdlib/src/epp.erl lib/stdlib/test/epp_SUITE.erl
2016-05-02stdlib: Strengthen map pattern testsBjörn-Egil Dahlberg
2016-05-02stdlib: Add lint tests for parallel match of mapsBjörn-Egil Dahlberg
2016-05-02stdlib: Refactor erl_lint_SUITEBjörn-Egil Dahlberg
2016-04-29Merge branch 'jlouis/stdlib/implement-lists-join/PR-1012/OTP-13523'Björn Gustavsson
* jlouis/stdlib/implement-lists-join/PR-1012/OTP-13523: Implement lists:join/2
2016-04-28stdlib: Add pretty-printing of exact map typesHans Bolinder
2016-04-28Merge branch 'egil/maps-api-additions/PR-1025/OTP-13522'Björn-Egil Dahlberg
* egil/maps-api-additions/PR-1025/OTP-13522: stdlib: Document maps:update_with/3,4 stdlib: Add tests for maps:update_with/3,4 stdlib: Add maps:update_with/3,4 erts: Add tests for maps:take/2 stdlib: Document maps:take/2 erts: Add BIF maps:take/2
2016-04-27stdlib: Add tests for maps:update_with/3,4Björn-Egil Dahlberg
2016-04-27Fix callback mode after code change not usedRaimo Niskanen
2016-04-25Merge branch 'raimo/new-gen-state-machine/OTP-13065'Raimo Niskanen
* raimo/new-gen-state-machine/OTP-13065: (52 commits) Add section on state filtering Promote gen_statem over gen_fsm Modify code_change/4 to return CallbackMode Use ?NAME macro in examples Introduce Fred Herbert suggested additions Introduce corrections from Fred Hebert and Ingela Use .png pictures instead of .gif Write Design Principles chapter Fix missing short forms for event timeout Do more intricate Fred Hebert doc changes Change Caller -> From as suggested by Fred Hebert Do documentation improvements from Fred Hebert Fix broken documenation reference Rename state_timeout -> event_timeout Fix most of the system docs and emacs mode Change code_change/4 to {ok,State,Data} Fixup sharpened test suite Sharpen test suite Remove the remove_event action and all alike Relax caller() type check and cleanup ... Conflicts: lib/stdlib/src/gen.erl lib/stdlib/src/gen_event.erl lib/stdlib/src/gen_fsm.erl lib/stdlib/src/gen_server.erl lib/stdlib/test/error_logger_forwarder.erl
2016-04-25stdlib: Remove use of crypto:rand_bytes/1Ingela Anderton Andin
The use case is not cryptographical but we want to compare Erlang implementation to c implementation so use crypto:strong_rand_bytes anyway.