rpcrt4/tests: Add more tests for integer ranges to show that ranges are independent.

Reported by Jérôme Gardou.
This commit is contained in:
Alexandre Julliard 2011-09-19 13:17:41 +02:00
parent 977e15b762
commit cb5beede16
2 changed files with 13 additions and 5 deletions

View file

@ -599,9 +599,14 @@ str_t __cdecl s_get_filename(void)
return (char *)__FILE__;
}
int __cdecl s_echo_ranged_int(int n)
int __cdecl s_echo_ranged_int(int i, int j, int k)
{
return n;
return min( 100, i + j + k );
}
int __cdecl s_echo_ranged_int2(int i)
{
return i;
}
void __cdecl s_get_ranged_enum(renum_t *re)
@ -934,10 +939,12 @@ basic_tests(void)
ok(!strcmp(str, __FILE__), "get_filename() returned %s instead of %s\n", str, __FILE__);
midl_user_free(str);
x = echo_ranged_int(0);
x = echo_ranged_int(0,0,0);
ok(x == 0, "echo_ranged_int() returned %d instead of 0\n", x);
x = echo_ranged_int(100);
x = echo_ranged_int(10,20,100);
ok(x == 100, "echo_ranged_int() returned %d instead of 100\n", x);
x = echo_ranged_int2(40);
ok(x == 40, "echo_ranged_int() returned %d instead of 40\n", x);
if (!old_windows_version)
{

View file

@ -363,7 +363,8 @@ cpp_quote("#endif")
const int RE_MAX = RE3;
typedef [range(RE_MIN, RE_MAX)] enum renum renum_t;
typedef [range(0, 100)] int rint_t;
rint_t echo_ranged_int([range(0, 100)] int n);
rint_t echo_ranged_int([range(0, 10)] int i, [range(0, 20)] int j, [range(0, 100)] int k);
rint_t echo_ranged_int2([range(0, 40)] int i);
void get_ranged_enum([out] renum_t *re);
void context_handle_test(void);