Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
30061d48
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
30061d48
编写于
4月 05, 2018
作者:
Y
Yi Wang
提交者:
GitHub
4月 05, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix cpplint errors in paddle/fluid/string (#9667)
* Fix cpplint errors in paddle/fluid/string * Fix unit test error * Correct
上级
49c665ba
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
9 addition
and
7 deletion
+9
-7
paddle/fluid/string/piece.cc
paddle/fluid/string/piece.cc
+1
-1
paddle/fluid/string/printf.h
paddle/fluid/string/printf.h
+2
-0
paddle/fluid/string/printf_test.cc
paddle/fluid/string/printf_test.cc
+3
-2
paddle/fluid/string/to_string_test.cc
paddle/fluid/string/to_string_test.cc
+3
-4
未找到文件。
paddle/fluid/string/piece.cc
浏览文件 @
30061d48
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// See the License for the specific language governing permissions and
// limitations under the License.
// limitations under the License.
#include "piece.h"
#include "p
addle/fluid/string/p
iece.h"
#include <string.h>
#include <string.h>
...
...
paddle/fluid/string/printf.h
浏览文件 @
30061d48
...
@@ -71,6 +71,8 @@
...
@@ -71,6 +71,8 @@
#include <iostream>
#include <iostream>
#include <sstream>
#include <sstream>
#include <string>
#include "tinyformat/tinyformat.h" // https://github.com/c42f/tinyformat
#include "tinyformat/tinyformat.h" // https://github.com/c42f/tinyformat
namespace
paddle
{
namespace
paddle
{
...
...
paddle/fluid/string/printf_test.cc
浏览文件 @
30061d48
...
@@ -11,7 +11,8 @@
...
@@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// See the License for the specific language governing permissions and
// limitations under the License.
// limitations under the License.
#include "printf.h"
#include "paddle/fluid/string/printf.h"
#include <string>
#include <string>
...
@@ -21,7 +22,7 @@ TEST(StringPrintf, StringPrintf) {
...
@@ -21,7 +22,7 @@ TEST(StringPrintf, StringPrintf) {
std
::
string
weekday
=
"Wednesday"
;
std
::
string
weekday
=
"Wednesday"
;
const
char
*
month
=
"July"
;
const
char
*
month
=
"July"
;
size_t
day
=
27
;
size_t
day
=
27
;
long
hour
=
14
;
int
hour
=
14
;
int
min
=
44
;
int
min
=
44
;
EXPECT_EQ
(
std
::
string
(
"Wednesday, July 27, 14:44"
),
EXPECT_EQ
(
std
::
string
(
"Wednesday, July 27, 14:44"
),
paddle
::
string
::
Sprintf
(
"%s, %s %d, %.2d:%.2d"
,
weekday
,
month
,
day
,
paddle
::
string
::
Sprintf
(
"%s, %s %d, %.2d:%.2d"
,
weekday
,
month
,
day
,
...
...
paddle/fluid/string/to_string_test.cc
浏览文件 @
30061d48
...
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
...
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
See the License for the specific language governing permissions and
limitations under the License. */
limitations under the License. */
#include "to_string.h"
#include "
paddle/fluid/string/
to_string.h"
#include <gtest/gtest.h>
#include <gtest/gtest.h>
constexpr
char
kOutputString
[]
=
"User Defined Output"
;
constexpr
char
kOutputString
[]
=
"User Defined Output"
;
...
@@ -26,14 +26,13 @@ std::ostream& operator<<(std::ostream& s, const UserDefinedClass& ins) {
...
@@ -26,14 +26,13 @@ std::ostream& operator<<(std::ostream& s, const UserDefinedClass& ins) {
}
}
TEST
(
to_string
,
normal
)
{
TEST
(
to_string
,
normal
)
{
using
namespace
paddle
::
string
;
using
paddle
::
string
::
to_
string
;
ASSERT_EQ
(
"10"
,
to_string
(
10
));
ASSERT_EQ
(
"10"
,
to_string
(
10
));
ASSERT_EQ
(
"abc"
,
to_string
(
"abc"
));
ASSERT_EQ
(
"abc"
,
to_string
(
"abc"
));
ASSERT_EQ
(
"1.2"
,
to_string
(
1.2
));
ASSERT_EQ
(
"1.2"
,
to_string
(
1.2
));
}
}
TEST
(
to_string
,
user_defined
)
{
TEST
(
to_string
,
user_defined
)
{
using
namespace
paddle
::
string
;
UserDefinedClass
instance
;
UserDefinedClass
instance
;
ASSERT_EQ
(
kOutputString
,
to_string
(
instance
));
ASSERT_EQ
(
kOutputString
,
paddle
::
string
::
to_string
(
instance
));
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录