Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/external/bsd/atf/dist



On 11/16/11 12:46 PM, Christos Zoulas wrote:
Module Name:    src
Committed By:   christos
Date:           Wed Nov 16 17:46:16 UTC 2011

Modified Files:
        src/external/bsd/atf/dist/atf-c++/detail: text.cpp text.hpp
        src/external/bsd/atf/dist/atf-run: requirements.cpp test-program.cpp

Log Message:
PR/45619: jmmv: Allow atf tests to request a minimum amount of memory

Could you run intrusive changes to atf for review please?

The current changes are incomplete and inappropriate, so they are going to make integration upstream a pain.

+int64_t
+impl::to_number(const std::string&  str)
+{
+       int64_t num;
+       ::dehumanize_number(str.c_str(),&num);

This adds a dependency on NetBSD that should not be there.

[...]
+static
+std::string
+check_memory(const std::string&  memory)
+{
+    // Make sure we have enough memory
+    int64_t memneed = atf::text::to_number(memory);
+    int64_t memavail;
+    size_t len = sizeof(memavail);
+
+    if (::sysctlbyname("hw.usermem64",&memavail,&len, NULL, 0) == -1) {

Same here and below in the same function. This is NetBSD specific and there is no provisions to support other systems.

[...]

Lastly, this has been added without absolutely no tests and no documentation. (And there seem to be whitespace issues, although I can't tell if these are my mua's fault...)

Home | Main Index | Thread Index | Old Index