bfirsh / bfirsh/python-echoprint

Test failure on Windows

未关闭
#3 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C++
星标
28
派生
11
PR 合并指标
30 天内没有已合并 PR

描述

I've been able to compile echoprint extension with MSVC after these patches:

``` diff
diff --git a/echoprint.cpp b/echoprint.cpp
index 25a32f5..d9a4016 100644
--- a/echoprint.cpp
+++ b/echoprint.cpp
@@ -7,11 +7,11 @@ static PyObject * echoprint_codegen(PyObject *self, PyObject *args) {
int start_offset = 0;
PyObject *item;
float *samples;
- uint num_samples;
- uint i;
+ unsigned int num_samples;
+ unsigned int i;
Codegen *pCodegen;
PyObject *result;

```

``` diff
diff --git a/libcodegen/Codegen.h b/libcodegen/Codegen.h
index 5923d51..7c88327 100644
--- a/libcodegen/Codegen.h
+++ b/libcodegen/Codegen.h
@@ -13,17 +13,8 @@
#include
#include

-#ifdef _MSC_VER
- #ifdef CODEGEN_EXPORTS
- #define CODEGEN_API __declspec(dllexport)
- #pragma message("Exporting codegen.dll")
- #else
- #define CODEGEN_API __declspec(dllimport)
- #pragma message("Importing codegen.dll")
- #endif
-#else
- #define CODEGEN_API
-#endif
+#define CODEGEN_API __declspec(dllexport)
+#pragma message("Exporting codegen.dll")

class Fingerprint;
class SubbandAnalysis;
```

``` diff
diff --git a/setup.py b/setup.py
index 27f7643..11cfa0b 100644
--- a/setup.py
+++ b/setup.py
@@ -10,13 +10,12 @@ echoprint_ext = Extension(
'libcodegen/Codegen.cxx',
'libcodegen/Fingerprint.cxx',
'libcodegen/MatrixUtility.cxx',
- 'libcodegen/Metadata.cxx',
'libcodegen/SubbandAnalysis.cxx',
'libcodegen/Whitening.cxx',
'echoprint.cpp',
],
- include_dirs=['/usr/include/taglib', 'libcodegen'],
- libraries=['tag', 'z', 'pthread'],
+ include_dirs=['zlib-1.2.8', 'libcodegen'],
+ libraries=['zlib'],
)

```

However test fails:

```
======================================================================
FAIL: test_codegen (tests.EchoprintTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "D:\src\python-echoprint\tests.py", line 8, in test_codegen
self.assertEqual(d['code'], 'eJydz7sNAzAIRdGV-GPGiQHvP0KcypVdpDnNFUIPANDhAdWL963AC7T_YbrSnjJMocwJo7Qy5FAELdcqtpBt6Eu38I0r4MH7e-3iroTDooJAZO7LO2AWeszaBXyXt_anXgQlcBr_QIy12Qh')
AssertionError: 'eJyd0juuQyEMRdEp2cbYZjjgz_yHEKrHy1VCkWYVW0I6CAAAFX6G4sb9LMMNtBtMN3q_cV_V2g2U32n0FUusWpTsn0h1NukQooQjImVPwiSn-0PlsIm1pe33K9S06QOOgjw0Q7YNMEEW7U1vRvGhMzBqmpTi2B23KNkjBg83YEOblrz0Q5WwV5jmWUsXct65YES9_T3dsC-ryO8mnwCPfZ2qsC2_16H2QH7jzw0Q4vGHW94A==' != 'eJydz7sNAzAIRdGV-GPGiQHvP0KcypVdpDnNFUIPANDhAdWL963AC7T_YbrSnjJMocwJo7Qy5FAELdcqtpBt6Ezu38I04MH7e-3iroTDooJAZO7LO2AWeszaBXyXt_anXgQlcBr_QIy12Qh'

----------------------------------------------------------------------
Ran 1 test in 0.073s

FAILED (failures=1)
```

My compile generates signature with 245 characters, while test asserts equal signature with length of 145 characters.

Can someone point the reason for this failure?

Thanks

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start with tests.py and reproduce test_codegen on Windows using the reported setup.py configuration. Compare the generated signature with the expected value and inspect echoprint.cpp plus the listed libcodegen sources to identify the platform-dependent difference; done means the test passes with the intended signature on Windows.

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp, python
领域
build-system, testing
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。