Closed Bug 490072 Opened 15 years ago Closed 15 years ago

Rewrite XPCOM unit tests to use new synchronization API

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: cjones, Assigned: cjones)

References

Details

Attachments

(2 files, 1 obsolete file)

Where possible.  It's a good test of the new code, and we should be guaranteeing that old XPCOM stuff works with the new sync primitives.  Depends on bug 456272 because I don't trust the hack job I made of the old deadlock detector as part of bug 58904.

Let's see if porky.py is up to this job...
And BTW, thanks porky.py!
Comment on attachment 377362 [details] [diff] [review]
First cut, awaiting tryserver approval

Looks good! I noticed one thing when glancing through this...

-        nsAutoLock guard(gLock);
+        MutexAutoLock  guard(*gLock);

When rewriting this pattern the tools seem to consistently put two spaces between the type and the variable name. Is that intentional?
(In reply to comment #3)
> (From update of attachment 377362 [details] [diff] [review])
> Looks good! I noticed one thing when glancing through this...
> 
> -        nsAutoLock guard(gLock);
> +        MutexAutoLock  guard(*gLock);
> 
> When rewriting this pattern the tools seem to consistently put two spaces
> between the type and the variable name. Is that intentional?

Oops, no.  Let me check into this ...
Attached patch v2Splinter Review
Fixed up some porky bugs, regenerated.
Attachment #377362 - Attachment is obsolete: true
Attachment #377493 - Flags: review?(benjamin)
For future reference, the steps I took to generate the patch were:

  (1) Run the porky rewrite on preprocessed firefox source
  (2) Apply the generated patch
  (3) Compile the unit tests, fix errors
      - all tests needed to have |#include "mozilla/..."; using namespace mozilla;| added by hand, since neither porky nor pork supports this yet
      - porky doesn't rewrite constructor expressions well yet; |nsAutoLock _(lockPtr)| was rewritten to |MutexAutoLock _(lockPtr)|, but needed to be |MutexAutoLock _(*lockPtr)|.  I fixed this by hand.
  (4) Fiddle with whitespace glitches, such as the table-alignment of class members being screwed up
Attachment #377493 - Flags: review?(benjamin) → review+
Pushed
b43beeb87f15 Chris Jones - bug 490072: upgrade XPCOM unit tests to new thread sync API. drop nsAutoLock test. r=bsmedberg
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: