Add FlagGuard for easier modification of flags for unit tests

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 9
    • Affects Version/s: 9
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: