OSDN Git Service

refator & add LineInfoTests.cpp
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sun, 12 Mar 2023 00:16:14 +0000 (09:16 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sun, 12 Mar 2023 00:16:14 +0000 (09:16 +0900)
14 files changed:
Externals/crystaledit/editlib/LineInfo.cpp
Externals/crystaledit/editlib/LineInfo.h
Externals/crystaledit/editlib/SyntaxColors.cpp
Externals/crystaledit/editlib/UndoRecord.cpp
Externals/crystaledit/editlib/UndoRecord.h
Externals/crystaledit/editlib/ViewableWhitespace.cpp
Externals/crystaledit/editlib/ccrystaltextbuffer.cpp
Externals/crystaledit/editlib/editlib.vcxitems
Externals/crystaledit/editlib/utils/string_util.cpp
Externals/crystaledit/test/LineInfoTests.cpp [new file with mode: 0644]
Externals/crystaledit/test/UndoRecordTests.cpp [moved from Externals/crystaledit/test/undoRecordTests.cpp with 98% similarity]
Externals/crystaledit/test/stdafx.h
Externals/crystaledit/test/test.vcxproj
Externals/crystaledit/test/test.vcxproj.filters

index e8f732c..455ff03 100644 (file)
@@ -4,12 +4,10 @@
  * @brief Implementation of LineInfo class.
  */
 
-#include "stdafx.h"
+#include "pch.h"
 #include "LineInfo.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
+#include <cassert>
+#include <utility>
 
 /**
  @brief Constructor.
@@ -22,7 +20,66 @@ LineInfo::LineInfo()
 , m_dwFlags(0)
 , m_dwRevisionNumber(0)
 {
-};
+}
+
+LineInfo::LineInfo(const tchar_t* pszLine, size_t nLength)
+: m_pcLine(nullptr)
+, m_nLength(0)
+, m_nMax(0)
+, m_nEolChars(0)
+, m_dwFlags(0)
+, m_dwRevisionNumber(0)
+{
+  Create(pszLine, nLength);
+}
+
+LineInfo::LineInfo(const LineInfo& li)
+: m_pcLine(new tchar_t[li.m_nMax])
+, m_nLength(li.m_nLength)
+, m_nMax(li.m_nMax)
+, m_nEolChars(li.m_nEolChars)
+, m_dwFlags(li.m_dwFlags)
+, m_dwRevisionNumber(li.m_dwRevisionNumber)
+{
+  memcpy (m_pcLine, li.m_pcLine, sizeof (tchar_t) * m_nMax);
+}
+
+LineInfo::LineInfo(LineInfo&& li) noexcept
+: m_pcLine(nullptr)
+, m_nLength(0)
+{
+  *this = std::move(li);
+}
+
+LineInfo::~LineInfo()
+{
+  delete[] m_pcLine;
+}
+
+LineInfo& LineInfo::operator=(const LineInfo& li)
+{
+  m_pcLine = new tchar_t[li.m_nMax];
+  m_nLength = li.m_nLength;
+  m_nMax = li.m_nMax;
+  m_nEolChars = li.m_nEolChars;
+  m_dwFlags = li.m_dwFlags;
+  m_dwRevisionNumber = li.m_dwRevisionNumber;
+  memcpy (m_pcLine, li.m_pcLine, sizeof (tchar_t) * m_nMax);
+  return *this;
+}
+
+LineInfo& LineInfo::operator=(LineInfo&& li) noexcept
+{
+  m_pcLine = li.m_pcLine;
+  m_nLength = li.m_nLength;
+  m_nMax = li.m_nMax;
+  m_nEolChars = li.m_nEolChars;
+  m_dwFlags = li.m_dwFlags;
+  m_dwRevisionNumber = li.m_dwRevisionNumber;
+  li.m_pcLine = nullptr;
+  li.m_nLength = 0;
+  return *this;
+}
 
 /**
  * @brief Clear item.
@@ -71,17 +128,17 @@ void LineInfo::Create(const tchar_t* pszLine, size_t nLength)
       return;
     }
 
-  ASSERT (nLength <= INT_MAX);         // assert "positive int"
+  assert (nLength <= INT_MAX);         // assert "positive int"
   m_nLength = nLength;
   m_nMax = ALIGN_BUF_SIZE (m_nLength + 1);
-  ASSERT (m_nMax < INT_MAX);
-  ASSERT (m_nMax >= m_nLength + 1);
+  assert (m_nMax < INT_MAX);
+  assert (m_nMax >= m_nLength + 1);
   if (m_pcLine != nullptr)
     delete[] m_pcLine;
   m_pcLine = new tchar_t[m_nMax];
-  ZeroMemory(m_pcLine, m_nMax * sizeof(tchar_t));
+  memset(m_pcLine, 0, m_nMax * sizeof(tchar_t));
   const size_t dwLen = sizeof (tchar_t) * m_nLength;
-  CopyMemory (m_pcLine, pszLine, dwLen);
+  memcpy (m_pcLine, pszLine, dwLen);
   m_pcLine[m_nLength] = '\0';
 
   int nEols = 0;
@@ -89,7 +146,7 @@ void LineInfo::Create(const tchar_t* pszLine, size_t nLength)
     nEols = 2;
   else if (IsEol(pszLine[nLength - 1]))
     nEols = 1;
-  ASSERT (static_cast<size_t>(nEols) <= m_nLength);
+  assert (static_cast<size_t>(nEols) <= m_nLength);
   m_nLength -= nEols;
   m_nEolChars = nEols;
 }
@@ -104,7 +161,7 @@ void LineInfo::CreateEmpty()
   m_nMax = ALIGN_BUF_SIZE (m_nLength + 1);
   delete [] m_pcLine;
   m_pcLine = new tchar_t[m_nMax];
-  ZeroMemory(m_pcLine, m_nMax * sizeof(tchar_t));
+  memset (m_pcLine, 0, m_nMax * sizeof(tchar_t));
 }
 
 /**
@@ -114,13 +171,13 @@ void LineInfo::CreateEmpty()
  */
 void LineInfo::Append(const tchar_t* pszChars, size_t nLength, bool bDetectEol)
 {
-  ASSERT (nLength <= INT_MAX);         // assert "positive int"
+  assert (nLength <= INT_MAX);         // assert "positive int"
   size_t nBufNeeded = m_nLength + m_nEolChars + nLength + 1;
   if (nBufNeeded > m_nMax)
     {
       m_nMax = ALIGN_BUF_SIZE (nBufNeeded);
-      ASSERT (m_nMax < INT_MAX);
-      ASSERT (m_nMax >= m_nLength + nLength);
+      assert (m_nMax < INT_MAX);
+      assert (m_nMax >= m_nLength + nLength);
       tchar_t *pcNewBuf = new tchar_t[m_nMax];
       if (FullLength() > 0)
         memcpy (pcNewBuf, m_pcLine, sizeof (tchar_t) * (FullLength() + 1));
@@ -144,21 +201,9 @@ void LineInfo::Append(const tchar_t* pszChars, size_t nLength, bool bDetectEol)
       {
        m_nEolChars = 1;
       }
-   ASSERT (static_cast<size_t>(m_nEolChars) <= m_nLength);
+   assert (static_cast<size_t>(m_nEolChars) <= m_nLength);
    m_nLength -= m_nEolChars;
-   ASSERT (m_nLength + m_nEolChars <= m_nMax);
-}
-
-/**
- * @brief Has the line EOL?
- * @return true if the line has EOL bytes.
- */
-bool LineInfo::HasEol() const
-{
-  if (m_nEolChars)
-    return true;
-  else
-    return false;
+   assert (m_nLength + m_nEolChars <= m_nMax);
 }
 
 /**
@@ -188,11 +233,11 @@ bool LineInfo::ChangeEol(const tchar_t* lpEOL)
       return false;
 
   size_t nBufNeeded = m_nLength + nNewEolChars+1;
-  ASSERT (nBufNeeded < INT_MAX);
+  assert (nBufNeeded < INT_MAX);
   if (nBufNeeded > m_nMax)
     {
       m_nMax = ALIGN_BUF_SIZE (nBufNeeded);
-      ASSERT (m_nMax >= nBufNeeded);
+      assert (m_nMax >= nBufNeeded);
       tchar_t *pcNewBuf = new tchar_t[m_nMax];
       if (FullLength() > 0)
         memcpy (pcNewBuf, m_pcLine, sizeof (tchar_t) * (FullLength() + 1));
@@ -226,12 +271,12 @@ void LineInfo::Delete(size_t nStartChar, size_t nEndChar)
     }
   else
     {
-      ASSERT( (m_nLength + m_nEolChars) <= nDelete );
+      assert( (m_nLength + m_nEolChars) <= nDelete );
       nDelete -= m_nLength;
       m_nLength = 0;
       m_nEolChars -= static_cast<int>(nDelete);
     }
-  ASSERT (m_nLength <= INT_MAX);               // assert "positive int"
+  assert (m_nLength <= INT_MAX);               // assert "positive int"
   if (m_pcLine != nullptr)
     m_pcLine[FullLength()] = '\0';
 }
@@ -243,24 +288,13 @@ void LineInfo::Delete(size_t nStartChar, size_t nEndChar)
 void LineInfo::DeleteEnd(size_t nStartChar)
 {
   m_nLength = nStartChar;
-  ASSERT (m_nLength <= INT_MAX);               // assert "positive int"
+  assert (m_nLength <= INT_MAX);               // assert "positive int"
   if (m_pcLine != nullptr)
     m_pcLine[nStartChar] = 0;
   m_nEolChars = 0;
 }
 
 /**
- * @brief Copy contents from another LineInfo item.
- * @param [in] li Item to copy.
- */
-void LineInfo::CopyFrom(const LineInfo &li)
-{
-  delete [] m_pcLine;
-  m_pcLine = new tchar_t[li.m_nMax];
-  memcpy(m_pcLine, li.m_pcLine, li.m_nMax * sizeof(tchar_t));
-}
-
-/**
  * @brief Remove EOL from line.
  */
 void LineInfo::RemoveEol()
@@ -271,13 +305,3 @@ void LineInfo::RemoveEol()
     m_nEolChars = 0;
   }
 }
