Re: Test suite results what they mean and how to evaluate

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

 



Thanks Ian,

After looking at the mmap test the return was ERROR not FAILED and
apparently that is what was expected.


class T {
  int i;
public:
  T() {
    i = 1;
    printf("T() at %x\n", this);
  }
  T(const T& o) {
    i = o.i;
    printf("T(const T&) at %x <-- %x\n", this, &o);
  }
  T operator +(const T& o) {
    T r;
    r.i = this->i + o.i;
    return r;
  }
  operator int () {
    return i;
  }
  ~T() { printf("~T() at %x\n", this); }
} s, b;

int foo() { return getenv("TEST") == 0; }

int main() {
  printf("foo()=%d\n",foo());
  int i = foo() ? s+b : s;
  printf("i==%d\n",i);
  return i != 2;
}


The temp.C -std=c++98 & -std=c++11 I don't really understand.  I pulled
test.C out, compiled it with the info I pulled out of the logs, set the
LD_LIBRARY_PATH and ran it.  The result is 2 when the TEST environment
variable is not set and 1 when it is (I added the printf statements to
main.)

This only leaves me with the question "What is this testing?" 
I assumed it was a test to see if the compiler recognized some particular
syntax, but this code's output seems to be determined by the TEST
environment variable.  Which the code does not check TEST before hand but
seems to expect it to be set.  This may be valid for the expected
environment.

Mark
   



--
View this message in context: http://gcc.1065356.n5.nabble.com/Test-suite-results-what-they-mean-and-how-to-evaluate-tp1001613p1001742.html
Sent from the gcc - Help mailing list archive at Nabble.com.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux