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

Side by Side Diff: src/vm/object_test.cc

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 months 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
« no previous file with comments | « src/vm/object_memory_test.cc ('k') | src/vm/pair.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dartino project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dartino project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 #include <stdio.h> 5 #include <stdio.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 7
8 #include "src/shared/assert.h" 8 #include "src/shared/assert.h"
9 #include "src/shared/flags.h" 9 #include "src/shared/flags.h"
10 #include "src/shared/test_case.h" 10 #include "src/shared/test_case.h"
11 11
12 #include "src/vm/object.h" 12 #include "src/vm/object.h"
13 #include "src/vm/program.h" 13 #include "src/vm/program.h"
14 14
15 namespace fletch { 15 namespace dartino {
16 16
17 static void CheckValidSmi(word value) { 17 static void CheckValidSmi(word value) {
18 EXPECT(Smi::IsValid(value)); 18 EXPECT(Smi::IsValid(value));
19 EXPECT_EQ(Smi::FromWord(value)->value(), value); 19 EXPECT_EQ(Smi::FromWord(value)->value(), value);
20 } 20 }
21 21
22 static void CheckInvalidSmi(word value) { EXPECT(!Smi::IsValid(value)); } 22 static void CheckInvalidSmi(word value) { EXPECT(!Smi::IsValid(value)); }
23 23
24 TEST_CASE(Smi) { 24 TEST_CASE(Smi) {
25 CheckValidSmi(0); 25 CheckValidSmi(0);
26 CheckValidSmi(-1); 26 CheckValidSmi(-1);
27 CheckValidSmi(1); 27 CheckValidSmi(1);
28 CheckValidSmi(Smi::kMinValue); 28 CheckValidSmi(Smi::kMinValue);
29 CheckValidSmi(Smi::kMaxValue); 29 CheckValidSmi(Smi::kMaxValue);
30 CheckValidSmi(Smi::kMinPortableValue); 30 CheckValidSmi(Smi::kMinPortableValue);
31 CheckValidSmi(Smi::kMaxPortableValue); 31 CheckValidSmi(Smi::kMaxPortableValue);
32 32
33 CheckInvalidSmi(Smi::kMinValue - 1); 33 CheckInvalidSmi(Smi::kMinValue - 1);
34 CheckInvalidSmi(Smi::kMaxValue + 1); 34 CheckInvalidSmi(Smi::kMaxValue + 1);
35 35
36 EXPECT(Smi::kMinValue <= Smi::kMinPortableValue); 36 EXPECT(Smi::kMinValue <= Smi::kMinPortableValue);
37 EXPECT(Smi::kMaxValue >= Smi::kMaxPortableValue); 37 EXPECT(Smi::kMaxValue >= Smi::kMaxPortableValue);
38 } 38 }
39 39
40 } // namespace fletch 40 } // namespace dartino
OLDNEW
« no previous file with comments | « src/vm/object_memory_test.cc ('k') | src/vm/pair.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698