Skip to content

Commit acf3309

Browse files
committed
Add test for abs()
Issue with #define in Python for _hypot
1 parent 01ced64 commit acf3309

4 files changed

Lines changed: 23 additions & 2 deletions

File tree

PythonScript/project/PythonScript2010.vcxproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
</PropertyGroup>
7676
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PythonDebug|Win32'">
7777
<LinkIncremental>true</LinkIncremental>
78-
<IncludePath>$(BoostBase);$(PythonBase)\Include;$(ProjectDir)..\..\NppPlugin\include;$(IncludePath)</IncludePath>
78+
<IncludePath>$(BoostBase);$(PythonBase)\Include;$(PythonBase)\PC;$(ProjectDir)..\..\NppPlugin\include;$(IncludePath)</IncludePath>
7979
<LibraryPath>$(BoostPythonLibPath);$(PythonLibPath);$(ProjectDir)..\..\NppPlugin\bin\debug;$(LibraryPath)</LibraryPath>
8080
<OutDir>$(SolutionDir)bin\$(Configuration)\</OutDir>
8181
<IntDir>$(Configuration)2\</IntDir>
@@ -223,6 +223,9 @@ xcopy $(ProjectDir)..\python_tests\*.* "e:\notepadtest\unicode\plugins\config\py
223223
<ClInclude Include="..\python_tests\tests\NotepadCallbackTestCase.py">
224224
<FileType>Document</FileType>
225225
</ClInclude>
226+
<None Include="..\python_tests\tests\MathTestCase.py">
227+
<FileType>CppHeader</FileType>
228+
</None>
226229
<None Include="..\python_tests\tests\ScintillaCallbackTestCase.py" />
227230
<ClInclude Include="..\python_tests\tests\ScintillaWrapperTestCase.py">
228231
<FileType>Document</FileType>

PythonScript/project/PythonScript2010.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
<Filter>PythonTests</Filter>
4848
</None>
4949
<None Include="..\python_tests\tests\ScintillaCallbackTestCase.py" />
50+
<None Include="..\python_tests\tests\MathTestCase.py">
51+
<Filter>PythonTests\Tests</Filter>
52+
</None>
5053
</ItemGroup>
5154
<ItemGroup>
5255
<ClCompile Include="..\src\PythonHandler.cpp">

PythonScript/project/PythonSettings.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<ImportGroup Label="PropertySheets" />
44
<PropertyGroup Label="UserMacros">
55
<BoostBase>E:\libs\boost_1_55_0</BoostBase>
6-
<PythonBase>E:\work\PythonGit\cpython</PythonBase>
6+
<PythonBase>l:\code\cpython</PythonBase>
77
<PythonLibPath>$(PythonBase)\PCbuild</PythonLibPath>
88
<BoostPythonLibPath>$(BoostBase)\stage\lib</BoostPythonLibPath>
99
<HtmlHelpBase>C:\Program Files (x86)\HTML Help Workshop</HtmlHelpBase>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# -*- coding: utf-8 -*-
2+
import unittest
3+
4+
class MathTestCase(unittest.TestCase):
5+
def setUp(self):
6+
pass
7+
8+
def tearDown(self):
9+
pass
10+
11+
def test_complex_abs(self):
12+
cplx = complex(-2, -1)
13+
self.assertAlmostEqual(abs(cplx), 2.236067977, places = 6)
14+
15+
suite = unittest.TestLoader().loadTestsFromTestCase(MathTestCase)

0 commit comments

Comments
 (0)