Ignore:
Timestamp:
Jan 8, 2008, 3:33:49 AM (17 years ago)
Author:
[email protected]
Message:

Turn testIsInteger assertions into compile-time asserts and move them into HashTraits.h where possible.

Reviewed by Maciej Stachowiak.

  • kjs/testkjs.cpp:
  • wtf/HashTraits.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/testkjs.cpp

    r28595 r29293  
    5454using namespace WTF;
    5555
    56 static void testIsInteger();
    5756static bool fillBufferWithContentsOfFile(const UString& fileName, Vector<char>& buffer);
    5857
     
    118117  virtual UString className() const { return "global"; }
    119118};
     119COMPILE_ASSERT(!IsInteger<GlobalImp>::value, WTF_IsInteger_GlobalImp_false);
    120120
    121121class TestFunctionImp : public JSObject {
     
    303303int kjsmain(int argc, char** argv)
    304304{
    305   testIsInteger();
    306 
    307305  JSLock lock;
    308306 
     
    318316
    319317  return success ? 0 : 3;
    320 }
    321 
    322 static void testIsInteger()
    323 {
    324   // Unit tests for WTF::IsInteger. Don't have a better place for them now.
    325   // FIXME: move these once we create a unit test directory for WTF.
    326 
    327   ASSERT(IsInteger<bool>::value);
    328   ASSERT(IsInteger<char>::value);
    329   ASSERT(IsInteger<signed char>::value);
    330   ASSERT(IsInteger<unsigned char>::value);
    331   ASSERT(IsInteger<short>::value);
    332   ASSERT(IsInteger<unsigned short>::value);
    333   ASSERT(IsInteger<int>::value);
    334   ASSERT(IsInteger<unsigned int>::value);
    335   ASSERT(IsInteger<long>::value);
    336   ASSERT(IsInteger<unsigned long>::value);
    337   ASSERT(IsInteger<long long>::value);
    338   ASSERT(IsInteger<unsigned long long>::value);
    339 
    340   ASSERT(!IsInteger<char*>::value);
    341   ASSERT(!IsInteger<const char* >::value);
    342   ASSERT(!IsInteger<volatile char* >::value);
    343   ASSERT(!IsInteger<double>::value);
    344   ASSERT(!IsInteger<float>::value);
    345   ASSERT(!IsInteger<GlobalImp>::value);
    346318}
    347319
Note: See TracChangeset for help on using the changeset viewer.