Closed
Bug 575379
Opened 15 years ago
Closed 15 years ago
jsapi-test for JSClass::getProperty
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: wes, Unassigned)
References
Details
Attachments
(1 file)
|
2.47 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
This is a trivial test based on bl's problem in #jsapi today.
| Reporter | ||
Updated•15 years ago
|
Attachment #454608 -
Attachment is patch: true
Attachment #454608 -
Attachment mime type: application/octet-stream → text/plain
Attachment #454608 -
Flags: review?(jorendorff)
Comment 1•15 years ago
|
||
What was bl's problem? Isn't it better addressed by docs, since there's no code fix to the engine that this jsapi-test QAs?
/be
| Reporter | ||
Comment 2•15 years ago
|
||
bl's problem was in fact user error - but I didn't realize that when I initially wrote the test.
Figured I'd post the test case as a "take if you want it" - not sure what jsapi-test's longer-term goals are, if they are only to watch regressions or to someday provide individual API coverage exercise.
Sorry for the crappy description, I forgot the wider audience.
Comment 3•15 years ago
|
||
Comment on attachment 454608 [details] [diff] [review]
Test program and relevent Makefile.in tweak
I'll take a test if I can get it, any day.
In jsapi-tests/Makefile.in:
> testNewObject.cpp \
> testOps.cpp \
> testPropCache.cpp \
> testTrap.cpp \
> testSameValue.cpp \
> testSeal.cpp \
> testXDR.cpp \
> testSetPropertyWithNativeGetterStubSetter.cpp \
>+ testClassGetter.cpp \
Please put the last two into alphabetical order with the rest.
>+ * Tests the JSClass get hook
"JSClass::getProperty hook", please.
>+static struct {
>+ int test_fn;
>+ int test_prop_get;
>+} called;
Just make two variables.
>+ CHECK(definePrint());
Delete this line.
>+BEGIN_TEST(testClassGetter)
[...]
>+END_TEST(testClassGetter)
By convention these test names are filename_testname, so this should be testClassGetter_isCalled or something.
>+ CHECK_SAME(INT_TO_JSVAL(i), INT_TO_JSVAL(called.test_fn));
>+ CHECK_SAME(INT_TO_JSVAL(4 * i), INT_TO_JSVAL(called.test_prop_get));
The order of arguments to CHECK_SAME is (actual, expected). So swap them.
r=me with those changes; if you have a chance, please make the changes and then commit and push this to tracemonkey. Thanks!
Attachment #454608 -
Flags: review?(jorendorff) → review+
Updated•15 years ago
|
Summary: jsapi-test for JSClass::get → jsapi-test for JSClass::getProperty
Comment 4•15 years ago
|
||
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.
Description
•