Displaying 20 results from an estimated 74 matches for "return_valu".
Did you mean:
return_val
2006 Sep 22
2
foo.expects(:blah).returns(10).then(11) syntax
...: test/mocha/expectation_test.rb
===================================================================
--- test/mocha/expectation_test.rb (revision 854)
+++ test/mocha/expectation_test.rb (working copy)
@@ -95,6 +95,12 @@
assert_equal 99, expectation.invoke
end
+ def test_should_return_values_in_order
+ expectation = Expectation.new(:expected_method).returns(9).then(10)
+ assert_equal 9, expectation.invoke
+ assert_equal 10, expectation.invoke
+ end
+
def test_should_return_nil_if_no_value_specified
expectation = Expectation.new(:expected_method)
assert_nil e...
2015 Jun 29
2
CPAN issues
Hello List,
Running CentOS Linux release 7.0.1406 (Core), and trying to update CPAN from version 1.98 to version 2.10, but it fails.
<snip>
t/97-process_setup_options.t .. ok
t/97-return_values.t .......... 6/10
# Failed test 'blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Prereq::Fails'
# at t/97-return_values.t line 49.
# got: '2'
# expected: '1'
# Failed test 'blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Make::Fail...
2016 Apr 11
1
[PATCH] RFC: php: support PHP 7
...tic void
guestfs_php_handle_dtor (zend_rsrc_list_entry *rsrc TSRMLS_DC)
+#endif
{
guestfs_h *g = (guestfs_h *) rsrc->ptr;
if (g != NULL)
@@ -191,7 +234,11 @@ PHP_FUNCTION (guestfs_create)
guestfs_set_error_handler (g, NULL, NULL);
+#if ZEND_MODULE_API_NO >= 20151012
+ ZVAL_RES(return_value, zend_register_resource(g, res_guestfs_h));
+#else
ZEND_REGISTER_RESOURCE (return_value, g, res_guestfs_h);
+#endif
}
PHP_FUNCTION (guestfs_last_error)
@@ -204,15 +251,15 @@ PHP_FUNCTION (guestfs_last_error)
RETURN_FALSE;
}
- ZEND_FETCH_RESOURCE (g, guestfs_h *, &z_g, -1, PHP...
2011 Sep 29
1
Nothing but rhythm was left after encoding and decoding by speex on ipad(XCode 4.1 48110)
....1?add "#include config.h" in arch.h) and
did the same thing with that on speex 1.0.5.
The following is the code I used to encode and decode, it works
properly in Android 3.0:
static int speexo_encode(const void *in_bytes, void *out_bytes, int size)
{
if (!codec_open)
return 0;
int return_value;
speex_bits_reset(&ebits);
//speex_echo_capture(echo_state, (short*)in_bytes, (short*)in_bytes);
//speex_preprocess_run(prep_state, (short*)in_bytes);
speex_encode_int(enc_state, (short*)in_bytes, &ebits);
if(speex_bits_nbytes(&ebits) >= (int)size) {
return_value = 0;...
2007 Oct 08
2
asterisk hangs on STRPTIME
...exten => s,n,Set(v_ts=${STRFTIME(|America/New_York|%Y-%m-%d)})
exten => s,n,NoOp(${v_ts})
;
exten => s,n,Set(v_ts=)
exten => s,n,Set(v_ts=${STRPTIME(2007-10-06
05:04:03|America/New_York|%Y-%m-%d %H:%M:%S)})
exten => s,n,NoOp(${v_ts})
;
I get the output :
-- Executing [s at return_values:6] Set("IAX2/4883-1", "v_ts=") in new stack
-- Executing [s at return_values:7] Set("IAX2/4883-1", "v_ts=2007-10-07") in
new stack
-- Executing [s at return_values:8] NoOp("IAX2/4883-1", "2007-10-07") in new
stack
-- Executing [s at r...
2008 Nov 10
4
PathFindExtension and wide strings
Hi,
What''s happening here?
require ''windows/path''
require ''windows/unicode''
include Windows::Path
include Windows::Unicode
file_a = ''bar.txt''
file_w = multi_to_wide(file_a)
p PathFindExtensionA(file_a) # ''.txt'' => OK
p PathFindExtensionW(file_w) # ''.'' => WRONG
Is Ruby chopping the
2015 Jun 29
0
CPAN issues
...t 5:08 PM, James D. Parra <jamesp at musicreports.com>
wrote:
> Hello List,
>
> Running CentOS Linux release 7.0.1406 (Core), and trying to update CPAN
> from version 1.98 to version 2.10, but it fails.
>
>
> <snip>
> t/97-process_setup_options.t .. ok
> t/97-return_values.t .......... 6/10
> # Failed test 'blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm
> Local::Prereq::Fails'
> # at t/97-return_values.t line 49.
> # got: '2'
> # expected: '1'
>
> # Failed test 'blib/script/cpan -j t/97-lib_cpan...
2007 Oct 25
2
Using strtok via win32/api
Hi all,
I''m having a little trouble with strtok:
require ''win32/api''
include Win32
strtok = API.new(''strtok'', ''PP, ''P'', ''msvcrt'')
string = "A string\tof ,,tokens\nand some more tokens";
seps = " ,\t\n";
puts "Tokens:"
token = strtok.call(string, seps)
while token
puts
2007 Oct 23
0
6 commits - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_script_function.c libswfdec/swfdec_flash_security.c
...*object,
const char *variable, SwfdecAsValue *value, guint flags, gpointer data);
+void swfdec_as_object_call_with_security
+ (SwfdecAsObject * object,
+ SwfdecSecurity * sec,
+ const char * name,
+ guint argc,
+ SwfdecAsValue * argv,
+ SwfdecAsValue * return_value);
void swfdec_as_object_collect (SwfdecAsObject * object);
guint swfdec_as_object_foreach_remove (SwfdecAsObject * object,
SwfdecAsVariableForeach func,
diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c
index 765a56c..ed0ae49 100644
--- a/libswfdec/swf...
2007 Jan 02
4
allow stubbing of previously defined methods such as "id"
...===================================================
--- lib/mocha/mock_methods.rb (revision 1114)
+++ lib/mocha/mock_methods.rb (working copy)
@@ -68,6 +68,7 @@
method_names = method_names.is_a?(Hash) ? method_names :
{ method_names => nil }
method_names.each do |method_name, return_value|
expectations << Stub.new(self, method_name,
backtrace).returns(return_value)
+ self.metaclass.send :undef_method, method_name if
self.metaclass.method_defined? method_name
end
expectations.last
end
Index: test/mocha/auto_verify_test.rb
===============...
2006 Sep 29
1
yielding consecutive values
...invoke
@invoked += 1
- yield(*@parameters_to_yield) if yield? and block_given?
+ if yield? and block_given?
+ params = @parameters_to_yield.collect do |element|
+ element.is_a?(Proc) ? element.call : element
+ end
+ yield(*params)
+ end
@return_value.is_a?(Proc) ? @return_value.call : @return_value
end
This test passes also, but I didn''t think it was necessary for the
suite...
def test_should_yield_with_block_result_1123
expected_vals = [1,2,3]
expectation = new_expectation.yields( lambda
{ expected_vals.shift...
2007 Aug 08
1
Mocking Time, delegating to original object
...objects down to where I want them, all wrapped up in a big
ugly file.
module Mocha
class Mock
def expects(method_name_or_hash, backtrace = nil, stub_method = nil)
@stub_method = stub_method
if method_name_or_hash.is_a?(Hash) then
method_name_or_hash.each do |method_name, return_value|
add_expectation(Expectation.new(self, method_name,
backtrace).returns(return_value))
end
else
add_expectation(Expectation.new(self, method_name_or_hash, backtrace))
end
end
def stubs(method_name_or_hash, backtrace = nil, stub_method = nil)
@stu...
2014 Sep 09
2
[LLVMdev] [Compiler-RT] [ARM] Where __aeabi_[il]div0 builtins should be implemented?
...enough. However, the point is that emulating GCC's behavior of the
exception is what I was referring to.
> Today we return either zero (in divmod/div/mod) or the argument (when
> calling div0 directly), and that's just wrong.
Quoting the RTABI:
1.
int __aeabi_idiv0(int return_value);
long long __aeabi_ldiv0(long long return_value);
The *div0 functions:
Return the value passed to them as a parameter.
Is my copy out of date?
> > Why 0 and not infinity? Or some other value?
>
> Because 0 is what it was before.
>
> cheers,
> --renato
&...
2007 Nov 14
0
7 commits - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_super.c libswfdec/swfdec_as_super.h
...as_object.c b/libswfdec/swfdec_as_object.c
index 1127cef..9a723f4 100644
--- a/libswfdec/swfdec_as_object.c
+++ b/libswfdec/swfdec_as_object.c
@@ -1283,7 +1283,7 @@ swfdec_as_object_create (SwfdecAsFunction *fun, guint n_args,
frame = swfdec_as_function_call_no_preload (fun, new, n_args, args, return_value);
frame->construct = TRUE;
- swfdec_as_super_new (frame, new, TRUE);
+ swfdec_as_super_new (frame, new, new->prototype);
swfdec_as_frame_preload (frame);
}
diff --git a/libswfdec/swfdec_as_super.c b/libswfdec/swfdec_as_super.c
index 1a4df38..9e67b40 100644
--- a/libswfdec/swfdec_a...
2006 Sep 29
2
multiyield
...-> expectation
# :call-seq: returns(*values) -> expectation
@@ -218,6 +228,7 @@
def invoke
@invoked += 1
yield(*@parameters_to_yield) if yield? and block_given?
+ @parameters_to_yield.each { |element| yield(element) } if
multiyield? and block_given?
@return_value.is_a?(Proc) ? @return_value.call : @return_value
end
Is this already in the framework and I missed it?
2010 Jan 05
3
R matching lat/lon pairs from two datasets?
...t2[i],lat)
loc2 <- match(lon2[i], lon)
print(loc); print(loc2)
#Need to test to make sure loc equals loc2
freq_ppt <-
c(data[i,4],data[i,6],data[i,8],data[i,10],data[i,12],data[i,14],data[i,16],data[i,18],data[i,20],data[i,22])
print(freq_ppt)
return_value <- approx(freq_ppt,yrs,xout=data2[i,3])
print(return_value)
}
Thanks for your help,
Doug
--
---------------------------------
Douglas M. Hultstrand, MS
Senior Hydrometeorologist
Metstat, Inc. Windsor, Colorado
voice: 970.686.1253
email: dmhultst at metstat.com
web: http://www.metsta...
2003 Oct 17
1
Script Control of sftp
...$process = proc_open(
"$sftp $User@$Server",
$descriptorspec,
$pipes
);
if (is_resource($process)) {
fwrite($pipes[0], $Password."\n");
fclose($pipes[0]);
while(!feof($pipes[1])) {
echo fgets($pipes[1], 1024);
}
fclose($pipes[1]);
$return_value = proc_close($process);
echo "\ncommand returned $return_value\n";
}
?>
--
Alan Little
Holotech Enterprises
2017 Jan 13
11
[Bug 99396] New: Crash in nouveau_dri.so when switching apps with alt-tab in Gnome
https://bugs.freedesktop.org/show_bug.cgi?id=99396
Bug ID: 99396
Summary: Crash in nouveau_dri.so when switching apps with
alt-tab in Gnome
Product: Mesa
Version: git
Hardware: Other
OS: All
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/DRI/nouveau
2007 Mar 04
4
Rails functional testing and Mocha
...thing in terms of undefining methods.
class AnyInstanceWithID
attr_reader :expectations
def initialize
@expectations = []
end
def stubs(method_names)
method_names = method_names.is_a?(Hash) ? method_names :
{ method_names => nil }
method_names.each do |method_name, return_value|
expectations << Mocha::Stub.new(nil, method_name,
caller).returns(return_value)
end
expectations.last
end
def expects(method_names)
method_names = method_names.is_a?(Hash) ? method_names :
{ method_names => nil }
method_names.each do |method_name,...
2002 Jul 20
3
Vorbis 1.0 spec notes, part 1
...a] is nonzero )" -> "if ( [sign] is nonzero )"
- question: What are the tolerances on this function? Is it acceptable
for me to cast mantissa to double, multiply it by the double returned
from pow(2,(dobule)(exponent-788)), and cast the result to float?
* lookup1_values
- given:
return_value ^ codebook_dimensions = codebook_entries
-> is this correct: ? (I'm out of school so my algebra is slacking...)
-> return_value = log(codebook_entires) / log(codebook_dimensions)
-> where return_value truncates the double result to int?
<p>vorbis-spec-codebook.html
* introduce...