摘要: Teaching Google Test How to Print Your Values 自定义打印的消息 When a test assertion such as EXPECT_EQ fails, Google Test prints the argument values to help you debug. It does this using a user-extensible ... 阅读全文
posted @ 2016-08-12 12:36 beichen2012 阅读(243) 评论(0) 推荐(0)
摘要: Now that you have read Primer and learned how to write tests using Google Test, it’s time to learn some new tricks. This document will show you more assertions as well as how to construct complex fail... 阅读全文
posted @ 2016-08-12 09:46 beichen2012 阅读(309) 评论(0) 推荐(0)
摘要: content Setting up a New Test ProjectBasic ConceptsAssertionsBasic AssertionsBinary ComparisonString ComparisonSimple TestsTest Fixtures: Using the Same Data Configuration for Multiple TestsInvoking... 阅读全文
posted @ 2016-08-12 09:45 beichen2012 阅读(418) 评论(0) 推荐(0)
摘要: float 浮点数转成定点数计算其加法和乘法 需要注意的是,以下的程序是建立在下述条件为真的情况下的: (sizeof(float) == 4 && sizeof(long long) == 8 && sizeof(int) == 4) == ture 也就是说,一定要保证float和int是占4个字节(32bits),long long是占8个字节(64bits)的。 1, 浮点数转定点... 阅读全文
posted @ 2016-08-12 09:44 beichen2012 阅读(849) 评论(0) 推荐(0)
摘要: IEEE754标准中,浮点数的内存布局 以下仅以float(内存中占据4个字节,32bits)来说明,double(8个字节,64bits)同理,只是有细微的差别。 float的内存分布 IEEE754规定,32bit的float在内存中是这样分布的: 符号位(S) 阶码(E) 尾数(M) 1 8 23 整数、浮点数在内存中都是以二进制的形式存在... 阅读全文
posted @ 2016-08-10 13:07 beichen2012 阅读(686) 评论(0) 推荐(0)