Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F2730023
effects-communication.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Mar 13, 7:28 PM
Size
2 KB
Mime Type
text/x-c++
Expires
Sun, Mar 15, 7:28 PM (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
243295
Attached To
rXR Xreate
effects-communication.cpp
View Options
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*
* communication.cpp
*
* Author: pgess <v.melnychenko@xreate.org>
* Created on October 14, 2017, 5:24 PM
*/
#include "xreatemanager.h"
#include "supplemental/docutils.h"
#include "gtest/gtest.h"
using namespace xreate;
using namespace std;
TEST(Communication, ast_Basic1){
FILE* script = fopen("scripts/effects-communication/example1-wr.xreate", "r");
std::unique_ptr<XreateManager> program(XreateManager::prepare(script));
ASSERT_TRUE(true);
fclose(script);
}
TEST(Communication, analysis_Basic1){
FILE* script = fopen("scripts/effects-communication/example1-wr.xreate", "r");
std::unique_ptr<details::tier1::XreateManager> program(details::tier1::XreateManager::prepare(script));
fclose(script);
program->analyse();
ASSERT_TRUE(true);
}
TEST(Communication, full_Basic1){
FILE* script = fopen("scripts/effects-communication/example1-wr.xreate", "r");
std::unique_ptr<XreateManager> program(XreateManager::prepare(script));
fclose(script);
int (*programEntry)() = (int (*)())program->run();
int result = programEntry();
ASSERT_EQ(1, result);
}
TEST(Communication, full_Basic2){
FILE* script = fopen("scripts/effects-communication/example2-wr.xreate", "r");
std::unique_ptr<XreateManager> program(XreateManager::prepare(script));
fclose(script);
int (*programEntry)() = (int (*)())program->run();
int result = programEntry();
ASSERT_EQ(1, result);
}
TEST(Communication, analysis_Weak1){
FILE* script = fopen("scripts/effects-communication/example3-wrwr.xreate", "r");
std::unique_ptr<details::tier1::XreateManager> program(details::tier1::XreateManager::prepare(script));
fclose(script);
program->analyse();
ASSERT_TRUE(true);
}
TEST(Communication, full_Weak1){
FILE* script = fopen("scripts/effects-communication/example3-wrwr.xreate", "r");
std::unique_ptr<XreateManager> program(XreateManager::prepare(script));
fclose(script);
int (*programEntry)(int) = (int (*)(int))program->run();
ASSERT_EQ(1, programEntry(1));
ASSERT_EQ(-1, programEntry(0));
}
TEST(Communication, Doc_DirImpl){
string example = getDocumentationExampleById("documentation/communication.xml", "DirImpl_1");
XreateManager* xreate = XreateManager::prepare(move(example));
xreate->run();
}
TEST(Communication, Doc_GuardedImpl){
string example = getDocumentationExampleById("documentation/communication.xml", "GuardedImpl_1");
XreateManager* xreate = XreateManager::prepare(move(example));
xreate->run();
}
Event Timeline
Log In to Comment