OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 } | 523 } |
524 #endif // DEBUG | 524 #endif // DEBUG |
525 } | 525 } |
526 | 526 |
527 | 527 |
528 class TestConfig { | 528 class TestConfig { |
529 public: | 529 public: |
530 typedef int Key; | 530 typedef int Key; |
531 typedef int Value; | 531 typedef int Value; |
532 static const int kNoKey; | 532 static const int kNoKey; |
533 static const int kNoValue; | 533 static int NoValue() { return 0; } |
534 static inline int Compare(int a, int b) { | 534 static inline int Compare(int a, int b) { |
535 if (a < b) | 535 if (a < b) |
536 return -1; | 536 return -1; |
537 else if (a > b) | 537 else if (a > b) |
538 return 1; | 538 return 1; |
539 else | 539 else |
540 return 0; | 540 return 0; |
541 } | 541 } |
542 }; | 542 }; |
543 | 543 |
544 | 544 |
545 const int TestConfig::kNoKey = 0; | 545 const int TestConfig::kNoKey = 0; |
546 const int TestConfig::kNoValue = 0; | |
547 | 546 |
548 | 547 |
549 static unsigned PseudoRandom(int i, int j) { | 548 static unsigned PseudoRandom(int i, int j) { |
550 return ~(~((i * 781) ^ (j * 329))); | 549 return ~(~((i * 781) ^ (j * 329))); |
551 } | 550 } |
552 | 551 |
553 | 552 |
554 TEST(SplayTreeSimple) { | 553 TEST(SplayTreeSimple) { |
555 v8::internal::V8::Initialize(NULL); | 554 v8::internal::V8::Initialize(NULL); |
556 static const unsigned kLimit = 1000; | 555 static const unsigned kLimit = 1000; |
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1824 bool in_second = CharacterInSet(&l2, i); | 1823 bool in_second = CharacterInSet(&l2, i); |
1825 CHECK((in_first || in_second) == CharacterInSet(&all, i)); | 1824 CHECK((in_first || in_second) == CharacterInSet(&all, i)); |
1826 } | 1825 } |
1827 } | 1826 } |
1828 | 1827 |
1829 | 1828 |
1830 TEST(Graph) { | 1829 TEST(Graph) { |
1831 V8::Initialize(NULL); | 1830 V8::Initialize(NULL); |
1832 Execute("\\b\\w+\\b", false, true, true); | 1831 Execute("\\b\\w+\\b", false, true, true); |
1833 } | 1832 } |
OLD | NEW |