Test failure on Windows
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- build-system, testing
Research direction
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.
Written by the indexing model from the issue text.
Description
I've been able to compile echoprint extension with MSVC after these patches:
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 --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 <string>
#include <vector>
-#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 --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
- Dominant language
- C++
- Stars
- 28
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bfirsh/python-echoprint
-
Difficulty 3/5 1-2 days Newbie friendliness 20/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 20/100
bfirsh/python-echoprint#2 · 3 comments ·
All issues in bfirsh/python-echoprint
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
duckdb/duckdb-wasm#2258 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
objectionary/eo-graphs#75 ·
-
Coarray integration tests carry no LABELS, so run_tests.py silently skips them under every backend Opencoarray
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
FISCO-BCOS/FISCO-BCOS#5642 ·