This app provides monitoring and information features for the common freifunk user and the technical stuff of a freifunk community.
Code base is taken from a TUM Practical Course project and added here to see if Freifunk Altdorf can use it.
https://www.freifunk-altdorf.de
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.0 KiB
45 lines
1.0 KiB
6 years ago
|
// Copyright 2004-present Facebook. All Rights Reserved.
|
||
|
|
||
|
#include <gtest/gtest.h>
|
||
|
#include <cxxreact/JSCExecutor.h>
|
||
|
|
||
|
using namespace facebook;
|
||
|
using namespace facebook::react;
|
||
|
|
||
|
/*
|
||
|
static const char* expectedLogMessageSubstring = NULL;
|
||
|
static bool hasSeenExpectedLogMessage = false;
|
||
|
|
||
|
static void mockLogHandler(int pri, const char *tag, const char *msg) {
|
||
|
if (expectedLogMessageSubstring == NULL) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
hasSeenExpectedLogMessage |= (strstr(msg, expectedLogMessageSubstring) != NULL);
|
||
|
}
|
||
|
|
||
|
class JSCLoggingTest : public testing::Test {
|
||
|
protected:
|
||
|
virtual void SetUp() override {
|
||
|
setLogHandler(&mockLogHandler);
|
||
|
}
|
||
|
|
||
|
virtual void TearDown() override {
|
||
|
setLogHandler(NULL);
|
||
|
expectedLogMessageSubstring = NULL;
|
||
|
hasSeenExpectedLogMessage = false;
|
||
|
}
|
||
|
|
||
|
};
|
||
|
|
||
|
TEST_F(JSCLoggingTest, LogException) {
|
||
|
auto jsText = "throw new Error('I am a banana!');";
|
||
|
expectedLogMessageSubstring = "I am a banana!";
|
||
|
|
||
|
JSCExecutor e;
|
||
|
e.loadApplicationScript(jsText, "");
|
||
|
|
||
|
ASSERT_TRUE(hasSeenExpectedLogMessage);
|
||
|
}
|
||
|
*/
|