Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: Source/core/testing/TypeConversions.h

Issue 54903014: [EnforceRange] doesn't enforce range of a short (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Extend layout test Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 20 matching lines...) Expand all
31 #include "wtf/RefCounted.h" 31 #include "wtf/RefCounted.h"
32 32
33 namespace WebCore { 33 namespace WebCore {
34 34
35 class TypeConversions : public RefCounted<TypeConversions> { 35 class TypeConversions : public RefCounted<TypeConversions> {
36 public: 36 public:
37 static PassRefPtr<TypeConversions> create() { return adoptRef(new TypeConver sions()); } 37 static PassRefPtr<TypeConversions> create() { return adoptRef(new TypeConver sions()); }
38 38
39 long testLong() { return m_long; } 39 long testLong() { return m_long; }
40 void setTestLong(long value) { m_long = value; } 40 void setTestLong(long value) { m_long = value; }
41 long testEnforceRangeLong() { return m_long; }
42 void setTestEnforceRangeLong(long value) { m_long = value; }
43 unsigned long testUnsignedLong() { return m_unsignedLong; } 41 unsigned long testUnsignedLong() { return m_unsignedLong; }
44 void setTestUnsignedLong(unsigned long value) { m_unsignedLong = value; } 42 void setTestUnsignedLong(unsigned long value) { m_unsignedLong = value; }
45 unsigned long testEnforceRangeUnsignedLong() { return m_unsignedLong; }
46 void setTestEnforceRangeUnsignedLong(unsigned long value) { m_unsignedLong = value; }
47 43
48 long long testLongLong() { return m_longLong; } 44 long long testLongLong() { return m_longLong; }
49 void setTestLongLong(long long value) { m_longLong = value; } 45 void setTestLongLong(long long value) { m_longLong = value; }
50 long long testEnforceRangeLongLong() { return m_longLong; }
51 void setTestEnforceRangeLongLong(long long value) { m_longLong = value; }
52 unsigned long long testUnsignedLongLong() { return m_unsignedLongLong; } 46 unsigned long long testUnsignedLongLong() { return m_unsignedLongLong; }
53 void setTestUnsignedLongLong(unsigned long long value) { m_unsignedLongLong = value; } 47 void setTestUnsignedLongLong(unsigned long long value) { m_unsignedLongLong = value; }
54 unsigned long long testEnforceRangeUnsignedLongLong() { return m_unsignedLon gLong; }
55 void setTestEnforceRangeUnsignedLongLong(unsigned long long value) { m_unsig nedLongLong = value; }
56 48
57 int8_t testByte() { return m_byte; } 49 int8_t testByte() { return m_byte; }
58 void setTestByte(int8_t value) { m_byte = value; } 50 void setTestByte(int8_t value) { m_byte = value; }
59 int8_t testEnforceRangeByte() { return m_byte; }
60 void setTestEnforceRangeByte(int8_t value) { m_byte = value; }
61
62 uint8_t testOctet() { return m_octet; } 51 uint8_t testOctet() { return m_octet; }
63 void setTestOctet(uint8_t value) { m_octet = value; } 52 void setTestOctet(uint8_t value) { m_octet = value; }
64 uint8_t testEnforceRangeOctet() { return m_octet; } 53
65 void setTestEnforceRangeOctet(uint8_t value) { m_octet = value; } 54 int16_t testShort() { return m_short; }
55 void setTestShort(int16_t value) { m_short = value; }
56 uint16_t testUnsignedShort() { return m_unsignedShort; }
57 void setTestUnsignedShort(uint16_t value) { m_unsignedShort = value; }
66 58
67 private: 59 private:
68 TypeConversions() 60 TypeConversions()
69 { 61 {
70 } 62 }
71 63
72 long m_long; 64 long m_long;
73 unsigned long m_unsignedLong; 65 unsigned long m_unsignedLong;
74 long long m_longLong; 66 long long m_longLong;
75 unsigned long long m_unsignedLongLong; 67 unsigned long long m_unsignedLongLong;
76 int8_t m_byte; 68 int8_t m_byte;
77 uint8_t m_octet; 69 uint8_t m_octet;
70 int16_t m_short;
71 uint16_t m_unsignedShort;
78 }; 72 };
79 73
80 } // namespace WebCore 74 } // namespace WebCore
81 75
82 #endif 76 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698