mirror of
https://github.com/usatiuk/psil.git
synced 2025-10-28 10:47:49 +01:00
Fix log tags, change EXPECT_ to ASSERT_ in tests
This commit is contained in:
47
.idea/codeStyles/Project.xml
generated
47
.idea/codeStyles/Project.xml
generated
@@ -1,47 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<Objective-C-extensions>
|
||||
<rules>
|
||||
<rule entity="NAMESPACE" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
|
||||
<rule entity="MACRO" visibility="ANY" specifier="ANY" prefix="" style="SCREAMING_SNAKE_CASE" suffix="" />
|
||||
<rule entity="CLASS" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
|
||||
<rule entity="STRUCT" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
|
||||
<rule entity="ENUM" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
|
||||
<rule entity="ENUMERATOR" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
|
||||
<rule entity="TYPEDEF" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
|
||||
<rule entity="UNION" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
|
||||
<rule entity="CLASS_MEMBER_FUNCTION" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
|
||||
<rule entity="STRUCT_MEMBER_FUNCTION" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
|
||||
<rule entity="CLASS_MEMBER_FIELD" visibility="ANY" specifier="ANY" prefix="_" style="SNAKE_CASE" suffix="" />
|
||||
<rule entity="STRUCT_MEMBER_FIELD" visibility="ANY" specifier="ANY" prefix="_" style="SNAKE_CASE" suffix="" />
|
||||
<rule entity="GLOBAL_FUNCTION" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
|
||||
<rule entity="GLOBAL_VARIABLE" visibility="ANY" specifier="ANY" prefix="" style="SCREAMING_SNAKE_CASE" suffix="" />
|
||||
<rule entity="PARAMETER" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
|
||||
<rule entity="LOCAL_VARIABLE" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
|
||||
</rules>
|
||||
</Objective-C-extensions>
|
||||
<Objective-C-extensions>
|
||||
<rules>
|
||||
<rule entity="NAMESPACE" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
|
||||
<rule entity="MACRO" visibility="ANY" specifier="ANY" prefix="" style="SCREAMING_SNAKE_CASE" suffix="" />
|
||||
<rule entity="CLASS" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
|
||||
<rule entity="STRUCT" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
|
||||
<rule entity="ENUM" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
|
||||
<rule entity="ENUMERATOR" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
|
||||
<rule entity="TYPEDEF" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
|
||||
<rule entity="UNION" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
|
||||
<rule entity="CLASS_MEMBER_FUNCTION" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
|
||||
<rule entity="STRUCT_MEMBER_FUNCTION" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
|
||||
<rule entity="CLASS_MEMBER_FIELD" visibility="ANY" specifier="ANY" prefix="_" style="SNAKE_CASE" suffix="" />
|
||||
<rule entity="STRUCT_MEMBER_FIELD" visibility="ANY" specifier="ANY" prefix="_" style="SNAKE_CASE" suffix="" />
|
||||
<rule entity="GLOBAL_FUNCTION" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
|
||||
<rule entity="GLOBAL_VARIABLE" visibility="ANY" specifier="ANY" prefix="" style="SCREAMING_SNAKE_CASE" suffix="" />
|
||||
<rule entity="PARAMETER" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
|
||||
<rule entity="LOCAL_VARIABLE" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
|
||||
</rules>
|
||||
</Objective-C-extensions>
|
||||
<clangFormatSettings>
|
||||
<option name="ENABLED" value="true" />
|
||||
</clangFormatSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
3
.idea/misc.xml
generated
3
.idea/misc.xml
generated
@@ -1,5 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakePythonSetting">
|
||||
<option name="pythonIntegrationState" value="YES" />
|
||||
</component>
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
<component name="CidrRootsConfiguration">
|
||||
<excludeRoots>
|
||||
|
||||
@@ -14,14 +14,17 @@
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
class Logger {
|
||||
class Logger
|
||||
{
|
||||
public:
|
||||
Logger();
|
||||
|
||||
enum LogLevel { ALWAYS = 0, ERROR = 1, INFO = 2, DEBUG = 3, TRACE = 4 };
|
||||
|
||||
enum LogTag { MemoryContext, VM, Compiler, LogTagMax };
|
||||
static void log(LogTag tag, const std::string &what, int level);
|
||||
static void log(LogTag tag, const std::function<void(std::ostream &)> &fn, int level);
|
||||
|
||||
static void log(LogTag tag, const std::string& what, int level);
|
||||
static void log(LogTag tag, const std::function<void(std::ostream&)>& fn, int level);
|
||||
|
||||
// 0 - disabled
|
||||
// 1 - error
|
||||
@@ -32,14 +35,15 @@ public:
|
||||
static int get_level(LogTag tag);
|
||||
static bool en_level(LogTag tag, int level);
|
||||
|
||||
static void set_out(std::ostream &out);
|
||||
static void set_out_err(std::ostream &out_err);
|
||||
static void set_out(std::ostream& out);
|
||||
static void set_out_err(std::ostream& out_err);
|
||||
|
||||
static void reset();
|
||||
|
||||
static Logger &get();
|
||||
static Logger& get();
|
||||
|
||||
static LogTag str_to_tag(const std::string &str) { return _str_to_tag.at(str); }
|
||||
static LogTag str_to_tag(const std::string& str) { return _str_to_tag.at(str); }
|
||||
static const std::string& tag_to_str(LogTag tag) { return _tag_to_str.at(tag); }
|
||||
|
||||
private:
|
||||
std::array<LogLevel, LogTag::LogTagMax> _levels{};
|
||||
@@ -51,6 +55,12 @@ private:
|
||||
{"MemoryContext", MemoryContext},
|
||||
{"Compiler", Compiler},
|
||||
};
|
||||
static inline std::unordered_map<LogTag, std::string> _tag_to_str{
|
||||
{VM, "VM"},
|
||||
{MemoryContext, "MemoryContext"},
|
||||
{Compiler, "Compiler"},
|
||||
};
|
||||
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> _start_time = std::chrono::high_resolution_clock::now();
|
||||
std::reference_wrapper<std::ostream> _out = std::cout;
|
||||
std::reference_wrapper<std::ostream> _out_err = std::cerr;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <sstream>
|
||||
|
||||
#include "Options.h"
|
||||
|
||||
Logger &Logger::get() {
|
||||
static Logger logger;
|
||||
return logger;
|
||||
@@ -23,11 +24,10 @@ void Logger::log(LogTag tag, const std::string &what, int level) {
|
||||
std::chrono::duration_cast<std::chrono::milliseconds>(now - get()._start_time).count()) /
|
||||
1000.0
|
||||
<< "s]"
|
||||
<< "[" << tag << "][" << get()._level_names.at(level) << "] " << what << '\n';
|
||||
<< "[" << tag_to_str(tag) << "][" << get()._level_names.at(level) << "] " << what << '\n';
|
||||
|
||||
if (level == 1) get()._out_err.get() << out.str();
|
||||
else
|
||||
get()._out.get() << out.str();
|
||||
else get()._out.get() << out.str();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ TEST(CompilerTest, BasicHello) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "3\n");
|
||||
ASSERT_EQ(ssout.str(), "3\n");
|
||||
}
|
||||
|
||||
TEST(CompilerTest, BasicLet) {
|
||||
@@ -54,7 +54,7 @@ TEST(CompilerTest, BasicLet) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "1\n");
|
||||
ASSERT_EQ(ssout.str(), "1\n");
|
||||
}
|
||||
|
||||
TEST(CompilerTest, BasicFn) {
|
||||
@@ -69,7 +69,7 @@ TEST(CompilerTest, BasicFn) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "5\n");
|
||||
ASSERT_EQ(ssout.str(), "5\n");
|
||||
}
|
||||
|
||||
TEST(CompilerTest, BasicFn2) {
|
||||
@@ -84,7 +84,7 @@ TEST(CompilerTest, BasicFn2) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "-1\n");
|
||||
ASSERT_EQ(ssout.str(), "-1\n");
|
||||
}
|
||||
|
||||
TEST(CompilerTest, MultiLet) {
|
||||
@@ -109,7 +109,7 @@ TEST(CompilerTest, MultiLet) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "-1\n1\n");
|
||||
ASSERT_EQ(ssout.str(), "-1\n1\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -125,8 +125,9 @@ TEST(CompilerTest, BasicFnIfT) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "1\n");
|
||||
ASSERT_EQ(ssout.str(), "1\n");
|
||||
}
|
||||
|
||||
TEST(CompilerTest, BasicFnIfF) {
|
||||
std::stringstream ssin;
|
||||
std::stringstream ssout;
|
||||
@@ -139,8 +140,9 @@ TEST(CompilerTest, BasicFnIfF) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "2\n");
|
||||
ASSERT_EQ(ssout.str(), "2\n");
|
||||
}
|
||||
|
||||
TEST(CompilerTest, RecursiveFn) {
|
||||
std::stringstream ssin;
|
||||
std::stringstream ssout;
|
||||
@@ -154,7 +156,7 @@ TEST(CompilerTest, RecursiveFn) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "55\n");
|
||||
ASSERT_EQ(ssout.str(), "55\n");
|
||||
}
|
||||
|
||||
TEST(CompilerTest, GlobalDefine) {
|
||||
@@ -169,7 +171,7 @@ TEST(CompilerTest, GlobalDefine) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "1\n");
|
||||
ASSERT_EQ(ssout.str(), "1\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -185,7 +187,7 @@ TEST(CompilerTest, GlobalDefineFn) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "5\n");
|
||||
ASSERT_EQ(ssout.str(), "5\n");
|
||||
}
|
||||
|
||||
TEST(CompilerTest, GlobalDefineFnQuote) {
|
||||
@@ -200,7 +202,7 @@ TEST(CompilerTest, GlobalDefineFnQuote) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "(1 2)\n");
|
||||
ASSERT_EQ(ssout.str(), "(1 2)\n");
|
||||
}
|
||||
|
||||
TEST(CompilerTest, GlobalDefineFnCar) {
|
||||
@@ -216,7 +218,7 @@ TEST(CompilerTest, GlobalDefineFnCar) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "1\n2\n");
|
||||
ASSERT_EQ(ssout.str(), "1\n2\n");
|
||||
}
|
||||
|
||||
TEST(CompilerTest, GlobalDefineFnEq) {
|
||||
@@ -241,7 +243,7 @@ TEST(CompilerTest, GlobalDefineFnEq) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "1\n1\n1\n1\n");
|
||||
ASSERT_EQ(ssout.str(), "1\n1\n1\n1\n");
|
||||
}
|
||||
|
||||
TEST(CompilerTest, GlobalDefineFnMulti) {
|
||||
@@ -257,7 +259,7 @@ TEST(CompilerTest, GlobalDefineFnMulti) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "6\n");
|
||||
ASSERT_EQ(ssout.str(), "6\n");
|
||||
}
|
||||
|
||||
TEST(CompilerTest, GlobalDefineFnMultiTwo) {
|
||||
@@ -273,7 +275,7 @@ TEST(CompilerTest, GlobalDefineFnMultiTwo) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "0\n");
|
||||
ASSERT_EQ(ssout.str(), "0\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -293,5 +295,5 @@ TEST(CompilerTest, GlobalDefineFnRec) {
|
||||
Options::set<bool>("command_strs", true);
|
||||
Logger::set_level(Logger::VM, Logger::DEBUG);
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "6765\n");
|
||||
ASSERT_EQ(ssout.str(), "6765\n");
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "MemoryContext.h"
|
||||
|
||||
class Environment : public ::testing::Environment {
|
||||
public:
|
||||
~Environment() override {}
|
||||
@@ -30,26 +31,26 @@ TEST(GCTest, GCTest) {
|
||||
c.append(Handle::makeNumCell(1));
|
||||
c.append(Handle::makeNumCell(2));
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
EXPECT_EQ(c.car().val(), 1);
|
||||
EXPECT_EQ(c.cdr().car().val(), 2);
|
||||
ASSERT_EQ(c.car().val(), 1);
|
||||
ASSERT_EQ(c.cdr().car().val(), 2);
|
||||
}
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
EXPECT_EQ(MemoryContext::get().cell_count(), 0);
|
||||
ASSERT_EQ(MemoryContext::get().cell_count(), 0);
|
||||
{
|
||||
Handle c = Handle::cons(nullptr, nullptr);
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
c.push(Handle::makeNumCell(1));
|
||||
c.push(Handle::makeNumCell(2));
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
EXPECT_EQ(c.car().val(), 2);
|
||||
EXPECT_EQ(c.cdr().car().val(), 1);
|
||||
ASSERT_EQ(c.car().val(), 2);
|
||||
ASSERT_EQ(c.cdr().car().val(), 1);
|
||||
}
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
EXPECT_EQ(MemoryContext::get().cell_count(), 0);
|
||||
ASSERT_EQ(MemoryContext::get().cell_count(), 0);
|
||||
}
|
||||
|
||||
TEST(GCTest, GCTestAppend) {
|
||||
@@ -59,13 +60,14 @@ TEST(GCTest, GCTestAppend) {
|
||||
MemoryContext::get().request_gc();
|
||||
c.append(Handle::makeNumCell(1));
|
||||
MemoryContext::get().request_gc();
|
||||
EXPECT_EQ(c.car().val(), 1);
|
||||
ASSERT_EQ(c.car().val(), 1);
|
||||
}
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
EXPECT_EQ(MemoryContext::get().cell_count(), 0);
|
||||
ASSERT_EQ(MemoryContext::get().cell_count(), 0);
|
||||
}
|
||||
|
||||
TEST(GCTest, GCTestPop) {
|
||||
|
||||
{
|
||||
@@ -77,13 +79,13 @@ TEST(GCTest, GCTestPop) {
|
||||
}
|
||||
for (int i = test_size - 1; i >= 0; i--) {
|
||||
MemoryContext::get().request_gc();
|
||||
EXPECT_EQ(i, c.pop().val());
|
||||
ASSERT_EQ(i, c.pop().val());
|
||||
}
|
||||
}
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
EXPECT_EQ(MemoryContext::get().cell_count(), 0);
|
||||
ASSERT_EQ(MemoryContext::get().cell_count(), 0);
|
||||
}
|
||||
|
||||
TEST(GCTest, GCTestAppend2) {
|
||||
@@ -96,12 +98,12 @@ TEST(GCTest, GCTestAppend2) {
|
||||
}
|
||||
for (int i = 0; i < test_size; i++) {
|
||||
MemoryContext::get().request_gc();
|
||||
EXPECT_EQ(i, c.pop().val());
|
||||
ASSERT_EQ(i, c.pop().val());
|
||||
}
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
EXPECT_EQ(MemoryContext::get().cell_count(), 0);
|
||||
ASSERT_EQ(MemoryContext::get().cell_count(), 0);
|
||||
}
|
||||
|
||||
TEST(GCTest, GCTestAppend3) {
|
||||
@@ -114,11 +116,11 @@ TEST(GCTest, GCTestAppend3) {
|
||||
MemoryContext::get().request_gc();
|
||||
Handle n = c.cdr();
|
||||
c.setcdr(nullptr);
|
||||
EXPECT_EQ(n.car().val(), 2);
|
||||
EXPECT_EQ(c.car().val(), 1);
|
||||
ASSERT_EQ(n.car().val(), 2);
|
||||
ASSERT_EQ(c.car().val(), 1);
|
||||
}
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
EXPECT_EQ(MemoryContext::get().cell_count(), 0);
|
||||
ASSERT_EQ(MemoryContext::get().cell_count(), 0);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "Command.h"
|
||||
#include "VM.h"
|
||||
|
||||
class Environment : public ::testing::Environment {
|
||||
public:
|
||||
~Environment() override {}
|
||||
@@ -36,7 +37,7 @@ TEST(VMTest, BasicHello) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "h");
|
||||
ASSERT_EQ(ssout.str(), "h");
|
||||
}
|
||||
|
||||
//TODO: maybe rewrite it all...
|
||||
@@ -84,7 +85,7 @@ TEST(VMTest, BasicHello) {
|
||||
// vm.run();
|
||||
// }
|
||||
// ssout.flush();
|
||||
// EXPECT_EQ(ssout.str(), "14");
|
||||
// ASSERT_EQ(ssout.str(), "14");
|
||||
//}
|
||||
//
|
||||
//TEST(VMTest, SimpleFunction) {
|
||||
@@ -112,7 +113,7 @@ TEST(VMTest, BasicHello) {
|
||||
// vm.run();
|
||||
// }
|
||||
// ssout.flush();
|
||||
// EXPECT_EQ(ssout.str(), "3");
|
||||
// ASSERT_EQ(ssout.str(), "3");
|
||||
//}
|
||||
//
|
||||
//TEST(VMTest, RecursiveFunction) {
|
||||
@@ -257,5 +258,5 @@ TEST(VMTest, BasicHello) {
|
||||
//vm.run();
|
||||
//}
|
||||
//ssout.flush();
|
||||
//EXPECT_EQ(ssout.str(), "2358 55");
|
||||
//ASSERT_EQ(ssout.str(), "2358 55");
|
||||
//}
|
||||
@@ -33,7 +33,7 @@ TEST(VMWithParserTest, BasicHello) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "h");
|
||||
ASSERT_EQ(ssout.str(), "h");
|
||||
}
|
||||
|
||||
TEST(VMWithParserTest, BasicBranch) {
|
||||
@@ -49,7 +49,7 @@ TEST(VMWithParserTest, BasicBranch) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "1040");
|
||||
ASSERT_EQ(ssout.str(), "1040");
|
||||
}
|
||||
|
||||
TEST(VMWithParserTest, BasicFunction) {
|
||||
@@ -64,7 +64,7 @@ TEST(VMWithParserTest, BasicFunction) {
|
||||
vm.run();
|
||||
}
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "3");
|
||||
ASSERT_EQ(ssout.str(), "3");
|
||||
}
|
||||
|
||||
TEST(VMWithParserTest, RecFunction) {
|
||||
@@ -85,7 +85,7 @@ TEST(VMWithParserTest, RecFunction) {
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
MemoryContext::get().request_gc_and_wait();
|
||||
EXPECT_EQ(MemoryContext::get().cell_count(), 0);
|
||||
ASSERT_EQ(MemoryContext::get().cell_count(), 0);
|
||||
ssout.flush();
|
||||
EXPECT_EQ(ssout.str(), "6765");
|
||||
ASSERT_EQ(ssout.str(), "6765");
|
||||
}
|
||||
Reference in New Issue
Block a user