aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
AgeCommit message (Collapse)Author
2011-09-13beam_lib_SUITE: Don't assume that "Abst" is the last chunkBjörn Gustavsson
"Line" is now the last chunk in a BEAM file, causing beam_lib_SUITE:error/1 to fail. To avoid being bitten by this problem again, don't simply change "Abst" to "Line", but use beam_lib:info/1 to find out the name of the last chunk.
2011-09-12Cleanup ETS bif's in hipe:erl_bif_types.erl (for dialyzer)Patrik Nyblom
2011-09-08ms_transform: Fix incorrect `variable shadowed' warningsHaitao Li
Compile below module resulting incorrect warning: $ cat tmp.erl -module(tmp). -export([tmp/1]). -include_lib("stdlib/include/ms_transform.hrl"). tmp(X) when X > 100 -> Y=X, Y; tmp(X) -> ets:fun2ms(fun(Y) -> {X, Y} end). $ erlc tmp.erl ./tmp.erl:8: Warning: variable 'Y' shadowed in ms_transform fun head The scope for a variable is its function clause. Variables bound in one function clause should not interfere with other function clauses. This patch removes incorrect passing of variable bindings from one function clause to another. Signed-off-by: Haitao Li <[email protected]>
2011-09-02Merge branch 'dev' into majorHans Bolinder
* dev: Fix a couple of minor bugs with hook priority Update to reflect addition of CTH priority addition Update CTH priority default to be 0 Update to reflect new cth callback api Update the return from init/2 to be {ok, NewState} or {ok,NewState,Priority} instead of NewState. Add priority functionality and tests for ct hooks Update internal hooks state to use a record instead of tuples Improve and correct types and specifications in Kernel and STDLIB
2011-08-31Add a high value to test data to catch type cast truncation errorsLukas Larsson
2011-08-31Improve and correct types and specifications in Kernel and STDLIBHans Bolinder
Running Dialyzer on the test suites revealed a few type errors.
2011-08-30Merge branch 'dev' into majorHenrik Nord
2011-08-25Merge branch 'bjorn/line-numbers-in-exceptions/OTP-9468' into majorBjörn Gustavsson
* bjorn/line-numbers-in-exceptions/OTP-9468: (51 commits) debugger: By default, only save non-tail-recursive calls debugger: Add line_number_SUITE debugger: Include line numbers in exceptions Update examples in the documentation to include line numbers Update documentation for erlang:raise/3 and erlang:get_stacktrace/0 beam_lib: Retain the "Line" chunk when stripping BEAM files erl: Add +L to suppress loading of line number information compiler: Add no_line_info for suppressing line/1 instructions exception_SUITE: Test line numbers in exceptions common_test: Use line numbers in exceptions common_test tests: Don't do detailed testing of the stack backtrace test_server: Refactor init_per_testcase/3 into two functions Implement process_info(Pid, current_{location,stacktrace}) beam_emu: Factor out saving of stack trace from save_stacktrace() compiler: Don't create filenames starting with "./" ops.tab: Remove line instructions before tail-recursive calls Lookup and include filenames and line numbers in exceptions Fix decrement of continuation pointers Refactor building of the exception stacktrace BEAM loader: Load the line table ...
2011-08-25Merge branch 'dev' into majorHenrik Nord
2011-08-23fix supervisors restarting temporary childrenFred Hebert
In the current implementation of supervisors, temporary children should never be restarted. However, when a temporary child is restarted as part of a one_for_all or rest_for_one strategy where the failing process is not the temporary child, the supervisor still tries to restart it. Because the supervisor doesn't keep some of the MFA information of temporary children, this causes the supervisor to hit its restart limit and crash. This patch fixes the behaviour by inserting a clause in terminate_children/2-3 (private function) that will omit temporary children when building a list of killed processes, to avoid having the supervisor trying to restart them again. Only supervisors in need of restarting children used the list, so the change should be of no impact for the functions that called terminate_children/2-3 only to kill all children. The documentation has been modified to make this behaviour more explicit.
2011-08-18Fix a bug in zip:zip_open/1,2.Hans Bolinder
zip:zip_open/1,2 did not accept binary archives. Also corrected the contracts of t/1 and tt/1.
2011-08-18beam_lib: Retain the "Line" chunk when stripping BEAM filesBjörn Gustavsson
2011-08-16Lookup and include filenames and line numbers in exceptionsBjörn Gustavsson
2011-08-16emulator: Add a fourth element in exception stacktracesBjörn Gustavsson
This commit is a preparation for introducing location information (filename/line number) in stacktraces in exceptions. Currently a stack trace looks like: [{Mod1,Function1,Arity1}, . . . {ModN,FunctionN,ArityN}] Add a forth element to each tuple that can be used indication the filename and line number of the source file: [{Mod1,Function1,Arity1,Location1}, . . . {ModN,FunctionN,ArityN,LocationN}] In this commit, the fourth element will just be an empty list, and we will change all code that look at or manipulate stacktraces.
2011-07-26Merge branch 'dev' into majorSverker Eriksson
2011-07-26Merge branch 'sverker/testcase/OTP-9423' into devSverker Eriksson
* sverker/testcase/OTP-9423: Add test case for ETS bug OTP-9423
2011-07-22Merge branch 'dev' into majorRaimo Niskanen
2011-07-21EOF before first field is only ok for first character in io:freadRaimo Niskanen
2011-07-21At end of input ask for more also for for literal format charactersRaimo Niskanen
2011-07-20Add test case for ETS bug OTP-9423Sverker Eriksson
2011-07-12Merge branch 'dev' into majorSverker Eriksson
2011-07-12Merge branch 'maint-r14' into devSverker Eriksson
Conflicts: erts/vsn.mk
2011-07-11Merge branch 'dev' into majorSiri Hansen
2011-07-08Use separate memory carriers for small blocksRickard Green
2011-07-08Make sure supervisor_SUITE:count_children_memory is always skipped when ↵Siri Hansen
erlang:memory is not supported Replace the count_children_allocator_test with try erlang:memory in order to make sure there is no attempt at running this test case if erlang:memory is not supported.
2011-07-07Merge branch 'dev' into majorHans Bolinder
* dev: Fix a bug in erl_scan:set_attribute/3
2011-07-06Fix a bug in erl_scan:set_attribute/3Hans Bolinder
2011-06-17Handle exit reason {shutdown,Term} as shutdown for children of supervisorSiri Hansen
In R13B proc_lib, gen_server and gen_fsm were all changed to handle exit reason {shutdown,Term} in the same way as exit reason 'shutdown', i.e. no crash reports are generated. This is an update of supervisor to do the same, i.e. handle these two exit reasons in the same way. This means that for children with restart type 'transient' there will be no attempt to restart the process if it terminates with reason {shutdown,Term}, and there will be no supervisor report.
2011-05-13Merge branch 'hb/stdlib/dets_tablenames/OTP-9282' into devHans Bolinder
* hb/stdlib/dets_tablenames/OTP-9282: Allow Dets tablenames to be arbitrary terms Conflicts: lib/stdlib/src/dets.erl
2011-05-13Merge branch 'hb/stdlib/specs/OTP-9267' into devHans Bolinder
* hb/stdlib/specs/OTP-9267: Types and specifications have been modified and added Conflicts: lib/stdlib/src/timer.erl
2011-05-12Types and specifications have been modified and addedHans Bolinder
2011-05-11Add timer:tc/1 which measures elapsed time for a fun/0Dan Gudmundsson
Also removes the 'catch' from timer:tc functions which masked errors in measuring code.
2011-05-11Allow Dets tablenames to be arbitrary termsHans Bolinder
2011-05-04Change list to set in supervisor for saving pids of dynamic temprary childrenSiri Hansen
Since initial arguments of temporary children under simple_one_for_one supervisors are not saved, only a list of pids was stored in such supervisors. When adding/deleting many children, this would scale badly. To avoid this the list is now changed to a set.
2011-04-28Merge branch ↵Siri Hansen
'siri/stdlib/supervisor-terminate_child-simple_one_for_one/OTP-9201' into dev * siri/stdlib/supervisor-terminate_child-simple_one_for_one/OTP-9201: Add terminate_child(Sup, Pid) for simple_one_for_one Allow supervisor:terminate_child(SupRef,Pid) for simple_one_for_one
2011-04-12Allow supervisor:terminate_child(SupRef,Pid) for simple_one_for_oneSiri Hansen
supervisor:terminate_child/2 was not allowed if the supervisor used restart strategy simple_one_for_one. This is now changed so that children of this type of supervisors can be terminated by specifying the child's Pid.
2011-04-12Merge branch 'gc/gen-format-status-improvements' into devHenrik Nord
* gc/gen-format-status-improvements: Fix format_status bug for unregistered gen_event processes Conflicts: lib/stdlib/test/gen_event_SUITE.erl OTP-9218
2011-04-04Completed bug fix "temporary child specs should not be kept when childIngela Anderton Andin
terminates" and improved test suite The bug fix supplied by Filipe David Manana <[email protected]> did not cover all possible ways that a process may be terminated as for instance with supervisor:terminate_child. Also there was a bug in the base case of the patch returning a list of a list instead of only the list. Added a timeout for the test cases, eliminated unnecessary sleeps, improved code.
2011-03-30Merge branch 'hw/call-chmod-without-f' into devHenrik Nord
* hw/call-chmod-without-f: Call chmod without the "-f" flag Conflicts: erts/emulator/test/Makefile lib/asn1/test/Makefile lib/crypto/test/Makefile lib/debugger/test/Makefile lib/docbuilder/test/Makefile lib/edoc/test/Makefile lib/erl_interface/test/Makefile lib/inviso/test/Makefile lib/parsetools/test/Makefile lib/percept/test/Makefile lib/ssl/test/Makefile lib/syntax_tools/test/Makefile lib/test_server/test/Makefile lib/tools/test/Makefile OTP-9170
2011-03-23v3_core: Fix variable incorrectly unbound after binary matchBjörn Gustavsson
In the following code: m(<<Sz:8,_:Sz/binary>>) -> Sz = wrong. the Sz variable is supposed to be bound in the function header and the matching "Sz = wrong" should cause a badarg exception. But what happens is that the Sz variables seems to be unbound and the matching succeds and the m/1 function returns 'wrong'. If the Sz variable is used directly (not matched), it will have the expected value. Thus the following code: m(<<Sz:8,_:Sz/binary>>) -> Sz. will correctly return the value of Sz that was matched out from the binary. Reported-by: Bernard Duggan
2011-03-22Fix a bug concerning record field typesHans Bolinder
The default value 'undefined' was added to records field types in such a way that the result was not always a well-formed type. This bug has been fixed. --- erl_pp has since OTP-8150 formatted types so that 'undefined' was removed from union types assigned to record fields. Since one cannot distinguish between 'undefined' added by the parser or supplied by the user, a side effect was that user supplied 'undefined's were also removed. Now the pretty printer shows 'undefined' even if added by the parser. This is a minor issue.
2011-03-11Update copyright yearsBjörn-Egil Dahlberg
2011-03-10Fix ~F.Fs bug, add testcase and improve documentationRaimo Niskanen
2011-03-02Add ISO week number calculation functions to the calendar module in stdlibImre Horvath
This new feature adds the missing week number function to the calendar module of the stdlib application. The implementation conforms to the ISO 8601 standard. The new feature has been implemented tested and documented.
2011-02-25Fix trivial typos in supervisor_SUITETuncer Ayaz
2011-02-23stdlib tests: Eliminate some compiler warningsBjörn Gustavsson
2011-02-23Merge branch 'ia/supervisor-saves-unnecessary-data/OTP-9064' into devIngela Anderton Andin
* ia/supervisor-saves-unnecessary-data/OTP-9064: Added test case do_not_save_start_parameters_for_temporary_children and fixed dialyzer spec. Do not save parameter list for any temporary processes Do not save initial arguments for dynamic temporary processes Conflicts: lib/stdlib/test/supervisor_SUITE.erl
2011-02-22Added test case do_not_save_start_parameters_for_temporary_children and fixedIngela Anderton Andin
dialyzer spec.
2011-02-22Do not save parameter list for any temporary processesIngela Anderton Andin
Previous commit changed the supervisor to not save parameter lists for temporary processes supervised by simple-one-for-one supervisors. But it is unnecessary to save them for any temporary processes as they should not be restarted. Proably the biggest gain is in the simple-one-for-one case. Also changed the test case count_children_memory so it does not test that which_children will produce garbage that must be reclaimed later. This is a strange thing to test and it is no longer true for all invocations of which_children.
2011-02-18Merge branch 'sverker/ets_halfword_highmem/OTP-8941' into devSverker Eriksson
* sverker/ets_halfword_highmem/OTP-8941: HALFWORD ETS Fix copyright year in some source files Fix vm crash in kernel test case seq_trace_SUITE:call remove NIF compile warning: no previous prototype for ‘nif_init’ Refuse to load NIF library on wrong VM variant (halfword/fullword) HALFWORD ETS match spec heap fragment optimization HALFWORD ETS removed eheap and improved test case t_match_spec_run HALFWORD ETS Further match spec optimization to minimize copying and garbage HALFWORD ETS db_prog_match optimization HALFWORD ETS Fix segv for match spec with several function and guards HALFWORD Make system_info mseg_alloc report both low/high mem HALFWORD Fix segv caused by erlang:halt HALFWORD Make more allocators use high mem (binary, fixed and driver) HALFWORD ETS 32-bit arch fixes and other cleanups HALFWORD ETS nicer update_element HALFWORD ETS Real matching on relative terms HALFWORD first stab at high mem alloc HALFWORD ETS relative terms Conflicts: erts/emulator/test/driver_SUITE.erl