-
-/**
- * @brief Get line contents.
- * @param [in] index Index of first character to get.
- * @note Make a copy from returned string, as it can get reallocated.
- */
-const tchar_t* LineInfo::GetLine(size_t index) const
-{
-  return &m_pcLine[index];
-}
index 118a471..e7a0e9d 100644 (file)
@@ -8,6 +8,7 @@
 #pragma once
 
 #include "utils/ctchar.h"
+#include <cstdint>
 
 //  Line allocation granularity
 #define     CHAR_ALIGN                  16
@@ -26,6 +27,12 @@ public:
     uint32_t m_dwRevisionNumber; /**< Edit revision (for edit tracking). */
 
     LineInfo();
+    LineInfo(const tchar_t* pszLine, size_t nLength);
+    LineInfo(const LineInfo& li);
+    LineInfo(LineInfo&& li) noexcept;
+    LineInfo& operator=(const LineInfo& li);
+    LineInfo& operator=(LineInfo&& li) noexcept;
+    ~LineInfo();
     void Clear();
     void FreeBuffer();
     void Create(const tchar_t* pszLine, size_t nLength);
@@ -33,7 +40,6 @@ public:
     void Append(const tchar_t* pszChars, size_t nLength, bool bDetectEol = true);
     void Delete(size_t nStartChar, size_t nEndChar);
     void DeleteEnd(size_t nStartChar);
