Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8159370

Add FlagGuard for easier modification of flags for unit tests

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • None
    • b127

      Add a class FlagGuard that allows for easier modification of flags for unit tests. A TEST_VM unit tests that wants to change a flag simply has to create a FlagGuard:

      FlagGuard g("MaxGCPauseMillis");

      together with a simple macro, GUARD_FLAG, a test only has to write:

      GUARD_FLAG(MaxGCPauseMillis);

      and can then the test can change the flag however it wants, the flags value will be restored when the test is done.

            ehelin Erik Helin
            ehelin Erik Helin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: