On Thu, 2008-10-23 at 15:54 +0100, Andy Whitcroft wrote:
> @@ -217,39 +334,37 @@ int main(int argc, char *argv[])
>        * ===
>        */
> 
> +     INIT_LIST(expected_sizes, 2048 * 1024, 1024 * 1024, 64 * 1024);
> +     setup_fake_data(expected_sizes, 3);
> +
>       /*
>        * Check handling when /proc/meminfo indicates no huge page support
> +      * and the sysfs heirachy is not present.
>        */
>       meminfo_state = OVERRIDE_MISSING;
> +     sysfs_state = OVERRIDE_MISSING;
> 
>       EXPECT_SIZES(gethugepagesizes, MAX, 0, expected_sizes);
> 
>       INIT_LIST(expected_sizes, base_size);
>       EXPECT_SIZES(getpagesizes, MAX, 1, expected_sizes);
> 
> -     /*
> -      * When the sysfs heirarchy is not present ...
> -      */
> -     sysfs_state = OVERRIDE_MISSING;
> -
>       /* ... only the meminfo size is returned. */
>       meminfo_state = OVERRIDE_ON;
> -     meminfo_size = read_meminfo("Hugepagesize:") * 1024;
> 
> -     INIT_LIST(expected_sizes, meminfo_size);
> +     INIT_LIST(expected_sizes, 2048 * 1024);
>       EXPECT_SIZES(gethugepagesizes, MAX, 1, expected_sizes);
> 
> -     INIT_LIST(expected_sizes, base_size, meminfo_size);
> +     INIT_LIST(expected_sizes, base_size, 2048 * 1024);

Magic numbers :(  Since these have some correlation to the values in the
fake meminfo files, perhaps you could use some #defines?

-- 
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to