-    void CopyFrom(const LineInfo &li);
     bool HasEol() const;
     const tchar_t* GetEol() const;
     bool ChangeEol(const tchar_t* lpEOL);
@@ -63,3 +69,17 @@ private:
     size_t m_nLength; /**< Line length (without EOL bytes). */
     int m_nEolChars; /**< # of EOL bytes. */
   };
+
+/**
+ * @brief Has the line EOL?
+ * @return true if the line has EOL bytes.
+ */
+inline bool LineInfo::HasEol() const { return (m_nEolChars != 0); }
+
+
+/**
+ * @brief Get line contents.
+ * @param [in] index Index of first character to get.
+ * @note Make a copy from returned string, as it can get reallocated.
+ */
+inline const tchar_t* LineInfo::GetLine(size_t index) const { return &m_pcLine[index]; }
index 9d4d981..0f72019 100644 (file)
@@ -4,8 +4,9 @@
  * @brief Implementation for SyntaxColors class.
  */
 
-#include "StdAfx.h"
+#include "pch.h"
 #include "SyntaxColors.h"
+#include <Windows.h>
 
 /**
  * @brief Constructor, initialise with default colors.
index 6daefe8..7d401e1 100644 (file)
@@ -4,12 +4,9 @@
  * @brief Implementation of UndoRecord struct.
  */
 
