Skip to content

Commit 0f96b56

Browse files
authored
Merge pull request Tencent#1202 from Sumoren/msc_long_part2
Change long/ulong as int/uint on MSC unit tests to be more inline wit…
2 parents d79533c + 27424d5 commit 0f96b56

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

test/unittest/valuetest.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,12 @@ TEST(Value, Int) {
443443
#ifdef _MSC_VER
444444
// long as int on MSC platforms
445445
RAPIDJSON_STATIC_ASSERT(sizeof(long) == sizeof(int));
446-
z.SetInt(1234);
446+
z.SetInt(2222);
447447
EXPECT_TRUE(z.Is<long>());
448-
EXPECT_EQ(1234l, z.Get<long>());
448+
EXPECT_EQ(2222l, z.Get<long>());
449+
EXPECT_EQ(3333l, z.Set(3333l).Get<long>());
450+
EXPECT_EQ(4444l, z.Set<long>(4444l).Get<long>());
451+
EXPECT_TRUE(z.IsInt());
449452
#endif
450453
}
451454

@@ -497,9 +500,12 @@ TEST(Value, Uint) {
497500
#ifdef _MSC_VER
498501
// unsigned long as unsigned on MSC platforms
499502
RAPIDJSON_STATIC_ASSERT(sizeof(unsigned long) == sizeof(unsigned));
500-
z.SetUint(1234);
503+
z.SetUint(2222);
501504
EXPECT_TRUE(z.Is<unsigned long>());
502-
EXPECT_EQ(1234ul, z.Get<unsigned long>());
505+
EXPECT_EQ(2222ul, z.Get<unsigned long>());
506+
EXPECT_EQ(3333ul, z.Set(3333ul).Get<unsigned long>());
507+
EXPECT_EQ(4444ul, z.Set<unsigned long>(4444ul).Get<unsigned long>());
508+
EXPECT_TRUE(x.IsUint());
503509
#endif
504510
}
505511

0 commit comments

Comments
 (0)