make test_webidl robust to stack start locations

This commit is contained in:
Alon Zakai 2014-12-08 17:43:17 -08:00
Родитель c702b43fda
Коммит 4c0ee8607b
4 изменённых файлов: 11 добавлений и 9 удалений

Просмотреть файл

@ -49,9 +49,10 @@ caught: a JSImplementation must implement all functions, you forgot Child2JS::vi
|hello|43|world|41| |hello|43|world|41|
12.35 12.35
a returned string a returned string
C string address: "string A" 0xa30 C string addresses: "string A" ? "string A" => 0
C string address: "string B" 0xa40 C string addresses: "string B" ? "string B" => 0
C string address: "string A" 0xa30 C string addresses: "string A" ? "string B" => -1
C string addresses: "string B" ? "string A" => 1
10 10
object object
10 10

Просмотреть файл

@ -104,9 +104,10 @@ suser.PrintFloat(12.3456);
TheModule.print(suser.returnAString()); TheModule.print(suser.returnAString());
// Verify that subsequent calls with the same string value re-use the string storage. // Verify that subsequent calls with the same string value re-use the string storage.
suser.PrintCStringAddress("string A"); suser.CompareCStringAddress("string A", "string A");
suser.PrintCStringAddress("string B"); suser.CompareCStringAddress("string B", "string B");
suser.PrintCStringAddress("string A"); suser.CompareCStringAddress("string A", "string B");
suser.CompareCStringAddress("string B", "string A");
var bv = new TheModule.RefUser(10); var bv = new TheModule.RefUser(10);
var bv2 = new TheModule.RefUser(11); var bv2 = new TheModule.RefUser(11);

Просмотреть файл

@ -60,8 +60,8 @@ public:
void PrintFloat(float f) { printf("%.2f\n", f); } void PrintFloat(float f) { printf("%.2f\n", f); }
const char* returnAString() { return "a returned string"; } const char* returnAString() { return "a returned string"; }
void PrintCStringAddress(const char* s) { void CompareCStringAddress(const char* s1, const char* s2) {
printf("C string address: \"%s\" %p\n", s, s); printf("C string addresses: \"%s\" ? \"%s\" => %d\n", s1, s2, s1 < s2 ? -1 : (s1 == s2 ? 0 : 1));
} }
}; };

Просмотреть файл

@ -52,7 +52,7 @@ interface StringUser {
void Print(long anotherInteger, DOMString anotherString); void Print(long anotherInteger, DOMString anotherString);
void PrintFloat(float f); void PrintFloat(float f);
[Const] DOMString returnAString(); [Const] DOMString returnAString();
void PrintCStringAddress(DOMString str); void CompareCStringAddress(DOMString str1, DOMString str2);
}; };
interface RefUser { interface RefUser {