mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Ensure that unmatched arity fails in C++
This commit is contained in:
parent
b3ddeac33e
commit
a3daf8e49a
2 changed files with 27 additions and 1 deletions
|
@ -22,5 +22,18 @@ begin
|
||||||
end
|
end
|
||||||
|
|
||||||
if ok
|
if ok
|
||||||
create_makefile("-test-/cxxanyargs")
|
$srcs = %w[cxxanyargs.cpp]
|
||||||
|
$cleanfiles << "failure.failed"
|
||||||
|
create_makefile("-test-/cxxanyargs") do |mk|
|
||||||
|
mk << <<MK
|
||||||
|
|
||||||
|
cxxanyargs.#$OBJEXT: failure.failed
|
||||||
|
|
||||||
|
failure.failed: failure.cpp
|
||||||
|
\t$(Q)$(RUBY) -rfileutils \\
|
||||||
|
\t -e "err = IO.popen(%[$(MAKE) failure.#$OBJEXT], err:[:child, :out], &:read)" \\
|
||||||
|
\t -e "abort err unless /rb_define_method/ =~ err" \\
|
||||||
|
\t -e "FileUtils.touch(*ARGV)" $@
|
||||||
|
MK
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
13
ext/-test-/cxxanyargs/failure.cpp
Normal file
13
ext/-test-/cxxanyargs/failure.cpp
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#include <ruby/ruby.h>
|
||||||
|
|
||||||
|
static VALUE
|
||||||
|
func_arg1(VALUE self, VALUE arg1)
|
||||||
|
{
|
||||||
|
return arg1;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" void
|
||||||
|
Init_failure(void)
|
||||||
|
{
|
||||||
|
rb_define_method(rb_cObject, "arg1", func_arg1, 0);
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue