Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
9c9efb6b
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9c9efb6b
编写于
11月 11, 2009
作者:
A
Anthony Liguori
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add unit test for QFloat
Signed-off-by:
N
Anthony Liguori
<
aliguori@us.ibm.com
>
上级
ec072ced
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
83 addition
and
0 deletion
+83
-0
Makefile
Makefile
+1
-0
check-qfloat.c
check-qfloat.c
+81
-0
configure
configure
+1
-0
未找到文件。
Makefile
浏览文件 @
9c9efb6b
...
...
@@ -229,6 +229,7 @@ check-qint: check-qint.o qint.o qemu-malloc.o
check-qstring
:
check-qstring.o qstring.o qemu-malloc.o
check-qdict
:
check-qdict.o qdict.o qint.o qstring.o qemu-malloc.o
check-qlist
:
check-qlist.o qlist.o qint.o qemu-malloc.o
check-qfloat
:
check-qfloat.o qfloat.o qemu-malloc.o
clean
:
# avoid old build problems by removing potentially incorrect old files
...
...
check-qfloat.c
0 → 100644
浏览文件 @
9c9efb6b
/*
* QFloat unit-tests.
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* Copyright IBM, Corp. 2009
*
* Authors:
* Anthony Liguori <aliguori@us.ibm.com>
*
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
* See the COPYING.LIB file in the top-level directory.
*
*/
#include <check.h>
#include "qfloat.h"
#include "qemu-common.h"
/*
* Public Interface test-cases
*
* (with some violations to access 'private' data)
*/
START_TEST
(
qfloat_from_double_test
)
{
QFloat
*
qf
;
const
double
value
=
-
42
.
23423
;
qf
=
qfloat_from_double
(
value
);
fail_unless
(
qf
!=
NULL
);
fail_unless
(
qf
->
value
==
value
);
fail_unless
(
qf
->
base
.
refcnt
==
1
);
fail_unless
(
qobject_type
(
QOBJECT
(
qf
))
==
QTYPE_QFLOAT
);
// destroy doesn't exit yet
qemu_free
(
qf
);
}
END_TEST
START_TEST
(
qfloat_destroy_test
)
{
QFloat
*
qf
=
qfloat_from_double
(
0
.
0
);
QDECREF
(
qf
);
}
END_TEST
static
Suite
*
qfloat_suite
(
void
)
{
Suite
*
s
;
TCase
*
qfloat_public_tcase
;
s
=
suite_create
(
"QFloat test-suite"
);
qfloat_public_tcase
=
tcase_create
(
"Public Interface"
);
suite_add_tcase
(
s
,
qfloat_public_tcase
);
tcase_add_test
(
qfloat_public_tcase
,
qfloat_from_double_test
);
tcase_add_test
(
qfloat_public_tcase
,
qfloat_destroy_test
);
return
s
;
}
int
main
(
void
)
{
int
nf
;
Suite
*
s
;
SRunner
*
sr
;
s
=
qfloat_suite
();
sr
=
srunner_create
(
s
);
srunner_run_all
(
sr
,
CK_NORMAL
);
nf
=
srunner_ntests_failed
(
sr
);
srunner_free
(
sr
);
return
(
nf
==
0
)
?
EXIT_SUCCESS
:
EXIT_FAILURE
;
}
configure
浏览文件 @
9c9efb6b
...
...
@@ -2092,6 +2092,7 @@ if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
tools
=
"qemu-nbd
\$
(EXESUF) qemu-io
\$
(EXESUF)
$tools
"
if
[
"
$check_utests
"
=
"yes"
]
;
then
tools
=
"check-qint check-qstring check-qdict check-qlist
$tools
"
tools
=
"check-qfloat
$tools
"
fi
elif
test
"
$mingw32
"
=
"yes"
;
then
tools
=
"qemu-io
\$
(EXESUF)
$tools
"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录