5 // This tests that the suppression for the leak in setenv() works. See bug
14 setenv("MYVAR", val1
, /*overwrite*/0); // makes a copy which is later leaked
15 assert( 0 == strcmp(getenv("MYVAR"), val1
) );
17 setenv("MYVAR", val2
, /*overwrite*/1); // makes a copy which is later leaked
18 assert( 0 == strcmp(getenv("MYVAR"), val2
) );
20 setenv("MYVAR", val3
, /*overwrite*/0); // doesn't overwrite MYVAR=val2
21 assert( 0 == strcmp(getenv("MYVAR"), val2
) );
23 putenv("MYVAR=xxxx"); // no leak for putenv()
24 assert( 0 == strcmp(getenv("MYVAR"), "xxxx") );
27 assert( NULL
== getenv("MYVAR") );