-#include "stdafx.h"
+#include "pch.h"
 #include "UndoRecord.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
+#include <cassert>
 
 void UndoRecord::
 Clone(const UndoRecord &src)
@@ -33,7 +30,7 @@ SetText (const tchar_t* pszText, size_t nLength)
   FreeText();
   if (nLength != 1)
     {
-      ASSERT (nLength < INT_MAX);
+      assert (nLength < INT_MAX);
       m_pszText = reinterpret_cast<TextBuffer *>(malloc(sizeof(TextBuffer) + (nLength+2) * sizeof(tchar_t)));
       if (m_pszText != nullptr)
         {
index 7726269..f68caec 100644 (file)
 #include "cepoint.h"\r
 #include <vector>\r
 \r
+typedef uint32_t undoflags_t;\r
+\r
 class UndoRecord\r
 {\r
 public:\r
-  DWORD m_dwFlags;\r
+  undoflags_t m_dwFlags;\r
   CEPoint m_ptStartPos, m_ptEndPos;  //  Block of text participating\r
   int m_nAction;            //  For information only: action type\r
   std::vector<uint32_t> *m_paSavedRevisionNumbers;\r
index bd10c04..b0669ca 100644 (file)
@@ -4,7 +4,7 @@
  * @brief Repository of character tables used to display whitespace (when View/Whitespace enabled)
  */
 
-#include "StdAfx.h" 
+#include "pch.h" 
 #include "ViewableWhitespace.h"
 
 /** @brief Is structure initialized? */
@@ -60,8 +60,9 @@ static void initialize()
 }
 
 #else
+#include <map>
 // For ANSI build, there are various sets for different codepages
-static CMap<int, int, int, int> f_offset; // map codepage to offset
+static std::map<int, int> f_offset; // map codepage to offset
 
 // tab, space, cr, lf, eol
 /** @brief Structure for whitespace characters.
@@ -110,7 +111,7 @@ static void initialize()
        for (int i=0; i<sizeof(f_specialChars)/sizeof(f_specialChars[0]); ++i)
        {
                int codepage = f_specialChars[i].c_codepage;
-               f_offset[codepage] = i;
+               f_offset.insert(codepage, i);
        }
 
        f_initialized = true;
@@ -131,8 +132,7 @@ const ViewableWhitespaceChars * GetViewableWhitespaceChars(int codepage, bool di
        return &f_specialChars[directwrite ? 1 : 0];
 #else
        // Use the [0] version by default, if lookup fails to find a better one
-       int offset = 0;
-       f_offset.Lookup(codepage, offset);
+       int offset = f_offset[codepage];
        return &f_specialChars[offset];
 #endif
 }
index 637ae76..96085fc 100644 (file)
@@ -192,8 +192,7 @@ void CCrystalTextBuffer::InsertLine (const tchar_t* pszLine, size_t nLength,
 {
   ASSERT(nLength != -1);
 
-  LineInfo line;
-  line.Create(pszLine, nLength);
+  LineInfo line{ pszLine, nLength };
 
   // nPosition not defined ? Insert at end of array
   if (nPosition == -1)
@@ -206,9 +205,7 @@ void CCrystalTextBuffer::InsertLine (const tchar_t* pszLine, size_t nLength,
   // create text data for lines after the first one
   for (int ic = 1; ic < nCount; ic++)
     {
-      LineInfo li ;
-      li.Create(pszLine, nLength);
-      m_aLines[nPosition + ic] = li;
+      m_aLines[nPosition + ic] = std::move(LineInfo{ pszLine, nLength });
     }
 
 #ifdef _DEBUG
@@ -278,9 +275,7 @@ void CCrystalTextBuffer::SetEmptyLine (int nPosition, int nCount /*= 1*/ )
 {
   for (int i = 0; i < nCount; i++) 
     {
-      LineInfo li;
-      li.CreateEmpty();
-      m_aLines[nPosition + i] = li;
+      m_aLines[nPosition + i] = std::move(LineInfo{ nullptr, 0 });
     }
 }
 
@@ -2145,9 +2140,7 @@ void CCrystalTextBuffer::SplitLinesForTableEditingMode ()
             eols = 1;
           if (eols > 0)
             {
-              LineInfo lineInfo;
-              lineInfo.Create (pszChars + j + eols, nLineLength - (j + eols));
-              m_aLines.insert (m_aLines.begin () + i + 1, lineInfo);
+              m_aLines.emplace (m_aLines.begin () + i + 1, pszChars + j + eols, nLineLength - (j + eols));
               m_aLines[i].DeleteEnd (j + eols);
               m_aLines[i].m_dwRevisionNumber = 0;
             }
index a3af33a..74454cb 100644 (file)
     <ClCompile Include="$(MSBuildThisFileDirectory)dialogs\ctextmarkerdlg.cpp" />
     <ClCompile Include="$(MSBuildThisFileDirectory)dialogs\gotodlg.cpp" />
     <ClCompile Include="$(MSBuildThisFileDirectory)dialogs\memcombo.cpp" />
-    <ClCompile Include="$(MSBuildThisFileDirectory)LineInfo.cpp" />
+    <ClCompile Include="$(MSBuildThisFileDirectory)LineInfo.cpp">
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
+    </ClCompile>
     <ClCompile Include="$(MSBuildThisFileDirectory)parsers\abap.cpp">
       <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
       <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
     </ClCompile>
     <ClCompile Include="$(MSBuildThisFileDirectory)renderers\ccrystalrenderergdi.cpp" />
-    <ClCompile Include="$(MSBuildThisFileDirectory)SyntaxColors.cpp" />
-    <ClCompile Include="$(MSBuildThisFileDirectory)UndoRecord.cpp" />
+    <ClCompile Include="$(MSBuildThisFileDirectory)SyntaxColors.cpp">
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
+    </ClCompile>
+    <ClCompile Include="$(MSBuildThisFileDirectory)UndoRecord.cpp">
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
+    </ClCompile>
     <ClCompile Include="$(MSBuildThisFileDirectory)utils\cregexp.cpp" />
     <ClCompile Include="$(MSBuildThisFileDirectory)utils\cregexp_poco.cpp" />
     <ClCompile Include="$(MSBuildThisFileDirectory)utils\cs2cs.cpp" />
     <ClCompile Include="$(MSBuildThisFileDirectory)utils\icu.cpp" />
     <ClCompile Include="$(MSBuildThisFileDirectory)utils\registry.cpp" />
     <ClCompile Include="$(MSBuildThisFileDirectory)utils\string_util.cpp">
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
     </ClCompile>
     <ClCompile Include="$(MSBuildThisFileDirectory)utils\wcwidth.cpp" />
-    <ClCompile Include="$(MSBuildThisFileDirectory)ViewableWhitespace.cpp" />
+    <ClCompile Include="$(MSBuildThisFileDirectory)ViewableWhitespace.cpp">
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="$(MSBuildThisFileDirectory)ccrystaleditview.h" />
index a4e229f..4e408c0 100644 (file)
@@ -4,6 +4,7 @@
  * @brief Char classification routines implementations.
  */
 
+#include "pch.h"
 #include "string_util.h"
 
 static wint_t normch(wint_t c);
diff --git a/Externals/crystaledit/test/LineInfoTests.cpp b/Externals/crystaledit/test/LineInfoTests.cpp
new file mode 100644 (file)
index 0000000..5487cc6
--- /dev/null
@@ -0,0 +1,90 @@
+// Copyright (c) 2023 Takashi Sawanaka
+// SPDX-License-Identifier: BSL-1.0
+#include "pch.h"
+#include "CppUnitTest.h"
+#include "../editlib/LineInfo.h"
+
+using namespace Microsoft::VisualStudio::CppUnitTestFramework;
+
+namespace test
+{
+       TEST_CLASS(LineInfoTests)
+       {
+       public:
+               TEST_METHOD(Test1)
+               {
+                       LineInfo li{ _T("AB"), 2 };
+                       Assert::AreEqual(_T("AB"), li.GetLine());
+                       Assert::AreEqual(static_cast<size_t>(2), li.Length());
+                       Assert::AreEqual(nullptr, li.GetEol());
+                       Assert::IsFalse( li.HasEol());
+
+                       li.Append(_T("0123456789"), 10);
+                       Assert::AreEqual(_T("AB0123456789"), li.GetLine());
+                       Assert::AreEqual(static_cast<size_t>(12), li.Length());
+                       Assert::AreEqual(nullptr, li.GetEol());
+                       Assert::IsFalse( li.HasEol());
+
+                       li.Append(_T("0123456789\r\n"), 12);
+                       Assert::AreEqual(_T("AB01234567890123456789\r\n"), li.GetLine());
+                       Assert::AreEqual(static_cast<size_t>(22), li.Length());
+                       Assert::AreEqual(_T("\r\n"), li.GetEol());
+                       Assert::IsTrue( li.HasEol());
+
+                       li.DeleteEnd(2);
+                       Assert::AreEqual(_T("AB"), li.GetLine());
+                       Assert::AreEqual(static_cast<size_t>(2), li.Length());
+                       Assert::AreEqual(nullptr, li.GetEol());
+                       Assert::IsFalse( li.HasEol());
+
+                       li.ChangeEol(_T("\n"));
+                       Assert::AreEqual(_T("AB\n"), li.GetLine());
+                       Assert::AreEqual(_T("\n"), li.GetEol());
+                       Assert::IsTrue( li.HasEol());
+
+                       li.ChangeEol(_T(""));
+                       Assert::AreEqual(_T("AB"), li.GetLine());
+                       Assert::AreEqual(nullptr, li.GetEol());
+                       Assert::IsFalse( li.HasEol());
+
+               }
+
+               TEST_METHOD(Test2)
+               {
+                       LineInfo li;
+                       li.CreateEmpty();
+                       Assert::AreEqual(_T(""), li.GetLine());
+                       Assert::AreEqual(static_cast<size_t>(0), li.Length());
+                       Assert::AreEqual(nullptr, li.GetEol());
+                       Assert::IsFalse( li.HasEol());
+
+                       li.Append(_T("0123456789"), 10);
+                       Assert::AreEqual(_T("0123456789"), li.GetLine());
+                       Assert::AreEqual(static_cast<size_t>(10), li.Length());
+                       Assert::AreEqual(nullptr, li.GetEol());
+                       Assert::IsFalse( li.HasEol());
+
+                       li.Delete(3, 5);
+                       Assert::AreEqual(_T("01256789"), li.GetLine());
+                       Assert::AreEqual(static_cast<size_t>(8), li.Length());
+                       Assert::AreEqual(nullptr, li.GetEol());
+                       Assert::IsFalse( li.HasEol());
+
+                       li.Delete(0, 8);
+                       Assert::AreEqual(_T(""), li.GetLine());
+                       Assert::AreEqual(static_cast<size_t>(0), li.Length());
+                       Assert::AreEqual(nullptr, li.GetEol());
+                       Assert::IsFalse( li.HasEol());
+               }
+
+               TEST_METHOD(Test3)
+               {
+                       LineInfo li;
+                       li.Create(_T("ABC\r"), 4);
+                       Assert::AreEqual(_T("ABC\r"), li.GetLine());
+                       Assert::AreEqual(static_cast<size_t>(3), li.Length());
+                       Assert::AreEqual(_T("\r"), li.GetEol());
+                       Assert::IsTrue( li.HasEol());
+               }
+       };
+}
@@ -1,6 +1,6 @@
 // Copyright (c) 2023 Takashi Sawanaka
 // SPDX-License-Identifier: BSL-1.0
-#include "stdafx.h"
+#include "pch.h"
 #include "CppUnitTest.h"
 #include "../editlib/UndoRecord.h"
 
index 630f7b1..3b3c991 100644 (file)
@@ -13,4 +13,3 @@
 // TODO: reference additional headers your program requires here\r
 #define _AFXDLL\r
 #include <afxwin.h>         // MFC core and standard components\r
-#define ASSERT(x)\r
index f7dffda..c83e9b2 100644 (file)
       <AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <UseFullPaths>true</UseFullPaths>
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <UseFullPaths>true</UseFullPaths>
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <UseFullPaths>true</UseFullPaths>
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <UseFullPaths>true</UseFullPaths>
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <UseFullPaths>true</UseFullPaths>
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <UseFullPaths>true</UseFullPaths>
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <UseFullPaths>true</UseFullPaths>
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <UseFullPaths>true</UseFullPaths>
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClInclude Include="..\editlib\LineInfo.h" />
     <ClInclude Include="..\editlib\parsers\crystallineparser.h" />
     <ClInclude Include="..\editlib\string_util.h" />
     <ClInclude Include="..\editlib\SyntaxColors.h" />
+    <ClInclude Include="..\editlib\UndoRecord.h" />
     <ClInclude Include="pch.h" />
     <ClInclude Include="stdafx.h" />
     <ClInclude Include="targetver.h" />
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\editlib\parsers\asp.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\basic.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\batch.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\cplusplus.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\csharp.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\css.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\dcl.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\dlang.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\fortran.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\go.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\html.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\ini.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\innosetup.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\is.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\isx.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\java.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\javascript.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\lisp.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\lua.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\nsis.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\pascal.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\perl.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\php.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\plain.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\po.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\powershell.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\python.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\rexx.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\rsrc.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\ruby.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\rust.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\sgml.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\sh.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\siod.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\smarty.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\sql.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\tcl.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\tex.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\verilog.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\vhdl.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="..\editlib\parsers\xml.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
+    <ClCompile Include="..\editlib\LineInfo.cpp" />
+    <ClCompile Include="..\editlib\parsers\asp.cpp" />
+    <ClCompile Include="..\editlib\parsers\basic.cpp" />
+    <ClCompile Include="..\editlib\parsers\batch.cpp" />
+    <ClCompile Include="..\editlib\parsers\cplusplus.cpp" />
+    <ClCompile Include="..\editlib\parsers\csharp.cpp" />
+    <ClCompile Include="..\editlib\parsers\css.cpp" />
+    <ClCompile Include="..\editlib\parsers\dcl.cpp" />
+    <ClCompile Include="..\editlib\parsers\dlang.cpp" />
+    <ClCompile Include="..\editlib\parsers\fortran.cpp" />
+    <ClCompile Include="..\editlib\parsers\go.cpp" />
+    <ClCompile Include="..\editlib\parsers\html.cpp" />
+    <ClCompile Include="..\editlib\parsers\ini.cpp" />
+    <ClCompile Include="..\editlib\parsers\innosetup.cpp" />
+    <ClCompile Include="..\editlib\parsers\is.cpp" />
+    <ClCompile Include="..\editlib\parsers\isx.cpp" />
+    <ClCompile Include="..\editlib\parsers\java.cpp" />
+    <ClCompile Include="..\editlib\parsers\javascript.cpp" />
+    <ClCompile Include="..\editlib\parsers\lisp.cpp" />
+    <ClCompile Include="..\editlib\parsers\lua.cpp" />
+    <ClCompile Include="..\editlib\parsers\nsis.cpp" />
+    <ClCompile Include="..\editlib\parsers\pascal.cpp" />
+    <ClCompile Include="..\editlib\parsers\perl.cpp" />
+    <ClCompile Include="..\editlib\parsers\php.cpp" />
+    <ClCompile Include="..\editlib\parsers\plain.cpp" />
+    <ClCompile Include="..\editlib\parsers\po.cpp" />
+    <ClCompile Include="..\editlib\parsers\powershell.cpp" />
+    <ClCompile Include="..\editlib\parsers\python.cpp" />
+    <ClCompile Include="..\editlib\parsers\rexx.cpp" />
+    <ClCompile Include="..\editlib\parsers\rsrc.cpp" />
+    <ClCompile Include="..\editlib\parsers\ruby.cpp" />
+    <ClCompile Include="..\editlib\parsers\rust.cpp" />
+    <ClCompile Include="..\editlib\parsers\sgml.cpp" />
+    <ClCompile Include="..\editlib\parsers\sh.cpp" />
+    <ClCompile Include="..\editlib\parsers\siod.cpp" />
+    <ClCompile Include="..\editlib\parsers\smarty.cpp" />
+    <ClCompile Include="..\editlib\parsers\sql.cpp" />
+    <ClCompile Include="..\editlib\parsers\tcl.cpp" />
+    <ClCompile Include="..\editlib\parsers\tex.cpp" />
+    <ClCompile Include="..\editlib\parsers\verilog.cpp" />
+    <ClCompile Include="..\editlib\parsers\vhdl.cpp" />
+    <ClCompile Include="..\editlib\parsers\xml.cpp" />
     <ClCompile Include="..\editlib\UndoRecord.cpp" />
-    <ClCompile Include="..\editlib\utils\string_util.cpp">
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-    </ClCompile>
+    <ClCompile Include="..\editlib\utils\string_util.cpp" />
     <ClCompile Include="..\editlib\SyntaxColors.cpp" />
-    <ClCompile Include="batchTests.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-    <ClCompile Include="undoRecordTests.cpp" />
-    <ClCompile Include="htmlTests.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
+    <ClCompile Include="batchTests.cpp" />
+    <ClCompile Include="LineInfoTests.cpp" />
+    <ClCompile Include="UndoRecordTests.cpp" />
+    <ClCompile Include="htmlTests.cpp" />
     <ClCompile Include="pch.cpp">
       <PrecompiledHeader>Create</PrecompiledHeader>
       <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
     </ClCompile>
     <ClCompile Include="stdafx.cpp">
       <PrecompiledHeader>Create</PrecompiledHeader>
+      <PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
     </ClCompile>
-    <ClCompile Include="luaTests.cpp">
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName)2.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
+    <ClCompile Include="luaTests.cpp" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
index 04bdcb3..aa4fe65 100644 (file)
     <ClInclude Include="pch.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\editlib\UndoRecord.h">
+      <Filter>Source Files\editlib</Filter>
+    </ClInclude>
+    <ClInclude Include="..\editlib\LineInfo.h">
+      <Filter>Source Files\editlib</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="stdafx.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="luaTests.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="pch.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="undoRecordTests.cpp">
+    <ClCompile Include="UndoRecordTests.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\editlib\UndoRecord.cpp">
       <Filter>Source Files\editlib</Filter>
     </ClCompile>
+    <ClCompile Include="stdafx.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\editlib\LineInfo.cpp">
+      <Filter>Source Files\editlib</Filter>
+    </ClCompile>
+    <ClCompile Include="LineInfoTests.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file