Comments (6)
The reason is that the two arguments in EXPECT_EQ have different types: one is signed integer and the other is unsigned. Maybe you can show me your code.
from balgo.
Data type is unsigned int by ``unsigned int value_one = 1, instead of 1 or 2 of integer type in trie_traits_test.cpp file.
unsigned int value_one = 1;
unsigned int value_two = 2;
TEST(UIntTraits, Traits) {
EXPECT_EQ(value_one, sizeof(UIntTraits<1>::UInt));
EXPECT_EQ(value_two, sizeof(UIntTraits<2>::UInt));
....
}
In additional, it's can casting type of them to unsigned int type with
EXPECT_EQ(static_cast<unsigned int>(1), sizeof(UIntTraits<1>::UInt));
.
I see UnitTraits<1>::UInt from typedef typename UIntTraits<sizeof(Char)>::UInt UChar;
on balgo/trie/trie_traits.h file name. It have declared unsigned integer of data type.
from balgo.
It's very strange that you got an "comparison between signed and unsigned integer expressions" error, because value_one and the return type of sizeof are both unsigned integer. I don't know why.
Are you sure the error line "trie_traits_test.cpp:33" is "EXPECT_EQ(value_one, sizeof(UIntTraits<1>::UInt));" ?
from balgo.
In trie_traits.h header file declared the data types of unsigned integer such as uintBit_t. I regress test with EXPECT_EQ(value_one, sizeof(UIntTraits<1>::UInt));
is okay in result test. It's result like declared the static casting type by EXPECT_EQ(static_cast<unsigned int>(1), sizeof(UIntTraits<1>::UInt));
.
from balgo.
I misunderstood what you mean before, now I got it.
I have updated the code and added some more strict compiling options.
My solution is just replacing 1 with 1U.
Thank you for reminding me of that.
from balgo.
Okay, It should close issues by set 1U that supported data type unsigned integer.
from balgo.
Related Issues (2)
- Segmentation faults HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from balgo.